@planqk/planqk-service-sdk 2.1.1 → 2.1.2

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 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.md CHANGED
@@ -1,56 +1,41 @@
1
- # planqk-service-sdk
1
+ # PLANQK Service SDK
2
2
 
3
- This repository contains the SDK clients to execute PLANQK Managed Services.
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
- ## Generate the SDK clients with Fern
8
-
9
- > <https://buildwithfern.com/docs/getting-started>
5
+ The package can be installed using `npm`:
10
6
 
11
7
  ```bash
12
- npm install -g fern-api
13
- fern upgrade
14
- fern generate
8
+ npm install @planqk/planqk-service-sdk
15
9
  ```
16
10
 
17
- ## Python Setup
18
-
19
- To create a new virtual environment and install the dependencies, run:
11
+ ## Usage
20
12
 
21
- ```bash
22
- uv venv
23
- source .venv/bin/activate
13
+ ```typescript
14
+ const serviceEndpoint = "..."
15
+ const consumerKey = "..."
16
+ const consumerSecret = "..."
24
17
 
25
- uv sync
26
- ```
18
+ const client = new PlanqkServiceClient(serviceEndpoint, consumerKey, consumerSecret)
27
19
 
28
- Update dependencies and lock files:
29
-
30
- ```bash
31
- uv sync -U
32
- ```
20
+ // prepare your input data and parameters
21
+ const data = {input: {a: 1, b: 2}};
22
+ const params = {param1: "value1", param2: "value2"};
33
23
 
34
- ## How to update the Python client?
24
+ // execute the service
25
+ let serviceExecution = await client.api().execute({data, params})
35
26
 
36
- After generating the SDK clients with Fern, the Python client needs to be copied manually.
27
+ // retrieve the status of a service execution
28
+ serviceExecution = await client.api().getStatus(serviceExecution.id!);
37
29
 
38
- Copy the content of `./generated/python` to `./planqk/service/sdk`.
39
- Make sure you overwrite any existing files.
40
- It is recommended to remove the old files first.
30
+ // wait for the service execution to finish
31
+ const finalStates = ["SUCCEEDED", "CANCELLED", "FAILED"];
32
+ while (!finalStates.includes(serviceExecution.status!)) {
33
+ serviceExecution = await client.api().getStatus(serviceExecution.id!);
34
+ }
41
35
 
42
- Next, check by executing `pytest` if the changes are compatible with our wrapper.
36
+ // retrieve the result
37
+ const result = await client.api().getResult(serviceExecution.id!)
43
38
 
44
- ## How to update the TypeScript client?
45
-
46
- After generating the SDK clients with Fern, the TypeScript client needs to be copied manually.
47
-
48
- Copy the content of `./generated/typescript` to `./typescript/src/sdk`.
49
- Make sure you overwrite any existing files.
50
- It is recommended to remove the old files first.
51
-
52
- Next, check by executing `npm test` if the changes are compatible with our wrapper.
53
-
54
- ## License
55
-
56
- Apache-2.0 | Copyright 2023-2024 Kipu Quantum GmbH
39
+ // retrieve the logs
40
+ const logs = await client.api().getLogs(serviceExecution.id!)
41
+ ```
@@ -18,6 +18,7 @@
18
18
  "outputs": [],
19
19
  "source": [
20
20
  "import os\n",
21
+ "\n",
21
22
  "from dotenv import load_dotenv\n",
22
23
  "\n",
23
24
  "# Make a copy of .env.example and rename it to .env, place it in the \n",
@@ -218,7 +219,6 @@
218
219
  "metadata": {},
219
220
  "outputs": [],
220
221
  "source": [
221
- "import json\n",
222
222
  "from planqk.service.sdk.types.input_data_ref import InputDataRef\n",
223
223
  "\n",
224
224
  "# Create a client\n",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planqk/planqk-service-sdk",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "description": "SDK to interact with PLANQK Managed Services.",
5
5
  "author": "Kipu Quantum GmbH",
6
6
  "contributors": [
@@ -45,6 +45,5 @@
45
45
  "private": false,
46
46
  "publishConfig": {
47
47
  "access": "public"
48
- },
49
- "readme": "./README-node.md"
48
+ }
50
49
  }
@@ -1 +1 @@
1
- __version__ = "2.1.1"
1
+ __version__ = "2.1.2"
package/pyproject.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "planqk-service-sdk"
3
- version = "2.1.1"
3
+ version = "2.1.2"
4
4
  description = "SDK to interact with PLANQK Managed Services."
5
5
  authors = [
6
6
  { name = "Kipu Quantum GmbH", email = "info@kipu-quantum.com" },