@retailrocketgroup/retailrocket-edit.repurchase-vue-email-template-render 3.0.381747 → 5.0.384530

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/.turbo/turbo-build.log +25 -0
  2. package/dist/assets/index.css +1 -0
  3. package/dist/assets/index.js +379 -0
  4. package/dist/assets/index.js.map +1 -0
  5. package/dist/editRepurchaseEmailTemplate.d.ts +0 -0
  6. package/dist/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CreateComponentLibrarySectionModalWindow/repurchaseComponentSectionItemFactory.d.ts +4 -0
  7. package/dist/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CreateComponentLibrarySectionModalWindow/repurchaseEmailComponentFactory.d.ts +4 -0
  8. package/dist/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CustomComponentLibrary/repurchaseComponentLibraryFactory.d.ts +4 -0
  9. package/dist/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CustomComponentLibrary/repurchaseSectionFactory.d.ts +4 -0
  10. package/dist/implementation/DataSources/ListDataExpressionSource/repurchaseEvaluateListExpressionDataSourceFactory.d.ts +8 -0
  11. package/dist/implementation/DataSources/NumberExpressionDataSource/repurchaseEvaluateNumberExpressionDataSourceFactory.d.ts +2 -0
  12. package/dist/implementation/DataSources/StringExpressionDataSource/repurchaseEvaluateStringExpressionDataSource.d.ts +9 -0
  13. package/dist/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/RepurchaseProductShelfDataSourceExpressionBuilderModal/ShelfBuilders/alternativeProductsForRepurchaseProductListShelfBuilderDepsFactory.d.ts +8 -0
  14. package/dist/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/RepurchaseProductShelfDataSourceExpressionBuilderModal/ShelfBuilders/relatedProductsForRepurchaseProductListShelfBuilderDepsFactory.d.ts +8 -0
  15. package/dist/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/RepurchaseProductShelfDataSourceExpressionBuilderModal/ShelfBuilders/repurchaseProductListShelfBuilderDepsFactory.d.ts +8 -0
  16. package/dist/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/RepurchaseProductShelfDataSourceExpressionBuilderModal/repurchaseProductShelfDataSourceExpressionBuilderModalDepsFactory.d.ts +11 -0
  17. package/dist/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/repurchaseProductShelfDataSourceExpressionBuilderDepsFactory.d.ts +11 -0
  18. package/dist/index.d.ts +1 -0
  19. package/dist/index.html +35 -0
  20. package/env.d.ts +1 -0
  21. package/index.html +1 -2
  22. package/package.json +1 -1
  23. package/src/editRepurchaseEmailTemplate.ts +407 -0
  24. package/src/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CreateComponentLibrarySectionModalWindow/repurchaseComponentSectionItemFactory.ts +30 -0
  25. package/src/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CreateComponentLibrarySectionModalWindow/repurchaseEmailComponentFactory.ts +26 -0
  26. package/src/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CustomComponentLibrary/repurchaseComponentLibraryFactory.ts +29 -0
  27. package/src/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CustomComponentLibrary/repurchaseSectionFactory.ts +32 -0
  28. package/src/implementation/DataSources/ListDataExpressionSource/repurchaseEvaluateListExpressionDataSourceFactory.ts +134 -0
  29. package/src/implementation/DataSources/NumberExpressionDataSource/repurchaseEvaluateNumberExpressionDataSourceFactory.ts +10 -0
  30. package/src/implementation/DataSources/StringExpressionDataSource/repurchaseEvaluateStringExpressionDataSource.ts +56 -0
  31. package/src/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/RepurchaseProductShelfDataSourceExpressionBuilderModal/ShelfBuilders/alternativeProductsForRepurchaseProductListShelfBuilderDepsFactory.ts +33 -0
  32. package/src/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/RepurchaseProductShelfDataSourceExpressionBuilderModal/ShelfBuilders/relatedProductsForRepurchaseProductListShelfBuilderDepsFactory.ts +33 -0
  33. package/src/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/RepurchaseProductShelfDataSourceExpressionBuilderModal/ShelfBuilders/repurchaseProductListShelfBuilderDepsFactory.ts +33 -0
  34. package/src/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/RepurchaseProductShelfDataSourceExpressionBuilderModal/repurchaseProductShelfDataSourceExpressionBuilderModalDepsFactory.ts +151 -0
  35. package/src/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/repurchaseProductShelfDataSourceExpressionBuilderDepsFactory.ts +35 -0
  36. package/src/index.ts +0 -0
  37. package/tsconfig.app.json +19 -0
  38. package/tsconfig.json +14 -0
  39. package/tsconfig.node.json +11 -0
  40. package/tsconfig.test.json +11 -0
  41. package/vite.config.ts +36 -0
  42. package/assets/main.css +0 -1
  43. package/assets/main.js +0 -217
  44. package/favicon.ico +0 -0
