@planqk/planqk-service-sdk 2.7.0 → 2.9.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.
Files changed (101) hide show
  1. package/dist/sdk/BaseClient.d.ts +26 -0
  2. package/dist/sdk/{api/resources/serviceApi/types/GetResultResponse.js → BaseClient.js} +1 -3
  3. package/dist/sdk/Client.d.ts +3 -21
  4. package/dist/sdk/Client.js +1 -3
  5. package/dist/sdk/api/index.d.ts +1 -1
  6. package/dist/sdk/api/index.js +1 -1
  7. package/dist/sdk/api/resources/index.d.ts +0 -1
  8. package/dist/sdk/api/resources/index.js +0 -4
  9. package/dist/sdk/api/resources/serviceApi/client/Client.d.ts +6 -23
  10. package/dist/sdk/api/resources/serviceApi/client/Client.js +37 -25
  11. package/dist/sdk/api/resources/serviceApi/index.d.ts +0 -1
  12. package/dist/sdk/api/resources/serviceApi/index.js +0 -1
  13. package/dist/sdk/api/types/HalLink.d.ts +0 -3
  14. package/dist/sdk/api/types/HalLink.js +1 -3
  15. package/dist/sdk/api/types/LogEntry.d.ts +15 -4
  16. package/dist/sdk/api/types/LogEntry.js +13 -3
  17. package/dist/sdk/api/types/RequestBody.d.ts +1 -0
  18. package/dist/sdk/api/types/RequestBody.js +3 -0
  19. package/dist/sdk/api/types/ResultResponse.d.ts +15 -0
  20. package/dist/sdk/api/types/ResultResponse.js +3 -0
  21. package/dist/sdk/api/types/ServiceExecution.d.ts +22 -5
  22. package/dist/sdk/api/types/ServiceExecution.js +7 -3
  23. package/dist/sdk/api/types/index.d.ts +2 -0
  24. package/dist/sdk/api/types/index.js +2 -0
  25. package/dist/sdk/core/auth/AuthProvider.d.ts +4 -0
  26. package/dist/sdk/core/auth/AuthProvider.js +2 -0
  27. package/dist/sdk/core/auth/AuthRequest.d.ts +9 -0
  28. package/dist/sdk/core/auth/AuthRequest.js +2 -0
  29. package/dist/sdk/core/auth/BasicAuth.js +2 -1
  30. package/dist/sdk/core/auth/index.d.ts +2 -0
  31. package/dist/sdk/core/fetcher/APIResponse.d.ts +1 -1
  32. package/dist/sdk/core/fetcher/BinaryResponse.d.ts +1 -1
  33. package/dist/sdk/core/fetcher/EndpointMetadata.d.ts +13 -0
  34. package/dist/sdk/core/fetcher/EndpointMetadata.js +2 -0
  35. package/dist/sdk/core/fetcher/EndpointSupplier.d.ts +12 -0
  36. package/dist/sdk/core/fetcher/EndpointSupplier.js +13 -0
  37. package/dist/sdk/core/fetcher/Fetcher.d.ts +6 -4
  38. package/dist/sdk/core/fetcher/Fetcher.js +3 -3
  39. package/dist/sdk/core/fetcher/HttpResponsePromise.d.ts +1 -1
  40. package/dist/sdk/core/fetcher/index.d.ts +7 -5
  41. package/dist/sdk/core/fetcher/index.js +7 -5
  42. package/dist/sdk/core/fetcher/requestWithRetries.js +44 -8
  43. package/dist/sdk/core/headers.d.ts +2 -3
  44. package/dist/sdk/core/url/join.js +23 -3
  45. package/dist/sdk/environments.d.ts +0 -3
  46. package/dist/sdk/environments.js +1 -3
  47. package/dist/sdk/errors/PlanqkServiceApiError.d.ts +0 -3
  48. package/dist/sdk/errors/PlanqkServiceApiError.js +1 -3
  49. package/dist/sdk/errors/PlanqkServiceApiTimeoutError.d.ts +0 -3
  50. package/dist/sdk/errors/PlanqkServiceApiTimeoutError.js +1 -3
  51. package/dist/sdk/index.d.ts +1 -0
  52. package/fern/fern.config.json +1 -1
  53. package/fern/openapi/openapi.yml +46 -6
  54. package/package.json +1 -1
  55. package/planqk/service/_version.py +1 -1
  56. package/planqk/service/sdk/__init__.py +6 -0
  57. package/planqk/service/sdk/types/__init__.py +6 -0
  58. package/planqk/service/sdk/types/log_entry.py +15 -3
  59. package/planqk/service/sdk/types/log_entry_severity.py +5 -0
  60. package/planqk/service/sdk/types/service_execution.py +57 -5
  61. package/planqk/service/sdk/types/service_execution_type.py +5 -0
  62. package/pyproject.toml +1 -1
  63. package/requirements-dev.txt +117 -83
  64. package/requirements.txt +58 -58
  65. package/src/index.test.ts +10 -0
  66. package/src/sdk/BaseClient.ts +30 -0
  67. package/src/sdk/Client.ts +5 -22
  68. package/src/sdk/api/index.ts +1 -1
  69. package/src/sdk/api/resources/index.ts +0 -1
  70. package/src/sdk/api/resources/serviceApi/client/Client.ts +73 -76
  71. package/src/sdk/api/resources/serviceApi/index.ts +0 -1
  72. package/src/sdk/api/types/HalLink.ts +1 -3
  73. package/src/sdk/api/types/LogEntry.ts +17 -4
  74. package/src/sdk/api/types/RequestBody.ts +3 -0
  75. package/src/sdk/api/types/ResultResponse.ts +20 -0
  76. package/src/sdk/api/types/ServiceExecution.ts +23 -5
  77. package/src/sdk/api/types/index.ts +2 -0
  78. package/src/sdk/core/auth/AuthProvider.ts +5 -0
  79. package/src/sdk/core/auth/AuthRequest.ts +9 -0
  80. package/src/sdk/core/auth/BasicAuth.ts +2 -1
  81. package/src/sdk/core/auth/index.ts +2 -0
  82. package/src/sdk/core/fetcher/APIResponse.ts +1 -1
  83. package/src/sdk/core/fetcher/BinaryResponse.ts +1 -1
  84. package/src/sdk/core/fetcher/EndpointMetadata.ts +13 -0
  85. package/src/sdk/core/fetcher/EndpointSupplier.ts +14 -0
  86. package/src/sdk/core/fetcher/Fetcher.ts +8 -6
  87. package/src/sdk/core/fetcher/HttpResponsePromise.ts +1 -1
  88. package/src/sdk/core/fetcher/index.ts +7 -5
  89. package/src/sdk/core/fetcher/requestWithRetries.ts +49 -9
  90. package/src/sdk/core/headers.ts +8 -10
  91. package/src/sdk/core/url/join.ts +28 -3
  92. package/src/sdk/environments.ts +1 -3
  93. package/src/sdk/errors/PlanqkServiceApiError.ts +1 -3
  94. package/src/sdk/errors/PlanqkServiceApiTimeoutError.ts +1 -3
  95. package/src/sdk/index.ts +1 -0
  96. package/uv.lock +260 -109
  97. package/dist/sdk/api/resources/serviceApi/types/GetResultResponse.d.ts +0 -18
  98. package/dist/sdk/api/resources/serviceApi/types/index.d.ts +0 -1
  99. package/dist/sdk/api/resources/serviceApi/types/index.js +0 -17
  100. package/src/sdk/api/resources/serviceApi/types/GetResultResponse.ts +0 -22
  101. package/src/sdk/api/resources/serviceApi/types/index.ts +0 -1
