@nirvana-labs/nirvana 1.46.2 → 1.47.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 +18 -0
- package/client.d.mts +5 -5
- package/client.d.mts.map +1 -1
- package/client.d.ts +5 -5
- package/client.d.ts.map +1 -1
- package/client.js +12 -5
- package/client.js.map +1 -1
- package/client.mjs +12 -5
- package/client.mjs.map +1 -1
- package/internal/tslib.js +6 -6
- package/package.json +1 -1
- package/resources/api-keys/api-keys.d.mts +168 -0
- package/resources/api-keys/api-keys.d.mts.map +1 -0
- package/resources/api-keys/api-keys.d.ts +168 -0
- package/resources/api-keys/api-keys.d.ts.map +1 -0
- package/resources/api-keys/api-keys.js +76 -0
- package/resources/api-keys/api-keys.js.map +1 -0
- package/resources/api-keys/api-keys.mjs +72 -0
- package/resources/api-keys/api-keys.mjs.map +1 -0
- package/resources/api-keys/index.d.mts +2 -0
- package/resources/api-keys/index.d.mts.map +1 -0
- package/resources/api-keys/index.d.ts +2 -0
- package/resources/api-keys/index.d.ts.map +1 -0
- package/resources/api-keys/index.js +7 -0
- package/resources/api-keys/index.js.map +1 -0
- package/resources/api-keys/index.mjs +3 -0
- package/resources/api-keys/index.mjs.map +1 -0
- package/resources/api-keys.d.mts +1 -167
- package/resources/api-keys.d.mts.map +1 -1
- package/resources/api-keys.d.ts +1 -167
- package/resources/api-keys.d.ts.map +1 -1
- package/resources/api-keys.js +2 -72
- package/resources/api-keys.js.map +1 -1
- package/resources/api-keys.mjs +1 -70
- package/resources/api-keys.mjs.map +1 -1
- package/resources/compute/vms/vms.d.mts +1 -1
- package/resources/compute/vms/vms.d.mts.map +1 -1
- package/resources/compute/vms/vms.d.ts +1 -1
- package/resources/compute/vms/vms.d.ts.map +1 -1
- package/resources/compute/volumes/volumes.d.mts +1 -1
- package/resources/compute/volumes/volumes.d.mts.map +1 -1
- package/resources/compute/volumes/volumes.d.ts +1 -1
- package/resources/compute/volumes/volumes.d.ts.map +1 -1
- package/resources/networking/connect/connections.d.mts +1 -1
- package/resources/networking/connect/connections.d.mts.map +1 -1
- package/resources/networking/connect/connections.d.ts +1 -1
- package/resources/networking/connect/connections.d.ts.map +1 -1
- package/resources/networking/firewall-rules.d.mts +1 -1
- package/resources/networking/firewall-rules.d.mts.map +1 -1
- package/resources/networking/firewall-rules.d.ts +1 -1
- package/resources/networking/firewall-rules.d.ts.map +1 -1
- package/resources/networking/vpcs/vpcs.d.mts +1 -1
- package/resources/networking/vpcs/vpcs.d.mts.map +1 -1
- package/resources/networking/vpcs/vpcs.d.ts +1 -1
- package/resources/networking/vpcs/vpcs.d.ts.map +1 -1
- package/resources/operations/index.d.mts +2 -0
- package/resources/operations/index.d.mts.map +1 -0
- package/resources/operations/index.d.ts +2 -0
- package/resources/operations/index.d.ts.map +1 -0
- package/resources/operations/index.js +7 -0
- package/resources/operations/index.js.map +1 -0
- package/resources/operations/index.mjs +3 -0
- package/resources/operations/index.mjs.map +1 -0
- package/resources/operations/operations.d.mts +82 -0
- package/resources/operations/operations.d.mts.map +1 -0
- package/resources/operations/operations.d.ts +82 -0
- package/resources/operations/operations.d.ts.map +1 -0
- package/resources/operations/operations.js +23 -0
- package/resources/operations/operations.js.map +1 -0
- package/resources/operations/operations.mjs +19 -0
- package/resources/operations/operations.mjs.map +1 -0
- package/resources/operations.d.mts +1 -81
- package/resources/operations.d.mts.map +1 -1
- package/resources/operations.d.ts +1 -81
- package/resources/operations.d.ts.map +1 -1
- package/resources/operations.js +2 -19
- package/resources/operations.js.map +1 -1
- package/resources/operations.mjs +1 -17
- package/resources/operations.mjs.map +1 -1
- package/resources/organizations/index.d.mts +2 -0
- package/resources/organizations/index.d.mts.map +1 -0
- package/resources/organizations/index.d.ts +2 -0
- package/resources/organizations/index.d.ts.map +1 -0
- package/resources/organizations/index.js +7 -0
- package/resources/organizations/index.js.map +1 -0
- package/resources/organizations/index.mjs +3 -0
- package/resources/organizations/index.mjs.map +1 -0
- package/resources/organizations/organizations.d.mts +103 -0
- package/resources/organizations/organizations.d.mts.map +1 -0
- package/resources/organizations/organizations.d.ts +103 -0
- package/resources/organizations/organizations.d.ts.map +1 -0
- package/resources/organizations/organizations.js +64 -0
- package/resources/organizations/organizations.js.map +1 -0
- package/resources/organizations/organizations.mjs +60 -0
- package/resources/organizations/organizations.mjs.map +1 -0
- package/resources/organizations.d.mts +1 -102
- package/resources/organizations.d.mts.map +1 -1
- package/resources/organizations.d.ts +1 -102
- package/resources/organizations.d.ts.map +1 -1
- package/resources/organizations.js +2 -60
- package/resources/organizations.js.map +1 -1
- package/resources/organizations.mjs +1 -58
- package/resources/organizations.mjs.map +1 -1
- package/resources/projects/index.d.mts +2 -0
- package/resources/projects/index.d.mts.map +1 -0
- package/resources/projects/index.d.ts +2 -0
- package/resources/projects/index.d.ts.map +1 -0
- package/resources/projects/index.js +7 -0
- package/resources/projects/index.js.map +1 -0
- package/resources/projects/index.mjs +3 -0
- package/resources/projects/index.mjs.map +1 -0
- package/resources/projects/projects.d.mts +171 -0
- package/resources/projects/projects.d.mts.map +1 -0
- package/resources/projects/projects.d.ts +171 -0
- package/resources/projects/projects.d.ts.map +1 -0
- package/resources/projects/projects.js +75 -0
- package/resources/projects/projects.js.map +1 -0
- package/resources/projects/projects.mjs +71 -0
- package/resources/projects/projects.mjs.map +1 -0
- package/resources/projects.d.mts +1 -174
- package/resources/projects.d.mts.map +1 -1
- package/resources/projects.d.ts +1 -174
- package/resources/projects.d.ts.map +1 -1
- package/resources/projects.js +2 -71
- package/resources/projects.js.map +1 -1
- package/resources/projects.mjs +1 -69
- package/resources/projects.mjs.map +1 -1
- package/resources/regions/index.d.mts +2 -0
- package/resources/regions/index.d.mts.map +1 -0
- package/resources/regions/index.d.ts +2 -0
- package/resources/regions/index.d.ts.map +1 -0
- package/resources/regions/index.js +7 -0
- package/resources/regions/index.js.map +1 -0
- package/resources/regions/index.mjs +3 -0
- package/resources/regions/index.mjs.map +1 -0
- package/resources/regions/regions.d.mts +108 -0
- package/resources/regions/regions.d.mts.map +1 -0
- package/resources/regions/regions.d.ts +108 -0
- package/resources/regions/regions.d.ts.map +1 -0
- package/resources/regions/regions.js +36 -0
- package/resources/regions/regions.js.map +1 -0
- package/resources/regions/regions.mjs +32 -0
- package/resources/regions/regions.mjs.map +1 -0
- package/resources/regions.d.mts +1 -107
- package/resources/regions.d.mts.map +1 -1
- package/resources/regions.d.ts +1 -107
- package/resources/regions.d.ts.map +1 -1
- package/resources/regions.js +2 -32
- package/resources/regions.js.map +1 -1
- package/resources/regions.mjs +1 -30
- package/resources/regions.mjs.map +1 -1
- package/src/client.ts +13 -5
- package/src/resources/api-keys/api-keys.ts +223 -0
- package/src/resources/api-keys/api.md +14 -0
- package/src/resources/api-keys/index.ts +3 -0
- package/src/resources/api-keys.ts +1 -221
- package/src/resources/compute/api.md +68 -0
- package/src/resources/compute/vms/vms.ts +1 -1
- package/src/resources/compute/volumes/volumes.ts +1 -1
- package/src/resources/networking/api.md +67 -0
- package/src/resources/networking/connect/connections.ts +1 -1
- package/src/resources/networking/firewall-rules.ts +1 -1
- package/src/resources/networking/vpcs/vpcs.ts +1 -1
- package/src/resources/operations/api.md +14 -0
- package/src/resources/operations/index.ts +3 -0
- package/src/resources/operations/operations.ts +114 -0
- package/src/resources/operations.ts +1 -112
- package/src/resources/organizations/api.md +13 -0
- package/src/resources/organizations/index.ts +3 -0
- package/src/resources/organizations/organizations.ts +142 -0
- package/src/resources/organizations.ts +1 -140
- package/src/resources/projects/api.md +14 -0
- package/src/resources/projects/index.ts +3 -0
- package/src/resources/projects/projects.ts +224 -0
- package/src/resources/projects.ts +1 -227
- package/src/resources/regions/api.md +12 -0
- package/src/resources/regions/index.ts +3 -0
- package/src/resources/regions/regions.ts +140 -0
- package/src/resources/regions.ts +1 -138
- package/src/resources/rpc-nodes/api.md +44 -0
- package/src/resources/user/api.md +20 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
import { Cursor } from "../../core/pagination.mjs";
|
|
4
|
+
import { path } from "../../internal/utils/path.mjs";
|
|
5
|
+
export class Regions extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* List all regions
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* // Automatically fetches more pages as needed.
|
|
12
|
+
* for await (const region of client.regions.list()) {
|
|
13
|
+
* // ...
|
|
14
|
+
* }
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
list(query = {}, options) {
|
|
18
|
+
return this._client.getAPIList('/v1/regions', (Cursor), { query, ...options });
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get a region by name
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* const region = await client.regions.get('us-wdc-1');
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
get(name, options) {
|
|
29
|
+
return this._client.get(path `/v1/regions/${name}`, options);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=regions.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regions.mjs","sourceRoot":"","sources":["../../src/resources/regions/regions.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,MAAM,EAAkC;OAE1C,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;OAUG;IACH,IAAI,CACF,QAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,aAAa,EAAE,CAAA,MAAc,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvF,CAAC;IAED;;;;;;;OAOG;IACH,GAAG,CAAC,IAAY,EAAE,OAAwB;QACxC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,eAAe,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;CACF"}
|
package/resources/regions.d.mts
CHANGED
|
@@ -1,108 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import * as Shared from "./shared.mjs";
|
|
3
|
-
import { APIPromise } from "../core/api-promise.mjs";
|
|
4
|
-
import { Cursor, type CursorParams, PagePromise } from "../core/pagination.mjs";
|
|
5
|
-
import { RequestOptions } from "../internal/request-options.mjs";
|
|
6
|
-
export declare class Regions extends APIResource {
|
|
7
|
-
/**
|
|
8
|
-
* List all regions
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```ts
|
|
12
|
-
* // Automatically fetches more pages as needed.
|
|
13
|
-
* for await (const region of client.regions.list()) {
|
|
14
|
-
* // ...
|
|
15
|
-
* }
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
list(query?: RegionListParams | null | undefined, options?: RequestOptions): PagePromise<RegionsCursor, Region>;
|
|
19
|
-
/**
|
|
20
|
-
* Get a region by name
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```ts
|
|
24
|
-
* const region = await client.regions.get('us-wdc-1');
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
get(name: string, options?: RequestOptions): APIPromise<Region>;
|
|
28
|
-
}
|
|
29
|
-
export type RegionsCursor = Cursor<Region>;
|
|
30
|
-
/**
|
|
31
|
-
* Region response with product availability.
|
|
32
|
-
*/
|
|
33
|
-
export interface Region {
|
|
34
|
-
/**
|
|
35
|
-
* Availability status of the region.
|
|
36
|
-
*/
|
|
37
|
-
availability: RegionAvailability;
|
|
38
|
-
/**
|
|
39
|
-
* Compute products available in this region.
|
|
40
|
-
*/
|
|
41
|
-
compute: Region.Compute;
|
|
42
|
-
/**
|
|
43
|
-
* Name of the region.
|
|
44
|
-
*/
|
|
45
|
-
name: string;
|
|
46
|
-
/**
|
|
47
|
-
* Networking products available in this region.
|
|
48
|
-
*/
|
|
49
|
-
networking: Region.Networking;
|
|
50
|
-
/**
|
|
51
|
-
* Storage products available in this region.
|
|
52
|
-
*/
|
|
53
|
-
storage: Region.Storage;
|
|
54
|
-
}
|
|
55
|
-
export declare namespace Region {
|
|
56
|
-
/**
|
|
57
|
-
* Compute products available in this region.
|
|
58
|
-
*/
|
|
59
|
-
interface Compute {
|
|
60
|
-
/**
|
|
61
|
-
* VMs indicates if Virtual Machines are available.
|
|
62
|
-
*/
|
|
63
|
-
vms: boolean;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Networking products available in this region.
|
|
67
|
-
*/
|
|
68
|
-
interface Networking {
|
|
69
|
-
/**
|
|
70
|
-
* Connect indicates if Nirvana Connect is available.
|
|
71
|
-
*/
|
|
72
|
-
connect: boolean;
|
|
73
|
-
/**
|
|
74
|
-
* VPCs indicates if Virtual Private Clouds are available.
|
|
75
|
-
*/
|
|
76
|
-
vpcs: boolean;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Storage products available in this region.
|
|
80
|
-
*/
|
|
81
|
-
interface Storage {
|
|
82
|
-
/**
|
|
83
|
-
* ABS indicates if Accelerated Block Storage is available.
|
|
84
|
-
*/
|
|
85
|
-
abs: boolean;
|
|
86
|
-
/**
|
|
87
|
-
* LocalNVMe indicates if locally-attached NVMe storage is available.
|
|
88
|
-
*/
|
|
89
|
-
local_nvme: boolean;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Availability status of the region.
|
|
94
|
-
*/
|
|
95
|
-
export type RegionAvailability = 'live' | 'preview' | 'maintenance' | 'sunset';
|
|
96
|
-
export interface RegionList {
|
|
97
|
-
items: Array<Region>;
|
|
98
|
-
/**
|
|
99
|
-
* Pagination response details.
|
|
100
|
-
*/
|
|
101
|
-
pagination: Shared.Pagination;
|
|
102
|
-
}
|
|
103
|
-
export interface RegionListParams extends CursorParams {
|
|
104
|
-
}
|
|
105
|
-
export declare namespace Regions {
|
|
106
|
-
export { type Region as Region, type RegionAvailability as RegionAvailability, type RegionList as RegionList, type RegionsCursor as RegionsCursor, type RegionListParams as RegionListParams, };
|
|
107
|
-
}
|
|
1
|
+
export * from "./regions/index.mjs";
|
|
108
2
|
//# sourceMappingURL=regions.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"regions.d.mts","sourceRoot":"","sources":["../src/resources/regions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"regions.d.mts","sourceRoot":"","sources":["../src/resources/regions.ts"],"names":[],"mappings":""}
|
package/resources/regions.d.ts
CHANGED
|
@@ -1,108 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import * as Shared from "./shared.js";
|
|
3
|
-
import { APIPromise } from "../core/api-promise.js";
|
|
4
|
-
import { Cursor, type CursorParams, PagePromise } from "../core/pagination.js";
|
|
5
|
-
import { RequestOptions } from "../internal/request-options.js";
|
|
6
|
-
export declare class Regions extends APIResource {
|
|
7
|
-
/**
|
|
8
|
-
* List all regions
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```ts
|
|
12
|
-
* // Automatically fetches more pages as needed.
|
|
13
|
-
* for await (const region of client.regions.list()) {
|
|
14
|
-
* // ...
|
|
15
|
-
* }
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
list(query?: RegionListParams | null | undefined, options?: RequestOptions): PagePromise<RegionsCursor, Region>;
|
|
19
|
-
/**
|
|
20
|
-
* Get a region by name
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```ts
|
|
24
|
-
* const region = await client.regions.get('us-wdc-1');
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
get(name: string, options?: RequestOptions): APIPromise<Region>;
|
|
28
|
-
}
|
|
29
|
-
export type RegionsCursor = Cursor<Region>;
|
|
30
|
-
/**
|
|
31
|
-
* Region response with product availability.
|
|
32
|
-
*/
|
|
33
|
-
export interface Region {
|
|
34
|
-
/**
|
|
35
|
-
* Availability status of the region.
|
|
36
|
-
*/
|
|
37
|
-
availability: RegionAvailability;
|
|
38
|
-
/**
|
|
39
|
-
* Compute products available in this region.
|
|
40
|
-
*/
|
|
41
|
-
compute: Region.Compute;
|
|
42
|
-
/**
|
|
43
|
-
* Name of the region.
|
|
44
|
-
*/
|
|
45
|
-
name: string;
|
|
46
|
-
/**
|
|
47
|
-
* Networking products available in this region.
|
|
48
|
-
*/
|
|
49
|
-
networking: Region.Networking;
|
|
50
|
-
/**
|
|
51
|
-
* Storage products available in this region.
|
|
52
|
-
*/
|
|
53
|
-
storage: Region.Storage;
|
|
54
|
-
}
|
|
55
|
-
export declare namespace Region {
|
|
56
|
-
/**
|
|
57
|
-
* Compute products available in this region.
|
|
58
|
-
*/
|
|
59
|
-
interface Compute {
|
|
60
|
-
/**
|
|
61
|
-
* VMs indicates if Virtual Machines are available.
|
|
62
|
-
*/
|
|
63
|
-
vms: boolean;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Networking products available in this region.
|
|
67
|
-
*/
|
|
68
|
-
interface Networking {
|
|
69
|
-
/**
|
|
70
|
-
* Connect indicates if Nirvana Connect is available.
|
|
71
|
-
*/
|
|
72
|
-
connect: boolean;
|
|
73
|
-
/**
|
|
74
|
-
* VPCs indicates if Virtual Private Clouds are available.
|
|
75
|
-
*/
|
|
76
|
-
vpcs: boolean;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Storage products available in this region.
|
|
80
|
-
*/
|
|
81
|
-
interface Storage {
|
|
82
|
-
/**
|
|
83
|
-
* ABS indicates if Accelerated Block Storage is available.
|
|
84
|
-
*/
|
|
85
|
-
abs: boolean;
|
|
86
|
-
/**
|
|
87
|
-
* LocalNVMe indicates if locally-attached NVMe storage is available.
|
|
88
|
-
*/
|
|
89
|
-
local_nvme: boolean;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Availability status of the region.
|
|
94
|
-
*/
|
|
95
|
-
export type RegionAvailability = 'live' | 'preview' | 'maintenance' | 'sunset';
|
|
96
|
-
export interface RegionList {
|
|
97
|
-
items: Array<Region>;
|
|
98
|
-
/**
|
|
99
|
-
* Pagination response details.
|
|
100
|
-
*/
|
|
101
|
-
pagination: Shared.Pagination;
|
|
102
|
-
}
|
|
103
|
-
export interface RegionListParams extends CursorParams {
|
|
104
|
-
}
|
|
105
|
-
export declare namespace Regions {
|
|
106
|
-
export { type Region as Region, type RegionAvailability as RegionAvailability, type RegionList as RegionList, type RegionsCursor as RegionsCursor, type RegionListParams as RegionListParams, };
|
|
107
|
-
}
|
|
1
|
+
export * from "./regions/index.js";
|
|
108
2
|
//# sourceMappingURL=regions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"regions.d.ts","sourceRoot":"","sources":["../src/resources/regions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"regions.d.ts","sourceRoot":"","sources":["../src/resources/regions.ts"],"names":[],"mappings":""}
|
package/resources/regions.js
CHANGED
|
@@ -1,36 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const pagination_1 = require("../core/pagination.js");
|
|
7
|
-
const path_1 = require("../internal/utils/path.js");
|
|
8
|
-
class Regions extends resource_1.APIResource {
|
|
9
|
-
/**
|
|
10
|
-
* List all regions
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```ts
|
|
14
|
-
* // Automatically fetches more pages as needed.
|
|
15
|
-
* for await (const region of client.regions.list()) {
|
|
16
|
-
* // ...
|
|
17
|
-
* }
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
list(query = {}, options) {
|
|
21
|
-
return this._client.getAPIList('/v1/regions', (pagination_1.Cursor), { query, ...options });
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Get a region by name
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```ts
|
|
28
|
-
* const region = await client.regions.get('us-wdc-1');
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
get(name, options) {
|
|
32
|
-
return this._client.get((0, path_1.path) `/v1/regions/${name}`, options);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
exports.Regions = Regions;
|
|
4
|
+
const tslib_1 = require("../internal/tslib.js");
|
|
5
|
+
tslib_1.__exportStar(require("./regions/index.js"), exports);
|
|
36
6
|
//# sourceMappingURL=regions.js.map
|
package/resources/regions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"regions.js","sourceRoot":"","sources":["../src/resources/regions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,
|
|
1
|
+
{"version":3,"file":"regions.js","sourceRoot":"","sources":["../src/resources/regions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6DAAgC"}
|
package/resources/regions.mjs
CHANGED
|
@@ -1,32 +1,3 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
-
|
|
3
|
-
import { Cursor } from "../core/pagination.mjs";
|
|
4
|
-
import { path } from "../internal/utils/path.mjs";
|
|
5
|
-
export class Regions extends APIResource {
|
|
6
|
-
/**
|
|
7
|
-
* List all regions
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```ts
|
|
11
|
-
* // Automatically fetches more pages as needed.
|
|
12
|
-
* for await (const region of client.regions.list()) {
|
|
13
|
-
* // ...
|
|
14
|
-
* }
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
list(query = {}, options) {
|
|
18
|
-
return this._client.getAPIList('/v1/regions', (Cursor), { query, ...options });
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Get a region by name
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```ts
|
|
25
|
-
* const region = await client.regions.get('us-wdc-1');
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
get(name, options) {
|
|
29
|
-
return this._client.get(path `/v1/regions/${name}`, options);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
2
|
+
export * from "./regions/index.mjs";
|
|
32
3
|
//# sourceMappingURL=regions.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"regions.mjs","sourceRoot":"","sources":["../src/resources/regions.ts"],"names":[],"mappings":"AAAA,sFAAsF
|
|
1
|
+
{"version":3,"file":"regions.mjs","sourceRoot":"","sources":["../src/resources/regions.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
|
package/src/client.ts
CHANGED
|
@@ -18,13 +18,13 @@ import { AbstractPage, type CursorParams, CursorResponse } from './core/paginati
|
|
|
18
18
|
import * as Uploads from './core/uploads';
|
|
19
19
|
import * as API from './resources/index';
|
|
20
20
|
import { APIPromise } from './core/api-promise';
|
|
21
|
-
import { APIKeys } from './resources/api-keys';
|
|
22
|
-
import { Operations } from './resources/operations';
|
|
23
|
-
import { Organizations } from './resources/organizations';
|
|
24
|
-
import { Projects } from './resources/projects';
|
|
25
|
-
import { Regions } from './resources/regions';
|
|
21
|
+
import { APIKeys } from './resources/api-keys/api-keys';
|
|
26
22
|
import { Compute } from './resources/compute/compute';
|
|
27
23
|
import { Networking } from './resources/networking/networking';
|
|
24
|
+
import { Operations } from './resources/operations/operations';
|
|
25
|
+
import { Organizations } from './resources/organizations/organizations';
|
|
26
|
+
import { Projects } from './resources/projects/projects';
|
|
27
|
+
import { Regions } from './resources/regions/regions';
|
|
28
28
|
import { RPCNodes } from './resources/rpc-nodes/rpc-nodes';
|
|
29
29
|
import { UserResource } from './resources/user/user';
|
|
30
30
|
import { type Fetch } from './internal/builtin-types';
|
|
@@ -731,6 +731,14 @@ export class NirvanaLabs {
|
|
|
731
731
|
(Symbol.iterator in body && 'next' in body && typeof body.next === 'function'))
|
|
732
732
|
) {
|
|
733
733
|
return { bodyHeaders: undefined, body: Shims.ReadableStreamFrom(body as AsyncIterable<Uint8Array>) };
|
|
734
|
+
} else if (
|
|
735
|
+
typeof body === 'object' &&
|
|
736
|
+
headers.values.get('content-type') === 'application/x-www-form-urlencoded'
|
|
737
|
+
) {
|
|
738
|
+
return {
|
|
739
|
+
bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },
|
|
740
|
+
body: this.stringifyQuery(body as Record<string, unknown>),
|
|
741
|
+
};
|
|
734
742
|
} else {
|
|
735
743
|
return this.#encoder({ body, headers });
|
|
736
744
|
}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import * as Shared from '../shared';
|
|
5
|
+
import { APIPromise } from '../../core/api-promise';
|
|
6
|
+
import { Cursor, type CursorParams, PagePromise } from '../../core/pagination';
|
|
7
|
+
import { buildHeaders } from '../../internal/headers';
|
|
8
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
9
|
+
import { path } from '../../internal/utils/path';
|
|
10
|
+
|
|
11
|
+
export class APIKeys extends APIResource {
|
|
12
|
+
/**
|
|
13
|
+
* Create a new API key
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const apiKey = await client.apiKeys.create({
|
|
18
|
+
* expires_at: '2025-12-31T23:59:59Z',
|
|
19
|
+
* name: 'My API Key',
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
create(body: APIKeyCreateParams, options?: RequestOptions): APIPromise<APIKey> {
|
|
24
|
+
return this._client.post('/v1/api_keys', { body, ...options });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Update an existing API key
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const apiKey = await client.apiKeys.update('api_key_id');
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
update(apiKeyID: string, body: APIKeyUpdateParams, options?: RequestOptions): APIPromise<APIKey> {
|
|
36
|
+
return this._client.patch(path`/v1/api_keys/${apiKeyID}`, { body, ...options });
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* List all API keys
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* // Automatically fetches more pages as needed.
|
|
45
|
+
* for await (const apiKey of client.apiKeys.list()) {
|
|
46
|
+
* // ...
|
|
47
|
+
* }
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
list(
|
|
51
|
+
query: APIKeyListParams | null | undefined = {},
|
|
52
|
+
options?: RequestOptions,
|
|
53
|
+
): PagePromise<APIKeysCursor, APIKey> {
|
|
54
|
+
return this._client.getAPIList('/v1/api_keys', Cursor<APIKey>, { query, ...options });
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Delete an API key
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* await client.apiKeys.delete('api_key_id');
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
delete(apiKeyID: string, options?: RequestOptions): APIPromise<void> {
|
|
66
|
+
return this._client.delete(path`/v1/api_keys/${apiKeyID}`, {
|
|
67
|
+
...options,
|
|
68
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Get details about an API key
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* const apiKey = await client.apiKeys.get('api_key_id');
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
get(apiKeyID: string, options?: RequestOptions): APIPromise<APIKey> {
|
|
81
|
+
return this._client.get(path`/v1/api_keys/${apiKeyID}`, options);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export type APIKeysCursor = Cursor<APIKey>;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* API Key response.
|
|
89
|
+
*/
|
|
90
|
+
export interface APIKey {
|
|
91
|
+
/**
|
|
92
|
+
* API Key ID.
|
|
93
|
+
*/
|
|
94
|
+
id: string;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* When the API Key was created.
|
|
98
|
+
*/
|
|
99
|
+
created_at: string;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* When the API Key expires and is no longer valid.
|
|
103
|
+
*/
|
|
104
|
+
expires_at: string;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* API Key name.
|
|
108
|
+
*/
|
|
109
|
+
name: string;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* IP filter rules.
|
|
113
|
+
*/
|
|
114
|
+
source_ip_rule: APIKey.SourceIPRule;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Status of the API Key.
|
|
118
|
+
*/
|
|
119
|
+
status: 'active' | 'inactive' | 'expired';
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Tags to attach to the API Key.
|
|
123
|
+
*/
|
|
124
|
+
tags: Array<string>;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* When the API Key was updated.
|
|
128
|
+
*/
|
|
129
|
+
updated_at: string;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* API Key. Only returned on creation.
|
|
133
|
+
*/
|
|
134
|
+
key?: string;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* When the API Key starts to be valid.
|
|
138
|
+
*/
|
|
139
|
+
starts_at?: string;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export namespace APIKey {
|
|
143
|
+
/**
|
|
144
|
+
* IP filter rules.
|
|
145
|
+
*/
|
|
146
|
+
export interface SourceIPRule {
|
|
147
|
+
/**
|
|
148
|
+
* List of IPv4 CIDR addresses to allow.
|
|
149
|
+
*/
|
|
150
|
+
allowed: Array<string>;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* List of IPv4 CIDR addresses to deny.
|
|
154
|
+
*/
|
|
155
|
+
blocked: Array<string>;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export interface APIKeyList {
|
|
160
|
+
items: Array<APIKey>;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Pagination response details.
|
|
164
|
+
*/
|
|
165
|
+
pagination: Shared.Pagination;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export interface APIKeyCreateParams {
|
|
169
|
+
/**
|
|
170
|
+
* When the API Key expires and is no longer valid.
|
|
171
|
+
*/
|
|
172
|
+
expires_at: string;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* API Key name.
|
|
176
|
+
*/
|
|
177
|
+
name: string;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* IP filter rules.
|
|
181
|
+
*/
|
|
182
|
+
source_ip_rule?: Shared.SourceIPRule;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* When the API Key starts to be valid.
|
|
186
|
+
*/
|
|
187
|
+
starts_at?: string;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Tags to attach to the API Key.
|
|
191
|
+
*/
|
|
192
|
+
tags?: Array<string>;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export interface APIKeyUpdateParams {
|
|
196
|
+
/**
|
|
197
|
+
* API Key name.
|
|
198
|
+
*/
|
|
199
|
+
name?: string;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* IP filter rules.
|
|
203
|
+
*/
|
|
204
|
+
source_ip_rule?: Shared.SourceIPRule;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Tags to attach to the API Key.
|
|
208
|
+
*/
|
|
209
|
+
tags?: Array<string>;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export interface APIKeyListParams extends CursorParams {}
|
|
213
|
+
|
|
214
|
+
export declare namespace APIKeys {
|
|
215
|
+
export {
|
|
216
|
+
type APIKey as APIKey,
|
|
217
|
+
type APIKeyList as APIKeyList,
|
|
218
|
+
type APIKeysCursor as APIKeysCursor,
|
|
219
|
+
type APIKeyCreateParams as APIKeyCreateParams,
|
|
220
|
+
type APIKeyUpdateParams as APIKeyUpdateParams,
|
|
221
|
+
type APIKeyListParams as APIKeyListParams,
|
|
222
|
+
};
|
|
223
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# APIKeys
|
|
2
|
+
|
|
3
|
+
Types:
|
|
4
|
+
|
|
5
|
+
- <code><a href="./src/resources/api-keys.ts">APIKey</a></code>
|
|
6
|
+
- <code><a href="./src/resources/api-keys.ts">APIKeyList</a></code>
|
|
7
|
+
|
|
8
|
+
Methods:
|
|
9
|
+
|
|
10
|
+
- <code title="post /v1/api_keys">client.apiKeys.<a href="./src/resources/api-keys.ts">create</a>({ ...params }) -> APIKey</code>
|
|
11
|
+
- <code title="patch /v1/api_keys/{api_key_id}">client.apiKeys.<a href="./src/resources/api-keys.ts">update</a>(apiKeyID, { ...params }) -> APIKey</code>
|
|
12
|
+
- <code title="get /v1/api_keys">client.apiKeys.<a href="./src/resources/api-keys.ts">list</a>({ ...params }) -> APIKeysCursor</code>
|
|
13
|
+
- <code title="delete /v1/api_keys/{api_key_id}">client.apiKeys.<a href="./src/resources/api-keys.ts">delete</a>(apiKeyID) -> void</code>
|
|
14
|
+
- <code title="get /v1/api_keys/{api_key_id}">client.apiKeys.<a href="./src/resources/api-keys.ts">get</a>(apiKeyID) -> APIKey</code>
|