@qbraid-core/jobs 0.12.0 → 0.12.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/dist/src/client.d.ts +14 -2
- package/dist/src/client.js +20 -2
- package/dist/src/client.js.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.js +2 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/types.d.ts +50 -6
- package/dist/src/types.js +10 -1
- package/dist/src/types.js.map +1 -1
- package/package.json +2 -2
package/dist/src/client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { QbraidSession, QbraidClient } from '@qbraid-core/base';
|
|
2
2
|
import { QbraidClientV1, QbraidSessionV1 } from '@qbraid-core/base';
|
|
3
|
-
import { QuantumJobResponse, JobQueryParams, DeleteSingleJobResponse, DeleteMultipleJobsResponse, CancelResponse,
|
|
3
|
+
import { QuantumJobResponse, JobQueryParams, DeleteSingleJobResponse, DeleteMultipleJobsResponse, CancelResponse, JobQueryParamsV1, DeleteJobResponseV1, DeleteMultipleJobsResponseV1, CancelJobResponseV1, JobResult, ProgramData, QuantumJobsResponseV1 } from './types';
|
|
4
4
|
export declare class QuantumJobsClient extends QbraidClient {
|
|
5
5
|
constructor(session: QbraidSession);
|
|
6
6
|
getJobs(params?: JobQueryParams): Promise<QuantumJobResponse>;
|
|
@@ -15,7 +15,7 @@ export declare class QuantumJobsClientV1 extends QbraidClientV1 {
|
|
|
15
15
|
* @param params - Optional query parameters to filter jobs
|
|
16
16
|
* @returns Array of PlatformJob objects
|
|
17
17
|
*/
|
|
18
|
-
getJobs(params?: JobQueryParamsV1): Promise<
|
|
18
|
+
getJobs(params?: JobQueryParamsV1): Promise<QuantumJobsResponseV1>;
|
|
19
19
|
/**
|
|
20
20
|
* Delete a single job by its QRN.
|
|
21
21
|
* @param jobQrn - The job QRN to delete
|
|
@@ -34,4 +34,16 @@ export declare class QuantumJobsClientV1 extends QbraidClientV1 {
|
|
|
34
34
|
* @returns Cancel response
|
|
35
35
|
*/
|
|
36
36
|
cancelJob(jobQrn: string): Promise<CancelJobResponseV1>;
|
|
37
|
+
/**
|
|
38
|
+
* Get the result of a completed job.
|
|
39
|
+
* @param jobQrn - The job QRN to get results for
|
|
40
|
+
* @returns Job result with status, cost, timestamps, and result data
|
|
41
|
+
*/
|
|
42
|
+
getJobResult(jobQrn: string): Promise<JobResult>;
|
|
43
|
+
/**
|
|
44
|
+
* Get the program/circuit data for a job.
|
|
45
|
+
* @param jobQrn - The job QRN to get program for
|
|
46
|
+
* @returns Program data with format and circuit string
|
|
47
|
+
*/
|
|
48
|
+
getJobProgram(jobQrn: string): Promise<ProgramData>;
|
|
37
49
|
}
|
package/dist/src/client.js
CHANGED
|
@@ -75,7 +75,7 @@ class QuantumJobsClientV1 extends base_2.QbraidClientV1 {
|
|
|
75
75
|
*/
|
|
76
76
|
async deleteMultipleJobs(jobQrns) {
|
|
77
77
|
const response = await this.session.client.delete('/jobs', {
|
|
78
|
-
|
|
78
|
+
params: { qrns: JSON.stringify(jobQrns) },
|
|
79
79
|
});
|
|
80
80
|
return response?.data ?? { message: 'Unknown error' };
|
|
81
81
|
}
|
|
@@ -86,7 +86,25 @@ class QuantumJobsClientV1 extends base_2.QbraidClientV1 {
|
|
|
86
86
|
*/
|
|
87
87
|
async cancelJob(jobQrn) {
|
|
88
88
|
const response = await this.session.client.put(`/jobs/${jobQrn}/cancel`);
|
|
89
|
-
return response?.data ?? { message: 'Unknown error' };
|
|
89
|
+
return response?.data?.data ?? { message: 'Unknown error' };
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Get the result of a completed job.
|
|
93
|
+
* @param jobQrn - The job QRN to get results for
|
|
94
|
+
* @returns Job result with status, cost, timestamps, and result data
|
|
95
|
+
*/
|
|
96
|
+
async getJobResult(jobQrn) {
|
|
97
|
+
const response = await this.session.client.get(`/jobs/${jobQrn}/result`);
|
|
98
|
+
return response.data;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Get the program/circuit data for a job.
|
|
102
|
+
* @param jobQrn - The job QRN to get program for
|
|
103
|
+
* @returns Program data with format and circuit string
|
|
104
|
+
*/
|
|
105
|
+
async getJobProgram(jobQrn) {
|
|
106
|
+
const response = await this.session.client.get(`/jobs/${jobQrn}/program`);
|
|
107
|
+
return response.data.data;
|
|
90
108
|
}
|
|
91
109
|
}
|
|
92
110
|
exports.QuantumJobsClientV1 = QuantumJobsClientV1;
|
package/dist/src/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":";AAAA,8CAA8C;AAC9C,uBAAuB;;;AAEvB,4CAAgE;AAChE,4CAAoE;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":";AAAA,8CAA8C;AAC9C,uBAAuB;;;AAEvB,4CAAgE;AAChE,4CAAoE;AAiBpE,MAAa,iBAAkB,SAAQ,mBAAY;IACjD,YAAY,OAAsB;QAChC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,MAAuB;QACnC,MAAM,SAAS,GAAG,MAAM,EAAE,IAAI,EAAE,MAAM,CACpC,CAAC,WAAW,EAAE,GAAG,EAAE,EAAE;YACnB,4BAA4B;YAC5B,WAAW,CAAC,QAAQ,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC;YAC3C,OAAO,WAAW,CAAC;QACrB,CAAC;QACD,6BAA6B;QAC7B,EAA4B,CAC7B,CAAC;QAEF,IAAI,MAAM,EAAE,CAAC;YACX,OAAO,MAAM,CAAC,IAAI,CAAC;QACrB,CAAC;QAED,MAAM,WAAW,GAAG,EAAE,GAAG,MAAM,EAAE,GAAG,SAAS,EAAE,CAAC;QAChD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CA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QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;IAC5B,CAAC;CACF;AAzED,kDAyEC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export { QuantumJobsClient, QuantumJobsClientV1 } from './client';
|
|
5
5
|
export type { Tag, TimeStamps, JobQueryParams, QuantumJobData, QuantumJobResponse, DeleteSingleJobResponse, DeleteMultipleJobsResponse, CancelResponse, } from './types';
|
|
6
|
-
export { JobStatus } from './types';
|
|
7
|
-
export type { ExperimentType, Vendor, Provider, ProgramFormat, S3Destination, TimeStampsV1, Program, JobBase, JobRequest, RuntimeJob, PlatformJob, JobQueryParamsV1, DeleteJobResponseV1, DeleteMultipleJobsResponseV1, CancelJobResponseV1, } from './types';
|
|
6
|
+
export { JobStatus, JobStatusGroup } from './types';
|
|
7
|
+
export type { ExperimentType, Vendor, Provider, ProgramFormat, S3Destination, TimeStampsV1, Program, ProgramData, JobBase, JobResult, JobRequest, RuntimeJob, PlatformJob, JobQueryParamsV1, DeleteJobResponseV1, DeleteMultipleJobsResponseV1, QuantumJobsResponseV1, CancelJobResponseV1, } from './types';
|
package/dist/src/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright (c) 2025, qBraid Development Team
|
|
3
3
|
// All rights reserved.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.JobStatus = exports.QuantumJobsClientV1 = exports.QuantumJobsClient = void 0;
|
|
5
|
+
exports.JobStatusGroup = exports.JobStatus = exports.QuantumJobsClientV1 = exports.QuantumJobsClient = void 0;
|
|
6
6
|
/**
|
|
7
7
|
* @module jobs
|
|
8
8
|
*/
|
|
@@ -12,4 +12,5 @@ Object.defineProperty(exports, "QuantumJobsClientV1", { enumerable: true, get: f
|
|
|
12
12
|
// V1 Types
|
|
13
13
|
var types_1 = require("./types");
|
|
14
14
|
Object.defineProperty(exports, "JobStatus", { enumerable: true, get: function () { return types_1.JobStatus; } });
|
|
15
|
+
Object.defineProperty(exports, "JobStatusGroup", { enumerable: true, get: function () { return types_1.JobStatusGroup; } });
|
|
15
16
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,8CAA8C;AAC9C,uBAAuB;;;AAEvB;;GAEG;AACH,mCAAkE;AAAzD,2GAAA,iBAAiB,OAAA;AAAE,6GAAA,mBAAmB,OAAA;AAc/C,WAAW;AACX,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,8CAA8C;AAC9C,uBAAuB;;;AAEvB;;GAEG;AACH,mCAAkE;AAAzD,2GAAA,iBAAiB,OAAA;AAAE,6GAAA,mBAAmB,OAAA;AAc/C,WAAW;AACX,iCAAoD;AAA3C,kGAAA,SAAS,OAAA;AAAE,uGAAA,cAAc,OAAA"}
|
package/dist/src/types.d.ts
CHANGED
|
@@ -84,6 +84,14 @@ export declare enum JobStatus {
|
|
|
84
84
|
FAILED = "FAILED",
|
|
85
85
|
UNKNOWN = "UNKNOWN"
|
|
86
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Enumeration for job statusgroup types.
|
|
89
|
+
*/
|
|
90
|
+
export declare enum JobStatusGroup {
|
|
91
|
+
ALL = "all",
|
|
92
|
+
PENDING = "pending",
|
|
93
|
+
RETURNED = "returned"
|
|
94
|
+
}
|
|
87
95
|
/**
|
|
88
96
|
* Experiment type enumeration.
|
|
89
97
|
*/
|
|
@@ -171,22 +179,42 @@ export interface PlatformJob extends RuntimeJob {
|
|
|
171
179
|
providerId: string;
|
|
172
180
|
error?: string | null;
|
|
173
181
|
s3Destination: S3Destination;
|
|
182
|
+
device: {
|
|
183
|
+
name: string;
|
|
184
|
+
status: string;
|
|
185
|
+
type: string;
|
|
186
|
+
vendor: string;
|
|
187
|
+
};
|
|
174
188
|
}
|
|
175
189
|
/**
|
|
176
190
|
* Query parameters for fetching jobs (V1).
|
|
177
191
|
*/
|
|
178
192
|
export interface JobQueryParamsV1 {
|
|
179
|
-
|
|
180
|
-
deviceQrn?: string;
|
|
181
|
-
status?: JobStatus;
|
|
193
|
+
statusGroup?: JobStatusGroup;
|
|
182
194
|
vendor?: Vendor;
|
|
183
195
|
provider?: Provider;
|
|
184
196
|
search?: string;
|
|
185
|
-
sortOrder?: 'asc' | 'desc';
|
|
186
|
-
sortBy?: 'status' | 'createdAt' | 'endedAt' | 'experimentType';
|
|
187
|
-
experimentType?: ExperimentType;
|
|
188
197
|
page?: number;
|
|
189
198
|
limit?: number;
|
|
199
|
+
tags?: Record<string, string | number | boolean>;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Response for fetching jobs (V1).
|
|
203
|
+
*/
|
|
204
|
+
export interface QuantumJobsResponseV1 {
|
|
205
|
+
success: boolean;
|
|
206
|
+
data: PlatformJob[];
|
|
207
|
+
pagination: {
|
|
208
|
+
page: number;
|
|
209
|
+
limit: number;
|
|
210
|
+
total: number;
|
|
211
|
+
totalPages: number;
|
|
212
|
+
hasNext: boolean;
|
|
213
|
+
hasPrev: boolean;
|
|
214
|
+
};
|
|
215
|
+
meta: {
|
|
216
|
+
timestamp: string;
|
|
217
|
+
};
|
|
190
218
|
}
|
|
191
219
|
/**
|
|
192
220
|
* Response for deleting a single job (V1).
|
|
@@ -211,3 +239,19 @@ export interface CancelJobResponseV1 {
|
|
|
211
239
|
jobQrn?: string;
|
|
212
240
|
status?: JobStatus;
|
|
213
241
|
}
|
|
242
|
+
/**
|
|
243
|
+
* Schema for job result.
|
|
244
|
+
*/
|
|
245
|
+
export interface JobResult {
|
|
246
|
+
status: JobStatus;
|
|
247
|
+
cost: number;
|
|
248
|
+
timeStamps: TimeStampsV1;
|
|
249
|
+
resultData: Record<string, unknown>;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Schema for program data response.
|
|
253
|
+
*/
|
|
254
|
+
export interface ProgramData {
|
|
255
|
+
format: ProgramFormat;
|
|
256
|
+
data: string;
|
|
257
|
+
}
|
package/dist/src/types.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright (c) 2025, qBraid Development Team
|
|
3
3
|
// All rights reserved.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.JobStatus = void 0;
|
|
5
|
+
exports.JobStatusGroup = exports.JobStatus = void 0;
|
|
6
6
|
// ==================== V1 Types ====================
|
|
7
7
|
/**
|
|
8
8
|
* Enumeration for job statuses.
|
|
@@ -20,4 +20,13 @@ var JobStatus;
|
|
|
20
20
|
JobStatus["FAILED"] = "FAILED";
|
|
21
21
|
JobStatus["UNKNOWN"] = "UNKNOWN";
|
|
22
22
|
})(JobStatus || (exports.JobStatus = JobStatus = {}));
|
|
23
|
+
/**
|
|
24
|
+
* Enumeration for job statusgroup types.
|
|
25
|
+
*/
|
|
26
|
+
var JobStatusGroup;
|
|
27
|
+
(function (JobStatusGroup) {
|
|
28
|
+
JobStatusGroup["ALL"] = "all";
|
|
29
|
+
JobStatusGroup["PENDING"] = "pending";
|
|
30
|
+
JobStatusGroup["RETURNED"] = "returned";
|
|
31
|
+
})(JobStatusGroup || (exports.JobStatusGroup = JobStatusGroup = {}));
|
|
23
32
|
//# sourceMappingURL=types.js.map
|
package/dist/src/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";AAAA,8CAA8C;AAC9C,uBAAuB;;;AAkFvB,qDAAqD;AAErD;;GAEG;AACH,IAAY,SAWX;AAXD,WAAY,SAAS;IACnB,0CAA6B,CAAA;IAC7B,8BAAiB,CAAA;IACjB,sCAAyB,CAAA;IACzB,gCAAmB,CAAA;IACnB,sCAAyB,CAAA;IACzB,oCAAuB,CAAA;IACvB,0BAAa,CAAA;IACb,oCAAuB,CAAA;IACvB,8BAAiB,CAAA;IACjB,gCAAmB,CAAA;AACrB,CAAC,EAXW,SAAS,yBAAT,SAAS,QAWpB"}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";AAAA,8CAA8C;AAC9C,uBAAuB;;;AAkFvB,qDAAqD;AAErD;;GAEG;AACH,IAAY,SAWX;AAXD,WAAY,SAAS;IACnB,0CAA6B,CAAA;IAC7B,8BAAiB,CAAA;IACjB,sCAAyB,CAAA;IACzB,gCAAmB,CAAA;IACnB,sCAAyB,CAAA;IACzB,oCAAuB,CAAA;IACvB,0BAAa,CAAA;IACb,oCAAuB,CAAA;IACvB,8BAAiB,CAAA;IACjB,gCAAmB,CAAA;AACrB,CAAC,EAXW,SAAS,yBAAT,SAAS,QAWpB;AAED;;GAEG;AACH,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,6BAAW,CAAA;IACX,qCAAmB,CAAA;IACnB,uCAAqB,CAAA;AACvB,CAAC,EAJW,cAAc,8BAAd,cAAc,QAIzB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qbraid-core/jobs",
|
|
3
3
|
"description": "Client for the qBraid Quantum Jobs service.",
|
|
4
|
-
"version": "0.12.
|
|
4
|
+
"version": "0.12.2",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"types": "dist/src/index.d.ts",
|
|
7
7
|
"author": "qBraid Development Team",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@qbraid-core/base": "0.12.
|
|
40
|
+
"@qbraid-core/base": "0.12.2"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"clean": "rimraf dist tsconfig.tsbuildinfo src/*.d.ts src/*.js",
|