@junobuild/analytics 0.0.9 → 0.0.11

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 (59) hide show
  1. package/README.md +1 -1
  2. package/dist/workers/analytics.worker.js +15 -15
  3. package/dist/workers/analytics.worker.js.gz +0 -0
  4. package/dist/workers/analytics.worker.js.map +2 -2
  5. package/package.json +3 -3
  6. package/declarations/cmc/cmc.did +0 -122
  7. package/declarations/cmc/cmc.did.d.ts +0 -48
  8. package/declarations/cmc/cmc.factory.did.js +0 -67
  9. package/declarations/cmc/index.d.ts +0 -45
  10. package/declarations/cmc/index.js +0 -37
  11. package/declarations/console/console.did.d.ts +0 -71
  12. package/declarations/console/console.factory.did.js +0 -79
  13. package/declarations/console/console.factory.did.mjs +0 -79
  14. package/declarations/console/index.d.ts +0 -45
  15. package/declarations/console/index.js +0 -37
  16. package/declarations/ic/ic.did +0 -195
  17. package/declarations/ic/ic.did.d.ts +0 -208
  18. package/declarations/ic/ic.factory.did.js +0 -274
  19. package/declarations/mission_control/index.d.ts +0 -45
  20. package/declarations/mission_control/index.js +0 -38
  21. package/declarations/mission_control/mission_control.did.d.ts +0 -101
  22. package/declarations/mission_control/mission_control.factory.did.js +0 -136
  23. package/declarations/observatory/index.d.ts +0 -45
  24. package/declarations/observatory/index.js +0 -38
  25. package/declarations/observatory/observatory.did.d.ts +0 -86
  26. package/declarations/observatory/observatory.factory.did.js +0 -95
  27. package/declarations/observatory/observatory.factory.did.mjs +0 -95
  28. package/declarations/satellite/index.d.ts +0 -45
  29. package/declarations/satellite/index.js +0 -37
  30. package/declarations/satellite/satellite.did.d.ts +0 -201
  31. package/declarations/satellite/satellite.factory.did.js +0 -215
  32. package/declarations/satellite/satellite.factory.did.mjs +0 -215
  33. package/dist/declarations/cmc/cmc.did +0 -122
  34. package/dist/declarations/cmc/cmc.did.d.ts +0 -48
  35. package/dist/declarations/cmc/cmc.factory.did.js +0 -67
  36. package/dist/declarations/cmc/index.d.ts +0 -45
  37. package/dist/declarations/cmc/index.js +0 -37
  38. package/dist/declarations/console/console.did.d.ts +0 -71
  39. package/dist/declarations/console/console.factory.did.js +0 -79
  40. package/dist/declarations/console/console.factory.did.mjs +0 -79
  41. package/dist/declarations/console/index.d.ts +0 -45
  42. package/dist/declarations/console/index.js +0 -37
  43. package/dist/declarations/ic/ic.did +0 -195
  44. package/dist/declarations/ic/ic.did.d.ts +0 -208
  45. package/dist/declarations/ic/ic.factory.did.js +0 -274
  46. package/dist/declarations/mission_control/index.d.ts +0 -45
  47. package/dist/declarations/mission_control/index.js +0 -38
  48. package/dist/declarations/mission_control/mission_control.did.d.ts +0 -101
  49. package/dist/declarations/mission_control/mission_control.factory.did.js +0 -136
  50. package/dist/declarations/observatory/index.d.ts +0 -45
  51. package/dist/declarations/observatory/index.js +0 -38
  52. package/dist/declarations/observatory/observatory.did.d.ts +0 -86
  53. package/dist/declarations/observatory/observatory.factory.did.js +0 -95
  54. package/dist/declarations/observatory/observatory.factory.did.mjs +0 -95
  55. package/dist/declarations/satellite/index.d.ts +0 -45
  56. package/dist/declarations/satellite/index.js +0 -37
  57. package/dist/declarations/satellite/satellite.did.d.ts +0 -201
  58. package/dist/declarations/satellite/satellite.factory.did.js +0 -215
  59. package/dist/declarations/satellite/satellite.factory.did.mjs +0 -215
