@nirvana-labs/nirvana 0.1.0-alpha.10

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 (249) hide show
  1. package/CHANGELOG.md +100 -0
  2. package/LICENSE +201 -0
  3. package/README.md +371 -0
  4. package/_shims/MultipartBody.d.ts +9 -0
  5. package/_shims/MultipartBody.d.ts.map +1 -0
  6. package/_shims/MultipartBody.js +16 -0
  7. package/_shims/MultipartBody.js.map +1 -0
  8. package/_shims/MultipartBody.mjs +12 -0
  9. package/_shims/MultipartBody.mjs.map +1 -0
  10. package/_shims/README.md +46 -0
  11. package/_shims/auto/runtime-bun.d.ts +5 -0
  12. package/_shims/auto/runtime-bun.d.ts.map +1 -0
  13. package/_shims/auto/runtime-bun.js +21 -0
  14. package/_shims/auto/runtime-bun.js.map +1 -0
  15. package/_shims/auto/runtime-bun.mjs +2 -0
  16. package/_shims/auto/runtime-bun.mjs.map +1 -0
  17. package/_shims/auto/runtime-node.d.ts +5 -0
  18. package/_shims/auto/runtime-node.d.ts.map +1 -0
  19. package/_shims/auto/runtime-node.js +21 -0
  20. package/_shims/auto/runtime-node.js.map +1 -0
  21. package/_shims/auto/runtime-node.mjs +2 -0
  22. package/_shims/auto/runtime-node.mjs.map +1 -0
  23. package/_shims/auto/runtime.d.ts +5 -0
  24. package/_shims/auto/runtime.d.ts.map +1 -0
  25. package/_shims/auto/runtime.js +21 -0
  26. package/_shims/auto/runtime.js.map +1 -0
  27. package/_shims/auto/runtime.mjs +2 -0
  28. package/_shims/auto/runtime.mjs.map +1 -0
  29. package/_shims/auto/types-node.d.ts +5 -0
  30. package/_shims/auto/types-node.d.ts.map +1 -0
  31. package/_shims/auto/types-node.js +21 -0
  32. package/_shims/auto/types-node.js.map +1 -0
  33. package/_shims/auto/types-node.mjs +2 -0
  34. package/_shims/auto/types-node.mjs.map +1 -0
  35. package/_shims/auto/types.d.ts +101 -0
  36. package/_shims/auto/types.js +3 -0
  37. package/_shims/auto/types.mjs +3 -0
  38. package/_shims/bun-runtime.d.ts +6 -0
  39. package/_shims/bun-runtime.d.ts.map +1 -0
  40. package/_shims/bun-runtime.js +14 -0
  41. package/_shims/bun-runtime.js.map +1 -0
  42. package/_shims/bun-runtime.mjs +10 -0
  43. package/_shims/bun-runtime.mjs.map +1 -0
  44. package/_shims/index.d.ts +81 -0
  45. package/_shims/index.js +13 -0
  46. package/_shims/index.mjs +7 -0
  47. package/_shims/manual-types.d.ts +12 -0
  48. package/_shims/manual-types.js +3 -0
  49. package/_shims/manual-types.mjs +3 -0
  50. package/_shims/node-runtime.d.ts +3 -0
  51. package/_shims/node-runtime.d.ts.map +1 -0
  52. package/_shims/node-runtime.js +89 -0
  53. package/_shims/node-runtime.js.map +1 -0
  54. package/_shims/node-runtime.mjs +56 -0
  55. package/_shims/node-runtime.mjs.map +1 -0
  56. package/_shims/node-types.d.ts +42 -0
  57. package/_shims/node-types.js +3 -0
  58. package/_shims/node-types.mjs +3 -0
  59. package/_shims/registry.d.ts +37 -0
  60. package/_shims/registry.d.ts.map +1 -0
  61. package/_shims/registry.js +41 -0
  62. package/_shims/registry.js.map +1 -0
  63. package/_shims/registry.mjs +37 -0
  64. package/_shims/registry.mjs.map +1 -0
  65. package/_shims/web-runtime.d.ts +5 -0
  66. package/_shims/web-runtime.d.ts.map +1 -0
  67. package/_shims/web-runtime.js +78 -0
  68. package/_shims/web-runtime.js.map +1 -0
  69. package/_shims/web-runtime.mjs +71 -0
  70. package/_shims/web-runtime.mjs.map +1 -0
  71. package/_shims/web-types.d.ts +83 -0
  72. package/_shims/web-types.js +3 -0
  73. package/_shims/web-types.mjs +3 -0
  74. package/core.d.ts +241 -0
  75. package/core.d.ts.map +1 -0
  76. package/core.js +908 -0
  77. package/core.js.map +1 -0
  78. package/core.mjs +876 -0
  79. package/core.mjs.map +1 -0
  80. package/error.d.ts +47 -0
  81. package/error.d.ts.map +1 -0
  82. package/error.js +113 -0
  83. package/error.js.map +1 -0
  84. package/error.mjs +97 -0
  85. package/error.mjs.map +1 -0
  86. package/index.d.mts +118 -0
  87. package/index.d.ts +118 -0
  88. package/index.d.ts.map +1 -0
  89. package/index.js +128 -0
  90. package/index.js.map +1 -0
  91. package/index.mjs +85 -0
  92. package/index.mjs.map +1 -0
  93. package/package.json +103 -0
  94. package/resource.d.ts +6 -0
  95. package/resource.d.ts.map +1 -0
  96. package/resource.js +11 -0
  97. package/resource.js.map +1 -0
  98. package/resource.mjs +7 -0
  99. package/resource.mjs.map +1 -0
  100. package/resources/compute/compute.d.ts +14 -0
  101. package/resources/compute/compute.d.ts.map +1 -0
  102. package/resources/compute/compute.js +43 -0
  103. package/resources/compute/compute.js.map +1 -0
  104. package/resources/compute/compute.mjs +16 -0
  105. package/resources/compute/compute.mjs.map +1 -0
  106. package/resources/compute/index.d.ts +4 -0
  107. package/resources/compute/index.d.ts.map +1 -0
  108. package/resources/compute/index.js +11 -0
  109. package/resources/compute/index.js.map +1 -0
  110. package/resources/compute/index.mjs +5 -0
  111. package/resources/compute/index.mjs.map +1 -0
  112. package/resources/compute/vms/index.d.ts +3 -0
  113. package/resources/compute/vms/index.d.ts.map +1 -0
  114. package/resources/compute/vms/index.js +9 -0
  115. package/resources/compute/vms/index.js.map +1 -0
  116. package/resources/compute/vms/index.mjs +4 -0
  117. package/resources/compute/vms/index.mjs.map +1 -0
  118. package/resources/compute/vms/os-images.d.ts +14 -0
  119. package/resources/compute/vms/os-images.d.ts.map +1 -0
  120. package/resources/compute/vms/os-images.js +15 -0
  121. package/resources/compute/vms/os-images.js.map +1 -0
  122. package/resources/compute/vms/os-images.mjs +11 -0
  123. package/resources/compute/vms/os-images.mjs.map +1 -0
  124. package/resources/compute/vms/vms.d.ts +164 -0
  125. package/resources/compute/vms/vms.d.ts.map +1 -0
  126. package/resources/compute/vms/vms.js +69 -0
  127. package/resources/compute/vms/vms.js.map +1 -0
  128. package/resources/compute/vms/vms.mjs +42 -0
  129. package/resources/compute/vms/vms.mjs.map +1 -0
  130. package/resources/compute/volumes.d.ts +72 -0
  131. package/resources/compute/volumes.d.ts.map +1 -0
  132. package/resources/compute/volumes.js +39 -0
  133. package/resources/compute/volumes.js.map +1 -0
  134. package/resources/compute/volumes.mjs +35 -0
  135. package/resources/compute/volumes.mjs.map +1 -0
  136. package/resources/index.d.ts +5 -0
  137. package/resources/index.d.ts.map +1 -0
  138. package/resources/index.js +26 -0
  139. package/resources/index.js.map +1 -0
  140. package/resources/index.mjs +6 -0
  141. package/resources/index.mjs.map +1 -0
  142. package/resources/networking/firewall-rules.d.ts +90 -0
  143. package/resources/networking/firewall-rules.d.ts.map +1 -0
  144. package/resources/networking/firewall-rules.js +42 -0
  145. package/resources/networking/firewall-rules.js.map +1 -0
  146. package/resources/networking/firewall-rules.mjs +38 -0
  147. package/resources/networking/firewall-rules.mjs.map +1 -0
  148. package/resources/networking/index.d.ts +4 -0
  149. package/resources/networking/index.d.ts.map +1 -0
  150. package/resources/networking/index.js +11 -0
  151. package/resources/networking/index.js.map +1 -0
  152. package/resources/networking/index.mjs +5 -0
  153. package/resources/networking/index.mjs.map +1 -0
  154. package/resources/networking/networking.d.ts +14 -0
  155. package/resources/networking/networking.d.ts.map +1 -0
  156. package/resources/networking/networking.js +43 -0
  157. package/resources/networking/networking.js.map +1 -0
  158. package/resources/networking/networking.mjs +16 -0
  159. package/resources/networking/networking.mjs.map +1 -0
  160. package/resources/networking/vpcs.d.ts +60 -0
  161. package/resources/networking/vpcs.d.ts.map +1 -0
  162. package/resources/networking/vpcs.js +33 -0
  163. package/resources/networking/vpcs.js.map +1 -0
  164. package/resources/networking/vpcs.mjs +29 -0
  165. package/resources/networking/vpcs.mjs.map +1 -0
  166. package/resources/operations.d.ts +26 -0
  167. package/resources/operations.d.ts.map +1 -0
  168. package/resources/operations.js +21 -0
  169. package/resources/operations.js.map +1 -0
  170. package/resources/operations.mjs +17 -0
  171. package/resources/operations.mjs.map +1 -0
  172. package/resources/shared.d.ts +3 -0
  173. package/resources/shared.d.ts.map +1 -0
  174. package/resources/shared.js +4 -0
  175. package/resources/shared.js.map +1 -0
  176. package/resources/shared.mjs +3 -0
  177. package/resources/shared.mjs.map +1 -0
  178. package/shims/node.d.ts +30 -0
  179. package/shims/node.d.ts.map +1 -0
  180. package/shims/node.js +31 -0
  181. package/shims/node.js.map +1 -0
  182. package/shims/node.mjs +5 -0
  183. package/shims/node.mjs.map +1 -0
  184. package/shims/web.d.ts +26 -0
  185. package/shims/web.d.ts.map +1 -0
  186. package/shims/web.js +31 -0
  187. package/shims/web.js.map +1 -0
  188. package/shims/web.mjs +5 -0
  189. package/shims/web.mjs.map +1 -0
  190. package/src/_shims/MultipartBody.ts +9 -0
  191. package/src/_shims/README.md +46 -0
  192. package/src/_shims/auto/runtime-bun.ts +4 -0
  193. package/src/_shims/auto/runtime-node.ts +4 -0
  194. package/src/_shims/auto/runtime.ts +4 -0
  195. package/src/_shims/auto/types-node.ts +4 -0
  196. package/src/_shims/auto/types.d.ts +101 -0
  197. package/src/_shims/auto/types.js +3 -0
  198. package/src/_shims/auto/types.mjs +3 -0
  199. package/src/_shims/bun-runtime.ts +14 -0
  200. package/src/_shims/index.d.ts +81 -0
  201. package/src/_shims/index.js +13 -0
  202. package/src/_shims/index.mjs +7 -0
  203. package/src/_shims/manual-types.d.ts +12 -0
  204. package/src/_shims/manual-types.js +3 -0
  205. package/src/_shims/manual-types.mjs +3 -0
  206. package/src/_shims/node-runtime.ts +81 -0
  207. package/src/_shims/node-types.d.ts +42 -0
  208. package/src/_shims/node-types.js +3 -0
  209. package/src/_shims/node-types.mjs +3 -0
  210. package/src/_shims/registry.ts +67 -0
  211. package/src/_shims/web-runtime.ts +103 -0
  212. package/src/_shims/web-types.d.ts +83 -0
  213. package/src/_shims/web-types.js +3 -0
  214. package/src/_shims/web-types.mjs +3 -0
  215. package/src/core.ts +1201 -0
  216. package/src/error.ts +130 -0
  217. package/src/index.ts +198 -0
  218. package/src/lib/.keep +4 -0
  219. package/src/resource.ts +11 -0
  220. package/src/resources/compute/compute.ts +49 -0
  221. package/src/resources/compute/index.ts +24 -0
  222. package/src/resources/compute/vms/index.ts +14 -0
  223. package/src/resources/compute/vms/os-images.ts +20 -0
  224. package/src/resources/compute/vms/vms.ts +239 -0
  225. package/src/resources/compute/volumes.ts +120 -0
  226. package/src/resources/index.ts +6 -0
  227. package/src/resources/networking/firewall-rules.ts +149 -0
  228. package/src/resources/networking/index.ts +12 -0
  229. package/src/resources/networking/networking.ts +41 -0
  230. package/src/resources/networking/vpcs.ts +96 -0
  231. package/src/resources/operations.ts +41 -0
  232. package/src/resources/shared.ts +22 -0
  233. package/src/shims/node.ts +50 -0
  234. package/src/shims/web.ts +50 -0
  235. package/src/tsconfig.json +11 -0
  236. package/src/uploads.ts +255 -0
  237. package/src/version.ts +1 -0
  238. package/uploads.d.ts +75 -0
  239. package/uploads.d.ts.map +1 -0
  240. package/uploads.js +171 -0
  241. package/uploads.js.map +1 -0
  242. package/uploads.mjs +158 -0
  243. package/uploads.mjs.map +1 -0
  244. package/version.d.ts +2 -0
  245. package/version.d.ts.map +1 -0
  246. package/version.js +5 -0
  247. package/version.js.map +1 -0
  248. package/version.mjs +2 -0
  249. package/version.mjs.map +1 -0
