@vendure/core 1.5.2 → 1.6.0
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/configurable-operation-codec.js +2 -2
- package/dist/api/common/configurable-operation-codec.js.map +1 -1
- package/dist/api/decorators/relations.decorator.d.ts +102 -0
- package/dist/api/decorators/relations.decorator.js +187 -0
- package/dist/api/decorators/relations.decorator.js.map +1 -0
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.js +1 -0
- package/dist/api/index.js.map +1 -1
- package/dist/api/resolvers/admin/administrator.resolver.d.ts +3 -2
- package/dist/api/resolvers/admin/administrator.resolver.js +10 -6
- package/dist/api/resolvers/admin/administrator.resolver.js.map +1 -1
- package/dist/api/resolvers/admin/asset.resolver.d.ts +3 -2
- package/dist/api/resolvers/admin/asset.resolver.js +10 -6
- package/dist/api/resolvers/admin/asset.resolver.js.map +1 -1
- package/dist/api/resolvers/admin/collection.resolver.d.ts +5 -3
- package/dist/api/resolvers/admin/collection.resolver.js +25 -7
- package/dist/api/resolvers/admin/collection.resolver.js.map +1 -1
- package/dist/api/resolvers/admin/country.resolver.d.ts +3 -2
- package/dist/api/resolvers/admin/country.resolver.js +10 -6
- package/dist/api/resolvers/admin/country.resolver.js.map +1 -1
- package/dist/api/resolvers/admin/customer-group.resolver.d.ts +3 -2
- package/dist/api/resolvers/admin/customer-group.resolver.js +8 -4
- package/dist/api/resolvers/admin/customer-group.resolver.js.map +1 -1
- package/dist/api/resolvers/admin/customer.resolver.d.ts +3 -2
- package/dist/api/resolvers/admin/customer.resolver.js +10 -6
- package/dist/api/resolvers/admin/customer.resolver.js.map +1 -1
- package/dist/api/resolvers/admin/facet.resolver.d.ts +3 -2
- package/dist/api/resolvers/admin/facet.resolver.js +10 -6
- package/dist/api/resolvers/admin/facet.resolver.js.map +1 -1
- package/dist/api/resolvers/admin/order.resolver.d.ts +6 -5
- package/dist/api/resolvers/admin/order.resolver.js +25 -11
- package/dist/api/resolvers/admin/order.resolver.js.map +1 -1
- package/dist/api/resolvers/admin/payment-method.resolver.d.ts +3 -2
- package/dist/api/resolvers/admin/payment-method.resolver.js +10 -6
- package/dist/api/resolvers/admin/payment-method.resolver.js.map +1 -1
- package/dist/api/resolvers/admin/product-option.resolver.d.ts +3 -2
- package/dist/api/resolvers/admin/product-option.resolver.js +8 -4
- package/dist/api/resolvers/admin/product-option.resolver.js.map +1 -1
- package/dist/api/resolvers/admin/product.resolver.d.ts +4 -3
- package/dist/api/resolvers/admin/product.resolver.js +16 -10
- package/dist/api/resolvers/admin/product.resolver.js.map +1 -1
- package/dist/api/resolvers/admin/promotion.resolver.d.ts +3 -2
- package/dist/api/resolvers/admin/promotion.resolver.js +9 -6
- package/dist/api/resolvers/admin/promotion.resolver.js.map +1 -1
- package/dist/api/resolvers/admin/role.resolver.d.ts +3 -2
- package/dist/api/resolvers/admin/role.resolver.js +10 -6
- package/dist/api/resolvers/admin/role.resolver.js.map +1 -1
- package/dist/api/resolvers/admin/shipping-method.resolver.d.ts +3 -2
- package/dist/api/resolvers/admin/shipping-method.resolver.js +10 -6
- package/dist/api/resolvers/admin/shipping-method.resolver.js.map +1 -1
- package/dist/api/resolvers/admin/tax-rate.resolver.d.ts +3 -2
- package/dist/api/resolvers/admin/tax-rate.resolver.js +10 -6
- package/dist/api/resolvers/admin/tax-rate.resolver.js.map +1 -1
- package/dist/api/resolvers/entity/collection-entity.resolver.d.ts +2 -1
- package/dist/api/resolvers/entity/collection-entity.resolver.js +5 -3
- package/dist/api/resolvers/entity/collection-entity.resolver.js.map +1 -1
- package/dist/api/resolvers/entity/customer-entity.resolver.d.ts +2 -1
- package/dist/api/resolvers/entity/customer-entity.resolver.js +5 -3
- package/dist/api/resolvers/entity/customer-entity.resolver.js.map +1 -1
- package/dist/api/resolvers/entity/order-line-entity.resolver.d.ts +2 -1
- package/dist/api/resolvers/entity/order-line-entity.resolver.js +6 -3
- package/dist/api/resolvers/entity/order-line-entity.resolver.js.map +1 -1
- package/dist/api/resolvers/entity/product-entity.resolver.d.ts +3 -2
- package/dist/api/resolvers/entity/product-entity.resolver.js +10 -6
- package/dist/api/resolvers/entity/product-entity.resolver.js.map +1 -1
- package/dist/api/resolvers/shop/shop-order.resolver.d.ts +4 -3
- package/dist/api/resolvers/shop/shop-order.resolver.js +16 -8
- package/dist/api/resolvers/shop/shop-order.resolver.js.map +1 -1
- package/dist/api/resolvers/shop/shop-products.resolver.d.ts +8 -8
- package/dist/api/resolvers/shop/shop-products.resolver.js +32 -21
- package/dist/api/resolvers/shop/shop-products.resolver.js.map +1 -1
- package/dist/api/schema/admin-api/collection.api.graphql +7 -0
- package/dist/bootstrap.js +2 -0
- package/dist/bootstrap.js.map +1 -1
- package/dist/common/calculated-decorator.d.ts +16 -3
- package/dist/common/calculated-decorator.js +3 -0
- package/dist/common/calculated-decorator.js.map +1 -1
- package/dist/common/types/entity-relation-paths.d.ts +1 -1
- package/dist/config/catalog/collection-filter.d.ts +32 -0
- package/dist/config/catalog/collection-filter.js +32 -0
- package/dist/config/catalog/collection-filter.js.map +1 -1
- package/dist/config/catalog/default-collection-filters.d.ts +100 -0
- package/dist/config/catalog/default-collection-filters.js +154 -21
- package/dist/config/catalog/default-collection-filters.js.map +1 -1
- package/dist/config/config.module.js +2 -0
- package/dist/config/config.module.js.map +1 -1
- package/dist/config/config.service.d.ts +2 -1
- package/dist/config/config.service.js +3 -0
- package/dist/config/config.service.js.map +1 -1
- package/dist/config/custom-field/custom-field-types.d.ts +3 -0
- package/dist/config/default-config.js +5 -0
- package/dist/config/default-config.js.map +1 -1
- package/dist/config/entity-metadata/add-foreign-key-indices.d.ts +12 -0
- package/dist/config/entity-metadata/add-foreign-key-indices.js +33 -0
- package/dist/config/entity-metadata/add-foreign-key-indices.js.map +1 -0
- package/dist/config/entity-metadata/entity-metadata-modifier.d.ts +55 -0
- package/dist/config/entity-metadata/entity-metadata-modifier.js +3 -0
- package/dist/config/entity-metadata/entity-metadata-modifier.js.map +1 -0
- package/dist/config/index.d.ts +3 -0
- package/dist/config/index.js +3 -0
- package/dist/config/index.js.map +1 -1
- package/dist/config/payment/dummy-payment-method-handler.js +2 -2
- package/dist/config/payment/dummy-payment-method-handler.js.map +1 -1
- package/dist/config/payment/example-payment-method-handler.js +2 -2
- package/dist/config/payment/example-payment-method-handler.js.map +1 -1
- package/dist/config/payment/payment-method-eligibility-checker.d.ts +3 -3
- package/dist/config/payment/payment-method-eligibility-checker.js +2 -2
- package/dist/config/payment/payment-method-eligibility-checker.js.map +1 -1
- package/dist/config/payment/payment-method-handler.d.ts +7 -8
- package/dist/config/payment/payment-method-handler.js +6 -6
- package/dist/config/payment/payment-method-handler.js.map +1 -1
- package/dist/config/shipping-method/shipping-calculator.d.ts +3 -3
- package/dist/config/shipping-method/shipping-calculator.js +2 -2
- package/dist/config/shipping-method/shipping-calculator.js.map +1 -1
- package/dist/config/shipping-method/shipping-eligibility-checker.d.ts +4 -4
- package/dist/config/shipping-method/shipping-eligibility-checker.js +5 -5
- package/dist/config/shipping-method/shipping-eligibility-checker.js.map +1 -1
- package/dist/config/system/health-check-strategy.d.ts +47 -0
- package/dist/config/system/health-check-strategy.js +3 -0
- package/dist/config/system/health-check-strategy.js.map +1 -0
- package/dist/config/vendure-config.d.ts +39 -0
- package/dist/connection/transactional-connection.js +5 -0
- package/dist/connection/transactional-connection.js.map +1 -1
- package/dist/data-import/providers/importer/importer.d.ts +3 -2
- package/dist/data-import/providers/importer/importer.js +1 -0
- package/dist/data-import/providers/importer/importer.js.map +1 -1
- package/dist/entity/order/order.entity.js +3 -2
- package/dist/entity/order/order.entity.js.map +1 -1
- package/dist/entity/order-line/order-line.entity.js +22 -22
- package/dist/entity/order-line/order-line.entity.js.map +1 -1
- package/dist/entity/register-custom-entity-fields.js +8 -0
- package/dist/entity/register-custom-entity-fields.js.map +1 -1
- package/dist/entity/run-entity-metadata-modifiers.d.ts +2 -0
- package/dist/entity/run-entity-metadata-modifiers.js +15 -0
- package/dist/entity/run-entity-metadata-modifiers.js.map +1 -0
- package/dist/entity/shipping-method/shipping-method.entity.js +2 -2
- package/dist/entity/shipping-method/shipping-method.entity.js.map +1 -1
- package/dist/event-bus/events/role-event.d.ts +1 -1
- package/dist/event-bus/events/role-event.js +1 -1
- package/dist/event-bus/events/search-event.d.ts +20 -0
- package/dist/event-bus/events/search-event.js +21 -0
- package/dist/event-bus/events/search-event.js.map +1 -0
- 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/health-check/health-check-registry.service.d.ts +7 -1
- package/dist/health-check/health-check-registry.service.js +7 -1
- package/dist/health-check/health-check-registry.service.js.map +1 -1
- package/dist/health-check/health-check.module.d.ts +1 -3
- package/dist/health-check/health-check.module.js +6 -5
- package/dist/health-check/health-check.module.js.map +1 -1
- package/dist/health-check/http-health-check-strategy.d.ts +36 -0
- package/dist/health-check/http-health-check-strategy.js +41 -0
- package/dist/health-check/http-health-check-strategy.js.map +1 -0
- package/dist/health-check/index.d.ts +2 -0
- package/dist/health-check/index.js +2 -0
- package/dist/health-check/index.js.map +1 -1
- package/dist/health-check/typeorm-health-check-strategy.d.ts +36 -0
- package/dist/health-check/typeorm-health-check-strategy.js +44 -0
- package/dist/health-check/typeorm-health-check-strategy.js.map +1 -0
- package/dist/job-queue/subscribable-job.js +1 -1
- package/dist/plugin/default-search-plugin/default-search-plugin.d.ts +9 -3
- package/dist/plugin/default-search-plugin/default-search-plugin.js +25 -2
- package/dist/plugin/default-search-plugin/default-search-plugin.js.map +1 -1
- package/dist/plugin/default-search-plugin/fulltext-search.service.d.ts +3 -1
- package/dist/plugin/default-search-plugin/fulltext-search.service.js +29 -19
- package/dist/plugin/default-search-plugin/fulltext-search.service.js.map +1 -1
- package/dist/plugin/default-search-plugin/indexer/search-index.service.js +1 -1
- package/dist/plugin/default-search-plugin/indexer/search-index.service.js.map +1 -1
- package/dist/plugin/default-search-plugin/search-strategy/mysql-search-strategy.d.ts +4 -4
- package/dist/plugin/default-search-plugin/search-strategy/mysql-search-strategy.js +7 -3
- 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.d.ts +4 -4
- package/dist/plugin/default-search-plugin/search-strategy/postgres-search-strategy.js +7 -3
- 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.d.ts +2 -1
- package/dist/plugin/default-search-plugin/search-strategy/sqlite-search-strategy.d.ts +4 -4
- package/dist/plugin/default-search-plugin/search-strategy/sqlite-search-strategy.js +7 -3
- package/dist/plugin/default-search-plugin/search-strategy/sqlite-search-strategy.js.map +1 -1
- package/dist/plugin/default-search-plugin/types.d.ts +84 -0
- package/dist/service/helpers/list-query-builder/list-query-builder.d.ts +28 -0
- package/dist/service/helpers/list-query-builder/list-query-builder.js +118 -17
- package/dist/service/helpers/list-query-builder/list-query-builder.js.map +1 -1
- package/dist/service/helpers/list-query-builder/parse-channel-param.d.ts +1 -1
- package/dist/service/helpers/list-query-builder/parse-channel-param.js +2 -2
- package/dist/service/helpers/list-query-builder/parse-channel-param.js.map +1 -1
- package/dist/service/helpers/list-query-builder/parse-filter-params.d.ts +1 -1
- package/dist/service/helpers/list-query-builder/parse-filter-params.js +3 -2
- package/dist/service/helpers/list-query-builder/parse-filter-params.js.map +1 -1
- package/dist/service/helpers/list-query-builder/parse-sort-params.d.ts +1 -1
- package/dist/service/helpers/list-query-builder/parse-sort-params.js +4 -3
- package/dist/service/helpers/list-query-builder/parse-sort-params.js.map +1 -1
- package/dist/service/helpers/order-modifier/order-modifier.js +2 -1
- package/dist/service/helpers/order-modifier/order-modifier.js.map +1 -1
- package/dist/service/services/administrator.service.d.ts +4 -3
- package/dist/service/services/administrator.service.js +6 -5
- package/dist/service/services/administrator.service.js.map +1 -1
- package/dist/service/services/asset.service.d.ts +3 -2
- package/dist/service/services/asset.service.js +6 -4
- package/dist/service/services/asset.service.js.map +1 -1
- package/dist/service/services/collection.service.d.ts +8 -5
- package/dist/service/services/collection.service.js +42 -12
- package/dist/service/services/collection.service.js.map +1 -1
- package/dist/service/services/country.service.d.ts +3 -2
- package/dist/service/services/country.service.js +4 -4
- package/dist/service/services/country.service.js.map +1 -1
- package/dist/service/services/customer-group.service.d.ts +3 -2
- package/dist/service/services/customer-group.service.js +4 -4
- package/dist/service/services/customer-group.service.js.map +1 -1
- package/dist/service/services/customer.service.d.ts +3 -2
- package/dist/service/services/customer.service.js +3 -3
- package/dist/service/services/customer.service.js.map +1 -1
- package/dist/service/services/facet.service.d.ts +3 -2
- package/dist/service/services/facet.service.js +10 -6
- package/dist/service/services/facet.service.js.map +1 -1
- package/dist/service/services/order.service.d.ts +15 -8
- package/dist/service/services/order.service.js +57 -40
- package/dist/service/services/order.service.js.map +1 -1
- package/dist/service/services/payment-method.service.d.ts +3 -2
- package/dist/service/services/payment-method.service.js +7 -5
- package/dist/service/services/payment-method.service.js.map +1 -1
- package/dist/service/services/payment.service.js +4 -4
- package/dist/service/services/payment.service.js.map +1 -1
- package/dist/service/services/product-option-group.service.d.ts +3 -2
- package/dist/service/services/product-option-group.service.js +4 -4
- package/dist/service/services/product-option-group.service.js.map +1 -1
- package/dist/service/services/product-variant.service.d.ts +10 -3
- package/dist/service/services/product-variant.service.js +35 -35
- package/dist/service/services/product-variant.service.js.map +1 -1
- package/dist/service/services/product.service.d.ts +5 -4
- package/dist/service/services/product.service.js +18 -8
- package/dist/service/services/product.service.js.map +1 -1
- package/dist/service/services/promotion.service.d.ts +3 -2
- package/dist/service/services/promotion.service.js +4 -3
- package/dist/service/services/promotion.service.js.map +1 -1
- package/dist/service/services/role.service.d.ts +3 -2
- package/dist/service/services/role.service.js +4 -4
- package/dist/service/services/role.service.js.map +1 -1
- package/dist/service/services/shipping-method.service.d.ts +3 -2
- package/dist/service/services/shipping-method.service.js +4 -4
- package/dist/service/services/shipping-method.service.js.map +1 -1
- package/dist/service/services/tax-rate.service.d.ts +3 -2
- package/dist/service/services/tax-rate.service.js +4 -4
- package/dist/service/services/tax-rate.service.js.map +1 -1
- package/dist/service/services/zone.service.d.ts +2 -2
- package/dist/service/services/zone.service.js +2 -2
- package/dist/service/services/zone.service.js.map +1 -1
- package/package.json +5 -3
|
@@ -15,10 +15,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.ProductOptionResolver = void 0;
|
|
16
16
|
const graphql_1 = require("@nestjs/graphql");
|
|
17
17
|
const generated_types_1 = require("@vendure/common/lib/generated-types");
|
|
18
|
+
const product_option_group_entity_1 = require("../../../entity/product-option-group/product-option-group.entity");
|
|
18
19
|
const product_option_group_service_1 = require("../../../service/services/product-option-group.service");
|
|
19
20
|
const product_option_service_1 = require("../../../service/services/product-option.service");
|
|
20
21
|
const request_context_1 = require("../../common/request-context");
|
|
21
22
|
const allow_decorator_1 = require("../../decorators/allow.decorator");
|
|
23
|
+
const relations_decorator_1 = require("../../decorators/relations.decorator");
|
|
22
24
|
const request_context_decorator_1 = require("../../decorators/request-context.decorator");
|
|
23
25
|
const transaction_decorator_1 = require("../../decorators/transaction.decorator");
|
|
24
26
|
let ProductOptionResolver = class ProductOptionResolver {
|
|
@@ -26,10 +28,10 @@ let ProductOptionResolver = class ProductOptionResolver {
|
|
|
26
28
|
this.productOptionGroupService = productOptionGroupService;
|
|
27
29
|
this.productOptionService = productOptionService;
|
|
28
30
|
}
|
|
29
|
-
productOptionGroups(ctx, args) {
|
|
31
|
+
productOptionGroups(ctx, args, relations) {
|
|
30
32
|
return this.productOptionGroupService.findAll(ctx, args.filterTerm || undefined);
|
|
31
33
|
}
|
|
32
|
-
productOptionGroup(ctx, args) {
|
|
34
|
+
productOptionGroup(ctx, args, relations) {
|
|
33
35
|
return this.productOptionGroupService.findOne(ctx, args.id);
|
|
34
36
|
}
|
|
35
37
|
async createProductOptionGroup(ctx, args) {
|
|
@@ -61,8 +63,9 @@ __decorate([
|
|
|
61
63
|
allow_decorator_1.Allow(generated_types_1.Permission.ReadCatalog, generated_types_1.Permission.ReadProduct),
|
|
62
64
|
__param(0, request_context_decorator_1.Ctx()),
|
|
63
65
|
__param(1, graphql_1.Args()),
|
|
66
|
+
__param(2, relations_decorator_1.Relations(product_option_group_entity_1.ProductOptionGroup)),
|
|
64
67
|
__metadata("design:type", Function),
|
|
65
|
-
__metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
|
|
68
|
+
__metadata("design:paramtypes", [request_context_1.RequestContext, Object, Array]),
|
|
66
69
|
__metadata("design:returntype", Promise)
|
|
67
70
|
], ProductOptionResolver.prototype, "productOptionGroups", null);
|
|
68
71
|
__decorate([
|
|
@@ -70,8 +73,9 @@ __decorate([
|
|
|
70
73
|
allow_decorator_1.Allow(generated_types_1.Permission.ReadCatalog, generated_types_1.Permission.ReadProduct),
|
|
71
74
|
__param(0, request_context_decorator_1.Ctx()),
|
|
72
75
|
__param(1, graphql_1.Args()),
|
|
76
|
+
__param(2, relations_decorator_1.Relations(product_option_group_entity_1.ProductOptionGroup)),
|
|
73
77
|
__metadata("design:type", Function),
|
|
74
|
-
__metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
|
|
78
|
+
__metadata("design:paramtypes", [request_context_1.RequestContext, Object, Array]),
|
|
75
79
|
__metadata("design:returntype", Promise)
|
|
76
80
|
], ProductOptionResolver.prototype, "productOptionGroup", null);
|
|
77
81
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-option.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/admin/product-option.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAkE;AAClE,yEAQ6C;
|
|
1
|
+
{"version":3,"file":"product-option.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/admin/product-option.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAkE;AAClE,yEAQ6C;AAG7C,kHAAsG;AAEtG,yGA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BAAU,CAAC,aAAa,EAAE,4BAAU,CAAC,aAAa,CAAC;IAErD,WAAA,+BAAG,EAAE,CAAA;IACL,WAAA,cAAI,EAAE,CAAA;;qCADK,gCAAc;;qEAK7B;AAKD;IAHC,mCAAW,EAAE;IACb,kBAAQ,EAAE;IACV,uBAAK,CAAC,4BAAU,CAAC,aAAa,EAAE,4BAAU,CAAC,aAAa,CAAC;IAErD,WAAA,+BAAG,EAAE,CAAA;IACL,WAAA,cAAI,EAAE,CAAA;;qCADK,gCAAc;;gEAK7B;AAKD;IAHC,mCAAW,EAAE;IACb,kBAAQ,EAAE;IACV,uBAAK,CAAC,4BAAU,CAAC,aAAa,EAAE,4BAAU,CAAC,aAAa,CAAC;IAErD,WAAA,+BAAG,EAAE,CAAA;IACL,WAAA,cAAI,EAAE,CAAA;;qCADK,gCAAc;;gEAK7B;AA5EQ,qBAAqB;IADjC,kBAAQ,EAAE;qCAGgC,wDAAyB;QAC9B,6CAAoB;GAH7C,qBAAqB,CA6EjC;AA7EY,sDAAqB"}
|
|
@@ -8,14 +8,15 @@ import { FacetValueService } from '../../../service/services/facet-value.service
|
|
|
8
8
|
import { ProductVariantService } from '../../../service/services/product-variant.service';
|
|
9
9
|
import { ProductService } from '../../../service/services/product.service';
|
|
10
10
|
import { RequestContext } from '../../common/request-context';
|
|
11
|
+
import { RelationPaths } from '../../decorators/relations.decorator';
|
|
11
12
|
export declare class ProductResolver {
|
|
12
13
|
private productService;
|
|
13
14
|
private productVariantService;
|
|
14
15
|
private facetValueService;
|
|
15
16
|
constructor(productService: ProductService, productVariantService: ProductVariantService, facetValueService: FacetValueService);
|
|
16
|
-
products(ctx: RequestContext, args: QueryProductsArgs): Promise<PaginatedList<Translated<Product>>>;
|
|
17
|
-
product(ctx: RequestContext, args: QueryProductArgs): Promise<Translated<Product> | undefined>;
|
|
18
|
-
productVariants(ctx: RequestContext, args: QueryProductVariantsArgs): Promise<PaginatedList<Translated<ProductVariant>>>;
|
|
17
|
+
products(ctx: RequestContext, args: QueryProductsArgs, relations: RelationPaths<Product>): Promise<PaginatedList<Translated<Product>>>;
|
|
18
|
+
product(ctx: RequestContext, args: QueryProductArgs, relations: RelationPaths<Product>): Promise<Translated<Product> | undefined>;
|
|
19
|
+
productVariants(ctx: RequestContext, args: QueryProductVariantsArgs, relations: RelationPaths<ProductVariant>): Promise<PaginatedList<Translated<ProductVariant>>>;
|
|
19
20
|
productVariant(ctx: RequestContext, args: QueryProductVariantArgs): Promise<Translated<ProductVariant> | undefined>;
|
|
20
21
|
createProduct(ctx: RequestContext, args: MutationCreateProductArgs): Promise<Translated<Product>>;
|
|
21
22
|
updateProduct(ctx: RequestContext, args: MutationUpdateProductArgs): Promise<Translated<Product>>;
|
|
@@ -16,11 +16,14 @@ exports.ProductResolver = void 0;
|
|
|
16
16
|
const graphql_1 = require("@nestjs/graphql");
|
|
17
17
|
const generated_types_1 = require("@vendure/common/lib/generated-types");
|
|
18
18
|
const errors_1 = require("../../../common/error/errors");
|
|
19
|
+
const product_variant_entity_1 = require("../../../entity/product-variant/product-variant.entity");
|
|
20
|
+
const product_entity_1 = require("../../../entity/product/product.entity");
|
|
19
21
|
const facet_value_service_1 = require("../../../service/services/facet-value.service");
|
|
20
22
|
const product_variant_service_1 = require("../../../service/services/product-variant.service");
|
|
21
23
|
const product_service_1 = require("../../../service/services/product.service");
|
|
22
24
|
const request_context_1 = require("../../common/request-context");
|
|
23
25
|
const allow_decorator_1 = require("../../decorators/allow.decorator");
|
|
26
|
+
const relations_decorator_1 = require("../../decorators/relations.decorator");
|
|
24
27
|
const request_context_decorator_1 = require("../../decorators/request-context.decorator");
|
|
25
28
|
const transaction_decorator_1 = require("../../decorators/transaction.decorator");
|
|
26
29
|
let ProductResolver = class ProductResolver {
|
|
@@ -29,27 +32,27 @@ let ProductResolver = class ProductResolver {
|
|
|
29
32
|
this.productVariantService = productVariantService;
|
|
30
33
|
this.facetValueService = facetValueService;
|
|
31
34
|
}
|
|
32
|
-
async products(ctx, args) {
|
|
33
|
-
return this.productService.findAll(ctx, args.options || undefined);
|
|
35
|
+
async products(ctx, args, relations) {
|
|
36
|
+
return this.productService.findAll(ctx, args.options || undefined, relations);
|
|
34
37
|
}
|
|
35
|
-
async product(ctx, args) {
|
|
38
|
+
async product(ctx, args, relations) {
|
|
36
39
|
if (args.id) {
|
|
37
|
-
const product = await this.productService.findOne(ctx, args.id);
|
|
40
|
+
const product = await this.productService.findOne(ctx, args.id, relations);
|
|
38
41
|
if (args.slug && product && product.slug !== args.slug) {
|
|
39
42
|
throw new errors_1.UserInputError(`error.product-id-slug-mismatch`);
|
|
40
43
|
}
|
|
41
44
|
return product;
|
|
42
45
|
}
|
|
43
46
|
else if (args.slug) {
|
|
44
|
-
return this.productService.findOneBySlug(ctx, args.slug);
|
|
47
|
+
return this.productService.findOneBySlug(ctx, args.slug, relations);
|
|
45
48
|
}
|
|
46
49
|
else {
|
|
47
50
|
throw new errors_1.UserInputError(`error.product-id-or-slug-must-be-provided`);
|
|
48
51
|
}
|
|
49
52
|
}
|
|
50
|
-
async productVariants(ctx, args) {
|
|
53
|
+
async productVariants(ctx, args, relations) {
|
|
51
54
|
if (args.productId) {
|
|
52
|
-
return this.productVariantService.getVariantsByProductId(ctx, args.productId, args.options || undefined);
|
|
55
|
+
return this.productVariantService.getVariantsByProductId(ctx, args.productId, args.options || undefined, relations);
|
|
53
56
|
}
|
|
54
57
|
return this.productVariantService.findAll(ctx, args.options || undefined);
|
|
55
58
|
}
|
|
@@ -104,8 +107,9 @@ __decorate([
|
|
|
104
107
|
allow_decorator_1.Allow(generated_types_1.Permission.ReadCatalog, generated_types_1.Permission.ReadProduct),
|
|
105
108
|
__param(0, request_context_decorator_1.Ctx()),
|
|
106
109
|
__param(1, graphql_1.Args()),
|
|
110
|
+
__param(2, relations_decorator_1.Relations(product_entity_1.Product)),
|
|
107
111
|
__metadata("design:type", Function),
|
|
108
|
-
__metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
|
|
112
|
+
__metadata("design:paramtypes", [request_context_1.RequestContext, Object, Array]),
|
|
109
113
|
__metadata("design:returntype", Promise)
|
|
110
114
|
], ProductResolver.prototype, "products", null);
|
|
111
115
|
__decorate([
|
|
@@ -113,8 +117,9 @@ __decorate([
|
|
|
113
117
|
allow_decorator_1.Allow(generated_types_1.Permission.ReadCatalog, generated_types_1.Permission.ReadProduct),
|
|
114
118
|
__param(0, request_context_decorator_1.Ctx()),
|
|
115
119
|
__param(1, graphql_1.Args()),
|
|
120
|
+
__param(2, relations_decorator_1.Relations(product_entity_1.Product)),
|
|
116
121
|
__metadata("design:type", Function),
|
|
117
|
-
__metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
|
|
122
|
+
__metadata("design:paramtypes", [request_context_1.RequestContext, Object, Array]),
|
|
118
123
|
__metadata("design:returntype", Promise)
|
|
119
124
|
], ProductResolver.prototype, "product", null);
|
|
120
125
|
__decorate([
|
|
@@ -122,8 +127,9 @@ __decorate([
|
|
|
122
127
|
allow_decorator_1.Allow(generated_types_1.Permission.ReadCatalog, generated_types_1.Permission.ReadProduct),
|
|
123
128
|
__param(0, request_context_decorator_1.Ctx()),
|
|
124
129
|
__param(1, graphql_1.Args()),
|
|
130
|
+
__param(2, relations_decorator_1.Relations(product_variant_entity_1.ProductVariant)),
|
|
125
131
|
__metadata("design:type", Function),
|
|
126
|
-
__metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
|
|
132
|
+
__metadata("design:paramtypes", [request_context_1.RequestContext, Object, Array]),
|
|
127
133
|
__metadata("design:returntype", Promise)
|
|
128
134
|
], ProductResolver.prototype, "productVariants", null);
|
|
129
135
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/admin/product.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAkE;AAClE,yEAoB6C;AAI7C,yDAA8D;
|
|
1
|
+
{"version":3,"file":"product.resolver.js","sourceRoot":"","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I,EAAE,CAAA;;qCADK,gCAAc;;4DAK7B;AAKD;IAHC,mCAAW,EAAE;IACb,kBAAQ,EAAE;IACV,uBAAK,CAAC,4BAAU,CAAC,aAAa,EAAE,4BAAU,CAAC,aAAa,CAAC;IAErD,WAAA,+BAAG,EAAE,CAAA;IACL,WAAA,cAAI,EAAE,CAAA;;qCADK,gCAAc;;2DAI7B;AAKD;IAHC,mCAAW,EAAE;IACb,kBAAQ,EAAE;IACV,uBAAK,CAAC,4BAAU,CAAC,aAAa,EAAE,4BAAU,CAAC,aAAa,CAAC;IAErD,WAAA,+BAAG,EAAE,CAAA;IACL,WAAA,cAAI,EAAE,CAAA;;qCADK,gCAAc;;8DAI7B;AAKD;IAHC,mCAAW,EAAE;IACb,kBAAQ,EAAE;IACV,uBAAK,CAAC,4BAAU,CAAC,aAAa,EAAE,4BAAU,CAAC,aAAa,CAAC;IAErD,WAAA,+BAAG,EAAE,CAAA;IACL,WAAA,cAAI,EAAE,CAAA;;qCADK,gCAAc;;gEAI7B;AAKD;IAHC,mCAAW,EAAE;IACb,kBAAQ,EAAE;IACV,uBAAK,CAAC,4BAAU,CAAC,aAAa,EAAE,4BAAU,CAAC,aAAa,CAAC;IAErD,WAAA,+BAAG,EAAE,CAAA;IACL,WAAA,cAAI,EAAE,CAAA;;qCADK,gCAAc;;qEAI7B;AAKD;IAHC,mCAAW,EAAE;IACb,kBAAQ,EAAE;IACV,uBAAK,CAAC,4BAAU,CAAC,aAAa,EAAE,4BAAU,CAAC,aAAa,CAAC;IAErD,WAAA,+BAAG,EAAE,CAAA;IACL,WAAA,cAAI,EAAE,CAAA;;qCADK,gCAAc;;uEAI7B;AA7LQ,eAAe;IAD3B,kBAAQ,EAAE;qCAGqB,gCAAc;QACP,+CAAqB;QACzB,uCAAiB;GAJvC,eAAe,CA8L3B;AA9LY,0CAAe"}
|
|
@@ -5,12 +5,13 @@ import { Promotion } from '../../../entity/promotion/promotion.entity';
|
|
|
5
5
|
import { PromotionService } from '../../../service/services/promotion.service';
|
|
6
6
|
import { ConfigurableOperationCodec } from '../../common/configurable-operation-codec';
|
|
7
7
|
import { RequestContext } from '../../common/request-context';
|
|
8
|
+
import { RelationPaths } from '../../decorators/relations.decorator';
|
|
8
9
|
export declare class PromotionResolver {
|
|
9
10
|
private promotionService;
|
|
10
11
|
private configurableOperationCodec;
|
|
11
12
|
constructor(promotionService: PromotionService, configurableOperationCodec: ConfigurableOperationCodec);
|
|
12
|
-
promotions(ctx: RequestContext, args: QueryPromotionsArgs): Promise<PaginatedList<Promotion>>;
|
|
13
|
-
promotion(ctx: RequestContext, args: QueryPromotionArgs): Promise<Promotion | undefined>;
|
|
13
|
+
promotions(ctx: RequestContext, args: QueryPromotionsArgs, relations: RelationPaths<Promotion>): Promise<PaginatedList<Promotion>>;
|
|
14
|
+
promotion(ctx: RequestContext, args: QueryPromotionArgs, relations: RelationPaths<Promotion>): Promise<Promotion | undefined>;
|
|
14
15
|
promotionConditions(ctx: RequestContext): import("@vendure/common/lib/generated-types").ConfigurableOperationDefinition[];
|
|
15
16
|
promotionActions(ctx: RequestContext): import("@vendure/common/lib/generated-types").ConfigurableOperationDefinition[];
|
|
16
17
|
createPromotion(ctx: RequestContext, args: MutationCreatePromotionArgs): Promise<ErrorResultUnion<CreatePromotionResult, Promotion>>;
|
|
@@ -22,6 +22,7 @@ const promotion_service_1 = require("../../../service/services/promotion.service
|
|
|
22
22
|
const configurable_operation_codec_1 = require("../../common/configurable-operation-codec");
|
|
23
23
|
const request_context_1 = require("../../common/request-context");
|
|
24
24
|
const allow_decorator_1 = require("../../decorators/allow.decorator");
|
|
25
|
+
const relations_decorator_1 = require("../../decorators/relations.decorator");
|
|
25
26
|
const request_context_decorator_1 = require("../../decorators/request-context.decorator");
|
|
26
27
|
const transaction_decorator_1 = require("../../decorators/transaction.decorator");
|
|
27
28
|
let PromotionResolver = class PromotionResolver {
|
|
@@ -39,14 +40,14 @@ let PromotionResolver = class PromotionResolver {
|
|
|
39
40
|
return maybePromotion;
|
|
40
41
|
};
|
|
41
42
|
}
|
|
42
|
-
promotions(ctx, args) {
|
|
43
|
-
return this.promotionService.findAll(ctx, args.options || undefined).then(res => {
|
|
43
|
+
promotions(ctx, args, relations) {
|
|
44
|
+
return this.promotionService.findAll(ctx, args.options || undefined, relations).then(res => {
|
|
44
45
|
res.items.forEach(this.encodeConditionsAndActions);
|
|
45
46
|
return res;
|
|
46
47
|
});
|
|
47
48
|
}
|
|
48
|
-
promotion(ctx, args) {
|
|
49
|
-
return this.promotionService.findOne(ctx, args.id).then(this.encodeConditionsAndActions);
|
|
49
|
+
promotion(ctx, args, relations) {
|
|
50
|
+
return this.promotionService.findOne(ctx, args.id, relations).then(this.encodeConditionsAndActions);
|
|
50
51
|
}
|
|
51
52
|
promotionConditions(ctx) {
|
|
52
53
|
return this.promotionService.getPromotionConditions(ctx);
|
|
@@ -80,8 +81,9 @@ __decorate([
|
|
|
80
81
|
allow_decorator_1.Allow(generated_types_1.Permission.ReadPromotion, generated_types_1.Permission.ReadPromotion),
|
|
81
82
|
__param(0, request_context_decorator_1.Ctx()),
|
|
82
83
|
__param(1, graphql_1.Args()),
|
|
84
|
+
__param(2, relations_decorator_1.Relations(promotion_entity_1.Promotion)),
|
|
83
85
|
__metadata("design:type", Function),
|
|
84
|
-
__metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
|
|
86
|
+
__metadata("design:paramtypes", [request_context_1.RequestContext, Object, Array]),
|
|
85
87
|
__metadata("design:returntype", Promise)
|
|
86
88
|
], PromotionResolver.prototype, "promotions", null);
|
|
87
89
|
__decorate([
|
|
@@ -89,8 +91,9 @@ __decorate([
|
|
|
89
91
|
allow_decorator_1.Allow(generated_types_1.Permission.ReadPromotion, generated_types_1.Permission.ReadPromotion),
|
|
90
92
|
__param(0, request_context_decorator_1.Ctx()),
|
|
91
93
|
__param(1, graphql_1.Args()),
|
|
94
|
+
__param(2, relations_decorator_1.Relations(promotion_entity_1.Promotion)),
|
|
92
95
|
__metadata("design:type", Function),
|
|
93
|
-
__metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
|
|
96
|
+
__metadata("design:paramtypes", [request_context_1.RequestContext, Object, Array]),
|
|
94
97
|
__metadata("design:returntype", Promise)
|
|
95
98
|
], PromotionResolver.prototype, "promotion", null);
|
|
96
99
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promotion.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/admin/promotion.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAkE;AAClE,yEAY6C;AAI7C,iFAAuG;AACvG,uFAAmF;AACnF,iFAAuE;AACvE,mFAA+E;AAC/E,4FAAuF;AACvF,kEAA8D;AAC9D,sEAAyD;AACzD,0FAAiE;AACjE,kFAAqE;AAGrE,IAAa,iBAAiB,GAA9B,MAAa,iBAAiB;IAC1B,YACY,gBAAkC,EAClC,0BAAsD;QADtD,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,+BAA0B,GAA1B,0BAA0B,CAA4B;
|
|
1
|
+
{"version":3,"file":"promotion.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/admin/promotion.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAkE;AAClE,yEAY6C;AAI7C,iFAAuG;AACvG,uFAAmF;AACnF,iFAAuE;AACvE,mFAA+E;AAC/E,4FAAuF;AACvF,kEAA8D;AAC9D,sEAAyD;AACzD,8EAAgF;AAChF,0FAAiE;AACjE,kFAAqE;AAGrE,IAAa,iBAAiB,GAA9B,MAAa,iBAAiB;IAC1B,YACY,gBAAkC,EAClC,0BAAsD;QADtD,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,+BAA0B,GAA1B,0BAA0B,CAA4B;QA4GlE;;WAEG;QACK,+BAA0B,GAAG,CAGjC,cAAiB,EAChB,EAAE;YACH,IAAI,cAAc,YAAY,4BAAS,EAAE;gBACrC,IAAI,CAAC,0BAA0B,CAAC,8BAA8B,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DAI7B;AAKD;IAHC,mCAAW,EAAE;IACb,kBAAQ,EAAE;IACV,uBAAK,CAAC,4BAAU,CAAC,eAAe,EAAE,4BAAU,CAAC,eAAe,CAAC;IAEzD,WAAA,+BAAG,EAAE,CAAA;IACL,WAAA,cAAI,EAAE,CAAA;;qCADK,gCAAc;;kEAI7B;AAKD;IAHC,mCAAW,EAAE;IACb,kBAAQ,EAAE;IACV,uBAAK,CAAC,4BAAU,CAAC,eAAe,EAAE,4BAAU,CAAC,eAAe,CAAC;IAEzD,WAAA,+BAAG,EAAE,CAAA;IACL,WAAA,cAAI,EAAE,CAAA;;qCADK,gCAAc;;oEAI7B;AA7GQ,iBAAiB;IAD7B,kBAAQ,CAAC,WAAW,CAAC;qCAGY,oCAAgB;QACN,yDAA0B;GAHzD,iBAAiB,CAmI7B;AAnIY,8CAAiB"}
|
|
@@ -3,11 +3,12 @@ import { PaginatedList } from '@vendure/common/lib/shared-types';
|
|
|
3
3
|
import { Role } from '../../../entity/role/role.entity';
|
|
4
4
|
import { RoleService } from '../../../service/services/role.service';
|
|
5
5
|
import { RequestContext } from '../../common/request-context';
|
|
6
|
+
import { RelationPaths } from '../../decorators/relations.decorator';
|
|
6
7
|
export declare class RoleResolver {
|
|
7
8
|
private roleService;
|
|
8
9
|
constructor(roleService: RoleService);
|
|
9
|
-
roles(ctx: RequestContext, args: QueryRolesArgs): Promise<PaginatedList<Role>>;
|
|
10
|
-
role(ctx: RequestContext, args: QueryRoleArgs): Promise<Role | undefined>;
|
|
10
|
+
roles(ctx: RequestContext, args: QueryRolesArgs, relations: RelationPaths<Role>): Promise<PaginatedList<Role>>;
|
|
11
|
+
role(ctx: RequestContext, args: QueryRoleArgs, relations: RelationPaths<Role>): Promise<Role | undefined>;
|
|
11
12
|
createRole(ctx: RequestContext, args: MutationCreateRoleArgs): Promise<Role>;
|
|
12
13
|
updateRole(ctx: RequestContext, args: MutationUpdateRoleArgs): Promise<Role>;
|
|
13
14
|
deleteRole(ctx: RequestContext, args: MutationDeleteRoleArgs): Promise<DeletionResponse>;
|
|
@@ -15,20 +15,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.RoleResolver = void 0;
|
|
16
16
|
const graphql_1 = require("@nestjs/graphql");
|
|
17
17
|
const generated_types_1 = require("@vendure/common/lib/generated-types");
|
|
18
|
+
const role_entity_1 = require("../../../entity/role/role.entity");
|
|
18
19
|
const role_service_1 = require("../../../service/services/role.service");
|
|
19
20
|
const request_context_1 = require("../../common/request-context");
|
|
20
21
|
const allow_decorator_1 = require("../../decorators/allow.decorator");
|
|
22
|
+
const relations_decorator_1 = require("../../decorators/relations.decorator");
|
|
21
23
|
const request_context_decorator_1 = require("../../decorators/request-context.decorator");
|
|
22
24
|
const transaction_decorator_1 = require("../../decorators/transaction.decorator");
|
|
23
25
|
let RoleResolver = class RoleResolver {
|
|
24
26
|
constructor(roleService) {
|
|
25
27
|
this.roleService = roleService;
|
|
26
28
|
}
|
|
27
|
-
roles(ctx, args) {
|
|
28
|
-
return this.roleService.findAll(ctx, args.options || undefined);
|
|
29
|
+
roles(ctx, args, relations) {
|
|
30
|
+
return this.roleService.findAll(ctx, args.options || undefined, relations);
|
|
29
31
|
}
|
|
30
|
-
role(ctx, args) {
|
|
31
|
-
return this.roleService.findOne(ctx, args.id);
|
|
32
|
+
role(ctx, args, relations) {
|
|
33
|
+
return this.roleService.findOne(ctx, args.id, relations);
|
|
32
34
|
}
|
|
33
35
|
createRole(ctx, args) {
|
|
34
36
|
const { input } = args;
|
|
@@ -48,8 +50,9 @@ __decorate([
|
|
|
48
50
|
allow_decorator_1.Allow(generated_types_1.Permission.ReadAdministrator),
|
|
49
51
|
__param(0, request_context_decorator_1.Ctx()),
|
|
50
52
|
__param(1, graphql_1.Args()),
|
|
53
|
+
__param(2, relations_decorator_1.Relations(role_entity_1.Role)),
|
|
51
54
|
__metadata("design:type", Function),
|
|
52
|
-
__metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
|
|
55
|
+
__metadata("design:paramtypes", [request_context_1.RequestContext, Object, Array]),
|
|
53
56
|
__metadata("design:returntype", Promise)
|
|
54
57
|
], RoleResolver.prototype, "roles", null);
|
|
55
58
|
__decorate([
|
|
@@ -57,8 +60,9 @@ __decorate([
|
|
|
57
60
|
allow_decorator_1.Allow(generated_types_1.Permission.ReadAdministrator),
|
|
58
61
|
__param(0, request_context_decorator_1.Ctx()),
|
|
59
62
|
__param(1, graphql_1.Args()),
|
|
63
|
+
__param(2, relations_decorator_1.Relations(role_entity_1.Role)),
|
|
60
64
|
__metadata("design:type", Function),
|
|
61
|
-
__metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
|
|
65
|
+
__metadata("design:paramtypes", [request_context_1.RequestContext, Object, Array]),
|
|
62
66
|
__metadata("design:returntype", Promise)
|
|
63
67
|
], RoleResolver.prototype, "role", null);
|
|
64
68
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"role.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/admin/role.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAkE;AAClE,yEAQ6C;
|
|
1
|
+
{"version":3,"file":"role.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/admin/role.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAkE;AAClE,yEAQ6C;AAG7C,kEAAwD;AACxD,yEAAqE;AACrE,kEAA8D;AAC9D,sEAAyD;AACzD,8EAAgF;AAChF,0FAAiE;AACjE,kFAAqE;AAGrE,IAAa,YAAY,GAAzB,MAAa,YAAY;IACrB,YAAoB,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;IAAG,CAAC;IAIhD,KAAK,CACM,GAAmB,EAClB,IAAoB,EACX,SAA8B;QAE/C,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,IAAI,SAAS,EAAE,SAAS,CAAC,CAAC;IAC/E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G,EAAE,CAAA;IAAuB,WAAA,cAAI,EAAE,CAAA;;qCAAvB,gCAAc;;8CAGpC;AAKD;IAHC,mCAAW,EAAE;IACb,kBAAQ,EAAE;IACV,uBAAK,CAAC,4BAAU,CAAC,mBAAmB,CAAC;IAC1B,WAAA,+BAAG,EAAE,CAAA;IAAuB,WAAA,cAAI,EAAE,CAAA;;qCAAvB,gCAAc;;8CAGpC;AAKD;IAHC,mCAAW,EAAE;IACb,kBAAQ,EAAE;IACV,uBAAK,CAAC,4BAAU,CAAC,mBAAmB,CAAC;IAC1B,WAAA,+BAAG,EAAE,CAAA;IAAuB,WAAA,cAAI,EAAE,CAAA;;qCAAvB,gCAAc;;8CAGpC;AA7CQ,YAAY;IADxB,kBAAQ,CAAC,OAAO,CAAC;qCAEmB,0BAAW;GADnC,YAAY,CA8CxB;AA9CY,oCAAY"}
|
|
@@ -4,12 +4,13 @@ import { ShippingMethod } from '../../../entity/shipping-method/shipping-method.
|
|
|
4
4
|
import { OrderTestingService } from '../../../service/services/order-testing.service';
|
|
5
5
|
import { ShippingMethodService } from '../../../service/services/shipping-method.service';
|
|
6
6
|
import { RequestContext } from '../../common/request-context';
|
|
7
|
+
import { RelationPaths } from '../../decorators/relations.decorator';
|
|
7
8
|
export declare class ShippingMethodResolver {
|
|
8
9
|
private shippingMethodService;
|
|
9
10
|
private orderTestingService;
|
|
10
11
|
constructor(shippingMethodService: ShippingMethodService, orderTestingService: OrderTestingService);
|
|
11
|
-
shippingMethods(ctx: RequestContext, args: QueryShippingMethodsArgs): Promise<PaginatedList<ShippingMethod>>;
|
|
12
|
-
shippingMethod(ctx: RequestContext, args: QueryShippingMethodArgs): Promise<ShippingMethod | undefined>;
|
|
12
|
+
shippingMethods(ctx: RequestContext, args: QueryShippingMethodsArgs, relations: RelationPaths<ShippingMethod>): Promise<PaginatedList<ShippingMethod>>;
|
|
13
|
+
shippingMethod(ctx: RequestContext, args: QueryShippingMethodArgs, relations: RelationPaths<ShippingMethod>): Promise<ShippingMethod | undefined>;
|
|
13
14
|
shippingEligibilityCheckers(ctx: RequestContext): ConfigurableOperationDefinition[];
|
|
14
15
|
shippingCalculators(ctx: RequestContext): ConfigurableOperationDefinition[];
|
|
15
16
|
fulfillmentHandlers(ctx: RequestContext): ConfigurableOperationDefinition[];
|
|
@@ -15,10 +15,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.ShippingMethodResolver = void 0;
|
|
16
16
|
const graphql_1 = require("@nestjs/graphql");
|
|
17
17
|
const generated_types_1 = require("@vendure/common/lib/generated-types");
|
|
18
|
+
const shipping_method_entity_1 = require("../../../entity/shipping-method/shipping-method.entity");
|
|
18
19
|
const order_testing_service_1 = require("../../../service/services/order-testing.service");
|
|
19
20
|
const shipping_method_service_1 = require("../../../service/services/shipping-method.service");
|
|
20
21
|
const request_context_1 = require("../../common/request-context");
|
|
21
22
|
const allow_decorator_1 = require("../../decorators/allow.decorator");
|
|
23
|
+
const relations_decorator_1 = require("../../decorators/relations.decorator");
|
|
22
24
|
const request_context_decorator_1 = require("../../decorators/request-context.decorator");
|
|
23
25
|
const transaction_decorator_1 = require("../../decorators/transaction.decorator");
|
|
24
26
|
let ShippingMethodResolver = class ShippingMethodResolver {
|
|
@@ -26,11 +28,11 @@ let ShippingMethodResolver = class ShippingMethodResolver {
|
|
|
26
28
|
this.shippingMethodService = shippingMethodService;
|
|
27
29
|
this.orderTestingService = orderTestingService;
|
|
28
30
|
}
|
|
29
|
-
shippingMethods(ctx, args) {
|
|
30
|
-
return this.shippingMethodService.findAll(ctx, args.options || undefined);
|
|
31
|
+
shippingMethods(ctx, args, relations) {
|
|
32
|
+
return this.shippingMethodService.findAll(ctx, args.options || undefined, relations);
|
|
31
33
|
}
|
|
32
|
-
shippingMethod(ctx, args) {
|
|
33
|
-
return this.shippingMethodService.findOne(ctx, args.id);
|
|
34
|
+
shippingMethod(ctx, args, relations) {
|
|
35
|
+
return this.shippingMethodService.findOne(ctx, args.id, false, relations);
|
|
34
36
|
}
|
|
35
37
|
shippingEligibilityCheckers(ctx) {
|
|
36
38
|
return this.shippingMethodService.getShippingEligibilityCheckers(ctx);
|
|
@@ -67,8 +69,9 @@ __decorate([
|
|
|
67
69
|
allow_decorator_1.Allow(generated_types_1.Permission.ReadSettings, generated_types_1.Permission.ReadShippingMethod),
|
|
68
70
|
__param(0, request_context_decorator_1.Ctx()),
|
|
69
71
|
__param(1, graphql_1.Args()),
|
|
72
|
+
__param(2, relations_decorator_1.Relations(shipping_method_entity_1.ShippingMethod)),
|
|
70
73
|
__metadata("design:type", Function),
|
|
71
|
-
__metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
|
|
74
|
+
__metadata("design:paramtypes", [request_context_1.RequestContext, Object, Array]),
|
|
72
75
|
__metadata("design:returntype", Promise)
|
|
73
76
|
], ShippingMethodResolver.prototype, "shippingMethods", null);
|
|
74
77
|
__decorate([
|
|
@@ -76,8 +79,9 @@ __decorate([
|
|
|
76
79
|
allow_decorator_1.Allow(generated_types_1.Permission.ReadSettings, generated_types_1.Permission.ReadShippingMethod),
|
|
77
80
|
__param(0, request_context_decorator_1.Ctx()),
|
|
78
81
|
__param(1, graphql_1.Args()),
|
|
82
|
+
__param(2, relations_decorator_1.Relations(shipping_method_entity_1.ShippingMethod)),
|
|
79
83
|
__metadata("design:type", Function),
|
|
80
|
-
__metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
|
|
84
|
+
__metadata("design:paramtypes", [request_context_1.RequestContext, Object, Array]),
|
|
81
85
|
__metadata("design:returntype", Promise)
|
|
82
86
|
], ShippingMethodResolver.prototype, "shippingMethod", null);
|
|
83
87
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shipping-method.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/admin/shipping-method.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAkE;AAClE,yEAW6C;
|
|
1
|
+
{"version":3,"file":"shipping-method.resolver.js","s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C,WAAA,+BAAG,EAAE,CAAA;IAAuB,WAAA,cAAI,EAAE,CAAA;;qCAAvB,gCAAc;;gEAG5C;AAID;IAFC,eAAK,EAAE;IACP,uBAAK,CAAC,4BAAU,CAAC,YAAY,EAAE,4BAAU,CAAC,kBAAkB,CAAC;IAEzD,WAAA,+BAAG,EAAE,CAAA;IACL,WAAA,cAAI,EAAE,CAAA;;qCADK,gCAAc;;yEAK7B;AA5FQ,sBAAsB;IADlC,kBAAQ,CAAC,gBAAgB,CAAC;qCAGY,+CAAqB;QACvB,2CAAmB;GAH3C,sBAAsB,CA6FlC;AA7FY,wDAAsB"}
|
|
@@ -3,11 +3,12 @@ import { PaginatedList } from '@vendure/common/lib/shared-types';
|
|
|
3
3
|
import { TaxRate } from '../../../entity/tax-rate/tax-rate.entity';
|
|
4
4
|
import { TaxRateService } from '../../../service/services/tax-rate.service';
|
|
5
5
|
import { RequestContext } from '../../common/request-context';
|
|
6
|
+
import { RelationPaths } from '../../decorators/relations.decorator';
|
|
6
7
|
export declare class TaxRateResolver {
|
|
7
8
|
private taxRateService;
|
|
8
9
|
constructor(taxRateService: TaxRateService);
|
|
9
|
-
taxRates(ctx: RequestContext, args: QueryTaxRatesArgs): Promise<PaginatedList<TaxRate>>;
|
|
10
|
-
taxRate(ctx: RequestContext, args: QueryTaxRateArgs): Promise<TaxRate | undefined>;
|
|
10
|
+
taxRates(ctx: RequestContext, args: QueryTaxRatesArgs, relations: RelationPaths<TaxRate>): Promise<PaginatedList<TaxRate>>;
|
|
11
|
+
taxRate(ctx: RequestContext, args: QueryTaxRateArgs, relations: RelationPaths<TaxRate>): Promise<TaxRate | undefined>;
|
|
11
12
|
createTaxRate(ctx: RequestContext, args: MutationCreateTaxRateArgs): Promise<TaxRate>;
|
|
12
13
|
updateTaxRate(ctx: RequestContext, args: MutationUpdateTaxRateArgs): Promise<TaxRate>;
|
|
13
14
|
deleteTaxRate(ctx: RequestContext, args: MutationDeleteTaxRateArgs): Promise<DeletionResponse>;
|
|
@@ -15,20 +15,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.TaxRateResolver = void 0;
|
|
16
16
|
const graphql_1 = require("@nestjs/graphql");
|
|
17
17
|
const generated_types_1 = require("@vendure/common/lib/generated-types");
|
|
18
|
+
const tax_rate_entity_1 = require("../../../entity/tax-rate/tax-rate.entity");
|
|
18
19
|
const tax_rate_service_1 = require("../../../service/services/tax-rate.service");
|
|
19
20
|
const request_context_1 = require("../../common/request-context");
|
|
20
21
|
const allow_decorator_1 = require("../../decorators/allow.decorator");
|
|
22
|
+
const relations_decorator_1 = require("../../decorators/relations.decorator");
|
|
21
23
|
const request_context_decorator_1 = require("../../decorators/request-context.decorator");
|
|
22
24
|
const transaction_decorator_1 = require("../../decorators/transaction.decorator");
|
|
23
25
|
let TaxRateResolver = class TaxRateResolver {
|
|
24
26
|
constructor(taxRateService) {
|
|
25
27
|
this.taxRateService = taxRateService;
|
|
26
28
|
}
|
|
27
|
-
async taxRates(ctx, args) {
|
|
28
|
-
return this.taxRateService.findAll(ctx, args.options || undefined);
|
|
29
|
+
async taxRates(ctx, args, relations) {
|
|
30
|
+
return this.taxRateService.findAll(ctx, args.options || undefined, relations);
|
|
29
31
|
}
|
|
30
|
-
async taxRate(ctx, args) {
|
|
31
|
-
return this.taxRateService.findOne(ctx, args.id);
|
|
32
|
+
async taxRate(ctx, args, relations) {
|
|
33
|
+
return this.taxRateService.findOne(ctx, args.id, relations);
|
|
32
34
|
}
|
|
33
35
|
async createTaxRate(ctx, args) {
|
|
34
36
|
return this.taxRateService.create(ctx, args.input);
|
|
@@ -45,8 +47,9 @@ __decorate([
|
|
|
45
47
|
allow_decorator_1.Allow(generated_types_1.Permission.ReadSettings, generated_types_1.Permission.ReadCatalog, generated_types_1.Permission.ReadProduct, generated_types_1.Permission.ReadTaxRate),
|
|
46
48
|
__param(0, request_context_decorator_1.Ctx()),
|
|
47
49
|
__param(1, graphql_1.Args()),
|
|
50
|
+
__param(2, relations_decorator_1.Relations(tax_rate_entity_1.TaxRate)),
|
|
48
51
|
__metadata("design:type", Function),
|
|
49
|
-
__metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
|
|
52
|
+
__metadata("design:paramtypes", [request_context_1.RequestContext, Object, Array]),
|
|
50
53
|
__metadata("design:returntype", Promise)
|
|
51
54
|
], TaxRateResolver.prototype, "taxRates", null);
|
|
52
55
|
__decorate([
|
|
@@ -54,8 +57,9 @@ __decorate([
|
|
|
54
57
|
allow_decorator_1.Allow(generated_types_1.Permission.ReadSettings, generated_types_1.Permission.ReadCatalog, generated_types_1.Permission.ReadTaxRate),
|
|
55
58
|
__param(0, request_context_decorator_1.Ctx()),
|
|
56
59
|
__param(1, graphql_1.Args()),
|
|
60
|
+
__param(2, relations_decorator_1.Relations(tax_rate_entity_1.TaxRate)),
|
|
57
61
|
__metadata("design:type", Function),
|
|
58
|
-
__metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
|
|
62
|
+
__metadata("design:paramtypes", [request_context_1.RequestContext, Object, Array]),
|
|
59
63
|
__metadata("design:returntype", Promise)
|
|
60
64
|
], TaxRateResolver.prototype, "taxRate", null);
|
|
61
65
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tax-rate.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/admin/tax-rate.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAkE;AAClE,yEAQ6C;
|
|
1
|
+
{"version":3,"file":"tax-rate.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/admin/tax-rate.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAkE;AAClE,yEAQ6C;AAG7C,8EAAmE;AACnE,iFAA4E;AAC5E,kEAA8D;AAC9D,sEAAyD;AACzD,8EAAgF;AAChF,0FAAiE;AACjE,kFAAqE;AAGrE,IAAa,eAAe,GAA5B,MAAa,eAAe;IACxB,YAAoB,cAA8B;QAA9B,mB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E,4BAAU,CAAC,WAAW,CAAC;IAE1E,WAAA,+BAAG,EAAE,CAAA;IACL,WAAA,cAAI,EAAE,CAAA;IACN,WAAA,+BAAS,CAAC,yBAAO,CAAC,CAAA;;qCAFP,gCAAc;;8CAK7B;AAKD;IAHC,mCAAW,EAAE;IACb,kBAAQ,EAAE;IACV,uBAAK,CAAC,4BAAU,CAAC,cAAc,EAAE,4BAAU,CAAC,aAAa,CAAC;IAEtD,WAAA,+BAAG,EAAE,CAAA;IACL,WAAA,cAAI,EAAE,CAAA;;qCADK,gCAAc;;oDAI7B;AAKD;IAHC,mCAAW,EAAE;IACb,kBAAQ,EAAE;IACV,uBAAK,CAAC,4BAAU,CAAC,cAAc,EAAE,4BAAU,CAAC,aAAa,CAAC;IAEtD,WAAA,+BAAG,EAAE,CAAA;IACL,WAAA,cAAI,EAAE,CAAA;;qCADK,gCAAc;;oDAI7B;AAKD;IAHC,mCAAW,EAAE;IACb,kBAAQ,EAAE;IACV,uBAAK,CAAC,4BAAU,CAAC,cAAc,EAAE,4BAAU,CAAC,aAAa,CAAC;IAEtD,WAAA,+BAAG,EAAE,CAAA;IACL,WAAA,cAAI,EAAE,CAAA;;qCADK,gCAAc;;oDAI7B;AAnDQ,eAAe;IAD3B,kBAAQ,CAAC,SAAS,CAAC;qCAEoB,iCAAc;GADzC,eAAe,CAoD3B;AApDY,0CAAe"}
|
|
@@ -8,6 +8,7 @@ import { CollectionService } from '../../../service/services/collection.service'
|
|
|
8
8
|
import { ProductVariantService } from '../../../service/services/product-variant.service';
|
|
9
9
|
import { ApiType } from '../../common/get-api-type';
|
|
10
10
|
import { RequestContext } from '../../common/request-context';
|
|
11
|
+
import { RelationPaths } from '../../decorators/relations.decorator';
|
|
11
12
|
export declare class CollectionEntityResolver {
|
|
12
13
|
private productVariantService;
|
|
13
14
|
private collectionService;
|
|
@@ -19,7 +20,7 @@ export declare class CollectionEntityResolver {
|
|
|
19
20
|
description(ctx: RequestContext, collection: Collection): Promise<string>;
|
|
20
21
|
productVariants(ctx: RequestContext, collection: Collection, args: {
|
|
21
22
|
options: ProductVariantListOptions;
|
|
22
|
-
}, apiType: ApiType): Promise<PaginatedList<Translated<ProductVariant>>>;
|
|
23
|
+
}, apiType: ApiType, relations: RelationPaths<ProductVariant>): Promise<PaginatedList<Translated<ProductVariant>>>;
|
|
23
24
|
breadcrumbs(ctx: RequestContext, collection: Collection): Promise<CollectionBreadcrumb[]>;
|
|
24
25
|
parent(ctx: RequestContext, collection: Collection, apiType: ApiType): Promise<Collection | undefined>;
|
|
25
26
|
children(ctx: RequestContext, collection: Collection, apiType: ApiType): Promise<Collection[]>;
|
|
@@ -21,6 +21,7 @@ const collection_service_1 = require("../../../service/services/collection.servi
|
|
|
21
21
|
const product_variant_service_1 = require("../../../service/services/product-variant.service");
|
|
22
22
|
const request_context_1 = require("../../common/request-context");
|
|
23
23
|
const api_decorator_1 = require("../../decorators/api.decorator");
|
|
24
|
+
const relations_decorator_1 = require("../../decorators/relations.decorator");
|
|
24
25
|
const request_context_decorator_1 = require("../../decorators/request-context.decorator");
|
|
25
26
|
let CollectionEntityResolver = class CollectionEntityResolver {
|
|
26
27
|
constructor(productVariantService, collectionService, assetService, localeStringHydrator) {
|
|
@@ -38,12 +39,12 @@ let CollectionEntityResolver = class CollectionEntityResolver {
|
|
|
38
39
|
description(ctx, collection) {
|
|
39
40
|
return this.localeStringHydrator.hydrateLocaleStringField(ctx, collection, 'description');
|
|
40
41
|
}
|
|
41
|
-
async productVariants(ctx, collection, args, apiType) {
|
|
42
|
+
async productVariants(ctx, collection, args, apiType, relations) {
|
|
42
43
|
let options = args.options;
|
|
43
44
|
if (apiType === 'shop') {
|
|
44
45
|
options = Object.assign(Object.assign({}, args.options), { filter: Object.assign(Object.assign({}, (args.options ? args.options.filter : {})), { enabled: { eq: true } }) });
|
|
45
46
|
}
|
|
46
|
-
return this.productVariantService.getVariantsByCollectionId(ctx, collection.id, options);
|
|
47
|
+
return this.productVariantService.getVariantsByCollectionId(ctx, collection.id, options, relations);
|
|
47
48
|
}
|
|
48
49
|
async breadcrumbs(ctx, collection) {
|
|
49
50
|
return this.collectionService.getBreadcrumbs(ctx, collection);
|
|
@@ -108,9 +109,10 @@ __decorate([
|
|
|
108
109
|
__param(1, graphql_1.Parent()),
|
|
109
110
|
__param(2, graphql_1.Args()),
|
|
110
111
|
__param(3, api_decorator_1.Api()),
|
|
112
|
+
__param(4, relations_decorator_1.Relations(entity_1.ProductVariant)),
|
|
111
113
|
__metadata("design:type", Function),
|
|
112
114
|
__metadata("design:paramtypes", [request_context_1.RequestContext,
|
|
113
|
-
entity_1.Collection, Object, String]),
|
|
115
|
+
entity_1.Collection, Object, String, Array]),
|
|
114
116
|
__metadata("design:returntype", Promise)
|
|
115
117
|
], CollectionEntityResolver.prototype, "productVariants", null);
|
|
116
118
|
__decorate([
|