@soft-stech/flux-cd
Version:
402 lines (401 loc) • 14.5 kB
JavaScript
import { addSchema } from "@soft-stech/apimachinery/_schemas/IoK8sApimachineryPkgApisMetaV1ObjectMeta";
import { Model, setSchema, createTypeMetaGuard } from "@soft-stech/base";
import { register } from "@soft-stech/validate";
const schemaId = "source.toolkit.fluxcd.io.v1.GitRepository";
const schema = {
"type": "object",
"properties": {
"apiVersion": {
"type": "string",
"enum": [
"source.toolkit.fluxcd.io/v1"
]
},
"kind": {
"type": "string",
"enum": [
"GitRepository"
]
},
"metadata": {
"oneOf": [
{
"$ref": "io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta#"
},
{
"type": "null"
}
]
},
"spec": {
"properties": {
"ignore": {
"type": "string",
"nullable": true
},
"include": {
"items": {
"properties": {
"fromPath": {
"type": "string",
"nullable": true
},
"repository": {
"properties": {
"name": {
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"toPath": {
"type": "string",
"nullable": true
}
},
"required": [
"repository"
],
"type": "object"
},
"type": "array",
"nullable": true
},
"interval": {
"type": "string",
"pattern": "^([0-9]+(\\.[0-9]+)?(ms|s|m|h))+$"
},
"proxySecretRef": {
"properties": {
"name": {
"type": "string"
}
},
"required": [
"name"
],
"type": "object",
"nullable": true
},
"recurseSubmodules": {
"type": "boolean",
"nullable": true
},
"ref": {
"properties": {
"branch": {
"type": "string",
"nullable": true
},
"commit": {
"type": "string",
"nullable": true
},
"name": {
"type": "string",
"nullable": true
},
"semver": {
"type": "string",
"nullable": true
},
"tag": {
"type": "string",
"nullable": true
}
},
"type": "object",
"nullable": true
},
"secretRef": {
"properties": {
"name": {
"type": "string"
}
},
"required": [
"name"
],
"type": "object",
"nullable": true
},
"suspend": {
"type": "boolean",
"nullable": true
},
"timeout": {
"default": "60s",
"type": "string",
"pattern": "^([0-9]+(\\.[0-9]+)?(ms|s|m))+$",
"nullable": true
},
"url": {
"type": "string",
"pattern": "^(http|https|ssh):\\/\\/.*$"
},
"verify": {
"properties": {
"mode": {
"default": "HEAD",
"enum": [
"head",
"HEAD",
"Tag",
"TagAndHEAD"
],
"type": "string",
"nullable": true
},
"secretRef": {
"properties": {
"name": {
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
}
},
"required": [
"secretRef"
],
"type": "object",
"nullable": true
}
},
"required": [
"interval",
"url"
],
"type": "object",
"nullable": true
},
"status": {
"default": {
"observedGeneration": -1
},
"properties": {
"artifact": {
"properties": {
"digest": {
"type": "string",
"pattern": "^[a-z0-9]+(?:[.+_-][a-z0-9]+)*:[a-zA-Z0-9=_-]+$",
"nullable": true
},
"lastUpdateTime": {
"format": "date-time",
"type": "string"
},
"metadata": {
"additionalProperties": {
"type": "string"
},
"type": "object",
"properties": {},
"nullable": true
},
"path": {
"type": "string"
},
"revision": {
"type": "string"
},
"size": {
"format": "int64",
"type": "integer",
"nullable": true
},
"url": {
"type": "string"
}
},
"required": [
"lastUpdateTime",
"path",
"revision",
"url"
],
"type": "object",
"nullable": true
},
"conditions": {
"items": {
"properties": {
"lastTransitionTime": {
"format": "date-time",
"type": "string"
},
"message": {
"maxLength": 32768,
"type": "string"
},
"observedGeneration": {
"format": "int64",
"type": "integer",
"minimum": 0,
"nullable": true
},
"reason": {
"maxLength": 1024,
"minLength": 1,
"type": "string",
"pattern": "^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$"
},
"status": {
"enum": [
"True",
"False",
"Unknown"
],
"type": "string"
},
"type": {
"maxLength": 316,
"type": "string",
"pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\\/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$"
}
},
"required": [
"lastTransitionTime",
"message",
"reason",
"status",
"type"
],
"type": "object"
},
"type": "array",
"nullable": true
},
"includedArtifacts": {
"items": {
"properties": {
"digest": {
"type": "string",
"pattern": "^[a-z0-9]+(?:[.+_-][a-z0-9]+)*:[a-zA-Z0-9=_-]+$",
"nullable": true
},
"lastUpdateTime": {
"format": "date-time",
"type": "string"
},
"metadata": {
"additionalProperties": {
"type": "string"
},
"type": "object",
"properties": {},
"nullable": true
},
"path": {
"type": "string"
},
"revision": {
"type": "string"
},
"size": {
"format": "int64",
"type": "integer",
"nullable": true
},
"url": {
"type": "string"
}
},
"required": [
"lastUpdateTime",
"path",
"revision",
"url"
],
"type": "object"
},
"type": "array",
"nullable": true
},
"lastHandledReconcileAt": {
"type": "string",
"nullable": true
},
"observedGeneration": {
"format": "int64",
"type": "integer",
"nullable": true
},
"observedIgnore": {
"type": "string",
"nullable": true
},
"observedInclude": {
"items": {
"properties": {
"fromPath": {
"type": "string",
"nullable": true
},
"repository": {
"properties": {
"name": {
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"toPath": {
"type": "string",
"nullable": true
}
},
"required": [
"repository"
],
"type": "object"
},
"type": "array",
"nullable": true
},
"observedRecurseSubmodules": {
"type": "boolean",
"nullable": true
},
"sourceVerificationMode": {
"type": "string",
"nullable": true
}
},
"type": "object",
"nullable": true
}
},
"required": [
"apiVersion",
"kind"
]
};
/**
* GitRepository is the Schema for the gitrepositories API.
*/
export class GitRepository extends Model {
constructor(data) {
super({
apiVersion: GitRepository.apiVersion,
kind: GitRepository.kind,
...data
});
}
}
GitRepository.apiVersion = "source.toolkit.fluxcd.io/v1";
GitRepository.kind = "GitRepository";
GitRepository.is = createTypeMetaGuard(GitRepository);
setSchema(GitRepository, schemaId, () => {
addSchema();
register(schemaId, schema);
});