@dynamic-labs/client 4.0.0-alpha.14 → 4.0.0-alpha.16
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 +13 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +5 -5
- package/src/client/core/core.cjs +42 -40
- package/src/client/core/core.d.ts +1 -1
- package/src/client/core/core.js +41 -39
- package/src/client/core/modules/manifestModule/validateManifest/validateManifest.cjs +2 -2
- package/src/client/core/modules/manifestModule/validateManifest/validateManifest.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.0.0-alpha.16](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.15...v4.0.0-alpha.16) (2024-10-27)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add passkey to web-extension ([#7096](https://github.com/dynamic-labs/dynamic-auth/issues/7096)) ([a4b4643](https://github.com/dynamic-labs/dynamic-auth/commit/a4b4643e5307358425c878067bae095090f322ca))
|
|
8
|
+
* add social to web extension ([#7106](https://github.com/dynamic-labs/dynamic-auth/issues/7106)) ([422bc8e](https://github.com/dynamic-labs/dynamic-auth/commit/422bc8e2d276d960a7a76ad55a7b244c3fd83173))
|
|
9
|
+
* add support for compass and leap wallets ([9738749](https://github.com/dynamic-labs/dynamic-auth/commit/9738749bb5ed8e07a2582df255f683e4d408db93))
|
|
10
|
+
* add support for epicgames social ([#7220](https://github.com/dynamic-labs/dynamic-auth/issues/7220)) ([cb5bc30](https://github.com/dynamic-labs/dynamic-auth/commit/cb5bc30bc17d063bdaa9b427a9358b30124c4589))
|
|
11
|
+
* add web-extension to client ([#7180](https://github.com/dynamic-labs/dynamic-auth/issues/7180)) ([e2ccbb7](https://github.com/dynamic-labs/dynamic-auth/commit/e2ccbb77bdd0250d000a6cc4d89a2e5d7d2f4bb2))
|
|
12
|
+
|
|
13
|
+
## [4.0.0-alpha.15](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.14...v4.0.0-alpha.15) (2024-10-19)
|
|
14
|
+
|
|
2
15
|
## [4.0.0-alpha.14](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.13...v4.0.0-alpha.14) (2024-10-18)
|
|
3
16
|
|
|
4
17
|
## [4.0.0-alpha.13](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.12...v4.0.0-alpha.13) (2024-10-18)
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/client",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.16",
|
|
4
4
|
"description": "Core package for utilizing Dynamic's sdk",
|
|
5
5
|
"author": "Dynamic Labs, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"homepage": "https://www.dynamic.xyz/",
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@vue/reactivity": "3.4.21",
|
|
22
|
-
"@dynamic-labs/assert-package-version": "4.0.0-alpha.
|
|
23
|
-
"@dynamic-labs/logger": "4.0.0-alpha.
|
|
24
|
-
"@dynamic-labs/message-transport": "4.0.0-alpha.
|
|
25
|
-
"@dynamic-labs/types": "4.0.0-alpha.
|
|
22
|
+
"@dynamic-labs/assert-package-version": "4.0.0-alpha.16",
|
|
23
|
+
"@dynamic-labs/logger": "4.0.0-alpha.16",
|
|
24
|
+
"@dynamic-labs/message-transport": "4.0.0-alpha.16",
|
|
25
|
+
"@dynamic-labs/types": "4.0.0-alpha.16",
|
|
26
26
|
"eventemitter3": "5.0.1"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {}
|
package/src/client/core/core.cjs
CHANGED
|
@@ -3,48 +3,50 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var messageTransport
|
|
6
|
+
var messageTransport = require('@dynamic-labs/message-transport');
|
|
7
7
|
var initializationModule = require('./modules/initializationModule/initializationModule.cjs');
|
|
8
8
|
var manifestModule = require('./modules/manifestModule/manifestModule.cjs');
|
|
9
9
|
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
// )
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
10
|
+
const createCore = (props) => {
|
|
11
|
+
const messageTransport$1 = messageTransport.applyDefaultMessageOrigin({
|
|
12
|
+
defaultOrigin: 'host',
|
|
13
|
+
messageTransport: messageTransport.makeWaitForInitEvent({
|
|
14
|
+
bypassBlockIf: (message) => message.origin === 'webview',
|
|
15
|
+
initializeMessageType: messageTransport.sdkHasLoadedEventName,
|
|
16
|
+
messageTransport: messageTransport.createMessageTransport(),
|
|
17
|
+
}),
|
|
18
|
+
});
|
|
19
|
+
// Uncomment this to easily debug incoming/outgoing messages to webview
|
|
20
|
+
// messageTransport.on((message) =>
|
|
21
|
+
// console.log('message', JSON.stringify(message, null, 2)),
|
|
22
|
+
// );
|
|
23
|
+
const initialization = initializationModule.createInitializationModule(messageTransport$1);
|
|
24
|
+
return {
|
|
25
|
+
/**
|
|
26
|
+
* Allows an extension to add its name to the list, such that
|
|
27
|
+
* other extensions are able to detect if it is present.
|
|
28
|
+
*
|
|
29
|
+
* Ex: ViemExtension adds "viem" to the list, and WagmiExtension later
|
|
30
|
+
* checks this list and throws an error if it doesn't find "viem" there.
|
|
31
|
+
*/
|
|
32
|
+
declaredExtensionNames: [],
|
|
33
|
+
/**
|
|
34
|
+
* SDK initialization module handles the initialization error
|
|
35
|
+
*/
|
|
36
|
+
initialization,
|
|
37
|
+
/**
|
|
38
|
+
* Manages the manifest of the host
|
|
39
|
+
*/
|
|
40
|
+
manifest: manifestModule.createManifestModule(props, messageTransport$1, initialization),
|
|
41
|
+
/**
|
|
42
|
+
* Message transport that will be used to send and receive messages to the webview.
|
|
43
|
+
* Should preferably be used with createRequestChannel, rather than used directly.
|
|
44
|
+
*
|
|
45
|
+
* Note: Doesn't implement forwarding messages to/from webview yet.
|
|
46
|
+
* The user is expected to extend the client with an Extension that implements that.
|
|
47
|
+
*/
|
|
48
|
+
messageTransport: messageTransport$1,
|
|
49
|
+
};
|
|
50
|
+
};
|
|
49
51
|
|
|
50
52
|
exports.createCore = createCore;
|
|
@@ -37,7 +37,7 @@ export declare const createCore: (props: ClientProps) => {
|
|
|
37
37
|
onEmit?: VoidFunction | undefined;
|
|
38
38
|
} | undefined) => void;
|
|
39
39
|
unblock: () => void;
|
|
40
|
-
isBlocked: boolean;
|
|
40
|
+
isBlocked: () => boolean;
|
|
41
41
|
} & {
|
|
42
42
|
defaultOrigin: "webview" | "host";
|
|
43
43
|
emit: (message: import("@dynamic-labs/message-transport").MessageTransportDataOptionalOrigin) => void;
|
package/src/client/core/core.js
CHANGED
|
@@ -3,44 +3,46 @@ import { applyDefaultMessageOrigin, makeWaitForInitEvent, sdkHasLoadedEventName,
|
|
|
3
3
|
import { createInitializationModule } from './modules/initializationModule/initializationModule.js';
|
|
4
4
|
import { createManifestModule } from './modules/manifestModule/manifestModule.js';
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
// )
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
6
|
+
const createCore = (props) => {
|
|
7
|
+
const messageTransport = applyDefaultMessageOrigin({
|
|
8
|
+
defaultOrigin: 'host',
|
|
9
|
+
messageTransport: makeWaitForInitEvent({
|
|
10
|
+
bypassBlockIf: (message) => message.origin === 'webview',
|
|
11
|
+
initializeMessageType: sdkHasLoadedEventName,
|
|
12
|
+
messageTransport: createMessageTransport(),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
// Uncomment this to easily debug incoming/outgoing messages to webview
|
|
16
|
+
// messageTransport.on((message) =>
|
|
17
|
+
// console.log('message', JSON.stringify(message, null, 2)),
|
|
18
|
+
// );
|
|
19
|
+
const initialization = createInitializationModule(messageTransport);
|
|
20
|
+
return {
|
|
21
|
+
/**
|
|
22
|
+
* Allows an extension to add its name to the list, such that
|
|
23
|
+
* other extensions are able to detect if it is present.
|
|
24
|
+
*
|
|
25
|
+
* Ex: ViemExtension adds "viem" to the list, and WagmiExtension later
|
|
26
|
+
* checks this list and throws an error if it doesn't find "viem" there.
|
|
27
|
+
*/
|
|
28
|
+
declaredExtensionNames: [],
|
|
29
|
+
/**
|
|
30
|
+
* SDK initialization module handles the initialization error
|
|
31
|
+
*/
|
|
32
|
+
initialization,
|
|
33
|
+
/**
|
|
34
|
+
* Manages the manifest of the host
|
|
35
|
+
*/
|
|
36
|
+
manifest: createManifestModule(props, messageTransport, initialization),
|
|
37
|
+
/**
|
|
38
|
+
* Message transport that will be used to send and receive messages to the webview.
|
|
39
|
+
* Should preferably be used with createRequestChannel, rather than used directly.
|
|
40
|
+
*
|
|
41
|
+
* Note: Doesn't implement forwarding messages to/from webview yet.
|
|
42
|
+
* The user is expected to extend the client with an Extension that implements that.
|
|
43
|
+
*/
|
|
44
|
+
messageTransport,
|
|
45
|
+
};
|
|
46
|
+
};
|
|
45
47
|
|
|
46
48
|
export { createCore };
|
|
@@ -10,8 +10,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
10
10
|
const mandatoryFields = {
|
|
11
11
|
clientVersion: "We were unable to retrieve the Dynamic Client's version from your app. Please contact us about this.",
|
|
12
12
|
environmentId: 'You must provide an environment id to the Dynamic Client.',
|
|
13
|
-
platform: 'Missing platform specific extension, like
|
|
14
|
-
redirectUrl: 'Missing platform specific extension, like
|
|
13
|
+
platform: 'Missing platform specific extension, like WebExtension or ReactNativeExtension. See how to setup Dynamic Client in our docs for help.',
|
|
14
|
+
redirectUrl: 'Missing platform specific extension, like WebExtension or ReactNativeExtension. See how to setup Dynamic Client in our docs for help.',
|
|
15
15
|
};
|
|
16
16
|
const validateManifest = (partialManifest) => {
|
|
17
17
|
/**
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
const mandatoryFields = {
|
|
7
7
|
clientVersion: "We were unable to retrieve the Dynamic Client's version from your app. Please contact us about this.",
|
|
8
8
|
environmentId: 'You must provide an environment id to the Dynamic Client.',
|
|
9
|
-
platform: 'Missing platform specific extension, like
|
|
10
|
-
redirectUrl: 'Missing platform specific extension, like
|
|
9
|
+
platform: 'Missing platform specific extension, like WebExtension or ReactNativeExtension. See how to setup Dynamic Client in our docs for help.',
|
|
10
|
+
redirectUrl: 'Missing platform specific extension, like WebExtension or ReactNativeExtension. See how to setup Dynamic Client in our docs for help.',
|
|
11
11
|
};
|
|
12
12
|
const validateManifest = (partialManifest) => {
|
|
13
13
|
/**
|