@trayio/cdk-build 5.35.0-unstable.fd7158a → 6.0.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/connector/ConnectorBuilder.d.ts +4 -4
- package/dist/connector/ConnectorBuilder.d.ts.map +1 -1
- package/dist/connector/ConnectorBuilder.js +54 -67
- package/dist/connector/operation/ConnectorOperationSchemaGenerator.d.ts +2 -2
- package/dist/connector/operation/ConnectorOperationSchemaGenerator.d.ts.map +1 -1
- package/dist/connector/operation/ConnectorOperationSchemaGenerator.js +14 -32
- package/dist/connector/schemas/ConnectorJson.d.ts +4 -42
- package/dist/connector/schemas/ConnectorJson.d.ts.map +1 -1
- package/dist/connector/test.js +26 -3
- package/package.json +5 -5
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as TE from 'fp-ts/TaskEither';
|
|
2
2
|
export declare class ConnectorBuilder {
|
|
3
3
|
private operationSchemaGenerator;
|
|
4
|
-
buildConnector(cdkProjectPath: string):
|
|
5
|
-
generateSchemas(cdkProjectPath: string):
|
|
6
|
-
getOperations(cdkProjectPath: string):
|
|
4
|
+
buildConnector(cdkProjectPath: string): TE.TaskEither<Error, undefined>;
|
|
5
|
+
generateSchemas(cdkProjectPath: string): TE.TaskEither<Error, undefined>;
|
|
6
|
+
getOperations(cdkProjectPath: string): TE.TaskEither<Error, string[]>;
|
|
7
7
|
private generatePackage;
|
|
8
8
|
private injectRawHttpOperation;
|
|
9
9
|
private injectGlobalConfigToCdkProjectPath;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectorBuilder.d.ts","sourceRoot":"","sources":["../../src/connector/ConnectorBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ConnectorBuilder.d.ts","sourceRoot":"","sources":["../../src/connector/ConnectorBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAcvC,qBAAa,gBAAgB;IAC5B,OAAO,CAAC,wBAAwB,CAA2C;IAE3E,cAAc,CAAC,cAAc,EAAE,MAAM,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC;IAQvE,eAAe,CAAC,cAAc,EAAE,MAAM,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC;IAgBxE,aAAa,CAAC,cAAc,EAAE,MAAM,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC;IAwBrE,OAAO,CAAC,eAAe;IAqFvB,OAAO,CAAC,sBAAsB;IAuC9B,OAAO,CAAC,kCAAkC;IAkB1C,OAAO,CAAC,gBAAgB;IAexB;;;OAGG;IACH,OAAO,CAAC,+BAA+B;CAqDvC"}
|
|
@@ -15,31 +15,24 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) ||
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
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
|
+
};
|
|
35
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
27
|
};
|
|
38
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
29
|
exports.ConnectorBuilder = void 0;
|
|
40
|
-
const
|
|
30
|
+
const TE = __importStar(require("fp-ts/TaskEither"));
|
|
31
|
+
const function_1 = require("fp-ts/function");
|
|
32
|
+
const Array_1 = require("fp-ts/Array");
|
|
41
33
|
const pathLib = __importStar(require("path"));
|
|
42
34
|
const fse = __importStar(require("fs-extra"));
|
|
35
|
+
const E = __importStar(require("fp-ts/Either"));
|
|
43
36
|
const adm_zip_1 = __importDefault(require("adm-zip"));
|
|
44
37
|
const lodash_1 = require("lodash");
|
|
45
38
|
const ZodSchemaParser_1 = require("@trayio/commons/zod/ZodSchemaParser");
|
|
@@ -49,17 +42,17 @@ const ConnectorJson_1 = require("./schemas/ConnectorJson");
|
|
|
49
42
|
class ConnectorBuilder {
|
|
50
43
|
operationSchemaGenerator = new ConnectorOperationSchemaGenerator_1.ConnectorOperationSchemaGenerator();
|
|
51
44
|
buildConnector(cdkProjectPath) {
|
|
52
|
-
return (0,
|
|
45
|
+
return (0, function_1.pipe)(this.validateDynamicOutputOperations(cdkProjectPath), TE.chain(() => this.generateSchemas(cdkProjectPath)), TE.chain(() => this.generatePackage(cdkProjectPath)));
|
|
53
46
|
}
|
|
54
47
|
generateSchemas(cdkProjectPath) {
|
|
55
|
-
return (0,
|
|
48
|
+
return (0, function_1.pipe)(this.getOperations(cdkProjectPath), TE.chain((operations) => (0, Array_1.traverse)(TE.ApplicativeSeq)((operation) => {
|
|
56
49
|
const operationPath = pathLib.join(cdkProjectPath, 'src', operation);
|
|
57
50
|
return this.operationSchemaGenerator.generateSchemasForOperation(operationPath, operation);
|
|
58
|
-
})(operations)),
|
|
51
|
+
})(operations)), TE.map(() => undefined));
|
|
59
52
|
}
|
|
60
53
|
getOperations(cdkProjectPath) {
|
|
61
54
|
const fileStorage = new NodeFsFileStorage_1.NodeFsFileStorage(cdkProjectPath);
|
|
62
|
-
return (0,
|
|
55
|
+
return (0, function_1.pipe)(fileStorage.readDirectory('src'), TE.map((filePaths) => filePaths
|
|
63
56
|
.filter((filePath) => filePath.isDirectory() &&
|
|
64
57
|
fse.existsSync(pathLib.join(`${cdkProjectPath}/src`, filePath.name, 'operation.json')))
|
|
65
58
|
.map((srcEntry) => srcEntry.name)));
|
|
@@ -73,32 +66,29 @@ class ConnectorBuilder {
|
|
|
73
66
|
const connectorJsonWithRawHttpConfig = this.addRawHttpConfig(connectorJson);
|
|
74
67
|
fse.writeJsonSync(connectorJsonPath, connectorJsonWithRawHttpConfig);
|
|
75
68
|
const connectorJsonResult = connectorJsonParser.parse(connectorJsonWithRawHttpConfig);
|
|
76
|
-
return (0,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
if (entry.entryName.endsWith('.ctx.json')) {
|
|
92
|
-
connectorPackage.deleteFile(entry.entryName);
|
|
93
|
-
}
|
|
69
|
+
return (0, function_1.pipe)(connectorJsonResult, E.fold((error) => TE.left(error), (connectorJsonParsed) => {
|
|
70
|
+
const connectorPackage = new adm_zip_1.default();
|
|
71
|
+
connectorPackage.addLocalFolder(pathLib.join(cdkProjectPath, 'src'), pathLib.join(connectorJsonParsed.name, 'src'));
|
|
72
|
+
const rawHttpOperationPath = pathLib.join(cdkProjectPath, 'src', 'raw_http_request');
|
|
73
|
+
const rawHttpExists = fse.existsSync(rawHttpOperationPath);
|
|
74
|
+
if (connectorJsonParsed.rawHttp.enabled &&
|
|
75
|
+
!rawHttpExists &&
|
|
76
|
+
!connectorJsonParsed.isTrigger) {
|
|
77
|
+
this.injectRawHttpOperation(connectorPackage, connectorJsonParsed.name, cdkProjectPath);
|
|
78
|
+
}
|
|
79
|
+
const entries = connectorPackage.getEntries();
|
|
80
|
+
// exclude all the ctx.json files from the zip as it can contain sensitive information
|
|
81
|
+
for (const entry of entries) {
|
|
82
|
+
if (entry.entryName.endsWith('.ctx.json')) {
|
|
83
|
+
connectorPackage.deleteFile(entry.entryName);
|
|
94
84
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
85
|
+
}
|
|
86
|
+
connectorPackage.addLocalFile(pathLib.join(cdkProjectPath, 'package.json'), connectorJsonParsed.name);
|
|
87
|
+
connectorPackage.addLocalFile(pathLib.join(cdkProjectPath, 'tsconfig.json'), connectorJsonParsed.name);
|
|
88
|
+
connectorPackage.addLocalFile(pathLib.join(cdkProjectPath, 'jest.config.js'), connectorJsonParsed.name);
|
|
89
|
+
connectorPackage.addLocalFile(pathLib.join(cdkProjectPath, 'connector.json'), connectorJsonParsed.name);
|
|
90
|
+
connectorPackage.writeZip(connectorPackagePath);
|
|
91
|
+
return TE.right(undefined);
|
|
102
92
|
}));
|
|
103
93
|
}
|
|
104
94
|
injectRawHttpOperation(connectorPackage, connectorName, cdkProjectPath) {
|
|
@@ -135,32 +125,29 @@ class ConnectorBuilder {
|
|
|
135
125
|
* Users must create these using: tray-cdk connector add-dynamic-output-schema <operation-name>
|
|
136
126
|
*/
|
|
137
127
|
validateDynamicOutputOperations(cdkProjectPath) {
|
|
138
|
-
return (0,
|
|
128
|
+
return (0, function_1.pipe)(this.getOperations(cdkProjectPath), TE.chain((operations) => (0, Array_1.traverse)(TE.ApplicativeSeq)((operation) => {
|
|
139
129
|
// Skip _output_schema operations themselves
|
|
140
130
|
if (operation.endsWith('_output_schema')) {
|
|
141
|
-
return
|
|
131
|
+
return TE.right(undefined);
|
|
142
132
|
}
|
|
143
133
|
const operationPath = pathLib.join(cdkProjectPath, 'src', operation);
|
|
144
134
|
const operationJsonPath = pathLib.join(operationPath, 'operation.json');
|
|
145
|
-
return
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
`Run: tray-cdk connector add-dynamic-output-schema ${operation}`);
|
|
156
|
-
}
|
|
157
|
-
console.log(`✓ Dynamic output schema operation found for: ${operation}`);
|
|
135
|
+
return TE.tryCatch(async () => {
|
|
136
|
+
// Read operation.json to check for dynamic_output flag
|
|
137
|
+
const operationJson = await fse.readJson(operationJsonPath);
|
|
138
|
+
if (operationJson.dynamic_output === true) {
|
|
139
|
+
// Validate that _output_schema operation exists
|
|
140
|
+
const outputSchemaOpName = `${operation}_output_schema`;
|
|
141
|
+
const outputSchemaOpPath = pathLib.join(cdkProjectPath, 'src', outputSchemaOpName);
|
|
142
|
+
if (!fse.existsSync(outputSchemaOpPath)) {
|
|
143
|
+
throw new Error(`Operation '${operation}' has dynamic_output: true but missing '${outputSchemaOpName}' operation.\n` +
|
|
144
|
+
`Run: tray-cdk connector add-dynamic-output-schema ${operation}`);
|
|
158
145
|
}
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
});
|
|
163
|
-
})(operations)),
|
|
146
|
+
console.log(`✓ Dynamic output schema operation found for: ${operation}`);
|
|
147
|
+
}
|
|
148
|
+
return undefined;
|
|
149
|
+
}, (reason) => new Error(String(reason)));
|
|
150
|
+
})(operations)), TE.map(() => undefined));
|
|
164
151
|
}
|
|
165
152
|
}
|
|
166
153
|
exports.ConnectorBuilder = ConnectorBuilder;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as TE from 'fp-ts/TaskEither';
|
|
2
2
|
export declare class ConnectorOperationSchemaGenerator {
|
|
3
|
-
generateSchemasForOperation(operationPath: string, operationName: string):
|
|
3
|
+
generateSchemasForOperation(operationPath: string, operationName: string): TE.TaskEither<Error, undefined>;
|
|
4
4
|
private generateSchema;
|
|
5
5
|
}
|
|
6
6
|
//# sourceMappingURL=ConnectorOperationSchemaGenerator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectorOperationSchemaGenerator.d.ts","sourceRoot":"","sources":["../../../src/connector/operation/ConnectorOperationSchemaGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ConnectorOperationSchemaGenerator.d.ts","sourceRoot":"","sources":["../../../src/connector/operation/ConnectorOperationSchemaGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AASvC,qBAAa,iCAAiC;IAC7C,2BAA2B,CAC1B,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,MAAM,GACnB,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC;IAiElC,OAAO,CAAC,cAAc;CAYtB"}
|
|
@@ -15,26 +15,17 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) ||
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
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
|
+
};
|
|
35
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
26
|
exports.ConnectorOperationSchemaGenerator = void 0;
|
|
37
|
-
const
|
|
27
|
+
const TE = __importStar(require("fp-ts/TaskEither"));
|
|
28
|
+
const function_1 = require("fp-ts/function");
|
|
38
29
|
const pathLib = __importStar(require("path"));
|
|
39
30
|
const StringExtensions_1 = require("@trayio/commons/string/StringExtensions");
|
|
40
31
|
const TJSTraySchemaGenerator_1 = require("@trayio/tray-schema/schema/TJSTraySchemaGenerator");
|
|
@@ -51,28 +42,19 @@ class ConnectorOperationSchemaGenerator {
|
|
|
51
42
|
const inputSchemaFilePath = pathLib.join(operationPath, 'input.json');
|
|
52
43
|
const outputSchemaFilePath = pathLib.join(operationPath, 'output.json');
|
|
53
44
|
const responseSchemaFilePath = pathLib.join(operationPath, 'response.json');
|
|
54
|
-
return (0,
|
|
55
|
-
try: () => fse.exists(inputFilePath),
|
|
56
|
-
catch: (reason) => new Error(String(reason)),
|
|
57
|
-
}), effect_1.Effect.flatMap(() => effect_1.Effect.tryPromise({
|
|
58
|
-
try: () => fse.exists(outputFilePath),
|
|
59
|
-
catch: (reason) => new Error(String(reason)),
|
|
60
|
-
})), effect_1.Effect.flatMap(() => {
|
|
45
|
+
return (0, function_1.pipe)(TE.tryCatch(() => fse.exists(inputFilePath), (reason) => new Error(String(reason))), TE.chain(() => TE.tryCatch(() => fse.exists(outputFilePath), (reason) => new Error(String(reason)))), TE.chain(() => {
|
|
61
46
|
console.log(`Generating types for operation: ${operationName}`); // TODO: Remove this and use a logger
|
|
62
47
|
return this.generateSchema(inputFilePath, inputTypeName, inputSchemaFilePath);
|
|
63
|
-
}),
|
|
64
|
-
try: () => fse.exists(responseFilePath),
|
|
65
|
-
catch: (reason) => new Error(String(reason)),
|
|
66
|
-
}), effect_1.Effect.flatMap((exists) => {
|
|
48
|
+
}), TE.chain(() => this.generateSchema(outputFilePath, outputTypeName, outputSchemaFilePath)), TE.chain(() => (0, function_1.pipe)(TE.tryCatch(() => fse.exists(responseFilePath), (reason) => new Error(String(reason))), TE.chain((exists) => {
|
|
67
49
|
if (exists) {
|
|
68
50
|
return this.generateSchema(responseFilePath, responseTypeName, responseSchemaFilePath);
|
|
69
51
|
}
|
|
70
|
-
return
|
|
71
|
-
}))),
|
|
52
|
+
return TE.right(undefined);
|
|
53
|
+
}))), TE.chain(() => TE.right(undefined)));
|
|
72
54
|
}
|
|
73
55
|
generateSchema(filePath, typeName, schemaFilePath) {
|
|
74
56
|
const schemaTransformer = new TJSTraySchemaGenerator_1.TJSTraySchemaGenerator();
|
|
75
|
-
return (0,
|
|
57
|
+
return (0, function_1.pipe)(TE.fromEither(schemaTransformer.generateFromType(typeName, filePath)), TE.chain((schema) => DynamicType_1.DynamicType.writeToFileAsync(schemaFilePath, schema)));
|
|
76
58
|
}
|
|
77
59
|
}
|
|
78
60
|
exports.ConnectorOperationSchemaGenerator = ConnectorOperationSchemaGenerator;
|
|
@@ -7,50 +7,12 @@ export declare const ConnectorJsonSchema: z.ZodObject<{
|
|
|
7
7
|
service: z.ZodObject<{
|
|
8
8
|
name: z.ZodString;
|
|
9
9
|
version: z.ZodString;
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
version: string;
|
|
13
|
-
}, {
|
|
14
|
-
name: string;
|
|
15
|
-
version: string;
|
|
16
|
-
}>;
|
|
17
|
-
tags: z.ZodArray<z.ZodString, "many">;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
tags: z.ZodArray<z.ZodString>;
|
|
18
12
|
isTrigger: z.ZodBoolean;
|
|
19
13
|
rawHttp: z.ZodObject<{
|
|
20
14
|
enabled: z.ZodBoolean;
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
}, {
|
|
24
|
-
enabled: boolean;
|
|
25
|
-
}>;
|
|
26
|
-
}, "strip", z.ZodTypeAny, {
|
|
27
|
-
name: string;
|
|
28
|
-
version: string;
|
|
29
|
-
title: string;
|
|
30
|
-
description: string;
|
|
31
|
-
service: {
|
|
32
|
-
name: string;
|
|
33
|
-
version: string;
|
|
34
|
-
};
|
|
35
|
-
tags: string[];
|
|
36
|
-
isTrigger: boolean;
|
|
37
|
-
rawHttp: {
|
|
38
|
-
enabled: boolean;
|
|
39
|
-
};
|
|
40
|
-
}, {
|
|
41
|
-
name: string;
|
|
42
|
-
version: string;
|
|
43
|
-
title: string;
|
|
44
|
-
description: string;
|
|
45
|
-
service: {
|
|
46
|
-
name: string;
|
|
47
|
-
version: string;
|
|
48
|
-
};
|
|
49
|
-
tags: string[];
|
|
50
|
-
isTrigger: boolean;
|
|
51
|
-
rawHttp: {
|
|
52
|
-
enabled: boolean;
|
|
53
|
-
};
|
|
54
|
-
}>;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
}, z.core.$strip>;
|
|
55
17
|
export type ConnectorJson = z.infer<typeof ConnectorJsonSchema>;
|
|
56
18
|
//# sourceMappingURL=ConnectorJson.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectorJson.d.ts","sourceRoot":"","sources":["../../../src/connector/schemas/ConnectorJson.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"ConnectorJson.d.ts","sourceRoot":"","sources":["../../../src/connector/schemas/ConnectorJson.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;iBAW9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
package/dist/connector/test.js
CHANGED
|
@@ -1,15 +1,38 @@
|
|
|
1
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
|
+
};
|
|
2
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
27
|
};
|
|
5
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
29
|
+
const E = __importStar(require("fp-ts/lib/Either"));
|
|
7
30
|
const chalk_1 = __importDefault(require("chalk"));
|
|
8
31
|
const ConnectorBuilder_1 = require("./ConnectorBuilder");
|
|
9
32
|
const connectorBuilder = new ConnectorBuilder_1.ConnectorBuilder();
|
|
10
33
|
const result = connectorBuilder.buildConnector('/Users/gnyani/projects/CDK-examples-public/name-change-test');
|
|
11
34
|
(async () => {
|
|
12
|
-
|
|
35
|
+
E.getOrElse((error) => {
|
|
13
36
|
console.log(chalk_1.default.bold(chalk_1.default.bgRed(error.message)));
|
|
14
|
-
})));
|
|
37
|
+
})(await result());
|
|
15
38
|
})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trayio/cdk-build",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "Build utilities for CDK projects",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./*": "./dist/*.js"
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
"access": "public"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@trayio/commons": "
|
|
18
|
-
"@trayio/tray-schema": "
|
|
17
|
+
"@trayio/commons": "6.0.0",
|
|
18
|
+
"@trayio/tray-schema": "6.0.0",
|
|
19
19
|
"adm-zip": "0.6.0",
|
|
20
20
|
"chalk": "4.1.2",
|
|
21
|
-
"
|
|
21
|
+
"fp-ts": "2.12.3",
|
|
22
22
|
"fs-extra": "11.3.4",
|
|
23
23
|
"lodash": "4.18.1",
|
|
24
|
-
"zod": "
|
|
24
|
+
"zod": "4.6.5"
|
|
25
25
|
},
|
|
26
26
|
"typesVersions": {
|
|
27
27
|
"*": {
|