@junobuild/core 0.0.20 → 0.0.22

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 (73) hide show
  1. package/declarations/cmc/index.js +6 -1
  2. package/declarations/console/console.did.d.ts +5 -4
  3. package/declarations/console/console.factory.did.js +3 -2
  4. package/declarations/console/console.factory.did.mjs +3 -2
  5. package/declarations/console/index.js +6 -1
  6. package/declarations/ic/ic.did +131 -18
  7. package/declarations/ic/ic.did.d.ts +184 -53
  8. package/declarations/ic/ic.factory.did.js +167 -24
  9. package/declarations/mission_control/index.js +7 -1
  10. package/declarations/mission_control/mission_control.did.d.ts +1 -0
  11. package/declarations/mission_control/mission_control.factory.did.js +5 -0
  12. package/declarations/observatory/index.js +7 -1
  13. package/declarations/satellite/index.js +6 -1
  14. package/declarations/satellite/satellite.did.d.ts +1 -0
  15. package/declarations/satellite/satellite.factory.did.js +1 -0
  16. package/declarations/satellite/satellite.factory.did.mjs +1 -0
  17. package/dist/browser/index.js +8 -8
  18. package/dist/browser/index.js.map +4 -4
  19. package/dist/declarations/cmc/index.js +6 -1
  20. package/dist/declarations/console/console.did.d.ts +5 -4
  21. package/dist/declarations/console/console.factory.did.js +3 -2
  22. package/dist/declarations/console/console.factory.did.mjs +3 -2
  23. package/dist/declarations/console/index.js +6 -1
  24. package/dist/declarations/ic/ic.did +131 -18
  25. package/dist/declarations/ic/ic.did.d.ts +184 -53
  26. package/dist/declarations/ic/ic.factory.did.js +167 -24
  27. package/dist/declarations/mission_control/index.js +7 -1
  28. package/dist/declarations/mission_control/mission_control.did.d.ts +1 -0
  29. package/dist/declarations/mission_control/mission_control.factory.did.js +5 -0
  30. package/dist/declarations/observatory/index.js +7 -1
  31. package/dist/declarations/satellite/index.js +6 -1
  32. package/dist/declarations/satellite/satellite.did.d.ts +1 -0
  33. package/dist/declarations/satellite/satellite.factory.did.js +1 -0
  34. package/dist/declarations/satellite/satellite.factory.did.mjs +1 -0
  35. package/dist/node/index.mjs +15 -15
  36. package/dist/node/index.mjs.map +4 -4
  37. package/dist/types/api/doc.api.d.ts +1 -1
  38. package/dist/types/api/storage.api.d.ts +3 -4
  39. package/dist/types/services/doc.services.d.ts +1 -1
  40. package/dist/types/services/storage.services.d.ts +3 -4
  41. package/package.json +3 -2
  42. package/declarations/frontend/frontend.did +0 -188
  43. package/declarations/frontend/frontend.did.d.ts +0 -172
  44. package/declarations/frontend/frontend.factory.did.js +0 -210
  45. package/declarations/frontend/index.d.ts +0 -45
  46. package/declarations/frontend/index.js +0 -32
  47. package/declarations/internet_identity/index.d.ts +0 -45
  48. package/declarations/internet_identity/index.js +0 -32
  49. package/declarations/internet_identity/internet_identity.did +0 -378
  50. package/declarations/internet_identity/internet_identity.did.d.ts +0 -231
  51. package/declarations/internet_identity/internet_identity.factory.did.js +0 -277
  52. package/declarations/ledger/index.d.ts +0 -45
  53. package/declarations/ledger/index.js +0 -32
  54. package/declarations/ledger/ledger.did +0 -266
  55. package/declarations/ledger/ledger.did.d.ts +0 -117
  56. package/declarations/ledger/ledger.factory.did.js +0 -115
  57. package/dist/declarations/frontend/frontend.did +0 -188
  58. package/dist/declarations/frontend/frontend.did.d.ts +0 -172
  59. package/dist/declarations/frontend/frontend.factory.did.js +0 -210
  60. package/dist/declarations/frontend/index.d.ts +0 -45
  61. package/dist/declarations/frontend/index.js +0 -32
  62. package/dist/declarations/internet_identity/index.d.ts +0 -45
  63. package/dist/declarations/internet_identity/index.js +0 -32
  64. package/dist/declarations/internet_identity/internet_identity.did +0 -378
  65. package/dist/declarations/internet_identity/internet_identity.did.d.ts +0 -231
  66. package/dist/declarations/internet_identity/internet_identity.factory.did.js +0 -277
  67. package/dist/declarations/ledger/index.d.ts +0 -45
  68. package/dist/declarations/ledger/index.js +0 -32
  69. package/dist/declarations/ledger/ledger.did +0 -266
  70. package/dist/declarations/ledger/ledger.did.d.ts +0 -117
  71. package/dist/declarations/ledger/ledger.factory.did.js +0 -115
  72. package/dist/types/utils/did.utils.d.ts +0 -4
  73. package/dist/types/utils/utils.d.ts +0 -7
