@trayio/cdk-runtime 4.103.0 → 5.5.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/operation/OperationExecutionGateway.unit.test.js +3 -3
- package/dist/connector/operation/OperationExecutionTest.d.ts.map +1 -1
- package/dist/connector/operation/OperationExecutionTest.js +16 -6
- package/dist/connector/operation/OperationExecutionValidation.d.ts.map +1 -1
- package/dist/connector/operation/OperationExecutionValidation.js +5 -3
- package/package.json +5 -5
|
@@ -463,7 +463,7 @@ describe('OperationExecutionGateway', () => {
|
|
|
463
463
|
files: {
|
|
464
464
|
'test-image': {
|
|
465
465
|
name: 'testImage.png',
|
|
466
|
-
url: 'https://
|
|
466
|
+
url: 'https://httpbin.org/image/png',
|
|
467
467
|
mime_type: 'image/png',
|
|
468
468
|
expires: 0,
|
|
469
469
|
},
|
|
@@ -519,8 +519,8 @@ describe('OperationExecutionGateway', () => {
|
|
|
519
519
|
.post('http://localhost:3000/image-upload')
|
|
520
520
|
.handleRequest((ctx, input, request) => request.withBodyAsFile({
|
|
521
521
|
name: 'test-image',
|
|
522
|
-
url: 'https://
|
|
523
|
-
mime_type: 'image/
|
|
522
|
+
url: 'https://httpbin.org/image/svg',
|
|
523
|
+
mime_type: 'image/svg+xml',
|
|
524
524
|
expires: 0,
|
|
525
525
|
}))
|
|
526
526
|
.handleResponse((ctx, input, response) => response.parseWithBodyAsJson())));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationExecutionTest.d.ts","sourceRoot":"","sources":["../../../src/connector/operation/OperationExecutionTest.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,oBAAoB,EAEpB,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0DAA0D,CAAC;AAIhG,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,iCAAiC,EAAE,MAAM,qCAAqC,CAAC;AAQxF,qBAAa,sBAAsB,CAClC,IAAI,SAAS,oBAAoB,CAAC,OAAO,EAAE,OAAO,CAAC,EACnD,EAAE,EACF,GAAG;IAEH,OAAO,CAAC,WAAW,CAA+C;IAClE,OAAO,CAAC,wBAAwB,CAAoC;gBAGnE,WAAW,EAAE,oBAAoB,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,EACzD,wBAAwB,EAAE,iCAAiC;IAM5D,IAAI,CAAC,SAAS,EAAE,kBAAkB,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"OperationExecutionTest.d.ts","sourceRoot":"","sources":["../../../src/connector/operation/OperationExecutionTest.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,oBAAoB,EAEpB,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0DAA0D,CAAC;AAIhG,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,iCAAiC,EAAE,MAAM,qCAAqC,CAAC;AAQxF,qBAAa,sBAAsB,CAClC,IAAI,SAAS,oBAAoB,CAAC,OAAO,EAAE,OAAO,CAAC,EACnD,EAAE,EACF,GAAG;IAEH,OAAO,CAAC,WAAW,CAA+C;IAClE,OAAO,CAAC,wBAAwB,CAAoC;gBAGnE,WAAW,EAAE,oBAAoB,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,EACzD,wBAAwB,EAAE,iCAAiC;IAM5D,IAAI,CAAC,SAAS,EAAE,kBAAkB,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,GAAG,IAAI;CA2GxD"}
|
|
@@ -22,11 +22,16 @@ class OperationExecutionTest {
|
|
|
22
22
|
let testContext;
|
|
23
23
|
beforeAll(async () => {
|
|
24
24
|
const beforeAllResult = await this.handlerTest.beforeAllFunction(defaultCtx, defaultInvoke);
|
|
25
|
-
switch (beforeAllResult.
|
|
26
|
-
case
|
|
25
|
+
switch (beforeAllResult._tag) {
|
|
26
|
+
case 'Failure':
|
|
27
27
|
fail(`BeforeAll has failed with the following error ${beforeAllResult.error}`);
|
|
28
|
-
|
|
28
|
+
break;
|
|
29
|
+
case 'Pending':
|
|
30
|
+
fail('BeforeAll returned pending result, which is not allowed');
|
|
31
|
+
break;
|
|
32
|
+
case 'Success':
|
|
29
33
|
testContext = beforeAllResult.value;
|
|
34
|
+
break;
|
|
30
35
|
}
|
|
31
36
|
});
|
|
32
37
|
this.handlerTest.testCaseFactories.forEach((testCaseFactory) => {
|
|
@@ -36,11 +41,16 @@ class OperationExecutionTest {
|
|
|
36
41
|
const invoke = this.handlerInvocationFactory(ctx);
|
|
37
42
|
const givenResult = await testCase.givenFunction(ctx, testContext, invoke);
|
|
38
43
|
let testCaseContext;
|
|
39
|
-
switch (givenResult.
|
|
40
|
-
case
|
|
44
|
+
switch (givenResult._tag) {
|
|
45
|
+
case 'Failure':
|
|
41
46
|
fail(`Given has failed with the following error ${givenResult.error}`);
|
|
42
|
-
|
|
47
|
+
break;
|
|
48
|
+
case 'Pending':
|
|
49
|
+
fail('Given returned pending result, which is not allowed');
|
|
50
|
+
break;
|
|
51
|
+
case 'Success':
|
|
43
52
|
testCaseContext = givenResult.value;
|
|
53
|
+
break;
|
|
44
54
|
}
|
|
45
55
|
const input = testCase.whenFunction(ctx, testContext, testCaseContext);
|
|
46
56
|
const output = await execution.execute(ctx, input);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationExecutionValidation.d.ts","sourceRoot":"","sources":["../../../src/connector/operation/OperationExecutionValidation.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EAEtB,oBAAoB,EACpB,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EAAE,0BAA0B,EAAE,MAAM,gEAAgE,CAAC;AAC5G,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,qBAAa,4BAA4B,CACxC,IAAI,SAAS,oBAAoB,CAAC,OAAO,EAAE,OAAO,CAAC,EACnD,EAAE,EACF,GAAG,CACF,YAAW,kBAAkB,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC;IAE7C,OAAO,CAAC,iBAAiB,CAA4C;IACrE,OAAO,CAAC,SAAS,CAAoC;IACrD,WAAW,EAAE,oBAAoB,CAAC;gBAGjC,iBAAiB,EAAE,0BAA0B,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,EAC5D,SAAS,EAAE,kBAAkB,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC;IAOvC,OAAO,CACZ,GAAG,EAAE,uBAAuB,CAAC,IAAI,CAAC,EAClC,KAAK,EAAE,EAAE,GACP,OAAO,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"OperationExecutionValidation.d.ts","sourceRoot":"","sources":["../../../src/connector/operation/OperationExecutionValidation.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EAEtB,oBAAoB,EACpB,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EAAE,0BAA0B,EAAE,MAAM,gEAAgE,CAAC;AAC5G,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,qBAAa,4BAA4B,CACxC,IAAI,SAAS,oBAAoB,CAAC,OAAO,EAAE,OAAO,CAAC,EACnD,EAAE,EACF,GAAG,CACF,YAAW,kBAAkB,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC;IAE7C,OAAO,CAAC,iBAAiB,CAA4C;IACrE,OAAO,CAAC,SAAS,CAAoC;IACrD,WAAW,EAAE,oBAAoB,CAAC;gBAGjC,iBAAiB,EAAE,0BAA0B,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,EAC5D,SAAS,EAAE,kBAAkB,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC;IAOvC,OAAO,CACZ,GAAG,EAAE,uBAAuB,CAAC,IAAI,CAAC,EAClC,KAAK,EAAE,EAAE,GACP,OAAO,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC;CA4CvC"}
|
|
@@ -21,10 +21,12 @@ class OperationExecutionValidation {
|
|
|
21
21
|
return OperationHandler_1.OperationHandlerResult.failure(OperationHandler_1.OperationHandlerError.userInputError(inputValidationResult.join(', ')));
|
|
22
22
|
}
|
|
23
23
|
const result = await this.execution.execute(ctx, input);
|
|
24
|
-
switch (result.
|
|
25
|
-
case
|
|
24
|
+
switch (result._tag) {
|
|
25
|
+
case 'Failure':
|
|
26
26
|
return result;
|
|
27
|
-
case
|
|
27
|
+
case 'Pending':
|
|
28
|
+
return result;
|
|
29
|
+
case 'Success':
|
|
28
30
|
// TODO Add output schema validation
|
|
29
31
|
const { outputValidation } = this.handlerValidation;
|
|
30
32
|
const outputValidationResult = outputValidation
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trayio/cdk-runtime",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.5.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": "
|
|
18
|
-
"@trayio/cdk-dsl": "
|
|
19
|
-
"@trayio/express": "
|
|
20
|
-
"@trayio/winston": "
|
|
17
|
+
"@trayio/axios": "5.5.0",
|
|
18
|
+
"@trayio/cdk-dsl": "5.5.0",
|
|
19
|
+
"@trayio/express": "5.5.0",
|
|
20
|
+
"@trayio/winston": "5.5.0",
|
|
21
21
|
"mime": "3.0.0",
|
|
22
22
|
"uuid": "9.0.0"
|
|
23
23
|
},
|