@tetrascience-npm/ts-connectors-sdk 3.2.0 → 4.0.0-beta.182.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.
- package/CHANGELOG.md +21 -0
- package/README.md +42 -3
- package/dist/api-tests/auth-token.test.js +25 -37
- package/dist/api-tests/auth-token.test.js.map +1 -1
- package/dist/api-tests/aws-timeout.test.d.ts +2 -0
- package/dist/api-tests/aws-timeout.test.d.ts.map +1 -0
- package/dist/api-tests/aws-timeout.test.js +251 -0
- package/dist/api-tests/aws-timeout.test.js.map +1 -0
- package/dist/api-tests/fixture/config.d.ts +4 -0
- package/dist/api-tests/fixture/config.d.ts.map +1 -1
- package/dist/api-tests/fixture/config.js +1 -0
- package/dist/api-tests/fixture/config.js.map +1 -1
- package/dist/api-tests/fixture/data-app-api.d.ts +60 -0
- package/dist/api-tests/fixture/data-app-api.d.ts.map +1 -0
- package/dist/api-tests/fixture/data-app-api.js +89 -0
- package/dist/api-tests/fixture/data-app-api.js.map +1 -0
- package/dist/api-tests/fixture/fixture.d.ts +1 -0
- package/dist/api-tests/fixture/fixture.d.ts.map +1 -1
- package/dist/api-tests/fixture/test-proxy-server.d.ts +74 -0
- package/dist/api-tests/fixture/test-proxy-server.d.ts.map +1 -0
- package/dist/api-tests/fixture/test-proxy-server.js +240 -0
- package/dist/api-tests/fixture/test-proxy-server.js.map +1 -0
- package/dist/src/auth/aws-client-provider.d.ts +2 -0
- package/dist/src/auth/aws-client-provider.d.ts.map +1 -1
- package/dist/src/auth/aws-env-client-provider.d.ts +7 -2
- package/dist/src/auth/aws-env-client-provider.d.ts.map +1 -1
- package/dist/src/auth/aws-env-client-provider.js +9 -6
- package/dist/src/auth/aws-env-client-provider.js.map +1 -1
- package/dist/src/auth/aws-refresh-client-provider.d.ts +8 -2
- package/dist/src/auth/aws-refresh-client-provider.d.ts.map +1 -1
- package/dist/src/auth/aws-refresh-client-provider.js +9 -6
- package/dist/src/auth/aws-refresh-client-provider.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/tdp-client.d.ts +46 -10
- package/dist/src/tdp-client.d.ts.map +1 -1
- package/dist/src/tdp-client.js +128 -40
- package/dist/src/tdp-client.js.map +1 -1
- package/dist/test/auth/aws-env-client-provider.test.js +6 -2
- package/dist/test/auth/aws-env-client-provider.test.js.map +1 -1
- package/dist/test/auth/aws-refresh-client-provider.test.js +6 -2
- package/dist/test/auth/aws-refresh-client-provider.test.js.map +1 -1
- package/dist/test/tdp-client.test.js +350 -7
- package/dist/test/tdp-client.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Major Changes
|
|
2
2
|
|
|
3
|
+
## 4.0.0
|
|
4
|
+
|
|
5
|
+
* Breaking change: remove support for Node.js 16; Node.js 18, 20, or 22 is now required
|
|
6
|
+
* Breaking change: replace `createProxyNodeHttpHandler` with `createProxyAWSNodeHttpHandlers` in the public `TDPClient` API. Call sites should be updated to use the new helper.
|
|
7
|
+
* 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.
|
|
8
|
+
* Add configurable timeouts for S3, SQS, and other AWS requests via `createProxyAWSNodeHttpHandlers` options
|
|
9
|
+
* Auto-include TDP deployment certificates in the CA bundle for axios-based TDP API calls
|
|
10
|
+
* New read-only getter `tdpDeploymentCertificates` on `TDPClient`
|
|
11
|
+
* New exports: `shouldRejectUnauthorized()`, `loadTdpCertificates()`, `loadCertificatesFromLocalVolume()`
|
|
12
|
+
* `createAxiosInstanceWithCertificatesAndHeaders` — the `certificates` parameter is now optional; when omitted, the instance's deployment certificates are used automatically
|
|
13
|
+
* Add `IAM_PROXY` environment variable support to `createProxyAWSNodeHttpHandlers`; when set, all AWS SDK traffic is routed through the specified proxy instead of the standard `http_proxy`/`https_proxy` environment variables
|
|
14
|
+
* Add `createAwsClient()` factory method to `TDPClient` for creating AWS SDK v3 clients pre-configured with the SDK's proxy settings, credentials, and region
|
|
15
|
+
|
|
16
|
+
## 3.2.0
|
|
17
|
+
|
|
18
|
+
* Add `destinationId` as an option to `tdpClient.uploadFile` with support for a custom S3 key prefix
|
|
19
|
+
* Fix HTTP proxy and certificate support for `TDPClient`
|
|
20
|
+
* Add support for `NODE_TLS_REJECT_UNAUTHORIZED` environment variable to disable TLS certificate validation
|
|
21
|
+
* Add support for the `HTTPS_AGENT` environment variable to override the default HTTPS agent (valid values: `hpagent`)
|
|
22
|
+
* Improve logging of environmental proxy settings
|
|
23
|
+
|
|
3
24
|
## 3.1.1
|
|
4
25
|
|
|
5
26
|
* Remove ts-lib-shared-schema as a dependency
|
package/README.md
CHANGED
|
@@ -44,8 +44,8 @@ If your project already depends on the AWS SDK v3 clients or `axios`, you only
|
|
|
44
44
|
need to add `@tetrascience-npm/ts-connectors-sdk` and ensure that your existing
|
|
45
45
|
versions satisfy the peer dependency ranges in `package.json`.
|
|
46
46
|
|
|
47
|
-
This SDK
|
|
48
|
-
|
|
47
|
+
This SDK requires Node.js 18, 20, or 22 (see the `engines` field in `package.json`).
|
|
48
|
+
Node.js 16 support was dropped in v4.0.0.
|
|
49
49
|
|
|
50
50
|
## Overview
|
|
51
51
|
|
|
@@ -91,6 +91,45 @@ async function uploadExample() {
|
|
|
91
91
|
Refer to the `TDPClient` source (`src/tdp-client.ts`) for the full set of
|
|
92
92
|
options and behaviors.
|
|
93
93
|
|
|
94
|
+
#### createAwsClient()
|
|
95
|
+
|
|
96
|
+
After calling `init()`, you can create additional AWS SDK v3 clients that share
|
|
97
|
+
the same proxy configuration and credentials as the SDK's built-in clients:
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
import { S3Client } from '@aws-sdk/client-s3';
|
|
101
|
+
|
|
102
|
+
const s3 = client.createAwsClient(S3Client);
|
|
103
|
+
// Optional: pass overrides for any AWS SDK client config
|
|
104
|
+
const s3WithOverrides = client.createAwsClient(S3Client, { region: 'us-west-2' });
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
#### tdpDeploymentCertificates
|
|
108
|
+
|
|
109
|
+
A read-only getter that returns the TDP deployment certificates loaded during
|
|
110
|
+
`init()`. These are automatically included in the CA bundle for axios-based
|
|
111
|
+
HTTP requests (e.g. TDP API calls). You can inspect the loaded certificates:
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
await client.init();
|
|
115
|
+
console.log(`Loaded ${client.tdpDeploymentCertificates.length} TDP deployment certificate(s)`);
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
#### IAM_PROXY environment variable
|
|
119
|
+
|
|
120
|
+
Set `IAM_PROXY` to an HTTP proxy URL to route all AWS SDK traffic (S3, SQS,
|
|
121
|
+
SSM, and other AWS clients created via `createAwsClient()`) through a specific
|
|
122
|
+
proxy. This is useful in network-restricted deployments where AWS endpoints are
|
|
123
|
+
only reachable through an IAM-aware proxy:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
IAM_PROXY=http://iam-proxy.example.com:8080
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
When `IAM_PROXY` is not set, the SDK falls back to the standard
|
|
130
|
+
`http_proxy`/`https_proxy` environment variables for per-request proxy
|
|
131
|
+
selection.
|
|
132
|
+
|
|
94
133
|
### Connector and PollingConnector
|
|
95
134
|
|
|
96
135
|
To build a connector, extend either `Connector` or `PollingConnector` and
|
|
@@ -120,4 +159,4 @@ For more details, see [CONTRIBUTING.md](./CONTRIBUTING.md).
|
|
|
120
159
|
|
|
121
160
|
## License
|
|
122
161
|
|
|
123
|
-
This project is licensed under the [Apache License 2.0](./LICENSE).
|
|
162
|
+
This project is licensed under the [Apache License 2.0](./LICENSE).
|
|
@@ -9,12 +9,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const uuid_1 = require("uuid");
|
|
12
13
|
const vitest_1 = require("vitest");
|
|
13
14
|
const logger_js_1 = require("../src/logger.js");
|
|
14
15
|
const tdp_client_js_1 = require("../src/tdp-client.js");
|
|
15
16
|
const config_1 = require("./fixture/config");
|
|
16
|
-
const connector_api_1 = require("./fixture/connector-api");
|
|
17
17
|
const create_http_client_1 = require("./fixture/create-http-client");
|
|
18
|
+
const data_app_api_1 = require("./fixture/data-app-api");
|
|
18
19
|
/**
|
|
19
20
|
* Tests for TDPClient direct authToken flow (Priority 1).
|
|
20
21
|
*
|
|
@@ -22,24 +23,18 @@ const create_http_client_1 = require("./fixture/create-http-client");
|
|
|
22
23
|
* directly (as used in data-apps) instead of using CONNECTOR_TOKEN or AWS credentials.
|
|
23
24
|
*/
|
|
24
25
|
(0, vitest_1.describe)('TDPClient Auth Token Flow', () => {
|
|
25
|
-
(0, vitest_1.test)('DAM-
|
|
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, }) {
|
|
26
27
|
const config = (0, config_1.loadConfig)();
|
|
27
28
|
const http = yield (0, create_http_client_1.createHttpClient)(config);
|
|
28
|
-
const
|
|
29
|
-
// Create a
|
|
30
|
-
const
|
|
31
|
-
connectorType: config.
|
|
32
|
-
name:
|
|
33
|
-
hostType: '
|
|
34
|
-
labels: [
|
|
35
|
-
{
|
|
36
|
-
name: 'testRunId',
|
|
37
|
-
value: config.TEST_RUN_ID,
|
|
38
|
-
},
|
|
39
|
-
],
|
|
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',
|
|
40
35
|
}, onTestFinished);
|
|
41
|
-
expect(
|
|
42
|
-
const
|
|
36
|
+
expect(dataAppResponse.status).toBe(201);
|
|
37
|
+
const dataAppId = dataAppResponse.data.id;
|
|
43
38
|
// Get user JWT from login (already authenticated via createHttpClient)
|
|
44
39
|
// We need to make a fresh login call to get the token
|
|
45
40
|
const loginResponse = yield http.post('/login', {
|
|
@@ -57,7 +52,7 @@ const create_http_client_1 = require("./fixture/create-http-client");
|
|
|
57
52
|
artifactType: 'data-app',
|
|
58
53
|
authToken: userJwt, // Direct auth token - this is what we're testing
|
|
59
54
|
awsRegion: config.AWS_REGION,
|
|
60
|
-
connectorId:
|
|
55
|
+
connectorId: dataAppId,
|
|
61
56
|
datalakeBucket: config.DATALAKE_BUCKET,
|
|
62
57
|
streamBucket: config.STREAM_BUCKET,
|
|
63
58
|
tdpCertificateKey: config.TDP_CERTIFICATE_KEY,
|
|
@@ -70,28 +65,21 @@ const create_http_client_1 = require("./fixture/create-http-client");
|
|
|
70
65
|
// because authToken bypasses the AWS token retrieval flow
|
|
71
66
|
yield tdpClient.init();
|
|
72
67
|
// Verify the client is initialized and can make API calls
|
|
73
|
-
const
|
|
74
|
-
expect(
|
|
75
|
-
expect(
|
|
76
|
-
expect(connector.name).toBe('Auth Token Test Connector');
|
|
68
|
+
const dataApp = yield tdpClient.getConnector();
|
|
69
|
+
expect(dataApp).toBeDefined();
|
|
70
|
+
expect(dataApp.id).toBe(dataAppId);
|
|
77
71
|
}));
|
|
78
|
-
(0, vitest_1.test)('DAM-
|
|
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 }) {
|
|
79
73
|
const config = (0, config_1.loadConfig)();
|
|
80
74
|
const http = yield (0, create_http_client_1.createHttpClient)(config);
|
|
81
|
-
const
|
|
82
|
-
// Create a
|
|
83
|
-
const
|
|
84
|
-
connectorType: config.
|
|
85
|
-
name:
|
|
86
|
-
hostType: '
|
|
87
|
-
labels: [
|
|
88
|
-
{
|
|
89
|
-
name: 'testRunId',
|
|
90
|
-
value: config.TEST_RUN_ID,
|
|
91
|
-
},
|
|
92
|
-
],
|
|
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',
|
|
93
81
|
}, onTestFinished);
|
|
94
|
-
expect(
|
|
82
|
+
expect(dataAppResponse.status).toBe(201);
|
|
95
83
|
// Get user JWT
|
|
96
84
|
const loginResponse = yield http.post('/login', {
|
|
97
85
|
email: config.TEST_USER_EMAIL,
|
|
@@ -106,7 +94,7 @@ const create_http_client_1 = require("./fixture/create-http-client");
|
|
|
106
94
|
artifactType: 'data-app',
|
|
107
95
|
authToken: loginResponse.data.token,
|
|
108
96
|
awsRegion: config.AWS_REGION,
|
|
109
|
-
connectorId:
|
|
97
|
+
connectorId: dataAppResponse.data.id,
|
|
110
98
|
datalakeBucket: config.DATALAKE_BUCKET,
|
|
111
99
|
streamBucket: config.STREAM_BUCKET,
|
|
112
100
|
tdpCertificateKey: config.TDP_CERTIFICATE_KEY,
|
|
@@ -119,7 +107,7 @@ const create_http_client_1 = require("./fixture/create-http-client");
|
|
|
119
107
|
// Test searchEql - this should work with the user's JWT
|
|
120
108
|
// We search for any files, expecting an empty or non-empty result
|
|
121
109
|
const searchResult = yield tdpClient.searchEql({
|
|
122
|
-
|
|
110
|
+
version: true,
|
|
123
111
|
size: 1,
|
|
124
112
|
from: 0,
|
|
125
113
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-token.test.js","sourceRoot":"","sources":["../../api-tests/auth-token.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,mCAAwC;AAExC,gDAA0C;AAC1C,wDAAiD;AACjD,6CAA8C;AAC9C,
|
|
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;AAClF,yDAAoD;AAEpD;;;;;GAKG;AACH,IAAA,iBAAQ,EAAC,2BAA2B,EAAE,GAAG,EAAE;IACzC,IAAA,aAAI,EAAC,sFAAsF,EAAE,KAG1F,EAAE,4CAH+F,EAClG,MAAM,EACN,cAAc,GACf;QACC,MAAM,MAAM,GAAG,IAAA,mBAAU,GAAE,CAAC;QAC5B,MAAM,IAAI,GAAG,MAAM,IAAA,qCAAgB,EAAC,MAAM,CAAC,CAAC;QAC5C,MAAM,UAAU,GAAG,IAAI,yBAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAEhD,0DAA0D;QAC1D,MAAM,eAAe,GAAG,MAAM,UAAU,CAAC,MAAM,CAC7C;YACE,aAAa,EAAE,MAAM,CAAC,aAAa;YACnC,IAAI,EAAE,4BAA4B,IAAA,SAAM,GAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;YACxD,QAAQ,EAAE,OAAO;SAClB,EACD,cAAc,CACf,CAAC;QACF,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACzC,MAAM,SAAS,GAAG,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;QAE1C,uEAAuE;QACvE,sDAAsD;QACtD,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,IAAI,CAAmB,QAAQ,EAAE;YAChE,KAAK,EAAE,MAAM,CAAC,eAAe;YAC7B,QAAQ,EAAE,MAAM,CA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AAW,EAAE,MAAM,CAAC,OAAO;YAC3B,QAAQ,EAAE,MAAM,CAAC,UAAU;YAC3B,oBAAoB,EAAE,MAAM,CAAC,sBAAsB;SACpD,CAAC,CAAC;QAEH,MAAM,SAAS,CAAC,IAAI,EAAE,CAAC;QAEvB,wDAAwD;QACxD,kEAAkE;QAClE,MAAM,YAAY,GAAG,MAAM,SAAS,CAAC,SAAS,CAAC;YAC7C,OAAO,EAAE,IAAI;YACb,IAAI,EAAE,CAAC;YACP,IAAI,EAAE,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 @@
|
|
|
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,2BAA2B,EAAE,GAAG,EAAE;IACzC,IAAA,uBAAa,EACX,4EAA4E,EAC5E,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,EAC1B,KAAwC,EAAE,4CAAnC,EAAE,mBAAmB,EAAE,MAAM,EAAE;QACpC,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;QACxC,2BAA2B;QAC3B,MAAM,WAAW,GAAG,IAAI,mCAAe,EAAE,CAAC;QAC1C,MAAM,SAAS,GAAG,MAAM,WAAW,CAAC,KAAK,EAAE,CAAC;QAC5C,OAAO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,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;
|
|
@@ -27,6 +28,7 @@ export declare const configSchema: z.ZodObject<{
|
|
|
27
28
|
TENANT: string;
|
|
28
29
|
API_URL: string;
|
|
29
30
|
STANDALONE_CONNECTOR_TYPE: string;
|
|
31
|
+
DATA_APP_TYPE: string;
|
|
30
32
|
TEST_RUN_ID: string;
|
|
31
33
|
DATA_ACQUISITION_LOG_GROUP: string;
|
|
32
34
|
}, {
|
|
@@ -43,6 +45,7 @@ export declare const configSchema: z.ZodObject<{
|
|
|
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>;
|
|
@@ -59,6 +62,7 @@ export declare const loadConfig: (env?: NodeJS.Dict<string>) => {
|
|
|
59
62
|
TENANT: string;
|
|
60
63
|
API_URL: string;
|
|
61
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
|
|
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,6BAAwB;AAEX,QAAA,YAAY,GAAG,OAAC,CAAC,MAAM,CAAC;IACnC,eAAe,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE;IACnC,kBAAkB,EAAE,OAAC,CAAC,MAAM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,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"}
|