@planqk/planqk-service-sdk 1.5.1 → 1.7.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.
Files changed (27) hide show
  1. package/dist/sdk/api/resources/serviceApi/client/requests/StartExecutionRequest.d.ts +2 -0
  2. package/dist/sdk/api/resources/serviceApi/types/GetResultResponse.d.ts +1 -1
  3. package/dist/sdk/api/types/ArrayResponse.d.ts +4 -0
  4. package/dist/sdk/api/types/InputDataRef.d.ts +8 -0
  5. package/dist/sdk/api/types/InputParamsRef.d.ts +8 -0
  6. package/dist/sdk/api/types/InputParamsRef.js +5 -0
  7. package/dist/sdk/api/types/{ErrorResponse.d.ts → NumberResponse.d.ts} +1 -1
  8. package/dist/sdk/api/types/NumberResponse.js +5 -0
  9. package/dist/sdk/api/types/{ResultResponse.d.ts → ObjectResponse.d.ts} +1 -1
  10. package/dist/sdk/api/types/ObjectResponse.js +5 -0
  11. package/dist/sdk/api/types/StringResponse.d.ts +4 -0
  12. package/dist/sdk/api/types/StringResponse.js +5 -0
  13. package/dist/sdk/api/types/index.d.ts +6 -2
  14. package/dist/sdk/api/types/index.js +6 -2
  15. package/package.json +1 -1
  16. package/src/sdk/api/resources/serviceApi/client/requests/StartExecutionRequest.ts +2 -0
  17. package/src/sdk/api/resources/serviceApi/types/GetResultResponse.ts +5 -1
  18. package/src/sdk/api/types/ArrayResponse.ts +5 -0
  19. package/src/sdk/api/types/InputDataRef.ts +9 -0
  20. package/src/sdk/api/types/InputParamsRef.ts +9 -0
  21. package/src/sdk/api/types/{ErrorResponse.ts → NumberResponse.ts} +1 -1
  22. package/src/sdk/api/types/{ResultResponse.ts → ObjectResponse.ts} +1 -1
  23. package/src/sdk/api/types/StringResponse.ts +5 -0
  24. package/src/sdk/api/types/index.ts +6 -2
  25. package/tests/integration.test.ts +29 -1
  26. /package/dist/sdk/api/types/{ErrorResponse.js → ArrayResponse.js} +0 -0
  27. /package/dist/sdk/api/types/{ResultResponse.js → InputDataRef.js} +0 -0
@@ -8,5 +8,7 @@ import * as PlanqkServiceApi from "../../../..";
8
8
  */
9
9
  export interface StartExecutionRequest {
10
10
  data?: PlanqkServiceApi.InputData;
11
+ dataRef?: PlanqkServiceApi.InputDataRef;
11
12
  params?: PlanqkServiceApi.InputParams;
13
+ paramsRef?: PlanqkServiceApi.InputParamsRef;
12
14
  }
