@dynamic-labs-sdk/client 0.25.2 → 0.26.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/{InvalidParamError-BxdCGMzn.esm.js → InvalidParamError-B55FwITx.esm.js} +76 -74
- package/dist/InvalidParamError-B55FwITx.esm.js.map +1 -0
- package/dist/{InvalidParamError-C5CPZiAb.native.esm.js → InvalidParamError-ByTZyQwv.native.esm.js} +76 -74
- package/dist/InvalidParamError-ByTZyQwv.native.esm.js.map +1 -0
- package/dist/{InvalidParamError-Dg0Tc6h7.cjs.js → InvalidParamError-D-SHhcTB.cjs} +76 -74
- package/dist/InvalidParamError-D-SHhcTB.cjs.map +1 -0
- package/dist/{NotWaasWalletAccountError-C3DRuoiZ.native.esm.js → NotWaasWalletAccountError-CeMjVe2F.native.esm.js} +3 -3
- package/dist/{NotWaasWalletAccountError-C3DRuoiZ.native.esm.js.map → NotWaasWalletAccountError-CeMjVe2F.native.esm.js.map} +1 -1
- package/dist/{NotWaasWalletAccountError-w4J6uXP2.cjs.js → NotWaasWalletAccountError-EPhK7TaK.cjs} +3 -3
- package/dist/NotWaasWalletAccountError-EPhK7TaK.cjs.map +1 -0
- package/dist/{NotWaasWalletAccountError-DjVbgGrH.esm.js → NotWaasWalletAccountError-_H23Gu_v.esm.js} +3 -3
- package/dist/{NotWaasWalletAccountError-DjVbgGrH.esm.js.map → NotWaasWalletAccountError-_H23Gu_v.esm.js.map} +1 -1
- package/dist/client/core/createCore/createCore.d.ts.map +1 -1
- package/dist/{core.cjs.js → core.cjs} +6 -6
- package/dist/core.cjs.map +1 -0
- package/dist/core.esm.js +5 -5
- package/dist/core.native.esm.js +5 -19
- package/dist/core.native.esm.js.map +1 -1
- package/dist/exports/index.d.ts +6 -0
- package/dist/exports/index.d.ts.map +1 -1
- package/dist/{getNetworkProviderFromNetworkId-DnfmH9wZ.native.esm.js → getNetworkProviderFromNetworkId-BVhQ3-C5.native.esm.js} +46 -31
- package/dist/getNetworkProviderFromNetworkId-BVhQ3-C5.native.esm.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-DRAq7tIx.cjs.js → getNetworkProviderFromNetworkId-CY555AiJ.cjs} +5 -4
- package/dist/getNetworkProviderFromNetworkId-CY555AiJ.cjs.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-BzJ_kChE.esm.js → getNetworkProviderFromNetworkId-DWSOEnSr.esm.js} +5 -4
- package/dist/getNetworkProviderFromNetworkId-DWSOEnSr.esm.js.map +1 -0
- package/dist/{getSignedSessionId-CDCWfHxY.cjs.js → getSignedSessionId-CWNj8rZW.cjs} +3 -3
- package/dist/getSignedSessionId-CWNj8rZW.cjs.map +1 -0
- package/dist/{getSignedSessionId-CZnVdASR.native.esm.js → getSignedSessionId-GTJp6UnP.native.esm.js} +3 -3
- package/dist/{getSignedSessionId-CZnVdASR.native.esm.js.map → getSignedSessionId-GTJp6UnP.native.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-DerECbsD.esm.js → getSignedSessionId-GVIy9gR0.esm.js} +3 -3
- package/dist/{getSignedSessionId-DerECbsD.esm.js.map → getSignedSessionId-GVIy9gR0.esm.js.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-Bznazz-w.cjs.js → getVerifiedCredentialForWalletAccount-BqaTVz4z.cjs} +33 -3
- package/dist/getVerifiedCredentialForWalletAccount-BqaTVz4z.cjs.map +1 -0
- package/dist/{getVerifiedCredentialForWalletAccount-C2LbBPET.esm.js → getVerifiedCredentialForWalletAccount-Bx9dMVjF.esm.js} +27 -3
- package/dist/getVerifiedCredentialForWalletAccount-Bx9dMVjF.esm.js.map +1 -0
- package/dist/{getVerifiedCredentialForWalletAccount-B18TOqzI.native.esm.js → getVerifiedCredentialForWalletAccount-KmSG5wRc.native.esm.js} +27 -3
- package/dist/getVerifiedCredentialForWalletAccount-KmSG5wRc.native.esm.js.map +1 -0
- package/dist/{index.cjs.js → index.cjs} +130 -70
- package/dist/index.cjs.map +1 -0
- package/dist/index.esm.js +125 -68
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.esm.js +176 -250
- package/dist/index.native.esm.js.map +1 -1
- package/dist/{isMfaRequiredForAction-HwI5Mu8R.native.esm.js → isMfaRequiredForAction-BS0JYBvl.native.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-HwI5Mu8R.native.esm.js.map → isMfaRequiredForAction-BS0JYBvl.native.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-BulokP-s.esm.js → isMfaRequiredForAction-DVA7aeXI.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-BulokP-s.esm.js.map → isMfaRequiredForAction-DVA7aeXI.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-DG4IaOFU.cjs.js → isMfaRequiredForAction-V3A2BO7c.cjs} +2 -2
- package/dist/isMfaRequiredForAction-V3A2BO7c.cjs.map +1 -0
- package/dist/modules/apiClient/createApiClient.d.ts +1 -1
- package/dist/modules/apiClient/createApiClient.d.ts.map +1 -1
- package/dist/modules/auth/passkeys/signInWithPasskey/signInWithPasskey.d.ts +1 -1
- package/dist/modules/auth/social/oauth/authenticateWithSocial/authenticateWithSocial.d.ts +4 -12
- package/dist/modules/auth/social/oauth/authenticateWithSocial/authenticateWithSocial.d.ts.map +1 -1
- package/dist/modules/auth/social/oauth/completeSocialAuthentication/completeSocialAuthentication.d.ts +4 -12
- package/dist/modules/auth/social/oauth/completeSocialAuthentication/completeSocialAuthentication.d.ts.map +1 -1
- package/dist/modules/auth/social/oauth/completeSocialRedirect/completeSocialRedirect.d.ts +20 -0
- package/dist/modules/auth/social/oauth/completeSocialRedirect/completeSocialRedirect.d.ts.map +1 -0
- package/dist/modules/auth/social/oauth/completeSocialRedirect/completeSocialRedirect.types.d.ts +6 -0
- package/dist/modules/auth/social/oauth/completeSocialRedirect/completeSocialRedirect.types.d.ts.map +1 -0
- package/dist/modules/auth/social/oauth/completeSocialRedirect/index.d.ts +2 -0
- package/dist/modules/auth/social/oauth/completeSocialRedirect/index.d.ts.map +1 -0
- package/dist/modules/auth/social/oauth/detectOAuthRedirect/detectOAuthRedirect.d.ts +4 -9
- package/dist/modules/auth/social/oauth/detectOAuthRedirect/detectOAuthRedirect.d.ts.map +1 -1
- package/dist/modules/auth/social/oauth/detectSocialRedirectUrl/detectSocialRedirectUrl.d.ts +16 -0
- package/dist/modules/auth/social/oauth/detectSocialRedirectUrl/detectSocialRedirectUrl.d.ts.map +1 -0
- package/dist/modules/auth/social/oauth/detectSocialRedirectUrl/detectSocialRedirectUrl.types.d.ts +4 -0
- package/dist/modules/auth/social/oauth/detectSocialRedirectUrl/detectSocialRedirectUrl.types.d.ts.map +1 -0
- package/dist/modules/auth/social/oauth/detectSocialRedirectUrl/index.d.ts +2 -0
- package/dist/modules/auth/social/oauth/detectSocialRedirectUrl/index.d.ts.map +1 -0
- package/dist/modules/auth/social/oauth/signInWithSocialRedirect/buildOAuthUrl/addOAuthUrlParams/addOAuthUrlParams.d.ts.map +1 -0
- package/dist/modules/auth/social/oauth/signInWithSocialRedirect/buildOAuthUrl/addOAuthUrlParams/index.d.ts.map +1 -0
- package/dist/modules/auth/social/oauth/{authenticateWithSocial → signInWithSocialRedirect}/buildOAuthUrl/buildOAuthUrl.d.ts +1 -1
- package/dist/modules/auth/social/oauth/signInWithSocialRedirect/buildOAuthUrl/buildOAuthUrl.d.ts.map +1 -0
- package/dist/modules/auth/social/oauth/signInWithSocialRedirect/buildOAuthUrl/getOAuthBaseUrl/getOAuthBaseUrl.d.ts.map +1 -0
- package/dist/modules/auth/social/oauth/signInWithSocialRedirect/buildOAuthUrl/getOAuthBaseUrl/index.d.ts.map +1 -0
- package/dist/modules/auth/social/oauth/signInWithSocialRedirect/buildOAuthUrl/index.d.ts.map +1 -0
- package/dist/modules/auth/social/oauth/signInWithSocialRedirect/index.d.ts +2 -0
- package/dist/modules/auth/social/oauth/signInWithSocialRedirect/index.d.ts.map +1 -0
- package/dist/modules/auth/social/oauth/signInWithSocialRedirect/signInWithSocialRedirect.d.ts +19 -0
- package/dist/modules/auth/social/oauth/signInWithSocialRedirect/signInWithSocialRedirect.d.ts.map +1 -0
- package/dist/modules/auth/social/oauth/signInWithSocialRedirect/signInWithSocialRedirect.types.d.ts +6 -0
- package/dist/modules/auth/social/oauth/signInWithSocialRedirect/signInWithSocialRedirect.types.d.ts.map +1 -0
- package/dist/modules/sessionKeys/generateSessionKeys/generateSessionKeys.d.ts.map +1 -1
- package/dist/modules/waas/restoreUserSharesForAllWalletAccounts/restoreUserSharesForAllWalletAccounts.d.ts.map +1 -1
- package/dist/services/instrumentation/connectLoggerToInstrumentation/connectLoggerToInstrumentation.d.ts +2 -1
- package/dist/services/instrumentation/connectLoggerToInstrumentation/connectLoggerToInstrumentation.d.ts.map +1 -1
- package/dist/services/instrumentation/instrumentFunction/instrumentFunction.d.ts.map +1 -1
- package/dist/services/instrumentation/instrumentation.types.d.ts +2 -0
- package/dist/services/instrumentation/instrumentation.types.d.ts.map +1 -1
- package/dist/services/passkey/createPasskeyService/createPasskeyService.d.ts +11 -0
- package/dist/services/passkey/createPasskeyService/createPasskeyService.d.ts.map +1 -0
- package/dist/services/passkey/createPasskeyService/index.d.ts +2 -0
- package/dist/services/passkey/createPasskeyService/index.d.ts.map +1 -0
- package/dist/services/passkey/index.d.ts +1 -1
- package/dist/services/passkey/index.d.ts.map +1 -1
- package/dist/services/passkey/passkey.types.d.ts +4 -0
- package/dist/services/passkey/passkey.types.d.ts.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/{waas.cjs.js → waas.cjs} +5 -5
- package/dist/waas.cjs.map +1 -0
- package/dist/waas.esm.js +3 -3
- package/dist/waas.native.esm.js +3 -3
- package/dist/{waasCore.cjs.js → waasCore.cjs} +5 -5
- package/dist/waasCore.cjs.map +1 -0
- package/dist/waasCore.esm.js +3 -3
- package/dist/waasCore.native.esm.js +3 -3
- package/package.json +13 -8
- package/dist/InvalidParamError-BxdCGMzn.esm.js.map +0 -1
- package/dist/InvalidParamError-C5CPZiAb.native.esm.js.map +0 -1
- package/dist/InvalidParamError-Dg0Tc6h7.cjs.js.map +0 -1
- package/dist/NotWaasWalletAccountError-w4J6uXP2.cjs.js.map +0 -1
- package/dist/core.cjs.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-BzJ_kChE.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-DRAq7tIx.cjs.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-DnfmH9wZ.native.esm.js.map +0 -1
- package/dist/getSignedSessionId-CDCWfHxY.cjs.js.map +0 -1
- package/dist/getVerifiedCredentialForWalletAccount-B18TOqzI.native.esm.js.map +0 -1
- package/dist/getVerifiedCredentialForWalletAccount-Bznazz-w.cjs.js.map +0 -1
- package/dist/getVerifiedCredentialForWalletAccount-C2LbBPET.esm.js.map +0 -1
- package/dist/index.cjs.js.map +0 -1
- package/dist/isMfaRequiredForAction-DG4IaOFU.cjs.js.map +0 -1
- package/dist/modules/auth/social/oauth/authenticateWithSocial/buildOAuthUrl/addOAuthUrlParams/addOAuthUrlParams.d.ts.map +0 -1
- package/dist/modules/auth/social/oauth/authenticateWithSocial/buildOAuthUrl/addOAuthUrlParams/index.d.ts.map +0 -1
- package/dist/modules/auth/social/oauth/authenticateWithSocial/buildOAuthUrl/buildOAuthUrl.d.ts.map +0 -1
- package/dist/modules/auth/social/oauth/authenticateWithSocial/buildOAuthUrl/getOAuthBaseUrl/getOAuthBaseUrl.d.ts.map +0 -1
- package/dist/modules/auth/social/oauth/authenticateWithSocial/buildOAuthUrl/getOAuthBaseUrl/index.d.ts.map +0 -1
- package/dist/modules/auth/social/oauth/authenticateWithSocial/buildOAuthUrl/index.d.ts.map +0 -1
- package/dist/services/passkey/createWebPasskeyService/createWebPasskeyService.d.ts +0 -7
- package/dist/services/passkey/createWebPasskeyService/createWebPasskeyService.d.ts.map +0 -1
- package/dist/services/passkey/createWebPasskeyService/index.d.ts +0 -2
- package/dist/services/passkey/createWebPasskeyService/index.d.ts.map +0 -1
- package/dist/waas.cjs.js.map +0 -1
- package/dist/waasCore.cjs.js.map +0 -1
- /package/dist/modules/auth/social/oauth/{authenticateWithSocial → signInWithSocialRedirect}/buildOAuthUrl/addOAuthUrlParams/addOAuthUrlParams.d.ts +0 -0
- /package/dist/modules/auth/social/oauth/{authenticateWithSocial → signInWithSocialRedirect}/buildOAuthUrl/addOAuthUrlParams/index.d.ts +0 -0
- /package/dist/modules/auth/social/oauth/{authenticateWithSocial → signInWithSocialRedirect}/buildOAuthUrl/getOAuthBaseUrl/getOAuthBaseUrl.d.ts +0 -0
- /package/dist/modules/auth/social/oauth/{authenticateWithSocial → signInWithSocialRedirect}/buildOAuthUrl/getOAuthBaseUrl/index.d.ts +0 -0
- /package/dist/modules/auth/social/oauth/{authenticateWithSocial → signInWithSocialRedirect}/buildOAuthUrl/index.d.ts +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const require_getNetworkProviderFromNetworkId = require('./getNetworkProviderFromNetworkId-
|
|
2
|
-
const require_InvalidParamError = require('./InvalidParamError-
|
|
3
|
-
const require_getVerifiedCredentialForWalletAccount = require('./getVerifiedCredentialForWalletAccount-
|
|
4
|
-
const require_NotWaasWalletAccountError = require('./NotWaasWalletAccountError-
|
|
5
|
-
const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-
|
|
1
|
+
const require_getNetworkProviderFromNetworkId = require('./getNetworkProviderFromNetworkId-CY555AiJ.cjs');
|
|
2
|
+
const require_InvalidParamError = require('./InvalidParamError-D-SHhcTB.cjs');
|
|
3
|
+
const require_getVerifiedCredentialForWalletAccount = require('./getVerifiedCredentialForWalletAccount-BqaTVz4z.cjs');
|
|
4
|
+
const require_NotWaasWalletAccountError = require('./NotWaasWalletAccountError-EPhK7TaK.cjs');
|
|
5
|
+
const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-V3A2BO7c.cjs');
|
|
6
6
|
let _dynamic_labs_sdk_assert_package_version = require("@dynamic-labs-sdk/assert-package-version");
|
|
7
7
|
let _dynamic_labs_sdk_api_core = require("@dynamic-labs/sdk-api-core");
|
|
8
8
|
let zod_mini = require("zod/mini");
|
|
@@ -622,7 +622,7 @@ const createWebFetch = () => {
|
|
|
622
622
|
* Only error-level log entries are forwarded.
|
|
623
623
|
* @not-instrumented
|
|
624
624
|
*/
|
|
625
|
-
const connectLoggerToInstrumentation = ({ environmentId, instrumentation, logger, sdkSessionId, sdkVersion, state }) => {
|
|
625
|
+
const connectLoggerToInstrumentation = ({ environmentId, extensions, instrumentation, logger, sdkSessionId, sdkVersion, state }) => {
|
|
626
626
|
logger.on("log", (level, message, ...args) => {
|
|
627
627
|
if (level !== "error") return;
|
|
628
628
|
const { token, user } = state.get();
|
|
@@ -632,6 +632,7 @@ const connectLoggerToInstrumentation = ({ environmentId, instrumentation, logger
|
|
|
632
632
|
args,
|
|
633
633
|
message
|
|
634
634
|
},
|
|
635
|
+
registeredExtensionKeys: Array.from(extensions),
|
|
635
636
|
sdkSessionId,
|
|
636
637
|
sdkVersion,
|
|
637
638
|
status: "error",
|
|
@@ -763,7 +764,7 @@ const createWebDeeplinkOpener = () => {
|
|
|
763
764
|
};
|
|
764
765
|
|
|
765
766
|
//#endregion
|
|
766
|
-
//#region src/services/passkey/
|
|
767
|
+
//#region src/services/passkey/createPasskeyService/createPasskeyService.ts
|
|
767
768
|
/**
|
|
768
769
|
* Because this is the web implementation of the passkey service, we need to
|
|
769
770
|
* import the browser's WebAuthn API directly.
|
|
@@ -771,9 +772,13 @@ const createWebDeeplinkOpener = () => {
|
|
|
771
772
|
*/
|
|
772
773
|
/**
|
|
773
774
|
* Create a passkey service that uses the browser's WebAuthn API.
|
|
775
|
+
*
|
|
776
|
+
* Metadata is accepted for parity with the native implementation (which uses
|
|
777
|
+
* `universalLink` to validate the associated domain) but is unused on web —
|
|
778
|
+
* the browser derives the relying party from `window.location.origin`.
|
|
774
779
|
* @not-instrumented
|
|
775
780
|
*/
|
|
776
|
-
const
|
|
781
|
+
const createPasskeyService = (_params) => ({
|
|
777
782
|
authenticate: (options) => (0, _simplewebauthn_browser.startAuthentication)(options),
|
|
778
783
|
isSupported: () => (0, _simplewebauthn_browser.browserSupportsWebAuthn)(),
|
|
779
784
|
register: (options) => (0, _simplewebauthn_browser.startRegistration)(options)
|
|
@@ -951,8 +956,10 @@ const createCore = (config) => {
|
|
|
951
956
|
const initTrack = createAsyncTrack();
|
|
952
957
|
const sdkSessionId = require_InvalidParamError.randomString({ length: 32 });
|
|
953
958
|
const instrumentation = createInstrumentation({ config: config.instrumentation });
|
|
959
|
+
const extensions = /* @__PURE__ */ new Set();
|
|
954
960
|
connectLoggerToInstrumentation({
|
|
955
961
|
environmentId: config.environmentId,
|
|
962
|
+
extensions,
|
|
956
963
|
instrumentation,
|
|
957
964
|
logger,
|
|
958
965
|
sdkSessionId,
|
|
@@ -964,7 +971,11 @@ const createCore = (config) => {
|
|
|
964
971
|
fetch
|
|
965
972
|
}));
|
|
966
973
|
const runtimeServices = createRuntimeServices();
|
|
967
|
-
const
|
|
974
|
+
const metadata = {
|
|
975
|
+
...config.metadata,
|
|
976
|
+
universalLink: config.metadata?.universalLink ?? (require_getNetworkProviderFromNetworkId.isServerSideRendering() ? void 0 : window.location.origin)
|
|
977
|
+
};
|
|
978
|
+
const passkey = config.coreConfig?.passkey ?? createPasskeyService({ metadata });
|
|
968
979
|
const realtime = config.coreConfig?.realtime ?? require_getNetworkProviderFromNetworkId.__createRealtimeService_wrapped();
|
|
969
980
|
const deviceSigner = config.coreConfig?.deviceSigner;
|
|
970
981
|
const keychain = config.coreConfig?.keychain ?? require_getNetworkProviderFromNetworkId.createKeychainService({ dbName: `dynamic_${config.environmentId}_keychain` });
|
|
@@ -975,17 +986,14 @@ const createCore = (config) => {
|
|
|
975
986
|
deviceSigner,
|
|
976
987
|
environmentId: config.environmentId,
|
|
977
988
|
eventEmitter,
|
|
978
|
-
extensions
|
|
989
|
+
extensions,
|
|
979
990
|
fetch,
|
|
980
991
|
getApiHeaders: config.coreConfig?.getApiHeaders ?? (() => ({})),
|
|
981
992
|
initTrack,
|
|
982
993
|
instrumentation,
|
|
983
994
|
keychain,
|
|
984
995
|
logger,
|
|
985
|
-
metadata
|
|
986
|
-
...config.metadata,
|
|
987
|
-
universalLink: config.metadata?.universalLink ?? (require_getNetworkProviderFromNetworkId.isServerSideRendering() ? void 0 : window.location.origin)
|
|
988
|
-
},
|
|
996
|
+
metadata,
|
|
989
997
|
navigate,
|
|
990
998
|
openDeeplink,
|
|
991
999
|
passkey,
|
|
@@ -1866,7 +1874,7 @@ const encodeBase64Url = (str) => {
|
|
|
1866
1874
|
};
|
|
1867
1875
|
|
|
1868
1876
|
//#endregion
|
|
1869
|
-
//#region src/modules/auth/social/oauth/
|
|
1877
|
+
//#region src/modules/auth/social/oauth/signInWithSocialRedirect/buildOAuthUrl/addOAuthUrlParams/addOAuthUrlParams.ts
|
|
1870
1878
|
const APPLE_RESPONSE_MODE = "form_post";
|
|
1871
1879
|
const APPLE_RESPONSE_TYPE = "code id_token";
|
|
1872
1880
|
/** Helper function to add OAuth URL parameters to a given base URL. * @not-instrumented
|
|
@@ -1896,7 +1904,7 @@ const addOAuthUrlParams = ({ baseUrl, isGoogleDriveBackupEnabled, provider }) =>
|
|
|
1896
1904
|
};
|
|
1897
1905
|
|
|
1898
1906
|
//#endregion
|
|
1899
|
-
//#region src/modules/auth/social/oauth/
|
|
1907
|
+
//#region src/modules/auth/social/oauth/signInWithSocialRedirect/buildOAuthUrl/getOAuthBaseUrl/getOAuthBaseUrl.ts
|
|
1900
1908
|
/** Helper function to build the OAuth base URL for a given provider. * @not-instrumented
|
|
1901
1909
|
*/
|
|
1902
1910
|
const getOAuthBaseUrl = (provider) => {
|
|
@@ -1916,7 +1924,7 @@ const getOAuthBaseUrl = (provider) => {
|
|
|
1916
1924
|
};
|
|
1917
1925
|
|
|
1918
1926
|
//#endregion
|
|
1919
|
-
//#region src/modules/auth/social/oauth/
|
|
1927
|
+
//#region src/modules/auth/social/oauth/signInWithSocialRedirect/buildOAuthUrl/buildOAuthUrl.ts
|
|
1920
1928
|
const providersRequiringPkce = ["twitter", "github"];
|
|
1921
1929
|
/** Helper function to build the OAuth URL for a given provider. * @not-instrumented
|
|
1922
1930
|
*/
|
|
@@ -1950,22 +1958,23 @@ const buildOAuthUrl = async (core, provider) => {
|
|
|
1950
1958
|
};
|
|
1951
1959
|
|
|
1952
1960
|
//#endregion
|
|
1953
|
-
//#region src/modules/auth/social/oauth/
|
|
1961
|
+
//#region src/modules/auth/social/oauth/signInWithSocialRedirect/signInWithSocialRedirect.ts
|
|
1954
1962
|
/**
|
|
1955
1963
|
* Initiates social authentication by redirecting to the OAuth provider.
|
|
1956
1964
|
*
|
|
1957
1965
|
* This function redirects the user to the specified social provider's
|
|
1958
|
-
* authorization page to complete OAuth authentication flow.
|
|
1959
|
-
* After the
|
|
1960
|
-
*
|
|
1961
|
-
*
|
|
1966
|
+
* authorization page to complete the OAuth authentication flow.
|
|
1967
|
+
* After the flow is complete, the user is redirected back to your app.
|
|
1968
|
+
* Call `detectSocialRedirectUrl` to check whether the user was redirected
|
|
1969
|
+
* back because of this flow, then call `completeSocialRedirect` to finish
|
|
1970
|
+
* the social authentication.
|
|
1962
1971
|
*
|
|
1963
1972
|
* @param params.provider - The social provider to authenticate with (e.g., 'google', 'github').
|
|
1964
1973
|
* @param params.redirectUrl - The URL to redirect back to after authentication.
|
|
1965
1974
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1966
1975
|
* @instrumented
|
|
1967
1976
|
*/
|
|
1968
|
-
const
|
|
1977
|
+
const signInWithSocialRedirect = async ({ provider, redirectUrl }, client = require_InvalidParamError.getDefaultClient()) => {
|
|
1969
1978
|
const core = require_InvalidParamError.getCore(client);
|
|
1970
1979
|
const apiClient = require_InvalidParamError.__createApiClient_wrapped({}, client);
|
|
1971
1980
|
await core.initTrack.waitForAll();
|
|
@@ -1986,10 +1995,10 @@ const authenticateWithSocial = async ({ provider, redirectUrl }, client = requir
|
|
|
1986
1995
|
});
|
|
1987
1996
|
await core.navigate(url.toString());
|
|
1988
1997
|
};
|
|
1989
|
-
const
|
|
1990
|
-
const
|
|
1991
|
-
fn:
|
|
1992
|
-
functionName: "
|
|
1998
|
+
const __signInWithSocialRedirect_impl = signInWithSocialRedirect;
|
|
1999
|
+
const __signInWithSocialRedirect_wrapped = require_InvalidParamError.instrumentFunction({
|
|
2000
|
+
fn: __signInWithSocialRedirect_impl,
|
|
2001
|
+
functionName: "signInWithSocialRedirect",
|
|
1993
2002
|
getCore: () => {
|
|
1994
2003
|
try {
|
|
1995
2004
|
return require_InvalidParamError.getCore(require_InvalidParamError.getDefaultClient());
|
|
@@ -2000,12 +2009,48 @@ const __authenticateWithSocial_wrapped = require_InvalidParamError.instrumentFun
|
|
|
2000
2009
|
});
|
|
2001
2010
|
|
|
2002
2011
|
//#endregion
|
|
2003
|
-
//#region src/modules/auth/social/oauth/
|
|
2012
|
+
//#region src/modules/auth/social/oauth/detectSocialRedirectUrl/detectSocialRedirectUrl.ts
|
|
2004
2013
|
/**
|
|
2005
|
-
*
|
|
2014
|
+
* Detects whether the given URL is an OAuth redirect from a social provider.
|
|
2006
2015
|
*
|
|
2007
|
-
*
|
|
2008
|
-
*
|
|
2016
|
+
* Examines the URL parameters to determine whether it carries OAuth callback
|
|
2017
|
+
* data that originated from a social authentication flow started by
|
|
2018
|
+
* `signInWithSocialRedirect`.
|
|
2019
|
+
*
|
|
2020
|
+
* @param params.url - The URL to check for OAuth redirect parameters.
|
|
2021
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
2022
|
+
* @returns A promise that resolves to true if the URL is an OAuth redirect, false otherwise.
|
|
2023
|
+
* @instrumented
|
|
2024
|
+
*/
|
|
2025
|
+
const detectSocialRedirectUrl = async ({ url }, client = require_InvalidParamError.getDefaultClient()) => {
|
|
2026
|
+
const core = require_InvalidParamError.getCore(client);
|
|
2027
|
+
const dynamicOauthState = url.searchParams.get("dynamicOauthState");
|
|
2028
|
+
const dynamicOauthCode = url.searchParams.get("dynamicOauthCode");
|
|
2029
|
+
if (!dynamicOauthState || !dynamicOauthCode) return false;
|
|
2030
|
+
await core.initTrack.waitForAll();
|
|
2031
|
+
return (await core.storage.getItem(redirectStateStorageKeySchema))?.state === dynamicOauthState;
|
|
2032
|
+
};
|
|
2033
|
+
const __detectSocialRedirectUrl_impl = detectSocialRedirectUrl;
|
|
2034
|
+
const __detectSocialRedirectUrl_wrapped = require_InvalidParamError.instrumentFunction({
|
|
2035
|
+
fn: __detectSocialRedirectUrl_impl,
|
|
2036
|
+
functionName: "detectSocialRedirectUrl",
|
|
2037
|
+
getCore: () => {
|
|
2038
|
+
try {
|
|
2039
|
+
return require_InvalidParamError.getCore(require_InvalidParamError.getDefaultClient());
|
|
2040
|
+
} catch {
|
|
2041
|
+
return;
|
|
2042
|
+
}
|
|
2043
|
+
}
|
|
2044
|
+
});
|
|
2045
|
+
|
|
2046
|
+
//#endregion
|
|
2047
|
+
//#region src/modules/auth/social/oauth/completeSocialRedirect/completeSocialRedirect.ts
|
|
2048
|
+
/**
|
|
2049
|
+
* Completes the social authentication flow after the OAuth redirect.
|
|
2050
|
+
*
|
|
2051
|
+
* Processes the OAuth callback URL with the authorization code and finishes
|
|
2052
|
+
* authenticating (or linking) the user with the social provider. This is the
|
|
2053
|
+
* final step after `signInWithSocialRedirect` + `detectSocialRedirectUrl`.
|
|
2009
2054
|
*
|
|
2010
2055
|
* @param params.url - The callback URL containing OAuth response parameters.
|
|
2011
2056
|
* @param [params.requestedScopes] - Optional scopes to request an elevated access token when verifying (linking) a social account.
|
|
@@ -2015,7 +2060,7 @@ const __authenticateWithSocial_wrapped = require_InvalidParamError.instrumentFun
|
|
|
2015
2060
|
* @throws InvalidRedirectStorageStateError If the stored state doesn't match.
|
|
2016
2061
|
* @instrumented
|
|
2017
2062
|
*/
|
|
2018
|
-
const
|
|
2063
|
+
const completeSocialRedirect = async ({ url, requestedScopes }, client = require_InvalidParamError.getDefaultClient()) => {
|
|
2019
2064
|
const core = require_InvalidParamError.getCore(client);
|
|
2020
2065
|
const apiClient = require_InvalidParamError.__createApiClient_wrapped({}, client);
|
|
2021
2066
|
await core.initTrack.waitForAll();
|
|
@@ -2052,6 +2097,50 @@ const completeSocialAuthentication = async ({ url, requestedScopes }, client = r
|
|
|
2052
2097
|
require_getVerifiedCredentialForWalletAccount.__updateAuthFromVerifyResponse_wrapped({ response }, client);
|
|
2053
2098
|
return response.user;
|
|
2054
2099
|
};
|
|
2100
|
+
const __completeSocialRedirect_impl = completeSocialRedirect;
|
|
2101
|
+
const __completeSocialRedirect_wrapped = require_InvalidParamError.instrumentFunction({
|
|
2102
|
+
fn: __completeSocialRedirect_impl,
|
|
2103
|
+
functionName: "completeSocialRedirect",
|
|
2104
|
+
getCore: () => {
|
|
2105
|
+
try {
|
|
2106
|
+
return require_InvalidParamError.getCore(require_InvalidParamError.getDefaultClient());
|
|
2107
|
+
} catch {
|
|
2108
|
+
return;
|
|
2109
|
+
}
|
|
2110
|
+
}
|
|
2111
|
+
});
|
|
2112
|
+
|
|
2113
|
+
//#endregion
|
|
2114
|
+
//#region src/modules/auth/social/oauth/authenticateWithSocial/authenticateWithSocial.ts
|
|
2115
|
+
/**
|
|
2116
|
+
* @deprecated Renamed to {@link signInWithSocialRedirect}. This alias will be
|
|
2117
|
+
* removed in a future major version.
|
|
2118
|
+
*
|
|
2119
|
+
* @instrumented
|
|
2120
|
+
*/
|
|
2121
|
+
const authenticateWithSocial = (params, client = require_InvalidParamError.getDefaultClient()) => __signInWithSocialRedirect_wrapped(params, client);
|
|
2122
|
+
const __authenticateWithSocial_impl = authenticateWithSocial;
|
|
2123
|
+
const __authenticateWithSocial_wrapped = require_InvalidParamError.instrumentFunction({
|
|
2124
|
+
fn: __authenticateWithSocial_impl,
|
|
2125
|
+
functionName: "authenticateWithSocial",
|
|
2126
|
+
getCore: () => {
|
|
2127
|
+
try {
|
|
2128
|
+
return require_InvalidParamError.getCore(require_InvalidParamError.getDefaultClient());
|
|
2129
|
+
} catch {
|
|
2130
|
+
return;
|
|
2131
|
+
}
|
|
2132
|
+
}
|
|
2133
|
+
});
|
|
2134
|
+
|
|
2135
|
+
//#endregion
|
|
2136
|
+
//#region src/modules/auth/social/oauth/completeSocialAuthentication/completeSocialAuthentication.ts
|
|
2137
|
+
/**
|
|
2138
|
+
* @deprecated Renamed to {@link completeSocialRedirect}. This alias will be
|
|
2139
|
+
* removed in a future major version.
|
|
2140
|
+
*
|
|
2141
|
+
* @instrumented
|
|
2142
|
+
*/
|
|
2143
|
+
const completeSocialAuthentication = (params, client = require_InvalidParamError.getDefaultClient()) => __completeSocialRedirect_wrapped(params, client);
|
|
2055
2144
|
const __completeSocialAuthentication_impl = completeSocialAuthentication;
|
|
2056
2145
|
const __completeSocialAuthentication_wrapped = require_InvalidParamError.instrumentFunction({
|
|
2057
2146
|
fn: __completeSocialAuthentication_impl,
|
|
@@ -2068,26 +2157,12 @@ const __completeSocialAuthentication_wrapped = require_InvalidParamError.instrum
|
|
|
2068
2157
|
//#endregion
|
|
2069
2158
|
//#region src/modules/auth/social/oauth/detectOAuthRedirect/detectOAuthRedirect.ts
|
|
2070
2159
|
/**
|
|
2071
|
-
*
|
|
2160
|
+
* @deprecated Renamed to {@link detectSocialRedirectUrl}. This alias will be
|
|
2161
|
+
* removed in a future major version.
|
|
2072
2162
|
*
|
|
2073
|
-
* This function examines the URL parameters to determine if it contains
|
|
2074
|
-
* OAuth callback data from a social authentication flow.
|
|
2075
|
-
*
|
|
2076
|
-
* @param params.url - The URL to check for OAuth redirect parameters.
|
|
2077
|
-
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
2078
|
-
* @returns A promise that resolves to true if the URL is an OAuth redirect, false otherwise.
|
|
2079
2163
|
* @instrumented
|
|
2080
2164
|
*/
|
|
2081
|
-
const detectOAuthRedirect =
|
|
2082
|
-
const core = require_InvalidParamError.getCore(client);
|
|
2083
|
-
const dynamicOauthState = url.searchParams.get("dynamicOauthState");
|
|
2084
|
-
const dynamicOauthCode = url.searchParams.get("dynamicOauthCode");
|
|
2085
|
-
if (!dynamicOauthState || !dynamicOauthCode) return false;
|
|
2086
|
-
await core.initTrack.waitForAll();
|
|
2087
|
-
const storedSocialRedirectState = await core.storage.getItem(redirectStateStorageKeySchema);
|
|
2088
|
-
if (!storedSocialRedirectState || storedSocialRedirectState.state !== dynamicOauthState) return false;
|
|
2089
|
-
return true;
|
|
2090
|
-
};
|
|
2165
|
+
const detectOAuthRedirect = (params, client = require_InvalidParamError.getDefaultClient()) => __detectSocialRedirectUrl_wrapped(params, client);
|
|
2091
2166
|
const __detectOAuthRedirect_impl = detectOAuthRedirect;
|
|
2092
2167
|
const __detectOAuthRedirect_wrapped = require_InvalidParamError.instrumentFunction({
|
|
2093
2168
|
fn: __detectOAuthRedirect_impl,
|
|
@@ -4240,24 +4315,6 @@ const isPendingRecoveryCodesAcknowledgment = (client = require_InvalidParamError
|
|
|
4240
4315
|
return user.mfaBackupCodeAcknowledgement === _dynamic_labs_sdk_api_core.MfaBackupCodeAcknowledgement.Pending;
|
|
4241
4316
|
};
|
|
4242
4317
|
|
|
4243
|
-
//#endregion
|
|
4244
|
-
//#region src/modules/mfa/isUserMissingMfaAuth/isUserMissingMfaAuth.ts
|
|
4245
|
-
/**
|
|
4246
|
-
* Checks if the user requires additional MFA authentication.
|
|
4247
|
-
*
|
|
4248
|
-
* This function determines if the current user session requires
|
|
4249
|
-
* additional multi-factor authentication to access certain features.
|
|
4250
|
-
*
|
|
4251
|
-
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
4252
|
-
* @returns True if the user needs additional MFA authentication, false otherwise.
|
|
4253
|
-
* @not-instrumented
|
|
4254
|
-
*/
|
|
4255
|
-
const isUserMissingMfaAuth = (client = require_InvalidParamError.getDefaultClient()) => {
|
|
4256
|
-
const user = client.user;
|
|
4257
|
-
require_InvalidParamError.assertDefined(user, "User not logged in");
|
|
4258
|
-
return Boolean(user.scope?.includes("requiresAdditionalAuth"));
|
|
4259
|
-
};
|
|
4260
|
-
|
|
4261
4318
|
//#endregion
|
|
4262
4319
|
//#region src/modules/mfa/registerTotpMfaDevice/registerTotpMfaDevice.ts
|
|
4263
4320
|
/**
|
|
@@ -5563,7 +5620,7 @@ const isUserOnboardingComplete = (client = require_InvalidParamError.getDefaultC
|
|
|
5563
5620
|
const user = client.user;
|
|
5564
5621
|
require_InvalidParamError.assertDefined(user, "User not logged in");
|
|
5565
5622
|
const hasMissingKycFields = Boolean(user.missingFields?.length);
|
|
5566
|
-
const hasPendingMfaAuth = isUserMissingMfaAuth(client);
|
|
5623
|
+
const hasPendingMfaAuth = require_getVerifiedCredentialForWalletAccount.isUserMissingMfaAuth(client);
|
|
5567
5624
|
const hasPendingRecoveryCodes = isPendingRecoveryCodesAcknowledgment(client);
|
|
5568
5625
|
return !hasMissingKycFields && !hasPendingMfaAuth && !hasPendingRecoveryCodes;
|
|
5569
5626
|
};
|
|
@@ -6819,6 +6876,7 @@ exports.cancelCheckoutTransaction = __cancelCheckoutTransaction_wrapped;
|
|
|
6819
6876
|
exports.checkStepUpAuth = __checkStepUpAuth_wrapped;
|
|
6820
6877
|
exports.completeDeviceRegistration = __completeDeviceRegistration_wrapped;
|
|
6821
6878
|
exports.completeSocialAuthentication = __completeSocialAuthentication_wrapped;
|
|
6879
|
+
exports.completeSocialRedirect = __completeSocialRedirect_wrapped;
|
|
6822
6880
|
exports.confirmTransaction = __confirmTransaction_wrapped;
|
|
6823
6881
|
exports.connectAndVerifyWithWalletProvider = __connectAndVerifyWithWalletProvider_wrapped;
|
|
6824
6882
|
exports.connectWithWalletProvider = __connectWithWalletProvider_wrapped;
|
|
@@ -6834,6 +6892,7 @@ exports.deletePasskey = __deletePasskey_wrapped;
|
|
|
6834
6892
|
exports.deleteUser = __deleteUser_wrapped;
|
|
6835
6893
|
exports.detectDeviceRegistrationRedirect = __detectDeviceRegistrationRedirect_wrapped;
|
|
6836
6894
|
exports.detectOAuthRedirect = __detectOAuthRedirect_wrapped;
|
|
6895
|
+
exports.detectSocialRedirectUrl = __detectSocialRedirectUrl_wrapped;
|
|
6837
6896
|
exports.executeSwapTransaction = __executeSwapTransaction_wrapped;
|
|
6838
6897
|
exports.fetchProjectSettings = require_getNetworkProviderFromNetworkId.__fetchProjectSettings_wrapped;
|
|
6839
6898
|
exports.getActiveNetworkData = __getActiveNetworkData_wrapped;
|
|
@@ -6882,7 +6941,7 @@ exports.isMobile = isMobile;
|
|
|
6882
6941
|
exports.isPendingRecoveryCodesAcknowledgment = isPendingRecoveryCodesAcknowledgment;
|
|
6883
6942
|
exports.isProgrammaticNetworkSwitchAvailable = isProgrammaticNetworkSwitchAvailable;
|
|
6884
6943
|
exports.isSignedIn = require_getNetworkProviderFromNetworkId.isSignedIn;
|
|
6885
|
-
exports.isUserMissingMfaAuth = isUserMissingMfaAuth;
|
|
6944
|
+
exports.isUserMissingMfaAuth = require_getVerifiedCredentialForWalletAccount.isUserMissingMfaAuth;
|
|
6886
6945
|
exports.isUserOnboardingComplete = isUserOnboardingComplete;
|
|
6887
6946
|
exports.isWalletAccountVerified = isWalletAccountVerified;
|
|
6888
6947
|
exports.logout = logout;
|
|
@@ -6911,6 +6970,7 @@ exports.setDefaultMfaDevice = __setDefaultMfaDevice_wrapped;
|
|
|
6911
6970
|
exports.setInstrumentationEnabled = __setInstrumentationEnabled_wrapped;
|
|
6912
6971
|
exports.signInWithExternalJwt = __signInWithExternalJwt_wrapped;
|
|
6913
6972
|
exports.signInWithPasskey = __signInWithPasskey_wrapped;
|
|
6973
|
+
exports.signInWithSocialRedirect = __signInWithSocialRedirect_wrapped;
|
|
6914
6974
|
exports.signMessage = __signMessage_wrapped;
|
|
6915
6975
|
exports.submitCheckoutTransaction = __submitCheckoutTransaction_wrapped;
|
|
6916
6976
|
exports.supportedCountries = supportedCountries;
|
|
@@ -6923,4 +6983,4 @@ exports.updateUser = __updateUser_wrapped;
|
|
|
6923
6983
|
exports.verifyOTP = __verifyOTP_wrapped;
|
|
6924
6984
|
exports.verifyWalletAccount = __verifyWalletAccount_wrapped;
|
|
6925
6985
|
exports.waitForClientInitialized = __waitForClientInitialized_wrapped;
|
|
6926
|
-
//# sourceMappingURL=index.cjs.
|
|
6986
|
+
//# sourceMappingURL=index.cjs.map
|