@dynamic-labs-sdk/client 0.17.1 → 0.17.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-3-1rSNtf.esm.js → InvalidParamError-C8bqZx25.esm.js} +59 -130
- package/dist/InvalidParamError-C8bqZx25.esm.js.map +1 -0
- package/dist/{InvalidParamError-zIxsXkiH.cjs.js → InvalidParamError-DvFYOkxL.cjs.js} +65 -187
- package/dist/InvalidParamError-DvFYOkxL.cjs.js.map +1 -0
- package/dist/{NotWaasWalletAccountError-DVIcEgHJ.esm.js → NotWaasWalletAccountError-C-_6uyUM.esm.js} +3 -3
- package/dist/{NotWaasWalletAccountError-DVIcEgHJ.esm.js.map → NotWaasWalletAccountError-C-_6uyUM.esm.js.map} +1 -1
- package/dist/{NotWaasWalletAccountError-B_Wl6sTh.cjs.js → NotWaasWalletAccountError-CHSFUjd9.cjs.js} +3 -3
- package/dist/{NotWaasWalletAccountError-B_Wl6sTh.cjs.js.map → NotWaasWalletAccountError-CHSFUjd9.cjs.js.map} +1 -1
- package/dist/client/core/createCore/createCore.d.ts.map +1 -1
- package/dist/client/core/types/DynamicCore.d.ts +20 -0
- package/dist/client/core/types/DynamicCore.d.ts.map +1 -1
- package/dist/client/core/types/DynamicCoreConfig.d.ts +1 -1
- package/dist/client/core/types/DynamicCoreConfig.d.ts.map +1 -1
- package/dist/client/types/DynamicClientConfig.d.ts +5 -0
- package/dist/client/types/DynamicClientConfig.d.ts.map +1 -1
- package/dist/core.cjs.js +24 -11
- package/dist/core.cjs.js.map +1 -1
- package/dist/core.esm.js +16 -6
- package/dist/core.esm.js.map +1 -1
- package/dist/exports/core.d.ts +10 -0
- package/dist/exports/core.d.ts.map +1 -1
- package/dist/{getNetworkProviderFromNetworkId-BJR1GciB.cjs.js → getNetworkProviderFromNetworkId-DK9fnM_Y.cjs.js} +432 -69
- package/dist/getNetworkProviderFromNetworkId-DK9fnM_Y.cjs.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-C7jp--76.esm.js → getNetworkProviderFromNetworkId-n7VUDpn0.esm.js} +374 -68
- package/dist/getNetworkProviderFromNetworkId-n7VUDpn0.esm.js.map +1 -0
- package/dist/{getSignedSessionId-DVpOgsL9.cjs.js → getSignedSessionId-B2-EYPik.cjs.js} +7 -17
- package/dist/getSignedSessionId-B2-EYPik.cjs.js.map +1 -0
- package/dist/{getSignedSessionId-Alfz9eul.esm.js → getSignedSessionId-CM3X3R5t.esm.js} +7 -17
- package/dist/getSignedSessionId-CM3X3R5t.esm.js.map +1 -0
- package/dist/{getVerifiedCredentialForWalletAccount-DLtDL1Gl.esm.js → getVerifiedCredentialForWalletAccount-Cs7AcMKQ.esm.js} +2 -2
- package/dist/{getVerifiedCredentialForWalletAccount-DLtDL1Gl.esm.js.map → getVerifiedCredentialForWalletAccount-Cs7AcMKQ.esm.js.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-D25Vyxub.cjs.js → getVerifiedCredentialForWalletAccount-CyLnpS2G.cjs.js} +3 -2
- package/dist/{getVerifiedCredentialForWalletAccount-D25Vyxub.cjs.js.map → getVerifiedCredentialForWalletAccount-CyLnpS2G.cjs.js.map} +1 -1
- package/dist/index.cjs.js +182 -79
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +174 -71
- package/dist/index.esm.js.map +1 -1
- package/dist/{isMfaRequiredForAction-CYYU8V1B.cjs.js → isMfaRequiredForAction-BrRKwK_i.cjs.js} +2 -2
- package/dist/{isMfaRequiredForAction-CYYU8V1B.cjs.js.map → isMfaRequiredForAction-BrRKwK_i.cjs.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-CPTFDCJp.esm.js → isMfaRequiredForAction-CM26tbT2.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-CPTFDCJp.esm.js.map → isMfaRequiredForAction-CM26tbT2.esm.js.map} +1 -1
- package/dist/modules/apiClient/apiClient.types.d.ts +7 -0
- package/dist/modules/apiClient/apiClient.types.d.ts.map +1 -1
- package/dist/modules/apiClient/constants.d.ts +2 -0
- package/dist/modules/apiClient/constants.d.ts.map +1 -1
- package/dist/modules/apiClient/createApiClient.d.ts.map +1 -1
- package/dist/modules/auth/getElevatedAccessToken/getElevatedAccessToken.d.ts +15 -8
- package/dist/modules/auth/getElevatedAccessToken/getElevatedAccessToken.d.ts.map +1 -1
- package/dist/modules/auth/logout/logout.d.ts.map +1 -1
- package/dist/modules/auth/passkeys/deletePasskey/deletePasskey.d.ts.map +1 -1
- package/dist/modules/auth/passkeys/serverRegisterPasskey/serverRegisterPasskey.d.ts.map +1 -1
- package/dist/modules/deviceRegistration/getDeviceSigner/getDeviceSigner.d.ts.map +1 -1
- package/dist/modules/initializeClient/initializeClient.d.ts.map +1 -1
- package/dist/modules/keychainMigration/migrateSessionKeyToKeychain/KeyMigrationError.d.ts +5 -0
- package/dist/modules/keychainMigration/migrateSessionKeyToKeychain/KeyMigrationError.d.ts.map +1 -0
- package/dist/modules/keychainMigration/migrateSessionKeyToKeychain/migrateSessionKeyToKeychain.d.ts +24 -0
- package/dist/modules/keychainMigration/migrateSessionKeyToKeychain/migrateSessionKeyToKeychain.d.ts.map +1 -0
- package/dist/modules/mfa/deleteMfaDevice/deleteMfaDevice.d.ts +6 -4
- package/dist/modules/mfa/deleteMfaDevice/deleteMfaDevice.d.ts.map +1 -1
- package/dist/modules/mfa/registerTotpMfaDevice/registerTotpMfaDevice.d.ts.map +1 -1
- package/dist/modules/sessionKeys/generateNonceSignature/generateNonceSignature.d.ts.map +1 -1
- package/dist/modules/sessionKeys/generateSessionKeys/generateSessionKeys.d.ts.map +1 -1
- package/dist/modules/sessionKeys/generateSessionSignature/generateSessionSignature.d.ts.map +1 -1
- package/dist/modules/sessionKeys/getSessionKeys/getSessionKeys.d.ts.map +1 -1
- package/dist/modules/sessionKeys/sessionKeys.types.d.ts +0 -2
- package/dist/modules/sessionKeys/sessionKeys.types.d.ts.map +1 -1
- package/dist/services/instrumentation/constants.d.ts +17 -0
- package/dist/services/instrumentation/constants.d.ts.map +1 -0
- package/dist/services/instrumentation/createInstrumentation/createInstrumentation.d.ts +18 -0
- package/dist/services/instrumentation/createInstrumentation/createInstrumentation.d.ts.map +1 -0
- package/dist/services/instrumentation/createInstrumentation/index.d.ts +2 -0
- package/dist/services/instrumentation/createInstrumentation/index.d.ts.map +1 -0
- package/dist/services/instrumentation/instrumentation.types.d.ts +44 -0
- package/dist/services/instrumentation/instrumentation.types.d.ts.map +1 -0
- package/dist/services/instrumentation/scrubParameters/index.d.ts +2 -0
- package/dist/services/instrumentation/scrubParameters/index.d.ts.map +1 -0
- package/dist/services/instrumentation/scrubParameters/scrubParameters.d.ts +8 -0
- package/dist/services/instrumentation/scrubParameters/scrubParameters.d.ts.map +1 -0
- package/dist/services/keychain/createIndexedDBKeychainService/KeyNotFoundError.d.ts +5 -0
- package/dist/services/keychain/createIndexedDBKeychainService/KeyNotFoundError.d.ts.map +1 -0
- package/dist/services/keychain/createIndexedDBKeychainService/createIndexedDBKeychainService.d.ts +7 -0
- package/dist/services/keychain/createIndexedDBKeychainService/createIndexedDBKeychainService.d.ts.map +1 -0
- package/dist/services/keychain/createIndexedDBKeychainService/createIndexedDBKeychainService.types.d.ts +6 -0
- package/dist/services/keychain/createIndexedDBKeychainService/createIndexedDBKeychainService.types.d.ts.map +1 -0
- package/dist/services/keychain/createIndexedDBKeychainService/index.d.ts +2 -0
- package/dist/services/keychain/createIndexedDBKeychainService/index.d.ts.map +1 -0
- package/dist/services/keychain/createIndexedDBKeychainService/utils/constants.d.ts +2 -0
- package/dist/services/keychain/createIndexedDBKeychainService/utils/constants.d.ts.map +1 -0
- package/dist/services/keychain/createIndexedDBKeychainService/utils/deleteIndexedDBItem.d.ts +2 -0
- package/dist/services/keychain/createIndexedDBKeychainService/utils/deleteIndexedDBItem.d.ts.map +1 -0
- package/dist/services/keychain/createIndexedDBKeychainService/utils/getIndexedDBItem.d.ts +3 -0
- package/dist/services/keychain/createIndexedDBKeychainService/utils/getIndexedDBItem.d.ts.map +1 -0
- package/dist/services/keychain/createIndexedDBKeychainService/utils/openDatabase.d.ts +2 -0
- package/dist/services/keychain/createIndexedDBKeychainService/utils/openDatabase.d.ts.map +1 -0
- package/dist/services/keychain/createIndexedDBKeychainService/utils/setIndexedDBItem.d.ts +3 -0
- package/dist/services/keychain/createIndexedDBKeychainService/utils/setIndexedDBItem.d.ts.map +1 -0
- package/dist/services/keychain/errors/KeychainNotConfiguredError.d.ts +5 -0
- package/dist/services/keychain/errors/KeychainNotConfiguredError.d.ts.map +1 -0
- package/dist/services/keychain/index.d.ts +3 -0
- package/dist/services/keychain/index.d.ts.map +1 -0
- package/dist/services/keychain/keychain.types.d.ts +9 -0
- package/dist/services/keychain/keychain.types.d.ts.map +1 -0
- package/dist/services/realtime/createRealtimeService/createRealtimeService.d.ts +11 -0
- package/dist/services/realtime/createRealtimeService/createRealtimeService.d.ts.map +1 -0
- package/dist/services/realtime/createRealtimeService/index.d.ts +2 -0
- package/dist/services/realtime/createRealtimeService/index.d.ts.map +1 -0
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/waas.cjs.js +4 -3
- package/dist/waas.cjs.js.map +1 -1
- package/dist/waas.esm.js +3 -3
- package/dist/waasCore.cjs.js +4 -3
- package/dist/waasCore.cjs.js.map +1 -1
- package/dist/waasCore.esm.js +3 -3
- package/package.json +2 -2
- package/dist/InvalidParamError-3-1rSNtf.esm.js.map +0 -1
- package/dist/InvalidParamError-zIxsXkiH.cjs.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-BJR1GciB.cjs.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-C7jp--76.esm.js.map +0 -1
- package/dist/getSignedSessionId-Alfz9eul.esm.js.map +0 -1
- package/dist/getSignedSessionId-DVpOgsL9.cjs.js.map +0 -1
package/dist/{isMfaRequiredForAction-CYYU8V1B.cjs.js → isMfaRequiredForAction-BrRKwK_i.cjs.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_InvalidParamError = require('./InvalidParamError-
|
|
1
|
+
const require_InvalidParamError = require('./InvalidParamError-DvFYOkxL.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-BrRKwK_i.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isMfaRequiredForAction-
|
|
1
|
+
{"version":3,"file":"isMfaRequiredForAction-BrRKwK_i.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-CPTFDCJp.esm.js → isMfaRequiredForAction-CM26tbT2.esm.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { F as getCore, T as assertDefined, j as getDefaultClient, u as createApiClient } from "./InvalidParamError-C8bqZx25.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-CM26tbT2.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isMfaRequiredForAction-
|
|
1
|
+
{"version":3,"file":"isMfaRequiredForAction-CM26tbT2.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,3 +1,4 @@
|
|
|
1
|
+
import type { TokenScope } from '@dynamic-labs/sdk-api-core';
|
|
1
2
|
/**
|
|
2
3
|
* A function that maps one error type to another.
|
|
3
4
|
*
|
|
@@ -16,6 +17,12 @@
|
|
|
16
17
|
*/
|
|
17
18
|
export type ErrorMapper = (error: Error) => Error | null;
|
|
18
19
|
export type CreateApiClientOptions = {
|
|
20
|
+
/**
|
|
21
|
+
* When set, reads the elevated access token for the given scope from
|
|
22
|
+
* client state and includes it in the `x-dyn-elevated-access-token`
|
|
23
|
+
* header. If no valid token exists for the scope, the header is omitted.
|
|
24
|
+
*/
|
|
25
|
+
elevatedAccessTokenScope?: TokenScope;
|
|
19
26
|
/**
|
|
20
27
|
* Array of error mappers that will be applied to API errors in order.
|
|
21
28
|
* Each mapper can transform an error into a different error type or return null to skip transformation.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiClient.types.d.ts","sourceRoot":"","sources":["../../../src/modules/apiClient/apiClient.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,KAAK,GAAG,IAAI,CAAC;AAEzD,MAAM,MAAM,sBAAsB,GAAG;IACnC;;;;;;;;;;;;;OAaG;IACH,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAE7B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEjC;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC"}
|
|
1
|
+
{"version":3,"file":"apiClient.types.d.ts","sourceRoot":"","sources":["../../../src/modules/apiClient/apiClient.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE7D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,KAAK,GAAG,IAAI,CAAC;AAEzD,MAAM,MAAM,sBAAsB,GAAG;IACnC;;;;OAIG;IACH,wBAAwB,CAAC,EAAE,UAAU,CAAC;IAEtC;;;;;;;;;;;;;OAaG;IACH,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAE7B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEjC;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export declare const DYNAMIC_API_VERSION_HEADER = "x-dyn-api-version";
|
|
2
2
|
export declare const DYNAMIC_REQUEST_ID_HEADER = "x-dyn-request-id";
|
|
3
3
|
export declare const DYNAMIC_SDK_VERSION_HEADER = "x-dyn-version";
|
|
4
|
+
export declare const ELEVATED_ACCESS_TOKEN_HEADER = "x-dyn-elevated-access-token";
|
|
4
5
|
export declare const MFA_TOKEN_HEADER = "x-mfa-auth-token";
|
|
5
6
|
export declare const SESSION_PUBLIC_KEY_HEADER = "x-dyn-session-public-key";
|
|
6
7
|
export declare const DYNAMIC_SDK_API_VERSION: string;
|
|
8
|
+
export declare const DYNAMIC_SDK_SESSION_ID_HEADER = "x-dyn-session-id";
|
|
7
9
|
export declare const CLIENT_SDK_NAME = "ClientSDK";
|
|
8
10
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/modules/apiClient/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,0BAA0B,sBAAsB,CAAC;AAE9D,eAAO,MAAM,yBAAyB,qBAAqB,CAAC;AAE5D,eAAO,MAAM,0BAA0B,kBAAkB,CAAC;AAE1D,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AAEnD,eAAO,MAAM,yBAAyB,6BAA6B,CAAC;AAEpE,eAAO,MAAM,uBAAuB,QACQ,CAAC;AAE7C,eAAO,MAAM,eAAe,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/modules/apiClient/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,0BAA0B,sBAAsB,CAAC;AAE9D,eAAO,MAAM,yBAAyB,qBAAqB,CAAC;AAE5D,eAAO,MAAM,0BAA0B,kBAAkB,CAAC;AAE1D,eAAO,MAAM,4BAA4B,gCAAgC,CAAC;AAE1E,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AAEnD,eAAO,MAAM,yBAAyB,6BAA6B,CAAC;AAEpE,eAAO,MAAM,uBAAuB,QACQ,CAAC;AAE7C,eAAO,MAAM,6BAA6B,qBAAqB,CAAC;AAEhE,eAAO,MAAM,eAAe,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createApiClient.d.ts","sourceRoot":"","sources":["../../../src/modules/apiClient/createApiClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAInE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAIxD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"createApiClient.d.ts","sourceRoot":"","sources":["../../../src/modules/apiClient/createApiClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAInE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAIxD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAkChE;;;;GAIG;AACH,eAAO,MAAM,eAAe,YACjB,sBAAsB,sBACvB,aAAa,WAgEtB,CAAC"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
type GetElevatedAccessTokenParams = {
|
|
2
|
+
/**
|
|
3
|
+
* Whether to consume single-use tokens after retrieval.
|
|
4
|
+
* Set to `false` to check for token existence without side-effects.
|
|
5
|
+
* @default true
|
|
6
|
+
*/
|
|
7
|
+
consume?: boolean;
|
|
2
8
|
scope: string;
|
|
3
9
|
};
|
|
4
10
|
/**
|
|
@@ -7,24 +13,25 @@ type GetElevatedAccessTokenParams = {
|
|
|
7
13
|
* This function retrieves an elevated access token that contains the specified scope.
|
|
8
14
|
* Expired tokens are automatically filtered out.
|
|
9
15
|
*
|
|
10
|
-
*
|
|
11
|
-
* consumed (removed from state) after retrieval.
|
|
12
|
-
* for
|
|
16
|
+
* By default, if the token has `singleUse: true`, it will be automatically
|
|
17
|
+
* consumed (removed from state) after retrieval. Pass `consume: false` to
|
|
18
|
+
* check for token existence without consuming it.
|
|
13
19
|
*
|
|
14
20
|
* @param params - The parameters object.
|
|
15
21
|
* @param params.scope - The scope to match (e.g., 'wallet:export').
|
|
22
|
+
* @param params.consume - Whether to consume single-use tokens (default: true).
|
|
16
23
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
17
24
|
* @returns The elevated access token if found and not expired, or undefined if not found or expired.
|
|
18
25
|
*
|
|
19
26
|
* @example
|
|
20
27
|
* ```typescript
|
|
28
|
+
* // Retrieve and consume (default)
|
|
21
29
|
* const token = getElevatedAccessToken({ scope: 'wallet:export' });
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* }
|
|
30
|
+
*
|
|
31
|
+
* // Check existence without consuming
|
|
32
|
+
* const token = getElevatedAccessToken({ scope: 'credential:unlink', consume: false });
|
|
26
33
|
* ```
|
|
27
34
|
*/
|
|
28
|
-
export declare const getElevatedAccessToken: ({ scope }: GetElevatedAccessTokenParams, client?: import("../../../exports").DynamicClient) => string | undefined;
|
|
35
|
+
export declare const getElevatedAccessToken: ({ consume, scope }: GetElevatedAccessTokenParams, client?: import("../../../exports").DynamicClient) => string | undefined;
|
|
29
36
|
export {};
|
|
30
37
|
//# sourceMappingURL=getElevatedAccessToken.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getElevatedAccessToken.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/getElevatedAccessToken/getElevatedAccessToken.ts"],"names":[],"mappings":"AAGA,KAAK,4BAA4B,GAAG;IAClC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"getElevatedAccessToken.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/getElevatedAccessToken/getElevatedAccessToken.ts"],"names":[],"mappings":"AAGA,KAAK,4BAA4B,GAAG;IAClC;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,sBAAsB,uBACN,4BAA4B,wDAEtD,MAAM,GAAG,SAiCX,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logout.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/logout/logout.ts"],"names":[],"mappings":"AAWA;;;;;GAKG;AACH,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"logout.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/logout/logout.ts"],"names":[],"mappings":"AAWA;;;;;GAKG;AACH,eAAO,MAAM,MAAM,sEAkDlB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deletePasskey.d.ts","sourceRoot":"","sources":["../../../../../src/modules/auth/passkeys/deletePasskey/deletePasskey.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deletePasskey.d.ts","sourceRoot":"","sources":["../../../../../src/modules/auth/passkeys/deletePasskey/deletePasskey.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,kBACT;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,2DAEnC,OAAO,CAAC,IAAI,CAgBd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serverRegisterPasskey.d.ts","sourceRoot":"","sources":["../../../../../src/modules/auth/passkeys/serverRegisterPasskey/serverRegisterPasskey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"serverRegisterPasskey.d.ts","sourceRoot":"","sources":["../../../../../src/modules/auth/passkeys/serverRegisterPasskey/serverRegisterPasskey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAGxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAG9D,KAAK,2BAA2B,GAAG;IACjC,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,YAAY,EAAE,wBAAwB,CAAC;CACxC,CAAC;AAEF,eAAO,MAAM,qBAAqB,qCACE,2BAA2B,UACrD,aAAa,iEAuBtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDeviceSigner.d.ts","sourceRoot":"","sources":["../../../../src/modules/deviceRegistration/getDeviceSigner/getDeviceSigner.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"getDeviceSigner.d.ts","sourceRoot":"","sources":["../../../../src/modules/deviceRegistration/getDeviceSigner/getDeviceSigner.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAEnE,eAAO,MAAM,eAAe,WAClB,aAAa,KACpB,OAAO,CAAC,YAAY,CAuBtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initializeClient.d.ts","sourceRoot":"","sources":["../../../src/modules/initializeClient/initializeClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"initializeClient.d.ts","sourceRoot":"","sources":["../../../src/modules/initializeClient/initializeClient.ts"],"names":[],"mappings":"AAsBA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB,mEAuI5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyMigrationError.d.ts","sourceRoot":"","sources":["../../../../src/modules/keychainMigration/migrateSessionKeyToKeychain/KeyMigrationError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,qBAAa,iBAAkB,SAAQ,SAAS;gBAClC,iBAAiB,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM;CASjE"}
|
package/dist/modules/keychainMigration/migrateSessionKeyToKeychain/migrateSessionKeyToKeychain.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { DynamicCoreState } from '../../../client/core/types';
|
|
2
|
+
import type { KeychainService } from '../../../services/keychain';
|
|
3
|
+
import type { Logger } from '../../../services/logger';
|
|
4
|
+
import type { Storage } from '../../../services/storage/storage.types';
|
|
5
|
+
import type { ObservableState } from '../../../utils/observable/observable.types';
|
|
6
|
+
type MigrateSessionKeyToKeychainParams = {
|
|
7
|
+
keychain: KeychainService;
|
|
8
|
+
logger: Logger;
|
|
9
|
+
state: ObservableState<DynamicCoreState>;
|
|
10
|
+
storage: Storage;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Migrates legacy session keys from the hydrated state into the IndexedDB keychain
|
|
14
|
+
* as non-extractable CryptoKey objects.
|
|
15
|
+
*
|
|
16
|
+
* Must run after hydrateStateWithStorage so that state.sessionKeys already holds
|
|
17
|
+
* the legacy base64 blob (or the new public key hex if already migrated).
|
|
18
|
+
*
|
|
19
|
+
* Idempotent: skips if the keychain already has a `session` key.
|
|
20
|
+
* Throws on failure — callers should handle errors (e.g. .catch(() => logout(client))).
|
|
21
|
+
*/
|
|
22
|
+
export declare const migrateSessionKeyToKeychain: ({ keychain, logger, state, storage, }: MigrateSessionKeyToKeychainParams) => Promise<void>;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=migrateSessionKeyToKeychain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrateSessionKeyToKeychain.d.ts","sourceRoot":"","sources":["../../../../src/modules/keychainMigration/migrateSessionKeyToKeychain/migrateSessionKeyToKeychain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AAGvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AASlF,KAAK,iCAAiC,GAAG;IACvC,QAAQ,EAAE,eAAe,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC;IACzC,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,2BAA2B,0CAKrC,iCAAiC,KAAG,OAAO,CAAC,IAAI,CAmElD,CAAC"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
type DeleteMfaDeviceParams = {
|
|
2
2
|
deviceId: string;
|
|
3
|
-
mfaAuthToken
|
|
3
|
+
mfaAuthToken?: string;
|
|
4
4
|
};
|
|
5
5
|
/**
|
|
6
6
|
* Deletes a specific MFA device from the user's account.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* When an elevated access token for `credential:unlink` is available,
|
|
9
|
+
* it is sent via the `x-dyn-elevated-access-token` header and the
|
|
10
|
+
* MFA auth token is not required. Otherwise, `mfaAuthToken` must be
|
|
11
|
+
* provided for backward compatibility with the legacy MFA flow.
|
|
10
12
|
*
|
|
11
13
|
* @param params.deviceId - The unique identifier of the MFA device to delete.
|
|
12
|
-
* @param params.mfaAuthToken - The MFA authentication token
|
|
14
|
+
* @param params.mfaAuthToken - The MFA authentication token. Optional when using elevated access tokens.
|
|
13
15
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
14
16
|
* @returns A promise that resolves when the MFA device is successfully deleted.
|
|
15
17
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deleteMfaDevice.d.ts","sourceRoot":"","sources":["../../../../src/modules/mfa/deleteMfaDevice/deleteMfaDevice.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deleteMfaDevice.d.ts","sourceRoot":"","sources":["../../../../src/modules/mfa/deleteMfaDevice/deleteMfaDevice.ts"],"names":[],"mappings":"AAQA,KAAK,qBAAqB,GAAG;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,+BACE,qBAAqB,qEA+BlD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerTotpMfaDevice.d.ts","sourceRoot":"","sources":["../../../../src/modules/mfa/registerTotpMfaDevice/registerTotpMfaDevice.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registerTotpMfaDevice.d.ts","sourceRoot":"","sources":["../../../../src/modules/mfa/registerTotpMfaDevice/registerTotpMfaDevice.ts"],"names":[],"mappings":"AAMA;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,uIAUjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateNonceSignature.d.ts","sourceRoot":"","sources":["../../../../src/modules/sessionKeys/generateNonceSignature/generateNonceSignature.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generateNonceSignature.d.ts","sourceRoot":"","sources":["../../../../src/modules/sessionKeys/generateNonceSignature/generateNonceSignature.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAG3D,KAAK,4BAA4B,GAAG;IAClC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,sBAAsB,cACtB,4BAA4B,UAC/B,aAAa;;EAStB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateSessionKeys.d.ts","sourceRoot":"","sources":["../../../../src/modules/sessionKeys/generateSessionKeys/generateSessionKeys.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"generateSessionKeys.d.ts","sourceRoot":"","sources":["../../../../src/modules/sessionKeys/generateSessionKeys/generateSessionKeys.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,eAAO,MAAM,mBAAmB,WACtB,aAAa,KACpB,OAAO,CAAC,WAAW,CAUrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateSessionSignature.d.ts","sourceRoot":"","sources":["../../../../src/modules/sessionKeys/generateSessionSignature/generateSessionSignature.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generateSessionSignature.d.ts","sourceRoot":"","sources":["../../../../src/modules/sessionKeys/generateSessionSignature/generateSessionSignature.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,KAAK,8BAA8B,GAAG;IACpC,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,wBAAwB,kBACpB,8BAA8B,UACrC,aAAa;;EAOtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSessionKeys.d.ts","sourceRoot":"","sources":["../../../../src/modules/sessionKeys/getSessionKeys/getSessionKeys.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"getSessionKeys.d.ts","sourceRoot":"","sources":["../../../../src/modules/sessionKeys/getSessionKeys/getSessionKeys.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,eAAO,MAAM,cAAc,WAAY,aAAa,KAAG,WAAW,GAAG,SAUpE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessionKeys.types.d.ts","sourceRoot":"","sources":["../../../src/modules/sessionKeys/sessionKeys.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IACxB,
|
|
1
|
+
{"version":3,"file":"sessionKeys.types.d.ts","sourceRoot":"","sources":["../../../src/modules/sessionKeys/sessionKeys.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IACxB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const DEFAULT_PII_FIELDS: string[];
|
|
2
|
+
export declare const REDACTED_VALUE = "[REDACTED]";
|
|
3
|
+
export declare const MAX_STRING_LENGTH = 500;
|
|
4
|
+
export declare const TRUNCATED_SUFFIX = "...[truncated]";
|
|
5
|
+
/**
|
|
6
|
+
* Label prefix for binary data placeholders. The full placeholder includes the
|
|
7
|
+
* byte length, e.g. `[Binary:16 bytes]`, so consumers can gauge data size
|
|
8
|
+
* without the actual bytes appearing in logs.
|
|
9
|
+
*/
|
|
10
|
+
export declare const BINARY_LABEL = "Binary";
|
|
11
|
+
/**
|
|
12
|
+
* Placeholder emitted when a circular reference is detected in the value tree.
|
|
13
|
+
* Using a named constant makes it easy to search for or filter in downstream
|
|
14
|
+
* log tooling.
|
|
15
|
+
*/
|
|
16
|
+
export declare const CIRCULAR_VALUE = "[Circular]";
|
|
17
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/services/instrumentation/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,UAY9B,CAAC;AAEF,eAAO,MAAM,cAAc,eAAe,CAAC;AAE3C,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC,eAAO,MAAM,gBAAgB,mBAAmB,CAAC;AAEjD;;;;GAIG;AACH,eAAO,MAAM,YAAY,WAAW,CAAC;AAErC;;;;GAIG;AACH,eAAO,MAAM,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Instrumentation, InstrumentationConfig } from '../instrumentation.types';
|
|
2
|
+
type CreateInstrumentationParams = {
|
|
3
|
+
config?: Partial<InstrumentationConfig>;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Creates the instrumentation service that gates event emission behind an
|
|
7
|
+
* enabled flag and delegates to a pluggable transport.
|
|
8
|
+
*
|
|
9
|
+
* The transport is intentionally optional at creation time — it is wired in
|
|
10
|
+
* later via setTransport so the SDK can initialise without one. Events logged
|
|
11
|
+
* before a transport is set are simply dropped.
|
|
12
|
+
*
|
|
13
|
+
* Custom piiFields are merged with and deduplicated against the defaults so
|
|
14
|
+
* callers only need to list additional fields, not replicate the baseline.
|
|
15
|
+
*/
|
|
16
|
+
export declare const createInstrumentation: ({ config: inputConfig, }?: CreateInstrumentationParams) => Instrumentation;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=createInstrumentation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createInstrumentation.d.ts","sourceRoot":"","sources":["../../../../src/services/instrumentation/createInstrumentation/createInstrumentation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,eAAe,EACf,qBAAqB,EAEtB,MAAM,0BAA0B,CAAC;AAElC,KAAK,2BAA2B,GAAG;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACzC,CAAC;AAQF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB,8BAE/B,2BAA2B,KAAQ,eAsBrC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/instrumentation/createInstrumentation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export type InstrumentationEventPhase = 'started' | 'resolved' | 'rejected';
|
|
2
|
+
/**
|
|
3
|
+
* A single telemetry record emitted by instrumentFunction for each phase of
|
|
4
|
+
* a function call (started, resolved, rejected).
|
|
5
|
+
*
|
|
6
|
+
* All string values that match piiFields are redacted before this event is
|
|
7
|
+
* constructed, so it is safe to forward to an external transport.
|
|
8
|
+
*/
|
|
9
|
+
export type InstrumentationEvent = {
|
|
10
|
+
callerChain: string[];
|
|
11
|
+
environmentId: string;
|
|
12
|
+
functionName: string;
|
|
13
|
+
isExternalCall: boolean;
|
|
14
|
+
parameters: Record<string, unknown>;
|
|
15
|
+
phase: InstrumentationEventPhase;
|
|
16
|
+
rejectedError?: Error;
|
|
17
|
+
resolvedValue?: unknown;
|
|
18
|
+
sdkSessionId: string;
|
|
19
|
+
sdkVersion: string;
|
|
20
|
+
timestamp: string;
|
|
21
|
+
tokenSessionId: string | null;
|
|
22
|
+
userAgent: string;
|
|
23
|
+
userId: string | null;
|
|
24
|
+
};
|
|
25
|
+
export type InstrumentationConfig = {
|
|
26
|
+
enabled: boolean;
|
|
27
|
+
piiFields: string[];
|
|
28
|
+
};
|
|
29
|
+
/** Pluggable sink that receives fully-scrubbed events for forwarding. */
|
|
30
|
+
export type InstrumentationTransport = {
|
|
31
|
+
log: (event: InstrumentationEvent) => void;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* The instrumentation service instance held on DynamicCore.
|
|
35
|
+
* Acts as a gatekeeper: events are only forwarded to the transport when
|
|
36
|
+
* enabled, and the transport can be swapped at any time without restarting.
|
|
37
|
+
*/
|
|
38
|
+
export type Instrumentation = {
|
|
39
|
+
config: InstrumentationConfig;
|
|
40
|
+
log: (event: InstrumentationEvent) => void;
|
|
41
|
+
setEnabled: (enabled: boolean) => void;
|
|
42
|
+
setTransport: (transport: InstrumentationTransport) => void;
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=instrumentation.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instrumentation.types.d.ts","sourceRoot":"","sources":["../../../src/services/instrumentation/instrumentation.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,yBAAyB,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAE5E;;;;;;GAMG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,KAAK,EAAE,yBAAyB,CAAC;IACjC,aAAa,CAAC,EAAE,KAAK,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAEF,yEAAyE;AACzE,MAAM,MAAM,wBAAwB,GAAG;IACrC,GAAG,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAC;CAC5C,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,qBAAqB,CAAC;IAC9B,GAAG,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC3C,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,YAAY,EAAE,CAAC,SAAS,EAAE,wBAAwB,KAAK,IAAI,CAAC;CAC7D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/instrumentation/scrubParameters/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type ScrubParametersParams = {
|
|
2
|
+
piiFields: string[];
|
|
3
|
+
redactAll?: boolean;
|
|
4
|
+
value: Record<string, unknown>;
|
|
5
|
+
};
|
|
6
|
+
export declare const scrubParameters: ({ piiFields, redactAll, value, }: ScrubParametersParams) => Record<string, unknown>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=scrubParameters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scrubParameters.d.ts","sourceRoot":"","sources":["../../../../src/services/instrumentation/scrubParameters/scrubParameters.ts"],"names":[],"mappings":"AAcA,KAAK,qBAAqB,GAAG;IAC3B,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC,CAAC;AA0KF,eAAO,MAAM,eAAe,qCAIzB,qBAAqB,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAQhD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyNotFoundError.d.ts","sourceRoot":"","sources":["../../../../src/services/keychain/createIndexedDBKeychainService/KeyNotFoundError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,qBAAa,gBAAiB,SAAQ,SAAS;gBACjC,OAAO,EAAE,MAAM;CAS5B"}
|
package/dist/services/keychain/createIndexedDBKeychainService/createIndexedDBKeychainService.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { KeychainService } from '../keychain.types';
|
|
2
|
+
type CreateIndexedDBKeychainServiceParams = {
|
|
3
|
+
dbName?: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const createIndexedDBKeychainService: (params?: CreateIndexedDBKeychainServiceParams) => KeychainService;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=createIndexedDBKeychainService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createIndexedDBKeychainService.d.ts","sourceRoot":"","sources":["../../../../src/services/keychain/createIndexedDBKeychainService/createIndexedDBKeychainService.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAOzD,KAAK,oCAAoC,GAAG;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAIF,eAAO,MAAM,8BAA8B,YAChC,oCAAoC,KAC5C,eAwHF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createIndexedDBKeychainService.types.d.ts","sourceRoot":"","sources":["../../../../src/services/keychain/createIndexedDBKeychainService/createIndexedDBKeychainService.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,SAAS,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/keychain/createIndexedDBKeychainService/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/services/keychain/createIndexedDBKeychainService/utils/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,SAAS,CAAC"}
|
package/dist/services/keychain/createIndexedDBKeychainService/utils/deleteIndexedDBItem.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deleteIndexedDBItem.d.ts","sourceRoot":"","sources":["../../../../../src/services/keychain/createIndexedDBKeychainService/utils/deleteIndexedDBItem.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,OAC1B,WAAW,WACN,MAAM,KACd,OAAO,CAAC,IAAI,CAQX,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getIndexedDBItem.d.ts","sourceRoot":"","sources":["../../../../../src/services/keychain/createIndexedDBKeychainService/utils/getIndexedDBItem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,eAAO,MAAM,gBAAgB,OACvB,WAAW,WACN,MAAM,KACd,OAAO,CAAC,SAAS,GAAG,SAAS,CAQ5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openDatabase.d.ts","sourceRoot":"","sources":["../../../../../src/services/keychain/createIndexedDBKeychainService/utils/openDatabase.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,WAAY,MAAM,KAAG,OAAO,CAAC,WAAW,CAc7D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setIndexedDBItem.d.ts","sourceRoot":"","sources":["../../../../../src/services/keychain/createIndexedDBKeychainService/utils/setIndexedDBItem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,eAAO,MAAM,gBAAgB,OACvB,WAAW,SACR,SAAS,KACf,OAAO,CAAC,IAAI,CAQX,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeychainNotConfiguredError.d.ts","sourceRoot":"","sources":["../../../../src/services/keychain/errors/KeychainNotConfiguredError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,qBAAa,0BAA2B,SAAQ,SAAS;;CAUxD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/keychain/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type KeychainService = {
|
|
2
|
+
generateKey(keyName: string): Promise<string>;
|
|
3
|
+
getPublicKey(keyName: string): Promise<string | null>;
|
|
4
|
+
hasKey(keyName: string): Promise<boolean>;
|
|
5
|
+
importKey(keyName: string, jwk: JsonWebKey): Promise<string>;
|
|
6
|
+
removeKey(keyName: string): Promise<void>;
|
|
7
|
+
sign(keyName: string, message: string): Promise<string>;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=keychain.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keychain.types.d.ts","sourceRoot":"","sources":["../../../src/services/keychain/keychain.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC5B,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC9C,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACtD,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1C,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7D,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACzD,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RealtimeService } from '../realtime.types';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a realtime pub/sub service backed by Ably.
|
|
4
|
+
*
|
|
5
|
+
* The service starts idle. Call `connect({ client })` to establish
|
|
6
|
+
* a connection, passing the DynamicClient explicitly.
|
|
7
|
+
*
|
|
8
|
+
* SSR environments receive a no-op implementation.
|
|
9
|
+
*/
|
|
10
|
+
export declare const createRealtimeService: () => RealtimeService;
|
|
11
|
+
//# sourceMappingURL=createRealtimeService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createRealtimeService.d.ts","sourceRoot":"","sources":["../../../../src/services/realtime/createRealtimeService/createRealtimeService.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAIV,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAgB3B;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,QAAO,eA6LxC,CAAC"}
|