@junobuild/core-peer 0.0.13 → 0.0.14
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/satellite/satellite.did.d.ts +17 -3
- package/declarations/satellite/satellite.factory.did.js +23 -6
- package/declarations/satellite/satellite.factory.did.mjs +23 -6
- package/dist/browser/index.js +1 -1
- package/dist/browser/index.js.map +3 -3
- package/dist/declarations/satellite/satellite.did.d.ts +17 -3
- package/dist/declarations/satellite/satellite.factory.did.js +23 -6
- package/dist/declarations/satellite/satellite.factory.did.mjs +23 -6
- package/dist/node/index.mjs +1 -1
- package/dist/node/index.mjs.map +3 -3
- package/dist/types/api/doc.api.d.ts +1 -1
- package/dist/types/api/storage.api.d.ts +3 -3
- package/dist/types/services/doc.services.d.ts +9 -9
- package/dist/types/services/storage.services.d.ts +9 -9
- package/dist/types/types/doc.types.d.ts +1 -0
- package/dist/types/utils/actor.utils.d.ts +1 -1
- package/dist/workers/auth.worker.js +17 -12
- package/dist/workers/auth.worker.js.map +4 -4
- package/package.json +5 -5
- package/declarations/satellite/index.d.ts +0 -45
- package/declarations/satellite/index.js +0 -37
- package/dist/declarations/satellite/index.d.ts +0 -45
- package/dist/declarations/satellite/index.js +0 -37
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@junobuild/core-peer",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"description": "JavaScript core client for Juno minus DFINITY agent-js dependencies",
|
|
5
5
|
"author": "David Dal Busco (https://daviddalbusco.com)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"@junobuild/utils": "*"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"@dfinity/agent": "^1.
|
|
61
|
-
"@dfinity/auth-client": "^1.
|
|
62
|
-
"@dfinity/identity": "^1.
|
|
63
|
-
"@dfinity/principal": "^1.
|
|
60
|
+
"@dfinity/agent": "^1.3.0",
|
|
61
|
+
"@dfinity/auth-client": "^1.3.0",
|
|
62
|
+
"@dfinity/identity": "^1.3.0",
|
|
63
|
+
"@dfinity/principal": "^1.3.0"
|
|
64
64
|
}
|
|
65
65
|
}
|
|
@@ -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 './satellite.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 satellite: ActorSubclass<_SERVICE>;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import {Actor, HttpAgent} from '@dfinity/agent';
|
|
2
|
-
|
|
3
|
-
// Imports and re-exports candid interface
|
|
4
|
-
import {idlFactory} from './satellite.did.js';
|
|
5
|
-
export {idlFactory} from './satellite.did.js';
|
|
6
|
-
|
|
7
|
-
/* CANISTER_ID is replaced by webpack based on node environment
|
|
8
|
-
* Note: canister environment variable will be standardized as
|
|
9
|
-
* process.env.CANISTER_ID_<CANISTER_NAME_UPPERCASE>
|
|
10
|
-
* beginning in dfx 0.15.0
|
|
11
|
-
*/
|
|
12
|
-
export const canisterId = process.env.CANISTER_ID_SATELLITE || process.env.SATELLITE_CANISTER_ID;
|
|
13
|
-
|
|
14
|
-
export const createActor = (canisterId, options = {}) => {
|
|
15
|
-
const agent = options.agent || new HttpAgent({...options.agentOptions});
|
|
16
|
-
|
|
17
|
-
if (options.agent && options.agentOptions) {
|
|
18
|
-
console.warn(
|
|
19
|
-
'Detected both agent and agentOptions passed to createActor. Ignoring agentOptions and proceeding with the provided agent.'
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// Fetch root key for certificate validation during development
|
|
24
|
-
if (process.env.DFX_NETWORK !== 'ic') {
|
|
25
|
-
agent.fetchRootKey().catch((err) => {
|
|
26
|
-
console.warn('Unable to fetch root key. Check to ensure that your local replica is running');
|
|
27
|
-
console.error(err);
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// Creates an actor with using the candid interface and the HttpAgent
|
|
32
|
-
return Actor.createActor(idlFactory, {
|
|
33
|
-
agent,
|
|
34
|
-
canisterId,
|
|
35
|
-
...options.actorOptions
|
|
36
|
-
});
|
|
37
|
-
};
|
|
@@ -1,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 './satellite.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 satellite: ActorSubclass<_SERVICE>;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import {Actor, HttpAgent} from '@dfinity/agent';
|
|
2
|
-
|
|
3
|
-
// Imports and re-exports candid interface
|
|
4
|
-
import {idlFactory} from './satellite.did.js';
|
|
5
|
-
export {idlFactory} from './satellite.did.js';
|
|
6
|
-
|
|
7
|
-
/* CANISTER_ID is replaced by webpack based on node environment
|
|
8
|
-
* Note: canister environment variable will be standardized as
|
|
9
|
-
* process.env.CANISTER_ID_<CANISTER_NAME_UPPERCASE>
|
|
10
|
-
* beginning in dfx 0.15.0
|
|
11
|
-
*/
|
|
12
|
-
export const canisterId = process.env.CANISTER_ID_SATELLITE || process.env.SATELLITE_CANISTER_ID;
|
|
13
|
-
|
|
14
|
-
export const createActor = (canisterId, options = {}) => {
|
|
15
|
-
const agent = options.agent || new HttpAgent({...options.agentOptions});
|
|
16
|
-
|
|
17
|
-
if (options.agent && options.agentOptions) {
|
|
18
|
-
console.warn(
|
|
19
|
-
'Detected both agent and agentOptions passed to createActor. Ignoring agentOptions and proceeding with the provided agent.'
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// Fetch root key for certificate validation during development
|
|
24
|
-
if (process.env.DFX_NETWORK !== 'ic') {
|
|
25
|
-
agent.fetchRootKey().catch((err) => {
|
|
26
|
-
console.warn('Unable to fetch root key. Check to ensure that your local replica is running');
|
|
27
|
-
console.error(err);
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// Creates an actor with using the candid interface and the HttpAgent
|
|
32
|
-
return Actor.createActor(idlFactory, {
|
|
33
|
-
agent,
|
|
34
|
-
canisterId,
|
|
35
|
-
...options.actorOptions
|
|
36
|
-
});
|
|
37
|
-
};
|