@fyul/embed-sdk 2.5.0 → 2.5.2
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/eventTypes.d.ts +1 -1
- package/dist/cjs/modules/events.d.ts +6 -0
- package/dist/cjs/modules/product-publish/events.d.ts +6 -0
- package/dist/cjs/modules/product-publish/events.js +3 -0
- package/dist/cjs/modules/product-publish/productPublishModule.d.ts +2 -1
- package/dist/cjs/modules/product-publish/productPublishModule.js +4 -0
- package/dist/cjs/modules/product-publish/productPublishService.d.ts +2 -1
- package/dist/cjs/modules/product-publish/productPublishService.js +4 -0
- package/dist/cjs/modules/product-publish/types/event/actionEventPayload.types.d.ts +6 -2
- package/dist/cjs/modules/product-publish/types/event/resultEvent.types.d.ts +3 -2
- package/dist/cjs/modules/product-publish/types/event/resultEventPayload.types.d.ts +5 -1
- package/dist/cjs/services/embedCommunicator.js +3 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/modules/eventTypes.d.ts +1 -1
- package/dist/esm/modules/events.d.ts +6 -0
- package/dist/esm/modules/product-publish/events.d.ts +6 -0
- package/dist/esm/modules/product-publish/events.js +3 -0
- package/dist/esm/modules/product-publish/productPublishModule.d.ts +2 -1
- package/dist/esm/modules/product-publish/productPublishModule.js +4 -0
- package/dist/esm/modules/product-publish/productPublishService.d.ts +2 -1
- package/dist/esm/modules/product-publish/productPublishService.js +4 -0
- package/dist/esm/modules/product-publish/types/event/actionEventPayload.types.d.ts +6 -2
- package/dist/esm/modules/product-publish/types/event/resultEvent.types.d.ts +3 -2
- package/dist/esm/modules/product-publish/types/event/resultEventPayload.types.d.ts +5 -1
- package/dist/esm/services/embedCommunicator.js +3 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- 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;
|
|
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").DeleteProductsResult | import("./edm/types").SaveDesignResultEvent | import("./edm/types").AddImageResultEvent | import("./edm/types").SetStyleResultEvent | import("./edm/types").NavigateStepResultEvent | 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("./mockup-generation/types").GetMockupsResultEvent | import("./mockup-generation/types").GetMoreMockupsResultEvent | import("./mockup-generation/types").AdjustMockupResultEvent | import("./white-label/types").GoToViewResultEvent;
|
|
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;
|
|
@@ -9,6 +9,7 @@ export declare const ALL_ACTION_EVENTS: {
|
|
|
9
9
|
readonly PRODUCT_PUBLISH: "actionProductPublish";
|
|
10
10
|
readonly GET_SAVED_PRODUCTS: "actionGetSavedProducts";
|
|
11
11
|
readonly DELETE_PRODUCTS: "actionDeleteProducts";
|
|
12
|
+
readonly GET_SAVED_PRODUCT_MOCKUPS: "actionGetSavedProductMockups";
|
|
12
13
|
readonly GET_MOCKUPS: "actionGetMockups";
|
|
13
14
|
readonly GET_MORE_MOCKUPS: "actionGetMoreMockups";
|
|
14
15
|
readonly ADJUST_MOCKUP: "actionAdjustMockup";
|
|
@@ -30,6 +31,7 @@ export declare const ALL_NOTIFICATION_EVENTS: {
|
|
|
30
31
|
readonly GET_PRODUCT_PUBLISH_FAILURE: "actionGetProductPublishFailure";
|
|
31
32
|
readonly GET_SAVED_PRODUCTS_FAILURE: "actionGetSavedProductsFailure";
|
|
32
33
|
readonly DELETE_PRODUCTS_FAILURE: "actionDeleteProductsFailure";
|
|
34
|
+
readonly GET_SAVED_PRODUCT_MOCKUPS_FAILURE: "actionGetSavedProductMockupsFailure";
|
|
33
35
|
readonly GET_MOCKUPS_FAILURE: "notificationGetMockupsFailure";
|
|
34
36
|
readonly GET_MORE_MOCKUPS_FAILURE: "notificationGetMoreMockupsFailure";
|
|
35
37
|
readonly ADJUST_MOCKUP_FAILURE: "actionAdjustMockupFailure";
|
|
@@ -47,6 +49,7 @@ export declare const ALL_RESULT_EVENTS: {
|
|
|
47
49
|
readonly GET_PRODUCT_PUBLISH_RESULT: "resultGetProductPublish";
|
|
48
50
|
readonly GET_SAVED_PRODUCTS_RESULT: "resultGetSavedProducts";
|
|
49
51
|
readonly DELETE_PRODUCTS_RESULT: "resultDeleteProducts";
|
|
52
|
+
readonly GET_SAVED_PRODUCT_MOCKUPS_RESULT: "resultGetSavedProductMockups";
|
|
50
53
|
readonly GET_MOCKUPS_RESULT: "resultGetMockups";
|
|
51
54
|
readonly GET_MORE_MOCKUPS_RESULT: "resultGetMoreMockups";
|
|
52
55
|
readonly ADJUST_MOCKUP_RESULT: "resultActionAdjustMockup";
|
|
@@ -77,6 +80,7 @@ export declare const ALL_EVENTS: {
|
|
|
77
80
|
readonly GET_PRODUCT_PUBLISH_RESULT: "resultGetProductPublish";
|
|
78
81
|
readonly GET_SAVED_PRODUCTS_RESULT: "resultGetSavedProducts";
|
|
79
82
|
readonly DELETE_PRODUCTS_RESULT: "resultDeleteProducts";
|
|
83
|
+
readonly GET_SAVED_PRODUCT_MOCKUPS_RESULT: "resultGetSavedProductMockups";
|
|
80
84
|
readonly GET_MOCKUPS_RESULT: "resultGetMockups";
|
|
81
85
|
readonly GET_MORE_MOCKUPS_RESULT: "resultGetMoreMockups";
|
|
82
86
|
readonly ADJUST_MOCKUP_RESULT: "resultActionAdjustMockup";
|
|
@@ -93,6 +97,7 @@ export declare const ALL_EVENTS: {
|
|
|
93
97
|
readonly GET_PRODUCT_PUBLISH_FAILURE: "actionGetProductPublishFailure";
|
|
94
98
|
readonly GET_SAVED_PRODUCTS_FAILURE: "actionGetSavedProductsFailure";
|
|
95
99
|
readonly DELETE_PRODUCTS_FAILURE: "actionDeleteProductsFailure";
|
|
100
|
+
readonly GET_SAVED_PRODUCT_MOCKUPS_FAILURE: "actionGetSavedProductMockupsFailure";
|
|
96
101
|
readonly GET_MOCKUPS_FAILURE: "notificationGetMockupsFailure";
|
|
97
102
|
readonly GET_MORE_MOCKUPS_FAILURE: "notificationGetMoreMockupsFailure";
|
|
98
103
|
readonly ADJUST_MOCKUP_FAILURE: "actionAdjustMockupFailure";
|
|
@@ -110,6 +115,7 @@ export declare const ALL_EVENTS: {
|
|
|
110
115
|
readonly PRODUCT_PUBLISH: "actionProductPublish";
|
|
111
116
|
readonly GET_SAVED_PRODUCTS: "actionGetSavedProducts";
|
|
112
117
|
readonly DELETE_PRODUCTS: "actionDeleteProducts";
|
|
118
|
+
readonly GET_SAVED_PRODUCT_MOCKUPS: "actionGetSavedProductMockups";
|
|
113
119
|
readonly GET_MOCKUPS: "actionGetMockups";
|
|
114
120
|
readonly GET_MORE_MOCKUPS: "actionGetMoreMockups";
|
|
115
121
|
readonly ADJUST_MOCKUP: "actionAdjustMockup";
|
|
@@ -2,25 +2,31 @@ export declare const EVENTS_ACTION: {
|
|
|
2
2
|
readonly PRODUCT_PUBLISH: "actionProductPublish";
|
|
3
3
|
readonly GET_SAVED_PRODUCTS: "actionGetSavedProducts";
|
|
4
4
|
readonly DELETE_PRODUCTS: "actionDeleteProducts";
|
|
5
|
+
readonly GET_SAVED_PRODUCT_MOCKUPS: "actionGetSavedProductMockups";
|
|
5
6
|
};
|
|
6
7
|
export declare const EVENTS_NOTIFICATION: {
|
|
7
8
|
readonly GET_PRODUCT_PUBLISH_FAILURE: "actionGetProductPublishFailure";
|
|
8
9
|
readonly GET_SAVED_PRODUCTS_FAILURE: "actionGetSavedProductsFailure";
|
|
9
10
|
readonly DELETE_PRODUCTS_FAILURE: "actionDeleteProductsFailure";
|
|
11
|
+
readonly GET_SAVED_PRODUCT_MOCKUPS_FAILURE: "actionGetSavedProductMockupsFailure";
|
|
10
12
|
};
|
|
11
13
|
export declare const EVENTS_RESULT: {
|
|
12
14
|
readonly GET_PRODUCT_PUBLISH_RESULT: "resultGetProductPublish";
|
|
13
15
|
readonly GET_SAVED_PRODUCTS_RESULT: "resultGetSavedProducts";
|
|
14
16
|
readonly DELETE_PRODUCTS_RESULT: "resultDeleteProducts";
|
|
17
|
+
readonly GET_SAVED_PRODUCT_MOCKUPS_RESULT: "resultGetSavedProductMockups";
|
|
15
18
|
};
|
|
16
19
|
export declare const EVENTS: {
|
|
17
20
|
readonly GET_PRODUCT_PUBLISH_RESULT: "resultGetProductPublish";
|
|
18
21
|
readonly GET_SAVED_PRODUCTS_RESULT: "resultGetSavedProducts";
|
|
19
22
|
readonly DELETE_PRODUCTS_RESULT: "resultDeleteProducts";
|
|
23
|
+
readonly GET_SAVED_PRODUCT_MOCKUPS_RESULT: "resultGetSavedProductMockups";
|
|
20
24
|
readonly GET_PRODUCT_PUBLISH_FAILURE: "actionGetProductPublishFailure";
|
|
21
25
|
readonly GET_SAVED_PRODUCTS_FAILURE: "actionGetSavedProductsFailure";
|
|
22
26
|
readonly DELETE_PRODUCTS_FAILURE: "actionDeleteProductsFailure";
|
|
27
|
+
readonly GET_SAVED_PRODUCT_MOCKUPS_FAILURE: "actionGetSavedProductMockupsFailure";
|
|
23
28
|
readonly PRODUCT_PUBLISH: "actionProductPublish";
|
|
24
29
|
readonly GET_SAVED_PRODUCTS: "actionGetSavedProducts";
|
|
25
30
|
readonly DELETE_PRODUCTS: "actionDeleteProducts";
|
|
31
|
+
readonly GET_SAVED_PRODUCT_MOCKUPS: "actionGetSavedProductMockups";
|
|
26
32
|
};
|
|
@@ -5,16 +5,19 @@ exports.EVENTS_ACTION = {
|
|
|
5
5
|
PRODUCT_PUBLISH: 'actionProductPublish',
|
|
6
6
|
GET_SAVED_PRODUCTS: 'actionGetSavedProducts',
|
|
7
7
|
DELETE_PRODUCTS: 'actionDeleteProducts',
|
|
8
|
+
GET_SAVED_PRODUCT_MOCKUPS: 'actionGetSavedProductMockups',
|
|
8
9
|
};
|
|
9
10
|
exports.EVENTS_NOTIFICATION = {
|
|
10
11
|
GET_PRODUCT_PUBLISH_FAILURE: 'actionGetProductPublishFailure',
|
|
11
12
|
GET_SAVED_PRODUCTS_FAILURE: 'actionGetSavedProductsFailure',
|
|
12
13
|
DELETE_PRODUCTS_FAILURE: 'actionDeleteProductsFailure',
|
|
14
|
+
GET_SAVED_PRODUCT_MOCKUPS_FAILURE: 'actionGetSavedProductMockupsFailure',
|
|
13
15
|
};
|
|
14
16
|
exports.EVENTS_RESULT = {
|
|
15
17
|
GET_PRODUCT_PUBLISH_RESULT: 'resultGetProductPublish',
|
|
16
18
|
GET_SAVED_PRODUCTS_RESULT: 'resultGetSavedProducts',
|
|
17
19
|
DELETE_PRODUCTS_RESULT: 'resultDeleteProducts',
|
|
20
|
+
GET_SAVED_PRODUCT_MOCKUPS_RESULT: 'resultGetSavedProductMockups',
|
|
18
21
|
};
|
|
19
22
|
exports.EVENTS = {
|
|
20
23
|
...exports.EVENTS_ACTION,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { IProductPublishModule } from '../../types/module/module.types';
|
|
2
2
|
import { BaseModule } from '../../modules/baseModule';
|
|
3
|
-
import { DeleteProductsPayload, DeleteProductResultPayload, GetProductPublishPayload, GetSavedProductsPayload, GetSavedProductsResultPayload, ProductPublishData } from '../../modules/product-publish/types';
|
|
3
|
+
import { DeleteProductsPayload, DeleteProductResultPayload, GetProductPublishPayload, GetSavedProductsPayload, GetSavedProductsResultPayload, GetSavedProductMockupsPayload, GetSavedProductMockupsResultPayload, ProductPublishData } from '../../modules/product-publish/types';
|
|
4
4
|
import { WithHandledResponses } from '../../helpers/typeHelper.types';
|
|
5
5
|
export declare class ProductPublishModule extends BaseModule implements WithHandledResponses<IProductPublishModule> {
|
|
6
6
|
constructor();
|
|
7
7
|
productPublish(data: GetProductPublishPayload): Promise<import("../..").HandledResponse<ProductPublishData, Error>>;
|
|
8
8
|
getSavedProducts(data?: GetSavedProductsPayload): Promise<import("../..").HandledResponse<GetSavedProductsResultPayload, Error>>;
|
|
9
9
|
deleteProducts(data: DeleteProductsPayload): Promise<import("../..").HandledResponse<DeleteProductResultPayload, Error>>;
|
|
10
|
+
getSavedProductMockups(data: GetSavedProductMockupsPayload): Promise<import("../..").HandledResponse<GetSavedProductMockupsResultPayload, Error>>;
|
|
10
11
|
}
|
|
@@ -21,5 +21,9 @@ class ProductPublishModule extends baseModule_1.BaseModule {
|
|
|
21
21
|
const response = await this.sendRequest(types_1.EVENTS_ACTION.DELETE_PRODUCTS, data).catch((e) => e);
|
|
22
22
|
return (0, responseHandler_1.handleResponse)(response, 'deleteProducts');
|
|
23
23
|
}
|
|
24
|
+
async getSavedProductMockups(data) {
|
|
25
|
+
const response = await this.sendRequest(types_1.EVENTS_ACTION.GET_SAVED_PRODUCT_MOCKUPS, data).catch((e) => e);
|
|
26
|
+
return (0, responseHandler_1.handleResponse)(response, 'getSavedProductMockups');
|
|
27
|
+
}
|
|
24
28
|
}
|
|
25
29
|
exports.ProductPublishModule = ProductPublishModule;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { BaseModuleService } from '../../modules/baseModuleService';
|
|
2
|
-
import { DeleteProductsPayload, GetProductPublishPayload, GetSavedProductsPayload } from '../../modules/product-publish/types';
|
|
2
|
+
import { DeleteProductsPayload, GetProductPublishPayload, GetSavedProductsPayload, GetSavedProductMockupsPayload } from '../../modules/product-publish/types';
|
|
3
3
|
export declare class ProductPublishService extends BaseModuleService {
|
|
4
4
|
private getProductPublishModule;
|
|
5
5
|
productPublish(data: GetProductPublishPayload): Promise<import("../..").HandledResponse<import("../../modules/product-publish/types").ProductPublishData, Error>>;
|
|
6
6
|
getSavedProducts(data?: GetSavedProductsPayload): Promise<import("../..").HandledResponse<import("../../modules/product-publish/types").GetSavedProductsResultPayload, Error>>;
|
|
7
7
|
deleteProducts(data: DeleteProductsPayload): Promise<import("../..").HandledResponse<import("../../modules/product-publish/types").DeleteProductResultPayload, Error>>;
|
|
8
|
+
getSavedProductMockups(data: GetSavedProductMockupsPayload): Promise<import("../..").HandledResponse<import("../../modules/product-publish/types").GetSavedProductMockupsResultPayload, Error>>;
|
|
8
9
|
}
|
|
@@ -19,5 +19,9 @@ class ProductPublishService extends baseModuleService_1.BaseModuleService {
|
|
|
19
19
|
const module = await this.getProductPublishModule();
|
|
20
20
|
return await module.deleteProducts(data);
|
|
21
21
|
}
|
|
22
|
+
async getSavedProductMockups(data) {
|
|
23
|
+
const module = await this.getProductPublishModule();
|
|
24
|
+
return await module.getSavedProductMockups(data);
|
|
25
|
+
}
|
|
22
26
|
}
|
|
23
27
|
exports.ProductPublishService = ProductPublishService;
|
|
@@ -7,7 +7,7 @@ export interface GetProductPublishPayload {
|
|
|
7
7
|
/** Should not be empty, otherwise will fail to publish */
|
|
8
8
|
variantIds: number[];
|
|
9
9
|
/** If was provided for getMockups payload, should be provided also here.
|
|
10
|
-
* Otherwise, customer might not get what he sees */
|
|
10
|
+
* Otherwise, the customer might not get what he sees */
|
|
11
11
|
selectedTechnique?: string;
|
|
12
12
|
}[];
|
|
13
13
|
/** Used to position design on a product */
|
|
@@ -21,4 +21,8 @@ export interface GetSavedProductsPayload {
|
|
|
21
21
|
export interface DeleteProductsPayload {
|
|
22
22
|
productTemplateIds: number[];
|
|
23
23
|
}
|
|
24
|
-
export
|
|
24
|
+
export interface GetSavedProductMockupsPayload {
|
|
25
|
+
externalProductId: string;
|
|
26
|
+
variantId?: number;
|
|
27
|
+
}
|
|
28
|
+
export type ActionEventPayload = DeleteProductsPayload | GetSavedProductsPayload | GetProductPublishPayload | GetSavedProductMockupsPayload;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { EVENTS_RESULT } from '../../../../modules/product-publish/events';
|
|
2
|
-
import type { DeleteProductResultPayload, GetSavedProductsResultPayload, ProductPublishData } from '../../../../modules/product-publish/types/event/resultEventPayload.types';
|
|
2
|
+
import type { DeleteProductResultPayload, GetSavedProductsResultPayload, GetSavedProductMockupsResultPayload, ProductPublishData } from '../../../../modules/product-publish/types/event/resultEventPayload.types';
|
|
3
3
|
import { BaseResultEvent } from '../../../../types/event/result/resultEvent.types';
|
|
4
4
|
export type GetProductPublishResult = BaseResultEvent<typeof EVENTS_RESULT.GET_PRODUCT_PUBLISH_RESULT, ProductPublishData>;
|
|
5
5
|
export type GetSavedProductsResult = BaseResultEvent<typeof EVENTS_RESULT.GET_SAVED_PRODUCTS_RESULT, GetSavedProductsResultPayload>;
|
|
6
|
+
export type GetSavedProductMockupsResult = BaseResultEvent<typeof EVENTS_RESULT.GET_SAVED_PRODUCT_MOCKUPS_RESULT, GetSavedProductMockupsResultPayload>;
|
|
6
7
|
export type DeleteProductsResult = BaseResultEvent<typeof EVENTS_RESULT.DELETE_PRODUCTS_RESULT, DeleteProductResultPayload>;
|
|
7
|
-
export type ResultEvent = DeleteProductsResult | GetSavedProductsResult | GetProductPublishResult;
|
|
8
|
+
export type ResultEvent = DeleteProductsResult | GetSavedProductsResult | GetSavedProductMockupsResult | GetProductPublishResult;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SavedProductListItem } from '../../../../modules/product-publish/types/data.types';
|
|
2
|
+
import { MockupItem } from '../../../../modules/mockup-generation/types';
|
|
2
3
|
export interface ProductPublishData {
|
|
3
4
|
productTemplateIds: number[];
|
|
4
5
|
templates: {
|
|
@@ -14,4 +15,7 @@ export interface GetSavedProductsResultPayload {
|
|
|
14
15
|
export interface DeleteProductResultPayload {
|
|
15
16
|
success: boolean;
|
|
16
17
|
}
|
|
17
|
-
export
|
|
18
|
+
export interface GetSavedProductMockupsResultPayload {
|
|
19
|
+
mockups: MockupItem[];
|
|
20
|
+
}
|
|
21
|
+
export type ProductPublishResultPayload = DeleteProductResultPayload | GetSavedProductsResultPayload | ProductPublishData | GetSavedProductMockupsResultPayload;
|
|
@@ -72,8 +72,10 @@ class EmbedCommunicator {
|
|
|
72
72
|
this.handleBroadcastEvent(event);
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
|
+
// Some browser extensions will attach themselves to iframes and will call postMessage
|
|
76
|
+
// If no identification from our side is found, just ignore it
|
|
75
77
|
if (!event.correlationId) {
|
|
76
|
-
|
|
78
|
+
return;
|
|
77
79
|
}
|
|
78
80
|
// Result event gets inbound ONLY if there's nothing wrong.
|
|
79
81
|
// Otherwise it's a notification.
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION: "2.5.
|
|
1
|
+
export declare const VERSION: "2.5.2";
|
package/dist/cjs/version.js
CHANGED
|
@@ -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;
|
|
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").DeleteProductsResult | import("./edm/types").SaveDesignResultEvent | import("./edm/types").AddImageResultEvent | import("./edm/types").SetStyleResultEvent | import("./edm/types").NavigateStepResultEvent | 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("./mockup-generation/types").GetMockupsResultEvent | import("./mockup-generation/types").GetMoreMockupsResultEvent | import("./mockup-generation/types").AdjustMockupResultEvent | import("./white-label/types").GoToViewResultEvent;
|
|
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;
|
|
@@ -9,6 +9,7 @@ export declare const ALL_ACTION_EVENTS: {
|
|
|
9
9
|
readonly PRODUCT_PUBLISH: "actionProductPublish";
|
|
10
10
|
readonly GET_SAVED_PRODUCTS: "actionGetSavedProducts";
|
|
11
11
|
readonly DELETE_PRODUCTS: "actionDeleteProducts";
|
|
12
|
+
readonly GET_SAVED_PRODUCT_MOCKUPS: "actionGetSavedProductMockups";
|
|
12
13
|
readonly GET_MOCKUPS: "actionGetMockups";
|
|
13
14
|
readonly GET_MORE_MOCKUPS: "actionGetMoreMockups";
|
|
14
15
|
readonly ADJUST_MOCKUP: "actionAdjustMockup";
|
|
@@ -30,6 +31,7 @@ export declare const ALL_NOTIFICATION_EVENTS: {
|
|
|
30
31
|
readonly GET_PRODUCT_PUBLISH_FAILURE: "actionGetProductPublishFailure";
|
|
31
32
|
readonly GET_SAVED_PRODUCTS_FAILURE: "actionGetSavedProductsFailure";
|
|
32
33
|
readonly DELETE_PRODUCTS_FAILURE: "actionDeleteProductsFailure";
|
|
34
|
+
readonly GET_SAVED_PRODUCT_MOCKUPS_FAILURE: "actionGetSavedProductMockupsFailure";
|
|
33
35
|
readonly GET_MOCKUPS_FAILURE: "notificationGetMockupsFailure";
|
|
34
36
|
readonly GET_MORE_MOCKUPS_FAILURE: "notificationGetMoreMockupsFailure";
|
|
35
37
|
readonly ADJUST_MOCKUP_FAILURE: "actionAdjustMockupFailure";
|
|
@@ -47,6 +49,7 @@ export declare const ALL_RESULT_EVENTS: {
|
|
|
47
49
|
readonly GET_PRODUCT_PUBLISH_RESULT: "resultGetProductPublish";
|
|
48
50
|
readonly GET_SAVED_PRODUCTS_RESULT: "resultGetSavedProducts";
|
|
49
51
|
readonly DELETE_PRODUCTS_RESULT: "resultDeleteProducts";
|
|
52
|
+
readonly GET_SAVED_PRODUCT_MOCKUPS_RESULT: "resultGetSavedProductMockups";
|
|
50
53
|
readonly GET_MOCKUPS_RESULT: "resultGetMockups";
|
|
51
54
|
readonly GET_MORE_MOCKUPS_RESULT: "resultGetMoreMockups";
|
|
52
55
|
readonly ADJUST_MOCKUP_RESULT: "resultActionAdjustMockup";
|
|
@@ -77,6 +80,7 @@ export declare const ALL_EVENTS: {
|
|
|
77
80
|
readonly GET_PRODUCT_PUBLISH_RESULT: "resultGetProductPublish";
|
|
78
81
|
readonly GET_SAVED_PRODUCTS_RESULT: "resultGetSavedProducts";
|
|
79
82
|
readonly DELETE_PRODUCTS_RESULT: "resultDeleteProducts";
|
|
83
|
+
readonly GET_SAVED_PRODUCT_MOCKUPS_RESULT: "resultGetSavedProductMockups";
|
|
80
84
|
readonly GET_MOCKUPS_RESULT: "resultGetMockups";
|
|
81
85
|
readonly GET_MORE_MOCKUPS_RESULT: "resultGetMoreMockups";
|
|
82
86
|
readonly ADJUST_MOCKUP_RESULT: "resultActionAdjustMockup";
|
|
@@ -93,6 +97,7 @@ export declare const ALL_EVENTS: {
|
|
|
93
97
|
readonly GET_PRODUCT_PUBLISH_FAILURE: "actionGetProductPublishFailure";
|
|
94
98
|
readonly GET_SAVED_PRODUCTS_FAILURE: "actionGetSavedProductsFailure";
|
|
95
99
|
readonly DELETE_PRODUCTS_FAILURE: "actionDeleteProductsFailure";
|
|
100
|
+
readonly GET_SAVED_PRODUCT_MOCKUPS_FAILURE: "actionGetSavedProductMockupsFailure";
|
|
96
101
|
readonly GET_MOCKUPS_FAILURE: "notificationGetMockupsFailure";
|
|
97
102
|
readonly GET_MORE_MOCKUPS_FAILURE: "notificationGetMoreMockupsFailure";
|
|
98
103
|
readonly ADJUST_MOCKUP_FAILURE: "actionAdjustMockupFailure";
|
|
@@ -110,6 +115,7 @@ export declare const ALL_EVENTS: {
|
|
|
110
115
|
readonly PRODUCT_PUBLISH: "actionProductPublish";
|
|
111
116
|
readonly GET_SAVED_PRODUCTS: "actionGetSavedProducts";
|
|
112
117
|
readonly DELETE_PRODUCTS: "actionDeleteProducts";
|
|
118
|
+
readonly GET_SAVED_PRODUCT_MOCKUPS: "actionGetSavedProductMockups";
|
|
113
119
|
readonly GET_MOCKUPS: "actionGetMockups";
|
|
114
120
|
readonly GET_MORE_MOCKUPS: "actionGetMoreMockups";
|
|
115
121
|
readonly ADJUST_MOCKUP: "actionAdjustMockup";
|
|
@@ -2,25 +2,31 @@ export declare const EVENTS_ACTION: {
|
|
|
2
2
|
readonly PRODUCT_PUBLISH: "actionProductPublish";
|
|
3
3
|
readonly GET_SAVED_PRODUCTS: "actionGetSavedProducts";
|
|
4
4
|
readonly DELETE_PRODUCTS: "actionDeleteProducts";
|
|
5
|
+
readonly GET_SAVED_PRODUCT_MOCKUPS: "actionGetSavedProductMockups";
|
|
5
6
|
};
|
|
6
7
|
export declare const EVENTS_NOTIFICATION: {
|
|
7
8
|
readonly GET_PRODUCT_PUBLISH_FAILURE: "actionGetProductPublishFailure";
|
|
8
9
|
readonly GET_SAVED_PRODUCTS_FAILURE: "actionGetSavedProductsFailure";
|
|
9
10
|
readonly DELETE_PRODUCTS_FAILURE: "actionDeleteProductsFailure";
|
|
11
|
+
readonly GET_SAVED_PRODUCT_MOCKUPS_FAILURE: "actionGetSavedProductMockupsFailure";
|
|
10
12
|
};
|
|
11
13
|
export declare const EVENTS_RESULT: {
|
|
12
14
|
readonly GET_PRODUCT_PUBLISH_RESULT: "resultGetProductPublish";
|
|
13
15
|
readonly GET_SAVED_PRODUCTS_RESULT: "resultGetSavedProducts";
|
|
14
16
|
readonly DELETE_PRODUCTS_RESULT: "resultDeleteProducts";
|
|
17
|
+
readonly GET_SAVED_PRODUCT_MOCKUPS_RESULT: "resultGetSavedProductMockups";
|
|
15
18
|
};
|
|
16
19
|
export declare const EVENTS: {
|
|
17
20
|
readonly GET_PRODUCT_PUBLISH_RESULT: "resultGetProductPublish";
|
|
18
21
|
readonly GET_SAVED_PRODUCTS_RESULT: "resultGetSavedProducts";
|
|
19
22
|
readonly DELETE_PRODUCTS_RESULT: "resultDeleteProducts";
|
|
23
|
+
readonly GET_SAVED_PRODUCT_MOCKUPS_RESULT: "resultGetSavedProductMockups";
|
|
20
24
|
readonly GET_PRODUCT_PUBLISH_FAILURE: "actionGetProductPublishFailure";
|
|
21
25
|
readonly GET_SAVED_PRODUCTS_FAILURE: "actionGetSavedProductsFailure";
|
|
22
26
|
readonly DELETE_PRODUCTS_FAILURE: "actionDeleteProductsFailure";
|
|
27
|
+
readonly GET_SAVED_PRODUCT_MOCKUPS_FAILURE: "actionGetSavedProductMockupsFailure";
|
|
23
28
|
readonly PRODUCT_PUBLISH: "actionProductPublish";
|
|
24
29
|
readonly GET_SAVED_PRODUCTS: "actionGetSavedProducts";
|
|
25
30
|
readonly DELETE_PRODUCTS: "actionDeleteProducts";
|
|
31
|
+
readonly GET_SAVED_PRODUCT_MOCKUPS: "actionGetSavedProductMockups";
|
|
26
32
|
};
|
|
@@ -2,16 +2,19 @@ export const EVENTS_ACTION = {
|
|
|
2
2
|
PRODUCT_PUBLISH: 'actionProductPublish',
|
|
3
3
|
GET_SAVED_PRODUCTS: 'actionGetSavedProducts',
|
|
4
4
|
DELETE_PRODUCTS: 'actionDeleteProducts',
|
|
5
|
+
GET_SAVED_PRODUCT_MOCKUPS: 'actionGetSavedProductMockups',
|
|
5
6
|
};
|
|
6
7
|
export const EVENTS_NOTIFICATION = {
|
|
7
8
|
GET_PRODUCT_PUBLISH_FAILURE: 'actionGetProductPublishFailure',
|
|
8
9
|
GET_SAVED_PRODUCTS_FAILURE: 'actionGetSavedProductsFailure',
|
|
9
10
|
DELETE_PRODUCTS_FAILURE: 'actionDeleteProductsFailure',
|
|
11
|
+
GET_SAVED_PRODUCT_MOCKUPS_FAILURE: 'actionGetSavedProductMockupsFailure',
|
|
10
12
|
};
|
|
11
13
|
export const EVENTS_RESULT = {
|
|
12
14
|
GET_PRODUCT_PUBLISH_RESULT: 'resultGetProductPublish',
|
|
13
15
|
GET_SAVED_PRODUCTS_RESULT: 'resultGetSavedProducts',
|
|
14
16
|
DELETE_PRODUCTS_RESULT: 'resultDeleteProducts',
|
|
17
|
+
GET_SAVED_PRODUCT_MOCKUPS_RESULT: 'resultGetSavedProductMockups',
|
|
15
18
|
};
|
|
16
19
|
export const EVENTS = {
|
|
17
20
|
...EVENTS_ACTION,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { IProductPublishModule } from '../../types/module/module.types';
|
|
2
2
|
import { BaseModule } from '../../modules/baseModule';
|
|
3
|
-
import { DeleteProductsPayload, DeleteProductResultPayload, GetProductPublishPayload, GetSavedProductsPayload, GetSavedProductsResultPayload, ProductPublishData } from '../../modules/product-publish/types';
|
|
3
|
+
import { DeleteProductsPayload, DeleteProductResultPayload, GetProductPublishPayload, GetSavedProductsPayload, GetSavedProductsResultPayload, GetSavedProductMockupsPayload, GetSavedProductMockupsResultPayload, ProductPublishData } from '../../modules/product-publish/types';
|
|
4
4
|
import { WithHandledResponses } from '../../helpers/typeHelper.types';
|
|
5
5
|
export declare class ProductPublishModule extends BaseModule implements WithHandledResponses<IProductPublishModule> {
|
|
6
6
|
constructor();
|
|
7
7
|
productPublish(data: GetProductPublishPayload): Promise<import("../..").HandledResponse<ProductPublishData, Error>>;
|
|
8
8
|
getSavedProducts(data?: GetSavedProductsPayload): Promise<import("../..").HandledResponse<GetSavedProductsResultPayload, Error>>;
|
|
9
9
|
deleteProducts(data: DeleteProductsPayload): Promise<import("../..").HandledResponse<DeleteProductResultPayload, Error>>;
|
|
10
|
+
getSavedProductMockups(data: GetSavedProductMockupsPayload): Promise<import("../..").HandledResponse<GetSavedProductMockupsResultPayload, Error>>;
|
|
10
11
|
}
|
|
@@ -18,4 +18,8 @@ export class ProductPublishModule extends BaseModule {
|
|
|
18
18
|
const response = await this.sendRequest(EVENTS_ACTION.DELETE_PRODUCTS, data).catch((e) => e);
|
|
19
19
|
return handleResponse(response, 'deleteProducts');
|
|
20
20
|
}
|
|
21
|
+
async getSavedProductMockups(data) {
|
|
22
|
+
const response = await this.sendRequest(EVENTS_ACTION.GET_SAVED_PRODUCT_MOCKUPS, data).catch((e) => e);
|
|
23
|
+
return handleResponse(response, 'getSavedProductMockups');
|
|
24
|
+
}
|
|
21
25
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { BaseModuleService } from '../../modules/baseModuleService';
|
|
2
|
-
import { DeleteProductsPayload, GetProductPublishPayload, GetSavedProductsPayload } from '../../modules/product-publish/types';
|
|
2
|
+
import { DeleteProductsPayload, GetProductPublishPayload, GetSavedProductsPayload, GetSavedProductMockupsPayload } from '../../modules/product-publish/types';
|
|
3
3
|
export declare class ProductPublishService extends BaseModuleService {
|
|
4
4
|
private getProductPublishModule;
|
|
5
5
|
productPublish(data: GetProductPublishPayload): Promise<import("../..").HandledResponse<import("../../modules/product-publish/types").ProductPublishData, Error>>;
|
|
6
6
|
getSavedProducts(data?: GetSavedProductsPayload): Promise<import("../..").HandledResponse<import("../../modules/product-publish/types").GetSavedProductsResultPayload, Error>>;
|
|
7
7
|
deleteProducts(data: DeleteProductsPayload): Promise<import("../..").HandledResponse<import("../../modules/product-publish/types").DeleteProductResultPayload, Error>>;
|
|
8
|
+
getSavedProductMockups(data: GetSavedProductMockupsPayload): Promise<import("../..").HandledResponse<import("../../modules/product-publish/types").GetSavedProductMockupsResultPayload, Error>>;
|
|
8
9
|
}
|
|
@@ -16,4 +16,8 @@ export class ProductPublishService extends BaseModuleService {
|
|
|
16
16
|
const module = await this.getProductPublishModule();
|
|
17
17
|
return await module.deleteProducts(data);
|
|
18
18
|
}
|
|
19
|
+
async getSavedProductMockups(data) {
|
|
20
|
+
const module = await this.getProductPublishModule();
|
|
21
|
+
return await module.getSavedProductMockups(data);
|
|
22
|
+
}
|
|
19
23
|
}
|
|
@@ -7,7 +7,7 @@ export interface GetProductPublishPayload {
|
|
|
7
7
|
/** Should not be empty, otherwise will fail to publish */
|
|
8
8
|
variantIds: number[];
|
|
9
9
|
/** If was provided for getMockups payload, should be provided also here.
|
|
10
|
-
* Otherwise, customer might not get what he sees */
|
|
10
|
+
* Otherwise, the customer might not get what he sees */
|
|
11
11
|
selectedTechnique?: string;
|
|
12
12
|
}[];
|
|
13
13
|
/** Used to position design on a product */
|
|
@@ -21,4 +21,8 @@ export interface GetSavedProductsPayload {
|
|
|
21
21
|
export interface DeleteProductsPayload {
|
|
22
22
|
productTemplateIds: number[];
|
|
23
23
|
}
|
|
24
|
-
export
|
|
24
|
+
export interface GetSavedProductMockupsPayload {
|
|
25
|
+
externalProductId: string;
|
|
26
|
+
variantId?: number;
|
|
27
|
+
}
|
|
28
|
+
export type ActionEventPayload = DeleteProductsPayload | GetSavedProductsPayload | GetProductPublishPayload | GetSavedProductMockupsPayload;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { EVENTS_RESULT } from '../../../../modules/product-publish/events';
|
|
2
|
-
import type { DeleteProductResultPayload, GetSavedProductsResultPayload, ProductPublishData } from '../../../../modules/product-publish/types/event/resultEventPayload.types';
|
|
2
|
+
import type { DeleteProductResultPayload, GetSavedProductsResultPayload, GetSavedProductMockupsResultPayload, ProductPublishData } from '../../../../modules/product-publish/types/event/resultEventPayload.types';
|
|
3
3
|
import { BaseResultEvent } from '../../../../types/event/result/resultEvent.types';
|
|
4
4
|
export type GetProductPublishResult = BaseResultEvent<typeof EVENTS_RESULT.GET_PRODUCT_PUBLISH_RESULT, ProductPublishData>;
|
|
5
5
|
export type GetSavedProductsResult = BaseResultEvent<typeof EVENTS_RESULT.GET_SAVED_PRODUCTS_RESULT, GetSavedProductsResultPayload>;
|
|
6
|
+
export type GetSavedProductMockupsResult = BaseResultEvent<typeof EVENTS_RESULT.GET_SAVED_PRODUCT_MOCKUPS_RESULT, GetSavedProductMockupsResultPayload>;
|
|
6
7
|
export type DeleteProductsResult = BaseResultEvent<typeof EVENTS_RESULT.DELETE_PRODUCTS_RESULT, DeleteProductResultPayload>;
|
|
7
|
-
export type ResultEvent = DeleteProductsResult | GetSavedProductsResult | GetProductPublishResult;
|
|
8
|
+
export type ResultEvent = DeleteProductsResult | GetSavedProductsResult | GetSavedProductMockupsResult | GetProductPublishResult;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SavedProductListItem } from '../../../../modules/product-publish/types/data.types';
|
|
2
|
+
import { MockupItem } from '../../../../modules/mockup-generation/types';
|
|
2
3
|
export interface ProductPublishData {
|
|
3
4
|
productTemplateIds: number[];
|
|
4
5
|
templates: {
|
|
@@ -14,4 +15,7 @@ export interface GetSavedProductsResultPayload {
|
|
|
14
15
|
export interface DeleteProductResultPayload {
|
|
15
16
|
success: boolean;
|
|
16
17
|
}
|
|
17
|
-
export
|
|
18
|
+
export interface GetSavedProductMockupsResultPayload {
|
|
19
|
+
mockups: MockupItem[];
|
|
20
|
+
}
|
|
21
|
+
export type ProductPublishResultPayload = DeleteProductResultPayload | GetSavedProductsResultPayload | ProductPublishData | GetSavedProductMockupsResultPayload;
|
|
@@ -69,8 +69,10 @@ export class EmbedCommunicator {
|
|
|
69
69
|
this.handleBroadcastEvent(event);
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
|
+
// Some browser extensions will attach themselves to iframes and will call postMessage
|
|
73
|
+
// If no identification from our side is found, just ignore it
|
|
72
74
|
if (!event.correlationId) {
|
|
73
|
-
|
|
75
|
+
return;
|
|
74
76
|
}
|
|
75
77
|
// Result event gets inbound ONLY if there's nothing wrong.
|
|
76
78
|
// Otherwise it's a notification.
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION: "2.5.
|
|
1
|
+
export declare const VERSION: "2.5.2";
|
package/dist/esm/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// AUTO-GENERATED
|
|
2
|
-
export const VERSION = '2.5.
|
|
2
|
+
export const VERSION = '2.5.2';
|