@junobuild/admin 0.0.20 → 0.0.21
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/declarations/cmc/index.js +6 -1
- package/declarations/console/console.did.d.ts +5 -4
- package/declarations/console/console.factory.did.js +3 -2
- package/declarations/console/console.factory.did.mjs +3 -2
- package/declarations/console/index.js +6 -1
- package/declarations/ic/ic.did +131 -18
- package/declarations/ic/ic.did.d.ts +184 -53
- package/declarations/ic/ic.factory.did.js +167 -24
- package/declarations/mission_control/index.js +7 -1
- package/declarations/mission_control/mission_control.did.d.ts +1 -0
- package/declarations/mission_control/mission_control.factory.did.js +5 -0
- package/declarations/observatory/index.js +7 -1
- package/declarations/satellite/index.js +6 -1
- package/declarations/satellite/satellite.did.d.ts +1 -0
- package/declarations/satellite/satellite.factory.did.js +1 -0
- package/declarations/satellite/satellite.factory.did.mjs +1 -0
- package/dist/browser/index.js +15 -15
- package/dist/browser/index.js.map +4 -4
- package/dist/declarations/cmc/index.js +6 -1
- package/dist/declarations/console/console.did.d.ts +5 -4
- package/dist/declarations/console/console.factory.did.js +3 -2
- package/dist/declarations/console/console.factory.did.mjs +3 -2
- package/dist/declarations/console/index.js +6 -1
- package/dist/declarations/ic/ic.did +131 -18
- package/dist/declarations/ic/ic.did.d.ts +184 -53
- package/dist/declarations/ic/ic.factory.did.js +167 -24
- package/dist/declarations/mission_control/index.js +7 -1
- package/dist/declarations/mission_control/mission_control.did.d.ts +1 -0
- package/dist/declarations/mission_control/mission_control.factory.did.js +5 -0
- package/dist/declarations/observatory/index.js +7 -1
- package/dist/declarations/satellite/index.js +6 -1
- package/dist/declarations/satellite/satellite.did.d.ts +1 -0
- package/dist/declarations/satellite/satellite.factory.did.js +1 -0
- package/dist/declarations/satellite/satellite.factory.did.mjs +1 -0
- package/dist/node/index.mjs +19 -19
- package/dist/node/index.mjs.map +4 -4
- package/dist/types/api/ic.api.d.ts +1 -1
- package/dist/types/constants/config.constants.d.ts +2 -0
- package/dist/types/services/mission-control.services.d.ts +1 -1
- package/dist/types/services/satellite.services.d.ts +2 -2
- package/dist/types/types/config.types.d.ts +9 -3
- package/dist/types/types/ic.types.d.ts +2 -1
- package/package.json +1 -1
- package/declarations/frontend/frontend.did +0 -188
- package/declarations/frontend/frontend.did.d.ts +0 -172
- package/declarations/frontend/frontend.factory.did.js +0 -210
- package/declarations/frontend/index.d.ts +0 -45
- package/declarations/frontend/index.js +0 -32
- package/declarations/internet_identity/index.d.ts +0 -45
- package/declarations/internet_identity/index.js +0 -32
- package/declarations/internet_identity/internet_identity.did +0 -378
- package/declarations/internet_identity/internet_identity.did.d.ts +0 -231
- package/declarations/internet_identity/internet_identity.factory.did.js +0 -277
- package/declarations/ledger/index.d.ts +0 -45
- package/declarations/ledger/index.js +0 -32
- package/declarations/ledger/ledger.did +0 -266
- package/declarations/ledger/ledger.did.d.ts +0 -117
- package/declarations/ledger/ledger.factory.did.js +0 -115
- package/dist/declarations/frontend/frontend.did +0 -188
- package/dist/declarations/frontend/frontend.did.d.ts +0 -172
- package/dist/declarations/frontend/frontend.factory.did.js +0 -210
- package/dist/declarations/frontend/index.d.ts +0 -45
- package/dist/declarations/frontend/index.js +0 -32
- package/dist/declarations/internet_identity/index.d.ts +0 -45
- package/dist/declarations/internet_identity/index.js +0 -32
- package/dist/declarations/internet_identity/internet_identity.did +0 -378
- package/dist/declarations/internet_identity/internet_identity.did.d.ts +0 -231
- package/dist/declarations/internet_identity/internet_identity.factory.did.js +0 -277
- package/dist/declarations/ledger/index.d.ts +0 -45
- package/dist/declarations/ledger/index.js +0 -32
- package/dist/declarations/ledger/ledger.did +0 -266
- package/dist/declarations/ledger/ledger.did.d.ts +0 -117
- package/dist/declarations/ledger/ledger.factory.did.js +0 -115
|
@@ -2,5 +2,5 @@ import type { ActorParameters } from '../types/actor.types';
|
|
|
2
2
|
import type { InstallCodeParams } from '../types/ic.types';
|
|
3
3
|
export declare const upgradeCode: ({ actor, code }: {
|
|
4
4
|
actor: ActorParameters;
|
|
5
|
-
code: Omit<InstallCodeParams, 'mode'>;
|
|
5
|
+
code: Omit<InstallCodeParams, 'mode' | 'sender_canister_version'>;
|
|
6
6
|
}) => Promise<void>;
|
|
@@ -6,7 +6,7 @@ export declare const missionControlVersion: (params: {
|
|
|
6
6
|
}) => Promise<string>;
|
|
7
7
|
export declare const upgradeMissionControl: ({ missionControl, wasm_module }: {
|
|
8
8
|
missionControl: MissionControlParameters;
|
|
9
|
-
wasm_module:
|
|
9
|
+
wasm_module: Uint8Array;
|
|
10
10
|
}) => Promise<void>;
|
|
11
11
|
export declare const setSatellitesController: ({ controllerId, profile, ...rest }: {
|
|
12
12
|
missionControl: MissionControlParameters;
|
|
@@ -2,7 +2,7 @@ import type { SatelliteParameters } from '../types/actor.types';
|
|
|
2
2
|
import type { Config } from '../types/config.types';
|
|
3
3
|
import type { CustomDomain } from '../types/customdomain.types';
|
|
4
4
|
import type { Rule, RulesType } from '../types/rules.types';
|
|
5
|
-
export declare const setConfig: ({ config: { storage: { headers: configHeaders } }, satellite }: {
|
|
5
|
+
export declare const setConfig: ({ config: { storage: { headers: configHeaders, rewrites: configRewrites } }, satellite }: {
|
|
6
6
|
config: Config;
|
|
7
7
|
satellite: SatelliteParameters;
|
|
8
8
|
}) => Promise<void>;
|
|
@@ -20,7 +20,7 @@ export declare const satelliteVersion: (params: {
|
|
|
20
20
|
}) => Promise<string>;
|
|
21
21
|
export declare const upgradeSatellite: ({ satellite, wasm_module, deprecated, deprecatedNoScope }: {
|
|
22
22
|
satellite: SatelliteParameters;
|
|
23
|
-
wasm_module:
|
|
23
|
+
wasm_module: Uint8Array;
|
|
24
24
|
deprecated: boolean;
|
|
25
25
|
deprecatedNoScope: boolean;
|
|
26
26
|
}) => Promise<void>;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
1
|
+
export type StorageConfigSourceGlob = string;
|
|
2
|
+
export interface StorageConfigHeader {
|
|
3
|
+
source: StorageConfigSourceGlob;
|
|
3
4
|
headers: [string, string][];
|
|
4
5
|
}
|
|
6
|
+
export interface StorageConfigRewrite {
|
|
7
|
+
source: StorageConfigSourceGlob;
|
|
8
|
+
destination: string;
|
|
9
|
+
}
|
|
5
10
|
export interface StorageConfig {
|
|
6
|
-
headers
|
|
11
|
+
headers?: StorageConfigHeader[];
|
|
12
|
+
rewrites?: StorageConfigRewrite[];
|
|
7
13
|
}
|
|
8
14
|
export interface Config {
|
|
9
15
|
storage: StorageConfig;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { canister_id, wasm_module } from '../../declarations/ic/ic.did';
|
|
2
2
|
export interface InstallCodeParams {
|
|
3
|
-
arg:
|
|
3
|
+
arg: Uint8Array;
|
|
4
4
|
wasm_module: wasm_module;
|
|
5
5
|
mode: {
|
|
6
6
|
reinstall: null;
|
|
@@ -10,4 +10,5 @@ export interface InstallCodeParams {
|
|
|
10
10
|
install: null;
|
|
11
11
|
};
|
|
12
12
|
canister_id: canister_id;
|
|
13
|
+
sender_canister_version: [] | [bigint];
|
|
13
14
|
}
|
package/package.json
CHANGED
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
type BatchId = nat;
|
|
2
|
-
type ChunkId = nat;
|
|
3
|
-
type Key = text;
|
|
4
|
-
type Time = int;
|
|
5
|
-
|
|
6
|
-
type CreateAssetArguments = record {
|
|
7
|
-
key: Key;
|
|
8
|
-
content_type: text;
|
|
9
|
-
max_age: opt nat64;
|
|
10
|
-
headers: opt vec HeaderField;
|
|
11
|
-
enable_aliasing: opt bool;
|
|
12
|
-
allow_raw_access: opt bool;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
// Add or change content for an asset, by content encoding
|
|
16
|
-
type SetAssetContentArguments = record {
|
|
17
|
-
key: Key;
|
|
18
|
-
content_encoding: text;
|
|
19
|
-
chunk_ids: vec ChunkId;
|
|
20
|
-
sha256: opt blob;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
// Remove content for an asset, by content encoding
|
|
24
|
-
type UnsetAssetContentArguments = record {
|
|
25
|
-
key: Key;
|
|
26
|
-
content_encoding: text;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
// Delete an asset
|
|
30
|
-
type DeleteAssetArguments = record {
|
|
31
|
-
key: Key;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
// Reset everything
|
|
35
|
-
type ClearArguments = record {};
|
|
36
|
-
|
|
37
|
-
type BatchOperationKind = variant {
|
|
38
|
-
CreateAsset: CreateAssetArguments;
|
|
39
|
-
SetAssetContent: SetAssetContentArguments;
|
|
40
|
-
|
|
41
|
-
UnsetAssetContent: UnsetAssetContentArguments;
|
|
42
|
-
DeleteAsset: DeleteAssetArguments;
|
|
43
|
-
|
|
44
|
-
Clear: ClearArguments;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
type HeaderField = record { text; text; };
|
|
48
|
-
|
|
49
|
-
type HttpRequest = record {
|
|
50
|
-
method: text;
|
|
51
|
-
url: text;
|
|
52
|
-
headers: vec HeaderField;
|
|
53
|
-
body: blob;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
type HttpResponse = record {
|
|
57
|
-
status_code: nat16;
|
|
58
|
-
headers: vec HeaderField;
|
|
59
|
-
body: blob;
|
|
60
|
-
streaming_strategy: opt StreamingStrategy;
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
type StreamingCallbackHttpResponse = record {
|
|
64
|
-
body: blob;
|
|
65
|
-
token: opt StreamingCallbackToken;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
type StreamingCallbackToken = record {
|
|
69
|
-
key: Key;
|
|
70
|
-
content_encoding: text;
|
|
71
|
-
index: nat;
|
|
72
|
-
sha256: opt blob;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
type StreamingStrategy = variant {
|
|
76
|
-
Callback: record {
|
|
77
|
-
callback: func (StreamingCallbackToken) -> (opt StreamingCallbackHttpResponse) query;
|
|
78
|
-
token: StreamingCallbackToken;
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
type SetAssetPropertiesArguments = record {
|
|
83
|
-
key: Key;
|
|
84
|
-
max_age: opt opt nat64;
|
|
85
|
-
headers: opt opt vec HeaderField;
|
|
86
|
-
allow_raw_access: opt opt bool;
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
type Permission = variant {
|
|
90
|
-
Commit;
|
|
91
|
-
ManagePermissions;
|
|
92
|
-
Prepare;
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
type GrantPermission = record {
|
|
96
|
-
to_principal: principal;
|
|
97
|
-
permission: Permission;
|
|
98
|
-
};
|
|
99
|
-
type RevokePermission = record {
|
|
100
|
-
of_principal: principal;
|
|
101
|
-
permission: Permission;
|
|
102
|
-
};
|
|
103
|
-
type ListPermitted = record { permission: Permission };
|
|
104
|
-
|
|
105
|
-
type ValidationResult = variant { Ok : text; Err : text };
|
|
106
|
-
|
|
107
|
-
service: {
|
|
108
|
-
get: (record {
|
|
109
|
-
key: Key;
|
|
110
|
-
accept_encodings: vec text;
|
|
111
|
-
}) -> (record {
|
|
112
|
-
content: blob; // may be the entirety of the content, or just chunk index 0
|
|
113
|
-
content_type: text;
|
|
114
|
-
content_encoding: text;
|
|
115
|
-
sha256: opt blob; // sha256 of entire asset encoding, calculated by dfx and passed in SetAssetContentArguments
|
|
116
|
-
total_length: nat; // all chunks except last have size == content.size()
|
|
117
|
-
}) query;
|
|
118
|
-
|
|
119
|
-
// if get() returned chunks > 1, call this to retrieve them.
|
|
120
|
-
// chunks may or may not be split up at the same boundaries as presented to create_chunk().
|
|
121
|
-
get_chunk: (record {
|
|
122
|
-
key: Key;
|
|
123
|
-
content_encoding: text;
|
|
124
|
-
index: nat;
|
|
125
|
-
sha256: opt blob; // sha256 of entire asset encoding, calculated by dfx and passed in SetAssetContentArguments
|
|
126
|
-
}) -> (record { content: blob }) query;
|
|
127
|
-
|
|
128
|
-
list : (record {}) -> (vec record {
|
|
129
|
-
key: Key;
|
|
130
|
-
content_type: text;
|
|
131
|
-
encodings: vec record {
|
|
132
|
-
content_encoding: text;
|
|
133
|
-
sha256: opt blob; // sha256 of entire asset encoding, calculated by dfx and passed in SetAssetContentArguments
|
|
134
|
-
length: nat; // Size of this encoding's blob. Calculated when uploading assets.
|
|
135
|
-
modified: Time;
|
|
136
|
-
};
|
|
137
|
-
}) query;
|
|
138
|
-
|
|
139
|
-
certified_tree : (record {}) -> (record {
|
|
140
|
-
certificate: blob;
|
|
141
|
-
tree: blob;
|
|
142
|
-
}) query;
|
|
143
|
-
|
|
144
|
-
create_batch : (record {}) -> (record { batch_id: BatchId });
|
|
145
|
-
|
|
146
|
-
create_chunk: (record { batch_id: BatchId; content: blob }) -> (record { chunk_id: ChunkId });
|
|
147
|
-
|
|
148
|
-
// Perform all operations successfully, or reject
|
|
149
|
-
commit_batch: (record { batch_id: BatchId; operations: vec BatchOperationKind }) -> ();
|
|
150
|
-
|
|
151
|
-
create_asset: (CreateAssetArguments) -> ();
|
|
152
|
-
set_asset_content: (SetAssetContentArguments) -> ();
|
|
153
|
-
unset_asset_content: (UnsetAssetContentArguments) -> ();
|
|
154
|
-
|
|
155
|
-
delete_asset: (DeleteAssetArguments) -> ();
|
|
156
|
-
|
|
157
|
-
clear: (ClearArguments) -> ();
|
|
158
|
-
|
|
159
|
-
// Single call to create an asset with content for a single content encoding that
|
|
160
|
-
// fits within the message ingress limit.
|
|
161
|
-
store: (record {
|
|
162
|
-
key: Key;
|
|
163
|
-
content_type: text;
|
|
164
|
-
content_encoding: text;
|
|
165
|
-
content: blob;
|
|
166
|
-
sha256: opt blob
|
|
167
|
-
}) -> ();
|
|
168
|
-
|
|
169
|
-
http_request: (request: HttpRequest) -> (HttpResponse) query;
|
|
170
|
-
http_request_streaming_callback: (token: StreamingCallbackToken) -> (opt StreamingCallbackHttpResponse) query;
|
|
171
|
-
|
|
172
|
-
authorize: (principal) -> ();
|
|
173
|
-
deauthorize: (principal) -> ();
|
|
174
|
-
list_authorized: () -> (vec principal) query;
|
|
175
|
-
grant_permission: (GrantPermission) -> ();
|
|
176
|
-
revoke_permission: (RevokePermission) -> ();
|
|
177
|
-
list_permitted: (ListPermitted) -> (vec principal) query;
|
|
178
|
-
take_ownership: () -> ();
|
|
179
|
-
|
|
180
|
-
get_asset_properties : (key: Key) -> (record {
|
|
181
|
-
max_age: opt nat64;
|
|
182
|
-
headers: opt vec HeaderField;
|
|
183
|
-
allow_raw_access: opt bool; } ) query;
|
|
184
|
-
set_asset_properties: (SetAssetPropertiesArguments) -> ();
|
|
185
|
-
|
|
186
|
-
validate_grant_permission: (GrantPermission) -> (ValidationResult);
|
|
187
|
-
validate_revoke_permission: (RevokePermission) -> (ValidationResult);
|
|
188
|
-
}
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import type {ActorMethod} from '@dfinity/agent';
|
|
2
|
-
import type {Principal} from '@dfinity/principal';
|
|
3
|
-
|
|
4
|
-
export type BatchId = bigint;
|
|
5
|
-
export type BatchOperationKind =
|
|
6
|
-
| {CreateAsset: CreateAssetArguments}
|
|
7
|
-
| {UnsetAssetContent: UnsetAssetContentArguments}
|
|
8
|
-
| {DeleteAsset: DeleteAssetArguments}
|
|
9
|
-
| {SetAssetContent: SetAssetContentArguments}
|
|
10
|
-
| {Clear: ClearArguments};
|
|
11
|
-
export type ChunkId = bigint;
|
|
12
|
-
export type ClearArguments = {};
|
|
13
|
-
export interface CreateAssetArguments {
|
|
14
|
-
key: Key;
|
|
15
|
-
content_type: string;
|
|
16
|
-
headers: [] | [Array<HeaderField>];
|
|
17
|
-
allow_raw_access: [] | [boolean];
|
|
18
|
-
max_age: [] | [bigint];
|
|
19
|
-
enable_aliasing: [] | [boolean];
|
|
20
|
-
}
|
|
21
|
-
export interface DeleteAssetArguments {
|
|
22
|
-
key: Key;
|
|
23
|
-
}
|
|
24
|
-
export interface GrantPermission {
|
|
25
|
-
permission: Permission;
|
|
26
|
-
to_principal: Principal;
|
|
27
|
-
}
|
|
28
|
-
export type HeaderField = [string, string];
|
|
29
|
-
export interface HttpRequest {
|
|
30
|
-
url: string;
|
|
31
|
-
method: string;
|
|
32
|
-
body: Uint8Array | number[];
|
|
33
|
-
headers: Array<HeaderField>;
|
|
34
|
-
}
|
|
35
|
-
export interface HttpResponse {
|
|
36
|
-
body: Uint8Array | number[];
|
|
37
|
-
headers: Array<HeaderField>;
|
|
38
|
-
streaming_strategy: [] | [StreamingStrategy];
|
|
39
|
-
status_code: number;
|
|
40
|
-
}
|
|
41
|
-
export type Key = string;
|
|
42
|
-
export interface ListPermitted {
|
|
43
|
-
permission: Permission;
|
|
44
|
-
}
|
|
45
|
-
export type Permission = {Prepare: null} | {ManagePermissions: null} | {Commit: null};
|
|
46
|
-
export interface RevokePermission {
|
|
47
|
-
permission: Permission;
|
|
48
|
-
of_principal: Principal;
|
|
49
|
-
}
|
|
50
|
-
export interface SetAssetContentArguments {
|
|
51
|
-
key: Key;
|
|
52
|
-
sha256: [] | [Uint8Array | number[]];
|
|
53
|
-
chunk_ids: Array<ChunkId>;
|
|
54
|
-
content_encoding: string;
|
|
55
|
-
}
|
|
56
|
-
export interface SetAssetPropertiesArguments {
|
|
57
|
-
key: Key;
|
|
58
|
-
headers: [] | [[] | [Array<HeaderField>]];
|
|
59
|
-
allow_raw_access: [] | [[] | [boolean]];
|
|
60
|
-
max_age: [] | [[] | [bigint]];
|
|
61
|
-
}
|
|
62
|
-
export interface StreamingCallbackHttpResponse {
|
|
63
|
-
token: [] | [StreamingCallbackToken];
|
|
64
|
-
body: Uint8Array | number[];
|
|
65
|
-
}
|
|
66
|
-
export interface StreamingCallbackToken {
|
|
67
|
-
key: Key;
|
|
68
|
-
sha256: [] | [Uint8Array | number[]];
|
|
69
|
-
index: bigint;
|
|
70
|
-
content_encoding: string;
|
|
71
|
-
}
|
|
72
|
-
export type StreamingStrategy = {
|
|
73
|
-
Callback: {
|
|
74
|
-
token: StreamingCallbackToken;
|
|
75
|
-
callback: [Principal, string];
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
export type Time = bigint;
|
|
79
|
-
export interface UnsetAssetContentArguments {
|
|
80
|
-
key: Key;
|
|
81
|
-
content_encoding: string;
|
|
82
|
-
}
|
|
83
|
-
export type ValidationResult = {Ok: string} | {Err: string};
|
|
84
|
-
export interface _SERVICE {
|
|
85
|
-
authorize: ActorMethod<[Principal], undefined>;
|
|
86
|
-
certified_tree: ActorMethod<
|
|
87
|
-
[{}],
|
|
88
|
-
{certificate: Uint8Array | number[]; tree: Uint8Array | number[]}
|
|
89
|
-
>;
|
|
90
|
-
clear: ActorMethod<[ClearArguments], undefined>;
|
|
91
|
-
commit_batch: ActorMethod<
|
|
92
|
-
[{batch_id: BatchId; operations: Array<BatchOperationKind>}],
|
|
93
|
-
undefined
|
|
94
|
-
>;
|
|
95
|
-
create_asset: ActorMethod<[CreateAssetArguments], undefined>;
|
|
96
|
-
create_batch: ActorMethod<[{}], {batch_id: BatchId}>;
|
|
97
|
-
create_chunk: ActorMethod<
|
|
98
|
-
[{content: Uint8Array | number[]; batch_id: BatchId}],
|
|
99
|
-
{chunk_id: ChunkId}
|
|
100
|
-
>;
|
|
101
|
-
deauthorize: ActorMethod<[Principal], undefined>;
|
|
102
|
-
delete_asset: ActorMethod<[DeleteAssetArguments], undefined>;
|
|
103
|
-
get: ActorMethod<
|
|
104
|
-
[{key: Key; accept_encodings: Array<string>}],
|
|
105
|
-
{
|
|
106
|
-
content: Uint8Array | number[];
|
|
107
|
-
sha256: [] | [Uint8Array | number[]];
|
|
108
|
-
content_type: string;
|
|
109
|
-
content_encoding: string;
|
|
110
|
-
total_length: bigint;
|
|
111
|
-
}
|
|
112
|
-
>;
|
|
113
|
-
get_asset_properties: ActorMethod<
|
|
114
|
-
[Key],
|
|
115
|
-
{
|
|
116
|
-
headers: [] | [Array<HeaderField>];
|
|
117
|
-
allow_raw_access: [] | [boolean];
|
|
118
|
-
max_age: [] | [bigint];
|
|
119
|
-
}
|
|
120
|
-
>;
|
|
121
|
-
get_chunk: ActorMethod<
|
|
122
|
-
[
|
|
123
|
-
{
|
|
124
|
-
key: Key;
|
|
125
|
-
sha256: [] | [Uint8Array | number[]];
|
|
126
|
-
index: bigint;
|
|
127
|
-
content_encoding: string;
|
|
128
|
-
}
|
|
129
|
-
],
|
|
130
|
-
{content: Uint8Array | number[]}
|
|
131
|
-
>;
|
|
132
|
-
grant_permission: ActorMethod<[GrantPermission], undefined>;
|
|
133
|
-
http_request: ActorMethod<[HttpRequest], HttpResponse>;
|
|
134
|
-
http_request_streaming_callback: ActorMethod<
|
|
135
|
-
[StreamingCallbackToken],
|
|
136
|
-
[] | [StreamingCallbackHttpResponse]
|
|
137
|
-
>;
|
|
138
|
-
list: ActorMethod<
|
|
139
|
-
[{}],
|
|
140
|
-
Array<{
|
|
141
|
-
key: Key;
|
|
142
|
-
encodings: Array<{
|
|
143
|
-
modified: Time;
|
|
144
|
-
sha256: [] | [Uint8Array | number[]];
|
|
145
|
-
length: bigint;
|
|
146
|
-
content_encoding: string;
|
|
147
|
-
}>;
|
|
148
|
-
content_type: string;
|
|
149
|
-
}>
|
|
150
|
-
>;
|
|
151
|
-
list_authorized: ActorMethod<[], Array<Principal>>;
|
|
152
|
-
list_permitted: ActorMethod<[ListPermitted], Array<Principal>>;
|
|
153
|
-
revoke_permission: ActorMethod<[RevokePermission], undefined>;
|
|
154
|
-
set_asset_content: ActorMethod<[SetAssetContentArguments], undefined>;
|
|
155
|
-
set_asset_properties: ActorMethod<[SetAssetPropertiesArguments], undefined>;
|
|
156
|
-
store: ActorMethod<
|
|
157
|
-
[
|
|
158
|
-
{
|
|
159
|
-
key: Key;
|
|
160
|
-
content: Uint8Array | number[];
|
|
161
|
-
sha256: [] | [Uint8Array | number[]];
|
|
162
|
-
content_type: string;
|
|
163
|
-
content_encoding: string;
|
|
164
|
-
}
|
|
165
|
-
],
|
|
166
|
-
undefined
|
|
167
|
-
>;
|
|
168
|
-
take_ownership: ActorMethod<[], undefined>;
|
|
169
|
-
unset_asset_content: ActorMethod<[UnsetAssetContentArguments], undefined>;
|
|
170
|
-
validate_grant_permission: ActorMethod<[GrantPermission], ValidationResult>;
|
|
171
|
-
validate_revoke_permission: ActorMethod<[RevokePermission], ValidationResult>;
|
|
172
|
-
}
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
// @ts-ignore
|
|
2
|
-
export const idlFactory = ({IDL}) => {
|
|
3
|
-
const ClearArguments = IDL.Record({});
|
|
4
|
-
const BatchId = IDL.Nat;
|
|
5
|
-
const Key = IDL.Text;
|
|
6
|
-
const HeaderField = IDL.Tuple(IDL.Text, IDL.Text);
|
|
7
|
-
const CreateAssetArguments = IDL.Record({
|
|
8
|
-
key: Key,
|
|
9
|
-
content_type: IDL.Text,
|
|
10
|
-
headers: IDL.Opt(IDL.Vec(HeaderField)),
|
|
11
|
-
allow_raw_access: IDL.Opt(IDL.Bool),
|
|
12
|
-
max_age: IDL.Opt(IDL.Nat64),
|
|
13
|
-
enable_aliasing: IDL.Opt(IDL.Bool)
|
|
14
|
-
});
|
|
15
|
-
const UnsetAssetContentArguments = IDL.Record({
|
|
16
|
-
key: Key,
|
|
17
|
-
content_encoding: IDL.Text
|
|
18
|
-
});
|
|
19
|
-
const DeleteAssetArguments = IDL.Record({key: Key});
|
|
20
|
-
const ChunkId = IDL.Nat;
|
|
21
|
-
const SetAssetContentArguments = IDL.Record({
|
|
22
|
-
key: Key,
|
|
23
|
-
sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
24
|
-
chunk_ids: IDL.Vec(ChunkId),
|
|
25
|
-
content_encoding: IDL.Text
|
|
26
|
-
});
|
|
27
|
-
const BatchOperationKind = IDL.Variant({
|
|
28
|
-
CreateAsset: CreateAssetArguments,
|
|
29
|
-
UnsetAssetContent: UnsetAssetContentArguments,
|
|
30
|
-
DeleteAsset: DeleteAssetArguments,
|
|
31
|
-
SetAssetContent: SetAssetContentArguments,
|
|
32
|
-
Clear: ClearArguments
|
|
33
|
-
});
|
|
34
|
-
const Permission = IDL.Variant({
|
|
35
|
-
Prepare: IDL.Null,
|
|
36
|
-
ManagePermissions: IDL.Null,
|
|
37
|
-
Commit: IDL.Null
|
|
38
|
-
});
|
|
39
|
-
const GrantPermission = IDL.Record({
|
|
40
|
-
permission: Permission,
|
|
41
|
-
to_principal: IDL.Principal
|
|
42
|
-
});
|
|
43
|
-
const HttpRequest = IDL.Record({
|
|
44
|
-
url: IDL.Text,
|
|
45
|
-
method: IDL.Text,
|
|
46
|
-
body: IDL.Vec(IDL.Nat8),
|
|
47
|
-
headers: IDL.Vec(HeaderField)
|
|
48
|
-
});
|
|
49
|
-
const StreamingCallbackToken = IDL.Record({
|
|
50
|
-
key: Key,
|
|
51
|
-
sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
52
|
-
index: IDL.Nat,
|
|
53
|
-
content_encoding: IDL.Text
|
|
54
|
-
});
|
|
55
|
-
const StreamingCallbackHttpResponse = IDL.Record({
|
|
56
|
-
token: IDL.Opt(StreamingCallbackToken),
|
|
57
|
-
body: IDL.Vec(IDL.Nat8)
|
|
58
|
-
});
|
|
59
|
-
const StreamingStrategy = IDL.Variant({
|
|
60
|
-
Callback: IDL.Record({
|
|
61
|
-
token: StreamingCallbackToken,
|
|
62
|
-
callback: IDL.Func(
|
|
63
|
-
[StreamingCallbackToken],
|
|
64
|
-
[IDL.Opt(StreamingCallbackHttpResponse)],
|
|
65
|
-
['query']
|
|
66
|
-
)
|
|
67
|
-
})
|
|
68
|
-
});
|
|
69
|
-
const HttpResponse = IDL.Record({
|
|
70
|
-
body: IDL.Vec(IDL.Nat8),
|
|
71
|
-
headers: IDL.Vec(HeaderField),
|
|
72
|
-
streaming_strategy: IDL.Opt(StreamingStrategy),
|
|
73
|
-
status_code: IDL.Nat16
|
|
74
|
-
});
|
|
75
|
-
const Time = IDL.Int;
|
|
76
|
-
const ListPermitted = IDL.Record({permission: Permission});
|
|
77
|
-
const RevokePermission = IDL.Record({
|
|
78
|
-
permission: Permission,
|
|
79
|
-
of_principal: IDL.Principal
|
|
80
|
-
});
|
|
81
|
-
const SetAssetPropertiesArguments = IDL.Record({
|
|
82
|
-
key: Key,
|
|
83
|
-
headers: IDL.Opt(IDL.Opt(IDL.Vec(HeaderField))),
|
|
84
|
-
allow_raw_access: IDL.Opt(IDL.Opt(IDL.Bool)),
|
|
85
|
-
max_age: IDL.Opt(IDL.Opt(IDL.Nat64))
|
|
86
|
-
});
|
|
87
|
-
const ValidationResult = IDL.Variant({Ok: IDL.Text, Err: IDL.Text});
|
|
88
|
-
return IDL.Service({
|
|
89
|
-
authorize: IDL.Func([IDL.Principal], [], []),
|
|
90
|
-
certified_tree: IDL.Func(
|
|
91
|
-
[IDL.Record({})],
|
|
92
|
-
[
|
|
93
|
-
IDL.Record({
|
|
94
|
-
certificate: IDL.Vec(IDL.Nat8),
|
|
95
|
-
tree: IDL.Vec(IDL.Nat8)
|
|
96
|
-
})
|
|
97
|
-
],
|
|
98
|
-
['query']
|
|
99
|
-
),
|
|
100
|
-
clear: IDL.Func([ClearArguments], [], []),
|
|
101
|
-
commit_batch: IDL.Func(
|
|
102
|
-
[
|
|
103
|
-
IDL.Record({
|
|
104
|
-
batch_id: BatchId,
|
|
105
|
-
operations: IDL.Vec(BatchOperationKind)
|
|
106
|
-
})
|
|
107
|
-
],
|
|
108
|
-
[],
|
|
109
|
-
[]
|
|
110
|
-
),
|
|
111
|
-
create_asset: IDL.Func([CreateAssetArguments], [], []),
|
|
112
|
-
create_batch: IDL.Func([IDL.Record({})], [IDL.Record({batch_id: BatchId})], []),
|
|
113
|
-
create_chunk: IDL.Func(
|
|
114
|
-
[IDL.Record({content: IDL.Vec(IDL.Nat8), batch_id: BatchId})],
|
|
115
|
-
[IDL.Record({chunk_id: ChunkId})],
|
|
116
|
-
[]
|
|
117
|
-
),
|
|
118
|
-
deauthorize: IDL.Func([IDL.Principal], [], []),
|
|
119
|
-
delete_asset: IDL.Func([DeleteAssetArguments], [], []),
|
|
120
|
-
get: IDL.Func(
|
|
121
|
-
[IDL.Record({key: Key, accept_encodings: IDL.Vec(IDL.Text)})],
|
|
122
|
-
[
|
|
123
|
-
IDL.Record({
|
|
124
|
-
content: IDL.Vec(IDL.Nat8),
|
|
125
|
-
sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
126
|
-
content_type: IDL.Text,
|
|
127
|
-
content_encoding: IDL.Text,
|
|
128
|
-
total_length: IDL.Nat
|
|
129
|
-
})
|
|
130
|
-
],
|
|
131
|
-
['query']
|
|
132
|
-
),
|
|
133
|
-
get_asset_properties: IDL.Func(
|
|
134
|
-
[Key],
|
|
135
|
-
[
|
|
136
|
-
IDL.Record({
|
|
137
|
-
headers: IDL.Opt(IDL.Vec(HeaderField)),
|
|
138
|
-
allow_raw_access: IDL.Opt(IDL.Bool),
|
|
139
|
-
max_age: IDL.Opt(IDL.Nat64)
|
|
140
|
-
})
|
|
141
|
-
],
|
|
142
|
-
['query']
|
|
143
|
-
),
|
|
144
|
-
get_chunk: IDL.Func(
|
|
145
|
-
[
|
|
146
|
-
IDL.Record({
|
|
147
|
-
key: Key,
|
|
148
|
-
sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
149
|
-
index: IDL.Nat,
|
|
150
|
-
content_encoding: IDL.Text
|
|
151
|
-
})
|
|
152
|
-
],
|
|
153
|
-
[IDL.Record({content: IDL.Vec(IDL.Nat8)})],
|
|
154
|
-
['query']
|
|
155
|
-
),
|
|
156
|
-
grant_permission: IDL.Func([GrantPermission], [], []),
|
|
157
|
-
http_request: IDL.Func([HttpRequest], [HttpResponse], ['query']),
|
|
158
|
-
http_request_streaming_callback: IDL.Func(
|
|
159
|
-
[StreamingCallbackToken],
|
|
160
|
-
[IDL.Opt(StreamingCallbackHttpResponse)],
|
|
161
|
-
['query']
|
|
162
|
-
),
|
|
163
|
-
list: IDL.Func(
|
|
164
|
-
[IDL.Record({})],
|
|
165
|
-
[
|
|
166
|
-
IDL.Vec(
|
|
167
|
-
IDL.Record({
|
|
168
|
-
key: Key,
|
|
169
|
-
encodings: IDL.Vec(
|
|
170
|
-
IDL.Record({
|
|
171
|
-
modified: Time,
|
|
172
|
-
sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
173
|
-
length: IDL.Nat,
|
|
174
|
-
content_encoding: IDL.Text
|
|
175
|
-
})
|
|
176
|
-
),
|
|
177
|
-
content_type: IDL.Text
|
|
178
|
-
})
|
|
179
|
-
)
|
|
180
|
-
],
|
|
181
|
-
['query']
|
|
182
|
-
),
|
|
183
|
-
list_authorized: IDL.Func([], [IDL.Vec(IDL.Principal)], ['query']),
|
|
184
|
-
list_permitted: IDL.Func([ListPermitted], [IDL.Vec(IDL.Principal)], ['query']),
|
|
185
|
-
revoke_permission: IDL.Func([RevokePermission], [], []),
|
|
186
|
-
set_asset_content: IDL.Func([SetAssetContentArguments], [], []),
|
|
187
|
-
set_asset_properties: IDL.Func([SetAssetPropertiesArguments], [], []),
|
|
188
|
-
store: IDL.Func(
|
|
189
|
-
[
|
|
190
|
-
IDL.Record({
|
|
191
|
-
key: Key,
|
|
192
|
-
content: IDL.Vec(IDL.Nat8),
|
|
193
|
-
sha256: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
194
|
-
content_type: IDL.Text,
|
|
195
|
-
content_encoding: IDL.Text
|
|
196
|
-
})
|
|
197
|
-
],
|
|
198
|
-
[],
|
|
199
|
-
[]
|
|
200
|
-
),
|
|
201
|
-
take_ownership: IDL.Func([], [], []),
|
|
202
|
-
unset_asset_content: IDL.Func([UnsetAssetContentArguments], [], []),
|
|
203
|
-
validate_grant_permission: IDL.Func([GrantPermission], [ValidationResult], []),
|
|
204
|
-
validate_revoke_permission: IDL.Func([RevokePermission], [ValidationResult], [])
|
|
205
|
-
});
|
|
206
|
-
};
|
|
207
|
-
// @ts-ignore
|
|
208
|
-
export const init = ({IDL}) => {
|
|
209
|
-
return [];
|
|
210
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type {ActorConfig, ActorSubclass, Agent, HttpAgentOptions} from '@dfinity/agent';
|
|
2
|
-
import type {IDL} from '@dfinity/candid';
|
|
3
|
-
import type {Principal} from '@dfinity/principal';
|
|
4
|
-
|
|
5
|
-
import {_SERVICE} from './frontend.did';
|
|
6
|
-
|
|
7
|
-
export declare const idlFactory: IDL.InterfaceFactory;
|
|
8
|
-
export declare const canisterId: string;
|
|
9
|
-
|
|
10
|
-
export declare interface CreateActorOptions {
|
|
11
|
-
/**
|
|
12
|
-
* @see {@link Agent}
|
|
13
|
-
*/
|
|
14
|
-
agent?: Agent;
|
|
15
|
-
/**
|
|
16
|
-
* @see {@link HttpAgentOptions}
|
|
17
|
-
*/
|
|
18
|
-
agentOptions?: HttpAgentOptions;
|
|
19
|
-
/**
|
|
20
|
-
* @see {@link ActorConfig}
|
|
21
|
-
*/
|
|
22
|
-
actorOptions?: ActorConfig;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Intializes an {@link ActorSubclass}, configured with the provided SERVICE interface of a canister.
|
|
27
|
-
* @constructs {@link ActorSubClass}
|
|
28
|
-
* @param {string | Principal} canisterId - ID of the canister the {@link Actor} will talk to
|
|
29
|
-
* @param {CreateActorOptions} options - see {@link CreateActorOptions}
|
|
30
|
-
* @param {CreateActorOptions["agent"]} options.agent - a pre-configured agent you'd like to use. Supercedes agentOptions
|
|
31
|
-
* @param {CreateActorOptions["agentOptions"]} options.agentOptions - options to set up a new agent
|
|
32
|
-
* @see {@link HttpAgentOptions}
|
|
33
|
-
* @param {CreateActorOptions["actorOptions"]} options.actorOptions - options for the Actor
|
|
34
|
-
* @see {@link ActorConfig}
|
|
35
|
-
*/
|
|
36
|
-
export declare const createActor: (
|
|
37
|
-
canisterId: string | Principal,
|
|
38
|
-
options?: CreateActorOptions
|
|
39
|
-
) => ActorSubclass<_SERVICE>;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Intialized Actor using default settings, ready to talk to a canister using its candid interface
|
|
43
|
-
* @constructs {@link ActorSubClass}
|
|
44
|
-
*/
|
|
45
|
-
export declare const frontend: ActorSubclass<_SERVICE>;
|