@@ -0,0 +1,120 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../resource';
4
+ import * as Core from '../../core';
5
+ import * as OperationsAPI from '../operations';
6
+
7
+ export class Volumes extends APIResource {
8
+ /**
9
+ * Create a Volume. Only data volumes can be created.
10
+ */
11
+ create(body: VolumeCreateParams, options?: Core.RequestOptions): Core.APIPromise<OperationsAPI.Operation> {
12
+ return this._client.post('/compute/volumes', { body, ...options });
13
+ }
14
+
15
+ /**
16
+ * Update a Volume. Boot or data volumes can be updated.
17
+ */
18
+ update(
19
+ volumeId: string,
20
+ body: VolumeUpdateParams,
21
+ options?: Core.RequestOptions,
22
+ ): Core.APIPromise<OperationsAPI.Operation> {
23
+ return this._client.patch(`/compute/volumes/${volumeId}`, { body, ...options });
24
+ }
25
+
26
+ /**
27
+ * List all volumes
28
+ */
29
+ list(options?: Core.RequestOptions): Core.APIPromise<VolumeListResponse> {
30
+ return this._client.get('/compute/volumes', options);
31
+ }
32
+
33
+ /**
34
+ * Delete a Volume. Boot or data volumes can be deleted.
35
+ */
36
+ delete(
37
+ volumeId: string,
38
+ body: VolumeDeleteParams,
39
+ options?: Core.RequestOptions,
40
+ ): Core.APIPromise<OperationsAPI.Operation> {
41
+ return this._client.delete(`/compute/volumes/${volumeId}`, { body, ...options });
42
+ }
43
+
44
+ /**
45
+ * Get a Volume.
46
+ */
47
+ get(volumeId: string, options?: Core.RequestOptions): Core.APIPromise<Volume> {
48
+ return this._client.get(`/compute/volumes/${volumeId}`, options);
49
+ }
50
+ }
51
+
52
+ /**
53
+ * Storage type.
54
+ */
55
+ export type StorageType = 'nvme';
56
+
57
+ /**
58
+ * Volume details.
59
+ */
60
+ export interface Volume {
61
+ id: string;
62
+
63
+ created_at: string;
64
+
65
+ /**
66
+ * Volume kind.
67
+ */
68
+ kind: VolumeKind;
69
+
70
+ size: number;
71
+
72
+ /**
73
+ * Storage type.
74
+ */
75
+ type: StorageType;
76
+
77
+ updated_at: string;
78
+ }
79
+
80
+ /**
81
+ * Volume kind.
82
+ */
83
+ export type VolumeKind = 'boot' | 'data';
84
+
85
+ export interface VolumeListResponse {
86
+ items: Array<Volume>;
87
+ }
88
+
89
+ export interface VolumeCreateParams {
90
+ size: number;
91
+
92
+ vm_id: string;
93
+
94
+ /**
95
+ * Storage type.
96
+ */
97
+ type?: StorageType;
98
+ }
99
+
100
+ export interface VolumeUpdateParams {
101
+ size: number;
102
+
103
+ vm_id: string;
104
+ }
105
+
106
+ export interface VolumeDeleteParams {
107
+ vm_id: string;
108
+ }
109
+
110
+ export declare namespace Volumes {
111
+ export {
112
+ type StorageType as StorageType,
113
+ type Volume as Volume,
114
+ type VolumeKind as VolumeKind,
115
+ type VolumeListResponse as VolumeListResponse,
116
+ type VolumeCreateParams as VolumeCreateParams,
117
+ type VolumeUpdateParams as VolumeUpdateParams,
118
+ type VolumeDeleteParams as VolumeDeleteParams,
119
+ };
120
+ }
@@ -0,0 +1,6 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './shared';
4
+ export { Compute } from './compute/compute';
5
+ export { Networking } from './networking/networking';
6
+ export { Operations } from './operations';
@@ -0,0 +1,149 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../resource';
4
+ import * as Core from '../../core';
5
+ import * as OperationsAPI from '../operations';
6
+ import * as Shared from '../shared';
7
+
8
+ export class FirewallRules extends APIResource {
9
+ /**
10
+ * Create a firewall rule
11
+ */
12
+ create(
13
+ vpcId: string,
14
+ body: FirewallRuleCreateParams,
15
+ options?: Core.RequestOptions,
16
+ ): Core.APIPromise<OperationsAPI.Operation> {
17
+ return this._client.post(`/networking/vpcs/${vpcId}/firewall_rules`, { body, ...options });
18
+ }
19
+
20
+ /**
21
+ * Update a firewall rule
22
+ */
23
+ update(
24
+ vpcId: string,
25
+ firewallRuleId: string,
26
+ body: FirewallRuleUpdateParams,
27
+ options?: Core.RequestOptions,
28
+ ): Core.APIPromise<OperationsAPI.Operation> {
29
+ return this._client.patch(`/networking/vpcs/${vpcId}/firewall_rules/${firewallRuleId}`, {
30
+ body,
31
+ ...options,
32
+ });
33
+ }
34
+
35
+ /**
36
+ * List all firewall rules
37
+ */
38
+ list(vpcId: string, options?: Core.RequestOptions): Core.APIPromise<FirewallRuleList> {
39
+ return this._client.get(`/networking/vpcs/${vpcId}/firewall_rules`, options);
40
+ }
41
+
42
+ /**
43
+ * Delete a firewall rule
44
+ */
45
+ delete(
46
+ vpcId: string,
47
+ firewallRuleId: string,
48
+ options?: Core.RequestOptions,
49
+ ): Core.APIPromise<OperationsAPI.Operation> {
50
+ return this._client.delete(`/networking/vpcs/${vpcId}/firewall_rules/${firewallRuleId}`, options);
51
+ }
52
+
53
+ /**
54
+ * Get details about a firewall rule
55
+ */
56
+ get(vpcId: string, firewallRuleId: string, options?: Core.RequestOptions): Core.APIPromise<FirewallRule> {
57
+ return this._client.get(`/networking/vpcs/${vpcId}/firewall_rules/${firewallRuleId}`, options);
58
+ }
59
+ }
60
+
61
+ /**
62
+ * Firewall rule details.
63
+ */
64
+ export interface FirewallRule {
65
+ id: string;
66
+
67
+ created_at: string;
68
+
69
+ /**
70
+ * Firewall rule endpoint.
71
+ */
72
+ destination: FirewallRuleEndpoint;
73
+
74
+ name: string;
75
+
76
+ protocol: string;
77
+
78
+ /**
79
+ * Firewall rule endpoint.
80
+ */
81
+ source: FirewallRuleEndpoint;
82
+
83
+ status: Shared.ResourceStatus;
84
+
85
+ updated_at: string;
86
+
87
+ vpc_id: string;
88
+ }
89
+
90
+ /**
91
+ * Firewall rule endpoint.
92
+ */
93
+ export interface FirewallRuleEndpoint {
94
+ address?: string;
95
+
96
+ ports?: Array<string>;
97
+ }
98
+
99
+ export interface FirewallRuleList {
100
+ items: Array<FirewallRule>;
101
+ }
102
+
103
+ export interface FirewallRuleCreateParams {
104
+ /**
105
+ * Firewall rule endpoint.
106
+ */
107
+ destination: FirewallRuleEndpoint;
108
+
109
+ name: string;
110
+
111
+ /**
112
+ * Supported protocols.
113
+ */
114
+ protocol: string;
115
+
116
+ /**
117
+ * Firewall rule endpoint.
118
+ */
119
+ source: FirewallRuleEndpoint;
120
+ }
121
+
122
+ export interface FirewallRuleUpdateParams {
123
+ /**
124
+ * Firewall rule endpoint.
125
+ */
126
+ destination: FirewallRuleEndpoint;
127
+
128
+ name: string;
129
+
130
+ /**
131
+ * Supported protocols.
132
+ */
133
+ protocol: 'tcp' | 'udp';
134
+
135
+ /**
136
+ * Firewall rule endpoint.
137
+ */
138
+ source: FirewallRuleEndpoint;
139
+ }
140
+
141
+ export declare namespace FirewallRules {
142
+ export {
143
+ type FirewallRule as FirewallRule,
144
+ type FirewallRuleEndpoint as FirewallRuleEndpoint,
145
+ type FirewallRuleList as FirewallRuleList,
146
+ type FirewallRuleCreateParams as FirewallRuleCreateParams,
147
+ type FirewallRuleUpdateParams as FirewallRuleUpdateParams,
148
+ };
149
+ }
@@ -0,0 +1,12 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export {
4
+ FirewallRules,
5
+ type FirewallRule,
6
+ type FirewallRuleEndpoint,
7
+ type FirewallRuleList,
8
+ type FirewallRuleCreateParams,
9
+ type FirewallRuleUpdateParams,
10
+ } from './firewall-rules';
11
+ export { Networking } from './networking';
12
+ export { VPCs, type Subnet, type VPC, type VPCList, type VPCCreateParams } from './vpcs';
@@ -0,0 +1,41 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../resource';
4
+ import * as FirewallRulesAPI from './firewall-rules';
5
+ import {
6
+ FirewallRule,
7
+ FirewallRuleCreateParams,
8
+ FirewallRuleEndpoint,
9
+ FirewallRuleList,
10
+ FirewallRuleUpdateParams,
11
+ FirewallRules,
12
+ } from './firewall-rules';
13
+ import * as VPCsAPI from './vpcs';
14
+ import { Subnet, VPC, VPCCreateParams, VPCList, VPCs } from './vpcs';
15
+
16
+ export class Networking extends APIResource {
17
+ vpcs: VPCsAPI.VPCs = new VPCsAPI.VPCs(this._client);
18
+ firewallRules: FirewallRulesAPI.FirewallRules = new FirewallRulesAPI.FirewallRules(this._client);
19
+ }
20
+
21
+ Networking.VPCs = VPCs;
22
+ Networking.FirewallRules = FirewallRules;
23
+
24
+ export declare namespace Networking {
25
+ export {
26
+ VPCs as VPCs,
27
+ type Subnet as Subnet,
28
+ type VPC as VPC,
29
+ type VPCList as VPCList,
30
+ type VPCCreateParams as VPCCreateParams,
31
+ };
32
+
33
+ export {
34
+ FirewallRules as FirewallRules,
35
+ type FirewallRule as FirewallRule,
36
+ type FirewallRuleEndpoint as FirewallRuleEndpoint,
37
+ type FirewallRuleList as FirewallRuleList,
38
+ type FirewallRuleCreateParams as FirewallRuleCreateParams,
39
+ type FirewallRuleUpdateParams as FirewallRuleUpdateParams,
40
+ };
41
+ }
@@ -0,0 +1,96 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../resource';
4
+ import * as Core from '../../core';
5
+ import * as OperationsAPI from '../operations';
6
+ import * as Shared from '../shared';
7
+
8
+ export class VPCs extends APIResource {
9
+ /**
10
+ * Create a VPC
11
+ */
12
+ create(body: VPCCreateParams, options?: Core.RequestOptions): Core.APIPromise<OperationsAPI.Operation> {
13
+ return this._client.post('/networking/vpcs', { body, ...options });
14
+ }
15
+
16
+ /**
17
+ * List all VPCs
18
+ */
19
+ list(options?: Core.RequestOptions): Core.APIPromise<VPCList> {
20
+ return this._client.get('/networking/vpcs', options);
21
+ }
22
+
23
+ /**
24
+ * Delete a VPC
25
+ */
26
+ delete(vpcId: string, options?: Core.RequestOptions): Core.APIPromise<OperationsAPI.Operation> {
27
+ return this._client.delete(`/networking/vpcs/${vpcId}`, options);
28
+ }
29
+
30
+ /**
31
+ * Get details about a VPC
32
+ */
33
+ get(vpcId: string, options?: Core.RequestOptions): Core.APIPromise<VPC> {
34
+ return this._client.get(`/networking/vpcs/${vpcId}`, options);
35
+ }
36
+ }
37
+
38
+ /**
39
+ * Subnet details.
40
+ */
41
+ export interface Subnet {
42
+ id: string;
43
+
44
+ cidr: string;
45
+
46
+ created_at: string;
47
+
48
+ name: string;
49
+
50
+ updated_at: string;
51
+ }
52
+
53
+ /**
54
+ * VPC details.
55
+ */
56
+ export interface VPC {
57
+ id: string;
58
+
59
+ created_at: string;
60
+
61
+ firewall_rule_ids: Array<string>;
62
+
63
+ name: string;
64
+
65
+ region: Shared.RegionName;
66
+
67
+ status: Shared.ResourceStatus;
68
+
69
+ /**
70
+ * Subnet details.
71
+ */
72
+ subnet: Subnet;
73
+
74
+ updated_at: string;
75
+ }
76
+
77
+ export interface VPCList {
78
+ items: Array<VPC>;
79
+ }
80
+
81
+ export interface VPCCreateParams {
82
+ name: string;
83
+
84
+ region: Shared.RegionName;
85
+
86
+ subnet_name: string;
87
+ }
88
+
89
+ export declare namespace VPCs {
90
+ export {
91
+ type Subnet as Subnet,
92
+ type VPC as VPC,
93
+ type VPCList as VPCList,
94
+ type VPCCreateParams as VPCCreateParams,
95
+ };
96
+ }
@@ -0,0 +1,41 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../resource';
4
+ import * as Core from '../core';
5
+
6
+ export class Operations extends APIResource {
7
+ /**
8
+ * List all operations
9
+ */
10
+ list(options?: Core.RequestOptions): Core.APIPromise<OperationListResponse> {
11
+ return this._client.get('/operations', options);
12
+ }
13
+
14
+ /**
15
+ * Get details about a specific operation
16
+ */
17
+ get(operationId: string, options?: Core.RequestOptions): Core.APIPromise<Operation> {
18
+ return this._client.get(`/operations/${operationId}`, options);
19
+ }
20
+ }
21
+
22
+ /**
23
+ * Operation details.
24
+ */
25
+ export interface Operation {
26
+ id: string;
27
+
28
+ created_at: string;
29
+
30
+ kind: 'vm' | 'volume' | 'vpc' | 'firewall_rule';
31
+
32
+ resource_id: string;
33
+
34
+ status: 'pending' | 'running' | 'done' | 'failed' | 'unknown';
35
+
36
+ type: 'create' | 'update' | 'delete';
37
+
38
+ updated_at: string;
39
+ }
40
+
41
+ export type OperationListResponse = Array<Operation>;
@@ -0,0 +1,22 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export type RegionName =
4
+ | 'us-sea-1'
5
+ | 'us-sva-1'
6
+ | 'us-chi-1'
7
+ | 'us-wdc-1'
8
+ | 'eu-lon-1'
9
+ | 'eu-ams-1'
10
+ | 'eu-frk-1'
11
+ | 'ap-mum-1'
12
+ | 'ap-sin-1'
13
+ | 'ap-tyo-1';
14
+
15
+ export type ResourceStatus =
16
+ | 'pending'
17
+ | 'creating'
18
+ | 'updating'
19
+ | 'ready'
20
+ | 'deleting'
21
+ | 'deleted'
22
+ | 'failed';
@@ -0,0 +1,50 @@
1
+ // @ts-ignore
2
+ import * as types from '../_shims/node-types';
3
+ import { setShims } from '../_shims/registry';
4
+ import { getRuntime } from '../_shims/node-runtime';
5
+ setShims(getRuntime());
6
+
7
+ declare module '../_shims/manual-types' {
8
+ export namespace manual {
9
+ // @ts-ignore
10
+ export type Agent = types.Agent;
11
+ // @ts-ignore
12
+ export import fetch = types.fetch;
13
+ // @ts-ignore
14
+ export type Request = types.Request;
15
+ // @ts-ignore
16
+ export type RequestInfo = types.RequestInfo;
17
+ // @ts-ignore
18
+ export type RequestInit = types.RequestInit;
19
+ // @ts-ignore
20
+ export type Response = types.Response;
21
+ // @ts-ignore
22
+ export type ResponseInit = types.ResponseInit;
23
+ // @ts-ignore
24
+ export type ResponseType = types.ResponseType;
25
+ // @ts-ignore
26
+ export type BodyInit = types.BodyInit;
27
+ // @ts-ignore
28
+ export type Headers = types.Headers;
29
+ // @ts-ignore
30
+ export type HeadersInit = types.HeadersInit;
31
+ // @ts-ignore
32
+ export type BlobPropertyBag = types.BlobPropertyBag;
33
+ // @ts-ignore
34
+ export type FilePropertyBag = types.FilePropertyBag;
35
+ // @ts-ignore
36
+ export type FileFromPathOptions = types.FileFromPathOptions;
37
+ // @ts-ignore
38
+ export import FormData = types.FormData;
39
+ // @ts-ignore
40
+ export import File = types.File;
41
+ // @ts-ignore
42
+ export import Blob = types.Blob;
43
+ // @ts-ignore
44
+ export type Readable = types.Readable;
45
+ // @ts-ignore
46
+ export type FsReadStream = types.FsReadStream;
47
+ // @ts-ignore
48
+ export import ReadableStream = types.ReadableStream;
49
+ }
50
+ }
@@ -0,0 +1,50 @@
1
+ // @ts-ignore
2
+ import * as types from '../_shims/web-types';
3
+ import { setShims } from '../_shims/registry';
4
+ import { getRuntime } from '../_shims/web-runtime';
5
+ setShims(getRuntime({ manuallyImported: true }));
6
+
7
+ declare module '../_shims/manual-types' {
8
+ export namespace manual {
9
+ // @ts-ignore
10
+ export type Agent = types.Agent;
11
+ // @ts-ignore
12
+ export import fetch = types.fetch;
13
+ // @ts-ignore
14
+ export type Request = types.Request;
15
+ // @ts-ignore
16
+ export type RequestInfo = types.RequestInfo;
17
+ // @ts-ignore
18
+ export type RequestInit = types.RequestInit;
19
+ // @ts-ignore
20
+ export type Response = types.Response;
21
+ // @ts-ignore
22
+ export type ResponseInit = types.ResponseInit;
23
+ // @ts-ignore
24
+ export type ResponseType = types.ResponseType;
25
+ // @ts-ignore
26
+ export type BodyInit = types.BodyInit;
27
+ // @ts-ignore
28
+ export type Headers = types.Headers;
29
+ // @ts-ignore
30
+ export type HeadersInit = types.HeadersInit;
31
+ // @ts-ignore
32
+ export type BlobPropertyBag = types.BlobPropertyBag;
33
+ // @ts-ignore
34
+ export type FilePropertyBag = types.FilePropertyBag;
35
+ // @ts-ignore
36
+ export type FileFromPathOptions = types.FileFromPathOptions;
37
+ // @ts-ignore
38
+ export import FormData = types.FormData;
39
+ // @ts-ignore
40
+ export import File = types.File;
41
+ // @ts-ignore
42
+ export import Blob = types.Blob;
43
+ // @ts-ignore
44
+ export type Readable = types.Readable;
45
+ // @ts-ignore
46
+ export type FsReadStream = types.FsReadStream;
47
+ // @ts-ignore
48
+ export import ReadableStream = types.ReadableStream;
49
+ }
50
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ // this config is included in the published src directory to prevent TS errors
3
+ // from appearing when users go to source, and VSCode opens the source .ts file
4
+ // via declaration maps
5
+ "include": ["index.ts"],
6
+ "compilerOptions": {
7
+ "target": "es2015",
8
+ "lib": ["DOM"],
9
+ "moduleResolution": "node"
10
+ }
11
+ }