@@ -0,0 +1,26 @@
1
+ import * as environments from "./environments.js";
2
+ import * as core from "./core/index.js";
3
+ export interface BaseClientOptions {
4
+ environment?: core.Supplier<environments.PlanqkServiceApiEnvironment | string>;
5
+ /** Specify a custom URL to connect the client to. */
6
+ baseUrl?: core.Supplier<string>;
7
+ token?: core.Supplier<core.BearerToken | undefined>;
8
+ /** Additional headers to include in requests. */
9
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
10
+ /** The default maximum time to wait for a response in seconds. */
11
+ timeoutInSeconds?: number;
12
+ /** The default number of times to retry the request. Defaults to 2. */
13
+ maxRetries?: number;
14
+ }
15
+ export interface BaseRequestOptions {
16
+ /** The maximum time to wait for a response in seconds. */
17
+ timeoutInSeconds?: number;
18
+ /** The number of times to retry the request. Defaults to 2. */
19
+ maxRetries?: number;
20
+ /** A hook to abort the request. */
21
+ abortSignal?: AbortSignal;
22
+ /** Additional query string parameters to include in the request. */
23
+ queryParams?: Record<string, unknown>;
24
+ /** Additional headers to include in the request. */
25
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
26
+ }
@@ -1,5 +1,3 @@
1
1
  "use strict";
