@tetrascience-npm/ts-connectors-sdk 3.1.1 → 4.0.0-beta.177.1

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.
Files changed (52) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/api-tests/auth-token.test.d.ts +2 -0
  3. package/dist/api-tests/auth-token.test.d.ts.map +1 -0
  4. package/dist/api-tests/auth-token.test.js +120 -0
  5. package/dist/api-tests/auth-token.test.js.map +1 -0
  6. package/dist/api-tests/aws-timeout.test.d.ts +2 -0
  7. package/dist/api-tests/aws-timeout.test.d.ts.map +1 -0
  8. package/dist/api-tests/aws-timeout.test.js +251 -0
  9. package/dist/api-tests/aws-timeout.test.js.map +1 -0
  10. package/dist/api-tests/fixture/config.d.ts +20 -16
  11. package/dist/api-tests/fixture/config.d.ts.map +1 -1
  12. package/dist/api-tests/fixture/config.js +1 -0
  13. package/dist/api-tests/fixture/config.js.map +1 -1
  14. package/dist/api-tests/fixture/data-app-api.d.ts +60 -0
  15. package/dist/api-tests/fixture/data-app-api.d.ts.map +1 -0
  16. package/dist/api-tests/fixture/data-app-api.js +89 -0
  17. package/dist/api-tests/fixture/data-app-api.js.map +1 -0
  18. package/dist/api-tests/fixture/fixture.d.ts +7 -6
  19. package/dist/api-tests/fixture/fixture.d.ts.map +1 -1
  20. package/dist/api-tests/fixture/test-proxy-server.d.ts +74 -0
  21. package/dist/api-tests/fixture/test-proxy-server.d.ts.map +1 -0
  22. package/dist/api-tests/fixture/test-proxy-server.js +240 -0
  23. package/dist/api-tests/fixture/test-proxy-server.js.map +1 -0
  24. package/dist/src/api.d.ts +177 -0
  25. package/dist/src/api.d.ts.map +1 -1
  26. package/dist/src/api.js +58 -0
  27. package/dist/src/api.js.map +1 -1
  28. package/dist/src/auth/aws-env-client-provider.d.ts +6 -2
  29. package/dist/src/auth/aws-env-client-provider.d.ts.map +1 -1
  30. package/dist/src/auth/aws-env-client-provider.js +6 -6
  31. package/dist/src/auth/aws-env-client-provider.js.map +1 -1
  32. package/dist/src/auth/aws-refresh-client-provider.d.ts +6 -2
  33. package/dist/src/auth/aws-refresh-client-provider.d.ts.map +1 -1
  34. package/dist/src/auth/aws-refresh-client-provider.js +6 -6
  35. package/dist/src/auth/aws-refresh-client-provider.js.map +1 -1
  36. package/dist/src/config.d.ts +19 -8
  37. package/dist/src/config.d.ts.map +1 -1
  38. package/dist/src/config.js +15 -10
  39. package/dist/src/config.js.map +1 -1
  40. package/dist/src/schemas.d.ts +8 -8
  41. package/dist/src/tdp-client.d.ts +72 -4
  42. package/dist/src/tdp-client.d.ts.map +1 -1
  43. package/dist/src/tdp-client.js +190 -32
  44. package/dist/src/tdp-client.js.map +1 -1
  45. package/dist/test/auth/aws-env-client-provider.test.js +6 -2
  46. package/dist/test/auth/aws-env-client-provider.test.js.map +1 -1
  47. package/dist/test/auth/aws-refresh-client-provider.test.js +6 -2
  48. package/dist/test/auth/aws-refresh-client-provider.test.js.map +1 -1
  49. package/dist/test/tdp-client.test.js +219 -10
  50. package/dist/test/tdp-client.test.js.map +1 -1
  51. package/dist/tsconfig.tsbuildinfo +1 -1
  52. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Major Changes
2
2
 
3
+ ## 4.0.0
4
+
5
+ * Breaking change: remove support for Node 16
6
+ * Add timeouts for various AWS requests
7
+ * * Breaking change: replace `createProxyNodeHttpHandler` with `createProxyAWSNodeHttpHandlers` in the public `TDPClient` API. Call sites should be updated to use the new `createProxyAWSNodeHttpHandlers` helper.
8
+ * Breaking change: update AWS client provider constructors used by `TDPClient`. Any custom initialization code that constructs AWS SDK clients or passes client providers into `TDPClient` must be updated to match the new constructor signatures.
9
+
3
10
  ## 3.1.1
