@infrab4a/connect 5.7.8 → 5.7.9
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 +45 -2
- package/index.esm.js +45 -3
- package/package.json +1 -1
- package/src/domain/shopping/models/checkout.d.ts +2 -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
|
@@ -2715,11 +2715,39 @@ class AdyenCardAxiosAdapter {
|
|
|
2715
2715
|
}
|
|
2716
2716
|
}
|
|
2717
2717
|
|
|
2718
|
+
function resolveCacheConfig(cache) {
|
|
2719
|
+
if (lodash.isNil(cache) || typeof cache !== 'object')
|
|
2720
|
+
return undefined;
|
|
2721
|
+
const candidate = cache;
|
|
2722
|
+
const cacheAdapter = candidate.cacheAdapter;
|
|
2723
|
+
if (!cacheAdapter)
|
|
2724
|
+
return undefined;
|
|
2725
|
+
if (!isCacheAdapter(cacheAdapter))
|
|
2726
|
+
return undefined;
|
|
2727
|
+
if (typeof cacheAdapter.isConfigured === 'function' && !cacheAdapter.isConfigured()) {
|
|
2728
|
+
return undefined;
|
|
2729
|
+
}
|
|
2730
|
+
return {
|
|
2731
|
+
cacheAdapter,
|
|
2732
|
+
ttlDefault: candidate.ttlDefault,
|
|
2733
|
+
};
|
|
2734
|
+
}
|
|
2735
|
+
function isCacheAdapter(adapter) {
|
|
2736
|
+
return (typeof adapter.get === 'function' &&
|
|
2737
|
+
typeof adapter.set === 'function' &&
|
|
2738
|
+
typeof adapter.remove === 'function' &&
|
|
2739
|
+
typeof adapter.clear === 'function');
|
|
2740
|
+
}
|
|
2741
|
+
|
|
2718
2742
|
class RestCacheAdapter {
|
|
2719
2743
|
constructor(config) {
|
|
2744
|
+
this.client = null;
|
|
2720
2745
|
this.logger = new DebugHelper('RestCacheAdapter');
|
|
2746
|
+
this.configured = this.isValidBaseURL(config.baseURL);
|
|
2747
|
+
if (!this.configured)
|
|
2748
|
+
return;
|
|
2721
2749
|
this.client = axios__default["default"].create({
|
|
2722
|
-
baseURL: config.baseURL,
|
|
2750
|
+
baseURL: config.baseURL.trim(),
|
|
2723
2751
|
headers: {
|
|
2724
2752
|
'Content-Type': 'application/json',
|
|
2725
2753
|
...(lodash.isNil(config.authToken) ? {} : { Authorization: `Bearer ${config.authToken}` }),
|
|
@@ -2727,7 +2755,12 @@ class RestCacheAdapter {
|
|
|
2727
2755
|
},
|
|
2728
2756
|
});
|
|
2729
2757
|
}
|
|
2758
|
+
isConfigured() {
|
|
2759
|
+
return this.configured;
|
|
2760
|
+
}
|
|
2730
2761
|
async set(options) {
|
|
2762
|
+
if (!this.client)
|
|
2763
|
+
return false;
|
|
2731
2764
|
try {
|
|
2732
2765
|
const response = await this.client.post('/redis/set', {
|
|
2733
2766
|
key: options.key,
|
|
@@ -2743,6 +2776,8 @@ class RestCacheAdapter {
|
|
|
2743
2776
|
}
|
|
2744
2777
|
}
|
|
2745
2778
|
async get(key) {
|
|
2779
|
+
if (!this.client)
|
|
2780
|
+
return null;
|
|
2746
2781
|
try {
|
|
2747
2782
|
const response = await this.client.post('/redis/get', {
|
|
2748
2783
|
key,
|
|
@@ -2759,6 +2794,8 @@ class RestCacheAdapter {
|
|
|
2759
2794
|
}
|
|
2760
2795
|
}
|
|
2761
2796
|
async remove(key) {
|
|
2797
|
+
if (!this.client)
|
|
2798
|
+
return false;
|
|
2762
2799
|
try {
|
|
2763
2800
|
const response = await this.client.post('/redis/del', {
|
|
2764
2801
|
key,
|
|
@@ -2772,6 +2809,8 @@ class RestCacheAdapter {
|
|
|
2772
2809
|
}
|
|
2773
2810
|
}
|
|
2774
2811
|
async clear() {
|
|
2812
|
+
if (!this.client)
|
|
2813
|
+
return false;
|
|
2775
2814
|
try {
|
|
2776
2815
|
const response = await this.client.post('/redis/flushdb', {});
|
|
2777
2816
|
return response.data.success;
|
|
@@ -2782,6 +2821,9 @@ class RestCacheAdapter {
|
|
|
2782
2821
|
return false;
|
|
2783
2822
|
}
|
|
2784
2823
|
}
|
|
2824
|
+
isValidBaseURL(baseURL) {
|
|
2825
|
+
return lodash.isString(baseURL) && baseURL.trim().length > 0;
|
|
2826
|
+
}
|
|
2785
2827
|
}
|
|
2786
2828
|
|
|
2787
2829
|
class AxiosAdapter {
|
|
@@ -6128,7 +6170,7 @@ function createHasuraGraphQLClass(MixinBase) {
|
|
|
6128
6170
|
this.model = options.model;
|
|
6129
6171
|
this.fields = options.fields || this.model.identifiersFields;
|
|
6130
6172
|
this.logger = DebugHelper.from(this);
|
|
6131
|
-
this.cache = options.cache;
|
|
6173
|
+
this.cache = resolveCacheConfig(options.cache);
|
|
6132
6174
|
}
|
|
6133
6175
|
get headers() {
|
|
6134
6176
|
return HasuraAuthHelper.buildHeaders(this.authOptions);
|
|
@@ -11860,6 +11902,7 @@ exports.isDebuggable = isDebuggable;
|
|
|
11860
11902
|
exports.isUUID = isUUID;
|
|
11861
11903
|
exports.parseDateTime = parseDateTime;
|
|
11862
11904
|
exports.registerClass = registerClass;
|
|
11905
|
+
exports.resolveCacheConfig = resolveCacheConfig;
|
|
11863
11906
|
exports.resolveClass = resolveClass;
|
|
11864
11907
|
exports.serialize = serialize;
|
|
11865
11908
|
exports.toCents = toCents;
|
package/index.esm.js
CHANGED
|
@@ -2709,11 +2709,39 @@ class AdyenCardAxiosAdapter {
|
|
|
2709
2709
|
}
|
|
2710
2710
|
}
|
|
2711
2711
|
|
|
2712
|
+
function resolveCacheConfig(cache) {
|
|
2713
|
+
if (isNil(cache) || typeof cache !== 'object')
|
|
2714
|
+
return undefined;
|
|
2715
|
+
const candidate = cache;
|
|
2716
|
+
const cacheAdapter = candidate.cacheAdapter;
|
|
2717
|
+
if (!cacheAdapter)
|
|
2718
|
+
return undefined;
|
|
2719
|
+
if (!isCacheAdapter(cacheAdapter))
|
|
2720
|
+
return undefined;
|
|
2721
|
+
if (typeof cacheAdapter.isConfigured === 'function' && !cacheAdapter.isConfigured()) {
|
|
2722
|
+
return undefined;
|
|
2723
|
+
}
|
|
2724
|
+
return {
|
|
2725
|
+
cacheAdapter,
|
|
2726
|
+
ttlDefault: candidate.ttlDefault,
|
|
2727
|
+
};
|
|
2728
|
+
}
|
|
2729
|
+
function isCacheAdapter(adapter) {
|
|
2730
|
+
return (typeof adapter.get === 'function' &&
|
|
2731
|
+
typeof adapter.set === 'function' &&
|
|
2732
|
+
typeof adapter.remove === 'function' &&
|
|
2733
|
+
typeof adapter.clear === 'function');
|
|
2734
|
+
}
|
|
2735
|
+
|
|
2712
2736
|
class RestCacheAdapter {
|
|
2713
2737
|
constructor(config) {
|
|
2738
|
+
this.client = null;
|
|
2714
2739
|
this.logger = new DebugHelper('RestCacheAdapter');
|
|
2740
|
+
this.configured = this.isValidBaseURL(config.baseURL);
|
|
2741
|
+
if (!this.configured)
|
|
2742
|
+
return;
|
|
2715
2743
|
this.client = axios.create({
|
|
2716
|
-
baseURL: config.baseURL,
|
|
2744
|
+
baseURL: config.baseURL.trim(),
|
|
2717
2745
|
headers: {
|
|
2718
2746
|
'Content-Type': 'application/json',
|
|
2719
2747
|
...(isNil(config.authToken) ? {} : { Authorization: `Bearer ${config.authToken}` }),
|
|
@@ -2721,7 +2749,12 @@ class RestCacheAdapter {
|
|
|
2721
2749
|
},
|
|
2722
2750
|
});
|
|
2723
2751
|
}
|
|
2752
|
+
isConfigured() {
|
|
2753
|
+
return this.configured;
|
|
2754
|
+
}
|
|
2724
2755
|
async set(options) {
|
|
2756
|
+
if (!this.client)
|
|
2757
|
+
return false;
|
|
2725
2758
|
try {
|
|
2726
2759
|
const response = await this.client.post('/redis/set', {
|
|
2727
2760
|
key: options.key,
|
|
@@ -2737,6 +2770,8 @@ class RestCacheAdapter {
|
|
|
2737
2770
|
}
|
|
2738
2771
|
}
|
|
2739
2772
|
async get(key) {
|
|
2773
|
+
if (!this.client)
|
|
2774
|
+
return null;
|
|
2740
2775
|
try {
|
|
2741
2776
|
const response = await this.client.post('/redis/get', {
|
|
2742
2777
|
key,
|
|
@@ -2753,6 +2788,8 @@ class RestCacheAdapter {
|
|
|
2753
2788
|
}
|
|
2754
2789
|
}
|
|
2755
2790
|
async remove(key) {
|
|
2791
|
+
if (!this.client)
|
|
2792
|
+
return false;
|
|
2756
2793
|
try {
|
|
2757
2794
|
const response = await this.client.post('/redis/del', {
|
|
2758
2795
|
key,
|
|
@@ -2766,6 +2803,8 @@ class RestCacheAdapter {
|
|
|
2766
2803
|
}
|
|
2767
2804
|
}
|
|
2768
2805
|
async clear() {
|
|
2806
|
+
if (!this.client)
|
|
2807
|
+
return false;
|
|
2769
2808
|
try {
|
|
2770
2809
|
const response = await this.client.post('/redis/flushdb', {});
|
|
2771
2810
|
return response.data.success;
|
|
@@ -2776,6 +2815,9 @@ class RestCacheAdapter {
|
|
|
2776
2815
|
return false;
|
|
2777
2816
|
}
|
|
2778
2817
|
}
|
|
2818
|
+
isValidBaseURL(baseURL) {
|
|
2819
|
+
return isString(baseURL) && baseURL.trim().length > 0;
|
|
2820
|
+
}
|
|
2779
2821
|
}
|
|
2780
2822
|
|
|
2781
2823
|
class AxiosAdapter {
|
|
@@ -6122,7 +6164,7 @@ function createHasuraGraphQLClass(MixinBase) {
|
|
|
6122
6164
|
this.model = options.model;
|
|
6123
6165
|
this.fields = options.fields || this.model.identifiersFields;
|
|
6124
6166
|
this.logger = DebugHelper.from(this);
|
|
6125
|
-
this.cache = options.cache;
|
|
6167
|
+
this.cache = resolveCacheConfig(options.cache);
|
|
6126
6168
|
}
|
|
6127
6169
|
get headers() {
|
|
6128
6170
|
return HasuraAuthHelper.buildHeaders(this.authOptions);
|
|
@@ -11539,4 +11581,4 @@ class ProductsVertexSearch {
|
|
|
11539
11581
|
}
|
|
11540
11582
|
}
|
|
11541
11583
|
|
|
11542
|
-
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, toCents, withCreateFirestore, withCreateHasuraGraphQL, withCrudFirestore, withCrudHasuraGraphQL, withDeleteFirestore, withDeleteHasuraGraphQL, withFindFirestore, withFindHasuraGraphQL, withFirestore, withGetFirestore, withGetHasuraGraphQL, withHasuraGraphQL, withHelpers, withSubCollection, withUpdateFirestore, withUpdateHasuraGraphQL };
|
|
11584
|
+
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, resolveCacheConfig, resolveClass, serialize, toCents, withCreateFirestore, withCreateHasuraGraphQL, withCrudFirestore, withCrudHasuraGraphQL, withDeleteFirestore, withDeleteHasuraGraphQL, withFindFirestore, withFindHasuraGraphQL, withFirestore, withGetFirestore, withGetHasuraGraphQL, withHasuraGraphQL, withHelpers, withSubCollection, withUpdateFirestore, withUpdateHasuraGraphQL };
|
package/package.json
CHANGED
|
@@ -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
|
}
|