2
- /**
3
- * This file was auto-generated by Fern from our API Definition.
4
- */
2
+ // This file was auto-generated by Fern from our API Definition.
5
3
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,27 +1,9 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- import * as environments from "./environments.js";
5
- import * as core from "./core/index.js";
1
+ import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
6
2
  import { ServiceApi } from "./api/resources/serviceApi/client/Client.js";
7
3
  export declare namespace PlanqkServiceApiClient {
8
- interface Options {
9
- environment?: core.Supplier<environments.PlanqkServiceApiEnvironment | string>;
10
- /** Specify a custom URL to connect the client to. */
11
- baseUrl?: core.Supplier<string>;
12
- token?: core.Supplier<core.BearerToken | undefined>;
13
- /** Additional headers to include in requests. */
14
- headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
4
+ interface Options extends BaseClientOptions {
15
5
  }
16
- interface RequestOptions {
17
- /** The maximum time to wait for a response in seconds. */
18
- timeoutInSeconds?: number;
19
- /** The number of times to retry the request. Defaults to 2. */
20
- maxRetries?: number;
21
- /** A hook to abort the request. */
22
- abortSignal?: AbortSignal;
23
- /** Additional headers to include in the request. */
24
- headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
6
+ interface RequestOptions extends BaseRequestOptions {
25
7
  }
26
8
  }
27
9
  export declare class PlanqkServiceApiClient {
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
- /**
3
- * This file was auto-generated by Fern from our API Definition.
4
- */
2
+ // This file was auto-generated by Fern from our API Definition.
5
3
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
4
  if (k2 === undefined) k2 = k;
7
5
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -1,2 +1,2 @@
1
- export * from "./resources/index.js";
2
1
  export * from "./types/index.js";
2
+ export * from "./resources/index.js";
@@ -14,5 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./resources/index.js"), exports);
18
17
  __exportStar(require("./types/index.js"), exports);
18
+ __exportStar(require("./resources/index.js"), exports);
@@ -1,2 +1 @@
1
1
  export * as serviceApi from "./serviceApi/index.js";
2
- export * from "./serviceApi/types/index.js";
@@ -32,10 +32,6 @@ var __importStar = (this && this.__importStar) || (function () {
32
32
  return result;
33
33
  };
34
34
  })();
35
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
- };
38
35
  Object.defineProperty(exports, "__esModule", { value: true });
39
36
  exports.serviceApi = void 0;
40
37
  exports.serviceApi = __importStar(require("./serviceApi/index.js"));
41
- __exportStar(require("./serviceApi/types/index.js"), exports);
@@ -1,27 +1,10 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- import * as environments from "../../../../environments.js";
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
5
2
  import * as core from "../../../../core/index.js";
6
3
  import * as PlanqkServiceApi from "../../../index.js";
7
4
  export declare namespace ServiceApi {
8
- interface Options {
9
- environment?: core.Supplier<environments.PlanqkServiceApiEnvironment | string>;
10
- /** Specify a custom URL to connect the client to. */
11
- baseUrl?: core.Supplier<string>;
12
- token?: core.Supplier<core.BearerToken | undefined>;
13
- /** Additional headers to include in requests. */
14
- headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
5
+ interface Options extends BaseClientOptions {
15
6
  }
16
- interface RequestOptions {
17
- /** The maximum time to wait for a response in seconds. */
18
- timeoutInSeconds?: number;
19
- /** The number of times to retry the request. Defaults to 2. */
20
- maxRetries?: number;
21
- /** A hook to abort the request. */
22
- abortSignal?: AbortSignal;
23
- /** Additional headers to include in the request. */
24
- headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
7
+ interface RequestOptions extends BaseRequestOptions {
25
8
  }
26
9
  }
27
10
  export declare class ServiceApi {
@@ -42,7 +25,7 @@ export declare class ServiceApi {
42
25
  * Starts a service execution, which in turn is processed asynchronously.
43
26
  * The location header of the response contains the URL which can be used to query the status and the result of the service execution.
44
27
  *
45
- * @param {Record<string, any>} request
28
+ * @param {PlanqkServiceApi.RequestBody} request
46
29
  * @param {ServiceApi.RequestOptions} requestOptions - Request-specific configuration.
47
30
  *
48
31
  * @example
@@ -50,7 +33,7 @@ export declare class ServiceApi {
50
33
  * "key": "value"
51
34
  * })
52
35
  */
53
- startExecution(request: Record<string, any>, requestOptions?: ServiceApi.RequestOptions): core.HttpResponsePromise<PlanqkServiceApi.ServiceExecution>;
36
+ startExecution(request: PlanqkServiceApi.RequestBody, requestOptions?: ServiceApi.RequestOptions): core.HttpResponsePromise<PlanqkServiceApi.ServiceExecution>;
54
37
  private __startExecution;
55
38
  /**
56
39
  * Retrieves the status of a service execution.
@@ -75,7 +58,7 @@ export declare class ServiceApi {
75
58
  * @example
76
59
  * await client.serviceApi.getResult("id")
77
60
  */
78
- getResult(id: string, requestOptions?: ServiceApi.RequestOptions): core.HttpResponsePromise<PlanqkServiceApi.GetResultResponse>;
61
+ getResult(id: string, requestOptions?: ServiceApi.RequestOptions): core.HttpResponsePromise<PlanqkServiceApi.ResultResponse>;
79
62
  private __getResult;
80
63
  /**
81
64
  * Retrieves a specific result file of a service execution.
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
- /**
3
- * This file was auto-generated by Fern from our API Definition.
4
- */
2
+ // This file was auto-generated by Fern from our API Definition.
5
3
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
4
  if (k2 === undefined) k2 = k;
7
5
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -59,14 +57,16 @@ class ServiceApi {
59
57
  return core.HttpResponsePromise.fromPromise(this.__getServiceExecutions(requestOptions));
60
58
  }
61
59
  async __getServiceExecutions(requestOptions) {
60
+ let _headers = (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: await this._getAuthorizationHeader() }), requestOptions?.headers);
62
61
  const _response = await core.fetcher({
63
62
  url: (await core.Supplier.get(this._options.baseUrl)) ??
64
63
  (await core.Supplier.get(this._options.environment)) ??
65
64
  environments.PlanqkServiceApiEnvironment.Default,
66
65
  method: "GET",
67
- headers: (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: await this._getAuthorizationHeader() }), requestOptions?.headers),
68
- timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
69
- maxRetries: requestOptions?.maxRetries,
66
+ headers: _headers,
67
+ queryParameters: requestOptions?.queryParams,
68
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
69
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
70
70
  withCredentials: true,
71
71
  abortSignal: requestOptions?.abortSignal,
72
72
  });
@@ -100,7 +100,7 @@ class ServiceApi {
100
100
  * Starts a service execution, which in turn is processed asynchronously.
101
101
  * The location header of the response contains the URL which can be used to query the status and the result of the service execution.
102
102
  *
103
- * @param {Record<string, any>} request
103
+ * @param {PlanqkServiceApi.RequestBody} request
104
104
  * @param {ServiceApi.RequestOptions} requestOptions - Request-specific configuration.
105
105
  *
106
106
  * @example
@@ -112,17 +112,19 @@ class ServiceApi {
112
112
  return core.HttpResponsePromise.fromPromise(this.__startExecution(request, requestOptions));
113
113
  }
114
114
  async __startExecution(request, requestOptions) {
115
+ let _headers = (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: await this._getAuthorizationHeader() }), requestOptions?.headers);
115
116
  const _response = await core.fetcher({
116
117
  url: (await core.Supplier.get(this._options.baseUrl)) ??
117
118
  (await core.Supplier.get(this._options.environment)) ??
118
119
  environments.PlanqkServiceApiEnvironment.Default,
119
120
  method: "POST",
120
- headers: (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: await this._getAuthorizationHeader() }), requestOptions?.headers),
121
+ headers: _headers,
121
122
  contentType: "application/json",
123
+ queryParameters: requestOptions?.queryParams,
122
124
  requestType: "json",
123
125
  body: request,
124
- timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
125
- maxRetries: requestOptions?.maxRetries,
126
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
127
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
126
128
  withCredentials: true,
127
129
  abortSignal: requestOptions?.abortSignal,
128
130
  });
