@notabene/javascript-sdk 2.18.0 → 2.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/notabene.cjs +6 -6
- package/dist/cjs/notabene.d.ts +19 -45
- package/dist/cjs/package.json +1 -1
- package/dist/esm/notabene.d.ts +19 -45
- package/dist/esm/notabene.js +1525 -1651
- package/dist/esm/package.json +1 -1
- package/dist/notabene.d.ts +19 -45
- package/dist/notabene.js +1525 -1651
- package/docs/README.md +34 -1
- package/package.json +1 -1
- package/src/__tests__/EmbeddedComponent.portless-message.test.ts +66 -0
- package/src/__tests__/EmbeddedComponent.test.ts +3 -3
- package/src/components/EmbeddedComponent.ts +18 -8
- package/src/notabene.ts +2 -2
- package/src/responseTransformer/README.md +0 -30
- package/src/responseTransformer/__tests__/transformer.test.ts +2 -2
- package/src/responseTransformer/index.ts +1 -3
- package/src/responseTransformer/mappers.ts +9 -218
- package/src/responseTransformer/transformer.ts +1 -57
- package/src/responseTransformer/types.ts +0 -18
- package/src/types.ts +21 -6
- package/src/utils/MessageEventManager.ts +2 -0
- package/src/utils/__tests__/MessageEventManager.test.ts +8 -0
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
|
/**
|
|
@@ -24,6 +24,14 @@ describe('MessageEventManager', () => {
|
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
describe('setPort', () => {
|
|
27
|
+
it('should ignore undefined port', () => {
|
|
28
|
+
expect(() =>
|
|
29
|
+
messageEventManager.setPort(undefined as unknown as MessagePort),
|
|
30
|
+
).not.toThrow();
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
describe('setPort with valid port', () => {
|
|
27
35
|
beforeEach(() => {
|
|
28
36
|
messageEventManager.setPort(mockPort);
|
|
29
37
|
});
|