@junobuild/storage 0.0.3 → 0.0.4

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.
@@ -0,0 +1,284 @@
1
+ // @ts-ignore
2
+ export const idlFactory = ({IDL}) => {
3
+ const Tokens = IDL.Record({e8s: IDL.Nat64});
4
+ const AssertMissionControlCenterArgs = IDL.Record({
5
+ mission_control_id: IDL.Principal,
6
+ user: IDL.Principal
7
+ });
8
+ const CommitBatch = IDL.Record({
9
+ batch_id: IDL.Nat,
10
+ headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
11
+ chunk_ids: IDL.Vec(IDL.Nat)
12
+ });
13
+ const CommitProposal = IDL.Record({
14
+ sha256: IDL.Vec(IDL.Nat8),
15
+ proposal_id: IDL.Nat
16
+ });
17
+ const CreateCanisterArgs = IDL.Record({
18
+ block_index: IDL.Opt(IDL.Nat64),
19
+ user: IDL.Principal
20
+ });
21
+ const DeleteControllersArgs = IDL.Record({
22
+ controllers: IDL.Vec(IDL.Principal)
23
+ });
24
+ const DeleteProposalAssets = IDL.Record({
25
+ proposal_ids: IDL.Vec(IDL.Nat)
26
+ });
27
+ const StorageConfigIFrame = IDL.Variant({
28
+ Deny: IDL.Null,
29
+ AllowAny: IDL.Null,
30
+ SameOrigin: IDL.Null
31
+ });
32
+ const ConfigMaxMemorySize = IDL.Record({
33
+ stable: IDL.Opt(IDL.Nat64),
34
+ heap: IDL.Opt(IDL.Nat64)
35
+ });
36
+ const StorageConfigRawAccess = IDL.Variant({
37
+ Deny: IDL.Null,
38
+ Allow: IDL.Null
39
+ });
40
+ const StorageConfigRedirect = IDL.Record({
41
+ status_code: IDL.Nat16,
42
+ location: IDL.Text
43
+ });
44
+ const StorageConfig = IDL.Record({
45
+ iframe: IDL.Opt(StorageConfigIFrame),
46
+ rewrites: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
47
+ headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)))),
48
+ max_memory_size: IDL.Opt(ConfigMaxMemorySize),
49
+ raw_access: IDL.Opt(StorageConfigRawAccess),
50
+ redirects: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, StorageConfigRedirect)))
51
+ });
52
+ const Config = IDL.Record({storage: StorageConfig});
53
+ const GetCreateCanisterFeeArgs = IDL.Record({user: IDL.Principal});
54
+ const ProposalStatus = IDL.Variant({
55
+ Initialized: IDL.Null,
56
+ Failed: IDL.Null,
57
+ Open: IDL.Null,
58
+ Rejected: IDL.Null,
59
+ Executed: IDL.Null,
60
+ Accepted: IDL.Null
61
+ });
62
+ const AssetsUpgradeOptions = IDL.Record({
63
+ clear_existing_assets: IDL.Opt(IDL.Bool)
64
+ });
65
+ const SegmentsDeploymentOptions = IDL.Record({
66
+ orbiter: IDL.Opt(IDL.Text),
67
+ mission_control_version: IDL.Opt(IDL.Text),
68
+ satellite_version: IDL.Opt(IDL.Text)
69
+ });
70
+ const ProposalType = IDL.Variant({
71
+ AssetsUpgrade: AssetsUpgradeOptions,
72
+ SegmentsDeployment: SegmentsDeploymentOptions
73
+ });
74
+ const Proposal = IDL.Record({
75
+ status: ProposalStatus,
76
+ updated_at: IDL.Nat64,
77
+ sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),
78
+ executed_at: IDL.Opt(IDL.Nat64),
79
+ owner: IDL.Principal,
80
+ created_at: IDL.Nat64,
81
+ version: IDL.Opt(IDL.Nat64),
82
+ proposal_type: ProposalType
83
+ });
84
+ const MissionControl = IDL.Record({
85
+ updated_at: IDL.Nat64,
86
+ credits: Tokens,
87
+ mission_control_id: IDL.Opt(IDL.Principal),
88
+ owner: IDL.Principal,
89
+ created_at: IDL.Nat64
90
+ });
91
+ const HttpRequest = IDL.Record({
92
+ url: IDL.Text,
93
+ method: IDL.Text,
94
+ body: IDL.Vec(IDL.Nat8),
95
+ headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
96
+ certificate_version: IDL.Opt(IDL.Nat16)
97
+ });
98
+ const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});
99
+ const StreamingCallbackToken = IDL.Record({
100
+ memory: Memory,
101
+ token: IDL.Opt(IDL.Text),
102
+ sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),
103
+ headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
104
+ index: IDL.Nat64,
105
+ encoding_type: IDL.Text,
106
+ full_path: IDL.Text
107
+ });
108
+ const StreamingStrategy = IDL.Variant({
109
+ Callback: IDL.Record({
110
+ token: StreamingCallbackToken,
111
+ callback: IDL.Func([], [], ['query'])
112
+ })
113
+ });
114
+ const HttpResponse = IDL.Record({
115
+ body: IDL.Vec(IDL.Nat8),
116
+ headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
117
+ streaming_strategy: IDL.Opt(StreamingStrategy),
118
+ status_code: IDL.Nat16
119
+ });
120
+ const StreamingCallbackHttpResponse = IDL.Record({
121
+ token: IDL.Opt(StreamingCallbackToken),
122
+ body: IDL.Vec(IDL.Nat8)
123
+ });
124
+ const InitAssetKey = IDL.Record({
125
+ token: IDL.Opt(IDL.Text),
126
+ collection: IDL.Text,
127
+ name: IDL.Text,
128
+ description: IDL.Opt(IDL.Text),
129
+ encoding_type: IDL.Opt(IDL.Text),
130
+ full_path: IDL.Text
131
+ });
132
+ const InitUploadResult = IDL.Record({batch_id: IDL.Nat});
133
+ const ListOrderField = IDL.Variant({
134
+ UpdatedAt: IDL.Null,
135
+ Keys: IDL.Null,
136
+ CreatedAt: IDL.Null
137
+ });
138
+ const ListOrder = IDL.Record({field: ListOrderField, desc: IDL.Bool});
139
+ const TimestampMatcher = IDL.Variant({
140
+ Equal: IDL.Nat64,
141
+ Between: IDL.Tuple(IDL.Nat64, IDL.Nat64),
142
+ GreaterThan: IDL.Nat64,
143
+ LessThan: IDL.Nat64
144
+ });
145
+ const ListMatcher = IDL.Record({
146
+ key: IDL.Opt(IDL.Text),
147
+ updated_at: IDL.Opt(TimestampMatcher),
148
+ description: IDL.Opt(IDL.Text),
149
+ created_at: IDL.Opt(TimestampMatcher)
150
+ });
151
+ const ListPaginate = IDL.Record({
152
+ start_after: IDL.Opt(IDL.Text),
153
+ limit: IDL.Opt(IDL.Nat64)
154
+ });
155
+ const ListParams = IDL.Record({
156
+ order: IDL.Opt(ListOrder),
157
+ owner: IDL.Opt(IDL.Principal),
158
+ matcher: IDL.Opt(ListMatcher),
159
+ paginate: IDL.Opt(ListPaginate)
160
+ });
161
+ const AssetKey = IDL.Record({
162
+ token: IDL.Opt(IDL.Text),
163
+ collection: IDL.Text,
164
+ owner: IDL.Principal,
165
+ name: IDL.Text,
166
+ description: IDL.Opt(IDL.Text),
167
+ full_path: IDL.Text
168
+ });
169
+ const AssetEncodingNoContent = IDL.Record({
170
+ modified: IDL.Nat64,
171
+ sha256: IDL.Vec(IDL.Nat8),
172
+ total_length: IDL.Nat
173
+ });
174
+ const AssetNoContent = IDL.Record({
175
+ key: AssetKey,
176
+ updated_at: IDL.Nat64,
177
+ encodings: IDL.Vec(IDL.Tuple(IDL.Text, AssetEncodingNoContent)),
178
+ headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
179
+ created_at: IDL.Nat64,
180
+ version: IDL.Opt(IDL.Nat64)
181
+ });
182
+ const ListResults = IDL.Record({
183
+ matches_pages: IDL.Opt(IDL.Nat64),
184
+ matches_length: IDL.Nat64,
185
+ items_page: IDL.Opt(IDL.Nat64),
186
+ items: IDL.Vec(IDL.Tuple(IDL.Text, AssetNoContent)),
187
+ items_length: IDL.Nat64
188
+ });
189
+ const CustomDomain = IDL.Record({
190
+ updated_at: IDL.Nat64,
191
+ created_at: IDL.Nat64,
192
+ version: IDL.Opt(IDL.Nat64),
193
+ bn_id: IDL.Opt(IDL.Text)
194
+ });
195
+ const PaymentStatus = IDL.Variant({
196
+ Refunded: IDL.Null,
197
+ Acknowledged: IDL.Null,
198
+ Completed: IDL.Null
199
+ });
200
+ const Payment = IDL.Record({
201
+ status: PaymentStatus,
202
+ updated_at: IDL.Nat64,
203
+ block_index_payment: IDL.Nat64,
204
+ mission_control_id: IDL.Opt(IDL.Principal),
205
+ created_at: IDL.Nat64,
206
+ block_index_refunded: IDL.Opt(IDL.Nat64)
207
+ });
208
+ const ControllerScope = IDL.Variant({
209
+ Write: IDL.Null,
210
+ Admin: IDL.Null
211
+ });
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 SegmentType = IDL.Variant({
222
+ Orbiter: IDL.Null,
223
+ MissionControl: IDL.Null,
224
+ Satellite: IDL.Null
225
+ });
226
+ const RateConfig = IDL.Record({
227
+ max_tokens: IDL.Nat64,
228
+ time_per_token_ns: IDL.Nat64
229
+ });
230
+ const UploadChunk = IDL.Record({
231
+ content: IDL.Vec(IDL.Nat8),
232
+ batch_id: IDL.Nat,
233
+ order_id: IDL.Opt(IDL.Nat)
234
+ });
235
+ const UploadChunkResult = IDL.Record({chunk_id: IDL.Nat});
236
+ return IDL.Service({
237
+ add_credits: IDL.Func([IDL.Principal, Tokens], [], []),
238
+ add_invitation_code: IDL.Func([IDL.Text], [], []),
239
+ assert_mission_control_center: IDL.Func([AssertMissionControlCenterArgs], [], ['query']),
240
+ commit_asset_upload: IDL.Func([CommitBatch], [], []),
241
+ commit_proposal: IDL.Func([CommitProposal], [IDL.Null], []),
242
+ create_orbiter: IDL.Func([CreateCanisterArgs], [IDL.Principal], []),
243
+ create_satellite: IDL.Func([CreateCanisterArgs], [IDL.Principal], []),
244
+ del_controllers: IDL.Func([DeleteControllersArgs], [], []),
245
+ del_custom_domain: IDL.Func([IDL.Text], [], []),
246
+ delete_proposal_assets: IDL.Func([DeleteProposalAssets], [], []),
247
+ get_config: IDL.Func([], [Config], []),
248
+ get_create_orbiter_fee: IDL.Func([GetCreateCanisterFeeArgs], [IDL.Opt(Tokens)], ['query']),
249
+ get_create_satellite_fee: IDL.Func([GetCreateCanisterFeeArgs], [IDL.Opt(Tokens)], ['query']),
250
+ get_credits: IDL.Func([], [Tokens], ['query']),
251
+ get_proposal: IDL.Func([IDL.Nat], [IDL.Opt(Proposal)], ['query']),
252
+ get_storage_config: IDL.Func([], [StorageConfig], ['query']),
253
+ get_user_mission_control_center: IDL.Func([], [IDL.Opt(MissionControl)], ['query']),
254
+ http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),
255
+ http_request_streaming_callback: IDL.Func(
256
+ [StreamingCallbackToken],
257
+ [StreamingCallbackHttpResponse],
258
+ ['query']
259
+ ),
260
+ init_asset_upload: IDL.Func([InitAssetKey, IDL.Nat], [InitUploadResult], []),
261
+ init_proposal: IDL.Func([ProposalType], [IDL.Nat, Proposal], []),
262
+ init_user_mission_control_center: IDL.Func([], [MissionControl], []),
263
+ list_assets: IDL.Func([IDL.Text, ListParams], [ListResults], ['query']),
264
+ list_custom_domains: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, CustomDomain))], ['query']),
265
+ list_payments: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Nat64, Payment))], ['query']),
266
+ list_user_mission_control_centers: IDL.Func(
267
+ [],
268
+ [IDL.Vec(IDL.Tuple(IDL.Principal, MissionControl))],
269
+ ['query']
270
+ ),
271
+ set_controllers: IDL.Func([SetControllersArgs], [], []),
272
+ set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),
273
+ set_fee: IDL.Func([SegmentType, Tokens], [], []),
274
+ set_storage_config: IDL.Func([StorageConfig], [], []),
275
+ submit_proposal: IDL.Func([IDL.Nat], [IDL.Nat, Proposal], []),
276
+ update_rate_config: IDL.Func([SegmentType, RateConfig], [], []),
277
+ upload_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], []),
278
+ version: IDL.Func([], [IDL.Text], ['query'])
279
+ });
280
+ };
281
+ // @ts-ignore
282
+ export const init = ({IDL}) => {
283
+ return [];
284
+ };
@@ -0,0 +1,80 @@
1
+ import type {ActorMethod} from '@dfinity/agent';
2
+ import type {Principal} from '@dfinity/principal';
3
+
4
+ export interface CanisterStatusResponse {
5
+ status: CanisterStatusType;
6
+ memory_size: bigint;
7
+ cycles: bigint;
8
+ settings: DefiniteCanisterSettings;
9
+ idle_cycles_burned_per_day: bigint;
10
+ module_hash: [] | [Uint8Array | number[]];
11
+ }
12
+ export type CanisterStatusType = {stopped: null} | {stopping: null} | {running: null};
13
+ export interface Controller {
14
+ updated_at: bigint;
15
+ metadata: Array<[string, string]>;
16
+ created_at: bigint;
17
+ expires_at: [] | [bigint];
18
+ }
19
+ export interface CronJobStatusesSatelliteConfig {
20
+ enabled: boolean;
21
+ cycles_threshold: [] | [bigint];
22
+ }
23
+ export interface DefiniteCanisterSettings {
24
+ freezing_threshold: bigint;
25
+ controllers: Array<Principal>;
26
+ memory_allocation: bigint;
27
+ compute_allocation: bigint;
28
+ }
29
+ export type Result = {Ok: SegmentStatus} | {Err: string};
30
+ export interface Satellite {
31
+ updated_at: bigint;
32
+ metadata: Array<[string, string]>;
33
+ created_at: bigint;
34
+ satellite_id: Principal;
35
+ }
36
+ export interface SegmentStatus {
37
+ id: Principal;
38
+ status: CanisterStatusResponse;
39
+ metadata: [] | [Array<[string, string]>];
40
+ status_at: bigint;
41
+ }
42
+ export interface SegmentsStatuses {
43
+ satellites: [] | [Array<Result>];
44
+ mission_control: Result;
45
+ }
46
+ export interface SetController {
47
+ metadata: Array<[string, string]>;
48
+ expires_at: [] | [bigint];
49
+ }
50
+ export interface StatusesArgs {
51
+ mission_control_cycles_threshold: [] | [bigint];
52
+ satellites: Array<[Principal, CronJobStatusesSatelliteConfig]>;
53
+ cycles_threshold: [] | [bigint];
54
+ }
55
+ export interface Tokens {
56
+ e8s: bigint;
57
+ }
58
+ export interface _SERVICE {
59
+ add_mission_control_controllers: ActorMethod<[Array<Principal>], undefined>;
60
+ add_satellites_controllers: ActorMethod<[Array<Principal>, Array<Principal>], undefined>;
61
+ create_satellite: ActorMethod<[string], Satellite>;
62
+ del_mission_control_controllers: ActorMethod<[Array<Principal>], undefined>;
63
+ del_satellites_controllers: ActorMethod<[Array<Principal>, Array<Principal>], undefined>;
64
+ get_user: ActorMethod<[], Principal>;
65
+ list_mission_control_controllers: ActorMethod<[], Array<[Principal, Controller]>>;
66
+ list_mission_control_statuses: ActorMethod<[], Array<[bigint, Result]>>;
67
+ list_satellite_statuses: ActorMethod<[Principal], [] | [Array<[bigint, Result]>]>;
68
+ list_satellites: ActorMethod<[], Array<[Principal, Satellite]>>;
69
+ remove_mission_control_controllers: ActorMethod<[Array<Principal>], undefined>;
70
+ remove_satellites_controllers: ActorMethod<[Array<Principal>, Array<Principal>], undefined>;
71
+ set_metadata: ActorMethod<[Array<[string, string]>], undefined>;
72
+ set_mission_control_controllers: ActorMethod<[Array<Principal>, SetController], undefined>;
73
+ set_satellites_controllers: ActorMethod<
74
+ [Array<Principal>, Array<Principal>, SetController],
75
+ undefined
76
+ >;
77
+ status: ActorMethod<[StatusesArgs], SegmentsStatuses>;
78
+ top_up: ActorMethod<[Principal, Tokens], undefined>;
79
+ version: ActorMethod<[], string>;
80
+ }
@@ -0,0 +1,99 @@
1
+ // @ts-ignore
2
+ export const idlFactory = ({IDL}) => {
3
+ const Satellite = IDL.Record({
4
+ updated_at: IDL.Nat64,
5
+ metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
6
+ created_at: IDL.Nat64,
7
+ satellite_id: IDL.Principal
8
+ });
9
+ const Controller = IDL.Record({
10
+ updated_at: IDL.Nat64,
11
+ metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
12
+ created_at: IDL.Nat64,
13
+ expires_at: IDL.Opt(IDL.Nat64)
14
+ });
15
+ const CanisterStatusType = IDL.Variant({
16
+ stopped: IDL.Null,
17
+ stopping: IDL.Null,
18
+ running: IDL.Null
19
+ });
20
+ const DefiniteCanisterSettings = IDL.Record({
21
+ freezing_threshold: IDL.Nat,
22
+ controllers: IDL.Vec(IDL.Principal),
23
+ memory_allocation: IDL.Nat,
24
+ compute_allocation: IDL.Nat
25
+ });
26
+ const CanisterStatusResponse = IDL.Record({
27
+ status: CanisterStatusType,
28
+ memory_size: IDL.Nat,
29
+ cycles: IDL.Nat,
30
+ settings: DefiniteCanisterSettings,
31
+ idle_cycles_burned_per_day: IDL.Nat,
32
+ module_hash: IDL.Opt(IDL.Vec(IDL.Nat8))
33
+ });
34
+ const SegmentStatus = IDL.Record({
35
+ id: IDL.Principal,
36
+ status: CanisterStatusResponse,
37
+ metadata: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))),
38
+ status_at: IDL.Nat64
39
+ });
40
+ const Result = IDL.Variant({Ok: SegmentStatus, Err: IDL.Text});
41
+ const SetController = IDL.Record({
42
+ metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
43
+ expires_at: IDL.Opt(IDL.Nat64)
44
+ });
45
+ const CronJobStatusesSatelliteConfig = IDL.Record({
46
+ enabled: IDL.Bool,
47
+ cycles_threshold: IDL.Opt(IDL.Nat64)
48
+ });
49
+ const StatusesArgs = IDL.Record({
50
+ mission_control_cycles_threshold: IDL.Opt(IDL.Nat64),
51
+ satellites: IDL.Vec(IDL.Tuple(IDL.Principal, CronJobStatusesSatelliteConfig)),
52
+ cycles_threshold: IDL.Opt(IDL.Nat64)
53
+ });
54
+ const SegmentsStatuses = IDL.Record({
55
+ satellites: IDL.Opt(IDL.Vec(Result)),
56
+ mission_control: Result
57
+ });
58
+ const Tokens = IDL.Record({e8s: IDL.Nat64});
59
+ return IDL.Service({
60
+ add_mission_control_controllers: IDL.Func([IDL.Vec(IDL.Principal)], [], []),
61
+ add_satellites_controllers: IDL.Func([IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal)], [], []),
62
+ create_satellite: IDL.Func([IDL.Text], [Satellite], []),
63
+ del_mission_control_controllers: IDL.Func([IDL.Vec(IDL.Principal)], [], []),
64
+ del_satellites_controllers: IDL.Func([IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal)], [], []),
65
+ get_user: IDL.Func([], [IDL.Principal], ['query']),
66
+ list_mission_control_controllers: IDL.Func(
67
+ [],
68
+ [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],
69
+ ['query']
70
+ ),
71
+ list_mission_control_statuses: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Nat64, Result))], ['query']),
72
+ list_satellite_statuses: IDL.Func(
73
+ [IDL.Principal],
74
+ [IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Nat64, Result)))],
75
+ ['query']
76
+ ),
77
+ list_satellites: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Satellite))], ['query']),
78
+ remove_mission_control_controllers: IDL.Func([IDL.Vec(IDL.Principal)], [], []),
79
+ remove_satellites_controllers: IDL.Func(
80
+ [IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal)],
81
+ [],
82
+ []
83
+ ),
84
+ set_metadata: IDL.Func([IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))], [], []),
85
+ set_mission_control_controllers: IDL.Func([IDL.Vec(IDL.Principal), SetController], [], []),
86
+ set_satellites_controllers: IDL.Func(
87
+ [IDL.Vec(IDL.Principal), IDL.Vec(IDL.Principal), SetController],
88
+ [],
89
+ []
90
+ ),
91
+ status: IDL.Func([StatusesArgs], [SegmentsStatuses], []),
92
+ top_up: IDL.Func([IDL.Principal, Tokens], [], []),
93
+ version: IDL.Func([], [IDL.Text], ['query'])
94
+ });
95
+ };
96
+ // @ts-ignore
97
+ export const init = ({IDL}) => {
98
+ return [];
99
+ };
@@ -0,0 +1,183 @@
1
+ import type {ActorMethod} from '@dfinity/agent';
2
+ import type {Principal} from '@dfinity/principal';
3
+
4
+ export interface AssetEncodingNoContent {
5
+ modified: bigint;
6
+ sha256: Uint8Array | number[];
7
+ total_length: bigint;
8
+ }
9
+ export interface AssetKey {
10
+ token: [] | [string];
11
+ collection: string;
12
+ owner: Principal;
13
+ name: string;
14
+ full_path: string;
15
+ }
16
+ export interface AssetNoContent {
17
+ key: AssetKey;
18
+ updated_at: bigint;
19
+ encodings: Array<[string, AssetEncodingNoContent]>;
20
+ headers: Array<[string, string]>;
21
+ created_at: bigint;
22
+ }
23
+ export interface Chunk {
24
+ content: Uint8Array | number[];
25
+ batch_id: bigint;
26
+ }
27
+ export interface CommitBatch {
28
+ batch_id: bigint;
29
+ headers: Array<[string, string]>;
30
+ chunk_ids: Array<bigint>;
31
+ }
32
+ export interface Config {
33
+ storage: StorageConfig;
34
+ }
35
+ export interface Controller {
36
+ updated_at: bigint;
37
+ metadata: Array<[string, string]>;
38
+ created_at: bigint;
39
+ expires_at: [] | [bigint];
40
+ }
41
+ export interface CustomDomain {
42
+ updated_at: bigint;
43
+ created_at: bigint;
44
+ bn_id: [] | [string];
45
+ }
46
+ export interface DelDoc {
47
+ updated_at: [] | [bigint];
48
+ }
49
+ export interface DeleteControllersArgs {
50
+ controllers: Array<Principal>;
51
+ }
52
+ export interface Doc {
53
+ updated_at: bigint;
54
+ owner: Principal;
55
+ data: Uint8Array | number[];
56
+ created_at: bigint;
57
+ }
58
+ export interface HttpRequest {
59
+ url: string;
60
+ method: string;
61
+ body: Uint8Array | number[];
62
+ headers: Array<[string, string]>;
63
+ }
64
+ export interface HttpResponse {
65
+ body: Uint8Array | number[];
66
+ headers: Array<[string, string]>;
67
+ streaming_strategy: [] | [StreamingStrategy];
68
+ status_code: number;
69
+ }
70
+ export interface InitAssetKey {
71
+ token: [] | [string];
72
+ collection: string;
73
+ name: string;
74
+ encoding_type: [] | [string];
75
+ full_path: string;
76
+ }
77
+ export interface InitUploadResult {
78
+ batch_id: bigint;
79
+ }
80
+ export interface ListOrder {
81
+ field: ListOrderField;
82
+ desc: boolean;
83
+ }
84
+ export type ListOrderField = {UpdatedAt: null} | {Keys: null} | {CreatedAt: null};
85
+ export interface ListPaginate {
86
+ start_after: [] | [string];
87
+ limit: [] | [bigint];
88
+ }
89
+ export interface ListParams {
90
+ order: [] | [ListOrder];
91
+ owner: [] | [Principal];
92
+ matcher: [] | [string];
93
+ paginate: [] | [ListPaginate];
94
+ }
95
+ export interface ListResults {
96
+ matches_length: bigint;
97
+ length: bigint;
98
+ items: Array<[string, AssetNoContent]>;
99
+ }
100
+ export interface ListResults_1 {
101
+ matches_length: bigint;
102
+ length: bigint;
103
+ items: Array<[string, Doc]>;
104
+ }
105
+ export type Permission = {Controllers: null} | {Private: null} | {Public: null} | {Managed: null};
106
+ export interface Rule {
107
+ updated_at: bigint;
108
+ max_size: [] | [bigint];
109
+ read: Permission;
110
+ created_at: bigint;
111
+ write: Permission;
112
+ }
113
+ export type RulesType = {Db: null} | {Storage: null};
114
+ export interface SetController {
115
+ metadata: Array<[string, string]>;
116
+ expires_at: [] | [bigint];
117
+ }
118
+ export interface SetControllersArgs {
119
+ controller: SetController;
120
+ controllers: Array<Principal>;
121
+ }
122
+ export interface SetDoc {
123
+ updated_at: [] | [bigint];
124
+ data: Uint8Array | number[];
125
+ }
126
+ export interface SetRule {
127
+ updated_at: [] | [bigint];
128
+ max_size: [] | [bigint];
129
+ read: Permission;
130
+ write: Permission;
131
+ }
132
+ export interface StorageConfig {
133
+ headers: Array<[string, Array<[string, string]>]>;
134
+ }
135
+ export interface StreamingCallbackHttpResponse {
136
+ token: [] | [StreamingCallbackToken];
137
+ body: Uint8Array | number[];
138
+ }
139
+ export interface StreamingCallbackToken {
140
+ token: [] | [string];
141
+ sha256: [] | [Uint8Array | number[]];
142
+ headers: Array<[string, string]>;
143
+ index: bigint;
144
+ encoding_type: string;
145
+ full_path: string;
146
+ }
147
+ export type StreamingStrategy = {
148
+ Callback: {
149
+ token: StreamingCallbackToken;
150
+ callback: [Principal, string];
151
+ };
152
+ };
153
+ export interface UploadChunk {
154
+ chunk_id: bigint;
155
+ }
156
+ export interface _SERVICE {
157
+ commit_asset_upload: ActorMethod<[CommitBatch], undefined>;
158
+ del_asset: ActorMethod<[string, string], undefined>;
159
+ del_assets: ActorMethod<[[] | [string]], undefined>;
160
+ del_controllers: ActorMethod<[DeleteControllersArgs], Array<[Principal, Controller]>>;
161
+ del_custom_domain: ActorMethod<[string], undefined>;
162
+ del_doc: ActorMethod<[string, string, DelDoc], undefined>;
163
+ get_config: ActorMethod<[], Config>;
164
+ get_doc: ActorMethod<[string, string], [] | [Doc]>;
165
+ http_request: ActorMethod<[HttpRequest], HttpResponse>;
166
+ http_request_streaming_callback: ActorMethod<
167
+ [StreamingCallbackToken],
168
+ StreamingCallbackHttpResponse
169
+ >;
170
+ init_asset_upload: ActorMethod<[InitAssetKey], InitUploadResult>;
171
+ list_assets: ActorMethod<[[] | [string], ListParams], ListResults>;
172
+ list_controllers: ActorMethod<[], Array<[Principal, Controller]>>;
173
+ list_custom_domains: ActorMethod<[], Array<[string, CustomDomain]>>;
174
+ list_docs: ActorMethod<[string, ListParams], ListResults_1>;
175
+ list_rules: ActorMethod<[RulesType], Array<[string, Rule]>>;
176
+ set_config: ActorMethod<[Config], undefined>;
177
+ set_controllers: ActorMethod<[SetControllersArgs], Array<[Principal, Controller]>>;
178
+ set_custom_domain: ActorMethod<[string, [] | [string]], undefined>;
179
+ set_doc: ActorMethod<[string, string, SetDoc], Doc>;
180
+ set_rule: ActorMethod<[RulesType, string, SetRule], undefined>;
181
+ upload_asset_chunk: ActorMethod<[Chunk], UploadChunk>;
182
+ version: ActorMethod<[], string>;
183
+ }