buckyos 0.7.148 → 0.7.149

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/cli/core/app.ts +2 -0
  2. package/cli/dist/cli.mjs +543 -83
  3. package/cli/dist/cli.mjs.map +1 -1
  4. package/cli/modules/bucket.ts +396 -0
  5. package/cli/modules/pikg_protocol.ts +67 -0
  6. package/cli/version.ts +1 -1
  7. package/dist/browser.cjs +1 -1
  8. package/dist/browser.cjs.map +1 -1
  9. package/dist/browser.d.ts +2 -0
  10. package/dist/browser.d.ts.map +1 -1
  11. package/dist/browser.mjs +190 -189
  12. package/dist/browser.mjs.map +1 -1
  13. package/dist/bucket_client.d.ts +344 -0
  14. package/dist/bucket_client.d.ts.map +1 -0
  15. package/dist/{executor_client-4fbf0c3c.mjs → executor_client-06dad8a8.mjs} +434 -192
  16. package/dist/executor_client-06dad8a8.mjs.map +1 -0
  17. package/dist/executor_client-d7fc4a8b.js +13 -0
  18. package/dist/executor_client-d7fc4a8b.js.map +1 -0
  19. package/dist/index.cjs +1 -1
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.d.ts +3 -0
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.mjs +195 -192
  24. package/dist/index.mjs.map +1 -1
  25. package/dist/ndm_client.d.ts +30 -0
  26. package/dist/ndm_client.d.ts.map +1 -1
  27. package/dist/node.cjs +1 -1
  28. package/dist/node.cjs.map +1 -1
  29. package/dist/node.d.ts +2 -0
  30. package/dist/node.d.ts.map +1 -1
  31. package/dist/node.mjs +190 -189
  32. package/dist/node.mjs.map +1 -1
  33. package/dist/runtime.d.ts +2 -0
  34. package/dist/runtime.d.ts.map +1 -1
  35. package/dist/sdk_core.d.ts +4 -0
  36. package/dist/sdk_core.d.ts.map +1 -1
  37. package/package.json +1 -1
  38. package/dist/executor_client-4fbf0c3c.mjs.map +0 -1
  39. package/dist/executor_client-5fa2d501.js +0 -13
  40. package/dist/executor_client-5fa2d501.js.map +0 -1
