buckyos 0.7.148 → 0.7.150
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/cli/core/app.ts +2 -0
- package/cli/dist/cli.mjs +548 -83
- package/cli/dist/cli.mjs.map +1 -1
- package/cli/modules/bucket.ts +396 -0
- package/cli/modules/pikg_protocol.ts +71 -0
- package/cli/version.ts +1 -1
- package/dist/browser.cjs +1 -1
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.ts +2 -0
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.mjs +190 -189
- package/dist/browser.mjs.map +1 -1
- package/dist/bucket_client.d.ts +393 -0
- package/dist/bucket_client.d.ts.map +1 -0
- package/dist/{executor_client-4fbf0c3c.mjs → executor_client-84d7a70d.mjs} +494 -193
- package/dist/executor_client-84d7a70d.mjs.map +1 -0
- package/dist/executor_client-900330a4.js +13 -0
- package/dist/executor_client-900330a4.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +195 -192
- package/dist/index.mjs.map +1 -1
- package/dist/ndm_client.d.ts +32 -0
- package/dist/ndm_client.d.ts.map +1 -1
- package/dist/nfsp.cjs.map +1 -1
- package/dist/nfsp.d.ts +5 -3
- package/dist/nfsp.d.ts.map +1 -1
- package/dist/nfsp.mjs.map +1 -1
- package/dist/node.cjs +1 -1
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.ts +2 -0
- package/dist/node.d.ts.map +1 -1
- package/dist/node.mjs +190 -189
- package/dist/node.mjs.map +1 -1
- package/dist/runtime.d.ts +2 -0
- package/dist/runtime.d.ts.map +1 -1
- package/dist/sdk_core.d.ts +4 -0
- package/dist/sdk_core.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/executor_client-4fbf0c3c.mjs.map +0 -1
- package/dist/executor_client-5fa2d501.js +0 -13
- package/dist/executor_client-5fa2d501.js.map +0 -1
|
@@ -408,6 +408,259 @@ class AiWorkspaceClient {
|
|
|
408
408
|
return this.call("proc.cancel", { workspace_id, run_id });
|
|
409
409
|
}
|
|
410
410
|
}
|
|
411
|
+
const BUCKET_SERVICE_NAME = "nfs-server";
|
|
412
|
+
const BUCKET_DATA_PATH = "/bucket/v1/";
|
|
413
|
+
const BUCKET_MAX_PUT_BYTES = 32 * 1024 * 1024;
|
|
414
|
+
class BucketError extends Error {
|
|
415
|
+
constructor(code, message, status, data) {
|
|
416
|
+
super(message);
|
|
417
|
+
this.code = code;
|
|
418
|
+
this.status = status;
|
|
419
|
+
this.data = data;
|
|
420
|
+
this.name = "BucketError";
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
function bucketDataPlaneBase(serviceUrl) {
|
|
424
|
+
const at = serviceUrl.indexOf("/kapi/");
|
|
425
|
+
return at >= 0 ? serviceUrl.slice(0, at) : "";
|
|
426
|
+
}
|
|
427
|
+
const ZONE_BUCKET_OWNER = "_";
|
|
428
|
+
const BUCKET_COMPONENT = /^[A-Za-z0-9._-]{1,128}$/;
|
|
429
|
+
function bucketComponent(what, value) {
|
|
430
|
+
if (!BUCKET_COMPONENT.test(value) || value === "." || value === "..")
|
|
431
|
+
throw new BucketError("invalid_argument", `invalid bucket ${what} '${value}'`);
|
|
432
|
+
return value;
|
|
433
|
+
}
|
|
434
|
+
function userBucketId(appid, owner, name) {
|
|
435
|
+
if (owner === ZONE_BUCKET_OWNER)
|
|
436
|
+
throw new BucketError("invalid_argument", "a user bucket needs a user owner");
|
|
437
|
+
return `user/${bucketComponent("appid", appid)}/${bucketComponent("owner", owner)}/${bucketComponent("name", name)}`;
|
|
438
|
+
}
|
|
439
|
+
function zoneBucketId(appid, name) {
|
|
440
|
+
return `zone/${bucketComponent("appid", appid)}/${ZONE_BUCKET_OWNER}/${bucketComponent("name", name)}`;
|
|
441
|
+
}
|
|
442
|
+
function parseBucketPath(path) {
|
|
443
|
+
const segments = path.split("/");
|
|
444
|
+
if (segments.length < 4)
|
|
445
|
+
return null;
|
|
446
|
+
const [scope, appid, owner, name] = segments;
|
|
447
|
+
if (scope !== "user" && scope !== "zone")
|
|
448
|
+
return null;
|
|
449
|
+
if (![appid, owner, name].every((v) => BUCKET_COMPONENT.test(v) && v !== "." && v !== ".."))
|
|
450
|
+
return null;
|
|
451
|
+
if (scope === "zone" !== (owner === ZONE_BUCKET_OWNER))
|
|
452
|
+
return null;
|
|
453
|
+
return { bucketId: `${scope}/${appid}/${owner}/${name}`, parts: { scope, appid, owner, name }, key: segments.slice(4).join("/") };
|
|
454
|
+
}
|
|
455
|
+
const BUCKET_OBJ_URL_PREFIX = "obj://bucket/";
|
|
456
|
+
function bucketObjUrl(bucketId, key) {
|
|
457
|
+
return `${BUCKET_OBJ_URL_PREFIX}${bucketId}/${key}`;
|
|
458
|
+
}
|
|
459
|
+
function parseBucketObjUrl(url) {
|
|
460
|
+
if (!url.startsWith(BUCKET_OBJ_URL_PREFIX))
|
|
461
|
+
return null;
|
|
462
|
+
const parsed = parseBucketPath(url.slice(BUCKET_OBJ_URL_PREFIX.length));
|
|
463
|
+
return parsed && parsed.key ? { bucketId: parsed.bucketId, key: parsed.key } : null;
|
|
464
|
+
}
|
|
465
|
+
function bucketObjectPath(bucketId, key) {
|
|
466
|
+
return `${BUCKET_DATA_PATH}${bucketId}/${key.split("/").map(encodeURIComponent).join("/")}`;
|
|
467
|
+
}
|
|
468
|
+
class BucketClient {
|
|
469
|
+
constructor(rpcClient, options = { dataPlaneBase: "" }) {
|
|
470
|
+
this.rpcClient = rpcClient;
|
|
471
|
+
this.options = options;
|
|
472
|
+
}
|
|
473
|
+
call(method, params) {
|
|
474
|
+
return this.rpcClient.call(method, params);
|
|
475
|
+
}
|
|
476
|
+
list(filter = {}) {
|
|
477
|
+
return this.call("bucket.list", { ...filter });
|
|
478
|
+
}
|
|
479
|
+
stat(bucketId) {
|
|
480
|
+
return this.call("bucket.stat", { bucket_id: bucketId });
|
|
481
|
+
}
|
|
482
|
+
/** Unbinds everything and drops the bucket; a documents / collected bucket takes the user's sudo session token. */
|
|
483
|
+
deleteBucket(bucketId, options = {}) {
|
|
484
|
+
return this.rpcClient.call("bucket.delete_bucket", { bucket_id: bucketId }, options.sessionToken ? { sessionToken: options.sessionToken } : {});
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Disposes of an uninstalled app instance's buckets by data policy (control-panel or a Zone admin):
|
|
488
|
+
* documents / collected (and app_data with `keepAppData`) become orphans, the rest are deleted.
|
|
489
|
+
*/
|
|
490
|
+
releaseApp(appid, owner, options = {}) {
|
|
491
|
+
return this.call("bucket.release_app", { appid, owner, keep_app_data: options.keepAppData ?? false });
|
|
492
|
+
}
|
|
493
|
+
put(bucketId, req) {
|
|
494
|
+
return this.call("bucket.put", { bucket_id: bucketId, ...req });
|
|
495
|
+
}
|
|
496
|
+
get(bucketId, key, version2) {
|
|
497
|
+
return this.call("bucket.get", { bucket_id: bucketId, key, version: version2 });
|
|
498
|
+
}
|
|
499
|
+
head(bucketId, key, version2) {
|
|
500
|
+
return this.call("bucket.head", { bucket_id: bucketId, key, version: version2 });
|
|
501
|
+
}
|
|
502
|
+
delete(bucketId, key, options = {}) {
|
|
503
|
+
return this.call("bucket.delete", { bucket_id: bucketId, key, version: options.version, if_match: options.ifMatch });
|
|
504
|
+
}
|
|
505
|
+
listObjects(bucketId, req = {}) {
|
|
506
|
+
return this.call("bucket.list_objects", { bucket_id: bucketId, ...req });
|
|
507
|
+
}
|
|
508
|
+
listVersions(bucketId, key) {
|
|
509
|
+
return this.call("bucket.list_versions", { bucket_id: bucketId, key });
|
|
510
|
+
}
|
|
511
|
+
copy(req) {
|
|
512
|
+
return this.call("bucket.copy", { ...req });
|
|
513
|
+
}
|
|
514
|
+
batch(bucketId, ops) {
|
|
515
|
+
return this.call("bucket.batch", { bucket_id: bucketId, ops });
|
|
516
|
+
}
|
|
517
|
+
setMetadata(bucketId, key, update) {
|
|
518
|
+
return this.call("bucket.set_metadata", { bucket_id: bucketId, key, ...update });
|
|
519
|
+
}
|
|
520
|
+
grant(bucketId, req) {
|
|
521
|
+
return this.call("bucket.grant", { bucket_id: bucketId, ...req });
|
|
522
|
+
}
|
|
523
|
+
revoke(grantId) {
|
|
524
|
+
return this.call("bucket.revoke", { grant_id: grantId });
|
|
525
|
+
}
|
|
526
|
+
listGrants(bucketId) {
|
|
527
|
+
return this.call("bucket.list_grants", { bucket_id: bucketId });
|
|
528
|
+
}
|
|
529
|
+
createAccessToken(bucketId, req) {
|
|
530
|
+
return this.call("bucket.create_access_token", { bucket_id: bucketId, ...req });
|
|
531
|
+
}
|
|
532
|
+
revokeAccessToken(tokenId) {
|
|
533
|
+
return this.call("bucket.revoke_access_token", { token_id: tokenId });
|
|
534
|
+
}
|
|
535
|
+
listAccessTokens(bucketId) {
|
|
536
|
+
return this.call("bucket.list_access_tokens", { bucket_id: bucketId });
|
|
537
|
+
}
|
|
538
|
+
checkAccess(bucketId, action, target = {}) {
|
|
539
|
+
return this.call("bucket.check_access", { bucket_id: bucketId, action, ...target });
|
|
540
|
+
}
|
|
541
|
+
getQuota(bucketId) {
|
|
542
|
+
return this.call("bucket.get_quota", { bucket_id: bucketId });
|
|
543
|
+
}
|
|
544
|
+
setQuota(bucketId, update) {
|
|
545
|
+
return this.call("bucket.set_quota", { bucket_id: bucketId, ...update });
|
|
546
|
+
}
|
|
547
|
+
getPoolQuota(kind, id2) {
|
|
548
|
+
return this.call("bucket.get_pool_quota", { kind, id: id2 });
|
|
549
|
+
}
|
|
550
|
+
usageReport(kind, id2, days) {
|
|
551
|
+
return this.call("bucket.usage_report", { kind, id: id2, days });
|
|
552
|
+
}
|
|
553
|
+
getLifecycle(bucketId) {
|
|
554
|
+
return this.call("bucket.get_lifecycle", { bucket_id: bucketId });
|
|
555
|
+
}
|
|
556
|
+
setLifecycle(bucketId, rules) {
|
|
557
|
+
return this.call("bucket.set_lifecycle", { bucket_id: bucketId, rules });
|
|
558
|
+
}
|
|
559
|
+
snapshot(bucketId, options = {}) {
|
|
560
|
+
return this.call("bucket.snapshot", { bucket_id: bucketId, label: options.label, include_noncurrent: options.includeNoncurrent });
|
|
561
|
+
}
|
|
562
|
+
listSnapshots(bucketId) {
|
|
563
|
+
return this.call("bucket.list_snapshots", { bucket_id: bucketId });
|
|
564
|
+
}
|
|
565
|
+
deleteSnapshot(bucketId, snapshotId) {
|
|
566
|
+
return this.call("bucket.delete_snapshot", { bucket_id: bucketId, snapshot_id: snapshotId });
|
|
567
|
+
}
|
|
568
|
+
restoreFromSnapshot(bucketId, rootObjId) {
|
|
569
|
+
return this.call("bucket.restore_from_snapshot", { bucket_id: bucketId, root_obj_id: rootObjId });
|
|
570
|
+
}
|
|
571
|
+
exportSnapshot(bucketId, snapshotId, target) {
|
|
572
|
+
return this.call("bucket.export", { bucket_id: bucketId, snapshot_id: snapshotId, target });
|
|
573
|
+
}
|
|
574
|
+
verifyReferences(bucketId, refs) {
|
|
575
|
+
return this.call("bucket.verify_references", { bucket_id: bucketId, refs });
|
|
576
|
+
}
|
|
577
|
+
/** Issues an S3 access key for the signed-in user and `appid` (the user's own session only). */
|
|
578
|
+
createS3Key(appid, options = {}) {
|
|
579
|
+
return this.call("bucket.create_s3_key", { appid, scope: options.scope, expires_at: options.expiresAt });
|
|
580
|
+
}
|
|
581
|
+
listS3Keys() {
|
|
582
|
+
return this.call("bucket.list_s3_keys", {});
|
|
583
|
+
}
|
|
584
|
+
revokeS3Key(accessKeyId) {
|
|
585
|
+
return this.call("bucket.revoke_s3_key", { access_key_id: accessKeyId });
|
|
586
|
+
}
|
|
587
|
+
/** URL of a key on the data plane; same-origin browser pages read it with the SSO cookie. */
|
|
588
|
+
objectUrl(bucketId, key, options = {}) {
|
|
589
|
+
const query = new URLSearchParams();
|
|
590
|
+
if (options.version !== void 0)
|
|
591
|
+
query.set("version", String(options.version));
|
|
592
|
+
if (options.token)
|
|
593
|
+
query.set("token", options.token);
|
|
594
|
+
const qs = query.toString();
|
|
595
|
+
return `${this.options.dataPlaneBase}${bucketObjectPath(bucketId, key)}${qs ? `?${qs}` : ""}`;
|
|
596
|
+
}
|
|
597
|
+
async authHeaders() {
|
|
598
|
+
const token = this.options.sessionTokenProvider ? await this.options.sessionTokenProvider() : null;
|
|
599
|
+
return token ? { Authorization: `Bearer ${token}` } : {};
|
|
600
|
+
}
|
|
601
|
+
/** `PUT /bucket/v1/...`: stores up to 32 MiB and binds it; success means it is retained. */
|
|
602
|
+
async putBytes(bucketId, key, body, options = {}) {
|
|
603
|
+
const headers = { ...await this.authHeaders() };
|
|
604
|
+
if (options.contentType)
|
|
605
|
+
headers["Content-Type"] = options.contentType;
|
|
606
|
+
for (const [k, v] of Object.entries(options.metadata ?? {}))
|
|
607
|
+
headers[`x-bucky-meta-${k}`] = v;
|
|
608
|
+
if (options.tags)
|
|
609
|
+
headers["x-bucky-tags"] = JSON.stringify(options.tags);
|
|
610
|
+
if (options.expiresAt !== void 0)
|
|
611
|
+
headers["x-bucky-expires-at"] = String(options.expiresAt);
|
|
612
|
+
if (options.origin)
|
|
613
|
+
headers["x-bucky-origin"] = JSON.stringify(options.origin);
|
|
614
|
+
if (options.if_none_match)
|
|
615
|
+
headers["If-None-Match"] = options.if_none_match;
|
|
616
|
+
if (options.if_match)
|
|
617
|
+
headers["If-Match"] = options.if_match;
|
|
618
|
+
if (options.if_version !== void 0)
|
|
619
|
+
headers["x-bucky-if-version"] = String(options.if_version);
|
|
620
|
+
const response = await (this.options.fetcher ?? fetch)(this.objectUrl(bucketId, key), {
|
|
621
|
+
method: "PUT",
|
|
622
|
+
credentials: "include",
|
|
623
|
+
headers,
|
|
624
|
+
body
|
|
625
|
+
});
|
|
626
|
+
return this.json(response);
|
|
627
|
+
}
|
|
628
|
+
/** Reads a key's content (a `Response` to stream or `.blob()`). */
|
|
629
|
+
async fetchObject(bucketId, key, options = {}) {
|
|
630
|
+
const headers = options.token ? {} : await this.authHeaders();
|
|
631
|
+
if (options.range)
|
|
632
|
+
headers.Range = options.range;
|
|
633
|
+
const response = await (this.options.fetcher ?? fetch)(this.objectUrl(bucketId, key, options), { credentials: "include", headers });
|
|
634
|
+
if (!response.ok)
|
|
635
|
+
await this.json(response);
|
|
636
|
+
return response;
|
|
637
|
+
}
|
|
638
|
+
async json(response) {
|
|
639
|
+
const text = await response.text();
|
|
640
|
+
const body = text ? JSON.parse(text) : {};
|
|
641
|
+
if (!response.ok) {
|
|
642
|
+
throw new BucketError(String(body.error ?? response.status), String(body.message ?? response.statusText), response.status, body.data);
|
|
643
|
+
}
|
|
644
|
+
return body;
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
const bucket_client = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
648
|
+
__proto__: null,
|
|
649
|
+
BUCKET_DATA_PATH,
|
|
650
|
+
BUCKET_MAX_PUT_BYTES,
|
|
651
|
+
BUCKET_OBJ_URL_PREFIX,
|
|
652
|
+
BUCKET_SERVICE_NAME,
|
|
653
|
+
BucketClient,
|
|
654
|
+
BucketError,
|
|
655
|
+
ZONE_BUCKET_OWNER,
|
|
656
|
+
bucketDataPlaneBase,
|
|
657
|
+
bucketObjUrl,
|
|
658
|
+
bucketObjectPath,
|
|
659
|
+
parseBucketObjUrl,
|
|
660
|
+
parseBucketPath,
|
|
661
|
+
userBucketId,
|
|
662
|
+
zoneBucketId
|
|
663
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
411
664
|
function serializeAuthTarget(target) {
|
|
412
665
|
if (!target || typeof target !== "object") {
|
|
413
666
|
throw new RPCError("verify-hub auth target is required");
|
|
@@ -3526,6 +3779,12 @@ class BuckyOSRuntime {
|
|
|
3526
3779
|
getAiWorkspaceClient() {
|
|
3527
3780
|
return new AiWorkspaceClient(this.getServiceRpcClient(AIWORKSPACE_SERVICE_NAME));
|
|
3528
3781
|
}
|
|
3782
|
+
getBucketClient() {
|
|
3783
|
+
return new BucketClient(this.getServiceRpcClient(BUCKET_SERVICE_NAME), {
|
|
3784
|
+
dataPlaneBase: bucketDataPlaneBase(this.getZoneServiceURL(BUCKET_SERVICE_NAME)),
|
|
3785
|
+
sessionTokenProvider: this.ensureSessionTokenReady.bind(this)
|
|
3786
|
+
});
|
|
3787
|
+
}
|
|
3529
3788
|
getMsgQueueClient() {
|
|
3530
3789
|
return new MsgQueueClient(this.getServiceRpcClient("kmsg"));
|
|
3531
3790
|
}
|
|
@@ -5479,6 +5738,12 @@ class BuckyOSSDK {
|
|
|
5479
5738
|
}
|
|
5480
5739
|
return this.currentRuntime.getAiWorkspaceClient();
|
|
5481
5740
|
}
|
|
5741
|
+
getBucketClient() {
|
|
5742
|
+
if (this.currentRuntime == null) {
|
|
5743
|
+
throw new Error("BuckyOS WebSDK is not initialized,call initBuckyOS first");
|
|
5744
|
+
}
|
|
5745
|
+
return this.currentRuntime.getBucketClient();
|
|
5746
|
+
}
|
|
5482
5747
|
getMsgQueueClient() {
|
|
5483
5748
|
if (this.currentRuntime == null) {
|
|
5484
5749
|
throw new Error("BuckyOS WebSDK is not initialized,call initBuckyOS first");
|
|
@@ -5663,6 +5928,7 @@ function createSDKModule(target) {
|
|
|
5663
5928
|
getWorkflowClient: sdk.getWorkflowClient.bind(sdk),
|
|
5664
5929
|
getAiccClient: sdk.getAiccClient.bind(sdk),
|
|
5665
5930
|
getAiWorkspaceClient: sdk.getAiWorkspaceClient.bind(sdk),
|
|
5931
|
+
getBucketClient: sdk.getBucketClient.bind(sdk),
|
|
5666
5932
|
getMsgQueueClient: sdk.getMsgQueueClient.bind(sdk),
|
|
5667
5933
|
getMsgCenterClient: sdk.getMsgCenterClient.bind(sdk),
|
|
5668
5934
|
getRepoClient: sdk.getRepoClient.bind(sdk)
|
|
@@ -28534,7 +28800,7 @@ async function importSelectedFiles(selectedFiles, options, tree) {
|
|
|
28534
28800
|
summary
|
|
28535
28801
|
};
|
|
28536
28802
|
if (options.autoStartUpload && uploadStatus === "not_started") {
|
|
28537
|
-
startUpload(sessionId, { endpoint: options.endpoint, sessionToken: options.sessionToken, fetcher: options.fetcher, headers: options.headers, signal: options.signal }).catch(() => {
|
|
28803
|
+
startUpload(sessionId, { endpoint: options.endpoint, sessionToken: options.sessionToken, fetcher: options.fetcher, headers: options.headers, signal: options.signal, bind: options.bind }).catch(() => {
|
|
28538
28804
|
});
|
|
28539
28805
|
snapshot.uploadStatus = "uploading";
|
|
28540
28806
|
}
|
|
@@ -28564,6 +28830,7 @@ async function getImportSessionStatus(sessionId) {
|
|
|
28564
28830
|
collect(session.items);
|
|
28565
28831
|
return {
|
|
28566
28832
|
sessionId,
|
|
28833
|
+
...session.binding ? { binding: session.binding } : {},
|
|
28567
28834
|
materializationStatus: session.materializationStatus,
|
|
28568
28835
|
uploadStatus: session.uploadStatus,
|
|
28569
28836
|
objectStatus: session.objectStatus,
|
|
@@ -28697,6 +28964,11 @@ async function startUpload(sessionId, options = {}) {
|
|
|
28697
28964
|
session.objectStatus = "pending";
|
|
28698
28965
|
session.error = void 0;
|
|
28699
28966
|
session.onProgress = options.onProgress;
|
|
28967
|
+
if (options.bind) {
|
|
28968
|
+
if (session.items.length !== 1)
|
|
28969
|
+
throw new NdmError("UPLOAD_FAILED", "bind needs exactly one imported root");
|
|
28970
|
+
session.bind = options.bind;
|
|
28971
|
+
}
|
|
28700
28972
|
session.uploadStartTime = Date.now();
|
|
28701
28973
|
session.uploadPromise = doUpload(session, concurrency).catch((error) => {
|
|
28702
28974
|
var _a3;
|
|
@@ -28803,7 +29075,12 @@ async function doUpload(session, concurrency) {
|
|
|
28803
29075
|
credentials: "include",
|
|
28804
29076
|
signal: options.signal,
|
|
28805
29077
|
headers: { ...options.headers, "Content-Type": "application/json", ...token ? { Authorization: `Bearer ${token}` } : {} },
|
|
28806
|
-
body: JSON.stringify({
|
|
29078
|
+
body: JSON.stringify({
|
|
29079
|
+
objects: [...session.manifest.values()],
|
|
29080
|
+
roots: session.items.map((item) => item.objectId),
|
|
29081
|
+
qcid_links: session.qcidLinks,
|
|
29082
|
+
...session.bind ? { auto_bind: autoBindBody(session.bind) } : {}
|
|
29083
|
+
})
|
|
28807
29084
|
});
|
|
28808
29085
|
const body = await response.json();
|
|
28809
29086
|
if (!response.ok)
|
|
@@ -28814,11 +29091,34 @@ async function doUpload(session, concurrency) {
|
|
|
28814
29091
|
if (body.ready !== true || !Array.isArray(body.roots) || session.items.some((item) => !body.roots.some((root) => root.obj_id === item.objectId && root.ready === true))) {
|
|
28815
29092
|
throw new NdmError("OBJECT_NOT_READY", "NDM did not confirm all root objects and their dependencies are ready");
|
|
28816
29093
|
}
|
|
29094
|
+
if (session.bind) {
|
|
29095
|
+
if (!body.binding || typeof body.binding.obj_id !== "string")
|
|
29096
|
+
throw new NdmError("UPLOAD_FAILED", "finalize did not bind the imported root");
|
|
29097
|
+
session.binding = body.binding;
|
|
29098
|
+
}
|
|
28817
29099
|
session.objectStatus = "ready";
|
|
28818
29100
|
session.uploadStatus = session.transmittedBytes === 0 ? "not_required" : "completed";
|
|
28819
29101
|
session.materializationStatus = "all_in_store";
|
|
28820
29102
|
emitProgress(session);
|
|
28821
29103
|
}
|
|
29104
|
+
function autoBindBody(bind) {
|
|
29105
|
+
const body = { bucket_id: bind.bucketId, key: bind.key };
|
|
29106
|
+
if (bind.contentType !== void 0)
|
|
29107
|
+
body.content_type = bind.contentType;
|
|
29108
|
+
if (bind.metadata !== void 0)
|
|
29109
|
+
body.metadata = bind.metadata;
|
|
29110
|
+
if (bind.tags !== void 0)
|
|
29111
|
+
body.tags = bind.tags;
|
|
29112
|
+
if (bind.expiresAt !== void 0)
|
|
29113
|
+
body.expires_at = bind.expiresAt;
|
|
29114
|
+
if (bind.origin !== void 0)
|
|
29115
|
+
body.origin = bind.origin;
|
|
29116
|
+
if (bind.ifNoneMatch !== void 0)
|
|
29117
|
+
body.if_none_match = bind.ifNoneMatch;
|
|
29118
|
+
if (bind.ifMatch !== void 0)
|
|
29119
|
+
body.if_match = bind.ifMatch;
|
|
29120
|
+
return body;
|
|
29121
|
+
}
|
|
28822
29122
|
async function uploadMissingChunk(session, state, chunk, chunkIndex) {
|
|
28823
29123
|
var _a2, _b;
|
|
28824
29124
|
try {
|
|
@@ -29713,212 +30013,213 @@ class ExecutorCommandStream {
|
|
|
29713
30013
|
}
|
|
29714
30014
|
}
|
|
29715
30015
|
export {
|
|
29716
|
-
|
|
29717
|
-
|
|
30016
|
+
CONTACT_TAG_ZONE_AGENT as $,
|
|
30017
|
+
NOTIFY_ACTION_ANSWER as A,
|
|
29718
30018
|
BS_SERVICE_VERIFY_HUB as B,
|
|
29719
|
-
|
|
29720
|
-
|
|
30019
|
+
NOTIFY_ACTION_DISMISS as C,
|
|
30020
|
+
NOTIFY_LINK_PATH as D,
|
|
29721
30021
|
EXTERNAL_PRINCIPAL_CLAIM as E,
|
|
29722
|
-
|
|
29723
|
-
|
|
29724
|
-
|
|
29725
|
-
|
|
29726
|
-
|
|
29727
|
-
|
|
29728
|
-
|
|
30022
|
+
isNotifyClosed as F,
|
|
30023
|
+
notifyCategorySessionId as G,
|
|
30024
|
+
notifyCategoryFromSessionId as H,
|
|
30025
|
+
inputPrompt as I,
|
|
30026
|
+
promptOptions as J,
|
|
30027
|
+
notifyAnswerToTaskResult as K,
|
|
30028
|
+
validateNotifyAnswer as L,
|
|
29729
30029
|
MsgQueueClient as M,
|
|
29730
30030
|
NOTIFY_INTENT as N,
|
|
29731
|
-
|
|
29732
|
-
|
|
29733
|
-
|
|
30031
|
+
notifyUrl as O,
|
|
30032
|
+
msgMachineData as P,
|
|
30033
|
+
notifyMessageData as Q,
|
|
29734
30034
|
RuntimeType as R,
|
|
29735
30035
|
SystemConfigClient as S,
|
|
29736
|
-
|
|
29737
|
-
|
|
30036
|
+
commitNotifyAnswer as T,
|
|
30037
|
+
answerNotify as U,
|
|
29738
30038
|
VerifyHubClient as V,
|
|
29739
30039
|
WEB3_BRIDGE_HOST as W,
|
|
29740
|
-
|
|
29741
|
-
|
|
30040
|
+
waitNotify as X,
|
|
30041
|
+
FRIEND_INTENT as Y,
|
|
29742
30042
|
ZONE_USER_TYPES as Z,
|
|
29743
|
-
|
|
30043
|
+
CONTACT_TAG_ZONE_USER as _,
|
|
29744
30044
|
ndm_proxy as a,
|
|
29745
|
-
|
|
29746
|
-
|
|
29747
|
-
|
|
29748
|
-
|
|
29749
|
-
|
|
29750
|
-
|
|
29751
|
-
|
|
29752
|
-
|
|
29753
|
-
|
|
29754
|
-
|
|
29755
|
-
|
|
29756
|
-
|
|
29757
|
-
|
|
29758
|
-
|
|
29759
|
-
|
|
29760
|
-
|
|
29761
|
-
|
|
29762
|
-
|
|
29763
|
-
|
|
29764
|
-
|
|
29765
|
-
|
|
29766
|
-
|
|
29767
|
-
|
|
29768
|
-
|
|
29769
|
-
|
|
29770
|
-
|
|
29771
|
-
|
|
29772
|
-
|
|
29773
|
-
|
|
29774
|
-
|
|
29775
|
-
|
|
29776
|
-
|
|
29777
|
-
|
|
29778
|
-
|
|
29779
|
-
|
|
29780
|
-
|
|
29781
|
-
|
|
29782
|
-
|
|
29783
|
-
|
|
29784
|
-
|
|
29785
|
-
|
|
29786
|
-
|
|
29787
|
-
|
|
29788
|
-
|
|
29789
|
-
|
|
29790
|
-
|
|
29791
|
-
|
|
29792
|
-
|
|
29793
|
-
|
|
29794
|
-
|
|
29795
|
-
|
|
29796
|
-
|
|
29797
|
-
|
|
29798
|
-
|
|
29799
|
-
|
|
29800
|
-
|
|
29801
|
-
|
|
29802
|
-
|
|
29803
|
-
|
|
29804
|
-
|
|
29805
|
-
|
|
29806
|
-
|
|
29807
|
-
|
|
29808
|
-
|
|
30045
|
+
TASK_ERR_CONTROL_NOT_AVAILABLE as a$,
|
|
30046
|
+
CONTACT_TAG_HOMESTATION_FOLLOWING as a0,
|
|
30047
|
+
CONTACT_CHANGED_EVENT_BOX as a1,
|
|
30048
|
+
WELL_KNOWN_CONTACT_TAGS as a2,
|
|
30049
|
+
USER_TYPE_GROUP_REF_PREFIX as a3,
|
|
30050
|
+
USER_GROUP_REF_PREFIX as a4,
|
|
30051
|
+
contactTagApp as a5,
|
|
30052
|
+
contactTagKind as a6,
|
|
30053
|
+
isUserGroupRefTag as a7,
|
|
30054
|
+
DENY_REASONS as a8,
|
|
30055
|
+
ACCESS_DENIED_ERROR_CODE as a9,
|
|
30056
|
+
HUMAN_APPROVAL_SCHEMA_ID as aA,
|
|
30057
|
+
DOWNLOAD_TASK_SCHEMA_ID as aB,
|
|
30058
|
+
SCHEDULER_DISPATCH_THUNK_TASK_SCHEMA_ID as aC,
|
|
30059
|
+
WORKFLOW_RUN_TREE_TASK_SCHEMA_ID as aD,
|
|
30060
|
+
WORKFLOW_STEP_TASK_SCHEMA_ID as aE,
|
|
30061
|
+
WORKFLOW_MAP_SHARD_TASK_SCHEMA_ID as aF,
|
|
30062
|
+
WORKFLOW_THUNK_TASK_SCHEMA_ID as aG,
|
|
30063
|
+
WORKFLOW_SCHEDULE_TASK_SCHEMA_ID as aH,
|
|
30064
|
+
WORKFLOW_SEND_MESSAGE_TASK_SCHEMA_ID as aI,
|
|
30065
|
+
WORKFLOW_EXECUTE_RPC_TASK_SCHEMA_ID as aJ,
|
|
30066
|
+
WORKFLOW_RUN_TARGET_TASK_SCHEMA_ID as aK,
|
|
30067
|
+
AGENT_DELEGATE_TASK_SCHEMA_ID as aL,
|
|
30068
|
+
HUMAN_INPUT_TASK_SCHEMA_ID as aM,
|
|
30069
|
+
OPENDAN_ASYNC_TOOL_TASK_SCHEMA_ID as aN,
|
|
30070
|
+
OPENDAN_COMMAND_TASK_SCHEMA_ID as aO,
|
|
30071
|
+
TOOL_EXEC_BASH_TASK_SCHEMA_ID as aP,
|
|
30072
|
+
AICC_COMPUTE_TASK_SCHEMA_ID as aQ,
|
|
30073
|
+
APP_INSTALL_TASK_SCHEMA_ID as aR,
|
|
30074
|
+
APP_UNINSTALL_TASK_SCHEMA_ID as aS,
|
|
30075
|
+
APP_START_TASK_SCHEMA_ID as aT,
|
|
30076
|
+
APP_UPDATE_TASK_SCHEMA_ID as aU,
|
|
30077
|
+
APP_UPDATE_BATCH_TASK_SCHEMA_ID as aV,
|
|
30078
|
+
TASK_ERR_NOT_FOUND as aW,
|
|
30079
|
+
TASK_ERR_PERMISSION_DENIED as aX,
|
|
30080
|
+
TASK_ERR_REVISION_CONFLICT as aY,
|
|
30081
|
+
TASK_ERR_STALE_RUNNER_EPOCH as aZ,
|
|
30082
|
+
TASK_ERR_INVALID_PHASE as a_,
|
|
30083
|
+
parseAccessDenial as aa,
|
|
30084
|
+
accessDenialOf as ab,
|
|
30085
|
+
ANONYMOUS_IDENTITY as ac,
|
|
30086
|
+
parseCurrentIdentity as ad,
|
|
30087
|
+
identityKey as ae,
|
|
30088
|
+
identityAllows as af,
|
|
30089
|
+
DEFAULT_JUMP_BASE_URL as ag,
|
|
30090
|
+
JUMP_ACTION_PATHS as ah,
|
|
30091
|
+
normalizeZoneHostname as ai,
|
|
30092
|
+
zoneActionUrl as aj,
|
|
30093
|
+
buildJumpUrl as ak,
|
|
30094
|
+
APP_LOGIN_ISSUE_METHOD as al,
|
|
30095
|
+
APP_LOGIN_EXCHANGE_METHOD as am,
|
|
30096
|
+
APP_LOGIN_SETTINGS_GET_METHOD as an,
|
|
30097
|
+
APP_LOGIN_SETTINGS_SET_METHOD as ao,
|
|
30098
|
+
issueAppLoginCode as ap,
|
|
30099
|
+
issueAppCustomerLink as aq,
|
|
30100
|
+
parseAppLoginExchangeResult as ar,
|
|
30101
|
+
randomAppLoginNonce as as,
|
|
30102
|
+
loginByAppAccessToken as at,
|
|
30103
|
+
completeAppAccessTokenLogin as au,
|
|
30104
|
+
TASK_MANAGER_SERVICE_UNIQUE_ID as av,
|
|
30105
|
+
TASK_MANAGER_SERVICE_NAME as aw,
|
|
30106
|
+
TASK_MANAGER_SERVICE_PORT as ax,
|
|
30107
|
+
TASK_POLICY_PRESET_COLLABORATIVE_TREE_V1 as ay,
|
|
30108
|
+
RAW_TASK_SCHEMA_ID as az,
|
|
29809
30109
|
bns_client as b,
|
|
29810
|
-
|
|
29811
|
-
|
|
29812
|
-
|
|
29813
|
-
|
|
29814
|
-
|
|
29815
|
-
|
|
29816
|
-
|
|
29817
|
-
|
|
29818
|
-
|
|
29819
|
-
|
|
29820
|
-
|
|
29821
|
-
|
|
29822
|
-
|
|
29823
|
-
|
|
29824
|
-
|
|
29825
|
-
|
|
29826
|
-
|
|
29827
|
-
|
|
29828
|
-
|
|
29829
|
-
|
|
29830
|
-
|
|
29831
|
-
|
|
29832
|
-
|
|
29833
|
-
|
|
29834
|
-
|
|
29835
|
-
|
|
29836
|
-
|
|
29837
|
-
|
|
29838
|
-
|
|
29839
|
-
|
|
29840
|
-
|
|
29841
|
-
|
|
29842
|
-
|
|
29843
|
-
|
|
29844
|
-
|
|
29845
|
-
|
|
29846
|
-
|
|
29847
|
-
|
|
29848
|
-
|
|
29849
|
-
|
|
29850
|
-
|
|
29851
|
-
|
|
29852
|
-
|
|
29853
|
-
|
|
29854
|
-
|
|
29855
|
-
|
|
29856
|
-
|
|
29857
|
-
|
|
29858
|
-
|
|
29859
|
-
|
|
29860
|
-
|
|
29861
|
-
|
|
29862
|
-
|
|
29863
|
-
|
|
29864
|
-
|
|
29865
|
-
|
|
29866
|
-
|
|
29867
|
-
|
|
29868
|
-
|
|
29869
|
-
|
|
29870
|
-
|
|
29871
|
-
|
|
29872
|
-
|
|
29873
|
-
|
|
30110
|
+
KEventReader as b$,
|
|
30111
|
+
TASK_ERR_CONTROL_ALREADY_PENDING as b0,
|
|
30112
|
+
TASK_ERR_ALREADY_COMPLETED as b1,
|
|
30113
|
+
TASK_ERR_INPUT_SCHEMA_MISMATCH as b2,
|
|
30114
|
+
TASK_ERR_RESULT_SCHEMA_MISMATCH as b3,
|
|
30115
|
+
TASK_ERR_IDEMPOTENCY_CONFLICT as b4,
|
|
30116
|
+
TASK_ERR_SCHEMA_NOT_FOUND as b5,
|
|
30117
|
+
TASK_MGR_ERROR_CODES as b6,
|
|
30118
|
+
taskMgrTaskEventPath as b7,
|
|
30119
|
+
taskMgrTreeEventPath as b8,
|
|
30120
|
+
taskMgrErrorCode as b9,
|
|
30121
|
+
WorkflowClient as bA,
|
|
30122
|
+
AICC_SERVICE_UNIQUE_ID as bB,
|
|
30123
|
+
AICC_SERVICE_SERVICE_NAME as bC,
|
|
30124
|
+
AICC_SERVICE_SERVICE_PORT as bD,
|
|
30125
|
+
AICC_AI_METHODS as bE,
|
|
30126
|
+
AICC_CORE_METHODS as bF,
|
|
30127
|
+
AICC_MANAGEMENT_METHODS as bG,
|
|
30128
|
+
AICC_QUOTA_METHODS as bH,
|
|
30129
|
+
AICC_METHODS as bI,
|
|
30130
|
+
AICC_FEATURES as bJ,
|
|
30131
|
+
AICC_EXECUTION_MODES as bK,
|
|
30132
|
+
AICC_POLICY_REFUSAL_CODES as bL,
|
|
30133
|
+
aiccRefusalOf as bM,
|
|
30134
|
+
isAiccAiMethod as bN,
|
|
30135
|
+
aiccTextMessage as bO,
|
|
30136
|
+
aiccMessageTextContent as bP,
|
|
30137
|
+
aiccMessageFirstText as bQ,
|
|
30138
|
+
validateAiccMessage as bR,
|
|
30139
|
+
AiccClient as bS,
|
|
30140
|
+
decisionRequirements as bT,
|
|
30141
|
+
validateDecisionRequest as bU,
|
|
30142
|
+
validateDecisionAnswers as bV,
|
|
30143
|
+
parseVideoPrompt as bW,
|
|
30144
|
+
validateVideoOutput as bX,
|
|
30145
|
+
validateVideoGeneration as bY,
|
|
30146
|
+
validateVideoEdit as bZ,
|
|
30147
|
+
videoGenerationRequirement as b_,
|
|
30148
|
+
TaskExecutorKind as ba,
|
|
30149
|
+
TaskPhase as bb,
|
|
30150
|
+
isTerminalTaskPhase as bc,
|
|
30151
|
+
TaskWaitReasonKind as bd,
|
|
30152
|
+
TaskOutcome as be,
|
|
30153
|
+
TaskControlAction as bf,
|
|
30154
|
+
baselineTaskControlProfile as bg,
|
|
30155
|
+
DEFAULT_CHILD_CONTROL_POLICY as bh,
|
|
30156
|
+
TaskAction as bi,
|
|
30157
|
+
TaskGrantScope as bj,
|
|
30158
|
+
TaskDataScope as bk,
|
|
30159
|
+
StorageDomain as bl,
|
|
30160
|
+
TaskEventType as bm,
|
|
30161
|
+
TaskManagerClient as bn,
|
|
30162
|
+
WORKFLOW_SERVICE_NAME as bo,
|
|
30163
|
+
WorkflowStepType as bp,
|
|
30164
|
+
WorkflowOutputMode as bq,
|
|
30165
|
+
WorkflowJoinMode as br,
|
|
30166
|
+
WorkflowRetryFallback as bs,
|
|
30167
|
+
WorkflowDefinitionStatus as bt,
|
|
30168
|
+
WorkflowRunStatus as bu,
|
|
30169
|
+
WorkflowNodeRunState as bv,
|
|
30170
|
+
WorkflowHumanActionKind as bw,
|
|
30171
|
+
WorkflowScheduledTaskStatus as bx,
|
|
30172
|
+
WorkflowScheduledTaskMisfirePolicy as by,
|
|
30173
|
+
WorkflowScheduledTaskFireStatus as bz,
|
|
29874
30174
|
createSDKModule as c,
|
|
29875
|
-
|
|
29876
|
-
|
|
29877
|
-
|
|
29878
|
-
|
|
29879
|
-
|
|
29880
|
-
|
|
29881
|
-
|
|
29882
|
-
|
|
29883
|
-
|
|
29884
|
-
|
|
29885
|
-
|
|
29886
|
-
|
|
29887
|
-
|
|
29888
|
-
|
|
29889
|
-
|
|
29890
|
-
|
|
29891
|
-
|
|
29892
|
-
|
|
29893
|
-
|
|
29894
|
-
|
|
29895
|
-
|
|
29896
|
-
|
|
29897
|
-
|
|
29898
|
-
|
|
29899
|
-
|
|
29900
|
-
|
|
29901
|
-
|
|
29902
|
-
|
|
30175
|
+
KEventClient as c0,
|
|
30176
|
+
appIdFromDid as c1,
|
|
30177
|
+
parseAppId as c2,
|
|
30178
|
+
appDidFromId as c3,
|
|
30179
|
+
createAppInstanceId as c4,
|
|
30180
|
+
parseAppInstanceId as c5,
|
|
30181
|
+
BNS_EVM_DEFAULT_GAS_LIMIT as c6,
|
|
30182
|
+
BNS_EVM_DEFAULT_MAX_FEE_PER_GAS as c7,
|
|
30183
|
+
BNS_EVM_DEFAULT_MAX_PRIORITY_FEE_PER_GAS as c8,
|
|
30184
|
+
BNS_MAX_INLINE_DOCUMENT_BYTES as c9,
|
|
30185
|
+
BNS_DNS_TXT_DEFAULT_TTL as ca,
|
|
30186
|
+
BNS_DNS_TXT_DOC_TYPE as cb,
|
|
30187
|
+
BNS_PUBLISH_DOCUMENT_ABI as cc,
|
|
30188
|
+
BnsEvmTxError as cd,
|
|
30189
|
+
BnsEvmTxBuilder as ce,
|
|
30190
|
+
decodeBnsPublishDocumentCalldata as cf,
|
|
30191
|
+
BnsTxExecutorError as cg,
|
|
30192
|
+
walletUserHasSnAccount as ch,
|
|
30193
|
+
BnsTxExecutor as ci,
|
|
30194
|
+
ExecutorClient as cj,
|
|
30195
|
+
ExecutorStreamError as ck,
|
|
30196
|
+
encodeExecutorControl as cl,
|
|
30197
|
+
ExecutorCommandStream as cm,
|
|
30198
|
+
AIWORKSPACE_SERVICE_NAME as cn,
|
|
30199
|
+
AiwsFailure as co,
|
|
30200
|
+
AiWorkspaceClient as cp,
|
|
30201
|
+
bucket_client as d,
|
|
30202
|
+
BS_SERVICE_TASK_MANAGER as e,
|
|
30203
|
+
getActiveRuntimeType as f,
|
|
29903
30204
|
getCurrentWalletUserFromHost as g,
|
|
29904
|
-
|
|
29905
|
-
|
|
29906
|
-
|
|
29907
|
-
|
|
29908
|
-
|
|
29909
|
-
|
|
30205
|
+
getActiveZoneGatewayOrigin as h,
|
|
30206
|
+
getActiveSessionToken as i,
|
|
30207
|
+
BuckyOSSDK as j,
|
|
30208
|
+
RepoClient as k,
|
|
30209
|
+
parseZoneUserType as l,
|
|
30210
|
+
isExternalPrincipal as m,
|
|
29910
30211
|
ndm_client as n,
|
|
29911
|
-
|
|
30212
|
+
RPCError as o,
|
|
29912
30213
|
parseSessionTokenClaims as p,
|
|
29913
|
-
|
|
30214
|
+
MsgCenterClient as q,
|
|
29914
30215
|
resolveDidFromHost as r,
|
|
29915
30216
|
sn_client as s,
|
|
29916
|
-
|
|
29917
|
-
|
|
29918
|
-
|
|
29919
|
-
|
|
29920
|
-
|
|
29921
|
-
|
|
29922
|
-
|
|
30217
|
+
mailboxAddress as t,
|
|
30218
|
+
mailboxResource as u,
|
|
30219
|
+
NOTIFY_DELIVERED_INTENT as v,
|
|
30220
|
+
NOTIFY_DATA_VERSION as w,
|
|
30221
|
+
NOTIFY_SESSION_PREFIX as x,
|
|
30222
|
+
NOTIFY_CHOICE_CONTROL_ID as y,
|
|
30223
|
+
NOTIFY_TEXT_CONTROL_ID as z
|
|
29923
30224
|
};
|
|
29924
|
-
//# sourceMappingURL=executor_client-
|
|
30225
|
+
//# sourceMappingURL=executor_client-84d7a70d.mjs.map
|