@trayio/cdk-runtime 3.17.0 → 3.19.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.
|
@@ -56,6 +56,21 @@ class TestControllerHttp {
|
|
|
56
56
|
});
|
|
57
57
|
},
|
|
58
58
|
},
|
|
59
|
+
{
|
|
60
|
+
path: `/queryParams`,
|
|
61
|
+
method: Http_1.HttpMethod.Get,
|
|
62
|
+
execute: () => (request) => {
|
|
63
|
+
const { ids } = request.queryString;
|
|
64
|
+
return T.of({
|
|
65
|
+
body: stream_1.Readable.from(JSON.stringify({
|
|
66
|
+
id: ids,
|
|
67
|
+
title: 'test',
|
|
68
|
+
})),
|
|
69
|
+
headers: {},
|
|
70
|
+
statusCode: 200,
|
|
71
|
+
});
|
|
72
|
+
},
|
|
73
|
+
},
|
|
59
74
|
{
|
|
60
75
|
path: `/error`,
|
|
61
76
|
method: Http_1.HttpMethod.Get,
|
|
@@ -395,6 +410,25 @@ describe('OperationExecutionGateway', () => {
|
|
|
395
410
|
.finallyDoNothing())
|
|
396
411
|
.nothingAfterAll());
|
|
397
412
|
});
|
|
413
|
+
describe('it should pass query string arrays', () => {
|
|
414
|
+
const getProductOperation = OperationHandlerSetup_1.OperationHandlerSetup.configureHandler((handler) => handler.usingHttp((http) => http
|
|
415
|
+
.get('http://localhost:3000/queryParams')
|
|
416
|
+
.handleRequest((_ctx, _input, request) => request.addQueryString('ids', ['1', '2', '3']).withoutBody())
|
|
417
|
+
.handleResponse((_ctx, _input, response) => response.parseWithBodyAsJson())));
|
|
418
|
+
OperationHandlerTest_1.OperationHandlerTestSetup.configureHandlerTest(getProductOperation, (handlerTest) => handlerTest
|
|
419
|
+
.usingHandlerContext('test')
|
|
420
|
+
.nothingBeforeAll()
|
|
421
|
+
.testCase('it should pass query string arrays', (testCase) => testCase
|
|
422
|
+
.usingHandlerContext('test')
|
|
423
|
+
.givenNothing()
|
|
424
|
+
.when(() => ({}))
|
|
425
|
+
.then(({ output }) => {
|
|
426
|
+
const outputValue = OperationHandler_1.OperationHandlerResult.getSuccessfulValueOrFail(output);
|
|
427
|
+
expect(outputValue.id).toEqual(['1', '2', '3']);
|
|
428
|
+
})
|
|
429
|
+
.finallyDoNothing())
|
|
430
|
+
.nothingAfterAll());
|
|
431
|
+
});
|
|
398
432
|
describe('it should an error using the body as the message', () => {
|
|
399
433
|
const getProductOperation = OperationHandlerSetup_1.OperationHandlerSetup.configureHandler((handler) => handler.usingHttp((http) => http
|
|
400
434
|
.get('http://localhost:3000/error')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trayio/cdk-runtime",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.19.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": "3.
|
|
18
|
-
"@trayio/cdk-dsl": "3.
|
|
19
|
-
"@trayio/express": "3.
|
|
20
|
-
"@trayio/winston": "3.
|
|
17
|
+
"@trayio/axios": "3.19.0",
|
|
18
|
+
"@trayio/cdk-dsl": "3.19.0",
|
|
19
|
+
"@trayio/express": "3.19.0",
|
|
20
|
+
"@trayio/winston": "3.19.0",
|
|
21
21
|
"mime": "3.0.0",
|
|
22
22
|
"uuid": "9.0.0"
|
|
23
23
|
},
|