@planqk/planqk-service-sdk 2.1.2 → 2.2.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.
Files changed (174) hide show
  1. package/README-node.md +16 -12
  2. package/README.md +16 -12
  3. package/dist/sdk/Client.d.ts +10 -4
  4. package/dist/sdk/Client.js +46 -4
  5. package/dist/sdk/api/index.d.ts +2 -3
  6. package/dist/sdk/api/index.js +2 -3
  7. package/dist/sdk/api/resources/index.d.ts +2 -2
  8. package/dist/sdk/api/resources/index.js +2 -2
  9. package/dist/sdk/api/resources/serviceApi/client/Client.d.ts +41 -55
  10. package/dist/sdk/api/resources/serviceApi/client/Client.js +131 -227
  11. package/dist/sdk/api/resources/serviceApi/index.d.ts +2 -2
  12. package/dist/sdk/api/resources/serviceApi/index.js +2 -2
  13. package/dist/sdk/api/resources/serviceApi/types/GetResultResponse.d.ts +13 -3
  14. package/dist/sdk/api/resources/serviceApi/types/index.d.ts +1 -4
  15. package/dist/sdk/api/resources/serviceApi/types/index.js +1 -4
  16. package/dist/sdk/api/types/ServiceExecution.d.ts +12 -2
  17. package/dist/sdk/api/types/ServiceExecution.js +12 -0
  18. package/dist/sdk/api/types/index.d.ts +2 -6
  19. package/dist/sdk/api/types/index.js +2 -6
  20. package/dist/sdk/core/auth/BasicAuth.js +3 -3
  21. package/dist/sdk/core/auth/index.d.ts +2 -2
  22. package/dist/sdk/core/auth/index.js +4 -4
  23. package/dist/sdk/core/base64.d.ts +2 -0
  24. package/dist/sdk/core/base64.js +26 -0
  25. package/dist/sdk/core/fetcher/APIResponse.d.ts +10 -0
  26. package/dist/sdk/core/fetcher/BinaryResponse.d.ts +20 -0
  27. package/dist/sdk/core/fetcher/BinaryResponse.js +17 -0
  28. package/dist/sdk/core/fetcher/Fetcher.d.ts +5 -4
  29. package/dist/sdk/core/fetcher/Fetcher.js +41 -22
  30. package/dist/sdk/core/fetcher/Headers.d.ts +2 -0
  31. package/dist/sdk/core/fetcher/Headers.js +85 -0
  32. package/dist/sdk/core/fetcher/HttpResponsePromise.d.ts +58 -0
  33. package/dist/sdk/core/fetcher/HttpResponsePromise.js +94 -0
  34. package/dist/sdk/core/fetcher/RawResponse.d.ts +29 -0
  35. package/dist/sdk/core/fetcher/RawResponse.js +44 -0
  36. package/dist/sdk/core/fetcher/ResponseWithBody.d.ts +4 -0
  37. package/dist/sdk/core/fetcher/ResponseWithBody.js +6 -0
  38. package/dist/sdk/core/fetcher/createRequestUrl.d.ts +1 -1
  39. package/dist/sdk/core/fetcher/createRequestUrl.js +3 -7
  40. package/dist/sdk/core/fetcher/getErrorResponseBody.d.ts +1 -0
  41. package/dist/sdk/core/fetcher/getErrorResponseBody.js +32 -0
  42. package/dist/sdk/core/fetcher/getFetchFn.d.ts +1 -4
  43. package/dist/sdk/core/fetcher/getFetchFn.js +1 -52
  44. package/dist/sdk/core/fetcher/getRequestBody.js +2 -1
  45. package/dist/sdk/core/fetcher/getResponseBody.js +34 -30
  46. package/dist/sdk/core/fetcher/index.d.ts +9 -5
  47. package/dist/sdk/core/fetcher/index.js +13 -7
  48. package/dist/sdk/core/fetcher/makeRequest.js +3 -3
  49. package/dist/sdk/core/fetcher/requestWithRetries.js +14 -5
  50. package/dist/sdk/core/headers.d.ts +3 -0
  51. package/dist/sdk/core/headers.js +29 -0
  52. package/dist/sdk/core/index.d.ts +5 -3
  53. package/dist/sdk/core/index.js +28 -3
  54. package/dist/sdk/core/json.d.ts +15 -0
  55. package/dist/sdk/core/json.js +24 -0
  56. package/dist/sdk/core/runtime/index.d.ts +1 -1
  57. package/dist/sdk/core/runtime/index.js +2 -2
  58. package/dist/sdk/core/runtime/runtime.d.ts +1 -1
  59. package/dist/sdk/core/runtime/runtime.js +49 -40
  60. package/dist/sdk/core/url/index.d.ts +2 -0
  61. package/dist/sdk/core/url/index.js +7 -0
  62. package/dist/sdk/core/url/join.d.ts +1 -0
  63. package/dist/sdk/core/url/join.js +49 -0
  64. package/dist/sdk/core/url/qs.d.ts +6 -0
  65. package/dist/sdk/core/url/qs.js +67 -0
  66. package/dist/sdk/environments.d.ts +1 -1
  67. package/dist/sdk/environments.js +1 -1
  68. package/dist/sdk/errors/PlanqkServiceApiError.d.ts +4 -1
  69. package/dist/sdk/errors/PlanqkServiceApiError.js +7 -8
  70. package/dist/sdk/errors/PlanqkServiceApiTimeoutError.d.ts +1 -1
  71. package/dist/sdk/errors/PlanqkServiceApiTimeoutError.js +2 -2
  72. package/dist/sdk/errors/index.d.ts +2 -2
  73. package/dist/sdk/errors/index.js +4 -4
  74. package/dist/sdk/index.d.ts +4 -4
  75. package/dist/sdk/index.js +9 -9
  76. package/fern/fern.config.json +1 -1
  77. package/fern/generators.yml +2 -2
  78. package/fern/openapi/openapi.yml +41 -131
  79. package/package.json +1 -1
  80. package/planqk/service/_version.py +1 -1
  81. package/pyproject.toml +1 -1
  82. package/src/index.test.ts +29 -16
  83. package/src/sdk/Client.ts +27 -7
  84. package/src/sdk/api/index.ts +2 -3
  85. package/src/sdk/api/resources/index.ts +2 -2
  86. package/src/sdk/api/resources/serviceApi/client/Client.ts +223 -250
  87. package/src/sdk/api/resources/serviceApi/index.ts +2 -2
  88. package/src/sdk/api/resources/serviceApi/types/GetResultResponse.ts +15 -3
  89. package/src/sdk/api/resources/serviceApi/types/index.ts +1 -4
  90. package/src/sdk/api/types/ServiceExecution.ts +13 -3
  91. package/src/sdk/api/types/index.ts +2 -6
  92. package/src/sdk/core/auth/BasicAuth.ts +3 -3
  93. package/src/sdk/core/auth/index.ts +2 -2
  94. package/src/sdk/core/base64.ts +27 -0
  95. package/src/sdk/core/fetcher/APIResponse.ts +11 -0
  96. package/src/sdk/core/fetcher/BinaryResponse.ts +36 -0
  97. package/src/sdk/core/fetcher/Fetcher.ts +46 -26
  98. package/src/sdk/core/fetcher/Headers.ts +93 -0
  99. package/src/sdk/core/fetcher/HttpResponsePromise.ts +116 -0
  100. package/src/sdk/core/fetcher/RawResponse.ts +61 -0
  101. package/src/sdk/core/fetcher/ResponseWithBody.ts +7 -0
  102. package/src/sdk/core/fetcher/createRequestUrl.ts +4 -8
  103. package/src/sdk/core/fetcher/getErrorResponseBody.ts +32 -0
  104. package/src/sdk/core/fetcher/getFetchFn.ts +2 -24
  105. package/src/sdk/core/fetcher/getRequestBody.ts +3 -1
  106. package/src/sdk/core/fetcher/getResponseBody.ts +38 -27
  107. package/src/sdk/core/fetcher/index.ts +9 -5
  108. package/src/sdk/core/fetcher/makeRequest.ts +2 -2
  109. package/src/sdk/core/fetcher/requestWithRetries.ts +18 -6
  110. package/src/sdk/core/fetcher/signals.ts +1 -1
  111. package/src/sdk/core/headers.ts +35 -0
  112. package/src/sdk/core/index.ts +5 -3
  113. package/src/sdk/core/json.ts +27 -0
  114. package/src/sdk/core/runtime/index.ts +1 -1
  115. package/src/sdk/core/runtime/runtime.ts +60 -53
  116. package/src/sdk/core/url/index.ts +2 -0
  117. package/src/sdk/core/url/join.ts +55 -0
  118. package/src/sdk/core/url/qs.ts +74 -0
  119. package/src/sdk/environments.ts +1 -1
  120. package/src/sdk/errors/PlanqkServiceApiError.ts +21 -11
  121. package/src/sdk/errors/PlanqkServiceApiTimeoutError.ts +2 -2
  122. package/src/sdk/errors/index.ts +2 -2
  123. package/src/sdk/index.ts +4 -4
  124. package/dist/sdk/api/errors/BadRequestError.d.ts +0 -7
  125. package/dist/sdk/api/errors/BadRequestError.js +0 -51
  126. package/dist/sdk/api/errors/ForbiddenError.d.ts +0 -7
  127. package/dist/sdk/api/errors/ForbiddenError.js +0 -51
  128. package/dist/sdk/api/errors/InternalServerError.d.ts +0 -7
  129. package/dist/sdk/api/errors/InternalServerError.js +0 -51
  130. package/dist/sdk/api/errors/NotFoundError.d.ts +0 -7
  131. package/dist/sdk/api/errors/NotFoundError.js +0 -51
  132. package/dist/sdk/api/errors/UnauthorizedError.d.ts +0 -7
  133. package/dist/sdk/api/errors/UnauthorizedError.js +0 -51
  134. package/dist/sdk/api/errors/index.d.ts +0 -5
  135. package/dist/sdk/api/errors/index.js +0 -21
  136. package/dist/sdk/api/resources/serviceApi/types/GetResultResponseEmbedded.d.ts +0 -7
  137. package/dist/sdk/api/resources/serviceApi/types/GetResultResponseEmbedded.js +0 -5
  138. package/dist/sdk/api/resources/serviceApi/types/GetResultResponseLinks.d.ts +0 -7
  139. package/dist/sdk/api/resources/serviceApi/types/GetResultResponseLinks.js +0 -5
  140. package/dist/sdk/api/resources/serviceApi/types/HealthCheckResponse.d.ts +0 -7
  141. package/dist/sdk/api/resources/serviceApi/types/HealthCheckResponse.js +0 -5
  142. package/dist/sdk/api/types/InputData.d.ts +0 -4
  143. package/dist/sdk/api/types/InputData.js +0 -5
  144. package/dist/sdk/api/types/InputDataRef.d.ts +0 -8
  145. package/dist/sdk/api/types/InputDataRef.js +0 -5
  146. package/dist/sdk/api/types/InputParams.d.ts +0 -4
  147. package/dist/sdk/api/types/InputParams.js +0 -5
  148. package/dist/sdk/api/types/ServiceExecutionStatus.d.ts +0 -12
  149. package/dist/sdk/api/types/ServiceExecutionStatus.js +0 -14
  150. package/dist/sdk/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +0 -30
  151. package/dist/sdk/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +0 -232
  152. package/dist/sdk/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +0 -21
  153. package/dist/sdk/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +0 -91
  154. package/dist/sdk/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +0 -31
  155. package/dist/sdk/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +0 -214
  156. package/dist/sdk/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +0 -18
  157. package/dist/sdk/core/fetcher/stream-wrappers/chooseStreamWrapper.js +0 -48
  158. package/src/sdk/api/errors/BadRequestError.ts +0 -16
  159. package/src/sdk/api/errors/ForbiddenError.ts +0 -16
  160. package/src/sdk/api/errors/InternalServerError.ts +0 -16
  161. package/src/sdk/api/errors/NotFoundError.ts +0 -16
  162. package/src/sdk/api/errors/UnauthorizedError.ts +0 -16
  163. package/src/sdk/api/errors/index.ts +0 -5
  164. package/src/sdk/api/resources/serviceApi/types/GetResultResponseEmbedded.ts +0 -9
  165. package/src/sdk/api/resources/serviceApi/types/GetResultResponseLinks.ts +0 -9
  166. package/src/sdk/api/resources/serviceApi/types/HealthCheckResponse.ts +0 -8
  167. package/src/sdk/api/types/InputData.ts +0 -5
  168. package/src/sdk/api/types/InputDataRef.ts +0 -9
  169. package/src/sdk/api/types/InputParams.ts +0 -5
  170. package/src/sdk/api/types/ServiceExecutionStatus.ts +0 -14
  171. package/src/sdk/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +0 -252
  172. package/src/sdk/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts +0 -106
  173. package/src/sdk/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +0 -239
  174. package/src/sdk/core/fetcher/stream-wrappers/chooseStreamWrapper.ts +0 -33
