@trayio/cdk-runtime 4.46.0 → 4.48.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":"HttpOperationExecution.d.ts","sourceRoot":"","sources":["../../../src/connector/operation/HttpOperationExecution.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAOlC,OAAO,EACN,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EAGtB,oBAAoB,EACpB,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EAGN,oBAAoB,EAMpB,MAAM,0DAA0D,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAW7D,OAAO,EAAQ,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,2DAA2D,CAAC;AAGtG,OAAO,0BAA0B,MAAM,8BAA8B,CAAC;AAOtE,qBAAa,sBAAsB,CAClC,IAAI,SAAS,oBAAoB,CAAC,OAAO,EAAE,OAAO,CAAC,EACnD,EAAE,EACF,GAAG,CACF,SAAQ,0BAA0B,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC;IAClD,OAAO,CAAC,iBAAiB,CAAoB;IAC7C,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,OAAO,CAAsC;IACrD,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,mBAAmB,CAA4C;IACvE,WAAW,EAAE,oBAAoB,CAAC;gBAGjC,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,oBAAoB,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,EAC5C,mBAAmB,EAAE,CAAC,CAAC,MAAM,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAC,EAC9D,WAAW,EAAE,oBAAoB;IAW5B,OAAO,CACZ,GAAG,EAAE,uBAAuB,CAAC,IAAI,CAAC,EAClC,KAAK,EAAE,EAAE,GACP,OAAO,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC;IAuDvC,OAAO,CAAC,eAAe;IAkCvB,OAAO,CAAC,6BAA6B;IAiCrC,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,yBAAyB;IAajC,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,oBAAoB;
|
|
1
|
+
{"version":3,"file":"HttpOperationExecution.d.ts","sourceRoot":"","sources":["../../../src/connector/operation/HttpOperationExecution.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAOlC,OAAO,EACN,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EAGtB,oBAAoB,EACpB,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EAGN,oBAAoB,EAMpB,MAAM,0DAA0D,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAW7D,OAAO,EAAQ,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,2DAA2D,CAAC;AAGtG,OAAO,0BAA0B,MAAM,8BAA8B,CAAC;AAOtE,qBAAa,sBAAsB,CAClC,IAAI,SAAS,oBAAoB,CAAC,OAAO,EAAE,OAAO,CAAC,EACnD,EAAE,EACF,GAAG,CACF,SAAQ,0BAA0B,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC;IAClD,OAAO,CAAC,iBAAiB,CAAoB;IAC7C,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,OAAO,CAAsC;IACrD,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,mBAAmB,CAA4C;IACvE,WAAW,EAAE,oBAAoB,CAAC;gBAGjC,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,oBAAoB,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,EAC5C,mBAAmB,EAAE,CAAC,CAAC,MAAM,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAC,EAC9D,WAAW,EAAE,oBAAoB;IAW5B,OAAO,CACZ,GAAG,EAAE,uBAAuB,CAAC,IAAI,CAAC,EAClC,KAAK,EAAE,EAAE,GACP,OAAO,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC;IAuDvC,OAAO,CAAC,eAAe;IAkCvB,OAAO,CAAC,6BAA6B;IAiCrC,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,yBAAyB;IAajC,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,oBAAoB;IAyD5B,OAAO,CAAC,eAAe;IA0BvB,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,oBAAoB;IAc5B,OAAO,CAAC,kBAAkB;IA8B1B,OAAO,CAAC,aAAa;IAoDrB,OAAO,CAAC,eAAe;IAmBvB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,eAAe;IA8CvB,OAAO,CAAC,eAAe;IAiBvB,OAAO,CAAC,qBAAqB;CAwC7B"}
|
|
@@ -134,10 +134,13 @@ class HttpOperationExecution extends AbstractOperationExecution_1.default {
|
|
|
134
134
|
const parsedSized = Number.parseInt(response.headers.ContentLength ||
|
|
135
135
|
response.headers['content-length'], 10);
|
|
136
136
|
return TE.right({
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
137
|
+
reference: {
|
|
138
|
+
_tag: 'FileDescriptor',
|
|
139
|
+
key: fileKey,
|
|
140
|
+
metadata: {
|
|
141
|
+
size: Number.isNaN(parsedSized) ? undefined : parsedSized,
|
|
142
|
+
contentType: fileRef.mime_type,
|
|
143
|
+
},
|
|
141
144
|
},
|
|
142
145
|
content: response.body,
|
|
143
146
|
});
|
|
@@ -145,7 +148,7 @@ class HttpOperationExecution extends AbstractOperationExecution_1.default {
|
|
|
145
148
|
});
|
|
146
149
|
const filesTask = (0, Array_1.sequence)(TE.MonadTask)(fileStreamsFromReferencesTasks);
|
|
147
150
|
return (0, function_1.pipe)(filesTask, TE.map((files) => files.reduce((acc, file) => {
|
|
148
|
-
acc[file.key] = file;
|
|
151
|
+
acc[file.reference.key] = file;
|
|
149
152
|
return acc;
|
|
150
153
|
}, {})), TE.map((multipartFiles) => ({
|
|
151
154
|
fields: body.fields,
|
|
@@ -235,15 +238,19 @@ class HttpOperationExecution extends AbstractOperationExecution_1.default {
|
|
|
235
238
|
const uploadOptions = this.generateUploadOptions(contentLength);
|
|
236
239
|
return (0, function_1.pipe)(this.fileStorage.write({
|
|
237
240
|
content: operationResponse.response.body,
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
241
|
+
reference: {
|
|
242
|
+
_tag: 'FileDescriptor',
|
|
243
|
+
key: fileExtension ? `${(0, uuid_1.v4)()}.${fileExtension}` : (0, uuid_1.v4)(),
|
|
244
|
+
metadata: {
|
|
245
|
+
name: fileExtension ? `${(0, uuid_1.v4)()}.${fileExtension}` : (0, uuid_1.v4)(),
|
|
246
|
+
size: parseFloat(contentLength ?? undefined),
|
|
247
|
+
contentType,
|
|
248
|
+
},
|
|
242
249
|
},
|
|
243
|
-
}, O.some(uploadOptions)), TE.chain((file) => (0, function_1.pipe)(this.fileStorage.getSharedUrl(file.key), TE.map((sharedUrl) => operationResponse.responseParser({
|
|
244
|
-
name: file.key,
|
|
250
|
+
}, O.some(uploadOptions)), TE.chain((file) => (0, function_1.pipe)(this.fileStorage.getSharedUrl(file.reference.key), TE.map((sharedUrl) => operationResponse.responseParser({
|
|
251
|
+
name: file.reference.key,
|
|
245
252
|
url: sharedUrl.url,
|
|
246
|
-
mime_type: file.metadata.contentType ?? '',
|
|
253
|
+
mime_type: file.reference.metadata.contentType ?? '',
|
|
247
254
|
expires: sharedUrl.expires ?? 0,
|
|
248
255
|
})))));
|
|
249
256
|
}
|
|
@@ -122,8 +122,13 @@ class TestControllerHttp {
|
|
|
122
122
|
const { body } = request;
|
|
123
123
|
return (0, function_1.pipe)(fileStorage.write({
|
|
124
124
|
content: body,
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
reference: {
|
|
126
|
+
_tag: 'FileDescriptor',
|
|
127
|
+
key: 'test.ico',
|
|
128
|
+
metadata: {
|
|
129
|
+
name: 'test.ico',
|
|
130
|
+
},
|
|
131
|
+
},
|
|
127
132
|
}), TE.fold(() => T.of({
|
|
128
133
|
body: stream_1.Readable.from(JSON.stringify({
|
|
129
134
|
success: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trayio/cdk-runtime",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.48.0",
|
|
4
4
|
"description": "A Runtime that executes connector operations defined using the CDK DSL",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./*": "./dist/*.js"
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"node": ">=18.x"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@trayio/axios": "4.
|
|
18
|
-
"@trayio/cdk-dsl": "4.
|
|
19
|
-
"@trayio/express": "4.
|
|
20
|
-
"@trayio/winston": "4.
|
|
17
|
+
"@trayio/axios": "4.48.0",
|
|
18
|
+
"@trayio/cdk-dsl": "4.48.0",
|
|
19
|
+
"@trayio/express": "4.48.0",
|
|
20
|
+
"@trayio/winston": "4.48.0",
|
|
21
21
|
"mime": "3.0.0",
|
|
22
22
|
"uuid": "9.0.0"
|
|
23
23
|
},
|