@nosana/schema-validator
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -129,4 +129,14 @@ (function (global, factory) { | ||
items: { | ||
type: "string", | ||
nullable: true | ||
type: "object", | ||
nullable: true, | ||
properties: { | ||
name: { | ||
type: "string", | ||
nullable: false | ||
}, | ||
path: { | ||
type: "string", | ||
nullable: false | ||
} | ||
} | ||
} | ||
@@ -133,0 +143,0 @@ }, |
@@ -1,1 +0,1 @@ | ||
!function(e,l){"object"==typeof exports&&"undefined"!=typeof module?l(exports,require("ajv"),require("yaml")):"function"==typeof define&&define.amd?define(["exports","ajv","yaml"],l):l((e="undefined"!=typeof globalThis?globalThis:e||self).validate_schema={},e.AJV,e.yaml)}(this,(function(e,l,t){"use strict";const n={type:"object",properties:{nosana:{type:"object",nullable:!1,properties:{description:{type:"string",nullable:!1,minLength:3,maxLength:255}}},global:{type:"object",nullable:!1,properties:{image:{type:"string",nullable:!0,minLength:1,maxLength:4096},trigger:{type:"object",nullable:!0,properties:{branch:{type:["array","string"],items:{type:"string"},nullable:!0,uniqueItems:!0}}},environment:{anyOf:[{type:"object",nullable:!0,additionalProperties:{type:"string"}},{type:"object",nullable:!0,properties:{type:{type:"string",nullable:!1},endpoint:{type:"string",nullable:!1},value:{type:"string",nullable:!1}}}]},allow_failure:{type:"boolean",nullable:!0}}},jobs:{type:"array",nullable:!1,items:{type:"object",nullable:!1,properties:{name:{type:"string",nullable:!1},image:{type:"string",nullable:!0,minLength:1,maxLength:4096},environment:{anyOf:[{type:"object",nullable:!0,additionalProperties:{type:"string"}},{type:"object",nullable:!0,properties:{type:{type:"string",nullable:!1},endpoint:{type:"string",nullable:!1},value:{type:"string",nullable:!1}}}]},allow_failure:{type:"boolean",nullable:!0},resources:{type:"array",nullable:!0,items:{type:"string",nullable:!0}},artifacts:{type:"array",nullable:!0,items:{type:"object",nullable:!0,properties:{name:{type:"string",nullable:!1},path:{type:"string",nullable:!1}}}},commands:{type:"array",nullable:!1,items:{anyOf:[{type:"string",nullable:!1},{type:"object",properties:{cmd:{type:"string",nullable:!1},working_dir:{type:"string",nullable:!0},allow_failure:{type:"boolean",nullable:!0},resources:{type:"string",nullable:!0},artifacts:{type:"array",nullable:!0,items:{type:"object",nullable:!0,properties:{name:{type:"string",nullable:!1},path:{type:"string",nullable:!1}}}}}}]}}}}}},required:["nosana","global","jobs"],additionalProperties:!1},a=new l({allErrors:!0,verbose:!0,allowUnionTypes:!0}),r=e=>{const l=JSON.parse(e),t=a.compile(n);return{valid:t(l),...t}};Object.defineProperty(e,"parseYaml",{enumerable:!0,get:function(){return t.parse}}),e.NosPipelineSchema=n,e.validateJson=r,e.validateYaml=e=>r(JSON.stringify(t.parse(e)))})); | ||
!function(e,l){"object"==typeof exports&&"undefined"!=typeof module?l(exports,require("ajv"),require("yaml")):"function"==typeof define&&define.amd?define(["exports","ajv","yaml"],l):l((e="undefined"!=typeof globalThis?globalThis:e||self).validate_schema={},e.AJV,e.yaml)}(this,(function(e,l,t){"use strict";const n={type:"object",properties:{nosana:{type:"object",nullable:!1,properties:{description:{type:"string",nullable:!1,minLength:3,maxLength:255}}},global:{type:"object",nullable:!1,properties:{image:{type:"string",nullable:!0,minLength:1,maxLength:4096},trigger:{type:"object",nullable:!0,properties:{branch:{type:["array","string"],items:{type:"string"},nullable:!0,uniqueItems:!0}}},environment:{anyOf:[{type:"object",nullable:!0,additionalProperties:{type:"string"}},{type:"object",nullable:!0,properties:{type:{type:"string",nullable:!1},endpoint:{type:"string",nullable:!1},value:{type:"string",nullable:!1}}}]},allow_failure:{type:"boolean",nullable:!0}}},jobs:{type:"array",nullable:!1,items:{type:"object",nullable:!1,properties:{name:{type:"string",nullable:!1},image:{type:"string",nullable:!0,minLength:1,maxLength:4096},environment:{anyOf:[{type:"object",nullable:!0,additionalProperties:{type:"string"}},{type:"object",nullable:!0,properties:{type:{type:"string",nullable:!1},endpoint:{type:"string",nullable:!1},value:{type:"string",nullable:!1}}}]},allow_failure:{type:"boolean",nullable:!0},resources:{type:"array",nullable:!0,items:{type:"object",nullable:!0,properties:{name:{type:"string",nullable:!1},path:{type:"string",nullable:!1}}}},artifacts:{type:"array",nullable:!0,items:{type:"object",nullable:!0,properties:{name:{type:"string",nullable:!1},path:{type:"string",nullable:!1}}}},commands:{type:"array",nullable:!1,items:{anyOf:[{type:"string",nullable:!1},{type:"object",properties:{cmd:{type:"string",nullable:!1},working_dir:{type:"string",nullable:!0},allow_failure:{type:"boolean",nullable:!0},resources:{type:"string",nullable:!0},artifacts:{type:"array",nullable:!0,items:{type:"object",nullable:!0,properties:{name:{type:"string",nullable:!1},path:{type:"string",nullable:!1}}}}}}]}}}}}},required:["nosana","global","jobs"],additionalProperties:!1},a=new l({allErrors:!0,verbose:!0,allowUnionTypes:!0}),r=e=>{const l=JSON.parse(e),t=a.compile(n);return{valid:t(l),...t}};Object.defineProperty(e,"parseYaml",{enumerable:!0,get:function(){return t.parse}}),e.NosPipelineSchema=n,e.validateJson=r,e.validateYaml=e=>r(JSON.stringify(t.parse(e)))})); |
@@ -123,4 +123,14 @@ export const NosPipelineSchema = { | ||
items: { | ||
type: "string", | ||
nullable: true | ||
type: "object", | ||
nullable: true, | ||
properties: { | ||
name: { | ||
type: "string", | ||
nullable: false | ||
}, | ||
path: { | ||
type: "string", | ||
nullable: false | ||
} | ||
} | ||
} | ||
@@ -127,0 +137,0 @@ }, |
@@ -10,3 +10,2 @@ { | ||
"@typescript-eslint/parser": "^5.46.0", | ||
"bun-types": "^0.2.0", | ||
"eslint": "^8.29.0", | ||
@@ -26,3 +25,3 @@ "jest": "^29.4.0", | ||
"description": "To install dependencies:", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"main": "dist/index.min.mjs", | ||
@@ -29,0 +28,0 @@ "module": "dist/index.min.mjs", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
44563
12
722