@junobuild/core-standalone 2.2.1 → 3.0.1
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/browser/index.js +28 -28
- package/dist/browser/index.js.map +4 -4
- package/dist/node/index.mjs +31 -108
- package/dist/node/index.mjs.map +4 -4
- package/dist/types/auth/providers/_auth-client.providers.d.ts +3 -12
- package/dist/types/auth/providers/_auth.providers.d.ts +11 -0
- package/dist/types/auth/providers/google.providers.d.ts +25 -0
- package/dist/types/auth/providers/webauthn.providers.d.ts +1 -1
- package/dist/types/auth/services/_auth-client.services.d.ts +17 -0
- package/dist/types/auth/services/identity.services.d.ts +22 -0
- package/dist/types/auth/services/load.services.d.ts +13 -0
- package/dist/types/auth/services/redirect.services.d.ts +1 -0
- package/dist/types/auth/services/sign-in.services.d.ts +19 -0
- package/dist/types/auth/services/sign-out.services.d.ts +10 -0
- package/dist/types/auth/services/sign-up.services.d.ts +8 -0
- package/dist/types/auth/services/user-webauthn.services.d.ts +1 -1
- package/dist/types/auth/stores/auth-client.store.d.ts +15 -0
- package/dist/types/auth/types/auth.d.ts +11 -12
- package/dist/types/auth/types/errors.d.ts +2 -0
- package/dist/types/auth/types/google.d.ts +50 -0
- package/dist/types/auth/types/provider.d.ts +42 -12
- package/dist/types/core/api/actor.api.d.ts +2 -2
- package/dist/types/core/services/{identity.services.d.ts → any-identity.services.d.ts} +1 -1
- package/dist/types/core/stores/_agent.factory.d.ts +1 -1
- package/dist/types/core/stores/actor.store.d.ts +2 -2
- package/dist/types/core/stores/agent.store.d.ts +1 -1
- package/dist/types/core/types/list.d.ts +1 -1
- package/dist/types/core/types/satellite.d.ts +1 -1
- package/dist/types/core/types/utility.d.ts +5 -3
- package/dist/types/core/utils/window.env.utils.d.ts +1 -0
- package/dist/types/functions/services/functions.services.d.ts +2 -2
- package/dist/types/index.d.ts +5 -3
- package/dist/workers/auth.worker.js +6 -6
- package/dist/workers/auth.worker.js.map +4 -4
- package/package.json +15 -16
- package/dist/types/auth/providers/nfid.providers.d.ts +0 -28
- package/dist/types/auth/services/auth.services.d.ts +0 -60
- package/dist/types/auth/types/nfid.d.ts +0 -22
- package/dist/types/auth/utils/auth.utils.d.ts +0 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@junobuild/core-standalone",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "JavaScript core client for Juno with all dependencies bundled — no peer dependencies",
|
|
5
5
|
"author": "David Dal Busco (https://daviddalbusco.com)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -42,25 +42,24 @@
|
|
|
42
42
|
"url": "https://github.com/junobuild/juno-js"
|
|
43
43
|
},
|
|
44
44
|
"keywords": [
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
45
|
+
"serverless",
|
|
46
|
+
"serverless-functions",
|
|
47
|
+
"wasm",
|
|
48
|
+
"self-hosted",
|
|
49
|
+
"cloud",
|
|
50
|
+
"auth",
|
|
51
|
+
"storage",
|
|
52
|
+
"database",
|
|
53
|
+
"hosting"
|
|
52
54
|
],
|
|
53
55
|
"homepage": "https://juno.build",
|
|
54
56
|
"dependencies": {
|
|
55
|
-
"@dfinity/
|
|
56
|
-
"@
|
|
57
|
-
"@
|
|
58
|
-
"@dfinity/identity": "^3.2.6",
|
|
59
|
-
"@dfinity/principal": "^3.2.6",
|
|
60
|
-
"@dfinity/utils": "^3.1",
|
|
57
|
+
"@dfinity/utils": "^4",
|
|
58
|
+
"@icp-sdk/auth": "^4.2",
|
|
59
|
+
"@icp-sdk/core": "^4.2",
|
|
61
60
|
"@junobuild/errors": "*",
|
|
62
|
-
"@junobuild/ic-client": "^
|
|
63
|
-
"@junobuild/storage": "^
|
|
61
|
+
"@junobuild/ic-client": "^4",
|
|
62
|
+
"@junobuild/storage": "^2",
|
|
64
63
|
"@junobuild/utils": "*"
|
|
65
64
|
}
|
|
66
65
|
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { AuthClientSignInOptions } from '../types/auth-client';
|
|
2
|
-
import type { NFIDConfig } from '../types/nfid';
|
|
3
|
-
import type { Provider } from '../types/provider';
|
|
4
|
-
import { AuthClientProvider, type AuthProviderSignInOptions } from './_auth-client.providers';
|
|
5
|
-
/**
|
|
6
|
-
* NFID authentication provider.
|
|
7
|
-
* @class NFIDProvider
|
|
8
|
-
* @implements {AuthProvider}
|
|
9
|
-
*/
|
|
10
|
-
export declare class NFIDProvider extends AuthClientProvider {
|
|
11
|
-
#private;
|
|
12
|
-
/**
|
|
13
|
-
* Creates an instance of NFIDProvider.
|
|
14
|
-
* @param {NFIDConfig} config - The configuration for NFID.
|
|
15
|
-
*/
|
|
16
|
-
constructor({ appName, logoUrl }: NFIDConfig);
|
|
17
|
-
/**
|
|
18
|
-
* Gets the identifier of the provider.
|
|
19
|
-
* @returns {Provider} The identifier of the provider- nfid.
|
|
20
|
-
*/
|
|
21
|
-
get id(): Provider;
|
|
22
|
-
/**
|
|
23
|
-
* Gets the sign-in options for NFID.
|
|
24
|
-
* @param {Pick<SignInOptions, 'windowed'>} options - The sign-in options.
|
|
25
|
-
* @returns {AuthProviderSignInOptions} The sign-in options to effectively sign-in with NFID.
|
|
26
|
-
*/
|
|
27
|
-
signInOptions({ windowed }: Pick<AuthClientSignInOptions, 'windowed'>): AuthProviderSignInOptions;
|
|
28
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import type { Identity } from '@dfinity/agent';
|
|
2
|
-
import type { SignInOptions, SignOutOptions, SignUpOptions } from '../types/auth';
|
|
3
|
-
import type { Provider } from '../types/provider';
|
|
4
|
-
/**
|
|
5
|
-
* Initialize the authClient and load the existing user.
|
|
6
|
-
* Executed when the library is initialized through initSatellite.
|
|
7
|
-
*/
|
|
8
|
-
export declare const loadAuth: () => Promise<void>;
|
|
9
|
-
/**
|
|
10
|
-
* Initialize the authClient, load or create a new user.
|
|
11
|
-
* Executed on sign-in.
|
|
12
|
-
*/
|
|
13
|
-
export declare const createAuth: ({ provider }: {
|
|
14
|
-
provider: Provider;
|
|
15
|
-
}) => Promise<void>;
|
|
16
|
-
/**
|
|
17
|
-
* Signs in a user with the specified options.
|
|
18
|
-
*
|
|
19
|
-
* @default Signs in by default with Internet Identity
|
|
20
|
-
* @param {SignInOptions} [options] - The options for signing in including the provider to use for the process.
|
|
21
|
-
* @returns {Promise<void>} A promise that resolves when the sign-in process is complete and the authenticated user is initialized.
|
|
22
|
-
*/
|
|
23
|
-
export declare const signIn: (options: SignInOptions) => Promise<void>;
|
|
24
|
-
/**
|
|
25
|
-
* Signs up to create a new user with the specified options.
|
|
26
|
-
*
|
|
27
|
-
* @param {SignUpOptions} [options] - The options for signing up including the provider to use for the process.
|
|
28
|
-
* @returns {Promise<void>} A promise that resolves when the sign-up process is complete and the user is authenticated.
|
|
29
|
-
*/
|
|
30
|
-
export declare const signUp: (options: SignUpOptions) => Promise<void>;
|
|
31
|
-
/**
|
|
32
|
-
* Signs out the current user.
|
|
33
|
-
* @returns {Promise<void>} A promise that resolves when the sign-out process is complete.
|
|
34
|
-
*/
|
|
35
|
-
export declare const signOut: (options?: SignOutOptions) => Promise<void>;
|
|
36
|
-
/**
|
|
37
|
-
* ℹ️ Exposed for testing purpose only. Should not be leaked to consumer or used by the library.
|
|
38
|
-
*/
|
|
39
|
-
export declare const resetAuth: () => Promise<void>;
|
|
40
|
-
export declare const getIdentity: () => Identity | undefined;
|
|
41
|
-
/**
|
|
42
|
-
* Returns the identity of a signed-in user or an anonymous identity.
|
|
43
|
-
* This function is useful for loading an identity in web workers.
|
|
44
|
-
* Used to imperatively get the identity. Please be certain before using it.
|
|
45
|
-
* @returns {Promise<Identity>} A promise that resolves to the identity of the user or an anonymous identity.
|
|
46
|
-
*/
|
|
47
|
-
export declare const unsafeIdentity: () => Promise<Identity>;
|
|
48
|
-
/**
|
|
49
|
-
* Returns the current identity if the user is authenticated.
|
|
50
|
-
*
|
|
51
|
-
* ⚠️ Use this function imperatively only. Do **not** persist the identity in global state.
|
|
52
|
-
* It is intended for short-lived or one-time operations.
|
|
53
|
-
*
|
|
54
|
-
* Typical use case is to enable developers to implement custom features for the Internet Computer:
|
|
55
|
-
* - Passing the identity to temporarily create an actor or agent to call a canister
|
|
56
|
-
* - Signing a message or making a one-time authenticated call
|
|
57
|
-
*
|
|
58
|
-
* @returns The authenticated identity, or null if unavailable.
|
|
59
|
-
*/
|
|
60
|
-
export declare const getIdentityOnce: () => Promise<Identity | null>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { AuthClientSignInOptions } from './auth-client';
|
|
2
|
-
/**
|
|
3
|
-
* Interface representing the specific configuration for NFID.
|
|
4
|
-
* @interface NFIDConfig
|
|
5
|
-
*/
|
|
6
|
-
export interface NFIDConfig {
|
|
7
|
-
/**
|
|
8
|
-
* The name of the application.
|
|
9
|
-
* @type {string}
|
|
10
|
-
*/
|
|
11
|
-
appName: string;
|
|
12
|
-
/**
|
|
13
|
-
* The URL of the application's logo.
|
|
14
|
-
* @type {string}
|
|
15
|
-
*/
|
|
16
|
-
logoUrl: string;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Interface representing sign-in options when using the NFID provider.
|
|
20
|
-
* @interface NFIDSignInOptions
|
|
21
|
-
*/
|
|
22
|
-
export type NFIDSignInOptions = NFIDConfig & AuthClientSignInOptions;
|