@junobuild/admin 0.1.6-next-2025-04-01 → 0.1.6-next-2025-04-05
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 +4 -4
- package/dist/declarations/mission_control/mission_control.factory.certified.did.js +247 -0
- package/dist/declarations/orbiter/orbiter.factory.certified.did.js +255 -0
- package/dist/declarations/satellite/satellite.factory.certified.did.js +319 -0
- package/dist/node/index.mjs +1 -1
- package/dist/node/index.mjs.map +4 -4
- package/dist/types/api/ic.api.d.ts +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/services/package.services.d.ts +17 -0
- package/package.json +3 -2
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
export const idlFactory = ({IDL}) => {
|
|
3
|
+
const CommitBatch = IDL.Record({
|
|
4
|
+
batch_id: IDL.Nat,
|
|
5
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
6
|
+
chunk_ids: IDL.Vec(IDL.Nat)
|
|
7
|
+
});
|
|
8
|
+
const ListOrderField = IDL.Variant({
|
|
9
|
+
UpdatedAt: IDL.Null,
|
|
10
|
+
Keys: IDL.Null,
|
|
11
|
+
CreatedAt: IDL.Null
|
|
12
|
+
});
|
|
13
|
+
const ListOrder = IDL.Record({field: ListOrderField, desc: IDL.Bool});
|
|
14
|
+
const TimestampMatcher = IDL.Variant({
|
|
15
|
+
Equal: IDL.Nat64,
|
|
16
|
+
Between: IDL.Tuple(IDL.Nat64, IDL.Nat64),
|
|
17
|
+
GreaterThan: IDL.Nat64,
|
|
18
|
+
LessThan: IDL.Nat64
|
|
19
|
+
});
|
|
20
|
+
const ListMatcher = IDL.Record({
|
|
21
|
+
key: IDL.Opt(IDL.Text),
|
|
22
|
+
updated_at: IDL.Opt(TimestampMatcher),
|
|
23
|
+
description: IDL.Opt(IDL.Text),
|
|
24
|
+
created_at: IDL.Opt(TimestampMatcher)
|
|
25
|
+
});
|
|
26
|
+
const ListPaginate = IDL.Record({
|
|
27
|
+
start_after: IDL.Opt(IDL.Text),
|
|
28
|
+
limit: IDL.Opt(IDL.Nat64)
|
|
29
|
+
});
|
|
30
|
+
const ListParams = IDL.Record({
|
|
31
|
+
order: IDL.Opt(ListOrder),
|
|
32
|
+
owner: IDL.Opt(IDL.Principal),
|
|
33
|
+
matcher: IDL.Opt(ListMatcher),
|
|
34
|
+
paginate: IDL.Opt(ListPaginate)
|
|
35
|
+
});
|
|
36
|
+
const DeleteControllersArgs = IDL.Record({
|
|
37
|
+
controllers: IDL.Vec(IDL.Principal)
|
|
38
|
+
});
|
|
39
|
+
const ControllerScope = IDL.Variant({
|
|
40
|
+
Write: IDL.Null,
|
|
41
|
+
Admin: IDL.Null
|
|
42
|
+
});
|
|
43
|
+
const Controller = IDL.Record({
|
|
44
|
+
updated_at: IDL.Nat64,
|
|
45
|
+
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
46
|
+
created_at: IDL.Nat64,
|
|
47
|
+
scope: ControllerScope,
|
|
48
|
+
expires_at: IDL.Opt(IDL.Nat64)
|
|
49
|
+
});
|
|
50
|
+
const DelDoc = IDL.Record({version: IDL.Opt(IDL.Nat64)});
|
|
51
|
+
const CollectionType = IDL.Variant({Db: IDL.Null, Storage: IDL.Null});
|
|
52
|
+
const DelRule = IDL.Record({version: IDL.Opt(IDL.Nat64)});
|
|
53
|
+
const DepositCyclesArgs = IDL.Record({
|
|
54
|
+
cycles: IDL.Nat,
|
|
55
|
+
destination_id: IDL.Principal
|
|
56
|
+
});
|
|
57
|
+
const AssetKey = IDL.Record({
|
|
58
|
+
token: IDL.Opt(IDL.Text),
|
|
59
|
+
collection: IDL.Text,
|
|
60
|
+
owner: IDL.Principal,
|
|
61
|
+
name: IDL.Text,
|
|
62
|
+
description: IDL.Opt(IDL.Text),
|
|
63
|
+
full_path: IDL.Text
|
|
64
|
+
});
|
|
65
|
+
const AssetEncodingNoContent = IDL.Record({
|
|
66
|
+
modified: IDL.Nat64,
|
|
67
|
+
sha256: IDL.Vec(IDL.Nat8),
|
|
68
|
+
total_length: IDL.Nat
|
|
69
|
+
});
|
|
70
|
+
const AssetNoContent = IDL.Record({
|
|
71
|
+
key: AssetKey,
|
|
72
|
+
updated_at: IDL.Nat64,
|
|
73
|
+
encodings: IDL.Vec(IDL.Tuple(IDL.Text, AssetEncodingNoContent)),
|
|
74
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
75
|
+
created_at: IDL.Nat64,
|
|
76
|
+
version: IDL.Opt(IDL.Nat64)
|
|
77
|
+
});
|
|
78
|
+
const AuthenticationConfigInternetIdentity = IDL.Record({
|
|
79
|
+
derivation_origin: IDL.Opt(IDL.Text),
|
|
80
|
+
external_alternative_origins: IDL.Opt(IDL.Vec(IDL.Text))
|
|
81
|
+
});
|
|
82
|
+
const AuthenticationConfig = IDL.Record({
|
|
83
|
+
internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity)
|
|
84
|
+
});
|
|
85
|
+
const ConfigMaxMemorySize = IDL.Record({
|
|
86
|
+
stable: IDL.Opt(IDL.Nat64),
|
|
87
|
+
heap: IDL.Opt(IDL.Nat64)
|
|
88
|
+
});
|
|
89
|
+
const DbConfig = IDL.Record({
|
|
90
|
+
max_memory_size: IDL.Opt(ConfigMaxMemorySize)
|
|
91
|
+
});
|
|
92
|
+
const StorageConfigIFrame = IDL.Variant({
|
|
93
|
+
Deny: IDL.Null,
|
|
94
|
+
AllowAny: IDL.Null,
|
|
95
|
+
SameOrigin: IDL.Null
|
|
96
|
+
});
|
|
97
|
+
const StorageConfigRawAccess = IDL.Variant({
|
|
98
|
+
Deny: IDL.Null,
|
|
99
|
+
Allow: IDL.Null
|
|
100
|
+
});
|
|
101
|
+
const StorageConfigRedirect = IDL.Record({
|
|
102
|
+
status_code: IDL.Nat16,
|
|
103
|
+
location: IDL.Text
|
|
104
|
+
});
|
|
105
|
+
const StorageConfig = IDL.Record({
|
|
106
|
+
iframe: IDL.Opt(StorageConfigIFrame),
|
|
107
|
+
rewrites: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
108
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)))),
|
|
109
|
+
max_memory_size: IDL.Opt(ConfigMaxMemorySize),
|
|
110
|
+
raw_access: IDL.Opt(StorageConfigRawAccess),
|
|
111
|
+
redirects: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, StorageConfigRedirect)))
|
|
112
|
+
});
|
|
113
|
+
const Config = IDL.Record({
|
|
114
|
+
db: IDL.Opt(DbConfig),
|
|
115
|
+
authentication: IDL.Opt(AuthenticationConfig),
|
|
116
|
+
storage: StorageConfig
|
|
117
|
+
});
|
|
118
|
+
const Doc = IDL.Record({
|
|
119
|
+
updated_at: IDL.Nat64,
|
|
120
|
+
owner: IDL.Principal,
|
|
121
|
+
data: IDL.Vec(IDL.Nat8),
|
|
122
|
+
description: IDL.Opt(IDL.Text),
|
|
123
|
+
created_at: IDL.Nat64,
|
|
124
|
+
version: IDL.Opt(IDL.Nat64)
|
|
125
|
+
});
|
|
126
|
+
const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});
|
|
127
|
+
const Permission = IDL.Variant({
|
|
128
|
+
Controllers: IDL.Null,
|
|
129
|
+
Private: IDL.Null,
|
|
130
|
+
Public: IDL.Null,
|
|
131
|
+
Managed: IDL.Null
|
|
132
|
+
});
|
|
133
|
+
const RateConfig = IDL.Record({
|
|
134
|
+
max_tokens: IDL.Nat64,
|
|
135
|
+
time_per_token_ns: IDL.Nat64
|
|
136
|
+
});
|
|
137
|
+
const Rule = IDL.Record({
|
|
138
|
+
max_capacity: IDL.Opt(IDL.Nat32),
|
|
139
|
+
memory: IDL.Opt(Memory),
|
|
140
|
+
updated_at: IDL.Nat64,
|
|
141
|
+
max_size: IDL.Opt(IDL.Nat),
|
|
142
|
+
read: Permission,
|
|
143
|
+
created_at: IDL.Nat64,
|
|
144
|
+
version: IDL.Opt(IDL.Nat64),
|
|
145
|
+
mutable_permissions: IDL.Opt(IDL.Bool),
|
|
146
|
+
rate_config: IDL.Opt(RateConfig),
|
|
147
|
+
write: Permission,
|
|
148
|
+
max_changes_per_user: IDL.Opt(IDL.Nat32)
|
|
149
|
+
});
|
|
150
|
+
const HttpRequest = IDL.Record({
|
|
151
|
+
url: IDL.Text,
|
|
152
|
+
method: IDL.Text,
|
|
153
|
+
body: IDL.Vec(IDL.Nat8),
|
|
154
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
155
|
+
certificate_version: IDL.Opt(IDL.Nat16)
|
|
156
|
+
});
|
|
157
|
+
const StreamingCallbackToken = IDL.Record({
|
|
158
|
+
memory: Memory,
|
|
159
|
+
token: IDL.Opt(IDL.Text),
|
|
160
|
+
sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
161
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
162
|
+
index: IDL.Nat64,
|
|
163
|
+
encoding_type: IDL.Text,
|
|
164
|
+
full_path: IDL.Text
|
|
165
|
+
});
|
|
166
|
+
const StreamingStrategy = IDL.Variant({
|
|
167
|
+
Callback: IDL.Record({
|
|
168
|
+
token: StreamingCallbackToken,
|
|
169
|
+
callback: IDL.Func([], [], [])
|
|
170
|
+
})
|
|
171
|
+
});
|
|
172
|
+
const HttpResponse = IDL.Record({
|
|
173
|
+
body: IDL.Vec(IDL.Nat8),
|
|
174
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
175
|
+
streaming_strategy: IDL.Opt(StreamingStrategy),
|
|
176
|
+
status_code: IDL.Nat16
|
|
177
|
+
});
|
|
178
|
+
const StreamingCallbackHttpResponse = IDL.Record({
|
|
179
|
+
token: IDL.Opt(StreamingCallbackToken),
|
|
180
|
+
body: IDL.Vec(IDL.Nat8)
|
|
181
|
+
});
|
|
182
|
+
const InitAssetKey = IDL.Record({
|
|
183
|
+
token: IDL.Opt(IDL.Text),
|
|
184
|
+
collection: IDL.Text,
|
|
185
|
+
name: IDL.Text,
|
|
186
|
+
description: IDL.Opt(IDL.Text),
|
|
187
|
+
encoding_type: IDL.Opt(IDL.Text),
|
|
188
|
+
full_path: IDL.Text
|
|
189
|
+
});
|
|
190
|
+
const InitUploadResult = IDL.Record({batch_id: IDL.Nat});
|
|
191
|
+
const ListResults = IDL.Record({
|
|
192
|
+
matches_pages: IDL.Opt(IDL.Nat64),
|
|
193
|
+
matches_length: IDL.Nat64,
|
|
194
|
+
items_page: IDL.Opt(IDL.Nat64),
|
|
195
|
+
items: IDL.Vec(IDL.Tuple(IDL.Text, AssetNoContent)),
|
|
196
|
+
items_length: IDL.Nat64
|
|
197
|
+
});
|
|
198
|
+
const CustomDomain = IDL.Record({
|
|
199
|
+
updated_at: IDL.Nat64,
|
|
200
|
+
created_at: IDL.Nat64,
|
|
201
|
+
version: IDL.Opt(IDL.Nat64),
|
|
202
|
+
bn_id: IDL.Opt(IDL.Text)
|
|
203
|
+
});
|
|
204
|
+
const ListResults_1 = IDL.Record({
|
|
205
|
+
matches_pages: IDL.Opt(IDL.Nat64),
|
|
206
|
+
matches_length: IDL.Nat64,
|
|
207
|
+
items_page: IDL.Opt(IDL.Nat64),
|
|
208
|
+
items: IDL.Vec(IDL.Tuple(IDL.Text, Doc)),
|
|
209
|
+
items_length: IDL.Nat64
|
|
210
|
+
});
|
|
211
|
+
const MemorySize = IDL.Record({stable: IDL.Nat64, heap: IDL.Nat64});
|
|
212
|
+
const SetController = IDL.Record({
|
|
213
|
+
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
214
|
+
scope: ControllerScope,
|
|
215
|
+
expires_at: IDL.Opt(IDL.Nat64)
|
|
216
|
+
});
|
|
217
|
+
const SetControllersArgs = IDL.Record({
|
|
218
|
+
controller: SetController,
|
|
219
|
+
controllers: IDL.Vec(IDL.Principal)
|
|
220
|
+
});
|
|
221
|
+
const SetDoc = IDL.Record({
|
|
222
|
+
data: IDL.Vec(IDL.Nat8),
|
|
223
|
+
description: IDL.Opt(IDL.Text),
|
|
224
|
+
version: IDL.Opt(IDL.Nat64)
|
|
225
|
+
});
|
|
226
|
+
const SetRule = IDL.Record({
|
|
227
|
+
max_capacity: IDL.Opt(IDL.Nat32),
|
|
228
|
+
memory: IDL.Opt(Memory),
|
|
229
|
+
max_size: IDL.Opt(IDL.Nat),
|
|
230
|
+
read: Permission,
|
|
231
|
+
version: IDL.Opt(IDL.Nat64),
|
|
232
|
+
mutable_permissions: IDL.Opt(IDL.Bool),
|
|
233
|
+
rate_config: IDL.Opt(RateConfig),
|
|
234
|
+
write: Permission,
|
|
235
|
+
max_changes_per_user: IDL.Opt(IDL.Nat32)
|
|
236
|
+
});
|
|
237
|
+
const UploadChunk = IDL.Record({
|
|
238
|
+
content: IDL.Vec(IDL.Nat8),
|
|
239
|
+
batch_id: IDL.Nat,
|
|
240
|
+
order_id: IDL.Opt(IDL.Nat)
|
|
241
|
+
});
|
|
242
|
+
const UploadChunkResult = IDL.Record({chunk_id: IDL.Nat});
|
|
243
|
+
return IDL.Service({
|
|
244
|
+
build_version: IDL.Func([], [IDL.Text], []),
|
|
245
|
+
commit_asset_upload: IDL.Func([CommitBatch], [], []),
|
|
246
|
+
count_assets: IDL.Func([IDL.Text, ListParams], [IDL.Nat64], []),
|
|
247
|
+
count_collection_assets: IDL.Func([IDL.Text], [IDL.Nat64], []),
|
|
248
|
+
count_collection_docs: IDL.Func([IDL.Text], [IDL.Nat64], []),
|
|
249
|
+
count_docs: IDL.Func([IDL.Text, ListParams], [IDL.Nat64], []),
|
|
250
|
+
del_asset: IDL.Func([IDL.Text, IDL.Text], [], []),
|
|
251
|
+
del_assets: IDL.Func([IDL.Text], [], []),
|
|
252
|
+
del_controllers: IDL.Func(
|
|
253
|
+
[DeleteControllersArgs],
|
|
254
|
+
[IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],
|
|
255
|
+
[]
|
|
256
|
+
),
|
|
257
|
+
del_custom_domain: IDL.Func([IDL.Text], [], []),
|
|
258
|
+
del_doc: IDL.Func([IDL.Text, IDL.Text, DelDoc], [], []),
|
|
259
|
+
del_docs: IDL.Func([IDL.Text], [], []),
|
|
260
|
+
del_filtered_assets: IDL.Func([IDL.Text, ListParams], [], []),
|
|
261
|
+
del_filtered_docs: IDL.Func([IDL.Text, ListParams], [], []),
|
|
262
|
+
del_many_assets: IDL.Func([IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))], [], []),
|
|
263
|
+
del_many_docs: IDL.Func([IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, DelDoc))], [], []),
|
|
264
|
+
del_rule: IDL.Func([CollectionType, IDL.Text, DelRule], [], []),
|
|
265
|
+
deposit_cycles: IDL.Func([DepositCyclesArgs], [], []),
|
|
266
|
+
get_asset: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(AssetNoContent)], []),
|
|
267
|
+
get_auth_config: IDL.Func([], [IDL.Opt(AuthenticationConfig)], []),
|
|
268
|
+
get_config: IDL.Func([], [Config], []),
|
|
269
|
+
get_db_config: IDL.Func([], [IDL.Opt(DbConfig)], []),
|
|
270
|
+
get_doc: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(Doc)], []),
|
|
271
|
+
get_many_assets: IDL.Func(
|
|
272
|
+
[IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],
|
|
273
|
+
[IDL.Vec(IDL.Tuple(IDL.Text, IDL.Opt(AssetNoContent)))],
|
|
274
|
+
[]
|
|
275
|
+
),
|
|
276
|
+
get_many_docs: IDL.Func(
|
|
277
|
+
[IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],
|
|
278
|
+
[IDL.Vec(IDL.Tuple(IDL.Text, IDL.Opt(Doc)))],
|
|
279
|
+
[]
|
|
280
|
+
),
|
|
281
|
+
get_rule: IDL.Func([CollectionType, IDL.Text], [IDL.Opt(Rule)], []),
|
|
282
|
+
get_storage_config: IDL.Func([], [StorageConfig], []),
|
|
283
|
+
http_request: IDL.Func([HttpRequest], [HttpResponse], []),
|
|
284
|
+
http_request_streaming_callback: IDL.Func(
|
|
285
|
+
[StreamingCallbackToken],
|
|
286
|
+
[StreamingCallbackHttpResponse],
|
|
287
|
+
[]
|
|
288
|
+
),
|
|
289
|
+
init_asset_upload: IDL.Func([InitAssetKey], [InitUploadResult], []),
|
|
290
|
+
list_assets: IDL.Func([IDL.Text, ListParams], [ListResults], []),
|
|
291
|
+
list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))], []),
|
|
292
|
+
list_custom_domains: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, CustomDomain))], []),
|
|
293
|
+
list_docs: IDL.Func([IDL.Text, ListParams], [ListResults_1], []),
|
|
294
|
+
list_rules: IDL.Func([CollectionType], [IDL.Vec(IDL.Tuple(IDL.Text, Rule))], []),
|
|
295
|
+
memory_size: IDL.Func([], [MemorySize], []),
|
|
296
|
+
set_auth_config: IDL.Func([AuthenticationConfig], [], []),
|
|
297
|
+
set_controllers: IDL.Func(
|
|
298
|
+
[SetControllersArgs],
|
|
299
|
+
[IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],
|
|
300
|
+
[]
|
|
301
|
+
),
|
|
302
|
+
set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),
|
|
303
|
+
set_db_config: IDL.Func([DbConfig], [], []),
|
|
304
|
+
set_doc: IDL.Func([IDL.Text, IDL.Text, SetDoc], [Doc], []),
|
|
305
|
+
set_many_docs: IDL.Func(
|
|
306
|
+
[IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, SetDoc))],
|
|
307
|
+
[IDL.Vec(IDL.Tuple(IDL.Text, Doc))],
|
|
308
|
+
[]
|
|
309
|
+
),
|
|
310
|
+
set_rule: IDL.Func([CollectionType, IDL.Text, SetRule], [Rule], []),
|
|
311
|
+
set_storage_config: IDL.Func([StorageConfig], [], []),
|
|
312
|
+
upload_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], []),
|
|
313
|
+
version: IDL.Func([], [IDL.Text], [])
|
|
314
|
+
});
|
|
315
|
+
};
|
|
316
|
+
// @ts-ignore
|
|
317
|
+
export const init = ({IDL}) => {
|
|
318
|
+
return [];
|
|
319
|
+
};
|
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
|
-
var D=class extends Error{constructor(){super("The Wasm code for the upgrade is identical to the code currently installed. No upgrade is necessary.")}};import{isNullish as Ge}from"@dfinity/utils";var gt=({IDL:t})=>{let e=t.Record({fund_cycles:t.Nat,min_cycles:t.Nat}),r=t.Variant({BelowThreshold:e}),o=t.Record({strategy:t.Opt(r),enabled:t.Bool}),s=t.Record({cycles:t.Opt(o)}),a=t.Record({monitoring:t.Opt(s)}),n=t.Record({updated_at:t.Nat64,orbiter_id:t.Principal,metadata:t.Vec(t.Tuple(t.Text,t.Text)),created_at:t.Nat64,settings:t.Opt(a)}),i=t.Record({subnet_id:t.Opt(t.Principal),name:t.Opt(t.Text)}),c=t.Record({updated_at:t.Nat64,metadata:t.Vec(t.Tuple(t.Text,t.Text)),created_at:t.Nat64,satellite_id:t.Principal,settings:t.Opt(a)}),p=t.Record({cycles:t.Nat,destination_id:t.Principal}),u=t.Record({to:t.Opt(t.Text),enabled:t.Bool}),m=t.Record({notification:t.Opt(u),default_strategy:t.Opt(r)}),l=t.Record({cycles:t.Opt(m)}),d=t.Record({monitoring:t.Opt(l)}),g=t.Record({to:t.Opt(t.Nat64),from:t.Opt(t.Nat64),segment_id:t.Principal}),h=t.Record({segment_id:t.Principal,created_at:t.Nat64,nonce:t.Int32}),C=t.Record({timestamp:t.Nat64,amount:t.Nat}),x=t.Record({deposited_cycles:t.Opt(C),cycles:C}),S=t.Record({cycles:t.Opt(x)}),R=t.Record({monitored_ids:t.Vec(t.Principal),running:t.Bool}),V=t.Record({cycles:t.Opt(R)}),O=t.Record({updated_at:t.Nat64,created_at:t.Nat64,monitoring:t.Opt(s)}),q=t.Record({updated_at:t.Nat64,metadata:t.Vec(t.Tuple(t.Text,t.Text)),user:t.Opt(t.Principal),created_at:t.Nat64,config:t.Opt(d)}),f=t.Record({e8s:t.Nat64}),E=t.Record({timestamp_nanos:t.Nat64}),T=t.Record({to:t.Vec(t.Nat8),fee:f,memo:t.Nat64,from_subaccount:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(E),amount:f}),y=t.Variant({TxTooOld:t.Record({allowed_window_nanos:t.Nat64}),BadFee:t.Record({expected_fee:f}),TxDuplicate:t.Record({duplicate_of:t.Nat64}),TxCreatedInFuture:t.Null,InsufficientFunds:t.Record({balance:f})}),P=t.Variant({Ok:t.Nat64,Err:y}),k=t.Record({owner:t.Principal,subaccount:t.Opt(t.Vec(t.Nat8))}),A=t.Record({to:k,fee:t.Opt(t.Nat),memo:t.Opt(t.Vec(t.Nat8)),from_subaccount:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat}),w=t.Variant({GenericError:t.Record({message:t.Text,error_code:t.Nat}),TemporarilyUnavailable:t.Null,BadBurn:t.Record({min_burn_amount:t.Nat}),Duplicate:t.Record({duplicate_of:t.Nat}),BadFee:t.Record({expected_fee:t.Nat}),CreatedInFuture:t.Record({ledger_time:t.Nat64}),TooOld:t.Null,InsufficientFunds:t.Record({balance:t.Nat})}),M=t.Variant({Ok:t.Nat,Err:w}),F=t.Variant({Write:t.Null,Admin:t.Null}),b=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)}),z=t.Record({metadata:t.Vec(t.Tuple(t.Text,t.Text)),scope:F,expires_at:t.Opt(t.Nat64)}),G=t.Record({ids:t.Vec(t.Principal),strategy:r}),j=t.Record({orbiters_strategy:t.Opt(G),mission_control_strategy:t.Opt(r),satellites_strategy:t.Opt(G)}),Z=t.Record({cycles_config:t.Opt(j)}),it=t.Record({satellite_ids:t.Opt(t.Vec(t.Principal)),try_mission_control:t.Opt(t.Bool),orbiter_ids:t.Opt(t.Vec(t.Principal))}),ct=t.Record({cycles_config:t.Opt(it)});return t.Service({add_mission_control_controllers:t.Func([t.Vec(t.Principal)],[],[]),add_satellites_controllers:t.Func([t.Vec(t.Principal),t.Vec(t.Principal)],[],[]),create_orbiter:t.Func([t.Opt(t.Text)],[n],[]),create_orbiter_with_config:t.Func([i],[n],[]),create_satellite:t.Func([t.Text],[c],[]),create_satellite_with_config:t.Func([i],[c],[]),del_mission_control_controllers:t.Func([t.Vec(t.Principal)],[],[]),del_orbiter:t.Func([t.Principal,t.Nat],[],[]),del_orbiters_controllers:t.Func([t.Vec(t.Principal),t.Vec(t.Principal)],[],[]),del_satellite:t.Func([t.Principal,t.Nat],[],[]),del_satellites_controllers:t.Func([t.Vec(t.Principal),t.Vec(t.Principal)],[],[]),deposit_cycles:t.Func([p],[],[]),get_config:t.Func([],[t.Opt(d)],["query"]),get_metadata:t.Func([],[t.Vec(t.Tuple(t.Text,t.Text))],["query"]),get_monitoring_history:t.Func([g],[t.Vec(t.Tuple(h,S))],["query"]),get_monitoring_status:t.Func([],[V],["query"]),get_settings:t.Func([],[t.Opt(O)],["query"]),get_user:t.Func([],[t.Principal],["query"]),get_user_data:t.Func([],[q],["query"]),icp_transfer:t.Func([T],[P],[]),icrc_transfer:t.Func([t.Principal,A],[M],[]),list_mission_control_controllers:t.Func([],[t.Vec(t.Tuple(t.Principal,b))],["query"]),list_orbiters:t.Func([],[t.Vec(t.Tuple(t.Principal,n))],["query"]),list_satellites:t.Func([],[t.Vec(t.Tuple(t.Principal,c))],["query"]),remove_mission_control_controllers:t.Func([t.Vec(t.Principal)],[],[]),remove_satellites_controllers:t.Func([t.Vec(t.Principal),t.Vec(t.Principal)],[],[]),set_config:t.Func([t.Opt(d)],[],[]),set_metadata:t.Func([t.Vec(t.Tuple(t.Text,t.Text))],[],[]),set_mission_control_controllers:t.Func([t.Vec(t.Principal),z],[],[]),set_orbiter:t.Func([t.Principal,t.Opt(t.Text)],[n],[]),set_orbiter_metadata:t.Func([t.Principal,t.Vec(t.Tuple(t.Text,t.Text))],[n],[]),set_orbiters_controllers:t.Func([t.Vec(t.Principal),t.Vec(t.Principal),z],[],[]),set_satellite:t.Func([t.Principal,t.Opt(t.Text)],[c],[]),set_satellite_metadata:t.Func([t.Principal,t.Vec(t.Tuple(t.Text,t.Text))],[c],[]),set_satellites_controllers:t.Func([t.Vec(t.Principal),t.Vec(t.Principal),z],[],[]),start_monitoring:t.Func([],[],[]),stop_monitoring:t.Func([],[],[]),top_up:t.Func([t.Principal,f],[],[]),unset_orbiter:t.Func([t.Principal],[],[]),unset_satellite:t.Func([t.Principal],[],[]),update_and_start_monitoring:t.Func([Z],[],[]),update_and_stop_monitoring:t.Func([ct],[],[]),version:t.Func([],[t.Text],["query"])})};var xt=({IDL:t})=>{let e=t.Record({controllers:t.Vec(t.Principal)}),r=t.Variant({Write:t.Null,Admin:t.Null}),o=t.Record({updated_at:t.Nat64,metadata:t.Vec(t.Tuple(t.Text,t.Text)),created_at:t.Nat64,scope:r,expires_at:t.Opt(t.Nat64)}),s=t.Record({version:t.Opt(t.Nat64)}),a=t.Record({cycles:t.Nat,destination_id:t.Principal}),n=t.Record({to:t.Opt(t.Nat64),from:t.Opt(t.Nat64),satellite_id:t.Opt(t.Principal)}),i=t.Record({key:t.Text,collected_at:t.Nat64}),c=t.Record({inner_height:t.Nat16,inner_width:t.Nat16}),p=t.Record({title:t.Text,updated_at:t.Nat64,referrer:t.Opt(t.Text),time_zone:t.Text,session_id:t.Text,href:t.Text,created_at:t.Nat64,satellite_id:t.Principal,device:c,version:t.Opt(t.Nat64),user_agent:t.Opt(t.Text)}),u=t.Record({safari:t.Float64,opera:t.Float64,others:t.Float64,firefox:t.Float64,chrome:t.Float64}),m=t.Record({desktop:t.Float64,others:t.Float64,mobile:t.Float64}),l=t.Record({browsers:u,devices:m}),d=t.Record({day:t.Nat8,month:t.Nat8,year:t.Int32}),g=t.Record({bounce_rate:t.Float64,average_page_views_per_session:t.Float64,daily_total_page_views:t.Vec(t.Tuple(d,t.Nat32)),total_page_views:t.Nat32,unique_page_views:t.Nat64,unique_sessions:t.Nat64}),h=t.Record({referrers:t.Vec(t.Tuple(t.Text,t.Nat32)),pages:t.Vec(t.Tuple(t.Text,t.Nat32))}),C=t.Variant({Navigate:t.Null,Restore:t.Null,Reload:t.Null,BackForward:t.Null,BackForwardCache:t.Null,Prerender:t.Null}),x=t.Record({id:t.Text,value:t.Float64,navigation_type:t.Opt(C),delta:t.Float64}),S=t.Variant({WebVitalsMetric:x}),R=t.Variant({CLS:t.Null,FCP:t.Null,INP:t.Null,LCP:t.Null,TTFB:t.Null}),V=t.Record({updated_at:t.Nat64,session_id:t.Text,data:S,href:t.Text,metric_name:R,created_at:t.Nat64,satellite_id:t.Principal,version:t.Opt(t.Nat64)}),O=t.Record({cls:t.Opt(t.Float64),fcp:t.Opt(t.Float64),inp:t.Opt(t.Float64),lcp:t.Opt(t.Float64),ttfb:t.Opt(t.Float64)}),q=t.Record({overall:O,pages:t.Vec(t.Tuple(t.Text,O))}),f=t.Record({updated_at:t.Nat64,session_id:t.Text,metadata:t.Opt(t.Vec(t.Tuple(t.Text,t.Text))),name:t.Text,created_at:t.Nat64,satellite_id:t.Principal,version:t.Opt(t.Nat64)}),E=t.Record({total:t.Vec(t.Tuple(t.Text,t.Nat32))}),T=t.Record({performance_metrics:t.Bool,track_events:t.Bool,page_views:t.Bool}),y=t.Record({updated_at:t.Nat64,features:t.Opt(T),created_at:t.Nat64,version:t.Opt(t.Nat64)}),P=t.Record({stable:t.Nat64,heap:t.Nat64}),k=t.Record({metadata:t.Vec(t.Tuple(t.Text,t.Text)),scope:r,expires_at:t.Opt(t.Nat64)}),A=t.Record({controller:k,controllers:t.Vec(t.Principal)}),w=t.Record({title:t.Text,updated_at:t.Opt(t.Nat64),referrer:t.Opt(t.Text),time_zone:t.Text,session_id:t.Text,href:t.Text,satellite_id:t.Principal,device:c,version:t.Opt(t.Nat64),user_agent:t.Opt(t.Text)}),M=t.Variant({Ok:p,Err:t.Text}),F=t.Variant({Ok:t.Null,Err:t.Vec(t.Tuple(i,t.Text))}),b=t.Record({session_id:t.Text,data:S,href:t.Text,metric_name:R,satellite_id:t.Principal,version:t.Opt(t.Nat64),user_agent:t.Opt(t.Text)}),z=t.Variant({Ok:V,Err:t.Text}),G=t.Record({features:t.Opt(T),version:t.Opt(t.Nat64)}),j=t.Record({updated_at:t.Opt(t.Nat64),session_id:t.Text,metadata:t.Opt(t.Vec(t.Tuple(t.Text,t.Text))),name:t.Text,satellite_id:t.Principal,version:t.Opt(t.Nat64),user_agent:t.Opt(t.Text)}),Z=t.Variant({Ok:f,Err:t.Text});return t.Service({del_controllers:t.Func([e],[t.Vec(t.Tuple(t.Principal,o))],[]),del_satellite_config:t.Func([t.Principal,s],[],[]),deposit_cycles:t.Func([a],[],[]),get_page_views:t.Func([n],[t.Vec(t.Tuple(i,p))],["query"]),get_page_views_analytics_clients:t.Func([n],[l],["query"]),get_page_views_analytics_metrics:t.Func([n],[g],["query"]),get_page_views_analytics_top_10:t.Func([n],[h],["query"]),get_performance_metrics:t.Func([n],[t.Vec(t.Tuple(i,V))],["query"]),get_performance_metrics_analytics_web_vitals:t.Func([n],[q],["query"]),get_track_events:t.Func([n],[t.Vec(t.Tuple(i,f))],["query"]),get_track_events_analytics:t.Func([n],[E],["query"]),list_controllers:t.Func([],[t.Vec(t.Tuple(t.Principal,o))],["query"]),list_satellite_configs:t.Func([],[t.Vec(t.Tuple(t.Principal,y))],["query"]),memory_size:t.Func([],[P],["query"]),set_controllers:t.Func([A],[t.Vec(t.Tuple(t.Principal,o))],[]),set_page_view:t.Func([i,w],[M],[]),set_page_views:t.Func([t.Vec(t.Tuple(i,w))],[F],[]),set_performance_metric:t.Func([i,b],[z],[]),set_performance_metrics:t.Func([t.Vec(t.Tuple(i,b))],[F],[]),set_satellite_configs:t.Func([t.Vec(t.Tuple(t.Principal,G))],[t.Vec(t.Tuple(t.Principal,y))],[]),set_track_event:t.Func([i,j],[Z],[]),set_track_events:t.Func([t.Vec(t.Tuple(i,j))],[F],[]),version:t.Func([],[t.Text],["query"])})};var ft=({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)}),r=t.Record({controllers:t.Vec(t.Principal)}),o=t.Record({updated_at:t.Nat64,metadata:t.Vec(t.Tuple(t.Text,t.Text)),created_at:t.Nat64,expires_at:t.Opt(t.Nat64)}),s=t.Record({updated_at:t.Opt(t.Nat64)}),a=t.Record({headers:t.Vec(t.Tuple(t.Text,t.Vec(t.Tuple(t.Text,t.Text))))}),n=t.Record({storage:a}),i=t.Record({updated_at:t.Nat64,owner:t.Principal,data:t.Vec(t.Nat8),created_at:t.Nat64}),c=t.Record({url:t.Text,method:t.Text,body:t.Vec(t.Nat8),headers:t.Vec(t.Tuple(t.Text,t.Text))}),p=t.Record({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}),u=t.Variant({Callback:t.Record({token:p,callback:t.Func([],[],[])})}),m=t.Record({body:t.Vec(t.Nat8),headers:t.Vec(t.Tuple(t.Text,t.Text)),streaming_strategy:t.Opt(u),status_code:t.Nat16}),l=t.Record({token:t.Opt(p),body:t.Vec(t.Nat8)}),d=t.Record({token:t.Opt(t.Text),collection:t.Text,name:t.Text,encoding_type:t.Opt(t.Text),full_path:t.Text}),g=t.Record({batch_id:t.Nat}),h=t.Variant({UpdatedAt:t.Null,Keys:t.Null,CreatedAt:t.Null}),C=t.Record({field:h,desc:t.Bool}),x=t.Record({start_after:t.Opt(t.Text),limit:t.Opt(t.Nat64)}),S=t.Record({order:t.Opt(C),owner:t.Opt(t.Principal),matcher:t.Opt(t.Text),paginate:t.Opt(x)}),R=t.Record({token:t.Opt(t.Text),collection:t.Text,owner:t.Principal,name:t.Text,full_path:t.Text}),V=t.Record({modified:t.Nat64,sha256:t.Vec(t.Nat8),total_length:t.Nat}),O=t.Record({key:R,updated_at:t.Nat64,encodings:t.Vec(t.Tuple(t.Text,V)),headers:t.Vec(t.Tuple(t.Text,t.Text)),created_at:t.Nat64}),q=t.Record({matches_length:t.Nat64,length:t.Nat64,items:t.Vec(t.Tuple(t.Text,O))}),f=t.Record({updated_at:t.Nat64,created_at:t.Nat64,bn_id:t.Opt(t.Text)}),E=t.Record({matches_length:t.Nat64,length:t.Nat64,items:t.Vec(t.Tuple(t.Text,i))}),T=t.Variant({Db:t.Null,Storage:t.Null}),y=t.Variant({Controllers:t.Null,Private:t.Null,Public:t.Null,Managed:t.Null}),P=t.Record({updated_at:t.Nat64,max_size:t.Opt(t.Nat),read:y,created_at:t.Nat64,write:y}),k=t.Record({metadata:t.Vec(t.Tuple(t.Text,t.Text)),expires_at:t.Opt(t.Nat64)}),A=t.Record({controller:k,controllers:t.Vec(t.Principal)}),w=t.Record({updated_at:t.Opt(t.Nat64),data:t.Vec(t.Nat8)}),M=t.Record({updated_at:t.Opt(t.Nat64),max_size:t.Opt(t.Nat),read:y,write:y}),F=t.Record({content:t.Vec(t.Nat8),batch_id:t.Nat}),b=t.Record({chunk_id:t.Nat});return t.Service({commit_asset_upload:t.Func([e],[],[]),del_asset:t.Func([t.Text,t.Text],[],[]),del_assets:t.Func([t.Opt(t.Text)],[],[]),del_controllers:t.Func([r],[t.Vec(t.Tuple(t.Principal,o))],[]),del_custom_domain:t.Func([t.Text],[],[]),del_doc:t.Func([t.Text,t.Text,s],[],[]),get_config:t.Func([],[n],[]),get_doc:t.Func([t.Text,t.Text],[t.Opt(i)],["query"]),http_request:t.Func([c],[m],["query"]),http_request_streaming_callback:t.Func([p],[l],["query"]),init_asset_upload:t.Func([d],[g],[]),list_assets:t.Func([t.Opt(t.Text),S],[q],["query"]),list_controllers:t.Func([],[t.Vec(t.Tuple(t.Principal,o))],["query"]),list_custom_domains:t.Func([],[t.Vec(t.Tuple(t.Text,f))],["query"]),list_docs:t.Func([t.Text,S],[E],["query"]),list_rules:t.Func([T],[t.Vec(t.Tuple(t.Text,P))],["query"]),set_config:t.Func([n],[],[]),set_controllers:t.Func([A],[t.Vec(t.Tuple(t.Principal,o))],[]),set_custom_domain:t.Func([t.Text,t.Opt(t.Text)],[],[]),set_doc:t.Func([t.Text,t.Text,w],[i],[]),set_rule:t.Func([T,t.Text,M],[],[]),upload_asset_chunk:t.Func([F],[b],[]),version:t.Func([],[t.Text],["query"])})};var Tt=({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)}),r=t.Record({controllers:t.Vec(t.Principal)}),o=t.Record({updated_at:t.Nat64,metadata:t.Vec(t.Tuple(t.Text,t.Text)),created_at:t.Nat64,expires_at:t.Opt(t.Nat64)}),s=t.Record({updated_at:t.Opt(t.Nat64)}),a=t.Record({headers:t.Vec(t.Tuple(t.Text,t.Vec(t.Tuple(t.Text,t.Text))))}),n=t.Record({storage:a}),i=t.Record({updated_at:t.Nat64,owner:t.Principal,data:t.Vec(t.Nat8),created_at:t.Nat64}),c=t.Record({url:t.Text,method:t.Text,body:t.Vec(t.Nat8),headers:t.Vec(t.Tuple(t.Text,t.Text))}),p=t.Record({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}),u=t.Variant({Callback:t.Record({token:p,callback:t.Func([],[],[])})}),m=t.Record({body:t.Vec(t.Nat8),headers:t.Vec(t.Tuple(t.Text,t.Text)),streaming_strategy:t.Opt(u),status_code:t.Nat16}),l=t.Record({token:t.Opt(p),body:t.Vec(t.Nat8)}),d=t.Record({token:t.Opt(t.Text),collection:t.Text,name:t.Text,encoding_type:t.Opt(t.Text),full_path:t.Text}),g=t.Record({batch_id:t.Nat}),h=t.Variant({UpdatedAt:t.Null,Keys:t.Null,CreatedAt:t.Null}),C=t.Record({field:h,desc:t.Bool}),x=t.Record({start_after:t.Opt(t.Text),limit:t.Opt(t.Nat64)}),S=t.Record({order:t.Opt(C),matcher:t.Opt(t.Text),paginate:t.Opt(x)}),R=t.Record({token:t.Opt(t.Text),collection:t.Text,owner:t.Principal,name:t.Text,full_path:t.Text}),V=t.Record({modified:t.Nat64,sha256:t.Vec(t.Nat8),total_length:t.Nat}),O=t.Record({key:R,updated_at:t.Nat64,encodings:t.Vec(t.Tuple(t.Text,V)),headers:t.Vec(t.Tuple(t.Text,t.Text)),created_at:t.Nat64}),q=t.Record({matches_length:t.Nat64,length:t.Nat64,items:t.Vec(t.Tuple(t.Text,O))}),f=t.Record({updated_at:t.Nat64,created_at:t.Nat64,bn_id:t.Opt(t.Text)}),E=t.Record({matches_length:t.Nat64,length:t.Nat64,items:t.Vec(t.Tuple(t.Text,i))}),T=t.Variant({Db:t.Null,Storage:t.Null}),y=t.Variant({Controllers:t.Null,Private:t.Null,Public:t.Null,Managed:t.Null}),P=t.Record({updated_at:t.Nat64,max_size:t.Opt(t.Nat),read:y,created_at:t.Nat64,write:y}),k=t.Record({metadata:t.Vec(t.Tuple(t.Text,t.Text)),expires_at:t.Opt(t.Nat64)}),A=t.Record({controller:k,controllers:t.Vec(t.Principal)}),w=t.Record({updated_at:t.Opt(t.Nat64),data:t.Vec(t.Nat8)}),M=t.Record({updated_at:t.Opt(t.Nat64),max_size:t.Opt(t.Nat),read:y,write:y}),F=t.Record({content:t.Vec(t.Nat8),batch_id:t.Nat}),b=t.Record({chunk_id:t.Nat});return t.Service({commit_asset_upload:t.Func([e],[],[]),del_asset:t.Func([t.Text,t.Text],[],[]),del_assets:t.Func([t.Opt(t.Text)],[],[]),del_controllers:t.Func([r],[t.Vec(t.Tuple(t.Principal,o))],[]),del_custom_domain:t.Func([t.Text],[],[]),del_doc:t.Func([t.Text,t.Text,s],[],[]),get_config:t.Func([],[n],[]),get_doc:t.Func([t.Text,t.Text],[t.Opt(i)],["query"]),http_request:t.Func([c],[m],["query"]),http_request_streaming_callback:t.Func([p],[l],["query"]),init_asset_upload:t.Func([d],[g],[]),list_assets:t.Func([t.Opt(t.Text),S],[q],["query"]),list_controllers:t.Func([],[t.Vec(t.Principal)],["query"]),list_custom_domains:t.Func([],[t.Vec(t.Tuple(t.Text,f))],["query"]),list_docs:t.Func([t.Text,S],[E],["query"]),list_rules:t.Func([T],[t.Vec(t.Tuple(t.Text,P))],["query"]),set_config:t.Func([n],[],[]),set_controllers:t.Func([A],[t.Vec(t.Tuple(t.Principal,o))],[]),set_custom_domain:t.Func([t.Text,t.Opt(t.Text)],[],[]),set_doc:t.Func([t.Text,t.Text,w],[i],[]),set_rule:t.Func([T,t.Text,M],[],[]),upload_asset_chunk:t.Func([F],[b],[]),version:t.Func([],[t.Text],["query"])})};var Ct=({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)}),r=t.Variant({UpdatedAt:t.Null,Keys:t.Null,CreatedAt:t.Null}),o=t.Record({field:r,desc:t.Bool}),s=t.Variant({Equal:t.Nat64,Between:t.Tuple(t.Nat64,t.Nat64),GreaterThan:t.Nat64,LessThan:t.Nat64}),a=t.Record({key:t.Opt(t.Text),updated_at:t.Opt(s),description:t.Opt(t.Text),created_at:t.Opt(s)}),n=t.Record({start_after:t.Opt(t.Text),limit:t.Opt(t.Nat64)}),i=t.Record({order:t.Opt(o),owner:t.Opt(t.Principal),matcher:t.Opt(a),paginate:t.Opt(n)}),c=t.Record({controllers:t.Vec(t.Principal)}),p=t.Variant({Write:t.Null,Admin:t.Null}),u=t.Record({updated_at:t.Nat64,metadata:t.Vec(t.Tuple(t.Text,t.Text)),created_at:t.Nat64,scope:p,expires_at:t.Opt(t.Nat64)}),m=t.Record({version:t.Opt(t.Nat64)}),l=t.Variant({Db:t.Null,Storage:t.Null}),d=t.Record({version:t.Opt(t.Nat64)}),g=t.Record({cycles:t.Nat,destination_id:t.Principal}),h=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}),x=t.Record({key:h,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)}),S=t.Record({derivation_origin:t.Opt(t.Text),external_alternative_origins:t.Opt(t.Vec(t.Text))}),R=t.Record({internet_identity:t.Opt(S)}),V=t.Record({stable:t.Opt(t.Nat64),heap:t.Opt(t.Nat64)}),O=t.Record({max_memory_size:t.Opt(V)}),q=t.Variant({Deny:t.Null,AllowAny:t.Null,SameOrigin:t.Null}),f=t.Variant({Deny:t.Null,Allow:t.Null}),E=t.Record({status_code:t.Nat16,location:t.Text}),T=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(V),raw_access:t.Opt(f),redirects:t.Opt(t.Vec(t.Tuple(t.Text,E)))}),y=t.Record({db:t.Opt(O),authentication:t.Opt(R),storage:T}),P=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)}),k=t.Variant({Heap:t.Null,Stable:t.Null}),A=t.Variant({Controllers:t.Null,Private:t.Null,Public:t.Null,Managed:t.Null}),w=t.Record({max_tokens:t.Nat64,time_per_token_ns:t.Nat64}),M=t.Record({max_capacity:t.Opt(t.Nat32),memory:t.Opt(k),updated_at:t.Nat64,max_size:t.Opt(t.Nat),read:A,created_at:t.Nat64,version:t.Opt(t.Nat64),mutable_permissions:t.Opt(t.Bool),rate_config:t.Opt(w),write:A,max_changes_per_user:t.Opt(t.Nat32)}),F=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)}),b=t.Record({memory:k,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}),z=t.Variant({Callback:t.Record({token:b,callback:t.Func([],[],["query"])})}),G=t.Record({body:t.Vec(t.Nat8),headers:t.Vec(t.Tuple(t.Text,t.Text)),streaming_strategy:t.Opt(z),status_code:t.Nat16}),j=t.Record({token:t.Opt(b),body:t.Vec(t.Nat8)}),Z=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}),it=t.Record({batch_id:t.Nat}),ct=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,x)),items_length:t.Nat64}),we=t.Record({updated_at:t.Nat64,created_at:t.Nat64,version:t.Opt(t.Nat64),bn_id:t.Opt(t.Text)}),Me=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}),ve=t.Record({stable:t.Nat64,heap:t.Nat64}),Ue=t.Record({metadata:t.Vec(t.Tuple(t.Text,t.Text)),scope:p,expires_at:t.Opt(t.Nat64)}),qe=t.Record({controller:Ue,controllers:t.Vec(t.Principal)}),yt=t.Record({data:t.Vec(t.Nat8),description:t.Opt(t.Text),version:t.Opt(t.Nat64)}),Ee=t.Record({max_capacity:t.Opt(t.Nat32),memory:t.Opt(k),max_size:t.Opt(t.Nat),read:A,version:t.Opt(t.Nat64),mutable_permissions:t.Opt(t.Bool),rate_config:t.Opt(w),write:A,max_changes_per_user:t.Opt(t.Nat32)}),Be=t.Record({content:t.Vec(t.Nat8),batch_id:t.Nat,order_id:t.Opt(t.Nat)}),ze=t.Record({chunk_id:t.Nat});return t.Service({build_version:t.Func([],[t.Text],["query"]),commit_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"]),del_asset:t.Func([t.Text,t.Text],[],[]),del_assets:t.Func([t.Text],[],[]),del_controllers:t.Func([c],[t.Vec(t.Tuple(t.Principal,u))],[]),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([l,t.Text,d],[],[]),deposit_cycles:t.Func([g],[],[]),get_asset:t.Func([t.Text,t.Text],[t.Opt(x)],["query"]),get_auth_config:t.Func([],[t.Opt(R)],["query"]),get_config:t.Func([],[y],[]),get_db_config:t.Func([],[t.Opt(O)],["query"]),get_doc:t.Func([t.Text,t.Text],[t.Opt(P)],["query"]),get_many_assets:t.Func([t.Vec(t.Tuple(t.Text,t.Text))],[t.Vec(t.Tuple(t.Text,t.Opt(x)))],["query"]),get_many_docs:t.Func([t.Vec(t.Tuple(t.Text,t.Text))],[t.Vec(t.Tuple(t.Text,t.Opt(P)))],["query"]),get_rule:t.Func([l,t.Text],[t.Opt(M)],["query"]),get_storage_config:t.Func([],[T],["query"]),http_request:t.Func([F],[G],["query"]),http_request_streaming_callback:t.Func([b],[j],["query"]),init_asset_upload:t.Func([Z],[it],[]),list_assets:t.Func([t.Text,i],[ct],["query"]),list_controllers:t.Func([],[t.Vec(t.Tuple(t.Principal,u))],["query"]),list_custom_domains:t.Func([],[t.Vec(t.Tuple(t.Text,we))],["query"]),list_docs:t.Func([t.Text,i],[Me],["query"]),list_rules:t.Func([l],[t.Vec(t.Tuple(t.Text,M))],["query"]),memory_size:t.Func([],[ve],["query"]),set_auth_config:t.Func([R],[],[]),set_controllers:t.Func([qe],[t.Vec(t.Tuple(t.Principal,u))],[]),set_custom_domain:t.Func([t.Text,t.Opt(t.Text)],[],[]),set_db_config:t.Func([O],[],[]),set_doc:t.Func([t.Text,t.Text,yt],[P],[]),set_many_docs:t.Func([t.Vec(t.Tuple(t.Text,t.Text,yt))],[t.Vec(t.Tuple(t.Text,P))],[]),set_rule:t.Func([l,t.Text,Ee],[M],[]),set_storage_config:t.Func([T],[],[]),upload_asset_chunk:t.Func([Be],[ze],[]),version:t.Func([],[t.Text],["query"])})};import{Actor as He,HttpAgent as Ke}from"@dfinity/agent";import{nonNullish as Pt}from"@dfinity/utils";var Nt=async({canisterId:t,idlFactory:e,config:r,...o})=>{let s=await N(o);return He.createActor(e,{agent:s,canisterId:t,...r??{}})},N=async({agent:t,...e})=>t??await We(e),We=async({identity:t,fetch:e,container:r})=>{let o=Pt(r)&&r!==!1,s=o?r===!0?"http://127.0.0.1:5987":r:"https://icp-api.io";return await Ke.create({identity:t,host:s,retryTimes:10,...Pt(e)&&{fetch:e},shouldFetchRootKey:o})};var ht=({satelliteId:t,...e})=>J({canisterId:t,...e,idlFactory:Tt}),_=({satelliteId:t,...e})=>J({canisterId:t,...e,idlFactory:Ct}),St=({satelliteId:t,...e})=>J({canisterId:t,...e,idlFactory:ft}),X=({missionControlId:t,...e})=>J({canisterId:t,...e,idlFactory:gt}),I=({orbiterId:t,...e})=>J({canisterId:t,...e,idlFactory:xt}),J=({canisterId:t,idlFactory:e,...r})=>{if(Ge(t))throw new Error("No canister ID provided.");return Nt({canisterId:t,idlFactory:e,...r})};var Rt=async({missionControl:t})=>(await X(t)).version(),Ot=async({missionControl:t})=>(await X(t)).get_user(),At=async({missionControl:t})=>(await X(t)).list_mission_control_controllers(),Ft=async({missionControl:t,satelliteIds:e,controllerIds:r,controller:o})=>(await X(t)).set_satellites_controllers(e,r,o),bt=async({missionControl:t,controllerIds:e,controller:r})=>(await X(t)).set_mission_control_controllers(e,r);import{Principal as je}from"@dfinity/principal";import{nonNullish as Xe,toNullable as Ze}from"@dfinity/utils";var lt=({controllerId:t,profile:e})=>({controllerIds:[je.fromText(t)],controller:Je(e)}),Je=t=>({metadata:Xe(t)&&t!==""?[["profile",t]]:[],expires_at:Ze(void 0),scope:{Admin:null}});var jr=({controllerId:t,profile:e,...r})=>Ft({...r,...lt({controllerId:t,profile:e})}),Xr=({controllerId:t,profile:e,...r})=>bt({...r,...lt({controllerId:t,profile:e})}),Zr=t=>At(t);import{Principal as dr}from"@dfinity/principal";var Q={reinstall:null},H={upgrade:[{skip_pre_upgrade:[!1],wasm_memory_persistence:[{replace:null}]}]};import{fromNullable as sr,isNullish as nr,uint8ArrayToHexString as ir}from"@dfinity/utils";import{CanisterStatus as Qe}from"@dfinity/agent";import{ICManagementCanister as v}from"@dfinity/ic-management";import{Principal as Ye}from"@dfinity/principal";import{assertNonNullish as $e}from"@dfinity/utils";var Vt=async({canisterId:t,actor:e})=>{let r=await N(e),{stopCanister:o}=v.create({agent:r});await o(t)},kt=async({canisterId:t,actor:e})=>{let r=await N(e),{startCanister:o}=v.create({agent:r});await o(t)},wt=async({actor:t,code:e})=>{let r=await N(t),{installCode:o}=v.create({agent:r});return o(e)},Mt=async({actor:t,canisterId:e})=>{let r=await N(t),{storedChunks:o}=v.create({agent:r});return o({canisterId:e})},L=async({actor:t,canisterId:e})=>{let r=await N(t),{clearChunkStore:o}=v.create({agent:r});return o({canisterId:e})},vt=async({actor:t,chunk:e})=>{let r=await N(t),{uploadChunk:o}=v.create({agent:r});return o(e)},Ut=async({actor:t,code:e})=>{let r=await N(t),{installChunkedCode:o}=v.create({agent:r});return o(e)},qt=async({actor:t,canisterId:e})=>{let r=await N(t),{canisterStatus:o}=v.create({agent:r});return o(e)},Et=async({canisterId:t,path:e,...r})=>{$e(t,"A canister ID must be provided to request its status.");let o=await N(r);return(await Qe.request({canisterId:Ye.from(t),agent:o,paths:[{kind:"metadata",key:e,path:e,decodeStrategy:"utf-8"}]})).get(e)},Bt=async({actor:t,canisterId:e})=>{let r=await N(t),{listCanisterSnapshots:o}=v.create({agent:r});return o({canisterId:e})},zt=async({actor:t,...e})=>{let r=await N(t),{takeCanisterSnapshot:o}=v.create({agent:r});return o(e)};var Ht=(a=>(a[a.AssertingExistingCode=0]="AssertingExistingCode",a[a.StoppingCanister=1]="StoppingCanister",a[a.TakingSnapshot=2]="TakingSnapshot",a[a.UpgradingCode=3]="UpgradingCode",a[a.RestartingCanister=4]="RestartingCanister",a))(Ht||{});var Kt=t=>crypto.subtle.digest("SHA-256",t),Wt=t=>Array.from(new Uint8Array(t)).map(r=>r.toString(16).padStart(2,"0")).join(""),Gt=async t=>{let e=await Kt(await t.arrayBuffer());return Wt(e)},tt=async t=>{let e=await Kt(t);return Wt(e)};import{isNullish as Ie,nonNullish as jt,uint8ArrayToHexString as Le}from"@dfinity/utils";var Xt=async({actor:t,canisterId:e,missionControlId:r,wasmModule:o,preClearChunks:s,...a})=>{s&&await L({actor:t,canisterId:e});let n=await tr({wasmModule:o}),{uploadChunks:i,storedChunks:c,preClearChunks:p,postClearChunks:u}=await er({actor:t,wasmChunks:n,canisterId:e,missionControlId:r});p&&await L({actor:t,canisterId:e});let m=[];for await(let l of rr({uploadChunks:i,actor:t,canisterId:e,missionControlId:r}))m=[...m,...l];await Ut({actor:t,code:{...a,chunkHashesList:[...m,...c].sort(({orderId:l},{orderId:d})=>l-d).map(({chunkHash:l})=>l),targetCanisterId:e,storeCanisterId:r,wasmModuleHash:await tt(o)}}),u&&await L({actor:t,canisterId:e})},tr=async({wasmModule:t})=>{let e=new Blob([t]),r=[],o=1e6,s=0;for(let a=0;a<e.size;a+=o){let n=e.slice(a,a+o);r.push({chunk:n,orderId:s,sha256:await Gt(n)}),s++}return r},er=async({canisterId:t,missionControlId:e,actor:r,wasmChunks:o})=>{let s=await Mt({actor:r,canisterId:e??t}),a=s.map(({hash:c})=>({chunkHash:{hash:c},sha256:Le(c)})),{storedChunks:n,uploadChunks:i}=o.reduce(({uploadChunks:c,storedChunks:p},{sha256:u,...m})=>{let l=a.find(({sha256:d})=>d===u);return{uploadChunks:[...c,...jt(l)?[]:[{sha256:u,...m}]],storedChunks:[...p,...jt(l)?[{...m,...l}]:[]]}},{uploadChunks:[],storedChunks:[]});return{uploadChunks:i,storedChunks:n,preClearChunks:s.length>0&&n.length===0,postClearChunks:Ie(e)}};async function*rr({uploadChunks:t,limit:e=12,...r}){for(let o=0;o<t.length;o=o+e){let s=t.slice(o,o+e);yield await Promise.all(s.map(n=>or({uploadChunk:n,...r})))}}var or=async({actor:t,canisterId:e,missionControlId:r,uploadChunk:{chunk:o,...s}})=>({chunkHash:await vt({actor:t,chunk:{canisterId:r??e,chunk:new Uint8Array(await o.arrayBuffer())}}),...s});var Zt=async({actor:t,...e})=>{await wt({actor:t,code:e})};var B=async({wasmModule:t,canisterId:e,actor:r,onProgress:o,takeSnapshot:s=!0,...a})=>{await Y({fn:async()=>await cr({wasmModule:t,canisterId:e,actor:r,...a}),onProgress:o,step:0}),await Y({fn:async()=>await Vt({canisterId:e,actor:r}),onProgress:o,step:1});try{await Y({fn:async()=>s?await pr({canisterId:e,actor:r}):Promise.resolve(),onProgress:o,step:2}),await Y({fn:async()=>await lr({wasmModule:t,canisterId:e,actor:r,...a}),onProgress:o,step:3})}finally{await Y({fn:async()=>await kt({canisterId:e,actor:r}),onProgress:o,step:4})}},Y=async({fn:t,step:e,onProgress:r})=>{r?.({step:e,state:"in_progress"});try{await t(),r?.({step:e,state:"success"})}catch(o){throw r?.({step:e,state:"error"}),o}},cr=async({actor:t,canisterId:e,wasmModule:r,reset:o})=>{if(o===!0)return;let{module_hash:s}=await qt({actor:t,canisterId:e}),a=sr(s);if(nr(a))return;let n=await tt(r),i=ir(a);if(n===i)throw new D},lr=async({wasmModule:t,canisterId:e,actor:r,...o})=>{await((new Blob([t]).size>2e6?"chunked":"single")==="chunked"?Xt:Zt)({wasmModule:t,canisterId:e,actor:r,...o})},pr=async t=>{let e=await Bt(t);await zt({...t,snapshotId:e?.[0]?.id})};import{IDL as K}from"@dfinity/candid";var Jt=t=>K.encode([K.Record({user:K.Principal})],[{user:t}]),et=t=>K.encode([K.Record({controllers:K.Vec(K.Principal)})],[{controllers:t.map(([e,r])=>e)}]);var ko=async({missionControl:t,...e})=>{let r=await Ot({missionControl:t}),{missionControlId:o,...s}=t;if(!o)throw new Error("No mission control principal defined.");let a=Jt(r);await B({actor:s,canisterId:dr.fromText(o),arg:new Uint8Array(a),mode:H,...e})};var vo=t=>Rt(t);var Eo=async t=>{await B(t)};var Qt=async({orbiter:t})=>(await I(t)).version(),rt=async({orbiter:t})=>(await I(t)).list_controllers(),Yt=async({orbiter:t})=>{let{memory_size:e}=await I(t);return e()};var Wo=t=>rt(t);var Xo=t=>Yt(t);import{Principal as mr}from"@dfinity/principal";var Io=async({orbiter:t,reset:e=!1,...r})=>{let{orbiterId:o,...s}=t;if(!o)throw new Error("No orbiter principal defined.");let a=await rt({orbiter:t}),n=et(a);await B({actor:s,canisterId:mr.fromText(o),arg:new Uint8Array(n),mode:e?Q:H,reset:e,...r})};var ea=t=>Qt(t);import{major as $t,minor as Dt,patch as It}from"semver";var aa=({currentVersion:t,selectedVersion:e})=>{let r=$t(t),o=$t(e),s=Dt(t),a=Dt(e),n=It(t),i=It(e);return r<o-1||s<a-1||n<i-1?{canUpgrade:!1}:{canUpgrade:!0}};import{toNullable as ur}from"@dfinity/utils";var Lt=async({config:t,satellite:e})=>{let{set_storage_config:r}=await _(e);return r(t)},te=async({config:t,satellite:e})=>{let{set_db_config:r}=await _(e);return r(t)},ee=async({config:t,satellite:e})=>{let{set_auth_config:r}=await _(e);return r(t)};var re=async({satellite:t})=>{let{get_auth_config:e}=await _(t);return e()},oe=async({satellite:t,type:e})=>(await _(t)).list_rules(e),ae=async({type:t,collection:e,rule:r,satellite:o})=>{let{set_rule:s}=await _(o);return s(t,e,r)},se=async({satellite:t})=>{let{version:e}=await _(t);return e()},ne=async({satellite:t})=>{let{build_version:e}=await _(t);return e()},ie=async({satellite:t})=>(await ht(t)).list_controllers(),ot=async({satellite:t})=>(await St(t)).list_controllers(),at=async({satellite:t})=>(await _(t)).list_controllers(),ce=async({satellite:t})=>{let{list_custom_domains:e}=await _(t);return e()},pt=async({satellite:t,domainName:e,boundaryNodesId:r})=>{let{set_custom_domain:o}=await _(t);await o(e,ur(r))},le=async({satellite:t})=>{let{memory_size:e}=await _(t);return e()},pe=async({collection:t,satellite:e})=>{let{count_collection_docs:r}=await _(e);return r(t)},de=async({collection:t,satellite:e})=>{let{count_collection_assets:r}=await _(e);return r(t)},me=async({collection:t,satellite:e})=>{let{del_docs:r}=await _(e);return r(t)},ue=async({collection:t,satellite:e})=>{let{del_assets:r}=await _(e);return r(t)},_e=async({args:t,satellite:e})=>{let{set_controllers:r}=await _(e);return r(t)};var pa=t=>de(t),da=t=>ue(t);import{fromNullable as st,isNullish as xe,nonNullish as ye,toNullable as ge}from"@dfinity/utils";import{nonNullish as _r,toNullable as dt}from"@dfinity/utils";var mt=t=>dt(_r(t)?{heap:dt(t.heap),stable:dt(t.stable)}:void 0);var fa=async({config:{headers:t,rewrites:e,redirects:r,iframe:o,rawAccess:s,maxMemorySize:a},satellite:n})=>{let i=(t??[]).map(({source:l,headers:d})=>[l,d]),c=(e??[]).map(({source:l,destination:d})=>[l,d]),p=(r??[]).map(({source:l,location:d,code:g})=>[l,{status_code:g,location:d}]);return await Lt({satellite:n,config:{headers:i,rewrites:c,redirects:[p],iframe:[o==="same-origin"?{SameOrigin:null}:o==="allow-any"?{AllowAny:null}:{Deny:null}],raw_access:[s===!0?{Allow:null}:{Deny:null}],max_memory_size:mt(a)}})},Ta=async({config:{maxMemorySize:t},...e})=>{await te({config:{max_memory_size:mt(t)},...e})},Ca=async({config:{internetIdentity:t},...e})=>{await ee({config:{internet_identity:xe(t)?[]:[{derivation_origin:ge(t?.derivationOrigin),external_alternative_origins:ge(t?.externalAlternativeOrigins)}]},...e})},Pa=async({satellite:t})=>{let e=st(await re({satellite:t}));if(xe(e))return;let r=st(e.internet_identity??[]);return{...ye(r)&&{internetIdentity:{...ye(st(r.derivation_origin))&&{derivationOrigin:st(r.derivation_origin)}}}}};var Sa=({deprecatedNoScope:t,...e})=>(t===!0?ot:at)(e),Ra=t=>_e(t);var Fa=t=>pe(t),ba=t=>me(t);import{fromNullable as fe,nonNullish as yr}from"@dfinity/utils";var Ma=async({satellite:t})=>(await ce({satellite:t})).map(([r,o])=>{let s=fe(o.version);return{domain:r,bn_id:fe(o.bn_id),created_at:o.created_at,updated_at:o.updated_at,...yr(s)&&{version:s}}}),va=({satellite:t,domains:e})=>Promise.all(e.map(({domain:r,bn_id:o})=>pt({satellite:t,domainName:r,boundaryNodesId:o}))),Ua=({satellite:t,domain:e})=>pt({satellite:t,domainName:e.domain,boundaryNodesId:e.bn_id});var Ba=t=>le(t);import{fromNullable as W,nonNullish as U,toNullable as $}from"@dfinity/utils";var Te={Db:null},Ce={Storage:null},Pe={Public:null},Ne={Private:null},he={Managed:null},Se={Controllers:null},ut={Heap:null},Re={Stable:null},Oe=600000000n;var _t=t=>t==="storage"?Ce:Te,be=({read:t,write:e,memory:r,maxSize:o,maxChangesPerUser:s,maxCapacity:a,version:n,mutablePermissions:i,maxTokens:c})=>({read:Fe(t),write:Fe(e),memory:U(r)?[gr(r)]:[],version:$(n),max_size:$(U(o)&&o>0?BigInt(o):void 0),max_capacity:$(U(a)&&a>0?a:void 0),max_changes_per_user:$(U(s)&&s>0?s:void 0),mutable_permissions:$(i),rate_config:U(c)?[{max_tokens:BigInt(c),time_per_token_ns:Oe}]:[]}),Ve=([t,e])=>{let{read:r,write:o,updated_at:s,created_at:a,max_size:n,max_changes_per_user:i,max_capacity:c,memory:p,mutable_permissions:u,version:m,rate_config:l}=e,d=n?.[0]??0n>0n?Number(W(n)):void 0,g=i?.[0]??!1?W(i):void 0,h=c?.[0]??!1?W(c):void 0,C=W(m),x=l?.[0]?.max_tokens??0n>0n?W(l)?.max_tokens:void 0;return{collection:t,read:Ae(r),write:Ae(o),memory:xr(W(p)??ut),updatedAt:s,createdAt:a,...U(C)&&{version:C},...U(g)&&{maxChangesPerUser:g},...U(d)&&{maxSize:d},...U(h)&&{maxCapacity:h},mutablePermissions:W(u)??!0,...U(x)&&{maxTokens:Number(x)}}},Ae=t=>"Public"in t?"public":"Private"in t?"private":"Managed"in t?"managed":"controllers",Fe=t=>{switch(t){case"public":return Pe;case"private":return Ne;case"managed":return he;default:return Se}},gr=t=>{switch(t.toLowerCase()){case"heap":return ut;default:return Re}},xr=t=>"Heap"in t?"heap":"stable";var Za=async({type:t,satellite:e})=>(await oe({satellite:e,type:_t(t)})).map(o=>Ve(o)),Ja=async({rule:{collection:t,...e},type:r,satellite:o})=>{await ae({type:_t(r),rule:be(e),satellite:o,collection:t})};import{IDL as nt}from"@dfinity/candid";import{Principal as ke}from"@dfinity/principal";import{isNullish as fr}from"@dfinity/utils";var rs=async({satellite:t,deprecated:e,deprecatedNoScope:r,reset:o=!1,...s})=>{let{satelliteId:a,...n}=t;if(fr(a))throw new Error("No satellite principal defined.");if(e){let u=await ie({satellite:t}),m=nt.encode([nt.Record({controllers:nt.Vec(nt.Principal)})],[{controllers:u}]);await B({actor:n,canisterId:ke.fromText(a),arg:new Uint8Array(m),mode:o?Q:H,reset:o,...s});return}let c=await(r?ot:at)({satellite:t}),p=et(c);await B({actor:n,canisterId:ke.fromText(a),arg:new Uint8Array(p),mode:o?Q:H,reset:o,...s})};import{nonNullish as Tr}from"@dfinity/utils";var is=t=>se(t),cs=t=>ne(t),ls=async({satellite:{satelliteId:t,...e}})=>{let r=await Et({...e,canisterId:t,path:"juno:build"});return Tr(r)&&["stock","extended"].includes(r)?r:void 0};export{Ht as UpgradeCodeProgressStep,D as UpgradeCodeUnchangedError,Gt as blobSha256,aa as checkUpgradeVersion,pa as countAssets,Fa as countDocs,da as deleteAssets,ba as deleteDocs,Pa as getAuthConfig,Ma as listCustomDomains,Zr as listMissionControlControllers,Wo as listOrbiterControllers,Za as listRules,Sa as listSatelliteControllers,vo as missionControlVersion,Xo as orbiterMemorySize,ea as orbiterVersion,ls as satelliteBuildType,cs as satelliteBuildVersion,Ba as satelliteMemorySize,is as satelliteVersion,Ca as setAuthConfig,Ua as setCustomDomain,va as setCustomDomains,Ta as setDatastoreConfig,Xr as setMissionControlController,Ja as setRule,Ra as setSatelliteControllers,jr as setSatellitesController,fa as setStorageConfig,tt as uint8ArraySha256,ko as upgradeMissionControl,Eo as upgradeModule,Io as upgradeOrbiter,rs as upgradeSatellite};
|
|
3
|
+
var D=class extends Error{constructor(){super("The Wasm code for the upgrade is identical to the code currently installed. No upgrade is necessary.")}};import{isNullish as je}from"@dfinity/utils";var xt=({IDL:t})=>{let e=t.Record({fund_cycles:t.Nat,min_cycles:t.Nat}),r=t.Variant({BelowThreshold:e}),o=t.Record({strategy:t.Opt(r),enabled:t.Bool}),s=t.Record({cycles:t.Opt(o)}),a=t.Record({monitoring:t.Opt(s)}),n=t.Record({updated_at:t.Nat64,orbiter_id:t.Principal,metadata:t.Vec(t.Tuple(t.Text,t.Text)),created_at:t.Nat64,settings:t.Opt(a)}),i=t.Record({subnet_id:t.Opt(t.Principal),name:t.Opt(t.Text)}),c=t.Record({updated_at:t.Nat64,metadata:t.Vec(t.Tuple(t.Text,t.Text)),created_at:t.Nat64,satellite_id:t.Principal,settings:t.Opt(a)}),p=t.Record({cycles:t.Nat,destination_id:t.Principal}),u=t.Record({to:t.Opt(t.Text),enabled:t.Bool}),m=t.Record({notification:t.Opt(u),default_strategy:t.Opt(r)}),l=t.Record({cycles:t.Opt(m)}),d=t.Record({monitoring:t.Opt(l)}),y=t.Record({to:t.Opt(t.Nat64),from:t.Opt(t.Nat64),segment_id:t.Principal}),h=t.Record({segment_id:t.Principal,created_at:t.Nat64,nonce:t.Int32}),P=t.Record({timestamp:t.Nat64,amount:t.Nat}),x=t.Record({deposited_cycles:t.Opt(P),cycles:P}),S=t.Record({cycles:t.Opt(x)}),R=t.Record({monitored_ids:t.Vec(t.Principal),running:t.Bool}),V=t.Record({cycles:t.Opt(R)}),O=t.Record({updated_at:t.Nat64,created_at:t.Nat64,monitoring:t.Opt(s)}),q=t.Record({updated_at:t.Nat64,metadata:t.Vec(t.Tuple(t.Text,t.Text)),user:t.Opt(t.Principal),created_at:t.Nat64,config:t.Opt(d)}),f=t.Record({e8s:t.Nat64}),E=t.Record({timestamp_nanos:t.Nat64}),T=t.Record({to:t.Vec(t.Nat8),fee:f,memo:t.Nat64,from_subaccount:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(E),amount:f}),g=t.Variant({TxTooOld:t.Record({allowed_window_nanos:t.Nat64}),BadFee:t.Record({expected_fee:f}),TxDuplicate:t.Record({duplicate_of:t.Nat64}),TxCreatedInFuture:t.Null,InsufficientFunds:t.Record({balance:f})}),C=t.Variant({Ok:t.Nat64,Err:g}),k=t.Record({owner:t.Principal,subaccount:t.Opt(t.Vec(t.Nat8))}),A=t.Record({to:k,fee:t.Opt(t.Nat),memo:t.Opt(t.Vec(t.Nat8)),from_subaccount:t.Opt(t.Vec(t.Nat8)),created_at_time:t.Opt(t.Nat64),amount:t.Nat}),w=t.Variant({GenericError:t.Record({message:t.Text,error_code:t.Nat}),TemporarilyUnavailable:t.Null,BadBurn:t.Record({min_burn_amount:t.Nat}),Duplicate:t.Record({duplicate_of:t.Nat}),BadFee:t.Record({expected_fee:t.Nat}),CreatedInFuture:t.Record({ledger_time:t.Nat64}),TooOld:t.Null,InsufficientFunds:t.Record({balance:t.Nat})}),M=t.Variant({Ok:t.Nat,Err:w}),F=t.Variant({Write:t.Null,Admin:t.Null}),b=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)}),z=t.Record({metadata:t.Vec(t.Tuple(t.Text,t.Text)),scope:F,expires_at:t.Opt(t.Nat64)}),G=t.Record({ids:t.Vec(t.Principal),strategy:r}),j=t.Record({orbiters_strategy:t.Opt(G),mission_control_strategy:t.Opt(r),satellites_strategy:t.Opt(G)}),X=t.Record({cycles_config:t.Opt(j)}),ct=t.Record({satellite_ids:t.Opt(t.Vec(t.Principal)),try_mission_control:t.Opt(t.Bool),orbiter_ids:t.Opt(t.Vec(t.Principal))}),lt=t.Record({cycles_config:t.Opt(ct)});return t.Service({add_mission_control_controllers:t.Func([t.Vec(t.Principal)],[],[]),add_satellites_controllers:t.Func([t.Vec(t.Principal),t.Vec(t.Principal)],[],[]),create_orbiter:t.Func([t.Opt(t.Text)],[n],[]),create_orbiter_with_config:t.Func([i],[n],[]),create_satellite:t.Func([t.Text],[c],[]),create_satellite_with_config:t.Func([i],[c],[]),del_mission_control_controllers:t.Func([t.Vec(t.Principal)],[],[]),del_orbiter:t.Func([t.Principal,t.Nat],[],[]),del_orbiters_controllers:t.Func([t.Vec(t.Principal),t.Vec(t.Principal)],[],[]),del_satellite:t.Func([t.Principal,t.Nat],[],[]),del_satellites_controllers:t.Func([t.Vec(t.Principal),t.Vec(t.Principal)],[],[]),deposit_cycles:t.Func([p],[],[]),get_config:t.Func([],[t.Opt(d)],["query"]),get_metadata:t.Func([],[t.Vec(t.Tuple(t.Text,t.Text))],["query"]),get_monitoring_history:t.Func([y],[t.Vec(t.Tuple(h,S))],["query"]),get_monitoring_status:t.Func([],[V],["query"]),get_settings:t.Func([],[t.Opt(O)],["query"]),get_user:t.Func([],[t.Principal],["query"]),get_user_data:t.Func([],[q],["query"]),icp_transfer:t.Func([T],[C],[]),icrc_transfer:t.Func([t.Principal,A],[M],[]),list_mission_control_controllers:t.Func([],[t.Vec(t.Tuple(t.Principal,b))],["query"]),list_orbiters:t.Func([],[t.Vec(t.Tuple(t.Principal,n))],["query"]),list_satellites:t.Func([],[t.Vec(t.Tuple(t.Principal,c))],["query"]),remove_mission_control_controllers:t.Func([t.Vec(t.Principal)],[],[]),remove_satellites_controllers:t.Func([t.Vec(t.Principal),t.Vec(t.Principal)],[],[]),set_config:t.Func([t.Opt(d)],[],[]),set_metadata:t.Func([t.Vec(t.Tuple(t.Text,t.Text))],[],[]),set_mission_control_controllers:t.Func([t.Vec(t.Principal),z],[],[]),set_orbiter:t.Func([t.Principal,t.Opt(t.Text)],[n],[]),set_orbiter_metadata:t.Func([t.Principal,t.Vec(t.Tuple(t.Text,t.Text))],[n],[]),set_orbiters_controllers:t.Func([t.Vec(t.Principal),t.Vec(t.Principal),z],[],[]),set_satellite:t.Func([t.Principal,t.Opt(t.Text)],[c],[]),set_satellite_metadata:t.Func([t.Principal,t.Vec(t.Tuple(t.Text,t.Text))],[c],[]),set_satellites_controllers:t.Func([t.Vec(t.Principal),t.Vec(t.Principal),z],[],[]),start_monitoring:t.Func([],[],[]),stop_monitoring:t.Func([],[],[]),top_up:t.Func([t.Principal,f],[],[]),unset_orbiter:t.Func([t.Principal],[],[]),unset_satellite:t.Func([t.Principal],[],[]),update_and_start_monitoring:t.Func([X],[],[]),update_and_stop_monitoring:t.Func([lt],[],[]),version:t.Func([],[t.Text],["query"])})};var ft=({IDL:t})=>{let e=t.Record({controllers:t.Vec(t.Principal)}),r=t.Variant({Write:t.Null,Admin:t.Null}),o=t.Record({updated_at:t.Nat64,metadata:t.Vec(t.Tuple(t.Text,t.Text)),created_at:t.Nat64,scope:r,expires_at:t.Opt(t.Nat64)}),s=t.Record({version:t.Opt(t.Nat64)}),a=t.Record({cycles:t.Nat,destination_id:t.Principal}),n=t.Record({to:t.Opt(t.Nat64),from:t.Opt(t.Nat64),satellite_id:t.Opt(t.Principal)}),i=t.Record({key:t.Text,collected_at:t.Nat64}),c=t.Record({inner_height:t.Nat16,inner_width:t.Nat16}),p=t.Record({title:t.Text,updated_at:t.Nat64,referrer:t.Opt(t.Text),time_zone:t.Text,session_id:t.Text,href:t.Text,created_at:t.Nat64,satellite_id:t.Principal,device:c,version:t.Opt(t.Nat64),user_agent:t.Opt(t.Text)}),u=t.Record({safari:t.Float64,opera:t.Float64,others:t.Float64,firefox:t.Float64,chrome:t.Float64}),m=t.Record({desktop:t.Float64,others:t.Float64,mobile:t.Float64}),l=t.Record({browsers:u,devices:m}),d=t.Record({day:t.Nat8,month:t.Nat8,year:t.Int32}),y=t.Record({bounce_rate:t.Float64,average_page_views_per_session:t.Float64,daily_total_page_views:t.Vec(t.Tuple(d,t.Nat32)),total_page_views:t.Nat32,unique_page_views:t.Nat64,unique_sessions:t.Nat64}),h=t.Record({referrers:t.Vec(t.Tuple(t.Text,t.Nat32)),pages:t.Vec(t.Tuple(t.Text,t.Nat32))}),P=t.Variant({Navigate:t.Null,Restore:t.Null,Reload:t.Null,BackForward:t.Null,BackForwardCache:t.Null,Prerender:t.Null}),x=t.Record({id:t.Text,value:t.Float64,navigation_type:t.Opt(P),delta:t.Float64}),S=t.Variant({WebVitalsMetric:x}),R=t.Variant({CLS:t.Null,FCP:t.Null,INP:t.Null,LCP:t.Null,TTFB:t.Null}),V=t.Record({updated_at:t.Nat64,session_id:t.Text,data:S,href:t.Text,metric_name:R,created_at:t.Nat64,satellite_id:t.Principal,version:t.Opt(t.Nat64)}),O=t.Record({cls:t.Opt(t.Float64),fcp:t.Opt(t.Float64),inp:t.Opt(t.Float64),lcp:t.Opt(t.Float64),ttfb:t.Opt(t.Float64)}),q=t.Record({overall:O,pages:t.Vec(t.Tuple(t.Text,O))}),f=t.Record({updated_at:t.Nat64,session_id:t.Text,metadata:t.Opt(t.Vec(t.Tuple(t.Text,t.Text))),name:t.Text,created_at:t.Nat64,satellite_id:t.Principal,version:t.Opt(t.Nat64)}),E=t.Record({total:t.Vec(t.Tuple(t.Text,t.Nat32))}),T=t.Record({performance_metrics:t.Bool,track_events:t.Bool,page_views:t.Bool}),g=t.Record({updated_at:t.Nat64,features:t.Opt(T),created_at:t.Nat64,version:t.Opt(t.Nat64)}),C=t.Record({stable:t.Nat64,heap:t.Nat64}),k=t.Record({metadata:t.Vec(t.Tuple(t.Text,t.Text)),scope:r,expires_at:t.Opt(t.Nat64)}),A=t.Record({controller:k,controllers:t.Vec(t.Principal)}),w=t.Record({title:t.Text,updated_at:t.Opt(t.Nat64),referrer:t.Opt(t.Text),time_zone:t.Text,session_id:t.Text,href:t.Text,satellite_id:t.Principal,device:c,version:t.Opt(t.Nat64),user_agent:t.Opt(t.Text)}),M=t.Variant({Ok:p,Err:t.Text}),F=t.Variant({Ok:t.Null,Err:t.Vec(t.Tuple(i,t.Text))}),b=t.Record({session_id:t.Text,data:S,href:t.Text,metric_name:R,satellite_id:t.Principal,version:t.Opt(t.Nat64),user_agent:t.Opt(t.Text)}),z=t.Variant({Ok:V,Err:t.Text}),G=t.Record({features:t.Opt(T),version:t.Opt(t.Nat64)}),j=t.Record({updated_at:t.Opt(t.Nat64),session_id:t.Text,metadata:t.Opt(t.Vec(t.Tuple(t.Text,t.Text))),name:t.Text,satellite_id:t.Principal,version:t.Opt(t.Nat64),user_agent:t.Opt(t.Text)}),X=t.Variant({Ok:f,Err:t.Text});return t.Service({del_controllers:t.Func([e],[t.Vec(t.Tuple(t.Principal,o))],[]),del_satellite_config:t.Func([t.Principal,s],[],[]),deposit_cycles:t.Func([a],[],[]),get_page_views:t.Func([n],[t.Vec(t.Tuple(i,p))],["query"]),get_page_views_analytics_clients:t.Func([n],[l],["query"]),get_page_views_analytics_metrics:t.Func([n],[y],["query"]),get_page_views_analytics_top_10:t.Func([n],[h],["query"]),get_performance_metrics:t.Func([n],[t.Vec(t.Tuple(i,V))],["query"]),get_performance_metrics_analytics_web_vitals:t.Func([n],[q],["query"]),get_track_events:t.Func([n],[t.Vec(t.Tuple(i,f))],["query"]),get_track_events_analytics:t.Func([n],[E],["query"]),list_controllers:t.Func([],[t.Vec(t.Tuple(t.Principal,o))],["query"]),list_satellite_configs:t.Func([],[t.Vec(t.Tuple(t.Principal,g))],["query"]),memory_size:t.Func([],[C],["query"]),set_controllers:t.Func([A],[t.Vec(t.Tuple(t.Principal,o))],[]),set_page_view:t.Func([i,w],[M],[]),set_page_views:t.Func([t.Vec(t.Tuple(i,w))],[F],[]),set_performance_metric:t.Func([i,b],[z],[]),set_performance_metrics:t.Func([t.Vec(t.Tuple(i,b))],[F],[]),set_satellite_configs:t.Func([t.Vec(t.Tuple(t.Principal,G))],[t.Vec(t.Tuple(t.Principal,g))],[]),set_track_event:t.Func([i,j],[X],[]),set_track_events:t.Func([t.Vec(t.Tuple(i,j))],[F],[]),version:t.Func([],[t.Text],["query"])})};var Tt=({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)}),r=t.Record({controllers:t.Vec(t.Principal)}),o=t.Record({updated_at:t.Nat64,metadata:t.Vec(t.Tuple(t.Text,t.Text)),created_at:t.Nat64,expires_at:t.Opt(t.Nat64)}),s=t.Record({updated_at:t.Opt(t.Nat64)}),a=t.Record({headers:t.Vec(t.Tuple(t.Text,t.Vec(t.Tuple(t.Text,t.Text))))}),n=t.Record({storage:a}),i=t.Record({updated_at:t.Nat64,owner:t.Principal,data:t.Vec(t.Nat8),created_at:t.Nat64}),c=t.Record({url:t.Text,method:t.Text,body:t.Vec(t.Nat8),headers:t.Vec(t.Tuple(t.Text,t.Text))}),p=t.Record({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}),u=t.Variant({Callback:t.Record({token:p,callback:t.Func([],[],[])})}),m=t.Record({body:t.Vec(t.Nat8),headers:t.Vec(t.Tuple(t.Text,t.Text)),streaming_strategy:t.Opt(u),status_code:t.Nat16}),l=t.Record({token:t.Opt(p),body:t.Vec(t.Nat8)}),d=t.Record({token:t.Opt(t.Text),collection:t.Text,name:t.Text,encoding_type:t.Opt(t.Text),full_path:t.Text}),y=t.Record({batch_id:t.Nat}),h=t.Variant({UpdatedAt:t.Null,Keys:t.Null,CreatedAt:t.Null}),P=t.Record({field:h,desc:t.Bool}),x=t.Record({start_after:t.Opt(t.Text),limit:t.Opt(t.Nat64)}),S=t.Record({order:t.Opt(P),owner:t.Opt(t.Principal),matcher:t.Opt(t.Text),paginate:t.Opt(x)}),R=t.Record({token:t.Opt(t.Text),collection:t.Text,owner:t.Principal,name:t.Text,full_path:t.Text}),V=t.Record({modified:t.Nat64,sha256:t.Vec(t.Nat8),total_length:t.Nat}),O=t.Record({key:R,updated_at:t.Nat64,encodings:t.Vec(t.Tuple(t.Text,V)),headers:t.Vec(t.Tuple(t.Text,t.Text)),created_at:t.Nat64}),q=t.Record({matches_length:t.Nat64,length:t.Nat64,items:t.Vec(t.Tuple(t.Text,O))}),f=t.Record({updated_at:t.Nat64,created_at:t.Nat64,bn_id:t.Opt(t.Text)}),E=t.Record({matches_length:t.Nat64,length:t.Nat64,items:t.Vec(t.Tuple(t.Text,i))}),T=t.Variant({Db:t.Null,Storage:t.Null}),g=t.Variant({Controllers:t.Null,Private:t.Null,Public:t.Null,Managed:t.Null}),C=t.Record({updated_at:t.Nat64,max_size:t.Opt(t.Nat),read:g,created_at:t.Nat64,write:g}),k=t.Record({metadata:t.Vec(t.Tuple(t.Text,t.Text)),expires_at:t.Opt(t.Nat64)}),A=t.Record({controller:k,controllers:t.Vec(t.Principal)}),w=t.Record({updated_at:t.Opt(t.Nat64),data:t.Vec(t.Nat8)}),M=t.Record({updated_at:t.Opt(t.Nat64),max_size:t.Opt(t.Nat),read:g,write:g}),F=t.Record({content:t.Vec(t.Nat8),batch_id:t.Nat}),b=t.Record({chunk_id:t.Nat});return t.Service({commit_asset_upload:t.Func([e],[],[]),del_asset:t.Func([t.Text,t.Text],[],[]),del_assets:t.Func([t.Opt(t.Text)],[],[]),del_controllers:t.Func([r],[t.Vec(t.Tuple(t.Principal,o))],[]),del_custom_domain:t.Func([t.Text],[],[]),del_doc:t.Func([t.Text,t.Text,s],[],[]),get_config:t.Func([],[n],[]),get_doc:t.Func([t.Text,t.Text],[t.Opt(i)],["query"]),http_request:t.Func([c],[m],["query"]),http_request_streaming_callback:t.Func([p],[l],["query"]),init_asset_upload:t.Func([d],[y],[]),list_assets:t.Func([t.Opt(t.Text),S],[q],["query"]),list_controllers:t.Func([],[t.Vec(t.Tuple(t.Principal,o))],["query"]),list_custom_domains:t.Func([],[t.Vec(t.Tuple(t.Text,f))],["query"]),list_docs:t.Func([t.Text,S],[E],["query"]),list_rules:t.Func([T],[t.Vec(t.Tuple(t.Text,C))],["query"]),set_config:t.Func([n],[],[]),set_controllers:t.Func([A],[t.Vec(t.Tuple(t.Principal,o))],[]),set_custom_domain:t.Func([t.Text,t.Opt(t.Text)],[],[]),set_doc:t.Func([t.Text,t.Text,w],[i],[]),set_rule:t.Func([T,t.Text,M],[],[]),upload_asset_chunk:t.Func([F],[b],[]),version:t.Func([],[t.Text],["query"])})};var Pt=({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)}),r=t.Record({controllers:t.Vec(t.Principal)}),o=t.Record({updated_at:t.Nat64,metadata:t.Vec(t.Tuple(t.Text,t.Text)),created_at:t.Nat64,expires_at:t.Opt(t.Nat64)}),s=t.Record({updated_at:t.Opt(t.Nat64)}),a=t.Record({headers:t.Vec(t.Tuple(t.Text,t.Vec(t.Tuple(t.Text,t.Text))))}),n=t.Record({storage:a}),i=t.Record({updated_at:t.Nat64,owner:t.Principal,data:t.Vec(t.Nat8),created_at:t.Nat64}),c=t.Record({url:t.Text,method:t.Text,body:t.Vec(t.Nat8),headers:t.Vec(t.Tuple(t.Text,t.Text))}),p=t.Record({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}),u=t.Variant({Callback:t.Record({token:p,callback:t.Func([],[],[])})}),m=t.Record({body:t.Vec(t.Nat8),headers:t.Vec(t.Tuple(t.Text,t.Text)),streaming_strategy:t.Opt(u),status_code:t.Nat16}),l=t.Record({token:t.Opt(p),body:t.Vec(t.Nat8)}),d=t.Record({token:t.Opt(t.Text),collection:t.Text,name:t.Text,encoding_type:t.Opt(t.Text),full_path:t.Text}),y=t.Record({batch_id:t.Nat}),h=t.Variant({UpdatedAt:t.Null,Keys:t.Null,CreatedAt:t.Null}),P=t.Record({field:h,desc:t.Bool}),x=t.Record({start_after:t.Opt(t.Text),limit:t.Opt(t.Nat64)}),S=t.Record({order:t.Opt(P),matcher:t.Opt(t.Text),paginate:t.Opt(x)}),R=t.Record({token:t.Opt(t.Text),collection:t.Text,owner:t.Principal,name:t.Text,full_path:t.Text}),V=t.Record({modified:t.Nat64,sha256:t.Vec(t.Nat8),total_length:t.Nat}),O=t.Record({key:R,updated_at:t.Nat64,encodings:t.Vec(t.Tuple(t.Text,V)),headers:t.Vec(t.Tuple(t.Text,t.Text)),created_at:t.Nat64}),q=t.Record({matches_length:t.Nat64,length:t.Nat64,items:t.Vec(t.Tuple(t.Text,O))}),f=t.Record({updated_at:t.Nat64,created_at:t.Nat64,bn_id:t.Opt(t.Text)}),E=t.Record({matches_length:t.Nat64,length:t.Nat64,items:t.Vec(t.Tuple(t.Text,i))}),T=t.Variant({Db:t.Null,Storage:t.Null}),g=t.Variant({Controllers:t.Null,Private:t.Null,Public:t.Null,Managed:t.Null}),C=t.Record({updated_at:t.Nat64,max_size:t.Opt(t.Nat),read:g,created_at:t.Nat64,write:g}),k=t.Record({metadata:t.Vec(t.Tuple(t.Text,t.Text)),expires_at:t.Opt(t.Nat64)}),A=t.Record({controller:k,controllers:t.Vec(t.Principal)}),w=t.Record({updated_at:t.Opt(t.Nat64),data:t.Vec(t.Nat8)}),M=t.Record({updated_at:t.Opt(t.Nat64),max_size:t.Opt(t.Nat),read:g,write:g}),F=t.Record({content:t.Vec(t.Nat8),batch_id:t.Nat}),b=t.Record({chunk_id:t.Nat});return t.Service({commit_asset_upload:t.Func([e],[],[]),del_asset:t.Func([t.Text,t.Text],[],[]),del_assets:t.Func([t.Opt(t.Text)],[],[]),del_controllers:t.Func([r],[t.Vec(t.Tuple(t.Principal,o))],[]),del_custom_domain:t.Func([t.Text],[],[]),del_doc:t.Func([t.Text,t.Text,s],[],[]),get_config:t.Func([],[n],[]),get_doc:t.Func([t.Text,t.Text],[t.Opt(i)],["query"]),http_request:t.Func([c],[m],["query"]),http_request_streaming_callback:t.Func([p],[l],["query"]),init_asset_upload:t.Func([d],[y],[]),list_assets:t.Func([t.Opt(t.Text),S],[q],["query"]),list_controllers:t.Func([],[t.Vec(t.Principal)],["query"]),list_custom_domains:t.Func([],[t.Vec(t.Tuple(t.Text,f))],["query"]),list_docs:t.Func([t.Text,S],[E],["query"]),list_rules:t.Func([T],[t.Vec(t.Tuple(t.Text,C))],["query"]),set_config:t.Func([n],[],[]),set_controllers:t.Func([A],[t.Vec(t.Tuple(t.Principal,o))],[]),set_custom_domain:t.Func([t.Text,t.Opt(t.Text)],[],[]),set_doc:t.Func([t.Text,t.Text,w],[i],[]),set_rule:t.Func([T,t.Text,M],[],[]),upload_asset_chunk:t.Func([F],[b],[]),version:t.Func([],[t.Text],["query"])})};var Ct=({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)}),r=t.Variant({UpdatedAt:t.Null,Keys:t.Null,CreatedAt:t.Null}),o=t.Record({field:r,desc:t.Bool}),s=t.Variant({Equal:t.Nat64,Between:t.Tuple(t.Nat64,t.Nat64),GreaterThan:t.Nat64,LessThan:t.Nat64}),a=t.Record({key:t.Opt(t.Text),updated_at:t.Opt(s),description:t.Opt(t.Text),created_at:t.Opt(s)}),n=t.Record({start_after:t.Opt(t.Text),limit:t.Opt(t.Nat64)}),i=t.Record({order:t.Opt(o),owner:t.Opt(t.Principal),matcher:t.Opt(a),paginate:t.Opt(n)}),c=t.Record({controllers:t.Vec(t.Principal)}),p=t.Variant({Write:t.Null,Admin:t.Null}),u=t.Record({updated_at:t.Nat64,metadata:t.Vec(t.Tuple(t.Text,t.Text)),created_at:t.Nat64,scope:p,expires_at:t.Opt(t.Nat64)}),m=t.Record({version:t.Opt(t.Nat64)}),l=t.Variant({Db:t.Null,Storage:t.Null}),d=t.Record({version:t.Opt(t.Nat64)}),y=t.Record({cycles:t.Nat,destination_id:t.Principal}),h=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}),P=t.Record({modified:t.Nat64,sha256:t.Vec(t.Nat8),total_length:t.Nat}),x=t.Record({key:h,updated_at:t.Nat64,encodings:t.Vec(t.Tuple(t.Text,P)),headers:t.Vec(t.Tuple(t.Text,t.Text)),created_at:t.Nat64,version:t.Opt(t.Nat64)}),S=t.Record({derivation_origin:t.Opt(t.Text),external_alternative_origins:t.Opt(t.Vec(t.Text))}),R=t.Record({internet_identity:t.Opt(S)}),V=t.Record({stable:t.Opt(t.Nat64),heap:t.Opt(t.Nat64)}),O=t.Record({max_memory_size:t.Opt(V)}),q=t.Variant({Deny:t.Null,AllowAny:t.Null,SameOrigin:t.Null}),f=t.Variant({Deny:t.Null,Allow:t.Null}),E=t.Record({status_code:t.Nat16,location:t.Text}),T=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(V),raw_access:t.Opt(f),redirects:t.Opt(t.Vec(t.Tuple(t.Text,E)))}),g=t.Record({db:t.Opt(O),authentication:t.Opt(R),storage:T}),C=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)}),k=t.Variant({Heap:t.Null,Stable:t.Null}),A=t.Variant({Controllers:t.Null,Private:t.Null,Public:t.Null,Managed:t.Null}),w=t.Record({max_tokens:t.Nat64,time_per_token_ns:t.Nat64}),M=t.Record({max_capacity:t.Opt(t.Nat32),memory:t.Opt(k),updated_at:t.Nat64,max_size:t.Opt(t.Nat),read:A,created_at:t.Nat64,version:t.Opt(t.Nat64),mutable_permissions:t.Opt(t.Bool),rate_config:t.Opt(w),write:A,max_changes_per_user:t.Opt(t.Nat32)}),F=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)}),b=t.Record({memory:k,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}),z=t.Variant({Callback:t.Record({token:b,callback:t.Func([],[],["query"])})}),G=t.Record({body:t.Vec(t.Nat8),headers:t.Vec(t.Tuple(t.Text,t.Text)),streaming_strategy:t.Opt(z),status_code:t.Nat16}),j=t.Record({token:t.Opt(b),body:t.Vec(t.Nat8)}),X=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}),ct=t.Record({batch_id:t.Nat}),lt=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,x)),items_length:t.Nat64}),Me=t.Record({updated_at:t.Nat64,created_at:t.Nat64,version:t.Opt(t.Nat64),bn_id:t.Opt(t.Text)}),ve=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,C)),items_length:t.Nat64}),Ue=t.Record({stable:t.Nat64,heap:t.Nat64}),qe=t.Record({metadata:t.Vec(t.Tuple(t.Text,t.Text)),scope:p,expires_at:t.Opt(t.Nat64)}),Ee=t.Record({controller:qe,controllers:t.Vec(t.Principal)}),yt=t.Record({data:t.Vec(t.Nat8),description:t.Opt(t.Text),version:t.Opt(t.Nat64)}),Be=t.Record({max_capacity:t.Opt(t.Nat32),memory:t.Opt(k),max_size:t.Opt(t.Nat),read:A,version:t.Opt(t.Nat64),mutable_permissions:t.Opt(t.Bool),rate_config:t.Opt(w),write:A,max_changes_per_user:t.Opt(t.Nat32)}),ze=t.Record({content:t.Vec(t.Nat8),batch_id:t.Nat,order_id:t.Opt(t.Nat)}),He=t.Record({chunk_id:t.Nat});return t.Service({build_version:t.Func([],[t.Text],["query"]),commit_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"]),del_asset:t.Func([t.Text,t.Text],[],[]),del_assets:t.Func([t.Text],[],[]),del_controllers:t.Func([c],[t.Vec(t.Tuple(t.Principal,u))],[]),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([l,t.Text,d],[],[]),deposit_cycles:t.Func([y],[],[]),get_asset:t.Func([t.Text,t.Text],[t.Opt(x)],["query"]),get_auth_config:t.Func([],[t.Opt(R)],["query"]),get_config:t.Func([],[g],[]),get_db_config:t.Func([],[t.Opt(O)],["query"]),get_doc:t.Func([t.Text,t.Text],[t.Opt(C)],["query"]),get_many_assets:t.Func([t.Vec(t.Tuple(t.Text,t.Text))],[t.Vec(t.Tuple(t.Text,t.Opt(x)))],["query"]),get_many_docs:t.Func([t.Vec(t.Tuple(t.Text,t.Text))],[t.Vec(t.Tuple(t.Text,t.Opt(C)))],["query"]),get_rule:t.Func([l,t.Text],[t.Opt(M)],["query"]),get_storage_config:t.Func([],[T],["query"]),http_request:t.Func([F],[G],["query"]),http_request_streaming_callback:t.Func([b],[j],["query"]),init_asset_upload:t.Func([X],[ct],[]),list_assets:t.Func([t.Text,i],[lt],["query"]),list_controllers:t.Func([],[t.Vec(t.Tuple(t.Principal,u))],["query"]),list_custom_domains:t.Func([],[t.Vec(t.Tuple(t.Text,Me))],["query"]),list_docs:t.Func([t.Text,i],[ve],["query"]),list_rules:t.Func([l],[t.Vec(t.Tuple(t.Text,M))],["query"]),memory_size:t.Func([],[Ue],["query"]),set_auth_config:t.Func([R],[],[]),set_controllers:t.Func([Ee],[t.Vec(t.Tuple(t.Principal,u))],[]),set_custom_domain:t.Func([t.Text,t.Opt(t.Text)],[],[]),set_db_config:t.Func([O],[],[]),set_doc:t.Func([t.Text,t.Text,yt],[C],[]),set_many_docs:t.Func([t.Vec(t.Tuple(t.Text,t.Text,yt))],[t.Vec(t.Tuple(t.Text,C))],[]),set_rule:t.Func([l,t.Text,Be],[M],[]),set_storage_config:t.Func([T],[],[]),upload_asset_chunk:t.Func([ze],[He],[]),version:t.Func([],[t.Text],["query"])})};import{Actor as Ke,HttpAgent as We}from"@dfinity/agent";import{nonNullish as Nt}from"@dfinity/utils";var ht=async({canisterId:t,idlFactory:e,config:r,...o})=>{let s=await N(o);return Ke.createActor(e,{agent:s,canisterId:t,...r??{}})},N=async({agent:t,...e})=>t??await Ge(e),Ge=async({identity:t,fetch:e,container:r})=>{let o=Nt(r)&&r!==!1,s=o?r===!0?"http://127.0.0.1:5987":r:"https://icp-api.io";return await We.create({identity:t,host:s,retryTimes:10,...Nt(e)&&{fetch:e},shouldFetchRootKey:o})};var St=({satelliteId:t,...e})=>Z({canisterId:t,...e,idlFactory:Pt}),_=({satelliteId:t,...e})=>Z({canisterId:t,...e,idlFactory:Ct}),Rt=({satelliteId:t,...e})=>Z({canisterId:t,...e,idlFactory:Tt}),J=({missionControlId:t,...e})=>Z({canisterId:t,...e,idlFactory:xt}),I=({orbiterId:t,...e})=>Z({canisterId:t,...e,idlFactory:ft}),Z=({canisterId:t,idlFactory:e,...r})=>{if(je(t))throw new Error("No canister ID provided.");return ht({canisterId:t,idlFactory:e,...r})};var Ot=async({missionControl:t})=>(await J(t)).version(),At=async({missionControl:t})=>(await J(t)).get_user(),Ft=async({missionControl:t})=>(await J(t)).list_mission_control_controllers(),bt=async({missionControl:t,satelliteIds:e,controllerIds:r,controller:o})=>(await J(t)).set_satellites_controllers(e,r,o),Vt=async({missionControl:t,controllerIds:e,controller:r})=>(await J(t)).set_mission_control_controllers(e,r);import{Principal as Je}from"@dfinity/principal";import{nonNullish as Xe,toNullable as Ze}from"@dfinity/utils";var pt=({controllerId:t,profile:e})=>({controllerIds:[Je.fromText(t)],controller:Qe(e)}),Qe=t=>({metadata:Xe(t)&&t!==""?[["profile",t]]:[],expires_at:Ze(void 0),scope:{Admin:null}});var Xr=({controllerId:t,profile:e,...r})=>bt({...r,...pt({controllerId:t,profile:e})}),Zr=({controllerId:t,profile:e,...r})=>Vt({...r,...pt({controllerId:t,profile:e})}),Qr=t=>Ft(t);import{Principal as dr}from"@dfinity/principal";var Q={reinstall:null},H={upgrade:[{skip_pre_upgrade:[!1],wasm_memory_persistence:[{replace:null}]}]};import{fromNullable as sr,isNullish as nr,uint8ArrayToHexString as ir}from"@dfinity/utils";import{CanisterStatus as Ye}from"@dfinity/agent";import{ICManagementCanister as v}from"@dfinity/ic-management";import{Principal as kt}from"@dfinity/principal";import{assertNonNullish as $e}from"@dfinity/utils";var wt=async({canisterId:t,actor:e})=>{let r=await N(e),{stopCanister:o}=v.create({agent:r});await o(t)},Mt=async({canisterId:t,actor:e})=>{let r=await N(e),{startCanister:o}=v.create({agent:r});await o(t)},vt=async({actor:t,code:e})=>{let r=await N(t),{installCode:o}=v.create({agent:r});return o(e)},Ut=async({actor:t,canisterId:e})=>{let r=await N(t),{storedChunks:o}=v.create({agent:r});return o({canisterId:e})},L=async({actor:t,canisterId:e})=>{let r=await N(t),{clearChunkStore:o}=v.create({agent:r});return o({canisterId:e})},qt=async({actor:t,chunk:e})=>{let r=await N(t),{uploadChunk:o}=v.create({agent:r});return o(e)},Et=async({actor:t,code:e})=>{let r=await N(t),{installChunkedCode:o}=v.create({agent:r});return o(e)},Bt=async({actor:t,canisterId:e})=>{let r=await N(t),{canisterStatus:o}=v.create({agent:r});return o(e)},tt=async({canisterId:t,path:e,...r})=>{$e(t,"A canister ID must be provided to request its status.");let o=await N(r);return(await Ye.request({canisterId:t instanceof kt?t:kt.fromText(t),agent:o,paths:[{kind:"metadata",key:e,path:e,decodeStrategy:"utf-8"}]})).get(e)},zt=async({actor:t,canisterId:e})=>{let r=await N(t),{listCanisterSnapshots:o}=v.create({agent:r});return o({canisterId:e})},Ht=async({actor:t,...e})=>{let r=await N(t),{takeCanisterSnapshot:o}=v.create({agent:r});return o(e)};var Kt=(a=>(a[a.AssertingExistingCode=0]="AssertingExistingCode",a[a.StoppingCanister=1]="StoppingCanister",a[a.TakingSnapshot=2]="TakingSnapshot",a[a.UpgradingCode=3]="UpgradingCode",a[a.RestartingCanister=4]="RestartingCanister",a))(Kt||{});var Wt=t=>crypto.subtle.digest("SHA-256",t),Gt=t=>Array.from(new Uint8Array(t)).map(r=>r.toString(16).padStart(2,"0")).join(""),jt=async t=>{let e=await Wt(await t.arrayBuffer());return Gt(e)},et=async t=>{let e=await Wt(t);return Gt(e)};import{isNullish as Ie,nonNullish as Jt,uint8ArrayToHexString as Le}from"@dfinity/utils";var Xt=async({actor:t,canisterId:e,missionControlId:r,wasmModule:o,preClearChunks:s,...a})=>{s&&await L({actor:t,canisterId:e});let n=await tr({wasmModule:o}),{uploadChunks:i,storedChunks:c,preClearChunks:p,postClearChunks:u}=await er({actor:t,wasmChunks:n,canisterId:e,missionControlId:r});p&&await L({actor:t,canisterId:e});let m=[];for await(let l of rr({uploadChunks:i,actor:t,canisterId:e,missionControlId:r}))m=[...m,...l];await Et({actor:t,code:{...a,chunkHashesList:[...m,...c].sort(({orderId:l},{orderId:d})=>l-d).map(({chunkHash:l})=>l),targetCanisterId:e,storeCanisterId:r,wasmModuleHash:await et(o)}}),u&&await L({actor:t,canisterId:e})},tr=async({wasmModule:t})=>{let e=new Blob([t]),r=[],o=1e6,s=0;for(let a=0;a<e.size;a+=o){let n=e.slice(a,a+o);r.push({chunk:n,orderId:s,sha256:await jt(n)}),s++}return r},er=async({canisterId:t,missionControlId:e,actor:r,wasmChunks:o})=>{let s=await Ut({actor:r,canisterId:e??t}),a=s.map(({hash:c})=>({chunkHash:{hash:c},sha256:Le(c)})),{storedChunks:n,uploadChunks:i}=o.reduce(({uploadChunks:c,storedChunks:p},{sha256:u,...m})=>{let l=a.find(({sha256:d})=>d===u);return{uploadChunks:[...c,...Jt(l)?[]:[{sha256:u,...m}]],storedChunks:[...p,...Jt(l)?[{...m,...l}]:[]]}},{uploadChunks:[],storedChunks:[]});return{uploadChunks:i,storedChunks:n,preClearChunks:s.length>0&&n.length===0,postClearChunks:Ie(e)}};async function*rr({uploadChunks:t,limit:e=12,...r}){for(let o=0;o<t.length;o=o+e){let s=t.slice(o,o+e);yield await Promise.all(s.map(n=>or({uploadChunk:n,...r})))}}var or=async({actor:t,canisterId:e,missionControlId:r,uploadChunk:{chunk:o,...s}})=>({chunkHash:await qt({actor:t,chunk:{canisterId:r??e,chunk:new Uint8Array(await o.arrayBuffer())}}),...s});var Zt=async({actor:t,...e})=>{await vt({actor:t,code:e})};var B=async({wasmModule:t,canisterId:e,actor:r,onProgress:o,takeSnapshot:s=!0,...a})=>{await Y({fn:async()=>await cr({wasmModule:t,canisterId:e,actor:r,...a}),onProgress:o,step:0}),await Y({fn:async()=>await wt({canisterId:e,actor:r}),onProgress:o,step:1});try{await Y({fn:async()=>s?await pr({canisterId:e,actor:r}):Promise.resolve(),onProgress:o,step:2}),await Y({fn:async()=>await lr({wasmModule:t,canisterId:e,actor:r,...a}),onProgress:o,step:3})}finally{await Y({fn:async()=>await Mt({canisterId:e,actor:r}),onProgress:o,step:4})}},Y=async({fn:t,step:e,onProgress:r})=>{r?.({step:e,state:"in_progress"});try{await t(),r?.({step:e,state:"success"})}catch(o){throw r?.({step:e,state:"error"}),o}},cr=async({actor:t,canisterId:e,wasmModule:r,reset:o})=>{if(o===!0)return;let{module_hash:s}=await Bt({actor:t,canisterId:e}),a=sr(s);if(nr(a))return;let n=await et(r),i=ir(a);if(n===i)throw new D},lr=async({wasmModule:t,canisterId:e,actor:r,...o})=>{await((new Blob([t]).size>2e6?"chunked":"single")==="chunked"?Xt:Zt)({wasmModule:t,canisterId:e,actor:r,...o})},pr=async t=>{let e=await zt(t);await Ht({...t,snapshotId:e?.[0]?.id})};import{IDL as K}from"@dfinity/candid";var Qt=t=>K.encode([K.Record({user:K.Principal})],[{user:t}]),rt=t=>K.encode([K.Record({controllers:K.Vec(K.Principal)})],[{controllers:t.map(([e,r])=>e)}]);var Mo=async({missionControl:t,...e})=>{let r=await At({missionControl:t}),{missionControlId:o,...s}=t;if(!o)throw new Error("No mission control principal defined.");let a=Qt(r);await B({actor:s,canisterId:dr.fromText(o),arg:new Uint8Array(a),mode:H,...e})};var qo=t=>Ot(t);var zo=async t=>{await B(t)};var Yt=async({orbiter:t})=>(await I(t)).version(),ot=async({orbiter:t})=>(await I(t)).list_controllers(),$t=async({orbiter:t})=>{let{memory_size:e}=await I(t);return e()};var jo=t=>ot(t);var Zo=t=>$t(t);import{Principal as mr}from"@dfinity/principal";var ta=async({orbiter:t,reset:e=!1,...r})=>{let{orbiterId:o,...s}=t;if(!o)throw new Error("No orbiter principal defined.");let a=await ot({orbiter:t}),n=rt(a);await B({actor:s,canisterId:mr.fromText(o),arg:new Uint8Array(n),mode:e?Q:H,reset:e,...r})};var oa=t=>Yt(t);import{isNullish as ur}from"@dfinity/utils";import{JunoPackageSchema as _r}from"@junobuild/config";var ca=async({moduleId:t,...e})=>{let r=await tt({...e,canisterId:t,path:"juno:package"});if(!ur(r))return _r.parse(r)};import{major as Dt,minor as It,patch as Lt}from"semver";var da=({currentVersion:t,selectedVersion:e})=>{let r=Dt(t),o=Dt(e),s=It(t),a=It(e),n=Lt(t),i=Lt(e);return r<o-1||s<a-1||n<i-1?{canUpgrade:!1}:{canUpgrade:!0}};import{toNullable as gr}from"@dfinity/utils";var te=async({config:t,satellite:e})=>{let{set_storage_config:r}=await _(e);return r(t)},ee=async({config:t,satellite:e})=>{let{set_db_config:r}=await _(e);return r(t)},re=async({config:t,satellite:e})=>{let{set_auth_config:r}=await _(e);return r(t)};var oe=async({satellite:t})=>{let{get_auth_config:e}=await _(t);return e()},ae=async({satellite:t,type:e})=>(await _(t)).list_rules(e),se=async({type:t,collection:e,rule:r,satellite:o})=>{let{set_rule:s}=await _(o);return s(t,e,r)},ne=async({satellite:t})=>{let{version:e}=await _(t);return e()},ie=async({satellite:t})=>{let{build_version:e}=await _(t);return e()},ce=async({satellite:t})=>(await St(t)).list_controllers(),at=async({satellite:t})=>(await Rt(t)).list_controllers(),st=async({satellite:t})=>(await _(t)).list_controllers(),le=async({satellite:t})=>{let{list_custom_domains:e}=await _(t);return e()},dt=async({satellite:t,domainName:e,boundaryNodesId:r})=>{let{set_custom_domain:o}=await _(t);await o(e,gr(r))},pe=async({satellite:t})=>{let{memory_size:e}=await _(t);return e()},de=async({collection:t,satellite:e})=>{let{count_collection_docs:r}=await _(e);return r(t)},me=async({collection:t,satellite:e})=>{let{count_collection_assets:r}=await _(e);return r(t)},ue=async({collection:t,satellite:e})=>{let{del_docs:r}=await _(e);return r(t)},_e=async({collection:t,satellite:e})=>{let{del_assets:r}=await _(e);return r(t)},ge=async({args:t,satellite:e})=>{let{set_controllers:r}=await _(e);return r(t)};var xa=t=>me(t),fa=t=>_e(t);import{fromNullable as nt,isNullish as fe,nonNullish as ye,toNullable as xe}from"@dfinity/utils";import{nonNullish as yr,toNullable as mt}from"@dfinity/utils";var ut=t=>mt(yr(t)?{heap:mt(t.heap),stable:mt(t.stable)}:void 0);var Ra=async({config:{headers:t,rewrites:e,redirects:r,iframe:o,rawAccess:s,maxMemorySize:a},satellite:n})=>{let i=(t??[]).map(({source:l,headers:d})=>[l,d]),c=(e??[]).map(({source:l,destination:d})=>[l,d]),p=(r??[]).map(({source:l,location:d,code:y})=>[l,{status_code:y,location:d}]);return await te({satellite:n,config:{headers:i,rewrites:c,redirects:[p],iframe:[o==="same-origin"?{SameOrigin:null}:o==="allow-any"?{AllowAny:null}:{Deny:null}],raw_access:[s===!0?{Allow:null}:{Deny:null}],max_memory_size:ut(a)}})},Oa=async({config:{maxMemorySize:t},...e})=>{await ee({config:{max_memory_size:ut(t)},...e})},Aa=async({config:{internetIdentity:t},...e})=>{await re({config:{internet_identity:fe(t)?[]:[{derivation_origin:xe(t?.derivationOrigin),external_alternative_origins:xe(t?.externalAlternativeOrigins)}]},...e})},Fa=async({satellite:t})=>{let e=nt(await oe({satellite:t}));if(fe(e))return;let r=nt(e.internet_identity??[]);return{...ye(r)&&{internetIdentity:{...ye(nt(r.derivation_origin))&&{derivationOrigin:nt(r.derivation_origin)}}}}};var ka=({deprecatedNoScope:t,...e})=>(t===!0?at:st)(e),wa=t=>ge(t);var Ua=t=>de(t),qa=t=>ue(t);import{fromNullable as Te,nonNullish as xr}from"@dfinity/utils";var Ha=async({satellite:t})=>(await le({satellite:t})).map(([r,o])=>{let s=Te(o.version);return{domain:r,bn_id:Te(o.bn_id),created_at:o.created_at,updated_at:o.updated_at,...xr(s)&&{version:s}}}),Ka=({satellite:t,domains:e})=>Promise.all(e.map(({domain:r,bn_id:o})=>dt({satellite:t,domainName:r,boundaryNodesId:o}))),Wa=({satellite:t,domain:e})=>dt({satellite:t,domainName:e.domain,boundaryNodesId:e.bn_id});var Ja=t=>pe(t);import{fromNullable as W,nonNullish as U,toNullable as $}from"@dfinity/utils";var Pe={Db:null},Ce={Storage:null},Ne={Public:null},he={Private:null},Se={Managed:null},Re={Controllers:null},_t={Heap:null},Oe={Stable:null},Ae=600000000n;var gt=t=>t==="storage"?Ce:Pe,Ve=({read:t,write:e,memory:r,maxSize:o,maxChangesPerUser:s,maxCapacity:a,version:n,mutablePermissions:i,maxTokens:c})=>({read:be(t),write:be(e),memory:U(r)?[fr(r)]:[],version:$(n),max_size:$(U(o)&&o>0?BigInt(o):void 0),max_capacity:$(U(a)&&a>0?a:void 0),max_changes_per_user:$(U(s)&&s>0?s:void 0),mutable_permissions:$(i),rate_config:U(c)?[{max_tokens:BigInt(c),time_per_token_ns:Ae}]:[]}),ke=([t,e])=>{let{read:r,write:o,updated_at:s,created_at:a,max_size:n,max_changes_per_user:i,max_capacity:c,memory:p,mutable_permissions:u,version:m,rate_config:l}=e,d=n?.[0]??0n>0n?Number(W(n)):void 0,y=i?.[0]??!1?W(i):void 0,h=c?.[0]??!1?W(c):void 0,P=W(m),x=l?.[0]?.max_tokens??0n>0n?W(l)?.max_tokens:void 0;return{collection:t,read:Fe(r),write:Fe(o),memory:Tr(W(p)??_t),updatedAt:s,createdAt:a,...U(P)&&{version:P},...U(y)&&{maxChangesPerUser:y},...U(d)&&{maxSize:d},...U(h)&&{maxCapacity:h},mutablePermissions:W(u)??!0,...U(x)&&{maxTokens:Number(x)}}},Fe=t=>"Public"in t?"public":"Private"in t?"private":"Managed"in t?"managed":"controllers",be=t=>{switch(t){case"public":return Ne;case"private":return he;case"managed":return Se;default:return Re}},fr=t=>{switch(t.toLowerCase()){case"heap":return _t;default:return Oe}},Tr=t=>"Heap"in t?"heap":"stable";var La=async({type:t,satellite:e})=>(await ae({satellite:e,type:gt(t)})).map(o=>ke(o)),ts=async({rule:{collection:t,...e},type:r,satellite:o})=>{await se({type:gt(r),rule:Ve(e),satellite:o,collection:t})};import{IDL as it}from"@dfinity/candid";import{Principal as we}from"@dfinity/principal";import{isNullish as Pr}from"@dfinity/utils";var ls=async({satellite:t,deprecated:e,deprecatedNoScope:r,reset:o=!1,...s})=>{let{satelliteId:a,...n}=t;if(Pr(a))throw new Error("No satellite principal defined.");if(e){let u=await ce({satellite:t}),m=it.encode([it.Record({controllers:it.Vec(it.Principal)})],[{controllers:u}]);await B({actor:n,canisterId:we.fromText(a),arg:new Uint8Array(m),mode:o?Q:H,reset:o,...s});return}let c=await(r?at:st)({satellite:t}),p=rt(c);await B({actor:n,canisterId:we.fromText(a),arg:new Uint8Array(p),mode:o?Q:H,reset:o,...s})};import{nonNullish as Cr}from"@dfinity/utils";var _s=t=>ne(t),gs=t=>ie(t),ys=async({satellite:{satelliteId:t,...e}})=>{let r=await tt({...e,canisterId:t,path:"juno:build"});return Cr(r)&&["stock","extended"].includes(r)?r:void 0};export{Kt as UpgradeCodeProgressStep,D as UpgradeCodeUnchangedError,jt as blobSha256,da as checkUpgradeVersion,xa as countAssets,Ua as countDocs,fa as deleteAssets,qa as deleteDocs,Fa as getAuthConfig,ca as getJunoPackage,Ha as listCustomDomains,Qr as listMissionControlControllers,jo as listOrbiterControllers,La as listRules,ka as listSatelliteControllers,qo as missionControlVersion,Zo as orbiterMemorySize,oa as orbiterVersion,ys as satelliteBuildType,gs as satelliteBuildVersion,Ja as satelliteMemorySize,_s as satelliteVersion,Aa as setAuthConfig,Wa as setCustomDomain,Ka as setCustomDomains,Oa as setDatastoreConfig,Zr as setMissionControlController,ts as setRule,wa as setSatelliteControllers,Xr as setSatellitesController,Ra as setStorageConfig,et as uint8ArraySha256,Mo as upgradeMissionControl,zo as upgradeModule,ta as upgradeOrbiter,ls as upgradeSatellite};
|
|
4
4
|
//# sourceMappingURL=index.mjs.map
|