@planqk/planqk-service-sdk 2.1.1 → 2.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/.gitlab-ci.yml +8 -39
- package/README-node.md +16 -12
- package/README.md +30 -41
- package/dist/sdk/Client.d.ts +10 -4
- package/dist/sdk/Client.js +46 -4
- package/dist/sdk/api/index.d.ts +2 -3
- package/dist/sdk/api/index.js +2 -3
- package/dist/sdk/api/resources/index.d.ts +2 -2
- package/dist/sdk/api/resources/index.js +2 -2
- package/dist/sdk/api/resources/serviceApi/client/Client.d.ts +41 -55
- package/dist/sdk/api/resources/serviceApi/client/Client.js +131 -227
- package/dist/sdk/api/resources/serviceApi/index.d.ts +2 -2
- package/dist/sdk/api/resources/serviceApi/index.js +2 -2
- package/dist/sdk/api/resources/serviceApi/types/GetResultResponse.d.ts +13 -3
- package/dist/sdk/api/resources/serviceApi/types/index.d.ts +1 -4
- package/dist/sdk/api/resources/serviceApi/types/index.js +1 -4
- package/dist/sdk/api/types/ServiceExecution.d.ts +12 -2
- package/dist/sdk/api/types/ServiceExecution.js +12 -0
- package/dist/sdk/api/types/index.d.ts +2 -6
- package/dist/sdk/api/types/index.js +2 -6
- package/dist/sdk/core/auth/BasicAuth.js +3 -3
- package/dist/sdk/core/auth/index.d.ts +2 -2
- package/dist/sdk/core/auth/index.js +4 -4
- package/dist/sdk/core/base64.d.ts +2 -0
- package/dist/sdk/core/base64.js +26 -0
- package/dist/sdk/core/fetcher/APIResponse.d.ts +10 -0
- package/dist/sdk/core/fetcher/BinaryResponse.d.ts +20 -0
- package/dist/sdk/core/fetcher/BinaryResponse.js +17 -0
- package/dist/sdk/core/fetcher/Fetcher.d.ts +5 -4
- package/dist/sdk/core/fetcher/Fetcher.js +41 -22
- package/dist/sdk/core/fetcher/Headers.d.ts +2 -0
- package/dist/sdk/core/fetcher/Headers.js +85 -0
- package/dist/sdk/core/fetcher/HttpResponsePromise.d.ts +58 -0
- package/dist/sdk/core/fetcher/HttpResponsePromise.js +94 -0
- package/dist/sdk/core/fetcher/RawResponse.d.ts +29 -0
- package/dist/sdk/core/fetcher/RawResponse.js +44 -0
- package/dist/sdk/core/fetcher/ResponseWithBody.d.ts +4 -0
- package/dist/sdk/core/fetcher/ResponseWithBody.js +6 -0
- package/dist/sdk/core/fetcher/createRequestUrl.d.ts +1 -1
- package/dist/sdk/core/fetcher/createRequestUrl.js +3 -7
- package/dist/sdk/core/fetcher/getErrorResponseBody.d.ts +1 -0
- package/dist/sdk/core/fetcher/getErrorResponseBody.js +32 -0
- package/dist/sdk/core/fetcher/getFetchFn.d.ts +1 -4
- package/dist/sdk/core/fetcher/getFetchFn.js +1 -52
- package/dist/sdk/core/fetcher/getRequestBody.js +2 -1
- package/dist/sdk/core/fetcher/getResponseBody.js +34 -30
- package/dist/sdk/core/fetcher/index.d.ts +9 -5
- package/dist/sdk/core/fetcher/index.js +13 -7
- package/dist/sdk/core/fetcher/makeRequest.js +3 -3
- package/dist/sdk/core/fetcher/requestWithRetries.js +14 -5
- package/dist/sdk/core/headers.d.ts +3 -0
- package/dist/sdk/core/headers.js +29 -0
- package/dist/sdk/core/index.d.ts +5 -3
- package/dist/sdk/core/index.js +28 -3
- package/dist/sdk/core/json.d.ts +15 -0
- package/dist/sdk/core/json.js +24 -0
- package/dist/sdk/core/runtime/index.d.ts +1 -1
- package/dist/sdk/core/runtime/index.js +2 -2
- package/dist/sdk/core/runtime/runtime.d.ts +1 -1
- package/dist/sdk/core/runtime/runtime.js +49 -40
- package/dist/sdk/core/url/index.d.ts +2 -0
- package/dist/sdk/core/url/index.js +7 -0
- package/dist/sdk/core/url/join.d.ts +1 -0
- package/dist/sdk/core/url/join.js +49 -0
- package/dist/sdk/core/url/qs.d.ts +6 -0
- package/dist/sdk/core/url/qs.js +67 -0
- package/dist/sdk/errors/PlanqkServiceApiError.d.ts +4 -1
- package/dist/sdk/errors/PlanqkServiceApiError.js +7 -8
- package/dist/sdk/errors/PlanqkServiceApiTimeoutError.d.ts +1 -1
- package/dist/sdk/errors/PlanqkServiceApiTimeoutError.js +2 -2
- package/dist/sdk/errors/index.d.ts +2 -2
- package/dist/sdk/errors/index.js +4 -4
- package/dist/sdk/index.d.ts +4 -4
- package/dist/sdk/index.js +9 -9
- package/fern/fern.config.json +1 -1
- package/fern/generators.yml +2 -2
- package/fern/openapi/openapi.yml +41 -131
- package/notebooks/python-sdk.ipynb +1 -1
- package/package.json +2 -3
- package/planqk/service/_version.py +1 -1
- package/pyproject.toml +1 -1
- package/src/index.test.ts +29 -16
- package/src/sdk/Client.ts +27 -7
- package/src/sdk/api/index.ts +2 -3
- package/src/sdk/api/resources/index.ts +2 -2
- package/src/sdk/api/resources/serviceApi/client/Client.ts +223 -250
- package/src/sdk/api/resources/serviceApi/index.ts +2 -2
- package/src/sdk/api/resources/serviceApi/types/GetResultResponse.ts +15 -3
- package/src/sdk/api/resources/serviceApi/types/index.ts +1 -4
- package/src/sdk/api/types/ServiceExecution.ts +13 -3
- package/src/sdk/api/types/index.ts +2 -6
- package/src/sdk/core/auth/BasicAuth.ts +3 -3
- package/src/sdk/core/auth/index.ts +2 -2
- package/src/sdk/core/base64.ts +27 -0
- package/src/sdk/core/fetcher/APIResponse.ts +11 -0
- package/src/sdk/core/fetcher/BinaryResponse.ts +36 -0
- package/src/sdk/core/fetcher/Fetcher.ts +46 -26
- package/src/sdk/core/fetcher/Headers.ts +93 -0
- package/src/sdk/core/fetcher/HttpResponsePromise.ts +116 -0
- package/src/sdk/core/fetcher/RawResponse.ts +61 -0
- package/src/sdk/core/fetcher/ResponseWithBody.ts +7 -0
- package/src/sdk/core/fetcher/createRequestUrl.ts +4 -8
- package/src/sdk/core/fetcher/getErrorResponseBody.ts +32 -0
- package/src/sdk/core/fetcher/getFetchFn.ts +2 -24
- package/src/sdk/core/fetcher/getRequestBody.ts +3 -1
- package/src/sdk/core/fetcher/getResponseBody.ts +38 -27
- package/src/sdk/core/fetcher/index.ts +9 -5
- package/src/sdk/core/fetcher/makeRequest.ts +2 -2
- package/src/sdk/core/fetcher/requestWithRetries.ts +18 -6
- package/src/sdk/core/fetcher/signals.ts +1 -1
- package/src/sdk/core/headers.ts +35 -0
- package/src/sdk/core/index.ts +5 -3
- package/src/sdk/core/json.ts +27 -0
- package/src/sdk/core/runtime/index.ts +1 -1
- package/src/sdk/core/runtime/runtime.ts +60 -53
- package/src/sdk/core/url/index.ts +2 -0
- package/src/sdk/core/url/join.ts +55 -0
- package/src/sdk/core/url/qs.ts +74 -0
- package/src/sdk/errors/PlanqkServiceApiError.ts +21 -11
- package/src/sdk/errors/PlanqkServiceApiTimeoutError.ts +2 -2
- package/src/sdk/errors/index.ts +2 -2
- package/src/sdk/index.ts +4 -4
- package/dist/sdk/api/errors/BadRequestError.d.ts +0 -7
- package/dist/sdk/api/errors/BadRequestError.js +0 -51
- package/dist/sdk/api/errors/ForbiddenError.d.ts +0 -7
- package/dist/sdk/api/errors/ForbiddenError.js +0 -51
- package/dist/sdk/api/errors/InternalServerError.d.ts +0 -7
- package/dist/sdk/api/errors/InternalServerError.js +0 -51
- package/dist/sdk/api/errors/NotFoundError.d.ts +0 -7
- package/dist/sdk/api/errors/NotFoundError.js +0 -51
- package/dist/sdk/api/errors/UnauthorizedError.d.ts +0 -7
- package/dist/sdk/api/errors/UnauthorizedError.js +0 -51
- package/dist/sdk/api/errors/index.d.ts +0 -5
- package/dist/sdk/api/errors/index.js +0 -21
- package/dist/sdk/api/resources/serviceApi/types/GetResultResponseEmbedded.d.ts +0 -7
- package/dist/sdk/api/resources/serviceApi/types/GetResultResponseEmbedded.js +0 -5
- package/dist/sdk/api/resources/serviceApi/types/GetResultResponseLinks.d.ts +0 -7
- package/dist/sdk/api/resources/serviceApi/types/GetResultResponseLinks.js +0 -5
- package/dist/sdk/api/resources/serviceApi/types/HealthCheckResponse.d.ts +0 -7
- package/dist/sdk/api/resources/serviceApi/types/HealthCheckResponse.js +0 -5
- package/dist/sdk/api/types/InputData.d.ts +0 -4
- package/dist/sdk/api/types/InputData.js +0 -5
- package/dist/sdk/api/types/InputDataRef.d.ts +0 -8
- package/dist/sdk/api/types/InputDataRef.js +0 -5
- package/dist/sdk/api/types/InputParams.d.ts +0 -4
- package/dist/sdk/api/types/InputParams.js +0 -5
- package/dist/sdk/api/types/ServiceExecutionStatus.d.ts +0 -12
- package/dist/sdk/api/types/ServiceExecutionStatus.js +0 -14
- package/dist/sdk/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +0 -30
- package/dist/sdk/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +0 -232
- package/dist/sdk/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +0 -21
- package/dist/sdk/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +0 -91
- package/dist/sdk/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +0 -31
- package/dist/sdk/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +0 -214
- package/dist/sdk/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +0 -18
- package/dist/sdk/core/fetcher/stream-wrappers/chooseStreamWrapper.js +0 -48
- package/src/sdk/api/errors/BadRequestError.ts +0 -16
- package/src/sdk/api/errors/ForbiddenError.ts +0 -16
- package/src/sdk/api/errors/InternalServerError.ts +0 -16
- package/src/sdk/api/errors/NotFoundError.ts +0 -16
- package/src/sdk/api/errors/UnauthorizedError.ts +0 -16
- package/src/sdk/api/errors/index.ts +0 -5
- package/src/sdk/api/resources/serviceApi/types/GetResultResponseEmbedded.ts +0 -9
- package/src/sdk/api/resources/serviceApi/types/GetResultResponseLinks.ts +0 -9
- package/src/sdk/api/resources/serviceApi/types/HealthCheckResponse.ts +0 -8
- package/src/sdk/api/types/InputData.ts +0 -5
- package/src/sdk/api/types/InputDataRef.ts +0 -9
- package/src/sdk/api/types/InputParams.ts +0 -5
- package/src/sdk/api/types/ServiceExecutionStatus.ts +0 -14
- package/src/sdk/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +0 -252
- package/src/sdk/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts +0 -106
- package/src/sdk/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +0 -239
- package/src/sdk/core/fetcher/stream-wrappers/chooseStreamWrapper.ts +0 -33
package/.gitlab-ci.yml
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
variables:
|
|
2
2
|
TWINE_USERNAME: __token__
|
|
3
|
-
DATADOG_STATIC_ANALYZER_URL: "https://github.com/DataDog/datadog-static-analyzer/releases/latest/download/datadog-static-analyzer-x86_64-unknown-linux-gnu.zip"
|
|
4
|
-
DATADOG_OSV_SCANNER_URL: "https://github.com/DataDog/osv-scanner/releases/latest/download/osv-scanner_linux_amd64.zip"
|
|
5
|
-
DATADOG_ENV: "ci"
|
|
6
|
-
DATADOG_SERVICE: "planqk-service-sdk"
|
|
7
3
|
UV_VERSION: 0.6
|
|
8
4
|
PYTHON_VERSION: 3.11
|
|
9
5
|
BASE_LAYER: bookworm-slim
|
|
@@ -17,41 +13,6 @@ stages:
|
|
|
17
13
|
- commit-release-check
|
|
18
14
|
- release-package
|
|
19
15
|
|
|
20
|
-
datadog-static-analyzer:
|
|
21
|
-
stage: commit-test
|
|
22
|
-
rules:
|
|
23
|
-
- if: '$CI_COMMIT_MESSAGE =~ /^chore\(release\):/'
|
|
24
|
-
when: never
|
|
25
|
-
- if: '$CI_PIPELINE_SOURCE == "web"'
|
|
26
|
-
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
|
|
27
|
-
image: node:lts
|
|
28
|
-
before_script:
|
|
29
|
-
- npm install -g @datadog/datadog-ci
|
|
30
|
-
- curl -L $DATADOG_STATIC_ANALYZER_URL > /tmp/datadog-static-analyzer.zip
|
|
31
|
-
- unzip /tmp/datadog-static-analyzer.zip -d /tmp
|
|
32
|
-
- mv /tmp/datadog-static-analyzer /usr/local/datadog-static-analyzer
|
|
33
|
-
script:
|
|
34
|
-
- /usr/local/datadog-static-analyzer -i . -o /tmp/report.sarif -f sarif
|
|
35
|
-
- datadog-ci sarif upload /tmp/report.sarif --service "$DATADOG_SERVICE" --env "$DATADOG_ENV"
|
|
36
|
-
|
|
37
|
-
datadog-sbom-analyzer:
|
|
38
|
-
stage: commit-test
|
|
39
|
-
rules:
|
|
40
|
-
- if: '$CI_COMMIT_MESSAGE =~ /^chore\(release\):/'
|
|
41
|
-
when: never
|
|
42
|
-
- if: '$CI_PIPELINE_SOURCE == "web"'
|
|
43
|
-
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
|
|
44
|
-
image: node:lts
|
|
45
|
-
before_script:
|
|
46
|
-
- npm install -g @datadog/datadog-ci
|
|
47
|
-
- mkdir /osv-scanner
|
|
48
|
-
- curl -L -o /osv-scanner/osv-scanner.zip $DATADOG_OSV_SCANNER_URL
|
|
49
|
-
- unzip /osv-scanner/osv-scanner.zip -d /osv-scanner
|
|
50
|
-
- chmod 755 /osv-scanner/osv-scanner
|
|
51
|
-
script:
|
|
52
|
-
- /osv-scanner/osv-scanner --skip-git -r --experimental-only-packages --format=cyclonedx-1-5 --paths-relative-to-scan-dir --output=/tmp/sbom.json .
|
|
53
|
-
- datadog-ci sbom upload --service "$DATADOG_SERVICE" --env "$DATADOG_ENV" /tmp/sbom.json
|
|
54
|
-
|
|
55
16
|
semantic-release:
|
|
56
17
|
stage: commit-release-check
|
|
57
18
|
rules:
|
|
@@ -59,6 +20,13 @@ semantic-release:
|
|
|
59
20
|
when: never
|
|
60
21
|
- if: '$CI_PIPELINE_SOURCE == "web"'
|
|
61
22
|
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
|
|
23
|
+
variables:
|
|
24
|
+
## Use the gitlab user to create the release commit
|
|
25
|
+
## https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#git-environment-variables
|
|
26
|
+
GIT_AUTHOR_NAME: "$GITLAB_USER_NAME"
|
|
27
|
+
GIT_AUTHOR_EMAIL: "$GITLAB_USER_EMAIL"
|
|
28
|
+
GIT_COMMITTER_NAME: "$GITLAB_USER_NAME"
|
|
29
|
+
GIT_COMMITTER_EMAIL: "$GITLAB_USER_EMAIL"
|
|
62
30
|
image: node:lts
|
|
63
31
|
before_script:
|
|
64
32
|
- apt-get update && apt-get install -y --no-install-recommends git-core ca-certificates
|
|
@@ -95,6 +63,7 @@ publish-node-sdk:
|
|
|
95
63
|
- npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
|
|
96
64
|
script:
|
|
97
65
|
- npm ci
|
|
66
|
+
- cp README-node.md README.md
|
|
98
67
|
- npm run build
|
|
99
68
|
- npm publish
|
|
100
69
|
cache:
|
package/README-node.md
CHANGED
|
@@ -17,25 +17,29 @@ const consumerSecret = "..."
|
|
|
17
17
|
|
|
18
18
|
const client = new PlanqkServiceClient(serviceEndpoint, consumerKey, consumerSecret)
|
|
19
19
|
|
|
20
|
-
//
|
|
21
|
-
const
|
|
22
|
-
const params = {param1: "value1", param2: "value2"};
|
|
20
|
+
// List all service executions
|
|
21
|
+
const serviceExecutions = await client.api().getServiceExecutions()
|
|
23
22
|
|
|
24
|
-
//
|
|
25
|
-
|
|
23
|
+
// Start a new service execution
|
|
24
|
+
const data = {n_coin_tosses: 2}
|
|
25
|
+
const params = {shots: 100}
|
|
26
|
+
let serviceExecution = await client.api().startExecution({data, params}, {timeoutInSeconds: 60})
|
|
26
27
|
|
|
27
|
-
//
|
|
28
|
-
serviceExecution = await client.api().getStatus(serviceExecution.id!)
|
|
28
|
+
// Check the status of the service execution
|
|
29
|
+
serviceExecution = await client.api().getStatus(serviceExecution.id!)
|
|
29
30
|
|
|
30
|
-
//
|
|
31
|
-
const finalStates = ["SUCCEEDED", "CANCELLED", "FAILED"]
|
|
31
|
+
// Wait for the service execution to finish
|
|
32
|
+
const finalStates = ["SUCCEEDED", "CANCELLED", "FAILED"]
|
|
32
33
|
while (!finalStates.includes(serviceExecution.status!)) {
|
|
33
|
-
serviceExecution = await client.api().getStatus(serviceExecution.id!)
|
|
34
|
+
serviceExecution = await client.api().getStatus(serviceExecution.id!)
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
//
|
|
37
|
+
// Get the result of the service execution
|
|
37
38
|
const result = await client.api().getResult(serviceExecution.id!)
|
|
38
39
|
|
|
39
|
-
//
|
|
40
|
+
// Get the logs of the service execution
|
|
40
41
|
const logs = await client.api().getLogs(serviceExecution.id!)
|
|
42
|
+
|
|
43
|
+
// Cancel the service execution if it is still pending or running
|
|
44
|
+
await client.api().cancelExecution(serviceExecution.id!)
|
|
41
45
|
```
|
package/README.md
CHANGED
|
@@ -1,56 +1,45 @@
|
|
|
1
|
-
#
|
|
1
|
+
# PLANQK Service SDK
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
The clients are generated from a very general [OpenAPI](https://swagger.io/specification) description using [Fern](https://buildwithfern.com).
|
|
5
|
-
The generated clients are a baseline, and the idea is to adapt and extend them to our specific needs.
|
|
3
|
+
## Installation
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
> <https://buildwithfern.com/docs/getting-started>
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm install -g fern-api
|
|
13
|
-
fern upgrade
|
|
14
|
-
fern generate
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Python Setup
|
|
18
|
-
|
|
19
|
-
To create a new virtual environment and install the dependencies, run:
|
|
5
|
+
The package can be installed using `npm`:
|
|
20
6
|
|
|
21
7
|
```bash
|
|
22
|
-
|
|
23
|
-
source .venv/bin/activate
|
|
24
|
-
|
|
25
|
-
uv sync
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
Update dependencies and lock files:
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
uv sync -U
|
|
8
|
+
npm install @planqk/planqk-service-sdk
|
|
32
9
|
```
|
|
33
10
|
|
|
34
|
-
##
|
|
11
|
+
## Usage
|
|
35
12
|
|
|
36
|
-
|
|
13
|
+
```typescript
|
|
14
|
+
const serviceEndpoint = "..."
|
|
15
|
+
const consumerKey = "..."
|
|
16
|
+
const consumerSecret = "..."
|
|
37
17
|
|
|
38
|
-
|
|
39
|
-
Make sure you overwrite any existing files.
|
|
40
|
-
It is recommended to remove the old files first.
|
|
18
|
+
const client = new PlanqkServiceClient(serviceEndpoint, consumerKey, consumerSecret)
|
|
41
19
|
|
|
42
|
-
|
|
20
|
+
// List all service executions
|
|
21
|
+
const serviceExecutions = await client.api().getServiceExecutions()
|
|
43
22
|
|
|
44
|
-
|
|
23
|
+
// Start a new service execution
|
|
24
|
+
const data = {n_coin_tosses: 2}
|
|
25
|
+
const params = {shots: 100}
|
|
26
|
+
let serviceExecution = await client.api().startExecution({data, params}, {timeoutInSeconds: 60})
|
|
45
27
|
|
|
46
|
-
|
|
28
|
+
// Check the status of the service execution
|
|
29
|
+
serviceExecution = await client.api().getStatus(serviceExecution.id!)
|
|
47
30
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
31
|
+
// Wait for the service execution to finish
|
|
32
|
+
const finalStates = ["SUCCEEDED", "CANCELLED", "FAILED"]
|
|
33
|
+
while (!finalStates.includes(serviceExecution.status!)) {
|
|
34
|
+
serviceExecution = await client.api().getStatus(serviceExecution.id!)
|
|
35
|
+
}
|
|
51
36
|
|
|
52
|
-
|
|
37
|
+
// Get the result of the service execution
|
|
38
|
+
const result = await client.api().getResult(serviceExecution.id!)
|
|
53
39
|
|
|
54
|
-
|
|
40
|
+
// Get the logs of the service execution
|
|
41
|
+
const logs = await client.api().getLogs(serviceExecution.id!)
|
|
55
42
|
|
|
56
|
-
|
|
43
|
+
// Cancel the service execution if it is still pending or running
|
|
44
|
+
await client.api().cancelExecution(serviceExecution.id!)
|
|
45
|
+
```
|
package/dist/sdk/Client.d.ts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as environments from "./environments";
|
|
5
|
-
import * as core from "./core";
|
|
6
|
-
import { ServiceApi } from "./api/resources/serviceApi/client/Client";
|
|
4
|
+
import * as environments from "./environments.js";
|
|
5
|
+
import * as core from "./core/index.js";
|
|
6
|
+
import { ServiceApi } from "./api/resources/serviceApi/client/Client.js";
|
|
7
7
|
export declare namespace PlanqkServiceApiClient {
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.PlanqkServiceApiEnvironment | string>;
|
|
10
|
+
/** Specify a custom URL to connect the client to. */
|
|
11
|
+
baseUrl?: core.Supplier<string>;
|
|
10
12
|
token: core.Supplier<core.BearerToken>;
|
|
13
|
+
/** Additional headers to include in requests. */
|
|
14
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
11
15
|
}
|
|
12
16
|
interface RequestOptions {
|
|
13
17
|
/** The maximum time to wait for a response in seconds. */
|
|
@@ -16,11 +20,13 @@ export declare namespace PlanqkServiceApiClient {
|
|
|
16
20
|
maxRetries?: number;
|
|
17
21
|
/** A hook to abort the request. */
|
|
18
22
|
abortSignal?: AbortSignal;
|
|
23
|
+
/** Additional headers to include in the request. */
|
|
24
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
19
25
|
}
|
|
20
26
|
}
|
|
21
27
|
export declare class PlanqkServiceApiClient {
|
|
22
28
|
protected readonly _options: PlanqkServiceApiClient.Options;
|
|
23
|
-
constructor(_options: PlanqkServiceApiClient.Options);
|
|
24
29
|
protected _serviceApi: ServiceApi | undefined;
|
|
30
|
+
constructor(_options: PlanqkServiceApiClient.Options);
|
|
25
31
|
get serviceApi(): ServiceApi;
|
|
26
32
|
}
|
package/dist/sdk/Client.js
CHANGED
|
@@ -2,17 +2,59 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* This file was auto-generated by Fern from our API Definition.
|
|
4
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
|
+
})();
|
|
5
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
39
|
exports.PlanqkServiceApiClient = void 0;
|
|
7
|
-
const
|
|
40
|
+
const core = __importStar(require("./core/index.js"));
|
|
41
|
+
const headers_js_1 = require("./core/headers.js");
|
|
42
|
+
const Client_js_1 = require("./api/resources/serviceApi/client/Client.js");
|
|
8
43
|
class PlanqkServiceApiClient {
|
|
9
44
|
_options;
|
|
45
|
+
_serviceApi;
|
|
10
46
|
constructor(_options) {
|
|
11
|
-
this._options =
|
|
47
|
+
this._options = {
|
|
48
|
+
..._options,
|
|
49
|
+
headers: (0, headers_js_1.mergeHeaders)({
|
|
50
|
+
"X-Fern-Language": "JavaScript",
|
|
51
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
52
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
53
|
+
}, _options?.headers),
|
|
54
|
+
};
|
|
12
55
|
}
|
|
13
|
-
_serviceApi;
|
|
14
56
|
get serviceApi() {
|
|
15
|
-
return (this._serviceApi ??= new
|
|
57
|
+
return (this._serviceApi ??= new Client_js_1.ServiceApi(this._options));
|
|
16
58
|
}
|
|
17
59
|
}
|
|
18
60
|
exports.PlanqkServiceApiClient = PlanqkServiceApiClient;
|
package/dist/sdk/api/index.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export * from "./resources";
|
|
2
|
-
export * from "./types";
|
|
3
|
-
export * from "./errors";
|
|
1
|
+
export * from "./resources/index.js";
|
|
2
|
+
export * from "./types/index.js";
|
package/dist/sdk/api/index.js
CHANGED
|
@@ -14,6 +14,5 @@ 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"), exports);
|
|
18
|
-
__exportStar(require("./types"), exports);
|
|
19
|
-
__exportStar(require("./errors"), exports);
|
|
17
|
+
__exportStar(require("./resources/index.js"), exports);
|
|
18
|
+
__exportStar(require("./types/index.js"), exports);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * as serviceApi from "./serviceApi";
|
|
2
|
-
export * from "./serviceApi/types";
|
|
1
|
+
export * as serviceApi from "./serviceApi/index.js";
|
|
2
|
+
export * from "./serviceApi/types/index.js";
|
|
@@ -37,5 +37,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.serviceApi = void 0;
|
|
40
|
-
exports.serviceApi = __importStar(require("./serviceApi"));
|
|
41
|
-
__exportStar(require("./serviceApi/types"), exports);
|
|
40
|
+
exports.serviceApi = __importStar(require("./serviceApi/index.js"));
|
|
41
|
+
__exportStar(require("./serviceApi/types/index.js"), exports);
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as environments from "../../../../environments";
|
|
5
|
-
import * as core from "../../../../core";
|
|
6
|
-
import * as PlanqkServiceApi from "../../../index";
|
|
7
|
-
import * as stream from "stream";
|
|
4
|
+
import * as environments from "../../../../environments.js";
|
|
5
|
+
import * as core from "../../../../core/index.js";
|
|
6
|
+
import * as PlanqkServiceApi from "../../../index.js";
|
|
8
7
|
export declare namespace ServiceApi {
|
|
9
8
|
interface Options {
|
|
10
9
|
environment?: core.Supplier<environments.PlanqkServiceApiEnvironment | string>;
|
|
10
|
+
/** Specify a custom URL to connect the client to. */
|
|
11
|
+
baseUrl?: core.Supplier<string>;
|
|
11
12
|
token: core.Supplier<core.BearerToken>;
|
|
13
|
+
/** Additional headers to include in requests. */
|
|
14
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
12
15
|
}
|
|
13
16
|
interface RequestOptions {
|
|
14
17
|
/** The maximum time to wait for a response in seconds. */
|
|
@@ -17,108 +20,91 @@ export declare namespace ServiceApi {
|
|
|
17
20
|
maxRetries?: number;
|
|
18
21
|
/** A hook to abort the request. */
|
|
19
22
|
abortSignal?: AbortSignal;
|
|
23
|
+
/** Additional headers to include in the request. */
|
|
24
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
20
25
|
}
|
|
21
26
|
}
|
|
22
27
|
export declare class ServiceApi {
|
|
23
28
|
protected readonly _options: ServiceApi.Options;
|
|
24
29
|
constructor(_options: ServiceApi.Options);
|
|
25
30
|
/**
|
|
26
|
-
*
|
|
31
|
+
* Retrieves a list of all service executions.
|
|
32
|
+
* The response includes links to each service execution, allowing for further queries on their status and results.
|
|
27
33
|
*
|
|
28
34
|
* @param {ServiceApi.RequestOptions} requestOptions - Request-specific configuration.
|
|
29
35
|
*
|
|
30
36
|
* @example
|
|
31
|
-
* await client.serviceApi.
|
|
37
|
+
* await client.serviceApi.getServiceExecutions()
|
|
32
38
|
*/
|
|
33
|
-
|
|
39
|
+
getServiceExecutions(requestOptions?: ServiceApi.RequestOptions): core.HttpResponsePromise<PlanqkServiceApi.ServiceExecution[]>;
|
|
40
|
+
private __getServiceExecutions;
|
|
34
41
|
/**
|
|
35
|
-
*
|
|
42
|
+
* Starts a service execution, which in turn is processed asynchronously.
|
|
36
43
|
* The location header of the response contains the URL which can be used to query the status and the result of the service execution.
|
|
37
44
|
*
|
|
38
|
-
* @param {Record<string,
|
|
45
|
+
* @param {Record<string, any>} request
|
|
39
46
|
* @param {ServiceApi.RequestOptions} requestOptions - Request-specific configuration.
|
|
40
47
|
*
|
|
41
|
-
* @throws {@link PlanqkServiceApi.BadRequestError}
|
|
42
|
-
* @throws {@link PlanqkServiceApi.UnauthorizedError}
|
|
43
|
-
* @throws {@link PlanqkServiceApi.ForbiddenError}
|
|
44
|
-
* @throws {@link PlanqkServiceApi.NotFoundError}
|
|
45
|
-
* @throws {@link PlanqkServiceApi.InternalServerError}
|
|
46
|
-
*
|
|
47
48
|
* @example
|
|
48
|
-
* await client.serviceApi.
|
|
49
|
-
* "key":
|
|
50
|
-
* "key": "value"
|
|
51
|
-
* }
|
|
49
|
+
* await client.serviceApi.startExecution({
|
|
50
|
+
* "key": "value"
|
|
52
51
|
* })
|
|
53
52
|
*/
|
|
54
|
-
|
|
53
|
+
startExecution(request: Record<string, any>, requestOptions?: ServiceApi.RequestOptions): core.HttpResponsePromise<PlanqkServiceApi.ServiceExecution>;
|
|
54
|
+
private __startExecution;
|
|
55
55
|
/**
|
|
56
|
-
*
|
|
56
|
+
* Retrieves the status of a service execution.
|
|
57
|
+
* The status can be one of the following: UNKNOWN, PENDING, RUNNING, SUCCEEDED, CANCELLED, FAILED.
|
|
57
58
|
*
|
|
58
59
|
* @param {string} id - The id of a service execution
|
|
59
60
|
* @param {ServiceApi.RequestOptions} requestOptions - Request-specific configuration.
|
|
60
61
|
*
|
|
61
|
-
* @throws {@link PlanqkServiceApi.UnauthorizedError}
|
|
62
|
-
* @throws {@link PlanqkServiceApi.ForbiddenError}
|
|
63
|
-
* @throws {@link PlanqkServiceApi.NotFoundError}
|
|
64
|
-
* @throws {@link PlanqkServiceApi.InternalServerError}
|
|
65
|
-
*
|
|
66
62
|
* @example
|
|
67
63
|
* await client.serviceApi.getStatus("id")
|
|
68
64
|
*/
|
|
69
|
-
getStatus(id: string, requestOptions?: ServiceApi.RequestOptions):
|
|
65
|
+
getStatus(id: string, requestOptions?: ServiceApi.RequestOptions): core.HttpResponsePromise<PlanqkServiceApi.ServiceExecution>;
|
|
66
|
+
private __getStatus;
|
|
70
67
|
/**
|
|
71
|
-
*
|
|
68
|
+
* Retrieves the result of a service execution.
|
|
69
|
+
* The result is returned as a JSON object containing the status and any additional data.
|
|
70
|
+
* The result may include links to download specific result files.
|
|
72
71
|
*
|
|
73
72
|
* @param {string} id - The id of a service execution
|
|
74
73
|
* @param {ServiceApi.RequestOptions} requestOptions - Request-specific configuration.
|
|
75
74
|
*
|
|
76
|
-
* @throws {@link PlanqkServiceApi.UnauthorizedError}
|
|
77
|
-
* @throws {@link PlanqkServiceApi.ForbiddenError}
|
|
78
|
-
* @throws {@link PlanqkServiceApi.NotFoundError}
|
|
79
|
-
* @throws {@link PlanqkServiceApi.InternalServerError}
|
|
80
|
-
*
|
|
81
75
|
* @example
|
|
82
76
|
* await client.serviceApi.getResult("id")
|
|
83
77
|
*/
|
|
84
|
-
getResult(id: string, requestOptions?: ServiceApi.RequestOptions):
|
|
78
|
+
getResult(id: string, requestOptions?: ServiceApi.RequestOptions): core.HttpResponsePromise<PlanqkServiceApi.GetResultResponse>;
|
|
79
|
+
private __getResult;
|
|
85
80
|
/**
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
* @throws {@link PlanqkServiceApi.NotFoundError}
|
|
90
|
-
* @throws {@link PlanqkServiceApi.InternalServerError}
|
|
81
|
+
* Retrieves a specific result file of a service execution.
|
|
82
|
+
* The file name is provided in the path parameter.
|
|
83
|
+
* The result file is returned as a binary stream.
|
|
91
84
|
*/
|
|
92
|
-
getResultFile(id: string, file: string, requestOptions?: ServiceApi.RequestOptions):
|
|
85
|
+
getResultFile(id: string, file: string, requestOptions?: ServiceApi.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
|
|
86
|
+
private __getResultFile;
|
|
93
87
|
/**
|
|
94
|
-
*
|
|
88
|
+
* Returns a list of log entries for a service execution in chronological order, where the first entry is the oldest.
|
|
95
89
|
*
|
|
96
90
|
* @param {string} id - The id of a service execution
|
|
97
91
|
* @param {ServiceApi.RequestOptions} requestOptions - Request-specific configuration.
|
|
98
92
|
*
|
|
99
|
-
* @throws {@link PlanqkServiceApi.UnauthorizedError}
|
|
100
|
-
* @throws {@link PlanqkServiceApi.ForbiddenError}
|
|
101
|
-
* @throws {@link PlanqkServiceApi.NotFoundError}
|
|
102
|
-
* @throws {@link PlanqkServiceApi.InternalServerError}
|
|
103
|
-
*
|
|
104
93
|
* @example
|
|
105
94
|
* await client.serviceApi.getLogs("id")
|
|
106
95
|
*/
|
|
107
|
-
getLogs(id: string, requestOptions?: ServiceApi.RequestOptions):
|
|
96
|
+
getLogs(id: string, requestOptions?: ServiceApi.RequestOptions): core.HttpResponsePromise<string[]>;
|
|
97
|
+
private __getLogs;
|
|
108
98
|
/**
|
|
109
|
-
*
|
|
99
|
+
* Cancel a pending or running service execution.
|
|
110
100
|
*
|
|
111
101
|
* @param {string} id - The id of a service execution
|
|
112
102
|
* @param {ServiceApi.RequestOptions} requestOptions - Request-specific configuration.
|
|
113
103
|
*
|
|
114
|
-
* @throws {@link PlanqkServiceApi.UnauthorizedError}
|
|
115
|
-
* @throws {@link PlanqkServiceApi.ForbiddenError}
|
|
116
|
-
* @throws {@link PlanqkServiceApi.NotFoundError}
|
|
117
|
-
* @throws {@link PlanqkServiceApi.InternalServerError}
|
|
118
|
-
*
|
|
119
104
|
* @example
|
|
120
|
-
* await client.serviceApi.
|
|
105
|
+
* await client.serviceApi.cancelExecution("id")
|
|
121
106
|
*/
|
|
122
|
-
|
|
107
|
+
cancelExecution(id: string, requestOptions?: ServiceApi.RequestOptions): core.HttpResponsePromise<PlanqkServiceApi.ServiceExecution>;
|
|
108
|
+
private __cancelExecution;
|
|
123
109
|
protected _getAuthorizationHeader(): Promise<string>;
|
|
124
110
|
}
|