@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.
Files changed (186) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/client.d.mts +5 -5
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +5 -5
  5. package/client.d.ts.map +1 -1
  6. package/client.js +12 -5
  7. package/client.js.map +1 -1
  8. package/client.mjs +12 -5
  9. package/client.mjs.map +1 -1
  10. package/internal/tslib.js +6 -6
  11. package/package.json +1 -1
  12. package/resources/api-keys/api-keys.d.mts +168 -0
  13. package/resources/api-keys/api-keys.d.mts.map +1 -0
  14. package/resources/api-keys/api-keys.d.ts +168 -0
  15. package/resources/api-keys/api-keys.d.ts.map +1 -0
  16. package/resources/api-keys/api-keys.js +76 -0
  17. package/resources/api-keys/api-keys.js.map +1 -0
  18. package/resources/api-keys/api-keys.mjs +72 -0
  19. package/resources/api-keys/api-keys.mjs.map +1 -0
  20. package/resources/api-keys/index.d.mts +2 -0
  21. package/resources/api-keys/index.d.mts.map +1 -0
  22. package/resources/api-keys/index.d.ts +2 -0
  23. package/resources/api-keys/index.d.ts.map +1 -0
  24. package/resources/api-keys/index.js +7 -0
  25. package/resources/api-keys/index.js.map +1 -0
  26. package/resources/api-keys/index.mjs +3 -0
  27. package/resources/api-keys/index.mjs.map +1 -0
  28. package/resources/api-keys.d.mts +1 -167
  29. package/resources/api-keys.d.mts.map +1 -1
  30. package/resources/api-keys.d.ts +1 -167
  31. package/resources/api-keys.d.ts.map +1 -1
  32. package/resources/api-keys.js +2 -72
  33. package/resources/api-keys.js.map +1 -1
  34. package/resources/api-keys.mjs +1 -70
  35. package/resources/api-keys.mjs.map +1 -1
  36. package/resources/compute/vms/vms.d.mts +1 -1
  37. package/resources/compute/vms/vms.d.mts.map +1 -1
  38. package/resources/compute/vms/vms.d.ts +1 -1
  39. package/resources/compute/vms/vms.d.ts.map +1 -1
  40. package/resources/compute/volumes/volumes.d.mts +1 -1
  41. package/resources/compute/volumes/volumes.d.mts.map +1 -1
  42. package/resources/compute/volumes/volumes.d.ts +1 -1
  43. package/resources/compute/volumes/volumes.d.ts.map +1 -1
  44. package/resources/networking/connect/connections.d.mts +1 -1
  45. package/resources/networking/connect/connections.d.mts.map +1 -1
  46. package/resources/networking/connect/connections.d.ts +1 -1
  47. package/resources/networking/connect/connections.d.ts.map +1 -1
  48. package/resources/networking/firewall-rules.d.mts +1 -1
  49. package/resources/networking/firewall-rules.d.mts.map +1 -1
  50. package/resources/networking/firewall-rules.d.ts +1 -1
  51. package/resources/networking/firewall-rules.d.ts.map +1 -1
  52. package/resources/networking/vpcs/vpcs.d.mts +1 -1
  53. package/resources/networking/vpcs/vpcs.d.mts.map +1 -1
  54. package/resources/networking/vpcs/vpcs.d.ts +1 -1
  55. package/resources/networking/vpcs/vpcs.d.ts.map +1 -1
  56. package/resources/operations/index.d.mts +2 -0
  57. package/resources/operations/index.d.mts.map +1 -0
  58. package/resources/operations/index.d.ts +2 -0
  59. package/resources/operations/index.d.ts.map +1 -0
  60. package/resources/operations/index.js +7 -0
  61. package/resources/operations/index.js.map +1 -0
  62. package/resources/operations/index.mjs +3 -0
  63. package/resources/operations/index.mjs.map +1 -0
  64. package/resources/operations/operations.d.mts +82 -0
  65. package/resources/operations/operations.d.mts.map +1 -0
  66. package/resources/operations/operations.d.ts +82 -0
  67. package/resources/operations/operations.d.ts.map +1 -0
  68. package/resources/operations/operations.js +23 -0
  69. package/resources/operations/operations.js.map +1 -0
  70. package/resources/operations/operations.mjs +19 -0
  71. package/resources/operations/operations.mjs.map +1 -0
  72. package/resources/operations.d.mts +1 -81
  73. package/resources/operations.d.mts.map +1 -1
  74. package/resources/operations.d.ts +1 -81
  75. package/resources/operations.d.ts.map +1 -1
  76. package/resources/operations.js +2 -19
  77. package/resources/operations.js.map +1 -1
  78. package/resources/operations.mjs +1 -17
  79. package/resources/operations.mjs.map +1 -1
  80. package/resources/organizations/index.d.mts +2 -0
  81. package/resources/organizations/index.d.mts.map +1 -0
  82. package/resources/organizations/index.d.ts +2 -0
  83. package/resources/organizations/index.d.ts.map +1 -0
  84. package/resources/organizations/index.js +7 -0
  85. package/resources/organizations/index.js.map +1 -0
  86. package/resources/organizations/index.mjs +3 -0
  87. package/resources/organizations/index.mjs.map +1 -0
  88. package/resources/organizations/organizations.d.mts +103 -0
  89. package/resources/organizations/organizations.d.mts.map +1 -0
  90. package/resources/organizations/organizations.d.ts +103 -0
  91. package/resources/organizations/organizations.d.ts.map +1 -0
  92. package/resources/organizations/organizations.js +64 -0
  93. package/resources/organizations/organizations.js.map +1 -0
  94. package/resources/organizations/organizations.mjs +60 -0
  95. package/resources/organizations/organizations.mjs.map +1 -0
  96. package/resources/organizations.d.mts +1 -102
  97. package/resources/organizations.d.mts.map +1 -1
  98. package/resources/organizations.d.ts +1 -102
  99. package/resources/organizations.d.ts.map +1 -1
  100. package/resources/organizations.js +2 -60
  101. package/resources/organizations.js.map +1 -1
  102. package/resources/organizations.mjs +1 -58
  103. package/resources/organizations.mjs.map +1 -1
  104. package/resources/projects/index.d.mts +2 -0
  105. package/resources/projects/index.d.mts.map +1 -0
  106. package/resources/projects/index.d.ts +2 -0
  107. package/resources/projects/index.d.ts.map +1 -0
  108. package/resources/projects/index.js +7 -0
  109. package/resources/projects/index.js.map +1 -0
  110. package/resources/projects/index.mjs +3 -0
  111. package/resources/projects/index.mjs.map +1 -0
  112. package/resources/projects/projects.d.mts +171 -0
  113. package/resources/projects/projects.d.mts.map +1 -0
  114. package/resources/projects/projects.d.ts +171 -0
  115. package/resources/projects/projects.d.ts.map +1 -0
  116. package/resources/projects/projects.js +75 -0
  117. package/resources/projects/projects.js.map +1 -0
  118. package/resources/projects/projects.mjs +71 -0
  119. package/resources/projects/projects.mjs.map +1 -0
  120. package/resources/projects.d.mts +1 -174
  121. package/resources/projects.d.mts.map +1 -1
  122. package/resources/projects.d.ts +1 -174
  123. package/resources/projects.d.ts.map +1 -1
  124. package/resources/projects.js +2 -71
  125. package/resources/projects.js.map +1 -1
  126. package/resources/projects.mjs +1 -69
  127. package/resources/projects.mjs.map +1 -1
  128. package/resources/regions/index.d.mts +2 -0
  129. package/resources/regions/index.d.mts.map +1 -0
  130. package/resources/regions/index.d.ts +2 -0
  131. package/resources/regions/index.d.ts.map +1 -0
  132. package/resources/regions/index.js +7 -0
  133. package/resources/regions/index.js.map +1 -0
  134. package/resources/regions/index.mjs +3 -0
  135. package/resources/regions/index.mjs.map +1 -0
  136. package/resources/regions/regions.d.mts +108 -0
  137. package/resources/regions/regions.d.mts.map +1 -0
  138. package/resources/regions/regions.d.ts +108 -0
  139. package/resources/regions/regions.d.ts.map +1 -0
  140. package/resources/regions/regions.js +36 -0
  141. package/resources/regions/regions.js.map +1 -0
  142. package/resources/regions/regions.mjs +32 -0
  143. package/resources/regions/regions.mjs.map +1 -0
  144. package/resources/regions.d.mts +1 -107
  145. package/resources/regions.d.mts.map +1 -1
  146. package/resources/regions.d.ts +1 -107
  147. package/resources/regions.d.ts.map +1 -1
  148. package/resources/regions.js +2 -32
  149. package/resources/regions.js.map +1 -1
  150. package/resources/regions.mjs +1 -30
  151. package/resources/regions.mjs.map +1 -1
  152. package/src/client.ts +13 -5
  153. package/src/resources/api-keys/api-keys.ts +223 -0
  154. package/src/resources/api-keys/api.md +14 -0
  155. package/src/resources/api-keys/index.ts +3 -0
  156. package/src/resources/api-keys.ts +1 -221
  157. package/src/resources/compute/api.md +68 -0
  158. package/src/resources/compute/vms/vms.ts +1 -1
  159. package/src/resources/compute/volumes/volumes.ts +1 -1
  160. package/src/resources/networking/api.md +67 -0
  161. package/src/resources/networking/connect/connections.ts +1 -1
  162. package/src/resources/networking/firewall-rules.ts +1 -1
  163. package/src/resources/networking/vpcs/vpcs.ts +1 -1
  164. package/src/resources/operations/api.md +14 -0
  165. package/src/resources/operations/index.ts +3 -0
  166. package/src/resources/operations/operations.ts +114 -0
  167. package/src/resources/operations.ts +1 -112
  168. package/src/resources/organizations/api.md +13 -0
  169. package/src/resources/organizations/index.ts +3 -0
  170. package/src/resources/organizations/organizations.ts +142 -0
  171. package/src/resources/organizations.ts +1 -140
  172. package/src/resources/projects/api.md +14 -0
  173. package/src/resources/projects/index.ts +3 -0
  174. package/src/resources/projects/projects.ts +224 -0
  175. package/src/resources/projects.ts +1 -227
  176. package/src/resources/regions/api.md +12 -0
  177. package/src/resources/regions/index.ts +3 -0
  178. package/src/resources/regions/regions.ts +140 -0
  179. package/src/resources/regions.ts +1 -138
  180. package/src/resources/rpc-nodes/api.md +44 -0
  181. package/src/resources/user/api.md +20 -0
  182. package/src/version.ts +1 -1
  183. package/version.d.mts +1 -1
  184. package/version.d.ts +1 -1
  185. package/version.js +1 -1
  186. 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"}
