@notabene/javascript-sdk 2.17.0-next.4 → 2.18.0-next.3
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 +1 -7
- package/dist/cjs/notabene.d.ts +18 -5
- package/dist/cjs/package.json +1 -1
- package/dist/esm/notabene.d.ts +18 -5
- package/dist/esm/package.json +1 -1
- package/dist/notabene.d.ts +18 -5
- package/docs/README.md +34 -1
- package/package.json +1 -1
- package/src/notabene.ts +2 -0
- package/src/types.ts +21 -6
package/README.md
CHANGED
|
@@ -452,12 +452,6 @@ const { invoice, merchant, customer } = await reader.completion();
|
|
|
452
452
|
|
|
453
453
|
It also supports `openModal()` and `popup()` like the other components:
|
|
454
454
|
|
|
455
|
-
```js
|
|
456
|
-
const { invoice, merchant, customer } = await notabene
|
|
457
|
-
.createInvoiceReader()
|
|
458
|
-
.openModal();
|
|
459
|
-
It also supports `openModal()` and `popup()` like the other components:
|
|
460
|
-
|
|
461
455
|
```js
|
|
462
456
|
// Modal
|
|
463
457
|
const { invoice, merchant, customer } = await notabene
|
|
@@ -468,7 +462,7 @@ const { invoice, merchant, customer } = await notabene
|
|
|
468
462
|
const { invoice, merchant, customer } = await notabene
|
|
469
463
|
.createInvoiceReader()
|
|
470
464
|
.popup();
|
|
471
|
-
```
|
|
465
|
+
```
|
|
472
466
|
|
|
473
467
|
### Response
|
|
474
468
|
|
package/dist/cjs/notabene.d.ts
CHANGED
|
@@ -753,6 +753,23 @@ export declare type ConnectionResult<T extends ComponentRequest> = {
|
|
|
753
753
|
|
|
754
754
|
export declare type ConnectionStatus = 'active' | 'completed' | 'closed';
|
|
755
755
|
|
|
756
|
+
/**
|
|
757
|
+
* Configuration for the terms and conditions consent checkbox.
|
|
758
|
+
*
|
|
759
|
+
* @remarks
|
|
760
|
+
* - `undefined` or `true`: show default T&C (current behavior)
|
|
761
|
+
* - `false`: hide T&C entirely
|
|
762
|
+
* - `{ label?, description? }`: show with custom text (translations are the customer's responsibility)
|
|
763
|
+
*
|
|
764
|
+
* @public
|
|
765
|
+
*/
|
|
766
|
+
export declare type ConsentConfig = boolean | {
|
|
767
|
+
/** Custom label text. Replaces the default "Accept terms and conditions". */
|
|
768
|
+
label?: string;
|
|
769
|
+
/** Custom description text. Replaces the default sharing-info description. */
|
|
770
|
+
description?: string;
|
|
771
|
+
};
|
|
772
|
+
|
|
756
773
|
/**
|
|
757
774
|
* Configuration for the contact support action.
|
|
758
775
|
*
|
|
@@ -3330,12 +3347,8 @@ export declare interface TransactionOptions {
|
|
|
3330
3347
|
vasps?: VASPOptions;
|
|
3331
3348
|
hide?: ValidationSections[];
|
|
3332
3349
|
counterpartyAssist?: CounterpartyAssistConfig;
|
|
3333
|
-
/**
|
|
3334
|
-
* Configuration for the contact support button.
|
|
3335
|
-
* Enablement is controlled via `agentSections` — include `'contact-support'`
|
|
3336
|
-
* in `main` or `fallback` to show the button.
|
|
3337
|
-
*/
|
|
3338
3350
|
contactSupport?: ContactSupportConfig;
|
|
3351
|
+
consent?: ConsentConfig;
|
|
3339
3352
|
autoSubmit?: boolean;
|
|
3340
3353
|
}
|
|
3341
3354
|
|
package/dist/cjs/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"author": "Notabene <developers@notabene.id>",
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"packageManager": "yarn@4.5.1",
|
|
13
|
-
"version": "2.
|
|
13
|
+
"version": "2.18.0-next.3",
|
|
14
14
|
"source": "src/notabene.ts",
|
|
15
15
|
"main": "dist/cjs/notabene.cjs",
|
|
16
16
|
"module": "dist/esm/notabene.js",
|
package/dist/esm/notabene.d.ts
CHANGED
|
@@ -753,6 +753,23 @@ export declare type ConnectionResult<T extends ComponentRequest> = {
|
|
|
753
753
|
|
|
754
754
|
export declare type ConnectionStatus = 'active' | 'completed' | 'closed';
|
|
755
755
|
|
|
756
|
+
/**
|
|
757
|
+
* Configuration for the terms and conditions consent checkbox.
|
|
758
|
+
*
|
|
759
|
+
* @remarks
|
|
760
|
+
* - `undefined` or `true`: show default T&C (current behavior)
|
|
761
|
+
* - `false`: hide T&C entirely
|
|
762
|
+
* - `{ label?, description? }`: show with custom text (translations are the customer's responsibility)
|
|
763
|
+
*
|
|
764
|
+
* @public
|
|
765
|
+
*/
|
|
766
|
+
export declare type ConsentConfig = boolean | {
|
|
767
|
+
/** Custom label text. Replaces the default "Accept terms and conditions". */
|
|
768
|
+
label?: string;
|
|
769
|
+
/** Custom description text. Replaces the default sharing-info description. */
|
|
770
|
+
description?: string;
|
|
771
|
+
};
|
|
772
|
+
|
|
756
773
|
/**
|
|
757
774
|
* Configuration for the contact support action.
|
|
758
775
|
*
|
|
@@ -3330,12 +3347,8 @@ export declare interface TransactionOptions {
|
|
|
3330
3347
|
vasps?: VASPOptions;
|
|
3331
3348
|
hide?: ValidationSections[];
|
|
3332
3349
|
counterpartyAssist?: CounterpartyAssistConfig;
|
|
3333
|
-
/**
|
|
3334
|
-
* Configuration for the contact support button.
|
|
3335
|
-
* Enablement is controlled via `agentSections` — include `'contact-support'`
|
|
3336
|
-
* in `main` or `fallback` to show the button.
|
|
3337
|
-
*/
|
|
3338
3350
|
contactSupport?: ContactSupportConfig;
|
|
3351
|
+
consent?: ConsentConfig;
|
|
3339
3352
|
autoSubmit?: boolean;
|
|
3340
3353
|
}
|
|
3341
3354
|
|
package/dist/esm/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"author": "Notabene <developers@notabene.id>",
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"packageManager": "yarn@4.5.1",
|
|
13
|
-
"version": "2.
|
|
13
|
+
"version": "2.18.0-next.3",
|
|
14
14
|
"source": "src/notabene.ts",
|
|
15
15
|
"main": "dist/cjs/notabene.cjs",
|
|
16
16
|
"module": "dist/esm/notabene.js",
|
package/dist/notabene.d.ts
CHANGED
|
@@ -753,6 +753,23 @@ export declare type ConnectionResult<T extends ComponentRequest> = {
|
|
|
753
753
|
|
|
754
754
|
export declare type ConnectionStatus = 'active' | 'completed' | 'closed';
|
|
755
755
|
|
|
756
|
+
/**
|
|
757
|
+
* Configuration for the terms and conditions consent checkbox.
|
|
758
|
+
*
|
|
759
|
+
* @remarks
|
|
760
|
+
* - `undefined` or `true`: show default T&C (current behavior)
|
|
761
|
+
* - `false`: hide T&C entirely
|
|
762
|
+
* - `{ label?, description? }`: show with custom text (translations are the customer's responsibility)
|
|
763
|
+
*
|
|
764
|
+
* @public
|
|
765
|
+
*/
|
|
766
|
+
export declare type ConsentConfig = boolean | {
|
|
767
|
+
/** Custom label text. Replaces the default "Accept terms and conditions". */
|
|
768
|
+
label?: string;
|
|
769
|
+
/** Custom description text. Replaces the default sharing-info description. */
|
|
770
|
+
description?: string;
|
|
771
|
+
};
|
|
772
|
+
|
|
756
773
|
/**
|
|
757
774
|
* Configuration for the contact support action.
|
|
758
775
|
*
|
|
@@ -3330,12 +3347,8 @@ export declare interface TransactionOptions {
|
|
|
3330
3347
|
vasps?: VASPOptions;
|
|
3331
3348
|
hide?: ValidationSections[];
|
|
3332
3349
|
counterpartyAssist?: CounterpartyAssistConfig;
|
|
3333
|
-
/**
|
|
3334
|
-
* Configuration for the contact support button.
|
|
3335
|
-
* Enablement is controlled via `agentSections` — include `'contact-support'`
|
|
3336
|
-
* in `main` or `fallback` to show the button.
|
|
3337
|
-
*/
|
|
3338
3350
|
contactSupport?: ContactSupportConfig;
|
|
3351
|
+
consent?: ConsentConfig;
|
|
3339
3352
|
autoSubmit?: boolean;
|
|
3340
3353
|
}
|
|
3341
3354
|
|
package/docs/README.md
CHANGED
|
@@ -73,6 +73,7 @@ This library is the JavaScript SDK for loading the Notabene UX components in the
|
|
|
73
73
|
- [Full Example](#full-example)
|
|
74
74
|
- [Field reference](#field-reference)
|
|
75
75
|
- [Configure Counterparty Assist](#counterparty-assist-configuration)
|
|
76
|
+
- [Consent / Terms & Conditions](#consent--terms--conditions)
|
|
76
77
|
- [Locales](#locales)
|
|
77
78
|
- [Theming](#theming)
|
|
78
79
|
- [License](#license)
|
|
@@ -767,7 +768,8 @@ const options: TransactionOptions = {
|
|
|
767
768
|
PersonType.NATURAL, // JS: 'natural'
|
|
768
769
|
PersonType.SELF, // JS: 'self'
|
|
769
770
|
],
|
|
770
|
-
}
|
|
771
|
+
},
|
|
772
|
+
consent: true, // true (default) | false (hide) | { label?: string, description?: string }
|
|
771
773
|
};
|
|
772
774
|
const withdrawal = notabene.createWithdrawalAssist(tx, options);
|
|
773
775
|
```
|
|
@@ -987,6 +989,37 @@ const options: TransactionOptions = {
|
|
|
987
989
|
| `lei` | -- | ✅ | 🟩 | LEI (Legal Entity Identifier) |
|
|
988
990
|
| `countryOfRegistration` | -- | 🟩 | 🟩 | Country of Registration |
|
|
989
991
|
|
|
992
|
+
### Consent / Terms & Conditions
|
|
993
|
+
|
|
994
|
+
By default, a consent checkbox is shown when the counterparty agent is a VASP. It asks the user to accept sharing personal information with the receiving/sending exchange. You can configure this behavior using the `consent` option.
|
|
995
|
+
|
|
996
|
+
- `undefined` or `true`: Show the default consent checkbox (default behavior)
|
|
997
|
+
- `false`: Hide the consent checkbox entirely
|
|
998
|
+
- `{ label?, description? }`: Show the checkbox with custom text
|
|
999
|
+
|
|
1000
|
+
#### Hiding the consent checkbox
|
|
1001
|
+
|
|
1002
|
+
```ts
|
|
1003
|
+
const options: TransactionOptions = {
|
|
1004
|
+
consent: false,
|
|
1005
|
+
};
|
|
1006
|
+
```
|
|
1007
|
+
|
|
1008
|
+
When hidden, the consent requirement is skipped in validation — the component will complete without requiring the user to check the box.
|
|
1009
|
+
|
|
1010
|
+
#### Custom consent text
|
|
1011
|
+
|
|
1012
|
+
```ts
|
|
1013
|
+
const options: TransactionOptions = {
|
|
1014
|
+
consent: {
|
|
1015
|
+
label: 'I agree to the terms',
|
|
1016
|
+
description: 'By proceeding you agree to share your name and address with the counterparty.',
|
|
1017
|
+
},
|
|
1018
|
+
};
|
|
1019
|
+
```
|
|
1020
|
+
|
|
1021
|
+
Both `label` and `description` are optional — you can override one while keeping the default for the other. Translations are the customer's responsibility when providing custom text.
|
|
1022
|
+
|
|
990
1023
|
## Locales
|
|
991
1024
|
|
|
992
1025
|
See [locales](_media/locales.ts) for the list of supported locales.
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"author": "Notabene <developers@notabene.id>",
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"packageManager": "yarn@4.5.1",
|
|
13
|
-
"version": "2.
|
|
13
|
+
"version": "2.18.0-next.3",
|
|
14
14
|
"source": "src/notabene.ts",
|
|
15
15
|
"main": "dist/cjs/notabene.cjs",
|
|
16
16
|
"module": "dist/esm/notabene.js",
|
package/src/notabene.ts
CHANGED
|
@@ -14,6 +14,7 @@ import type {
|
|
|
14
14
|
ComponentResponse,
|
|
15
15
|
ConnectionOptions,
|
|
16
16
|
ConnectionRequest,
|
|
17
|
+
ConsentConfig,
|
|
17
18
|
ContactSupportConfig,
|
|
18
19
|
CosmosMetadata,
|
|
19
20
|
Counterparty,
|
|
@@ -143,6 +144,7 @@ export type {
|
|
|
143
144
|
ComponentResponse,
|
|
144
145
|
ConnectionOptions,
|
|
145
146
|
ConnectionRequest,
|
|
147
|
+
ConsentConfig,
|
|
146
148
|
ContactSupportConfig,
|
|
147
149
|
CosmosMetadata,
|
|
148
150
|
Counterparty,
|
package/src/types.ts
CHANGED
|
@@ -978,6 +978,25 @@ export interface AgentSections {
|
|
|
978
978
|
fallback?: SectionOption[];
|
|
979
979
|
}
|
|
980
980
|
|
|
981
|
+
/**
|
|
982
|
+
* Configuration for the terms and conditions consent checkbox.
|
|
983
|
+
*
|
|
984
|
+
* @remarks
|
|
985
|
+
* - `undefined` or `true`: show default T&C (current behavior)
|
|
986
|
+
* - `false`: hide T&C entirely
|
|
987
|
+
* - `{ label?, description? }`: show with custom text (translations are the customer's responsibility)
|
|
988
|
+
*
|
|
989
|
+
* @public
|
|
990
|
+
*/
|
|
991
|
+
export type ConsentConfig =
|
|
992
|
+
| boolean
|
|
993
|
+
| {
|
|
994
|
+
/** Custom label text. Replaces the default "Accept terms and conditions". */
|
|
995
|
+
label?: string;
|
|
996
|
+
/** Custom description text. Replaces the default sharing-info description. */
|
|
997
|
+
description?: string;
|
|
998
|
+
};
|
|
999
|
+
|
|
981
1000
|
/**
|
|
982
1001
|
* Configuration options for Transaction components
|
|
983
1002
|
* @public
|
|
@@ -1005,12 +1024,8 @@ export interface TransactionOptions {
|
|
|
1005
1024
|
vasps?: VASPOptions;
|
|
1006
1025
|
hide?: ValidationSections[]; // You can hide a specific section of the component by listing it here
|
|
1007
1026
|
counterpartyAssist?: CounterpartyAssistConfig;
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
* Enablement is controlled via `agentSections` — include `'contact-support'`
|
|
1011
|
-
* in `main` or `fallback` to show the button.
|
|
1012
|
-
*/
|
|
1013
|
-
contactSupport?: ContactSupportConfig;
|
|
1027
|
+
contactSupport?: ContactSupportConfig; // Requires 'contact-support' in agentSections
|
|
1028
|
+
consent?: ConsentConfig; // Defaults to true
|
|
1014
1029
|
autoSubmit?: boolean; // Defaults to false
|
|
1015
1030
|
}
|
|
1016
1031
|
/**
|