@junobuild/core-peer 0.0.1
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/LICENSE +21 -0
- package/README.md +25 -0
- package/declarations/deprecated/mission_control-0-0-4.did.d.ts +80 -0
- package/declarations/deprecated/mission_control-0-0-4.factory.did.js +99 -0
- package/declarations/deprecated/satellite-0-0-8.did.d.ts +183 -0
- package/declarations/deprecated/satellite-0-0-8.factory.did.js +194 -0
- package/declarations/deprecated/satellite-0-0-9.did.d.ts +199 -0
- package/declarations/deprecated/satellite-0-0-9.factory.did.js +213 -0
- package/declarations/satellite/index.d.ts +45 -0
- package/declarations/satellite/index.js +37 -0
- package/declarations/satellite/satellite.did.d.ts +207 -0
- package/declarations/satellite/satellite.factory.did.js +221 -0
- package/declarations/satellite/satellite.factory.did.mjs +221 -0
- package/dist/browser/index.js +2 -0
- package/dist/browser/index.js.map +7 -0
- package/dist/declarations/deprecated/mission_control-0-0-4.did.d.ts +80 -0
- package/dist/declarations/deprecated/mission_control-0-0-4.factory.did.js +99 -0
- package/dist/declarations/deprecated/satellite-0-0-8.did.d.ts +183 -0
- package/dist/declarations/deprecated/satellite-0-0-8.factory.did.js +194 -0
- package/dist/declarations/deprecated/satellite-0-0-9.did.d.ts +199 -0
- package/dist/declarations/deprecated/satellite-0-0-9.factory.did.js +213 -0
- package/dist/declarations/satellite/index.d.ts +45 -0
- package/dist/declarations/satellite/index.js +37 -0
- package/dist/declarations/satellite/satellite.did.d.ts +207 -0
- package/dist/declarations/satellite/satellite.factory.did.js +221 -0
- package/dist/declarations/satellite/satellite.factory.did.mjs +221 -0
- package/dist/index.js +1 -0
- package/dist/node/index.mjs +4 -0
- package/dist/node/index.mjs.map +7 -0
- package/dist/types/api/actor.api.d.ts +3 -0
- package/dist/types/api/doc.api.d.ts +22 -0
- package/dist/types/api/storage.api.d.ts +20 -0
- package/dist/types/constants/auth.constants.d.ts +11 -0
- package/dist/types/index.d.ts +16 -0
- package/dist/types/providers/auth.providers.d.ts +31 -0
- package/dist/types/services/auth-timout.services.d.ts +3 -0
- package/dist/types/services/auth.services.d.ts +11 -0
- package/dist/types/services/doc.services.d.ts +22 -0
- package/dist/types/services/identity.services.d.ts +2 -0
- package/dist/types/services/storage.services.d.ts +24 -0
- package/dist/types/services/user.services.d.ts +2 -0
- package/dist/types/stores/auth.store.d.ts +13 -0
- package/dist/types/stores/env.store.d.ts +12 -0
- package/dist/types/stores/store.d.ts +5 -0
- package/dist/types/types/auth.types.d.ts +13 -0
- package/dist/types/types/doc.types.d.ts +8 -0
- package/dist/types/types/env.types.d.ts +10 -0
- package/dist/types/types/list.types.d.ts +28 -0
- package/dist/types/types/post-message.d.ts +5 -0
- package/dist/types/types/satellite.types.d.ts +8 -0
- package/dist/types/types/storage.types.d.ts +35 -0
- package/dist/types/types/subscription.types.d.ts +1 -0
- package/dist/types/utils/actor.utils.d.ts +6 -0
- package/dist/types/utils/auth.utils.d.ts +2 -0
- package/dist/types/utils/crypto.utils.d.ts +1 -0
- package/dist/types/utils/data.utils.d.ts +2 -0
- package/dist/types/utils/env.utils.d.ts +1 -0
- package/dist/types/utils/events.utils.d.ts +4 -0
- package/dist/types/utils/list.utils.d.ts +3 -0
- package/dist/types/utils/storage.utils.d.ts +1 -0
- package/dist/types/utils/window.utils.d.ts +4 -0
- package/dist/types/workers/auth.worker.d.ts +6 -0
- package/dist/workers/auth.worker.js +25 -0
- package/dist/workers/auth.worker.js.gz +0 -0
- package/dist/workers/auth.worker.js.map +7 -0
- package/package.json +66 -0
|
@@ -0,0 +1,221 @@
|
|
|
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 DeleteControllersArgs = IDL.Record({
|
|
9
|
+
controllers: IDL.Vec(IDL.Principal)
|
|
10
|
+
});
|
|
11
|
+
const ControllerScope = IDL.Variant({
|
|
12
|
+
Write: IDL.Null,
|
|
13
|
+
Admin: IDL.Null
|
|
14
|
+
});
|
|
15
|
+
const Controller = IDL.Record({
|
|
16
|
+
updated_at: IDL.Nat64,
|
|
17
|
+
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
18
|
+
created_at: IDL.Nat64,
|
|
19
|
+
scope: ControllerScope,
|
|
20
|
+
expires_at: IDL.Opt(IDL.Nat64)
|
|
21
|
+
});
|
|
22
|
+
const DelDoc = IDL.Record({updated_at: IDL.Opt(IDL.Nat64)});
|
|
23
|
+
const RulesType = IDL.Variant({Db: IDL.Null, Storage: IDL.Null});
|
|
24
|
+
const StorageConfig = IDL.Record({
|
|
25
|
+
rewrites: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
26
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))))
|
|
27
|
+
});
|
|
28
|
+
const Config = IDL.Record({storage: StorageConfig});
|
|
29
|
+
const Doc = IDL.Record({
|
|
30
|
+
updated_at: IDL.Nat64,
|
|
31
|
+
owner: IDL.Principal,
|
|
32
|
+
data: IDL.Vec(IDL.Nat8),
|
|
33
|
+
description: IDL.Opt(IDL.Text),
|
|
34
|
+
created_at: IDL.Nat64
|
|
35
|
+
});
|
|
36
|
+
const HttpRequest = IDL.Record({
|
|
37
|
+
url: IDL.Text,
|
|
38
|
+
method: IDL.Text,
|
|
39
|
+
body: IDL.Vec(IDL.Nat8),
|
|
40
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))
|
|
41
|
+
});
|
|
42
|
+
const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});
|
|
43
|
+
const StreamingCallbackToken = IDL.Record({
|
|
44
|
+
memory: Memory,
|
|
45
|
+
token: IDL.Opt(IDL.Text),
|
|
46
|
+
sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
47
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
48
|
+
index: IDL.Nat64,
|
|
49
|
+
encoding_type: IDL.Text,
|
|
50
|
+
full_path: IDL.Text
|
|
51
|
+
});
|
|
52
|
+
const StreamingStrategy = IDL.Variant({
|
|
53
|
+
Callback: IDL.Record({
|
|
54
|
+
token: StreamingCallbackToken,
|
|
55
|
+
callback: IDL.Func([], [], ['query'])
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
const HttpResponse = IDL.Record({
|
|
59
|
+
body: IDL.Vec(IDL.Nat8),
|
|
60
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
61
|
+
streaming_strategy: IDL.Opt(StreamingStrategy),
|
|
62
|
+
status_code: IDL.Nat16
|
|
63
|
+
});
|
|
64
|
+
const StreamingCallbackHttpResponse = IDL.Record({
|
|
65
|
+
token: IDL.Opt(StreamingCallbackToken),
|
|
66
|
+
body: IDL.Vec(IDL.Nat8)
|
|
67
|
+
});
|
|
68
|
+
const InitAssetKey = IDL.Record({
|
|
69
|
+
token: IDL.Opt(IDL.Text),
|
|
70
|
+
collection: IDL.Text,
|
|
71
|
+
name: IDL.Text,
|
|
72
|
+
description: IDL.Opt(IDL.Text),
|
|
73
|
+
encoding_type: IDL.Opt(IDL.Text),
|
|
74
|
+
full_path: IDL.Text
|
|
75
|
+
});
|
|
76
|
+
const InitUploadResult = IDL.Record({batch_id: IDL.Nat});
|
|
77
|
+
const ListOrderField = IDL.Variant({
|
|
78
|
+
UpdatedAt: IDL.Null,
|
|
79
|
+
Keys: IDL.Null,
|
|
80
|
+
CreatedAt: IDL.Null
|
|
81
|
+
});
|
|
82
|
+
const ListOrder = IDL.Record({field: ListOrderField, desc: IDL.Bool});
|
|
83
|
+
const ListMatcher = IDL.Record({
|
|
84
|
+
key: IDL.Opt(IDL.Text),
|
|
85
|
+
description: IDL.Opt(IDL.Text)
|
|
86
|
+
});
|
|
87
|
+
const ListPaginate = IDL.Record({
|
|
88
|
+
start_after: IDL.Opt(IDL.Text),
|
|
89
|
+
limit: IDL.Opt(IDL.Nat64)
|
|
90
|
+
});
|
|
91
|
+
const ListParams = IDL.Record({
|
|
92
|
+
order: IDL.Opt(ListOrder),
|
|
93
|
+
owner: IDL.Opt(IDL.Principal),
|
|
94
|
+
matcher: IDL.Opt(ListMatcher),
|
|
95
|
+
paginate: IDL.Opt(ListPaginate)
|
|
96
|
+
});
|
|
97
|
+
const AssetKey = IDL.Record({
|
|
98
|
+
token: IDL.Opt(IDL.Text),
|
|
99
|
+
collection: IDL.Text,
|
|
100
|
+
owner: IDL.Principal,
|
|
101
|
+
name: IDL.Text,
|
|
102
|
+
description: IDL.Opt(IDL.Text),
|
|
103
|
+
full_path: IDL.Text
|
|
104
|
+
});
|
|
105
|
+
const AssetEncodingNoContent = IDL.Record({
|
|
106
|
+
modified: IDL.Nat64,
|
|
107
|
+
sha256: IDL.Vec(IDL.Nat8),
|
|
108
|
+
total_length: IDL.Nat
|
|
109
|
+
});
|
|
110
|
+
const AssetNoContent = IDL.Record({
|
|
111
|
+
key: AssetKey,
|
|
112
|
+
updated_at: IDL.Nat64,
|
|
113
|
+
encodings: IDL.Vec(IDL.Tuple(IDL.Text, AssetEncodingNoContent)),
|
|
114
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
115
|
+
created_at: IDL.Nat64
|
|
116
|
+
});
|
|
117
|
+
const ListResults = IDL.Record({
|
|
118
|
+
matches_pages: IDL.Opt(IDL.Nat64),
|
|
119
|
+
matches_length: IDL.Nat64,
|
|
120
|
+
items_page: IDL.Opt(IDL.Nat64),
|
|
121
|
+
items: IDL.Vec(IDL.Tuple(IDL.Text, AssetNoContent)),
|
|
122
|
+
items_length: IDL.Nat64
|
|
123
|
+
});
|
|
124
|
+
const CustomDomain = IDL.Record({
|
|
125
|
+
updated_at: IDL.Nat64,
|
|
126
|
+
created_at: IDL.Nat64,
|
|
127
|
+
bn_id: IDL.Opt(IDL.Text)
|
|
128
|
+
});
|
|
129
|
+
const ListResults_1 = IDL.Record({
|
|
130
|
+
matches_pages: IDL.Opt(IDL.Nat64),
|
|
131
|
+
matches_length: IDL.Nat64,
|
|
132
|
+
items_page: IDL.Opt(IDL.Nat64),
|
|
133
|
+
items: IDL.Vec(IDL.Tuple(IDL.Text, Doc)),
|
|
134
|
+
items_length: IDL.Nat64
|
|
135
|
+
});
|
|
136
|
+
const Permission = IDL.Variant({
|
|
137
|
+
Controllers: IDL.Null,
|
|
138
|
+
Private: IDL.Null,
|
|
139
|
+
Public: IDL.Null,
|
|
140
|
+
Managed: IDL.Null
|
|
141
|
+
});
|
|
142
|
+
const Rule = IDL.Record({
|
|
143
|
+
memory: IDL.Opt(Memory),
|
|
144
|
+
updated_at: IDL.Nat64,
|
|
145
|
+
max_size: IDL.Opt(IDL.Nat),
|
|
146
|
+
read: Permission,
|
|
147
|
+
created_at: IDL.Nat64,
|
|
148
|
+
mutable_permissions: IDL.Opt(IDL.Bool),
|
|
149
|
+
write: Permission
|
|
150
|
+
});
|
|
151
|
+
const SetController = IDL.Record({
|
|
152
|
+
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
153
|
+
scope: ControllerScope,
|
|
154
|
+
expires_at: IDL.Opt(IDL.Nat64)
|
|
155
|
+
});
|
|
156
|
+
const SetControllersArgs = IDL.Record({
|
|
157
|
+
controller: SetController,
|
|
158
|
+
controllers: IDL.Vec(IDL.Principal)
|
|
159
|
+
});
|
|
160
|
+
const SetDoc = IDL.Record({
|
|
161
|
+
updated_at: IDL.Opt(IDL.Nat64),
|
|
162
|
+
data: IDL.Vec(IDL.Nat8),
|
|
163
|
+
description: IDL.Opt(IDL.Text)
|
|
164
|
+
});
|
|
165
|
+
const SetRule = IDL.Record({
|
|
166
|
+
memory: IDL.Opt(Memory),
|
|
167
|
+
updated_at: IDL.Opt(IDL.Nat64),
|
|
168
|
+
max_size: IDL.Opt(IDL.Nat),
|
|
169
|
+
read: Permission,
|
|
170
|
+
mutable_permissions: IDL.Opt(IDL.Bool),
|
|
171
|
+
write: Permission
|
|
172
|
+
});
|
|
173
|
+
const UploadChunk = IDL.Record({
|
|
174
|
+
content: IDL.Vec(IDL.Nat8),
|
|
175
|
+
batch_id: IDL.Nat,
|
|
176
|
+
order_id: IDL.Opt(IDL.Nat)
|
|
177
|
+
});
|
|
178
|
+
const UploadChunkResult = IDL.Record({chunk_id: IDL.Nat});
|
|
179
|
+
return IDL.Service({
|
|
180
|
+
commit_asset_upload: IDL.Func([CommitBatch], [], []),
|
|
181
|
+
del_asset: IDL.Func([IDL.Text, IDL.Text], [], []),
|
|
182
|
+
del_assets: IDL.Func([IDL.Text], [], []),
|
|
183
|
+
del_controllers: IDL.Func(
|
|
184
|
+
[DeleteControllersArgs],
|
|
185
|
+
[IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],
|
|
186
|
+
[]
|
|
187
|
+
),
|
|
188
|
+
del_custom_domain: IDL.Func([IDL.Text], [], []),
|
|
189
|
+
del_doc: IDL.Func([IDL.Text, IDL.Text, DelDoc], [], []),
|
|
190
|
+
del_rule: IDL.Func([RulesType, IDL.Text, DelDoc], [], []),
|
|
191
|
+
get_config: IDL.Func([], [Config], []),
|
|
192
|
+
get_doc: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(Doc)], ['query']),
|
|
193
|
+
http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),
|
|
194
|
+
http_request_streaming_callback: IDL.Func(
|
|
195
|
+
[StreamingCallbackToken],
|
|
196
|
+
[StreamingCallbackHttpResponse],
|
|
197
|
+
['query']
|
|
198
|
+
),
|
|
199
|
+
init_asset_upload: IDL.Func([InitAssetKey], [InitUploadResult], []),
|
|
200
|
+
list_assets: IDL.Func([IDL.Text, ListParams], [ListResults], ['query']),
|
|
201
|
+
list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))], ['query']),
|
|
202
|
+
list_custom_domains: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, CustomDomain))], ['query']),
|
|
203
|
+
list_docs: IDL.Func([IDL.Text, ListParams], [ListResults_1], ['query']),
|
|
204
|
+
list_rules: IDL.Func([RulesType], [IDL.Vec(IDL.Tuple(IDL.Text, Rule))], ['query']),
|
|
205
|
+
set_config: IDL.Func([Config], [], []),
|
|
206
|
+
set_controllers: IDL.Func(
|
|
207
|
+
[SetControllersArgs],
|
|
208
|
+
[IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],
|
|
209
|
+
[]
|
|
210
|
+
),
|
|
211
|
+
set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),
|
|
212
|
+
set_doc: IDL.Func([IDL.Text, IDL.Text, SetDoc], [Doc], []),
|
|
213
|
+
set_rule: IDL.Func([RulesType, IDL.Text, SetRule], [], []),
|
|
214
|
+
upload_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], []),
|
|
215
|
+
version: IDL.Func([], [IDL.Text], ['query'])
|
|
216
|
+
});
|
|
217
|
+
};
|
|
218
|
+
// @ts-ignore
|
|
219
|
+
export const init = ({IDL}) => {
|
|
220
|
+
return [];
|
|
221
|
+
};
|
|
@@ -0,0 +1,221 @@
|
|
|
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 DeleteControllersArgs = IDL.Record({
|
|
9
|
+
controllers: IDL.Vec(IDL.Principal)
|
|
10
|
+
});
|
|
11
|
+
const ControllerScope = IDL.Variant({
|
|
12
|
+
Write: IDL.Null,
|
|
13
|
+
Admin: IDL.Null
|
|
14
|
+
});
|
|
15
|
+
const Controller = IDL.Record({
|
|
16
|
+
updated_at: IDL.Nat64,
|
|
17
|
+
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
18
|
+
created_at: IDL.Nat64,
|
|
19
|
+
scope: ControllerScope,
|
|
20
|
+
expires_at: IDL.Opt(IDL.Nat64)
|
|
21
|
+
});
|
|
22
|
+
const DelDoc = IDL.Record({updated_at: IDL.Opt(IDL.Nat64)});
|
|
23
|
+
const RulesType = IDL.Variant({Db: IDL.Null, Storage: IDL.Null});
|
|
24
|
+
const StorageConfig = IDL.Record({
|
|
25
|
+
rewrites: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
26
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))))
|
|
27
|
+
});
|
|
28
|
+
const Config = IDL.Record({storage: StorageConfig});
|
|
29
|
+
const Doc = IDL.Record({
|
|
30
|
+
updated_at: IDL.Nat64,
|
|
31
|
+
owner: IDL.Principal,
|
|
32
|
+
data: IDL.Vec(IDL.Nat8),
|
|
33
|
+
description: IDL.Opt(IDL.Text),
|
|
34
|
+
created_at: IDL.Nat64
|
|
35
|
+
});
|
|
36
|
+
const HttpRequest = IDL.Record({
|
|
37
|
+
url: IDL.Text,
|
|
38
|
+
method: IDL.Text,
|
|
39
|
+
body: IDL.Vec(IDL.Nat8),
|
|
40
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))
|
|
41
|
+
});
|
|
42
|
+
const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});
|
|
43
|
+
const StreamingCallbackToken = IDL.Record({
|
|
44
|
+
memory: Memory,
|
|
45
|
+
token: IDL.Opt(IDL.Text),
|
|
46
|
+
sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
47
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
48
|
+
index: IDL.Nat64,
|
|
49
|
+
encoding_type: IDL.Text,
|
|
50
|
+
full_path: IDL.Text
|
|
51
|
+
});
|
|
52
|
+
const StreamingStrategy = IDL.Variant({
|
|
53
|
+
Callback: IDL.Record({
|
|
54
|
+
token: StreamingCallbackToken,
|
|
55
|
+
callback: IDL.Func([], [], ['query'])
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
const HttpResponse = IDL.Record({
|
|
59
|
+
body: IDL.Vec(IDL.Nat8),
|
|
60
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
61
|
+
streaming_strategy: IDL.Opt(StreamingStrategy),
|
|
62
|
+
status_code: IDL.Nat16
|
|
63
|
+
});
|
|
64
|
+
const StreamingCallbackHttpResponse = IDL.Record({
|
|
65
|
+
token: IDL.Opt(StreamingCallbackToken),
|
|
66
|
+
body: IDL.Vec(IDL.Nat8)
|
|
67
|
+
});
|
|
68
|
+
const InitAssetKey = IDL.Record({
|
|
69
|
+
token: IDL.Opt(IDL.Text),
|
|
70
|
+
collection: IDL.Text,
|
|
71
|
+
name: IDL.Text,
|
|
72
|
+
description: IDL.Opt(IDL.Text),
|
|
73
|
+
encoding_type: IDL.Opt(IDL.Text),
|
|
74
|
+
full_path: IDL.Text
|
|
75
|
+
});
|
|
76
|
+
const InitUploadResult = IDL.Record({batch_id: IDL.Nat});
|
|
77
|
+
const ListOrderField = IDL.Variant({
|
|
78
|
+
UpdatedAt: IDL.Null,
|
|
79
|
+
Keys: IDL.Null,
|
|
80
|
+
CreatedAt: IDL.Null
|
|
81
|
+
});
|
|
82
|
+
const ListOrder = IDL.Record({field: ListOrderField, desc: IDL.Bool});
|
|
83
|
+
const ListMatcher = IDL.Record({
|
|
84
|
+
key: IDL.Opt(IDL.Text),
|
|
85
|
+
description: IDL.Opt(IDL.Text)
|
|
86
|
+
});
|
|
87
|
+
const ListPaginate = IDL.Record({
|
|
88
|
+
start_after: IDL.Opt(IDL.Text),
|
|
89
|
+
limit: IDL.Opt(IDL.Nat64)
|
|
90
|
+
});
|
|
91
|
+
const ListParams = IDL.Record({
|
|
92
|
+
order: IDL.Opt(ListOrder),
|
|
93
|
+
owner: IDL.Opt(IDL.Principal),
|
|
94
|
+
matcher: IDL.Opt(ListMatcher),
|
|
95
|
+
paginate: IDL.Opt(ListPaginate)
|
|
96
|
+
});
|
|
97
|
+
const AssetKey = IDL.Record({
|
|
98
|
+
token: IDL.Opt(IDL.Text),
|
|
99
|
+
collection: IDL.Text,
|
|
100
|
+
owner: IDL.Principal,
|
|
101
|
+
name: IDL.Text,
|
|
102
|
+
description: IDL.Opt(IDL.Text),
|
|
103
|
+
full_path: IDL.Text
|
|
104
|
+
});
|
|
105
|
+
const AssetEncodingNoContent = IDL.Record({
|
|
106
|
+
modified: IDL.Nat64,
|
|
107
|
+
sha256: IDL.Vec(IDL.Nat8),
|
|
108
|
+
total_length: IDL.Nat
|
|
109
|
+
});
|
|
110
|
+
const AssetNoContent = IDL.Record({
|
|
111
|
+
key: AssetKey,
|
|
112
|
+
updated_at: IDL.Nat64,
|
|
113
|
+
encodings: IDL.Vec(IDL.Tuple(IDL.Text, AssetEncodingNoContent)),
|
|
114
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
115
|
+
created_at: IDL.Nat64
|
|
116
|
+
});
|
|
117
|
+
const ListResults = IDL.Record({
|
|
118
|
+
matches_pages: IDL.Opt(IDL.Nat64),
|
|
119
|
+
matches_length: IDL.Nat64,
|
|
120
|
+
items_page: IDL.Opt(IDL.Nat64),
|
|
121
|
+
items: IDL.Vec(IDL.Tuple(IDL.Text, AssetNoContent)),
|
|
122
|
+
items_length: IDL.Nat64
|
|
123
|
+
});
|
|
124
|
+
const CustomDomain = IDL.Record({
|
|
125
|
+
updated_at: IDL.Nat64,
|
|
126
|
+
created_at: IDL.Nat64,
|
|
127
|
+
bn_id: IDL.Opt(IDL.Text)
|
|
128
|
+
});
|
|
129
|
+
const ListResults_1 = IDL.Record({
|
|
130
|
+
matches_pages: IDL.Opt(IDL.Nat64),
|
|
131
|
+
matches_length: IDL.Nat64,
|
|
132
|
+
items_page: IDL.Opt(IDL.Nat64),
|
|
133
|
+
items: IDL.Vec(IDL.Tuple(IDL.Text, Doc)),
|
|
134
|
+
items_length: IDL.Nat64
|
|
135
|
+
});
|
|
136
|
+
const Permission = IDL.Variant({
|
|
137
|
+
Controllers: IDL.Null,
|
|
138
|
+
Private: IDL.Null,
|
|
139
|
+
Public: IDL.Null,
|
|
140
|
+
Managed: IDL.Null
|
|
141
|
+
});
|
|
142
|
+
const Rule = IDL.Record({
|
|
143
|
+
memory: IDL.Opt(Memory),
|
|
144
|
+
updated_at: IDL.Nat64,
|
|
145
|
+
max_size: IDL.Opt(IDL.Nat),
|
|
146
|
+
read: Permission,
|
|
147
|
+
created_at: IDL.Nat64,
|
|
148
|
+
mutable_permissions: IDL.Opt(IDL.Bool),
|
|
149
|
+
write: Permission
|
|
150
|
+
});
|
|
151
|
+
const SetController = IDL.Record({
|
|
152
|
+
metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
153
|
+
scope: ControllerScope,
|
|
154
|
+
expires_at: IDL.Opt(IDL.Nat64)
|
|
155
|
+
});
|
|
156
|
+
const SetControllersArgs = IDL.Record({
|
|
157
|
+
controller: SetController,
|
|
158
|
+
controllers: IDL.Vec(IDL.Principal)
|
|
159
|
+
});
|
|
160
|
+
const SetDoc = IDL.Record({
|
|
161
|
+
updated_at: IDL.Opt(IDL.Nat64),
|
|
162
|
+
data: IDL.Vec(IDL.Nat8),
|
|
163
|
+
description: IDL.Opt(IDL.Text)
|
|
164
|
+
});
|
|
165
|
+
const SetRule = IDL.Record({
|
|
166
|
+
memory: IDL.Opt(Memory),
|
|
167
|
+
updated_at: IDL.Opt(IDL.Nat64),
|
|
168
|
+
max_size: IDL.Opt(IDL.Nat),
|
|
169
|
+
read: Permission,
|
|
170
|
+
mutable_permissions: IDL.Opt(IDL.Bool),
|
|
171
|
+
write: Permission
|
|
172
|
+
});
|
|
173
|
+
const UploadChunk = IDL.Record({
|
|
174
|
+
content: IDL.Vec(IDL.Nat8),
|
|
175
|
+
batch_id: IDL.Nat,
|
|
176
|
+
order_id: IDL.Opt(IDL.Nat)
|
|
177
|
+
});
|
|
178
|
+
const UploadChunkResult = IDL.Record({chunk_id: IDL.Nat});
|
|
179
|
+
return IDL.Service({
|
|
180
|
+
commit_asset_upload: IDL.Func([CommitBatch], [], []),
|
|
181
|
+
del_asset: IDL.Func([IDL.Text, IDL.Text], [], []),
|
|
182
|
+
del_assets: IDL.Func([IDL.Text], [], []),
|
|
183
|
+
del_controllers: IDL.Func(
|
|
184
|
+
[DeleteControllersArgs],
|
|
185
|
+
[IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],
|
|
186
|
+
[]
|
|
187
|
+
),
|
|
188
|
+
del_custom_domain: IDL.Func([IDL.Text], [], []),
|
|
189
|
+
del_doc: IDL.Func([IDL.Text, IDL.Text, DelDoc], [], []),
|
|
190
|
+
del_rule: IDL.Func([RulesType, IDL.Text, DelDoc], [], []),
|
|
191
|
+
get_config: IDL.Func([], [Config], []),
|
|
192
|
+
get_doc: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(Doc)], ['query']),
|
|
193
|
+
http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),
|
|
194
|
+
http_request_streaming_callback: IDL.Func(
|
|
195
|
+
[StreamingCallbackToken],
|
|
196
|
+
[StreamingCallbackHttpResponse],
|
|
197
|
+
['query']
|
|
198
|
+
),
|
|
199
|
+
init_asset_upload: IDL.Func([InitAssetKey], [InitUploadResult], []),
|
|
200
|
+
list_assets: IDL.Func([IDL.Text, ListParams], [ListResults], ['query']),
|
|
201
|
+
list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))], ['query']),
|
|
202
|
+
list_custom_domains: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, CustomDomain))], ['query']),
|
|
203
|
+
list_docs: IDL.Func([IDL.Text, ListParams], [ListResults_1], ['query']),
|
|
204
|
+
list_rules: IDL.Func([RulesType], [IDL.Vec(IDL.Tuple(IDL.Text, Rule))], ['query']),
|
|
205
|
+
set_config: IDL.Func([Config], [], []),
|
|
206
|
+
set_controllers: IDL.Func(
|
|
207
|
+
[SetControllersArgs],
|
|
208
|
+
[IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],
|
|
209
|
+
[]
|
|
210
|
+
),
|
|
211
|
+
set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),
|
|
212
|
+
set_doc: IDL.Func([IDL.Text, IDL.Text, SetDoc], [Doc], []),
|
|
213
|
+
set_rule: IDL.Func([RulesType, IDL.Text, SetRule], [], []),
|
|
214
|
+
upload_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], []),
|
|
215
|
+
version: IDL.Func([], [IDL.Text], ['query'])
|
|
216
|
+
});
|
|
217
|
+
};
|
|
218
|
+
// @ts-ignore
|
|
219
|
+
export const init = ({IDL}) => {
|
|
220
|
+
return [];
|
|
221
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var l=t=>t==null,Ot=t=>!l(t);var p=t=>Ot(t)?[t]:[],g=t=>t?.[0],z=async t=>{let e=new Blob([JSON.stringify(t)],{type:"application/json; charset=utf-8"});return new Uint8Array(await e.arrayBuffer())},G=async t=>{let e=new Blob([t instanceof Uint8Array?t:new Uint8Array(t)],{type:"application/json; charset=utf-8"});return JSON.parse(await e.text())},k=()=>typeof window<"u";var O=class{callbacks=[];populate(e){this.callbacks.forEach(({callback:s})=>s(e))}subscribe(e){let s=Symbol();return this.callbacks.push({id:s,callback:e}),()=>this.callbacks=this.callbacks.filter(({id:i})=>i!==s)}};var w=class t extends O{static instance;authUser=null;constructor(){super()}static getInstance(){return t.instance||(t.instance=new t),t.instance}set(e){this.authUser=e,this.populate(e)}get(){return this.authUser}subscribe(e){let s=super.subscribe(e);return e(this.authUser),s}reset(){this.authUser=null,this.populate(this.authUser)}};var W=({message:t,detail:e})=>{let s=new CustomEvent(t,{detail:e,bubbles:!0});document.dispatchEvent(s)};var Y=BigInt(144e11),J={width:576,height:576},X={width:505,height:705},Q="internetcomputer.org";var f=class t extends O{static instance;env;constructor(){super()}static getInstance(){return t.instance||(t.instance=new t),t.instance}set(e){this.env=e,this.populate(e)}get(){return this.env}localIdentity(){return this.get()?.localIdentityCanisterId!==void 0}subscribe(e){let s=super.subscribe(e);return e(this.env),s}};var B=({width:t,height:e})=>{if(!k()||l(window)||l(window.top))return;let{top:{innerWidth:s,innerHeight:i}}=window,o=i/2+screenY-e/2,r=s/2+screenX-t/2;return`toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=${t}, height=${e}, top=${o}, left=${r}`};var R=class{#t;constructor({domain:e}){this.#t=e}get id(){return"internet_identity"}signInOptions({windowed:e}){let s=f.getInstance().localIdentity()?`http://${f.getInstance().get()?.localIdentityCanisterId}.localhost:8000`:`https://identity.${this.#t??Q}`;return{...e!==!1&&{windowOpenerFeatures:B(J)},identityProvider:s}}},Z=class{#t;#e;constructor({appName:e,logoUrl:s}){this.#t=e,this.#e=s}get id(){return"nfid"}signInOptions({windowed:e}){return{...e!==!1&&{windowOpenerFeatures:B(X)},identityProvider:`https://nfid.one/authenticate/?applicationName=${encodeURI(this.#t)}&applicationLogo=${encodeURI(this.#e)}`}}};import{AuthClient as vt}from"@dfinity/auth-client";var U=()=>vt.create({idleOptions:{disableIdle:!0,disableDefaultIdleCallback:!0}});var $=async({data:t})=>{try{return await G(t)}catch(e){console.error("The data parsing has failed, mapping to undefined as a fallback.",e);return}};import{Principal as kt}from"@dfinity/principal";var C=({matcher:t,paginate:e,order:s,owner:i})=>({matcher:l(t)?[]:[{key:p(t.key),description:p(t.description)}],paginate:p(l(e)?void 0:{start_after:p(e.startAfter),limit:p(l(e.limit)?void 0:BigInt(e.limit))}),order:p(l(s)?void 0:{desc:s.desc,field:s.field==="created_at"?{CreatedAt:null}:s.field==="updated_at"?{UpdatedAt:null}:{Keys:null}}),owner:p(l(i)?void 0:typeof i=="string"?kt.fromText(i):i)});var I=({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)}),s=t.Record({controllers:t.Vec(t.Principal)}),i=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:i,expires_at:t.Opt(t.Nat64)}),r=t.Record({updated_at:t.Opt(t.Nat64)}),n=t.Variant({Db:t.Null,Storage:t.Null}),c=t.Record({rewrites:t.Vec(t.Tuple(t.Text,t.Text)),headers:t.Vec(t.Tuple(t.Text,t.Vec(t.Tuple(t.Text,t.Text))))}),d=t.Record({storage:c}),a=t.Record({updated_at:t.Nat64,owner:t.Principal,data:t.Vec(t.Nat8),description:t.Opt(t.Text),created_at:t.Nat64}),u=t.Record({url:t.Text,method:t.Text,body:t.Vec(t.Nat8),headers:t.Vec(t.Tuple(t.Text,t.Text))}),m=t.Variant({Heap:t.Null,Stable:t.Null}),h=t.Record({memory:m,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}),P=t.Variant({Callback:t.Record({token:h,callback:t.Func([],[],["query"])})}),b=t.Record({body:t.Vec(t.Nat8),headers:t.Vec(t.Tuple(t.Text,t.Text)),streaming_strategy:t.Opt(P),status_code:t.Nat16}),x=t.Record({token:t.Opt(h),body:t.Vec(t.Nat8)}),N=t.Record({token:t.Opt(t.Text),collection:t.Text,name:t.Text,description:t.Opt(t.Text),encoding_type:t.Opt(t.Text),full_path:t.Text}),y=t.Record({batch_id:t.Nat}),S=t.Variant({UpdatedAt:t.Null,Keys:t.Null,CreatedAt:t.Null}),F=t.Record({field:S,desc:t.Bool}),V=t.Record({key:t.Opt(t.Text),description:t.Opt(t.Text)}),mt=t.Record({start_after:t.Opt(t.Text),limit:t.Opt(t.Nat64)}),j=t.Record({order:t.Opt(F),owner:t.Opt(t.Principal),matcher:t.Opt(V),paginate:t.Opt(mt)}),yt=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}),ft=t.Record({modified:t.Nat64,sha256:t.Vec(t.Nat8),total_length:t.Nat}),gt=t.Record({key:yt,updated_at:t.Nat64,encodings:t.Vec(t.Tuple(t.Text,ft)),headers:t.Vec(t.Tuple(t.Text,t.Text)),created_at:t.Nat64}),ht=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,gt)),items_length:t.Nat64}),xt=t.Record({updated_at:t.Nat64,created_at:t.Nat64,bn_id:t.Opt(t.Text)}),Tt=t.Record({matches_pages:t.Opt(t.Nat64),matches_length:t.Nat64,items_page:t.Opt(t.Nat64),items:t.Vec(t.Tuple(t.Text,a)),items_length:t.Nat64}),v=t.Variant({Controllers:t.Null,Private:t.Null,Public:t.Null,Managed:t.Null}),At=t.Record({memory:t.Opt(m),updated_at:t.Nat64,max_size:t.Opt(t.Nat),read:v,created_at:t.Nat64,mutable_permissions:t.Opt(t.Bool),write:v}),_t=t.Record({metadata:t.Vec(t.Tuple(t.Text,t.Text)),scope:i,expires_at:t.Opt(t.Nat64)}),wt=t.Record({controller:_t,controllers:t.Vec(t.Principal)}),Pt=t.Record({updated_at:t.Opt(t.Nat64),data:t.Vec(t.Nat8),description:t.Opt(t.Text)}),bt=t.Record({memory:t.Opt(m),updated_at:t.Opt(t.Nat64),max_size:t.Opt(t.Nat),read:v,mutable_permissions:t.Opt(t.Bool),write:v}),Nt=t.Record({content:t.Vec(t.Nat8),batch_id:t.Nat,order_id:t.Opt(t.Nat)}),St=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.Text],[],[]),del_controllers:t.Func([s],[t.Vec(t.Tuple(t.Principal,o))],[]),del_custom_domain:t.Func([t.Text],[],[]),del_doc:t.Func([t.Text,t.Text,r],[],[]),del_rule:t.Func([n,t.Text,r],[],[]),get_config:t.Func([],[d],[]),get_doc:t.Func([t.Text,t.Text],[t.Opt(a)],["query"]),http_request:t.Func([u],[b],["query"]),http_request_streaming_callback:t.Func([h],[x],["query"]),init_asset_upload:t.Func([N],[y],[]),list_assets:t.Func([t.Text,j],[ht],["query"]),list_controllers:t.Func([],[t.Vec(t.Tuple(t.Principal,o))],["query"]),list_custom_domains:t.Func([],[t.Vec(t.Tuple(t.Text,xt))],["query"]),list_docs:t.Func([t.Text,j],[Tt],["query"]),list_rules:t.Func([n],[t.Vec(t.Tuple(t.Text,At))],["query"]),set_config:t.Func([d],[],[]),set_controllers:t.Func([wt],[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,Pt],[a],[]),set_rule:t.Func([n,t.Text,bt],[],[]),upload_asset_chunk:t.Func([Nt],[St],[]),version:t.Func([],[t.Text],["query"])})};import{Actor as Rt,HttpAgent as Ut}from"@dfinity/agent";var D=async({satelliteId:t,idlFactory:e,identity:s,fetch:i,env:o="prod"})=>{let r=o==="dev"||f.getInstance().localIdentity(),n=r?"http://127.0.0.1:8000/":"https://icp-api.io",c=new Ut({identity:s,...n&&{host:n},...i&&{fetch:i}});return r&&await c.fetchRootKey(),Rt.createActor(e,{agent:c,canisterId:t})};var T=async({satelliteId:t,...e})=>{let{satelliteId:s}=t!==void 0?{satelliteId:t}:f.getInstance().get()??{satelliteId:void 0};if(!s)throw new Error("No satellite principal defined.");return D({satelliteId:s,idlFactory:I,...e})};var L=async({collection:t,key:e,satellite:s})=>{let i=await T(s),o=g(await i.get_doc(t,e));if(l(o))return;let{data:r,owner:n,description:c,...d}=o,a=await $({data:r});return{key:e,description:g(c),owner:n.toText(),data:a,...d}},tt=async({collection:t,doc:e,satellite:s})=>{let i=await T(s),{key:o,data:r,updated_at:n,description:c}=e,d=await i.set_doc(t,o,{description:p(c),data:await z(r),updated_at:p(n)}),{owner:a,updated_at:u,created_at:m,description:h}=d;return{key:o,description:g(h),owner:a.toText(),data:r,created_at:m,updated_at:u}},et=async({collection:t,doc:e,satellite:s})=>{let i=await T(s),{key:o,updated_at:r}=e;return i.del_doc(t,o,{updated_at:p(r)})},st=async({collection:t,filter:e,satellite:s})=>{let i=await T(s),{items:o,items_page:r,items_length:n,matches_length:c,matches_pages:d}=await i.list_docs(t,C(e)),a=[];for(let[u,m]of o){let{data:h,owner:P,description:b,...x}=m;a.push({key:u,description:g(b),owner:P.toText(),data:await $({data:h}),...x})}return{items:a,items_length:n,items_page:g(r),matches_length:c,matches_pages:g(d)}};import{AnonymousIdentity as Ct}from"@dfinity/agent";var A=t=>t!==void 0?t:E()??new Ct;var it=async({satellite:t,...e})=>{let s=A(t?.identity);return L({...e,satellite:{...t,identity:s}})},ot=async({satellite:t,...e})=>{let s=A(t?.identity);return tt({...e,satellite:{...t,identity:s}})},Pe=async({satellite:t,...e})=>{let s=A(t?.identity);return et({...e,satellite:{...t,identity:s}})},be=async({satellite:t,filter:e,...s})=>{let i=A(t?.identity);return st({...s,filter:e??{},satellite:{...t,identity:i}})};var rt=async t=>{let e=E();if(l(e))throw new Error("No identity to initialize the user. Have you initialized Juno?");let s=e.getPrincipal().toText(),i=await it({collection:"#user",key:s});return l(i)?await Et({userId:s,provider:t}):i},Et=async({userId:t,...e})=>ot({collection:"#user",doc:{key:t,data:e}});var _,q=async t=>{if(_=_??await U(),!(await _?.isAuthenticated()??!1))return;let s=await rt(t);w.getInstance().set(s)},Ft=async t=>new Promise(async(e,s)=>{_=_??await U();let i=t?.provider??new R({});await _.login({onSuccess:async()=>{await q(i.id),e()},onError:o=>s(o),maxTimeToLive:t?.maxTimeToLive??Y,...t?.derivationOrigin!==void 0&&{derivationOrigin:t.derivationOrigin},...i.signInOptions({windowed:t?.windowed})})}),M=async()=>{await _?.logout(),_=void 0,w.getInstance().reset()},E=()=>_?.getIdentity(),Vt=async()=>(_??await U()).getIdentity();var nt=t=>{let e=t===!0?"./workers/auth.worker.js":t,s=new Worker(e),i=async()=>{W({message:"junoSignOutAuthTimer"}),await M()};return s.onmessage=async({data:o})=>{let{msg:r}=o;switch(r){case"junoSignOutAuthTimer":await i();return}},w.getInstance().subscribe(o=>{if(l(o)){s.postMessage({msg:"junoStopAuthTimer"});return}s.postMessage({msg:"junoStartAuthTimer"})})};var at=async({data:t,filename:e,collection:s,headers:i,token:o,fullPath:r,encoding:n,description:c,satellite:d})=>{let a=await T(d),{batch_id:u}=await a.init_asset_upload({collection:s,full_path:r,name:e,token:p(o),encoding_type:p(n),description:p(c)}),m=19e5,h=[],P=k()?new Blob([await t.arrayBuffer()]):t,b=0n;for(let y=0;y<P.size;y+=m){let S=P.slice(y,y+m);h.push({batchId:u,chunk:S,actor:a,orderId:b}),b++}let x=[];for await(let y of Bt({uploadChunks:h}))x=[...x,...y];let N=i.find(([y,S])=>y.toLowerCase()==="content-type")===void 0&&t.type!==void 0&&t.type!==""?[["Content-Type",t.type]]:void 0;await a.commit_asset_upload({batch_id:u,chunk_ids:x.map(({chunk_id:y})=>y),headers:[...i,...N||[]]})};async function*Bt({uploadChunks:t,limit:e=12}){for(let s=0;s<t.length;s=s+e){let i=t.slice(s,s+e);yield await Promise.all(i.map(r=>$t(r)))}}var $t=async({batchId:t,chunk:e,actor:s,orderId:i})=>s.upload_asset_chunk({batch_id:t,content:new Uint8Array(await e.arrayBuffer()),order_id:p(i)}),ct=async({collection:t,satellite:e,filter:s})=>{let i=await T(e),{items:o,items_length:r,items_page:n,matches_length:c,matches_pages:d}=await i.list_assets(t,C(s));return{items:o.map(([a,u])=>u),items_length:r,items_page:g(n),matches_length:c,matches_pages:g(d)}},lt=async({collection:t,fullPath:e,satellite:s})=>(await T(s)).del_asset(t,e),pt=async({collection:t,satellite:e})=>(await T(e)).del_assets(t);var dt=t=>btoa([...t].map(e=>String.fromCharCode(e)).join(""));var K=()=>{let t=f.getInstance().get()?.satelliteId??"unknown";return f.getInstance().localIdentity()?`http://${t}.localhost:8000`:`https://${t}.icp0.io`};var H=t=>encodeURI(t.toLowerCase().replace(/\s/g,"-"));var es=async t=>ut(t),ss=async t=>ut({filename:t.data.name,...t}),ut=async({filename:t,data:e,collection:s,headers:i=[],fullPath:o,token:r,satellite:n,encoding:c,description:d})=>{let a=A(n?.identity),u=H(t),m=o||`/${s}/${u}`;return await at({data:e,filename:H(u),collection:s,token:r,headers:i,fullPath:m,encoding:c,satellite:{...n,identity:a},description:d}),{downloadUrl:`${K()}${m}${r!==void 0?`?token=${r}`:""}`,fullPath:m,name:u}},is=async({collection:t,satellite:e,filter:s})=>{let{items:i,...o}=await ct({collection:t,satellite:{...e,identity:A(e?.identity)},filter:s??{}}),r=K();return{assets:i.map(({key:{full_path:n,token:c,name:d,owner:a,description:u},headers:m,encodings:h,created_at:P,updated_at:b})=>{let x=g(c);return{fullPath:n,description:g(u),name:d,downloadUrl:`${r}${n}${x!==void 0?`?token=${x}`:""}`,token:x,headers:m,encodings:h.reduce((N,[y,{modified:S,sha256:F,total_length:V}])=>({...N,[y]:{modified:S,sha256:dt(F),total_length:V}}),{}),owner:a.toText(),created_at:P,updated_at:b}}),...o}},os=async({collection:t,fullPath:e,satellite:s})=>lt({collection:t,fullPath:e,satellite:{...s,identity:A(s?.identity)}}),rs=async({collection:t,satellite:e})=>pt({collection:t,satellite:{...e,identity:A(e?.identity)}});var ds=async t=>{f.getInstance().set(t),await q();let e=t.workers?.auth!==void 0?nt(t.workers.auth):void 0;return[...e?[e]:[]]},us=t=>w.getInstance().subscribe(t);export{R as InternetIdentityProvider,Z as NFIDProvider,us as authSubscribe,os as deleteAsset,rs as deleteAssets,Pe as deleteDoc,it as getDoc,ds as initJuno,is as listAssets,be as listDocs,ot as setDoc,Ft as signIn,M as signOut,Vt as unsafeIdentity,es as uploadBlob,ss as uploadFile};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../utils/src/utils/debounce.utils.ts", "../../../utils/src/utils/null.utils.ts", "../../../utils/src/utils/did.utils.ts", "../../../utils/src/utils/env.utils.ts", "../../src/stores/store.ts", "../../src/stores/auth.store.ts", "../../src/utils/events.utils.ts", "../../src/constants/auth.constants.ts", "../../src/stores/env.store.ts", "../../src/utils/window.utils.ts", "../../src/providers/auth.providers.ts", "../../src/utils/auth.utils.ts", "../../src/utils/data.utils.ts", "../../src/utils/list.utils.ts", "../../declarations/satellite/satellite.factory.did.js", "../../src/utils/actor.utils.ts", "../../src/api/actor.api.ts", "../../src/api/doc.api.ts", "../../src/services/identity.services.ts", "../../src/services/doc.services.ts", "../../src/services/user.services.ts", "../../src/services/auth.services.ts", "../../src/services/auth-timout.services.ts", "../../src/api/storage.api.ts", "../../src/utils/crypto.utils.ts", "../../src/utils/env.utils.ts", "../../src/utils/storage.utils.ts", "../../src/services/storage.services.ts", "../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable-next-line @typescript-eslint/ban-types */\nexport const debounce = (func: Function, timeout?: number) => {\n let timer: NodeJS.Timer | undefined;\n\n return (...args: unknown[]) => {\n const next = () => func(...args);\n\n if (timer) {\n clearTimeout(timer);\n }\n\n timer = setTimeout(next, timeout !== undefined && timeout > 0 ? timeout : 300);\n };\n};\n", "/** Is null or undefined */\nexport const isNullish = <T>(argument: T | undefined | null): argument is undefined | null =>\n argument === null || argument === undefined;\n\n/** Not null and not undefined */\nexport const nonNullish = <T>(argument: T | undefined | null): argument is NonNullable<T> =>\n !isNullish(argument);\n\nexport class NullishError extends Error {}\n\nexport const assertNonNullish: <T>(\n value: T,\n message?: string\n) => asserts value is NonNullable<T> = <T>(value: T, message?: string): void => {\n if (isNullish(value)) {\n throw new NullishError(message);\n }\n};\n", "import {nonNullish} from './null.utils';\n\nexport const toNullable = <T>(value?: T): [] | [T] => {\n return nonNullish(value) ? [value] : [];\n};\n\nexport const fromNullable = <T>(value: [] | [T]): T | undefined => {\n return value?.[0];\n};\n\nexport const toArray = async <T>(data: T): Promise<Uint8Array> => {\n const blob: Blob = new Blob([JSON.stringify(data)], {\n type: 'application/json; charset=utf-8'\n });\n return new Uint8Array(await blob.arrayBuffer());\n};\n\nexport const fromArray = async <T>(data: Uint8Array | number[]): Promise<T> => {\n const blob: Blob = new Blob([data instanceof Uint8Array ? data : new Uint8Array(data)], {\n type: 'application/json; charset=utf-8'\n });\n return JSON.parse(await blob.text());\n};\n", "export const isBrowser = () => typeof window !== `undefined`;\n", "export abstract class Store<T> {\n private callbacks: {id: symbol; callback: (data: T | null) => void}[] = [];\n\n protected populate(data: T | null) {\n this.callbacks.forEach(({callback}: {id: symbol; callback: (data: T | null) => void}) =>\n callback(data)\n );\n }\n\n subscribe(callback: (data: T | null) => void): () => void {\n const callbackId = Symbol();\n this.callbacks.push({id: callbackId, callback});\n\n return () =>\n (this.callbacks = this.callbacks.filter(\n ({id}: {id: symbol; callback: (data: T | null) => void}) => id !== callbackId\n ));\n }\n}\n", "import type {User} from '../types/auth.types';\nimport type {Unsubscribe} from '../types/subscription.types';\nimport {Store} from './store';\n\nexport class AuthStore extends Store<User | null> {\n private static instance: AuthStore;\n\n private authUser: User | null = null;\n\n private constructor() {\n super();\n }\n\n static getInstance() {\n if (!AuthStore.instance) {\n AuthStore.instance = new AuthStore();\n }\n return AuthStore.instance;\n }\n\n set(authUser: User | null) {\n this.authUser = authUser;\n\n this.populate(authUser);\n }\n\n get(): User | null {\n return this.authUser;\n }\n\n override subscribe(callback: (data: User | null) => void): Unsubscribe {\n const unsubscribe: () => void = super.subscribe(callback);\n\n callback(this.authUser);\n\n return unsubscribe;\n }\n\n reset() {\n this.authUser = null;\n\n this.populate(this.authUser);\n }\n}\n", "export const emit = <T>({message, detail}: {message: string; detail?: T | undefined}) => {\n const $event: CustomEvent<T> = new CustomEvent<T>(message, {detail, bubbles: true});\n document.dispatchEvent($event);\n};\n", "// How long the delegation identity should remain valid?\n// e.g. BigInt(7 * 24 * 60 * 60 * 1000 * 1000 * 1000) = 7 days in nanoseconds\n// For Juno: 4 hours\nexport const DELEGATION_IDENTITY_EXPIRATION = BigInt(4 * 60 * 60 * 1000 * 1000 * 1000);\n\nexport const II_POPUP: {width: number; height: number} = {width: 576, height: 576};\nexport const NFID_POPUP: {width: number; height: number} = {width: 505, height: 705};\n\nexport const INTERNET_COMPUTER_ORG = 'internetcomputer.org';\n\n// Worker\nexport const AUTH_TIMER_INTERVAL = 1000;\n", "import type {Environment} from '../types/env.types';\nimport {Store} from './store';\n\nexport class EnvStore extends Store<Environment | undefined> {\n private static instance: EnvStore;\n\n private env: Environment | undefined;\n\n private constructor() {\n super();\n }\n\n static getInstance() {\n if (!EnvStore.instance) {\n EnvStore.instance = new EnvStore();\n }\n return EnvStore.instance;\n }\n\n set(env: Environment | undefined) {\n this.env = env;\n\n this.populate(env);\n }\n\n get(): Environment | undefined {\n return this.env;\n }\n\n localIdentity(): boolean {\n return this.get()?.localIdentityCanisterId !== undefined;\n }\n\n override subscribe(callback: (data: Environment | null | undefined) => void): () => void {\n const unsubscribe: () => void = super.subscribe(callback);\n\n callback(this.env);\n\n return unsubscribe;\n }\n}\n", "import {isBrowser, isNullish} from '@junobuild/utils';\n\nexport const popupCenter = ({\n width,\n height\n}: {\n width: number;\n height: number;\n}): string | undefined => {\n if (!isBrowser()) {\n return undefined;\n }\n\n if (isNullish(window) || isNullish(window.top)) {\n return undefined;\n }\n\n const {\n top: {innerWidth, innerHeight}\n } = window;\n\n const y = innerHeight / 2 + screenY - height / 2;\n const x = innerWidth / 2 + screenX - width / 2;\n\n return `toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=${width}, height=${height}, top=${y}, left=${x}`;\n};\n", "import {II_POPUP, INTERNET_COMPUTER_ORG, NFID_POPUP} from '../constants/auth.constants';\nimport {EnvStore} from '../stores/env.store';\nimport type {Provider, SignInOptions} from '../types/auth.types';\nimport {popupCenter} from '../utils/window.utils';\n\nexport interface AuthProvider {\n readonly id: Provider;\n signInOptions: (options: Pick<SignInOptions, 'windowed'>) => {\n identityProvider: string;\n windowOpenerFeatures?: string;\n };\n}\n\nexport class InternetIdentityProvider implements AuthProvider {\n #domain?: 'internetcomputer.org' | 'ic0.app';\n\n constructor({domain}: {domain?: 'internetcomputer.org' | 'ic0.app'}) {\n this.#domain = domain;\n }\n\n get id(): Provider {\n return 'internet_identity';\n }\n\n signInOptions({windowed}: Pick<SignInOptions, 'windowed'>): {\n identityProvider: string;\n windowOpenerFeatures?: string;\n } {\n const identityProvider = EnvStore.getInstance().localIdentity()\n ? `http://${EnvStore.getInstance().get()?.localIdentityCanisterId}.localhost:8000`\n : `https://identity.${this.#domain ?? INTERNET_COMPUTER_ORG}`;\n\n return {\n ...(windowed !== false && {\n windowOpenerFeatures: popupCenter(II_POPUP)\n }),\n identityProvider\n };\n }\n}\n\nexport class NFIDProvider implements AuthProvider {\n #appName: string;\n #logoUrl: string;\n\n constructor({appName, logoUrl}: {appName: string; logoUrl: string}) {\n this.#appName = appName;\n this.#logoUrl = logoUrl;\n }\n\n get id(): Provider {\n return 'nfid';\n }\n\n signInOptions({windowed}: Pick<SignInOptions, 'windowed'>): {\n identityProvider: string;\n windowOpenerFeatures?: string;\n } {\n return {\n ...(windowed !== false && {\n windowOpenerFeatures: popupCenter(NFID_POPUP)\n }),\n identityProvider: `https://nfid.one/authenticate/?applicationName=${encodeURI(\n this.#appName\n )}&applicationLogo=${encodeURI(this.#logoUrl)}`\n };\n }\n}\n", "import {AuthClient} from '@dfinity/auth-client';\n\nexport const createAuthClient = (): Promise<AuthClient> =>\n AuthClient.create({\n idleOptions: {\n disableIdle: true,\n disableDefaultIdleCallback: true\n }\n });\n", "import {fromArray} from '@junobuild/utils';\nimport type {Doc} from '../../declarations/satellite/satellite.did';\n\nexport const mapData = async <D>({data}: Pick<Doc, 'data'>): Promise<D> => {\n try {\n return await fromArray<D>(data);\n } catch (err: unknown) {\n console.error('The data parsing has failed, mapping to undefined as a fallback.', err);\n return undefined as D;\n }\n};\n", "import {Principal} from '@dfinity/principal';\nimport {isNullish, toNullable} from '@junobuild/utils';\nimport type {ListParams as ListParamsApi} from '../../declarations/satellite/satellite.did';\nimport type {ListParams} from '../types/list.types';\n\nexport const toListParams = ({matcher, paginate, order, owner}: ListParams): ListParamsApi => ({\n matcher: isNullish(matcher)\n ? []\n : [\n {\n key: toNullable(matcher.key),\n description: toNullable(matcher.description)\n }\n ],\n paginate: toNullable(\n isNullish(paginate)\n ? undefined\n : {\n start_after: toNullable(paginate.startAfter),\n limit: toNullable(isNullish(paginate.limit) ? undefined : BigInt(paginate.limit))\n }\n ),\n order: toNullable(\n isNullish(order)\n ? undefined\n : {\n desc: order.desc,\n field:\n order.field === 'created_at'\n ? {CreatedAt: null}\n : order.field === 'updated_at'\n ? {UpdatedAt: null}\n : {Keys: null}\n }\n ),\n owner: toNullable(\n isNullish(owner) ? undefined : typeof owner === 'string' ? Principal.fromText(owner) : owner\n )\n});\n", "// @ts-ignore\nexport const idlFactory = ({IDL}) => {\n const CommitBatch = IDL.Record({\n batch_id: IDL.Nat,\n headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n chunk_ids: IDL.Vec(IDL.Nat)\n });\n const DeleteControllersArgs = IDL.Record({\n controllers: IDL.Vec(IDL.Principal)\n });\n const ControllerScope = IDL.Variant({\n Write: IDL.Null,\n Admin: IDL.Null\n });\n const Controller = IDL.Record({\n updated_at: IDL.Nat64,\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n created_at: IDL.Nat64,\n scope: ControllerScope,\n expires_at: IDL.Opt(IDL.Nat64)\n });\n const DelDoc = IDL.Record({updated_at: IDL.Opt(IDL.Nat64)});\n const RulesType = IDL.Variant({Db: IDL.Null, Storage: IDL.Null});\n const StorageConfig = IDL.Record({\n rewrites: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))))\n });\n const Config = IDL.Record({storage: StorageConfig});\n const Doc = IDL.Record({\n updated_at: IDL.Nat64,\n owner: IDL.Principal,\n data: IDL.Vec(IDL.Nat8),\n description: IDL.Opt(IDL.Text),\n created_at: IDL.Nat64\n });\n const HttpRequest = IDL.Record({\n url: IDL.Text,\n method: IDL.Text,\n body: IDL.Vec(IDL.Nat8),\n headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))\n });\n const Memory = IDL.Variant({Heap: IDL.Null, Stable: IDL.Null});\n const StreamingCallbackToken = IDL.Record({\n memory: Memory,\n token: IDL.Opt(IDL.Text),\n sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),\n headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n index: IDL.Nat64,\n encoding_type: IDL.Text,\n full_path: IDL.Text\n });\n const StreamingStrategy = IDL.Variant({\n Callback: IDL.Record({\n token: StreamingCallbackToken,\n callback: IDL.Func([], [], ['query'])\n })\n });\n const HttpResponse = IDL.Record({\n body: IDL.Vec(IDL.Nat8),\n headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n streaming_strategy: IDL.Opt(StreamingStrategy),\n status_code: IDL.Nat16\n });\n const StreamingCallbackHttpResponse = IDL.Record({\n token: IDL.Opt(StreamingCallbackToken),\n body: IDL.Vec(IDL.Nat8)\n });\n const InitAssetKey = IDL.Record({\n token: IDL.Opt(IDL.Text),\n collection: IDL.Text,\n name: IDL.Text,\n description: IDL.Opt(IDL.Text),\n encoding_type: IDL.Opt(IDL.Text),\n full_path: IDL.Text\n });\n const InitUploadResult = IDL.Record({batch_id: IDL.Nat});\n const ListOrderField = IDL.Variant({\n UpdatedAt: IDL.Null,\n Keys: IDL.Null,\n CreatedAt: IDL.Null\n });\n const ListOrder = IDL.Record({field: ListOrderField, desc: IDL.Bool});\n const ListMatcher = IDL.Record({\n key: IDL.Opt(IDL.Text),\n description: IDL.Opt(IDL.Text)\n });\n const ListPaginate = IDL.Record({\n start_after: IDL.Opt(IDL.Text),\n limit: IDL.Opt(IDL.Nat64)\n });\n const ListParams = IDL.Record({\n order: IDL.Opt(ListOrder),\n owner: IDL.Opt(IDL.Principal),\n matcher: IDL.Opt(ListMatcher),\n paginate: IDL.Opt(ListPaginate)\n });\n const AssetKey = IDL.Record({\n token: IDL.Opt(IDL.Text),\n collection: IDL.Text,\n owner: IDL.Principal,\n name: IDL.Text,\n description: IDL.Opt(IDL.Text),\n full_path: IDL.Text\n });\n const AssetEncodingNoContent = IDL.Record({\n modified: IDL.Nat64,\n sha256: IDL.Vec(IDL.Nat8),\n total_length: IDL.Nat\n });\n const AssetNoContent = IDL.Record({\n key: AssetKey,\n updated_at: IDL.Nat64,\n encodings: IDL.Vec(IDL.Tuple(IDL.Text, AssetEncodingNoContent)),\n headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n created_at: IDL.Nat64\n });\n const ListResults = IDL.Record({\n matches_pages: IDL.Opt(IDL.Nat64),\n matches_length: IDL.Nat64,\n items_page: IDL.Opt(IDL.Nat64),\n items: IDL.Vec(IDL.Tuple(IDL.Text, AssetNoContent)),\n items_length: IDL.Nat64\n });\n const CustomDomain = IDL.Record({\n updated_at: IDL.Nat64,\n created_at: IDL.Nat64,\n bn_id: IDL.Opt(IDL.Text)\n });\n const ListResults_1 = IDL.Record({\n matches_pages: IDL.Opt(IDL.Nat64),\n matches_length: IDL.Nat64,\n items_page: IDL.Opt(IDL.Nat64),\n items: IDL.Vec(IDL.Tuple(IDL.Text, Doc)),\n items_length: IDL.Nat64\n });\n const Permission = IDL.Variant({\n Controllers: IDL.Null,\n Private: IDL.Null,\n Public: IDL.Null,\n Managed: IDL.Null\n });\n const Rule = IDL.Record({\n memory: IDL.Opt(Memory),\n updated_at: IDL.Nat64,\n max_size: IDL.Opt(IDL.Nat),\n read: Permission,\n created_at: IDL.Nat64,\n mutable_permissions: IDL.Opt(IDL.Bool),\n write: Permission\n });\n const SetController = IDL.Record({\n metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),\n scope: ControllerScope,\n expires_at: IDL.Opt(IDL.Nat64)\n });\n const SetControllersArgs = IDL.Record({\n controller: SetController,\n controllers: IDL.Vec(IDL.Principal)\n });\n const SetDoc = IDL.Record({\n updated_at: IDL.Opt(IDL.Nat64),\n data: IDL.Vec(IDL.Nat8),\n description: IDL.Opt(IDL.Text)\n });\n const SetRule = IDL.Record({\n memory: IDL.Opt(Memory),\n updated_at: IDL.Opt(IDL.Nat64),\n max_size: IDL.Opt(IDL.Nat),\n read: Permission,\n mutable_permissions: IDL.Opt(IDL.Bool),\n write: Permission\n });\n const UploadChunk = IDL.Record({\n content: IDL.Vec(IDL.Nat8),\n batch_id: IDL.Nat,\n order_id: IDL.Opt(IDL.Nat)\n });\n const UploadChunkResult = IDL.Record({chunk_id: IDL.Nat});\n return IDL.Service({\n commit_asset_upload: IDL.Func([CommitBatch], [], []),\n del_asset: IDL.Func([IDL.Text, IDL.Text], [], []),\n del_assets: IDL.Func([IDL.Text], [], []),\n del_controllers: IDL.Func(\n [DeleteControllersArgs],\n [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],\n []\n ),\n del_custom_domain: IDL.Func([IDL.Text], [], []),\n del_doc: IDL.Func([IDL.Text, IDL.Text, DelDoc], [], []),\n del_rule: IDL.Func([RulesType, IDL.Text, DelDoc], [], []),\n get_config: IDL.Func([], [Config], []),\n get_doc: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(Doc)], ['query']),\n http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),\n http_request_streaming_callback: IDL.Func(\n [StreamingCallbackToken],\n [StreamingCallbackHttpResponse],\n ['query']\n ),\n init_asset_upload: IDL.Func([InitAssetKey], [InitUploadResult], []),\n list_assets: IDL.Func([IDL.Text, ListParams], [ListResults], ['query']),\n list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))], ['query']),\n list_custom_domains: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, CustomDomain))], ['query']),\n list_docs: IDL.Func([IDL.Text, ListParams], [ListResults_1], ['query']),\n list_rules: IDL.Func([RulesType], [IDL.Vec(IDL.Tuple(IDL.Text, Rule))], ['query']),\n set_config: IDL.Func([Config], [], []),\n set_controllers: IDL.Func(\n [SetControllersArgs],\n [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],\n []\n ),\n set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),\n set_doc: IDL.Func([IDL.Text, IDL.Text, SetDoc], [Doc], []),\n set_rule: IDL.Func([RulesType, IDL.Text, SetRule], [], []),\n upload_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], []),\n version: IDL.Func([], [IDL.Text], ['query'])\n });\n};\n// @ts-ignore\nexport const init = ({IDL}) => {\n return [];\n};\n", "import type {ActorMethod, ActorSubclass} from '@dfinity/agent';\nimport {Actor, HttpAgent} from '@dfinity/agent';\nimport type {IDL} from '@dfinity/candid';\nimport {EnvStore} from '../stores/env.store';\nimport type {Satellite} from '../types/satellite.types';\n\nexport const createActor = async <T = Record<string, ActorMethod>>({\n satelliteId: canisterId,\n idlFactory,\n identity,\n fetch,\n env = 'prod'\n}: {\n idlFactory: IDL.InterfaceFactory;\n} & Required<Pick<Satellite, 'satelliteId' | 'identity'>> &\n Pick<Satellite, 'fetch' | 'env'>): Promise<ActorSubclass<T>> => {\n const localActor = env === 'dev' || EnvStore.getInstance().localIdentity();\n\n const host: string = localActor ? 'http://127.0.0.1:8000/' : 'https://icp-api.io';\n\n const agent: HttpAgent = new HttpAgent({identity, ...(host && {host}), ...(fetch && {fetch})});\n\n if (localActor) {\n // Fetch root key for certificate validation during development\n await agent.fetchRootKey();\n }\n\n // Creates an actor with using the candid interface and the HttpAgent\n return Actor.createActor(idlFactory, {\n agent,\n canisterId\n });\n};\n", "import type {_SERVICE as SatelliteActor} from '../../declarations/satellite/satellite.did';\nimport {idlFactory} from '../../declarations/satellite/satellite.factory.did.js';\nimport {EnvStore} from '../stores/env.store';\nimport type {Satellite} from '../types/satellite.types';\nimport {createActor} from '../utils/actor.utils';\n\nexport const getSatelliteActor = async ({\n satelliteId,\n ...rest\n}: Satellite): Promise<SatelliteActor> => {\n const {satelliteId: canisterId} =\n satelliteId !== undefined\n ? {satelliteId}\n : EnvStore.getInstance().get() ?? {satelliteId: undefined};\n\n if (!canisterId) {\n throw new Error('No satellite principal defined.');\n }\n\n return createActor({\n satelliteId: canisterId,\n idlFactory,\n ...rest\n });\n};\n", "import {fromNullable, isNullish, toArray, toNullable} from '@junobuild/utils';\nimport type {\n Doc as DocApi,\n ListResults_1 as ListDocsApi,\n _SERVICE as SatelliteActor\n} from '../../declarations/satellite/satellite.did';\nimport type {Doc} from '../types/doc.types';\nimport type {ListParams, ListResults} from '../types/list.types';\nimport type {Satellite} from '../types/satellite.types';\nimport {mapData} from '../utils/data.utils';\nimport {toListParams} from '../utils/list.utils';\nimport {getSatelliteActor} from './actor.api';\n\nexport const getDoc = async <D>({\n collection,\n key,\n satellite\n}: {\n collection: string;\n satellite: Satellite;\n} & Pick<Doc<D>, 'key'>): Promise<Doc<D> | undefined> => {\n const actor: SatelliteActor = await getSatelliteActor(satellite);\n\n const entry: DocApi | undefined = fromNullable(await actor.get_doc(collection, key));\n\n if (isNullish(entry)) {\n return undefined;\n }\n\n const {data: dataArray, owner, description, ...rest} = entry;\n\n const data: D = await mapData<D>({data: dataArray});\n\n return {\n key,\n description: fromNullable(description),\n owner: owner.toText(),\n data,\n ...rest\n };\n};\n\nexport const setDoc = async <D>({\n collection,\n doc,\n satellite\n}: {\n collection: string;\n doc: Doc<D>;\n satellite: Satellite;\n}): Promise<Doc<D>> => {\n const actor: SatelliteActor = await getSatelliteActor(satellite);\n\n const {key, data, updated_at, description} = doc;\n\n const updatedDoc: DocApi = await actor.set_doc(collection, key, {\n description: toNullable(description),\n data: await toArray<D>(data),\n updated_at: toNullable(updated_at)\n });\n\n const {owner, updated_at: updatedAt, created_at, description: updatedDescription} = updatedDoc;\n\n // We update the data with the updated_at timestamp generated in the backend.\n // The canister checks if the updated_at date is equals to the entity timestamp otherwise it rejects the update to prevent overwrite of data if user uses multiple devices.\n // In other words: to update a data, the current updated_at information need to be provided.\n return {\n key,\n description: fromNullable(updatedDescription),\n owner: owner.toText(),\n data,\n created_at,\n updated_at: updatedAt\n };\n};\n\nexport const deleteDoc = async <D>({\n collection,\n doc,\n satellite\n}: {\n collection: string;\n doc: Doc<D>;\n satellite: Satellite;\n}): Promise<void> => {\n const actor: SatelliteActor = await getSatelliteActor(satellite);\n\n const {key, updated_at} = doc;\n\n return actor.del_doc(collection, key, {\n updated_at: toNullable(updated_at)\n });\n};\n\nexport const listDocs = async <D>({\n collection,\n filter,\n satellite\n}: {\n collection: string;\n filter: ListParams;\n satellite: Satellite;\n}): Promise<ListResults<Doc<D>>> => {\n const actor: SatelliteActor = await getSatelliteActor(satellite);\n\n const {items, items_page, items_length, matches_length, matches_pages}: ListDocsApi =\n await actor.list_docs(collection, toListParams(filter));\n\n const docs: Doc<D>[] = [];\n\n for (const [key, item] of items) {\n const {data: dataArray, owner, description, ...rest} = item;\n\n docs.push({\n key,\n description: fromNullable(description),\n owner: owner.toText(),\n data: await mapData<D>({data: dataArray}),\n ...rest\n });\n }\n\n return {\n items: docs,\n items_length,\n items_page: fromNullable(items_page),\n matches_length,\n matches_pages: fromNullable(matches_pages)\n };\n};\n", "import type {Identity} from '@dfinity/agent';\nimport {AnonymousIdentity} from '@dfinity/agent';\nimport {getIdentity as getAuthIdentity} from './auth.services';\n\nexport const getIdentity = (identity?: Identity): Identity => {\n if (identity !== undefined) {\n return identity;\n }\n\n const authIdentity: Identity | undefined = getAuthIdentity();\n\n return authIdentity ?? new AnonymousIdentity();\n};\n", "import {\n deleteDoc as deleteDocApi,\n getDoc as getDocApi,\n listDocs as listDocsApi,\n setDoc as setDocApi\n} from '../api/doc.api';\nimport type {Doc} from '../types/doc.types';\nimport type {ListParams, ListResults} from '../types/list.types';\nimport type {SatelliteOptions} from '../types/satellite.types';\nimport {getIdentity} from './identity.services';\n\nexport const getDoc = async <D>({\n satellite,\n ...rest\n}: {\n collection: string;\n satellite?: SatelliteOptions;\n} & Pick<Doc<D>, 'key'>): Promise<Doc<D> | undefined> => {\n const identity = getIdentity(satellite?.identity);\n\n return getDocApi({...rest, satellite: {...satellite, identity}});\n};\n\nexport const setDoc = async <D>({\n satellite,\n ...rest\n}: {\n collection: string;\n doc: Doc<D>;\n satellite?: SatelliteOptions;\n}): Promise<Doc<D>> => {\n const identity = getIdentity(satellite?.identity);\n\n return setDocApi({...rest, satellite: {...satellite, identity}});\n};\n\nexport const deleteDoc = async <D>({\n satellite,\n ...rest\n}: {\n collection: string;\n doc: Doc<D>;\n satellite?: SatelliteOptions;\n}): Promise<void> => {\n const identity = getIdentity(satellite?.identity);\n\n return deleteDocApi({...rest, satellite: {...satellite, identity}});\n};\n\nexport const listDocs = async <D>({\n satellite,\n filter,\n ...rest\n}: {\n collection: string;\n filter?: ListParams;\n satellite?: SatelliteOptions;\n}): Promise<ListResults<Doc<D>>> => {\n const identity = getIdentity(satellite?.identity);\n\n return listDocsApi<D>({...rest, filter: filter ?? {}, satellite: {...satellite, identity}});\n};\n", "import type {Identity} from '@dfinity/agent';\nimport {isNullish} from '@junobuild/utils';\nimport type {Provider, User, UserData} from '../types/auth.types';\nimport {getIdentity} from './auth.services';\nimport {getDoc, setDoc} from './doc.services';\n\nexport const initUser = async (provider?: Provider): Promise<User> => {\n const identity: Identity | undefined = getIdentity();\n\n if (isNullish(identity)) {\n throw new Error('No identity to initialize the user. Have you initialized Juno?');\n }\n\n const userId = identity.getPrincipal().toText();\n\n const user: User | undefined = await getDoc<UserData>({\n collection: `#user`,\n key: userId\n });\n\n if (isNullish(user)) {\n const newUser: User = await createUser({userId, provider});\n return newUser;\n }\n\n return user;\n};\n\nconst createUser = async ({\n userId,\n ...rest\n}: {\n userId: string;\n} & UserData): Promise<User> =>\n setDoc<UserData>({\n collection: `#user`,\n doc: {\n key: userId,\n data: rest\n }\n });\n", "import type {Identity} from '@dfinity/agent';\nimport type {AuthClient} from '@dfinity/auth-client';\nimport {DELEGATION_IDENTITY_EXPIRATION} from '../constants/auth.constants';\nimport {InternetIdentityProvider} from '../providers/auth.providers';\nimport {AuthStore} from '../stores/auth.store';\nimport type {Provider, SignInOptions} from '../types/auth.types';\nimport {createAuthClient} from '../utils/auth.utils';\nimport {initUser} from './user.services';\n\nlet authClient: AuthClient | undefined;\n\nexport const initAuth = async (provider?: Provider) => {\n authClient = authClient ?? (await createAuthClient());\n\n const isAuthenticated: boolean = (await authClient?.isAuthenticated()) ?? false;\n\n if (!isAuthenticated) {\n return;\n }\n\n const user = await initUser(provider);\n AuthStore.getInstance().set(user);\n};\n\nexport const signIn = async (options?: SignInOptions) =>\n /* eslint-disable no-async-promise-executor */\n new Promise<void>(async (resolve, reject) => {\n authClient = authClient ?? (await createAuthClient());\n\n const provider = options?.provider ?? new InternetIdentityProvider({});\n\n await authClient.login({\n onSuccess: async () => {\n await initAuth(provider.id);\n resolve();\n },\n onError: (error?: string) => reject(error),\n maxTimeToLive: options?.maxTimeToLive ?? DELEGATION_IDENTITY_EXPIRATION,\n ...(options?.derivationOrigin !== undefined && {derivationOrigin: options.derivationOrigin}),\n ...provider.signInOptions({\n windowed: options?.windowed\n })\n });\n });\n\nexport const signOut = async (): Promise<void> => {\n await authClient?.logout();\n\n // Reset local object otherwise next sign in (sign in - sign out - sign in) might not work out - i.e. agent-js might not recreate the delegation or identity if not resetted\n authClient = undefined;\n\n AuthStore.getInstance().reset();\n};\n\nexport const getIdentity = (): Identity | undefined => {\n return authClient?.getIdentity();\n};\n\n/**\n * Return what can be the identity of a sign-in user or an anonymous identity.\n * Useful to load an identity in web workers.\n */\nexport const unsafeIdentity = async (): Promise<Identity> =>\n (authClient ?? (await createAuthClient())).getIdentity();\n", "import {isNullish} from '@junobuild/utils';\nimport {AuthStore} from '../stores/auth.store';\nimport type {User} from '../types/auth.types';\nimport type {EnvironmentWorker} from '../types/env.types';\nimport type {PostMessage} from '../types/post-message';\nimport type {Unsubscribe} from '../types/subscription.types';\nimport {emit} from '../utils/events.utils';\nimport {signOut} from './auth.services';\n\nexport const initAuthTimeoutWorker = (auth: EnvironmentWorker): Unsubscribe => {\n const workerUrl = auth === true ? './workers/auth.worker.js' : auth;\n const worker = new Worker(workerUrl);\n\n const timeoutSignOut = async () => {\n emit({message: 'junoSignOutAuthTimer'});\n await signOut();\n };\n\n worker.onmessage = async ({data}: MessageEvent<PostMessage>) => {\n const {msg} = data;\n\n switch (msg) {\n case 'junoSignOutAuthTimer':\n await timeoutSignOut();\n return;\n }\n };\n\n return AuthStore.getInstance().subscribe((user: User | null) => {\n if (isNullish(user)) {\n worker.postMessage({msg: 'junoStopAuthTimer'});\n return;\n }\n\n worker.postMessage({msg: 'junoStartAuthTimer'});\n });\n};\n", "import {fromNullable, isBrowser, toNullable} from '@junobuild/utils';\nimport type {\n AssetNoContent,\n ListResults as ListAssetsApi,\n _SERVICE as SatelliteActor\n} from '../../declarations/satellite/satellite.did';\nimport type {ListParams, ListResults} from '../types/list.types';\nimport type {Satellite} from '../types/satellite.types';\nimport type {AssetKey, ENCODING_TYPE, Storage} from '../types/storage.types';\nimport {toListParams} from '../utils/list.utils';\nimport {getSatelliteActor} from './actor.api';\n\nexport const uploadAsset = async ({\n data,\n filename,\n collection,\n headers,\n token,\n fullPath,\n encoding,\n description,\n satellite\n}: Required<Omit<Storage, 'token' | 'encoding' | 'description'>> &\n Pick<Storage, 'token' | 'encoding' | 'description'> & {satellite: Satellite}): Promise<void> => {\n const actor: SatelliteActor = await getSatelliteActor(satellite);\n\n const {batch_id: batchId} = await actor.init_asset_upload({\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\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 actor,\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 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 actor.commit_asset_upload({\n batch_id: batchId,\n chunk_ids: chunkIds.map(({chunk_id}: UploadChunkResult) => chunk_id),\n headers: [...headers, ...(contentType ? contentType : [])]\n });\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\ntype UploadChunkResult = {chunk_id: bigint};\n\ntype UploadChunkParams = {\n batchId: bigint;\n chunk: Blob;\n actor: SatelliteActor;\n orderId: bigint;\n};\n\nconst uploadChunk = async ({\n batchId,\n chunk,\n actor,\n orderId\n}: UploadChunkParams): Promise<UploadChunkResult> =>\n actor.upload_asset_chunk({\n batch_id: batchId,\n content: new Uint8Array(await chunk.arrayBuffer()),\n order_id: toNullable(orderId)\n });\n\nexport const listAssets = async ({\n collection,\n satellite,\n filter\n}: {\n collection: string;\n satellite: Satellite;\n filter: ListParams;\n}): Promise<ListResults<AssetNoContent>> => {\n const actor: SatelliteActor = await getSatelliteActor(satellite);\n\n const {\n items: assets,\n items_length,\n items_page,\n matches_length,\n matches_pages\n }: ListAssetsApi = await actor.list_assets(collection, toListParams(filter));\n\n return {\n items: assets.map(([_, asset]) => asset),\n items_length,\n items_page: fromNullable(items_page),\n matches_length,\n matches_pages: fromNullable(matches_pages)\n };\n};\n\nexport const deleteAsset = async ({\n collection,\n fullPath,\n satellite\n}: {\n collection: string;\n satellite: Satellite;\n} & Pick<AssetKey, 'fullPath'>): Promise<void> => {\n const actor: SatelliteActor = await getSatelliteActor(satellite);\n\n return actor.del_asset(collection, fullPath);\n};\n\nexport const deleteAssets = async ({\n collection,\n satellite\n}: {\n collection: string;\n satellite: Satellite;\n}): Promise<void> => {\n const actor: SatelliteActor = await getSatelliteActor(satellite);\n\n return actor.del_assets(collection);\n};\n", "export const sha256ToBase64String = (sha256: Iterable<number>): string =>\n btoa([...sha256].map((c) => String.fromCharCode(c)).join(''));\n", "import {EnvStore} from '../stores/env.store';\n\nexport const satelliteUrl = (): string => {\n const satelliteId: string = EnvStore.getInstance().get()?.satelliteId ?? 'unknown';\n\n if (EnvStore.getInstance().localIdentity()) {\n return `http://${satelliteId}.localhost:8000`;\n }\n\n return `https://${satelliteId}.icp0.io`;\n};\n", "export const encodeFilename = (filename: string): string =>\n encodeURI(filename.toLowerCase().replace(/\\s/g, '-'));\n", "import {fromNullable} from '@junobuild/utils';\nimport type {AssetNoContent} from '../../declarations/satellite/satellite.did';\nimport {\n deleteAsset as deleteAssetApi,\n deleteAssets as deleteAssetsApi,\n listAssets as listAssetsApi,\n uploadAsset as uploadAssetApi\n} from '../api/storage.api';\nimport type {ListParams, ListResults} from '../types/list.types';\nimport type {SatelliteOptions} from '../types/satellite.types';\nimport type {Asset, AssetEncoding, AssetKey, Assets, Storage} from '../types/storage.types';\nimport {sha256ToBase64String} from '../utils/crypto.utils';\nimport {satelliteUrl} from '../utils/env.utils';\nimport {encodeFilename} from '../utils/storage.utils';\nimport {getIdentity} from './identity.services';\n\nexport const uploadBlob = async (\n params: Storage & {satellite?: SatelliteOptions}\n): Promise<AssetKey> => uploadAssetIC(params);\n\nexport const uploadFile = async (\n params: Partial<Pick<Storage, 'filename'>> &\n Omit<Storage, 'filename' | 'data'> & {data: File} & {satellite?: SatelliteOptions}\n): Promise<AssetKey> =>\n uploadAssetIC({\n filename: params.data.name,\n ...params\n });\n\nconst uploadAssetIC = async ({\n filename: storageFilename,\n data,\n collection,\n headers = [],\n fullPath: storagePath,\n token,\n satellite,\n encoding,\n description\n}: Storage & {satellite?: SatelliteOptions}): Promise<AssetKey> => {\n const identity = getIdentity(satellite?.identity);\n\n const filename: string = encodeFilename(storageFilename);\n const fullPath: string = storagePath || `/${collection}/${filename}`;\n\n await uploadAssetApi({\n data,\n filename: encodeFilename(filename),\n collection,\n token,\n headers,\n fullPath,\n encoding,\n satellite: {...satellite, identity},\n description\n });\n\n return {\n downloadUrl: `${satelliteUrl()}${fullPath}${token !== undefined ? `?token=${token}` : ''}`,\n fullPath,\n name: filename\n };\n};\n\nexport const listAssets = async ({\n collection,\n satellite,\n filter\n}: {\n collection: string;\n satellite?: SatelliteOptions;\n filter?: ListParams;\n}): Promise<Assets> => {\n const {items, ...rest}: ListResults<AssetNoContent> = await listAssetsApi({\n collection,\n satellite: {...satellite, identity: getIdentity(satellite?.identity)},\n filter: filter ?? {}\n });\n\n const host: string = satelliteUrl();\n\n return {\n assets: items.map(\n ({\n key: {full_path, token: t, name, owner, description},\n headers,\n encodings,\n created_at,\n updated_at\n }: AssetNoContent) => {\n const token = fromNullable(t);\n\n return {\n fullPath: full_path,\n description: fromNullable(description),\n name,\n downloadUrl: `${host}${full_path}${token !== undefined ? `?token=${token}` : ''}`,\n token,\n headers,\n encodings: encodings.reduce(\n (acc, [type, {modified, sha256, total_length}]) => ({\n ...acc,\n [type]: {\n modified,\n sha256: sha256ToBase64String(sha256),\n total_length\n }\n }),\n {} as Record<string, AssetEncoding>\n ),\n owner: owner.toText(),\n created_at,\n updated_at\n } as Asset;\n }\n ),\n ...rest\n };\n};\n\nexport const deleteAsset = async ({\n collection,\n fullPath,\n satellite\n}: {\n collection: string;\n satellite?: SatelliteOptions;\n} & Pick<AssetKey, 'fullPath'>): Promise<void> =>\n deleteAssetApi({\n collection,\n fullPath,\n satellite: {...satellite, identity: getIdentity(satellite?.identity)}\n });\n\nexport const deleteAssets = async ({\n collection,\n satellite\n}: {\n collection: string;\n satellite?: SatelliteOptions;\n}): Promise<void> =>\n deleteAssetsApi({\n collection,\n satellite: {...satellite, identity: getIdentity(satellite?.identity)}\n });\n", "import {initAuthTimeoutWorker} from './services/auth-timout.services';\nimport {initAuth} from './services/auth.services';\nimport {AuthStore} from './stores/auth.store';\nimport {EnvStore} from './stores/env.store';\nimport type {User} from './types/auth.types';\nimport type {Environment} from './types/env.types';\nimport type {Unsubscribe} from './types/subscription.types';\n\nexport * from './providers/auth.providers';\nexport {signIn, signOut, unsafeIdentity} from './services/auth.services';\nexport * from './services/doc.services';\nexport * from './services/storage.services';\nexport * from './types/auth.types';\nexport * from './types/doc.types';\nexport * from './types/env.types';\nexport {ListOrder, ListPaginate, ListParams, ListResults} from './types/list.types';\nexport * from './types/satellite.types';\nexport * from './types/storage.types';\nexport * from './types/subscription.types';\n\nexport const initJuno = async (env: Environment): Promise<Unsubscribe[]> => {\n EnvStore.getInstance().set(env);\n\n await initAuth();\n\n const authSubscribe =\n env.workers?.auth !== undefined ? initAuthTimeoutWorker(env.workers.auth) : undefined;\n\n return [...(authSubscribe ? [authSubscribe] : [])];\n};\n\nexport const authSubscribe = (callback: (authUser: User | null) => void): Unsubscribe =>\n AuthStore.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,WAAAlC,EACA,UAAAI,CACF,IAIE8B,GAAgB,CACd,WAAAlC,EACA,UAAW,CAAC,GAAGI,EAAW,SAAUI,EAAYJ,GAAW,QAAQ,CAAC,CACtE,CAAC,EC5HI,IAAM+B,GAAW,MAAOC,GAA6C,CAC1EC,EAAS,YAAY,EAAE,IAAID,CAAG,EAE9B,MAAME,EAAS,EAEf,IAAMC,EACJH,EAAI,SAAS,OAAS,OAAYI,GAAsBJ,EAAI,QAAQ,IAAI,EAAI,OAE9E,MAAO,CAAC,GAAIG,EAAgB,CAACA,CAAa,EAAI,CAAC,CAAE,CACnD,EAEaA,GAAiBE,GAC5BC,EAAU,YAAY,EAAE,UAAUD,CAAQ",
|
|
6
|
+
"names": ["isNullish", "argument", "nonNullish", "toNullable", "value", "nonNullish", "fromNullable", "toArray", "data", "blob", "fromArray", "isBrowser", "Store", "data", "callback", "callbackId", "id", "AuthStore", "_AuthStore", "Store", "authUser", "callback", "unsubscribe", "emit", "message", "detail", "$event", "DELEGATION_IDENTITY_EXPIRATION", "II_POPUP", "NFID_POPUP", "INTERNET_COMPUTER_ORG", "EnvStore", "_EnvStore", "Store", "env", "callback", "unsubscribe", "popupCenter", "width", "height", "y", "t", "innerWidth", "innerHeight", "x", "InternetIdentityProvider", "#domain", "domain", "windowed", "identityProvider", "EnvStore", "INTERNET_COMPUTER_ORG", "popupCenter", "II_POPUP", "NFIDProvider", "#appName", "#logoUrl", "appName", "logoUrl", "NFID_POPUP", "AuthClient", "createAuthClient", "mapData", "data", "m", "err", "Principal", "toListParams", "matcher", "paginate", "order", "owner", "t", "T", "Principal", "idlFactory", "IDL", "CommitBatch", "DeleteControllersArgs", "ControllerScope", "Controller", "DelDoc", "RulesType", "StorageConfig", "Config", "Doc", "HttpRequest", "Memory", "StreamingCallbackToken", "StreamingStrategy", "HttpResponse", "StreamingCallbackHttpResponse", "InitAssetKey", "InitUploadResult", "ListOrderField", "ListOrder", "ListMatcher", "ListPaginate", "ListParams", "AssetKey", "AssetEncodingNoContent", "AssetNoContent", "ListResults", "CustomDomain", "ListResults_1", "Permission", "Rule", "SetController", "SetControllersArgs", "SetDoc", "SetRule", "UploadChunk", "UploadChunkResult", "Actor", "HttpAgent", "createActor", "canisterId", "idlFactory", "identity", "fetch", "env", "localActor", "EnvStore", "host", "agent", "HttpAgent", "Actor", "getSatelliteActor", "satelliteId", "rest", "canisterId", "EnvStore", "createActor", "idlFactory", "getDoc", "collection", "key", "satellite", "actor", "getSatelliteActor", "entry", "d", "t", "dataArray", "owner", "description", "rest", "data", "mapData", "setDoc", "doc", "updated_at", "updatedDoc", "T", "x", "updatedAt", "created_at", "updatedDescription", "deleteDoc", "listDocs", "filter", "items", "items_page", "items_length", "matches_length", "matches_pages", "toListParams", "docs", "item", "AnonymousIdentity", "getIdentity", "identity", "AnonymousIdentity", "getDoc", "satellite", "rest", "identity", "getIdentity", "setDoc", "deleteDoc", "listDocs", "filter", "initUser", "provider", "identity", "getIdentity", "t", "userId", "user", "getDoc", "createUser", "rest", "setDoc", "authClient", "initAuth", "provider", "createAuthClient", "user", "initUser", "AuthStore", "signIn", "options", "resolve", "reject", "InternetIdentityProvider", "error", "DELEGATION_IDENTITY_EXPIRATION", "signOut", "getIdentity", "unsafeIdentity", "initAuthTimeoutWorker", "auth", "workerUrl", "worker", "timeoutSignOut", "emit", "signOut", "data", "msg", "AuthStore", "user", "t", "uploadAsset", "data", "filename", "collection", "headers", "token", "fullPath", "encoding", "description", "satellite", "actor", "getSatelliteActor", "batchId", "T", "chunkSize", "uploadChunks", "clone", "y", "orderId", "start", "chunk", "chunkIds", "results", "batchUploadChunks", "contentType", "type", "_", "chunk_id", "limit", "i", "batch", "params", "uploadChunk", "listAssets", "filter", "assets", "items_length", "items_page", "matches_length", "matches_pages", "toListParams", "asset", "d", "deleteAsset", "deleteAssets", "sha256ToBase64String", "sha256", "c", "satelliteUrl", "satelliteId", "EnvStore", "encodeFilename", "filename", "uploadBlob", "params", "uploadAssetIC", "uploadFile", "storageFilename", "data", "collection", "headers", "storagePath", "token", "satellite", "encoding", "description", "identity", "getIdentity", "filename", "encodeFilename", "fullPath", "uploadAsset", "satelliteUrl", "listAssets", "filter", "items", "rest", "host", "full_path", "t", "name", "owner", "encodings", "created_at", "updated_at", "d", "acc", "type", "modified", "sha256", "total_length", "sha256ToBase64String", "deleteAsset", "deleteAssets", "initJuno", "env", "EnvStore", "initAuth", "authSubscribe", "initAuthTimeoutWorker", "callback", "AuthStore"]
|
|
7
|
+
}
|