@qbraid-core/ibm-cloud 0.10.2 → 0.12.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/dist/src/client.d.ts +5 -1
- package/dist/src/client.js +42 -7
- package/dist/src/client.js.map +1 -1
- package/dist/src/config.d.ts +90 -9
- package/dist/src/config.js +132 -62
- package/dist/src/config.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +3 -2
- package/dist/src/index.js.map +1 -1
- package/package.json +12 -4
package/dist/src/client.d.ts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
|
+
import { IBMConfig } from './config';
|
|
1
2
|
import { AllDevicesResponse, DeviceProperties, DeviceConfiguration, DeviceErrors, DeviceStatus, JobList, Job, JobMetrics, GetJobParams, APIErrorResponse, JobTranspiledCircuitResponse } from './types';
|
|
2
3
|
export declare class IBMCloudClient {
|
|
3
4
|
private baseUrl;
|
|
4
5
|
private client;
|
|
5
6
|
private configManager;
|
|
6
|
-
constructor({ apiKey, token, crn }: {
|
|
7
|
+
constructor({ apiKey, token, crn, configManager, }: {
|
|
7
8
|
apiKey?: string;
|
|
8
9
|
token?: string;
|
|
9
10
|
crn?: string;
|
|
11
|
+
configManager?: IBMConfig;
|
|
10
12
|
});
|
|
13
|
+
private refreshBearerToken;
|
|
14
|
+
private fetchNewBearerToken;
|
|
11
15
|
private handleJobRequest;
|
|
12
16
|
getBackends(): Promise<AllDevicesResponse>;
|
|
13
17
|
getBackendProperties(backendName: string, updatedBefore?: string): Promise<DeviceProperties>;
|
package/dist/src/client.js
CHANGED
|
@@ -6,15 +6,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
6
6
|
};
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.IBMCloudClient = void 0;
|
|
9
|
-
const https_1 = require("https");
|
|
10
9
|
const axios_1 = __importDefault(require("axios"));
|
|
11
10
|
const config_1 = require("./config");
|
|
12
11
|
class IBMCloudClient {
|
|
13
12
|
baseUrl;
|
|
14
13
|
client;
|
|
15
14
|
configManager;
|
|
16
|
-
constructor({ apiKey, token, crn }) {
|
|
17
|
-
this.configManager = new config_1.
|
|
15
|
+
constructor({ apiKey, token, crn, configManager, }) {
|
|
16
|
+
this.configManager = configManager || new config_1.IBMConfig();
|
|
18
17
|
if (apiKey)
|
|
19
18
|
this.configManager.setApiKey(apiKey);
|
|
20
19
|
if (token)
|
|
@@ -30,17 +29,41 @@ class IBMCloudClient {
|
|
|
30
29
|
this.baseUrl = 'https://quantum.cloud.ibm.com/api/v1';
|
|
31
30
|
const headers = {
|
|
32
31
|
'Service-CRN': this.configManager.getServiceCRN(),
|
|
33
|
-
Authorization: this.configManager.
|
|
34
|
-
? `apikey ${this.configManager.getApiKey()}`
|
|
35
|
-
: `Bearer ${this.configManager.getBearerToken()}`,
|
|
32
|
+
Authorization: `Bearer ${this.configManager.getBearerToken()}`,
|
|
36
33
|
};
|
|
37
34
|
const axiosInstance = axios_1.default.create({
|
|
38
35
|
baseURL: this.baseUrl,
|
|
39
36
|
headers,
|
|
40
|
-
httpsAgent: new https_1.Agent({ keepAlive: true }),
|
|
41
37
|
});
|
|
42
38
|
this.client = axiosInstance;
|
|
43
39
|
}
|
|
40
|
+
async refreshBearerToken() {
|
|
41
|
+
try {
|
|
42
|
+
if (this.configManager.isBearerTokenExpired()) {
|
|
43
|
+
if (this.configManager.getApiKey() === '') {
|
|
44
|
+
throw new Error('API key is required to refresh the bearer token');
|
|
45
|
+
}
|
|
46
|
+
const newToken = await this.fetchNewBearerToken();
|
|
47
|
+
this.configManager.setBearerToken(newToken);
|
|
48
|
+
// edit the header of the client with new token
|
|
49
|
+
this.client.defaults.headers['Authorization'] = `Bearer ${newToken}`;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
console.error('Error refreshing bearer token:', error);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
async fetchNewBearerToken() {
|
|
57
|
+
const response = await axios_1.default.post('https://iam.cloud.ibm.com/identity/token', {
|
|
58
|
+
grant_type: 'urn:ibm:params:oauth:grant-type:apikey',
|
|
59
|
+
apikey: this.configManager.getApiKey(),
|
|
60
|
+
}, {
|
|
61
|
+
headers: {
|
|
62
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
return response.data.access_token;
|
|
66
|
+
}
|
|
44
67
|
async handleJobRequest(request) {
|
|
45
68
|
try {
|
|
46
69
|
const response = await request;
|
|
@@ -55,28 +78,33 @@ class IBMCloudClient {
|
|
|
55
78
|
}
|
|
56
79
|
// 1. GET /backends - get all backends from IBM
|
|
57
80
|
async getBackends() {
|
|
81
|
+
await this.refreshBearerToken();
|
|
58
82
|
const response = await this.client.get('/backends');
|
|
59
83
|
return response.data;
|
|
60
84
|
}
|
|
61
85
|
// 2. GET /backends/:backend_name/properties - get all properties of a specific backend
|
|
62
86
|
async getBackendProperties(backendName, updatedBefore // format : YYYY-MM-DDThh:mm:ssZ
|
|
63
87
|
) {
|
|
88
|
+
await this.refreshBearerToken();
|
|
64
89
|
const params = updatedBefore ? { updated_before: updatedBefore } : undefined;
|
|
65
90
|
const response = await this.client.get(`/backends/${backendName}/properties`, { params: params });
|
|
66
91
|
return response.data;
|
|
67
92
|
}
|
|
68
93
|
// 3. GET /backends/:backend_name/configuration - get all configuration of a specific backend
|
|
69
94
|
async getBackendConfiguration(backendName) {
|
|
95
|
+
await this.refreshBearerToken();
|
|
70
96
|
const response = await this.client.get(`/backends/${backendName}/configuration`);
|
|
71
97
|
return response.data;
|
|
72
98
|
}
|
|
73
99
|
// 4. GET /backends/:backend_name/status - get the status of a specific backend
|
|
74
100
|
async getBackendStatus(backendName) {
|
|
101
|
+
await this.refreshBearerToken();
|
|
75
102
|
const response = await this.client.get(`/backends/${backendName}/status`);
|
|
76
103
|
return response.data;
|
|
77
104
|
}
|
|
78
105
|
// 5. GET /backends/:backend_name/errors - get the gate errors of a specific backend
|
|
79
106
|
async getBackendErrors(backendName) {
|
|
107
|
+
await this.refreshBearerToken();
|
|
80
108
|
const backendProps = await this.getBackendProperties(backendName);
|
|
81
109
|
if (!backendProps.gates || backendProps.gates.length === 0) {
|
|
82
110
|
return { gate_errors: [] };
|
|
@@ -111,20 +139,24 @@ class IBMCloudClient {
|
|
|
111
139
|
}
|
|
112
140
|
// 6. GET /jobs - get all jobs from IBM
|
|
113
141
|
async getJobs(params) {
|
|
142
|
+
await this.refreshBearerToken();
|
|
114
143
|
return this.handleJobRequest(this.client.get('/jobs', { params }));
|
|
115
144
|
}
|
|
116
145
|
// 7. GET /jobs/:job_id - get a specific job from IBM
|
|
117
146
|
async getJob(jobId, excludeParams) {
|
|
147
|
+
await this.refreshBearerToken();
|
|
118
148
|
return this.handleJobRequest(this.client.get(`/jobs/${jobId}`, {
|
|
119
149
|
params: { exclude_params: excludeParams },
|
|
120
150
|
}));
|
|
121
151
|
}
|
|
122
152
|
// 8. DELETE /jobs/:job_id - delete a specific job from IBM
|
|
123
153
|
async deleteJob(jobId) {
|
|
154
|
+
await this.refreshBearerToken();
|
|
124
155
|
return this.handleJobRequest(this.client.delete(`/jobs/${jobId}`));
|
|
125
156
|
}
|
|
126
157
|
// 9. POST /jobs/:job_id/cancel - cancel a specific job from IBM
|
|
127
158
|
async cancelJob(jobId, parentJobId) {
|
|
159
|
+
await this.refreshBearerToken();
|
|
128
160
|
const customHeader = parentJobId ? { 'parent-job-id': parentJobId } : {};
|
|
129
161
|
return this.handleJobRequest(this.client.post(`/jobs/${jobId}/cancel`, null, {
|
|
130
162
|
headers: {
|
|
@@ -135,14 +167,17 @@ class IBMCloudClient {
|
|
|
135
167
|
}
|
|
136
168
|
// 10. GET /jobs/:job_id/logs - get logs of a specific job from IBM
|
|
137
169
|
async getJobLogs(jobId) {
|
|
170
|
+
await this.refreshBearerToken();
|
|
138
171
|
return this.handleJobRequest(this.client.get(`/jobs/${jobId}/logs`));
|
|
139
172
|
}
|
|
140
173
|
// 11. GET /jobs/:job_id/transpiled_circuits - get transpiled circuits of a specific job from IBM
|
|
141
174
|
async getJobTranspiledCircuits(jobId) {
|
|
175
|
+
await this.refreshBearerToken();
|
|
142
176
|
return this.handleJobRequest(this.client.get(`/jobs/${jobId}/transpiled_circuits`));
|
|
143
177
|
}
|
|
144
178
|
// 12. GET /jobs/:job_id/metrics - get metrics of a specific job from IBM
|
|
145
179
|
async getJobMetrics(jobId) {
|
|
180
|
+
await this.refreshBearerToken();
|
|
146
181
|
return this.handleJobRequest(this.client.get(`/jobs/${jobId}/metrics`));
|
|
147
182
|
}
|
|
148
183
|
}
|
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,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":";AAAA,8CAA8C;AAC9C,uBAAuB;;;;;;AAEvB,kDAA4D;AAE5D,qCAAqC;AAgBrC,MAAa,cAAc;IACjB,OAAO,CAAS;IAChB,MAAM,CAAgB;IACtB,aAAa,CAAY;IAEjC,YAAY,EACV,MAAM,EACN,KAAK,EACL,GAAG,EACH,aAAa,GAMd;QACC,IAAI,CAAC,aAAa,GAAG,aAAa,IAAI,IAAI,kBAAS,EAAE,CAAC;QAEtD,IAAI,MAAM;YAAE,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACjD,IAAI,KAAK;YAAE,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QACpD,IAAI,GAAG;YAAE,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QAE/C,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,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IACzE,KAAK,CAAC,aAAa,CAAC,KAAa;QAC/B,MAAM,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAChC,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAa,SAAS,KAAK,UAAU,CAAC,CAAC,CAAC;IACtF,CAAC;CACF;AAjOD,wCAiOC"}
|
package/dist/src/config.d.ts
CHANGED
|
@@ -1,17 +1,98 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* IBM Quantum Platform configuration data structure.
|
|
3
|
+
* Top-level keys are configuration "sections" (e.g., 'default-ibm-quantum-platform').
|
|
4
|
+
* Each section stores simple key/value pairs (string | boolean).
|
|
5
|
+
*/
|
|
6
|
+
export type IBMConfigData = Record<string, Record<string, string | boolean>>;
|
|
7
|
+
/**
|
|
8
|
+
* Default IBM Quantum Platform configuration.
|
|
9
|
+
* This can be used directly in frontend applications or as a base for filesystem config.
|
|
10
|
+
*/
|
|
11
|
+
export declare const DEFAULT_IBM_CONFIG: IBMConfigData;
|
|
12
|
+
export declare const IBM_DEFAULT_TOKEN_LIFETIME = 3600000;
|
|
13
|
+
/**
|
|
14
|
+
* Lightweight, browser-safe IBM Quantum Platform config wrapper.
|
|
15
|
+
* - In-memory only (no filesystem operations).
|
|
16
|
+
* - Provides helpers for API key (token) and service CRN (instance).
|
|
17
|
+
* - Maintains an in-memory bearer token with simple expiry logic.
|
|
18
|
+
*/
|
|
19
|
+
export declare class IBMConfig {
|
|
20
|
+
private config;
|
|
5
21
|
private bearerToken;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
22
|
+
private tokenFetchTime;
|
|
23
|
+
/**
|
|
24
|
+
* Create a new IBMConfig.
|
|
25
|
+
* @param config Optional initial configuration. If omitted, a deep copy of DEFAULT_IBM_CONFIG is used.
|
|
26
|
+
*/
|
|
27
|
+
constructor(config?: IBMConfigData);
|
|
28
|
+
/**
|
|
29
|
+
* Get a shallow copy of the current configuration object.
|
|
30
|
+
* Note: nested section objects are not deeply cloned.
|
|
31
|
+
* @returns A shallow copy of the current configuration.
|
|
32
|
+
*/
|
|
33
|
+
getConfig(): IBMConfigData;
|
|
34
|
+
/**
|
|
35
|
+
* Shallow-merge top-level sections from the provided config into the current config.
|
|
36
|
+
*
|
|
37
|
+
* - Existing sections are preserved unless overwritten by the same section key in newConfig.
|
|
38
|
+
* - For a given section key, the entire section object is replaced (no deep merge of keys).
|
|
39
|
+
* Use setValue()/specific setters for per-key updates.
|
|
40
|
+
* @param newConfig The partial configuration to merge at the section level.
|
|
41
|
+
*/
|
|
42
|
+
updateConfig(newConfig: IBMConfigData): void;
|
|
43
|
+
/**
|
|
44
|
+
* Get the IBM API key (stored as 'token').
|
|
45
|
+
* @returns The API key string.
|
|
46
|
+
*/
|
|
10
47
|
getApiKey(): string;
|
|
48
|
+
/**
|
|
49
|
+
* Set the IBM API key (stored as 'token').
|
|
50
|
+
* @param apiKey The API key.
|
|
51
|
+
*/
|
|
11
52
|
setApiKey(apiKey: string): void;
|
|
53
|
+
/**
|
|
54
|
+
* Get the IBM Quantum service CRN (stored as 'instance').
|
|
55
|
+
* @returns The service CRN string.
|
|
56
|
+
*/
|
|
12
57
|
getServiceCRN(): string;
|
|
58
|
+
/**
|
|
59
|
+
* Set the IBM Quantum service CRN (stored as 'instance').
|
|
60
|
+
* @param crn The service CRN value.
|
|
61
|
+
*/
|
|
13
62
|
setServiceCRN(crn: string): void;
|
|
63
|
+
/**
|
|
64
|
+
* Get the in-memory bearer token (not persisted).
|
|
65
|
+
* @returns The bearer token string.
|
|
66
|
+
*/
|
|
14
67
|
getBearerToken(): string;
|
|
68
|
+
/**
|
|
69
|
+
* Set the in-memory bearer token (not persisted).
|
|
70
|
+
* @param token The bearer token value.
|
|
71
|
+
*/
|
|
15
72
|
setBearerToken(token: string): void;
|
|
73
|
+
/**
|
|
74
|
+
* Bearer token expiry check.
|
|
75
|
+
* Returns true if token was never set or lifetime exceeded.
|
|
76
|
+
*/
|
|
77
|
+
isBearerTokenExpired(): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Get a configuration section by name.
|
|
80
|
+
* @param section The section key.
|
|
81
|
+
* @returns The section object if present, otherwise undefined.
|
|
82
|
+
*/
|
|
83
|
+
getSection(section: string): Record<string, string | boolean> | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* Get a value from a given section.
|
|
86
|
+
* @param section The section key.
|
|
87
|
+
* @param key The key within the section.
|
|
88
|
+
* @returns The value if present, otherwise undefined.
|
|
89
|
+
*/
|
|
90
|
+
getValue(section: string, key: string): string | boolean | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* Set a value within a section, creating the section if needed.
|
|
93
|
+
* @param section The section key.
|
|
94
|
+
* @param key The key within the section.
|
|
95
|
+
* @param value The value to set.
|
|
96
|
+
*/
|
|
97
|
+
setValue(section: string, key: string, value: string | boolean): void;
|
|
16
98
|
}
|
|
17
|
-
export { IBMConfigManager };
|
package/dist/src/config.js
CHANGED
|
@@ -1,90 +1,160 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Copyright (c) 2025, qBraid Development Team
|
|
3
3
|
// All rights reserved.
|
|
4
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
-
if (k2 === undefined) k2 = k;
|
|
6
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
-
}
|
|
10
|
-
Object.defineProperty(o, k2, desc);
|
|
11
|
-
}) : (function(o, m, k, k2) {
|
|
12
|
-
if (k2 === undefined) k2 = k;
|
|
13
|
-
o[k2] = m[k];
|
|
14
|
-
}));
|
|
15
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
16
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
17
|
-
}) : function(o, v) {
|
|
18
|
-
o["default"] = v;
|
|
19
|
-
});
|
|
20
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
21
|
-
var ownKeys = function(o) {
|
|
22
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
23
|
-
var ar = [];
|
|
24
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
25
|
-
return ar;
|
|
26
|
-
};
|
|
27
|
-
return ownKeys(o);
|
|
28
|
-
};
|
|
29
|
-
return function (mod) {
|
|
30
|
-
if (mod && mod.__esModule) return mod;
|
|
31
|
-
var result = {};
|
|
32
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
33
|
-
__setModuleDefault(result, mod);
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
|
-
})();
|
|
37
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
5
|
+
exports.IBMConfig = exports.IBM_DEFAULT_TOKEN_LIFETIME = exports.DEFAULT_IBM_CONFIG = void 0;
|
|
6
|
+
/**
|
|
7
|
+
* Default IBM Quantum Platform configuration.
|
|
8
|
+
* This can be used directly in frontend applications or as a base for filesystem config.
|
|
9
|
+
*/
|
|
10
|
+
exports.DEFAULT_IBM_CONFIG = {
|
|
11
|
+
'default-ibm-quantum-platform': {
|
|
12
|
+
// latest IBMQ channel, ibm_cloud will be deprecated soon
|
|
13
|
+
channel: 'ibm_quantum_platform',
|
|
14
|
+
// Loading account from environment variables (browser-safe)
|
|
15
|
+
// Ref : Qiskit IBM Runtime docs on environment variables
|
|
16
|
+
instance: (() => {
|
|
17
|
+
try {
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
|
+
const p = globalThis.process;
|
|
20
|
+
return p?.env?.QISKIT_IBM_INSTANCE ?? '';
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return '';
|
|
24
|
+
}
|
|
25
|
+
})(),
|
|
26
|
+
token: (() => {
|
|
27
|
+
try {
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
29
|
+
const p = globalThis.process;
|
|
30
|
+
return p?.env?.QISKIT_IBM_TOKEN ?? '';
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return '';
|
|
34
|
+
}
|
|
35
|
+
})(),
|
|
36
|
+
private_endpoint: false,
|
|
37
|
+
url: 'https://cloud.ibm.com',
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
exports.IBM_DEFAULT_TOKEN_LIFETIME = 3600_000; // 1 hour in milliseconds
|
|
41
|
+
/**
|
|
42
|
+
* Lightweight, browser-safe IBM Quantum Platform config wrapper.
|
|
43
|
+
* - In-memory only (no filesystem operations).
|
|
44
|
+
* - Provides helpers for API key (token) and service CRN (instance).
|
|
45
|
+
* - Maintains an in-memory bearer token with simple expiry logic.
|
|
46
|
+
*/
|
|
47
|
+
class IBMConfig {
|
|
48
|
+
config;
|
|
46
49
|
bearerToken = '';
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
tokenFetchTime = 0;
|
|
51
|
+
/**
|
|
52
|
+
* Create a new IBMConfig.
|
|
53
|
+
* @param config Optional initial configuration. If omitted, a deep copy of DEFAULT_IBM_CONFIG is used.
|
|
54
|
+
*/
|
|
55
|
+
constructor(config) {
|
|
56
|
+
this.config = config
|
|
57
|
+
? JSON.parse(JSON.stringify(config))
|
|
58
|
+
: JSON.parse(JSON.stringify(exports.DEFAULT_IBM_CONFIG));
|
|
52
59
|
}
|
|
53
|
-
|
|
54
|
-
|
|
60
|
+
/**
|
|
61
|
+
* Get a shallow copy of the current configuration object.
|
|
62
|
+
* Note: nested section objects are not deeply cloned.
|
|
63
|
+
* @returns A shallow copy of the current configuration.
|
|
64
|
+
*/
|
|
65
|
+
getConfig() {
|
|
66
|
+
return { ...this.config };
|
|
55
67
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
url: 'https://cloud.ibm.com',
|
|
67
|
-
},
|
|
68
|
-
};
|
|
68
|
+
/**
|
|
69
|
+
* Shallow-merge top-level sections from the provided config into the current config.
|
|
70
|
+
*
|
|
71
|
+
* - Existing sections are preserved unless overwritten by the same section key in newConfig.
|
|
72
|
+
* - For a given section key, the entire section object is replaced (no deep merge of keys).
|
|
73
|
+
* Use setValue()/specific setters for per-key updates.
|
|
74
|
+
* @param newConfig The partial configuration to merge at the section level.
|
|
75
|
+
*/
|
|
76
|
+
updateConfig(newConfig) {
|
|
77
|
+
this.config = { ...this.config, ...newConfig };
|
|
69
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Get the IBM API key (stored as 'token').
|
|
81
|
+
* @returns The API key string.
|
|
82
|
+
*/
|
|
70
83
|
getApiKey() {
|
|
71
84
|
return this.config['default-ibm-quantum-platform'].token;
|
|
72
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* Set the IBM API key (stored as 'token').
|
|
88
|
+
* @param apiKey The API key.
|
|
89
|
+
*/
|
|
73
90
|
setApiKey(apiKey) {
|
|
74
91
|
this.config['default-ibm-quantum-platform'].token = apiKey;
|
|
75
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Get the IBM Quantum service CRN (stored as 'instance').
|
|
95
|
+
* @returns The service CRN string.
|
|
96
|
+
*/
|
|
76
97
|
getServiceCRN() {
|
|
77
98
|
return this.config['default-ibm-quantum-platform'].instance;
|
|
78
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* Set the IBM Quantum service CRN (stored as 'instance').
|
|
102
|
+
* @param crn The service CRN value.
|
|
103
|
+
*/
|
|
79
104
|
setServiceCRN(crn) {
|
|
80
105
|
this.config['default-ibm-quantum-platform'].instance = crn;
|
|
81
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* Get the in-memory bearer token (not persisted).
|
|
109
|
+
* @returns The bearer token string.
|
|
110
|
+
*/
|
|
82
111
|
getBearerToken() {
|
|
83
112
|
return this.bearerToken;
|
|
84
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* Set the in-memory bearer token (not persisted).
|
|
116
|
+
* @param token The bearer token value.
|
|
117
|
+
*/
|
|
85
118
|
setBearerToken(token) {
|
|
86
119
|
this.bearerToken = token;
|
|
120
|
+
this.tokenFetchTime = Date.now();
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Bearer token expiry check.
|
|
124
|
+
* Returns true if token was never set or lifetime exceeded.
|
|
125
|
+
*/
|
|
126
|
+
isBearerTokenExpired() {
|
|
127
|
+
return (this.tokenFetchTime === 0 || Date.now() - this.tokenFetchTime > exports.IBM_DEFAULT_TOKEN_LIFETIME);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Get a configuration section by name.
|
|
131
|
+
* @param section The section key.
|
|
132
|
+
* @returns The section object if present, otherwise undefined.
|
|
133
|
+
*/
|
|
134
|
+
getSection(section) {
|
|
135
|
+
return this.config[section];
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Get a value from a given section.
|
|
139
|
+
* @param section The section key.
|
|
140
|
+
* @param key The key within the section.
|
|
141
|
+
* @returns The value if present, otherwise undefined.
|
|
142
|
+
*/
|
|
143
|
+
getValue(section, key) {
|
|
144
|
+
return this.config[section]?.[key];
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Set a value within a section, creating the section if needed.
|
|
148
|
+
* @param section The section key.
|
|
149
|
+
* @param key The key within the section.
|
|
150
|
+
* @param value The value to set.
|
|
151
|
+
*/
|
|
152
|
+
setValue(section, key, value) {
|
|
153
|
+
if (!this.config[section]) {
|
|
154
|
+
this.config[section] = {};
|
|
155
|
+
}
|
|
156
|
+
this.config[section][key] = value;
|
|
87
157
|
}
|
|
88
158
|
}
|
|
89
|
-
exports.
|
|
159
|
+
exports.IBMConfig = IBMConfig;
|
|
90
160
|
//# sourceMappingURL=config.js.map
|
package/dist/src/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":";AAAA,8CAA8C;AAC9C,uBAAuB
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":";AAAA,8CAA8C;AAC9C,uBAAuB;;;AASvB;;;GAGG;AACU,QAAA,kBAAkB,GAAkB;IAC/C,8BAA8B,EAAE;QAC9B,yDAAyD;QACzD,OAAO,EAAE,sBAAsB;QAE/B,4DAA4D;QAC5D,yDAAyD;QACzD,QAAQ,EAAE,CAAC,GAAG,EAAE;YACd,IAAI,CAAC;gBACH,8DAA8D;gBAC9D,MAAM,CAAC,GAAS,UAAkB,CAAC,OAAO,CAAC;gBAC3C,OAAO,CAAC,EAAE,GAAG,EAAE,mBAAmB,IAAI,EAAE,CAAC;YAC3C,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,EAAE,CAAC;YACZ,CAAC;QACH,CAAC,CAAC,EAAE;QACJ,KAAK,EAAE,CAAC,GAAG,EAAE;YACX,IAAI,CAAC;gBACH,8DAA8D;gBAC9D,MAAM,CAAC,GAAS,UAAkB,CAAC,OAAO,CAAC;gBAC3C,OAAO,CAAC,EAAE,GAAG,EAAE,gBAAgB,IAAI,EAAE,CAAC;YACxC,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,EAAE,CAAC;YACZ,CAAC;QACH,CAAC,CAAC,EAAE;QACJ,gBAAgB,EAAE,KAAK;QACvB,GAAG,EAAE,uBAAuB;KAC7B;CACF,CAAC;AAEW,QAAA,0BAA0B,GAAG,Q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AAG,KAAK,CAAC;QACzB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACnC,CAAC;IAED;;;OAGG;IACI,oBAAoB;QACzB,OAAO,CACL,IAAI,CAAC,cAAc,KAAK,CAAC,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,cAAc,GAAG,kCAA0B,CAC3F,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACI,UAAU,CAAC,OAAe;QAC/B,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;IAED;;;;;OAKG;IACI,QAAQ,CAAC,OAAe,EAAE,GAAW;QAC1C,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC;IAED;;;;;OAKG;IACI,QAAQ,CAAC,OAAe,EAAE,GAAW,EAAE,KAAuB;QACnE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;YAC1B,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;QAC5B,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACpC,CAAC;CACF;AA9HD,8BA8HC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* @module ibm-cloud
|
|
3
3
|
*/
|
|
4
4
|
export { IBMCloudClient } from './client';
|
|
5
|
-
export {
|
|
5
|
+
export { IBMConfig, IBMConfigData, DEFAULT_IBM_CONFIG } from './config';
|
|
6
6
|
export type { APIErrorResponse, Job, JobMetrics, JobList, DeviceProperties, DeviceErrors, DeviceStatus, DeviceConfiguration, } from './types';
|
package/dist/src/index.js
CHANGED
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
// Copyright (c) 2025, qBraid Development Team
|
|
3
3
|
// All rights reserved.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.
|
|
5
|
+
exports.DEFAULT_IBM_CONFIG = exports.IBMConfig = exports.IBMCloudClient = void 0;
|
|
6
6
|
/**
|
|
7
7
|
* @module ibm-cloud
|
|
8
8
|
*/
|
|
9
9
|
var client_1 = require("./client");
|
|
10
10
|
Object.defineProperty(exports, "IBMCloudClient", { enumerable: true, get: function () { return client_1.IBMCloudClient; } });
|
|
11
11
|
var config_1 = require("./config");
|
|
12
|
-
Object.defineProperty(exports, "
|
|
12
|
+
Object.defineProperty(exports, "IBMConfig", { enumerable: true, get: function () { return config_1.IBMConfig; } });
|
|
13
|
+
Object.defineProperty(exports, "DEFAULT_IBM_CONFIG", { enumerable: true, get: function () { return config_1.DEFAULT_IBM_CONFIG; } });
|
|
13
14
|
//# 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,mCAA0C;AAAjC,wGAAA,cAAc,OAAA;AACvB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,8CAA8C;AAC9C,uBAAuB;;;AAEvB;;GAEG;AACH,mCAA0C;AAAjC,wGAAA,cAAc,OAAA;AACvB,mCAAwE;AAA/D,mGAAA,SAAS,OAAA;AAAiB,4GAAA,kBAAkB,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qbraid-core/ibm-cloud",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"main": "dist/src/index.js",
|
|
5
5
|
"types": "dist/src/index.d.ts",
|
|
6
6
|
"description": "Client for interacting with IBM's Qiskit Runtime Service via the IBM Cloud API.",
|
|
@@ -29,9 +29,17 @@
|
|
|
29
29
|
"url": "git+https://github.com/qBraid/qbraid-core-js.git"
|
|
30
30
|
},
|
|
31
31
|
"homepage": "https://qbraid.github.io/qbraid-core-js/modules/ibm-cloud.html",
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
32
|
+
"browser": {
|
|
33
|
+
"https": false,
|
|
34
|
+
"http": false,
|
|
35
|
+
"os": false,
|
|
36
|
+
"fs": false,
|
|
37
|
+
"path": false
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"axios": "^1.12.2",
|
|
42
|
+
"@qbraid-core/base": "0.12.0"
|
|
35
43
|
},
|
|
36
44
|
"scripts": {
|
|
37
45
|
"clean": "rimraf dist tsconfig.tsbuildinfo src/*.js",
|