@junobuild/storage 0.1.9 → 0.2.0-next-2025-05-25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +3 -3
- package/dist/declarations/console/console.did.d.ts +3 -3
- package/dist/declarations/console/console.factory.certified.did.js +7 -7
- package/dist/declarations/console/console.factory.did.js +8 -8
- package/dist/declarations/console/console.factory.did.mjs +8 -8
- package/dist/declarations/mission_control/mission_control.did.d.ts +430 -0
- package/dist/declarations/mission_control/mission_control.factory.certified.did.js +455 -0
- package/dist/declarations/mission_control/mission_control.factory.did.js +455 -0
- package/dist/node/index.mjs +1 -1
- package/dist/node/index.mjs.map +3 -3
- package/dist/types/api/storage.api.d.ts +12 -5
- package/package.json +7 -7
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
export const idlFactory = ({IDL}) => {
|
|
3
|
+
const CommitProposal = IDL.Record({
|
|
4
|
+
sha256: IDL.Vec(IDL.Nat8),
|
|
5
|
+
proposal_id: IDL.Nat
|
|
6
|
+
});
|
|
7
|
+
const CommitBatch = IDL.Record({
|
|
8
|
+
batch_id: IDL.Nat,
|
|
9
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
10
|
+
chunk_ids: IDL.Vec(IDL.Nat)
|
|
11
|
+
});
|
|
12
|
+
const CyclesThreshold = IDL.Record({
|
|
13
|
+
fund_cycles: IDL.Nat,
|
|
14
|
+
min_cycles: IDL.Nat
|
|
15
|
+
});
|
|
16
|
+
const CyclesMonitoringStrategy = IDL.Variant({
|
|
17
|
+
BelowThreshold: CyclesThreshold
|
|
18
|
+
});
|
|
19
|
+
const CyclesMonitoring = IDL.Record({
|
|
20
|
+
strategy: IDL.Opt(CyclesMonitoringStrategy),
|
|
21
|
+
enabled: IDL.Bool
|
|
22
|
+
});
|
|
23
|
+
const Monitoring = IDL.Record({cycles: IDL.Opt(CyclesMonitoring)});
|
|
24
|
+
const Settings = IDL.Record({monitoring: IDL.Opt(Monitoring)});
|
|
25
|
+
const Orbiter = IDL.Record({
|
|
26
|
+
updated_at: IDL.Nat64,
|
|
27
|
+
orbiter_id: IDL.Principal,
|
|
28
|
+
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
29
|
+
created_at: IDL.Nat64,
|
|
30
|
+
settings: IDL.Opt(Settings)
|
|
31
|
+
});
|
|
32
|
+
const CreateCanisterConfig = IDL.Record({
|
|
33
|
+
subnet_id: IDL.Opt(IDL.Principal),
|
|
34
|
+
name: IDL.Opt(IDL.Text)
|
|
35
|
+
});
|
|
36
|
+
const Satellite = IDL.Record({
|
|
37
|
+
updated_at: IDL.Nat64,
|
|
38
|
+
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
39
|
+
created_at: IDL.Nat64,
|
|
40
|
+
satellite_id: IDL.Principal,
|
|
41
|
+
settings: IDL.Opt(Settings)
|
|
42
|
+
});
|
|
43
|
+
const DeleteProposalAssets = IDL.Record({
|
|
44
|
+
proposal_ids: IDL.Vec(IDL.Nat)
|
|
45
|
+
});
|
|
46
|
+
const DepositCyclesArgs = IDL.Record({
|
|
47
|
+
cycles: IDL.Nat,
|
|
48
|
+
destination_id: IDL.Principal
|
|
49
|
+
});
|
|
50
|
+
const DepositedCyclesEmailNotification = IDL.Record({
|
|
51
|
+
to: IDL.Opt(IDL.Text),
|
|
52
|
+
enabled: IDL.Bool
|
|
53
|
+
});
|
|
54
|
+
const CyclesMonitoringConfig = IDL.Record({
|
|
55
|
+
notification: IDL.Opt(DepositedCyclesEmailNotification),
|
|
56
|
+
default_strategy: IDL.Opt(CyclesMonitoringStrategy)
|
|
57
|
+
});
|
|
58
|
+
const MonitoringConfig = IDL.Record({
|
|
59
|
+
cycles: IDL.Opt(CyclesMonitoringConfig)
|
|
60
|
+
});
|
|
61
|
+
const Config = IDL.Record({monitoring: IDL.Opt(MonitoringConfig)});
|
|
62
|
+
const GetMonitoringHistory = IDL.Record({
|
|
63
|
+
to: IDL.Opt(IDL.Nat64),
|
|
64
|
+
from: IDL.Opt(IDL.Nat64),
|
|
65
|
+
segment_id: IDL.Principal
|
|
66
|
+
});
|
|
67
|
+
const MonitoringHistoryKey = IDL.Record({
|
|
68
|
+
segment_id: IDL.Principal,
|
|
69
|
+
created_at: IDL.Nat64,
|
|
70
|
+
nonce: IDL.Int32
|
|
71
|
+
});
|
|
72
|
+
const CyclesBalance = IDL.Record({
|
|
73
|
+
timestamp: IDL.Nat64,
|
|
74
|
+
amount: IDL.Nat
|
|
75
|
+
});
|
|
76
|
+
const FundingErrorCode = IDL.Variant({
|
|
77
|
+
BalanceCheckFailed: IDL.Null,
|
|
78
|
+
ObtainCyclesFailed: IDL.Null,
|
|
79
|
+
DepositFailed: IDL.Null,
|
|
80
|
+
InsufficientCycles: IDL.Null,
|
|
81
|
+
Other: IDL.Text
|
|
82
|
+
});
|
|
83
|
+
const FundingFailure = IDL.Record({
|
|
84
|
+
timestamp: IDL.Nat64,
|
|
85
|
+
error_code: FundingErrorCode
|
|
86
|
+
});
|
|
87
|
+
const MonitoringHistoryCycles = IDL.Record({
|
|
88
|
+
deposited_cycles: IDL.Opt(CyclesBalance),
|
|
89
|
+
cycles: CyclesBalance,
|
|
90
|
+
funding_failure: IDL.Opt(FundingFailure)
|
|
91
|
+
});
|
|
92
|
+
const MonitoringHistory = IDL.Record({
|
|
93
|
+
cycles: IDL.Opt(MonitoringHistoryCycles)
|
|
94
|
+
});
|
|
95
|
+
const CyclesMonitoringStatus = IDL.Record({
|
|
96
|
+
monitored_ids: IDL.Vec(IDL.Principal),
|
|
97
|
+
running: IDL.Bool
|
|
98
|
+
});
|
|
99
|
+
const MonitoringStatus = IDL.Record({
|
|
100
|
+
cycles: IDL.Opt(CyclesMonitoringStatus)
|
|
101
|
+
});
|
|
102
|
+
const ProposalStatus = IDL.Variant({
|
|
103
|
+
Initialized: IDL.Null,
|
|
104
|
+
Failed: IDL.Null,
|
|
105
|
+
Open: IDL.Null,
|
|
106
|
+
Rejected: IDL.Null,
|
|
107
|
+
Executed: IDL.Null,
|
|
108
|
+
Accepted: IDL.Null
|
|
109
|
+
});
|
|
110
|
+
const AssetsUpgradeOptions = IDL.Record({
|
|
111
|
+
clear_existing_assets: IDL.Opt(IDL.Bool)
|
|
112
|
+
});
|
|
113
|
+
const SegmentsDeploymentOptions = IDL.Record({
|
|
114
|
+
orbiter: IDL.Opt(IDL.Text),
|
|
115
|
+
mission_control_version: IDL.Opt(IDL.Text),
|
|
116
|
+
satellite_version: IDL.Opt(IDL.Text)
|
|
117
|
+
});
|
|
118
|
+
const ProposalType = IDL.Variant({
|
|
119
|
+
AssetsUpgrade: AssetsUpgradeOptions,
|
|
120
|
+
SegmentsDeployment: SegmentsDeploymentOptions
|
|
121
|
+
});
|
|
122
|
+
const Proposal = IDL.Record({
|
|
123
|
+
status: ProposalStatus,
|
|
124
|
+
updated_at: IDL.Nat64,
|
|
125
|
+
sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
126
|
+
executed_at: IDL.Opt(IDL.Nat64),
|
|
127
|
+
owner: IDL.Principal,
|
|
128
|
+
created_at: IDL.Nat64,
|
|
129
|
+
version: IDL.Opt(IDL.Nat64),
|
|
130
|
+
proposal_type: ProposalType
|
|
131
|
+
});
|
|
132
|
+
const MissionControlSettings = IDL.Record({
|
|
133
|
+
updated_at: IDL.Nat64,
|
|
134
|
+
created_at: IDL.Nat64,
|
|
135
|
+
monitoring: IDL.Opt(Monitoring)
|
|
136
|
+
});
|
|
137
|
+
const StorageConfigIFrame = IDL.Variant({
|
|
138
|
+
Deny: IDL.Null,
|
|
139
|
+
AllowAny: IDL.Null,
|
|
140
|
+
SameOrigin: IDL.Null
|
|
141
|
+
});
|
|
142
|
+
const ConfigMaxMemorySize = IDL.Record({
|
|
143
|
+
stable: IDL.Opt(IDL.Nat64),
|
|
144
|
+
heap: IDL.Opt(IDL.Nat64)
|
|
145
|
+
});
|
|
146
|
+
const StorageConfigRawAccess = IDL.Variant({
|
|
147
|
+
Deny: IDL.Null,
|
|
148
|
+
Allow: IDL.Null
|
|
149
|
+
});
|
|
150
|
+
const StorageConfigRedirect = IDL.Record({
|
|
151
|
+
status_code: IDL.Nat16,
|
|
152
|
+
location: IDL.Text
|
|
153
|
+
});
|
|
154
|
+
const StorageConfig = IDL.Record({
|
|
155
|
+
iframe: IDL.Opt(StorageConfigIFrame),
|
|
156
|
+
rewrites: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
157
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)))),
|
|
158
|
+
max_memory_size: IDL.Opt(ConfigMaxMemorySize),
|
|
159
|
+
raw_access: IDL.Opt(StorageConfigRawAccess),
|
|
160
|
+
redirects: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, StorageConfigRedirect)))
|
|
161
|
+
});
|
|
162
|
+
const User = IDL.Record({
|
|
163
|
+
updated_at: IDL.Nat64,
|
|
164
|
+
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
165
|
+
user: IDL.Opt(IDL.Principal),
|
|
166
|
+
created_at: IDL.Nat64,
|
|
167
|
+
config: IDL.Opt(Config)
|
|
168
|
+
});
|
|
169
|
+
const HttpRequest = IDL.Record({
|
|
170
|
+
url: IDL.Text,
|
|
171
|
+
method: IDL.Text,
|
|
172
|
+
body: IDL.Vec(IDL.Nat8),
|
|
173
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
174
|
+
certificate_version: IDL.Opt(IDL.Nat16)
|
|
175
|
+
});
|
|
176
|
+
const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});
|
|
177
|
+
const StreamingCallbackToken = IDL.Record({
|
|
178
|
+
memory: Memory,
|
|
179
|
+
token: IDL.Opt(IDL.Text),
|
|
180
|
+
sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
181
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
182
|
+
index: IDL.Nat64,
|
|
183
|
+
encoding_type: IDL.Text,
|
|
184
|
+
full_path: IDL.Text
|
|
185
|
+
});
|
|
186
|
+
const StreamingStrategy = IDL.Variant({
|
|
187
|
+
Callback: IDL.Record({
|
|
188
|
+
token: StreamingCallbackToken,
|
|
189
|
+
callback: IDL.Func([], [], ['query'])
|
|
190
|
+
})
|
|
191
|
+
});
|
|
192
|
+
const HttpResponse = IDL.Record({
|
|
193
|
+
body: IDL.Vec(IDL.Nat8),
|
|
194
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
195
|
+
streaming_strategy: IDL.Opt(StreamingStrategy),
|
|
196
|
+
status_code: IDL.Nat16
|
|
197
|
+
});
|
|
198
|
+
const StreamingCallbackHttpResponse = IDL.Record({
|
|
199
|
+
token: IDL.Opt(StreamingCallbackToken),
|
|
200
|
+
body: IDL.Vec(IDL.Nat8)
|
|
201
|
+
});
|
|
202
|
+
const Tokens = IDL.Record({e8s: IDL.Nat64});
|
|
203
|
+
const Timestamp = IDL.Record({timestamp_nanos: IDL.Nat64});
|
|
204
|
+
const TransferArgs = IDL.Record({
|
|
205
|
+
to: IDL.Vec(IDL.Nat8),
|
|
206
|
+
fee: Tokens,
|
|
207
|
+
memo: IDL.Nat64,
|
|
208
|
+
from_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
209
|
+
created_at_time: IDL.Opt(Timestamp),
|
|
210
|
+
amount: Tokens
|
|
211
|
+
});
|
|
212
|
+
const TransferError = IDL.Variant({
|
|
213
|
+
TxTooOld: IDL.Record({allowed_window_nanos: IDL.Nat64}),
|
|
214
|
+
BadFee: IDL.Record({expected_fee: Tokens}),
|
|
215
|
+
TxDuplicate: IDL.Record({duplicate_of: IDL.Nat64}),
|
|
216
|
+
TxCreatedInFuture: IDL.Null,
|
|
217
|
+
InsufficientFunds: IDL.Record({balance: Tokens})
|
|
218
|
+
});
|
|
219
|
+
const Result = IDL.Variant({Ok: IDL.Nat64, Err: TransferError});
|
|
220
|
+
const Account = IDL.Record({
|
|
221
|
+
owner: IDL.Principal,
|
|
222
|
+
subaccount: IDL.Opt(IDL.Vec(IDL.Nat8))
|
|
223
|
+
});
|
|
224
|
+
const TransferArg = IDL.Record({
|
|
225
|
+
to: Account,
|
|
226
|
+
fee: IDL.Opt(IDL.Nat),
|
|
227
|
+
memo: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
228
|
+
from_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
229
|
+
created_at_time: IDL.Opt(IDL.Nat64),
|
|
230
|
+
amount: IDL.Nat
|
|
231
|
+
});
|
|
232
|
+
const TransferError_1 = IDL.Variant({
|
|
233
|
+
GenericError: IDL.Record({
|
|
234
|
+
message: IDL.Text,
|
|
235
|
+
error_code: IDL.Nat
|
|
236
|
+
}),
|
|
237
|
+
TemporarilyUnavailable: IDL.Null,
|
|
238
|
+
BadBurn: IDL.Record({min_burn_amount: IDL.Nat}),
|
|
239
|
+
Duplicate: IDL.Record({duplicate_of: IDL.Nat}),
|
|
240
|
+
BadFee: IDL.Record({expected_fee: IDL.Nat}),
|
|
241
|
+
CreatedInFuture: IDL.Record({ledger_time: IDL.Nat64}),
|
|
242
|
+
TooOld: IDL.Null,
|
|
243
|
+
InsufficientFunds: IDL.Record({balance: IDL.Nat})
|
|
244
|
+
});
|
|
245
|
+
const Result_1 = IDL.Variant({Ok: IDL.Nat, Err: TransferError_1});
|
|
246
|
+
const InitAssetKey = IDL.Record({
|
|
247
|
+
token: IDL.Opt(IDL.Text),
|
|
248
|
+
collection: IDL.Text,
|
|
249
|
+
name: IDL.Text,
|
|
250
|
+
description: IDL.Opt(IDL.Text),
|
|
251
|
+
encoding_type: IDL.Opt(IDL.Text),
|
|
252
|
+
full_path: IDL.Text
|
|
253
|
+
});
|
|
254
|
+
const InitUploadResult = IDL.Record({batch_id: IDL.Nat});
|
|
255
|
+
const ListOrderField = IDL.Variant({
|
|
256
|
+
UpdatedAt: IDL.Null,
|
|
257
|
+
Keys: IDL.Null,
|
|
258
|
+
CreatedAt: IDL.Null
|
|
259
|
+
});
|
|
260
|
+
const ListOrder = IDL.Record({field: ListOrderField, desc: IDL.Bool});
|
|
261
|
+
const TimestampMatcher = IDL.Variant({
|
|
262
|
+
Equal: IDL.Nat64,
|
|
263
|
+
Between: IDL.Tuple(IDL.Nat64, IDL.Nat64),
|
|
264
|
+
GreaterThan: IDL.Nat64,
|
|
265
|
+
LessThan: IDL.Nat64
|
|
266
|
+
});
|
|
267
|
+
const ListMatcher = IDL.Record({
|
|
268
|
+
key: IDL.Opt(IDL.Text),
|
|
269
|
+
updated_at: IDL.Opt(TimestampMatcher),
|
|
270
|
+
description: IDL.Opt(IDL.Text),
|
|
271
|
+
created_at: IDL.Opt(TimestampMatcher)
|
|
272
|
+
});
|
|
273
|
+
const ListPaginate = IDL.Record({
|
|
274
|
+
start_after: IDL.Opt(IDL.Text),
|
|
275
|
+
limit: IDL.Opt(IDL.Nat64)
|
|
276
|
+
});
|
|
277
|
+
const ListParams = IDL.Record({
|
|
278
|
+
order: IDL.Opt(ListOrder),
|
|
279
|
+
owner: IDL.Opt(IDL.Principal),
|
|
280
|
+
matcher: IDL.Opt(ListMatcher),
|
|
281
|
+
paginate: IDL.Opt(ListPaginate)
|
|
282
|
+
});
|
|
283
|
+
const AssetKey = IDL.Record({
|
|
284
|
+
token: IDL.Opt(IDL.Text),
|
|
285
|
+
collection: IDL.Text,
|
|
286
|
+
owner: IDL.Principal,
|
|
287
|
+
name: IDL.Text,
|
|
288
|
+
description: IDL.Opt(IDL.Text),
|
|
289
|
+
full_path: IDL.Text
|
|
290
|
+
});
|
|
291
|
+
const AssetEncodingNoContent = IDL.Record({
|
|
292
|
+
modified: IDL.Nat64,
|
|
293
|
+
sha256: IDL.Vec(IDL.Nat8),
|
|
294
|
+
total_length: IDL.Nat
|
|
295
|
+
});
|
|
296
|
+
const AssetNoContent = IDL.Record({
|
|
297
|
+
key: AssetKey,
|
|
298
|
+
updated_at: IDL.Nat64,
|
|
299
|
+
encodings: IDL.Vec(IDL.Tuple(IDL.Text, AssetEncodingNoContent)),
|
|
300
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
301
|
+
created_at: IDL.Nat64,
|
|
302
|
+
version: IDL.Opt(IDL.Nat64)
|
|
303
|
+
});
|
|
304
|
+
const ListResults = IDL.Record({
|
|
305
|
+
matches_pages: IDL.Opt(IDL.Nat64),
|
|
306
|
+
matches_length: IDL.Nat64,
|
|
307
|
+
items_page: IDL.Opt(IDL.Nat64),
|
|
308
|
+
items: IDL.Vec(IDL.Tuple(IDL.Text, AssetNoContent)),
|
|
309
|
+
items_length: IDL.Nat64
|
|
310
|
+
});
|
|
311
|
+
const CustomDomain = IDL.Record({
|
|
312
|
+
updated_at: IDL.Nat64,
|
|
313
|
+
created_at: IDL.Nat64,
|
|
314
|
+
version: IDL.Opt(IDL.Nat64),
|
|
315
|
+
bn_id: IDL.Opt(IDL.Text)
|
|
316
|
+
});
|
|
317
|
+
const ControllerScope = IDL.Variant({
|
|
318
|
+
Write: IDL.Null,
|
|
319
|
+
Admin: IDL.Null
|
|
320
|
+
});
|
|
321
|
+
const Controller = IDL.Record({
|
|
322
|
+
updated_at: IDL.Nat64,
|
|
323
|
+
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
324
|
+
created_at: IDL.Nat64,
|
|
325
|
+
scope: ControllerScope,
|
|
326
|
+
expires_at: IDL.Opt(IDL.Nat64)
|
|
327
|
+
});
|
|
328
|
+
const SetController = IDL.Record({
|
|
329
|
+
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
330
|
+
scope: ControllerScope,
|
|
331
|
+
expires_at: IDL.Opt(IDL.Nat64)
|
|
332
|
+
});
|
|
333
|
+
const SegmentsMonitoringStrategy = IDL.Record({
|
|
334
|
+
ids: IDL.Vec(IDL.Principal),
|
|
335
|
+
strategy: CyclesMonitoringStrategy
|
|
336
|
+
});
|
|
337
|
+
const CyclesMonitoringStartConfig = IDL.Record({
|
|
338
|
+
orbiters_strategy: IDL.Opt(SegmentsMonitoringStrategy),
|
|
339
|
+
mission_control_strategy: IDL.Opt(CyclesMonitoringStrategy),
|
|
340
|
+
satellites_strategy: IDL.Opt(SegmentsMonitoringStrategy)
|
|
341
|
+
});
|
|
342
|
+
const MonitoringStartConfig = IDL.Record({
|
|
343
|
+
cycles_config: IDL.Opt(CyclesMonitoringStartConfig)
|
|
344
|
+
});
|
|
345
|
+
const CyclesMonitoringStopConfig = IDL.Record({
|
|
346
|
+
satellite_ids: IDL.Opt(IDL.Vec(IDL.Principal)),
|
|
347
|
+
try_mission_control: IDL.Opt(IDL.Bool),
|
|
348
|
+
orbiter_ids: IDL.Opt(IDL.Vec(IDL.Principal))
|
|
349
|
+
});
|
|
350
|
+
const MonitoringStopConfig = IDL.Record({
|
|
351
|
+
cycles_config: IDL.Opt(CyclesMonitoringStopConfig)
|
|
352
|
+
});
|
|
353
|
+
const UploadChunk = IDL.Record({
|
|
354
|
+
content: IDL.Vec(IDL.Nat8),
|
|
355
|
+
batch_id: IDL.Nat,
|
|
356
|
+
order_id: IDL.Opt(IDL.Nat)
|
|
357
|
+
});
|
|
358
|
+
const UploadChunkResult = IDL.Record({chunk_id: IDL.Nat});
|
|
359
|
+
return IDL.Service({
|
|
360
|
+
add_mission_control_controllers: IDL.Func([IDL.Vec(IDL.Principal)], [], []),
|
|
361
|
+
add_satellites_controllers: IDL.Func([IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal)], [], []),
|
|
362
|
+
commit_proposal: IDL.Func([CommitProposal], [IDL.Null], []),
|
|
363
|
+
commit_proposal_asset_upload: IDL.Func([CommitBatch], [], []),
|
|
364
|
+
create_orbiter: IDL.Func([IDL.Opt(IDL.Text)], [Orbiter], []),
|
|
365
|
+
create_orbiter_with_config: IDL.Func([CreateCanisterConfig], [Orbiter], []),
|
|
366
|
+
create_satellite: IDL.Func([IDL.Text], [Satellite], []),
|
|
367
|
+
create_satellite_with_config: IDL.Func([CreateCanisterConfig], [Satellite], []),
|
|
368
|
+
del_custom_domain: IDL.Func([IDL.Text], [], []),
|
|
369
|
+
del_mission_control_controllers: IDL.Func([IDL.Vec(IDL.Principal)], [], []),
|
|
370
|
+
del_orbiter: IDL.Func([IDL.Principal, IDL.Nat], [], []),
|
|
371
|
+
del_orbiters_controllers: IDL.Func([IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal)], [], []),
|
|
372
|
+
del_satellite: IDL.Func([IDL.Principal, IDL.Nat], [], []),
|
|
373
|
+
del_satellites_controllers: IDL.Func([IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal)], [], []),
|
|
374
|
+
delete_proposal_assets: IDL.Func([DeleteProposalAssets], [], []),
|
|
375
|
+
deposit_cycles: IDL.Func([DepositCyclesArgs], [], []),
|
|
376
|
+
get_config: IDL.Func([], [IDL.Opt(Config)], ['query']),
|
|
377
|
+
get_metadata: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))], ['query']),
|
|
378
|
+
get_monitoring_history: IDL.Func(
|
|
379
|
+
[GetMonitoringHistory],
|
|
380
|
+
[IDL.Vec(IDL.Tuple(MonitoringHistoryKey, MonitoringHistory))],
|
|
381
|
+
['query']
|
|
382
|
+
),
|
|
383
|
+
get_monitoring_status: IDL.Func([], [MonitoringStatus], ['query']),
|
|
384
|
+
get_proposal: IDL.Func([IDL.Nat], [IDL.Opt(Proposal)], ['query']),
|
|
385
|
+
get_settings: IDL.Func([], [IDL.Opt(MissionControlSettings)], ['query']),
|
|
386
|
+
get_storage_config: IDL.Func([], [StorageConfig], ['query']),
|
|
387
|
+
get_user: IDL.Func([], [IDL.Principal], ['query']),
|
|
388
|
+
get_user_data: IDL.Func([], [User], ['query']),
|
|
389
|
+
http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),
|
|
390
|
+
http_request_streaming_callback: IDL.Func(
|
|
391
|
+
[StreamingCallbackToken],
|
|
392
|
+
[StreamingCallbackHttpResponse],
|
|
393
|
+
['query']
|
|
394
|
+
),
|
|
395
|
+
icp_transfer: IDL.Func([TransferArgs], [Result], []),
|
|
396
|
+
icrc_transfer: IDL.Func([IDL.Principal, TransferArg], [Result_1], []),
|
|
397
|
+
init_proposal: IDL.Func([ProposalType], [IDL.Nat, Proposal], []),
|
|
398
|
+
init_proposal_asset_upload: IDL.Func([InitAssetKey, IDL.Nat], [InitUploadResult], []),
|
|
399
|
+
list_assets: IDL.Func([IDL.Text, ListParams], [ListResults], ['query']),
|
|
400
|
+
list_custom_domains: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, CustomDomain))], ['query']),
|
|
401
|
+
list_mission_control_controllers: IDL.Func(
|
|
402
|
+
[],
|
|
403
|
+
[IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],
|
|
404
|
+
['query']
|
|
405
|
+
),
|
|
406
|
+
list_orbiters: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Orbiter))], ['query']),
|
|
407
|
+
list_satellites: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Satellite))], ['query']),
|
|
408
|
+
remove_mission_control_controllers: IDL.Func([IDL.Vec(IDL.Principal)], [], []),
|
|
409
|
+
remove_satellites_controllers: IDL.Func(
|
|
410
|
+
[IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal)],
|
|
411
|
+
[],
|
|
412
|
+
[]
|
|
413
|
+
),
|
|
414
|
+
set_config: IDL.Func([IDL.Opt(Config)], [], []),
|
|
415
|
+
set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),
|
|
416
|
+
set_metadata: IDL.Func([IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))], [], []),
|
|
417
|
+
set_mission_control_controllers: IDL.Func([IDL.Vec(IDL.Principal), SetController], [], []),
|
|
418
|
+
set_orbiter: IDL.Func([IDL.Principal, IDL.Opt(IDL.Text)], [Orbiter], []),
|
|
419
|
+
set_orbiter_metadata: IDL.Func(
|
|
420
|
+
[IDL.Principal, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],
|
|
421
|
+
[Orbiter],
|
|
422
|
+
[]
|
|
423
|
+
),
|
|
424
|
+
set_orbiters_controllers: IDL.Func(
|
|
425
|
+
[IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal), SetController],
|
|
426
|
+
[],
|
|
427
|
+
[]
|
|
428
|
+
),
|
|
429
|
+
set_satellite: IDL.Func([IDL.Principal, IDL.Opt(IDL.Text)], [Satellite], []),
|
|
430
|
+
set_satellite_metadata: IDL.Func(
|
|
431
|
+
[IDL.Principal, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],
|
|
432
|
+
[Satellite],
|
|
433
|
+
[]
|
|
434
|
+
),
|
|
435
|
+
set_satellites_controllers: IDL.Func(
|
|
436
|
+
[IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal), SetController],
|
|
437
|
+
[],
|
|
438
|
+
[]
|
|
439
|
+
),
|
|
440
|
+
set_storage_config: IDL.Func([StorageConfig], [], []),
|
|
441
|
+
start_monitoring: IDL.Func([], [], []),
|
|
442
|
+
stop_monitoring: IDL.Func([], [], []),
|
|
443
|
+
submit_proposal: IDL.Func([IDL.Nat], [IDL.Nat, Proposal], []),
|
|
444
|
+
top_up: IDL.Func([IDL.Principal, Tokens], [], []),
|
|
445
|
+
unset_orbiter: IDL.Func([IDL.Principal], [], []),
|
|
446
|
+
unset_satellite: IDL.Func([IDL.Principal], [], []),
|
|
447
|
+
update_and_start_monitoring: IDL.Func([MonitoringStartConfig], [], []),
|
|
448
|
+
update_and_stop_monitoring: IDL.Func([MonitoringStopConfig], [], []),
|
|
449
|
+
upload_proposal_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], [])
|
|
450
|
+
});
|
|
451
|
+
};
|
|
452
|
+
// @ts-ignore
|
|
453
|
+
export const init = ({IDL}) => {
|
|
454
|
+
return [];
|
|
455
|
+
};
|
package/dist/node/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as topLevelCreateRequire } from 'module';
|
|
2
2
|
const require = topLevelCreateRequire(import.meta.url);
|
|
3
|
-
import{toNullable as
|
|
3
|
+
import{toNullable as c}from"@dfinity/utils";import{isBrowser as m}from"@junobuild/utils";var U=async({asset:{data:t,headers:s,...o},actor:e})=>{let{init_asset_upload:a,upload_asset_chunk:n,commit_asset_upload:l}=e,{batch_id:r}=await a(d(o)),{chunkIds:i}=await h({data:t,uploadFn:n,batchId:r});await u({commitFn:l,batchId:r,data:t,headers:s,chunkIds:i})},_=async({asset:{data:t,headers:s,...o},proposalId:e,actor:a})=>{let{init_proposal_asset_upload:n,upload_proposal_asset_chunk:l,commit_proposal_asset_upload:r}=a,{batch_id:i}=await n(d(o),e),{chunkIds:p}=await h({data:t,uploadFn:l,batchId:i});await u({commitFn:r,batchId:i,data:t,headers:s,chunkIds:p})},d=({filename:t,collection:s,token:o,fullPath:e,encoding:a,description:n})=>({collection:s,full_path:e,name:t,token:c(o),encoding_type:c(a),description:c(n)}),u=async({commitFn:t,batchId:s,chunkIds:o,headers:e,data:a})=>{let n=e.find(([l,r])=>l.toLowerCase()==="content-type")===void 0&&a.type!==void 0&&a.type!==""?[["Content-Type",a.type]]:void 0;await t({batch_id:s,chunk_ids:o.map(({chunk_id:l})=>l),headers:[...e,...n??[]]})},h=async({data:t,uploadFn:s,batchId:o})=>{let a=[],n=m()?new Blob([await t.arrayBuffer()]):t,l=0n;for(let i=0;i<n.size;i+=19e5){let p=n.slice(i,i+19e5);a.push({batchId:o,chunk:p,uploadFn:s,orderId:l}),l++}let r=[];for await(let i of C({uploadChunks:a}))r=[...r,...i];return{chunkIds:r}};async function*C({uploadChunks:t,limit:s=12}){for(let o=0;o<t.length;o=o+s){let e=t.slice(o,o+s);yield await Promise.all(e.map(n=>k(n)))}}var k=async({batchId:t,chunk:s,uploadFn:o,orderId:e})=>o({batch_id:t,content:new Uint8Array(await s.arrayBuffer()),order_id:c(e)});export{U as uploadAsset,_ as uploadAssetWithProposal};
|
|
4
4
|
//# sourceMappingURL=index.mjs.map
|
package/dist/node/index.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/api/storage.api.ts"],
|
|
4
|
-
"sourcesContent": ["import {toNullable} from '@dfinity/utils';\nimport {isBrowser} from '@junobuild/utils';\nimport type {\n _SERVICE as ConsoleActor,\n InitAssetKey as ConsoleInitAssetKey,\n
|
|
5
|
-
"mappings": ";;AAAA,OAAQ,cAAAA,MAAiB,iBACzB,OAAQ,aAAAC,MAAgB,
|
|
6
|
-
"names": ["toNullable", "isBrowser", "uploadAsset", "data", "
|
|
4
|
+
"sourcesContent": ["import {toNullable} from '@dfinity/utils';\nimport {isBrowser} from '@junobuild/utils';\nimport type {\n _SERVICE as ConsoleActor,\n CommitBatch as ConsoleCommitBatch,\n InitAssetKey as ConsoleInitAssetKey,\n UploadChunk as ConsoleUploadChunk\n} from '../../declarations/console/console.did';\nimport type {\n _SERVICE as MissionControlActor,\n CommitBatch as MissionControlCommitBatch,\n InitAssetKey as MissionControlInitAssetKey,\n UploadChunk as MissionControlUploadChunk\n} from '../../declarations/mission_control/mission_control.did';\nimport type {\n _SERVICE as SatelliteActor,\n CommitBatch as SatelliteCommitBatch,\n InitAssetKey as SatelliteInitAssetKey,\n UploadChunk as SatelliteUploadChunk\n} from '../../declarations/satellite/satellite.did';\nimport type {ENCODING_TYPE, Storage} from '../types/storage.types';\n\nexport type UploadAsset = Required<Omit<Storage, 'token' | 'encoding' | 'description'>> &\n Pick<Storage, 'token' | 'encoding' | 'description'>;\n\nexport type UploadAssetActor = SatelliteActor;\nexport type UploadAssetWithProposalActor = ConsoleActor | MissionControlActor;\n\ntype InitAssetKey = SatelliteInitAssetKey | MissionControlInitAssetKey | ConsoleInitAssetKey;\ntype UploadChunk = SatelliteUploadChunk | MissionControlUploadChunk | ConsoleUploadChunk;\ntype CommitBatch = SatelliteCommitBatch | MissionControlCommitBatch | ConsoleCommitBatch;\n\nexport const uploadAsset = async ({\n asset: {data, headers, ...restAsset},\n actor\n}: {\n asset: UploadAsset;\n actor: UploadAssetActor;\n}): Promise<void> => {\n const {init_asset_upload, upload_asset_chunk, commit_asset_upload} = actor;\n\n const {batch_id: batchId} = await init_asset_upload(mapInitAssetUploadParams(restAsset));\n\n const {chunkIds} = await uploadChunks({data, uploadFn: upload_asset_chunk, batchId});\n\n await commitAsset({\n commitFn: commit_asset_upload,\n batchId,\n data,\n headers,\n chunkIds\n });\n};\n\nexport const uploadAssetWithProposal = async ({\n asset: {data, headers, ...restAsset},\n proposalId,\n actor\n}: {\n asset: UploadAsset;\n proposalId: bigint;\n actor: UploadAssetWithProposalActor;\n}): Promise<void> => {\n const {init_proposal_asset_upload, upload_proposal_asset_chunk, commit_proposal_asset_upload} =\n actor;\n\n const {batch_id: batchId} = await init_proposal_asset_upload(\n mapInitAssetUploadParams(restAsset),\n proposalId\n );\n\n const {chunkIds} = await uploadChunks({data, uploadFn: upload_proposal_asset_chunk, batchId});\n\n await commitAsset({\n commitFn: commit_proposal_asset_upload,\n batchId,\n data,\n headers,\n chunkIds\n });\n};\n\nconst mapInitAssetUploadParams = ({\n filename,\n collection,\n token,\n fullPath,\n encoding,\n description\n}: Omit<UploadAsset, 'headers' | 'data'>): InitAssetKey => ({\n collection,\n full_path: fullPath,\n name: filename,\n token: toNullable<string>(token),\n encoding_type: toNullable<ENCODING_TYPE>(encoding),\n description: toNullable(description)\n});\n\nconst commitAsset = async ({\n commitFn,\n batchId,\n chunkIds,\n headers,\n data\n}: {\n commitFn: (commitBatch: CommitBatch) => Promise<void>;\n batchId: bigint;\n chunkIds: UploadChunkResult[];\n} & Pick<UploadAsset, 'headers' | 'data'>) => {\n const contentType: [[string, string]] | undefined =\n headers.find(([type, _]) => type.toLowerCase() === 'content-type') === undefined &&\n data.type !== undefined &&\n data.type !== ''\n ? [['Content-Type', data.type]]\n : undefined;\n\n await commitFn({\n batch_id: batchId,\n chunk_ids: chunkIds.map(({chunk_id}: UploadChunkResult) => chunk_id),\n headers: [...headers, ...(contentType ?? [])]\n });\n};\n\nconst uploadChunks = async ({\n data,\n uploadFn,\n batchId\n}: {\n batchId: bigint;\n} & Pick<UploadAsset, 'data'> &\n Pick<UploadChunkParams, 'uploadFn'>): Promise<{chunkIds: UploadChunkResult[]}> => {\n // https://forum.dfinity.org/t/optimal-upload-chunk-size/20444/23?u=peterparker\n const chunkSize = 1900000;\n\n const uploadChunks: UploadChunkParams[] = [];\n\n // Prevent transforming chunk to arrayBuffer error: The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.\n const clone: Blob = isBrowser() ? new Blob([await data.arrayBuffer()]) : data;\n\n // Split data into chunks\n let orderId = 0n;\n for (let start = 0; start < clone.size; start += chunkSize) {\n const chunk: Blob = clone.slice(start, start + chunkSize);\n\n uploadChunks.push({\n batchId,\n chunk,\n uploadFn,\n orderId\n });\n\n orderId++;\n }\n\n // Upload chunks to the IC in batch - i.e. 12 chunks uploaded at a time.\n let chunkIds: UploadChunkResult[] = [];\n for await (const results of batchUploadChunks({uploadChunks})) {\n chunkIds = [...chunkIds, ...results];\n }\n\n return {chunkIds};\n};\n\nasync function* batchUploadChunks({\n uploadChunks,\n limit = 12\n}: {\n uploadChunks: UploadChunkParams[];\n limit?: number;\n}): AsyncGenerator<UploadChunkResult[], void> {\n for (let i = 0; i < uploadChunks.length; i = i + limit) {\n const batch = uploadChunks.slice(i, i + limit);\n const result = await Promise.all(batch.map((params) => uploadChunk(params)));\n yield result;\n }\n}\n\ninterface UploadChunkResult {\n chunk_id: bigint;\n}\n\ninterface UploadChunkParams {\n batchId: bigint;\n chunk: Blob;\n uploadFn: (uploadChunk: UploadChunk) => Promise<UploadChunkResult>;\n orderId: bigint;\n}\n\nconst uploadChunk = async ({\n batchId,\n chunk,\n uploadFn,\n orderId\n}: UploadChunkParams): Promise<UploadChunkResult> =>\n uploadFn({\n batch_id: batchId,\n content: new Uint8Array(await chunk.arrayBuffer()),\n order_id: toNullable(orderId)\n });\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["toNullable", "isBrowser", "uploadAsset", "data", "headers", "restAsset", "actor", "init_asset_upload", "upload_asset_chunk", "commit_asset_upload", "batchId", "mapInitAssetUploadParams", "chunkIds", "uploadChunks", "commitAsset", "uploadAssetWithProposal", "proposalId", "init_proposal_asset_upload", "upload_proposal_asset_chunk", "commit_proposal_asset_upload", "filename", "collection", "token", "fullPath", "encoding", "description", "commitFn", "contentType", "type", "_", "chunk_id", "uploadFn", "clone", "orderId", "start", "chunk", "results", "batchUploadChunks", "limit", "i", "batch", "params", "uploadChunk"]
|
|
7
7
|
}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import type { _SERVICE as ConsoleActor
|
|
2
|
-
import type { _SERVICE as
|
|
1
|
+
import type { _SERVICE as ConsoleActor } from '../../declarations/console/console.did';
|
|
2
|
+
import type { _SERVICE as MissionControlActor } from '../../declarations/mission_control/mission_control.did';
|
|
3
|
+
import type { _SERVICE as SatelliteActor } from '../../declarations/satellite/satellite.did';
|
|
3
4
|
import type { Storage } from '../types/storage.types';
|
|
4
5
|
export type UploadAsset = Required<Omit<Storage, 'token' | 'encoding' | 'description'>> & Pick<Storage, 'token' | 'encoding' | 'description'>;
|
|
5
|
-
export
|
|
6
|
+
export type UploadAssetActor = SatelliteActor;
|
|
7
|
+
export type UploadAssetWithProposalActor = ConsoleActor | MissionControlActor;
|
|
8
|
+
export declare const uploadAsset: ({ asset: { data, headers, ...restAsset }, actor }: {
|
|
6
9
|
asset: UploadAsset;
|
|
7
|
-
actor:
|
|
8
|
-
|
|
10
|
+
actor: UploadAssetActor;
|
|
11
|
+
}) => Promise<void>;
|
|
12
|
+
export declare const uploadAssetWithProposal: ({ asset: { data, headers, ...restAsset }, proposalId, actor }: {
|
|
13
|
+
asset: UploadAsset;
|
|
14
|
+
proposalId: bigint;
|
|
15
|
+
actor: UploadAssetWithProposalActor;
|
|
9
16
|
}) => Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@junobuild/storage",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0-next-2025-05-25",
|
|
4
4
|
"description": "A library for interfacing with Juno's Storage features.",
|
|
5
5
|
"author": "David Dal Busco (https://daviddalbusco.com)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -47,11 +47,11 @@
|
|
|
47
47
|
],
|
|
48
48
|
"homepage": "https://juno.build",
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@dfinity/agent": "
|
|
51
|
-
"@dfinity/candid": "
|
|
52
|
-
"@dfinity/identity": "
|
|
53
|
-
"@dfinity/principal": "
|
|
54
|
-
"@dfinity/utils": "
|
|
50
|
+
"@dfinity/agent": "*",
|
|
51
|
+
"@dfinity/candid": "*",
|
|
52
|
+
"@dfinity/identity": "*",
|
|
53
|
+
"@dfinity/principal": "*",
|
|
54
|
+
"@dfinity/utils": "*",
|
|
55
55
|
"@junobuild/utils": "*"
|
|
56
56
|
}
|
|
57
|
-
}
|
|
57
|
+
}
|