@melio-eng/web-sdk 1.0.24-pr.47.d32a400 → 1.0.24

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 CHANGED
@@ -4,7 +4,7 @@
4
4
  function getBaseUrl(environment) {
5
5
  switch (environment) {
6
6
  case 'production':
7
- return 'https://partnerships.melio.com';
7
+ return 'https://partnerships.production.melioservices.com';
8
8
  case 'staging01':
9
9
  return 'https://partnerships.staging01.melioservices.com';
10
10
  case 'public-qa':
@@ -108,6 +108,11 @@ class Flow {
108
108
  case 'ONBOARDING_COMPLETED':
109
109
  this.emit('completed', { flowName: 'onboarding', ...data });
110
110
  break;
111
+ case 'MELIO_ERROR':
112
+ if (data.code === 'failed_to_sync_bills') {
113
+ this.emit('error', { errorCode: 'billsSyncFailed' });
114
+ }
115
+ break;
111
116
  case 'HEIGHT_CHANGE':
112
117
  if (this.iframe) {
113
118
  this.iframe.style.height = `${data.height}px`;
package/dist/types.d.ts CHANGED
@@ -87,14 +87,20 @@ export interface FlowCompletionData {
87
87
  flowName: 'onboarding' | 'payment';
88
88
  [key: string]: any;
89
89
  }
90
+ /**
91
+ * Flow error data
92
+ */
93
+ export interface ErrorData {
94
+ errorCode: 'billsSyncFailed';
95
+ }
90
96
  /**
91
97
  * Event types that can be listened to
92
98
  */
93
- export type FlowEventType = 'completed' | 'exit' | 'navigated' | 'authenticationSucceeded' | 'authenticationFailed';
99
+ export type FlowEventType = 'completed' | 'exit' | 'navigated' | 'authenticationSucceeded' | 'authenticationFailed' | 'error';
94
100
  /**
95
101
  * Event callback function types
96
102
  */
97
- export type FlowEventCallback = ((data: FlowCompletionData | NavigationData) => void) | (() => void);
103
+ export type FlowEventCallback = ((data: FlowCompletionData | NavigationData | ErrorData) => void) | (() => void);
98
104
  /**
99
105
  * Flow instance interface for event handling
100
106
  */
@@ -109,6 +115,7 @@ export interface FlowInstance {
109
115
  on(event: 'navigated', callback: (payload: NavigationData) => void): void;
110
116
  on(event: 'authenticationSucceeded', callback: () => void): void;
111
117
  on(event: 'authenticationFailed', callback: () => void): void;
118
+ on(event: 'error', callback: (data: ErrorData) => void): void;
112
119
  /**
113
120
  * Remove an event listener for this flow
114
121
  * @param event - The event type to remove listener for
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@melio-eng/web-sdk",
3
- "version": "1.0.24-pr.47.d32a400",
3
+ "version": "1.0.24",
4
4
  "description": "Melio Web SDK - Embed core Melio workflows directly into partner UI with minimal effort",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",