@infrab4a/connect 3.14.4 → 3.15.0-beta.1
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 +202 -650
- package/bundles/infrab4a-connect.umd.js.map +1 -1
- package/domain/catalog/models/category-filter.d.ts +0 -2
- package/domain/catalog/models/category.d.ts +27 -5
- package/domain/catalog/models/index.d.ts +0 -1
- package/domain/catalog/models/kit-product.d.ts +3 -3
- package/domain/catalog/models/product.d.ts +40 -5
- package/domain/catalog/repositories/category-filter.repository.d.ts +0 -1
- package/domain/catalog/repositories/index.d.ts +0 -1
- package/domain/shop-settings/enums/index.d.ts +1 -0
- package/domain/shop-settings/enums/shop-page-name.enum.d.ts +19 -0
- package/domain/shop-settings/models/campaign-banner.d.ts +11 -0
- package/domain/shop-settings/models/campaign.d.ts +10 -0
- package/domain/shop-settings/models/index.d.ts +2 -0
- package/domain/shop-settings/models/shop-settings.d.ts +2 -1
- package/domain/shop-settings/models/types/campaign-page.d.ts +17 -0
- package/domain/shop-settings/models/types/index.d.ts +4 -0
- package/domain/shop-settings/models/types/sections.type.d.ts +17 -0
- package/domain/shop-settings/models/types/shop-gift.type.d.ts +8 -0
- package/domain/shop-settings/models/types/shop-post.type.d.ts +7 -0
- package/domain/shop-settings/models/types/shop-section.type.d.ts +3 -0
- package/domain/shop-settings/repositories/campaign-banner.repository.d.ts +4 -0
- package/domain/shop-settings/repositories/campaign.repository.d.ts +4 -0
- package/domain/shop-settings/repositories/index.d.ts +2 -0
- package/esm2015/domain/catalog/models/category-filter.js +1 -6
- package/esm2015/domain/catalog/models/category.js +10 -6
- package/esm2015/domain/catalog/models/index.js +1 -2
- package/esm2015/domain/catalog/models/kit-product.js +6 -6
- package/esm2015/domain/catalog/models/product.js +24 -6
- package/esm2015/domain/catalog/repositories/category-filter.repository.js +1 -1
- package/esm2015/domain/catalog/repositories/index.js +1 -2
- package/esm2015/domain/shop-settings/enums/index.js +2 -1
- package/esm2015/domain/shop-settings/enums/shop-page-name.enum.js +21 -0
- package/esm2015/domain/shop-settings/models/campaign-banner.js +7 -0
- package/esm2015/domain/shop-settings/models/campaign.js +7 -0
- package/esm2015/domain/shop-settings/models/index.js +3 -1
- package/esm2015/domain/shop-settings/models/shop-settings.js +1 -1
- package/esm2015/domain/shop-settings/models/types/campaign-page.js +2 -0
- package/esm2015/domain/shop-settings/models/types/index.js +5 -1
- package/esm2015/domain/shop-settings/models/types/sections.type.js +2 -0
- package/esm2015/domain/shop-settings/models/types/shop-gift.type.js +2 -0
- package/esm2015/domain/shop-settings/models/types/shop-post.type.js +2 -0
- package/esm2015/domain/shop-settings/models/types/shop-section.type.js +1 -1
- package/esm2015/domain/shop-settings/repositories/campaign-banner.repository.js +2 -0
- package/esm2015/domain/shop-settings/repositories/campaign.repository.js +2 -0
- package/esm2015/domain/shop-settings/repositories/index.js +3 -1
- package/esm2015/infra/firebase/firestore/repositories/shop-settings/campaign-banner-firestore.repository.js +12 -0
- package/esm2015/infra/firebase/firestore/repositories/shop-settings/campaign-firestore.repository.js +12 -0
- package/esm2015/infra/firebase/firestore/repositories/shop-settings/index.js +3 -1
- package/esm2015/infra/hasura-graphql/mixins/helpers/bind-filter-query.helper.js +2 -2
- package/esm2015/infra/hasura-graphql/repositories/catalog/category-filter-hasura-graphql.repository.js +1 -52
- package/esm2015/infra/hasura-graphql/repositories/catalog/category-hasura-graphql.repository.js +50 -36
- package/esm2015/infra/hasura-graphql/repositories/catalog/index.js +1 -2
- package/fesm2015/infrab4a-connect.js +140 -424
- package/fesm2015/infrab4a-connect.js.map +1 -1
- package/infra/firebase/firestore/repositories/shop-settings/campaign-banner-firestore.repository.d.ts +8 -0
- package/infra/firebase/firestore/repositories/shop-settings/campaign-firestore.repository.d.ts +8 -0
- package/infra/firebase/firestore/repositories/shop-settings/index.d.ts +2 -0
- package/infra/hasura-graphql/repositories/catalog/category-filter-hasura-graphql.repository.d.ts +0 -1
- package/infra/hasura-graphql/repositories/catalog/index.d.ts +0 -1
- package/package.json +1 -1
- package/domain/catalog/models/category-base.d.ts +0 -30
- package/domain/catalog/models/category-for-product.d.ts +0 -5
- package/domain/catalog/models/product-base.d.ts +0 -40
- package/domain/catalog/models/product-for-category.d.ts +0 -7
- package/domain/catalog/models/product-for-kit.d.ts +0 -7
- package/domain/catalog/models/wishlist.d.ts +0 -6
- package/domain/catalog/repositories/wishlist.repository.d.ts +0 -6
- package/esm2015/domain/catalog/models/category-base.js +0 -18
- package/esm2015/domain/catalog/models/category-for-product.js +0 -7
- package/esm2015/domain/catalog/models/product-base.js +0 -25
- package/esm2015/domain/catalog/models/product-for-category.js +0 -14
- package/esm2015/domain/catalog/models/product-for-kit.js +0 -14
- package/esm2015/domain/catalog/models/wishlist.js +0 -7
- package/esm2015/domain/catalog/repositories/wishlist.repository.js +0 -2
- package/esm2015/infra/hasura-graphql/repositories/catalog/wishlist-hasura-graphql.repository.js +0 -252
- package/infra/hasura-graphql/repositories/catalog/wishlist-hasura-graphql.repository.d.ts +0 -27
|
@@ -1823,142 +1823,6 @@
|
|
|
1823
1823
|
return Filter;
|
|
1824
1824
|
}(BaseModel));
|
|
1825
1825
|
|
|
1826
|
-
var CategoryBase = /** @class */ (function (_super) {
|
|
1827
|
-
__extends(CategoryBase, _super);
|
|
1828
|
-
function CategoryBase() {
|
|
1829
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1830
|
-
}
|
|
1831
|
-
Object.defineProperty(CategoryBase, "identifiersFields", {
|
|
1832
|
-
get: function () {
|
|
1833
|
-
return ['id'];
|
|
1834
|
-
},
|
|
1835
|
-
enumerable: false,
|
|
1836
|
-
configurable: true
|
|
1837
|
-
});
|
|
1838
|
-
return CategoryBase;
|
|
1839
|
-
}(BaseModel));
|
|
1840
|
-
__decorate([
|
|
1841
|
-
classTransformer.Type(function () { return CategoryBase; }),
|
|
1842
|
-
__metadata("design:type", CategoryBase)
|
|
1843
|
-
], CategoryBase.prototype, "parent", void 0);
|
|
1844
|
-
__decorate([
|
|
1845
|
-
classTransformer.Type(function () { return Filter; }),
|
|
1846
|
-
__metadata("design:type", Array)
|
|
1847
|
-
], CategoryBase.prototype, "filters", void 0);
|
|
1848
|
-
|
|
1849
|
-
var CategoryForProduct = /** @class */ (function (_super) {
|
|
1850
|
-
__extends(CategoryForProduct, _super);
|
|
1851
|
-
function CategoryForProduct() {
|
|
1852
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1853
|
-
}
|
|
1854
|
-
Object.defineProperty(CategoryForProduct, "identifiersFields", {
|
|
1855
|
-
get: function () {
|
|
1856
|
-
return ['id'];
|
|
1857
|
-
},
|
|
1858
|
-
enumerable: false,
|
|
1859
|
-
configurable: true
|
|
1860
|
-
});
|
|
1861
|
-
return CategoryForProduct;
|
|
1862
|
-
}(CategoryBase));
|
|
1863
|
-
|
|
1864
|
-
var ProductBase = /** @class */ (function (_super) {
|
|
1865
|
-
__extends(ProductBase, _super);
|
|
1866
|
-
function ProductBase() {
|
|
1867
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1868
|
-
}
|
|
1869
|
-
Object.defineProperty(ProductBase.prototype, "evaluation", {
|
|
1870
|
-
get: function () {
|
|
1871
|
-
return {
|
|
1872
|
-
reviews: this.reviews,
|
|
1873
|
-
count: this.reviewsTotal,
|
|
1874
|
-
rating: this.rate,
|
|
1875
|
-
};
|
|
1876
|
-
},
|
|
1877
|
-
set: function (evaluation) {
|
|
1878
|
-
if (!evaluation) {
|
|
1879
|
-
this.reviews = null;
|
|
1880
|
-
this.reviewsTotal = null;
|
|
1881
|
-
this.rate = null;
|
|
1882
|
-
return;
|
|
1883
|
-
}
|
|
1884
|
-
this.reviews = evaluation.reviews || this.reviews;
|
|
1885
|
-
this.reviewsTotal = evaluation.count || this.reviewsTotal;
|
|
1886
|
-
this.rate = evaluation.rating || this.rate;
|
|
1887
|
-
},
|
|
1888
|
-
enumerable: false,
|
|
1889
|
-
configurable: true
|
|
1890
|
-
});
|
|
1891
|
-
Object.defineProperty(ProductBase, "identifiersFields", {
|
|
1892
|
-
get: function () {
|
|
1893
|
-
return ['id'];
|
|
1894
|
-
},
|
|
1895
|
-
enumerable: false,
|
|
1896
|
-
configurable: true
|
|
1897
|
-
});
|
|
1898
|
-
return ProductBase;
|
|
1899
|
-
}(BaseModel));
|
|
1900
|
-
|
|
1901
|
-
var ProductForKit = /** @class */ (function (_super) {
|
|
1902
|
-
__extends(ProductForKit, _super);
|
|
1903
|
-
function ProductForKit() {
|
|
1904
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1905
|
-
}
|
|
1906
|
-
Object.defineProperty(ProductForKit, "identifiersFields", {
|
|
1907
|
-
get: function () {
|
|
1908
|
-
return ['id'];
|
|
1909
|
-
},
|
|
1910
|
-
enumerable: false,
|
|
1911
|
-
configurable: true
|
|
1912
|
-
});
|
|
1913
|
-
return ProductForKit;
|
|
1914
|
-
}(ProductBase));
|
|
1915
|
-
__decorate([
|
|
1916
|
-
classTransformer.Type(function () { return CategoryForProduct; }),
|
|
1917
|
-
__metadata("design:type", CategoryForProduct)
|
|
1918
|
-
], ProductForKit.prototype, "category", void 0);
|
|
1919
|
-
|
|
1920
|
-
var KitProduct = /** @class */ (function (_super) {
|
|
1921
|
-
__extends(KitProduct, _super);
|
|
1922
|
-
function KitProduct() {
|
|
1923
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1924
|
-
}
|
|
1925
|
-
Object.defineProperty(KitProduct, "identifiersFields", {
|
|
1926
|
-
get: function () {
|
|
1927
|
-
return ['productId', 'kitProductId'];
|
|
1928
|
-
},
|
|
1929
|
-
enumerable: false,
|
|
1930
|
-
configurable: true
|
|
1931
|
-
});
|
|
1932
|
-
return KitProduct;
|
|
1933
|
-
}(BaseModel));
|
|
1934
|
-
__decorate([
|
|
1935
|
-
classTransformer.Type(function () { return ProductForKit; }),
|
|
1936
|
-
__metadata("design:type", ProductForKit)
|
|
1937
|
-
], KitProduct.prototype, "kit", void 0);
|
|
1938
|
-
__decorate([
|
|
1939
|
-
classTransformer.Type(function () { return ProductForKit; }),
|
|
1940
|
-
__metadata("design:type", ProductForKit)
|
|
1941
|
-
], KitProduct.prototype, "product", void 0);
|
|
1942
|
-
|
|
1943
|
-
var ProductForCategory = /** @class */ (function (_super) {
|
|
1944
|
-
__extends(ProductForCategory, _super);
|
|
1945
|
-
function ProductForCategory() {
|
|
1946
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1947
|
-
}
|
|
1948
|
-
Object.defineProperty(ProductForCategory, "identifiersFields", {
|
|
1949
|
-
get: function () {
|
|
1950
|
-
return ['id'];
|
|
1951
|
-
},
|
|
1952
|
-
enumerable: false,
|
|
1953
|
-
configurable: true
|
|
1954
|
-
});
|
|
1955
|
-
return ProductForCategory;
|
|
1956
|
-
}(ProductBase));
|
|
1957
|
-
__decorate([
|
|
1958
|
-
classTransformer.Type(function () { return KitProduct; }),
|
|
1959
|
-
__metadata("design:type", Array)
|
|
1960
|
-
], ProductForCategory.prototype, "kitProducts", void 0);
|
|
1961
|
-
|
|
1962
1826
|
var Category = /** @class */ (function (_super) {
|
|
1963
1827
|
__extends(Category, _super);
|
|
1964
1828
|
function Category() {
|
|
@@ -1972,11 +1836,15 @@
|
|
|
1972
1836
|
configurable: true
|
|
1973
1837
|
});
|
|
1974
1838
|
return Category;
|
|
1975
|
-
}(
|
|
1839
|
+
}(BaseModel));
|
|
1976
1840
|
__decorate([
|
|
1977
|
-
classTransformer.Type(function () { return
|
|
1841
|
+
classTransformer.Type(function () { return Category; }),
|
|
1842
|
+
__metadata("design:type", Category)
|
|
1843
|
+
], Category.prototype, "parent", void 0);
|
|
1844
|
+
__decorate([
|
|
1845
|
+
classTransformer.Type(function () { return Filter; }),
|
|
1978
1846
|
__metadata("design:type", Array)
|
|
1979
|
-
], Category.prototype, "
|
|
1847
|
+
], Category.prototype, "filters", void 0);
|
|
1980
1848
|
|
|
1981
1849
|
var CategoryCollectionChildren = /** @class */ (function (_super) {
|
|
1982
1850
|
__extends(CategoryCollectionChildren, _super);
|
|
@@ -2015,10 +1883,6 @@
|
|
|
2015
1883
|
classTransformer.Type(function () { return Filter; }),
|
|
2016
1884
|
__metadata("design:type", Filter)
|
|
2017
1885
|
], CategoryFilter.prototype, "filter", void 0);
|
|
2018
|
-
__decorate([
|
|
2019
|
-
classTransformer.Type(function () { return Category; }),
|
|
2020
|
-
__metadata("design:type", Category)
|
|
2021
|
-
], CategoryFilter.prototype, "category", void 0);
|
|
2022
1886
|
|
|
2023
1887
|
exports.GenderDestination = void 0;
|
|
2024
1888
|
(function (GenderDestination) {
|
|
@@ -2055,6 +1919,28 @@
|
|
|
2055
1919
|
function Product() {
|
|
2056
1920
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
2057
1921
|
}
|
|
1922
|
+
Object.defineProperty(Product.prototype, "evaluation", {
|
|
1923
|
+
get: function () {
|
|
1924
|
+
return {
|
|
1925
|
+
reviews: this.reviews,
|
|
1926
|
+
count: this.reviewsTotal,
|
|
1927
|
+
rating: this.rate,
|
|
1928
|
+
};
|
|
1929
|
+
},
|
|
1930
|
+
set: function (evaluation) {
|
|
1931
|
+
if (!evaluation) {
|
|
1932
|
+
this.reviews = null;
|
|
1933
|
+
this.reviewsTotal = null;
|
|
1934
|
+
this.rate = null;
|
|
1935
|
+
return;
|
|
1936
|
+
}
|
|
1937
|
+
this.reviews = evaluation.reviews || this.reviews;
|
|
1938
|
+
this.reviewsTotal = evaluation.count || this.reviewsTotal;
|
|
1939
|
+
this.rate = evaluation.rating || this.rate;
|
|
1940
|
+
},
|
|
1941
|
+
enumerable: false,
|
|
1942
|
+
configurable: true
|
|
1943
|
+
});
|
|
2058
1944
|
Object.defineProperty(Product, "identifiersFields", {
|
|
2059
1945
|
get: function () {
|
|
2060
1946
|
return ['id'];
|
|
@@ -2063,45 +1949,53 @@
|
|
|
2063
1949
|
configurable: true
|
|
2064
1950
|
});
|
|
2065
1951
|
return Product;
|
|
2066
|
-
}(
|
|
1952
|
+
}(BaseModel));
|
|
2067
1953
|
__decorate([
|
|
2068
|
-
classTransformer.Type(function () { return
|
|
2069
|
-
__metadata("design:type",
|
|
1954
|
+
classTransformer.Type(function () { return Category; }),
|
|
1955
|
+
__metadata("design:type", Category)
|
|
2070
1956
|
], Product.prototype, "category", void 0);
|
|
2071
1957
|
__decorate([
|
|
2072
1958
|
classTransformer.Type(function () { return KitProduct; }),
|
|
2073
1959
|
__metadata("design:type", Array)
|
|
2074
1960
|
], Product.prototype, "kitProducts", void 0);
|
|
2075
1961
|
|
|
2076
|
-
var
|
|
2077
|
-
__extends(
|
|
2078
|
-
function
|
|
1962
|
+
var KitProduct = /** @class */ (function (_super) {
|
|
1963
|
+
__extends(KitProduct, _super);
|
|
1964
|
+
function KitProduct() {
|
|
2079
1965
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
2080
1966
|
}
|
|
2081
|
-
Object.defineProperty(
|
|
1967
|
+
Object.defineProperty(KitProduct, "identifiersFields", {
|
|
2082
1968
|
get: function () {
|
|
2083
|
-
return ['
|
|
1969
|
+
return ['productId', 'kitProductId'];
|
|
2084
1970
|
},
|
|
2085
1971
|
enumerable: false,
|
|
2086
1972
|
configurable: true
|
|
2087
1973
|
});
|
|
2088
|
-
return
|
|
1974
|
+
return KitProduct;
|
|
2089
1975
|
}(BaseModel));
|
|
1976
|
+
__decorate([
|
|
1977
|
+
classTransformer.Type(function () { return Product; }),
|
|
1978
|
+
__metadata("design:type", Product)
|
|
1979
|
+
], KitProduct.prototype, "kit", void 0);
|
|
1980
|
+
__decorate([
|
|
1981
|
+
classTransformer.Type(function () { return Product; }),
|
|
1982
|
+
__metadata("design:type", Product)
|
|
1983
|
+
], KitProduct.prototype, "product", void 0);
|
|
2090
1984
|
|
|
2091
|
-
var
|
|
2092
|
-
__extends(
|
|
2093
|
-
function
|
|
1985
|
+
var Variant = /** @class */ (function (_super) {
|
|
1986
|
+
__extends(Variant, _super);
|
|
1987
|
+
function Variant() {
|
|
2094
1988
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
2095
1989
|
}
|
|
2096
|
-
Object.defineProperty(
|
|
1990
|
+
Object.defineProperty(Variant, "identifiersFields", {
|
|
2097
1991
|
get: function () {
|
|
2098
|
-
return ['id'];
|
|
1992
|
+
return ['id', 'productId'];
|
|
2099
1993
|
},
|
|
2100
1994
|
enumerable: false,
|
|
2101
1995
|
configurable: true
|
|
2102
1996
|
});
|
|
2103
|
-
return
|
|
2104
|
-
}(
|
|
1997
|
+
return Variant;
|
|
1998
|
+
}(BaseModel));
|
|
2105
1999
|
|
|
2106
2000
|
var Buy2Win = /** @class */ (function (_super) {
|
|
2107
2001
|
__extends(Buy2Win, _super);
|
|
@@ -2328,6 +2222,27 @@
|
|
|
2328
2222
|
QuestionsFilters["PRODUCT_SPENT"] = "Qual \u00E9 o seu nivel de gasto mensal em produtos de beleza e cuidados pessoais?";
|
|
2329
2223
|
})(exports.QuestionsFilters || (exports.QuestionsFilters = {}));
|
|
2330
2224
|
|
|
2225
|
+
exports.ShopPageName = void 0;
|
|
2226
|
+
(function (ShopPageName) {
|
|
2227
|
+
ShopPageName["LP_CLUB"] = "LP_CLUBE";
|
|
2228
|
+
ShopPageName["SUBSCRIBER_PANEL"] = "SUBSCRIBER_PANEL";
|
|
2229
|
+
ShopPageName["INVITE_FRIENDS"] = "INVITE_FRIENDS";
|
|
2230
|
+
ShopPageName["INVITE_AND_WIN"] = "INVITE_AND_WIN";
|
|
2231
|
+
ShopPageName["WIN_GLAMPOINTS"] = "WIN_GLAMPOINTS";
|
|
2232
|
+
ShopPageName["POSTS"] = "POSTS";
|
|
2233
|
+
ShopPageName["GLAMPOINTS_SHOWCASE"] = "GLAMPOINTS_SHOWCASE";
|
|
2234
|
+
ShopPageName["LP_EDITIONS"] = "LP_EDITIONS";
|
|
2235
|
+
ShopPageName["LP_GLAMBOX_EDITION"] = "LP_GLAMBOX_EDITION";
|
|
2236
|
+
ShopPageName["LP_GLAMBOX_PROMOTION"] = "LP_GLAMBOX_PROMOTION";
|
|
2237
|
+
ShopPageName["LP_GLAMBAG_PROMOTION"] = "LP_GLAMBAG_PROMOTION";
|
|
2238
|
+
ShopPageName["LP_GLAMPASS_PROMOTION"] = "LP_GLAMPASS_PROMOTION";
|
|
2239
|
+
ShopPageName["LP_SUBSCRIPTION_PROMOTION"] = "LP_SUBSCRIPTION_PROMOTION";
|
|
2240
|
+
ShopPageName["LP_GLAMPARTNER_PROMOTION"] = "LP_GLAMPARTNER_PROMOTION";
|
|
2241
|
+
ShopPageName["LP_GLAMQUEENS"] = "LP_GLAMQUEENS";
|
|
2242
|
+
ShopPageName["LP_INVITE"] = "LP_INVITE";
|
|
2243
|
+
ShopPageName["LP_LIVELO"] = "LP_LIVELO";
|
|
2244
|
+
})(exports.ShopPageName || (exports.ShopPageName = {}));
|
|
2245
|
+
|
|
2331
2246
|
var BeautyQuestionsHelper = /** @class */ (function () {
|
|
2332
2247
|
function BeautyQuestionsHelper() {
|
|
2333
2248
|
}
|
|
@@ -2375,6 +2290,36 @@
|
|
|
2375
2290
|
return BeautyQuestionsHelper;
|
|
2376
2291
|
}());
|
|
2377
2292
|
|
|
2293
|
+
var Campaign = /** @class */ (function (_super) {
|
|
2294
|
+
__extends(Campaign, _super);
|
|
2295
|
+
function Campaign() {
|
|
2296
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
2297
|
+
}
|
|
2298
|
+
Object.defineProperty(Campaign, "identifiersFields", {
|
|
2299
|
+
get: function () {
|
|
2300
|
+
return ['id'];
|
|
2301
|
+
},
|
|
2302
|
+
enumerable: false,
|
|
2303
|
+
configurable: true
|
|
2304
|
+
});
|
|
2305
|
+
return Campaign;
|
|
2306
|
+
}(BaseModel));
|
|
2307
|
+
|
|
2308
|
+
var CampaignBanner = /** @class */ (function (_super) {
|
|
2309
|
+
__extends(CampaignBanner, _super);
|
|
2310
|
+
function CampaignBanner() {
|
|
2311
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
2312
|
+
}
|
|
2313
|
+
Object.defineProperty(CampaignBanner, "identifiersFields", {
|
|
2314
|
+
get: function () {
|
|
2315
|
+
return ['id'];
|
|
2316
|
+
},
|
|
2317
|
+
enumerable: false,
|
|
2318
|
+
configurable: true
|
|
2319
|
+
});
|
|
2320
|
+
return CampaignBanner;
|
|
2321
|
+
}(BaseModel));
|
|
2322
|
+
|
|
2378
2323
|
var Home = /** @class */ (function (_super) {
|
|
2379
2324
|
__extends(Home, _super);
|
|
2380
2325
|
function Home() {
|
|
@@ -3738,6 +3683,30 @@
|
|
|
3738
3683
|
return SubscriptionPlanFirestoreRepository;
|
|
3739
3684
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
3740
3685
|
|
|
3686
|
+
var CampaignBannerFirestoreRepository = /** @class */ (function (_super) {
|
|
3687
|
+
__extends(CampaignBannerFirestoreRepository, _super);
|
|
3688
|
+
function CampaignBannerFirestoreRepository(firestore) {
|
|
3689
|
+
var _this = _super.call(this) || this;
|
|
3690
|
+
_this.firestore = firestore;
|
|
3691
|
+
_this.collectionName = 'banners';
|
|
3692
|
+
_this.model = CampaignBanner;
|
|
3693
|
+
return _this;
|
|
3694
|
+
}
|
|
3695
|
+
return CampaignBannerFirestoreRepository;
|
|
3696
|
+
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
3697
|
+
|
|
3698
|
+
var CampaignFirestoreRepository = /** @class */ (function (_super) {
|
|
3699
|
+
__extends(CampaignFirestoreRepository, _super);
|
|
3700
|
+
function CampaignFirestoreRepository(firestore) {
|
|
3701
|
+
var _this = _super.call(this) || this;
|
|
3702
|
+
_this.firestore = firestore;
|
|
3703
|
+
_this.collectionName = 'campaigns';
|
|
3704
|
+
_this.model = Campaign;
|
|
3705
|
+
return _this;
|
|
3706
|
+
}
|
|
3707
|
+
return CampaignFirestoreRepository;
|
|
3708
|
+
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
3709
|
+
|
|
3741
3710
|
var HomeFirestoreRepository = /** @class */ (function (_super) {
|
|
3742
3711
|
__extends(HomeFirestoreRepository, _super);
|
|
3743
3712
|
function HomeFirestoreRepository(firestore) {
|
|
@@ -4044,7 +4013,7 @@
|
|
|
4044
4013
|
var fieldOptions = AttributeOptionHelper.FindByAttribute(key, (fieldSentenceOptions === null || fieldSentenceOptions === void 0 ? void 0 : fieldSentenceOptions.fields) || fields);
|
|
4045
4014
|
var columnName = fieldOptions.columnName;
|
|
4046
4015
|
var columnFields = fieldOptions.fields;
|
|
4047
|
-
return Object.assign(Object.assign({}, variables), (_a = {}, _a[columnName] = BindFilterQueryHelper.BuildWhereSentence(key, options[key],
|
|
4016
|
+
return Object.assign(Object.assign({}, variables), (_a = {}, _a[columnName] = BindFilterQueryHelper.BuildWhereSentence(key, options[key], columnFields || []), _a));
|
|
4048
4017
|
}, {});
|
|
4049
4018
|
if (!Array.isArray(options) && !lodash.isNil(fieldSentenceOptions.fields))
|
|
4050
4019
|
return _a = {},
|
|
@@ -4808,60 +4777,9 @@
|
|
|
4808
4777
|
],
|
|
4809
4778
|
},
|
|
4810
4779
|
},
|
|
4811
|
-
{
|
|
4812
|
-
category: {
|
|
4813
|
-
columnName: 'category',
|
|
4814
|
-
foreignKeyColumn: { id: 'categoryId' },
|
|
4815
|
-
fields: [
|
|
4816
|
-
'id',
|
|
4817
|
-
'description',
|
|
4818
|
-
{
|
|
4819
|
-
products: {
|
|
4820
|
-
columnName: 'products',
|
|
4821
|
-
fields: ['product_id'],
|
|
4822
|
-
from: function (value) { return value.map(function (product) { return product.product_id.toString(); }); },
|
|
4823
|
-
to: function (productIds) { return productIds.map(function (productId) { return ({
|
|
4824
|
-
product_id: +productId,
|
|
4825
|
-
}); }); },
|
|
4826
|
-
},
|
|
4827
|
-
},
|
|
4828
|
-
{
|
|
4829
|
-
childrenProducts: {
|
|
4830
|
-
columnName: 'children_products',
|
|
4831
|
-
foreignKeyColumn: { category_id: 'id' },
|
|
4832
|
-
fields: [
|
|
4833
|
-
'id',
|
|
4834
|
-
'name',
|
|
4835
|
-
'slug',
|
|
4836
|
-
{
|
|
4837
|
-
categories: {
|
|
4838
|
-
columnName: 'categories',
|
|
4839
|
-
fields: ['category_id'],
|
|
4840
|
-
bindPersistData: function (value) { return ({
|
|
4841
|
-
categories: { data: value.map(function (category) { return ({ category_id: +category }); }) },
|
|
4842
|
-
}); },
|
|
4843
|
-
to: function (categories) { return categories.map(function (categoryId) { return +categoryId; }); },
|
|
4844
|
-
from: function (categories) { return (categories === null || categories === void 0 ? void 0 : categories.map(function (category) { var _a; return (_a = category === null || category === void 0 ? void 0 : category.category_id) === null || _a === void 0 ? void 0 : _a.toString(); })) || []; },
|
|
4845
|
-
},
|
|
4846
|
-
},
|
|
4847
|
-
],
|
|
4848
|
-
},
|
|
4849
|
-
},
|
|
4850
|
-
],
|
|
4851
|
-
},
|
|
4852
|
-
},
|
|
4853
4780
|
],
|
|
4854
4781
|
}) || this;
|
|
4855
4782
|
}
|
|
4856
|
-
CategoryFilterHasuraGraphQLRepository.prototype.deleteByCategory = function (categoryId) {
|
|
4857
|
-
return this.mutation('delete_category_filter', ['affected_rows'], {
|
|
4858
|
-
where: {
|
|
4859
|
-
type: 'category_filter_bool_exp',
|
|
4860
|
-
required: true,
|
|
4861
|
-
value: { category_id: { _eq: categoryId } },
|
|
4862
|
-
},
|
|
4863
|
-
});
|
|
4864
|
-
};
|
|
4865
4783
|
CategoryFilterHasuraGraphQLRepository.prototype.deleteByCategoryAndFilter = function (categoryId, filterId) {
|
|
4866
4784
|
return this.mutation('delete_category_filter', ['affected_rows'], {
|
|
4867
4785
|
where: {
|
|
@@ -4946,7 +4864,6 @@
|
|
|
4946
4864
|
},
|
|
4947
4865
|
},
|
|
4948
4866
|
{ isCollection: { columnName: 'is_collection' } },
|
|
4949
|
-
{ isWishlist: { columnName: 'is_wishlist' } },
|
|
4950
4867
|
'reference',
|
|
4951
4868
|
{ parentId: { columnName: 'parent_id' } },
|
|
4952
4869
|
{
|
|
@@ -4970,7 +4887,7 @@
|
|
|
4970
4887
|
var metadata, data;
|
|
4971
4888
|
return __generator(this, function (_c) {
|
|
4972
4889
|
metadata = params.metadata, data = __rest(params, ["metadata"]);
|
|
4973
|
-
return [2 /*return*/, _super.create.call(this, Object.assign(Object.assign({}, data), {
|
|
4890
|
+
return [2 /*return*/, _super.create.call(this, Object.assign(Object.assign({}, data), { metadata: metadata || { description: null, title: null } }))];
|
|
4974
4891
|
});
|
|
4975
4892
|
});
|
|
4976
4893
|
};
|
|
@@ -5011,7 +4928,7 @@
|
|
|
5011
4928
|
return [4 /*yield*/, this.getId(plainData.id)];
|
|
5012
4929
|
case 1:
|
|
5013
4930
|
id = _j.sent();
|
|
5014
|
-
return [4 /*yield*/, _super.update.call(this, Object.assign(
|
|
4931
|
+
return [4 /*yield*/, _super.update.call(this, Object.assign({ id: id }, data))];
|
|
5015
4932
|
case 2:
|
|
5016
4933
|
category = _j.sent();
|
|
5017
4934
|
_c = category;
|
|
@@ -5059,7 +4976,6 @@
|
|
|
5059
4976
|
slug: slug,
|
|
5060
4977
|
shops: { operator: exports.Where.IN, value: [shop] },
|
|
5061
4978
|
published: { operator: exports.Where.EQUALS, value: true },
|
|
5062
|
-
isWishlist: { operator: exports.Where.EQUALS, value: false },
|
|
5063
4979
|
},
|
|
5064
4980
|
options: {
|
|
5065
4981
|
enableCount: false,
|
|
@@ -5088,7 +5004,6 @@
|
|
|
5088
5004
|
filters: {
|
|
5089
5005
|
shops: { operator: exports.Where.IN, value: [shop] },
|
|
5090
5006
|
published: { operator: exports.Where.EQUALS, value: true },
|
|
5091
|
-
isWishlist: { operator: exports.Where.EQUALS, value: false },
|
|
5092
5007
|
},
|
|
5093
5008
|
options: {
|
|
5094
5009
|
enableCount: false,
|
|
@@ -5306,136 +5221,104 @@
|
|
|
5306
5221
|
CategoryHasuraGraphQLRepository.prototype.updateFilters = function (categoryId, _c) {
|
|
5307
5222
|
var filters = _c.filters;
|
|
5308
5223
|
return __awaiter(this, void 0, void 0, function () {
|
|
5309
|
-
var i, filtersList,
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
switch (_e.label) {
|
|
5224
|
+
var i, filtersList, i, hasFilter, newCategoryFilter, error_1, filtersList, i, hasFilter, newCategoryFilter, error_2;
|
|
5225
|
+
return __generator(this, function (_c) {
|
|
5226
|
+
switch (_c.label) {
|
|
5313
5227
|
case 0:
|
|
5314
5228
|
if (!('action' in filters && filters.action === 'remove' && filters.value.length)) return [3 /*break*/, 5];
|
|
5315
5229
|
i = 0;
|
|
5316
|
-
|
|
5230
|
+
_c.label = 1;
|
|
5317
5231
|
case 1:
|
|
5318
5232
|
if (!(i < filters.value.length)) return [3 /*break*/, 4];
|
|
5319
5233
|
return [4 /*yield*/, this.categoryFilterRepository.deleteByCategoryAndFilter(categoryId, filters.value[i].id)];
|
|
5320
5234
|
case 2:
|
|
5321
|
-
|
|
5322
|
-
|
|
5235
|
+
_c.sent();
|
|
5236
|
+
_c.label = 3;
|
|
5323
5237
|
case 3:
|
|
5324
5238
|
i++;
|
|
5325
5239
|
return [3 /*break*/, 1];
|
|
5326
5240
|
case 4: return [2 /*return*/, []];
|
|
5327
5241
|
case 5:
|
|
5328
|
-
if (!('action' in filters && filters.action === 'merge' && filters.value.length)) return [3 /*break*/,
|
|
5242
|
+
if (!('action' in filters && filters.action === 'merge' && filters.value.length)) return [3 /*break*/, 15];
|
|
5329
5243
|
filtersList = [];
|
|
5244
|
+
i = 0;
|
|
5245
|
+
_c.label = 6;
|
|
5246
|
+
case 6:
|
|
5247
|
+
if (!(i < filters.value.length)) return [3 /*break*/, 14];
|
|
5248
|
+
_c.label = 7;
|
|
5249
|
+
case 7:
|
|
5250
|
+
_c.trys.push([7, 12, , 13]);
|
|
5330
5251
|
return [4 /*yield*/, this.categoryFilterRepository
|
|
5331
5252
|
.find({
|
|
5332
5253
|
filters: {
|
|
5333
5254
|
categoryId: categoryId,
|
|
5255
|
+
filterId: filters.value[i].id,
|
|
5334
5256
|
},
|
|
5335
5257
|
})
|
|
5336
|
-
.then(function (
|
|
5337
|
-
case 6:
|
|
5338
|
-
currentFilters = _e.sent();
|
|
5339
|
-
currentFiltersId_1 = currentFilters.map(function (f) { return f.id; });
|
|
5340
|
-
filtersUpdatedId_1 = filters.value.map(function (f) { return f.id; });
|
|
5341
|
-
filterToBeDeleted = currentFiltersId_1.filter(function (c) { return !filtersUpdatedId_1.includes(c); });
|
|
5342
|
-
filterToBeInserted = filtersUpdatedId_1.filter(function (c) { return !currentFiltersId_1.includes(c); });
|
|
5343
|
-
_loop_1 = function (filter) {
|
|
5344
|
-
var index;
|
|
5345
|
-
return __generator(this, function (_f) {
|
|
5346
|
-
switch (_f.label) {
|
|
5347
|
-
case 0:
|
|
5348
|
-
index = currentFilters.findIndex(function (f) { return f.id == filter; });
|
|
5349
|
-
if (index != -1) {
|
|
5350
|
-
currentFilters.splice(index, 1);
|
|
5351
|
-
}
|
|
5352
|
-
return [4 /*yield*/, this_1.categoryFilterRepository.deleteByCategoryAndFilter(categoryId, filter)];
|
|
5353
|
-
case 1:
|
|
5354
|
-
_f.sent();
|
|
5355
|
-
return [2 /*return*/];
|
|
5356
|
-
}
|
|
5357
|
-
});
|
|
5358
|
-
};
|
|
5359
|
-
this_1 = this;
|
|
5360
|
-
_e.label = 7;
|
|
5361
|
-
case 7:
|
|
5362
|
-
_e.trys.push([7, 12, 13, 14]);
|
|
5363
|
-
filterToBeDeleted_1 = __values(filterToBeDeleted), filterToBeDeleted_1_1 = filterToBeDeleted_1.next();
|
|
5364
|
-
_e.label = 8;
|
|
5258
|
+
.then(function (data) { return data.data.shift(); })];
|
|
5365
5259
|
case 8:
|
|
5366
|
-
|
|
5367
|
-
|
|
5368
|
-
|
|
5369
|
-
|
|
5370
|
-
|
|
5371
|
-
|
|
5260
|
+
hasFilter = _c.sent();
|
|
5261
|
+
if (!hasFilter) return [3 /*break*/, 9];
|
|
5262
|
+
filtersList.push(hasFilter);
|
|
5263
|
+
return [3 /*break*/, 11];
|
|
5264
|
+
case 9: return [4 /*yield*/, this.categoryFilterRepository.create({
|
|
5265
|
+
filterId: filters.value[i].id,
|
|
5266
|
+
categoryId: categoryId,
|
|
5267
|
+
})];
|
|
5372
5268
|
case 10:
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
|
|
5269
|
+
newCategoryFilter = _c.sent();
|
|
5270
|
+
filtersList.push(newCategoryFilter);
|
|
5271
|
+
_c.label = 11;
|
|
5272
|
+
case 11: return [3 /*break*/, 13];
|
|
5376
5273
|
case 12:
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
return [3 /*break*/,
|
|
5274
|
+
error_1 = _c.sent();
|
|
5275
|
+
console.log('catch error: ', error_1);
|
|
5276
|
+
return [3 /*break*/, 13];
|
|
5380
5277
|
case 13:
|
|
5381
|
-
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
finally { if (e_1) throw e_1.error; }
|
|
5385
|
-
return [7 /*endfinally*/];
|
|
5386
|
-
case 14:
|
|
5387
|
-
_e.trys.push([14, 19, 20, 21]);
|
|
5388
|
-
filterToBeInserted_1 = __values(filterToBeInserted), filterToBeInserted_1_1 = filterToBeInserted_1.next();
|
|
5389
|
-
_e.label = 15;
|
|
5278
|
+
i++;
|
|
5279
|
+
return [3 /*break*/, 6];
|
|
5280
|
+
case 14: return [2 /*return*/, filtersList];
|
|
5390
5281
|
case 15:
|
|
5391
|
-
if (
|
|
5392
|
-
|
|
5393
|
-
|
|
5394
|
-
|
|
5395
|
-
categoryId: categoryId,
|
|
5396
|
-
})];
|
|
5282
|
+
if (!(Array.isArray(filters) && filters.length)) return [3 /*break*/, 25];
|
|
5283
|
+
filtersList = [];
|
|
5284
|
+
i = 0;
|
|
5285
|
+
_c.label = 16;
|
|
5397
5286
|
case 16:
|
|
5398
|
-
|
|
5399
|
-
|
|
5400
|
-
_e.label = 17;
|
|
5287
|
+
if (!(i < filters.length)) return [3 /*break*/, 24];
|
|
5288
|
+
_c.label = 17;
|
|
5401
5289
|
case 17:
|
|
5402
|
-
|
|
5403
|
-
return [
|
|
5404
|
-
|
|
5405
|
-
|
|
5406
|
-
|
|
5407
|
-
|
|
5290
|
+
_c.trys.push([17, 22, , 23]);
|
|
5291
|
+
return [4 /*yield*/, this.categoryFilterRepository
|
|
5292
|
+
.find({
|
|
5293
|
+
filters: {
|
|
5294
|
+
categoryId: categoryId,
|
|
5295
|
+
filterId: filters[i].id,
|
|
5296
|
+
},
|
|
5297
|
+
})
|
|
5298
|
+
.then(function (data) { return data.data.shift(); })];
|
|
5299
|
+
case 18:
|
|
5300
|
+
hasFilter = _c.sent();
|
|
5301
|
+
if (!hasFilter) return [3 /*break*/, 19];
|
|
5302
|
+
filtersList.push(hasFilter);
|
|
5408
5303
|
return [3 /*break*/, 21];
|
|
5304
|
+
case 19: return [4 /*yield*/, this.categoryFilterRepository.create({
|
|
5305
|
+
filterId: filters[i].id,
|
|
5306
|
+
categoryId: categoryId,
|
|
5307
|
+
})];
|
|
5409
5308
|
case 20:
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
return [7 /*endfinally*/];
|
|
5415
|
-
case 21: return [2 /*return*/, __spreadArray(__spreadArray([], __read(currentFilters)), __read(filtersList))];
|
|
5309
|
+
newCategoryFilter = _c.sent();
|
|
5310
|
+
filtersList.push(newCategoryFilter);
|
|
5311
|
+
_c.label = 21;
|
|
5312
|
+
case 21: return [3 /*break*/, 23];
|
|
5416
5313
|
case 22:
|
|
5417
|
-
|
|
5418
|
-
|
|
5314
|
+
error_2 = _c.sent();
|
|
5315
|
+
console.log('catch error: ', error_2);
|
|
5316
|
+
return [3 /*break*/, 23];
|
|
5419
5317
|
case 23:
|
|
5420
|
-
_e.sent();
|
|
5421
|
-
filtersList = [];
|
|
5422
|
-
i = 0;
|
|
5423
|
-
_e.label = 24;
|
|
5424
|
-
case 24:
|
|
5425
|
-
if (!(i < filters.length)) return [3 /*break*/, 27];
|
|
5426
|
-
return [4 /*yield*/, this.categoryFilterRepository.create({
|
|
5427
|
-
filterId: filters[i].id,
|
|
5428
|
-
categoryId: categoryId,
|
|
5429
|
-
})];
|
|
5430
|
-
case 25:
|
|
5431
|
-
newCategoryFilter = _e.sent();
|
|
5432
|
-
filtersList.push(newCategoryFilter);
|
|
5433
|
-
_e.label = 26;
|
|
5434
|
-
case 26:
|
|
5435
5318
|
i++;
|
|
5436
|
-
return [3 /*break*/,
|
|
5437
|
-
case
|
|
5438
|
-
case
|
|
5319
|
+
return [3 /*break*/, 16];
|
|
5320
|
+
case 24: return [2 /*return*/, filtersList];
|
|
5321
|
+
case 25: return [2 /*return*/];
|
|
5439
5322
|
}
|
|
5440
5323
|
});
|
|
5441
5324
|
});
|
|
@@ -6557,339 +6440,6 @@
|
|
|
6557
6440
|
return VariantHasuraGraphQLRepository;
|
|
6558
6441
|
}(withCrudHasuraGraphQL(withHasuraGraphQL(Base))));
|
|
6559
6442
|
|
|
6560
|
-
var WishlistHasuraGraphQLRepository = /** @class */ (function (_super_1) {
|
|
6561
|
-
__extends(WishlistHasuraGraphQLRepository, _super_1);
|
|
6562
|
-
function WishlistHasuraGraphQLRepository(endpoint, authOptions, categoryFilterRepository) {
|
|
6563
|
-
var _this = _super_1.call(this, {
|
|
6564
|
-
tableName: 'category',
|
|
6565
|
-
model: Wishlist,
|
|
6566
|
-
endpoint: endpoint,
|
|
6567
|
-
authOptions: authOptions,
|
|
6568
|
-
fields: [
|
|
6569
|
-
{ id: { columnName: 'id', to: function (value) { return +value; }, from: function (value) { return value.toString(); } } },
|
|
6570
|
-
{ firestoreId: { columnName: 'firestore_id' } },
|
|
6571
|
-
'name',
|
|
6572
|
-
'description',
|
|
6573
|
-
'image',
|
|
6574
|
-
'published',
|
|
6575
|
-
'shop',
|
|
6576
|
-
{ shops: { columnName: 'shops', type: HasuraGraphQLColumnType.Jsonb } },
|
|
6577
|
-
'slug',
|
|
6578
|
-
{ brandCategory: { columnName: 'brand_category' } },
|
|
6579
|
-
{ brandCategoryBanner: { columnName: 'brand_banner' } },
|
|
6580
|
-
{ brandCategoryBannerMobile: { columnName: 'brand_banner_mobile' } },
|
|
6581
|
-
{ brandLogo: { columnName: 'brand_logo' } },
|
|
6582
|
-
{ brandCondition: { columnName: 'brand_condition' } },
|
|
6583
|
-
{
|
|
6584
|
-
conditions: {
|
|
6585
|
-
columnName: 'tag_condition',
|
|
6586
|
-
type: HasuraGraphQLColumnType.Jsonb,
|
|
6587
|
-
from: function (tags, row) { return ({ brand: row.brand_condition, tags: Array.isArray(tags) ? tags : [] }); },
|
|
6588
|
-
bindPersistData: function (value) {
|
|
6589
|
-
return {
|
|
6590
|
-
brand_condition: value.brand,
|
|
6591
|
-
tag_condition: (value === null || value === void 0 ? void 0 : value.tags) || [],
|
|
6592
|
-
};
|
|
6593
|
-
},
|
|
6594
|
-
bindFindFilter: function (sentence) {
|
|
6595
|
-
return Object.assign(Object.assign({}, (sentence.brand ? { brand_condition: sentence.brand } : {})), (sentence.tags ? { tag_condition: sentence.tags } : {}));
|
|
6596
|
-
},
|
|
6597
|
-
},
|
|
6598
|
-
},
|
|
6599
|
-
{
|
|
6600
|
-
filters: {
|
|
6601
|
-
columnName: 'filters',
|
|
6602
|
-
foreignKeyColumn: { filter_id: 'id' },
|
|
6603
|
-
fields: [{ filter: ['id', 'description', 'slug', 'enabled'] }],
|
|
6604
|
-
bindPersistData: function (value) { return ({
|
|
6605
|
-
filters: { data: value.map(function (filter) { return ({ filter_id: filter.id }); }) },
|
|
6606
|
-
}); },
|
|
6607
|
-
from: function (filters) { return (filters === null || filters === void 0 ? void 0 : filters.map(function (filter) { return filter === null || filter === void 0 ? void 0 : filter.filter; })) || []; },
|
|
6608
|
-
},
|
|
6609
|
-
},
|
|
6610
|
-
{ createdAt: { columnName: 'created_at' } },
|
|
6611
|
-
{ updatedAt: { columnName: 'updated_at' } },
|
|
6612
|
-
{
|
|
6613
|
-
products: {
|
|
6614
|
-
columnName: 'products',
|
|
6615
|
-
fields: ['product_id'],
|
|
6616
|
-
from: function (value) { return value.map(function (product) { return product.product_id.toString(); }); },
|
|
6617
|
-
to: function (productIds) { return productIds.map(function (productId) { return ({
|
|
6618
|
-
product_id: +productId,
|
|
6619
|
-
}); }); },
|
|
6620
|
-
},
|
|
6621
|
-
},
|
|
6622
|
-
{
|
|
6623
|
-
metadata: {
|
|
6624
|
-
columnName: 'metadata',
|
|
6625
|
-
fields: ['title', 'description'],
|
|
6626
|
-
bindPersistData: function (value) { return ({
|
|
6627
|
-
metadata: { data: value },
|
|
6628
|
-
}); },
|
|
6629
|
-
},
|
|
6630
|
-
},
|
|
6631
|
-
{ isCollection: { columnName: 'is_collection' } },
|
|
6632
|
-
{ isWishlist: { columnName: 'is_wishlist' } },
|
|
6633
|
-
'reference',
|
|
6634
|
-
{ parentId: { columnName: 'parent_id' } },
|
|
6635
|
-
{
|
|
6636
|
-
parent: {
|
|
6637
|
-
columnName: 'parent',
|
|
6638
|
-
foreignKeyColumn: { id: 'parentId' },
|
|
6639
|
-
fields: ['id', 'name', 'reference', 'slug'],
|
|
6640
|
-
},
|
|
6641
|
-
},
|
|
6642
|
-
{ personId: { columnName: 'person_id' } },
|
|
6643
|
-
],
|
|
6644
|
-
}) || this;
|
|
6645
|
-
_this.categoryFilterRepository = categoryFilterRepository;
|
|
6646
|
-
return _this;
|
|
6647
|
-
}
|
|
6648
|
-
WishlistHasuraGraphQLRepository.prototype.create = function (params) {
|
|
6649
|
-
var _super = Object.create(null, {
|
|
6650
|
-
create: { get: function () { return _super_1.prototype.create; } }
|
|
6651
|
-
});
|
|
6652
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
6653
|
-
var metadata, data;
|
|
6654
|
-
return __generator(this, function (_a) {
|
|
6655
|
-
metadata = params.metadata, data = __rest(params, ["metadata"]);
|
|
6656
|
-
return [2 /*return*/, _super.create.call(this, Object.assign(Object.assign({}, data), { isWishlist: true, isCollection: true, brandCategory: false, metadata: metadata || { description: data.description, title: data.name } }))];
|
|
6657
|
-
});
|
|
6658
|
-
});
|
|
6659
|
-
};
|
|
6660
|
-
WishlistHasuraGraphQLRepository.prototype.get = function (identifiers) {
|
|
6661
|
-
var _super = Object.create(null, {
|
|
6662
|
-
get: { get: function () { return _super_1.prototype.get; } }
|
|
6663
|
-
});
|
|
6664
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
6665
|
-
var data;
|
|
6666
|
-
return __generator(this, function (_a) {
|
|
6667
|
-
switch (_a.label) {
|
|
6668
|
-
case 0: return [4 /*yield*/, _super.get.call(this, identifiers)];
|
|
6669
|
-
case 1:
|
|
6670
|
-
data = _a.sent();
|
|
6671
|
-
if (!data.isWishlist)
|
|
6672
|
-
throw new NotFoundError("Category with id " + identifiers.id + " is not a wishlist");
|
|
6673
|
-
return [2 /*return*/, data];
|
|
6674
|
-
}
|
|
6675
|
-
});
|
|
6676
|
-
});
|
|
6677
|
-
};
|
|
6678
|
-
WishlistHasuraGraphQLRepository.prototype.update = function (params) {
|
|
6679
|
-
var _super = Object.create(null, {
|
|
6680
|
-
update: { get: function () { return _super_1.prototype.update; } }
|
|
6681
|
-
});
|
|
6682
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
6683
|
-
var products, checkId, metadata, filters, data, plainData, id, category, _a, _b, _c, _d;
|
|
6684
|
-
return __generator(this, function (_e) {
|
|
6685
|
-
switch (_e.label) {
|
|
6686
|
-
case 0:
|
|
6687
|
-
products = params.products, checkId = params.id, metadata = params.metadata, filters = params.filters, data = __rest(params, ["products", "id", "metadata", "filters"]);
|
|
6688
|
-
plainData = this.paramsToPlain({ id: checkId });
|
|
6689
|
-
id = plainData.id;
|
|
6690
|
-
return [4 /*yield*/, _super.update.call(this, Object.assign(Object.assign({ id: id }, data), { isWishlist: true, isCollection: true, brandCategory: false }))];
|
|
6691
|
-
case 1:
|
|
6692
|
-
category = _e.sent();
|
|
6693
|
-
_a = category;
|
|
6694
|
-
_b = products;
|
|
6695
|
-
if (!_b) return [3 /*break*/, 3];
|
|
6696
|
-
return [4 /*yield*/, this.updateProducts(+id, { products: products })];
|
|
6697
|
-
case 2:
|
|
6698
|
-
_b = (_e.sent());
|
|
6699
|
-
_e.label = 3;
|
|
6700
|
-
case 3:
|
|
6701
|
-
_a.products = _b;
|
|
6702
|
-
_c = category;
|
|
6703
|
-
_d = metadata;
|
|
6704
|
-
if (!_d) return [3 /*break*/, 5];
|
|
6705
|
-
return [4 /*yield*/, this.updateMetadata(+id, { metadata: metadata })];
|
|
6706
|
-
case 4:
|
|
6707
|
-
_d = (_e.sent());
|
|
6708
|
-
_e.label = 5;
|
|
6709
|
-
case 5:
|
|
6710
|
-
_c.metadata = _d;
|
|
6711
|
-
return [2 /*return*/, category];
|
|
6712
|
-
}
|
|
6713
|
-
});
|
|
6714
|
-
});
|
|
6715
|
-
};
|
|
6716
|
-
WishlistHasuraGraphQLRepository.prototype.getWishlistBySlug = function (slug) {
|
|
6717
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
6718
|
-
var data;
|
|
6719
|
-
return __generator(this, function (_a) {
|
|
6720
|
-
switch (_a.label) {
|
|
6721
|
-
case 0:
|
|
6722
|
-
if (!slug)
|
|
6723
|
-
return [2 /*return*/];
|
|
6724
|
-
return [4 /*yield*/, this.find({
|
|
6725
|
-
filters: {
|
|
6726
|
-
slug: slug,
|
|
6727
|
-
isWishlist: { operator: exports.Where.EQUALS, value: true },
|
|
6728
|
-
},
|
|
6729
|
-
options: {
|
|
6730
|
-
enableCount: false,
|
|
6731
|
-
},
|
|
6732
|
-
})];
|
|
6733
|
-
case 1:
|
|
6734
|
-
data = (_a.sent()).data;
|
|
6735
|
-
if (!data.length)
|
|
6736
|
-
throw new NotFoundError("Wishlist with slug " + slug + " not found");
|
|
6737
|
-
if (data.length > 1)
|
|
6738
|
-
throw new DuplicatedResultsError('Query returned duplicated values');
|
|
6739
|
-
return [2 /*return*/, data.shift()];
|
|
6740
|
-
}
|
|
6741
|
-
});
|
|
6742
|
-
});
|
|
6743
|
-
};
|
|
6744
|
-
WishlistHasuraGraphQLRepository.prototype.getWishlistByPerson = function (personId) {
|
|
6745
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
6746
|
-
var data;
|
|
6747
|
-
return __generator(this, function (_a) {
|
|
6748
|
-
switch (_a.label) {
|
|
6749
|
-
case 0:
|
|
6750
|
-
if (!personId)
|
|
6751
|
-
return [2 /*return*/];
|
|
6752
|
-
return [4 /*yield*/, this.find({
|
|
6753
|
-
filters: {
|
|
6754
|
-
personId: { operator: exports.Where.EQUALS, value: personId },
|
|
6755
|
-
isWishlist: { operator: exports.Where.EQUALS, value: true },
|
|
6756
|
-
},
|
|
6757
|
-
options: {
|
|
6758
|
-
enableCount: false,
|
|
6759
|
-
},
|
|
6760
|
-
})];
|
|
6761
|
-
case 1:
|
|
6762
|
-
data = (_a.sent()).data;
|
|
6763
|
-
if (!data.length)
|
|
6764
|
-
throw new NotFoundError("Wishlists from person " + personId + " not found");
|
|
6765
|
-
return [2 /*return*/, data];
|
|
6766
|
-
}
|
|
6767
|
-
});
|
|
6768
|
-
});
|
|
6769
|
-
};
|
|
6770
|
-
WishlistHasuraGraphQLRepository.prototype.updateProducts = function (categoryId, _a) {
|
|
6771
|
-
var products = _a.products;
|
|
6772
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
6773
|
-
var plainData;
|
|
6774
|
-
return __generator(this, function (_a) {
|
|
6775
|
-
switch (_a.label) {
|
|
6776
|
-
case 0:
|
|
6777
|
-
if (!('action' in products && products.action === 'remove')) return [3 /*break*/, 3];
|
|
6778
|
-
return [4 /*yield*/, this.mutation('delete_category_product', ['affected_rows'], {
|
|
6779
|
-
where: {
|
|
6780
|
-
type: 'category_product_bool_exp',
|
|
6781
|
-
required: true,
|
|
6782
|
-
value: { category_id: { _eq: categoryId } },
|
|
6783
|
-
},
|
|
6784
|
-
})];
|
|
6785
|
-
case 1:
|
|
6786
|
-
_a.sent();
|
|
6787
|
-
return [4 /*yield*/, this.categoryFilterRepository.deleteByCategory(categoryId)];
|
|
6788
|
-
case 2:
|
|
6789
|
-
_a.sent();
|
|
6790
|
-
return [2 /*return*/, []];
|
|
6791
|
-
case 3:
|
|
6792
|
-
plainData = this.paramsToPlain({ products: products });
|
|
6793
|
-
if (!plainData.products || plainData.products.length <= 0)
|
|
6794
|
-
return [2 /*return*/, []];
|
|
6795
|
-
return [4 /*yield*/, this.mutation('delete_category_product', ['affected_rows'], {
|
|
6796
|
-
where: {
|
|
6797
|
-
type: 'category_product_bool_exp',
|
|
6798
|
-
required: true,
|
|
6799
|
-
value: { category_id: { _eq: categoryId } },
|
|
6800
|
-
},
|
|
6801
|
-
})];
|
|
6802
|
-
case 4:
|
|
6803
|
-
_a.sent();
|
|
6804
|
-
return [4 /*yield*/, this.categoryFilterRepository.deleteByCategory(categoryId)];
|
|
6805
|
-
case 5:
|
|
6806
|
-
_a.sent();
|
|
6807
|
-
return [4 /*yield*/, this.mutation('insert_category_product', ['affected_rows'], {
|
|
6808
|
-
objects: {
|
|
6809
|
-
type: '[category_product_insert_input!]',
|
|
6810
|
-
required: true,
|
|
6811
|
-
value: plainData.products.map(function (productId) { return ({ category_id: categoryId, product_id: productId }); }),
|
|
6812
|
-
},
|
|
6813
|
-
})];
|
|
6814
|
-
case 6:
|
|
6815
|
-
_a.sent();
|
|
6816
|
-
return [2 /*return*/, plainData.products];
|
|
6817
|
-
}
|
|
6818
|
-
});
|
|
6819
|
-
});
|
|
6820
|
-
};
|
|
6821
|
-
WishlistHasuraGraphQLRepository.prototype.updateMetadata = function (categoryId, _a) {
|
|
6822
|
-
var metadata = _a.metadata;
|
|
6823
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
6824
|
-
var plainData;
|
|
6825
|
-
return __generator(this, function (_a) {
|
|
6826
|
-
switch (_a.label) {
|
|
6827
|
-
case 0:
|
|
6828
|
-
plainData = this.paramsToPlain({ metadata: metadata });
|
|
6829
|
-
if (!plainData.metadata)
|
|
6830
|
-
return [2 /*return*/];
|
|
6831
|
-
return [4 /*yield*/, this.mutation('update_category_metadata_by_pk', ['category_id'], {
|
|
6832
|
-
pk_columns: {
|
|
6833
|
-
value: { category_id: categoryId },
|
|
6834
|
-
type: 'category_metadata_pk_columns_input',
|
|
6835
|
-
required: true,
|
|
6836
|
-
},
|
|
6837
|
-
_set: {
|
|
6838
|
-
value: lodash.omit(metadata, ['category_id']),
|
|
6839
|
-
type: 'category_metadata_set_input',
|
|
6840
|
-
required: true,
|
|
6841
|
-
},
|
|
6842
|
-
})];
|
|
6843
|
-
case 1:
|
|
6844
|
-
_a.sent();
|
|
6845
|
-
return [2 /*return*/, plainData.metadata];
|
|
6846
|
-
}
|
|
6847
|
-
});
|
|
6848
|
-
});
|
|
6849
|
-
};
|
|
6850
|
-
WishlistHasuraGraphQLRepository.prototype.getCategoryBySlug = function (slug, _shop) {
|
|
6851
|
-
return this.getWishlistBySlug(slug);
|
|
6852
|
-
};
|
|
6853
|
-
WishlistHasuraGraphQLRepository.prototype.getCategoryByShop = function (shop) {
|
|
6854
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
6855
|
-
var data;
|
|
6856
|
-
return __generator(this, function (_a) {
|
|
6857
|
-
switch (_a.label) {
|
|
6858
|
-
case 0:
|
|
6859
|
-
if (!shop)
|
|
6860
|
-
return [2 /*return*/];
|
|
6861
|
-
return [4 /*yield*/, this.find({
|
|
6862
|
-
filters: {
|
|
6863
|
-
shops: { operator: exports.Where.IN, value: [shop] },
|
|
6864
|
-
published: { operator: exports.Where.EQUALS, value: true },
|
|
6865
|
-
isWishlist: { operator: exports.Where.EQUALS, value: true },
|
|
6866
|
-
},
|
|
6867
|
-
options: {
|
|
6868
|
-
enableCount: false,
|
|
6869
|
-
},
|
|
6870
|
-
})];
|
|
6871
|
-
case 1:
|
|
6872
|
-
data = (_a.sent()).data;
|
|
6873
|
-
return [2 /*return*/, data];
|
|
6874
|
-
}
|
|
6875
|
-
});
|
|
6876
|
-
});
|
|
6877
|
-
};
|
|
6878
|
-
WishlistHasuraGraphQLRepository.prototype.getCategoriesForHome = function (categoryIds, limit, gender) {
|
|
6879
|
-
return;
|
|
6880
|
-
};
|
|
6881
|
-
WishlistHasuraGraphQLRepository.prototype.mountCategory = function (category, options) {
|
|
6882
|
-
return;
|
|
6883
|
-
};
|
|
6884
|
-
WishlistHasuraGraphQLRepository.prototype.getChildren = function (parentId) {
|
|
6885
|
-
return;
|
|
6886
|
-
};
|
|
6887
|
-
WishlistHasuraGraphQLRepository.prototype.isChild = function (id, parentId) {
|
|
6888
|
-
return;
|
|
6889
|
-
};
|
|
6890
|
-
return WishlistHasuraGraphQLRepository;
|
|
6891
|
-
}(withCrudHasuraGraphQL(withHasuraGraphQL(Base))));
|
|
6892
|
-
|
|
6893
6443
|
/**
|
|
6894
6444
|
* Generated bundle index. Do not edit.
|
|
6895
6445
|
*/
|
|
@@ -7016,8 +6566,12 @@
|
|
|
7016
6566
|
exports.BeautyQuestionsHelper = BeautyQuestionsHelper;
|
|
7017
6567
|
exports.Buy2Win = Buy2Win;
|
|
7018
6568
|
exports.Buy2WinFirestoreRepository = Buy2WinFirestoreRepository;
|
|
6569
|
+
exports.Campaign = Campaign;
|
|
6570
|
+
exports.CampaignBanner = CampaignBanner;
|
|
6571
|
+
exports.CampaignBannerFirestoreRepository = CampaignBannerFirestoreRepository;
|
|
7019
6572
|
exports.CampaignDashboard = CampaignDashboard;
|
|
7020
6573
|
exports.CampaignDashboardFirestoreRepository = CampaignDashboardFirestoreRepository;
|
|
6574
|
+
exports.CampaignFirestoreRepository = CampaignFirestoreRepository;
|
|
7021
6575
|
exports.CampaignHashtag = CampaignHashtag;
|
|
7022
6576
|
exports.CampaignHashtagFirestoreRepository = CampaignHashtagFirestoreRepository;
|
|
7023
6577
|
exports.Category = Category;
|
|
@@ -7100,8 +6654,6 @@
|
|
|
7100
6654
|
exports.VariantHasuraGraphQL = VariantHasuraGraphQL;
|
|
7101
6655
|
exports.VariantHasuraGraphQLRepository = VariantHasuraGraphQLRepository;
|
|
7102
6656
|
exports.WeakPasswordError = WeakPasswordError;
|
|
7103
|
-
exports.Wishlist = Wishlist;
|
|
7104
|
-
exports.WishlistHasuraGraphQLRepository = WishlistHasuraGraphQLRepository;
|
|
7105
6657
|
exports.isDebuggable = isDebuggable;
|
|
7106
6658
|
exports.isUUID = isUUID;
|
|
7107
6659
|
exports.parseDateTime = parseDateTime;
|