@junobuild/core 0.0.9 → 0.0.10

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