package/README-node.md CHANGED
@@ -17,25 +17,29 @@ const consumerSecret = "..."
17
17
 
18
18
  const client = new PlanqkServiceClient(serviceEndpoint, consumerKey, consumerSecret)
19
19
 
20
- // prepare your input data and parameters
21
- const data = {input: {a: 1, b: 2}};
22
- const params = {param1: "value1", param2: "value2"};
20
+ // List all service executions
21
+ const serviceExecutions = await client.api().getServiceExecutions()
23
22
 
24
- // execute the service
25
- let serviceExecution = await client.api().execute({data, params})
23
+ // Start a new service execution
24
+ const data = {n_coin_tosses: 2}
25
+ const params = {shots: 100}
26
+ let serviceExecution = await client.api().startExecution({data, params}, {timeoutInSeconds: 60})
26
27
 
27
- // retrieve the status of a service execution
28
- serviceExecution = await client.api().getStatus(serviceExecution.id!);
28
+ // Check the status of the service execution
29
+ serviceExecution = await client.api().getStatus(serviceExecution.id!)
29
30
 
30
- // wait for the service execution to finish
31
- const finalStates = ["SUCCEEDED", "CANCELLED", "FAILED"];
31
+ // Wait for the service execution to finish
32
+ const finalStates = ["SUCCEEDED", "CANCELLED", "FAILED"]
32
33
  while (!finalStates.includes(serviceExecution.status!)) {
33
- serviceExecution = await client.api().getStatus(serviceExecution.id!);
34
+ serviceExecution = await client.api().getStatus(serviceExecution.id!)
34
35
  }
