@trayio/tray-schema 0.0.37 → 0.0.38
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/connector/operation/ConnectorOperationInputSchema.d.ts +11 -0
- package/dist/connector/operation/ConnectorOperationInputSchema.d.ts.map +1 -0
- package/dist/connector/operation/ConnectorOperationInputSchema.js +37 -0
- package/dist/connector/operation/ConnectorOperationInputSchema.test.d.ts +2 -0
- package/dist/connector/operation/ConnectorOperationInputSchema.test.d.ts.map +1 -0
- package/dist/connector/operation/ConnectorOperationInputSchema.test.js +32 -0
- package/dist/connector/operation/LegacyConnectorOperationInputSchema.d.ts +4 -0
- package/dist/connector/operation/LegacyConnectorOperationInputSchema.d.ts.map +1 -0
- package/dist/connector/operation/LegacyConnectorOperationInputSchema.js +2 -0
- package/package.json +3 -2
- package/dist/main.d.ts +0 -2
- package/dist/main.d.ts.map +0 -1
- package/dist/main.js +0 -7
|
@@ -0,0 +1,11 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectorOperationInputSchema.test.d.ts","sourceRoot":"","sources":["../../../src/connector/operation/ConnectorOperationInputSchema.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trayio/tray-schema",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.38",
|
|
4
4
|
"description": "Vanilla typescript code with extensions to the language or basic features",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./*": "./dist/*.js"
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"author": "Tray.io",
|
|
9
9
|
"license": "Proprietary",
|
|
10
10
|
"dependencies": {
|
|
11
|
+
"@trayio/tray-commons": "0.0.38",
|
|
11
12
|
"@types/node": "*"
|
|
12
13
|
},
|
|
13
14
|
"typesVersions": {
|
|
@@ -21,5 +22,5 @@
|
|
|
21
22
|
"files": [
|
|
22
23
|
"/dist"
|
|
23
24
|
],
|
|
24
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "89c5c7bfcd025257a058808a699148579096b39b"
|
|
25
26
|
}
|
package/dist/main.d.ts
DELETED
package/dist/main.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,UAAW,MAAM,SAEjC,CAAC"}
|