@junobuild/core-standalone 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +17 -0
  3. package/dist/browser/canisterStatus-MTFHSECX.js +2 -0
  4. package/dist/browser/canisterStatus-MTFHSECX.js.map +7 -0
  5. package/dist/browser/chunk-F6RH4LLT.js +69 -0
  6. package/dist/browser/chunk-F6RH4LLT.js.map +7 -0
  7. package/dist/browser/index.js +26 -0
  8. package/dist/browser/index.js.map +7 -0
  9. package/dist/declarations/deprecated/mission_control-0-0-4.did.d.ts +80 -0
  10. package/dist/declarations/deprecated/mission_control-0-0-4.factory.did.js +99 -0
  11. package/dist/declarations/deprecated/satellite-0-0-8.did.d.ts +183 -0
  12. package/dist/declarations/deprecated/satellite-0-0-8.factory.did.js +194 -0
  13. package/dist/declarations/deprecated/satellite-0-0-9.did.d.ts +199 -0
  14. package/dist/declarations/deprecated/satellite-0-0-9.factory.did.js +213 -0
  15. package/dist/declarations/satellite/satellite.did.d.ts +288 -0
  16. package/dist/declarations/satellite/satellite.factory.did.js +316 -0
  17. package/dist/declarations/satellite/satellite.factory.did.mjs +316 -0
  18. package/dist/index.js +1 -0
  19. package/dist/node/index.mjs +104 -0
  20. package/dist/node/index.mjs.map +7 -0
  21. package/dist/types/api/actor.api.d.ts +9 -0
  22. package/dist/types/api/doc.api.d.ts +52 -0
  23. package/dist/types/api/storage.api.d.ts +42 -0
  24. package/dist/types/constants/auth.constants.d.ts +12 -0
  25. package/dist/types/constants/container.constants.d.ts +2 -0
  26. package/dist/types/index.d.ts +38 -0
  27. package/dist/types/providers/auth.providers.d.ts +79 -0
  28. package/dist/types/services/auth-timout.services.d.ts +3 -0
  29. package/dist/types/services/auth.services.d.ts +23 -0
  30. package/dist/types/services/doc.services.d.ts +127 -0
  31. package/dist/types/services/factory.services.d.ts +8 -0
  32. package/dist/types/services/identity.services.d.ts +2 -0
  33. package/dist/types/services/storage.services.d.ts +130 -0
  34. package/dist/types/services/user.services.d.ts +2 -0
  35. package/dist/types/stores/actor.store.d.ts +21 -0
  36. package/dist/types/stores/agent.store.d.ts +13 -0
  37. package/dist/types/stores/auth.store.d.ts +13 -0
  38. package/dist/types/stores/env.store.d.ts +11 -0
  39. package/dist/types/stores/store.d.ts +5 -0
  40. package/dist/types/types/auth.types.d.ts +90 -0
  41. package/dist/types/types/build.types.d.ts +5 -0
  42. package/dist/types/types/doc.types.d.ts +42 -0
  43. package/dist/types/types/env.types.d.ts +43 -0
  44. package/dist/types/types/list.types.d.ts +170 -0
  45. package/dist/types/types/post-message.d.ts +11 -0
  46. package/dist/types/types/satellite.types.d.ts +32 -0
  47. package/dist/types/types/storage.types.d.ts +21 -0
  48. package/dist/types/types/subscription.types.d.ts +6 -0
  49. package/dist/types/utils/auth.utils.d.ts +2 -0
  50. package/dist/types/utils/crypto.utils.d.ts +1 -0
  51. package/dist/types/utils/data.utils.d.ts +2 -0
  52. package/dist/types/utils/doc.utils.d.ts +8 -0
  53. package/dist/types/utils/env.utils.d.ts +4 -0
  54. package/dist/types/utils/events.utils.d.ts +4 -0
  55. package/dist/types/utils/list.utils.d.ts +3 -0
  56. package/dist/types/utils/window.env.utils.d.ts +2 -0
  57. package/dist/types/utils/window.utils.d.ts +4 -0
  58. package/dist/types/workers/auth.worker.d.ts +5 -0
  59. package/dist/workers/auth.worker.js +58 -0
  60. package/dist/workers/auth.worker.js.map +7 -0
  61. package/package.json +64 -0
