@fyul/embed-sdk 2.7.54 → 2.7.55

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.
Files changed (31) hide show
  1. package/dist/cjs/modules/eventTypes.d.ts +1 -1
  2. package/dist/cjs/modules/events.d.ts +4 -0
  3. package/dist/cjs/modules/white-label/events.d.ts +4 -0
  4. package/dist/cjs/modules/white-label/events.js +2 -0
  5. package/dist/cjs/modules/white-label/types/data.types.d.ts +6 -0
  6. package/dist/cjs/modules/white-label/types/event/actionEventPayload.types.d.ts +2 -1
  7. package/dist/cjs/modules/white-label/types/event/resultEvent.types.d.ts +3 -2
  8. package/dist/cjs/modules/white-label/types/event/resultEventPayload.types.d.ts +5 -1
  9. package/dist/cjs/modules/white-label/whiteLabelModule.d.ts +2 -1
  10. package/dist/cjs/modules/white-label/whiteLabelModule.js +4 -0
  11. package/dist/cjs/services/whiteLabel.d.ts +1 -0
  12. package/dist/cjs/services/whiteLabel.js +4 -0
  13. package/dist/cjs/types/module/module.types.d.ts +2 -1
  14. package/dist/cjs/version.d.ts +1 -1
  15. package/dist/cjs/version.js +1 -1
  16. package/dist/esm/modules/eventTypes.d.ts +1 -1
  17. package/dist/esm/modules/events.d.ts +4 -0
  18. package/dist/esm/modules/white-label/events.d.ts +4 -0
  19. package/dist/esm/modules/white-label/events.js +2 -0
  20. package/dist/esm/modules/white-label/types/data.types.d.ts +6 -0
  21. package/dist/esm/modules/white-label/types/event/actionEventPayload.types.d.ts +2 -1
  22. package/dist/esm/modules/white-label/types/event/resultEvent.types.d.ts +3 -2
  23. package/dist/esm/modules/white-label/types/event/resultEventPayload.types.d.ts +5 -1
  24. package/dist/esm/modules/white-label/whiteLabelModule.d.ts +2 -1
  25. package/dist/esm/modules/white-label/whiteLabelModule.js +4 -0
  26. package/dist/esm/services/whiteLabel.d.ts +1 -0
  27. package/dist/esm/services/whiteLabel.js +4 -0
  28. package/dist/esm/types/module/module.types.d.ts +2 -1
  29. package/dist/esm/version.d.ts +1 -1
  30. package/dist/esm/version.js +1 -1
  31. package/package.json +1 -1
@@ -7,5 +7,5 @@ export declare const EVENT_TYPES: {
7
7
  };
8
8
  export declare function isAction(event: AnyEvent): event is import("./sdk/types").InitializeSdkAction | import("./sdk/types").LoadModuleAction | import("./mockup-generation/types").GetMockupsAction | import("./mockup-generation/types").GetMoreMockupsAction | import("./mockup-generation/types").AdjustMockupAction | import("./edm/types").InitializeEdmAction | import("./edm/types").SaveDesignAction | import("./edm/types").AddImageAction | import("./edm/types").NavigateStepAction | import("./white-label/types").InitializeWhiteLabelAction | import("./catalog/types").GetCatalogCategoriesAction | import("./catalog/types").GetCatalogProductsByIdsAction | import("./catalog/types").GetCatalogProductsAction | import("./catalog/types").GetSingleCatalogProductAction | import("./product-publish/types").DeleteProductsAction | import("./product-publish/types").GetSavedProductsAction | import("./product-publish/types").GetProductPublishAction | import("./embed-studio/types").InitializeEmbedStudioAction | import("./embed-studio/types").SaveDesignAction;
9
9
  export declare function isNotification(event: AnyEvent): event is import("..").NotificationEvent;
