@qonto/embed-sdk 0.56.0 → 0.58.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/auth-links.d.ts +1 -1
- package/dist/auth-links/auth-links.d.ts.map +1 -1
- package/dist/auth-links/client/auth-links.client.d.ts +57 -0
- package/dist/auth-links/client/auth-links.client.d.ts.map +1 -0
- package/dist/auth-links/client/auth-links.client.test.d.ts +2 -0
- package/dist/auth-links/client/auth-links.client.test.d.ts.map +1 -0
- package/dist/auth-links/index.d.ts +14 -6
- package/dist/auth-links/index.d.ts.map +1 -1
- package/dist/auth-links/index.server.d.ts +30 -0
- package/dist/auth-links/index.server.d.ts.map +1 -0
- package/dist/auth-links/server/auth-links.server.d.ts +56 -0
- package/dist/auth-links/server/auth-links.server.d.ts.map +1 -0
- package/dist/auth-links/server/auth-links.server.test.d.ts +2 -0
- package/dist/auth-links/server/auth-links.server.test.d.ts.map +1 -0
- package/dist/auth-links/shared/auth-links.api.d.ts.map +1 -0
- package/dist/auth-links/shared/auth-links.serializer.d.ts +6 -0
- package/dist/auth-links/shared/auth-links.serializer.d.ts.map +1 -0
- package/dist/auth-links/shared/auth-links.shared.test.d.ts +2 -0
- package/dist/auth-links/shared/auth-links.shared.test.d.ts.map +1 -0
- package/dist/auth-links/shared/auth-links.types.d.ts.map +1 -0
- package/dist/auth-links/shared/auth-links.validate.d.ts.map +1 -0
- package/dist/auth-links/shared/auth-links.validate.test.d.ts.map +1 -0
- package/dist/cards/cards.api.d.ts +1 -1
- package/dist/cards/cards.api.d.ts.map +1 -1
- package/dist/index.umd.js +3 -3
- package/dist/payment-links/payment-links.d.ts.map +1 -1
- package/dist/sepa-transfers/bulk-transfers/client/bulk-transfers.client.d.ts +2 -4
- package/dist/sepa-transfers/bulk-transfers/client/bulk-transfers.client.d.ts.map +1 -1
- package/dist/sepa-transfers/bulk-transfers/shared/bulk-transfers.api.d.ts +4 -1
- package/dist/sepa-transfers/bulk-transfers/shared/bulk-transfers.api.d.ts.map +1 -1
- package/dist/sepa-transfers/client/sepa-transfers.client.d.ts +1 -1
- package/dist/sepa-transfers/client/sepa-transfers.client.d.ts.map +1 -1
- package/dist/sepa-transfers/sepa-transfers.d.ts +1 -1
- package/dist/sepa-transfers/sepa-transfers.d.ts.map +1 -1
- package/dist/sepa-transfers/server/sepa-transfers.server.d.ts +1 -1
- package/dist/sepa-transfers/server/sepa-transfers.server.d.ts.map +1 -1
- package/dist/sepa-transfers/shared/sepa-transfers.types.d.ts +1 -1
- package/dist/sepa-transfers/shared/sepa-transfers.types.d.ts.map +1 -1
- package/dist/server/auth-links/auth-links.d.ts +1 -1
- package/dist/server/auth-links/auth-links.d.ts.map +1 -1
- package/dist/server/auth-links/client/auth-links.client.d.ts +57 -0
- package/dist/server/auth-links/client/auth-links.client.d.ts.map +1 -0
- package/dist/server/auth-links/client/auth-links.client.test.d.ts +2 -0
- package/dist/server/auth-links/client/auth-links.client.test.d.ts.map +1 -0
- package/dist/server/auth-links/index.d.ts +14 -6
- package/dist/server/auth-links/index.d.ts.map +1 -1
- package/dist/server/auth-links/index.server.d.ts +30 -0
- package/dist/server/auth-links/index.server.d.ts.map +1 -0
- package/dist/server/auth-links/server/auth-links.server.d.ts +56 -0
- package/dist/server/auth-links/server/auth-links.server.d.ts.map +1 -0
- package/dist/server/auth-links/server/auth-links.server.test.d.ts +2 -0
- package/dist/server/auth-links/server/auth-links.server.test.d.ts.map +1 -0
- package/dist/server/auth-links/shared/auth-links.api.d.ts.map +1 -0
- package/dist/server/auth-links/shared/auth-links.serializer.d.ts +6 -0
- package/dist/server/auth-links/shared/auth-links.serializer.d.ts.map +1 -0
- package/dist/server/auth-links/shared/auth-links.shared.test.d.ts +2 -0
- package/dist/server/auth-links/shared/auth-links.shared.test.d.ts.map +1 -0
- package/dist/server/auth-links/shared/auth-links.types.d.ts.map +1 -0
- package/dist/server/auth-links/shared/auth-links.validate.d.ts.map +1 -0
- package/dist/server/auth-links/shared/auth-links.validate.test.d.ts.map +1 -0
- package/dist/server/cards/cards.api.d.ts +1 -1
- package/dist/server/cards/cards.api.d.ts.map +1 -1
- package/dist/server/index.server.umd.js +1 -1
- package/dist/server/payment-links/payment-links.d.ts.map +1 -1
- package/dist/server/sepa-transfers/bulk-transfers/client/bulk-transfers.client.d.ts +2 -4
- package/dist/server/sepa-transfers/bulk-transfers/client/bulk-transfers.client.d.ts.map +1 -1
- package/dist/server/sepa-transfers/bulk-transfers/shared/bulk-transfers.api.d.ts +4 -1
- package/dist/server/sepa-transfers/bulk-transfers/shared/bulk-transfers.api.d.ts.map +1 -1
- package/dist/server/sepa-transfers/client/sepa-transfers.client.d.ts +1 -1
- package/dist/server/sepa-transfers/client/sepa-transfers.client.d.ts.map +1 -1
- package/dist/server/sepa-transfers/sepa-transfers.d.ts +1 -1
- package/dist/server/sepa-transfers/sepa-transfers.d.ts.map +1 -1
- package/dist/server/sepa-transfers/server/sepa-transfers.server.d.ts +1 -1
- package/dist/server/sepa-transfers/server/sepa-transfers.server.d.ts.map +1 -1
- package/dist/server/sepa-transfers/shared/sepa-transfers.types.d.ts +1 -1
- package/dist/server/sepa-transfers/shared/sepa-transfers.types.d.ts.map +1 -1
- package/dist/server/src/auth-links/auth-links.js +1 -1
- package/dist/server/src/auth-links/shared/auth-links.api.js +1 -0
- package/dist/server/src/auth-links/shared/auth-links.serializer.js +1 -0
- package/dist/server/src/auth-links/shared/auth-links.validate.js +1 -0
- package/dist/server/src/sepa-transfers/server/sepa-transfers.server.js +1 -1
- package/dist/server/types/types.public-api.d.ts +1 -1
- package/dist/server/types/types.public-api.d.ts.map +1 -1
- package/dist/server/ui/ui-elements/localize/generated/locales/de.d.ts.map +1 -1
- package/dist/server/ui/ui-elements/localize/generated/locales/es.d.ts.map +1 -1
- package/dist/server/ui/ui-elements/localize/generated/locales/fr.d.ts.map +1 -1
- package/dist/server/ui/ui-elements/localize/generated/locales/it.d.ts.map +1 -1
- package/dist/server/ui/ui-elements/localize/generated/locales/nl.d.ts.map +1 -1
- package/dist/server/ui/ui-elements/localize/generated/locales/pt.d.ts.map +1 -1
- package/dist/src/auth-links/auth-links.js +1 -1
- package/dist/src/auth-links/client/auth-links.client.js +1 -0
- package/dist/src/auth-links/index.js +1 -1
- package/dist/src/auth-links/shared/auth-links.api.js +1 -0
- package/dist/src/auth-links/shared/auth-links.serializer.js +1 -0
- package/dist/src/auth-links/shared/auth-links.validate.js +1 -0
- package/dist/src/cards/cards.api.js +1 -1
- package/dist/src/payment-links/payment-links.js +1 -1
- package/dist/src/sepa-transfers/bulk-transfers/client/bulk-transfers.client.js +1 -1
- package/dist/src/sepa-transfers/bulk-transfers/shared/bulk-transfers.api.js +1 -1
- package/dist/src/sepa-transfers/client/sepa-transfers.client.js +1 -1
- package/dist/types/types.public-api.d.ts +1 -1
- package/dist/types/types.public-api.d.ts.map +1 -1
- package/dist/ui/ui-elements/localize/generated/locales/de.d.ts.map +1 -1
- package/dist/ui/ui-elements/localize/generated/locales/es.d.ts.map +1 -1
- package/dist/ui/ui-elements/localize/generated/locales/fr.d.ts.map +1 -1
- package/dist/ui/ui-elements/localize/generated/locales/it.d.ts.map +1 -1
- package/dist/ui/ui-elements/localize/generated/locales/nl.d.ts.map +1 -1
- package/dist/ui/ui-elements/localize/generated/locales/pt.d.ts.map +1 -1
- package/package.json +5 -1
- package/dist/auth-links/auth-links.api.d.ts.map +0 -1
- package/dist/auth-links/auth-links.public-api.d.ts +0 -6
- package/dist/auth-links/auth-links.public-api.d.ts.map +0 -1
- package/dist/auth-links/auth-links.types.d.ts.map +0 -1
- package/dist/auth-links/auth-links.validate.d.ts.map +0 -1
- package/dist/auth-links/auth-links.validate.test.d.ts.map +0 -1
- package/dist/server/auth-links/auth-links.api.d.ts.map +0 -1
- package/dist/server/auth-links/auth-links.public-api.d.ts +0 -6
- package/dist/server/auth-links/auth-links.public-api.d.ts.map +0 -1
- package/dist/server/auth-links/auth-links.types.d.ts.map +0 -1
- package/dist/server/auth-links/auth-links.validate.d.ts.map +0 -1
- package/dist/server/auth-links/auth-links.validate.test.d.ts.map +0 -1
- package/dist/server/src/auth-links/auth-links.api.js +0 -1
- package/dist/server/src/auth-links/auth-links.public-api.js +0 -1
- package/dist/server/src/auth-links/auth-links.validate.js +0 -1
- package/dist/server/src/auth-links/index.js +0 -1
- package/dist/src/auth-links/auth-links.api.js +0 -1
- package/dist/src/auth-links/auth-links.public-api.js +0 -1
- package/dist/src/auth-links/auth-links.validate.js +0 -1
- /package/dist/auth-links/{auth-links.api.d.ts → shared/auth-links.api.d.ts} +0 -0
- /package/dist/auth-links/{auth-links.types.d.ts → shared/auth-links.types.d.ts} +0 -0
- /package/dist/auth-links/{auth-links.validate.d.ts → shared/auth-links.validate.d.ts} +0 -0
- /package/dist/auth-links/{auth-links.validate.test.d.ts → shared/auth-links.validate.test.d.ts} +0 -0
- /package/dist/server/auth-links/{auth-links.api.d.ts → shared/auth-links.api.d.ts} +0 -0
- /package/dist/server/auth-links/{auth-links.types.d.ts → shared/auth-links.types.d.ts} +0 -0
- /package/dist/server/auth-links/{auth-links.validate.d.ts → shared/auth-links.validate.d.ts} +0 -0
- /package/dist/server/auth-links/{auth-links.validate.test.d.ts → shared/auth-links.validate.test.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment-links.d.ts","sourceRoot":"","sources":["../../src/payment-links/payment-links.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"payment-links.d.ts","sourceRoot":"","sources":["../../src/payment-links/payment-links.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,yBAAyB,EACzB,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAM/B;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,6BAA6B,GAAU,6CAGjD,iBAAiB,CAAC,yBAAyB,CAAC,KAAG,OAAO,CAAC,MAAM,CAsB/D,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,iCAAiC,GAAU,6CAGrD,iBAAiB,CAAC,yBAAyB,CAAC,KAAG,OAAO,CAAC,IAAI,CAM7D,CAAC"}
|
|
@@ -33,10 +33,8 @@ interface CreateBulkTransferClientParams {
|
|
|
33
33
|
* Creates a new SEPA bulk transfer with Verification of Payee (VoP) checks.
|
|
34
34
|
* This function is only available in client-side (browser) environments as it requires UI interaction.
|
|
35
35
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* @param params - An object containing bulk transfer settings and operation settings.
|
|
36
|
+
* @param params - An object containing bulk transfer settings and operation settings with
|
|
37
|
+
* proxyRequestFunction or proxyEndpointDescriptor (required).
|
|
40
38
|
* @returns As a yielded value, VoP check results for all unique beneficiaries.
|
|
41
39
|
* As the final return value, an object containing the created bulk transfer and metadata
|
|
42
40
|
* including the idempotency key.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bulk-transfers.client.d.ts","sourceRoot":"","sources":["../../../../src/sepa-transfers/bulk-transfers/client/bulk-transfers.client.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"bulk-transfers.client.d.ts","sourceRoot":"","sources":["../../../../src/sepa-transfers/bulk-transfers/client/bulk-transfers.client.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAiBzF,OAAO,KAAK,EACV,YAAY,EAEZ,oBAAoB,EACpB,0BAA0B,EAC1B,eAAe,EACf,wBAAwB,EACxB,8BAA8B,EAC9B,+BAA+B,EAEhC,MAAM,gCAAgC,CAAC;AAMxC;;GAEG;AACH,MAAM,WAAW,wBAAwB,CAAC,CAAC;IACzC,oBAAoB,CAAC,EAAE,CAAC,CAAC;IACzB,iBAAiB,CAAC,EAAE,uBAAuB,CAAC;CAC7C;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACpC,sBAAsB,CAAC,EAAE,wBAAwB,CAAC,KAAK,CAAC,GACvD,OAAO,CAAC,wBAAwB,CAAC,CAkCnC;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,EACpC,oBAAoB,EACpB,iBAAiB,GAClB,EAAE,wBAAwB,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,CAsBnE;AAwBD;;GAEG;AACH,UAAU,8BAA8B;IACtC,oBAAoB,EAAE,oBAAoB,CAAC,8BAA8B,CAAC,CAAC;IAC3E,iBAAiB,CAAC,EAAE,uBAAuB,CAAC;CAC7C;AAED;;;;;;;;;GASG;AACH,wBAAuB,kBAAkB,CAAC,EACxC,oBAAoB,EACpB,iBAAiB,GAClB,EAAE,8BAA8B,GAAG,cAAc,CAChD,+BAA+B,EAAE,EACjC,0BAA0B,GAAG,SAAS,CACvC,CAoEA"}
|
|
@@ -18,9 +18,11 @@ interface GetBulkTransfersApiResponse {
|
|
|
18
18
|
interface GetBulkTransferParams extends AuthParams {
|
|
19
19
|
bulkTransferId: string;
|
|
20
20
|
}
|
|
21
|
-
export interface CreateBulkTransferParams
|
|
21
|
+
export interface CreateBulkTransferParams {
|
|
22
22
|
bulkTransfers: NewBulkTransfer[];
|
|
23
23
|
bankAccountId: string;
|
|
24
|
+
accessToken?: string;
|
|
25
|
+
stagingToken?: string;
|
|
24
26
|
scaSessionToken?: string;
|
|
25
27
|
idempotencyKey: string;
|
|
26
28
|
}
|
|
@@ -38,6 +40,7 @@ export declare function prepareGetBulkTransferCall({ bulkTransferId, accessToken
|
|
|
38
40
|
stagingToken?: string;
|
|
39
41
|
}): NetworkCallDescriptor;
|
|
40
42
|
export declare function getBulkTransfer({ accessToken, stagingToken, bulkTransferId, }: GetBulkTransferParams): Promise<BulkTransferDataObject>;
|
|
43
|
+
export declare function prepareCreateBulkTransferCall({ bulkTransfers, bankAccountId, accessToken, stagingToken, scaSessionToken, idempotencyKey, }: CreateBulkTransferParams): NetworkCallDescriptor;
|
|
41
44
|
export declare function createBulkTransfer({ bulkTransfers, accessToken, stagingToken, scaSessionToken, bankAccountId, idempotencyKey, }: CreateBulkTransferParams): Promise<BulkTransferDataObject>;
|
|
42
45
|
export declare function prepareVerifySepaPayeesCall({ sepaPayees, accessToken, stagingToken, }: VerifySepaPayeesParams): NetworkCallDescriptor;
|
|
43
46
|
export declare function verifySepaPayees({ sepaPayees, accessToken, stagingToken, }: VerifySepaPayeesParams): Promise<VerifyBulkSepaPayeeApiResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bulk-transfers.api.d.ts","sourceRoot":"","sources":["../../../../src/sepa-transfers/bulk-transfers/shared/bulk-transfers.api.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,4BAA4B,EAC5B,kBAAkB,EACnB,MAAM,6CAA6C,CAAC;AAErD,OAAO,EACL,KAAK,qBAAqB,EAG3B,MAAM,yBAAyB,CAAC;AAKjC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAC;AAG7E,OAAO,KAAK,EACV,sBAAsB,EACtB,eAAe,EACf,8BAA8B,EAC/B,MAAM,wBAAwB,CAAC;AAGhC,UAAU,UAAU;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,sBAAsB;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACzC;AAED,UAAU,2BAA2B;IACnC,aAAa,EAAE,sBAAsB,EAAE,CAAC;IACxC,IAAI,EAAE,4BAA4B,CAAC;CACpC;AAED,UAAU,qBAAsB,SAAQ,UAAU;IAChD,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"bulk-transfers.api.d.ts","sourceRoot":"","sources":["../../../../src/sepa-transfers/bulk-transfers/shared/bulk-transfers.api.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,4BAA4B,EAC5B,kBAAkB,EACnB,MAAM,6CAA6C,CAAC;AAErD,OAAO,EACL,KAAK,qBAAqB,EAG3B,MAAM,yBAAyB,CAAC;AAKjC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAC;AAG7E,OAAO,KAAK,EACV,sBAAsB,EACtB,eAAe,EACf,8BAA8B,EAC/B,MAAM,wBAAwB,CAAC;AAGhC,UAAU,UAAU;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,sBAAsB;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACzC;AAED,UAAU,2BAA2B;IACnC,aAAa,EAAE,sBAAsB,EAAE,CAAC;IACxC,IAAI,EAAE,4BAA4B,CAAC;CACpC;AAED,UAAU,qBAAsB,SAAQ,UAAU;IAChD,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,wBAAwB;IACvC,aAAa,EAAE,eAAe,EAAE,CAAC;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,sBAAsB;IAC9B,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,uBAAuB,4BAA4B,CAAC;AAEjE,wBAAgB,2BAA2B,CAAC,EAC1C,kBAAkB,EAClB,WAAW,EACX,YAAY,GACb,EAAE,sBAAsB,GAAG,qBAAqB,CAgBhD;AAED,wBAAsB,gBAAgB,CAAC,EACrC,WAAW,EACX,YAAY,EACZ,kBAAkB,GACnB,EAAE,sBAAsB,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAe/D;AAED,wBAAgB,0BAA0B,CAAC,EACzC,cAAc,EACd,WAAW,EACX,YAAY,GACb,EAAE;IACD,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,qBAAqB,CAWxB;AAED,wBAAsB,eAAe,CAAC,EACpC,WAAW,EACX,YAAY,EACZ,cAAc,GACf,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAUzD;AAED,wBAAgB,6BAA6B,CAAC,EAC5C,aAAa,EACb,aAAa,EACb,WAAW,EACX,YAAY,EACZ,eAAe,EACf,cAAc,GACf,EAAE,wBAAwB,GAAG,qBAAqB,CAmBlD;AAED,wBAAsB,kBAAkB,CAAC,EACvC,aAAa,EACb,WAAW,EACX,YAAY,EACZ,eAAe,EACf,aAAa,EACb,cAAc,GACf,EAAE,wBAAwB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAqC5D;AAED,wBAAgB,2BAA2B,CAAC,EAC1C,UAAU,EACV,WAAW,EACX,YAAY,GACb,EAAE,sBAAsB,GAAG,qBAAqB,CAchD;AAED,wBAAsB,gBAAgB,CAAC,EACrC,UAAU,EACV,WAAW,EACX,YAAY,GACb,EAAE,sBAAsB,GAAG,OAAO,CAAC,8BAA8B,CAAC,CASlE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuthLinkRequestResult } from '@auth-links/auth-links.types';
|
|
1
|
+
import type { AuthLinkRequestResult } from '@auth-links/shared/auth-links.types';
|
|
2
2
|
import type { ClientOperationSettings } from '@validation/operation-settings-validation';
|
|
3
3
|
import type { BeneficiaryInformationForVop, CancelSepaTransferParams, CreateSepaTransferResponse, GetSepaTransfer, GetSepaTransfersResponse, NewSepaTransfer, SepaTransfer, SepaTransferCreationFlowRequest, VopVerificationResult } from '../shared/sepa-transfers.types';
|
|
4
4
|
import '../../ui/ui-elements/sca-passkey/qonto-sca-passkey-waiting.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sepa-transfers.client.d.ts","sourceRoot":"","sources":["../../../src/sepa-transfers/client/sepa-transfers.client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"sepa-transfers.client.d.ts","sourceRoot":"","sources":["../../../src/sepa-transfers/client/sepa-transfers.client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAajF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAuBzF,OAAO,KAAK,EACV,4BAA4B,EAC5B,wBAAwB,EACxB,0BAA0B,EAC1B,eAAe,EACf,wBAAwB,EACxB,eAAe,EAEf,YAAY,EACZ,+BAA+B,EAI/B,qBAAqB,EACtB,MAAM,gCAAgC,CAAC;AAexC,OAAO,+DAA+D,CAAC;AAEvE;;GAEG;AACH,MAAM,WAAW,wBAAwB,CAAC,CAAC;IACzC,oBAAoB,CAAC,EAAE,CAAC,CAAC;IACzB,iBAAiB,CAAC,EAAE,uBAAuB,CAAC;CAC7C;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,CACpC,sBAAsB,CAAC,EAAE,wBAAwB,CAAC,KAAK,CAAC,GACvD,OAAO,CAAC,wBAAwB,CAAC,CAkCnC;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,eAAe,CAAC,EACpC,oBAAoB,EACpB,iBAAiB,GAClB,EAAE,wBAAwB,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,CAsBnE;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAuB,kBAAkB,CAAC,EACxC,oBAAoB,EACpB,iBAAiB,GAClB,EAAE,wBAAwB,CACzB,eAAe,GAAG,4BAA4B,CAC/C,GAAG,cAAc,CAChB,qBAAqB,EACrB,0BAA0B,GAAG,SAAS,CACvC,CAsIA;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,kBAAkB,CAAC,EACvC,oBAAoB,EACpB,iBAAiB,GAClB,EAAE,wBAAwB,CAAC,wBAAwB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAoBpE;AA6BD;;;;;;;;;;;;GAYG;AACH,wBAAsB,+BAA+B,CAAC,EACpD,oBAAoB,EACpB,iBAAiB,GAClB,EAAE,wBAAwB,CAAC,+BAA+B,CAAC,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA2B5F"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuthLinkRequestResult } from '@auth-links/auth-links.types';
|
|
1
|
+
import type { AuthLinkRequestResult } from '@auth-links/shared/auth-links.types';
|
|
2
2
|
import type { BeneficiaryInformationForVop, CancelSepaTransferParams, GetSepaTransfer, GetSepaTransfersResponse, NewSepaTransfer, SepaTransfer, SepaTransferCreationFlowRequest, SepaTransferParams, VopVerificationResult } from './shared/sepa-transfers.types';
|
|
3
3
|
import '../ui/ui-elements/sca-passkey/qonto-sca-passkey-waiting.ts';
|
|
4
4
|
/**
|
|
@@ -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,
|
|
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,4BAA4B,EAC5B,wBAAwB,EACxB,eAAe,EACf,wBAAwB,EACxB,eAAe,EAEf,YAAY,EACZ,+BAA+B,EAE/B,kBAAkB,EAGlB,qBAAqB,EACtB,MAAM,+BAA+B,CAAC;AAgBvC,OAAO,4DAA4D,CAAC;AAEpE;;;;;;;;;;;;;GAaG;AACH,wBAAsB,gBAAgB,CACpC,sBAAsB,CAAC,EAAE,kBAAkB,CAAC,KAAK,CAAC,GACjD,OAAO,CAAC,wBAAwB,CAAC,CAuDnC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,eAAe,CAAC,EACpC,oBAAoB,EACpB,iBAAiB,GAClB,EAAE,kBAAkB,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,CA2B7D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgGG;AACH,wBAAuB,kBAAkB,CAAC,EACxC,oBAAoB,EACpB,iBAAiB,GAClB,EAAE,kBAAkB,CACnB,eAAe,GAAG,4BAA4B,CAC/C,GAAG,cAAc,CAAC,qBAAqB,EAAE,YAAY,GAAG,SAAS,CAAC,CAwJlE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,kBAAkB,CAAC,EACvC,oBAAoB,EACpB,iBAAiB,GAClB,EAAE,kBAAkB,CAAC,wBAAwB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAwB9D;AA+BD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,+BAA+B,CAAC,EACpD,oBAAoB,EACpB,iBAAiB,GAClB,EAAE,kBAAkB,CAAC,+BAA+B,CAAC,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAyBtF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuthLinkRequestResult } from '@auth-links/auth-links.types';
|
|
1
|
+
import type { AuthLinkRequestResult } from '@auth-links/shared/auth-links.types';
|
|
2
2
|
import type { ServerOperationSettings } from '@validation/operation-settings-validation';
|
|
3
3
|
import type { BeneficiaryInformationForVop, CancelSepaTransferParams, CreateSepaTransferResponse, GetSepaTransfer, GetSepaTransfersResponse, NewSepaTransfer, SepaTransfer, SepaTransferCreationFlowRequest, VopVerificationResult } from '../shared/sepa-transfers.types';
|
|
4
4
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sepa-transfers.server.d.ts","sourceRoot":"","sources":["../../../src/sepa-transfers/server/sepa-transfers.server.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"sepa-transfers.server.d.ts","sourceRoot":"","sources":["../../../src/sepa-transfers/server/sepa-transfers.server.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAMjF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAazF,OAAO,KAAK,EACV,4BAA4B,EAC5B,wBAAwB,EACxB,0BAA0B,EAC1B,eAAe,EACf,wBAAwB,EACxB,eAAe,EACf,YAAY,EACZ,+BAA+B,EAG/B,qBAAqB,EACtB,MAAM,gCAAgC,CAAC;AAaxC;;GAEG;AACH,MAAM,WAAW,wBAAwB,CAAC,CAAC;IACzC,oBAAoB,CAAC,EAAE,CAAC,CAAC;IACzB,iBAAiB,CAAC,EAAE,uBAAuB,CAAC;CAC7C;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,CACpC,sBAAsB,CAAC,EAAE,wBAAwB,CAAC,KAAK,CAAC,GACvD,OAAO,CAAC,wBAAwB,CAAC,CAsBnC;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,eAAe,CAAC,EACpC,oBAAoB,EACpB,iBAAiB,GAClB,EAAE,wBAAwB,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,CAcnE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,kBAAkB,CAAC,EACvC,oBAAoB,EACpB,iBAAiB,GAClB,EAAE,wBAAwB,CAAC,wBAAwB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAYpE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0FG;AACH,wBAAuB,kBAAkB,CAAC,EACxC,oBAAoB,EACpB,iBAAiB,GAClB,EAAE,wBAAwB,CACzB,eAAe,GAAG,4BAA4B,CAC/C,GAAG,cAAc,CAChB,qBAAqB,EACrB,0BAA0B,GAAG,SAAS,CACvC,CAsEA;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,+BAA+B,CAAC,EACpD,oBAAoB,EACpB,iBAAiB,GAClB,EAAE,wBAAwB,CAAC,+BAA+B,CAAC,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAuB5F"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuthLinkRequestSettings } from '@auth-links/auth-links.types';
|
|
1
|
+
import type { AuthLinkRequestSettings } from '@auth-links/shared/auth-links.types';
|
|
2
2
|
import type { Beneficiary } from '@beneficiaries/beneficiaries.types';
|
|
3
3
|
import type { PaginationSettings, PaginationState } from '@common/api-pagination/api-pagination.types';
|
|
4
4
|
import { TRANSFER_DECLINE_REASONS, TRANSFER_STATUSES, VOP_CHECK_RESULTS, VOP_DECISIONS } from '@common/constants';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sepa-transfers.types.d.ts","sourceRoot":"","sources":["../../../src/sepa-transfers/shared/sepa-transfers.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"sepa-transfers.types.d.ts","sourceRoot":"","sources":["../../../src/sepa-transfers/shared/sepa-transfers.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAEnF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEtE,OAAO,KAAK,EACV,kBAAkB,EAClB,eAAe,EAChB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAEnF;;GAEG;AACH,KAAK,0BAA0B,GAC7B,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,OAAO,wBAAwB,CAAC,CAAC;AAE3E;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC5B,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC;AAE7D;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,MAAM,EAAE,kBAAkB,CAAC;IAC3B;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,cAAc,EAAE,0BAA0B,CAAC;IAC3C;;OAEG;IACH,aAAa,EAAE,IAAI,CAAC;IACpB;;OAEG;IACH,SAAS,EAAE,IAAI,CAAC;IAChB;;OAEG;IACH,SAAS,EAAE,IAAI,CAAC;IAChB;;OAEG;IACH,WAAW,EAAE,IAAI,CAAC;IAClB;;OAEG;IACH,WAAW,EAAE,IAAI,CAAC;IAClB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B;;;OAGG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,QAAQ,EAAE,YAAY,CAAC;IACvB;;OAEG;IACH,IAAI,EAAE;QACJ;;;WAGG;QACH,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;CACH;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,aAAa,CAAC,EAAE,IAAI,CAAC;IACrB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED;;;;GAIG;AACH,MAAM,MAAM,4BAA4B,GAAG,IAAI,CAC7C,eAAe,EACf,eAAe,GAAG,aAAa,CAChC,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,yBAAyB;IACxC,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,sBAAsB;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACzC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB,CAAC,CAAC;IACnC;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,CAAC,CAAC;IACzB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACvC;AAED;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACvC,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAE3D,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,cAAc,GACxB,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC;AAE7D,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAE7E;;;;;GAKG;AACH,MAAM,MAAM,+BAA+B,GAAG,IAAI,CAChD,uBAAuB,EACvB,QAAQ,CACT,CAAC;AAEF,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,WAAW,CAAC;IACzB,oBAAoB,CAAC,EAAE,eAAe,CAAC;CACxC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuthLinkRequestParams, AuthLinkRequestResult } from './auth-links.types';
|
|
1
|
+
import type { AuthLinkRequestParams, AuthLinkRequestResult } from './shared/auth-links.types';
|
|
2
2
|
/**
|
|
3
3
|
* Requests an authentication link for a specific action. Auth links allow
|
|
4
4
|
* loading embed features or performing Embed actions in a secure manner while
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-links.d.ts","sourceRoot":"","sources":["../../../src/auth-links/auth-links.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auth-links.d.ts","sourceRoot":"","sources":["../../../src/auth-links/auth-links.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,qBAAqB,EACrB,qBAAqB,EAEtB,MAAM,2BAA2B,CAAC;AAGnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAsB,OAAO,CAAC,EAC5B,eAAe,EACf,iBAAiB,GAClB,EAAE,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAkCxD"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { ClientOperationSettings } from '@validation/operation-settings-validation';
|
|
2
|
+
import type { AuthLinkRequestParams, AuthLinkRequestResult } from '../shared/auth-links.types';
|
|
3
|
+
/**
|
|
4
|
+
* Generic parameter type for client-side auth link operations
|
|
5
|
+
*/
|
|
6
|
+
export interface AuthLinkClientParams {
|
|
7
|
+
requestSettings: AuthLinkRequestParams['requestSettings'];
|
|
8
|
+
operationSettings?: ClientOperationSettings;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* **Client-side implementation** - Requests an authentication link for a specific action.
|
|
12
|
+
*
|
|
13
|
+
* Auth links allow loading embed features or performing Embed actions in a secure manner
|
|
14
|
+
* while still avoiding exposing the access token to the client side.
|
|
15
|
+
*
|
|
16
|
+
* This implementation uses a proxy-based flow (via proxyEndpointDescriptor or
|
|
17
|
+
* proxyRequestFunction), which is designed for client-side environments where
|
|
18
|
+
* access tokens should not be exposed.
|
|
19
|
+
*
|
|
20
|
+
* @param requestAuthLinkParams - An object containing:
|
|
21
|
+
* - `requestSettings`: An object with the `action` and an optional `callbackUrl`
|
|
22
|
+
* properties (both string).
|
|
23
|
+
* - `operationSettings`: An object with operation-level settings. Must include
|
|
24
|
+
* either `proxyEndpointDescriptor` (recommended) or `proxyRequestFunction`.
|
|
25
|
+
* See {@link ClientOperationSettings}.
|
|
26
|
+
* @returns Promise resolving to the auth link details, which includes the URL
|
|
27
|
+
* where the user should be redirected to perform the action, the requested action,
|
|
28
|
+
* the callback URL if it was provided, the expiration time of the link, and the
|
|
29
|
+
* time it was used.
|
|
30
|
+
* @throws `InvalidParametersError` - If the request settings are invalid or if
|
|
31
|
+
* neither proxyEndpointDescriptor nor proxyRequestFunction is provided.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* import { authLinks } from '@qonto/embed-sdk/auth-links';
|
|
36
|
+
* import { AUTH_LINK_ACTIONS } from '@qonto/embed-sdk/constants';
|
|
37
|
+
*
|
|
38
|
+
* const result = await authLinks.request({
|
|
39
|
+
* requestSettings: {
|
|
40
|
+
* action: AUTH_LINK_ACTIONS.DISPLAY_CARD,
|
|
41
|
+
* },
|
|
42
|
+
* operationSettings: {
|
|
43
|
+
* proxyEndpointDescriptor: {
|
|
44
|
+
* url: '/api/qonto-proxy',
|
|
45
|
+
* method: 'POST',
|
|
46
|
+
* },
|
|
47
|
+
* }
|
|
48
|
+
* });
|
|
49
|
+
*
|
|
50
|
+
* console.log('Auth link URL:', result.url);
|
|
51
|
+
* // Use the URL to load the requested UI element (e.g., in an iframe, modal, or new window)
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @see For server-side implementation with accessToken, import from `@qonto/embed-sdk/auth-links/server`
|
|
55
|
+
*/
|
|
56
|
+
export declare function request({ requestSettings, operationSettings, }: AuthLinkClientParams): Promise<AuthLinkRequestResult>;
|
|
57
|
+
//# sourceMappingURL=auth-links.client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-links.client.d.ts","sourceRoot":"","sources":["../../../../src/auth-links/client/auth-links.client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAKzF,OAAO,KAAK,EACV,qBAAqB,EACrB,qBAAqB,EAEtB,MAAM,4BAA4B,CAAC;AAGpC;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,eAAe,EAAE,qBAAqB,CAAC,iBAAiB,CAAC,CAAC;IAC1D,iBAAiB,CAAC,EAAE,uBAAuB,CAAC;CAC7C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAsB,OAAO,CAAC,EAC5B,eAAe,EACf,iBAAiB,GAClB,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAwBvD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-links.client.test.d.ts","sourceRoot":"","sources":["../../../../src/auth-links/client/auth-links.client.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
import { request } from './client/auth-links.client';
|
|
1
2
|
/**
|
|
2
|
-
* The authLinks namespace contains all the functions related to authentication link operations.
|
|
3
|
+
* The authLinks namespace contains all the client-side functions related to authentication link operations.
|
|
4
|
+
* This version uses proxy-based authentication (proxyRequestFunction or proxyEndpointDescriptor)
|
|
5
|
+
* and is designed for browser environments.
|
|
6
|
+
*
|
|
7
|
+
* For server-side operations using access tokens, import from '\@qonto/embed-sdk/server/auth-links'.
|
|
8
|
+
*
|
|
3
9
|
* It can be accessed like this:
|
|
4
10
|
* ```ts
|
|
5
11
|
* import { authLinks } from '@qonto/embed-sdk/auth-links';
|
|
@@ -9,17 +15,19 @@
|
|
|
9
15
|
* ```ts
|
|
10
16
|
* await authLinks.request({
|
|
11
17
|
* requestSettings: {
|
|
12
|
-
* action:
|
|
13
|
-
* callbackUrl: 'https://example.com/callback'
|
|
18
|
+
* action: AUTH_LINK_ACTIONS.DISPLAY_CARD,
|
|
14
19
|
* },
|
|
15
20
|
* operationSettings: {
|
|
16
|
-
*
|
|
17
|
-
*
|
|
21
|
+
* proxyRequestFunction: async (encodedCall) => {
|
|
22
|
+
* // Implement your proxy logic here
|
|
23
|
+
* },
|
|
18
24
|
* }
|
|
19
25
|
* });
|
|
20
26
|
* ```
|
|
21
27
|
*/
|
|
22
28
|
export declare const authLinks: {
|
|
23
|
-
request: typeof
|
|
29
|
+
request: typeof request;
|
|
24
30
|
};
|
|
31
|
+
export type * from './shared/auth-links.types';
|
|
32
|
+
export type { ClientOperationSettings } from '@validation/operation-settings-validation';
|
|
25
33
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/auth-links/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/auth-links/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,SAAS;;CAErB,CAAC;AAGF,mBAAmB,2BAA2B,CAAC;AAC/C,YAAY,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { request } from './server/auth-links.server';
|
|
2
|
+
/**
|
|
3
|
+
* The authLinks namespace contains all the server-side functions related to authentication link operations.
|
|
4
|
+
* This version uses access token-based authentication and is designed for server environments.
|
|
5
|
+
*
|
|
6
|
+
* For client-side operations using proxy functions, import from '\@qonto/embed-sdk/auth-links'.
|
|
7
|
+
*
|
|
8
|
+
* It can be accessed like this:
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { authLinks } from '@qonto/embed-sdk/auth-links/server';
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* Then, the authLinks object contains the functions to perform auth link operations:
|
|
14
|
+
* ```ts
|
|
15
|
+
* await authLinks.request({
|
|
16
|
+
* requestSettings: {
|
|
17
|
+
* action: AUTH_LINK_ACTIONS.DISPLAY_CARD,
|
|
18
|
+
* },
|
|
19
|
+
* operationSettings: {
|
|
20
|
+
* accessToken: 'your-access-token',
|
|
21
|
+
* }
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare const authLinks: {
|
|
26
|
+
request: typeof request;
|
|
27
|
+
};
|
|
28
|
+
export type * from './shared/auth-links.types';
|
|
29
|
+
export type { ServerOperationSettings } from '@validation/operation-settings-validation';
|
|
30
|
+
//# sourceMappingURL=index.server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.server.d.ts","sourceRoot":"","sources":["../../../src/auth-links/index.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,SAAS;;CAErB,CAAC;AAGF,mBAAmB,2BAA2B,CAAC;AAC/C,YAAY,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { ServerOperationSettings } from '@validation/operation-settings-validation';
|
|
2
|
+
import type { AuthLinkRequestParams, AuthLinkRequestResult } from '../shared/auth-links.types';
|
|
3
|
+
/**
|
|
4
|
+
* Generic parameter type for server-side auth link operations
|
|
5
|
+
*/
|
|
6
|
+
export interface AuthLinkServerParams {
|
|
7
|
+
requestSettings: AuthLinkRequestParams['requestSettings'];
|
|
8
|
+
operationSettings?: ServerOperationSettings;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* **Server-side implementation** - Requests an authentication link for a specific action.
|
|
12
|
+
*
|
|
13
|
+
* Auth links allow loading embed features or performing Embed actions in a secure manner
|
|
14
|
+
* while still avoiding exposing the access token to the client side.
|
|
15
|
+
*
|
|
16
|
+
* This implementation uses the direct access token flow, which is designed for
|
|
17
|
+
* server-side environments where access tokens can be safely managed.
|
|
18
|
+
*
|
|
19
|
+
* @param requestAuthLinkParams - An object containing:
|
|
20
|
+
* - `requestSettings`: An object with the `action` and an optional `callbackUrl`
|
|
21
|
+
* properties (both string).
|
|
22
|
+
* - `operationSettings`: An object with operation-level settings such as
|
|
23
|
+
* `accessToken`, `stagingToken`, and other optional parameters.
|
|
24
|
+
* See {@link ServerOperationSettings}.
|
|
25
|
+
* @returns Promise resolving to the auth link details, which includes the URL
|
|
26
|
+
* where the user should be redirected to perform the action, the requested action,
|
|
27
|
+
* the callback URL if it was provided, the expiration time of the link, and the
|
|
28
|
+
* time it was used.
|
|
29
|
+
* @throws `InvalidParametersError` - If the request settings are invalid.
|
|
30
|
+
* @throws `AuthenticationError` - If authentication fails (e.g., invalid or missing
|
|
31
|
+
* access token).
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* import { authLinks } from '@qonto/embed-sdk/auth-links/server';
|
|
36
|
+
* import { AUTH_LINK_ACTIONS } from '@qonto/embed-sdk/constants';
|
|
37
|
+
*
|
|
38
|
+
* // Request an auth link for displaying a card within an iframe injected to
|
|
39
|
+
* // your application.
|
|
40
|
+
* const result = await authLinks.request({
|
|
41
|
+
* requestSettings: {
|
|
42
|
+
* action: AUTH_LINK_ACTIONS.DISPLAY_CARD,
|
|
43
|
+
* },
|
|
44
|
+
* operationSettings: {
|
|
45
|
+
* accessToken: 'your-access-token',
|
|
46
|
+
* }
|
|
47
|
+
* });
|
|
48
|
+
*
|
|
49
|
+
* console.log('Auth link URL:', result.url);
|
|
50
|
+
* // Use the URL to load the requested UI element (e.g., in an iframe, modal, or new window)
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* @see For client-side implementation using proxyEndpointDescriptor, import from `@qonto/embed-sdk/auth-links`
|
|
54
|
+
*/
|
|
55
|
+
export declare function request({ requestSettings, operationSettings, }: AuthLinkServerParams): Promise<AuthLinkRequestResult>;
|
|
56
|
+
//# sourceMappingURL=auth-links.server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-links.server.d.ts","sourceRoot":"","sources":["../../../../src/auth-links/server/auth-links.server.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAIzF,OAAO,KAAK,EACV,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,4BAA4B,CAAC;AAGpC;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,eAAe,EAAE,qBAAqB,CAAC,iBAAiB,CAAC,CAAC;IAC1D,iBAAiB,CAAC,EAAE,uBAAuB,CAAC;CAC7C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAsB,OAAO,CAAC,EAC5B,eAAe,EACf,iBAAiB,GAClB,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAevD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-links.server.test.d.ts","sourceRoot":"","sources":["../../../../src/auth-links/server/auth-links.server.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-links.api.d.ts","sourceRoot":"","sources":["../../../../src/auth-links/shared/auth-links.api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAGrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAEnF,OAAO,KAAK,EACV,uBAAuB,EACvB,uBAAuB,EACvB,cAAc,EACf,MAAM,oBAAoB,CAAC;AAE5B,UAAU,4BAA4B;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,cAAc,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,WAAW,EACX,YAAY,EACZ,MAAM,EACN,WAAW,GACZ,EAAE,4BAA4B,GAAG,qBAAqB,CAsBtD;AAED,MAAM,MAAM,qBAAqB,GAAG,uBAAuB,GACzD,IAAI,CAAC,iBAAiB,EAAE,aAAa,GAAG,cAAc,CAAC,CAAC;AAE1D;;GAEG;AACH,wBAAsB,eAAe,CACnC,qBAAqB,EAAE,qBAAqB,GAC3C,OAAO,CAAC,uBAAuB,CAAC,CAmBlC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AuthLinkRequestResult, EmbedAuthLinkDataObject } from './auth-links.types';
|
|
2
|
+
/**
|
|
3
|
+
* Serializes the API response to the public SDK format
|
|
4
|
+
*/
|
|
5
|
+
export declare function serializeAuthLink(authLink: EmbedAuthLinkDataObject): AuthLinkRequestResult;
|
|
6
|
+
//# sourceMappingURL=auth-links.serializer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-links.serializer.d.ts","sourceRoot":"","sources":["../../../../src/auth-links/shared/auth-links.serializer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,oBAAoB,CAAC;AAE5B;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,uBAAuB,GAChC,qBAAqB,CAQvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-links.shared.test.d.ts","sourceRoot":"","sources":["../../../../src/auth-links/shared/auth-links.shared.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-links.types.d.ts","sourceRoot":"","sources":["../../../../src/auth-links/shared/auth-links.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAEnF;;GAEG;AACH,MAAM,MAAM,cAAc,GACxB,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,MAAM,EAAE,cAAc,CAAC;IACvB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,eAAe,EAAE,uBAAuB,CAAC;IACzC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACvC;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,cAAc,EAAE,cAAc,CAAC;IAC/B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-links.validate.d.ts","sourceRoot":"","sources":["../../../../src/auth-links/shared/auth-links.validate.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAGlE;;GAEG;AACH,wBAAgB,+BAA+B,CAC7C,eAAe,EAAE,uBAAuB,GACvC,OAAO,CAAC,eAAe,IAAI,uBAAuB,CA2BpD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-links.validate.test.d.ts","sourceRoot":"","sources":["../../../../src/auth-links/shared/auth-links.validate.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { EmbedAuthLinkDataObject } from '@auth-links/auth-links.types';
|
|
1
|
+
import type { EmbedAuthLinkDataObject } from '@auth-links/shared/auth-links.types';
|
|
2
2
|
import type { NetworkCallDescriptor } from '@common/network/network';
|
|
3
3
|
import type { OperationSettings } from '@validation/operation-settings-validation';
|
|
4
4
|
import type { CardDataObject, DisplayCardSettings } from './cards.types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cards.api.d.ts","sourceRoot":"","sources":["../../../src/cards/cards.api.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"cards.api.d.ts","sourceRoot":"","sources":["../../../src/cards/cards.api.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAInF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAEnF,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEzE,UAAU,cAAc;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,aAAa;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,6BAA6B;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,sBAAsB,GAAG,mBAAmB,GACtD,IAAI,CAAC,iBAAiB,EAAE,aAAa,GAAG,cAAc,GAAG,eAAe,CAAC,CAAC;AAE5E,wBAAgB,mBAAmB,CAAC,EAClC,YAAY,EACZ,WAAW,EACX,YAAY,GACb,EAAE;IACD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,qBAAqB,CAiBxB;AAED,wBAAsB,QAAQ,CAAC,EAC7B,YAAY,EACZ,WAAW,EACX,YAAY,GACb,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAY5C;AAED,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,WAAW,EACX,YAAY,GACb,EAAE;IACD,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,qBAAqB,CAWxB;AAED,wBAAsB,OAAO,CAAC,EAC5B,MAAM,EACN,WAAW,EACX,YAAY,GACb,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,CAYzC;AAED,wBAAgB,uBAAuB,CAAC,EACtC,WAAW,EACX,YAAY,GACb,EAAE,6BAA6B,GAAG,qBAAqB,CAMvD;AAED,wBAAsB,gBAAgB,CACpC,sBAAsB,EAAE,sBAAsB,GAC7C,OAAO,CAAC,uBAAuB,CAAC,CAQlC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).QontoEmbedServer={})}(this,(function(e){"use strict";const n=[];for(let e=0;e<256;++e)n.push((e+256).toString(16).slice(1));let t;const a=new Uint8Array(16);var r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function s(e,s,o){if(r.randomUUID&&!e)return r.randomUUID();const i=(e=e||{}).random??e.rng?.()??function(){if(!t){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");t=crypto.getRandomValues.bind(crypto)}return t(a)}();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=15&i[6]|64,i[8]=63&i[8]|128,function(e,t=0){return(n[e[t+0]]+n[e[t+1]]+n[e[t+2]]+n[e[t+3]]+"-"+n[e[t+4]]+n[e[t+5]]+"-"+n[e[t+6]]+n[e[t+7]]+"-"+n[e[t+8]]+n[e[t+9]]+"-"+n[e[t+10]]+n[e[t+11]]+n[e[t+12]]+n[e[t+13]]+n[e[t+14]]+n[e[t+15]]).toLowerCase()}(i)}function o(e){const n=new URLSearchParams;return e?.page&&n.append("page",e.page.toString()),e?.itemsPerPage&&n.append("per_page",e.itemsPerPage.toString()),n}function i(e){if(e)return{totalItems:e?.total_count,totalPages:e?.total_pages,currentPage:e?.current_page,itemsPerPage:e?.per_page,previousPage:e?.prev_page||null,nextPage:e?.next_page||null}}class c{constructor(){this.accessToken=null,this.stagingToken=null}static getInstance(){return c.instance||(c.instance=new c),c.instance}setAccessToken(e){this.accessToken=e}getAccessToken(){return this.accessToken}hasAccessToken(){return null!==this.accessToken&&""!==this.accessToken}clearAccessToken(){this.accessToken=null}setStagingToken(e){this.stagingToken=e}getStagingToken(){return this.stagingToken}hasStagingToken(){return null!==this.stagingToken&&""!==this.stagingToken}clearStagingToken(){this.stagingToken=null}}const u=c.getInstance();class d extends Error{constructor(){super(),this.stack=""}toString(){return`${this.name}: ${this.message}`}}class f extends d{constructor(){super(),this.name="AuthenticationError",this.message="Authentication failed due to missing or invalid authentication method. Provide either a proxyRequestFunction (recommended) or accessToken, either as parameters or by calling the initialize function first."}}function p(){if(!u.hasAccessToken())throw new f;return u.getAccessToken()}const g={PRODUCTION:"production",STAGING:"staging",LOCAL:"local"},l={MASTER:"master",SANDBOX:"sandbox",QA:"qa"},T={PASSKEY:"passkey",SMS_OTP:"sms-otp",PAIRED_DEVICE:"paired-device",MOCK:"mock"},m=3e4,h="REJECT",k={CARD_DISPLAY:"display_card",PAYMENT_LINK_CREATE:"create_payment_link",SEPA_TRANSFER_CREATE:"create_sepa_transfer"},b="https://embed.qonto.com",y="https://embed-js{branch}.staging.qonto.co",w="https://embed.dev.qonto.co",I={[g.PRODUCTION]:{EMBED_BASE_URL:b,EMBED_URL:`${b}/connect`,THIRD_PARTY_API_URL:"https://thirdparty.qonto.com"},[g.STAGING]:{EMBED_BASE_URL:y,EMBED_URL:`${y}/connect`,THIRD_PARTY_API_URL:"https://thirdparty{branch}.staging.qonto.co"},[g.LOCAL]:{EMBED_BASE_URL:w,EMBED_URL:`${w}/connect`,THIRD_PARTY_API_URL:"https://thirdparty{branch}.staging.qonto.co"}};class S{constructor(){let e,n;this.environment=g.PRODUCTION,this.branch=l.SANDBOX,"undefined"!=typeof process&&process.env&&(e=process.env.QONTO_EMBED_ENVIRONMENT,n=process.env.QONTO_EMBED_BRANCH),this.environment=Object.values(g).includes(e)?e:g.PRODUCTION,this.branch=Object.values(l).includes(n)?n:l.SANDBOX}static getInstance(){return S.instance||(S.instance=new S),S.instance}setEnvironment(e){this.environment=e}getEnvironment(){return this.environment}isProductionEnvironment(){return this.environment===g.PRODUCTION}setBranch(e){this.branch=e}getBranch(){return this.branch}clear(){this.environment=g.PRODUCTION,this.branch=l.MASTER}getEnvironmentUrls(){if(this.environment===g.PRODUCTION)return I.production;{const e=I[this.environment];return Object.entries(e).reduce(((e,[n,t])=>({...e,[n]:t.replace("{branch}",`-${this.branch}`)})),{})}}}const _=S.getInstance();function P(){return!("undefined"!=typeof window&&"undefined"!=typeof document)}class E{constructor(){this.currentLocale="en"}static getInstance(){return E.instance||(E.instance=new E),E.instance}setLocale(e){this.currentLocale=e}getLocale(){return this.currentLocale}setDefaultLocale(){this.currentLocale="en"}}const A=E.getInstance();class v{constructor(){this.mfaPreference=T.PASSKEY,this.debugMode=!1}static getInstance(){return v.instance||(v.instance=new v),v.instance}setSettings(e){e.uiParentElementId&&(this.uiParentElementId=e.uiParentElementId),e.mfaPreference&&(this.mfaPreference=e.mfaPreference),e.debugMode&&(this.debugMode=e.debugMode),e.proxyRequestFunction&&(this.proxyRequestFunction=e.proxyRequestFunction),e.proxyEndpointDescriptor&&(this.proxyEndpointDescriptor=e.proxyEndpointDescriptor)}getUIParentElementId(){return this.uiParentElementId}getMFAPreference(){return this.mfaPreference}getDebugMode(){return this.debugMode}getProxyRequestFunction(){return this.proxyRequestFunction}getProxyEndpointDescriptor(){return this.proxyEndpointDescriptor}clearSettings(){this.uiParentElementId=void 0,this.mfaPreference=T.PASSKEY,this.debugMode=!1,this.proxyRequestFunction=void 0}getSettings(){return{uiParentElementId:this.uiParentElementId,mfaPreference:this.mfaPreference,debugMode:this.debugMode,proxyRequestFunction:this.proxyRequestFunction}}}const D=v.getInstance();class R extends d{constructor({message:e,data:n,code:t}){super(),this.code=500;const a=Array.isArray(e)?e.join("\n"):e;this.name="EmbedApiError",this.message=`The call to the Embed API failed with the following errors:\n${a}`,this.data=n||{},this.code=t||this.code}}function x({accessToken:e,stagingToken:n,idempotencyKey:t,mfaPreference:a,scaSessionToken:r}){const s=new Headers;s.append("Authorization",`Bearer ${e}`);const o=n||u.getStagingToken();o&&s.append("X-Qonto-Staging-Token",o),t&&s.append("X-Qonto-Idempotency-Key",t);const i=a||D.getMFAPreference();return i&&s.append("X-Qonto-2fa-Preference",i),r&&s.append("X-Qonto-SCA-Session-Token",r),s.append("Content-Type","application/json"),s.append("Accept-Language",A.getLocale()),s}async function U({path:e,options:n}){const t=`${_.getEnvironmentUrls().THIRD_PARTY_API_URL}${e}`,a=await fetch(t,{...n,headers:x(n.headers),body:n.body?JSON.stringify(n.body):void 0});if(204===a.status)return;const r=await a.json();if(!a.ok)throw r.errors?new R({code:a.status,message:r.errors.map((e=>`${e.code}: ${e.detail}`))}):new R({code:a.status,message:`${r.code}: ${r.detail}`,data:r});return r}function O(e){const n={method:e.options.method,headers:e.options.headers,path:e.path,payload:e.options?.body},t=JSON.stringify(n);return a=t,P()?Buffer.from(a).toString("base64"):btoa(a);var a}function q(e){return JSON.parse((n=e,P()?Buffer.from(n,"base64").toString("utf-8"):atob(n)));var n}function $(e){return{id:e.id,initiatorId:e.initiator_id,bankAccountId:e.bank_account_id,amount:Number(e.amount),amountCents:Number(e.amount_cents),amountCurrency:e.amount_currency,status:e.status,beneficiaryId:e.beneficiary_id,reference:e.reference,note:e.note,declinedReason:e.declined_reason,scheduledDate:new Date(e.scheduled_date),createdAt:new Date(e.created_at),updatedAt:new Date(e.updated_at),processedAt:new Date(e.processed_at),completedAt:new Date(e.completed_at),transactionId:e.transaction_id}}function M(e){return{name:e.name,iban:e.iban}}const N="/v2/sepa",L=`${N}/transfers`;async function C({accessToken:e,stagingToken:n,paginationSettings:t}){const a=function({paginationSettings:e,accessToken:n,stagingToken:t}){const a={method:"GET",headers:{accessToken:n,stagingToken:t}},r=o(e),s=r.size?`?${r.toString()}`:"";return{path:`${L}${s}`,options:a}}({paginationSettings:t,accessToken:e,stagingToken:n}),{transfers:r,meta:s}=await U(a);return{transfers:r,meta:s}}async function j({accessToken:e,stagingToken:n,sepaTransferId:t}){const a=function({sepaTransferId:e,accessToken:n,stagingToken:t}){return{path:`${L}/${e}`,options:{method:"GET",headers:{accessToken:n,stagingToken:t}}}}({sepaTransferId:t,accessToken:e,stagingToken:n}),{transfer:r}=await U(a);return r}async function B({transfer:e,vopProofToken:n,accessToken:t,stagingToken:a,scaSessionToken:r,idempotencyKey:s}){const o=function({transfer:e,vopProofToken:n,accessToken:t,stagingToken:a,scaSessionToken:r,idempotencyKey:s}){const o=function(e){const n=e.beneficiaryId||e.beneficiary?.id;return{bank_account_id:e.bankAccountId,beneficiary_id:n,amount:e.amount.toString(),reference:e.reference,...e.note?{note:e.note}:{},...e.scheduledDate?{scheduled_date:e.scheduledDate.toISOString().split("T")[0]}:{},...e.attachmentIds?{attachment_ids:e.attachmentIds}:{}}}(e);return{path:L,options:{method:"POST",headers:{accessToken:t,stagingToken:a,scaSessionToken:r,idempotencyKey:s},body:{transfer:o,vop_proof_token:n}}}}({transfer:e,vopProofToken:n,accessToken:t,stagingToken:a,scaSessionToken:r,idempotencyKey:s}),{transfer:i}=await U(o);return i}async function F({sepaTransferId:e,accessToken:n,stagingToken:t}){const a=function({sepaTransferId:e,accessToken:n,stagingToken:t}){return{path:`${L}/${e}/cancel`,options:{method:"POST",headers:{accessToken:n,stagingToken:t}}}}({sepaTransferId:e,accessToken:n,stagingToken:t});await U(a)}async function K({sepaPayee:e,accessToken:n,stagingToken:t}){const a=function({sepaPayee:e,accessToken:n,stagingToken:t}){return{path:`${N}/verify_payee`,options:{method:"POST",headers:{accessToken:n,stagingToken:t},body:{beneficiary_name:e.name,iban:e.iban}}}}({sepaPayee:e,accessToken:n,stagingToken:t});return await U(a)}function Y(e){return{id:e.id,initiatorId:e.initiator_id,createdAt:new Date(e.created_at),updatedAt:new Date(e.updated_at),totalCount:Number(e.total_count),completedCount:Number(e.completed_count),failedCount:Number(e.failed_count),pendingCount:Number(e.pending_count),results:e.results.map((e=>({clientTransferId:e.client_transfer_id,transferId:e.transfer_id??null,errors:e.errors||null,status:e.status})))}}function G(e){return{id:e.id,response:{matchResult:e.response.match_result,matchedName:e.response.matched_name}}}const H="/v2/sepa/bulk_transfers";async function Q({accessToken:e,stagingToken:n,paginationSettings:t}){const a=function({paginationSettings:e,accessToken:n,stagingToken:t}){const a={method:"GET",headers:{accessToken:n,stagingToken:t}},r=o(e),s=r.size?`?${r.toString()}`:"";return{path:`${H}${s}`,options:a}}({paginationSettings:t,accessToken:e,stagingToken:n}),{bulk_transfers:r,meta:s}=await U(a);return{bulkTransfers:r,meta:s}}async function X({accessToken:e,stagingToken:n,bulkTransferId:t}){const a=function({bulkTransferId:e,accessToken:n,stagingToken:t}){return{path:`${H}/${e}`,options:{method:"GET",headers:{accessToken:n,stagingToken:t}}}}({bulkTransferId:t,accessToken:e,stagingToken:n}),{bulk_transfer:r}=await U(a);return r}async function z({sepaPayees:e,accessToken:n,stagingToken:t}){const a=function({sepaPayees:e,accessToken:n,stagingToken:t}){return{path:`${N}/bulk_verify_payee`,options:{method:"POST",headers:{accessToken:n,stagingToken:t},body:{requests:e.map(M)}}}}({sepaPayees:e,accessToken:n,stagingToken:t});return await U(a)}class J extends d{constructor(e){super(),this.name="InvalidParametersError",this.invalidParameters=Array.isArray(e)?e:[e],this.message=`Invalid parameters were passed to the function:\n${this.invalidParameters.map((e=>e)).join("\n")}`}}function V(e,n){const t=n.filter((n=>n.requiredIfPresent?!e[n.name]&&e[n.requiredIfPresent]:void 0===e[n.name])).map((e=>e.name));if(t.length>0)throw new J(t.map((e=>`Missing required parameter: ${e}`)))}function W(e){return Object.entries(e).filter((([,e])=>void 0!==e)).filter((([,e])=>"string"!=typeof e)).map((([e])=>`${e} must be a string`))}function Z(e){return Object.entries(e).filter((([,e])=>void 0!==e)).filter((([,e])=>"number"!=typeof e)).map((([e])=>`${e} must be a number`))}function ee(e){if(!e)throw new J("bulkTransferSettings parameter is required for the called function.");if(!e.bankAccountId)throw new J("bankAccountId is required");if(!Array.isArray(e.bulkTransfers))throw new J("bulkTransfers must be an array");if(e.bulkTransfers.length>400)throw new J("Maximum of 400 bulk transfers allowed");return e.bulkTransfers.forEach(((e,n)=>{!function(e,n){if(!e)throw new J(`Invalid bulkTransfer at index ${n}: bulkTransfer object is required`);if(!e.beneficiary)throw new J(`Invalid bulkTransfer at index ${n}: Beneficiary details must be provided in the bulkTransferSettings.beneficiary field`);if(!e.beneficiary.iban)throw new J(`Invalid bulkTransfer at index ${n}: IBAN is required as part of the beneficiary details`);if(!e.beneficiary.name)throw new J(`Invalid bulkTransfer at index ${n}: Beneficiary name is required as part of the beneficiary details`);const t=W({reference:e.reference,clientTransferId:e.clientTransferId,note:e.note}),a=Z({amount:e.amount}),r=[...t,...a].flat();if(r.length>0)throw new J(r);if(e.amount>m&&(!e.attachmentsIds||0===e.attachmentsIds.length))throw new J(`Invalid bulkTransfer at index ${n}: Attachments are required for transfers over €30000`)}(e,n)})),e}const ne={getBulkTransfers:async function(e){const{accessToken:n,stagingToken:t,paginationSettings:a}=e?.operationSettings||{},r=n||p(),s=await Q({accessToken:r,stagingToken:t,paginationSettings:a}),o=s.bulkTransfers?.map(Y),c=i(s.meta);return{bulkTransfers:o,...c?{meta:c}:{}}},getBulkTransfer:async function({bulkTransferSettings:e,operationSettings:n}){const t=function(e){if(!e)throw new J("bulkTransferId parameter is required for the called function.");if("string"!=typeof e)throw new J("bulkTransferId must be a string.");return e}(e?.bulkTransferId),{accessToken:a,stagingToken:r}=n||{},s=a||p();return Y(await X({accessToken:s,stagingToken:r,bulkTransferId:t}))},createBulkTransfer:async function*({bulkTransferSettings:e,operationSettings:n}){const{accessToken:t,stagingToken:a,scaSessionToken:r,idempotencyKey:o}=n||{},i=t||p(),c=o||s(),u=ee(e),d=new Map;for(const e of u.bulkTransfers){const n=e.beneficiary;if(n){const e=n.iban;e&&!d.has(e)&&d.set(e,{name:n.name,iban:e})}}const f=Array.from(d.values()),g=await z({sepaPayees:f,accessToken:i,stagingToken:a});if((yield g.requests.map(G))===h)return;const l=await async function({bulkTransfers:e,accessToken:n,stagingToken:t,scaSessionToken:a,bankAccountId:r,idempotencyKey:s}){const o={method:"POST",headers:{...x({accessToken:n,stagingToken:t,scaSessionToken:a,idempotencyKey:s})},body:JSON.stringify({bank_account_id:r,bulk_transfers:e.map((e=>function(e){return{beneficiary_id:e.beneficiaryId||e.beneficiary?.id,client_transfer_id:e.clientTransferId,amount:e.amount.toString(),reference:e.reference,...e.note?{note:e.note}:{},...e.scheduledDate?{scheduled_date:e.scheduledDate.toISOString().split("T")[0]}:{},...e.attachmentsIds?{attachment_ids:e.attachmentsIds}:{}}}(e)))})},i=new URL(`${_.getEnvironmentUrls().THIRD_PARTY_API_URL}${H}`),c=await fetch(i,o),u=await c.json();if(!c.ok||u.errors)throw new R({message:u.errors?u.errors.map((e=>`${e.code}: ${e.detail}`)).join(", "):"Failed to create SEPA bulk transfer"});return u.bulk_transfer}({bulkTransfers:u.bulkTransfers,bankAccountId:u.bankAccountId,accessToken:i,stagingToken:a,scaSessionToken:r,idempotencyKey:c});return{bulkTransfer:Y(l),meta:{idempotencyKey:c}}}};class te extends d{constructor(e){super(),this.name="EmbedOperationError",this.message=e}}async function ae({proxyFunction:e,networkCallDescriptor:n,proxyEndpointDescriptor:t}){if(t){const e={...Object.fromEntries([...x(n.options?.headers)??{}])},a=O({...n,options:{...n.options,headers:e}}),r=await fetch(t.path,{method:t.method,headers:t.options.headers,body:a}),s=q(await r.text());if(!r.ok)throw new R({code:r.status,data:s,message:`Error from proxy endpoint: ${r.status} ${r.statusText}`});return s}if(e){const t=Object.fromEntries([...x(n.options?.headers)??{}]),a=O({...n,options:{...n.options,headers:t}});return q(await e(a))}throw new te("No proxy function or proxy endpoint descriptor provided for proxy call.")}const re={requiresUI:!1};function se(e,{requiresUI:n}=re){const t=e?.uiParentElementId||D.getUIParentElementId();if(n){if(!t)throw new J("operationSettings parameter must have a uiParentElementId for the called function.\nYou can pass it either to the initialize function or in a per function basis.");if(!["string","function"].includes(typeof t))throw new J("operationSettings.uiParentElementId must be a string or a function returning an HTMLElement")}const a=e?.mfaPreference||D.getMFAPreference();if(a){const e=(r=Object.values(T),_.isProductionEnvironment()?r.filter((e=>e!==T.MOCK)):r);if(!e.includes(a))throw new J(`operationSettings.mfaPreference must be one of ${e.join(", ")}`);if(_.isProductionEnvironment()&&a===T.MOCK)throw new J("operationSettings.mfaPreference cannot be set to mock in production environment.")}var r;const s=e?.debugMode||D.getDebugMode();if(void 0!==s&&"boolean"!=typeof s)throw new J("operationSettings.debugMode must be a boolean.");const o=e?.proxyRequestFunction||D.getProxyRequestFunction();if(o&&"function"!=typeof o)throw new J("operationSettings.proxyRequestFunction must be a function.");const i=e?.proxyEndpointDescriptor||D.getProxyEndpointDescriptor();if(i&&!i.path)throw new J("operationSettings.proxyEndpointDescriptor must have at least a string-formatted path property.");return{...e,uiParentElementId:t,mfaPreference:a,debugMode:s,proxyRequestFunction:o,proxyEndpointDescriptor:i}}function oe({accessToken:e,stagingToken:n,action:t,callbackUrl:a}){const r={post_authn_action:t};return a&&(r.callback_url=a),{path:"/v1/embed_auth_links",options:{method:"POST",headers:{accessToken:e,stagingToken:n},body:{embed_auth_link:r}}}}function ie(e){return{url:e.url,postAuthAction:e.post_authn_action,callbackUrl:e.callback_url,expiresAt:e.expired_at,usedAt:e.used_at}}const ce={request:async function({requestSettings:e,operationSettings:n}){!function(e){if(!e||"object"!=typeof e)throw new J("requestSettings must be an object");const n=e,{action:t,callbackUrl:a}=e;V(n,[{name:"action"}]);const r=W(n),s=Object.values(k);if(s.includes(t)||r.push(`action must be one of ${s.join(", ")}`),r.length>0)throw new J(r);if(void 0!==a&&""===a.trim())throw new J("callbackUrl cannot be empty")}(e);const{proxyRequestFunction:t,proxyEndpointDescriptor:a,stagingToken:r}=se(n||{});if(t||a){const n=oe({stagingToken:r,action:e.action,callbackUrl:e.callbackUrl});return ie((await ae({proxyFunction:t,proxyEndpointDescriptor:a,networkCallDescriptor:n})).body)}{const t=n?.accessToken||p();return ie(await async function(e){const n=oe({accessToken:e.accessToken,stagingToken:e.stagingToken,action:e.action,callbackUrl:e.callbackUrl}),{embed_auth_link:t}=await U(n);return{url:t.url,post_authn_action:t.post_authn_action,callback_url:t.callback_url,expired_at:t.expired_at,used_at:t.used_at}}({accessToken:t,stagingToken:r,action:e.action,callbackUrl:e.callbackUrl}))}}};function ue(e){return{id:e.id,name:e.name,email:e.email,activityTag:e.activity_tag,iban:e.iban,bic:e.bic,currency:e.currency,status:e.status,trusted:e.trusted,createdAt:new Date(e.created_at),updatedAt:new Date(e.updated_at)}}function de({beneficiaryId:e,accessToken:n,stagingToken:t}){return{path:`/v2/sepa/beneficiaries/${e}`,options:{method:"GET",headers:{accessToken:n,stagingToken:t}}}}async function fe({beneficiarySettings:e,operationSettings:n}){const t=function(e){if(!e)throw new J("beneficiaryId parameter is required for the called function");if(e&&"string"!=typeof e)throw new J("beneficiaryId must be a string");return e}(e?.beneficiaryId),{proxyRequestFunction:a,proxyEndpointDescriptor:r,accessToken:s,stagingToken:o}=se(n||{});if(a||r){const e=de({beneficiaryId:t});return ue((await ae({proxyFunction:a,proxyEndpointDescriptor:r,networkCallDescriptor:e})).body.beneficiary)}{const e=s||p(),n=await async function({accessToken:e,stagingToken:n,beneficiaryId:t}){const a=de({beneficiaryId:t,accessToken:e,stagingToken:n}),{beneficiary:r}=await U(a);return r}({beneficiaryId:t,accessToken:e,stagingToken:o});return ue(n)}}function pe(e,n){const t=n?.locale||A.getLocale(),a=new URL(e);return t&&a.searchParams.append("lang",t),n?.mfaPreference&&a.searchParams.append("mfaPreference",n.mfaPreference),n?.idempotencyKey&&a.searchParams.append("idempotencyKey",n.idempotencyKey),a.toString()}const ge=[{name:"bankAccountId"},{name:"reference"},{name:"amount"}];const le={getSepaTransfers:async function(e){const{accessToken:n,stagingToken:t,paginationSettings:a}=e?.operationSettings||{},r=n||p(),s=await C({accessToken:r,stagingToken:t,paginationSettings:a}),o=s.transfers.map($),c=i(s.meta);return{transfers:o,...c?{meta:c}:{}}},getSepaTransfer:async function({sepaTransferSettings:e,operationSettings:n}){const t=function(e){if(!e)throw new J("sepaTransferId parameter is required for the called function");if(e&&"string"!=typeof e)throw new J("sepaTransferId must be a string");return e}(e?.sepaTransferId),{accessToken:a,stagingToken:r}=n||{},s=a||p();return $(await j({sepaTransferId:t,accessToken:s,stagingToken:r}))},createSepaTransfer:async function*({sepaTransferSettings:e,operationSettings:n}){const{accessToken:t,stagingToken:a,scaSessionToken:r,idempotencyKey:o}=n||{},i=t||p(),c=o||s();!function(e){if(!e)throw new J("sepaTransferSettings parameter is required for the called function");if("object"!=typeof e)throw new J("sepaTransferSettings must be an object");if(!e.beneficiaryId&&!e.beneficiary)throw new J("Either beneficiaryId or beneficiary must be provided");const n=W({beneficiaryId:e.beneficiaryId});if(n.length>0)throw new J(n)}(e);const u=e?.beneficiary?e.beneficiary:await async function({sepaTransferSettings:e,operationSettings:n}){return e?.beneficiary?e.beneficiary:await fe({beneficiarySettings:{beneficiaryId:e?.beneficiaryId},operationSettings:n})}({sepaTransferSettings:e,operationSettings:n}),d={name:u.name,iban:u.iban},f=await K({sepaPayee:d,accessToken:i,stagingToken:a}),g=yield(l=f,{matchResult:l.match_result,matchedName:l.matched_name});var l;let T;if("string"==typeof g){if(g===h)return}else{if(g.vopDecision===h)return;T=g.sepaTransferSettings}const k={...e,...T};!function(e){if(!e)throw new J("sepaTransferSettings parameter is required for the called function");if("object"!=typeof e)throw new J("sepaTransferSettings must be an object");V(e,ge);const n=[...W({bankAccountId:e.bankAccountId,note:e.note,reference:e.reference}),...Z({amount:e.amount})].flat();if(n.length>0)throw new J(n);if(e.amount>m&&(!e.attachmentIds||0===e.attachmentIds.length))throw new J("Attachments are required for transfers over €30,000")}(k);const b={...k,beneficiary:u};return{transfer:$(await B({transfer:b,vopProofToken:f.proof_token.token,accessToken:i,stagingToken:a,scaSessionToken:r,idempotencyKey:c})),meta:{idempotencyKey:c}}},cancelSepaTransfer:async function({sepaTransferSettings:e,operationSettings:n}){const t=function(e){if(!e)throw new J("sepaTransferId parameter is required for the called function");if("string"!=typeof e)throw new J("sepaTransferId must be a string");return e}(e?.sepaTransferId),{accessToken:a,stagingToken:r}=n||{},s=a||p();await F({sepaTransferId:t,accessToken:s,stagingToken:r})},getSepaTransferCreationFlowLink:async function({sepaTransferSettings:e,operationSettings:n}){const t=function(e){if(!e||!e.callbackUrl)throw new J("callbackUrl parameter is required for the getSepaTransferCreationFlowLink function");if("string"!=typeof e.callbackUrl)throw new J("callbackUrl must be a string");return e.callbackUrl}(e),{accessToken:a,stagingToken:r}=n||{},s=a||p(),o=await ce.request({requestSettings:{action:k.SEPA_TRANSFER_CREATE,callbackUrl:t},operationSettings:{stagingToken:r,accessToken:s}});return{...o,url:pe(o.url,n)}},bulkTransfers:ne};e.sepaTransfers=le}));
|
|
1
|
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).QontoEmbedServer={})}(this,(function(e){"use strict";const n=[];for(let e=0;e<256;++e)n.push((e+256).toString(16).slice(1));let t;const a=new Uint8Array(16);var r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function s(e,s,o){if(r.randomUUID&&!e)return r.randomUUID();const i=(e=e||{}).random??e.rng?.()??function(){if(!t){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");t=crypto.getRandomValues.bind(crypto)}return t(a)}();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=15&i[6]|64,i[8]=63&i[8]|128,function(e,t=0){return(n[e[t+0]]+n[e[t+1]]+n[e[t+2]]+n[e[t+3]]+"-"+n[e[t+4]]+n[e[t+5]]+"-"+n[e[t+6]]+n[e[t+7]]+"-"+n[e[t+8]]+n[e[t+9]]+"-"+n[e[t+10]]+n[e[t+11]]+n[e[t+12]]+n[e[t+13]]+n[e[t+14]]+n[e[t+15]]).toLowerCase()}(i)}function o(e){const n=new URLSearchParams;return e?.page&&n.append("page",e.page.toString()),e?.itemsPerPage&&n.append("per_page",e.itemsPerPage.toString()),n}function i(e){if(e)return{totalItems:e?.total_count,totalPages:e?.total_pages,currentPage:e?.current_page,itemsPerPage:e?.per_page,previousPage:e?.prev_page||null,nextPage:e?.next_page||null}}class c{constructor(){this.accessToken=null,this.stagingToken=null}static getInstance(){return c.instance||(c.instance=new c),c.instance}setAccessToken(e){this.accessToken=e}getAccessToken(){return this.accessToken}hasAccessToken(){return null!==this.accessToken&&""!==this.accessToken}clearAccessToken(){this.accessToken=null}setStagingToken(e){this.stagingToken=e}getStagingToken(){return this.stagingToken}hasStagingToken(){return null!==this.stagingToken&&""!==this.stagingToken}clearStagingToken(){this.stagingToken=null}}const u=c.getInstance();class d extends Error{constructor(){super(),this.stack=""}toString(){return`${this.name}: ${this.message}`}}class f extends d{constructor(){super(),this.name="AuthenticationError",this.message="Authentication failed due to missing or invalid authentication method. Provide either a proxyRequestFunction (recommended) or accessToken, either as parameters or by calling the initialize function first."}}function p(){if(!u.hasAccessToken())throw new f;return u.getAccessToken()}const g={PRODUCTION:"production",STAGING:"staging",LOCAL:"local"},l={MASTER:"master",SANDBOX:"sandbox",QA:"qa"},T={PASSKEY:"passkey",SMS_OTP:"sms-otp",PAIRED_DEVICE:"paired-device",MOCK:"mock"},m=3e4,h="REJECT",k={CARD_DISPLAY:"display_card",PAYMENT_LINK_CREATE:"create_payment_link",SEPA_TRANSFER_CREATE:"create_sepa_transfer"},b="https://embed.qonto.com",y="https://embed-js{branch}.staging.qonto.co",w="https://embed.dev.qonto.co",I={[g.PRODUCTION]:{EMBED_BASE_URL:b,EMBED_URL:`${b}/connect`,THIRD_PARTY_API_URL:"https://thirdparty.qonto.com"},[g.STAGING]:{EMBED_BASE_URL:y,EMBED_URL:`${y}/connect`,THIRD_PARTY_API_URL:"https://thirdparty{branch}.staging.qonto.co"},[g.LOCAL]:{EMBED_BASE_URL:w,EMBED_URL:`${w}/connect`,THIRD_PARTY_API_URL:"https://thirdparty{branch}.staging.qonto.co"}};class S{constructor(){let e,n;this.environment=g.PRODUCTION,this.branch=l.SANDBOX,"undefined"!=typeof process&&process.env&&(e=process.env.QONTO_EMBED_ENVIRONMENT,n=process.env.QONTO_EMBED_BRANCH),this.environment=Object.values(g).includes(e)?e:g.PRODUCTION,this.branch=Object.values(l).includes(n)?n:l.SANDBOX}static getInstance(){return S.instance||(S.instance=new S),S.instance}setEnvironment(e){this.environment=e}getEnvironment(){return this.environment}isProductionEnvironment(){return this.environment===g.PRODUCTION}setBranch(e){this.branch=e}getBranch(){return this.branch}clear(){this.environment=g.PRODUCTION,this.branch=l.MASTER}getEnvironmentUrls(){if(this.environment===g.PRODUCTION)return I.production;{const e=I[this.environment];return Object.entries(e).reduce(((e,[n,t])=>({...e,[n]:t.replace("{branch}",`-${this.branch}`)})),{})}}}const _=S.getInstance();function P(){return!("undefined"!=typeof window&&"undefined"!=typeof document)}class E{constructor(){this.currentLocale="en"}static getInstance(){return E.instance||(E.instance=new E),E.instance}setLocale(e){this.currentLocale=e}getLocale(){return this.currentLocale}setDefaultLocale(){this.currentLocale="en"}}const A=E.getInstance();class v{constructor(){this.mfaPreference=T.PASSKEY,this.debugMode=!1}static getInstance(){return v.instance||(v.instance=new v),v.instance}setSettings(e){e.uiParentElementId&&(this.uiParentElementId=e.uiParentElementId),e.mfaPreference&&(this.mfaPreference=e.mfaPreference),e.debugMode&&(this.debugMode=e.debugMode),e.proxyRequestFunction&&(this.proxyRequestFunction=e.proxyRequestFunction),e.proxyEndpointDescriptor&&(this.proxyEndpointDescriptor=e.proxyEndpointDescriptor)}getUIParentElementId(){return this.uiParentElementId}getMFAPreference(){return this.mfaPreference}getDebugMode(){return this.debugMode}getProxyRequestFunction(){return this.proxyRequestFunction}getProxyEndpointDescriptor(){return this.proxyEndpointDescriptor}clearSettings(){this.uiParentElementId=void 0,this.mfaPreference=T.PASSKEY,this.debugMode=!1,this.proxyRequestFunction=void 0}getSettings(){return{uiParentElementId:this.uiParentElementId,mfaPreference:this.mfaPreference,debugMode:this.debugMode,proxyRequestFunction:this.proxyRequestFunction}}}const D=v.getInstance();class R extends d{constructor({message:e,data:n,code:t}){super(),this.code=500;const a=Array.isArray(e)?e.join("\n"):e;this.name="EmbedApiError",this.message=`The call to the Embed API failed with the following errors:\n${a}`,this.data=n||{},this.code=t||this.code}}function x({accessToken:e,stagingToken:n,idempotencyKey:t,mfaPreference:a,scaSessionToken:r}){const s=new Headers;s.append("Authorization",`Bearer ${e}`);const o=n||u.getStagingToken();o&&s.append("X-Qonto-Staging-Token",o),t&&s.append("X-Qonto-Idempotency-Key",t);const i=a||D.getMFAPreference();return i&&s.append("X-Qonto-2fa-Preference",i),r&&s.append("X-Qonto-SCA-Session-Token",r),s.append("Content-Type","application/json"),s.append("Accept-Language",A.getLocale()),s}async function U({path:e,options:n}){const t=`${_.getEnvironmentUrls().THIRD_PARTY_API_URL}${e}`,a=await fetch(t,{...n,headers:x(n.headers),body:n.body?JSON.stringify(n.body):void 0});if(204===a.status)return;const r=await a.json();if(!a.ok)throw r.errors?new R({code:a.status,message:r.errors.map((e=>`${e.code}: ${e.detail}`))}):new R({code:a.status,message:`${r.code}: ${r.detail}`,data:r});return r}function O(e){const n={method:e.options.method,headers:e.options.headers,path:e.path,payload:e.options?.body},t=JSON.stringify(n);return a=t,P()?Buffer.from(a).toString("base64"):btoa(a);var a}function $(e){return JSON.parse((n=e,P()?Buffer.from(n,"base64").toString("utf-8"):atob(n)));var n}function q(e){return{id:e.id,initiatorId:e.initiator_id,bankAccountId:e.bank_account_id,amount:Number(e.amount),amountCents:Number(e.amount_cents),amountCurrency:e.amount_currency,status:e.status,beneficiaryId:e.beneficiary_id,reference:e.reference,note:e.note,declinedReason:e.declined_reason,scheduledDate:new Date(e.scheduled_date),createdAt:new Date(e.created_at),updatedAt:new Date(e.updated_at),processedAt:new Date(e.processed_at),completedAt:new Date(e.completed_at),transactionId:e.transaction_id}}function M(e){return{name:e.name,iban:e.iban}}const N="/v2/sepa",L=`${N}/transfers`;async function C({accessToken:e,stagingToken:n,paginationSettings:t}){const a=function({paginationSettings:e,accessToken:n,stagingToken:t}){const a={method:"GET",headers:{accessToken:n,stagingToken:t}},r=o(e),s=r.size?`?${r.toString()}`:"";return{path:`${L}${s}`,options:a}}({paginationSettings:t,accessToken:e,stagingToken:n}),{transfers:r,meta:s}=await U(a);return{transfers:r,meta:s}}async function j({accessToken:e,stagingToken:n,sepaTransferId:t}){const a=function({sepaTransferId:e,accessToken:n,stagingToken:t}){return{path:`${L}/${e}`,options:{method:"GET",headers:{accessToken:n,stagingToken:t}}}}({sepaTransferId:t,accessToken:e,stagingToken:n}),{transfer:r}=await U(a);return r}async function B({transfer:e,vopProofToken:n,accessToken:t,stagingToken:a,scaSessionToken:r,idempotencyKey:s}){const o=function({transfer:e,vopProofToken:n,accessToken:t,stagingToken:a,scaSessionToken:r,idempotencyKey:s}){const o=function(e){const n=e.beneficiaryId||e.beneficiary?.id;return{bank_account_id:e.bankAccountId,beneficiary_id:n,amount:e.amount.toString(),reference:e.reference,...e.note?{note:e.note}:{},...e.scheduledDate?{scheduled_date:e.scheduledDate.toISOString().split("T")[0]}:{},...e.attachmentIds?{attachment_ids:e.attachmentIds}:{}}}(e);return{path:L,options:{method:"POST",headers:{accessToken:t,stagingToken:a,scaSessionToken:r,idempotencyKey:s},body:{transfer:o,vop_proof_token:n}}}}({transfer:e,vopProofToken:n,accessToken:t,stagingToken:a,scaSessionToken:r,idempotencyKey:s}),{transfer:i}=await U(o);return i}async function F({sepaTransferId:e,accessToken:n,stagingToken:t}){const a=function({sepaTransferId:e,accessToken:n,stagingToken:t}){return{path:`${L}/${e}/cancel`,options:{method:"POST",headers:{accessToken:n,stagingToken:t}}}}({sepaTransferId:e,accessToken:n,stagingToken:t});await U(a)}async function K({sepaPayee:e,accessToken:n,stagingToken:t}){const a=function({sepaPayee:e,accessToken:n,stagingToken:t}){return{path:`${N}/verify_payee`,options:{method:"POST",headers:{accessToken:n,stagingToken:t},body:{beneficiary_name:e.name,iban:e.iban}}}}({sepaPayee:e,accessToken:n,stagingToken:t});return await U(a)}function Y(e){return{id:e.id,initiatorId:e.initiator_id,createdAt:new Date(e.created_at),updatedAt:new Date(e.updated_at),totalCount:Number(e.total_count),completedCount:Number(e.completed_count),failedCount:Number(e.failed_count),pendingCount:Number(e.pending_count),results:e.results.map((e=>({clientTransferId:e.client_transfer_id,transferId:e.transfer_id??null,errors:e.errors||null,status:e.status})))}}function G(e){return{id:e.id,response:{matchResult:e.response.match_result,matchedName:e.response.matched_name}}}const H="/v2/sepa/bulk_transfers";async function Q({accessToken:e,stagingToken:n,paginationSettings:t}){const a=function({paginationSettings:e,accessToken:n,stagingToken:t}){const a={method:"GET",headers:{accessToken:n,stagingToken:t}},r=o(e),s=r.size?`?${r.toString()}`:"";return{path:`${H}${s}`,options:a}}({paginationSettings:t,accessToken:e,stagingToken:n}),{bulk_transfers:r,meta:s}=await U(a);return{bulkTransfers:r,meta:s}}async function X({accessToken:e,stagingToken:n,bulkTransferId:t}){const a=function({bulkTransferId:e,accessToken:n,stagingToken:t}){return{path:`${H}/${e}`,options:{method:"GET",headers:{accessToken:n,stagingToken:t}}}}({bulkTransferId:t,accessToken:e,stagingToken:n}),{bulk_transfer:r}=await U(a);return r}async function z({sepaPayees:e,accessToken:n,stagingToken:t}){const a=function({sepaPayees:e,accessToken:n,stagingToken:t}){return{path:`${N}/bulk_verify_payee`,options:{method:"POST",headers:{accessToken:n,stagingToken:t},body:{requests:e.map(M)}}}}({sepaPayees:e,accessToken:n,stagingToken:t});return await U(a)}class J extends d{constructor(e){super(),this.name="InvalidParametersError",this.invalidParameters=Array.isArray(e)?e:[e],this.message=`Invalid parameters were passed to the function:\n${this.invalidParameters.map((e=>e)).join("\n")}`}}function V(e,n){const t=n.filter((n=>n.requiredIfPresent?!e[n.name]&&e[n.requiredIfPresent]:void 0===e[n.name])).map((e=>e.name));if(t.length>0)throw new J(t.map((e=>`Missing required parameter: ${e}`)))}function W(e){return Object.entries(e).filter((([,e])=>void 0!==e)).filter((([,e])=>"string"!=typeof e)).map((([e])=>`${e} must be a string`))}function Z(e){return Object.entries(e).filter((([,e])=>void 0!==e)).filter((([,e])=>"number"!=typeof e)).map((([e])=>`${e} must be a number`))}function ee(e){if(!e)throw new J("bulkTransferSettings parameter is required for the called function.");if(!e.bankAccountId)throw new J("bankAccountId is required");if(!Array.isArray(e.bulkTransfers))throw new J("bulkTransfers must be an array");if(e.bulkTransfers.length>400)throw new J("Maximum of 400 bulk transfers allowed");return e.bulkTransfers.forEach(((e,n)=>{!function(e,n){if(!e)throw new J(`Invalid bulkTransfer at index ${n}: bulkTransfer object is required`);if(!e.beneficiary)throw new J(`Invalid bulkTransfer at index ${n}: Beneficiary details must be provided in the bulkTransferSettings.beneficiary field`);if(!e.beneficiary.iban)throw new J(`Invalid bulkTransfer at index ${n}: IBAN is required as part of the beneficiary details`);if(!e.beneficiary.name)throw new J(`Invalid bulkTransfer at index ${n}: Beneficiary name is required as part of the beneficiary details`);const t=W({reference:e.reference,clientTransferId:e.clientTransferId,note:e.note}),a=Z({amount:e.amount}),r=[...t,...a].flat();if(r.length>0)throw new J(r);if(e.amount>m&&(!e.attachmentsIds||0===e.attachmentsIds.length))throw new J(`Invalid bulkTransfer at index ${n}: Attachments are required for transfers over €30000`)}(e,n)})),e}const ne={getBulkTransfers:async function(e){const{accessToken:n,stagingToken:t,paginationSettings:a}=e?.operationSettings||{},r=n||p(),s=await Q({accessToken:r,stagingToken:t,paginationSettings:a}),o=s.bulkTransfers?.map(Y),c=i(s.meta);return{bulkTransfers:o,...c?{meta:c}:{}}},getBulkTransfer:async function({bulkTransferSettings:e,operationSettings:n}){const t=function(e){if(!e)throw new J("bulkTransferId parameter is required for the called function.");if("string"!=typeof e)throw new J("bulkTransferId must be a string.");return e}(e?.bulkTransferId),{accessToken:a,stagingToken:r}=n||{},s=a||p();return Y(await X({accessToken:s,stagingToken:r,bulkTransferId:t}))},createBulkTransfer:async function*({bulkTransferSettings:e,operationSettings:n}){const{accessToken:t,stagingToken:a,scaSessionToken:r,idempotencyKey:o}=n||{},i=t||p(),c=o||s(),u=ee(e),d=new Map;for(const e of u.bulkTransfers){const n=e.beneficiary;if(n){const e=n.iban;e&&!d.has(e)&&d.set(e,{name:n.name,iban:e})}}const f=Array.from(d.values()),g=await z({sepaPayees:f,accessToken:i,stagingToken:a});if((yield g.requests.map(G))===h)return;const l=await async function({bulkTransfers:e,accessToken:n,stagingToken:t,scaSessionToken:a,bankAccountId:r,idempotencyKey:s}){const o={method:"POST",headers:{...x({accessToken:n,stagingToken:t,scaSessionToken:a,idempotencyKey:s})},body:JSON.stringify({bank_account_id:r,bulk_transfers:e.map((e=>function(e){return{beneficiary_id:e.beneficiaryId||e.beneficiary?.id,client_transfer_id:e.clientTransferId,amount:e.amount.toString(),reference:e.reference,...e.note?{note:e.note}:{},...e.scheduledDate?{scheduled_date:e.scheduledDate.toISOString().split("T")[0]}:{},...e.attachmentsIds?{attachment_ids:e.attachmentsIds}:{}}}(e)))})},i=new URL(`${_.getEnvironmentUrls().THIRD_PARTY_API_URL}${H}`),c=await fetch(i,o),u=await c.json();if(!c.ok||u.errors)throw new R({message:u.errors?u.errors.map((e=>`${e.code}: ${e.detail}`)).join(", "):"Failed to create SEPA bulk transfer"});return u.bulk_transfer}({bulkTransfers:u.bulkTransfers,bankAccountId:u.bankAccountId,accessToken:i,stagingToken:a,scaSessionToken:r,idempotencyKey:c});return{bulkTransfer:Y(l),meta:{idempotencyKey:c}}}};class te extends d{constructor(e){super(),this.name="EmbedOperationError",this.message=e}}async function ae({proxyFunction:e,networkCallDescriptor:n,proxyEndpointDescriptor:t}){if(t){const e={...Object.fromEntries([...x(n.options?.headers)??{}])},a=O({...n,options:{...n.options,headers:e}}),r=await fetch(t.path,{method:t.method,headers:t.options.headers,body:a}),s=$(await r.text());if(!r.ok)throw new R({code:r.status,data:s,message:`Error from proxy endpoint: ${r.status} ${r.statusText}`});return s}if(e){const t=Object.fromEntries([...x(n.options?.headers)??{}]),a=O({...n,options:{...n.options,headers:t}});return $(await e(a))}throw new te("No proxy function or proxy endpoint descriptor provided for proxy call.")}const re={requiresUI:!1};function se(e,{requiresUI:n}=re){const t=e?.uiParentElementId||D.getUIParentElementId();if(n){if(!t)throw new J("operationSettings parameter must have a uiParentElementId for the called function.\nYou can pass it either to the initialize function or in a per function basis.");if(!["string","function"].includes(typeof t))throw new J("operationSettings.uiParentElementId must be a string or a function returning an HTMLElement")}const a=e?.mfaPreference||D.getMFAPreference();if(a){const e=(r=Object.values(T),_.isProductionEnvironment()?r.filter((e=>e!==T.MOCK)):r);if(!e.includes(a))throw new J(`operationSettings.mfaPreference must be one of ${e.join(", ")}`);if(_.isProductionEnvironment()&&a===T.MOCK)throw new J("operationSettings.mfaPreference cannot be set to mock in production environment.")}var r;const s=e?.debugMode||D.getDebugMode();if(void 0!==s&&"boolean"!=typeof s)throw new J("operationSettings.debugMode must be a boolean.");const o=e?.proxyRequestFunction||D.getProxyRequestFunction();if(o&&"function"!=typeof o)throw new J("operationSettings.proxyRequestFunction must be a function.");const i=e?.proxyEndpointDescriptor||D.getProxyEndpointDescriptor();if(i&&!i.path)throw new J("operationSettings.proxyEndpointDescriptor must have at least a string-formatted path property.");return{...e,uiParentElementId:t,mfaPreference:a,debugMode:s,proxyRequestFunction:o,proxyEndpointDescriptor:i}}function oe({accessToken:e,stagingToken:n,action:t,callbackUrl:a}){const r={post_authn_action:t};return a&&(r.callback_url=a),{path:"/v1/embed_auth_links",options:{method:"POST",headers:{accessToken:e,stagingToken:n},body:{embed_auth_link:r}}}}function ie(e){return{url:e.url,postAuthAction:e.post_authn_action,callbackUrl:e.callback_url,expiresAt:e.expired_at,usedAt:e.used_at}}async function ce({requestSettings:e,operationSettings:n}){!function(e){if(!e||"object"!=typeof e)throw new J("requestSettings must be an object");const n=e,{action:t,callbackUrl:a}=e;V(n,[{name:"action"}]);const r=W(n),s=Object.values(k);if(s.includes(t)||r.push(`action must be one of ${s.join(", ")}`),r.length>0)throw new J(r);if(void 0!==a&&""===a.trim())throw new J("callbackUrl cannot be empty")}(e);const{proxyRequestFunction:t,proxyEndpointDescriptor:a,stagingToken:r}=se(n||{});if(t||a){const n=oe({stagingToken:r,action:e.action,callbackUrl:e.callbackUrl});return ie((await ae({proxyFunction:t,proxyEndpointDescriptor:a,networkCallDescriptor:n})).body)}{const t=n?.accessToken||p();return ie(await async function(e){const n=oe({accessToken:e.accessToken,stagingToken:e.stagingToken,action:e.action,callbackUrl:e.callbackUrl}),{embed_auth_link:t}=await U(n);return{url:t.url,post_authn_action:t.post_authn_action,callback_url:t.callback_url,expired_at:t.expired_at,used_at:t.used_at}}({accessToken:t,stagingToken:r,action:e.action,callbackUrl:e.callbackUrl}))}}function ue(e){return{id:e.id,name:e.name,email:e.email,activityTag:e.activity_tag,iban:e.iban,bic:e.bic,currency:e.currency,status:e.status,trusted:e.trusted,createdAt:new Date(e.created_at),updatedAt:new Date(e.updated_at)}}function de({beneficiaryId:e,accessToken:n,stagingToken:t}){return{path:`/v2/sepa/beneficiaries/${e}`,options:{method:"GET",headers:{accessToken:n,stagingToken:t}}}}async function fe({beneficiarySettings:e,operationSettings:n}){const t=function(e){if(!e)throw new J("beneficiaryId parameter is required for the called function");if(e&&"string"!=typeof e)throw new J("beneficiaryId must be a string");return e}(e?.beneficiaryId),{proxyRequestFunction:a,proxyEndpointDescriptor:r,accessToken:s,stagingToken:o}=se(n||{});if(a||r){const e=de({beneficiaryId:t});return ue((await ae({proxyFunction:a,proxyEndpointDescriptor:r,networkCallDescriptor:e})).body.beneficiary)}{const e=s||p(),n=await async function({accessToken:e,stagingToken:n,beneficiaryId:t}){const a=de({beneficiaryId:t,accessToken:e,stagingToken:n}),{beneficiary:r}=await U(a);return r}({beneficiaryId:t,accessToken:e,stagingToken:o});return ue(n)}}function pe(e,n){const t=n?.locale||A.getLocale(),a=new URL(e);return t&&a.searchParams.append("lang",t),n?.mfaPreference&&a.searchParams.append("mfaPreference",n.mfaPreference),n?.idempotencyKey&&a.searchParams.append("idempotencyKey",n.idempotencyKey),a.toString()}const ge=[{name:"bankAccountId"},{name:"reference"},{name:"amount"}];const le={getSepaTransfers:async function(e){const{accessToken:n,stagingToken:t,paginationSettings:a}=e?.operationSettings||{},r=n||p(),s=await C({accessToken:r,stagingToken:t,paginationSettings:a}),o=s.transfers.map(q),c=i(s.meta);return{transfers:o,...c?{meta:c}:{}}},getSepaTransfer:async function({sepaTransferSettings:e,operationSettings:n}){const t=function(e){if(!e)throw new J("sepaTransferId parameter is required for the called function");if(e&&"string"!=typeof e)throw new J("sepaTransferId must be a string");return e}(e?.sepaTransferId),{accessToken:a,stagingToken:r}=n||{},s=a||p();return q(await j({sepaTransferId:t,accessToken:s,stagingToken:r}))},createSepaTransfer:async function*({sepaTransferSettings:e,operationSettings:n}){const{accessToken:t,stagingToken:a,scaSessionToken:r,idempotencyKey:o}=n||{},i=t||p(),c=o||s();!function(e){if(!e)throw new J("sepaTransferSettings parameter is required for the called function");if("object"!=typeof e)throw new J("sepaTransferSettings must be an object");if(!e.beneficiaryId&&!e.beneficiary)throw new J("Either beneficiaryId or beneficiary must be provided");const n=W({beneficiaryId:e.beneficiaryId});if(n.length>0)throw new J(n)}(e);const u=e?.beneficiary?e.beneficiary:await async function({sepaTransferSettings:e,operationSettings:n}){return e?.beneficiary?e.beneficiary:await fe({beneficiarySettings:{beneficiaryId:e?.beneficiaryId},operationSettings:n})}({sepaTransferSettings:e,operationSettings:n}),d={name:u.name,iban:u.iban},f=await K({sepaPayee:d,accessToken:i,stagingToken:a}),g=yield(l=f,{matchResult:l.match_result,matchedName:l.matched_name});var l;let T;if("string"==typeof g){if(g===h)return}else{if(g.vopDecision===h)return;T=g.sepaTransferSettings}const k={...e,...T};!function(e){if(!e)throw new J("sepaTransferSettings parameter is required for the called function");if("object"!=typeof e)throw new J("sepaTransferSettings must be an object");V(e,ge);const n=[...W({bankAccountId:e.bankAccountId,note:e.note,reference:e.reference}),...Z({amount:e.amount})].flat();if(n.length>0)throw new J(n);if(e.amount>m&&(!e.attachmentIds||0===e.attachmentIds.length))throw new J("Attachments are required for transfers over €30,000")}(k);const b={...k,beneficiary:u};return{transfer:q(await B({transfer:b,vopProofToken:f.proof_token.token,accessToken:i,stagingToken:a,scaSessionToken:r,idempotencyKey:c})),meta:{idempotencyKey:c}}},cancelSepaTransfer:async function({sepaTransferSettings:e,operationSettings:n}){const t=function(e){if(!e)throw new J("sepaTransferId parameter is required for the called function");if("string"!=typeof e)throw new J("sepaTransferId must be a string");return e}(e?.sepaTransferId),{accessToken:a,stagingToken:r}=n||{},s=a||p();await F({sepaTransferId:t,accessToken:s,stagingToken:r})},getSepaTransferCreationFlowLink:async function({sepaTransferSettings:e,operationSettings:n}){const t=function(e){if(!e||!e.callbackUrl)throw new J("callbackUrl parameter is required for the getSepaTransferCreationFlowLink function");if("string"!=typeof e.callbackUrl)throw new J("callbackUrl must be a string");return e.callbackUrl}(e),{accessToken:a,stagingToken:r}=n||{},s=a||p(),o=await ce({requestSettings:{action:k.SEPA_TRANSFER_CREATE,callbackUrl:t},operationSettings:{stagingToken:r,accessToken:s}});return{...o,url:pe(o.url,n)}},bulkTransfers:ne};e.sepaTransfers=le}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment-links.d.ts","sourceRoot":"","sources":["../../../src/payment-links/payment-links.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"payment-links.d.ts","sourceRoot":"","sources":["../../../src/payment-links/payment-links.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,yBAAyB,EACzB,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAM/B;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,6BAA6B,GAAU,6CAGjD,iBAAiB,CAAC,yBAAyB,CAAC,KAAG,OAAO,CAAC,MAAM,CAsB/D,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,iCAAiC,GAAU,6CAGrD,iBAAiB,CAAC,yBAAyB,CAAC,KAAG,OAAO,CAAC,IAAI,CAM7D,CAAC"}
|
|
@@ -33,10 +33,8 @@ interface CreateBulkTransferClientParams {
|
|
|
33
33
|
* Creates a new SEPA bulk transfer with Verification of Payee (VoP) checks.
|
|
34
34
|
* This function is only available in client-side (browser) environments as it requires UI interaction.
|
|
35
35
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* @param params - An object containing bulk transfer settings and operation settings.
|
|
36
|
+
* @param params - An object containing bulk transfer settings and operation settings with
|
|
37
|
+
* proxyRequestFunction or proxyEndpointDescriptor (required).
|
|
40
38
|
* @returns As a yielded value, VoP check results for all unique beneficiaries.
|
|
41
39
|
* As the final return value, an object containing the created bulk transfer and metadata
|
|
42
40
|
* including the idempotency key.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bulk-transfers.client.d.ts","sourceRoot":"","sources":["../../../../../src/sepa-transfers/bulk-transfers/client/bulk-transfers.client.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"bulk-transfers.client.d.ts","sourceRoot":"","sources":["../../../../../src/sepa-transfers/bulk-transfers/client/bulk-transfers.client.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAiBzF,OAAO,KAAK,EACV,YAAY,EAEZ,oBAAoB,EACpB,0BAA0B,EAC1B,eAAe,EACf,wBAAwB,EACxB,8BAA8B,EAC9B,+BAA+B,EAEhC,MAAM,gCAAgC,CAAC;AAMxC;;GAEG;AACH,MAAM,WAAW,wBAAwB,CAAC,CAAC;IACzC,oBAAoB,CAAC,EAAE,CAAC,CAAC;IACzB,iBAAiB,CAAC,EAAE,uBAAuB,CAAC;CAC7C;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACpC,sBAAsB,CAAC,EAAE,wBAAwB,CAAC,KAAK,CAAC,GACvD,OAAO,CAAC,wBAAwB,CAAC,CAkCnC;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,EACpC,oBAAoB,EACpB,iBAAiB,GAClB,EAAE,wBAAwB,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,CAsBnE;AAwBD;;GAEG;AACH,UAAU,8BAA8B;IACtC,oBAAoB,EAAE,oBAAoB,CAAC,8BAA8B,CAAC,CAAC;IAC3E,iBAAiB,CAAC,EAAE,uBAAuB,CAAC;CAC7C;AAED;;;;;;;;;GASG;AACH,wBAAuB,kBAAkB,CAAC,EACxC,oBAAoB,EACpB,iBAAiB,GAClB,EAAE,8BAA8B,GAAG,cAAc,CAChD,+BAA+B,EAAE,EACjC,0BAA0B,GAAG,SAAS,CACvC,CAoEA"}
|