@planqk/planqk-service-sdk 1.9.1 → 2.1.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/.devcontainer/devcontainer.json +32 -0
- package/.devcontainer/post-create.sh +7 -0
- package/.env.template +4 -0
- package/.gitlab-ci.yml +103 -0
- package/.python-version +1 -0
- package/.releaserc.json +45 -0
- package/LICENSE +201 -0
- package/README-node.md +41 -0
- package/README-python.md +52 -0
- package/README.md +42 -21
- package/dist/auth.js +12 -19
- package/dist/client.d.ts +2 -12
- package/dist/client.js +5 -76
- package/dist/sdk/Client.d.ts +4 -3
- package/dist/sdk/Client.js +4 -8
- package/dist/sdk/api/errors/BadRequestError.d.ts +1 -1
- package/dist/sdk/api/errors/BadRequestError.js +18 -8
- package/dist/sdk/api/errors/ForbiddenError.d.ts +1 -1
- package/dist/sdk/api/errors/ForbiddenError.js +18 -8
- package/dist/sdk/api/errors/InternalServerError.d.ts +1 -1
- package/dist/sdk/api/errors/InternalServerError.js +18 -8
- package/dist/sdk/api/errors/NotFoundError.d.ts +1 -1
- package/dist/sdk/api/errors/NotFoundError.js +18 -8
- package/dist/sdk/api/errors/UnauthorizedError.d.ts +1 -1
- package/dist/sdk/api/errors/UnauthorizedError.js +18 -8
- package/dist/sdk/api/resources/index.d.ts +0 -3
- package/dist/sdk/api/resources/index.js +18 -11
- package/dist/sdk/api/resources/serviceApi/client/Client.d.ts +65 -12
- package/dist/sdk/api/resources/serviceApi/client/Client.js +405 -261
- package/dist/sdk/api/resources/serviceApi/client/index.d.ts +1 -1
- package/dist/sdk/api/resources/serviceApi/client/index.js +0 -15
- package/dist/sdk/api/resources/serviceApi/types/GetResultResponse.d.ts +4 -1
- package/dist/sdk/api/resources/serviceApi/types/{GetInterimResultsResponse.d.ts → GetResultResponseEmbedded.d.ts} +3 -1
- package/dist/sdk/api/resources/serviceApi/types/GetResultResponseLinks.d.ts +7 -0
- package/dist/sdk/api/resources/{statusApi → serviceApi}/types/HealthCheckResponse.d.ts +1 -0
- package/dist/sdk/api/resources/serviceApi/types/index.d.ts +3 -1
- package/dist/sdk/api/resources/serviceApi/types/index.js +3 -1
- package/dist/sdk/api/types/HalLink.d.ts +21 -0
- package/dist/sdk/api/types/InputData.d.ts +1 -1
- package/dist/sdk/api/types/{InputRef.d.ts → InputDataRef.d.ts} +1 -1
- package/dist/sdk/api/types/InputParams.d.ts +1 -1
- package/dist/sdk/api/types/{Job.d.ts → ServiceExecution.d.ts} +2 -2
- package/dist/sdk/api/types/{JobStatus.d.ts → ServiceExecutionStatus.d.ts} +2 -2
- package/dist/sdk/api/types/{JobStatus.js → ServiceExecutionStatus.js} +2 -2
- package/dist/sdk/api/types/index.d.ts +4 -8
- package/dist/sdk/api/types/index.js +4 -8
- package/dist/sdk/core/fetcher/APIResponse.d.ts +1 -0
- package/dist/sdk/core/fetcher/Fetcher.d.ts +6 -5
- package/dist/sdk/core/fetcher/Fetcher.js +68 -112
- package/dist/sdk/core/fetcher/Supplier.js +2 -11
- package/dist/sdk/core/fetcher/createRequestUrl.d.ts +1 -0
- package/dist/sdk/core/fetcher/createRequestUrl.js +12 -0
- package/dist/sdk/core/fetcher/getFetchFn.d.ts +4 -0
- package/dist/sdk/core/fetcher/getFetchFn.js +57 -0
- package/dist/sdk/core/fetcher/getHeader.d.ts +1 -0
- package/dist/sdk/core/fetcher/getHeader.js +11 -0
- package/dist/sdk/core/fetcher/getRequestBody.d.ts +7 -0
- package/dist/sdk/core/fetcher/getRequestBody.js +11 -0
- package/dist/sdk/core/fetcher/getResponseBody.d.ts +1 -0
- package/dist/sdk/core/fetcher/getResponseBody.js +40 -0
- package/dist/sdk/core/fetcher/index.d.ts +1 -0
- package/dist/sdk/core/fetcher/index.js +3 -1
- package/dist/sdk/core/fetcher/makeRequest.d.ts +1 -0
- package/dist/sdk/core/fetcher/makeRequest.js +33 -0
- package/dist/sdk/core/fetcher/requestWithRetries.d.ts +1 -0
- package/dist/sdk/core/fetcher/requestWithRetries.js +20 -0
- package/dist/sdk/core/fetcher/signals.d.ts +11 -0
- package/dist/sdk/core/fetcher/signals.js +36 -0
- package/dist/sdk/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
- package/dist/sdk/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +232 -0
- package/dist/sdk/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +21 -0
- package/dist/sdk/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +91 -0
- package/dist/sdk/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/dist/sdk/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +214 -0
- package/dist/sdk/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/dist/sdk/core/fetcher/stream-wrappers/chooseStreamWrapper.js +48 -0
- package/dist/sdk/core/index.d.ts +1 -0
- package/dist/sdk/core/index.js +1 -0
- package/dist/sdk/core/runtime/index.d.ts +1 -0
- package/dist/sdk/core/runtime/index.js +5 -0
- package/dist/sdk/core/runtime/runtime.d.ts +9 -0
- package/dist/sdk/core/runtime/runtime.js +92 -0
- package/dist/sdk/errors/PlanqkServiceApiError.js +2 -0
- package/dist/sdk/index.js +17 -7
- package/eslint.config.mjs +11 -0
- package/fern/fern.config.json +4 -0
- package/fern/generators.yml +25 -0
- package/fern/openapi/openapi.yml +342 -0
- package/notebooks/python-sdk.ipynb +280 -0
- package/package.json +27 -28
- package/planqk/__init__.py +0 -0
- package/planqk/service/__init__.py +1 -0
- package/planqk/service/_version.py +1 -0
- package/planqk/service/auth.py +30 -0
- package/planqk/service/client.py +151 -0
- package/planqk/service/sdk/__init__.py +48 -0
- package/planqk/service/sdk/client.py +152 -0
- package/planqk/service/sdk/core/__init__.py +47 -0
- package/planqk/service/sdk/core/api_error.py +17 -0
- package/planqk/service/sdk/core/client_wrapper.py +74 -0
- package/planqk/service/sdk/core/datetime_utils.py +30 -0
- package/planqk/service/sdk/core/file.py +70 -0
- package/planqk/service/sdk/core/http_client.py +575 -0
- package/planqk/service/sdk/core/jsonable_encoder.py +103 -0
- package/planqk/service/sdk/core/pydantic_utilities.py +323 -0
- package/planqk/service/sdk/core/query_encoder.py +60 -0
- package/planqk/service/sdk/core/remove_none_from_dict.py +11 -0
- package/planqk/service/sdk/core/request_options.py +35 -0
- package/planqk/service/sdk/core/serialization.py +276 -0
- package/planqk/service/sdk/environment.py +7 -0
- package/planqk/service/sdk/errors/__init__.py +15 -0
- package/planqk/service/sdk/errors/bad_request_error.py +9 -0
- package/planqk/service/sdk/errors/forbidden_error.py +9 -0
- package/planqk/service/sdk/errors/internal_server_error.py +9 -0
- package/planqk/service/sdk/errors/not_found_error.py +9 -0
- package/planqk/service/sdk/errors/unauthorized_error.py +9 -0
- package/planqk/service/sdk/service_api/__init__.py +15 -0
- package/planqk/service/sdk/service_api/client.py +1257 -0
- package/planqk/service/sdk/service_api/types/__init__.py +13 -0
- package/planqk/service/sdk/service_api/types/get_result_response.py +30 -0
- package/planqk/service/sdk/service_api/types/get_result_response_embedded.py +22 -0
- package/planqk/service/sdk/service_api/types/get_result_response_links.py +22 -0
- package/planqk/service/sdk/service_api/types/health_check_response.py +24 -0
- package/planqk/service/sdk/types/__init__.py +17 -0
- package/planqk/service/sdk/types/hal_link.py +59 -0
- package/planqk/service/sdk/types/input_data.py +5 -0
- package/planqk/service/sdk/types/input_data_ref.py +27 -0
- package/planqk/service/sdk/types/input_params.py +5 -0
- package/planqk/service/sdk/types/service_execution.py +34 -0
- package/planqk/service/sdk/types/service_execution_status.py +8 -0
- package/pyproject.toml +51 -0
- package/scripts/update-version.sh +6 -0
- package/src/client.ts +4 -78
- package/src/index.test.ts +43 -0
- package/src/sdk/Client.ts +4 -7
- package/src/sdk/api/errors/BadRequestError.ts +1 -1
- package/src/sdk/api/errors/ForbiddenError.ts +1 -1
- package/src/sdk/api/errors/InternalServerError.ts +1 -1
- package/src/sdk/api/errors/NotFoundError.ts +1 -1
- package/src/sdk/api/errors/UnauthorizedError.ts +1 -1
- package/src/sdk/api/resources/index.ts +0 -3
- package/src/sdk/api/resources/serviceApi/client/Client.ts +205 -32
- package/src/sdk/api/resources/serviceApi/client/index.ts +1 -1
- package/src/sdk/api/resources/serviceApi/types/GetResultResponse.ts +4 -5
- package/src/sdk/api/resources/serviceApi/types/GetResultResponseEmbedded.ts +9 -0
- package/src/sdk/api/resources/serviceApi/types/GetResultResponseLinks.ts +9 -0
- package/src/sdk/api/resources/{statusApi → serviceApi}/types/HealthCheckResponse.ts +1 -0
- package/src/sdk/api/resources/serviceApi/types/index.ts +3 -1
- package/src/sdk/api/types/HalLink.ts +22 -0
- package/src/sdk/api/types/InputData.ts +1 -1
- package/src/sdk/api/types/{InputRef.ts → InputDataRef.ts} +1 -1
- package/src/sdk/api/types/InputParams.ts +1 -1
- package/src/sdk/api/types/{Job.ts → ServiceExecution.ts} +2 -2
- package/src/sdk/api/types/{JobStatus.ts → ServiceExecutionStatus.ts} +2 -2
- package/src/sdk/api/types/index.ts +4 -8
- package/src/sdk/core/fetcher/APIResponse.ts +1 -0
- package/src/sdk/core/fetcher/Fetcher.ts +55 -72
- package/src/sdk/core/fetcher/createRequestUrl.ts +10 -0
- package/src/sdk/core/fetcher/getFetchFn.ts +25 -0
- package/src/sdk/core/fetcher/getHeader.ts +8 -0
- package/src/sdk/core/fetcher/getRequestBody.ts +14 -0
- package/src/sdk/core/fetcher/getResponseBody.ts +32 -0
- package/src/sdk/core/fetcher/index.ts +1 -0
- package/src/sdk/core/fetcher/makeRequest.ts +44 -0
- package/src/sdk/core/fetcher/requestWithRetries.ts +21 -0
- package/src/sdk/core/fetcher/signals.ts +38 -0
- package/src/sdk/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +252 -0
- package/src/sdk/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts +106 -0
- package/src/sdk/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +239 -0
- package/src/sdk/core/fetcher/stream-wrappers/chooseStreamWrapper.ts +33 -0
- package/src/sdk/core/index.ts +1 -0
- package/src/sdk/core/runtime/index.ts +1 -0
- package/src/sdk/core/runtime/runtime.ts +126 -0
- package/tsconfig.json +15 -107
- package/uv.lock +1109 -0
- package/.eslintignore +0 -3
- package/.eslintrc +0 -7
- package/dist/sdk/api/resources/serviceApi/client/requests/GetInterimResultsRequest.d.ts +0 -9
- package/dist/sdk/api/resources/serviceApi/client/requests/StartExecutionRequest.d.ts +0 -13
- package/dist/sdk/api/resources/serviceApi/client/requests/index.d.ts +0 -2
- package/dist/sdk/api/resources/serviceApi/client/requests/index.js +0 -2
- package/dist/sdk/api/resources/statusApi/client/Client.d.ts +0 -28
- package/dist/sdk/api/resources/statusApi/client/Client.js +0 -97
- package/dist/sdk/api/resources/statusApi/client/index.d.ts +0 -1
- package/dist/sdk/api/resources/statusApi/client/index.js +0 -2
- package/dist/sdk/api/resources/statusApi/index.d.ts +0 -2
- package/dist/sdk/api/resources/statusApi/index.js +0 -18
- package/dist/sdk/api/resources/statusApi/types/index.d.ts +0 -1
- package/dist/sdk/api/resources/statusApi/types/index.js +0 -17
- package/dist/sdk/api/types/ArrayResponse.d.ts +0 -4
- package/dist/sdk/api/types/InterimResultResponse.d.ts +0 -4
- package/dist/sdk/api/types/InterimResultResponse.js +0 -5
- package/dist/sdk/api/types/Job.js +0 -5
- package/dist/sdk/api/types/NumberResponse.d.ts +0 -4
- package/dist/sdk/api/types/NumberResponse.js +0 -5
- package/dist/sdk/api/types/ObjectResponse.d.ts +0 -4
- package/dist/sdk/api/types/ObjectResponse.js +0 -5
- package/dist/sdk/api/types/StringResponse.d.ts +0 -4
- package/dist/sdk/api/types/StringResponse.js +0 -5
- package/jest.config.js +0 -12
- package/src/sdk/api/resources/serviceApi/client/requests/GetInterimResultsRequest.ts +0 -10
- package/src/sdk/api/resources/serviceApi/client/requests/StartExecutionRequest.ts +0 -15
- package/src/sdk/api/resources/serviceApi/client/requests/index.ts +0 -2
- package/src/sdk/api/resources/serviceApi/types/GetInterimResultsResponse.ts +0 -9
- package/src/sdk/api/resources/statusApi/client/Client.ts +0 -75
- package/src/sdk/api/resources/statusApi/client/index.ts +0 -1
- package/src/sdk/api/resources/statusApi/index.ts +0 -2
- package/src/sdk/api/resources/statusApi/types/index.ts +0 -1
- package/src/sdk/api/types/ArrayResponse.ts +0 -5
- package/src/sdk/api/types/InterimResultResponse.ts +0 -5
- package/src/sdk/api/types/NumberResponse.ts +0 -5
- package/src/sdk/api/types/ObjectResponse.ts +0 -5
- package/src/sdk/api/types/StringResponse.ts +0 -5
- package/tests/fixtures/complex-input.ts +0 -477
- package/tests/integration.test.ts +0 -92
- /package/dist/sdk/api/resources/serviceApi/{client/requests/GetInterimResultsRequest.js → types/GetResultResponseEmbedded.js} +0 -0
- /package/dist/sdk/api/resources/serviceApi/{client/requests/StartExecutionRequest.js → types/GetResultResponseLinks.js} +0 -0
- /package/dist/sdk/api/resources/{statusApi → serviceApi}/types/HealthCheckResponse.js +0 -0
- /package/dist/sdk/api/{resources/serviceApi/types/GetInterimResultsResponse.js → types/HalLink.js} +0 -0
- /package/dist/sdk/api/types/{ArrayResponse.js → InputDataRef.js} +0 -0
- /package/dist/sdk/api/types/{InputRef.js → ServiceExecution.js} +0 -0
package/dist/client.js
CHANGED
|
@@ -1,98 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.PlanqkServiceClient = void 0;
|
|
13
4
|
const auth_1 = require("./auth");
|
|
14
5
|
const sdk_1 = require("./sdk");
|
|
15
|
-
const api_1 = require("./sdk/api");
|
|
16
6
|
class PlanqkServiceClient {
|
|
7
|
+
_api;
|
|
17
8
|
constructor(serviceEndpoint, consumerKey, consumerSecret, tokenEndpoint = auth_1.DEFAULT_TOKEN_ENDPOINT) {
|
|
18
9
|
if (consumerKey && consumerSecret) {
|
|
19
10
|
const auth = new auth_1.PlanqkServiceAuth(consumerKey, consumerSecret, tokenEndpoint);
|
|
20
11
|
this._api = new sdk_1.PlanqkServiceApiClient({
|
|
21
12
|
environment: () => serviceEndpoint,
|
|
22
|
-
token: () =>
|
|
13
|
+
token: async () => auth.getAccessToken(),
|
|
23
14
|
});
|
|
24
15
|
}
|
|
25
16
|
else {
|
|
26
17
|
this._api = new sdk_1.PlanqkServiceApiClient({
|
|
27
18
|
environment: () => serviceEndpoint,
|
|
28
|
-
token: () =>
|
|
19
|
+
token: async () => Math.random().toString(36).slice(2),
|
|
29
20
|
});
|
|
30
21
|
}
|
|
31
22
|
}
|
|
32
|
-
|
|
33
|
-
return this._api.serviceApi
|
|
34
|
-
}
|
|
35
|
-
getInterimResults(jobId, request = {}, requestOptions) {
|
|
36
|
-
return this._api.serviceApi.getInterimResults(jobId, request, requestOptions);
|
|
37
|
-
}
|
|
38
|
-
getResult(jobId, requestOptions) {
|
|
39
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
-
yield this.waitForFinalState(jobId);
|
|
41
|
-
return this.doGetResultWithRetries(jobId, requestOptions);
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
getStatus(jobId, requestOptions) {
|
|
45
|
-
return this._api.serviceApi.getStatus(jobId, requestOptions);
|
|
46
|
-
}
|
|
47
|
-
healthCheck(requestOptions) {
|
|
48
|
-
return this._api.statusApi.healthCheck(requestOptions);
|
|
49
|
-
}
|
|
50
|
-
startExecution(request = {}, requestOptions) {
|
|
51
|
-
return this._api.serviceApi.startExecution(request, requestOptions);
|
|
52
|
-
}
|
|
53
|
-
doGetResultWithRetries(jobId, requestOptions, retries = 5, delay = 1000) {
|
|
54
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
-
try {
|
|
56
|
-
return yield this._api.serviceApi.getResult(jobId, requestOptions);
|
|
57
|
-
}
|
|
58
|
-
catch (error) {
|
|
59
|
-
if (error instanceof api_1.NotFoundError) {
|
|
60
|
-
if (retries === 0)
|
|
61
|
-
throw error;
|
|
62
|
-
// Wait for the specified delay
|
|
63
|
-
yield new Promise(resolve => {
|
|
64
|
-
setTimeout(resolve, delay);
|
|
65
|
-
});
|
|
66
|
-
// Double the delay, but cap it at 16 seconds
|
|
67
|
-
const newDelay = Math.min(delay * 2, 16000);
|
|
68
|
-
return this.doGetResultWithRetries(jobId, requestOptions, retries - 1, newDelay);
|
|
69
|
-
}
|
|
70
|
-
throw error;
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
doWaitForFinalState(jobId, timeout, waitTime = 5, startTime = Date.now()) {
|
|
75
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
-
const job = yield this.getStatus(jobId);
|
|
77
|
-
if (this.jobHasFinished(job))
|
|
78
|
-
return;
|
|
79
|
-
const elapsedTime = Date.now() - startTime;
|
|
80
|
-
if (timeout !== undefined && elapsedTime >= timeout * 1000) {
|
|
81
|
-
throw new Error(`Timeout while waiting for job '${jobId}'.`);
|
|
82
|
-
}
|
|
83
|
-
yield new Promise(resolve => {
|
|
84
|
-
setTimeout(resolve, waitTime * 1000);
|
|
85
|
-
});
|
|
86
|
-
yield this.doWaitForFinalState(jobId, timeout, waitTime, startTime);
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
jobHasFinished(job) {
|
|
90
|
-
return (job.status === api_1.JobStatus.Succeeded || job.status === api_1.JobStatus.Failed || job.status === api_1.JobStatus.Cancelled);
|
|
91
|
-
}
|
|
92
|
-
waitForFinalState(jobId, timeout, wait = 5) {
|
|
93
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
94
|
-
yield this.doWaitForFinalState(jobId, timeout, wait);
|
|
95
|
-
});
|
|
23
|
+
api() {
|
|
24
|
+
return this._api.serviceApi;
|
|
96
25
|
}
|
|
97
26
|
}
|
|
98
27
|
exports.PlanqkServiceClient = PlanqkServiceClient;
|
package/dist/sdk/Client.d.ts
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as environments from "./environments";
|
|
5
5
|
import * as core from "./core";
|
|
6
|
-
import { StatusApi } from "./api/resources/statusApi/client/Client";
|
|
7
6
|
import { ServiceApi } from "./api/resources/serviceApi/client/Client";
|
|
8
7
|
export declare namespace PlanqkServiceApiClient {
|
|
9
8
|
interface Options {
|
|
@@ -11,15 +10,17 @@ export declare namespace PlanqkServiceApiClient {
|
|
|
11
10
|
token: core.Supplier<core.BearerToken>;
|
|
12
11
|
}
|
|
13
12
|
interface RequestOptions {
|
|
13
|
+
/** The maximum time to wait for a response in seconds. */
|
|
14
14
|
timeoutInSeconds?: number;
|
|
15
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
15
16
|
maxRetries?: number;
|
|
17
|
+
/** A hook to abort the request. */
|
|
18
|
+
abortSignal?: AbortSignal;
|
|
16
19
|
}
|
|
17
20
|
}
|
|
18
21
|
export declare class PlanqkServiceApiClient {
|
|
19
22
|
protected readonly _options: PlanqkServiceApiClient.Options;
|
|
20
23
|
constructor(_options: PlanqkServiceApiClient.Options);
|
|
21
|
-
protected _statusApi: StatusApi | undefined;
|
|
22
|
-
get statusApi(): StatusApi;
|
|
23
24
|
protected _serviceApi: ServiceApi | undefined;
|
|
24
25
|
get serviceApi(): ServiceApi;
|
|
25
26
|
}
|
package/dist/sdk/Client.js
CHANGED
|
@@ -4,19 +4,15 @@
|
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.PlanqkServiceApiClient = void 0;
|
|
7
|
-
const Client_1 = require("./api/resources/
|
|
8
|
-
const Client_2 = require("./api/resources/serviceApi/client/Client");
|
|
7
|
+
const Client_1 = require("./api/resources/serviceApi/client/Client");
|
|
9
8
|
class PlanqkServiceApiClient {
|
|
9
|
+
_options;
|
|
10
10
|
constructor(_options) {
|
|
11
11
|
this._options = _options;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
var _a;
|
|
15
|
-
return ((_a = this._statusApi) !== null && _a !== void 0 ? _a : (this._statusApi = new Client_1.StatusApi(this._options)));
|
|
16
|
-
}
|
|
13
|
+
_serviceApi;
|
|
17
14
|
get serviceApi() {
|
|
18
|
-
|
|
19
|
-
return ((_a = this._serviceApi) !== null && _a !== void 0 ? _a : (this._serviceApi = new Client_2.ServiceApi(this._options)));
|
|
15
|
+
return (this._serviceApi ??= new Client_1.ServiceApi(this._options));
|
|
20
16
|
}
|
|
21
17
|
}
|
|
22
18
|
exports.PlanqkServiceApiClient = PlanqkServiceApiClient;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as errors from "../../errors";
|
|
4
|
+
import * as errors from "../../errors/index";
|
|
5
5
|
export declare class BadRequestError extends errors.PlanqkServiceApiError {
|
|
6
6
|
constructor(body?: any);
|
|
7
7
|
}
|
|
@@ -18,16 +18,26 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
18
18
|
}) : function(o, v) {
|
|
19
19
|
o["default"] = v;
|
|
20
20
|
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
39
|
exports.BadRequestError = void 0;
|
|
30
|
-
const errors = __importStar(require("../../errors"));
|
|
40
|
+
const errors = __importStar(require("../../errors/index"));
|
|
31
41
|
class BadRequestError extends errors.PlanqkServiceApiError {
|
|
32
42
|
constructor(body) {
|
|
33
43
|
super({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as errors from "../../errors";
|
|
4
|
+
import * as errors from "../../errors/index";
|
|
5
5
|
export declare class ForbiddenError extends errors.PlanqkServiceApiError {
|
|
6
6
|
constructor(body?: any);
|
|
7
7
|
}
|
|
@@ -18,16 +18,26 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
18
18
|
}) : function(o, v) {
|
|
19
19
|
o["default"] = v;
|
|
20
20
|
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
39
|
exports.ForbiddenError = void 0;
|
|
30
|
-
const errors = __importStar(require("../../errors"));
|
|
40
|
+
const errors = __importStar(require("../../errors/index"));
|
|
31
41
|
class ForbiddenError extends errors.PlanqkServiceApiError {
|
|
32
42
|
constructor(body) {
|
|
33
43
|
super({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as errors from "../../errors";
|
|
4
|
+
import * as errors from "../../errors/index";
|
|
5
5
|
export declare class InternalServerError extends errors.PlanqkServiceApiError {
|
|
6
6
|
constructor(body?: any);
|
|
7
7
|
}
|
|
@@ -18,16 +18,26 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
18
18
|
}) : function(o, v) {
|
|
19
19
|
o["default"] = v;
|
|
20
20
|
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
39
|
exports.InternalServerError = void 0;
|
|
30
|
-
const errors = __importStar(require("../../errors"));
|
|
40
|
+
const errors = __importStar(require("../../errors/index"));
|
|
31
41
|
class InternalServerError extends errors.PlanqkServiceApiError {
|
|
32
42
|
constructor(body) {
|
|
33
43
|
super({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as errors from "../../errors";
|
|
4
|
+
import * as errors from "../../errors/index";
|
|
5
5
|
export declare class NotFoundError extends errors.PlanqkServiceApiError {
|
|
6
6
|
constructor(body?: any);
|
|
7
7
|
}
|
|
@@ -18,16 +18,26 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
18
18
|
}) : function(o, v) {
|
|
19
19
|
o["default"] = v;
|
|
20
20
|
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
39
|
exports.NotFoundError = void 0;
|
|
30
|
-
const errors = __importStar(require("../../errors"));
|
|
40
|
+
const errors = __importStar(require("../../errors/index"));
|
|
31
41
|
class NotFoundError extends errors.PlanqkServiceApiError {
|
|
32
42
|
constructor(body) {
|
|
33
43
|
super({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as errors from "../../errors";
|
|
4
|
+
import * as errors from "../../errors/index";
|
|
5
5
|
export declare class UnauthorizedError extends errors.PlanqkServiceApiError {
|
|
6
6
|
constructor(body?: any);
|
|
7
7
|
}
|
|
@@ -18,16 +18,26 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
18
18
|
}) : function(o, v) {
|
|
19
19
|
o["default"] = v;
|
|
20
20
|
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
39
|
exports.UnauthorizedError = void 0;
|
|
30
|
-
const errors = __importStar(require("../../errors"));
|
|
40
|
+
const errors = __importStar(require("../../errors/index"));
|
|
31
41
|
class UnauthorizedError extends errors.PlanqkServiceApiError {
|
|
32
42
|
constructor(body) {
|
|
33
43
|
super({
|
|
@@ -15,20 +15,27 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
37
|
};
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.serviceApi =
|
|
30
|
-
exports.statusApi = __importStar(require("./statusApi"));
|
|
31
|
-
__exportStar(require("./statusApi/types"), exports);
|
|
39
|
+
exports.serviceApi = void 0;
|
|
32
40
|
exports.serviceApi = __importStar(require("./serviceApi"));
|
|
33
41
|
__exportStar(require("./serviceApi/types"), exports);
|
|
34
|
-
__exportStar(require("./serviceApi/client/requests"), exports);
|
|
@@ -4,21 +4,40 @@
|
|
|
4
4
|
import * as environments from "../../../../environments";
|
|
5
5
|
import * as core from "../../../../core";
|
|
6
6
|
import * as PlanqkServiceApi from "../../../index";
|
|
7
|
+
import * as stream from "stream";
|
|
7
8
|
export declare namespace ServiceApi {
|
|
8
9
|
interface Options {
|
|
9
10
|
environment?: core.Supplier<environments.PlanqkServiceApiEnvironment | string>;
|
|
10
11
|
token: core.Supplier<core.BearerToken>;
|
|
11
12
|
}
|
|
12
13
|
interface RequestOptions {
|
|
14
|
+
/** The maximum time to wait for a response in seconds. */
|
|
13
15
|
timeoutInSeconds?: number;
|
|
16
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
14
17
|
maxRetries?: number;
|
|
18
|
+
/** A hook to abort the request. */
|
|
19
|
+
abortSignal?: AbortSignal;
|
|
15
20
|
}
|
|
16
21
|
}
|
|
17
22
|
export declare class ServiceApi {
|
|
18
23
|
protected readonly _options: ServiceApi.Options;
|
|
19
24
|
constructor(_options: ServiceApi.Options);
|
|
20
25
|
/**
|
|
21
|
-
* This method
|
|
26
|
+
* This method checks the health of the service.
|
|
27
|
+
*
|
|
28
|
+
* @param {ServiceApi.RequestOptions} requestOptions - Request-specific configuration.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* await client.serviceApi.healthCheck()
|
|
32
|
+
*/
|
|
33
|
+
healthCheck(requestOptions?: ServiceApi.RequestOptions): Promise<PlanqkServiceApi.HealthCheckResponse>;
|
|
34
|
+
/**
|
|
35
|
+
* This method starts a service execution, which in turn is processed asynchronously by PLANQK.
|
|
36
|
+
* The location header of the response contains the URL which can be used to query the status and the result of the service execution.
|
|
37
|
+
*
|
|
38
|
+
* @param {Record<string, Record<string, any>>} request
|
|
39
|
+
* @param {ServiceApi.RequestOptions} requestOptions - Request-specific configuration.
|
|
40
|
+
*
|
|
22
41
|
* @throws {@link PlanqkServiceApi.BadRequestError}
|
|
23
42
|
* @throws {@link PlanqkServiceApi.UnauthorizedError}
|
|
24
43
|
* @throws {@link PlanqkServiceApi.ForbiddenError}
|
|
@@ -26,46 +45,80 @@ export declare class ServiceApi {
|
|
|
26
45
|
* @throws {@link PlanqkServiceApi.InternalServerError}
|
|
27
46
|
*
|
|
28
47
|
* @example
|
|
29
|
-
* await
|
|
48
|
+
* await client.serviceApi.execute({
|
|
49
|
+
* "key": {
|
|
50
|
+
* "key": "value"
|
|
51
|
+
* }
|
|
52
|
+
* })
|
|
30
53
|
*/
|
|
31
|
-
|
|
54
|
+
execute(request: Record<string, Record<string, any>>, requestOptions?: ServiceApi.RequestOptions): Promise<PlanqkServiceApi.ServiceExecution>;
|
|
32
55
|
/**
|
|
33
|
-
*
|
|
56
|
+
* This method checks the status of a service execution.
|
|
57
|
+
*
|
|
58
|
+
* @param {string} id - The id of a service execution
|
|
59
|
+
* @param {ServiceApi.RequestOptions} requestOptions - Request-specific configuration.
|
|
60
|
+
*
|
|
34
61
|
* @throws {@link PlanqkServiceApi.UnauthorizedError}
|
|
35
62
|
* @throws {@link PlanqkServiceApi.ForbiddenError}
|
|
36
63
|
* @throws {@link PlanqkServiceApi.NotFoundError}
|
|
37
64
|
* @throws {@link PlanqkServiceApi.InternalServerError}
|
|
38
65
|
*
|
|
39
66
|
* @example
|
|
40
|
-
* await
|
|
67
|
+
* await client.serviceApi.getStatus("id")
|
|
41
68
|
*/
|
|
42
|
-
getStatus(id: string, requestOptions?: ServiceApi.RequestOptions): Promise<PlanqkServiceApi.
|
|
69
|
+
getStatus(id: string, requestOptions?: ServiceApi.RequestOptions): Promise<PlanqkServiceApi.ServiceExecution>;
|
|
43
70
|
/**
|
|
44
|
-
*
|
|
71
|
+
* This method retrieves the result of a service execution.
|
|
72
|
+
*
|
|
73
|
+
* @param {string} id - The id of a service execution
|
|
74
|
+
* @param {ServiceApi.RequestOptions} requestOptions - Request-specific configuration.
|
|
75
|
+
*
|
|
45
76
|
* @throws {@link PlanqkServiceApi.UnauthorizedError}
|
|
46
77
|
* @throws {@link PlanqkServiceApi.ForbiddenError}
|
|
47
78
|
* @throws {@link PlanqkServiceApi.NotFoundError}
|
|
48
79
|
* @throws {@link PlanqkServiceApi.InternalServerError}
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* await client.serviceApi.getResult("id")
|
|
49
83
|
*/
|
|
50
84
|
getResult(id: string, requestOptions?: ServiceApi.RequestOptions): Promise<PlanqkServiceApi.GetResultResponse>;
|
|
51
85
|
/**
|
|
52
|
-
*
|
|
86
|
+
* This method downloads a result file of a service execution.
|
|
53
87
|
* @throws {@link PlanqkServiceApi.UnauthorizedError}
|
|
54
88
|
* @throws {@link PlanqkServiceApi.ForbiddenError}
|
|
55
89
|
* @throws {@link PlanqkServiceApi.NotFoundError}
|
|
56
90
|
* @throws {@link PlanqkServiceApi.InternalServerError}
|
|
57
91
|
*/
|
|
58
|
-
|
|
92
|
+
getResultFile(id: string, file: string, requestOptions?: ServiceApi.RequestOptions): Promise<stream.Readable>;
|
|
59
93
|
/**
|
|
60
|
-
*
|
|
94
|
+
* This method retrieves the log output of a service execution.
|
|
95
|
+
*
|
|
96
|
+
* @param {string} id - The id of a service execution
|
|
97
|
+
* @param {ServiceApi.RequestOptions} requestOptions - Request-specific configuration.
|
|
98
|
+
*
|
|
99
|
+
* @throws {@link PlanqkServiceApi.UnauthorizedError}
|
|
100
|
+
* @throws {@link PlanqkServiceApi.ForbiddenError}
|
|
101
|
+
* @throws {@link PlanqkServiceApi.NotFoundError}
|
|
102
|
+
* @throws {@link PlanqkServiceApi.InternalServerError}
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* await client.serviceApi.getLogs("id")
|
|
106
|
+
*/
|
|
107
|
+
getLogs(id: string, requestOptions?: ServiceApi.RequestOptions): Promise<string[]>;
|
|
108
|
+
/**
|
|
109
|
+
* This method cancels a service execution.
|
|
110
|
+
*
|
|
111
|
+
* @param {string} id - The id of a service execution
|
|
112
|
+
* @param {ServiceApi.RequestOptions} requestOptions - Request-specific configuration.
|
|
113
|
+
*
|
|
61
114
|
* @throws {@link PlanqkServiceApi.UnauthorizedError}
|
|
62
115
|
* @throws {@link PlanqkServiceApi.ForbiddenError}
|
|
63
116
|
* @throws {@link PlanqkServiceApi.NotFoundError}
|
|
64
117
|
* @throws {@link PlanqkServiceApi.InternalServerError}
|
|
65
118
|
*
|
|
66
119
|
* @example
|
|
67
|
-
* await
|
|
120
|
+
* await client.serviceApi.cancel("id")
|
|
68
121
|
*/
|
|
69
|
-
|
|
122
|
+
cancel(id: string, requestOptions?: ServiceApi.RequestOptions): Promise<PlanqkServiceApi.ServiceExecution>;
|
|
70
123
|
protected _getAuthorizationHeader(): Promise<string>;
|
|
71
124
|
}
|