buckyos 0.7.169 → 0.7.170
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/dist/cli.mjs +1 -1
- package/cli/dist/cli.mjs.map +1 -1
- package/cli/version.ts +1 -1
- package/dist/app-frame.cjs +1 -1
- package/dist/app-frame.cjs.map +1 -1
- package/dist/app-frame.mjs +1 -0
- package/dist/app-frame.mjs.map +1 -1
- package/dist/browser.cjs +1 -1
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.mjs +212 -211
- package/dist/browser.mjs.map +1 -1
- package/dist/content.cjs +1 -1
- package/dist/content.cjs.map +1 -1
- package/dist/content.d.ts +2 -1
- package/dist/content.d.ts.map +1 -1
- package/dist/content.mjs +32 -167
- package/dist/content.mjs.map +1 -1
- package/dist/content_mime-dc80d960.js +2 -0
- package/dist/content_mime-dc80d960.js.map +1 -0
- package/dist/content_mime-e42d5f8d.mjs +335 -0
- package/dist/content_mime-e42d5f8d.mjs.map +1 -0
- package/dist/content_mime.d.ts +18 -0
- package/dist/content_mime.d.ts.map +1 -1
- package/dist/executor_client-1ee523cf.js +13 -0
- package/dist/executor_client-1ee523cf.js.map +1 -0
- package/dist/{executor_client-a32bc377.mjs → executor_client-5f4d0468.mjs} +1751 -286
- package/dist/executor_client-5f4d0468.mjs.map +1 -0
- package/dist/file_meta.d.ts +26 -0
- package/dist/file_meta.d.ts.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +217 -216
- package/dist/index.mjs.map +1 -1
- package/dist/msg_center_client.d.ts +2 -1
- package/dist/msg_center_client.d.ts.map +1 -1
- package/dist/namelib.d.ts.map +1 -1
- package/dist/ndm_client.d.ts +7 -0
- package/dist/ndm_client.d.ts.map +1 -1
- package/dist/ndn.d.ts +3 -0
- package/dist/ndn.d.ts.map +1 -0
- package/dist/ndn_types-8c2696d5.js +2 -0
- package/dist/ndn_types-8c2696d5.js.map +1 -0
- package/dist/{namelib-b41b10cc.mjs → ndn_types-ab30fac0.mjs} +3077 -2697
- package/dist/ndn_types-ab30fac0.mjs.map +1 -0
- package/dist/ndn_types.d.ts +268 -16
- package/dist/ndn_types.d.ts.map +1 -1
- package/dist/node.cjs +1 -1
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.d.ts.map +1 -1
- package/dist/node.mjs +212 -211
- package/dist/node.mjs.map +1 -1
- package/dist/provision.cjs +2 -2
- package/dist/provision.cjs.map +1 -1
- package/dist/provision.d.ts +1 -2
- package/dist/provision.d.ts.map +1 -1
- package/dist/provision.mjs +3 -31
- package/dist/provision.mjs.map +1 -1
- package/dist/repo_client.d.ts +2 -1
- package/dist/repo_client.d.ts.map +1 -1
- package/dist/{tus_client-4f7254e9.js → tus_client-b231b248.js} +2 -2
- package/dist/{tus_client-4f7254e9.js.map → tus_client-b231b248.js.map} +1 -1
- package/dist/{tus_client-04080b1e.mjs → tus_client-d1ffe2d6.mjs} +2 -2
- package/dist/{tus_client-04080b1e.mjs.map → tus_client-d1ffe2d6.mjs.map} +1 -1
- package/package.json +1 -1
- package/dist/executor_client-a32bc377.mjs.map +0 -1
- package/dist/executor_client-e026942b.js +0 -13
- package/dist/executor_client-e026942b.js.map +0 -1
- package/dist/namelib-b41b10cc.mjs.map +0 -1
- package/dist/namelib-f8ff0045.js +0 -2
- package/dist/namelib-f8ff0045.js.map +0 -1
package/dist/browser.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { c as createSDKModule } from "./executor_client-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { c as createSDKModule } from "./executor_client-5f4d0468.mjs";
|
|
2
|
+
import { ab, aN, bI, aS, bJ, bO, bN, bK, bM, bP, bL, bG, bH, bF, ae, aT, ao, an, ap, aq, aV, aU, aX, aW, bW, ce, cf, ca, cb, cc, cd, cg, f, B, ci, ch, cm, ck, k, a3, a2, a1, a0, bj, ai, aa, aD, E, cn, cq, co, $, aC, aO, aj, c4, c3, u, M, D, F, A, y, x, N, G, z, C, aP, aQ, aB, t, l, R, aE, bn, S, b3, b2, b1, b6, b4, b0, aY, aZ, b5, a_, b7, a$, ay, az, ax, b8, aA, aR, bk, bh, bm, bo, bc, bl, bp, bg, bd, bf, a6, a5, V, W, a4, aL, aH, aM, aF, aJ, aK, bq, aG, aI, bE, bx, br, bA, bv, bz, bu, bs, bw, by, bD, bC, bB, bt, Z, ad, bU, bT, bQ, bS, Y, c7, c5, bi, b, e, am, X, aw, a7, a8, c8, bX, cj, cp, h, j, i, g, ah, ag, K, bR, q, H, be, a9, as, ar, av, v, w, T, a, d, n, ak, O, J, I, U, Q, o, ac, c6, c9, at, af, p, b_, m, L, au, r, s, bb, b9, ba, bV, bZ, bY, P, c1, c0, b$, c2, _, cl, al } from "./executor_client-5f4d0468.mjs";
|
|
3
|
+
import { a as a10, D as D2, N as N2, s as s2, r as r2, h as h2, g as g2, k as k2, f as f2, c, e as e2, b as b10, d as d2, l as l2, j as j2, i as i2, n as n2, q as q2, o as o2, m as m2, p as p2 } from "./ndn_types-ab30fac0.mjs";
|
|
4
|
+
import "./content_mime-e42d5f8d.mjs";
|
|
4
5
|
const sdkModule = createSDKModule("browser");
|
|
5
6
|
const buckyos = sdkModule.buckyos;
|
|
6
7
|
const initBuckyOS = sdkModule.initBuckyOS;
|
|
@@ -37,172 +38,172 @@ const getSystemConfigClient = sdkModule.getSystemConfigClient;
|
|
|
37
38
|
const getTaskManagerClient = sdkModule.getTaskManagerClient;
|
|
38
39
|
const getWorkflowClient = sdkModule.getWorkflowClient;
|
|
39
40
|
export {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
41
|
+
ab as ACCESS_DENIED_ERROR_CODE,
|
|
42
|
+
aN as AGENT_DELEGATE_TASK_SCHEMA_ID,
|
|
43
|
+
bI as AICC_AI_METHODS,
|
|
44
|
+
aS as AICC_COMPUTE_TASK_SCHEMA_ID,
|
|
45
|
+
bJ as AICC_CORE_METHODS,
|
|
46
|
+
bO as AICC_EXECUTION_MODES,
|
|
47
|
+
bN as AICC_FEATURES,
|
|
48
|
+
bK as AICC_MANAGEMENT_METHODS,
|
|
49
|
+
bM as AICC_METHODS,
|
|
50
|
+
bP as AICC_POLICY_REFUSAL_CODES,
|
|
51
|
+
bL as AICC_QUOTA_METHODS,
|
|
52
|
+
bG as AICC_SERVICE_SERVICE_NAME,
|
|
53
|
+
bH as AICC_SERVICE_SERVICE_PORT,
|
|
54
|
+
bF as AICC_SERVICE_UNIQUE_ID,
|
|
55
|
+
ae as ANONYMOUS_IDENTITY,
|
|
56
|
+
aT as APP_INSTALL_TASK_SCHEMA_ID,
|
|
57
|
+
ao as APP_LOGIN_EXCHANGE_METHOD,
|
|
58
|
+
an as APP_LOGIN_ISSUE_METHOD,
|
|
59
|
+
ap as APP_LOGIN_SETTINGS_GET_METHOD,
|
|
60
|
+
aq as APP_LOGIN_SETTINGS_SET_METHOD,
|
|
61
|
+
aV as APP_START_TASK_SCHEMA_ID,
|
|
62
|
+
aU as APP_UNINSTALL_TASK_SCHEMA_ID,
|
|
63
|
+
aX as APP_UPDATE_BATCH_TASK_SCHEMA_ID,
|
|
64
|
+
aW as APP_UPDATE_TASK_SCHEMA_ID,
|
|
65
|
+
bW as AiccClient,
|
|
66
|
+
ce as BNS_DNS_TXT_DEFAULT_TTL,
|
|
67
|
+
cf as BNS_DNS_TXT_DOC_TYPE,
|
|
68
|
+
ca as BNS_EVM_DEFAULT_GAS_LIMIT,
|
|
69
|
+
cb as BNS_EVM_DEFAULT_MAX_FEE_PER_GAS,
|
|
70
|
+
cc as BNS_EVM_DEFAULT_MAX_PRIORITY_FEE_PER_GAS,
|
|
71
|
+
cd as BNS_MAX_INLINE_DOCUMENT_BYTES,
|
|
72
|
+
cg as BNS_PUBLISH_DOCUMENT_ABI,
|
|
73
|
+
f as BS_SERVICE_TASK_MANAGER,
|
|
73
74
|
B as BS_SERVICE_VERIFY_HUB,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
75
|
+
ci as BnsEvmTxBuilder,
|
|
76
|
+
ch as BnsEvmTxError,
|
|
77
|
+
cm as BnsTxExecutor,
|
|
78
|
+
ck as BnsTxExecutorError,
|
|
79
|
+
k as BuckyOSSDK,
|
|
80
|
+
a3 as CONTACT_CHANGED_EVENT_PATTERN,
|
|
81
|
+
a2 as CONTACT_TAG_HOMESTATION_FOLLOWING,
|
|
82
|
+
a1 as CONTACT_TAG_ZONE_AGENT,
|
|
83
|
+
a0 as CONTACT_TAG_ZONE_USER,
|
|
84
|
+
bj as DEFAULT_CHILD_CONTROL_POLICY,
|
|
85
|
+
ai as DEFAULT_JUMP_BASE_URL,
|
|
86
|
+
aa as DENY_REASONS,
|
|
87
|
+
a10 as DID_OBJECT_SERVICE_ID,
|
|
87
88
|
D2 as DID_OBJECT_SERVICE_TYPE,
|
|
88
|
-
|
|
89
|
+
aD as DOWNLOAD_TASK_SCHEMA_ID,
|
|
89
90
|
E as EXTERNAL_PRINCIPAL_CLAIM,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
91
|
+
cn as ExecutorClient,
|
|
92
|
+
cq as ExecutorCommandStream,
|
|
93
|
+
co as ExecutorStreamError,
|
|
94
|
+
$ as FRIEND_INTENT,
|
|
95
|
+
aC as HUMAN_APPROVAL_SCHEMA_ID,
|
|
96
|
+
aO as HUMAN_INPUT_TASK_SCHEMA_ID,
|
|
97
|
+
aj as JUMP_ACTION_PATHS,
|
|
98
|
+
c4 as KEventClient,
|
|
99
|
+
c3 as KEventReader,
|
|
100
|
+
u as MsgCenterClient,
|
|
100
101
|
M as MsgQueueClient,
|
|
101
102
|
N2 as NODE_IDENTITY_SCHEMA_V2,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
D as NOTIFY_ACTION_ANSWER,
|
|
104
|
+
F as NOTIFY_ACTION_DISMISS,
|
|
105
|
+
A as NOTIFY_CHOICE_CONTROL_ID,
|
|
106
|
+
y as NOTIFY_DATA_VERSION,
|
|
107
|
+
x as NOTIFY_DELIVERED_INTENT,
|
|
107
108
|
N as NOTIFY_INTENT,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
109
|
+
G as NOTIFY_LINK_PATH,
|
|
110
|
+
z as NOTIFY_SESSION_PREFIX,
|
|
111
|
+
C as NOTIFY_TEXT_CONTROL_ID,
|
|
112
|
+
aP as OPENDAN_ASYNC_TOOL_TASK_SCHEMA_ID,
|
|
113
|
+
aQ as OPENDAN_COMMAND_TASK_SCHEMA_ID,
|
|
114
|
+
aB as RAW_TASK_SCHEMA_ID,
|
|
115
|
+
t as RPCError,
|
|
116
|
+
l as RepoClient,
|
|
116
117
|
R as RuntimeType,
|
|
117
|
-
|
|
118
|
-
|
|
118
|
+
aE as SCHEDULER_DISPATCH_THUNK_TASK_SCHEMA_ID,
|
|
119
|
+
bn as StorageDomain,
|
|
119
120
|
S as SystemConfigClient,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
121
|
+
b3 as TASK_ERR_ALREADY_COMPLETED,
|
|
122
|
+
b2 as TASK_ERR_CONTROL_ALREADY_PENDING,
|
|
123
|
+
b1 as TASK_ERR_CONTROL_NOT_AVAILABLE,
|
|
124
|
+
b6 as TASK_ERR_IDEMPOTENCY_CONFLICT,
|
|
125
|
+
b4 as TASK_ERR_INPUT_SCHEMA_MISMATCH,
|
|
126
|
+
b0 as TASK_ERR_INVALID_PHASE,
|
|
127
|
+
aY as TASK_ERR_NOT_FOUND,
|
|
128
|
+
aZ as TASK_ERR_PERMISSION_DENIED,
|
|
129
|
+
b5 as TASK_ERR_RESULT_SCHEMA_MISMATCH,
|
|
130
|
+
a_ as TASK_ERR_REVISION_CONFLICT,
|
|
131
|
+
b7 as TASK_ERR_SCHEMA_NOT_FOUND,
|
|
132
|
+
a$ as TASK_ERR_STALE_RUNNER_EPOCH,
|
|
133
|
+
ay as TASK_MANAGER_SERVICE_NAME,
|
|
134
|
+
az as TASK_MANAGER_SERVICE_PORT,
|
|
135
|
+
ax as TASK_MANAGER_SERVICE_UNIQUE_ID,
|
|
136
|
+
b8 as TASK_MGR_ERROR_CODES,
|
|
137
|
+
aA as TASK_POLICY_PRESET_COLLABORATIVE_TREE_V1,
|
|
138
|
+
aR as TOOL_EXEC_BASH_TASK_SCHEMA_ID,
|
|
139
|
+
bk as TaskAction,
|
|
140
|
+
bh as TaskControlAction,
|
|
141
|
+
bm as TaskDataScope,
|
|
142
|
+
bo as TaskEventType,
|
|
143
|
+
bc as TaskExecutorKind,
|
|
144
|
+
bl as TaskGrantScope,
|
|
145
|
+
bp as TaskManagerClient,
|
|
146
|
+
bg as TaskOutcome,
|
|
147
|
+
bd as TaskPhase,
|
|
148
|
+
bf as TaskWaitReasonKind,
|
|
149
|
+
a6 as USER_GROUP_REF_PREFIX,
|
|
150
|
+
a5 as USER_TYPE_GROUP_REF_PREFIX,
|
|
150
151
|
V as VerifyHubClient,
|
|
151
152
|
W as WEB3_BRIDGE_HOST,
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
153
|
+
a4 as WELL_KNOWN_CONTACT_TAGS,
|
|
154
|
+
aL as WORKFLOW_EXECUTE_RPC_TASK_SCHEMA_ID,
|
|
155
|
+
aH as WORKFLOW_MAP_SHARD_TASK_SCHEMA_ID,
|
|
156
|
+
aM as WORKFLOW_RUN_TARGET_TASK_SCHEMA_ID,
|
|
157
|
+
aF as WORKFLOW_RUN_TREE_TASK_SCHEMA_ID,
|
|
158
|
+
aJ as WORKFLOW_SCHEDULE_TASK_SCHEMA_ID,
|
|
159
|
+
aK as WORKFLOW_SEND_MESSAGE_TASK_SCHEMA_ID,
|
|
160
|
+
bq as WORKFLOW_SERVICE_NAME,
|
|
161
|
+
aG as WORKFLOW_STEP_TASK_SCHEMA_ID,
|
|
162
|
+
aI as WORKFLOW_THUNK_TASK_SCHEMA_ID,
|
|
163
|
+
bE as WorkflowClient,
|
|
164
|
+
bx as WorkflowDefinitionStatus,
|
|
165
|
+
br as WorkflowErrorCode,
|
|
166
|
+
bA as WorkflowHumanActionKind,
|
|
167
|
+
bv as WorkflowJoinMode,
|
|
168
|
+
bz as WorkflowNodeRunState,
|
|
169
|
+
bu as WorkflowOutputMode,
|
|
170
|
+
bs as WorkflowRequestError,
|
|
171
|
+
bw as WorkflowRetryFallback,
|
|
172
|
+
by as WorkflowRunStatus,
|
|
173
|
+
bD as WorkflowScheduledTaskFireStatus,
|
|
174
|
+
bC as WorkflowScheduledTaskMisfirePolicy,
|
|
175
|
+
bB as WorkflowScheduledTaskStatus,
|
|
176
|
+
bt as WorkflowStepType,
|
|
176
177
|
Z as ZONE_USER_TYPES,
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
178
|
+
ad as accessDenialOf,
|
|
179
|
+
bU as aiccMessageFirstText,
|
|
180
|
+
bT as aiccMessageTextContent,
|
|
181
|
+
bQ as aiccRefusalOf,
|
|
182
|
+
bS as aiccTextMessage,
|
|
183
|
+
Y as answerNotify,
|
|
184
|
+
c7 as appDidFromId,
|
|
185
|
+
c5 as appIdFromDid,
|
|
185
186
|
attachEvent,
|
|
186
|
-
|
|
187
|
+
bi as baselineTaskControlProfile,
|
|
187
188
|
b as bns,
|
|
188
|
-
|
|
189
|
+
e as bucket,
|
|
189
190
|
buckyos,
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
191
|
+
am as buildJumpUrl,
|
|
192
|
+
X as commitNotifyAnswer,
|
|
193
|
+
aw as completeAppAccessTokenLogin,
|
|
194
|
+
a7 as contactTagApp,
|
|
195
|
+
a8 as contactTagKind,
|
|
196
|
+
c8 as createAppInstanceId,
|
|
196
197
|
createEventReader,
|
|
197
198
|
createSDKModule,
|
|
198
199
|
create_event_reader,
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
bX as decisionRequirements,
|
|
201
|
+
cj as decodeBnsPublishDocumentCalldata,
|
|
202
|
+
cp as encodeExecutorControl,
|
|
202
203
|
getAccountInfo,
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
204
|
+
h as getActiveRuntimeType,
|
|
205
|
+
j as getActiveSessionToken,
|
|
206
|
+
i as getActiveZoneGatewayOrigin,
|
|
206
207
|
getAppDataDir,
|
|
207
208
|
getAppDid,
|
|
208
209
|
getAppId,
|
|
@@ -212,8 +213,8 @@ export {
|
|
|
212
213
|
getCurrentIdentity,
|
|
213
214
|
getCurrentWalletUser,
|
|
214
215
|
g as getCurrentWalletUserFromHost,
|
|
215
|
-
|
|
216
|
-
|
|
216
|
+
s2 as getDidIdentifier,
|
|
217
|
+
r2 as getDidMethod,
|
|
217
218
|
getKEventClient,
|
|
218
219
|
getRuntimeType,
|
|
219
220
|
getServiceRpcClient,
|
|
@@ -224,82 +225,82 @@ export {
|
|
|
224
225
|
getZoneHostName,
|
|
225
226
|
getZoneServiceURL,
|
|
226
227
|
h2 as hashPassword,
|
|
227
|
-
|
|
228
|
-
|
|
228
|
+
ah as identityAllows,
|
|
229
|
+
ag as identityKey,
|
|
229
230
|
initBuckyOS,
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
231
|
+
K as inputPrompt,
|
|
232
|
+
bR as isAiccAiMethod,
|
|
233
|
+
g2 as isBuckyOSAgentDocument,
|
|
234
|
+
k2 as isBuckyOSDIDObjectCard,
|
|
235
|
+
f2 as isBuckyOSDeviceDocument,
|
|
236
|
+
c as isBuckyOSDeviceMiniDocument,
|
|
237
|
+
e2 as isBuckyOSLocalNodeIdentityConfig,
|
|
238
|
+
b10 as isBuckyOSOwnerDocument,
|
|
239
|
+
d2 as isBuckyOSZoneBootDocument,
|
|
240
|
+
l2 as isBuckyOSZoneConfig,
|
|
241
|
+
j2 as isBuckyOSZoneDocument,
|
|
242
|
+
q as isExternalPrincipal,
|
|
243
|
+
H as isNotifyClosed,
|
|
244
|
+
be as isTerminalTaskPhase,
|
|
245
|
+
a9 as isUserGroupRefTag,
|
|
245
246
|
i2 as isW3CDIDDocumentBase,
|
|
246
|
-
|
|
247
|
-
|
|
247
|
+
as as issueAppCustomerLink,
|
|
248
|
+
ar as issueAppLoginCode,
|
|
248
249
|
login,
|
|
249
|
-
|
|
250
|
+
av as loginByAppAccessToken,
|
|
250
251
|
loginByBrowserSSO,
|
|
251
252
|
loginByPassword,
|
|
252
253
|
loginByRuntimeSession,
|
|
253
254
|
logout,
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
255
|
+
v as mailboxAddress,
|
|
256
|
+
w as mailboxResource,
|
|
257
|
+
T as msgMachineData,
|
|
257
258
|
n2 as namelib,
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
259
|
+
a as ndm,
|
|
260
|
+
d as ndm_proxy,
|
|
261
|
+
n as ndn,
|
|
262
|
+
ak as normalizeZoneHostname,
|
|
263
|
+
O as notifyAnswerToTaskResult,
|
|
264
|
+
J as notifyCategoryFromSessionId,
|
|
265
|
+
I as notifyCategorySessionId,
|
|
266
|
+
U as notifyMessageData,
|
|
267
|
+
Q as notifyUrl,
|
|
267
268
|
o as objectUrl,
|
|
268
269
|
openExternalUrl,
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
270
|
+
ac as parseAccessDenial,
|
|
271
|
+
c6 as parseAppId,
|
|
272
|
+
c9 as parseAppInstanceId,
|
|
273
|
+
at as parseAppLoginExchangeResult,
|
|
274
|
+
q2 as parseBuckyOSDIDDocument,
|
|
275
|
+
o2 as parseBuckyOSDeviceMiniDocument,
|
|
276
|
+
m2 as parseBuckyOSOwnerDocument,
|
|
277
|
+
af as parseCurrentIdentity,
|
|
277
278
|
p as parseSessionTokenClaims,
|
|
278
|
-
|
|
279
|
+
b_ as parseVideoPrompt,
|
|
279
280
|
p2 as parseW3CDIDDocumentBase,
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
281
|
+
m as parseZoneUserType,
|
|
282
|
+
L as promptOptions,
|
|
283
|
+
au as randomAppLoginNonce,
|
|
283
284
|
removeEvent,
|
|
284
285
|
r as resolveDidFromHost,
|
|
285
286
|
resolve_did,
|
|
286
287
|
setAppSetting,
|
|
287
288
|
s as sn,
|
|
288
289
|
subscribeKEvent,
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
290
|
+
bb as taskMgrErrorCode,
|
|
291
|
+
b9 as taskMgrTaskEventPath,
|
|
292
|
+
ba as taskMgrTreeEventPath,
|
|
293
|
+
bV as validateAiccMessage,
|
|
294
|
+
bZ as validateDecisionAnswers,
|
|
295
|
+
bY as validateDecisionRequest,
|
|
296
|
+
P as validateNotifyAnswer,
|
|
297
|
+
c1 as validateVideoEdit,
|
|
298
|
+
c0 as validateVideoGeneration,
|
|
299
|
+
b$ as validateVideoOutput,
|
|
300
|
+
c2 as videoGenerationRequirement,
|
|
301
|
+
_ as waitNotify,
|
|
301
302
|
walletSignWithActiveDid,
|
|
302
|
-
|
|
303
|
-
|
|
303
|
+
cl as walletUserHasSnAccount,
|
|
304
|
+
al as zoneActionUrl
|
|
304
305
|
};
|
|
305
306
|
//# sourceMappingURL=browser.mjs.map
|
package/dist/browser.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.mjs","sources":["../src/browser.ts"],"sourcesContent":["import { createSDKModule } from './sdk_core'\nimport { hashPassword } from './account'\n\nconst sdkModule = createSDKModule('browser')\n\nexport const buckyos = sdkModule.buckyos\nexport const initBuckyOS = sdkModule.initBuckyOS\nexport const getBuckyOSConfig = sdkModule.getBuckyOSConfig\nexport const getRuntimeType = sdkModule.getRuntimeType\nexport const getAppId = sdkModule.getAppId\nexport const getAppDid = sdkModule.getAppDid\nexport const getAppInstanceId = sdkModule.getAppInstanceId\nexport const getAppDataDir = sdkModule.getAppDataDir\nexport const getKEventClient = sdkModule.getKEventClient\nexport const createEventReader = sdkModule.createEventReader\nexport const create_event_reader = sdkModule.create_event_reader\nexport const subscribeKEvent = sdkModule.subscribeKEvent\nexport const attachEvent = sdkModule.attachEvent\nexport const removeEvent = sdkModule.removeEvent\nexport const getAccountInfo = sdkModule.getAccountInfo\nexport const getCurrentIdentity = sdkModule.getCurrentIdentity\nexport const loginByPassword = sdkModule.loginByPassword\nexport const loginByBrowserSSO = sdkModule.loginByBrowserSSO\nexport const loginByRuntimeSession = sdkModule.loginByRuntimeSession\nexport const login = sdkModule.login\nexport const logout = sdkModule.logout\nexport const getAppSetting = sdkModule.getAppSetting\nexport const setAppSetting = sdkModule.setAppSetting\nexport const getCurrentWalletUser = sdkModule.getCurrentWalletUser\nexport const resolve_did = sdkModule.resolve_did\nexport const walletSignWithActiveDid = sdkModule.walletSignWithActiveDid\nexport const openExternalUrl = sdkModule.openExternalUrl\nexport const getZoneHostName = sdkModule.getZoneHostName\nexport const getZoneServiceURL = sdkModule.getZoneServiceURL\nexport const getServiceRpcClient = sdkModule.getServiceRpcClient\nexport const getVerifyHubClient = sdkModule.getVerifyHubClient\nexport const getSystemConfigClient = sdkModule.getSystemConfigClient\nexport const getTaskManagerClient = sdkModule.getTaskManagerClient\nexport const getWorkflowClient = sdkModule.getWorkflowClient\n\nexport { hashPassword }\nexport * from './sdk_core'\nexport * from './types'\nexport * from './app_identity'\nexport * as namelib from './namelib'\nexport * as bns from './bns_client'\nexport * from './bns_evm_tx'\nexport * from './bns_tx_executor'\nexport * as sn from './sn_client'\nexport * as ndn from './
|
|
1
|
+
{"version":3,"file":"browser.mjs","sources":["../src/browser.ts"],"sourcesContent":["import { createSDKModule } from './sdk_core'\nimport { hashPassword } from './account'\n\nconst sdkModule = createSDKModule('browser')\n\nexport const buckyos = sdkModule.buckyos\nexport const initBuckyOS = sdkModule.initBuckyOS\nexport const getBuckyOSConfig = sdkModule.getBuckyOSConfig\nexport const getRuntimeType = sdkModule.getRuntimeType\nexport const getAppId = sdkModule.getAppId\nexport const getAppDid = sdkModule.getAppDid\nexport const getAppInstanceId = sdkModule.getAppInstanceId\nexport const getAppDataDir = sdkModule.getAppDataDir\nexport const getKEventClient = sdkModule.getKEventClient\nexport const createEventReader = sdkModule.createEventReader\nexport const create_event_reader = sdkModule.create_event_reader\nexport const subscribeKEvent = sdkModule.subscribeKEvent\nexport const attachEvent = sdkModule.attachEvent\nexport const removeEvent = sdkModule.removeEvent\nexport const getAccountInfo = sdkModule.getAccountInfo\nexport const getCurrentIdentity = sdkModule.getCurrentIdentity\nexport const loginByPassword = sdkModule.loginByPassword\nexport const loginByBrowserSSO = sdkModule.loginByBrowserSSO\nexport const loginByRuntimeSession = sdkModule.loginByRuntimeSession\nexport const login = sdkModule.login\nexport const logout = sdkModule.logout\nexport const getAppSetting = sdkModule.getAppSetting\nexport const setAppSetting = sdkModule.setAppSetting\nexport const getCurrentWalletUser = sdkModule.getCurrentWalletUser\nexport const resolve_did = sdkModule.resolve_did\nexport const walletSignWithActiveDid = sdkModule.walletSignWithActiveDid\nexport const openExternalUrl = sdkModule.openExternalUrl\nexport const getZoneHostName = sdkModule.getZoneHostName\nexport const getZoneServiceURL = sdkModule.getZoneServiceURL\nexport const getServiceRpcClient = sdkModule.getServiceRpcClient\nexport const getVerifyHubClient = sdkModule.getVerifyHubClient\nexport const getSystemConfigClient = sdkModule.getSystemConfigClient\nexport const getTaskManagerClient = sdkModule.getTaskManagerClient\nexport const getWorkflowClient = sdkModule.getWorkflowClient\n\nexport { hashPassword }\nexport * from './sdk_core'\nexport * from './types'\nexport * from './app_identity'\nexport * as namelib from './namelib'\nexport * as bns from './bns_client'\nexport * from './bns_evm_tx'\nexport * from './bns_tx_executor'\nexport * as sn from './sn_client'\nexport * as ndn from './ndn'\nexport * as ndm from './ndm_client'\nexport * as ndm_proxy from './ndm_proxy'\nexport * as bucket from './bucket_client'\nexport * as objectUrl from './object_url'\n\nexport * from './executor_client'\n"],"names":[],"mappings":";;;;AAGA,MAAM,YAAY,gBAAgB,SAAS;AAEpC,MAAM,UAAU,UAAU;AAC1B,MAAM,cAAc,UAAU;AAC9B,MAAM,mBAAmB,UAAU;AACnC,MAAM,iBAAiB,UAAU;AACjC,MAAM,WAAW,UAAU;AAC3B,MAAM,YAAY,UAAU;AAC5B,MAAM,mBAAmB,UAAU;AACnC,MAAM,gBAAgB,UAAU;AAChC,MAAM,kBAAkB,UAAU;AAClC,MAAM,oBAAoB,UAAU;AACpC,MAAM,sBAAsB,UAAU;AACtC,MAAM,kBAAkB,UAAU;AAClC,MAAM,cAAc,UAAU;AAC9B,MAAM,cAAc,UAAU;AAC9B,MAAM,iBAAiB,UAAU;AACjC,MAAM,qBAAqB,UAAU;AACrC,MAAM,kBAAkB,UAAU;AAClC,MAAM,oBAAoB,UAAU;AACpC,MAAM,wBAAwB,UAAU;AACxC,MAAM,QAAQ,UAAU;AACxB,MAAM,SAAS,UAAU;AACzB,MAAM,gBAAgB,UAAU;AAChC,MAAM,gBAAgB,UAAU;AAChC,MAAM,uBAAuB,UAAU;AACvC,MAAM,cAAc,UAAU;AAC9B,MAAM,0BAA0B,UAAU;AAC1C,MAAM,kBAAkB,UAAU;AAClC,MAAM,kBAAkB,UAAU;AAClC,MAAM,oBAAoB,UAAU;AACpC,MAAM,sBAAsB,UAAU;AACtC,MAAM,qBAAqB,UAAU;AACrC,MAAM,wBAAwB,UAAU;AACxC,MAAM,uBAAuB,UAAU;AACvC,MAAM,oBAAoB,UAAU;"}
|
package/dist/content.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=["txt","text","log","ini","conf","cfg","env","csv","tsv","md","markdown","rst","adoc","json","jsonc","json5","xml","yaml","yml","toml","ts","tsx","js","jsx","mjs","cjs","rs","py","go","c","h","cc","cpp","hpp","java","kt","swift","rb","php","sql","sh","bash","zsh","ps1","bat","css","scss","less","vue","svelte","lua","dart","r","scala","ex","exs","dockerfile","makefile","gitignore","editorconfig","lock"],t={png:"image/png",apng:"image/apng",jpg:"image/jpeg",jpeg:"image/jpeg",jfif:"image/jpeg",gif:"image/gif",webp:"image/webp",bmp:"image/bmp",ico:"image/x-icon",avif:"image/avif",heic:"image/heic",heif:"image/heif",tif:"image/tiff",tiff:"image/tiff",psd:"image/vnd.adobe.photoshop",svg:"image/svg+xml",mp4:"video/mp4",m4v:"video/mp4",webm:"video/webm",mov:"video/quicktime",mkv:"video/x-matroska",avi:"video/x-msvideo",ogv:"video/ogg",mp3:"audio/mpeg",wav:"audio/wav",flac:"audio/flac",ogg:"audio/ogg",oga:"audio/ogg",opus:"audio/ogg",m4a:"audio/mp4",aac:"audio/aac",pdf:"application/pdf",html:"text/html",htm:"text/html",xhtml:"application/xhtml+xml",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",doc:"application/msword",xls:"application/vnd.ms-excel",ppt:"application/vnd.ms-powerpoint",odt:"application/vnd.oasis.opendocument.text",zip:"application/zip",tar:"application/x-tar",gz:"application/gzip","7z":"application/x-7z-compressed",rar:"application/vnd.rar",epub:"application/epub+zip",md:"text/markdown",markdown:"text/markdown",json:"application/json",xml:"application/xml",csv:"text/csv",yaml:"application/yaml",yml:"application/yaml",toml:"application/toml",js:"text/javascript",mjs:"text/javascript",cjs:"text/javascript",css:"text/css"};for(const h of e)t[h]||(t[h]=`text/x-${h}`);function s(e){if(!e)return"";const t=e.split("/").pop()??e,s=t.lastIndexOf(".");return s<=0?"":t.slice(s+1).toLowerCase()}function i(e){return t[e.toLowerCase()]}function n(e){if(!e||"object"!=typeof e)return{};const t=e,s={};"string"==typeof t.name&&t.name&&t.name.length<=255&&!/[\/\\\0]/.test(t.name)&&(s.name=t.name),"string"==typeof t.mime&&/^[\w.+-]+\/[\w.+-]+$/.test(t.mime)&&(s.mime=t.mime.toLowerCase());const i="string"==typeof t.size?Number(t.size):t.size;return"number"==typeof i&&Number.isSafeInteger(i)&&i>=0&&(s.size=i),s}const r={provider:"system",handler_id:"preview",handler_version:1,selectors:[{mime:"*/*"}],enabled:!0,intents:{open:{entry:{type:"builtin",target:"preview"},modes:["view"],fidelity:"partial",window:"reuse",priority:90}}},o=()=>({schema_version:1,defaults:{},disabled:[]}),a=e=>"cyfs-path"===e.kind?e.path:`obj://${e.objectId}`;function c(e){if(!e||"object"!=typeof e)return!1;const t=e;return"cyfs-path"===t.kind&&"string"==typeof t.path&&/^cyfs:\/\/\/[^\0]*$/.test(t.path)||"object-id"===t.kind&&"string"==typeof t.objectId&&/^[\w.-]+:[\w-]+$/.test(t.objectId)}function p(e){if(!e||"object"!=typeof e)return!1;const t=e;return"single"===t.kind||"container"===t.kind&&c(t.container)&&c(t.current)||"list"===t.kind&&Array.isArray(t.items)&&t.items.every((e=>e&&c(e.source)))&&Number.isInteger(t.currentIndex)&&t.currentIndex>=0&&t.currentIndex<t.items.length}const d=e=>void 0===e?[]:Array.isArray(e)?e:[e];function m(e,t){var s;if(void 0!==e.maxSize&&void 0!==t.size&&t.size>e.maxSize)return 0;if(e.objType&&!d(e.objType).includes(t.objType??""))return 0;let i=e.objType?2:1;if(e.schema){const s=d(e.schema).filter((e=>{var s;return e.endsWith("*")?null==(s=t.schema)?void 0:s.startsWith(e.slice(0,-1)):t.schema===e}));if(!s.length)return 0;i=s.some((e=>e===t.schema))?7:6}if(e.mime){const s=(t.mime??"").toLowerCase().split(";")[0].trim(),n=d(e.mime).map((t=>"*/*"===(t=t.toLowerCase())?1:t.split(";")[0].trim()===s?e.objType?6:5:t.includes("/*+")&&s.startsWith(t.split("/")[0]+"/")&&s.endsWith(t.slice(t.indexOf("+")))?4:t.endsWith("/*")&&s.startsWith(t.slice(0,-1))?3:0)),r=Math.max(...n,0);if(!r)return 0;i=Math.max(i,r)}return e.mime||e.objType||e.schema||(null==(s=e.ext)?void 0:s.includes(t.ext??""))?i:0}function l(e){const t={};for(const s of e.split(";")){const e=s.indexOf(":"),i=s.slice(0,e),n=s.slice(e+1);if("obj"===i)t.objType=n;else if("mime"===i)t.mime=n;else if("schema"===i)t.schema=n;else{if("ext"!==i)return{};t.ext=[n]}}return t}function f(e){if("cyfs-path"!==e.kind)return;const t=e.path.lastIndexOf("/");return t>=7?{kind:"cyfs-path",path:e.path.slice(0,t)||"cyfs:///"}:void 0}function u(e,t){if(!e)return"";const s=e=>btoa(Array.from((new TextEncoder).encode(JSON.stringify(e)),(e=>String.fromCharCode(e))).join("")).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""),i=s(e);if(i.length<=2048||"list"!==e.kind)return i;const n=f(t);return n&&e.items.every((e=>a(f(e.source)??e.source)===a(n)))?s({kind:"container",container:n,current:t}):""}exports.ContentRegistryClient=class{constructor(e,t){this.config=e,this.userId=t,this.registry={schema_version:1,handlers:{}},this.defaults={schema_version:1,defaults:{},disabled:[]},this.updatedAt=0,this.listeners=new Set}async refresh(){const[e,t]=await Promise.all([this.config.get("system/content_registry"),this.config.get(`users/${this.userId}/content_defaults`).catch((e=>{if(/not found|not_found/i.test(String(e)))return null;throw e}))]);this.registry=JSON.parse(e.value),this.defaults=t?JSON.parse(t.value):{schema_version:1,defaults:{},disabled:[]},this.updatedAt=Date.now(),this.listeners.forEach((e=>e()))}async setDefault(e,t,s){await this.refresh();const i={...this.defaults.defaults[e]};s?i[t]=s:delete i[t],await this.persist({...this.defaults,defaults:{...this.defaults.defaults,[e]:i}})}async setEnabled(e,t){await this.refresh(),await this.persist({...this.defaults,disabled:[...new Set([...this.defaults.disabled.filter((t=>t!==e)),...t?[]:[e]])]})}onChanged(e){return this.listeners.add(e),()=>this.listeners.delete(e)}async persist(e){await this.config.set(`users/${this.userId}/content_defaults`,JSON.stringify(e)),this.defaults=e,this.listeners.forEach((e=>e()))}},exports.TEXT_CODE_EXTENSIONS=e,exports.contentDescriptor=function(e,t={}){const n=t.name??a(e).split("/").pop()??"",r=s(n);return{source:e,name:n,size:t.size,ext:r?`.${r}`:void 0,objType:"cyfs-path"===e.kind?"cyfile":e.objectId.split(":")[0],mime:t.mime||i(r)||"application/octet-stream"}},exports.contentRefString=a,exports.emptyDefaults=o,exports.encodeSession=u,exports.expandOpenPath=function(e,t,s=["view","edit"]){if(!e.startsWith("/")||e.startsWith("//")||/(?:\.\.|\\|[\r\n])/.test(decodeURIComponent(e)))throw new Error("Invalid App entry path");const i={source:a(t.source),mode:t.mode??(s.includes("edit")?"edit":"view"),session:u(t.session,t.source)},n=e.replace(/\{(source|mode|session)\}/g,((e,t)=>encodeURIComponent(i[t])));return n+(n.includes("?")?"&":"?")+"requestId="+encodeURIComponent(t.requestId)},exports.extensionOf=s,exports.handlerOfApp=(e,t)=>!!e.appInstanceId&&e.appInstanceId.split("@")[0]===t.split("@")[0],exports.isOpenRequest=function(e){if(!e||"object"!=typeof e)return!1;const t=e;return"string"==typeof t.requestId&&c(t.source)&&(void 0===t.mode||"view"===t.mode||"edit"===t.mode)&&(void 0===t.session||p(t.session))},exports.isTransferableRef=c,exports.isTransferableSession=p,exports.matchSelector=m,exports.mediaTypeFromExtension=i,exports.parentSource=f,exports.parseSystemOpen=function(e){const t=e.get("open");if(!t)return;const s=t.startsWith("obj://")?{kind:"object-id",objectId:t.slice(6)}:{kind:"cyfs-path",path:t};if(!c(s))return;const i=e.get("intent"),r="preview"===i||"chooser"===i?i:"default",o={source:s},a=e.get("mode");"view"!==a&&"edit"!==a||(o.mode=a);const d=e.get("session");if(d)try{const e=JSON.parse((new TextDecoder).decode(Uint8Array.from(atob(d.replace(/-/g,"+").replace(/_/g,"/")),(e=>e.charCodeAt(0)))));p(e)&&(o.session=e)}catch{}const m=e.get("from");return{request:o,target:r,hints:n({name:e.get("name")??void 0,mime:e.get("mime")??void 0,size:e.get("size")??void 0}),from:m&&/^[\w.@-]+$/.test(m)?m:void 0}},exports.previewHandler=r,exports.readContentHints=n,exports.resolveContentHandlers=function(e,t,s,i="open",n={},o=[]){var a;const c=new Set(o),p={...e.handlers,"system#preview":r},d=Object.entries(t.defaults.open??{}).map((([e,t])=>({key:t,score:m(l(e),s)}))).filter((e=>e.score>0)).sort(((e,t)=>t.score-e.score||e.key.localeCompare(t.key))),f=Object.entries(p).flatMap((([e,n])=>{const r=n.intents[i];if(!r||!n.enabled||"system#preview"!==e&&t.disabled.includes(e))return[];if(!("app"!==n.provider||n.app_instance_id&&c.has(n.app_instance_id)&&"web"===r.entry.type))return[];const o=n.selectors.map((e=>({selector:e,specificity:m(e,s)}))).filter((e=>e.specificity>0)).sort(((e,t)=>t.specificity-e.specificity));return o.length?[{key:e,h:n,binding:r,matched:o[0]}]:[]})),u=null==(a=d.find((e=>f.some((t=>t.key===e.key)))))?void 0:a.key;return f.sort(((e,t)=>Number(t.key===u)-Number(e.key===u)||Number(t.matched.specificity>1||"system"===t.h.provider)-Number(e.matched.specificity>1||"system"===e.h.provider)||t.matched.specificity-e.matched.specificity||(t.binding.priority??0)-(e.binding.priority??0)||Number("system"===t.h.provider)-Number("system"===e.h.provider)||(e.h.registered_at??0)-(t.h.registered_at??0)||e.key.localeCompare(t.key))),f.map((e=>{var t;return{handlerKey:e.key,handlerRef:`${(null==(t=e.h.app_instance_id)?void 0:t.split("@")[0])??"system"}#${e.h.handler_id}`,appInstanceId:e.h.app_instance_id,appDocObjectId:e.h.app_doc_object_id,handlerVersion:e.h.handler_version,intent:i,binding:e.binding,matched:e.matched,reason:e.key===u?"user-default":"system"===e.h.provider?"system-default":"ranked"}}))},exports.systemOpenUrl=function(e,t){const s=new URL("/",e);s.searchParams.set("open",a(t.request.source)),s.searchParams.set("intent",t.target);const i=u(t.request.session,t.request.source);i&&s.searchParams.set("session",i),t.request.mode&&s.searchParams.set("mode",t.request.mode);for(const n of["name","mime","size"])void 0!==t.hints[n]&&s.searchParams.set(n,String(t.hints[n]));return t.from&&s.searchParams.set("from",t.from),s.href};
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./content_mime-dc80d960.js");function t(e){if(!e||"object"!=typeof e)return{};const t=e,s={};"string"==typeof t.name&&t.name&&t.name.length<=255&&!/[\/\\\0]/.test(t.name)&&(s.name=t.name),"string"==typeof t.mime&&/^[\w.+-]+\/[\w.+-]+$/.test(t.mime)&&(s.mime=t.mime.toLowerCase());const i="string"==typeof t.size?Number(t.size):t.size;return"number"==typeof i&&Number.isSafeInteger(i)&&i>=0&&(s.size=i),s}const s={provider:"system",handler_id:"preview",handler_version:1,selectors:[{mime:"*/*"}],enabled:!0,intents:{open:{entry:{type:"builtin",target:"preview"},modes:["view"],fidelity:"partial",window:"reuse",priority:90}}},i=()=>({schema_version:1,defaults:{},disabled:[]}),r=e=>"cyfs-path"===e.kind?e.path:`obj://${e.objectId}`;function n(e){if(!e||"object"!=typeof e)return!1;const t=e;return"cyfs-path"===t.kind&&"string"==typeof t.path&&/^cyfs:\/\/\/[^\0]*$/.test(t.path)||"object-id"===t.kind&&"string"==typeof t.objectId&&/^[\w.-]+:[\w-]+$/.test(t.objectId)}function o(e){if(!e||"object"!=typeof e)return!1;const t=e;return"single"===t.kind||"container"===t.kind&&n(t.container)&&n(t.current)||"list"===t.kind&&Array.isArray(t.items)&&t.items.every((e=>e&&n(e.source)))&&Number.isInteger(t.currentIndex)&&t.currentIndex>=0&&t.currentIndex<t.items.length}const a=e=>void 0===e?[]:Array.isArray(e)?e:[e];function c(e,t){var s;if(void 0!==e.maxSize&&void 0!==t.size&&t.size>e.maxSize)return 0;if(e.objType&&!a(e.objType).includes(t.objType??""))return 0;let i=e.objType?2:1;if(e.schema){const s=a(e.schema).filter((e=>{var s;return e.endsWith("*")?null==(s=t.schema)?void 0:s.startsWith(e.slice(0,-1)):t.schema===e}));if(!s.length)return 0;i=s.some((e=>e===t.schema))?7:6}if(e.mime){const s=(t.mime??"").toLowerCase().split(";")[0].trim(),r=a(e.mime).map((t=>"*/*"===(t=t.toLowerCase())?1:t.split(";")[0].trim()===s?e.objType?6:5:t.includes("/*+")&&s.startsWith(t.split("/")[0]+"/")&&s.endsWith(t.slice(t.indexOf("+")))?4:t.endsWith("/*")&&s.startsWith(t.slice(0,-1))?3:0)),n=Math.max(...r,0);if(!n)return 0;i=Math.max(i,n)}return e.mime||e.objType||e.schema||(null==(s=e.ext)?void 0:s.includes(t.ext??""))?i:0}function d(e){const t={};for(const s of e.split(";")){const e=s.indexOf(":"),i=s.slice(0,e),r=s.slice(e+1);if("obj"===i)t.objType=r;else if("mime"===i)t.mime=r;else if("schema"===i)t.schema=r;else{if("ext"!==i)return{};t.ext=[r]}}return t}function p(e){if("cyfs-path"!==e.kind)return;const t=e.path.lastIndexOf("/");return t>=7?{kind:"cyfs-path",path:e.path.slice(0,t)||"cyfs:///"}:void 0}function m(e,t){if(!e)return"";const s=e=>btoa(Array.from((new TextEncoder).encode(JSON.stringify(e)),(e=>String.fromCharCode(e))).join("")).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""),i=s(e);if(i.length<=2048||"list"!==e.kind)return i;const n=p(t);return n&&e.items.every((e=>r(p(e.source)??e.source)===r(n)))?s({kind:"container",container:n,current:t}):""}exports.TEXT_CODE_EXTENSIONS=e.TEXT_CODE_EXTENSIONS,exports.extensionOf=e.extensionOf,exports.heifImageSize=e.heifImageSize,exports.isoBoxes=e.isoBoxes,exports.mediaTypeFromExtension=e.mediaTypeFromExtension,exports.sniffMagic=e.sniffMagic,exports.stripMediaTypeParams=e.stripMediaTypeParams,exports.ContentRegistryClient=class{constructor(e,t){this.config=e,this.userId=t,this.registry={schema_version:1,handlers:{}},this.defaults={schema_version:1,defaults:{},disabled:[]},this.updatedAt=0,this.listeners=new Set}async refresh(){const[e,t]=await Promise.all([this.config.get("system/content_registry"),this.config.get(`users/${this.userId}/content_defaults`).catch((e=>{if(/not found|not_found/i.test(String(e)))return null;throw e}))]);this.registry=JSON.parse(e.value),this.defaults=t?JSON.parse(t.value):{schema_version:1,defaults:{},disabled:[]},this.updatedAt=Date.now(),this.listeners.forEach((e=>e()))}async setDefault(e,t,s){await this.refresh();const i={...this.defaults.defaults[e]};s?i[t]=s:delete i[t],await this.persist({...this.defaults,defaults:{...this.defaults.defaults,[e]:i}})}async setEnabled(e,t){await this.refresh(),await this.persist({...this.defaults,disabled:[...new Set([...this.defaults.disabled.filter((t=>t!==e)),...t?[]:[e]])]})}onChanged(e){return this.listeners.add(e),()=>this.listeners.delete(e)}async persist(e){await this.config.set(`users/${this.userId}/content_defaults`,JSON.stringify(e)),this.defaults=e,this.listeners.forEach((e=>e()))}},exports.contentDescriptor=function(t,s={}){const i=s.name??r(t).split("/").pop()??"",n=e.extensionOf(i);return{source:t,name:i,size:s.size,ext:n?`.${n}`:void 0,objType:"cyfs-path"===t.kind?"cyfile":t.objectId.split(":")[0],mime:s.mime||e.mediaTypeFromExtension(n)||"application/octet-stream"}},exports.contentRefString=r,exports.emptyDefaults=i,exports.encodeSession=m,exports.expandOpenPath=function(e,t,s=["view","edit"]){if(!e.startsWith("/")||e.startsWith("//")||/(?:\.\.|\\|[\r\n])/.test(decodeURIComponent(e)))throw new Error("Invalid App entry path");const i={source:r(t.source),mode:t.mode??(s.includes("edit")?"edit":"view"),session:m(t.session,t.source)},n=e.replace(/\{(source|mode|session)\}/g,((e,t)=>encodeURIComponent(i[t])));return n+(n.includes("?")?"&":"?")+"requestId="+encodeURIComponent(t.requestId)},exports.handlerOfApp=(e,t)=>!!e.appInstanceId&&e.appInstanceId.split("@")[0]===t.split("@")[0],exports.isOpenRequest=function(e){if(!e||"object"!=typeof e)return!1;const t=e;return"string"==typeof t.requestId&&n(t.source)&&(void 0===t.mode||"view"===t.mode||"edit"===t.mode)&&(void 0===t.session||o(t.session))},exports.isTransferableRef=n,exports.isTransferableSession=o,exports.matchSelector=c,exports.parentSource=p,exports.parseSystemOpen=function(e){const s=e.get("open");if(!s)return;const i=s.startsWith("obj://")?{kind:"object-id",objectId:s.slice(6)}:{kind:"cyfs-path",path:s};if(!n(i))return;const r=e.get("intent"),a="preview"===r||"chooser"===r?r:"default",c={source:i},d=e.get("mode");"view"!==d&&"edit"!==d||(c.mode=d);const p=e.get("session");if(p)try{const e=JSON.parse((new TextDecoder).decode(Uint8Array.from(atob(p.replace(/-/g,"+").replace(/_/g,"/")),(e=>e.charCodeAt(0)))));o(e)&&(c.session=e)}catch{}const m=e.get("from");return{request:c,target:a,hints:t({name:e.get("name")??void 0,mime:e.get("mime")??void 0,size:e.get("size")??void 0}),from:m&&/^[\w.@-]+$/.test(m)?m:void 0}},exports.previewHandler=s,exports.readContentHints=t,exports.resolveContentHandlers=function(e,t,i,r="open",n={},o=[]){var a;const p=new Set(o),m={...e.handlers,"system#preview":s},f=Object.entries(t.defaults.open??{}).map((([e,t])=>({key:t,score:c(d(e),i)}))).filter((e=>e.score>0)).sort(((e,t)=>t.score-e.score||e.key.localeCompare(t.key))),u=Object.entries(m).flatMap((([e,s])=>{const n=s.intents[r];if(!n||!s.enabled||"system#preview"!==e&&t.disabled.includes(e))return[];if(!("app"!==s.provider||s.app_instance_id&&p.has(s.app_instance_id)&&"web"===n.entry.type))return[];const o=s.selectors.map((e=>({selector:e,specificity:c(e,i)}))).filter((e=>e.specificity>0)).sort(((e,t)=>t.specificity-e.specificity));return o.length?[{key:e,h:s,binding:n,matched:o[0]}]:[]})),l=null==(a=f.find((e=>u.some((t=>t.key===e.key)))))?void 0:a.key;return u.sort(((e,t)=>Number(t.key===l)-Number(e.key===l)||Number(t.matched.specificity>1||"system"===t.h.provider)-Number(e.matched.specificity>1||"system"===e.h.provider)||t.matched.specificity-e.matched.specificity||(t.binding.priority??0)-(e.binding.priority??0)||Number("system"===t.h.provider)-Number("system"===e.h.provider)||(e.h.registered_at??0)-(t.h.registered_at??0)||e.key.localeCompare(t.key))),u.map((e=>{var t;return{handlerKey:e.key,handlerRef:`${(null==(t=e.h.app_instance_id)?void 0:t.split("@")[0])??"system"}#${e.h.handler_id}`,appInstanceId:e.h.app_instance_id,appDocObjectId:e.h.app_doc_object_id,handlerVersion:e.h.handler_version,intent:r,binding:e.binding,matched:e.matched,reason:e.key===l?"user-default":"system"===e.h.provider?"system-default":"ranked"}}))},exports.systemOpenUrl=function(e,t){const s=new URL("/",e);s.searchParams.set("open",r(t.request.source)),s.searchParams.set("intent",t.target);const i=m(t.request.session,t.request.source);i&&s.searchParams.set("session",i),t.request.mode&&s.searchParams.set("mode",t.request.mode);for(const r of["name","mime","size"])void 0!==t.hints[r]&&s.searchParams.set(r,String(t.hints[r]));return t.from&&s.searchParams.set("from",t.from),s.href};
|
|
2
2
|
//# sourceMappingURL=content.cjs.map
|