@dynamic-labs-sdk/client 0.16.2 → 0.16.3
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-DRf5Y5Aj.esm.js → InvalidParamError-BVx-qvip.esm.js} +8 -3
- package/dist/{InvalidParamError-DRf5Y5Aj.esm.js.map → InvalidParamError-BVx-qvip.esm.js.map} +1 -1
- package/dist/{InvalidParamError-BweYAZrY.cjs.js → InvalidParamError-DgN3p6L7.cjs.js} +8 -3
- package/dist/{InvalidParamError-BweYAZrY.cjs.js.map → InvalidParamError-DgN3p6L7.cjs.js.map} +1 -1
- package/dist/{NotWaasWalletAccountError-D_AuJFHM.esm.js → NotWaasWalletAccountError-Cf9lQuha.esm.js} +3 -3
- package/dist/{NotWaasWalletAccountError-D_AuJFHM.esm.js.map → NotWaasWalletAccountError-Cf9lQuha.esm.js.map} +1 -1
- package/dist/{NotWaasWalletAccountError-Cf966VSY.cjs.js → NotWaasWalletAccountError-D-U7HAdA.cjs.js} +3 -3
- package/dist/{NotWaasWalletAccountError-Cf966VSY.cjs.js.map → NotWaasWalletAccountError-D-U7HAdA.cjs.js.map} +1 -1
- package/dist/core.cjs.js +5 -5
- package/dist/core.esm.js +5 -5
- package/dist/{getNetworkProviderFromNetworkId-D1oubSr_.cjs.js → getNetworkProviderFromNetworkId-B3Q8FbYk.cjs.js} +3 -3
- package/dist/{getNetworkProviderFromNetworkId-D1oubSr_.cjs.js.map → getNetworkProviderFromNetworkId-B3Q8FbYk.cjs.js.map} +1 -1
- package/dist/{getNetworkProviderFromNetworkId-PYVbXW2g.esm.js → getNetworkProviderFromNetworkId-Dxgklnpy.esm.js} +3 -3
- package/dist/{getNetworkProviderFromNetworkId-PYVbXW2g.esm.js.map → getNetworkProviderFromNetworkId-Dxgklnpy.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-DrTDCzhj.cjs.js → getSignedSessionId-CHghEuS-.cjs.js} +3 -3
- package/dist/{getSignedSessionId-DrTDCzhj.cjs.js.map → getSignedSessionId-CHghEuS-.cjs.js.map} +1 -1
- package/dist/{getSignedSessionId-CA2ARcr3.esm.js → getSignedSessionId-DyHvgJWx.esm.js} +3 -3
- package/dist/{getSignedSessionId-CA2ARcr3.esm.js.map → getSignedSessionId-DyHvgJWx.esm.js.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-Cc7DjHds.esm.js → getVerifiedCredentialForWalletAccount-BNiAI52Z.esm.js} +2 -2
- package/dist/{getVerifiedCredentialForWalletAccount-Cc7DjHds.esm.js.map → getVerifiedCredentialForWalletAccount-BNiAI52Z.esm.js.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-CnEQvQrG.cjs.js → getVerifiedCredentialForWalletAccount-CrCYutAz.cjs.js} +2 -2
- package/dist/{getVerifiedCredentialForWalletAccount-CnEQvQrG.cjs.js.map → getVerifiedCredentialForWalletAccount-CrCYutAz.cjs.js.map} +1 -1
- package/dist/index.cjs.js +9 -12
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +9 -12
- package/dist/index.esm.js.map +1 -1
- package/dist/{isMfaRequiredForAction-LvTNM74t.cjs.js → isMfaRequiredForAction-C3HCyv2s.cjs.js} +2 -2
- package/dist/{isMfaRequiredForAction-LvTNM74t.cjs.js.map → isMfaRequiredForAction-C3HCyv2s.cjs.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-Buji2Pg6.esm.js → isMfaRequiredForAction-cHOlNJRm.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-Buji2Pg6.esm.js.map → isMfaRequiredForAction-cHOlNJRm.esm.js.map} +1 -1
- package/dist/modules/deviceRegistration/isDeviceRegistrationRequired/isDeviceRegistrationRequired.d.ts +5 -3
- package/dist/modules/deviceRegistration/isDeviceRegistrationRequired/isDeviceRegistrationRequired.d.ts.map +1 -1
- package/dist/modules/wallets/constants.d.ts.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/waas.cjs.js +3 -3
- package/dist/waas.esm.js +3 -3
- package/dist/waasCore.cjs.js +3 -3
- package/dist/waasCore.esm.js +3 -3
- package/package.json +3 -3
package/dist/{isMfaRequiredForAction-LvTNM74t.cjs.js → isMfaRequiredForAction-C3HCyv2s.cjs.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_InvalidParamError = require('./InvalidParamError-
|
|
1
|
+
const require_InvalidParamError = require('./InvalidParamError-DgN3p6L7.cjs.js');
|
|
2
2
|
|
|
3
3
|
//#region src/modules/mfa/consumeMfaToken/consumeMfaToken.ts
|
|
4
4
|
/**
|
|
@@ -76,4 +76,4 @@ Object.defineProperty(exports, 'isMfaRequiredForAction', {
|
|
|
76
76
|
return isMfaRequiredForAction;
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
|
-
//# sourceMappingURL=isMfaRequiredForAction-
|
|
79
|
+
//# sourceMappingURL=isMfaRequiredForAction-C3HCyv2s.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isMfaRequiredForAction-
|
|
1
|
+
{"version":3,"file":"isMfaRequiredForAction-C3HCyv2s.cjs.js","names":["getDefaultClient","getCore","getDefaultClient","getCore","createApiClient","getDefaultClient"],"sources":["../src/modules/mfa/consumeMfaToken/consumeMfaToken.ts","../src/modules/mfa/getMfaMethods/getMfaMethods.ts","../src/modules/mfa/isMfaRequiredForAction/isMfaRequiredForAction.ts"],"sourcesContent":["import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\n\n/**\n * Consumes and clears the current MFA token from the client state.\n *\n * This function retrieves the MFA token obtained from a successful MFA authentication,\n * and removes it from the client, to prevent it from being used again.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns The MFA token that was consumed.\n * @throws Error if no MFA token is found.\n */\nexport const consumeMfaToken = (client = getDefaultClient()) => {\n const core = getCore(client);\n\n const mfaToken = core.state.get().mfaToken;\n\n assertDefined(mfaToken, 'No MFA token found');\n\n core.state.set({\n mfaToken: null,\n });\n\n return mfaToken;\n};\n","import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { createApiClient } from '../../apiClient';\n\n/**\n * Retrieves the available MFA methods for the current user.\n *\n * This function fetches information about which multi-factor authentication\n * methods are available and configured for the user's account.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the user's MFA methods configuration.\n */\nexport const getMfaMethods = async (client = getDefaultClient()) => {\n const core = getCore(client);\n const apiClient = createApiClient({}, client);\n\n const userMfaMethods = await apiClient.getUserMfaMethods({\n environmentId: core.environmentId,\n verifiedOnly: true,\n });\n\n return userMfaMethods;\n};\n","import type { MFAAction } from '@dynamic-labs/sdk-api-core';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { getMfaMethods } from '../getMfaMethods';\n\ntype IsMfaRequiredForActionParams = {\n mfaAction: MFAAction;\n};\n\n/**\n * Checks if MFA is required for a specific action.\n *\n * This function determines whether multi-factor authentication is required\n * for the specified action based on project settings and user configuration.\n *\n * @param params.mfaAction - The action to check MFA requirements for.\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to true if MFA is required for the action, false otherwise.\n */\nexport const isMfaRequiredForAction = async (\n { mfaAction }: IsMfaRequiredForActionParams,\n client = getDefaultClient()\n) => {\n const projectSettings = client.projectSettings;\n\n const isRequiredForAction = projectSettings?.security?.mfa?.actions?.some(\n (action) => action.action === mfaAction && action.required\n );\n\n // if mfa is not required for the action, return false\n // no matter if general mfa is set to required or not\n if (!isRequiredForAction) {\n return false;\n }\n\n const isMfaMethodRequired = projectSettings?.security?.mfa?.required;\n\n // if mfa is required for the action and also set as required in general, return true\n if (isMfaMethodRequired) {\n return true;\n }\n\n const mfaMethods = await getMfaMethods(client);\n // if general mfa is optional, but user has registered methods,\n // then it should be required for the action\n return mfaMethods.userHasVerifiedMfaMethods;\n};\n"],"mappings":";;;;;;;;;;;;;AAcA,MAAa,mBAAmB,SAASA,4CAAkB,KAAK;CAC9D,MAAM,OAAOC,kCAAQ,OAAO;CAE5B,MAAM,WAAW,KAAK,MAAM,KAAK,CAAC;AAElC,yCAAc,UAAU,qBAAqB;AAE7C,MAAK,MAAM,IAAI,EACb,UAAU,MACX,CAAC;AAEF,QAAO;;;;;;;;;;;;;;ACZT,MAAa,gBAAgB,OAAO,SAASC,4CAAkB,KAAK;CAClE,MAAM,OAAOC,kCAAQ,OAAO;AAQ5B,QALuB,MAFLC,0CAAgB,EAAE,EAAE,OAAO,CAEN,kBAAkB;EACvD,eAAe,KAAK;EACpB,cAAc;EACf,CAAC;;;;;;;;;;;;;;;ACDJ,MAAa,yBAAyB,OACpC,EAAE,aACF,SAASC,4CAAkB,KACxB;CACH,MAAM,kBAAkB,OAAO;AAQ/B,KAAI,CANwB,iBAAiB,UAAU,KAAK,SAAS,MAClE,WAAW,OAAO,WAAW,aAAa,OAAO,SACnD,CAKC,QAAO;AAMT,KAH4B,iBAAiB,UAAU,KAAK,SAI1D,QAAO;AAMT,SAHmB,MAAM,cAAc,OAAO,EAG5B"}
|
package/dist/{isMfaRequiredForAction-Buji2Pg6.esm.js → isMfaRequiredForAction-cHOlNJRm.esm.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as assertDefined, P as getDefaultClient, R as getCore, u as createApiClient } from "./InvalidParamError-
|
|
1
|
+
import { O as assertDefined, P as getDefaultClient, R as getCore, u as createApiClient } from "./InvalidParamError-BVx-qvip.esm.js";
|
|
2
2
|
|
|
3
3
|
//#region src/modules/mfa/consumeMfaToken/consumeMfaToken.ts
|
|
4
4
|
/**
|
|
@@ -59,4 +59,4 @@ const isMfaRequiredForAction = async ({ mfaAction }, client = getDefaultClient()
|
|
|
59
59
|
|
|
60
60
|
//#endregion
|
|
61
61
|
export { getMfaMethods as n, consumeMfaToken as r, isMfaRequiredForAction as t };
|
|
62
|
-
//# sourceMappingURL=isMfaRequiredForAction-
|
|
62
|
+
//# sourceMappingURL=isMfaRequiredForAction-cHOlNJRm.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isMfaRequiredForAction-
|
|
1
|
+
{"version":3,"file":"isMfaRequiredForAction-cHOlNJRm.esm.js","names":[],"sources":["../src/modules/mfa/consumeMfaToken/consumeMfaToken.ts","../src/modules/mfa/getMfaMethods/getMfaMethods.ts","../src/modules/mfa/isMfaRequiredForAction/isMfaRequiredForAction.ts"],"sourcesContent":["import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { assertDefined } from '../../../utils/assertDefined';\n\n/**\n * Consumes and clears the current MFA token from the client state.\n *\n * This function retrieves the MFA token obtained from a successful MFA authentication,\n * and removes it from the client, to prevent it from being used again.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns The MFA token that was consumed.\n * @throws Error if no MFA token is found.\n */\nexport const consumeMfaToken = (client = getDefaultClient()) => {\n const core = getCore(client);\n\n const mfaToken = core.state.get().mfaToken;\n\n assertDefined(mfaToken, 'No MFA token found');\n\n core.state.set({\n mfaToken: null,\n });\n\n return mfaToken;\n};\n","import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { createApiClient } from '../../apiClient';\n\n/**\n * Retrieves the available MFA methods for the current user.\n *\n * This function fetches information about which multi-factor authentication\n * methods are available and configured for the user's account.\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the user's MFA methods configuration.\n */\nexport const getMfaMethods = async (client = getDefaultClient()) => {\n const core = getCore(client);\n const apiClient = createApiClient({}, client);\n\n const userMfaMethods = await apiClient.getUserMfaMethods({\n environmentId: core.environmentId,\n verifiedOnly: true,\n });\n\n return userMfaMethods;\n};\n","import type { MFAAction } from '@dynamic-labs/sdk-api-core';\n\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { getMfaMethods } from '../getMfaMethods';\n\ntype IsMfaRequiredForActionParams = {\n mfaAction: MFAAction;\n};\n\n/**\n * Checks if MFA is required for a specific action.\n *\n * This function determines whether multi-factor authentication is required\n * for the specified action based on project settings and user configuration.\n *\n * @param params.mfaAction - The action to check MFA requirements for.\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to true if MFA is required for the action, false otherwise.\n */\nexport const isMfaRequiredForAction = async (\n { mfaAction }: IsMfaRequiredForActionParams,\n client = getDefaultClient()\n) => {\n const projectSettings = client.projectSettings;\n\n const isRequiredForAction = projectSettings?.security?.mfa?.actions?.some(\n (action) => action.action === mfaAction && action.required\n );\n\n // if mfa is not required for the action, return false\n // no matter if general mfa is set to required or not\n if (!isRequiredForAction) {\n return false;\n }\n\n const isMfaMethodRequired = projectSettings?.security?.mfa?.required;\n\n // if mfa is required for the action and also set as required in general, return true\n if (isMfaMethodRequired) {\n return true;\n }\n\n const mfaMethods = await getMfaMethods(client);\n // if general mfa is optional, but user has registered methods,\n // then it should be required for the action\n return mfaMethods.userHasVerifiedMfaMethods;\n};\n"],"mappings":";;;;;;;;;;;;;AAcA,MAAa,mBAAmB,SAAS,kBAAkB,KAAK;CAC9D,MAAM,OAAO,QAAQ,OAAO;CAE5B,MAAM,WAAW,KAAK,MAAM,KAAK,CAAC;AAElC,eAAc,UAAU,qBAAqB;AAE7C,MAAK,MAAM,IAAI,EACb,UAAU,MACX,CAAC;AAEF,QAAO;;;;;;;;;;;;;;ACZT,MAAa,gBAAgB,OAAO,SAAS,kBAAkB,KAAK;CAClE,MAAM,OAAO,QAAQ,OAAO;AAQ5B,QALuB,MAFL,gBAAgB,EAAE,EAAE,OAAO,CAEN,kBAAkB;EACvD,eAAe,KAAK;EACpB,cAAc;EACf,CAAC;;;;;;;;;;;;;;;ACDJ,MAAa,yBAAyB,OACpC,EAAE,aACF,SAAS,kBAAkB,KACxB;CACH,MAAM,kBAAkB,OAAO;AAQ/B,KAAI,CANwB,iBAAiB,UAAU,KAAK,SAAS,MAClE,WAAW,OAAO,WAAW,aAAa,OAAO,SACnD,CAKC,QAAO;AAMT,KAH4B,iBAAiB,UAAU,KAAK,SAI1D,QAAO;AAMT,SAHmB,MAAM,cAAc,OAAO,EAG5B"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import type { User } from '../../user/user.types';
|
|
1
2
|
/**
|
|
2
|
-
* Checks if device registration is required for the
|
|
3
|
+
* Checks if device registration is required for the given user.
|
|
3
4
|
*
|
|
4
|
-
* This function determines if the
|
|
5
|
+
* This function determines if the user has the deviceRegistration
|
|
5
6
|
* scope, indicating that device registration is required.
|
|
6
7
|
*
|
|
8
|
+
* @param user - The user to check.
|
|
7
9
|
* @returns True if device registration is required, false otherwise.
|
|
8
10
|
*/
|
|
9
|
-
export declare const isDeviceRegistrationRequired: (
|
|
11
|
+
export declare const isDeviceRegistrationRequired: (user: User) => boolean;
|
|
10
12
|
//# sourceMappingURL=isDeviceRegistrationRequired.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isDeviceRegistrationRequired.d.ts","sourceRoot":"","sources":["../../../../src/modules/deviceRegistration/isDeviceRegistrationRequired/isDeviceRegistrationRequired.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"isDeviceRegistrationRequired.d.ts","sourceRoot":"","sources":["../../../../src/modules/deviceRegistration/isDeviceRegistrationRequired/isDeviceRegistrationRequired.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAElD;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B,SAAU,IAAI,YACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/modules/wallets/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC,KAAK,SAAS,GAAG;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,2BAA2B,EAAE,MAAM,CAAC;IACpC,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,KAAK,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/modules/wallets/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC,KAAK,SAAS,GAAG;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,2BAA2B,EAAE,MAAM,CAAC;IACpC,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,KAAK,EAAE,SAAS,CAmFpD,CAAC"}
|