@trayio/tray-schema 4.63.0 → 4.65.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/schema/TJSTraySchemaGenerator.d.ts.map +1 -1
- package/dist/schema/TJSTraySchemaGenerator.js +1 -0
- package/dist/schema/TJSTraySchemaGenerator.unit.test.js +21 -0
- package/dist/schema/default_jsonpath.test.data.d.ts +7 -0
- package/dist/schema/default_jsonpath.test.data.d.ts.map +1 -0
- package/dist/schema/default_jsonpath.test.data.js +2 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TJSTraySchemaGenerator.d.ts","sourceRoot":"","sources":["../../src/schema/TJSTraySchemaGenerator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAQ,MAAM,cAAc,CAAC;AAE5C,OAAO,EACN,aAAa,EAEb,MAAM,yCAAyC,CAAC;AAEjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,qBAAa,sBAAuB,YAAW,mBAAmB;IACjE,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"TJSTraySchemaGenerator.d.ts","sourceRoot":"","sources":["../../src/schema/TJSTraySchemaGenerator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAQ,MAAM,cAAc,CAAC;AAE5C,OAAO,EACN,aAAa,EAEb,MAAM,yCAAyC,CAAC;AAEjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,qBAAa,sBAAuB,YAAW,mBAAmB;IACjE,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC;IA4C1E,sBAAsB,CAAC,MAAM,EAAE,aAAa,GAAG,aAAa;CA8L5D"}
|
|
@@ -385,6 +385,27 @@ describe('TJSTraySchemaGenerator', () => {
|
|
|
385
385
|
};
|
|
386
386
|
expect(actual).toEqual(expected);
|
|
387
387
|
});
|
|
388
|
+
it('Generates default_jsonpath properties from JSdoc annotations', () => {
|
|
389
|
+
const type = 'Input';
|
|
390
|
+
const dirPath = __dirname;
|
|
391
|
+
const path = (0, path_1.join)(dirPath, 'default_jsonpath.test.data.ts');
|
|
392
|
+
const result = new TJSTraySchemaGenerator_1.TJSTraySchemaGenerator().generateFromType(type, path);
|
|
393
|
+
const actual = E.getOrElse((error) => {
|
|
394
|
+
console.warn(error);
|
|
395
|
+
throw new Error(`Failed to generate JSON schema from type`);
|
|
396
|
+
})(result);
|
|
397
|
+
const expected = {
|
|
398
|
+
type: 'object',
|
|
399
|
+
properties: {
|
|
400
|
+
str: { default_jsonpath: '$env.foo', type: 'string' },
|
|
401
|
+
},
|
|
402
|
+
advanced: [],
|
|
403
|
+
required: ['str'],
|
|
404
|
+
additionalProperties: false,
|
|
405
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
406
|
+
};
|
|
407
|
+
expect(actual).toEqual(expected);
|
|
408
|
+
});
|
|
388
409
|
it('Generates advanced fields array', () => {
|
|
389
410
|
const type = 'Input';
|
|
390
411
|
const dirPath = __dirname;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default_jsonpath.test.data.d.ts","sourceRoot":"","sources":["../../src/schema/default_jsonpath.test.data.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG;IACnB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACZ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trayio/tray-schema",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.65.0",
|
|
4
4
|
"description": "Schema for Tray connectors and authentications",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./*": "./dist/*.js"
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@trayio/commons": "4.
|
|
14
|
+
"@trayio/commons": "4.65.0",
|
|
15
15
|
"@types/node": "18.11.9",
|
|
16
16
|
"lodash": "4.17.21",
|
|
17
17
|
"typescript-json-schema": "0.62.0"
|