@phala/cloud 0.2.5 → 0.2.9
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/dist/actions/apps/check_app_cvms_is_allowed.d.ts +164 -0
- package/dist/actions/apps/check_app_is_allowed.d.ts +109 -0
- package/dist/actions/apps/create_app_instance.d.ts +196 -0
- package/dist/actions/apps/get_app_device_allowlist.d.ts +2 -2
- package/dist/actions/blockchains/abi/dstack_app.d.ts +30 -0
- package/dist/actions/blockchains/check_compose_hash_allowed.d.ts +43 -0
- package/dist/actions/blockchains/check_on_chain_prerequisites.d.ts +59 -0
- package/dist/actions/cvms/check_cvm_is_allowed.d.ts +145 -0
- package/dist/actions/cvms/commit_cvm_provision.d.ts +19 -0
- package/dist/actions/cvms/commit_cvm_update.d.ts +100 -0
- package/dist/actions/cvms/confirm_cvm_patch.d.ts +92 -0
- package/dist/actions/cvms/patch_cvm.d.ts +447 -0
- package/dist/actions/cvms/provision_cvm_compose_file_update.d.ts +8 -0
- package/dist/actions/index.d.ts +9 -0
- package/dist/client.d.ts +5 -0
- package/dist/index.js +741 -191
- package/dist/index.mjs +710 -191
- package/dist/types/app_info_v20260121.d.ts +90 -6
- package/dist/types/cvm_info_v20260121.d.ts +60 -4
- package/dist/utils/error_codes.d.ts +48 -0
- package/dist/utils/errors.d.ts +9 -0
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/verify-webhook.d.ts +35 -0
- package/dist/webhook.d.ts +11 -0
- package/dist/webhook.js +68 -0
- package/dist/webhook.mjs +40 -0
- package/package.json +7 -2
package/dist/index.mjs
CHANGED
|
@@ -56,13 +56,14 @@ var RequestError = class _RequestError extends PhalaCloudError {
|
|
|
56
56
|
static fromFetchError(error) {
|
|
57
57
|
const parseResult = ApiErrorSchema.safeParse(error.data);
|
|
58
58
|
if (parseResult.success) {
|
|
59
|
+
const detail = parseResult.data.detail ?? (error.data && typeof error.data === "object" && "error_code" in error.data ? error.data : void 0);
|
|
59
60
|
return new _RequestError(error.message, {
|
|
60
61
|
status: error.status ?? void 0,
|
|
61
62
|
statusText: error.statusText ?? void 0,
|
|
62
63
|
data: error.data,
|
|
63
64
|
request: error.request ?? void 0,
|
|
64
65
|
response: error.response ?? void 0,
|
|
65
|
-
detail
|
|
66
|
+
detail,
|
|
66
67
|
code: parseResult.data.code ?? void 0,
|
|
67
68
|
type: parseResult.data.type ?? void 0
|
|
68
69
|
});
|
|
@@ -331,6 +332,12 @@ function formatStructuredError(error, options) {
|
|
|
331
332
|
}
|
|
332
333
|
return parts.join("\n");
|
|
333
334
|
}
|
|
335
|
+
function isConflictError(error) {
|
|
336
|
+
return error.status === 409;
|
|
337
|
+
}
|
|
338
|
+
function isAppIdConflictError(error) {
|
|
339
|
+
return error instanceof ResourceError && error.errorCode === "ERR-03-007";
|
|
340
|
+
}
|
|
334
341
|
|
|
335
342
|
// src/client.ts
|
|
336
343
|
var SUPPORTED_API_VERSIONS = [
|
|
@@ -394,8 +401,20 @@ var Client = class _Client {
|
|
|
394
401
|
headers: requestHeaders,
|
|
395
402
|
...useCookieAuth ? { credentials: "include" } : {},
|
|
396
403
|
...fetchOptions,
|
|
397
|
-
//
|
|
404
|
+
// Strip Content-Type for FormData so the browser/runtime sets
|
|
405
|
+
// the correct multipart/form-data boundary automatically.
|
|
406
|
+
// This runs after ofetch merges instance and per-request headers,
|
|
407
|
+
// so deleting here is final.
|
|
398
408
|
onRequest({ request, options }) {
|
|
409
|
+
if (options.body instanceof FormData) {
|
|
410
|
+
const h = options.headers;
|
|
411
|
+
if (h instanceof Headers) {
|
|
412
|
+
h.delete("content-type");
|
|
413
|
+
} else if (h && typeof h === "object" && !Array.isArray(h)) {
|
|
414
|
+
delete h["Content-Type"];
|
|
415
|
+
delete h["content-type"];
|
|
416
|
+
}
|
|
417
|
+
}
|
|
399
418
|
if (logger.enabled) {
|
|
400
419
|
const method = options.method || "GET";
|
|
401
420
|
const url = typeof request === "string" ? request : request.url;
|
|
@@ -527,16 +546,28 @@ var Client = class _Client {
|
|
|
527
546
|
throw phalaCloudError;
|
|
528
547
|
}
|
|
529
548
|
}
|
|
549
|
+
/**
|
|
550
|
+
* Build request options, stripping Content-Type when body is FormData
|
|
551
|
+
* so the browser/runtime sets the correct multipart boundary automatically.
|
|
552
|
+
*/
|
|
553
|
+
// biome-ignore lint/suspicious/noExplicitAny: ofetch generic variance
|
|
554
|
+
buildRequestOptions(method, body, options) {
|
|
555
|
+
const opts = { ...options, method, body };
|
|
556
|
+
if (body instanceof FormData) {
|
|
557
|
+
const existing = opts.headers;
|
|
558
|
+
opts.headers = {
|
|
559
|
+
...existing,
|
|
560
|
+
"Content-Type": ""
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
return opts;
|
|
564
|
+
}
|
|
530
565
|
/**
|
|
531
566
|
* Perform POST request (throws PhalaCloudError on error)
|
|
532
567
|
*/
|
|
533
568
|
async post(request, body, options) {
|
|
534
569
|
try {
|
|
535
|
-
return await this.fetchInstance(request,
|
|
536
|
-
...options,
|
|
537
|
-
method: "POST",
|
|
538
|
-
body
|
|
539
|
-
});
|
|
570
|
+
return await this.fetchInstance(request, this.buildRequestOptions("POST", body, options));
|
|
540
571
|
} catch (error) {
|
|
541
572
|
const requestError = this.convertToRequestError(error);
|
|
542
573
|
const phalaCloudError = this.emitError(requestError);
|
|
@@ -548,11 +579,7 @@ var Client = class _Client {
|
|
|
548
579
|
*/
|
|
549
580
|
async put(request, body, options) {
|
|
550
581
|
try {
|
|
551
|
-
return await this.fetchInstance(request,
|
|
552
|
-
...options,
|
|
553
|
-
method: "PUT",
|
|
554
|
-
body
|
|
555
|
-
});
|
|
582
|
+
return await this.fetchInstance(request, this.buildRequestOptions("PUT", body, options));
|
|
556
583
|
} catch (error) {
|
|
557
584
|
const requestError = this.convertToRequestError(error);
|
|
558
585
|
const phalaCloudError = this.emitError(requestError);
|
|
@@ -564,11 +591,7 @@ var Client = class _Client {
|
|
|
564
591
|
*/
|
|
565
592
|
async patch(request, body, options) {
|
|
566
593
|
try {
|
|
567
|
-
return await this.fetchInstance(request,
|
|
568
|
-
...options,
|
|
569
|
-
method: "PATCH",
|
|
570
|
-
body
|
|
571
|
-
});
|
|
594
|
+
return await this.fetchInstance(request, this.buildRequestOptions("PATCH", body, options));
|
|
572
595
|
} catch (error) {
|
|
573
596
|
const requestError = this.convertToRequestError(error);
|
|
574
597
|
const phalaCloudError = this.emitError(requestError);
|
|
@@ -1222,7 +1245,7 @@ var CvmOsInfoV20260121Schema = z9.object({
|
|
|
1222
1245
|
is_dev: z9.boolean().nullable().optional(),
|
|
1223
1246
|
os_image_hash: z9.string().nullable().optional()
|
|
1224
1247
|
});
|
|
1225
|
-
var
|
|
1248
|
+
var CvmKmsInfoV20260121BaseSchema = z9.object({
|
|
1226
1249
|
chain_id: z9.number().int().nullable().optional(),
|
|
1227
1250
|
dstack_kms_address: z9.string().nullable().optional(),
|
|
1228
1251
|
dstack_app_address: z9.string().nullable().optional(),
|
|
@@ -1230,6 +1253,15 @@ var CvmKmsInfoV20260121Schema = z9.object({
|
|
|
1230
1253
|
rpc_endpoint: z9.string().nullable().optional(),
|
|
1231
1254
|
encrypted_env_pubkey: z9.string().nullable().optional()
|
|
1232
1255
|
});
|
|
1256
|
+
var CvmKmsInfoV20260121Schema = CvmKmsInfoV20260121BaseSchema.transform((data) => {
|
|
1257
|
+
if (data.chain_id != null) {
|
|
1258
|
+
const chain = SUPPORTED_CHAINS[data.chain_id];
|
|
1259
|
+
if (chain) {
|
|
1260
|
+
return { ...data, chain };
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
return data;
|
|
1264
|
+
});
|
|
1233
1265
|
var CvmProgressInfoV20260121Schema = z9.object({
|
|
1234
1266
|
target: z9.string().nullable().optional(),
|
|
1235
1267
|
started_at: z9.string().nullable().optional(),
|
|
@@ -1745,7 +1777,8 @@ var ProvisionCvmComposeFileUpdateResultSchema = z15.object({
|
|
|
1745
1777
|
app_id: z15.string().nullable(),
|
|
1746
1778
|
device_id: z15.string().nullable(),
|
|
1747
1779
|
compose_hash: z15.string(),
|
|
1748
|
-
kms_info: KmsInfoSchema.nullable().optional()
|
|
1780
|
+
kms_info: KmsInfoSchema.nullable().optional(),
|
|
1781
|
+
compose_hash_registered: z15.boolean().optional().default(false)
|
|
1749
1782
|
}).passthrough();
|
|
1750
1783
|
var { action: provisionCvmComposeFileUpdate, safeAction: safeProvisionCvmComposeFileUpdate } = defineAction(ProvisionCvmComposeFileUpdateResultSchema, async (client, request) => {
|
|
1751
1784
|
const validatedRequest = ProvisionCvmComposeFileUpdateRequestSchema.parse(request);
|
|
@@ -1852,14 +1885,24 @@ var { action: updateCvmEnvs, safeAction: safeUpdateCvmEnvs } = defineAction(Upda
|
|
|
1852
1885
|
const detail = error.detail;
|
|
1853
1886
|
if (detail && typeof detail === "object") {
|
|
1854
1887
|
const detailObj = detail;
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1888
|
+
const detailsArray = detailObj.details;
|
|
1889
|
+
if (detailsArray && Array.isArray(detailsArray)) {
|
|
1890
|
+
const fieldMap = new Map(detailsArray.map((d) => [d.field, d.value]));
|
|
1891
|
+
const composeHash = fieldMap.get("compose_hash");
|
|
1892
|
+
const appId = fieldMap.get("app_id");
|
|
1893
|
+
const deviceId = fieldMap.get("device_id");
|
|
1894
|
+
const kmsInfo = fieldMap.get("kms_info");
|
|
1895
|
+
if (composeHash && appId) {
|
|
1896
|
+
return {
|
|
1897
|
+
status: "precondition_required",
|
|
1898
|
+
message: detailObj.message || "Compose hash verification required",
|
|
1899
|
+
compose_hash: composeHash,
|
|
1900
|
+
app_id: appId,
|
|
1901
|
+
device_id: deviceId || "",
|
|
1902
|
+
kms_info: kmsInfo
|
|
1903
|
+
};
|
|
1904
|
+
}
|
|
1905
|
+
}
|
|
1863
1906
|
}
|
|
1864
1907
|
}
|
|
1865
1908
|
throw error;
|
|
@@ -1926,14 +1969,24 @@ var { action: updateDockerCompose, safeAction: safeUpdateDockerCompose } = defin
|
|
|
1926
1969
|
const detail = error.detail;
|
|
1927
1970
|
if (detail && typeof detail === "object") {
|
|
1928
1971
|
const detailObj = detail;
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1972
|
+
const detailsArray = detailObj.details;
|
|
1973
|
+
if (detailsArray && Array.isArray(detailsArray)) {
|
|
1974
|
+
const fieldMap = new Map(detailsArray.map((d) => [d.field, d.value]));
|
|
1975
|
+
const composeHash = fieldMap.get("compose_hash");
|
|
1976
|
+
const appId = fieldMap.get("app_id");
|
|
1977
|
+
const deviceId = fieldMap.get("device_id");
|
|
1978
|
+
const kmsInfo = fieldMap.get("kms_info");
|
|
1979
|
+
if (composeHash && appId) {
|
|
1980
|
+
return {
|
|
1981
|
+
status: "precondition_required",
|
|
1982
|
+
message: detailObj.message || "Compose hash verification required",
|
|
1983
|
+
compose_hash: composeHash,
|
|
1984
|
+
app_id: appId,
|
|
1985
|
+
device_id: deviceId || "",
|
|
1986
|
+
kms_info: kmsInfo
|
|
1987
|
+
};
|
|
1988
|
+
}
|
|
1989
|
+
}
|
|
1937
1990
|
}
|
|
1938
1991
|
}
|
|
1939
1992
|
throw error;
|
|
@@ -2000,14 +2053,24 @@ var { action: updatePreLaunchScript, safeAction: safeUpdatePreLaunchScript } = d
|
|
|
2000
2053
|
const detail = error.detail;
|
|
2001
2054
|
if (detail && typeof detail === "object") {
|
|
2002
2055
|
const detailObj = detail;
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2056
|
+
const detailsArray = detailObj.details;
|
|
2057
|
+
if (detailsArray && Array.isArray(detailsArray)) {
|
|
2058
|
+
const fieldMap = new Map(detailsArray.map((d) => [d.field, d.value]));
|
|
2059
|
+
const composeHash = fieldMap.get("compose_hash");
|
|
2060
|
+
const appId = fieldMap.get("app_id");
|
|
2061
|
+
const deviceId = fieldMap.get("device_id");
|
|
2062
|
+
const kmsInfo = fieldMap.get("kms_info");
|
|
2063
|
+
if (composeHash && appId) {
|
|
2064
|
+
return {
|
|
2065
|
+
status: "precondition_required",
|
|
2066
|
+
message: detailObj.message || "Compose hash verification required",
|
|
2067
|
+
compose_hash: composeHash,
|
|
2068
|
+
app_id: appId,
|
|
2069
|
+
device_id: deviceId || "",
|
|
2070
|
+
kms_info: kmsInfo
|
|
2071
|
+
};
|
|
2072
|
+
}
|
|
2073
|
+
}
|
|
2011
2074
|
}
|
|
2012
2075
|
}
|
|
2013
2076
|
throw error;
|
|
@@ -2859,6 +2922,51 @@ function asHex(value) {
|
|
|
2859
2922
|
throw new Error(`Invalid hex value: ${value}`);
|
|
2860
2923
|
}
|
|
2861
2924
|
|
|
2925
|
+
// src/utils/error_codes.ts
|
|
2926
|
+
var ErrorCodes = {
|
|
2927
|
+
// Module 01: CVM Preflight & Compose Hash
|
|
2928
|
+
NODE_NOT_FOUND: "ERR-01-001",
|
|
2929
|
+
COMPOSE_FILE_REQUIRED: "ERR-01-002",
|
|
2930
|
+
INVALID_COMPOSE_FILE: "ERR-01-003",
|
|
2931
|
+
DUPLICATE_CVM_NAME: "ERR-01-004",
|
|
2932
|
+
HASH_REGISTRATION_REQUIRED: "ERR-01-005",
|
|
2933
|
+
HASH_INVALID_OR_EXPIRED: "ERR-01-006",
|
|
2934
|
+
TX_VERIFICATION_FAILED: "ERR-01-007",
|
|
2935
|
+
HASH_NOT_ALLOWED: "ERR-01-008",
|
|
2936
|
+
// Module 02: Inventory
|
|
2937
|
+
INSTANCE_TYPE_NOT_FOUND: "ERR-02-001",
|
|
2938
|
+
RESOURCE_NOT_AVAILABLE: "ERR-02-002",
|
|
2939
|
+
INSUFFICIENT_VCPU: "ERR-02-003",
|
|
2940
|
+
INSUFFICIENT_MEMORY: "ERR-02-004",
|
|
2941
|
+
INSUFFICIENT_SLOTS: "ERR-02-005",
|
|
2942
|
+
GPU_ALLOCATION_ERROR: "ERR-02-006",
|
|
2943
|
+
INSUFFICIENT_GPU: "ERR-02-007",
|
|
2944
|
+
INVALID_REQUEST: "ERR-02-008",
|
|
2945
|
+
INCOMPATIBLE_CONFIG: "ERR-02-009",
|
|
2946
|
+
IMAGE_NOT_FOUND: "ERR-02-010",
|
|
2947
|
+
KMS_NOT_FOUND: "ERR-02-011",
|
|
2948
|
+
TEEPOD_NOT_ACCESSIBLE: "ERR-02-012",
|
|
2949
|
+
OS_IMAGE_NOT_COMPATIBLE: "ERR-02-013",
|
|
2950
|
+
NODE_CAPACITY_NOT_CONFIGURED: "ERR-02-014",
|
|
2951
|
+
QUOTA_EXCEEDED: "ERR-02-015",
|
|
2952
|
+
// Module 03: CVM Operations
|
|
2953
|
+
CVM_NOT_FOUND: "ERR-03-001",
|
|
2954
|
+
MULTIPLE_CVMS_SAME_NAME: "ERR-03-002",
|
|
2955
|
+
CVM_NOT_IN_WORKSPACE: "ERR-03-003",
|
|
2956
|
+
CVM_ACCESS_DENIED: "ERR-03-005",
|
|
2957
|
+
REPLICA_IMAGE_NOT_AVAILABLE: "ERR-03-006",
|
|
2958
|
+
CVM_APP_ID_CONFLICT: "ERR-03-007",
|
|
2959
|
+
// Module 04: Workspace
|
|
2960
|
+
INSUFFICIENT_BALANCE: "ERR-04-001",
|
|
2961
|
+
MAX_CVM_LIMIT: "ERR-04-002",
|
|
2962
|
+
RESOURCE_LIMIT_EXCEEDED: "ERR-04-003",
|
|
2963
|
+
// Module 05: Credentials
|
|
2964
|
+
TOKEN_LIMIT_EXCEEDED: "ERR-05-001",
|
|
2965
|
+
TOKEN_RATE_LIMIT: "ERR-05-002",
|
|
2966
|
+
// Module 06: Auth
|
|
2967
|
+
OAUTH_EMAIL_INVALID: "ERR-06-001"
|
|
2968
|
+
};
|
|
2969
|
+
|
|
2862
2970
|
// src/utils/network.ts
|
|
2863
2971
|
var NetworkError = class extends Error {
|
|
2864
2972
|
constructor(message, code, details) {
|
|
@@ -3997,6 +4105,24 @@ async function addComposeHash(request, parameters) {
|
|
|
3997
4105
|
);
|
|
3998
4106
|
}
|
|
3999
4107
|
}
|
|
4108
|
+
const contractOwner = await publicClient.readContract({
|
|
4109
|
+
address: appAuthAddress,
|
|
4110
|
+
abi: [
|
|
4111
|
+
{
|
|
4112
|
+
inputs: [],
|
|
4113
|
+
name: "owner",
|
|
4114
|
+
outputs: [{ type: "address" }],
|
|
4115
|
+
stateMutability: "view",
|
|
4116
|
+
type: "function"
|
|
4117
|
+
}
|
|
4118
|
+
],
|
|
4119
|
+
functionName: "owner"
|
|
4120
|
+
});
|
|
4121
|
+
if (contractOwner.toLowerCase() !== address.toLowerCase()) {
|
|
4122
|
+
throw new Error(
|
|
4123
|
+
`Sender ${address} is not the owner of contract ${appAuthAddress}. Contract owner is ${contractOwner}.`
|
|
4124
|
+
);
|
|
4125
|
+
}
|
|
4000
4126
|
const addComposeHashOperation = async (clients) => {
|
|
4001
4127
|
const hash = await clients.walletClient.writeContract({
|
|
4002
4128
|
address: appAuthAddress,
|
|
@@ -4114,6 +4240,24 @@ var dstackAppAbi = [
|
|
|
4114
4240
|
stateMutability: "view",
|
|
4115
4241
|
type: "function"
|
|
4116
4242
|
},
|
|
4243
|
+
{
|
|
4244
|
+
inputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
|
|
4245
|
+
name: "allowedComposeHashes",
|
|
4246
|
+
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
4247
|
+
stateMutability: "view",
|
|
4248
|
+
type: "function"
|
|
4249
|
+
},
|
|
4250
|
+
// ── Errors ───────────────────────────────────────────────────────
|
|
4251
|
+
{
|
|
4252
|
+
inputs: [{ internalType: "address", name: "owner", type: "address" }],
|
|
4253
|
+
name: "OwnableInvalidOwner",
|
|
4254
|
+
type: "error"
|
|
4255
|
+
},
|
|
4256
|
+
{
|
|
4257
|
+
inputs: [{ internalType: "address", name: "account", type: "address" }],
|
|
4258
|
+
name: "OwnableUnauthorizedAccount",
|
|
4259
|
+
type: "error"
|
|
4260
|
+
},
|
|
4117
4261
|
// ── Events ───────────────────────────────────────────────────────
|
|
4118
4262
|
{
|
|
4119
4263
|
anonymous: false,
|
|
@@ -4199,17 +4343,21 @@ async function addDevice(request, parameters) {
|
|
|
4199
4343
|
let chainId;
|
|
4200
4344
|
if (privateKey) {
|
|
4201
4345
|
const account = privateKeyToAccount4(privateKey);
|
|
4202
|
-
|
|
4346
|
+
const transport = http4(rpcUrl, { timeout });
|
|
4347
|
+
publicClient = providedPublicClient ? providedPublicClient : createPublicClient4({ chain, transport });
|
|
4203
4348
|
walletClient = createWalletClient4({
|
|
4204
4349
|
account,
|
|
4205
4350
|
chain,
|
|
4206
|
-
transport
|
|
4351
|
+
transport
|
|
4207
4352
|
});
|
|
4208
4353
|
address = account.address;
|
|
4209
4354
|
chainId = chain.id;
|
|
4210
4355
|
} else if (providedWalletClient) {
|
|
4211
4356
|
walletClient = providedWalletClient;
|
|
4212
|
-
publicClient = providedPublicClient ? providedPublicClient : createPublicClient4({
|
|
4357
|
+
publicClient = providedPublicClient ? providedPublicClient : createPublicClient4({
|
|
4358
|
+
chain,
|
|
4359
|
+
transport: http4(rpcUrl, { timeout })
|
|
4360
|
+
});
|
|
4213
4361
|
if (!walletClient.account?.address) {
|
|
4214
4362
|
throw new Error("WalletClient must have an account with address");
|
|
4215
4363
|
}
|
|
@@ -4248,6 +4396,16 @@ async function addDevice(request, parameters) {
|
|
|
4248
4396
|
);
|
|
4249
4397
|
}
|
|
4250
4398
|
}
|
|
4399
|
+
const contractOwner = await publicClient.readContract({
|
|
4400
|
+
address: contractAddress,
|
|
4401
|
+
abi: dstackAppAbi,
|
|
4402
|
+
functionName: "owner"
|
|
4403
|
+
});
|
|
4404
|
+
if (contractOwner.toLowerCase() !== address.toLowerCase()) {
|
|
4405
|
+
throw new Error(
|
|
4406
|
+
`Sender ${address} is not the owner of contract ${contractAddress}. Contract owner is ${contractOwner}.`
|
|
4407
|
+
);
|
|
4408
|
+
}
|
|
4251
4409
|
const addDeviceOperation = async (clients) => {
|
|
4252
4410
|
return clients.walletClient.writeContract({
|
|
4253
4411
|
address: contractAddress,
|
|
@@ -4375,17 +4533,21 @@ async function removeDevice(request, parameters) {
|
|
|
4375
4533
|
let chainId;
|
|
4376
4534
|
if (privateKey) {
|
|
4377
4535
|
const account = privateKeyToAccount5(privateKey);
|
|
4378
|
-
|
|
4536
|
+
const transport = http5(rpcUrl, { timeout });
|
|
4537
|
+
publicClient = providedPublicClient ? providedPublicClient : createPublicClient5({ chain, transport });
|
|
4379
4538
|
walletClient = createWalletClient5({
|
|
4380
4539
|
account,
|
|
4381
4540
|
chain,
|
|
4382
|
-
transport
|
|
4541
|
+
transport
|
|
4383
4542
|
});
|
|
4384
4543
|
address = account.address;
|
|
4385
4544
|
chainId = chain.id;
|
|
4386
4545
|
} else if (providedWalletClient) {
|
|
4387
4546
|
walletClient = providedWalletClient;
|
|
4388
|
-
publicClient = providedPublicClient ? providedPublicClient : createPublicClient5({
|
|
4547
|
+
publicClient = providedPublicClient ? providedPublicClient : createPublicClient5({
|
|
4548
|
+
chain,
|
|
4549
|
+
transport: http5(rpcUrl, { timeout })
|
|
4550
|
+
});
|
|
4389
4551
|
if (!walletClient.account?.address) {
|
|
4390
4552
|
throw new Error("WalletClient must have an account with address");
|
|
4391
4553
|
}
|
|
@@ -4550,17 +4712,21 @@ async function setAllowAnyDevice(request, parameters) {
|
|
|
4550
4712
|
let chainId;
|
|
4551
4713
|
if (privateKey) {
|
|
4552
4714
|
const account = privateKeyToAccount6(privateKey);
|
|
4553
|
-
|
|
4715
|
+
const transport = http6(rpcUrl, { timeout });
|
|
4716
|
+
publicClient = providedPublicClient ? providedPublicClient : createPublicClient6({ chain, transport });
|
|
4554
4717
|
walletClient = createWalletClient6({
|
|
4555
4718
|
account,
|
|
4556
4719
|
chain,
|
|
4557
|
-
transport
|
|
4720
|
+
transport
|
|
4558
4721
|
});
|
|
4559
4722
|
address = account.address;
|
|
4560
4723
|
chainId = chain.id;
|
|
4561
4724
|
} else if (providedWalletClient) {
|
|
4562
4725
|
walletClient = providedWalletClient;
|
|
4563
|
-
publicClient = providedPublicClient ? providedPublicClient : createPublicClient6({
|
|
4726
|
+
publicClient = providedPublicClient ? providedPublicClient : createPublicClient6({
|
|
4727
|
+
chain,
|
|
4728
|
+
transport: http6(rpcUrl, { timeout })
|
|
4729
|
+
});
|
|
4564
4730
|
if (!walletClient.account?.address) {
|
|
4565
4731
|
throw new Error("WalletClient must have an account with address");
|
|
4566
4732
|
}
|
|
@@ -4763,6 +4929,97 @@ async function safeCheckDeviceAllowed(request) {
|
|
|
4763
4929
|
}
|
|
4764
4930
|
}
|
|
4765
4931
|
|
|
4932
|
+
// src/actions/blockchains/check_compose_hash_allowed.ts
|
|
4933
|
+
import { createPublicClient as createPublicClient9, http as http9 } from "viem";
|
|
4934
|
+
async function checkComposeHashAllowed(request) {
|
|
4935
|
+
const { chain, rpcUrl, appAddress, composeHash, publicClient: providedPublicClient } = request;
|
|
4936
|
+
const contractAddress = appAddress.startsWith("0x") ? appAddress : `0x${appAddress}`;
|
|
4937
|
+
const composeHashHex = asHex(composeHash);
|
|
4938
|
+
const publicClient = providedPublicClient ? providedPublicClient : (() => {
|
|
4939
|
+
if (!chain) throw new Error("Chain is required when publicClient is not provided");
|
|
4940
|
+
return createPublicClient9({ chain, transport: http9(rpcUrl) });
|
|
4941
|
+
})();
|
|
4942
|
+
const allowed = await publicClient.readContract({
|
|
4943
|
+
address: contractAddress,
|
|
4944
|
+
abi: dstackAppAbi,
|
|
4945
|
+
functionName: "allowedComposeHashes",
|
|
4946
|
+
args: [composeHashHex]
|
|
4947
|
+
});
|
|
4948
|
+
return allowed;
|
|
4949
|
+
}
|
|
4950
|
+
async function safeCheckComposeHashAllowed(request) {
|
|
4951
|
+
try {
|
|
4952
|
+
const result = await checkComposeHashAllowed(request);
|
|
4953
|
+
return { success: true, data: result };
|
|
4954
|
+
} catch (error) {
|
|
4955
|
+
const errorMessage = error instanceof Error ? error.message : "Unknown blockchain error";
|
|
4956
|
+
return {
|
|
4957
|
+
success: false,
|
|
4958
|
+
error: { isRequestError: true, message: errorMessage, status: 500, detail: errorMessage }
|
|
4959
|
+
};
|
|
4960
|
+
}
|
|
4961
|
+
}
|
|
4962
|
+
|
|
4963
|
+
// src/actions/blockchains/check_on_chain_prerequisites.ts
|
|
4964
|
+
import { createPublicClient as createPublicClient10, http as http10 } from "viem";
|
|
4965
|
+
async function checkOnChainPrerequisites(request) {
|
|
4966
|
+
const {
|
|
4967
|
+
chain,
|
|
4968
|
+
rpcUrl,
|
|
4969
|
+
appAddress,
|
|
4970
|
+
deviceId,
|
|
4971
|
+
composeHash,
|
|
4972
|
+
publicClient: providedPublicClient
|
|
4973
|
+
} = request;
|
|
4974
|
+
const contractAddress = appAddress.startsWith("0x") ? appAddress : `0x${appAddress}`;
|
|
4975
|
+
const deviceIdHex = asHex(deviceId);
|
|
4976
|
+
const composeHashHex = asHex(composeHash);
|
|
4977
|
+
const publicClient = providedPublicClient ? providedPublicClient : (() => {
|
|
4978
|
+
if (!chain) throw new Error("Chain is required when publicClient is not provided");
|
|
4979
|
+
return createPublicClient10({ chain, transport: http10(rpcUrl) });
|
|
4980
|
+
})();
|
|
4981
|
+
const calls = [
|
|
4982
|
+
{
|
|
4983
|
+
address: contractAddress,
|
|
4984
|
+
abi: dstackAppAbi,
|
|
4985
|
+
functionName: "allowAnyDevice"
|
|
4986
|
+
},
|
|
4987
|
+
{
|
|
4988
|
+
address: contractAddress,
|
|
4989
|
+
abi: dstackAppAbi,
|
|
4990
|
+
functionName: "allowedDeviceIds",
|
|
4991
|
+
args: [deviceIdHex]
|
|
4992
|
+
},
|
|
4993
|
+
{
|
|
4994
|
+
address: contractAddress,
|
|
4995
|
+
abi: dstackAppAbi,
|
|
4996
|
+
functionName: "allowedComposeHashes",
|
|
4997
|
+
args: [composeHashHex]
|
|
4998
|
+
}
|
|
4999
|
+
];
|
|
5000
|
+
const multicallResults = await publicClient.multicall({ contracts: calls });
|
|
5001
|
+
const allowAnyDevice = multicallResults[0]?.status === "success" && multicallResults[0]?.result === true;
|
|
5002
|
+
const deviceIdAllowed = multicallResults[1]?.status === "success" && multicallResults[1]?.result === true;
|
|
5003
|
+
const composeHashAllowed = multicallResults[2]?.status === "success" && multicallResults[2]?.result === true;
|
|
5004
|
+
return {
|
|
5005
|
+
allowAnyDevice,
|
|
5006
|
+
deviceAllowed: allowAnyDevice || deviceIdAllowed,
|
|
5007
|
+
composeHashAllowed
|
|
5008
|
+
};
|
|
5009
|
+
}
|
|
5010
|
+
async function safeCheckOnChainPrerequisites(request) {
|
|
5011
|
+
try {
|
|
5012
|
+
const result = await checkOnChainPrerequisites(request);
|
|
5013
|
+
return { success: true, data: result };
|
|
5014
|
+
} catch (error) {
|
|
5015
|
+
const errorMessage = error instanceof Error ? error.message : "Unknown blockchain error";
|
|
5016
|
+
return {
|
|
5017
|
+
success: false,
|
|
5018
|
+
error: { isRequestError: true, message: errorMessage, status: 500, detail: errorMessage }
|
|
5019
|
+
};
|
|
5020
|
+
}
|
|
5021
|
+
}
|
|
5022
|
+
|
|
4766
5023
|
// src/actions/workspaces/get_workspace_nodes.ts
|
|
4767
5024
|
import { z as z54 } from "zod";
|
|
4768
5025
|
var NodeRefSchema2 = NodeRefSchema;
|
|
@@ -5020,22 +5277,177 @@ function sleep(ms, signal) {
|
|
|
5020
5277
|
});
|
|
5021
5278
|
}
|
|
5022
5279
|
|
|
5023
|
-
// src/actions/cvms/
|
|
5280
|
+
// src/actions/cvms/patch_cvm.ts
|
|
5024
5281
|
import { z as z58 } from "zod";
|
|
5025
|
-
var
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5282
|
+
var PatchCvmRequestSchema = refineCvmId(
|
|
5283
|
+
CvmIdObjectSchema.extend({
|
|
5284
|
+
// Compose-hash-affecting fields
|
|
5285
|
+
docker_compose_file: z58.string().optional(),
|
|
5286
|
+
pre_launch_script: z58.string().optional(),
|
|
5287
|
+
allowed_envs: z58.array(z58.string()).optional(),
|
|
5288
|
+
// Visibility
|
|
5289
|
+
public_logs: z58.boolean().optional(),
|
|
5290
|
+
public_sysinfo: z58.boolean().optional(),
|
|
5291
|
+
public_tcbinfo: z58.boolean().optional(),
|
|
5292
|
+
// Non-compose-hash config
|
|
5293
|
+
encrypted_env: z58.string().optional(),
|
|
5294
|
+
user_config: z58.string().optional(),
|
|
5295
|
+
gpus: z58.object({
|
|
5296
|
+
count: z58.number(),
|
|
5297
|
+
product_name: z58.string().optional()
|
|
5298
|
+
}).optional(),
|
|
5299
|
+
// Resources
|
|
5300
|
+
vcpu: z58.number().optional(),
|
|
5301
|
+
memory: z58.number().optional(),
|
|
5302
|
+
disk_size: z58.number().optional(),
|
|
5303
|
+
// OS image
|
|
5304
|
+
image: z58.string().optional(),
|
|
5305
|
+
// Shutdown behavior
|
|
5306
|
+
shutdown_timeout: z58.number().optional(),
|
|
5307
|
+
allow_force_stop: z58.boolean().optional(),
|
|
5308
|
+
// Prepare-only mode (for multisig workflows)
|
|
5309
|
+
prepareOnly: z58.boolean().optional()
|
|
5310
|
+
})
|
|
5311
|
+
);
|
|
5312
|
+
var PatchCvmAcceptedSchema = z58.object({
|
|
5313
|
+
requiresOnChainHash: z58.literal(false),
|
|
5314
|
+
correlationId: z58.string()
|
|
5315
|
+
});
|
|
5316
|
+
var PatchCvmHashRequiredSchema = z58.object({
|
|
5317
|
+
requiresOnChainHash: z58.literal(true),
|
|
5318
|
+
composeHash: z58.string(),
|
|
5319
|
+
appId: z58.string(),
|
|
5320
|
+
deviceId: z58.string(),
|
|
5321
|
+
kmsInfo: KmsInfoSchema,
|
|
5322
|
+
commitToken: z58.string().optional(),
|
|
5323
|
+
commitUrl: z58.string().optional(),
|
|
5324
|
+
apiCommitUrl: z58.string().optional(),
|
|
5325
|
+
onchainStatus: z58.object({
|
|
5326
|
+
compose_hash_allowed: z58.boolean(),
|
|
5327
|
+
device_id_allowed: z58.boolean(),
|
|
5328
|
+
is_allowed: z58.boolean()
|
|
5329
|
+
}).optional()
|
|
5330
|
+
});
|
|
5331
|
+
var PatchCvmResultSchema = z58.discriminatedUnion("requiresOnChainHash", [
|
|
5332
|
+
PatchCvmAcceptedSchema,
|
|
5333
|
+
PatchCvmHashRequiredSchema
|
|
5334
|
+
]);
|
|
5335
|
+
function extractDetailsMap(detail) {
|
|
5336
|
+
const map = {};
|
|
5337
|
+
if (!detail || typeof detail !== "object") return map;
|
|
5338
|
+
const obj = detail;
|
|
5339
|
+
const details = obj.details;
|
|
5340
|
+
if (!Array.isArray(details)) return map;
|
|
5341
|
+
for (const item of details) {
|
|
5342
|
+
if (item && typeof item === "object" && "field" in item && "value" in item) {
|
|
5343
|
+
map[item.field] = item.value;
|
|
5344
|
+
}
|
|
5345
|
+
}
|
|
5346
|
+
return map;
|
|
5347
|
+
}
|
|
5348
|
+
var { action: patchCvm, safeAction: safePatchCvm } = defineAction(PatchCvmResultSchema, async (client, request) => {
|
|
5349
|
+
const parsed = PatchCvmRequestSchema.parse(request);
|
|
5350
|
+
const { cvmId } = CvmIdSchema.parse(parsed);
|
|
5351
|
+
const { id, uuid, app_id, instance_id, name, prepareOnly, ...body } = parsed;
|
|
5352
|
+
try {
|
|
5353
|
+
const response = prepareOnly ? await client.patch(`/cvms/${cvmId}`, body, {
|
|
5354
|
+
headers: { "X-Prepare-Only": "true" }
|
|
5355
|
+
}) : await client.patch(`/cvms/${cvmId}`, body);
|
|
5356
|
+
return {
|
|
5357
|
+
requiresOnChainHash: false,
|
|
5358
|
+
correlationId: response.correlation_id
|
|
5359
|
+
};
|
|
5360
|
+
} catch (error) {
|
|
5361
|
+
if (error instanceof PhalaCloudError && error.status === 465) {
|
|
5362
|
+
const details = extractDetailsMap(error.detail);
|
|
5363
|
+
return {
|
|
5364
|
+
requiresOnChainHash: true,
|
|
5365
|
+
composeHash: details.compose_hash,
|
|
5366
|
+
appId: String(details.app_id),
|
|
5367
|
+
deviceId: details.device_id,
|
|
5368
|
+
kmsInfo: details.kms_info,
|
|
5369
|
+
commitToken: details.commit_token,
|
|
5370
|
+
commitUrl: details.commit_url,
|
|
5371
|
+
apiCommitUrl: details.api_commit_url,
|
|
5372
|
+
onchainStatus: details.onchain_status
|
|
5373
|
+
};
|
|
5374
|
+
}
|
|
5375
|
+
throw error;
|
|
5376
|
+
}
|
|
5377
|
+
});
|
|
5378
|
+
|
|
5379
|
+
// src/actions/cvms/confirm_cvm_patch.ts
|
|
5380
|
+
import { z as z59 } from "zod";
|
|
5381
|
+
var ConfirmCvmPatchRequestSchema = refineCvmId(
|
|
5382
|
+
CvmIdObjectSchema.extend({
|
|
5383
|
+
composeHash: z59.string().describe("Compose hash from patchCvm Phase 1 response"),
|
|
5384
|
+
transactionHash: z59.string().describe("Transaction hash proving on-chain registration")
|
|
5385
|
+
})
|
|
5386
|
+
);
|
|
5387
|
+
var ConfirmCvmPatchResultSchema = z59.object({
|
|
5388
|
+
correlationId: z59.string()
|
|
5389
|
+
});
|
|
5390
|
+
var { action: confirmCvmPatch, safeAction: safeConfirmCvmPatch } = defineAction(ConfirmCvmPatchResultSchema, async (client, request) => {
|
|
5391
|
+
const parsed = ConfirmCvmPatchRequestSchema.parse(request);
|
|
5392
|
+
const { cvmId } = CvmIdSchema.parse(parsed);
|
|
5393
|
+
const response = await client.patch(
|
|
5394
|
+
`/cvms/${cvmId}`,
|
|
5395
|
+
{},
|
|
5396
|
+
{
|
|
5397
|
+
headers: {
|
|
5398
|
+
"X-Compose-Hash": parsed.composeHash,
|
|
5399
|
+
"X-Transaction-Hash": parsed.transactionHash
|
|
5400
|
+
}
|
|
5401
|
+
}
|
|
5402
|
+
);
|
|
5403
|
+
return {
|
|
5404
|
+
correlationId: response.correlation_id
|
|
5405
|
+
};
|
|
5406
|
+
});
|
|
5407
|
+
|
|
5408
|
+
// src/actions/cvms/commit_cvm_update.ts
|
|
5409
|
+
import { z as z60 } from "zod";
|
|
5410
|
+
var CommitCvmUpdateRequestSchema = refineCvmId(
|
|
5411
|
+
CvmIdObjectSchema.extend({
|
|
5412
|
+
token: z60.string().describe("One-time commit token from prepare-only flow"),
|
|
5413
|
+
composeHash: z60.string().describe("Compose hash from Phase 1 response"),
|
|
5414
|
+
transactionHash: z60.string().describe("Transaction hash proving on-chain registration")
|
|
5415
|
+
})
|
|
5416
|
+
);
|
|
5417
|
+
var CommitCvmUpdateResultSchema = z60.object({
|
|
5418
|
+
correlationId: z60.string(),
|
|
5419
|
+
status: z60.string()
|
|
5420
|
+
});
|
|
5421
|
+
var { action: commitCvmUpdate, safeAction: safeCommitCvmUpdate } = defineAction(CommitCvmUpdateResultSchema, async (client, request) => {
|
|
5422
|
+
const parsed = CommitCvmUpdateRequestSchema.parse(request);
|
|
5423
|
+
const { cvmId } = CvmIdSchema.parse(parsed);
|
|
5424
|
+
const response = await client.post(`/cvms/${cvmId}/commit-update`, {
|
|
5425
|
+
token: parsed.token,
|
|
5426
|
+
compose_hash: parsed.composeHash,
|
|
5427
|
+
transaction_hash: parsed.transactionHash
|
|
5428
|
+
});
|
|
5429
|
+
return {
|
|
5430
|
+
correlationId: response.correlation_id,
|
|
5431
|
+
status: response.status
|
|
5432
|
+
};
|
|
5433
|
+
});
|
|
5434
|
+
|
|
5435
|
+
// src/actions/cvms/refresh_cvm_instance_id.ts
|
|
5436
|
+
import { z as z61 } from "zod";
|
|
5437
|
+
var InstanceIdRefreshResultSchema = z61.object({
|
|
5438
|
+
cvm_id: z61.number().int(),
|
|
5439
|
+
identifier: z61.string(),
|
|
5440
|
+
status: z61.enum(["updated", "unchanged", "skipped", "conflict", "error"]),
|
|
5441
|
+
old_instance_id: z61.string().nullable().optional(),
|
|
5442
|
+
new_instance_id: z61.string().nullable().optional(),
|
|
5443
|
+
source: z61.enum(["teepod_state", "teepod_info", "gateway", "none"]),
|
|
5444
|
+
verified_with_gateway: z61.boolean(),
|
|
5445
|
+
reason: z61.string().nullable().optional()
|
|
5034
5446
|
});
|
|
5035
5447
|
var RefreshCvmInstanceIdRequestSchema = refineCvmId(
|
|
5036
5448
|
CvmIdObjectSchema.extend({
|
|
5037
|
-
overwrite:
|
|
5038
|
-
dry_run:
|
|
5449
|
+
overwrite: z61.boolean().optional(),
|
|
5450
|
+
dry_run: z61.boolean().optional()
|
|
5039
5451
|
})
|
|
5040
5452
|
);
|
|
5041
5453
|
var { action: refreshCvmInstanceId, safeAction: safeRefreshCvmInstanceId } = defineAction(InstanceIdRefreshResultSchema, async (client, request) => {
|
|
@@ -5049,24 +5461,24 @@ var { action: refreshCvmInstanceId, safeAction: safeRefreshCvmInstanceId } = def
|
|
|
5049
5461
|
});
|
|
5050
5462
|
|
|
5051
5463
|
// src/actions/cvms/refresh_cvm_instance_ids.ts
|
|
5052
|
-
import { z as
|
|
5053
|
-
var RefreshCvmInstanceIdsRequestSchema =
|
|
5054
|
-
cvm_ids:
|
|
5055
|
-
running_only:
|
|
5056
|
-
missing_only:
|
|
5057
|
-
overwrite:
|
|
5058
|
-
limit:
|
|
5059
|
-
dry_run:
|
|
5464
|
+
import { z as z62 } from "zod";
|
|
5465
|
+
var RefreshCvmInstanceIdsRequestSchema = z62.object({
|
|
5466
|
+
cvm_ids: z62.array(z62.string()).optional(),
|
|
5467
|
+
running_only: z62.boolean().optional(),
|
|
5468
|
+
missing_only: z62.boolean().optional(),
|
|
5469
|
+
overwrite: z62.boolean().optional(),
|
|
5470
|
+
limit: z62.number().int().min(1).max(500).optional(),
|
|
5471
|
+
dry_run: z62.boolean().optional()
|
|
5060
5472
|
}).strict();
|
|
5061
|
-
var RefreshCvmInstanceIdsResponseSchema =
|
|
5062
|
-
total:
|
|
5063
|
-
scanned:
|
|
5064
|
-
updated:
|
|
5065
|
-
unchanged:
|
|
5066
|
-
skipped:
|
|
5067
|
-
conflicts:
|
|
5068
|
-
errors:
|
|
5069
|
-
items:
|
|
5473
|
+
var RefreshCvmInstanceIdsResponseSchema = z62.object({
|
|
5474
|
+
total: z62.number().int(),
|
|
5475
|
+
scanned: z62.number().int(),
|
|
5476
|
+
updated: z62.number().int(),
|
|
5477
|
+
unchanged: z62.number().int(),
|
|
5478
|
+
skipped: z62.number().int(),
|
|
5479
|
+
conflicts: z62.number().int(),
|
|
5480
|
+
errors: z62.number().int(),
|
|
5481
|
+
items: z62.array(InstanceIdRefreshResultSchema)
|
|
5070
5482
|
});
|
|
5071
5483
|
var { action: refreshCvmInstanceIds, safeAction: safeRefreshCvmInstanceIds } = defineAction(RefreshCvmInstanceIdsResponseSchema, async (client, request) => {
|
|
5072
5484
|
const parsed = RefreshCvmInstanceIdsRequestSchema.parse(request);
|
|
@@ -5074,21 +5486,21 @@ var { action: refreshCvmInstanceIds, safeAction: safeRefreshCvmInstanceIds } = d
|
|
|
5074
5486
|
});
|
|
5075
5487
|
|
|
5076
5488
|
// src/actions/cvms/get_cvm_status_batch.ts
|
|
5077
|
-
import { z as
|
|
5078
|
-
var CvmStatusSchema =
|
|
5079
|
-
vm_uuid:
|
|
5080
|
-
status:
|
|
5081
|
-
uptime:
|
|
5082
|
-
in_progress:
|
|
5083
|
-
boot_progress:
|
|
5084
|
-
boot_error:
|
|
5085
|
-
operation_type:
|
|
5086
|
-
operation_started_at:
|
|
5087
|
-
correlation_id:
|
|
5088
|
-
});
|
|
5089
|
-
var GetCvmStatusBatchResponseSchema =
|
|
5090
|
-
var GetCvmStatusBatchRequestSchema =
|
|
5091
|
-
vmUuids:
|
|
5489
|
+
import { z as z63 } from "zod";
|
|
5490
|
+
var CvmStatusSchema = z63.object({
|
|
5491
|
+
vm_uuid: z63.string(),
|
|
5492
|
+
status: z63.string(),
|
|
5493
|
+
uptime: z63.string().nullable().optional(),
|
|
5494
|
+
in_progress: z63.boolean(),
|
|
5495
|
+
boot_progress: z63.string().nullable().optional(),
|
|
5496
|
+
boot_error: z63.string().nullable().optional(),
|
|
5497
|
+
operation_type: z63.string().nullable().optional(),
|
|
5498
|
+
operation_started_at: z63.string().nullable().optional(),
|
|
5499
|
+
correlation_id: z63.string().nullable().optional()
|
|
5500
|
+
});
|
|
5501
|
+
var GetCvmStatusBatchResponseSchema = z63.record(z63.string(), CvmStatusSchema);
|
|
5502
|
+
var GetCvmStatusBatchRequestSchema = z63.object({
|
|
5503
|
+
vmUuids: z63.array(z63.string())
|
|
5092
5504
|
});
|
|
5093
5505
|
var { action: getCvmStatusBatch, safeAction: safeGetCvmStatusBatch } = defineAction(GetCvmStatusBatchResponseSchema, async (client, request) => {
|
|
5094
5506
|
const { vmUuids } = GetCvmStatusBatchRequestSchema.parse(request);
|
|
@@ -5096,11 +5508,11 @@ var { action: getCvmStatusBatch, safeAction: safeGetCvmStatusBatch } = defineAct
|
|
|
5096
5508
|
});
|
|
5097
5509
|
|
|
5098
5510
|
// src/actions/cvms/get_cvm_user_config.ts
|
|
5099
|
-
import { z as
|
|
5100
|
-
var CvmUserConfigSchema =
|
|
5101
|
-
hostname:
|
|
5102
|
-
ssh_authorized_keys:
|
|
5103
|
-
default_gateway_domain:
|
|
5511
|
+
import { z as z64 } from "zod";
|
|
5512
|
+
var CvmUserConfigSchema = z64.object({
|
|
5513
|
+
hostname: z64.string().nullable().optional(),
|
|
5514
|
+
ssh_authorized_keys: z64.array(z64.string()).default([]),
|
|
5515
|
+
default_gateway_domain: z64.string().nullable().optional()
|
|
5104
5516
|
});
|
|
5105
5517
|
var GetCvmUserConfigRequestSchema = CvmIdSchema;
|
|
5106
5518
|
var { action: getCvmUserConfig, safeAction: safeGetCvmUserConfig } = defineAction(CvmUserConfigSchema, async (client, request) => {
|
|
@@ -5108,20 +5520,78 @@ var { action: getCvmUserConfig, safeAction: safeGetCvmUserConfig } = defineActio
|
|
|
5108
5520
|
return await client.get(`/cvms/${cvmId}/user_config`);
|
|
5109
5521
|
});
|
|
5110
5522
|
|
|
5523
|
+
// src/actions/cvms/check_cvm_is_allowed.ts
|
|
5524
|
+
import { z as z65 } from "zod";
|
|
5525
|
+
var IsAllowedResultSchema = z65.object({
|
|
5526
|
+
cvm_id: z65.number().optional(),
|
|
5527
|
+
app_contract_address: z65.string(),
|
|
5528
|
+
compose_hash: z65.string(),
|
|
5529
|
+
device_id: z65.string(),
|
|
5530
|
+
compose_hash_allowed: z65.boolean(),
|
|
5531
|
+
allow_any_device: z65.boolean(),
|
|
5532
|
+
device_id_allowed: z65.boolean().nullable().optional(),
|
|
5533
|
+
is_allowed: z65.boolean(),
|
|
5534
|
+
error: z65.string().nullable().optional()
|
|
5535
|
+
});
|
|
5536
|
+
var CheckCvmIsAllowedInputSchema = z65.object({
|
|
5537
|
+
cvmId: z65.string().min(1),
|
|
5538
|
+
compose_hash: z65.string().optional(),
|
|
5539
|
+
node_id: z65.number().optional(),
|
|
5540
|
+
device_id: z65.string().optional()
|
|
5541
|
+
});
|
|
5542
|
+
var CheckCvmIsAllowedRequestSchema = CheckCvmIsAllowedInputSchema;
|
|
5543
|
+
var { action: checkCvmIsAllowed, safeAction: safeCheckCvmIsAllowed } = defineAction(IsAllowedResultSchema, async (client, request) => {
|
|
5544
|
+
const { cvmId, ...body } = CheckCvmIsAllowedRequestSchema.parse(request);
|
|
5545
|
+
return await client.post(`/cvms/${cvmId}/is-allowed`, body);
|
|
5546
|
+
});
|
|
5547
|
+
|
|
5548
|
+
// src/actions/apps/check_app_is_allowed.ts
|
|
5549
|
+
import { z as z66 } from "zod";
|
|
5550
|
+
var CheckAppIsAllowedRequestSchema = z66.object({
|
|
5551
|
+
appId: z66.string().min(1),
|
|
5552
|
+
compose_hash: z66.string(),
|
|
5553
|
+
node_id: z66.number().optional(),
|
|
5554
|
+
device_id: z66.string().optional(),
|
|
5555
|
+
chain_id: z66.number().optional()
|
|
5556
|
+
});
|
|
5557
|
+
var { action: checkAppIsAllowed, safeAction: safeCheckAppIsAllowed } = defineAction(IsAllowedResultSchema, async (client, request) => {
|
|
5558
|
+
const { appId, ...body } = CheckAppIsAllowedRequestSchema.parse(request);
|
|
5559
|
+
return await client.post(`/apps/${appId}/is-allowed`, body);
|
|
5560
|
+
});
|
|
5561
|
+
|
|
5562
|
+
// src/actions/apps/check_app_cvms_is_allowed.ts
|
|
5563
|
+
import { z as z67 } from "zod";
|
|
5564
|
+
var AppCvmsBatchIsAllowedResponseSchema = z67.object({
|
|
5565
|
+
is_onchain: z67.boolean(),
|
|
5566
|
+
results: z67.array(IsAllowedResultSchema.extend({ cvm_id: z67.number() })).default([]),
|
|
5567
|
+
total: z67.number().default(0),
|
|
5568
|
+
allowed_count: z67.number().default(0),
|
|
5569
|
+
denied_count: z67.number().default(0),
|
|
5570
|
+
error_count: z67.number().default(0),
|
|
5571
|
+
skipped_cvm_ids: z67.array(z67.number()).default([])
|
|
5572
|
+
});
|
|
5573
|
+
var CheckAppCvmsIsAllowedRequestSchema = z67.object({
|
|
5574
|
+
appId: z67.string().min(1)
|
|
5575
|
+
});
|
|
5576
|
+
var { action: checkAppCvmsIsAllowed, safeAction: safeCheckAppCvmsIsAllowed } = defineAction(AppCvmsBatchIsAllowedResponseSchema, async (client, request) => {
|
|
5577
|
+
const { appId } = CheckAppCvmsIsAllowedRequestSchema.parse(request);
|
|
5578
|
+
return await client.post(`/apps/${appId}/cvms/is-allowed`, {});
|
|
5579
|
+
});
|
|
5580
|
+
|
|
5111
5581
|
// src/actions/apps/get_app_list.ts
|
|
5112
|
-
import { z as
|
|
5113
|
-
var GetAppListRequestSchema =
|
|
5114
|
-
page:
|
|
5115
|
-
page_size:
|
|
5116
|
-
search:
|
|
5117
|
-
status:
|
|
5118
|
-
listed:
|
|
5119
|
-
base_image:
|
|
5120
|
-
instance_type:
|
|
5121
|
-
kms_slug:
|
|
5122
|
-
kms_type:
|
|
5123
|
-
node:
|
|
5124
|
-
region:
|
|
5582
|
+
import { z as z68 } from "zod";
|
|
5583
|
+
var GetAppListRequestSchema = z68.object({
|
|
5584
|
+
page: z68.number().int().min(1).optional(),
|
|
5585
|
+
page_size: z68.number().int().min(1).max(100).optional(),
|
|
5586
|
+
search: z68.string().optional(),
|
|
5587
|
+
status: z68.array(z68.string()).optional(),
|
|
5588
|
+
listed: z68.boolean().optional(),
|
|
5589
|
+
base_image: z68.string().optional(),
|
|
5590
|
+
instance_type: z68.string().optional(),
|
|
5591
|
+
kms_slug: z68.string().optional(),
|
|
5592
|
+
kms_type: z68.string().optional(),
|
|
5593
|
+
node: z68.string().optional(),
|
|
5594
|
+
region: z68.string().optional()
|
|
5125
5595
|
}).strict();
|
|
5126
5596
|
function getSchemaForVersion4(version) {
|
|
5127
5597
|
return version === "2025-10-28" ? DstackAppListResponseV20251028Schema : DstackAppListResponseV20260121Schema;
|
|
@@ -5151,9 +5621,9 @@ async function safeGetAppList(client, request) {
|
|
|
5151
5621
|
}
|
|
5152
5622
|
|
|
5153
5623
|
// src/actions/apps/get_app_info.ts
|
|
5154
|
-
import { z as
|
|
5155
|
-
var GetAppInfoRequestSchema =
|
|
5156
|
-
appId:
|
|
5624
|
+
import { z as z69 } from "zod";
|
|
5625
|
+
var GetAppInfoRequestSchema = z69.object({
|
|
5626
|
+
appId: z69.string().min(1)
|
|
5157
5627
|
}).strict();
|
|
5158
5628
|
function getSchemaForVersion5(version) {
|
|
5159
5629
|
return version === "2025-10-28" ? DstackAppWithCvmResponseV20251028Schema : DstackAppWithCvmResponseV20260121Schema;
|
|
@@ -5183,12 +5653,12 @@ async function safeGetAppInfo(client, request) {
|
|
|
5183
5653
|
}
|
|
5184
5654
|
|
|
5185
5655
|
// src/actions/apps/get_app_cvms.ts
|
|
5186
|
-
import { z as
|
|
5187
|
-
var GetAppCvmsRequestSchema =
|
|
5188
|
-
appId:
|
|
5656
|
+
import { z as z70 } from "zod";
|
|
5657
|
+
var GetAppCvmsRequestSchema = z70.object({
|
|
5658
|
+
appId: z70.string().min(1)
|
|
5189
5659
|
}).strict();
|
|
5190
5660
|
function getSchemaForVersion6(version) {
|
|
5191
|
-
return version === "2025-10-28" ?
|
|
5661
|
+
return version === "2025-10-28" ? z70.array(CvmInfoV20251028Schema) : z70.array(CvmInfoV20260121Schema);
|
|
5192
5662
|
}
|
|
5193
5663
|
async function getAppCvms(client, request) {
|
|
5194
5664
|
const { appId } = GetAppCvmsRequestSchema.parse(request);
|
|
@@ -5214,24 +5684,42 @@ async function safeGetAppCvms(client, request) {
|
|
|
5214
5684
|
}
|
|
5215
5685
|
}
|
|
5216
5686
|
|
|
5687
|
+
// src/actions/apps/create_app_instance.ts
|
|
5688
|
+
import { z as z71 } from "zod";
|
|
5689
|
+
var CreateAppInstanceRequestSchema = z71.object({
|
|
5690
|
+
appId: z71.string().min(1),
|
|
5691
|
+
node_id: z71.number().optional(),
|
|
5692
|
+
docker_compose_file: z71.string().optional(),
|
|
5693
|
+
pre_launch_script: z71.string().optional(),
|
|
5694
|
+
encrypted_env: z71.string().optional(),
|
|
5695
|
+
compose_hash: z71.string().optional(),
|
|
5696
|
+
token: z71.string().optional(),
|
|
5697
|
+
transaction_hash: z71.string().optional()
|
|
5698
|
+
}).strict();
|
|
5699
|
+
var { action: createAppInstance, safeAction: safeCreateAppInstance } = defineAction(VMSchema, async (client, request) => {
|
|
5700
|
+
const parsed = CreateAppInstanceRequestSchema.parse(request);
|
|
5701
|
+
const { appId, ...body } = parsed;
|
|
5702
|
+
return await client.post(`/apps/${appId}/instances`, body);
|
|
5703
|
+
});
|
|
5704
|
+
|
|
5217
5705
|
// src/actions/apps/get_app_device_allowlist.ts
|
|
5218
|
-
import { z as
|
|
5219
|
-
var DeviceAllowlistItemSchema =
|
|
5220
|
-
device_id:
|
|
5221
|
-
node_name:
|
|
5222
|
-
cvm_ids:
|
|
5223
|
-
allowed_onchain:
|
|
5224
|
-
status:
|
|
5225
|
-
});
|
|
5226
|
-
var DeviceAllowlistResponseSchema =
|
|
5227
|
-
is_onchain_kms:
|
|
5228
|
-
allow_any_device:
|
|
5229
|
-
chain_id:
|
|
5230
|
-
app_contract_address:
|
|
5231
|
-
devices:
|
|
5232
|
-
});
|
|
5233
|
-
var GetAppDeviceAllowlistRequestSchema =
|
|
5234
|
-
appId:
|
|
5706
|
+
import { z as z72 } from "zod";
|
|
5707
|
+
var DeviceAllowlistItemSchema = z72.object({
|
|
5708
|
+
device_id: z72.string(),
|
|
5709
|
+
node_name: z72.string().nullable(),
|
|
5710
|
+
cvm_ids: z72.array(z72.number()),
|
|
5711
|
+
allowed_onchain: z72.boolean(),
|
|
5712
|
+
status: z72.string()
|
|
5713
|
+
});
|
|
5714
|
+
var DeviceAllowlistResponseSchema = z72.object({
|
|
5715
|
+
is_onchain_kms: z72.boolean(),
|
|
5716
|
+
allow_any_device: z72.boolean().nullable().optional(),
|
|
5717
|
+
chain_id: z72.number().nullable().optional(),
|
|
5718
|
+
app_contract_address: z72.string().nullable().optional(),
|
|
5719
|
+
devices: z72.array(DeviceAllowlistItemSchema).optional().default([])
|
|
5720
|
+
});
|
|
5721
|
+
var GetAppDeviceAllowlistRequestSchema = z72.object({
|
|
5722
|
+
appId: z72.string().min(1)
|
|
5235
5723
|
}).strict();
|
|
5236
5724
|
async function getAppDeviceAllowlist(client, request) {
|
|
5237
5725
|
const { appId } = GetAppDeviceAllowlistRequestSchema.parse(request);
|
|
@@ -5257,11 +5745,11 @@ async function safeGetAppDeviceAllowlist(client, request) {
|
|
|
5257
5745
|
}
|
|
5258
5746
|
|
|
5259
5747
|
// src/actions/apps/get_app_revisions.ts
|
|
5260
|
-
import { z as
|
|
5261
|
-
var GetAppRevisionsRequestSchema =
|
|
5262
|
-
appId:
|
|
5263
|
-
page:
|
|
5264
|
-
page_size:
|
|
5748
|
+
import { z as z73 } from "zod";
|
|
5749
|
+
var GetAppRevisionsRequestSchema = z73.object({
|
|
5750
|
+
appId: z73.string().min(1),
|
|
5751
|
+
page: z73.number().int().min(1).optional(),
|
|
5752
|
+
page_size: z73.number().int().min(1).max(1e3).optional()
|
|
5265
5753
|
}).strict();
|
|
5266
5754
|
async function getAppRevisions(client, request) {
|
|
5267
5755
|
const { appId, ...params } = GetAppRevisionsRequestSchema.parse(request);
|
|
@@ -5287,11 +5775,11 @@ async function safeGetAppRevisions(client, request) {
|
|
|
5287
5775
|
}
|
|
5288
5776
|
|
|
5289
5777
|
// src/actions/apps/get_app_revision_detail.ts
|
|
5290
|
-
import { z as
|
|
5291
|
-
var GetAppRevisionDetailRequestSchema =
|
|
5292
|
-
appId:
|
|
5293
|
-
revisionId:
|
|
5294
|
-
rawComposeFile:
|
|
5778
|
+
import { z as z74 } from "zod";
|
|
5779
|
+
var GetAppRevisionDetailRequestSchema = z74.object({
|
|
5780
|
+
appId: z74.string().min(1),
|
|
5781
|
+
revisionId: z74.string().min(1),
|
|
5782
|
+
rawComposeFile: z74.boolean().optional()
|
|
5295
5783
|
}).strict();
|
|
5296
5784
|
async function getAppRevisionDetail(client, request) {
|
|
5297
5785
|
const { appId, revisionId, rawComposeFile } = GetAppRevisionDetailRequestSchema.parse(request);
|
|
@@ -5318,15 +5806,15 @@ async function safeGetAppRevisionDetail(client, request) {
|
|
|
5318
5806
|
}
|
|
5319
5807
|
|
|
5320
5808
|
// src/actions/apps/get_app_filter_options.ts
|
|
5321
|
-
import { z as
|
|
5322
|
-
var AppFilterOptionsSchema =
|
|
5323
|
-
statuses:
|
|
5324
|
-
image_versions:
|
|
5325
|
-
instance_types:
|
|
5326
|
-
kms_slugs:
|
|
5327
|
-
kms_types:
|
|
5328
|
-
regions:
|
|
5329
|
-
nodes:
|
|
5809
|
+
import { z as z75 } from "zod";
|
|
5810
|
+
var AppFilterOptionsSchema = z75.object({
|
|
5811
|
+
statuses: z75.array(z75.string()),
|
|
5812
|
+
image_versions: z75.array(z75.string()),
|
|
5813
|
+
instance_types: z75.array(z75.string()),
|
|
5814
|
+
kms_slugs: z75.array(z75.string()),
|
|
5815
|
+
kms_types: z75.array(z75.string()),
|
|
5816
|
+
regions: z75.array(z75.string()),
|
|
5817
|
+
nodes: z75.array(z75.string())
|
|
5330
5818
|
});
|
|
5331
5819
|
async function getAppFilterOptions(client) {
|
|
5332
5820
|
const response = await client.get("/apps/filter-options");
|
|
@@ -5351,47 +5839,47 @@ async function safeGetAppFilterOptions(client) {
|
|
|
5351
5839
|
}
|
|
5352
5840
|
|
|
5353
5841
|
// src/actions/apps/get_app_attestation.ts
|
|
5354
|
-
import { z as
|
|
5355
|
-
var KmsInfoSchema2 =
|
|
5356
|
-
contract_address:
|
|
5357
|
-
chain_id:
|
|
5358
|
-
version:
|
|
5359
|
-
url:
|
|
5360
|
-
gateway_app_id:
|
|
5361
|
-
gateway_app_url:
|
|
5362
|
-
kms_type:
|
|
5363
|
-
});
|
|
5364
|
-
var GuestAgentInfoSchema =
|
|
5365
|
-
app_id:
|
|
5366
|
-
instance_id:
|
|
5367
|
-
app_name:
|
|
5368
|
-
device_id:
|
|
5842
|
+
import { z as z76 } from "zod";
|
|
5843
|
+
var KmsInfoSchema2 = z76.object({
|
|
5844
|
+
contract_address: z76.string(),
|
|
5845
|
+
chain_id: z76.string().nullable(),
|
|
5846
|
+
version: z76.string(),
|
|
5847
|
+
url: z76.string(),
|
|
5848
|
+
gateway_app_id: z76.string().nullable(),
|
|
5849
|
+
gateway_app_url: z76.string(),
|
|
5850
|
+
kms_type: z76.string()
|
|
5851
|
+
});
|
|
5852
|
+
var GuestAgentInfoSchema = z76.object({
|
|
5853
|
+
app_id: z76.string().optional(),
|
|
5854
|
+
instance_id: z76.string().optional(),
|
|
5855
|
+
app_name: z76.string().optional(),
|
|
5856
|
+
device_id: z76.string().optional()
|
|
5369
5857
|
}).passthrough().nullable();
|
|
5370
|
-
var AppAttestationInstanceSchema =
|
|
5371
|
-
vm_uuid:
|
|
5372
|
-
name:
|
|
5373
|
-
instance_id:
|
|
5374
|
-
status:
|
|
5375
|
-
image_version:
|
|
5376
|
-
quote:
|
|
5377
|
-
ppid:
|
|
5378
|
-
device_id:
|
|
5858
|
+
var AppAttestationInstanceSchema = z76.object({
|
|
5859
|
+
vm_uuid: z76.string().nullable().optional(),
|
|
5860
|
+
name: z76.string().optional(),
|
|
5861
|
+
instance_id: z76.string().nullable().optional(),
|
|
5862
|
+
status: z76.string().optional(),
|
|
5863
|
+
image_version: z76.string().nullable().optional(),
|
|
5864
|
+
quote: z76.string().nullable().optional(),
|
|
5865
|
+
ppid: z76.string().optional(),
|
|
5866
|
+
device_id: z76.string().optional(),
|
|
5379
5867
|
tcb_info: TcbInfoSchema.nullable().optional(),
|
|
5380
|
-
app_certificates:
|
|
5381
|
-
compose_file:
|
|
5382
|
-
error:
|
|
5868
|
+
app_certificates: z76.array(CertificateSchema).nullable().optional(),
|
|
5869
|
+
compose_file: z76.string().nullable().optional(),
|
|
5870
|
+
error: z76.string().nullable().optional()
|
|
5383
5871
|
});
|
|
5384
|
-
var AppAttestationResponseSchema =
|
|
5385
|
-
app_id:
|
|
5386
|
-
contract_address:
|
|
5872
|
+
var AppAttestationResponseSchema = z76.object({
|
|
5873
|
+
app_id: z76.string(),
|
|
5874
|
+
contract_address: z76.string(),
|
|
5387
5875
|
kms_info: KmsInfoSchema2,
|
|
5388
|
-
instances:
|
|
5876
|
+
instances: z76.array(AppAttestationInstanceSchema),
|
|
5389
5877
|
kms_guest_agent_info: GuestAgentInfoSchema,
|
|
5390
5878
|
gateway_guest_agent_info: GuestAgentInfoSchema,
|
|
5391
|
-
qemu_version:
|
|
5879
|
+
qemu_version: z76.string().nullable()
|
|
5392
5880
|
});
|
|
5393
|
-
var GetAppAttestationRequestSchema =
|
|
5394
|
-
appId:
|
|
5881
|
+
var GetAppAttestationRequestSchema = z76.object({
|
|
5882
|
+
appId: z76.string().min(1)
|
|
5395
5883
|
}).strict();
|
|
5396
5884
|
var { action: getAppAttestation, safeAction: safeGetAppAttestation } = defineAction(AppAttestationResponseSchema, async (client, request) => {
|
|
5397
5885
|
const { appId } = GetAppAttestationRequestSchema.parse(request);
|
|
@@ -5442,6 +5930,7 @@ export {
|
|
|
5442
5930
|
ApiErrorSchema,
|
|
5443
5931
|
AppAttestationInstanceSchema,
|
|
5444
5932
|
AppAttestationResponseSchema,
|
|
5933
|
+
AppCvmsBatchIsAllowedResponseSchema,
|
|
5445
5934
|
AppFilterOptionsSchema,
|
|
5446
5935
|
AppProfileSchema,
|
|
5447
5936
|
AppRevisionDetailResponseSchema,
|
|
@@ -5455,10 +5944,16 @@ export {
|
|
|
5455
5944
|
CertificateIssuerSchema,
|
|
5456
5945
|
CertificateSchema,
|
|
5457
5946
|
CertificateSubjectSchema,
|
|
5947
|
+
CheckAppCvmsIsAllowedRequestSchema,
|
|
5948
|
+
CheckAppIsAllowedRequestSchema,
|
|
5949
|
+
CheckCvmIsAllowedRequestSchema,
|
|
5458
5950
|
CommitCvmComposeFileUpdateRequestSchema,
|
|
5459
5951
|
CommitCvmComposeFileUpdateSchema,
|
|
5460
5952
|
CommitCvmProvisionRequestSchema,
|
|
5461
5953
|
CommitCvmProvisionSchema,
|
|
5954
|
+
CommitCvmUpdateRequestSchema,
|
|
5955
|
+
ConfirmCvmPatchRequestSchema,
|
|
5956
|
+
CreateAppInstanceRequestSchema,
|
|
5462
5957
|
CreateSshKeyRequestSchema,
|
|
5463
5958
|
CreditsInfoSchema,
|
|
5464
5959
|
CurrentUserV20251028Schema as CurrentUserSchema,
|
|
@@ -5500,6 +5995,7 @@ export {
|
|
|
5500
5995
|
DstackAppMinimalResponseV20260121Schema,
|
|
5501
5996
|
DstackAppWithCvmResponseV20251028Schema,
|
|
5502
5997
|
DstackAppWithCvmResponseV20260121Schema,
|
|
5998
|
+
ErrorCodes,
|
|
5503
5999
|
EventLogSchema,
|
|
5504
6000
|
FamilyGroupSchema,
|
|
5505
6001
|
FamilyInstanceTypesResponseSchema,
|
|
@@ -5541,6 +6037,7 @@ export {
|
|
|
5541
6037
|
ImportGithubProfileResponseSchema,
|
|
5542
6038
|
InstanceIdRefreshResultSchema,
|
|
5543
6039
|
InstanceTypeSchema,
|
|
6040
|
+
IsAllowedResultSchema,
|
|
5544
6041
|
KmsInfoSchema,
|
|
5545
6042
|
KmsTypeSchema,
|
|
5546
6043
|
ListFamilyInstanceTypesRequestSchema,
|
|
@@ -5564,6 +6061,8 @@ export {
|
|
|
5564
6061
|
PaginatedCvmInfosV20251028Schema,
|
|
5565
6062
|
PaginatedCvmInfosV20260121Schema,
|
|
5566
6063
|
PaginationMetadataSchema,
|
|
6064
|
+
PatchCvmRequestSchema,
|
|
6065
|
+
PatchCvmResultSchema,
|
|
5567
6066
|
PhalaCloudError,
|
|
5568
6067
|
ProvisionCvmComposeFileUpdateRequestSchema,
|
|
5569
6068
|
ProvisionCvmComposeFileUpdateResultSchema,
|
|
@@ -5617,12 +6116,20 @@ export {
|
|
|
5617
6116
|
addNetwork,
|
|
5618
6117
|
asHex,
|
|
5619
6118
|
autoCreateClients,
|
|
6119
|
+
checkAppCvmsIsAllowed,
|
|
6120
|
+
checkAppIsAllowed,
|
|
5620
6121
|
checkBalance,
|
|
6122
|
+
checkComposeHashAllowed,
|
|
6123
|
+
checkCvmIsAllowed,
|
|
5621
6124
|
checkDeviceAllowed,
|
|
5622
6125
|
checkNetworkStatus,
|
|
6126
|
+
checkOnChainPrerequisites,
|
|
5623
6127
|
commitCvmComposeFileUpdate,
|
|
5624
6128
|
commitCvmProvision,
|
|
6129
|
+
commitCvmUpdate,
|
|
6130
|
+
confirmCvmPatch,
|
|
5625
6131
|
convertToHostname,
|
|
6132
|
+
createAppInstance,
|
|
5626
6133
|
createClient as createBaseClient,
|
|
5627
6134
|
createClient2 as createClient,
|
|
5628
6135
|
createClientsFromBrowser,
|
|
@@ -5684,6 +6191,8 @@ export {
|
|
|
5684
6191
|
getWorkspaceNodes,
|
|
5685
6192
|
getWorkspaceQuotas,
|
|
5686
6193
|
importGithubProfileSshKeys,
|
|
6194
|
+
isAppIdConflictError,
|
|
6195
|
+
isConflictError,
|
|
5687
6196
|
isValidHostname,
|
|
5688
6197
|
listAllInstanceTypeFamilies,
|
|
5689
6198
|
listFamilyInstanceTypes,
|
|
@@ -5693,6 +6202,7 @@ export {
|
|
|
5693
6202
|
parseApiError,
|
|
5694
6203
|
parseEnv,
|
|
5695
6204
|
parseEnvVars,
|
|
6205
|
+
patchCvm,
|
|
5696
6206
|
preprocessAppCompose,
|
|
5697
6207
|
provisionCvm,
|
|
5698
6208
|
provisionCvmComposeFileUpdate,
|
|
@@ -5704,9 +6214,17 @@ export {
|
|
|
5704
6214
|
restartCvm,
|
|
5705
6215
|
safeAddComposeHash,
|
|
5706
6216
|
safeAddDevice,
|
|
6217
|
+
safeCheckAppCvmsIsAllowed,
|
|
6218
|
+
safeCheckAppIsAllowed,
|
|
6219
|
+
safeCheckComposeHashAllowed,
|
|
6220
|
+
safeCheckCvmIsAllowed,
|
|
5707
6221
|
safeCheckDeviceAllowed,
|
|
6222
|
+
safeCheckOnChainPrerequisites,
|
|
5708
6223
|
safeCommitCvmComposeFileUpdate,
|
|
5709
6224
|
safeCommitCvmProvision,
|
|
6225
|
+
safeCommitCvmUpdate,
|
|
6226
|
+
safeConfirmCvmPatch,
|
|
6227
|
+
safeCreateAppInstance,
|
|
5710
6228
|
safeCreateSshKey,
|
|
5711
6229
|
safeDeleteCvm,
|
|
5712
6230
|
safeDeleteSshKey,
|
|
@@ -5749,6 +6267,7 @@ export {
|
|
|
5749
6267
|
safeListSshKeys,
|
|
5750
6268
|
safeListWorkspaces,
|
|
5751
6269
|
safeNextAppIds,
|
|
6270
|
+
safePatchCvm,
|
|
5752
6271
|
safeProvisionCvm,
|
|
5753
6272
|
safeProvisionCvmComposeFileUpdate,
|
|
5754
6273
|
safeRefreshCvmInstanceId,
|