@qbraid-core/compute 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/README.md CHANGED
@@ -15,14 +15,30 @@ npm install @qbraid-core/compute
15
15
 
16
16
  ## Usage Example
17
17
 
18
+ ### V1 API (Recommended)
19
+
20
+ ```typescript
21
+ import { QbraidSessionV1 } from '@qbraid-core/base';
22
+ import { ComputeManagerClientV1 } from '@qbraid-core/compute';
23
+
24
+ const session = new QbraidSessionV1('your-api-key');
25
+ const client = new ComputeManagerClientV1(session);
26
+
27
+ const profiles = await client.getProfiles();
28
+
29
+ profiles.forEach(profile => console.log(`${profile.slug} - ${profile.description}`));
30
+ ```
31
+
32
+ ### V0 API (Legacy)
33
+
18
34
  ```typescript
19
35
  import { ComputeManagerClient } from '@qbraid-core/compute';
20
36
 
21
37
  const client = new ComputeManagerClient();
22
38
 
23
- const computeProfiles = await client.getComputeManagerAsync('<<your-email>>');
39
+ const profiles = await client.getComputeManager('your-email');
24
40
 
25
- computeProfiles.forEach(profile => console.log(`${profile.slug} - ${profile.description}`));
41
+ profiles.forEach(profile => console.log(`${profile.slug} - ${profile.description}`));
26
42
  ```
27
43
 
28
44
  ## License
@@ -1,6 +1,7 @@
1
1
  import { QbraidClient, QbraidSession } from '@qbraid-core/base';
2
+ import { QbraidClientV1, QbraidSessionV1 } from '@qbraid-core/base';
2
3
  import { AxiosResponse } from 'axios';
3
- import { ComputeProfile, UserServerStatus } from './types';
4
+ import { ComputeProfile, UserServerStatus, ComputeProfileV1, ProfileQueryParamsV1, ServerStartResponseV1, ServerStopResponseV1, ServerStatusResponseV1, ProfileCost } from './types';
4
5
  export declare class ComputeManagerClient extends QbraidClient {
5
6
  private qBraidURLs;
6
7
  constructor(session: QbraidSession, hubURL?: string, labURL?: string);
@@ -11,3 +12,39 @@ export declare class ComputeManagerClient extends QbraidClient {
11
12
  statusServer(labToken: string, labUserName: string): Promise<UserServerStatus>;
12
13
  getProfilePrice(profileSlug: string): Promise<number>;
13
14
  }
15
+ export declare class ComputeManagerClientV1 extends QbraidClientV1 {
16
+ constructor(session: QbraidSessionV1);
17
+ /**
18
+ * Get compute profiles from the V1 API.
19
+ * @param params - Optional query parameters to filter profiles
20
+ * @returns Array of ComputeProfileV1 objects
21
+ */
22
+ getProfiles(params?: ProfileQueryParamsV1): Promise<ComputeProfileV1[]>;
23
+ /**
24
+ * Start a compute server with the specified profile.
25
+ * @param profileSlug - The slug of the profile to use
26
+ * @returns Server start response
27
+ */
28
+ startServer(profileSlug: string): Promise<ServerStartResponseV1>;
29
+ /**
30
+ * Stop the current user's compute server.
31
+ * @returns Server stop response
32
+ */
33
+ stopServer(): Promise<ServerStopResponseV1>;
34
+ /**
35
+ * Get the status of the current user's compute server.
36
+ * @returns Server status response
37
+ */
38
+ getServerStatus(): Promise<ServerStatusResponseV1>;
39
+ /**
40
+ * Get a session token for the current user's compute server.
41
+ * @returns The session token string
42
+ */
43
+ getUserLabToken(): Promise<string>;
44
+ /**
45
+ * Get the price of a compute profile.
46
+ * @param profileSlug - The slug of the profile
47
+ * @returns Profile cost information
48
+ */
49
+ getProfilePrice(profileSlug: string): Promise<ProfileCost>;
50
+ }
@@ -5,8 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  return (mod && mod.__esModule) ? mod : { "default": mod };
6
6
  };
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.ComputeManagerClient = void 0;
8
+ exports.ComputeManagerClientV1 = exports.ComputeManagerClient = void 0;
9
9
  const base_1 = require("@qbraid-core/base");
10
+ const base_2 = require("@qbraid-core/base");
10
11
  const context_1 = require("@qbraid-core/base/src/context");
