@vendure/core 1.6.4 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/common/custom-field-relation-resolver.service.d.ts +3 -1
- package/dist/api/common/custom-field-relation-resolver.service.js +7 -5
- package/dist/api/common/custom-field-relation-resolver.service.js.map +1 -1
- package/dist/api/config/generate-resolvers.d.ts +3 -0
- package/dist/api/config/generate-resolvers.js +7 -1
- package/dist/api/config/generate-resolvers.js.map +1 -1
- package/dist/api/resolvers/admin/collection.resolver.js +8 -2
- package/dist/api/resolvers/admin/collection.resolver.js.map +1 -1
- package/dist/api/resolvers/admin/order.resolver.d.ts +3 -2
- package/dist/api/resolvers/admin/order.resolver.js +15 -3
- package/dist/api/resolvers/admin/order.resolver.js.map +1 -1
- package/dist/api/resolvers/admin/product-option.resolver.d.ts +2 -1
- package/dist/api/resolvers/admin/product-option.resolver.js +13 -0
- package/dist/api/resolvers/admin/product-option.resolver.js.map +1 -1
- package/dist/api/resolvers/base/base-auth.resolver.d.ts +2 -2
- package/dist/api/resolvers/base/base-auth.resolver.js.map +1 -1
- package/dist/api/resolvers/entity/fulfillment-entity.resolver.d.ts +8 -2
- package/dist/api/resolvers/entity/fulfillment-entity.resolver.js +17 -3
- package/dist/api/resolvers/entity/fulfillment-entity.resolver.js.map +1 -1
- package/dist/api/resolvers/entity/order-item-entity.resolver.d.ts +3 -1
- package/dist/api/resolvers/entity/order-item-entity.resolver.js +9 -3
- package/dist/api/resolvers/entity/order-item-entity.resolver.js.map +1 -1
- package/dist/api/resolvers/entity/order-line-entity.resolver.d.ts +5 -3
- package/dist/api/resolvers/entity/order-line-entity.resolver.js +19 -2
- package/dist/api/resolvers/entity/order-line-entity.resolver.js.map +1 -1
- package/dist/api/resolvers/entity/payment-entity.resolver.d.ts +3 -1
- package/dist/api/resolvers/entity/payment-entity.resolver.js +6 -3
- package/dist/api/resolvers/entity/payment-entity.resolver.js.map +1 -1
- package/dist/api/resolvers/entity/product-option-group-entity.resolver.js +8 -3
- package/dist/api/resolvers/entity/product-option-group-entity.resolver.js.map +1 -1
- package/dist/api/resolvers/shop/shop-products.resolver.js +8 -2
- package/dist/api/resolvers/shop/shop-products.resolver.js.map +1 -1
- package/dist/api/schema/admin-api/order.api.graphql +11 -0
- package/dist/api/schema/admin-api/product-option-group.api.graphql +2 -0
- package/dist/api/schema/common/order.type.graphql +7 -0
- package/dist/bootstrap.js +2 -3
- package/dist/bootstrap.js.map +1 -1
- package/dist/common/configurable-operation.js +9 -4
- package/dist/common/configurable-operation.js.map +1 -1
- package/dist/common/constants.d.ts +1 -2
- package/dist/common/error/errors.d.ts +1 -0
- package/dist/common/error/errors.js.map +1 -1
- package/dist/common/error/generated-graphql-admin-errors.d.ts +10 -0
- package/dist/common/error/generated-graphql-admin-errors.js +17 -2
- package/dist/common/error/generated-graphql-admin-errors.js.map +1 -1
- package/dist/config/asset-import-strategy/asset-import-strategy.d.ts +24 -0
- package/dist/config/asset-import-strategy/asset-import-strategy.js +3 -0
- package/dist/config/asset-import-strategy/asset-import-strategy.js.map +1 -0
- package/dist/config/asset-import-strategy/default-asset-import-strategy.d.ts +24 -0
- package/dist/config/asset-import-strategy/default-asset-import-strategy.js +91 -0
- package/dist/config/asset-import-strategy/default-asset-import-strategy.js.map +1 -0
- package/dist/config/asset-naming-strategy/default-asset-naming-strategy.js +1 -1
- package/dist/config/asset-naming-strategy/default-asset-naming-strategy.js.map +1 -1
- package/dist/config/catalog/default-collection-filters.d.ts +18 -19
- package/dist/config/config-helpers.d.ts +4 -0
- package/dist/config/config-helpers.js +8 -1
- package/dist/config/config-helpers.js.map +1 -1
- package/dist/config/config.module.js +11 -0
- package/dist/config/config.module.js.map +1 -1
- package/dist/config/default-config.js +3 -1
- package/dist/config/default-config.js.map +1 -1
- package/dist/config/entity-id-strategy/entity-id-strategy.d.ts +7 -0
- package/dist/config/fulfillment/custom-fulfillment-process.d.ts +2 -2
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.js +1 -0
- package/dist/config/index.js.map +1 -1
- package/dist/config/logger/vendure-logger.d.ts +1 -0
- package/dist/config/logger/vendure-logger.js.map +1 -1
- package/dist/config/order/custom-order-process.d.ts +2 -2
- package/dist/config/order/order-item-price-calculation-strategy.d.ts +3 -0
- package/dist/config/payment/custom-payment-process.d.ts +2 -2
- package/dist/config/payment/dummy-payment-method-handler.js +8 -0
- package/dist/config/payment/dummy-payment-method-handler.js.map +1 -1
- package/dist/config/payment/payment-method-handler.d.ts +66 -0
- package/dist/config/payment/payment-method-handler.js +11 -1
- package/dist/config/payment/payment-method-handler.js.map +1 -1
- package/dist/config/promotion/actions/order-fixed-discount-action.js +1 -1
- package/dist/config/promotion/actions/order-fixed-discount-action.js.map +1 -1
- package/dist/config/promotion/conditions/buy-x-get-y-free-condition.d.ts +5 -7
- package/dist/config/vendure-config.d.ts +18 -0
- package/dist/connection/connection.module.d.ts +1 -1
- package/dist/connection/remove-custom-fields-with-eager-relations.d.ts +34 -0
- package/dist/connection/remove-custom-fields-with-eager-relations.js +55 -0
- package/dist/connection/remove-custom-fields-with-eager-relations.js.map +1 -0
- package/dist/connection/transaction-subscriber.d.ts +16 -2
- package/dist/connection/transaction-subscriber.js +27 -7
- package/dist/connection/transaction-subscriber.js.map +1 -1
- package/dist/connection/transaction-wrapper.js +6 -9
- package/dist/connection/transaction-wrapper.js.map +1 -1
- package/dist/connection/transactional-connection.d.ts +2 -33
- package/dist/connection/transactional-connection.js +23 -55
- package/dist/connection/transactional-connection.js.map +1 -1
- package/dist/data-import/providers/asset-importer/asset-importer.js +12 -18
- package/dist/data-import/providers/asset-importer/asset-importer.js.map +1 -1
- package/dist/entity/asset/asset.entity.js +4 -2
- package/dist/entity/asset/asset.entity.js.map +1 -1
- package/dist/entity/asset/orderable-asset.entity.js +3 -1
- package/dist/entity/asset/orderable-asset.entity.js.map +1 -1
- package/dist/entity/authentication-method/external-authentication-method.entity.js +3 -1
- package/dist/entity/authentication-method/external-authentication-method.entity.js.map +1 -1
- package/dist/entity/authentication-method/native-authentication-method.entity.js +3 -1
- package/dist/entity/authentication-method/native-authentication-method.entity.js.map +1 -1
- package/dist/entity/channel/channel.entity.js +5 -3
- package/dist/entity/channel/channel.entity.js.map +1 -1
- package/dist/entity/collection/collection-asset.entity.js +4 -2
- package/dist/entity/collection/collection-asset.entity.js.map +1 -1
- package/dist/entity/collection/collection-translation.entity.js +4 -2
- package/dist/entity/collection/collection-translation.entity.js.map +1 -1
- package/dist/entity/country/country-translation.entity.js +4 -2
- package/dist/entity/country/country-translation.entity.js.map +1 -1
- package/dist/entity/country/country.entity.js +3 -1
- package/dist/entity/country/country.entity.js.map +1 -1
- package/dist/entity/customer-group/customer-group.entity.js +3 -1
- package/dist/entity/customer-group/customer-group.entity.js.map +1 -1
- package/dist/entity/fulfillment/fulfillment.entity.js +3 -1
- package/dist/entity/fulfillment/fulfillment.entity.js.map +1 -1
- package/dist/entity/global-settings/global-settings.entity.js +3 -1
- package/dist/entity/global-settings/global-settings.entity.js.map +1 -1
- package/dist/entity/order-line/order-line.entity.js +4 -0
- package/dist/entity/order-line/order-line.entity.js.map +1 -1
- package/dist/entity/product/product-asset.entity.js +4 -2
- package/dist/entity/product/product-asset.entity.js.map +1 -1
- package/dist/entity/product-option/product-option-translation.entity.js.map +1 -1
- package/dist/entity/product-option-group/product-option-group-translation.entity.js.map +1 -1
- package/dist/entity/product-variant/product-variant-asset.entity.js +4 -2
- package/dist/entity/product-variant/product-variant-asset.entity.js.map +1 -1
- package/dist/entity/role/role.entity.js +3 -1
- package/dist/entity/role/role.entity.js.map +1 -1
- package/dist/entity/tag/tag.entity.js +3 -1
- package/dist/entity/tag/tag.entity.js.map +1 -1
- package/dist/entity/user/user.entity.js +3 -1
- package/dist/entity/user/user.entity.js.map +1 -1
- package/dist/entity/zone/zone.entity.js +3 -1
- package/dist/entity/zone/zone.entity.js.map +1 -1
- package/dist/event-bus/event-bus.js +14 -3
- package/dist/event-bus/event-bus.js.map +1 -1
- package/dist/event-bus/events/initializer-event.d.ts +12 -0
- package/dist/event-bus/events/initializer-event.js +19 -0
- package/dist/event-bus/events/initializer-event.js.map +1 -0
- package/dist/event-bus/events/product-option-event.d.ts +1 -1
- package/dist/event-bus/events/product-option-event.js.map +1 -1
- package/dist/event-bus/events/product-option-group-event.d.ts +1 -1
- package/dist/event-bus/events/product-option-group-event.js.map +1 -1
- package/dist/event-bus/index.d.ts +1 -0
- package/dist/event-bus/index.js +1 -0
- package/dist/event-bus/index.js.map +1 -1
- package/dist/i18n/messages/en.json +3 -0
- package/dist/job-queue/in-memory-job-queue-strategy.d.ts +1 -1
- package/dist/migrate.js +14 -0
- package/dist/migrate.js.map +1 -1
- package/dist/plugin/default-search-plugin/search-strategy/mysql-search-strategy.js +33 -33
- package/dist/plugin/default-search-plugin/search-strategy/mysql-search-strategy.js.map +1 -1
- package/dist/plugin/default-search-plugin/search-strategy/postgres-search-strategy.js +7 -7
- package/dist/plugin/default-search-plugin/search-strategy/postgres-search-strategy.js.map +1 -1
- package/dist/plugin/default-search-plugin/search-strategy/search-strategy-common.d.ts +1 -0
- package/dist/plugin/default-search-plugin/search-strategy/search-strategy-common.js +8 -1
- package/dist/plugin/default-search-plugin/search-strategy/search-strategy-common.js.map +1 -1
- package/dist/plugin/default-search-plugin/search-strategy/search-strategy-utils.d.ts +11 -1
- package/dist/plugin/default-search-plugin/search-strategy/search-strategy-utils.js +31 -1
- package/dist/plugin/default-search-plugin/search-strategy/search-strategy-utils.js.map +1 -1
- package/dist/plugin/default-search-plugin/search-strategy/sqlite-search-strategy.js +29 -29
- package/dist/plugin/default-search-plugin/search-strategy/sqlite-search-strategy.js.map +1 -1
- package/dist/plugin/plugin-metadata.js +2 -1
- package/dist/plugin/plugin-metadata.js.map +1 -1
- package/dist/plugin/vendure-plugin.d.ts +11 -2
- package/dist/plugin/vendure-plugin.js.map +1 -1
- package/dist/service/helpers/config-arg/config-arg.service.d.ts +1 -0
- package/dist/service/helpers/config-arg/config-arg.service.js +12 -1
- package/dist/service/helpers/config-arg/config-arg.service.js.map +1 -1
- package/dist/service/helpers/entity-hydrator/entity-hydrator.service.d.ts +3 -1
- package/dist/service/helpers/entity-hydrator/entity-hydrator.service.js +6 -4
- package/dist/service/helpers/entity-hydrator/entity-hydrator.service.js.map +1 -1
- package/dist/service/helpers/fulfillment-state-machine/fulfillment-state.d.ts +9 -1
- package/dist/service/helpers/fulfillment-state-machine/fulfillment-state.js.map +1 -1
- package/dist/service/helpers/list-query-builder/connection-utils.js +7 -1
- package/dist/service/helpers/list-query-builder/connection-utils.js.map +1 -1
- package/dist/service/helpers/list-query-builder/list-query-builder.d.ts +4 -3
- package/dist/service/helpers/list-query-builder/list-query-builder.js +17 -8
- package/dist/service/helpers/list-query-builder/list-query-builder.js.map +1 -1
- package/dist/service/helpers/locale-string-hydrator/locale-string-hydrator.d.ts +3 -1
- package/dist/service/helpers/locale-string-hydrator/locale-string-hydrator.js +6 -4
- package/dist/service/helpers/locale-string-hydrator/locale-string-hydrator.js.map +1 -1
- package/dist/service/helpers/order-calculator/order-calculator.d.ts +18 -0
- package/dist/service/helpers/order-calculator/order-calculator.js +18 -0
- package/dist/service/helpers/order-calculator/order-calculator.js.map +1 -1
- package/dist/service/helpers/order-modifier/order-modifier.d.ts +19 -1
- package/dist/service/helpers/order-modifier/order-modifier.js +49 -20
- package/dist/service/helpers/order-modifier/order-modifier.js.map +1 -1
- package/dist/service/helpers/order-state-machine/order-state-machine.js +1 -1
- package/dist/service/helpers/order-state-machine/order-state-machine.js.map +1 -1
- package/dist/service/helpers/order-state-machine/order-state.d.ts +9 -1
- package/dist/service/helpers/order-state-machine/order-state.js.map +1 -1
- package/dist/service/helpers/payment-state-machine/payment-state.d.ts +9 -1
- package/dist/service/helpers/payment-state-machine/payment-state.js.map +1 -1
- package/dist/service/helpers/product-price-applicator/product-price-applicator.d.ts +26 -2
- package/dist/service/helpers/product-price-applicator/product-price-applicator.js +26 -2
- package/dist/service/helpers/product-price-applicator/product-price-applicator.js.map +1 -1
- package/dist/service/helpers/slug-validator/slug-validator.d.ts +16 -0
- package/dist/service/helpers/slug-validator/slug-validator.js +11 -1
- package/dist/service/helpers/slug-validator/slug-validator.js.map +1 -1
- package/dist/service/helpers/translatable-saver/translatable-saver.d.ts +28 -1
- package/dist/service/helpers/translatable-saver/translatable-saver.js +28 -1
- package/dist/service/helpers/translatable-saver/translatable-saver.js.map +1 -1
- package/dist/service/helpers/translator/translator.service.d.ts +10 -0
- package/dist/service/helpers/translator/translator.service.js +29 -0
- package/dist/service/helpers/translator/translator.service.js.map +1 -0
- package/dist/service/helpers/utils/translate-entity.d.ts +3 -3
- package/dist/service/helpers/utils/translate-entity.js +11 -2
- package/dist/service/helpers/utils/translate-entity.js.map +1 -1
- package/dist/service/index.d.ts +1 -0
- package/dist/service/index.js +1 -0
- package/dist/service/index.js.map +1 -1
- package/dist/service/initializer.service.d.ts +3 -1
- package/dist/service/initializer.service.js +7 -2
- package/dist/service/initializer.service.js.map +1 -1
- package/dist/service/service.module.js +2 -0
- package/dist/service/service.module.js.map +1 -1
- package/dist/service/services/asset.service.d.ts +2 -1
- package/dist/service/services/asset.service.js +19 -4
- package/dist/service/services/asset.service.js.map +1 -1
- package/dist/service/services/collection.service.d.ts +3 -1
- package/dist/service/services/collection.service.js +16 -16
- package/dist/service/services/collection.service.js.map +1 -1
- package/dist/service/services/country.service.d.ts +3 -1
- package/dist/service/services/country.service.js +9 -7
- package/dist/service/services/country.service.js.map +1 -1
- package/dist/service/services/customer.service.d.ts +3 -1
- package/dist/service/services/customer.service.js +8 -6
- package/dist/service/services/customer.service.js.map +1 -1
- package/dist/service/services/facet-value.service.d.ts +3 -1
- package/dist/service/services/facet-value.service.js +11 -6
- package/dist/service/services/facet-value.service.js.map +1 -1
- package/dist/service/services/facet.service.d.ts +3 -1
- package/dist/service/services/facet.service.js +18 -8
- package/dist/service/services/facet.service.js.map +1 -1
- package/dist/service/services/fulfillment.service.d.ts +9 -0
- package/dist/service/services/fulfillment.service.js +48 -8
- package/dist/service/services/fulfillment.service.js.map +1 -1
- package/dist/service/services/order-testing.service.d.ts +3 -1
- package/dist/service/services/order-testing.service.js +6 -4
- package/dist/service/services/order-testing.service.js.map +1 -1
- package/dist/service/services/order.service.d.ts +10 -2
- package/dist/service/services/order.service.js +50 -27
- package/dist/service/services/order.service.js.map +1 -1
- package/dist/service/services/payment.service.d.ts +2 -0
- package/dist/service/services/payment.service.js +30 -10
- package/dist/service/services/payment.service.js.map +1 -1
- package/dist/service/services/product-option-group.service.d.ts +24 -2
- package/dist/service/services/product-option-group.service.js +92 -6
- package/dist/service/services/product-option-group.service.js.map +1 -1
- package/dist/service/services/product-option.service.d.ts +15 -2
- package/dist/service/services/product-option.service.js +66 -5
- package/dist/service/services/product-option.service.js.map +1 -1
- package/dist/service/services/product-variant.service.d.ts +3 -1
- package/dist/service/services/product-variant.service.js +12 -10
- package/dist/service/services/product-variant.service.js.map +1 -1
- package/dist/service/services/product.service.d.ts +5 -1
- package/dist/service/services/product.service.js +55 -20
- package/dist/service/services/product.service.js.map +1 -1
- package/dist/service/services/promotion.service.js +4 -1
- package/dist/service/services/promotion.service.js.map +1 -1
- package/dist/service/services/shipping-method.service.d.ts +3 -1
- package/dist/service/services/shipping-method.service.js +8 -6
- package/dist/service/services/shipping-method.service.js.map +1 -1
- package/dist/service/services/stock-movement.service.js +8 -7
- package/dist/service/services/stock-movement.service.js.map +1 -1
- package/dist/service/services/user.service.d.ts +1 -1
- package/dist/service/services/user.service.js +5 -0
- package/dist/service/services/user.service.js.map +1 -1
- package/dist/service/services/zone.service.d.ts +3 -1
- package/dist/service/services/zone.service.js +8 -6
- package/dist/service/services/zone.service.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-variant-asset.entity.js","sourceRoot":"","sources":["../../../src/entity/product-variant/product-variant-asset.entity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"product-variant-asset.entity.js","sourceRoot":"","sources":["../../../src/entity/product-variant/product-variant-asset.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mEAAmE;AACnE,qCAAoD;AAEpD,4EAAiE;AAEjE,qEAA0D;AAG1D,IAAa,mBAAmB,GAAhC,MAAa,mBAAoB,SAAQ,uCAAc;IACnD,YAAY,KAAwC;QAChD,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;CAMJ,CAAA;AAJG;IADC,gBAAM,EAAE;kDACS,iBAAE,oBAAF,iBAAE;6DAAC;AAGrB;IADC,mBAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,uCAAc,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;8BAC1E,uCAAc;2DAAC;AARtB,mBAAmB;IAD/B,gBAAM,EAAE;yDAEe,0BAAW,oBAAX,0BAAW;GADtB,mBAAmB,CAS/B;AATY,kDAAmB"}
|
|
@@ -8,8 +8,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
+
var _a;
|
|
11
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
13
|
exports.Role = void 0;
|
|
14
|
+
const shared_types_1 = require("@vendure/common/lib/shared-types");
|
|
13
15
|
const typeorm_1 = require("typeorm");
|
|
14
16
|
const base_entity_1 = require("../base/base.entity");
|
|
15
17
|
const channel_entity_1 = require("../channel/channel.entity");
|
|
@@ -44,7 +46,7 @@ __decorate([
|
|
|
44
46
|
], Role.prototype, "channels", void 0);
|
|
45
47
|
Role = __decorate([
|
|
46
48
|
typeorm_1.Entity(),
|
|
47
|
-
__metadata("design:paramtypes", [Object])
|
|
49
|
+
__metadata("design:paramtypes", [typeof (_a = typeof shared_types_1.DeepPartial !== "undefined" && shared_types_1.DeepPartial) === "function" ? _a : Object])
|
|
48
50
|
], Role);
|
|
49
51
|
exports.Role = Role;
|
|
50
52
|
//# sourceMappingURL=role.entity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"role.entity.js","sourceRoot":"","sources":["../../../src/entity/role/role.entity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"role.entity.js","sourceRoot":"","sources":["../../../src/entity/role/role.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AACA,mEAA+D;AAC/D,qCAAgE;AAGhE,qDAAoD;AACpD,8DAAoD;AAEpD;;;;;;GAMG;AAEH,IAAa,IAAI,GAAjB,MAAa,IAAK,SAAQ,2BAAa;IACnC,YAAY,KAAyB;QACjC,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;CAWJ,CAAA;AATa;IAAT,gBAAM,EAAE;;kCAAc;AAEb;IAAT,gBAAM,EAAE;;yCAAqB;AAEN;IAAvB,gBAAM,CAAC,cAAc,CAAC;;yCAA2B;AAIlD;IAFC,oBAAU,CAAC,IAAI,CAAC,EAAE,CAAC,wBAAO,CAAC;IAC3B,mBAAS,EAAE;;sCACQ;AAbX,IAAI;IADhB,gBAAM,EAAE;yDAEe,0BAAW,oBAAX,0BAAW;GADtB,IAAI,CAchB;AAdY,oBAAI"}
|
|
@@ -8,8 +8,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
+
var _a;
|
|
11
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
13
|
exports.Tag = void 0;
|
|
14
|
+
const shared_types_1 = require("@vendure/common/lib/shared-types");
|
|
13
15
|
const typeorm_1 = require("typeorm");
|
|
14
16
|
const base_entity_1 = require("../base/base.entity");
|
|
15
17
|
/**
|
|
@@ -30,7 +32,7 @@ __decorate([
|
|
|
30
32
|
], Tag.prototype, "value", void 0);
|
|
31
33
|
Tag = __decorate([
|
|
32
34
|
typeorm_1.Entity(),
|
|
33
|
-
__metadata("design:paramtypes", [Object])
|
|
35
|
+
__metadata("design:paramtypes", [typeof (_a = typeof shared_types_1.DeepPartial !== "undefined" && shared_types_1.DeepPartial) === "function" ? _a : Object])
|
|
34
36
|
], Tag);
|
|
35
37
|
exports.Tag = Tag;
|
|
36
38
|
//# sourceMappingURL=tag.entity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag.entity.js","sourceRoot":"","sources":["../../../src/entity/tag/tag.entity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tag.entity.js","sourceRoot":"","sources":["../../../src/entity/tag/tag.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mEAA+D;AAC/D,qCAAyC;AAEzC,qDAAoD;AAEpD;;;;;;GAMG;AAEH,IAAa,GAAG,GAAhB,MAAa,GAAI,SAAQ,2BAAa;IAClC,YAAY,KAAwB;QAChC,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;CAIJ,CAAA;AADG;IADC,gBAAM,EAAE;;kCACK;AANL,GAAG;IADf,gBAAM,EAAE;yDAEe,0BAAW,oBAAX,0BAAW;GADtB,GAAG,CAOf;AAPY,kBAAG"}
|
|
@@ -8,8 +8,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
+
var _a;
|
|
11
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
13
|
exports.User = void 0;
|
|
14
|
+
const shared_types_1 = require("@vendure/common/lib/shared-types");
|
|
13
15
|
const typeorm_1 = require("typeorm");
|
|
14
16
|
const errors_1 = require("../../common/error/errors");
|
|
15
17
|
const authentication_method_entity_1 = require("../authentication-method/authentication-method.entity");
|
|
@@ -70,7 +72,7 @@ __decorate([
|
|
|
70
72
|
], User.prototype, "customFields", void 0);
|
|
71
73
|
User = __decorate([
|
|
72
74
|
typeorm_1.Entity(),
|
|
73
|
-
__metadata("design:paramtypes", [Object])
|
|
75
|
+
__metadata("design:paramtypes", [typeof (_a = typeof shared_types_1.DeepPartial !== "undefined" && shared_types_1.DeepPartial) === "function" ? _a : Object])
|
|
74
76
|
], User);
|
|
75
77
|
exports.User = User;
|
|
76
78
|
//# sourceMappingURL=user.entity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../../src/entity/user/user.entity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../../src/entity/user/user.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mEAA+D;AAC/D,qCAA2E;AAE3E,sDAAgE;AAGhE,wGAA6F;AAC7F,sHAA0G;AAC1G,qDAAoD;AACpD,kEAA2D;AAC3D,qDAA2C;AAE3C;;;;;;GAMG;AAEH,IAAa,IAAI,GAAjB,MAAa,IAAK,SAAQ,2BAAa;IACnC,YAAY,KAAyB;QACjC,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IA2BD,6BAA6B;QACzB,IAAI,CAAC,IAAI,CAAC,qBAAqB,EAAE;YAC7B,MAAM,IAAI,4BAAmB,CAAC,8CAA8C,CAAC,CAAC;SACjF;QACD,MAAM,KAAK,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,CACzC,CAAC,CAAC,EAAmC,EAAE,CAAC,CAAC,YAAY,gEAA0B,CAClF,CAAC;QACF,IAAI,CAAC,KAAK,EAAE;YACR,MAAM,IAAI,4BAAmB,CAAC,+CAA+C,CAAC,CAAC;SAClF;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ,CAAA;AApCG;IADC,gBAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uCAChB;AAGvB;IADC,gBAAM,EAAE;;wCACU;AAMnB;IAJC,mBAAS,CACN,IAAI,CAAC,EAAE,CAAC,mDAAoB,EAC5B,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CACxB;;mDAC6C;AAG9C;IADC,gBAAM,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;sCACT;AAIlB;IAFC,oBAAU,CAAC,IAAI,CAAC,EAAE,CAAC,kBAAI,CAAC;IACxB,mBAAS,EAAE;;mCACE;AAGd;IADC,gBAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uCAChB;AAGvB;IADC,gBAAM,CAAC,IAAI,CAAC,EAAE,CAAC,uCAAgB,CAAC;8BACnB,uCAAgB;0CAAC;AA5BtB,IAAI;IADhB,gBAAM,EAAE;yDAEe,0BAAW,oBAAX,0BAAW;GADtB,IAAI,CA0ChB;AA1CY,oBAAI"}
|
|
@@ -8,8 +8,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
+
var _a;
|
|
11
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
13
|
exports.Zone = void 0;
|
|
14
|
+
const shared_types_1 = require("@vendure/common/lib/shared-types");
|
|
13
15
|
const typeorm_1 = require("typeorm");
|
|
14
16
|
const base_entity_1 = require("../base/base.entity");
|
|
15
17
|
const country_entity_1 = require("../country/country.entity");
|
|
@@ -41,7 +43,7 @@ __decorate([
|
|
|
41
43
|
], Zone.prototype, "customFields", void 0);
|
|
42
44
|
Zone = __decorate([
|
|
43
45
|
typeorm_1.Entity(),
|
|
44
|
-
__metadata("design:paramtypes", [Object])
|
|
46
|
+
__metadata("design:paramtypes", [typeof (_a = typeof shared_types_1.DeepPartial !== "undefined" && shared_types_1.DeepPartial) === "function" ? _a : Object])
|
|
45
47
|
], Zone);
|
|
46
48
|
exports.Zone = Zone;
|
|
47
49
|
//# sourceMappingURL=zone.entity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zone.entity.js","sourceRoot":"","sources":["../../../src/entity/zone/zone.entity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"zone.entity.js","sourceRoot":"","sources":["../../../src/entity/zone/zone.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mEAA+D;AAC/D,qCAAgE;AAGhE,qDAAoD;AACpD,8DAAoD;AACpD,kEAA2D;AAE3D;;;;;;GAMG;AAEH,IAAa,IAAI,GAAjB,MAAa,IAAK,SAAQ,2BAAa;IACnC,YAAY,KAAyB;QACjC,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;CAUJ,CAAA;AARa;IAAT,gBAAM,EAAE;;kCAAc;AAIvB;IAFC,oBAAU,CAAC,IAAI,CAAC,EAAE,CAAC,wBAAO,CAAC;IAC3B,mBAAS,EAAE;;qCACO;AAGnB;IADC,gBAAM,CAAC,IAAI,CAAC,EAAE,CAAC,uCAAgB,CAAC;8BACnB,uCAAgB;0CAAC;AAZtB,IAAI;IADhB,gBAAM,EAAE;yDAEe,0BAAW,oBAAX,0BAAW;GADtB,IAAI,CAahB;AAbY,oBAAI"}
|
|
@@ -13,6 +13,7 @@ exports.EventBus = void 0;
|
|
|
13
13
|
const common_1 = require("@nestjs/common");
|
|
14
14
|
const rxjs_1 = require("rxjs");
|
|
15
15
|
const operators_1 = require("rxjs/operators");
|
|
16
|
+
const shared_utils_1 = require("../../../common/lib/shared-utils");
|
|
16
17
|
const request_context_1 = require("../api/common/request-context");
|
|
17
18
|
const constants_1 = require("../common/constants");
|
|
18
19
|
const transaction_subscriber_1 = require("../connection/transaction-subscriber");
|
|
@@ -82,7 +83,7 @@ let EventBus = class EventBus {
|
|
|
82
83
|
* data related to the event.
|
|
83
84
|
*/
|
|
84
85
|
ofType(type) {
|
|
85
|
-
return this.eventStream.asObservable().pipe(operators_1.takeUntil(this.destroy$), operators_1.filter(e => e.constructor === type), operators_1.mergeMap(event => this.awaitActiveTransactions(event)));
|
|
86
|
+
return this.eventStream.asObservable().pipe(operators_1.takeUntil(this.destroy$), operators_1.filter(e => e.constructor === type), operators_1.mergeMap(event => this.awaitActiveTransactions(event)), operators_1.filter(shared_utils_1.notNullOrUndefined));
|
|
86
87
|
}
|
|
87
88
|
/** @internal */
|
|
88
89
|
onModuleDestroy() {
|
|
@@ -117,7 +118,8 @@ let EventBus = class EventBus {
|
|
|
117
118
|
if (!(transactionManager === null || transactionManager === void 0 ? void 0 : transactionManager.queryRunner)) {
|
|
118
119
|
return event;
|
|
119
120
|
}
|
|
120
|
-
|
|
121
|
+
try {
|
|
122
|
+
await this.transactionSubscriber.awaitCommit(transactionManager.queryRunner);
|
|
121
123
|
// Copy context and remove transaction manager
|
|
122
124
|
// This will prevent queries to released query runner
|
|
123
125
|
const newContext = ctx.copy();
|
|
@@ -125,7 +127,16 @@ let EventBus = class EventBus {
|
|
|
125
127
|
// Reassign new context
|
|
126
128
|
event[key] = newContext;
|
|
127
129
|
return event;
|
|
128
|
-
}
|
|
130
|
+
}
|
|
131
|
+
catch (e) {
|
|
132
|
+
if (e instanceof transaction_subscriber_1.TransactionSubscriberError) {
|
|
133
|
+
// Expected commit, but rollback or something else happened.
|
|
134
|
+
// This is still reliable behavior, return undefined
|
|
135
|
+
// as event should not be exposed from this transaction
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
throw e;
|
|
139
|
+
}
|
|
129
140
|
}
|
|
130
141
|
};
|
|
131
142
|
EventBus = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-bus.js","sourceRoot":"","sources":["../../src/event-bus/event-bus.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA6D;AAE7D,+BAA2C;AAC3C,8CAA6D;
|
|
1
|
+
{"version":3,"file":"event-bus.js","sourceRoot":"","sources":["../../src/event-bus/event-bus.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA6D;AAE7D,+BAA2C;AAC3C,8CAA6D;AAE7D,mEAAsE;AAEtE,mEAA+D;AAC/D,mDAA8D;AAC9D,iFAAyG;AAIzG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA0CK;AAEL,IAAa,QAAQ,GAArB,MAAa,QAAQ;IAIjB,YAAoB,qBAA4C;QAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;QAHxD,gBAAW,GAAG,IAAI,cAAO,EAAgB,CAAC;QAC1C,aAAQ,GAAG,IAAI,cAAO,EAAE,CAAC;IAEkC,CAAC;IAEpE;;;OAGG;IACH,OAAO,CAAyB,KAAQ;QACpC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAyB,IAAa;QACxC,OAAO,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC,IAAI,CACvC,qBAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,EACxB,kBAAM,CAAC,CAAC,CAAC,EAAE,CAAE,CAAS,CAAC,WAAW,KAAK,IAAI,CAAC,EAC5C,oBAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAAC,EACtD,kBAAM,CAAC,iCAAkB,CAAC,CACZ,CAAC;IACvB,CAAC;IAED,gBAAgB;IAChB,eAAe;QACX,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACK,KAAK,CAAC,uBAAuB,CAAyB,KAAQ;QAClE,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,YAAY,gCAAc,CAAC,CAAC;QAE1F,IAAI,CAAC,KAAK,EAAE;YACR,OAAO,KAAK,CAAC;SAChB;QAED,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GAA6B,KAAK,CAAC;QAEnD,MAAM,kBAAkB,GAA+B,GAAW,CAAC,mCAAuB,CAAC,CAAC;QAC5F,IAAI,CAAC,CAAA,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,WAAW,CAAA,EAAE;YAClC,OAAO,KAAK,CAAC;SAChB;QAED,IAAI;YACA,MAAM,IAAI,CAAC,qBAAqB,CAAC,WAAW,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;YAE7E,8CAA8C;YAC9C,qDAAqD;YACrD,MAAM,UAAU,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;YAC9B,OAAQ,UAAkB,CAAC,mCAAuB,CAAC,CAAC;YAEpD,uBAAuB;YACtB,KAAa,CAAC,GAAG,CAAC,GAAG,UAAU,CAAA;YAEhC,OAAO,KAAK,CAAC;SAChB;QAAC,OAAO,CAAM,EAAE;YACb,IAAI,CAAC,YAAY,mDAA0B,EAAE;gBACzC,4DAA4D;gBAC5D,oDAAoD;gBACpD,uDAAuD;gBACvD,OAAO;aACV;YAED,MAAM,CAAC,CAAC;SACX;IACL,CAAC;CACJ,CAAA;AA7FY,QAAQ;IADpB,mBAAU,EAAE;qCAKkC,8CAAqB;GAJvD,QAAQ,CA6FpB;AA7FY,4BAAQ"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { VendureEvent } from '../vendure-event';
|
|
2
|
+
/**
|
|
3
|
+
* @description
|
|
4
|
+
* This event is fired when vendure finished initializing its services inside the {@code InitializerService}
|
|
5
|
+
*
|
|
6
|
+
* @docsCategory events
|
|
7
|
+
* @docsPage Event Types
|
|
8
|
+
* @since 1.7.0
|
|
9
|
+
*/
|
|
10
|
+
export declare class InitializerEvent extends VendureEvent {
|
|
11
|
+
constructor();
|
|
12
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InitializerEvent = void 0;
|
|
4
|
+
const vendure_event_1 = require("../vendure-event");
|
|
5
|
+
/**
|
|
6
|
+
* @description
|
|
7
|
+
* This event is fired when vendure finished initializing its services inside the {@code InitializerService}
|
|
8
|
+
*
|
|
9
|
+
* @docsCategory events
|
|
10
|
+
* @docsPage Event Types
|
|
11
|
+
* @since 1.7.0
|
|
12
|
+
*/
|
|
13
|
+
class InitializerEvent extends vendure_event_1.VendureEvent {
|
|
14
|
+
constructor() {
|
|
15
|
+
super();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.InitializerEvent = InitializerEvent;
|
|
19
|
+
//# sourceMappingURL=initializer-event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initializer-event.js","sourceRoot":"","sources":["../../../src/event-bus/events/initializer-event.ts"],"names":[],"mappings":";;;AAAA,oDAAgD;AAEhD;;;;;;;GAOG;AACH,MAAa,gBAAiB,SAAQ,4BAAY;IAC9C;QACI,KAAK,EAAE,CAAC;IACZ,CAAC;CACJ;AAJD,4CAIC"}
|
|
@@ -13,6 +13,6 @@ declare type ProductOptionInputTypes = CreateGroupOptionInput | CreateProductOpt
|
|
|
13
13
|
* @since 1.4
|
|
14
14
|
*/
|
|
15
15
|
export declare class ProductOptionEvent extends VendureEntityEvent<ProductOption, ProductOptionInputTypes> {
|
|
16
|
-
constructor(ctx: RequestContext, entity: ProductOption, type: 'created' | 'updated', input?: ProductOptionInputTypes);
|
|
16
|
+
constructor(ctx: RequestContext, entity: ProductOption, type: 'created' | 'updated' | 'deleted', input?: ProductOptionInputTypes);
|
|
17
17
|
}
|
|
18
18
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-option-event.js","sourceRoot":"","sources":["../../../src/event-bus/events/product-option-event.ts"],"names":[],"mappings":";;;AASA,kEAA6D;AAQ7D;;;;;;;GAOG;AACH,MAAa,kBAAmB,SAAQ,yCAA0D;IAC9F,YACI,GAAmB,EACnB,MAAqB,EACrB,
|
|
1
|
+
{"version":3,"file":"product-option-event.js","sourceRoot":"","sources":["../../../src/event-bus/events/product-option-event.ts"],"names":[],"mappings":";;;AASA,kEAA6D;AAQ7D;;;;;;;GAOG;AACH,MAAa,kBAAmB,SAAQ,yCAA0D;IAC9F,YACI,GAAmB,EACnB,MAAqB,EACrB,IAAuC,EACvC,KAA+B;QAE/B,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IACpC,CAAC;CACJ;AATD,gDASC"}
|
|
@@ -13,6 +13,6 @@ declare type ProductOptionGroupInputTypes = CreateProductOptionGroupInput | Upda
|
|
|
13
13
|
* @since 1.4
|
|
14
14
|
*/
|
|
15
15
|
export declare class ProductOptionGroupEvent extends VendureEntityEvent<ProductOptionGroup, ProductOptionGroupInputTypes> {
|
|
16
|
-
constructor(ctx: RequestContext, entity: ProductOptionGroup, type: 'created' | 'updated', input?: ProductOptionGroupInputTypes);
|
|
16
|
+
constructor(ctx: RequestContext, entity: ProductOptionGroup, type: 'created' | 'updated' | 'deleted', input?: ProductOptionGroupInputTypes);
|
|
17
17
|
}
|
|
18
18
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-option-group-event.js","sourceRoot":"","sources":["../../../src/event-bus/events/product-option-group-event.ts"],"names":[],"mappings":";;;AAQA,kEAA6D;AAI7D;;;;;;;GAOG;AACH,MAAa,uBAAwB,SAAQ,yCAG5C;IACG,YACI,GAAmB,EACnB,MAA0B,EAC1B,
|
|
1
|
+
{"version":3,"file":"product-option-group-event.js","sourceRoot":"","sources":["../../../src/event-bus/events/product-option-group-event.ts"],"names":[],"mappings":";;;AAQA,kEAA6D;AAI7D;;;;;;;GAOG;AACH,MAAa,uBAAwB,SAAQ,yCAG5C;IACG,YACI,GAAmB,EACnB,MAA0B,EAC1B,IAAuC,EACvC,KAAoC;QAEpC,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IACpC,CAAC;CACJ;AAZD,0DAYC"}
|
|
@@ -25,6 +25,7 @@ export * from './events/global-settings-event';
|
|
|
25
25
|
export * from './events/history-entry-event';
|
|
26
26
|
export * from './events/identifier-change-event';
|
|
27
27
|
export * from './events/identifier-change-request-event';
|
|
28
|
+
export * from './events/initializer-event';
|
|
28
29
|
export * from './events/login-event';
|
|
29
30
|
export * from './events/logout-event';
|
|
30
31
|
export * from './events/order-event';
|
package/dist/event-bus/index.js
CHANGED
|
@@ -37,6 +37,7 @@ __exportStar(require("./events/global-settings-event"), exports);
|
|
|
37
37
|
__exportStar(require("./events/history-entry-event"), exports);
|
|
38
38
|
__exportStar(require("./events/identifier-change-event"), exports);
|
|
39
39
|
__exportStar(require("./events/identifier-change-request-event"), exports);
|
|
40
|
+
__exportStar(require("./events/initializer-event"), exports);
|
|
40
41
|
__exportStar(require("./events/login-event"), exports);
|
|
41
42
|
__exportStar(require("./events/logout-event"), exports);
|
|
42
43
|
__exportStar(require("./events/order-event"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/event-bus/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8CAA4B;AAC5B,qDAAmC;AACnC,kDAAgC;AAEhC,sEAAoD;AACpD,kEAAgD;AAChD,+DAA6C;AAC7C,+DAA6C;AAC7C,uDAAqC;AACrC,iEAA+C;AAC/C,gEAA8C;AAC9C,yDAAuC;AACvC,4DAA0C;AAC1C,yEAAuD;AACvD,yDAAuC;AACvC,6DAA2C;AAC3C,kEAAgD;AAChD,0DAA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8C;AAC9C,0EAAwD;AACxD,iEAA+C;AAC/C,yDAAuC;AACvC,gEAA8C;AAC9C,6EAA2D;AAC3D,sEAAoD;AACpD,yEAAuD;AACvD,iEAA+C;AAC/C,2DAAyC;AACzC,yEAAuD;AACvD,6DAA2C;AAC3C,sDAAoC;AACpC,wDAAsC;AACtC,iEAA+C;AAC/C,gEAA8C;AAC9C,8DAA4C;AAC5C,0DAAwC;AACxC,uEAAqD;AACrD,sDAAoC;AACpC,8DAA4C"}
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"products-cannot-be-removed-from-default-channel": "Products cannot be removed from the default Channel",
|
|
41
41
|
"product-id-or-slug-must-be-provided": "Either the Product id or slug must be provided",
|
|
42
42
|
"product-id-slug-mismatch": "The provided id and slug refer to different Products",
|
|
43
|
+
"product-option-group-already-assigned": "The ProductOptionGroup \"{ groupCode }\" is already assigned to the Product \"{ productName }\"",
|
|
43
44
|
"product-variant-option-ids-not-compatible": "ProductVariant optionIds must include one optionId from each of the groups: {groupNames}",
|
|
44
45
|
"product-variant-options-combination-already-exists": "A ProductVariant with the selected options already exists: {variantName}",
|
|
45
46
|
"promotion-channels-can-only-be-changed-from-default-channel": "Promotions channels may only be changed from the Default Channel",
|
|
@@ -51,6 +52,7 @@
|
|
|
51
52
|
"ALREADY_LOGGED_IN_ERROR": "Cannot set a Customer for the Order when already logged in",
|
|
52
53
|
"ALREADY_REFUNDED_ERROR": "Cannot refund an OrderItem which has already been refunded",
|
|
53
54
|
"CANCEL_ACTIVE_ORDER_ERROR": "Cannot cancel OrderLines from an Order in the \"{ orderState }\" state",
|
|
55
|
+
"CANCEL_PAYMENT_ERROR": "Cancelling the payment failed",
|
|
54
56
|
"CHANNEL_DEFAULT_LANGUAGE_ERROR": "Cannot make language \"{ language }\" unavailable as it is used as the defaultLanguage by the channel \"{ channelCode }\"",
|
|
55
57
|
"COUPON_CODE_EXPIRED_ERROR": "Coupon code \"{ couponCode }\" has expired",
|
|
56
58
|
"COUPON_CODE_INVALID_ERROR": "Coupon code \"{ couponCode }\" is not valid",
|
|
@@ -116,6 +118,7 @@
|
|
|
116
118
|
"facet-value-force-deleted": "The selected FacetValue was removed from {products, plural, =0 {} one {1 Product} other {# Products}}{both, select, both { , } single {}}{variants, plural, =0 {} one {1 ProductVariant} other {# ProductVariants}} and deleted",
|
|
117
119
|
"facet-value-used": "The selected FacetValue is assigned to {products, plural, =0 {} one {1 Product} other {# Products}}{both, select, both { , } single {}}{variants, plural, =0 {} one {1 ProductVariant} other {# ProductVariants}}",
|
|
118
120
|
"payment-method-used-in-channels": "The selected PaymentMethod is assigned to the following Channels: { channelCodes }. Set \"force: true\" to delete from all Channels.",
|
|
121
|
+
"product-option-used": "Cannot delete the option \"{code}\" as it is being used by {count, plural, =0 {} one {1 ProductVariant} other {# ProductVariants}}",
|
|
119
122
|
"zone-used-in-channels": "The selected Zone cannot be deleted as it used as a default in the following Channels: { channelCodes }",
|
|
120
123
|
"zone-used-in-tax-rates": "The selected Zone cannot be deleted as it is used in the following TaxRates: { taxRateNames }"
|
|
121
124
|
}
|
|
@@ -26,7 +26,7 @@ import { JobData } from './types';
|
|
|
26
26
|
* @docsCategory JobQueue
|
|
27
27
|
*/
|
|
28
28
|
export declare class InMemoryJobQueueStrategy extends PollingJobQueueStrategy implements InspectableJobQueueStrategy {
|
|
29
|
-
protected jobs: Map<
|
|
29
|
+
protected jobs: Map<any, Job<any>>;
|
|
30
30
|
protected unsettledJobs: {
|
|
31
31
|
[queueName: string]: Array<{
|
|
32
32
|
job: Job;
|
package/dist/migrate.js
CHANGED
|
@@ -12,6 +12,7 @@ const typeorm_1 = require("typeorm");
|
|
|
12
12
|
const MysqlDriver_1 = require("typeorm/driver/mysql/MysqlDriver");
|
|
13
13
|
const StringUtils_1 = require("typeorm/util/StringUtils");
|
|
14
14
|
const bootstrap_1 = require("./bootstrap");
|
|
15
|
+
const config_helpers_1 = require("./config/config-helpers");
|
|
15
16
|
/**
|
|
16
17
|
* @description
|
|
17
18
|
* Runs any pending database migrations. See [TypeORM migration docs](https://typeorm.io/#/migrations)
|
|
@@ -34,10 +35,21 @@ async function runMigrations(userConfig) {
|
|
|
34
35
|
process.exitCode = 1;
|
|
35
36
|
}
|
|
36
37
|
finally {
|
|
38
|
+
await checkMigrationStatus(connection);
|
|
37
39
|
await connection.close();
|
|
40
|
+
config_helpers_1.resetConfig();
|
|
38
41
|
}
|
|
39
42
|
}
|
|
40
43
|
exports.runMigrations = runMigrations;
|
|
44
|
+
async function checkMigrationStatus(connection) {
|
|
45
|
+
const builderLog = await connection.driver.createSchemaBuilder().log();
|
|
46
|
+
if (builderLog.upQueries.length) {
|
|
47
|
+
console.log(chalk_1.default.yellow(`Your database schema does not match your current configuration. Generate a new migration for the following changes:`));
|
|
48
|
+
for (const query of builderLog.upQueries) {
|
|
49
|
+
console.log(' - ' + chalk_1.default.yellow(query.query));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
41
53
|
/**
|
|
42
54
|
* @description
|
|
43
55
|
* Reverts the last applied database migration. See [TypeORM migration docs](https://typeorm.io/#/migrations)
|
|
@@ -58,6 +70,7 @@ async function revertLastMigration(userConfig) {
|
|
|
58
70
|
}
|
|
59
71
|
finally {
|
|
60
72
|
await connection.close();
|
|
73
|
+
config_helpers_1.resetConfig();
|
|
61
74
|
}
|
|
62
75
|
}
|
|
63
76
|
exports.revertLastMigration = revertLastMigration;
|
|
@@ -129,6 +142,7 @@ async function generateMigration(userConfig, options) {
|
|
|
129
142
|
console.log(chalk_1.default.yellow(`No changes in database schema were found - cannot generate a migration.`));
|
|
130
143
|
}
|
|
131
144
|
await connection.close();
|
|
145
|
+
config_helpers_1.resetConfig();
|
|
132
146
|
}
|
|
133
147
|
exports.generateMigration = generateMigration;
|
|
134
148
|
function createConnectionOptions(userConfig) {
|
package/dist/migrate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate.js","sourceRoot":"","sources":["../src/migrate.ts"],"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AAC;AACF,CAAC"}
|
|
@@ -24,8 +24,8 @@ class MysqlSearchStrategy {
|
|
|
24
24
|
const facetValuesQb = this.connection
|
|
25
25
|
.getRepository(ctx, search_index_item_entity_1.SearchIndexItem)
|
|
26
26
|
.createQueryBuilder('si')
|
|
27
|
-
.select(['MIN(productId)', 'MIN(productVariantId)'])
|
|
28
|
-
.addSelect('GROUP_CONCAT(facetValueIds)', 'facetValues');
|
|
27
|
+
.select(['MIN(si.productId)', 'MIN(si.productVariantId)'])
|
|
28
|
+
.addSelect('GROUP_CONCAT(si.facetValueIds)', 'facetValues');
|
|
29
29
|
this.applyTermAndFilters(ctx, facetValuesQb, Object.assign(Object.assign({}, input), { groupByProduct: true }));
|
|
30
30
|
if (!input.groupByProduct) {
|
|
31
31
|
facetValuesQb.groupBy('productVariantId');
|
|
@@ -40,11 +40,11 @@ class MysqlSearchStrategy {
|
|
|
40
40
|
const collectionsQb = this.connection
|
|
41
41
|
.getRepository(ctx, search_index_item_entity_1.SearchIndexItem)
|
|
42
42
|
.createQueryBuilder('si')
|
|
43
|
-
.select(['MIN(productId)', 'MIN(productVariantId)'])
|
|
44
|
-
.addSelect('GROUP_CONCAT(collectionIds)', 'collections');
|
|
43
|
+
.select(['MIN(si.productId)', 'MIN(si.productVariantId)'])
|
|
44
|
+
.addSelect('GROUP_CONCAT(si.collectionIds)', 'collections');
|
|
45
45
|
this.applyTermAndFilters(ctx, collectionsQb, input);
|
|
46
46
|
if (!input.groupByProduct) {
|
|
47
|
-
collectionsQb.groupBy('productVariantId');
|
|
47
|
+
collectionsQb.groupBy('si.productVariantId');
|
|
48
48
|
}
|
|
49
49
|
if (enabledOnly) {
|
|
50
50
|
collectionsQb.andWhere('si.enabled = :enabled', { enabled: true });
|
|
@@ -61,18 +61,18 @@ class MysqlSearchStrategy {
|
|
|
61
61
|
.createQueryBuilder('si')
|
|
62
62
|
.select(this.createMysqlSelect(!!input.groupByProduct));
|
|
63
63
|
if (input.groupByProduct) {
|
|
64
|
-
qb.addSelect('MIN(price)', 'minPrice')
|
|
65
|
-
.addSelect('MAX(price)', 'maxPrice')
|
|
66
|
-
.addSelect('MIN(priceWithTax)', 'minPriceWithTax')
|
|
67
|
-
.addSelect('MAX(priceWithTax)', 'maxPriceWithTax');
|
|
64
|
+
qb.addSelect('MIN(si.price)', 'minPrice')
|
|
65
|
+
.addSelect('MAX(si.price)', 'maxPrice')
|
|
66
|
+
.addSelect('MIN(si.priceWithTax)', 'minPriceWithTax')
|
|
67
|
+
.addSelect('MAX(si.priceWithTax)', 'maxPriceWithTax');
|
|
68
68
|
}
|
|
69
69
|
this.applyTermAndFilters(ctx, qb, input);
|
|
70
70
|
if (sort) {
|
|
71
71
|
if (sort.name) {
|
|
72
|
-
qb.addOrderBy(input.groupByProduct ? 'MIN(productName)' : 'productName', sort.name);
|
|
72
|
+
qb.addOrderBy(input.groupByProduct ? 'MIN(si.productName)' : 'si.productName', sort.name);
|
|
73
73
|
}
|
|
74
74
|
if (sort.price) {
|
|
75
|
-
qb.addOrderBy(input.groupByProduct ? 'MIN(price)' : 'price', sort.price);
|
|
75
|
+
qb.addOrderBy(input.groupByProduct ? 'MIN(si.price)' : 'si.price', sort.price);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
else {
|
|
@@ -84,8 +84,8 @@ class MysqlSearchStrategy {
|
|
|
84
84
|
qb.andWhere('si.enabled = :enabled', { enabled: true });
|
|
85
85
|
}
|
|
86
86
|
return qb
|
|
87
|
-
.
|
|
88
|
-
.
|
|
87
|
+
.limit(take)
|
|
88
|
+
.offset(skip)
|
|
89
89
|
.getRawMany()
|
|
90
90
|
.then(res => res.map(r => search_strategy_utils_1.mapToSearchResult(r, ctx.channel.currencyCode)));
|
|
91
91
|
}
|
|
@@ -112,18 +112,18 @@ class MysqlSearchStrategy {
|
|
|
112
112
|
.createQueryBuilder('si_inner')
|
|
113
113
|
.select('si_inner.productId', 'inner_productId')
|
|
114
114
|
.addSelect('si_inner.productVariantId', 'inner_productVariantId')
|
|
115
|
-
.addSelect(`IF (sku LIKE :like_term, 10, 0)`, 'sku_score')
|
|
115
|
+
.addSelect(`IF (si_inner.sku LIKE :like_term, 10, 0)`, 'sku_score')
|
|
116
116
|
.addSelect(`(SELECT sku_score) +
|
|
117
|
-
MATCH (productName) AGAINST (:term IN BOOLEAN MODE) * 2 +
|
|
118
|
-
MATCH (productVariantName) AGAINST (:term IN BOOLEAN MODE) * 1.5 +
|
|
119
|
-
MATCH (description) AGAINST (:term IN BOOLEAN MODE) * 1`, 'score')
|
|
117
|
+
MATCH (si_inner.productName) AGAINST (:term IN BOOLEAN MODE) * 2 +
|
|
118
|
+
MATCH (si_inner.productVariantName) AGAINST (:term IN BOOLEAN MODE) * 1.5 +
|
|
119
|
+
MATCH (si_inner.description) AGAINST (:term IN BOOLEAN MODE) * 1`, 'score')
|
|
120
120
|
.where(new typeorm_1.Brackets(qb1 => {
|
|
121
|
-
qb1.where('sku LIKE :like_term')
|
|
122
|
-
.orWhere('MATCH (productName) AGAINST (:term IN BOOLEAN MODE)')
|
|
123
|
-
.orWhere('MATCH (productVariantName) AGAINST (:term IN BOOLEAN MODE)')
|
|
124
|
-
.orWhere('MATCH (description) AGAINST (:term IN BOOLEAN MODE)');
|
|
121
|
+
qb1.where('si_inner.sku LIKE :like_term')
|
|
122
|
+
.orWhere('MATCH (si_inner.productName) AGAINST (:term IN BOOLEAN MODE)')
|
|
123
|
+
.orWhere('MATCH (si_inner.productVariantName) AGAINST (:term IN BOOLEAN MODE)')
|
|
124
|
+
.orWhere('MATCH (si_inner.description) AGAINST (:term IN BOOLEAN MODE)');
|
|
125
125
|
}))
|
|
126
|
-
.andWhere('channelId = :channelId')
|
|
126
|
+
.andWhere('si_inner.channelId = :channelId')
|
|
127
127
|
.setParameters({ term: `${term}*`, like_term: `%${term}%`, channelId: ctx.channelId });
|
|
128
128
|
qb.innerJoin(`(${termScoreQuery.getQuery()})`, 'term_result', 'inner_productId = si.productId')
|
|
129
129
|
.addSelect(input.groupByProduct ? 'MAX(term_result.score)' : 'term_result.score', 'score')
|
|
@@ -135,17 +135,17 @@ class MysqlSearchStrategy {
|
|
|
135
135
|
}
|
|
136
136
|
if (input.inStock != null) {
|
|
137
137
|
if (input.groupByProduct) {
|
|
138
|
-
qb.andWhere('productInStock = :inStock', { inStock: input.inStock });
|
|
138
|
+
qb.andWhere('si.productInStock = :inStock', { inStock: input.inStock });
|
|
139
139
|
}
|
|
140
140
|
else {
|
|
141
|
-
qb.andWhere('inStock = :inStock', { inStock: input.inStock });
|
|
141
|
+
qb.andWhere('si.inStock = :inStock', { inStock: input.inStock });
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
if (facetValueIds === null || facetValueIds === void 0 ? void 0 : facetValueIds.length) {
|
|
145
145
|
qb.andWhere(new typeorm_1.Brackets(qb1 => {
|
|
146
146
|
for (const id of facetValueIds) {
|
|
147
147
|
const placeholder = search_strategy_utils_1.createPlaceholderFromId(id);
|
|
148
|
-
const clause = `FIND_IN_SET(:${placeholder}, facetValueIds)`;
|
|
148
|
+
const clause = `FIND_IN_SET(:${placeholder}, si.facetValueIds)`;
|
|
149
149
|
const params = { [placeholder]: id };
|
|
150
150
|
if (facetValueOperator === generated_types_1.LogicalOperator.AND) {
|
|
151
151
|
qb1.andWhere(clause, params);
|
|
@@ -166,14 +166,14 @@ class MysqlSearchStrategy {
|
|
|
166
166
|
}
|
|
167
167
|
if (facetValueFilter.and) {
|
|
168
168
|
const placeholder = search_strategy_utils_1.createPlaceholderFromId(facetValueFilter.and);
|
|
169
|
-
const clause = `FIND_IN_SET(:${placeholder}, facetValueIds)`;
|
|
169
|
+
const clause = `FIND_IN_SET(:${placeholder}, si.facetValueIds)`;
|
|
170
170
|
const params = { [placeholder]: facetValueFilter.and };
|
|
171
171
|
qb2.where(clause, params);
|
|
172
172
|
}
|
|
173
173
|
if ((_b = facetValueFilter.or) === null || _b === void 0 ? void 0 : _b.length) {
|
|
174
174
|
for (const id of facetValueFilter.or) {
|
|
175
175
|
const placeholder = search_strategy_utils_1.createPlaceholderFromId(id);
|
|
176
|
-
const clause = `FIND_IN_SET(:${placeholder}, facetValueIds)`;
|
|
176
|
+
const clause = `FIND_IN_SET(:${placeholder}, si.facetValueIds)`;
|
|
177
177
|
const params = { [placeholder]: id };
|
|
178
178
|
qb2.orWhere(clause, params);
|
|
179
179
|
}
|
|
@@ -183,16 +183,16 @@ class MysqlSearchStrategy {
|
|
|
183
183
|
}));
|
|
184
184
|
}
|
|
185
185
|
if (collectionId) {
|
|
186
|
-
qb.andWhere(`FIND_IN_SET (:collectionId, collectionIds)`, { collectionId });
|
|
186
|
+
qb.andWhere(`FIND_IN_SET (:collectionId, si.collectionIds)`, { collectionId });
|
|
187
187
|
}
|
|
188
188
|
if (collectionSlug) {
|
|
189
|
-
qb.andWhere(`FIND_IN_SET (:collectionSlug, collectionSlugs)`, { collectionSlug });
|
|
189
|
+
qb.andWhere(`FIND_IN_SET (:collectionSlug, si.collectionSlugs)`, { collectionSlug });
|
|
190
190
|
}
|
|
191
|
-
|
|
192
|
-
qb.andWhere('channelId = :channelId', { channelId: ctx.channelId });
|
|
191
|
+
search_strategy_utils_1.applyLanguageConstraints(qb, ctx.languageCode, ctx.channel.defaultLanguageCode);
|
|
192
|
+
qb.andWhere('si.channelId = :channelId', { channelId: ctx.channelId });
|
|
193
193
|
if (input.groupByProduct === true) {
|
|
194
|
-
qb.groupBy('productId');
|
|
195
|
-
qb.addSelect('BIT_OR(enabled)', 'productEnabled');
|
|
194
|
+
qb.groupBy('si.productId');
|
|
195
|
+
qb.addSelect('BIT_OR(si.enabled)', 'productEnabled');
|
|
196
196
|
}
|
|
197
197
|
return qb;
|
|
198
198
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mysql-search-strategy.js","sourceRoot":"","sources":["../../../../src/plugin/default-search-plugin/search-strategy/mysql-search-strategy.ts"],"names":[],"mappings":";;;AAAA,yEAAoF;AAEpF,qCAAuD;AAIvD,yDAA8D;AAC9D,2FAAuF;AACvF,4CAAmD;AACnD,mFAAuE;AAIvE,qEAA6D;AAC7D,
|
|
1
|
+
{"version":3,"file":"mysql-search-strategy.js","sourceRoot":"","sources":["../../../../src/plugin/default-search-plugin/search-strategy/mysql-search-strategy.ts"],"names":[],"mappings":";;;AAAA,yEAAoF;AAEpF,qCAAuD;AAIvD,yDAA8D;AAC9D,2FAAuF;AACvF,4CAAmD;AACnD,mFAAuE;AAIvE,qEAA6D;AAC7D,mEAMiC;AAEjC;;GAEG;AACH,MAAa,mBAAmB;IAAhC;QACqB,kBAAa,GAAG,CAAC,CAAC;IA6PvC,CAAC;IAzPG,KAAK,CAAC,IAAI,CAAC,QAAkB;QACzB,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC,GAAG,CAAC,kDAAuB,CAAC,CAAC;QACxD,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,+BAAmB,CAAC,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,gBAAgB,CAClB,GAAmB,EACnB,KAAkB,EAClB,WAAoB;QAEpB,MAAM,aAAa,GAAG,IAAI,CAAC,UAAU;aAChC,aAAa,CAAC,GAAG,EAAE,0CAAe,CAAC;aACnC,kBAAkB,CAAC,IAAI,CAAC;aACxB,MAAM,CAAC,CAAC,mBAAmB,EAAE,0BAA0B,CAAC,CAAC;aACzD,SAAS,CAAC,gCAAgC,EAAE,aAAa,CAAC,CAAC;QAEhE,IAAI,CAAC,mBAAmB,CAAC,GAAG,EAAE,aAAa,kCAAO,KAAK,KAAE,cAAc,EAAE,IAAI,IAAG,CAAC;QACjF,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE;YACvB,aAAa,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;SAC7C;QACD,IAAI,WAAW,EAAE;YACb,aAAa,CAAC,QAAQ,CAAC,uBAAuB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;SACtE;QACD,MAAM,iBAAiB,GAA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QAC7C,OAAO,0CAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC;aAClD,GAAG,CAAC,GAAG,CAAC,EAAE;YACP,MAAM,aAAa,GAAG,MAAM,GAAG,EAAE,CAAC;YAClC,MAAM,KAAK,GAAG,MAAM,GAAG,EAAE,CAAC;YAC1B,IAAI,cAAc,IAAI,GAAG,KAAK,WAAW,EAAE;gBACvC,IACI,GAAG,KAAK,UAAU;oBAClB,GAAG,KAAK,eAAe;oBACvB,GAAG,KAAK,eAAe;oBACvB,GAAG,KAAK,YAAY,EACtB;oBACE,OAAO,gBAAgB,aAAa,SAAS,KAAK,GAAG,CAAC;iBACzD;qBAAM,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,gBAAgB,EAAE;oBAC3E,OAAO,OAAO,aAAa,SAAS,KAAK,GAAG,CAAC;iBAChD;qBAAM;oBACH,OAAO,OAAO,aAAa,SAAS,KAAK,GAAG,CAAC;iBAChD;aACJ;iBAAM;gBACH,OAAO,GAAG,aAAa,QAAQ,KAAK,GAAG,CAAC;aAC3C;QACL,CAAC,CAAC;aACD,IAAI,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;CACJ;AA9PD,kDA8PC"}
|
|
@@ -61,10 +61,10 @@ class PostgresSearchStrategy {
|
|
|
61
61
|
.createQueryBuilder('si')
|
|
62
62
|
.select(this.createPostgresSelect(!!input.groupByProduct));
|
|
63
63
|
if (input.groupByProduct) {
|
|
64
|
-
qb.addSelect('MIN(price)', 'minPrice')
|
|
65
|
-
.addSelect('MAX(price)', 'maxPrice')
|
|
66
|
-
.addSelect('MIN(
|
|
67
|
-
.addSelect('MAX(
|
|
64
|
+
qb.addSelect('MIN(si.price)', 'minPrice')
|
|
65
|
+
.addSelect('MAX(si.price)', 'maxPrice')
|
|
66
|
+
.addSelect('MIN(si.priceWithTax)', 'minPriceWithTax')
|
|
67
|
+
.addSelect('MAX(si.priceWithTax)', 'maxPriceWithTax');
|
|
68
68
|
}
|
|
69
69
|
this.applyTermAndFilters(ctx, qb, input);
|
|
70
70
|
if (sort) {
|
|
@@ -87,8 +87,8 @@ class PostgresSearchStrategy {
|
|
|
87
87
|
qb.andWhere('"si"."enabled" = :enabled', { enabled: true });
|
|
88
88
|
}
|
|
89
89
|
return qb
|
|
90
|
-
.
|
|
91
|
-
.
|
|
90
|
+
.limit(take)
|
|
91
|
+
.offset(skip)
|
|
92
92
|
.getRawMany()
|
|
93
93
|
.then(res => res.map(r => search_strategy_utils_1.mapToSearchResult(r, ctx.channel.currencyCode)));
|
|
94
94
|
}
|
|
@@ -191,7 +191,7 @@ class PostgresSearchStrategy {
|
|
|
191
191
|
collectionSlug,
|
|
192
192
|
});
|
|
193
193
|
}
|
|
194
|
-
|
|
194
|
+
search_strategy_utils_1.applyLanguageConstraints(qb, ctx.languageCode, ctx.channel.defaultLanguageCode);
|
|
195
195
|
qb.andWhere('si.channelId = :channelId', { channelId: ctx.channelId });
|
|
196
196
|
if (input.groupByProduct === true) {
|
|
197
197
|
qb.groupBy('si.productId');
|