@@ -0,0 +1,396 @@
1
+ import type { CommandDefinition, CommandModule, JsonSchema } from '../core/command.ts'
2
+ import type { CommandContext } from '../core/context.ts'
3
+ import { EXIT_INTERNAL, ToolError, UsageError } from '../core/errors.ts'
4
+ import { callService, inputString, parseTimestamp, requiredInputString } from '../core/service.ts'
5
+ import { getHost } from '../runtime/host.ts'
6
+
7
+ // Application object buckets (BuckyOS doc/arch/应用对象桶 Bucket 设计.md §12.4):
8
+ // kRPC `bucket.*` on nfs-server plus the `/bucket/v1/<bucket_id>/<key>` data plane.
9
+ // A target is `obj://bucket/<scope>/<appid>/<owner>/<name>[/<key>]` or the same without the scheme.
10
+ const OBJECT_OUTPUT: JsonSchema = { type: 'object', additionalProperties: true }
11
+ const SERVICE = 'nfs-server'
12
+ const MAX_PUT_BYTES = 32 * 1024 * 1024
13
+ const DAY_MS = 86_400_000
14
+ /** `BucketError::code()` of bucket_store; service errors read `<code>: <message>`. */
15
+ const BUCKET_ERROR_CODES = [
16
+ 'bucket_not_found', 'no_such_key', 'invalid_key', 'invalid_argument', 'precondition_failed', 'permission_denied',
17
+ 'quota_exceeded', 'object_too_large', 'content_not_available', 'content_evicted', 'origin_unavailable', 'kind_mismatch',
18
+ 'policy_violation', 'origin_required', 'not_held', 'token_invalid', 'conflict', 'store_error', 'db_error', 'internal_error',
19
+ ]
20
+
21
+ export function createBucketModule(): CommandModule {
22
+ return {
23
+ name: 'bucket',
24
+ summary: 'Read and write application object buckets (key -> object, retained by the Zone)',
25
+ commands: [lsCommand(), statCommand(), putCommand(), getCommand(), rmCommand(), linkCommand(), s3KeysCommand(), s3KeyCreateCommand(), s3KeyRevokeCommand()],
26
+ }
27
+ }
28
+
29
+ export interface BucketTarget {
30
+ bucketId: string
31
+ key: string
32
+ }
33
+
34
+ /** Splits `obj://bucket/<scope>/<appid>/<owner>/<name>/<key...>` (scheme optional). */
35
+ export function parseBucketTarget(value: string, keyRequired: boolean): BucketTarget {
36
+ const path = value.startsWith('obj://bucket/') ? value.slice('obj://bucket/'.length) : value
37
+ const parts = path.split('/')
38
+ if (parts.length < 4 || !['user', 'zone'].includes(parts[0]) || parts.slice(0, 4).some((p) => !p)) {
39
+ throw new UsageError('INVALID_ARGUMENT', `'${value}' is not obj://bucket/<scope>/<appid>/<owner>/<name>[/<key>]`)
40
+ }
41
+ const key = parts.slice(4).join('/')
42
+ if (keyRequired && !key) throw new UsageError('INVALID_ARGUMENT', `'${value}' names no key`)
43
+ return { bucketId: parts.slice(0, 4).join('/'), key }
44
+ }
45
+
46
+ async function call<T = Record<string, unknown>>(ctx: CommandContext, method: string, params: Record<string, unknown>): Promise<T> {
47
+ try {
48
+ return await callService<T>(ctx, SERVICE, method, params)
49
+ } catch (error) {
50
+ const message = error instanceof Error ? error.message : String(error)
51
+ const code = BUCKET_ERROR_CODES.find((c) => message.includes(`${c}: `))
52
+ if (code) throw new ToolError(`BUCKET_${code.toUpperCase()}`, message)
53
+ throw error
54
+ }
55
+ }
56
+
57
+ function gatewayOrigin(endpoint: string): string {
58
+ const url = new URL(endpoint)
59
+ const marker = url.pathname.indexOf('/kapi')
60
+ url.pathname = marker >= 0 ? url.pathname.slice(0, marker) || '/' : '/'
61
+ url.search = ''
62
+ url.hash = ''
63
+ return url.toString().replace(/\/$/, '')
64
+ }
65
+
66
+ function objectUrl(ctx: CommandContext, target: BucketTarget, query: Record<string, string> = {}): string {
67
+ const qs = new URLSearchParams(query).toString()
68
+ const key = target.key.split('/').map(encodeURIComponent).join('/')
69
+ return `${gatewayOrigin(ctx.connection.endpoint)}/bucket/v1/${target.bucketId}/${key}${qs ? `?${qs}` : ''}`
70
+ }
71
+
72
+ async function bearer(ctx: CommandContext): Promise<Record<string, string>> {
73
+ if (!ctx.session) throw new ToolError('AUTH_REQUIRED', 'authenticated session is required', 3)
74
+ return { Authorization: `Bearer ${(await ctx.session.ensureValid()).token}` }
75
+ }
76
+
77
+ async function failure(response: Response): Promise<never> {
78
+ let body: Record<string, unknown> = {}
79
+ try {
80
+ body = await response.json()
81
+ } catch {
82
+ throw new ToolError('INVALID_SERVICE_RESPONSE', `bucket data plane answered HTTP ${response.status}`, EXIT_INTERNAL)
83
+ }
84
+ throw new ToolError(`BUCKET_${String(body.error ?? response.status).toUpperCase()}`, String(body.message ?? `HTTP ${response.status}`))
85
+ }
86
+
87
+ const TARGET = { name: 'target', description: 'obj://bucket/<scope>/<appid>/<owner>/<name>[/<key>]', required: true }
88
+
89
+ function lsCommand(): CommandDefinition {
90
+ return {
91
+ verb: 'ls',
92
+ summary: 'List your buckets, or the keys of one bucket',
93
+ positionals: [{ ...TARGET, required: false }],
94
+ options: [
95
+ { name: 'delimiter', description: 'Fold keys at this delimiter (e.g. /)', type: 'string' },
96
+ { name: 'start-after', property: 'start_after', description: 'Continue after this key', type: 'string' },
97
+ { name: 'limit', description: 'Page size, at most 1000', type: 'integer' },
98
+ { name: 'appid', description: 'Only buckets of this app (no target)', type: 'string' },
99
+ ],
100
+ inputSchema: {
101
+ type: 'object',
102
+ properties: {
103
+ target: { type: 'string', minLength: 1 },
104
+ delimiter: { type: 'string', minLength: 1 },
105
+ start_after: { type: 'string', minLength: 1 },
106
+ limit: { type: 'integer', minimum: 1 },
107
+ appid: { type: 'string', minLength: 1 },
108
+ },
109
+ additionalProperties: false,
110
+ },
111
+ outputSchema: OBJECT_OUTPUT,
112
+ resultSchemaVersion: 1,
113
+ access: { mode: 'fixed', level: 'read' },
114
+ asyncMode: 'sync',
115
+ requiresSession: true,
116
+ examples: ['buckyos bucket ls', 'buckyos bucket ls obj://bucket/user/photos/alice/library/2026/ --delimiter /'],
117
+ handler: async (ctx, input) => {
118
+ const raw = inputString(input, 'target')
119
+ if (!raw) return { buckets: await call(ctx, 'bucket.list', { appid: inputString(input, 'appid') }) }
120
+ const target = parseBucketTarget(raw, false)
121
+ return await call(ctx, 'bucket.list_objects', {
122
+ bucket_id: target.bucketId,
123
+ prefix: target.key,
124
+ delimiter: inputString(input, 'delimiter'),
125
+ start_after: inputString(input, 'start_after'),
126
+ limit: input.limit,
127
+ })
128
+ },
129
+ }
130
+ }
131
+
132
+ function statCommand(): CommandDefinition {
133
+ return {
134
+ verb: 'stat',
135
+ summary: 'Show a bucket (usage, quota) or a key (binding and where its content is)',
136
+ positionals: [TARGET],
137
+ options: [{ name: 'version', description: 'A specific version of the key', type: 'integer' }],
138
+ inputSchema: {
139
+ type: 'object',
140
+ properties: { target: { type: 'string', minLength: 1 }, version: { type: 'integer', minimum: 1 } },
141
+ required: ['target'],
142
+ additionalProperties: false,
143
+ },
144
+ outputSchema: OBJECT_OUTPUT,
145
+ resultSchemaVersion: 1,
146
+ access: { mode: 'fixed', level: 'read' },
147
+ asyncMode: 'sync',
148
+ requiresSession: true,
149
+ examples: ['buckyos bucket stat obj://bucket/user/photos/alice/library', 'buckyos bucket stat obj://bucket/user/photos/alice/library/a.jpg'],
150
+ handler: async (ctx, input) => {
151
+ const target = parseBucketTarget(requiredInputString(input, 'target'), false)
152
+ if (!target.key) {
153
+ const [bucket, quota] = await Promise.all([
154
+ call(ctx, 'bucket.stat', { bucket_id: target.bucketId }),
155
+ call(ctx, 'bucket.get_quota', { bucket_id: target.bucketId }),
156
+ ])
157
+ return { bucket, quota }
158
+ }
159
+ return await call(ctx, 'bucket.head', { bucket_id: target.bucketId, key: target.key, version: input.version })
160
+ },
161
+ }
162
+ }
163
+
164
+ function putCommand(): CommandDefinition {
165
+ return {
166
+ verb: 'put',
167
+ summary: 'Store a local file (up to 32 MiB) under a key; success means the Zone retains it',
168
+ positionals: [TARGET, { name: 'file', description: 'Local file to upload', required: true }],
169
+ options: [
170
+ { name: 'content-type', property: 'content_type', description: 'Content-Type of the object', type: 'string' },
171
+ { name: 'if-absent', property: 'if_absent', description: 'Fail if the key already exists', type: 'boolean' },
172
+ { name: 'expires', description: 'Unbind after: 1d, 7d, or an RFC 3339 time (temp/cache/app_data buckets)', type: 'string' },
173
+ ],
174
+ inputSchema: {
175
+ type: 'object',
176
+ properties: {
177
+ target: { type: 'string', minLength: 1 },
178
+ file: { type: 'string', minLength: 1 },
179
+ content_type: { type: 'string', minLength: 1 },
180
+ if_absent: { type: 'boolean' },
181
+ expires: { type: 'string', minLength: 1 },
182
+ },
183
+ required: ['target', 'file'],
184
+ additionalProperties: false,
185
+ },
186
+ outputSchema: OBJECT_OUTPUT,
187
+ resultSchemaVersion: 1,
188
+ access: { mode: 'fixed', level: 'write' },
189
+ asyncMode: 'sync',
190
+ requiresSession: true,
191
+ networkAccess: true,
192
+ examples: ['buckyos bucket put obj://bucket/user/photos/alice/library/2026/a.jpg ./a.jpg --content-type image/jpeg'],
193
+ handler: async (ctx, input) => {
194
+ const target = parseBucketTarget(requiredInputString(input, 'target'), true)
195
+ const bytes = await getHost().readFile(requiredInputString(input, 'file'))
196
+ if (bytes.byteLength > MAX_PUT_BYTES) {
197
+ throw new UsageError('FILE_TOO_LARGE', 'files over 32 MiB go through the SDK upload (ndm.startUpload with bind)')
198
+ }
199
+ const headers: Record<string, string> = { ...(await bearer(ctx)) }
200
+ const contentType = inputString(input, 'content_type')
201
+ if (contentType) headers['Content-Type'] = contentType
202
+ if (input.if_absent === true) headers['If-None-Match'] = '*'
203
+ const expires = inputString(input, 'expires')
204
+ if (expires) {
205
+ const days = expires.match(/^(\d+)d$/)
206
+ const at = days ? Date.now() + Number(days[1]) * DAY_MS : parseTimestamp(expires, 'expires')
207
+ if (at !== undefined) headers['x-bucky-expires-at'] = String(at)
208
+ }
209
+ const response = await fetch(objectUrl(ctx, target), { method: 'PUT', headers, body: new Blob([bytes as Uint8Array<ArrayBuffer>]), signal: ctx.signal })
210
+ if (!response.ok) await failure(response)
211
+ return await response.json()
212
+ },
213
+ }
214
+ }
215
+
216
+ function getCommand(): CommandDefinition {
217
+ return {
218
+ verb: 'get',
219
+ summary: 'Download a key to a local file',
220
+ positionals: [TARGET, { name: 'output', description: 'Local file to write', required: true }],
221
+ options: [{ name: 'version', description: 'A specific version of the key', type: 'integer' }],
222
+ inputSchema: {
223
+ type: 'object',
224
+ properties: {
225
+ target: { type: 'string', minLength: 1 },
226
+ output: { type: 'string', minLength: 1 },
227
+ version: { type: 'integer', minimum: 1 },
228
+ },
229
+ required: ['target', 'output'],
230
+ additionalProperties: false,
231
+ },
232
+ outputSchema: OBJECT_OUTPUT,
233
+ resultSchemaVersion: 1,
234
+ access: { mode: 'fixed', level: 'read' },
235
+ asyncMode: 'sync',
236
+ requiresSession: true,
237
+ networkAccess: true,
238
+ examples: ['buckyos bucket get obj://bucket/user/photos/alice/library/2026/a.jpg ./a.jpg'],
239
+ handler: async (ctx, input) => {
240
+ const target = parseBucketTarget(requiredInputString(input, 'target'), true)
241
+ const query: Record<string, string> = input.version !== undefined ? { version: String(input.version) } : {}
242
+ const response = await fetch(objectUrl(ctx, target, query), { headers: await bearer(ctx), signal: ctx.signal })
243
+ if (!response.ok) await failure(response)
244
+ const bytes = new Uint8Array(await response.arrayBuffer())
245
+ const output = requiredInputString(input, 'output')
246
+ await getHost().writeFile(output, bytes)
247
+ return {
248
+ output,
249
+ size: bytes.byteLength,
250
+ obj_id: response.headers.get('x-bucky-obj-id'),
251
+ version: Number(response.headers.get('x-bucky-version')),
252
+ content_type: response.headers.get('content-type'),
253
+ }
254
+ },
255
+ }
256
+ }
257
+
258
+ function rmCommand(): CommandDefinition {
259
+ return {
260
+ verb: 'rm',
261
+ summary: 'Unbind a key (the bucket stops retaining its content)',
262
+ positionals: [TARGET],
263
+ options: [{ name: 'version', description: 'Remove only this version', type: 'integer' }],
264
+ inputSchema: {
265
+ type: 'object',
266
+ properties: { target: { type: 'string', minLength: 1 }, version: { type: 'integer', minimum: 1 } },
267
+ required: ['target'],
268
+ additionalProperties: false,
269
+ },
270
+ outputSchema: OBJECT_OUTPUT,
271
+ resultSchemaVersion: 1,
272
+ access: { mode: 'fixed', level: 'write' },
273
+ asyncMode: 'sync',
274
+ requiresSession: true,
275
+ examples: ['buckyos bucket rm obj://bucket/user/photos/alice/library/2026/a.jpg'],
276
+ handler: async (ctx, input) => {
277
+ const target = parseBucketTarget(requiredInputString(input, 'target'), true)
278
+ return await call(ctx, 'bucket.delete', { bucket_id: target.bucketId, key: target.key, version: input.version })
279
+ },
280
+ }
281
+ }
282
+
283
+ function linkCommand(): CommandDefinition {
284
+ return {
285
+ verb: 'link',
286
+ summary: 'Create a revocable read link to one key (up to 7 days, no Zone account needed)',
287
+ positionals: [TARGET],
288
+ options: [
289
+ { name: 'expires', description: '1d (default) to 7d, or an RFC 3339 time', type: 'string' },
290
+ { name: 'max-uses', property: 'max_uses', description: 'Stop after this many reads', type: 'integer' },
291
+ ],
292
+ inputSchema: {
293
+ type: 'object',
294
+ properties: {
295
+ target: { type: 'string', minLength: 1 },
296
+ expires: { type: 'string', minLength: 1 },
297
+ max_uses: { type: 'integer', minimum: 1 },
298
+ },
299
+ required: ['target'],
300
+ additionalProperties: false,
301
+ },
302
+ outputSchema: OBJECT_OUTPUT,
303
+ resultSchemaVersion: 1,
304
+ access: { mode: 'fixed', level: 'write' },
305
+ asyncMode: 'sync',
306
+ requiresSession: true,
307
+ examples: ['buckyos bucket link obj://bucket/user/photos/alice/library/2026/a.jpg --expires 3d'],
308
+ handler: async (ctx, input) => {
309
+ const target = parseBucketTarget(requiredInputString(input, 'target'), true)
310
+ const text = inputString(input, 'expires') ?? '1d'
311
+ const days = text.match(/^(\d+)d$/)
312
+ const expiresAt = days ? Date.now() + Number(days[1]) * DAY_MS : parseTimestamp(text, 'expires')
313
+ if (expiresAt === undefined) throw new UsageError('INVALID_ARGUMENT', 'expires is required')
314
+ const issued = await call(ctx, 'bucket.create_access_token', {
315
+ bucket_id: target.bucketId,
316
+ key: target.key,
317
+ actions: ['read'],
318
+ expires_at: expiresAt,
319
+ max_uses: input.max_uses,
320
+ })
321
+ return { ...issued, url: `${gatewayOrigin(ctx.connection.endpoint)}${String(issued.path)}` }
322
+ },
323
+ }
324
+ }
325
+
326
+ function s3KeysCommand(): CommandDefinition {
327
+ return {
328
+ verb: 's3-keys',
329
+ summary: 'List your S3 access keys (secrets are shown only when created)',
330
+ inputSchema: { type: 'object', properties: {}, additionalProperties: false },
331
+ outputSchema: OBJECT_OUTPUT,
332
+ resultSchemaVersion: 1,
333
+ access: { mode: 'fixed', level: 'read' },
334
+ asyncMode: 'sync',
335
+ requiresSession: true,
336
+ examples: ['buckyos bucket s3-keys'],
337
+ handler: async (ctx) => ({ keys: await call(ctx, 'bucket.list_s3_keys', {}) }),
338
+ }
339
+ }
340
+
341
+ function s3KeyCreateCommand(): CommandDefinition {
342
+ return {
343
+ verb: 's3-key-create',
344
+ summary: 'Issue an S3 access key for one of your apps (endpoint https://<zone>/s3 or https://s3.<zone>)',
345
+ options: [
346
+ { name: 'app', description: 'App id whose buckets the key reaches', type: 'string' },
347
+ { name: 'prefix', description: 'Only keys under this prefix', type: 'string' },
348
+ { name: 'expires', description: 'Expiry: 30d, or an RFC 3339 time (default: none)', type: 'string' },
349
+ ],
350
+ inputSchema: {
351
+ type: 'object',
352
+ properties: { app: { type: 'string', minLength: 1 }, prefix: { type: 'string', minLength: 1 }, expires: { type: 'string', minLength: 1 } },
353
+ required: ['app'],
354
+ additionalProperties: false,
355
+ },
356
+ outputSchema: OBJECT_OUTPUT,
357
+ resultSchemaVersion: 1,
358
+ access: { mode: 'fixed', level: 'write' },
359
+ asyncMode: 'sync',
360
+ requiresSession: true,
361
+ examples: ['buckyos bucket s3-key-create --app photos.app.bns.did --expires 30d'],
362
+ handler: async (ctx, input) => {
363
+ const text = inputString(input, 'expires')
364
+ const days = text?.match(/^(\d+)d$/)
365
+ const expiresAt = !text ? undefined : days ? Date.now() + Number(days[1]) * DAY_MS : parseTimestamp(text, 'expires')
366
+ const prefix = inputString(input, 'prefix')
367
+ const key = await call(ctx, 'bucket.create_s3_key', {
368
+ appid: requiredInputString(input, 'app'),
369
+ scope: prefix ? { prefix } : undefined,
370
+ expires_at: expiresAt,
371
+ })
372
+ return { ...key, endpoint: `${gatewayOrigin(ctx.connection.endpoint)}/s3`, region: 'us-east-1', path_style: true }
373
+ },
374
+ }
375
+ }
376
+
377
+ function s3KeyRevokeCommand(): CommandDefinition {
378
+ return {
379
+ verb: 's3-key-revoke',
380
+ summary: 'Revoke an S3 access key (its presigned URLs stop working too)',
381
+ positionals: [{ name: 'access_key_id', description: 'Access key id (BK…)', required: true }],
382
+ inputSchema: {
383
+ type: 'object',
384
+ properties: { access_key_id: { type: 'string', minLength: 1 } },
385
+ required: ['access_key_id'],
386
+ additionalProperties: false,
387
+ },
388
+ outputSchema: OBJECT_OUTPUT,
389
+ resultSchemaVersion: 1,
390
+ access: { mode: 'fixed', level: 'write' },
391
+ asyncMode: 'sync',
392
+ requiresSession: true,
393
+ examples: ['buckyos bucket s3-key-revoke BKABCDEFGHIJKLMNOPQR'],
394
+ handler: async (ctx, input) => await call(ctx, 'bucket.revoke_s3_key', { access_key_id: requiredInputString(input, 'access_key_id') }),
395
+ }
396
+ }
@@ -265,6 +265,72 @@ export function validatePermissions(value: unknown, label: string): unknown[] {
265
265
  })