10
- export declare function isResult(event: AnyEvent): event is import("./catalog/types").GetCatalogProductsResult | import("./catalog/types").GetSingleCatalogProductResult | import("./catalog/types").GetCatalogCategoriesResult | import("./product-publish/types").GetProductPublishResult | import("./product-publish/types").GetSavedProductsResult | import("./product-publish/types").GetSavedProductMockupsResult | import("./product-publish/types").DeleteProductsResult | import("./edm/types").SaveDesignResultEvent | import("./edm/types").AddImageResultEvent | import("./edm/types").SetStyleResultEvent | import("./edm/types").NavigateStepResultEvent | import("./embed-studio/types").SaveDesignResultEvent | import("./mockup-generation/types").GetMockupsResultEvent | import("./mockup-generation/types").GetMoreMockupsResultEvent | import("./mockup-generation/types").AdjustMockupResultEvent | import("./white-label/types").GoToViewResultEvent;
10
+ export declare function isResult(event: AnyEvent): event is import("./catalog/types").GetCatalogProductsResult | import("./catalog/types").GetSingleCatalogProductResult | import("./catalog/types").GetCatalogCategoriesResult | import("./product-publish/types").GetProductPublishResult | import("./product-publish/types").GetSavedProductsResult | import("./product-publish/types").GetSavedProductMockupsResult | import("./product-publish/types").DeleteProductsResult | import("./edm/types").SaveDesignResultEvent | import("./edm/types").AddImageResultEvent | import("./edm/types").SetStyleResultEvent | import("./edm/types").NavigateStepResultEvent | import("./embed-studio/types").SaveDesignResultEvent | import("./mockup-generation/types").GetMockupsResultEvent | import("./mockup-generation/types").GetMoreMockupsResultEvent | import("./mockup-generation/types").AdjustMockupResultEvent | import("./white-label/types").GoToViewResultEvent | import("./white-label/types").GetAvailableRoutesResultEvent;
11
11
  export declare function isBroadcast(event: AnyEvent): event is import("./edm/types/event/broadcastEvent.types").OnDesignStatusUpdateBroadcast | import("./edm/types/event/broadcastEvent.types").OnPricingStatusUpdateBroadcast | import("./edm/types/event/broadcastEvent.types").OnFilePickerRequestBroadcast | import("./edm/types/event/broadcastEvent.types").OnStepStatusUpdateBroadcast | import("./edm/types/event/broadcastEvent.types").OnErrorUpdateBroadcast | import("./white-label/types").OnShoppingCartUpdateBroadcast | import("./white-label/types").OnContentSizeChangeBroadcast;