4
11
 
5
12
  * Remove ts-lib-shared-schema as a dependency
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=auth-token.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-token.test.d.ts","sourceRoot":"","sources":["../../api-tests/auth-token.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const uuid_1 = require("uuid");
13
+ const vitest_1 = require("vitest");
14
+ const logger_js_1 = require("../src/logger.js");
15
+ const tdp_client_js_1 = require("../src/tdp-client.js");
16
+ const config_1 = require("./fixture/config");
17
+ const create_http_client_1 = require("./fixture/create-http-client");
18
+ const data_app_api_1 = require("./fixture/data-app-api");
19
+ /**
20
+ * Tests for TDPClient direct authToken flow (Priority 1).
21
+ *
22
+ * These tests verify that TDPClient can be initialized with a user's JWT token
23
+ * directly (as used in data-apps) instead of using CONNECTOR_TOKEN or AWS credentials.
24
+ */
25
+ (0, vitest_1.describe)('TDPClient Auth Token Flow', () => {
26
+ (0, vitest_1.test)('DAM-T184: TDPClient initializes with direct authToken and can retrieve data app info', (_a) => __awaiter(void 0, [_a], void 0, function* ({ expect, onTestFinished, }) {
27
+ const config = (0, config_1.loadConfig)();
28
+ const http = yield (0, create_http_client_1.createHttpClient)(config);
29
+ const dataAppApi = new data_app_api_1.DataAppApi(http, config);
30
+ // Create a data app to have a valid context for API calls
31
+ const dataAppResponse = yield dataAppApi.create({
32
+ connectorType: config.DATA_APP_TYPE,
33
+ name: `Auth Token Test Data App ${(0, uuid_1.v4)().slice(0, 8)}`,
34
+ hostType: 'cloud',
35
+ }, onTestFinished);
36
+ expect(dataAppResponse.status).toBe(201);
37
+ const dataAppId = dataAppResponse.data.id;
38
+ // Get user JWT from login (already authenticated via createHttpClient)
39
+ // We need to make a fresh login call to get the token
40
+ const loginResponse = yield http.post('/login', {
41
+ email: config.TEST_USER_EMAIL,
42
+ password: config.TEST_USER_PASSWORD,
43
+ subdomain: config.TENANT,
44
+ });
45
+ expect(loginResponse.status).toBe(200);
46
+ const userJwt = loginResponse.data.token;
47
+ // Suppress connector logs in test output
48
+ // @ts-expect-error - override private method
49
+ logger_js_1.Logger.prototype.sendToConsole = () => { };
50
+ // Initialize TDPClient with direct authToken (Priority 1 flow)
51
+ const tdpClient = new tdp_client_js_1.TDPClient({
52
+ artifactType: 'data-app',
53
+ authToken: userJwt, // Direct auth token - this is what we're testing
54
+ awsRegion: config.AWS_REGION,
55
+ connectorId: dataAppId,
56
+ datalakeBucket: config.DATALAKE_BUCKET,
57
+ streamBucket: config.STREAM_BUCKET,
58
+ tdpCertificateKey: config.TDP_CERTIFICATE_KEY,
59
+ orgSlug: config.ORG_SLUG,
60
+ tdpEndpoint: config.API_URL,
61
+ kmsKeyId: config.KMS_KEY_ID,
62
+ outboundCommandQueue: config.OUTBOUND_COMMAND_QUEUE,
63
+ });
64
+ // Initialize the client - this should work without AWS credentials
65
+ // because authToken bypasses the AWS token retrieval flow
66
+ yield tdpClient.init();
67
+ // Verify the client is initialized and can make API calls
68
+ const dataApp = yield tdpClient.getConnector();
69
+ expect(dataApp).toBeDefined();
70
+ expect(dataApp.id).toBe(dataAppId);
71
+ }));
72
+ (0, vitest_1.test)('DAM-T185: TDPClient with authToken can search datalake using searchEql', (_a) => __awaiter(void 0, [_a], void 0, function* ({ expect, onTestFinished }) {
73
+ const config = (0, config_1.loadConfig)();
74
+ const http = yield (0, create_http_client_1.createHttpClient)(config);
75
+ const dataAppApi = new data_app_api_1.DataAppApi(http, config);
76
+ // Create a data app for context
77
+ const dataAppResponse = yield dataAppApi.create({
78
+ connectorType: config.DATA_APP_TYPE,
79
+ name: `SearchEql Auth Token Test ${(0, uuid_1.v4)().slice(0, 8)}`,
80
+ hostType: 'cloud',
81
+ }, onTestFinished);
82
+ expect(dataAppResponse.status).toBe(201);
83
+ // Get user JWT
84
+ const loginResponse = yield http.post('/login', {
85
+ email: config.TEST_USER_EMAIL,
86
+ password: config.TEST_USER_PASSWORD,
87
+ subdomain: config.TENANT,
88
+ });
89
+ expect(loginResponse.status).toBe(200);
90
+ // @ts-expect-error - override private method
91
+ logger_js_1.Logger.prototype.sendToConsole = () => { };
92
+ // Initialize TDPClient with direct authToken
93
+ const tdpClient = new tdp_client_js_1.TDPClient({
94
+ artifactType: 'data-app',
95
+ authToken: loginResponse.data.token,
96
+ awsRegion: config.AWS_REGION,
97
+ connectorId: dataAppResponse.data.id,
98
+ datalakeBucket: config.DATALAKE_BUCKET,
99
+ streamBucket: config.STREAM_BUCKET,
100
+ tdpCertificateKey: config.TDP_CERTIFICATE_KEY,
101
+ orgSlug: config.ORG_SLUG,
102
+ tdpEndpoint: config.API_URL,
103
+ kmsKeyId: config.KMS_KEY_ID,
104
+ outboundCommandQueue: config.OUTBOUND_COMMAND_QUEUE,
105
+ });
106
+ yield tdpClient.init();
107
+ // Test searchEql - this should work with the user's JWT
108
+ // We search for any files, expecting an empty or non-empty result
109
+ const searchResult = yield tdpClient.searchEql({
110
+ version: true,
111
+ size: 1,
112
+ from: 0,
113
+ });
114
+ expect(searchResult).toBeDefined();
115
+ expect(searchResult.hits).toBeDefined();
116
+ // The search should return a valid response structure
117
+ expect(Array.isArray(searchResult.hits.hits)).toBe(true);
118
+ }));
119
+ });
120
+ //# sourceMappingURL=auth-token.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-token.test.js","sourceRoot":"","sources":["../../api-tests/auth-token.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+BAAoC;AACpC,mCAAwC;AAExC,gDAA0C;AAC1C,wDAAiD;AACjD,6CAA8C;AAC9C,qEAAkF;AA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E,CAAC;SACR,CAAC,CAAC;QAEH,MAAM,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE,CAAC;QACnC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;QACxC,sDAAsD;QACtD,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3D,CAAC,CAAA,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=aws-timeout.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aws-timeout.test.d.ts","sourceRoot":"","sources":["../../api-tests/aws-timeout.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,251 @@
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 () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
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
+ })();
35
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
+ return new (P || (P = Promise))(function (resolve, reject) {
38
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
42
+ });
43
+ };
44
+ Object.defineProperty(exports, "__esModule", { value: true });
45
+ const s3 = __importStar(require("@aws-sdk/client-s3"));
46
+ const sqs = __importStar(require("@aws-sdk/client-sqs"));
47
+ const ssm = __importStar(require("@aws-sdk/client-ssm"));
48
+ const vitest_1 = require("vitest");
49
+ const fixture_1 = require("./fixture/fixture");
50
+ const test_proxy_server_1 = require("./fixture/test-proxy-server");
51
+ /**
52
+ * AWS Handler Timeout Tests
53
+ *
54
+ * These tests verify that AWS SDK handlers (S3, SQS, SSM) properly respect timeout configurations.
55
+ * We use a test proxy server to intercept HTTP requests and intentionally delay responses to trigger timeouts.
56
+ *
57
+ * Note: We cannot use aws-sdk-client-mock for timeout testing because it intercepts at the SDK level,
58
+ * bypassing the actual HTTP layer where timeouts occur. We cannot use MSW because it conflicts with
59
+ * ProxyAgent at the Node.js HTTP interception level. Instead, we use a real proxy server that ProxyAgent
60
+ * can connect to, allowing us to test actual timeout behavior with the real code path.
61
+ */
62
+ (0, vitest_1.describe)('AWS Handler Timeout Tests', () => {
63
+ (0, fixture_1.connectorTest)('DAM-T186: HTTP handler for S3 client respects socket timeout configuration', { timeout: 1 * 60 * 1000 }, (_a) => __awaiter(void 0, [_a], void 0, function* ({ standaloneConnector, expect }) {
64
+ console.log('[TEST] Starting DAM-T186');
65
+ // Set up test proxy server
66
+ const proxyServer = new test_proxy_server_1.TestProxyServer();
67
+ const proxyPort = yield proxyServer.start();
68
+ console.log('[TEST] Proxy server started on port', proxyPort);
69
+ // Save original proxy settings
70
+ const originalHttpProxy = process.env.http_proxy;
71
+ const originalHttpsProxy = process.env.https_proxy;
72
+ try {
73
+ // Configure environment to use test proxy
74
+ process.env.http_proxy = `http://localhost:${proxyPort}`;
75
+ process.env.https_proxy = `http://localhost:${proxyPort}`;
76
+ // Add socket hang rule for S3 requests
77
+ // Connection will be established, but no data will be sent (hangs indefinitely)
78
+ // This tests socket idle timeout (not connection timeout)
79
+ // The client should timeout after 500ms and close the connection
80
+ proxyServer.addSocketHangRule(/s3.*amazonaws\.com(:\d+)?/);
81
+ console.log('[TEST] Socket hang rule added');
82
+ console.log('[TEST] Starting connector');
83
+ yield standaloneConnector.start();
84
+ console.log('[TEST] Connector started');
85
+ // Get the TDPClient from the connector (accessing protected property via test connector)
86
+ const tdpClient = standaloneConnector.tdpClient;
87
+ console.log('[TEST] Creating handlers');
88
+ // Create handlers with very short socket timeout (500ms)
89
+ // Connection timeout is set higher to ensure we're testing socket timeout, not connection timeout
90
+ const handlers = tdpClient.createProxyAWSNodeHttpHandlers({
91
+ s3ConnectionTimeout: 5000, // Longer connection timeout
92
+ s3SocketTimeout: 500, // Short socket timeout - this is what we're testing
93
+ });
94
+ console.log('[TEST] Handlers created');
95
+ // Create S3 client with the short-timeout handler
96
+ // Requests will go through our test proxy which will hang the socket
97
+ const s3Client = new s3.S3Client({
98
+ region: 'us-east-2',
99
+ credentials: {
100
+ accessKeyId: 'test',
101
+ secretAccessKey: 'test',
102
+ },
103
+ requestHandler: handlers.s3Handler,
104
+ maxAttempts: 1, // Disable retries to test timeout behavior
105
+ });
106
+ console.log('[TEST] S3 client created');
107
+ // Attempt to get object - should timeout because socket hangs indefinitely
108
+ // but socket timeout is only 500ms
109
+ console.log('[TEST] Sending S3 request');
110
+ yield expect(s3Client.send(new s3.GetObjectCommand({
111
+ Bucket: 'test-bucket',
112
+ Key: 'test-key',
113
+ }))).rejects.toThrow(/timeout|timed out/i);
114
+ console.log('[TEST] S3 request completed (threw as expected)');
115
+ }
116
+ finally {
117
+ // Clean up: stop proxy server and restore environment
118
+ console.log('[TEST] Entering finally block');
119
+ console.log('[TEST] Stopping proxy server');
120
+ yield proxyServer.stop();
121
+ console.log('[TEST] Proxy server stopped');
122
+ if (originalHttpProxy !== undefined) {
123
+ process.env.http_proxy = originalHttpProxy;
124
+ }
125
+ else {
126
+ delete process.env.http_proxy;
127
+ }
128
+ if (originalHttpsProxy !== undefined) {
129
+ process.env.https_proxy = originalHttpsProxy;
130
+ }
131
+ else {
132
+ delete process.env.https_proxy;
133
+ }
134
+ console.log('[TEST] Environment restored');
135
+ console.log('[TEST] DAM-T186 cleanup complete');
136
+ }
137
+ }));
138
+ (0, fixture_1.connectorTest)('DAM-T187: HTTP handler for SQS client respects request timeout configuration', { timeout: 1 * 60 * 1000 }, (_a) => __awaiter(void 0, [_a], void 0, function* ({ standaloneConnector, expect }) {
139
+ // Set up test proxy server
140
+ const proxyServer = new test_proxy_server_1.TestProxyServer();
141
+ const proxyPort = yield proxyServer.start();
142
+ // Save original proxy settings
143
+ const originalHttpProxy = process.env.http_proxy;
144
+ const originalHttpsProxy = process.env.https_proxy;
145
+ try {
146
+ // Configure environment to use test proxy
147
+ process.env.http_proxy = `http://localhost:${proxyPort}`;
148
+ process.env.https_proxy = `http://localhost:${proxyPort}`;
149
+ // Add socket hang rule for SQS requests
150
+ // Connection will be established, but no data will be sent (hangs indefinitely)
151
+ // The client should timeout after 500ms and close the connection
152
+ proxyServer.addSocketHangRule(/sqs.*amazonaws\.com(:\d+)?/);
153
+ yield standaloneConnector.start();
154
+ // Get the TDPClient from the connector (accessing protected property via test connector)
155
+ const tdpClient = standaloneConnector.tdpClient;
156
+ // Create handlers with very short request timeout (500ms)
157
+ const handlers = tdpClient.createProxyAWSNodeHttpHandlers({
158
+ sqsRequestTimeout: 500,
159
+ });
160
+ // Create SQS client with the short-timeout handler
161
+ // Requests will go through our test proxy which will hang the socket
162
+ const sqsClient = new sqs.SQSClient({
163
+ region: 'us-east-2',
164
+ credentials: {
165
+ accessKeyId: 'test',
166
+ secretAccessKey: 'test',
167
+ },
168
+ requestHandler: handlers.sqsHandler,
169
+ maxAttempts: 1, // Disable retries to test timeout behavior
170
+ });
171
+ // Attempt to receive message - should timeout because socket hangs for 2 seconds
172
+ // but request timeout is only 500ms
173
+ yield expect(sqsClient.send(new sqs.ReceiveMessageCommand({
174
+ QueueUrl: 'https://sqs.us-east-2.amazonaws.com/123456789012/test-queue',
175
+ }))).rejects.toThrow(/timeout|timed out/i);
176
+ }
177
+ finally {
178
+ // Clean up: stop proxy server and restore environment
179
+ yield proxyServer.stop();
180
+ if (originalHttpProxy !== undefined) {
181
+ process.env.http_proxy = originalHttpProxy;
182
+ }
183
+ else {
184
+ delete process.env.http_proxy;
185
+ }
186
+ if (originalHttpsProxy !== undefined) {
187
+ process.env.https_proxy = originalHttpsProxy;
188
+ }
189
+ else {
190
+ delete process.env.https_proxy;
191
+ }
192
+ }
193
+ }));
194
+ (0, fixture_1.connectorTest)('DAM-T188: HTTP handler for SSM and CloudWatch respects request timeout configuration', { timeout: 1 * 60 * 1000 }, (_a) => __awaiter(void 0, [_a], void 0, function* ({ standaloneConnector, expect }) {
195
+ // Set up test proxy server
196
+ const proxyServer = new test_proxy_server_1.TestProxyServer();
197
+ const proxyPort = yield proxyServer.start();
198
+ // Save original proxy settings
199
+ const originalHttpProxy = process.env.http_proxy;
200
+ const originalHttpsProxy = process.env.https_proxy;
201
+ try {
202
+ // Configure environment to use test proxy
203
+ process.env.http_proxy = `http://localhost:${proxyPort}`;
204
+ process.env.https_proxy = `http://localhost:${proxyPort}`;
205
+ // Add socket hang rule for SSM requests
206
+ // Connection will be established, but no data will be sent (hangs indefinitely)
207
+ // The client should timeout after 500ms and close the connection
208
+ proxyServer.addSocketHangRule(/ssm.*amazonaws\.com(:\d+)?/);
209
+ yield standaloneConnector.start();
210
+ // Get the TDPClient from the connector (accessing protected property via test connector)
211
+ const tdpClient = standaloneConnector.tdpClient;
212
+ // Create handlers with very short request timeout (500ms)
213
+ const handlers = tdpClient.createProxyAWSNodeHttpHandlers({
214
+ genericRequestTimeout: 500,
215
+ });
216
+ // Create SSM client with the short-timeout handler
217
+ // Requests will go through our test proxy which will hang the socket
218
+ const ssmClient = new ssm.SSMClient({
219
+ region: 'us-east-2',
220
+ credentials: {
221
+ accessKeyId: 'test',
222
+ secretAccessKey: 'test',
223
+ },
224
+ requestHandler: handlers.genericHandler,
225
+ maxAttempts: 1, // Disable retries to test timeout behavior
226
+ });
227
+ // Attempt to get parameter - should timeout because socket hangs for 2 seconds
228
+ // but request timeout is only 500ms
229
+ yield expect(ssmClient.send(new ssm.GetParameterCommand({
230
+ Name: '/test/parameter',
231
+ }))).rejects.toThrow(/timeout|timed out/i);
232
+ }
233
+ finally {
234
+ // Clean up: stop proxy server and restore environment
235
+ yield proxyServer.stop();
236
+ if (originalHttpProxy !== undefined) {
237
+ process.env.http_proxy = originalHttpProxy;
238
+ }
239
+ else {
240
+ delete process.env.http_proxy;
241
+ }
242
+ if (originalHttpsProxy !== undefined) {
243
+ process.env.https_proxy = originalHttpsProxy;
244
+ }
245
+ else {
246
+ delete process.env.https_proxy;
247
+ }
248
+ }
249
+ }));
250
+ });
251
+ //# sourceMappingURL=aws-timeout.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aws-timeout.test.js","sourceRoot":"","sources":["../../api-tests/aws-timeout.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAAyC;AACzC,yDAA2C;AAC3C,yDAA2C;AAC3C,mCAAkC;AAElC,+CAAkD;AAClD,mEAA8D;AAE9D;;;;;;;;;;GAUG;AACH,IAAA,iBAAQ,EAAC,2BAA2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;YACtD,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;YACzB,IAAI,iBAAiB,KAAK,SAAS,EAAE,CAAC;gBACpC,OAAO,CAAC,GAAG,CAAC,UAAU,GAAG,iBAAiB,CAAC;YAC7C,CAAC;iBAAM,CAAC;gBACN,OAAO,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;YAChC,CAAC;YACD,IAAI,kBAAkB,KAAK,SAAS,EAAE,CAAC;gBACrC,OAAO,CAAC,GAAG,CAAC,WAAW,GAAG,kBAAkB,CAAC;YAC/C,CAAC;iBAAM,CAAC;gBACN,OAAO,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;YACjC,CAAC;QACH,CAAC;IACH,CAAC,CAAA,CACF,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -6,6 +6,7 @@ export declare const configSchema: z.ZodObject<{
6
6
  API_URL: z.ZodString;
