@nirvana-labs/nirvana 1.0.4 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/README.md +1 -1
- package/api-promise.js +2 -15
- package/api-promise.js.map +1 -1
- package/bin/cli +52 -0
- package/bin/migration-config.json +110 -0
- package/client.d.mts +4 -1
- package/client.d.mts.map +1 -1
- package/client.d.ts +4 -1
- package/client.d.ts.map +1 -1
- package/client.js +25 -42
- package/client.js.map +1 -1
- package/client.mjs +18 -12
- package/client.mjs.map +1 -1
- package/core/api-promise.d.mts +0 -1
- package/core/api-promise.d.mts.map +1 -1
- package/core/api-promise.d.ts +0 -1
- package/core/api-promise.d.ts.map +1 -1
- package/core/api-promise.js +4 -14
- package/core/api-promise.js.map +1 -1
- package/core/api-promise.mjs +1 -11
- package/core/api-promise.mjs.map +1 -1
- package/core/error.d.mts +0 -1
- package/core/error.d.mts.map +1 -1
- package/core/error.d.ts +0 -1
- package/core/error.d.ts.map +1 -1
- package/core/error.js.map +1 -1
- package/core/error.mjs.map +1 -1
- package/error.js +2 -15
- package/error.js.map +1 -1
- package/internal/builtin-types.d.mts +0 -2
- package/internal/builtin-types.d.mts.map +1 -1
- package/internal/builtin-types.d.ts +0 -2
- package/internal/builtin-types.d.ts.map +1 -1
- package/internal/detect-platform.js.map +1 -1
- package/internal/detect-platform.mjs.map +1 -1
- package/internal/errors.d.mts.map +1 -1
- package/internal/errors.d.ts.map +1 -1
- package/internal/errors.js +2 -2
- package/internal/errors.js.map +1 -1
- package/internal/errors.mjs.map +1 -1
- package/internal/headers.d.mts +0 -1
- package/internal/headers.d.mts.map +1 -1
- package/internal/headers.d.ts +0 -1
- package/internal/headers.d.ts.map +1 -1
- package/internal/headers.js.map +1 -1
- package/internal/headers.mjs.map +1 -1
- package/internal/parse.d.mts +0 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts +0 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +1 -2
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs.map +1 -1
- package/internal/request-options.d.mts +0 -1
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts +0 -1
- package/internal/request-options.d.ts.map +1 -1
- package/internal/shims.js +5 -6
- package/internal/shims.js.map +1 -1
- package/internal/shims.mjs.map +1 -1
- package/internal/to-file.d.mts +0 -1
- package/internal/to-file.d.mts.map +1 -1
- package/internal/to-file.d.ts +0 -1
- package/internal/to-file.d.ts.map +1 -1
- package/internal/to-file.js +4 -4
- package/internal/to-file.js.map +1 -1
- package/internal/to-file.mjs +3 -2
- package/internal/to-file.mjs.map +1 -1
- package/internal/tslib.js +81 -0
- package/internal/tslib.mjs +17 -0
- package/internal/types.d.mts +0 -1
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +0 -1
- package/internal/types.d.ts.map +1 -1
- package/internal/uploads.d.mts +1 -3
- package/internal/uploads.d.mts.map +1 -1
- package/internal/uploads.d.ts +1 -3
- package/internal/uploads.d.ts.map +1 -1
- package/internal/uploads.js +16 -6
- package/internal/uploads.js.map +1 -1
- package/internal/uploads.mjs +12 -3
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/base64.d.mts.map +1 -1
- package/internal/utils/base64.d.ts.map +1 -1
- package/internal/utils/base64.js.map +1 -1
- package/internal/utils/base64.mjs.map +1 -1
- package/internal/utils/bytes.d.mts +1 -1
- package/internal/utils/bytes.d.mts.map +1 -1
- package/internal/utils/bytes.d.ts +1 -1
- package/internal/utils/bytes.d.ts.map +1 -1
- package/internal/utils/bytes.js +3 -4
- package/internal/utils/bytes.js.map +1 -1
- package/internal/utils/bytes.mjs.map +1 -1
- package/internal/utils/env.d.mts.map +1 -1
- package/internal/utils/env.d.ts.map +1 -1
- package/internal/utils/env.js.map +1 -1
- package/internal/utils/env.mjs.map +1 -1
- package/internal/utils/log.d.mts +0 -1
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts +0 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js +2 -2
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/path.d.mts.map +1 -1
- package/internal/utils/path.d.ts.map +1 -1
- package/internal/utils/path.js +2 -2
- package/internal/utils/path.js.map +1 -1
- package/internal/utils/path.mjs.map +1 -1
- package/internal/utils/sleep.d.mts.map +1 -1
- package/internal/utils/sleep.d.ts.map +1 -1
- package/internal/utils/uuid.d.mts +1 -1
- package/internal/utils/uuid.d.mts.map +1 -1
- package/internal/utils/uuid.d.ts +1 -1
- package/internal/utils/uuid.d.ts.map +1 -1
- package/internal/utils/uuid.js +1 -2
- package/internal/utils/uuid.js.map +1 -1
- package/internal/utils/uuid.mjs +1 -2
- package/internal/utils/uuid.mjs.map +1 -1
- package/internal/utils/values.d.mts.map +1 -1
- package/internal/utils/values.d.ts.map +1 -1
- package/internal/utils/values.js +5 -5
- package/internal/utils/values.js.map +1 -1
- package/internal/utils/values.mjs.map +1 -1
- package/internal/utils.js +7 -20
- package/internal/utils.js.map +1 -1
- package/package.json +8 -6
- package/resource.js +2 -15
- package/resource.js.map +1 -1
- package/resources/api-keys.d.mts +28 -0
- package/resources/api-keys.d.mts.map +1 -1
- package/resources/api-keys.d.ts +28 -0
- package/resources/api-keys.d.ts.map +1 -1
- package/resources/api-keys.js +28 -0
- package/resources/api-keys.js.map +1 -1
- package/resources/api-keys.mjs +28 -0
- package/resources/api-keys.mjs.map +1 -1
- package/resources/compute/compute.js +3 -25
- package/resources/compute/compute.js.map +1 -1
- package/resources/compute/vms/os-images.d.mts +5 -0
- package/resources/compute/vms/os-images.d.mts.map +1 -1
- package/resources/compute/vms/os-images.d.ts +5 -0
- package/resources/compute/vms/os-images.d.ts.map +1 -1
- package/resources/compute/vms/os-images.js +5 -0
- package/resources/compute/vms/os-images.js.map +1 -1
- package/resources/compute/vms/os-images.mjs +5 -0
- package/resources/compute/vms/os-images.mjs.map +1 -1
- package/resources/compute/vms/vms.d.mts +38 -0
- package/resources/compute/vms/vms.d.mts.map +1 -1
- package/resources/compute/vms/vms.d.ts +38 -0
- package/resources/compute/vms/vms.d.ts.map +1 -1
- package/resources/compute/vms/vms.js +41 -25
- package/resources/compute/vms/vms.js.map +1 -1
- package/resources/compute/vms/vms.mjs +38 -0
- package/resources/compute/vms/vms.mjs.map +1 -1
- package/resources/compute/vms/volumes.d.mts +7 -0
- package/resources/compute/vms/volumes.d.mts.map +1 -1
- package/resources/compute/vms/volumes.d.ts +7 -0
- package/resources/compute/vms/volumes.d.ts.map +1 -1
- package/resources/compute/vms/volumes.js +7 -0
- package/resources/compute/vms/volumes.js.map +1 -1
- package/resources/compute/vms/volumes.mjs +7 -0
- package/resources/compute/vms/volumes.mjs.map +1 -1
- package/resources/compute/vms.js +2 -15
- package/resources/compute/vms.js.map +1 -1
- package/resources/compute/volumes.d.mts +35 -0
- package/resources/compute/volumes.d.mts.map +1 -1
- package/resources/compute/volumes.d.ts +35 -0
- package/resources/compute/volumes.d.ts.map +1 -1
- package/resources/compute/volumes.js +35 -0
- package/resources/compute/volumes.js.map +1 -1
- package/resources/compute/volumes.mjs +35 -0
- package/resources/compute/volumes.mjs.map +1 -1
- package/resources/compute.js +2 -15
- package/resources/compute.js.map +1 -1
- package/resources/index.js +2 -15
- package/resources/index.js.map +1 -1
- package/resources/networking/firewall-rules.d.mts +45 -0
- package/resources/networking/firewall-rules.d.mts.map +1 -1
- package/resources/networking/firewall-rules.d.ts +45 -0
- package/resources/networking/firewall-rules.d.ts.map +1 -1
- package/resources/networking/firewall-rules.js +45 -0
- package/resources/networking/firewall-rules.js.map +1 -1
- package/resources/networking/firewall-rules.mjs +45 -0
- package/resources/networking/firewall-rules.mjs.map +1 -1
- package/resources/networking/networking.js +3 -25
- package/resources/networking/networking.js.map +1 -1
- package/resources/networking/vpcs.d.mts +33 -0
- package/resources/networking/vpcs.d.mts.map +1 -1
- package/resources/networking/vpcs.d.ts +33 -0
- package/resources/networking/vpcs.d.ts.map +1 -1
- package/resources/networking/vpcs.js +33 -0
- package/resources/networking/vpcs.js.map +1 -1
- package/resources/networking/vpcs.mjs +33 -0
- package/resources/networking/vpcs.mjs.map +1 -1
- package/resources/networking.js +2 -15
- package/resources/networking.js.map +1 -1
- package/resources.js +2 -15
- package/resources.js.map +1 -1
- package/src/client.ts +17 -0
- package/src/internal/to-file.ts +4 -2
- package/src/internal/uploads.ts +16 -4
- package/src/internal/utils/uuid.ts +1 -3
- package/src/resources/api-keys.ts +28 -0
- package/src/resources/compute/vms/os-images.ts +5 -0
- package/src/resources/compute/vms/vms.ts +38 -0
- package/src/resources/compute/vms/volumes.ts +7 -0
- package/src/resources/compute/volumes.ts +35 -0
- package/src/resources/networking/firewall-rules.ts +45 -0
- package/src/resources/networking/vpcs.ts +33 -0
- package/src/version.ts +1 -1
- package/uploads.js +2 -15
- package/uploads.js.map +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/internal/shims/crypto.d.mts +0 -13
- package/internal/shims/crypto.d.mts.map +0 -1
- package/internal/shims/crypto.d.ts +0 -13
- package/internal/shims/crypto.d.ts.map +0 -1
- package/internal/shims/crypto.js +0 -13
- package/internal/shims/crypto.js.map +0 -1
- package/internal/shims/crypto.mjs +0 -9
- package/internal/shims/crypto.mjs.map +0 -1
- package/internal/shims/file.d.mts +0 -23
- package/internal/shims/file.d.mts.map +0 -1
- package/internal/shims/file.d.ts +0 -23
- package/internal/shims/file.d.ts.map +0 -1
- package/internal/shims/file.js +0 -16
- package/internal/shims/file.js.map +0 -1
- package/internal/shims/file.mjs +0 -12
- package/internal/shims/file.mjs.map +0 -1
- package/internal/shims/getBuiltinModule.d.mts +0 -11
- package/internal/shims/getBuiltinModule.d.mts.map +0 -1
- package/internal/shims/getBuiltinModule.d.ts +0 -11
- package/internal/shims/getBuiltinModule.d.ts.map +0 -1
- package/internal/shims/getBuiltinModule.js +0 -71
- package/internal/shims/getBuiltinModule.js.map +0 -1
- package/internal/shims/getBuiltinModule.mjs +0 -67
- package/internal/shims/getBuiltinModule.mjs.map +0 -1
- package/internal/shims/nullGetBuiltinModule.d.mts +0 -2
- package/internal/shims/nullGetBuiltinModule.d.mts.map +0 -1
- package/internal/shims/nullGetBuiltinModule.d.ts +0 -2
- package/internal/shims/nullGetBuiltinModule.d.ts.map +0 -1
- package/internal/shims/nullGetBuiltinModule.js +0 -5
- package/internal/shims/nullGetBuiltinModule.js.map +0 -1
- package/internal/shims/nullGetBuiltinModule.mjs +0 -2
- package/internal/shims/nullGetBuiltinModule.mjs.map +0 -1
- package/src/internal/shims/crypto.ts +0 -18
- package/src/internal/shims/file.ts +0 -32
- package/src/internal/shims/getBuiltinModule.ts +0 -66
- package/src/internal/shims/nullGetBuiltinModule.ts +0 -1
|
@@ -4,12 +4,33 @@ import { path } from "../../internal/utils/path.mjs";
|
|
|
4
4
|
export class FirewallRules extends APIResource {
|
|
5
5
|
/**
|
|
6
6
|
* Create a firewall rule
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const operation =
|
|
11
|
+
* await client.networking.firewallRules.create('vpc_id', {
|
|
12
|
+
* destination_address: '0.0.0.0/0',
|
|
13
|
+
* destination_ports: ['22', '80', '443'],
|
|
14
|
+
* name: 'my-firewall-rule',
|
|
15
|
+
* protocol: 'tcp',
|
|
16
|
+
* source_address: '0.0.0.0/0',
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
7
19
|
*/
|
|
8
20
|
create(vpcID, body, options) {
|
|
9
21
|
return this._client.post(path `/v1/networking/vpcs/${vpcID}/firewall_rules`, { body, ...options });
|
|
10
22
|
}
|
|
11
23
|
/**
|
|
12
24
|
* Update a firewall rule
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const operation =
|
|
29
|
+
* await client.networking.firewallRules.update(
|
|
30
|
+
* 'firewall_rule_id',
|
|
31
|
+
* { vpc_id: 'vpc_id' },
|
|
32
|
+
* );
|
|
33
|
+
* ```
|
|
13
34
|
*/
|
|
14
35
|
update(firewallRuleID, params, options) {
|
|
15
36
|
const { vpc_id, ...body } = params;
|
|
@@ -20,12 +41,27 @@ export class FirewallRules extends APIResource {
|
|
|
20
41
|
}
|
|
21
42
|
/**
|
|
22
43
|
* List all firewall rules
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const firewallRuleList =
|
|
48
|
+
* await client.networking.firewallRules.list('vpc_id');
|
|
49
|
+
* ```
|
|
23
50
|
*/
|
|
24
51
|
list(vpcID, options) {
|
|
25
52
|
return this._client.get(path `/v1/networking/vpcs/${vpcID}/firewall_rules`, options);
|
|
26
53
|
}
|
|
27
54
|
/**
|
|
28
55
|
* Delete a firewall rule
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* const operation =
|
|
60
|
+
* await client.networking.firewallRules.delete(
|
|
61
|
+
* 'firewall_rule_id',
|
|
62
|
+
* { vpc_id: 'vpc_id' },
|
|
63
|
+
* );
|
|
64
|
+
* ```
|
|
29
65
|
*/
|
|
30
66
|
delete(firewallRuleID, params, options) {
|
|
31
67
|
const { vpc_id } = params;
|
|
@@ -33,6 +69,15 @@ export class FirewallRules extends APIResource {
|
|
|
33
69
|
}
|
|
34
70
|
/**
|
|
35
71
|
* Get details about a firewall rule
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* const firewallRule =
|
|
76
|
+
* await client.networking.firewallRules.get(
|
|
77
|
+
* 'firewall_rule_id',
|
|
78
|
+
* { vpc_id: 'vpc_id' },
|
|
79
|
+
* );
|
|
80
|
+
* ```
|
|
36
81
|
*/
|
|
37
82
|
get(firewallRuleID, params, options) {
|
|
38
83
|
const { vpc_id } = params;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"firewall-rules.mjs","sourceRoot":"","sources":["../../src/resources/networking/firewall-rules.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAKf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,aAAc,SAAQ,WAAW;IAC5C
|
|
1
|
+
{"version":3,"file":"firewall-rules.mjs","sourceRoot":"","sources":["../../src/resources/networking/firewall-rules.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAKf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,aAAc,SAAQ,WAAW;IAC5C;;;;;;;;;;;;;;OAcG;IACH,MAAM,CACJ,KAAa,EACb,IAA8B,EAC9B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,uBAAuB,KAAK,iBAAiB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpG,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,cAAsB,EACtB,MAAgC,EAChC,OAAwB;QAExB,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACnC,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA,uBAAuB,MAAM,mBAAmB,cAAc,EAAE,EAAE;YAC9F,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI,CAAC,KAAa,EAAE,OAAwB;QAC1C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,uBAAuB,KAAK,iBAAiB,EAAE,OAAO,CAAC,CAAC;IACtF,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,cAAsB,EACtB,MAAgC,EAChC,OAAwB;QAExB,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;QAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,uBAAuB,MAAM,mBAAmB,cAAc,EAAE,EAAE,OAAO,CAAC,CAAC;IAC5G,CAAC;IAED;;;;;;;;;;;OAWG;IACH,GAAG,CACD,cAAsB,EACtB,MAA6B,EAC7B,OAAwB;QAExB,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;QAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,uBAAuB,MAAM,mBAAmB,cAAc,EAAE,EAAE,OAAO,CAAC,CAAC;IACzG,CAAC;CACF"}
|
|
@@ -1,34 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
-
if (k2 === undefined) k2 = k;
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
-
if (mod && mod.__esModule) return mod;
|
|
21
|
-
var result = {};
|
|
22
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
-
__setModuleDefault(result, mod);
|
|
24
|
-
return result;
|
|
25
|
-
};
|
|
26
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
4
|
exports.Networking = void 0;
|
|
5
|
+
const tslib_1 = require("../../internal/tslib.js");
|
|
28
6
|
const resource_1 = require("../../core/resource.js");
|
|
29
|
-
const FirewallRulesAPI = __importStar(require("./firewall-rules.js"));
|
|
7
|
+
const FirewallRulesAPI = tslib_1.__importStar(require("./firewall-rules.js"));
|
|
30
8
|
const firewall_rules_1 = require("./firewall-rules.js");
|
|
31
|
-
const VPCsAPI = __importStar(require("./vpcs.js"));
|
|
9
|
+
const VPCsAPI = tslib_1.__importStar(require("./vpcs.js"));
|
|
32
10
|
const vpcs_1 = require("./vpcs.js");
|
|
33
11
|
class Networking extends resource_1.APIResource {
|
|
34
12
|
constructor() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"networking.js","sourceRoot":"","sources":["../../src/resources/networking/networking.ts"],"names":[],"mappings":";AAAA,sFAAsF
|
|
1
|
+
{"version":3,"file":"networking.js","sourceRoot":"","sources":["../../src/resources/networking/networking.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,8EAAqD;AACrD,wDAQ0B;AAC1B,2DAAkC;AAClC,oCAAsF;AAEtF,MAAa,UAAW,SAAQ,sBAAW;IAA3C;;QACE,SAAI,GAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpD,kBAAa,GAAmC,IAAI,gBAAgB,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACnG,CAAC;CAAA;AAHD,gCAGC;AAED,UAAU,CAAC,IAAI,GAAG,WAAI,CAAC;AACvB,UAAU,CAAC,aAAa,GAAG,8BAAa,CAAC"}
|
|
@@ -6,22 +6,55 @@ import { RequestOptions } from "../../internal/request-options.mjs";
|
|
|
6
6
|
export declare class VPCs extends APIResource {
|
|
7
7
|
/**
|
|
8
8
|
* Create a VPC
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const operation = await client.networking.vpcs.create({
|
|
13
|
+
* name: 'my-vpc',
|
|
14
|
+
* region: 'us-wdc-1',
|
|
15
|
+
* subnet_name: 'my-subnet',
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
9
18
|
*/
|
|
10
19
|
create(body: VPCCreateParams, options?: RequestOptions): APIPromise<OperationsAPI.Operation>;
|
|
11
20
|
/**
|
|
12
21
|
* Update a VPC
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* const operation = await client.networking.vpcs.update(
|
|
26
|
+
* 'vpc_id',
|
|
27
|
+
* );
|
|
28
|
+
* ```
|
|
13
29
|
*/
|
|
14
30
|
update(vpcID: string, body: VPCUpdateParams, options?: RequestOptions): APIPromise<OperationsAPI.Operation>;
|
|
15
31
|
/**
|
|
16
32
|
* List all VPCs
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* const vpcList = await client.networking.vpcs.list();
|
|
37
|
+
* ```
|
|
17
38
|
*/
|
|
18
39
|
list(options?: RequestOptions): APIPromise<VPCList>;
|
|
19
40
|
/**
|
|
20
41
|
* Delete a VPC
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* const operation = await client.networking.vpcs.delete(
|
|
46
|
+
* 'vpc_id',
|
|
47
|
+
* );
|
|
48
|
+
* ```
|
|
21
49
|
*/
|
|
22
50
|
delete(vpcID: string, options?: RequestOptions): APIPromise<OperationsAPI.Operation>;
|
|
23
51
|
/**
|
|
24
52
|
* Get details about a VPC
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* const vpc = await client.networking.vpcs.get('vpc_id');
|
|
57
|
+
* ```
|
|
25
58
|
*/
|
|
26
59
|
get(vpcID: string, options?: RequestOptions): APIPromise<VPC>;
|
|
27
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vpcs.d.mts","sourceRoot":"","sources":["../../src/resources/networking/vpcs.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,aAAa;OAClB,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,IAAK,SAAQ,WAAW;IACnC
|
|
1
|
+
{"version":3,"file":"vpcs.d.mts","sourceRoot":"","sources":["../../src/resources/networking/vpcs.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,aAAa;OAClB,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,IAAK,SAAQ,WAAW;IACnC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC,SAAS,CAAC;IAI5F;;;;;;;;;OASG;IACH,MAAM,CACJ,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,eAAe,EACrB,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,aAAa,CAAC,SAAS,CAAC;IAItC;;;;;;;OAOG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAInD;;;;;;;;;OASG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC,SAAS,CAAC;IAIpF;;;;;;;OAOG;IACH,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,GAAG,CAAC;CAG9D;AAED;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,GAAG;IAClB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,iBAAiB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAEjC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,UAAU,CAAC;IAE1B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC;IAE9B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,UAAU,CAAC;IAE1B;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EACL,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,GAAG,IAAI,GAAG,EACf,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,eAAe,IAAI,eAAe,GACxC,CAAC;CACH"}
|
|
@@ -6,22 +6,55 @@ import { RequestOptions } from "../../internal/request-options.js";
|
|
|
6
6
|
export declare class VPCs extends APIResource {
|
|
7
7
|
/**
|
|
8
8
|
* Create a VPC
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const operation = await client.networking.vpcs.create({
|
|
13
|
+
* name: 'my-vpc',
|
|
14
|
+
* region: 'us-wdc-1',
|
|
15
|
+
* subnet_name: 'my-subnet',
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
9
18
|
*/
|
|
10
19
|
create(body: VPCCreateParams, options?: RequestOptions): APIPromise<OperationsAPI.Operation>;
|
|
11
20
|
/**
|
|
12
21
|
* Update a VPC
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* const operation = await client.networking.vpcs.update(
|
|
26
|
+
* 'vpc_id',
|
|
27
|
+
* );
|
|
28
|
+
* ```
|
|
13
29
|
*/
|
|
14
30
|
update(vpcID: string, body: VPCUpdateParams, options?: RequestOptions): APIPromise<OperationsAPI.Operation>;
|
|
15
31
|
/**
|
|
16
32
|
* List all VPCs
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* const vpcList = await client.networking.vpcs.list();
|
|
37
|
+
* ```
|
|
17
38
|
*/
|
|
18
39
|
list(options?: RequestOptions): APIPromise<VPCList>;
|
|
19
40
|
/**
|
|
20
41
|
* Delete a VPC
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* const operation = await client.networking.vpcs.delete(
|
|
46
|
+
* 'vpc_id',
|
|
47
|
+
* );
|
|
48
|
+
* ```
|
|
21
49
|
*/
|
|
22
50
|
delete(vpcID: string, options?: RequestOptions): APIPromise<OperationsAPI.Operation>;
|
|
23
51
|
/**
|
|
24
52
|
* Get details about a VPC
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* const vpc = await client.networking.vpcs.get('vpc_id');
|
|
57
|
+
* ```
|
|
25
58
|
*/
|
|
26
59
|
get(vpcID: string, options?: RequestOptions): APIPromise<VPC>;
|
|
27
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vpcs.d.ts","sourceRoot":"","sources":["../../src/resources/networking/vpcs.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,aAAa;OAClB,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,IAAK,SAAQ,WAAW;IACnC
|
|
1
|
+
{"version":3,"file":"vpcs.d.ts","sourceRoot":"","sources":["../../src/resources/networking/vpcs.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,aAAa;OAClB,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,IAAK,SAAQ,WAAW;IACnC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC,SAAS,CAAC;IAI5F;;;;;;;;;OASG;IACH,MAAM,CACJ,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,eAAe,EACrB,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,aAAa,CAAC,SAAS,CAAC;IAItC;;;;;;;OAOG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAInD;;;;;;;;;OASG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC,SAAS,CAAC;IAIpF;;;;;;;OAOG;IACH,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,GAAG,CAAC;CAG9D;AAED;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,GAAG;IAClB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,iBAAiB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAEjC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,UAAU,CAAC;IAE1B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC;IAE9B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,UAAU,CAAC;IAE1B;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EACL,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,GAAG,IAAI,GAAG,EACf,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,eAAe,IAAI,eAAe,GACxC,CAAC;CACH"}
|
|
@@ -7,30 +7,63 @@ const path_1 = require("../../internal/utils/path.js");
|
|
|
7
7
|
class VPCs extends resource_1.APIResource {
|
|
8
8
|
/**
|
|
9
9
|
* Create a VPC
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const operation = await client.networking.vpcs.create({
|
|
14
|
+
* name: 'my-vpc',
|
|
15
|
+
* region: 'us-wdc-1',
|
|
16
|
+
* subnet_name: 'my-subnet',
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
10
19
|
*/
|
|
11
20
|
create(body, options) {
|
|
12
21
|
return this._client.post('/v1/networking/vpcs', { body, ...options });
|
|
13
22
|
}
|
|
14
23
|
/**
|
|
15
24
|
* Update a VPC
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const operation = await client.networking.vpcs.update(
|
|
29
|
+
* 'vpc_id',
|
|
30
|
+
* );
|
|
31
|
+
* ```
|
|
16
32
|
*/
|
|
17
33
|
update(vpcID, body, options) {
|
|
18
34
|
return this._client.patch((0, path_1.path) `/v1/networking/vpcs/${vpcID}`, { body, ...options });
|
|
19
35
|
}
|
|
20
36
|
/**
|
|
21
37
|
* List all VPCs
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const vpcList = await client.networking.vpcs.list();
|
|
42
|
+
* ```
|
|
22
43
|
*/
|
|
23
44
|
list(options) {
|
|
24
45
|
return this._client.get('/v1/networking/vpcs', options);
|
|
25
46
|
}
|
|
26
47
|
/**
|
|
27
48
|
* Delete a VPC
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* const operation = await client.networking.vpcs.delete(
|
|
53
|
+
* 'vpc_id',
|
|
54
|
+
* );
|
|
55
|
+
* ```
|
|
28
56
|
*/
|
|
29
57
|
delete(vpcID, options) {
|
|
30
58
|
return this._client.delete((0, path_1.path) `/v1/networking/vpcs/${vpcID}`, options);
|
|
31
59
|
}
|
|
32
60
|
/**
|
|
33
61
|
* Get details about a VPC
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```ts
|
|
65
|
+
* const vpc = await client.networking.vpcs.get('vpc_id');
|
|
66
|
+
* ```
|
|
34
67
|
*/
|
|
35
68
|
get(vpcID, options) {
|
|
36
69
|
return this._client.get((0, path_1.path) `/v1/networking/vpcs/${vpcID}`, options);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vpcs.js","sourceRoot":"","sources":["../../src/resources/networking/vpcs.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAKlD,uDAAiD;AAEjD,MAAa,IAAK,SAAQ,sBAAW;IACnC
|
|
1
|
+
{"version":3,"file":"vpcs.js","sourceRoot":"","sources":["../../src/resources/networking/vpcs.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAKlD,uDAAiD;AAEjD,MAAa,IAAK,SAAQ,sBAAW;IACnC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAAqB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CACJ,KAAa,EACb,IAAqB,EACrB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,uBAAuB,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtF,CAAC;IAED;;;;;;;OAOG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,KAAa,EAAE,OAAwB;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,uBAAuB,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;IAC1E,CAAC;IAED;;;;;;;OAOG;IACH,GAAG,CAAC,KAAa,EAAE,OAAwB;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,uBAAuB,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;IACvE,CAAC;CACF;AAxED,oBAwEC"}
|
|
@@ -4,30 +4,63 @@ import { path } from "../../internal/utils/path.mjs";
|
|
|
4
4
|
export class VPCs extends APIResource {
|
|
5
5
|
/**
|
|
6
6
|
* Create a VPC
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const operation = await client.networking.vpcs.create({
|
|
11
|
+
* name: 'my-vpc',
|
|
12
|
+
* region: 'us-wdc-1',
|
|
13
|
+
* subnet_name: 'my-subnet',
|
|
14
|
+
* });
|
|
15
|
+
* ```
|
|
7
16
|
*/
|
|
8
17
|
create(body, options) {
|
|
9
18
|
return this._client.post('/v1/networking/vpcs', { body, ...options });
|
|
10
19
|
}
|
|
11
20
|
/**
|
|
12
21
|
* Update a VPC
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* const operation = await client.networking.vpcs.update(
|
|
26
|
+
* 'vpc_id',
|
|
27
|
+
* );
|
|
28
|
+
* ```
|
|
13
29
|
*/
|
|
14
30
|
update(vpcID, body, options) {
|
|
15
31
|
return this._client.patch(path `/v1/networking/vpcs/${vpcID}`, { body, ...options });
|
|
16
32
|
}
|
|
17
33
|
/**
|
|
18
34
|
* List all VPCs
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const vpcList = await client.networking.vpcs.list();
|
|
39
|
+
* ```
|
|
19
40
|
*/
|
|
20
41
|
list(options) {
|
|
21
42
|
return this._client.get('/v1/networking/vpcs', options);
|
|
22
43
|
}
|
|
23
44
|
/**
|
|
24
45
|
* Delete a VPC
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const operation = await client.networking.vpcs.delete(
|
|
50
|
+
* 'vpc_id',
|
|
51
|
+
* );
|
|
52
|
+
* ```
|
|
25
53
|
*/
|
|
26
54
|
delete(vpcID, options) {
|
|
27
55
|
return this._client.delete(path `/v1/networking/vpcs/${vpcID}`, options);
|
|
28
56
|
}
|
|
29
57
|
/**
|
|
30
58
|
* Get details about a VPC
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* const vpc = await client.networking.vpcs.get('vpc_id');
|
|
63
|
+
* ```
|
|
31
64
|
*/
|
|
32
65
|
get(vpcID, options) {
|
|
33
66
|
return this._client.get(path `/v1/networking/vpcs/${vpcID}`, options);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vpcs.mjs","sourceRoot":"","sources":["../../src/resources/networking/vpcs.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAKf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,IAAK,SAAQ,WAAW;IACnC
|
|
1
|
+
{"version":3,"file":"vpcs.mjs","sourceRoot":"","sources":["../../src/resources/networking/vpcs.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAKf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,IAAK,SAAQ,WAAW;IACnC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAAqB,EAAE,OAAwB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CACJ,KAAa,EACb,IAAqB,EACrB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA,uBAAuB,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtF,CAAC;IAED;;;;;;;OAOG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,KAAa,EAAE,OAAwB;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,uBAAuB,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;IAC1E,CAAC;IAED;;;;;;;OAOG;IACH,GAAG,CAAC,KAAa,EAAE,OAAwB;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,uBAAuB,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;IACvE,CAAC;CACF"}
|
package/resources/networking.js
CHANGED
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
-
if (k2 === undefined) k2 = k;
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
-
};
|
|
17
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
|
|
4
|
+
const tslib_1 = require("../internal/tslib.js");
|
|
5
|
+
tslib_1.__exportStar(require("./networking/index.js"), exports);
|
|
19
6
|
//# sourceMappingURL=networking.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"networking.js","sourceRoot":"","sources":["../src/resources/networking.ts"],"names":[],"mappings":";AAAA,sFAAsF
|
|
1
|
+
{"version":3,"file":"networking.js","sourceRoot":"","sources":["../src/resources/networking.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gEAAmC"}
|
package/resources.js
CHANGED
|
@@ -1,18 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
3
|
+
const tslib_1 = require("./internal/tslib.js");
|
|
4
|
+
tslib_1.__exportStar(require("./resources/index.js"), exports);
|
|
18
5
|
//# sourceMappingURL=resources.js.map
|
package/resources.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources.js","sourceRoot":"","sources":["src/resources.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resources.js","sourceRoot":"","sources":["src/resources.ts"],"names":[],"mappings":";;;AAAA,+DAAkC"}
|
package/src/client.ts
CHANGED
|
@@ -169,6 +169,23 @@ export class NirvanaLabs {
|
|
|
169
169
|
this.apiKey = apiKey;
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
+
/**
|
|
173
|
+
* Create a new client instance re-using the same options given to the current client with optional overriding.
|
|
174
|
+
*/
|
|
175
|
+
withOptions(options: Partial<ClientOptions>): this {
|
|
176
|
+
return new (this.constructor as any as new (props: ClientOptions) => typeof this)({
|
|
177
|
+
...this._options,
|
|
178
|
+
baseURL: this.baseURL,
|
|
179
|
+
maxRetries: this.maxRetries,
|
|
180
|
+
timeout: this.timeout,
|
|
181
|
+
logger: this.logger,
|
|
182
|
+
logLevel: this.logLevel,
|
|
183
|
+
fetchOptions: this.fetchOptions,
|
|
184
|
+
apiKey: this.apiKey,
|
|
185
|
+
...options,
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
|
|
172
189
|
protected defaultQuery(): Record<string, string | undefined> | undefined {
|
|
173
190
|
return this._options.defaultQuery;
|
|
174
191
|
}
|
package/src/internal/to-file.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type File, getFile } from './shims/file';
|
|
2
1
|
import { BlobPart, getName, makeFile, isAsyncIterable } from './uploads';
|
|
3
2
|
import type { FilePropertyBag } from './builtin-types';
|
|
3
|
+
import { checkFileSupport } from './uploads';
|
|
4
4
|
|
|
5
5
|
type BlobLikePart = string | ArrayBuffer | ArrayBufferView | BlobLike | DataView;
|
|
6
6
|
|
|
@@ -85,12 +85,14 @@ export async function toFile(
|
|
|
85
85
|
name?: string | null | undefined,
|
|
86
86
|
options?: FilePropertyBag | undefined,
|
|
87
87
|
): Promise<File> {
|
|
88
|
+
checkFileSupport();
|
|
89
|
+
|
|
88
90
|
// If it's a promise, resolve it.
|
|
89
91
|
value = await value;
|
|
90
92
|
|
|
91
93
|
// If we've been given a `File` we don't need to do anything
|
|
92
94
|
if (isFileLike(value)) {
|
|
93
|
-
if (value instanceof
|
|
95
|
+
if (value instanceof File) {
|
|
94
96
|
return value;
|
|
95
97
|
}
|
|
96
98
|
return makeFile([await value.arrayBuffer()], value.name);
|
package/src/internal/uploads.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type RequestOptions } from './request-options';
|
|
2
2
|
import type { FilePropertyBag, Fetch } from './builtin-types';
|
|
3
3
|
import type { NirvanaLabs } from '../client';
|
|
4
|
-
import { type File, getFile } from './shims/file';
|
|
5
4
|
import { ReadableStreamFrom } from './shims';
|
|
6
5
|
|
|
7
6
|
export type BlobPart = string | ArrayBuffer | ArrayBufferView | Blob | DataView;
|
|
@@ -12,6 +11,20 @@ interface BunFile extends Blob {
|
|
|
12
11
|
readonly name?: string | undefined;
|
|
13
12
|
}
|
|
14
13
|
|
|
14
|
+
export const checkFileSupport = () => {
|
|
15
|
+
if (typeof File === 'undefined') {
|
|
16
|
+
const { process } = globalThis as any;
|
|
17
|
+
const isOldNode =
|
|
18
|
+
typeof process?.versions?.node === 'string' && parseInt(process.versions.node.split('.')) < 20;
|
|
19
|
+
throw new Error(
|
|
20
|
+
'`File` is not defined as a global, which is required for file uploads.' +
|
|
21
|
+
(isOldNode ?
|
|
22
|
+
" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`."
|
|
23
|
+
: ''),
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
15
28
|
/**
|
|
16
29
|
* Typically, this is a native "File" class.
|
|
17
30
|
*
|
|
@@ -32,7 +45,7 @@ export function makeFile(
|
|
|
32
45
|
fileName: string | undefined,
|
|
33
46
|
options?: FilePropertyBag,
|
|
34
47
|
): File {
|
|
35
|
-
|
|
48
|
+
checkFileSupport();
|
|
36
49
|
return new File(fileBits as any, fileName ?? 'unknown_file', options);
|
|
37
50
|
}
|
|
38
51
|
|
|
@@ -125,8 +138,7 @@ export const createForm = async <T = Record<string, unknown>>(
|
|
|
125
138
|
|
|
126
139
|
// We check for Blob not File because Bun.File doesn't inherit from File,
|
|
127
140
|
// but they both inherit from Blob and have a `name` property at runtime.
|
|
128
|
-
const isNamedBlob = (value: object) =>
|
|
129
|
-
value instanceof getFile() || (value instanceof Blob && 'name' in value);
|
|
141
|
+
const isNamedBlob = (value: object) => value instanceof Blob && 'name' in value;
|
|
130
142
|
|
|
131
143
|
const isUploadable = (value: unknown) =>
|
|
132
144
|
typeof value === 'object' &&
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { getCrypto } from '../shims/crypto';
|
|
4
|
-
|
|
5
3
|
/**
|
|
6
4
|
* https://stackoverflow.com/a/2117523
|
|
7
5
|
*/
|
|
8
6
|
export let uuid4 = function () {
|
|
9
|
-
const crypto =
|
|
7
|
+
const { crypto } = globalThis as any;
|
|
10
8
|
if (crypto?.randomUUID) {
|
|
11
9
|
uuid4 = crypto.randomUUID.bind(crypto);
|
|
12
10
|
return crypto.randomUUID();
|
|
@@ -9,6 +9,14 @@ import { path } from '../internal/utils/path';
|
|
|
9
9
|
export class APIKeys extends APIResource {
|
|
10
10
|
/**
|
|
11
11
|
* Create a new API key
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const apiKey = await client.apiKeys.create({
|
|
16
|
+
* expires_at: '2025-12-31T23:59:59Z',
|
|
17
|
+
* name: 'my-api-key',
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
12
20
|
*/
|
|
13
21
|
create(body: APIKeyCreateParams, options?: RequestOptions): APIPromise<APIKey> {
|
|
14
22
|
return this._client.post('/v1/api_keys', { body, ...options });
|
|
@@ -16,6 +24,11 @@ export class APIKeys extends APIResource {
|
|
|
16
24
|
|
|
17
25
|
/**
|
|
18
26
|
* Update an API key's name
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* const apiKey = await client.apiKeys.update('api_key_id');
|
|
31
|
+
* ```
|
|
19
32
|
*/
|
|
20
33
|
update(apiKeyID: string, body: APIKeyUpdateParams, options?: RequestOptions): APIPromise<APIKey> {
|
|
21
34
|
return this._client.patch(path`/v1/api_keys/${apiKeyID}`, { body, ...options });
|
|
@@ -23,6 +36,11 @@ export class APIKeys extends APIResource {
|
|
|
23
36
|
|
|
24
37
|
/**
|
|
25
38
|
* List all API keys you created
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* const apiKeyList = await client.apiKeys.list();
|
|
43
|
+
* ```
|
|
26
44
|
*/
|
|
27
45
|
list(options?: RequestOptions): APIPromise<APIKeyList> {
|
|
28
46
|
return this._client.get('/v1/api_keys', options);
|
|
@@ -30,6 +48,11 @@ export class APIKeys extends APIResource {
|
|
|
30
48
|
|
|
31
49
|
/**
|
|
32
50
|
* Delete an API key
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* await client.apiKeys.delete('api_key_id');
|
|
55
|
+
* ```
|
|
33
56
|
*/
|
|
34
57
|
delete(apiKeyID: string, options?: RequestOptions): APIPromise<void> {
|
|
35
58
|
return this._client.delete(path`/v1/api_keys/${apiKeyID}`, {
|
|
@@ -40,6 +63,11 @@ export class APIKeys extends APIResource {
|
|
|
40
63
|
|
|
41
64
|
/**
|
|
42
65
|
* Get details about an API key
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* const apiKey = await client.apiKeys.get('api_key_id');
|
|
70
|
+
* ```
|
|
43
71
|
*/
|
|
44
72
|
get(apiKeyID: string, options?: RequestOptions): APIPromise<APIKey> {
|
|
45
73
|
return this._client.get(path`/v1/api_keys/${apiKeyID}`, options);
|
|
@@ -8,6 +8,11 @@ import { RequestOptions } from '../../../internal/request-options';
|
|
|
8
8
|
export class OSImages extends APIResource {
|
|
9
9
|
/**
|
|
10
10
|
* List all OS Images
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const osImages = await client.compute.vms.osImages.list();
|
|
15
|
+
* ```
|
|
11
16
|
*/
|
|
12
17
|
list(options?: RequestOptions): APIPromise<OSImageListResponse> {
|
|
13
18
|
return this._client.get('/v1/compute/vms/os_images', options);
|