@nirvana-labs/nirvana 0.1.0-alpha.45 → 0.1.0-alpha.46
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 +8 -0
- package/README.md +2 -2
- 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.js +1 -1
- package/version.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.46 (2025-03-21)
|
|
4
|
+
|
|
5
|
+
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)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** manual updates ([#160](https://github.com/nirvana-labs/nirvana-node/issues/160)) ([e2bce0d](https://github.com/nirvana-labs/nirvana-node/commit/e2bce0d0b89ab31a0da703912efa33a3479b523b))
|
|
10
|
+
|
|
3
11
|
## 0.1.0-alpha.45 (2025-03-21)
|
|
4
12
|
|
|
5
13
|
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() {
|
|
@@ -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() {
|
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,WAAW,aAAa;IAC5B;;OAEG;IACH,
|
|
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,CA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EjB,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,
|
|
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,MAAM,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B,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,YAAY,EACV,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,uBAAuB,CAAC,EAC/C,
|
|
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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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-alpha.
|
|
1
|
+
export const VERSION = '0.1.0-alpha.46'; // x-release-please-version
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.0-alpha.
|
|
1
|
+
export declare const VERSION = "0.1.0-alpha.46";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VERSION = void 0;
|
|
4
|
-
exports.VERSION = '0.1.0-alpha.
|
|
4
|
+
exports.VERSION = '0.1.0-alpha.46'; // x-release-please-version
|
|
5
5
|
//# sourceMappingURL=version.js.map
|
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.1.0-alpha.
|
|
1
|
+
export const VERSION = '0.1.0-alpha.46'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|