@@ -1,108 +1,2 @@
1
- import { APIResource } from "../core/resource.mjs";
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":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE;OAC1C,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;OAUG;IACH,IAAI,CACF,KAAK,GAAE,gBAAgB,GAAG,IAAI,GAAG,SAAc,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,aAAa,EAAE,MAAM,CAAC;IAIrC;;;;;;;OAOG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;CAGhE;AAED,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,YAAY,EAAE,kBAAkB,CAAC;IAEjC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC;IAExB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC;IAE9B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC;CACzB;AAED,yBAAiB,MAAM,CAAC;IACtB;;OAEG;IACH,UAAiB,OAAO;QACtB;;WAEG;QACH,GAAG,EAAE,OAAO,CAAC;KACd;IAED;;OAEG;IACH,UAAiB,UAAU;QACzB;;WAEG;QACH,OAAO,EAAE,OAAO,CAAC;QAEjB;;WAEG;QACH,IAAI,EAAE,OAAO,CAAC;KACf;IAED;;OAEG;IACH,UAAiB,OAAO;QACtB;;WAEG;QACH,GAAG,EAAE,OAAO,CAAC;QAEb;;WAEG;QACH,UAAU,EAAE,OAAO,CAAC;KACrB;CACF;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,SAAS,GAAG,aAAa,GAAG,QAAQ,CAAC;AAE/E,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAErB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC;CAC/B;AAED,MAAM,WAAW,gBAAiB,SAAQ,YAAY;CAAG;AAEzD,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
1
+ {"version":3,"file":"regions.d.mts","sourceRoot":"","sources":["../src/resources/regions.ts"],"names":[],"mappings":""}
@@ -1,108 +1,2 @@
1
- import { APIResource } from "../core/resource.js";
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":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,MAAM,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE;OAC1C,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;OAUG;IACH,IAAI,CACF,KAAK,GAAE,gBAAgB,GAAG,IAAI,GAAG,SAAc,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,aAAa,EAAE,MAAM,CAAC;IAIrC;;;;;;;OAOG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;CAGhE;AAED,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,YAAY,EAAE,kBAAkB,CAAC;IAEjC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC;IAExB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC;IAE9B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC;CACzB;AAED,yBAAiB,MAAM,CAAC;IACtB;;OAEG;IACH,UAAiB,OAAO;QACtB;;WAEG;QACH,GAAG,EAAE,OAAO,CAAC;KACd;IAED;;OAEG;IACH,UAAiB,UAAU;QACzB;;WAEG;QACH,OAAO,EAAE,OAAO,CAAC;QAEjB;;WAEG;QACH,IAAI,EAAE,OAAO,CAAC;KACf;IAED;;OAEG;IACH,UAAiB,OAAO;QACtB;;WAEG;QACH,GAAG,EAAE,OAAO,CAAC;QAEb;;WAEG;QACH,UAAU,EAAE,OAAO,CAAC;KACrB;CACF;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,SAAS,GAAG,aAAa,GAAG,QAAQ,CAAC;AAE/E,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAErB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC;CAC/B;AAED,MAAM,WAAW,gBAAiB,SAAQ,YAAY;CAAG;AAEzD,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;CACH"}
1
+ {"version":3,"file":"regions.d.ts","sourceRoot":"","sources":["../src/resources/regions.ts"],"names":[],"mappings":""}
@@ -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
- exports.Regions = void 0;
5
- const resource_1 = require("../core/resource.js");
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
@@ -1 +1 @@
1
- {"version":3,"file":"regions.js","sourceRoot":"","sources":["../src/resources/regions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,sDAA4E;AAE5E,oDAA8C;AAE9C,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;;;;;;;OAUG;IACH,IAAI,CACF,QAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,aAAa,EAAE,CAAA,mBAAc,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,IAAA,WAAI,EAAA,eAAe,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;CACF;AA9BD,0BA8BC"}
1
+ {"version":3,"file":"regions.js","sourceRoot":"","sources":["../src/resources/regions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6DAAgC"}
@@ -1,32 +1,3 @@
1
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
- }
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;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"}
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>
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export { APIKeys } from './api-keys';