@trayio/tray-schema 0.35.0 → 1.1.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.
Files changed (30) hide show
  1. package/dist/schema/TJSTraySchemaGenerator.d.ts +1 -1
  2. package/dist/schema/TJSTraySchemaGenerator.d.ts.map +1 -1
  3. package/dist/schema/TJSTraySchemaGenerator.js +19 -2
  4. package/dist/schema/TJSTraySchemaGenerator.unit.test.js +62 -3
  5. package/dist/schema/TraySchemaGenerator.d.ts +1 -1
  6. package/dist/schema/TraySchemaGenerator.d.ts.map +1 -1
  7. package/dist/schema/advanced.test.data.d.ts +14 -0
  8. package/dist/schema/advanced.test.data.d.ts.map +1 -0
  9. package/dist/schema/advanced.test.data.js +2 -0
  10. package/dist/schema/dataTypes.test.data.d.ts +1 -1
  11. package/dist/schema/dataTypes.test.data.d.ts.map +1 -1
  12. package/dist/schema/ddl.test.data.d.ts +1 -1
  13. package/dist/schema/ddl.test.data.d.ts.map +1 -1
  14. package/dist/schema/default.test.data.d.ts +1 -1
  15. package/dist/schema/default.test.data.d.ts.map +1 -1
  16. package/dist/schema/enum.test.data.d.ts +2 -2
  17. package/dist/schema/enum.test.data.d.ts.map +1 -1
  18. package/dist/schema/format.test.data.d.ts +1 -1
  19. package/dist/schema/format.test.data.d.ts.map +1 -1
  20. package/dist/schema/importsReusable.test.data.d.ts +2 -2
  21. package/dist/schema/importsReusable.test.data.d.ts.map +1 -1
  22. package/dist/schema/oneOf.test.data.d.ts +7 -7
  23. package/dist/schema/oneOf.test.data.d.ts.map +1 -1
  24. package/dist/schema/required.test.data.d.ts +1 -1
  25. package/dist/schema/required.test.data.d.ts.map +1 -1
  26. package/dist/schema/reusableField.test.data.d.ts +1 -1
  27. package/dist/schema/reusableField.test.data.d.ts.map +1 -1
  28. package/dist/schema/reusableSchema.test.data.d.ts +1 -1
  29. package/dist/schema/reusableSchema.test.data.d.ts.map +1 -1
  30. package/package.json +3 -3
@@ -1,6 +1,6 @@
1
1
  import * as TJS from 'typescript-json-schema';
2
2
  import { Either } from 'fp-ts/Either';
3
- import { DynamicObject } from '@trayio/tray-commons/dynamictype/DynamicType';
3
+ import { DynamicObject } from '@trayio/commons/dynamictype/DynamicType';
4
4
  import { TraySchemaGenerator } from './TraySchemaGenerator';