266
266
  }
267
267
 
268
+ const BUCKET_POLICIES = ['documents', 'app_data', 'collected', 'ambient', 'temp', 'cache']
269
+
270
+ /** `buckets` / `storage_quota_mib` (BuckyOS 应用对象桶设计 §4.3, §4.5.3, D17). */
271
+ function validateBuckets(config: Record<string, unknown>, label: string): void {
272
+ if (config.storage_quota_mib !== undefined) {
273
+ expectUint(config.storage_quota_mib, `${label}.storage_quota_mib`, Number.MAX_SAFE_INTEGER)
274
+ }
275
+ let needsAppPool = false
276
+ for (const [name, raw] of Object.entries(expectObject(config.buckets ?? {}, `${label}.buckets`))) {
277
+ const at = `${label}.buckets.${name}`
278
+ if (!/^[A-Za-z0-9._-]{1,128}$/.test(name) || name === '.' || name === '..') {
279
+ throw invalid('schema', `${at} is not a valid bucket name`)
280
+ }
281
+ const bucket = expectObject(raw, at)
282
+ assertKnownFields(
283
+ bucket,
284
+ ['kind', 'data_policy', 'scope', 'versioning', 'quota_mib', 'max_objects', 'default_ttl_days', 'lifecycle'],
285
+ at,
286
+ )
287
+ if (!['data', 'object'].includes(String(bucket.kind))) throw invalid('schema', `${at}.kind is data or object`)
288
+ const policy = String(bucket.data_policy)
289
+ if (!BUCKET_POLICIES.includes(policy)) throw invalid('schema', `${at}.data_policy is invalid`)
290
+ if (bucket.scope !== undefined && !['user', 'zone'].includes(String(bucket.scope))) {
291
+ throw invalid('schema', `${at}.scope is user or zone`)
292
+ }
293
+ optionalBoolean(bucket.versioning, `${at}.versioning`)
294
+ const userOwned = policy === 'documents' || policy === 'collected'
295
+ if (bucket.quota_mib !== undefined) {
296
+ expectUint(bucket.quota_mib, `${at}.quota_mib`, Number.MAX_SAFE_INTEGER)
297
+ if (userOwned) throw invalid('schema', `${at}: a ${policy} bucket uses the user's quota`)
298
+ }
299
+ if (bucket.max_objects !== undefined) expectUint(bucket.max_objects, `${at}.max_objects`, Number.MAX_SAFE_INTEGER)
300
+ if (bucket.versioning === true && !['documents', 'app_data', 'collected'].includes(policy)) {
301
+ throw invalid('schema', `${at}: a ${policy} bucket cannot be versioned`)
302
+ }
303
+ if (bucket.default_ttl_days !== undefined) {
304
+ expectUint(bucket.default_ttl_days, `${at}.default_ttl_days`, 0xffffffff)
305
+ if (!['ambient', 'temp', 'cache'].includes(policy)) {
306
+ throw invalid('schema', `${at}: a ${policy} bucket cannot declare default_ttl_days`)
307
+ }
308
+ }
309
+ if (policy === 'temp') {
310
+ const days = bucket.default_ttl_days
311
+ if (typeof days !== 'number' || days < 1 || days > 30) {
312
+ throw invalid('schema', `${at}: a temp bucket declares default_ttl_days 1..30`)
313
+ }
314
+ }
315
+ if (bucket.lifecycle !== undefined) {
316
+ if (!Array.isArray(bucket.lifecycle)) throw invalid('schema', `${at}.lifecycle must be an array`)
317
+ for (const [index, rule] of bucket.lifecycle.entries()) {
318
+ const kind = String(expectObject(rule, `${at}.lifecycle[${index}]`).rule)
319
+ if (!['expire', 'noncurrent_expire', 'expired_delete_marker'].includes(kind)) {
320
+ throw invalid('schema', `${at}.lifecycle[${index}].rule is invalid`)
321
+ }
322
+ if (policy === 'temp' || (userOwned && kind !== 'noncurrent_expire')) {
323
+ throw invalid('schema', `${at}: a ${policy} bucket does not accept the ${kind} rule`)
324
+ }
325
+ }
326
+ }
327
+ needsAppPool ||= policy === 'app_data' || policy === 'temp'
328
+ }
329
+ if (needsAppPool && config.storage_quota_mib === undefined) {
330
+ throw invalid('schema', `${label}.storage_quota_mib is required when app_data or temp buckets are declared`)
331
+ }
332
+ }
333
+
268
334
  export function validateServiceConfigTips(
269
335
  value: unknown,
270
336
  label: string,
@@ -390,6 +456,7 @@ export function validateServiceConfigTips(
390
456
  }
391
457
  optionalString(database.connection, `${label}.rdb_instances.${name}.connection`)
392
458
  }
