@nirvana-labs/nirvana 0.9.1 → 0.10.1
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 +17 -6
- package/README.md +109 -51
- package/api-promise.d.mts +2 -0
- package/api-promise.d.mts.map +1 -0
- package/api-promise.d.ts +2 -0
- package/api-promise.d.ts.map +1 -0
- package/{_shims/auto/runtime.js → api-promise.js} +3 -5
- package/api-promise.js.map +1 -0
- package/api-promise.mjs +2 -0
- package/api-promise.mjs.map +1 -0
- package/client.d.mts +189 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +189 -0
- package/client.d.ts.map +1 -0
- package/client.js +481 -0
- package/client.js.map +1 -0
- package/client.mjs +454 -0
- package/client.mjs.map +1 -0
- package/core/api-promise.d.mts +47 -0
- package/core/api-promise.d.mts.map +1 -0
- package/core/api-promise.d.ts +47 -0
- package/core/api-promise.d.ts.map +1 -0
- package/core/api-promise.js +84 -0
- package/core/api-promise.js.map +1 -0
- package/core/api-promise.mjs +80 -0
- package/core/api-promise.mjs.map +1 -0
- package/core/error.d.mts +47 -0
- package/core/error.d.mts.map +1 -0
- package/core/error.d.ts +47 -0
- package/core/error.d.ts.map +1 -0
- package/core/error.js +113 -0
- package/core/error.js.map +1 -0
- package/core/error.mjs +97 -0
- package/core/error.mjs.map +1 -0
- package/core/resource.d.mts +6 -0
- package/core/resource.d.mts.map +1 -0
- package/core/resource.d.ts +6 -0
- package/core/resource.d.ts.map +1 -0
- package/core/resource.js +11 -0
- package/core/resource.js.map +1 -0
- package/core/resource.mjs +7 -0
- package/core/resource.mjs.map +1 -0
- package/core/uploads.d.mts +3 -0
- package/core/uploads.d.mts.map +1 -0
- package/core/uploads.d.ts +3 -0
- package/core/uploads.d.ts.map +1 -0
- package/core/uploads.js +6 -0
- package/core/uploads.js.map +1 -0
- package/core/uploads.mjs +2 -0
- package/core/uploads.mjs.map +1 -0
- package/error.d.mts +2 -0
- package/error.d.mts.map +1 -0
- package/error.d.ts +1 -46
- package/error.d.ts.map +1 -1
- package/error.js +16 -110
- package/error.js.map +1 -1
- package/error.mjs +1 -96
- package/error.mjs.map +1 -1
- package/index.d.mts +6 -124
- package/index.d.mts.map +1 -0
- package/index.d.ts +5 -123
- package/index.d.ts.map +1 -1
- package/index.js +12 -116
- package/index.js.map +1 -1
- package/index.mjs +5 -89
- package/index.mjs.map +1 -1
- package/internal/builtin-types.d.mts +75 -0
- package/internal/builtin-types.d.mts.map +1 -0
- package/internal/builtin-types.d.ts +75 -0
- package/internal/builtin-types.d.ts.map +1 -0
- package/internal/builtin-types.js +4 -0
- package/internal/builtin-types.js.map +1 -0
- package/internal/builtin-types.mjs +3 -0
- package/internal/builtin-types.mjs.map +1 -0
- package/internal/detect-platform.d.mts +15 -0
- package/internal/detect-platform.d.mts.map +1 -0
- package/internal/detect-platform.d.ts +15 -0
- package/internal/detect-platform.d.ts.map +1 -0
- package/internal/detect-platform.js +162 -0
- package/internal/detect-platform.js.map +1 -0
- package/internal/detect-platform.mjs +157 -0
- package/internal/detect-platform.mjs.map +1 -0
- package/internal/errors.d.mts +3 -0
- package/internal/errors.d.mts.map +1 -0
- package/internal/errors.d.ts +3 -0
- package/internal/errors.d.ts.map +1 -0
- package/internal/errors.js +41 -0
- package/internal/errors.js.map +1 -0
- package/internal/errors.mjs +36 -0
- package/internal/errors.mjs.map +1 -0
- package/internal/headers.d.mts +21 -0
- package/internal/headers.d.mts.map +1 -0
- package/internal/headers.d.ts +21 -0
- package/internal/headers.d.ts.map +1 -0
- package/internal/headers.js +77 -0
- package/internal/headers.js.map +1 -0
- package/internal/headers.mjs +72 -0
- package/internal/headers.mjs.map +1 -0
- package/internal/parse.d.mts +13 -0
- package/internal/parse.d.mts.map +1 -0
- package/internal/parse.d.ts +13 -0
- package/internal/parse.d.ts.map +1 -0
- package/internal/parse.js +36 -0
- package/internal/parse.js.map +1 -0
- package/internal/parse.mjs +32 -0
- package/internal/parse.mjs.map +1 -0
- package/internal/request-options.d.mts +33 -0
- package/internal/request-options.d.mts.map +1 -0
- package/internal/request-options.d.ts +33 -0
- package/internal/request-options.d.ts.map +1 -0
- package/internal/request-options.js +14 -0
- package/internal/request-options.js.map +1 -0
- package/internal/request-options.mjs +10 -0
- package/internal/request-options.mjs.map +1 -0
- package/internal/shim-types.d.mts +28 -0
- package/internal/shim-types.d.ts +28 -0
- package/internal/shims/crypto.d.mts +13 -0
- package/internal/shims/crypto.d.mts.map +1 -0
- package/internal/shims/crypto.d.ts +13 -0
- package/internal/shims/crypto.d.ts.map +1 -0
- package/internal/shims/crypto.js +13 -0
- package/internal/shims/crypto.js.map +1 -0
- package/internal/shims/crypto.mjs +9 -0
- package/internal/shims/crypto.mjs.map +1 -0
- package/internal/shims/file.d.mts +23 -0
- package/internal/shims/file.d.mts.map +1 -0
- package/internal/shims/file.d.ts +23 -0
- package/internal/shims/file.d.ts.map +1 -0
- package/internal/shims/file.js +16 -0
- package/internal/shims/file.js.map +1 -0
- package/internal/shims/file.mjs +12 -0
- package/internal/shims/file.mjs.map +1 -0
- package/internal/shims/getBuiltinModule.d.mts +11 -0
- package/internal/shims/getBuiltinModule.d.mts.map +1 -0
- package/internal/shims/getBuiltinModule.d.ts +11 -0
- package/internal/shims/getBuiltinModule.d.ts.map +1 -0
- package/internal/shims/getBuiltinModule.js +71 -0
- package/internal/shims/getBuiltinModule.js.map +1 -0
- package/internal/shims/getBuiltinModule.mjs +67 -0
- package/internal/shims/getBuiltinModule.mjs.map +1 -0
- package/internal/shims/nullGetBuiltinModule.d.mts +2 -0
- package/internal/shims/nullGetBuiltinModule.d.mts.map +1 -0
- package/internal/shims/nullGetBuiltinModule.d.ts +2 -0
- package/internal/shims/nullGetBuiltinModule.d.ts.map +1 -0
- package/internal/shims/nullGetBuiltinModule.js +5 -0
- package/internal/shims/nullGetBuiltinModule.js.map +1 -0
- package/internal/shims/nullGetBuiltinModule.mjs +2 -0
- package/internal/shims/nullGetBuiltinModule.mjs.map +1 -0
- package/internal/shims.d.mts +20 -0
- package/internal/shims.d.mts.map +1 -0
- package/internal/shims.d.ts +20 -0
- package/internal/shims.d.ts.map +1 -0
- package/internal/shims.js +93 -0
- package/internal/shims.js.map +1 -0
- package/internal/shims.mjs +85 -0
- package/internal/shims.mjs.map +1 -0
- package/internal/to-file.d.mts +46 -0
- package/internal/to-file.d.mts.map +1 -0
- package/internal/to-file.d.ts +46 -0
- package/internal/to-file.d.ts.map +1 -0
- package/internal/to-file.js +91 -0
- package/internal/to-file.js.map +1 -0
- package/internal/to-file.mjs +87 -0
- package/internal/to-file.mjs.map +1 -0
- package/internal/types.d.mts +68 -0
- package/internal/types.d.mts.map +1 -0
- package/internal/types.d.ts +68 -0
- package/internal/types.d.ts.map +1 -0
- package/internal/types.js +4 -0
- package/internal/types.js.map +1 -0
- package/internal/types.mjs +3 -0
- package/internal/types.mjs.map +1 -0
- package/internal/uploads.d.mts +44 -0
- package/internal/uploads.d.mts.map +1 -0
- package/internal/uploads.d.ts +44 -0
- package/internal/uploads.d.ts.map +1 -0
- package/internal/uploads.js +131 -0
- package/internal/uploads.js.map +1 -0
- package/internal/uploads.mjs +122 -0
- package/internal/uploads.mjs.map +1 -0
- package/internal/utils/base64.d.mts +3 -0
- package/internal/utils/base64.d.mts.map +1 -0
- package/internal/utils/base64.d.ts +3 -0
- package/internal/utils/base64.d.ts.map +1 -0
- package/internal/utils/base64.js +33 -0
- package/internal/utils/base64.js.map +1 -0
- package/internal/utils/base64.mjs +28 -0
- package/internal/utils/base64.mjs.map +1 -0
- package/internal/utils/env.d.mts +9 -0
- package/internal/utils/env.d.mts.map +1 -0
- package/internal/utils/env.d.ts +9 -0
- package/internal/utils/env.d.ts.map +1 -0
- package/internal/utils/env.js +22 -0
- package/internal/utils/env.js.map +1 -0
- package/internal/utils/env.mjs +18 -0
- package/internal/utils/env.mjs.map +1 -0
- package/internal/utils/log.d.mts +38 -0
- package/internal/utils/log.d.mts.map +1 -0
- package/internal/utils/log.d.ts +38 -0
- package/internal/utils/log.d.ts.map +1 -0
- package/internal/utils/log.js +85 -0
- package/internal/utils/log.js.map +1 -0
- package/internal/utils/log.mjs +79 -0
- package/internal/utils/log.mjs.map +1 -0
- package/internal/utils/path.d.mts +15 -0
- package/internal/utils/path.d.mts.map +1 -0
- package/internal/utils/path.d.ts +15 -0
- package/internal/utils/path.d.ts.map +1 -0
- package/internal/utils/path.js +58 -0
- package/internal/utils/path.js.map +1 -0
- package/internal/utils/path.mjs +53 -0
- package/internal/utils/path.mjs.map +1 -0
- package/internal/utils/sleep.d.mts +2 -0
- package/internal/utils/sleep.d.mts.map +1 -0
- package/internal/utils/sleep.d.ts +2 -0
- package/internal/utils/sleep.d.ts.map +1 -0
- package/internal/utils/sleep.js +7 -0
- package/internal/utils/sleep.js.map +1 -0
- package/internal/utils/sleep.mjs +3 -0
- package/internal/utils/sleep.mjs.map +1 -0
- package/internal/utils/uuid.d.mts +5 -0
- package/internal/utils/uuid.d.mts.map +1 -0
- package/internal/utils/uuid.d.ts +5 -0
- package/internal/utils/uuid.d.ts.map +1 -0
- package/internal/utils/uuid.js +20 -0
- package/internal/utils/uuid.js.map +1 -0
- package/internal/utils/uuid.mjs +16 -0
- package/internal/utils/uuid.mjs.map +1 -0
- package/internal/utils/values.d.mts +16 -0
- package/internal/utils/values.d.mts.map +1 -0
- package/internal/utils/values.d.ts +16 -0
- package/internal/utils/values.d.ts.map +1 -0
- package/internal/utils/values.js +109 -0
- package/internal/utils/values.js.map +1 -0
- package/internal/utils/values.mjs +92 -0
- package/internal/utils/values.mjs.map +1 -0
- package/internal/utils.d.mts +7 -0
- package/internal/utils.d.mts.map +1 -0
- package/internal/utils.d.ts +7 -0
- package/internal/utils.d.ts.map +1 -0
- package/{_shims/auto/runtime-bun.js → internal/utils.js} +8 -5
- package/internal/utils.js.map +1 -0
- package/internal/utils.mjs +8 -0
- package/internal/utils.mjs.map +1 -0
- package/package.json +107 -64
- package/resource.d.mts +2 -0
- package/resource.d.mts.map +1 -0
- package/resource.d.ts +1 -5
- package/resource.d.ts.map +1 -1
- package/resource.js +16 -8
- package/resource.js.map +1 -1
- package/resource.mjs +1 -6
- package/resource.mjs.map +1 -1
- package/resources/api-keys.d.mts +93 -0
- package/resources/api-keys.d.mts.map +1 -0
- package/resources/api-keys.d.ts +8 -7
- package/resources/api-keys.d.ts.map +1 -1
- package/resources/api-keys.js +10 -8
- package/resources/api-keys.js.map +1 -1
- package/resources/api-keys.mjs +10 -8
- package/resources/api-keys.mjs.map +1 -1
- package/resources/compute/compute.d.mts +14 -0
- package/resources/compute/compute.d.mts.map +1 -0
- package/resources/compute/compute.d.ts +1 -1
- package/resources/compute/compute.d.ts.map +1 -1
- package/resources/compute/compute.js +1 -1
- package/resources/compute/compute.js.map +1 -1
- package/resources/compute/compute.mjs +1 -1
- package/resources/compute/index.d.mts +4 -0
- package/resources/compute/index.d.mts.map +1 -0
- package/resources/compute/index.d.ts.map +1 -1
- package/resources/compute/vms/index.d.mts +4 -0
- package/resources/compute/vms/index.d.mts.map +1 -0
- package/resources/compute/vms/index.d.ts.map +1 -1
- package/resources/compute/vms/os-images.d.mts +15 -0
- package/resources/compute/vms/os-images.d.mts.map +1 -0
- package/resources/compute/vms/os-images.d.ts +4 -3
- package/resources/compute/vms/os-images.d.ts.map +1 -1
- package/resources/compute/vms/os-images.js +1 -1
- package/resources/compute/vms/os-images.js.map +1 -1
- package/resources/compute/vms/os-images.mjs +1 -1
- package/resources/compute/vms/os-images.mjs.map +1 -1
- package/resources/compute/vms/vms.d.mts +148 -0
- package/resources/compute/vms/vms.d.mts.map +1 -0
- package/resources/compute/vms/vms.d.ts +8 -7
- package/resources/compute/vms/vms.d.ts.map +1 -1
- package/resources/compute/vms/vms.js +8 -7
- package/resources/compute/vms/vms.js.map +1 -1
- package/resources/compute/vms/vms.mjs +8 -7
- package/resources/compute/vms/vms.mjs.map +1 -1
- package/resources/compute/vms/volumes.d.mts +11 -0
- package/resources/compute/vms/volumes.d.mts.map +1 -0
- package/resources/compute/vms/volumes.d.ts +4 -3
- package/resources/compute/vms/volumes.d.ts.map +1 -1
- package/resources/compute/vms/volumes.js +4 -3
- package/resources/compute/vms/volumes.js.map +1 -1
- package/resources/compute/vms/volumes.mjs +4 -3
- package/resources/compute/vms/volumes.mjs.map +1 -1
- package/resources/compute/vms.d.mts +2 -0
- package/resources/compute/vms.d.mts.map +1 -0
- package/resources/compute/vms.d.ts.map +1 -1
- package/resources/compute/volumes.d.mts +72 -0
- package/resources/compute/volumes.d.mts.map +1 -0
- package/resources/compute/volumes.d.ts +8 -7
- package/resources/compute/volumes.d.ts.map +1 -1
- package/resources/compute/volumes.js +8 -7
- package/resources/compute/volumes.js.map +1 -1
- package/resources/compute/volumes.mjs +8 -7
- package/resources/compute/volumes.mjs.map +1 -1
- package/resources/compute.d.mts +2 -0
- package/resources/compute.d.mts.map +1 -0
- package/resources/compute.d.ts.map +1 -1
- package/resources/index.d.mts +7 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/networking/firewall-rules.d.mts +100 -0
- package/resources/networking/firewall-rules.d.mts.map +1 -0
- package/resources/networking/firewall-rules.d.ts +38 -9
- package/resources/networking/firewall-rules.d.ts.map +1 -1
- package/resources/networking/firewall-rules.js +15 -11
- package/resources/networking/firewall-rules.js.map +1 -1
- package/resources/networking/firewall-rules.mjs +15 -11
- package/resources/networking/firewall-rules.mjs.map +1 -1
- package/resources/networking/index.d.mts +4 -0
- package/resources/networking/index.d.mts.map +1 -0
- package/resources/networking/index.d.ts +1 -1
- package/resources/networking/index.d.ts.map +1 -1
- package/resources/networking/index.js.map +1 -1
- package/resources/networking/index.mjs.map +1 -1
- package/resources/networking/networking.d.mts +14 -0
- package/resources/networking/networking.d.mts.map +1 -0
- package/resources/networking/networking.d.ts +3 -3
- package/resources/networking/networking.d.ts.map +1 -1
- package/resources/networking/networking.js +1 -1
- package/resources/networking/networking.js.map +1 -1
- package/resources/networking/networking.mjs +1 -1
- package/resources/networking/networking.mjs.map +1 -1
- package/resources/networking/vpcs.d.mts +69 -0
- package/resources/networking/vpcs.d.mts.map +1 -0
- package/resources/networking/vpcs.d.ts +8 -7
- package/resources/networking/vpcs.d.ts.map +1 -1
- package/resources/networking/vpcs.js +8 -7
- package/resources/networking/vpcs.js.map +1 -1
- package/resources/networking/vpcs.mjs +8 -7
- package/resources/networking/vpcs.mjs.map +1 -1
- package/resources/networking.d.mts +2 -0
- package/resources/networking.d.mts.map +1 -0
- package/resources/networking.d.ts.map +1 -1
- package/resources/operations.d.mts +35 -0
- package/resources/operations.d.mts.map +1 -0
- package/resources/operations.d.ts +5 -4
- package/resources/operations.d.ts.map +1 -1
- package/resources/operations.js +4 -3
- package/resources/operations.js.map +1 -1
- package/resources/operations.mjs +4 -3
- package/resources/operations.mjs.map +1 -1
- package/resources/shared.d.mts +3 -0
- package/resources/shared.d.mts.map +1 -0
- package/resources/user.d.mts +23 -0
- package/resources/user.d.mts.map +1 -0
- package/resources/user.d.ts +4 -3
- package/resources/user.d.ts.map +1 -1
- package/resources/user.js +1 -1
- package/resources/user.js.map +1 -1
- package/resources/user.mjs +1 -1
- package/resources/user.mjs.map +1 -1
- package/resources.d.mts +2 -0
- package/resources.d.mts.map +1 -0
- package/resources.d.ts.map +1 -1
- package/src/api-promise.ts +2 -0
- package/src/client.ts +707 -0
- package/src/core/README.md +3 -0
- package/src/core/api-promise.ts +92 -0
- package/src/core/error.ts +130 -0
- package/src/core/resource.ts +11 -0
- package/src/core/uploads.ts +2 -0
- package/src/error.ts +2 -130
- package/src/index.ts +5 -191
- package/src/internal/README.md +3 -0
- package/src/internal/builtin-types.ts +93 -0
- package/src/internal/detect-platform.ts +196 -0
- package/src/internal/errors.ts +33 -0
- package/src/internal/headers.ts +96 -0
- package/src/internal/parse.ts +50 -0
- package/src/internal/request-options.ts +37 -0
- package/src/internal/shim-types.d.ts +28 -0
- package/src/internal/shims/crypto.ts +18 -0
- package/src/internal/shims/file.ts +32 -0
- package/src/internal/shims/getBuiltinModule.ts +66 -0
- package/src/internal/shims/nullGetBuiltinModule.ts +1 -0
- package/src/internal/shims.ts +107 -0
- package/src/internal/to-file.ts +152 -0
- package/src/internal/types.ts +92 -0
- package/src/internal/uploads.ts +175 -0
- package/src/internal/utils/base64.ts +37 -0
- package/src/internal/utils/env.ts +18 -0
- package/src/internal/utils/log.ts +126 -0
- package/src/internal/utils/path.ts +65 -0
- package/src/internal/utils/sleep.ts +3 -0
- package/src/internal/utils/uuid.ts +19 -0
- package/src/internal/utils/values.ts +102 -0
- package/src/internal/utils.ts +8 -0
- package/src/resource.ts +2 -11
- package/src/resources/api-keys.ts +14 -11
- package/src/resources/compute/compute.ts +1 -1
- package/src/resources/compute/vms/os-images.ts +4 -3
- package/src/resources/compute/vms/vms.ts +12 -14
- package/src/resources/compute/vms/volumes.ts +6 -4
- package/src/resources/compute/volumes.ts +14 -12
- package/src/resources/networking/firewall-rules.ts +63 -22
- package/src/resources/networking/index.ts +2 -0
- package/src/resources/networking/networking.ts +5 -1
- package/src/resources/networking/vpcs.ts +14 -12
- package/src/resources/operations.ts +7 -5
- package/src/resources/user.ts +4 -3
- package/src/tsconfig.json +2 -2
- package/src/uploads.ts +2 -255
- package/src/version.ts +1 -1
- package/uploads.d.mts +2 -0
- package/uploads.d.mts.map +1 -0
- package/uploads.d.ts +1 -74
- package/uploads.d.ts.map +1 -1
- package/uploads.js +16 -168
- package/uploads.js.map +1 -1
- package/uploads.mjs +1 -157
- package/uploads.mjs.map +1 -1
- package/version.d.mts +2 -0
- package/version.d.mts.map +1 -0
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/_shims/MultipartBody.d.ts +0 -9
- package/_shims/MultipartBody.d.ts.map +0 -1
- package/_shims/MultipartBody.js +0 -16
- package/_shims/MultipartBody.js.map +0 -1
- package/_shims/MultipartBody.mjs +0 -12
- package/_shims/MultipartBody.mjs.map +0 -1
- package/_shims/README.md +0 -46
- package/_shims/auto/runtime-bun.d.ts +0 -5
- package/_shims/auto/runtime-bun.d.ts.map +0 -1
- package/_shims/auto/runtime-bun.js.map +0 -1
- package/_shims/auto/runtime-bun.mjs +0 -2
- package/_shims/auto/runtime-bun.mjs.map +0 -1
- package/_shims/auto/runtime-node.d.ts +0 -5
- package/_shims/auto/runtime-node.d.ts.map +0 -1
- package/_shims/auto/runtime-node.js +0 -21
- package/_shims/auto/runtime-node.js.map +0 -1
- package/_shims/auto/runtime-node.mjs +0 -2
- package/_shims/auto/runtime-node.mjs.map +0 -1
- package/_shims/auto/runtime.d.ts +0 -5
- package/_shims/auto/runtime.d.ts.map +0 -1
- package/_shims/auto/runtime.js.map +0 -1
- package/_shims/auto/runtime.mjs +0 -2
- package/_shims/auto/runtime.mjs.map +0 -1
- package/_shims/auto/types-node.d.ts +0 -5
- package/_shims/auto/types-node.d.ts.map +0 -1
- package/_shims/auto/types-node.js +0 -21
- package/_shims/auto/types-node.js.map +0 -1
- package/_shims/auto/types-node.mjs +0 -2
- package/_shims/auto/types-node.mjs.map +0 -1
- package/_shims/auto/types.d.ts +0 -101
- package/_shims/auto/types.js +0 -3
- package/_shims/auto/types.mjs +0 -3
- package/_shims/bun-runtime.d.ts +0 -6
- package/_shims/bun-runtime.d.ts.map +0 -1
- package/_shims/bun-runtime.js +0 -14
- package/_shims/bun-runtime.js.map +0 -1
- package/_shims/bun-runtime.mjs +0 -10
- package/_shims/bun-runtime.mjs.map +0 -1
- package/_shims/index.d.ts +0 -83
- package/_shims/index.js +0 -17
- package/_shims/index.mjs +0 -11
- package/_shims/manual-types.d.ts +0 -12
- package/_shims/manual-types.js +0 -3
- package/_shims/manual-types.mjs +0 -3
- package/_shims/node-runtime.d.ts +0 -3
- package/_shims/node-runtime.d.ts.map +0 -1
- package/_shims/node-runtime.js +0 -89
- package/_shims/node-runtime.js.map +0 -1
- package/_shims/node-runtime.mjs +0 -56
- package/_shims/node-runtime.mjs.map +0 -1
- package/_shims/node-types.d.ts +0 -42
- package/_shims/node-types.js +0 -3
- package/_shims/node-types.mjs +0 -3
- package/_shims/registry.d.ts +0 -37
- package/_shims/registry.d.ts.map +0 -1
- package/_shims/registry.js +0 -41
- package/_shims/registry.js.map +0 -1
- package/_shims/registry.mjs +0 -37
- package/_shims/registry.mjs.map +0 -1
- package/_shims/web-runtime.d.ts +0 -5
- package/_shims/web-runtime.d.ts.map +0 -1
- package/_shims/web-runtime.js +0 -78
- package/_shims/web-runtime.js.map +0 -1
- package/_shims/web-runtime.mjs +0 -71
- package/_shims/web-runtime.mjs.map +0 -1
- package/_shims/web-types.d.ts +0 -83
- package/_shims/web-types.js +0 -3
- package/_shims/web-types.mjs +0 -3
- package/core.d.ts +0 -252
- package/core.d.ts.map +0 -1
- package/core.js +0 -917
- package/core.js.map +0 -1
- package/core.mjs +0 -885
- package/core.mjs.map +0 -1
- package/shims/node.d.ts +0 -30
- package/shims/node.d.ts.map +0 -1
- package/shims/node.js +0 -31
- package/shims/node.js.map +0 -1
- package/shims/node.mjs +0 -5
- package/shims/node.mjs.map +0 -1
- package/shims/web.d.ts +0 -26
- package/shims/web.d.ts.map +0 -1
- package/shims/web.js +0 -31
- package/shims/web.js.map +0 -1
- package/shims/web.mjs +0 -5
- package/shims/web.mjs.map +0 -1
- package/src/_shims/MultipartBody.ts +0 -9
- package/src/_shims/README.md +0 -46
- package/src/_shims/auto/runtime-bun.ts +0 -4
- package/src/_shims/auto/runtime-node.ts +0 -4
- package/src/_shims/auto/runtime.ts +0 -4
- package/src/_shims/auto/types-node.ts +0 -4
- package/src/_shims/auto/types.d.ts +0 -101
- package/src/_shims/auto/types.js +0 -3
- package/src/_shims/auto/types.mjs +0 -3
- package/src/_shims/bun-runtime.ts +0 -14
- package/src/_shims/index.d.ts +0 -83
- package/src/_shims/index.js +0 -17
- package/src/_shims/index.mjs +0 -11
- package/src/_shims/manual-types.d.ts +0 -12
- package/src/_shims/manual-types.js +0 -3
- package/src/_shims/manual-types.mjs +0 -3
- package/src/_shims/node-runtime.ts +0 -81
- package/src/_shims/node-types.d.ts +0 -42
- package/src/_shims/node-types.js +0 -3
- package/src/_shims/node-types.mjs +0 -3
- package/src/_shims/registry.ts +0 -67
- package/src/_shims/web-runtime.ts +0 -103
- package/src/_shims/web-types.d.ts +0 -83
- package/src/_shims/web-types.js +0 -3
- package/src/_shims/web-types.mjs +0 -3
- package/src/core.ts +0 -1228
- package/src/shims/node.ts +0 -50
- package/src/shims/web.ts +0 -50
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { getCrypto } from '../shims/crypto';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* https://stackoverflow.com/a/2117523
|
|
7
|
+
*/
|
|
8
|
+
export let uuid4 = function () {
|
|
9
|
+
const crypto = getCrypto();
|
|
10
|
+
if (crypto?.randomUUID) {
|
|
11
|
+
uuid4 = crypto.randomUUID.bind(crypto);
|
|
12
|
+
return crypto.randomUUID();
|
|
13
|
+
}
|
|
14
|
+
const u8 = new Uint8Array(1);
|
|
15
|
+
const randomByte = crypto ? () => crypto.getRandomValues(u8)[0]! : () => (Math.random() * 0xff) & 0xff;
|
|
16
|
+
return '10000000-1000-4000-8000-100000000000'.replace(/[018]/g, (c) =>
|
|
17
|
+
(+c ^ (randomByte() & (15 >> (+c / 4)))).toString(16),
|
|
18
|
+
);
|
|
19
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { NirvanaLabsError } from '../../core/error';
|
|
4
|
+
|
|
5
|
+
// https://url.spec.whatwg.org/#url-scheme-string
|
|
6
|
+
const startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i;
|
|
7
|
+
|
|
8
|
+
export const isAbsoluteURL = (url: string): boolean => {
|
|
9
|
+
return startsWithSchemeRegexp.test(url);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/** Returns an object if the given value isn't an object, otherwise returns as-is */
|
|
13
|
+
export function maybeObj(x: unknown): object {
|
|
14
|
+
if (typeof x !== 'object') {
|
|
15
|
+
return {};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return x ?? {};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// https://stackoverflow.com/a/34491287
|
|
22
|
+
export function isEmptyObj(obj: Object | null | undefined): boolean {
|
|
23
|
+
if (!obj) return true;
|
|
24
|
+
for (const _k in obj) return false;
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// https://eslint.org/docs/latest/rules/no-prototype-builtins
|
|
29
|
+
export function hasOwn<T extends object = object>(obj: T, key: PropertyKey): key is keyof T {
|
|
30
|
+
return Object.prototype.hasOwnProperty.call(obj, key);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function isObj(obj: unknown): obj is Record<string, unknown> {
|
|
34
|
+
return obj != null && typeof obj === 'object' && !Array.isArray(obj);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const ensurePresent = <T>(value: T | null | undefined): T => {
|
|
38
|
+
if (value == null) {
|
|
39
|
+
throw new NirvanaLabsError(`Expected a value to be given but received ${value} instead.`);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return value;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const validatePositiveInteger = (name: string, n: unknown): number => {
|
|
46
|
+
if (typeof n !== 'number' || !Number.isInteger(n)) {
|
|
47
|
+
throw new NirvanaLabsError(`${name} must be an integer`);
|
|
48
|
+
}
|
|
49
|
+
if (n < 0) {
|
|
50
|
+
throw new NirvanaLabsError(`${name} must be a positive integer`);
|
|
51
|
+
}
|
|
52
|
+
return n;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const coerceInteger = (value: unknown): number => {
|
|
56
|
+
if (typeof value === 'number') return Math.round(value);
|
|
57
|
+
if (typeof value === 'string') return parseInt(value, 10);
|
|
58
|
+
|
|
59
|
+
throw new NirvanaLabsError(`Could not coerce ${value} (type: ${typeof value}) into a number`);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const coerceFloat = (value: unknown): number => {
|
|
63
|
+
if (typeof value === 'number') return value;
|
|
64
|
+
if (typeof value === 'string') return parseFloat(value);
|
|
65
|
+
|
|
66
|
+
throw new NirvanaLabsError(`Could not coerce ${value} (type: ${typeof value}) into a number`);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const coerceBoolean = (value: unknown): boolean => {
|
|
70
|
+
if (typeof value === 'boolean') return value;
|
|
71
|
+
if (typeof value === 'string') return value === 'true';
|
|
72
|
+
return Boolean(value);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export const maybeCoerceInteger = (value: unknown): number | undefined => {
|
|
76
|
+
if (value === undefined) {
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
return coerceInteger(value);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export const maybeCoerceFloat = (value: unknown): number | undefined => {
|
|
83
|
+
if (value === undefined) {
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
return coerceFloat(value);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export const maybeCoerceBoolean = (value: unknown): boolean | undefined => {
|
|
90
|
+
if (value === undefined) {
|
|
91
|
+
return undefined;
|
|
92
|
+
}
|
|
93
|
+
return coerceBoolean(value);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export const safeJSON = (text: string) => {
|
|
97
|
+
try {
|
|
98
|
+
return JSON.parse(text);
|
|
99
|
+
} catch (err) {
|
|
100
|
+
return undefined;
|
|
101
|
+
}
|
|
102
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export * from './utils/values';
|
|
4
|
+
export * from './utils/base64';
|
|
5
|
+
export * from './utils/env';
|
|
6
|
+
export * from './utils/log';
|
|
7
|
+
export * from './utils/uuid';
|
|
8
|
+
export * from './utils/sleep';
|
package/src/resource.ts
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import type { NirvanaLabs } from './index';
|
|
4
|
-
|
|
5
|
-
export class APIResource {
|
|
6
|
-
protected _client: NirvanaLabs;
|
|
7
|
-
|
|
8
|
-
constructor(client: NirvanaLabs) {
|
|
9
|
-
this._client = client;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
1
|
+
/** @deprecated Import from ./core/resource instead */
|
|
2
|
+
export * from './core/resource';
|
|
@@ -1,45 +1,48 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '../resource';
|
|
4
|
-
import
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { buildHeaders } from '../internal/headers';
|
|
6
|
+
import { RequestOptions } from '../internal/request-options';
|
|
7
|
+
import { path } from '../internal/utils/path';
|
|
5
8
|
|
|
6
9
|
export class APIKeys extends APIResource {
|
|
7
10
|
/**
|
|
8
11
|
* Create a new API key
|
|
9
12
|
*/
|
|
10
|
-
create(body: APIKeyCreateParams, options?:
|
|
13
|
+
create(body: APIKeyCreateParams, options?: RequestOptions): APIPromise<APIKey> {
|
|
11
14
|
return this._client.post('/v1/api_keys', { body, ...options });
|
|
12
15
|
}
|
|
13
16
|
|
|
14
17
|
/**
|
|
15
18
|
* Update an API key's name
|
|
16
19
|
*/
|
|
17
|
-
update(
|
|
18
|
-
return this._client.patch(`/v1/api_keys/${
|
|
20
|
+
update(apiKeyID: string, body: APIKeyUpdateParams, options?: RequestOptions): APIPromise<APIKey> {
|
|
21
|
+
return this._client.patch(path`/v1/api_keys/${apiKeyID}`, { body, ...options });
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
/**
|
|
22
25
|
* List all API keys you created
|
|
23
26
|
*/
|
|
24
|
-
list(options?:
|
|
27
|
+
list(options?: RequestOptions): APIPromise<APIKeyList> {
|
|
25
28
|
return this._client.get('/v1/api_keys', options);
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
/**
|
|
29
32
|
* Delete an API key
|
|
30
33
|
*/
|
|
31
|
-
delete(
|
|
32
|
-
return this._client.delete(`/v1/api_keys/${
|
|
34
|
+
delete(apiKeyID: string, options?: RequestOptions): APIPromise<void> {
|
|
35
|
+
return this._client.delete(path`/v1/api_keys/${apiKeyID}`, {
|
|
33
36
|
...options,
|
|
34
|
-
headers: { Accept: '*/*',
|
|
37
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
35
38
|
});
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
/**
|
|
39
42
|
* Get details about an API key
|
|
40
43
|
*/
|
|
41
|
-
get(
|
|
42
|
-
return this._client.get(`/v1/api_keys/${
|
|
44
|
+
get(apiKeyID: string, options?: RequestOptions): APIPromise<APIKey> {
|
|
45
|
+
return this._client.get(path`/v1/api_keys/${apiKeyID}`, options);
|
|
43
46
|
}
|
|
44
47
|
}
|
|
45
48
|
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '../../../resource';
|
|
4
|
-
import * as Core from '../../../core';
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
5
4
|
import * as VMsAPI from './vms';
|
|
5
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
6
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
6
7
|
|
|
7
8
|
export class OSImages extends APIResource {
|
|
8
9
|
/**
|
|
9
10
|
* List all OS Images
|
|
10
11
|
*/
|
|
11
|
-
list(options?:
|
|
12
|
+
list(options?: RequestOptions): APIPromise<OSImageListResponse> {
|
|
12
13
|
return this._client.get('/v1/compute/vms/os_images', options);
|
|
13
14
|
}
|
|
14
15
|
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '../../../resource';
|
|
4
|
-
import * as Core from '../../../core';
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
5
4
|
import * as OperationsAPI from '../../operations';
|
|
6
5
|
import * as Shared from '../../shared';
|
|
7
6
|
import * as OSImagesAPI from './os-images';
|
|
8
7
|
import { OSImageListResponse, OSImages } from './os-images';
|
|
9
8
|
import * as VolumesAPI from './volumes';
|
|
10
9
|
import { Volumes } from './volumes';
|
|
10
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
11
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
12
|
+
import { path } from '../../../internal/utils/path';
|
|
11
13
|
|
|
12
14
|
export class VMs extends APIResource {
|
|
13
15
|
volumes: VolumesAPI.Volumes = new VolumesAPI.Volumes(this._client);
|
|
@@ -16,40 +18,36 @@ export class VMs extends APIResource {
|
|
|
16
18
|
/**
|
|
17
19
|
* Create a VM
|
|
18
20
|
*/
|
|
19
|
-
create(body: VMCreateParams, options?:
|
|
21
|
+
create(body: VMCreateParams, options?: RequestOptions): APIPromise<OperationsAPI.Operation> {
|
|
20
22
|
return this._client.post('/v1/compute/vms', { body, ...options });
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
/**
|
|
24
26
|
* Update a VM
|
|
25
27
|
*/
|
|
26
|
-
update(
|
|
27
|
-
|
|
28
|
-
body: VMUpdateParams,
|
|
29
|
-
options?: Core.RequestOptions,
|
|
30
|
-
): Core.APIPromise<OperationsAPI.Operation> {
|
|
31
|
-
return this._client.patch(`/v1/compute/vms/${vmId}`, { body, ...options });
|
|
28
|
+
update(vmID: string, body: VMUpdateParams, options?: RequestOptions): APIPromise<OperationsAPI.Operation> {
|
|
29
|
+
return this._client.patch(path`/v1/compute/vms/${vmID}`, { body, ...options });
|
|
32
30
|
}
|
|
33
31
|
|
|
34
32
|
/**
|
|
35
33
|
* List all VMs
|
|
36
34
|
*/
|
|
37
|
-
list(options?:
|
|
35
|
+
list(options?: RequestOptions): APIPromise<VMList> {
|
|
38
36
|
return this._client.get('/v1/compute/vms', options);
|
|
39
37
|
}
|
|
40
38
|
|
|
41
39
|
/**
|
|
42
40
|
* Delete a VM
|
|
43
41
|
*/
|
|
44
|
-
delete(
|
|
45
|
-
return this._client.delete(`/v1/compute/vms/${
|
|
42
|
+
delete(vmID: string, options?: RequestOptions): APIPromise<OperationsAPI.Operation> {
|
|
43
|
+
return this._client.delete(path`/v1/compute/vms/${vmID}`, options);
|
|
46
44
|
}
|
|
47
45
|
|
|
48
46
|
/**
|
|
49
47
|
* Get details about a VM
|
|
50
48
|
*/
|
|
51
|
-
get(
|
|
52
|
-
return this._client.get(`/v1/compute/vms/${
|
|
49
|
+
get(vmID: string, options?: RequestOptions): APIPromise<VM> {
|
|
50
|
+
return this._client.get(path`/v1/compute/vms/${vmID}`, options);
|
|
53
51
|
}
|
|
54
52
|
}
|
|
55
53
|
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '../../../resource';
|
|
4
|
-
import * as Core from '../../../core';
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
5
4
|
import * as VolumesAPI from '../volumes';
|
|
5
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
6
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
7
|
+
import { path } from '../../../internal/utils/path';
|
|
6
8
|
|
|
7
9
|
export class Volumes extends APIResource {
|
|
8
10
|
/**
|
|
9
11
|
* List VM's Volumes
|
|
10
12
|
*/
|
|
11
|
-
list(
|
|
12
|
-
return this._client.get(`/v1/compute/vms/${
|
|
13
|
+
list(vmID: string, options?: RequestOptions): APIPromise<VolumesAPI.VolumeList> {
|
|
14
|
+
return this._client.get(path`/v1/compute/vms/${vmID}/volumes`, options);
|
|
13
15
|
}
|
|
14
16
|
}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '../../resource';
|
|
4
|
-
import * as Core from '../../core';
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
5
4
|
import * as OperationsAPI from '../operations';
|
|
6
5
|
import * as Shared from '../shared';
|
|
6
|
+
import { APIPromise } from '../../core/api-promise';
|
|
7
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
8
|
+
import { path } from '../../internal/utils/path';
|
|
7
9
|
|
|
8
10
|
export class Volumes extends APIResource {
|
|
9
11
|
/**
|
|
10
12
|
* Create a Volume. Only data volumes can be created.
|
|
11
13
|
*/
|
|
12
|
-
create(body: VolumeCreateParams, options?:
|
|
14
|
+
create(body: VolumeCreateParams, options?: RequestOptions): APIPromise<OperationsAPI.Operation> {
|
|
13
15
|
return this._client.post('/v1/compute/volumes', { body, ...options });
|
|
14
16
|
}
|
|
15
17
|
|
|
@@ -17,32 +19,32 @@ export class Volumes extends APIResource {
|
|
|
17
19
|
* Update a Volume. Boot or data volumes can be updated.
|
|
18
20
|
*/
|
|
19
21
|
update(
|
|
20
|
-
|
|
22
|
+
volumeID: string,
|
|
21
23
|
body: VolumeUpdateParams,
|
|
22
|
-
options?:
|
|
23
|
-
):
|
|
24
|
-
return this._client.patch(`/v1/compute/volumes/${
|
|
24
|
+
options?: RequestOptions,
|
|
25
|
+
): APIPromise<OperationsAPI.Operation> {
|
|
26
|
+
return this._client.patch(path`/v1/compute/volumes/${volumeID}`, { body, ...options });
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
/**
|
|
28
30
|
* List all volumes
|
|
29
31
|
*/
|
|
30
|
-
list(options?:
|
|
32
|
+
list(options?: RequestOptions): APIPromise<VolumeList> {
|
|
31
33
|
return this._client.get('/v1/compute/volumes', options);
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
/**
|
|
35
37
|
* Delete a Volume. Boot or data volumes can be deleted.
|
|
36
38
|
*/
|
|
37
|
-
delete(
|
|
38
|
-
return this._client.delete(`/v1/compute/volumes/${
|
|
39
|
+
delete(volumeID: string, options?: RequestOptions): APIPromise<OperationsAPI.Operation> {
|
|
40
|
+
return this._client.delete(path`/v1/compute/volumes/${volumeID}`, options);
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
/**
|
|
42
44
|
* Get a Volume.
|
|
43
45
|
*/
|
|
44
|
-
get(
|
|
45
|
-
return this._client.get(`/v1/compute/volumes/${
|
|
46
|
+
get(volumeID: string, options?: RequestOptions): APIPromise<Volume> {
|
|
47
|
+
return this._client.get(path`/v1/compute/volumes/${volumeID}`, options);
|
|
46
48
|
}
|
|
47
49
|
}
|
|
48
50
|
|
|
@@ -1,32 +1,34 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '../../resource';
|
|
4
|
-
import * as Core from '../../core';
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
5
4
|
import * as OperationsAPI from '../operations';
|
|
6
5
|
import * as Shared from '../shared';
|
|
6
|
+
import { APIPromise } from '../../core/api-promise';
|
|
7
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
8
|
+
import { path } from '../../internal/utils/path';
|
|
7
9
|
|
|
8
10
|
export class FirewallRules extends APIResource {
|
|
9
11
|
/**
|
|
10
12
|
* Create a firewall rule
|
|
11
13
|
*/
|
|
12
14
|
create(
|
|
13
|
-
|
|
15
|
+
vpcID: string,
|
|
14
16
|
body: FirewallRuleCreateParams,
|
|
15
|
-
options?:
|
|
16
|
-
):
|
|
17
|
-
return this._client.post(`/v1/networking/vpcs/${
|
|
17
|
+
options?: RequestOptions,
|
|
18
|
+
): APIPromise<OperationsAPI.Operation> {
|
|
19
|
+
return this._client.post(path`/v1/networking/vpcs/${vpcID}/firewall_rules`, { body, ...options });
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
/**
|
|
21
23
|
* Update a firewall rule
|
|
22
24
|
*/
|
|
23
25
|
update(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return this._client.patch(`/v1/networking/vpcs/${
|
|
26
|
+
firewallRuleID: string,
|
|
27
|
+
params: FirewallRuleUpdateParams,
|
|
28
|
+
options?: RequestOptions,
|
|
29
|
+
): APIPromise<OperationsAPI.Operation> {
|
|
30
|
+
const { vpc_id, ...body } = params;
|
|
31
|
+
return this._client.patch(path`/v1/networking/vpcs/${vpc_id}/firewall_rules/${firewallRuleID}`, {
|
|
30
32
|
body,
|
|
31
33
|
...options,
|
|
32
34
|
});
|
|
@@ -35,26 +37,32 @@ export class FirewallRules extends APIResource {
|
|
|
35
37
|
/**
|
|
36
38
|
* List all firewall rules
|
|
37
39
|
*/
|
|
38
|
-
list(
|
|
39
|
-
return this._client.get(`/v1/networking/vpcs/${
|
|
40
|
+
list(vpcID: string, options?: RequestOptions): APIPromise<FirewallRuleList> {
|
|
41
|
+
return this._client.get(path`/v1/networking/vpcs/${vpcID}/firewall_rules`, options);
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
/**
|
|
43
45
|
* Delete a firewall rule
|
|
44
46
|
*/
|
|
45
47
|
delete(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
options?:
|
|
49
|
-
):
|
|
50
|
-
|
|
48
|
+
firewallRuleID: string,
|
|
49
|
+
params: FirewallRuleDeleteParams,
|
|
50
|
+
options?: RequestOptions,
|
|
51
|
+
): APIPromise<OperationsAPI.Operation> {
|
|
52
|
+
const { vpc_id } = params;
|
|
53
|
+
return this._client.delete(path`/v1/networking/vpcs/${vpc_id}/firewall_rules/${firewallRuleID}`, options);
|
|
51
54
|
}
|
|
52
55
|
|
|
53
56
|
/**
|
|
54
57
|
* Get details about a firewall rule
|
|
55
58
|
*/
|
|
56
|
-
get(
|
|
57
|
-
|
|
59
|
+
get(
|
|
60
|
+
firewallRuleID: string,
|
|
61
|
+
params: FirewallRuleGetParams,
|
|
62
|
+
options?: RequestOptions,
|
|
63
|
+
): APIPromise<FirewallRule> {
|
|
64
|
+
const { vpc_id } = params;
|
|
65
|
+
return this._client.get(path`/v1/networking/vpcs/${vpc_id}/firewall_rules/${firewallRuleID}`, options);
|
|
58
66
|
}
|
|
59
67
|
}
|
|
60
68
|
|
|
@@ -106,25 +114,58 @@ export interface FirewallRuleCreateParams {
|
|
|
106
114
|
}
|
|
107
115
|
|
|
108
116
|
export interface FirewallRuleUpdateParams {
|
|
117
|
+
/**
|
|
118
|
+
* Path param: VPC ID
|
|
119
|
+
*/
|
|
120
|
+
vpc_id: string;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Body param:
|
|
124
|
+
*/
|
|
109
125
|
destination_address?: string;
|
|
110
126
|
|
|
127
|
+
/**
|
|
128
|
+
* Body param:
|
|
129
|
+
*/
|
|
111
130
|
destination_ports?: Array<string>;
|
|
112
131
|
|
|
132
|
+
/**
|
|
133
|
+
* Body param:
|
|
134
|
+
*/
|
|
113
135
|
name?: string;
|
|
114
136
|
|
|
115
137
|
/**
|
|
116
|
-
* Supported Firewall Rule protocols.
|
|
138
|
+
* Body param: Supported Firewall Rule protocols.
|
|
117
139
|
*/
|
|
118
140
|
protocol?: 'tcp' | 'udp';
|
|
119
141
|
|
|
142
|
+
/**
|
|
143
|
+
* Body param:
|
|
144
|
+
*/
|
|
120
145
|
source_address?: string;
|
|
121
146
|
}
|
|
122
147
|
|
|
148
|
+
export interface FirewallRuleDeleteParams {
|
|
149
|
+
/**
|
|
150
|
+
* VPC ID
|
|
151
|
+
*/
|
|
152
|
+
vpc_id: string;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export interface FirewallRuleGetParams {
|
|
156
|
+
/**
|
|
157
|
+
* VPC ID
|
|
158
|
+
*/
|
|
159
|
+
vpc_id: string;
|
|
160
|
+
}
|
|
161
|
+
|
|
123
162
|
export declare namespace FirewallRules {
|
|
124
163
|
export {
|
|
125
164
|
type FirewallRule as FirewallRule,
|
|
126
165
|
type FirewallRuleList as FirewallRuleList,
|
|
127
166
|
type FirewallRuleCreateParams as FirewallRuleCreateParams,
|
|
128
167
|
type FirewallRuleUpdateParams as FirewallRuleUpdateParams,
|
|
168
|
+
type FirewallRuleDeleteParams as FirewallRuleDeleteParams,
|
|
169
|
+
type FirewallRuleGetParams as FirewallRuleGetParams,
|
|
129
170
|
};
|
|
130
171
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '../../resource';
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
4
|
import * as FirewallRulesAPI from './firewall-rules';
|
|
5
5
|
import {
|
|
6
6
|
FirewallRule,
|
|
7
7
|
FirewallRuleCreateParams,
|
|
8
|
+
FirewallRuleDeleteParams,
|
|
9
|
+
FirewallRuleGetParams,
|
|
8
10
|
FirewallRuleList,
|
|
9
11
|
FirewallRuleUpdateParams,
|
|
10
12
|
FirewallRules,
|
|
@@ -36,5 +38,7 @@ export declare namespace Networking {
|
|
|
36
38
|
type FirewallRuleList as FirewallRuleList,
|
|
37
39
|
type FirewallRuleCreateParams as FirewallRuleCreateParams,
|
|
38
40
|
type FirewallRuleUpdateParams as FirewallRuleUpdateParams,
|
|
41
|
+
type FirewallRuleDeleteParams as FirewallRuleDeleteParams,
|
|
42
|
+
type FirewallRuleGetParams as FirewallRuleGetParams,
|
|
39
43
|
};
|
|
40
44
|
}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '../../resource';
|
|
4
|
-
import * as Core from '../../core';
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
5
4
|
import * as OperationsAPI from '../operations';
|
|
6
5
|
import * as Shared from '../shared';
|
|
6
|
+
import { APIPromise } from '../../core/api-promise';
|
|
7
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
8
|
+
import { path } from '../../internal/utils/path';
|
|
7
9
|
|
|
8
10
|
export class VPCs extends APIResource {
|
|
9
11
|
/**
|
|
10
12
|
* Create a VPC
|
|
11
13
|
*/
|
|
12
|
-
create(body: VPCCreateParams, options?:
|
|
14
|
+
create(body: VPCCreateParams, options?: RequestOptions): APIPromise<OperationsAPI.Operation> {
|
|
13
15
|
return this._client.post('/v1/networking/vpcs', { body, ...options });
|
|
14
16
|
}
|
|
15
17
|
|
|
@@ -17,32 +19,32 @@ export class VPCs extends APIResource {
|
|
|
17
19
|
* Update a VPC
|
|
18
20
|
*/
|
|
19
21
|
update(
|
|
20
|
-
|
|
22
|
+
vpcID: string,
|
|
21
23
|
body: VPCUpdateParams,
|
|
22
|
-
options?:
|
|
23
|
-
):
|
|
24
|
-
return this._client.patch(`/v1/networking/vpcs/${
|
|
24
|
+
options?: RequestOptions,
|
|
25
|
+
): APIPromise<OperationsAPI.Operation> {
|
|
26
|
+
return this._client.patch(path`/v1/networking/vpcs/${vpcID}`, { body, ...options });
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
/**
|
|
28
30
|
* List all VPCs
|
|
29
31
|
*/
|
|
30
|
-
list(options?:
|
|
32
|
+
list(options?: RequestOptions): APIPromise<VPCList> {
|
|
31
33
|
return this._client.get('/v1/networking/vpcs', options);
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
/**
|
|
35
37
|
* Delete a VPC
|
|
36
38
|
*/
|
|
37
|
-
delete(
|
|
38
|
-
return this._client.delete(`/v1/networking/vpcs/${
|
|
39
|
+
delete(vpcID: string, options?: RequestOptions): APIPromise<OperationsAPI.Operation> {
|
|
40
|
+
return this._client.delete(path`/v1/networking/vpcs/${vpcID}`, options);
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
/**
|
|
42
44
|
* Get details about a VPC
|
|
43
45
|
*/
|
|
44
|
-
get(
|
|
45
|
-
return this._client.get(`/v1/networking/vpcs/${
|
|
46
|
+
get(vpcID: string, options?: RequestOptions): APIPromise<VPC> {
|
|
47
|
+
return this._client.get(path`/v1/networking/vpcs/${vpcID}`, options);
|
|
46
48
|
}
|
|
47
49
|
}
|
|
48
50
|
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '../resource';
|
|
4
|
-
import
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../internal/request-options';
|
|
6
|
+
import { path } from '../internal/utils/path';
|
|
5
7
|
|
|
6
8
|
export class Operations extends APIResource {
|
|
7
9
|
/**
|
|
8
10
|
* List all operations
|
|
9
11
|
*/
|
|
10
|
-
list(options?:
|
|
12
|
+
list(options?: RequestOptions): APIPromise<OperationList> {
|
|
11
13
|
return this._client.get('/v1/operations', options);
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
/**
|
|
15
17
|
* Get details about a specific operation
|
|
16
18
|
*/
|
|
17
|
-
get(
|
|
18
|
-
return this._client.get(`/v1/operations/${
|
|
19
|
+
get(operationID: string, options?: RequestOptions): APIPromise<Operation> {
|
|
20
|
+
return this._client.get(path`/v1/operations/${operationID}`, options);
|
|
19
21
|
}
|
|
20
22
|
}
|
|
21
23
|
|