11
12
  const axios_1 = __importDefault(require("axios"));
12
13
  class ComputeManagerClient extends base_1.QbraidClient {
@@ -56,4 +57,91 @@ class ComputeManagerClient extends base_1.QbraidClient {
56
57
  }
57
58
  }
58
59
  exports.ComputeManagerClient = ComputeManagerClient;
60
+ class ComputeManagerClientV1 extends base_2.QbraidClientV1 {
61
+ constructor(session) {
62
+ super(session);
63
+ }
64
+ /**
65
+ * Get compute profiles from the V1 API.
66
+ * @param params - Optional query parameters to filter profiles
67
+ * @returns Array of ComputeProfileV1 objects
68
+ */
69
+ async getProfiles(params) {
70
+ const response = await this.session.client?.get('/compute/profiles', {
71
+ params,
72
+ });
73
+ return response?.data ?? [];
74
+ }
75
+ /**
76
+ * Start a compute server with the specified profile.
77
+ * @param profileSlug - The slug of the profile to use
78
+ * @returns Server start response
79
+ */
80
+ async startServer(profileSlug) {
81
+ const response = await this.session.client?.post('/compute/servers/start', { profileSlug });
82
+ return (response?.data ?? {
83
+ message: 'Unknown error',
84
+ clusterId: '',
85
+ profile: profileSlug,
86
+ status: 'starting',
87
+ });
88
+ }
89
+ /**
90
+ * Stop the current user's compute server.
91
+ * @returns Server stop response
92
+ */
93
+ async stopServer() {
94
+ const response = await this.session.client?.delete('/compute/servers/stop');
95
+ return (response?.data ?? {
96
+ message: 'Unknown error',
97
+ clusterId: '',
98
+ status: 'stopping',
99
+ });
100
+ }
101
+ /**
102
+ * Get the status of the current user's compute server.
103
+ * @returns Server status response
104
+ */
105
+ async getServerStatus() {
106
+ const response = await this.session.client?.get('/compute/servers/status');
107
+ return (response?.data ?? {
108
+ clusterId: '',
109
+ serverRunning: false,
110
+ currentProfile: null,
111
+ serverDetails: null,
112
+ userInfo: {
113
+ name: '',
114
+ admin: false,
115
+ groups: [],
116
+ },
117
+ });
118
+ }
119
+ /**
120
+ * Get a session token for the current user's compute server.
121
+ * @returns The session token string
122
+ */
123
+ async getUserLabToken() {
124
+ const response = await this.session.client?.get('/compute/servers/session-token');
125
+ return response?.data?.token?.token ?? '';
126
+ }
127
+ /**
128
+ * Get the price of a compute profile.
129
+ * @param profileSlug - The slug of the profile
130
+ * @returns Profile cost information
131
+ */
132
+ async getProfilePrice(profileSlug) {
133
+ // TODO: Implement when the pricing endpoint is available
134
+ const response = await this.session.client?.get(
135
+ // assuming the following endpoint -
136
+ `/compute/profiles/${profileSlug}/price`);
137
+ return (response?.data ?? {
138
+ profileSlug,
139
+ rateDollar: 0,
140
+ rateTimeFrame: 'hour',
141
+ estimatedHourlyCost: 0,
142
+ isFree: true,
143
+ });
144
+ }
145
+ }
146
+ exports.ComputeManagerClientV1 = ComputeManagerClientV1;
59
147
  //# sourceMappingURL=client.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":";AAAA,8CAA8C;AAC9C,uBAAuB;;;;;;AAEvB,4CAAgE;AAChE,2DAAiF;AACjF,kDAA6C;AAI7C,MAAa,oBAAqB,SAAQ,mBAAY;IAC5C,UAAU,CAA4B;IAE9C,YACE,OAAsB,EACtB,SAAiB,yBAAe,EAChC,SAAiB,yBAAe;QAEhC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,UAAU,GAAG;YAChB,GAAG,EAAE,MAAM;YACX,GAAG,EAAE,MAAM;SACZ,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,SAAiB;QACvC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAC5C,iCAAiC,SAAS,EAAE,CAC7C,CAAC;QACF,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,eAAe;QACnB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAmB,yBAAyB,CAAC,CAAC;QAC5F,MAAM,IAAI,GAAqB,QAAQ,CAAC,IAAI,CAAC;QAC7C,MAAM,SAAS,GAAa,IAAI,CAAC,KAAK,CAAC;QACvC,OAAO,SAAS,CAAC,KAAK,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,QAAgB,EAAE,cAAsB,WAAW;QACnE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,C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,WAAW;YACX,UAAU,EAAE,CAAC;YACb,aAAa,EAAE,MAAM;YACrB,mBAAmB,EAAE,CAAC;YACtB,MAAM,EAAE,IAAI;SACb,CACF,CAAC;IACJ,CAAC;CACF;AA3GD,wDA2GC"}
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * @module compute
3
3
  */