@@ -166,14 +168,16 @@ class ServiceApi {
166
168
  return core.HttpResponsePromise.fromPromise(this.__getStatus(id, requestOptions));
167
169
  }
168
170
  async __getStatus(id, requestOptions) {
171
+ let _headers = (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: await this._getAuthorizationHeader() }), requestOptions?.headers);
169
172
  const _response = await core.fetcher({
170
173
  url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
171
174
  (await core.Supplier.get(this._options.environment)) ??
172
175
  environments.PlanqkServiceApiEnvironment.Default, `${encodeURIComponent(id)}`),
173
176
  method: "GET",
174
- headers: (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: await this._getAuthorizationHeader() }), requestOptions?.headers),
175
- timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
176
- maxRetries: requestOptions?.maxRetries,
177
+ headers: _headers,
178
+ queryParameters: requestOptions?.queryParams,
179
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
180
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
177
181
  withCredentials: true,
178
182
  abortSignal: requestOptions?.abortSignal,
179
183
  });
@@ -218,14 +222,16 @@ class ServiceApi {
218
222
  return core.HttpResponsePromise.fromPromise(this.__getResult(id, requestOptions));
219
223
  }
220
224
  async __getResult(id, requestOptions) {
225
+ let _headers = (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: await this._getAuthorizationHeader() }), requestOptions?.headers);
221
226
  const _response = await core.fetcher({
222
227
  url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
223
228
  (await core.Supplier.get(this._options.environment)) ??
224
229
  environments.PlanqkServiceApiEnvironment.Default, `${encodeURIComponent(id)}/result`),
225
230
  method: "GET",
226
- headers: (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: await this._getAuthorizationHeader() }), requestOptions?.headers),
227
- timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
228
- maxRetries: requestOptions?.maxRetries,
231
+ headers: _headers,
232
+ queryParameters: requestOptions?.queryParams,
233
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
234
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
229
235
  withCredentials: true,