35
36
 
36
- // retrieve the result
37
+ // Get the result of the service execution
37
38
  const result = await client.api().getResult(serviceExecution.id!)
38
39
 
39
- // retrieve the logs
40
+ // Get the logs of the service execution
40
41
  const logs = await client.api().getLogs(serviceExecution.id!)
42
+
43
+ // Cancel the service execution if it is still pending or running
44
+ await client.api().cancelExecution(serviceExecution.id!)
41
45
  ```
package/README.md CHANGED
@@ -17,25 +17,29 @@ const consumerSecret = "..."
17
17
 
18
18
  const client = new PlanqkServiceClient(serviceEndpoint, consumerKey, consumerSecret)
19
19
 
20
- // prepare your input data and parameters
21
- const data = {input: {a: 1, b: 2}};
22
- const params = {param1: "value1", param2: "value2"};
20
+ // List all service executions
21
+ const serviceExecutions = await client.api().getServiceExecutions()
23
22
 
24
- // execute the service
25
- let serviceExecution = await client.api().execute({data, params})
23
+ // Start a new service execution
24
+ const data = {n_coin_tosses: 2}
25
+ const params = {shots: 100}
26
+ let serviceExecution = await client.api().startExecution({data, params}, {timeoutInSeconds: 60})
26
27
 
27
- // retrieve the status of a service execution
28
- serviceExecution = await client.api().getStatus(serviceExecution.id!);
28
+ // Check the status of the service execution
29
+ serviceExecution = await client.api().getStatus(serviceExecution.id!)
29
30
 
30
- // wait for the service execution to finish
31
- const finalStates = ["SUCCEEDED", "CANCELLED", "FAILED"];
31
+ // Wait for the service execution to finish
32
+ const finalStates = ["SUCCEEDED", "CANCELLED", "FAILED"]
32
33
  while (!finalStates.includes(serviceExecution.status!)) {
33
- serviceExecution = await client.api().getStatus(serviceExecution.id!);
34
+ serviceExecution = await client.api().getStatus(serviceExecution.id!)
34
35
  }
35
36
 
36
- // retrieve the result
37
+ // Get the result of the service execution
37
38
  const result = await client.api().getResult(serviceExecution.id!)
38
39
 
39
- // retrieve the logs
40
+ // Get the logs of the service execution
40
41
  const logs = await client.api().getLogs(serviceExecution.id!)
42
+
43
+ // Cancel the service execution if it is still pending or running
44
+ await client.api().cancelExecution(serviceExecution.id!)
41
45
  ```