4
- export { ComputeManagerClient } from './client';
5
- export type { ComputeProfile, UserServerStatus } from './types';
4
+ export { ComputeManagerClient, ComputeManagerClientV1 } from './client';
5
+ export type { ComputeProfile, UserServerStatus, LabTokenResponse } from './types';
6
+ export type { ComputeProfileV1, ProfileQueryParamsV1, ServerStartResponseV1, ServerStopResponseV1, ServerStatusResponseV1, ProfileCost, SessionTokenResponseV1, } from './types';
package/dist/src/index.js CHANGED
@@ -2,10 +2,11 @@
2
2
  // Copyright (c) 2025, qBraid Development Team
3
3
  // All rights reserved.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.ComputeManagerClient = void 0;
5
+ exports.ComputeManagerClientV1 = exports.ComputeManagerClient = void 0;
6
6
  /**
7
7
  * @module compute
8
8
  */
9
9
  var client_1 = require("./client");
10
10
  Object.defineProperty(exports, "ComputeManagerClient", { enumerable: true, get: function () { return client_1.ComputeManagerClient; } });
11
+ Object.defineProperty(exports, "ComputeManagerClientV1", { enumerable: true, get: function () { return client_1.ComputeManagerClientV1; } });
11
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,8CAA8C;AAC9C,uBAAuB;;;AAEvB;;GAEG;AACH,mCAAgD;AAAvC,8GAAA,oBAAoB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,8CAA8C;AAC9C,uBAAuB;;;AAEvB;;GAEG;AACH,mCAAwE;AAA/D,8GAAA,oBAAoB,OAAA;AAAE,gHAAA,sBAAsB,OAAA"}
@@ -76,3 +76,176 @@ export interface LabToken {
76
76
  export interface LabTokenResponse {
77
77
  token: LabToken;
78
78
  }
79
+ /**
80
+ * Plan type enumeration.
81
+ */
82
+ export type PlanType = 'Free' | 'Individual' | 'Team' | 'Enterprise' | 'Academic';
83
+ /**
84
+ * Rate time frame enumeration.
85
+ */
86
+ export type RateTimeFrame = 'hour' | 'minute' | 'second' | 'session' | 'month' | 'day';
87
+ /**
88
+ * Kubernetes toleration definition.
89
+ */
90
+ export interface KubernetesToleration {
91
+ key: string;
92
+ operator: 'Equal' | 'Exists';
93
+ value?: string;
94
+ effect: 'NoSchedule' | 'PreferNoSchedule' | 'NoExecute';
95
+ tolerationSeconds?: number;
96
+ }
97
+ /**
98
+ * GPU resource limits configuration.
99
+ */
100
+ export interface GPUResourceLimits {
101
+ nvidia?: {
102
+ 'com/gpu'?: number;
103
+ };
104
+ amd?: {
105
+ 'com/gpu'?: number;
106
+ };
107
+ }
108
+ /**
109
+ * Permission node for profile access control.
110
+ */
111
+ export interface PermissionNode {
112
+ email?: string;
113
+ domain?: string;
114
+ role?: string;
115
+ }
116
+ /**
117
+ * Kubespawner override configuration.
118
+ */
119
+ export interface KubespawnerOverride {
120
+ image: string;
121
+ cpu_guarantee: number;
122
+ cpu_limit: number;
123
+ mem_limit: string;
124
+ mem_guarantee: string;
125
+ start_timeout?: number;
126
+ node_selector?: Record<string, string>;
127
+ tolerations: KubernetesToleration[];
128
+ extra_resource_limits?: GPUResourceLimits;
129
+ }
130
+ /**
131
+ * Spawner configuration.
132
+ */
133
+ export interface SpawnerConfig {
134
+ allowed_lambda_regions: string[];
135
+ lambda_instance_type?: string;
136
+ }
137
+ /**
138
+ * Compute Profile V1 schema - complete profile information.
139
+ */
140
+ export interface ComputeProfileV1 {
141
+ slug: string;
142
+ display_name: string;
143
+ description: string;
144
+ plan: PlanType;
145
+ machineInternalName: string;
146
+ documentationDetails: string;
147
+ rateDollar: number;
148
+ rateTimeFrame: RateTimeFrame;
149
+ rateRatioOffered: number;
150
+ visibility: 'public' | 'private';
151
+ kubespawner_override: KubespawnerOverride;
152
+ gpu: boolean;
153
+ ide: 'jupyterlab' | 'vscode';
154
+ clusterId: string;
155
+ spawner_config: SpawnerConfig;
156
+ hasCapacity: boolean;
157
+ lastRefreshDateTime?: string | null;
158
+ permissionsNodes: PermissionNode[];
159
+ createdAt: string;
160
+ updatedAt: string;
161
+ }
162
+ /**
163
+ * Query parameters for fetching compute profiles (V1).
164
+ */
165
+ export interface ProfileQueryParamsV1 {
166
+ plan?: string;
167
+ gpu?: boolean;
168
+ visibility?: 'public' | 'private';
169
+ hasCapacity?: boolean;
170
+ clusterId?: string;
171
+ page?: number;
172
+ limit?: number;
173
+ sortBy?: 'name' | 'rateDollar' | 'createdAt';
174
+ sortOrder?: 'asc' | 'desc';
175
+ }
176
+ /**
177
+ * Request body for starting a server (V1).
178
+ */
179
+ export interface ServerStartRequest {
180
+ profileSlug: string;
181
+ }
182
+ /**
183
+ * Response for starting a server (V1).
184
+ */
185
+ export interface ServerStartResponseV1 {
186
+ message: string;
187
+ clusterId: string;
188
+ profile: string;
189
+ status: 'starting' | 'started';
190
+ }
191
+ /**
192
+ * Response for stopping a server (V1).
193
+ */
194
+ export interface ServerStopResponseV1 {
195
+ message: string;
196
+ clusterId: string;
197
+ status: 'stopping' | 'stopped';
198
+ }
199
+ /**
200
+ * User info within server status response.
201
+ */
202
+ export interface ServerUserInfo {
203
+ name: string;
204
+ admin: boolean;
205
+ groups: string[];
206
+ kind?: string;
207
+ created?: string;
208
+ last_activity?: string | null;
209
+ pending?: string | null;
210
+ servers?: Record<string, unknown>;
211
+ }
212
+ /**
213
+ * Response for server status (V1).
214
+ */
215
+ export interface ServerStatusResponseV1 {
216
+ clusterId: string;
217
+ serverRunning: boolean;
218
+ serverStarting?: boolean;
219
+ currentProfile: string | null;
220
+ serverDetails: unknown | null;
221
+ userInfo: ServerUserInfo;
222
+ }
223
+ /**
224
+ * Profile cost information (V1).
225
+ */
226
+ export interface ProfileCost {
227
+ profileSlug: string;
228
+ rateDollar: number;
229
+ rateTimeFrame: string;
230
+ estimatedHourlyCost: number;
231
+ isFree: boolean;
232
+ }
233
+ /**
234
+ * Session token information (V1).
235
+ */
236
+ export interface SessionTokenV1 {
237
+ token: string;
238
+ id: string;
239
+ user: string;
240
+ scopes: string[];
241
+ note?: string;
242
+ created?: string;
243
+ expires_at: string | null;
244
+ }
245
+ /**
246
+ * Response for session token endpoint (V1).
247
+ */
248
+ export interface SessionTokenResponseV1 {
249
+ clusterId: string;
250
+ token: SessionTokenV1;
251
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@qbraid-core/compute",
3
3
  "description": "Client for the qBraid Compute service.",
4
- "version": "0.12.0",
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",
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "homepage": "https://qbraid.github.io/qbraid-core-js/modules/compute.html",
30
30
  "dependencies": {
31
- "@qbraid-core/base": "0.12.0"
31
+ "@qbraid-core/base": "0.12.2"
32
32
  },
33
33
  "scripts": {
34
34
  "clean": "rimraf dist tsconfig.tsbuildinfo src/*.d.ts src/*.js",