@qonto/embed-sdk 0.1.0 → 0.2.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/README.md +12 -5
- package/dist/cards/cards.api.d.ts +7 -1
- package/dist/cards/cards.api.d.ts.map +1 -1
- package/dist/cards/cards.d.ts +48 -11
- package/dist/cards/cards.d.ts.map +1 -1
- package/dist/cards/cards.public-api.d.ts +2 -1
- package/dist/cards/cards.public-api.d.ts.map +1 -1
- package/dist/cards/cards.types.d.ts +59 -3
- package/dist/cards/cards.types.d.ts.map +1 -1
- package/dist/cards/index.d.ts +15 -0
- package/dist/cards/index.d.ts.map +1 -1
- package/dist/common/common.public-api.d.ts.map +1 -1
- package/dist/common/constants.d.ts +15 -0
- package/dist/common/constants.d.ts.map +1 -1
- package/dist/common/environment/environment-manager.d.ts.map +1 -1
- package/dist/common/initialize/initialize.d.ts +38 -14
- package/dist/common/initialize/initialize.d.ts.map +1 -1
- package/dist/common/initialize/initialize.types.d.ts +19 -0
- package/dist/common/initialize/initialize.types.d.ts.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/mocks/handlers.d.ts.map +1 -1
- package/dist/src/cards/cards.api.js +1 -1
- package/dist/src/cards/cards.js +1 -1
- package/dist/src/cards/cards.public-api.js +1 -1
- package/dist/src/common/environment/environment-manager.js +1 -1
- package/dist/src/common/initialize/initialize.validate.js +1 -1
- package/dist/validation/operation-settings-validation.d.ts +14 -0
- package/dist/validation/operation-settings-validation.d.ts.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -7,25 +7,25 @@ Use Qonto Embed in your website with a high level abstraction that will make you
|
|
|
7
7
|
1. Install the SDK with your package manager of choice:
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npm install @qonto/
|
|
10
|
+
npm install @qonto/embed-sdk
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
or
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
pnpm install @qonto/
|
|
16
|
+
pnpm install @qonto/embed-sdk
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
or
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
yarn add @qonto/
|
|
22
|
+
yarn add @qonto/embed-sdk
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
2. Then, initialize the SDK in your code:
|
|
26
26
|
|
|
27
27
|
```ts
|
|
28
|
-
import { initialize } from '@qonto/
|
|
28
|
+
import { initialize } from '@qonto/embed-sdk/common';
|
|
29
29
|
|
|
30
30
|
const accessToken =
|
|
31
31
|
'An access token you have previously generated from your app';
|
|
@@ -38,11 +38,18 @@ Read more about how your users are onboarded and an access token is generated fo
|
|
|
38
38
|
3. From that moment on, you can access the different namespaces of the SDK:
|
|
39
39
|
|
|
40
40
|
```ts
|
|
41
|
-
import { cards } from '@qonto/
|
|
41
|
+
import { cards } from '@qonto/embed-sdk/cards';
|
|
42
42
|
|
|
43
43
|
const newCard = cards.orderCard(cardConfig);
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
+
## API stability
|
|
47
|
+
|
|
48
|
+
We are in the early stages of the SDK implementation. While we will strongly attempt to avoid
|
|
49
|
+
breaking changes, we may need to make some in the future. Note that while the SDK is in the v0.x
|
|
50
|
+
stage, breaking changes might happen.
|
|
51
|
+
Once we reach v1.0.0, we will follow [semantic versioning](https://semver.org/) strictly.
|
|
52
|
+
|
|
46
53
|
## Next steps
|
|
47
54
|
|
|
48
55
|
Now that you have the SDK installed and initialized, you can start using it. Check
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import type { CardDataObject, DisplayCardSettings } from './cards.types';
|
|
2
2
|
interface GetCardsParams {
|
|
3
3
|
accessToken: string;
|
|
4
|
+
membershipId?: string;
|
|
4
5
|
}
|
|
5
|
-
|
|
6
|
+
interface GetCardParams {
|
|
7
|
+
accessToken: string;
|
|
8
|
+
cardId: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function getCards({ accessToken, membershipId, }: GetCardsParams): Promise<CardDataObject[]>;
|
|
11
|
+
export declare function getCard({ accessToken, cardId, }: GetCardParams): Promise<CardDataObject>;
|
|
6
12
|
export declare function getCardIframeURL(cardSettings: DisplayCardSettings, accessToken: string): Promise<string>;
|
|
7
13
|
export {};
|
|
8
14
|
//# sourceMappingURL=cards.api.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cards.api.d.ts","sourceRoot":"","sources":["../../src/cards/cards.api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAKzE,UAAU,cAAc;IACtB,WAAW,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"cards.api.d.ts","sourceRoot":"","sources":["../../src/cards/cards.api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAKzE,UAAU,cAAc;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,aAAa;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB;AAOD,wBAAsB,QAAQ,CAAC,EAC7B,WAAW,EACX,YAAY,GACb,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAoB5C;AAED,wBAAsB,OAAO,CAAC,EAC5B,WAAW,EACX,MAAM,GACP,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,CAkBzC;AAED,wBAAsB,gBAAgB,CACpC,YAAY,EAAE,mBAAmB,EACjC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,CAAC,CA8BjB"}
|
package/dist/cards/cards.d.ts
CHANGED
|
@@ -1,21 +1,50 @@
|
|
|
1
1
|
import { type Card, type CardOrderSettings, type DisplayCardReturnObject, type DisplayCardSettings, type UnlockCardSettings } from './cards.types';
|
|
2
2
|
import { type OperationSettings } from '@validation/operation-settings-validation';
|
|
3
|
+
/**
|
|
4
|
+
* This is the common parameter format most of the card functions expect as
|
|
5
|
+
* their only parameter. It consists of a `cardSettings` object and an optional
|
|
6
|
+
* `operationSettings` object. The `cardSettings` object's properties will be
|
|
7
|
+
* different depending on the function being called. Read the docs of each card
|
|
8
|
+
* related function to see the expected properties of the `cardSettings` object.
|
|
9
|
+
*/
|
|
3
10
|
export interface CardParams<T> {
|
|
11
|
+
/**
|
|
12
|
+
* An object with the parameters relevant to different card operations. Read the
|
|
13
|
+
* documentation of each function to see the expected properties of this object.
|
|
14
|
+
*/
|
|
4
15
|
cardSettings: T;
|
|
5
16
|
operationSettings?: OperationSettings;
|
|
6
17
|
}
|
|
7
18
|
/**
|
|
8
19
|
* Fetches the list of cards for the current user.
|
|
9
|
-
*
|
|
20
|
+
* If membershipId is provided, it will fetch the cards for the given membership.
|
|
21
|
+
* @param Object - An object with the membershipId property.
|
|
22
|
+
* @returns A promise that resolves to an array of cards.
|
|
23
|
+
* @throws \{AuthenticationError\} If the access token is invalid or missing.
|
|
24
|
+
* Ensure initialize has been called before using this function.
|
|
25
|
+
*/
|
|
26
|
+
export declare function getCards({ membershipId, }: {
|
|
27
|
+
membershipId?: string;
|
|
28
|
+
}): Promise<Card[]>;
|
|
29
|
+
/**
|
|
30
|
+
* Fetches a card by its id.
|
|
31
|
+
* @param Object - An object with the cardId property.
|
|
32
|
+
* @returns A promise that resolves to a card.
|
|
10
33
|
* @throws \{AuthenticationError\} If the access token is invalid or missing.
|
|
11
34
|
* Ensure initialize has been called before using this function.
|
|
12
35
|
*/
|
|
13
|
-
export declare function
|
|
36
|
+
export declare function getCard({ cardId }: {
|
|
37
|
+
cardId: string;
|
|
38
|
+
}): Promise<Card>;
|
|
14
39
|
/**
|
|
15
|
-
* Requests the creation of a card by showing the user the UI to perform
|
|
16
|
-
* It will show an element on the screen where users will be able to go through the
|
|
40
|
+
* Requests the creation of a card by showing the user the UI to perform MFA in the calling page.
|
|
41
|
+
* It will show an element on the screen where users will be able to go through the MFA
|
|
17
42
|
* authentication process and upon successful authentication, will perform the ordering operation.
|
|
18
|
-
* @param cardConfig - An object with the parameters to order the card.
|
|
43
|
+
* @param cardConfig - An object with the parameters to order the card. If it was not provided when
|
|
44
|
+
* calling the SDK's `initialize` function, an `operationSettings` object has to be passed too
|
|
45
|
+
* with the `uiParentElementId` property. This has to specify the ID of the DOM element where
|
|
46
|
+
* the UI for MFA will be displayed.
|
|
47
|
+
* @returns A promise that resolves to an object representing the ordered card.
|
|
19
48
|
* @throws InvalidParametersError If the cardId is not provided or if the cardId is not a string.
|
|
20
49
|
* @throws InvalidParametersError If the uiParentElementId or operationSettings are not provided.
|
|
21
50
|
* @example Ordering a physical card to be shipped to the org's business address
|
|
@@ -93,11 +122,15 @@ export declare function getCards(): Promise<Card[]>;
|
|
|
93
122
|
*/
|
|
94
123
|
export declare function orderCard(cardConfig: CardParams<CardOrderSettings>): Promise<Card>;
|
|
95
124
|
/**
|
|
96
|
-
* Unlocks a locked card by showing the user the UI to perform
|
|
97
|
-
* It will show an element on the screen where users will be able to go through the
|
|
125
|
+
* Unlocks a locked card by showing the user the UI to perform MFA in the calling page.
|
|
126
|
+
* It will show an element on the screen where users will be able to go through the MFA
|
|
98
127
|
* authentication process and upon successful authentication, will perform the unlock operation.
|
|
99
128
|
* @param cardConfig - An object with the parameters to unlock the card.
|
|
100
|
-
* It requires a cardSettings object with the cardId property
|
|
129
|
+
* It requires a `cardSettings` object with the `cardId` property. If it was not provided when
|
|
130
|
+
* calling the SDK's `initialize` function, an `operationSettings` object has to be passed too
|
|
131
|
+
* with the `uiParentElementId` property. This has to specify the ID of the DOM element where
|
|
132
|
+
* the UI for MFA will be displayed.
|
|
133
|
+
* @returns A promise that resolves to an object representing the unlocked card.
|
|
101
134
|
* @throws InvalidParametersError If the cardId is not provided or if the cardId is not a string.
|
|
102
135
|
* @throws InvalidParametersError If the uiParentElementId or operationSettings are not provided.
|
|
103
136
|
* @example
|
|
@@ -110,15 +143,19 @@ export declare function orderCard(cardConfig: CardParams<CardOrderSettings>): Pr
|
|
|
110
143
|
* uiParentElementId: 'dom-element-id',
|
|
111
144
|
* },
|
|
112
145
|
* };
|
|
113
|
-
* unlockCard(cardConfig);
|
|
146
|
+
* const unlockedCard = await unlockCard(cardConfig);
|
|
114
147
|
* ```
|
|
115
148
|
*/
|
|
116
149
|
export declare function unlockCard(cardConfig: CardParams<UnlockCardSettings>): Promise<Card>;
|
|
117
150
|
/**
|
|
118
151
|
* Displays the UI in the calling page which allows the user to see card details.
|
|
119
152
|
* @param cardConfig - An object with the parameters to display the card.
|
|
120
|
-
* It requires a cardSettings object with the cardId property
|
|
121
|
-
*
|
|
153
|
+
* It requires a `cardSettings` object with the `cardId` property. If it was not provided when
|
|
154
|
+
* calling the SDK's `initialize` function, an `operationSettings` object has to be passed too
|
|
155
|
+
* with the `uiParentElementId` property. This has to specify the ID of the DOM element where
|
|
156
|
+
* the UI for MFA will be displayed.
|
|
157
|
+
* @returns A promise that resolves to an object with a `destroyEmbedUI` function. When calling
|
|
158
|
+
* this function, the UI will be removed from the DOM.
|
|
122
159
|
* @throws InvalidParametersError If the cardId is not provided or if the cardId is not a string.
|
|
123
160
|
* @throws InvalidParametersError If the uiParentElementId or operationSettings are not provided.
|
|
124
161
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cards.d.ts","sourceRoot":"","sources":["../../src/cards/cards.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cards.d.ts","sourceRoot":"","sources":["../../src/cards/cards.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,IAAI,EAET,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACxB,MAAM,eAAe,CAAC;AAYvB,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,2CAA2C,CAAC;AAGnD;;;;;;GAMG;AACH,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B;;;OAGG;IACH,YAAY,EAAE,CAAC,CAAC;IAChB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACvC;AAED;;;;;;;GAOG;AACH,wBAAsB,QAAQ,CAAC,EAC7B,YAAY,GACb,EAAE;IACD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAWlB;AAED;;;;;;GAMG;AACH,wBAAsB,OAAO,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAW3E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmFG;AACH,wBAAsB,SAAS,CAC7B,UAAU,EAAE,UAAU,CAAC,iBAAiB,CAAC,GACxC,OAAO,CAAC,IAAI,CAAC,CA0Bf;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,UAAU,CAC9B,UAAU,EAAE,UAAU,CAAC,kBAAkB,CAAC,GACzC,OAAO,CAAC,IAAI,CAAC,CA0Bf;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,WAAW,CAC/B,UAAU,EAAE,UAAU,CAAC,mBAAmB,CAAC,GAC1C,OAAO,CAAC,uBAAuB,CAAC,CAsBlC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { getCards, orderCard, unlockCard, displayCard } from './cards';
|
|
1
|
+
import { getCards, getCard, orderCard, unlockCard, displayCard } from './cards';
|
|
2
2
|
declare const cards: {
|
|
3
3
|
getCards: typeof getCards;
|
|
4
|
+
getCard: typeof getCard;
|
|
4
5
|
orderCard: typeof orderCard;
|
|
5
6
|
unlockCard: typeof unlockCard;
|
|
6
7
|
displayCard: typeof displayCard;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cards.public-api.d.ts","sourceRoot":"","sources":["../../src/cards/cards.public-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"cards.public-api.d.ts","sourceRoot":"","sources":["../../src/cards/cards.public-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEhF,QAAA,MAAM,KAAK;;;;;;CAMV,CAAC;AAEF,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The possible statuses a card can be in.
|
|
3
|
+
*/
|
|
1
4
|
export declare enum CardStatus {
|
|
2
5
|
PENDING = "pending",
|
|
3
6
|
ONHOLD = "onhold",
|
|
@@ -14,6 +17,10 @@ export declare enum CardStatus {
|
|
|
14
17
|
SHIPPED_LOST = "shipped_lost",
|
|
15
18
|
ABUSIVE = "abusive"
|
|
16
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* The possible categories a card can be assigned to. These categories are used
|
|
22
|
+
* to allow or restrict the use of the card in certain types of transactions.
|
|
23
|
+
*/
|
|
17
24
|
export declare const CardCategories: {
|
|
18
25
|
TRANSPORT: string;
|
|
19
26
|
RESTAURANT_AND_BAR: string;
|
|
@@ -28,10 +35,18 @@ export declare const CardCategories: {
|
|
|
28
35
|
FINANCE: string;
|
|
29
36
|
};
|
|
30
37
|
type CardCategory = (typeof CardCategories)[keyof typeof CardCategories];
|
|
38
|
+
/**
|
|
39
|
+
* The possible visual designs a physical card can have. These designs are used
|
|
40
|
+
* to customize the appearance of the card.
|
|
41
|
+
*/
|
|
31
42
|
type CardDesign = 'standard.recycled.plastic.2023' | 'plus.black.2023' | 'plus.recycled.plastic.silver.2023' | 'plus.recycled.plastic.black.2023' | 'plus.recycled.plastic.lilac.2023' | 'metal.graphite.black.2019' | 'metal.mineral.gray.2024' | 'metal.sand.gold.2024' | 'virtual.default.2017' | 'flash.default.2021' | 'advertising.default.2023';
|
|
32
43
|
export declare enum VirtualCardLevel {
|
|
33
44
|
VIRTUAL = "virtual"
|
|
34
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* The possible levels of a physical card. These levels are used to determine
|
|
48
|
+
* the features and benefits associated with the card.
|
|
49
|
+
*/
|
|
35
50
|
export declare enum PhysicalCardLevel {
|
|
36
51
|
METAL = "metal",
|
|
37
52
|
PLUS = "plus",
|
|
@@ -39,6 +54,10 @@ export declare enum PhysicalCardLevel {
|
|
|
39
54
|
}
|
|
40
55
|
type CardType = 'debit' | 'prepaid';
|
|
41
56
|
type TypeOfPrint = 'embossed' | 'print' | null;
|
|
57
|
+
/**
|
|
58
|
+
* Object that contains a representation of a card. This object is returned from
|
|
59
|
+
* several functions, such as `getCards`, `getCard`, `orderCard` or `unlockCard`.
|
|
60
|
+
*/
|
|
42
61
|
export interface Card {
|
|
43
62
|
id: string;
|
|
44
63
|
nickname: string;
|
|
@@ -94,6 +113,10 @@ export interface Card {
|
|
|
94
113
|
discardOn: Date;
|
|
95
114
|
reordered: boolean;
|
|
96
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* Object that contains the desired settings of a virtual card to be ordered
|
|
118
|
+
* when calling `orderCard`.
|
|
119
|
+
*/
|
|
97
120
|
export interface VirtualCardOrderSettings {
|
|
98
121
|
monthlyLimit: number;
|
|
99
122
|
membershipId: string;
|
|
@@ -107,15 +130,44 @@ export interface VirtualCardOrderSettings {
|
|
|
107
130
|
activeDays?: number[];
|
|
108
131
|
categories?: CardCategory[];
|
|
109
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* Object containing the different fields of an address. This address is used
|
|
135
|
+
* when ordering a physical card and opting to get it sent to a specific location.
|
|
136
|
+
*/
|
|
110
137
|
export interface Address {
|
|
138
|
+
/**
|
|
139
|
+
* The recipient to whom the card will be sent.
|
|
140
|
+
*/
|
|
111
141
|
contactName: string;
|
|
142
|
+
/**
|
|
143
|
+
* The first line of the address to which to send the card.
|
|
144
|
+
*/
|
|
112
145
|
firstLine: string;
|
|
146
|
+
/**
|
|
147
|
+
* The second line of the address to which to send the card.
|
|
148
|
+
*/
|
|
113
149
|
secondLine: string;
|
|
150
|
+
/**
|
|
151
|
+
* The third line of the address to which to send the card.
|
|
152
|
+
*/
|
|
114
153
|
thirdLine: string;
|
|
154
|
+
/**
|
|
155
|
+
* The postal code of the address to which to send the card.
|
|
156
|
+
*/
|
|
115
157
|
zipCode: string;
|
|
158
|
+
/**
|
|
159
|
+
* The city of the address to which to send the card.
|
|
160
|
+
*/
|
|
116
161
|
city: string;
|
|
162
|
+
/**
|
|
163
|
+
* The country of the address to which to send the card.
|
|
164
|
+
*/
|
|
117
165
|
country: string;
|
|
118
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* Object that contains the desired settings of a physical card to be ordered
|
|
169
|
+
* when calling `orderCard`.
|
|
170
|
+
*/
|
|
119
171
|
export interface PhysicalCardOrderSettings extends Omit<VirtualCardOrderSettings, 'cardLevel'> {
|
|
120
172
|
shipToBusiness: boolean;
|
|
121
173
|
cardLevel: PhysicalCardLevel;
|
|
@@ -187,7 +239,14 @@ export interface CardDataObject {
|
|
|
187
239
|
discard_on: string;
|
|
188
240
|
reordered: boolean;
|
|
189
241
|
}
|
|
242
|
+
/**
|
|
243
|
+
* Object passed to `unlockCard` in which the function expects to find the
|
|
244
|
+
* relevant information to unlock a card.
|
|
245
|
+
*/
|
|
190
246
|
export interface UnlockCardSettings {
|
|
247
|
+
/**
|
|
248
|
+
* The ID of the card to unlock when calling `cards.unlockCard()`.
|
|
249
|
+
*/
|
|
191
250
|
cardId: string;
|
|
192
251
|
}
|
|
193
252
|
/**
|
|
@@ -210,15 +269,12 @@ export interface DisplayCardSettings {
|
|
|
210
269
|
cardId: string;
|
|
211
270
|
/**
|
|
212
271
|
* Whether to show the `Show PIN` button in the UI.
|
|
213
|
-
*
|
|
214
272
|
* If nothing is passed, defaults to `false`.
|
|
215
273
|
**/
|
|
216
274
|
allowPinReveal?: boolean;
|
|
217
275
|
/**
|
|
218
276
|
* Whether to show the `Block Card` button in the UI.
|
|
219
|
-
*
|
|
220
277
|
* If the card is already blocked, the button will be hidden even if the value is `true`.
|
|
221
|
-
*
|
|
222
278
|
* If nothing is passed, defaults to `false`.
|
|
223
279
|
**/
|
|
224
280
|
allowBlocking?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cards.types.d.ts","sourceRoot":"","sources":["../../src/cards/cards.types.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU;IACpB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,cAAc,mBAAmB;IACjC,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,WAAW,gBAAgB;IAC3B,OAAO,YAAY;IACnB,WAAW,gBAAgB;IAC3B,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,YAAY,iBAAiB;IAC7B,OAAO,YAAY;CACpB;AAGD,eAAO,MAAM,cAAc;;;;;;;;;;;;CAY1B,CAAC;AAEF,KAAK,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAEzE,KAAK,UAAU,GACX,gCAAgC,GAChC,iBAAiB,GACjB,mCAAmC,GACnC,kCAAkC,GAClC,kCAAkC,GAClC,2BAA2B,GAC3B,yBAAyB,GACzB,sBAAsB,GACtB,sBAAsB,GACtB,oBAAoB,GACpB,0BAA0B,CAAC;AAE/B,oBAAY,gBAAgB;IAC1B,OAAO,YAAY;CACpB;AAED,oBAAY,iBAAiB;IAC3B,KAAK,UAAU;IACf,IAAI,SAAS;IACb,QAAQ,aAAa;CACtB;AAED,KAAK,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;AAEpC,KAAK,WAAW,GAAG,U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CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,QAAQ,CAAC;IACpB,UAAU,EAAE,iBAAiB,CAAC;IAC9B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,YAAY,EAAE,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,mBAAmB,EAAE;QACnB,EAAE,EAAE,MAAM,CAAC;QACX,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,aAAa,EAAE,OAAO,CAAC;IACvB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,WAAW,EAAE,UAAU,CAAC;IACxB,aAAa,EAAE,WAAW,CAAC;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;IAYI;AACJ,MAAM,WAAW,mBAAmB;IAClC;;QAEI;IACJ,MAAM,EAAE,MAAM,CAAC;IACf;;;QAGI;IACJ,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;QAII;IACJ,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;IAGI;AACJ,MAAM,WAAW,uBAAuB;IACtC;;;QAGI;IACJ,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B"}
|
package/dist/cards/index.d.ts
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The cards namespace contains all the functions related to card operations.
|
|
3
|
+
* It can be accessed like this:
|
|
4
|
+
* ```ts
|
|
5
|
+
* import { cards } from '@qonto/embed-sdk/cards';
|
|
6
|
+
* ```
|
|
7
|
+
*
|
|
8
|
+
* Then, the cards object contains the functions to perform card operations:
|
|
9
|
+
* ```ts
|
|
10
|
+
* await cards.getCards();
|
|
11
|
+
* await cards.orderCard(/* params here *\/);
|
|
12
|
+
* await cards.unlockCard(/* params here *\/);
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
1
15
|
export declare const cards: {
|
|
2
16
|
getCards: typeof import("./cards").getCards;
|
|
17
|
+
getCard: typeof import("./cards").getCard;
|
|
3
18
|
orderCard: typeof import("./cards").orderCard;
|
|
4
19
|
unlockCard: typeof import("./cards").unlockCard;
|
|
5
20
|
displayCard: typeof import("./cards").displayCard;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cards/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cards/index.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,KAAK;;;;;;CAAuB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.public-api.d.ts","sourceRoot":"","sources":["../../src/common/common.public-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"common.public-api.d.ts","sourceRoot":"","sources":["../../src/common/common.public-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AAEzC,QAAA,MAAM,MAAM;;;;CAAoC,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* List of possible events the iframe can emit.
|
|
3
|
+
*/
|
|
1
4
|
export declare const IFRAME_EVENTS: {
|
|
5
|
+
/**
|
|
6
|
+
* Emitted when the iframe is ready to be used.
|
|
7
|
+
*/
|
|
2
8
|
READY: string;
|
|
3
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* List of possible actions that can be performed in the iframe.
|
|
12
|
+
*/
|
|
4
13
|
export declare const ACTIONS: {
|
|
5
14
|
CARD_SEE: string;
|
|
6
15
|
CARD_SEE_DETAILS: string;
|
|
@@ -10,11 +19,17 @@ export declare const ACTIONS: {
|
|
|
10
19
|
CARD_SET_PIN: string;
|
|
11
20
|
TRANSFERS_CREATE: string;
|
|
12
21
|
};
|
|
22
|
+
/**
|
|
23
|
+
* List of possible environments the SDK can be used in.
|
|
24
|
+
*/
|
|
13
25
|
export declare const ENVIRONMENTS: {
|
|
14
26
|
PRODUCTION: string;
|
|
15
27
|
STAGING: string;
|
|
16
28
|
LOCAL: string;
|
|
17
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* List of possible branches the SDK can be used in non-production environments.
|
|
32
|
+
*/
|
|
18
33
|
export declare const BRANCHES: {
|
|
19
34
|
MASTER: string;
|
|
20
35
|
SANDBOX: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/common/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/common/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,aAAa;IACxB;;OAEG;;CAEJ,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO;;;;;;;;CAQnB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY;;;;CAIxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;CAIpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment-manager.d.ts","sourceRoot":"","sources":["../../../src/common/environment/environment-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ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hD;;;OAGG;IACI,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAItC;;;OAGG;IACI,SAAS,IAAI,MAAM,GAAG,SAAS;IAItC;;OAEG;IACI,KAAK,IAAI,IAAI;IAKb,kBAAkB,IAAI,eAAe;CAa7C;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,oBAAmC,CAAC"}
|
|
@@ -5,27 +5,51 @@ import type { InitializeParams } from './initialize.types';
|
|
|
5
5
|
* access token.
|
|
6
6
|
* @param initializeParams - An object with the parameters to initialize the SDK.
|
|
7
7
|
* The only required parameter is the `accessToken`.
|
|
8
|
-
* - accessToken
|
|
8
|
+
* - `accessToken`: The access token to authenticate the user. This has to be previously
|
|
9
9
|
* generated using the OAuth authentication flow.
|
|
10
|
-
* environment
|
|
11
|
-
* the SDK will default to
|
|
12
|
-
* staging.
|
|
13
|
-
* branch
|
|
14
|
-
* environment is set to 'staging'. The possible values are BRANCHES.MASTER
|
|
15
|
-
* BRANCHES.SANDBOX and BRANCHES.QA
|
|
16
|
-
*
|
|
10
|
+
* - `environment`: Optional parameter to set the SDK's environment. If not provided,
|
|
11
|
+
* the SDK will default to `ENVIRONMENTS.PRODUCTION`. Use `ENVIRONMENTS.STAGING` to set
|
|
12
|
+
* the SDK to staging.
|
|
13
|
+
* - `branch`: Optional parameter to set the SDK's branch. This is only relevant when the
|
|
14
|
+
* `environment` is set to 'staging'. The possible values are `BRANCHES.MASTER`,
|
|
15
|
+
* `BRANCHES.SANDBOX` and `BRANCHES.QA`. If not provided, the SDK will default to
|
|
16
|
+
* `BRANCHES.MASTER`.
|
|
17
|
+
* - `operationSettings`: Optional settings to configure the SDK's operations that will
|
|
17
18
|
* be performed after the initialization. This can be also provided when calling the
|
|
18
19
|
* operation functions themselves.
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
20
|
+
* - `uiParentElementId`: The id of the DOM element where the SDK will be rendered.
|
|
21
|
+
* - `mfaPreference`: The MFA preference to use for the operations. This can be either
|
|
22
|
+
* `MFA_METHODS.PASSKEY`, `MFA_METHODS.PAIRED_DEVICE` or `MFA_METHODS.SMS_OTP`. If not
|
|
23
|
+
* provided, the SDK will default to `MFA_METHODS.PASSKEY`.
|
|
23
24
|
|
|
24
|
-
* @throws InvalidParametersError If the access token is not provided
|
|
25
|
-
*
|
|
25
|
+
* @throws InvalidParametersError If the access token is not provided or the specified
|
|
26
|
+
* parameters don't comply with the expected format.
|
|
27
|
+
*
|
|
28
|
+
* @example Simple initialization with an access token:
|
|
29
|
+
* ```ts
|
|
30
|
+
* // The simplest way to initialize the SDK is to provide an access token.
|
|
31
|
+
* import { initialize } from '@qonto/embed-sdk/common';
|
|
32
|
+
*
|
|
33
|
+
* const initializeParams = {
|
|
34
|
+
* accessToken: 'an-access-token',
|
|
35
|
+
* };
|
|
36
|
+
*
|
|
37
|
+
* initialize(initializeParams);
|
|
26
38
|
* ```
|
|
39
|
+
*
|
|
40
|
+
* @example Configuring the element where the SDK will render the Multifactor Authentication UI.
|
|
41
|
+
* ```ts
|
|
42
|
+
* // Initializes the SDK to work in the staging environment, concretely in the sandbox branch. Also, it sets the
|
|
43
|
+
* // ID of the DOM element where the SDK will render the multi-factor authentication (MFA) UI if a sensitive
|
|
44
|
+
* // operation is requested after SDK initialization.
|
|
45
|
+
* import { initialize, constants } from '@qonto/embed-sdk/common';
|
|
46
|
+
*
|
|
27
47
|
* const initializeParams = {
|
|
28
48
|
* accessToken: 'an-access-token',
|
|
49
|
+
* environment: constants.ENVIRONMENTS.STAGING,
|
|
50
|
+
* operationSettings: {
|
|
51
|
+
* uiParentElementId: 'mfa-container',
|
|
52
|
+
* },
|
|
29
53
|
* };
|
|
30
54
|
* initialize(initializeParams);
|
|
31
55
|
* ```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../../../src/common/initialize/initialize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAK3D
|
|
1
|
+
{"version":3,"file":"initialize.d.ts","sourceRoot":"","sources":["../../../src/common/initialize/initialize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAK3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,wBAAgB,UAAU,CAAC,gBAAgB,EAAE,gBAAgB,QAc5D;AAED;;;;GAIG;AACH,wBAAgB,MAAM,SAErB"}
|
|
@@ -1,8 +1,27 @@
|
|
|
1
1
|
import type { OperationSettings } from '@validation/operation-settings-validation';
|
|
2
|
+
/**
|
|
3
|
+
* An object with the parameters to initialize the SDK. The only required parameter
|
|
4
|
+
* is the `accessToken`.
|
|
5
|
+
*/
|
|
2
6
|
export interface InitializeParams {
|
|
7
|
+
/**
|
|
8
|
+
* The access token to authenticate the user. This has to be previously
|
|
9
|
+
* generated using the OAuth authentication flow.
|
|
10
|
+
*/
|
|
3
11
|
accessToken: string;
|
|
4
12
|
locale?: 'en' | 'fr' | 'es' | 'de' | 'it' | 'pt';
|
|
13
|
+
/**
|
|
14
|
+
* Optional parameter to set the SDK's environment. If not provided,
|
|
15
|
+
* the SDK will default to `'production'`. Use `ENVIRONMENTS.STAGING` to set
|
|
16
|
+
* the SDK to staging.
|
|
17
|
+
*/
|
|
5
18
|
environment?: 'production' | 'staging' | 'local';
|
|
19
|
+
/**
|
|
20
|
+
* Optional parameter to set the SDK's branch. This is only relevant when the
|
|
21
|
+
* environment is set to `'staging'`. The possible values are `BRANCHES.MASTER`,
|
|
22
|
+
* `BRANCHES.SANDBOX` and `BRANCHES.QA`. If not provided, the SDK will default
|
|
23
|
+
* to `'MASTER'`.
|
|
24
|
+
*/
|
|
6
25
|
branch?: 'master' | 'sandbox' | 'qa';
|
|
7
26
|
operationSettings?: OperationSettings;
|
|
8
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.types.d.ts","sourceRoot":"","sources":["../../../src/common/initialize/initialize.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAEnF,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACjD,WAAW,CAAC,EAAE,YAAY,GAAG,SAAS,GAAG,OAAO,CAAC;IACjD,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC;IACrC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACvC"}
|
|
1
|
+
{"version":3,"file":"initialize.types.d.ts","sourceRoot":"","sources":["../../../src/common/initialize/initialize.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAEnF;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACjD;;;;OAIG;IACH,WAAW,CAAC,EAAE,YAAY,GAAG,SAAS,GAAG,OAAO,CAAC;IACjD;;;;;OAKG;IACH,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC;IACrC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACvC"}
|
package/dist/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).QontoEmbed={})}(this,(function(e){"use strict";class t{constructor(){this.accessToken=null}static getInstance(){return t.instance||(t.instance=new t),t.instance}setAccessToken(e){this.accessToken=e}getAccessToken(){return this.accessToken}hasAccessToken(){return null!==this.accessToken&&""!==this.accessToken}clearAccessToken(){this.accessToken=null}}const n=t.getInstance();class i extends Error{constructor(){super(),this.stack=""}toString(){return`${this.name}: ${this.message}`}}class a extends i{constructor(){super(),this.name="AuthenticationError",this.message="Authentication failed due to missing or invalid access token.\nEnsure you have called the initialize function with a valid access token."}}function r(){if(!n.hasAccessToken())throw new a;return n.getAccessToken()}class s extends i{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")}`}}class o{constructor(){this.uiParentElementId=null,this.mfaPreference=null}static getInstance(){return o.instance||(o.instance=new o),o.instance}setSettings(e){e.uiParentElementId&&(this.uiParentElementId=e.uiParentElementId),e.mfaPreference&&(this.mfaPreference=e.mfaPreference)}getUIParentElementId(){return this.uiParentElementId}getMFAPreference(){return this.mfaPreference}clearSettings(){this.uiParentElementId=null,this.mfaPreference=null}}const c=o.getInstance();function d(e){const t=e?.uiParentElementId||c.getUIParentElementId();if(!t)throw new s("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.");const n=e?.mfaPreference||c.getMFAPreference();if(n&&!["passkey","paired-device","sms-otp"].includes(n))throw new s("operationSettings.mfaPreference must be one of passkey, paired-device or sms-otp.");return{uiParentElementId:t,mfaPreference:n}}function m(e){if(!e?.accessToken)throw new s("Access token is required when calling initialize()");return e?.operationSettings&&d(e.operationSettings),function(e){if(e.environment){if(!["production","staging","local"].includes(e.environment))throw new s('If provided, environment must be either "production" or "staging"\nYou can "import constants from @qonto/embed-sdk/common" and then use "constants.environment.PRODUCTION" or "constants.environment.STAGING"');if(e.branch&&!["master","sandbox","qa"].includes(e.environment))throw new s('If provided, branch must be either "master", "sandbox" or "qa"\nYou can "import constants from @qonto/embed-sdk/common" and then use "constants.branch.MASTER" or "constants.environment.SANDBOX" and so on')}}(e),e}const l={READY:"qonto.ready"},u={CARD_SEE:"card.see",CARD_SEE_DETAILS:"card.see-details",CARD_ORDER:"card.order",CARD_UNLOCK:"card.unlock",CARD_SHOW_PIN:"card.show.pin",CARD_SET_PIN:"card.set.pin",TRANSFERS_CREATE:"transfers.create"},h={PRODUCTION:"production",STAGING:"staging",LOCAL:"local"},p={MASTER:"master",SANDBOX:"sandbox",QA:"qa"};var f=Object.freeze({__proto__:null,ACTIONS:u,BRANCHES:p,ENVIRONMENTS:h,IFRAME_EVENTS:l});const y="https://embed.qonto.com",_="https://embed-js{branch}.staging.qonto.co",g="https://embed.dev.qonto.co",I={[h.PRODUCTION]:{IFRAME_BASE_URL:y,IFRAME_URL:`${y}/connect`,THIRD_PARTY_API_URL:"https://thirdparty.qonto.com"},[h.STAGING]:{IFRAME_BASE_URL:_,IFRAME_URL:`${_}/connect`,THIRD_PARTY_API_URL:"https://thirdparty{branch}.staging.qonto.co"},[h.LOCAL]:{IFRAME_BASE_URL:g,IFRAME_URL:`${g}/connect`,THIRD_PARTY_API_URL:"https://thirdparty{branch}.staging.qonto.co"}};class L{constructor(){this.environment=h.PRODUCTION,this.branch=p.MASTER}static getInstance(){return L.instance||(L.instance=new L),L.instance}setEnvironment(e){this.environment=e}getEnvironment(){return this.environment}setBranch(e){this.branch=e}getBranch(){return this.branch}clear(){this.environment=h.PRODUCTION,this.branch=p.MASTER}getEnvironmentUrls(){if(this.environment===h.PRODUCTION)return I.production;{const e=I[this.environment];return Object.entries(e).reduce(((e,[t,n])=>({...e,[t]:n.replace("{branch}",`-${this.branch}`)})),{})}}}const E=L.getInstance();const A={initialize:function(e){const{accessToken:t,operationSettings:i,environment:a,branch:r}=m(e);n.setAccessToken(t),i&&c.setSettings(i),a&&(E.setEnvironment(a),r&&E.setBranch(r))},logout:function(){n.clearAccessToken()},constants:f},{initialize:w,logout:v,constants:D}=A;class b extends i{constructor(e){super();const t=Array.isArray(e)?e.join("\n"):e;this.name="EmbedApiError",this.message=`The call to the Embed API failed with the following errors:\n${t}`}}async function T(e,t){const n={method:"GET",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json","Accept-Language":"en"}},i=E.getEnvironmentUrls().THIRD_PARTY_API_URL,a=await fetch(`${i}/v2/cards/${e.cardId}/data_view`,n),r=await a.json();if(r.errors)throw new b(r.errors.map((e=>`${e.code}: ${e.detail}`)));return function(e,t){const n=new URL(e);return"boolean"==typeof t.allowPinReveal&&n.searchParams.set("canSeePin",t.allowPinReveal?"true":"false"),"boolean"==typeof t.allowBlocking&&n.searchParams.set("canBlock",t.allowBlocking?"true":"false"),n.toString()}(r.iframe_url,e)}var P;!function(e){e.PENDING="pending",e.ONHOLD="onhold",e.ORDER_CANCELED="order_canceled",e.LIVE="live",e.PAUSED="paused",e.STOLEN="stolen",e.LOST="lost",e.PIN_BLOCKED="pin_blocked",e.DELETED="deleted",e.PRE_EXPIRED="pre_expired",e.EXPIRED="expired",e.DISCARDED="discarded",e.SHIPPED_LOST="shipped_lost",e.ABUSIVE="abusive"}(P||(P={}));const R={TRANSPORT:"transport",RESTAURANT_AND_BAR:"restaurant_and_bar",FOOD_AND_GROCERY:"food_and_grocery",IT_AND_ELECTRONICS:"it_and_electronics",UTILITY:"utility",TAX:"tax",LEGAL_AND_ACCOUNTING:"legal_and_accounting",ATM:"atm",OFFICE_SUPPLY:"office_supply",HARDWARE_AND_EQUIPMENT:"hardware_and_equipment",FINANCE:"finance"};var O,S;function U(e,t){const n=t.filter((t=>t.requiredIfPresent?!e[t.name]&&e[t.requiredIfPresent]:!e[t.name])).map((e=>e.name));if(n.length>0)throw new s(n.map((e=>`Missing required parameter: ${e}`)))}function k(e){return Object.entries(e).filter((([,e])=>void 0!==e)).filter((([,e])=>"string"!=typeof e)).map((([e])=>`${e} must be a string`))}function N(e){return Object.entries(e).filter((([,e])=>void 0!==e&&!1!==e&&!0!==e)).map((([e])=>`${e} must be a boolean`))}function C(e){return Object.entries(e).filter((([,e])=>void 0!==e)).filter((([,e])=>"number"!=typeof e)).map((([e])=>`${e} must be a number`))}!function(e){e.VIRTUAL="virtual"}(O||(O={})),function(e){e.METAL="metal",e.PLUS="plus",e.STANDARD="standard"}(S||(S={}));const M=[{name:"organizationId"},{name:"membershipId"},{name:"bankAccountId"},{name:"monthlyLimit"},{name:"cardLevel"}],$=[...M,{name:"atmDailyLimit",requiredIfPresent:"hasAtmDailyLimit"},{name:"hasAtmDailyLimit",requiredIfPresent:"hasAtmOption"},{name:"atmMonthlyLimit",requiredIfPresent:"hasAtmOption"},{name:"shipToBusiness"},{name:"cardLevel"}];function z(e){if(!e)throw new s("cardSettings parameter is required for the called function");return"virtual"===e.cardLevel?function(e){return U(e,M),function(e){const{membershipId:t,organizationId:n,bankAccountId:i,hasDailyLimit:a,hasTransactionLimit:r,monthlyLimit:o,dailyLimit:c,transactionLimit:d,activeDays:m,categories:l,cardLevel:u}=e,h=function(e){return"virtual"!==e?['cardLevel must be "virtual"']:[]}(u),p=k({membershipId:t,organizationId:n,bankAccountId:i}),f=N({hasDailyLimit:a,hasTransactionLimit:r}),y=C({monthlyLimit:o,dailyLimit:c,transactionLimit:d}),_=B(m),g=q(l),I=[...h,...p,...f,...y,..._,...g];if(I.length>0)throw new s(I)}(e),e}(e):function(e){U(e,$),function(e){const{membershipId:t,organizationId:n,bankAccountId:i,hasDailyLimit:a,hasTransactionLimit:r,monthlyLimit:o,dailyLimit:c,transactionLimit:d,activeDays:m,categories:l,cardLevel:u,hasNfcOption:h,hasForeignPaymentOption:p,hasOnlinePaymentOption:f,shipToBusiness:y,hasAtmOption:_,hasAtmDailyLimit:g,atmDailyLimit:I,atmMonthlyLimit:L,address:E,cardDesign:A,typeOfPrint:w}=e,v=function(e){return Object.values(S).includes(e)?[]:['cardLevel must be one of "standard", "plus", "metal"']}(u),D=function(e){const t=null!=e&&"string"!=typeof e,n=!["print","embossed",void 0,null].includes(e);return t||n?['typeOfPrint must be one of "print", "embossed" or null']:[]}(w),b=k({membershipId:t,organizationId:n,bankAccountId:i}),T=N({hasDailyLimit:a,hasTransactionLimit:r,hasAtmOption:_,hasNfcOption:h,hasForeignPaymentOption:p,hasOnlinePaymentOption:f,hasAtmDailyLimit:g,shipToBusiness:y}),P=C({monthlyLimit:o,dailyLimit:c,transactionLimit:d,atmDailyLimit:I,atmMonthlyLimit:L}),R=B(m),O=q(l),U=function(e){return["undefined","string"].includes(typeof e)?[]:["cardDesign must be a string"]}(A),M=function(e){return!e||e.contactName&&e.firstLine&&e.zipCode&&e.city&&e.country?[]:["address must contain at least contactName, firstLine, zipCode, city and country properties"]}(E),$=[...v,...b,...T,...P,...R,...O,...D,...U,...M];if($.length>0)throw new s($)}(e)}(e)}function B(e){const t=!Array.isArray(e)||!e.every((e=>Number.isInteger(e)&&e>0&&e<8));return void 0!==e&&t?["activeDays must be an array of integers between 1 and 7"]:[]}function q(e){const t=!Array.isArray(e)||e.some((e=>"string"!=typeof e));return void 0!==e&&t?["categories must be an array of strings"]:[]}class x extends i{constructor(e){super(),this.name="EmbedOperationError",this.message=e}}class j{constructor(e){this.options=e,this.iframe=null,this.parentElement=null,this.messageListeners=new Map,this.defaultTimeout=3e4;const t=new URL(e.iframeUrl);this.targetOrigin=`${t.protocol}//${t.host}`}async initialize(){if(this.iframe)return this;if(this.parentElement=document.getElementById(this.options.parentElementId),!this.parentElement)throw new x(`Could not install the authentication UI because the parent element with id ${this.options.parentElementId} was not found.\nPlease make sure to pass a valid parentElementId when calling the method.`);return new Promise(((e,t)=>{this.iframe=document.createElement("iframe"),this.iframe.src=this.options.iframeUrl,this.iframe.style.width="100%",this.iframe.style.height="100%",this.iframe.style.border="none";const n=this.options.timeout||this.defaultTimeout,i=setTimeout((()=>{window.removeEventListener("message",a),t(new x(`Could not install the authentication UI because the timeout of ${n}ms was reached.\nPlease make sure the application can reach the Internet.`))}),n),a=t=>{t.data.eventId===l.READY&&(clearTimeout(i),window.removeEventListener("message",a),e(this))};window.addEventListener("message",a),this.parentElement?.appendChild(this.iframe)}))}postMessage(e){return this.iframe&&this.iframe.contentWindow?new Promise(((t,n)=>{const i=a=>{if(a.data?.actionId===e.actionId){if("error"===a.data.status)return this.removeMessageListener(e.actionId,i),n(new x(`An error occurred when performing the action ${e.actionId}.\n${JSON.stringify(a.data.payload)}`));this.removeMessageListener(e.actionId,i),t(a.data.payload)}};this.addMessageListener(e.actionId,i),this.iframe?.contentWindow?.postMessage(e,this.targetOrigin)})):Promise.reject(new x("Attempted to perform an Embed operation without having the authentication UI initialized."))}addMessageListener(e,t){this.messageListeners.has(e)||this.messageListeners.set(e,[]);this.messageListeners.get(e).push(t),window.addEventListener("message",t)}removeMessageListener(e,t){const n=this.messageListeners.get(e);if(n){const e=n.indexOf(t);-1!==e&&(n.splice(e,1),window.removeEventListener("message",t))}}destroy(){this.messageListeners.forEach((e=>{e.forEach((e=>{window.removeEventListener("message",e)}))})),this.messageListeners.clear(),this.iframe&&this.parentElement&&(this.parentElement.removeChild(this.iframe),this.iframe=null)}}function F({accessToken:e,language:t,debugMode:n}){const i=n||!1,a=t||"en";return`${E.getEnvironmentUrls().IFRAME_URL}?debug=${i}&lang=${encodeURIComponent(a)}#access_token=${encodeURIComponent(e)}`}function Y({parentElementId:e,iframeUrl:t}){return new j({parentElementId:e,iframeUrl:t}).initialize()}const G=[];for(let e=0;e<256;++e)G.push((e+256).toString(16).slice(1));let H;const V=new Uint8Array(16);var K={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function X(e,t,n){if(K.randomUUID&&!e)return K.randomUUID();const i=(e=e||{}).random??e.rng?.()??function(){if(!H){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");H=crypto.getRandomValues.bind(crypto)}return H(V)}();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(G[e[t+0]]+G[e[t+1]]+G[e[t+2]]+G[e[t+3]]+"-"+G[e[t+4]]+G[e[t+5]]+"-"+G[e[t+6]]+G[e[t+7]]+"-"+G[e[t+8]]+G[e[t+9]]+"-"+G[e[t+10]]+G[e[t+11]]+G[e[t+12]]+G[e[t+13]]+G[e[t+14]]+G[e[t+15]]).toLowerCase()}(i)}function W(e){return"virtual"===e.cardLevel?function(e){const t=J(e.categories);return{actionId:u.CARD_ORDER,actionData:{idempotencyKey:X(),body:{card:{payment_monthly_limit:e.monthlyLimit,payment_daily_limit:e.dailyLimit,payment_daily_limit_option:e.hasDailyLimit,payment_transaction_limit:e.transactionLimit,payment_transaction_limit_option:e.hasTransactionLimit,active_days:e.activeDays||[],holder_id:e.membershipId,organization_id:e.organizationId,bank_account_id:e.bankAccountId,categories:t,card_level:e.cardLevel}}}}}(e):function(e){const t=J(e.categories);return{actionId:u.CARD_ORDER,actionData:{idempotencyKey:X(),body:{card:{payment_monthly_limit:e.monthlyLimit,payment_daily_limit:e.dailyLimit,payment_daily_limit_option:e.hasDailyLimit,payment_transaction_limit:e.transactionLimit,payment_transaction_limit_option:e.hasTransactionLimit,active_days:e.activeDays||[],holder_id:e.membershipId,organization_id:e.organizationId,bank_account_id:e.bankAccountId,categories:t,card_level:e.cardLevel,card_design:e.cardDesign,..."plus"===e.cardLevel&&{type_of_print:e.typeOfPrint},ship_to_business_address:e.shipToBusiness,atm_option:e.hasAtmOption,nfc_option:e.hasNfcOption,foreign_option:e.hasForeignPaymentOption,online_option:e.hasOnlinePaymentOption,atm_daily_limit:e.atmDailyLimit,atm_monthly_limit:e.atmMonthlyLimit,...!e.shipToBusiness&&{address:{contact_name:e.address?.contactName,first_line:e.address?.firstLine,second_line:e.address?.secondLine,third_line:e.address?.thirdLine,zipcode:e.address?.zipCode,city:e.address?.city,country:e.address?.country}}}}}}}(e)}function Q(e){return{id:e.id,nickname:e.nickname,embossedName:e.embossed_name,status:e.status,maskPan:e.mask_pan,expMonth:parseInt(e.exp_month,10),expYear:parseInt(e.exp_year,10),lastActivityAt:new Date(e.last_activity_at),lastDigits:e.last_digits,shipToBusiness:e.ship_to_business,atmOption:e.atm_option,atmDailyLimitOption:e.atm_daily_limit_option,nfcOption:e.nfc_option,onlineOption:e.online_option,foreignOption:e.foreign_option,atmMonthlyLimit:e.atm_monthly_limit,atmMonthlySpent:e.atm_monthly_spent,atmDailyLimit:e.atm_daily_limit,atmDailySpent:e.atm_daily_spent,paymentMonthlyLimit:e.payment_monthly_limit,paymentMonthlySpent:e.payment_monthly_spent,paymentDailyLimit:e.payment_daily_limit,paymentDailySpent:e.payment_daily_spent,paymentDailyLimitOption:e.payment_daily_limit_option,paymentTransactionLimit:e.payment_transaction_limit,paymentTransactionLimitOption:e.payment_transaction_limit_option,activeDays:e.active_days,holderId:e.holder_id,bankAccountId:e.bank_account_id,organizationId:e.organization_id,updatedAt:new Date(e.updated_at),createdAt:new Date(e.created_at),shippedAt:new Date(e.shipped_at),cardType:e.card_type,cardLevel:e.card_level,paymentLifespanLimit:e.payment_lifespan_limit,paymentLifespanSpent:e.payment_lifespan_spent,preExpiresAt:new Date(e.pre_expires_at),categories:e.categories,renewed:e.renewed,renewal:e.renewal,...e.parent_card_summary&&{parentCardSummary:{id:e.parent_card_summary.id,lastDigits:e.parent_card_summary.last_digits}},hadOperation:e.had_operation,hadPinOperation:e.had_pin_operation,cardDesign:e.card_design,typeOfPrint:e.type_of_print,upsold:e.upsold,upsell:e.upsell,discardOn:new Date(e.discard_on),reordered:e.reordered}}function J(e){const t=Object.values(R);return(e||[]).filter((e=>t.includes(e)))}const Z={getCards:async function(){try{const e=r();return(await async function({accessToken:e}){const t={method:"GET",headers:{Authorization:`Bearer ${e}`}},n=E.getEnvironmentUrls().THIRD_PARTY_API_URL,i=await fetch(`${n}/v2/cards`,t),a=await i.json();if(a.errors)throw new b(a.errors.map((e=>`${e.code}: ${e.detail}`)));return a.cards}({accessToken:e})).map((e=>Q(e)))}catch(e){return Promise.reject(e)}},orderCard:async function(e){try{const t=r(),{uiParentElementId:n}=d(e.operationSettings);z(e.cardSettings);const i=F({accessToken:t}),a=await Y({iframeUrl:i,parentElementId:n}),s=W(e.cardSettings),o=await a.postMessage(s);return a.destroy(),Q(o)}catch(e){return Promise.reject(e)}},unlockCard:async function(e){try{const t=r(),{uiParentElementId:n}=d(e.operationSettings);!function(e){if(!e)throw new s("cardSettings parameter is required for the called function");if(!e.cardId)throw new s("cardId is required for the called function");const t=k({cardId:e.cardId});if(t.length>0)throw new s(t)}(e.cardSettings);const i=F({accessToken:t}),a=await Y({iframeUrl:i,parentElementId:n}),o=function(e){return{actionId:u.CARD_UNLOCK,actionData:{cardId:e.cardSettings.cardId}}}(e),c=await a.postMessage(o);return a.destroy(),Q(c)}catch(e){return Promise.reject(e)}},displayCard:async function(e){try{const t=r(),{uiParentElementId:n}=d(e.operationSettings);!function(e){if(!e)throw new s("cardSettings parameter is required for the called function");if(!e.cardId)throw new s("cardId is required for the called function");const t=k({cardId:e.cardId});if(t.length>0)throw new s(t);let n={};void 0!==e.allowPinReveal&&(n={allowPinReveal:e.allowPinReveal}),void 0!==e.allowBlocking&&(n={...n,allowBlocking:e.allowBlocking});const i=N(n);if(i.length>0)throw new s(i)}(e.cardSettings);const i=await T(e.cardSettings,t),a=await Y({iframeUrl:i,parentElementId:n});return{destroyEmbedUI:()=>{a.destroy()}}}catch(e){return Promise.reject(e)}}};e.cards=Z,e.constants=D,e.initialize=w,e.logout=v}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).QontoEmbed={})}(this,(function(e){"use strict";class t{constructor(){this.accessToken=null}static getInstance(){return t.instance||(t.instance=new t),t.instance}setAccessToken(e){this.accessToken=e}getAccessToken(){return this.accessToken}hasAccessToken(){return null!==this.accessToken&&""!==this.accessToken}clearAccessToken(){this.accessToken=null}}const n=t.getInstance();class i extends Error{constructor(){super(),this.stack=""}toString(){return`${this.name}: ${this.message}`}}class a extends i{constructor(){super(),this.name="AuthenticationError",this.message="Authentication failed due to missing or invalid access token.\nEnsure you have called the initialize function with a valid access token."}}function r(){if(!n.hasAccessToken())throw new a;return n.getAccessToken()}class s extends i{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")}`}}class o{constructor(){this.uiParentElementId=null,this.mfaPreference=null}static getInstance(){return o.instance||(o.instance=new o),o.instance}setSettings(e){e.uiParentElementId&&(this.uiParentElementId=e.uiParentElementId),e.mfaPreference&&(this.mfaPreference=e.mfaPreference)}getUIParentElementId(){return this.uiParentElementId}getMFAPreference(){return this.mfaPreference}clearSettings(){this.uiParentElementId=null,this.mfaPreference=null}}const c=o.getInstance();function d(e){const t=e?.uiParentElementId||c.getUIParentElementId();if(!t)throw new s("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.");const n=e?.mfaPreference||c.getMFAPreference();if(n&&!["passkey","paired-device","sms-otp"].includes(n))throw new s("operationSettings.mfaPreference must be one of passkey, paired-device or sms-otp.");return{uiParentElementId:t,mfaPreference:n}}function m(e){if(!e?.accessToken)throw new s("Access token is required when calling initialize()");return e?.operationSettings&&d(e.operationSettings),function(e){if(e.environment){if(!["production","staging","local"].includes(e.environment))throw new s('If provided, environment must be either "production" or "staging"\nYou can "import constants from @qonto/embed-sdk/common" and then use "constants.environment.PRODUCTION" or "constants.environment.STAGING"');if(e.branch&&!["master","sandbox","qa"].includes(e.branch))throw new s('If provided, branch must be either "master", "sandbox" or "qa"\nYou can "import constants from @qonto/embed-sdk/common" and then use "constants.branch.MASTER" or "constants.environment.SANDBOX" and so on')}}(e),e}const l={READY:"qonto.ready"},u={CARD_SEE:"card.see",CARD_SEE_DETAILS:"card.see-details",CARD_ORDER:"card.order",CARD_UNLOCK:"card.unlock",CARD_SHOW_PIN:"card.show.pin",CARD_SET_PIN:"card.set.pin",TRANSFERS_CREATE:"transfers.create"},h={PRODUCTION:"production",STAGING:"staging",LOCAL:"local"},p={MASTER:"master",SANDBOX:"sandbox",QA:"qa"};var f=Object.freeze({__proto__:null,ACTIONS:u,BRANCHES:p,ENVIRONMENTS:h,IFRAME_EVENTS:l});const y="https://embed.qonto.com",_="https://embed-js{branch}.staging.qonto.co",g="https://embed.dev.qonto.co",I={[h.PRODUCTION]:{IFRAME_BASE_URL:y,IFRAME_URL:`${y}/connect`,THIRD_PARTY_API_URL:"https://thirdparty.qonto.com"},[h.STAGING]:{IFRAME_BASE_URL:_,IFRAME_URL:`${_}/connect`,THIRD_PARTY_API_URL:"https://thirdparty{branch}.staging.qonto.co"},[h.LOCAL]:{IFRAME_BASE_URL:g,IFRAME_URL:`${g}/connect`,THIRD_PARTY_API_URL:"https://thirdparty{branch}.staging.qonto.co"}};class L{constructor(){this.environment=h.PRODUCTION,this.branch=p.SANDBOX}static getInstance(){return L.instance||(L.instance=new L),L.instance}setEnvironment(e){this.environment=e}getEnvironment(){return this.environment}setBranch(e){this.branch=e}getBranch(){return this.branch}clear(){this.environment=h.PRODUCTION,this.branch=p.MASTER}getEnvironmentUrls(){if(this.environment===h.PRODUCTION)return I.production;{const e=I[this.environment];return Object.entries(e).reduce(((e,[t,n])=>({...e,[t]:n.replace("{branch}",`-${this.branch}`)})),{})}}}const w=L.getInstance();const A={initialize:function(e){const{accessToken:t,operationSettings:i,environment:a,branch:r}=m(e);n.setAccessToken(t),i&&c.setSettings(i),a&&(w.setEnvironment(a),r&&w.setBranch(r))},logout:function(){n.clearAccessToken()},constants:f},{initialize:E,logout:v,constants:b}=A;class D extends i{constructor(e){super();const t=Array.isArray(e)?e.join("\n"):e;this.name="EmbedApiError",this.message=`The call to the Embed API failed with the following errors:\n${t}`}}async function T(e,t){const n={method:"GET",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json","Accept-Language":"en"}},i=w.getEnvironmentUrls().THIRD_PARTY_API_URL,a=await fetch(`${i}/v2/cards/${e.cardId}/data_view`,n),r=await a.json();if(r.errors)throw new D(r.errors.map((e=>`${e.code}: ${e.detail}`)));return function(e,t){const n=new URL(e);return"boolean"==typeof t.allowPinReveal&&n.searchParams.set("canSeePin",t.allowPinReveal?"true":"false"),"boolean"==typeof t.allowBlocking&&n.searchParams.set("canBlock",t.allowBlocking?"true":"false"),n.toString()}(r.iframe_url,e)}var P;!function(e){e.PENDING="pending",e.ONHOLD="onhold",e.ORDER_CANCELED="order_canceled",e.LIVE="live",e.PAUSED="paused",e.STOLEN="stolen",e.LOST="lost",e.PIN_BLOCKED="pin_blocked",e.DELETED="deleted",e.PRE_EXPIRED="pre_expired",e.EXPIRED="expired",e.DISCARDED="discarded",e.SHIPPED_LOST="shipped_lost",e.ABUSIVE="abusive"}(P||(P={}));const R={TRANSPORT:"transport",RESTAURANT_AND_BAR:"restaurant_and_bar",FOOD_AND_GROCERY:"food_and_grocery",IT_AND_ELECTRONICS:"it_and_electronics",UTILITY:"utility",TAX:"tax",LEGAL_AND_ACCOUNTING:"legal_and_accounting",ATM:"atm",OFFICE_SUPPLY:"office_supply",HARDWARE_AND_EQUIPMENT:"hardware_and_equipment",FINANCE:"finance"};var O,S;function U(e,t){const n=t.filter((t=>t.requiredIfPresent?!e[t.name]&&e[t.requiredIfPresent]:!e[t.name])).map((e=>e.name));if(n.length>0)throw new s(n.map((e=>`Missing required parameter: ${e}`)))}function k(e){return Object.entries(e).filter((([,e])=>void 0!==e)).filter((([,e])=>"string"!=typeof e)).map((([e])=>`${e} must be a string`))}function N(e){return Object.entries(e).filter((([,e])=>void 0!==e&&!1!==e&&!0!==e)).map((([e])=>`${e} must be a boolean`))}function C(e){return Object.entries(e).filter((([,e])=>void 0!==e)).filter((([,e])=>"number"!=typeof e)).map((([e])=>`${e} must be a number`))}!function(e){e.VIRTUAL="virtual"}(O||(O={})),function(e){e.METAL="metal",e.PLUS="plus",e.STANDARD="standard"}(S||(S={}));const M=[{name:"organizationId"},{name:"membershipId"},{name:"bankAccountId"},{name:"monthlyLimit"},{name:"cardLevel"}],$=[...M,{name:"atmDailyLimit",requiredIfPresent:"hasAtmDailyLimit"},{name:"hasAtmDailyLimit",requiredIfPresent:"hasAtmOption"},{name:"atmMonthlyLimit",requiredIfPresent:"hasAtmOption"},{name:"shipToBusiness"},{name:"cardLevel"}];function B(e){if(!e)throw new s("cardSettings parameter is required for the called function");return"virtual"===e.cardLevel?function(e){return U(e,M),function(e){const{membershipId:t,organizationId:n,bankAccountId:i,hasDailyLimit:a,hasTransactionLimit:r,monthlyLimit:o,dailyLimit:c,transactionLimit:d,activeDays:m,categories:l,cardLevel:u}=e,h=function(e){return"virtual"!==e?['cardLevel must be "virtual"']:[]}(u),p=k({membershipId:t,organizationId:n,bankAccountId:i}),f=N({hasDailyLimit:a,hasTransactionLimit:r}),y=C({monthlyLimit:o,dailyLimit:c,transactionLimit:d}),_=z(m),g=q(l),I=[...h,...p,...f,...y,..._,...g];if(I.length>0)throw new s(I)}(e),e}(e):function(e){U(e,$),function(e){const{membershipId:t,organizationId:n,bankAccountId:i,hasDailyLimit:a,hasTransactionLimit:r,monthlyLimit:o,dailyLimit:c,transactionLimit:d,activeDays:m,categories:l,cardLevel:u,hasNfcOption:h,hasForeignPaymentOption:p,hasOnlinePaymentOption:f,shipToBusiness:y,hasAtmOption:_,hasAtmDailyLimit:g,atmDailyLimit:I,atmMonthlyLimit:L,address:w,cardDesign:A,typeOfPrint:E}=e,v=function(e){return Object.values(S).includes(e)?[]:['cardLevel must be one of "standard", "plus", "metal"']}(u),b=function(e){const t=null!=e&&"string"!=typeof e,n=!["print","embossed",void 0,null].includes(e);return t||n?['typeOfPrint must be one of "print", "embossed" or null']:[]}(E),D=k({membershipId:t,organizationId:n,bankAccountId:i}),T=N({hasDailyLimit:a,hasTransactionLimit:r,hasAtmOption:_,hasNfcOption:h,hasForeignPaymentOption:p,hasOnlinePaymentOption:f,hasAtmDailyLimit:g,shipToBusiness:y}),P=C({monthlyLimit:o,dailyLimit:c,transactionLimit:d,atmDailyLimit:I,atmMonthlyLimit:L}),R=z(m),O=q(l),U=function(e){return["undefined","string"].includes(typeof e)?[]:["cardDesign must be a string"]}(A),M=function(e){return!e||e.contactName&&e.firstLine&&e.zipCode&&e.city&&e.country?[]:["address must contain at least contactName, firstLine, zipCode, city and country properties"]}(w),$=[...v,...D,...T,...P,...R,...O,...b,...U,...M];if($.length>0)throw new s($)}(e)}(e)}function z(e){const t=!Array.isArray(e)||!e.every((e=>Number.isInteger(e)&&e>0&&e<8));return void 0!==e&&t?["activeDays must be an array of integers between 1 and 7"]:[]}function q(e){const t=!Array.isArray(e)||e.some((e=>"string"!=typeof e));return void 0!==e&&t?["categories must be an array of strings"]:[]}class j extends i{constructor(e){super(),this.name="EmbedOperationError",this.message=e}}class x{constructor(e){this.options=e,this.iframe=null,this.parentElement=null,this.messageListeners=new Map,this.defaultTimeout=3e4;const t=new URL(e.iframeUrl);this.targetOrigin=`${t.protocol}//${t.host}`}async initialize(){if(this.iframe)return this;if(this.parentElement=document.getElementById(this.options.parentElementId),!this.parentElement)throw new j(`Could not install the authentication UI because the parent element with id ${this.options.parentElementId} was not found.\nPlease make sure to pass a valid parentElementId when calling the method.`);return new Promise(((e,t)=>{this.iframe=document.createElement("iframe"),this.iframe.src=this.options.iframeUrl,this.iframe.style.width="100%",this.iframe.style.height="100%",this.iframe.style.border="none";const n=this.options.timeout||this.defaultTimeout,i=setTimeout((()=>{window.removeEventListener("message",a),t(new j(`Could not install the authentication UI because the timeout of ${n}ms was reached.\nPlease make sure the application can reach the Internet.`))}),n),a=t=>{t.data.eventId===l.READY&&(clearTimeout(i),window.removeEventListener("message",a),e(this))};window.addEventListener("message",a),this.parentElement?.appendChild(this.iframe)}))}postMessage(e){return this.iframe&&this.iframe.contentWindow?new Promise(((t,n)=>{const i=a=>{if(a.data?.actionId===e.actionId){if("error"===a.data.status)return this.removeMessageListener(e.actionId,i),n(new j(`An error occurred when performing the action ${e.actionId}.\n${JSON.stringify(a.data.payload)}`));this.removeMessageListener(e.actionId,i),t(a.data.payload)}};this.addMessageListener(e.actionId,i),this.iframe?.contentWindow?.postMessage(e,this.targetOrigin)})):Promise.reject(new j("Attempted to perform an Embed operation without having the authentication UI initialized."))}addMessageListener(e,t){this.messageListeners.has(e)||this.messageListeners.set(e,[]);this.messageListeners.get(e).push(t),window.addEventListener("message",t)}removeMessageListener(e,t){const n=this.messageListeners.get(e);if(n){const e=n.indexOf(t);-1!==e&&(n.splice(e,1),window.removeEventListener("message",t))}}destroy(){this.messageListeners.forEach((e=>{e.forEach((e=>{window.removeEventListener("message",e)}))})),this.messageListeners.clear(),this.iframe&&this.parentElement&&(this.parentElement.removeChild(this.iframe),this.iframe=null)}}function F({accessToken:e,language:t,debugMode:n}){const i=n||!1,a=t||"en";return`${w.getEnvironmentUrls().IFRAME_URL}?debug=${i}&lang=${encodeURIComponent(a)}#access_token=${encodeURIComponent(e)}`}function Y({parentElementId:e,iframeUrl:t}){return new x({parentElementId:e,iframeUrl:t}).initialize()}const G=[];for(let e=0;e<256;++e)G.push((e+256).toString(16).slice(1));let H;const V=new Uint8Array(16);var X={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function K(e,t,n){if(X.randomUUID&&!e)return X.randomUUID();const i=(e=e||{}).random??e.rng?.()??function(){if(!H){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");H=crypto.getRandomValues.bind(crypto)}return H(V)}();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(G[e[t+0]]+G[e[t+1]]+G[e[t+2]]+G[e[t+3]]+"-"+G[e[t+4]]+G[e[t+5]]+"-"+G[e[t+6]]+G[e[t+7]]+"-"+G[e[t+8]]+G[e[t+9]]+"-"+G[e[t+10]]+G[e[t+11]]+G[e[t+12]]+G[e[t+13]]+G[e[t+14]]+G[e[t+15]]).toLowerCase()}(i)}function W(e){return"virtual"===e.cardLevel?function(e){const t=J(e.categories);return{actionId:u.CARD_ORDER,actionData:{idempotencyKey:K(),body:{card:{payment_monthly_limit:e.monthlyLimit,payment_daily_limit:e.dailyLimit,payment_daily_limit_option:e.hasDailyLimit,payment_transaction_limit:e.transactionLimit,payment_transaction_limit_option:e.hasTransactionLimit,active_days:e.activeDays||[],holder_id:e.membershipId,organization_id:e.organizationId,bank_account_id:e.bankAccountId,categories:t,card_level:e.cardLevel}}}}}(e):function(e){const t=J(e.categories);return{actionId:u.CARD_ORDER,actionData:{idempotencyKey:K(),body:{card:{payment_monthly_limit:e.monthlyLimit,payment_daily_limit:e.dailyLimit,payment_daily_limit_option:e.hasDailyLimit,payment_transaction_limit:e.transactionLimit,payment_transaction_limit_option:e.hasTransactionLimit,active_days:e.activeDays||[],holder_id:e.membershipId,organization_id:e.organizationId,bank_account_id:e.bankAccountId,categories:t,card_level:e.cardLevel,card_design:e.cardDesign,..."plus"===e.cardLevel&&{type_of_print:e.typeOfPrint},ship_to_business_address:e.shipToBusiness,atm_option:e.hasAtmOption,nfc_option:e.hasNfcOption,foreign_option:e.hasForeignPaymentOption,online_option:e.hasOnlinePaymentOption,atm_daily_limit:e.atmDailyLimit,atm_monthly_limit:e.atmMonthlyLimit,...!e.shipToBusiness&&{address:{contact_name:e.address?.contactName,first_line:e.address?.firstLine,second_line:e.address?.secondLine,third_line:e.address?.thirdLine,zipcode:e.address?.zipCode,city:e.address?.city,country:e.address?.country}}}}}}}(e)}function Q(e){return{id:e.id,nickname:e.nickname,embossedName:e.embossed_name,status:e.status,maskPan:e.mask_pan,expMonth:parseInt(e.exp_month,10),expYear:parseInt(e.exp_year,10),lastActivityAt:new Date(e.last_activity_at),lastDigits:e.last_digits,shipToBusiness:e.ship_to_business,atmOption:e.atm_option,atmDailyLimitOption:e.atm_daily_limit_option,nfcOption:e.nfc_option,onlineOption:e.online_option,foreignOption:e.foreign_option,atmMonthlyLimit:e.atm_monthly_limit,atmMonthlySpent:e.atm_monthly_spent,atmDailyLimit:e.atm_daily_limit,atmDailySpent:e.atm_daily_spent,paymentMonthlyLimit:e.payment_monthly_limit,paymentMonthlySpent:e.payment_monthly_spent,paymentDailyLimit:e.payment_daily_limit,paymentDailySpent:e.payment_daily_spent,paymentDailyLimitOption:e.payment_daily_limit_option,paymentTransactionLimit:e.payment_transaction_limit,paymentTransactionLimitOption:e.payment_transaction_limit_option,activeDays:e.active_days,holderId:e.holder_id,bankAccountId:e.bank_account_id,organizationId:e.organization_id,updatedAt:new Date(e.updated_at),createdAt:new Date(e.created_at),shippedAt:new Date(e.shipped_at),cardType:e.card_type,cardLevel:e.card_level,paymentLifespanLimit:e.payment_lifespan_limit,paymentLifespanSpent:e.payment_lifespan_spent,preExpiresAt:new Date(e.pre_expires_at),categories:e.categories,renewed:e.renewed,renewal:e.renewal,...e.parent_card_summary&&{parentCardSummary:{id:e.parent_card_summary.id,lastDigits:e.parent_card_summary.last_digits}},hadOperation:e.had_operation,hadPinOperation:e.had_pin_operation,cardDesign:e.card_design,typeOfPrint:e.type_of_print,upsold:e.upsold,upsell:e.upsell,discardOn:new Date(e.discard_on),reordered:e.reordered}}function J(e){const t=Object.values(R);return(e||[]).filter((e=>t.includes(e)))}const Z={getCards:async function({membershipId:e}){try{const t=r();if(e&&"string"!=typeof e)throw new s("membershipId must be a string");const n=await async function({accessToken:e,membershipId:t}){const n={method:"GET",headers:{Authorization:`Bearer ${e}`}},i=w.getEnvironmentUrls().THIRD_PARTY_API_URL,a=t?`${i}/v2/cards?holder_ids[]=${t}`:`${i}/v2/cards`,r=await fetch(a,n),s=await r.json();if(s.errors)throw new D(s.errors.map((e=>`${e.code}: ${e.detail}`)));return s.cards}({accessToken:t,membershipId:e});return n.map((e=>Q(e)))}catch(e){return Promise.reject(e)}},getCard:async function({cardId:e}){try{const t=r();if(e&&"string"!=typeof e)throw new s("cardId must be a string");const n=await async function({accessToken:e,cardId:t}){const n={method:"GET",headers:{Authorization:`Bearer ${e}`}},i=`${w.getEnvironmentUrls().THIRD_PARTY_API_URL}/v2/cards?ids[]=${t}`,a=await fetch(i,n),r=await a.json();if(r.errors)throw new D(r.errors.map((e=>`${e.code}: ${e.detail}`)));return r.cards[0]}({accessToken:t,cardId:e});return Q(n)}catch(e){return Promise.reject(e)}},orderCard:async function(e){try{const t=r(),{uiParentElementId:n}=d(e.operationSettings);B(e.cardSettings);const i=F({accessToken:t}),a=await Y({iframeUrl:i,parentElementId:n}),s=W(e.cardSettings),o=await a.postMessage(s);return a.destroy(),Q(o)}catch(e){return Promise.reject(e)}},unlockCard:async function(e){try{const t=r(),{uiParentElementId:n}=d(e.operationSettings);!function(e){if(!e)throw new s("cardSettings parameter is required for the called function");if(!e.cardId)throw new s("cardId is required for the called function");const t=k({cardId:e.cardId});if(t.length>0)throw new s(t)}(e.cardSettings);const i=F({accessToken:t}),a=await Y({iframeUrl:i,parentElementId:n}),o=function(e){return{actionId:u.CARD_UNLOCK,actionData:{cardId:e.cardSettings.cardId}}}(e),c=await a.postMessage(o);return a.destroy(),Q(c)}catch(e){return Promise.reject(e)}},displayCard:async function(e){try{const t=r(),{uiParentElementId:n}=d(e.operationSettings);!function(e){if(!e)throw new s("cardSettings parameter is required for the called function");if(!e.cardId)throw new s("cardId is required for the called function");const t=k({cardId:e.cardId});if(t.length>0)throw new s(t);let n={};void 0!==e.allowPinReveal&&(n={allowPinReveal:e.allowPinReveal}),void 0!==e.allowBlocking&&(n={...n,allowBlocking:e.allowBlocking});const i=N(n);if(i.length>0)throw new s(i)}(e.cardSettings);const i=await T(e.cardSettings,t),a=await Y({iframeUrl:i,parentElementId:n});return{destroyEmbedUI:()=>{a.destroy()}}}catch(e){return Promise.reject(e)}}},ee=Z;e.cards=ee,e.constants=b,e.initialize=E,e.logout=v}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../src/mocks/handlers.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAK3D,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../src/mocks/handlers.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAK3D,eAAO,MAAM,WAAW,6BA2FvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EmbedApiError as r}from"../errors/EmbedApiError.js";import{getPopulatedIframeURL as e}from"./cards.helper.js";import{environmentManager as o}from"../common/environment/environment-manager.js";async function
|
|
1
|
+
import{EmbedApiError as r}from"../errors/EmbedApiError.js";import{getPopulatedIframeURL as e}from"./cards.helper.js";import{environmentManager as o}from"../common/environment/environment-manager.js";async function a({accessToken:e,membershipId:a}){const t={method:"GET",headers:{Authorization:`Bearer ${e}`}},n=o.getEnvironmentUrls().THIRD_PARTY_API_URL,s=a?`${n}/v2/cards?holder_ids[]=${a}`:`${n}/v2/cards`,i=await fetch(s,t),c=await i.json();if(c.errors)throw new r(c.errors.map((r=>`${r.code}: ${r.detail}`)));return c.cards}async function t({accessToken:e,cardId:a}){const t={method:"GET",headers:{Authorization:`Bearer ${e}`}},n=`${o.getEnvironmentUrls().THIRD_PARTY_API_URL}/v2/cards?ids[]=${a}`,s=await fetch(n,t),i=await s.json();if(i.errors)throw new r(i.errors.map((r=>`${r.code}: ${r.detail}`)));return i.cards[0]}async function n(a,t){const n={method:"GET",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json","Accept-Language":"en"}},s=o.getEnvironmentUrls().THIRD_PARTY_API_URL,i=await fetch(`${s}/v2/cards/${a.cardId}/data_view`,n),c=await i.json();if(c.errors)throw new r(c.errors.map((r=>`${r.code}: ${r.detail}`)));return e(c.iframe_url,a)}export{t as getCard,n as getCardIframeURL,a as getCards};
|
package/dist/src/cards/cards.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../common/auth/auth.js";import{validatePresenceOfAuthToken as t}from"../common/auth/auth.validate.js";import{getCardIframeURL as e,getCards as
|
|
1
|
+
import"../common/auth/auth.js";import{validatePresenceOfAuthToken as t}from"../common/auth/auth.validate.js";import{getCardIframeURL as r,getCard as e,getCards as a}from"./cards.api.js";import"./cards.types.js";import{validateDisplayCardParams as s,validateUnlockCardParams as n,validateOrderCardParams as i}from"./cards.validate.js";import{createIframe as o,buildIframeUrl as c}from"../iframe/iframe-manager.js";import{serializeUnlockCardPayload as m,serializeCard as d,serializeOrderCardPayload as p}from"./cards.serializer.js";import{validateOperationSettingsParams as u}from"../validation/operation-settings-validation.js";import{InvalidParametersError as f}from"../errors/InvalidParametersError.js";async function g({membershipId:r}){try{const e=t();if(r&&"string"!=typeof r)throw new f("membershipId must be a string");return(await a({accessToken:e,membershipId:r})).map((t=>d(t)))}catch(t){return Promise.reject(t)}}async function y({cardId:r}){try{const a=t();if(r&&"string"!=typeof r)throw new f("cardId must be a string");const s=await e({accessToken:a,cardId:r});return d(s)}catch(t){return Promise.reject(t)}}async function l(r){try{const e=t(),{uiParentElementId:a}=u(r.operationSettings);i(r.cardSettings);const s=c({accessToken:e}),n=await o({iframeUrl:s,parentElementId:a}),m=p(r.cardSettings),f=await n.postMessage(m);return n.destroy(),d(f)}catch(t){return Promise.reject(t)}}async function h(r){try{const e=t(),{uiParentElementId:a}=u(r.operationSettings);n(r.cardSettings);const s=c({accessToken:e}),i=await o({iframeUrl:s,parentElementId:a}),p=m(r),f=await i.postMessage(p);return i.destroy(),d(f)}catch(t){return Promise.reject(t)}}async function j(e){try{const a=t(),{uiParentElementId:n}=u(e.operationSettings);s(e.cardSettings);const i=await r(e.cardSettings,a),c=await o({iframeUrl:i,parentElementId:n});return{destroyEmbedUI:()=>{c.destroy()}}}catch(t){return Promise.reject(t)}}export{j as displayCard,y as getCard,g as getCards,l as orderCard,h as unlockCard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{displayCard as r,unlockCard as d,orderCard as a,getCards as
|
|
1
|
+
import{displayCard as r,unlockCard as d,orderCard as a,getCard as o,getCards as s}from"./cards.js";const t={getCards:s,getCard:o,orderCard:a,unlockCard:d,displayCard:r};export{t as cards};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ENVIRONMENTS as t,BRANCHES as n}from"../constants.js";const e="https://embed.qonto.com",r="https://embed-js{branch}.staging.qonto.co",c="https://embed.dev.qonto.co",o={[t.PRODUCTION]:{IFRAME_BASE_URL:e,IFRAME_URL:`${e}/connect`,THIRD_PARTY_API_URL:"https://thirdparty.qonto.com"},[t.STAGING]:{IFRAME_BASE_URL:r,IFRAME_URL:`${r}/connect`,THIRD_PARTY_API_URL:"https://thirdparty{branch}.staging.qonto.co"},[t.LOCAL]:{IFRAME_BASE_URL:c,IFRAME_URL:`${c}/connect`,THIRD_PARTY_API_URL:"https://thirdparty{branch}.staging.qonto.co"}};class s{constructor(){this.environment=t.PRODUCTION,this.branch=n.
|
|
1
|
+
import{ENVIRONMENTS as t,BRANCHES as n}from"../constants.js";const e="https://embed.qonto.com",r="https://embed-js{branch}.staging.qonto.co",c="https://embed.dev.qonto.co",o={[t.PRODUCTION]:{IFRAME_BASE_URL:e,IFRAME_URL:`${e}/connect`,THIRD_PARTY_API_URL:"https://thirdparty.qonto.com"},[t.STAGING]:{IFRAME_BASE_URL:r,IFRAME_URL:`${r}/connect`,THIRD_PARTY_API_URL:"https://thirdparty{branch}.staging.qonto.co"},[t.LOCAL]:{IFRAME_BASE_URL:c,IFRAME_URL:`${c}/connect`,THIRD_PARTY_API_URL:"https://thirdparty{branch}.staging.qonto.co"}};class s{constructor(){this.environment=t.PRODUCTION,this.branch=n.SANDBOX}static getInstance(){return s.instance||(s.instance=new s),s.instance}setEnvironment(t){this.environment=t}getEnvironment(){return this.environment}setBranch(t){this.branch=t}getBranch(){return this.branch}clear(){this.environment=t.PRODUCTION,this.branch=n.MASTER}getEnvironmentUrls(){if(this.environment===t.PRODUCTION)return o.production;{const t=o[this.environment];return Object.entries(t).reduce(((t,[n,e])=>({...t,[n]:e.replace("{branch}",`-${this.branch}`)})),{})}}}const i=s.getInstance();export{s as EnvironmentManager,i as environmentManager};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{InvalidParametersError as n}from"../../errors/InvalidParametersError.js";import{validateOperationSettingsParams as o}from"../../validation/operation-settings-validation.js";function t(t){if(!t?.accessToken)throw new n("Access token is required when calling initialize()");return t?.operationSettings&&o(t.operationSettings),function(o){if(o.environment){if(!["production","staging","local"].includes(o.environment))throw new n('If provided, environment must be either "production" or "staging"\nYou can "import constants from @qonto/embed-sdk/common" and then use "constants.environment.PRODUCTION" or "constants.environment.STAGING"');if(o.branch&&!["master","sandbox","qa"].includes(o.
|
|
1
|
+
import{InvalidParametersError as n}from"../../errors/InvalidParametersError.js";import{validateOperationSettingsParams as o}from"../../validation/operation-settings-validation.js";function t(t){if(!t?.accessToken)throw new n("Access token is required when calling initialize()");return t?.operationSettings&&o(t.operationSettings),function(o){if(o.environment){if(!["production","staging","local"].includes(o.environment))throw new n('If provided, environment must be either "production" or "staging"\nYou can "import constants from @qonto/embed-sdk/common" and then use "constants.environment.PRODUCTION" or "constants.environment.STAGING"');if(o.branch&&!["master","sandbox","qa"].includes(o.branch))throw new n('If provided, branch must be either "master", "sandbox" or "qa"\nYou can "import constants from @qonto/embed-sdk/common" and then use "constants.branch.MASTER" or "constants.environment.SANDBOX" and so on')}}(t),t}export{t as validateInitializeParams};
|
|
@@ -1,5 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Optional settings to configure the SDK's operations that will be performed
|
|
3
|
+
* after the initialization. This can be also provided when calling the
|
|
4
|
+
* operation functions themselves.
|
|
5
|
+
*/
|
|
1
6
|
export interface OperationSettings {
|
|
7
|
+
/**
|
|
8
|
+
* The id of the element where the SDK UI for sensitive operations will be
|
|
9
|
+
* rendered.
|
|
10
|
+
*/
|
|
2
11
|
uiParentElementId?: string;
|
|
12
|
+
/**
|
|
13
|
+
* The Multifactor Authentication (MFA) preference to use for the operations.
|
|
14
|
+
* This can be either `MFA_METHODS.PASSKEY`, `MFA_METHODS.PAIRED_DEVICE` or
|
|
15
|
+
* `MFA_METHODS.SMS_OTP`. If not provided, the SDK will default to 'PASSKEY'.
|
|
16
|
+
*/
|
|
3
17
|
mfaPreference?: 'passkey' | 'paired-device' | 'sms-otp' | null;
|
|
4
18
|
}
|
|
5
19
|
export declare function validateOperationSettingsParams(params: OperationSettings | undefined): OperationSettings;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation-settings-validation.d.ts","sourceRoot":"","sources":["../../src/validation/operation-settings-validation.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,iBAAiB;IAChC,iBAAiB,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"operation-settings-validation.d.ts","sourceRoot":"","sources":["../../src/validation/operation-settings-validation.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;OAIG;IACH,aAAa,CAAC,EAAE,SAAS,GAAG,eAAe,GAAG,SAAS,GAAG,IAAI,CAAC;CAChE;AAED,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,iBAAiB,GAAG,SAAS,GACpC,iBAAiB,CAwBnB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qonto/embed-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Library to embed Qonto features in your application",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -81,6 +81,7 @@
|
|
|
81
81
|
"semantic-release": "^24.2.3",
|
|
82
82
|
"typedoc": "^0.28.2",
|
|
83
83
|
"typedoc-plugin-markdown": "^4.6.2",
|
|
84
|
+
"typedoc-plugin-missing-exports": "^4.0.0",
|
|
84
85
|
"typescript": "^5.8.3",
|
|
85
86
|
"typescript-eslint": "^8.29.1",
|
|
86
87
|
"vitest": "^3.1.1"
|