@planqk/planqk-api-sdk 1.0.2 → 1.2.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/Client.d.ts +9 -2
- package/dist/Client.js +7 -1
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.js +1 -1
- package/dist/api/resources/authentication/client/Client.d.ts +55 -0
- package/dist/api/resources/authentication/client/Client.js +126 -0
- package/dist/api/resources/authentication/client/index.d.ts +1 -0
- package/dist/api/resources/authentication/client/index.js +2 -0
- package/dist/api/resources/authentication/index.d.ts +2 -0
- package/dist/api/resources/authentication/index.js +18 -0
- package/dist/api/resources/authentication/types/AuthorizeResponse.d.ts +5 -0
- package/dist/api/resources/authentication/types/AuthorizeResponse.js +5 -0
- package/dist/api/resources/authentication/types/index.d.ts +1 -0
- package/dist/api/resources/authentication/types/index.js +17 -0
- package/dist/api/resources/dataPools/client/Client.d.ts +10 -3
- package/dist/api/resources/dataPools/client/Client.js +37 -9
- package/dist/api/resources/index.d.ts +2 -0
- package/dist/api/resources/index.js +3 -1
- package/dist/api/types/AccessToken.d.ts +10 -0
- package/dist/api/types/AccessToken.js +5 -0
- package/dist/api/types/OrganizationMembership.d.ts +22 -0
- package/dist/api/types/OrganizationMembership.js +19 -0
- package/dist/api/types/PersonalAccessTokenPrincipal.d.ts +18 -0
- package/dist/api/types/PersonalAccessTokenPrincipal.js +14 -0
- package/dist/api/types/ServiceExecution.d.ts +20 -0
- package/dist/api/types/ServiceExecution.js +16 -0
- package/dist/api/types/ServiceExecutionTokenPrincipal.d.ts +8 -0
- package/dist/api/types/ServiceExecutionTokenPrincipal.js +5 -0
- package/dist/api/types/UserContext.d.ts +24 -0
- package/dist/api/types/UserContext.js +19 -0
- package/dist/api/types/index.d.ts +6 -0
- package/dist/api/types/index.js +6 -0
- package/fern/fern.config.json +1 -1
- package/fern/openapi/openapi.json +321 -15
- package/package.json +1 -1
- package/planqk/api/_version.py +1 -1
- package/planqk/api/client.py +3 -2
- package/planqk/api/sdk/__init__.py +34 -2
- package/planqk/api/sdk/authentication/__init__.py +7 -0
- package/planqk/api/sdk/authentication/client.py +102 -0
- package/planqk/api/sdk/authentication/raw_client.py +183 -0
- package/planqk/api/sdk/authentication/types/__init__.py +7 -0
- package/planqk/api/sdk/authentication/types/authorize_response.py +8 -0
- package/planqk/api/sdk/client.py +11 -0
- package/planqk/api/sdk/core/client_wrapper.py +12 -2
- package/planqk/api/sdk/data_pools/client.py +16 -0
- package/planqk/api/sdk/environment.py +1 -1
- package/planqk/api/sdk/types/__init__.py +30 -1
- package/planqk/api/sdk/types/access_token.py +26 -0
- package/planqk/api/sdk/types/organization_membership.py +27 -0
- package/planqk/api/sdk/types/organization_membership_account_type.py +5 -0
- package/planqk/api/sdk/types/organization_membership_role.py +5 -0
- package/planqk/api/sdk/types/personal_access_token_principal.py +31 -0
- package/planqk/api/sdk/types/personal_access_token_principal_account_type.py +5 -0
- package/planqk/api/sdk/types/service_execution.py +27 -0
- package/planqk/api/sdk/types/service_execution_status.py +7 -0
- package/planqk/api/sdk/types/service_execution_token_principal.py +34 -0
- package/planqk/api/sdk/types/user_context.py +35 -0
- package/planqk/api/sdk/types/user_context_account_type.py +5 -0
- package/planqk/api/sdk/types/user_context_context_type.py +5 -0
- package/pyproject.toml +6 -1
- package/src/Client.ts +13 -2
- package/src/api/index.ts +1 -1
- package/src/api/resources/authentication/client/Client.ts +134 -0
- package/src/api/resources/authentication/client/index.ts +1 -0
- package/src/api/resources/authentication/index.ts +2 -0
- package/src/api/resources/authentication/types/AuthorizeResponse.ts +7 -0
- package/src/api/resources/authentication/types/index.ts +1 -0
- package/src/api/resources/dataPools/client/Client.ts +42 -10
- package/src/api/resources/index.ts +2 -0
- package/src/api/types/AccessToken.ts +11 -0
- package/src/api/types/OrganizationMembership.ts +24 -0
- package/src/api/types/PersonalAccessTokenPrincipal.ts +21 -0
- package/src/api/types/ServiceExecution.ts +22 -0
- package/src/api/types/ServiceExecutionTokenPrincipal.ts +10 -0
- package/src/api/types/UserContext.ts +27 -0
- package/src/api/types/index.ts +6 -0
- package/uv.lock +27 -269
- package/README-node.md +0 -18
- package/README-python.md +0 -21
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
import typing_extensions
|
|
7
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
8
|
+
from ..core.serialization import FieldMetadata
|
|
9
|
+
from .access_token import AccessToken
|
|
10
|
+
from .organization_membership import OrganizationMembership
|
|
11
|
+
from .personal_access_token_principal_account_type import PersonalAccessTokenPrincipalAccountType
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class PersonalAccessTokenPrincipal(UniversalBaseModel):
|
|
15
|
+
id: typing.Optional[str] = None
|
|
16
|
+
access_token: typing_extensions.Annotated[typing.Optional[AccessToken], FieldMetadata(alias="accessToken")] = None
|
|
17
|
+
account_type: typing_extensions.Annotated[
|
|
18
|
+
typing.Optional[PersonalAccessTokenPrincipalAccountType], FieldMetadata(alias="accountType")
|
|
19
|
+
] = None
|
|
20
|
+
organization_memberships: typing_extensions.Annotated[
|
|
21
|
+
typing.Optional[typing.List[OrganizationMembership]], FieldMetadata(alias="organizationMemberships")
|
|
22
|
+
] = None
|
|
23
|
+
|
|
24
|
+
if IS_PYDANTIC_V2:
|
|
25
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
26
|
+
else:
|
|
27
|
+
|
|
28
|
+
class Config:
|
|
29
|
+
frozen = True
|
|
30
|
+
smart_union = True
|
|
31
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
import pydantic
|
|
7
|
+
import typing_extensions
|
|
8
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
9
|
+
from ..core.serialization import FieldMetadata
|
|
10
|
+
from .service_execution_status import ServiceExecutionStatus
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ServiceExecution(UniversalBaseModel):
|
|
14
|
+
id: typing.Optional[str] = None
|
|
15
|
+
created_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="createdAt")] = None
|
|
16
|
+
started_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="startedAt")] = None
|
|
17
|
+
ended_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="endedAt")] = None
|
|
18
|
+
status: typing.Optional[ServiceExecutionStatus] = None
|
|
19
|
+
|
|
20
|
+
if IS_PYDANTIC_V2:
|
|
21
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
22
|
+
else:
|
|
23
|
+
|
|
24
|
+
class Config:
|
|
25
|
+
frozen = True
|
|
26
|
+
smart_union = True
|
|
27
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import typing
|
|
6
|
+
|
|
7
|
+
import pydantic
|
|
8
|
+
import typing_extensions
|
|
9
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs
|
|
10
|
+
from ..core.serialization import FieldMetadata
|
|
11
|
+
from .service_execution import ServiceExecution
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class ServiceExecutionTokenPrincipal(UniversalBaseModel):
|
|
15
|
+
service_execution: typing_extensions.Annotated[
|
|
16
|
+
typing.Optional[ServiceExecution], FieldMetadata(alias="serviceExecution")
|
|
17
|
+
] = None
|
|
18
|
+
service_provider: typing_extensions.Annotated[
|
|
19
|
+
typing.Optional["UserContext"], FieldMetadata(alias="serviceProvider")
|
|
20
|
+
] = None
|
|
21
|
+
|
|
22
|
+
if IS_PYDANTIC_V2:
|
|
23
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
24
|
+
else:
|
|
25
|
+
|
|
26
|
+
class Config:
|
|
27
|
+
frozen = True
|
|
28
|
+
smart_union = True
|
|
29
|
+
extra = pydantic.Extra.allow
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
from .user_context import UserContext # noqa: E402, F401, I001
|
|
33
|
+
|
|
34
|
+
update_forward_refs(ServiceExecutionTokenPrincipal)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import typing
|
|
6
|
+
|
|
7
|
+
import pydantic
|
|
8
|
+
import typing_extensions
|
|
9
|
+
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs
|
|
10
|
+
from ..core.serialization import FieldMetadata
|
|
11
|
+
from .user_context_account_type import UserContextAccountType
|
|
12
|
+
from .user_context_context_type import UserContextContextType
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class UserContext(UniversalBaseModel):
|
|
16
|
+
id: typing.Optional[str] = None
|
|
17
|
+
context_type: typing_extensions.Annotated[
|
|
18
|
+
typing.Optional[UserContextContextType], FieldMetadata(alias="contextType")
|
|
19
|
+
] = None
|
|
20
|
+
account_type: typing_extensions.Annotated[
|
|
21
|
+
typing.Optional[UserContextAccountType], FieldMetadata(alias="accountType")
|
|
22
|
+
] = None
|
|
23
|
+
parent: typing.Optional["UserContext"] = None
|
|
24
|
+
|
|
25
|
+
if IS_PYDANTIC_V2:
|
|
26
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
27
|
+
else:
|
|
28
|
+
|
|
29
|
+
class Config:
|
|
30
|
+
frozen = True
|
|
31
|
+
smart_union = True
|
|
32
|
+
extra = pydantic.Extra.allow
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
update_forward_refs(UserContext)
|
package/pyproject.toml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "planqk-api-sdk"
|
|
3
|
-
version = "1.0
|
|
3
|
+
version = "1.2.0"
|
|
4
4
|
description = "SDK to interact with the official PLANQK API."
|
|
5
5
|
authors = [
|
|
6
6
|
{ name = "Kipu Quantum GmbH", email = "info@kipu-quantum.com" },
|
|
@@ -49,3 +49,8 @@ include = ["planqk*"]
|
|
|
49
49
|
ignore-paths = '^planqk/api/sdk/.*$'
|
|
50
50
|
max-line-length = 120
|
|
51
51
|
disable = ['missing-module-docstring', 'missing-class-docstring', 'missing-function-docstring']
|
|
52
|
+
|
|
53
|
+
[tool.uv.workspace]
|
|
54
|
+
members = [
|
|
55
|
+
"python-test-app",
|
|
56
|
+
]
|
package/src/Client.ts
CHANGED
|
@@ -6,13 +6,16 @@ import * as environments from "./environments.js";
|
|
|
6
6
|
import * as core from "./core/index.js";
|
|
7
7
|
import { mergeHeaders } from "./core/headers.js";
|
|
8
8
|
import { DataPools } from "./api/resources/dataPools/client/Client.js";
|
|
9
|
+
import { Authentication } from "./api/resources/authentication/client/Client.js";
|
|
9
10
|
|
|
10
11
|
export declare namespace PlanqkApiClient {
|
|
11
12
|
export interface Options {
|
|
12
13
|
environment?: core.Supplier<environments.PlanqkApiEnvironment | string>;
|
|
13
14
|
/** Specify a custom URL to connect the client to. */
|
|
14
15
|
baseUrl?: core.Supplier<string>;
|
|
15
|
-
apiKey
|
|
16
|
+
apiKey?: core.Supplier<string | undefined>;
|
|
17
|
+
/** Override the X-OrganizationId header */
|
|
18
|
+
organizationId?: core.Supplier<string | undefined>;
|
|
16
19
|
/** Additional headers to include in requests. */
|
|
17
20
|
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
18
21
|
}
|
|
@@ -24,6 +27,8 @@ export declare namespace PlanqkApiClient {
|
|
|
24
27
|
maxRetries?: number;
|
|
25
28
|
/** A hook to abort the request. */
|
|
26
29
|
abortSignal?: AbortSignal;
|
|
30
|
+
/** Override the X-OrganizationId header */
|
|
31
|
+
organizationId?: string | undefined;
|
|
27
32
|
/** Additional headers to include in the request. */
|
|
28
33
|
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
29
34
|
}
|
|
@@ -32,12 +37,14 @@ export declare namespace PlanqkApiClient {
|
|
|
32
37
|
export class PlanqkApiClient {
|
|
33
38
|
protected readonly _options: PlanqkApiClient.Options;
|
|
34
39
|
protected _dataPools: DataPools | undefined;
|
|
40
|
+
protected _authentication: Authentication | undefined;
|
|
35
41
|
|
|
36
|
-
constructor(_options: PlanqkApiClient.Options) {
|
|
42
|
+
constructor(_options: PlanqkApiClient.Options = {}) {
|
|
37
43
|
this._options = {
|
|
38
44
|
..._options,
|
|
39
45
|
headers: mergeHeaders(
|
|
40
46
|
{
|
|
47
|
+
"X-OrganizationId": _options?.organizationId,
|
|
41
48
|
"X-Fern-Language": "JavaScript",
|
|
42
49
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
43
50
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
@@ -50,4 +57,8 @@ export class PlanqkApiClient {
|
|
|
50
57
|
public get dataPools(): DataPools {
|
|
51
58
|
return (this._dataPools ??= new DataPools(this._options));
|
|
52
59
|
}
|
|
60
|
+
|
|
61
|
+
public get authentication(): Authentication {
|
|
62
|
+
return (this._authentication ??= new Authentication(this._options));
|
|
63
|
+
}
|
|
53
64
|
}
|
package/src/api/index.ts
CHANGED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as environments from "../../../../environments.js";
|
|
6
|
+
import * as core from "../../../../core/index.js";
|
|
7
|
+
import * as PlanqkApi from "../../../index.js";
|
|
8
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js";
|
|
9
|
+
import * as errors from "../../../../errors/index.js";
|
|
10
|
+
|
|
11
|
+
export declare namespace Authentication {
|
|
12
|
+
export interface Options {
|
|
13
|
+
environment?: core.Supplier<environments.PlanqkApiEnvironment | string>;
|
|
14
|
+
/** Specify a custom URL to connect the client to. */
|
|
15
|
+
baseUrl?: core.Supplier<string>;
|
|
16
|
+
apiKey?: core.Supplier<string | undefined>;
|
|
17
|
+
/** Override the X-OrganizationId header */
|
|
18
|
+
organizationId?: core.Supplier<string | undefined>;
|
|
19
|
+
/** Additional headers to include in requests. */
|
|
20
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface RequestOptions {
|
|
24
|
+
/** The maximum time to wait for a response in seconds. */
|
|
25
|
+
timeoutInSeconds?: number;
|
|
26
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
27
|
+
maxRetries?: number;
|
|
28
|
+
/** A hook to abort the request. */
|
|
29
|
+
abortSignal?: AbortSignal;
|
|
30
|
+
/** Override the X-OrganizationId header */
|
|
31
|
+
organizationId?: string | undefined;
|
|
32
|
+
/** Additional headers to include in the request. */
|
|
33
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Endpoints for checking authentication and authorization.
|
|
39
|
+
*/
|
|
40
|
+
export class Authentication {
|
|
41
|
+
protected readonly _options: Authentication.Options;
|
|
42
|
+
|
|
43
|
+
constructor(_options: Authentication.Options = {}) {
|
|
44
|
+
this._options = _options;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Get the authenticated principal based on the provided token.
|
|
49
|
+
*
|
|
50
|
+
* @param {Authentication.RequestOptions} requestOptions - Request-specific configuration.
|
|
51
|
+
*
|
|
52
|
+
* @throws {@link PlanqkApi.UnauthorizedError}
|
|
53
|
+
* @throws {@link PlanqkApi.ForbiddenError}
|
|
54
|
+
* @throws {@link PlanqkApi.NotFoundError}
|
|
55
|
+
* @throws {@link PlanqkApi.InternalServerError}
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* await client.authentication.authorize()
|
|
59
|
+
*/
|
|
60
|
+
public authorize(
|
|
61
|
+
requestOptions?: Authentication.RequestOptions,
|
|
62
|
+
): core.HttpResponsePromise<PlanqkApi.AuthorizeResponse> {
|
|
63
|
+
return core.HttpResponsePromise.fromPromise(this.__authorize(requestOptions));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
private async __authorize(
|
|
67
|
+
requestOptions?: Authentication.RequestOptions,
|
|
68
|
+
): Promise<core.WithRawResponse<PlanqkApi.AuthorizeResponse>> {
|
|
69
|
+
const _response = await core.fetcher({
|
|
70
|
+
url: core.url.join(
|
|
71
|
+
(await core.Supplier.get(this._options.baseUrl)) ??
|
|
72
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
73
|
+
environments.PlanqkApiEnvironment.Default,
|
|
74
|
+
"authorize",
|
|
75
|
+
),
|
|
76
|
+
method: "POST",
|
|
77
|
+
headers: mergeHeaders(
|
|
78
|
+
this._options?.headers,
|
|
79
|
+
mergeOnlyDefinedHeaders({
|
|
80
|
+
"X-OrganizationId": requestOptions?.organizationId,
|
|
81
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
82
|
+
}),
|
|
83
|
+
requestOptions?.headers,
|
|
84
|
+
),
|
|
85
|
+
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
86
|
+
maxRetries: requestOptions?.maxRetries,
|
|
87
|
+
withCredentials: true,
|
|
88
|
+
abortSignal: requestOptions?.abortSignal,
|
|
89
|
+
});
|
|
90
|
+
if (_response.ok) {
|
|
91
|
+
return { data: _response.body as PlanqkApi.AuthorizeResponse, rawResponse: _response.rawResponse };
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (_response.error.reason === "status-code") {
|
|
95
|
+
switch (_response.error.statusCode) {
|
|
96
|
+
case 401:
|
|
97
|
+
throw new PlanqkApi.UnauthorizedError(_response.error.body as any, _response.rawResponse);
|
|
98
|
+
case 403:
|
|
99
|
+
throw new PlanqkApi.ForbiddenError(_response.error.body as any, _response.rawResponse);
|
|
100
|
+
case 404:
|
|
101
|
+
throw new PlanqkApi.NotFoundError(_response.error.body as any, _response.rawResponse);
|
|
102
|
+
case 500:
|
|
103
|
+
throw new PlanqkApi.InternalServerError(_response.error.body as any, _response.rawResponse);
|
|
104
|
+
default:
|
|
105
|
+
throw new errors.PlanqkApiError({
|
|
106
|
+
statusCode: _response.error.statusCode,
|
|
107
|
+
body: _response.error.body,
|
|
108
|
+
rawResponse: _response.rawResponse,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
switch (_response.error.reason) {
|
|
114
|
+
case "non-json":
|
|
115
|
+
throw new errors.PlanqkApiError({
|
|
116
|
+
statusCode: _response.error.statusCode,
|
|
117
|
+
body: _response.error.rawBody,
|
|
118
|
+
rawResponse: _response.rawResponse,
|
|
119
|
+
});
|
|
120
|
+
case "timeout":
|
|
121
|
+
throw new errors.PlanqkApiTimeoutError("Timeout exceeded when calling POST /authorize.");
|
|
122
|
+
case "unknown":
|
|
123
|
+
throw new errors.PlanqkApiError({
|
|
124
|
+
message: _response.error.errorMessage,
|
|
125
|
+
rawResponse: _response.rawResponse,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
protected async _getCustomAuthorizationHeaders() {
|
|
131
|
+
const apiKeyValue = await core.Supplier.get(this._options.apiKey);
|
|
132
|
+
return { "X-Auth-Token": apiKeyValue };
|
|
133
|
+
}
|
|
134
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./AuthorizeResponse.js";
|
|
@@ -14,7 +14,9 @@ export declare namespace DataPools {
|
|
|
14
14
|
environment?: core.Supplier<environments.PlanqkApiEnvironment | string>;
|
|
15
15
|
/** Specify a custom URL to connect the client to. */
|
|
16
16
|
baseUrl?: core.Supplier<string>;
|
|
17
|
-
apiKey
|
|
17
|
+
apiKey?: core.Supplier<string | undefined>;
|
|
18
|
+
/** Override the X-OrganizationId header */
|
|
19
|
+
organizationId?: core.Supplier<string | undefined>;
|
|
18
20
|
/** Additional headers to include in requests. */
|
|
19
21
|
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
20
22
|
}
|
|
@@ -26,15 +28,20 @@ export declare namespace DataPools {
|
|
|
26
28
|
maxRetries?: number;
|
|
27
29
|
/** A hook to abort the request. */
|
|
28
30
|
abortSignal?: AbortSignal;
|
|
31
|
+
/** Override the X-OrganizationId header */
|
|
32
|
+
organizationId?: string | undefined;
|
|
29
33
|
/** Additional headers to include in the request. */
|
|
30
34
|
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
31
35
|
}
|
|
32
36
|
}
|
|
33
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Manage data pools, which are organized collections of files that serve as reusable data sources for services.
|
|
40
|
+
*/
|
|
34
41
|
export class DataPools {
|
|
35
42
|
protected readonly _options: DataPools.Options;
|
|
36
43
|
|
|
37
|
-
constructor(_options: DataPools.Options) {
|
|
44
|
+
constructor(_options: DataPools.Options = {}) {
|
|
38
45
|
this._options = _options;
|
|
39
46
|
}
|
|
40
47
|
|
|
@@ -73,7 +80,10 @@ export class DataPools {
|
|
|
73
80
|
method: "GET",
|
|
74
81
|
headers: mergeHeaders(
|
|
75
82
|
this._options?.headers,
|
|
76
|
-
mergeOnlyDefinedHeaders({
|
|
83
|
+
mergeOnlyDefinedHeaders({
|
|
84
|
+
"X-OrganizationId": requestOptions?.organizationId,
|
|
85
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
86
|
+
}),
|
|
77
87
|
requestOptions?.headers,
|
|
78
88
|
),
|
|
79
89
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -160,7 +170,10 @@ export class DataPools {
|
|
|
160
170
|
method: "PUT",
|
|
161
171
|
headers: mergeHeaders(
|
|
162
172
|
this._options?.headers,
|
|
163
|
-
mergeOnlyDefinedHeaders({
|
|
173
|
+
mergeOnlyDefinedHeaders({
|
|
174
|
+
"X-OrganizationId": requestOptions?.organizationId,
|
|
175
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
176
|
+
}),
|
|
164
177
|
requestOptions?.headers,
|
|
165
178
|
),
|
|
166
179
|
contentType: "application/json",
|
|
@@ -245,7 +258,10 @@ export class DataPools {
|
|
|
245
258
|
method: "DELETE",
|
|
246
259
|
headers: mergeHeaders(
|
|
247
260
|
this._options?.headers,
|
|
248
|
-
mergeOnlyDefinedHeaders({
|
|
261
|
+
mergeOnlyDefinedHeaders({
|
|
262
|
+
"X-OrganizationId": requestOptions?.organizationId,
|
|
263
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
264
|
+
}),
|
|
249
265
|
requestOptions?.headers,
|
|
250
266
|
),
|
|
251
267
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -323,7 +339,10 @@ export class DataPools {
|
|
|
323
339
|
method: "GET",
|
|
324
340
|
headers: mergeHeaders(
|
|
325
341
|
this._options?.headers,
|
|
326
|
-
mergeOnlyDefinedHeaders({
|
|
342
|
+
mergeOnlyDefinedHeaders({
|
|
343
|
+
"X-OrganizationId": requestOptions?.organizationId,
|
|
344
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
345
|
+
}),
|
|
327
346
|
requestOptions?.headers,
|
|
328
347
|
),
|
|
329
348
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -407,7 +426,10 @@ export class DataPools {
|
|
|
407
426
|
method: "POST",
|
|
408
427
|
headers: mergeHeaders(
|
|
409
428
|
this._options?.headers,
|
|
410
|
-
mergeOnlyDefinedHeaders({
|
|
429
|
+
mergeOnlyDefinedHeaders({
|
|
430
|
+
"X-OrganizationId": requestOptions?.organizationId,
|
|
431
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
432
|
+
}),
|
|
411
433
|
requestOptions?.headers,
|
|
412
434
|
),
|
|
413
435
|
contentType: "application/json",
|
|
@@ -495,7 +517,10 @@ export class DataPools {
|
|
|
495
517
|
method: "GET",
|
|
496
518
|
headers: mergeHeaders(
|
|
497
519
|
this._options?.headers,
|
|
498
|
-
mergeOnlyDefinedHeaders({
|
|
520
|
+
mergeOnlyDefinedHeaders({
|
|
521
|
+
"X-OrganizationId": requestOptions?.organizationId,
|
|
522
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
523
|
+
}),
|
|
499
524
|
requestOptions?.headers,
|
|
500
525
|
),
|
|
501
526
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -593,6 +618,7 @@ export class DataPools {
|
|
|
593
618
|
headers: mergeHeaders(
|
|
594
619
|
this._options?.headers,
|
|
595
620
|
mergeOnlyDefinedHeaders({
|
|
621
|
+
"X-OrganizationId": requestOptions?.organizationId,
|
|
596
622
|
...(await this._getCustomAuthorizationHeaders()),
|
|
597
623
|
..._maybeEncodedRequest.headers,
|
|
598
624
|
}),
|
|
@@ -679,7 +705,10 @@ export class DataPools {
|
|
|
679
705
|
method: "GET",
|
|
680
706
|
headers: mergeHeaders(
|
|
681
707
|
this._options?.headers,
|
|
682
|
-
mergeOnlyDefinedHeaders({
|
|
708
|
+
mergeOnlyDefinedHeaders({
|
|
709
|
+
"X-OrganizationId": requestOptions?.organizationId,
|
|
710
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
711
|
+
}),
|
|
683
712
|
requestOptions?.headers,
|
|
684
713
|
),
|
|
685
714
|
responseType: "binary-response",
|
|
@@ -768,7 +797,10 @@ export class DataPools {
|
|
|
768
797
|
method: "DELETE",
|
|
769
798
|
headers: mergeHeaders(
|
|
770
799
|
this._options?.headers,
|
|
771
|
-
mergeOnlyDefinedHeaders({
|
|
800
|
+
mergeOnlyDefinedHeaders({
|
|
801
|
+
"X-OrganizationId": requestOptions?.organizationId,
|
|
802
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
803
|
+
}),
|
|
772
804
|
requestOptions?.headers,
|
|
773
805
|
),
|
|
774
806
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export interface OrganizationMembership {
|
|
6
|
+
id?: string;
|
|
7
|
+
accountType?: OrganizationMembership.AccountType;
|
|
8
|
+
role?: OrganizationMembership.Role;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export namespace OrganizationMembership {
|
|
12
|
+
export type AccountType = "BASIC" | "PRO" | "BUSINESS";
|
|
13
|
+
export const AccountType = {
|
|
14
|
+
Basic: "BASIC",
|
|
15
|
+
Pro: "PRO",
|
|
16
|
+
Business: "BUSINESS",
|
|
17
|
+
} as const;
|
|
18
|
+
export type Role = "VIEWER" | "MAINTAINER" | "OWNER";
|
|
19
|
+
export const Role = {
|
|
20
|
+
Viewer: "VIEWER",
|
|
21
|
+
Maintainer: "MAINTAINER",
|
|
22
|
+
Owner: "OWNER",
|
|
23
|
+
} as const;
|
|
24
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as PlanqkApi from "../index.js";
|
|
6
|
+
|
|
7
|
+
export interface PersonalAccessTokenPrincipal {
|
|
8
|
+
id?: string;
|
|
9
|
+
accessToken?: PlanqkApi.AccessToken;
|
|
10
|
+
accountType?: PersonalAccessTokenPrincipal.AccountType;
|
|
11
|
+
organizationMemberships?: PlanqkApi.OrganizationMembership[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export namespace PersonalAccessTokenPrincipal {
|
|
15
|
+
export type AccountType = "BASIC" | "PRO" | "BUSINESS";
|
|
16
|
+
export const AccountType = {
|
|
17
|
+
Basic: "BASIC",
|
|
18
|
+
Pro: "PRO",
|
|
19
|
+
Business: "BUSINESS",
|
|
20
|
+
} as const;
|
|
21
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export interface ServiceExecution {
|
|
6
|
+
id?: string;
|
|
7
|
+
createdAt?: string;
|
|
8
|
+
startedAt?: string;
|
|
9
|
+
endedAt?: string;
|
|
10
|
+
status?: ServiceExecution.Status;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export namespace ServiceExecution {
|
|
14
|
+
export type Status = "UNKNOWN" | "PENDING" | "RUNNING" | "SUCCEEDED" | "FAILED";
|
|
15
|
+
export const Status = {
|
|
16
|
+
Unknown: "UNKNOWN",
|
|
17
|
+
Pending: "PENDING",
|
|
18
|
+
Running: "RUNNING",
|
|
19
|
+
Succeeded: "SUCCEEDED",
|
|
20
|
+
Failed: "FAILED",
|
|
21
|
+
} as const;
|
|
22
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as PlanqkApi from "../index.js";
|
|
6
|
+
|
|
7
|
+
export interface ServiceExecutionTokenPrincipal {
|
|
8
|
+
serviceExecution?: PlanqkApi.ServiceExecution;
|
|
9
|
+
serviceProvider?: PlanqkApi.UserContext;
|
|
10
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as PlanqkApi from "../index.js";
|
|
6
|
+
|
|
7
|
+
export interface UserContext {
|
|
8
|
+
id?: string;
|
|
9
|
+
contextType?: UserContext.ContextType;
|
|
10
|
+
accountType?: UserContext.AccountType;
|
|
11
|
+
parent?: PlanqkApi.UserContext;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export namespace UserContext {
|
|
15
|
+
export type ContextType = "USER" | "ORGANIZATION" | "SERVICE_EXECUTION";
|
|
16
|
+
export const ContextType = {
|
|
17
|
+
User: "USER",
|
|
18
|
+
Organization: "ORGANIZATION",
|
|
19
|
+
ServiceExecution: "SERVICE_EXECUTION",
|
|
20
|
+
} as const;
|
|
21
|
+
export type AccountType = "BASIC" | "PRO" | "BUSINESS";
|
|
22
|
+
export const AccountType = {
|
|
23
|
+
Basic: "BASIC",
|
|
24
|
+
Pro: "PRO",
|
|
25
|
+
Business: "BUSINESS",
|
|
26
|
+
} as const;
|
|
27
|
+
}
|
package/src/api/types/index.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
export * from "./OauthScope.js";
|
|
2
2
|
export * from "./DataPoolDto.js";
|
|
3
3
|
export * from "./DataPoolFileDto.js";
|
|
4
|
+
export * from "./AccessToken.js";
|
|
5
|
+
export * from "./OrganizationMembership.js";
|
|
6
|
+
export * from "./PersonalAccessTokenPrincipal.js";
|
|
7
|
+
export * from "./ServiceExecution.js";
|
|
8
|
+
export * from "./ServiceExecutionTokenPrincipal.js";
|
|
9
|
+
export * from "./UserContext.js";
|