5
5
  export declare class TJSTraySchemaGenerator implements TraySchemaGenerator {
6
6
  generateFromType(type: string, path: string): Either<Error, DynamicObject>;
@@ -1 +1 @@
1
- {"version":3,"file":"TJSTraySchemaGenerator.d.ts","sourceRoot":"","sources":["../../src/schema/TJSTraySchemaGenerator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,GAAG,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAe,MAAM,cAAc,CAAC;AAEnD,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAC7E,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;IA2B1E,sBAAsB,CAAC,MAAM,EAAE,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC,UAAU;CAsF9D"}
1
+ {"version":3,"file":"TJSTraySchemaGenerator.d.ts","sourceRoot":"","sources":["../../src/schema/TJSTraySchemaGenerator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,GAAG,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAe,MAAM,cAAc,CAAC;AAEnD,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AACxE,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;IAgC1E,sBAAsB,CAAC,MAAM,EAAE,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC,UAAU;CAqG9D"}
@@ -34,7 +34,12 @@ class TJSTraySchemaGenerator {
34
34
  // this will prevent creating references in the schema when references are used in the types
35
35
  ref: false,
36
36
  // adds support for DDLs and more in the JSdoc annotations
37
- validationKeywords: ['lookupInput', 'lookupOperation', 'enumLabels'],
37
+ validationKeywords: [
38
+ 'lookupInput',
39
+ 'lookupOperation',
40
+ 'enumLabels',
41
+ 'advanced',
42
+ ],
38
43
  // adds a required array to every entitiy in the schema which describes which children are required
39
44
  required: true,
40
45
  // adds "additionalProperties: false" to the schemas
@@ -119,9 +124,21 @@ class TJSTraySchemaGenerator {
119
124
  delete object.allOf;
120
125
  }
121
126
  };
127
+ const transformAdvanced = (object) => {
128
+ if (Object.prototype.hasOwnProperty.call(object, 'properties') &&
129
+ object.properties !== null) {
130
+ object.advanced = [];
131
+ for (const [key, value] of Object.entries(object.properties)) {
132
+ if (value.advanced === true) {
133
+ object.advanced.push(key);
134
+ }
135
+ delete value.advanced;
136
+ }
137
+ }
138
+ };
122
139
  const recursiveObjectSearch = (object) => {
123
140
  transformAllOf(object);
124
- // eslint-disable-next-line no-restricted-syntax
141
+ transformAdvanced(object);
125
142
  for (const [key, value] of Object.entries(object)) {
126
143
  if (typeof value === 'object' && value !== null) {
127
144
  transformLookup(value);
@@ -43,12 +43,23 @@ describe('TJSTraySchemaGenerator', () => {
43
43
  num: { type: 'number' },
44
44
  int: { type: 'integer' },
45
45
  bool: { type: 'boolean' },
46
- obj: { type: 'object', properties: {}, additionalProperties: true },
46
+ obj: {
47
+ type: 'object',
48
+ properties: {},
49
+ advanced: [],
50
+ additionalProperties: true,
51
+ },
47
52
  arr: {
48
53
  type: 'array',
49
- items: { type: 'object', properties: {}, additionalProperties: true },
54
+ items: {
55
+ type: 'object',
56
+ properties: {},
57
+ advanced: [],
58
+ additionalProperties: true,
59
+ },
50
60
  },
51
61
  },
62
+ advanced: [],
52
63
  required: ['arr', 'bool', 'int', 'num', 'obj', 'str'],
53
64
  additionalProperties: false,
54
65
  $schema: 'http://json-schema.org/draft-07/schema#',
@@ -74,12 +85,14 @@ describe('TJSTraySchemaGenerator', () => {
74
85
  reusableFieldA: { type: 'number' },
75
86
  reusableFieldB: { type: 'string' },
76
87
  },
88
+ advanced: [],
77
89
  required: ['reusableFieldA', 'reusableFieldB'],
78
90
  additionalProperties: false,
79
91
  },
80
92
  reusableSchemaA: { type: 'number' },
81
93
  reusableSchemaB: { type: 'string' },
82
94
  },
95
+ advanced: [],
83
96
  required: [
84
97
  'reusableFields',
85
98
  'reusableSchemaA',
@@ -120,18 +133,21 @@ describe('TJSTraySchemaGenerator', () => {
120
133
  path: { type: 'string' },
121
134
  metadata: { type: 'string' },
122
135
  },
136
+ advanced: [],
123
137
  required: ['metadata', 'path'],
124
138
  additionalProperties: false,
125
139
  },
126
140
  {
127
141
  type: 'object',
128
142
  properties: { imgId: { type: 'number' } },
143
+ advanced: [],
129
144
  required: ['imgId'],
130
145
  additionalProperties: false,
131
146
  },
132
147
  ],
133
148
  },
134
149
  },
150
+ advanced: [],
135
151
  required: ['src'],
136
152
  additionalProperties: false,
137
153
  },
@@ -144,6 +160,7 @@ describe('TJSTraySchemaGenerator', () => {
144
160
  type: 'string',
145
161
  },
146
162
  },
163
+ advanced: [],
147
164
  required: ['msg'],
148
165
  additionalProperties: false,
149
166
  },
@@ -151,6 +168,7 @@ describe('TJSTraySchemaGenerator', () => {
151
168
  },
152
169
  },
153
170
  },
171
+ advanced: [],
154
172
  required: ['elements'],
155
173
  additionalProperties: false,
156
174
  $schema: 'http://json-schema.org/draft-07/schema#',
@@ -182,11 +200,13 @@ describe('TJSTraySchemaGenerator', () => {
182
200
  type: 'string',
183
201
  },
184
202
  },
203
+ advanced: [],
185
204
  required: ['text', 'type'],
186
205
  additionalProperties: false,
187
206
  },