@@ -1,13 +1,17 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as environments from "./environments";
5
- import * as core from "./core";
6
- import { ServiceApi } from "./api/resources/serviceApi/client/Client";
4
+ import * as environments from "./environments.js";
5
+ import * as core from "./core/index.js";
6
+ import { ServiceApi } from "./api/resources/serviceApi/client/Client.js";
7
7
  export declare namespace PlanqkServiceApiClient {
8
8
  interface Options {
9
9
  environment?: core.Supplier<environments.PlanqkServiceApiEnvironment | string>;
10
+ /** Specify a custom URL to connect the client to. */
11
+ baseUrl?: core.Supplier<string>;
10
12
  token: core.Supplier<core.BearerToken>;
13
+ /** Additional headers to include in requests. */
14
+ headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
11
15
  }
12
16
  interface RequestOptions {
13
17
  /** The maximum time to wait for a response in seconds. */
@@ -16,11 +20,13 @@ export declare namespace PlanqkServiceApiClient {
16
20
  maxRetries?: number;
17
21
  /** A hook to abort the request. */
18
22
  abortSignal?: AbortSignal;
23
+ /** Additional headers to include in the request. */
24
+ headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
19
25
  }
20
26
  }
21
27
  export declare class PlanqkServiceApiClient {
22
28
  protected readonly _options: PlanqkServiceApiClient.Options;
23
- constructor(_options: PlanqkServiceApiClient.Options);
24
29
  protected _serviceApi: ServiceApi | undefined;
30
+ constructor(_options: PlanqkServiceApiClient.Options);
25
31
  get serviceApi(): ServiceApi;
26
32
  }
@@ -2,17 +2,59 @@
2
2
  /**
3
3
  * This file was auto-generated by Fern from our API Definition.
4
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
+ })();
5
38
  Object.defineProperty(exports, "__esModule", { value: true });
6
39
  exports.PlanqkServiceApiClient = void 0;
7
- const Client_1 = require("./api/resources/serviceApi/client/Client");
40
+ const core = __importStar(require("./core/index.js"));
41
+ const headers_js_1 = require("./core/headers.js");
42
+ const Client_js_1 = require("./api/resources/serviceApi/client/Client.js");
8
43
  class PlanqkServiceApiClient {
9
44
  _options;
45
+ _serviceApi;
10
46
  constructor(_options) {
11
- this._options = _options;
47
+ this._options = {
48
+ ..._options,
49
+ headers: (0, headers_js_1.mergeHeaders)({
50
+ "X-Fern-Language": "JavaScript",
51
+ "X-Fern-Runtime": core.RUNTIME.type,
52
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
53
+ }, _options?.headers),
54
+ };
12
55
  }
13
- _serviceApi;
14
56
  get serviceApi() {
15
- return (this._serviceApi ??= new Client_1.ServiceApi(this._options));
57
+ return (this._serviceApi ??= new Client_js_1.ServiceApi(this._options));
16
58
  }
17
59
  }
18
60
  exports.PlanqkServiceApiClient = PlanqkServiceApiClient;
@@ -1,3 +1,2 @@
1
- export * from "./resources";
2
- export * from "./types";
3
- export * from "./errors";
1
+ export * from "./resources/index.js";
2
+ export * from "./types/index.js";
@@ -14,6 +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"), exports);
18
- __exportStar(require("./types"), exports);
19
- __exportStar(require("./errors"), exports);
17
+ __exportStar(require("./resources/index.js"), exports);
18
+ __exportStar(require("./types/index.js"), exports);
@@ -1,2 +1,2 @@
1
- export * as serviceApi from "./serviceApi";
2
- export * from "./serviceApi/types";
1
+ export * as serviceApi from "./serviceApi/index.js";
2
+ export * from "./serviceApi/types/index.js";
@@ -37,5 +37,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.serviceApi = void 0;
40
- exports.serviceApi = __importStar(require("./serviceApi"));
41
- __exportStar(require("./serviceApi/types"), exports);
40
+ exports.serviceApi = __importStar(require("./serviceApi/index.js"));
41
+ __exportStar(require("./serviceApi/types/index.js"), exports);
@@ -1,14 +1,17 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as environments from "../../../../environments";
5
- import * as core from "../../../../core";
6
- import * as PlanqkServiceApi from "../../../index";
7
- import * as stream from "stream";
4
+ import * as environments from "../../../../environments.js";
5
+ import * as core from "../../../../core/index.js";
6
+ import * as PlanqkServiceApi from "../../../index.js";
8
7
  export declare namespace ServiceApi {
9
8
  interface Options {
10
9
  environment?: core.Supplier<environments.PlanqkServiceApiEnvironment | string>;
10
+ /** Specify a custom URL to connect the client to. */
11
+ baseUrl?: core.Supplier<string>;
11
12
  token: core.Supplier<core.BearerToken>;
13
+ /** Additional headers to include in requests. */
14
+ headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
12
15
  }
