@phala/cloud 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/README.md +20 -0
  2. package/dist/actions/api_tokens/revoke_current_api_token.d.ts +47 -0
  3. package/dist/actions/apps/app_launch_token.d.ts +121 -0
  4. package/dist/actions/apps/check_app_cvms_is_allowed.d.ts +17 -311
  5. package/dist/actions/apps/check_app_is_allowed.d.ts +20 -32
  6. package/dist/actions/apps/create_app_instance.d.ts +43 -63
  7. package/dist/actions/apps/get_app_attestation.d.ts +116 -772
  8. package/dist/actions/apps/get_app_cvms.d.ts +1 -5
  9. package/dist/actions/apps/get_app_device_allowlist.d.ts +26 -272
  10. package/dist/actions/apps/get_app_filter_options.d.ts +8 -24
  11. package/dist/actions/apps/get_app_info.d.ts +1 -5
  12. package/dist/actions/apps/get_app_list.d.ts +2 -26
  13. package/dist/actions/apps/get_app_revision_detail.d.ts +1 -9
  14. package/dist/actions/apps/get_app_revisions.d.ts +1 -9
  15. package/dist/actions/blockchains/add_compose_hash.d.ts +1 -13
  16. package/dist/actions/blockchains/add_device.d.ts +1 -13
  17. package/dist/actions/blockchains/deploy_app_auth.d.ts +3 -95
  18. package/dist/actions/blockchains/get_allowed_devices.d.ts +2 -12
  19. package/dist/actions/blockchains/remove_device.d.ts +1 -13
  20. package/dist/actions/blockchains/set_allow_any_device.d.ts +1 -13
  21. package/dist/actions/cvms/check_cvm_is_allowed.d.ts +13 -138
  22. package/dist/actions/cvms/commit_cvm_compose_file_update.d.ts +9 -45
  23. package/dist/actions/cvms/commit_cvm_provision.d.ts +32 -416
  24. package/dist/actions/cvms/commit_cvm_update.d.ts +70 -41
  25. package/dist/actions/cvms/confirm_cvm_patch.d.ts +62 -35
  26. package/dist/actions/cvms/cvm_annotations.d.ts +152 -0
  27. package/dist/actions/cvms/delete_cvm.d.ts +8 -14
  28. package/dist/actions/cvms/get_available_os_images.d.ts +70 -111
  29. package/dist/actions/cvms/get_cvm_attestation.d.ts +34 -392
  30. package/dist/actions/cvms/get_cvm_compose_file.d.ts +426 -512
  31. package/dist/actions/cvms/get_cvm_containers_stats.d.ts +25 -91
  32. package/dist/actions/cvms/get_cvm_docker_compose.d.ts +8 -14
  33. package/dist/actions/cvms/get_cvm_info.d.ts +6 -12
  34. package/dist/actions/cvms/get_cvm_init_scripts.d.ts +87 -0
  35. package/dist/actions/cvms/get_cvm_list.d.ts +9 -17
  36. package/dist/actions/cvms/get_cvm_network.d.ts +18 -50
  37. package/dist/actions/cvms/get_cvm_prelaunch_script.d.ts +8 -14
  38. package/dist/actions/cvms/get_cvm_state.d.ts +11 -37
  39. package/dist/actions/cvms/get_cvm_stats.d.ts +23 -149
  40. package/dist/actions/cvms/get_cvm_status_batch.d.ts +97 -64
  41. package/dist/actions/cvms/get_cvm_user_config.d.ts +13 -24
  42. package/dist/actions/cvms/get_prelaunch_script_upgrade_status.d.ts +9 -27
  43. package/dist/actions/cvms/patch_cvm.d.ts +666 -287
  44. package/dist/actions/cvms/provision_cvm.d.ts +339 -725
  45. package/dist/actions/cvms/provision_cvm_compose_file_update.d.ts +584 -777
  46. package/dist/actions/cvms/refresh_cvm_instance_id.d.ts +74 -131
  47. package/dist/actions/cvms/refresh_cvm_instance_ids.d.ts +77 -297
  48. package/dist/actions/cvms/replicate_cvm.d.ts +7 -21
  49. package/dist/actions/cvms/restart_cvm.d.ts +3 -18
  50. package/dist/actions/cvms/shutdown_cvm.d.ts +6 -12
  51. package/dist/actions/cvms/start_cvm.d.ts +6 -12
  52. package/dist/actions/cvms/stop_cvm.d.ts +6 -12
  53. package/dist/actions/cvms/update_cvm_envs.d.ts +144 -195
  54. package/dist/actions/cvms/update_cvm_resources.d.ts +93 -37
  55. package/dist/actions/cvms/update_cvm_visibility.d.ts +90 -130
  56. package/dist/actions/cvms/update_docker_compose.d.ts +143 -187
  57. package/dist/actions/cvms/update_os_image.d.ts +55 -28
  58. package/dist/actions/cvms/update_prelaunch_script.d.ts +143 -187
  59. package/dist/actions/cvms/upgrade_prelaunch_script.d.ts +126 -185
  60. package/dist/actions/cvms/watch_cvm_state.d.ts +5 -15
  61. package/dist/actions/get_available_nodes.d.ts +201 -823
  62. package/dist/actions/get_cvm_create_resources.d.ts +150 -2150
  63. package/dist/actions/index.d.ts +14 -4
  64. package/dist/actions/kms/get_app_env_encrypt_pubkey.d.ts +11 -23
  65. package/dist/actions/kms/get_kms_contract.d.ts +57 -0
  66. package/dist/actions/kms/get_kms_info.d.ts +3 -7
  67. package/dist/actions/kms/get_kms_list.d.ts +43 -82
  68. package/dist/actions/kms/get_kms_onchain_detail.d.ts +72 -616
  69. package/dist/actions/kms/list_kms_contract_nodes.d.ts +66 -0
  70. package/dist/actions/kms/list_kms_contracts.d.ts +98 -0
  71. package/dist/actions/kms/next_app_ids.d.ts +5 -25
  72. package/dist/actions/list-instance-types.d.ts +77 -257
  73. package/dist/actions/os_images/get_os_images.d.ts +38 -152
  74. package/dist/actions/ssh_keys/create_ssh_key.d.ts +11 -17
  75. package/dist/actions/ssh_keys/delete_ssh_key.d.ts +3 -7
  76. package/dist/actions/ssh_keys/get_cvm_ssh_keys.d.ts +113 -0
  77. package/dist/actions/ssh_keys/import_github_profile.d.ts +7 -21
  78. package/dist/actions/ssh_keys/list_ssh_keys.d.ts +2 -50
  79. package/dist/actions/ssh_keys/sync_github_ssh_keys.d.ts +8 -20
  80. package/dist/actions/ssh_keys/update_cvm_ssh_keys.d.ts +140 -0
  81. package/dist/actions/workspaces/get_workspace.d.ts +32 -24
  82. package/dist/actions/workspaces/get_workspace_nodes.d.ts +56 -182
  83. package/dist/actions/workspaces/get_workspace_quotas.d.ts +107 -1021
  84. package/dist/actions/workspaces/list_workspaces.d.ts +69 -245
  85. package/dist/client.d.ts +27 -5
  86. package/dist/create-client.d.ts +1820 -1
  87. package/dist/credentials/current_user_v20251028.d.ts +1 -17
  88. package/dist/credentials/current_user_v20260121.d.ts +22 -227
  89. package/dist/index.d.ts +1 -2
  90. package/dist/index.js +5454 -4389
  91. package/dist/index.mjs +5396 -4395
  92. package/dist/types/app_compose.d.ts +116 -184
  93. package/dist/types/app_info_v20251028.d.ts +29 -1030
  94. package/dist/types/app_info_v20260121.d.ts +686 -6832
  95. package/dist/types/app_revision.d.ts +15 -371
  96. package/dist/types/client.d.ts +18 -2
  97. package/dist/types/common.d.ts +6 -0
  98. package/dist/types/cvm_id.d.ts +12 -57
  99. package/dist/types/cvm_info.d.ts +33 -460
  100. package/dist/types/cvm_info_v20251028.d.ts +102 -800
  101. package/dist/types/cvm_info_v20260121.d.ts +411 -2347
  102. package/dist/types/kms_contract.d.ts +34 -0
  103. package/dist/types/kms_info.d.ts +34 -60
  104. package/dist/types/version-mappings.d.ts +6 -6
  105. package/dist/utils/define-action.d.ts +4 -4
  106. package/dist/utils/error_codes.d.ts +1 -0
  107. package/dist/utils/errors.d.ts +34 -37
  108. package/dist/utils/get_compose_hash.d.ts +59 -4
  109. package/dist/utils/get_mr_config_id.d.ts +146 -0
  110. package/dist/utils/index.d.ts +3 -2
  111. package/dist/utils/placement-request.d.ts +3 -0
  112. package/package.json +4 -4
