@junobuild/core 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs.js +12 -12
- package/dist/cjs/index.cjs.js.map +4 -4
- package/dist/declarations/cmc/cmc.did +122 -0
- package/dist/declarations/cmc/cmc.did.d.ts +48 -0
- package/dist/declarations/cmc/cmc.factory.did.js +65 -0
- package/dist/declarations/cmc/index.d.ts +45 -0
- package/dist/declarations/cmc/index.js +32 -0
- package/dist/declarations/console/console.did.d.ts +47 -0
- package/dist/declarations/console/console.factory.did.js +49 -0
- package/dist/declarations/console/console.factory.did.mjs +49 -0
- package/dist/declarations/console/index.d.ts +45 -0
- package/dist/declarations/console/index.js +32 -0
- package/dist/declarations/frontend/frontend.did +147 -0
- package/dist/declarations/frontend/frontend.did.d.ts +128 -0
- package/dist/declarations/frontend/frontend.factory.did.js +165 -0
- package/dist/declarations/frontend/index.d.ts +45 -0
- package/dist/declarations/frontend/index.js +32 -0
- package/dist/declarations/ic/ic.did +82 -0
- package/dist/declarations/ic/ic.did.d.ts +77 -0
- package/dist/declarations/ic/ic.factory.did.js +128 -0
- package/dist/declarations/internet_identity/index.d.ts +45 -0
- package/dist/declarations/internet_identity/index.js +32 -0
- package/dist/declarations/internet_identity/internet_identity.did +271 -0
- package/dist/declarations/internet_identity/internet_identity.did.d.ts +161 -0
- package/dist/declarations/internet_identity/internet_identity.factory.did.js +187 -0
- package/dist/declarations/ledger/index.d.ts +45 -0
- package/dist/declarations/ledger/index.js +32 -0
- package/dist/declarations/ledger/ledger.did +249 -0
- package/dist/declarations/ledger/ledger.did.d.ts +100 -0
- package/dist/declarations/ledger/ledger.factory.did.js +98 -0
- package/dist/declarations/mission_control/index.d.ts +45 -0
- package/dist/declarations/mission_control/index.js +32 -0
- package/dist/declarations/mission_control/mission_control.did.d.ts +24 -0
- package/dist/declarations/mission_control/mission_control.factory.did.js +28 -0
- package/dist/declarations/satellite/index.d.ts +45 -0
- package/dist/declarations/satellite/index.js +32 -0
- package/dist/declarations/satellite/satellite.did.d.ts +166 -0
- package/dist/declarations/satellite/satellite.factory.did.js +164 -0
- package/dist/declarations/satellite/satellite.factory.did.mjs +164 -0
- package/dist/esm/canisterStatus-UMNLFNN3.js +2 -0
- package/dist/esm/{canisterStatus-KN67PLOF.js.map → canisterStatus-UMNLFNN3.js.map} +0 -0
- package/dist/esm/{chunk-VT367M3F.js → chunk-QVUY65GN.js} +2 -2
- package/dist/esm/{chunk-VT367M3F.js.map → chunk-QVUY65GN.js.map} +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +4 -4
- package/dist/types/api/actor.api.d.ts +1 -1
- package/dist/types/api/storage.api.d.ts +1 -1
- package/dist/types/types/storage.types.d.ts +1 -1
- package/package.json +9 -3
- package/dist/esm/canisterStatus-KN67PLOF.js +0 -2
|
@@ -0,0 +1,166 @@
|
|
|
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;
|
|
7
|
+
total_length: bigint;
|
|
8
|
+
}
|
|
9
|
+
export interface AssetKey {
|
|
10
|
+
token: [] | [string];
|
|
11
|
+
collection: string;
|
|
12
|
+
owner: Principal;
|
|
13
|
+
name: string;
|
|
14
|
+
full_path: string;
|
|
15
|
+
}
|
|
16
|
+
export interface AssetNoContent {
|
|
17
|
+
key: AssetKey;
|
|
18
|
+
updated_at: bigint;
|
|
19
|
+
encodings: Array<[string, AssetEncodingNoContent]>;
|
|
20
|
+
headers: Array<[string, string]>;
|
|
21
|
+
created_at: bigint;
|
|
22
|
+
}
|
|
23
|
+
export interface Chunk {
|
|
24
|
+
content: Uint8Array;
|
|
25
|
+
batch_id: bigint;
|
|
26
|
+
}
|
|
27
|
+
export interface CommitBatch {
|
|
28
|
+
batch_id: bigint;
|
|
29
|
+
headers: Array<[string, string]>;
|
|
30
|
+
chunk_ids: Array<bigint>;
|
|
31
|
+
}
|
|
32
|
+
export interface Config {
|
|
33
|
+
storage: StorageConfig;
|
|
34
|
+
}
|
|
35
|
+
export interface ControllersArgs {
|
|
36
|
+
controllers: Array<Principal>;
|
|
37
|
+
}
|
|
38
|
+
export interface CustomDomain {
|
|
39
|
+
updated_at: bigint;
|
|
40
|
+
created_at: bigint;
|
|
41
|
+
bn_id: [] | [string];
|
|
42
|
+
}
|
|
43
|
+
export interface DelDoc {
|
|
44
|
+
updated_at: [] | [bigint];
|
|
45
|
+
}
|
|
46
|
+
export interface Doc {
|
|
47
|
+
updated_at: bigint;
|
|
48
|
+
owner: Principal;
|
|
49
|
+
data: Uint8Array;
|
|
50
|
+
created_at: bigint;
|
|
51
|
+
}
|
|
52
|
+
export interface HttpRequest {
|
|
53
|
+
url: string;
|
|
54
|
+
method: string;
|
|
55
|
+
body: Uint8Array;
|
|
56
|
+
headers: Array<[string, string]>;
|
|
57
|
+
}
|
|
58
|
+
export interface HttpResponse {
|
|
59
|
+
body: Uint8Array;
|
|
60
|
+
headers: Array<[string, string]>;
|
|
61
|
+
streaming_strategy: [] | [StreamingStrategy];
|
|
62
|
+
status_code: number;
|
|
63
|
+
}
|
|
64
|
+
export interface InitAssetKey {
|
|
65
|
+
token: [] | [string];
|
|
66
|
+
collection: string;
|
|
67
|
+
name: string;
|
|
68
|
+
encoding_type: [] | [string];
|
|
69
|
+
full_path: string;
|
|
70
|
+
}
|
|
71
|
+
export interface InitUploadResult {
|
|
72
|
+
batch_id: bigint;
|
|
73
|
+
}
|
|
74
|
+
export interface ListParams {
|
|
75
|
+
order: [] | [OrderKeys];
|
|
76
|
+
matcher: [] | [string];
|
|
77
|
+
paginate: [] | [PaginateKeys];
|
|
78
|
+
}
|
|
79
|
+
export interface ListResults {
|
|
80
|
+
matches_length: bigint;
|
|
81
|
+
length: bigint;
|
|
82
|
+
items: Array<[string, AssetNoContent]>;
|
|
83
|
+
}
|
|
84
|
+
export interface ListResults_1 {
|
|
85
|
+
matches_length: bigint;
|
|
86
|
+
length: bigint;
|
|
87
|
+
items: Array<[string, Doc]>;
|
|
88
|
+
}
|
|
89
|
+
export interface OrderKeys {
|
|
90
|
+
desc: boolean;
|
|
91
|
+
}
|
|
92
|
+
export interface PaginateKeys {
|
|
93
|
+
start_after: [] | [string];
|
|
94
|
+
limit: [] | [bigint];
|
|
95
|
+
}
|
|
96
|
+
export type Permission = {Controllers: null} | {Private: null} | {Public: null} | {Managed: null};
|
|
97
|
+
export interface Rule {
|
|
98
|
+
updated_at: bigint;
|
|
99
|
+
max_size: [] | [bigint];
|
|
100
|
+
read: Permission;
|
|
101
|
+
created_at: bigint;
|
|
102
|
+
write: Permission;
|
|
103
|
+
}
|
|
104
|
+
export type RulesType = {Db: null} | {Storage: null};
|
|
105
|
+
export interface SetDoc {
|
|
106
|
+
updated_at: [] | [bigint];
|
|
107
|
+
data: Uint8Array;
|
|
108
|
+
}
|
|
109
|
+
export interface SetRule {
|
|
110
|
+
updated_at: [] | [bigint];
|
|
111
|
+
max_size: [] | [bigint];
|
|
112
|
+
read: Permission;
|
|
113
|
+
write: Permission;
|
|
114
|
+
}
|
|
115
|
+
export interface StorageConfig {
|
|
116
|
+
headers: Array<[string, Array<[string, string]>]>;
|
|
117
|
+
}
|
|
118
|
+
export interface StreamingCallbackHttpResponse {
|
|
119
|
+
token: [] | [StreamingCallbackToken];
|
|
120
|
+
body: Uint8Array;
|
|
121
|
+
}
|
|
122
|
+
export interface StreamingCallbackToken {
|
|
123
|
+
token: [] | [string];
|
|
124
|
+
sha256: [] | [Uint8Array];
|
|
125
|
+
headers: Array<[string, string]>;
|
|
126
|
+
index: bigint;
|
|
127
|
+
encoding_type: string;
|
|
128
|
+
full_path: string;
|
|
129
|
+
}
|
|
130
|
+
export type StreamingStrategy = {
|
|
131
|
+
Callback: {
|
|
132
|
+
token: StreamingCallbackToken;
|
|
133
|
+
callback: [Principal, string];
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
export interface UploadChunk {
|
|
137
|
+
chunk_id: bigint;
|
|
138
|
+
}
|
|
139
|
+
export interface _SERVICE {
|
|
140
|
+
add_controllers: ActorMethod<[ControllersArgs], Array<Principal>>;
|
|
141
|
+
commit_asset_upload: ActorMethod<[CommitBatch], undefined>;
|
|
142
|
+
del_asset: ActorMethod<[string, string], undefined>;
|
|
143
|
+
del_assets: ActorMethod<[[] | [string]], undefined>;
|
|
144
|
+
del_custom_domain: ActorMethod<[string], undefined>;
|
|
145
|
+
del_doc: ActorMethod<[string, string, DelDoc], undefined>;
|
|
146
|
+
get_config: ActorMethod<[], Config>;
|
|
147
|
+
get_doc: ActorMethod<[string, string], [] | [Doc]>;
|
|
148
|
+
http_request: ActorMethod<[HttpRequest], HttpResponse>;
|
|
149
|
+
http_request_streaming_callback: ActorMethod<
|
|
150
|
+
[StreamingCallbackToken],
|
|
151
|
+
StreamingCallbackHttpResponse
|
|
152
|
+
>;
|
|
153
|
+
init_asset_upload: ActorMethod<[InitAssetKey], InitUploadResult>;
|
|
154
|
+
list_assets: ActorMethod<[[] | [string], ListParams], ListResults>;
|
|
155
|
+
list_controllers: ActorMethod<[], Array<Principal>>;
|
|
156
|
+
list_custom_domains: ActorMethod<[], Array<[string, CustomDomain]>>;
|
|
157
|
+
list_docs: ActorMethod<[string, ListParams], ListResults_1>;
|
|
158
|
+
list_rules: ActorMethod<[RulesType], Array<[string, Rule]>>;
|
|
159
|
+
remove_controllers: ActorMethod<[ControllersArgs], Array<Principal>>;
|
|
160
|
+
set_config: ActorMethod<[Config], undefined>;
|
|
161
|
+
set_custom_domain: ActorMethod<[string, [] | [string]], undefined>;
|
|
162
|
+
set_doc: ActorMethod<[string, string, SetDoc], Doc>;
|
|
163
|
+
set_rule: ActorMethod<[RulesType, string, SetRule], undefined>;
|
|
164
|
+
upload_asset_chunk: ActorMethod<[Chunk], UploadChunk>;
|
|
165
|
+
version: ActorMethod<[], string>;
|
|
166
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
export const idlFactory = ({IDL}) => {
|
|
2
|
+
const ControllersArgs = IDL.Record({
|
|
3
|
+
controllers: IDL.Vec(IDL.Principal)
|
|
4
|
+
});
|
|
5
|
+
const CommitBatch = IDL.Record({
|
|
6
|
+
batch_id: IDL.Nat,
|
|
7
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
8
|
+
chunk_ids: IDL.Vec(IDL.Nat)
|
|
9
|
+
});
|
|
10
|
+
const DelDoc = IDL.Record({updated_at: IDL.Opt(IDL.Nat64)});
|
|
11
|
+
const StorageConfig = IDL.Record({
|
|
12
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))))
|
|
13
|
+
});
|
|
14
|
+
const Config = IDL.Record({storage: StorageConfig});
|
|
15
|
+
const Doc = IDL.Record({
|
|
16
|
+
updated_at: IDL.Nat64,
|
|
17
|
+
owner: IDL.Principal,
|
|
18
|
+
data: IDL.Vec(IDL.Nat8),
|
|
19
|
+
created_at: IDL.Nat64
|
|
20
|
+
});
|
|
21
|
+
const HttpRequest = IDL.Record({
|
|
22
|
+
url: IDL.Text,
|
|
23
|
+
method: IDL.Text,
|
|
24
|
+
body: IDL.Vec(IDL.Nat8),
|
|
25
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))
|
|
26
|
+
});
|
|
27
|
+
const StreamingCallbackToken = IDL.Record({
|
|
28
|
+
token: IDL.Opt(IDL.Text),
|
|
29
|
+
sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
30
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
31
|
+
index: IDL.Nat64,
|
|
32
|
+
encoding_type: IDL.Text,
|
|
33
|
+
full_path: IDL.Text
|
|
34
|
+
});
|
|
35
|
+
const StreamingStrategy = IDL.Variant({
|
|
36
|
+
Callback: IDL.Record({
|
|
37
|
+
token: StreamingCallbackToken,
|
|
38
|
+
callback: IDL.Func([], [], [])
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
const HttpResponse = IDL.Record({
|
|
42
|
+
body: IDL.Vec(IDL.Nat8),
|
|
43
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
44
|
+
streaming_strategy: IDL.Opt(StreamingStrategy),
|
|
45
|
+
status_code: IDL.Nat16
|
|
46
|
+
});
|
|
47
|
+
const StreamingCallbackHttpResponse = IDL.Record({
|
|
48
|
+
token: IDL.Opt(StreamingCallbackToken),
|
|
49
|
+
body: IDL.Vec(IDL.Nat8)
|
|
50
|
+
});
|
|
51
|
+
const InitAssetKey = IDL.Record({
|
|
52
|
+
token: IDL.Opt(IDL.Text),
|
|
53
|
+
collection: IDL.Text,
|
|
54
|
+
name: IDL.Text,
|
|
55
|
+
encoding_type: IDL.Opt(IDL.Text),
|
|
56
|
+
full_path: IDL.Text
|
|
57
|
+
});
|
|
58
|
+
const InitUploadResult = IDL.Record({batch_id: IDL.Nat});
|
|
59
|
+
const OrderKeys = IDL.Record({desc: IDL.Bool});
|
|
60
|
+
const PaginateKeys = IDL.Record({
|
|
61
|
+
start_after: IDL.Opt(IDL.Text),
|
|
62
|
+
limit: IDL.Opt(IDL.Nat64)
|
|
63
|
+
});
|
|
64
|
+
const ListParams = IDL.Record({
|
|
65
|
+
order: IDL.Opt(OrderKeys),
|
|
66
|
+
matcher: IDL.Opt(IDL.Text),
|
|
67
|
+
paginate: IDL.Opt(PaginateKeys)
|
|
68
|
+
});
|
|
69
|
+
const AssetKey = IDL.Record({
|
|
70
|
+
token: IDL.Opt(IDL.Text),
|
|
71
|
+
collection: IDL.Text,
|
|
72
|
+
owner: IDL.Principal,
|
|
73
|
+
name: IDL.Text,
|
|
74
|
+
full_path: IDL.Text
|
|
75
|
+
});
|
|
76
|
+
const AssetEncodingNoContent = IDL.Record({
|
|
77
|
+
modified: IDL.Nat64,
|
|
78
|
+
sha256: IDL.Vec(IDL.Nat8),
|
|
79
|
+
total_length: IDL.Nat
|
|
80
|
+
});
|
|
81
|
+
const AssetNoContent = IDL.Record({
|
|
82
|
+
key: AssetKey,
|
|
83
|
+
updated_at: IDL.Nat64,
|
|
84
|
+
encodings: IDL.Vec(IDL.Tuple(IDL.Text, AssetEncodingNoContent)),
|
|
85
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
86
|
+
created_at: IDL.Nat64
|
|
87
|
+
});
|
|
88
|
+
const ListResults = IDL.Record({
|
|
89
|
+
matches_length: IDL.Nat64,
|
|
90
|
+
length: IDL.Nat64,
|
|
91
|
+
items: IDL.Vec(IDL.Tuple(IDL.Text, AssetNoContent))
|
|
92
|
+
});
|
|
93
|
+
const CustomDomain = IDL.Record({
|
|
94
|
+
updated_at: IDL.Nat64,
|
|
95
|
+
created_at: IDL.Nat64,
|
|
96
|
+
bn_id: IDL.Opt(IDL.Text)
|
|
97
|
+
});
|
|
98
|
+
const ListResults_1 = IDL.Record({
|
|
99
|
+
matches_length: IDL.Nat64,
|
|
100
|
+
length: IDL.Nat64,
|
|
101
|
+
items: IDL.Vec(IDL.Tuple(IDL.Text, Doc))
|
|
102
|
+
});
|
|
103
|
+
const RulesType = IDL.Variant({Db: IDL.Null, Storage: IDL.Null});
|
|
104
|
+
const Permission = IDL.Variant({
|
|
105
|
+
Controllers: IDL.Null,
|
|
106
|
+
Private: IDL.Null,
|
|
107
|
+
Public: IDL.Null,
|
|
108
|
+
Managed: IDL.Null
|
|
109
|
+
});
|
|
110
|
+
const Rule = IDL.Record({
|
|
111
|
+
updated_at: IDL.Nat64,
|
|
112
|
+
max_size: IDL.Opt(IDL.Nat),
|
|
113
|
+
read: Permission,
|
|
114
|
+
created_at: IDL.Nat64,
|
|
115
|
+
write: Permission
|
|
116
|
+
});
|
|
117
|
+
const SetDoc = IDL.Record({
|
|
118
|
+
updated_at: IDL.Opt(IDL.Nat64),
|
|
119
|
+
data: IDL.Vec(IDL.Nat8)
|
|
120
|
+
});
|
|
121
|
+
const SetRule = IDL.Record({
|
|
122
|
+
updated_at: IDL.Opt(IDL.Nat64),
|
|
123
|
+
max_size: IDL.Opt(IDL.Nat),
|
|
124
|
+
read: Permission,
|
|
125
|
+
write: Permission
|
|
126
|
+
});
|
|
127
|
+
const Chunk = IDL.Record({
|
|
128
|
+
content: IDL.Vec(IDL.Nat8),
|
|
129
|
+
batch_id: IDL.Nat
|
|
130
|
+
});
|
|
131
|
+
const UploadChunk = IDL.Record({chunk_id: IDL.Nat});
|
|
132
|
+
return IDL.Service({
|
|
133
|
+
add_controllers: IDL.Func([ControllersArgs], [IDL.Vec(IDL.Principal)], []),
|
|
134
|
+
commit_asset_upload: IDL.Func([CommitBatch], [], []),
|
|
135
|
+
del_asset: IDL.Func([IDL.Text, IDL.Text], [], []),
|
|
136
|
+
del_assets: IDL.Func([IDL.Opt(IDL.Text)], [], []),
|
|
137
|
+
del_custom_domain: IDL.Func([IDL.Text], [], []),
|
|
138
|
+
del_doc: IDL.Func([IDL.Text, IDL.Text, DelDoc], [], []),
|
|
139
|
+
get_config: IDL.Func([], [Config], []),
|
|
140
|
+
get_doc: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(Doc)], ['query']),
|
|
141
|
+
http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),
|
|
142
|
+
http_request_streaming_callback: IDL.Func(
|
|
143
|
+
[StreamingCallbackToken],
|
|
144
|
+
[StreamingCallbackHttpResponse],
|
|
145
|
+
['query']
|
|
146
|
+
),
|
|
147
|
+
init_asset_upload: IDL.Func([InitAssetKey], [InitUploadResult], []),
|
|
148
|
+
list_assets: IDL.Func([IDL.Opt(IDL.Text), ListParams], [ListResults], ['query']),
|
|
149
|
+
list_controllers: IDL.Func([], [IDL.Vec(IDL.Principal)], ['query']),
|
|
150
|
+
list_custom_domains: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, CustomDomain))], ['query']),
|
|
151
|
+
list_docs: IDL.Func([IDL.Text, ListParams], [ListResults_1], ['query']),
|
|
152
|
+
list_rules: IDL.Func([RulesType], [IDL.Vec(IDL.Tuple(IDL.Text, Rule))], ['query']),
|
|
153
|
+
remove_controllers: IDL.Func([ControllersArgs], [IDL.Vec(IDL.Principal)], []),
|
|
154
|
+
set_config: IDL.Func([Config], [], []),
|
|
155
|
+
set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),
|
|
156
|
+
set_doc: IDL.Func([IDL.Text, IDL.Text, SetDoc], [Doc], []),
|
|
157
|
+
set_rule: IDL.Func([RulesType, IDL.Text, SetRule], [], []),
|
|
158
|
+
upload_asset_chunk: IDL.Func([Chunk], [UploadChunk], []),
|
|
159
|
+
version: IDL.Func([], [IDL.Text], ['query'])
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
export const init = ({IDL}) => {
|
|
163
|
+
return [];
|
|
164
|
+
};
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
export const idlFactory = ({IDL}) => {
|
|
2
|
+
const ControllersArgs = IDL.Record({
|
|
3
|
+
controllers: IDL.Vec(IDL.Principal)
|
|
4
|
+
});
|
|
5
|
+
const CommitBatch = IDL.Record({
|
|
6
|
+
batch_id: IDL.Nat,
|
|
7
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
8
|
+
chunk_ids: IDL.Vec(IDL.Nat)
|
|
9
|
+
});
|
|
10
|
+
const DelDoc = IDL.Record({updated_at: IDL.Opt(IDL.Nat64)});
|
|
11
|
+
const StorageConfig = IDL.Record({
|
|
12
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))))
|
|
13
|
+
});
|
|
14
|
+
const Config = IDL.Record({storage: StorageConfig});
|
|
15
|
+
const Doc = IDL.Record({
|
|
16
|
+
updated_at: IDL.Nat64,
|
|
17
|
+
owner: IDL.Principal,
|
|
18
|
+
data: IDL.Vec(IDL.Nat8),
|
|
19
|
+
created_at: IDL.Nat64
|
|
20
|
+
});
|
|
21
|
+
const HttpRequest = IDL.Record({
|
|
22
|
+
url: IDL.Text,
|
|
23
|
+
method: IDL.Text,
|
|
24
|
+
body: IDL.Vec(IDL.Nat8),
|
|
25
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text))
|
|
26
|
+
});
|
|
27
|
+
const StreamingCallbackToken = IDL.Record({
|
|
28
|
+
token: IDL.Opt(IDL.Text),
|
|
29
|
+
sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
30
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
31
|
+
index: IDL.Nat64,
|
|
32
|
+
encoding_type: IDL.Text,
|
|
33
|
+
full_path: IDL.Text
|
|
34
|
+
});
|
|
35
|
+
const StreamingStrategy = IDL.Variant({
|
|
36
|
+
Callback: IDL.Record({
|
|
37
|
+
token: StreamingCallbackToken,
|
|
38
|
+
callback: IDL.Func([], [], [])
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
const HttpResponse = IDL.Record({
|
|
42
|
+
body: IDL.Vec(IDL.Nat8),
|
|
43
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
44
|
+
streaming_strategy: IDL.Opt(StreamingStrategy),
|
|
45
|
+
status_code: IDL.Nat16
|
|
46
|
+
});
|
|
47
|
+
const StreamingCallbackHttpResponse = IDL.Record({
|
|
48
|
+
token: IDL.Opt(StreamingCallbackToken),
|
|
49
|
+
body: IDL.Vec(IDL.Nat8)
|
|
50
|
+
});
|
|
51
|
+
const InitAssetKey = IDL.Record({
|
|
52
|
+
token: IDL.Opt(IDL.Text),
|
|
53
|
+
collection: IDL.Text,
|
|
54
|
+
name: IDL.Text,
|
|
55
|
+
encoding_type: IDL.Opt(IDL.Text),
|
|
56
|
+
full_path: IDL.Text
|
|
57
|
+
});
|
|
58
|
+
const InitUploadResult = IDL.Record({batch_id: IDL.Nat});
|
|
59
|
+
const OrderKeys = IDL.Record({desc: IDL.Bool});
|
|
60
|
+
const PaginateKeys = IDL.Record({
|
|
61
|
+
start_after: IDL.Opt(IDL.Text),
|
|
62
|
+
limit: IDL.Opt(IDL.Nat64)
|
|
63
|
+
});
|
|
64
|
+
const ListParams = IDL.Record({
|
|
65
|
+
order: IDL.Opt(OrderKeys),
|
|
66
|
+
matcher: IDL.Opt(IDL.Text),
|
|
67
|
+
paginate: IDL.Opt(PaginateKeys)
|
|
68
|
+
});
|
|
69
|
+
const AssetKey = IDL.Record({
|
|
70
|
+
token: IDL.Opt(IDL.Text),
|
|
71
|
+
collection: IDL.Text,
|
|
72
|
+
owner: IDL.Principal,
|
|
73
|
+
name: IDL.Text,
|
|
74
|
+
full_path: IDL.Text
|
|
75
|
+
});
|
|
76
|
+
const AssetEncodingNoContent = IDL.Record({
|
|
77
|
+
modified: IDL.Nat64,
|
|
78
|
+
sha256: IDL.Vec(IDL.Nat8),
|
|
79
|
+
total_length: IDL.Nat
|
|
80
|
+
});
|
|
81
|
+
const AssetNoContent = IDL.Record({
|
|
82
|
+
key: AssetKey,
|
|
83
|
+
updated_at: IDL.Nat64,
|
|
84
|
+
encodings: IDL.Vec(IDL.Tuple(IDL.Text, AssetEncodingNoContent)),
|
|
85
|
+
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
|
|
86
|
+
created_at: IDL.Nat64
|
|
87
|
+
});
|
|
88
|
+
const ListResults = IDL.Record({
|
|
89
|
+
matches_length: IDL.Nat64,
|
|
90
|
+
length: IDL.Nat64,
|
|
91
|
+
items: IDL.Vec(IDL.Tuple(IDL.Text, AssetNoContent))
|
|
92
|
+
});
|
|
93
|
+
const CustomDomain = IDL.Record({
|
|
94
|
+
updated_at: IDL.Nat64,
|
|
95
|
+
created_at: IDL.Nat64,
|
|
96
|
+
bn_id: IDL.Opt(IDL.Text)
|
|
97
|
+
});
|
|
98
|
+
const ListResults_1 = IDL.Record({
|
|
99
|
+
matches_length: IDL.Nat64,
|
|
100
|
+
length: IDL.Nat64,
|
|
101
|
+
items: IDL.Vec(IDL.Tuple(IDL.Text, Doc))
|
|
102
|
+
});
|
|
103
|
+
const RulesType = IDL.Variant({Db: IDL.Null, Storage: IDL.Null});
|
|
104
|
+
const Permission = IDL.Variant({
|
|
105
|
+
Controllers: IDL.Null,
|
|
106
|
+
Private: IDL.Null,
|
|
107
|
+
Public: IDL.Null,
|
|
108
|
+
Managed: IDL.Null
|
|
109
|
+
});
|
|
110
|
+
const Rule = IDL.Record({
|
|
111
|
+
updated_at: IDL.Nat64,
|
|
112
|
+
max_size: IDL.Opt(IDL.Nat),
|
|
113
|
+
read: Permission,
|
|
114
|
+
created_at: IDL.Nat64,
|
|
115
|
+
write: Permission
|
|
116
|
+
});
|
|
117
|
+
const SetDoc = IDL.Record({
|
|
118
|
+
updated_at: IDL.Opt(IDL.Nat64),
|
|
119
|
+
data: IDL.Vec(IDL.Nat8)
|
|
120
|
+
});
|
|
121
|
+
const SetRule = IDL.Record({
|
|
122
|
+
updated_at: IDL.Opt(IDL.Nat64),
|
|
123
|
+
max_size: IDL.Opt(IDL.Nat),
|
|
124
|
+
read: Permission,
|
|
125
|
+
write: Permission
|
|
126
|
+
});
|
|
127
|
+
const Chunk = IDL.Record({
|
|
128
|
+
content: IDL.Vec(IDL.Nat8),
|
|
129
|
+
batch_id: IDL.Nat
|
|
130
|
+
});
|
|
131
|
+
const UploadChunk = IDL.Record({chunk_id: IDL.Nat});
|
|
132
|
+
return IDL.Service({
|
|
133
|
+
add_controllers: IDL.Func([ControllersArgs], [IDL.Vec(IDL.Principal)], []),
|
|
134
|
+
commit_asset_upload: IDL.Func([CommitBatch], [], []),
|
|
135
|
+
del_asset: IDL.Func([IDL.Text, IDL.Text], [], []),
|
|
136
|
+
del_assets: IDL.Func([IDL.Opt(IDL.Text)], [], []),
|
|
137
|
+
del_custom_domain: IDL.Func([IDL.Text], [], []),
|
|
138
|
+
del_doc: IDL.Func([IDL.Text, IDL.Text, DelDoc], [], []),
|
|
139
|
+
get_config: IDL.Func([], [Config], []),
|
|
140
|
+
get_doc: IDL.Func([IDL.Text, IDL.Text], [IDL.Opt(Doc)], ['query']),
|
|
141
|
+
http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),
|
|
142
|
+
http_request_streaming_callback: IDL.Func(
|
|
143
|
+
[StreamingCallbackToken],
|
|
144
|
+
[StreamingCallbackHttpResponse],
|
|
145
|
+
['query']
|
|
146
|
+
),
|
|
147
|
+
init_asset_upload: IDL.Func([InitAssetKey], [InitUploadResult], []),
|
|
148
|
+
list_assets: IDL.Func([IDL.Opt(IDL.Text), ListParams], [ListResults], ['query']),
|
|
149
|
+
list_controllers: IDL.Func([], [IDL.Vec(IDL.Principal)], ['query']),
|
|
150
|
+
list_custom_domains: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Text, CustomDomain))], ['query']),
|
|
151
|
+
list_docs: IDL.Func([IDL.Text, ListParams], [ListResults_1], ['query']),
|
|
152
|
+
list_rules: IDL.Func([RulesType], [IDL.Vec(IDL.Tuple(IDL.Text, Rule))], ['query']),
|
|
153
|
+
remove_controllers: IDL.Func([ControllersArgs], [IDL.Vec(IDL.Principal)], []),
|
|
154
|
+
set_config: IDL.Func([Config], [], []),
|
|
155
|
+
set_custom_domain: IDL.Func([IDL.Text, IDL.Opt(IDL.Text)], [], []),
|
|
156
|
+
set_doc: IDL.Func([IDL.Text, IDL.Text, SetDoc], [Doc], []),
|
|
157
|
+
set_rule: IDL.Func([RulesType, IDL.Text, SetRule], [], []),
|
|
158
|
+
upload_asset_chunk: IDL.Func([Chunk], [UploadChunk], []),
|
|
159
|
+
version: IDL.Func([], [IDL.Text], ['query'])
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
export const init = ({IDL}) => {
|
|
163
|
+
return [];
|
|
164
|
+
};
|
|
File without changes
|