@infrab4a/connect 5.7.4 → 5.7.6
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/index.cjs.js +148 -2
- package/index.esm.js +144 -3
- package/package.json +1 -1
- package/src/domain/catalog/models/category.d.ts +12 -0
- package/src/domain/shopping/index.d.ts +1 -0
- package/src/domain/shopping/mappers/index.d.ts +1 -0
- package/src/domain/shopping/mappers/line-item-recurrence.mapper.d.ts +5 -0
- package/src/domain/shopping/models/line-item.d.ts +5 -0
- package/src/domain/shopping/models/order.d.ts +1 -0
- package/src/domain/shopping/models/recurrence/index.d.ts +1 -0
- package/src/domain/shopping/models/recurrence/shopping-recurrence-error-log.d.ts +9 -0
- package/src/domain/shopping/models/types/line-item-recurrence.type.d.ts +1 -1
- package/src/domain/shopping/repositories/recurrence/index.d.ts +1 -0
- package/src/domain/shopping/repositories/recurrence/shopping-recurrence-error-log.repository.d.ts +4 -0
- package/src/domain/shopping/types/create-recurrency-payload.type.d.ts +0 -2
- package/src/domain/shopping/types/index.d.ts +1 -0
- package/src/domain/shopping/types/shopping-recurrence-update-payloads.type.d.ts +35 -0
- package/src/infra/cache/index.d.ts +1 -0
- package/src/infra/cache/resolve-cache-config.d.ts +2 -0
- package/src/infra/cache/restcache.adapter.d.ts +3 -0
- package/src/infra/firebase/firestore/repositories/shopping/index.d.ts +1 -0
- package/src/infra/firebase/firestore/repositories/shopping/shopping-recurrence-error-log-firestore.repository.d.ts +7 -0
package/index.cjs.js
CHANGED
|
@@ -175,6 +175,51 @@ class PaymentProviderFactory {
|
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
+
function toLineItemRecurrence(item) {
|
|
179
|
+
if (item.recurrenceCycle == null) {
|
|
180
|
+
throw new Error(`Line item ${item.id ?? item.sku ?? 'unknown'} is missing recurrenceCycle`);
|
|
181
|
+
}
|
|
182
|
+
return {
|
|
183
|
+
id: item.id,
|
|
184
|
+
EAN: item.EAN,
|
|
185
|
+
sku: item.sku,
|
|
186
|
+
slug: item.slug,
|
|
187
|
+
name: item.name,
|
|
188
|
+
description: item.description,
|
|
189
|
+
brand: item.brand,
|
|
190
|
+
gender: item.gender,
|
|
191
|
+
costPrice: item.costPrice,
|
|
192
|
+
discount: item.discount,
|
|
193
|
+
weight: item.weight,
|
|
194
|
+
pricePaid: item.pricePaid,
|
|
195
|
+
quantity: item.quantity,
|
|
196
|
+
images: item.images,
|
|
197
|
+
miniatures: item.miniatures,
|
|
198
|
+
recurrenceCycle: item.recurrenceCycle,
|
|
199
|
+
recurrenceDiscountPercentage: item.recurrenceDiscountPercentage,
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
function groupRecurringLineItemsByCycle(items) {
|
|
203
|
+
const groups = new Map();
|
|
204
|
+
for (const item of items) {
|
|
205
|
+
if (!item.recurrenceCartItem) {
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
208
|
+
if (item.recurrenceCycle == null) {
|
|
209
|
+
throw new Error(`Line item ${item.id ?? item.sku ?? 'unknown'} has recurrenceCartItem but is missing recurrenceCycle`);
|
|
210
|
+
}
|
|
211
|
+
const mapped = toLineItemRecurrence(item);
|
|
212
|
+
const existing = groups.get(item.recurrenceCycle);
|
|
213
|
+
if (existing) {
|
|
214
|
+
existing.push(mapped);
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
groups.set(item.recurrenceCycle, [mapped]);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
return groups;
|
|
221
|
+
}
|
|
222
|
+
|
|
178
223
|
const registry = new Map();
|
|
179
224
|
function registerClass(name, classConstructor) {
|
|
180
225
|
registry.set(name, classConstructor);
|
|
@@ -751,12 +796,36 @@ class Category extends BaseModel {
|
|
|
751
796
|
image: null,
|
|
752
797
|
};
|
|
753
798
|
}
|
|
799
|
+
get glamBeautyImages() {
|
|
800
|
+
return this.images?.[exports.Shops.GLAMBEAUTY]
|
|
801
|
+
? this.images[exports.Shops.GLAMBEAUTY]
|
|
802
|
+
: {
|
|
803
|
+
brandBanner: null,
|
|
804
|
+
brandBannerMobile: null,
|
|
805
|
+
image: null,
|
|
806
|
+
};
|
|
807
|
+
}
|
|
808
|
+
get ellaImages() {
|
|
809
|
+
return this.images?.[exports.Shops.ELLA]
|
|
810
|
+
? this.images[exports.Shops.ELLA]
|
|
811
|
+
: {
|
|
812
|
+
brandBanner: null,
|
|
813
|
+
brandBannerMobile: null,
|
|
814
|
+
image: null,
|
|
815
|
+
};
|
|
816
|
+
}
|
|
754
817
|
get glamMetadata() {
|
|
755
818
|
return this.metadatas.find((metadata) => metadata.shop === exports.Shops.GLAMSHOP);
|
|
756
819
|
}
|
|
757
820
|
get mensMetadata() {
|
|
758
821
|
return this.metadatas.find((metadata) => metadata.shop === exports.Shops.MENSMARKET);
|
|
759
822
|
}
|
|
823
|
+
get glamBeautyMetadata() {
|
|
824
|
+
return this.metadatas.find((metadata) => metadata.shop === exports.Shops.GLAMBEAUTY);
|
|
825
|
+
}
|
|
826
|
+
get ellaMetadata() {
|
|
827
|
+
return this.metadatas.find((metadata) => metadata.shop === exports.Shops.ELLA);
|
|
828
|
+
}
|
|
760
829
|
getMostRelevantByShop(shop) {
|
|
761
830
|
return this.mostRelevants?.[shop] || [];
|
|
762
831
|
}
|
|
@@ -1770,6 +1839,12 @@ class ShoppingRecurrenceEdition extends BaseModel {
|
|
|
1770
1839
|
}
|
|
1771
1840
|
}
|
|
1772
1841
|
|
|
1842
|
+
class ShoppingRecurrenceErrorLog extends BaseModel {
|
|
1843
|
+
static get identifiersFields() {
|
|
1844
|
+
return ['id'];
|
|
1845
|
+
}
|
|
1846
|
+
}
|
|
1847
|
+
|
|
1773
1848
|
class CheckoutSubscription extends BaseModel {
|
|
1774
1849
|
static get identifiersFields() {
|
|
1775
1850
|
return ['id'];
|
|
@@ -2690,11 +2765,39 @@ class AdyenCardAxiosAdapter {
|
|
|
2690
2765
|
}
|
|
2691
2766
|
}
|
|
2692
2767
|
|
|
2768
|
+
function resolveCacheConfig(cache) {
|
|
2769
|
+
if (lodash.isNil(cache) || typeof cache !== 'object')
|
|
2770
|
+
return undefined;
|
|
2771
|
+
const candidate = cache;
|
|
2772
|
+
const cacheAdapter = candidate.cacheAdapter;
|
|
2773
|
+
if (!cacheAdapter)
|
|
2774
|
+
return undefined;
|
|
2775
|
+
if (!isCacheAdapter(cacheAdapter))
|
|
2776
|
+
return undefined;
|
|
2777
|
+
if (typeof cacheAdapter.isConfigured === 'function' && !cacheAdapter.isConfigured()) {
|
|
2778
|
+
return undefined;
|
|
2779
|
+
}
|
|
2780
|
+
return {
|
|
2781
|
+
cacheAdapter,
|
|
2782
|
+
ttlDefault: candidate.ttlDefault,
|
|
2783
|
+
};
|
|
2784
|
+
}
|
|
2785
|
+
function isCacheAdapter(adapter) {
|
|
2786
|
+
return (typeof adapter.get === 'function' &&
|
|
2787
|
+
typeof adapter.set === 'function' &&
|
|
2788
|
+
typeof adapter.remove === 'function' &&
|
|
2789
|
+
typeof adapter.clear === 'function');
|
|
2790
|
+
}
|
|
2791
|
+
|
|
2693
2792
|
class RestCacheAdapter {
|
|
2694
2793
|
constructor(config) {
|
|
2794
|
+
this.client = null;
|
|
2695
2795
|
this.logger = new DebugHelper('RestCacheAdapter');
|
|
2796
|
+
this.configured = this.isValidBaseURL(config.baseURL);
|
|
2797
|
+
if (!this.configured)
|
|
2798
|
+
return;
|
|
2696
2799
|
this.client = axios__default["default"].create({
|
|
2697
|
-
baseURL: config.baseURL,
|
|
2800
|
+
baseURL: config.baseURL.trim(),
|
|
2698
2801
|
headers: {
|
|
2699
2802
|
'Content-Type': 'application/json',
|
|
2700
2803
|
...(lodash.isNil(config.authToken) ? {} : { Authorization: `Bearer ${config.authToken}` }),
|
|
@@ -2702,7 +2805,12 @@ class RestCacheAdapter {
|
|
|
2702
2805
|
},
|
|
2703
2806
|
});
|
|
2704
2807
|
}
|
|
2808
|
+
isConfigured() {
|
|
2809
|
+
return this.configured;
|
|
2810
|
+
}
|
|
2705
2811
|
async set(options) {
|
|
2812
|
+
if (!this.client)
|
|
2813
|
+
return false;
|
|
2706
2814
|
try {
|
|
2707
2815
|
const response = await this.client.post('/redis/set', {
|
|
2708
2816
|
key: options.key,
|
|
@@ -2718,6 +2826,8 @@ class RestCacheAdapter {
|
|
|
2718
2826
|
}
|
|
2719
2827
|
}
|
|
2720
2828
|
async get(key) {
|
|
2829
|
+
if (!this.client)
|
|
2830
|
+
return null;
|
|
2721
2831
|
try {
|
|
2722
2832
|
const response = await this.client.post('/redis/get', {
|
|
2723
2833
|
key,
|
|
@@ -2734,6 +2844,8 @@ class RestCacheAdapter {
|
|
|
2734
2844
|
}
|
|
2735
2845
|
}
|
|
2736
2846
|
async remove(key) {
|
|
2847
|
+
if (!this.client)
|
|
2848
|
+
return false;
|
|
2737
2849
|
try {
|
|
2738
2850
|
const response = await this.client.post('/redis/del', {
|
|
2739
2851
|
key,
|
|
@@ -2747,6 +2859,8 @@ class RestCacheAdapter {
|
|
|
2747
2859
|
}
|
|
2748
2860
|
}
|
|
2749
2861
|
async clear() {
|
|
2862
|
+
if (!this.client)
|
|
2863
|
+
return false;
|
|
2750
2864
|
try {
|
|
2751
2865
|
const response = await this.client.post('/redis/flushdb', {});
|
|
2752
2866
|
return response.data.success;
|
|
@@ -2757,6 +2871,9 @@ class RestCacheAdapter {
|
|
|
2757
2871
|
return false;
|
|
2758
2872
|
}
|
|
2759
2873
|
}
|
|
2874
|
+
isValidBaseURL(baseURL) {
|
|
2875
|
+
return lodash.isString(baseURL) && baseURL.trim().length > 0;
|
|
2876
|
+
}
|
|
2760
2877
|
}
|
|
2761
2878
|
|
|
2762
2879
|
class AxiosAdapter {
|
|
@@ -5582,6 +5699,18 @@ class ShoppingRecurrenceEditionFirestoreRepository extends withCrudFirestore(wit
|
|
|
5582
5699
|
}
|
|
5583
5700
|
}
|
|
5584
5701
|
|
|
5702
|
+
class ShoppingRecurrenceErrorLogFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
5703
|
+
constructor({ firestore, interceptors, cache, }) {
|
|
5704
|
+
super({
|
|
5705
|
+
firestore,
|
|
5706
|
+
collectionName: 'shoppingRecurrenceErrorLogs',
|
|
5707
|
+
model: ShoppingRecurrenceErrorLog,
|
|
5708
|
+
interceptors,
|
|
5709
|
+
cache,
|
|
5710
|
+
});
|
|
5711
|
+
}
|
|
5712
|
+
}
|
|
5713
|
+
|
|
5585
5714
|
class ShoppingRecurrenceFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
5586
5715
|
constructor({ firestore, interceptors, cache, }) {
|
|
5587
5716
|
super({
|
|
@@ -6091,7 +6220,7 @@ function createHasuraGraphQLClass(MixinBase) {
|
|
|
6091
6220
|
this.model = options.model;
|
|
6092
6221
|
this.fields = options.fields || this.model.identifiersFields;
|
|
6093
6222
|
this.logger = DebugHelper.from(this);
|
|
6094
|
-
this.cache = options.cache;
|
|
6223
|
+
this.cache = resolveCacheConfig(options.cache);
|
|
6095
6224
|
}
|
|
6096
6225
|
get headers() {
|
|
6097
6226
|
return HasuraAuthHelper.buildHeaders(this.authOptions);
|
|
@@ -7118,6 +7247,8 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
7118
7247
|
mostRelevants: mostRelevants || {
|
|
7119
7248
|
[exports.Shops.GLAMSHOP]: null,
|
|
7120
7249
|
[exports.Shops.MENSMARKET]: null,
|
|
7250
|
+
[exports.Shops.GLAMBEAUTY]: null,
|
|
7251
|
+
[exports.Shops.ELLA]: null,
|
|
7121
7252
|
},
|
|
7122
7253
|
images: images || {
|
|
7123
7254
|
[exports.Shops.GLAMSHOP]: {
|
|
@@ -7130,6 +7261,16 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
7130
7261
|
brandBannerMobile: null,
|
|
7131
7262
|
image: null,
|
|
7132
7263
|
},
|
|
7264
|
+
[exports.Shops.GLAMBEAUTY]: {
|
|
7265
|
+
brandBanner: null,
|
|
7266
|
+
brandBannerMobile: null,
|
|
7267
|
+
image: null,
|
|
7268
|
+
},
|
|
7269
|
+
[exports.Shops.ELLA]: {
|
|
7270
|
+
brandBanner: null,
|
|
7271
|
+
brandBannerMobile: null,
|
|
7272
|
+
image: null,
|
|
7273
|
+
},
|
|
7133
7274
|
},
|
|
7134
7275
|
});
|
|
7135
7276
|
}
|
|
@@ -11762,6 +11903,8 @@ exports.ShopSettingsFirestoreRepository = ShopSettingsFirestoreRepository;
|
|
|
11762
11903
|
exports.ShoppingRecurrence = ShoppingRecurrence;
|
|
11763
11904
|
exports.ShoppingRecurrenceEdition = ShoppingRecurrenceEdition;
|
|
11764
11905
|
exports.ShoppingRecurrenceEditionFirestoreRepository = ShoppingRecurrenceEditionFirestoreRepository;
|
|
11906
|
+
exports.ShoppingRecurrenceErrorLog = ShoppingRecurrenceErrorLog;
|
|
11907
|
+
exports.ShoppingRecurrenceErrorLogFirestoreRepository = ShoppingRecurrenceErrorLogFirestoreRepository;
|
|
11765
11908
|
exports.ShoppingRecurrenceFirestoreRepository = ShoppingRecurrenceFirestoreRepository;
|
|
11766
11909
|
exports.SignOut = SignOut;
|
|
11767
11910
|
exports.StockLimitError = StockLimitError;
|
|
@@ -11798,13 +11941,16 @@ exports.Wishlist = Wishlist;
|
|
|
11798
11941
|
exports.WishlistHasuraGraphQLRepository = WishlistHasuraGraphQLRepository;
|
|
11799
11942
|
exports.deserialize = deserialize;
|
|
11800
11943
|
exports.getClass = getClass;
|
|
11944
|
+
exports.groupRecurringLineItemsByCycle = groupRecurringLineItemsByCycle;
|
|
11801
11945
|
exports.is = is;
|
|
11802
11946
|
exports.isDebuggable = isDebuggable;
|
|
11803
11947
|
exports.isUUID = isUUID;
|
|
11804
11948
|
exports.parseDateTime = parseDateTime;
|
|
11805
11949
|
exports.registerClass = registerClass;
|
|
11950
|
+
exports.resolveCacheConfig = resolveCacheConfig;
|
|
11806
11951
|
exports.resolveClass = resolveClass;
|
|
11807
11952
|
exports.serialize = serialize;
|
|
11953
|
+
exports.toLineItemRecurrence = toLineItemRecurrence;
|
|
11808
11954
|
exports.withCreateFirestore = withCreateFirestore;
|
|
11809
11955
|
exports.withCreateHasuraGraphQL = withCreateHasuraGraphQL;
|
|
11810
11956
|
exports.withCrudFirestore = withCrudFirestore;
|
package/index.esm.js
CHANGED
|
@@ -151,6 +151,51 @@ class PaymentProviderFactory {
|
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
+
function toLineItemRecurrence(item) {
|
|
155
|
+
if (item.recurrenceCycle == null) {
|
|
156
|
+
throw new Error(`Line item ${item.id ?? item.sku ?? 'unknown'} is missing recurrenceCycle`);
|
|
157
|
+
}
|
|
158
|
+
return {
|
|
159
|
+
id: item.id,
|
|
160
|
+
EAN: item.EAN,
|
|
161
|
+
sku: item.sku,
|
|
162
|
+
slug: item.slug,
|
|
163
|
+
name: item.name,
|
|
164
|
+
description: item.description,
|
|
165
|
+
brand: item.brand,
|
|
166
|
+
gender: item.gender,
|
|
167
|
+
costPrice: item.costPrice,
|
|
168
|
+
discount: item.discount,
|
|
169
|
+
weight: item.weight,
|
|
170
|
+
pricePaid: item.pricePaid,
|
|
171
|
+
quantity: item.quantity,
|
|
172
|
+
images: item.images,
|
|
173
|
+
miniatures: item.miniatures,
|
|
174
|
+
recurrenceCycle: item.recurrenceCycle,
|
|
175
|
+
recurrenceDiscountPercentage: item.recurrenceDiscountPercentage,
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
function groupRecurringLineItemsByCycle(items) {
|
|
179
|
+
const groups = new Map();
|
|
180
|
+
for (const item of items) {
|
|
181
|
+
if (!item.recurrenceCartItem) {
|
|
182
|
+
continue;
|
|
183
|
+
}
|
|
184
|
+
if (item.recurrenceCycle == null) {
|
|
185
|
+
throw new Error(`Line item ${item.id ?? item.sku ?? 'unknown'} has recurrenceCartItem but is missing recurrenceCycle`);
|
|
186
|
+
}
|
|
187
|
+
const mapped = toLineItemRecurrence(item);
|
|
188
|
+
const existing = groups.get(item.recurrenceCycle);
|
|
189
|
+
if (existing) {
|
|
190
|
+
existing.push(mapped);
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
groups.set(item.recurrenceCycle, [mapped]);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return groups;
|
|
197
|
+
}
|
|
198
|
+
|
|
154
199
|
const registry = new Map();
|
|
155
200
|
function registerClass(name, classConstructor) {
|
|
156
201
|
registry.set(name, classConstructor);
|
|
@@ -727,12 +772,36 @@ class Category extends BaseModel {
|
|
|
727
772
|
image: null,
|
|
728
773
|
};
|
|
729
774
|
}
|
|
775
|
+
get glamBeautyImages() {
|
|
776
|
+
return this.images?.[Shops.GLAMBEAUTY]
|
|
777
|
+
? this.images[Shops.GLAMBEAUTY]
|
|
778
|
+
: {
|
|
779
|
+
brandBanner: null,
|
|
780
|
+
brandBannerMobile: null,
|
|
781
|
+
image: null,
|
|
782
|
+
};
|
|
783
|
+
}
|
|
784
|
+
get ellaImages() {
|
|
785
|
+
return this.images?.[Shops.ELLA]
|
|
786
|
+
? this.images[Shops.ELLA]
|
|
787
|
+
: {
|
|
788
|
+
brandBanner: null,
|
|
789
|
+
brandBannerMobile: null,
|
|
790
|
+
image: null,
|
|
791
|
+
};
|
|
792
|
+
}
|
|
730
793
|
get glamMetadata() {
|
|
731
794
|
return this.metadatas.find((metadata) => metadata.shop === Shops.GLAMSHOP);
|
|
732
795
|
}
|
|
733
796
|
get mensMetadata() {
|
|
734
797
|
return this.metadatas.find((metadata) => metadata.shop === Shops.MENSMARKET);
|
|
735
798
|
}
|
|
799
|
+
get glamBeautyMetadata() {
|
|
800
|
+
return this.metadatas.find((metadata) => metadata.shop === Shops.GLAMBEAUTY);
|
|
801
|
+
}
|
|
802
|
+
get ellaMetadata() {
|
|
803
|
+
return this.metadatas.find((metadata) => metadata.shop === Shops.ELLA);
|
|
804
|
+
}
|
|
736
805
|
getMostRelevantByShop(shop) {
|
|
737
806
|
return this.mostRelevants?.[shop] || [];
|
|
738
807
|
}
|
|
@@ -1746,6 +1815,12 @@ class ShoppingRecurrenceEdition extends BaseModel {
|
|
|
1746
1815
|
}
|
|
1747
1816
|
}
|
|
1748
1817
|
|
|
1818
|
+
class ShoppingRecurrenceErrorLog extends BaseModel {
|
|
1819
|
+
static get identifiersFields() {
|
|
1820
|
+
return ['id'];
|
|
1821
|
+
}
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1749
1824
|
class CheckoutSubscription extends BaseModel {
|
|
1750
1825
|
static get identifiersFields() {
|
|
1751
1826
|
return ['id'];
|
|
@@ -2666,11 +2741,39 @@ class AdyenCardAxiosAdapter {
|
|
|
2666
2741
|
}
|
|
2667
2742
|
}
|
|
2668
2743
|
|
|
2744
|
+
function resolveCacheConfig(cache) {
|
|
2745
|
+
if (isNil(cache) || typeof cache !== 'object')
|
|
2746
|
+
return undefined;
|
|
2747
|
+
const candidate = cache;
|
|
2748
|
+
const cacheAdapter = candidate.cacheAdapter;
|
|
2749
|
+
if (!cacheAdapter)
|
|
2750
|
+
return undefined;
|
|
2751
|
+
if (!isCacheAdapter(cacheAdapter))
|
|
2752
|
+
return undefined;
|
|
2753
|
+
if (typeof cacheAdapter.isConfigured === 'function' && !cacheAdapter.isConfigured()) {
|
|
2754
|
+
return undefined;
|
|
2755
|
+
}
|
|
2756
|
+
return {
|
|
2757
|
+
cacheAdapter,
|
|
2758
|
+
ttlDefault: candidate.ttlDefault,
|
|
2759
|
+
};
|
|
2760
|
+
}
|
|
2761
|
+
function isCacheAdapter(adapter) {
|
|
2762
|
+
return (typeof adapter.get === 'function' &&
|
|
2763
|
+
typeof adapter.set === 'function' &&
|
|
2764
|
+
typeof adapter.remove === 'function' &&
|
|
2765
|
+
typeof adapter.clear === 'function');
|
|
2766
|
+
}
|
|
2767
|
+
|
|
2669
2768
|
class RestCacheAdapter {
|
|
2670
2769
|
constructor(config) {
|
|
2770
|
+
this.client = null;
|
|
2671
2771
|
this.logger = new DebugHelper('RestCacheAdapter');
|
|
2772
|
+
this.configured = this.isValidBaseURL(config.baseURL);
|
|
2773
|
+
if (!this.configured)
|
|
2774
|
+
return;
|
|
2672
2775
|
this.client = axios.create({
|
|
2673
|
-
baseURL: config.baseURL,
|
|
2776
|
+
baseURL: config.baseURL.trim(),
|
|
2674
2777
|
headers: {
|
|
2675
2778
|
'Content-Type': 'application/json',
|
|
2676
2779
|
...(isNil(config.authToken) ? {} : { Authorization: `Bearer ${config.authToken}` }),
|
|
@@ -2678,7 +2781,12 @@ class RestCacheAdapter {
|
|
|
2678
2781
|
},
|
|
2679
2782
|
});
|
|
2680
2783
|
}
|
|
2784
|
+
isConfigured() {
|
|
2785
|
+
return this.configured;
|
|
2786
|
+
}
|
|
2681
2787
|
async set(options) {
|
|
2788
|
+
if (!this.client)
|
|
2789
|
+
return false;
|
|
2682
2790
|
try {
|
|
2683
2791
|
const response = await this.client.post('/redis/set', {
|
|
2684
2792
|
key: options.key,
|
|
@@ -2694,6 +2802,8 @@ class RestCacheAdapter {
|
|
|
2694
2802
|
}
|
|
2695
2803
|
}
|
|
2696
2804
|
async get(key) {
|
|
2805
|
+
if (!this.client)
|
|
2806
|
+
return null;
|
|
2697
2807
|
try {
|
|
2698
2808
|
const response = await this.client.post('/redis/get', {
|
|
2699
2809
|
key,
|
|
@@ -2710,6 +2820,8 @@ class RestCacheAdapter {
|
|
|
2710
2820
|
}
|
|
2711
2821
|
}
|
|
2712
2822
|
async remove(key) {
|
|
2823
|
+
if (!this.client)
|
|
2824
|
+
return false;
|
|
2713
2825
|
try {
|
|
2714
2826
|
const response = await this.client.post('/redis/del', {
|
|
2715
2827
|
key,
|
|
@@ -2723,6 +2835,8 @@ class RestCacheAdapter {
|
|
|
2723
2835
|
}
|
|
2724
2836
|
}
|
|
2725
2837
|
async clear() {
|
|
2838
|
+
if (!this.client)
|
|
2839
|
+
return false;
|
|
2726
2840
|
try {
|
|
2727
2841
|
const response = await this.client.post('/redis/flushdb', {});
|
|
2728
2842
|
return response.data.success;
|
|
@@ -2733,6 +2847,9 @@ class RestCacheAdapter {
|
|
|
2733
2847
|
return false;
|
|
2734
2848
|
}
|
|
2735
2849
|
}
|
|
2850
|
+
isValidBaseURL(baseURL) {
|
|
2851
|
+
return isString(baseURL) && baseURL.trim().length > 0;
|
|
2852
|
+
}
|
|
2736
2853
|
}
|
|
2737
2854
|
|
|
2738
2855
|
class AxiosAdapter {
|
|
@@ -5558,6 +5675,18 @@ class ShoppingRecurrenceEditionFirestoreRepository extends withCrudFirestore(wit
|
|
|
5558
5675
|
}
|
|
5559
5676
|
}
|
|
5560
5677
|
|
|
5678
|
+
class ShoppingRecurrenceErrorLogFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
5679
|
+
constructor({ firestore, interceptors, cache, }) {
|
|
5680
|
+
super({
|
|
5681
|
+
firestore,
|
|
5682
|
+
collectionName: 'shoppingRecurrenceErrorLogs',
|
|
5683
|
+
model: ShoppingRecurrenceErrorLog,
|
|
5684
|
+
interceptors,
|
|
5685
|
+
cache,
|
|
5686
|
+
});
|
|
5687
|
+
}
|
|
5688
|
+
}
|
|
5689
|
+
|
|
5561
5690
|
class ShoppingRecurrenceFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
5562
5691
|
constructor({ firestore, interceptors, cache, }) {
|
|
5563
5692
|
super({
|
|
@@ -6067,7 +6196,7 @@ function createHasuraGraphQLClass(MixinBase) {
|
|
|
6067
6196
|
this.model = options.model;
|
|
6068
6197
|
this.fields = options.fields || this.model.identifiersFields;
|
|
6069
6198
|
this.logger = DebugHelper.from(this);
|
|
6070
|
-
this.cache = options.cache;
|
|
6199
|
+
this.cache = resolveCacheConfig(options.cache);
|
|
6071
6200
|
}
|
|
6072
6201
|
get headers() {
|
|
6073
6202
|
return HasuraAuthHelper.buildHeaders(this.authOptions);
|
|
@@ -7094,6 +7223,8 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
7094
7223
|
mostRelevants: mostRelevants || {
|
|
7095
7224
|
[Shops.GLAMSHOP]: null,
|
|
7096
7225
|
[Shops.MENSMARKET]: null,
|
|
7226
|
+
[Shops.GLAMBEAUTY]: null,
|
|
7227
|
+
[Shops.ELLA]: null,
|
|
7097
7228
|
},
|
|
7098
7229
|
images: images || {
|
|
7099
7230
|
[Shops.GLAMSHOP]: {
|
|
@@ -7106,6 +7237,16 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
7106
7237
|
brandBannerMobile: null,
|
|
7107
7238
|
image: null,
|
|
7108
7239
|
},
|
|
7240
|
+
[Shops.GLAMBEAUTY]: {
|
|
7241
|
+
brandBanner: null,
|
|
7242
|
+
brandBannerMobile: null,
|
|
7243
|
+
image: null,
|
|
7244
|
+
},
|
|
7245
|
+
[Shops.ELLA]: {
|
|
7246
|
+
brandBanner: null,
|
|
7247
|
+
brandBannerMobile: null,
|
|
7248
|
+
image: null,
|
|
7249
|
+
},
|
|
7109
7250
|
},
|
|
7110
7251
|
});
|
|
7111
7252
|
}
|
|
@@ -11466,4 +11607,4 @@ class ProductsVertexSearch {
|
|
|
11466
11607
|
}
|
|
11467
11608
|
}
|
|
11468
11609
|
|
|
11469
|
-
export { AccessoryImportances, Address, AdyenCardAxiosAdapter, AdyenPaymentMethodFactory, AntifraudBankSlipService, AntifraudCardService, AntifraudGlampointsService, AntifraudPixService, AntifraudProviderFactory, AntifraudProviders, Area, Authentication, AuthenticationFirebaseAuthService, AxiosAdapter, Base, BaseModel, BeardProblems, BeardSizes, BeautyProductImportances, BeautyProfile, BeautyQuestionsHelper, BillingStatus, BodyProblems, BodyShapes, BodyTattoos, BrandCategory, BrandCategoryFirestoreRepository, BrandEquityOptions, BusinessError, BusinessUnitEnum, Buy2Win, Buy2WinFirestoreRepository, Campaign, CampaignBanner, CampaignDashboard, CampaignDashboardFirestoreRepository, CampaignHashtag, CampaignHashtagFirestoreRepository, Category, CategoryCollectionChildren, CategoryCollectionChildrenHasuraGraphQLRepository, CategoryFilter, CategoryFilterHasuraGraphQLRepository, CategoryFirestoreRepository, CategoryHasuraGraphQL, CategoryHasuraGraphQLRepository, CategoryProduct, CategoryProductHasuraGraphQLRepository, Checkout, CheckoutFirestoreRepository, CheckoutSubscription, CheckoutSubscriptionFirestoreRepository, CheckoutTypes, ClassNameHelper, ConnectBaseDocumentSnapshot, ConnectCollectionService, ConnectDocumentService, ConnectFirestoreService, Coupon, CouponCategories, CouponCategory, CouponChannels, CouponFirestoreRepository, CouponOldCategories, CouponSubtypes, CouponTypes, Debug, DebugDecoratorHelper, DebugHelper, DebugNamespaces, DuplicatedResultsError, Edition, EditionStatus, ErrorsCode, Exclusivities, FaceSkinOilinesses, FaceSkinProblems, FaceSkinTones, FamilyIncomes, Filter, FilterHasuraGraphQLRepository, FilterOption, FilterOptionHasuraGraphQLRepository, FilterType, FirebaseFileUploaderService, FragranceImportances, FraudValidationError, GenderDestination, GlampointsPaymentMethodFactory, GlampointsPaymentService, Group, GroupFirestoreRepository, HairColors, HairProblems, HairStrands, HairTypes, Home, HomeFirestoreRepository, InvalidArgumentError, InvalidCheckoutError, KitProduct, KitProductHasuraGraphQL, Lead, LeadFirestoreRepository, LegacyOrderFirestoreRepository, LineItem, Log, LogDocument, LogFirestoreRepository, Logger, MercadoPagoBankSlipAxiosAdapter, MercadoPagoCardAxiosAdapter, MercadoPagoErrorHelper, MercadoPagoPaymentMethodFactory, MercadoPagoPixAxiosAdapter, MercadoPagoRequestHelper, MercadoPagoResponseHelper, MercadoPagoStatusDetailEnum, MercadoPagoStatusEnum, NotFoundError, ObsEmitter, OfficePosition, Order, OrderBlocked, OrderBlockedFirestoreRepository, OrderBlockedType, OrderFirestoreRepository, OrderPaymentStatus, OrderStatus, PagarMeV5OrderStatus, PagarMeV5PaymentStatus, PagarmeBankSlipAxiosAdapter, PagarmeCardAxiosAdapter, PagarmePaymentMethodFactory, PagarmePaymentStatus, PagarmePixAxiosAdapter, PagarmeV5BankSlipAxiosAdapter, PagarmeV5BaseAxiosAdapter, PagarmeV5CardAxiosAdapter, PagarmeV5PixAxiosAdapter, Payment, PaymentError, PaymentFirestoreRepository, PaymentMethods, PaymentProviderFactory, PaymentProviders, PaymentTransaction, PaymentType, PersonTypes, Plans, Product, ProductCatalogHasuraGraphQL, ProductCatalogHasuraGraphQLRepository, ProductErrors, ProductErrorsHasuraGraphQL, ProductErrorsHasuraGraphQLRepository, ProductFirestoreRepository, ProductGroup, ProductGroupHasuraGraphQLRepository, ProductHasuraGraphQL, ProductHasuraGraphQLRepository, ProductLabelEnum, ProductPriceLog, ProductPriceLogHasuraGraphQLRepository, ProductReview, ProductReviewHasuraGraphQLRepository, ProductSpents, ProductStockEntry, ProductStockEntryHasuraGraphQL, ProductStockEntryHasuraGraphQLRepository, ProductStockNotification, ProductStockNotificationHasuraGraphQLRepository, ProductVariantFirestoreRepository, ProductsIndex, ProductsVertexSearch, QuestionsFilters, RecoveryPassword, ReflectHelper, Register, RegisterFirebaseAuthService, RequiredArgumentError, RestCacheAdapter, RoundProductPricesHelper, Sequence, SequenceFirestoreRepository, ShippingMethod, ShopConfigs, ShopConfigsFirestoreRepository, ShopMenu, ShopMenuFirestoreRepository, ShopPageName, ShopSettings, ShopSettingsFirestoreRepository, ShoppingRecurrence, ShoppingRecurrenceCycle, ShoppingRecurrenceEdition, ShoppingRecurrenceEditionFirestoreRepository, ShoppingRecurrenceEditionStatus, ShoppingRecurrenceFirestoreRepository, ShoppingRecurrenceStatus, Shops, SignInMethods, SignOut, Status, StockLimitError, StockOutError, Subscription, SubscriptionEditionFirestoreRepository, SubscriptionFirestoreRepository, SubscriptionMaterialization, SubscriptionMaterializationFirestoreRepository, SubscriptionPayment, SubscriptionPaymentFirestoreRepository, SubscriptionPlan, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionSummary, SubscriptionSummaryFirestoreRepository, Trace, TransactionPaymentMethods, UnauthorizedError, UpdateOptionActions, UpdateUserImage, User, UserAddress, UserAddressFirestoreRepository, UserAlreadyRegisteredError, UserBeautyProfileFirestoreRepository, UserFirestoreRepository, UserPaymentMethod, UserPaymentMethodFirestoreRepository, UserType, Variant, VariantHasuraGraphQL, VariantHasuraGraphQLRepository, VertexAxiosAdapter, WeakPasswordError, Where, Wishlist, WishlistHasuraGraphQLRepository, WishlistLogType, deserialize, getClass, is, isDebuggable, isUUID, parseDateTime, registerClass, resolveClass, serialize, withCreateFirestore, withCreateHasuraGraphQL, withCrudFirestore, withCrudHasuraGraphQL, withDeleteFirestore, withDeleteHasuraGraphQL, withFindFirestore, withFindHasuraGraphQL, withFirestore, withGetFirestore, withGetHasuraGraphQL, withHasuraGraphQL, withHelpers, withSubCollection, withUpdateFirestore, withUpdateHasuraGraphQL };
|
|
11610
|
+
export { AccessoryImportances, Address, AdyenCardAxiosAdapter, AdyenPaymentMethodFactory, AntifraudBankSlipService, AntifraudCardService, AntifraudGlampointsService, AntifraudPixService, AntifraudProviderFactory, AntifraudProviders, Area, Authentication, AuthenticationFirebaseAuthService, AxiosAdapter, Base, BaseModel, BeardProblems, BeardSizes, BeautyProductImportances, BeautyProfile, BeautyQuestionsHelper, BillingStatus, BodyProblems, BodyShapes, BodyTattoos, BrandCategory, BrandCategoryFirestoreRepository, BrandEquityOptions, BusinessError, BusinessUnitEnum, Buy2Win, Buy2WinFirestoreRepository, Campaign, CampaignBanner, CampaignDashboard, CampaignDashboardFirestoreRepository, CampaignHashtag, CampaignHashtagFirestoreRepository, Category, CategoryCollectionChildren, CategoryCollectionChildrenHasuraGraphQLRepository, CategoryFilter, CategoryFilterHasuraGraphQLRepository, CategoryFirestoreRepository, CategoryHasuraGraphQL, CategoryHasuraGraphQLRepository, CategoryProduct, CategoryProductHasuraGraphQLRepository, Checkout, CheckoutFirestoreRepository, CheckoutSubscription, CheckoutSubscriptionFirestoreRepository, CheckoutTypes, ClassNameHelper, ConnectBaseDocumentSnapshot, ConnectCollectionService, ConnectDocumentService, ConnectFirestoreService, Coupon, CouponCategories, CouponCategory, CouponChannels, CouponFirestoreRepository, CouponOldCategories, CouponSubtypes, CouponTypes, Debug, DebugDecoratorHelper, DebugHelper, DebugNamespaces, DuplicatedResultsError, Edition, EditionStatus, ErrorsCode, Exclusivities, FaceSkinOilinesses, FaceSkinProblems, FaceSkinTones, FamilyIncomes, Filter, FilterHasuraGraphQLRepository, FilterOption, FilterOptionHasuraGraphQLRepository, FilterType, FirebaseFileUploaderService, FragranceImportances, FraudValidationError, GenderDestination, GlampointsPaymentMethodFactory, GlampointsPaymentService, Group, GroupFirestoreRepository, HairColors, HairProblems, HairStrands, HairTypes, Home, HomeFirestoreRepository, InvalidArgumentError, InvalidCheckoutError, KitProduct, KitProductHasuraGraphQL, Lead, LeadFirestoreRepository, LegacyOrderFirestoreRepository, LineItem, Log, LogDocument, LogFirestoreRepository, Logger, MercadoPagoBankSlipAxiosAdapter, MercadoPagoCardAxiosAdapter, MercadoPagoErrorHelper, MercadoPagoPaymentMethodFactory, MercadoPagoPixAxiosAdapter, MercadoPagoRequestHelper, MercadoPagoResponseHelper, MercadoPagoStatusDetailEnum, MercadoPagoStatusEnum, NotFoundError, ObsEmitter, OfficePosition, Order, OrderBlocked, OrderBlockedFirestoreRepository, OrderBlockedType, OrderFirestoreRepository, OrderPaymentStatus, OrderStatus, PagarMeV5OrderStatus, PagarMeV5PaymentStatus, PagarmeBankSlipAxiosAdapter, PagarmeCardAxiosAdapter, PagarmePaymentMethodFactory, PagarmePaymentStatus, PagarmePixAxiosAdapter, PagarmeV5BankSlipAxiosAdapter, PagarmeV5BaseAxiosAdapter, PagarmeV5CardAxiosAdapter, PagarmeV5PixAxiosAdapter, Payment, PaymentError, PaymentFirestoreRepository, PaymentMethods, PaymentProviderFactory, PaymentProviders, PaymentTransaction, PaymentType, PersonTypes, Plans, Product, ProductCatalogHasuraGraphQL, ProductCatalogHasuraGraphQLRepository, ProductErrors, ProductErrorsHasuraGraphQL, ProductErrorsHasuraGraphQLRepository, ProductFirestoreRepository, ProductGroup, ProductGroupHasuraGraphQLRepository, ProductHasuraGraphQL, ProductHasuraGraphQLRepository, ProductLabelEnum, ProductPriceLog, ProductPriceLogHasuraGraphQLRepository, ProductReview, ProductReviewHasuraGraphQLRepository, ProductSpents, ProductStockEntry, ProductStockEntryHasuraGraphQL, ProductStockEntryHasuraGraphQLRepository, ProductStockNotification, ProductStockNotificationHasuraGraphQLRepository, ProductVariantFirestoreRepository, ProductsIndex, ProductsVertexSearch, QuestionsFilters, RecoveryPassword, ReflectHelper, Register, RegisterFirebaseAuthService, RequiredArgumentError, RestCacheAdapter, RoundProductPricesHelper, Sequence, SequenceFirestoreRepository, ShippingMethod, ShopConfigs, ShopConfigsFirestoreRepository, ShopMenu, ShopMenuFirestoreRepository, ShopPageName, ShopSettings, ShopSettingsFirestoreRepository, ShoppingRecurrence, ShoppingRecurrenceCycle, ShoppingRecurrenceEdition, ShoppingRecurrenceEditionFirestoreRepository, ShoppingRecurrenceEditionStatus, ShoppingRecurrenceErrorLog, ShoppingRecurrenceErrorLogFirestoreRepository, ShoppingRecurrenceFirestoreRepository, ShoppingRecurrenceStatus, Shops, SignInMethods, SignOut, Status, StockLimitError, StockOutError, Subscription, SubscriptionEditionFirestoreRepository, SubscriptionFirestoreRepository, SubscriptionMaterialization, SubscriptionMaterializationFirestoreRepository, SubscriptionPayment, SubscriptionPaymentFirestoreRepository, SubscriptionPlan, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionSummary, SubscriptionSummaryFirestoreRepository, Trace, TransactionPaymentMethods, UnauthorizedError, UpdateOptionActions, UpdateUserImage, User, UserAddress, UserAddressFirestoreRepository, UserAlreadyRegisteredError, UserBeautyProfileFirestoreRepository, UserFirestoreRepository, UserPaymentMethod, UserPaymentMethodFirestoreRepository, UserType, Variant, VariantHasuraGraphQL, VariantHasuraGraphQLRepository, VertexAxiosAdapter, WeakPasswordError, Where, Wishlist, WishlistHasuraGraphQLRepository, WishlistLogType, deserialize, getClass, groupRecurringLineItemsByCycle, is, isDebuggable, isUUID, parseDateTime, registerClass, resolveCacheConfig, resolveClass, serialize, toLineItemRecurrence, withCreateFirestore, withCreateHasuraGraphQL, withCrudFirestore, withCrudHasuraGraphQL, withDeleteFirestore, withDeleteHasuraGraphQL, withFindFirestore, withFindHasuraGraphQL, withFirestore, withGetFirestore, withGetHasuraGraphQL, withHasuraGraphQL, withHelpers, withSubCollection, withUpdateFirestore, withUpdateHasuraGraphQL };
|
package/package.json
CHANGED
|
@@ -46,7 +46,19 @@ export declare class Category extends BaseModel<Category> {
|
|
|
46
46
|
brandBanner: string;
|
|
47
47
|
brandBannerMobile: string;
|
|
48
48
|
};
|
|
49
|
+
get glamBeautyImages(): {
|
|
50
|
+
image: string;
|
|
51
|
+
brandBanner: string;
|
|
52
|
+
brandBannerMobile: string;
|
|
53
|
+
};
|
|
54
|
+
get ellaImages(): {
|
|
55
|
+
image: string;
|
|
56
|
+
brandBanner: string;
|
|
57
|
+
brandBannerMobile: string;
|
|
58
|
+
};
|
|
49
59
|
get glamMetadata(): CategoryMetadata;
|
|
50
60
|
get mensMetadata(): CategoryMetadata;
|
|
61
|
+
get glamBeautyMetadata(): CategoryMetadata;
|
|
62
|
+
get ellaMetadata(): CategoryMetadata;
|
|
51
63
|
getMostRelevantByShop(shop: Shops): string[];
|
|
52
64
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './line-item-recurrence.mapper';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ShoppingRecurrenceCycle } from '../models/enums/shopping-recurrence-cycle.enum';
|
|
2
|
+
import { LineItem } from '../models/line-item';
|
|
3
|
+
import { LineItemRecurrence } from '../models/types/line-item-recurrence.type';
|
|
4
|
+
export declare function toLineItemRecurrence(item: LineItem): LineItemRecurrence;
|
|
5
|
+
export declare function groupRecurringLineItemsByCycle(items: LineItem[]): Map<ShoppingRecurrenceCycle, LineItemRecurrence[]>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Product } from '../../catalog/models/product';
|
|
2
|
+
import { ShoppingRecurrenceCycle } from './enums';
|
|
2
3
|
export declare class LineItem extends Product {
|
|
3
4
|
parentId?: string;
|
|
4
5
|
quantity: number;
|
|
@@ -6,5 +7,9 @@ export declare class LineItem extends Product {
|
|
|
6
7
|
pricePaid?: number;
|
|
7
8
|
discount?: number;
|
|
8
9
|
image?: string;
|
|
10
|
+
refunded?: boolean;
|
|
11
|
+
recurrenceCartItem?: boolean;
|
|
12
|
+
recurrenceCycle?: ShoppingRecurrenceCycle;
|
|
13
|
+
recurrenceDiscountPercentage?: number;
|
|
9
14
|
get pricePaidWithDiscount(): number;
|
|
10
15
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseModel, GenericIdentifier } from '../../../generic/model/base.model';
|
|
2
|
+
import { CreateShoppingRecurrencyPayload } from '../../types/create-recurrency-payload.type';
|
|
3
|
+
export declare class ShoppingRecurrenceErrorLog extends BaseModel<ShoppingRecurrenceErrorLog> {
|
|
4
|
+
id: string;
|
|
5
|
+
payload: CreateShoppingRecurrencyPayload;
|
|
6
|
+
error?: unknown;
|
|
7
|
+
createdAt: Date;
|
|
8
|
+
static get identifiersFields(): GenericIdentifier[];
|
|
9
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { LineItem } from '../line-item';
|
|
2
|
-
export type LineItemRecurrence = Pick<LineItem, 'id' | 'EAN' | 'sku' | 'slug' | 'name' | 'description' | 'brand' | 'gender' | 'costPrice' | 'discount' | 'weight' | 'pricePaid' | 'quantity' | 'images' | 'miniatures'>;
|
|
2
|
+
export type LineItemRecurrence = Pick<LineItem, 'id' | 'EAN' | 'sku' | 'slug' | 'name' | 'description' | 'brand' | 'gender' | 'costPrice' | 'discount' | 'weight' | 'pricePaid' | 'quantity' | 'images' | 'miniatures' | 'recurrenceCycle' | 'recurrenceDiscountPercentage'>;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { ShoppingRecurrenceCycle } from '../models';
|
|
2
1
|
import { PaymentCardInfo } from './payment-card-info.type';
|
|
3
2
|
export type CreateShoppingRecurrencyPayload = {
|
|
4
3
|
shopId: string;
|
|
5
4
|
cards?: PaymentCardInfo[];
|
|
6
5
|
orderId: string;
|
|
7
|
-
recurrence: ShoppingRecurrenceCycle;
|
|
8
6
|
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { UserAddress } from '../../users';
|
|
2
|
+
import { ShoppingRecurrenceCycle } from '../models/enums/shopping-recurrence-cycle.enum';
|
|
3
|
+
import { LineItemRecurrence } from '../models/types/line-item-recurrence.type';
|
|
4
|
+
import { CardForPaymentInfo } from './payment-card-info.type';
|
|
5
|
+
export type UpdateShoppingRecurrencePaymentMethodPayload = {
|
|
6
|
+
recurrenceId: string;
|
|
7
|
+
cards: CardForPaymentInfo[];
|
|
8
|
+
};
|
|
9
|
+
export type GetShoppingRecurrenceAvailableShippingPayload = {
|
|
10
|
+
recurrenceId: string;
|
|
11
|
+
shippingAddress?: UserAddress;
|
|
12
|
+
};
|
|
13
|
+
export type UpdateShoppingRecurrenceShippingAddressPayload = {
|
|
14
|
+
recurrenceId: string;
|
|
15
|
+
shippingAddress: UserAddress;
|
|
16
|
+
shippingOption: string;
|
|
17
|
+
};
|
|
18
|
+
export type CancelShoppingRecurrencePayload = {
|
|
19
|
+
recurrenceId: string;
|
|
20
|
+
};
|
|
21
|
+
export type EnableOrDisableShoppingRecurrencePayload = {
|
|
22
|
+
recurrenceId: string;
|
|
23
|
+
active: boolean;
|
|
24
|
+
};
|
|
25
|
+
export type SkipShoppingRecurrenceEditionPayload = {
|
|
26
|
+
recurrenceEditionId: string;
|
|
27
|
+
};
|
|
28
|
+
export type UpdateShoppingRecurrenceFrequencyPayload = {
|
|
29
|
+
recurrenceId: string;
|
|
30
|
+
frequency: ShoppingRecurrenceCycle;
|
|
31
|
+
};
|
|
32
|
+
export type UpdateShoppingRecurrenceLineItemsPayload = {
|
|
33
|
+
recurrenceId: string;
|
|
34
|
+
lineItems: LineItemRecurrence[];
|
|
35
|
+
};
|
|
@@ -7,9 +7,12 @@ export interface RESTCacheConfig {
|
|
|
7
7
|
export declare class RestCacheAdapter implements CacheAdapter {
|
|
8
8
|
private client;
|
|
9
9
|
private readonly logger;
|
|
10
|
+
private readonly configured;
|
|
10
11
|
constructor(config: RESTCacheConfig);
|
|
12
|
+
isConfigured(): boolean;
|
|
11
13
|
set(options: CacheOptions): Promise<boolean>;
|
|
12
14
|
get<T = any>(key: string): Promise<T | null>;
|
|
13
15
|
remove(key: string): Promise<boolean>;
|
|
14
16
|
clear(): Promise<boolean>;
|
|
17
|
+
private isValidBaseURL;
|
|
15
18
|
}
|
|
@@ -9,5 +9,6 @@ export * from './order-blocked-firestore.repository';
|
|
|
9
9
|
export * from './order-firestore.repository';
|
|
10
10
|
export * from './payment-firestore.repository';
|
|
11
11
|
export * from './shopping-recurrence-edition-firestore.repository';
|
|
12
|
+
export * from './shopping-recurrence-error-log-firestore.repository';
|
|
12
13
|
export * from './shopping-recurrence-firestore.repository';
|
|
13
14
|
export * from './subscription-plan-firestore.repository';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ShoppingRecurrenceErrorLog, ShoppingRecurrenceErrorLogRepository } from '../../../../../domain';
|
|
2
|
+
import { FirestoreConstructorParams } from '../../mixins';
|
|
3
|
+
declare const ShoppingRecurrenceErrorLogFirestoreRepository_base: import("../../../../../utils").MixinCtor<import("../..").FirestoreRepository<ShoppingRecurrenceErrorLog> & import("../../../../../domain").CrudRepository<ShoppingRecurrenceErrorLog, import("../../../../../domain").CrudParams<ShoppingRecurrenceErrorLog>> & import("../..").FirestoreHelpers, [FirestoreConstructorParams<ShoppingRecurrenceErrorLog>, ...any[]]>;
|
|
4
|
+
export declare class ShoppingRecurrenceErrorLogFirestoreRepository extends ShoppingRecurrenceErrorLogFirestoreRepository_base implements ShoppingRecurrenceErrorLogRepository {
|
|
5
|
+
constructor({ firestore, interceptors, cache, }: Pick<FirestoreConstructorParams<ShoppingRecurrenceErrorLog>, 'firestore' | 'interceptors' | 'cache'>);
|
|
6
|
+
}
|
|
7
|
+
export {};
|