459
+ validateBuckets(config, label)
393
460
  if (config.instance_volume !== undefined) {
394
461
  const volume = expectObject(config.instance_volume, `${label}.instance_volume`)
395
462
  assertKnownFields(
package/cli/version.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  // Generated by scripts/generate-cli-version.mjs. Do not edit.
2
- export const PACKAGE_VERSION = '0.7.148'
2
+ export const PACKAGE_VERSION = '0.7.149'
3
3
  export const TOOL_VERSION = PACKAGE_VERSION
4
4
  export const SDK_VERSION = PACKAGE_VERSION
5
5
  export const PROTOCOL_VERSION = '1'
package/dist/browser.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./executor_client-5fa2d501.js"),t=require("./ndn_types-08dc9ef1.js"),o=e.createSDKModule("browser"),_=o.buckyos,s=o.initBuckyOS,r=o.getBuckyOSConfig,E=o.getRuntimeType,A=o.getAppId,T=o.getAppDid,S=o.getAppInstanceId,p=o.getAppDataDir,n=o.getKEventClient,i=o.createEventReader,C=o.create_event_reader,I=o.subscribeKEvent,x=o.attachEvent,a=o.removeEvent,O=o.getAccountInfo,D=o.getCurrentIdentity,R=o.loginByPassword,N=o.loginByBrowserSSO,c=o.loginByRuntimeSession,M=o.login,l=o.logout,u=o.getAppSetting,d=o.setAppSetting,P=o.getCurrentWalletUser,L=o.resolve_did,H=o.walletSignWithActiveDid,g=o.openExternalUrl,K=o.getZoneHostName,U=o.getZoneServiceURL,k=o.getServiceRpcClient,m=o.getVerifyHubClient,y=o.getSystemConfigClient,B=o.getTaskManagerClient,F=o.getWorkflowClient;exports.ACCESS_DENIED_ERROR_CODE=e.ACCESS_DENIED_ERROR_CODE,exports.AGENT_DELEGATE_TASK_SCHEMA_ID=e.AGENT_DELEGATE_TASK_SCHEMA_ID,exports.AICC_AI_METHODS=e.AICC_AI_METHODS,exports.AICC_COMPUTE_TASK_SCHEMA_ID=e.AICC_COMPUTE_TASK_SCHEMA_ID,exports.AICC_CORE_METHODS=e.AICC_CORE_METHODS,exports.AICC_EXECUTION_MODES=e.AICC_EXECUTION_MODES,exports.AICC_FEATURES=e.AICC_FEATURES,exports.AICC_MANAGEMENT_METHODS=e.AICC_MANAGEMENT_METHODS,exports.AICC_METHODS=e.AICC_METHODS,exports.AICC_POLICY_REFUSAL_CODES=e.AICC_POLICY_REFUSAL_CODES,exports.AICC_QUOTA_METHODS=e.AICC_QUOTA_METHODS,exports.AICC_SERVICE_SERVICE_NAME=e.AICC_SERVICE_SERVICE_NAME,exports.AICC_SERVICE_SERVICE_PORT=e.AICC_SERVICE_SERVICE_PORT,exports.AICC_SERVICE_UNIQUE_ID=e.AICC_SERVICE_UNIQUE_ID,exports.ANONYMOUS_IDENTITY=e.ANONYMOUS_IDENTITY,exports.APP_INSTALL_TASK_SCHEMA_ID=e.APP_INSTALL_TASK_SCHEMA_ID,exports.APP_LOGIN_EXCHANGE_METHOD=e.APP_LOGIN_EXCHANGE_METHOD,exports.APP_LOGIN_ISSUE_METHOD=e.APP_LOGIN_ISSUE_METHOD,exports.APP_LOGIN_SETTINGS_GET_METHOD=e.APP_LOGIN_SETTINGS_GET_METHOD,exports.APP_LOGIN_SETTINGS_SET_METHOD=e.APP_LOGIN_SETTINGS_SET_METHOD,exports.APP_START_TASK_SCHEMA_ID=e.APP_START_TASK_SCHEMA_ID,exports.APP_UNINSTALL_TASK_SCHEMA_ID=e.APP_UNINSTALL_TASK_SCHEMA_ID,exports.APP_UPDATE_BATCH_TASK_SCHEMA_ID=e.APP_UPDATE_BATCH_TASK_SCHEMA_ID,exports.APP_UPDATE_TASK_SCHEMA_ID=e.APP_UPDATE_TASK_SCHEMA_ID,exports.AiccClient=e.AiccClient,exports.BNS_DNS_TXT_DEFAULT_TTL=e.BNS_DNS_TXT_DEFAULT_TTL,exports.BNS_DNS_TXT_DOC_TYPE=e.BNS_DNS_TXT_DOC_TYPE,exports.BNS_EVM_DEFAULT_GAS_LIMIT=e.BNS_EVM_DEFAULT_GAS_LIMIT,exports.BNS_EVM_DEFAULT_MAX_FEE_PER_GAS=e.BNS_EVM_DEFAULT_MAX_FEE_PER_GAS,exports.BNS_EVM_DEFAULT_MAX_PRIORITY_FEE_PER_GAS=e.BNS_EVM_DEFAULT_MAX_PRIORITY_FEE_PER_GAS,exports.BNS_MAX_INLINE_DOCUMENT_BYTES=e.BNS_MAX_INLINE_DOCUMENT_BYTES,exports.BNS_PUBLISH_DOCUMENT_ABI=e.BNS_PUBLISH_DOCUMENT_ABI,exports.BS_SERVICE_TASK_MANAGER=e.BS_SERVICE_TASK_MANAGER,exports.BS_SERVICE_VERIFY_HUB=e.BS_SERVICE_VERIFY_HUB,exports.BnsEvmTxBuilder=e.BnsEvmTxBuilder,exports.BnsEvmTxError=e.BnsEvmTxError,exports.BnsTxExecutor=e.BnsTxExecutor,exports.BnsTxExecutorError=e.BnsTxExecutorError,exports.BuckyOSSDK=e.BuckyOSSDK,exports.CONTACT_CHANGED_EVENT_BOX=e.CONTACT_CHANGED_EVENT_BOX,exports.CONTACT_TAG_HOMESTATION_FOLLOWING=e.CONTACT_TAG_HOMESTATION_FOLLOWING,exports.CONTACT_TAG_ZONE_AGENT=e.CONTACT_TAG_ZONE_AGENT,exports.CONTACT_TAG_ZONE_USER=e.CONTACT_TAG_ZONE_USER,exports.DEFAULT_CHILD_CONTROL_POLICY=e.DEFAULT_CHILD_CONTROL_POLICY,exports.DEFAULT_JUMP_BASE_URL=e.DEFAULT_JUMP_BASE_URL,exports.DENY_REASONS=e.DENY_REASONS,exports.DOWNLOAD_TASK_SCHEMA_ID=e.DOWNLOAD_TASK_SCHEMA_ID,exports.EXTERNAL_PRINCIPAL_CLAIM=e.EXTERNAL_PRINCIPAL_CLAIM,exports.ExecutorClient=e.ExecutorClient,exports.ExecutorCommandStream=e.ExecutorCommandStream,exports.ExecutorStreamError=e.ExecutorStreamError,exports.FRIEND_INTENT=e.FRIEND_INTENT,exports.HUMAN_APPROVAL_SCHEMA_ID=e.HUMAN_APPROVAL_SCHEMA_ID,exports.HUMAN_INPUT_TASK_SCHEMA_ID=e.HUMAN_INPUT_TASK_SCHEMA_ID,exports.JUMP_ACTION_PATHS=e.JUMP_ACTION_PATHS,exports.KEventClient=e.KEventClient,exports.KEventReader=e.KEventReader,exports.MsgCenterClient=e.MsgCenterClient,exports.MsgQueueClient=e.MsgQueueClient,exports.NOTIFY_ACTION_ANSWER=e.NOTIFY_ACTION_ANSWER,exports.NOTIFY_ACTION_DISMISS=e.NOTIFY_ACTION_DISMISS,exports.NOTIFY_CHOICE_CONTROL_ID=e.NOTIFY_CHOICE_CONTROL_ID,exports.NOTIFY_DATA_VERSION=e.NOTIFY_DATA_VERSION,exports.NOTIFY_DELIVERED_INTENT=e.NOTIFY_DELIVERED_INTENT,exports.NOTIFY_INTENT=e.NOTIFY_INTENT,exports.NOTIFY_LINK_PATH=e.NOTIFY_LINK_PATH,exports.NOTIFY_SESSION_PREFIX=e.NOTIFY_SESSION_PREFIX,exports.NOTIFY_TEXT_CONTROL_ID=e.NOTIFY_TEXT_CONTROL_ID,exports.OPENDAN_ASYNC_TOOL_TASK_SCHEMA_ID=e.OPENDAN_ASYNC_TOOL_TASK_SCHEMA_ID,exports.OPENDAN_COMMAND_TASK_SCHEMA_ID=e.OPENDAN_COMMAND_TASK_SCHEMA_ID,exports.RAW_TASK_SCHEMA_ID=e.RAW_TASK_SCHEMA_ID,exports.RPCError=e.RPCError,exports.RepoClient=e.RepoClient,exports.RuntimeType=e.RuntimeType,exports.SCHEDULER_DISPATCH_THUNK_TASK_SCHEMA_ID=e.SCHEDULER_DISPATCH_THUNK_TASK_SCHEMA_ID,exports.StorageDomain=e.StorageDomain,exports.SystemConfigClient=e.SystemConfigClient,exports.TASK_ERR_ALREADY_COMPLETED=e.TASK_ERR_ALREADY_COMPLETED,exports.TASK_ERR_CONTROL_ALREADY_PENDING=e.TASK_ERR_CONTROL_ALREADY_PENDING,exports.TASK_ERR_CONTROL_NOT_AVAILABLE=e.TASK_ERR_CONTROL_NOT_AVAILABLE,exports.TASK_ERR_IDEMPOTENCY_CONFLICT=e.TASK_ERR_IDEMPOTENCY_CONFLICT,exports.TASK_ERR_INPUT_SCHEMA_MISMATCH=e.TASK_ERR_INPUT_SCHEMA_MISMATCH,exports.TASK_ERR_INVALID_PHASE=e.TASK_ERR_INVALID_PHASE,exports.TASK_ERR_NOT_FOUND=e.TASK_ERR_NOT_FOUND,exports.TASK_ERR_PERMISSION_DENIED=e.TASK_ERR_PERMISSION_DENIED,exports.TASK_ERR_RESULT_SCHEMA_MISMATCH=e.TASK_ERR_RESULT_SCHEMA_MISMATCH,exports.TASK_ERR_REVISION_CONFLICT=e.TASK_ERR_REVISION_CONFLICT,exports.TASK_ERR_SCHEMA_NOT_FOUND=e.TASK_ERR_SCHEMA_NOT_FOUND,exports.TASK_ERR_STALE_RUNNER_EPOCH=e.TASK_ERR_STALE_RUNNER_EPOCH,exports.TASK_MANAGER_SERVICE_NAME=e.TASK_MANAGER_SERVICE_NAME,exports.TASK_MANAGER_SERVICE_PORT=e.TASK_MANAGER_SERVICE_PORT,exports.TASK_MANAGER_SERVICE_UNIQUE_ID=e.TASK_MANAGER_SERVICE_UNIQUE_ID,exports.TASK_MGR_ERROR_CODES=e.TASK_MGR_ERROR_CODES,exports.TASK_POLICY_PRESET_COLLABORATIVE_TREE_V1=e.TASK_POLICY_PRESET_COLLABORATIVE_TREE_V1,exports.TOOL_EXEC_BASH_TASK_SCHEMA_ID=e.TOOL_EXEC_BASH_TASK_SCHEMA_ID,exports.TaskAction=e.TaskAction,exports.TaskControlAction=e.TaskControlAction,exports.TaskDataScope=e.TaskDataScope,exports.TaskEventType=e.TaskEventType,exports.TaskExecutorKind=e.TaskExecutorKind,exports.TaskGrantScope=e.TaskGrantScope,exports.TaskManagerClient=e.TaskManagerClient,exports.TaskOutcome=e.TaskOutcome,exports.TaskPhase=e.TaskPhase,exports.TaskWaitReasonKind=e.TaskWaitReasonKind,exports.USER_GROUP_REF_PREFIX=e.USER_GROUP_REF_PREFIX,exports.USER_TYPE_GROUP_REF_PREFIX=e.USER_TYPE_GROUP_REF_PREFIX,exports.VerifyHubClient=e.VerifyHubClient,exports.WEB3_BRIDGE_HOST=e.WEB3_BRIDGE_HOST,exports.WELL_KNOWN_CONTACT_TAGS=e.WELL_KNOWN_CONTACT_TAGS,exports.WORKFLOW_EXECUTE_RPC_TASK_SCHEMA_ID=e.WORKFLOW_EXECUTE_RPC_TASK_SCHEMA_ID,exports.WORKFLOW_MAP_SHARD_TASK_SCHEMA_ID=e.WORKFLOW_MAP_SHARD_TASK_SCHEMA_ID,exports.WORKFLOW_RUN_TARGET_TASK_SCHEMA_ID=e.WORKFLOW_RUN_TARGET_TASK_SCHEMA_ID,exports.WORKFLOW_RUN_TREE_TASK_SCHEMA_ID=e.WORKFLOW_RUN_TREE_TASK_SCHEMA_ID,exports.WORKFLOW_SCHEDULE_TASK_SCHEMA_ID=e.WORKFLOW_SCHEDULE_TASK_SCHEMA_ID,exports.WORKFLOW_SEND_MESSAGE_TASK_SCHEMA_ID=e.WORKFLOW_SEND_MESSAGE_TASK_SCHEMA_ID,exports.WORKFLOW_SERVICE_NAME=e.WORKFLOW_SERVICE_NAME,exports.WORKFLOW_STEP_TASK_SCHEMA_ID=e.WORKFLOW_STEP_TASK_SCHEMA_ID,exports.WORKFLOW_THUNK_TASK_SCHEMA_ID=e.WORKFLOW_THUNK_TASK_SCHEMA_ID,exports.WorkflowClient=e.WorkflowClient,exports.WorkflowDefinitionStatus=e.WorkflowDefinitionStatus,exports.WorkflowHumanActionKind=e.WorkflowHumanActionKind,exports.WorkflowJoinMode=e.WorkflowJoinMode,exports.WorkflowNodeRunState=e.WorkflowNodeRunState,exports.WorkflowOutputMode=e.WorkflowOutputMode,exports.WorkflowRetryFallback=e.WorkflowRetryFallback,exports.WorkflowRunStatus=e.WorkflowRunStatus,exports.WorkflowScheduledTaskFireStatus=e.WorkflowScheduledTaskFireStatus,exports.WorkflowScheduledTaskMisfirePolicy=e.WorkflowScheduledTaskMisfirePolicy,exports.WorkflowScheduledTaskStatus=e.WorkflowScheduledTaskStatus,exports.WorkflowStepType=e.WorkflowStepType,exports.ZONE_USER_TYPES=e.ZONE_USER_TYPES,exports.accessDenialOf=e.accessDenialOf,exports.aiccMessageFirstText=e.aiccMessageFirstText,exports.aiccMessageTextContent=e.aiccMessageTextContent,exports.aiccRefusalOf=e.aiccRefusalOf,exports.aiccTextMessage=e.aiccTextMessage,exports.answerNotify=e.answerNotify,exports.appDidFromId=e.appDidFromId,exports.appIdFromDid=e.appIdFromDid,exports.baselineTaskControlProfile=e.baselineTaskControlProfile,exports.bns=e.bns_client,exports.buildJumpUrl=e.buildJumpUrl,exports.commitNotifyAnswer=e.commitNotifyAnswer,exports.completeAppAccessTokenLogin=e.completeAppAccessTokenLogin,exports.contactTagApp=e.contactTagApp,exports.contactTagKind=e.contactTagKind,exports.createAppInstanceId=e.createAppInstanceId,exports.createSDKModule=e.createSDKModule,exports.decisionRequirements=e.decisionRequirements,exports.decodeBnsPublishDocumentCalldata=e.decodeBnsPublishDocumentCalldata,exports.encodeExecutorControl=e.encodeExecutorControl,exports.getActiveRuntimeType=e.getActiveRuntimeType,exports.getActiveSessionToken=e.getActiveSessionToken,exports.getActiveZoneGatewayOrigin=e.getActiveZoneGatewayOrigin,exports.getCurrentWalletUserFromHost=e.getCurrentWalletUserFromHost,exports.identityAllows=e.identityAllows,exports.identityKey=e.identityKey,exports.inputPrompt=e.inputPrompt,exports.isAiccAiMethod=e.isAiccAiMethod,exports.isExternalPrincipal=e.isExternalPrincipal,exports.isNotifyClosed=e.isNotifyClosed,exports.isTerminalTaskPhase=e.isTerminalTaskPhase,exports.isUserGroupRefTag=e.isUserGroupRefTag,exports.issueAppCustomerLink=e.issueAppCustomerLink,exports.issueAppLoginCode=e.issueAppLoginCode,exports.loginByAppAccessToken=e.loginByAppAccessToken,exports.mailboxAddress=e.mailboxAddress,exports.mailboxResource=e.mailboxResource,exports.msgMachineData=e.msgMachineData,exports.ndm=e.ndm_client,exports.ndm_proxy=e.ndm_proxy,exports.normalizeZoneHostname=e.normalizeZoneHostname,exports.notifyAnswerToTaskResult=e.notifyAnswerToTaskResult,exports.notifyCategoryFromSessionId=e.notifyCategoryFromSessionId,exports.notifyCategorySessionId=e.notifyCategorySessionId,exports.notifyMessageData=e.notifyMessageData,exports.notifyUrl=e.notifyUrl,exports.parseAccessDenial=e.parseAccessDenial,exports.parseAppId=e.parseAppId,exports.parseAppInstanceId=e.parseAppInstanceId,exports.parseAppLoginExchangeResult=e.parseAppLoginExchangeResult,exports.parseCurrentIdentity=e.parseCurrentIdentity,exports.parseSessionTokenClaims=e.parseSessionTokenClaims,exports.parseVideoPrompt=e.parseVideoPrompt,exports.parseZoneUserType=e.parseZoneUserType,exports.promptOptions=e.promptOptions,exports.randomAppLoginNonce=e.randomAppLoginNonce,exports.resolveDidFromHost=e.resolveDidFromHost,exports.sn=e.sn_client,exports.taskMgrErrorCode=e.taskMgrErrorCode,exports.taskMgrTaskEventPath=e.taskMgrTaskEventPath,exports.taskMgrTreeEventPath=e.taskMgrTreeEventPath,exports.validateAiccMessage=e.validateAiccMessage,exports.validateDecisionAnswers=e.validateDecisionAnswers,exports.validateDecisionRequest=e.validateDecisionRequest,exports.validateNotifyAnswer=e.validateNotifyAnswer,exports.validateVideoEdit=e.validateVideoEdit,exports.validateVideoGeneration=e.validateVideoGeneration,exports.validateVideoOutput=e.validateVideoOutput,exports.videoGenerationRequirement=e.videoGenerationRequirement,exports.waitNotify=e.waitNotify,exports.walletUserHasSnAccount=e.walletUserHasSnAccount,exports.zoneActionUrl=e.zoneActionUrl,exports.DID_OBJECT_SERVICE_ID=t.DID_OBJECT_SERVICE_ID,exports.DID_OBJECT_SERVICE_TYPE=t.DID_OBJECT_SERVICE_TYPE,exports.NODE_IDENTITY_SCHEMA_V2=t.NODE_IDENTITY_SCHEMA_V2,exports.getDidIdentifier=t.getDidIdentifier,exports.getDidMethod=t.getDidMethod,exports.hashPassword=t.hashPassword,exports.isBuckyOSAgentDocument=t.isBuckyOSAgentDocument,exports.isBuckyOSDIDObjectCard=t.isBuckyOSDIDObjectCard,exports.isBuckyOSDeviceDocument=t.isBuckyOSDeviceDocument,exports.isBuckyOSDeviceMiniDocument=t.isBuckyOSDeviceMiniDocument,exports.isBuckyOSLocalNodeIdentityConfig=t.isBuckyOSLocalNodeIdentityConfig,exports.isBuckyOSOwnerDocument=t.isBuckyOSOwnerDocument,exports.isBuckyOSZoneBootDocument=t.isBuckyOSZoneBootDocument,exports.isBuckyOSZoneConfig=t.isBuckyOSZoneConfig,exports.isBuckyOSZoneDocument=t.isBuckyOSZoneDocument,exports.isW3CDIDDocumentBase=t.isW3CDIDDocumentBase,exports.namelib=t.namelib,exports.ndn=t.ndn_types,exports.parseBuckyOSDIDDocument=t.parseBuckyOSDIDDocument,exports.parseBuckyOSDeviceMiniDocument=t.parseBuckyOSDeviceMiniDocument,exports.parseBuckyOSOwnerDocument=t.parseBuckyOSOwnerDocument,exports.parseW3CDIDDocumentBase=t.parseW3CDIDDocumentBase,exports.attachEvent=x,exports.buckyos=_,exports.createEventReader=i,exports.create_event_reader=C,exports.getAccountInfo=O,exports.getAppDataDir=p,exports.getAppDid=T,exports.getAppId=A,exports.getAppInstanceId=S,exports.getAppSetting=u,exports.getBuckyOSConfig=r,exports.getCurrentIdentity=D,exports.getCurrentWalletUser=P,exports.getKEventClient=n,exports.getRuntimeType=E,exports.getServiceRpcClient=k,exports.getSystemConfigClient=y,exports.getTaskManagerClient=B,exports.getVerifyHubClient=m,exports.getWorkflowClient=F,exports.getZoneHostName=K,exports.getZoneServiceURL=U,exports.initBuckyOS=s,exports.login=M,exports.loginByBrowserSSO=N,exports.loginByPassword=R,exports.loginByRuntimeSession=c,exports.logout=l,exports.openExternalUrl=g,exports.removeEvent=a,exports.resolve_did=L,exports.setAppSetting=d,exports.subscribeKEvent=I,exports.walletSignWithActiveDid=H;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./executor_client-d7fc4a8b.js"),t=require("./ndn_types-08dc9ef1.js"),o=e.createSDKModule("browser"),_=o.buckyos,s=o.initBuckyOS,r=o.getBuckyOSConfig,E=o.getRuntimeType,A=o.getAppId,T=o.getAppDid,p=o.getAppInstanceId,S=o.getAppDataDir,n=o.getKEventClient,i=o.createEventReader,C=o.create_event_reader,I=o.subscribeKEvent,x=o.attachEvent,a=o.removeEvent,O=o.getAccountInfo,D=o.getCurrentIdentity,R=o.loginByPassword,N=o.loginByBrowserSSO,c=o.loginByRuntimeSession,M=o.login,l=o.logout,u=o.getAppSetting,d=o.setAppSetting,P=o.getCurrentWalletUser,L=o.resolve_did,H=o.walletSignWithActiveDid,g=o.openExternalUrl,K=o.getZoneHostName,U=o.getZoneServiceURL,k=o.getServiceRpcClient,m=o.getVerifyHubClient,y=o.getSystemConfigClient,B=o.getTaskManagerClient,F=o.getWorkflowClient;exports.ACCESS_DENIED_ERROR_CODE=e.ACCESS_DENIED_ERROR_CODE,exports.AGENT_DELEGATE_TASK_SCHEMA_ID=e.AGENT_DELEGATE_TASK_SCHEMA_ID,exports.AICC_AI_METHODS=e.AICC_AI_METHODS,exports.AICC_COMPUTE_TASK_SCHEMA_ID=e.AICC_COMPUTE_TASK_SCHEMA_ID,exports.AICC_CORE_METHODS=e.AICC_CORE_METHODS,exports.AICC_EXECUTION_MODES=e.AICC_EXECUTION_MODES,exports.AICC_FEATURES=e.AICC_FEATURES,exports.AICC_MANAGEMENT_METHODS=e.AICC_MANAGEMENT_METHODS,exports.AICC_METHODS=e.AICC_METHODS,exports.AICC_POLICY_REFUSAL_CODES=e.AICC_POLICY_REFUSAL_CODES,exports.AICC_QUOTA_METHODS=e.AICC_QUOTA_METHODS,exports.AICC_SERVICE_SERVICE_NAME=e.AICC_SERVICE_SERVICE_NAME,exports.AICC_SERVICE_SERVICE_PORT=e.AICC_SERVICE_SERVICE_PORT,exports.AICC_SERVICE_UNIQUE_ID=e.AICC_SERVICE_UNIQUE_ID,exports.ANONYMOUS_IDENTITY=e.ANONYMOUS_IDENTITY,exports.APP_INSTALL_TASK_SCHEMA_ID=e.APP_INSTALL_TASK_SCHEMA_ID,exports.APP_LOGIN_EXCHANGE_METHOD=e.APP_LOGIN_EXCHANGE_METHOD,exports.APP_LOGIN_ISSUE_METHOD=e.APP_LOGIN_ISSUE_METHOD,exports.APP_LOGIN_SETTINGS_GET_METHOD=e.APP_LOGIN_SETTINGS_GET_METHOD,exports.APP_LOGIN_SETTINGS_SET_METHOD=e.APP_LOGIN_SETTINGS_SET_METHOD,exports.APP_START_TASK_SCHEMA_ID=e.APP_START_TASK_SCHEMA_ID,exports.APP_UNINSTALL_TASK_SCHEMA_ID=e.APP_UNINSTALL_TASK_SCHEMA_ID,exports.APP_UPDATE_BATCH_TASK_SCHEMA_ID=e.APP_UPDATE_BATCH_TASK_SCHEMA_ID,exports.APP_UPDATE_TASK_SCHEMA_ID=e.APP_UPDATE_TASK_SCHEMA_ID,exports.AiccClient=e.AiccClient,exports.BNS_DNS_TXT_DEFAULT_TTL=e.BNS_DNS_TXT_DEFAULT_TTL,exports.BNS_DNS_TXT_DOC_TYPE=e.BNS_DNS_TXT_DOC_TYPE,exports.BNS_EVM_DEFAULT_GAS_LIMIT=e.BNS_EVM_DEFAULT_GAS_LIMIT,exports.BNS_EVM_DEFAULT_MAX_FEE_PER_GAS=e.BNS_EVM_DEFAULT_MAX_FEE_PER_GAS,exports.BNS_EVM_DEFAULT_MAX_PRIORITY_FEE_PER_GAS=e.BNS_EVM_DEFAULT_MAX_PRIORITY_FEE_PER_GAS,exports.BNS_MAX_INLINE_DOCUMENT_BYTES=e.BNS_MAX_INLINE_DOCUMENT_BYTES,exports.BNS_PUBLISH_DOCUMENT_ABI=e.BNS_PUBLISH_DOCUMENT_ABI,exports.BS_SERVICE_TASK_MANAGER=e.BS_SERVICE_TASK_MANAGER,exports.BS_SERVICE_VERIFY_HUB=e.BS_SERVICE_VERIFY_HUB,exports.BnsEvmTxBuilder=e.BnsEvmTxBuilder,exports.BnsEvmTxError=e.BnsEvmTxError,exports.BnsTxExecutor=e.BnsTxExecutor,exports.BnsTxExecutorError=e.BnsTxExecutorError,exports.BuckyOSSDK=e.BuckyOSSDK,exports.CONTACT_CHANGED_EVENT_BOX=e.CONTACT_CHANGED_EVENT_BOX,exports.CONTACT_TAG_HOMESTATION_FOLLOWING=e.CONTACT_TAG_HOMESTATION_FOLLOWING,exports.CONTACT_TAG_ZONE_AGENT=e.CONTACT_TAG_ZONE_AGENT,exports.CONTACT_TAG_ZONE_USER=e.CONTACT_TAG_ZONE_USER,exports.DEFAULT_CHILD_CONTROL_POLICY=e.DEFAULT_CHILD_CONTROL_POLICY,exports.DEFAULT_JUMP_BASE_URL=e.DEFAULT_JUMP_BASE_URL,exports.DENY_REASONS=e.DENY_REASONS,exports.DOWNLOAD_TASK_SCHEMA_ID=e.DOWNLOAD_TASK_SCHEMA_ID,exports.EXTERNAL_PRINCIPAL_CLAIM=e.EXTERNAL_PRINCIPAL_CLAIM,exports.ExecutorClient=e.ExecutorClient,exports.ExecutorCommandStream=e.ExecutorCommandStream,exports.ExecutorStreamError=e.ExecutorStreamError,exports.FRIEND_INTENT=e.FRIEND_INTENT,exports.HUMAN_APPROVAL_SCHEMA_ID=e.HUMAN_APPROVAL_SCHEMA_ID,exports.HUMAN_INPUT_TASK_SCHEMA_ID=e.HUMAN_INPUT_TASK_SCHEMA_ID,exports.JUMP_ACTION_PATHS=e.JUMP_ACTION_PATHS,exports.KEventClient=e.KEventClient,exports.KEventReader=e.KEventReader,exports.MsgCenterClient=e.MsgCenterClient,exports.MsgQueueClient=e.MsgQueueClient,exports.NOTIFY_ACTION_ANSWER=e.NOTIFY_ACTION_ANSWER,exports.NOTIFY_ACTION_DISMISS=e.NOTIFY_ACTION_DISMISS,exports.NOTIFY_CHOICE_CONTROL_ID=e.NOTIFY_CHOICE_CONTROL_ID,exports.NOTIFY_DATA_VERSION=e.NOTIFY_DATA_VERSION,exports.NOTIFY_DELIVERED_INTENT=e.NOTIFY_DELIVERED_INTENT,exports.NOTIFY_INTENT=e.NOTIFY_INTENT,exports.NOTIFY_LINK_PATH=e.NOTIFY_LINK_PATH,exports.NOTIFY_SESSION_PREFIX=e.NOTIFY_SESSION_PREFIX,exports.NOTIFY_TEXT_CONTROL_ID=e.NOTIFY_TEXT_CONTROL_ID,exports.OPENDAN_ASYNC_TOOL_TASK_SCHEMA_ID=e.OPENDAN_ASYNC_TOOL_TASK_SCHEMA_ID,exports.OPENDAN_COMMAND_TASK_SCHEMA_ID=e.OPENDAN_COMMAND_TASK_SCHEMA_ID,exports.RAW_TASK_SCHEMA_ID=e.RAW_TASK_SCHEMA_ID,exports.RPCError=e.RPCError,exports.RepoClient=e.RepoClient,exports.RuntimeType=e.RuntimeType,exports.SCHEDULER_DISPATCH_THUNK_TASK_SCHEMA_ID=e.SCHEDULER_DISPATCH_THUNK_TASK_SCHEMA_ID,exports.StorageDomain=e.StorageDomain,exports.SystemConfigClient=e.SystemConfigClient,exports.TASK_ERR_ALREADY_COMPLETED=e.TASK_ERR_ALREADY_COMPLETED,exports.TASK_ERR_CONTROL_ALREADY_PENDING=e.TASK_ERR_CONTROL_ALREADY_PENDING,exports.TASK_ERR_CONTROL_NOT_AVAILABLE=e.TASK_ERR_CONTROL_NOT_AVAILABLE,exports.TASK_ERR_IDEMPOTENCY_CONFLICT=e.TASK_ERR_IDEMPOTENCY_CONFLICT,exports.TASK_ERR_INPUT_SCHEMA_MISMATCH=e.TASK_ERR_INPUT_SCHEMA_MISMATCH,exports.TASK_ERR_INVALID_PHASE=e.TASK_ERR_INVALID_PHASE,exports.TASK_ERR_NOT_FOUND=e.TASK_ERR_NOT_FOUND,exports.TASK_ERR_PERMISSION_DENIED=e.TASK_ERR_PERMISSION_DENIED,exports.TASK_ERR_RESULT_SCHEMA_MISMATCH=e.TASK_ERR_RESULT_SCHEMA_MISMATCH,exports.TASK_ERR_REVISION_CONFLICT=e.TASK_ERR_REVISION_CONFLICT,exports.TASK_ERR_SCHEMA_NOT_FOUND=e.TASK_ERR_SCHEMA_NOT_FOUND,exports.TASK_ERR_STALE_RUNNER_EPOCH=e.TASK_ERR_STALE_RUNNER_EPOCH,exports.TASK_MANAGER_SERVICE_NAME=e.TASK_MANAGER_SERVICE_NAME,exports.TASK_MANAGER_SERVICE_PORT=e.TASK_MANAGER_SERVICE_PORT,exports.TASK_MANAGER_SERVICE_UNIQUE_ID=e.TASK_MANAGER_SERVICE_UNIQUE_ID,exports.TASK_MGR_ERROR_CODES=e.TASK_MGR_ERROR_CODES,exports.TASK_POLICY_PRESET_COLLABORATIVE_TREE_V1=e.TASK_POLICY_PRESET_COLLABORATIVE_TREE_V1,exports.TOOL_EXEC_BASH_TASK_SCHEMA_ID=e.TOOL_EXEC_BASH_TASK_SCHEMA_ID,exports.TaskAction=e.TaskAction,exports.TaskControlAction=e.TaskControlAction,exports.TaskDataScope=e.TaskDataScope,exports.TaskEventType=e.TaskEventType,exports.TaskExecutorKind=e.TaskExecutorKind,exports.TaskGrantScope=e.TaskGrantScope,exports.TaskManagerClient=e.TaskManagerClient,exports.TaskOutcome=e.TaskOutcome,exports.TaskPhase=e.TaskPhase,exports.TaskWaitReasonKind=e.TaskWaitReasonKind,exports.USER_GROUP_REF_PREFIX=e.USER_GROUP_REF_PREFIX,exports.USER_TYPE_GROUP_REF_PREFIX=e.USER_TYPE_GROUP_REF_PREFIX,exports.VerifyHubClient=e.VerifyHubClient,exports.WEB3_BRIDGE_HOST=e.WEB3_BRIDGE_HOST,exports.WELL_KNOWN_CONTACT_TAGS=e.WELL_KNOWN_CONTACT_TAGS,exports.WORKFLOW_EXECUTE_RPC_TASK_SCHEMA_ID=e.WORKFLOW_EXECUTE_RPC_TASK_SCHEMA_ID,exports.WORKFLOW_MAP_SHARD_TASK_SCHEMA_ID=e.WORKFLOW_MAP_SHARD_TASK_SCHEMA_ID,exports.WORKFLOW_RUN_TARGET_TASK_SCHEMA_ID=e.WORKFLOW_RUN_TARGET_TASK_SCHEMA_ID,exports.WORKFLOW_RUN_TREE_TASK_SCHEMA_ID=e.WORKFLOW_RUN_TREE_TASK_SCHEMA_ID,exports.WORKFLOW_SCHEDULE_TASK_SCHEMA_ID=e.WORKFLOW_SCHEDULE_TASK_SCHEMA_ID,exports.WORKFLOW_SEND_MESSAGE_TASK_SCHEMA_ID=e.WORKFLOW_SEND_MESSAGE_TASK_SCHEMA_ID,exports.WORKFLOW_SERVICE_NAME=e.WORKFLOW_SERVICE_NAME,exports.WORKFLOW_STEP_TASK_SCHEMA_ID=e.WORKFLOW_STEP_TASK_SCHEMA_ID,exports.WORKFLOW_THUNK_TASK_SCHEMA_ID=e.WORKFLOW_THUNK_TASK_SCHEMA_ID,exports.WorkflowClient=e.WorkflowClient,exports.WorkflowDefinitionStatus=e.WorkflowDefinitionStatus,exports.WorkflowHumanActionKind=e.WorkflowHumanActionKind,exports.WorkflowJoinMode=e.WorkflowJoinMode,exports.WorkflowNodeRunState=e.WorkflowNodeRunState,exports.WorkflowOutputMode=e.WorkflowOutputMode,exports.WorkflowRetryFallback=e.WorkflowRetryFallback,exports.WorkflowRunStatus=e.WorkflowRunStatus,exports.WorkflowScheduledTaskFireStatus=e.WorkflowScheduledTaskFireStatus,exports.WorkflowScheduledTaskMisfirePolicy=e.WorkflowScheduledTaskMisfirePolicy,exports.WorkflowScheduledTaskStatus=e.WorkflowScheduledTaskStatus,exports.WorkflowStepType=e.WorkflowStepType,exports.ZONE_USER_TYPES=e.ZONE_USER_TYPES,exports.accessDenialOf=e.accessDenialOf,exports.aiccMessageFirstText=e.aiccMessageFirstText,exports.aiccMessageTextContent=e.aiccMessageTextContent,exports.aiccRefusalOf=e.aiccRefusalOf,exports.aiccTextMessage=e.aiccTextMessage,exports.answerNotify=e.answerNotify,exports.appDidFromId=e.appDidFromId,exports.appIdFromDid=e.appIdFromDid,exports.baselineTaskControlProfile=e.baselineTaskControlProfile,exports.bns=e.bns_client,exports.bucket=e.bucket_client,exports.buildJumpUrl=e.buildJumpUrl,exports.commitNotifyAnswer=e.commitNotifyAnswer,exports.completeAppAccessTokenLogin=e.completeAppAccessTokenLogin,exports.contactTagApp=e.contactTagApp,exports.contactTagKind=e.contactTagKind,exports.createAppInstanceId=e.createAppInstanceId,exports.createSDKModule=e.createSDKModule,exports.decisionRequirements=e.decisionRequirements,exports.decodeBnsPublishDocumentCalldata=e.decodeBnsPublishDocumentCalldata,exports.encodeExecutorControl=e.encodeExecutorControl,exports.getActiveRuntimeType=e.getActiveRuntimeType,exports.getActiveSessionToken=e.getActiveSessionToken,exports.getActiveZoneGatewayOrigin=e.getActiveZoneGatewayOrigin,exports.getCurrentWalletUserFromHost=e.getCurrentWalletUserFromHost,exports.identityAllows=e.identityAllows,exports.identityKey=e.identityKey,exports.inputPrompt=e.inputPrompt,exports.isAiccAiMethod=e.isAiccAiMethod,exports.isExternalPrincipal=e.isExternalPrincipal,exports.isNotifyClosed=e.isNotifyClosed,exports.isTerminalTaskPhase=e.isTerminalTaskPhase,exports.isUserGroupRefTag=e.isUserGroupRefTag,exports.issueAppCustomerLink=e.issueAppCustomerLink,exports.issueAppLoginCode=e.issueAppLoginCode,exports.loginByAppAccessToken=e.loginByAppAccessToken,exports.mailboxAddress=e.mailboxAddress,exports.mailboxResource=e.mailboxResource,exports.msgMachineData=e.msgMachineData,exports.ndm=e.ndm_client,exports.ndm_proxy=e.ndm_proxy,exports.normalizeZoneHostname=e.normalizeZoneHostname,exports.notifyAnswerToTaskResult=e.notifyAnswerToTaskResult,exports.notifyCategoryFromSessionId=e.notifyCategoryFromSessionId,exports.notifyCategorySessionId=e.notifyCategorySessionId,exports.notifyMessageData=e.notifyMessageData,exports.notifyUrl=e.notifyUrl,exports.parseAccessDenial=e.parseAccessDenial,exports.parseAppId=e.parseAppId,exports.parseAppInstanceId=e.parseAppInstanceId,exports.parseAppLoginExchangeResult=e.parseAppLoginExchangeResult,exports.parseCurrentIdentity=e.parseCurrentIdentity,exports.parseSessionTokenClaims=e.parseSessionTokenClaims,exports.parseVideoPrompt=e.parseVideoPrompt,exports.parseZoneUserType=e.parseZoneUserType,exports.promptOptions=e.promptOptions,exports.randomAppLoginNonce=e.randomAppLoginNonce,exports.resolveDidFromHost=e.resolveDidFromHost,exports.sn=e.sn_client,exports.taskMgrErrorCode=e.taskMgrErrorCode,exports.taskMgrTaskEventPath=e.taskMgrTaskEventPath,exports.taskMgrTreeEventPath=e.taskMgrTreeEventPath,exports.validateAiccMessage=e.validateAiccMessage,exports.validateDecisionAnswers=e.validateDecisionAnswers,exports.validateDecisionRequest=e.validateDecisionRequest,exports.validateNotifyAnswer=e.validateNotifyAnswer,exports.validateVideoEdit=e.validateVideoEdit,exports.validateVideoGeneration=e.validateVideoGeneration,exports.validateVideoOutput=e.validateVideoOutput,exports.videoGenerationRequirement=e.videoGenerationRequirement,exports.waitNotify=e.waitNotify,exports.walletUserHasSnAccount=e.walletUserHasSnAccount,exports.zoneActionUrl=e.zoneActionUrl,exports.DID_OBJECT_SERVICE_ID=t.DID_OBJECT_SERVICE_ID,exports.DID_OBJECT_SERVICE_TYPE=t.DID_OBJECT_SERVICE_TYPE,exports.NODE_IDENTITY_SCHEMA_V2=t.NODE_IDENTITY_SCHEMA_V2,exports.getDidIdentifier=t.getDidIdentifier,exports.getDidMethod=t.getDidMethod,exports.hashPassword=t.hashPassword,exports.isBuckyOSAgentDocument=t.isBuckyOSAgentDocument,exports.isBuckyOSDIDObjectCard=t.isBuckyOSDIDObjectCard,exports.isBuckyOSDeviceDocument=t.isBuckyOSDeviceDocument,exports.isBuckyOSDeviceMiniDocument=t.isBuckyOSDeviceMiniDocument,exports.isBuckyOSLocalNodeIdentityConfig=t.isBuckyOSLocalNodeIdentityConfig,exports.isBuckyOSOwnerDocument=t.isBuckyOSOwnerDocument,exports.isBuckyOSZoneBootDocument=t.isBuckyOSZoneBootDocument,exports.isBuckyOSZoneConfig=t.isBuckyOSZoneConfig,exports.isBuckyOSZoneDocument=t.isBuckyOSZoneDocument,exports.isW3CDIDDocumentBase=t.isW3CDIDDocumentBase,exports.namelib=t.namelib,exports.ndn=t.ndn_types,exports.parseBuckyOSDIDDocument=t.parseBuckyOSDIDDocument,exports.parseBuckyOSDeviceMiniDocument=t.parseBuckyOSDeviceMiniDocument,exports.parseBuckyOSOwnerDocument=t.parseBuckyOSOwnerDocument,exports.parseW3CDIDDocumentBase=t.parseW3CDIDDocumentBase,exports.attachEvent=x,exports.buckyos=_,exports.createEventReader=i,exports.create_event_reader=C,exports.getAccountInfo=O,exports.getAppDataDir=S,exports.getAppDid=T,exports.getAppId=A,exports.getAppInstanceId=p,exports.getAppSetting=u,exports.getBuckyOSConfig=r,exports.getCurrentIdentity=D,exports.getCurrentWalletUser=P,exports.getKEventClient=n,exports.getRuntimeType=E,exports.getServiceRpcClient=k,exports.getSystemConfigClient=y,exports.getTaskManagerClient=B,exports.getVerifyHubClient=m,exports.getWorkflowClient=F,exports.getZoneHostName=K,exports.getZoneServiceURL=U,exports.initBuckyOS=s,exports.login=M,exports.loginByBrowserSSO=N,exports.loginByPassword=R,exports.loginByRuntimeSession=c,exports.logout=l,exports.openExternalUrl=g,exports.removeEvent=a,exports.resolve_did=L,exports.setAppSetting=d,exports.subscribeKEvent=I,exports.walletSignWithActiveDid=H;
2
2
  //# sourceMappingURL=browser.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser.cjs","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_types'\nexport * as ndm from './ndm_client'\nexport * as ndm_proxy from './ndm_proxy'\n\nexport * from './executor_client'\n"],"names":["sdkModule","createSDKModule","buckyos","initBuckyOS","getBuckyOSConfig","getRuntimeType","getAppId","getAppDid","getAppInstanceId","getAppDataDir","getKEventClient","createEventReader","create_event_reader","subscribeKEvent","attachEvent","removeEvent","getAccountInfo","getCurrentIdentity","loginByPassword","loginByBrowserSSO","loginByRuntimeSession","login","logout","getAppSetting","setAppSetting","getCurrentWalletUser","resolve_did","walletSignWithActiveDid","openExternalUrl","getZoneHostName","getZoneServiceURL","getServiceRpcClient","getVerifyHubClient","getSystemConfigClient","getTaskManagerClient","getWorkflowClient"],"mappings":"sKAGMA,EAAYC,EAAAA,gBAAgB,WAErBC,EAAUF,EAAUE,QACpBC,EAAcH,EAAUG,YACxBC,EAAmBJ,EAAUI,iBAC7BC,EAAiBL,EAAUK,eAC3BC,EAAWN,EAAUM,SACrBC,EAAYP,EAAUO,UACtBC,EAAmBR,EAAUQ,iBAC7BC,EAAgBT,EAAUS,cAC1BC,EAAkBV,EAAUU,gBAC5BC,EAAoBX,EAAUW,kBAC9BC,EAAsBZ,EAAUY,oBAChCC,EAAkBb,EAAUa,gBAC5BC,EAAcd,EAAUc,YACxBC,EAAcf,EAAUe,YACxBC,EAAiBhB,EAAUgB,eAC3BC,EAAqBjB,EAAUiB,mBAC/BC,EAAkBlB,EAAUkB,gBAC5BC,EAAoBnB,EAAUmB,kBAC9BC,EAAwBpB,EAAUoB,sBAClCC,EAAQrB,EAAUqB,MAClBC,EAAStB,EAAUsB,OACnBC,EAAgBvB,EAAUuB,cAC1BC,EAAgBxB,EAAUwB,cAC1BC,EAAuBzB,EAAUyB,qBACjCC,EAAc1B,EAAU0B,YACxBC,EAA0B3B,EAAU2B,wBACpCC,EAAkB5B,EAAU4B,gBAC5BC,EAAkB7B,EAAU6B,gBAC5BC,EAAoB9B,EAAU8B,kBAC9BC,EAAsB/B,EAAU+B,oBAChCC,EAAqBhC,EAAUgC,mBAC/BC,EAAwBjC,EAAUiC,sBAClCC,EAAuBlC,EAAUkC,qBACjCC,EAAoBnC,EAAUmC"}
1
+ {"version":3,"file":"browser.cjs","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_types'\nexport * as ndm from './ndm_client'\nexport * as ndm_proxy from './ndm_proxy'\nexport * as bucket from './bucket_client'\n\nexport * from './executor_client'\n"],"names":["sdkModule","createSDKModule","buckyos","initBuckyOS","getBuckyOSConfig","getRuntimeType","getAppId","getAppDid","getAppInstanceId","getAppDataDir","getKEventClient","createEventReader","create_event_reader","subscribeKEvent","attachEvent","removeEvent","getAccountInfo","getCurrentIdentity","loginByPassword","loginByBrowserSSO","loginByRuntimeSession","login","logout","getAppSetting","setAppSetting","getCurrentWalletUser","resolve_did","walletSignWithActiveDid","openExternalUrl","getZoneHostName","getZoneServiceURL","getServiceRpcClient","getVerifyHubClient","getSystemConfigClient","getTaskManagerClient","getWorkflowClient"],"mappings":"sKAGMA,EAAYC,EAAAA,gBAAgB,WAErBC,EAAUF,EAAUE,QACpBC,EAAcH,EAAUG,YACxBC,EAAmBJ,EAAUI,iBAC7BC,EAAiBL,EAAUK,eAC3BC,EAAWN,EAAUM,SACrBC,EAAYP,EAAUO,UACtBC,EAAmBR,EAAUQ,iBAC7BC,EAAgBT,EAAUS,cAC1BC,EAAkBV,EAAUU,gBAC5BC,EAAoBX,EAAUW,kBAC9BC,EAAsBZ,EAAUY,oBAChCC,EAAkBb,EAAUa,gBAC5BC,EAAcd,EAAUc,YACxBC,EAAcf,EAAUe,YACxBC,EAAiBhB,EAAUgB,eAC3BC,EAAqBjB,EAAUiB,mBAC/BC,EAAkBlB,EAAUkB,gBAC5BC,EAAoBnB,EAAUmB,kBAC9BC,EAAwBpB,EAAUoB,sBAClCC,EAAQrB,EAAUqB,MAClBC,EAAStB,EAAUsB,OACnBC,EAAgBvB,EAAUuB,cAC1BC,EAAgBxB,EAAUwB,cAC1BC,EAAuBzB,EAAUyB,qBACjCC,EAAc1B,EAAU0B,YACxBC,EAA0B3B,EAAU2B,wBACpCC,EAAkB5B,EAAU4B,gBAC5BC,EAAkB7B,EAAU6B,gBAC5BC,EAAoB9B,EAAU8B,kBAC9BC,EAAsB/B,EAAU+B,oBAChCC,EAAqBhC,EAAUgC,mBAC/BC,EAAwBjC,EAAUiC,sBAClCC,EAAuBlC,EAAUkC,qBACjCC,EAAoBnC,EAAUmC"}
package/dist/browser.d.ts CHANGED
@@ -36,6 +36,7 @@ export declare const buckyos: {
36
36
  getWorkflowClient: () => import("./workflow_client").WorkflowClient;
37
37
  getAiccClient: () => import("./aicc_client").AiccClient;
38
38
  getAiWorkspaceClient: () => import("./aiworkspace_client").AiWorkspaceClient;
39
+ getBucketClient: () => import("./bucket_client").BucketClient;
39
40
  getMsgQueueClient: () => import("./msg_queue_client").MsgQueueClient;
40
41
  getMsgCenterClient: () => import("./msg_center_client").MsgCenterClient;
41
42
  getRepoClient: () => import("./repo_client").RepoClient;
@@ -87,5 +88,6 @@ export * as sn from './sn_client';
87
88
  export * as ndn from './ndn_types';
88
89
  export * as ndm from './ndm_client';
89
90
  export * as ndm_proxy from './ndm_proxy';
91
+ export * as bucket from './bucket_client';
90
92
  export * from './executor_client';
91
93
  //# sourceMappingURL=browser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAIxC,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAoB,CAAA;AACxC,eAAO,MAAM,WAAW,sFAAwB,CAAA;AAChD,eAAO,MAAM,gBAAgB,gDAA6B,CAAA;AAC1D,eAAO,MAAM,cAAc,uCAA2B,CAAA;AACtD,eAAO,MAAM,QAAQ,qBAAqB,CAAA;AAC1C,eAAO,MAAM,SAAS,qBAAsB,CAAA;AAC5C,eAAO,MAAM,gBAAgB,qBAA6B,CAAA;AAC1D,eAAO,MAAM,aAAa,qBAA0B,CAAA;AACpD,eAAO,MAAM,eAAe,8CAA4B,CAAA;AACxD,eAAO,MAAM,iBAAiB,sKAA8B,CAAA;AAC5D,eAAO,MAAM,mBAAmB,sKAAgC,CAAA;AAChE,eAAO,MAAM,eAAe,4PAA4B,CAAA;AACxD,eAAO,MAAM,WAAW,iDAAwB,CAAA;AAChD,eAAO,MAAM,WAAW,4BAAwB,CAAA;AAChD,eAAO,MAAM,cAAc,uDAA2B,CAAA;AACtD,eAAO,MAAM,kBAAkB,uDAA+B,CAAA;AAC9D,eAAO,MAAM,eAAe,wJAA4B,CAAA;AACxD,eAAO,MAAM,iBAAiB,qBAA8B,CAAA;AAC5D,eAAO,MAAM,qBAAqB,uDAAkC,CAAA;AACpE,eAAO,MAAM,KAAK,uDAAkB,CAAA;AACpC,eAAO,MAAM,MAAM,sCAAmB,CAAA;AACtC,eAAO,MAAM,aAAa,mDAA0B,CAAA;AACpD,eAAO,MAAM,aAAa,iFAA0B,CAAA;AACpD,eAAO,MAAM,oBAAoB,oBAAiC,CAAA;AAClE,eAAO,MAAM,WAAW,qHAAwB,CAAA;AAChD,eAAO,MAAM,uBAAuB,6GAAoC,CAAA;AACxE,eAAO,MAAM,eAAe,gCAA4B,CAAA;AACxD,eAAO,MAAM,eAAe,qBAA4B,CAAA;AACxD,eAAO,MAAM,iBAAiB,iCAA8B,CAAA;AAC5D,eAAO,MAAM,mBAAmB,6DAAgC,CAAA;AAChE,eAAO,MAAM,kBAAkB,qDAA+B,CAAA;AAC9D,eAAO,MAAM,qBAAqB,2DAAkC,CAAA;AACpE,eAAO,MAAM,oBAAoB,qDAAiC,CAAA;AAClE,eAAO,MAAM,iBAAiB,kDAA8B,CAAA;AAE5D,OAAO,EAAE,YAAY,EAAE,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,cAAc,gBAAgB,CAAA;AAC9B,OAAO,KAAK,OAAO,MAAM,WAAW,CAAA;AACpC,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,OAAO,KAAK,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,KAAK,GAAG,MAAM,aAAa,CAAA;AAClC,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAA;AAExC,cAAc,mBAAmB,CAAA"}
1
+ {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAIxC,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAoB,CAAA;AACxC,eAAO,MAAM,WAAW,sFAAwB,CAAA;AAChD,eAAO,MAAM,gBAAgB,gDAA6B,CAAA;AAC1D,eAAO,MAAM,cAAc,uCAA2B,CAAA;AACtD,eAAO,MAAM,QAAQ,qBAAqB,CAAA;AAC1C,eAAO,MAAM,SAAS,qBAAsB,CAAA;AAC5C,eAAO,MAAM,gBAAgB,qBAA6B,CAAA;AAC1D,eAAO,MAAM,aAAa,qBAA0B,CAAA;AACpD,eAAO,MAAM,eAAe,8CAA4B,CAAA;AACxD,eAAO,MAAM,iBAAiB,sKAA8B,CAAA;AAC5D,eAAO,MAAM,mBAAmB,sKAAgC,CAAA;AAChE,eAAO,MAAM,eAAe,4PAA4B,CAAA;AACxD,eAAO,MAAM,WAAW,iDAAwB,CAAA;AAChD,eAAO,MAAM,WAAW,4BAAwB,CAAA;AAChD,eAAO,MAAM,cAAc,uDAA2B,CAAA;AACtD,eAAO,MAAM,kBAAkB,uDAA+B,CAAA;AAC9D,eAAO,MAAM,eAAe,wJAA4B,CAAA;AACxD,eAAO,MAAM,iBAAiB,qBAA8B,CAAA;AAC5D,eAAO,MAAM,qBAAqB,uDAAkC,CAAA;AACpE,eAAO,MAAM,KAAK,uDAAkB,CAAA;AACpC,eAAO,MAAM,MAAM,sCAAmB,CAAA;AACtC,eAAO,MAAM,aAAa,mDAA0B,CAAA;AACpD,eAAO,MAAM,aAAa,iFAA0B,CAAA;AACpD,eAAO,MAAM,oBAAoB,oBAAiC,CAAA;AAClE,eAAO,MAAM,WAAW,qHAAwB,CAAA;AAChD,eAAO,MAAM,uBAAuB,6GAAoC,CAAA;AACxE,eAAO,MAAM,eAAe,gCAA4B,CAAA;AACxD,eAAO,MAAM,eAAe,qBAA4B,CAAA;AACxD,eAAO,MAAM,iBAAiB,iCAA8B,CAAA;AAC5D,eAAO,MAAM,mBAAmB,6DAAgC,CAAA;AAChE,eAAO,MAAM,kBAAkB,qDAA+B,CAAA;AAC9D,eAAO,MAAM,qBAAqB,2DAAkC,CAAA;AACpE,eAAO,MAAM,oBAAoB,qDAAiC,CAAA;AAClE,eAAO,MAAM,iBAAiB,kDAA8B,CAAA;AAE5D,OAAO,EAAE,YAAY,EAAE,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,cAAc,gBAAgB,CAAA;AAC9B,OAAO,KAAK,OAAO,MAAM,WAAW,CAAA;AACpC,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,OAAO,KAAK,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,KAAK,GAAG,MAAM,aAAa,CAAA;AAClC,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAA;AAEzC,cAAc,mBAAmB,CAAA"}