@@ -10,7 +10,7 @@ export declare const setDoc: <D>({ collection, doc, satellite }: {
10
10
  doc: Doc<D>;
11
11
  satellite: Satellite;
12
12
  }) => Promise<Doc<D>>;
13
- export declare const delDoc: <D>({ collection, doc, satellite }: {
13
+ export declare const deleteDoc: <D>({ collection, doc, satellite }: {
14
14
  collection: string;
15
15
  doc: Doc<D>;
16
16
  satellite: Satellite;
@@ -1,7 +1,7 @@
1
1
  import type { AssetNoContent } from '../../declarations/satellite/satellite.did';
2
2
  import type { ListParams, ListResults } from '../types/list.types';
3
3
  import type { Satellite } from '../types/satellite.types';
4
- import type { Asset, Storage } from '../types/storage.types';
4
+ import type { AssetKey, Storage } from '../types/storage.types';
5
5
  export declare const uploadAsset: ({ data, filename, collection, headers, token, fullPath, encoding, description, satellite }: Required<Omit<Storage, "description" | "token" | "encoding">> & Pick<Storage, "description" | "token" | "encoding"> & {
6
6
  satellite: Satellite;
7
7
  }) => Promise<void>;
@@ -10,11 +10,10 @@ export declare const listAssets: ({ collection, satellite, filter }: {
10
10
  satellite: Satellite;
11
11
  filter: ListParams;
12
12
  }) => Promise<ListResults<AssetNoContent>>;
13
- export declare const deleteAsset: ({ collection, storageFile, satellite }: {
13
+ export declare const deleteAsset: ({ collection, fullPath, satellite }: {
14
14
  collection: string;
15
- storageFile: Asset;
16
15
  satellite: Satellite;
17
- }) => Promise<void>;
16
+ } & Pick<AssetKey, "fullPath">) => Promise<void>;
18
17
  export declare const deleteAssets: ({ collection, satellite }: {
19
18
  collection: string;
20
19
  satellite: Satellite;
@@ -10,7 +10,7 @@ export declare const setDoc: <D>({ satellite, ...rest }: {
10
10
  doc: Doc<D>;
11
11
  satellite?: Partial<import("../types/satellite.types").Satellite> | undefined;
12
12
  }) => Promise<Doc<D>>;
13
- export declare const delDoc: <D>({ satellite, ...rest }: {
13
+ export declare const deleteDoc: <D>({ satellite, ...rest }: {
14
14
  collection: string;
15
15
  doc: Doc<D>;
16
16
  satellite?: Partial<import("../types/satellite.types").Satellite> | undefined;
@@ -1,6 +1,6 @@
1
1
  import type { ListParams } from '../types/list.types';
2
2
  import type { SatelliteOptions } from '../types/satellite.types';
3
- import type { Asset, AssetKey, Assets, Storage } from '../types/storage.types';
3
+ import type { AssetKey, Assets, Storage } from '../types/storage.types';
4
4
  export declare const uploadBlob: (params: Storage & {
5
5
  satellite?: SatelliteOptions;
6
6
  }) => Promise<AssetKey>;
@@ -14,11 +14,10 @@ export declare const listAssets: ({ collection, satellite, filter }: {
14
14
  satellite?: Partial<import("../types/satellite.types").Satellite> | undefined;
15
15
  filter?: ListParams | undefined;
16
16
  }) => Promise<Assets>;
17
- export declare const deleteAsset: ({ storageFile, collection, satellite }: {
18
- storageFile: Asset;
17
+ export declare const deleteAsset: ({ collection, fullPath, satellite }: {
19
18
  collection: string;
20
19
  satellite?: Partial<import("../types/satellite.types").Satellite> | undefined;
21
- }) => Promise<void>;
20
+ } & Pick<AssetKey, "fullPath">) => Promise<void>;
22
21
  export declare const deleteAssets: ({ collection, satellite }: {
23
22
  collection: string;
24
23
  satellite?: Partial<import("../types/satellite.types").Satellite> | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@junobuild/core",
3
- "version": "0.0.20",
3
+ "version": "0.0.22",
4
4
  "description": "JavaScript core client for Juno",
5
5
  "author": "David Dal Busco (https://daviddalbusco.com)",
6
6
  "license": "MIT",
@@ -42,6 +42,7 @@
42
42
  "@dfinity/agent": "^0.15.6",
43
43
  "@dfinity/auth-client": "^0.15.6",
44
44
  "@dfinity/identity": "^0.15.6",
45
- "@dfinity/principal": "^0.15.6"
45
+ "@dfinity/principal": "^0.15.6",
46
+ "@junobuild/utils": "*"
46
47
  }
47
48
  }
@@ -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>;