@qonto/embed-sdk 0.66.0 → 0.67.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.
Files changed (32) hide show
  1. package/dist/index.umd.js +3 -3
  2. package/dist/sepa-transfers/bulk-transfers/bulk-transfers.d.ts +4 -4
  3. package/dist/sepa-transfers/bulk-transfers/client/bulk-transfers.client.d.ts +3 -3
  4. package/dist/sepa-transfers/bulk-transfers/client/bulk-transfers.client.d.ts.map +1 -1
  5. package/dist/sepa-transfers/bulk-transfers/index.d.ts +1 -1
  6. package/dist/sepa-transfers/client/sepa-transfers.client.d.ts +8 -9
  7. package/dist/sepa-transfers/client/sepa-transfers.client.d.ts.map +1 -1
  8. package/dist/sepa-transfers/index.d.ts +3 -3
  9. package/dist/sepa-transfers/sepa-transfers.d.ts +10 -10
  10. package/dist/sepa-transfers/sepa-transfers.d.ts.map +1 -1
  11. package/dist/server/_virtual/index.js +1 -1
  12. package/dist/server/_virtual/index2.js +1 -1
  13. package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/utils/observable.js +1 -1
  14. package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/utils/safe-stringify.js +1 -1
  15. package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-thrashed-cursor.js +1 -1
  16. package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture-plugin.js +1 -1
  17. package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/frustration-plugin.js +1 -1
  18. package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/observables.js +1 -1
  19. package/dist/server/node_modules/.pnpm/@amplitude_plugin-network-capture-browser@1.9.10/node_modules/@amplitude/plugin-network-capture-browser/lib/esm/network-capture-plugin.js +1 -1
  20. package/dist/server/sepa-transfers/bulk-transfers/bulk-transfers.d.ts +4 -4
  21. package/dist/server/sepa-transfers/bulk-transfers/client/bulk-transfers.client.d.ts +3 -3
  22. package/dist/server/sepa-transfers/bulk-transfers/client/bulk-transfers.client.d.ts.map +1 -1
  23. package/dist/server/sepa-transfers/bulk-transfers/index.d.ts +1 -1
  24. package/dist/server/sepa-transfers/client/sepa-transfers.client.d.ts +8 -9
  25. package/dist/server/sepa-transfers/client/sepa-transfers.client.d.ts.map +1 -1
  26. package/dist/server/sepa-transfers/index.d.ts +3 -3
  27. package/dist/server/sepa-transfers/sepa-transfers.d.ts +10 -10
  28. package/dist/server/sepa-transfers/sepa-transfers.d.ts.map +1 -1
  29. package/dist/src/sepa-transfers/bulk-transfers/client/bulk-transfers.client.js +1 -1
  30. package/dist/src/sepa-transfers/client/sepa-transfers.client.js +1 -1
  31. package/dist/src/sepa-transfers/sepa-transfers.js +1 -1
  32. package/package.json +1 -1
@@ -5,13 +5,13 @@ import '../ui/ui-elements/sca-passkey/qonto-sca-passkey-waiting.ts';
5
5
  * Fetches the list of SEPA transfers for the current user.
6
6
  * @param getSepaTransfersParams - An object containing:
7
7
  * - `operationSettings`: An object with operation-level settings such as
8
- * `proxyRequestFunction` (preferred over using the access token flow),
8
+ * `proxyEndpointDescriptor` (preferred over using the access token flow),
9
9
  * `accessToken`, `stagingToken`, `paginationSettings`, and other optional
10
10
  * parameters.
11
11
  * @returns A promise that resolves to an object containing an array of SEPA
12
12
  * transfers and a `meta` object containing pagination state.
13
13
  * @throws `InvalidParametersError` If any parameter validation fails.
14
- * @throws `AuthenticationError` If both the `proxyRequestFunction` and
14
+ * @throws `AuthenticationError` If both the `proxyEndpointDescriptor` and
15
15
  * `accessToken` are invalid or missing within `operationSettings`.
