@trayio/tray-openapi 4.47.0 → 4.49.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":"OpenApiSchemaImporter.d.ts","sourceRoot":"","sources":["../src/OpenApiSchemaImporter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AASvC,OAAO,EAAQ,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAGlE,OAAO,EAEN,sBAAsB,EAMtB,MAAM,0BAA0B,CAAC;AAalC,qBAAa,qBAAqB;IACrB,OAAO,CAAC,SAAS;IAAa,OAAO,CAAC,WAAW;gBAAzC,SAAS,EAAE,SAAS,EAAU,WAAW,EAAE,WAAW;IAE1E,cAAc,CACb,eAAe,EAAE,MAAM,EACvB,aAAa,EAAE,MAAM,GACnB,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,sBAAsB,CAAC;IAoD/C,OAAO,CAAC,yBAAyB;IAyDjC,OAAO,CAAC,eAAe;IAgBvB,OAAO,CAAC,cAAc;IAoCtB,OAAO,CAAC,oCAAoC;
|
|
1
|
+
{"version":3,"file":"OpenApiSchemaImporter.d.ts","sourceRoot":"","sources":["../src/OpenApiSchemaImporter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AASvC,OAAO,EAAQ,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAGlE,OAAO,EAEN,sBAAsB,EAMtB,MAAM,0BAA0B,CAAC;AAalC,qBAAa,qBAAqB;IACrB,OAAO,CAAC,SAAS;IAAa,OAAO,CAAC,WAAW;gBAAzC,SAAS,EAAE,SAAS,EAAU,WAAW,EAAE,WAAW;IAE1E,cAAc,CACb,eAAe,EAAE,MAAM,EACvB,aAAa,EAAE,MAAM,GACnB,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,sBAAsB,CAAC;IAoD/C,OAAO,CAAC,yBAAyB;IAyDjC,OAAO,CAAC,eAAe;IAgBvB,OAAO,CAAC,cAAc;IAoCtB,OAAO,CAAC,oCAAoC;IA2F5C,OAAO,CAAC,0BAA0B;IAwBlC,OAAO,CAAC,0BAA0B;CAclC"}
|
|
@@ -104,8 +104,11 @@ class OpenApiSchemaImporter {
|
|
|
104
104
|
generateHandlerFilesAndOperationJson(method, path, operationPath, baseUrl, httpPath, connectorName, input, output) {
|
|
105
105
|
const writeFile = (content, fileName) => this.fileStorage.write({
|
|
106
106
|
content: stream_1.Readable.from(content),
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
reference: {
|
|
108
|
+
_tag: 'FileDescriptor',
|
|
109
|
+
key: `${operationPath}/${fileName}`,
|
|
110
|
+
metadata: { name: fileName },
|
|
111
|
+
},
|
|
109
112
|
}, O.none);
|
|
110
113
|
const operationName = path.operationId;
|
|
111
114
|
const handleFileCreationError = (error, fileName) => (0, function_1.pipe)(writeFile('', fileName), TE.mapLeft(() => error));
|
|
@@ -38,8 +38,11 @@ describe('openApiSchemaImporter', () => {
|
|
|
38
38
|
const spec = 'test-openapi-spec.json';
|
|
39
39
|
beforeAll(async () => {
|
|
40
40
|
fileStorage.write({
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
reference: {
|
|
42
|
+
_tag: 'FileDescriptor',
|
|
43
|
+
key: `${__dirname}/${spec}`,
|
|
44
|
+
metadata: { name: spec },
|
|
45
|
+
},
|
|
43
46
|
content: stream_1.Readable.from(Buffer.from(JSON.stringify(openApiSpec))),
|
|
44
47
|
});
|
|
45
48
|
result = await openApiSchemaImporter.buildConnector(`${__dirname}/${spec}`, 'testConnector')();
|