@infrab4a/connect 4.25.0-beta.7 → 4.25.0-beta.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 +157 -68
- package/index.esm.js +157 -68
- package/package.json +1 -1
- package/src/infra/firebase/firestore/mixins/helpers/cache-key-generator.helper.d.ts +9 -0
- package/src/infra/firebase/firestore/mixins/helpers/index.d.ts +1 -0
- package/src/infra/firebase/firestore/mixins/with-helpers.mixin.d.ts +1 -1
- package/src/infra/firebase/firestore/repositories/shop-settings/home-firestore.repository.d.ts +1 -1
- package/src/infra/firebase/firestore/repositories/shop-settings/shop-menu-firestore.repository.d.ts +1 -1
- package/src/infra/firebase/firestore/repositories/shop-settings/shop-settings-firestore.repository.d.ts +1 -1
- package/src/infra/firebase/firestore/repositories/shopping/buy-2-win-firestore.repository.d.ts +1 -1
- package/src/infra/firebase/firestore/repositories/shopping/campaign-dashboard-firestore.repository.d.ts +1 -1
- package/src/infra/firebase/firestore/repositories/shopping/campaign-hashtag-firestore.repository.d.ts +1 -1
- package/src/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.d.ts +1 -1
- package/src/infra/firebase/firestore/repositories/shopping/checkout-subscription-firestore.repository.d.ts +1 -1
- package/src/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.d.ts +1 -1
- package/src/infra/firebase/firestore/repositories/shopping/legacy-order-firestore.repository.d.ts +1 -1
- package/src/infra/firebase/firestore/repositories/shopping/order-blocked-firestore.repository.d.ts +1 -1
- package/src/infra/firebase/firestore/repositories/shopping/order-firestore.repository.d.ts +1 -1
- package/src/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.d.ts +1 -1
- package/src/infra/firebase/firestore/repositories/shopping/subscription-plan-firestore.repository.d.ts +1 -1
- package/src/infra/firebase/firestore/repositories/users/lead-firestore.repository.d.ts +1 -1
- package/src/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.d.ts +1 -1
- package/src/infra/firebase/firestore/repositories/users/subscription-firestore.repository.d.ts +1 -1
- package/src/infra/firebase/firestore/repositories/users/subscription-materialization-firestore.repository.d.ts +1 -1
- package/src/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.d.ts +1 -1
- package/src/infra/firebase/firestore/repositories/users/subscription-summary-firestore.repository.d.ts +1 -1
- package/src/infra/firebase/firestore/repositories/users/user-address-firestore.repository.d.ts +1 -1
- package/src/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.d.ts +1 -1
- package/src/infra/firebase/firestore/repositories/users/user-firestore.repository.d.ts +1 -1
- package/src/infra/firebase/firestore/repositories/users/user-payment-method-firestore.repository.d.ts +1 -1
- package/src/infra/hasura-graphql/repositories/catalog/category-collection-children-hasura-graphql.repository.d.ts +1 -1
- package/src/infra/hasura-graphql/repositories/catalog/category-filter-hasura-graphql.repository.d.ts +1 -1
- package/src/infra/hasura-graphql/repositories/catalog/category-product-hasura-graphql.repository.d.ts +1 -1
- package/src/infra/hasura-graphql/repositories/catalog/filter-hasura-graphql.repository.d.ts +1 -1
- package/src/infra/hasura-graphql/repositories/catalog/filter-option-hasura-graphql.repository.d.ts +1 -1
- package/src/infra/hasura-graphql/repositories/catalog/product-errors-hasura-graphql.repository.d.ts +1 -1
- package/src/infra/hasura-graphql/repositories/catalog/product-review-hasura-graphql.repository.d.ts +1 -1
- package/src/infra/hasura-graphql/repositories/catalog/product-stock-notification-hasura-graphql.repository.d.ts +1 -1
- package/src/infra/hasura-graphql/repositories/catalog/variant-hasura-graphql.repository.d.ts +1 -1
- package/src/infra/hasura-graphql/repositories/catalog/wishlist-hasura-graphql.repository.d.ts +1 -1
package/index.esm.js
CHANGED
|
@@ -3598,24 +3598,39 @@ class MD5GeneratorHelper {
|
|
|
3598
3598
|
}
|
|
3599
3599
|
}
|
|
3600
3600
|
|
|
3601
|
+
class FirestoreCacheKeyGeneratorHelper {
|
|
3602
|
+
static generateGetCacheKey(model, identifiers) {
|
|
3603
|
+
const sortedEntries = Object.entries(identifiers).sort(([keyA], [keyB]) => keyA.localeCompare(keyB));
|
|
3604
|
+
const keyParts = [];
|
|
3605
|
+
for (const [key, value] of sortedEntries) {
|
|
3606
|
+
keyParts.push(`${key}:${value}`);
|
|
3607
|
+
}
|
|
3608
|
+
return `${model.name.toLowerCase()}:get:${keyParts.join(':')}`;
|
|
3609
|
+
}
|
|
3610
|
+
static generateFindCacheKey(model, findParams) {
|
|
3611
|
+
const md5 = MD5GeneratorHelper.generateMD5(findParams);
|
|
3612
|
+
return `${model.name.toLowerCase()}:find:${md5}`;
|
|
3613
|
+
}
|
|
3614
|
+
}
|
|
3615
|
+
|
|
3601
3616
|
const withGetFirestore = (MixinBase) => {
|
|
3602
3617
|
return class GetFirestore extends MixinBase {
|
|
3603
|
-
async get(identifiers) {
|
|
3604
|
-
var _a, _b, _c, _d, _e, _f;
|
|
3618
|
+
async get(identifiers, options) {
|
|
3619
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
3605
3620
|
const logger = this.logger.with('get');
|
|
3606
3621
|
const collectionName = this.buildCollectionPathForGet(identifiers);
|
|
3607
3622
|
const instance = this.model.toInstance(this.model.identifiersFields.reduce((acc, field) => (Object.assign(Object.assign({}, acc), { [field]: identifiers[field] })), {}));
|
|
3608
3623
|
const req = { collection: collectionName, data: identifiers };
|
|
3609
|
-
if ((_a = this.cache) === null || _a === void 0 ? void 0 : _a.cacheAdapter) {
|
|
3610
|
-
const cacheKey =
|
|
3624
|
+
if (((_a = this.cache) === null || _a === void 0 ? void 0 : _a.cacheAdapter) && ((_b = options === null || options === void 0 ? void 0 : options.cache) === null || _b === void 0 ? void 0 : _b.enabled) !== false) {
|
|
3625
|
+
const cacheKey = FirestoreCacheKeyGeneratorHelper.generateGetCacheKey(this.model, identifiers);
|
|
3611
3626
|
const cachedData = await this.cache.cacheAdapter.get(cacheKey);
|
|
3612
3627
|
if (cachedData) {
|
|
3613
3628
|
logger.log({ req, res: 'Dados recuperados do cache', cacheKey });
|
|
3614
|
-
return this.model.toInstance(cachedData);
|
|
3629
|
+
return this.model.toInstance(JSON.parse(cachedData));
|
|
3615
3630
|
}
|
|
3616
3631
|
}
|
|
3617
3632
|
try {
|
|
3618
|
-
const intercepted = await ((
|
|
3633
|
+
const intercepted = await ((_d = (_c = this.interceptors) === null || _c === void 0 ? void 0 : _c.request) === null || _d === void 0 ? void 0 : _d.call(_c, { instance }));
|
|
3619
3634
|
const builded = (intercepted === null || intercepted === void 0 ? void 0 : intercepted.instance) || instance;
|
|
3620
3635
|
const docRef = await this.collection(collectionName)
|
|
3621
3636
|
.getDoc(Object.values(builded.identifier).shift().toString())
|
|
@@ -3623,14 +3638,14 @@ const withGetFirestore = (MixinBase) => {
|
|
|
3623
3638
|
const data = docRef.data();
|
|
3624
3639
|
if (isNil(data))
|
|
3625
3640
|
throw new NotFoundError(`Document '${collectionName}/${Object.values(identifiers).shift()}' not found`);
|
|
3626
|
-
const res = ((
|
|
3641
|
+
const res = (await ((_f = (_e = this.interceptors) === null || _e === void 0 ? void 0 : _e.response) === null || _f === void 0 ? void 0 : _f.call(_e, data, intercepted))) || data;
|
|
3627
3642
|
logger.log({ req, res });
|
|
3628
|
-
if ((
|
|
3629
|
-
const cacheKey =
|
|
3643
|
+
if (((_g = this.cache) === null || _g === void 0 ? void 0 : _g.cacheAdapter) && ((_h = options === null || options === void 0 ? void 0 : options.cache) === null || _h === void 0 ? void 0 : _h.enabled) !== false) {
|
|
3644
|
+
const cacheKey = FirestoreCacheKeyGeneratorHelper.generateGetCacheKey(this.model, identifiers);
|
|
3630
3645
|
await this.cache.cacheAdapter.set({
|
|
3631
3646
|
key: cacheKey,
|
|
3632
|
-
data: res,
|
|
3633
|
-
expirationInSeconds: this.cache.ttlDefault,
|
|
3647
|
+
data: JSON.stringify((res === null || res === void 0 ? void 0 : res.toPlain()) || res),
|
|
3648
|
+
expirationInSeconds: ((_j = options === null || options === void 0 ? void 0 : options.cache) === null || _j === void 0 ? void 0 : _j.ttl) || this.cache.ttlDefault,
|
|
3634
3649
|
});
|
|
3635
3650
|
logger.log({ req, message: 'Dados salvos no cache', cacheKey });
|
|
3636
3651
|
}
|
|
@@ -3723,15 +3738,26 @@ const withFindFirestore = (MixinBase) => {
|
|
|
3723
3738
|
]);
|
|
3724
3739
|
};
|
|
3725
3740
|
}
|
|
3726
|
-
|
|
3727
|
-
|
|
3741
|
+
generateCacheKey(findParams) {
|
|
3742
|
+
return FirestoreCacheKeyGeneratorHelper.generateFindCacheKey(this.model, findParams);
|
|
3743
|
+
}
|
|
3744
|
+
async find(find = {}, options) {
|
|
3745
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
3728
3746
|
const logger = this.logger.with('find');
|
|
3747
|
+
if (((_a = this.cache) === null || _a === void 0 ? void 0 : _a.cacheAdapter) && ((_b = options === null || options === void 0 ? void 0 : options.cache) === null || _b === void 0 ? void 0 : _b.enabled) !== false) {
|
|
3748
|
+
const cacheKey = this.generateCacheKey(find);
|
|
3749
|
+
const cachedData = await this.cache.cacheAdapter.get(cacheKey);
|
|
3750
|
+
if (cachedData) {
|
|
3751
|
+
logger.log(`Dados recuperados do cache: ${cacheKey}`);
|
|
3752
|
+
return JSON.parse(cachedData);
|
|
3753
|
+
}
|
|
3754
|
+
}
|
|
3729
3755
|
const collectionName = this.buildCollectionPathForFind(find.filters);
|
|
3730
3756
|
const collection = this.collection(collectionName);
|
|
3731
|
-
const enableCount = (
|
|
3757
|
+
const enableCount = (_d = (_c = find === null || find === void 0 ? void 0 : find.options) === null || _c === void 0 ? void 0 : _c.enableCount) !== null && _d !== void 0 ? _d : true;
|
|
3732
3758
|
const req = { collection: collectionName, data: find };
|
|
3733
3759
|
try {
|
|
3734
|
-
const intercepted = await ((
|
|
3760
|
+
const intercepted = await ((_f = (_e = this.interceptors) === null || _e === void 0 ? void 0 : _e.request) === null || _f === void 0 ? void 0 : _f.call(_e, { find }));
|
|
3735
3761
|
const { fields, filters, limits, orderBy } = (intercepted === null || intercepted === void 0 ? void 0 : intercepted.find) || find;
|
|
3736
3762
|
const queries = this.makeFirestoreWhere(filters || {});
|
|
3737
3763
|
const ordination = this.makeFirestoreOrderBy(filters, orderBy);
|
|
@@ -3741,10 +3767,19 @@ const withFindFirestore = (MixinBase) => {
|
|
|
3741
3767
|
.getDocs();
|
|
3742
3768
|
const data = docs.docs.map((doc) => doc.data());
|
|
3743
3769
|
const res = {
|
|
3744
|
-
data: (await ((
|
|
3770
|
+
data: (await ((_h = (_g = this.interceptors) === null || _g === void 0 ? void 0 : _g.response) === null || _h === void 0 ? void 0 : _h.call(_g, data, intercepted))) || data,
|
|
3745
3771
|
count: enableCount ? this.calculateCount(data, limits) : Infinity,
|
|
3746
3772
|
};
|
|
3747
3773
|
logger.log({ req, queries, ordination, offsets, res });
|
|
3774
|
+
if (((_j = this.cache) === null || _j === void 0 ? void 0 : _j.cacheAdapter) && ((_k = options === null || options === void 0 ? void 0 : options.cache) === null || _k === void 0 ? void 0 : _k.enabled) !== false) {
|
|
3775
|
+
const cacheKey = this.generateCacheKey(find);
|
|
3776
|
+
await this.cache.cacheAdapter.set({
|
|
3777
|
+
key: cacheKey,
|
|
3778
|
+
data: JSON.stringify(res),
|
|
3779
|
+
expirationInSeconds: ((_l = options === null || options === void 0 ? void 0 : options.cache) === null || _l === void 0 ? void 0 : _l.ttl) || this.cache.ttlDefault,
|
|
3780
|
+
});
|
|
3781
|
+
logger.log(`Dados salvos no cache: ${cacheKey}`);
|
|
3782
|
+
}
|
|
3748
3783
|
return res;
|
|
3749
3784
|
}
|
|
3750
3785
|
catch (error) {
|
|
@@ -3848,24 +3883,41 @@ const withUpdateFirestore = (MixinBase) => {
|
|
|
3848
3883
|
return options === null || options === void 0 ? void 0 : options.value;
|
|
3849
3884
|
};
|
|
3850
3885
|
return class UpdateFirestore extends MixinBase {
|
|
3886
|
+
getIdentifiersFromData(data) {
|
|
3887
|
+
const identifiers = {};
|
|
3888
|
+
const model = new this.model();
|
|
3889
|
+
const keyField = model.identifiersFields.shift();
|
|
3890
|
+
const identifierValue = getValueFromParams(data, keyField);
|
|
3891
|
+
identifiers[keyField] = identifierValue;
|
|
3892
|
+
return identifiers;
|
|
3893
|
+
}
|
|
3894
|
+
generateCacheKey(identifiers) {
|
|
3895
|
+
return FirestoreCacheKeyGeneratorHelper.generateGetCacheKey(this.model, identifiers);
|
|
3896
|
+
}
|
|
3851
3897
|
async update(data) {
|
|
3852
|
-
var _a, _b, _c, _d;
|
|
3898
|
+
var _a, _b, _c, _d, _e;
|
|
3853
3899
|
const logger = this.logger.with('update');
|
|
3854
3900
|
const collectionName = this.buildCollectionPathForUpdate(data);
|
|
3855
3901
|
const model = new this.model();
|
|
3856
3902
|
const keyField = model.identifiersFields.shift();
|
|
3857
3903
|
const req = { collection: collectionName, data };
|
|
3904
|
+
if ((_a = this.cache) === null || _a === void 0 ? void 0 : _a.cacheAdapter) {
|
|
3905
|
+
const identifiers = this.getIdentifiersFromData(data);
|
|
3906
|
+
const cacheKey = this.generateCacheKey(identifiers);
|
|
3907
|
+
await this.cache.cacheAdapter.remove(cacheKey);
|
|
3908
|
+
logger.log(`Cache removido: ${cacheKey}`);
|
|
3909
|
+
}
|
|
3858
3910
|
try {
|
|
3859
3911
|
const identifiers = getValueFromParams(data, keyField);
|
|
3860
3912
|
const docRef = this.collection(collectionName).getDoc(identifiers.toString());
|
|
3861
3913
|
if (!(await docRef.get()).data())
|
|
3862
3914
|
throw new NotFoundError(`Document '${collectionName}/${Object.values(identifiers.toString())}' not found`);
|
|
3863
3915
|
const plainFromData = this.model.toInstance(this.paramsToPlain(data));
|
|
3864
|
-
const intercepted = await ((
|
|
3916
|
+
const intercepted = await ((_c = (_b = this.interceptors) === null || _b === void 0 ? void 0 : _b.request) === null || _c === void 0 ? void 0 : _c.call(_b, { instance: plainFromData }));
|
|
3865
3917
|
const builded = (intercepted === null || intercepted === void 0 ? void 0 : intercepted.instance) || plainFromData;
|
|
3866
3918
|
await docRef.save(builded.toPlain());
|
|
3867
3919
|
const docData = await docRef.get();
|
|
3868
|
-
const res = ((
|
|
3920
|
+
const res = ((_e = (_d = this.interceptors) === null || _d === void 0 ? void 0 : _d.response) === null || _e === void 0 ? void 0 : _e.call(_d, docData.data(), intercepted)) || docData.data();
|
|
3869
3921
|
logger.log({ req, res, identifiers });
|
|
3870
3922
|
return res;
|
|
3871
3923
|
}
|
|
@@ -3891,17 +3943,25 @@ const withUpdateFirestore = (MixinBase) => {
|
|
|
3891
3943
|
|
|
3892
3944
|
const withDeleteFirestore = (MixinBase) => {
|
|
3893
3945
|
return class DeleteFirestore extends MixinBase {
|
|
3946
|
+
generateCacheKey(identifiers) {
|
|
3947
|
+
return FirestoreCacheKeyGeneratorHelper.generateGetCacheKey(this.model, identifiers);
|
|
3948
|
+
}
|
|
3894
3949
|
async delete(identifiers) {
|
|
3895
|
-
var _a, _b, _c, _d;
|
|
3950
|
+
var _a, _b, _c, _d, _e;
|
|
3896
3951
|
const logger = this.logger.with('delete');
|
|
3897
3952
|
const collectionName = this.buildCollectionPathForRemove(identifiers);
|
|
3898
3953
|
const instance = this.model.toInstance(this.model.identifiersFields.reduce((acc, field) => (Object.assign(Object.assign({}, acc), { [field]: identifiers[field] })), {}));
|
|
3899
3954
|
const req = { collection: collectionName, data: identifiers };
|
|
3955
|
+
if ((_a = this.cache) === null || _a === void 0 ? void 0 : _a.cacheAdapter) {
|
|
3956
|
+
const cacheKey = this.generateCacheKey(identifiers);
|
|
3957
|
+
await this.cache.cacheAdapter.remove(cacheKey);
|
|
3958
|
+
logger.log(`Cache removido: ${cacheKey}`);
|
|
3959
|
+
}
|
|
3900
3960
|
try {
|
|
3901
|
-
const intercepted = await ((
|
|
3961
|
+
const intercepted = await ((_c = (_b = this.interceptors) === null || _b === void 0 ? void 0 : _b.request) === null || _c === void 0 ? void 0 : _c.call(_b, { instance }));
|
|
3902
3962
|
const builded = (intercepted === null || intercepted === void 0 ? void 0 : intercepted.instance) || instance;
|
|
3903
3963
|
await this.collection(collectionName).getDoc(Object.values(builded.identifier).shift().toString()).delete();
|
|
3904
|
-
await ((
|
|
3964
|
+
await ((_e = (_d = this.interceptors) === null || _d === void 0 ? void 0 : _d.response) === null || _e === void 0 ? void 0 : _e.call(_d, instance, intercepted));
|
|
3905
3965
|
logger.log({ req, res: undefined });
|
|
3906
3966
|
}
|
|
3907
3967
|
catch (error) {
|
|
@@ -4146,12 +4206,13 @@ class SequenceFirestoreRepository extends withCrudFirestore(withHelpers(withFire
|
|
|
4146
4206
|
}
|
|
4147
4207
|
|
|
4148
4208
|
class HomeFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
4149
|
-
constructor({ firestore, interceptors }) {
|
|
4209
|
+
constructor({ firestore, interceptors, cache, }) {
|
|
4150
4210
|
super({
|
|
4151
4211
|
firestore,
|
|
4152
4212
|
collectionName: 'dms',
|
|
4153
4213
|
model: Home,
|
|
4154
4214
|
interceptors,
|
|
4215
|
+
cache,
|
|
4155
4216
|
});
|
|
4156
4217
|
this.homeCategoryGroupToPlain = (homeCategoryGroup) => {
|
|
4157
4218
|
var _a, _b, _c;
|
|
@@ -4208,89 +4269,97 @@ class HomeFirestoreRepository extends withCrudFirestore(withHelpers(withFirestor
|
|
|
4208
4269
|
}
|
|
4209
4270
|
|
|
4210
4271
|
class ShopMenuFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
4211
|
-
constructor({ firestore, interceptors }) {
|
|
4272
|
+
constructor({ firestore, interceptors, cache, }) {
|
|
4212
4273
|
super({
|
|
4213
4274
|
firestore,
|
|
4214
4275
|
collectionName: 'shopMenus',
|
|
4215
4276
|
model: ShopMenu,
|
|
4216
4277
|
interceptors,
|
|
4278
|
+
cache,
|
|
4217
4279
|
});
|
|
4218
4280
|
}
|
|
4219
4281
|
}
|
|
4220
4282
|
|
|
4221
4283
|
class ShopSettingsFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
4222
|
-
constructor({ firestore, interceptors, }) {
|
|
4284
|
+
constructor({ firestore, interceptors, cache, }) {
|
|
4223
4285
|
super({
|
|
4224
4286
|
firestore,
|
|
4225
4287
|
collectionName: 'shopSettings',
|
|
4226
4288
|
model: ShopSettings,
|
|
4227
4289
|
interceptors,
|
|
4290
|
+
cache,
|
|
4228
4291
|
});
|
|
4229
4292
|
}
|
|
4230
4293
|
}
|
|
4231
4294
|
|
|
4232
4295
|
class Buy2WinFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
4233
|
-
constructor({ firestore, interceptors }) {
|
|
4296
|
+
constructor({ firestore, interceptors, cache, }) {
|
|
4234
4297
|
super({
|
|
4235
4298
|
firestore,
|
|
4236
4299
|
collectionName: 'buy2win',
|
|
4237
4300
|
model: Buy2Win,
|
|
4238
4301
|
interceptors,
|
|
4302
|
+
cache,
|
|
4239
4303
|
});
|
|
4240
4304
|
}
|
|
4241
4305
|
}
|
|
4242
4306
|
|
|
4243
4307
|
class CampaignDashboardFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
4244
|
-
constructor({ firestore, interceptors, }) {
|
|
4308
|
+
constructor({ firestore, interceptors, cache, }) {
|
|
4245
4309
|
super({
|
|
4246
4310
|
firestore,
|
|
4247
4311
|
collectionName: 'dashboardCampaignsAuto',
|
|
4248
4312
|
model: CampaignDashboard,
|
|
4249
4313
|
interceptors,
|
|
4314
|
+
cache,
|
|
4250
4315
|
});
|
|
4251
4316
|
}
|
|
4252
4317
|
}
|
|
4253
4318
|
|
|
4254
4319
|
class CampaignHashtagFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
4255
|
-
constructor({ firestore, interceptors, }) {
|
|
4320
|
+
constructor({ firestore, interceptors, cache, }) {
|
|
4256
4321
|
super({
|
|
4257
4322
|
firestore,
|
|
4258
4323
|
collectionName: 'hashtagCampaignsAuto',
|
|
4259
4324
|
model: CampaignHashtag,
|
|
4260
4325
|
interceptors,
|
|
4326
|
+
cache,
|
|
4261
4327
|
});
|
|
4262
4328
|
}
|
|
4263
4329
|
}
|
|
4264
4330
|
|
|
4265
4331
|
class CheckoutFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
4266
|
-
constructor({ firestore, interceptors }) {
|
|
4332
|
+
constructor({ firestore, interceptors, cache, }) {
|
|
4267
4333
|
super({
|
|
4268
4334
|
firestore,
|
|
4269
4335
|
collectionName: 'checkouts',
|
|
4270
4336
|
model: Checkout,
|
|
4271
4337
|
interceptors,
|
|
4338
|
+
cache,
|
|
4272
4339
|
});
|
|
4273
4340
|
}
|
|
4274
4341
|
}
|
|
4275
4342
|
|
|
4276
4343
|
class CheckoutSubscriptionFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
4277
|
-
constructor({ firestore, interceptors, }) {
|
|
4344
|
+
constructor({ firestore, interceptors, cache, }) {
|
|
4278
4345
|
super({
|
|
4279
4346
|
firestore,
|
|
4280
4347
|
collectionName: 'checkoutsSubscription',
|
|
4281
4348
|
model: CheckoutSubscription,
|
|
4282
4349
|
interceptors,
|
|
4350
|
+
cache,
|
|
4283
4351
|
});
|
|
4284
4352
|
}
|
|
4285
4353
|
}
|
|
4286
4354
|
|
|
4287
4355
|
class CouponFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
4288
|
-
constructor({ firestore, interceptors }) {
|
|
4356
|
+
constructor({ firestore, interceptors, cache, }) {
|
|
4289
4357
|
super({
|
|
4290
4358
|
firestore,
|
|
4291
4359
|
collectionName: 'coupons',
|
|
4292
4360
|
model: Coupon,
|
|
4293
4361
|
interceptors,
|
|
4362
|
+
cache,
|
|
4294
4363
|
});
|
|
4295
4364
|
}
|
|
4296
4365
|
buildModelInstance() {
|
|
@@ -4313,12 +4382,13 @@ class CouponFirestoreRepository extends withCrudFirestore(withHelpers(withFirest
|
|
|
4313
4382
|
}
|
|
4314
4383
|
|
|
4315
4384
|
class OrderFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
4316
|
-
constructor({ firestore, interceptors }) {
|
|
4385
|
+
constructor({ firestore, interceptors, cache, }) {
|
|
4317
4386
|
super({
|
|
4318
4387
|
firestore,
|
|
4319
4388
|
collectionName: 'orders',
|
|
4320
4389
|
model: Order,
|
|
4321
4390
|
interceptors,
|
|
4391
|
+
cache,
|
|
4322
4392
|
fields: {
|
|
4323
4393
|
status: FirestoreFieldType.String,
|
|
4324
4394
|
},
|
|
@@ -4350,22 +4420,24 @@ class OrderFirestoreRepository extends withCrudFirestore(withHelpers(withFiresto
|
|
|
4350
4420
|
}
|
|
4351
4421
|
|
|
4352
4422
|
class LegacyOrderFirestoreRepository extends OrderFirestoreRepository {
|
|
4353
|
-
constructor({ firestore, interceptors }) {
|
|
4423
|
+
constructor({ firestore, interceptors, cache, }) {
|
|
4354
4424
|
super({
|
|
4355
4425
|
firestore,
|
|
4356
4426
|
interceptors,
|
|
4427
|
+
cache,
|
|
4357
4428
|
});
|
|
4358
4429
|
this.collectionName = 'legacyOrders';
|
|
4359
4430
|
}
|
|
4360
4431
|
}
|
|
4361
4432
|
|
|
4362
4433
|
class OrderBlockedFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
4363
|
-
constructor({ firestore, interceptors, }) {
|
|
4434
|
+
constructor({ firestore, interceptors, cache, }) {
|
|
4364
4435
|
super({
|
|
4365
4436
|
firestore,
|
|
4366
4437
|
collectionName: 'paymentBlockedAttempts',
|
|
4367
4438
|
model: OrderBlocked,
|
|
4368
4439
|
interceptors,
|
|
4440
|
+
cache,
|
|
4369
4441
|
});
|
|
4370
4442
|
}
|
|
4371
4443
|
async createBlockedOrderOrPayment(checkout, blockType, type, limiteRange, card = null) {
|
|
@@ -4397,130 +4469,141 @@ class OrderBlockedFirestoreRepository extends withCrudFirestore(withHelpers(with
|
|
|
4397
4469
|
}
|
|
4398
4470
|
|
|
4399
4471
|
class PaymentFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
4400
|
-
constructor({ firestore, interceptors }) {
|
|
4472
|
+
constructor({ firestore, interceptors, cache, }) {
|
|
4401
4473
|
super({
|
|
4402
4474
|
firestore,
|
|
4403
4475
|
collectionName: 'payments',
|
|
4404
4476
|
model: Payment,
|
|
4405
4477
|
interceptors,
|
|
4478
|
+
cache,
|
|
4406
4479
|
});
|
|
4407
4480
|
}
|
|
4408
4481
|
}
|
|
4409
4482
|
|
|
4410
4483
|
class SubscriptionPlanFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
4411
|
-
constructor({ firestore, interceptors, }) {
|
|
4484
|
+
constructor({ firestore, interceptors, cache, }) {
|
|
4412
4485
|
super({
|
|
4413
4486
|
firestore,
|
|
4414
4487
|
collectionName: 'subscriptionPlans',
|
|
4415
4488
|
model: SubscriptionPlan,
|
|
4416
4489
|
interceptors,
|
|
4490
|
+
cache,
|
|
4417
4491
|
});
|
|
4418
4492
|
}
|
|
4419
4493
|
}
|
|
4420
4494
|
|
|
4421
4495
|
class LeadFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
4422
|
-
constructor({ firestore, interceptors }) {
|
|
4496
|
+
constructor({ firestore, interceptors, cache, }) {
|
|
4423
4497
|
super({
|
|
4424
4498
|
firestore,
|
|
4425
4499
|
collectionName: 'leads',
|
|
4426
4500
|
model: Lead,
|
|
4427
4501
|
interceptors,
|
|
4502
|
+
cache,
|
|
4428
4503
|
});
|
|
4429
4504
|
}
|
|
4430
4505
|
}
|
|
4431
4506
|
|
|
4432
4507
|
class SubscriptionEditionFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base)))) {
|
|
4433
|
-
constructor({ firestore, interceptors }, parentRepository) {
|
|
4508
|
+
constructor({ firestore, interceptors, cache, }, parentRepository) {
|
|
4434
4509
|
super({
|
|
4435
4510
|
firestore,
|
|
4436
4511
|
collectionName: 'editions',
|
|
4437
4512
|
parentIdField: 'subscriptionId',
|
|
4438
4513
|
model: Edition,
|
|
4439
4514
|
interceptors,
|
|
4515
|
+
cache,
|
|
4440
4516
|
});
|
|
4441
4517
|
this.parentRepository = parentRepository;
|
|
4442
4518
|
}
|
|
4443
4519
|
}
|
|
4444
4520
|
|
|
4445
4521
|
class SubscriptionFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
4446
|
-
constructor({ firestore, interceptors, }) {
|
|
4522
|
+
constructor({ firestore, interceptors, cache, }) {
|
|
4447
4523
|
super({
|
|
4448
4524
|
firestore,
|
|
4449
4525
|
collectionName: 'subscription',
|
|
4450
4526
|
model: Subscription,
|
|
4451
4527
|
interceptors,
|
|
4528
|
+
cache,
|
|
4452
4529
|
});
|
|
4453
4530
|
}
|
|
4454
4531
|
}
|
|
4455
4532
|
|
|
4456
4533
|
class SubscriptionMaterializationFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
4457
|
-
constructor({ firestore, interceptors }) {
|
|
4534
|
+
constructor({ firestore, interceptors, cache, }) {
|
|
4458
4535
|
super({
|
|
4459
4536
|
firestore,
|
|
4460
4537
|
collectionName: 'subscriptionMaterialization',
|
|
4461
4538
|
model: SubscriptionMaterialization,
|
|
4462
4539
|
interceptors,
|
|
4540
|
+
cache,
|
|
4463
4541
|
});
|
|
4464
4542
|
}
|
|
4465
4543
|
}
|
|
4466
4544
|
|
|
4467
4545
|
class SubscriptionPaymentFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base)))) {
|
|
4468
|
-
constructor({ firestore, interceptors }, parentRepository) {
|
|
4546
|
+
constructor({ firestore, interceptors, cache, }, parentRepository) {
|
|
4469
4547
|
super({
|
|
4470
4548
|
firestore,
|
|
4471
4549
|
collectionName: 'payments',
|
|
4472
4550
|
parentIdField: 'subscriptionId',
|
|
4473
4551
|
model: SubscriptionPayment,
|
|
4474
4552
|
interceptors,
|
|
4553
|
+
cache,
|
|
4475
4554
|
});
|
|
4476
4555
|
this.parentRepository = parentRepository;
|
|
4477
4556
|
}
|
|
4478
4557
|
}
|
|
4479
4558
|
|
|
4480
4559
|
class SubscriptionSummaryFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
4481
|
-
constructor({ firestore, interceptors, }) {
|
|
4560
|
+
constructor({ firestore, interceptors, cache, }) {
|
|
4482
4561
|
super({
|
|
4483
4562
|
firestore,
|
|
4484
4563
|
collectionName: 'subscriptionSummary',
|
|
4485
4564
|
model: SubscriptionSummary,
|
|
4486
4565
|
interceptors,
|
|
4566
|
+
cache,
|
|
4487
4567
|
});
|
|
4488
4568
|
}
|
|
4489
4569
|
}
|
|
4490
4570
|
|
|
4491
4571
|
class UserAddressFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base)))) {
|
|
4492
|
-
constructor({ firestore, interceptors }, parentRepository) {
|
|
4572
|
+
constructor({ firestore, interceptors, cache, }, parentRepository) {
|
|
4493
4573
|
super({
|
|
4494
4574
|
firestore,
|
|
4495
4575
|
collectionName: 'address',
|
|
4496
4576
|
parentIdField: 'userId',
|
|
4497
4577
|
model: UserAddress,
|
|
4498
4578
|
interceptors,
|
|
4579
|
+
cache,
|
|
4499
4580
|
});
|
|
4500
4581
|
this.parentRepository = parentRepository;
|
|
4501
4582
|
}
|
|
4502
4583
|
}
|
|
4503
4584
|
|
|
4504
4585
|
class UserBeautyProfileFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base)))) {
|
|
4505
|
-
constructor({ firestore, interceptors }, parentRepository) {
|
|
4586
|
+
constructor({ firestore, interceptors, cache, }, parentRepository) {
|
|
4506
4587
|
super({
|
|
4507
4588
|
firestore,
|
|
4508
4589
|
collectionName: 'CX',
|
|
4509
4590
|
parentIdField: 'userId',
|
|
4510
4591
|
model: BeautyProfile,
|
|
4511
4592
|
interceptors,
|
|
4593
|
+
cache,
|
|
4512
4594
|
});
|
|
4513
4595
|
this.parentRepository = parentRepository;
|
|
4514
4596
|
}
|
|
4515
4597
|
}
|
|
4516
4598
|
|
|
4517
4599
|
class UserFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
4518
|
-
constructor({ firestore, interceptors }) {
|
|
4600
|
+
constructor({ firestore, interceptors, cache, }) {
|
|
4519
4601
|
super({
|
|
4520
4602
|
firestore,
|
|
4521
4603
|
collectionName: 'users',
|
|
4522
4604
|
model: User,
|
|
4523
4605
|
interceptors,
|
|
4606
|
+
cache,
|
|
4524
4607
|
});
|
|
4525
4608
|
}
|
|
4526
4609
|
async get(identifiers) {
|
|
@@ -4580,13 +4663,14 @@ __decorate([
|
|
|
4580
4663
|
], UserFirestoreRepository.prototype, "checkIfExistsByField", null);
|
|
4581
4664
|
|
|
4582
4665
|
class UserPaymentMethodFirestoreRepository extends withSubCollection(withCrudFirestore(withHelpers(withFirestore(Base)))) {
|
|
4583
|
-
constructor({ firestore, interceptors }, parentRepository) {
|
|
4666
|
+
constructor({ firestore, interceptors, cache, }, parentRepository) {
|
|
4584
4667
|
super({
|
|
4585
4668
|
firestore,
|
|
4586
4669
|
collectionName: 'payment_method',
|
|
4587
4670
|
parentIdField: 'userId',
|
|
4588
4671
|
model: UserPaymentMethod,
|
|
4589
4672
|
interceptors,
|
|
4673
|
+
cache,
|
|
4590
4674
|
});
|
|
4591
4675
|
this.parentRepository = parentRepository;
|
|
4592
4676
|
}
|
|
@@ -5253,7 +5337,7 @@ __decorate([
|
|
|
5253
5337
|
], ProductErrorsHasuraGraphQL.prototype, "product", void 0);
|
|
5254
5338
|
|
|
5255
5339
|
class CategoryCollectionChildrenHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
5256
|
-
constructor({ endpoint, authOptions, interceptors, }) {
|
|
5340
|
+
constructor({ endpoint, authOptions, interceptors, cache, }) {
|
|
5257
5341
|
super({
|
|
5258
5342
|
tableName: 'category_collection_children',
|
|
5259
5343
|
model: CategoryCollectionChildren,
|
|
@@ -5284,12 +5368,13 @@ class CategoryCollectionChildrenHasuraGraphQLRepository extends withCrudHasuraGr
|
|
|
5284
5368
|
},
|
|
5285
5369
|
},
|
|
5286
5370
|
],
|
|
5371
|
+
cache,
|
|
5287
5372
|
});
|
|
5288
5373
|
}
|
|
5289
5374
|
}
|
|
5290
5375
|
|
|
5291
5376
|
class CategoryFilterHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
5292
|
-
constructor({ endpoint, authOptions, interceptors, }) {
|
|
5377
|
+
constructor({ endpoint, authOptions, interceptors, cache, }) {
|
|
5293
5378
|
super({
|
|
5294
5379
|
tableName: 'category_filter',
|
|
5295
5380
|
model: CategoryFilter,
|
|
@@ -5371,6 +5456,7 @@ class CategoryFilterHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHa
|
|
|
5371
5456
|
},
|
|
5372
5457
|
},
|
|
5373
5458
|
],
|
|
5459
|
+
cache,
|
|
5374
5460
|
});
|
|
5375
5461
|
}
|
|
5376
5462
|
deleteByCategory(categoryId) {
|
|
@@ -5615,12 +5701,10 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
5615
5701
|
const mostRelevants = category.getMostRelevantByShop(shop);
|
|
5616
5702
|
const mostRelevantProductsIds = [...new Set(mostRelevants.concat(category.products))];
|
|
5617
5703
|
const products = [];
|
|
5618
|
-
const { data: productsData } = await this.productRepository.findCatalog({
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
published: true,
|
|
5622
|
-
},
|
|
5623
|
-
fields: [
|
|
5704
|
+
const { data: productsData } = await this.productRepository.findCatalog(Object.assign(Object.assign({ filters: Object.assign({ id: {
|
|
5705
|
+
operator: Where.IN,
|
|
5706
|
+
value: mostRelevantProductsIds,
|
|
5707
|
+
}, published: true }, (options.hasStock ? { stock: { quantity: { operator: Where.GT, value: 0 } } } : {})) }, (options.limit ? { limit: options.limit } : {})), { fields: [
|
|
5624
5708
|
'id',
|
|
5625
5709
|
'name',
|
|
5626
5710
|
'slug',
|
|
@@ -5646,15 +5730,12 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
5646
5730
|
'shoppingCount',
|
|
5647
5731
|
'gender',
|
|
5648
5732
|
'createdAt',
|
|
5649
|
-
],
|
|
5650
|
-
|
|
5651
|
-
orderBy: {
|
|
5733
|
+
], options: { enableCount: false }, orderBy: {
|
|
5734
|
+
stock: 'desc',
|
|
5652
5735
|
shoppingCount: 'desc',
|
|
5653
5736
|
rate: 'desc',
|
|
5654
|
-
stock: 'desc',
|
|
5655
5737
|
name: 'asc',
|
|
5656
|
-
},
|
|
5657
|
-
}, shop === Shops.MENSMARKET ? 'male' : 'female', optionsCache);
|
|
5738
|
+
} }), shop === Shops.MENSMARKET ? 'male' : 'female', optionsCache);
|
|
5658
5739
|
const mostRelevantWithouyStock = productsData.filter((product) => mostRelevants.includes(product.id) && product.stock.quantity <= 0);
|
|
5659
5740
|
const firstProducts = productsData
|
|
5660
5741
|
.filter((product) => mostRelevants.includes(product.id) && product.stock.quantity > 0)
|
|
@@ -5840,7 +5921,7 @@ __decorate([
|
|
|
5840
5921
|
], CategoryHasuraGraphQLRepository.prototype, "isChild", null);
|
|
5841
5922
|
|
|
5842
5923
|
class CategoryProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
5843
|
-
constructor({ endpoint, authOptions, interceptors, }) {
|
|
5924
|
+
constructor({ endpoint, authOptions, interceptors, cache, }) {
|
|
5844
5925
|
super({
|
|
5845
5926
|
tableName: 'category_product',
|
|
5846
5927
|
model: CategoryProduct,
|
|
@@ -5848,6 +5929,7 @@ class CategoryProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withH
|
|
|
5848
5929
|
authOptions,
|
|
5849
5930
|
interceptors,
|
|
5850
5931
|
fields: [{ productId: { columnName: 'product_id' } }, { categoryId: { columnName: 'category_id' } }, 'order'],
|
|
5932
|
+
cache,
|
|
5851
5933
|
});
|
|
5852
5934
|
}
|
|
5853
5935
|
async removeProductFromCategory(categoryId, productId) {
|
|
@@ -5874,7 +5956,7 @@ class CategoryProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withH
|
|
|
5874
5956
|
}
|
|
5875
5957
|
|
|
5876
5958
|
class FilterHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
5877
|
-
constructor({ endpoint, authOptions, interceptors, }, filterOptionRepository, categoryFilterRepository) {
|
|
5959
|
+
constructor({ endpoint, authOptions, interceptors, cache, }, filterOptionRepository, categoryFilterRepository) {
|
|
5878
5960
|
super({
|
|
5879
5961
|
tableName: 'filter',
|
|
5880
5962
|
model: Filter,
|
|
@@ -5914,6 +5996,7 @@ class FilterHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGrap
|
|
|
5914
5996
|
},
|
|
5915
5997
|
},
|
|
5916
5998
|
],
|
|
5999
|
+
cache,
|
|
5917
6000
|
});
|
|
5918
6001
|
this.filterOptionRepository = filterOptionRepository;
|
|
5919
6002
|
this.categoryFilterRepository = categoryFilterRepository;
|
|
@@ -6000,7 +6083,7 @@ __decorate([
|
|
|
6000
6083
|
], FilterHasuraGraphQLRepository.prototype, "deleteOptions", null);
|
|
6001
6084
|
|
|
6002
6085
|
class FilterOptionHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
6003
|
-
constructor({ endpoint, authOptions, interceptors, }) {
|
|
6086
|
+
constructor({ endpoint, authOptions, interceptors, cache, }) {
|
|
6004
6087
|
super({
|
|
6005
6088
|
tableName: 'filter_option',
|
|
6006
6089
|
model: FilterOption,
|
|
@@ -6014,18 +6097,20 @@ class FilterOptionHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasu
|
|
|
6014
6097
|
{ createdAt: { columnName: 'created_at' } },
|
|
6015
6098
|
{ updatedAt: { columnName: 'updated_at' } },
|
|
6016
6099
|
],
|
|
6100
|
+
cache,
|
|
6017
6101
|
});
|
|
6018
6102
|
}
|
|
6019
6103
|
}
|
|
6020
6104
|
|
|
6021
6105
|
class ProductErrorsHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
6022
|
-
constructor({ endpoint, authOptions, interceptors, }, productRepository) {
|
|
6106
|
+
constructor({ endpoint, authOptions, interceptors, cache, }, productRepository) {
|
|
6023
6107
|
super({
|
|
6024
6108
|
tableName: 'product_errors',
|
|
6025
6109
|
model: ProductErrorsHasuraGraphQL,
|
|
6026
6110
|
endpoint,
|
|
6027
6111
|
authOptions,
|
|
6028
6112
|
interceptors,
|
|
6113
|
+
cache,
|
|
6029
6114
|
fields: [
|
|
6030
6115
|
{
|
|
6031
6116
|
productId: {
|
|
@@ -6739,7 +6824,7 @@ __decorate([
|
|
|
6739
6824
|
], ProductHasuraGraphQLRepository.prototype, "findReviewsByProduct", null);
|
|
6740
6825
|
|
|
6741
6826
|
class ProductReviewHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
6742
|
-
constructor({ endpoint, authOptions, interceptors, }) {
|
|
6827
|
+
constructor({ endpoint, authOptions, interceptors, cache, }) {
|
|
6743
6828
|
super({
|
|
6744
6829
|
tableName: 'product_review',
|
|
6745
6830
|
model: ProductReview,
|
|
@@ -6763,6 +6848,7 @@ class ProductReviewHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHas
|
|
|
6763
6848
|
{ createdAt: { columnName: 'created_at' } },
|
|
6764
6849
|
{ updatedAt: { columnName: 'updated_at' } },
|
|
6765
6850
|
],
|
|
6851
|
+
cache,
|
|
6766
6852
|
});
|
|
6767
6853
|
}
|
|
6768
6854
|
async updateManyStatus(reviews) {
|
|
@@ -6804,13 +6890,14 @@ __decorate([
|
|
|
6804
6890
|
], ProductReviewHasuraGraphQLRepository.prototype, "disaproveReview", null);
|
|
6805
6891
|
|
|
6806
6892
|
class ProductStockNotificationHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
6807
|
-
constructor({ endpoint, authOptions, interceptors, }) {
|
|
6893
|
+
constructor({ endpoint, authOptions, interceptors, cache, }) {
|
|
6808
6894
|
super({
|
|
6809
6895
|
tableName: 'product_stock_notification',
|
|
6810
6896
|
model: ProductStockNotification,
|
|
6811
6897
|
endpoint,
|
|
6812
6898
|
authOptions,
|
|
6813
6899
|
interceptors,
|
|
6900
|
+
cache,
|
|
6814
6901
|
fields: [
|
|
6815
6902
|
'id',
|
|
6816
6903
|
{ productId: { columnName: 'product_id' } },
|
|
@@ -6865,13 +6952,14 @@ class ProductStockNotificationHasuraGraphQLRepository extends withCrudHasuraGrap
|
|
|
6865
6952
|
}
|
|
6866
6953
|
|
|
6867
6954
|
class VariantHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
6868
|
-
constructor({ endpoint, authOptions, interceptors, }) {
|
|
6955
|
+
constructor({ endpoint, authOptions, interceptors, cache, }) {
|
|
6869
6956
|
super({
|
|
6870
6957
|
tableName: 'product',
|
|
6871
6958
|
model: VariantHasuraGraphQL,
|
|
6872
6959
|
endpoint,
|
|
6873
6960
|
authOptions,
|
|
6874
6961
|
interceptors,
|
|
6962
|
+
cache,
|
|
6875
6963
|
fields: [
|
|
6876
6964
|
{ id: { columnName: 'id', to: (value) => +value, from: (value) => value.toString() } },
|
|
6877
6965
|
{ firestoreId: { columnName: 'firestore_id' } },
|
|
@@ -6978,13 +7066,14 @@ class WishlistHasuraGraphQL extends Wishlist {
|
|
|
6978
7066
|
}
|
|
6979
7067
|
|
|
6980
7068
|
class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
6981
|
-
constructor({ endpoint, authOptions, interceptors, }, categoryProductRepository) {
|
|
7069
|
+
constructor({ endpoint, authOptions, interceptors, cache, }, categoryProductRepository) {
|
|
6982
7070
|
super({
|
|
6983
7071
|
tableName: 'category',
|
|
6984
7072
|
model: WishlistHasuraGraphQL,
|
|
6985
7073
|
endpoint,
|
|
6986
7074
|
authOptions,
|
|
6987
7075
|
interceptors,
|
|
7076
|
+
cache,
|
|
6988
7077
|
fields: [
|
|
6989
7078
|
{ id: { columnName: 'id', to: (value) => +value, from: (value) => value.toString() } },
|
|
6990
7079
|
{ firestoreId: { columnName: 'firestore_id' } },
|