@vendure/core 1.5.0 → 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/config/generate-permissions.js +29 -4
- package/dist/api/config/generate-permissions.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/decorators/request-context.decorator.js +9 -2
- package/dist/api/decorators/request-context.decorator.js.map +1 -1
- 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/middleware/transaction-interceptor.d.ts +9 -0
- package/dist/api/middleware/transaction-interceptor.js +16 -1
- package/dist/api/middleware/transaction-interceptor.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 +6 -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/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 +8 -3
- 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/constants.d.ts +1 -0
- package/dist/common/constants.js +2 -1
- package/dist/common/constants.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/transaction-wrapper.d.ts +5 -1
- package/dist/connection/transaction-wrapper.js +9 -3
- package/dist/connection/transaction-wrapper.js.map +1 -1
- package/dist/connection/transactional-connection.d.ts +7 -3
- package/dist/connection/transactional-connection.js +8 -3
- 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 +13 -7
- 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/event-bus.js +12 -3
- package/dist/event-bus/event-bus.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 +29 -1
- package/dist/service/helpers/list-query-builder/list-query-builder.js +119 -18
- 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-calculator/prorate.js +1 -1
- package/dist/service/helpers/order-calculator/prorate.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/helpers/slug-validator/slug-validator.js +15 -6
- package/dist/service/helpers/slug-validator/slug-validator.js.map +1 -1
- package/dist/service/helpers/utils/translate-entity.js +1 -2
- package/dist/service/helpers/utils/translate-entity.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 +6 -3
- package/dist/service/services/customer-group.service.js +12 -7
- 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 -7
- package/dist/service/services/order.service.js +63 -53
- 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 +11 -3
- package/dist/service/services/product-variant.service.js +53 -40
- 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 +6 -4
- 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,22 +15,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.OrderResolver = void 0;
|
|
16
16
|
const graphql_1 = require("@nestjs/graphql");
|
|
17
17
|
const generated_types_1 = require("@vendure/common/lib/generated-types");
|
|
18
|
+
const connection_1 = require("../../../connection");
|
|
19
|
+
const error_result_1 = require("../../../common/error/error-result");
|
|
20
|
+
const order_entity_1 = require("../../../entity/order/order.entity");
|
|
18
21
|
const order_service_1 = require("../../../service/services/order.service");
|
|
19
|
-
const shipping_method_service_1 = require("../../../service/services/shipping-method.service");
|
|
20
22
|
const request_context_1 = require("../../common/request-context");
|
|
21
23
|
const allow_decorator_1 = require("../../decorators/allow.decorator");
|
|
24
|
+
const relations_decorator_1 = require("../../decorators/relations.decorator");
|
|
22
25
|
const request_context_decorator_1 = require("../../decorators/request-context.decorator");
|
|
23
26
|
const transaction_decorator_1 = require("../../decorators/transaction.decorator");
|
|
24
27
|
let OrderResolver = class OrderResolver {
|
|
25
|
-
constructor(orderService,
|
|
28
|
+
constructor(orderService, connection) {
|
|
26
29
|
this.orderService = orderService;
|
|
27
|
-
this.
|
|
30
|
+
this.connection = connection;
|
|
28
31
|
}
|
|
29
|
-
orders(ctx, args) {
|
|
30
|
-
return this.orderService.findAll(ctx, args.options || undefined);
|
|
32
|
+
orders(ctx, args, relations) {
|
|
33
|
+
return this.orderService.findAll(ctx, args.options || undefined, relations);
|
|
31
34
|
}
|
|
32
|
-
async order(ctx, args) {
|
|
33
|
-
return this.orderService.findOne(ctx, args.id);
|
|
35
|
+
async order(ctx, args, relations) {
|
|
36
|
+
return this.orderService.findOne(ctx, args.id, relations);
|
|
34
37
|
}
|
|
35
38
|
async settlePayment(ctx, args) {
|
|
36
39
|
return this.orderService.settlePayment(ctx, args.id);
|
|
@@ -69,7 +72,15 @@ let OrderResolver = class OrderResolver {
|
|
|
69
72
|
return this.orderService.transitionPaymentToState(ctx, args.id, args.state);
|
|
70
73
|
}
|
|
71
74
|
async modifyOrder(ctx, args) {
|
|
72
|
-
|
|
75
|
+
await this.connection.startTransaction(ctx);
|
|
76
|
+
const result = await this.orderService.modifyOrder(ctx, args.input);
|
|
77
|
+
if (args.input.dryRun || error_result_1.isGraphQlErrorResult(result)) {
|
|
78
|
+
await this.connection.rollBackTransaction(ctx);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
await this.connection.commitOpenTransaction(ctx);
|
|
82
|
+
}
|
|
83
|
+
return result;
|
|
73
84
|
}
|
|
74
85
|
async addManualPaymentToOrder(ctx, args) {
|
|
75
86
|
return this.orderService.addManualPaymentToOrder(ctx, args.input);
|
|
@@ -80,8 +91,9 @@ __decorate([
|
|
|
80
91
|
allow_decorator_1.Allow(generated_types_1.Permission.ReadOrder),
|
|
81
92
|
__param(0, request_context_decorator_1.Ctx()),
|
|
82
93
|
__param(1, graphql_1.Args()),
|
|
94
|
+
__param(2, relations_decorator_1.Relations(order_entity_1.Order)),
|
|
83
95
|
__metadata("design:type", Function),
|
|
84
|
-
__metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
|
|
96
|
+
__metadata("design:paramtypes", [request_context_1.RequestContext, Object, Array]),
|
|
85
97
|
__metadata("design:returntype", Promise)
|
|
86
98
|
], OrderResolver.prototype, "orders", null);
|
|
87
99
|
__decorate([
|
|
@@ -89,8 +101,9 @@ __decorate([
|
|
|
89
101
|
allow_decorator_1.Allow(generated_types_1.Permission.ReadOrder),
|
|
90
102
|
__param(0, request_context_decorator_1.Ctx()),
|
|
91
103
|
__param(1, graphql_1.Args()),
|
|
104
|
+
__param(2, relations_decorator_1.Relations(order_entity_1.Order)),
|
|
92
105
|
__metadata("design:type", Function),
|
|
93
|
-
__metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
|
|
106
|
+
__metadata("design:paramtypes", [request_context_1.RequestContext, Object, Array]),
|
|
94
107
|
__metadata("design:returntype", Promise)
|
|
95
108
|
], OrderResolver.prototype, "order", null);
|
|
96
109
|
__decorate([
|
|
@@ -235,7 +248,8 @@ __decorate([
|
|
|
235
248
|
], OrderResolver.prototype, "addManualPaymentToOrder", null);
|
|
236
249
|
OrderResolver = __decorate([
|
|
237
250
|
graphql_1.Resolver(),
|
|
238
|
-
__metadata("design:paramtypes", [order_service_1.OrderService,
|
|
251
|
+
__metadata("design:paramtypes", [order_service_1.OrderService,
|
|
252
|
+
connection_1.TransactionalConnection])
|
|
239
253
|
], OrderResolver);
|
|
240
254
|
exports.OrderResolver = OrderResolver;
|
|
241
255
|
//# sourceMappingURL=order.resolver.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/admin/order.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAkE;AAClE,yEAuB6C;
|
|
1
|
+
{"version":3,"file":"order.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/admin/order.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAkE;AAClE,yEAuB6C;AAE7C,oDAA8D;AAE9D,qEAA4F;AAE5F,qEAA2D;AAM3D,2EAAuE;AACvE,kEAA8D;AAC9D,sEAAyD;AACzD,8EAAgF;AAChF,0FAAiE;AACjE,kFAAqE;AAGrE,IAAa,aAAa,GAA1B,MAAa,aAAa;IACtB,YACY,YAA0B,EAC1B,UAAmC;QADnC,iBAAY,GAAZ,YAAY,CAAc;QAC1B,eAAU,GAAV,UAAU,CAAyB;IAC5C,CAAC;IAIJ,MAAM,CACK,GAAmB,EAClB,IAAqB,EACX,SAA+B;QAEjD,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,IAAI,SAAS,EAAE,SAAS,CAAC,CAAC;IAChF,CAAC;IAID,KAAK,CAAC,KAAK,CACA,GAAmB,EAClB,IAAoB,EACV,SAA+B;QAEjD,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;IAC9D,CAAC;IAKD,KAAK,CAAC,aAAa,CACR,GAAmB,EAClB,IAA+B;QAEvC,OAAO,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IACzD,CAAC;IAKD,KAAK,CAAC,qBAAqB,CAChB,GAAmB,EAClB,IAAuC;QAE/C,OAAO,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,GAAG,EAAE,IAAI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AQ,EAAE;IACV,uBAAK,CAAC,4BAAU,CAAC,WAAW,CAAC;IACX,WAAA,+BAAG,EAAE,CAAA;IAAuB,WAAA,cAAI,EAAE,CAAA;;qCAAvB,gCAAc;;gDAW3C;AAKD;IAHC,mCAAW,EAAE;IACb,kBAAQ,EAAE;IACV,uBAAK,CAAC,4BAAU,CAAC,WAAW,CAAC;IAEzB,WAAA,+BAAG,EAAE,CAAA;IACL,WAAA,cAAI,EAAE,CAAA;;qCADK,gCAAc;;4DAI7B;AA3JQ,aAAa;IADzB,kBAAQ,EAAE;qCAGmB,4BAAY;QACd,oCAAuB;GAHtC,aAAa,CA4JzB;AA5JY,sCAAa"}
|
|
@@ -3,11 +3,12 @@ import { PaginatedList } from '@vendure/common/lib/shared-types';
|
|
|
3
3
|
import { PaymentMethod } from '../../../entity/payment-method/payment-method.entity';
|
|
4
4
|
import { PaymentMethodService } from '../../../service/services/payment-method.service';
|
|
5
5
|
import { RequestContext } from '../../common/request-context';
|
|
6
|
+
import { RelationPaths } from '../../decorators/relations.decorator';
|
|
6
7
|
export declare class PaymentMethodResolver {
|
|
7
8
|
private paymentMethodService;
|
|
8
9
|
constructor(paymentMethodService: PaymentMethodService);
|
|
9
|
-
paymentMethods(ctx: RequestContext, args: QueryPaymentMethodsArgs): Promise<PaginatedList<PaymentMethod>>;
|
|
10
|
-
paymentMethod(ctx: RequestContext, args: QueryPaymentMethodArgs): Promise<PaymentMethod | undefined>;
|
|
10
|
+
paymentMethods(ctx: RequestContext, args: QueryPaymentMethodsArgs, relations: RelationPaths<PaymentMethod>): Promise<PaginatedList<PaymentMethod>>;
|
|
11
|
+
paymentMethod(ctx: RequestContext, args: QueryPaymentMethodArgs, relations: RelationPaths<PaymentMethod>): Promise<PaymentMethod | undefined>;
|
|
11
12
|
createPaymentMethod(ctx: RequestContext, args: MutationCreatePaymentMethodArgs): Promise<PaymentMethod>;
|
|
12
13
|
updatePaymentMethod(ctx: RequestContext, args: MutationUpdatePaymentMethodArgs): Promise<PaymentMethod>;
|
|
13
14
|
deletePaymentMethod(ctx: RequestContext, args: MutationDeletePaymentMethodArgs): Promise<DeletionResponse>;
|
|
@@ -15,20 +15,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.PaymentMethodResolver = void 0;
|
|
16
16
|
const graphql_1 = require("@nestjs/graphql");
|
|
17
17
|
const generated_types_1 = require("@vendure/common/lib/generated-types");
|
|
18
|
+
const payment_method_entity_1 = require("../../../entity/payment-method/payment-method.entity");
|
|
18
19
|
const payment_method_service_1 = require("../../../service/services/payment-method.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 PaymentMethodResolver = class PaymentMethodResolver {
|
|
24
26
|
constructor(paymentMethodService) {
|
|
25
27
|
this.paymentMethodService = paymentMethodService;
|
|
26
28
|
}
|
|
27
|
-
paymentMethods(ctx, args) {
|
|
28
|
-
return this.paymentMethodService.findAll(ctx, args.options || undefined);
|
|
29
|
+
paymentMethods(ctx, args, relations) {
|
|
30
|
+
return this.paymentMethodService.findAll(ctx, args.options || undefined, relations);
|
|
29
31
|
}
|
|
30
|
-
paymentMethod(ctx, args) {
|
|
31
|
-
return this.paymentMethodService.findOne(ctx, args.id);
|
|
32
|
+
paymentMethod(ctx, args, relations) {
|
|
33
|
+
return this.paymentMethodService.findOne(ctx, args.id, relations);
|
|
32
34
|
}
|
|
33
35
|
createPaymentMethod(ctx, args) {
|
|
34
36
|
return this.paymentMethodService.create(ctx, args.input);
|
|
@@ -51,8 +53,9 @@ __decorate([
|
|
|
51
53
|
allow_decorator_1.Allow(generated_types_1.Permission.ReadSettings, generated_types_1.Permission.ReadPaymentMethod),
|
|
52
54
|
__param(0, request_context_decorator_1.Ctx()),
|
|
53
55
|
__param(1, graphql_1.Args()),
|
|
56
|
+
__param(2, relations_decorator_1.Relations(payment_method_entity_1.PaymentMethod)),
|
|
54
57
|
__metadata("design:type", Function),
|
|
55
|
-
__metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
|
|
58
|
+
__metadata("design:paramtypes", [request_context_1.RequestContext, Object, Array]),
|
|
56
59
|
__metadata("design:returntype", Promise)
|
|
57
60
|
], PaymentMethodResolver.prototype, "paymentMethods", null);
|
|
58
61
|
__decorate([
|
|
@@ -60,8 +63,9 @@ __decorate([
|
|
|
60
63
|
allow_decorator_1.Allow(generated_types_1.Permission.ReadSettings, generated_types_1.Permission.ReadPaymentMethod),
|
|
61
64
|
__param(0, request_context_decorator_1.Ctx()),
|
|
62
65
|
__param(1, graphql_1.Args()),
|
|
66
|
+
__param(2, relations_decorator_1.Relations(payment_method_entity_1.PaymentMethod)),
|
|
63
67
|
__metadata("design:type", Function),
|
|
64
|
-
__metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
|
|
68
|
+
__metadata("design:paramtypes", [request_context_1.RequestContext, Object, Array]),
|
|
65
69
|
__metadata("design:returntype", Promise)
|
|
66
70
|
], PaymentMethodResolver.prototype, "paymentMethod", null);
|
|
67
71
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment-method.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/admin/payment-method.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAkE;AAClE,yEAS6C;
|
|
1
|
+
{"version":3,"file":"payment-method.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/admin/payment-method.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAkE;AAClE,yEAS6C;AAG7C,gGAAqF;AACrF,6FAAwF;AACxF,kEAA8D;AAC9D,sEAAyD;AACzD,8EAAgF;AAChF,0FAAiE;AACjE,kFAAqE;AAGrE,IAA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,EAAE,CAAA;;qCAAM,gCAAc;;6EAE1D;AA/DQ,qBAAqB;IADjC,kBAAQ,CAAC,eAAe,CAAC;qCAEoB,6CAAoB;GADrD,qBAAqB,CAgEjC;AAhEY,sDAAqB"}
|
|
@@ -5,12 +5,13 @@ import { ProductOption } from '../../../entity/product-option/product-option.ent
|
|
|
5
5
|
import { ProductOptionGroupService } from '../../../service/services/product-option-group.service';
|
|
6
6
|
import { ProductOptionService } from '../../../service/services/product-option.service';
|
|
7
7
|
import { RequestContext } from '../../common/request-context';
|
|
8
|
+
import { RelationPaths } from '../../decorators/relations.decorator';
|
|
8
9
|
export declare class ProductOptionResolver {
|
|
9
10
|
private productOptionGroupService;
|
|
10
11
|
private productOptionService;
|
|
11
12
|
constructor(productOptionGroupService: ProductOptionGroupService, productOptionService: ProductOptionService);
|
|
12
|
-
productOptionGroups(ctx: RequestContext, args: QueryProductOptionGroupsArgs): Promise<Array<Translated<ProductOptionGroup>>>;
|
|
13
|
-
productOptionGroup(ctx: RequestContext, args: QueryProductOptionGroupArgs): Promise<Translated<ProductOptionGroup> | undefined>;
|
|
13
|
+
productOptionGroups(ctx: RequestContext, args: QueryProductOptionGroupsArgs, relations: RelationPaths<ProductOptionGroup>): Promise<Array<Translated<ProductOptionGroup>>>;
|
|
14
|
+
productOptionGroup(ctx: RequestContext, args: QueryProductOptionGroupArgs, relations: RelationPaths<ProductOptionGroup>): Promise<Translated<ProductOptionGroup> | undefined>;
|
|
14
15
|
createProductOptionGroup(ctx: RequestContext, args: MutationCreateProductOptionGroupArgs): Promise<Translated<ProductOptionGroup>>;
|
|
15
16
|
updateProductOptionGroup(ctx: RequestContext, args: MutationUpdateProductOptionGroupArgs): Promise<Translated<ProductOptionGroup>>;
|
|
16
17
|
createProductOption(ctx: RequestContext, args: MutationCreateProductOptionArgs): Promise<Translated<ProductOption>>;
|
|
@@ -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,yGAAmG;AACnG,6FAAwF;AACxF,kEAA8D;AAC9D,sEAAyD;AACzD,8EAAgF;AAChF,0FAAiE;AACjE,kFAAqE;AAGrE,IAAa,qBAAqB,GAAlC,MAAa,qBAAqB;IAC9B,YACY,yBAAoD,EACpD,oBAA0C;QAD1C,8BAAyB,GAAzB,yBAAyB,CAA2B;QACpD,yBAAoB,GAApB,oBAAoB,CAAsB;IACnD,CAAC;IAIJ,mBAAmB,CACR,GAA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,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":"","sources":["../../../../src/api/resolvers/admin/product.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAkE;AAClE,yEAoB6C;AAI7C,yDAA8D;AAE9D,mGAAwF;AACxF,2EAAiE;AACjE,uFAAkF;AAClF,+FAA0F;AAC1F,+EAA2E;AAC3E,kEAA8D;AAC9D,sEAAyD;AACzD,8EAAgF;AAChF,0FAAiE;AACjE,kFAAqE;AAGrE,IAAa,eAAe,G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ACV,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,CAC1D,uCAAoB,EACpB,cAAc,CAAC,OAAO,CACzB,CAAC;gBACF,IAAI,CAAC,0BAA0B,CAAC,8BAA8B,CAC1D,wCAAkB,EAClB,cAAc,CAAC,UAAU,CAC5B,CAAC;aACL;YACD,OAAO,cAAc,CAAC;QAC1B,CAAC,CAAC;IA9HC,CAAC;IAIJ,UAAU,CACC,GAAmB,EAClB,IAAyB,EACX,SAAmC;QAEzD,OAAO,IAAI,CAAC,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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,CAAC;IAID,IAAI,CACO,GAAmB,EAClB,IAAmB,EACV,SAA8B;QAE/C,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;IAC7D,CAAC;IAKD,UAAU,CAAQ,GAAmB,EAAU,IAA4B;QACvE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;QACvB,OAAO,IAAI,CAA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,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[];
|