@planqk/planqk-api-sdk 1.3.6 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.fossa.yml +1 -0
- package/.gitlab-ci.yml +21 -14
- package/.releaserc.json +2 -1
- package/dist/sdk/Client.d.ts +8 -0
- package/dist/sdk/Client.js +12 -2
- package/dist/sdk/api/resources/dataPools/client/Client.d.ts +4 -1
- package/dist/sdk/api/resources/dataPools/client/Client.js +57 -39
- package/dist/sdk/api/resources/dataPools/client/requests/AddDataPoolFileRequest.d.ts +1 -1
- package/dist/sdk/api/resources/dataPools/client/requests/CreateDataPoolRequest.d.ts +1 -0
- package/dist/sdk/api/resources/dataPools/client/requests/UpdateDataPoolRequest.d.ts +3 -0
- package/dist/sdk/api/resources/index.d.ts +3 -0
- package/dist/sdk/api/resources/index.js +4 -1
- package/dist/sdk/api/resources/serviceExecutions/client/Client.d.ts +90 -0
- package/dist/sdk/api/resources/serviceExecutions/client/Client.js +271 -0
- package/dist/sdk/api/resources/serviceExecutions/client/index.d.ts +1 -0
- package/dist/sdk/api/resources/serviceExecutions/index.d.ts +1 -0
- package/dist/sdk/api/resources/serviceExecutions/index.js +17 -0
- package/dist/sdk/api/resources/serviceJobs/client/Client.d.ts +138 -0
- package/dist/sdk/api/resources/serviceJobs/client/Client.js +489 -0
- package/dist/sdk/api/resources/serviceJobs/client/index.d.ts +2 -0
- package/dist/sdk/api/resources/serviceJobs/client/index.js +17 -0
- package/dist/sdk/api/resources/serviceJobs/client/requests/CreateServiceJobRequest.d.ts +15 -0
- package/dist/sdk/api/resources/serviceJobs/client/requests/CreateServiceJobRequest.js +5 -0
- package/dist/sdk/api/resources/serviceJobs/client/requests/index.d.ts +1 -0
- package/dist/sdk/api/resources/serviceJobs/client/requests/index.js +2 -0
- package/dist/sdk/api/resources/serviceJobs/index.d.ts +1 -0
- package/dist/sdk/api/resources/serviceJobs/index.js +17 -0
- package/dist/sdk/api/types/ActivityInstance.d.ts +20 -0
- package/dist/sdk/api/types/ActivityInstance.js +14 -0
- package/dist/sdk/api/types/DataPoolDto.d.ts +5 -0
- package/dist/sdk/api/types/DataPoolFileDto.d.ts +7 -0
- package/dist/sdk/api/types/LogEntry.d.ts +24 -0
- package/dist/sdk/api/types/LogEntry.js +16 -0
- package/dist/sdk/api/types/MetricDataPoint.d.ts +12 -0
- package/dist/sdk/api/types/MetricDataPoint.js +5 -0
- package/dist/sdk/api/types/ServiceExecutionDto.d.ts +21 -0
- package/dist/sdk/api/types/ServiceExecutionDto.js +17 -0
- package/dist/sdk/api/types/ServiceExecutionLogs.d.ts +5 -0
- package/dist/sdk/api/types/ServiceExecutionLogs.js +5 -0
- package/dist/sdk/api/types/ServiceExecutionMetrics.d.ts +23 -0
- package/dist/sdk/api/types/ServiceExecutionMetrics.js +5 -0
- package/dist/sdk/api/types/ServiceJobDto.d.ts +46 -0
- package/dist/sdk/api/types/ServiceJobDto.js +22 -0
- package/dist/sdk/api/types/VariableInstance.d.ts +9 -0
- package/dist/sdk/api/types/VariableInstance.js +5 -0
- package/dist/sdk/api/types/WorkflowInstance.d.ts +23 -0
- package/dist/sdk/api/types/WorkflowInstance.js +17 -0
- package/dist/sdk/api/types/WorkflowServiceExecutionDto.d.ts +8 -0
- package/dist/sdk/api/types/WorkflowServiceExecutionDto.js +5 -0
- package/dist/sdk/api/types/index.d.ts +10 -0
- package/dist/sdk/api/types/index.js +10 -0
- package/dist/sdk/core/exports.d.ts +1 -0
- package/dist/sdk/core/exports.js +17 -0
- package/dist/sdk/core/fetcher/Fetcher.d.ts +1 -1
- package/dist/sdk/core/fetcher/Fetcher.js +2 -2
- package/dist/sdk/core/fetcher/index.d.ts +5 -5
- package/dist/sdk/core/fetcher/index.js +5 -5
- package/dist/sdk/core/file/exports.d.ts +1 -0
- package/dist/sdk/core/file/exports.js +2 -0
- package/dist/sdk/core/file/file.d.ts +5 -0
- package/dist/sdk/core/file/file.js +185 -0
- package/dist/sdk/core/file/index.d.ts +2 -0
- package/dist/sdk/core/file/index.js +18 -0
- package/dist/sdk/core/file/types.d.ts +66 -0
- package/dist/sdk/core/file/types.js +2 -0
- package/dist/sdk/core/form-data-utils/FormDataWrapper.js +12 -3
- package/dist/sdk/core/index.d.ts +1 -1
- package/dist/sdk/core/index.js +2 -2
- package/dist/sdk/core/url/join.js +23 -3
- package/dist/sdk/exports.d.ts +1 -0
- package/dist/sdk/exports.js +17 -0
- package/dist/sdk/index.d.ts +1 -0
- package/dist/sdk/index.js +4 -0
- package/fern/fern.config.json +1 -1
- package/fern/generators.yml +9 -3
- package/fern/openapi/openapi.json +950 -54
- package/package.json +1 -1
- package/planqk/api/_version.py +1 -1
- package/pyproject.toml +1 -1
- package/requirements.txt +319 -0
- package/scripts/update-version.sh +2 -0
- package/src/index.test.ts +11 -0
- package/src/sdk/Client.ts +14 -0
- package/src/sdk/api/resources/dataPools/client/Client.ts +95 -75
- package/src/sdk/api/resources/dataPools/client/requests/AddDataPoolFileRequest.ts +1 -1
- package/src/sdk/api/resources/dataPools/client/requests/CreateDataPoolRequest.ts +1 -0
- package/src/sdk/api/resources/dataPools/client/requests/UpdateDataPoolRequest.ts +3 -0
- package/src/sdk/api/resources/index.ts +3 -0
- package/src/sdk/api/resources/serviceExecutions/client/Client.ts +323 -0
- package/src/sdk/api/resources/serviceExecutions/client/index.ts +1 -0
- package/src/sdk/api/resources/serviceExecutions/index.ts +1 -0
- package/src/sdk/api/resources/serviceJobs/client/Client.ts +581 -0
- package/src/sdk/api/resources/serviceJobs/client/index.ts +2 -0
- package/src/sdk/api/resources/serviceJobs/client/requests/CreateServiceJobRequest.ts +16 -0
- package/src/sdk/api/resources/serviceJobs/client/requests/index.ts +1 -0
- package/src/sdk/api/resources/serviceJobs/index.ts +1 -0
- package/src/sdk/api/types/ActivityInstance.ts +22 -0
- package/src/sdk/api/types/DataPoolDto.ts +5 -0
- package/src/sdk/api/types/DataPoolFileDto.ts +7 -0
- package/src/sdk/api/types/LogEntry.ts +26 -0
- package/src/sdk/api/types/MetricDataPoint.ts +13 -0
- package/src/sdk/api/types/ServiceExecutionDto.ts +23 -0
- package/src/sdk/api/types/ServiceExecutionLogs.ts +7 -0
- package/src/sdk/api/types/ServiceExecutionMetrics.ts +25 -0
- package/src/sdk/api/types/ServiceJobDto.ts +48 -0
- package/src/sdk/api/types/VariableInstance.ts +10 -0
- package/src/sdk/api/types/WorkflowInstance.ts +26 -0
- package/src/sdk/api/types/WorkflowServiceExecutionDto.ts +10 -0
- package/src/sdk/api/types/index.ts +10 -0
- package/src/sdk/core/exports.ts +1 -0
- package/src/sdk/core/fetcher/Fetcher.ts +3 -3
- package/src/sdk/core/fetcher/index.ts +5 -5
- package/src/sdk/core/file/exports.ts +1 -0
- package/src/sdk/core/file/file.ts +186 -0
- package/src/sdk/core/file/index.ts +2 -0
- package/src/sdk/core/file/types.ts +81 -0
- package/src/sdk/core/form-data-utils/FormDataWrapper.ts +12 -3
- package/src/sdk/core/index.ts +1 -1
- package/src/sdk/core/url/join.ts +28 -3
- package/src/sdk/exports.ts +1 -0
- package/src/sdk/index.ts +1 -0
- package/uv.lock +245 -228
- package/dist/sdk/core/file.d.ts +0 -1
- package/planqk/__init__.py +0 -0
- package/src/sdk/core/file.ts +0 -11
- /package/dist/sdk/{core/file.js → api/resources/serviceExecutions/client/index.js} +0 -0
|
@@ -30,6 +30,8 @@ export declare namespace DataPools {
|
|
|
30
30
|
abortSignal?: AbortSignal;
|
|
31
31
|
/** Override the X-OrganizationId header */
|
|
32
32
|
organizationId?: string | undefined;
|
|
33
|
+
/** Additional query string parameters to include in the request. */
|
|
34
|
+
queryParams?: Record<string, unknown>;
|
|
33
35
|
/** Additional headers to include in the request. */
|
|
34
36
|
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
35
37
|
}
|
|
@@ -70,6 +72,14 @@ export class DataPools {
|
|
|
70
72
|
id: string,
|
|
71
73
|
requestOptions?: DataPools.RequestOptions,
|
|
72
74
|
): Promise<core.WithRawResponse<PlanqkApi.DataPoolDto>> {
|
|
75
|
+
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
|
|
76
|
+
this._options?.headers,
|
|
77
|
+
mergeOnlyDefinedHeaders({
|
|
78
|
+
"X-OrganizationId": requestOptions?.organizationId ?? this._options?.organizationId,
|
|
79
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
80
|
+
}),
|
|
81
|
+
requestOptions?.headers,
|
|
82
|
+
);
|
|
73
83
|
const _response = await core.fetcher({
|
|
74
84
|
url: core.url.join(
|
|
75
85
|
(await core.Supplier.get(this._options.baseUrl)) ??
|
|
@@ -78,14 +88,8 @@ export class DataPools {
|
|
|
78
88
|
`datapools/${encodeURIComponent(id)}`,
|
|
79
89
|
),
|
|
80
90
|
method: "GET",
|
|
81
|
-
headers:
|
|
82
|
-
|
|
83
|
-
mergeOnlyDefinedHeaders({
|
|
84
|
-
"X-OrganizationId": requestOptions?.organizationId,
|
|
85
|
-
...(await this._getCustomAuthorizationHeaders()),
|
|
86
|
-
}),
|
|
87
|
-
requestOptions?.headers,
|
|
88
|
-
),
|
|
91
|
+
headers: _headers,
|
|
92
|
+
queryParameters: requestOptions?.queryParams,
|
|
89
93
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
90
94
|
maxRetries: requestOptions?.maxRetries,
|
|
91
95
|
withCredentials: true,
|
|
@@ -160,6 +164,14 @@ export class DataPools {
|
|
|
160
164
|
request: PlanqkApi.UpdateDataPoolRequest = {},
|
|
161
165
|
requestOptions?: DataPools.RequestOptions,
|
|
162
166
|
): Promise<core.WithRawResponse<PlanqkApi.DataPoolDto>> {
|
|
167
|
+
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
|
|
168
|
+
this._options?.headers,
|
|
169
|
+
mergeOnlyDefinedHeaders({
|
|
170
|
+
"X-OrganizationId": requestOptions?.organizationId ?? this._options?.organizationId,
|
|
171
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
172
|
+
}),
|
|
173
|
+
requestOptions?.headers,
|
|
174
|
+
);
|
|
163
175
|
const _response = await core.fetcher({
|
|
164
176
|
url: core.url.join(
|
|
165
177
|
(await core.Supplier.get(this._options.baseUrl)) ??
|
|
@@ -168,15 +180,9 @@ export class DataPools {
|
|
|
168
180
|
`datapools/${encodeURIComponent(id)}`,
|
|
169
181
|
),
|
|
170
182
|
method: "PUT",
|
|
171
|
-
headers:
|
|
172
|
-
this._options?.headers,
|
|
173
|
-
mergeOnlyDefinedHeaders({
|
|
174
|
-
"X-OrganizationId": requestOptions?.organizationId,
|
|
175
|
-
...(await this._getCustomAuthorizationHeaders()),
|
|
176
|
-
}),
|
|
177
|
-
requestOptions?.headers,
|
|
178
|
-
),
|
|
183
|
+
headers: _headers,
|
|
179
184
|
contentType: "application/json",
|
|
185
|
+
queryParameters: requestOptions?.queryParams,
|
|
180
186
|
requestType: "json",
|
|
181
187
|
body: request,
|
|
182
188
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -248,6 +254,14 @@ export class DataPools {
|
|
|
248
254
|
id: string,
|
|
249
255
|
requestOptions?: DataPools.RequestOptions,
|
|
250
256
|
): Promise<core.WithRawResponse<void>> {
|
|
257
|
+
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
|
|
258
|
+
this._options?.headers,
|
|
259
|
+
mergeOnlyDefinedHeaders({
|
|
260
|
+
"X-OrganizationId": requestOptions?.organizationId ?? this._options?.organizationId,
|
|
261
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
262
|
+
}),
|
|
263
|
+
requestOptions?.headers,
|
|
264
|
+
);
|
|
251
265
|
const _response = await core.fetcher({
|
|
252
266
|
url: core.url.join(
|
|
253
267
|
(await core.Supplier.get(this._options.baseUrl)) ??
|
|
@@ -256,14 +270,8 @@ export class DataPools {
|
|
|
256
270
|
`datapools/${encodeURIComponent(id)}`,
|
|
257
271
|
),
|
|
258
272
|
method: "DELETE",
|
|
259
|
-
headers:
|
|
260
|
-
|
|
261
|
-
mergeOnlyDefinedHeaders({
|
|
262
|
-
"X-OrganizationId": requestOptions?.organizationId,
|
|
263
|
-
...(await this._getCustomAuthorizationHeaders()),
|
|
264
|
-
}),
|
|
265
|
-
requestOptions?.headers,
|
|
266
|
-
),
|
|
273
|
+
headers: _headers,
|
|
274
|
+
queryParameters: requestOptions?.queryParams,
|
|
267
275
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
268
276
|
maxRetries: requestOptions?.maxRetries,
|
|
269
277
|
withCredentials: true,
|
|
@@ -310,7 +318,7 @@ export class DataPools {
|
|
|
310
318
|
}
|
|
311
319
|
|
|
312
320
|
/**
|
|
313
|
-
* Get a list of all data pools for the current user.
|
|
321
|
+
* Get a list of all data pools for the current user or organization.
|
|
314
322
|
*
|
|
315
323
|
* @param {DataPools.RequestOptions} requestOptions - Request-specific configuration.
|
|
316
324
|
*
|
|
@@ -329,6 +337,14 @@ export class DataPools {
|
|
|
329
337
|
private async __getDataPools(
|
|
330
338
|
requestOptions?: DataPools.RequestOptions,
|
|
331
339
|
): Promise<core.WithRawResponse<PlanqkApi.DataPoolDto[]>> {
|
|
340
|
+
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
|
|
341
|
+
this._options?.headers,
|
|
342
|
+
mergeOnlyDefinedHeaders({
|
|
343
|
+
"X-OrganizationId": requestOptions?.organizationId ?? this._options?.organizationId,
|
|
344
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
345
|
+
}),
|
|
346
|
+
requestOptions?.headers,
|
|
347
|
+
);
|
|
332
348
|
const _response = await core.fetcher({
|
|
333
349
|
url: core.url.join(
|
|
334
350
|
(await core.Supplier.get(this._options.baseUrl)) ??
|
|
@@ -337,14 +353,8 @@ export class DataPools {
|
|
|
337
353
|
"datapools",
|
|
338
354
|
),
|
|
339
355
|
method: "GET",
|
|
340
|
-
headers:
|
|
341
|
-
|
|
342
|
-
mergeOnlyDefinedHeaders({
|
|
343
|
-
"X-OrganizationId": requestOptions?.organizationId,
|
|
344
|
-
...(await this._getCustomAuthorizationHeaders()),
|
|
345
|
-
}),
|
|
346
|
-
requestOptions?.headers,
|
|
347
|
-
),
|
|
356
|
+
headers: _headers,
|
|
357
|
+
queryParameters: requestOptions?.queryParams,
|
|
348
358
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
349
359
|
maxRetries: requestOptions?.maxRetries,
|
|
350
360
|
withCredentials: true,
|
|
@@ -416,6 +426,14 @@ export class DataPools {
|
|
|
416
426
|
request: PlanqkApi.CreateDataPoolRequest = {},
|
|
417
427
|
requestOptions?: DataPools.RequestOptions,
|
|
418
428
|
): Promise<core.WithRawResponse<PlanqkApi.DataPoolDto>> {
|
|
429
|
+
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
|
|
430
|
+
this._options?.headers,
|
|
431
|
+
mergeOnlyDefinedHeaders({
|
|
432
|
+
"X-OrganizationId": requestOptions?.organizationId ?? this._options?.organizationId,
|
|
433
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
434
|
+
}),
|
|
435
|
+
requestOptions?.headers,
|
|
436
|
+
);
|
|
419
437
|
const _response = await core.fetcher({
|
|
420
438
|
url: core.url.join(
|
|
421
439
|
(await core.Supplier.get(this._options.baseUrl)) ??
|
|
@@ -424,15 +442,9 @@ export class DataPools {
|
|
|
424
442
|
"datapools",
|
|
425
443
|
),
|
|
426
444
|
method: "POST",
|
|
427
|
-
headers:
|
|
428
|
-
this._options?.headers,
|
|
429
|
-
mergeOnlyDefinedHeaders({
|
|
430
|
-
"X-OrganizationId": requestOptions?.organizationId,
|
|
431
|
-
...(await this._getCustomAuthorizationHeaders()),
|
|
432
|
-
}),
|
|
433
|
-
requestOptions?.headers,
|
|
434
|
-
),
|
|
445
|
+
headers: _headers,
|
|
435
446
|
contentType: "application/json",
|
|
447
|
+
queryParameters: requestOptions?.queryParams,
|
|
436
448
|
requestType: "json",
|
|
437
449
|
body: request,
|
|
438
450
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -507,6 +519,14 @@ export class DataPools {
|
|
|
507
519
|
id: string,
|
|
508
520
|
requestOptions?: DataPools.RequestOptions,
|
|
509
521
|
): Promise<core.WithRawResponse<PlanqkApi.DataPoolFileDto[]>> {
|
|
522
|
+
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
|
|
523
|
+
this._options?.headers,
|
|
524
|
+
mergeOnlyDefinedHeaders({
|
|
525
|
+
"X-OrganizationId": requestOptions?.organizationId ?? this._options?.organizationId,
|
|
526
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
527
|
+
}),
|
|
528
|
+
requestOptions?.headers,
|
|
529
|
+
);
|
|
510
530
|
const _response = await core.fetcher({
|
|
511
531
|
url: core.url.join(
|
|
512
532
|
(await core.Supplier.get(this._options.baseUrl)) ??
|
|
@@ -515,14 +535,8 @@ export class DataPools {
|
|
|
515
535
|
`datapools/${encodeURIComponent(id)}/files`,
|
|
516
536
|
),
|
|
517
537
|
method: "GET",
|
|
518
|
-
headers:
|
|
519
|
-
|
|
520
|
-
mergeOnlyDefinedHeaders({
|
|
521
|
-
"X-OrganizationId": requestOptions?.organizationId,
|
|
522
|
-
...(await this._getCustomAuthorizationHeaders()),
|
|
523
|
-
}),
|
|
524
|
-
requestOptions?.headers,
|
|
525
|
-
),
|
|
538
|
+
headers: _headers,
|
|
539
|
+
queryParameters: requestOptions?.queryParams,
|
|
526
540
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
527
541
|
maxRetries: requestOptions?.maxRetries,
|
|
528
542
|
withCredentials: true,
|
|
@@ -582,6 +596,7 @@ export class DataPools {
|
|
|
582
596
|
* @throws {@link PlanqkApi.InternalServerError}
|
|
583
597
|
*
|
|
584
598
|
* @example
|
|
599
|
+
* import { createReadStream } from "fs";
|
|
585
600
|
* await client.dataPools.addDataPoolFile("id", {
|
|
586
601
|
* file: fs.createReadStream("/path/to/your/file")
|
|
587
602
|
* })
|
|
@@ -607,6 +622,15 @@ export class DataPools {
|
|
|
607
622
|
const _request = await core.newFormData();
|
|
608
623
|
await _request.appendFile("file", request.file);
|
|
609
624
|
const _maybeEncodedRequest = await _request.getRequest();
|
|
625
|
+
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
|
|
626
|
+
this._options?.headers,
|
|
627
|
+
mergeOnlyDefinedHeaders({
|
|
628
|
+
"X-OrganizationId": requestOptions?.organizationId ?? this._options?.organizationId,
|
|
629
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
630
|
+
..._maybeEncodedRequest.headers,
|
|
631
|
+
}),
|
|
632
|
+
requestOptions?.headers,
|
|
633
|
+
);
|
|
610
634
|
const _response = await core.fetcher({
|
|
611
635
|
url: core.url.join(
|
|
612
636
|
(await core.Supplier.get(this._options.baseUrl)) ??
|
|
@@ -615,16 +639,8 @@ export class DataPools {
|
|
|
615
639
|
`datapools/${encodeURIComponent(id)}/files`,
|
|
616
640
|
),
|
|
617
641
|
method: "POST",
|
|
618
|
-
headers:
|
|
619
|
-
|
|
620
|
-
mergeOnlyDefinedHeaders({
|
|
621
|
-
"X-OrganizationId": requestOptions?.organizationId,
|
|
622
|
-
...(await this._getCustomAuthorizationHeaders()),
|
|
623
|
-
..._maybeEncodedRequest.headers,
|
|
624
|
-
}),
|
|
625
|
-
requestOptions?.headers,
|
|
626
|
-
),
|
|
627
|
-
queryParameters: _queryParams,
|
|
642
|
+
headers: _headers,
|
|
643
|
+
queryParameters: { ..._queryParams, ...requestOptions?.queryParams },
|
|
628
644
|
requestType: "file",
|
|
629
645
|
duplex: _maybeEncodedRequest.duplex,
|
|
630
646
|
body: _maybeEncodedRequest.body,
|
|
@@ -695,6 +711,14 @@ export class DataPools {
|
|
|
695
711
|
fileId: string,
|
|
696
712
|
requestOptions?: DataPools.RequestOptions,
|
|
697
713
|
): Promise<core.WithRawResponse<core.BinaryResponse>> {
|
|
714
|
+
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
|
|
715
|
+
this._options?.headers,
|
|
716
|
+
mergeOnlyDefinedHeaders({
|
|
717
|
+
"X-OrganizationId": requestOptions?.organizationId ?? this._options?.organizationId,
|
|
718
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
719
|
+
}),
|
|
720
|
+
requestOptions?.headers,
|
|
721
|
+
);
|
|
698
722
|
const _response = await core.fetcher<core.BinaryResponse>({
|
|
699
723
|
url: core.url.join(
|
|
700
724
|
(await core.Supplier.get(this._options.baseUrl)) ??
|
|
@@ -703,14 +727,8 @@ export class DataPools {
|
|
|
703
727
|
`datapools/${encodeURIComponent(id)}/files/${encodeURIComponent(fileId)}`,
|
|
704
728
|
),
|
|
705
729
|
method: "GET",
|
|
706
|
-
headers:
|
|
707
|
-
|
|
708
|
-
mergeOnlyDefinedHeaders({
|
|
709
|
-
"X-OrganizationId": requestOptions?.organizationId,
|
|
710
|
-
...(await this._getCustomAuthorizationHeaders()),
|
|
711
|
-
}),
|
|
712
|
-
requestOptions?.headers,
|
|
713
|
-
),
|
|
730
|
+
headers: _headers,
|
|
731
|
+
queryParameters: requestOptions?.queryParams,
|
|
714
732
|
responseType: "binary-response",
|
|
715
733
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
716
734
|
maxRetries: requestOptions?.maxRetries,
|
|
@@ -787,6 +805,14 @@ export class DataPools {
|
|
|
787
805
|
fileId: string,
|
|
788
806
|
requestOptions?: DataPools.RequestOptions,
|
|
789
807
|
): Promise<core.WithRawResponse<void>> {
|
|
808
|
+
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
|
|
809
|
+
this._options?.headers,
|
|
810
|
+
mergeOnlyDefinedHeaders({
|
|
811
|
+
"X-OrganizationId": requestOptions?.organizationId ?? this._options?.organizationId,
|
|
812
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
813
|
+
}),
|
|
814
|
+
requestOptions?.headers,
|
|
815
|
+
);
|
|
790
816
|
const _response = await core.fetcher({
|
|
791
817
|
url: core.url.join(
|
|
792
818
|
(await core.Supplier.get(this._options.baseUrl)) ??
|
|
@@ -795,14 +821,8 @@ export class DataPools {
|
|
|
795
821
|
`datapools/${encodeURIComponent(id)}/files/${encodeURIComponent(fileId)}`,
|
|
796
822
|
),
|
|
797
823
|
method: "DELETE",
|
|
798
|
-
headers:
|
|
799
|
-
|
|
800
|
-
mergeOnlyDefinedHeaders({
|
|
801
|
-
"X-OrganizationId": requestOptions?.organizationId,
|
|
802
|
-
...(await this._getCustomAuthorizationHeaders()),
|
|
803
|
-
}),
|
|
804
|
-
requestOptions?.headers,
|
|
805
|
-
),
|
|
824
|
+
headers: _headers,
|
|
825
|
+
queryParameters: requestOptions?.queryParams,
|
|
806
826
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
807
827
|
maxRetries: requestOptions?.maxRetries,
|
|
808
828
|
withCredentials: true,
|
|
@@ -7,7 +7,10 @@
|
|
|
7
7
|
* {}
|
|
8
8
|
*/
|
|
9
9
|
export interface UpdateDataPoolRequest {
|
|
10
|
+
/** The name of the data pool. Must be at least 3 characters and at most 255 characters long. */
|
|
10
11
|
name?: string;
|
|
12
|
+
/** Short description of the data pool. */
|
|
11
13
|
shortDescription?: string;
|
|
14
|
+
/** Detailed description of the data pool. */
|
|
12
15
|
description?: string;
|
|
13
16
|
}
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
+
export * as serviceJobs from "./serviceJobs/index.js";
|
|
1
2
|
export * as dataPools from "./dataPools/index.js";
|
|
3
|
+
export * as serviceExecutions from "./serviceExecutions/index.js";
|
|
4
|
+
export * from "./serviceJobs/client/requests/index.js";
|
|
2
5
|
export * from "./dataPools/client/requests/index.js";
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as environments from "../../../../environments.js";
|
|
6
|
+
import * as core from "../../../../core/index.js";
|
|
7
|
+
import * as PlanqkApi from "../../../index.js";
|
|
8
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js";
|
|
9
|
+
import * as errors from "../../../../errors/index.js";
|
|
10
|
+
|
|
11
|
+
export declare namespace ServiceExecutions {
|
|
12
|
+
export interface Options {
|
|
13
|
+
environment?: core.Supplier<environments.PlanqkApiEnvironment | string>;
|
|
14
|
+
/** Specify a custom URL to connect the client to. */
|
|
15
|
+
baseUrl?: core.Supplier<string>;
|
|
16
|
+
apiKey: core.Supplier<string>;
|
|
17
|
+
/** Override the X-OrganizationId header */
|
|
18
|
+
organizationId?: core.Supplier<string | undefined>;
|
|
19
|
+
/** Additional headers to include in requests. */
|
|
20
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface RequestOptions {
|
|
24
|
+
/** The maximum time to wait for a response in seconds. */
|
|
25
|
+
timeoutInSeconds?: number;
|
|
26
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
27
|
+
maxRetries?: number;
|
|
28
|
+
/** A hook to abort the request. */
|
|
29
|
+
abortSignal?: AbortSignal;
|
|
30
|
+
/** Override the X-OrganizationId header */
|
|
31
|
+
organizationId?: string | undefined;
|
|
32
|
+
/** Additional query string parameters to include in the request. */
|
|
33
|
+
queryParams?: Record<string, unknown>;
|
|
34
|
+
/** Additional headers to include in the request. */
|
|
35
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Track status, costs, logs, metrics, and results of your service executions.
|
|
41
|
+
*/
|
|
42
|
+
export class ServiceExecutions {
|
|
43
|
+
protected readonly _options: ServiceExecutions.Options;
|
|
44
|
+
|
|
45
|
+
constructor(_options: ServiceExecutions.Options) {
|
|
46
|
+
this._options = _options;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Get a specific service execution (identified by its ID).
|
|
51
|
+
*
|
|
52
|
+
* @param {string} id
|
|
53
|
+
* @param {ServiceExecutions.RequestOptions} requestOptions - Request-specific configuration.
|
|
54
|
+
*
|
|
55
|
+
* @throws {@link PlanqkApi.UnauthorizedError}
|
|
56
|
+
* @throws {@link PlanqkApi.ForbiddenError}
|
|
57
|
+
* @throws {@link PlanqkApi.NotFoundError}
|
|
58
|
+
* @throws {@link PlanqkApi.InternalServerError}
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* await client.serviceExecutions.getServiceExecution("id")
|
|
62
|
+
*/
|
|
63
|
+
public getServiceExecution(
|
|
64
|
+
id: string,
|
|
65
|
+
requestOptions?: ServiceExecutions.RequestOptions,
|
|
66
|
+
): core.HttpResponsePromise<string> {
|
|
67
|
+
return core.HttpResponsePromise.fromPromise(this.__getServiceExecution(id, requestOptions));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
private async __getServiceExecution(
|
|
71
|
+
id: string,
|
|
72
|
+
requestOptions?: ServiceExecutions.RequestOptions,
|
|
73
|
+
): Promise<core.WithRawResponse<string>> {
|
|
74
|
+
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
|
|
75
|
+
this._options?.headers,
|
|
76
|
+
mergeOnlyDefinedHeaders({
|
|
77
|
+
"X-OrganizationId": requestOptions?.organizationId ?? this._options?.organizationId,
|
|
78
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
79
|
+
}),
|
|
80
|
+
requestOptions?.headers,
|
|
81
|
+
);
|
|
82
|
+
const _response = await core.fetcher({
|
|
83
|
+
url: core.url.join(
|
|
84
|
+
(await core.Supplier.get(this._options.baseUrl)) ??
|
|
85
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
86
|
+
environments.PlanqkApiEnvironment.Default,
|
|
87
|
+
`service-executions/v1/${encodeURIComponent(id)}`,
|
|
88
|
+
),
|
|
89
|
+
method: "GET",
|
|
90
|
+
headers: _headers,
|
|
91
|
+
queryParameters: requestOptions?.queryParams,
|
|
92
|
+
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
93
|
+
maxRetries: requestOptions?.maxRetries,
|
|
94
|
+
withCredentials: true,
|
|
95
|
+
abortSignal: requestOptions?.abortSignal,
|
|
96
|
+
});
|
|
97
|
+
if (_response.ok) {
|
|
98
|
+
return { data: _response.body as string, rawResponse: _response.rawResponse };
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (_response.error.reason === "status-code") {
|
|
102
|
+
switch (_response.error.statusCode) {
|
|
103
|
+
case 401:
|
|
104
|
+
throw new PlanqkApi.UnauthorizedError(_response.error.body as any, _response.rawResponse);
|
|
105
|
+
case 403:
|
|
106
|
+
throw new PlanqkApi.ForbiddenError(_response.error.body as any, _response.rawResponse);
|
|
107
|
+
case 404:
|
|
108
|
+
throw new PlanqkApi.NotFoundError(_response.error.body as any, _response.rawResponse);
|
|
109
|
+
case 500:
|
|
110
|
+
throw new PlanqkApi.InternalServerError(_response.error.body as any, _response.rawResponse);
|
|
111
|
+
default:
|
|
112
|
+
throw new errors.PlanqkApiError({
|
|
113
|
+
statusCode: _response.error.statusCode,
|
|
114
|
+
body: _response.error.body,
|
|
115
|
+
rawResponse: _response.rawResponse,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
switch (_response.error.reason) {
|
|
121
|
+
case "non-json":
|
|
122
|
+
throw new errors.PlanqkApiError({
|
|
123
|
+
statusCode: _response.error.statusCode,
|
|
124
|
+
body: _response.error.rawBody,
|
|
125
|
+
rawResponse: _response.rawResponse,
|
|
126
|
+
});
|
|
127
|
+
case "timeout":
|
|
128
|
+
throw new errors.PlanqkApiTimeoutError(
|
|
129
|
+
"Timeout exceeded when calling GET /service-executions/v1/{id}.",
|
|
130
|
+
);
|
|
131
|
+
case "unknown":
|
|
132
|
+
throw new errors.PlanqkApiError({
|
|
133
|
+
message: _response.error.errorMessage,
|
|
134
|
+
rawResponse: _response.rawResponse,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Check if the tenant has view permission for a specific service execution (identified by its ID).
|
|
141
|
+
*
|
|
142
|
+
* @param {string} id
|
|
143
|
+
* @param {ServiceExecutions.RequestOptions} requestOptions - Request-specific configuration.
|
|
144
|
+
*
|
|
145
|
+
* @throws {@link PlanqkApi.UnauthorizedError}
|
|
146
|
+
* @throws {@link PlanqkApi.ForbiddenError}
|
|
147
|
+
* @throws {@link PlanqkApi.NotFoundError}
|
|
148
|
+
* @throws {@link PlanqkApi.InternalServerError}
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
* await client.serviceExecutions.headServiceExecution("id")
|
|
152
|
+
*/
|
|
153
|
+
public headServiceExecution(
|
|
154
|
+
id: string,
|
|
155
|
+
requestOptions?: ServiceExecutions.RequestOptions,
|
|
156
|
+
): core.HttpResponsePromise<Headers> {
|
|
157
|
+
return core.HttpResponsePromise.fromPromise(this.__headServiceExecution(id, requestOptions));
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
private async __headServiceExecution(
|
|
161
|
+
id: string,
|
|
162
|
+
requestOptions?: ServiceExecutions.RequestOptions,
|
|
163
|
+
): Promise<core.WithRawResponse<Headers>> {
|
|
164
|
+
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
|
|
165
|
+
this._options?.headers,
|
|
166
|
+
mergeOnlyDefinedHeaders({
|
|
167
|
+
"X-OrganizationId": requestOptions?.organizationId ?? this._options?.organizationId,
|
|
168
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
169
|
+
}),
|
|
170
|
+
requestOptions?.headers,
|
|
171
|
+
);
|
|
172
|
+
const _response = await core.fetcher({
|
|
173
|
+
url: core.url.join(
|
|
174
|
+
(await core.Supplier.get(this._options.baseUrl)) ??
|
|
175
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
176
|
+
environments.PlanqkApiEnvironment.Default,
|
|
177
|
+
`service-executions/v1/${encodeURIComponent(id)}`,
|
|
178
|
+
),
|
|
179
|
+
method: "HEAD",
|
|
180
|
+
headers: _headers,
|
|
181
|
+
queryParameters: requestOptions?.queryParams,
|
|
182
|
+
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
183
|
+
maxRetries: requestOptions?.maxRetries,
|
|
184
|
+
withCredentials: true,
|
|
185
|
+
abortSignal: requestOptions?.abortSignal,
|
|
186
|
+
});
|
|
187
|
+
if (_response.ok) {
|
|
188
|
+
return { data: _response.rawResponse.headers, rawResponse: _response.rawResponse };
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
if (_response.error.reason === "status-code") {
|
|
192
|
+
switch (_response.error.statusCode) {
|
|
193
|
+
case 401:
|
|
194
|
+
throw new PlanqkApi.UnauthorizedError(_response.error.body as any, _response.rawResponse);
|
|
195
|
+
case 403:
|
|
196
|
+
throw new PlanqkApi.ForbiddenError(_response.error.body as any, _response.rawResponse);
|
|
197
|
+
case 404:
|
|
198
|
+
throw new PlanqkApi.NotFoundError(_response.error.body as any, _response.rawResponse);
|
|
199
|
+
case 500:
|
|
200
|
+
throw new PlanqkApi.InternalServerError(_response.error.body as any, _response.rawResponse);
|
|
201
|
+
default:
|
|
202
|
+
throw new errors.PlanqkApiError({
|
|
203
|
+
statusCode: _response.error.statusCode,
|
|
204
|
+
body: _response.error.body,
|
|
205
|
+
rawResponse: _response.rawResponse,
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
switch (_response.error.reason) {
|
|
211
|
+
case "non-json":
|
|
212
|
+
throw new errors.PlanqkApiError({
|
|
213
|
+
statusCode: _response.error.statusCode,
|
|
214
|
+
body: _response.error.rawBody,
|
|
215
|
+
rawResponse: _response.rawResponse,
|
|
216
|
+
});
|
|
217
|
+
case "timeout":
|
|
218
|
+
throw new errors.PlanqkApiTimeoutError(
|
|
219
|
+
"Timeout exceeded when calling HEAD /service-executions/v1/{id}.",
|
|
220
|
+
);
|
|
221
|
+
case "unknown":
|
|
222
|
+
throw new errors.PlanqkApiError({
|
|
223
|
+
message: _response.error.errorMessage,
|
|
224
|
+
rawResponse: _response.rawResponse,
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Get resource usage metrics for a specific service execution (identified by its ID).
|
|
231
|
+
*
|
|
232
|
+
* @param {string} id
|
|
233
|
+
* @param {ServiceExecutions.RequestOptions} requestOptions - Request-specific configuration.
|
|
234
|
+
*
|
|
235
|
+
* @throws {@link PlanqkApi.UnauthorizedError}
|
|
236
|
+
* @throws {@link PlanqkApi.ForbiddenError}
|
|
237
|
+
* @throws {@link PlanqkApi.NotFoundError}
|
|
238
|
+
* @throws {@link PlanqkApi.InternalServerError}
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
* await client.serviceExecutions.getServiceExecutionMetrics("id")
|
|
242
|
+
*/
|
|
243
|
+
public getServiceExecutionMetrics(
|
|
244
|
+
id: string,
|
|
245
|
+
requestOptions?: ServiceExecutions.RequestOptions,
|
|
246
|
+
): core.HttpResponsePromise<PlanqkApi.ServiceExecutionMetrics> {
|
|
247
|
+
return core.HttpResponsePromise.fromPromise(this.__getServiceExecutionMetrics(id, requestOptions));
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
private async __getServiceExecutionMetrics(
|
|
251
|
+
id: string,
|
|
252
|
+
requestOptions?: ServiceExecutions.RequestOptions,
|
|
253
|
+
): Promise<core.WithRawResponse<PlanqkApi.ServiceExecutionMetrics>> {
|
|
254
|
+
let _headers: core.Fetcher.Args["headers"] = mergeHeaders(
|
|
255
|
+
this._options?.headers,
|
|
256
|
+
mergeOnlyDefinedHeaders({
|
|
257
|
+
"X-OrganizationId": requestOptions?.organizationId ?? this._options?.organizationId,
|
|
258
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
259
|
+
}),
|
|
260
|
+
requestOptions?.headers,
|
|
261
|
+
);
|
|
262
|
+
const _response = await core.fetcher({
|
|
263
|
+
url: core.url.join(
|
|
264
|
+
(await core.Supplier.get(this._options.baseUrl)) ??
|
|
265
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
266
|
+
environments.PlanqkApiEnvironment.Default,
|
|
267
|
+
`service-executions/v1/${encodeURIComponent(id)}/metrics`,
|
|
268
|
+
),
|
|
269
|
+
method: "GET",
|
|
270
|
+
headers: _headers,
|
|
271
|
+
queryParameters: requestOptions?.queryParams,
|
|
272
|
+
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
273
|
+
maxRetries: requestOptions?.maxRetries,
|
|
274
|
+
withCredentials: true,
|
|
275
|
+
abortSignal: requestOptions?.abortSignal,
|
|
276
|
+
});
|
|
277
|
+
if (_response.ok) {
|
|
278
|
+
return { data: _response.body as PlanqkApi.ServiceExecutionMetrics, rawResponse: _response.rawResponse };
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
if (_response.error.reason === "status-code") {
|
|
282
|
+
switch (_response.error.statusCode) {
|
|
283
|
+
case 401:
|
|
284
|
+
throw new PlanqkApi.UnauthorizedError(_response.error.body as any, _response.rawResponse);
|
|
285
|
+
case 403:
|
|
286
|
+
throw new PlanqkApi.ForbiddenError(_response.error.body as any, _response.rawResponse);
|
|
287
|
+
case 404:
|
|
288
|
+
throw new PlanqkApi.NotFoundError(_response.error.body as any, _response.rawResponse);
|
|
289
|
+
case 500:
|
|
290
|
+
throw new PlanqkApi.InternalServerError(_response.error.body as any, _response.rawResponse);
|
|
291
|
+
default:
|
|
292
|
+
throw new errors.PlanqkApiError({
|
|
293
|
+
statusCode: _response.error.statusCode,
|
|
294
|
+
body: _response.error.body,
|
|
295
|
+
rawResponse: _response.rawResponse,
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
switch (_response.error.reason) {
|
|
301
|
+
case "non-json":
|
|
302
|
+
throw new errors.PlanqkApiError({
|
|
303
|
+
statusCode: _response.error.statusCode,
|
|
304
|
+
body: _response.error.rawBody,
|
|
305
|
+
rawResponse: _response.rawResponse,
|
|
306
|
+
});
|
|
307
|
+
case "timeout":
|
|
308
|
+
throw new errors.PlanqkApiTimeoutError(
|
|
309
|
+
"Timeout exceeded when calling GET /service-executions/v1/{id}/metrics.",
|
|
310
|
+
);
|
|
311
|
+
case "unknown":
|
|
312
|
+
throw new errors.PlanqkApiError({
|
|
313
|
+
message: _response.error.errorMessage,
|
|
314
|
+
rawResponse: _response.rawResponse,
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
protected async _getCustomAuthorizationHeaders() {
|
|
320
|
+
const apiKeyValue = await core.Supplier.get(this._options.apiKey);
|
|
321
|
+
return { "X-Auth-Token": apiKeyValue };
|
|
322
|
+
}
|
|
323
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.js";
|