@dynamic-labs/client 3.0.0-alpha.32 → 3.0.0-alpha.33

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/CHANGELOG.md CHANGED
@@ -1,4 +1,11 @@
1
1
 
2
+ ## [3.0.0-alpha.33](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.32...v3.0.0-alpha.33) (2024-08-02)
3
+
4
+
5
+ ### Features
6
+
7
+ * add async handler for mfa enrollment and completion ([#6481](https://github.com/dynamic-labs/DynamicAuth/issues/6481)) ([63ce10d](https://github.com/dynamic-labs/DynamicAuth/commit/63ce10dd9f9aa58f43411455d6bbeb2f440ddcac))
8
+
2
9
  ## [3.0.0-alpha.32](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.31...v3.0.0-alpha.32) (2024-07-30)
3
10
 
4
11
 
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "3.0.0-alpha.32";
6
+ var version = "3.0.0-alpha.33";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "3.0.0-alpha.32";
2
+ var version = "3.0.0-alpha.33";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/client",
3
- "version": "3.0.0-alpha.32",
3
+ "version": "3.0.0-alpha.33",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
@@ -26,12 +26,12 @@
26
26
  "./package.json": "./package.json"
27
27
  },
28
28
  "dependencies": {
29
- "@dynamic-labs/message-transport": "3.0.0-alpha.32",
29
+ "@dynamic-labs/message-transport": "3.0.0-alpha.33",
30
30
  "@vue/reactivity": "3.4.21"
31
31
  },
32
32
  "peerDependencies": {
33
- "@dynamic-labs/logger": "3.0.0-alpha.32",
34
- "@dynamic-labs/types": "3.0.0-alpha.32",
33
+ "@dynamic-labs/logger": "3.0.0-alpha.33",
34
+ "@dynamic-labs/types": "3.0.0-alpha.33",
35
35
  "eventemitter3": "5.0.1"
36
36
  }
37
37
  }
@@ -23,14 +23,7 @@ export declare const createClient: (props: ClientProps) => {
23
23
  /** Module that gives insight over the state of the SDK */
24
24
  sdk: import("../modules/sdkModule").SdkModule;
25
25
  /** Module that provide access to UI features */
26
- ui: {
27
- auth: {
28
- show: () => void;
29
- };
30
- userProfile: {
31
- show: () => void;
32
- };
33
- };
26
+ ui: import("../modules/userInterfaceModule/userInterfaceModule").UserInterfaceModule;
34
27
  /** Module that provides access to user's wallets */
35
28
  wallets: import("../modules/walletsModule").WalletsModule;
36
29
  } & Extendable;
@@ -6,7 +6,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
6
6
  var messageTransport = require('@dynamic-labs/message-transport');
7
7
  var pickListenerActions = require('../../utils/pickListenerActions/pickListenerActions.cjs');
8
8
  var emailAuthModule = require('./emailAuthModule/emailAuthModule.cjs');
9
- var externalAuthMethod = require('./externalAuthMethod/externalAuthMethod.cjs');
9
+ var externalAuthModule = require('./externalAuthModule/externalAuthModule.cjs');
10
10
  var smsAuthModule = require('./smsAuthModule/smsAuthModule.cjs');
11
11
  var socialAuthModule = require('./socialAuthModule/socialAuthModule.cjs');
12
12
 
@@ -27,8 +27,8 @@ const createAuthModule = (core) => {
27
27
  const requestChannel = messageTransport.createRequestChannel(core.messageTransport);
28
28
  return Object.assign(store.getters, pickListenerActions.pickListenerActions(messageEvents), {
29
29
  email: emailAuthModule.createEmailAuthModule(core),
30
+ external: externalAuthModule.createExternalAuthModule(core),
30
31
  logout: () => requestChannel.request('logout'),
31
- signInWithExternalJwt: externalAuthMethod.createExternalAuthMethod(core),
32
32
  sms: smsAuthModule.createSmsAuthModule(core),
33
33
  social: socialAuthModule.createSocialAuthModule(core),
34
34
  });
@@ -1,7 +1,7 @@
1
1
  import { AuthModuleMessages, AuthModuleState, StoreEventListeners } from '@dynamic-labs/message-transport';
2
2
  import { Core } from '../../client/core';
3
3
  import { EmailAuthModule } from './emailAuthModule';
4
- import { ExternalAuthMethod } from './externalAuthMethod';
4
+ import { ExternalAuthModule } from './externalAuthModule';
5
5
  import { SmsAuthModule } from './smsAuthModule';
6
6
  import { SocialAuthModule } from './socialAuthModule';
7
7
  type PublicAuthModuleMessages = Pick<AuthModuleMessages, 'logout'>;
@@ -9,7 +9,7 @@ export type AuthModule = AuthModuleState & StoreEventListeners<AuthModuleState>
9
9
  sms: SmsAuthModule;
10
10
  email: EmailAuthModule;
11
11
  social: SocialAuthModule;
12
- signInWithExternalJwt: ExternalAuthMethod;
12
+ external: ExternalAuthModule;
13
13
  };
