@planqk/planqk-api-sdk 1.2.0 → 1.3.1
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/.env.template +2 -1
- package/.gitlab-ci.yml +1 -0
- package/README-node.md +13 -0
- package/README-python.md +13 -0
- package/README.md +6 -49
- package/apps/README.md +24 -0
- package/apps/python-test-app/main.py +159 -0
- package/apps/test-file.txt +1 -0
- package/apps/ts-test-app/index.ts +140 -0
- package/apps/ts-test-app/package-lock.json +695 -0
- package/apps/ts-test-app/package.json +15 -0
- package/apps/ts-test-app/tsconfig.json +11 -0
- package/dist/index.d.ts +1 -4
- package/dist/index.js +4 -31
- package/dist/{Client.d.ts → sdk/Client.d.ts} +2 -5
- package/dist/{Client.js → sdk/Client.js} +1 -6
- package/dist/{api → sdk/api}/resources/dataPools/client/Client.d.ts +3 -3
- package/dist/{api → sdk/api}/resources/dataPools/client/Client.js +1 -1
- package/dist/sdk/api/resources/index.d.ts +2 -0
- package/dist/{api → sdk/api}/resources/index.js +1 -3
- package/dist/sdk/api/types/index.d.ts +3 -0
- package/dist/{api/resources/authentication → sdk/api}/types/index.js +3 -1
- package/dist/sdk/index.d.ts +4 -0
- package/dist/sdk/index.js +44 -0
- package/fern/fern.config.json +1 -1
- package/fern/openapi/openapi.json +2 -202
- package/notebooks/python-sdk.ipynb +2 -1
- package/package.json +3 -4
- package/planqk/api/_version.py +1 -1
- package/planqk/api/client.py +5 -2
- package/planqk/api/sdk/__init__.py +2 -34
- package/planqk/api/sdk/client.py +0 -3
- package/planqk/api/sdk/types/__init__.py +1 -30
- package/pyproject.toml +3 -6
- package/src/index.test.ts +6 -5
- package/src/index.ts +1 -4
- package/src/{Client.ts → sdk/Client.ts} +2 -8
- package/src/{api → sdk/api}/resources/dataPools/client/Client.ts +2 -2
- package/src/sdk/api/resources/index.ts +2 -0
- package/src/sdk/api/types/index.ts +3 -0
- package/src/sdk/index.ts +4 -0
- package/uv.lock +658 -324
- package/dist/api/resources/authentication/client/Client.d.ts +0 -55
- package/dist/api/resources/authentication/client/Client.js +0 -126
- package/dist/api/resources/authentication/client/index.d.ts +0 -1
- package/dist/api/resources/authentication/index.d.ts +0 -2
- package/dist/api/resources/authentication/index.js +0 -18
- package/dist/api/resources/authentication/types/AuthorizeResponse.d.ts +0 -5
- package/dist/api/resources/authentication/types/AuthorizeResponse.js +0 -5
- package/dist/api/resources/authentication/types/index.d.ts +0 -1
- package/dist/api/resources/dataPools/client/requests/index.js +0 -2
- package/dist/api/resources/index.d.ts +0 -4
- package/dist/api/types/AccessToken.d.ts +0 -10
- package/dist/api/types/AccessToken.js +0 -5
- package/dist/api/types/OrganizationMembership.d.ts +0 -22
- package/dist/api/types/OrganizationMembership.js +0 -19
- package/dist/api/types/PersonalAccessTokenPrincipal.d.ts +0 -18
- package/dist/api/types/PersonalAccessTokenPrincipal.js +0 -14
- package/dist/api/types/ServiceExecution.d.ts +0 -20
- package/dist/api/types/ServiceExecution.js +0 -16
- package/dist/api/types/ServiceExecutionTokenPrincipal.d.ts +0 -8
- package/dist/api/types/ServiceExecutionTokenPrincipal.js +0 -5
- package/dist/api/types/UserContext.d.ts +0 -24
- package/dist/api/types/UserContext.js +0 -19
- package/dist/api/types/index.d.ts +0 -9
- package/dist/api/types/index.js +0 -25
- package/planqk/api/sdk/authentication/__init__.py +0 -7
- package/planqk/api/sdk/authentication/client.py +0 -102
- package/planqk/api/sdk/authentication/raw_client.py +0 -183
- package/planqk/api/sdk/authentication/types/__init__.py +0 -7
- package/planqk/api/sdk/authentication/types/authorize_response.py +0 -8
- package/planqk/api/sdk/types/access_token.py +0 -26
- package/planqk/api/sdk/types/organization_membership.py +0 -27
- package/planqk/api/sdk/types/organization_membership_account_type.py +0 -5
- package/planqk/api/sdk/types/organization_membership_role.py +0 -5
- package/planqk/api/sdk/types/personal_access_token_principal.py +0 -31
- package/planqk/api/sdk/types/personal_access_token_principal_account_type.py +0 -5
- package/planqk/api/sdk/types/service_execution.py +0 -27
- package/planqk/api/sdk/types/service_execution_status.py +0 -7
- package/planqk/api/sdk/types/service_execution_token_principal.py +0 -34
- package/planqk/api/sdk/types/user_context.py +0 -35
- package/planqk/api/sdk/types/user_context_account_type.py +0 -5
- package/planqk/api/sdk/types/user_context_context_type.py +0 -5
- package/src/api/resources/authentication/client/Client.ts +0 -134
- package/src/api/resources/authentication/client/index.ts +0 -1
- package/src/api/resources/authentication/index.ts +0 -2
- package/src/api/resources/authentication/types/AuthorizeResponse.ts +0 -7
- package/src/api/resources/authentication/types/index.ts +0 -1
- package/src/api/resources/index.ts +0 -4
- package/src/api/types/AccessToken.ts +0 -11
- package/src/api/types/OrganizationMembership.ts +0 -24
- package/src/api/types/PersonalAccessTokenPrincipal.ts +0 -21
- package/src/api/types/ServiceExecution.ts +0 -22
- package/src/api/types/ServiceExecutionTokenPrincipal.ts +0 -10
- package/src/api/types/UserContext.ts +0 -27
- package/src/api/types/index.ts +0 -9
- package/dist/{api → sdk/api}/errors/BadRequestError.d.ts +0 -0
- package/dist/{api → sdk/api}/errors/BadRequestError.js +0 -0
- package/dist/{api → sdk/api}/errors/ForbiddenError.d.ts +0 -0
- package/dist/{api → sdk/api}/errors/ForbiddenError.js +0 -0
- package/dist/{api → sdk/api}/errors/InternalServerError.d.ts +0 -0
- package/dist/{api → sdk/api}/errors/InternalServerError.js +0 -0
- package/dist/{api → sdk/api}/errors/NotFoundError.d.ts +0 -0
- package/dist/{api → sdk/api}/errors/NotFoundError.js +0 -0
- package/dist/{api → sdk/api}/errors/UnauthorizedError.d.ts +0 -0
- package/dist/{api → sdk/api}/errors/UnauthorizedError.js +0 -0
- package/dist/{api → sdk/api}/errors/index.d.ts +0 -0
- package/dist/{api → sdk/api}/errors/index.js +0 -0
- package/dist/{api → sdk/api}/index.d.ts +1 -1
- package/dist/{api → sdk/api}/index.js +1 -1
- package/dist/{api → sdk/api}/resources/dataPools/client/index.d.ts +0 -0
- package/dist/{api → sdk/api}/resources/dataPools/client/index.js +0 -0
- package/dist/{api → sdk/api}/resources/dataPools/client/requests/AddDataPoolFileRequest.d.ts +0 -0
- package/dist/{api → sdk/api}/resources/dataPools/client/requests/AddDataPoolFileRequest.js +0 -0
- package/dist/{api → sdk/api}/resources/dataPools/client/requests/CreateDataPoolRequest.d.ts +0 -0
- package/dist/{api → sdk/api}/resources/dataPools/client/requests/CreateDataPoolRequest.js +0 -0
- package/dist/{api → sdk/api}/resources/dataPools/client/requests/UpdateDataPoolRequest.d.ts +0 -0
- package/dist/{api → sdk/api}/resources/dataPools/client/requests/UpdateDataPoolRequest.js +0 -0
- package/dist/{api → sdk/api}/resources/dataPools/client/requests/index.d.ts +0 -0
- package/dist/{api/resources/authentication/client → sdk/api/resources/dataPools/client/requests}/index.js +0 -0
- package/dist/{api → sdk/api}/resources/dataPools/index.d.ts +0 -0
- package/dist/{api → sdk/api}/resources/dataPools/index.js +0 -0
- package/dist/{api → sdk/api}/types/DataPoolDto.d.ts +0 -0
- package/dist/{api → sdk/api}/types/DataPoolDto.js +0 -0
- package/dist/{api → sdk/api}/types/DataPoolFileDto.d.ts +0 -0
- package/dist/{api → sdk/api}/types/DataPoolFileDto.js +0 -0
- package/dist/{api → sdk/api}/types/OauthScope.d.ts +0 -0
- package/dist/{api → sdk/api}/types/OauthScope.js +0 -0
- package/dist/{core → sdk/core}/fetcher/APIResponse.d.ts +0 -0
- package/dist/{core → sdk/core}/fetcher/APIResponse.js +0 -0
- package/dist/{core → sdk/core}/fetcher/BinaryResponse.d.ts +0 -0
- package/dist/{core → sdk/core}/fetcher/BinaryResponse.js +0 -0
- package/dist/{core → sdk/core}/fetcher/Fetcher.d.ts +0 -0
- package/dist/{core → sdk/core}/fetcher/Fetcher.js +0 -0
- package/dist/{core → sdk/core}/fetcher/Headers.d.ts +0 -0
- package/dist/{core → sdk/core}/fetcher/Headers.js +0 -0
- package/dist/{core → sdk/core}/fetcher/HttpResponsePromise.d.ts +0 -0
- package/dist/{core → sdk/core}/fetcher/HttpResponsePromise.js +0 -0
- package/dist/{core → sdk/core}/fetcher/RawResponse.d.ts +0 -0
- package/dist/{core → sdk/core}/fetcher/RawResponse.js +0 -0
- package/dist/{core → sdk/core}/fetcher/ResponseWithBody.d.ts +0 -0
- package/dist/{core → sdk/core}/fetcher/ResponseWithBody.js +0 -0
- package/dist/{core → sdk/core}/fetcher/Supplier.d.ts +0 -0
- package/dist/{core → sdk/core}/fetcher/Supplier.js +0 -0
- package/dist/{core → sdk/core}/fetcher/createRequestUrl.d.ts +0 -0
- package/dist/{core → sdk/core}/fetcher/createRequestUrl.js +0 -0
- package/dist/{core → sdk/core}/fetcher/getErrorResponseBody.d.ts +0 -0
- package/dist/{core → sdk/core}/fetcher/getErrorResponseBody.js +0 -0
- package/dist/{core → sdk/core}/fetcher/getFetchFn.d.ts +0 -0
- package/dist/{core → sdk/core}/fetcher/getFetchFn.js +0 -0
- package/dist/{core → sdk/core}/fetcher/getHeader.d.ts +0 -0
- package/dist/{core → sdk/core}/fetcher/getHeader.js +0 -0
- package/dist/{core → sdk/core}/fetcher/getRequestBody.d.ts +0 -0
- package/dist/{core → sdk/core}/fetcher/getRequestBody.js +0 -0
- package/dist/{core → sdk/core}/fetcher/getResponseBody.d.ts +0 -0
- package/dist/{core → sdk/core}/fetcher/getResponseBody.js +0 -0
- package/dist/{core → sdk/core}/fetcher/index.d.ts +0 -0
- package/dist/{core → sdk/core}/fetcher/index.js +0 -0
- package/dist/{core → sdk/core}/fetcher/makeRequest.d.ts +0 -0
- package/dist/{core → sdk/core}/fetcher/makeRequest.js +0 -0
- package/dist/{core → sdk/core}/fetcher/requestWithRetries.d.ts +0 -0
- package/dist/{core → sdk/core}/fetcher/requestWithRetries.js +0 -0
- package/dist/{core → sdk/core}/fetcher/signals.d.ts +0 -0
- package/dist/{core → sdk/core}/fetcher/signals.js +0 -0
- package/dist/{core → sdk/core}/file.d.ts +0 -0
- package/dist/{core → sdk/core}/file.js +0 -0
- package/dist/{core → sdk/core}/form-data-utils/FormDataWrapper.d.ts +0 -0
- package/dist/{core → sdk/core}/form-data-utils/FormDataWrapper.js +0 -0
- package/dist/{core → sdk/core}/form-data-utils/encodeAsFormParameter.d.ts +0 -0
- package/dist/{core → sdk/core}/form-data-utils/encodeAsFormParameter.js +0 -0
- package/dist/{core → sdk/core}/form-data-utils/index.d.ts +0 -0
- package/dist/{core → sdk/core}/form-data-utils/index.js +0 -0
- package/dist/{core → sdk/core}/headers.d.ts +0 -0
- package/dist/{core → sdk/core}/headers.js +0 -0
- package/dist/{core → sdk/core}/index.d.ts +0 -0
- package/dist/{core → sdk/core}/index.js +0 -0
- package/dist/{core → sdk/core}/json.d.ts +0 -0
- package/dist/{core → sdk/core}/json.js +0 -0
- package/dist/{core → sdk/core}/runtime/index.d.ts +0 -0
- package/dist/{core → sdk/core}/runtime/index.js +0 -0
- package/dist/{core → sdk/core}/runtime/runtime.d.ts +0 -0
- package/dist/{core → sdk/core}/runtime/runtime.js +0 -0
- package/dist/{core → sdk/core}/url/index.d.ts +0 -0
- package/dist/{core → sdk/core}/url/index.js +0 -0
- package/dist/{core → sdk/core}/url/join.d.ts +0 -0
- package/dist/{core → sdk/core}/url/join.js +0 -0
- package/dist/{core → sdk/core}/url/qs.d.ts +0 -0
- package/dist/{core → sdk/core}/url/qs.js +0 -0
- package/dist/{environments.d.ts → sdk/environments.d.ts} +0 -0
- package/dist/{environments.js → sdk/environments.js} +0 -0
- package/dist/{errors → sdk/errors}/PlanqkApiError.d.ts +0 -0
- package/dist/{errors → sdk/errors}/PlanqkApiError.js +0 -0
- package/dist/{errors → sdk/errors}/PlanqkApiTimeoutError.d.ts +0 -0
- package/dist/{errors → sdk/errors}/PlanqkApiTimeoutError.js +0 -0
- package/dist/{errors → sdk/errors}/index.d.ts +0 -0
- package/dist/{errors → sdk/errors}/index.js +0 -0
- package/src/{api → sdk/api}/errors/BadRequestError.ts +0 -0
- package/src/{api → sdk/api}/errors/ForbiddenError.ts +0 -0
- package/src/{api → sdk/api}/errors/InternalServerError.ts +0 -0
- package/src/{api → sdk/api}/errors/NotFoundError.ts +0 -0
- package/src/{api → sdk/api}/errors/UnauthorizedError.ts +0 -0
- package/src/{api → sdk/api}/errors/index.ts +0 -0
- package/src/{api → sdk/api}/index.ts +1 -1
- /package/src/{api → sdk/api}/resources/dataPools/client/index.ts +0 -0
- /package/src/{api → sdk/api}/resources/dataPools/client/requests/AddDataPoolFileRequest.ts +0 -0
- /package/src/{api → sdk/api}/resources/dataPools/client/requests/CreateDataPoolRequest.ts +0 -0
- /package/src/{api → sdk/api}/resources/dataPools/client/requests/UpdateDataPoolRequest.ts +0 -0
- /package/src/{api → sdk/api}/resources/dataPools/client/requests/index.ts +0 -0
- /package/src/{api → sdk/api}/resources/dataPools/index.ts +0 -0
- /package/src/{api → sdk/api}/types/DataPoolDto.ts +0 -0
- /package/src/{api → sdk/api}/types/DataPoolFileDto.ts +0 -0
- /package/src/{api → sdk/api}/types/OauthScope.ts +0 -0
- /package/src/{core → sdk/core}/fetcher/APIResponse.ts +0 -0
- /package/src/{core → sdk/core}/fetcher/BinaryResponse.ts +0 -0
- /package/src/{core → sdk/core}/fetcher/Fetcher.ts +0 -0
- /package/src/{core → sdk/core}/fetcher/Headers.ts +0 -0
- /package/src/{core → sdk/core}/fetcher/HttpResponsePromise.ts +0 -0
- /package/src/{core → sdk/core}/fetcher/RawResponse.ts +0 -0
- /package/src/{core → sdk/core}/fetcher/ResponseWithBody.ts +0 -0
- /package/src/{core → sdk/core}/fetcher/Supplier.ts +0 -0
- /package/src/{core → sdk/core}/fetcher/createRequestUrl.ts +0 -0
- /package/src/{core → sdk/core}/fetcher/getErrorResponseBody.ts +0 -0
- /package/src/{core → sdk/core}/fetcher/getFetchFn.ts +0 -0
- /package/src/{core → sdk/core}/fetcher/getHeader.ts +0 -0
- /package/src/{core → sdk/core}/fetcher/getRequestBody.ts +0 -0
- /package/src/{core → sdk/core}/fetcher/getResponseBody.ts +0 -0
- /package/src/{core → sdk/core}/fetcher/index.ts +0 -0
- /package/src/{core → sdk/core}/fetcher/makeRequest.ts +0 -0
- /package/src/{core → sdk/core}/fetcher/requestWithRetries.ts +0 -0
- /package/src/{core → sdk/core}/fetcher/signals.ts +0 -0
- /package/src/{core → sdk/core}/file.ts +0 -0
- /package/src/{core → sdk/core}/form-data-utils/FormDataWrapper.ts +0 -0
- /package/src/{core → sdk/core}/form-data-utils/encodeAsFormParameter.ts +0 -0
- /package/src/{core → sdk/core}/form-data-utils/index.ts +0 -0
- /package/src/{core → sdk/core}/headers.ts +0 -0
- /package/src/{core → sdk/core}/index.ts +0 -0
- /package/src/{core → sdk/core}/json.ts +0 -0
- /package/src/{core → sdk/core}/runtime/index.ts +0 -0
- /package/src/{core → sdk/core}/runtime/runtime.ts +0 -0
- /package/src/{core → sdk/core}/url/index.ts +0 -0
- /package/src/{core → sdk/core}/url/join.ts +0 -0
- /package/src/{core → sdk/core}/url/qs.ts +0 -0
- /package/src/{environments.ts → sdk/environments.ts} +0 -0
- /package/src/{errors → sdk/errors}/PlanqkApiError.ts +0 -0
- /package/src/{errors → sdk/errors}/PlanqkApiTimeoutError.ts +0 -0
- /package/src/{errors → sdk/errors}/index.ts +0 -0
|
@@ -1,55 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,126 +0,0 @@
|
|
|
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;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,18 +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("./types/index.js"), exports);
|
|
18
|
-
__exportStar(require("./client/index.js"), exports);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./AuthorizeResponse.js";
|
|
@@ -1,22 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
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 = {}));
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
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 = {}));
|
|
@@ -1,20 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
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 = {}));
|
|
@@ -1,8 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
import * as PlanqkApi from "../index.js";
|
|
5
|
-
export interface UserContext {
|
|
6
|
-
id?: string;
|
|
7
|
-
contextType?: UserContext.ContextType;
|
|
8
|
-
accountType?: UserContext.AccountType;
|
|
9
|
-
parent?: PlanqkApi.UserContext;
|
|
10
|
-
}
|
|
11
|
-
export declare namespace UserContext {
|
|
12
|
-
type ContextType = "USER" | "ORGANIZATION" | "SERVICE_EXECUTION";
|
|
13
|
-
const ContextType: {
|
|
14
|
-
readonly User: "USER";
|
|
15
|
-
readonly Organization: "ORGANIZATION";
|
|
16
|
-
readonly ServiceExecution: "SERVICE_EXECUTION";
|
|
17
|
-
};
|
|
18
|
-
type AccountType = "BASIC" | "PRO" | "BUSINESS";
|
|
19
|
-
const AccountType: {
|
|
20
|
-
readonly Basic: "BASIC";
|
|
21
|
-
readonly Pro: "PRO";
|
|
22
|
-
readonly Business: "BUSINESS";
|
|
23
|
-
};
|
|
24
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
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.UserContext = void 0;
|
|
7
|
-
var UserContext;
|
|
8
|
-
(function (UserContext) {
|
|
9
|
-
UserContext.ContextType = {
|
|
10
|
-
User: "USER",
|
|
11
|
-
Organization: "ORGANIZATION",
|
|
12
|
-
ServiceExecution: "SERVICE_EXECUTION",
|
|
13
|
-
};
|
|
14
|
-
UserContext.AccountType = {
|
|
15
|
-
Basic: "BASIC",
|
|
16
|
-
Pro: "PRO",
|
|
17
|
-
Business: "BUSINESS",
|
|
18
|
-
};
|
|
19
|
-
})(UserContext || (exports.UserContext = UserContext = {}));
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from "./OauthScope.js";
|
|
2
|
-
export * from "./DataPoolDto.js";
|
|
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";
|
package/dist/api/types/index.js
DELETED
|
@@ -1,25 +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("./OauthScope.js"), exports);
|
|
18
|
-
__exportStar(require("./DataPoolDto.js"), exports);
|
|
19
|
-
__exportStar(require("./DataPoolFileDto.js"), exports);
|
|
20
|
-
__exportStar(require("./AccessToken.js"), exports);
|
|
21
|
-
__exportStar(require("./OrganizationMembership.js"), exports);
|
|
22
|
-
__exportStar(require("./PersonalAccessTokenPrincipal.js"), exports);
|
|
23
|
-
__exportStar(require("./ServiceExecution.js"), exports);
|
|
24
|
-
__exportStar(require("./ServiceExecutionTokenPrincipal.js"), exports);
|
|
25
|
-
__exportStar(require("./UserContext.js"), exports);
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
|
|
3
|
-
import typing
|
|
4
|
-
|
|
5
|
-
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
6
|
-
from ..core.request_options import RequestOptions
|
|
7
|
-
from .raw_client import AsyncRawAuthenticationClient, RawAuthenticationClient
|
|
8
|
-
from .types.authorize_response import AuthorizeResponse
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class AuthenticationClient:
|
|
12
|
-
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
13
|
-
self._raw_client = RawAuthenticationClient(client_wrapper=client_wrapper)
|
|
14
|
-
|
|
15
|
-
@property
|
|
16
|
-
def with_raw_response(self) -> RawAuthenticationClient:
|
|
17
|
-
"""
|
|
18
|
-
Retrieves a raw implementation of this client that returns raw responses.
|
|
19
|
-
|
|
20
|
-
Returns
|
|
21
|
-
-------
|
|
22
|
-
RawAuthenticationClient
|
|
23
|
-
"""
|
|
24
|
-
return self._raw_client
|
|
25
|
-
|
|
26
|
-
def authorize(self, *, request_options: typing.Optional[RequestOptions] = None) -> AuthorizeResponse:
|
|
27
|
-
"""
|
|
28
|
-
Get the authenticated principal based on the provided token.
|
|
29
|
-
|
|
30
|
-
Parameters
|
|
31
|
-
----------
|
|
32
|
-
request_options : typing.Optional[RequestOptions]
|
|
33
|
-
Request-specific configuration.
|
|
34
|
-
|
|
35
|
-
Returns
|
|
36
|
-
-------
|
|
37
|
-
AuthorizeResponse
|
|
38
|
-
The scopes of the provided token.
|
|
39
|
-
|
|
40
|
-
Examples
|
|
41
|
-
--------
|
|
42
|
-
from planqk import PlanqkApi
|
|
43
|
-
|
|
44
|
-
client = PlanqkApi(
|
|
45
|
-
organization_id="YOUR_ORGANIZATION_ID",
|
|
46
|
-
api_key="YOUR_API_KEY",
|
|
47
|
-
)
|
|
48
|
-
client.authentication.authorize()
|
|
49
|
-
"""
|
|
50
|
-
_response = self._raw_client.authorize(request_options=request_options)
|
|
51
|
-
return _response.data
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
class AsyncAuthenticationClient:
|
|
55
|
-
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
56
|
-
self._raw_client = AsyncRawAuthenticationClient(client_wrapper=client_wrapper)
|
|
57
|
-
|
|
58
|
-
@property
|
|
59
|
-
def with_raw_response(self) -> AsyncRawAuthenticationClient:
|
|
60
|
-
"""
|
|
61
|
-
Retrieves a raw implementation of this client that returns raw responses.
|
|
62
|
-
|
|
63
|
-
Returns
|
|
64
|
-
-------
|
|
65
|
-
AsyncRawAuthenticationClient
|
|
66
|
-
"""
|
|
67
|
-
return self._raw_client
|
|
68
|
-
|
|
69
|
-
async def authorize(self, *, request_options: typing.Optional[RequestOptions] = None) -> AuthorizeResponse:
|
|
70
|
-
"""
|
|
71
|
-
Get the authenticated principal based on the provided token.
|
|
72
|
-
|
|
73
|
-
Parameters
|
|
74
|
-
----------
|
|
75
|
-
request_options : typing.Optional[RequestOptions]
|
|
76
|
-
Request-specific configuration.
|
|
77
|
-
|
|
78
|
-
Returns
|
|
79
|
-
-------
|
|
80
|
-
AuthorizeResponse
|
|
81
|
-
The scopes of the provided token.
|
|
82
|
-
|
|
83
|
-
Examples
|
|
84
|
-
--------
|
|
85
|
-
import asyncio
|
|
86
|
-
|
|
87
|
-
from planqk import AsyncPlanqkApi
|
|
88
|
-
|
|
89
|
-
client = AsyncPlanqkApi(
|
|
90
|
-
organization_id="YOUR_ORGANIZATION_ID",
|
|
91
|
-
api_key="YOUR_API_KEY",
|
|
92
|
-
)
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
async def main() -> None:
|
|
96
|
-
await client.authentication.authorize()
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
asyncio.run(main())
|
|
100
|
-
"""
|
|
101
|
-
_response = await self._raw_client.authorize(request_options=request_options)
|
|
102
|
-
return _response.data
|