appthrust models.
Install with npm.
npm install @appthrust/appthrust@0.1.0
import { Project, IProject } from "@appthrust/appthrust/projects.appthrust.io/v1alpha1";
// Create a new Project
const project = new Project({
metadata: {
name: "my-project",
},
spec: {
displayName: "My Project",
description: "This is my first project",
template: "nodejs",
},
});
// Validate against JSON schema
project.validate();
// Get the raw JSON representation
const json = project.toJSON();
// Create a new instance from JSON
const anotherProject = new Project(json);
If you encounter issues with the token expiring when getting CRDs, you can clone the appthrust repository and specify the relative path to the CRD files instead.
- Clone the appthrust repository:
git clone https://github.com/appthrust/appthrust.git
- In your
package.json
, update thecrd-generate.input
field to point to the cloned CRD files. For example:
"crd-generate": {
"input": [
"../../appthrust/apps/project/crds/projects.appthrust.io.yaml"
],
"output": "./gen"
}
This way, the CRDs will be read from the cloned repository instead of the token URL.
MIT