@trayio/tray-schema 0.30.0 → 0.31.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/TJSTraySchemaTypeTransformer.d.ts.map +1 -1
- package/dist/schema/TJSTraySchemaTypeTransformer.js +1 -0
- package/package.json +5 -2
- package/dist/connector/operation/ConnectorOperationInputSchema.d.ts +0 -11
- package/dist/connector/operation/ConnectorOperationInputSchema.d.ts.map +0 -1
- package/dist/connector/operation/ConnectorOperationInputSchema.js +0 -37
- package/dist/connector/operation/ConnectorOperationInputSchema.test.d.ts +0 -2
- package/dist/connector/operation/ConnectorOperationInputSchema.test.d.ts.map +0 -1
- package/dist/connector/operation/ConnectorOperationInputSchema.test.js +0 -32
- package/dist/connector/operation/LegacyConnectorOperationInputSchema.d.ts +0 -4
- package/dist/connector/operation/LegacyConnectorOperationInputSchema.d.ts.map +0 -1
- package/dist/connector/operation/LegacyConnectorOperationInputSchema.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TJSTraySchemaTypeTransformer.d.ts","sourceRoot":"","sources":["../../src/schema/TJSTraySchemaTypeTransformer.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,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE,qBAAa,4BAA6B,YAAW,yBAAyB;IAC7E,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"TJSTraySchemaTypeTransformer.d.ts","sourceRoot":"","sources":["../../src/schema/TJSTraySchemaTypeTransformer.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,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE,qBAAa,4BAA6B,YAAW,yBAAyB;IAC7E,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC;IAyB3E,sBAAsB,CAAC,MAAM,EAAE,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC,UAAU;CAsF9D"}
|
|
@@ -40,6 +40,7 @@ class TJSTraySchemaTypeTransformer {
|
|
|
40
40
|
};
|
|
41
41
|
const compilerOptions = {
|
|
42
42
|
strictNullChecks: true,
|
|
43
|
+
esModuleInterop: true,
|
|
43
44
|
};
|
|
44
45
|
const program = TJS.getProgramFromFiles([(0, path_1.resolve)(path)], compilerOptions);
|
|
45
46
|
const schema = TJS.generateSchema(program, type, settings);
|
package/package.json
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trayio/tray-schema",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.0",
|
|
4
4
|
"description": "Vanilla typescript code with extensions to the language or basic features",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./*": "./dist/*.js"
|
|
7
7
|
},
|
|
8
8
|
"author": "Tray.io",
|
|
9
9
|
"license": "Proprietary",
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
10
13
|
"dependencies": {
|
|
11
|
-
"@trayio/tray-commons": "0.
|
|
14
|
+
"@trayio/tray-commons": "0.31.0",
|
|
12
15
|
"@types/node": "18.7.18",
|
|
13
16
|
"lodash": "4.17.5",
|
|
14
17
|
"typescript-json-schema": "0.61.0"
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as O from 'fp-ts/Option';
|
|
2
|
-
import { LegacyConnectorOperationInputSchema } from './LegacyConnectorOperationInputSchema';
|
|
3
|
-
export declare type ConnectorOperationInputSchema = {
|
|
4
|
-
$schema: string;
|
|
5
|
-
};
|
|
6
|
-
export interface ConnectorOperationInputSchemaInterface {
|
|
7
|
-
fromLegacySchema: (legacySchema: LegacyConnectorOperationInputSchema) => O.Option<ConnectorOperationInputSchema>;
|
|
8
|
-
toLegacy: (schema: ConnectorOperationInputSchema) => O.Option<LegacyConnectorOperationInputSchema>;
|
|
9
|
-
}
|
|
10
|
-
export declare const ConnectorOperationInputSchema: ConnectorOperationInputSchemaInterface;
|
|
11
|
-
//# sourceMappingURL=ConnectorOperationInputSchema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectorOperationInputSchema.d.ts","sourceRoot":"","sources":["../../../src/connector/operation/ConnectorOperationInputSchema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC;AAE5F,oBAAY,6BAA6B,GAAG;IAC3C,OAAO,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,WAAW,sCAAsC;IACtD,gBAAgB,EAAE,CACjB,YAAY,EAAE,mCAAmC,KAC7C,CAAC,CAAC,MAAM,CAAC,6BAA6B,CAAC,CAAC;IAC7C,QAAQ,EAAE,CACT,MAAM,EAAE,6BAA6B,KACjC,CAAC,CAAC,MAAM,CAAC,mCAAmC,CAAC,CAAC;CACnD;AAED,eAAO,MAAM,6BAA6B,EAAE,sCAqB1C,CAAC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.ConnectorOperationInputSchema = void 0;
|
|
27
|
-
const O = __importStar(require("fp-ts/Option"));
|
|
28
|
-
exports.ConnectorOperationInputSchema = {
|
|
29
|
-
fromLegacySchema: (legacySchema) => {
|
|
30
|
-
const result = Object.assign(Object.assign({}, legacySchema), { $schema: 'https://api.tray.io/core/v1/connectors/operations/input-schema#' });
|
|
31
|
-
return O.some(result);
|
|
32
|
-
},
|
|
33
|
-
toLegacy: (schema) => {
|
|
34
|
-
const result = Object.assign(Object.assign({}, schema), { $schema: 'http://json-schema.org/draft-04/schema#' });
|
|
35
|
-
return O.some(result);
|
|
36
|
-
},
|
|
37
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectorOperationInputSchema.test.d.ts","sourceRoot":"","sources":["../../../src/connector/operation/ConnectorOperationInputSchema.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const ConnectorOperationInputSchema_1 = require("./ConnectorOperationInputSchema");
|
|
4
|
-
const inputSchema = {
|
|
5
|
-
advanced: [],
|
|
6
|
-
additionalProperties: false,
|
|
7
|
-
type: 'object',
|
|
8
|
-
properties: {
|
|
9
|
-
text: {
|
|
10
|
-
type: 'string',
|
|
11
|
-
description: 'The content of the reminder',
|
|
12
|
-
title: 'Text',
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
required: [],
|
|
16
|
-
};
|
|
17
|
-
const capiSchema = Object.assign(Object.assign({}, inputSchema), { $schema: 'https://api.tray.io/core/v1/connectors/operations/input-schema#' });
|
|
18
|
-
const legacySchema = Object.assign(Object.assign({}, inputSchema), { $schema: 'http://json-schema.org/draft-04/schema#' });
|
|
19
|
-
describe('ConnectorOperationInputSchema', () => {
|
|
20
|
-
it('should convert CAPI schema to legacy schema', () => {
|
|
21
|
-
const result = ConnectorOperationInputSchema_1.ConnectorOperationInputSchema.toLegacy(capiSchema);
|
|
22
|
-
if (result._tag === 'Some') {
|
|
23
|
-
expect(result.value).toStrictEqual(legacySchema);
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
it('should convert legacy schema to CAPI schema', () => {
|
|
27
|
-
const result = ConnectorOperationInputSchema_1.ConnectorOperationInputSchema.fromLegacySchema(legacySchema);
|
|
28
|
-
if (result._tag === 'Some') {
|
|
29
|
-
expect(result.value).toStrictEqual(capiSchema);
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LegacyConnectorOperationInputSchema.d.ts","sourceRoot":"","sources":["../../../src/connector/operation/LegacyConnectorOperationInputSchema.ts"],"names":[],"mappings":"AAAA,oBAAY,mCAAmC,GAAG;IACjD,OAAO,EAAE,MAAM,CAAC;CAChB,CAAC"}
|