@infrab4a/connect 3.4.0-beta.14 → 3.4.0-beta.2
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/bundles/infrab4a-connect.umd.js +145 -324
- package/bundles/infrab4a-connect.umd.js.map +1 -1
- package/domain/catalog/models/category.d.ts +2 -3
- package/domain/catalog/models/filter-option.d.ts +1 -1
- package/domain/catalog/models/index.d.ts +0 -1
- package/domain/catalog/models/product.d.ts +0 -1
- package/domain/catalog/models/types/category-filter.type.d.ts +4 -0
- package/domain/catalog/models/types/index.d.ts +1 -0
- package/domain/catalog/repositories/index.d.ts +0 -1
- package/esm2015/domain/catalog/models/category.js +1 -8
- package/esm2015/domain/catalog/models/filter-option.js +1 -1
- package/esm2015/domain/catalog/models/index.js +1 -2
- package/esm2015/domain/catalog/models/product.js +1 -1
- package/esm2015/domain/catalog/models/types/category-filter.type.js +2 -0
- package/esm2015/domain/catalog/models/types/index.js +2 -1
- package/esm2015/domain/catalog/repositories/index.js +1 -2
- package/esm2015/infra/hasura-graphql/mixins/helpers/attribute-option.helper.js +2 -2
- package/esm2015/infra/hasura-graphql/repositories/catalog/category-hasura-graphql.repository.js +4 -84
- package/esm2015/infra/hasura-graphql/repositories/catalog/filter-hasura-graphql.repository.js +42 -68
- package/esm2015/infra/hasura-graphql/repositories/catalog/filter-option-hasura-graphql.repository.js +29 -3
- package/esm2015/infra/hasura-graphql/repositories/catalog/index.js +1 -2
- package/esm2015/infra/hasura-graphql/repositories/catalog/product-hasura-graphql.repository.js +1 -2
- package/esm2015/infra/hasura-graphql/types/hasura-graphql-fields.type.js +1 -1
- package/esm2015/utils/index.js +6 -6
- package/fesm2015/infrab4a-connect.js +82 -199
- package/fesm2015/infrab4a-connect.js.map +1 -1
- package/infra/hasura-graphql/repositories/catalog/category-hasura-graphql.repository.d.ts +1 -4
- package/infra/hasura-graphql/repositories/catalog/filter-hasura-graphql.repository.d.ts +5 -6
- package/infra/hasura-graphql/repositories/catalog/filter-option-hasura-graphql.repository.d.ts +5 -1
- package/infra/hasura-graphql/repositories/catalog/index.d.ts +0 -1
- package/infra/hasura-graphql/types/hasura-graphql-fields.type.d.ts +1 -1
- package/package.json +1 -1
- package/utils/index.d.ts +5 -5
- package/domain/catalog/models/category-filter.d.ts +0 -9
- package/domain/catalog/repositories/category-filter.repository.d.ts +0 -5
- package/esm2015/domain/catalog/models/category-filter.js +0 -10
- package/esm2015/domain/catalog/repositories/category-filter.repository.js +0 -2
- package/esm2015/infra/hasura-graphql/repositories/catalog/category-filter-hasura-graphql.repository.js +0 -24
- package/infra/hasura-graphql/repositories/catalog/category-filter-hasura-graphql.repository.d.ts +0 -11
|
@@ -4,7 +4,7 @@ import { __decorate, __metadata, __awaiter, __rest } from 'tslib';
|
|
|
4
4
|
import { parseISO } from 'date-fns';
|
|
5
5
|
export { add, addBusinessDays, addDays, addMonths, addYears, endOfDay, format, formatISO9075, parseISO, startOfDay, sub } from 'date-fns';
|
|
6
6
|
import { isString, isNil, isNumber, isDate, set, isObject, isEmpty, chunk, isBoolean, isInteger, isNaN as isNaN$1, omit } from 'lodash';
|
|
7
|
-
export { chunk, isBoolean, isDate, isEmpty, isInteger, isNaN, isNil, isNumber, isObject, isString, now, omit, pick, set } from 'lodash';
|
|
7
|
+
export { chunk, difference, isBoolean, isDate, isEmpty, isInteger, isNaN, isNil, isNumber, isObject, isString, now, omit, pick, set } from 'lodash';
|
|
8
8
|
import { CustomError } from 'ts-custom-error';
|
|
9
9
|
import axios from 'axios';
|
|
10
10
|
import firebase from 'firebase';
|
|
@@ -466,14 +466,14 @@ class Address extends BaseModel {
|
|
|
466
466
|
}
|
|
467
467
|
}
|
|
468
468
|
|
|
469
|
+
const isUUID = (value) => isString(value) && /[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}/.test(value);
|
|
470
|
+
|
|
469
471
|
class Base {
|
|
470
472
|
constructor(...args) {
|
|
471
473
|
Object.assign(this, ...args);
|
|
472
474
|
}
|
|
473
475
|
}
|
|
474
476
|
|
|
475
|
-
const isUUID = (value) => isString(value) && /[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}/.test(value);
|
|
476
|
-
|
|
477
477
|
const parseDateTime = (value) => {
|
|
478
478
|
if (!isString(value))
|
|
479
479
|
return value;
|
|
@@ -751,15 +751,6 @@ class RecoveryPassword {
|
|
|
751
751
|
}
|
|
752
752
|
}
|
|
753
753
|
|
|
754
|
-
class Filter extends BaseModel {
|
|
755
|
-
identifierFields() {
|
|
756
|
-
return ['id'];
|
|
757
|
-
}
|
|
758
|
-
static get identifiersFields() {
|
|
759
|
-
return ['id'];
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
|
|
763
754
|
class Category extends BaseModel {
|
|
764
755
|
identifierFields() {
|
|
765
756
|
return ['id'];
|
|
@@ -767,19 +758,6 @@ class Category extends BaseModel {
|
|
|
767
758
|
static get identifiersFields() {
|
|
768
759
|
return ['id'];
|
|
769
760
|
}
|
|
770
|
-
}
|
|
771
|
-
__decorate([
|
|
772
|
-
Type(() => Filter),
|
|
773
|
-
__metadata("design:type", Array)
|
|
774
|
-
], Category.prototype, "filters", void 0);
|
|
775
|
-
|
|
776
|
-
class CategoryFilter extends BaseModel {
|
|
777
|
-
// identifierFields(): NonFunctionPropertyNames<CategoryFilter>[] {
|
|
778
|
-
// return ['id']
|
|
779
|
-
// }
|
|
780
|
-
static get identifiersFields() {
|
|
781
|
-
return ['id', 'filterId', 'categoryId'];
|
|
782
|
-
}
|
|
783
761
|
}
|
|
784
762
|
|
|
785
763
|
var GenderDestination;
|
|
@@ -797,6 +775,15 @@ var Shops;
|
|
|
797
775
|
Shops["ALL"] = "ALL";
|
|
798
776
|
})(Shops || (Shops = {}));
|
|
799
777
|
|
|
778
|
+
class Filter extends BaseModel {
|
|
779
|
+
identifierFields() {
|
|
780
|
+
return ['id'];
|
|
781
|
+
}
|
|
782
|
+
static get identifiersFields() {
|
|
783
|
+
return ['id'];
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
|
|
800
787
|
class FilterOption extends BaseModel {
|
|
801
788
|
identifierFields() {
|
|
802
789
|
return ['id'];
|
|
@@ -2020,7 +2007,7 @@ class AttributeOptionHelper {
|
|
|
2020
2007
|
}
|
|
2021
2008
|
AttributeOptionHelper.FindByAttribute = (attributeName, fields) => {
|
|
2022
2009
|
if (fields.includes(attributeName))
|
|
2023
|
-
return { columnName: attributeName.toString(), attributeName
|
|
2010
|
+
return { columnName: attributeName.toString(), attributeName };
|
|
2024
2011
|
const field = fields.find((columnOption) => isObject(columnOption) && Object.keys(columnOption).includes(attributeName.toString()));
|
|
2025
2012
|
const fieldOption = field === null || field === void 0 ? void 0 : field[attributeName.toString()];
|
|
2026
2013
|
if (isNil(fieldOption))
|
|
@@ -2541,29 +2528,8 @@ class VariantHasuraGraphQL extends Variant {
|
|
|
2541
2528
|
}
|
|
2542
2529
|
}
|
|
2543
2530
|
|
|
2544
|
-
class CategoryFilterHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
2545
|
-
constructor(endpoint, authOptions) {
|
|
2546
|
-
super({
|
|
2547
|
-
tableName: 'category_filter',
|
|
2548
|
-
model: CategoryFilter,
|
|
2549
|
-
endpoint,
|
|
2550
|
-
authOptions,
|
|
2551
|
-
fields: ['id', { filterId: { columnName: 'filter_id' } }, { categoryId: { columnName: 'category_id' } }],
|
|
2552
|
-
});
|
|
2553
|
-
}
|
|
2554
|
-
deleteByCategoryAndFilter(categoryId, filterId) {
|
|
2555
|
-
return this.mutation('delete_category_filter', ['affected_rows'], {
|
|
2556
|
-
where: {
|
|
2557
|
-
type: 'category_filter_bool_exp',
|
|
2558
|
-
required: true,
|
|
2559
|
-
value: { category_id: { _eq: categoryId }, filter_id: { _eq: filterId } },
|
|
2560
|
-
},
|
|
2561
|
-
});
|
|
2562
|
-
}
|
|
2563
|
-
}
|
|
2564
|
-
|
|
2565
2531
|
class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
2566
|
-
constructor(endpoint, authOptions, productRepository
|
|
2532
|
+
constructor(endpoint, authOptions, productRepository) {
|
|
2567
2533
|
super({
|
|
2568
2534
|
tableName: 'category',
|
|
2569
2535
|
model: Category,
|
|
@@ -2599,17 +2565,7 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
2599
2565
|
},
|
|
2600
2566
|
},
|
|
2601
2567
|
},
|
|
2602
|
-
|
|
2603
|
-
filters: {
|
|
2604
|
-
columnName: 'filters',
|
|
2605
|
-
foreignKeyColumn: { filter_id: 'id' },
|
|
2606
|
-
fields: [{ filter: ['id', 'description', 'slug', 'enabled'] }],
|
|
2607
|
-
bindPersistData: (value) => ({
|
|
2608
|
-
filters: { data: value.map((filter) => ({ filter_id: filter.id })) },
|
|
2609
|
-
}),
|
|
2610
|
-
from: (filters) => (filters === null || filters === void 0 ? void 0 : filters.map((filter) => filter === null || filter === void 0 ? void 0 : filter.filter)) || [],
|
|
2611
|
-
},
|
|
2612
|
-
},
|
|
2568
|
+
'filters',
|
|
2613
2569
|
{ createdAt: { columnName: 'created_at' } },
|
|
2614
2570
|
{ updatedAt: { columnName: 'updated_at' } },
|
|
2615
2571
|
{
|
|
@@ -2634,7 +2590,6 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
2634
2590
|
],
|
|
2635
2591
|
});
|
|
2636
2592
|
this.productRepository = productRepository;
|
|
2637
|
-
this.categoryFilterRepository = categoryFilterRepository;
|
|
2638
2593
|
}
|
|
2639
2594
|
create(params) {
|
|
2640
2595
|
const _super = Object.create(null, {
|
|
@@ -2661,13 +2616,12 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
2661
2616
|
update: { get: () => super.update }
|
|
2662
2617
|
});
|
|
2663
2618
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2664
|
-
const { products, id: checkId, metadata
|
|
2619
|
+
const { products, id: checkId, metadata } = params, data = __rest(params, ["products", "id", "metadata"]);
|
|
2665
2620
|
const plainData = this.paramsToPlain({ id: checkId });
|
|
2666
2621
|
const id = yield this.getId(plainData.id);
|
|
2667
2622
|
const category = yield _super.update.call(this, Object.assign({ id }, data));
|
|
2668
2623
|
category.products = products && (yield this.updateProducts(+id, { products }));
|
|
2669
2624
|
category.metadata = metadata && (yield this.updateMetadata(+id, { metadata }));
|
|
2670
|
-
category.filters = filters && (yield this.updateFilters(+id, { filters }));
|
|
2671
2625
|
return category;
|
|
2672
2626
|
});
|
|
2673
2627
|
}
|
|
@@ -2807,78 +2761,10 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
2807
2761
|
return plainData.metadata;
|
|
2808
2762
|
});
|
|
2809
2763
|
}
|
|
2810
|
-
updateFilters(categoryId, { filters }) {
|
|
2811
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
2812
|
-
if ('action' in filters && filters.action === 'remove' && filters.value.length) {
|
|
2813
|
-
for (let i = 0; i < filters.value.length; i++) {
|
|
2814
|
-
yield this.categoryFilterRepository.deleteByCategoryAndFilter(categoryId, filters.value[i].id);
|
|
2815
|
-
}
|
|
2816
|
-
return [];
|
|
2817
|
-
}
|
|
2818
|
-
if ('action' in filters && filters.action === 'merge' && filters.value.length) {
|
|
2819
|
-
let filtersList = [];
|
|
2820
|
-
for (let i = 0; i < filters.value.length; i++) {
|
|
2821
|
-
try {
|
|
2822
|
-
const hasFilter = yield this.categoryFilterRepository
|
|
2823
|
-
.find({
|
|
2824
|
-
filters: {
|
|
2825
|
-
categoryId,
|
|
2826
|
-
filterId: filters.value[i].id,
|
|
2827
|
-
},
|
|
2828
|
-
})
|
|
2829
|
-
.then((data) => data.data.shift());
|
|
2830
|
-
if (hasFilter) {
|
|
2831
|
-
filtersList.push(hasFilter);
|
|
2832
|
-
}
|
|
2833
|
-
else {
|
|
2834
|
-
const newCategoryFilter = yield this.categoryFilterRepository.create({
|
|
2835
|
-
filterId: filters.value[i].id,
|
|
2836
|
-
categoryId,
|
|
2837
|
-
});
|
|
2838
|
-
filtersList.push(newCategoryFilter);
|
|
2839
|
-
}
|
|
2840
|
-
}
|
|
2841
|
-
catch (error) {
|
|
2842
|
-
console.log('catch error: ', error);
|
|
2843
|
-
}
|
|
2844
|
-
}
|
|
2845
|
-
return filtersList;
|
|
2846
|
-
}
|
|
2847
|
-
if (Array.isArray(filters) && filters.length) {
|
|
2848
|
-
let filtersList = [];
|
|
2849
|
-
for (let i = 0; i < filters.length; i++) {
|
|
2850
|
-
try {
|
|
2851
|
-
const hasFilter = yield this.categoryFilterRepository
|
|
2852
|
-
.find({
|
|
2853
|
-
filters: {
|
|
2854
|
-
categoryId,
|
|
2855
|
-
filterId: filters[i].id,
|
|
2856
|
-
},
|
|
2857
|
-
})
|
|
2858
|
-
.then((data) => data.data.shift());
|
|
2859
|
-
if (hasFilter) {
|
|
2860
|
-
filtersList.push(hasFilter);
|
|
2861
|
-
}
|
|
2862
|
-
else {
|
|
2863
|
-
const newCategoryFilter = yield this.categoryFilterRepository.create({
|
|
2864
|
-
filterId: filters[i].id,
|
|
2865
|
-
categoryId,
|
|
2866
|
-
});
|
|
2867
|
-
filtersList.push(newCategoryFilter);
|
|
2868
|
-
}
|
|
2869
|
-
}
|
|
2870
|
-
catch (error) {
|
|
2871
|
-
console.log('catch error: ', error);
|
|
2872
|
-
}
|
|
2873
|
-
}
|
|
2874
|
-
return filtersList;
|
|
2875
|
-
}
|
|
2876
|
-
});
|
|
2877
|
-
}
|
|
2878
2764
|
}
|
|
2879
2765
|
|
|
2880
2766
|
class FilterHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
2881
|
-
constructor(endpoint, authOptions, filterOptionRepository
|
|
2767
|
+
constructor(endpoint, authOptions, filterOptionRepository) {
|
|
2882
2768
|
super({
|
|
2883
2769
|
tableName: 'filter',
|
|
2884
2770
|
model: Filter,
|
|
@@ -2887,7 +2773,6 @@ class FilterHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGrap
|
|
|
2887
2773
|
fields: [
|
|
2888
2774
|
'id',
|
|
2889
2775
|
'description',
|
|
2890
|
-
'slug',
|
|
2891
2776
|
'enabled',
|
|
2892
2777
|
{ createdAt: { columnName: 'created_at' } },
|
|
2893
2778
|
{ updatedAt: { columnName: 'updated_at' } },
|
|
@@ -2895,19 +2780,41 @@ class FilterHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGrap
|
|
|
2895
2780
|
options: {
|
|
2896
2781
|
columnName: 'options',
|
|
2897
2782
|
foreignKeyColumn: { filterId: 'id' },
|
|
2898
|
-
fields: [
|
|
2899
|
-
'id',
|
|
2900
|
-
{ filterId: { columnName: 'filter_id' } },
|
|
2901
|
-
'description',
|
|
2902
|
-
{ createdAt: { columnName: 'created_at' } },
|
|
2903
|
-
{ updatedAt: { columnName: 'updated_at' } },
|
|
2904
|
-
],
|
|
2783
|
+
fields: ['id', { filterId: { columnName: 'filter_id' } }, 'description', 'createdAt', 'updatedAt'],
|
|
2905
2784
|
},
|
|
2906
2785
|
},
|
|
2907
2786
|
],
|
|
2908
2787
|
});
|
|
2909
2788
|
this.filterOptionRepository = filterOptionRepository;
|
|
2910
|
-
|
|
2789
|
+
}
|
|
2790
|
+
get(identifiers) {
|
|
2791
|
+
const _super = Object.create(null, {
|
|
2792
|
+
get: { get: () => super.get }
|
|
2793
|
+
});
|
|
2794
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2795
|
+
const filter = yield _super.get.call(this, identifiers);
|
|
2796
|
+
if (!filter)
|
|
2797
|
+
throw new NotFoundError('Filter not found');
|
|
2798
|
+
return filter;
|
|
2799
|
+
});
|
|
2800
|
+
}
|
|
2801
|
+
find(options) {
|
|
2802
|
+
const _super = Object.create(null, {
|
|
2803
|
+
find: { get: () => super.find }
|
|
2804
|
+
});
|
|
2805
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2806
|
+
const filter = yield _super.find.call(this, options);
|
|
2807
|
+
return filter;
|
|
2808
|
+
});
|
|
2809
|
+
}
|
|
2810
|
+
create(params) {
|
|
2811
|
+
const _super = Object.create(null, {
|
|
2812
|
+
create: { get: () => super.create }
|
|
2813
|
+
});
|
|
2814
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2815
|
+
const filter = yield _super.create.call(this, params);
|
|
2816
|
+
return filter;
|
|
2817
|
+
});
|
|
2911
2818
|
}
|
|
2912
2819
|
update(params) {
|
|
2913
2820
|
const _super = Object.create(null, {
|
|
@@ -2924,73 +2831,25 @@ class FilterHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGrap
|
|
|
2924
2831
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2925
2832
|
if (!options)
|
|
2926
2833
|
return [];
|
|
2927
|
-
if ('action' in options && options.action === 'remove'
|
|
2834
|
+
if ('action' in options && options.action === 'remove') {
|
|
2928
2835
|
for (let i = 0; i < options.value.length; i++) {
|
|
2929
2836
|
yield this.filterOptionRepository.delete({ id: options.value[i].id });
|
|
2930
2837
|
}
|
|
2931
2838
|
return [];
|
|
2932
2839
|
}
|
|
2933
|
-
if ('action' in options && options.action === '
|
|
2840
|
+
if ('action' in options && options.action === 'update') {
|
|
2934
2841
|
let filterOptions = [];
|
|
2935
2842
|
for (let i = 0; i < options.value.length; i++) {
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
filterOptions.push(hasFilter);
|
|
2940
|
-
}
|
|
2941
|
-
catch (error) {
|
|
2942
|
-
const newOption = yield this.filterOptionRepository.create(Object.assign(Object.assign({}, options.value[i]), { filterId }));
|
|
2843
|
+
const hasFilter = yield this.filterOptionRepository.get({ id: options.value[i].id });
|
|
2844
|
+
if (!hasFilter) {
|
|
2845
|
+
const newOption = yield this.filterOptionRepository.create(options.value[i]);
|
|
2943
2846
|
filterOptions.push(newOption);
|
|
2944
2847
|
}
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
}
|
|
2948
|
-
if (Array.isArray(options) && options.length) {
|
|
2949
|
-
let filterOptions = [];
|
|
2950
|
-
for (let i = 0; i < options.length; i++) {
|
|
2951
|
-
try {
|
|
2952
|
-
const hasFilter = yield this.filterOptionRepository.get({ id: options[i].id });
|
|
2953
|
-
if (hasFilter)
|
|
2954
|
-
filterOptions.push(hasFilter);
|
|
2955
|
-
}
|
|
2956
|
-
catch (error) {
|
|
2957
|
-
const newOption = yield this.filterOptionRepository.create(Object.assign(Object.assign({}, options[i]), { filterId }));
|
|
2958
|
-
filterOptions.push(newOption);
|
|
2848
|
+
else {
|
|
2849
|
+
filterOptions.push(hasFilter);
|
|
2959
2850
|
}
|
|
2960
2851
|
}
|
|
2961
|
-
|
|
2962
|
-
return [];
|
|
2963
|
-
});
|
|
2964
|
-
}
|
|
2965
|
-
delete(params) {
|
|
2966
|
-
const _super = Object.create(null, {
|
|
2967
|
-
delete: { get: () => super.delete }
|
|
2968
|
-
});
|
|
2969
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
2970
|
-
const { options } = params, data = __rest(params, ["options"]);
|
|
2971
|
-
const categoryFilters = yield this.categoryFilterRepository
|
|
2972
|
-
.find({
|
|
2973
|
-
filters: {
|
|
2974
|
-
filterId: +data.id,
|
|
2975
|
-
},
|
|
2976
|
-
})
|
|
2977
|
-
.then((result) => result.data);
|
|
2978
|
-
if (categoryFilters.length)
|
|
2979
|
-
throw new Error('Erro: o filtro está associado a uma ou mais categoria(s)');
|
|
2980
|
-
yield this.deleteOptions(options);
|
|
2981
|
-
yield _super.delete.call(this, { id: +data.id });
|
|
2982
|
-
return;
|
|
2983
|
-
});
|
|
2984
|
-
}
|
|
2985
|
-
deleteOptions(options) {
|
|
2986
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
2987
|
-
for (let i = 0; i < options.length; i++) {
|
|
2988
|
-
try {
|
|
2989
|
-
yield this.filterOptionRepository.delete({ id: options[i].id });
|
|
2990
|
-
}
|
|
2991
|
-
catch (error) {
|
|
2992
|
-
console.log(error);
|
|
2993
|
-
}
|
|
2852
|
+
return filterOptions;
|
|
2994
2853
|
}
|
|
2995
2854
|
});
|
|
2996
2855
|
}
|
|
@@ -2999,7 +2858,7 @@ class FilterHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGrap
|
|
|
2999
2858
|
class FilterOptionHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
3000
2859
|
constructor(endpoint, authOptions) {
|
|
3001
2860
|
super({
|
|
3002
|
-
tableName: '
|
|
2861
|
+
tableName: 'filter-option',
|
|
3003
2862
|
model: FilterOption,
|
|
3004
2863
|
endpoint,
|
|
3005
2864
|
authOptions,
|
|
@@ -3012,6 +2871,31 @@ class FilterOptionHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasu
|
|
|
3012
2871
|
],
|
|
3013
2872
|
});
|
|
3014
2873
|
}
|
|
2874
|
+
create(params) {
|
|
2875
|
+
return super.create(params);
|
|
2876
|
+
}
|
|
2877
|
+
find(options) {
|
|
2878
|
+
const _super = Object.create(null, {
|
|
2879
|
+
find: { get: () => super.find }
|
|
2880
|
+
});
|
|
2881
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2882
|
+
const filterOptions = yield _super.find.call(this, options);
|
|
2883
|
+
return filterOptions;
|
|
2884
|
+
});
|
|
2885
|
+
}
|
|
2886
|
+
delete(identifiers) {
|
|
2887
|
+
return super.delete(identifiers);
|
|
2888
|
+
}
|
|
2889
|
+
findByFilter(filterId) {
|
|
2890
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2891
|
+
const options = yield this.find({
|
|
2892
|
+
filters: {
|
|
2893
|
+
filterId,
|
|
2894
|
+
},
|
|
2895
|
+
});
|
|
2896
|
+
return options;
|
|
2897
|
+
});
|
|
2898
|
+
}
|
|
3015
2899
|
}
|
|
3016
2900
|
|
|
3017
2901
|
class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
@@ -3117,7 +3001,6 @@ class ProductHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
3117
3001
|
'weight',
|
|
3118
3002
|
'gender',
|
|
3119
3003
|
{ tags: { columnName: 'tags', type: HasuraGraphQLColumnType.Jsonb } },
|
|
3120
|
-
{ filters: { columnName: 'filters', type: HasuraGraphQLColumnType.Jsonb } },
|
|
3121
3004
|
{ isKit: { columnName: 'is_kit' } },
|
|
3122
3005
|
{ createdAt: { columnName: 'created_at' } },
|
|
3123
3006
|
{ updatedAt: { columnName: 'updated_at' } },
|
|
@@ -3583,5 +3466,5 @@ class VariantHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGra
|
|
|
3583
3466
|
* Generated bundle index. Do not edit.
|
|
3584
3467
|
*/
|
|
3585
3468
|
|
|
3586
|
-
export { AccessoryImportances, Address, Area, Authentication, AuthenticationFirebaseAuthService, AxiosAdapter, Base, BaseModel, BeardProblems, BeardSizes, BeautyProductImportances, BeautyProfile, BeautyQuestionsHelper, BillingStatus, BodyProblems, BodyShapes, BodyTattoos, Buy2Win, Buy2WinFirestoreRepository, Category,
|
|
3469
|
+
export { AccessoryImportances, Address, Area, Authentication, AuthenticationFirebaseAuthService, AxiosAdapter, Base, BaseModel, BeardProblems, BeardSizes, BeautyProductImportances, BeautyProfile, BeautyQuestionsHelper, BillingStatus, BodyProblems, BodyShapes, BodyTattoos, Buy2Win, Buy2WinFirestoreRepository, Category, CategoryFirestoreRepository, CategoryHasuraGraphQL, CategoryHasuraGraphQLRepository, Checkout, CheckoutFirestoreRepository, CheckoutSubscription, CheckoutSubscriptionFirestoreRepository, CheckoutTypes, Coupon, CouponFirestoreRepository, CouponSubtypes, CouponTypes, DuplicatedResultsError, Edition, EditionStatus, Exclusivities, FaceSkinOilinesses, FaceSkinProblems, FaceSkinTones, FamilyIncomes, Filter, FilterHasuraGraphQLRepository, FilterOption, FilterOptionHasuraGraphQLRepository, FilterType, FragranceImportances, GenderDestination, HairColors, HairProblems, HairStrands, HairTypes, Home, HomeFirestoreRepository, InvalidArgumentError, KitProduct, KitProductHasuraGraphQL, Lead, LeadFirestoreRepository, LegacyOrderFirestoreRepository, LineItem, NotFoundError, OfficePosition, Order, OrderFirestoreRepository, OrderStatus, Payment, PaymentFirestoreRepository, PaymentType, Product, ProductFirestoreRepository, ProductHasuraGraphQL, ProductHasuraGraphQLRepository, ProductSpents, ProductVariantFirestoreRepository, ProductsIndex, QuestionsFilters, RecoveryPassword, Register, RegisterFirebaseAuthService, RequiredArgumentError, ShippingMethod, ShopMenu, ShopMenuFirestoreRepository, Shops, SignInMethods, SignOut, Status, Subscription, SubscriptionEditionFirestoreRepository, SubscriptionFirestoreRepository, SubscriptionPayment, SubscriptionPaymentFirestoreRepository, SubscriptionPlan, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, UnauthorizedError, UpdateOptionActions, User, UserAddress, UserAddressFirestoreRepository, UserAlreadyRegisteredError, UserBeautyProfileFirestoreRepository, UserFirestoreRepository, UserPaymentMethod, UserPaymentMethodFirestoreRepository, UserType, Variant, VariantHasuraGraphQL, VariantHasuraGraphQLRepository, WeakPasswordError, Where, isUUID, parseDateTime, withCreateFirestore, withCreateHasuraGraphQL, withCrudFirestore, withCrudHasuraGraphQL, withDeleteFirestore, withDeleteHasuraGraphQL, withFindFirestore, withFindHasuraGraphQL, withFirestore, withGetFirestore, withGetHasuraGraphQL, withHasuraGraphQL, withHelpers, withSubCollection, withUpdateFirestore, withUpdateHasuraGraphQL };
|
|
3587
3470
|
//# sourceMappingURL=infrab4a-connect.js.map
|