230
236
  abortSignal: requestOptions?.abortSignal,
231
237
  });
@@ -264,15 +270,17 @@ class ServiceApi {
264
270
  return core.HttpResponsePromise.fromPromise(this.__getResultFile(id, file, requestOptions));
265
271
  }
266
272
  async __getResultFile(id, file, requestOptions) {
273
+ let _headers = (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: await this._getAuthorizationHeader() }), requestOptions?.headers);
267
274
  const _response = await core.fetcher({
268
275
  url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
269
276
  (await core.Supplier.get(this._options.environment)) ??
270
277
  environments.PlanqkServiceApiEnvironment.Default, `${encodeURIComponent(id)}/result/${encodeURIComponent(file)}`),
271
278
  method: "GET",
272
- headers: (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: await this._getAuthorizationHeader() }), requestOptions?.headers),
279
+ headers: _headers,
280
+ queryParameters: requestOptions?.queryParams,
273
281
  responseType: "binary-response",
274
- timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
275
- maxRetries: requestOptions?.maxRetries,
282
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
283
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
276
284
  withCredentials: true,
277
285
  abortSignal: requestOptions?.abortSignal,
278
286
  });
@@ -315,14 +323,16 @@ class ServiceApi {
315
323
  return core.HttpResponsePromise.fromPromise(this.__getLogs(id, requestOptions));
316
324
  }
