@planqk/planqk-api-sdk 1.1.0 → 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 -3
- package/dist/Client.js +7 -2
- 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 +1 -5
- 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 +1 -1
- package/src/Client.ts +13 -4
- 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/dist/Client.d.ts
CHANGED
|
@@ -4,13 +4,15 @@
|
|
|
4
4
|
import * as environments from "./environments.js";
|
|
5
5
|
import * as core from "./core/index.js";
|
|
6
6
|
import { DataPools } from "./api/resources/dataPools/client/Client.js";
|
|
7
|
+
import { Authentication } from "./api/resources/authentication/client/Client.js";
|
|
7
8
|
export declare namespace PlanqkApiClient {
|
|
8
9
|
interface Options {
|
|
9
10
|
environment?: core.Supplier<environments.PlanqkApiEnvironment | string>;
|
|
10
11
|
/** Specify a custom URL to connect the client to. */
|
|
11
12
|
baseUrl?: core.Supplier<string>;
|
|
12
|
-
apiKey
|
|
13
|
-
|
|
13
|
+
apiKey?: core.Supplier<string | undefined>;
|
|
14
|
+
/** Override the X-OrganizationId header */
|
|
15
|
+
organizationId?: core.Supplier<string | undefined>;
|
|
14
16
|
/** Additional headers to include in requests. */
|
|
15
17
|
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
16
18
|
}
|
|
@@ -21,6 +23,8 @@ export declare namespace PlanqkApiClient {
|
|
|
21
23
|
maxRetries?: number;
|
|
22
24
|
/** A hook to abort the request. */
|
|
23
25
|
abortSignal?: AbortSignal;
|
|
26
|
+
/** Override the X-OrganizationId header */
|
|
27
|
+
organizationId?: string | undefined;
|
|
24
28
|
/** Additional headers to include in the request. */
|
|
25
29
|
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
26
30
|
}
|
|
@@ -28,6 +32,8 @@ export declare namespace PlanqkApiClient {
|
|
|
28
32
|
export declare class PlanqkApiClient {
|
|
29
33
|
protected readonly _options: PlanqkApiClient.Options;
|
|
30
34
|
protected _dataPools: DataPools | undefined;
|
|
31
|
-
|
|
35
|
+
protected _authentication: Authentication | undefined;
|
|
36
|
+
constructor(_options?: PlanqkApiClient.Options);
|
|
32
37
|
get dataPools(): DataPools;
|
|
38
|
+
get authentication(): Authentication;
|
|
33
39
|
}
|
package/dist/Client.js
CHANGED
|
@@ -40,22 +40,27 @@ exports.PlanqkApiClient = void 0;
|
|
|
40
40
|
const core = __importStar(require("./core/index.js"));
|
|
41
41
|
const headers_js_1 = require("./core/headers.js");
|
|
42
42
|
const Client_js_1 = require("./api/resources/dataPools/client/Client.js");
|
|
43
|
+
const Client_js_2 = require("./api/resources/authentication/client/Client.js");
|
|
43
44
|
class PlanqkApiClient {
|
|
44
45
|
_options;
|
|
45
46
|
_dataPools;
|
|
46
|
-
|
|
47
|
+
_authentication;
|
|
48
|
+
constructor(_options = {}) {
|
|
47
49
|
this._options = {
|
|
48
50
|
..._options,
|
|
49
51
|
headers: (0, headers_js_1.mergeHeaders)({
|
|
52
|
+
"X-OrganizationId": _options?.organizationId,
|
|
50
53
|
"X-Fern-Language": "JavaScript",
|
|
51
54
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
52
55
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
53
|
-
"X-OrganizationId": _options.organizationId,
|
|
54
56
|
}, _options?.headers),
|
|
55
57
|
};
|
|
56
58
|
}
|
|
57
59
|
get dataPools() {
|
|
58
60
|
return (this._dataPools ??= new Client_js_1.DataPools(this._options));
|
|
59
61
|
}
|
|
62
|
+
get authentication() {
|
|
63
|
+
return (this._authentication ??= new Client_js_2.Authentication(this._options));
|
|
64
|
+
}
|
|
60
65
|
}
|
|
61
66
|
exports.PlanqkApiClient = PlanqkApiClient;
|
package/dist/api/index.d.ts
CHANGED
package/dist/api/index.js
CHANGED
|
@@ -14,6 +14,6 @@ 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/index.js"), exports);
|
|
17
18
|
__exportStar(require("./types/index.js"), exports);
|
|
18
19
|
__exportStar(require("./errors/index.js"), exports);
|
|
19
|
-
__exportStar(require("./resources/index.js"), exports);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../environments.js";
|
|
5
|
+
import * as core from "../../../../core/index.js";
|
|
6
|
+
import * as PlanqkApi from "../../../index.js";
|
|
7
|
+
export declare namespace Authentication {
|
|
8
|
+
interface Options {
|
|
9
|
+
environment?: core.Supplier<environments.PlanqkApiEnvironment | string>;
|
|
10
|
+
/** Specify a custom URL to connect the client to. */
|
|
11
|
+
baseUrl?: core.Supplier<string>;
|
|
12
|
+
apiKey?: core.Supplier<string | undefined>;
|
|
13
|
+
/** Override the X-OrganizationId header */
|
|
14
|
+
organizationId?: core.Supplier<string | undefined>;
|
|
15
|
+
/** Additional headers to include in requests. */
|
|
16
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
17
|
+
}
|
|
18
|
+
interface RequestOptions {
|
|
19
|
+
/** The maximum time to wait for a response in seconds. */
|
|
20
|
+
timeoutInSeconds?: number;
|
|
21
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
22
|
+
maxRetries?: number;
|
|
23
|
+
/** A hook to abort the request. */
|
|
24
|
+
abortSignal?: AbortSignal;
|
|
25
|
+
/** Override the X-OrganizationId header */
|
|
26
|
+
organizationId?: string | undefined;
|
|
27
|
+
/** Additional headers to include in the request. */
|
|
28
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Endpoints for checking authentication and authorization.
|
|
33
|
+
*/
|
|
34
|
+
export declare class Authentication {
|
|
35
|
+
protected readonly _options: Authentication.Options;
|
|
36
|
+
constructor(_options?: Authentication.Options);
|
|
37
|
+
/**
|
|
38
|
+
* Get the authenticated principal based on the provided token.
|
|
39
|
+
*
|
|
40
|
+
* @param {Authentication.RequestOptions} requestOptions - Request-specific configuration.
|
|
41
|
+
*
|
|
42
|
+
* @throws {@link PlanqkApi.UnauthorizedError}
|
|
43
|
+
* @throws {@link PlanqkApi.ForbiddenError}
|
|
44
|
+
* @throws {@link PlanqkApi.NotFoundError}
|
|
45
|
+
* @throws {@link PlanqkApi.InternalServerError}
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* await client.authentication.authorize()
|
|
49
|
+
*/
|
|
50
|
+
authorize(requestOptions?: Authentication.RequestOptions): core.HttpResponsePromise<PlanqkApi.AuthorizeResponse>;
|
|
51
|
+
private __authorize;
|
|
52
|
+
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
53
|
+
"X-Auth-Token": string | undefined;
|
|
54
|
+
}>;
|
|
55
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
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
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.Authentication = void 0;
|
|
40
|
+
const environments = __importStar(require("../../../../environments.js"));
|
|
41
|
+
const core = __importStar(require("../../../../core/index.js"));
|
|
42
|
+
const PlanqkApi = __importStar(require("../../../index.js"));
|
|
43
|
+
const headers_js_1 = require("../../../../core/headers.js");
|
|
44
|
+
const errors = __importStar(require("../../../../errors/index.js"));
|
|
45
|
+
/**
|
|
46
|
+
* Endpoints for checking authentication and authorization.
|
|
47
|
+
*/
|
|
48
|
+
class Authentication {
|
|
49
|
+
_options;
|
|
50
|
+
constructor(_options = {}) {
|
|
51
|
+
this._options = _options;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Get the authenticated principal based on the provided token.
|
|
55
|
+
*
|
|
56
|
+
* @param {Authentication.RequestOptions} requestOptions - Request-specific configuration.
|
|
57
|
+
*
|
|
58
|
+
* @throws {@link PlanqkApi.UnauthorizedError}
|
|
59
|
+
* @throws {@link PlanqkApi.ForbiddenError}
|
|
60
|
+
* @throws {@link PlanqkApi.NotFoundError}
|
|
61
|
+
* @throws {@link PlanqkApi.InternalServerError}
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* await client.authentication.authorize()
|
|
65
|
+
*/
|
|
66
|
+
authorize(requestOptions) {
|
|
67
|
+
return core.HttpResponsePromise.fromPromise(this.__authorize(requestOptions));
|
|
68
|
+
}
|
|
69
|
+
async __authorize(requestOptions) {
|
|
70
|
+
const _response = await core.fetcher({
|
|
71
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
72
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
73
|
+
environments.PlanqkApiEnvironment.Default, "authorize"),
|
|
74
|
+
method: "POST",
|
|
75
|
+
headers: (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
76
|
+
"X-OrganizationId": requestOptions?.organizationId,
|
|
77
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
78
|
+
}), requestOptions?.headers),
|
|
79
|
+
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
80
|
+
maxRetries: requestOptions?.maxRetries,
|
|
81
|
+
withCredentials: true,
|
|
82
|
+
abortSignal: requestOptions?.abortSignal,
|
|
83
|
+
});
|
|
84
|
+
if (_response.ok) {
|
|
85
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
86
|
+
}
|
|
87
|
+
if (_response.error.reason === "status-code") {
|
|
88
|
+
switch (_response.error.statusCode) {
|
|
89
|
+
case 401:
|
|
90
|
+
throw new PlanqkApi.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
91
|
+
case 403:
|
|
92
|
+
throw new PlanqkApi.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
93
|
+
case 404:
|
|
94
|
+
throw new PlanqkApi.NotFoundError(_response.error.body, _response.rawResponse);
|
|
95
|
+
case 500:
|
|
96
|
+
throw new PlanqkApi.InternalServerError(_response.error.body, _response.rawResponse);
|
|
97
|
+
default:
|
|
98
|
+
throw new errors.PlanqkApiError({
|
|
99
|
+
statusCode: _response.error.statusCode,
|
|
100
|
+
body: _response.error.body,
|
|
101
|
+
rawResponse: _response.rawResponse,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
switch (_response.error.reason) {
|
|
106
|
+
case "non-json":
|
|
107
|
+
throw new errors.PlanqkApiError({
|
|
108
|
+
statusCode: _response.error.statusCode,
|
|
109
|
+
body: _response.error.rawBody,
|
|
110
|
+
rawResponse: _response.rawResponse,
|
|
111
|
+
});
|
|
112
|
+
case "timeout":
|
|
113
|
+
throw new errors.PlanqkApiTimeoutError("Timeout exceeded when calling POST /authorize.");
|
|
114
|
+
case "unknown":
|
|
115
|
+
throw new errors.PlanqkApiError({
|
|
116
|
+
message: _response.error.errorMessage,
|
|
117
|
+
rawResponse: _response.rawResponse,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
async _getCustomAuthorizationHeaders() {
|
|
122
|
+
const apiKeyValue = await core.Supplier.get(this._options.apiKey);
|
|
123
|
+
return { "X-Auth-Token": apiKeyValue };
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
exports.Authentication = Authentication;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
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("./types/index.js"), exports);
|
|
18
|
+
__exportStar(require("./client/index.js"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./AuthorizeResponse.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
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("./AuthorizeResponse.js"), exports);
|
|
@@ -9,7 +9,9 @@ export declare namespace DataPools {
|
|
|
9
9
|
environment?: core.Supplier<environments.PlanqkApiEnvironment | string>;
|
|
10
10
|
/** Specify a custom URL to connect the client to. */
|
|
11
11
|
baseUrl?: core.Supplier<string>;
|
|
12
|
-
apiKey
|
|
12
|
+
apiKey?: core.Supplier<string | undefined>;
|
|
13
|
+
/** Override the X-OrganizationId header */
|
|
14
|
+
organizationId?: core.Supplier<string | undefined>;
|
|
13
15
|
/** Additional headers to include in requests. */
|
|
14
16
|
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
15
17
|
}
|
|
@@ -20,13 +22,18 @@ export declare namespace DataPools {
|
|
|
20
22
|
maxRetries?: number;
|
|
21
23
|
/** A hook to abort the request. */
|
|
22
24
|
abortSignal?: AbortSignal;
|
|
25
|
+
/** Override the X-OrganizationId header */
|
|
26
|
+
organizationId?: string | undefined;
|
|
23
27
|
/** Additional headers to include in the request. */
|
|
24
28
|
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
25
29
|
}
|
|
26
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Manage data pools, which are organized collections of files that serve as reusable data sources for services.
|
|
33
|
+
*/
|
|
27
34
|
export declare class DataPools {
|
|
28
35
|
protected readonly _options: DataPools.Options;
|
|
29
|
-
constructor(_options
|
|
36
|
+
constructor(_options?: DataPools.Options);
|
|
30
37
|
/**
|
|
31
38
|
* Get a specific data pool (identified by its ID).
|
|
32
39
|
*
|
|
@@ -172,6 +179,6 @@ export declare class DataPools {
|
|
|
172
179
|
deleteDataPoolFile(id: string, fileId: string, requestOptions?: DataPools.RequestOptions): core.HttpResponsePromise<void>;
|
|
173
180
|
private __deleteDataPoolFile;
|
|
174
181
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
175
|
-
"X-Auth-Token": string;
|
|
182
|
+
"X-Auth-Token": string | undefined;
|
|
176
183
|
}>;
|
|
177
184
|
}
|
|
@@ -42,9 +42,12 @@ const core = __importStar(require("../../../../core/index.js"));
|
|
|
42
42
|
const PlanqkApi = __importStar(require("../../../index.js"));
|
|
43
43
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
44
44
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
45
|
+
/**
|
|
46
|
+
* Manage data pools, which are organized collections of files that serve as reusable data sources for services.
|
|
47
|
+
*/
|
|
45
48
|
class DataPools {
|
|
46
49
|
_options;
|
|
47
|
-
constructor(_options) {
|
|
50
|
+
constructor(_options = {}) {
|
|
48
51
|
this._options = _options;
|
|
49
52
|
}
|
|
50
53
|
/**
|
|
@@ -70,7 +73,10 @@ class DataPools {
|
|
|
70
73
|
(await core.Supplier.get(this._options.environment)) ??
|
|
71
74
|
environments.PlanqkApiEnvironment.Default, `datapools/${encodeURIComponent(id)}`),
|
|
72
75
|
method: "GET",
|
|
73
|
-
headers: (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
76
|
+
headers: (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
77
|
+
"X-OrganizationId": requestOptions?.organizationId,
|
|
78
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
79
|
+
}), requestOptions?.headers),
|
|
74
80
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
75
81
|
maxRetries: requestOptions?.maxRetries,
|
|
76
82
|
withCredentials: true,
|
|
@@ -138,7 +144,10 @@ class DataPools {
|
|
|
138
144
|
(await core.Supplier.get(this._options.environment)) ??
|
|
139
145
|
environments.PlanqkApiEnvironment.Default, `datapools/${encodeURIComponent(id)}`),
|
|
140
146
|
method: "PUT",
|
|
141
|
-
headers: (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
147
|
+
headers: (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
148
|
+
"X-OrganizationId": requestOptions?.organizationId,
|
|
149
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
150
|
+
}), requestOptions?.headers),
|
|
142
151
|
contentType: "application/json",
|
|
143
152
|
requestType: "json",
|
|
144
153
|
body: request,
|
|
@@ -209,7 +218,10 @@ class DataPools {
|
|
|
209
218
|
(await core.Supplier.get(this._options.environment)) ??
|
|
210
219
|
environments.PlanqkApiEnvironment.Default, `datapools/${encodeURIComponent(id)}`),
|
|
211
220
|
method: "DELETE",
|
|
212
|
-
headers: (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
221
|
+
headers: (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
222
|
+
"X-OrganizationId": requestOptions?.organizationId,
|
|
223
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
224
|
+
}), requestOptions?.headers),
|
|
213
225
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
214
226
|
maxRetries: requestOptions?.maxRetries,
|
|
215
227
|
withCredentials: true,
|
|
@@ -274,7 +286,10 @@ class DataPools {
|
|
|
274
286
|
(await core.Supplier.get(this._options.environment)) ??
|
|
275
287
|
environments.PlanqkApiEnvironment.Default, "datapools"),
|
|
276
288
|
method: "GET",
|
|
277
|
-
headers: (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
289
|
+
headers: (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
290
|
+
"X-OrganizationId": requestOptions?.organizationId,
|
|
291
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
292
|
+
}), requestOptions?.headers),
|
|
278
293
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
279
294
|
maxRetries: requestOptions?.maxRetries,
|
|
280
295
|
withCredentials: true,
|
|
@@ -341,7 +356,10 @@ class DataPools {
|
|
|
341
356
|
(await core.Supplier.get(this._options.environment)) ??
|
|
342
357
|
environments.PlanqkApiEnvironment.Default, "datapools"),
|
|
343
358
|
method: "POST",
|
|
344
|
-
headers: (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
359
|
+
headers: (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
360
|
+
"X-OrganizationId": requestOptions?.organizationId,
|
|
361
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
362
|
+
}), requestOptions?.headers),
|
|
345
363
|
contentType: "application/json",
|
|
346
364
|
requestType: "json",
|
|
347
365
|
body: request,
|
|
@@ -412,7 +430,10 @@ class DataPools {
|
|
|
412
430
|
(await core.Supplier.get(this._options.environment)) ??
|
|
413
431
|
environments.PlanqkApiEnvironment.Default, `datapools/${encodeURIComponent(id)}/files`),
|
|
414
432
|
method: "GET",
|
|
415
|
-
headers: (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
433
|
+
headers: (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
434
|
+
"X-OrganizationId": requestOptions?.organizationId,
|
|
435
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
436
|
+
}), requestOptions?.headers),
|
|
416
437
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
417
438
|
maxRetries: requestOptions?.maxRetries,
|
|
418
439
|
withCredentials: true,
|
|
@@ -490,6 +511,7 @@ class DataPools {
|
|
|
490
511
|
environments.PlanqkApiEnvironment.Default, `datapools/${encodeURIComponent(id)}/files`),
|
|
491
512
|
method: "POST",
|
|
492
513
|
headers: (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
514
|
+
"X-OrganizationId": requestOptions?.organizationId,
|
|
493
515
|
...(await this._getCustomAuthorizationHeaders()),
|
|
494
516
|
..._maybeEncodedRequest.headers,
|
|
495
517
|
}), requestOptions?.headers),
|
|
@@ -557,7 +579,10 @@ class DataPools {
|
|
|
557
579
|
(await core.Supplier.get(this._options.environment)) ??
|
|
558
580
|
environments.PlanqkApiEnvironment.Default, `datapools/${encodeURIComponent(id)}/files/${encodeURIComponent(fileId)}`),
|
|
559
581
|
method: "GET",
|
|
560
|
-
headers: (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
582
|
+
headers: (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
583
|
+
"X-OrganizationId": requestOptions?.organizationId,
|
|
584
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
585
|
+
}), requestOptions?.headers),
|
|
561
586
|
responseType: "binary-response",
|
|
562
587
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
563
588
|
maxRetries: requestOptions?.maxRetries,
|
|
@@ -625,7 +650,10 @@ class DataPools {
|
|
|
625
650
|
(await core.Supplier.get(this._options.environment)) ??
|
|
626
651
|
environments.PlanqkApiEnvironment.Default, `datapools/${encodeURIComponent(id)}/files/${encodeURIComponent(fileId)}`),
|
|
627
652
|
method: "DELETE",
|
|
628
|
-
headers: (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
653
|
+
headers: (0, headers_js_1.mergeHeaders)(this._options?.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
654
|
+
"X-OrganizationId": requestOptions?.organizationId,
|
|
655
|
+
...(await this._getCustomAuthorizationHeaders()),
|
|
656
|
+
}), requestOptions?.headers),
|
|
629
657
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
630
658
|
maxRetries: requestOptions?.maxRetries,
|
|
631
659
|
withCredentials: true,
|
|
@@ -36,6 +36,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
36
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.dataPools = void 0;
|
|
39
|
+
exports.dataPools = exports.authentication = void 0;
|
|
40
|
+
exports.authentication = __importStar(require("./authentication/index.js"));
|
|
41
|
+
__exportStar(require("./authentication/types/index.js"), exports);
|
|
40
42
|
exports.dataPools = __importStar(require("./dataPools/index.js"));
|
|
41
43
|
__exportStar(require("./dataPools/client/requests/index.js"), exports);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export interface OrganizationMembership {
|
|
5
|
+
id?: string;
|
|
6
|
+
accountType?: OrganizationMembership.AccountType;
|
|
7
|
+
role?: OrganizationMembership.Role;
|
|
8
|
+
}
|
|
9
|
+
export declare namespace OrganizationMembership {
|
|
10
|
+
type AccountType = "BASIC" | "PRO" | "BUSINESS";
|
|
11
|
+
const AccountType: {
|
|
12
|
+
readonly Basic: "BASIC";
|
|
13
|
+
readonly Pro: "PRO";
|
|
14
|
+
readonly Business: "BUSINESS";
|
|
15
|
+
};
|
|
16
|
+
type Role = "VIEWER" | "MAINTAINER" | "OWNER";
|
|
17
|
+
const Role: {
|
|
18
|
+
readonly Viewer: "VIEWER";
|
|
19
|
+
readonly Maintainer: "MAINTAINER";
|
|
20
|
+
readonly Owner: "OWNER";
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.OrganizationMembership = void 0;
|
|
7
|
+
var OrganizationMembership;
|
|
8
|
+
(function (OrganizationMembership) {
|
|
9
|
+
OrganizationMembership.AccountType = {
|
|
10
|
+
Basic: "BASIC",
|
|
11
|
+
Pro: "PRO",
|
|
12
|
+
Business: "BUSINESS",
|
|
13
|
+
};
|
|
14
|
+
OrganizationMembership.Role = {
|
|
15
|
+
Viewer: "VIEWER",
|
|
16
|
+
Maintainer: "MAINTAINER",
|
|
17
|
+
Owner: "OWNER",
|
|
18
|
+
};
|
|
19
|
+
})(OrganizationMembership || (exports.OrganizationMembership = OrganizationMembership = {}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as PlanqkApi from "../index.js";
|
|
5
|
+
export interface PersonalAccessTokenPrincipal {
|
|
6
|
+
id?: string;
|
|
7
|
+
accessToken?: PlanqkApi.AccessToken;
|
|
8
|
+
accountType?: PersonalAccessTokenPrincipal.AccountType;
|
|
9
|
+
organizationMemberships?: PlanqkApi.OrganizationMembership[];
|
|
10
|
+
}
|
|
11
|
+
export declare namespace PersonalAccessTokenPrincipal {
|
|
12
|
+
type AccountType = "BASIC" | "PRO" | "BUSINESS";
|
|
13
|
+
const AccountType: {
|
|
14
|
+
readonly Basic: "BASIC";
|
|
15
|
+
readonly Pro: "PRO";
|
|
16
|
+
readonly Business: "BUSINESS";
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PersonalAccessTokenPrincipal = void 0;
|
|
7
|
+
var PersonalAccessTokenPrincipal;
|
|
8
|
+
(function (PersonalAccessTokenPrincipal) {
|
|
9
|
+
PersonalAccessTokenPrincipal.AccountType = {
|
|
10
|
+
Basic: "BASIC",
|
|
11
|
+
Pro: "PRO",
|
|
12
|
+
Business: "BUSINESS",
|
|
13
|
+
};
|
|
14
|
+
})(PersonalAccessTokenPrincipal || (exports.PersonalAccessTokenPrincipal = PersonalAccessTokenPrincipal = {}));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export interface ServiceExecution {
|
|
5
|
+
id?: string;
|
|
6
|
+
createdAt?: string;
|
|
7
|
+
startedAt?: string;
|
|
8
|
+
endedAt?: string;
|
|
9
|
+
status?: ServiceExecution.Status;
|
|
10
|
+
}
|
|
11
|
+
export declare namespace ServiceExecution {
|
|
12
|
+
type Status = "UNKNOWN" | "PENDING" | "RUNNING" | "SUCCEEDED" | "FAILED";
|
|
13
|
+
const Status: {
|
|
14
|
+
readonly Unknown: "UNKNOWN";
|
|
15
|
+
readonly Pending: "PENDING";
|
|
16
|
+
readonly Running: "RUNNING";
|
|
17
|
+
readonly Succeeded: "SUCCEEDED";
|
|
18
|
+
readonly Failed: "FAILED";
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ServiceExecution = void 0;
|
|
7
|
+
var ServiceExecution;
|
|
8
|
+
(function (ServiceExecution) {
|
|
9
|
+
ServiceExecution.Status = {
|
|
10
|
+
Unknown: "UNKNOWN",
|
|
11
|
+
Pending: "PENDING",
|
|
12
|
+
Running: "RUNNING",
|
|
13
|
+
Succeeded: "SUCCEEDED",
|
|
14
|
+
Failed: "FAILED",
|
|
15
|
+
};
|
|
16
|
+
})(ServiceExecution || (exports.ServiceExecution = ServiceExecution = {}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as PlanqkApi from "../index.js";
|
|
5
|
+
export interface ServiceExecutionTokenPrincipal {
|
|
6
|
+
serviceExecution?: PlanqkApi.ServiceExecution;
|
|
7
|
+
serviceProvider?: PlanqkApi.UserContext;
|
|
8
|
+
}
|