16
16
  * @throws `EmbedApiError` If the API request fails or returns an error.
17
17
  */
@@ -21,13 +21,13 @@ export declare function getSepaTransfers(getSepaTransfersParams?: SepaTransferPa
21
21
  * @param getSepaTransferParams - An object containing:
22
22
  * - `sepaTransferSettings`: An object with the `sepaTransferId` property (string).
23
23
  * - `operationSettings`: An object with operation-level settings such as
24
- * `proxyRequestFunction` (preferred over using the access token flow),
24
+ * `proxyEndpointDescriptor` (preferred over using the access token flow),
25
25
  * `accessToken`, `stagingToken`, and other optional
26
26
  * parameters.
27
27
  * @returns A promise that resolves to a SEPA transfer.
28
28
  * @throws `InvalidParametersError` If the `sepaTransferId` parameter is not a string
29
29
  * or missing, or if any parameter validation fails.
30
- * @throws `AuthenticationError` If both the `proxyRequestFunction` and
30
+ * @throws `AuthenticationError` If both the `proxyEndpointDescriptor` and
31
31
  * `accessToken` are invalid or missing within `operationSettings`.
32
32
  * @throws `EmbedApiError` If the API request fails or returns an error.
33
33
  */
@@ -61,14 +61,14 @@ export declare function getSepaTransfer({ sepaTransferSettings, operationSetting
61
61
  * the process and require the user to give the transfer data after the VoP
62
62
  * result.
63
63
  * - `operationSettings`: An object with operation-level settings such as
64
- * `proxyRequestFunction` (preferred over using the access token flow),
64
+ * `proxyEndpointDescriptor` (preferred over using the access token flow),
65
65
  * `accessToken`, `stagingToken`, `idempotencyKey`, `mfaPreference`,
66
66
  * `uiParentElementId`, and other optional parameters.
67
67
  * @returns As the first yielded value, a promise that resolves to the VoP check
68
68
  * result.
69
69
  * @returns As the final return value, a promise that resolves to the created
70
70
  * SEPA transfer.
71
- * @throws `AuthenticationError` If both the `proxyRequestFunction` and
71
+ * @throws `AuthenticationError` If both the `proxyEndpointDescriptor` and
72
72
  * `accessToken` are invalid or missing within `operationSettings`.
73
73
  * @throws `InvalidParametersError` If the `transfer` parameter is not an object
74
74
  * or is missing, or if the required properties of the transfer object are
@@ -135,13 +135,13 @@ export declare function createSepaTransfer({ sepaTransferSettings, operationSett
135
135
  * @param cancelSepaTransferParams - An object containing:
136
136
  * - `sepaTransferSettings`: An object with the `sepaTransferId` property (string).
137
137
  * - `operationSettings`: An object with operation-level settings such as
138
- * `proxyRequestFunction` (preferred over using the access token flow),
138
+ * `proxyEndpointDescriptor` (preferred over using the access token flow),
139
139
  * `accessToken`, `stagingToken`, and other optional
140
140
  * parameters.
141
141
  * @returns A promise that resolves without return value.
142
142
  * @throws `InvalidParametersError` If the `sepaTransferId` parameter is missing
143
143
  * or not a string, or if any parameter validation fails.
144
- * @throws `AuthenticationError` If both the `proxyRequestFunction` and
144
+ * @throws `AuthenticationError` If both the `proxyEndpointDescriptor` and
145
145
  * `accessToken` are invalid or missing within `operationSettings`.
146
146
  * @throws `EmbedApiError` If the API request fails or returns an error.
147
147
  */
@@ -155,14 +155,14 @@ export declare function cancelSepaTransfer({ sepaTransferSettings, operationSett
155
155
  * - `sepaTransferSettings`: An object with the `callbackUrl` property, which
156
156
  * will be used to return the user to the desired location after completion.
157
157
  * - `operationSettings`: An object with operation-level settings such as
158
- * `proxyRequestFunction` (preferred over using the access token flow),
158
+ * `proxyEndpointDescriptor` (preferred over using the access token flow),
159
159
  * `accessToken`, `stagingToken`, `locale`, and other optional
160
160
  * parameters.
161
161
  * @returns A promise that resolves to an object representing the Embed Auth Link.
162
162
  * This object contains a `url` property with the link to start the SEPA transfer.
163
163
  * @throws `InvalidParametersError` If the callbackUrl is invalid or missing, or
164
164
  * if any parameter validation fails.
165
- * @throws `AuthenticationError` If both the `proxyRequestFunction` and
165
+ * @throws `AuthenticationError` If both the `proxyEndpointDescriptor` and
166
166
  * `accessToken` are invalid or missing within `operationSettings`.
167
167
  * @throws `EmbedApiError` If the API request fails or returns an error.
168
168
  */
@@ -1 +1 @@
1
- {"version":3,"file":"sepa-transfers.d.ts","sourceRoot":"","sources":["../../../src/sepa-transfers/sepa-transfers.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAwCjF,OAAO,KAAK,EACV,4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ializePaginationResponse as r}from"../../../common/api-pagination/api-pagination.js";import{authManager as n}from"../../../common/auth/auth.js";import{callProxyFunction as o}from"../../../common/common.utils.js";import{VOP_DECISIONS as s}from"../../../common/constants.js";import{isRunningInBrowser as t}from"../../../common/runtime/runtime.validation.js";import{validateClientOperationSettings as i}from"../../../validation/operation-settings-validation.js";import{InvalidRuntimeError as a,RUNTIME_ENVIRONMENT as p}from"../../../errors/InvalidRuntimeError.js";import{prepareCreateBulkTransferCall as c,prepareGetBulkTransfersCall as u,prepareVerifySepaPayeesCall as m,prepareGetBulkTransferCall as d}from"../shared/bulk-transfers.api.js";import{serializeToBulkVopVerificationResult as y,serializeBulkTransfer as f}from"../shared/bulk-transfers.serializer.js";import{validateCreateBulkTransferParams as l,validateBulkTransferParams as k}from"../shared/bulk-transfers.validate.js";import b from"../../../../node_modules/.pnpm/uuid@13.0.0/node_modules/uuid/dist/v4.js";async function x(n){e.sepaTransferBulkList();const{proxyRequestFunction:s,proxyEndpointDescriptor:t,paginationSettings:a}=i(n?.operationSettings,'Client-side bulk transfer operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" and access sepaTransfers.bulkTransfers only in server-side/backend environments.'),p=u({paginationSettings:a}),c=await o({proxyFunction:s,proxyEndpointDescriptor:t,networkCallDescriptor:p}),m=c.body.bulk_transfers.map(f),d=r(c.body.meta);return{bulkTransfers:m,...d?{meta:d}:{}}}async function T({bulkTransferSettings:r,operationSettings:n}){e.sepaTransferBulkGet();const s=k(r?.bulkTransferId),{proxyRequestFunction:t,proxyEndpointDescriptor:a}=i(n,'Client-side bulk transfer operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" and access sepaTransfers.bulkTransfers only in server-side/backend environments.'),p=d({bulkTransferId:s}),c=await o({proxyFunction:t,proxyEndpointDescriptor:a,networkCallDescriptor:p});return f(c.body.bulk_transfer)}async function*v({bulkTransferSettings:r,operationSettings:u}){e.sepaTransferBulkCreate();const{proxyRequestFunction:d,proxyEndpointDescriptor:k}=i(u,'Client-side bulk transfer operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" and access sepaTransfers.bulkTransfers only in server-side/backend environments.');if(!t())throw new a(p.BROWSER);const x=n.getStagingToken(),T=u?.idempotencyKey||b();l(r);const v=new Map;for(const e of r.bulkTransfers){const r=e.beneficiary.iban;r&&!v.has(r)&&v.set(r,{name:e.beneficiary.name,iban:r})}const g=Array.from(v.values()),D=await async function({sepaPayees:e,proxyRequestFunction:r,proxyEndpointDescriptor:n}){const s=m({sepaPayees:e});return(await o({proxyFunction:r,proxyEndpointDescriptor:n,networkCallDescriptor:s})).body}({sepaPayees:g,proxyRequestFunction:d,proxyEndpointDescriptor:k});if((yield D.requests.map(y))===s.REJECT)return;const E=c({bulkTransfers:r.bulkTransfers,bankAccountId:r.bankAccountId,stagingToken:x||void 0,idempotencyKey:T}),q=(await o({proxyFunction:d,proxyEndpointDescriptor:k,networkCallDescriptor:E})).body.bulk_transfer;return{bulkTransfer:f(q),meta:{idempotencyKey:T}}}export{v as createBulkTransfer,T as getBulkTransfer,x as getBulkTransfers};
1
+ import{tracker as e}from"../../../common/analytics/analytics-tracker.js";import{serializePaginationResponse as r}from"../../../common/api-pagination/api-pagination.js";import{authManager as n}from"../../../common/auth/auth.js";import{callProxyFunction as s}from"../../../common/common.utils.js";import{VOP_DECISIONS as o}from"../../../common/constants.js";import{isRunningInBrowser as t}from"../../../common/runtime/runtime.validation.js";import{validateClientOperationSettings as a}from"../../../validation/operation-settings-validation.js";import{InvalidRuntimeError as i,RUNTIME_ENVIRONMENT as p}from"../../../errors/InvalidRuntimeError.js";import{prepareCreateBulkTransferCall as c,prepareGetBulkTransfersCall as m,prepareVerifySepaPayeesCall as d,prepareGetBulkTransferCall as u}from"../shared/bulk-transfers.api.js";import{serializeToBulkVopVerificationResult as f,serializeBulkTransfer as l}from"../shared/bulk-transfers.serializer.js";import{validateCreateBulkTransferParams as k,validateBulkTransferParams as y}from"../shared/bulk-transfers.validate.js";import b from"../../../../node_modules/.pnpm/uuid@13.0.0/node_modules/uuid/dist/v4.js";async function T(n){e.sepaTransferBulkList();const{proxyEndpointDescriptor:o,paginationSettings:t}=a(n?.operationSettings,'Client-side bulk transfer operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" and access sepaTransfers.bulkTransfers only in server-side/backend environments.'),i=m({paginationSettings:t}),p=await s({proxyEndpointDescriptor:o,networkCallDescriptor:i}),c=p.body.bulk_transfers.map(l),d=r(p.body.meta);return{bulkTransfers:c,...d?{meta:d}:{}}}async function v({bulkTransferSettings:r,operationSettings:n}){e.sepaTransferBulkGet();const o=y(r?.bulkTransferId),{proxyEndpointDescriptor:t}=a(n,'Client-side bulk transfer operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" and access sepaTransfers.bulkTransfers only in server-side/backend environments.'),i=u({bulkTransferId:o}),p=await s({proxyEndpointDescriptor:t,networkCallDescriptor:i});return l(p.body.bulk_transfer)}async function*g({bulkTransferSettings:r,operationSettings:m}){e.sepaTransferBulkCreate();const{proxyEndpointDescriptor:u}=a(m,'Client-side bulk transfer operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" and access sepaTransfers.bulkTransfers only in server-side/backend environments.');if(!t())throw new i(p.BROWSER);const y=n.getStagingToken(),T=m?.idempotencyKey||b();k(r);const v=new Map;for(const e of r.bulkTransfers){const r=e.beneficiary.iban;r&&!v.has(r)&&v.set(r,{name:e.beneficiary.name,iban:r})}const g=Array.from(v.values()),x=await async function({sepaPayees:e,proxyEndpointDescriptor:r}){const n=d({sepaPayees:e});return(await s({proxyEndpointDescriptor:r,networkCallDescriptor:n})).body}({sepaPayees:g,proxyEndpointDescriptor:u});if((yield x.requests.map(f))===o.REJECT)return;const D=c({bulkTransfers:r.bulkTransfers,bankAccountId:r.bankAccountId,stagingToken:y||void 0,idempotencyKey:T}),E=(await s({proxyEndpointDescriptor:u,networkCallDescriptor:D})).body.bulk_transfer;return{bulkTransfer:l(E),meta:{idempotencyKey:T}}}export{g as createBulkTransfer,v as getBulkTransfer,T as getBulkTransfers};
@@ -1 +1 @@
1
- import{authLinks as e}from"../../auth-links/index.js";import{tracker as r}from"../../common/analytics/analytics-tracker.js";import{serializePaginationResponse as o}from"../../common/api-pagination/api-pagination.js";import{authManager as n}from"../../common/auth/auth.js";import{callProxyFunction as t}from"../../common/common.utils.js";import{VOP_DECISIONS as s,HTTP_CODES as i,AUTH_LINK_ACTIONS as a}from"../../common/constants.js";import{isRunningInBrowser as p}from"../../common/runtime/runtime.validation.js";import{validateClientOperationSettings as c}from"../../validation/operation-settings-validation.js";import{EmbedApiError as d}from"../../errors/EmbedApiError.js";import{InvalidParametersError as u}from"../../errors/InvalidParametersError.js";import{InvalidRuntimeError as m,RUNTIME_ENVIRONMENT as y}from"../../errors/InvalidRuntimeError.js";import{serializePreconditionRequiredResponse as f}from"../../sca/sca.serializer.js";import{prepareCreateSepaTransferCall as l,prepareGetSepaTransfersCall as x,prepareCancelSepaTransferCall as k,prepareGetSepaTransferCall as E,prepareVerifySepaPayeeCall as g}from"../shared/sepa-transfers.api.js";import{serializeToVopVerificationResult as v,serializeSepaTransfer as b}from"../shared/sepa-transfers.serializer.js";import{findBeneficiary as w,createSepaTransferScaElement as q,waitForSepaTransferScaResult as D,decorateUrlWithExtraParams as S}from"../shared/sepa-transfers.utils.js";import{validateTransferBeneficiaryParams as T,validateCreateSepaTransferParams as F,validateGetSepaTransferCreationFlowLinkParams as R,validateCancelSepaTransferParams as h,validateGetSepaTransferParams as C}from"../shared/sepa-transfers.validate.js";import"../../ui/ui-elements/sca-passkey/qonto-sca-passkey-waiting.js";import j from"../../../node_modules/.pnpm/uuid@13.0.0/node_modules/uuid/dist/v4.js";async function I(e){r.sepaTransferList();const{proxyRequestFunction:n,proxyEndpointDescriptor:s,paginationSettings:i}=c(e?.operationSettings,'Client-side operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" only in server-side/backend environments.'),a=x({paginationSettings:i}),p=await t({proxyFunction:n,proxyEndpointDescriptor:s,networkCallDescriptor:a}),d=p.body.transfers.map(b),u=o(p.body.meta);return{transfers:d,...u?{meta:u}:{}}}async function P({sepaTransferSettings:e,operationSettings:o}){r.sepaTransferGet();const n=C(e?.sepaTransferId),{proxyRequestFunction:s,proxyEndpointDescriptor:i}=c(o,'Client-side operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" only in server-side/backend environments.'),a=E({sepaTransferId:n}),p=await t({proxyFunction:s,proxyEndpointDescriptor:i,networkCallDescriptor:a});return b(p.body.transfer)}async function*U({sepaTransferSettings:e,operationSettings:o}){r.sepaTransferCreate();const{proxyRequestFunction:a,proxyEndpointDescriptor:x,uiParentElementId:k,locale:E}=c(o),S=n.getStagingToken(),R=o?.idempotencyKey||j();let h;T(e);const C=await w({sepaTransferSettings:e,operationSettings:o}),I={name:C.name,iban:C.iban},P=await async function({sepaPayee:e,operationSettings:r}){const{proxyRequestFunction:o,proxyEndpointDescriptor:n}=c(r,'Client-side operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" only in server-side/backend environments.'),s=g({sepaPayee:e}),i=await t({proxyFunction:o,proxyEndpointDescriptor:n,networkCallDescriptor:s});return i.body}({sepaPayee:I,operationSettings:o}),U=yield v(P);let _;if("string"==typeof U){if(U===s.REJECT)return}else{if(U.vopDecision===s.REJECT)return;_=U.sepaTransferSettings}const A={...e,..._};F(A);const K={...A,beneficiary:C};if(K.beneficiary?.trusted){const e=l({transfer:K,vopProofToken:P.proof_token.token,idempotencyKey:R});h=(await t({proxyFunction:a,proxyEndpointDescriptor:x,networkCallDescriptor:e})).body.transfer}else{if(!p())throw new m(y.BROWSER);if(!k)throw new u("operationSettings.uiParentElementId is required for creating transfers to untrusted beneficiaries. This operation requires UI interaction for SCA.");const e=l({transfer:K,vopProofToken:P.proof_token.token,stagingToken:S||void 0,idempotencyKey:R});let r;try{h=(await t({proxyFunction:a,proxyEndpointDescriptor:x,networkCallDescriptor:e})).body.transfer}catch(e){if(!(e instanceof d&&e.code===i.PRECONDITION_REQUIRED))throw e;r=f(e.data.body).scaSessionToken}const o=q({networkCallDescriptor:e,scaSessionToken:r,operationSettings:{uiParentElementId:k,proxyRequestFunction:a,locale:E}});try{h=await D(o)}finally{o.remove()}}return{transfer:b(h),meta:{idempotencyKey:R}}}async function _({sepaTransferSettings:e,operationSettings:o}){r.sepaTransferCancel();const n=h(e?.sepaTransferId),{proxyRequestFunction:s,proxyEndpointDescriptor:i}=c(o,'Client-side operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" only in server-side/backend environments.'),a=k({sepaTransferId:n});await t({proxyFunction:s,proxyEndpointDescriptor:i,networkCallDescriptor:a})}async function A({sepaTransferSettings:o,operationSettings:n}){r.sepaTransferCreationFlowLink();const t=R(o),{proxyRequestFunction:s,proxyEndpointDescriptor:i}=c(n,'Client-side operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" only in server-side/backend environments.'),p=await e.request({requestSettings:{action:a.SEPA_TRANSFER_CREATE,callbackUrl:t},operationSettings:{proxyRequestFunction:s,proxyEndpointDescriptor:i}});return{...p,url:S(p.url,n)}}export{_ as cancelSepaTransfer,U as createSepaTransfer,P as getSepaTransfer,A as getSepaTransferCreationFlowLink,I as getSepaTransfers};
1
+ import{authLinks as e}from"../../auth-links/index.js";import{tracker as r}from"../../common/analytics/analytics-tracker.js";import{serializePaginationResponse as n}from"../../common/api-pagination/api-pagination.js";import{authManager as t}from"../../common/auth/auth.js";import{callProxyFunction as o}from"../../common/common.utils.js";import{VOP_DECISIONS as s,HTTP_CODES as i,AUTH_LINK_ACTIONS as a}from"../../common/constants.js";import{isRunningInBrowser as p}from"../../common/runtime/runtime.validation.js";import{validateClientOperationSettings as c}from"../../validation/operation-settings-validation.js";import{EmbedApiError as d}from"../../errors/EmbedApiError.js";import{InvalidParametersError as m}from"../../errors/InvalidParametersError.js";import{InvalidRuntimeError as f,RUNTIME_ENVIRONMENT as y}from"../../errors/InvalidRuntimeError.js";import{serializePreconditionRequiredResponse as l}from"../../sca/sca.serializer.js";import{prepareCreateSepaTransferCall as u,prepareGetSepaTransfersCall as k,prepareCancelSepaTransferCall as E,prepareGetSepaTransferCall as g,prepareVerifySepaPayeeCall as v}from"../shared/sepa-transfers.api.js";import{serializeToVopVerificationResult as b,serializeSepaTransfer as w}from"../shared/sepa-transfers.serializer.js";import{findBeneficiary as D,createSepaTransferScaElement as S,waitForSepaTransferScaResult as T,decorateUrlWithExtraParams as x}from"../shared/sepa-transfers.utils.js";import{validateTransferBeneficiaryParams as C,validateCreateSepaTransferParams as j,validateGetSepaTransferCreationFlowLinkParams as h,validateCancelSepaTransferParams as q,validateGetSepaTransferParams as I}from"../shared/sepa-transfers.validate.js";import"../../ui/ui-elements/sca-passkey/qonto-sca-passkey-waiting.js";import P from"../../../node_modules/.pnpm/uuid@13.0.0/node_modules/uuid/dist/v4.js";async function R(e){r.sepaTransferList();const{proxyEndpointDescriptor:t,paginationSettings:s}=c(e?.operationSettings,'Client-side operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" only in server-side/backend environments.'),i=k({paginationSettings:s}),a=await o({proxyEndpointDescriptor:t,networkCallDescriptor:i}),p=a.body.transfers.map(w),d=n(a.body.meta);return{transfers:p,...d?{meta:d}:{}}}async function U({sepaTransferSettings:e,operationSettings:n}){r.sepaTransferGet();const t=I(e?.sepaTransferId),{proxyEndpointDescriptor:s}=c(n,'Client-side operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" only in server-side/backend environments.'),i=g({sepaTransferId:t}),a=await o({proxyEndpointDescriptor:s,networkCallDescriptor:i});return w(a.body.transfer)}async function*F({sepaTransferSettings:e,operationSettings:n}){r.sepaTransferCreate();const{proxyEndpointDescriptor:a,uiParentElementId:k,locale:E}=c(n),g=t.getStagingToken(),x=n?.idempotencyKey||P();let h;C(e);const q=await D({sepaTransferSettings:e,operationSettings:n}),I={name:q.name,iban:q.iban},R=await async function({sepaPayee:e,operationSettings:r}){const{proxyEndpointDescriptor:n}=c(r,'Client-side operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" only in server-side/backend environments.'),t=v({sepaPayee:e}),s=await o({proxyEndpointDescriptor:n,networkCallDescriptor:t});return s.body}({sepaPayee:I,operationSettings:n}),U=yield b(R);let F;if("string"==typeof U){if(U===s.REJECT)return}else{if(U.vopDecision===s.REJECT)return;F=U.sepaTransferSettings}const _={...e,...F};j(_);const A={..._,beneficiary:q};if(A.beneficiary?.trusted){const e=u({transfer:A,vopProofToken:R.proof_token.token,idempotencyKey:x});h=(await o({proxyEndpointDescriptor:a,networkCallDescriptor:e})).body.transfer}else{if(!p())throw new f(y.BROWSER);if(!k)throw new m("operationSettings.uiParentElementId is required for creating transfers to untrusted beneficiaries. This operation requires UI interaction for SCA.");const e=u({transfer:A,vopProofToken:R.proof_token.token,stagingToken:g||void 0,idempotencyKey:x});let r;try{h=(await o({proxyEndpointDescriptor:a,networkCallDescriptor:e})).body.transfer}catch(e){if(!(e instanceof d&&e.code===i.PRECONDITION_REQUIRED))throw e;r=l(e.data.body).scaSessionToken}const n=S({networkCallDescriptor:e,scaSessionToken:r,operationSettings:{uiParentElementId:k,locale:E}});try{h=await T(n)}finally{n.remove()}}return{transfer:w(h),meta:{idempotencyKey:x}}}async function _({sepaTransferSettings:e,operationSettings:n}){r.sepaTransferCancel();const t=q(e?.sepaTransferId),{proxyEndpointDescriptor:s}=c(n,'Client-side operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" only in server-side/backend environments.'),i=E({sepaTransferId:t});await o({proxyEndpointDescriptor:s,networkCallDescriptor:i})}async function A({sepaTransferSettings:n,operationSettings:t}){r.sepaTransferCreationFlowLink();const o=h(n),{proxyEndpointDescriptor:s}=c(t,'Client-side operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" only in server-side/backend environments.'),i=await e.request({requestSettings:{action:a.SEPA_TRANSFER_CREATE,callbackUrl:o},operationSettings:{proxyEndpointDescriptor:s}});return{...i,url:x(i.url,t)}}export{_ as cancelSepaTransfer,F as createSepaTransfer,U as getSepaTransfer,A as getSepaTransferCreationFlowLink,R as getSepaTransfers};
@@ -1 +1 @@
1
- import"../common/auth/auth.js";import{validatePresenceOfAuthToken as t}from"../common/auth/auth.validate.js";import{callProxyFunction as o}from"../common/common.utils.js";import{validateOperationSettingsParams as a}from"../validation/operation-settings-validation.js";import"../common/environment/environment-manager.js";import"../common/locale/locale-manager.js";import"../common/operation-settings/operation-settings.js";import{serializePaginationResponse as n}from"../common/api-pagination/api-pagination.js";import{prepareGetSepaTransfersCall as s,getSepaTransfers as i}from"./shared/sepa-transfers.api.js";import{serializeSepaTransfer as e}from"./shared/sepa-transfers.serializer.js";import"../ui/ui-elements/sca-passkey/qonto-sca-passkey-waiting.js";async function r(r){const{stagingToken:m,proxyRequestFunction:p,accessToken:c,paginationSettings:g}=a(r?.operationSettings||{});if(p){const t=s({paginationSettings:g}),a=await o({proxyFunction:p,networkCallDescriptor:t}),i=a.body.transfers.map(e),r=n(a.body.meta);return{transfers:i,...r?{meta:r}:{}}}{const o=c||t(),a=await i({accessToken:o,stagingToken:m,paginationSettings:g}),s=a.transfers.map(e),r=n(a.meta);return{transfers:s,...r?{meta:r}:{}}}}export{r as getSepaTransfers};
1
+ import"../common/auth/auth.js";import{validatePresenceOfAuthToken as t}from"../common/auth/auth.validate.js";import{callProxyFunction as o}from"../common/common.utils.js";import{validateOperationSettingsParams as a}from"../validation/operation-settings-validation.js";import"../common/environment/environment-manager.js";import"../common/locale/locale-manager.js";import"../common/operation-settings/operation-settings.js";import{serializePaginationResponse as n}from"../common/api-pagination/api-pagination.js";import{prepareGetSepaTransfersCall as s,getSepaTransfers as i}from"./shared/sepa-transfers.api.js";import{serializeSepaTransfer as e}from"./shared/sepa-transfers.serializer.js";import"../ui/ui-elements/sca-passkey/qonto-sca-passkey-waiting.js";async function r(r){const{stagingToken:m,proxyEndpointDescriptor:p,accessToken:c,paginationSettings:g}=a(r?.operationSettings||{});if(p){const t=s({paginationSettings:g}),a=await o({proxyEndpointDescriptor:p,networkCallDescriptor:t}),i=a.body.transfers.map(e),r=n(a.body.meta);return{transfers:i,...r?{meta:r}:{}}}{const o=c||t(),a=await i({accessToken:o,stagingToken:m,paginationSettings:g}),s=a.transfers.map(e),r=n(a.meta);return{transfers:s,...r?{meta:r}:{}}}}export{r as getSepaTransfers};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qonto/embed-sdk",
3
- "version": "0.66.0",
3
+ "version": "0.67.0",
4
4
  "description": "Library to embed Qonto features in your application",
5
5
  "type": "module",
6
6
  "exports": {