@qonto/embed-sdk 0.69.0 → 0.70.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/auth-links/client/auth-links.client.d.ts +1 -1
- package/dist/beneficiaries/beneficiaries.d.ts +1 -1
- package/dist/beneficiaries/beneficiaries.d.ts.map +1 -1
- package/dist/beneficiaries/client/beneficiaries.client.d.ts +1 -1
- package/dist/beneficiaries/client/beneficiaries.client.d.ts.map +1 -1
- package/dist/beneficiaries/index.server.d.ts +1 -1
- package/dist/cards/client/cards.client.d.ts +1 -1
- package/dist/cards/index.d.ts +2 -2
- package/dist/cards/server/cards.server.d.ts +1 -1
- package/dist/common/constants.d.ts +17 -0
- package/dist/common/constants.d.ts.map +1 -1
- package/dist/common/initialize/initialize.d.ts +22 -14
- package/dist/common/initialize/initialize.d.ts.map +1 -1
- package/dist/iframe/embed-iframe.d.ts +9 -0
- package/dist/iframe/embed-iframe.d.ts.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/payment-links/client/payment-links.client.d.ts +2 -2
- package/dist/server/auth-links/client/auth-links.client.d.ts +1 -1
- package/dist/server/beneficiaries/beneficiaries.d.ts +1 -1
- package/dist/server/beneficiaries/beneficiaries.d.ts.map +1 -1
- package/dist/server/beneficiaries/client/beneficiaries.client.d.ts +1 -1
- package/dist/server/beneficiaries/client/beneficiaries.client.d.ts.map +1 -1
- package/dist/server/beneficiaries/index.server.d.ts +1 -1
- package/dist/server/cards/client/cards.client.d.ts +1 -1
- package/dist/server/cards/index.d.ts +2 -2
- package/dist/server/cards/server/cards.server.d.ts +1 -1
- package/dist/server/common/constants.d.ts +17 -0
- package/dist/server/common/constants.d.ts.map +1 -1
- package/dist/server/common/initialize/initialize.d.ts +22 -14
- package/dist/server/common/initialize/initialize.d.ts.map +1 -1
- package/dist/server/iframe/embed-iframe.d.ts +9 -0
- package/dist/server/iframe/embed-iframe.d.ts.map +1 -1
- package/dist/server/payment-links/client/payment-links.client.d.ts +2 -2
- package/dist/src/common/constants.js +1 -1
- package/dist/src/iframe/embed-iframe.js +1 -1
- package/package.json +1 -1
|
@@ -14,7 +14,7 @@ import type { CreatePaymentLinkSettings, PaymentLinkParams } from '../shared/pay
|
|
|
14
14
|
* `proxyEndpointDescriptor` (required).
|
|
15
15
|
* @returns Promise resolving to the full URL as a string, which can be used to launch the payment link creation flow in an iframe or browser.
|
|
16
16
|
* @throws `InvalidParametersError` If `proxyEndpointDescriptor` is not provided, or if the provided items array is invalid, or if callbackUrl is missing or invalid.
|
|
17
|
-
* @throws `AuthenticationError` If authentication fails (e.g.,
|
|
17
|
+
* @throws `AuthenticationError` If authentication fails (e.g., proxy authentication is rejected).
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
20
|
* ```
|
|
@@ -42,7 +42,7 @@ export declare const getPaymentLinkCreationFlowUrl: ({ paymentLinkSettings, oper
|
|
|
42
42
|
* `proxyEndpointDescriptor` (required).
|
|
43
43
|
* @returns This function redirects the browser to the payment link creation flow. Due to the redirect, the returned promise will not resolve.
|
|
44
44
|
* @throws `InvalidParametersError` If `proxyEndpointDescriptor` is not provided, or if the provided items array is invalid, or if callbackUrl is missing or invalid.
|
|
45
|
-
* @throws `AuthenticationError` If authentication fails (e.g.,
|
|
45
|
+
* @throws `AuthenticationError` If authentication fails (e.g., proxy authentication is rejected).
|
|
46
46
|
*
|
|
47
47
|
* @example
|
|
48
48
|
* ```
|
|
@@ -94,7 +94,7 @@ export declare function updateBeneficiary({ beneficiarySettings, operationSettin
|
|
|
94
94
|
* - `beneficiarySettings`: An object with the list of beneficiary IDs to
|
|
95
95
|
* trust (e.g., `{ beneficiaryIds: string[] }`).
|
|
96
96
|
* - `operationSettings`: An object with operation-level settings such as
|
|
97
|
-
* `accessToken`, `stagingToken`, `
|
|
97
|
+
* `accessToken`, `stagingToken`, `uiParentElementId`, and other optional
|
|
98
98
|
* parameters. See {@link BeneficiaryParams}.
|
|
99
99
|
*
|
|
100
100
|
* @returns A promise that resolves to an array of trusted beneficiaries.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beneficiaries.d.ts","sourceRoot":"","sources":["../../../src/beneficiaries/beneficiaries.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"beneficiaries.d.ts","sourceRoot":"","sources":["../../../src/beneficiaries/beneficiaries.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,KAAK,iBAAiB,EAGvB,MAAM,2CAA2C,CAAC;AAenD,OAAO,KAAK,EACV,WAAW,EAEX,6BAA6B,EAC7B,wBAAwB,EACxB,cAAc,EACf,MAAM,8BAA8B,CAAC;AAStC;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,CAAC,CAAC;IACxB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACvC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,gBAAgB,CACpC,sBAAsB,CAAC,EAAE,iBAAiB,CAAC,KAAK,CAAC,GAChD,OAAO,CAAC,wBAAwB,CAAC,CAuDnC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,cAAc,CAAC,EACnC,mBAAmB,EACnB,iBAAiB,GAClB,EAAE,iBAAiB,CAAC;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CA2BrE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,cAAc,CAAC,EACnC,mBAAmB,EACnB,iBAAiB,GAClB,EAAE,iBAAiB,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CA8B1D;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,iBAAiB,CAAC,EACtC,mBAAmB,EACnB,iBAAiB,GAClB,EAAE,iBAAiB,CAAC,6BAA6B,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAsCzE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,kBAAkB,CAAC,EACvC,mBAAmB,EACnB,iBAAiB,GAClB,EAAE,iBAAiB,CAAC;IACnB,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B,CAAC,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAwB1B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,oBAAoB,CAAC,EACzC,mBAAmB,EACnB,iBAAiB,GAClB,EAAE,iBAAiB,CAAC;IAAE,cAAc,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CA2B1E"}
|
|
@@ -99,7 +99,7 @@ export declare function updateBeneficiary({ beneficiarySettings, operationSettin
|
|
|
99
99
|
* - `beneficiarySettings`: An object with the list of beneficiary IDs to
|
|
100
100
|
* trust (e.g., `{ beneficiaryIds: string[] }`).
|
|
101
101
|
* - `operationSettings`: An object with operation-level settings such as
|
|
102
|
-
* `accessToken`, `stagingToken`, `
|
|
102
|
+
* `accessToken`, `stagingToken`, `uiParentElementId`, and other optional
|
|
103
103
|
* parameters.
|
|
104
104
|
*
|
|
105
105
|
* @returns A promise that resolves to an array of trusted beneficiaries.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beneficiaries.client.d.ts","sourceRoot":"","sources":["../../../../src/beneficiaries/client/beneficiaries.client.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,6BAA6B,EAGnC,MAAM,2CAA2C,CAAC;AAWnD,OAAO,KAAK,EACV,WAAW,EAEX,6BAA6B,EAC7B,wBAAwB,EACxB,cAAc,EACf,MAAM,+BAA+B,CAAC;AAQvC;;;;GAIG;AACH,MAAM,WAAW,uBAAuB,CAAC,CAAC;IACxC,mBAAmB,CAAC,EAAE,CAAC,CAAC;IACxB,iBAAiB,CAAC,EAAE,uBAAuB,CAAC;CAC7C;AAED;;GAEG;AACH,MAAM,WAAW,6BAA6B,CAAC,CAAC;IAC9C,mBAAmB,CAAC,EAAE,CAAC,CAAC;IACxB,iBAAiB,CAAC,EAAE,6BAA6B,CAAC;CACnD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,gBAAgB,CACpC,sBAAsB,CAAC,EAAE,uBAAuB,CAAC,KAAK,CAAC,GACtD,OAAO,CAAC,wBAAwB,CAAC,CAkCnC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,cAAc,CAAC,EACnC,mBAAmB,EACnB,iBAAiB,GAClB,EAAE,uBAAuB,CAAC;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"beneficiaries.client.d.ts","sourceRoot":"","sources":["../../../../src/beneficiaries/client/beneficiaries.client.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,6BAA6B,EAGnC,MAAM,2CAA2C,CAAC;AAWnD,OAAO,KAAK,EACV,WAAW,EAEX,6BAA6B,EAC7B,wBAAwB,EACxB,cAAc,EACf,MAAM,+BAA+B,CAAC;AAQvC;;;;GAIG;AACH,MAAM,WAAW,uBAAuB,CAAC,CAAC;IACxC,mBAAmB,CAAC,EAAE,CAAC,CAAC;IACxB,iBAAiB,CAAC,EAAE,uBAAuB,CAAC;CAC7C;AAED;;GAEG;AACH,MAAM,WAAW,6BAA6B,CAAC,CAAC;IAC9C,mBAAmB,CAAC,EAAE,CAAC,CAAC;IACxB,iBAAiB,CAAC,EAAE,6BAA6B,CAAC;CACnD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,gBAAgB,CACpC,sBAAsB,CAAC,EAAE,uBAAuB,CAAC,KAAK,CAAC,GACtD,OAAO,CAAC,wBAAwB,CAAC,CAkCnC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,cAAc,CAAC,EACnC,mBAAmB,EACnB,iBAAiB,GAClB,EAAE,uBAAuB,CAAC;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAsB3E;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,cAAc,CAAC,EACnC,mBAAmB,EACnB,iBAAiB,GAClB,EAAE,uBAAuB,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAyBhE;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,iBAAiB,CAAC,EACtC,mBAAmB,EACnB,iBAAiB,GAClB,EAAE,uBAAuB,CAAC,6BAA6B,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CA0B/E;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,kBAAkB,CAAC,EACvC,mBAAmB,EACnB,iBAAiB,GAClB,EAAE,6BAA6B,CAAC;IAC/B,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B,CAAC,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAyB1B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,oBAAoB,CAAC,EACzC,mBAAmB,EACnB,iBAAiB,GAClB,EAAE,uBAAuB,CAAC;IAAE,cAAc,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,GAAG,OAAO,CAChE,WAAW,EAAE,CACd,CAsBA"}
|
|
@@ -7,7 +7,7 @@ import { addBeneficiary, getBeneficiaries, getBeneficiary, untrustBeneficiaries,
|
|
|
7
7
|
*
|
|
8
8
|
* It can be accessed like this:
|
|
9
9
|
* ```ts
|
|
10
|
-
* import { beneficiaries } from
|
|
10
|
+
* import { beneficiaries } from '@qonto/embed-sdk/server/beneficiaries';
|
|
11
11
|
* ```
|
|
12
12
|
*
|
|
13
13
|
* Then, the beneficiaries object contains the functions to perform beneficiary operations:
|
|
@@ -43,7 +43,7 @@ export declare function getCards(getCardsParams?: CardClientParams<{
|
|
|
43
43
|
* - `operationSettings`: An object with `proxyEndpointDescriptor` (required), `stagingToken`,
|
|
44
44
|
* and other optional parameters.
|
|
45
45
|
* @returns A promise that resolves to a card.
|
|
46
|
-
* @throws `InvalidParametersError` If the cardId is not provided, not a string, or
|
|
46
|
+
* @throws `InvalidParametersError` If the `cardId` is not provided, not a string, or
|
|
47
47
|
* if proxyEndpointDescriptor is not provided.
|
|
48
48
|
* @throws `EmbedApiError` If the API request fails or returns an error.
|
|
49
49
|
*/
|
|
@@ -35,12 +35,12 @@ import { displayCard, getCard, getCards, orderCard, unlockCard } from './client/
|
|
|
35
35
|
*
|
|
36
36
|
* await cards.orderCard({
|
|
37
37
|
* cardSettings: { ... },
|
|
38
|
-
* operationSettings: {
|
|
38
|
+
* operationSettings: { accessToken, uiParentElementId: 'element-id' }
|
|
39
39
|
* });
|
|
40
40
|
*
|
|
41
41
|
* await cards.unlockCard({
|
|
42
42
|
* cardSettings: { cardId: '...' },
|
|
43
|
-
* operationSettings: {
|
|
43
|
+
* operationSettings: { accessToken, uiParentElementId: 'element-id' }
|
|
44
44
|
* });
|
|
45
45
|
* ```
|
|
46
46
|
*/
|
|
@@ -36,7 +36,7 @@ export declare function getCards(getCardsParams?: CardServerParams<{
|
|
|
36
36
|
* - `operationSettings`: An object with `accessToken` (optional, falls back to global auth),
|
|
37
37
|
* `stagingToken`, and other optional parameters.
|
|
38
38
|
* @returns A promise that resolves to a card.
|
|
39
|
-
* @throws `InvalidParametersError` If the cardId is not provided or not a string.
|
|
39
|
+
* @throws `InvalidParametersError` If the `cardId` is not provided or not a string.
|
|
40
40
|
* @throws `AuthenticationError` If the `accessToken` is invalid or missing.
|
|
41
41
|
* @throws `EmbedApiError` If the API request fails or returns an error.
|
|
42
42
|
*/
|
|
@@ -6,6 +6,23 @@ export declare const IFRAME_EVENTS: {
|
|
|
6
6
|
* Emitted when the iframe is ready to be used.
|
|
7
7
|
*/
|
|
8
8
|
READY: string;
|
|
9
|
+
/**
|
|
10
|
+
* Emitted when the mandate invitation link has loaded and the form is shown.
|
|
11
|
+
*/
|
|
12
|
+
MANDATE_LOADED: string;
|
|
13
|
+
/**
|
|
14
|
+
* Emitted when the mandate has been signed.
|
|
15
|
+
*/
|
|
16
|
+
MANDATE_SIGNED: string;
|
|
17
|
+
/**
|
|
18
|
+
* Emitted when the mandate could not be loaded or signed.
|
|
19
|
+
*/
|
|
20
|
+
MANDATE_ERROR: string;
|
|
21
|
+
/**
|
|
22
|
+
* Emitted when the content height changes. The SDK also uses it to resize
|
|
23
|
+
* the iframe.
|
|
24
|
+
*/
|
|
25
|
+
RESIZE: string;
|
|
9
26
|
};
|
|
10
27
|
/**
|
|
11
28
|
* List of possible actions that can be performed in the iframe.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/common/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,aAAa;IACxB;;OAEG;;CAEJ,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;CAUnB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY;;;;CAIxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;CAIpB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;CAIhC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,OAAO;;;;;;;CAOnB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;CAQpC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;CAQ7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;CAIhC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW;IACtB;;;;OAIG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAEH;;;;;OAKG;;CAEJ,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,4BAA4B,QAAS,CAAC;AAEnD;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB;;;;;;CAM7B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa;;;CAGzB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;CAI7B,CAAC;AAEF,eAAO,MAAM,UAAU;;;CAGtB,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/common/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,aAAa;IACxB;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;;OAGG;;CAEJ,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;CAUnB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY;;;;CAIxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;CAIpB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;CAIhC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,OAAO;;;;;;;CAOnB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;CAQpC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;CAQ7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;CAIhC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW;IACtB;;;;OAIG;;IAEH;;;OAGG;;IAEH;;;OAGG;;IAEH;;;;;OAKG;;CAEJ,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,4BAA4B,QAAS,CAAC;AAEnD;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB;;;;;;CAM7B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa;;;CAGzB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;CAI7B,CAAC;AAEF,eAAO,MAAM,UAAU;;;CAGtB,CAAC"}
|
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
import type { InitializeParams } from './initialize.types';
|
|
2
2
|
/**
|
|
3
|
-
* Initializes the SDK with the provided parameters.
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* to
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
3
|
+
* Initializes the SDK with the provided parameters. Calling this function is
|
|
4
|
+
* not mandatory, but in stateful environments like in a single page application
|
|
5
|
+
* running in a browser, it is recommended. The `initialize` function is useful
|
|
6
|
+
* to pass data to the SDK that otherwise would have to be passed in every
|
|
7
|
+
* function call.
|
|
8
|
+
* In order to call functions afterward without having to pass repetitive
|
|
9
|
+
* parameters to them, it is helpful to call this function before using any
|
|
10
|
+
* other SDK functions. In client side environments, it expects at least the
|
|
11
|
+
* `operationSettings.proxyEndpointDescriptor` param, while in server side
|
|
12
|
+
* environments it expects at least an `accessToken`.
|
|
13
|
+
* It's also useful to rely on the exposed SDK constants to pass some of the
|
|
14
|
+
* parameters.
|
|
13
15
|
* @param initializeParams - An object with the parameters to initialize the SDK.
|
|
14
|
-
* The only required parameter is the `
|
|
15
|
-
*
|
|
16
|
-
*
|
|
16
|
+
* The only required parameter is the `proxyEndpointDescriptor` in client
|
|
17
|
+
* environments or `accessToken` in server environments.
|
|
18
|
+
* - `accessToken`: The access token to authenticate the user. This has to be
|
|
19
|
+
* previously generated using the OAuth authentication flow. Only needed in
|
|
20
|
+
* server side usage, and not recommended in client side.
|
|
17
21
|
* - `environment`: Optional parameter to set the SDK's environment. If not provided,
|
|
18
22
|
* the SDK will default to `ENVIRONMENTS.PRODUCTION`. Use `ENVIRONMENTS.STAGING` to set
|
|
19
23
|
* the SDK to staging.
|
|
@@ -24,7 +28,11 @@ import type { InitializeParams } from './initialize.types';
|
|
|
24
28
|
* - `operationSettings`: Optional settings to configure the SDK's operations that will
|
|
25
29
|
* be performed after the initialization. This can be also provided when calling the
|
|
26
30
|
* operation functions themselves.
|
|
27
|
-
* - `uiParentElementId`: The id of the DOM element where the SDK will
|
|
31
|
+
* - `uiParentElementId`: The id of the DOM element where the SDK will render UI
|
|
32
|
+
* in those functions that involve rendering UI in the caller website. Normally,
|
|
33
|
+
* it will make more sense to add this param when calling functions that require
|
|
34
|
+
* rendering UI, because each function call will likely render the UI under a
|
|
35
|
+
* different parent.
|
|
28
36
|
* - `mfaPreference`: The MFA preference to use for the operations. This can be either
|
|
29
37
|
* `MFA_METHODS.PASSKEY`, `MFA_METHODS.PAIRED_DEVICE` or `MFA_METHODS.SMS_OTP`. If not
|
|
30
38
|
* provided, the SDK will default to `MFA_METHODS.PASSKEY`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../../../../src/common/initialize/initialize.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAG3D
|
|
1
|
+
{"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../../../../src/common/initialize/initialize.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAG3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AACH,wBAAgB,UAAU,CAAC,gBAAgB,EAAE,gBAAgB,QAqC5D;AAED;;;;GAIG;AACH,wBAAgB,MAAM,SAMrB"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { UIParentElementId } from '@validation/operation-settings-validation.ts';
|
|
2
2
|
import type { IframeMessage } from './iframe.types';
|
|
3
|
+
export interface IframeFrameEvent {
|
|
4
|
+
eventId: string;
|
|
5
|
+
payload?: Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
type FrameEventHandler = (event: IframeFrameEvent) => void;
|
|
3
8
|
interface IframeOptions {
|
|
4
9
|
parentElementId: UIParentElementId;
|
|
5
10
|
iframeUrl: string;
|
|
@@ -10,11 +15,15 @@ export declare class EmbedIframe {
|
|
|
10
15
|
private iframe;
|
|
11
16
|
private parentElement;
|
|
12
17
|
private messageListeners;
|
|
18
|
+
private frameEventHandlers;
|
|
13
19
|
private readonly defaultTimeout;
|
|
14
20
|
private targetOrigin;
|
|
15
21
|
constructor(options: IframeOptions);
|
|
16
22
|
initialize(): Promise<EmbedIframe>;
|
|
17
23
|
postMessage(message: IframeMessage): Promise<unknown>;
|
|
24
|
+
onFrameEvent(handler: FrameEventHandler): () => void;
|
|
25
|
+
private frameEventListener;
|
|
26
|
+
private resize;
|
|
18
27
|
private addMessageListener;
|
|
19
28
|
private removeMessageListener;
|
|
20
29
|
destroy(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embed-iframe.d.ts","sourceRoot":"","sources":["../../../src/iframe/embed-iframe.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AAGtF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGpD,UAAU,aAAa;IACrB,eAAe,EAAE,iBAAiB,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,WAAW;
|
|
1
|
+
{"version":3,"file":"embed-iframe.d.ts","sourceRoot":"","sources":["../../../src/iframe/embed-iframe.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AAGtF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGpD,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,KAAK,iBAAiB,GAAG,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;AAE3D,UAAU,aAAa;IACrB,eAAe,EAAE,iBAAiB,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,WAAW;IASV,OAAO,CAAC,OAAO;IAR3B,OAAO,CAAC,MAAM,CAAkC;IAChD,OAAO,CAAC,aAAa,CAA4B;IACjD,OAAO,CAAC,gBAAgB,CACZ;IACZ,OAAO,CAAC,kBAAkB,CAAqC;IAC/D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAChD,OAAO,CAAC,YAAY,CAAS;gBAET,OAAO,EAAE,aAAa;IAKpC,UAAU,IAAI,OAAO,CAAC,WAAW,CAAC;IA6CxC,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC;IA+BrD,YAAY,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,IAAI;IAOpD,OAAO,CAAC,kBAAkB,CA2BxB;IAEF,OAAO,CAAC,MAAM;IAWd,OAAO,CAAC,kBAAkB;IAa1B,OAAO,CAAC,qBAAqB;IAc7B,OAAO,IAAI,IAAI;CAiBhB"}
|
|
@@ -14,7 +14,7 @@ import type { CreatePaymentLinkSettings, PaymentLinkParams } from '../shared/pay
|
|
|
14
14
|
* `proxyEndpointDescriptor` (required).
|
|
15
15
|
* @returns Promise resolving to the full URL as a string, which can be used to launch the payment link creation flow in an iframe or browser.
|
|
16
16
|
* @throws `InvalidParametersError` If `proxyEndpointDescriptor` is not provided, or if the provided items array is invalid, or if callbackUrl is missing or invalid.
|
|
17
|
-
* @throws `AuthenticationError` If authentication fails (e.g.,
|
|
17
|
+
* @throws `AuthenticationError` If authentication fails (e.g., proxy authentication is rejected).
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
20
|
* ```
|
|
@@ -42,7 +42,7 @@ export declare const getPaymentLinkCreationFlowUrl: ({ paymentLinkSettings, oper
|
|
|
42
42
|
* `proxyEndpointDescriptor` (required).
|
|
43
43
|
* @returns This function redirects the browser to the payment link creation flow. Due to the redirect, the returned promise will not resolve.
|
|
44
44
|
* @throws `InvalidParametersError` If `proxyEndpointDescriptor` is not provided, or if the provided items array is invalid, or if callbackUrl is missing or invalid.
|
|
45
|
-
* @throws `AuthenticationError` If authentication fails (e.g.,
|
|
45
|
+
* @throws `AuthenticationError` If authentication fails (e.g., proxy authentication is rejected).
|
|
46
46
|
*
|
|
47
47
|
* @example
|
|
48
48
|
* ```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const E={READY:"qonto.ready"},_={CARD_SEE:"card.see",CARD_SEE_DETAILS:"card.see-details",CARD_ORDER:"card.order",CARD_UNLOCK:"card.unlock",CARD_SHOW_PIN:"card.show.pin",CARD_SET_PIN:"card.set.pin",TRANSFER_SINGLE_CREATE:"transfer.single.create",TRANSFER_BULK_CREATE:"transfer.bulk.create",BENEFICIARIES_TRUST:"beneficiary.trust"},e={PRODUCTION:"production",STAGING:"staging",LOCAL:"local"},A={MASTER:"master",SANDBOX:"sandbox",QA:"qa"},T={ATM:"atm",FALLBACK:"fallback",FEES:"fees",FINANCE:"finance",FOOD_AND_GROCERY:"food_and_grocery",GAS_STATION:"gas_station",HARDWARE_AND_EQUIPMENT:"hardware_and_equipment",HOTEL_AND_LODGING:"hotel_and_lodging",INSURANCE:"insurance",IT_AND_ELECTRONICS:"it_and_electronics",LEGAL_AND_ACCOUNTING:"legal_and_accounting",LOGISTICS:"logistics",MANUFACTURING:"manufacturing",MARKETING:"marketing",OFFICE_RENTAL:"office_rental",OFFICE_SUPPLY:"office_supply",ONLINE_SERVICE:"online_service",OTHER_EXPENSE:"other_expense",OTHER_INCOME:"other_income",OTHER_SERVICE:"other_service",PENDING:"pending",REFUND:"refund",RESTAURANT_AND_BAR:"restaurant_and_bar",SALES:"sales",SALARY:"salary",SUBSCRIPTION:"subscription",TAX:"tax",TRANSPORT:"transport",TREASURY_AND_INTERCO:"treasury_and_interco",UTILITY:"utility",VOUCHER:"voucher"},N={PENDING:"pending",VALIDATED:"validated",DECLINED:"declined"},
|
|
1
|
+
const E={READY:"qonto.ready",MANDATE_LOADED:"qonto.mandate.loaded",MANDATE_SIGNED:"qonto.mandate.signed",MANDATE_ERROR:"qonto.mandate.error",RESIZE:"qonto.resize"},_={CARD_SEE:"card.see",CARD_SEE_DETAILS:"card.see-details",CARD_ORDER:"card.order",CARD_UNLOCK:"card.unlock",CARD_SHOW_PIN:"card.show.pin",CARD_SET_PIN:"card.set.pin",TRANSFER_SINGLE_CREATE:"transfer.single.create",TRANSFER_BULK_CREATE:"transfer.bulk.create",BENEFICIARIES_TRUST:"beneficiary.trust"},e={PRODUCTION:"production",STAGING:"staging",LOCAL:"local"},A={MASTER:"master",SANDBOX:"sandbox",QA:"qa"},T={ATM:"atm",FALLBACK:"fallback",FEES:"fees",FINANCE:"finance",FOOD_AND_GROCERY:"food_and_grocery",GAS_STATION:"gas_station",HARDWARE_AND_EQUIPMENT:"hardware_and_equipment",HOTEL_AND_LODGING:"hotel_and_lodging",INSURANCE:"insurance",IT_AND_ELECTRONICS:"it_and_electronics",LEGAL_AND_ACCOUNTING:"legal_and_accounting",LOGISTICS:"logistics",MANUFACTURING:"manufacturing",MARKETING:"marketing",OFFICE_RENTAL:"office_rental",OFFICE_SUPPLY:"office_supply",ONLINE_SERVICE:"online_service",OTHER_EXPENSE:"other_expense",OTHER_INCOME:"other_income",OTHER_SERVICE:"other_service",PENDING:"pending",REFUND:"refund",RESTAURANT_AND_BAR:"restaurant_and_bar",SALES:"sales",SALARY:"salary",SUBSCRIPTION:"subscription",TAX:"tax",TRANSPORT:"transport",TREASURY_AND_INTERCO:"treasury_and_interco",UTILITY:"utility",VOUCHER:"voucher"},N={PENDING:"pending",VALIDATED:"validated",DECLINED:"declined"},n={EN:"en",FR:"fr",DE:"de",ES:"es",IT:"it",PT:"pt"},R={BENEFICIARY_BIC_INVALID:"beneficiary_bic_invalid",BENEFICIARY_IBAN_INVALID:"beneficiary_iban_invalid",BENEFICIARY_STATUS:"beneficiary_status",BENEFICIARY_NETWORK_RULES_ERROR:"beneficiary_network_rules_error",ORGANISATION_COMPLIANCE_REASONS:"organisation_compliance_reasons",DEBIT_ACCOUNT_INSUFFICIENT_FUNDS:"debit_account_insufficient_funds",QONTO_PROCESSING_FAILED:"qonto_processing_failed"},a={PENDING:"pending",PROCESSING:"processing",CANCELED:"canceled",DECLINED:"declined",SETTLED:"settled",FAILED:"failed",COMPLETED:"completed"},I={PENDING:"pending",DECLINED:"declined",COMPLETED:"completed"},C={PASSKEY:"passkey",SMS_OTP:"sms-otp",PAIRED_DEVICE:"paired-device",MOCK:"mock"},S=3e4,i={MATCH_RESULT_MATCH:"MATCH_RESULT_MATCH",MATCH_RESULT_NO_MATCH:"MATCH_RESULT_NO_MATCH",MATCH_RESULT_CLOSE_MATCH:"MATCH_RESULT_CLOSE_MATCH",MATCH_RESULT_NOT_POSSIBLE:"MATCH_RESULT_NOT_POSSIBLE",MATCH_RESULT_UNSPECIFIED:"MATCH_RESULT_UNSPECIFIED"},r={ACCEPT:"ACCEPT",REJECT:"REJECT"},t={CARD_DISPLAY:"display_card",PAYMENT_LINK_CREATE:"create_payment_link",SEPA_TRANSFER_CREATE:"create_sepa_transfer"},D={PRECONDITION_REQUIRED:428,UNAUTHORIZED:401};export{_ as ACTIONS,T as ACTIVITY_TAGS,S as AMOUNT_REQUIRING_ATTACHMENTS,t as AUTH_LINK_ACTIONS,N as BENEFICIARY_STATUSES,A as BRANCHES,e as ENVIRONMENTS,D as HTTP_CODES,E as IFRAME_EVENTS,n as LOCALES,C as MFA_METHODS,I as TRANSACTION_STATUSES,R as TRANSFER_DECLINE_REASONS,a as TRANSFER_STATUSES,i as VOP_CHECK_RESULTS,r as VOP_DECISIONS};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getUIParentElement as e}from"../common/common.utils.js";import{IFRAME_EVENTS as t}from"../common/constants.js";import{buildIframeMessage as s}from"./iframe-message-builder.js";import{EmbedOperationError as i}from"../errors/EmbedOperationError.js";class n{constructor(e){this.options=e,this.iframe=null,this.parentElement=null,this.messageListeners=new Map,this.defaultTimeout=3e4;const
|
|
1
|
+
import{getUIParentElement as e}from"../common/common.utils.js";import{IFRAME_EVENTS as t}from"../common/constants.js";import{buildIframeMessage as s}from"./iframe-message-builder.js";import{EmbedOperationError as i}from"../errors/EmbedOperationError.js";class n{constructor(e){this.options=e,this.iframe=null,this.parentElement=null,this.messageListeners=new Map,this.frameEventHandlers=new Set,this.defaultTimeout=3e4,this.frameEventListener=e=>{if(!this.iframe||e.source!==this.iframe.contentWindow||e.origin!==this.targetOrigin||"string"!=typeof e.data?.eventId)return;const{eventId:s,payload:i}=e.data;s!==t.READY&&(s===t.RESIZE&&this.resize(i?.height),this.frameEventHandlers.forEach((e=>{try{e({eventId:s,payload:i})}catch(e){console.error(e)}})))};const s=new URL(e.iframeUrl);this.targetOrigin=`${s.protocol}//${s.host}`}async initialize(){if(this.iframe)return this;if(this.parentElement=e(this.options.parentElementId),!this.parentElement)throw new i(`Could not install the authentication UI because the parent element with id ${this.options.parentElementId} was not found.\nPlease make sure to pass a valid parentElementId when calling the method.`);return new Promise(((e,s)=>{this.iframe=document.createElement("iframe"),this.iframe.src=this.options.iframeUrl,this.iframe.style.width="100%",this.iframe.style.height="100%",this.iframe.style.border="none",window.addEventListener("message",this.frameEventListener);const n=this.options.timeout||this.defaultTimeout,r=setTimeout((()=>{window.removeEventListener("message",a),window.removeEventListener("message",this.frameEventListener),s(new i(`Could not install the authentication UI because the timeout of ${n}ms was reached.\nPlease make sure the application can reach the Internet.`))}),n),a=s=>{s.data.eventId===t.READY&&(clearTimeout(r),window.removeEventListener("message",a),e(this))};window.addEventListener("message",a),this.parentElement?.appendChild(this.iframe)}))}postMessage(e){if(!this.iframe||!this.iframe.contentWindow)return Promise.reject(new i("Attempted to perform an Embed operation without having the authentication UI initialized."));const t=s(e);return new Promise(((e,s)=>{const n=r=>{if(r.data?.actionId===t.actionId){if("error"===r.data.status)return this.removeMessageListener(t.actionId,n),s(new i(`An error occurred when performing the action ${t.actionId}.\n${JSON.stringify(r.data.payload)}`));this.removeMessageListener(t.actionId,n),e(r.data.payload)}};this.addMessageListener(t.actionId,n),this.iframe?.contentWindow?.postMessage(t,this.targetOrigin)}))}onFrameEvent(e){return this.frameEventHandlers.add(e),()=>{this.frameEventHandlers.delete(e)}}resize(e){this.iframe&&"number"==typeof e&&Number.isFinite(e)&&e>0&&(this.iframe.style.height=`${Math.ceil(e)}px`)}addMessageListener(e,t){this.messageListeners.has(e)||this.messageListeners.set(e,[]);this.messageListeners.get(e).push(t),window.addEventListener("message",t)}removeMessageListener(e,t){const s=this.messageListeners.get(e);if(s){const e=s.indexOf(t);-1!==e&&(s.splice(e,1),window.removeEventListener("message",t))}}destroy(){this.messageListeners.forEach((e=>{e.forEach((e=>{window.removeEventListener("message",e)}))})),this.messageListeners.clear(),window.removeEventListener("message",this.frameEventListener),this.frameEventHandlers.clear(),this.iframe&&this.parentElement&&(this.parentElement.removeChild(this.iframe),this.iframe=null)}}export{n as EmbedIframe};
|