@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,9 +1,7 @@
1
- import * as core from "./index.js";
2
-
3
- export function mergeHeaders(
4
- ...headersArray: (Record<string, string | core.Supplier<string | undefined> | undefined> | undefined)[]
5
- ): Record<string, string | core.Supplier<string | undefined>> {
6
- const result: Record<string, string | core.Supplier<string | undefined>> = {};
1
+ export function mergeHeaders<THeaderValue>(
2
+ ...headersArray: (Record<string, THeaderValue> | null | undefined)[]
3
+ ): Record<string, string | THeaderValue> {
4
+ const result: Record<string, THeaderValue> = {};
7
5
 
8
6
  for (const [key, value] of headersArray
9
7
  .filter((headers) => headers != null)
@@ -18,10 +16,10 @@ export function mergeHeaders(
18
16
  return result;
19
17
  }
20
18
 
21
- export function mergeOnlyDefinedHeaders(
22
- ...headersArray: (Record<string, string | core.Supplier<string | undefined> | undefined> | undefined)[]
23
- ): Record<string, string | core.Supplier<string | undefined>> {
24
- const result: Record<string, string | core.Supplier<string | undefined>> = {};
19
+ export function mergeOnlyDefinedHeaders<THeaderValue>(
20
+ ...headersArray: (Record<string, THeaderValue> | null | undefined)[]
21
+ ): Record<string, THeaderValue> {
22
+ const result: Record<string, THeaderValue> = {};
25
23
 
26
24
  for (const [key, value] of headersArray
27
25
  .filter((headers) => headers != null)
@@ -3,6 +3,10 @@ export function join(base: string, ...segments: string[]): string {
3
3
  return "";
4
4
  }
5
5
 
6
+ if (segments.length === 0) {
7
+ return base;
8
+ }
9
+
6
10
  if (base.includes("://")) {
7
11
  let url: URL;
8
12
  try {
@@ -12,6 +16,9 @@ export function join(base: string, ...segments: string[]): string {
12
16
  return joinPath(base, ...segments);
13
17
  }
14
18
 
19
+ const lastSegment = segments[segments.length - 1];
20
+ const shouldPreserveTrailingSlash = lastSegment && lastSegment.endsWith("/");
21
+
15
22
  for (const segment of segments) {
16
23
  const cleanSegment = trimSlashes(segment);
17
24
  if (cleanSegment) {
@@ -19,6 +26,10 @@ export function join(base: string, ...segments: string[]): string {
19
26
  }
20
27
  }
21
28
 
29
+ if (shouldPreserveTrailingSlash && !url.pathname.endsWith("/")) {
30
+ url.pathname += "/";
31
+ }
32
+
22
33
  return url.toString();
23
34
  }
24
35
 
@@ -26,8 +37,15 @@ export function join(base: string, ...segments: string[]): string {
26
37
  }
27
38
 
28
39
  function joinPath(base: string, ...segments: string[]): string {
40
+ if (segments.length === 0) {
41
+ return base;
42
+ }
43
+
29
44
  let result = base;
30
45
 
46
+ const lastSegment = segments[segments.length - 1];
47
+ const shouldPreserveTrailingSlash = lastSegment && lastSegment.endsWith("/");
48
+
31
49
  for (const segment of segments) {
32
50
  const cleanSegment = trimSlashes(segment);
33
51
  if (cleanSegment) {
@@ -35,6 +53,10 @@ function joinPath(base: string, ...segments: string[]): string {
35
53
  }
36
54
  }
37
55
 
56
+ if (shouldPreserveTrailingSlash && !result.endsWith("/")) {
57
+ result += "/";
58
+ }
59
+
38
60
  return result;
39
61
  }
40
62
 
@@ -48,8 +70,11 @@ function joinPathSegments(left: string, right: string): string {
48
70
  function trimSlashes(str: string): string {
49
71
  if (!str) return str;
50
72
 
51
- let start = str.startsWith("/") ? 1 : 0;
52
- let end = str.endsWith("/") ? str.length - 1 : str.length;
73
+ let start = 0;
74
+ let end = str.length;
75
+
76
+ if (str.startsWith("/")) start = 1;
77
+ if (str.endsWith("/")) end = str.length - 1;
53
78
 
54
- return str.slice(start, end);
79
+ return start === 0 && end === str.length ? str : str.slice(start, end);
55
80
  }
@@ -1,6 +1,4 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
1
+ // This file was auto-generated by Fern from our API Definition.
4
2
 
5
3
  export const PlanqkServiceApiEnvironment = {
6
4
  Default: "https://gateway.platform.planqk.de/<context>/<service>/<version>",
@@ -1,6 +1,4 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
1
+ // This file was auto-generated by Fern from our API Definition.
4
2
 
5
3
  import * as core from "../core/index.js";
6
4
  import { toJson } from "../core/json.js";
@@ -1,6 +1,4 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
1
+ // This file was auto-generated by Fern from our API Definition.
4
2
 
5
3
  export class PlanqkServiceApiTimeoutError extends Error {
6
4
  constructor(message: string) {
package/src/sdk/index.ts CHANGED
@@ -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";