@@ -2,4 +2,4 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as PlanqkServiceApi from "../../..";
5
- export type GetResultResponse = PlanqkServiceApi.ResultResponse | PlanqkServiceApi.ErrorResponse;
5
+ export type GetResultResponse = PlanqkServiceApi.ObjectResponse | PlanqkServiceApi.StringResponse | PlanqkServiceApi.NumberResponse | PlanqkServiceApi.ArrayResponse;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export type ArrayResponse = Record<string, any>[];
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface InputDataRef {
5
+ dataPoolId: string;
6
+ dataSourceDescriptorId: string;
7
+ fileId: string;
8
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface InputParamsRef {
5
+ dataPoolId: string;
6
+ dataSourceDescriptorId: string;
7
+ fileId: string;
8
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export type ErrorResponse = Record<string, any>;
4
+ export type NumberResponse = number;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export type ResultResponse = Record<string, any>;
4
+ export type ObjectResponse = Record<string, any>;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export type StringResponse = string;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,11 @@
1
1
  export * from "./InputData";
2
+ export * from "./InputDataRef";
2
3
  export * from "./InputParams";
4
+ export * from "./InputParamsRef";
3
5
  export * from "./InterimResultResponse";
4
- export * from "./ResultResponse";
5
- export * from "./ErrorResponse";
6
+ export * from "./ObjectResponse";
7
+ export * from "./StringResponse";
8
+ export * from "./NumberResponse";
9
+ export * from "./ArrayResponse";
6
10
  export * from "./JobStatus";
7
11
  export * from "./Job";
@@ -15,9 +15,13 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./InputData"), exports);
18
+ __exportStar(require("./InputDataRef"), exports);
18
19
  __exportStar(require("./InputParams"), exports);
20
+ __exportStar(require("./InputParamsRef"), exports);
19
21
  __exportStar(require("./InterimResultResponse"), exports);
20
- __exportStar(require("./ResultResponse"), exports);
21
- __exportStar(require("./ErrorResponse"), exports);
22
+ __exportStar(require("./ObjectResponse"), exports);
23
+ __exportStar(require("./StringResponse"), exports);
24
+ __exportStar(require("./NumberResponse"), exports);
25
+ __exportStar(require("./ArrayResponse"), exports);
22
26
  __exportStar(require("./JobStatus"), exports);
23
27
  __exportStar(require("./Job"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planqk/planqk-service-sdk",
3
- "version": "1.5.1",
3
+ "version": "1.7.0",
4
4
  "description": "Typescript SDK to execute PlanQK Managed Services.",
5
5
  "author": "Kipu Quantum GmbH",
6
6
  "contributors": [
@@ -10,5 +10,7 @@ import * as PlanqkServiceApi from "../../../..";
10
10
  */
11
11
  export interface StartExecutionRequest {
12
12
  data?: PlanqkServiceApi.InputData;
13
+ dataRef?: PlanqkServiceApi.InputDataRef;
13
14
  params?: PlanqkServiceApi.InputParams;
15
+ paramsRef?: PlanqkServiceApi.InputParamsRef;
14
16
  }
@@ -4,4 +4,8 @@
4
4
 
5
5
  import * as PlanqkServiceApi from "../../..";
6
6
 
7
- export type GetResultResponse = PlanqkServiceApi.ResultResponse | PlanqkServiceApi.ErrorResponse;
7
+ export type GetResultResponse =
8
+ | PlanqkServiceApi.ObjectResponse
9
+ | PlanqkServiceApi.StringResponse
10
+ | PlanqkServiceApi.NumberResponse
11
+ | PlanqkServiceApi.ArrayResponse;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+
5
+ export type ArrayResponse = Record<string, any>[];
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+
5
+ export interface InputDataRef {
6
+ dataPoolId: string;
7
+ dataSourceDescriptorId: string;
8
+ fileId: string;
9
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+
5
+ export interface InputParamsRef {
6
+ dataPoolId: string;
7
+ dataSourceDescriptorId: string;
8
+ fileId: string;
9
+ }
@@ -2,4 +2,4 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
 
5
- export type ErrorResponse = Record<string, any>;
5
+ export type NumberResponse = number;
@@ -2,4 +2,4 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
 
5
- export type ResultResponse = Record<string, any>;
5
+ export type ObjectResponse = Record<string, any>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+
5
+ export type StringResponse = string;
@@ -1,7 +1,11 @@
1
1
  export * from "./InputData";
2
+ export * from "./InputDataRef";
2
3
  export * from "./InputParams";
4
+ export * from "./InputParamsRef";
3
5
  export * from "./InterimResultResponse";
4
- export * from "./ResultResponse";
5
- export * from "./ErrorResponse";
6
+ export * from "./ObjectResponse";
7
+ export * from "./StringResponse";
8
+ export * from "./NumberResponse";
9
+ export * from "./ArrayResponse";
6
10
  export * from "./JobStatus";
7
11
  export * from "./Job";
@@ -1,6 +1,6 @@
1
1
  import {PlanqkServiceAuth, PlanqkServiceClient} from '../src'
2
2
  import {PlanqkServiceApiClient} from '../src/sdk'
3
- import {JobStatus} from '../src/sdk/api'
3
+ import {JobStatus, StartExecutionRequest} from '../src/sdk/api'
4
4
  import {complexInput} from './fixtures/complex-input'
5
5
 
6
6
  const serviceEndpoint = process.env.SERVICE_ENDPOINT
@@ -59,3 +59,31 @@ test('should use client abstraction', async () => {
59
59
  job = await client.getStatus(job.id!)
60
60
  expect(job.status).toBe(JobStatus.Succeeded)
61
61
  }, 5 * 60 * 1000)
62
+
63
+ test('should execute with data pool ref', async () => {
64
+ const client = new PlanqkServiceClient(serviceEndpoint, consumerKey, consumerSecret)
65
+
66
+ const health = await client.healthCheck()
67
+ expect(health.status).toBe('Service is up and running')
68
+
69
+ const request: StartExecutionRequest = {
70
+ dataRef: {
71
+ dataPoolId: 'e3859bb2-1959-4d3d-852b-62ee81b28a72',
72
+ dataSourceDescriptorId: '1c8d341e-1c86-4e19-acae-2f84bcab55ca',
73
+ fileId: 'f5251675-49c6-49f3-a3a6-de75b8335d76',
74
+ },
75
+ params: {},
76
+ }
77
+
78
+ let job = await client.startExecution(request)
79
+ expect(job.id).toBeDefined()
80
+ expect(job.status).toBe(JobStatus.Pending)
81
+
82
+ job = await client.getStatus(job.id!)
83
+
84
+ const result = await client.getResult(job.id!)
85
+ expect(result).toBeDefined()
86
+
87
+ job = await client.getStatus(job.id!)
88
+ expect(job.status).toBe(JobStatus.Succeeded)
89
+ }, 5 * 60 * 1000)