@dynamic-labs-sdk/client 0.23.4 → 0.24.0
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-D2mY6bDm.cjs.js → InvalidParamError-BgmShvv_.cjs.js} +9 -5
- package/dist/{InvalidParamError-D2mY6bDm.cjs.js.map → InvalidParamError-BgmShvv_.cjs.js.map} +1 -1
- package/dist/{InvalidParamError-DQNvDHoJ.esm.js → InvalidParamError-kLBXFKhe.esm.js} +8 -4
- package/dist/{InvalidParamError-DQNvDHoJ.esm.js.map → InvalidParamError-kLBXFKhe.esm.js.map} +1 -1
- package/dist/{NotWaasWalletAccountError-BycDPZE7.esm.js → NotWaasWalletAccountError-VJL72OTC.esm.js} +3 -3
- package/dist/{NotWaasWalletAccountError-BycDPZE7.esm.js.map → NotWaasWalletAccountError-VJL72OTC.esm.js.map} +1 -1
- package/dist/{NotWaasWalletAccountError-DKt-e0jp.cjs.js → NotWaasWalletAccountError-qK9GIBpr.cjs.js} +3 -3
- package/dist/{NotWaasWalletAccountError-DKt-e0jp.cjs.js.map → NotWaasWalletAccountError-qK9GIBpr.cjs.js.map} +1 -1
- package/dist/core.cjs.js +6 -29
- package/dist/core.cjs.js.map +1 -1
- package/dist/core.esm.js +5 -28
- package/dist/core.esm.js.map +1 -1
- package/dist/exports/index.d.ts +3 -0
- package/dist/exports/index.d.ts.map +1 -1
- package/dist/{getNetworkProviderFromNetworkId-BZ0Yi99m.cjs.js → getNetworkProviderFromNetworkId-B8OjAdet.cjs.js} +32 -3
- package/dist/getNetworkProviderFromNetworkId-B8OjAdet.cjs.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-Ck4qXPsJ.esm.js → getNetworkProviderFromNetworkId-RlnraKJN.esm.js} +27 -4
- package/dist/getNetworkProviderFromNetworkId-RlnraKJN.esm.js.map +1 -0
- package/dist/{getSignedSessionId-lg-rT8W_.esm.js → getSignedSessionId-CvNFnwt1.esm.js} +3 -3
- package/dist/{getSignedSessionId-lg-rT8W_.esm.js.map → getSignedSessionId-CvNFnwt1.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-oiCgC33U.cjs.js → getSignedSessionId-DBQS7lht.cjs.js} +3 -3
- package/dist/{getSignedSessionId-oiCgC33U.cjs.js.map → getSignedSessionId-DBQS7lht.cjs.js.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-C2m6GufK.esm.js → getVerifiedCredentialForWalletAccount-8VlwTOBc.esm.js} +2 -2
- package/dist/{getVerifiedCredentialForWalletAccount-C2m6GufK.esm.js.map → getVerifiedCredentialForWalletAccount-8VlwTOBc.esm.js.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-6iZSd5T2.cjs.js → getVerifiedCredentialForWalletAccount-CBJrrV08.cjs.js} +3 -3
- package/dist/{getVerifiedCredentialForWalletAccount-6iZSd5T2.cjs.js.map → getVerifiedCredentialForWalletAccount-CBJrrV08.cjs.js.map} +1 -1
- package/dist/index.cjs.js +114 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +114 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/{isMfaRequiredForAction-DqZS12dt.esm.js → isMfaRequiredForAction-8NlpzYe6.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-DqZS12dt.esm.js.map → isMfaRequiredForAction-8NlpzYe6.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-DRetUSWZ.cjs.js → isMfaRequiredForAction-9NDyQhHS.cjs.js} +2 -2
- package/dist/{isMfaRequiredForAction-DRetUSWZ.cjs.js.map → isMfaRequiredForAction-9NDyQhHS.cjs.js.map} +1 -1
- package/dist/modules/checkout/createCheckoutTransaction/createCheckoutTransaction.d.ts.map +1 -1
- package/dist/modules/checkout/events.d.ts +27 -0
- package/dist/modules/checkout/events.d.ts.map +1 -0
- package/dist/modules/checkout/trackCheckoutTransaction/index.d.ts +3 -0
- package/dist/modules/checkout/trackCheckoutTransaction/index.d.ts.map +1 -0
- package/dist/modules/checkout/trackCheckoutTransaction/trackCheckoutTransaction.d.ts +15 -0
- package/dist/modules/checkout/trackCheckoutTransaction/trackCheckoutTransaction.d.ts.map +1 -0
- package/dist/modules/checkout/utils/createCheckoutTransactionChannelSchema/createCheckoutTransactionChannelSchema.d.ts +28 -0
- package/dist/modules/checkout/utils/createCheckoutTransactionChannelSchema/createCheckoutTransactionChannelSchema.d.ts.map +1 -0
- package/dist/modules/checkout/utils/createCheckoutTransactionChannelSchema/index.d.ts +3 -0
- package/dist/modules/checkout/utils/createCheckoutTransactionChannelSchema/index.d.ts.map +1 -0
- package/dist/modules/checkout/utils/subscribeToCheckoutTransaction/index.d.ts +3 -0
- package/dist/modules/checkout/utils/subscribeToCheckoutTransaction/index.d.ts.map +1 -0
- package/dist/modules/checkout/utils/subscribeToCheckoutTransaction/subscribeToCheckoutTransaction.d.ts +15 -0
- package/dist/modules/checkout/utils/subscribeToCheckoutTransaction/subscribeToCheckoutTransaction.d.ts.map +1 -0
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/utils/getNonce/fetchAndStoreNonces/fetchAndStoreNonces.d.ts +4 -1
- package/dist/utils/getNonce/fetchAndStoreNonces/fetchAndStoreNonces.d.ts.map +1 -1
- package/dist/waas.cjs.js +4 -4
- package/dist/waas.esm.js +3 -3
- package/dist/waasCore.cjs.js +4 -4
- package/dist/waasCore.esm.js +3 -3
- package/package.json +3 -3
- package/dist/getNetworkProviderFromNetworkId-BZ0Yi99m.cjs.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-Ck4qXPsJ.esm.js.map +0 -1
package/dist/{isMfaRequiredForAction-DqZS12dt.esm.js → isMfaRequiredForAction-8NlpzYe6.esm.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as getDefaultClient, k as assertDefined, u as __createApiClient_wrapped, w as instrumentFunction, z as getCore } from "./InvalidParamError-
|
|
1
|
+
import { F as getDefaultClient, k as assertDefined, u as __createApiClient_wrapped, w as instrumentFunction, z as getCore } from "./InvalidParamError-kLBXFKhe.esm.js";
|
|
2
2
|
|
|
3
3
|
//#region src/modules/mfa/consumeMfaToken/consumeMfaToken.ts
|
|
4
4
|
/**
|
|
@@ -86,4 +86,4 @@ const isMfaRequiredForAction = async ({ mfaAction }, client = getDefaultClient()
|
|
|
86
86
|
|
|
87
87
|
//#endregion
|
|
88
88
|
export { __getMfaMethods_wrapped as n, __consumeMfaToken_wrapped as r, isMfaRequiredForAction as t };
|
|
89
|
-
//# sourceMappingURL=isMfaRequiredForAction-
|
|
89
|
+
//# sourceMappingURL=isMfaRequiredForAction-8NlpzYe6.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isMfaRequiredForAction-
|
|
1
|
+
{"version":3,"file":"isMfaRequiredForAction-8NlpzYe6.esm.js","names":["getMfaMethods"],"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 * @instrumented\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 * @instrumented\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 * @not-instrumented\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":";;;;;;;;;;;;;;AAkBA,MAAE,mBAAsB,SAAU,kBAAU,KAAA;;;AAK1C,eAAY,UAAI,qBAAA;kBAGhB,UAAO,MACR,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CCTC,MAAM,OAAA,QAAe,OAAO;QAG1B,MAFe,0BAAK,EAAa,EAAA,OAAA,CAEjC,kBAAA;;EAEF,cAAO;EACR,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACJD,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,MAAMA,wBAAc,OAAO,EAG5B"}
|
package/dist/{isMfaRequiredForAction-DRetUSWZ.cjs.js → isMfaRequiredForAction-9NDyQhHS.cjs.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_InvalidParamError = require('./InvalidParamError-
|
|
1
|
+
const require_InvalidParamError = require('./InvalidParamError-BgmShvv_.cjs.js');
|
|
2
2
|
|
|
3
3
|
//#region src/modules/mfa/consumeMfaToken/consumeMfaToken.ts
|
|
4
4
|
/**
|
|
@@ -103,4 +103,4 @@ Object.defineProperty(exports, 'isMfaRequiredForAction', {
|
|
|
103
103
|
return isMfaRequiredForAction;
|
|
104
104
|
}
|
|
105
105
|
});
|
|
106
|
-
//# sourceMappingURL=isMfaRequiredForAction-
|
|
106
|
+
//# sourceMappingURL=isMfaRequiredForAction-9NDyQhHS.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isMfaRequiredForAction-
|
|
1
|
+
{"version":3,"file":"isMfaRequiredForAction-9NDyQhHS.cjs.js","names":["getDefaultClient","getMfaMethods"],"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 * @instrumented\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 * @instrumented\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 * @not-instrumented\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":";;;;;;;;;;;;;;AAkBA,MAAE,mBAAsB,SAAU,4CAAU,KAAA;;;AAK1C,yCAAY,UAAI,qBAAA;kBAGhB,UAAO,MACR,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CCTC,MAAM,OAAA,kCAAe,OAAO;QAG1B,MAFe,oDAAK,EAAa,EAAA,OAAA,CAEjC,kBAAA;;EAEF,cAAO;EACR,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACJD,MAAa,yBAAyB,OACpC,EAAE,aACF,SAASA,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,MAAMC,wBAAc,OAAO,EAG5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createCheckoutTransaction.d.ts","sourceRoot":"","sources":["../../../../src/modules/checkout/createCheckoutTransaction/createCheckoutTransaction.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAG3D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"createCheckoutTransaction.d.ts","sourceRoot":"","sources":["../../../../src/modules/checkout/createCheckoutTransaction/createCheckoutTransaction.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAG3D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,mBAAmB,CAAC;AAK3E,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,WAC5B,+BAA+B,WAC/B,aAAa,KACpB,OAAO,CAAC,iCAAiC,CAgD3C,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { CheckoutExecutionState, CheckoutSettlementState } from './checkout.types';
|
|
2
|
+
type CheckoutTransactionSettlementStateChangedEvent = {
|
|
3
|
+
newState: CheckoutSettlementState;
|
|
4
|
+
previousState: CheckoutSettlementState;
|
|
5
|
+
timestamp: string;
|
|
6
|
+
transactionId: string;
|
|
7
|
+
};
|
|
8
|
+
type CheckoutTransactionExecutionStateChangedEvent = {
|
|
9
|
+
newState: CheckoutExecutionState;
|
|
10
|
+
previousState: CheckoutExecutionState;
|
|
11
|
+
timestamp: string;
|
|
12
|
+
transactionId: string;
|
|
13
|
+
};
|
|
14
|
+
declare global {
|
|
15
|
+
interface DynamicEvents {
|
|
16
|
+
/**
|
|
17
|
+
* Raised when a checkout transaction's execution state changes.
|
|
18
|
+
*/
|
|
19
|
+
checkoutTransactionExecutionStateChanged: (args: CheckoutTransactionExecutionStateChangedEvent) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Raised when a checkout transaction's settlement state changes.
|
|
22
|
+
*/
|
|
23
|
+
checkoutTransactionSettlementStateChanged: (args: CheckoutTransactionSettlementStateChangedEvent) => void;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export type { CheckoutTransactionExecutionStateChangedEvent, CheckoutTransactionSettlementStateChangedEvent, };
|
|
27
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/modules/checkout/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,kBAAkB,CAAC;AAE1B,KAAK,8CAA8C,GAAG;IACpD,QAAQ,EAAE,uBAAuB,CAAC;IAClC,aAAa,EAAE,uBAAuB,CAAC;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,KAAK,6CAA6C,GAAG;IACnD,QAAQ,EAAE,sBAAsB,CAAC;IACjC,aAAa,EAAE,sBAAsB,CAAC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,aAAa;QACrB;;WAEG;QACH,wCAAwC,EAAE,CACxC,IAAI,EAAE,6CAA6C,KAChD,IAAI,CAAC;QACV;;WAEG;QACH,yCAAyC,EAAE,CACzC,IAAI,EAAE,8CAA8C,KACjD,IAAI,CAAC;KACX;CACF;AAED,YAAY,EACV,6CAA6C,EAC7C,8CAA8C,GAC/C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/checkout/trackCheckoutTransaction/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,YAAY,EAAE,8BAA8B,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type TrackCheckoutTransactionParams = {
|
|
2
|
+
transactionId: string;
|
|
3
|
+
};
|
|
4
|
+
/**
|
|
5
|
+
* Subscribes to realtime state change events for an existing checkout transaction.
|
|
6
|
+
*
|
|
7
|
+
* Call this after a page refresh to resume receiving transaction events
|
|
8
|
+
* for a transaction that was created in a previous page session.
|
|
9
|
+
*
|
|
10
|
+
* @param params.transactionId - The ID of the checkout transaction to track.
|
|
11
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
12
|
+
* @instrumented
|
|
13
|
+
*/
|
|
14
|
+
export declare const trackCheckoutTransaction: ({ transactionId }: TrackCheckoutTransactionParams, client?: import("../../../exports").DynamicClient) => Promise<void>;
|
|
15
|
+
//# sourceMappingURL=trackCheckoutTransaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trackCheckoutTransaction.d.ts","sourceRoot":"","sources":["../../../../src/modules/checkout/trackCheckoutTransaction/trackCheckoutTransaction.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,8BAA8B,GAAG;IAC3C,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB,sBAChB,8BAA8B,wDAEhD,OAAO,CAAC,IAAI,CAA8D,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as z from 'zod/mini';
|
|
2
|
+
/**
|
|
3
|
+
* Zod schema for realtime events published to a checkout transaction's channel.
|
|
4
|
+
* Uses z.string() for axis and state fields to remain valid when new states are
|
|
5
|
+
* added to the backend without requiring a SDK update.
|
|
6
|
+
*/
|
|
7
|
+
declare const checkoutTransactionEventSchema: z.ZodMiniObject<{
|
|
8
|
+
axis: z.ZodMiniString<string>;
|
|
9
|
+
newState: z.ZodMiniString<string>;
|
|
10
|
+
previousState: z.ZodMiniString<string>;
|
|
11
|
+
timestamp: z.ZodMiniString<string>;
|
|
12
|
+
transactionId: z.ZodMiniString<string>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export type CheckoutTransactionEvent = z.infer<typeof checkoutTransactionEventSchema>;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a typed realtime channel schema for a given checkout transaction.
|
|
17
|
+
* Channel name follows the backend convention: `transaction:{transactionId}`.
|
|
18
|
+
* @not-instrumented
|
|
19
|
+
*/
|
|
20
|
+
export declare const createCheckoutTransactionChannelSchema: (transactionId: string) => import("../../../../services/realtime").RealtimeChannelSchema<{
|
|
21
|
+
axis: string;
|
|
22
|
+
newState: string;
|
|
23
|
+
previousState: string;
|
|
24
|
+
timestamp: string;
|
|
25
|
+
transactionId: string;
|
|
26
|
+
}>;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=createCheckoutTransactionChannelSchema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createCheckoutTransactionChannelSchema.d.ts","sourceRoot":"","sources":["../../../../../src/modules/checkout/utils/createCheckoutTransactionChannelSchema/createCheckoutTransactionChannelSchema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAI9B;;;;GAIG;AACH,QAAA,MAAM,8BAA8B;;;;;;iBAMlC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF;;;;GAIG;AACH,eAAO,MAAM,sCAAsC,kBAAmB,MAAM;;;;;;EAIxE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/checkout/utils/createCheckoutTransactionChannelSchema/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sCAAsC,EAAE,MAAM,0CAA0C,CAAC;AAClG,YAAY,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/checkout/utils/subscribeToCheckoutTransaction/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,YAAY,EAAE,oCAAoC,EAAE,MAAM,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { DynamicClient } from '../../../../client/types';
|
|
2
|
+
import '../../events';
|
|
3
|
+
export type SubscribeToCheckoutTransactionParams = {
|
|
4
|
+
transactionId: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Connects to the realtime service if not already connected and subscribes to
|
|
8
|
+
* all state transition events for the given checkout transaction.
|
|
9
|
+
*
|
|
10
|
+
* Settlement and execution axis events are forwarded as public SDK events.
|
|
11
|
+
* The subscription is torn down automatically when a terminal event is received.
|
|
12
|
+
* @not-instrumented
|
|
13
|
+
*/
|
|
14
|
+
export declare const subscribeToCheckoutTransaction: ({ transactionId }: SubscribeToCheckoutTransactionParams, client: DynamicClient) => Promise<void>;
|
|
15
|
+
//# sourceMappingURL=subscribeToCheckoutTransaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscribeToCheckoutTransaction.d.ts","sourceRoot":"","sources":["../../../../../src/modules/checkout/utils/subscribeToCheckoutTransaction/subscribeToCheckoutTransaction.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAO9D,OAAO,cAAc,CAAC;AAetB,MAAM,MAAM,oCAAoC,GAAG;IACjD,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;;;;;GAOG;AAEH,eAAO,MAAM,8BAA8B,sBACtB,oCAAoC,UAC/C,aAAa,KACpB,OAAO,CAAC,IAAI,CA+Cd,CAAC"}
|