@planqk/planqk-api-sdk 1.3.7 → 1.7.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/.env.template +3 -3
- package/.gitlab-ci.yml +19 -22
- package/.releaserc.json +2 -1
- package/README-node.md +1 -1
- package/README-python.md +1 -1
- package/README.md +1 -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/environments.d.ts +1 -1
- package/dist/sdk/environments.js +1 -1
- 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 +951 -55
- package/package.json +1 -1
- package/planqk/api/_version.py +1 -1
- package/planqk/api/client.py +2 -2
- package/planqk/api/credentials.py +6 -6
- package/planqk/api/sdk/environment.py +1 -1
- package/pyproject.toml +3 -3
- package/requirements.txt +117 -113
- package/scripts/update-version.sh +2 -0
- package/src/index.test.ts +11 -4
- 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/environments.ts +1 -1
- 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/requirements-dev.txt +0 -682
- package/src/sdk/core/file.ts +0 -11
- /package/dist/sdk/{core/file.js → api/resources/serviceExecutions/client/index.js} +0 -0
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
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
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.ServiceJobs = void 0;
|
|
40
|
+
const environments = __importStar(require("../../../../environments.js"));
|
|
41
|
+
const core = __importStar(require("../../../../core/index.js"));
|
|
42
|
+
const PlanqkApi = __importStar(require("../../../index.js"));
|
|
43
|
+
const headers_js_1 = require("../../../../core/headers.js");
|
|
44
|
+
const errors = __importStar(require("../../../../errors/index.js"));
|
|
45
|
+
/**
|
|
46
|
+
* Run your created services in a job-based manner. Service jobs allow you to execute services with specific parameters and track their execution status, costs, logs, metrics, and results.
|
|
47
|
+
*/
|
|
48
|
+
class ServiceJobs {
|
|
49
|
+
_options;
|
|
50
|
+
constructor(_options) {
|
|
51
|
+
this._options = _options;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Cancel a specific service job (identified by its ID). Only service jobs that are pending or currently running can be cancelled.
|
|
55
|
+
*
|
|
56
|
+
* @param {string} id
|
|
57
|
+
* @param {ServiceJobs.RequestOptions} requestOptions - Request-specific configuration.
|
|
58
|
+
*
|
|
59
|
+
* @throws {@link PlanqkApi.UnauthorizedError}
|
|
60
|
+
* @throws {@link PlanqkApi.ForbiddenError}
|
|
61
|
+
* @throws {@link PlanqkApi.NotFoundError}
|
|
62
|
+
* @throws {@link PlanqkApi.InternalServerError}
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* await client.serviceJobs.cancelServiceJob("id")
|
|
66
|
+
*/
|
|
67
|
+
cancelServiceJob(id, requestOptions) {
|
|
68
|
+
return core.HttpResponsePromise.fromPromise(this.__cancelServiceJob(id, requestOptions));
|
|
69
|
+
}
|
|
70
|
+
async __cancelServiceJob(id, requestOptions) {
|
|
71
|
+
let _headers = (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
72
|
+
"X-OrganizationId": requestOptions?.organizationId ?? this._options?.organizationId,
|
|
73
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
74
|
+
}), requestOptions?.headers);
|
|
75
|
+
const _response = await core.fetcher({
|
|
76
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
77
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
78
|
+
environments.PlanqkApiEnvironment.Default, `service-jobs/${encodeURIComponent(id)}/cancel`),
|
|
79
|
+
method: "PUT",
|
|
80
|
+
headers: _headers,
|
|
81
|
+
queryParameters: requestOptions?.queryParams,
|
|
82
|
+
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
83
|
+
maxRetries: requestOptions?.maxRetries,
|
|
84
|
+
withCredentials: true,
|
|
85
|
+
abortSignal: requestOptions?.abortSignal,
|
|
86
|
+
});
|
|
87
|
+
if (_response.ok) {
|
|
88
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
89
|
+
}
|
|
90
|
+
if (_response.error.reason === "status-code") {
|
|
91
|
+
switch (_response.error.statusCode) {
|
|
92
|
+
case 401:
|
|
93
|
+
throw new PlanqkApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
94
|
+
case 403:
|
|
95
|
+
throw new PlanqkApi.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
96
|
+
case 404:
|
|
97
|
+
throw new PlanqkApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
98
|
+
case 500:
|
|
99
|
+
throw new PlanqkApi.InternalServerError(_response.error.body, _response.rawResponse);
|
|
100
|
+
default:
|
|
101
|
+
throw new errors.PlanqkApiError({
|
|
102
|
+
statusCode: _response.error.statusCode,
|
|
103
|
+
body: _response.error.body,
|
|
104
|
+
rawResponse: _response.rawResponse,
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
switch (_response.error.reason) {
|
|
109
|
+
case "non-json":
|
|
110
|
+
throw new errors.PlanqkApiError({
|
|
111
|
+
statusCode: _response.error.statusCode,
|
|
112
|
+
body: _response.error.rawBody,
|
|
113
|
+
rawResponse: _response.rawResponse,
|
|
114
|
+
});
|
|
115
|
+
case "timeout":
|
|
116
|
+
throw new errors.PlanqkApiTimeoutError("Timeout exceeded when calling PUT /service-jobs/{id}/cancel.");
|
|
117
|
+
case "unknown":
|
|
118
|
+
throw new errors.PlanqkApiError({
|
|
119
|
+
message: _response.error.errorMessage,
|
|
120
|
+
rawResponse: _response.rawResponse,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Get a list of all service jobs for the current user or organization.
|
|
126
|
+
*
|
|
127
|
+
* @param {ServiceJobs.RequestOptions} requestOptions - Request-specific configuration.
|
|
128
|
+
*
|
|
129
|
+
* @throws {@link PlanqkApi.UnauthorizedError}
|
|
130
|
+
* @throws {@link PlanqkApi.ForbiddenError}
|
|
131
|
+
* @throws {@link PlanqkApi.NotFoundError}
|
|
132
|
+
* @throws {@link PlanqkApi.InternalServerError}
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* await client.serviceJobs.getServiceJobs()
|
|
136
|
+
*/
|
|
137
|
+
getServiceJobs(requestOptions) {
|
|
138
|
+
return core.HttpResponsePromise.fromPromise(this.__getServiceJobs(requestOptions));
|
|
139
|
+
}
|
|
140
|
+
async __getServiceJobs(requestOptions) {
|
|
141
|
+
let _headers = (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
142
|
+
"X-OrganizationId": requestOptions?.organizationId ?? this._options?.organizationId,
|
|
143
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
144
|
+
}), requestOptions?.headers);
|
|
145
|
+
const _response = await core.fetcher({
|
|
146
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
147
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
148
|
+
environments.PlanqkApiEnvironment.Default, "service-jobs"),
|
|
149
|
+
method: "GET",
|
|
150
|
+
headers: _headers,
|
|
151
|
+
queryParameters: requestOptions?.queryParams,
|
|
152
|
+
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
153
|
+
maxRetries: requestOptions?.maxRetries,
|
|
154
|
+
withCredentials: true,
|
|
155
|
+
abortSignal: requestOptions?.abortSignal,
|
|
156
|
+
});
|
|
157
|
+
if (_response.ok) {
|
|
158
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
159
|
+
}
|
|
160
|
+
if (_response.error.reason === "status-code") {
|
|
161
|
+
switch (_response.error.statusCode) {
|
|
162
|
+
case 401:
|
|
163
|
+
throw new PlanqkApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
164
|
+
case 403:
|
|
165
|
+
throw new PlanqkApi.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
166
|
+
case 404:
|
|
167
|
+
throw new PlanqkApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
168
|
+
case 500:
|
|
169
|
+
throw new PlanqkApi.InternalServerError(_response.error.body, _response.rawResponse);
|
|
170
|
+
default:
|
|
171
|
+
throw new errors.PlanqkApiError({
|
|
172
|
+
statusCode: _response.error.statusCode,
|
|
173
|
+
body: _response.error.body,
|
|
174
|
+
rawResponse: _response.rawResponse,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
switch (_response.error.reason) {
|
|
179
|
+
case "non-json":
|
|
180
|
+
throw new errors.PlanqkApiError({
|
|
181
|
+
statusCode: _response.error.statusCode,
|
|
182
|
+
body: _response.error.rawBody,
|
|
183
|
+
rawResponse: _response.rawResponse,
|
|
184
|
+
});
|
|
185
|
+
case "timeout":
|
|
186
|
+
throw new errors.PlanqkApiTimeoutError("Timeout exceeded when calling GET /service-jobs.");
|
|
187
|
+
case "unknown":
|
|
188
|
+
throw new errors.PlanqkApiError({
|
|
189
|
+
message: _response.error.errorMessage,
|
|
190
|
+
rawResponse: _response.rawResponse,
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Create and start a new service job.
|
|
196
|
+
*
|
|
197
|
+
* @param {PlanqkApi.CreateServiceJobRequest} request
|
|
198
|
+
* @param {ServiceJobs.RequestOptions} requestOptions - Request-specific configuration.
|
|
199
|
+
*
|
|
200
|
+
* @throws {@link PlanqkApi.BadRequestError}
|
|
201
|
+
* @throws {@link PlanqkApi.UnauthorizedError}
|
|
202
|
+
* @throws {@link PlanqkApi.ForbiddenError}
|
|
203
|
+
* @throws {@link PlanqkApi.NotFoundError}
|
|
204
|
+
* @throws {@link PlanqkApi.InternalServerError}
|
|
205
|
+
*
|
|
206
|
+
* @example
|
|
207
|
+
* await client.serviceJobs.createServiceJob()
|
|
208
|
+
*/
|
|
209
|
+
createServiceJob(request = {}, requestOptions) {
|
|
210
|
+
return core.HttpResponsePromise.fromPromise(this.__createServiceJob(request, requestOptions));
|
|
211
|
+
}
|
|
212
|
+
async __createServiceJob(request = {}, requestOptions) {
|
|
213
|
+
let _headers = (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
214
|
+
"X-OrganizationId": requestOptions?.organizationId ?? this._options?.organizationId,
|
|
215
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
216
|
+
}), requestOptions?.headers);
|
|
217
|
+
const _response = await core.fetcher({
|
|
218
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
219
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
220
|
+
environments.PlanqkApiEnvironment.Default, "service-jobs"),
|
|
221
|
+
method: "POST",
|
|
222
|
+
headers: _headers,
|
|
223
|
+
contentType: "application/json",
|
|
224
|
+
queryParameters: requestOptions?.queryParams,
|
|
225
|
+
requestType: "json",
|
|
226
|
+
body: request,
|
|
227
|
+
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
228
|
+
maxRetries: requestOptions?.maxRetries,
|
|
229
|
+
withCredentials: true,
|
|
230
|
+
abortSignal: requestOptions?.abortSignal,
|
|
231
|
+
});
|
|
232
|
+
if (_response.ok) {
|
|
233
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
234
|
+
}
|
|
235
|
+
if (_response.error.reason === "status-code") {
|
|
236
|
+
switch (_response.error.statusCode) {
|
|
237
|
+
case 400:
|
|
238
|
+
throw new PlanqkApi.BadRequestError(_response.error.body, _response.rawResponse);
|
|
239
|
+
case 401:
|
|
240
|
+
throw new PlanqkApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
241
|
+
case 403:
|
|
242
|
+
throw new PlanqkApi.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
243
|
+
case 404:
|
|
244
|
+
throw new PlanqkApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
245
|
+
case 500:
|
|
246
|
+
throw new PlanqkApi.InternalServerError(_response.error.body, _response.rawResponse);
|
|
247
|
+
default:
|
|
248
|
+
throw new errors.PlanqkApiError({
|
|
249
|
+
statusCode: _response.error.statusCode,
|
|
250
|
+
body: _response.error.body,
|
|
251
|
+
rawResponse: _response.rawResponse,
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
switch (_response.error.reason) {
|
|
256
|
+
case "non-json":
|
|
257
|
+
throw new errors.PlanqkApiError({
|
|
258
|
+
statusCode: _response.error.statusCode,
|
|
259
|
+
body: _response.error.rawBody,
|
|
260
|
+
rawResponse: _response.rawResponse,
|
|
261
|
+
});
|
|
262
|
+
case "timeout":
|
|
263
|
+
throw new errors.PlanqkApiTimeoutError("Timeout exceeded when calling POST /service-jobs.");
|
|
264
|
+
case "unknown":
|
|
265
|
+
throw new errors.PlanqkApiError({
|
|
266
|
+
message: _response.error.errorMessage,
|
|
267
|
+
rawResponse: _response.rawResponse,
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Get a specific service job (identified by its ID).
|
|
273
|
+
*
|
|
274
|
+
* @param {string} id
|
|
275
|
+
* @param {ServiceJobs.RequestOptions} requestOptions - Request-specific configuration.
|
|
276
|
+
*
|
|
277
|
+
* @throws {@link PlanqkApi.UnauthorizedError}
|
|
278
|
+
* @throws {@link PlanqkApi.ForbiddenError}
|
|
279
|
+
* @throws {@link PlanqkApi.NotFoundError}
|
|
280
|
+
* @throws {@link PlanqkApi.InternalServerError}
|
|
281
|
+
*
|
|
282
|
+
* @example
|
|
283
|
+
* await client.serviceJobs.getServiceJob("id")
|
|
284
|
+
*/
|
|
285
|
+
getServiceJob(id, requestOptions) {
|
|
286
|
+
return core.HttpResponsePromise.fromPromise(this.__getServiceJob(id, requestOptions));
|
|
287
|
+
}
|
|
288
|
+
async __getServiceJob(id, requestOptions) {
|
|
289
|
+
let _headers = (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
290
|
+
"X-OrganizationId": requestOptions?.organizationId ?? this._options?.organizationId,
|
|
291
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
292
|
+
}), requestOptions?.headers);
|
|
293
|
+
const _response = await core.fetcher({
|
|
294
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
295
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
296
|
+
environments.PlanqkApiEnvironment.Default, `service-jobs/${encodeURIComponent(id)}`),
|
|
297
|
+
method: "GET",
|
|
298
|
+
headers: _headers,
|
|
299
|
+
queryParameters: requestOptions?.queryParams,
|
|
300
|
+
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
301
|
+
maxRetries: requestOptions?.maxRetries,
|
|
302
|
+
withCredentials: true,
|
|
303
|
+
abortSignal: requestOptions?.abortSignal,
|
|
304
|
+
});
|
|
305
|
+
if (_response.ok) {
|
|
306
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
307
|
+
}
|
|
308
|
+
if (_response.error.reason === "status-code") {
|
|
309
|
+
switch (_response.error.statusCode) {
|
|
310
|
+
case 401:
|
|
311
|
+
throw new PlanqkApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
312
|
+
case 403:
|
|
313
|
+
throw new PlanqkApi.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
314
|
+
case 404:
|
|
315
|
+
throw new PlanqkApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
316
|
+
case 500:
|
|
317
|
+
throw new PlanqkApi.InternalServerError(_response.error.body, _response.rawResponse);
|
|
318
|
+
default:
|
|
319
|
+
throw new errors.PlanqkApiError({
|
|
320
|
+
statusCode: _response.error.statusCode,
|
|
321
|
+
body: _response.error.body,
|
|
322
|
+
rawResponse: _response.rawResponse,
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
switch (_response.error.reason) {
|
|
327
|
+
case "non-json":
|
|
328
|
+
throw new errors.PlanqkApiError({
|
|
329
|
+
statusCode: _response.error.statusCode,
|
|
330
|
+
body: _response.error.rawBody,
|
|
331
|
+
rawResponse: _response.rawResponse,
|
|
332
|
+
});
|
|
333
|
+
case "timeout":
|
|
334
|
+
throw new errors.PlanqkApiTimeoutError("Timeout exceeded when calling GET /service-jobs/{id}.");
|
|
335
|
+
case "unknown":
|
|
336
|
+
throw new errors.PlanqkApiError({
|
|
337
|
+
message: _response.error.errorMessage,
|
|
338
|
+
rawResponse: _response.rawResponse,
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Get the results for a specific service job (identified by its ID). If the service job has not completed yet or no results are available, a HTTP 204 (No Content) response is returned with a Retry-After header.
|
|
344
|
+
*
|
|
345
|
+
* @param {string} id
|
|
346
|
+
* @param {ServiceJobs.RequestOptions} requestOptions - Request-specific configuration.
|
|
347
|
+
*
|
|
348
|
+
* @throws {@link PlanqkApi.UnauthorizedError}
|
|
349
|
+
* @throws {@link PlanqkApi.ForbiddenError}
|
|
350
|
+
* @throws {@link PlanqkApi.NotFoundError}
|
|
351
|
+
* @throws {@link PlanqkApi.InternalServerError}
|
|
352
|
+
*
|
|
353
|
+
* @example
|
|
354
|
+
* await client.serviceJobs.getServiceJobResults("id")
|
|
355
|
+
*/
|
|
356
|
+
getServiceJobResults(id, requestOptions) {
|
|
357
|
+
return core.HttpResponsePromise.fromPromise(this.__getServiceJobResults(id, requestOptions));
|
|
358
|
+
}
|
|
359
|
+
async __getServiceJobResults(id, requestOptions) {
|
|
360
|
+
let _headers = (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
361
|
+
"X-OrganizationId": requestOptions?.organizationId ?? this._options?.organizationId,
|
|
362
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
363
|
+
}), requestOptions?.headers);
|
|
364
|
+
const _response = await core.fetcher({
|
|
365
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
366
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
367
|
+
environments.PlanqkApiEnvironment.Default, `service-jobs/${encodeURIComponent(id)}/results`),
|
|
368
|
+
method: "GET",
|
|
369
|
+
headers: _headers,
|
|
370
|
+
queryParameters: requestOptions?.queryParams,
|
|
371
|
+
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
372
|
+
maxRetries: requestOptions?.maxRetries,
|
|
373
|
+
withCredentials: true,
|
|
374
|
+
abortSignal: requestOptions?.abortSignal,
|
|
375
|
+
});
|
|
376
|
+
if (_response.ok) {
|
|
377
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
378
|
+
}
|
|
379
|
+
if (_response.error.reason === "status-code") {
|
|
380
|
+
switch (_response.error.statusCode) {
|
|
381
|
+
case 401:
|
|
382
|
+
throw new PlanqkApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
383
|
+
case 403:
|
|
384
|
+
throw new PlanqkApi.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
385
|
+
case 404:
|
|
386
|
+
throw new PlanqkApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
387
|
+
case 500:
|
|
388
|
+
throw new PlanqkApi.InternalServerError(_response.error.body, _response.rawResponse);
|
|
389
|
+
default:
|
|
390
|
+
throw new errors.PlanqkApiError({
|
|
391
|
+
statusCode: _response.error.statusCode,
|
|
392
|
+
body: _response.error.body,
|
|
393
|
+
rawResponse: _response.rawResponse,
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
switch (_response.error.reason) {
|
|
398
|
+
case "non-json":
|
|
399
|
+
throw new errors.PlanqkApiError({
|
|
400
|
+
statusCode: _response.error.statusCode,
|
|
401
|
+
body: _response.error.rawBody,
|
|
402
|
+
rawResponse: _response.rawResponse,
|
|
403
|
+
});
|
|
404
|
+
case "timeout":
|
|
405
|
+
throw new errors.PlanqkApiTimeoutError("Timeout exceeded when calling GET /service-jobs/{id}/results.");
|
|
406
|
+
case "unknown":
|
|
407
|
+
throw new errors.PlanqkApiError({
|
|
408
|
+
message: _response.error.errorMessage,
|
|
409
|
+
rawResponse: _response.rawResponse,
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Get the logs for a specific service job (identified by its ID). If the service job has not started yet or no logs are available, a HTTP 204 (No Content) response is returned with a Retry-After header.
|
|
415
|
+
*
|
|
416
|
+
* @param {string} id
|
|
417
|
+
* @param {ServiceJobs.RequestOptions} requestOptions - Request-specific configuration.
|
|
418
|
+
*
|
|
419
|
+
* @throws {@link PlanqkApi.UnauthorizedError}
|
|
420
|
+
* @throws {@link PlanqkApi.ForbiddenError}
|
|
421
|
+
* @throws {@link PlanqkApi.NotFoundError}
|
|
422
|
+
* @throws {@link PlanqkApi.InternalServerError}
|
|
423
|
+
*
|
|
424
|
+
* @example
|
|
425
|
+
* await client.serviceJobs.getServiceJobLogs("id")
|
|
426
|
+
*/
|
|
427
|
+
getServiceJobLogs(id, requestOptions) {
|
|
428
|
+
return core.HttpResponsePromise.fromPromise(this.__getServiceJobLogs(id, requestOptions));
|
|
429
|
+
}
|
|
430
|
+
async __getServiceJobLogs(id, requestOptions) {
|
|
431
|
+
let _headers = (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
432
|
+
"X-OrganizationId": requestOptions?.organizationId ?? this._options?.organizationId,
|
|
433
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
434
|
+
}), requestOptions?.headers);
|
|
435
|
+
const _response = await core.fetcher({
|
|
436
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
437
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
438
|
+
environments.PlanqkApiEnvironment.Default, `service-jobs/${encodeURIComponent(id)}/logs`),
|
|
439
|
+
method: "GET",
|
|
440
|
+
headers: _headers,
|
|
441
|
+
queryParameters: requestOptions?.queryParams,
|
|
442
|
+
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
443
|
+
maxRetries: requestOptions?.maxRetries,
|
|
444
|
+
withCredentials: true,
|
|
445
|
+
abortSignal: requestOptions?.abortSignal,
|
|
446
|
+
});
|
|
447
|
+
if (_response.ok) {
|
|
448
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
449
|
+
}
|
|
450
|
+
if (_response.error.reason === "status-code") {
|
|
451
|
+
switch (_response.error.statusCode) {
|
|
452
|
+
case 401:
|
|
453
|
+
throw new PlanqkApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
454
|
+
case 403:
|
|
455
|
+
throw new PlanqkApi.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
456
|
+
case 404:
|
|
457
|
+
throw new PlanqkApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
458
|
+
case 500:
|
|
459
|
+
throw new PlanqkApi.InternalServerError(_response.error.body, _response.rawResponse);
|
|
460
|
+
default:
|
|
461
|
+
throw new errors.PlanqkApiError({
|
|
462
|
+
statusCode: _response.error.statusCode,
|
|
463
|
+
body: _response.error.body,
|
|
464
|
+
rawResponse: _response.rawResponse,
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
switch (_response.error.reason) {
|
|
469
|
+
case "non-json":
|
|
470
|
+
throw new errors.PlanqkApiError({
|
|
471
|
+
statusCode: _response.error.statusCode,
|
|
472
|
+
body: _response.error.rawBody,
|
|
473
|
+
rawResponse: _response.rawResponse,
|
|
474
|
+
});
|
|
475
|
+
case "timeout":
|
|
476
|
+
throw new errors.PlanqkApiTimeoutError("Timeout exceeded when calling GET /service-jobs/{id}/logs.");
|
|
477
|
+
case "unknown":
|
|
478
|
+
throw new errors.PlanqkApiError({
|
|
479
|
+
message: _response.error.errorMessage,
|
|
480
|
+
rawResponse: _response.rawResponse,
|
|
481
|
+
});
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
async _getCustomAuthorizationHeaders() {
|
|
485
|
+
const apiKeyValue = await core.Supplier.get(this._options.apiKey);
|
|
486
|
+
return { "X-Auth-Token": apiKeyValue };
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
exports.ServiceJobs = ServiceJobs;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./requests/index.js"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* {}
|
|
7
|
+
*/
|
|
8
|
+
export interface CreateServiceJobRequest {
|
|
9
|
+
/** The ID fo the service for which the job is created. */
|
|
10
|
+
serviceId?: string;
|
|
11
|
+
/** Input data for the service job. This can be any JSON object that the service expects as input. The structure and content of this object depend on the specific service being executed. */
|
|
12
|
+
input?: Record<string, any>;
|
|
13
|
+
/** List of tags associated with the service job. Tags are saved in lowercase and can be used for filtering and searching. */
|
|
14
|
+
tags?: string[];
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type CreateServiceJobRequest } from "./CreateServiceJobRequest.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./client/index.js"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export interface ActivityInstance {
|
|
5
|
+
id?: string;
|
|
6
|
+
modelId?: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
type?: string;
|
|
9
|
+
startTime?: string;
|
|
10
|
+
endTime?: string;
|
|
11
|
+
state?: ActivityInstance.State;
|
|
12
|
+
}
|
|
13
|
+
export declare namespace ActivityInstance {
|
|
14
|
+
type State = "PENDING" | "RUNNING" | "COMPLETED";
|
|
15
|
+
const State: {
|
|
16
|
+
readonly Pending: "PENDING";
|
|
17
|
+
readonly Running: "RUNNING";
|
|
18
|
+
readonly Completed: "COMPLETED";
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ActivityInstance = void 0;
|
|
7
|
+
var ActivityInstance;
|
|
8
|
+
(function (ActivityInstance) {
|
|
9
|
+
ActivityInstance.State = {
|
|
10
|
+
Pending: "PENDING",
|
|
11
|
+
Running: "RUNNING",
|
|
12
|
+
Completed: "COMPLETED",
|
|
13
|
+
};
|
|
14
|
+
})(ActivityInstance || (exports.ActivityInstance = ActivityInstance = {}));
|
|
@@ -4,10 +4,15 @@
|
|
|
4
4
|
export interface DataPoolDto {
|
|
5
5
|
/** The access permission role for this entity of the current user */
|
|
6
6
|
currentUserPermission?: DataPoolDto.CurrentUserPermission;
|
|
7
|
+
/** Unique identifier of the data pool. */
|
|
7
8
|
id?: string;
|
|
9
|
+
/** Name of the data pool. */
|
|
8
10
|
name?: string;
|
|
11
|
+
/** Short description of the data pool. */
|
|
9
12
|
shortDescription?: string;
|
|
13
|
+
/** Detailed description of the data pool. */
|
|
10
14
|
description?: string;
|
|
15
|
+
/** Timestamp when the data pool was created. */
|
|
11
16
|
createdAt?: string;
|
|
12
17
|
}
|
|
13
18
|
export declare namespace DataPoolDto {
|
|
@@ -2,11 +2,18 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
export interface DataPoolFileDto {
|
|
5
|
+
/** Unique identifier of the data pool file. */
|
|
5
6
|
id?: string;
|
|
7
|
+
/** Unique identifier of the data pool. */
|
|
6
8
|
dataPoolId?: string;
|
|
9
|
+
/** The name of the file. */
|
|
7
10
|
name?: string;
|
|
11
|
+
/** The full path of the file in the data pool. */
|
|
8
12
|
fullPath?: string;
|
|
13
|
+
/** The content type of the file. */
|
|
9
14
|
contentType?: string;
|
|
15
|
+
/** The size of the file in bytes. */
|
|
10
16
|
contentLength?: number;
|
|
17
|
+
/** Timestamp when the file was created. */
|
|
11
18
|
createdAt?: string;
|
|
12
19
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export interface LogEntry {
|
|
5
|
+
/** Log message content. */
|
|
6
|
+
message?: string;
|
|
7
|
+
/** Severity of the log entry. */
|
|
8
|
+
severity?: LogEntry.Severity;
|
|
9
|
+
/** Timestamp when the entry was logged. */
|
|
10
|
+
timestamp?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare namespace LogEntry {
|
|
13
|
+
/**
|
|
14
|
+
* Severity of the log entry.
|
|
15
|
+
*/
|
|
16
|
+
type Severity = "DEBUG" | "NOTICE" | "INFO" | "WARNING" | "ERROR";
|
|
17
|
+
const Severity: {
|
|
18
|
+
readonly Debug: "DEBUG";
|
|
19
|
+
readonly Notice: "NOTICE";
|
|
20
|
+
readonly Info: "INFO";
|
|
21
|
+
readonly Warning: "WARNING";
|
|
22
|
+
readonly Error: "ERROR";
|
|
23
|
+
};
|
|
24
|
+
}
|