@infrab4a/connect 3.11.1-beta2 → 3.11.1-beta4
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 +1282 -344
- package/bundles/infrab4a-connect.umd.js.map +1 -1
- package/domain/catalog/helpers/index.d.ts +1 -0
- package/domain/catalog/helpers/round-product-price.helper.d.ts +4 -0
- package/domain/catalog/index.d.ts +1 -0
- package/domain/catalog/models/category-collection-children.d.ts +13 -0
- package/domain/catalog/models/category-filter.d.ts +5 -1
- package/domain/catalog/models/category.d.ts +5 -3
- package/domain/catalog/models/filter-option.d.ts +1 -2
- package/domain/catalog/models/filter.d.ts +1 -2
- package/domain/catalog/models/index.d.ts +1 -0
- package/domain/catalog/models/kit-product.d.ts +1 -1
- package/domain/catalog/models/product.d.ts +1 -2
- package/domain/catalog/models/types/category-product.d.ts +4 -0
- package/domain/catalog/models/types/index.d.ts +1 -0
- package/domain/catalog/models/types/shop-description.type.d.ts +1 -0
- package/domain/catalog/models/variant.d.ts +1 -2
- package/domain/catalog/repositories/category-collection-children.repository.d.ts +4 -0
- package/domain/catalog/repositories/category.repository.d.ts +3 -0
- package/domain/catalog/repositories/index.d.ts +1 -0
- package/domain/catalog/repositories/product.repository.d.ts +3 -1
- package/domain/generic/model/base.model.d.ts +9 -5
- package/domain/generic/model/types/base-model-builder.type.d.ts +4 -2
- package/domain/generic/model/types/identifier-model.type.d.ts +6 -5
- package/domain/generic/model/types/model-base-structure.type.d.ts +9 -3
- package/domain/generic/model/types/non-function-property-name.type.d.ts +12 -3
- package/domain/generic/repository/find.repository.d.ts +3 -1
- package/domain/generic/repository/get.repository.d.ts +2 -2
- package/domain/generic/repository/types/repository-find-filters.type.d.ts +3 -3
- package/domain/generic/repository/types/repository-find-result.type.d.ts +8 -1
- package/domain/generic/repository/types/repository-order-by-list.type.d.ts +2 -2
- package/domain/generic/repository/types/repository-update-params.type.d.ts +2 -2
- package/domain/location/models/address.d.ts +5 -3
- package/domain/shopping/models/checkout.d.ts +5 -6
- package/domain/shopping/models/coupons/coupon.d.ts +34 -6
- package/domain/shopping/models/order.d.ts +1 -0
- package/domain/shopping/models/shipping-method.d.ts +1 -0
- package/domain/shopping/models/subscription/checkout.d.ts +3 -4
- package/domain/users/models/subscription/subscription-materialization.d.ts +4 -4
- package/domain/users/models/subscription/subscription.d.ts +3 -3
- package/domain/users/models/user-address.d.ts +1 -1
- package/domain/users/models/user.d.ts +3 -4
- package/esm2015/domain/catalog/helpers/index.js +2 -0
- package/esm2015/domain/catalog/helpers/round-product-price.helper.js +15 -0
- package/esm2015/domain/catalog/index.js +2 -1
- package/esm2015/domain/catalog/models/category-collection-children.js +13 -0
- package/esm2015/domain/catalog/models/category-filter.js +14 -5
- package/esm2015/domain/catalog/models/category.js +6 -4
- package/esm2015/domain/catalog/models/filter-option.js +1 -4
- package/esm2015/domain/catalog/models/filter.js +1 -4
- package/esm2015/domain/catalog/models/index.js +2 -1
- package/esm2015/domain/catalog/models/kit-product.js +2 -2
- package/esm2015/domain/catalog/models/product.js +1 -4
- package/esm2015/domain/catalog/models/types/category-product.js +2 -0
- package/esm2015/domain/catalog/models/types/index.js +2 -1
- package/esm2015/domain/catalog/models/types/shop-description.type.js +1 -1
- package/esm2015/domain/catalog/models/variant.js +1 -4
- package/esm2015/domain/catalog/repositories/category-collection-children.repository.js +2 -0
- package/esm2015/domain/catalog/repositories/category.repository.js +1 -1
- package/esm2015/domain/catalog/repositories/index.js +2 -1
- package/esm2015/domain/catalog/repositories/product.repository.js +1 -1
- package/esm2015/domain/generic/model/base.model.js +3 -2
- package/esm2015/domain/generic/model/types/base-model-builder.type.js +1 -1
- package/esm2015/domain/generic/model/types/identifier-model.type.js +1 -1
- package/esm2015/domain/generic/model/types/model-base-structure.type.js +1 -1
- package/esm2015/domain/generic/model/types/non-function-property-name.type.js +1 -1
- package/esm2015/domain/generic/repository/find.repository.js +1 -1
- package/esm2015/domain/generic/repository/get.repository.js +1 -1
- package/esm2015/domain/generic/repository/types/repository-find-filters.type.js +1 -1
- package/esm2015/domain/generic/repository/types/repository-find-result.type.js +1 -1
- package/esm2015/domain/generic/repository/types/repository-order-by-list.type.js +1 -1
- package/esm2015/domain/generic/repository/types/repository-update-params.type.js +1 -1
- package/esm2015/domain/location/models/address.js +2 -2
- package/esm2015/domain/shopping/models/checkout.js +6 -7
- package/esm2015/domain/shopping/models/coupons/coupon.js +16 -16
- package/esm2015/domain/shopping/models/order.js +1 -1
- package/esm2015/domain/shopping/models/shipping-method.js +1 -1
- package/esm2015/domain/shopping/models/subscription/checkout.js +6 -6
- package/esm2015/domain/users/models/subscription/subscription-materialization.js +6 -6
- package/esm2015/domain/users/models/subscription/subscription.js +6 -6
- package/esm2015/domain/users/models/user-address.js +1 -1
- package/esm2015/domain/users/models/user.js +2 -2
- package/esm2015/infra/elasticsearch/adapters/axios.adapter.js +1 -1
- package/esm2015/infra/elasticsearch/indexes/products-index.js +8 -3
- package/esm2015/infra/firebase/firestore/mixins/with-create-firestore.mixin.js +3 -3
- package/esm2015/infra/firebase/firestore/mixins/with-crud-firestore.mixin.js +1 -1
- package/esm2015/infra/firebase/firestore/mixins/with-delete-firestore.mixin.js +1 -1
- package/esm2015/infra/firebase/firestore/mixins/with-find-firestore.mixin.js +1 -1
- package/esm2015/infra/firebase/firestore/mixins/with-firestore.mixin.js +17 -2
- package/esm2015/infra/firebase/firestore/mixins/with-get-firestore.mixin.js +2 -2
- package/esm2015/infra/firebase/firestore/mixins/with-helpers.mixin.js +1 -1
- package/esm2015/infra/firebase/firestore/mixins/with-sub-collection.mixin.js +1 -1
- package/esm2015/infra/firebase/firestore/mixins/with-update-firestore.mixin.js +1 -1
- package/esm2015/infra/firebase/firestore/repositories/catalog/category-firestore.repository.js +10 -1
- package/esm2015/infra/firebase/firestore/repositories/catalog/product-firestore.repository.js +5 -2
- package/esm2015/infra/firebase/firestore/repositories/users/user-address-firestore.repository.js +2 -2
- package/esm2015/infra/firebase/firestore/types/firestore-sub.repository.type.js +1 -1
- package/esm2015/infra/firebase/firestore/types/firestore.helpers.type.js +1 -1
- package/esm2015/infra/firebase/firestore/types/firestore.repository.type.js +1 -1
- package/esm2015/infra/hasura-graphql/mixins/helpers/attribute-option.helper.js +2 -2
- package/esm2015/infra/hasura-graphql/mixins/helpers/bind-filter-query.helper.js +20 -15
- package/esm2015/infra/hasura-graphql/mixins/helpers/filter-option.helper.js +1 -1
- package/esm2015/infra/hasura-graphql/mixins/helpers/graphql-field.helper.js +23 -18
- package/esm2015/infra/hasura-graphql/mixins/with-create-hasura-graphql.mixin.js +19 -3
- package/esm2015/infra/hasura-graphql/mixins/with-crud-hasura-graphql.mixin.js +2 -2
- package/esm2015/infra/hasura-graphql/mixins/with-delete-hasura-graphql.mixin.js +5 -3
- package/esm2015/infra/hasura-graphql/mixins/with-find-hasura-graphql.mixin.js +67 -8
- package/esm2015/infra/hasura-graphql/mixins/with-get-hasura-graphql.mixin.js +5 -3
- package/esm2015/infra/hasura-graphql/mixins/with-hasura-graphql.mixin.js +7 -4
- package/esm2015/infra/hasura-graphql/mixins/with-update-hasura-graphql.mixin.js +7 -5
- package/esm2015/infra/hasura-graphql/models/product-hasura-graphql.js +1 -1
- package/esm2015/infra/hasura-graphql/models/variant-hasura-graphql.js +1 -1
- package/esm2015/infra/hasura-graphql/repositories/catalog/category-collection-children-hasura-graphql.repository.js +38 -0
- package/esm2015/infra/hasura-graphql/repositories/catalog/category-filter-hasura-graphql.repository.js +75 -2
- package/esm2015/infra/hasura-graphql/repositories/catalog/category-hasura-graphql.repository.js +46 -2
- package/esm2015/infra/hasura-graphql/repositories/catalog/index.js +2 -1
- package/esm2015/infra/hasura-graphql/repositories/catalog/product-hasura-graphql.repository.js +27 -10
- package/esm2015/infra/hasura-graphql/repositories/catalog/variant-hasura-graphql.repository.js +2 -1
- package/esm2015/infra/hasura-graphql/types/graphql.repository.type.js +1 -1
- package/esm2015/infra/hasura-graphql/types/hasura-graphql-fields.type.js +1 -1
- package/esm2015/utils/decorators/debug.class.decorator.js +7 -0
- package/esm2015/utils/decorators/index.js +3 -0
- package/esm2015/utils/decorators/trace.method.decorator.js +81 -0
- package/esm2015/utils/helpers/class-name.helper.js +15 -0
- package/esm2015/utils/helpers/debug-decorator.helper.js +18 -0
- package/esm2015/utils/helpers/debug.helper.js +150 -0
- package/esm2015/utils/helpers/index.js +5 -0
- package/esm2015/utils/helpers/reflect.helper.js +165 -0
- package/esm2015/utils/index.js +9 -6
- package/esm2015/utils/log.utils.js +9 -0
- package/fesm2015/infrab4a-connect.js +911 -162
- package/fesm2015/infrab4a-connect.js.map +1 -1
- package/infra/elasticsearch/adapters/axios.adapter.d.ts +2 -2
- package/infra/firebase/firestore/mixins/with-create-firestore.mixin.d.ts +2 -2
- package/infra/firebase/firestore/mixins/with-crud-firestore.mixin.d.ts +3 -3
- package/infra/firebase/firestore/mixins/with-delete-firestore.mixin.d.ts +3 -3
- package/infra/firebase/firestore/mixins/with-find-firestore.mixin.d.ts +2 -2
- package/infra/firebase/firestore/mixins/with-firestore.mixin.d.ts +1 -1
- package/infra/firebase/firestore/mixins/with-get-firestore.mixin.d.ts +3 -3
- package/infra/firebase/firestore/mixins/with-helpers.mixin.d.ts +4 -4
- package/infra/firebase/firestore/mixins/with-sub-collection.mixin.d.ts +4 -4
- package/infra/firebase/firestore/mixins/with-update-firestore.mixin.d.ts +3 -3
- package/infra/firebase/firestore/repositories/catalog/category-firestore.repository.d.ts +4 -1
- package/infra/firebase/firestore/repositories/catalog/product-firestore.repository.d.ts +3 -2
- package/infra/firebase/firestore/repositories/catalog/product-variant-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/catalog/subscription-product-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/shop-settings/home-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/shop-settings/shop-menu-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/shop-settings/shop-settings-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/shopping/buy-2-win-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/shopping/campaign-dashboard-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/shopping/campaign-hashtag-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/shopping/checkout-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/shopping/checkout-subscription-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/shopping/coupon-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/shopping/order-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/shopping/payment-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/shopping/subscription-plan-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/users/lead-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/users/subscription-edition-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/users/subscription-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/users/subscription-materialization-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/users/subscription-payment-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/users/user-address-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/users/user-beauty-profile-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/users/user-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/repositories/users/user-payment-method-firestore.repository.d.ts +1 -1
- package/infra/firebase/firestore/types/firestore-sub.repository.type.d.ts +3 -3
- package/infra/firebase/firestore/types/firestore.helpers.type.d.ts +5 -5
- package/infra/firebase/firestore/types/firestore.repository.type.d.ts +1 -1
- package/infra/hasura-graphql/mixins/helpers/attribute-option.helper.d.ts +5 -3
- package/infra/hasura-graphql/mixins/helpers/bind-filter-query.helper.d.ts +5 -5
- package/infra/hasura-graphql/mixins/helpers/filter-option.helper.d.ts +4 -2
- package/infra/hasura-graphql/mixins/helpers/graphql-field.helper.d.ts +6 -5
- package/infra/hasura-graphql/mixins/with-create-hasura-graphql.mixin.d.ts +2 -1
- package/infra/hasura-graphql/mixins/with-crud-hasura-graphql.mixin.d.ts +4 -4
- package/infra/hasura-graphql/mixins/with-delete-hasura-graphql.mixin.d.ts +2 -2
- package/infra/hasura-graphql/mixins/with-find-hasura-graphql.mixin.d.ts +22 -9
- package/infra/hasura-graphql/mixins/with-get-hasura-graphql.mixin.d.ts +5 -4
- package/infra/hasura-graphql/mixins/with-hasura-graphql.mixin.d.ts +2 -2
- package/infra/hasura-graphql/mixins/with-update-hasura-graphql.mixin.d.ts +2 -2
- package/infra/hasura-graphql/models/product-hasura-graphql.d.ts +3 -0
- package/infra/hasura-graphql/models/variant-hasura-graphql.d.ts +1 -0
- package/infra/hasura-graphql/repositories/catalog/category-collection-children-hasura-graphql.repository.d.ts +10 -0
- package/infra/hasura-graphql/repositories/catalog/category-hasura-graphql.repository.d.ts +3 -0
- package/infra/hasura-graphql/repositories/catalog/index.d.ts +1 -0
- package/infra/hasura-graphql/repositories/catalog/product-hasura-graphql.repository.d.ts +2 -1
- package/infra/hasura-graphql/types/graphql.repository.type.d.ts +5 -3
- package/infra/hasura-graphql/types/hasura-graphql-fields.type.d.ts +7 -3
- package/package.json +2 -1
- package/utils/decorators/debug.class.decorator.d.ts +2 -0
- package/utils/decorators/index.d.ts +2 -0
- package/utils/decorators/trace.method.decorator.d.ts +14 -0
- package/utils/helpers/class-name.helper.d.ts +3 -0
- package/utils/helpers/debug-decorator.helper.d.ts +9 -0
- package/utils/helpers/debug.helper.d.ts +60 -0
- package/utils/helpers/index.d.ts +4 -0
- package/utils/helpers/reflect.helper.d.ts +50 -0
- package/utils/index.d.ts +8 -5
- package/utils/log.utils.d.ts +7 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('reflect-metadata'), require('class-transformer'), require('date-fns'), require('lodash'), require('ts-custom-error'), require('axios'), require('firebase'), require('gql-query-builder')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@infrab4a/connect', ['exports', 'reflect-metadata', 'class-transformer', 'date-fns', 'lodash', 'ts-custom-error', 'axios', 'firebase', 'gql-query-builder'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.infrab4a = global.infrab4a || {}, global.infrab4a.connect = {}), null, global["class-transformer"], global["date-fns"], global.lodash, global["ts-custom-error"], global.axios, global.firebase, global["gql-query-builder"]));
|
|
5
|
-
})(this, (function (exports, reflectMetadata, classTransformer, dateFns, lodash, tsCustomError, axios, firebase, gqlQueryBuilder) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('reflect-metadata'), require('class-transformer'), require('date-fns'), require('lodash'), require('rxjs'), require('debug'), require('ts-custom-error'), require('axios'), require('firebase'), require('gql-query-builder')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@infrab4a/connect', ['exports', 'reflect-metadata', 'class-transformer', 'date-fns', 'lodash', 'rxjs', 'debug', 'ts-custom-error', 'axios', 'firebase', 'gql-query-builder'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.infrab4a = global.infrab4a || {}, global.infrab4a.connect = {}), null, global["class-transformer"], global["date-fns"], global.lodash, global.rxjs, global.debug, global["ts-custom-error"], global.axios, global.firebase, global["gql-query-builder"]));
|
|
5
|
+
})(this, (function (exports, reflectMetadata, classTransformer, dateFns, lodash, rxjs, debug, tsCustomError, axios, firebase, gqlQueryBuilder) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
}
|
|
16
16
|
Object.defineProperty(BaseModel.prototype, "identifier", {
|
|
17
17
|
get: function () {
|
|
18
|
-
var _this = this;
|
|
19
18
|
var fields = this.constructor.identifiersFields.filter(function (field) { return field !== 'identifier'; });
|
|
19
|
+
var data = this;
|
|
20
20
|
return fields.reduce(function (object, field) {
|
|
21
21
|
var _a;
|
|
22
|
-
return (Object.assign(Object.assign({}, object), (_a = {}, _a[field] =
|
|
22
|
+
return (Object.assign(Object.assign({}, object), (_a = {}, _a[field] = data[field], _a)));
|
|
23
23
|
}, {});
|
|
24
24
|
},
|
|
25
25
|
enumerable: false,
|
|
@@ -816,20 +816,562 @@
|
|
|
816
816
|
__metadata("design:type", Payment)
|
|
817
817
|
], SubscriptionPayment.prototype, "payment", void 0);
|
|
818
818
|
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
819
|
+
exports.DebugNamespaces = void 0;
|
|
820
|
+
(function (DebugNamespaces) {
|
|
821
|
+
DebugNamespaces["ROOT"] = "connect";
|
|
822
|
+
DebugNamespaces["TRACE"] = "trace";
|
|
823
|
+
DebugNamespaces["ERROR"] = "error";
|
|
824
|
+
})(exports.DebugNamespaces || (exports.DebugNamespaces = {}));
|
|
825
|
+
var Logger = debug.debug(exports.DebugNamespaces.ROOT);
|
|
826
|
+
|
|
827
|
+
var ReflectHelper = /** @class */ (function () {
|
|
828
|
+
function ReflectHelper() {
|
|
823
829
|
}
|
|
824
|
-
Object.defineProperty(
|
|
830
|
+
Object.defineProperty(ReflectHelper, "items", {
|
|
825
831
|
get: function () {
|
|
826
|
-
return
|
|
832
|
+
return this._items;
|
|
827
833
|
},
|
|
828
834
|
enumerable: false,
|
|
829
835
|
configurable: true
|
|
830
836
|
});
|
|
831
|
-
|
|
832
|
-
|
|
837
|
+
Object.defineProperty(ReflectHelper, "keys", {
|
|
838
|
+
get: function () {
|
|
839
|
+
return Object.keys(ReflectHelper.items);
|
|
840
|
+
},
|
|
841
|
+
enumerable: false,
|
|
842
|
+
configurable: true
|
|
843
|
+
});
|
|
844
|
+
ReflectHelper.has = function (key, target, property) {
|
|
845
|
+
return (!lodash.isNil(key) &&
|
|
846
|
+
!lodash.isNil(ReflectHelper.items[key]) &&
|
|
847
|
+
(lodash.isNil(target) ||
|
|
848
|
+
(!lodash.isNil(ReflectHelper.items[key][target]) &&
|
|
849
|
+
(lodash.isNil(property) || !lodash.isNil(ReflectHelper.items[key][target][String(property)])))));
|
|
850
|
+
};
|
|
851
|
+
ReflectHelper.get = function (_a) {
|
|
852
|
+
var key = _a.key, target = _a.target, property = _a.property, _b = _a.own, own = _b === void 0 ? true : _b;
|
|
853
|
+
try {
|
|
854
|
+
if (own) {
|
|
855
|
+
return Reflect.getOwnMetadata(key, target, property) || null;
|
|
856
|
+
}
|
|
857
|
+
else {
|
|
858
|
+
return Reflect.getMetadata(key, target, property) || null;
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
catch (_err) {
|
|
862
|
+
return null;
|
|
863
|
+
}
|
|
864
|
+
};
|
|
865
|
+
ReflectHelper.first = function (_a) {
|
|
866
|
+
var key = _a.key, target = _a.target, property = _a.property, _b = _a.own, own = _b === void 0 ? true : _b;
|
|
867
|
+
var values = ReflectHelper.get({ key: key, target: target, property: property, own: own });
|
|
868
|
+
return lodash.isArray(values) ? lodash.first(values) : values;
|
|
869
|
+
};
|
|
870
|
+
ReflectHelper.last = function (_a) {
|
|
871
|
+
var key = _a.key, target = _a.target, property = _a.property, _b = _a.own, own = _b === void 0 ? true : _b;
|
|
872
|
+
var values = ReflectHelper.get({ key: key, target: target, property: property, own: own });
|
|
873
|
+
return lodash.isArray(values) ? lodash.last(values) : values;
|
|
874
|
+
};
|
|
875
|
+
ReflectHelper.set = function (_a) {
|
|
876
|
+
var key = _a.key, target = _a.target, property = _a.property, value = _a.value, propertyDescriptor = _a.propertyDescriptor;
|
|
877
|
+
Reflect.defineMetadata(key, value, target, property);
|
|
878
|
+
ReflectHelper.put({ key: key, target: target, property: property, value: value, propertyDescriptor: propertyDescriptor });
|
|
879
|
+
};
|
|
880
|
+
ReflectHelper.add = function (_a) {
|
|
881
|
+
var key = _a.key, target = _a.target, property = _a.property, value = _a.value, propertyDescriptor = _a.propertyDescriptor;
|
|
882
|
+
var values = ReflectHelper.get({ key: key, target: target, property: property }) || new Array();
|
|
883
|
+
if (!Array.isArray(values))
|
|
884
|
+
values = [values];
|
|
885
|
+
values.push(value);
|
|
886
|
+
ReflectHelper.set({ key: key, target: target, property: property, value: values, propertyDescriptor: propertyDescriptor });
|
|
887
|
+
};
|
|
888
|
+
ReflectHelper.all = function (_a) {
|
|
889
|
+
var _this = this;
|
|
890
|
+
var key = _a.key;
|
|
891
|
+
var items = ReflectHelper.items[key] || {};
|
|
892
|
+
return lodash.flatten(Object.keys(items).map(function (item) { return lodash.flatten(_this.allFrom(key, items[item])); }));
|
|
893
|
+
};
|
|
894
|
+
ReflectHelper.allFrom = function (key, target) {
|
|
895
|
+
var _this = this;
|
|
896
|
+
return Object.keys(target)
|
|
897
|
+
.filter(function (property) { return property !== 'object'; })
|
|
898
|
+
.map(function (property) { return _this.allValuesFrom(key, target, property); });
|
|
899
|
+
};
|
|
900
|
+
ReflectHelper.allValuesFrom = function (key, target, property) {
|
|
901
|
+
var values = target[property];
|
|
902
|
+
var value = values.value;
|
|
903
|
+
var propertyDescriptor = values.propertyDescriptor;
|
|
904
|
+
if (!lodash.isArray(value))
|
|
905
|
+
value = [value];
|
|
906
|
+
return lodash.flatten(value.map(function (val) {
|
|
907
|
+
return {
|
|
908
|
+
key: key,
|
|
909
|
+
target: target.object,
|
|
910
|
+
property: property,
|
|
911
|
+
value: val,
|
|
912
|
+
propertyDescriptor: propertyDescriptor,
|
|
913
|
+
};
|
|
914
|
+
}));
|
|
915
|
+
};
|
|
916
|
+
ReflectHelper.delete = function (_a) {
|
|
917
|
+
var key = _a.key, target = _a.target, property = _a.property;
|
|
918
|
+
Reflect.deleteMetadata(key, target, property);
|
|
919
|
+
return ReflectHelper.remove(key, target, property);
|
|
920
|
+
};
|
|
921
|
+
ReflectHelper.clear = function (key) {
|
|
922
|
+
if (!key) {
|
|
923
|
+
ReflectHelper.keys.forEach(function (storedKey) {
|
|
924
|
+
ReflectHelper.clear(storedKey);
|
|
925
|
+
});
|
|
926
|
+
}
|
|
927
|
+
else {
|
|
928
|
+
if (ReflectHelper.keys.includes(key)) {
|
|
929
|
+
Object.values(ReflectHelper.items[key]).forEach(function (target) {
|
|
930
|
+
if (ReflectHelper.has(key, target)) {
|
|
931
|
+
Object.values(ReflectHelper.items[key][target]).forEach(function (property) {
|
|
932
|
+
ReflectHelper.delete({
|
|
933
|
+
key: key,
|
|
934
|
+
target: target.object,
|
|
935
|
+
property: String(property),
|
|
936
|
+
});
|
|
937
|
+
ReflectHelper.remove(key, target, String(property));
|
|
938
|
+
});
|
|
939
|
+
}
|
|
940
|
+
ReflectHelper.delete({ key: key, target: target.object });
|
|
941
|
+
ReflectHelper.remove(key, target);
|
|
942
|
+
});
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
};
|
|
946
|
+
ReflectHelper.getType = function (_a) {
|
|
947
|
+
var target = _a.target, propertyKey = _a.propertyKey;
|
|
948
|
+
return Reflect.getMetadata('design:type', target, propertyKey);
|
|
949
|
+
};
|
|
950
|
+
ReflectHelper.getReturntype = function (_a) {
|
|
951
|
+
var target = _a.target, propertyKey = _a.propertyKey;
|
|
952
|
+
return Reflect.getMetadata('design:returntype', target, propertyKey);
|
|
953
|
+
};
|
|
954
|
+
ReflectHelper.getAllMethods = function (target) {
|
|
955
|
+
var props = [];
|
|
956
|
+
var obj = target;
|
|
957
|
+
do {
|
|
958
|
+
props.push.apply(props, __spreadArray([], __read(Object.getOwnPropertyNames(obj))));
|
|
959
|
+
} while ((obj = Object.getPrototypeOf(obj)));
|
|
960
|
+
return props.sort().filter(function (e, i, arr) {
|
|
961
|
+
if ([
|
|
962
|
+
'__defineGetter__',
|
|
963
|
+
'__defineSetter__',
|
|
964
|
+
'__lookupGetter__',
|
|
965
|
+
'__lookupSetter__',
|
|
966
|
+
'constructor',
|
|
967
|
+
'hasOwnProperty',
|
|
968
|
+
'isPrototypeOf',
|
|
969
|
+
'propertyIsEnumerable',
|
|
970
|
+
'toLocaleString',
|
|
971
|
+
'toString',
|
|
972
|
+
'valueOf',
|
|
973
|
+
].includes(e))
|
|
974
|
+
return false;
|
|
975
|
+
if (e != arr[i + 1] && typeof target[e] === 'function')
|
|
976
|
+
return true;
|
|
977
|
+
});
|
|
978
|
+
};
|
|
979
|
+
ReflectHelper.put = function (_a) {
|
|
980
|
+
var key = _a.key, target = _a.target, property = _a.property, value = _a.value, propertyDescriptor = _a.propertyDescriptor;
|
|
981
|
+
var index = target.constructor.name;
|
|
982
|
+
ReflectHelper.items[key] = ReflectHelper.items[key] || {};
|
|
983
|
+
ReflectHelper.items[key][index] = ReflectHelper.items[key][index] || {};
|
|
984
|
+
ReflectHelper.items[key][index].object = target;
|
|
985
|
+
if (lodash.isNil(property)) {
|
|
986
|
+
ReflectHelper.items[key][index].value = {
|
|
987
|
+
value: value,
|
|
988
|
+
propertyDescriptor: propertyDescriptor,
|
|
989
|
+
};
|
|
990
|
+
}
|
|
991
|
+
else {
|
|
992
|
+
ReflectHelper.items[key][index][String(property)] = ReflectHelper.items[key][index][String(property)] || {};
|
|
993
|
+
ReflectHelper.items[key][index][String(property)] = {
|
|
994
|
+
value: value,
|
|
995
|
+
propertyDescriptor: propertyDescriptor,
|
|
996
|
+
};
|
|
997
|
+
}
|
|
998
|
+
};
|
|
999
|
+
ReflectHelper.remove = function (key, target, property) {
|
|
1000
|
+
if (ReflectHelper.has(key, target, property))
|
|
1001
|
+
return delete ReflectHelper.items[key][target][String(property)];
|
|
1002
|
+
else if (ReflectHelper.has(key, target))
|
|
1003
|
+
return delete ReflectHelper.items[key][target];
|
|
1004
|
+
else if (ReflectHelper.has(key))
|
|
1005
|
+
return delete ReflectHelper.items[key];
|
|
1006
|
+
else
|
|
1007
|
+
return false;
|
|
1008
|
+
};
|
|
1009
|
+
return ReflectHelper;
|
|
1010
|
+
}());
|
|
1011
|
+
ReflectHelper._items = {};
|
|
1012
|
+
|
|
1013
|
+
var DebugDecoratorHelper = /** @class */ (function () {
|
|
1014
|
+
function DebugDecoratorHelper() {
|
|
1015
|
+
}
|
|
1016
|
+
DebugDecoratorHelper.set = function (target, options) {
|
|
1017
|
+
ReflectHelper.add({
|
|
1018
|
+
key: DebugDecoratorHelper.DebugNamingMetadataKey,
|
|
1019
|
+
target: target,
|
|
1020
|
+
value: options,
|
|
1021
|
+
});
|
|
1022
|
+
};
|
|
1023
|
+
DebugDecoratorHelper.get = function (target) {
|
|
1024
|
+
return ReflectHelper.first({
|
|
1025
|
+
key: DebugDecoratorHelper.DebugNamingMetadataKey,
|
|
1026
|
+
target: target,
|
|
1027
|
+
});
|
|
1028
|
+
};
|
|
1029
|
+
return DebugDecoratorHelper;
|
|
1030
|
+
}());
|
|
1031
|
+
DebugDecoratorHelper.DebugNamingMetadataKey = 'model:naming:decorator';
|
|
1032
|
+
|
|
1033
|
+
var ClassNameHelper = /** @class */ (function () {
|
|
1034
|
+
function ClassNameHelper() {
|
|
1035
|
+
}
|
|
1036
|
+
ClassNameHelper.get = function (clazz) {
|
|
1037
|
+
if (!clazz)
|
|
1038
|
+
return null;
|
|
1039
|
+
var prototype = Object.getPrototypeOf(clazz);
|
|
1040
|
+
var names = lodash.compact([
|
|
1041
|
+
lodash.get(clazz, 'constructor.name'),
|
|
1042
|
+
lodash.get(prototype, 'constructor.name'),
|
|
1043
|
+
lodash.get(prototype, '__proto__.constructor.name'),
|
|
1044
|
+
]);
|
|
1045
|
+
return names.find(function (name) { return name !== 'class_1'; });
|
|
1046
|
+
};
|
|
1047
|
+
return ClassNameHelper;
|
|
1048
|
+
}());
|
|
1049
|
+
|
|
1050
|
+
var isDebuggable = function (object) {
|
|
1051
|
+
return 'debug' in object;
|
|
1052
|
+
};
|
|
1053
|
+
var DebugHelper = /** @class */ (function () {
|
|
1054
|
+
function DebugHelper() {
|
|
1055
|
+
var namespace = [];
|
|
1056
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1057
|
+
namespace[_i] = arguments[_i];
|
|
1058
|
+
}
|
|
1059
|
+
this.namespaces = new Set();
|
|
1060
|
+
this.push.apply(this, __spreadArray([], __read(namespace)));
|
|
1061
|
+
}
|
|
1062
|
+
DebugHelper.namespacesFor = function (target) {
|
|
1063
|
+
if (lodash.isNil(target))
|
|
1064
|
+
return [];
|
|
1065
|
+
var decorator = DebugDecoratorHelper.get(Object.getPrototypeOf(target));
|
|
1066
|
+
var namespaces = lodash.get(decorator, 'namespaces', []);
|
|
1067
|
+
var name = lodash.get(decorator, 'name', ClassNameHelper.get(target));
|
|
1068
|
+
return __spreadArray(__spreadArray([], __read(namespaces)), [name]);
|
|
1069
|
+
};
|
|
1070
|
+
DebugHelper.as = function () {
|
|
1071
|
+
var namespaces = [];
|
|
1072
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1073
|
+
namespaces[_i] = arguments[_i];
|
|
1074
|
+
}
|
|
1075
|
+
return new (DebugHelper.bind.apply(DebugHelper, __spreadArray([void 0], __read(namespaces))))();
|
|
1076
|
+
};
|
|
1077
|
+
DebugHelper.for = function (target) {
|
|
1078
|
+
var namespaces = [];
|
|
1079
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
1080
|
+
namespaces[_i - 1] = arguments[_i];
|
|
1081
|
+
}
|
|
1082
|
+
var targetNamespaces = this.namespacesFor(target);
|
|
1083
|
+
return new (DebugHelper.bind.apply(DebugHelper, __spreadArray(__spreadArray([void 0], __read(targetNamespaces)), __read(namespaces))))();
|
|
1084
|
+
};
|
|
1085
|
+
DebugHelper.from = function (target) {
|
|
1086
|
+
var namespaces = [];
|
|
1087
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
1088
|
+
namespaces[_i - 1] = arguments[_i];
|
|
1089
|
+
}
|
|
1090
|
+
if (this.isDebuggable(target)) {
|
|
1091
|
+
var debug = target.debug;
|
|
1092
|
+
if (namespaces)
|
|
1093
|
+
debug.push.apply(debug, __spreadArray([], __read(namespaces)));
|
|
1094
|
+
return debug;
|
|
1095
|
+
}
|
|
1096
|
+
return DebugHelper.for.apply(DebugHelper, __spreadArray([target], __read(namespaces)));
|
|
1097
|
+
};
|
|
1098
|
+
DebugHelper.clonedFrom = function (target) {
|
|
1099
|
+
var namespaces = [];
|
|
1100
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
1101
|
+
namespaces[_i - 1] = arguments[_i];
|
|
1102
|
+
}
|
|
1103
|
+
if (this.isDebuggable(target)) {
|
|
1104
|
+
namespaces.push.apply(namespaces, __spreadArray([], __read(target.debug.entries)));
|
|
1105
|
+
}
|
|
1106
|
+
else if (!lodash.isNil(target)) {
|
|
1107
|
+
namespaces.push.apply(namespaces, __spreadArray([], __read(this.namespacesFor(target))));
|
|
1108
|
+
}
|
|
1109
|
+
return DebugHelper.for.apply(DebugHelper, __spreadArray([target], __read(namespaces)));
|
|
1110
|
+
};
|
|
1111
|
+
DebugHelper.clone = function (target) {
|
|
1112
|
+
var namespaces = [];
|
|
1113
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
1114
|
+
namespaces[_i - 1] = arguments[_i];
|
|
1115
|
+
}
|
|
1116
|
+
var original;
|
|
1117
|
+
if (this.isDebuggable(target)) {
|
|
1118
|
+
original = target.debug;
|
|
1119
|
+
namespaces.push.apply(namespaces, __spreadArray([], __read(original.entries)));
|
|
1120
|
+
}
|
|
1121
|
+
return {
|
|
1122
|
+
original: original,
|
|
1123
|
+
debug: DebugHelper.for.apply(DebugHelper, __spreadArray([target], __read(namespaces))),
|
|
1124
|
+
};
|
|
1125
|
+
};
|
|
1126
|
+
DebugHelper.replace = function (target, attrs) {
|
|
1127
|
+
if (this.isDebuggable(target))
|
|
1128
|
+
target.debug = attrs.with;
|
|
1129
|
+
};
|
|
1130
|
+
DebugHelper.mock = function (target) {
|
|
1131
|
+
var namespaces = [];
|
|
1132
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
1133
|
+
namespaces[_i - 1] = arguments[_i];
|
|
1134
|
+
}
|
|
1135
|
+
var _a = DebugHelper.clone.apply(DebugHelper, __spreadArray([target], __read(namespaces))), original = _a.original, debug = _a.debug;
|
|
1136
|
+
DebugHelper.replace(target, { with: debug });
|
|
1137
|
+
return { original: original, debug: debug };
|
|
1138
|
+
};
|
|
1139
|
+
Object.defineProperty(DebugHelper.prototype, "entries", {
|
|
1140
|
+
get: function () {
|
|
1141
|
+
return Array.from(lodash.get(this, 'namespaces', []));
|
|
1142
|
+
},
|
|
1143
|
+
enumerable: false,
|
|
1144
|
+
configurable: true
|
|
1145
|
+
});
|
|
1146
|
+
Object.defineProperty(DebugHelper.prototype, "namespace", {
|
|
1147
|
+
get: function () {
|
|
1148
|
+
return lodash.compact(lodash.flatten(this.entries)).join(':');
|
|
1149
|
+
},
|
|
1150
|
+
enumerable: false,
|
|
1151
|
+
configurable: true
|
|
1152
|
+
});
|
|
1153
|
+
DebugHelper.prototype.log = function (message) {
|
|
1154
|
+
var args = [];
|
|
1155
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
1156
|
+
args[_i - 1] = arguments[_i];
|
|
1157
|
+
}
|
|
1158
|
+
this.logger.apply(this, __spreadArray([JSON.stringify(message)], __read(args.map(function (element) { return JSON.stringify(element); }))));
|
|
1159
|
+
DebugHelper.logs$.next({ namespace: this.namespace, message: message, args: args });
|
|
1160
|
+
return this;
|
|
1161
|
+
};
|
|
1162
|
+
DebugHelper.prototype.trace = function (message) {
|
|
1163
|
+
var args = [];
|
|
1164
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
1165
|
+
args[_i - 1] = arguments[_i];
|
|
1166
|
+
}
|
|
1167
|
+
this.logger.extend(exports.DebugNamespaces.TRACE).apply(void 0, __spreadArray([message], __read(args)));
|
|
1168
|
+
DebugHelper.traces$.next({ namespace: this.namespace, message: message, args: args });
|
|
1169
|
+
return this;
|
|
1170
|
+
};
|
|
1171
|
+
DebugHelper.prototype.error = function (error) {
|
|
1172
|
+
var args = [];
|
|
1173
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
1174
|
+
args[_i - 1] = arguments[_i];
|
|
1175
|
+
}
|
|
1176
|
+
this.logger.extend(exports.DebugNamespaces.ERROR).apply(void 0, __spreadArray([JSON.stringify(error)], __read(args.map(function (element) { return JSON.stringify(element); }))));
|
|
1177
|
+
DebugHelper.errors$.next({ namespace: this.namespace, error: error, args: args });
|
|
1178
|
+
return this;
|
|
1179
|
+
};
|
|
1180
|
+
DebugHelper.prototype.build = function () {
|
|
1181
|
+
var _this = this;
|
|
1182
|
+
this.logger = Logger;
|
|
1183
|
+
this.tracer = Logger;
|
|
1184
|
+
this.err = Logger;
|
|
1185
|
+
this.entries.forEach(function (namespace) {
|
|
1186
|
+
_this.logger = _this.logger.extend(namespace);
|
|
1187
|
+
_this.tracer = _this.tracer.extend(namespace);
|
|
1188
|
+
_this.err = _this.err.extend(namespace);
|
|
1189
|
+
});
|
|
1190
|
+
return this;
|
|
1191
|
+
};
|
|
1192
|
+
DebugHelper.prototype.with = function () {
|
|
1193
|
+
var namespace = [];
|
|
1194
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1195
|
+
namespace[_i] = arguments[_i];
|
|
1196
|
+
}
|
|
1197
|
+
return new (DebugHelper.bind.apply(DebugHelper, __spreadArray(__spreadArray([void 0], __read(this.entries)), __read(namespace))))();
|
|
1198
|
+
};
|
|
1199
|
+
DebugHelper.prototype.push = function () {
|
|
1200
|
+
var _this = this;
|
|
1201
|
+
var namespace = [];
|
|
1202
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1203
|
+
namespace[_i] = arguments[_i];
|
|
1204
|
+
}
|
|
1205
|
+
if (namespace) {
|
|
1206
|
+
namespace.filter(function (item) { return Boolean(item); }).forEach(function (item) { return _this.namespaces.add(item); });
|
|
1207
|
+
}
|
|
1208
|
+
return this.build();
|
|
1209
|
+
};
|
|
1210
|
+
DebugHelper.prototype.unshift = function () {
|
|
1211
|
+
var namespace = [];
|
|
1212
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1213
|
+
namespace[_i] = arguments[_i];
|
|
1214
|
+
}
|
|
1215
|
+
if (namespace) {
|
|
1216
|
+
return this.reset.apply(this, __spreadArray(__spreadArray([], __read(namespace)), __read(this.entries)));
|
|
1217
|
+
}
|
|
1218
|
+
return this;
|
|
1219
|
+
};
|
|
1220
|
+
DebugHelper.prototype.reset = function () {
|
|
1221
|
+
var namespace = [];
|
|
1222
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1223
|
+
namespace[_i] = arguments[_i];
|
|
1224
|
+
}
|
|
1225
|
+
this.namespaces = new Set(lodash.flatten(lodash.compact(namespace)));
|
|
1226
|
+
return this.build();
|
|
1227
|
+
};
|
|
1228
|
+
DebugHelper.prototype.startWith = function () {
|
|
1229
|
+
var namespace = [];
|
|
1230
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1231
|
+
namespace[_i] = arguments[_i];
|
|
1232
|
+
}
|
|
1233
|
+
var current = this.namespaces;
|
|
1234
|
+
this.namespaces = new Set(lodash.flatten(__spreadArray([lodash.compact(namespace)], __read(current))));
|
|
1235
|
+
return this.build();
|
|
1236
|
+
};
|
|
1237
|
+
DebugHelper.prototype.shift = function () {
|
|
1238
|
+
var list = this.entries;
|
|
1239
|
+
list.shift();
|
|
1240
|
+
return this.reset.apply(this, __spreadArray([], __read(list)));
|
|
1241
|
+
};
|
|
1242
|
+
DebugHelper.prototype.pop = function () {
|
|
1243
|
+
var list = this.entries;
|
|
1244
|
+
list.pop();
|
|
1245
|
+
return this.reset.apply(this, __spreadArray([], __read(list)));
|
|
1246
|
+
};
|
|
1247
|
+
DebugHelper.prototype.clear = function () {
|
|
1248
|
+
return this.reset();
|
|
1249
|
+
};
|
|
1250
|
+
DebugHelper.prototype.remove = function () {
|
|
1251
|
+
var _this = this;
|
|
1252
|
+
var namespace = [];
|
|
1253
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1254
|
+
namespace[_i] = arguments[_i];
|
|
1255
|
+
}
|
|
1256
|
+
if (namespace) {
|
|
1257
|
+
namespace.filter(function (item) { return Boolean(item); }).forEach(function (item) { return _this.namespaces.delete(item); });
|
|
1258
|
+
}
|
|
1259
|
+
return this.build();
|
|
1260
|
+
};
|
|
1261
|
+
DebugHelper.prototype.puts = function () {
|
|
1262
|
+
var args = [];
|
|
1263
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1264
|
+
args[_i] = arguments[_i];
|
|
1265
|
+
}
|
|
1266
|
+
return __spreadArray(["[" + this.namespace + "]"], __read(args)).join(' ');
|
|
1267
|
+
};
|
|
1268
|
+
return DebugHelper;
|
|
1269
|
+
}());
|
|
1270
|
+
DebugHelper.logs$ = new rxjs.Subject();
|
|
1271
|
+
DebugHelper.traces$ = new rxjs.Subject();
|
|
1272
|
+
DebugHelper.errors$ = new rxjs.Subject();
|
|
1273
|
+
DebugHelper.isDebuggable = isDebuggable;
|
|
1274
|
+
|
|
1275
|
+
function Debug(opts) {
|
|
1276
|
+
return function (target) {
|
|
1277
|
+
DebugDecoratorHelper.set(target.prototype, opts);
|
|
1278
|
+
};
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
var ASYNC_IDENTIFIER = 'async';
|
|
1282
|
+
function Log(options) {
|
|
1283
|
+
if (options === void 0) { options = {}; }
|
|
1284
|
+
return Trace(Object.assign({ level: 'log' }, options));
|
|
1285
|
+
}
|
|
1286
|
+
function Trace(options) {
|
|
1287
|
+
if (options === void 0) { options = {}; }
|
|
1288
|
+
return function (target, propertyKey, propertyDescriptor) {
|
|
1289
|
+
var method = propertyDescriptor.value;
|
|
1290
|
+
var isPromise = method.toString().includes(ASYNC_IDENTIFIER);
|
|
1291
|
+
var args = {
|
|
1292
|
+
options: options,
|
|
1293
|
+
method: method,
|
|
1294
|
+
target: target,
|
|
1295
|
+
propertyKey: propertyKey,
|
|
1296
|
+
propertyDescriptor: propertyDescriptor,
|
|
1297
|
+
};
|
|
1298
|
+
propertyDescriptor.value = isPromise ? promiseTracer(args) : functionTracer(args);
|
|
1299
|
+
return propertyDescriptor;
|
|
1300
|
+
};
|
|
1301
|
+
}
|
|
1302
|
+
var traceCall = function (_a) {
|
|
1303
|
+
var target = _a.target, propertyKey = _a.propertyKey, propertyDescriptor = _a.propertyDescriptor, args = _a.args;
|
|
1304
|
+
if (!target.debug)
|
|
1305
|
+
target.debug = DebugHelper.for(target, propertyKey);
|
|
1306
|
+
return target.debug.push(propertyKey).trace('called', { target: target, propertyKey: propertyKey, propertyDescriptor: propertyDescriptor, args: args });
|
|
1307
|
+
};
|
|
1308
|
+
var promiseTracer = function (_a) {
|
|
1309
|
+
var options = _a.options, method = _a.method, propertyKey = _a.propertyKey, propertyDescriptor = _a.propertyDescriptor;
|
|
1310
|
+
return function () {
|
|
1311
|
+
var _this = this;
|
|
1312
|
+
var args = [];
|
|
1313
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1314
|
+
args[_i] = arguments[_i];
|
|
1315
|
+
}
|
|
1316
|
+
return new Promise(function (resolve, reject) {
|
|
1317
|
+
var debug = traceCall({ target: _this, propertyDescriptor: propertyDescriptor, propertyKey: propertyKey, args: args });
|
|
1318
|
+
if (lodash.get(options, 'level', '') === 'log') {
|
|
1319
|
+
debug.with('params').log(args);
|
|
1320
|
+
}
|
|
1321
|
+
return method
|
|
1322
|
+
.apply(_this, args)
|
|
1323
|
+
.then(function (result) {
|
|
1324
|
+
if (options.callbackFn) {
|
|
1325
|
+
options.callbackFn({ target: _this, result: result, args: args, namespace: [propertyKey] });
|
|
1326
|
+
}
|
|
1327
|
+
if (lodash.get(options, 'level', '') === 'log') {
|
|
1328
|
+
debug.with('returns').log(result === undefined ? 'void' : result);
|
|
1329
|
+
}
|
|
1330
|
+
return resolve(result);
|
|
1331
|
+
})
|
|
1332
|
+
.catch(function (error) {
|
|
1333
|
+
debug.error.apply(debug, __spreadArray([error], __read(args)));
|
|
1334
|
+
debug.with('stack').error(error.stack).pop();
|
|
1335
|
+
return reject(error);
|
|
1336
|
+
})
|
|
1337
|
+
.finally(function () {
|
|
1338
|
+
return debug.trace('finally', { args: args }).pop();
|
|
1339
|
+
});
|
|
1340
|
+
});
|
|
1341
|
+
};
|
|
1342
|
+
};
|
|
1343
|
+
var functionTracer = function (_a) {
|
|
1344
|
+
var options = _a.options, target = _a.target, method = _a.method, propertyKey = _a.propertyKey, propertyDescriptor = _a.propertyDescriptor;
|
|
1345
|
+
return function () {
|
|
1346
|
+
var args = [];
|
|
1347
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1348
|
+
args[_i] = arguments[_i];
|
|
1349
|
+
}
|
|
1350
|
+
var debug = traceCall({ target: this || target, propertyDescriptor: propertyDescriptor, propertyKey: propertyKey, args: args });
|
|
1351
|
+
if (lodash.get(options, 'level', '') === 'log') {
|
|
1352
|
+
debug.with('params').log(args);
|
|
1353
|
+
}
|
|
1354
|
+
var result;
|
|
1355
|
+
try {
|
|
1356
|
+
result = method.apply(this, args);
|
|
1357
|
+
if (options.callbackFn)
|
|
1358
|
+
options.callbackFn({ target: this, result: result, args: args, namespace: [propertyKey] });
|
|
1359
|
+
if (lodash.get(options, 'level', '') === 'log') {
|
|
1360
|
+
debug.with('returns').log(result === undefined ? 'void' : result);
|
|
1361
|
+
}
|
|
1362
|
+
return result;
|
|
1363
|
+
}
|
|
1364
|
+
catch (error) {
|
|
1365
|
+
debug.error.apply(debug, __spreadArray([error], __read(args))).pop();
|
|
1366
|
+
throw error;
|
|
1367
|
+
}
|
|
1368
|
+
finally {
|
|
1369
|
+
debug.trace('finally', { args: args }).pop();
|
|
1370
|
+
}
|
|
1371
|
+
};
|
|
1372
|
+
};
|
|
1373
|
+
|
|
1374
|
+
var isUUID = function (value) { return lodash.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); };
|
|
833
1375
|
|
|
834
1376
|
var Base = /** @class */ (function () {
|
|
835
1377
|
function Base() {
|
|
@@ -842,8 +1384,6 @@
|
|
|
842
1384
|
return Base;
|
|
843
1385
|
}());
|
|
844
1386
|
|
|
845
|
-
var isUUID = function (value) { return lodash.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); };
|
|
846
|
-
|
|
847
1387
|
var parseDateTime = function (value) {
|
|
848
1388
|
if (!lodash.isString(value))
|
|
849
1389
|
return value;
|
|
@@ -912,12 +1452,22 @@
|
|
|
912
1452
|
Coupon.createCoupon = function (userId) {
|
|
913
1453
|
return this.toInstance({
|
|
914
1454
|
nickname: "" + Date.now(),
|
|
915
|
-
type: exports.CouponTypes.ABSOLUTE,
|
|
916
1455
|
checkoutType: exports.CheckoutTypes.ECOMMERCE,
|
|
917
|
-
discount:
|
|
1456
|
+
discount: {
|
|
1457
|
+
subscriber: {
|
|
1458
|
+
type: exports.CouponTypes.ABSOLUTE,
|
|
1459
|
+
value: 10,
|
|
1460
|
+
},
|
|
1461
|
+
non_subscriber: {
|
|
1462
|
+
type: exports.CouponTypes.ABSOLUTE,
|
|
1463
|
+
value: 10,
|
|
1464
|
+
},
|
|
1465
|
+
subscription: {
|
|
1466
|
+
type: exports.CouponTypes.ABSOLUTE,
|
|
1467
|
+
value: 10,
|
|
1468
|
+
},
|
|
1469
|
+
},
|
|
918
1470
|
user: userId,
|
|
919
|
-
useLimit: 1,
|
|
920
|
-
useLimitPerUser: true,
|
|
921
1471
|
createdAt: new Date(Date.now()),
|
|
922
1472
|
beginAt: new Date(Date.now()),
|
|
923
1473
|
expiresIn: new Date(Date.now() + COUPON_EXPIRATION),
|
|
@@ -925,14 +1475,6 @@
|
|
|
925
1475
|
};
|
|
926
1476
|
return Coupon;
|
|
927
1477
|
}(BaseModel));
|
|
928
|
-
__decorate([
|
|
929
|
-
classTransformer.Expose({ name: 'checkout_type' }),
|
|
930
|
-
__metadata("design:type", Number)
|
|
931
|
-
], Coupon.prototype, "checkoutType", void 0);
|
|
932
|
-
__decorate([
|
|
933
|
-
classTransformer.Expose({ name: 'exclusivity_type' }),
|
|
934
|
-
__metadata("design:type", Number)
|
|
935
|
-
], Coupon.prototype, "exclusivityType", void 0);
|
|
936
1478
|
|
|
937
1479
|
var SubscriptionPlan = /** @class */ (function (_super) {
|
|
938
1480
|
__extends(SubscriptionPlan, _super);
|
|
@@ -999,6 +1541,36 @@
|
|
|
999
1541
|
__metadata("design:type", BeautyProfile)
|
|
1000
1542
|
], User.prototype, "beautyProfile", void 0);
|
|
1001
1543
|
|
|
1544
|
+
var Address = /** @class */ (function (_super) {
|
|
1545
|
+
__extends(Address, _super);
|
|
1546
|
+
function Address() {
|
|
1547
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1548
|
+
}
|
|
1549
|
+
Object.defineProperty(Address, "identifiersFields", {
|
|
1550
|
+
get: function () {
|
|
1551
|
+
return ['id'];
|
|
1552
|
+
},
|
|
1553
|
+
enumerable: false,
|
|
1554
|
+
configurable: true
|
|
1555
|
+
});
|
|
1556
|
+
return Address;
|
|
1557
|
+
}(BaseModel));
|
|
1558
|
+
|
|
1559
|
+
var UserAddress = /** @class */ (function (_super) {
|
|
1560
|
+
__extends(UserAddress, _super);
|
|
1561
|
+
function UserAddress() {
|
|
1562
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1563
|
+
}
|
|
1564
|
+
Object.defineProperty(UserAddress, "identifiersFields", {
|
|
1565
|
+
get: function () {
|
|
1566
|
+
return ['id', 'userId'];
|
|
1567
|
+
},
|
|
1568
|
+
enumerable: false,
|
|
1569
|
+
configurable: true
|
|
1570
|
+
});
|
|
1571
|
+
return UserAddress;
|
|
1572
|
+
}(Address));
|
|
1573
|
+
|
|
1002
1574
|
var Subscription = /** @class */ (function (_super) {
|
|
1003
1575
|
__extends(Subscription, _super);
|
|
1004
1576
|
function Subscription() {
|
|
@@ -1022,12 +1594,12 @@
|
|
|
1022
1594
|
__metadata("design:type", SubscriptionPlan)
|
|
1023
1595
|
], Subscription.prototype, "subscriptionPlan", void 0);
|
|
1024
1596
|
__decorate([
|
|
1025
|
-
classTransformer.Type(function () { return
|
|
1026
|
-
__metadata("design:type",
|
|
1597
|
+
classTransformer.Type(function () { return UserAddress; }),
|
|
1598
|
+
__metadata("design:type", UserAddress)
|
|
1027
1599
|
], Subscription.prototype, "shippingAddress", void 0);
|
|
1028
1600
|
__decorate([
|
|
1029
|
-
classTransformer.Type(function () { return
|
|
1030
|
-
__metadata("design:type",
|
|
1601
|
+
classTransformer.Type(function () { return UserAddress; }),
|
|
1602
|
+
__metadata("design:type", UserAddress)
|
|
1031
1603
|
], Subscription.prototype, "billingAddress", void 0);
|
|
1032
1604
|
__decorate([
|
|
1033
1605
|
classTransformer.Type(function () { return Coupon; }),
|
|
@@ -1047,9 +1619,6 @@
|
|
|
1047
1619
|
function Filter() {
|
|
1048
1620
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
1049
1621
|
}
|
|
1050
|
-
Filter.prototype.identifierFields = function () {
|
|
1051
|
-
return ['id'];
|
|
1052
|
-
};
|
|
1053
1622
|
Object.defineProperty(Filter, "identifiersFields", {
|
|
1054
1623
|
get: function () {
|
|
1055
1624
|
return ['id'];
|
|
@@ -1060,82 +1629,28 @@
|
|
|
1060
1629
|
return Filter;
|
|
1061
1630
|
}(BaseModel));
|
|
1062
1631
|
|
|
1063
|
-
var
|
|
1064
|
-
__extends(
|
|
1065
|
-
function
|
|
1632
|
+
var KitProduct = /** @class */ (function (_super) {
|
|
1633
|
+
__extends(KitProduct, _super);
|
|
1634
|
+
function KitProduct() {
|
|
1066
1635
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
1067
1636
|
}
|
|
1068
|
-
|
|
1069
|
-
return ['id'];
|
|
1070
|
-
};
|
|
1071
|
-
Object.defineProperty(Category, "identifiersFields", {
|
|
1637
|
+
Object.defineProperty(KitProduct, "identifiersFields", {
|
|
1072
1638
|
get: function () {
|
|
1073
|
-
return ['
|
|
1639
|
+
return ['productId', 'kitProductId'];
|
|
1074
1640
|
},
|
|
1075
1641
|
enumerable: false,
|
|
1076
1642
|
configurable: true
|
|
1077
1643
|
});
|
|
1078
|
-
return
|
|
1644
|
+
return KitProduct;
|
|
1079
1645
|
}(BaseModel));
|
|
1080
1646
|
__decorate([
|
|
1081
|
-
classTransformer.Type(function () { return
|
|
1082
|
-
__metadata("design:type",
|
|
1083
|
-
],
|
|
1647
|
+
classTransformer.Type(function () { return Product; }),
|
|
1648
|
+
__metadata("design:type", Product)
|
|
1649
|
+
], KitProduct.prototype, "kit", void 0);
|
|
1084
1650
|
__decorate([
|
|
1085
|
-
classTransformer.Type(function () { return
|
|
1086
|
-
__metadata("design:type",
|
|
1087
|
-
],
|
|
1088
|
-
|
|
1089
|
-
var CategoryFilter = /** @class */ (function (_super) {
|
|
1090
|
-
__extends(CategoryFilter, _super);
|
|
1091
|
-
function CategoryFilter() {
|
|
1092
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1093
|
-
}
|
|
1094
|
-
Object.defineProperty(CategoryFilter, "identifiersFields", {
|
|
1095
|
-
// identifierFields(): NonFunctionPropertyNames<CategoryFilter>[] {
|
|
1096
|
-
// return ['id']
|
|
1097
|
-
// }
|
|
1098
|
-
get: function () {
|
|
1099
|
-
return ['id', 'filterId', 'categoryId'];
|
|
1100
|
-
},
|
|
1101
|
-
enumerable: false,
|
|
1102
|
-
configurable: true
|
|
1103
|
-
});
|
|
1104
|
-
return CategoryFilter;
|
|
1105
|
-
}(BaseModel));
|
|
1106
|
-
|
|
1107
|
-
exports.GenderDestination = void 0;
|
|
1108
|
-
(function (GenderDestination) {
|
|
1109
|
-
GenderDestination["FEMALE"] = "female";
|
|
1110
|
-
GenderDestination["MALE"] = "male";
|
|
1111
|
-
GenderDestination["UNISEX"] = "unisex";
|
|
1112
|
-
})(exports.GenderDestination || (exports.GenderDestination = {}));
|
|
1113
|
-
|
|
1114
|
-
exports.Shops = void 0;
|
|
1115
|
-
(function (Shops) {
|
|
1116
|
-
Shops["MENSMARKET"] = "mensmarket";
|
|
1117
|
-
Shops["GLAMSHOP"] = "Glamshop";
|
|
1118
|
-
Shops["GLAMPOINTS"] = "Glampoints";
|
|
1119
|
-
Shops["ALL"] = "ALL";
|
|
1120
|
-
})(exports.Shops || (exports.Shops = {}));
|
|
1121
|
-
|
|
1122
|
-
var FilterOption = /** @class */ (function (_super) {
|
|
1123
|
-
__extends(FilterOption, _super);
|
|
1124
|
-
function FilterOption() {
|
|
1125
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1126
|
-
}
|
|
1127
|
-
FilterOption.prototype.identifierFields = function () {
|
|
1128
|
-
return ['id'];
|
|
1129
|
-
};
|
|
1130
|
-
Object.defineProperty(FilterOption, "identifiersFields", {
|
|
1131
|
-
get: function () {
|
|
1132
|
-
return ['id'];
|
|
1133
|
-
},
|
|
1134
|
-
enumerable: false,
|
|
1135
|
-
configurable: true
|
|
1136
|
-
});
|
|
1137
|
-
return FilterOption;
|
|
1138
|
-
}(BaseModel));
|
|
1651
|
+
classTransformer.Type(function () { return Product; }),
|
|
1652
|
+
__metadata("design:type", Product)
|
|
1653
|
+
], KitProduct.prototype, "product", void 0);
|
|
1139
1654
|
|
|
1140
1655
|
var Product = /** @class */ (function (_super) {
|
|
1141
1656
|
__extends(Product, _super);
|
|
@@ -1164,9 +1679,6 @@
|
|
|
1164
1679
|
enumerable: false,
|
|
1165
1680
|
configurable: true
|
|
1166
1681
|
});
|
|
1167
|
-
Product.prototype.identifierFields = function () {
|
|
1168
|
-
return ['id'];
|
|
1169
|
-
};
|
|
1170
1682
|
Object.defineProperty(Product, "identifiersFields", {
|
|
1171
1683
|
get: function () {
|
|
1172
1684
|
return ['id'];
|
|
@@ -1185,37 +1697,110 @@
|
|
|
1185
1697
|
__metadata("design:type", Array)
|
|
1186
1698
|
], Product.prototype, "kitProducts", void 0);
|
|
1187
1699
|
|
|
1188
|
-
var
|
|
1189
|
-
__extends(
|
|
1190
|
-
function
|
|
1700
|
+
var Category = /** @class */ (function (_super) {
|
|
1701
|
+
__extends(Category, _super);
|
|
1702
|
+
function Category() {
|
|
1703
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1704
|
+
}
|
|
1705
|
+
Object.defineProperty(Category, "identifiersFields", {
|
|
1706
|
+
get: function () {
|
|
1707
|
+
return ['id'];
|
|
1708
|
+
},
|
|
1709
|
+
enumerable: false,
|
|
1710
|
+
configurable: true
|
|
1711
|
+
});
|
|
1712
|
+
return Category;
|
|
1713
|
+
}(BaseModel));
|
|
1714
|
+
__decorate([
|
|
1715
|
+
classTransformer.Type(function () { return Category; }),
|
|
1716
|
+
__metadata("design:type", Category)
|
|
1717
|
+
], Category.prototype, "parent", void 0);
|
|
1718
|
+
__decorate([
|
|
1719
|
+
classTransformer.Type(function () { return Filter; }),
|
|
1720
|
+
__metadata("design:type", Array)
|
|
1721
|
+
], Category.prototype, "filters", void 0);
|
|
1722
|
+
__decorate([
|
|
1723
|
+
classTransformer.Type(function () { return Product; }),
|
|
1724
|
+
__metadata("design:type", Array)
|
|
1725
|
+
], Category.prototype, "childrenProducts", void 0);
|
|
1726
|
+
|
|
1727
|
+
var CategoryCollectionChildren = /** @class */ (function (_super) {
|
|
1728
|
+
__extends(CategoryCollectionChildren, _super);
|
|
1729
|
+
function CategoryCollectionChildren() {
|
|
1730
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1731
|
+
}
|
|
1732
|
+
Object.defineProperty(CategoryCollectionChildren, "identifiersFields", {
|
|
1733
|
+
get: function () {
|
|
1734
|
+
return ['collectionId', 'categoryId'];
|
|
1735
|
+
},
|
|
1736
|
+
enumerable: false,
|
|
1737
|
+
configurable: true
|
|
1738
|
+
});
|
|
1739
|
+
return CategoryCollectionChildren;
|
|
1740
|
+
}(BaseModel));
|
|
1741
|
+
__decorate([
|
|
1742
|
+
classTransformer.Type(function () { return CategoryCollectionChildren; }),
|
|
1743
|
+
__metadata("design:type", CategoryCollectionChildren)
|
|
1744
|
+
], CategoryCollectionChildren.prototype, "parent", void 0);
|
|
1745
|
+
|
|
1746
|
+
var CategoryFilter = /** @class */ (function (_super) {
|
|
1747
|
+
__extends(CategoryFilter, _super);
|
|
1748
|
+
function CategoryFilter() {
|
|
1749
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
1750
|
+
}
|
|
1751
|
+
Object.defineProperty(CategoryFilter, "identifiersFields", {
|
|
1752
|
+
get: function () {
|
|
1753
|
+
return ['id'];
|
|
1754
|
+
},
|
|
1755
|
+
enumerable: false,
|
|
1756
|
+
configurable: true
|
|
1757
|
+
});
|
|
1758
|
+
return CategoryFilter;
|
|
1759
|
+
}(BaseModel));
|
|
1760
|
+
__decorate([
|
|
1761
|
+
classTransformer.Type(function () { return Filter; }),
|
|
1762
|
+
__metadata("design:type", Filter)
|
|
1763
|
+
], CategoryFilter.prototype, "filter", void 0);
|
|
1764
|
+
__decorate([
|
|
1765
|
+
classTransformer.Type(function () { return Category; }),
|
|
1766
|
+
__metadata("design:type", Category)
|
|
1767
|
+
], CategoryFilter.prototype, "category", void 0);
|
|
1768
|
+
|
|
1769
|
+
exports.GenderDestination = void 0;
|
|
1770
|
+
(function (GenderDestination) {
|
|
1771
|
+
GenderDestination["FEMALE"] = "female";
|
|
1772
|
+
GenderDestination["MALE"] = "male";
|
|
1773
|
+
GenderDestination["UNISEX"] = "unisex";
|
|
1774
|
+
})(exports.GenderDestination || (exports.GenderDestination = {}));
|
|
1775
|
+
|
|
1776
|
+
exports.Shops = void 0;
|
|
1777
|
+
(function (Shops) {
|
|
1778
|
+
Shops["MENSMARKET"] = "mensmarket";
|
|
1779
|
+
Shops["GLAMSHOP"] = "Glamshop";
|
|
1780
|
+
Shops["GLAMPOINTS"] = "Glampoints";
|
|
1781
|
+
Shops["ALL"] = "ALL";
|
|
1782
|
+
})(exports.Shops || (exports.Shops = {}));
|
|
1783
|
+
|
|
1784
|
+
var FilterOption = /** @class */ (function (_super) {
|
|
1785
|
+
__extends(FilterOption, _super);
|
|
1786
|
+
function FilterOption() {
|
|
1191
1787
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
1192
1788
|
}
|
|
1193
|
-
Object.defineProperty(
|
|
1789
|
+
Object.defineProperty(FilterOption, "identifiersFields", {
|
|
1194
1790
|
get: function () {
|
|
1195
|
-
return ['
|
|
1791
|
+
return ['id'];
|
|
1196
1792
|
},
|
|
1197
1793
|
enumerable: false,
|
|
1198
1794
|
configurable: true
|
|
1199
1795
|
});
|
|
1200
|
-
return
|
|
1796
|
+
return FilterOption;
|
|
1201
1797
|
}(BaseModel));
|
|
1202
|
-
__decorate([
|
|
1203
|
-
classTransformer.Type(function () { return Product; }),
|
|
1204
|
-
__metadata("design:type", Product)
|
|
1205
|
-
], KitProduct.prototype, "kit", void 0);
|
|
1206
|
-
__decorate([
|
|
1207
|
-
classTransformer.Type(function () { return Product; }),
|
|
1208
|
-
__metadata("design:type", Product)
|
|
1209
|
-
], KitProduct.prototype, "product", void 0);
|
|
1210
1798
|
|
|
1211
1799
|
var Variant = /** @class */ (function (_super) {
|
|
1212
1800
|
__extends(Variant, _super);
|
|
1213
1801
|
function Variant() {
|
|
1214
1802
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
1215
1803
|
}
|
|
1216
|
-
Variant.prototype.identifierFields = function () {
|
|
1217
|
-
return ['id'];
|
|
1218
|
-
};
|
|
1219
1804
|
Object.defineProperty(Variant, "identifiersFields", {
|
|
1220
1805
|
get: function () {
|
|
1221
1806
|
return ['id', 'productId'];
|
|
@@ -1321,12 +1906,12 @@
|
|
|
1321
1906
|
__metadata("design:type", User)
|
|
1322
1907
|
], Checkout.prototype, "user", void 0);
|
|
1323
1908
|
__decorate([
|
|
1324
|
-
classTransformer.Type(function () { return
|
|
1325
|
-
__metadata("design:type",
|
|
1909
|
+
classTransformer.Type(function () { return UserAddress; }),
|
|
1910
|
+
__metadata("design:type", UserAddress)
|
|
1326
1911
|
], Checkout.prototype, "shippingAddress", void 0);
|
|
1327
1912
|
__decorate([
|
|
1328
|
-
classTransformer.Type(function () { return
|
|
1329
|
-
__metadata("design:type",
|
|
1913
|
+
classTransformer.Type(function () { return UserAddress; }),
|
|
1914
|
+
__metadata("design:type", UserAddress)
|
|
1330
1915
|
], Checkout.prototype, "billingAddress", void 0);
|
|
1331
1916
|
__decorate([
|
|
1332
1917
|
classTransformer.Type(function () { return ShippingMethod; }),
|
|
@@ -1376,12 +1961,12 @@
|
|
|
1376
1961
|
return CheckoutSubscription;
|
|
1377
1962
|
}(BaseModel));
|
|
1378
1963
|
__decorate([
|
|
1379
|
-
classTransformer.Type(function () { return
|
|
1380
|
-
__metadata("design:type",
|
|
1964
|
+
classTransformer.Type(function () { return UserAddress; }),
|
|
1965
|
+
__metadata("design:type", UserAddress)
|
|
1381
1966
|
], CheckoutSubscription.prototype, "shippingAddress", void 0);
|
|
1382
1967
|
__decorate([
|
|
1383
|
-
classTransformer.Type(function () { return
|
|
1384
|
-
__metadata("design:type",
|
|
1968
|
+
classTransformer.Type(function () { return UserAddress; }),
|
|
1969
|
+
__metadata("design:type", UserAddress)
|
|
1385
1970
|
], CheckoutSubscription.prototype, "billingAddress", void 0);
|
|
1386
1971
|
__decorate([
|
|
1387
1972
|
classTransformer.Type(function () { return SubscriptionPlan; }),
|
|
@@ -1415,12 +2000,12 @@
|
|
|
1415
2000
|
__metadata("design:type", SubscriptionPlan)
|
|
1416
2001
|
], SubscriptionMaterialization.prototype, "subscriptionPlan", void 0);
|
|
1417
2002
|
__decorate([
|
|
1418
|
-
classTransformer.Type(function () { return
|
|
1419
|
-
__metadata("design:type",
|
|
2003
|
+
classTransformer.Type(function () { return UserAddress; }),
|
|
2004
|
+
__metadata("design:type", UserAddress)
|
|
1420
2005
|
], SubscriptionMaterialization.prototype, "shippingAddress", void 0);
|
|
1421
2006
|
__decorate([
|
|
1422
|
-
classTransformer.Type(function () { return
|
|
1423
|
-
__metadata("design:type",
|
|
2007
|
+
classTransformer.Type(function () { return UserAddress; }),
|
|
2008
|
+
__metadata("design:type", UserAddress)
|
|
1424
2009
|
], SubscriptionMaterialization.prototype, "billingAddress", void 0);
|
|
1425
2010
|
__decorate([
|
|
1426
2011
|
classTransformer.Type(function () { return Coupon; }),
|
|
@@ -1435,21 +2020,6 @@
|
|
|
1435
2020
|
__metadata("design:type", SubscriptionPayment)
|
|
1436
2021
|
], SubscriptionMaterialization.prototype, "payment", void 0);
|
|
1437
2022
|
|
|
1438
|
-
var UserAddress = /** @class */ (function (_super) {
|
|
1439
|
-
__extends(UserAddress, _super);
|
|
1440
|
-
function UserAddress() {
|
|
1441
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1442
|
-
}
|
|
1443
|
-
Object.defineProperty(UserAddress, "identifiersFields", {
|
|
1444
|
-
get: function () {
|
|
1445
|
-
return ['id', 'userId'];
|
|
1446
|
-
},
|
|
1447
|
-
enumerable: false,
|
|
1448
|
-
configurable: true
|
|
1449
|
-
});
|
|
1450
|
-
return UserAddress;
|
|
1451
|
-
}(Address));
|
|
1452
|
-
|
|
1453
2023
|
var UserPaymentMethod = /** @class */ (function (_super) {
|
|
1454
2024
|
__extends(UserPaymentMethod, _super);
|
|
1455
2025
|
function UserPaymentMethod() {
|
|
@@ -1644,6 +2214,23 @@
|
|
|
1644
2214
|
return RecoveryPassword;
|
|
1645
2215
|
}());
|
|
1646
2216
|
|
|
2217
|
+
var RoundProductPricesHelper = /** @class */ (function () {
|
|
2218
|
+
function RoundProductPricesHelper() {
|
|
2219
|
+
}
|
|
2220
|
+
RoundProductPricesHelper.roundProductPrices = function (product) {
|
|
2221
|
+
product.price.price = Number(product.price.price.toFixed(2));
|
|
2222
|
+
product.price.fullPrice = Number(product.price.fullPrice.toFixed(2));
|
|
2223
|
+
if (product.price.subscriberPrice) {
|
|
2224
|
+
product.price.subscriberPrice = Number(product.price.subscriberPrice.toFixed(2));
|
|
2225
|
+
}
|
|
2226
|
+
if (product instanceof LineItem && product.pricePaid) {
|
|
2227
|
+
product.pricePaid = Number(product.pricePaid.toFixed(2));
|
|
2228
|
+
}
|
|
2229
|
+
return product;
|
|
2230
|
+
};
|
|
2231
|
+
return RoundProductPricesHelper;
|
|
2232
|
+
}());
|
|
2233
|
+
|
|
1647
2234
|
exports.FilterType = void 0;
|
|
1648
2235
|
(function (FilterType) {
|
|
1649
2236
|
FilterType["ACCESSORY_IMPORTANCE"] = "accessoryImportance";
|
|
@@ -2013,7 +2600,12 @@
|
|
|
2013
2600
|
})];
|
|
2014
2601
|
case 1:
|
|
2015
2602
|
search = _a.sent();
|
|
2016
|
-
search.hits = search.hits
|
|
2603
|
+
search.hits = search.hits
|
|
2604
|
+
.filter(function (e) { return e._source.name !== ''; })
|
|
2605
|
+
.map(function (hit) {
|
|
2606
|
+
RoundProductPricesHelper.roundProductPrices(hit._source);
|
|
2607
|
+
return hit;
|
|
2608
|
+
});
|
|
2017
2609
|
return [2 /*return*/, search];
|
|
2018
2610
|
}
|
|
2019
2611
|
});
|
|
@@ -2102,6 +2694,17 @@
|
|
|
2102
2694
|
: bindDate(data[key], key), _a)));
|
|
2103
2695
|
}, {});
|
|
2104
2696
|
};
|
|
2697
|
+
var omitByRecursivelyInPlace = function (value, iteratee) {
|
|
2698
|
+
lodash.each(value, function (v, k) {
|
|
2699
|
+
if (iteratee(v, k)) {
|
|
2700
|
+
lodash.unset(value, k);
|
|
2701
|
+
}
|
|
2702
|
+
else if (lodash.isObject(v)) {
|
|
2703
|
+
omitByRecursivelyInPlace(v, iteratee);
|
|
2704
|
+
}
|
|
2705
|
+
});
|
|
2706
|
+
return value;
|
|
2707
|
+
};
|
|
2105
2708
|
return /** @class */ (function (_super) {
|
|
2106
2709
|
__extends(class_1, _super);
|
|
2107
2710
|
function class_1() {
|
|
@@ -2113,7 +2716,10 @@
|
|
|
2113
2716
|
class_1.prototype.buildModelInstance = function () {
|
|
2114
2717
|
var _this = this;
|
|
2115
2718
|
return {
|
|
2116
|
-
toFirestore: function (data) {
|
|
2719
|
+
toFirestore: function (data) {
|
|
2720
|
+
var plain = (data === null || data === void 0 ? void 0 : data.toPlain) ? data.toPlain() : data;
|
|
2721
|
+
return omitByRecursivelyInPlace(plain, function (value) { return value === undefined; });
|
|
2722
|
+
},
|
|
2117
2723
|
fromFirestore: function (snap) {
|
|
2118
2724
|
var data = snap.data();
|
|
2119
2725
|
var bindedData;
|
|
@@ -2331,34 +2937,34 @@
|
|
|
2331
2937
|
CreateFirestore.prototype.create = function (data) {
|
|
2332
2938
|
return __awaiter(this, void 0, void 0, function () {
|
|
2333
2939
|
var docRef, doc;
|
|
2334
|
-
return __generator(this, function (
|
|
2335
|
-
switch (
|
|
2940
|
+
return __generator(this, function (_c) {
|
|
2941
|
+
switch (_c.label) {
|
|
2336
2942
|
case 0: return [4 /*yield*/, this.save(this.model.toInstance(data))];
|
|
2337
2943
|
case 1:
|
|
2338
|
-
docRef =
|
|
2944
|
+
docRef = _c.sent();
|
|
2339
2945
|
return [4 /*yield*/, docRef.get()];
|
|
2340
2946
|
case 2:
|
|
2341
|
-
doc =
|
|
2947
|
+
doc = _c.sent();
|
|
2342
2948
|
return [2 /*return*/, doc.data()];
|
|
2343
2949
|
}
|
|
2344
2950
|
});
|
|
2345
2951
|
});
|
|
2346
2952
|
};
|
|
2347
2953
|
CreateFirestore.prototype.save = function (data) {
|
|
2348
|
-
var _a;
|
|
2954
|
+
var _a, _b;
|
|
2349
2955
|
return __awaiter(this, void 0, void 0, function () {
|
|
2350
2956
|
var id, collectionPath, docRef;
|
|
2351
|
-
return __generator(this, function (
|
|
2352
|
-
switch (
|
|
2957
|
+
return __generator(this, function (_c) {
|
|
2958
|
+
switch (_c.label) {
|
|
2353
2959
|
case 0:
|
|
2354
|
-
id = (_a = data
|
|
2960
|
+
id = (_b = (_a = Object.values(data.identifier)) === null || _a === void 0 ? void 0 : _a.shift()) === null || _b === void 0 ? void 0 : _b.toString();
|
|
2355
2961
|
collectionPath = this.buildCollectionPathForAdd(data);
|
|
2356
2962
|
if (lodash.isEmpty(id))
|
|
2357
2963
|
return [2 /*return*/, this.collection(collectionPath).add(data)];
|
|
2358
2964
|
docRef = this.collection(collectionPath).doc(id);
|
|
2359
2965
|
return [4 /*yield*/, docRef.set(data)];
|
|
2360
2966
|
case 1:
|
|
2361
|
-
|
|
2967
|
+
_c.sent();
|
|
2362
2968
|
return [2 /*return*/, docRef];
|
|
2363
2969
|
}
|
|
2364
2970
|
});
|
|
@@ -2815,6 +3421,15 @@
|
|
|
2815
3421
|
});
|
|
2816
3422
|
});
|
|
2817
3423
|
};
|
|
3424
|
+
CategoryFirestoreRepository.prototype.getCategoryByShop = function (shop) {
|
|
3425
|
+
return;
|
|
3426
|
+
};
|
|
3427
|
+
CategoryFirestoreRepository.prototype.getChildren = function (parentId) {
|
|
3428
|
+
return;
|
|
3429
|
+
};
|
|
3430
|
+
CategoryFirestoreRepository.prototype.isChild = function (id, parentId) {
|
|
3431
|
+
return;
|
|
3432
|
+
};
|
|
2818
3433
|
return CategoryFirestoreRepository;
|
|
2819
3434
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
2820
3435
|
|
|
@@ -2884,6 +3499,9 @@
|
|
|
2884
3499
|
ProductFirestoreRepository.prototype.cleanShoppingCountFromIds = function (ids) {
|
|
2885
3500
|
return;
|
|
2886
3501
|
};
|
|
3502
|
+
ProductFirestoreRepository.prototype.findCatalog = function (params) {
|
|
3503
|
+
return this.find(params);
|
|
3504
|
+
};
|
|
2887
3505
|
return ProductFirestoreRepository;
|
|
2888
3506
|
}(withCrudFirestore(withHelpers(withFirestore(Base)))));
|
|
2889
3507
|
|
|
@@ -3283,7 +3901,7 @@
|
|
|
3283
3901
|
return { columnName: attributeName.toString(), attributeName: attributeName, fields: fieldOption };
|
|
3284
3902
|
return Object.assign({ attributeName: attributeName, columnName: attributeName.toString() }, fieldOption);
|
|
3285
3903
|
};
|
|
3286
|
-
AttributeOptionHelper.CheckIsColumnOption = function (fieldValue) { return !!fieldValue.columnName; };
|
|
3904
|
+
AttributeOptionHelper.CheckIsColumnOption = function (fieldValue) { return !!(fieldValue === null || fieldValue === void 0 ? void 0 : fieldValue.columnName); };
|
|
3287
3905
|
AttributeOptionHelper.FindColumnOptionFromList = function (columnName, fields) {
|
|
3288
3906
|
if (fields.includes(columnName))
|
|
3289
3907
|
return { columnName: columnName, attributeName: columnName };
|
|
@@ -3372,23 +3990,24 @@
|
|
|
3372
3990
|
BindFilterQueryHelper.BuildWhereSentence = function (field, options, fields) {
|
|
3373
3991
|
var _a;
|
|
3374
3992
|
var fieldSentenceOptions = AttributeOptionHelper.FindByAttribute(field, fields);
|
|
3375
|
-
|
|
3993
|
+
var isNestedField = !Array.isArray(options) &&
|
|
3376
3994
|
lodash.isObject(options) &&
|
|
3377
3995
|
lodash.isNil(options === null || options === void 0 ? void 0 : options.operator) &&
|
|
3378
3996
|
lodash.isNil(options === null || options === void 0 ? void 0 : options.value) &&
|
|
3379
|
-
lodash.isNil(fieldSentenceOptions === null || fieldSentenceOptions === void 0 ? void 0 : fieldSentenceOptions.to)
|
|
3997
|
+
lodash.isNil(fieldSentenceOptions === null || fieldSentenceOptions === void 0 ? void 0 : fieldSentenceOptions.to);
|
|
3998
|
+
if (isNestedField)
|
|
3380
3999
|
return Object.keys(options).reduce(function (variables, key) {
|
|
3381
4000
|
var _a;
|
|
3382
4001
|
var fieldOptions = AttributeOptionHelper.FindByAttribute(key, (fieldSentenceOptions === null || fieldSentenceOptions === void 0 ? void 0 : fieldSentenceOptions.fields) || fields);
|
|
3383
4002
|
var columnName = fieldOptions.columnName;
|
|
3384
4003
|
var columnFields = fieldOptions.fields;
|
|
3385
|
-
return Object.assign(Object.assign({}, variables), (_a = {}, _a[columnName] = BindFilterQueryHelper.BuildWhereSentence(key, options[key], columnFields ||
|
|
4004
|
+
return Object.assign(Object.assign({}, variables), (_a = {}, _a[columnName] = BindFilterQueryHelper.BuildWhereSentence(key, options[key], (fieldSentenceOptions === null || fieldSentenceOptions === void 0 ? void 0 : fieldSentenceOptions.fields) || columnFields || fields), _a));
|
|
3386
4005
|
}, {});
|
|
3387
4006
|
if (!Array.isArray(options) && !lodash.isNil(fieldSentenceOptions.fields))
|
|
3388
4007
|
return _a = {},
|
|
3389
4008
|
_a[fieldSentenceOptions.fields[0]] = BindFilterQueryHelper.BuildOperatorSentence(options, fieldSentenceOptions),
|
|
3390
4009
|
_a;
|
|
3391
|
-
if (lodash.isObject(options) && !FilterOptionHelper.CheckIfIsFilterOption(options))
|
|
4010
|
+
if (!Array.isArray(options) && lodash.isObject(options) && !FilterOptionHelper.CheckIfIsFilterOption(options))
|
|
3392
4011
|
options = Object.values(options)[0];
|
|
3393
4012
|
return Array.isArray(options)
|
|
3394
4013
|
? options.reduce(function (whereSentence, option) { return (Object.assign(Object.assign({}, whereSentence), BindFilterQueryHelper.BuildOperatorSentence(option, fieldSentenceOptions))); }, {})
|
|
@@ -3400,16 +4019,20 @@
|
|
|
3400
4019
|
_a[BindFilterQueryHelper.GetHasuraOperator(options, fieldOption)] = FilterOptionHelper.GetValueFromFilter(options, fieldOption),
|
|
3401
4020
|
_a);
|
|
3402
4021
|
};
|
|
3403
|
-
BindFilterQueryHelper.GetHasuraOperator = function (options, fieldOption) {
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
4022
|
+
BindFilterQueryHelper.GetHasuraOperator = function (options, fieldOption) {
|
|
4023
|
+
if (!FilterOptionHelper.CheckIfIsFilterOption(options))
|
|
4024
|
+
return HasuraGraphQLWhere.EQUALS;
|
|
4025
|
+
if (fieldOption.type === HasuraGraphQLColumnType.Jsonb)
|
|
4026
|
+
return BindFilterQueryHelper.GetHasuraJsonbOperator(options);
|
|
4027
|
+
return HasuraGraphQLWhere[Object.keys(HasuraGraphQLWhere).find(function (graphQLOperator) { return graphQLOperator === Object.keys(exports.Where).find(function (operator) { return exports.Where[operator] === (options === null || options === void 0 ? void 0 : options.operator); }); })];
|
|
4028
|
+
};
|
|
4029
|
+
BindFilterQueryHelper.GetHasuraJsonbOperator = function (options) {
|
|
4030
|
+
if (options.operator === exports.Where.IN)
|
|
4031
|
+
return '_contains';
|
|
4032
|
+
if (options.operator === exports.Where.LIKE)
|
|
4033
|
+
return '_has_keys_any';
|
|
4034
|
+
return HasuraGraphQLWhere[Object.keys(HasuraGraphQLWhere).find(function (graphQLOperator) { return graphQLOperator === Object.keys(exports.Where).find(function (operator) { return exports.Where[operator] === (options === null || options === void 0 ? void 0 : options.operator); }); })];
|
|
4035
|
+
};
|
|
3413
4036
|
|
|
3414
4037
|
var GraphQLFieldHelper = /** @class */ (function () {
|
|
3415
4038
|
function GraphQLFieldHelper() {
|
|
@@ -3419,7 +4042,7 @@
|
|
|
3419
4042
|
GraphQLFieldHelper.CheckIsGraphQLParams = function (params) { return !lodash.isString(params) && Array.isArray(params) && params.length >= 0 && !!params[0].operation; };
|
|
3420
4043
|
GraphQLFieldHelper.ConvertModelFieldsToGraphQLFields = function (fields) {
|
|
3421
4044
|
return fields === null || fields === void 0 ? void 0 : fields.map(function (field) {
|
|
3422
|
-
var _b
|
|
4045
|
+
var _b;
|
|
3423
4046
|
if (lodash.isString(field))
|
|
3424
4047
|
return field.toString();
|
|
3425
4048
|
var fieldName = Object.keys(field).shift();
|
|
@@ -3428,22 +4051,9 @@
|
|
|
3428
4051
|
return _b = {}, _b[fieldName] = GraphQLFieldHelper.ConvertModelFieldsToGraphQLFields(fieldValue), _b;
|
|
3429
4052
|
if (!AttributeOptionHelper.CheckIsColumnOption(fieldValue))
|
|
3430
4053
|
return;
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
_c[fieldValue.columnName || fieldName] = GraphQLFieldHelper.ConvertModelFieldsToGraphQLFields(fieldValue.fields),
|
|
3435
|
-
_c) : {
|
|
3436
|
-
operation: fieldValue.columnName || fieldName,
|
|
3437
|
-
fields: GraphQLFieldHelper.ConvertModelFieldsToGraphQLFields(fieldValue.fields),
|
|
3438
|
-
variables: (_d = {},
|
|
3439
|
-
_d[fieldValue.columnName + "_where"] = {
|
|
3440
|
-
name: 'where',
|
|
3441
|
-
type: fieldValue.filters.filterType,
|
|
3442
|
-
value: BindFilterQueryHelper.MakeGraphQLWhere(fieldValue.filters.filters, fieldValue.fields),
|
|
3443
|
-
required: true,
|
|
3444
|
-
},
|
|
3445
|
-
_d),
|
|
3446
|
-
};
|
|
4054
|
+
var isNestedField = !!fieldValue.fields;
|
|
4055
|
+
if (isNestedField)
|
|
4056
|
+
return GraphQLFieldHelper.ConvertNestedFieldsToGraphQLFields(fieldName, fieldValue);
|
|
3447
4057
|
return fieldValue.columnName;
|
|
3448
4058
|
}).filter(function (field) { return !!field; });
|
|
3449
4059
|
};
|
|
@@ -3502,6 +4112,26 @@
|
|
|
3502
4112
|
return Object.assign(Object.assign({}, result), (_d = {}, _d[columnName] = data[attributeName], _d));
|
|
3503
4113
|
}, {});
|
|
3504
4114
|
};
|
|
4115
|
+
GraphQLFieldHelper.ConvertNestedFieldsToGraphQLFields = function (fieldName, fieldValue) {
|
|
4116
|
+
var _b, _c;
|
|
4117
|
+
var hasCustomFilters = !!fieldValue.filters;
|
|
4118
|
+
if (hasCustomFilters)
|
|
4119
|
+
return {
|
|
4120
|
+
operation: fieldValue.columnName || fieldName,
|
|
4121
|
+
fields: GraphQLFieldHelper.ConvertModelFieldsToGraphQLFields(fieldValue.fields),
|
|
4122
|
+
variables: (_b = {},
|
|
4123
|
+
_b[fieldValue.columnName + "_where"] = {
|
|
4124
|
+
name: 'where',
|
|
4125
|
+
type: fieldValue.filters.filterType,
|
|
4126
|
+
value: BindFilterQueryHelper.MakeGraphQLWhere(fieldValue.filters.filters, fieldValue.fields),
|
|
4127
|
+
required: true,
|
|
4128
|
+
},
|
|
4129
|
+
_b),
|
|
4130
|
+
};
|
|
4131
|
+
return _c = {},
|
|
4132
|
+
_c[fieldValue.columnName || fieldName] = GraphQLFieldHelper.ConvertModelFieldsToGraphQLFields(fieldValue.fields),
|
|
4133
|
+
_c;
|
|
4134
|
+
};
|
|
3505
4135
|
|
|
3506
4136
|
var withCreateHasuraGraphQL = function (MixinBase) {
|
|
3507
4137
|
return /** @class */ (function (_super) {
|
|
@@ -3515,6 +4145,7 @@
|
|
|
3515
4145
|
var options = params === null || params === void 0 ? void 0 : params[0];
|
|
3516
4146
|
_this = _super.apply(this, __spreadArray([], __read(params))) || this;
|
|
3517
4147
|
_this.insertGraphQLOperation = (options === null || options === void 0 ? void 0 : options.insertGraphQLOperation) || "insert_" + _this.tableName + "_one";
|
|
4148
|
+
_this.insertAllGraphQLOperation = (options === null || options === void 0 ? void 0 : options.insertAllGraphQLOperation) || "insert_" + _this.tableName;
|
|
3518
4149
|
_this.insertGraphQLObjectType = (options === null || options === void 0 ? void 0 : options.insertGraphQLObjectType) || _this.tableName + "_insert_input";
|
|
3519
4150
|
return _this;
|
|
3520
4151
|
}
|
|
@@ -3523,7 +4154,9 @@
|
|
|
3523
4154
|
var newData;
|
|
3524
4155
|
return __generator(this, function (_b) {
|
|
3525
4156
|
switch (_b.label) {
|
|
3526
|
-
case 0:
|
|
4157
|
+
case 0:
|
|
4158
|
+
this.logger = DebugHelper.from(this, 'create');
|
|
4159
|
+
return [4 /*yield*/, this.save(this.model.toInstance(data))];
|
|
3527
4160
|
case 1:
|
|
3528
4161
|
newData = _b.sent();
|
|
3529
4162
|
return [2 /*return*/, this.model.toInstance(newData)];
|
|
@@ -3531,6 +4164,29 @@
|
|
|
3531
4164
|
});
|
|
3532
4165
|
});
|
|
3533
4166
|
};
|
|
4167
|
+
CreateHasuraGraphQLMixin.prototype.createAll = function (data) {
|
|
4168
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4169
|
+
var result;
|
|
4170
|
+
var _this = this;
|
|
4171
|
+
return __generator(this, function (_b) {
|
|
4172
|
+
switch (_b.label) {
|
|
4173
|
+
case 0:
|
|
4174
|
+
this.logger = DebugHelper.from(this, 'createAll');
|
|
4175
|
+
return [4 /*yield*/, this.mutation(this.insertAllGraphQLOperation, [{ returning: this.model.identifiersFields }], {
|
|
4176
|
+
objects: {
|
|
4177
|
+
type: this.insertGraphQLObjectType,
|
|
4178
|
+
required: true,
|
|
4179
|
+
list: true,
|
|
4180
|
+
value: data.map(function (item) { return _this.convertDataToHasura(item); }),
|
|
4181
|
+
},
|
|
4182
|
+
})];
|
|
4183
|
+
case 1:
|
|
4184
|
+
result = _b.sent();
|
|
4185
|
+
return [2 /*return*/, result[this.insertAllGraphQLOperation].returning.map(function (item, index) { return _this.model.toInstance(Object.assign(Object.assign({}, data[index]), item)); })];
|
|
4186
|
+
}
|
|
4187
|
+
});
|
|
4188
|
+
});
|
|
4189
|
+
};
|
|
3534
4190
|
CreateHasuraGraphQLMixin.prototype.save = function (data) {
|
|
3535
4191
|
return __awaiter(this, void 0, void 0, function () {
|
|
3536
4192
|
var primaryKeyColumns, foreignKeyColumns, result;
|
|
@@ -3548,8 +4204,7 @@
|
|
|
3548
4204
|
(_b = {},
|
|
3549
4205
|
_b[columnOptions.columnName] = Object.keys(columnOptions.foreignKeyColumn).map(function (foreignKeyField) {
|
|
3550
4206
|
var _a;
|
|
3551
|
-
return ((_a = AttributeOptionHelper.FindByAttribute(foreignKeyField, columnOptions === null || columnOptions === void 0 ? void 0 : columnOptions.fields)) === null || _a === void 0 ? void 0 : _a.columnName) ||
|
|
3552
|
-
foreignKeyField;
|
|
4207
|
+
return ((_a = AttributeOptionHelper.FindByAttribute(foreignKeyField, columnOptions === null || columnOptions === void 0 ? void 0 : columnOptions.fields)) === null || _a === void 0 ? void 0 : _a.columnName) || foreignKeyField;
|
|
3553
4208
|
}),
|
|
3554
4209
|
_b),
|
|
3555
4210
|
]));
|
|
@@ -3591,10 +4246,12 @@
|
|
|
3591
4246
|
return __generator(this, function (_a) {
|
|
3592
4247
|
switch (_a.label) {
|
|
3593
4248
|
case 0:
|
|
4249
|
+
this.logger = DebugHelper.from(this, 'delete');
|
|
3594
4250
|
instance = this.model.toInstance(identifiers);
|
|
3595
4251
|
return [4 /*yield*/, this.mutation(this.deleteGraphQLOperation, this.model.identifiersFields.map(function (field) { return AttributeOptionHelper.FindByAttribute(field, _this.fields).columnName; }), this.model.identifiersFields.reduce(function (ids, identifier) {
|
|
3596
4252
|
var _a;
|
|
3597
|
-
|
|
4253
|
+
var identifierBinded = identifier;
|
|
4254
|
+
if (lodash.isNil(instance[identifierBinded]))
|
|
3598
4255
|
return ids;
|
|
3599
4256
|
var columnOption = AttributeOptionHelper.FindByAttribute(identifier, _this.fields);
|
|
3600
4257
|
var value = columnOption.to(identifiers[identifier.toString()], instance);
|
|
@@ -3631,6 +4288,7 @@
|
|
|
3631
4288
|
_this.authOptions = options.authOptions;
|
|
3632
4289
|
_this.model = options.model;
|
|
3633
4290
|
_this.fields = options.fields || _this.model.identifiersFields;
|
|
4291
|
+
_this.logger = DebugHelper.from(_this);
|
|
3634
4292
|
return _this;
|
|
3635
4293
|
}
|
|
3636
4294
|
Object.defineProperty(HasuraGraphQLMixin.prototype, "headers", {
|
|
@@ -3680,6 +4338,7 @@
|
|
|
3680
4338
|
return __generator(this, function (_a) {
|
|
3681
4339
|
switch (_a.label) {
|
|
3682
4340
|
case 0:
|
|
4341
|
+
this.logger.with('params').log(params);
|
|
3683
4342
|
headers = this.headers;
|
|
3684
4343
|
return [4 /*yield*/, axios__default["default"]({
|
|
3685
4344
|
url: "" + this.endpoint,
|
|
@@ -3691,6 +4350,7 @@
|
|
|
3691
4350
|
result = (_a.sent()).data;
|
|
3692
4351
|
if (!lodash.isNil(result.errors))
|
|
3693
4352
|
throw new Error(JSON.stringify(result.errors));
|
|
4353
|
+
this.logger.with('returns').log(result);
|
|
3694
4354
|
return [2 /*return*/, result.data];
|
|
3695
4355
|
}
|
|
3696
4356
|
});
|
|
@@ -3719,8 +4379,8 @@
|
|
|
3719
4379
|
return value;
|
|
3720
4380
|
return date;
|
|
3721
4381
|
};
|
|
3722
|
-
HasuraGraphQLMixin.prototype.convertDataFromHasura = function (data) {
|
|
3723
|
-
var plain = GraphQLFieldHelper.ConvertFieldValueFrom(data, this.fields);
|
|
4382
|
+
HasuraGraphQLMixin.prototype.convertDataFromHasura = function (data, fields) {
|
|
4383
|
+
var plain = GraphQLFieldHelper.ConvertFieldValueFrom(data, fields || this.fields);
|
|
3724
4384
|
return this.model.toInstance(plain);
|
|
3725
4385
|
};
|
|
3726
4386
|
HasuraGraphQLMixin.prototype.convertDataToHasura = function (instance, update) {
|
|
@@ -3763,6 +4423,7 @@
|
|
|
3763
4423
|
return __generator(this, function (_b) {
|
|
3764
4424
|
switch (_b.label) {
|
|
3765
4425
|
case 0:
|
|
4426
|
+
this.logger = DebugHelper.from(this, 'update');
|
|
3766
4427
|
plainData = this.paramsToPlain(data);
|
|
3767
4428
|
return [4 /*yield*/, this.mutation(this.updateGraphQLOperation, this.model.identifiersFields.map(function (field) { return AttributeOptionHelper.FindByAttribute(field, _this.fields).columnName; }), {
|
|
3768
4429
|
_set: {
|
|
@@ -3794,10 +4455,11 @@
|
|
|
3794
4455
|
return this.model.identifiersFields.reduce(function (ids, identifier) {
|
|
3795
4456
|
var _b;
|
|
3796
4457
|
var _a;
|
|
3797
|
-
|
|
4458
|
+
var identifierBinded = identifier;
|
|
4459
|
+
if (lodash.isNil(instance[identifierBinded]))
|
|
3798
4460
|
return ids;
|
|
3799
|
-
var columnOption = AttributeOptionHelper.FindByAttribute(
|
|
3800
|
-
var value = ((_a = columnOption === null || columnOption === void 0 ? void 0 : columnOption.to) === null || _a === void 0 ? void 0 : _a.call(columnOption, data[
|
|
4461
|
+
var columnOption = AttributeOptionHelper.FindByAttribute(identifierBinded, _this.fields);
|
|
4462
|
+
var value = ((_a = columnOption === null || columnOption === void 0 ? void 0 : columnOption.to) === null || _a === void 0 ? void 0 : _a.call(columnOption, data[identifierBinded], instance)) || data[columnOption.attributeName];
|
|
3801
4463
|
return Object.assign(Object.assign({}, ids), (_b = {}, _b[columnOption.columnName] = value, _b));
|
|
3802
4464
|
}, {});
|
|
3803
4465
|
};
|
|
@@ -3826,11 +4488,13 @@
|
|
|
3826
4488
|
return __generator(this, function (_b) {
|
|
3827
4489
|
switch (_b.label) {
|
|
3828
4490
|
case 0:
|
|
4491
|
+
this.logger = DebugHelper.from(this, 'get');
|
|
3829
4492
|
instance = this.model.toInstance(identifiers);
|
|
3830
4493
|
return [4 /*yield*/, this.query(this.getGraphQLOperation, this.fields, this.model.identifiersFields.reduce(function (ids, identifier) {
|
|
3831
4494
|
var _b;
|
|
3832
4495
|
var _a;
|
|
3833
|
-
|
|
4496
|
+
var identifierBinded = identifier;
|
|
4497
|
+
if (lodash.isNil(instance[identifierBinded]))
|
|
3834
4498
|
return ids;
|
|
3835
4499
|
var columnOption = AttributeOptionHelper.FindByAttribute(identifier, _this.fields);
|
|
3836
4500
|
var value = ((_a = columnOption === null || columnOption === void 0 ? void 0 : columnOption.to) === null || _a === void 0 ? void 0 : _a.call(columnOption, identifiers[identifier.toString()], instance)) || identifiers[identifier.toString()];
|
|
@@ -3858,19 +4522,54 @@
|
|
|
3858
4522
|
return /** @class */ (function (_super) {
|
|
3859
4523
|
__extends(FindHasuraGraphQLMixin, _super);
|
|
3860
4524
|
function FindHasuraGraphQLMixin() {
|
|
3861
|
-
|
|
4525
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
4526
|
+
_this.bindOrderByAttributes = function (orderBy, fields) { return Object.keys(orderBy).reduce(function (acc, current) {
|
|
4527
|
+
var _d;
|
|
4528
|
+
return (Object.assign(Object.assign({}, acc), (_d = {}, _d[AttributeOptionHelper.FindByAttribute(current, fields)
|
|
4529
|
+
.columnName] = orderBy[current], _d)));
|
|
4530
|
+
}, {}); };
|
|
4531
|
+
_this.bindAggretageAttributes = function (aggregates, fields) {
|
|
4532
|
+
var _a, _b;
|
|
4533
|
+
return __spreadArray(__spreadArray([], __read((((_a = aggregates === null || aggregates === void 0 ? void 0 : aggregates.minimal) === null || _a === void 0 ? void 0 : _a.length)
|
|
4534
|
+
? [
|
|
4535
|
+
{
|
|
4536
|
+
min: _this.bindAttributesToColumns(aggregates === null || aggregates === void 0 ? void 0 : aggregates.minimal, fields),
|
|
4537
|
+
},
|
|
4538
|
+
]
|
|
4539
|
+
: []))), __read((((_b = aggregates === null || aggregates === void 0 ? void 0 : aggregates.maximum) === null || _b === void 0 ? void 0 : _b.length)
|
|
4540
|
+
? [
|
|
4541
|
+
{
|
|
4542
|
+
max: _this.bindAttributesToColumns(aggregates === null || aggregates === void 0 ? void 0 : aggregates.maximum, fields),
|
|
4543
|
+
},
|
|
4544
|
+
]
|
|
4545
|
+
: [])));
|
|
4546
|
+
};
|
|
4547
|
+
_this.bindAttributesToColumns = function (attributes, fields) { return attributes.map(function (attr) {
|
|
4548
|
+
var _a;
|
|
4549
|
+
return ((_a = AttributeOptionHelper.FindByAttribute(attr.toString().split('.').pop(), fields)) === null || _a === void 0 ? void 0 : _a.columnName) || attr;
|
|
4550
|
+
}); };
|
|
4551
|
+
return _this;
|
|
3862
4552
|
}
|
|
3863
4553
|
FindHasuraGraphQLMixin.prototype.find = function (params) {
|
|
3864
|
-
var _a;
|
|
4554
|
+
var _a, _b, _c;
|
|
3865
4555
|
return __awaiter(this, void 0, void 0, function () {
|
|
3866
|
-
var
|
|
4556
|
+
var _d, filters, limits, orderBy, options, enableCount, variablesCount, variables, aggregateFields, result, data;
|
|
3867
4557
|
var _this = this;
|
|
3868
|
-
return __generator(this, function (
|
|
3869
|
-
switch (
|
|
4558
|
+
return __generator(this, function (_e) {
|
|
4559
|
+
switch (_e.label) {
|
|
3870
4560
|
case 0:
|
|
3871
|
-
|
|
4561
|
+
this.logger = DebugHelper.from(this, 'find');
|
|
4562
|
+
_d = params || {}, filters = _d.filters, limits = _d.limits, orderBy = _d.orderBy, options = _d.options;
|
|
3872
4563
|
enableCount = (_a = options === null || options === void 0 ? void 0 : options.enableCount) !== null && _a !== void 0 ? _a : true;
|
|
3873
|
-
variablesCount = Object.assign(Object.assign({}, (lodash.isNil(orderBy)
|
|
4564
|
+
variablesCount = Object.assign(Object.assign({}, (lodash.isNil(orderBy)
|
|
4565
|
+
? {}
|
|
4566
|
+
: {
|
|
4567
|
+
order_by: {
|
|
4568
|
+
type: this.tableName + "_order_by!",
|
|
4569
|
+
list: true,
|
|
4570
|
+
value: this.bindOrderByAttributes(orderBy, this.fields),
|
|
4571
|
+
},
|
|
4572
|
+
})), (lodash.isNil(filters)
|
|
3874
4573
|
? {}
|
|
3875
4574
|
: {
|
|
3876
4575
|
where: {
|
|
@@ -3880,6 +4579,7 @@
|
|
|
3880
4579
|
},
|
|
3881
4580
|
}));
|
|
3882
4581
|
variables = Object.assign(Object.assign({}, (lodash.isNil(limits) ? {} : limits)), variablesCount);
|
|
4582
|
+
aggregateFields = __spreadArray(__spreadArray([], __read((enableCount ? ['count'] : []))), __read(this.bindAggretageAttributes(params.options, this.fields)));
|
|
3883
4583
|
return [4 /*yield*/, this.query(__spreadArray([
|
|
3884
4584
|
{
|
|
3885
4585
|
operation: this.tableName,
|
|
@@ -3893,19 +4593,37 @@
|
|
|
3893
4593
|
: this.fields,
|
|
3894
4594
|
variables: variables,
|
|
3895
4595
|
}
|
|
3896
|
-
], __read((
|
|
4596
|
+
], __read((aggregateFields.length > 0
|
|
3897
4597
|
? [
|
|
3898
4598
|
{
|
|
3899
4599
|
operation: this.tableName + "_aggregate",
|
|
3900
|
-
fields: [
|
|
4600
|
+
fields: [
|
|
4601
|
+
{
|
|
4602
|
+
aggregate: aggregateFields,
|
|
4603
|
+
},
|
|
4604
|
+
],
|
|
3901
4605
|
variables: variablesCount,
|
|
3902
4606
|
},
|
|
3903
4607
|
]
|
|
3904
4608
|
: []))))];
|
|
3905
4609
|
case 1:
|
|
3906
|
-
result =
|
|
4610
|
+
result = _e.sent();
|
|
3907
4611
|
data = result[this.tableName].map(function (row) { return _this.convertDataFromHasura(row); });
|
|
3908
|
-
return [2 /*return*/, { data: data, count: enableCount ? result[this.tableName + "_aggregate"].aggregate.count : Infinity }
|
|
4612
|
+
return [2 /*return*/, Object.assign(Object.assign({ data: data, count: enableCount ? result[this.tableName + "_aggregate"].aggregate.count : Infinity }, (((_b = options === null || options === void 0 ? void 0 : options.minimal) === null || _b === void 0 ? void 0 : _b.length)
|
|
4613
|
+
? {
|
|
4614
|
+
minimal: options.minimal.reduce(function (minimals, current) {
|
|
4615
|
+
var _a;
|
|
4616
|
+
return (Object.assign(Object.assign({}, minimals), lodash.set(minimals, current, result[_this.tableName + "_aggregate"].aggregate.min[((_a = AttributeOptionHelper.FindByAttribute(current.toString().split('.').pop(), _this.fields)) === null || _a === void 0 ? void 0 : _a.columnName) || current])));
|
|
4617
|
+
}, {}),
|
|
4618
|
+
}
|
|
4619
|
+
: {})), (((_c = options === null || options === void 0 ? void 0 : options.maximum) === null || _c === void 0 ? void 0 : _c.length)
|
|
4620
|
+
? {
|
|
4621
|
+
maximum: options.maximum.reduce(function (maximums, current) {
|
|
4622
|
+
var _a;
|
|
4623
|
+
return (Object.assign(Object.assign({}, maximums), lodash.set(maximums, current, result[_this.tableName + "_aggregate"].aggregate.max[((_a = AttributeOptionHelper.FindByAttribute(current.toString().split('.').pop(), _this.fields)) === null || _a === void 0 ? void 0 : _a.columnName) || current])));
|
|
4624
|
+
}, {}),
|
|
4625
|
+
}
|
|
4626
|
+
: {}))];
|
|
3909
4627
|
}
|
|
3910
4628
|
});
|
|
3911
4629
|
});
|
|
@@ -3971,6 +4689,43 @@
|
|
|
3971
4689
|
return VariantHasuraGraphQL;
|
|
3972
4690
|
}(Variant));
|
|
3973
4691
|
|
|
4692
|
+
var CategoryCollectionChildrenHasuraGraphQLRepository = /** @class */ (function (_super) {
|
|
4693
|
+
__extends(CategoryCollectionChildrenHasuraGraphQLRepository, _super);
|
|
4694
|
+
function CategoryCollectionChildrenHasuraGraphQLRepository(endpoint, authOptions) {
|
|
4695
|
+
return _super.call(this, {
|
|
4696
|
+
tableName: 'category_collection_children',
|
|
4697
|
+
model: CategoryCollectionChildren,
|
|
4698
|
+
endpoint: endpoint,
|
|
4699
|
+
authOptions: authOptions,
|
|
4700
|
+
fields: [
|
|
4701
|
+
{ collectionId: { columnName: 'collection_id' } },
|
|
4702
|
+
{ categoryId: { columnName: 'category_id' } },
|
|
4703
|
+
'name',
|
|
4704
|
+
'slug',
|
|
4705
|
+
'reference',
|
|
4706
|
+
{ parentCollectionId: { columnName: 'parent_collection_id' } },
|
|
4707
|
+
{ parentCategoryId: { columnName: 'parent_category_id' } },
|
|
4708
|
+
{
|
|
4709
|
+
parent: {
|
|
4710
|
+
columnName: 'parent',
|
|
4711
|
+
foreignKeyColumn: { collectionId: 'parentCollectionId', categoryId: 'parentCategoryId' },
|
|
4712
|
+
fields: [
|
|
4713
|
+
{ collectionId: { columnName: 'collection_id' } },
|
|
4714
|
+
{ categoryId: { columnName: 'category_id' } },
|
|
4715
|
+
'name',
|
|
4716
|
+
'slug',
|
|
4717
|
+
'reference',
|
|
4718
|
+
{ parentCollectionId: { columnName: 'parent_collection_id' } },
|
|
4719
|
+
{ parentCategoryId: { columnName: 'parent_category_id' } },
|
|
4720
|
+
],
|
|
4721
|
+
},
|
|
4722
|
+
},
|
|
4723
|
+
],
|
|
4724
|
+
}) || this;
|
|
4725
|
+
}
|
|
4726
|
+
return CategoryCollectionChildrenHasuraGraphQLRepository;
|
|
4727
|
+
}(withCrudHasuraGraphQL(withHasuraGraphQL(Base))));
|
|
4728
|
+
|
|
3974
4729
|
var CategoryFilterHasuraGraphQLRepository = /** @class */ (function (_super) {
|
|
3975
4730
|
__extends(CategoryFilterHasuraGraphQLRepository, _super);
|
|
3976
4731
|
function CategoryFilterHasuraGraphQLRepository(endpoint, authOptions) {
|
|
@@ -3979,7 +4734,80 @@
|
|
|
3979
4734
|
model: CategoryFilter,
|
|
3980
4735
|
endpoint: endpoint,
|
|
3981
4736
|
authOptions: authOptions,
|
|
3982
|
-
fields: [
|
|
4737
|
+
fields: [
|
|
4738
|
+
'id',
|
|
4739
|
+
{ filterId: { columnName: 'filter_id' } },
|
|
4740
|
+
{ categoryId: { columnName: 'category_id' } },
|
|
4741
|
+
{
|
|
4742
|
+
filter: {
|
|
4743
|
+
columnName: 'filter',
|
|
4744
|
+
foreignKeyColumn: { id: 'filterId' },
|
|
4745
|
+
fields: [
|
|
4746
|
+
'id',
|
|
4747
|
+
'description',
|
|
4748
|
+
'slug',
|
|
4749
|
+
'enabled',
|
|
4750
|
+
{ createdAt: { columnName: 'created_at' } },
|
|
4751
|
+
{ updatedAt: { columnName: 'updated_at' } },
|
|
4752
|
+
{
|
|
4753
|
+
options: {
|
|
4754
|
+
columnName: 'options',
|
|
4755
|
+
foreignKeyColumn: { filterId: 'id' },
|
|
4756
|
+
fields: [
|
|
4757
|
+
'id',
|
|
4758
|
+
{ filterId: { columnName: 'filter_id' } },
|
|
4759
|
+
'description',
|
|
4760
|
+
{ createdAt: { columnName: 'created_at' } },
|
|
4761
|
+
{ updatedAt: { columnName: 'updated_at' } },
|
|
4762
|
+
],
|
|
4763
|
+
},
|
|
4764
|
+
},
|
|
4765
|
+
],
|
|
4766
|
+
},
|
|
4767
|
+
},
|
|
4768
|
+
{
|
|
4769
|
+
category: {
|
|
4770
|
+
columnName: 'category',
|
|
4771
|
+
foreignKeyColumn: { id: 'categoryId' },
|
|
4772
|
+
fields: [
|
|
4773
|
+
'id',
|
|
4774
|
+
'description',
|
|
4775
|
+
{
|
|
4776
|
+
products: {
|
|
4777
|
+
columnName: 'products',
|
|
4778
|
+
fields: ['product_id'],
|
|
4779
|
+
from: function (value) { return value.map(function (product) { return product.product_id.toString(); }); },
|
|
4780
|
+
to: function (productIds) { return productIds.map(function (productId) { return ({
|
|
4781
|
+
product_id: +productId,
|
|
4782
|
+
}); }); },
|
|
4783
|
+
},
|
|
4784
|
+
},
|
|
4785
|
+
{
|
|
4786
|
+
childrenProducts: {
|
|
4787
|
+
columnName: 'children_products',
|
|
4788
|
+
foreignKeyColumn: { category_id: 'id' },
|
|
4789
|
+
fields: [
|
|
4790
|
+
'id',
|
|
4791
|
+
'name',
|
|
4792
|
+
'slug',
|
|
4793
|
+
{
|
|
4794
|
+
categories: {
|
|
4795
|
+
columnName: 'categories',
|
|
4796
|
+
fields: ['category_id'],
|
|
4797
|
+
bindPersistData: function (value) { return ({
|
|
4798
|
+
categories: { data: value.map(function (category) { return ({ category_id: +category }); }) },
|
|
4799
|
+
}); },
|
|
4800
|
+
to: function (categories) { return categories.map(function (categoryId) { return +categoryId; }); },
|
|
4801
|
+
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(); })) || []; },
|
|
4802
|
+
},
|
|
4803
|
+
},
|
|
4804
|
+
],
|
|
4805
|
+
},
|
|
4806
|
+
},
|
|
4807
|
+
],
|
|
4808
|
+
},
|
|
4809
|
+
},
|
|
4810
|
+
],
|
|
3983
4811
|
}) || this;
|
|
3984
4812
|
}
|
|
3985
4813
|
CategoryFilterHasuraGraphQLRepository.prototype.deleteByCategoryAndFilter = function (categoryId, filterId) {
|
|
@@ -4010,6 +4838,7 @@
|
|
|
4010
4838
|
'image',
|
|
4011
4839
|
'published',
|
|
4012
4840
|
'shop',
|
|
4841
|
+
{ shops: { columnName: 'shops', type: HasuraGraphQLColumnType.Jsonb } },
|
|
4013
4842
|
'slug',
|
|
4014
4843
|
{ brandCategory: { columnName: 'brand_category' } },
|
|
4015
4844
|
{ brandCategoryBanner: { columnName: 'brand_banner' } },
|
|
@@ -4172,7 +5001,16 @@
|
|
|
4172
5001
|
case 0:
|
|
4173
5002
|
if (!slug)
|
|
4174
5003
|
return [2 /*return*/];
|
|
4175
|
-
return [4 /*yield*/, this.find({
|
|
5004
|
+
return [4 /*yield*/, this.find({
|
|
5005
|
+
filters: {
|
|
5006
|
+
slug: slug,
|
|
5007
|
+
shops: { operator: exports.Where.IN, value: [shop] },
|
|
5008
|
+
published: { operator: exports.Where.EQUALS, value: true },
|
|
5009
|
+
},
|
|
5010
|
+
options: {
|
|
5011
|
+
enableCount: false,
|
|
5012
|
+
},
|
|
5013
|
+
})];
|
|
4176
5014
|
case 1:
|
|
4177
5015
|
data = (_c.sent()).data;
|
|
4178
5016
|
if (!data.length)
|
|
@@ -4184,6 +5022,30 @@
|
|
|
4184
5022
|
});
|
|
4185
5023
|
});
|
|
4186
5024
|
};
|
|
5025
|
+
CategoryHasuraGraphQLRepository.prototype.getCategoryByShop = function (shop) {
|
|
5026
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5027
|
+
var data;
|
|
5028
|
+
return __generator(this, function (_c) {
|
|
5029
|
+
switch (_c.label) {
|
|
5030
|
+
case 0:
|
|
5031
|
+
if (!shop)
|
|
5032
|
+
return [2 /*return*/];
|
|
5033
|
+
return [4 /*yield*/, this.find({
|
|
5034
|
+
filters: {
|
|
5035
|
+
shops: { operator: exports.Where.IN, value: [shop] },
|
|
5036
|
+
published: { operator: exports.Where.EQUALS, value: true },
|
|
5037
|
+
},
|
|
5038
|
+
options: {
|
|
5039
|
+
enableCount: false,
|
|
5040
|
+
},
|
|
5041
|
+
})];
|
|
5042
|
+
case 1:
|
|
5043
|
+
data = (_c.sent()).data;
|
|
5044
|
+
return [2 /*return*/, data];
|
|
5045
|
+
}
|
|
5046
|
+
});
|
|
5047
|
+
});
|
|
5048
|
+
};
|
|
4187
5049
|
CategoryHasuraGraphQLRepository.prototype.getCategoriesForHome = function (categoryIds, limit, gender) {
|
|
4188
5050
|
if (limit === void 0) { limit = 4; }
|
|
4189
5051
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -4491,6 +5353,38 @@
|
|
|
4491
5353
|
});
|
|
4492
5354
|
});
|
|
4493
5355
|
};
|
|
5356
|
+
CategoryHasuraGraphQLRepository.prototype.getChildren = function (parentId) {
|
|
5357
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5358
|
+
var category_tree;
|
|
5359
|
+
return __generator(this, function (_c) {
|
|
5360
|
+
switch (_c.label) {
|
|
5361
|
+
case 0: return [4 /*yield*/, this.query('category_tree', ['id', 'name', 'parent_id'], {
|
|
5362
|
+
args: {
|
|
5363
|
+
type: 'category_tree_args',
|
|
5364
|
+
value: { parentid: parentId },
|
|
5365
|
+
required: true,
|
|
5366
|
+
},
|
|
5367
|
+
})];
|
|
5368
|
+
case 1:
|
|
5369
|
+
category_tree = (_c.sent()).category_tree;
|
|
5370
|
+
return [2 /*return*/, category_tree.map(function (category) { return Category.toInstance(category); })];
|
|
5371
|
+
}
|
|
5372
|
+
});
|
|
5373
|
+
});
|
|
5374
|
+
};
|
|
5375
|
+
CategoryHasuraGraphQLRepository.prototype.isChild = function (id, parentId) {
|
|
5376
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5377
|
+
var categoryTree;
|
|
5378
|
+
return __generator(this, function (_c) {
|
|
5379
|
+
switch (_c.label) {
|
|
5380
|
+
case 0: return [4 /*yield*/, this.getChildren(parentId)];
|
|
5381
|
+
case 1:
|
|
5382
|
+
categoryTree = _c.sent();
|
|
5383
|
+
return [2 /*return*/, categoryTree.some(function (c) { return c.id == id.toString(); })];
|
|
5384
|
+
}
|
|
5385
|
+
});
|
|
5386
|
+
});
|
|
5387
|
+
};
|
|
4494
5388
|
return CategoryHasuraGraphQLRepository;
|
|
4495
5389
|
}(withCrudHasuraGraphQL(withHasuraGraphQL(Base))));
|
|
4496
5390
|
|
|
@@ -4744,26 +5638,29 @@
|
|
|
4744
5638
|
whoMustUse: data.who_must_use,
|
|
4745
5639
|
howToUse: data.how_to_use,
|
|
4746
5640
|
brand: data.brand_description,
|
|
5641
|
+
ingredients: data.ingredients,
|
|
4747
5642
|
}); },
|
|
4748
|
-
bindFindFilter: function (
|
|
4749
|
-
|
|
4750
|
-
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, ((filters === null || filters === void 0 ? void 0 : filters.description) && { description: filters.description })), (filters.differentials && { differentials: filters.differentials })), (filters.whoMustUse && {
|
|
5643
|
+
bindFindFilter: function (filters) {
|
|
5644
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, ((filters === null || filters === void 0 ? void 0 : filters.description) && { description: filters.description })), (filters.differentials && { differentials: filters.differentials })), (filters.whoMustUse && {
|
|
4751
5645
|
who_must_use: filters.whoMustUse,
|
|
4752
5646
|
})), (filters.howToUse && {
|
|
4753
5647
|
how_to_use: filters.howToUse,
|
|
4754
5648
|
})), (filters.brand && {
|
|
4755
5649
|
brand_description: filters.brand,
|
|
5650
|
+
})), (filters.ingredients && {
|
|
5651
|
+
ingredients: filters.ingredients,
|
|
4756
5652
|
}));
|
|
4757
5653
|
},
|
|
4758
|
-
bindPersistData: function (descriptionData) { return (Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, ((descriptionData === null || descriptionData === void 0 ? void 0 : descriptionData.description) && { description: descriptionData.description })), (descriptionData.differentials && { differentials: descriptionData.differentials })), (descriptionData.whoMustUse && {
|
|
5654
|
+
bindPersistData: function (descriptionData) { return (Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, ((descriptionData === null || descriptionData === void 0 ? void 0 : descriptionData.description) && { description: descriptionData.description })), (descriptionData.differentials && { differentials: descriptionData.differentials })), (descriptionData.whoMustUse && {
|
|
4759
5655
|
who_must_use: descriptionData.whoMustUse,
|
|
4760
|
-
})), (descriptionData.howToUse && { how_to_use: descriptionData.howToUse })), (descriptionData.brand && { brand_description: descriptionData.brand }))); },
|
|
5656
|
+
})), (descriptionData.howToUse && { how_to_use: descriptionData.howToUse })), (descriptionData.brand && { brand_description: descriptionData.brand })), (descriptionData.ingredients && { ingredients: descriptionData.ingredients }))); },
|
|
4761
5657
|
},
|
|
4762
5658
|
},
|
|
4763
5659
|
{ differentials: { columnName: 'differentials' } },
|
|
4764
5660
|
{ whoMustUse: { columnName: 'who_must_use' } },
|
|
4765
5661
|
{ howToUse: { columnName: 'how_to_use' } },
|
|
4766
5662
|
{ brandDescription: { columnName: 'brand_description' } },
|
|
5663
|
+
{ ingredients: { columnName: 'ingredients' } },
|
|
4767
5664
|
{ hasVariants: { columnName: 'has_variants' } },
|
|
4768
5665
|
{
|
|
4769
5666
|
images: {
|
|
@@ -4787,8 +5684,7 @@
|
|
|
4787
5684
|
subscriberDiscountPercentage: data.subscriber_discount_percentage,
|
|
4788
5685
|
subscriberPrice: data.subscriber_price,
|
|
4789
5686
|
}); },
|
|
4790
|
-
bindFindFilter: function (
|
|
4791
|
-
var filters = Object.values(sentence).shift();
|
|
5687
|
+
bindFindFilter: function (filters) {
|
|
4792
5688
|
return Object.assign(Object.assign(Object.assign(Object.assign({}, (((filters === null || filters === void 0 ? void 0 : filters.price) || (filters === null || filters === void 0 ? void 0 : filters.price) === 0) && { price: filters.price })), ((filters.fullPrice || filters.fullPrice === 0) && { full_price: filters.fullPrice })), ((filters.subscriberDiscountPercentage || filters.subscriberDiscountPercentage === 0) && {
|
|
4793
5689
|
subscriber_discount_percentage: filters.subscriberDiscountPercentage,
|
|
4794
5690
|
})), ((filters.subscriberPrice || filters.subscriberPrice === 0) && {
|
|
@@ -4812,11 +5708,13 @@
|
|
|
4812
5708
|
to: function (value) { return (lodash.isNil(value === null || value === void 0 ? void 0 : value.quantity) ? value : value === null || value === void 0 ? void 0 : value.quantity); },
|
|
4813
5709
|
},
|
|
4814
5710
|
},
|
|
5711
|
+
{ hasStock: { columnName: 'has_stock' } },
|
|
4815
5712
|
'slug',
|
|
4816
5713
|
'type',
|
|
4817
5714
|
'video',
|
|
4818
5715
|
'weight',
|
|
4819
5716
|
'gender',
|
|
5717
|
+
{ intGender: { columnName: 'int_gender' } },
|
|
4820
5718
|
{ tags: { columnName: 'tags', type: HasuraGraphQLColumnType.Jsonb } },
|
|
4821
5719
|
{ filters: { columnName: 'filters', type: HasuraGraphQLColumnType.Jsonb } },
|
|
4822
5720
|
{ isKit: { columnName: 'is_kit' } },
|
|
@@ -4904,32 +5802,32 @@
|
|
|
4904
5802
|
create: { get: function () { return _super_1.prototype.create; } }
|
|
4905
5803
|
});
|
|
4906
5804
|
return __awaiter(this, void 0, void 0, function () {
|
|
4907
|
-
var metadata, data, product,
|
|
4908
|
-
return __generator(this, function (
|
|
4909
|
-
switch (
|
|
5805
|
+
var metadata, data, product, _p, _q, error_1;
|
|
5806
|
+
return __generator(this, function (_r) {
|
|
5807
|
+
switch (_r.label) {
|
|
4910
5808
|
case 0:
|
|
4911
5809
|
metadata = params.metadata, data = __rest(params, ["metadata"]);
|
|
4912
5810
|
return [4 /*yield*/, _super.create.call(this, lodash.omit(Object.assign(Object.assign({}, data), { metadata: metadata || { description: null, title: null } }), ['reviews']))];
|
|
4913
5811
|
case 1:
|
|
4914
|
-
product =
|
|
4915
|
-
|
|
5812
|
+
product = _r.sent();
|
|
5813
|
+
_r.label = 2;
|
|
4916
5814
|
case 2:
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
if (!
|
|
5815
|
+
_r.trys.push([2, 5, , 7]);
|
|
5816
|
+
_p = product;
|
|
5817
|
+
_q = data.reviews;
|
|
5818
|
+
if (!_q) return [3 /*break*/, 4];
|
|
4921
5819
|
return [4 /*yield*/, this.updateReviews(+product.id, data)];
|
|
4922
5820
|
case 3:
|
|
4923
|
-
|
|
4924
|
-
|
|
5821
|
+
_q = (_r.sent());
|
|
5822
|
+
_r.label = 4;
|
|
4925
5823
|
case 4:
|
|
4926
|
-
|
|
5824
|
+
_p.reviews = _q;
|
|
4927
5825
|
return [3 /*break*/, 7];
|
|
4928
5826
|
case 5:
|
|
4929
|
-
error_1 =
|
|
5827
|
+
error_1 = _r.sent();
|
|
4930
5828
|
return [4 /*yield*/, this.delete({ id: product.id })];
|
|
4931
5829
|
case 6:
|
|
4932
|
-
|
|
5830
|
+
_r.sent();
|
|
4933
5831
|
throw error_1;
|
|
4934
5832
|
case 7: return [2 /*return*/, product];
|
|
4935
5833
|
}
|
|
@@ -4942,32 +5840,32 @@
|
|
|
4942
5840
|
});
|
|
4943
5841
|
var _a;
|
|
4944
5842
|
return __awaiter(this, void 0, void 0, function () {
|
|
4945
|
-
var product,
|
|
4946
|
-
return __generator(this, function (
|
|
4947
|
-
switch (
|
|
5843
|
+
var product, _p, _q, _r;
|
|
5844
|
+
return __generator(this, function (_s) {
|
|
5845
|
+
switch (_s.label) {
|
|
4948
5846
|
case 0:
|
|
4949
5847
|
if (!Number.isNaN(+identifiers.id)) return [3 /*break*/, 2];
|
|
4950
5848
|
return [4 /*yield*/, this.find({ filters: { firestoreId: identifiers.id }, options: { enableCount: false } })];
|
|
4951
5849
|
case 1:
|
|
4952
|
-
|
|
5850
|
+
_p = (_a = (_s.sent()).data) === null || _a === void 0 ? void 0 : _a[0];
|
|
4953
5851
|
return [3 /*break*/, 4];
|
|
4954
5852
|
case 2: return [4 /*yield*/, _super.get.call(this, identifiers)];
|
|
4955
5853
|
case 3:
|
|
4956
|
-
|
|
4957
|
-
|
|
5854
|
+
_p = _s.sent();
|
|
5855
|
+
_s.label = 4;
|
|
4958
5856
|
case 4:
|
|
4959
|
-
product =
|
|
5857
|
+
product = _p;
|
|
4960
5858
|
if (product.productId)
|
|
4961
5859
|
throw new NotFoundError('Product not found, it is a variant');
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
if (
|
|
5860
|
+
_q = product;
|
|
5861
|
+
_r = product.reviews;
|
|
5862
|
+
if (_r) return [3 /*break*/, 6];
|
|
4965
5863
|
return [4 /*yield*/, this.findReviewsByProduct(+product.id)];
|
|
4966
5864
|
case 5:
|
|
4967
|
-
|
|
4968
|
-
|
|
5865
|
+
_r = (_s.sent());
|
|
5866
|
+
_s.label = 6;
|
|
4969
5867
|
case 6:
|
|
4970
|
-
|
|
5868
|
+
_q.reviews = _r;
|
|
4971
5869
|
return [2 /*return*/, product];
|
|
4972
5870
|
}
|
|
4973
5871
|
});
|
|
@@ -4977,14 +5875,21 @@
|
|
|
4977
5875
|
var _super = Object.create(null, {
|
|
4978
5876
|
find: { get: function () { return _super_1.prototype.find; } }
|
|
4979
5877
|
});
|
|
5878
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
4980
5879
|
return __awaiter(this, void 0, void 0, function () {
|
|
4981
|
-
var
|
|
4982
|
-
return __generator(this, function (
|
|
4983
|
-
|
|
5880
|
+
var _o, filters, fields, options, bindFields;
|
|
5881
|
+
return __generator(this, function (_p) {
|
|
5882
|
+
_o = params || {}, filters = _o.filters, fields = _o.fields, options = __rest(_o, ["filters", "fields"]);
|
|
4984
5883
|
bindFields = fields ||
|
|
4985
5884
|
this.fields
|
|
4986
5885
|
.map(function (field) { return (typeof field === 'string' ? field : Object.keys(field).shift()); })
|
|
4987
5886
|
.filter(function (field) { return field !== 'reviews'; });
|
|
5887
|
+
if ((_b = (_a = options.options) === null || _a === void 0 ? void 0 : _a.minimal) === null || _b === void 0 ? void 0 : _b.includes('price'))
|
|
5888
|
+
(_c = options.options) === null || _c === void 0 ? void 0 : _c.minimal.push('price.price', 'price.fullPrice', 'price.subscriberPrice');
|
|
5889
|
+
if ((_e = (_d = options.options) === null || _d === void 0 ? void 0 : _d.maximum) === null || _e === void 0 ? void 0 : _e.includes('price'))
|
|
5890
|
+
(_f = options.options) === null || _f === void 0 ? void 0 : _f.maximum.push('price.price', 'price.fullPrice', 'price.subscriberPrice');
|
|
5891
|
+
(_h = (_g = options.options) === null || _g === void 0 ? void 0 : _g.minimal) === null || _h === void 0 ? void 0 : _h.splice((_j = options.options) === null || _j === void 0 ? void 0 : _j.minimal.indexOf('price'), 1);
|
|
5892
|
+
(_l = (_k = options.options) === null || _k === void 0 ? void 0 : _k.maximum) === null || _l === void 0 ? void 0 : _l.splice((_m = options.options) === null || _m === void 0 ? void 0 : _m.maximum.indexOf('price'), 1);
|
|
4988
5893
|
return [2 /*return*/, _super.find.call(this, Object.assign(Object.assign({}, options), { filters: Object.assign(Object.assign({}, filters), { productId: { operator: exports.Where.ISNULL } }), fields: __spreadArray(__spreadArray([], __read(bindFields)), __read((bindFields.includes('price')
|
|
4989
5894
|
? [
|
|
4990
5895
|
'subscriberPrice',
|
|
@@ -4999,8 +5904,8 @@
|
|
|
4999
5904
|
var _a;
|
|
5000
5905
|
return __awaiter(this, void 0, void 0, function () {
|
|
5001
5906
|
var result, product;
|
|
5002
|
-
return __generator(this, function (
|
|
5003
|
-
switch (
|
|
5907
|
+
return __generator(this, function (_p) {
|
|
5908
|
+
switch (_p.label) {
|
|
5004
5909
|
case 0: return [4 /*yield*/, this.find({
|
|
5005
5910
|
filters: {
|
|
5006
5911
|
slug: slug,
|
|
@@ -5011,8 +5916,9 @@
|
|
|
5011
5916
|
},
|
|
5012
5917
|
})];
|
|
5013
5918
|
case 1:
|
|
5014
|
-
result =
|
|
5919
|
+
result = _p.sent();
|
|
5015
5920
|
product = (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.shift();
|
|
5921
|
+
RoundProductPricesHelper.roundProductPrices(product);
|
|
5016
5922
|
return [2 /*return*/, product];
|
|
5017
5923
|
}
|
|
5018
5924
|
});
|
|
@@ -5023,54 +5929,54 @@
|
|
|
5023
5929
|
update: { get: function () { return _super_1.prototype.update; } }
|
|
5024
5930
|
});
|
|
5025
5931
|
return __awaiter(this, void 0, void 0, function () {
|
|
5026
|
-
var categories, kitProducts, reviews, checkId, rate, metadata, data, plainData, id, product,
|
|
5027
|
-
return __generator(this, function (
|
|
5028
|
-
switch (
|
|
5932
|
+
var categories, kitProducts, reviews, checkId, rate, metadata, data, plainData, id, product, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
5933
|
+
return __generator(this, function (_x) {
|
|
5934
|
+
switch (_x.label) {
|
|
5029
5935
|
case 0:
|
|
5030
5936
|
categories = params.categories, kitProducts = params.kitProducts, reviews = params.reviews, checkId = params.id, rate = params.rate, metadata = params.metadata, data = __rest(params, ["categories", "kitProducts", "reviews", "id", "rate", "metadata"]);
|
|
5031
5937
|
plainData = this.paramsToPlain({ id: checkId });
|
|
5032
5938
|
return [4 /*yield*/, this.getId(plainData.id)];
|
|
5033
5939
|
case 1:
|
|
5034
|
-
id =
|
|
5940
|
+
id = _x.sent();
|
|
5035
5941
|
return [4 /*yield*/, _super.update.call(this, Object.assign({ id: id }, data))];
|
|
5036
5942
|
case 2:
|
|
5037
|
-
product =
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
if (!
|
|
5943
|
+
product = _x.sent();
|
|
5944
|
+
_p = product;
|
|
5945
|
+
_q = categories;
|
|
5946
|
+
if (!_q) return [3 /*break*/, 4];
|
|
5041
5947
|
return [4 /*yield*/, this.updateCategories(+id, { categories: categories })];
|
|
5042
5948
|
case 3:
|
|
5043
|
-
|
|
5044
|
-
|
|
5949
|
+
_q = (_x.sent());
|
|
5950
|
+
_x.label = 4;
|
|
5045
5951
|
case 4:
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
if (!
|
|
5952
|
+
_p.categories = _q;
|
|
5953
|
+
_r = product;
|
|
5954
|
+
_s = kitProducts;
|
|
5955
|
+
if (!_s) return [3 /*break*/, 6];
|
|
5050
5956
|
return [4 /*yield*/, this.updateKitProducts(+id, { kitProducts: kitProducts })];
|
|
5051
5957
|
case 5:
|
|
5052
|
-
|
|
5053
|
-
|
|
5958
|
+
_s = (_x.sent());
|
|
5959
|
+
_x.label = 6;
|
|
5054
5960
|
case 6:
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
if (!
|
|
5961
|
+
_r.kitProducts = _s;
|
|
5962
|
+
_t = product;
|
|
5963
|
+
_u = reviews;
|
|
5964
|
+
if (!_u) return [3 /*break*/, 8];
|
|
5059
5965
|
return [4 /*yield*/, this.updateReviews(+id, { reviews: reviews })];
|
|
5060
5966
|
case 7:
|
|
5061
|
-
|
|
5062
|
-
|
|
5967
|
+
_u = (_x.sent());
|
|
5968
|
+
_x.label = 8;
|
|
5063
5969
|
case 8:
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
if (!
|
|
5970
|
+
_t.reviews = _u;
|
|
5971
|
+
_v = product;
|
|
5972
|
+
_w = metadata;
|
|
5973
|
+
if (!_w) return [3 /*break*/, 10];
|
|
5068
5974
|
return [4 /*yield*/, this.updateMetadata(+id, { metadata: metadata })];
|
|
5069
5975
|
case 9:
|
|
5070
|
-
|
|
5071
|
-
|
|
5976
|
+
_w = (_x.sent());
|
|
5977
|
+
_x.label = 10;
|
|
5072
5978
|
case 10:
|
|
5073
|
-
|
|
5979
|
+
_v.metadata = _w;
|
|
5074
5980
|
return [2 /*return*/, product];
|
|
5075
5981
|
}
|
|
5076
5982
|
});
|
|
@@ -5079,20 +5985,20 @@
|
|
|
5079
5985
|
ProductHasuraGraphQLRepository.prototype.fetchReviews = function (status) {
|
|
5080
5986
|
return __awaiter(this, void 0, void 0, function () {
|
|
5081
5987
|
var reviewsExpression, data;
|
|
5082
|
-
var
|
|
5988
|
+
var _p, _q;
|
|
5083
5989
|
var _this = this;
|
|
5084
|
-
return __generator(this, function (
|
|
5085
|
-
switch (
|
|
5990
|
+
return __generator(this, function (_r) {
|
|
5991
|
+
switch (_r.label) {
|
|
5086
5992
|
case 0:
|
|
5087
5993
|
reviewsExpression = {
|
|
5088
5994
|
status: status === 'pending'
|
|
5089
|
-
? (
|
|
5995
|
+
? (_p = {}, _p[HasuraGraphQLWhere.ISNULL] = true, _p) : (_q = {}, _q[HasuraGraphQLWhere.EQUALS] = status === 'approved', _q),
|
|
5090
5996
|
};
|
|
5091
5997
|
return [4 /*yield*/, this.query('product', ['id', 'name', 'sku', { reviews: { columnName: 'reviews', fields: this.reviewsFields } }], {
|
|
5092
5998
|
where: { value: { reviews: reviewsExpression }, type: 'product_bool_exp', required: true },
|
|
5093
5999
|
})];
|
|
5094
6000
|
case 1:
|
|
5095
|
-
data = (
|
|
6001
|
+
data = (_r.sent()).product;
|
|
5096
6002
|
return [2 /*return*/, data.reduce(function (reviews, product) { return __spreadArray(__spreadArray([], __read(reviews)), __read(product.reviews
|
|
5097
6003
|
.filter(function (review) { return (status === 'pending' && [undefined, null].includes(review.status)) ||
|
|
5098
6004
|
(status === 'approved' && review.status === true) ||
|
|
@@ -5102,12 +6008,19 @@
|
|
|
5102
6008
|
});
|
|
5103
6009
|
});
|
|
5104
6010
|
};
|
|
5105
|
-
ProductHasuraGraphQLRepository.prototype.
|
|
5106
|
-
|
|
6011
|
+
ProductHasuraGraphQLRepository.prototype.findCatalog = function (params, mainGender) {
|
|
6012
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
6013
|
+
return __generator(this, function (_p) {
|
|
6014
|
+
return [2 /*return*/, this.find(Object.assign(Object.assign({}, params), { filters: Object.assign(Object.assign({}, params.filters), { published: true }), orderBy: Object.assign({ hasStock: 'desc', intGender: mainGender === 'female' ? 'desc' : 'asc' }, lodash.omit(params.orderBy, ['hasStock', 'intGender'])) }))];
|
|
6015
|
+
});
|
|
6016
|
+
});
|
|
6017
|
+
};
|
|
6018
|
+
ProductHasuraGraphQLRepository.prototype.updateCategories = function (productId, _p) {
|
|
6019
|
+
var categories = _p.categories;
|
|
5107
6020
|
return __awaiter(this, void 0, void 0, function () {
|
|
5108
6021
|
var plainData;
|
|
5109
|
-
return __generator(this, function (
|
|
5110
|
-
switch (
|
|
6022
|
+
return __generator(this, function (_p) {
|
|
6023
|
+
switch (_p.label) {
|
|
5111
6024
|
case 0:
|
|
5112
6025
|
if (!('action' in categories && categories.action === 'remove')) return [3 /*break*/, 2];
|
|
5113
6026
|
return [4 /*yield*/, this.mutation('delete_category_product', ['affected_rows'], {
|
|
@@ -5118,7 +6031,7 @@
|
|
|
5118
6031
|
},
|
|
5119
6032
|
})];
|
|
5120
6033
|
case 1:
|
|
5121
|
-
|
|
6034
|
+
_p.sent();
|
|
5122
6035
|
return [2 /*return*/, []];
|
|
5123
6036
|
case 2:
|
|
5124
6037
|
plainData = this.paramsToPlain({ categories: categories });
|
|
@@ -5132,7 +6045,7 @@
|
|
|
5132
6045
|
},
|
|
5133
6046
|
})];
|
|
5134
6047
|
case 3:
|
|
5135
|
-
|
|
6048
|
+
_p.sent();
|
|
5136
6049
|
return [4 /*yield*/, this.mutation('insert_category_product', ['affected_rows'], {
|
|
5137
6050
|
objects: {
|
|
5138
6051
|
type: '[category_product_insert_input!]',
|
|
@@ -5141,18 +6054,18 @@
|
|
|
5141
6054
|
},
|
|
5142
6055
|
})];
|
|
5143
6056
|
case 4:
|
|
5144
|
-
|
|
6057
|
+
_p.sent();
|
|
5145
6058
|
return [2 /*return*/, plainData.categories];
|
|
5146
6059
|
}
|
|
5147
6060
|
});
|
|
5148
6061
|
});
|
|
5149
6062
|
};
|
|
5150
|
-
ProductHasuraGraphQLRepository.prototype.updateKitProducts = function (productId,
|
|
5151
|
-
var kitProducts =
|
|
6063
|
+
ProductHasuraGraphQLRepository.prototype.updateKitProducts = function (productId, _p) {
|
|
6064
|
+
var kitProducts = _p.kitProducts;
|
|
5152
6065
|
return __awaiter(this, void 0, void 0, function () {
|
|
5153
6066
|
var plainData;
|
|
5154
|
-
return __generator(this, function (
|
|
5155
|
-
switch (
|
|
6067
|
+
return __generator(this, function (_p) {
|
|
6068
|
+
switch (_p.label) {
|
|
5156
6069
|
case 0:
|
|
5157
6070
|
plainData = this.paramsToPlain({ kitProducts: kitProducts });
|
|
5158
6071
|
return [4 /*yield*/, this.mutation('delete_product_kit', ['affected_rows'], {
|
|
@@ -5163,7 +6076,7 @@
|
|
|
5163
6076
|
},
|
|
5164
6077
|
})];
|
|
5165
6078
|
case 1:
|
|
5166
|
-
|
|
6079
|
+
_p.sent();
|
|
5167
6080
|
return [4 /*yield*/, this.mutation('insert_product_kit', ['affected_rows'], {
|
|
5168
6081
|
objects: {
|
|
5169
6082
|
type: '[product_kit_insert_input!]',
|
|
@@ -5176,55 +6089,55 @@
|
|
|
5176
6089
|
},
|
|
5177
6090
|
})];
|
|
5178
6091
|
case 2:
|
|
5179
|
-
|
|
6092
|
+
_p.sent();
|
|
5180
6093
|
return [2 /*return*/, plainData.kitProducts];
|
|
5181
6094
|
}
|
|
5182
6095
|
});
|
|
5183
6096
|
});
|
|
5184
6097
|
};
|
|
5185
|
-
ProductHasuraGraphQLRepository.prototype.updateReviews = function (productId,
|
|
5186
|
-
var reviews =
|
|
6098
|
+
ProductHasuraGraphQLRepository.prototype.updateReviews = function (productId, _p) {
|
|
6099
|
+
var reviews = _p.reviews;
|
|
5187
6100
|
return __awaiter(this, void 0, void 0, function () {
|
|
5188
6101
|
var reviewIds_1, plainData;
|
|
5189
6102
|
var _this = this;
|
|
5190
|
-
return __generator(this, function (
|
|
5191
|
-
switch (
|
|
6103
|
+
return __generator(this, function (_p) {
|
|
6104
|
+
switch (_p.label) {
|
|
5192
6105
|
case 0:
|
|
5193
6106
|
if (!reviews)
|
|
5194
6107
|
return [2 /*return*/, []];
|
|
5195
6108
|
if (!('action' in reviews && reviews.action === 'remove')) return [3 /*break*/, 3];
|
|
5196
6109
|
return [4 /*yield*/, Promise.all(reviews.value.map(function (reviewData) { return __awaiter(_this, void 0, void 0, function () {
|
|
5197
6110
|
var review;
|
|
5198
|
-
return __generator(this, function (
|
|
5199
|
-
switch (
|
|
6111
|
+
return __generator(this, function (_p) {
|
|
6112
|
+
switch (_p.label) {
|
|
5200
6113
|
case 0: return [4 /*yield*/, this.findReview(reviewData, productId)];
|
|
5201
6114
|
case 1:
|
|
5202
|
-
review =
|
|
6115
|
+
review = _p.sent();
|
|
5203
6116
|
return [2 /*return*/, review === null || review === void 0 ? void 0 : review.id];
|
|
5204
6117
|
}
|
|
5205
6118
|
});
|
|
5206
6119
|
}); }))];
|
|
5207
6120
|
case 1:
|
|
5208
|
-
reviewIds_1 =
|
|
6121
|
+
reviewIds_1 = _p.sent();
|
|
5209
6122
|
return [4 /*yield*/, this.mutation('delete_product_review', ['affected_rows'], {
|
|
5210
6123
|
where: { value: { id: { _in: reviewIds_1.filter(Boolean) } }, type: 'product_review_bool_exp', required: true },
|
|
5211
6124
|
})];
|
|
5212
6125
|
case 2:
|
|
5213
|
-
|
|
6126
|
+
_p.sent();
|
|
5214
6127
|
return [2 /*return*/, reviews.value.map(function (review, index) { return !reviewIds_1[index] && review; }).filter(Boolean)];
|
|
5215
6128
|
case 3:
|
|
5216
6129
|
plainData = this.paramsToPlain({ reviews: reviews });
|
|
5217
6130
|
if (!plainData.reviews || plainData.reviews.length <= 0)
|
|
5218
6131
|
return [2 /*return*/, []];
|
|
5219
6132
|
return [2 /*return*/, Promise.all(plainData.reviews.map(function (reviewData) { return __awaiter(_this, void 0, void 0, function () {
|
|
5220
|
-
var review,
|
|
5221
|
-
return __generator(this, function (
|
|
5222
|
-
switch (
|
|
6133
|
+
var review, _p, _q;
|
|
6134
|
+
return __generator(this, function (_r) {
|
|
6135
|
+
switch (_r.label) {
|
|
5223
6136
|
case 0: return [4 /*yield*/, this.findReview(reviewData, productId)];
|
|
5224
6137
|
case 1:
|
|
5225
|
-
review =
|
|
6138
|
+
review = _r.sent();
|
|
5226
6139
|
if (!review.id) return [3 /*break*/, 3];
|
|
5227
|
-
|
|
6140
|
+
_p = this.bindReviewToModel;
|
|
5228
6141
|
return [4 /*yield*/, this.mutation('update_product_review_by_pk', this.reviewsFields, {
|
|
5229
6142
|
pk_columns: {
|
|
5230
6143
|
value: { id: review.id },
|
|
@@ -5237,9 +6150,9 @@
|
|
|
5237
6150
|
required: true,
|
|
5238
6151
|
},
|
|
5239
6152
|
})];
|
|
5240
|
-
case 2: return [2 /*return*/,
|
|
6153
|
+
case 2: return [2 /*return*/, _p.apply(this, [(_r.sent()).update_product_review_by_pk])];
|
|
5241
6154
|
case 3:
|
|
5242
|
-
|
|
6155
|
+
_q = this.bindReviewToModel;
|
|
5243
6156
|
return [4 /*yield*/, this.mutation('insert_product_review_one', this.reviewsFields, {
|
|
5244
6157
|
object: {
|
|
5245
6158
|
value: lodash.omit(Object.assign(Object.assign({}, this.bindReviewToHasura(reviewData)), { product_id: productId }), ['id']),
|
|
@@ -5247,7 +6160,7 @@
|
|
|
5247
6160
|
required: true,
|
|
5248
6161
|
},
|
|
5249
6162
|
})];
|
|
5250
|
-
case 4: return [2 /*return*/,
|
|
6163
|
+
case 4: return [2 /*return*/, _q.apply(this, [(_r.sent()).insert_product_review_one])];
|
|
5251
6164
|
}
|
|
5252
6165
|
});
|
|
5253
6166
|
}); }))];
|
|
@@ -5255,12 +6168,12 @@
|
|
|
5255
6168
|
});
|
|
5256
6169
|
});
|
|
5257
6170
|
};
|
|
5258
|
-
ProductHasuraGraphQLRepository.prototype.updateMetadata = function (productId,
|
|
5259
|
-
var metadata =
|
|
6171
|
+
ProductHasuraGraphQLRepository.prototype.updateMetadata = function (productId, _p) {
|
|
6172
|
+
var metadata = _p.metadata;
|
|
5260
6173
|
return __awaiter(this, void 0, void 0, function () {
|
|
5261
6174
|
var plainData;
|
|
5262
|
-
return __generator(this, function (
|
|
5263
|
-
switch (
|
|
6175
|
+
return __generator(this, function (_p) {
|
|
6176
|
+
switch (_p.label) {
|
|
5264
6177
|
case 0:
|
|
5265
6178
|
plainData = this.paramsToPlain({ metadata: metadata });
|
|
5266
6179
|
if (!plainData.metadata)
|
|
@@ -5278,7 +6191,7 @@
|
|
|
5278
6191
|
},
|
|
5279
6192
|
})];
|
|
5280
6193
|
case 1:
|
|
5281
|
-
|
|
6194
|
+
_p.sent();
|
|
5282
6195
|
return [2 /*return*/, plainData.metadata];
|
|
5283
6196
|
}
|
|
5284
6197
|
});
|
|
@@ -5288,14 +6201,14 @@
|
|
|
5288
6201
|
var _a, _b;
|
|
5289
6202
|
return __awaiter(this, void 0, void 0, function () {
|
|
5290
6203
|
var data;
|
|
5291
|
-
return __generator(this, function (
|
|
5292
|
-
switch (
|
|
6204
|
+
return __generator(this, function (_p) {
|
|
6205
|
+
switch (_p.label) {
|
|
5293
6206
|
case 0:
|
|
5294
6207
|
if (!Number.isNaN(+id))
|
|
5295
6208
|
return [2 /*return*/, id];
|
|
5296
6209
|
return [4 /*yield*/, this.find({ filters: { firestoreId: id }, options: { enableCount: false } })];
|
|
5297
6210
|
case 1:
|
|
5298
|
-
data = (
|
|
6211
|
+
data = (_p.sent()).data;
|
|
5299
6212
|
if ((_a = data === null || data === void 0 ? void 0 : data[0]) === null || _a === void 0 ? void 0 : _a.id)
|
|
5300
6213
|
return [2 /*return*/, (_b = data === null || data === void 0 ? void 0 : data[0]) === null || _b === void 0 ? void 0 : _b.id];
|
|
5301
6214
|
throw new NotFoundError("Product with id " + id + " not found");
|
|
@@ -5307,8 +6220,8 @@
|
|
|
5307
6220
|
return __awaiter(this, void 0, void 0, function () {
|
|
5308
6221
|
var data;
|
|
5309
6222
|
var _this = this;
|
|
5310
|
-
return __generator(this, function (
|
|
5311
|
-
switch (
|
|
6223
|
+
return __generator(this, function (_p) {
|
|
6224
|
+
switch (_p.label) {
|
|
5312
6225
|
case 0: return [4 /*yield*/, this.query('product_review', this.reviewsFields, {
|
|
5313
6226
|
where: {
|
|
5314
6227
|
value: {
|
|
@@ -5319,7 +6232,7 @@
|
|
|
5319
6232
|
},
|
|
5320
6233
|
})];
|
|
5321
6234
|
case 1:
|
|
5322
|
-
data = (
|
|
6235
|
+
data = (_p.sent()).product_review;
|
|
5323
6236
|
return [2 /*return*/, data && data.map(function (review) { return _this.bindReviewToModel(review); })];
|
|
5324
6237
|
}
|
|
5325
6238
|
});
|
|
@@ -5328,22 +6241,22 @@
|
|
|
5328
6241
|
ProductHasuraGraphQLRepository.prototype.findReview = function (review, productId) {
|
|
5329
6242
|
return __awaiter(this, void 0, void 0, function () {
|
|
5330
6243
|
var loadedReview;
|
|
5331
|
-
return __generator(this, function (
|
|
5332
|
-
switch (
|
|
6244
|
+
return __generator(this, function (_p) {
|
|
6245
|
+
switch (_p.label) {
|
|
5333
6246
|
case 0:
|
|
5334
6247
|
if (review.id)
|
|
5335
6248
|
return [2 /*return*/, review];
|
|
5336
6249
|
if (!review.personId) return [3 /*break*/, 2];
|
|
5337
6250
|
return [4 /*yield*/, this.getReviewByPersonId(review.personId, productId, review.orderId)];
|
|
5338
6251
|
case 1:
|
|
5339
|
-
loadedReview =
|
|
5340
|
-
|
|
6252
|
+
loadedReview = _p.sent();
|
|
6253
|
+
_p.label = 2;
|
|
5341
6254
|
case 2:
|
|
5342
6255
|
if (!(!loadedReview && review.author && review.email)) return [3 /*break*/, 4];
|
|
5343
6256
|
return [4 /*yield*/, this.getReviewByAuthorAndEmail(review.author, review.email, productId, review.orderId)];
|
|
5344
6257
|
case 3:
|
|
5345
|
-
loadedReview =
|
|
5346
|
-
|
|
6258
|
+
loadedReview = _p.sent();
|
|
6259
|
+
_p.label = 4;
|
|
5347
6260
|
case 4: return [2 /*return*/, loadedReview || review];
|
|
5348
6261
|
}
|
|
5349
6262
|
});
|
|
@@ -5352,8 +6265,8 @@
|
|
|
5352
6265
|
ProductHasuraGraphQLRepository.prototype.getReviewByPersonId = function (personId, productId, orderId) {
|
|
5353
6266
|
return __awaiter(this, void 0, void 0, function () {
|
|
5354
6267
|
var data;
|
|
5355
|
-
return __generator(this, function (
|
|
5356
|
-
switch (
|
|
6268
|
+
return __generator(this, function (_p) {
|
|
6269
|
+
switch (_p.label) {
|
|
5357
6270
|
case 0: return [4 /*yield*/, this.query('product_review', this.reviewsFields, {
|
|
5358
6271
|
where: {
|
|
5359
6272
|
value: Object.assign({ product_id: { _eq: productId }, person_id: { _eq: personId } }, (orderId && { order_id: { _eq: orderId } })),
|
|
@@ -5362,7 +6275,7 @@
|
|
|
5362
6275
|
},
|
|
5363
6276
|
})];
|
|
5364
6277
|
case 1:
|
|
5365
|
-
data = (
|
|
6278
|
+
data = (_p.sent()).product_review;
|
|
5366
6279
|
return [2 /*return*/, data && data[0] && this.bindReviewToModel(data[0])];
|
|
5367
6280
|
}
|
|
5368
6281
|
});
|
|
@@ -5371,8 +6284,8 @@
|
|
|
5371
6284
|
ProductHasuraGraphQLRepository.prototype.getReviewByAuthorAndEmail = function (author, email, productId, orderId) {
|
|
5372
6285
|
return __awaiter(this, void 0, void 0, function () {
|
|
5373
6286
|
var data;
|
|
5374
|
-
return __generator(this, function (
|
|
5375
|
-
switch (
|
|
6287
|
+
return __generator(this, function (_p) {
|
|
6288
|
+
switch (_p.label) {
|
|
5376
6289
|
case 0: return [4 /*yield*/, this.query('product_review', this.reviewsFields, {
|
|
5377
6290
|
where: {
|
|
5378
6291
|
value: Object.assign({ product_id: { _eq: productId }, author: { _eq: author }, email: { _eq: email } }, (orderId && { order_id: { _eq: orderId } })),
|
|
@@ -5381,7 +6294,7 @@
|
|
|
5381
6294
|
},
|
|
5382
6295
|
})];
|
|
5383
6296
|
case 1:
|
|
5384
|
-
data = (
|
|
6297
|
+
data = (_p.sent()).product_review;
|
|
5385
6298
|
return [2 /*return*/, data && data[0] && this.bindReviewToModel(data[0])];
|
|
5386
6299
|
}
|
|
5387
6300
|
});
|
|
@@ -5389,8 +6302,8 @@
|
|
|
5389
6302
|
};
|
|
5390
6303
|
ProductHasuraGraphQLRepository.prototype.cleanShoppingCountFromIds = function (ids) {
|
|
5391
6304
|
return __awaiter(this, void 0, void 0, function () {
|
|
5392
|
-
return __generator(this, function (
|
|
5393
|
-
switch (
|
|
6305
|
+
return __generator(this, function (_p) {
|
|
6306
|
+
switch (_p.label) {
|
|
5394
6307
|
case 0: return [4 /*yield*/, this.mutation('update_product', ['affected_rows'], {
|
|
5395
6308
|
where: {
|
|
5396
6309
|
value: { id: { _nin: ids } },
|
|
@@ -5402,7 +6315,7 @@
|
|
|
5402
6315
|
type: 'product_set_input',
|
|
5403
6316
|
},
|
|
5404
6317
|
})];
|
|
5405
|
-
case 1: return [2 /*return*/,
|
|
6318
|
+
case 1: return [2 /*return*/, _p.sent()];
|
|
5406
6319
|
}
|
|
5407
6320
|
});
|
|
5408
6321
|
});
|
|
@@ -5457,6 +6370,7 @@
|
|
|
5457
6370
|
to: function (value) { return (lodash.isNil(value === null || value === void 0 ? void 0 : value.quantity) ? value : value === null || value === void 0 ? void 0 : value.quantity); },
|
|
5458
6371
|
},
|
|
5459
6372
|
},
|
|
6373
|
+
{ hasStock: { columnName: 'has_stock' } },
|
|
5460
6374
|
'weight',
|
|
5461
6375
|
{ name: { to: function () { return ''; }, from: function () { return undefined; } } },
|
|
5462
6376
|
{ hasVariants: { columnName: 'has_variants', to: function () { return false; }, from: function () { return undefined; } } },
|
|
@@ -5608,6 +6522,14 @@
|
|
|
5608
6522
|
enumerable: true,
|
|
5609
6523
|
get: function () { return lodash.chunk; }
|
|
5610
6524
|
});
|
|
6525
|
+
Object.defineProperty(exports, 'each', {
|
|
6526
|
+
enumerable: true,
|
|
6527
|
+
get: function () { return lodash.each; }
|
|
6528
|
+
});
|
|
6529
|
+
Object.defineProperty(exports, 'get', {
|
|
6530
|
+
enumerable: true,
|
|
6531
|
+
get: function () { return lodash.get; }
|
|
6532
|
+
});
|
|
5611
6533
|
Object.defineProperty(exports, 'isBoolean', {
|
|
5612
6534
|
enumerable: true,
|
|
5613
6535
|
get: function () { return lodash.isBoolean; }
|
|
@@ -5660,6 +6582,10 @@
|
|
|
5660
6582
|
enumerable: true,
|
|
5661
6583
|
get: function () { return lodash.set; }
|
|
5662
6584
|
});
|
|
6585
|
+
Object.defineProperty(exports, 'unset', {
|
|
6586
|
+
enumerable: true,
|
|
6587
|
+
get: function () { return lodash.unset; }
|
|
6588
|
+
});
|
|
5663
6589
|
exports.Address = Address;
|
|
5664
6590
|
exports.Authentication = Authentication;
|
|
5665
6591
|
exports.AuthenticationFirebaseAuthService = AuthenticationFirebaseAuthService;
|
|
@@ -5675,6 +6601,8 @@
|
|
|
5675
6601
|
exports.CampaignHashtag = CampaignHashtag;
|
|
5676
6602
|
exports.CampaignHashtagFirestoreRepository = CampaignHashtagFirestoreRepository;
|
|
5677
6603
|
exports.Category = Category;
|
|
6604
|
+
exports.CategoryCollectionChildren = CategoryCollectionChildren;
|
|
6605
|
+
exports.CategoryCollectionChildrenHasuraGraphQLRepository = CategoryCollectionChildrenHasuraGraphQLRepository;
|
|
5678
6606
|
exports.CategoryFilter = CategoryFilter;
|
|
5679
6607
|
exports.CategoryFilterHasuraGraphQLRepository = CategoryFilterHasuraGraphQLRepository;
|
|
5680
6608
|
exports.CategoryFirestoreRepository = CategoryFirestoreRepository;
|
|
@@ -5684,8 +6612,12 @@
|
|
|
5684
6612
|
exports.CheckoutFirestoreRepository = CheckoutFirestoreRepository;
|
|
5685
6613
|
exports.CheckoutSubscription = CheckoutSubscription;
|
|
5686
6614
|
exports.CheckoutSubscriptionFirestoreRepository = CheckoutSubscriptionFirestoreRepository;
|
|
6615
|
+
exports.ClassNameHelper = ClassNameHelper;
|
|
5687
6616
|
exports.Coupon = Coupon;
|
|
5688
6617
|
exports.CouponFirestoreRepository = CouponFirestoreRepository;
|
|
6618
|
+
exports.Debug = Debug;
|
|
6619
|
+
exports.DebugDecoratorHelper = DebugDecoratorHelper;
|
|
6620
|
+
exports.DebugHelper = DebugHelper;
|
|
5689
6621
|
exports.DuplicatedResultsError = DuplicatedResultsError;
|
|
5690
6622
|
exports.Edition = Edition;
|
|
5691
6623
|
exports.Filter = Filter;
|
|
@@ -5701,6 +6633,8 @@
|
|
|
5701
6633
|
exports.LeadFirestoreRepository = LeadFirestoreRepository;
|
|
5702
6634
|
exports.LegacyOrderFirestoreRepository = LegacyOrderFirestoreRepository;
|
|
5703
6635
|
exports.LineItem = LineItem;
|
|
6636
|
+
exports.Log = Log;
|
|
6637
|
+
exports.Logger = Logger;
|
|
5704
6638
|
exports.NotFoundError = NotFoundError;
|
|
5705
6639
|
exports.Order = Order;
|
|
5706
6640
|
exports.OrderFirestoreRepository = OrderFirestoreRepository;
|
|
@@ -5713,9 +6647,11 @@
|
|
|
5713
6647
|
exports.ProductVariantFirestoreRepository = ProductVariantFirestoreRepository;
|
|
5714
6648
|
exports.ProductsIndex = ProductsIndex;
|
|
5715
6649
|
exports.RecoveryPassword = RecoveryPassword;
|
|
6650
|
+
exports.ReflectHelper = ReflectHelper;
|
|
5716
6651
|
exports.Register = Register;
|
|
5717
6652
|
exports.RegisterFirebaseAuthService = RegisterFirebaseAuthService;
|
|
5718
6653
|
exports.RequiredArgumentError = RequiredArgumentError;
|
|
6654
|
+
exports.RoundProductPricesHelper = RoundProductPricesHelper;
|
|
5719
6655
|
exports.ShippingMethod = ShippingMethod;
|
|
5720
6656
|
exports.ShopMenu = ShopMenu;
|
|
5721
6657
|
exports.ShopMenuFirestoreRepository = ShopMenuFirestoreRepository;
|
|
@@ -5732,6 +6668,7 @@
|
|
|
5732
6668
|
exports.SubscriptionPlan = SubscriptionPlan;
|
|
5733
6669
|
exports.SubscriptionPlanFirestoreRepository = SubscriptionPlanFirestoreRepository;
|
|
5734
6670
|
exports.SubscriptionProductFirestoreRepository = SubscriptionProductFirestoreRepository;
|
|
6671
|
+
exports.Trace = Trace;
|
|
5735
6672
|
exports.UnauthorizedError = UnauthorizedError;
|
|
5736
6673
|
exports.User = User;
|
|
5737
6674
|
exports.UserAddress = UserAddress;
|
|
@@ -5745,6 +6682,7 @@
|
|
|
5745
6682
|
exports.VariantHasuraGraphQL = VariantHasuraGraphQL;
|
|
5746
6683
|
exports.VariantHasuraGraphQLRepository = VariantHasuraGraphQLRepository;
|
|
5747
6684
|
exports.WeakPasswordError = WeakPasswordError;
|
|
6685
|
+
exports.isDebuggable = isDebuggable;
|
|
5748
6686
|
exports.isUUID = isUUID;
|
|
5749
6687
|
exports.parseDateTime = parseDateTime;
|
|
5750
6688
|
exports.withCreateFirestore = withCreateFirestore;
|