13
16
  interface RequestOptions {
14
17
  /** The maximum time to wait for a response in seconds. */
@@ -17,108 +20,91 @@ export declare namespace ServiceApi {
17
20
  maxRetries?: number;
18
21
  /** A hook to abort the request. */
19
22
  abortSignal?: AbortSignal;
23
+ /** Additional headers to include in the request. */
24
+ headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
20
25
  }
21
26
  }
22
27
  export declare class ServiceApi {
23
28
  protected readonly _options: ServiceApi.Options;
24
29
  constructor(_options: ServiceApi.Options);
25
30
  /**
26
- * This method checks the health of the service.
31
+ * Retrieves a list of all service executions.
32
+ * The response includes links to each service execution, allowing for further queries on their status and results.
27
33
  *
28
34
  * @param {ServiceApi.RequestOptions} requestOptions - Request-specific configuration.
29
35
  *
30
36
  * @example
31
- * await client.serviceApi.healthCheck()
37
+ * await client.serviceApi.getServiceExecutions()
32
38
  */
33
- healthCheck(requestOptions?: ServiceApi.RequestOptions): Promise<PlanqkServiceApi.HealthCheckResponse>;
39
+ getServiceExecutions(requestOptions?: ServiceApi.RequestOptions): core.HttpResponsePromise<PlanqkServiceApi.ServiceExecution[]>;
40
+ private __getServiceExecutions;
34
41
  /**
35
- * This method starts a service execution, which in turn is processed asynchronously by PLANQK.
42
+ * Starts a service execution, which in turn is processed asynchronously.
36
43
  * 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
44
  *
38
- * @param {Record<string, Record<string, any>>} request
45
+ * @param {Record<string, any>} request
39
46
  * @param {ServiceApi.RequestOptions} requestOptions - Request-specific configuration.
40
47
  *
41
- * @throws {@link PlanqkServiceApi.BadRequestError}
42
- * @throws {@link PlanqkServiceApi.UnauthorizedError}
43
- * @throws {@link PlanqkServiceApi.ForbiddenError}
44
- * @throws {@link PlanqkServiceApi.NotFoundError}
45
- * @throws {@link PlanqkServiceApi.InternalServerError}
46
- *
47
48
  * @example
48
- * await client.serviceApi.execute({
49
- * "key": {
50
- * "key": "value"
51
- * }
49
+ * await client.serviceApi.startExecution({
50
+ * "key": "value"
52
51
  * })
53
52
  */
54
- execute(request: Record<string, Record<string, any>>, requestOptions?: ServiceApi.RequestOptions): Promise<PlanqkServiceApi.ServiceExecution>;
53
+ startExecution(request: Record<string, any>, requestOptions?: ServiceApi.RequestOptions): core.HttpResponsePromise<PlanqkServiceApi.ServiceExecution>;
54
+ private __startExecution;
55
55
  /**
56
- * This method checks the status of a service execution.
56
+ * Retrieves the status of a service execution.
57
+ * The status can be one of the following: UNKNOWN, PENDING, RUNNING, SUCCEEDED, CANCELLED, FAILED.
57
58
  *
58
59
  * @param {string} id - The id of a service execution
59
60
  * @param {ServiceApi.RequestOptions} requestOptions - Request-specific configuration.
60
61
  *
61
- * @throws {@link PlanqkServiceApi.UnauthorizedError}
62
- * @throws {@link PlanqkServiceApi.ForbiddenError}
63
- * @throws {@link PlanqkServiceApi.NotFoundError}
64
- * @throws {@link PlanqkServiceApi.InternalServerError}
65
- *
66
62
  * @example
67
63
  * await client.serviceApi.getStatus("id")
68
64
  */
69
- getStatus(id: string, requestOptions?: ServiceApi.RequestOptions): Promise<PlanqkServiceApi.ServiceExecution>;
65
+ getStatus(id: string, requestOptions?: ServiceApi.RequestOptions): core.HttpResponsePromise<PlanqkServiceApi.ServiceExecution>;
66
+ private __getStatus;
70
67
  /**
71
- * This method retrieves the result of a service execution.
68
+ * Retrieves the result of a service execution.
69
+ * The result is returned as a JSON object containing the status and any additional data.
70
+ * The result may include links to download specific result files.
72
71
  *
73
72
  * @param {string} id - The id of a service execution
74
73
  * @param {ServiceApi.RequestOptions} requestOptions - Request-specific configuration.
75
74
  *
76
- * @throws {@link PlanqkServiceApi.UnauthorizedError}
77
- * @throws {@link PlanqkServiceApi.ForbiddenError}
78
- * @throws {@link PlanqkServiceApi.NotFoundError}
79
- * @throws {@link PlanqkServiceApi.InternalServerError}
80
- *
81
75
  * @example
82
76
  * await client.serviceApi.getResult("id")
83
77
  */
84
- getResult(id: string, requestOptions?: ServiceApi.RequestOptions): Promise<PlanqkServiceApi.GetResultResponse>;
78
+ getResult(id: string, requestOptions?: ServiceApi.RequestOptions): core.HttpResponsePromise<PlanqkServiceApi.GetResultResponse>;
79
+ private __getResult;
85
80
  /**
86
- * This method downloads a result file of a service execution.
87
- * @throws {@link PlanqkServiceApi.UnauthorizedError}
88
- * @throws {@link PlanqkServiceApi.ForbiddenError}
89
- * @throws {@link PlanqkServiceApi.NotFoundError}
90
- * @throws {@link PlanqkServiceApi.InternalServerError}
81
+ * Retrieves a specific result file of a service execution.
82
+ * The file name is provided in the path parameter.
83
+ * The result file is returned as a binary stream.
91
84
  */
92
- getResultFile(id: string, file: string, requestOptions?: ServiceApi.RequestOptions): Promise<stream.Readable>;
85
+ getResultFile(id: string, file: string, requestOptions?: ServiceApi.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
86
+ private __getResultFile;
93
87
  /**
94
- * This method retrieves the log output of a service execution.
88
+ * Returns a list of log entries for a service execution in chronological order, where the first entry is the oldest.
95
89
  *
96
90
  * @param {string} id - The id of a service execution
97
91
  * @param {ServiceApi.RequestOptions} requestOptions - Request-specific configuration.
98
92
  *
99
- * @throws {@link PlanqkServiceApi.UnauthorizedError}
100
- * @throws {@link PlanqkServiceApi.ForbiddenError}
101
- * @throws {@link PlanqkServiceApi.NotFoundError}
102
- * @throws {@link PlanqkServiceApi.InternalServerError}
103
- *
104
93
  * @example
105
94
  * await client.serviceApi.getLogs("id")
106
95
  */
107
- getLogs(id: string, requestOptions?: ServiceApi.RequestOptions): Promise<string[]>;
96
+ getLogs(id: string, requestOptions?: ServiceApi.RequestOptions): core.HttpResponsePromise<string[]>;
97
+ private __getLogs;
108
98
  /**
109
- * This method cancels a service execution.
99
+ * Cancel a pending or running service execution.
110
100
  *
111
101
  * @param {string} id - The id of a service execution
112
102
  * @param {ServiceApi.RequestOptions} requestOptions - Request-specific configuration.
113
103
  *
114
- * @throws {@link PlanqkServiceApi.UnauthorizedError}
115
- * @throws {@link PlanqkServiceApi.ForbiddenError}
116
- * @throws {@link PlanqkServiceApi.NotFoundError}
117
- * @throws {@link PlanqkServiceApi.InternalServerError}
118
- *
119
104
  * @example
120
- * await client.serviceApi.cancel("id")
105
+ * await client.serviceApi.cancelExecution("id")
121
106
  */
122
- cancel(id: string, requestOptions?: ServiceApi.RequestOptions): Promise<PlanqkServiceApi.ServiceExecution>;
107
+ cancelExecution(id: string, requestOptions?: ServiceApi.RequestOptions): core.HttpResponsePromise<PlanqkServiceApi.ServiceExecution>;
108
+ private __cancelExecution;
123
109
  protected _getAuthorizationHeader(): Promise<string>;
124
110
  }