@scaleway/sdk-qaas 1.5.0 → 2.1.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/README.md +96 -0
- package/dist/v1alpha1/api.gen.d.ts +12 -12
- package/dist/v1alpha1/api.gen.js +55 -97
- package/dist/v1alpha1/index.gen.d.ts +2 -2
- package/dist/v1alpha1/marshalling.gen.d.ts +1 -1
- package/dist/v1alpha1/marshalling.gen.js +11 -13
- package/dist/v1alpha1/types.gen.d.ts +5 -5
- package/package.json +6 -9
- package/dist/index.gen.cjs +0 -4
- package/dist/v1alpha1/api.gen.cjs +0 -635
- package/dist/v1alpha1/content.gen.cjs +0 -25
- package/dist/v1alpha1/index.gen.cjs +0 -38
- package/dist/v1alpha1/marshalling.gen.cjs +0 -426
- package/dist/v1alpha1/validation-rules.gen.cjs +0 -14
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# @scaleway/sdk-qaas
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@scaleway/sdk-qaas)
|
|
4
|
+
[](https://www.npmjs.com/package/@scaleway/sdk-qaas)
|
|
5
|
+
[](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE)
|
|
6
|
+
|
|
7
|
+
Scaleway SDK for Qaas API.
|
|
8
|
+
|
|
9
|
+
> **Note**
|
|
10
|
+
> This is an automatically generated package that is part of the [Scaleway SDK for JavaScript](https://github.com/scaleway/scaleway-sdk-js).
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @scaleway/sdk-qaas @scaleway/sdk-client
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
or with pnpm:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pnpm add @scaleway/sdk-qaas @scaleway/sdk-client
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
or with yarn:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
yarn add @scaleway/sdk-qaas @scaleway/sdk-client
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Getting Started
|
|
31
|
+
|
|
32
|
+
You'll need a pair of access and secret keys to connect to Scaleway API. Please check the [documentation](https://www.scaleway.com/en/docs/identity-and-access-management/iam/how-to/create-api-keys/) on how to retrieve them.
|
|
33
|
+
|
|
34
|
+
### Basic Usage
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
import { createClient } from '@scaleway/sdk-client'
|
|
38
|
+
import { Qaas } from '@scaleway/sdk-qaas'
|
|
39
|
+
|
|
40
|
+
const client = createClient({
|
|
41
|
+
accessKey: 'SCWXXXXXXXXXXXXXXXXX',
|
|
42
|
+
secretKey: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
|
43
|
+
defaultProjectId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
|
|
44
|
+
defaultRegion: 'fr-par',
|
|
45
|
+
defaultZone: 'fr-par-1',
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
const api = new Qaas.v1.API(client)
|
|
49
|
+
|
|
50
|
+
// Use the API
|
|
51
|
+
// Example: await api.listServers()
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Using Configuration Loader
|
|
55
|
+
|
|
56
|
+
For a simpler setup, you can load credentials from the configuration file or environment variables:
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
import { createClient } from '@scaleway/sdk-client'
|
|
60
|
+
import { loadProfileFromConfigurationFile } from '@scaleway/configuration-loader'
|
|
61
|
+
import { Qaas } from '@scaleway/sdk-qaas'
|
|
62
|
+
|
|
63
|
+
const profile = loadProfileFromConfigurationFile()
|
|
64
|
+
const client = createClient(profile)
|
|
65
|
+
const api = new Qaas.v1.API(client)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Documentation
|
|
69
|
+
|
|
70
|
+
- 📚 [Scaleway SDK Reference Documentation](https://scaleway.github.io/scaleway-sdk-js)
|
|
71
|
+
- 🌐 [Scaleway Qaas API Documentation](https://www.scaleway.com/en/developers/api/qaas/)
|
|
72
|
+
- 📖 [Main Repository](https://github.com/scaleway/scaleway-sdk-js)
|
|
73
|
+
- 💡 [Example Projects](https://github.com/scaleway/scaleway-sdk-js/tree/master/examples)
|
|
74
|
+
|
|
75
|
+
## Features
|
|
76
|
+
|
|
77
|
+
- ✅ Full TypeScript support with complete type definitions
|
|
78
|
+
- ✅ Promise-based API
|
|
79
|
+
- ✅ Automatic pagination helpers
|
|
80
|
+
- ✅ Built-in error handling
|
|
81
|
+
- ✅ Compatible with Node.js ≥ 20
|
|
82
|
+
|
|
83
|
+
## Support
|
|
84
|
+
|
|
85
|
+
We love feedback! Feel free to reach us on:
|
|
86
|
+
- [Scaleway Slack community](https://slack.scaleway.com/) - Join us on [#opensource](https://scaleway-community.slack.com/app_redirect?channel=opensource)
|
|
87
|
+
- [GitHub Issues](https://github.com/scaleway/scaleway-sdk-js/issues)
|
|
88
|
+
|
|
89
|
+
## Contributing
|
|
90
|
+
|
|
91
|
+
This repository is at its early stage and is still in active development. If you are looking for a way to contribute, please read [CONTRIBUTING.md](https://github.com/scaleway/scaleway-sdk-js/blob/master/CONTRIBUTING.md).
|
|
92
|
+
|
|
93
|
+
## License
|
|
94
|
+
|
|
95
|
+
This project is Apache 2.0 licensed. See the [LICENSE](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE) file for details.
|
|
96
|
+
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
2
1
|
import type { WaitForOptions } from '@scaleway/sdk-client';
|
|
3
|
-
import
|
|
2
|
+
import { API as ParentAPI } from '@scaleway/sdk-client';
|
|
3
|
+
import type { Application, Booking, CancelJobRequest, CancelProcessRequest, CreateJobRequest, CreateModelRequest, CreateProcessRequest, CreateSessionRequest, DeleteJobRequest, DeleteProcessRequest, DeleteSessionRequest, GetApplicationRequest, GetBookingRequest, GetJobCircuitRequest, GetJobRequest, GetModelRequest, GetPlatformRequest, GetProcessRequest, GetSessionRequest, Job, JobCircuit, ListApplicationsRequest, ListApplicationsResponse, ListBookingsRequest, ListBookingsResponse, ListJobResultsRequest, ListJobResultsResponse, ListJobsRequest, ListJobsResponse, ListModelsRequest, ListModelsResponse, ListPlatformsRequest, ListPlatformsResponse, ListProcessesRequest, ListProcessesResponse, ListProcessResultsRequest, ListProcessResultsResponse, ListSessionACLsRequest, ListSessionACLsResponse, ListSessionsRequest, ListSessionsResponse, Model, Platform, Process, Session, TerminateSessionRequest, UpdateBookingRequest, UpdateJobRequest, UpdateProcessRequest, UpdateSessionRequest } from './types.gen.js';
|
|
4
4
|
/**
|
|
5
5
|
* Quantum as a Service API.
|
|
6
6
|
|
|
7
|
-
This API allows you to
|
|
7
|
+
This API allows you to allocate and program Quantum Processing Units (QPUs) to run quantum algorithms.
|
|
8
8
|
*/
|
|
9
9
|
export declare class API extends ParentAPI {
|
|
10
10
|
/**
|
|
11
|
-
* Get job information. Retrieve information about the provided **job ID**,
|
|
11
|
+
* Get job information. Retrieve information about the provided **job ID**, mainly used to get the current status.
|
|
12
12
|
*
|
|
13
13
|
* @param request - The request {@link GetJobRequest}
|
|
14
14
|
* @returns A Promise of Job
|
|
@@ -24,7 +24,7 @@ export declare class API extends ParentAPI {
|
|
|
24
24
|
waitForJob: (request: Readonly<GetJobRequest>, options?: Readonly<WaitForOptions<Job>>) => Promise<Job>;
|
|
25
25
|
protected pageOfListJobs: (request?: Readonly<ListJobsRequest>) => Promise<ListJobsResponse>;
|
|
26
26
|
/**
|
|
27
|
-
* List all jobs within a project or session. Retrieve information about all jobs within a given
|
|
27
|
+
* List all jobs within a project or session. Retrieve information about all jobs within a given session.
|
|
28
28
|
*
|
|
29
29
|
* @param request - The request {@link ListJobsRequest}
|
|
30
30
|
* @returns A Promise of ListJobsResponse
|
|
@@ -45,7 +45,7 @@ export declare class API extends ParentAPI {
|
|
|
45
45
|
[Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen.js").JobResult[], void, void>;
|
|
46
46
|
};
|
|
47
47
|
/**
|
|
48
|
-
* Create a job. Create a job to be executed inside a session.
|
|
48
|
+
* Create a job. Create a job to be executed inside a QPU session.
|
|
49
49
|
*
|
|
50
50
|
* @param request - The request {@link CreateJobRequest}
|
|
51
51
|
* @returns A Promise of Job
|
|
@@ -97,7 +97,7 @@ export declare class API extends ParentAPI {
|
|
|
97
97
|
[Symbol.asyncIterator]: () => AsyncGenerator<Platform[], void, void>;
|
|
98
98
|
};
|
|
99
99
|
/**
|
|
100
|
-
* Get session information. Retrieve information about the provided **session ID**, such as name
|
|
100
|
+
* Get session information. Retrieve information about the provided **session ID**, such as name and status.
|
|
101
101
|
*
|
|
102
102
|
* @param request - The request {@link GetSessionRequest}
|
|
103
103
|
* @returns A Promise of Session
|
|
@@ -113,7 +113,7 @@ export declare class API extends ParentAPI {
|
|
|
113
113
|
waitForSession: (request: Readonly<GetSessionRequest>, options?: Readonly<WaitForOptions<Session>>) => Promise<Session>;
|
|
114
114
|
protected pageOfListSessions: (request?: Readonly<ListSessionsRequest>) => Promise<ListSessionsResponse>;
|
|
115
115
|
/**
|
|
116
|
-
* List all sessions. Retrieve information about all sessions.
|
|
116
|
+
* List all sessions. Retrieve information about all QPU sessions.
|
|
117
117
|
*
|
|
118
118
|
* @param request - The request {@link ListSessionsRequest}
|
|
119
119
|
* @returns A Promise of ListSessionsResponse
|
|
@@ -123,7 +123,7 @@ export declare class API extends ParentAPI {
|
|
|
123
123
|
[Symbol.asyncIterator]: () => AsyncGenerator<Session[], void, void>;
|
|
124
124
|
};
|
|
125
125
|
/**
|
|
126
|
-
* Create a session. Create a
|
|
126
|
+
* Create a session. Create a new QPU session for the specified platform. Once ready, jobs can be sent to this session.
|
|
127
127
|
*
|
|
128
128
|
* @param request - The request {@link CreateSessionRequest}
|
|
129
129
|
* @returns A Promise of Session
|
|
@@ -137,14 +137,14 @@ export declare class API extends ParentAPI {
|
|
|
137
137
|
*/
|
|
138
138
|
updateSession: (request: Readonly<UpdateSessionRequest>) => Promise<Session>;
|
|
139
139
|
/**
|
|
140
|
-
* Terminate an existing session. Terminate a session by its unique ID and cancel all its attached jobs and
|
|
140
|
+
* Terminate an existing session. Terminate a session by its unique ID and cancel all its attached jobs and bookings.
|
|
141
141
|
*
|
|
142
142
|
* @param request - The request {@link TerminateSessionRequest}
|
|
143
143
|
* @returns A Promise of Session
|
|
144
144
|
*/
|
|
145
145
|
terminateSession: (request: Readonly<TerminateSessionRequest>) => Promise<Session>;
|
|
146
146
|
/**
|
|
147
|
-
* Delete an existing session. Delete a session by its unique ID and delete all its attached
|
|
147
|
+
* Delete an existing session. Delete a session by its unique ID and delete all its attached jobs and bookings.
|
|
148
148
|
*
|
|
149
149
|
* @param request - The request {@link DeleteSessionRequest}
|
|
150
150
|
*/
|
|
@@ -219,7 +219,7 @@ export declare class API extends ParentAPI {
|
|
|
219
219
|
[Symbol.asyncIterator]: () => AsyncGenerator<import("./types.gen.js").ProcessResult[], void, void>;
|
|
220
220
|
};
|
|
221
221
|
/**
|
|
222
|
-
* Get application information. Retrieve information about the provided **
|
|
222
|
+
* Get application information. Retrieve information about the provided **application ID**, such as name, type and compatible platforms.
|
|
223
223
|
*
|
|
224
224
|
* @param request - The request {@link GetApplicationRequest}
|
|
225
225
|
* @returns A Promise of Application
|
package/dist/v1alpha1/api.gen.js
CHANGED
|
@@ -6,7 +6,7 @@ const jsonContentHeaders = {
|
|
|
6
6
|
};
|
|
7
7
|
class API extends API$1 {
|
|
8
8
|
/**
|
|
9
|
-
* Get job information. Retrieve information about the provided **job ID**,
|
|
9
|
+
* Get job information. Retrieve information about the provided **job ID**, mainly used to get the current status.
|
|
10
10
|
*
|
|
11
11
|
* @param request - The request {@link GetJobRequest}
|
|
12
12
|
* @returns A Promise of Job
|
|
@@ -38,27 +38,25 @@ class API extends API$1 {
|
|
|
38
38
|
urlParams: urlParams(
|
|
39
39
|
["order_by", request.orderBy],
|
|
40
40
|
["page", request.page],
|
|
41
|
-
[
|
|
42
|
-
"page_size",
|
|
43
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
44
|
-
],
|
|
41
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
45
42
|
["tags", request.tags],
|
|
46
|
-
...Object.entries(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
43
|
+
...Object.entries(resolveOneOf([
|
|
44
|
+
{
|
|
45
|
+
param: "session_id",
|
|
46
|
+
value: request.sessionId
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
default: this.client.settings.defaultProjectId,
|
|
50
|
+
param: "project_id",
|
|
51
|
+
value: request.projectId
|
|
52
|
+
}
|
|
53
|
+
]))
|
|
56
54
|
)
|
|
57
55
|
},
|
|
58
56
|
unmarshalListJobsResponse
|
|
59
57
|
);
|
|
60
58
|
/**
|
|
61
|
-
* List all jobs within a project or session. Retrieve information about all jobs within a given
|
|
59
|
+
* List all jobs within a project or session. Retrieve information about all jobs within a given session.
|
|
62
60
|
*
|
|
63
61
|
* @param request - The request {@link ListJobsRequest}
|
|
64
62
|
* @returns A Promise of ListJobsResponse
|
|
@@ -71,10 +69,7 @@ class API extends API$1 {
|
|
|
71
69
|
urlParams: urlParams(
|
|
72
70
|
["order_by", request.orderBy],
|
|
73
71
|
["page", request.page],
|
|
74
|
-
[
|
|
75
|
-
"page_size",
|
|
76
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
77
|
-
]
|
|
72
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
|
|
78
73
|
)
|
|
79
74
|
},
|
|
80
75
|
unmarshalListJobResultsResponse
|
|
@@ -87,7 +82,7 @@ class API extends API$1 {
|
|
|
87
82
|
*/
|
|
88
83
|
listJobResults = (request) => enrichForPagination("jobResults", this.pageOfListJobResults, request);
|
|
89
84
|
/**
|
|
90
|
-
* Create a job. Create a job to be executed inside a session.
|
|
85
|
+
* Create a job. Create a job to be executed inside a QPU session.
|
|
91
86
|
*
|
|
92
87
|
* @param request - The request {@link CreateJobRequest}
|
|
93
88
|
* @returns A Promise of Job
|
|
@@ -140,10 +135,12 @@ class API extends API$1 {
|
|
|
140
135
|
*
|
|
141
136
|
* @param request - The request {@link DeleteJobRequest}
|
|
142
137
|
*/
|
|
143
|
-
deleteJob = (request) => this.client.fetch(
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
138
|
+
deleteJob = (request) => this.client.fetch(
|
|
139
|
+
{
|
|
140
|
+
method: "DELETE",
|
|
141
|
+
path: `/qaas/v1alpha1/jobs/${validatePathParam("jobId", request.jobId)}`
|
|
142
|
+
}
|
|
143
|
+
);
|
|
147
144
|
/**
|
|
148
145
|
* Get a job circuit. Retrieve the circuit of the provided **job ID**.
|
|
149
146
|
*
|
|
@@ -179,10 +176,7 @@ class API extends API$1 {
|
|
|
179
176
|
["name", request.name],
|
|
180
177
|
["order_by", request.orderBy],
|
|
181
178
|
["page", request.page],
|
|
182
|
-
[
|
|
183
|
-
"page_size",
|
|
184
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
185
|
-
],
|
|
179
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
186
180
|
["platform_technology", request.platformTechnology],
|
|
187
181
|
["platform_type", request.platformType],
|
|
188
182
|
["provider_name", request.providerName]
|
|
@@ -198,7 +192,7 @@ class API extends API$1 {
|
|
|
198
192
|
*/
|
|
199
193
|
listPlatforms = (request = {}) => enrichForPagination("platforms", this.pageOfListPlatforms, request);
|
|
200
194
|
/**
|
|
201
|
-
* Get session information. Retrieve information about the provided **session ID**, such as name
|
|
195
|
+
* Get session information. Retrieve information about the provided **session ID**, such as name and status.
|
|
202
196
|
*
|
|
203
197
|
* @param request - The request {@link GetSessionRequest}
|
|
204
198
|
* @returns A Promise of Session
|
|
@@ -218,9 +212,7 @@ class API extends API$1 {
|
|
|
218
212
|
* @returns A Promise of Session
|
|
219
213
|
*/
|
|
220
214
|
waitForSession = (request, options) => waitForResource(
|
|
221
|
-
options?.stop ?? ((res) => Promise.resolve(
|
|
222
|
-
!SESSION_TRANSIENT_STATUSES.includes(res.status)
|
|
223
|
-
)),
|
|
215
|
+
options?.stop ?? ((res) => Promise.resolve(!SESSION_TRANSIENT_STATUSES.includes(res.status))),
|
|
224
216
|
this.getSession,
|
|
225
217
|
request,
|
|
226
218
|
options
|
|
@@ -232,29 +224,23 @@ class API extends API$1 {
|
|
|
232
224
|
urlParams: urlParams(
|
|
233
225
|
["order_by", request.orderBy],
|
|
234
226
|
["page", request.page],
|
|
235
|
-
[
|
|
236
|
-
"page_size",
|
|
237
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
238
|
-
],
|
|
227
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
239
228
|
["platform_id", request.platformId],
|
|
240
|
-
[
|
|
241
|
-
"project_id",
|
|
242
|
-
request.projectId ?? this.client.settings.defaultProjectId
|
|
243
|
-
],
|
|
229
|
+
["project_id", request.projectId ?? this.client.settings.defaultProjectId],
|
|
244
230
|
["tags", request.tags]
|
|
245
231
|
)
|
|
246
232
|
},
|
|
247
233
|
unmarshalListSessionsResponse
|
|
248
234
|
);
|
|
249
235
|
/**
|
|
250
|
-
* List all sessions. Retrieve information about all sessions.
|
|
236
|
+
* List all sessions. Retrieve information about all QPU sessions.
|
|
251
237
|
*
|
|
252
238
|
* @param request - The request {@link ListSessionsRequest}
|
|
253
239
|
* @returns A Promise of ListSessionsResponse
|
|
254
240
|
*/
|
|
255
241
|
listSessions = (request = {}) => enrichForPagination("sessions", this.pageOfListSessions, request);
|
|
256
242
|
/**
|
|
257
|
-
* Create a session. Create a
|
|
243
|
+
* Create a session. Create a new QPU session for the specified platform. Once ready, jobs can be sent to this session.
|
|
258
244
|
*
|
|
259
245
|
* @param request - The request {@link CreateSessionRequest}
|
|
260
246
|
* @returns A Promise of Session
|
|
@@ -288,7 +274,7 @@ class API extends API$1 {
|
|
|
288
274
|
unmarshalSession
|
|
289
275
|
);
|
|
290
276
|
/**
|
|
291
|
-
* Terminate an existing session. Terminate a session by its unique ID and cancel all its attached jobs and
|
|
277
|
+
* Terminate an existing session. Terminate a session by its unique ID and cancel all its attached jobs and bookings.
|
|
292
278
|
*
|
|
293
279
|
* @param request - The request {@link TerminateSessionRequest}
|
|
294
280
|
* @returns A Promise of Session
|
|
@@ -303,14 +289,16 @@ class API extends API$1 {
|
|
|
303
289
|
unmarshalSession
|
|
304
290
|
);
|
|
305
291
|
/**
|
|
306
|
-
* Delete an existing session. Delete a session by its unique ID and delete all its attached
|
|
292
|
+
* Delete an existing session. Delete a session by its unique ID and delete all its attached jobs and bookings.
|
|
307
293
|
*
|
|
308
294
|
* @param request - The request {@link DeleteSessionRequest}
|
|
309
295
|
*/
|
|
310
|
-
deleteSession = (request) => this.client.fetch(
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
296
|
+
deleteSession = (request) => this.client.fetch(
|
|
297
|
+
{
|
|
298
|
+
method: "DELETE",
|
|
299
|
+
path: `/qaas/v1alpha1/sessions/${validatePathParam("sessionId", request.sessionId)}`
|
|
300
|
+
}
|
|
301
|
+
);
|
|
314
302
|
pageOfListSessionACLs = (request) => this.client.fetch(
|
|
315
303
|
{
|
|
316
304
|
method: "GET",
|
|
@@ -318,10 +306,7 @@ class API extends API$1 {
|
|
|
318
306
|
urlParams: urlParams(
|
|
319
307
|
["order_by", request.orderBy],
|
|
320
308
|
["page", request.page],
|
|
321
|
-
[
|
|
322
|
-
"page_size",
|
|
323
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
324
|
-
]
|
|
309
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
|
|
325
310
|
)
|
|
326
311
|
},
|
|
327
312
|
unmarshalListSessionACLsResponse
|
|
@@ -365,9 +350,7 @@ class API extends API$1 {
|
|
|
365
350
|
* @returns A Promise of Process
|
|
366
351
|
*/
|
|
367
352
|
waitForProcess = (request, options) => waitForResource(
|
|
368
|
-
options?.stop ?? ((res) => Promise.resolve(
|
|
369
|
-
!PROCESS_TRANSIENT_STATUSES.includes(res.status)
|
|
370
|
-
)),
|
|
353
|
+
options?.stop ?? ((res) => Promise.resolve(!PROCESS_TRANSIENT_STATUSES.includes(res.status))),
|
|
371
354
|
this.getProcess,
|
|
372
355
|
request,
|
|
373
356
|
options
|
|
@@ -380,14 +363,8 @@ class API extends API$1 {
|
|
|
380
363
|
["application_id", request.applicationId],
|
|
381
364
|
["order_by", request.orderBy],
|
|
382
365
|
["page", request.page],
|
|
383
|
-
[
|
|
384
|
-
|
|
385
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
386
|
-
],
|
|
387
|
-
[
|
|
388
|
-
"project_id",
|
|
389
|
-
request.projectId ?? this.client.settings.defaultProjectId
|
|
390
|
-
],
|
|
366
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
367
|
+
["project_id", request.projectId ?? this.client.settings.defaultProjectId],
|
|
391
368
|
["tags", request.tags]
|
|
392
369
|
)
|
|
393
370
|
},
|
|
@@ -437,10 +414,12 @@ class API extends API$1 {
|
|
|
437
414
|
*
|
|
438
415
|
* @param request - The request {@link DeleteProcessRequest}
|
|
439
416
|
*/
|
|
440
|
-
deleteProcess = (request) => this.client.fetch(
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
417
|
+
deleteProcess = (request) => this.client.fetch(
|
|
418
|
+
{
|
|
419
|
+
method: "DELETE",
|
|
420
|
+
path: `/qaas/v1alpha1/processes/${validatePathParam("processId", request.processId)}`
|
|
421
|
+
}
|
|
422
|
+
);
|
|
444
423
|
pageOfListProcessResults = (request) => this.client.fetch(
|
|
445
424
|
{
|
|
446
425
|
method: "GET",
|
|
@@ -448,10 +427,7 @@ class API extends API$1 {
|
|
|
448
427
|
urlParams: urlParams(
|
|
449
428
|
["order_by", request.orderBy],
|
|
450
429
|
["page", request.page],
|
|
451
|
-
[
|
|
452
|
-
"page_size",
|
|
453
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
454
|
-
]
|
|
430
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
|
|
455
431
|
)
|
|
456
432
|
},
|
|
457
433
|
unmarshalListProcessResultsResponse
|
|
@@ -462,13 +438,9 @@ class API extends API$1 {
|
|
|
462
438
|
* @param request - The request {@link ListProcessResultsRequest}
|
|
463
439
|
* @returns A Promise of ListProcessResultsResponse
|
|
464
440
|
*/
|
|
465
|
-
listProcessResults = (request) => enrichForPagination(
|
|
466
|
-
"processResults",
|
|
467
|
-
this.pageOfListProcessResults,
|
|
468
|
-
request
|
|
469
|
-
);
|
|
441
|
+
listProcessResults = (request) => enrichForPagination("processResults", this.pageOfListProcessResults, request);
|
|
470
442
|
/**
|
|
471
|
-
* Get application information. Retrieve information about the provided **
|
|
443
|
+
* Get application information. Retrieve information about the provided **application ID**, such as name, type and compatible platforms.
|
|
472
444
|
*
|
|
473
445
|
* @param request - The request {@link GetApplicationRequest}
|
|
474
446
|
* @returns A Promise of Application
|
|
@@ -489,10 +461,7 @@ class API extends API$1 {
|
|
|
489
461
|
["name", request.name],
|
|
490
462
|
["order_by", request.orderBy],
|
|
491
463
|
["page", request.page],
|
|
492
|
-
[
|
|
493
|
-
"page_size",
|
|
494
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
495
|
-
]
|
|
464
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize]
|
|
496
465
|
)
|
|
497
466
|
},
|
|
498
467
|
unmarshalListApplicationsResponse
|
|
@@ -525,9 +494,7 @@ class API extends API$1 {
|
|
|
525
494
|
* @returns A Promise of Booking
|
|
526
495
|
*/
|
|
527
496
|
waitForBooking = (request, options) => waitForResource(
|
|
528
|
-
options?.stop ?? ((res) => Promise.resolve(
|
|
529
|
-
!BOOKING_TRANSIENT_STATUSES.includes(res.status)
|
|
530
|
-
)),
|
|
497
|
+
options?.stop ?? ((res) => Promise.resolve(!BOOKING_TRANSIENT_STATUSES.includes(res.status))),
|
|
531
498
|
this.getBooking,
|
|
532
499
|
request,
|
|
533
500
|
options
|
|
@@ -539,10 +506,7 @@ class API extends API$1 {
|
|
|
539
506
|
urlParams: urlParams(
|
|
540
507
|
["order_by", request.orderBy],
|
|
541
508
|
["page", request.page],
|
|
542
|
-
[
|
|
543
|
-
"page_size",
|
|
544
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
545
|
-
],
|
|
509
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
546
510
|
["platform_id", request.platformId],
|
|
547
511
|
["project_id", request.projectId]
|
|
548
512
|
)
|
|
@@ -610,14 +574,8 @@ class API extends API$1 {
|
|
|
610
574
|
urlParams: urlParams(
|
|
611
575
|
["order_by", request.orderBy],
|
|
612
576
|
["page", request.page],
|
|
613
|
-
[
|
|
614
|
-
|
|
615
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
616
|
-
],
|
|
617
|
-
[
|
|
618
|
-
"project_id",
|
|
619
|
-
request.projectId ?? this.client.settings.defaultProjectId
|
|
620
|
-
]
|
|
577
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
578
|
+
["project_id", request.projectId ?? this.client.settings.defaultProjectId]
|
|
621
579
|
)
|
|
622
580
|
},
|
|
623
581
|
unmarshalListModelsResponse
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { API } from './api.gen.js';
|
|
1
|
+
export { API, } from './api.gen.js';
|
|
2
2
|
export * from './content.gen.js';
|
|
3
3
|
export * from './marshalling.gen.js';
|
|
4
|
-
export type { Application, ApplicationType, Booking, BookingStatus, CancelJobRequest, CancelProcessRequest, CreateJobRequest, CreateModelRequest, CreateProcessRequest, CreateSessionRequest, CreateSessionRequestBookingDemand, DeleteJobRequest, DeleteProcessRequest, DeleteSessionRequest, GetApplicationRequest, GetBookingRequest, GetJobCircuitRequest, GetJobRequest, GetModelRequest, GetPlatformRequest, GetProcessRequest, GetSessionRequest, Job, JobCircuit, JobResult, JobStatus, ListApplicationsRequest, ListApplicationsRequestOrderBy, ListApplicationsResponse, ListBookingsRequest, ListBookingsRequestOrderBy, ListBookingsResponse, ListJobResultsRequest, ListJobResultsRequestOrderBy, ListJobResultsResponse, ListJobsRequest, ListJobsRequestOrderBy, ListJobsResponse, ListModelsRequest, ListModelsRequestOrderBy, ListModelsResponse, ListPlatformsRequest, ListPlatformsRequestOrderBy, ListPlatformsResponse,
|
|
4
|
+
export type { Application, ApplicationType, Booking, BookingStatus, CancelJobRequest, CancelProcessRequest, CreateJobRequest, CreateModelRequest, CreateProcessRequest, CreateSessionRequest, CreateSessionRequestBookingDemand, DeleteJobRequest, DeleteProcessRequest, DeleteSessionRequest, GetApplicationRequest, GetBookingRequest, GetJobCircuitRequest, GetJobRequest, GetModelRequest, GetPlatformRequest, GetProcessRequest, GetSessionRequest, Job, JobCircuit, JobResult, JobStatus, ListApplicationsRequest, ListApplicationsRequestOrderBy, ListApplicationsResponse, ListBookingsRequest, ListBookingsRequestOrderBy, ListBookingsResponse, ListJobResultsRequest, ListJobResultsRequestOrderBy, ListJobResultsResponse, ListJobsRequest, ListJobsRequestOrderBy, ListJobsResponse, ListModelsRequest, ListModelsRequestOrderBy, ListModelsResponse, ListPlatformsRequest, ListPlatformsRequestOrderBy, ListPlatformsResponse, ListProcessesRequest, ListProcessesRequestOrderBy, ListProcessesResponse, ListProcessResultsRequest, ListProcessResultsRequestOrderBy, ListProcessResultsResponse, ListSessionACLsRequest, ListSessionACLsRequestOrderBy, ListSessionACLsResponse, ListSessionsRequest, ListSessionsRequestOrderBy, ListSessionsResponse, Model, Platform, PlatformAvailability, PlatformBookingRequirement, PlatformHardware, PlatformTechnology, PlatformType, Process, ProcessResult, ProcessStatus, Session, SessionAccess, SessionOriginType, SessionStatus, TerminateSessionRequest, UpdateBookingRequest, UpdateJobRequest, UpdateProcessRequest, UpdateSessionRequest, } from './types.gen.js';
|
|
5
5
|
export * as ValidationRules from './validation-rules.gen.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DefaultValues } from '@scaleway/sdk-client';
|
|
2
|
-
import type { Application, Booking, CreateJobRequest, CreateModelRequest, CreateProcessRequest, CreateSessionRequest, Job, JobCircuit, ListApplicationsResponse, ListBookingsResponse, ListJobResultsResponse, ListJobsResponse, ListModelsResponse, ListPlatformsResponse,
|
|
2
|
+
import type { Application, Booking, CreateJobRequest, CreateModelRequest, CreateProcessRequest, CreateSessionRequest, Job, JobCircuit, ListApplicationsResponse, ListBookingsResponse, ListJobResultsResponse, ListJobsResponse, ListModelsResponse, ListPlatformsResponse, ListProcessesResponse, ListProcessResultsResponse, ListSessionACLsResponse, ListSessionsResponse, Model, Platform, Process, Session, UpdateBookingRequest, UpdateJobRequest, UpdateProcessRequest, UpdateSessionRequest } from './types.gen.js';
|
|
3
3
|
export declare const unmarshalJobCircuit: (data: unknown) => JobCircuit;
|
|
4
4
|
export declare const unmarshalApplication: (data: unknown) => Application;
|
|
5
5
|
export declare const unmarshalBooking: (data: unknown) => Booking;
|
|
@@ -198,10 +198,7 @@ const unmarshalListApplicationsResponse = (data) => {
|
|
|
198
198
|
);
|
|
199
199
|
}
|
|
200
200
|
return {
|
|
201
|
-
applications: unmarshalArrayOfObject(
|
|
202
|
-
data.applications,
|
|
203
|
-
unmarshalApplication
|
|
204
|
-
),
|
|
201
|
+
applications: unmarshalArrayOfObject(data.applications, unmarshalApplication),
|
|
205
202
|
totalCount: data.total_count
|
|
206
203
|
};
|
|
207
204
|
};
|
|
@@ -292,10 +289,7 @@ const unmarshalListProcessResultsResponse = (data) => {
|
|
|
292
289
|
);
|
|
293
290
|
}
|
|
294
291
|
return {
|
|
295
|
-
processResults: unmarshalArrayOfObject(
|
|
296
|
-
data.process_results,
|
|
297
|
-
unmarshalProcessResult
|
|
298
|
-
),
|
|
292
|
+
processResults: unmarshalArrayOfObject(data.process_results, unmarshalProcessResult),
|
|
299
293
|
totalCount: data.total_count
|
|
300
294
|
};
|
|
301
295
|
};
|
|
@@ -334,8 +328,14 @@ const unmarshalListSessionsResponse = (data) => {
|
|
|
334
328
|
};
|
|
335
329
|
const marshalJobCircuit = (request, defaults) => ({
|
|
336
330
|
...resolveOneOf([
|
|
337
|
-
{
|
|
338
|
-
|
|
331
|
+
{
|
|
332
|
+
param: "perceval_circuit",
|
|
333
|
+
value: request.percevalCircuit
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
param: "qiskit_circuit",
|
|
337
|
+
value: request.qiskitCircuit
|
|
338
|
+
}
|
|
339
339
|
])
|
|
340
340
|
});
|
|
341
341
|
const marshalCreateJobRequest = (request, defaults) => ({
|
|
@@ -366,9 +366,7 @@ const marshalCreateSessionRequestBookingDemand = (request, defaults) => ({
|
|
|
366
366
|
time_zone: request.timeZone
|
|
367
367
|
});
|
|
368
368
|
const marshalCreateSessionRequest = (request, defaults) => ({
|
|
369
|
-
booking_demand: request.bookingDemand !== void 0 ? marshalCreateSessionRequestBookingDemand(
|
|
370
|
-
request.bookingDemand
|
|
371
|
-
) : void 0,
|
|
369
|
+
booking_demand: request.bookingDemand !== void 0 ? marshalCreateSessionRequestBookingDemand(request.bookingDemand) : void 0,
|
|
372
370
|
deduplication_id: request.deduplicationId,
|
|
373
371
|
max_duration: request.maxDuration,
|
|
374
372
|
max_idle_duration: request.maxIdleDuration,
|
|
@@ -259,23 +259,23 @@ export interface Platform {
|
|
|
259
259
|
*/
|
|
260
260
|
name: string;
|
|
261
261
|
/**
|
|
262
|
-
*
|
|
262
|
+
* Name of the technological provider of the platform in lowercase (quandela, pasqal...).
|
|
263
263
|
*/
|
|
264
264
|
providerName: string;
|
|
265
265
|
/**
|
|
266
|
-
* Name of the running backend
|
|
266
|
+
* Name of the running emulation backend or QPU model of the platform in lowercase (mosaiq, qsim, aer...).
|
|
267
267
|
*/
|
|
268
268
|
backendName: string;
|
|
269
269
|
/**
|
|
270
|
-
* Type of the platform.
|
|
270
|
+
* Type of the platform (emulator or qpu).
|
|
271
271
|
*/
|
|
272
272
|
type: PlatformType;
|
|
273
273
|
/**
|
|
274
|
-
*
|
|
274
|
+
* Quantum technology used by the platform (trapped-ion, photonic, superconducting qubits...).
|
|
275
275
|
*/
|
|
276
276
|
technology: PlatformTechnology;
|
|
277
277
|
/**
|
|
278
|
-
*
|
|
278
|
+
* Maximum number of qubits supported by the platform (estimated for emulator).
|
|
279
279
|
*/
|
|
280
280
|
maxQubitCount: number;
|
|
281
281
|
/**
|
package/package.json
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleway/sdk-qaas",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "Scaleway SDK qaas",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"files": [
|
|
7
|
+
"README.md",
|
|
7
8
|
"dist"
|
|
8
9
|
],
|
|
9
10
|
"type": "module",
|
|
10
11
|
"exports": {
|
|
11
12
|
".": {
|
|
12
13
|
"types": "./dist/index.gen.d.ts",
|
|
13
|
-
"import": "./dist/index.gen.js",
|
|
14
|
-
"require": "./dist/index.gen.cjs",
|
|
15
14
|
"default": "./dist/index.gen.js"
|
|
16
15
|
},
|
|
17
16
|
"./*": {
|
|
18
17
|
"types": "./dist/*/index.gen.d.ts",
|
|
19
|
-
"import": "./dist/*/index.gen.js",
|
|
20
|
-
"require": "./dist/*/index.gen.cjs",
|
|
21
18
|
"default": "./dist/*/index.gen.js"
|
|
22
19
|
}
|
|
23
20
|
},
|
|
@@ -26,17 +23,17 @@
|
|
|
26
23
|
"directory": "packages_generated/qaas"
|
|
27
24
|
},
|
|
28
25
|
"engines": {
|
|
29
|
-
"node": ">=20.19.
|
|
26
|
+
"node": ">=20.19.6"
|
|
30
27
|
},
|
|
31
28
|
"dependencies": {
|
|
32
29
|
"@scaleway/random-name": "5.1.2",
|
|
33
|
-
"@scaleway/sdk-std": "1.
|
|
30
|
+
"@scaleway/sdk-std": "2.1.0"
|
|
34
31
|
},
|
|
35
32
|
"peerDependencies": {
|
|
36
|
-
"@scaleway/sdk-client": "^1.
|
|
33
|
+
"@scaleway/sdk-client": "^2.1.0"
|
|
37
34
|
},
|
|
38
35
|
"devDependencies": {
|
|
39
|
-
"@scaleway/sdk-client": "^1.
|
|
36
|
+
"@scaleway/sdk-client": "^2.1.0"
|
|
40
37
|
},
|
|
41
38
|
"scripts": {
|
|
42
39
|
"package:check": "pnpm publint",
|
package/dist/index.gen.cjs
DELETED