@junobuild/cdn 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +3 -3
- package/dist/declarations/console/console.did.d.ts +13 -1
- package/dist/declarations/console/console.factory.certified.did.js +13 -1
- package/dist/declarations/console/console.factory.did.js +13 -1
- package/dist/declarations/console/console.factory.did.mjs +13 -1
- package/dist/declarations/satellite/satellite.did.d.ts +34 -3
- package/dist/declarations/satellite/satellite.factory.certified.did.js +35 -4
- package/dist/declarations/satellite/satellite.factory.did.js +35 -4
- package/dist/declarations/satellite/satellite.factory.did.mjs +35 -4
- package/dist/node/index.mjs +1 -1
- package/dist/node/index.mjs.map +3 -3
- package/package.json +1 -1
|
@@ -27,12 +27,19 @@ export interface AssetsUpgradeOptions {
|
|
|
27
27
|
clear_existing_assets: [] | [boolean];
|
|
28
28
|
}
|
|
29
29
|
export interface AuthenticationConfig {
|
|
30
|
+
updated_at: [] | [bigint];
|
|
31
|
+
created_at: [] | [bigint];
|
|
32
|
+
version: [] | [bigint];
|
|
30
33
|
internet_identity: [] | [AuthenticationConfigInternetIdentity];
|
|
34
|
+
rules: [] | [AuthenticationRules];
|
|
31
35
|
}
|
|
32
36
|
export interface AuthenticationConfigInternetIdentity {
|
|
33
37
|
derivation_origin: [] | [string];
|
|
34
38
|
external_alternative_origins: [] | [Array<string>];
|
|
35
39
|
}
|
|
40
|
+
export interface AuthenticationRules {
|
|
41
|
+
allowed_callers: Array<Principal>;
|
|
42
|
+
}
|
|
36
43
|
export type CollectionType = {Db: null} | {Storage: null};
|
|
37
44
|
export interface CommitBatch {
|
|
38
45
|
batch_id: bigint;
|
|
@@ -67,6 +74,9 @@ export interface CustomDomain {
|
|
|
67
74
|
bn_id: [] | [string];
|
|
68
75
|
}
|
|
69
76
|
export interface DbConfig {
|
|
77
|
+
updated_at: [] | [bigint];
|
|
78
|
+
created_at: [] | [bigint];
|
|
79
|
+
version: [] | [bigint];
|
|
70
80
|
max_memory_size: [] | [ConfigMaxMemorySize];
|
|
71
81
|
}
|
|
72
82
|
export interface DelDoc {
|
|
@@ -230,6 +240,11 @@ export interface SegmentsDeploymentOptions {
|
|
|
230
240
|
mission_control_version: [] | [string];
|
|
231
241
|
satellite_version: [] | [string];
|
|
232
242
|
}
|
|
243
|
+
export interface SetAuthenticationConfig {
|
|
244
|
+
version: [] | [bigint];
|
|
245
|
+
internet_identity: [] | [AuthenticationConfigInternetIdentity];
|
|
246
|
+
rules: [] | [AuthenticationRules];
|
|
247
|
+
}
|
|
233
248
|
export interface SetController {
|
|
234
249
|
metadata: Array<[string, string]>;
|
|
235
250
|
scope: ControllerScope;
|
|
@@ -239,6 +254,10 @@ export interface SetControllersArgs {
|
|
|
239
254
|
controller: SetController;
|
|
240
255
|
controllers: Array<Principal>;
|
|
241
256
|
}
|
|
257
|
+
export interface SetDbConfig {
|
|
258
|
+
version: [] | [bigint];
|
|
259
|
+
max_memory_size: [] | [ConfigMaxMemorySize];
|
|
260
|
+
}
|
|
242
261
|
export interface SetDoc {
|
|
243
262
|
data: Uint8Array | number[];
|
|
244
263
|
description: [] | [string];
|
|
@@ -255,10 +274,22 @@ export interface SetRule {
|
|
|
255
274
|
write: Permission;
|
|
256
275
|
max_changes_per_user: [] | [number];
|
|
257
276
|
}
|
|
277
|
+
export interface SetStorageConfig {
|
|
278
|
+
iframe: [] | [StorageConfigIFrame];
|
|
279
|
+
rewrites: Array<[string, string]>;
|
|
280
|
+
headers: Array<[string, Array<[string, string]>]>;
|
|
281
|
+
version: [] | [bigint];
|
|
282
|
+
max_memory_size: [] | [ConfigMaxMemorySize];
|
|
283
|
+
raw_access: [] | [StorageConfigRawAccess];
|
|
284
|
+
redirects: [] | [Array<[string, StorageConfigRedirect]>];
|
|
285
|
+
}
|
|
258
286
|
export interface StorageConfig {
|
|
259
287
|
iframe: [] | [StorageConfigIFrame];
|
|
288
|
+
updated_at: [] | [bigint];
|
|
260
289
|
rewrites: Array<[string, string]>;
|
|
261
290
|
headers: Array<[string, Array<[string, string]>]>;
|
|
291
|
+
created_at: [] | [bigint];
|
|
292
|
+
version: [] | [bigint];
|
|
262
293
|
max_memory_size: [] | [ConfigMaxMemorySize];
|
|
263
294
|
raw_access: [] | [StorageConfigRawAccess];
|
|
264
295
|
redirects: [] | [Array<[string, StorageConfigRedirect]>];
|
|
@@ -349,14 +380,14 @@ export interface _SERVICE {
|
|
|
349
380
|
list_rules: ActorMethod<[CollectionType, ListRulesParams], ListRulesResults>;
|
|
350
381
|
memory_size: ActorMethod<[], MemorySize>;
|
|
351
382
|
reject_proposal: ActorMethod<[CommitProposal], null>;
|
|
352
|
-
set_auth_config: ActorMethod<[
|
|
383
|
+
set_auth_config: ActorMethod<[SetAuthenticationConfig], AuthenticationConfig>;
|
|
353
384
|
set_controllers: ActorMethod<[SetControllersArgs], Array<[Principal, Controller]>>;
|
|
354
385
|
set_custom_domain: ActorMethod<[string, [] | [string]], undefined>;
|
|
355
|
-
set_db_config: ActorMethod<[
|
|
386
|
+
set_db_config: ActorMethod<[SetDbConfig], DbConfig>;
|
|
356
387
|
set_doc: ActorMethod<[string, string, SetDoc], Doc>;
|
|
357
388
|
set_many_docs: ActorMethod<[Array<[string, string, SetDoc]>], Array<[string, Doc]>>;
|
|
358
389
|
set_rule: ActorMethod<[CollectionType, string, SetRule], Rule>;
|
|
359
|
-
set_storage_config: ActorMethod<[
|
|
390
|
+
set_storage_config: ActorMethod<[SetStorageConfig], StorageConfig>;
|
|
360
391
|
submit_proposal: ActorMethod<[bigint], [bigint, Proposal]>;
|
|
361
392
|
upload_asset_chunk: ActorMethod<[UploadChunk], UploadChunkResult>;
|
|
362
393
|
upload_proposal_asset_chunk: ActorMethod<[UploadChunk], UploadChunkResult>;
|
|
@@ -87,14 +87,24 @@ export const idlFactory = ({IDL}) => {
|
|
|
87
87
|
derivation_origin: IDL.Opt(IDL.Text),
|
|
88
88
|
external_alternative_origins: IDL.Opt(IDL.Vec(IDL.Text))
|
|
89
89
|
});
|
|
90
|
+
const AuthenticationRules = IDL.Record({
|
|
91
|
+
allowed_callers: IDL.Vec(IDL.Principal)
|
|
92
|
+
});
|
|
90
93
|
const AuthenticationConfig = IDL.Record({
|
|
91
|
-
|
|
94
|
+
updated_at: IDL.Opt(IDL.Nat64),
|
|
95
|
+
created_at: IDL.Opt(IDL.Nat64),
|
|
96
|
+
version: IDL.Opt(IDL.Nat64),
|
|
97
|
+
internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),
|
|
98
|
+
rules: IDL.Opt(AuthenticationRules)
|
|
92
99
|
});
|
|
93
100
|
const ConfigMaxMemorySize = IDL.Record({
|
|
94
101
|
stable: IDL.Opt(IDL.Nat64),
|
|
95
102
|
heap: IDL.Opt(IDL.Nat64)
|
|
96
103
|
});
|
|
97
104
|
const DbConfig = IDL.Record({
|
|
105
|
+
updated_at: IDL.Opt(IDL.Nat64),
|
|
106
|
+
created_at: IDL.Opt(IDL.Nat64),
|
|
107
|
+
version: IDL.Opt(IDL.Nat64),
|
|
98
108
|
max_memory_size: IDL.Opt(ConfigMaxMemorySize)
|
|
99
109
|
});
|
|
100
110
|
const StorageConfigIFrame = IDL.Variant({
|
|
@@ -112,8 +122,11 @@ export const idlFactory = ({IDL}) => {
|
|
|
112
122
|
});
|
|
113
123
|
const StorageConfig = IDL.Record({
|
|
114
124
|
iframe: IDL.Opt(StorageConfigIFrame),
|
|
125
|
+
updated_at: IDL.Opt(IDL.Nat64),
|
|
115
126
|
rewrites: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
116
127
|
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)))),
|
|
128
|
+
created_at: IDL.Opt(IDL.Nat64),
|
|
129
|
+
version: IDL.Opt(IDL.Nat64),
|
|
117
130
|
max_memory_size: IDL.Opt(ConfigMaxMemorySize),
|
|
118
131
|
raw_access: IDL.Opt(StorageConfigRawAccess),
|
|
119
132
|
redirects: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, StorageConfigRedirect)))
|
|
@@ -269,6 +282,11 @@ export const idlFactory = ({IDL}) => {
|
|
|
269
282
|
items_length: IDL.Nat64
|
|
270
283
|
});
|
|
271
284
|
const MemorySize = IDL.Record({stable: IDL.Nat64, heap: IDL.Nat64});
|
|
285
|
+
const SetAuthenticationConfig = IDL.Record({
|
|
286
|
+
version: IDL.Opt(IDL.Nat64),
|
|
287
|
+
internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),
|
|
288
|
+
rules: IDL.Opt(AuthenticationRules)
|
|
289
|
+
});
|
|
272
290
|
const SetController = IDL.Record({
|
|
273
291
|
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
274
292
|
scope: ControllerScope,
|
|
@@ -278,6 +296,10 @@ export const idlFactory = ({IDL}) => {
|
|
|
278
296
|
controller: SetController,
|
|
279
297
|
controllers: IDL.Vec(IDL.Principal)
|
|
280
298
|
});
|
|
299
|
+
const SetDbConfig = IDL.Record({
|
|
300
|
+
version: IDL.Opt(IDL.Nat64),
|
|
301
|
+
max_memory_size: IDL.Opt(ConfigMaxMemorySize)
|
|
302
|
+
});
|
|
281
303
|
const SetDoc = IDL.Record({
|
|
282
304
|
data: IDL.Vec(IDL.Nat8),
|
|
283
305
|
description: IDL.Opt(IDL.Text),
|
|
@@ -294,6 +316,15 @@ export const idlFactory = ({IDL}) => {
|
|
|
294
316
|
write: Permission,
|
|
295
317
|
max_changes_per_user: IDL.Opt(IDL.Nat32)
|
|
296
318
|
});
|
|
319
|
+
const SetStorageConfig = IDL.Record({
|
|
320
|
+
iframe: IDL.Opt(StorageConfigIFrame),
|
|
321
|
+
rewrites: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
322
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)))),
|
|
323
|
+
version: IDL.Opt(IDL.Nat64),
|
|
324
|
+
max_memory_size: IDL.Opt(ConfigMaxMemorySize),
|
|
325
|
+
raw_access: IDL.Opt(StorageConfigRawAccess),
|
|
326
|
+
redirects: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, StorageConfigRedirect)))
|
|
327
|
+
});
|
|
297
328
|
const UploadChunk = IDL.Record({
|
|
298
329
|
content: IDL.Vec(IDL.Nat8),
|
|
299
330
|
batch_id: IDL.Nat,
|
|
@@ -361,14 +392,14 @@ export const idlFactory = ({IDL}) => {
|
|
|
361
392
|
list_rules: IDL.Func([CollectionType, ListRulesParams], [ListRulesResults], []),
|
|
362
393
|
memory_size: IDL.Func([], [MemorySize], []),
|
|
363
394
|
reject_proposal: IDL.Func([CommitProposal], [IDL.Null], []),
|
|
364
|
-
set_auth_config: IDL.Func([
|
|
395
|
+
set_auth_config: IDL.Func([SetAuthenticationConfig], [AuthenticationConfig], []),
|
|
365
396
|
set_controllers: IDL.Func(
|
|
366
397
|
[SetControllersArgs],
|
|
367
398
|
[IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],
|
|
368
399
|
[]
|
|
369
400
|
),
|
|
370
401
|
set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),
|
|
371
|
-
set_db_config: IDL.Func([
|
|
402
|
+
set_db_config: IDL.Func([SetDbConfig], [DbConfig], []),
|
|
372
403
|
set_doc: IDL.Func([IDL.Text, IDL.Text, SetDoc], [Doc], []),
|
|
373
404
|
set_many_docs: IDL.Func(
|
|
374
405
|
[IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, SetDoc))],
|
|
@@ -376,7 +407,7 @@ export const idlFactory = ({IDL}) => {
|
|
|
376
407
|
[]
|
|
377
408
|
),
|
|
378
409
|
set_rule: IDL.Func([CollectionType, IDL.Text, SetRule], [Rule], []),
|
|
379
|
-
set_storage_config: IDL.Func([
|
|
410
|
+
set_storage_config: IDL.Func([SetStorageConfig], [StorageConfig], []),
|
|
380
411
|
submit_proposal: IDL.Func([IDL.Nat], [IDL.Nat, Proposal], []),
|
|
381
412
|
upload_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], []),
|
|
382
413
|
upload_proposal_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], [])
|
|
@@ -87,14 +87,24 @@ export const idlFactory = ({IDL}) => {
|
|
|
87
87
|
derivation_origin: IDL.Opt(IDL.Text),
|
|
88
88
|
external_alternative_origins: IDL.Opt(IDL.Vec(IDL.Text))
|
|
89
89
|
});
|
|
90
|
+
const AuthenticationRules = IDL.Record({
|
|
91
|
+
allowed_callers: IDL.Vec(IDL.Principal)
|
|
92
|
+
});
|
|
90
93
|
const AuthenticationConfig = IDL.Record({
|
|
91
|
-
|
|
94
|
+
updated_at: IDL.Opt(IDL.Nat64),
|
|
95
|
+
created_at: IDL.Opt(IDL.Nat64),
|
|
96
|
+
version: IDL.Opt(IDL.Nat64),
|
|
97
|
+
internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),
|
|
98
|
+
rules: IDL.Opt(AuthenticationRules)
|
|
92
99
|
});
|
|
93
100
|
const ConfigMaxMemorySize = IDL.Record({
|
|
94
101
|
stable: IDL.Opt(IDL.Nat64),
|
|
95
102
|
heap: IDL.Opt(IDL.Nat64)
|
|
96
103
|
});
|
|
97
104
|
const DbConfig = IDL.Record({
|
|
105
|
+
updated_at: IDL.Opt(IDL.Nat64),
|
|
106
|
+
created_at: IDL.Opt(IDL.Nat64),
|
|
107
|
+
version: IDL.Opt(IDL.Nat64),
|
|
98
108
|
max_memory_size: IDL.Opt(ConfigMaxMemorySize)
|
|
99
109
|
});
|
|
100
110
|
const StorageConfigIFrame = IDL.Variant({
|
|
@@ -112,8 +122,11 @@ export const idlFactory = ({IDL}) => {
|
|
|
112
122
|
});
|
|
113
123
|
const StorageConfig = IDL.Record({
|
|
114
124
|
iframe: IDL.Opt(StorageConfigIFrame),
|
|
125
|
+
updated_at: IDL.Opt(IDL.Nat64),
|
|
115
126
|
rewrites: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
116
127
|
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)))),
|
|
128
|
+
created_at: IDL.Opt(IDL.Nat64),
|
|
129
|
+
version: IDL.Opt(IDL.Nat64),
|
|
117
130
|
max_memory_size: IDL.Opt(ConfigMaxMemorySize),
|
|
118
131
|
raw_access: IDL.Opt(StorageConfigRawAccess),
|
|
119
132
|
redirects: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, StorageConfigRedirect)))
|
|
@@ -269,6 +282,11 @@ export const idlFactory = ({IDL}) => {
|
|
|
269
282
|
items_length: IDL.Nat64
|
|
270
283
|
});
|
|
271
284
|
const MemorySize = IDL.Record({stable: IDL.Nat64, heap: IDL.Nat64});
|
|
285
|
+
const SetAuthenticationConfig = IDL.Record({
|
|
286
|
+
version: IDL.Opt(IDL.Nat64),
|
|
287
|
+
internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),
|
|
288
|
+
rules: IDL.Opt(AuthenticationRules)
|
|
289
|
+
});
|
|
272
290
|
const SetController = IDL.Record({
|
|
273
291
|
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
274
292
|
scope: ControllerScope,
|
|
@@ -278,6 +296,10 @@ export const idlFactory = ({IDL}) => {
|
|
|
278
296
|
controller: SetController,
|
|
279
297
|
controllers: IDL.Vec(IDL.Principal)
|
|
280
298
|
});
|
|
299
|
+
const SetDbConfig = IDL.Record({
|
|
300
|
+
version: IDL.Opt(IDL.Nat64),
|
|
301
|
+
max_memory_size: IDL.Opt(ConfigMaxMemorySize)
|
|
302
|
+
});
|
|
281
303
|
const SetDoc = IDL.Record({
|
|
282
304
|
data: IDL.Vec(IDL.Nat8),
|
|
283
305
|
description: IDL.Opt(IDL.Text),
|
|
@@ -294,6 +316,15 @@ export const idlFactory = ({IDL}) => {
|
|
|
294
316
|
write: Permission,
|
|
295
317
|
max_changes_per_user: IDL.Opt(IDL.Nat32)
|
|
296
318
|
});
|
|
319
|
+
const SetStorageConfig = IDL.Record({
|
|
320
|
+
iframe: IDL.Opt(StorageConfigIFrame),
|
|
321
|
+
rewrites: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
322
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)))),
|
|
323
|
+
version: IDL.Opt(IDL.Nat64),
|
|
324
|
+
max_memory_size: IDL.Opt(ConfigMaxMemorySize),
|
|
325
|
+
raw_access: IDL.Opt(StorageConfigRawAccess),
|
|
326
|
+
redirects: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, StorageConfigRedirect)))
|
|
327
|
+
});
|
|
297
328
|
const UploadChunk = IDL.Record({
|
|
298
329
|
content: IDL.Vec(IDL.Nat8),
|
|
299
330
|
batch_id: IDL.Nat,
|
|
@@ -361,14 +392,14 @@ export const idlFactory = ({IDL}) => {
|
|
|
361
392
|
list_rules: IDL.Func([CollectionType, ListRulesParams], [ListRulesResults], ['query']),
|
|
362
393
|
memory_size: IDL.Func([], [MemorySize], ['query']),
|
|
363
394
|
reject_proposal: IDL.Func([CommitProposal], [IDL.Null], []),
|
|
364
|
-
set_auth_config: IDL.Func([
|
|
395
|
+
set_auth_config: IDL.Func([SetAuthenticationConfig], [AuthenticationConfig], []),
|
|
365
396
|
set_controllers: IDL.Func(
|
|
366
397
|
[SetControllersArgs],
|
|
367
398
|
[IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],
|
|
368
399
|
[]
|
|
369
400
|
),
|
|
370
401
|
set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),
|
|
371
|
-
set_db_config: IDL.Func([
|
|
402
|
+
set_db_config: IDL.Func([SetDbConfig], [DbConfig], []),
|
|
372
403
|
set_doc: IDL.Func([IDL.Text, IDL.Text, SetDoc], [Doc], []),
|
|
373
404
|
set_many_docs: IDL.Func(
|
|
374
405
|
[IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, SetDoc))],
|
|
@@ -376,7 +407,7 @@ export const idlFactory = ({IDL}) => {
|
|
|
376
407
|
[]
|
|
377
408
|
),
|
|
378
409
|
set_rule: IDL.Func([CollectionType, IDL.Text, SetRule], [Rule], []),
|
|
379
|
-
set_storage_config: IDL.Func([
|
|
410
|
+
set_storage_config: IDL.Func([SetStorageConfig], [StorageConfig], []),
|
|
380
411
|
submit_proposal: IDL.Func([IDL.Nat], [IDL.Nat, Proposal], []),
|
|
381
412
|
upload_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], []),
|
|
382
413
|
upload_proposal_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], [])
|
|
@@ -87,14 +87,24 @@ export const idlFactory = ({IDL}) => {
|
|
|
87
87
|
derivation_origin: IDL.Opt(IDL.Text),
|
|
88
88
|
external_alternative_origins: IDL.Opt(IDL.Vec(IDL.Text))
|
|
89
89
|
});
|
|
90
|
+
const AuthenticationRules = IDL.Record({
|
|
91
|
+
allowed_callers: IDL.Vec(IDL.Principal)
|
|
92
|
+
});
|
|
90
93
|
const AuthenticationConfig = IDL.Record({
|
|
91
|
-
|
|
94
|
+
updated_at: IDL.Opt(IDL.Nat64),
|
|
95
|
+
created_at: IDL.Opt(IDL.Nat64),
|
|
96
|
+
version: IDL.Opt(IDL.Nat64),
|
|
97
|
+
internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),
|
|
98
|
+
rules: IDL.Opt(AuthenticationRules)
|
|
92
99
|
});
|
|
93
100
|
const ConfigMaxMemorySize = IDL.Record({
|
|
94
101
|
stable: IDL.Opt(IDL.Nat64),
|
|
95
102
|
heap: IDL.Opt(IDL.Nat64)
|
|
96
103
|
});
|
|
97
104
|
const DbConfig = IDL.Record({
|
|
105
|
+
updated_at: IDL.Opt(IDL.Nat64),
|
|
106
|
+
created_at: IDL.Opt(IDL.Nat64),
|
|
107
|
+
version: IDL.Opt(IDL.Nat64),
|
|
98
108
|
max_memory_size: IDL.Opt(ConfigMaxMemorySize)
|
|
99
109
|
});
|
|
100
110
|
const StorageConfigIFrame = IDL.Variant({
|
|
@@ -112,8 +122,11 @@ export const idlFactory = ({IDL}) => {
|
|
|
112
122
|
});
|
|
113
123
|
const StorageConfig = IDL.Record({
|
|
114
124
|
iframe: IDL.Opt(StorageConfigIFrame),
|
|
125
|
+
updated_at: IDL.Opt(IDL.Nat64),
|
|
115
126
|
rewrites: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
116
127
|
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)))),
|
|
128
|
+
created_at: IDL.Opt(IDL.Nat64),
|
|
129
|
+
version: IDL.Opt(IDL.Nat64),
|
|
117
130
|
max_memory_size: IDL.Opt(ConfigMaxMemorySize),
|
|
118
131
|
raw_access: IDL.Opt(StorageConfigRawAccess),
|
|
119
132
|
redirects: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, StorageConfigRedirect)))
|
|
@@ -269,6 +282,11 @@ export const idlFactory = ({IDL}) => {
|
|
|
269
282
|
items_length: IDL.Nat64
|
|
270
283
|
});
|
|
271
284
|
const MemorySize = IDL.Record({stable: IDL.Nat64, heap: IDL.Nat64});
|
|
285
|
+
const SetAuthenticationConfig = IDL.Record({
|
|
286
|
+
version: IDL.Opt(IDL.Nat64),
|
|
287
|
+
internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity),
|
|
288
|
+
rules: IDL.Opt(AuthenticationRules)
|
|
289
|
+
});
|
|
272
290
|
const SetController = IDL.Record({
|
|
273
291
|
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
274
292
|
scope: ControllerScope,
|
|
@@ -278,6 +296,10 @@ export const idlFactory = ({IDL}) => {
|
|
|
278
296
|
controller: SetController,
|
|
279
297
|
controllers: IDL.Vec(IDL.Principal)
|
|
280
298
|
});
|
|
299
|
+
const SetDbConfig = IDL.Record({
|
|
300
|
+
version: IDL.Opt(IDL.Nat64),
|
|
301
|
+
max_memory_size: IDL.Opt(ConfigMaxMemorySize)
|
|
302
|
+
});
|
|
281
303
|
const SetDoc = IDL.Record({
|
|
282
304
|
data: IDL.Vec(IDL.Nat8),
|
|
283
305
|
description: IDL.Opt(IDL.Text),
|
|
@@ -294,6 +316,15 @@ export const idlFactory = ({IDL}) => {
|
|
|
294
316
|
write: Permission,
|
|
295
317
|
max_changes_per_user: IDL.Opt(IDL.Nat32)
|
|
296
318
|
});
|
|
319
|
+
const SetStorageConfig = IDL.Record({
|
|
320
|
+
iframe: IDL.Opt(StorageConfigIFrame),
|
|
321
|
+
rewrites: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
322
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)))),
|
|
323
|
+
version: IDL.Opt(IDL.Nat64),
|
|
324
|
+
max_memory_size: IDL.Opt(ConfigMaxMemorySize),
|
|
325
|
+
raw_access: IDL.Opt(StorageConfigRawAccess),
|
|
326
|
+
redirects: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, StorageConfigRedirect)))
|
|
327
|
+
});
|
|
297
328
|
const UploadChunk = IDL.Record({
|
|
298
329
|
content: IDL.Vec(IDL.Nat8),
|
|
299
330
|
batch_id: IDL.Nat,
|
|
@@ -361,14 +392,14 @@ export const idlFactory = ({IDL}) => {
|
|
|
361
392
|
list_rules: IDL.Func([CollectionType, ListRulesParams], [ListRulesResults], ['query']),
|
|
362
393
|
memory_size: IDL.Func([], [MemorySize], ['query']),
|
|
363
394
|
reject_proposal: IDL.Func([CommitProposal], [IDL.Null], []),
|
|
364
|
-
set_auth_config: IDL.Func([
|
|
395
|
+
set_auth_config: IDL.Func([SetAuthenticationConfig], [AuthenticationConfig], []),
|
|
365
396
|
set_controllers: IDL.Func(
|
|
366
397
|
[SetControllersArgs],
|
|
367
398
|
[IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],
|
|
368
399
|
[]
|
|
369
400
|
),
|
|
370
401
|
set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),
|
|
371
|
-
set_db_config: IDL.Func([
|
|
402
|
+
set_db_config: IDL.Func([SetDbConfig], [DbConfig], []),
|
|
372
403
|
set_doc: IDL.Func([IDL.Text, IDL.Text, SetDoc], [Doc], []),
|
|
373
404
|
set_many_docs: IDL.Func(
|
|
374
405
|
[IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, SetDoc))],
|
|
@@ -376,7 +407,7 @@ export const idlFactory = ({IDL}) => {
|
|
|
376
407
|
[]
|
|
377
408
|
),
|
|
378
409
|
set_rule: IDL.Func([CollectionType, IDL.Text, SetRule], [Rule], []),
|
|
379
|
-
set_storage_config: IDL.Func([
|
|
410
|
+
set_storage_config: IDL.Func([SetStorageConfig], [StorageConfig], []),
|
|
380
411
|
submit_proposal: IDL.Func([IDL.Nat], [IDL.Nat, Proposal], []),
|
|
381
412
|
upload_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], []),
|
|
382
413
|
upload_proposal_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], [])
|
package/dist/node/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as topLevelCreateRequire } from 'module';
|
|
2
2
|
const require = topLevelCreateRequire(import.meta.url);
|
|
3
|
-
import{assertNonNullish as St}from"@dfinity/utils";var pt=({IDL:t})=>{let e=t.Record({e8s:t.Nat64}),o=t.Record({mission_control_id:t.Principal,user:t.Principal}),a=t.Record({batch_id:t.Nat,headers:t.Vec(t.Tuple(t.Text,t.Text)),chunk_ids:t.Vec(t.Nat)}),s=t.Record({sha256:t.Vec(t.Nat8),proposal_id:t.Nat}),r=t.Record({block_index:t.Opt(t.Nat64),subnet_id:t.Opt(t.Principal),user:t.Principal}),n=t.Record({controllers:t.Vec(t.Principal)}),u=t.Record({proposal_ids:t.Vec(t.Nat)}),i=t.Variant({Deny:t.Null,AllowAny:t.Null,SameOrigin:t.Null}),K=t.Record({stable:t.Opt(t.Nat64),heap:t.Opt(t.Nat64)}),f=t.Variant({Deny:t.Null,Allow:t.Null}),y=t.Record({status_code:t.Nat16,location:t.Text}),m=t.Record({iframe:t.Opt(i),rewrites:t.Vec(t.Tuple(t.Text,t.Text)),headers:t.Vec(t.Tuple(t.Text,t.Vec(t.Tuple(t.Text,t.Text)))),max_memory_size:t.Opt(K),raw_access:t.Opt(f),redirects:t.Opt(t.Vec(t.Tuple(t.Text,y)))}),_=t.Record({storage:m}),F=t.Record({user:t.Principal}),W=t.Variant({Initialized:t.Null,Failed:t.Null,Open:t.Null,Rejected:t.Null,Executed:t.Null,Accepted:t.Null}),G=t.Record({clear_existing_assets:t.Opt(t.Bool)}),J=t.Record({orbiter:t.Opt(t.Text),mission_control_version:t.Opt(t.Text),satellite_version:t.Opt(t.Text)}),C=t.Variant({AssetsUpgrade:G,SegmentsDeployment:J}),l=t.Record({status:W,updated_at:t.Nat64,sha256:t.Opt(t.Vec(t.Nat8)),executed_at:t.Opt(t.Nat64),owner:t.Principal,created_at:t.Nat64,version:t.Opt(t.Nat64),proposal_type:C}),P=t.Record({updated_at:t.Nat64,credits:e,mission_control_id:t.Opt(t.Principal),owner:t.Principal,created_at:t.Nat64}),g=t.Record({url:t.Text,method:t.Text,body:t.Vec(t.Nat8),headers:t.Vec(t.Tuple(t.Text,t.Text)),certificate_version:t.Opt(t.Nat16)}),A=t.Variant({Heap:t.Null,Stable:t.Null}),p=t.Record({memory:A,token:t.Opt(t.Text),sha256:t.Opt(t.Vec(t.Nat8)),headers:t.Vec(t.Tuple(t.Text,t.Text)),index:t.Nat64,encoding_type:t.Text,full_path:t.Text}),Q=t.Variant({Callback:t.Record({token:p,callback:t.Func([],[],["query"])})}),X=t.Record({body:t.Vec(t.Nat8),headers:t.Vec(t.Tuple(t.Text,t.Text)),streaming_strategy:t.Opt(Q),status_code:t.Nat16}),Y=t.Record({token:t.Opt(p),body:t.Vec(t.Nat8)}),N=t.Record({token:t.Opt(t.Text),collection:t.Text,name:t.Text,description:t.Opt(t.Text),encoding_type:t.Opt(t.Text),full_path:t.Text}),V=t.Record({batch_id:t.Nat}),d=t.Variant({UpdatedAt:t.Null,Keys:t.Null,CreatedAt:t.Null}),Z=t.Record({field:d,desc:t.Bool}),w=t.Variant({Equal:t.Nat64,Between:t.Tuple(t.Nat64,t.Nat64),GreaterThan:t.Nat64,LessThan:t.Nat64}),$=t.Record({key:t.Opt(t.Text),updated_at:t.Opt(w),description:t.Opt(t.Text),created_at:t.Opt(w)}),S=t.Record({start_after:t.Opt(t.Text),limit:t.Opt(t.Nat64)}),T=t.Record({order:t.Opt(Z),owner:t.Opt(t.Principal),matcher:t.Opt($),paginate:t.Opt(S)}),O=t.Record({token:t.Opt(t.Text),collection:t.Text,owner:t.Principal,name:t.Text,description:t.Opt(t.Text),full_path:t.Text}),x=t.Record({modified:t.Nat64,sha256:t.Vec(t.Nat8),total_length:t.Nat}),b=t.Record({key:O,updated_at:t.Nat64,encodings:t.Vec(t.Tuple(t.Text,x)),headers:t.Vec(t.Tuple(t.Text,t.Text)),created_at:t.Nat64,version:t.Opt(t.Nat64)}),R=t.Record({matches_pages:t.Opt(t.Nat64),matches_length:t.Nat64,items_page:t.Opt(t.Nat64),items:t.Vec(t.Tuple(t.Text,b)),items_length:t.Nat64}),k=t.Variant({Write:t.Null,Admin:t.Null,Submit:t.Null}),h=t.Record({updated_at:t.Nat64,metadata:t.Vec(t.Tuple(t.Text,t.Text)),created_at:t.Nat64,scope:k,expires_at:t.Opt(t.Nat64)}),I=t.Record({updated_at:t.Nat64,created_at:t.Nat64,version:t.Opt(t.Nat64),bn_id:t.Opt(t.Text)}),L=t.Variant({Refunded:t.Null,Acknowledged:t.Null,Completed:t.Null}),D=t.Record({status:L,updated_at:t.Nat64,block_index_payment:t.Nat64,mission_control_id:t.Opt(t.Principal),created_at:t.Nat64,block_index_refunded:t.Opt(t.Nat64)}),q=t.Record({desc:t.Bool}),v=t.Record({start_after:t.Opt(t.Nat),limit:t.Opt(t.Nat)}),tt=t.Record({order:t.Opt(q),paginate:t.Opt(v)}),et=t.Record({proposal_id:t.Nat}),ot=t.Record({matches_length:t.Nat64,items:t.Vec(t.Tuple(et,l)),items_length:t.Nat64}),at=t.Record({metadata:t.Vec(t.Tuple(t.Text,t.Text)),scope:k,expires_at:t.Opt(t.Nat64)}),st=t.Record({controller:at,controllers:t.Vec(t.Principal)}),j=t.Variant({Orbiter:t.Null,MissionControl:t.Null,Satellite:t.Null}),rt=t.Record({max_tokens:t.Nat64,time_per_token_ns:t.Nat64}),M=t.Record({content:t.Vec(t.Nat8),batch_id:t.Nat,order_id:t.Opt(t.Nat)}),U=t.Record({chunk_id:t.Nat});return t.Service({add_credits:t.Func([t.Principal,e],[],[]),add_invitation_code:t.Func([t.Text],[],[]),assert_mission_control_center:t.Func([o],[],["query"]),commit_asset_upload:t.Func([a],[],[]),commit_proposal:t.Func([s],[t.Null],[]),commit_proposal_asset_upload:t.Func([a],[],[]),count_proposals:t.Func([],[t.Nat64],["query"]),create_orbiter:t.Func([r],[t.Principal],[]),create_satellite:t.Func([r],[t.Principal],[]),del_controllers:t.Func([n],[],[]),del_custom_domain:t.Func([t.Text],[],[]),delete_proposal_assets:t.Func([u],[],[]),get_config:t.Func([],[_],["query"]),get_create_orbiter_fee:t.Func([F],[t.Opt(e)],["query"]),get_create_satellite_fee:t.Func([F],[t.Opt(e)],["query"]),get_credits:t.Func([],[e],["query"]),get_proposal:t.Func([t.Nat],[t.Opt(l)],["query"]),get_storage_config:t.Func([],[m],["query"]),get_user_mission_control_center:t.Func([],[t.Opt(P)],["query"]),http_request:t.Func([g],[X],["query"]),http_request_streaming_callback:t.Func([p],[Y],["query"]),init_asset_upload:t.Func([N,t.Nat],[V],[]),init_proposal:t.Func([C],[t.Nat,l],[]),init_proposal_asset_upload:t.Func([N,t.Nat],[V],[]),init_user_mission_control_center:t.Func([],[P],[]),list_assets:t.Func([t.Text,T],[R],["query"]),list_controllers:t.Func([],[t.Vec(t.Tuple(t.Principal,h))],["query"]),list_custom_domains:t.Func([],[t.Vec(t.Tuple(t.Text,I))],["query"]),list_payments:t.Func([],[t.Vec(t.Tuple(t.Nat64,D))],["query"]),list_proposals:t.Func([tt],[ot],["query"]),list_user_mission_control_centers:t.Func([],[t.Vec(t.Tuple(t.Principal,P))],["query"]),reject_proposal:t.Func([s],[t.Null],[]),set_controllers:t.Func([st],[],[]),set_custom_domain:t.Func([t.Text,t.Opt(t.Text)],[],[]),set_fee:t.Func([j,e],[],[]),set_storage_config:t.Func([m],[],[]),submit_proposal:t.Func([t.Nat],[t.Nat,l],[]),update_rate_config:t.Func([j,rt],[],[]),upload_asset_chunk:t.Func([M],[U],[]),upload_proposal_asset_chunk:t.Func([M],[U],[])})};var dt=({IDL:t})=>{let e=t.Record({batch_id:t.Nat,headers:t.Vec(t.Tuple(t.Text,t.Text)),chunk_ids:t.Vec(t.Nat)}),o=t.Record({sha256:t.Vec(t.Nat8),proposal_id:t.Nat}),a=t.Variant({UpdatedAt:t.Null,Keys:t.Null,CreatedAt:t.Null}),s=t.Record({field:a,desc:t.Bool}),r=t.Variant({Equal:t.Nat64,Between:t.Tuple(t.Nat64,t.Nat64),GreaterThan:t.Nat64,LessThan:t.Nat64}),n=t.Record({key:t.Opt(t.Text),updated_at:t.Opt(r),description:t.Opt(t.Text),created_at:t.Opt(r)}),u=t.Record({start_after:t.Opt(t.Text),limit:t.Opt(t.Nat64)}),i=t.Record({order:t.Opt(s),owner:t.Opt(t.Principal),matcher:t.Opt(n),paginate:t.Opt(u)}),K=t.Record({controllers:t.Vec(t.Principal)}),f=t.Variant({Write:t.Null,Admin:t.Null,Submit:t.Null}),y=t.Record({updated_at:t.Nat64,metadata:t.Vec(t.Tuple(t.Text,t.Text)),created_at:t.Nat64,scope:f,expires_at:t.Opt(t.Nat64)}),m=t.Record({version:t.Opt(t.Nat64)}),_=t.Variant({Db:t.Null,Storage:t.Null}),F=t.Record({version:t.Opt(t.Nat64)}),W=t.Record({proposal_ids:t.Vec(t.Nat)}),G=t.Record({cycles:t.Nat,destination_id:t.Principal}),J=t.Record({token:t.Opt(t.Text),collection:t.Text,owner:t.Principal,name:t.Text,description:t.Opt(t.Text),full_path:t.Text}),C=t.Record({modified:t.Nat64,sha256:t.Vec(t.Nat8),total_length:t.Nat}),l=t.Record({key:J,updated_at:t.Nat64,encodings:t.Vec(t.Tuple(t.Text,C)),headers:t.Vec(t.Tuple(t.Text,t.Text)),created_at:t.Nat64,version:t.Opt(t.Nat64)}),P=t.Record({derivation_origin:t.Opt(t.Text),external_alternative_origins:t.Opt(t.Vec(t.Text))}),g=t.Record({internet_identity:t.Opt(P)}),A=t.Record({stable:t.Opt(t.Nat64),heap:t.Opt(t.Nat64)}),p=t.Record({max_memory_size:t.Opt(A)}),Q=t.Variant({Deny:t.Null,AllowAny:t.Null,SameOrigin:t.Null}),X=t.Variant({Deny:t.Null,Allow:t.Null}),Y=t.Record({status_code:t.Nat16,location:t.Text}),N=t.Record({iframe:t.Opt(Q),rewrites:t.Vec(t.Tuple(t.Text,t.Text)),headers:t.Vec(t.Tuple(t.Text,t.Vec(t.Tuple(t.Text,t.Text)))),max_memory_size:t.Opt(A),raw_access:t.Opt(X),redirects:t.Opt(t.Vec(t.Tuple(t.Text,Y)))}),V=t.Record({db:t.Opt(p),authentication:t.Opt(g),storage:N}),d=t.Record({updated_at:t.Nat64,owner:t.Principal,data:t.Vec(t.Nat8),description:t.Opt(t.Text),created_at:t.Nat64,version:t.Opt(t.Nat64)}),Z=t.Variant({Initialized:t.Null,Failed:t.Null,Open:t.Null,Rejected:t.Null,Executed:t.Null,Accepted:t.Null}),w=t.Record({clear_existing_assets:t.Opt(t.Bool)}),$=t.Record({orbiter:t.Opt(t.Text),mission_control_version:t.Opt(t.Text),satellite_version:t.Opt(t.Text)}),S=t.Variant({AssetsUpgrade:w,SegmentsDeployment:$}),T=t.Record({status:Z,updated_at:t.Nat64,sha256:t.Opt(t.Vec(t.Nat8)),executed_at:t.Opt(t.Nat64),owner:t.Principal,created_at:t.Nat64,version:t.Opt(t.Nat64),proposal_type:S}),O=t.Variant({Heap:t.Null,Stable:t.Null}),x=t.Variant({Controllers:t.Null,Private:t.Null,Public:t.Null,Managed:t.Null}),b=t.Record({max_tokens:t.Nat64,time_per_token_ns:t.Nat64}),R=t.Record({max_capacity:t.Opt(t.Nat32),memory:t.Opt(O),updated_at:t.Nat64,max_size:t.Opt(t.Nat),read:x,created_at:t.Nat64,version:t.Opt(t.Nat64),mutable_permissions:t.Opt(t.Bool),rate_config:t.Opt(b),write:x,max_changes_per_user:t.Opt(t.Nat32)}),k=t.Record({url:t.Text,method:t.Text,body:t.Vec(t.Nat8),headers:t.Vec(t.Tuple(t.Text,t.Text)),certificate_version:t.Opt(t.Nat16)}),h=t.Record({memory:O,token:t.Opt(t.Text),sha256:t.Opt(t.Vec(t.Nat8)),headers:t.Vec(t.Tuple(t.Text,t.Text)),index:t.Nat64,encoding_type:t.Text,full_path:t.Text}),I=t.Variant({Callback:t.Record({token:h,callback:t.Func([],[],["query"])})}),L=t.Record({body:t.Vec(t.Nat8),headers:t.Vec(t.Tuple(t.Text,t.Text)),streaming_strategy:t.Opt(I),status_code:t.Nat16}),D=t.Record({token:t.Opt(h),body:t.Vec(t.Nat8)}),q=t.Record({token:t.Opt(t.Text),collection:t.Text,name:t.Text,description:t.Opt(t.Text),encoding_type:t.Opt(t.Text),full_path:t.Text}),v=t.Record({batch_id:t.Nat}),tt=t.Record({matches_pages:t.Opt(t.Nat64),matches_length:t.Nat64,items_page:t.Opt(t.Nat64),items:t.Vec(t.Tuple(t.Text,l)),items_length:t.Nat64}),et=t.Record({updated_at:t.Nat64,created_at:t.Nat64,version:t.Opt(t.Nat64),bn_id:t.Opt(t.Text)}),ot=t.Record({matches_pages:t.Opt(t.Nat64),matches_length:t.Nat64,items_page:t.Opt(t.Nat64),items:t.Vec(t.Tuple(t.Text,d)),items_length:t.Nat64}),at=t.Record({desc:t.Bool}),st=t.Record({start_after:t.Opt(t.Nat),limit:t.Opt(t.Nat)}),j=t.Record({order:t.Opt(at),paginate:t.Opt(st)}),rt=t.Record({proposal_id:t.Nat}),M=t.Record({matches_length:t.Nat64,items:t.Vec(t.Tuple(rt,T)),items_length:t.Nat64}),U=t.Record({include_system:t.Bool}),gt=t.Record({matcher:t.Opt(U)}),Ot=t.Record({matches_length:t.Nat64,items:t.Vec(t.Tuple(t.Text,R)),items_length:t.Nat64}),Rt=t.Record({stable:t.Nat64,heap:t.Nat64}),ht=t.Record({metadata:t.Vec(t.Tuple(t.Text,t.Text)),scope:f,expires_at:t.Opt(t.Nat64)}),ft=t.Record({controller:ht,controllers:t.Vec(t.Principal)}),nt=t.Record({data:t.Vec(t.Nat8),description:t.Opt(t.Text),version:t.Opt(t.Nat64)}),Ft=t.Record({max_capacity:t.Opt(t.Nat32),memory:t.Opt(O),max_size:t.Opt(t.Nat),read:x,version:t.Opt(t.Nat64),mutable_permissions:t.Opt(t.Bool),rate_config:t.Opt(b),write:x,max_changes_per_user:t.Opt(t.Nat32)}),it=t.Record({content:t.Vec(t.Nat8),batch_id:t.Nat,order_id:t.Opt(t.Nat)}),lt=t.Record({chunk_id:t.Nat});return t.Service({commit_asset_upload:t.Func([e],[],[]),commit_proposal:t.Func([o],[t.Null],[]),commit_proposal_asset_upload:t.Func([e],[],[]),count_assets:t.Func([t.Text,i],[t.Nat64],["query"]),count_collection_assets:t.Func([t.Text],[t.Nat64],["query"]),count_collection_docs:t.Func([t.Text],[t.Nat64],["query"]),count_docs:t.Func([t.Text,i],[t.Nat64],["query"]),count_proposals:t.Func([],[t.Nat64],["query"]),del_asset:t.Func([t.Text,t.Text],[],[]),del_assets:t.Func([t.Text],[],[]),del_controllers:t.Func([K],[t.Vec(t.Tuple(t.Principal,y))],[]),del_custom_domain:t.Func([t.Text],[],[]),del_doc:t.Func([t.Text,t.Text,m],[],[]),del_docs:t.Func([t.Text],[],[]),del_filtered_assets:t.Func([t.Text,i],[],[]),del_filtered_docs:t.Func([t.Text,i],[],[]),del_many_assets:t.Func([t.Vec(t.Tuple(t.Text,t.Text))],[],[]),del_many_docs:t.Func([t.Vec(t.Tuple(t.Text,t.Text,m))],[],[]),del_rule:t.Func([_,t.Text,F],[],[]),delete_proposal_assets:t.Func([W],[],[]),deposit_cycles:t.Func([G],[],[]),get_asset:t.Func([t.Text,t.Text],[t.Opt(l)],["query"]),get_auth_config:t.Func([],[t.Opt(g)],["query"]),get_config:t.Func([],[V],[]),get_db_config:t.Func([],[t.Opt(p)],["query"]),get_doc:t.Func([t.Text,t.Text],[t.Opt(d)],["query"]),get_many_assets:t.Func([t.Vec(t.Tuple(t.Text,t.Text))],[t.Vec(t.Tuple(t.Text,t.Opt(l)))],["query"]),get_many_docs:t.Func([t.Vec(t.Tuple(t.Text,t.Text))],[t.Vec(t.Tuple(t.Text,t.Opt(d)))],["query"]),get_proposal:t.Func([t.Nat],[t.Opt(T)],["query"]),get_rule:t.Func([_,t.Text],[t.Opt(R)],["query"]),get_storage_config:t.Func([],[N],["query"]),http_request:t.Func([k],[L],["query"]),http_request_streaming_callback:t.Func([h],[D],["query"]),init_asset_upload:t.Func([q],[v],[]),init_proposal:t.Func([S],[t.Nat,T],[]),init_proposal_asset_upload:t.Func([q,t.Nat],[v],[]),list_assets:t.Func([t.Text,i],[tt],["query"]),list_controllers:t.Func([],[t.Vec(t.Tuple(t.Principal,y))],["query"]),list_custom_domains:t.Func([],[t.Vec(t.Tuple(t.Text,et))],["query"]),list_docs:t.Func([t.Text,i],[ot],["query"]),list_proposals:t.Func([j],[M],["query"]),list_rules:t.Func([_,gt],[Ot],["query"]),memory_size:t.Func([],[Rt],["query"]),reject_proposal:t.Func([o],[t.Null],[]),set_auth_config:t.Func([g],[],[]),set_controllers:t.Func([ft],[t.Vec(t.Tuple(t.Principal,y))],[]),set_custom_domain:t.Func([t.Text,t.Opt(t.Text)],[],[]),set_db_config:t.Func([p],[],[]),set_doc:t.Func([t.Text,t.Text,nt],[d],[]),set_many_docs:t.Func([t.Vec(t.Tuple(t.Text,t.Text,nt))],[t.Vec(t.Tuple(t.Text,d))],[]),set_rule:t.Func([_,t.Text,Ft],[R],[]),set_storage_config:t.Func([N],[],[]),submit_proposal:t.Func([t.Nat],[t.Nat,T],[]),upload_asset_chunk:t.Func([it],[lt],[]),upload_proposal_asset_chunk:t.Func([it],[lt],[])})};import{Actor as Ct,HttpAgent as At}from"@dfinity/agent";import{nonNullish as Vt}from"@dfinity/utils";var ut=async({canisterId:t,idlFactory:e,config:o,...a})=>{let s=await B(a);return Ct.createActor(e,{agent:s,canisterId:t,...o??{}})},B=async({agent:t,...e})=>t??await wt(e),wt=async({identity:t,container:e})=>{let o=Vt(e)&&e!==!1,a=o?e===!0?"http://127.0.0.1:5987":e:"https://icp-api.io";return await At.create({identity:t,host:a,retryTimes:10,shouldFetchRootKey:o})};var c=t=>"satellite"in t?kt(t.satellite):bt(t.console),bt=({consoleId:t,...e})=>mt({canisterId:t,...e,idlFactory:pt}),kt=({satelliteId:t,...e})=>mt({canisterId:t,...e,idlFactory:dt}),mt=({canisterId:t,idlFactory:e,...o})=>(St(t,"No canister ID provided."),ut({canisterId:t,idlFactory:e,...o}));var Zt=async({cdn:t,proposalType:e})=>{let{init_proposal:o}=await c(t);return o(e)},$t=async({cdn:t,proposalId:e})=>{let{submit_proposal:o}=await c(t);return o(e)},_t=async({cdn:t,proposal:e})=>{let{reject_proposal:o}=await c(t);await o(e)},Nt=async({cdn:t,proposal:e})=>{let{commit_proposal:o}=await c(t);await o(e)},z=async({cdn:t,proposalIds:e})=>{let{delete_proposal_assets:o}=await c(t);await o({proposal_ids:e})},It=async({cdn:t})=>{let{count_proposals:e}=await c(t);return e()},Lt=async({cdn:t,filter:e})=>{let{list_proposals:o}=await c(t);return o(e)},Dt=async({cdn:t,proposalId:e})=>{let{get_proposal:o}=await c(t);return o(e)};import{uploadAssetWithProposal as qt}from"@junobuild/storage";var ae=async({cdn:t,proposalId:e,asset:o})=>{let a=await c(t);await qt({actor:a,asset:o,proposalId:e})};import{nonNullish as Mt}from"@dfinity/utils";import{ICManagementCanister as Tt}from"@dfinity/ic-management";import{Principal as H}from"@dfinity/principal";var vt=async({actor:t,canisterId:e})=>{let o=await B(t),{listCanisterSnapshots:a}=Tt.create({agent:o});return a({canisterId:e})},jt=async({actor:t,...e})=>{let o=await B(t),{takeCanisterSnapshot:a}=Tt.create({agent:o});return a(e)},xt=async({cdn:t})=>{let o=(()=>{if("satellite"in t){let{satellite:{satelliteId:n,...u}}=t;return{canisterId:n instanceof H?n:H.fromText(n),actor:u}}let{console:{consoleId:s,...r}}=t;return{canisterId:s instanceof H?s:H.fromText(s),actor:r}})(),a=await vt(o);await jt({...o,snapshotId:a?.[0]?.id})};var yt=(s=>(s[s.TakingSnapshot=0]="TakingSnapshot",s[s.CommittingProposal=1]="CommittingProposal",s[s.ClearingProposalAssets=2]="ClearingProposalAssets",s[s.PostApply=3]="PostApply",s))(yt||{}),Pt=(a=>(a[a.RejectingProposal=0]="RejectingProposal",a[a.ClearingProposalAssets=1]="ClearingProposalAssets",a[a.PostReject=2]="PostReject",a))(Pt||{});var _e=async({takeSnapshot:t=!1,clearProposalAssets:e=!1,onProgress:o,cdn:a,proposal:s,postApply:r})=>{try{await E({fn:async()=>t?await xt({cdn:a}):Promise.resolve(),onProgress:o,step:0}),await E({fn:async()=>await Nt({cdn:a,proposal:s}),onProgress:o,step:1}),await E({fn:async()=>e?await z({cdn:a,proposalIds:[s.proposal_id]}):Promise.resolve(),onProgress:o,step:2})}finally{await E({fn:async()=>Mt(r)?await r():Promise.resolve(),onProgress:o,step:3})}},E=async({fn:t,step:e,onProgress:o})=>{o?.({step:e,state:"in_progress"});try{await t(),o?.({step:e,state:"success"})}catch(a){throw o?.({step:e,state:"error"}),a}};import{nonNullish as Ut}from"@dfinity/utils";var Pe=async({clearProposalAssets:t=!1,onProgress:e,cdn:o,proposal:a,postReject:s})=>{try{await ct({fn:async()=>await _t({cdn:o,proposal:a}),onProgress:e,step:0}),await ct({fn:async()=>t?await z({cdn:o,proposalIds:[a.proposal_id]}):Promise.resolve(),onProgress:e,step:1})}finally{await ct({fn:async()=>Ut(s)?await s():Promise.resolve(),onProgress:e,step:2})}},ct=async({fn:t,step:e,onProgress:o})=>{o?.({step:e,state:"in_progress"});try{await t(),o?.({step:e,state:"success"})}catch(a){throw o?.({step:e,state:"error"}),a}};export{yt as ApplyProposalProgressStep,Pt as RejectProposalProgressStep,Nt as commitProposal,It as countProposals,z as deleteProposalAssets,_e as executeApplyProposal,Pe as executeRejectProposal,Dt as getProposal,Zt as initProposal,Lt as listProposals,_t as rejectProposal,$t as submitProposal,ae as uploadAssetWithProposal};
|
|
3
|
+
import{assertNonNullish as vt}from"@dfinity/utils";var dt=({IDL:t})=>{let e=t.Record({e8s:t.Nat64}),o=t.Record({mission_control_id:t.Principal,user:t.Principal}),a=t.Record({batch_id:t.Nat,headers:t.Vec(t.Tuple(t.Text,t.Text)),chunk_ids:t.Vec(t.Nat)}),s=t.Record({sha256:t.Vec(t.Nat8),proposal_id:t.Nat}),r=t.Record({block_index:t.Opt(t.Nat64),subnet_id:t.Opt(t.Principal),user:t.Principal}),n=t.Record({controllers:t.Vec(t.Principal)}),u=t.Record({proposal_ids:t.Vec(t.Nat)}),i=t.Variant({Deny:t.Null,AllowAny:t.Null,SameOrigin:t.Null}),V=t.Record({stable:t.Opt(t.Nat64),heap:t.Opt(t.Nat64)}),g=t.Variant({Deny:t.Null,Allow:t.Null}),m=t.Record({status_code:t.Nat16,location:t.Text}),_=t.Record({iframe:t.Opt(i),updated_at:t.Opt(t.Nat64),rewrites:t.Vec(t.Tuple(t.Text,t.Text)),headers:t.Vec(t.Tuple(t.Text,t.Vec(t.Tuple(t.Text,t.Text)))),created_at:t.Opt(t.Nat64),version:t.Opt(t.Nat64),max_memory_size:t.Opt(V),raw_access:t.Opt(g),redirects:t.Opt(t.Vec(t.Tuple(t.Text,m)))}),N=t.Record({storage:_}),A=t.Record({user:t.Principal}),J=t.Variant({Initialized:t.Null,Failed:t.Null,Open:t.Null,Rejected:t.Null,Executed:t.Null,Accepted:t.Null}),Q=t.Record({clear_existing_assets:t.Opt(t.Bool)}),X=t.Record({orbiter:t.Opt(t.Text),mission_control_version:t.Opt(t.Text),satellite_version:t.Opt(t.Text)}),w=t.Variant({AssetsUpgrade:Q,SegmentsDeployment:X}),p=t.Record({status:J,updated_at:t.Nat64,sha256:t.Opt(t.Vec(t.Nat8)),executed_at:t.Opt(t.Nat64),owner:t.Principal,created_at:t.Nat64,version:t.Opt(t.Nat64),proposal_type:w}),T=t.Record({updated_at:t.Nat64,credits:e,mission_control_id:t.Opt(t.Principal),owner:t.Principal,created_at:t.Nat64}),S=t.Record({url:t.Text,method:t.Text,body:t.Vec(t.Nat8),headers:t.Vec(t.Tuple(t.Text,t.Text)),certificate_version:t.Opt(t.Nat16)}),R=t.Variant({Heap:t.Null,Stable:t.Null}),l=t.Record({memory:R,token:t.Opt(t.Text),sha256:t.Opt(t.Vec(t.Nat8)),headers:t.Vec(t.Tuple(t.Text,t.Text)),index:t.Nat64,encoding_type:t.Text,full_path:t.Text}),h=t.Variant({Callback:t.Record({token:l,callback:t.Func([],[],["query"])})}),b=t.Record({body:t.Vec(t.Nat8),headers:t.Vec(t.Tuple(t.Text,t.Text)),streaming_strategy:t.Opt(h),status_code:t.Nat16}),k=t.Record({token:t.Opt(l),body:t.Vec(t.Nat8)}),f=t.Record({token:t.Opt(t.Text),collection:t.Text,name:t.Text,description:t.Opt(t.Text),encoding_type:t.Opt(t.Text),full_path:t.Text}),x=t.Record({batch_id:t.Nat}),Y=t.Variant({UpdatedAt:t.Null,Keys:t.Null,CreatedAt:t.Null}),d=t.Record({field:Y,desc:t.Bool}),q=t.Variant({Equal:t.Nat64,Between:t.Tuple(t.Nat64,t.Nat64),GreaterThan:t.Nat64,LessThan:t.Nat64}),Z=t.Record({key:t.Opt(t.Text),updated_at:t.Opt(q),description:t.Opt(t.Text),created_at:t.Opt(q)}),$=t.Record({start_after:t.Opt(t.Text),limit:t.Opt(t.Nat64)}),v=t.Record({order:t.Opt(d),owner:t.Opt(t.Principal),matcher:t.Opt(Z),paginate:t.Opt($)}),y=t.Record({token:t.Opt(t.Text),collection:t.Text,owner:t.Principal,name:t.Text,description:t.Opt(t.Text),full_path:t.Text}),F=t.Record({modified:t.Nat64,sha256:t.Vec(t.Nat8),total_length:t.Nat}),P=t.Record({key:y,updated_at:t.Nat64,encodings:t.Vec(t.Tuple(t.Text,F)),headers:t.Vec(t.Tuple(t.Text,t.Text)),created_at:t.Nat64,version:t.Opt(t.Nat64)}),j=t.Record({matches_pages:t.Opt(t.Nat64),matches_length:t.Nat64,items_page:t.Opt(t.Nat64),items:t.Vec(t.Tuple(t.Text,P)),items_length:t.Nat64}),O=t.Variant({Write:t.Null,Admin:t.Null,Submit:t.Null}),I=t.Record({updated_at:t.Nat64,metadata:t.Vec(t.Tuple(t.Text,t.Text)),created_at:t.Nat64,scope:O,expires_at:t.Opt(t.Nat64)}),C=t.Record({updated_at:t.Nat64,created_at:t.Nat64,version:t.Opt(t.Nat64),bn_id:t.Opt(t.Text)}),L=t.Variant({Refunded:t.Null,Acknowledged:t.Null,Completed:t.Null}),D=t.Record({status:L,updated_at:t.Nat64,block_index_payment:t.Nat64,mission_control_id:t.Opt(t.Principal),created_at:t.Nat64,block_index_refunded:t.Opt(t.Nat64)}),tt=t.Record({desc:t.Bool}),M=t.Record({start_after:t.Opt(t.Nat),limit:t.Opt(t.Nat)}),z=t.Record({order:t.Opt(tt),paginate:t.Opt(M)}),et=t.Record({proposal_id:t.Nat}),ot=t.Record({matches_length:t.Nat64,items:t.Vec(t.Tuple(et,p)),items_length:t.Nat64}),at=t.Record({metadata:t.Vec(t.Tuple(t.Text,t.Text)),scope:O,expires_at:t.Opt(t.Nat64)}),st=t.Record({controller:at,controllers:t.Vec(t.Principal)}),U=t.Variant({Orbiter:t.Null,MissionControl:t.Null,Satellite:t.Null}),rt=t.Record({iframe:t.Opt(i),rewrites:t.Vec(t.Tuple(t.Text,t.Text)),headers:t.Vec(t.Tuple(t.Text,t.Vec(t.Tuple(t.Text,t.Text)))),version:t.Opt(t.Nat64),max_memory_size:t.Opt(V),raw_access:t.Opt(g),redirects:t.Opt(t.Vec(t.Tuple(t.Text,m)))}),ct=t.Record({max_tokens:t.Nat64,time_per_token_ns:t.Nat64}),B=t.Record({content:t.Vec(t.Nat8),batch_id:t.Nat,order_id:t.Opt(t.Nat)}),H=t.Record({chunk_id:t.Nat});return t.Service({add_credits:t.Func([t.Principal,e],[],[]),add_invitation_code:t.Func([t.Text],[],[]),assert_mission_control_center:t.Func([o],[],["query"]),commit_asset_upload:t.Func([a],[],[]),commit_proposal:t.Func([s],[t.Null],[]),commit_proposal_asset_upload:t.Func([a],[],[]),count_proposals:t.Func([],[t.Nat64],["query"]),create_orbiter:t.Func([r],[t.Principal],[]),create_satellite:t.Func([r],[t.Principal],[]),del_controllers:t.Func([n],[],[]),del_custom_domain:t.Func([t.Text],[],[]),delete_proposal_assets:t.Func([u],[],[]),get_config:t.Func([],[N],["query"]),get_create_orbiter_fee:t.Func([A],[t.Opt(e)],["query"]),get_create_satellite_fee:t.Func([A],[t.Opt(e)],["query"]),get_credits:t.Func([],[e],["query"]),get_proposal:t.Func([t.Nat],[t.Opt(p)],["query"]),get_storage_config:t.Func([],[_],["query"]),get_user_mission_control_center:t.Func([],[t.Opt(T)],["query"]),http_request:t.Func([S],[b],["query"]),http_request_streaming_callback:t.Func([l],[k],["query"]),init_asset_upload:t.Func([f,t.Nat],[x],[]),init_proposal:t.Func([w],[t.Nat,p],[]),init_proposal_asset_upload:t.Func([f,t.Nat],[x],[]),init_user_mission_control_center:t.Func([],[T],[]),list_assets:t.Func([t.Text,v],[j],["query"]),list_controllers:t.Func([],[t.Vec(t.Tuple(t.Principal,I))],["query"]),list_custom_domains:t.Func([],[t.Vec(t.Tuple(t.Text,C))],["query"]),list_payments:t.Func([],[t.Vec(t.Tuple(t.Nat64,D))],["query"]),list_proposals:t.Func([z],[ot],["query"]),list_user_mission_control_centers:t.Func([],[t.Vec(t.Tuple(t.Principal,T))],["query"]),reject_proposal:t.Func([s],[t.Null],[]),set_controllers:t.Func([st],[],[]),set_custom_domain:t.Func([t.Text,t.Opt(t.Text)],[],[]),set_fee:t.Func([U,e],[],[]),set_storage_config:t.Func([rt],[_],[]),submit_proposal:t.Func([t.Nat],[t.Nat,p],[]),update_rate_config:t.Func([U,ct],[],[]),upload_asset_chunk:t.Func([B],[H],[]),upload_proposal_asset_chunk:t.Func([B],[H],[])})};var ut=({IDL:t})=>{let e=t.Record({batch_id:t.Nat,headers:t.Vec(t.Tuple(t.Text,t.Text)),chunk_ids:t.Vec(t.Nat)}),o=t.Record({sha256:t.Vec(t.Nat8),proposal_id:t.Nat}),a=t.Variant({UpdatedAt:t.Null,Keys:t.Null,CreatedAt:t.Null}),s=t.Record({field:a,desc:t.Bool}),r=t.Variant({Equal:t.Nat64,Between:t.Tuple(t.Nat64,t.Nat64),GreaterThan:t.Nat64,LessThan:t.Nat64}),n=t.Record({key:t.Opt(t.Text),updated_at:t.Opt(r),description:t.Opt(t.Text),created_at:t.Opt(r)}),u=t.Record({start_after:t.Opt(t.Text),limit:t.Opt(t.Nat64)}),i=t.Record({order:t.Opt(s),owner:t.Opt(t.Principal),matcher:t.Opt(n),paginate:t.Opt(u)}),V=t.Record({controllers:t.Vec(t.Principal)}),g=t.Variant({Write:t.Null,Admin:t.Null,Submit:t.Null}),m=t.Record({updated_at:t.Nat64,metadata:t.Vec(t.Tuple(t.Text,t.Text)),created_at:t.Nat64,scope:g,expires_at:t.Opt(t.Nat64)}),_=t.Record({version:t.Opt(t.Nat64)}),N=t.Variant({Db:t.Null,Storage:t.Null}),A=t.Record({version:t.Opt(t.Nat64)}),J=t.Record({proposal_ids:t.Vec(t.Nat)}),Q=t.Record({cycles:t.Nat,destination_id:t.Principal}),X=t.Record({token:t.Opt(t.Text),collection:t.Text,owner:t.Principal,name:t.Text,description:t.Opt(t.Text),full_path:t.Text}),w=t.Record({modified:t.Nat64,sha256:t.Vec(t.Nat8),total_length:t.Nat}),p=t.Record({key:X,updated_at:t.Nat64,encodings:t.Vec(t.Tuple(t.Text,w)),headers:t.Vec(t.Tuple(t.Text,t.Text)),created_at:t.Nat64,version:t.Opt(t.Nat64)}),T=t.Record({derivation_origin:t.Opt(t.Text),external_alternative_origins:t.Opt(t.Vec(t.Text))}),S=t.Record({allowed_callers:t.Vec(t.Principal)}),R=t.Record({updated_at:t.Opt(t.Nat64),created_at:t.Opt(t.Nat64),version:t.Opt(t.Nat64),internet_identity:t.Opt(T),rules:t.Opt(S)}),l=t.Record({stable:t.Opt(t.Nat64),heap:t.Opt(t.Nat64)}),h=t.Record({updated_at:t.Opt(t.Nat64),created_at:t.Opt(t.Nat64),version:t.Opt(t.Nat64),max_memory_size:t.Opt(l)}),b=t.Variant({Deny:t.Null,AllowAny:t.Null,SameOrigin:t.Null}),k=t.Variant({Deny:t.Null,Allow:t.Null}),f=t.Record({status_code:t.Nat16,location:t.Text}),x=t.Record({iframe:t.Opt(b),updated_at:t.Opt(t.Nat64),rewrites:t.Vec(t.Tuple(t.Text,t.Text)),headers:t.Vec(t.Tuple(t.Text,t.Vec(t.Tuple(t.Text,t.Text)))),created_at:t.Opt(t.Nat64),version:t.Opt(t.Nat64),max_memory_size:t.Opt(l),raw_access:t.Opt(k),redirects:t.Opt(t.Vec(t.Tuple(t.Text,f)))}),Y=t.Record({db:t.Opt(h),authentication:t.Opt(R),storage:x}),d=t.Record({updated_at:t.Nat64,owner:t.Principal,data:t.Vec(t.Nat8),description:t.Opt(t.Text),created_at:t.Nat64,version:t.Opt(t.Nat64)}),q=t.Variant({Initialized:t.Null,Failed:t.Null,Open:t.Null,Rejected:t.Null,Executed:t.Null,Accepted:t.Null}),Z=t.Record({clear_existing_assets:t.Opt(t.Bool)}),$=t.Record({orbiter:t.Opt(t.Text),mission_control_version:t.Opt(t.Text),satellite_version:t.Opt(t.Text)}),v=t.Variant({AssetsUpgrade:Z,SegmentsDeployment:$}),y=t.Record({status:q,updated_at:t.Nat64,sha256:t.Opt(t.Vec(t.Nat8)),executed_at:t.Opt(t.Nat64),owner:t.Principal,created_at:t.Nat64,version:t.Opt(t.Nat64),proposal_type:v}),F=t.Variant({Heap:t.Null,Stable:t.Null}),P=t.Variant({Controllers:t.Null,Private:t.Null,Public:t.Null,Managed:t.Null}),j=t.Record({max_tokens:t.Nat64,time_per_token_ns:t.Nat64}),O=t.Record({max_capacity:t.Opt(t.Nat32),memory:t.Opt(F),updated_at:t.Nat64,max_size:t.Opt(t.Nat),read:P,created_at:t.Nat64,version:t.Opt(t.Nat64),mutable_permissions:t.Opt(t.Bool),rate_config:t.Opt(j),write:P,max_changes_per_user:t.Opt(t.Nat32)}),I=t.Record({url:t.Text,method:t.Text,body:t.Vec(t.Nat8),headers:t.Vec(t.Tuple(t.Text,t.Text)),certificate_version:t.Opt(t.Nat16)}),C=t.Record({memory:F,token:t.Opt(t.Text),sha256:t.Opt(t.Vec(t.Nat8)),headers:t.Vec(t.Tuple(t.Text,t.Text)),index:t.Nat64,encoding_type:t.Text,full_path:t.Text}),L=t.Variant({Callback:t.Record({token:C,callback:t.Func([],[],["query"])})}),D=t.Record({body:t.Vec(t.Nat8),headers:t.Vec(t.Tuple(t.Text,t.Text)),streaming_strategy:t.Opt(L),status_code:t.Nat16}),tt=t.Record({token:t.Opt(C),body:t.Vec(t.Nat8)}),M=t.Record({token:t.Opt(t.Text),collection:t.Text,name:t.Text,description:t.Opt(t.Text),encoding_type:t.Opt(t.Text),full_path:t.Text}),z=t.Record({batch_id:t.Nat}),et=t.Record({matches_pages:t.Opt(t.Nat64),matches_length:t.Nat64,items_page:t.Opt(t.Nat64),items:t.Vec(t.Tuple(t.Text,p)),items_length:t.Nat64}),ot=t.Record({updated_at:t.Nat64,created_at:t.Nat64,version:t.Opt(t.Nat64),bn_id:t.Opt(t.Text)}),at=t.Record({matches_pages:t.Opt(t.Nat64),matches_length:t.Nat64,items_page:t.Opt(t.Nat64),items:t.Vec(t.Tuple(t.Text,d)),items_length:t.Nat64}),st=t.Record({desc:t.Bool}),U=t.Record({start_after:t.Opt(t.Nat),limit:t.Opt(t.Nat)}),rt=t.Record({order:t.Opt(st),paginate:t.Opt(U)}),ct=t.Record({proposal_id:t.Nat}),B=t.Record({matches_length:t.Nat64,items:t.Vec(t.Tuple(ct,y)),items_length:t.Nat64}),H=t.Record({include_system:t.Bool}),gt=t.Record({matcher:t.Opt(H)}),Rt=t.Record({matches_length:t.Nat64,items:t.Vec(t.Tuple(t.Text,O)),items_length:t.Nat64}),ht=t.Record({stable:t.Nat64,heap:t.Nat64}),ft=t.Record({version:t.Opt(t.Nat64),internet_identity:t.Opt(T),rules:t.Opt(S)}),Ft=t.Record({metadata:t.Vec(t.Tuple(t.Text,t.Text)),scope:g,expires_at:t.Opt(t.Nat64)}),Ct=t.Record({controller:Ft,controllers:t.Vec(t.Principal)}),Vt=t.Record({version:t.Opt(t.Nat64),max_memory_size:t.Opt(l)}),it=t.Record({data:t.Vec(t.Nat8),description:t.Opt(t.Text),version:t.Opt(t.Nat64)}),At=t.Record({max_capacity:t.Opt(t.Nat32),memory:t.Opt(F),max_size:t.Opt(t.Nat),read:P,version:t.Opt(t.Nat64),mutable_permissions:t.Opt(t.Bool),rate_config:t.Opt(j),write:P,max_changes_per_user:t.Opt(t.Nat32)}),wt=t.Record({iframe:t.Opt(b),rewrites:t.Vec(t.Tuple(t.Text,t.Text)),headers:t.Vec(t.Tuple(t.Text,t.Vec(t.Tuple(t.Text,t.Text)))),version:t.Opt(t.Nat64),max_memory_size:t.Opt(l),raw_access:t.Opt(k),redirects:t.Opt(t.Vec(t.Tuple(t.Text,f)))}),pt=t.Record({content:t.Vec(t.Nat8),batch_id:t.Nat,order_id:t.Opt(t.Nat)}),lt=t.Record({chunk_id:t.Nat});return t.Service({commit_asset_upload:t.Func([e],[],[]),commit_proposal:t.Func([o],[t.Null],[]),commit_proposal_asset_upload:t.Func([e],[],[]),count_assets:t.Func([t.Text,i],[t.Nat64],["query"]),count_collection_assets:t.Func([t.Text],[t.Nat64],["query"]),count_collection_docs:t.Func([t.Text],[t.Nat64],["query"]),count_docs:t.Func([t.Text,i],[t.Nat64],["query"]),count_proposals:t.Func([],[t.Nat64],["query"]),del_asset:t.Func([t.Text,t.Text],[],[]),del_assets:t.Func([t.Text],[],[]),del_controllers:t.Func([V],[t.Vec(t.Tuple(t.Principal,m))],[]),del_custom_domain:t.Func([t.Text],[],[]),del_doc:t.Func([t.Text,t.Text,_],[],[]),del_docs:t.Func([t.Text],[],[]),del_filtered_assets:t.Func([t.Text,i],[],[]),del_filtered_docs:t.Func([t.Text,i],[],[]),del_many_assets:t.Func([t.Vec(t.Tuple(t.Text,t.Text))],[],[]),del_many_docs:t.Func([t.Vec(t.Tuple(t.Text,t.Text,_))],[],[]),del_rule:t.Func([N,t.Text,A],[],[]),delete_proposal_assets:t.Func([J],[],[]),deposit_cycles:t.Func([Q],[],[]),get_asset:t.Func([t.Text,t.Text],[t.Opt(p)],["query"]),get_auth_config:t.Func([],[t.Opt(R)],["query"]),get_config:t.Func([],[Y],[]),get_db_config:t.Func([],[t.Opt(h)],["query"]),get_doc:t.Func([t.Text,t.Text],[t.Opt(d)],["query"]),get_many_assets:t.Func([t.Vec(t.Tuple(t.Text,t.Text))],[t.Vec(t.Tuple(t.Text,t.Opt(p)))],["query"]),get_many_docs:t.Func([t.Vec(t.Tuple(t.Text,t.Text))],[t.Vec(t.Tuple(t.Text,t.Opt(d)))],["query"]),get_proposal:t.Func([t.Nat],[t.Opt(y)],["query"]),get_rule:t.Func([N,t.Text],[t.Opt(O)],["query"]),get_storage_config:t.Func([],[x],["query"]),http_request:t.Func([I],[D],["query"]),http_request_streaming_callback:t.Func([C],[tt],["query"]),init_asset_upload:t.Func([M],[z],[]),init_proposal:t.Func([v],[t.Nat,y],[]),init_proposal_asset_upload:t.Func([M,t.Nat],[z],[]),list_assets:t.Func([t.Text,i],[et],["query"]),list_controllers:t.Func([],[t.Vec(t.Tuple(t.Principal,m))],["query"]),list_custom_domains:t.Func([],[t.Vec(t.Tuple(t.Text,ot))],["query"]),list_docs:t.Func([t.Text,i],[at],["query"]),list_proposals:t.Func([rt],[B],["query"]),list_rules:t.Func([N,gt],[Rt],["query"]),memory_size:t.Func([],[ht],["query"]),reject_proposal:t.Func([o],[t.Null],[]),set_auth_config:t.Func([ft],[R],[]),set_controllers:t.Func([Ct],[t.Vec(t.Tuple(t.Principal,m))],[]),set_custom_domain:t.Func([t.Text,t.Opt(t.Text)],[],[]),set_db_config:t.Func([Vt],[h],[]),set_doc:t.Func([t.Text,t.Text,it],[d],[]),set_many_docs:t.Func([t.Vec(t.Tuple(t.Text,t.Text,it))],[t.Vec(t.Tuple(t.Text,d))],[]),set_rule:t.Func([N,t.Text,At],[O],[]),set_storage_config:t.Func([wt],[x],[]),submit_proposal:t.Func([t.Nat],[t.Nat,y],[]),upload_asset_chunk:t.Func([pt],[lt],[]),upload_proposal_asset_chunk:t.Func([pt],[lt],[])})};import{Actor as St,HttpAgent as bt}from"@dfinity/agent";import{nonNullish as kt}from"@dfinity/utils";var mt=async({canisterId:t,idlFactory:e,config:o,...a})=>{let s=await E(a);return St.createActor(e,{agent:s,canisterId:t,...o??{}})},E=async({agent:t,...e})=>t??await qt(e),qt=async({identity:t,container:e})=>{let o=kt(e)&&e!==!1,a=o?e===!0?"http://127.0.0.1:5987":e:"https://icp-api.io";return await bt.create({identity:t,host:a,retryTimes:10,shouldFetchRootKey:o})};var c=t=>"satellite"in t?Mt(t.satellite):jt(t.console),jt=({consoleId:t,...e})=>_t({canisterId:t,...e,idlFactory:dt}),Mt=({satelliteId:t,...e})=>_t({canisterId:t,...e,idlFactory:ut}),_t=({canisterId:t,idlFactory:e,...o})=>(vt(t,"No canister ID provided."),mt({canisterId:t,idlFactory:e,...o}));var Dt=async({cdn:t,proposalType:e})=>{let{init_proposal:o}=await c(t);return o(e)},te=async({cdn:t,proposalId:e})=>{let{submit_proposal:o}=await c(t);return o(e)},Nt=async({cdn:t,proposal:e})=>{let{reject_proposal:o}=await c(t);await o(e)},Tt=async({cdn:t,proposal:e})=>{let{commit_proposal:o}=await c(t);await o(e)},K=async({cdn:t,proposalIds:e})=>{let{delete_proposal_assets:o}=await c(t);await o({proposal_ids:e})},ee=async({cdn:t})=>{let{count_proposals:e}=await c(t);return e()},oe=async({cdn:t,filter:e})=>{let{list_proposals:o}=await c(t);return o(e)},ae=async({cdn:t,proposalId:e})=>{let{get_proposal:o}=await c(t);return o(e)};import{uploadAssetWithProposal as zt}from"@junobuild/storage";var ne=async({cdn:t,proposalId:e,asset:o})=>{let a=await c(t);await zt({actor:a,asset:o,proposalId:e})};import{nonNullish as Ht}from"@dfinity/utils";import{ICManagementCanister as xt}from"@dfinity/ic-management";import{Principal as W}from"@dfinity/principal";var Ut=async({actor:t,canisterId:e})=>{let o=await E(t),{listCanisterSnapshots:a}=xt.create({agent:o});return a({canisterId:e})},Bt=async({actor:t,...e})=>{let o=await E(t),{takeCanisterSnapshot:a}=xt.create({agent:o});return a(e)},yt=async({cdn:t})=>{let o=(()=>{if("satellite"in t){let{satellite:{satelliteId:n,...u}}=t;return{canisterId:n instanceof W?n:W.fromText(n),actor:u}}let{console:{consoleId:s,...r}}=t;return{canisterId:s instanceof W?s:W.fromText(s),actor:r}})(),a=await Ut(o);await Bt({...o,snapshotId:a?.[0]?.id})};var Pt=(s=>(s[s.TakingSnapshot=0]="TakingSnapshot",s[s.CommittingProposal=1]="CommittingProposal",s[s.ClearingProposalAssets=2]="ClearingProposalAssets",s[s.PostApply=3]="PostApply",s))(Pt||{}),Ot=(a=>(a[a.RejectingProposal=0]="RejectingProposal",a[a.ClearingProposalAssets=1]="ClearingProposalAssets",a[a.PostReject=2]="PostReject",a))(Ot||{});var ye=async({takeSnapshot:t=!1,clearProposalAssets:e=!1,onProgress:o,cdn:a,proposal:s,postApply:r})=>{try{await G({fn:async()=>t?await yt({cdn:a}):Promise.resolve(),onProgress:o,step:0}),await G({fn:async()=>await Tt({cdn:a,proposal:s}),onProgress:o,step:1}),await G({fn:async()=>e?await K({cdn:a,proposalIds:[s.proposal_id]}):Promise.resolve(),onProgress:o,step:2})}finally{await G({fn:async()=>Ht(r)?await r():Promise.resolve(),onProgress:o,step:3})}},G=async({fn:t,step:e,onProgress:o})=>{o?.({step:e,state:"in_progress"});try{await t(),o?.({step:e,state:"success"})}catch(a){throw o?.({step:e,state:"error"}),a}};import{nonNullish as Et}from"@dfinity/utils";var he=async({clearProposalAssets:t=!1,onProgress:e,cdn:o,proposal:a,postReject:s})=>{try{await nt({fn:async()=>await Nt({cdn:o,proposal:a}),onProgress:e,step:0}),await nt({fn:async()=>t?await K({cdn:o,proposalIds:[a.proposal_id]}):Promise.resolve(),onProgress:e,step:1})}finally{await nt({fn:async()=>Et(s)?await s():Promise.resolve(),onProgress:e,step:2})}},nt=async({fn:t,step:e,onProgress:o})=>{o?.({step:e,state:"in_progress"});try{await t(),o?.({step:e,state:"success"})}catch(a){throw o?.({step:e,state:"error"}),a}};export{Pt as ApplyProposalProgressStep,Ot as RejectProposalProgressStep,Tt as commitProposal,ee as countProposals,K as deleteProposalAssets,ye as executeApplyProposal,he as executeRejectProposal,ae as getProposal,Dt as initProposal,oe as listProposals,Nt as rejectProposal,te as submitProposal,ne as uploadAssetWithProposal};
|
|
4
4
|
//# sourceMappingURL=index.mjs.map
|