@fyul/embed-sdk 2.7.53 → 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.
- package/dist/cjs/modules/embed-studio/embedStudioModule.d.ts +1 -2
- package/dist/cjs/modules/embed-studio/embedStudioModule.js +0 -4
- package/dist/cjs/modules/embed-studio/events.d.ts +0 -4
- package/dist/cjs/modules/embed-studio/events.js +0 -2
- package/dist/cjs/modules/embed-studio/types/data.types.d.ts +1 -0
- package/dist/cjs/modules/embed-studio/types/event/actionEvent.types.d.ts +2 -3
- package/dist/cjs/modules/embed-studio/types/event/actionEventPayload.types.d.ts +1 -4
- package/dist/cjs/modules/embed-studio/types/event/resultEvent.types.d.ts +2 -3
- package/dist/cjs/modules/embed-studio/types/event/resultEventPayload.types.d.ts +1 -4
- package/dist/cjs/modules/eventTypes.d.ts +2 -2
- package/dist/cjs/modules/events.d.ts +4 -4
- package/dist/cjs/modules/white-label/events.d.ts +4 -0
- package/dist/cjs/modules/white-label/events.js +2 -0
- package/dist/cjs/modules/white-label/types/data.types.d.ts +6 -0
- package/dist/cjs/modules/white-label/types/event/actionEventPayload.types.d.ts +2 -1
- package/dist/cjs/modules/white-label/types/event/resultEvent.types.d.ts +3 -2
- package/dist/cjs/modules/white-label/types/event/resultEventPayload.types.d.ts +5 -1
- package/dist/cjs/modules/white-label/whiteLabelModule.d.ts +2 -1
- package/dist/cjs/modules/white-label/whiteLabelModule.js +4 -0
- package/dist/cjs/services/embedStudio.d.ts +1 -3
- package/dist/cjs/services/embedStudio.js +0 -4
- package/dist/cjs/services/whiteLabel.d.ts +1 -0
- package/dist/cjs/services/whiteLabel.js +4 -0
- package/dist/cjs/types/module/module.types.d.ts +3 -3
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/modules/embed-studio/embedStudioModule.d.ts +1 -2
- package/dist/esm/modules/embed-studio/embedStudioModule.js +0 -4
- package/dist/esm/modules/embed-studio/events.d.ts +0 -4
- package/dist/esm/modules/embed-studio/events.js +0 -2
- package/dist/esm/modules/embed-studio/types/data.types.d.ts +1 -0
- package/dist/esm/modules/embed-studio/types/event/actionEvent.types.d.ts +2 -3
- package/dist/esm/modules/embed-studio/types/event/actionEventPayload.types.d.ts +1 -4
- package/dist/esm/modules/embed-studio/types/event/resultEvent.types.d.ts +2 -3
- package/dist/esm/modules/embed-studio/types/event/resultEventPayload.types.d.ts +1 -4
- package/dist/esm/modules/eventTypes.d.ts +2 -2
- package/dist/esm/modules/events.d.ts +4 -4
- package/dist/esm/modules/white-label/events.d.ts +4 -0
- package/dist/esm/modules/white-label/events.js +2 -0
- package/dist/esm/modules/white-label/types/data.types.d.ts +6 -0
- package/dist/esm/modules/white-label/types/event/actionEventPayload.types.d.ts +2 -1
- package/dist/esm/modules/white-label/types/event/resultEvent.types.d.ts +3 -2
- package/dist/esm/modules/white-label/types/event/resultEventPayload.types.d.ts +5 -1
- package/dist/esm/modules/white-label/whiteLabelModule.d.ts +2 -1
- package/dist/esm/modules/white-label/whiteLabelModule.js +4 -0
- package/dist/esm/services/embedStudio.d.ts +1 -3
- package/dist/esm/services/embedStudio.js +0 -4
- package/dist/esm/services/whiteLabel.d.ts +1 -0
- package/dist/esm/services/whiteLabel.js +4 -0
- package/dist/esm/types/module/module.types.d.ts +3 -3
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { IEmbedStudioModule } from '../../types/module/module.types';
|
|
2
2
|
import { BaseModule } from '../../modules/baseModule';
|
|
3
|
-
import { InitializeEmbedStudioPayload, SaveDesignResultPayload
|
|
3
|
+
import { InitializeEmbedStudioPayload, SaveDesignResultPayload } from './types';
|
|
4
4
|
import { NotificationEventPayload } from '../../types/event/notification/notificationEventPayload.types';
|
|
5
5
|
import { WithHandledResponses } from '../../helpers/typeHelper.types';
|
|
6
6
|
export declare class EmbedStudioModule extends BaseModule implements WithHandledResponses<IEmbedStudioModule> {
|
|
7
7
|
constructor();
|
|
8
8
|
setup(payload?: InitializeEmbedStudioPayload): Promise<NotificationEventPayload>;
|
|
9
9
|
saveDesign(): Promise<import("../..").HandledResponse<SaveDesignResultPayload, Error>>;
|
|
10
|
-
setStoreContext(payload: SetStoreContextPayload): Promise<import("../..").HandledResponse<SetStoreContextResultPayload, Error>>;
|
|
11
10
|
}
|
|
@@ -17,9 +17,5 @@ class EmbedStudioModule extends baseModule_1.BaseModule {
|
|
|
17
17
|
const response = await this.sendRequest(events_1.EVENTS_ACTION.SAVE_DESIGN, {}).catch((e) => e);
|
|
18
18
|
return (0, responseHandler_1.handleResponse)(response, 'Failed to save design');
|
|
19
19
|
}
|
|
20
|
-
async setStoreContext(payload) {
|
|
21
|
-
const response = await this.sendRequest(events_1.EVENTS_ACTION.SET_STORE_CONTEXT, payload).catch((e) => e);
|
|
22
|
-
return (0, responseHandler_1.handleResponse)(response, 'Failed to set store context');
|
|
23
|
-
}
|
|
24
20
|
}
|
|
25
21
|
exports.EmbedStudioModule = EmbedStudioModule;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export declare const EVENTS_ACTION: {
|
|
2
2
|
readonly INITIALIZE_EMBED_STUDIO: "actionInitializeEdm";
|
|
3
3
|
readonly SAVE_DESIGN: "actionSaveDesign";
|
|
4
|
-
readonly SET_STORE_CONTEXT: "actionSetStoreContext";
|
|
5
4
|
};
|
|
6
5
|
export declare const EVENTS_NOTIFICATION: {
|
|
7
6
|
readonly EMBED_STUDIO_INITIALIZATION_SUCCESS: "notificationEdmInitializationSuccess";
|
|
@@ -9,7 +8,6 @@ export declare const EVENTS_NOTIFICATION: {
|
|
|
9
8
|
};
|
|
10
9
|
export declare const EVENTS_RESULT: {
|
|
11
10
|
readonly SAVE_DESIGN_RESULT: "resultSaveDesign";
|
|
12
|
-
readonly SET_STORE_CONTEXT_RESULT: "resultSetStoreContext";
|
|
13
11
|
};
|
|
14
12
|
export declare const EVENT_BROADCAST: {
|
|
15
13
|
readonly ON_DESIGN_STATUS_UPDATE: "onDesignStatusUpdate";
|
|
@@ -19,10 +17,8 @@ export declare const EVENTS: {
|
|
|
19
17
|
readonly ON_DESIGN_STATUS_UPDATE: "onDesignStatusUpdate";
|
|
20
18
|
readonly ON_INTERNAL_ERROR: "onError";
|
|
21
19
|
readonly SAVE_DESIGN_RESULT: "resultSaveDesign";
|
|
22
|
-
readonly SET_STORE_CONTEXT_RESULT: "resultSetStoreContext";
|
|
23
20
|
readonly EMBED_STUDIO_INITIALIZATION_SUCCESS: "notificationEdmInitializationSuccess";
|
|
24
21
|
readonly SAVE_DESIGN_FAILURE: "actionSaveDesignFailure";
|
|
25
22
|
readonly INITIALIZE_EMBED_STUDIO: "actionInitializeEdm";
|
|
26
23
|
readonly SAVE_DESIGN: "actionSaveDesign";
|
|
27
|
-
readonly SET_STORE_CONTEXT: "actionSetStoreContext";
|
|
28
24
|
};
|
|
@@ -4,7 +4,6 @@ exports.EVENTS = exports.EVENT_BROADCAST = exports.EVENTS_RESULT = exports.EVENT
|
|
|
4
4
|
exports.EVENTS_ACTION = {
|
|
5
5
|
INITIALIZE_EMBED_STUDIO: 'actionInitializeEdm',
|
|
6
6
|
SAVE_DESIGN: 'actionSaveDesign',
|
|
7
|
-
SET_STORE_CONTEXT: 'actionSetStoreContext',
|
|
8
7
|
};
|
|
9
8
|
exports.EVENTS_NOTIFICATION = {
|
|
10
9
|
EMBED_STUDIO_INITIALIZATION_SUCCESS: 'notificationEdmInitializationSuccess',
|
|
@@ -12,7 +11,6 @@ exports.EVENTS_NOTIFICATION = {
|
|
|
12
11
|
};
|
|
13
12
|
exports.EVENTS_RESULT = {
|
|
14
13
|
SAVE_DESIGN_RESULT: 'resultSaveDesign',
|
|
15
|
-
SET_STORE_CONTEXT_RESULT: 'resultSetStoreContext',
|
|
16
14
|
};
|
|
17
15
|
exports.EVENT_BROADCAST = {
|
|
18
16
|
ON_DESIGN_STATUS_UPDATE: 'onDesignStatusUpdate',
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { EVENTS_ACTION } from '../../../../modules/embed-studio/events';
|
|
2
|
-
import { InitializeEmbedStudioPayload
|
|
2
|
+
import { InitializeEmbedStudioPayload } from '../../../../modules/embed-studio/types';
|
|
3
3
|
import { BaseActionEvent } from '../../../../types/event/action/actionEvent.types';
|
|
4
4
|
export type InitializeEmbedStudioAction = BaseActionEvent<typeof EVENTS_ACTION.INITIALIZE_EMBED_STUDIO, InitializeEmbedStudioPayload>;
|
|
5
5
|
export type SaveDesignAction = BaseActionEvent<typeof EVENTS_ACTION.SAVE_DESIGN, undefined>;
|
|
6
|
-
export type
|
|
7
|
-
export type ActionEvent = InitializeEmbedStudioAction | SaveDesignAction | SetStoreContextAction;
|
|
6
|
+
export type ActionEvent = InitializeEmbedStudioAction | SaveDesignAction;
|
|
@@ -3,7 +3,4 @@ export type InitializeEmbedStudioPayload = EmbedStudioConfig & EmbedStudioParams
|
|
|
3
3
|
export interface InitializeEmbedStudioPayloadWithVersion {
|
|
4
4
|
clientVersion: string;
|
|
5
5
|
}
|
|
6
|
-
export
|
|
7
|
-
storeId: string;
|
|
8
|
-
}
|
|
9
|
-
export type ActionEventPayload = InitializeEmbedStudioPayloadWithVersion | SetStoreContextPayload;
|
|
6
|
+
export type ActionEventPayload = InitializeEmbedStudioPayloadWithVersion;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { BaseResultEvent } from '../../../../types/event/result/resultEvent.types';
|
|
2
2
|
import type { EVENTS_RESULT } from '../../../../modules/embed-studio/events';
|
|
3
|
-
import { SaveDesignResultPayload
|
|
3
|
+
import { SaveDesignResultPayload } from '../../../../modules/embed-studio/types/event/resultEventPayload.types';
|
|
4
4
|
export type SaveDesignResultEvent = BaseResultEvent<typeof EVENTS_RESULT.SAVE_DESIGN_RESULT, SaveDesignResultPayload>;
|
|
5
|
-
export type
|
|
6
|
-
export type ResultEvent = SaveDesignResultEvent | SetStoreContextResultEvent;
|
|
5
|
+
export type ResultEvent = SaveDesignResultEvent;
|
|
@@ -2,7 +2,4 @@ import { FyulTemplate } from '../../../../modules/embed-studio/types/data.types'
|
|
|
2
2
|
export type SaveDesignResultPayload = {
|
|
3
3
|
template: FyulTemplate;
|
|
4
4
|
};
|
|
5
|
-
export type
|
|
6
|
-
storeId: string;
|
|
7
|
-
};
|
|
8
|
-
export type EmbedStudioResultPayload = SaveDesignResultPayload | SetStoreContextResultPayload;
|
|
5
|
+
export type EmbedStudioResultPayload = SaveDesignResultPayload;
|
|
@@ -5,7 +5,7 @@ export declare const EVENT_TYPES: {
|
|
|
5
5
|
readonly RESULT: "result";
|
|
6
6
|
readonly BROADCAST: "broadcast";
|
|
7
7
|
};
|
|
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
|
|
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("./
|
|
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,9 +1,9 @@
|
|
|
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
|
-
readonly SET_STORE_CONTEXT: "actionSetStoreContext";
|
|
7
7
|
readonly INITIALIZE_EDM: "actionInitializeEdm";
|
|
8
8
|
readonly ADD_IMAGE: "actionAddImage";
|
|
9
9
|
readonly SET_STYLE: "actionSetStyle";
|
|
@@ -46,8 +46,8 @@ export declare const ALL_NOTIFICATION_EVENTS: {
|
|
|
46
46
|
};
|
|
47
47
|
export declare const ALL_RESULT_EVENTS: {
|
|
48
48
|
readonly GO_TO_VIEW_RESULT: "resultGoToView";
|
|
49
|
+
readonly GET_AVAILABLE_ROUTES_RESULT: "resultGetAvailableRoutes";
|
|
49
50
|
readonly SAVE_DESIGN_RESULT: "resultSaveDesign";
|
|
50
|
-
readonly SET_STORE_CONTEXT_RESULT: "resultSetStoreContext";
|
|
51
51
|
readonly ADD_IMAGE_RESULT: "resultAddImage";
|
|
52
52
|
readonly SET_STYLE_RESULT: "resultSetStyle";
|
|
53
53
|
readonly NAVIGATE_STEP_RESULT: "resultNavigateStep";
|
|
@@ -80,8 +80,8 @@ export declare const ALL_EVENTS: {
|
|
|
80
80
|
readonly ON_FILE_PICKER_REQUESTED: "onFilePickerRequested";
|
|
81
81
|
readonly ON_STEP_STATUS_UPDATE: "onStepStatusUpdate";
|
|
82
82
|
readonly GO_TO_VIEW_RESULT: "resultGoToView";
|
|
83
|
+
readonly GET_AVAILABLE_ROUTES_RESULT: "resultGetAvailableRoutes";
|
|
83
84
|
readonly SAVE_DESIGN_RESULT: "resultSaveDesign";
|
|
84
|
-
readonly SET_STORE_CONTEXT_RESULT: "resultSetStoreContext";
|
|
85
85
|
readonly ADD_IMAGE_RESULT: "resultAddImage";
|
|
86
86
|
readonly SET_STYLE_RESULT: "resultSetStyle";
|
|
87
87
|
readonly NAVIGATE_STEP_RESULT: "resultNavigateStep";
|
|
@@ -117,9 +117,9 @@ export declare const ALL_EVENTS: {
|
|
|
117
117
|
readonly SDK_INITIALIZATION_SUCCESS: "notificationSdkInitializationSuccess";
|
|
118
118
|
readonly INITIALIZE_WHITE_LABEL: "actionInitializeWhiteLabel";
|
|
119
119
|
readonly GO_TO_VIEW: "actionGoToView";
|
|
120
|
+
readonly GET_AVAILABLE_ROUTES: "actionGetAvailableRoutes";
|
|
120
121
|
readonly INITIALIZE_EMBED_STUDIO: "actionInitializeEdm";
|
|
121
122
|
readonly SAVE_DESIGN: "actionSaveDesign";
|
|
122
|
-
readonly SET_STORE_CONTEXT: "actionSetStoreContext";
|
|
123
123
|
readonly INITIALIZE_EDM: "actionInitializeEdm";
|
|
124
124
|
readonly ADD_IMAGE: "actionAddImage";
|
|
125
125
|
readonly SET_STYLE: "actionSetStyle";
|
|
@@ -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
|
-
|
|
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
|
|
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
|
|
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;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { EmbedStudioBroadcastModule } from '../modules/embed-studio/embedStudioBroadcastModule';
|
|
2
2
|
import type { EmbedStudioParams, EmbedStudioConfig } from '../modules/embed-studio/types/data.types';
|
|
3
3
|
import type { EmbedStudioBroadcastListeners } from '../modules/embed-studio/types/event/broadcastEvent.types';
|
|
4
|
-
import type { SaveDesignResultPayload
|
|
4
|
+
import type { SaveDesignResultPayload } from '../modules/embed-studio/types/event/resultEventPayload.types';
|
|
5
5
|
import type { HandledResponse } from '../types/event/result/resultEventPayload.types';
|
|
6
|
-
import { SetStoreContextPayload } from '../modules/embed-studio/types';
|
|
7
6
|
export declare class EmbedStudio {
|
|
8
7
|
private params;
|
|
9
8
|
private config?;
|
|
@@ -16,7 +15,6 @@ export declare class EmbedStudio {
|
|
|
16
15
|
constructor(params: EmbedStudioParams, config?: EmbedStudioConfig | undefined, callbacks?: Partial<EmbedStudioBroadcastListeners>);
|
|
17
16
|
init(): Promise<void>;
|
|
18
17
|
saveDesign(): Promise<HandledResponse<SaveDesignResultPayload, Error>>;
|
|
19
|
-
setStoreContext(payload: SetStoreContextPayload): Promise<HandledResponse<SetStoreContextResultPayload, Error>>;
|
|
20
18
|
destroy(): void;
|
|
21
19
|
static getBroadCastEventHandler(): EmbedStudioBroadcastModule;
|
|
22
20
|
}
|
|
@@ -68,10 +68,6 @@ class EmbedStudio {
|
|
|
68
68
|
const module = this.moduleLoader.getModule(moduleNames_1.MODULE_NAMES.EMBED_STUDIO);
|
|
69
69
|
return module.saveDesign();
|
|
70
70
|
}
|
|
71
|
-
setStoreContext(payload) {
|
|
72
|
-
const module = this.moduleLoader.getModule(moduleNames_1.MODULE_NAMES.EMBED_STUDIO);
|
|
73
|
-
return module.setStoreContext(payload);
|
|
74
|
-
}
|
|
75
71
|
destroy() {
|
|
76
72
|
if (this.iFrameManager) {
|
|
77
73
|
this.iFrameManager.destroy();
|
|
@@ -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');
|
|
@@ -7,8 +7,8 @@ import { DeleteProductsPayload, DeleteProductResultPayload, GetProductPublishPay
|
|
|
7
7
|
import { OnDesignStatusEventPayload, OnErrorEventPayload, OnFilePickerRequestedEventPayload, OnPricingStatusUpdateEventPayload, OnStepStatusUpdateEventPayload } from '../../modules/edm/types/event/broadcastEventPayload.types';
|
|
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
|
-
import { InitializeEmbedStudioPayload, SaveDesignResultPayload as EmbedStudioSaveDesignResultPayload
|
|
11
|
-
import { InitializeWhiteLabelPayload, GoToViewResultPayload, GoToViewPayload, SetupNotificationPayload } from '../../modules/white-label/types';
|
|
10
|
+
import { InitializeEmbedStudioPayload, SaveDesignResultPayload as EmbedStudioSaveDesignResultPayload } from '../../modules/embed-studio/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];
|
|
@@ -40,7 +40,6 @@ export interface IEdmModule {
|
|
|
40
40
|
export interface IEmbedStudioModule {
|
|
41
41
|
setup(config?: InitializeEmbedStudioPayload): NotificationEventPayload | void;
|
|
42
42
|
saveDesign(): EmbedStudioSaveDesignResultPayload;
|
|
43
|
-
setStoreContext(payload: SetStoreContextPayload): EmbedStudioSetStoreContextResultPayload;
|
|
44
43
|
}
|
|
45
44
|
export interface IEdmBroadcastModule {
|
|
46
45
|
onDesignStatusUpdate(event: OnDesignStatusEventPayload): void;
|
|
@@ -56,6 +55,7 @@ export interface IEmbedStudioBroadcastModule {
|
|
|
56
55
|
export interface IWhiteLabelModule {
|
|
57
56
|
setup(config: InitializeWhiteLabelPayload): SetupNotificationPayload;
|
|
58
57
|
goToView(event: GoToViewPayload): GoToViewResultPayload;
|
|
58
|
+
getAvailableRoutes(): GetAvailableRoutesResultPayload;
|
|
59
59
|
}
|
|
60
60
|
export interface IWhiteLabelBroadcastModule {
|
|
61
61
|
onShoppingCartUpdate(event: OnShoppingCartUpdateEventPayload): void;
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION: "2.7.
|
|
1
|
+
export declare const VERSION: "2.7.55";
|
package/dist/cjs/version.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { IEmbedStudioModule } from '../../types/module/module.types';
|
|
2
2
|
import { BaseModule } from '../../modules/baseModule';
|
|
3
|
-
import { InitializeEmbedStudioPayload, SaveDesignResultPayload
|
|
3
|
+
import { InitializeEmbedStudioPayload, SaveDesignResultPayload } from './types';
|
|
4
4
|
import { NotificationEventPayload } from '../../types/event/notification/notificationEventPayload.types';
|
|
5
5
|
import { WithHandledResponses } from '../../helpers/typeHelper.types';
|
|
6
6
|
export declare class EmbedStudioModule extends BaseModule implements WithHandledResponses<IEmbedStudioModule> {
|
|
7
7
|
constructor();
|
|
8
8
|
setup(payload?: InitializeEmbedStudioPayload): Promise<NotificationEventPayload>;
|
|
9
9
|
saveDesign(): Promise<import("../..").HandledResponse<SaveDesignResultPayload, Error>>;
|
|
10
|
-
setStoreContext(payload: SetStoreContextPayload): Promise<import("../..").HandledResponse<SetStoreContextResultPayload, Error>>;
|
|
11
10
|
}
|
|
@@ -14,8 +14,4 @@ export class EmbedStudioModule extends BaseModule {
|
|
|
14
14
|
const response = await this.sendRequest(EVENTS_ACTION.SAVE_DESIGN, {}).catch((e) => e);
|
|
15
15
|
return handleResponse(response, 'Failed to save design');
|
|
16
16
|
}
|
|
17
|
-
async setStoreContext(payload) {
|
|
18
|
-
const response = await this.sendRequest(EVENTS_ACTION.SET_STORE_CONTEXT, payload).catch((e) => e);
|
|
19
|
-
return handleResponse(response, 'Failed to set store context');
|
|
20
|
-
}
|
|
21
17
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export declare const EVENTS_ACTION: {
|
|
2
2
|
readonly INITIALIZE_EMBED_STUDIO: "actionInitializeEdm";
|
|
3
3
|
readonly SAVE_DESIGN: "actionSaveDesign";
|
|
4
|
-
readonly SET_STORE_CONTEXT: "actionSetStoreContext";
|
|
5
4
|
};
|
|
6
5
|
export declare const EVENTS_NOTIFICATION: {
|
|
7
6
|
readonly EMBED_STUDIO_INITIALIZATION_SUCCESS: "notificationEdmInitializationSuccess";
|
|
@@ -9,7 +8,6 @@ export declare const EVENTS_NOTIFICATION: {
|
|
|
9
8
|
};
|
|
10
9
|
export declare const EVENTS_RESULT: {
|
|
11
10
|
readonly SAVE_DESIGN_RESULT: "resultSaveDesign";
|
|
12
|
-
readonly SET_STORE_CONTEXT_RESULT: "resultSetStoreContext";
|
|
13
11
|
};
|
|
14
12
|
export declare const EVENT_BROADCAST: {
|
|
15
13
|
readonly ON_DESIGN_STATUS_UPDATE: "onDesignStatusUpdate";
|
|
@@ -19,10 +17,8 @@ export declare const EVENTS: {
|
|
|
19
17
|
readonly ON_DESIGN_STATUS_UPDATE: "onDesignStatusUpdate";
|
|
20
18
|
readonly ON_INTERNAL_ERROR: "onError";
|
|
21
19
|
readonly SAVE_DESIGN_RESULT: "resultSaveDesign";
|
|
22
|
-
readonly SET_STORE_CONTEXT_RESULT: "resultSetStoreContext";
|
|
23
20
|
readonly EMBED_STUDIO_INITIALIZATION_SUCCESS: "notificationEdmInitializationSuccess";
|
|
24
21
|
readonly SAVE_DESIGN_FAILURE: "actionSaveDesignFailure";
|
|
25
22
|
readonly INITIALIZE_EMBED_STUDIO: "actionInitializeEdm";
|
|
26
23
|
readonly SAVE_DESIGN: "actionSaveDesign";
|
|
27
|
-
readonly SET_STORE_CONTEXT: "actionSetStoreContext";
|
|
28
24
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export const EVENTS_ACTION = {
|
|
2
2
|
INITIALIZE_EMBED_STUDIO: 'actionInitializeEdm',
|
|
3
3
|
SAVE_DESIGN: 'actionSaveDesign',
|
|
4
|
-
SET_STORE_CONTEXT: 'actionSetStoreContext',
|
|
5
4
|
};
|
|
6
5
|
export const EVENTS_NOTIFICATION = {
|
|
7
6
|
EMBED_STUDIO_INITIALIZATION_SUCCESS: 'notificationEdmInitializationSuccess',
|
|
@@ -9,7 +8,6 @@ export const EVENTS_NOTIFICATION = {
|
|
|
9
8
|
};
|
|
10
9
|
export const EVENTS_RESULT = {
|
|
11
10
|
SAVE_DESIGN_RESULT: 'resultSaveDesign',
|
|
12
|
-
SET_STORE_CONTEXT_RESULT: 'resultSetStoreContext',
|
|
13
11
|
};
|
|
14
12
|
export const EVENT_BROADCAST = {
|
|
15
13
|
ON_DESIGN_STATUS_UPDATE: 'onDesignStatusUpdate',
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { EVENTS_ACTION } from '../../../../modules/embed-studio/events';
|
|
2
|
-
import { InitializeEmbedStudioPayload
|
|
2
|
+
import { InitializeEmbedStudioPayload } from '../../../../modules/embed-studio/types';
|
|
3
3
|
import { BaseActionEvent } from '../../../../types/event/action/actionEvent.types';
|
|
4
4
|
export type InitializeEmbedStudioAction = BaseActionEvent<typeof EVENTS_ACTION.INITIALIZE_EMBED_STUDIO, InitializeEmbedStudioPayload>;
|
|
5
5
|
export type SaveDesignAction = BaseActionEvent<typeof EVENTS_ACTION.SAVE_DESIGN, undefined>;
|
|
6
|
-
export type
|
|
7
|
-
export type ActionEvent = InitializeEmbedStudioAction | SaveDesignAction | SetStoreContextAction;
|
|
6
|
+
export type ActionEvent = InitializeEmbedStudioAction | SaveDesignAction;
|
|
@@ -3,7 +3,4 @@ export type InitializeEmbedStudioPayload = EmbedStudioConfig & EmbedStudioParams
|
|
|
3
3
|
export interface InitializeEmbedStudioPayloadWithVersion {
|
|
4
4
|
clientVersion: string;
|
|
5
5
|
}
|
|
6
|
-
export
|
|
7
|
-
storeId: string;
|
|
8
|
-
}
|
|
9
|
-
export type ActionEventPayload = InitializeEmbedStudioPayloadWithVersion | SetStoreContextPayload;
|
|
6
|
+
export type ActionEventPayload = InitializeEmbedStudioPayloadWithVersion;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { BaseResultEvent } from '../../../../types/event/result/resultEvent.types';
|
|
2
2
|
import type { EVENTS_RESULT } from '../../../../modules/embed-studio/events';
|
|
3
|
-
import { SaveDesignResultPayload
|
|
3
|
+
import { SaveDesignResultPayload } from '../../../../modules/embed-studio/types/event/resultEventPayload.types';
|
|
4
4
|
export type SaveDesignResultEvent = BaseResultEvent<typeof EVENTS_RESULT.SAVE_DESIGN_RESULT, SaveDesignResultPayload>;
|
|
5
|
-
export type
|
|
6
|
-
export type ResultEvent = SaveDesignResultEvent | SetStoreContextResultEvent;
|
|
5
|
+
export type ResultEvent = SaveDesignResultEvent;
|
|
@@ -2,7 +2,4 @@ import { FyulTemplate } from '../../../../modules/embed-studio/types/data.types'
|
|
|
2
2
|
export type SaveDesignResultPayload = {
|
|
3
3
|
template: FyulTemplate;
|
|
4
4
|
};
|
|
5
|
-
export type
|
|
6
|
-
storeId: string;
|
|
7
|
-
};
|
|
8
|
-
export type EmbedStudioResultPayload = SaveDesignResultPayload | SetStoreContextResultPayload;
|
|
5
|
+
export type EmbedStudioResultPayload = SaveDesignResultPayload;
|
|
@@ -5,7 +5,7 @@ export declare const EVENT_TYPES: {
|
|
|
5
5
|
readonly RESULT: "result";
|
|
6
6
|
readonly BROADCAST: "broadcast";
|
|
7
7
|
};
|
|
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
|
|
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("./
|
|
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,9 +1,9 @@
|
|
|
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
|
-
readonly SET_STORE_CONTEXT: "actionSetStoreContext";
|
|
7
7
|
readonly INITIALIZE_EDM: "actionInitializeEdm";
|
|
8
8
|
readonly ADD_IMAGE: "actionAddImage";
|
|
9
9
|
readonly SET_STYLE: "actionSetStyle";
|
|
@@ -46,8 +46,8 @@ export declare const ALL_NOTIFICATION_EVENTS: {
|
|
|
46
46
|
};
|
|
47
47
|
export declare const ALL_RESULT_EVENTS: {
|
|
48
48
|
readonly GO_TO_VIEW_RESULT: "resultGoToView";
|
|
49
|
+
readonly GET_AVAILABLE_ROUTES_RESULT: "resultGetAvailableRoutes";
|
|
49
50
|
readonly SAVE_DESIGN_RESULT: "resultSaveDesign";
|
|
50
|
-
readonly SET_STORE_CONTEXT_RESULT: "resultSetStoreContext";
|
|
51
51
|
readonly ADD_IMAGE_RESULT: "resultAddImage";
|
|
52
52
|
readonly SET_STYLE_RESULT: "resultSetStyle";
|
|
53
53
|
readonly NAVIGATE_STEP_RESULT: "resultNavigateStep";
|
|
@@ -80,8 +80,8 @@ export declare const ALL_EVENTS: {
|
|
|
80
80
|
readonly ON_FILE_PICKER_REQUESTED: "onFilePickerRequested";
|
|
81
81
|
readonly ON_STEP_STATUS_UPDATE: "onStepStatusUpdate";
|
|
82
82
|
readonly GO_TO_VIEW_RESULT: "resultGoToView";
|
|
83
|
+
readonly GET_AVAILABLE_ROUTES_RESULT: "resultGetAvailableRoutes";
|
|
83
84
|
readonly SAVE_DESIGN_RESULT: "resultSaveDesign";
|
|
84
|
-
readonly SET_STORE_CONTEXT_RESULT: "resultSetStoreContext";
|
|
85
85
|
readonly ADD_IMAGE_RESULT: "resultAddImage";
|
|
86
86
|
readonly SET_STYLE_RESULT: "resultSetStyle";
|
|
87
87
|
readonly NAVIGATE_STEP_RESULT: "resultNavigateStep";
|
|
@@ -117,9 +117,9 @@ export declare const ALL_EVENTS: {
|
|
|
117
117
|
readonly SDK_INITIALIZATION_SUCCESS: "notificationSdkInitializationSuccess";
|
|
118
118
|
readonly INITIALIZE_WHITE_LABEL: "actionInitializeWhiteLabel";
|
|
119
119
|
readonly GO_TO_VIEW: "actionGoToView";
|
|
120
|
+
readonly GET_AVAILABLE_ROUTES: "actionGetAvailableRoutes";
|
|
120
121
|
readonly INITIALIZE_EMBED_STUDIO: "actionInitializeEdm";
|
|
121
122
|
readonly SAVE_DESIGN: "actionSaveDesign";
|
|
122
|
-
readonly SET_STORE_CONTEXT: "actionSetStoreContext";
|
|
123
123
|
readonly INITIALIZE_EDM: "actionInitializeEdm";
|
|
124
124
|
readonly ADD_IMAGE: "actionAddImage";
|
|
125
125
|
readonly SET_STYLE: "actionSetStyle";
|
|
@@ -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
|
-
|
|
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
|
|
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
|
|
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
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { EmbedStudioBroadcastModule } from '../modules/embed-studio/embedStudioBroadcastModule';
|
|
2
2
|
import type { EmbedStudioParams, EmbedStudioConfig } from '../modules/embed-studio/types/data.types';
|
|
3
3
|
import type { EmbedStudioBroadcastListeners } from '../modules/embed-studio/types/event/broadcastEvent.types';
|
|
4
|
-
import type { SaveDesignResultPayload
|
|
4
|
+
import type { SaveDesignResultPayload } from '../modules/embed-studio/types/event/resultEventPayload.types';
|
|
5
5
|
import type { HandledResponse } from '../types/event/result/resultEventPayload.types';
|
|
6
|
-
import { SetStoreContextPayload } from '../modules/embed-studio/types';
|
|
7
6
|
export declare class EmbedStudio {
|
|
8
7
|
private params;
|
|
9
8
|
private config?;
|
|
@@ -16,7 +15,6 @@ export declare class EmbedStudio {
|
|
|
16
15
|
constructor(params: EmbedStudioParams, config?: EmbedStudioConfig | undefined, callbacks?: Partial<EmbedStudioBroadcastListeners>);
|
|
17
16
|
init(): Promise<void>;
|
|
18
17
|
saveDesign(): Promise<HandledResponse<SaveDesignResultPayload, Error>>;
|
|
19
|
-
setStoreContext(payload: SetStoreContextPayload): Promise<HandledResponse<SetStoreContextResultPayload, Error>>;
|
|
20
18
|
destroy(): void;
|
|
21
19
|
static getBroadCastEventHandler(): EmbedStudioBroadcastModule;
|
|
22
20
|
}
|
|
@@ -65,10 +65,6 @@ export class EmbedStudio {
|
|
|
65
65
|
const module = this.moduleLoader.getModule(MODULE_NAMES.EMBED_STUDIO);
|
|
66
66
|
return module.saveDesign();
|
|
67
67
|
}
|
|
68
|
-
setStoreContext(payload) {
|
|
69
|
-
const module = this.moduleLoader.getModule(MODULE_NAMES.EMBED_STUDIO);
|
|
70
|
-
return module.setStoreContext(payload);
|
|
71
|
-
}
|
|
72
68
|
destroy() {
|
|
73
69
|
if (this.iFrameManager) {
|
|
74
70
|
this.iFrameManager.destroy();
|
|
@@ -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');
|
|
@@ -7,8 +7,8 @@ import { DeleteProductsPayload, DeleteProductResultPayload, GetProductPublishPay
|
|
|
7
7
|
import { OnDesignStatusEventPayload, OnErrorEventPayload, OnFilePickerRequestedEventPayload, OnPricingStatusUpdateEventPayload, OnStepStatusUpdateEventPayload } from '../../modules/edm/types/event/broadcastEventPayload.types';
|
|
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
|
-
import { InitializeEmbedStudioPayload, SaveDesignResultPayload as EmbedStudioSaveDesignResultPayload
|
|
11
|
-
import { InitializeWhiteLabelPayload, GoToViewResultPayload, GoToViewPayload, SetupNotificationPayload } from '../../modules/white-label/types';
|
|
10
|
+
import { InitializeEmbedStudioPayload, SaveDesignResultPayload as EmbedStudioSaveDesignResultPayload } from '../../modules/embed-studio/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];
|
|
@@ -40,7 +40,6 @@ export interface IEdmModule {
|
|
|
40
40
|
export interface IEmbedStudioModule {
|
|
41
41
|
setup(config?: InitializeEmbedStudioPayload): NotificationEventPayload | void;
|
|
42
42
|
saveDesign(): EmbedStudioSaveDesignResultPayload;
|
|
43
|
-
setStoreContext(payload: SetStoreContextPayload): EmbedStudioSetStoreContextResultPayload;
|
|
44
43
|
}
|
|
45
44
|
export interface IEdmBroadcastModule {
|
|
46
45
|
onDesignStatusUpdate(event: OnDesignStatusEventPayload): void;
|
|
@@ -56,6 +55,7 @@ export interface IEmbedStudioBroadcastModule {
|
|
|
56
55
|
export interface IWhiteLabelModule {
|
|
57
56
|
setup(config: InitializeWhiteLabelPayload): SetupNotificationPayload;
|
|
58
57
|
goToView(event: GoToViewPayload): GoToViewResultPayload;
|
|
58
|
+
getAvailableRoutes(): GetAvailableRoutesResultPayload;
|
|
59
59
|
}
|
|
60
60
|
export interface IWhiteLabelBroadcastModule {
|
|
61
61
|
onShoppingCartUpdate(event: OnShoppingCartUpdateEventPayload): void;
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION: "2.7.
|
|
1
|
+
export declare const VERSION: "2.7.55";
|
package/dist/esm/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// AUTO-GENERATED
|
|
2
|
-
export const VERSION = '2.7.
|
|
2
|
+
export const VERSION = '2.7.55';
|