7
7
  ORG_SLUG: z.ZodString;
8
8
  STANDALONE_CONNECTOR_TYPE: z.ZodDefault<z.ZodString>;
9
+ DATA_APP_TYPE: z.ZodDefault<z.ZodString>;
9
10
  AWS_REGION: z.ZodString;
10
11
  DATALAKE_BUCKET: z.ZodString;
11
12
  STREAM_BUCKET: z.ZodString;
@@ -15,50 +16,53 @@ export declare const configSchema: z.ZodObject<{
15
16
  TEST_RUN_ID: z.ZodDefault<z.ZodString>;
16
17
  DATA_ACQUISITION_LOG_GROUP: z.ZodString;
17
18
  }, "strip", z.ZodTypeAny, {
18
- TEST_USER_EMAIL: string;
19
- TEST_USER_PASSWORD: string;
20
- TENANT: string;
21
- API_URL: string;
22
19
  ORG_SLUG: string;
23
- STANDALONE_CONNECTOR_TYPE: string;
24
20
  AWS_REGION: string;
25
21
  DATALAKE_BUCKET: string;
26
22
  STREAM_BUCKET: string;
27
23
  TDP_CERTIFICATE_KEY: string;
28
- KMS_KEY_ID: string;
29
24
  OUTBOUND_COMMAND_QUEUE: string;
30
- TEST_RUN_ID: string;
31
- DATA_ACQUISITION_LOG_GROUP: string;
32
- }, {
25
+ KMS_KEY_ID: string;
33
26
  TEST_USER_EMAIL: string;
34
27
  TEST_USER_PASSWORD: string;
28
+ TENANT: string;
35
29
  API_URL: string;
30
+ STANDALONE_CONNECTOR_TYPE: string;
31
+ DATA_APP_TYPE: string;
32
+ TEST_RUN_ID: string;
33
+ DATA_ACQUISITION_LOG_GROUP: string;
34
+ }, {
36
35
  ORG_SLUG: string;
37
36
  AWS_REGION: string;
38
37
  DATALAKE_BUCKET: string;
39
38
  STREAM_BUCKET: string;
40
39
  TDP_CERTIFICATE_KEY: string;
41
- KMS_KEY_ID: string;
42
40
  OUTBOUND_COMMAND_QUEUE: string;
41
+ KMS_KEY_ID: string;
42
+ TEST_USER_EMAIL: string;
43
+ TEST_USER_PASSWORD: string;
44
+ API_URL: string;
43
45
  DATA_ACQUISITION_LOG_GROUP: string;
44
46
  TENANT?: string | undefined;
45
47
  STANDALONE_CONNECTOR_TYPE?: string | undefined;
48
+ DATA_APP_TYPE?: string | undefined;
46
49
  TEST_RUN_ID?: string | undefined;
47
50
  }>;
