@nirvana-labs/nirvana 1.22.1 → 1.24.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 (58) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/client.d.mts +3 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +3 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/index.d.mts +1 -0
  12. package/resources/index.d.mts.map +1 -1
  13. package/resources/index.d.ts +1 -0
  14. package/resources/index.d.ts.map +1 -1
  15. package/resources/index.js +3 -1
  16. package/resources/index.js.map +1 -1
  17. package/resources/index.mjs +1 -0
  18. package/resources/index.mjs.map +1 -1
  19. package/resources/networking/connect/connections.d.mts +2 -2
  20. package/resources/networking/connect/connections.d.ts +2 -2
  21. package/resources/networking/firewall-rules.d.mts +5 -4
  22. package/resources/networking/firewall-rules.d.mts.map +1 -1
  23. package/resources/networking/firewall-rules.d.ts +5 -4
  24. package/resources/networking/firewall-rules.d.ts.map +1 -1
  25. package/resources/projects.d.mts +120 -0
  26. package/resources/projects.d.mts.map +1 -0
  27. package/resources/projects.d.ts +120 -0
  28. package/resources/projects.d.ts.map +1 -0
  29. package/resources/projects.js +75 -0
  30. package/resources/projects.js.map +1 -0
  31. package/resources/projects.mjs +71 -0
  32. package/resources/projects.mjs.map +1 -0
  33. package/resources/rpc-nodes/dedicated/dedicated.d.mts +8 -0
  34. package/resources/rpc-nodes/dedicated/dedicated.d.mts.map +1 -1
  35. package/resources/rpc-nodes/dedicated/dedicated.d.ts +8 -0
  36. package/resources/rpc-nodes/dedicated/dedicated.d.ts.map +1 -1
  37. package/resources/rpc-nodes/dedicated/dedicated.js.map +1 -1
  38. package/resources/rpc-nodes/dedicated/dedicated.mjs.map +1 -1
  39. package/resources/rpc-nodes/flex/flex.d.mts +13 -0
  40. package/resources/rpc-nodes/flex/flex.d.mts.map +1 -1
  41. package/resources/rpc-nodes/flex/flex.d.ts +13 -0
  42. package/resources/rpc-nodes/flex/flex.d.ts.map +1 -1
  43. package/resources/rpc-nodes/flex/flex.js +1 -0
  44. package/resources/rpc-nodes/flex/flex.js.map +1 -1
  45. package/resources/rpc-nodes/flex/flex.mjs +1 -0
  46. package/resources/rpc-nodes/flex/flex.mjs.map +1 -1
  47. package/src/client.ts +5 -0
  48. package/src/resources/index.ts +1 -0
  49. package/src/resources/networking/connect/connections.ts +2 -2
  50. package/src/resources/networking/firewall-rules.ts +5 -4
  51. package/src/resources/projects.ts +165 -0
  52. package/src/resources/rpc-nodes/dedicated/dedicated.ts +11 -1
  53. package/src/resources/rpc-nodes/flex/flex.ts +17 -1
  54. package/src/version.ts +1 -1
  55. package/version.d.mts +1 -1
  56. package/version.d.ts +1 -1
  57. package/version.js +1 -1
  58. package/version.mjs +1 -1
package/src/client.ts CHANGED
@@ -20,6 +20,7 @@ import * as API from './resources/index';
20
20
  import { APIPromise } from './core/api-promise';
21
21
  import { APIKeys } from './resources/api-keys';
22
22
  import { Operations } from './resources/operations';
23
+ import { Projects } from './resources/projects';
23
24
  import { UserResource } from './resources/user';
24
25
  import { Compute } from './resources/compute/compute';
25
26
  import { Networking } from './resources/networking/networking';
