@trayio/tray-schema 4.33.0 → 4.35.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.
@@ -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;IA2C1E,sBAAsB,CAAC,MAAM,EAAE,aAAa,GAAG,aAAa;CAiM5D"}
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;IA2C1E,sBAAsB,CAAC,MAAM,EAAE,aAAa,GAAG,aAAa;CA8L5D"}
@@ -84,13 +84,12 @@ class TJSTraySchemaGenerator {
84
84
  const unionTypes = [];
85
85
  let extras = {};
86
86
  if (object.oneOf) {
87
- object.oneOf.forEach((item) => {
88
- unionTypes.push(item.type);
89
- if (item.type === 'object') {
90
- extras = {
91
- ...extras,
92
- additionalProperties: true,
93
- };
87
+ object.oneOf?.forEach((item) => {
88
+ if (Array.isArray(item.type)) {
89
+ unionTypes.push(...item.type);
90
+ }
91
+ else {
92
+ unionTypes.push(item.type);
94
93
  }
95
94
  if (item.type === 'array') {
96
95
  extras = {
@@ -454,7 +454,6 @@ describe('TJSTraySchemaGenerator', () => {
454
454
  properties: {
455
455
  emails: {
456
456
  type: ['object', 'string'],
457
- additionalProperties: true,
458
457
  },
459
458
  workspaces: {
460
459
  type: ['array', 'string'],
@@ -464,9 +463,12 @@ describe('TJSTraySchemaGenerator', () => {
464
463
  type: ['array', 'string'],
465
464
  items: { type: 'number' },
466
465
  },
466
+ users: {
467
+ type: ['object', 'null', 'string', 'number', 'boolean'],
468
+ },
467
469
  },
468
470
  advanced: [],
469
- required: ['emails', 'projects', 'workspaces'],
471
+ required: ['emails', 'projects', 'users', 'workspaces'],
470
472
  additionalProperties: false,
471
473
  $schema: 'http://json-schema.org/draft-07/schema#',
472
474
  };
@@ -11,5 +11,9 @@ export type Input = {
11
11
  * @dropdown false
12
12
  */
13
13
  projects: string | number[];
14
+ /**
15
+ * @dropdown false
16
+ */
17
+ users: string | number | boolean | null | object;
14
18
  };
15
19
  //# sourceMappingURL=dropdown.test.data.d.ts.map
@@ -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;IAExB;;OAEG;IACH,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE9B;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC5B,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;IAE9B;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE5B;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,CAAC;CACjD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trayio/tray-schema",
3
- "version": "4.33.0",
3
+ "version": "4.35.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.33.0",
14
+ "@trayio/commons": "4.35.0",
15
15
  "@types/node": "18.11.9",
16
16
  "lodash": "4.17.21",
17
17
  "typescript-json-schema": "0.62.0"