@@ -0,0 +1,316 @@
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 RulesType = 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
+ });
81
+ const AuthenticationConfig = IDL.Record({
82
+ internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity)
83
+ });
84
+ const ConfigMaxMemorySize = IDL.Record({
85
+ stable: IDL.Opt(IDL.Nat64),
86
+ heap: IDL.Opt(IDL.Nat64)
87
+ });
88
+ const DbConfig = IDL.Record({
89
+ max_memory_size: IDL.Opt(ConfigMaxMemorySize)
90
+ });
91
+ const StorageConfigIFrame = IDL.Variant({
92
+ Deny: IDL.Null,
93
+ AllowAny: IDL.Null,
94
+ SameOrigin: IDL.Null
95
+ });
96
+ const StorageConfigRawAccess = IDL.Variant({
97
+ Deny: IDL.Null,
98
+ Allow: IDL.Null
99
+ });
100
+ const StorageConfigRedirect = IDL.Record({
101
+ status_code: IDL.Nat16,
102
+ location: IDL.Text
103
+ });
104
+ const StorageConfig = IDL.Record({
105
+ iframe: IDL.Opt(StorageConfigIFrame),
106
+ rewrites: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
107
+ headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)))),
108
+ max_memory_size: IDL.Opt(ConfigMaxMemorySize),
109
+ raw_access: IDL.Opt(StorageConfigRawAccess),
110
+ redirects: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, StorageConfigRedirect)))
111
+ });
112
+ const Config = IDL.Record({
113
+ db: IDL.Opt(DbConfig),
114
+ authentication: IDL.Opt(AuthenticationConfig),
115
+ storage: StorageConfig
116
+ });
117
+ const Doc = IDL.Record({
118
+ updated_at: IDL.Nat64,
119
+ owner: IDL.Principal,
120
+ data: IDL.Vec(IDL.Nat8),
121
+ description: IDL.Opt(IDL.Text),
122
+ created_at: IDL.Nat64,
123
+ version: IDL.Opt(IDL.Nat64)
124
+ });
125
+ const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});
126
+ const Permission = IDL.Variant({
127
+ Controllers: IDL.Null,
128
+ Private: IDL.Null,
129
+ Public: IDL.Null,
130
+ Managed: IDL.Null
131
+ });
132
+ const RateConfig = IDL.Record({
133
+ max_tokens: IDL.Nat64,
134
+ time_per_token_ns: IDL.Nat64
135
+ });
136
+ const Rule = IDL.Record({
137
+ max_capacity: IDL.Opt(IDL.Nat32),
138
+ memory: IDL.Opt(Memory),
139
+ updated_at: IDL.Nat64,
140
+ max_size: IDL.Opt(IDL.Nat),
141
+ read: Permission,
142
+ created_at: IDL.Nat64,
143
+ version: IDL.Opt(IDL.Nat64),
144
+ mutable_permissions: IDL.Opt(IDL.Bool),
145
+ rate_config: IDL.Opt(RateConfig),
146
+ write: Permission
147
+ });
148
+ const HttpRequest = IDL.Record({
149
+ url: IDL.Text,
150
+ method: IDL.Text,
151
+ body: IDL.Vec(IDL.Nat8),
152
+ headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
153
+ certificate_version: IDL.Opt(IDL.Nat16)
154
+ });
155
+ const StreamingCallbackToken = IDL.Record({
156
+ memory: Memory,
157
+ token: IDL.Opt(IDL.Text),
158
+ sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),
159
+ headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
160
+ index: IDL.Nat64,
161
+ encoding_type: IDL.Text,
162
+ full_path: IDL.Text
163
+ });
164
+ const StreamingStrategy = IDL.Variant({
165
+ Callback: IDL.Record({
166
+ token: StreamingCallbackToken,
167
+ callback: IDL.Func([], [], ['query'])
168
+ })
169
+ });
170
+ const HttpResponse = IDL.Record({
171
+ body: IDL.Vec(IDL.Nat8),
172
+ headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
173
+ streaming_strategy: IDL.Opt(StreamingStrategy),
174
+ status_code: IDL.Nat16
175
+ });
176
+ const StreamingCallbackHttpResponse = IDL.Record({
177
+ token: IDL.Opt(StreamingCallbackToken),
178
+ body: IDL.Vec(IDL.Nat8)
179
+ });
180
+ const InitAssetKey = IDL.Record({
181
+ token: IDL.Opt(IDL.Text),
182
+ collection: IDL.Text,
183
+ name: IDL.Text,
184
+ description: IDL.Opt(IDL.Text),
185
+ encoding_type: IDL.Opt(IDL.Text),
186
+ full_path: IDL.Text
187
+ });
188
+ const InitUploadResult = IDL.Record({batch_id: IDL.Nat});
189
+ const ListResults = IDL.Record({
190
+ matches_pages: IDL.Opt(IDL.Nat64),
191
+ matches_length: IDL.Nat64,
192
+ items_page: IDL.Opt(IDL.Nat64),
193
+ items: IDL.Vec(IDL.Tuple(IDL.Text, AssetNoContent)),
194
+ items_length: IDL.Nat64
195
+ });
196
+ const CustomDomain = IDL.Record({
197
+ updated_at: IDL.Nat64,
198
+ created_at: IDL.Nat64,
199
+ version: IDL.Opt(IDL.Nat64),
200
+ bn_id: IDL.Opt(IDL.Text)
201
+ });
202
+ const ListResults_1 = IDL.Record({
203
+ matches_pages: IDL.Opt(IDL.Nat64),
204
+ matches_length: IDL.Nat64,
205
+ items_page: IDL.Opt(IDL.Nat64),
206
+ items: IDL.Vec(IDL.Tuple(IDL.Text, Doc)),
207
+ items_length: IDL.Nat64
208
+ });
209
+ const MemorySize = IDL.Record({stable: IDL.Nat64, heap: IDL.Nat64});
210
+ const SetController = IDL.Record({
211
+ metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
212
+ scope: ControllerScope,
213
+ expires_at: IDL.Opt(IDL.Nat64)
214
+ });
215
+ const SetControllersArgs = IDL.Record({
216
+ controller: SetController,
217
+ controllers: IDL.Vec(IDL.Principal)
218
+ });
219
+ const SetDoc = IDL.Record({
220
+ data: IDL.Vec(IDL.Nat8),
221
+ description: IDL.Opt(IDL.Text),
222
+ version: IDL.Opt(IDL.Nat64)
223
+ });
224
+ const SetRule = IDL.Record({
225
+ max_capacity: IDL.Opt(IDL.Nat32),
226
+ memory: IDL.Opt(Memory),
227
+ max_size: IDL.Opt(IDL.Nat),
228
+ read: Permission,
229
+ version: IDL.Opt(IDL.Nat64),
230
+ mutable_permissions: IDL.Opt(IDL.Bool),
231
+ rate_config: IDL.Opt(RateConfig),
232
+ write: Permission
233
+ });
234
+ const UploadChunk = IDL.Record({
235
+ content: IDL.Vec(IDL.Nat8),
236
+ batch_id: IDL.Nat,
237
+ order_id: IDL.Opt(IDL.Nat)
238
+ });
239
+ const UploadChunkResult = IDL.Record({chunk_id: IDL.Nat});
240
+ return IDL.Service({
241
+ build_version: IDL.Func([], [IDL.Text], ['query']),
242
+ commit_asset_upload: IDL.Func([CommitBatch], [], []),
243
+ count_assets: IDL.Func([IDL.Text, ListParams], [IDL.Nat64], ['query']),
244
+ count_collection_assets: IDL.Func([IDL.Text], [IDL.Nat64], ['query']),
245
+ count_collection_docs: IDL.Func([IDL.Text], [IDL.Nat64], ['query']),
246
+ count_docs: IDL.Func([IDL.Text, ListParams], [IDL.Nat64], ['query']),
247
+ del_asset: IDL.Func([IDL.Text, IDL.Text], [], []),
248
+ del_assets: IDL.Func([IDL.Text], [], []),
249
+ del_controllers: IDL.Func(
250
+ [DeleteControllersArgs],
251
+ [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],
252
+ []
253
+ ),
254
+ del_custom_domain: IDL.Func([IDL.Text], [], []),
255
+ del_doc: IDL.Func([IDL.Text, IDL.Text, DelDoc], [], []),
256
+ del_docs: IDL.Func([IDL.Text], [], []),
257
+ del_filtered_assets: IDL.Func([IDL.Text, ListParams], [], []),
258
+ del_filtered_docs: IDL.Func([IDL.Text, ListParams], [], []),
259
+ del_many_assets: IDL.Func([IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))], [], []),
260
+ del_many_docs: IDL.Func([IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, DelDoc))], [], []),
261
+ del_rule: IDL.Func([RulesType, IDL.Text, DelRule], [], []),
262
+ deposit_cycles: IDL.Func([DepositCyclesArgs], [], []),
263
+ get_asset: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(AssetNoContent)], ['query']),
264
+ get_auth_config: IDL.Func([], [IDL.Opt(AuthenticationConfig)], ['query']),
265
+ get_config: IDL.Func([], [Config], []),
266
+ get_db_config: IDL.Func([], [IDL.Opt(DbConfig)], ['query']),
267
+ get_doc: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(Doc)], ['query']),
268
+ get_many_assets: IDL.Func(
269
+ [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],
270
+ [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Opt(AssetNoContent)))],
271
+ ['query']
272
+ ),
273
+ get_many_docs: IDL.Func(
274
+ [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],
275
+ [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Opt(Doc)))],
276
+ ['query']
277
+ ),
278
+ get_rule: IDL.Func([RulesType, IDL.Text], [IDL.Opt(Rule)], ['query']),
279
+ get_storage_config: IDL.Func([], [StorageConfig], ['query']),
280
+ http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),
281
+ http_request_streaming_callback: IDL.Func(
282
+ [StreamingCallbackToken],
283
+ [StreamingCallbackHttpResponse],
284
+ ['query']
285
+ ),
286
+ init_asset_upload: IDL.Func([InitAssetKey], [InitUploadResult], []),
287
+ list_assets: IDL.Func([IDL.Text, ListParams], [ListResults], ['query']),
288
+ list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))], ['query']),
289
+ list_custom_domains: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, CustomDomain))], ['query']),
290
+ list_docs: IDL.Func([IDL.Text, ListParams], [ListResults_1], ['query']),
291
+ list_rules: IDL.Func([RulesType], [IDL.Vec(IDL.Tuple(IDL.Text, Rule))], ['query']),
292
+ memory_size: IDL.Func([], [MemorySize], ['query']),
293
+ set_auth_config: IDL.Func([AuthenticationConfig], [], []),
294
+ set_controllers: IDL.Func(
295
+ [SetControllersArgs],
296
+ [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],
297
+ []
298
+ ),
299
+ set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),
300
+ set_db_config: IDL.Func([DbConfig], [], []),
301
+ set_doc: IDL.Func([IDL.Text, IDL.Text, SetDoc], [Doc], []),
302
+ set_many_docs: IDL.Func(
303
+ [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, SetDoc))],
304
+ [IDL.Vec(IDL.Tuple(IDL.Text, Doc))],
305
+ []
306
+ ),
307
+ set_rule: IDL.Func([RulesType, IDL.Text, SetRule], [Rule], []),
308
+ set_storage_config: IDL.Func([StorageConfig], [], []),
309
+ upload_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], []),
310
+ version: IDL.Func([], [IDL.Text], ['query'])
311
+ });
312
+ };
313
+ // @ts-ignore
314
+ export const init = ({IDL}) => {
315
+ return [];
316
+ };
@@ -0,0 +1,316 @@
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 RulesType = 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
+ });
81
+ const AuthenticationConfig = IDL.Record({
82
+ internet_identity: IDL.Opt(AuthenticationConfigInternetIdentity)
83
+ });
84
+ const ConfigMaxMemorySize = IDL.Record({
85
+ stable: IDL.Opt(IDL.Nat64),
86
+ heap: IDL.Opt(IDL.Nat64)
87
+ });
88
+ const DbConfig = IDL.Record({
89
+ max_memory_size: IDL.Opt(ConfigMaxMemorySize)
90
+ });
91
+ const StorageConfigIFrame = IDL.Variant({
92
+ Deny: IDL.Null,
93
+ AllowAny: IDL.Null,
94
+ SameOrigin: IDL.Null
95
+ });
96
+ const StorageConfigRawAccess = IDL.Variant({
97
+ Deny: IDL.Null,
98
+ Allow: IDL.Null
99
+ });
100
+ const StorageConfigRedirect = IDL.Record({
101
+ status_code: IDL.Nat16,
102
+ location: IDL.Text
103
+ });
104
+ const StorageConfig = IDL.Record({
105
+ iframe: IDL.Opt(StorageConfigIFrame),
106
+ rewrites: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
107
+ headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)))),
108
+ max_memory_size: IDL.Opt(ConfigMaxMemorySize),
109
+ raw_access: IDL.Opt(StorageConfigRawAccess),
110
+ redirects: IDL.Opt(IDL.Vec(IDL.Tuple(IDL.Text, StorageConfigRedirect)))
111
+ });
112
+ const Config = IDL.Record({
113
+ db: IDL.Opt(DbConfig),
114
+ authentication: IDL.Opt(AuthenticationConfig),
115
+ storage: StorageConfig
116
+ });
117
+ const Doc = IDL.Record({
118
+ updated_at: IDL.Nat64,
119
+ owner: IDL.Principal,
120
+ data: IDL.Vec(IDL.Nat8),
121
+ description: IDL.Opt(IDL.Text),
122
+ created_at: IDL.Nat64,
123
+ version: IDL.Opt(IDL.Nat64)
124
+ });
125
+ const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});
126
+ const Permission = IDL.Variant({
127
+ Controllers: IDL.Null,
128
+ Private: IDL.Null,
129
+ Public: IDL.Null,
130
+ Managed: IDL.Null
131
+ });
132
+ const RateConfig = IDL.Record({
133
+ max_tokens: IDL.Nat64,
134
+ time_per_token_ns: IDL.Nat64
135
+ });
136
+ const Rule = IDL.Record({
137
+ max_capacity: IDL.Opt(IDL.Nat32),
138
+ memory: IDL.Opt(Memory),
139
+ updated_at: IDL.Nat64,
140
+ max_size: IDL.Opt(IDL.Nat),
141
+ read: Permission,
142
+ created_at: IDL.Nat64,
143
+ version: IDL.Opt(IDL.Nat64),
144
+ mutable_permissions: IDL.Opt(IDL.Bool),
145
+ rate_config: IDL.Opt(RateConfig),
146
+ write: Permission
147
+ });
148
+ const HttpRequest = IDL.Record({
149
+ url: IDL.Text,
150
+ method: IDL.Text,
151
+ body: IDL.Vec(IDL.Nat8),
152
+ headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
153
+ certificate_version: IDL.Opt(IDL.Nat16)
154
+ });
155
+ const StreamingCallbackToken = IDL.Record({
156
+ memory: Memory,
157
+ token: IDL.Opt(IDL.Text),
158
+ sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),
159
+ headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
160
+ index: IDL.Nat64,
161
+ encoding_type: IDL.Text,
162
+ full_path: IDL.Text
163
+ });
164
+ const StreamingStrategy = IDL.Variant({
165
+ Callback: IDL.Record({
166
+ token: StreamingCallbackToken,
167
+ callback: IDL.Func([], [], ['query'])
168
+ })
169
+ });
170
+ const HttpResponse = IDL.Record({
171
+ body: IDL.Vec(IDL.Nat8),
172
+ headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
173
+ streaming_strategy: IDL.Opt(StreamingStrategy),
174
+ status_code: IDL.Nat16
175
+ });
176
+ const StreamingCallbackHttpResponse = IDL.Record({
177
+ token: IDL.Opt(StreamingCallbackToken),
178
+ body: IDL.Vec(IDL.Nat8)
179
+ });
180
+ const InitAssetKey = IDL.Record({
181
+ token: IDL.Opt(IDL.Text),
182
+ collection: IDL.Text,
183
+ name: IDL.Text,
184
+ description: IDL.Opt(IDL.Text),
185
+ encoding_type: IDL.Opt(IDL.Text),
186
+ full_path: IDL.Text
187
+ });
188
+ const InitUploadResult = IDL.Record({batch_id: IDL.Nat});
189
+ const ListResults = IDL.Record({
190
+ matches_pages: IDL.Opt(IDL.Nat64),
191
+ matches_length: IDL.Nat64,
192
+ items_page: IDL.Opt(IDL.Nat64),
193
+ items: IDL.Vec(IDL.Tuple(IDL.Text, AssetNoContent)),
194
+ items_length: IDL.Nat64
195
+ });
196
+ const CustomDomain = IDL.Record({
197
+ updated_at: IDL.Nat64,
198
+ created_at: IDL.Nat64,
199
+ version: IDL.Opt(IDL.Nat64),
200
+ bn_id: IDL.Opt(IDL.Text)
201
+ });
202
+ const ListResults_1 = IDL.Record({
203
+ matches_pages: IDL.Opt(IDL.Nat64),
204
+ matches_length: IDL.Nat64,
205
+ items_page: IDL.Opt(IDL.Nat64),
206
+ items: IDL.Vec(IDL.Tuple(IDL.Text, Doc)),
207
+ items_length: IDL.Nat64
208
+ });
209
+ const MemorySize = IDL.Record({stable: IDL.Nat64, heap: IDL.Nat64});
210
+ const SetController = IDL.Record({
211
+ metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
212
+ scope: ControllerScope,
213
+ expires_at: IDL.Opt(IDL.Nat64)
214
+ });
215
+ const SetControllersArgs = IDL.Record({
216
+ controller: SetController,
217
+ controllers: IDL.Vec(IDL.Principal)
218
+ });
219
+ const SetDoc = IDL.Record({
220
+ data: IDL.Vec(IDL.Nat8),
221
+ description: IDL.Opt(IDL.Text),
222
+ version: IDL.Opt(IDL.Nat64)
223
+ });
224
+ const SetRule = IDL.Record({
225
+ max_capacity: IDL.Opt(IDL.Nat32),
226
+ memory: IDL.Opt(Memory),
227
+ max_size: IDL.Opt(IDL.Nat),
228
+ read: Permission,
229
+ version: IDL.Opt(IDL.Nat64),
230
+ mutable_permissions: IDL.Opt(IDL.Bool),
231
+ rate_config: IDL.Opt(RateConfig),
232
+ write: Permission
233
+ });
234
+ const UploadChunk = IDL.Record({
235
+ content: IDL.Vec(IDL.Nat8),
236
+ batch_id: IDL.Nat,
237
+ order_id: IDL.Opt(IDL.Nat)
238
+ });
239
+ const UploadChunkResult = IDL.Record({chunk_id: IDL.Nat});
240
+ return IDL.Service({
241
+ build_version: IDL.Func([], [IDL.Text], ['query']),
242
+ commit_asset_upload: IDL.Func([CommitBatch], [], []),
243
+ count_assets: IDL.Func([IDL.Text, ListParams], [IDL.Nat64], ['query']),
244
+ count_collection_assets: IDL.Func([IDL.Text], [IDL.Nat64], ['query']),
245
+ count_collection_docs: IDL.Func([IDL.Text], [IDL.Nat64], ['query']),
246
+ count_docs: IDL.Func([IDL.Text, ListParams], [IDL.Nat64], ['query']),
247
+ del_asset: IDL.Func([IDL.Text, IDL.Text], [], []),
248
+ del_assets: IDL.Func([IDL.Text], [], []),
249
+ del_controllers: IDL.Func(
250
+ [DeleteControllersArgs],
251
+ [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],
252
+ []
253
+ ),
254
+ del_custom_domain: IDL.Func([IDL.Text], [], []),
255
+ del_doc: IDL.Func([IDL.Text, IDL.Text, DelDoc], [], []),
256
+ del_docs: IDL.Func([IDL.Text], [], []),
257
+ del_filtered_assets: IDL.Func([IDL.Text, ListParams], [], []),
258
+ del_filtered_docs: IDL.Func([IDL.Text, ListParams], [], []),
259
+ del_many_assets: IDL.Func([IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))], [], []),
260
+ del_many_docs: IDL.Func([IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, DelDoc))], [], []),
261
+ del_rule: IDL.Func([RulesType, IDL.Text, DelRule], [], []),
262
+ deposit_cycles: IDL.Func([DepositCyclesArgs], [], []),
263
+ get_asset: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(AssetNoContent)], ['query']),
264
+ get_auth_config: IDL.Func([], [IDL.Opt(AuthenticationConfig)], ['query']),
265
+ get_config: IDL.Func([], [Config], []),
266
+ get_db_config: IDL.Func([], [IDL.Opt(DbConfig)], ['query']),
267
+ get_doc: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(Doc)], ['query']),
268
+ get_many_assets: IDL.Func(
269
+ [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],
270
+ [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Opt(AssetNoContent)))],
271
+ ['query']
272
+ ),
273
+ get_many_docs: IDL.Func(
274
+ [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))],
275
+ [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Opt(Doc)))],
276
+ ['query']
277
+ ),
278
+ get_rule: IDL.Func([RulesType, IDL.Text], [IDL.Opt(Rule)], ['query']),
279
+ get_storage_config: IDL.Func([], [StorageConfig], ['query']),
280
+ http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),
281
+ http_request_streaming_callback: IDL.Func(
282
+ [StreamingCallbackToken],
283
+ [StreamingCallbackHttpResponse],
284
+ ['query']
285
+ ),
286
+ init_asset_upload: IDL.Func([InitAssetKey], [InitUploadResult], []),
287
+ list_assets: IDL.Func([IDL.Text, ListParams], [ListResults], ['query']),
288
+ list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))], ['query']),
289
+ list_custom_domains: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, CustomDomain))], ['query']),
290
+ list_docs: IDL.Func([IDL.Text, ListParams], [ListResults_1], ['query']),
291
+ list_rules: IDL.Func([RulesType], [IDL.Vec(IDL.Tuple(IDL.Text, Rule))], ['query']),
292
+ memory_size: IDL.Func([], [MemorySize], ['query']),
293
+ set_auth_config: IDL.Func([AuthenticationConfig], [], []),
294
+ set_controllers: IDL.Func(
295
+ [SetControllersArgs],
296
+ [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],
297
+ []
298
+ ),
299
+ set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),
300
+ set_db_config: IDL.Func([DbConfig], [], []),
301
+ set_doc: IDL.Func([IDL.Text, IDL.Text, SetDoc], [Doc], []),
302
+ set_many_docs: IDL.Func(
303
+ [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text, SetDoc))],
304
+ [IDL.Vec(IDL.Tuple(IDL.Text, Doc))],
305
+ []
306
+ ),
307
+ set_rule: IDL.Func([RulesType, IDL.Text, SetRule], [Rule], []),
308
+ set_storage_config: IDL.Func([StorageConfig], [], []),
309
+ upload_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], []),
310
+ version: IDL.Func([], [IDL.Text], ['query'])
311
+ });
312
+ };
313
+ // @ts-ignore
314
+ export const init = ({IDL}) => {
315
+ return [];
316
+ };
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from './browser/index.js';