@trayio/tray-schema 4.8.1 → 4.10.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 +5 -0
- package/dist/schema/TJSTraySchemaGenerator.unit.test.js +13 -2
- package/dist/schema/dropdown.test.data.d.ts +4 -0
- package/dist/schema/dropdown.test.data.d.ts.map +1 -1
- 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,EAAe,MAAM,cAAc,CAAC;AAEnD,OAAO,EAEN,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;IA2C1E,sBAAsB,CAAC,MAAM,EAAE,aAAa,GAAG,aAAa;
|
|
1
|
+
{"version":3,"file":"TJSTraySchemaGenerator.d.ts","sourceRoot":"","sources":["../../src/schema/TJSTraySchemaGenerator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAe,MAAM,cAAc,CAAC;AAEnD,OAAO,EAEN,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;IA2C1E,sBAAsB,CAAC,MAAM,EAAE,aAAa,GAAG,aAAa;CAqK5D"}
|
|
@@ -83,6 +83,11 @@ class TJSTraySchemaGenerator {
|
|
|
83
83
|
if (object.dropdown === false) {
|
|
84
84
|
const unionTypes = [];
|
|
85
85
|
object.oneOf.forEach((item) => {
|
|
86
|
+
if (item.type === 'array' ||
|
|
87
|
+
item.type === 'object') {
|
|
88
|
+
unionTypes.push(item);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
86
91
|
const types = Array.isArray(item.type)
|
|
87
92
|
? item.type
|
|
88
93
|
: [item.type];
|
|
@@ -478,11 +478,22 @@ describe('TJSTraySchemaGenerator', () => {
|
|
|
478
478
|
type: 'object',
|
|
479
479
|
properties: {
|
|
480
480
|
emails: {
|
|
481
|
-
type: [
|
|
481
|
+
type: [
|
|
482
|
+
{
|
|
483
|
+
type: 'object',
|
|
484
|
+
properties: {},
|
|
485
|
+
additionalProperties: true,
|
|
486
|
+
advanced: [],
|
|
487
|
+
},
|
|
488
|
+
'string',
|
|
489
|
+
],
|
|
490
|
+
},
|
|
491
|
+
workspaces: {
|
|
492
|
+
type: [{ type: 'array', items: { type: 'string' } }, 'string'],
|
|
482
493
|
},
|
|
483
494
|
},
|
|
484
495
|
advanced: [],
|
|
485
|
-
required: ['emails'],
|
|
496
|
+
required: ['emails', 'workspaces'],
|
|
486
497
|
additionalProperties: false,
|
|
487
498
|
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
488
499
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.test.data.d.ts","sourceRoot":"","sources":["../../src/schema/dropdown.test.data.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG;IACnB;;OAEG;IACH,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"dropdown.test.data.d.ts","sourceRoot":"","sources":["../../src/schema/dropdown.test.data.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG;IACnB;;OAEG;IACH,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IAExB;;OAEG;IACH,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC9B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trayio/tray-schema",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.10.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.10.0",
|
|
15
15
|
"@types/node": "18.11.9",
|
|
16
16
|
"lodash": "4.17.21",
|
|
17
17
|
"typescript-json-schema": "0.62.0"
|