@@ -744,6 +745,7 @@ export class NirvanaLabs {
744
745
  user: API.UserResource = new API.UserResource(this);
745
746
  apiKeys: API.APIKeys = new API.APIKeys(this);
746
747
  operations: API.Operations = new API.Operations(this);
748
+ projects: API.Projects = new API.Projects(this);
747
749
  compute: API.Compute = new API.Compute(this);
748
750
  networking: API.Networking = new API.Networking(this);
749
751
  rpcNodes: API.RPCNodes = new API.RPCNodes(this);
@@ -753,6 +755,7 @@ export class NirvanaLabs {
753
755
  NirvanaLabs.UserResource = UserResource;
754
756
  NirvanaLabs.APIKeys = APIKeys;
755
757
  NirvanaLabs.Operations = Operations;
758
+ NirvanaLabs.Projects = Projects;
756
759
  NirvanaLabs.Compute = Compute;
757
760
  NirvanaLabs.Networking = Networking;
758
761
  NirvanaLabs.RPCNodes = RPCNodes;
@@ -770,6 +773,8 @@ export declare namespace NirvanaLabs {
770
773
 
771
774
  export { Operations as Operations };
772
775
 
776
+ export { Projects as Projects };
777
+
773
778
  export { Compute as Compute };
774
779
 
775
780
  export { Networking as Networking };
@@ -5,6 +5,7 @@ export { APIKeys } from './api-keys';
5
5
  export { Compute } from './compute/compute';
6
6
  export { Networking } from './networking/networking';
7
7
  export { Operations } from './operations';
8
+ export { Projects } from './projects';
8
9
  export { RPCNodes } from './rpc-nodes/rpc-nodes';
9
10
  export { UserResource } from './user';
10
11
  export { Vektor } from './vektor/vektor';
@@ -109,7 +109,7 @@ export interface ConnectionCreateParams {
109
109
  bandwidth_mbps: ConnectAPI.ConnectBandwidthMbps;
110
110
 
111
111
  /**
112
- * CIDRs for the Connect Connection
112
+ * CIDRs for the Connect Connection. Must be in network-aligned/canonical form.
113
113
  */
114
114
  cidrs: Array<string>;
115
115
 
@@ -119,7 +119,7 @@ export interface ConnectionCreateParams {
119
119
  name: string;
120
120
 
121
121
  /**
122
- * Provider CIDRs
122
+ * Provider CIDRs. Must be in network-aligned/canonical form.
123
123
  */
124
124
  provider_cidrs: Array<string>;
125
125
 
@@ -197,7 +197,8 @@ export interface FirewallRuleList {
197
197
 
198
198
  export interface FirewallRuleCreateParams {
199
199
  /**
200
- * Destination address of the Firewall Rule. Either VPC CIDR or VM in VPC.
200
+ * Destination address of the Firewall Rule. Either VPC CIDR or VM in VPC. Must be
201
+ * in network-aligned/canonical form.
201
202
  */
202
203
  destination_address: string;
203
204
 
@@ -218,7 +219,7 @@ export interface FirewallRuleCreateParams {
218
219
 
219
220
  /**
220
221
  * Source address of the Firewall Rule. Address of 0.0.0.0 requires a CIDR mask
221
- * of 0.
222
+ * of 0. Must be in network-aligned/canonical form.
222
223
  */
223
224
  source_address: string;
224
225
 
@@ -236,7 +237,7 @@ export interface FirewallRuleUpdateParams {
236
237
 
237
238
  /**
238
239
  * Body param: Destination address of the Firewall Rule. Either VPC CIDR or VM in
239
- * VPC.
240
+ * VPC. Must be in network-aligned/canonical form.
240
241
  */
241
242
  destination_address?: string;
242
243
 
@@ -257,7 +258,7 @@ export interface FirewallRuleUpdateParams {
257
258
 
258
259
  /**
259
260
  * Body param: Source address of the Firewall Rule. Address of 0.0.0.0 requires a
260
- * CIDR mask of 0.
261
+ * CIDR mask of 0. Must be in network-aligned/canonical form.
261
262
  */
262
263
  source_address?: string;
263
264
 
@@ -0,0 +1,165 @@
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 Projects extends APIResource {
12
+ /**
13
+ * Create a new project
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * const project = await client.projects.create({
18
+ * name: 'My Project',
19
+ * });
20
+ * ```
21
+ */
22
+ create(body: ProjectCreateParams, options?: RequestOptions): APIPromise<Project> {
23
+ return this._client.post('/v1/projects', { body, ...options });
24
+ }
25
+
26
+ /**
27
+ * Update an existing project
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * const project = await client.projects.update('project_id');
32
+ * ```
33
+ */
34
+ update(projectID: string, body: ProjectUpdateParams, options?: RequestOptions): APIPromise<Project> {
35
+ return this._client.patch(path`/v1/projects/${projectID}`, { body, ...options });
36
+ }
37
+
38
+ /**
39
+ * List all projects for the authenticated user
40
+ *
41
+ * @example
42
+ * ```ts
43
+ * // Automatically fetches more pages as needed.
44
+ * for await (const project of client.projects.list()) {
45
+ * // ...
46
+ * }
47
+ * ```
48
+ */
49
+ list(
50
+ query: ProjectListParams | null | undefined = {},
51
+ options?: RequestOptions,
52
+ ): PagePromise<ProjectsCursor, Project> {
53
+ return this._client.getAPIList('/v1/projects', Cursor<Project>, { query, ...options });
54
+ }
55
+
56
+ /**
57
+ * Delete a project
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * await client.projects.delete('project_id');
62
+ * ```
63
+ */
64
+ delete(projectID: string, options?: RequestOptions): APIPromise<void> {
65
+ return this._client.delete(path`/v1/projects/${projectID}`, {
66
+ ...options,
67
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
68
+ });
69
+ }
70
+
71
+ /**
72
+ * Get details about a project
73
+ *
74
+ * @example
75
+ * ```ts
76
+ * const project = await client.projects.get('project_id');
77
+ * ```
78
+ */
79
+ get(projectID: string, options?: RequestOptions): APIPromise<Project> {
80
+ return this._client.get(path`/v1/projects/${projectID}`, options);
81
+ }
82
+ }
83
+
84
+ export type ProjectsCursor = Cursor<Project>;
85
+
86
+ /**
87
+ * Project response.
88
+ */
89
+ export interface Project {
90
+ /**
91
+ * Project ID.
92
+ */
93
+ id: string;
94
+
95
+ /**
96
+ * When the Project was created.
97
+ */
98
+ created_at: string;
99
+
100
+ /**
101
+ * Project name.
102
+ */
103
+ name: string;
104
+
105
+ /**
106
+ * Tags attached to the Project.
107
+ */
108
+ tags: Array<string>;
109
+
110
+ /**
111
+ * When the Project was updated.
112
+ */
113
+ updated_at: string;
114
+
115
+ /**
116
+ * User ID that owns the project.
117
+ */
118
+ user_id: string;
119
+ }
120
+
121
+ export interface ProjectList {
122
+ items: Array<Project>;
123
+
124
+ /**
125
+ * Pagination response details.
126
+ */
127
+ pagination: Shared.Pagination;
128
+ }
129
+
130
+ export interface ProjectCreateParams {
131
+ /**
132
+ * Project name.
133
+ */
134
+ name: string;
135
+
136
+ /**
137
+ * Tags to attach to the Project.
138
+ */
139
+ tags?: Array<string>;
140
+ }
141
+
142
+ export interface ProjectUpdateParams {
143
+ /**
144
+ * Project name.
145
+ */
146
+ name?: string;
147
+
148
+ /**
149
+ * Tags to attach to the Project.
150
+ */
151
+ tags?: Array<string>;
152
+ }
153
+
154
+ export interface ProjectListParams extends CursorParams {}
155
+
156
+ export declare namespace Projects {
157
+ export {
158
+ type Project as Project,
159
+ type ProjectList as ProjectList,
160
+ type ProjectsCursor as ProjectsCursor,
161
+ type ProjectCreateParams as ProjectCreateParams,
162
+ type ProjectUpdateParams as ProjectUpdateParams,
163
+ type ProjectListParams as ProjectListParams,
164
+ };
165
+ }
@@ -83,6 +83,11 @@ export interface Dedicated {
83
83
  */
84
84
  network: string;
85
85
 
86
+ /**
87
+ * Project identifier associated with the RPC Node Dedicated.
88
+ */
89
+ project_id: string | null;
90
+
86
91
  /**
87
92
  * Tags to attach to the RPC Node Dedicated.
88
93
  */
@@ -127,7 +132,12 @@ export interface DedicatedList {
127
132
  pagination: Shared.Pagination;
128
133
  }
129
134
 
130
- export interface DedicatedListParams extends CursorParams {}
135
+ export interface DedicatedListParams extends CursorParams {
136
+ /**
137
+ * Project ID of resources to request
138
+ */
139
+ project_id?: string;
140
+ }
131
141
 
132
142
  DedicatedResource.Blockchains = Blockchains;
133
143
 
@@ -22,6 +22,7 @@ export class FlexResource extends APIResource {
22
22
  * blockchain: 'ethereum',
23
23
  * name: 'my-ethereum-node',
24
24
  * network: 'mainnet',
25
+ * project_id: '123e4567-e89b-12d3-a456-426614174000',
25
26
  * });
26
27
  * ```
27
28
  */
@@ -125,6 +126,11 @@ export interface Flex {
125
126
  */
126
127
  network: string;
127
128
 
129
+ /**
130
+ * Project identifier associated with the RPC Node Flex.
131
+ */
132
+ project_id: string | null;
133
+
128
134
  /**
129
135
  * Tags to attach to the RPC Node Flex.
130
136
  */
@@ -185,6 +191,11 @@ export interface FlexCreateParams {
185
191
  */
186
192
  network: string;
187
193
 
194
+ /**
195
+ * Project ID to associate with the RPC Node Flex.
196
+ */
197
+ project_id: string;
198
+
188
199
  /**
189
200
  * Tags to attach to the RPC Node Flex (optional, max 50).
190
201
  */
@@ -203,7 +214,12 @@ export interface FlexUpdateParams {
203
214
  tags?: Array<string>;
204
215
  }
205
216
 
206
- export interface FlexListParams extends CursorParams {}
217
+ export interface FlexListParams extends CursorParams {
218
+ /**
219
+ * Project ID of resources to request
220
+ */
221
+ project_id?: string;
222
+ }
207
223
 
208
224
  FlexResource.Blockchains = Blockchains;
209
225
 
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.22.1'; // x-release-please-version
1
+ export const VERSION = '1.24.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.22.1";
1
+ export declare const VERSION = "1.24.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.22.1";
1
+ export declare const VERSION = "1.24.0";
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 = '1.22.1'; // x-release-please-version
4
+ exports.VERSION = '1.24.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.22.1'; // x-release-please-version
1
+ export const VERSION = '1.24.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map