@@ -1,6 +1,7 @@
1
1
  export declare const ALL_ACTION_EVENTS: {
2
2
  readonly INITIALIZE_WHITE_LABEL: "actionInitializeWhiteLabel";
3
3
  readonly GO_TO_VIEW: "actionGoToView";
4
+ readonly GET_AVAILABLE_ROUTES: "actionGetAvailableRoutes";
4
5
  readonly INITIALIZE_EMBED_STUDIO: "actionInitializeEdm";
5
6
  readonly SAVE_DESIGN: "actionSaveDesign";
6
7
  readonly INITIALIZE_EDM: "actionInitializeEdm";
@@ -45,6 +46,7 @@ export declare const ALL_NOTIFICATION_EVENTS: {
45
46
  };
46
47
  export declare const ALL_RESULT_EVENTS: {
47
48
  readonly GO_TO_VIEW_RESULT: "resultGoToView";
49
+ readonly GET_AVAILABLE_ROUTES_RESULT: "resultGetAvailableRoutes";
48
50
  readonly SAVE_DESIGN_RESULT: "resultSaveDesign";
49
51
  readonly ADD_IMAGE_RESULT: "resultAddImage";
50
52
  readonly SET_STYLE_RESULT: "resultSetStyle";
@@ -78,6 +80,7 @@ export declare const ALL_EVENTS: {
78
80
  readonly ON_FILE_PICKER_REQUESTED: "onFilePickerRequested";
79
81
  readonly ON_STEP_STATUS_UPDATE: "onStepStatusUpdate";
80
82
  readonly GO_TO_VIEW_RESULT: "resultGoToView";
83
+ readonly GET_AVAILABLE_ROUTES_RESULT: "resultGetAvailableRoutes";
81
84
  readonly SAVE_DESIGN_RESULT: "resultSaveDesign";
82
85
  readonly ADD_IMAGE_RESULT: "resultAddImage";
83
86
  readonly SET_STYLE_RESULT: "resultSetStyle";
@@ -114,6 +117,7 @@ export declare const ALL_EVENTS: {
114
117
  readonly SDK_INITIALIZATION_SUCCESS: "notificationSdkInitializationSuccess";
115
118
  readonly INITIALIZE_WHITE_LABEL: "actionInitializeWhiteLabel";
116
119
  readonly GO_TO_VIEW: "actionGoToView";
120
+ readonly GET_AVAILABLE_ROUTES: "actionGetAvailableRoutes";
117
121
  readonly INITIALIZE_EMBED_STUDIO: "actionInitializeEdm";
118
122
  readonly SAVE_DESIGN: "actionSaveDesign";
119
123
  readonly INITIALIZE_EDM: "actionInitializeEdm";
@@ -1,6 +1,7 @@
1
1
  export declare const EVENTS_ACTION: {
2
2
  readonly INITIALIZE_WHITE_LABEL: "actionInitializeWhiteLabel";
3
3
  readonly GO_TO_VIEW: "actionGoToView";
4
+ readonly GET_AVAILABLE_ROUTES: "actionGetAvailableRoutes";
4
5
  };
5
6
  export declare const EVENTS_NOTIFICATION: {
6
7
  readonly WHITE_LABEL_INITIALIZATION_FAILURE: "notificationWhiteLabelInitializationFailure";
@@ -9,6 +10,7 @@ export declare const EVENTS_NOTIFICATION: {
9
10
  };
10
11
  export declare const EVENTS_RESULT: {
11
12
  readonly GO_TO_VIEW_RESULT: "resultGoToView";
13
+ readonly GET_AVAILABLE_ROUTES_RESULT: "resultGetAvailableRoutes";
12
14
  };
13
15
  export declare const EVENT_BROADCAST: {
14
16
  readonly ON_SHOPPING_CART_UPDATE: "onShoppingCartUpdate";
@@ -18,9 +20,11 @@ export declare const EVENTS: {
18
20
  readonly ON_SHOPPING_CART_UPDATE: "onShoppingCartUpdate";
19
21
  readonly ON_CONTENT_SIZE_CHANGE: "onContentSizeChange";
20
22
  readonly GO_TO_VIEW_RESULT: "resultGoToView";
23
+ readonly GET_AVAILABLE_ROUTES_RESULT: "resultGetAvailableRoutes";
21
24
  readonly WHITE_LABEL_INITIALIZATION_FAILURE: "notificationWhiteLabelInitializationFailure";
22
25
  readonly WHITE_LABEL_INITIALIZATION_SUCCESS: "notificationWhiteLabelInitializationSuccess";
23
26
  readonly GO_TO_VIEW_FAILURE: "actionGoToViewFailure";
24
27
  readonly INITIALIZE_WHITE_LABEL: "actionInitializeWhiteLabel";
25
28
  readonly GO_TO_VIEW: "actionGoToView";
29
+ readonly GET_AVAILABLE_ROUTES: "actionGetAvailableRoutes";
26
30
  };
@@ -4,6 +4,7 @@ exports.EVENTS = exports.EVENT_BROADCAST = exports.EVENTS_RESULT = exports.EVENT
4
4
  exports.EVENTS_ACTION = {
5
5
  INITIALIZE_WHITE_LABEL: 'actionInitializeWhiteLabel',
6
6
  GO_TO_VIEW: 'actionGoToView',
7
+ GET_AVAILABLE_ROUTES: 'actionGetAvailableRoutes',
7
8
  };
8
9
  exports.EVENTS_NOTIFICATION = {
9
10
  WHITE_LABEL_INITIALIZATION_FAILURE: 'notificationWhiteLabelInitializationFailure',
@@ -12,6 +13,7 @@ exports.EVENTS_NOTIFICATION = {
12
13
  };
13
14
  exports.EVENTS_RESULT = {
14
15
  GO_TO_VIEW_RESULT: 'resultGoToView',
16
+ GET_AVAILABLE_ROUTES_RESULT: 'resultGetAvailableRoutes',
15
17
  };
16
18
  exports.EVENT_BROADCAST = {
17
19
  ON_SHOPPING_CART_UPDATE: 'onShoppingCartUpdate',
@@ -12,6 +12,7 @@ export type WhiteLabelParams = ({
12
12
  } & WhiteLabelCommonParams);
13
13
  export interface WhiteLabelCommonParams {
14
14
  jwt: string;
15
+ userFlow: 'd2c' | 'retail' | 'creator';
15
16
  iframeClassName?: string;
16
17
  debug?: boolean;
17
18
  }
@@ -32,6 +33,11 @@ export interface OnShoppingCartUpdateEvent {
32
33
  export interface OnContentSizeChangeEvent {
33
34
  height: number;
34
35
  }
36
+ export type AvailableRouteInfo = {
37
+ name: string;
38
+ title: string;
39
+ params: string[];
40
+ };
35
41
  export interface JWTData {
36
42
  tid: string;
37
43
  nce: string;
@@ -3,6 +3,7 @@ export type InitializeWhiteLabelPayload = WhiteLabelConfig & WhiteLabelCommonPar
3
3
  clientVersion: string;
4
4
  };
5
5
  export interface GoToViewPayload {
6
- view: string;
6
+ name: string;
7
+ params?: Record<string, string | number>;
7
8
  }
8
9
  export type ActionEventPayload = InitializeWhiteLabelPayload | GoToViewPayload;
@@ -1,5 +1,6 @@
1
1
  import { BaseResultEvent } from '../../../../types/event/result/resultEvent.types';
2
2
  import type { EVENTS_RESULT } from '../../../../modules/white-label/events';
3
- import { GoToViewResultPayload } from '../../../../modules/white-label/types';
3
+ import { GetAvailableRoutesResultPayload, GoToViewResultPayload } from '../../../../modules/white-label/types';
4
4
  export type GoToViewResultEvent = BaseResultEvent<typeof EVENTS_RESULT.GO_TO_VIEW_RESULT, GoToViewResultPayload>;
5
- export type ResultEvent = GoToViewResultEvent;
5
+ export type GetAvailableRoutesResultEvent = BaseResultEvent<typeof EVENTS_RESULT.GET_AVAILABLE_ROUTES_RESULT, GetAvailableRoutesResultPayload>;
6
+ export type ResultEvent = GoToViewResultEvent | GetAvailableRoutesResultEvent;
@@ -1,7 +1,11 @@
1
+ import { AvailableRouteInfo } from '../../../../modules/white-label/types/data.types';
1
2
  export type SetupNotificationPayload = {
2
3
  error: Error | null;
3
4
  };
4
5
  export type GoToViewResultPayload = {
5
6
  success: boolean;
6
7
  };
7
- export type WhiteLabelResultPayload = GoToViewResultPayload;
8
+ export type GetAvailableRoutesResultPayload = {
9
+ routes: AvailableRouteInfo[];
10
+ };
11
+ export type WhiteLabelResultPayload = GoToViewResultPayload | GetAvailableRoutesResultPayload;
@@ -1,9 +1,10 @@
1
1
  import { IWhiteLabelModule } from '../../types/module/module.types';
2
2
  import { BaseModule } from '../../modules/baseModule';
3
- import { InitializeWhiteLabelPayload, GoToViewPayload, GoToViewResultPayload, SetupNotificationPayload } from './types';
3
+ import { InitializeWhiteLabelPayload, GoToViewPayload, GoToViewResultPayload, GetAvailableRoutesResultPayload, SetupNotificationPayload } from './types';
4
4
  import { PromisifyMethods, WithHandledResponses } from '../../helpers/typeHelper.types';
5
5
  export declare class WhiteLabelModule extends BaseModule implements Omit<WithHandledResponses<IWhiteLabelModule>, 'setup'>, Pick<PromisifyMethods<IWhiteLabelModule>, 'setup'> {
6
6
  constructor();
7
7
  setup(payload: InitializeWhiteLabelPayload): Promise<SetupNotificationPayload>;
8
8
  goToView(event: GoToViewPayload): Promise<import("../..").HandledResponse<GoToViewResultPayload, Error>>;
9
+ getAvailableRoutes(): Promise<import("../..").HandledResponse<GetAvailableRoutesResultPayload, Error>>;
9
10
  }
@@ -20,5 +20,9 @@ class WhiteLabelModule extends baseModule_1.BaseModule {
20
20
  const response = await this.sendRequest(events_1.EVENTS_ACTION.GO_TO_VIEW, event).catch((e) => e);
21
21
  return (0, responseHandler_1.handleResponse)(response, 'Failed to navigate to view');
22
22
  }
23
+ async getAvailableRoutes() {
24
+ const response = await this.sendRequest(events_1.EVENTS_ACTION.GET_AVAILABLE_ROUTES).catch((e) => e);
25
+ return (0, responseHandler_1.handleResponse)(response, 'Failed to get available routes');
26
+ }
23
27
  }
24
28
  exports.WhiteLabelModule = WhiteLabelModule;
@@ -20,5 +20,6 @@ export declare class WhiteLabel {
20
20
  }>;
21
21
  destroy(): void;
22
22
  goToView(payload: GoToViewPayload): Promise<import("..").HandledResponse<import("../modules/white-label/types").GoToViewResultPayload, Error>>;
23
+ getAvailableRoutes(): Promise<import("..").HandledResponse<import("../modules/white-label/types").GetAvailableRoutesResultPayload, Error>>;
23
24
  static getBroadCastEventHandler(): WhiteLabelBroadcastModule;
24
25
  }
@@ -100,6 +100,10 @@ class WhiteLabel {
100
100
  const whiteLabelModule = this.moduleLoader.getModule(moduleNames_1.MODULE_NAMES.WHITE_LABEL);
101
101
  return whiteLabelModule.goToView(payload);
102
102
  }
103
+ getAvailableRoutes() {
104
+ const whiteLabelModule = this.moduleLoader.getModule(moduleNames_1.MODULE_NAMES.WHITE_LABEL);
105
+ return whiteLabelModule.getAvailableRoutes();
106
+ }
103
107
  static getBroadCastEventHandler() {
104
108
  if (!WhiteLabel.broadCastEventHandler) {
105
109
  throw new Error('No active WhiteLabelBroadcastModule instance');
@@ -8,7 +8,7 @@ import { OnDesignStatusEventPayload, OnErrorEventPayload, OnFilePickerRequestedE
8
8
  import { OnDesignStatusEventPayload as EmbedStudioOnDesignStatusEventPayload, OnErrorEventPayload as EmbedStudioOnErrorEventPayload } from '../../modules/embed-studio/types/event/broadcastEventPayload.types';
9
9
  import { AddImagePayload, AddImageResultPayload, InitializeEdmPayload, NavigateStepPayload, NavigateStepResultPayload, SaveDesignResultPayload, SetStylePayload, SetStyleResultPayload } from '../../modules/edm/types';
10
10
  import { InitializeEmbedStudioPayload, SaveDesignResultPayload as EmbedStudioSaveDesignResultPayload } from '../../modules/embed-studio/types';
11
- import { InitializeWhiteLabelPayload, GoToViewResultPayload, GoToViewPayload, SetupNotificationPayload } from '../../modules/white-label/types';
11
+ import { InitializeWhiteLabelPayload, GoToViewResultPayload, GoToViewPayload, SetupNotificationPayload, GetAvailableRoutesResultPayload } from '../../modules/white-label/types';
12
12
  import { OnShoppingCartUpdateEventPayload, OnContentSizeChangeEventPayload } from '../../modules/white-label/types/event/broadcastEventPayload.types';
13
13
  /** This file ensures that Iframe and SDK has the same source of truth for return values */
14
14
  export type ModuleName = (typeof MODULE_NAMES)[keyof typeof MODULE_NAMES];
@@ -55,6 +55,7 @@ export interface IEmbedStudioBroadcastModule {
55
55
  export interface IWhiteLabelModule {
56
56
  setup(config: InitializeWhiteLabelPayload): SetupNotificationPayload;
57
57
  goToView(event: GoToViewPayload): GoToViewResultPayload;
58
+ getAvailableRoutes(): GetAvailableRoutesResultPayload;
58
59
  }
59
60
  export interface IWhiteLabelBroadcastModule {
60
61
  onShoppingCartUpdate(event: OnShoppingCartUpdateEventPayload): void;
@@ -1 +1 @@
1
- export declare const VERSION: "2.7.54";
1
+ export declare const VERSION: "2.7.55";
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  // AUTO-GENERATED
5
- exports.VERSION = '2.7.54';
5
+ exports.VERSION = '2.7.55';
@@ -7,5 +7,5 @@ export declare const EVENT_TYPES: {
7
7
  };
8
8
  export declare function isAction(event: AnyEvent): event is import("./sdk/types").InitializeSdkAction | import("./sdk/types").LoadModuleAction | import("./mockup-generation/types").GetMockupsAction | import("./mockup-generation/types").GetMoreMockupsAction | import("./mockup-generation/types").AdjustMockupAction | import("./edm/types").InitializeEdmAction | import("./edm/types").SaveDesignAction | import("./edm/types").AddImageAction | import("./edm/types").NavigateStepAction | import("./white-label/types").InitializeWhiteLabelAction | import("./catalog/types").GetCatalogCategoriesAction | import("./catalog/types").GetCatalogProductsByIdsAction | import("./catalog/types").GetCatalogProductsAction | import("./catalog/types").GetSingleCatalogProductAction | import("./product-publish/types").DeleteProductsAction | import("./product-publish/types").GetSavedProductsAction | import("./product-publish/types").GetProductPublishAction | import("./embed-studio/types").InitializeEmbedStudioAction | import("./embed-studio/types").SaveDesignAction;
9
9
  export declare function isNotification(event: AnyEvent): event is import("..").NotificationEvent;
10
- export declare function isResult(event: AnyEvent): event is import("./catalog/types").GetCatalogProductsResult | import("./catalog/types").GetSingleCatalogProductResult | import("./catalog/types").GetCatalogCategoriesResult | import("./product-publish/types").GetProductPublishResult | import("./product-publish/types").GetSavedProductsResult | import("./product-publish/types").GetSavedProductMockupsResult | import("./product-publish/types").DeleteProductsResult | import("./edm/types").SaveDesignResultEvent | import("./edm/types").AddImageResultEvent | import("./edm/types").SetStyleResultEvent | import("./edm/types").NavigateStepResultEvent | import("./embed-studio/types").SaveDesignResultEvent | import("./mockup-generation/types").GetMockupsResultEvent | import("./mockup-generation/types").GetMoreMockupsResultEvent | import("./mockup-generation/types").AdjustMockupResultEvent | import("./white-label/types").GoToViewResultEvent;
10
+ export declare function isResult(event: AnyEvent): event is import("./catalog/types").GetCatalogProductsResult | import("./catalog/types").GetSingleCatalogProductResult | import("./catalog/types").GetCatalogCategoriesResult | import("./product-publish/types").GetProductPublishResult | import("./product-publish/types").GetSavedProductsResult | import("./product-publish/types").GetSavedProductMockupsResult | import("./product-publish/types").DeleteProductsResult | import("./edm/types").SaveDesignResultEvent | import("./edm/types").AddImageResultEvent | import("./edm/types").SetStyleResultEvent | import("./edm/types").NavigateStepResultEvent | import("./embed-studio/types").SaveDesignResultEvent | import("./mockup-generation/types").GetMockupsResultEvent | import("./mockup-generation/types").GetMoreMockupsResultEvent | import("./mockup-generation/types").AdjustMockupResultEvent | import("./white-label/types").GoToViewResultEvent | import("./white-label/types").GetAvailableRoutesResultEvent;
11
11
  export declare function isBroadcast(event: AnyEvent): event is import("./edm/types/event/broadcastEvent.types").OnDesignStatusUpdateBroadcast | import("./edm/types/event/broadcastEvent.types").OnPricingStatusUpdateBroadcast | import("./edm/types/event/broadcastEvent.types").OnFilePickerRequestBroadcast | import("./edm/types/event/broadcastEvent.types").OnStepStatusUpdateBroadcast | import("./edm/types/event/broadcastEvent.types").OnErrorUpdateBroadcast | import("./white-label/types").OnShoppingCartUpdateBroadcast | import("./white-label/types").OnContentSizeChangeBroadcast;
@@ -1,6 +1,7 @@
1
1
  export declare const ALL_ACTION_EVENTS: {
2
2
  readonly INITIALIZE_WHITE_LABEL: "actionInitializeWhiteLabel";
3
3
  readonly GO_TO_VIEW: "actionGoToView";
4
+ readonly GET_AVAILABLE_ROUTES: "actionGetAvailableRoutes";
4
5
  readonly INITIALIZE_EMBED_STUDIO: "actionInitializeEdm";
5
6
  readonly SAVE_DESIGN: "actionSaveDesign";
6
7
  readonly INITIALIZE_EDM: "actionInitializeEdm";
@@ -45,6 +46,7 @@ export declare const ALL_NOTIFICATION_EVENTS: {
45
46
  };
46
47
  export declare const ALL_RESULT_EVENTS: {
47
48
  readonly GO_TO_VIEW_RESULT: "resultGoToView";
49
+ readonly GET_AVAILABLE_ROUTES_RESULT: "resultGetAvailableRoutes";
48
50
  readonly SAVE_DESIGN_RESULT: "resultSaveDesign";
49
51
  readonly ADD_IMAGE_RESULT: "resultAddImage";
50
52
  readonly SET_STYLE_RESULT: "resultSetStyle";
@@ -78,6 +80,7 @@ export declare const ALL_EVENTS: {
78
80
  readonly ON_FILE_PICKER_REQUESTED: "onFilePickerRequested";
79
81
  readonly ON_STEP_STATUS_UPDATE: "onStepStatusUpdate";
80
82
  readonly GO_TO_VIEW_RESULT: "resultGoToView";
83
+ readonly GET_AVAILABLE_ROUTES_RESULT: "resultGetAvailableRoutes";
81
84
  readonly SAVE_DESIGN_RESULT: "resultSaveDesign";
82
85
  readonly ADD_IMAGE_RESULT: "resultAddImage";
83
86
  readonly SET_STYLE_RESULT: "resultSetStyle";
@@ -114,6 +117,7 @@ export declare const ALL_EVENTS: {
114
117
  readonly SDK_INITIALIZATION_SUCCESS: "notificationSdkInitializationSuccess";
115
118
  readonly INITIALIZE_WHITE_LABEL: "actionInitializeWhiteLabel";
116
119
  readonly GO_TO_VIEW: "actionGoToView";
120
+ readonly GET_AVAILABLE_ROUTES: "actionGetAvailableRoutes";
117
121
  readonly INITIALIZE_EMBED_STUDIO: "actionInitializeEdm";
118
122
  readonly SAVE_DESIGN: "actionSaveDesign";
119
123
  readonly INITIALIZE_EDM: "actionInitializeEdm";
@@ -1,6 +1,7 @@
1
1
  export declare const EVENTS_ACTION: {
2
2
  readonly INITIALIZE_WHITE_LABEL: "actionInitializeWhiteLabel";
3
3
  readonly GO_TO_VIEW: "actionGoToView";
4
+ readonly GET_AVAILABLE_ROUTES: "actionGetAvailableRoutes";
4
5
  };
5
6
  export declare const EVENTS_NOTIFICATION: {
6
7
  readonly WHITE_LABEL_INITIALIZATION_FAILURE: "notificationWhiteLabelInitializationFailure";
@@ -9,6 +10,7 @@ export declare const EVENTS_NOTIFICATION: {
9
10
  };
10
11
  export declare const EVENTS_RESULT: {
11
12
  readonly GO_TO_VIEW_RESULT: "resultGoToView";
13
+ readonly GET_AVAILABLE_ROUTES_RESULT: "resultGetAvailableRoutes";
12
14
  };
13
15
  export declare const EVENT_BROADCAST: {
14
16
  readonly ON_SHOPPING_CART_UPDATE: "onShoppingCartUpdate";
@@ -18,9 +20,11 @@ export declare const EVENTS: {
18
20
  readonly ON_SHOPPING_CART_UPDATE: "onShoppingCartUpdate";
19
21
  readonly ON_CONTENT_SIZE_CHANGE: "onContentSizeChange";
20
22
  readonly GO_TO_VIEW_RESULT: "resultGoToView";
23
+ readonly GET_AVAILABLE_ROUTES_RESULT: "resultGetAvailableRoutes";
21
24
  readonly WHITE_LABEL_INITIALIZATION_FAILURE: "notificationWhiteLabelInitializationFailure";
22
25
  readonly WHITE_LABEL_INITIALIZATION_SUCCESS: "notificationWhiteLabelInitializationSuccess";
23
26
  readonly GO_TO_VIEW_FAILURE: "actionGoToViewFailure";
24
27
  readonly INITIALIZE_WHITE_LABEL: "actionInitializeWhiteLabel";
25
28
  readonly GO_TO_VIEW: "actionGoToView";
29
+ readonly GET_AVAILABLE_ROUTES: "actionGetAvailableRoutes";
26
30
  };
@@ -1,6 +1,7 @@
1
1
  export const EVENTS_ACTION = {
2
2
  INITIALIZE_WHITE_LABEL: 'actionInitializeWhiteLabel',
3
3
  GO_TO_VIEW: 'actionGoToView',
4
+ GET_AVAILABLE_ROUTES: 'actionGetAvailableRoutes',
4
5
  };
5
6
  export const EVENTS_NOTIFICATION = {
6
7
  WHITE_LABEL_INITIALIZATION_FAILURE: 'notificationWhiteLabelInitializationFailure',
@@ -9,6 +10,7 @@ export const EVENTS_NOTIFICATION = {
9
10
  };
10
11
  export const EVENTS_RESULT = {
11
12
  GO_TO_VIEW_RESULT: 'resultGoToView',
13
+ GET_AVAILABLE_ROUTES_RESULT: 'resultGetAvailableRoutes',
12
14
  };
13
15
  export const EVENT_BROADCAST = {
14
16
  ON_SHOPPING_CART_UPDATE: 'onShoppingCartUpdate',
@@ -12,6 +12,7 @@ export type WhiteLabelParams = ({
12
12
  } & WhiteLabelCommonParams);
13
13
  export interface WhiteLabelCommonParams {
14
14
  jwt: string;
15
+ userFlow: 'd2c' | 'retail' | 'creator';
15
16
  iframeClassName?: string;
16
17
  debug?: boolean;
17
18
  }
@@ -32,6 +33,11 @@ export interface OnShoppingCartUpdateEvent {
32
33
  export interface OnContentSizeChangeEvent {
33
34
  height: number;
34
35
  }
36
+ export type AvailableRouteInfo = {
37
+ name: string;
38
+ title: string;
39
+ params: string[];
40
+ };
35
41
  export interface JWTData {
36
42
  tid: string;
37
43
  nce: string;
@@ -3,6 +3,7 @@ export type InitializeWhiteLabelPayload = WhiteLabelConfig & WhiteLabelCommonPar
3
3
  clientVersion: string;
4
4
  };
5
5
  export interface GoToViewPayload {
6
- view: string;
6
+ name: string;
7
+ params?: Record<string, string | number>;
7
8
  }
8
9
  export type ActionEventPayload = InitializeWhiteLabelPayload | GoToViewPayload;
@@ -1,5 +1,6 @@
1
1
  import { BaseResultEvent } from '../../../../types/event/result/resultEvent.types';
2
2
  import type { EVENTS_RESULT } from '../../../../modules/white-label/events';
3
- import { GoToViewResultPayload } from '../../../../modules/white-label/types';
3
+ import { GetAvailableRoutesResultPayload, GoToViewResultPayload } from '../../../../modules/white-label/types';
4
4
  export type GoToViewResultEvent = BaseResultEvent<typeof EVENTS_RESULT.GO_TO_VIEW_RESULT, GoToViewResultPayload>;
5
- export type ResultEvent = GoToViewResultEvent;
5
+ export type GetAvailableRoutesResultEvent = BaseResultEvent<typeof EVENTS_RESULT.GET_AVAILABLE_ROUTES_RESULT, GetAvailableRoutesResultPayload>;
6
+ export type ResultEvent = GoToViewResultEvent | GetAvailableRoutesResultEvent;
@@ -1,7 +1,11 @@
1
+ import { AvailableRouteInfo } from '../../../../modules/white-label/types/data.types';
1
2
  export type SetupNotificationPayload = {
2
3
  error: Error | null;
3
4
  };
4
5
  export type GoToViewResultPayload = {
5
6
  success: boolean;
6
7
  };
7
- export type WhiteLabelResultPayload = GoToViewResultPayload;
8
+ export type GetAvailableRoutesResultPayload = {
9
+ routes: AvailableRouteInfo[];
10
+ };
11
+ export type WhiteLabelResultPayload = GoToViewResultPayload | GetAvailableRoutesResultPayload;
@@ -1,9 +1,10 @@
1
1
  import { IWhiteLabelModule } from '../../types/module/module.types';
2
2
  import { BaseModule } from '../../modules/baseModule';
3
- import { InitializeWhiteLabelPayload, GoToViewPayload, GoToViewResultPayload, SetupNotificationPayload } from './types';
3
+ import { InitializeWhiteLabelPayload, GoToViewPayload, GoToViewResultPayload, GetAvailableRoutesResultPayload, SetupNotificationPayload } from './types';
4
4
  import { PromisifyMethods, WithHandledResponses } from '../../helpers/typeHelper.types';
5
5
  export declare class WhiteLabelModule extends BaseModule implements Omit<WithHandledResponses<IWhiteLabelModule>, 'setup'>, Pick<PromisifyMethods<IWhiteLabelModule>, 'setup'> {
6
6
  constructor();
7
7
  setup(payload: InitializeWhiteLabelPayload): Promise<SetupNotificationPayload>;
8
8
  goToView(event: GoToViewPayload): Promise<import("../..").HandledResponse<GoToViewResultPayload, Error>>;
9
+ getAvailableRoutes(): Promise<import("../..").HandledResponse<GetAvailableRoutesResultPayload, Error>>;
9
10
  }
@@ -17,4 +17,8 @@ export class WhiteLabelModule extends BaseModule {
17
17
  const response = await this.sendRequest(EVENTS_ACTION.GO_TO_VIEW, event).catch((e) => e);
18
18
  return handleResponse(response, 'Failed to navigate to view');
19
19
  }
20
+ async getAvailableRoutes() {
21
+ const response = await this.sendRequest(EVENTS_ACTION.GET_AVAILABLE_ROUTES).catch((e) => e);
22
+ return handleResponse(response, 'Failed to get available routes');
23
+ }
20
24
  }
@@ -20,5 +20,6 @@ export declare class WhiteLabel {
20
20
  }>;
21
21
  destroy(): void;
22
22
  goToView(payload: GoToViewPayload): Promise<import("..").HandledResponse<import("../modules/white-label/types").GoToViewResultPayload, Error>>;
23
+ getAvailableRoutes(): Promise<import("..").HandledResponse<import("../modules/white-label/types").GetAvailableRoutesResultPayload, Error>>;
23
24
  static getBroadCastEventHandler(): WhiteLabelBroadcastModule;
24
25
  }
@@ -97,6 +97,10 @@ export class WhiteLabel {
97
97
  const whiteLabelModule = this.moduleLoader.getModule(MODULE_NAMES.WHITE_LABEL);
98
98
  return whiteLabelModule.goToView(payload);
99
99
  }
100
+ getAvailableRoutes() {
101
+ const whiteLabelModule = this.moduleLoader.getModule(MODULE_NAMES.WHITE_LABEL);
102
+ return whiteLabelModule.getAvailableRoutes();
103
+ }
100
104
  static getBroadCastEventHandler() {
101
105
  if (!WhiteLabel.broadCastEventHandler) {
102
106
  throw new Error('No active WhiteLabelBroadcastModule instance');
@@ -8,7 +8,7 @@ import { OnDesignStatusEventPayload, OnErrorEventPayload, OnFilePickerRequestedE
8
8
  import { OnDesignStatusEventPayload as EmbedStudioOnDesignStatusEventPayload, OnErrorEventPayload as EmbedStudioOnErrorEventPayload } from '../../modules/embed-studio/types/event/broadcastEventPayload.types';
9
9
  import { AddImagePayload, AddImageResultPayload, InitializeEdmPayload, NavigateStepPayload, NavigateStepResultPayload, SaveDesignResultPayload, SetStylePayload, SetStyleResultPayload } from '../../modules/edm/types';
10
10
  import { InitializeEmbedStudioPayload, SaveDesignResultPayload as EmbedStudioSaveDesignResultPayload } from '../../modules/embed-studio/types';
11
- import { InitializeWhiteLabelPayload, GoToViewResultPayload, GoToViewPayload, SetupNotificationPayload } from '../../modules/white-label/types';
11
+ import { InitializeWhiteLabelPayload, GoToViewResultPayload, GoToViewPayload, SetupNotificationPayload, GetAvailableRoutesResultPayload } from '../../modules/white-label/types';
12
12
  import { OnShoppingCartUpdateEventPayload, OnContentSizeChangeEventPayload } from '../../modules/white-label/types/event/broadcastEventPayload.types';
13
13
  /** This file ensures that Iframe and SDK has the same source of truth for return values */
14
14
  export type ModuleName = (typeof MODULE_NAMES)[keyof typeof MODULE_NAMES];
@@ -55,6 +55,7 @@ export interface IEmbedStudioBroadcastModule {
55
55
  export interface IWhiteLabelModule {
56
56
  setup(config: InitializeWhiteLabelPayload): SetupNotificationPayload;
57
57
  goToView(event: GoToViewPayload): GoToViewResultPayload;
58
+ getAvailableRoutes(): GetAvailableRoutesResultPayload;
58
59
  }
59
60
  export interface IWhiteLabelBroadcastModule {
60
61
  onShoppingCartUpdate(event: OnShoppingCartUpdateEventPayload): void;
@@ -1 +1 @@
1
- export declare const VERSION: "2.7.54";
1
+ export declare const VERSION: "2.7.55";
@@ -1,2 +1,2 @@
1
1
  // AUTO-GENERATED
2
- export const VERSION = '2.7.54';
2
+ export const VERSION = '2.7.55';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fyul/embed-sdk",
3
- "version": "2.7.54",
3
+ "version": "2.7.55",
4
4
  "description": "",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",