@anduril-industries/lattice-sdk 4.6.0 → 4.7.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/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/entities/client/Client.js +6 -6
- package/dist/cjs/api/resources/oauth/client/Client.js +1 -1
- package/dist/cjs/api/resources/objects/client/Client.js +9 -5
- package/dist/cjs/api/resources/objects/types/UploadObjectRequestDistributionMode.d.ts +4 -0
- package/dist/cjs/api/resources/objects/types/UploadObjectRequestDistributionMode.js +7 -0
- package/dist/cjs/api/resources/objects/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/objects/types/index.js +1 -0
- package/dist/cjs/api/resources/tasks/client/Client.js +9 -9
- package/dist/cjs/core/fetcher/Fetcher.d.ts +6 -0
- package/dist/cjs/core/fetcher/Fetcher.js +9 -8
- package/dist/cjs/core/url/QueryStringBuilder.d.ts +47 -0
- package/dist/cjs/core/url/QueryStringBuilder.js +83 -0
- package/dist/cjs/core/url/index.d.ts +1 -0
- package/dist/cjs/core/url/index.js +3 -1
- package/dist/cjs/core/url/qs.d.ts +2 -1
- package/dist/cjs/core/url/qs.js +24 -12
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/entities/client/Client.mjs +6 -6
- package/dist/esm/api/resources/oauth/client/Client.mjs +1 -1
- package/dist/esm/api/resources/objects/client/Client.mjs +9 -5
- package/dist/esm/api/resources/objects/types/UploadObjectRequestDistributionMode.d.mts +4 -0
- package/dist/esm/api/resources/objects/types/UploadObjectRequestDistributionMode.mjs +4 -0
- package/dist/esm/api/resources/objects/types/index.d.mts +1 -0
- package/dist/esm/api/resources/objects/types/index.mjs +1 -0
- package/dist/esm/api/resources/tasks/client/Client.mjs +9 -9
- package/dist/esm/core/fetcher/Fetcher.d.mts +6 -0
- package/dist/esm/core/fetcher/Fetcher.mjs +9 -8
- package/dist/esm/core/url/QueryStringBuilder.d.mts +47 -0
- package/dist/esm/core/url/QueryStringBuilder.mjs +80 -0
- package/dist/esm/core/url/index.d.mts +1 -0
- package/dist/esm/core/url/index.mjs +1 -0
- package/dist/esm/core/url/qs.d.mts +2 -1
- package/dist/esm/core/url/qs.mjs +24 -12
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "@anduril-industries/lattice-sdk",
|
|
46
|
-
"X-Fern-SDK-Version": "4.
|
|
47
|
-
"User-Agent": "@anduril-industries/lattice-sdk/4.
|
|
46
|
+
"X-Fern-SDK-Version": "4.7.1",
|
|
47
|
+
"User-Agent": "@anduril-industries/lattice-sdk/4.7.1",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
50
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -100,7 +100,7 @@ class EntitiesClient {
|
|
|
100
100
|
method: "PUT",
|
|
101
101
|
headers: _headers,
|
|
102
102
|
contentType: "application/json",
|
|
103
|
-
|
|
103
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
104
104
|
requestType: "json",
|
|
105
105
|
body: request,
|
|
106
106
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
@@ -155,7 +155,7 @@ class EntitiesClient {
|
|
|
155
155
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LatticeEnvironment.Default, `api/v1/entities/${core.url.encodePathParam(entityId)}`),
|
|
156
156
|
method: "GET",
|
|
157
157
|
headers: _headers,
|
|
158
|
-
|
|
158
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
159
159
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
160
160
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
161
161
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -220,7 +220,7 @@ class EntitiesClient {
|
|
|
220
220
|
method: "PUT",
|
|
221
221
|
headers: _headers,
|
|
222
222
|
contentType: "application/json",
|
|
223
|
-
|
|
223
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
224
224
|
requestType: "json",
|
|
225
225
|
body: _body,
|
|
226
226
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
@@ -280,7 +280,7 @@ class EntitiesClient {
|
|
|
280
280
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LatticeEnvironment.Default, `api/v1/entities/${core.url.encodePathParam(entityId)}/override/${core.url.encodePathParam(fieldPath)}`),
|
|
281
281
|
method: "DELETE",
|
|
282
282
|
headers: _headers,
|
|
283
|
-
|
|
283
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
284
284
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
285
285
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
286
286
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -347,7 +347,7 @@ class EntitiesClient {
|
|
|
347
347
|
method: "POST",
|
|
348
348
|
headers: _headers,
|
|
349
349
|
contentType: "application/json",
|
|
350
|
-
|
|
350
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
351
351
|
requestType: "json",
|
|
352
352
|
body: request,
|
|
353
353
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
@@ -418,7 +418,7 @@ class EntitiesClient {
|
|
|
418
418
|
method: "POST",
|
|
419
419
|
headers: _headers,
|
|
420
420
|
contentType: "application/json",
|
|
421
|
-
|
|
421
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
422
422
|
requestType: "json",
|
|
423
423
|
body: request,
|
|
424
424
|
responseType: "sse",
|
|
@@ -81,7 +81,7 @@ class OauthClient {
|
|
|
81
81
|
method: "POST",
|
|
82
82
|
headers: _headers,
|
|
83
83
|
contentType: "application/x-www-form-urlencoded",
|
|
84
|
-
|
|
84
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
85
85
|
requestType: "form",
|
|
86
86
|
body: Object.assign(Object.assign({}, request), { grant_type: "client_credentials" }),
|
|
87
87
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
@@ -91,7 +91,11 @@ class ObjectsClient {
|
|
|
91
91
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LatticeEnvironment.Default, "api/v1/objects"),
|
|
92
92
|
method: "GET",
|
|
93
93
|
headers: _headers,
|
|
94
|
-
|
|
94
|
+
queryString: core.url
|
|
95
|
+
.queryBuilder()
|
|
96
|
+
.addMany(_queryParams)
|
|
97
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
98
|
+
.build(),
|
|
95
99
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
96
100
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
97
101
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -155,7 +159,7 @@ class ObjectsClient {
|
|
|
155
159
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LatticeEnvironment.Default, `api/v1/objects/${core.url.encodePathParam(objectPath)}`),
|
|
156
160
|
method: "GET",
|
|
157
161
|
headers: _headers,
|
|
158
|
-
|
|
162
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
159
163
|
responseType: "binary-response",
|
|
160
164
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
161
165
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
@@ -220,7 +224,7 @@ class ObjectsClient {
|
|
|
220
224
|
method: "POST",
|
|
221
225
|
headers: _headers,
|
|
222
226
|
contentType: "application/octet-stream",
|
|
223
|
-
|
|
227
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
224
228
|
requestType: "bytes",
|
|
225
229
|
duplex: "half",
|
|
226
230
|
body: _binaryUploadRequest.body,
|
|
@@ -287,7 +291,7 @@ class ObjectsClient {
|
|
|
287
291
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LatticeEnvironment.Default, `api/v1/objects/${core.url.encodePathParam(objectPath)}`),
|
|
288
292
|
method: "DELETE",
|
|
289
293
|
headers: _headers,
|
|
290
|
-
|
|
294
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
291
295
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
292
296
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
293
297
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -348,7 +352,7 @@ class ObjectsClient {
|
|
|
348
352
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LatticeEnvironment.Default, `api/v1/objects/${core.url.encodePathParam(objectPath)}`),
|
|
349
353
|
method: "HEAD",
|
|
350
354
|
headers: _headers,
|
|
351
|
-
|
|
355
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
352
356
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
353
357
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
354
358
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./GetObjectRequestAcceptEncoding.js"), exports);
|
|
18
|
+
__exportStar(require("./UploadObjectRequestDistributionMode.js"), exports);
|
|
@@ -101,7 +101,7 @@ class TasksClient {
|
|
|
101
101
|
method: "POST",
|
|
102
102
|
headers: _headers,
|
|
103
103
|
contentType: "application/json",
|
|
104
|
-
|
|
104
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
105
105
|
requestType: "json",
|
|
106
106
|
body: request,
|
|
107
107
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
@@ -165,7 +165,7 @@ class TasksClient {
|
|
|
165
165
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LatticeEnvironment.Default, `api/v1/tasks/${core.url.encodePathParam(taskId)}`),
|
|
166
166
|
method: "GET",
|
|
167
167
|
headers: _headers,
|
|
168
|
-
|
|
168
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
169
169
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
170
170
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
171
171
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -233,7 +233,7 @@ class TasksClient {
|
|
|
233
233
|
method: "PUT",
|
|
234
234
|
headers: _headers,
|
|
235
235
|
contentType: "application/json",
|
|
236
|
-
|
|
236
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
237
237
|
requestType: "json",
|
|
238
238
|
body: _body,
|
|
239
239
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
@@ -304,7 +304,7 @@ class TasksClient {
|
|
|
304
304
|
method: "PUT",
|
|
305
305
|
headers: _headers,
|
|
306
306
|
contentType: "application/json",
|
|
307
|
-
|
|
307
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
308
308
|
requestType: "json",
|
|
309
309
|
body: _body,
|
|
310
310
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
@@ -375,7 +375,7 @@ class TasksClient {
|
|
|
375
375
|
method: "POST",
|
|
376
376
|
headers: _headers,
|
|
377
377
|
contentType: "application/json",
|
|
378
|
-
|
|
378
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
379
379
|
requestType: "json",
|
|
380
380
|
body: request,
|
|
381
381
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
@@ -427,7 +427,7 @@ class TasksClient {
|
|
|
427
427
|
method: "POST",
|
|
428
428
|
headers: _headers,
|
|
429
429
|
contentType: "application/json",
|
|
430
|
-
|
|
430
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
431
431
|
requestType: "json",
|
|
432
432
|
body: request,
|
|
433
433
|
responseType: "sse",
|
|
@@ -511,7 +511,7 @@ class TasksClient {
|
|
|
511
511
|
method: "POST",
|
|
512
512
|
headers: _headers,
|
|
513
513
|
contentType: "application/json",
|
|
514
|
-
|
|
514
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
515
515
|
requestType: "json",
|
|
516
516
|
body: request,
|
|
517
517
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
@@ -574,7 +574,7 @@ class TasksClient {
|
|
|
574
574
|
method: "POST",
|
|
575
575
|
headers: _headers,
|
|
576
576
|
contentType: "application/json",
|
|
577
|
-
|
|
577
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
578
578
|
requestType: "json",
|
|
579
579
|
body: request,
|
|
580
580
|
responseType: "sse",
|
|
@@ -645,7 +645,7 @@ class TasksClient {
|
|
|
645
645
|
method: "POST",
|
|
646
646
|
headers: _headers,
|
|
647
647
|
contentType: "application/json",
|
|
648
|
-
|
|
648
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
649
649
|
requestType: "json",
|
|
650
650
|
body: _body,
|
|
651
651
|
responseType: "sse",
|
|
@@ -8,7 +8,13 @@ export declare namespace Fetcher {
|
|
|
8
8
|
method: string;
|
|
9
9
|
contentType?: string;
|
|
10
10
|
headers?: Record<string, unknown>;
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Prefer `queryString` (produced by `core.url.queryBuilder()`).
|
|
13
|
+
* Retained for backwards compatibility with custom fetchers and callers that
|
|
14
|
+
* still construct request args with a query-parameter object.
|
|
15
|
+
*/
|
|
11
16
|
queryParameters?: Record<string, unknown>;
|
|
17
|
+
queryString?: string;
|
|
12
18
|
body?: unknown;
|
|
13
19
|
timeoutMs?: number;
|
|
14
20
|
maxRetries?: number;
|
|
@@ -75,16 +75,11 @@ const SENSITIVE_QUERY_PARAMS = new Set([
|
|
|
75
75
|
]);
|
|
76
76
|
function redactQueryParameters(queryParameters) {
|
|
77
77
|
if (queryParameters == null) {
|
|
78
|
-
return
|
|
78
|
+
return undefined;
|
|
79
79
|
}
|
|
80
80
|
const redacted = {};
|
|
81
81
|
for (const [key, value] of Object.entries(queryParameters)) {
|
|
82
|
-
|
|
83
|
-
redacted[key] = "[REDACTED]";
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
redacted[key] = value;
|
|
87
|
-
}
|
|
82
|
+
redacted[key] = SENSITIVE_QUERY_PARAMS.has(key.toLowerCase()) ? "[REDACTED]" : value;
|
|
88
83
|
}
|
|
89
84
|
return redacted;
|
|
90
85
|
}
|
|
@@ -186,7 +181,13 @@ function getHeaders(args) {
|
|
|
186
181
|
function fetcherImpl(args) {
|
|
187
182
|
return __awaiter(this, void 0, void 0, function* () {
|
|
188
183
|
var _a, _b, _c;
|
|
189
|
-
|
|
184
|
+
let url = args.url;
|
|
185
|
+
if (args.queryString != null && args.queryString.length > 0) {
|
|
186
|
+
url = `${url}?${args.queryString}`;
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
url = (0, createRequestUrl_js_1.createRequestUrl)(args.url, args.queryParameters);
|
|
190
|
+
}
|
|
190
191
|
const requestBody = yield (0, getRequestBody_js_1.getRequestBody)({
|
|
191
192
|
body: args.body,
|
|
192
193
|
type: (_a = args.requestType) !== null && _a !== void 0 ? _a : "other",
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a fluent builder for constructing URL query strings.
|
|
3
|
+
*
|
|
4
|
+
* Each `.add()` call serializes its value immediately (like C#'s builder),
|
|
5
|
+
* so no format tracking is needed — the style is applied at add-time.
|
|
6
|
+
*
|
|
7
|
+
* Usage (generated code):
|
|
8
|
+
*
|
|
9
|
+
* const qs = core.url.queryBuilder()
|
|
10
|
+
* .add("limit", limit)
|
|
11
|
+
* .add("tags", tags, { style: "comma" }) // explode: false
|
|
12
|
+
* .mergeAdditional(requestOptions?.queryParams)
|
|
13
|
+
* .build();
|
|
14
|
+
*/
|
|
15
|
+
export declare function queryBuilder(): QueryStringBuilder;
|
|
16
|
+
declare class QueryStringBuilder {
|
|
17
|
+
private parts;
|
|
18
|
+
/**
|
|
19
|
+
* Adds a query parameter, serializing it immediately.
|
|
20
|
+
*
|
|
21
|
+
* By default arrays use "repeat" format (`key=a&key=b`).
|
|
22
|
+
* Pass `{ style: "comma" }` for OpenAPI `explode: false` parameters
|
|
23
|
+
* to get comma-separated values (`key=a,b,c`).
|
|
24
|
+
*
|
|
25
|
+
* Null / undefined values are silently skipped.
|
|
26
|
+
*/
|
|
27
|
+
add(key: string, value: unknown, options?: {
|
|
28
|
+
style?: "comma";
|
|
29
|
+
}): this;
|
|
30
|
+
/**
|
|
31
|
+
* Adds multiple query parameters at once from a record.
|
|
32
|
+
* All parameters use the default "repeat" array format.
|
|
33
|
+
* Null / undefined values are silently skipped.
|
|
34
|
+
*/
|
|
35
|
+
addMany(params: Record<string, unknown>): this;
|
|
36
|
+
/**
|
|
37
|
+
* Merges additional query parameters supplied at call-time via
|
|
38
|
+
* `requestOptions.queryParams`. Overrides existing keys (last-write-wins).
|
|
39
|
+
*/
|
|
40
|
+
mergeAdditional(additionalParams?: Record<string, unknown>): this;
|
|
41
|
+
/**
|
|
42
|
+
* Returns the assembled query string (without the leading `?`).
|
|
43
|
+
* Returns an empty string when no parameters were added.
|
|
44
|
+
*/
|
|
45
|
+
build(): string;
|
|
46
|
+
}
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.queryBuilder = queryBuilder;
|
|
4
|
+
const qs_js_1 = require("./qs.js");
|
|
5
|
+
/**
|
|
6
|
+
* Creates a fluent builder for constructing URL query strings.
|
|
7
|
+
*
|
|
8
|
+
* Each `.add()` call serializes its value immediately (like C#'s builder),
|
|
9
|
+
* so no format tracking is needed — the style is applied at add-time.
|
|
10
|
+
*
|
|
11
|
+
* Usage (generated code):
|
|
12
|
+
*
|
|
13
|
+
* const qs = core.url.queryBuilder()
|
|
14
|
+
* .add("limit", limit)
|
|
15
|
+
* .add("tags", tags, { style: "comma" }) // explode: false
|
|
16
|
+
* .mergeAdditional(requestOptions?.queryParams)
|
|
17
|
+
* .build();
|
|
18
|
+
*/
|
|
19
|
+
function queryBuilder() {
|
|
20
|
+
return new QueryStringBuilder();
|
|
21
|
+
}
|
|
22
|
+
class QueryStringBuilder {
|
|
23
|
+
constructor() {
|
|
24
|
+
this.parts = new Map();
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Adds a query parameter, serializing it immediately.
|
|
28
|
+
*
|
|
29
|
+
* By default arrays use "repeat" format (`key=a&key=b`).
|
|
30
|
+
* Pass `{ style: "comma" }` for OpenAPI `explode: false` parameters
|
|
31
|
+
* to get comma-separated values (`key=a,b,c`).
|
|
32
|
+
*
|
|
33
|
+
* Null / undefined values are silently skipped.
|
|
34
|
+
*/
|
|
35
|
+
add(key, value, options) {
|
|
36
|
+
if (value === undefined || value === null) {
|
|
37
|
+
return this;
|
|
38
|
+
}
|
|
39
|
+
const serialized = (0, qs_js_1.toQueryString)({ [key]: value }, { arrayFormat: (options === null || options === void 0 ? void 0 : options.style) === "comma" ? "comma" : "repeat" });
|
|
40
|
+
if (serialized.length > 0) {
|
|
41
|
+
this.parts.set(key, serialized);
|
|
42
|
+
}
|
|
43
|
+
return this;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Adds multiple query parameters at once from a record.
|
|
47
|
+
* All parameters use the default "repeat" array format.
|
|
48
|
+
* Null / undefined values are silently skipped.
|
|
49
|
+
*/
|
|
50
|
+
addMany(params) {
|
|
51
|
+
if (params != null) {
|
|
52
|
+
for (const [key, value] of Object.entries(params)) {
|
|
53
|
+
this.add(key, value);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return this;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Merges additional query parameters supplied at call-time via
|
|
60
|
+
* `requestOptions.queryParams`. Overrides existing keys (last-write-wins).
|
|
61
|
+
*/
|
|
62
|
+
mergeAdditional(additionalParams) {
|
|
63
|
+
if (additionalParams != null) {
|
|
64
|
+
for (const [key, value] of Object.entries(additionalParams)) {
|
|
65
|
+
if (value === undefined || value === null) {
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
const serialized = (0, qs_js_1.toQueryString)({ [key]: value }, { arrayFormat: "repeat" });
|
|
69
|
+
if (serialized.length > 0) {
|
|
70
|
+
this.parts.set(key, serialized);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return this;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Returns the assembled query string (without the leading `?`).
|
|
78
|
+
* Returns an empty string when no parameters were added.
|
|
79
|
+
*/
|
|
80
|
+
build() {
|
|
81
|
+
return [...this.parts.values()].join("&");
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toQueryString = exports.join = exports.encodePathParam = void 0;
|
|
3
|
+
exports.toQueryString = exports.queryBuilder = exports.join = exports.encodePathParam = void 0;
|
|
4
4
|
var encodePathParam_js_1 = require("./encodePathParam.js");
|
|
5
5
|
Object.defineProperty(exports, "encodePathParam", { enumerable: true, get: function () { return encodePathParam_js_1.encodePathParam; } });
|
|
6
6
|
var join_js_1 = require("./join.js");
|
|
7
7
|
Object.defineProperty(exports, "join", { enumerable: true, get: function () { return join_js_1.join; } });
|
|
8
|
+
var QueryStringBuilder_js_1 = require("./QueryStringBuilder.js");
|
|
9
|
+
Object.defineProperty(exports, "queryBuilder", { enumerable: true, get: function () { return QueryStringBuilder_js_1.queryBuilder; } });
|
|
8
10
|
var qs_js_1 = require("./qs.js");
|
|
9
11
|
Object.defineProperty(exports, "toQueryString", { enumerable: true, get: function () { return qs_js_1.toQueryString; } });
|
package/dist/cjs/core/url/qs.js
CHANGED
|
@@ -26,19 +26,31 @@ function stringifyObject(obj, prefix = "", options) {
|
|
|
26
26
|
if (value.length === 0) {
|
|
27
27
|
continue;
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
const effectiveFormat = options.arrayFormat;
|
|
30
|
+
if (effectiveFormat === "comma") {
|
|
31
|
+
const encodedKey = options.encode ? encodeURIComponent(fullKey) : fullKey;
|
|
32
|
+
const encodedValues = value
|
|
33
|
+
.filter((item) => item !== undefined && item !== null)
|
|
34
|
+
.map((item) => encodeValue(item, options.encode));
|
|
35
|
+
if (encodedValues.length > 0) {
|
|
36
|
+
parts.push(`${encodedKey}=${encodedValues.join(",")}`);
|
|
33
37
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
for (let i = 0; i < value.length; i++) {
|
|
41
|
+
const item = value[i];
|
|
42
|
+
if (item === undefined) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
if (typeof item === "object" && !Array.isArray(item) && item !== null) {
|
|
46
|
+
const arrayKey = effectiveFormat === "indices" ? `${fullKey}[${i}]` : fullKey;
|
|
47
|
+
parts.push(...stringifyObject(item, arrayKey, options));
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
const arrayKey = effectiveFormat === "indices" ? `${fullKey}[${i}]` : fullKey;
|
|
51
|
+
const encodedKey = options.encode ? encodeURIComponent(arrayKey) : arrayKey;
|
|
52
|
+
parts.push(`${encodedKey}=${encodeValue(item, options.encode)}`);
|
|
53
|
+
}
|
|
42
54
|
}
|
|
43
55
|
}
|
|
44
56
|
}
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "4.
|
|
1
|
+
export declare const SDK_VERSION = "4.7.1";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "@anduril-industries/lattice-sdk",
|
|
9
|
-
"X-Fern-SDK-Version": "4.
|
|
10
|
-
"User-Agent": "@anduril-industries/lattice-sdk/4.
|
|
9
|
+
"X-Fern-SDK-Version": "4.7.1",
|
|
10
|
+
"User-Agent": "@anduril-industries/lattice-sdk/4.7.1",
|
|
11
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
13
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -64,7 +64,7 @@ export class EntitiesClient {
|
|
|
64
64
|
method: "PUT",
|
|
65
65
|
headers: _headers,
|
|
66
66
|
contentType: "application/json",
|
|
67
|
-
|
|
67
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
68
68
|
requestType: "json",
|
|
69
69
|
body: request,
|
|
70
70
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
@@ -119,7 +119,7 @@ export class EntitiesClient {
|
|
|
119
119
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LatticeEnvironment.Default, `api/v1/entities/${core.url.encodePathParam(entityId)}`),
|
|
120
120
|
method: "GET",
|
|
121
121
|
headers: _headers,
|
|
122
|
-
|
|
122
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
123
123
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
124
124
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
125
125
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -184,7 +184,7 @@ export class EntitiesClient {
|
|
|
184
184
|
method: "PUT",
|
|
185
185
|
headers: _headers,
|
|
186
186
|
contentType: "application/json",
|
|
187
|
-
|
|
187
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
188
188
|
requestType: "json",
|
|
189
189
|
body: _body,
|
|
190
190
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
@@ -244,7 +244,7 @@ export class EntitiesClient {
|
|
|
244
244
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LatticeEnvironment.Default, `api/v1/entities/${core.url.encodePathParam(entityId)}/override/${core.url.encodePathParam(fieldPath)}`),
|
|
245
245
|
method: "DELETE",
|
|
246
246
|
headers: _headers,
|
|
247
|
-
|
|
247
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
248
248
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
249
249
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
250
250
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -311,7 +311,7 @@ export class EntitiesClient {
|
|
|
311
311
|
method: "POST",
|
|
312
312
|
headers: _headers,
|
|
313
313
|
contentType: "application/json",
|
|
314
|
-
|
|
314
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
315
315
|
requestType: "json",
|
|
316
316
|
body: request,
|
|
317
317
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
@@ -382,7 +382,7 @@ export class EntitiesClient {
|
|
|
382
382
|
method: "POST",
|
|
383
383
|
headers: _headers,
|
|
384
384
|
contentType: "application/json",
|
|
385
|
-
|
|
385
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
386
386
|
requestType: "json",
|
|
387
387
|
body: request,
|
|
388
388
|
responseType: "sse",
|
|
@@ -45,7 +45,7 @@ export class OauthClient {
|
|
|
45
45
|
method: "POST",
|
|
46
46
|
headers: _headers,
|
|
47
47
|
contentType: "application/x-www-form-urlencoded",
|
|
48
|
-
|
|
48
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
49
49
|
requestType: "form",
|
|
50
50
|
body: Object.assign(Object.assign({}, request), { grant_type: "client_credentials" }),
|
|
51
51
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
@@ -55,7 +55,11 @@ export class ObjectsClient {
|
|
|
55
55
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LatticeEnvironment.Default, "api/v1/objects"),
|
|
56
56
|
method: "GET",
|
|
57
57
|
headers: _headers,
|
|
58
|
-
|
|
58
|
+
queryString: core.url
|
|
59
|
+
.queryBuilder()
|
|
60
|
+
.addMany(_queryParams)
|
|
61
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
62
|
+
.build(),
|
|
59
63
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
60
64
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
61
65
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -119,7 +123,7 @@ export class ObjectsClient {
|
|
|
119
123
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LatticeEnvironment.Default, `api/v1/objects/${core.url.encodePathParam(objectPath)}`),
|
|
120
124
|
method: "GET",
|
|
121
125
|
headers: _headers,
|
|
122
|
-
|
|
126
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
123
127
|
responseType: "binary-response",
|
|
124
128
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
125
129
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
@@ -184,7 +188,7 @@ export class ObjectsClient {
|
|
|
184
188
|
method: "POST",
|
|
185
189
|
headers: _headers,
|
|
186
190
|
contentType: "application/octet-stream",
|
|
187
|
-
|
|
191
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
188
192
|
requestType: "bytes",
|
|
189
193
|
duplex: "half",
|
|
190
194
|
body: _binaryUploadRequest.body,
|
|
@@ -251,7 +255,7 @@ export class ObjectsClient {
|
|
|
251
255
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LatticeEnvironment.Default, `api/v1/objects/${core.url.encodePathParam(objectPath)}`),
|
|
252
256
|
method: "DELETE",
|
|
253
257
|
headers: _headers,
|
|
254
|
-
|
|
258
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
255
259
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
256
260
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
257
261
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -312,7 +316,7 @@ export class ObjectsClient {
|
|
|
312
316
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LatticeEnvironment.Default, `api/v1/objects/${core.url.encodePathParam(objectPath)}`),
|
|
313
317
|
method: "HEAD",
|
|
314
318
|
headers: _headers,
|
|
315
|
-
|
|
319
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
316
320
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
317
321
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
318
322
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -65,7 +65,7 @@ export class TasksClient {
|
|
|
65
65
|
method: "POST",
|
|
66
66
|
headers: _headers,
|
|
67
67
|
contentType: "application/json",
|
|
68
|
-
|
|
68
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
69
69
|
requestType: "json",
|
|
70
70
|
body: request,
|
|
71
71
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
@@ -129,7 +129,7 @@ export class TasksClient {
|
|
|
129
129
|
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.LatticeEnvironment.Default, `api/v1/tasks/${core.url.encodePathParam(taskId)}`),
|
|
130
130
|
method: "GET",
|
|
131
131
|
headers: _headers,
|
|
132
|
-
|
|
132
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
133
133
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
134
134
|
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
135
135
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -197,7 +197,7 @@ export class TasksClient {
|
|
|
197
197
|
method: "PUT",
|
|
198
198
|
headers: _headers,
|
|
199
199
|
contentType: "application/json",
|
|
200
|
-
|
|
200
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
201
201
|
requestType: "json",
|
|
202
202
|
body: _body,
|
|
203
203
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
@@ -268,7 +268,7 @@ export class TasksClient {
|
|
|
268
268
|
method: "PUT",
|
|
269
269
|
headers: _headers,
|
|
270
270
|
contentType: "application/json",
|
|
271
|
-
|
|
271
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
272
272
|
requestType: "json",
|
|
273
273
|
body: _body,
|
|
274
274
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
@@ -339,7 +339,7 @@ export class TasksClient {
|
|
|
339
339
|
method: "POST",
|
|
340
340
|
headers: _headers,
|
|
341
341
|
contentType: "application/json",
|
|
342
|
-
|
|
342
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
343
343
|
requestType: "json",
|
|
344
344
|
body: request,
|
|
345
345
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
@@ -391,7 +391,7 @@ export class TasksClient {
|
|
|
391
391
|
method: "POST",
|
|
392
392
|
headers: _headers,
|
|
393
393
|
contentType: "application/json",
|
|
394
|
-
|
|
394
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
395
395
|
requestType: "json",
|
|
396
396
|
body: request,
|
|
397
397
|
responseType: "sse",
|
|
@@ -475,7 +475,7 @@ export class TasksClient {
|
|
|
475
475
|
method: "POST",
|
|
476
476
|
headers: _headers,
|
|
477
477
|
contentType: "application/json",
|
|
478
|
-
|
|
478
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
479
479
|
requestType: "json",
|
|
480
480
|
body: request,
|
|
481
481
|
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
@@ -538,7 +538,7 @@ export class TasksClient {
|
|
|
538
538
|
method: "POST",
|
|
539
539
|
headers: _headers,
|
|
540
540
|
contentType: "application/json",
|
|
541
|
-
|
|
541
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
542
542
|
requestType: "json",
|
|
543
543
|
body: request,
|
|
544
544
|
responseType: "sse",
|
|
@@ -609,7 +609,7 @@ export class TasksClient {
|
|
|
609
609
|
method: "POST",
|
|
610
610
|
headers: _headers,
|
|
611
611
|
contentType: "application/json",
|
|
612
|
-
|
|
612
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
613
613
|
requestType: "json",
|
|
614
614
|
body: _body,
|
|
615
615
|
responseType: "sse",
|
|
@@ -8,7 +8,13 @@ export declare namespace Fetcher {
|
|
|
8
8
|
method: string;
|
|
9
9
|
contentType?: string;
|
|
10
10
|
headers?: Record<string, unknown>;
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Prefer `queryString` (produced by `core.url.queryBuilder()`).
|
|
13
|
+
* Retained for backwards compatibility with custom fetchers and callers that
|
|
14
|
+
* still construct request args with a query-parameter object.
|
|
15
|
+
*/
|
|
11
16
|
queryParameters?: Record<string, unknown>;
|
|
17
|
+
queryString?: string;
|
|
12
18
|
body?: unknown;
|
|
13
19
|
timeoutMs?: number;
|
|
14
20
|
maxRetries?: number;
|
|
@@ -71,16 +71,11 @@ const SENSITIVE_QUERY_PARAMS = new Set([
|
|
|
71
71
|
]);
|
|
72
72
|
function redactQueryParameters(queryParameters) {
|
|
73
73
|
if (queryParameters == null) {
|
|
74
|
-
return
|
|
74
|
+
return undefined;
|
|
75
75
|
}
|
|
76
76
|
const redacted = {};
|
|
77
77
|
for (const [key, value] of Object.entries(queryParameters)) {
|
|
78
|
-
|
|
79
|
-
redacted[key] = "[REDACTED]";
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
redacted[key] = value;
|
|
83
|
-
}
|
|
78
|
+
redacted[key] = SENSITIVE_QUERY_PARAMS.has(key.toLowerCase()) ? "[REDACTED]" : value;
|
|
84
79
|
}
|
|
85
80
|
return redacted;
|
|
86
81
|
}
|
|
@@ -182,7 +177,13 @@ function getHeaders(args) {
|
|
|
182
177
|
export function fetcherImpl(args) {
|
|
183
178
|
return __awaiter(this, void 0, void 0, function* () {
|
|
184
179
|
var _a, _b, _c;
|
|
185
|
-
|
|
180
|
+
let url = args.url;
|
|
181
|
+
if (args.queryString != null && args.queryString.length > 0) {
|
|
182
|
+
url = `${url}?${args.queryString}`;
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
url = createRequestUrl(args.url, args.queryParameters);
|
|
186
|
+
}
|
|
186
187
|
const requestBody = yield getRequestBody({
|
|
187
188
|
body: args.body,
|
|
188
189
|
type: (_a = args.requestType) !== null && _a !== void 0 ? _a : "other",
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a fluent builder for constructing URL query strings.
|
|
3
|
+
*
|
|
4
|
+
* Each `.add()` call serializes its value immediately (like C#'s builder),
|
|
5
|
+
* so no format tracking is needed — the style is applied at add-time.
|
|
6
|
+
*
|
|
7
|
+
* Usage (generated code):
|
|
8
|
+
*
|
|
9
|
+
* const qs = core.url.queryBuilder()
|
|
10
|
+
* .add("limit", limit)
|
|
11
|
+
* .add("tags", tags, { style: "comma" }) // explode: false
|
|
12
|
+
* .mergeAdditional(requestOptions?.queryParams)
|
|
13
|
+
* .build();
|
|
14
|
+
*/
|
|
15
|
+
export declare function queryBuilder(): QueryStringBuilder;
|
|
16
|
+
declare class QueryStringBuilder {
|
|
17
|
+
private parts;
|
|
18
|
+
/**
|
|
19
|
+
* Adds a query parameter, serializing it immediately.
|
|
20
|
+
*
|
|
21
|
+
* By default arrays use "repeat" format (`key=a&key=b`).
|
|
22
|
+
* Pass `{ style: "comma" }` for OpenAPI `explode: false` parameters
|
|
23
|
+
* to get comma-separated values (`key=a,b,c`).
|
|
24
|
+
*
|
|
25
|
+
* Null / undefined values are silently skipped.
|
|
26
|
+
*/
|
|
27
|
+
add(key: string, value: unknown, options?: {
|
|
28
|
+
style?: "comma";
|
|
29
|
+
}): this;
|
|
30
|
+
/**
|
|
31
|
+
* Adds multiple query parameters at once from a record.
|
|
32
|
+
* All parameters use the default "repeat" array format.
|
|
33
|
+
* Null / undefined values are silently skipped.
|
|
34
|
+
*/
|
|
35
|
+
addMany(params: Record<string, unknown>): this;
|
|
36
|
+
/**
|
|
37
|
+
* Merges additional query parameters supplied at call-time via
|
|
38
|
+
* `requestOptions.queryParams`. Overrides existing keys (last-write-wins).
|
|
39
|
+
*/
|
|
40
|
+
mergeAdditional(additionalParams?: Record<string, unknown>): this;
|
|
41
|
+
/**
|
|
42
|
+
* Returns the assembled query string (without the leading `?`).
|
|
43
|
+
* Returns an empty string when no parameters were added.
|
|
44
|
+
*/
|
|
45
|
+
build(): string;
|
|
46
|
+
}
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { toQueryString } from "./qs.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a fluent builder for constructing URL query strings.
|
|
4
|
+
*
|
|
5
|
+
* Each `.add()` call serializes its value immediately (like C#'s builder),
|
|
6
|
+
* so no format tracking is needed — the style is applied at add-time.
|
|
7
|
+
*
|
|
8
|
+
* Usage (generated code):
|
|
9
|
+
*
|
|
10
|
+
* const qs = core.url.queryBuilder()
|
|
11
|
+
* .add("limit", limit)
|
|
12
|
+
* .add("tags", tags, { style: "comma" }) // explode: false
|
|
13
|
+
* .mergeAdditional(requestOptions?.queryParams)
|
|
14
|
+
* .build();
|
|
15
|
+
*/
|
|
16
|
+
export function queryBuilder() {
|
|
17
|
+
return new QueryStringBuilder();
|
|
18
|
+
}
|
|
19
|
+
class QueryStringBuilder {
|
|
20
|
+
constructor() {
|
|
21
|
+
this.parts = new Map();
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Adds a query parameter, serializing it immediately.
|
|
25
|
+
*
|
|
26
|
+
* By default arrays use "repeat" format (`key=a&key=b`).
|
|
27
|
+
* Pass `{ style: "comma" }` for OpenAPI `explode: false` parameters
|
|
28
|
+
* to get comma-separated values (`key=a,b,c`).
|
|
29
|
+
*
|
|
30
|
+
* Null / undefined values are silently skipped.
|
|
31
|
+
*/
|
|
32
|
+
add(key, value, options) {
|
|
33
|
+
if (value === undefined || value === null) {
|
|
34
|
+
return this;
|
|
35
|
+
}
|
|
36
|
+
const serialized = toQueryString({ [key]: value }, { arrayFormat: (options === null || options === void 0 ? void 0 : options.style) === "comma" ? "comma" : "repeat" });
|
|
37
|
+
if (serialized.length > 0) {
|
|
38
|
+
this.parts.set(key, serialized);
|
|
39
|
+
}
|
|
40
|
+
return this;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Adds multiple query parameters at once from a record.
|
|
44
|
+
* All parameters use the default "repeat" array format.
|
|
45
|
+
* Null / undefined values are silently skipped.
|
|
46
|
+
*/
|
|
47
|
+
addMany(params) {
|
|
48
|
+
if (params != null) {
|
|
49
|
+
for (const [key, value] of Object.entries(params)) {
|
|
50
|
+
this.add(key, value);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Merges additional query parameters supplied at call-time via
|
|
57
|
+
* `requestOptions.queryParams`. Overrides existing keys (last-write-wins).
|
|
58
|
+
*/
|
|
59
|
+
mergeAdditional(additionalParams) {
|
|
60
|
+
if (additionalParams != null) {
|
|
61
|
+
for (const [key, value] of Object.entries(additionalParams)) {
|
|
62
|
+
if (value === undefined || value === null) {
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
const serialized = toQueryString({ [key]: value }, { arrayFormat: "repeat" });
|
|
66
|
+
if (serialized.length > 0) {
|
|
67
|
+
this.parts.set(key, serialized);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return this;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Returns the assembled query string (without the leading `?`).
|
|
75
|
+
* Returns an empty string when no parameters were added.
|
|
76
|
+
*/
|
|
77
|
+
build() {
|
|
78
|
+
return [...this.parts.values()].join("&");
|
|
79
|
+
}
|
|
80
|
+
}
|
package/dist/esm/core/url/qs.mjs
CHANGED
|
@@ -23,19 +23,31 @@ function stringifyObject(obj, prefix = "", options) {
|
|
|
23
23
|
if (value.length === 0) {
|
|
24
24
|
continue;
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
const effectiveFormat = options.arrayFormat;
|
|
27
|
+
if (effectiveFormat === "comma") {
|
|
28
|
+
const encodedKey = options.encode ? encodeURIComponent(fullKey) : fullKey;
|
|
29
|
+
const encodedValues = value
|
|
30
|
+
.filter((item) => item !== undefined && item !== null)
|
|
31
|
+
.map((item) => encodeValue(item, options.encode));
|
|
32
|
+
if (encodedValues.length > 0) {
|
|
33
|
+
parts.push(`${encodedKey}=${encodedValues.join(",")}`);
|
|
30
34
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
for (let i = 0; i < value.length; i++) {
|
|
38
|
+
const item = value[i];
|
|
39
|
+
if (item === undefined) {
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (typeof item === "object" && !Array.isArray(item) && item !== null) {
|
|
43
|
+
const arrayKey = effectiveFormat === "indices" ? `${fullKey}[${i}]` : fullKey;
|
|
44
|
+
parts.push(...stringifyObject(item, arrayKey, options));
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
const arrayKey = effectiveFormat === "indices" ? `${fullKey}[${i}]` : fullKey;
|
|
48
|
+
const encodedKey = options.encode ? encodeURIComponent(arrayKey) : arrayKey;
|
|
49
|
+
parts.push(`${encodedKey}=${encodeValue(item, options.encode)}`);
|
|
50
|
+
}
|
|
39
51
|
}
|
|
40
52
|
}
|
|
41
53
|
}
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "4.
|
|
1
|
+
export declare const SDK_VERSION = "4.7.1";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "4.
|
|
1
|
+
export const SDK_VERSION = "4.7.1";
|