@@ -0,0 +1,26 @@
1
+ import type { EmailComponentType } from '@easy-wizzy/core';
2
+ import type {
3
+ Component,
4
+ } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.addcomponentlibrarysectionitemmodalwindow/main';
5
+ import type {
6
+ RepurchaseListExpressionDataSource
7
+ } from '@easy-wizzy/retailrocket-repurchase';
8
+ import type {
9
+ RepurchaseNumberExpressionDataSource
10
+ } from '@easy-wizzy/retailrocket-repurchase';
11
+ import type {
12
+ RepurchaseStringExpressionDataSource
13
+ } from '@easy-wizzy/retailrocket-repurchase';
14
+
15
+ export const repurchaseEmailComponentFactory = (
16
+ component: Component
17
+ ): EmailComponentType<
18
+ RepurchaseListExpressionDataSource,
19
+ RepurchaseNumberExpressionDataSource,
20
+ RepurchaseStringExpressionDataSource
21
+ > =>
22
+ {
23
+ return component.triggerRepurchase
24
+ ? JSON.parse(component.triggerRepurchase.componentJson)
25
+ : JSON.parse(component.common!.componentJson)
26
+ }
@@ -0,0 +1,29 @@
1
+ import type {
2
+ ComponentLibrarySection,
3
+ } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.componentlibrary/main';
4
+ import type {
5
+ CustomComponentLibraryType
6
+ } from '@easy-wizzy/core';
7
+ import type {
8
+ RepurchaseListExpressionDataSource
9
+ } from '@easy-wizzy/retailrocket-repurchase';
10
+ import type {
11
+ RepurchaseNumberExpressionDataSource
12
+ } from '@easy-wizzy/retailrocket-repurchase';
13
+ import type {
14
+ RepurchaseStringExpressionDataSource
15
+ } from '@easy-wizzy/retailrocket-repurchase';
16
+ import {
17
+ repurchaseSectionFactory
18
+ } from '@/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CustomComponentLibrary/repurchaseSectionFactory';
19
+
20
+ export const repurchaseComponentLibraryFactory = (
21
+ componentLibrary: Array<ComponentLibrarySection>
22
+ ): CustomComponentLibraryType<
23
+ RepurchaseListExpressionDataSource,
24
+ RepurchaseNumberExpressionDataSource,
25
+ RepurchaseStringExpressionDataSource
26
+ > => {
27
+ return componentLibrary
28
+ .map(section => repurchaseSectionFactory(section))
29
+ }
@@ -0,0 +1,32 @@
1
+ import type {
2
+ ComponentLibrarySection,
3
+ } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.componentlibrary/main';
4
+ import type { CustomComponentSectionType } from '@easy-wizzy/core';
5
+ import type {
6
+ RepurchaseListExpressionDataSource
7
+ } from '@easy-wizzy/retailrocket-repurchase';
8
+ import type {
9
+ RepurchaseNumberExpressionDataSource
10
+ } from '@easy-wizzy/retailrocket-repurchase';
11
+ import type {
12
+ RepurchaseStringExpressionDataSource
13
+ } from '@easy-wizzy/retailrocket-repurchase';
14
+ import {
15
+ repurchaseComponentSectionItemFactory
16
+ } from '@/implementation/Apps/components/WysiwygTemplateEditor/AsideMenu/ComponentLibrary/CreateComponentLibrarySectionModalWindow/repurchaseComponentSectionItemFactory';
17
+
18
+ export const repurchaseSectionFactory = (
19
+ section: ComponentLibrarySection,
20
+ ): CustomComponentSectionType<
21
+ RepurchaseListExpressionDataSource,
22
+ RepurchaseNumberExpressionDataSource,
23
+ RepurchaseStringExpressionDataSource
24
+ > => {
25
+ return {
26
+ sectionId: section.sectionId,
27
+ sectionName: section.sectionName,
28
+ componentList: section
29
+ .sectionItems
30
+ .map(component => repurchaseComponentSectionItemFactory(component)),
31
+ };
32
+ };
@@ -0,0 +1,134 @@
1
+ import type {
2
+ DataListType
3
+ } from '@easy-wizzy/core';
4
+ import type { ListExpressionDataSourceBffClient } from '@easy-wizzy/common-app';
5
+ import type { ListExpressionDataSourceEvaluatorDelegate } from '@easy-wizzy/core';
6
+ import { getPopularProducts } from '@easy-wizzy/common-app';
7
+ import { stockIdFactory } from '@easy-wizzy/common-app';
8
+ import type { RepurchaseListExpressionDataSource } from '@easy-wizzy/retailrocket-repurchase';
9
+ import { repurchaseListExpressionDataSourceMatcher } from '@easy-wizzy/retailrocket-repurchase';
10
+ import { getProductList } from '@easy-wizzy/common-app';
11
+ import { getRelatedProducts } from '@easy-wizzy/common-app';
12
+ import { getAlternativeProducts } from '@easy-wizzy/common-app';
13
+ import { getPopularProductsInCategories } from '@easy-wizzy/common-app';
14
+ import type { Product } from '@retailrocket/retailrocket.wysiwyg.bff.v2.apiclients.listexpressiondatasource';
15
+ import { getLatestProducts } from '@easy-wizzy/common-app';
16
+ import { getSaleByPopularProducts } from '@easy-wizzy/common-app';
17
+ import { getSaleByLatestProducts } from '@easy-wizzy/common-app';
18
+ import { getSampleProductsForPreview } from '@easy-wizzy/common-app';
19
+
20
+ export const repurchaseEvaluateListExpressionDataSourceFactory = (arg: {
21
+ partnerId: string;
22
+ listExpressionDataSourceBffClient: ListExpressionDataSourceBffClient;
23
+ customerStockId: string | undefined;
24
+ }): ListExpressionDataSourceEvaluatorDelegate<RepurchaseListExpressionDataSource> => {
25
+ let productCache: { [key: string]: Product } = {};
26
+
27
+ return (asyncDataSource: RepurchaseListExpressionDataSource) =>
28
+ repurchaseListExpressionDataSourceMatcher(asyncDataSource).Match<Promise<DataListType>>({
29
+ RepurchaseProductList: ({ StockSource }) =>
30
+ getSampleProductsForPreview({
31
+ partnerId: arg.partnerId,
32
+ stockId: stockIdFactory({
33
+ stockSource: StockSource,
34
+ customerStockId: arg.customerStockId,
35
+ }),
36
+ getSampleProductsForPreviewHttpClient: arg.listExpressionDataSourceBffClient.postGetSampleProductsForPreview,
37
+ }),
38
+ RelatedProductsForRepurchaseProductList: ({ StockSource }) =>
39
+ getSampleProductsForPreview({
40
+ partnerId: arg.partnerId,
41
+ stockId: stockIdFactory({
42
+ stockSource: StockSource,
43
+ customerStockId: arg.customerStockId,
44
+ }),
45
+ getSampleProductsForPreviewHttpClient: arg.listExpressionDataSourceBffClient.postGetSampleProductsForPreview,
46
+ }),
47
+ AlternativeProductsForRepurchaseProductList: ({ StockSource }) =>
48
+ getSampleProductsForPreview({
49
+ partnerId: arg.partnerId,
50
+ stockId: stockIdFactory({
51
+ stockSource: StockSource,
52
+ customerStockId: arg.customerStockId,
53
+ }),
54
+ getSampleProductsForPreviewHttpClient: arg.listExpressionDataSourceBffClient.postGetSampleProductsForPreview,
55
+ }),
56
+ ProductList: ({ ProductIds, StockSource }) =>
57
+ getProductList({
58
+ partnerId: arg.partnerId,
59
+ productIDs: ProductIds,
60
+ stockId: stockIdFactory({
61
+ stockSource: StockSource,
62
+ customerStockId: arg.customerStockId,
63
+ }),
64
+ productCache: productCache,
65
+ getProductsByIDsHttpClient: arg.listExpressionDataSourceBffClient.postGetProductsByIds,
66
+ }),
67
+ RelatedProductsFor: ({ ProductIds, StockSource }) =>
68
+ getRelatedProducts({
69
+ partnerId: arg.partnerId,
70
+ productIDs: ProductIds,
71
+ stockId: stockIdFactory({
72
+ stockSource: StockSource,
73
+ customerStockId: arg.customerStockId
74
+ }),
75
+ getRelatedProducts: arg.listExpressionDataSourceBffClient.postGetRelatedRecommendations,
76
+ }),
77
+ AlternativeProductsFor: ({ ProductIds, StockSource }) =>
78
+ getAlternativeProducts({
79
+ partnerId: arg.partnerId,
80
+ productIDs: ProductIds,
81
+ stockId: stockIdFactory({
82
+ stockSource: StockSource,
83
+ customerStockId: arg.customerStockId,
84
+ }),
85
+ getAlternativeProductsHttpClient: arg.listExpressionDataSourceBffClient.postGetAlternativeRecommendations,
86
+ }),
87
+ PopularProductsInCategories: ({ CategoryIds, StockSource }) =>
88
+ getPopularProductsInCategories({
89
+ partnerId: arg.partnerId,
90
+ categoryIds: CategoryIds,
91
+ stockId: stockIdFactory({
92
+ stockSource: StockSource,
93
+ customerStockId: arg.customerStockId,
94
+ }),
95
+ getPopularProductsInCategoriesHttpClient: arg.listExpressionDataSourceBffClient.postGetPopularInCategoriesRecommendations,
96
+ }),
97
+ Popular: ({ StockSource }) =>
98
+ getPopularProducts({
99
+ partnerId: arg.partnerId,
100
+ stockId: stockIdFactory({
101
+ stockSource: StockSource,
102
+ customerStockId: arg.customerStockId,
103
+ }),
104
+ getPopularProductsHttpClient: arg.listExpressionDataSourceBffClient.postGetPopularRecommendations,
105
+ }),
106
+ Latest: ({ StockSource }) =>
107
+ getLatestProducts({
108
+ partnerId: arg.partnerId,
109
+ stockId: stockIdFactory({
110
+ stockSource: StockSource,
111
+ customerStockId: arg.customerStockId,
112
+ }),
113
+ getLatestProductsHttpClient: arg.listExpressionDataSourceBffClient.postGetLatestRecommendations,
114
+ }),
115
+ SaleByPopular: ({ StockSource }) =>
116
+ getSaleByPopularProducts({
117
+ partnerId: arg.partnerId,
118
+ stockId: stockIdFactory({
119
+ stockSource: StockSource,
120
+ customerStockId: arg.customerStockId,
121
+ }),
122
+ getSaleByPopularProductsHttpClient: arg.listExpressionDataSourceBffClient.postGetSaleByPopularRecommendations,
123
+ }),
124
+ SaleByLatest: ({ StockSource }) =>
125
+ getSaleByLatestProducts({
126
+ partnerId: arg.partnerId,
127
+ stockId: stockIdFactory({
128
+ stockSource: StockSource,
129
+ customerStockId: arg.customerStockId,
130
+ }),
131
+ getSaleByLatestProductsHttpClient: arg.listExpressionDataSourceBffClient.postGetSaleByLatestRecommendations,
132
+ }),
133
+ });
134
+ };
@@ -0,0 +1,10 @@
1
+ import type {
2
+ NumberExpressionDataSourceEvaluatorDelegate
3
+ } from '@easy-wizzy/core';
4
+
5
+ export const repurchaseEvaluateNumberExpressionDataSourceFactory = <
6
+ TNumberExpressionDataSource
7
+ >():
8
+ NumberExpressionDataSourceEvaluatorDelegate<TNumberExpressionDataSource> => {
9
+ return () => Promise.resolve(0);
10
+ }
@@ -0,0 +1,56 @@
1
+ import type {
2
+ StringExpressionDataSourceEvaluatorDelegate
3
+ } from '@easy-wizzy/core';
4
+ import type { ContactCustomData } from '@easy-wizzy/retailrocket-common';
5
+ import type {
6
+ ProductImageUrlBuilderExpressionEvaluatorDelegate
7
+ } from '@easy-wizzy/common-app';
8
+ import type {
9
+ DataType
10
+ } from '@easy-wizzy/core';
11
+ import type {
12
+ RepurchaseListExpressionDataSource
13
+ } from '@easy-wizzy/retailrocket-repurchase';
14
+ import type {
15
+ RepurchaseNumberExpressionDataSource
16
+ } from '@easy-wizzy/retailrocket-repurchase';
17
+ import type {
18
+ RepurchaseStringExpressionDataSource
19
+ } from '@easy-wizzy/retailrocket-repurchase';
20
+ import {
21
+ repurchaseStringExpressionDataSourceMatcher
22
+ } from '@easy-wizzy/retailrocket-repurchase';
23
+ import type { NextCouponFromBatchType } from '@easy-wizzy/retailrocket-common';
24
+
25
+ export const repurchaseStringExpressionDataSourceEvaluatorFactory = (arg: {
26
+ productImageUrlBuilderExpressionEvaluator: ProductImageUrlBuilderExpressionEvaluatorDelegate<
27
+ RepurchaseListExpressionDataSource,
28
+ RepurchaseNumberExpressionDataSource
29
+ >
30
+ contactCustomData: ContactCustomData
31
+ nextCouponFromBatch: NextCouponFromBatchType
32
+ }): StringExpressionDataSourceEvaluatorDelegate<
33
+ RepurchaseStringExpressionDataSource
34
+ > => {
35
+ const repurchaseContactCustomData = arg.contactCustomData;
36
+
37
+ return (a: {
38
+ stringExpressionDataSource: RepurchaseStringExpressionDataSource,
39
+ context: DataType
40
+ }) => repurchaseStringExpressionDataSourceMatcher(
41
+ a.stringExpressionDataSource
42
+ )
43
+ .Match({
44
+ StringFromContactCustomData: (x) => Promise.resolve(repurchaseContactCustomData[x.FieldName] as string),
45
+ StringFromContactCustomDataWithFallback: (x) => Promise.resolve(
46
+ x.FieldName in repurchaseContactCustomData && typeof repurchaseContactCustomData[x.FieldName] === 'string'
47
+ ? repurchaseContactCustomData[x.FieldName] as string
48
+ : x.FallbackValue
49
+ ),
50
+ ProductImageUrlBuilderExpression: e => arg.productImageUrlBuilderExpressionEvaluator({
51
+ expression: e,
52
+ context: a.context
53
+ }),
54
+ NextCouponFromBatch: () => Promise.resolve('Coupon')
55
+ });
56
+ }
@@ -0,0 +1,33 @@
1
+ import type { LocaleKey } from '@easy-wizzy/core';
2
+ import type { ProductShelfBuilderModalWindowBffClient } from '@easy-wizzy/common-app';
3
+ import {
4
+ getAllStockIdsFactory
5
+ } from '@easy-wizzy/common-app';
6
+ import type {
7
+ AlternativeProductsForRepurchaseProductListShelfBuilderDeps
8
+ } from '@easy-wizzy/retailrocket-repurchase';
9
+
10
+ export const alternativeProductsForAbandonedProductListShelfBuilderDepsFactory = (
11
+ arg: {
12
+ localeKey: LocaleKey;
13
+ partnerId: string,
14
+ getAllStockIdsHttpClient: ProductShelfBuilderModalWindowBffClient['postGetAllStockIds']
15
+ }
16
+ ): AlternativeProductsForRepurchaseProductListShelfBuilderDeps => {
17
+ return {
18
+ localeKey: arg.localeKey,
19
+ getAllStockIds: getAllStockIdsFactory({
20
+ partnerId: arg.partnerId,
21
+ getAllStockIdsHttpClient: arg.getAllStockIdsHttpClient
22
+ }),
23
+ stockSelectorDeps: {
24
+ localeKey: arg.localeKey,
25
+ stockSourceSelectorDeps: {
26
+ localeKey: arg.localeKey
27
+ }
28
+ },
29
+ productListShelfLimiterDeps: {
30
+ localeKey: arg.localeKey
31
+ }
32
+ }
33
+ }
@@ -0,0 +1,33 @@
1
+ import type { LocaleKey } from '@easy-wizzy/core';
2
+ import type { ProductShelfBuilderModalWindowBffClient } from '@easy-wizzy/common-app';
3
+ import {
4
+ getAllStockIdsFactory
5
+ } from '@easy-wizzy/common-app';
6
+ import type {
7
+ RelatedProductsForRepurchaseProductListShelfBuilderDeps
8
+ } from '@easy-wizzy/retailrocket-repurchase';
9
+
10
+ export const relatedProductsForAbandonedProductListShelfBuilderDepsFactory = (
11
+ arg: {
12
+ localeKey: LocaleKey;
13
+ partnerId: string,
14
+ getAllStockIdsHttpClient: ProductShelfBuilderModalWindowBffClient['postGetAllStockIds']
15
+ }
16
+ ): RelatedProductsForRepurchaseProductListShelfBuilderDeps => {
17
+ return {
18
+ localeKey: arg.localeKey,
19
+ getAllStockIds: getAllStockIdsFactory({
20
+ partnerId: arg.partnerId,
21
+ getAllStockIdsHttpClient: arg.getAllStockIdsHttpClient
22
+ }),
23
+ stockSelectorDeps: {
24
+ localeKey: arg.localeKey,
25
+ stockSourceSelectorDeps: {
26
+ localeKey: arg.localeKey
27
+ }
28
+ },
29
+ productListShelfLimiterDeps: {
30
+ localeKey: arg.localeKey
31
+ }
32
+ }
33
+ }
@@ -0,0 +1,33 @@
1
+ import type { LocaleKey } from '@easy-wizzy/core';
2
+ import type { ProductShelfBuilderModalWindowBffClient } from '@easy-wizzy/common-app';
3
+ import {
4
+ getAllStockIdsFactory
5
+ } from '@easy-wizzy/common-app';
6
+ import type {
7
+ RepurchaseProductListShelfBuilderDeps
8
+ } from '@easy-wizzy/retailrocket-repurchase';
9
+
10
+ export const repurchaseProductListShelfBuilderDepsFactory = (
11
+ arg: {
12
+ localeKey: LocaleKey;
13
+ partnerId: string,
14
+ getAllStockIdsHttpClient: ProductShelfBuilderModalWindowBffClient['postGetAllStockIds']
15
+ }
16
+ ): RepurchaseProductListShelfBuilderDeps => {
17
+ return {
18
+ localeKey: arg.localeKey,
19
+ getAllStockIds: getAllStockIdsFactory({
20
+ partnerId: arg.partnerId,
21
+ getAllStockIdsHttpClient: arg.getAllStockIdsHttpClient
22
+ }),
23
+ stockSelectorDeps: {
24
+ localeKey: arg.localeKey,
25
+ stockSourceSelectorDeps: {
26
+ localeKey: arg.localeKey
27
+ }
28
+ },
29
+ productListShelfLimiterDeps: {
30
+ localeKey: arg.localeKey
31
+ }
32
+ }
33
+ }
@@ -0,0 +1,151 @@
1
+ import type { LocaleKey } from '@easy-wizzy/core';
2
+ import {
3
+ popularProductListShelfBuilderDepsFactory
4
+ } from '@easy-wizzy/common-app';
5
+ import type { ProductShelfBuilderModalWindowBffClient } from '@easy-wizzy/common-app';
6
+ import type {
7
+ RepurchaseProductShelfDataSourceExpressionBuilderModalDeps
8
+ } from '@easy-wizzy/retailrocket-repurchase';
9
+ import {
10
+ alternativeProductsForAbandonedProductListShelfBuilderDepsFactory
11
+ } from '@/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/RepurchaseProductShelfDataSourceExpressionBuilderModal/ShelfBuilders/alternativeProductsForRepurchaseProductListShelfBuilderDepsFactory';
12
+ import {
13
+ repurchaseProductListShelfBuilderDepsFactory
14
+ } from '@/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/RepurchaseProductShelfDataSourceExpressionBuilderModal/ShelfBuilders/repurchaseProductListShelfBuilderDepsFactory';
15
+ import {
16
+ relatedProductsForAbandonedProductListShelfBuilderDepsFactory
17
+ } from '@/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/RepurchaseProductShelfDataSourceExpressionBuilderModal/ShelfBuilders/relatedProductsForRepurchaseProductListShelfBuilderDepsFactory';
18
+ import {
19
+ latestProductListShelfBuilderDepsFactory
20
+ } from '@easy-wizzy/common-app';
21
+ import {
22
+ saleByPopularProductListShelfBuilderDepsFactory
23
+ } from '@easy-wizzy/common-app';
24
+ import {
25
+ saleByLatestProductListShelfBuilderDepsFactory
26
+ } from '@easy-wizzy/common-app';
27
+ import {
28
+ productListComposerModalWindowDepsFactory
29
+ } from '@easy-wizzy/common-app';
30
+
31
+ import type { ProductPickerModalWindowBffClient } from '@easy-wizzy/common-app';
32
+ import {
33
+ categoryListComposerModalWindowDepsFactory
34
+ } from '@easy-wizzy/common-app';
35
+ import {
36
+ alternativeProductListShelfBuilderDepsFactory
37
+ } from '@easy-wizzy/common-app';
38
+ import {
39
+ relatedProductListShelfBuilderDepsFactory
40
+ } from '@easy-wizzy/common-app';
41
+ import {
42
+ productListShelfBuilderDepsFactory
43
+ } from '@easy-wizzy/common-app';
44
+ import {
45
+ popularFromCategoryListShelfBuilderDepsFactory
46
+ } from '@easy-wizzy/common-app';
47
+ import type {
48
+ ProductCategoryPickerModalWindowBffClient
49
+ } from '@easy-wizzy/common-app';
50
+
51
+ export const repurchaseProductShelfDataSourceExpressionBuilderModalDepsFactory = (
52
+ arg: {
53
+ localeKey: LocaleKey;
54
+ partnerId: string,
55
+ customerStockId: string | undefined,
56
+ productShelfBuilderModalWindowBffClient: ProductShelfBuilderModalWindowBffClient,
57
+ productCategoryPickerModalWindowBffClient: ProductCategoryPickerModalWindowBffClient,
58
+ productPickerModalWindowBffClient: ProductPickerModalWindowBffClient,
59
+ }
60
+ ): RepurchaseProductShelfDataSourceExpressionBuilderModalDeps => {
61
+
62
+ const productCache = {};
63
+ const categoryCache = {};
64
+
65
+ const productListComposerModalWindowDeps = productListComposerModalWindowDepsFactory({
66
+ localeKey: arg.localeKey,
67
+ partnerId: arg.partnerId,
68
+ customerStockId: arg.customerStockId,
69
+ productPickerModalWindowBffClient: arg.productPickerModalWindowBffClient,
70
+ });
71
+
72
+ return {
73
+ localeKey: arg.localeKey,
74
+ ProductListComposerModalWindowDeps: productListComposerModalWindowDeps,
75
+ CategoryListComposerModalWindowDeps: categoryListComposerModalWindowDepsFactory({
76
+ localeKey: arg.localeKey,
77
+ partnerId: arg.partnerId,
78
+ productCategoryPickerModalWindowBffClient: arg.productCategoryPickerModalWindowBffClient
79
+ }),
80
+ RepurchaseProductListShelfBuilderDeps: repurchaseProductListShelfBuilderDepsFactory({
81
+ localeKey: arg.localeKey,
82
+ partnerId: arg.partnerId,
83
+ getAllStockIdsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetAllStockIds
84
+ }),
85
+ AlternativeProductsForRepurchaseProductListShelfBuilderDeps: alternativeProductsForAbandonedProductListShelfBuilderDepsFactory({
86
+ localeKey: arg.localeKey,
87
+ partnerId: arg.partnerId,
88
+ getAllStockIdsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetAllStockIds
89
+ }),
90
+ RelatedProductsForRepurchaseProductListShelfBuilderDeps: relatedProductsForAbandonedProductListShelfBuilderDepsFactory({
91
+ localeKey: arg.localeKey,
92
+ partnerId: arg.partnerId,
93
+ getAllStockIdsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetAllStockIds
94
+ }),
95
+ ProductListShelfBuilderDeps: productListShelfBuilderDepsFactory({
96
+ localeKey: arg.localeKey,
97
+ partnerId: arg.partnerId,
98
+ customerStockId: arg.customerStockId,
99
+ productCache: productCache,
100
+ getProductsByIDsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetProductsByIds,
101
+ getAllStockIdsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetAllStockIds,
102
+ productListComposerModalWindowDeps: productListComposerModalWindowDeps
103
+ }),
104
+ RelatedProductListShelfBuilderDeps: relatedProductListShelfBuilderDepsFactory({
105
+ localeKey: arg.localeKey,
106
+ partnerId: arg.partnerId,
107
+ customerStockId: arg.customerStockId,
108
+ productCache: productCache,
109
+ getProductsByIDsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetProductsByIds,
110
+ getAllStockIdsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetAllStockIds,
111
+ productListComposerModalWindowDeps: productListComposerModalWindowDeps
112
+ }),
113
+ AlternativeProductListShelfBuilderDeps: alternativeProductListShelfBuilderDepsFactory({
114
+ localeKey: arg.localeKey,
115
+ partnerId: arg.partnerId,
116
+ customerStockId: arg.customerStockId,
117
+ productCache: productCache,
118
+ getProductsByIDsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetProductsByIds,
119
+ getAllStockIdsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetAllStockIds,
120
+ productListComposerModalWindowDeps: productListComposerModalWindowDeps
121
+ }),
122
+ PopularFromCategoryListShelfBuilderDeps: popularFromCategoryListShelfBuilderDepsFactory({
123
+ localeKey: arg.localeKey,
124
+ partnerId: arg.partnerId,
125
+ categoryCache: categoryCache,
126
+ getAllStockIdsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetAllStockIds,
127
+ getCategoriesByIDsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetProductCategoriesByIds,
128
+ productCategoryPickerModalWindowBffClient: arg.productCategoryPickerModalWindowBffClient
129
+ }),
130
+ PopularProductListShelfBuilderDeps: popularProductListShelfBuilderDepsFactory({
131
+ localeKey: arg.localeKey,
132
+ partnerId: arg.partnerId,
133
+ getAllStockIdsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetAllStockIds
134
+ }),
135
+ LatestProductListShelfBuilderDeps: latestProductListShelfBuilderDepsFactory({
136
+ localeKey: arg.localeKey,
137
+ partnerId: arg.partnerId,
138
+ getAllStockIdsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetAllStockIds
139
+ }),
140
+ SaleByPopularProductListShelfBuilderDeps: saleByPopularProductListShelfBuilderDepsFactory({
141
+ localeKey: arg.localeKey,
142
+ partnerId: arg.partnerId,
143
+ getAllStockIdsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetAllStockIds
144
+ }),
145
+ SaleByLatestProductListShelfBuilderDeps: saleByLatestProductListShelfBuilderDepsFactory({
146
+ localeKey: arg.localeKey,
147
+ partnerId: arg.partnerId,
148
+ getAllStockIdsHttpClient: arg.productShelfBuilderModalWindowBffClient.postGetAllStockIds
149
+ })
150
+ }
151
+ }
@@ -0,0 +1,35 @@
1
+ import type { LocaleKey } from '@easy-wizzy/core';
2
+ import type { ProductShelfBuilderModalWindowBffClient } from '@easy-wizzy/common-app';
3
+ import type {
4
+ RepurchaseProductShelfDataSourceExpressionBuilderDeps
5
+ } from '@easy-wizzy/retailrocket-repurchase';
6
+ import {
7
+ repurchaseProductShelfDataSourceExpressionBuilderModalDepsFactory
8
+ } from '@/implementation/EmailComponentSettingsModifierPlugin/ProductShelfDataSourceExpressionBuilder/RepurchaseProductShelfDataSourceExpressionBuilderModal/repurchaseProductShelfDataSourceExpressionBuilderModalDepsFactory';
9
+
10
+ import type { ProductPickerModalWindowBffClient } from '@easy-wizzy/common-app';
11
+ import type {
12
+ ProductCategoryPickerModalWindowBffClient
13
+ } from '@easy-wizzy/common-app';
14
+
15
+ export const repurchaseProductShelfDataSourceExpressionBuilderDepsFactory = (
16
+ arg: {
17
+ localeKey: LocaleKey;
18
+ partnerId: string,
19
+ customerStockId: string | undefined,
20
+ productShelfBuilderModalWindowBffClient: ProductShelfBuilderModalWindowBffClient,
21
+ productCategoryPickerModalWindowBffClient: ProductCategoryPickerModalWindowBffClient,
22
+ productPickerModalWindowBffClient: ProductPickerModalWindowBffClient
23
+ }
24
+ ): RepurchaseProductShelfDataSourceExpressionBuilderDeps => {
25
+ return {
26
+ repurchaseProductShelfDataSourceExpressionBuilderModalDeps: repurchaseProductShelfDataSourceExpressionBuilderModalDepsFactory({
27
+ localeKey: arg.localeKey,
28
+ partnerId: arg.partnerId,
29
+ customerStockId: arg.customerStockId,
30
+ productShelfBuilderModalWindowBffClient: arg.productShelfBuilderModalWindowBffClient,
31
+ productCategoryPickerModalWindowBffClient: arg.productCategoryPickerModalWindowBffClient,
32
+ productPickerModalWindowBffClient: arg.productPickerModalWindowBffClient
33
+ })
34
+ }
35
+ }
package/src/index.ts ADDED
File without changes
@@ -0,0 +1,19 @@
1
+ {
2
+ "extends": "@easy-wizzy/ts-config/app.json",
3
+ "include": [
4
+ "env.d.ts",
5
+ "src/**/*.ts",
6
+ "src/**/*.vue"
7
+ ],
8
+ "exclude": [
9
+ "src/**/*.spec.ts"
10
+ ],
11
+ "compilerOptions": {
12
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
13
+ "paths": {
14
+ "@/*": [
15
+ "./src/*"
16
+ ]
17
+ }
18
+ }
19
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "files": [],
3
+ "references": [
4
+ {
5
+ "path": "./tsconfig.node.json"
6
+ },
7
+ {
8
+ "path": "./tsconfig.app.json"
9
+ },
10
+ {
11
+ "path": "./tsconfig.test.json"
12
+ }
13
+ ]
14
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": "@easy-wizzy/ts-config/node.json",
3
+ "include": [
4
+ "vite.config.*",
5
+ "vitest.config.*",
6
+ "eslint.config.*"
7
+ ],
8
+ "compilerOptions": {
9
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo"
10
+ }
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": "./tsconfig.app.json",
3
+ "include": [
4
+ "env.d.ts",
5
+ "src/**/*.spec.ts"
6
+ ],
7
+ "exclude": [],
8
+ "compilerOptions": {
9
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.test.tsbuildinfo"
10
+ }
11
+ }