@planqk/planqk-service-sdk 2.7.0 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sdk/BaseClient.d.ts +26 -0
- package/dist/sdk/{api/resources/serviceApi/types/GetResultResponse.js → BaseClient.js} +1 -3
- package/dist/sdk/Client.d.ts +3 -21
- package/dist/sdk/Client.js +1 -3
- package/dist/sdk/api/index.d.ts +1 -1
- package/dist/sdk/api/index.js +1 -1
- package/dist/sdk/api/resources/index.d.ts +0 -1
- package/dist/sdk/api/resources/index.js +0 -4
- package/dist/sdk/api/resources/serviceApi/client/Client.d.ts +6 -23
- package/dist/sdk/api/resources/serviceApi/client/Client.js +37 -25
- package/dist/sdk/api/resources/serviceApi/index.d.ts +0 -1
- package/dist/sdk/api/resources/serviceApi/index.js +0 -1
- package/dist/sdk/api/types/HalLink.d.ts +0 -3
- package/dist/sdk/api/types/HalLink.js +1 -3
- package/dist/sdk/api/types/LogEntry.d.ts +15 -4
- package/dist/sdk/api/types/LogEntry.js +13 -3
- package/dist/sdk/api/types/RequestBody.d.ts +1 -0
- package/dist/sdk/api/types/RequestBody.js +3 -0
- package/dist/sdk/api/types/ResultResponse.d.ts +15 -0
- package/dist/sdk/api/types/ResultResponse.js +3 -0
- package/dist/sdk/api/types/ServiceExecution.d.ts +1 -4
- package/dist/sdk/api/types/ServiceExecution.js +1 -3
- package/dist/sdk/api/types/index.d.ts +2 -0
- package/dist/sdk/api/types/index.js +2 -0
- package/dist/sdk/core/auth/AuthProvider.d.ts +4 -0
- package/dist/sdk/core/auth/AuthProvider.js +2 -0
- package/dist/sdk/core/auth/AuthRequest.d.ts +9 -0
- package/dist/sdk/core/auth/AuthRequest.js +2 -0
- package/dist/sdk/core/auth/BasicAuth.js +2 -1
- package/dist/sdk/core/auth/index.d.ts +2 -0
- package/dist/sdk/core/fetcher/APIResponse.d.ts +1 -1
- package/dist/sdk/core/fetcher/BinaryResponse.d.ts +1 -1
- package/dist/sdk/core/fetcher/EndpointMetadata.d.ts +13 -0
- package/dist/sdk/core/fetcher/EndpointMetadata.js +2 -0
- package/dist/sdk/core/fetcher/EndpointSupplier.d.ts +12 -0
- package/dist/sdk/core/fetcher/EndpointSupplier.js +13 -0
- package/dist/sdk/core/fetcher/Fetcher.d.ts +6 -4
- package/dist/sdk/core/fetcher/Fetcher.js +3 -3
- package/dist/sdk/core/fetcher/HttpResponsePromise.d.ts +1 -1
- package/dist/sdk/core/fetcher/index.d.ts +7 -5
- package/dist/sdk/core/fetcher/index.js +7 -5
- package/dist/sdk/core/fetcher/requestWithRetries.js +44 -8
- package/dist/sdk/core/headers.d.ts +2 -3
- package/dist/sdk/core/url/join.js +23 -3
- package/dist/sdk/environments.d.ts +0 -3
- package/dist/sdk/environments.js +1 -3
- package/dist/sdk/errors/PlanqkServiceApiError.d.ts +0 -3
- package/dist/sdk/errors/PlanqkServiceApiError.js +1 -3
- package/dist/sdk/errors/PlanqkServiceApiTimeoutError.d.ts +0 -3
- package/dist/sdk/errors/PlanqkServiceApiTimeoutError.js +1 -3
- package/dist/sdk/index.d.ts +1 -0
- package/fern/openapi/openapi.yml +13 -2
- package/package.json +1 -1
- package/planqk/service/_version.py +1 -1
- package/planqk/service/sdk/__init__.py +3 -0
- package/planqk/service/sdk/types/__init__.py +3 -0
- package/planqk/service/sdk/types/log_entry.py +15 -3
- package/planqk/service/sdk/types/log_entry_severity.py +5 -0
- package/pyproject.toml +1 -1
- package/src/index.test.ts +10 -0
- package/src/sdk/BaseClient.ts +30 -0
- package/src/sdk/Client.ts +5 -22
- package/src/sdk/api/index.ts +1 -1
- package/src/sdk/api/resources/index.ts +0 -1
- package/src/sdk/api/resources/serviceApi/client/Client.ts +73 -76
- package/src/sdk/api/resources/serviceApi/index.ts +0 -1
- package/src/sdk/api/types/HalLink.ts +1 -3
- package/src/sdk/api/types/LogEntry.ts +17 -4
- package/src/sdk/api/types/RequestBody.ts +3 -0
- package/src/sdk/api/types/ResultResponse.ts +20 -0
- package/src/sdk/api/types/ServiceExecution.ts +2 -4
- package/src/sdk/api/types/index.ts +2 -0
- package/src/sdk/core/auth/AuthProvider.ts +5 -0
- package/src/sdk/core/auth/AuthRequest.ts +9 -0
- package/src/sdk/core/auth/BasicAuth.ts +2 -1
- package/src/sdk/core/auth/index.ts +2 -0
- package/src/sdk/core/fetcher/APIResponse.ts +1 -1
- package/src/sdk/core/fetcher/BinaryResponse.ts +1 -1
- package/src/sdk/core/fetcher/EndpointMetadata.ts +13 -0
- package/src/sdk/core/fetcher/EndpointSupplier.ts +14 -0
- package/src/sdk/core/fetcher/Fetcher.ts +8 -6
- package/src/sdk/core/fetcher/HttpResponsePromise.ts +1 -1
- package/src/sdk/core/fetcher/index.ts +7 -5
- package/src/sdk/core/fetcher/requestWithRetries.ts +49 -9
- package/src/sdk/core/headers.ts +8 -10
- package/src/sdk/core/url/join.ts +28 -3
- package/src/sdk/environments.ts +1 -3
- package/src/sdk/errors/PlanqkServiceApiError.ts +1 -3
- package/src/sdk/errors/PlanqkServiceApiTimeoutError.ts +1 -3
- package/src/sdk/index.ts +1 -0
- package/dist/sdk/api/resources/serviceApi/types/GetResultResponse.d.ts +0 -18
- package/dist/sdk/api/resources/serviceApi/types/index.d.ts +0 -1
- package/dist/sdk/api/resources/serviceApi/types/index.js +0 -17
- package/src/sdk/api/resources/serviceApi/types/GetResultResponse.ts +0 -22
- package/src/sdk/api/resources/serviceApi/types/index.ts +0 -1
package/src/sdk/core/url/join.ts
CHANGED
|
@@ -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 =
|
|
52
|
-
let end = str.
|
|
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
|
}
|
package/src/sdk/environments.ts
CHANGED
|
@@ -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>",
|
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";
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
import * as PlanqkServiceApi from "../../../index.js";
|
|
5
|
-
export interface GetResultResponse {
|
|
6
|
-
_links?: GetResultResponse.Links;
|
|
7
|
-
_embedded?: GetResultResponse.Embedded;
|
|
8
|
-
/** Accepts any additional properties */
|
|
9
|
-
[key: string]: any;
|
|
10
|
-
}
|
|
11
|
-
export declare namespace GetResultResponse {
|
|
12
|
-
interface Links {
|
|
13
|
-
status?: PlanqkServiceApi.HalLink;
|
|
14
|
-
}
|
|
15
|
-
interface Embedded {
|
|
16
|
-
status?: PlanqkServiceApi.ServiceExecution;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./GetResultResponse.js";
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./GetResultResponse.js"), exports);
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as PlanqkServiceApi from "../../../index.js";
|
|
6
|
-
|
|
7
|
-
export interface GetResultResponse {
|
|
8
|
-
_links?: GetResultResponse.Links;
|
|
9
|
-
_embedded?: GetResultResponse.Embedded;
|
|
10
|
-
/** Accepts any additional properties */
|
|
11
|
-
[key: string]: any;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export namespace GetResultResponse {
|
|
15
|
-
export interface Links {
|
|
16
|
-
status?: PlanqkServiceApi.HalLink;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface Embedded {
|
|
20
|
-
status?: PlanqkServiceApi.ServiceExecution;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./GetResultResponse.js";
|