14
14
  export declare const createAuthModule: (core: Core) => AuthModule;
15
15
  export {};
@@ -2,7 +2,7 @@
2
2
  import { createStore, createEventEmitterForMessages, createRequestChannel } from '@dynamic-labs/message-transport';
3
3
  import { pickListenerActions } from '../../utils/pickListenerActions/pickListenerActions.js';
4
4
  import { createEmailAuthModule } from './emailAuthModule/emailAuthModule.js';
5
- import { createExternalAuthMethod } from './externalAuthMethod/externalAuthMethod.js';
5
+ import { createExternalAuthModule } from './externalAuthModule/externalAuthModule.js';
6
6
  import { createSmsAuthModule } from './smsAuthModule/smsAuthModule.js';
7
7
  import { createSocialAuthModule } from './socialAuthModule/socialAuthModule.js';
8
8
 
@@ -23,8 +23,8 @@ const createAuthModule = (core) => {
23
23
  const requestChannel = createRequestChannel(core.messageTransport);
24
24
  return Object.assign(store.getters, pickListenerActions(messageEvents), {
25
25
  email: createEmailAuthModule(core),
26
+ external: createExternalAuthModule(core),
26
27
  logout: () => requestChannel.request('logout'),
27
- signInWithExternalJwt: createExternalAuthMethod(core),
28
28
  sms: createSmsAuthModule(core),
29
29
  social: createSocialAuthModule(core),
30
30
  });
@@ -0,0 +1,16 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var messageTransport = require('@dynamic-labs/message-transport');
7
+
8
+ const createExternalAuthModule = (core) => {
9
+ const requestChannel = messageTransport.createRequestChannel(core.messageTransport);
10
+ return {
11
+ signInWithExternalJwt: (props) => requestChannel.request('signInWithExternalJwt', props),
12
+ verifyWithExternalJwt: (props) => requestChannel.request('verifyWithExternalJwt', props),
13
+ };
14
+ };
15
+
16
+ exports.createExternalAuthModule = createExternalAuthModule;
@@ -0,0 +1,7 @@
1
+ import { ExternalAuthMessages } from '@dynamic-labs/message-transport';
2
+ import { Core } from '../../../client/core';
3
+ export type ExternalAuthModule = {
4
+ signInWithExternalJwt: ExternalAuthMessages['signInWithExternalJwt'];
5
+ verifyWithExternalJwt: ExternalAuthMessages['verifyWithExternalJwt'];
6
+ };
7
+ export declare const createExternalAuthModule: (core: Core) => ExternalAuthModule;
@@ -0,0 +1,12 @@
1
+ 'use client'
2
+ import { createRequestChannel } from '@dynamic-labs/message-transport';
3
+
4
+ const createExternalAuthModule = (core) => {
5
+ const requestChannel = createRequestChannel(core.messageTransport);
6
+ return {
7
+ signInWithExternalJwt: (props) => requestChannel.request('signInWithExternalJwt', props),
8
+ verifyWithExternalJwt: (props) => requestChannel.request('verifyWithExternalJwt', props),
9
+ };
10
+ };
11
+
12
+ export { createExternalAuthModule };
@@ -0,0 +1 @@
1
+ export * from './externalAuthModule';
@@ -14,6 +14,9 @@ const createUserInterfaceModule = (core) => {
14
14
  userProfile: {
15
15
  show: () => userInterfaceRequestChannel.emit('openUserProfile'),
16
16
  },
17
+ wallets: {
18
+ revealEmbeddedWalletKey: () => userInterfaceRequestChannel.emit('revealEmbeddedWalletKey'),
19
+ },
17
20
  };
18
21
  };
19
22
 
@@ -1,9 +1,13 @@
1
1
  import { Core } from '../../client/core';