188
207
  },
189
208
  },
209
+ advanced: [],
190
210
  required: ['actions'],
191
211
  additionalProperties: false,
192
212
  $schema: 'http://json-schema.org/draft-07/schema#',
@@ -216,6 +236,7 @@ describe('TJSTraySchemaGenerator', () => {
216
236
  },
217
237
  },
218
238
  },
239
+ advanced: [],
219
240
  required: ['emails'],
220
241
  additionalProperties: false,
221
242
  $schema: 'http://json-schema.org/draft-07/schema#',
@@ -237,6 +258,7 @@ describe('TJSTraySchemaGenerator', () => {
237
258
  mandatoryField: { type: 'string' },
238
259
  optionalField: { type: 'string' },
239
260
  },
261
+ advanced: [],
240
262
  required: ['mandatoryField'],
241
263
  additionalProperties: false,
242
264
  $schema: 'http://json-schema.org/draft-07/schema#',
@@ -261,6 +283,7 @@ describe('TJSTraySchemaGenerator', () => {
261
283
  password: { format: 'password', type: 'string' },
262
284
  file: { format: 'file', type: 'string' },
263
285
  },
286
+ advanced: [],
264
287
  required: ['file', 'html', 'longNotes', 'password', 'timestamp'],
265
288
  additionalProperties: false,
266
289
  $schema: 'http://json-schema.org/draft-07/schema#',
@@ -287,18 +310,54 @@ describe('TJSTraySchemaGenerator', () => {
287
310
  default: { default: true },
288
311
  type: 'object',
289
312
  properties: {},
313
+ advanced: [],
290
314
  additionalProperties: true,
291
315
  },
292
316
  arr: {
293
317
  default: ['default'],
294
318
  type: 'array',
295
- items: { type: 'object', properties: {}, additionalProperties: true },
319
+ items: {
320
+ type: 'object',
321
+ properties: {},
322
+ advanced: [],
323
+ additionalProperties: true,
324
+ },
296
325
  },
297
326
  },
327
+ advanced: [],
298
328
  required: ['arr', 'bool', 'int', 'num', 'obj', 'str'],
299
329
  additionalProperties: false,
300
330
  $schema: 'http://json-schema.org/draft-07/schema#',
301
331
  };
302
332
  expect(actual).toEqual(expected);
303
333
  });
334
+ it('Generates advanced fields array', () => {
335
+ const type = 'Input';
336
+ const dirPath = __dirname;
337
+ const path = (0, path_1.join)(dirPath, 'advanced.test.data.ts');
338
+ const result = new TJSTraySchemaGenerator_1.TJSTraySchemaGenerator().generateFromType(type, path);
339
+ const actual = E.getOrElse((error) => {
340
+ console.warn(error);
341
+ throw new Error(`Failed to generate JSON schema from type`);
342
+ })(result);
343
+ const expected = {
344
+ type: 'object',
345
+ properties: {
346
+ advancedField: { type: 'string' },
347
+ normalField: {
348
+ type: 'object',
349
+ properties: {
350
+ normalField: { type: 'string' },
351
+ advancedField: { type: 'string' },
352
+ },
353
+ advanced: ['advancedField'],
354
+ additionalProperties: false,
355
+ },
356
+ },
357
+ advanced: ['advancedField'],
358
+ additionalProperties: false,
359
+ $schema: 'http://json-schema.org/draft-07/schema#',
360
+ };
361
+ expect(actual).toEqual(expected);
362
+ });
304
363
  });