@@ -0,0 +1,34 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * A KMS contract: a group of equivalent KMS node replicas sharing one root key.
4
+ *
5
+ * `contract_address` is an on-chain address for ETHEREUM/BASE contracts, or the
6
+ * sentinel `"phala"` for the off-chain PHALA KMS (where `chain_id` is `0`).
7
+ * `k256_pubkey` / `ca_pubkey` are the verification anchors.
8
+ *
9
+ * Available from API version 2026-06-23.
10
+ */
11
+ export declare const KmsContractInfoSchema: z.ZodObject<{
12
+ id: z.ZodString;
13
+ slug: z.ZodNullable<z.ZodString>;
14
+ label: z.ZodNullable<z.ZodString>;
15
+ contract_address: z.ZodString;
16
+ chain_id: z.ZodNumber;
17
+ k256_pubkey: z.ZodNullable<z.ZodString>;
18
+ ca_pubkey: z.ZodNullable<z.ZodString>;
19
+ node_count: z.ZodNumber;
20
+ }, z.core.$loose>;
21
+ export type KmsContractInfo = z.infer<typeof KmsContractInfoSchema>;
22
+ /**
23
+ * A single KMS node (replica) under a contract, including its RPC `url`.
24
+ *
25
+ * Available from API version 2026-06-23.
26
+ */
27
+ export declare const KmsContractNodeSchema: z.ZodObject<{
28
+ id: z.ZodString;
29
+ slug: z.ZodNullable<z.ZodString>;
30
+ url: z.ZodString;
31
+ version: z.ZodString;
32
+ kms_type: z.ZodString;
33
+ }, z.core.$loose>;
34
+ export type KmsContractNode = z.infer<typeof KmsContractNodeSchema>;
@@ -6,66 +6,40 @@ declare const KmsInfoBaseSchema: z.ZodObject<{
6
6
  url: z.ZodString;
7
7
  version: z.ZodString;
8
8
  chain_id: z.ZodNullable<z.ZodNumber>;
9
- kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
10
- gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
11
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
12
- id: z.ZodString;
13
- slug: z.ZodNullable<z.ZodString>;
14
- url: z.ZodString;
15
- version: z.ZodString;
16
- chain_id: z.ZodNullable<z.ZodNumber>;
17
- kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
18
- gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
19
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
20
- id: z.ZodString;
21
- slug: z.ZodNullable<z.ZodString>;
22
- url: z.ZodString;
23
- version: z.ZodString;
24
- chain_id: z.ZodNullable<z.ZodNumber>;
25
- kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
26
- gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
27
- }, z.ZodTypeAny, "passthrough">>;
28
- export declare const KmsInfoSchema: z.ZodEffects<z.ZodObject<{
29
- id: z.ZodString;
30
- slug: z.ZodNullable<z.ZodString>;
31
- url: z.ZodString;
32
- version: z.ZodString;
33
- chain_id: z.ZodNullable<z.ZodNumber>;
34
- kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
35
- gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
36
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
37
- id: z.ZodString;
38
- slug: z.ZodNullable<z.ZodString>;
39
- url: z.ZodString;
40
- version: z.ZodString;
41
- chain_id: z.ZodNullable<z.ZodNumber>;
42
- kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
43
- gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
44
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
45
- id: z.ZodString;
46
- slug: z.ZodNullable<z.ZodString>;
47
- url: z.ZodString;
48
- version: z.ZodString;
49
- chain_id: z.ZodNullable<z.ZodNumber>;
50
- kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
51
- gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
52
- }, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
53
- id: z.ZodString;
54
- slug: z.ZodNullable<z.ZodString>;
55
- url: z.ZodString;
56
- version: z.ZodString;
57
- chain_id: z.ZodNullable<z.ZodNumber>;
58
- kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
59
- gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
60
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
61
- id: z.ZodString;
62
- slug: z.ZodNullable<z.ZodString>;
63
- url: z.ZodString;
64
- version: z.ZodString;
65
- chain_id: z.ZodNullable<z.ZodNumber>;
66
- kms_contract_address: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
67
- gateway_app_id: z.ZodEffects<z.ZodNullable<z.ZodString>, `0x${string}`, string | null>;
68
- }, z.ZodTypeAny, "passthrough">>;
9
+ kms_contract_address: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<`0x${string}`, string | null>>;
10
+ gateway_app_id: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<`0x${string}`, string | null>>;
11
+ k256_pubkey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
+ }, z.core.$loose>;
13
+ export declare const KmsInfoSchema: z.ZodPipe<z.ZodObject<{
14
+ id: z.ZodString;
15
+ slug: z.ZodNullable<z.ZodString>;
16
+ url: z.ZodString;
17
+ version: z.ZodString;
18
+ chain_id: z.ZodNullable<z.ZodNumber>;
19
+ kms_contract_address: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<`0x${string}`, string | null>>;
20
+ gateway_app_id: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<`0x${string}`, string | null>>;
21
+ k256_pubkey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
22
+ }, z.core.$loose>, z.ZodTransform<{
23
+ [x: string]: unknown;
24
+ id: string;
25
+ slug: string | null;
26
+ url: string;
27
+ version: string;
28
+ chain_id: number | null;
29
+ kms_contract_address: `0x${string}`;
30
+ gateway_app_id: `0x${string}`;
31
+ k256_pubkey?: string | null | undefined;
32
+ }, {
33
+ [x: string]: unknown;
34
+ id: string;
35
+ slug: string | null;
36
+ url: string;
37
+ version: string;
38
+ chain_id: number | null;
39
+ kms_contract_address: `0x${string}`;
40
+ gateway_app_id: `0x${string}`;
41
+ k256_pubkey?: string | null | undefined;
42
+ }>>;
69
43
  export type KmsInfo = (z.infer<typeof KmsInfoBaseSchema> & {
70
44
  chain_id: number;
71
45
  chain: Chain;
@@ -22,27 +22,27 @@ import type { CvmInfoDetailV20260121, CvmInfoDetailV20260522, CvmInfoV20260121,
22
22
  /**
23
23
  * Maps API version to the auth/me response type
24
24
  */
25
- export type GetCurrentUserResponse<V extends ApiVersion> = V extends "2026-05-22" ? CurrentUserV20260121 : V extends "2026-01-21" ? CurrentUserV20260121 : V extends "2025-10-28" ? CurrentUserV20251028 : CurrentUserV20260121;
25
+ export type GetCurrentUserResponse<V extends ApiVersion> = V extends "2026-05-22" | "2026-06-23" ? CurrentUserV20260121 : V extends "2026-01-21" ? CurrentUserV20260121 : V extends "2025-10-28" ? CurrentUserV20251028 : CurrentUserV20260121;
26
26
  /**
27
27
  * Maps API version to the paginated CVM list response type
28
28
  */
29
- export type GetCvmListResponse<V extends ApiVersion> = V extends "2026-05-22" ? PaginatedCvmInfosV20260522 : V extends "2026-01-21" ? PaginatedCvmInfosV20260121 : V extends "2025-10-28" ? PaginatedCvmInfosV20251028 : PaginatedCvmInfosV20260121;
29
+ export type GetCvmListResponse<V extends ApiVersion> = V extends "2026-05-22" | "2026-06-23" ? PaginatedCvmInfosV20260522 : V extends "2026-01-21" ? PaginatedCvmInfosV20260121 : V extends "2025-10-28" ? PaginatedCvmInfosV20251028 : PaginatedCvmInfosV20260121;
30
30
  /**
31
31
  * Maps API version to the CVM info detail response type
32
32
  */
33
- export type GetCvmInfoResponse<V extends ApiVersion> = V extends "2026-05-22" ? CvmInfoDetailV20260522 : V extends "2026-01-21" ? CvmInfoDetailV20260121 : V extends "2025-10-28" ? CvmDetailV20251028 : CvmInfoDetailV20260121;
33
+ export type GetCvmInfoResponse<V extends ApiVersion> = V extends "2026-05-22" | "2026-06-23" ? CvmInfoDetailV20260522 : V extends "2026-01-21" ? CvmInfoDetailV20260121 : V extends "2025-10-28" ? CvmDetailV20251028 : CvmInfoDetailV20260121;
34
34
  /**
35
35
  * Maps API version to the app list response type
36
36
  */
37
- export type GetAppListResponse<V extends ApiVersion> = V extends "2026-05-22" ? DstackAppListResponseV20260522 : V extends "2026-01-21" ? DstackAppListResponseV20260121 : V extends "2025-10-28" ? DstackAppListResponseV20251028 : DstackAppListResponseV20260121;
37
+ export type GetAppListResponse<V extends ApiVersion> = V extends "2026-05-22" | "2026-06-23" ? DstackAppListResponseV20260522 : V extends "2026-01-21" ? DstackAppListResponseV20260121 : V extends "2025-10-28" ? DstackAppListResponseV20251028 : DstackAppListResponseV20260121;
38
38
  /**
39
39
  * Maps API version to the app info response type
40
40
  */
41
- export type GetAppInfoResponse<V extends ApiVersion> = V extends "2026-05-22" ? DstackAppWithCvmResponseV20260522 : V extends "2026-01-21" ? DstackAppWithCvmResponseV20260121 : V extends "2025-10-28" ? DstackAppWithCvmResponseV20251028 : DstackAppWithCvmResponseV20260121;
41
+ export type GetAppInfoResponse<V extends ApiVersion> = V extends "2026-05-22" | "2026-06-23" ? DstackAppWithCvmResponseV20260522 : V extends "2026-01-21" ? DstackAppWithCvmResponseV20260121 : V extends "2025-10-28" ? DstackAppWithCvmResponseV20251028 : DstackAppWithCvmResponseV20260121;
42
42
  /**
43
43
  * Maps API version to the app CVMs list response type
44
44
  */
45
- export type GetAppCvmsResponse<V extends ApiVersion> = V extends "2026-05-22" ? CvmInfoV20260522[] : V extends "2026-01-21" ? CvmInfoV20260121[] : V extends "2025-10-28" ? CvmInfoV20251028[] : CvmInfoV20260121[];
45
+ export type GetAppCvmsResponse<V extends ApiVersion> = V extends "2026-05-22" | "2026-06-23" ? CvmInfoV20260522[] : V extends "2026-01-21" ? CvmInfoV20260121[] : V extends "2025-10-28" ? CvmInfoV20251028[] : CvmInfoV20260121[];
46
46
  /**
47
47
  * Maps API version to the CVM lifecycle action response type (start/stop/restart/shutdown/replicate)
48
48
  */
@@ -17,7 +17,7 @@ export declare function defineSimpleAction<TSchema extends z.ZodTypeAny, TReturn
17
17
  <T extends z.ZodTypeAny>(client: Client<ApiVersion>, parameters: {
18
18
  schema: T;
19
19
  }): Promise<z.infer<T>>;
20
- (client: Client<ApiVersion>): Promise<[TReturnOverride] extends [never] ? z.TypeOf<TSchema> : TReturnOverride>;
20
+ (client: Client<ApiVersion>): Promise<[TReturnOverride] extends [never] ? z.core.output<TSchema> : TReturnOverride>;
21
21
  };
22
22
  safeAction: {
23
23
  (client: Client<ApiVersion>, parameters: {
@@ -26,7 +26,7 @@ export declare function defineSimpleAction<TSchema extends z.ZodTypeAny, TReturn
26
26
  <T extends z.ZodTypeAny>(client: Client<ApiVersion>, parameters: {
27
27
  schema: T;
28
28
  }): Promise<SafeResult<z.infer<T>>>;
29
- (client: Client<ApiVersion>): Promise<SafeResult<[TReturnOverride] extends [never] ? z.TypeOf<TSchema> : TReturnOverride>>;
29
+ (client: Client<ApiVersion>): Promise<SafeResult<[TReturnOverride] extends [never] ? z.core.output<TSchema> : TReturnOverride>>;
30
30
  };
31
31
  };
32
32
  /**
@@ -34,7 +34,7 @@ export declare function defineSimpleAction<TSchema extends z.ZodTypeAny, TReturn
34
34
  */
35
35
  export declare function defineAction<TParams, TSchema extends z.ZodTypeAny, TReturnOverride = never>(schema: TSchema, fn: (client: Client<ApiVersion>, params: TParams) => Promise<unknown>): {
36
36
  action: {
37
- (client: Client<ApiVersion>, ...args: (undefined extends TParams ? true : false) extends true ? [params?: TParams] : [params: TParams]): Promise<[TReturnOverride] extends [never] ? z.TypeOf<TSchema> : TReturnOverride>;
37
+ (client: Client<ApiVersion>, ...args: (undefined extends TParams ? true : false) extends true ? [params?: TParams] : [params: TParams]): Promise<[TReturnOverride] extends [never] ? z.core.output<TSchema> : TReturnOverride>;
38
38
  <T extends z.ZodTypeAny>(client: Client<ApiVersion>, ...args: (undefined extends TParams ? true : false) extends true ? [params?: TParams, parameters?: {
39
39
  schema: T;
40
40
  }] : [params: TParams, parameters: {
@@ -47,7 +47,7 @@ export declare function defineAction<TParams, TSchema extends z.ZodTypeAny, TRet
47
47
  }]): Promise<unknown>;
48
48
  };
49
49
  safeAction: {
50
- (client: Client<ApiVersion>, ...args: (undefined extends TParams ? true : false) extends true ? [params?: TParams] : [params: TParams]): Promise<SafeResult<[TReturnOverride] extends [never] ? z.TypeOf<TSchema> : TReturnOverride>>;
50
+ (client: Client<ApiVersion>, ...args: (undefined extends TParams ? true : false) extends true ? [params?: TParams] : [params: TParams]): Promise<SafeResult<[TReturnOverride] extends [never] ? z.core.output<TSchema> : TReturnOverride>>;
51
51
  <T extends z.ZodTypeAny>(client: Client<ApiVersion>, ...args: (undefined extends TParams ? true : false) extends true ? [params?: TParams, parameters?: {
52
52
  schema: T;
53
53
  }] : [params: TParams, parameters: {
@@ -44,5 +44,6 @@ export declare const ErrorCodes: {
44
44
  readonly TOKEN_LIMIT_EXCEEDED: "ERR-05-001";
45
45
  readonly TOKEN_RATE_LIMIT: "ERR-05-002";
46
46
  readonly OAUTH_EMAIL_INVALID: "ERR-06-001";
47
+ readonly PERMISSION_DENIED: "ERR-06-006";
47
48
  };
48
49
  export type ErrorCode = (typeof ErrorCodes)[keyof typeof ErrorCodes];
@@ -4,48 +4,16 @@ import type { FetchError, FetchRequest } from "ofetch";
4
4
  * API Error Response Schema
5
5
  */
6
6
  export declare const ApiErrorSchema: z.ZodObject<{
7
- detail: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodObject<{
7
+ detail: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodObject<{
8
8
  msg: z.ZodString;
9
9
  type: z.ZodOptional<z.ZodString>;
10
10
  ctx: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
11
- loc: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">>;
11
+ loc: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
12
12
  input: z.ZodOptional<z.ZodUnknown>;
13
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
14
- msg: z.ZodString;
15
- type: z.ZodOptional<z.ZodString>;
16
- ctx: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
17
- loc: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">>;
18
- input: z.ZodOptional<z.ZodUnknown>;
19
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
20
- msg: z.ZodString;
21
- type: z.ZodOptional<z.ZodString>;
22
- ctx: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
23
- loc: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">>;
24
- input: z.ZodOptional<z.ZodUnknown>;
25
- }, z.ZodTypeAny, "passthrough">>, "many">, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
13
+ }, z.core.$loose>>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
26
14
  type: z.ZodOptional<z.ZodString>;
27
15
  code: z.ZodOptional<z.ZodString>;
28
- }, "strip", z.ZodTypeAny, {
29
- code?: string | undefined;
30
- type?: string | undefined;
31
- detail?: string | Record<string, unknown> | z.objectOutputType<{
32
- msg: z.ZodString;
33
- type: z.ZodOptional<z.ZodString>;
34
- ctx: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
35
- loc: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">>;
36
- input: z.ZodOptional<z.ZodUnknown>;
37
- }, z.ZodTypeAny, "passthrough">[] | undefined;
38
- }, {
39
- code?: string | undefined;
40
- type?: string | undefined;
41
- detail?: string | Record<string, unknown> | z.objectInputType<{
42
- msg: z.ZodString;
43
- type: z.ZodOptional<z.ZodString>;
44
- ctx: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
45
- loc: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">>;
46
- input: z.ZodOptional<z.ZodUnknown>;
47
- }, z.ZodTypeAny, "passthrough">[] | undefined;
48
- }>;
16
+ }, z.core.$strip>;
49
17
  export type ApiError = z.infer<typeof ApiErrorSchema>;
50
18
  /**
51
19
  * Structured validation error item from FastAPI/Pydantic
@@ -72,6 +40,9 @@ export declare class PhalaCloudError extends Error {
72
40
  ctx?: Record<string, unknown>;
73
41
  }>;
74
42
  readonly requestId?: string;
43
+ readonly request?: FetchRequest | undefined;
44
+ readonly requestMethod?: string | undefined;
45
+ readonly data?: unknown;
75
46
  /** Machine-readable error code (e.g. "TIMEOUT", HTTP status as string). */
76
47
  readonly code?: string;
77
48
  constructor(message: string, data: {
@@ -83,6 +54,9 @@ export declare class PhalaCloudError extends Error {
83
54
  ctx?: Record<string, unknown>;
84
55
  }>;
85
56
  requestId?: string;
57
+ request?: FetchRequest | undefined;
58
+ requestMethod?: string | undefined;
59
+ data?: unknown;
86
60
  code?: string;
87
61
  });
88
62
  }
@@ -95,6 +69,7 @@ export declare class RequestError extends PhalaCloudError implements ApiError {
95
69
  readonly isRequestError: true;
96
70
  readonly data?: unknown;
97
71
  readonly request?: FetchRequest | undefined;
72
+ readonly requestMethod?: string | undefined;
98
73
  readonly response?: Response | undefined;
99
74
  readonly type?: string | undefined;
100
75
  constructor(message: string, options?: {
@@ -102,6 +77,7 @@ export declare class RequestError extends PhalaCloudError implements ApiError {
102
77
  statusText?: string | undefined;
103
78
  data?: unknown;
104
79
  request?: FetchRequest | undefined;
80
+ requestMethod?: string | undefined;
105
81
  response?: Response | undefined;
106
82
  cause?: unknown;
107
83
  detail?: string | Record<string, unknown> | Array<{
@@ -123,7 +99,7 @@ export declare class RequestError extends PhalaCloudError implements ApiError {
123
99
  /**
124
100
  * Create RequestError from generic Error
125
101
  */
126
- static fromError(error: Error, request?: FetchRequest): RequestError;
102
+ static fromError(error: Error, request?: FetchRequest, requestMethod?: string): RequestError;
127
103
  }
128
104
  /**
129
105
  * Validation error from FastAPI/Pydantic (422)
@@ -145,6 +121,8 @@ export declare class ValidationError extends PhalaCloudError {
145
121
  [key: string]: unknown;
146
122
  }>;
147
123
  validationErrors: ValidationErrorItem[];
124
+ request?: FetchRequest | undefined;
125
+ data?: unknown;
148
126
  });
149
127
  }
150
128
  /**
@@ -289,12 +267,28 @@ export declare function formatErrorMessage(error: PhalaCloudError, options?: {
289
267
  export declare function getErrorMessage(error: ApiError): string;
290
268
  /**
291
269
  * Structured error detail from new error format (ERR-xxxx codes)
270
+ *
271
+ * `value` is typed as `unknown` because the backend contract says it should be
272
+ * a primitive (string / number / boolean) but in practice some errors emit
273
+ * dict / array values (e.g. HashRegistrationRequired carries `kms_info` and
274
+ * `onchain_status` as objects). Consumers that need a string should use
275
+ * {@link formatStructuredErrorDetailValue}; consumers that need the original
276
+ * structure (e.g. CLI extracting `commit_token`) should access `value` directly.
292
277
  */
293
278
  export interface StructuredErrorDetail {
294
279
  field?: string;
295
280
  value?: unknown;
296
281
  message?: string;
297
282
  }
283
+ /**
284
+ * Coerce a {@link StructuredErrorDetail} `value` to a renderable string.
285
+ *
286
+ * - `string` returned as-is
287
+ * - `number` / `boolean` stringified via `String(...)`
288
+ * - `null` / `undefined` returned as `""` so callers never interpolate `null` literally
289
+ * - anything else (dict, array) serialized via `JSON.stringify` with a fallback to `String(...)`
290
+ */
291
+ export declare function formatStructuredErrorDetailValue(value: unknown): string;
298
292
  /**
299
293
  * Error link from structured error response
300
294
  */
@@ -338,6 +332,9 @@ export declare class ResourceError extends BusinessError {
338
332
  [key: string]: unknown;
339
333
  }>;
340
334
  requestId?: string;
335
+ request?: FetchRequest | undefined;
336
+ requestMethod?: string | undefined;
337
+ data?: unknown;
341
338
  errorCode?: string;
342
339
  structuredDetails?: StructuredErrorDetail[];
343
340
  suggestions?: string[];
@@ -5,15 +5,70 @@ export interface SortableObject {
5
5
  export interface SortableArray extends Array<SortableValue> {
6
6
  }
7
7
  export declare function sortObject(obj: SortableValue): SortableValue;
8
+ export type KeyProviderKind = "none" | "kms" | "local" | "tpm";
9
+ export interface DockerConfig extends SortableObject {
10
+ registry?: string;
11
+ username?: string;
12
+ token_key?: string;
13
+ }
8
14
  export interface AppCompose extends SortableObject {
15
+ manifest_version?: number | string;
16
+ name?: string;
17
+ features?: string[];
9
18
  runner?: string;
10
19
  docker_compose_file?: string;
11
- bash_script?: string;
12
- pre_launch_script?: string;
20
+ docker_config?: DockerConfig;
21
+ public_logs?: boolean;
22
+ public_sysinfo?: boolean;
23
+ public_tcbinfo?: boolean;
24
+ kms_enabled?: boolean;
25
+ gateway_enabled?: boolean;
26
+ tproxy_enabled?: boolean;
27
+ local_key_provider_enabled?: boolean;
28
+ key_provider?: KeyProviderKind;
29
+ key_provider_id?: string;
30
+ allowed_envs?: string[];
31
+ no_instance_id?: boolean;
32
+ secure_time?: boolean;
33
+ storage_fs?: string;
34
+ swap_size?: string;
35
+ bash_script?: string | null;
36
+ pre_launch_script?: string | null;
37
+ init_script?: string | string[];
38
+ storage_discard?: boolean | null;
39
+ event_log_version?: number | null;
40
+ snapshotter?: string | null;
41
+ verity_volumes?: SortableArray | null;
42
+ requirements?: SortableObject | null;
43
+ port_policy?: SortableObject | null;
13
44
  }
14
- export declare function preprocessAppCompose(dic: AppCompose): AppCompose;
45
+ /**
46
+ * Apply the same normalization as the Phala Cloud backend before hashing:
47
+ * drop the script field the runner does not use, drop optional fields that are
48
+ * null (or empty for string fields), and always emit `tproxy_enabled`.
49
+ *
50
+ * With `osImageVersion` (the OS image the CVM runs, e.g. "0.6.0"), also write
51
+ * the OS-dependent wire format: below 0.6.0, `manifest_version` 2 and
52
+ * `init_script` as a single string (omitted when empty); from 0.6.0,
53
+ * `manifest_version` "3" and `init_script` as a list. Without it,
54
+ * `manifest_version` and `init_script` are hashed as given, which is right for
55
+ * a compose read back from Phala Cloud.
56
+ */
57
+ export declare function preprocessAppCompose(dic: AppCompose, osImageVersion?: string): AppCompose;
58
+ /**
59
+ * Serialize like the backend: sorted keys, compact separators, and non-ASCII
60
+ * text left as UTF-8. Nested keys are sorted too, which matches the backend
61
+ * because its nested models declare their fields alphabetically.
62
+ */
15
63
  export declare function dumpAppCompose(dic: AppCompose): string;
16
- export declare function getComposeHash(app_compose: AppCompose): string;
64
+ /**
65
+ * Compute the compose hash exactly as the Phala Cloud backend does.
66
+ *
67
+ * Pass `osImageVersion` when hashing a compose you built yourself, so the
68
+ * OS-dependent `manifest_version` and `init_script` wire format is applied (see
69
+ * `preprocessAppCompose`).
70
+ */
71
+ export declare function getComposeHash(app_compose: AppCompose, osImageVersion?: string): string;
17
72
  /**
18
73
  * Attach utility methods to an AppCompose-compatible object
19
74
  *
@@ -0,0 +1,146 @@
1
+ import { type Hex } from "viem";
2
+ /**
3
+ * Key provider kind, encoded as a single byte for mr_config_id computation.
4
+ *
5
+ * Maps to dstack-types KeyProviderKind:
6
+ * - None = 0
7
+ * - Local = 1
8
+ * - Kms = 2
9
+ * - Tpm = 3
10
+ */
11
+ declare const KEY_PROVIDER_BYTE: {
12
+ readonly none: 0;
13
+ readonly local: 1;
14
+ readonly kms: 2;
15
+ readonly tpm: 3;
16
+ };
17
+ export type KeyProviderKind = keyof typeof KEY_PROVIDER_BYTE;
18
+ export interface MrConfigIdInput {
19
+ /** SHA-256 compose hash, 32 bytes as 0x-prefixed hex */
20
+ compose_hash: Hex;
21
+ /** Application ID, 20 bytes as 0x-prefixed hex */
22
+ app_id: Hex;
23
+ /** Key provider kind */
24
+ key_provider_type: KeyProviderKind;
25
+ /** Key provider identity (CA pubkey for KMS, MR enclave for local-sgx, empty for none), hex bytes */
26
+ key_provider_id: Hex;
27
+ }
28
+ /**
29
+ * Compute mr_config_id V1 from compose_hash alone.
30
+ *
31
+ * Used when key_provider_id is empty (no key provider configured).
32
+ * Format: 0x01 || compose_hash (32 bytes) || zeros (15 bytes)
33
+ */
34
+ export declare function getMrConfigIdV1(composeHash: Hex): Hex;
35
+ /**
36
+ * Compute mr_config_id V2 from compose_hash, app_id, key_provider_type
37
+ * and key_provider_id.
38
+ *
39
+ * LEGACY VMMs ONLY. dstack stopped generating V2 for new VMs: a TDX VM that
40
+ * declares `key_provider_id` now measures MrConfigV3, and V2 survives only as
41
+ * the fallback for VMs that predate the stored mr_config document
42
+ * (`dstack/vmm/src/app/mr_config.rs`). Keep it for verifying those quotes;
43
+ * never use it to describe a new deployment.
44
+ *
45
+ * Mirrors dstack-types/src/mr_config.rs MrConfig::V2::to_mr_config_id().
46
+ *
47
+ * Hash input (concatenated raw bytes):
48
+ * - compose_hash: [u8; 32]
49
+ * - app_id: [u8; 20]
50
+ * - key_provider_type: u8 (none=0, local=1, kms=2, tpm=3)
51
+ * - key_provider_id: [u8] (variable length, hex-decoded)
52
+ *
53
+ * Output: 0x02 || keccak256(above) (32 bytes) || zeros (15 bytes) = 48 bytes
54
+ */
55
+ export declare function getMrConfigId(input: MrConfigIdInput): Hex;
56
+ /** dstack refuses to bind more than this many init scripts. */
57
+ export declare const MAX_INIT_SCRIPTS = 5;
58
+ /**
59
+ * The MrConfigV3 document, field for field as dstack serializes it
60
+ * (`dstack-types/src/mr_config.rs` `MrConfigV3`).
61
+ *
62
+ * Byte fields carry the exact spelling the canonical JSON uses: lowercase hex,
63
+ * no `0x` prefix. Optional fields are absent — never null, never empty — which
64
+ * is what `#[skip_serializing_none]` produces on the Rust side.
65
+ */
66
+ export interface MrConfigV3Document {
67
+ /** Always 3, and the only numeric field in the document. */
68
+ version: 3;
69
+ app_id?: string;
70
+ compose_hash: string;
71
+ gpu_policy_hash?: string;
72
+ key_provider: KeyProviderKind;
73
+ key_provider_id?: string;
74
+ instance_id?: string;
75
+ /** Present only for manifest_version >= 3; an empty list is meaningful. */
76
+ init_script_hashes?: string[];
77
+ }
78
+ /** Loose inputs accepted when building a document: `0x`-prefixed or bare hex. */
79
+ export interface MrConfigV3Input {
80
+ /** 20 bytes. Absent or empty means dstack pins no application identity. */
81
+ app_id?: string;
82
+ /** 32 bytes. */
83
+ compose_hash: string;
84
+ /** 32 bytes. Present only when the VM has GPUs attached. */
85
+ gpu_policy_hash?: string;
86
+ key_provider: KeyProviderKind;
87
+ /** Variable length. Absent or empty for `key_provider: "none"`. */
88
+ key_provider_id?: string;
89
+ /** 20 bytes. Absent when the compose sets `no_instance_id`. */
90
+ instance_id?: string;
91
+ /** 32 bytes each, in execution order. Absent disables the check. */
92
+ init_script_hashes?: string[];
93
+ }
94
+ /**
95
+ * Build the MrConfigV3 document dstack would generate for these inputs.
96
+ *
97
+ * Mirrors `VmWorkDir::prepare_mr_config_v3` in `dstack/vmm/src/app/mr_config.rs`:
98
+ * empty optional byte fields are dropped rather than serialized as empty
99
+ * strings, so a `no_instance_id` compose yields a document with no
100
+ * `instance_id` key at all.
101
+ */
102
+ export declare function buildMrConfigV3Document(input: MrConfigV3Input): MrConfigV3Document;
103
+ /**
104
+ * RFC 8785 (JCS) serialization of an MrConfigV3 document, byte for byte what
105
+ * `serde_jcs::to_string` produces for the Rust struct.
106
+ *
107
+ * The document is a flat object whose values are hex strings, one enum string,
108
+ * one small integer, and an array of hex strings. That means JCS reduces to
109
+ * three rules here: sort the member names by UTF-16 code unit (which is what
110
+ * `Array.prototype.sort` does), emit no whitespace, and print the one number as
111
+ * a bare integer. No value needs JSON string escaping, because every string is
112
+ * `[0-9a-f]*` or one of `none`/`kms`/`local`/`tpm`.
113
+ */
114
+ export declare function canonicalizeMrConfigV3Document(document: MrConfigV3Document): string;
115
+ /**
116
+ * Compute the TDX mr_config_id V3 for a document.
117
+ *
118
+ * Output: 0x03 || sha256(domain ‖ 0x00 ‖ JCS(document)) (32 bytes) || zeros (15 bytes).
119
+ *
120
+ * Mirrors `MrConfigV3::tdx_mr_config_id_from_document` in
121
+ * `dstack-types/src/mr_config.rs`.
122
+ */
123
+ export declare function getMrConfigIdV3(document: MrConfigV3Document): Hex;
124
+ /**
125
+ * Compute the AMD SEV-SNP `host_data` for a document: the same 32-byte digest
126
+ * as `getMrConfigIdV3`, carried without the version byte or the padding.
127
+ */
128
+ export declare function getSnpHostDataV3(document: MrConfigV3Document): Hex;
129
+ /** Everything `verifyMrConfigId` may need, across all three layouts. */
130
+ export interface MrConfigVerifyInput extends MrConfigIdInput {
131
+ /** V3 only: present when the VM has GPUs attached. */
132
+ gpu_policy_hash?: Hex;
133
+ /** V3 only: absent when the compose sets `no_instance_id`. */
134
+ instance_id?: Hex;
135
+ /** V3 only: present when the compose is manifest_version >= 3. */
136
+ init_script_hashes?: Hex[];
137
+ }
138
+ /**
139
+ * Verify a mr_config_id against the inputs it should have been derived from.
140
+ *
141
+ * The version byte decides the layout, so a single call verifies quotes from
142
+ * legacy VMMs (V1 compose-hash-only, V2 keccak) and current ones (V3 document
143
+ * digest) alike.
144
+ */
145
+ export declare function verifyMrConfigId(mrConfigId: Hex, input: MrConfigVerifyInput): boolean;
146
+ export {};
@@ -1,9 +1,10 @@
1
1
  export { encryptEnvVars } from "@phala/dstack-sdk/encrypt-env-vars";
2
- export { getComposeHash, dumpAppCompose, preprocessAppCompose, sortObject, withComposeMethods, type AppCompose, type AppComposeWithMethods, type SortableValue, type SortableObject, type SortableArray, } from "./get_compose_hash";
2
+ export { getComposeHash, dumpAppCompose, preprocessAppCompose, sortObject, withComposeMethods, type AppCompose, type AppComposeWithMethods, type DockerConfig, type KeyProviderKind, type SortableValue, type SortableObject, type SortableArray, } from "./get_compose_hash";
3
+ export { buildMrConfigV3Document, canonicalizeMrConfigV3Document, getMrConfigId, getMrConfigIdV1, getMrConfigIdV3, getSnpHostDataV3, verifyMrConfigId, MAX_INIT_SCRIPTS, type MrConfigIdInput, type MrConfigV3Document, type MrConfigV3Input, type MrConfigVerifyInput, type KeyProviderKind as MrConfigKeyProviderKind, } from "./get_mr_config_id";
3
4
  export { asHex } from "./as-hex";
4
5
  export { validateActionParameters, safeValidateActionParameters } from "./validate-parameters";
5
6
  export { isValidHostname, convertToHostname, generateFallbackHostname, generateDefaultCvmName, } from "./hostname";
6
- export { parseApiError, PhalaCloudError, RequestError, ValidationError, AuthError, BusinessError, ServerError, UnknownError, ResourceError, formatValidationErrors, formatErrorMessage, formatStructuredError, getErrorMessage, isConflictError, isAppIdConflictError, getValidationFields, type ValidationErrorItem, type StructuredErrorDetail, type ErrorLink, type StructuredErrorResponse, ApiErrorSchema, type ApiError, } from "./errors";
7
+ export { parseApiError, PhalaCloudError, RequestError, ValidationError, AuthError, BusinessError, ServerError, UnknownError, ResourceError, formatValidationErrors, formatErrorMessage, formatStructuredError, formatStructuredErrorDetailValue, getErrorMessage, isConflictError, isAppIdConflictError, getValidationFields, type ValidationErrorItem, type StructuredErrorDetail, type ErrorLink, type StructuredErrorResponse, ApiErrorSchema, type ApiError, } from "./errors";
7
8
  export { ErrorCodes, type ErrorCode } from "./error_codes";
8
9
  export { createNetworkClients, extractNetworkClients, checkNetworkStatus, checkBalance, validateNetworkPrerequisites, waitForTransactionReceipt, executeTransaction, NetworkError, WalletError, TransactionError, type NetworkConfig, type WalletConnection, type NetworkClients, type BalanceCheckResult, type TransactionOptions, type TransactionResult, } from "./network";
9
10
  export { createTransactionTracker, executeBatchTransactions, executeTransactionWithRetry, estimateTransactionGas, type TransactionState, type TransactionStatus, type TransactionTracker, type BatchTransactionOptions, type BatchTransactionResult, type RetryOptions, type GasEstimationOptions, } from "./transaction";
@@ -0,0 +1,3 @@
1
+ import { z } from "zod";
2
+ /** Reject legacy placement keys before object schemas strip unknown fields. */
3
+ export declare function placementRequest<T extends z.ZodTypeAny>(schema: T): z.ZodPipe<z.ZodUnknown, T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phala/cloud",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "TypeScript SDK for Phala Cloud API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -47,8 +47,8 @@
47
47
  "debug": "^4.4.1",
48
48
  "mitt": "^3.0.1",
49
49
  "ofetch": "^1.3.3",
50
- "viem": "^2.7.0",
51
- "zod": "^3.24.1"
50
+ "viem": "^2.55.8",
51
+ "zod": "^4.6.7"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@biomejs/biome": "^1.9.4",
@@ -57,7 +57,7 @@
57
57
  "dotenv": "^16.5.0",
58
58
  "tsup": "^8.5.1",
59
59
  "typescript": "^5.3.0",
60
- "vitest": "^1.0.0"
60
+ "vitest": "^4.1.12"
61
61
  },
62
62
  "peerDependencies": {
63
63
  "typescript": ">=4.5.0"