@infrab4a/connect 5.7.5 → 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 +92 -2
- package/index.esm.js +90 -3
- package/package.json +1 -1
- 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 +4 -0
- package/src/domain/shopping/models/order.d.ts +1 -0
- package/src/domain/shopping/models/types/line-item-recurrence.type.d.ts +1 -1
- 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/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);
|
|
@@ -2720,11 +2765,39 @@ class AdyenCardAxiosAdapter {
|
|
|
2720
2765
|
}
|
|
2721
2766
|
}
|
|
2722
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
|
+
|
|
2723
2792
|
class RestCacheAdapter {
|
|
2724
2793
|
constructor(config) {
|
|
2794
|
+
this.client = null;
|
|
2725
2795
|
this.logger = new DebugHelper('RestCacheAdapter');
|
|
2796
|
+
this.configured = this.isValidBaseURL(config.baseURL);
|
|
2797
|
+
if (!this.configured)
|
|
2798
|
+
return;
|
|
2726
2799
|
this.client = axios__default["default"].create({
|
|
2727
|
-
baseURL: config.baseURL,
|
|
2800
|
+
baseURL: config.baseURL.trim(),
|
|
2728
2801
|
headers: {
|
|
2729
2802
|
'Content-Type': 'application/json',
|
|
2730
2803
|
...(lodash.isNil(config.authToken) ? {} : { Authorization: `Bearer ${config.authToken}` }),
|
|
@@ -2732,7 +2805,12 @@ class RestCacheAdapter {
|
|
|
2732
2805
|
},
|
|
2733
2806
|
});
|
|
2734
2807
|
}
|
|
2808
|
+
isConfigured() {
|
|
2809
|
+
return this.configured;
|
|
2810
|
+
}
|
|
2735
2811
|
async set(options) {
|
|
2812
|
+
if (!this.client)
|
|
2813
|
+
return false;
|
|
2736
2814
|
try {
|
|
2737
2815
|
const response = await this.client.post('/redis/set', {
|
|
2738
2816
|
key: options.key,
|
|
@@ -2748,6 +2826,8 @@ class RestCacheAdapter {
|
|
|
2748
2826
|
}
|
|
2749
2827
|
}
|
|
2750
2828
|
async get(key) {
|
|
2829
|
+
if (!this.client)
|
|
2830
|
+
return null;
|
|
2751
2831
|
try {
|
|
2752
2832
|
const response = await this.client.post('/redis/get', {
|
|
2753
2833
|
key,
|
|
@@ -2764,6 +2844,8 @@ class RestCacheAdapter {
|
|
|
2764
2844
|
}
|
|
2765
2845
|
}
|
|
2766
2846
|
async remove(key) {
|
|
2847
|
+
if (!this.client)
|
|
2848
|
+
return false;
|
|
2767
2849
|
try {
|
|
2768
2850
|
const response = await this.client.post('/redis/del', {
|
|
2769
2851
|
key,
|
|
@@ -2777,6 +2859,8 @@ class RestCacheAdapter {
|
|
|
2777
2859
|
}
|
|
2778
2860
|
}
|
|
2779
2861
|
async clear() {
|
|
2862
|
+
if (!this.client)
|
|
2863
|
+
return false;
|
|
2780
2864
|
try {
|
|
2781
2865
|
const response = await this.client.post('/redis/flushdb', {});
|
|
2782
2866
|
return response.data.success;
|
|
@@ -2787,6 +2871,9 @@ class RestCacheAdapter {
|
|
|
2787
2871
|
return false;
|
|
2788
2872
|
}
|
|
2789
2873
|
}
|
|
2874
|
+
isValidBaseURL(baseURL) {
|
|
2875
|
+
return lodash.isString(baseURL) && baseURL.trim().length > 0;
|
|
2876
|
+
}
|
|
2790
2877
|
}
|
|
2791
2878
|
|
|
2792
2879
|
class AxiosAdapter {
|
|
@@ -6133,7 +6220,7 @@ function createHasuraGraphQLClass(MixinBase) {
|
|
|
6133
6220
|
this.model = options.model;
|
|
6134
6221
|
this.fields = options.fields || this.model.identifiersFields;
|
|
6135
6222
|
this.logger = DebugHelper.from(this);
|
|
6136
|
-
this.cache = options.cache;
|
|
6223
|
+
this.cache = resolveCacheConfig(options.cache);
|
|
6137
6224
|
}
|
|
6138
6225
|
get headers() {
|
|
6139
6226
|
return HasuraAuthHelper.buildHeaders(this.authOptions);
|
|
@@ -11854,13 +11941,16 @@ exports.Wishlist = Wishlist;
|
|
|
11854
11941
|
exports.WishlistHasuraGraphQLRepository = WishlistHasuraGraphQLRepository;
|
|
11855
11942
|
exports.deserialize = deserialize;
|
|
11856
11943
|
exports.getClass = getClass;
|
|
11944
|
+
exports.groupRecurringLineItemsByCycle = groupRecurringLineItemsByCycle;
|
|
11857
11945
|
exports.is = is;
|
|
11858
11946
|
exports.isDebuggable = isDebuggable;
|
|
11859
11947
|
exports.isUUID = isUUID;
|
|
11860
11948
|
exports.parseDateTime = parseDateTime;
|
|
11861
11949
|
exports.registerClass = registerClass;
|
|
11950
|
+
exports.resolveCacheConfig = resolveCacheConfig;
|
|
11862
11951
|
exports.resolveClass = resolveClass;
|
|
11863
11952
|
exports.serialize = serialize;
|
|
11953
|
+
exports.toLineItemRecurrence = toLineItemRecurrence;
|
|
11864
11954
|
exports.withCreateFirestore = withCreateFirestore;
|
|
11865
11955
|
exports.withCreateHasuraGraphQL = withCreateHasuraGraphQL;
|
|
11866
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);
|
|
@@ -2696,11 +2741,39 @@ class AdyenCardAxiosAdapter {
|
|
|
2696
2741
|
}
|
|
2697
2742
|
}
|
|
2698
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
|
+
|
|
2699
2768
|
class RestCacheAdapter {
|
|
2700
2769
|
constructor(config) {
|
|
2770
|
+
this.client = null;
|
|
2701
2771
|
this.logger = new DebugHelper('RestCacheAdapter');
|
|
2772
|
+
this.configured = this.isValidBaseURL(config.baseURL);
|
|
2773
|
+
if (!this.configured)
|
|
2774
|
+
return;
|
|
2702
2775
|
this.client = axios.create({
|
|
2703
|
-
baseURL: config.baseURL,
|
|
2776
|
+
baseURL: config.baseURL.trim(),
|
|
2704
2777
|
headers: {
|
|
2705
2778
|
'Content-Type': 'application/json',
|
|
2706
2779
|
...(isNil(config.authToken) ? {} : { Authorization: `Bearer ${config.authToken}` }),
|
|
@@ -2708,7 +2781,12 @@ class RestCacheAdapter {
|
|
|
2708
2781
|
},
|
|
2709
2782
|
});
|
|
2710
2783
|
}
|
|
2784
|
+
isConfigured() {
|
|
2785
|
+
return this.configured;
|
|
2786
|
+
}
|
|
2711
2787
|
async set(options) {
|
|
2788
|
+
if (!this.client)
|
|
2789
|
+
return false;
|
|
2712
2790
|
try {
|
|
2713
2791
|
const response = await this.client.post('/redis/set', {
|
|
2714
2792
|
key: options.key,
|
|
@@ -2724,6 +2802,8 @@ class RestCacheAdapter {
|
|
|
2724
2802
|
}
|
|
2725
2803
|
}
|
|
2726
2804
|
async get(key) {
|
|
2805
|
+
if (!this.client)
|
|
2806
|
+
return null;
|
|
2727
2807
|
try {
|
|
2728
2808
|
const response = await this.client.post('/redis/get', {
|
|
2729
2809
|
key,
|
|
@@ -2740,6 +2820,8 @@ class RestCacheAdapter {
|
|
|
2740
2820
|
}
|
|
2741
2821
|
}
|
|
2742
2822
|
async remove(key) {
|
|
2823
|
+
if (!this.client)
|
|
2824
|
+
return false;
|
|
2743
2825
|
try {
|
|
2744
2826
|
const response = await this.client.post('/redis/del', {
|
|
2745
2827
|
key,
|
|
@@ -2753,6 +2835,8 @@ class RestCacheAdapter {
|
|
|
2753
2835
|
}
|
|
2754
2836
|
}
|
|
2755
2837
|
async clear() {
|
|
2838
|
+
if (!this.client)
|
|
2839
|
+
return false;
|
|
2756
2840
|
try {
|
|
2757
2841
|
const response = await this.client.post('/redis/flushdb', {});
|
|
2758
2842
|
return response.data.success;
|
|
@@ -2763,6 +2847,9 @@ class RestCacheAdapter {
|
|
|
2763
2847
|
return false;
|
|
2764
2848
|
}
|
|
2765
2849
|
}
|
|
2850
|
+
isValidBaseURL(baseURL) {
|
|
2851
|
+
return isString(baseURL) && baseURL.trim().length > 0;
|
|
2852
|
+
}
|
|
2766
2853
|
}
|
|
2767
2854
|
|
|
2768
2855
|
class AxiosAdapter {
|
|
@@ -6109,7 +6196,7 @@ function createHasuraGraphQLClass(MixinBase) {
|
|
|
6109
6196
|
this.model = options.model;
|
|
6110
6197
|
this.fields = options.fields || this.model.identifiersFields;
|
|
6111
6198
|
this.logger = DebugHelper.from(this);
|
|
6112
|
-
this.cache = options.cache;
|
|
6199
|
+
this.cache = resolveCacheConfig(options.cache);
|
|
6113
6200
|
}
|
|
6114
6201
|
get headers() {
|
|
6115
6202
|
return HasuraAuthHelper.buildHeaders(this.authOptions);
|
|
@@ -11520,4 +11607,4 @@ class ProductsVertexSearch {
|
|
|
11520
11607
|
}
|
|
11521
11608
|
}
|
|
11522
11609
|
|
|
11523
|
-
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, 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
|
@@ -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;
|
|
@@ -7,5 +8,8 @@ export declare class LineItem extends Product {
|
|
|
7
8
|
discount?: number;
|
|
8
9
|
image?: string;
|
|
9
10
|
refunded?: boolean;
|
|
11
|
+
recurrenceCartItem?: boolean;
|
|
12
|
+
recurrenceCycle?: ShoppingRecurrenceCycle;
|
|
13
|
+
recurrenceDiscountPercentage?: number;
|
|
10
14
|
get pricePaidWithDiscount(): number;
|
|
11
15
|
}
|
|
@@ -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/enums/shopping-recurrence-cycle.enum';
|
|
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
|
}
|