2
- export declare const createUserInterfaceModule: (core: Core) => {
2
+ export type UserInterfaceModule = {
3
3
  auth: {
4
- show: () => void;
4
+ show: VoidFunction;
5
5
  };
6
6
  userProfile: {
7
- show: () => void;
7
+ show: VoidFunction;
8
+ };
9
+ wallets: {
10
+ revealEmbeddedWalletKey: VoidFunction;
8
11
  };
9
12
  };
13
+ export declare const createUserInterfaceModule: (core: Core) => UserInterfaceModule;
@@ -10,6 +10,9 @@ const createUserInterfaceModule = (core) => {
10
10
  userProfile: {
11
11
  show: () => userInterfaceRequestChannel.emit('openUserProfile'),
12
12
  },
13
+ wallets: {
14
+ revealEmbeddedWalletKey: () => userInterfaceRequestChannel.emit('revealEmbeddedWalletKey'),
15
+ },
13
16
  };
14
17
  };
15
18
 
@@ -18,10 +18,12 @@ const createWalletsModule = (core) => {
18
18
  const getBalance = (params) => requestChannel.request('getBalance', params);
19
19
  const switchNetwork = (params) => requestChannel.request('switchNetwork', params);
20
20
  const getNetwork = (params) => requestChannel.request('getNetwork', params);
21
+ const setPrimary = (params) => requestChannel.request('setPrimary', params);
21
22
  return Object.assign(store.getters, pickListenerActions.pickListenerActions(store.eventEmitter), {
22
23
  embedded: embeddedWalletsModule.createEmbeddedWalletsModule(core),
23
24
  getBalance,
24
25
  getNetwork,
26
+ setPrimary,
25
27
  signMessage,
26
28
  switchNetwork,
27
29
  });
@@ -7,5 +7,6 @@ export type WalletsModule = WalletsModuleState & {
7
7
  switchNetwork: WalletsModuleMessages['switchNetwork'];
8
8
  getBalance: WalletsModuleMessages['getBalance'];
9
9
  getNetwork: WalletsModuleMessages['getNetwork'];
10
+ setPrimary: WalletsModuleMessages['setPrimary'];
10
11
  } & StoreEventListeners<WalletsModuleState>;
11
12
  export declare const createWalletsModule: (core: Core) => WalletsModule;
@@ -14,10 +14,12 @@ const createWalletsModule = (core) => {
14
14
  const getBalance = (params) => requestChannel.request('getBalance', params);
15
15
  const switchNetwork = (params) => requestChannel.request('switchNetwork', params);
16
16
  const getNetwork = (params) => requestChannel.request('getNetwork', params);
17
+ const setPrimary = (params) => requestChannel.request('setPrimary', params);
17
18
  return Object.assign(store.getters, pickListenerActions(store.eventEmitter), {
18
19
  embedded: createEmbeddedWalletsModule(core),
19
20
  getBalance,
20
21
  getNetwork,
22
+ setPrimary,
21
23
  signMessage,
22
24
  switchNetwork,
23
25
  });
@@ -1,15 +0,0 @@
1
- 'use client'
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, '__esModule', { value: true });
5
-
6
- var messageTransport = require('@dynamic-labs/message-transport');
7
-
8
- // Since we only have a single method for this right now this file is for the method
9
- // But if we ever add more external auth methods, this should become "createExternalAuthModule"
10
- const createExternalAuthMethod = (core) => {
11
- const requestChannel = messageTransport.createRequestChannel(core.messageTransport);
12
- return (props) => requestChannel.request('signInWithExternalJwt', props);
13
- };
14
-
15
- exports.createExternalAuthMethod = createExternalAuthMethod;
@@ -1,4 +0,0 @@
1
- import { ExternalAuthMessages } from '@dynamic-labs/message-transport';
2
- import { Core } from '../../../client/core';
3
- export type ExternalAuthMethod = ExternalAuthMessages['signInWithExternalJwt'];
4
- export declare const createExternalAuthMethod: (core: Core) => ExternalAuthMethod;
@@ -1,11 +0,0 @@
1
- 'use client'
2
- import { createRequestChannel } from '@dynamic-labs/message-transport';
3
-
4
- // Since we only have a single method for this right now this file is for the method
5
- // But if we ever add more external auth methods, this should become "createExternalAuthModule"
6
- const createExternalAuthMethod = (core) => {
7
- const requestChannel = createRequestChannel(core.messageTransport);
8
- return (props) => requestChannel.request('signInWithExternalJwt', props);
9
- };
10
-
11
- export { createExternalAuthMethod };
@@ -1 +0,0 @@
1
- export * from './externalAuthMethod';