@melio-eng/web-sdk 1.0.26-pr.52.57a5a1b → 1.0.26
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/index.js +3 -4
- package/dist/types.d.ts +2 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -108,8 +108,8 @@ class Flow {
|
|
|
108
108
|
case 'ONBOARDING_COMPLETED':
|
|
109
109
|
this.emit('completed', { flowName: 'onboarding', ...data });
|
|
110
110
|
break;
|
|
111
|
-
case '
|
|
112
|
-
this.emit('loaded'
|
|
111
|
+
case 'READY_FOR_INTERACTION':
|
|
112
|
+
this.emit('loaded');
|
|
113
113
|
break;
|
|
114
114
|
case 'MELIO_ERROR':
|
|
115
115
|
if (data.code === 'failed_to_sync_bills') {
|
|
@@ -237,13 +237,12 @@ class SettingsFlow extends Flow {
|
|
|
237
237
|
class PaymentsDashboardFlow extends Flow {
|
|
238
238
|
constructor(containerId, config, partnerName, environment, branchOverride) {
|
|
239
239
|
super(containerId, config, partnerName, environment, branchOverride);
|
|
240
|
-
this.paymentId = config.paymentId;
|
|
241
240
|
}
|
|
242
241
|
/**
|
|
243
242
|
* Construct the specific flow URL for payments dashboard
|
|
244
243
|
*/
|
|
245
244
|
constructFlowUrl(baseUrl) {
|
|
246
|
-
return `${baseUrl}/${this.partnerName}/pay-dashboard/payments
|
|
245
|
+
return `${baseUrl}/${this.partnerName}/pay-dashboard/payments`;
|
|
247
246
|
}
|
|
248
247
|
}
|
|
249
248
|
const isEmptyString = (str) => {
|
package/dist/types.d.ts
CHANGED
|
@@ -64,7 +64,6 @@ export interface SettingsConfig extends BaseFlowConfig {
|
|
|
64
64
|
* Configuration for payments dashboard flow
|
|
65
65
|
*/
|
|
66
66
|
export interface PaymentsDashboardConfig extends BaseFlowConfig {
|
|
67
|
-
paymentId?: string;
|
|
68
67
|
}
|
|
69
68
|
/**
|
|
70
69
|
* Configuration for init flow
|
|
@@ -98,13 +97,6 @@ export interface FlowCompletionData {
|
|
|
98
97
|
export interface ErrorData {
|
|
99
98
|
errorCode: 'billsSyncFailed';
|
|
100
99
|
}
|
|
101
|
-
/**
|
|
102
|
-
* Flow loaded data
|
|
103
|
-
*/
|
|
104
|
-
export interface FlowLoadedData {
|
|
105
|
-
/** The name of the flow that was loaded */
|
|
106
|
-
flowName: 'onboarding' | 'payment' | 'settings' | 'dashboard';
|
|
107
|
-
}
|
|
108
100
|
/**
|
|
109
101
|
* Event types that can be listened to
|
|
110
102
|
*/
|
|
@@ -112,7 +104,7 @@ export type FlowEventType = 'completed' | 'exit' | 'navigated' | 'authentication
|
|
|
112
104
|
/**
|
|
113
105
|
* Event callback function types
|
|
114
106
|
*/
|
|
115
|
-
export type FlowEventCallback = ((data: FlowCompletionData | NavigationData | ErrorData
|
|
107
|
+
export type FlowEventCallback = ((data: FlowCompletionData | NavigationData | ErrorData) => void) | (() => void);
|
|
116
108
|
/**
|
|
117
109
|
* Flow instance interface for event handling
|
|
118
110
|
*/
|
|
@@ -128,7 +120,7 @@ export interface FlowInstance {
|
|
|
128
120
|
on(event: 'authenticationSucceeded', callback: () => void): void;
|
|
129
121
|
on(event: 'authenticationFailed', callback: () => void): void;
|
|
130
122
|
on(event: 'error', callback: (data: ErrorData) => void): void;
|
|
131
|
-
on(event: 'loaded', callback: (
|
|
123
|
+
on(event: 'loaded', callback: () => void): void;
|
|
132
124
|
/**
|
|
133
125
|
* Remove an event listener for this flow
|
|
134
126
|
* @param event - The event type to remove listener for
|
package/package.json
CHANGED