317
325
  async __getLogs(id, requestOptions) {
326
+ let _headers = (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: await this._getAuthorizationHeader() }), requestOptions?.headers);
318
327
  const _response = await core.fetcher({
319
328
  url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
320
329
  (await core.Supplier.get(this._options.environment)) ??
321
330
  environments.PlanqkServiceApiEnvironment.Default, `${encodeURIComponent(id)}/log`),
322
331
  method: "GET",
323
- headers: (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: await this._getAuthorizationHeader() }), requestOptions?.headers),
324
- timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
325
- maxRetries: requestOptions?.maxRetries,
332
+ headers: _headers,
333
+ queryParameters: requestOptions?.queryParams,
334
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
335
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
326
336
  withCredentials: true,
327
337
  abortSignal: requestOptions?.abortSignal,
328
338
  });
@@ -365,14 +375,16 @@ class ServiceApi {
365
375
  return core.HttpResponsePromise.fromPromise(this.__cancelExecution(id, requestOptions));
366
376
  }
367
377
  async __cancelExecution(id, requestOptions) {
378
+ let _headers = (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: await this._getAuthorizationHeader() }), requestOptions?.headers);
368
379
  const _response = await core.fetcher({
369
380
  url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
370
381
  (await core.Supplier.get(this._options.environment)) ??
371
382
  environments.PlanqkServiceApiEnvironment.Default, `${encodeURIComponent(id)}/cancel`),
372
383
  method: "PUT",
373
- headers: (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: await this._getAuthorizationHeader() }), requestOptions?.headers),
374
- timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
375
- maxRetries: requestOptions?.maxRetries,
384
+ headers: _headers,
385
+ queryParameters: requestOptions?.queryParams,
386
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
387
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
376
388
  withCredentials: true,
377
389
  abortSignal: requestOptions?.abortSignal,
378
390
  });
@@ -1,2 +1 @@
1
- export * from "./types/index.js";
2
1
  export * from "./client/index.js";
@@ -14,5 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./types/index.js"), exports);
18
17
  __exportStar(require("./client/index.js"), exports);
