@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
@@ -1,13 +1,14 @@
1
- import { APIResponse } from "./APIResponse.js";
2
- import { Supplier } from "./Supplier.js";
1
+ import type { APIResponse } from "./APIResponse.js";
2
+ import type { EndpointMetadata } from "./EndpointMetadata.js";
3
+ import { EndpointSupplier } from "./EndpointSupplier.js";
3
4
  export type FetchFunction = <R = unknown>(args: Fetcher.Args) => Promise<APIResponse<R, Fetcher.Error>>;
4
5
  export declare namespace Fetcher {
5
6
  interface Args {
6
7
  url: string;
7
8
  method: string;
8
9
  contentType?: string;
9
- headers?: Record<string, string | Supplier<string | undefined> | undefined>;
10
- queryParameters?: Record<string, string | string[] | object | object[] | null>;
10
+ headers?: Record<string, string | EndpointSupplier<string | null | undefined> | null | undefined>;
11
+ queryParameters?: Record<string, unknown>;
11
12
  body?: unknown;
12
13
  timeoutMs?: number;
13
14
  maxRetries?: number;
@@ -16,6 +17,7 @@ export declare namespace Fetcher {
16
17
  requestType?: "json" | "file" | "bytes";
17
18
  responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer" | "binary-response";
18
19
  duplex?: "half";
20
+ endpointMetadata?: EndpointMetadata;
19
21
  }
20
22
  type Error = FailedStatusCodeError | NonJsonError | TimeoutError | UnknownError;
21
23
  interface FailedStatusCodeError {
@@ -3,14 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.fetcher = void 0;
4
4
  exports.fetcherImpl = fetcherImpl;
5
5
  const json_js_1 = require("../json.js");
6
- const RawResponse_js_1 = require("./RawResponse.js");
7
- const Supplier_js_1 = require("./Supplier.js");
8
6
  const createRequestUrl_js_1 = require("./createRequestUrl.js");
7
+ const EndpointSupplier_js_1 = require("./EndpointSupplier.js");
9
8
  const getErrorResponseBody_js_1 = require("./getErrorResponseBody.js");
10
9
  const getFetchFn_js_1 = require("./getFetchFn.js");
11
10
  const getRequestBody_js_1 = require("./getRequestBody.js");
12
11
  const getResponseBody_js_1 = require("./getResponseBody.js");
13
12
  const makeRequest_js_1 = require("./makeRequest.js");
13
+ const RawResponse_js_1 = require("./RawResponse.js");
14
14
  const requestWithRetries_js_1 = require("./requestWithRetries.js");
15
15
  async function getHeaders(args) {
16
16
  const newHeaders = {};
@@ -21,7 +21,7 @@ async function getHeaders(args) {
21
21
  return newHeaders;
22
22
  }
23
23
  for (const [key, value] of Object.entries(args.headers)) {
24
- const result = await Supplier_js_1.Supplier.get(value);
24
+ const result = await EndpointSupplier_js_1.EndpointSupplier.get(value, { endpointMetadata: args.endpointMetadata ?? {} });
25
25
  if (typeof result === "string") {
26
26
  newHeaders[key] = result;
27
27
  continue;
@@ -1,4 +1,4 @@
1
- import { WithRawResponse } from "./RawResponse.js";
1
+ import type { WithRawResponse } from "./RawResponse.js";
2
2
  /**
3
3
  * A promise that returns the parsed response and lets you retrieve the raw response too.
4
4
  */
@@ -1,9 +1,11 @@
1
1
  export type { APIResponse } from "./APIResponse.js";
2
- export { fetcher } from "./Fetcher.js";
2
+ export type { BinaryResponse } from "./BinaryResponse.js";
3
+ export type { EndpointMetadata } from "./EndpointMetadata.js";
4
+ export { EndpointSupplier } from "./EndpointSupplier.js";
3
5
  export type { Fetcher, FetchFunction } from "./Fetcher.js";
6
+ export { fetcher } from "./Fetcher.js";
4
7
  export { getHeader } from "./getHeader.js";
5
- export { Supplier } from "./Supplier.js";
6
- export { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.js";
7
- export type { RawResponse, WithRawResponse } from "./RawResponse.js";
8
8
  export { HttpResponsePromise } from "./HttpResponsePromise.js";
9
- export { BinaryResponse } from "./BinaryResponse.js";
9
+ export type { RawResponse, WithRawResponse } from "./RawResponse.js";
10
+ export { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.js";
11
+ export { Supplier } from "./Supplier.js";
@@ -1,15 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HttpResponsePromise = exports.unknownRawResponse = exports.toRawResponse = exports.abortRawResponse = exports.Supplier = exports.getHeader = exports.fetcher = void 0;
3
+ exports.Supplier = exports.unknownRawResponse = exports.toRawResponse = exports.abortRawResponse = exports.HttpResponsePromise = exports.getHeader = exports.fetcher = exports.EndpointSupplier = void 0;
4
+ var EndpointSupplier_js_1 = require("./EndpointSupplier.js");
5
+ Object.defineProperty(exports, "EndpointSupplier", { enumerable: true, get: function () { return EndpointSupplier_js_1.EndpointSupplier; } });
4
6
  var Fetcher_js_1 = require("./Fetcher.js");
5
7
  Object.defineProperty(exports, "fetcher", { enumerable: true, get: function () { return Fetcher_js_1.fetcher; } });
6
8
  var getHeader_js_1 = require("./getHeader.js");
7
9
  Object.defineProperty(exports, "getHeader", { enumerable: true, get: function () { return getHeader_js_1.getHeader; } });
8
- var Supplier_js_1 = require("./Supplier.js");
9
- Object.defineProperty(exports, "Supplier", { enumerable: true, get: function () { return Supplier_js_1.Supplier; } });
10
+ var HttpResponsePromise_js_1 = require("./HttpResponsePromise.js");
11
+ Object.defineProperty(exports, "HttpResponsePromise", { enumerable: true, get: function () { return HttpResponsePromise_js_1.HttpResponsePromise; } });
10
12
  var RawResponse_js_1 = require("./RawResponse.js");
11
13
  Object.defineProperty(exports, "abortRawResponse", { enumerable: true, get: function () { return RawResponse_js_1.abortRawResponse; } });
12
14
  Object.defineProperty(exports, "toRawResponse", { enumerable: true, get: function () { return RawResponse_js_1.toRawResponse; } });
13
15
  Object.defineProperty(exports, "unknownRawResponse", { enumerable: true, get: function () { return RawResponse_js_1.unknownRawResponse; } });
14
- var HttpResponsePromise_js_1 = require("./HttpResponsePromise.js");
15
- Object.defineProperty(exports, "HttpResponsePromise", { enumerable: true, get: function () { return HttpResponsePromise_js_1.HttpResponsePromise; } });
16
+ var Supplier_js_1 = require("./Supplier.js");
17
+ Object.defineProperty(exports, "Supplier", { enumerable: true, get: function () { return Supplier_js_1.Supplier; } });
@@ -5,20 +5,56 @@ const INITIAL_RETRY_DELAY = 1000; // in milliseconds
5
5
  const MAX_RETRY_DELAY = 60000; // in milliseconds
6
6
  const DEFAULT_MAX_RETRIES = 2;
7
7
  const JITTER_FACTOR = 0.2; // 20% random jitter
8
- function addJitter(delay) {
9
- // Generate a random value between -JITTER_FACTOR and +JITTER_FACTOR
10
- const jitterMultiplier = 1 + (Math.random() * 2 - 1) * JITTER_FACTOR;
8
+ function addPositiveJitter(delay) {
9
+ // Generate a random value between 0 and +JITTER_FACTOR
10
+ const jitterMultiplier = 1 + Math.random() * JITTER_FACTOR;
11
11
  return delay * jitterMultiplier;
12
12
  }
13
+ function addSymmetricJitter(delay) {
14
+ // Generate a random value in a JITTER_FACTOR-sized percentage range around delay
15
+ const jitterMultiplier = 1 + (Math.random() - 0.5) * JITTER_FACTOR;
16
+ return delay * jitterMultiplier;
17
+ }
18
+ function getRetryDelayFromHeaders(response, retryAttempt) {
19
+ // Check for Retry-After header first (RFC 7231), with no jitter
20
+ const retryAfter = response.headers.get("Retry-After");
21
+ if (retryAfter) {
22
+ // Parse as number of seconds...
23
+ const retryAfterSeconds = parseInt(retryAfter, 10);
24
+ if (!isNaN(retryAfterSeconds) && retryAfterSeconds > 0) {
25
+ return Math.min(retryAfterSeconds * 1000, MAX_RETRY_DELAY);
26
+ }
27
+ // ...or as an HTTP date; both are valid
28
+ const retryAfterDate = new Date(retryAfter);
29
+ if (!isNaN(retryAfterDate.getTime())) {
30
+ const delay = retryAfterDate.getTime() - Date.now();
31
+ if (delay > 0) {
32
+ return Math.min(Math.max(delay, 0), MAX_RETRY_DELAY);
33
+ }
34
+ }
35
+ }
36
+ // Then check for industry-standard X-RateLimit-Reset header, with positive jitter
37
+ const rateLimitReset = response.headers.get("X-RateLimit-Reset");
38
+ if (rateLimitReset) {
39
+ const resetTime = parseInt(rateLimitReset, 10);
40
+ if (!isNaN(resetTime)) {
41
+ // Assume Unix timestamp in epoch seconds
42
+ const delay = resetTime * 1000 - Date.now();
43
+ if (delay > 0) {
44
+ return addPositiveJitter(Math.min(delay, MAX_RETRY_DELAY));
45
+ }
46
+ }
47
+ }
48
+ // Fall back to exponential backoff, with symmetric jitter
49
+ return addSymmetricJitter(Math.min(INITIAL_RETRY_DELAY * Math.pow(2, retryAttempt), MAX_RETRY_DELAY));
50
+ }
13
51
  async function requestWithRetries(requestFn, maxRetries = DEFAULT_MAX_RETRIES) {
14
52
  let response = await requestFn();
15
53
  for (let i = 0; i < maxRetries; ++i) {
16
54
  if ([408, 429].includes(response.status) || response.status >= 500) {
17
- // Calculate base delay using exponential backoff (in milliseconds)
18
- const baseDelay = Math.min(INITIAL_RETRY_DELAY * Math.pow(2, i), MAX_RETRY_DELAY);
19
- // Add jitter to the delay
20
- const delayWithJitter = addJitter(baseDelay);
21
- await new Promise((resolve) => setTimeout(resolve, delayWithJitter));
55
+ // Get delay with appropriate jitter applied
56
+ const delay = getRetryDelayFromHeaders(response, i);
57
+ await new Promise((resolve) => setTimeout(resolve, delay));
22
58
  response = await requestFn();
23
59
  }
24
60
  else {
@@ -1,3 +1,2 @@
1
- import * as core from "./index.js";
2
- export declare function mergeHeaders(...headersArray: (Record<string, string | core.Supplier<string | undefined> | undefined> | undefined)[]): Record<string, string | core.Supplier<string | undefined>>;
3
- export declare function mergeOnlyDefinedHeaders(...headersArray: (Record<string, string | core.Supplier<string | undefined> | undefined> | undefined)[]): Record<string, string | core.Supplier<string | undefined>>;
1
+ export declare function mergeHeaders<THeaderValue>(...headersArray: (Record<string, THeaderValue> | null | undefined)[]): Record<string, string | THeaderValue>;
2
+ export declare function mergeOnlyDefinedHeaders<THeaderValue>(...headersArray: (Record<string, THeaderValue> | null | undefined)[]): Record<string, THeaderValue>;
@@ -5,6 +5,9 @@ function join(base, ...segments) {
5
5
  if (!base) {
6
6
  return "";
7
7
  }
8
+ if (segments.length === 0) {
9
+ return base;
10
+ }
8
11
  if (base.includes("://")) {
9
12
  let url;
10
13
  try {
@@ -14,24 +17,37 @@ function join(base, ...segments) {
14
17
  // Fallback to path joining if URL is malformed
15
18
  return joinPath(base, ...segments);
16
19
  }
20
+ const lastSegment = segments[segments.length - 1];
21
+ const shouldPreserveTrailingSlash = lastSegment && lastSegment.endsWith("/");
17
22
  for (const segment of segments) {
18
23
  const cleanSegment = trimSlashes(segment);
19
24
  if (cleanSegment) {
20
25
  url.pathname = joinPathSegments(url.pathname, cleanSegment);
21
26
  }
22
27
  }
28
+ if (shouldPreserveTrailingSlash && !url.pathname.endsWith("/")) {
29
+ url.pathname += "/";
30
+ }
23
31
  return url.toString();
24
32
  }
25
33
  return joinPath(base, ...segments);
26
34
  }
27
35
  function joinPath(base, ...segments) {
36
+ if (segments.length === 0) {
37
+ return base;
38
+ }
28
39
  let result = base;
40
+ const lastSegment = segments[segments.length - 1];
41
+ const shouldPreserveTrailingSlash = lastSegment && lastSegment.endsWith("/");
29
42
  for (const segment of segments) {
30
43
  const cleanSegment = trimSlashes(segment);
31
44
  if (cleanSegment) {
32
45
  result = joinPathSegments(result, cleanSegment);
33
46
  }
34
47
  }
48
+ if (shouldPreserveTrailingSlash && !result.endsWith("/")) {
49
+ result += "/";
50
+ }
35
51
  return result;
36
52
  }
37
53
  function joinPathSegments(left, right) {
@@ -43,7 +59,11 @@ function joinPathSegments(left, right) {
43
59
  function trimSlashes(str) {
44
60
  if (!str)
45
61
  return str;
46
- let start = str.startsWith("/") ? 1 : 0;
47
- let end = str.endsWith("/") ? str.length - 1 : str.length;
48
- return str.slice(start, end);
62
+ let start = 0;
63
+ let end = str.length;
64
+ if (str.startsWith("/"))
65
+ start = 1;
66
+ if (str.endsWith("/"))
67
+ end = str.length - 1;
68
+ return start === 0 && end === str.length ? str : str.slice(start, end);
49
69
  }
@@ -1,6 +1,3 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
1
  export declare const PlanqkServiceApiEnvironment: {
5
2
  readonly Default: "https://gateway.platform.planqk.de/<context>/<service>/<version>";
6
3
  };
@@ -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
  Object.defineProperty(exports, "__esModule", { value: true });
6
4
  exports.PlanqkServiceApiEnvironment = void 0;
7
5
  exports.PlanqkServiceApiEnvironment = {
@@ -1,6 +1,3 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
1
  import * as core from "../core/index.js";
5
2
  export declare class PlanqkServiceApiError extends Error {
6
3
  readonly statusCode?: number;
@@ -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
  Object.defineProperty(exports, "__esModule", { value: true });
6
4
  exports.PlanqkServiceApiError = void 0;
7
5
  const json_js_1 = require("../core/json.js");
@@ -1,6 +1,3 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
1
  export declare class PlanqkServiceApiTimeoutError extends Error {
5
2
  constructor(message: string);
6
3
  }
@@ -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
  Object.defineProperty(exports, "__esModule", { value: true });
6
4
  exports.PlanqkServiceApiTimeoutError = void 0;
7
5
  class PlanqkServiceApiTimeoutError extends Error {
@@ -1,4 +1,5 @@
1
1
  export * as PlanqkServiceApi from "./api/index.js";
2
2
  export { PlanqkServiceApiError, PlanqkServiceApiTimeoutError } from "./errors/index.js";
3
+ export { type BaseClientOptions, type BaseRequestOptions } from "./BaseClient.js";
3
4
  export { PlanqkServiceApiClient } from "./Client.js";
4
5
  export { PlanqkServiceApiEnvironment } from "./environments.js";
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "organization": "planqk-service",
3
- "version": "0.86.2"
3
+ "version": "0.101.3"
4
4
  }
@@ -38,30 +38,70 @@ components:
38
38
  properties:
39
39
  id:
40
40
  type: string
41
+ format: uuid
42
+ description: Unique identifier of the service execution.
41
43
  examples: [ 87cb778e-ac43-11ec-b909-0242ac120002 ]
42
- status:
43
- type: string
44
- enum: [ UNKNOWN, PENDING, RUNNING, SUCCEEDED, CANCELLED, FAILED ]
45
- examples: [ SUCCEEDED ]
46
44
  createdAt:
47
45
  type: string
46
+ pattern: "^\\d{4}\\-\\d{2}\\-\\d{2}\\s{1}\\d{2}\\:\\d{2}\\:\\d{2}$"
47
+ description: Timestamp when the service execution was created.
48
48
  examples: [ "2022-01-01 22:38:08" ]
49
49
  startedAt:
50
50
  type: string
51
+ pattern: "^\\d{4}\\-\\d{2}\\-\\d{2}\\s{1}\\d{2}\\:\\d{2}\\:\\d{2}$"
52
+ description: Timestamp when the service execution started.
51
53
  examples: [ "2022-01-01 22:39:08" ]
52
54
  endedAt:
53
55
  type: string
56
+ pattern: "^\\d{4}\\-\\d{2}\\-\\d{2}\\s{1}\\d{2}\\:\\d{2}\\:\\d{2}$"
57
+ description: Timestamp when the service execution ended.
54
58
  examples: [ "2022-01-01 22:40:08" ]
59
+ status:
60
+ type: string
61
+ enum: [ UNKNOWN, PENDING, RUNNING, SUCCEEDED, CANCELLED, FAILED ]
62
+ description: Status of the service execution.
63
+ examples: [ SUCCEEDED ]
64
+ type:
65
+ type: string
66
+ enum: [ MANAGED, WORKFLOW ]
67
+ description: Type identifier indicating whether the underlying service is a 'managed' or 'workflow' service.
68
+ examples: [ MANAGED ]
69
+ serviceId:
70
+ type: string
71
+ format: uuid
72
+ description: The ID of the service for which this service execution was created.
73
+ examples: [ 123e4567-e89b-12d3-a456-426614174000 ]
74
+ serviceDefinitionId:
75
+ type: string
76
+ format: uuid
77
+ description: The ID of the service definition for which this service execution was created.
78
+ examples: [ 123e4567-e89b-12d3-a456-426614174000 ]
79
+ applicationId:
80
+ type: string
81
+ format: uuid
82
+ description: The ID of the application for which this service execution was created.
83
+ examples: [ 123e4567-e89b-12d3-a456-426614174000 ]
55
84
  LogEntry:
56
85
  type: object
57
86
  properties:
58
87
  message:
59
88
  type: string
89
+ description: Log message content.
60
90
  severity:
61
91
  type: string
92
+ description: Severity of the log entry.
93
+ enum:
94
+ - DEBUG
95
+ - NOTICE
96
+ - INFO
97
+ - WARNING
98
+ - ERROR
99
+ examples: [ "INFO" ]
62
100
  timestamp:
63
101
  type: string
64
102
  format: date-time
103
+ description: Timestamp when the entry was logged.
104
+ examples: [ "2025-10-10T08:23:26.452335419Z" ]
65
105
  # Representation of link as defined in HAL: https://datatracker.ietf.org/doc/html/draft-kelly-json-hal-11
66
106
  HALLink:
67
107
  type: object
@@ -97,9 +137,9 @@ components:
97
137
  flows:
98
138
  clientCredentials:
99
139
  tokenUrl: https://gateway.platform.planqk.de/token
100
- scopes: {}
140
+ scopes: { }
101
141
  security:
102
- - ApplicationCredentials: []
142
+ - ApplicationCredentials: [ ]
103
143
  servers:
104
144
  - url: https://gateway.platform.planqk.de/<context>/<service>/<version>
105
145
  description: The service endpoint
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planqk/planqk-service-sdk",
3
- "version": "2.7.0",
3
+ "version": "2.9.0",
4
4
  "description": "SDK to interact with PLANQK Managed Services.",
5
5
  "author": "Kipu Quantum GmbH",
6
6
  "contributors": [
@@ -1 +1 @@
1
- __version__ = "2.7.0"
1
+ __version__ = "2.9.0"
@@ -9,12 +9,14 @@ if typing.TYPE_CHECKING:
9
9
  from .types import (
10
10
  HalLink,
11
11
  LogEntry,
12
+ LogEntrySeverity,
12
13
  RequestBody,
13
14
  ResultResponse,
14
15
  ResultResponseEmbedded,
15
16
  ResultResponseLinks,
16
17
  ServiceExecution,
17
18
  ServiceExecutionStatus,
19
+ ServiceExecutionType,
18
20
  )
19
21
  from . import service_api
20
22
  from .client import AsyncPlanqkServiceApi, PlanqkServiceApi
@@ -23,6 +25,7 @@ _dynamic_imports: typing.Dict[str, str] = {
23
25
  "AsyncPlanqkServiceApi": ".client",
24
26
  "HalLink": ".types",
25
27
  "LogEntry": ".types",
28
+ "LogEntrySeverity": ".types",
26
29
  "PlanqkServiceApi": ".client",
27
30
  "PlanqkServiceApiEnvironment": ".environment",
28
31
  "RequestBody": ".types",
@@ -31,6 +34,7 @@ _dynamic_imports: typing.Dict[str, str] = {
31
34
  "ResultResponseLinks": ".types",
32
35
  "ServiceExecution": ".types",
33
36
  "ServiceExecutionStatus": ".types",
37
+ "ServiceExecutionType": ".types",
34
38
  "service_api": ".service_api",
35
39
  }
36
40
 
@@ -60,6 +64,7 @@ __all__ = [
60
64
  "AsyncPlanqkServiceApi",
61
65
  "HalLink",
62
66
  "LogEntry",
67
+ "LogEntrySeverity",
63
68
  "PlanqkServiceApi",
64
69
  "PlanqkServiceApiEnvironment",
65
70
  "RequestBody",
@@ -68,5 +73,6 @@ __all__ = [
68
73
  "ResultResponseLinks",
69
74
  "ServiceExecution",
70
75
  "ServiceExecutionStatus",
76
+ "ServiceExecutionType",
71
77
  "service_api",
72
78
  ]
@@ -8,21 +8,25 @@ from importlib import import_module
8
8
  if typing.TYPE_CHECKING:
9
9
  from .hal_link import HalLink
10
10
  from .log_entry import LogEntry
11
+ from .log_entry_severity import LogEntrySeverity
11
12
  from .request_body import RequestBody
12
13
  from .result_response import ResultResponse
13
14
  from .result_response_embedded import ResultResponseEmbedded
14
15
  from .result_response_links import ResultResponseLinks
15
16
  from .service_execution import ServiceExecution
16
17
  from .service_execution_status import ServiceExecutionStatus
18
+ from .service_execution_type import ServiceExecutionType
17
19
  _dynamic_imports: typing.Dict[str, str] = {
18
20
  "HalLink": ".hal_link",
19
21
  "LogEntry": ".log_entry",
22
+ "LogEntrySeverity": ".log_entry_severity",
20
23
  "RequestBody": ".request_body",
21
24
  "ResultResponse": ".result_response",
22
25
  "ResultResponseEmbedded": ".result_response_embedded",
23
26
  "ResultResponseLinks": ".result_response_links",
24
27
  "ServiceExecution": ".service_execution",
25
28
  "ServiceExecutionStatus": ".service_execution_status",
29
+ "ServiceExecutionType": ".service_execution_type",
26
30
  }
27
31
 
28
32
 
@@ -50,10 +54,12 @@ def __dir__():
50
54
  __all__ = [
51
55
  "HalLink",
52
56
  "LogEntry",
57
+ "LogEntrySeverity",
53
58
  "RequestBody",
54
59
  "ResultResponse",
55
60
  "ResultResponseEmbedded",
56
61
  "ResultResponseLinks",
57
62
  "ServiceExecution",
58
63
  "ServiceExecutionStatus",
64
+ "ServiceExecutionType",
59
65
  ]
@@ -6,12 +6,24 @@ import typing
6
6
  import pydantic
7
7
  from ..core.pydantic_utilities import IS_PYDANTIC_V2
8
8
  from ..core.unchecked_base_model import UncheckedBaseModel
9
+ from .log_entry_severity import LogEntrySeverity
9
10
 
10
11
 
11
12
  class LogEntry(UncheckedBaseModel):
12
- message: typing.Optional[str] = None
13
- severity: typing.Optional[str] = None
14
- timestamp: typing.Optional[dt.datetime] = None
13
+ message: typing.Optional[str] = pydantic.Field(default=None)
14
+ """
15
+ Log message content.
16
+ """
17
+
18
+ severity: typing.Optional[LogEntrySeverity] = pydantic.Field(default=None)
19
+ """
20
+ Severity of the log entry.
21
+ """
22
+
23
+ timestamp: typing.Optional[dt.datetime] = pydantic.Field(default=None)
24
+ """
25
+ Timestamp when the entry was logged.
26
+ """
15
27
 
16
28
  if IS_PYDANTIC_V2:
17
29
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ LogEntrySeverity = typing.Union[typing.Literal["DEBUG", "NOTICE", "INFO", "WARNING", "ERROR"], typing.Any]
@@ -8,14 +8,66 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2
8
8
  from ..core.serialization import FieldMetadata
9
9
  from ..core.unchecked_base_model import UncheckedBaseModel
10
10
  from .service_execution_status import ServiceExecutionStatus
11
+ from .service_execution_type import ServiceExecutionType
11
12
 
12
13
 
13
14
  class ServiceExecution(UncheckedBaseModel):
14
- id: typing.Optional[str] = None
15
- status: typing.Optional[ServiceExecutionStatus] = None
16
- created_at: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="createdAt")] = None
17
- started_at: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="startedAt")] = None
18
- ended_at: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="endedAt")] = None
15
+ id: typing.Optional[str] = pydantic.Field(default=None)
16
+ """
17
+ Unique identifier of the service execution.
18
+ """
19
+
20
+ created_at: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="createdAt")] = pydantic.Field(
21
+ default=None
22
+ )
23
+ """
24
+ Timestamp when the service execution was created.
25
+ """
26
+
27
+ started_at: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="startedAt")] = pydantic.Field(
28
+ default=None
29
+ )
30
+ """
31
+ Timestamp when the service execution started.
32
+ """
33
+
34
+ ended_at: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="endedAt")] = pydantic.Field(
35
+ default=None
36
+ )
37
+ """
38
+ Timestamp when the service execution ended.
39
+ """
40
+
41
+ status: typing.Optional[ServiceExecutionStatus] = pydantic.Field(default=None)
42
+ """
43
+ Status of the service execution.
44
+ """
45
+
46
+ type: typing.Optional[ServiceExecutionType] = pydantic.Field(default=None)
47
+ """
48
+ Type identifier indicating whether the underlying service is a 'managed' or 'workflow' service.
49
+ """
50
+
51
+ service_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="serviceId")] = pydantic.Field(
52
+ default=None
53
+ )
54
+ """
55
+ The ID of the service for which this service execution was created.
56
+ """
57
+
58
+ service_definition_id: typing_extensions.Annotated[
59
+ typing.Optional[str], FieldMetadata(alias="serviceDefinitionId")
60
+ ] = pydantic.Field(default=None)
61
+ """
62
+ The ID of the service definition for which this service execution was created.
63
+ """
64
+
65
+ application_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="applicationId")] = (
66
+ pydantic.Field(default=None)
67
+ )
68
+ """
69
+ The ID of the application for which this service execution was created.
70
+ """
19
71
 
20
72
  if IS_PYDANTIC_V2:
21
73
  model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ ServiceExecutionType = typing.Union[typing.Literal["MANAGED", "WORKFLOW"], typing.Any]
package/pyproject.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "planqk-service-sdk"
3
- version = "2.7.0"
3
+ version = "2.9.0"
4
4
  description = "SDK to interact with PLANQK Managed Services."
5
5
  authors = [
6
6
  { name = "Kipu Quantum GmbH", email = "info@kipu-quantum.com" },