@nirvana-labs/nirvana 0.1.0-alpha.45 → 0.1.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/CHANGELOG.md +16 -0
- package/README.md +10 -10
- package/index.d.mts +5 -5
- package/index.d.ts +5 -5
- package/index.d.ts.map +1 -1
- package/index.js +7 -7
- package/index.js.map +1 -1
- package/index.mjs +7 -7
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +10 -10
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.0 (2025-03-21)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.1.0-alpha.46...v0.1.0](https://github.com/nirvana-labs/nirvana-node/compare/v0.1.0-alpha.46...v0.1.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([#163](https://github.com/nirvana-labs/nirvana-node/issues/163)) ([2a3581f](https://github.com/nirvana-labs/nirvana-node/commit/2a3581fa4206e58a241bcbc2a5959a53debcea56))
|
|
10
|
+
|
|
11
|
+
## 0.1.0-alpha.46 (2025-03-21)
|
|
12
|
+
|
|
13
|
+
Full Changelog: [v0.1.0-alpha.45...v0.1.0-alpha.46](https://github.com/nirvana-labs/nirvana-node/compare/v0.1.0-alpha.45...v0.1.0-alpha.46)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **api:** manual updates ([#160](https://github.com/nirvana-labs/nirvana-node/issues/160)) ([e2bce0d](https://github.com/nirvana-labs/nirvana-node/commit/e2bce0d0b89ab31a0da703912efa33a3479b523b))
|
|
18
|
+
|
|
3
19
|
## 0.1.0-alpha.45 (2025-03-21)
|
|
4
20
|
|
|
5
21
|
Full Changelog: [v0.1.0-alpha.44...v0.1.0-alpha.45](https://github.com/nirvana-labs/nirvana-node/compare/v0.1.0-alpha.44...v0.1.0-alpha.45)
|
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ The full API of this library can be found in [api.md](api.md).
|
|
|
21
21
|
import NirvanaLabs from '@nirvana-labs/nirvana';
|
|
22
22
|
|
|
23
23
|
const client = new NirvanaLabs({
|
|
24
|
-
|
|
24
|
+
apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
async function main() {
|
|
@@ -30,7 +30,7 @@ async function main() {
|
|
|
30
30
|
cpu_config: { vcpu: 2 },
|
|
31
31
|
memory_config: { size: 2 },
|
|
32
32
|
name: 'my-vm',
|
|
33
|
-
os_image_name: 'noble-2025-03-04',
|
|
33
|
+
os_image_name: 'ubuntu-noble-2025-03-04',
|
|
34
34
|
public_ip_enabled: true,
|
|
35
35
|
region: 'us-sea-1',
|
|
36
36
|
ssh_key: {
|
|
@@ -55,7 +55,7 @@ This library includes TypeScript definitions for all request params and response
|
|
|
55
55
|
import NirvanaLabs from '@nirvana-labs/nirvana';
|
|
56
56
|
|
|
57
57
|
const client = new NirvanaLabs({
|
|
58
|
-
|
|
58
|
+
apiKey: process.env['NIRVANA_LABS_API_KEY'], // This is the default and can be omitted
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
async function main() {
|
|
@@ -64,7 +64,7 @@ async function main() {
|
|
|
64
64
|
cpu_config: { vcpu: 2 },
|
|
65
65
|
memory_config: { size: 2 },
|
|
66
66
|
name: 'my-vm',
|
|
67
|
-
os_image_name: 'noble-2025-03-04',
|
|
67
|
+
os_image_name: 'ubuntu-noble-2025-03-04',
|
|
68
68
|
public_ip_enabled: true,
|
|
69
69
|
region: 'us-sea-1',
|
|
70
70
|
ssh_key: {
|
|
@@ -96,7 +96,7 @@ async function main() {
|
|
|
96
96
|
cpu_config: { vcpu: 2 },
|
|
97
97
|
memory_config: { size: 2 },
|
|
98
98
|
name: 'my-vm',
|
|
99
|
-
os_image_name: 'noble-2025-03-04',
|
|
99
|
+
os_image_name: 'ubuntu-noble-2025-03-04',
|
|
100
100
|
public_ip_enabled: true,
|
|
101
101
|
region: 'us-sea-1',
|
|
102
102
|
ssh_key: {
|
|
@@ -148,7 +148,7 @@ const client = new NirvanaLabs({
|
|
|
148
148
|
});
|
|
149
149
|
|
|
150
150
|
// Or, configure per-request:
|
|
151
|
-
await client.compute.vms.create({ boot_volume: { size: 100 }, cpu_config: { vcpu: 2 }, memory_config: { size: 2 }, name: 'my-vm', os_image_name: 'noble-2025-03-04', public_ip_enabled: true, region: 'us-sea-1', ssh_key: { public_key: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDJiJabIUkXw7VrQG+yBohvhEsyoKEYvejZc4RFzV5maybqQei1punVsoe4r6gJttMM1Gr3cNr3OfepikCQAhAchw5ww94ZWqDsDYIqMrlDFbqhGTXDNzFAjeVIKptCOlz9k+7aM69YtLXJ6gFUCq1fbK9PjY+AK28UpMfKYUcyHQ== noname' }, subnet_id: '123e4567-e89b-12d3-a456-426614174000' }, {
|
|
151
|
+
await client.compute.vms.create({ boot_volume: { size: 100 }, cpu_config: { vcpu: 2 }, memory_config: { size: 2 }, name: 'my-vm', os_image_name: 'ubuntu-noble-2025-03-04', public_ip_enabled: true, region: 'us-sea-1', ssh_key: { public_key: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDJiJabIUkXw7VrQG+yBohvhEsyoKEYvejZc4RFzV5maybqQei1punVsoe4r6gJttMM1Gr3cNr3OfepikCQAhAchw5ww94ZWqDsDYIqMrlDFbqhGTXDNzFAjeVIKptCOlz9k+7aM69YtLXJ6gFUCq1fbK9PjY+AK28UpMfKYUcyHQ== noname' }, subnet_id: '123e4567-e89b-12d3-a456-426614174000' }, {
|
|
152
152
|
maxRetries: 5,
|
|
153
153
|
});
|
|
154
154
|
```
|
|
@@ -165,7 +165,7 @@ const client = new NirvanaLabs({
|
|
|
165
165
|
});
|
|
166
166
|
|
|
167
167
|
// Override per-request:
|
|
168
|
-
await client.compute.vms.create({ boot_volume: { size: 100 }, cpu_config: { vcpu: 2 }, memory_config: { size: 2 }, name: 'my-vm', os_image_name: 'noble-2025-03-04', public_ip_enabled: true, region: 'us-sea-1', ssh_key: { public_key: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDJiJabIUkXw7VrQG+yBohvhEsyoKEYvejZc4RFzV5maybqQei1punVsoe4r6gJttMM1Gr3cNr3OfepikCQAhAchw5ww94ZWqDsDYIqMrlDFbqhGTXDNzFAjeVIKptCOlz9k+7aM69YtLXJ6gFUCq1fbK9PjY+AK28UpMfKYUcyHQ== noname' }, subnet_id: '123e4567-e89b-12d3-a456-426614174000' }, {
|
|
168
|
+
await client.compute.vms.create({ boot_volume: { size: 100 }, cpu_config: { vcpu: 2 }, memory_config: { size: 2 }, name: 'my-vm', os_image_name: 'ubuntu-noble-2025-03-04', public_ip_enabled: true, region: 'us-sea-1', ssh_key: { public_key: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDJiJabIUkXw7VrQG+yBohvhEsyoKEYvejZc4RFzV5maybqQei1punVsoe4r6gJttMM1Gr3cNr3OfepikCQAhAchw5ww94ZWqDsDYIqMrlDFbqhGTXDNzFAjeVIKptCOlz9k+7aM69YtLXJ6gFUCq1fbK9PjY+AK28UpMfKYUcyHQ== noname' }, subnet_id: '123e4567-e89b-12d3-a456-426614174000' }, {
|
|
169
169
|
timeout: 5 * 1000,
|
|
170
170
|
});
|
|
171
171
|
```
|
|
@@ -192,7 +192,7 @@ const response = await client.compute.vms
|
|
|
192
192
|
cpu_config: { vcpu: 2 },
|
|
193
193
|
memory_config: { size: 2 },
|
|
194
194
|
name: 'my-vm',
|
|
195
|
-
os_image_name: 'noble-2025-03-04',
|
|
195
|
+
os_image_name: 'ubuntu-noble-2025-03-04',
|
|
196
196
|
public_ip_enabled: true,
|
|
197
197
|
region: 'us-sea-1',
|
|
198
198
|
ssh_key: {
|
|
@@ -211,7 +211,7 @@ const { data: operation, response: raw } = await client.compute.vms
|
|
|
211
211
|
cpu_config: { vcpu: 2 },
|
|
212
212
|
memory_config: { size: 2 },
|
|
213
213
|
name: 'my-vm',
|
|
214
|
-
os_image_name: 'noble-2025-03-04',
|
|
214
|
+
os_image_name: 'ubuntu-noble-2025-03-04',
|
|
215
215
|
public_ip_enabled: true,
|
|
216
216
|
region: 'us-sea-1',
|
|
217
217
|
ssh_key: {
|
|
@@ -332,7 +332,7 @@ await client.compute.vms.create(
|
|
|
332
332
|
cpu_config: { vcpu: 2 },
|
|
333
333
|
memory_config: { size: 2 },
|
|
334
334
|
name: 'my-vm',
|
|
335
|
-
os_image_name: 'noble-2025-03-04',
|
|
335
|
+
os_image_name: 'ubuntu-noble-2025-03-04',
|
|
336
336
|
public_ip_enabled: true,
|
|
337
337
|
region: 'us-sea-1',
|
|
338
338
|
ssh_key: {
|
package/index.d.mts
CHANGED
|
@@ -8,9 +8,9 @@ import { Compute } from "./resources/compute/compute.js";
|
|
|
8
8
|
import { Networking } from "./resources/networking/networking.js";
|
|
9
9
|
export interface ClientOptions {
|
|
10
10
|
/**
|
|
11
|
-
* Defaults to process.env['
|
|
11
|
+
* Defaults to process.env['NIRVANA_LABS_API_KEY'].
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
apiKey?: string | undefined;
|
|
14
14
|
/**
|
|
15
15
|
* Override the default base URL for the API, e.g., "https://api.example.com/v2/"
|
|
16
16
|
*
|
|
@@ -65,12 +65,12 @@ export interface ClientOptions {
|
|
|
65
65
|
* API Client for interfacing with the Nirvana Labs API.
|
|
66
66
|
*/
|
|
67
67
|
export declare class NirvanaLabs extends Core.APIClient {
|
|
68
|
-
|
|
68
|
+
apiKey: string;
|
|
69
69
|
private _options;
|
|
70
70
|
/**
|
|
71
71
|
* API Client for interfacing with the Nirvana Labs API.
|
|
72
72
|
*
|
|
73
|
-
* @param {string | undefined} [opts.
|
|
73
|
+
* @param {string | undefined} [opts.apiKey=process.env['NIRVANA_LABS_API_KEY'] ?? undefined]
|
|
74
74
|
* @param {string} [opts.baseURL=process.env['NIRVANA_LABS_BASE_URL'] ?? https://api.nirvanalabs.io/] - Override the default base URL for the API.
|
|
75
75
|
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
76
76
|
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
@@ -79,7 +79,7 @@ export declare class NirvanaLabs extends Core.APIClient {
|
|
|
79
79
|
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
80
80
|
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
81
81
|
*/
|
|
82
|
-
constructor({ baseURL,
|
|
82
|
+
constructor({ baseURL, apiKey, ...opts }?: ClientOptions);
|
|
83
83
|
operations: API.Operations;
|
|
84
84
|
compute: API.Compute;
|
|
85
85
|
networking: API.Networking;
|
package/index.d.ts
CHANGED
|
@@ -8,9 +8,9 @@ import { Compute } from "./resources/compute/compute.js";
|
|
|
8
8
|
import { Networking } from "./resources/networking/networking.js";
|
|
9
9
|
export interface ClientOptions {
|
|
10
10
|
/**
|
|
11
|
-
* Defaults to process.env['
|
|
11
|
+
* Defaults to process.env['NIRVANA_LABS_API_KEY'].
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
apiKey?: string | undefined;
|
|
14
14
|
/**
|
|
15
15
|
* Override the default base URL for the API, e.g., "https://api.example.com/v2/"
|
|
16
16
|
*
|
|
@@ -65,12 +65,12 @@ export interface ClientOptions {
|
|
|
65
65
|
* API Client for interfacing with the Nirvana Labs API.
|
|
66
66
|
*/
|
|
67
67
|
export declare class NirvanaLabs extends Core.APIClient {
|
|
68
|
-
|
|
68
|
+
apiKey: string;
|
|
69
69
|
private _options;
|
|
70
70
|
/**
|
|
71
71
|
* API Client for interfacing with the Nirvana Labs API.
|
|
72
72
|
*
|
|
73
|
-
* @param {string | undefined} [opts.
|
|
73
|
+
* @param {string | undefined} [opts.apiKey=process.env['NIRVANA_LABS_API_KEY'] ?? undefined]
|
|
74
74
|
* @param {string} [opts.baseURL=process.env['NIRVANA_LABS_BASE_URL'] ?? https://api.nirvanalabs.io/] - Override the default base URL for the API.
|
|
75
75
|
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
76
76
|
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
@@ -79,7 +79,7 @@ export declare class NirvanaLabs extends Core.APIClient {
|
|
|
79
79
|
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
80
80
|
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
81
81
|
*/
|
|
82
|
-
constructor({ baseURL,
|
|
82
|
+
constructor({ baseURL, apiKey, ...opts }?: ClientOptions);
|
|
83
83
|
operations: API.Operations;
|
|
84
84
|
compute: API.Compute;
|
|
85
85
|
networking: API.Networking;
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,SAAS,CAAC;AAClC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAE/D,MAAM,W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EpC,MAAM,MAAM,UAAU,GAAG,GAAG,CAAC,UAAU,CAAC;IACxC,MAAM,MAAM,cAAc,GAAG,GAAG,CAAC,cAAc,CAAC;CACjD;AAED,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EACL,gBAAgB,EAChB,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,SAAS,CAAC;AAEjB,eAAe,WAAW,CAAC"}
|
package/index.js
CHANGED
|
@@ -40,7 +40,7 @@ class NirvanaLabs extends Core.APIClient {
|
|
|
40
40
|
/**
|
|
41
41
|
* API Client for interfacing with the Nirvana Labs API.
|
|
42
42
|
*
|
|
43
|
-
* @param {string | undefined} [opts.
|
|
43
|
+
* @param {string | undefined} [opts.apiKey=process.env['NIRVANA_LABS_API_KEY'] ?? undefined]
|
|
44
44
|
* @param {string} [opts.baseURL=process.env['NIRVANA_LABS_BASE_URL'] ?? https://api.nirvanalabs.io/] - Override the default base URL for the API.
|
|
45
45
|
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
46
46
|
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
@@ -49,12 +49,12 @@ class NirvanaLabs extends Core.APIClient {
|
|
|
49
49
|
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
50
50
|
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
51
51
|
*/
|
|
52
|
-
constructor({ baseURL = Core.readEnv('NIRVANA_LABS_BASE_URL'),
|
|
53
|
-
if (
|
|
54
|
-
throw new Errors.NirvanaLabsError("The
|
|
52
|
+
constructor({ baseURL = Core.readEnv('NIRVANA_LABS_BASE_URL'), apiKey = Core.readEnv('NIRVANA_LABS_API_KEY'), ...opts } = {}) {
|
|
53
|
+
if (apiKey === undefined) {
|
|
54
|
+
throw new Errors.NirvanaLabsError("The NIRVANA_LABS_API_KEY environment variable is missing or empty; either provide it, or instantiate the NirvanaLabs client with an apiKey option, like new NirvanaLabs({ apiKey: 'My API Key' }).");
|
|
55
55
|
}
|
|
56
56
|
const options = {
|
|
57
|
-
|
|
57
|
+
apiKey,
|
|
58
58
|
...opts,
|
|
59
59
|
baseURL: baseURL || `https://api.nirvanalabs.io/`,
|
|
60
60
|
};
|
|
@@ -69,7 +69,7 @@ class NirvanaLabs extends Core.APIClient {
|
|
|
69
69
|
this.compute = new API.Compute(this);
|
|
70
70
|
this.networking = new API.Networking(this);
|
|
71
71
|
this._options = options;
|
|
72
|
-
this.
|
|
72
|
+
this.apiKey = apiKey;
|
|
73
73
|
}
|
|
74
74
|
defaultQuery() {
|
|
75
75
|
return this._options.defaultQuery;
|
|
@@ -81,7 +81,7 @@ class NirvanaLabs extends Core.APIClient {
|
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
83
|
authHeaders(opts) {
|
|
84
|
-
return { Authorization: `Bearer ${this.
|
|
84
|
+
return { Authorization: `Bearer ${this.apiKey}` };
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
exports.NirvanaLabs = NirvanaLabs;
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGtF,gDAA+B;AAC/B,mDAAkC;AAClC,sDAAqC;AACrC,0DAAyC;AACzC,0DAAoD;AACpD,4DAAsD;AACtD,qEAA+D;AAiE/D;;GAEG;AACH,MAAa,WAAY,SAAQ,IAAI,CAAC,SAAS;IAK7C;;;;;;;;;;;OAWG;IACH,YAAY,EACV,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,uBAAuB,CAAC,EAC/C,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,CAAC;AAcpC,wCAAiD;AAAxC,iGAAA,MAAM,OAAA;AAAE,uGAAA,YAAY,OAAA;AAC7B,oCAciB;AAbf,yGAAA,gBAAgB,OAAA;AAChB,iGAAA,QAAQ,OAAA;AACR,2GAAA,kBAAkB,OAAA;AAClB,kHAAA,yBAAyB,OAAA;AACzB,0GAAA,iBAAiB,OAAA;AACjB,sGAAA,aAAa,OAAA;AACb,sGAAA,aAAa,OAAA;AACb,uGAAA,cAAc,OAAA;AACd,wGAAA,eAAe,OAAA;AACf,4GAAA,mBAAmB,OAAA;AACnB,4GAAA,mBAAmB,OAAA;AACnB,8GAAA,qBAAqB,OAAA;AACrB,iHAAA,wBAAwB,OAAA;AAG1B,kBAAe,WAAW,CAAC"}
|
package/index.mjs
CHANGED
|
@@ -14,7 +14,7 @@ export class NirvanaLabs extends Core.APIClient {
|
|
|
14
14
|
/**
|
|
15
15
|
* API Client for interfacing with the Nirvana Labs API.
|
|
16
16
|
*
|
|
17
|
-
* @param {string | undefined} [opts.
|
|
17
|
+
* @param {string | undefined} [opts.apiKey=process.env['NIRVANA_LABS_API_KEY'] ?? undefined]
|
|
18
18
|
* @param {string} [opts.baseURL=process.env['NIRVANA_LABS_BASE_URL'] ?? https://api.nirvanalabs.io/] - Override the default base URL for the API.
|
|
19
19
|
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
20
20
|
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
@@ -23,12 +23,12 @@ export class NirvanaLabs extends Core.APIClient {
|
|
|
23
23
|
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
24
24
|
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
25
25
|
*/
|
|
26
|
-
constructor({ baseURL = Core.readEnv('NIRVANA_LABS_BASE_URL'),
|
|
27
|
-
if (
|
|
28
|
-
throw new Errors.NirvanaLabsError("The
|
|
26
|
+
constructor({ baseURL = Core.readEnv('NIRVANA_LABS_BASE_URL'), apiKey = Core.readEnv('NIRVANA_LABS_API_KEY'), ...opts } = {}) {
|
|
27
|
+
if (apiKey === undefined) {
|
|
28
|
+
throw new Errors.NirvanaLabsError("The NIRVANA_LABS_API_KEY environment variable is missing or empty; either provide it, or instantiate the NirvanaLabs client with an apiKey option, like new NirvanaLabs({ apiKey: 'My API Key' }).");
|
|
29
29
|
}
|
|
30
30
|
const options = {
|
|
31
|
-
|
|
31
|
+
apiKey,
|
|
32
32
|
...opts,
|
|
33
33
|
baseURL: baseURL || `https://api.nirvanalabs.io/`,
|
|
34
34
|
};
|
|
@@ -43,7 +43,7 @@ export class NirvanaLabs extends Core.APIClient {
|
|
|
43
43
|
this.compute = new API.Compute(this);
|
|
44
44
|
this.networking = new API.Networking(this);
|
|
45
45
|
this._options = options;
|
|
46
|
-
this.
|
|
46
|
+
this.apiKey = apiKey;
|
|
47
47
|
}
|
|
48
48
|
defaultQuery() {
|
|
49
49
|
return this._options.defaultQuery;
|
|
@@ -55,7 +55,7 @@ export class NirvanaLabs extends Core.APIClient {
|
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
authHeaders(opts) {
|
|
58
|
-
return { Authorization: `Bearer ${this.
|
|
58
|
+
return { Authorization: `Bearer ${this.apiKey}` };
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
_a = NirvanaLabs;
|
package/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;;OAG/E,KAAK,IAAI;OACT,KAAK,MAAM;OACX,KAAK,OAAO;OACZ,KAAK,GAAG;OACR,EAAE,UAAU,EAAE;OACd,EAAE,OAAO,EAAE;OACX,EAAE,UAAU,EAAE;AAiErB;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,IAAI,CAAC,SAAS;IAK7C;;;;;;;;;;;OAWG;IACH,Y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AAO,GAAG,OAAO,CAAC;AAC9B,WAAW,CAAC,UAAU,GAAG,UAAU,CAAC;OAc7B,EAAE,MAAM,EAAE,YAAY,EAAE;OACxB,EACL,gBAAgB,EAChB,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,GACzB;AAED,eAAe,WAAW,CAAC"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -11,9 +11,9 @@ import { Networking } from './resources/networking/networking';
|
|
|
11
11
|
|
|
12
12
|
export interface ClientOptions {
|
|
13
13
|
/**
|
|
14
|
-
* Defaults to process.env['
|
|
14
|
+
* Defaults to process.env['NIRVANA_LABS_API_KEY'].
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
apiKey?: string | undefined;
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Override the default base URL for the API, e.g., "https://api.example.com/v2/"
|
|
@@ -76,14 +76,14 @@ export interface ClientOptions {
|
|
|
76
76
|
* API Client for interfacing with the Nirvana Labs API.
|
|
77
77
|
*/
|
|
78
78
|
export class NirvanaLabs extends Core.APIClient {
|
|
79
|
-
|
|
79
|
+
apiKey: string;
|
|
80
80
|
|
|
81
81
|
private _options: ClientOptions;
|
|
82
82
|
|
|
83
83
|
/**
|
|
84
84
|
* API Client for interfacing with the Nirvana Labs API.
|
|
85
85
|
*
|
|
86
|
-
* @param {string | undefined} [opts.
|
|
86
|
+
* @param {string | undefined} [opts.apiKey=process.env['NIRVANA_LABS_API_KEY'] ?? undefined]
|
|
87
87
|
* @param {string} [opts.baseURL=process.env['NIRVANA_LABS_BASE_URL'] ?? https://api.nirvanalabs.io/] - Override the default base URL for the API.
|
|
88
88
|
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
89
89
|
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
@@ -94,17 +94,17 @@ export class NirvanaLabs extends Core.APIClient {
|
|
|
94
94
|
*/
|
|
95
95
|
constructor({
|
|
96
96
|
baseURL = Core.readEnv('NIRVANA_LABS_BASE_URL'),
|
|
97
|
-
|
|
97
|
+
apiKey = Core.readEnv('NIRVANA_LABS_API_KEY'),
|
|
98
98
|
...opts
|
|
99
99
|
}: ClientOptions = {}) {
|
|
100
|
-
if (
|
|
100
|
+
if (apiKey === undefined) {
|
|
101
101
|
throw new Errors.NirvanaLabsError(
|
|
102
|
-
"The
|
|
102
|
+
"The NIRVANA_LABS_API_KEY environment variable is missing or empty; either provide it, or instantiate the NirvanaLabs client with an apiKey option, like new NirvanaLabs({ apiKey: 'My API Key' }).",
|
|
103
103
|
);
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
const options: ClientOptions = {
|
|
107
|
-
|
|
107
|
+
apiKey,
|
|
108
108
|
...opts,
|
|
109
109
|
baseURL: baseURL || `https://api.nirvanalabs.io/`,
|
|
110
110
|
};
|
|
@@ -119,7 +119,7 @@ export class NirvanaLabs extends Core.APIClient {
|
|
|
119
119
|
|
|
120
120
|
this._options = options;
|
|
121
121
|
|
|
122
|
-
this.
|
|
122
|
+
this.apiKey = apiKey;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
operations: API.Operations = new API.Operations(this);
|
|
@@ -138,7 +138,7 @@ export class NirvanaLabs extends Core.APIClient {
|
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
protected override authHeaders(opts: Core.FinalRequestOptions): Core.Headers {
|
|
141
|
-
return { Authorization: `Bearer ${this.
|
|
141
|
+
return { Authorization: `Bearer ${this.apiKey}` };
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
static NirvanaLabs = this;
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.1.0
|
|
1
|
+
export const VERSION = '0.1.0'; // x-release-please-version
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.0
|
|
1
|
+
export declare const VERSION = "0.1.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
|
package/version.js
CHANGED
package/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}
|
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.1.0
|
|
1
|
+
export const VERSION = '0.1.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|
package/version.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}
|