@notabene/javascript-sdk 2.19.1 → 2.20.0-next.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 +3 -3
- package/dist/cjs/notabene.d.ts +37 -1
- package/dist/cjs/package.json +1 -1
- package/dist/esm/notabene.d.ts +37 -1
- package/dist/esm/notabene.js +163 -156
- package/dist/esm/package.json +1 -1
- package/dist/notabene.d.ts +37 -1
- package/dist/notabene.js +163 -156
- package/package.json +1 -1
- package/src/notabene.ts +1 -0
- package/src/types.ts +17 -0
- package/src/utils/__tests__/connections.test.ts +29 -0
- package/src/utils/connections.ts +25 -1
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.20.0-next.1",
|
|
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
|
@@ -688,6 +688,14 @@ export declare interface ConnectionMetadata {
|
|
|
688
688
|
readonly participants: readonly string[];
|
|
689
689
|
readonly transactionType: TransactionType;
|
|
690
690
|
readonly locale?: string;
|
|
691
|
+
/**
|
|
692
|
+
* Delivery target for Counterparty Assist completion/closure webhooks.
|
|
693
|
+
* Sent and stored as plaintext so the connection can route the event, so do not
|
|
694
|
+
* embed secrets (e.g. `?token=`) in this URL. Webhook payloads carry the encrypted
|
|
695
|
+
* `sealed` blob, whose successful decryption is itself an authenticity check;
|
|
696
|
+
* signed delivery is provided by the future Svix-backed pipeline.
|
|
697
|
+
*/
|
|
698
|
+
readonly webhookUrl?: string;
|
|
691
699
|
}
|
|
692
700
|
|
|
693
701
|
/**
|
|
@@ -832,6 +840,17 @@ export declare type CounterpartyAssistConfig = boolean | {
|
|
|
832
840
|
counterpartyTypes: PersonType[];
|
|
833
841
|
/** @remarks Requires a transactionId to be passed in. */
|
|
834
842
|
identityVerification?: IdentityVerificationConfig;
|
|
843
|
+
/**
|
|
844
|
+
* Optional URL that receives an `EC.counterpartyAssist*` webhook when the
|
|
845
|
+
* counterparty completes or closes their part. MVP-only per-link override;
|
|
846
|
+
* superseded by Portal-managed subscriptions post-migration.
|
|
847
|
+
*
|
|
848
|
+
* Transmitted and stored as plaintext, so do not embed secrets (e.g. `?token=`)
|
|
849
|
+
* in this URL. Payloads carry the encrypted `sealed` blob (a successful decrypt
|
|
850
|
+
* is itself an authenticity check); signed delivery is provided by the future
|
|
851
|
+
* Svix-backed pipeline.
|
|
852
|
+
*/
|
|
853
|
+
webhookUrl?: string;
|
|
835
854
|
};
|
|
836
855
|
|
|
837
856
|
declare type CountryCode = "AF" | "AL" | "DZ" | "AS" | "AD" | "AO" | "AI" | "AQ" | "AG" | "AR" | "AM" | "AW" | "AU" | "AT" | "AZ" | "BS" | "BH" | "BD" | "BB" | "BY" | "BE" | "BZ" | "BJ" | "BM" | "BT" | "BO" | "BQ" | "BA" | "BW" | "BV" | "BR" | "IO" | "BN" | "BG" | "BF" | "BI" | "CV" | "KH" | "CM" | "CA" | "KY" | "CF" | "TD" | "CL" | "CN" | "CX" | "CC" | "CO" | "KM" | "CD" | "CG" | "CK" | "CR" | "HR" | "CU" | "CW" | "CY" | "CZ" | "CI" | "DK" | "DJ" | "DM" | "DO" | "EC" | "EG" | "SV" | "GQ" | "ER" | "EE" | "SZ" | "ET" | "FK" | "FO" | "FJ" | "FI" | "FR" | "GF" | "PF" | "TF" | "GA" | "GM" | "GE" | "DE" | "GH" | "GI" | "GR" | "GL" | "GD" | "GP" | "GU" | "GT" | "GG" | "GN" | "GW" | "GY" | "HT" | "HM" | "VA" | "HN" | "HK" | "HU" | "IS" | "IN" | "ID" | "IR" | "IQ" | "IE" | "IM" | "IL" | "IT" | "JM" | "JP" | "JE" | "JO" | "KZ" | "KE" | "KI" | "KP" | "KR" | "KW" | "KG" | "LA" | "LV" | "LB" | "LS" | "LR" | "LY" | "LI" | "LT" | "LU" | "MO" | "MG" | "MW" | "MY" | "MV" | "ML" | "MT" | "MH" | "MQ" | "MR" | "MU" | "YT" | "MX" | "FM" | "MD" | "MC" | "MN" | "ME" | "MS" | "MA" | "MZ" | "MM" | "NA" | "NR" | "NP" | "NL" | "NC" | "NZ" | "NI" | "NE" | "NG" | "NU" | "NF" | "MK" | "MP" | "NO" | "OM" | "PK" | "PW" | "PS" | "PA" | "PG" | "PY" | "PE" | "PH" | "PN" | "PL" | "PT" | "PR" | "QA" | "RO" | "RU" | "RW" | "RE" | "BL" | "SH" | "KN" | "LC" | "MF" | "PM" | "VC" | "WS" | "SM" | "ST" | "SA" | "SN" | "RS" | "SC" | "SL" | "SG" | "SX" | "SK" | "SI" | "SB" | "SO" | "ZA" | "GS" | "SS" | "ES" | "LK" | "SD" | "SR" | "SJ" | "SE" | "CH" | "SY" | "TW" | "TJ" | "TZ" | "TH" | "TL" | "TG" | "TK" | "TO" | "TT" | "TN" | "TR" | "TM" | "TC" | "TV" | "UG" | "UA" | "AE" | "GB" | "UM" | "US" | "UY" | "UZ" | "VU" | "VE" | "VN" | "VG" | "VI" | "WF" | "EH" | "YE" | "ZM" | "ZW" | "AX" | "XX";
|
|
@@ -872,6 +891,17 @@ export declare interface DeclarationProof extends OwnershipProof {
|
|
|
872
891
|
*/
|
|
873
892
|
export declare function decodeFragmentToObject(fragment: string): Record<string, string>;
|
|
874
893
|
|
|
894
|
+
/**
|
|
895
|
+
* Decrypt a Counterparty Assist webhook payload with the key the VASP captured
|
|
896
|
+
* at connection creation. Single call, no network fetch (the webhook already
|
|
897
|
+
* carried the ciphertext).
|
|
898
|
+
* @public
|
|
899
|
+
*/
|
|
900
|
+
export declare function decryptCounterpartyAssistPayload<T>({ sealed, key, }: {
|
|
901
|
+
sealed: string;
|
|
902
|
+
key: string;
|
|
903
|
+
}): Promise<T>;
|
|
904
|
+
|
|
875
905
|
/**
|
|
876
906
|
* An object representing a deposit transaction
|
|
877
907
|
* @public
|
|
@@ -1117,7 +1147,7 @@ export declare type FieldTypes = {
|
|
|
1117
1147
|
* @param refreshSource Source information for the refresh operation
|
|
1118
1148
|
* @returns Promise resolving to connection result with decrypted data
|
|
1119
1149
|
*/
|
|
1120
|
-
export declare function getRefreshResult<T extends ComponentRequest>(refreshSource: RefreshSource): Promise<ConnectionResult<T>>;
|
|
1150
|
+
export declare function getRefreshResult<T extends ComponentRequest>(refreshSource: Pick<RefreshSource, 'url' | 'key'>): Promise<ConnectionResult<T>>;
|
|
1121
1151
|
|
|
1122
1152
|
/**
|
|
1123
1153
|
* Host Message Type enum representing different message types that can be sent
|
|
@@ -2837,6 +2867,12 @@ declare interface Refreshable {
|
|
|
2837
2867
|
export declare interface RefreshSource {
|
|
2838
2868
|
url: URI;
|
|
2839
2869
|
key: string;
|
|
2870
|
+
/**
|
|
2871
|
+
* The connection id (also embedded in `url`). Exposed directly so consumers can
|
|
2872
|
+
* correlate a Counterparty Assist webhook event (whose `payload.id` is this id)
|
|
2873
|
+
* without parsing it out of the url.
|
|
2874
|
+
*/
|
|
2875
|
+
id: string;
|
|
2840
2876
|
}
|
|
2841
2877
|
|
|
2842
2878
|
declare type RequestID = UUID;
|