@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/dist/esm/package.json
CHANGED
package/dist/notabene.d.ts
CHANGED
|
@@ -633,28 +633,6 @@ export declare function componentResponseToTxRequests(response: TransactionRespo
|
|
|
633
633
|
};
|
|
634
634
|
};
|
|
635
635
|
|
|
636
|
-
/**
|
|
637
|
-
* Transforms a Notabene component response to a Version 1 API request body
|
|
638
|
-
*
|
|
639
|
-
* @param response - The response from the Notabene TX Create component
|
|
640
|
-
* @returns The transformed request body ready for the Version 1 API
|
|
641
|
-
*
|
|
642
|
-
* @example
|
|
643
|
-
* ```typescript
|
|
644
|
-
* import { componentResponseToV1TxCreateRequest } from '$lib/notabene-tx-transformer';
|
|
645
|
-
*
|
|
646
|
-
* withdrawal.on('complete', async (result) => {
|
|
647
|
-
* const requestBody = componentResponseToV1TxCreateRequest(result.response);
|
|
648
|
-
*
|
|
649
|
-
* await fetch(endpointUrl, {
|
|
650
|
-
* method: 'POST',
|
|
651
|
-
* body: JSON.stringify(requestBody)
|
|
652
|
-
* });
|
|
653
|
-
* });
|
|
654
|
-
* ```
|
|
655
|
-
*/
|
|
656
|
-
export declare function componentResponseToV1TxCreateRequest(response: TransactionResponse<Withdrawal>): TransactionCreateRequest;
|
|
657
|
-
|
|
658
636
|
export declare interface ConnectionData<T extends ComponentRequest> {
|
|
659
637
|
readonly tx: T;
|
|
660
638
|
readonly authToken?: string;
|
|
@@ -753,6 +731,23 @@ export declare type ConnectionResult<T extends ComponentRequest> = {
|
|
|
753
731
|
|
|
754
732
|
export declare type ConnectionStatus = 'active' | 'completed' | 'closed';
|
|
755
733
|
|
|
734
|
+
/**
|
|
735
|
+
* Configuration for the terms and conditions consent checkbox.
|
|
736
|
+
*
|
|
737
|
+
* @remarks
|
|
738
|
+
* - `undefined` or `true`: show default T&C (current behavior)
|
|
739
|
+
* - `false`: hide T&C entirely
|
|
740
|
+
* - `{ label?, description? }`: show with custom text (translations are the customer's responsibility)
|
|
741
|
+
*
|
|
742
|
+
* @public
|
|
743
|
+
*/
|
|
744
|
+
export declare type ConsentConfig = boolean | {
|
|
745
|
+
/** Custom label text. Replaces the default "Accept terms and conditions". */
|
|
746
|
+
label?: string;
|
|
747
|
+
/** Custom description text. Replaces the default sharing-info description. */
|
|
748
|
+
description?: string;
|
|
749
|
+
};
|
|
750
|
+
|
|
756
751
|
/**
|
|
757
752
|
* Configuration for the contact support action.
|
|
758
753
|
*
|
|
@@ -993,6 +988,7 @@ export declare class EmbeddedComponent<V, O> {
|
|
|
993
988
|
private iframe?;
|
|
994
989
|
private eventManager;
|
|
995
990
|
private modal?;
|
|
991
|
+
private messageHandler?;
|
|
996
992
|
/**
|
|
997
993
|
* Creates an instance of EmbeddedComponent.
|
|
998
994
|
* @param url - The URL of the embedded component
|
|
@@ -3265,24 +3261,6 @@ export declare interface Transaction extends ComponentRequest {
|
|
|
3265
3261
|
*/
|
|
3266
3262
|
export declare type TransactionAsset = NotabeneAsset | CAIP19 | DTI;
|
|
3267
3263
|
|
|
3268
|
-
export declare interface TransactionCreateRequest {
|
|
3269
|
-
transactionAsset: any;
|
|
3270
|
-
transactionAmount: string;
|
|
3271
|
-
beneficiaryDid?: string;
|
|
3272
|
-
originatorVASPdid: string;
|
|
3273
|
-
beneficiaryVASPdid?: string;
|
|
3274
|
-
beneficiaryVASPname?: string;
|
|
3275
|
-
beneficiaryVASPwebsite?: string;
|
|
3276
|
-
transactionBlockchainInfo: {
|
|
3277
|
-
origin?: string;
|
|
3278
|
-
destination?: string;
|
|
3279
|
-
};
|
|
3280
|
-
beneficiaryProof?: any;
|
|
3281
|
-
beneficiary?: any;
|
|
3282
|
-
originator?: any;
|
|
3283
|
-
originatorEqualsBeneficiary?: boolean;
|
|
3284
|
-
}
|
|
3285
|
-
|
|
3286
3264
|
export declare interface TransactionCreateRequestV2 {
|
|
3287
3265
|
originator: {
|
|
3288
3266
|
'@id': string;
|
|
@@ -3330,12 +3308,8 @@ export declare interface TransactionOptions {
|
|
|
3330
3308
|
vasps?: VASPOptions;
|
|
3331
3309
|
hide?: ValidationSections[];
|
|
3332
3310
|
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
3311
|
contactSupport?: ContactSupportConfig;
|
|
3312
|
+
consent?: ConsentConfig;
|
|
3339
3313
|
autoSubmit?: boolean;
|
|
3340
3314
|
}
|
|
3341
3315
|
|