@@ -1,5 +1,5 @@
1
1
  import { Either } from 'fp-ts/lib/Either';
2
- import { DynamicObject } from '@trayio/tray-commons/dynamictype/DynamicType';
2
+ import { DynamicObject } from '@trayio/commons/dynamictype/DynamicType';
3
3
  export interface TraySchemaGenerator {
4
4
  generateFromType(type: string, path: string): Either<Error, DynamicObject>;
5
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TraySchemaGenerator.d.ts","sourceRoot":"","sources":["../../src/schema/TraySchemaGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAE7E,MAAM,WAAW,mBAAmB;IACnC,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;CAC3E"}
1
+ {"version":3,"file":"TraySchemaGenerator.d.ts","sourceRoot":"","sources":["../../src/schema/TraySchemaGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAExE,MAAM,WAAW,mBAAmB;IACnC,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;CAC3E"}
@@ -0,0 +1,14 @@
1
+ export type Input = {
2
+ /**
3
+ * @advanced true
4
+ */
5
+ advancedField?: string;
6
+ normalField?: {
7
+ /**
8
+ * @advanced true
9
+ */
10
+ advancedField?: string;
11
+ normalField?: string;
12
+ };
13
+ };
14
+ //# sourceMappingURL=advanced.test.data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"advanced.test.data.d.ts","sourceRoot":"","sources":["../../src/schema/advanced.test.data.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG;IACnB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE;QACb;;WAEG;QACH,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,WAAW,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;CACF,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,4 @@
1
- export declare type Input = {
1
+ export type Input = {
2
2
  str: string;
3
3
  num: number;
4
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"dataTypes.test.data.d.ts","sourceRoot":"","sources":["../../src/schema/dataTypes.test.data.ts"],"names":[],"mappings":"AAAA,oBAAY,KAAK,GAAG;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,EAAE,CAAC;CACd,CAAC"}
1
+ {"version":3,"file":"dataTypes.test.data.d.ts","sourceRoot":"","sources":["../../src/schema/dataTypes.test.data.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,EAAE,CAAC;CACd,CAAC"}
@@ -1,4 +1,4 @@
1
- export declare type Input = {
1
+ export type Input = {
2
2
  /**
3
3
  * @lookupOperation list_users_actual_ddl
4
4
  * @lookupInput {"include_private_channels": false,"workspace_id": "{{{workspace_id}}}"}
@@ -1 +1 @@
1
- {"version":3,"file":"ddl.test.data.d.ts","sourceRoot":"","sources":["../../src/schema/ddl.test.data.ts"],"names":[],"mappings":"AAAA,oBAAY,KAAK,GAAG;IACnB;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;CACf,CAAC"}
1
+ {"version":3,"file":"ddl.test.data.d.ts","sourceRoot":"","sources":["../../src/schema/ddl.test.data.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG;IACnB;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;CACf,CAAC"}
@@ -1,4 +1,4 @@
1
- export declare type Input = {
1
+ export type Input = {
2
2
  /**
3
3
  * @default string default
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"default.test.data.d.ts","sourceRoot":"","sources":["../../src/schema/default.test.data.ts"],"names":[],"mappings":"AAAA,oBAAY,KAAK,GAAG;IACnB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;IACd;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,GAAG,EAAE,MAAM,EAAE,CAAC;CACd,CAAC"}
1
+ {"version":3,"file":"default.test.data.d.ts","sourceRoot":"","sources":["../../src/schema/default.test.data.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG;IACnB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;IACd;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,GAAG,EAAE,MAAM,EAAE,CAAC;CACd,CAAC"}
@@ -1,10 +1,10 @@
1
- export declare type Input = {
1
+ export type Input = {
2
2
  /**
3
3
  * @description example dropdown
4
4
  */
5
5
  actions: Action[];
6
6
  };
7
- declare type Action = {
7
+ type Action = {
8
8
  text: string;
9
9
  type: ActionType;
10
10
  };
@@ -1 +1 @@
1
- {"version":3,"file":"enum.test.data.d.ts","sourceRoot":"","sources":["../../src/schema/enum.test.data.ts"],"names":[],"mappings":"AAAA,oBAAY,KAAK,GAAG;IACnB;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,aAAK,MAAM,GAAG;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,UAAU,CAAC;CACjB,CAAC;AAEF,aAAK,UAAU;IACd,OAAO,mBAAmB;IAC1B,MAAM,eAAe;IACrB,OAAO,gBAAgB;CACvB"}
1
+ {"version":3,"file":"enum.test.data.d.ts","sourceRoot":"","sources":["../../src/schema/enum.test.data.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG;IACnB;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,KAAK,MAAM,GAAG;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,UAAU,CAAC;CACjB,CAAC;AAEF,aAAK,UAAU;IACd,OAAO,mBAAmB;IAC1B,MAAM,eAAe;IACrB,OAAO,gBAAgB;CACvB"}
@@ -1,4 +1,4 @@
1
- export declare type Input = {
1
+ export type Input = {
2
2
  /**
3
3
  * @format datetime
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"format.test.data.d.ts","sourceRoot":"","sources":["../../src/schema/format.test.data.ts"],"names":[],"mappings":"AAAA,oBAAY,KAAK,GAAG;IACnB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACb,CAAC"}
1
+ {"version":3,"file":"format.test.data.d.ts","sourceRoot":"","sources":["../../src/schema/format.test.data.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG;IACnB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACb,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { ReusableField } from './reusableField.test.data';
2
2
  import { ReusableSchema } from './reusableSchema.test.data';
3
- export declare type Input = SpecificSchema & ReusableSchema;
4
- declare type SpecificSchema = {
3
+ export type Input = SpecificSchema & ReusableSchema;
4
+ type SpecificSchema = {
5
5
  specificField: string;
6
6
  reusableFields: ReusableField;
7
7
  };
@@ -1 +1 @@
1
- {"version":3,"file":"importsReusable.test.data.d.ts","sourceRoot":"","sources":["../../src/schema/importsReusable.test.data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,oBAAY,KAAK,GAAG,cAAc,GAAG,cAAc,CAAC;AAEpD,aAAK,cAAc,GAAG;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,aAAa,CAAC;CAC9B,CAAC"}
1
+ {"version":3,"file":"importsReusable.test.data.d.ts","sourceRoot":"","sources":["../../src/schema/importsReusable.test.data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,MAAM,MAAM,KAAK,GAAG,cAAc,GAAG,cAAc,CAAC;AAEpD,KAAK,cAAc,GAAG;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,aAAa,CAAC;CAC9B,CAAC"}
@@ -1,23 +1,23 @@
1
- declare type Src = {
1
+ type Src = {
2
2
  path: string;
3
3
  metadata: string;
4
4
  };
5
- declare type Id = {
5
+ type Id = {
6
6
  imgId: number;
7
7
  };
8
- declare type SrcOrId = Src | Id;
9
- declare type Image = {
8
+ type SrcOrId = Src | Id;
9
+ type Image = {
10
10
  src: SrcOrId;
11
11
  };
12
- declare type Text = {
12
+ type Text = {
13
13
  /**
14
14
  * @title myText
15
15
  * @description the text.
16
16
  */
17
17
  msg: string;
18
18
  };
19
- declare type ImageOrText = Image | Text;
20
- export declare type Input = {
19
+ type ImageOrText = Image | Text;
20
+ export type Input = {
21
21
  /**
22
22
  * @title Elements
23
23
  * @description Add images or text to the context. Maximum number of items is 10.
@@ -1 +1 @@
1
- {"version":3,"file":"oneOf.test.data.d.ts","sourceRoot":"","sources":["../../src/schema/oneOf.test.data.ts"],"names":[],"mappings":"AAAA,aAAK,GAAG,GAAG;IACV,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,aAAK,EAAE,GAAG;IACT,KAAK,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,aAAK,OAAO,GAAG,GAAG,GAAG,EAAE,CAAC;AAExB,aAAK,KAAK,GAAG;IACZ,GAAG,EAAE,OAAO,CAAC;CACb,CAAC;AAEF,aAAK,IAAI,GAAG;IACX;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,aAAK,WAAW,GAAG,KAAK,GAAG,IAAI,CAAC;AAEhC,oBAAY,KAAK,GAAG;IACnB;;;OAGG;IACH,QAAQ,EAAE,WAAW,EAAE,CAAC;CACxB,CAAC"}
1
+ {"version":3,"file":"oneOf.test.data.d.ts","sourceRoot":"","sources":["../../src/schema/oneOf.test.data.ts"],"names":[],"mappings":"AAAA,KAAK,GAAG,GAAG;IACV,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,KAAK,EAAE,GAAG;IACT,KAAK,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,KAAK,OAAO,GAAG,GAAG,GAAG,EAAE,CAAC;AAExB,KAAK,KAAK,GAAG;IACZ,GAAG,EAAE,OAAO,CAAC;CACb,CAAC;AAEF,KAAK,IAAI,GAAG;IACX;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,KAAK,WAAW,GAAG,KAAK,GAAG,IAAI,CAAC;AAEhC,MAAM,MAAM,KAAK,GAAG;IACnB;;;OAGG;IACH,QAAQ,EAAE,WAAW,EAAE,CAAC;CACxB,CAAC"}
@@ -1,4 +1,4 @@
1
- export declare type Input = {
1
+ export type Input = {
2
2
  mandatoryField: string;
3
3
  optionalField?: string;
4
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"required.test.data.d.ts","sourceRoot":"","sources":["../../src/schema/required.test.data.ts"],"names":[],"mappings":"AAAA,oBAAY,KAAK,GAAG;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC"}
1
+ {"version":3,"file":"required.test.data.d.ts","sourceRoot":"","sources":["../../src/schema/required.test.data.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC"}
@@ -1,4 +1,4 @@
1
- export declare type ReusableField = {
1
+ export type ReusableField = {
2
2
  reusableFieldA: number;
3
3
  reusableFieldB: string;
4
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"reusableField.test.data.d.ts","sourceRoot":"","sources":["../../src/schema/reusableField.test.data.ts"],"names":[],"mappings":"AAAA,oBAAY,aAAa,GAAG;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACvB,CAAC"}
1
+ {"version":3,"file":"reusableField.test.data.d.ts","sourceRoot":"","sources":["../../src/schema/reusableField.test.data.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACvB,CAAC"}
@@ -1,4 +1,4 @@
1
- export declare type ReusableSchema = {
1
+ export type ReusableSchema = {
2
2
  reusableSchemaA: number;
3
3
  reusableSchemaB: string;
4
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"reusableSchema.test.data.d.ts","sourceRoot":"","sources":["../../src/schema/reusableSchema.test.data.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc,GAAG;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;CACxB,CAAC"}
1
+ {"version":3,"file":"reusableSchema.test.data.d.ts","sourceRoot":"","sources":["../../src/schema/reusableSchema.test.data.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;CACxB,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@trayio/tray-schema",
3
- "version": "0.35.0",
4
- "description": "Vanilla typescript code with extensions to the language or basic features",
3
+ "version": "1.1.0",
4
+ "description": "Schema for Tray connectors and authentications",
5
5
  "exports": {
6
6
  "./*": "./dist/*.js"
7
7
  },
@@ -11,7 +11,7 @@
11
11
  "access": "public"
12
12
  },
13
13
  "dependencies": {
14
- "@trayio/tray-commons": "0.35.0",
14
+ "@trayio/commons": "1.1.0",
15
15
  "@types/node": "18.11.9",
16
16
  "lodash": "4.17.5",
17
17
  "typescript-json-schema": "0.61.0"