@@ -1,37 +0,0 @@
1
- import {Actor, HttpAgent} from '@dfinity/agent';
2
-
3
- // Imports and re-exports candid interface
4
- import {idlFactory} from './satellite.did.js';
5
- export {idlFactory} from './satellite.did.js';
6
-
7
- /* CANISTER_ID is replaced by webpack based on node environment
8
- * Note: canister environment variable will be standardized as
9
- * process.env.CANISTER_ID_<CANISTER_NAME_UPPERCASE>
10
- * beginning in dfx 0.15.0
11
- */
12
- export const canisterId = process.env.CANISTER_ID_SATELLITE || process.env.SATELLITE_CANISTER_ID;
13
-
14
- export const createActor = (canisterId, options = {}) => {
15
- const agent = options.agent || new HttpAgent({...options.agentOptions});
16
-
17
- if (options.agent && options.agentOptions) {
18
- console.warn(
19
- 'Detected both agent and agentOptions passed to createActor. Ignoring agentOptions and proceeding with the provided agent.'
20
- );
21
- }
22
-
23
- // Fetch root key for certificate validation during development
24
- if (process.env.DFX_NETWORK !== 'ic') {
25
- agent.fetchRootKey().catch((err) => {
26
- console.warn('Unable to fetch root key. Check to ensure that your local replica is running');
27
- console.error(err);
28
- });
29
- }
30
-
31
- // Creates an actor with using the candid interface and the HttpAgent
32
- return Actor.createActor(idlFactory, {
33
- agent,
34
- canisterId,
35
- ...options.actorOptions
36
- });
37
- };
@@ -1,201 +0,0 @@
1
- import type {ActorMethod} from '@dfinity/agent';
2
- import type {Principal} from '@dfinity/principal';
3
-
4
- export interface AssetEncodingNoContent {
5
- modified: bigint;
6
- sha256: Uint8Array | number[];
7
- total_length: bigint;
8
- }
9
- export interface AssetKey {
10
- token: [] | [string];
11
- collection: string;
12
- owner: Principal;
13
- name: string;
14
- description: [] | [string];
15
- full_path: string;
16
- }
17
- export interface AssetNoContent {
18
- key: AssetKey;
19
- updated_at: bigint;
20
- encodings: Array<[string, AssetEncodingNoContent]>;
21
- headers: Array<[string, string]>;
22
- created_at: bigint;
23
- }
24
- export interface CommitBatch {
25
- batch_id: bigint;
26
- headers: Array<[string, string]>;
27
- chunk_ids: Array<bigint>;
28
- }
29
- export interface Config {
30
- storage: StorageConfig;
31
- }
32
- export interface Controller {
33
- updated_at: bigint;
34
- metadata: Array<[string, string]>;
35
- created_at: bigint;
36
- scope: ControllerScope;
37
- expires_at: [] | [bigint];
38
- }
39
- export type ControllerScope = {Write: null} | {Admin: null};
40
- export interface CustomDomain {
41
- updated_at: bigint;
42
- created_at: bigint;
43
- bn_id: [] | [string];
44
- }
45
- export interface DelDoc {
46
- updated_at: [] | [bigint];
47
- }
48
- export interface DeleteControllersArgs {
49
- controllers: Array<Principal>;
50
- }
51
- export interface Doc {
52
- updated_at: bigint;
53
- owner: Principal;
54
- data: Uint8Array | number[];
55
- description: [] | [string];
56
- created_at: bigint;
57
- }
58
- export interface HttpRequest {
59
- url: string;
60
- method: string;
61
- body: Uint8Array | number[];
62
- headers: Array<[string, string]>;
63
- }
64
- export interface HttpResponse {
65
- body: Uint8Array | number[];
66
- headers: Array<[string, string]>;
67
- streaming_strategy: [] | [StreamingStrategy];
68
- status_code: number;
69
- }
70
- export interface InitAssetKey {
71
- token: [] | [string];
72
- collection: string;
73
- name: string;
74
- description: [] | [string];
75
- encoding_type: [] | [string];
76
- full_path: string;
77
- }
78
- export interface InitUploadResult {
79
- batch_id: bigint;
80
- }
81
- export interface ListMatcher {
82
- key: [] | [string];
83
- description: [] | [string];
84
- }
85
- export interface ListOrder {
86
- field: ListOrderField;
87
- desc: boolean;
88
- }
89
- export type ListOrderField = {UpdatedAt: null} | {Keys: null} | {CreatedAt: null};
90
- export interface ListPaginate {
91
- start_after: [] | [string];
92
- limit: [] | [bigint];
93
- }
94
- export interface ListParams {
95
- order: [] | [ListOrder];
96
- owner: [] | [Principal];
97
- matcher: [] | [ListMatcher];
98
- paginate: [] | [ListPaginate];
99
- }
100
- export interface ListResults {
101
- matches_pages: [] | [bigint];
102
- matches_length: bigint;
103
- items_page: [] | [bigint];
104
- items: Array<[string, AssetNoContent]>;
105
- items_length: bigint;
106
- }
107
- export interface ListResults_1 {
108
- matches_pages: [] | [bigint];
109
- matches_length: bigint;
110
- items_page: [] | [bigint];
111
- items: Array<[string, Doc]>;
112
- items_length: bigint;
113
- }
114
- export type Permission = {Controllers: null} | {Private: null} | {Public: null} | {Managed: null};
115
- export interface Rule {
116
- updated_at: bigint;
117
- max_size: [] | [bigint];
118
- read: Permission;
119
- created_at: bigint;
120
- write: Permission;
121
- }
122
- export type RulesType = {Db: null} | {Storage: null};
123
- export interface SetController {
124
- metadata: Array<[string, string]>;
125
- scope: ControllerScope;
126
- expires_at: [] | [bigint];
127
- }
128
- export interface SetControllersArgs {
129
- controller: SetController;
130
- controllers: Array<Principal>;
131
- }
132
- export interface SetDoc {
133
- updated_at: [] | [bigint];
134
- data: Uint8Array | number[];
135
- description: [] | [string];
136
- }
137
- export interface SetRule {
138
- updated_at: [] | [bigint];
139
- max_size: [] | [bigint];
140
- read: Permission;
141
- write: Permission;
142
- }
143
- export interface StorageConfig {
144
- rewrites: Array<[string, string]>;
145
- headers: Array<[string, Array<[string, string]>]>;
146
- }
147
- export interface StreamingCallbackHttpResponse {
148
- token: [] | [StreamingCallbackToken];
149
- body: Uint8Array | number[];
150
- }
151
- export interface StreamingCallbackToken {
152
- token: [] | [string];
153
- sha256: [] | [Uint8Array | number[]];
154
- headers: Array<[string, string]>;
155
- index: bigint;
156
- encoding_type: string;
157
- full_path: string;
158
- }
159
- export type StreamingStrategy = {
160
- Callback: {
161
- token: StreamingCallbackToken;
162
- callback: [Principal, string];
163
- };
164
- };
165
- export interface UploadChunk {
166
- content: Uint8Array | number[];
167
- batch_id: bigint;
168
- order_id: [] | [bigint];
169
- }
170
- export interface UploadChunkResult {
171
- chunk_id: bigint;
172
- }
173
- export interface _SERVICE {
174
- commit_asset_upload: ActorMethod<[CommitBatch], undefined>;
175
- del_asset: ActorMethod<[string, string], undefined>;
176
- del_assets: ActorMethod<[string], undefined>;
177
- del_controllers: ActorMethod<[DeleteControllersArgs], Array<[Principal, Controller]>>;
178
- del_custom_domain: ActorMethod<[string], undefined>;
179
- del_doc: ActorMethod<[string, string, DelDoc], undefined>;
180
- del_rule: ActorMethod<[RulesType, string, DelDoc], undefined>;
181
- get_config: ActorMethod<[], Config>;
182
- get_doc: ActorMethod<[string, string], [] | [Doc]>;
183
- http_request: ActorMethod<[HttpRequest], HttpResponse>;
184
- http_request_streaming_callback: ActorMethod<
185
- [StreamingCallbackToken],
186
- StreamingCallbackHttpResponse
187
- >;
188
- init_asset_upload: ActorMethod<[InitAssetKey], InitUploadResult>;
189
- list_assets: ActorMethod<[string, ListParams], ListResults>;
190
- list_controllers: ActorMethod<[], Array<[Principal, Controller]>>;
191
- list_custom_domains: ActorMethod<[], Array<[string, CustomDomain]>>;
192
- list_docs: ActorMethod<[string, ListParams], ListResults_1>;
193
- list_rules: ActorMethod<[RulesType], Array<[string, Rule]>>;
194
- set_config: ActorMethod<[Config], undefined>;
195
- set_controllers: ActorMethod<[SetControllersArgs], Array<[Principal, Controller]>>;
196
- set_custom_domain: ActorMethod<[string, [] | [string]], undefined>;
197
- set_doc: ActorMethod<[string, string, SetDoc], Doc>;
198
- set_rule: ActorMethod<[RulesType, string, SetRule], undefined>;
199
- upload_asset_chunk: ActorMethod<[UploadChunk], UploadChunkResult>;
200
- version: ActorMethod<[], string>;
201
- }
@@ -1,215 +0,0 @@
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 StreamingCallbackToken = IDL.Record({
43
- token: IDL.Opt(IDL.Text),
44
- sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),
45
- headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
46
- index: IDL.Nat64,
47
- encoding_type: IDL.Text,
48
- full_path: IDL.Text
49
- });
50
- const StreamingStrategy = IDL.Variant({
51
- Callback: IDL.Record({
52
- token: StreamingCallbackToken,
53
- callback: IDL.Func([], [], ['query'])
54
- })
55
- });
56
- const HttpResponse = IDL.Record({
57
- body: IDL.Vec(IDL.Nat8),
58
- headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
59
- streaming_strategy: IDL.Opt(StreamingStrategy),
60
- status_code: IDL.Nat16
61
- });
62
- const StreamingCallbackHttpResponse = IDL.Record({
63
- token: IDL.Opt(StreamingCallbackToken),
64
- body: IDL.Vec(IDL.Nat8)
65
- });
66
- const InitAssetKey = IDL.Record({
67
- token: IDL.Opt(IDL.Text),
68
- collection: IDL.Text,
69
- name: IDL.Text,
70
- description: IDL.Opt(IDL.Text),
71
- encoding_type: IDL.Opt(IDL.Text),
72
- full_path: IDL.Text
73
- });
74
- const InitUploadResult = IDL.Record({batch_id: IDL.Nat});
75
- const ListOrderField = IDL.Variant({
76
- UpdatedAt: IDL.Null,
77
- Keys: IDL.Null,
78
- CreatedAt: IDL.Null
79
- });
80
- const ListOrder = IDL.Record({field: ListOrderField, desc: IDL.Bool});
81
- const ListMatcher = IDL.Record({
82
- key: IDL.Opt(IDL.Text),
83
- description: IDL.Opt(IDL.Text)
84
- });
85
- const ListPaginate = IDL.Record({
86
- start_after: IDL.Opt(IDL.Text),
87
- limit: IDL.Opt(IDL.Nat64)
88
- });
89
- const ListParams = IDL.Record({
90
- order: IDL.Opt(ListOrder),
91
- owner: IDL.Opt(IDL.Principal),
92
- matcher: IDL.Opt(ListMatcher),
93
- paginate: IDL.Opt(ListPaginate)
94
- });
95
- const AssetKey = IDL.Record({
96
- token: IDL.Opt(IDL.Text),
97
- collection: IDL.Text,
98
- owner: IDL.Principal,
99
- name: IDL.Text,
100
- description: IDL.Opt(IDL.Text),
101
- full_path: IDL.Text
102
- });
103
- const AssetEncodingNoContent = IDL.Record({
104
- modified: IDL.Nat64,
105
- sha256: IDL.Vec(IDL.Nat8),
106
- total_length: IDL.Nat
107
- });
108
- const AssetNoContent = IDL.Record({
109
- key: AssetKey,
110
- updated_at: IDL.Nat64,
111
- encodings: IDL.Vec(IDL.Tuple(IDL.Text, AssetEncodingNoContent)),
112
- headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
113
- created_at: IDL.Nat64
114
- });
115
- const ListResults = IDL.Record({
116
- matches_pages: IDL.Opt(IDL.Nat64),
117
- matches_length: IDL.Nat64,
118
- items_page: IDL.Opt(IDL.Nat64),
119
- items: IDL.Vec(IDL.Tuple(IDL.Text, AssetNoContent)),
120
- items_length: IDL.Nat64
121
- });
122
- const CustomDomain = IDL.Record({
123
- updated_at: IDL.Nat64,
124
- created_at: IDL.Nat64,
125
- bn_id: IDL.Opt(IDL.Text)
126
- });
127
- const ListResults_1 = IDL.Record({
128
- matches_pages: IDL.Opt(IDL.Nat64),
129
- matches_length: IDL.Nat64,
130
- items_page: IDL.Opt(IDL.Nat64),
131
- items: IDL.Vec(IDL.Tuple(IDL.Text, Doc)),
132
- items_length: IDL.Nat64
133
- });
134
- const Permission = IDL.Variant({
135
- Controllers: IDL.Null,
136
- Private: IDL.Null,
137
- Public: IDL.Null,
138
- Managed: IDL.Null
139
- });
140
- const Rule = IDL.Record({
141
- updated_at: IDL.Nat64,
142
- max_size: IDL.Opt(IDL.Nat),
143
- read: Permission,
144
- created_at: IDL.Nat64,
145
- write: Permission
146
- });
147
- const SetController = IDL.Record({
148
- metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
149
- scope: ControllerScope,
150
- expires_at: IDL.Opt(IDL.Nat64)
151
- });
152
- const SetControllersArgs = IDL.Record({
153
- controller: SetController,
154
- controllers: IDL.Vec(IDL.Principal)
155
- });
156
- const SetDoc = IDL.Record({
157
- updated_at: IDL.Opt(IDL.Nat64),
158
- data: IDL.Vec(IDL.Nat8),
159
- description: IDL.Opt(IDL.Text)
160
- });
161
- const SetRule = IDL.Record({
162
- updated_at: IDL.Opt(IDL.Nat64),
163
- max_size: IDL.Opt(IDL.Nat),
164
- read: Permission,
165
- write: Permission
166
- });
167
- const UploadChunk = IDL.Record({
168
- content: IDL.Vec(IDL.Nat8),
169
- batch_id: IDL.Nat,
170
- order_id: IDL.Opt(IDL.Nat)
171
- });
172
- const UploadChunkResult = IDL.Record({chunk_id: IDL.Nat});
173
- return IDL.Service({
174
- commit_asset_upload: IDL.Func([CommitBatch], [], []),
175
- del_asset: IDL.Func([IDL.Text, IDL.Text], [], []),
176
- del_assets: IDL.Func([IDL.Text], [], []),
177
- del_controllers: IDL.Func(
178
- [DeleteControllersArgs],
179
- [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],
180
- []
181
- ),
182
- del_custom_domain: IDL.Func([IDL.Text], [], []),
183
- del_doc: IDL.Func([IDL.Text, IDL.Text, DelDoc], [], []),
184
- del_rule: IDL.Func([RulesType, IDL.Text, DelDoc], [], []),
185
- get_config: IDL.Func([], [Config], []),
186
- get_doc: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(Doc)], ['query']),
187
- http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),
188
- http_request_streaming_callback: IDL.Func(
189
- [StreamingCallbackToken],
190
- [StreamingCallbackHttpResponse],
191
- ['query']
192
- ),
193
- init_asset_upload: IDL.Func([InitAssetKey], [InitUploadResult], []),
194
- list_assets: IDL.Func([IDL.Text, ListParams], [ListResults], ['query']),
195
- list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))], ['query']),
196
- list_custom_domains: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, CustomDomain))], ['query']),
197
- list_docs: IDL.Func([IDL.Text, ListParams], [ListResults_1], ['query']),
198
- list_rules: IDL.Func([RulesType], [IDL.Vec(IDL.Tuple(IDL.Text, Rule))], ['query']),
199
- set_config: IDL.Func([Config], [], []),
200
- set_controllers: IDL.Func(
201
- [SetControllersArgs],
202
- [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],
203
- []
204
- ),
205
- set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),
206
- set_doc: IDL.Func([IDL.Text, IDL.Text, SetDoc], [Doc], []),
207
- set_rule: IDL.Func([RulesType, IDL.Text, SetRule], [], []),
208
- upload_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], []),
209
- version: IDL.Func([], [IDL.Text], ['query'])
210
- });
211
- };
212
- // @ts-ignore
213
- export const init = ({IDL}) => {
214
- return [];
215
- };
@@ -1,215 +0,0 @@
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 StreamingCallbackToken = IDL.Record({
43
- token: IDL.Opt(IDL.Text),
44
- sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),
45
- headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
46
- index: IDL.Nat64,
47
- encoding_type: IDL.Text,
48
- full_path: IDL.Text
49
- });
50
- const StreamingStrategy = IDL.Variant({
51
- Callback: IDL.Record({
52
- token: StreamingCallbackToken,
53
- callback: IDL.Func([], [], ['query'])
54
- })
55
- });
56
- const HttpResponse = IDL.Record({
57
- body: IDL.Vec(IDL.Nat8),
58
- headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
59
- streaming_strategy: IDL.Opt(StreamingStrategy),
60
- status_code: IDL.Nat16
61
- });
62
- const StreamingCallbackHttpResponse = IDL.Record({
63
- token: IDL.Opt(StreamingCallbackToken),
64
- body: IDL.Vec(IDL.Nat8)
65
- });
66
- const InitAssetKey = IDL.Record({
67
- token: IDL.Opt(IDL.Text),
68
- collection: IDL.Text,
69
- name: IDL.Text,
70
- description: IDL.Opt(IDL.Text),
71
- encoding_type: IDL.Opt(IDL.Text),
72
- full_path: IDL.Text
73
- });
74
- const InitUploadResult = IDL.Record({batch_id: IDL.Nat});
75
- const ListOrderField = IDL.Variant({
76
- UpdatedAt: IDL.Null,
77
- Keys: IDL.Null,
78
- CreatedAt: IDL.Null
79
- });
80
- const ListOrder = IDL.Record({field: ListOrderField, desc: IDL.Bool});
81
- const ListMatcher = IDL.Record({
82
- key: IDL.Opt(IDL.Text),
83
- description: IDL.Opt(IDL.Text)
84
- });
85
- const ListPaginate = IDL.Record({
86
- start_after: IDL.Opt(IDL.Text),
87
- limit: IDL.Opt(IDL.Nat64)
88
- });
89
- const ListParams = IDL.Record({
90
- order: IDL.Opt(ListOrder),
91
- owner: IDL.Opt(IDL.Principal),
92
- matcher: IDL.Opt(ListMatcher),
93
- paginate: IDL.Opt(ListPaginate)
94
- });
95
- const AssetKey = IDL.Record({
96
- token: IDL.Opt(IDL.Text),
97
- collection: IDL.Text,
98
- owner: IDL.Principal,
99
- name: IDL.Text,
100
- description: IDL.Opt(IDL.Text),
101
- full_path: IDL.Text
102
- });
103
- const AssetEncodingNoContent = IDL.Record({
104
- modified: IDL.Nat64,
105
- sha256: IDL.Vec(IDL.Nat8),
106
- total_length: IDL.Nat
107
- });
108
- const AssetNoContent = IDL.Record({
109
- key: AssetKey,
110
- updated_at: IDL.Nat64,
111
- encodings: IDL.Vec(IDL.Tuple(IDL.Text, AssetEncodingNoContent)),
112
- headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
113
- created_at: IDL.Nat64
114
- });
115
- const ListResults = IDL.Record({
116
- matches_pages: IDL.Opt(IDL.Nat64),
117
- matches_length: IDL.Nat64,
118
- items_page: IDL.Opt(IDL.Nat64),
119
- items: IDL.Vec(IDL.Tuple(IDL.Text, AssetNoContent)),
120
- items_length: IDL.Nat64
121
- });
122
- const CustomDomain = IDL.Record({
123
- updated_at: IDL.Nat64,
124
- created_at: IDL.Nat64,
125
- bn_id: IDL.Opt(IDL.Text)
126
- });
127
- const ListResults_1 = IDL.Record({
128
- matches_pages: IDL.Opt(IDL.Nat64),
129
- matches_length: IDL.Nat64,
130
- items_page: IDL.Opt(IDL.Nat64),
131
- items: IDL.Vec(IDL.Tuple(IDL.Text, Doc)),
132
- items_length: IDL.Nat64
133
- });
134
- const Permission = IDL.Variant({
135
- Controllers: IDL.Null,
136
- Private: IDL.Null,
137
- Public: IDL.Null,
138
- Managed: IDL.Null
139
- });
140
- const Rule = IDL.Record({
141
- updated_at: IDL.Nat64,
142
- max_size: IDL.Opt(IDL.Nat),
143
- read: Permission,
144
- created_at: IDL.Nat64,
145
- write: Permission
146
- });
147
- const SetController = IDL.Record({
148
- metadata: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
149
- scope: ControllerScope,
150
- expires_at: IDL.Opt(IDL.Nat64)
151
- });
152
- const SetControllersArgs = IDL.Record({
153
- controller: SetController,
154
- controllers: IDL.Vec(IDL.Principal)
155
- });
156
- const SetDoc = IDL.Record({
157
- updated_at: IDL.Opt(IDL.Nat64),
158
- data: IDL.Vec(IDL.Nat8),
159
- description: IDL.Opt(IDL.Text)
160
- });
161
- const SetRule = IDL.Record({
162
- updated_at: IDL.Opt(IDL.Nat64),
163
- max_size: IDL.Opt(IDL.Nat),
164
- read: Permission,
165
- write: Permission
166
- });
167
- const UploadChunk = IDL.Record({
168
- content: IDL.Vec(IDL.Nat8),
169
- batch_id: IDL.Nat,
170
- order_id: IDL.Opt(IDL.Nat)
171
- });
172
- const UploadChunkResult = IDL.Record({chunk_id: IDL.Nat});
173
- return IDL.Service({
174
- commit_asset_upload: IDL.Func([CommitBatch], [], []),
175
- del_asset: IDL.Func([IDL.Text, IDL.Text], [], []),
176
- del_assets: IDL.Func([IDL.Text], [], []),
177
- del_controllers: IDL.Func(
178
- [DeleteControllersArgs],
179
- [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],
180
- []
181
- ),
182
- del_custom_domain: IDL.Func([IDL.Text], [], []),
183
- del_doc: IDL.Func([IDL.Text, IDL.Text, DelDoc], [], []),
184
- del_rule: IDL.Func([RulesType, IDL.Text, DelDoc], [], []),
185
- get_config: IDL.Func([], [Config], []),
186
- get_doc: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(Doc)], ['query']),
187
- http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),
188
- http_request_streaming_callback: IDL.Func(
189
- [StreamingCallbackToken],
190
- [StreamingCallbackHttpResponse],
191
- ['query']
192
- ),
193
- init_asset_upload: IDL.Func([InitAssetKey], [InitUploadResult], []),
194
- list_assets: IDL.Func([IDL.Text, ListParams], [ListResults], ['query']),
195
- list_controllers: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))], ['query']),
196
- list_custom_domains: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, CustomDomain))], ['query']),
197
- list_docs: IDL.Func([IDL.Text, ListParams], [ListResults_1], ['query']),
198
- list_rules: IDL.Func([RulesType], [IDL.Vec(IDL.Tuple(IDL.Text, Rule))], ['query']),
199
- set_config: IDL.Func([Config], [], []),
200
- set_controllers: IDL.Func(
201
- [SetControllersArgs],
202
- [IDL.Vec(IDL.Tuple(IDL.Principal, Controller))],
203
- []
204
- ),
205
- set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),
206
- set_doc: IDL.Func([IDL.Text, IDL.Text, SetDoc], [Doc], []),
207
- set_rule: IDL.Func([RulesType, IDL.Text, SetRule], [], []),
208
- upload_asset_chunk: IDL.Func([UploadChunk], [UploadChunkResult], []),
209
- version: IDL.Func([], [IDL.Text], ['query'])
210
- });
211
- };
212
- // @ts-ignore
213
- export const init = ({IDL}) => {
214
- return [];
215
- };