48
51
  export type Config = z.infer<typeof configSchema>;
49
52
  export declare const loadConfig: (env?: NodeJS.Dict<string>) => {
50
- TEST_USER_EMAIL: string;
51
- TEST_USER_PASSWORD: string;
52
- TENANT: string;
53
- API_URL: string;
54
53
  ORG_SLUG: string;
55
- STANDALONE_CONNECTOR_TYPE: string;
56
54
  AWS_REGION: string;
57
55
  DATALAKE_BUCKET: string;
58
56
  STREAM_BUCKET: string;
59
57
  TDP_CERTIFICATE_KEY: string;
60
- KMS_KEY_ID: string;
61
58
  OUTBOUND_COMMAND_QUEUE: string;
59
+ KMS_KEY_ID: string;
60
+ TEST_USER_EMAIL: string;
61
+ TEST_USER_PASSWORD: string;
62
+ TENANT: string;
63
+ API_URL: string;
64
+ STANDALONE_CONNECTOR_TYPE: string;
65
+ DATA_APP_TYPE: string;
62
66
  TEST_RUN_ID: string;
63
67
  DATA_ACQUISITION_LOG_GROUP: string;
64
68
  };
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../api-tests/fixture/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAevB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAElD,eAAO,MAAM,UAAU,GAAI,MAAK,MAAM,CAAC,IAAI,CAAC,MAAM,CAAe;;;;;;;;;;;;;;;CAA4B,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../api-tests/fixture/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBvB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAElD,eAAO,MAAM,UAAU,GAAI,MAAK,MAAM,CAAC,IAAI,CAAC,MAAM,CAAe;;;;;;;;;;;;;;;;CAA4B,CAAC"}
@@ -10,6 +10,7 @@ exports.configSchema = zod_1.z.object({
10
10
  API_URL: zod_1.z.string(),
11
11
  ORG_SLUG: zod_1.z.string(),
12
12
  STANDALONE_CONNECTOR_TYPE: zod_1.z.string().default('common/workshop-demo:v1.6.1'),
13
+ DATA_APP_TYPE: zod_1.z.string().default('common/fplc-data-explorer:v0.0.5'),
13
14
  AWS_REGION: zod_1.z.string(),
14
15
  DATALAKE_BUCKET: zod_1.z.string(),
15
16
  STREAM_BUCKET: zod_1.z.string(),
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../api-tests/fixture/config.ts"],"names":[],"mappings":";;;AAAA,+BAAoC;AACpC,6B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AAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IAC9B,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;IACnB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;IACpB,yBAAyB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,6BAA6B,CAAC;IAC5E,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,kCAAkC,CAAC;IACrE,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE;IACtB,eAAe,EAAE,OAAC,CAAC,MAAM,EAAE;IAC3B,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE;IACzB,mBAAmB,EAAE,OAAC,CAAC,MAAM,EAAE;IAC/B,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE;IACtB,sBAAsB,EAAE,OAAC,CAAC,MAAM,EAAE;IAClC,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAA,SAAM,GAAE,CAAC;IAC/C,0BAA0B,EAAE,OAAC,CAAC,MAAM,EAAE;CACvC,CAAC,CAAC;AAII,MAAM,UAAU,GAAG,CAAC,MAA2B,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,oBAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAAjF,QAAA,UAAU,cAAuE"}
@@ -0,0 +1,60 @@
1
+ import { AxiosInstance, AxiosResponse } from 'axios';
2
+ import { OnTestFinishedHandler } from 'vitest';
3
+ import * as apiTypes from './api.js';
4
+ import { Config } from './config';
5
+ export interface CreateDataAppRequest {
6
+ connectorType: string;
7
+ name: string;
8
+ hostType: 'cloud' | 'local';
9
+ dataAppId?: string;
10
+ }
11
+ export declare class DataAppApi {
12
+ private http;
13
+ private readonly config;
14
+ constructor(http: AxiosInstance, config: Config);
15
+ create(input: CreateDataAppRequest, cleanupHandler?: (fn: OnTestFinishedHandler) => void): Promise<AxiosResponse<{
16
+ id: string;
17
+ name: string;
18
+ orgSlug: string;
19
+ description?: string;
20
+ artifact: apiTypes.components["schemas"]["ArtifactDto"] | apiTypes.components["schemas"]["ArtifactDetailsDto"];
21
+ hostType: "cloud" | "local";
22
+ commandQueue?: string;
23
+ clusterArn: string;
24
+ taskDefinitionArn: string;
25
+ taskArn: string;
26
+ health: string;
27
+ healthErrorCode?: string;
28
+ operatingStatus: string;
29
+ networkStatus: string;
30
+ config: Record<string, never>;
31
+ lastSeenAt?: string;
32
+ updatedAt: string;
33
+ createdAt: string;
34
+ serviceDiscoveryName?: string;
35
+ }, any, {}>>;
36
+ get(id: string): Promise<AxiosResponse<{
37
+ id: string;
38
+ name: string;
39
+ orgSlug: string;
40
+ description?: string;
41
+ artifact: apiTypes.components["schemas"]["ArtifactDto"] | apiTypes.components["schemas"]["ArtifactDetailsDto"];
42
+ hostType: "cloud" | "local";
43
+ commandQueue?: string;
44
+ clusterArn: string;
45
+ taskDefinitionArn: string;
46
+ taskArn: string;
47
+ health: string;
48
+ healthErrorCode?: string;
49
+ operatingStatus: string;
50
+ networkStatus: string;
51
+ config: Record<string, never>;
52
+ lastSeenAt?: string;
53
+ updatedAt: string;
54
+ createdAt: string;
55
+ serviceDiscoveryName?: string;
56
+ }, any, {}>>;
57
+ delete(id: string): Promise<AxiosResponse<any, any, {}>>;
58
+ private request;
59
+ }
60
+ //# sourceMappingURL=data-app-api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-app-api.d.ts","sourceRoot":"","sources":["../../../api-tests/fixture/data-app-api.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAsB,aAAa,EAAgB,MAAM,OAAO,CAAC;AAEvF,OAAO,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAE/C,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAIlC,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,UAAU;IAEnB,OAAO,CAAC,IAAI;IACZ,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADf,IAAI,EAAE,aAAa,EACV,MAAM,EAAE,MAAM;IAG3B,MAAM,CAAC,KAAK,EAAE,oBAAoB,EAAE,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,qBAAqB,KAAK,IAAI;;;;;kBAqEy6pB,8BAAsB,kBAAiB,8BAAsB;;;;;;;;;;;;;;;;IAxC9jqB,GAAG,CAAC,EAAE,EAAE,MAAM;;;;;kBAwCm/pB,8BAAsB,kBAAiB,8BAAsB;;;;;;;;;;;;;;;;IAjC9jqB,MAAM,CAAC,EAAE,EAAE,MAAM;YAOT,OAAO;CAwBtB"}