@@ -1,6 +1,3 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
1
  export interface HalLink {
5
2
  /** The URL of the link */
6
3
  href?: string;
@@ -1,5 +1,3 @@
1
1
  "use strict";
2
- /**
3
- * This file was auto-generated by Fern from our API Definition.
4
- */
2
+ // This file was auto-generated by Fern from our API Definition.
5
3
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,8 +1,19 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
1
  export interface LogEntry {
2
+ /** Log message content. */
5
3
  message?: string;
6
- severity?: string;
4
+ /** Severity of the log entry. */
5
+ severity?: LogEntry.Severity;
6
+ /** Timestamp when the entry was logged. */
7
7
  timestamp?: string;
8
8
  }
9
+ export declare namespace LogEntry {
10
+ /** Severity of the log entry. */
11
+ const Severity: {
12
+ readonly Debug: "DEBUG";
13
+ readonly Notice: "NOTICE";
14
+ readonly Info: "INFO";
15
+ readonly Warning: "WARNING";
16
+ readonly Error: "ERROR";
17
+ };
18
+ type Severity = (typeof Severity)[keyof typeof Severity];
19
+ }
@@ -1,5 +1,15 @@
1
1
  "use strict";
2
- /**
3
- * This file was auto-generated by Fern from our API Definition.
4
- */
2
+ // This file was auto-generated by Fern from our API Definition.
5
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.LogEntry = void 0;
5
+ var LogEntry;
6
+ (function (LogEntry) {
7
+ /** Severity of the log entry. */
8
+ LogEntry.Severity = {
9
+ Debug: "DEBUG",
10
+ Notice: "NOTICE",
11
+ Info: "INFO",
12
+ Warning: "WARNING",
13
+ Error: "ERROR",
14
+ };
15
+ })(LogEntry || (exports.LogEntry = LogEntry = {}));
@@ -0,0 +1 @@
1
+ export type RequestBody = Record<string, any>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,15 @@
1
+ import * as PlanqkServiceApi from "../index.js";
2
+ export interface ResultResponse {
3
+ _links?: ResultResponse.Links;
4
+ _embedded?: ResultResponse.Embedded;
5
+ /** Accepts any additional properties */
6
+ [key: string]: any;
7
+ }
8
+ export declare namespace ResultResponse {
9
+ interface Links {
10
+ status?: PlanqkServiceApi.HalLink;
11
+ }
12
+ interface Embedded {
13
+ status?: PlanqkServiceApi.ServiceExecution;
14
+ }
15
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,15 +1,25 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
1
  export interface ServiceExecution {
2
+ /** Unique identifier of the service execution. */
5
3
  id?: string;
6
- status?: ServiceExecution.Status;
4
+ /** Timestamp when the service execution was created. */
7
5
  createdAt?: string;
6
+ /** Timestamp when the service execution started. */
8
7
  startedAt?: string;
8
+ /** Timestamp when the service execution ended. */
9
9
  endedAt?: string;
10
+ /** Status of the service execution. */
11
+ status?: ServiceExecution.Status;
12
+ /** Type identifier indicating whether the underlying service is a 'managed' or 'workflow' service. */
13
+ type?: ServiceExecution.Type;
14
+ /** The ID of the service for which this service execution was created. */
15
+ serviceId?: string;
16
+ /** The ID of the service definition for which this service execution was created. */
17
+ serviceDefinitionId?: string;
18
+ /** The ID of the application for which this service execution was created. */
19
+ applicationId?: string;
10
20
  }
11
21
  export declare namespace ServiceExecution {
12
- type Status = "UNKNOWN" | "PENDING" | "RUNNING" | "SUCCEEDED" | "CANCELLED" | "FAILED";
22
+ /** Status of the service execution. */
13
23
  const Status: {
14
24
  readonly Unknown: "UNKNOWN";
15
25
  readonly Pending: "PENDING";
@@ -18,4 +28,11 @@ export declare namespace ServiceExecution {
18
28
  readonly Cancelled: "CANCELLED";
19
29
  readonly Failed: "FAILED";
20
30
  };
31
+ type Status = (typeof Status)[keyof typeof Status];
32
+ /** Type identifier indicating whether the underlying service is a 'managed' or 'workflow' service. */
33
+ const Type: {
34
+ readonly Managed: "MANAGED";
35
+ readonly Workflow: "WORKFLOW";
36
+ };
37
+ type Type = (typeof Type)[keyof typeof Type];
21
38
  }
@@ -1,11 +1,10 @@
1
1
  "use strict";
2
- /**
3
- * This file was auto-generated by Fern from our API Definition.
4
- */
2
+ // This file was auto-generated by Fern from our API Definition.
5
3
  Object.defineProperty(exports, "__esModule", { value: true });
6
4
  exports.ServiceExecution = void 0;
7
5
  var ServiceExecution;
8
6
  (function (ServiceExecution) {
7
+ /** Status of the service execution. */
9
8
  ServiceExecution.Status = {
10
9
  Unknown: "UNKNOWN",
11
10
  Pending: "PENDING",
@@ -14,4 +13,9 @@ var ServiceExecution;
14
13
  Cancelled: "CANCELLED",
15
14
  Failed: "FAILED",
16
15
  };
16
+ /** Type identifier indicating whether the underlying service is a 'managed' or 'workflow' service. */
17
+ ServiceExecution.Type = {
18
+ Managed: "MANAGED",
19
+ Workflow: "WORKFLOW",
20
+ };
17
21
  })(ServiceExecution || (exports.ServiceExecution = ServiceExecution = {}));
@@ -1,3 +1,5 @@
1
+ export * from "./RequestBody.js";
2
+ export * from "./ResultResponse.js";
1
3
  export * from "./ServiceExecution.js";
2
4
  export * from "./LogEntry.js";
3
5
  export * from "./HalLink.js";
@@ -14,6 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./RequestBody.js"), exports);
18
+ __exportStar(require("./ResultResponse.js"), exports);
17
19
  __exportStar(require("./ServiceExecution.js"), exports);
18
20
  __exportStar(require("./LogEntry.js"), exports);
19
21
  __exportStar(require("./HalLink.js"), exports);
@@ -0,0 +1,4 @@
1
+ import type { AuthRequest } from "./AuthRequest.js";
2
+ export interface AuthProvider {
3
+ getAuthRequest(): Promise<AuthRequest>;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Request parameters for authentication requests.
3
+ */
4
+ export interface AuthRequest {
5
+ /**
6
+ * The headers to be included in the request.
7
+ */
8
+ headers: Record<string, string>;
9
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -14,7 +14,8 @@ exports.BasicAuth = {
14
14
  fromAuthorizationHeader: (header) => {
15
15
  const credentials = header.replace(BASIC_AUTH_HEADER_PREFIX, "");
16
16
  const decoded = (0, base64_js_1.base64Decode)(credentials);
17
- const [username, password] = decoded.split(":", 2);
17
+ const [username, ...passwordParts] = decoded.split(":");
18
+ const password = passwordParts.length > 0 ? passwordParts.join(":") : undefined;
18
19
  if (username == null || password == null) {
19
20
  throw new Error("Invalid basic auth");
20
21
  }
@@ -1,2 +1,4 @@
1
+ export type { AuthProvider } from "./AuthProvider.js";
2
+ export type { AuthRequest } from "./AuthRequest.js";
1
3
  export { BasicAuth } from "./BasicAuth.js";
2
4
  export { BearerToken } from "./BearerToken.js";
@@ -1,4 +1,4 @@
1
- import { RawResponse } from "./RawResponse.js";
1
+ import type { RawResponse } from "./RawResponse.js";
2
2
  /**
3
3
  * The response of an API call.
4
4
  * It is a successful response or a failed response.
@@ -1,4 +1,4 @@
1
- import { ResponseWithBody } from "./ResponseWithBody.js";
1
+ import type { ResponseWithBody } from "./ResponseWithBody.js";
2
2
  export type BinaryResponse = {
3
3
  /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */
4
4
  bodyUsed: boolean;
@@ -0,0 +1,13 @@
1
+ export type SecuritySchemeKey = string;
2
+ /**
3
+ * A collection of security schemes, where the key is the name of the security scheme and the value is the list of scopes required for that scheme.
4
+ * All schemes in the collection must be satisfied for authentication to be successful.
5
+ */
6
+ export type SecuritySchemeCollection = Record<SecuritySchemeKey, AuthScope[]>;
7
+ export type AuthScope = string;
8
+ export type EndpointMetadata = {
9
+ /**
10
+ * An array of security scheme collections. Each collection represents an alternative way to authenticate.
11
+ */
12
+ security?: SecuritySchemeCollection[];
13
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,12 @@
1
+ import type { EndpointMetadata } from "./EndpointMetadata.js";
2
+ import { Supplier } from "./Supplier.js";
3
+ type EndpointSupplierFn<T> = (arg: {
4
+ endpointMetadata: EndpointMetadata;
5
+ }) => T | Promise<T>;
6
+ export type EndpointSupplier<T> = Supplier<T> | EndpointSupplierFn<T>;
7
+ export declare const EndpointSupplier: {
8
+ get: <T>(supplier: EndpointSupplier<T>, arg: {
9
+ endpointMetadata: EndpointMetadata;
10
+ }) => Promise<T>;
11
+ };
12
+ export {};
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EndpointSupplier = void 0;
4
+ exports.EndpointSupplier = {
5
+ get: async (supplier, arg) => {
6
+ if (typeof supplier === "function") {
7
+ return supplier(arg);
8
+ }
9
+ else {
10
+ return supplier;
11
+ }
12
+ },
13
+ };