@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.
- package/CHANGELOG.md +100 -0
- package/LICENSE +201 -0
- package/README.md +371 -0
- package/_shims/MultipartBody.d.ts +9 -0
- package/_shims/MultipartBody.d.ts.map +1 -0
- package/_shims/MultipartBody.js +16 -0
- package/_shims/MultipartBody.js.map +1 -0
- package/_shims/MultipartBody.mjs +12 -0
- package/_shims/MultipartBody.mjs.map +1 -0
- package/_shims/README.md +46 -0
- package/_shims/auto/runtime-bun.d.ts +5 -0
- package/_shims/auto/runtime-bun.d.ts.map +1 -0
- package/_shims/auto/runtime-bun.js +21 -0
- package/_shims/auto/runtime-bun.js.map +1 -0
- package/_shims/auto/runtime-bun.mjs +2 -0
- package/_shims/auto/runtime-bun.mjs.map +1 -0
- package/_shims/auto/runtime-node.d.ts +5 -0
- package/_shims/auto/runtime-node.d.ts.map +1 -0
- package/_shims/auto/runtime-node.js +21 -0
- package/_shims/auto/runtime-node.js.map +1 -0
- package/_shims/auto/runtime-node.mjs +2 -0
- package/_shims/auto/runtime-node.mjs.map +1 -0
- package/_shims/auto/runtime.d.ts +5 -0
- package/_shims/auto/runtime.d.ts.map +1 -0
- package/_shims/auto/runtime.js +21 -0
- package/_shims/auto/runtime.js.map +1 -0
- package/_shims/auto/runtime.mjs +2 -0
- package/_shims/auto/runtime.mjs.map +1 -0
- package/_shims/auto/types-node.d.ts +5 -0
- package/_shims/auto/types-node.d.ts.map +1 -0
- package/_shims/auto/types-node.js +21 -0
- package/_shims/auto/types-node.js.map +1 -0
- package/_shims/auto/types-node.mjs +2 -0
- package/_shims/auto/types-node.mjs.map +1 -0
- package/_shims/auto/types.d.ts +101 -0
- package/_shims/auto/types.js +3 -0
- package/_shims/auto/types.mjs +3 -0
- package/_shims/bun-runtime.d.ts +6 -0
- package/_shims/bun-runtime.d.ts.map +1 -0
- package/_shims/bun-runtime.js +14 -0
- package/_shims/bun-runtime.js.map +1 -0
- package/_shims/bun-runtime.mjs +10 -0
- package/_shims/bun-runtime.mjs.map +1 -0
- package/_shims/index.d.ts +81 -0
- package/_shims/index.js +13 -0
- package/_shims/index.mjs +7 -0
- package/_shims/manual-types.d.ts +12 -0
- package/_shims/manual-types.js +3 -0
- package/_shims/manual-types.mjs +3 -0
- package/_shims/node-runtime.d.ts +3 -0
- package/_shims/node-runtime.d.ts.map +1 -0
- package/_shims/node-runtime.js +89 -0
- package/_shims/node-runtime.js.map +1 -0
- package/_shims/node-runtime.mjs +56 -0
- package/_shims/node-runtime.mjs.map +1 -0
- package/_shims/node-types.d.ts +42 -0
- package/_shims/node-types.js +3 -0
- package/_shims/node-types.mjs +3 -0
- package/_shims/registry.d.ts +37 -0
- package/_shims/registry.d.ts.map +1 -0
- package/_shims/registry.js +41 -0
- package/_shims/registry.js.map +1 -0
- package/_shims/registry.mjs +37 -0
- package/_shims/registry.mjs.map +1 -0
- package/_shims/web-runtime.d.ts +5 -0
- package/_shims/web-runtime.d.ts.map +1 -0
- package/_shims/web-runtime.js +78 -0
- package/_shims/web-runtime.js.map +1 -0
- package/_shims/web-runtime.mjs +71 -0
- package/_shims/web-runtime.mjs.map +1 -0
- package/_shims/web-types.d.ts +83 -0
- package/_shims/web-types.js +3 -0
- package/_shims/web-types.mjs +3 -0
- package/core.d.ts +241 -0
- package/core.d.ts.map +1 -0
- package/core.js +908 -0
- package/core.js.map +1 -0
- package/core.mjs +876 -0
- package/core.mjs.map +1 -0
- package/error.d.ts +47 -0
- package/error.d.ts.map +1 -0
- package/error.js +113 -0
- package/error.js.map +1 -0
- package/error.mjs +97 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +118 -0
- package/index.d.ts +118 -0
- package/index.d.ts.map +1 -0
- package/index.js +128 -0
- package/index.js.map +1 -0
- package/index.mjs +85 -0
- package/index.mjs.map +1 -0
- package/package.json +103 -0
- package/resource.d.ts +6 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +11 -0
- package/resource.js.map +1 -0
- package/resource.mjs +7 -0
- package/resource.mjs.map +1 -0
- package/resources/compute/compute.d.ts +14 -0
- package/resources/compute/compute.d.ts.map +1 -0
- package/resources/compute/compute.js +43 -0
- package/resources/compute/compute.js.map +1 -0
- package/resources/compute/compute.mjs +16 -0
- package/resources/compute/compute.mjs.map +1 -0
- package/resources/compute/index.d.ts +4 -0
- package/resources/compute/index.d.ts.map +1 -0
- package/resources/compute/index.js +11 -0
- package/resources/compute/index.js.map +1 -0
- package/resources/compute/index.mjs +5 -0
- package/resources/compute/index.mjs.map +1 -0
- package/resources/compute/vms/index.d.ts +3 -0
- package/resources/compute/vms/index.d.ts.map +1 -0
- package/resources/compute/vms/index.js +9 -0
- package/resources/compute/vms/index.js.map +1 -0
- package/resources/compute/vms/index.mjs +4 -0
- package/resources/compute/vms/index.mjs.map +1 -0
- package/resources/compute/vms/os-images.d.ts +14 -0
- package/resources/compute/vms/os-images.d.ts.map +1 -0
- package/resources/compute/vms/os-images.js +15 -0
- package/resources/compute/vms/os-images.js.map +1 -0
- package/resources/compute/vms/os-images.mjs +11 -0
- package/resources/compute/vms/os-images.mjs.map +1 -0
- package/resources/compute/vms/vms.d.ts +164 -0
- package/resources/compute/vms/vms.d.ts.map +1 -0
- package/resources/compute/vms/vms.js +69 -0
- package/resources/compute/vms/vms.js.map +1 -0
- package/resources/compute/vms/vms.mjs +42 -0
- package/resources/compute/vms/vms.mjs.map +1 -0
- package/resources/compute/volumes.d.ts +72 -0
- package/resources/compute/volumes.d.ts.map +1 -0
- package/resources/compute/volumes.js +39 -0
- package/resources/compute/volumes.js.map +1 -0
- package/resources/compute/volumes.mjs +35 -0
- package/resources/compute/volumes.mjs.map +1 -0
- package/resources/index.d.ts +5 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +26 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +6 -0
- package/resources/index.mjs.map +1 -0
- package/resources/networking/firewall-rules.d.ts +90 -0
- package/resources/networking/firewall-rules.d.ts.map +1 -0
- package/resources/networking/firewall-rules.js +42 -0
- package/resources/networking/firewall-rules.js.map +1 -0
- package/resources/networking/firewall-rules.mjs +38 -0
- package/resources/networking/firewall-rules.mjs.map +1 -0
- package/resources/networking/index.d.ts +4 -0
- package/resources/networking/index.d.ts.map +1 -0
- package/resources/networking/index.js +11 -0
- package/resources/networking/index.js.map +1 -0
- package/resources/networking/index.mjs +5 -0
- package/resources/networking/index.mjs.map +1 -0
- package/resources/networking/networking.d.ts +14 -0
- package/resources/networking/networking.d.ts.map +1 -0
- package/resources/networking/networking.js +43 -0
- package/resources/networking/networking.js.map +1 -0
- package/resources/networking/networking.mjs +16 -0
- package/resources/networking/networking.mjs.map +1 -0
- package/resources/networking/vpcs.d.ts +60 -0
- package/resources/networking/vpcs.d.ts.map +1 -0
- package/resources/networking/vpcs.js +33 -0
- package/resources/networking/vpcs.js.map +1 -0
- package/resources/networking/vpcs.mjs +29 -0
- package/resources/networking/vpcs.mjs.map +1 -0
- package/resources/operations.d.ts +26 -0
- package/resources/operations.d.ts.map +1 -0
- package/resources/operations.js +21 -0
- package/resources/operations.js.map +1 -0
- package/resources/operations.mjs +17 -0
- package/resources/operations.mjs.map +1 -0
- package/resources/shared.d.ts +3 -0
- package/resources/shared.d.ts.map +1 -0
- package/resources/shared.js +4 -0
- package/resources/shared.js.map +1 -0
- package/resources/shared.mjs +3 -0
- package/resources/shared.mjs.map +1 -0
- package/shims/node.d.ts +30 -0
- package/shims/node.d.ts.map +1 -0
- package/shims/node.js +31 -0
- package/shims/node.js.map +1 -0
- package/shims/node.mjs +5 -0
- package/shims/node.mjs.map +1 -0
- package/shims/web.d.ts +26 -0
- package/shims/web.d.ts.map +1 -0
- package/shims/web.js +31 -0
- package/shims/web.js.map +1 -0
- package/shims/web.mjs +5 -0
- package/shims/web.mjs.map +1 -0
- package/src/_shims/MultipartBody.ts +9 -0
- package/src/_shims/README.md +46 -0
- package/src/_shims/auto/runtime-bun.ts +4 -0
- package/src/_shims/auto/runtime-node.ts +4 -0
- package/src/_shims/auto/runtime.ts +4 -0
- package/src/_shims/auto/types-node.ts +4 -0
- package/src/_shims/auto/types.d.ts +101 -0
- package/src/_shims/auto/types.js +3 -0
- package/src/_shims/auto/types.mjs +3 -0
- package/src/_shims/bun-runtime.ts +14 -0
- package/src/_shims/index.d.ts +81 -0
- package/src/_shims/index.js +13 -0
- package/src/_shims/index.mjs +7 -0
- package/src/_shims/manual-types.d.ts +12 -0
- package/src/_shims/manual-types.js +3 -0
- package/src/_shims/manual-types.mjs +3 -0
- package/src/_shims/node-runtime.ts +81 -0
- package/src/_shims/node-types.d.ts +42 -0
- package/src/_shims/node-types.js +3 -0
- package/src/_shims/node-types.mjs +3 -0
- package/src/_shims/registry.ts +67 -0
- package/src/_shims/web-runtime.ts +103 -0
- package/src/_shims/web-types.d.ts +83 -0
- package/src/_shims/web-types.js +3 -0
- package/src/_shims/web-types.mjs +3 -0
- package/src/core.ts +1201 -0
- package/src/error.ts +130 -0
- package/src/index.ts +198 -0
- package/src/lib/.keep +4 -0
- package/src/resource.ts +11 -0
- package/src/resources/compute/compute.ts +49 -0
- package/src/resources/compute/index.ts +24 -0
- package/src/resources/compute/vms/index.ts +14 -0
- package/src/resources/compute/vms/os-images.ts +20 -0
- package/src/resources/compute/vms/vms.ts +239 -0
- package/src/resources/compute/volumes.ts +120 -0
- package/src/resources/index.ts +6 -0
- package/src/resources/networking/firewall-rules.ts +149 -0
- package/src/resources/networking/index.ts +12 -0
- package/src/resources/networking/networking.ts +41 -0
- package/src/resources/networking/vpcs.ts +96 -0
- package/src/resources/operations.ts +41 -0
- package/src/resources/shared.ts +22 -0
- package/src/shims/node.ts +50 -0
- package/src/shims/web.ts +50 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +255 -0
- package/src/version.ts +1 -0
- package/uploads.d.ts +75 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +171 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +158 -0
- package/uploads.mjs.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- 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,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
|
+
}
|
package/src/shims/web.ts
ADDED
|
@@ -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
|
+
}
|