@vendure/core 2.0.0-next.11 → 2.0.0-next.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/common/custom-field-relation-resolver.service.d.ts +3 -1
- package/dist/api/common/custom-field-relation-resolver.service.js +7 -5
- package/dist/api/common/custom-field-relation-resolver.service.js.map +1 -1
- package/dist/api/config/generate-resolvers.d.ts +3 -0
- package/dist/api/resolvers/admin/collection.resolver.js +8 -2
- package/dist/api/resolvers/admin/collection.resolver.js.map +1 -1
- package/dist/api/resolvers/admin/order.resolver.d.ts +2 -1
- package/dist/api/resolvers/admin/order.resolver.js +13 -0
- package/dist/api/resolvers/admin/order.resolver.js.map +1 -1
- package/dist/api/resolvers/admin/product-option.resolver.d.ts +2 -1
- package/dist/api/resolvers/admin/product-option.resolver.js +13 -0
- package/dist/api/resolvers/admin/product-option.resolver.js.map +1 -1
- package/dist/api/resolvers/base/base-auth.resolver.d.ts +2 -2
- package/dist/api/resolvers/base/base-auth.resolver.js.map +1 -1
- package/dist/api/resolvers/entity/fulfillment-entity.resolver.d.ts +8 -2
- package/dist/api/resolvers/entity/fulfillment-entity.resolver.js +17 -3
- package/dist/api/resolvers/entity/fulfillment-entity.resolver.js.map +1 -1
- package/dist/api/resolvers/entity/order-item-entity.resolver.d.ts +3 -1
- package/dist/api/resolvers/entity/order-item-entity.resolver.js +9 -3
- package/dist/api/resolvers/entity/order-item-entity.resolver.js.map +1 -1
- package/dist/api/resolvers/entity/order-line-entity.resolver.d.ts +5 -3
- package/dist/api/resolvers/entity/order-line-entity.resolver.js +19 -2
- package/dist/api/resolvers/entity/order-line-entity.resolver.js.map +1 -1
- package/dist/api/resolvers/entity/payment-entity.resolver.d.ts +3 -1
- package/dist/api/resolvers/entity/payment-entity.resolver.js +6 -3
- package/dist/api/resolvers/entity/payment-entity.resolver.js.map +1 -1
- package/dist/api/resolvers/entity/product-option-group-entity.resolver.js +8 -3
- package/dist/api/resolvers/entity/product-option-group-entity.resolver.js.map +1 -1
- package/dist/api/resolvers/shop/shop-products.resolver.js +8 -2
- package/dist/api/resolvers/shop/shop-products.resolver.js.map +1 -1
- package/dist/api/schema/admin-api/order.api.graphql +9 -0
- package/dist/api/schema/admin-api/product-option-group.api.graphql +2 -0
- package/dist/api/schema/common/order.type.graphql +7 -0
- package/dist/common/configurable-operation.js +9 -4
- package/dist/common/configurable-operation.js.map +1 -1
- package/dist/common/error/generated-graphql-admin-errors.d.ts +12 -0
- package/dist/common/error/generated-graphql-admin-errors.js +17 -2
- package/dist/common/error/generated-graphql-admin-errors.js.map +1 -1
- package/dist/config/entity-id-strategy/entity-id-strategy.d.ts +7 -0
- package/dist/config/payment/dummy-payment-method-handler.js +8 -0
- package/dist/config/payment/dummy-payment-method-handler.js.map +1 -1
- package/dist/config/payment/payment-method-handler.d.ts +66 -0
- package/dist/config/payment/payment-method-handler.js +11 -1
- package/dist/config/payment/payment-method-handler.js.map +1 -1
- package/dist/config/promotion/actions/order-fixed-discount-action.js +1 -1
- package/dist/config/promotion/actions/order-fixed-discount-action.js.map +1 -1
- package/dist/config/vendure-config.d.ts +9 -0
- package/dist/connection/remove-custom-fields-with-eager-relations.d.ts +34 -0
- package/dist/connection/remove-custom-fields-with-eager-relations.js +55 -0
- package/dist/connection/remove-custom-fields-with-eager-relations.js.map +1 -0
- package/dist/connection/transactional-connection.d.ts +0 -33
- package/dist/connection/transactional-connection.js +21 -53
- package/dist/connection/transactional-connection.js.map +1 -1
- package/dist/entity/product-option/product-option-translation.entity.js.map +1 -1
- package/dist/entity/product-option-group/product-option-group-translation.entity.js.map +1 -1
- package/dist/event-bus/events/product-option-event.d.ts +1 -1
- package/dist/event-bus/events/product-option-event.js.map +1 -1
- package/dist/event-bus/events/product-option-group-event.d.ts +1 -1
- package/dist/event-bus/events/product-option-group-event.js.map +1 -1
- package/dist/i18n/messages/en.json +3 -0
- package/dist/migrate.js +14 -0
- package/dist/migrate.js.map +1 -1
- package/dist/plugin/default-search-plugin/search-strategy/mysql-search-strategy.js +34 -34
- package/dist/plugin/default-search-plugin/search-strategy/mysql-search-strategy.js.map +1 -1
- package/dist/plugin/default-search-plugin/search-strategy/postgres-search-strategy.js +12 -12
- package/dist/plugin/default-search-plugin/search-strategy/postgres-search-strategy.js.map +1 -1
- package/dist/plugin/default-search-plugin/search-strategy/search-strategy-common.d.ts +1 -0
- package/dist/plugin/default-search-plugin/search-strategy/search-strategy-common.js +8 -1
- package/dist/plugin/default-search-plugin/search-strategy/search-strategy-common.js.map +1 -1
- package/dist/plugin/default-search-plugin/search-strategy/search-strategy-utils.d.ts +11 -1
- package/dist/plugin/default-search-plugin/search-strategy/search-strategy-utils.js +31 -1
- package/dist/plugin/default-search-plugin/search-strategy/search-strategy-utils.js.map +1 -1
- package/dist/plugin/default-search-plugin/search-strategy/sqlite-search-strategy.js +30 -30
- package/dist/plugin/default-search-plugin/search-strategy/sqlite-search-strategy.js.map +1 -1
- package/dist/service/helpers/config-arg/config-arg.service.d.ts +1 -0
- package/dist/service/helpers/config-arg/config-arg.service.js +12 -1
- package/dist/service/helpers/config-arg/config-arg.service.js.map +1 -1
- package/dist/service/helpers/entity-hydrator/entity-hydrator.service.d.ts +3 -1
- package/dist/service/helpers/entity-hydrator/entity-hydrator.service.js +6 -4
- package/dist/service/helpers/entity-hydrator/entity-hydrator.service.js.map +1 -1
- package/dist/service/helpers/locale-string-hydrator/locale-string-hydrator.d.ts +3 -1
- package/dist/service/helpers/locale-string-hydrator/locale-string-hydrator.js +6 -4
- package/dist/service/helpers/locale-string-hydrator/locale-string-hydrator.js.map +1 -1
- package/dist/service/helpers/order-modifier/order-modifier.d.ts +3 -1
- package/dist/service/helpers/order-modifier/order-modifier.js +15 -8
- package/dist/service/helpers/order-modifier/order-modifier.js.map +1 -1
- package/dist/service/helpers/order-state-machine/order-state-machine.js +1 -1
- package/dist/service/helpers/order-state-machine/order-state-machine.js.map +1 -1
- package/dist/service/helpers/slug-validator/slug-validator.js +3 -1
- package/dist/service/helpers/slug-validator/slug-validator.js.map +1 -1
- package/dist/service/helpers/translator/translator.service.d.ts +10 -0
- package/dist/service/helpers/translator/translator.service.js +29 -0
- package/dist/service/helpers/translator/translator.service.js.map +1 -0
- package/dist/service/helpers/utils/translate-entity.d.ts +3 -3
- package/dist/service/helpers/utils/translate-entity.js +11 -2
- package/dist/service/helpers/utils/translate-entity.js.map +1 -1
- package/dist/service/index.d.ts +1 -0
- package/dist/service/index.js +1 -0
- package/dist/service/index.js.map +1 -1
- package/dist/service/service.module.js +2 -0
- package/dist/service/service.module.js.map +1 -1
- package/dist/service/services/collection.service.d.ts +3 -1
- package/dist/service/services/collection.service.js +14 -12
- package/dist/service/services/collection.service.js.map +1 -1
- package/dist/service/services/country.service.d.ts +3 -1
- package/dist/service/services/country.service.js +9 -7
- package/dist/service/services/country.service.js.map +1 -1
- package/dist/service/services/customer.service.d.ts +3 -1
- package/dist/service/services/customer.service.js +8 -6
- package/dist/service/services/customer.service.js.map +1 -1
- package/dist/service/services/facet-value.service.d.ts +3 -1
- package/dist/service/services/facet-value.service.js +9 -5
- package/dist/service/services/facet-value.service.js.map +1 -1
- package/dist/service/services/facet.service.d.ts +3 -1
- package/dist/service/services/facet.service.js +9 -5
- package/dist/service/services/facet.service.js.map +1 -1
- package/dist/service/services/fulfillment.service.d.ts +9 -0
- package/dist/service/services/fulfillment.service.js +48 -8
- package/dist/service/services/fulfillment.service.js.map +1 -1
- package/dist/service/services/order-testing.service.d.ts +3 -1
- package/dist/service/services/order-testing.service.js +6 -4
- package/dist/service/services/order-testing.service.js.map +1 -1
- package/dist/service/services/order.service.d.ts +10 -2
- package/dist/service/services/order.service.js +48 -27
- package/dist/service/services/order.service.js.map +1 -1
- package/dist/service/services/payment.service.d.ts +2 -0
- package/dist/service/services/payment.service.js +30 -10
- package/dist/service/services/payment.service.js.map +1 -1
- package/dist/service/services/product-option-group.service.d.ts +24 -2
- package/dist/service/services/product-option-group.service.js +92 -6
- package/dist/service/services/product-option-group.service.js.map +1 -1
- package/dist/service/services/product-option.service.d.ts +15 -2
- package/dist/service/services/product-option.service.js +66 -5
- package/dist/service/services/product-option.service.js.map +1 -1
- package/dist/service/services/product-variant.service.d.ts +3 -1
- package/dist/service/services/product-variant.service.js +12 -10
- package/dist/service/services/product-variant.service.js.map +1 -1
- package/dist/service/services/product.service.d.ts +5 -1
- package/dist/service/services/product.service.js +45 -13
- package/dist/service/services/product.service.js.map +1 -1
- package/dist/service/services/shipping-method.service.d.ts +3 -1
- package/dist/service/services/shipping-method.service.js +8 -6
- package/dist/service/services/shipping-method.service.js.map +1 -1
- package/dist/service/services/stock-movement.service.js +8 -7
- package/dist/service/services/stock-movement.service.js.map +1 -1
- package/dist/service/services/user.service.d.ts +1 -1
- package/dist/service/services/user.service.js +5 -0
- package/dist/service/services/user.service.js.map +1 -1
- package/dist/service/services/zone.service.d.ts +3 -1
- package/dist/service/services/zone.service.js +8 -6
- package/dist/service/services/zone.service.js.map +1 -1
- package/package.json +3 -3
|
@@ -4,6 +4,7 @@ import { RelationCustomFieldConfig } from '../../config/custom-field/custom-fiel
|
|
|
4
4
|
import { TransactionalConnection } from '../../connection/transactional-connection';
|
|
5
5
|
import { VendureEntity } from '../../entity/base/base.entity';
|
|
6
6
|
import { ProductPriceApplicator } from '../../service/helpers/product-price-applicator/product-price-applicator';
|
|
7
|
+
import { TranslatorService } from '../../service/helpers/translator/translator.service';
|
|
7
8
|
import { RequestContext } from './request-context';
|
|
8
9
|
export interface ResolveRelationConfig {
|
|
9
10
|
ctx: RequestContext;
|
|
@@ -15,7 +16,8 @@ export declare class CustomFieldRelationResolverService {
|
|
|
15
16
|
private connection;
|
|
16
17
|
private configService;
|
|
17
18
|
private productPriceApplicator;
|
|
18
|
-
|
|
19
|
+
private translator;
|
|
20
|
+
constructor(connection: TransactionalConnection, configService: ConfigService, productPriceApplicator: ProductPriceApplicator, translator: TranslatorService);
|
|
19
21
|
/**
|
|
20
22
|
* @description
|
|
21
23
|
* Used to dynamically resolve related entities in custom fields. Based on the field
|
|
@@ -16,12 +16,13 @@ const config_service_1 = require("../../config/config.service");
|
|
|
16
16
|
const transactional_connection_1 = require("../../connection/transactional-connection");
|
|
17
17
|
const product_variant_entity_1 = require("../../entity/product-variant/product-variant.entity");
|
|
18
18
|
const product_price_applicator_1 = require("../../service/helpers/product-price-applicator/product-price-applicator");
|
|
19
|
-
const
|
|
19
|
+
const translator_service_1 = require("../../service/helpers/translator/translator.service");
|
|
20
20
|
let CustomFieldRelationResolverService = class CustomFieldRelationResolverService {
|
|
21
|
-
constructor(connection, configService, productPriceApplicator) {
|
|
21
|
+
constructor(connection, configService, productPriceApplicator, translator) {
|
|
22
22
|
this.connection = connection;
|
|
23
23
|
this.configService = configService;
|
|
24
24
|
this.productPriceApplicator = productPriceApplicator;
|
|
25
|
+
this.translator = translator;
|
|
25
26
|
}
|
|
26
27
|
/**
|
|
27
28
|
* @description
|
|
@@ -54,9 +55,9 @@ let CustomFieldRelationResolverService = class CustomFieldRelationResolverServic
|
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
57
|
const translated = Array.isArray(result)
|
|
57
|
-
? result.map(r => (this.isTranslatable(r) ?
|
|
58
|
+
? result.map(r => (this.isTranslatable(r) ? this.translator.translate(r, ctx) : r))
|
|
58
59
|
: this.isTranslatable(result)
|
|
59
|
-
?
|
|
60
|
+
? this.translator.translate(result, ctx)
|
|
60
61
|
: result;
|
|
61
62
|
return translated;
|
|
62
63
|
}
|
|
@@ -78,7 +79,8 @@ CustomFieldRelationResolverService = __decorate([
|
|
|
78
79
|
(0, common_1.Injectable)(),
|
|
79
80
|
__metadata("design:paramtypes", [transactional_connection_1.TransactionalConnection,
|
|
80
81
|
config_service_1.ConfigService,
|
|
81
|
-
product_price_applicator_1.ProductPriceApplicator
|
|
82
|
+
product_price_applicator_1.ProductPriceApplicator,
|
|
83
|
+
translator_service_1.TranslatorService])
|
|
82
84
|
], CustomFieldRelationResolverService);
|
|
83
85
|
exports.CustomFieldRelationResolverService = CustomFieldRelationResolverService;
|
|
84
86
|
//# sourceMappingURL=custom-field-relation-resolver.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-field-relation-resolver.service.js","sourceRoot":"","sources":["../../../src/api/common/custom-field-relation-resolver.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAE5C,4EAAyE;AAGzE,gEAA4D;AAE5D,wFAAoF;AAEpF,gGAAqF;AACrF,sHAAiH;AACjH,
|
|
1
|
+
{"version":3,"file":"custom-field-relation-resolver.service.js","sourceRoot":"","sources":["../../../src/api/common/custom-field-relation-resolver.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAE5C,4EAAyE;AAGzE,gEAA4D;AAE5D,wFAAoF;AAEpF,gGAAqF;AACrF,sHAAiH;AACjH,4FAAwF;AAYxF,IAAa,kCAAkC,GAA/C,MAAa,kCAAkC;IAC3C,YACY,UAAmC,EACnC,aAA4B,EAC5B,sBAA8C,EAC9C,UAA6B;QAH7B,eAAU,GAAV,UAAU,CAAyB;QACnC,kBAAa,GAAb,aAAa,CAAe;QAC5B,2BAAsB,GAAtB,sBAAsB,CAAwB;QAC9C,eAAU,GAAV,UAAU,CAAmB;IACtC,CAAC;IAEJ;;;;;OAKG;IACH,KAAK,CAAC,eAAe,CAAC,MAA6B;QAC/C,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;QAEvD,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU;aACxB,aAAa,CAAC,GAAG,EAAE,UAAU,CAAC;aAC9B,kBAAkB,CAAC,QAAQ,CAAC;aAC5B,QAAQ,CAAC,uBAAuB,QAAQ,CAAC,IAAI,EAAE,EAAE,gBAAgB,CAAC;aAClE,MAAM,CAAC,mBAAmB,CAAC;aAC3B,KAAK,CAAC,iBAAiB,CAAC,CAAC;QAE9B,MAAM,EAAE,GAAG,IAAI,CAAC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C,UAAU,CAAC,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC;gBACxC,CAAC,CAAC,MAAM,CAAC;QAEb,OAAO,UAAU,CAAC;IACtB,CAAC;IAEO,cAAc,CAAC,KAAc;QACjC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;IAC9F,CAAC;IAEO,KAAK,CAAC,kBAAkB,CAAC,GAAmB,EAAE,OAAuB;QACzE,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,UAAU;aACpC,aAAa,CAAC,GAAG,EAAE,uCAAc,CAAC;aAClC,kBAAkB,EAAE;aACpB,QAAQ,CAAC,aAAa,CAAC;aACvB,EAAE,CAAC,OAAO,CAAC;aACX,OAAO,EAAE,CAAC;QACf,OAAO,CAAC,WAAW,GAAG,WAAW,CAAC;QAClC,OAAO,IAAI,CAAC,sBAAsB,CAAC,uBAAuB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IAC7E,CAAC;CACJ,CAAA;AAjEY,kCAAkC;IAD9C,IAAA,mBAAU,GAAE;qCAGe,kDAAuB;QACpB,8BAAa;QACJ,iDAAsB;QAClC,sCAAiB;GALhC,kCAAkC,CAiE9C;AAjEY,gFAAkC"}
|
|
@@ -21,6 +21,9 @@ export declare function generateResolvers(configService: ConfigService, customFi
|
|
|
21
21
|
CancelOrderResult: {
|
|
22
22
|
__resolveType(value: any): any;
|
|
23
23
|
};
|
|
24
|
+
CancelPaymentResult: {
|
|
25
|
+
__resolveType(value: any): any;
|
|
26
|
+
};
|
|
24
27
|
CreateAssetResult: {
|
|
25
28
|
__resolveType(value: any): any;
|
|
26
29
|
};
|
|
@@ -102,7 +102,10 @@ __decorate([
|
|
|
102
102
|
(0, allow_decorator_1.Allow)(generated_types_1.Permission.ReadCatalog, generated_types_1.Permission.ReadCollection),
|
|
103
103
|
__param(0, (0, request_context_decorator_1.Ctx)()),
|
|
104
104
|
__param(1, (0, graphql_1.Args)()),
|
|
105
|
-
__param(2, (0, relations_decorator_1.Relations)({
|
|
105
|
+
__param(2, (0, relations_decorator_1.Relations)({
|
|
106
|
+
entity: collection_entity_1.Collection,
|
|
107
|
+
omit: ['productVariants', 'assets', 'parent.productVariants', 'children.productVariants'],
|
|
108
|
+
})),
|
|
106
109
|
__metadata("design:type", Function),
|
|
107
110
|
__metadata("design:paramtypes", [request_context_1.RequestContext, Object, Array]),
|
|
108
111
|
__metadata("design:returntype", Promise)
|
|
@@ -112,7 +115,10 @@ __decorate([
|
|
|
112
115
|
(0, allow_decorator_1.Allow)(generated_types_1.Permission.ReadCatalog, generated_types_1.Permission.ReadCollection),
|
|
113
116
|
__param(0, (0, request_context_decorator_1.Ctx)()),
|
|
114
117
|
__param(1, (0, graphql_1.Args)()),
|
|
115
|
-
__param(2, (0, relations_decorator_1.Relations)({
|
|
118
|
+
__param(2, (0, relations_decorator_1.Relations)({
|
|
119
|
+
entity: collection_entity_1.Collection,
|
|
120
|
+
omit: ['productVariants', 'assets', 'parent.productVariants', 'children.productVariants'],
|
|
121
|
+
})),
|
|
116
122
|
__metadata("design:type", Function),
|
|
117
123
|
__metadata("design:paramtypes", [request_context_1.RequestContext, Object, Array]),
|
|
118
124
|
__metadata("design:returntype", Promise)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/admin/collection.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAkE;AAClE,yEAW6C;AAG7C,yDAA8D;AAE9D,iFAA6E;AAC7E,oFAA0E;AAC1E,qFAAiF;AACjF,uFAAkF;AAClF,4FAAuF;AACvF,kEAA8D;AAC9D,sEAAyD;AACzD,8EAAgF;AAChF,0FAAiE;AACjE,kFAAqE;AAGrE,IAAa,kBAAkB,GAA/B,MAAa,kBAAkB;IAC3B,YACY,iBAAoC,EACpC,iBAAoC,EACpC,0BAAsD;QAFtD,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,+BAA0B,GAA1B,0BAA0B,CAA4B;
|
|
1
|
+
{"version":3,"file":"collection.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/admin/collection.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAkE;AAClE,yEAW6C;AAG7C,yDAA8D;AAE9D,iFAA6E;AAC7E,oFAA0E;AAC1E,qFAAiF;AACjF,uFAAkF;AAClF,4FAAuF;AACvF,kEAA8D;AAC9D,sEAAyD;AACzD,8EAAgF;AAChF,0FAAiE;AACjE,kFAAqE;AAGrE,IAAa,kBAAkB,GAA/B,MAAa,kBAAkB;IAC3B,YACY,iBAAoC,EACpC,iBAAoC,EACpC,0BAAsD;QAFtD,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,+BAA0B,GAA1B,0BAA0B,CAA4B;QA2GlE;;WAEG;QACK,kBAAa,GAAG,CAAmC,UAAa,EAAK,EAAE;YAC3E,IAAI,UAAU,EAAE;gBACZ,IAAI,CAAC,0BAA0B,CAAC,8BAA8B,CAC1D,oCAAgB,EAChB,UAAU,CAAC,OAAO,CACrB,CAAC;aACL;YACD,OAAO,UAAU,CAAC;QACtB,CAAC,CAAC;IArHC,CAAC;IAIJ,KAAK,CAAC,iBAAiB,CACZ,GAAmB,EAClB,IAA0B;QAElC,OAAO,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC;IAC3D,CAAC;IAID,KAAK,CAAC,WAAW,CACN,GAAmB,EAClB,IAA0B,EAKlC,SAAoC;QAEpC,OAAO,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,IAAI,SAAS,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;YACxF,GAAG,CAAC,KAAK,CAAC,O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GAAE,CAAA;;qCADK,gCAAc;;0DAM7B;AAKD;IAHC,IAAA,mCAAW,GAAE;IACb,IAAA,kBAAQ,GAAE;IACV,IAAA,uBAAK,EAAC,4BAAU,CAAC,aAAa,EAAE,4BAAU,CAAC,gBAAgB,CAAC;IAExD,WAAA,IAAA,+BAAG,GAAE,CAAA;IACL,WAAA,IAAA,cAAI,GAAE,CAAA;;qCADK,gCAAc;;wDAK7B;AAKD;IAHC,IAAA,mCAAW,GAAE;IACb,IAAA,kBAAQ,GAAE;IACV,IAAA,uBAAK,EAAC,4BAAU,CAAC,aAAa,EAAE,4BAAU,CAAC,gBAAgB,CAAC;IAExD,WAAA,IAAA,+BAAG,GAAE,CAAA;IACL,WAAA,IAAA,cAAI,GAAE,CAAA;;qCADK,gCAAc;;0DAI7B;AA7GQ,kBAAkB;IAD9B,IAAA,kBAAQ,GAAE;qCAGwB,sCAAiB;QACjB,uCAAiB;QACR,yDAA0B;GAJzD,kBAAkB,CA2H9B;AA3HY,gDAAkB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AddFulfillmentToOrderResult, CancelOrderResult, MutationAddFulfillmentToOrderArgs, MutationAddManualPaymentToOrderArgs, MutationAddNoteToOrderArgs, MutationCancelOrderArgs, MutationDeleteOrderNoteArgs, MutationModifyOrderArgs, MutationRefundOrderArgs, MutationSetOrderCustomFieldsArgs, MutationSettlePaymentArgs, MutationSettleRefundArgs, MutationTransitionFulfillmentToStateArgs, MutationTransitionOrderToStateArgs, MutationTransitionPaymentToStateArgs, MutationUpdateOrderNoteArgs, QueryOrderArgs, QueryOrdersArgs, RefundOrderResult, SettlePaymentResult, TransitionPaymentToStateResult } from '@vendure/common/lib/generated-types';
|
|
1
|
+
import { AddFulfillmentToOrderResult, CancelOrderResult, CancelPaymentResult, MutationAddFulfillmentToOrderArgs, MutationAddManualPaymentToOrderArgs, MutationAddNoteToOrderArgs, MutationCancelOrderArgs, MutationCancelPaymentArgs, MutationDeleteOrderNoteArgs, MutationModifyOrderArgs, MutationRefundOrderArgs, MutationSetOrderCustomFieldsArgs, MutationSettlePaymentArgs, MutationSettleRefundArgs, MutationTransitionFulfillmentToStateArgs, MutationTransitionOrderToStateArgs, MutationTransitionPaymentToStateArgs, MutationUpdateOrderNoteArgs, QueryOrderArgs, QueryOrdersArgs, RefundOrderResult, SettlePaymentResult, TransitionPaymentToStateResult } from '@vendure/common/lib/generated-types';
|
|
2
2
|
import { PaginatedList } from '@vendure/common/lib/shared-types';
|
|
3
3
|
import { ErrorResultUnion } from '../../../common/error/error-result';
|
|
4
4
|
import { TransactionalConnection } from '../../../connection';
|
|
@@ -16,6 +16,7 @@ export declare class OrderResolver {
|
|
|
16
16
|
orders(ctx: RequestContext, args: QueryOrdersArgs, relations: RelationPaths<Order>): Promise<PaginatedList<Order>>;
|
|
17
17
|
order(ctx: RequestContext, args: QueryOrderArgs, relations: RelationPaths<Order>): Promise<Order | undefined>;
|
|
18
18
|
settlePayment(ctx: RequestContext, args: MutationSettlePaymentArgs): Promise<ErrorResultUnion<SettlePaymentResult, Payment>>;
|
|
19
|
+
cancelPayment(ctx: RequestContext, args: MutationCancelPaymentArgs): Promise<ErrorResultUnion<CancelPaymentResult, Payment>>;
|
|
19
20
|
addFulfillmentToOrder(ctx: RequestContext, args: MutationAddFulfillmentToOrderArgs): Promise<ErrorResultUnion<AddFulfillmentToOrderResult, Fulfillment>>;
|
|
20
21
|
cancelOrder(ctx: RequestContext, args: MutationCancelOrderArgs): Promise<ErrorResultUnion<CancelOrderResult, Order>>;
|
|
21
22
|
refundOrder(ctx: RequestContext, args: MutationRefundOrderArgs): Promise<ErrorResultUnion<RefundOrderResult, Refund>>;
|
|
@@ -38,6 +38,9 @@ let OrderResolver = class OrderResolver {
|
|
|
38
38
|
async settlePayment(ctx, args) {
|
|
39
39
|
return this.orderService.settlePayment(ctx, args.id);
|
|
40
40
|
}
|
|
41
|
+
async cancelPayment(ctx, args) {
|
|
42
|
+
return this.orderService.cancelPayment(ctx, args.id);
|
|
43
|
+
}
|
|
41
44
|
async addFulfillmentToOrder(ctx, args) {
|
|
42
45
|
return this.orderService.createFulfillment(ctx, args.input);
|
|
43
46
|
}
|
|
@@ -116,6 +119,16 @@ __decorate([
|
|
|
116
119
|
__metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
|
|
117
120
|
__metadata("design:returntype", Promise)
|
|
118
121
|
], OrderResolver.prototype, "settlePayment", null);
|
|
122
|
+
__decorate([
|
|
123
|
+
(0, transaction_decorator_1.Transaction)(),
|
|
124
|
+
(0, graphql_1.Mutation)(),
|
|
125
|
+
(0, allow_decorator_1.Allow)(generated_types_1.Permission.UpdateOrder),
|
|
126
|
+
__param(0, (0, request_context_decorator_1.Ctx)()),
|
|
127
|
+
__param(1, (0, graphql_1.Args)()),
|
|
128
|
+
__metadata("design:type", Function),
|
|
129
|
+
__metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
|
|
130
|
+
__metadata("design:returntype", Promise)
|
|
131
|
+
], OrderResolver.prototype, "cancelPayment", null);
|
|
119
132
|
__decorate([
|
|
120
133
|
(0, transaction_decorator_1.Transaction)(),
|
|
121
134
|
(0, graphql_1.Mutation)(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/admin/order.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAkE;AAClE,
|
|
1
|
+
{"version":3,"file":"order.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/admin/order.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAkE;AAClE,yEAyB6C;AAG7C,qEAA4F;AAC5F,oDAA8D;AAE9D,qEAA2D;AAM3D,2EAAuE;AACvE,kEAA8D;AAC9D,sEAAyD;AACzD,8EAAgF;AAChF,0FAAiE;AACjE,kFAAqE;AAGrE,IAAa,aAAa,GAA1B,MAAa,aAAa;IACtB,YAAoB,YAA0B,EAAU,UAAmC;QAA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7B;AAKD;IAHC,IAAA,mCAAW,GAAE;IACb,IAAA,kBAAQ,GAAE;IACV,IAAA,uBAAK,EAAC,4BAAU,CAAC,WAAW,CAAC;IAEzB,WAAA,IAAA,+BAAG,GAAE,CAAA;IACL,WAAA,IAAA,cAAI,GAAE,CAAA;;qCADK,gCAAc;;6DAI7B;AAKD;IAHC,IAAA,mCAAW,EAAC,QAAQ,CAAC;IACrB,IAAA,kBAAQ,GAAE;IACV,IAAA,uBAAK,EAAC,4BAAU,CAAC,WAAW,CAAC;IACX,WAAA,IAAA,+BAAG,GAAE,CAAA;IAAuB,WAAA,IAAA,cAAI,GAAE,CAAA;;qCAAvB,gCAAc;;gDAW3C;AAKD;IAHC,IAAA,mCAAW,GAAE;IACb,IAAA,kBAAQ,GAAE;IACV,IAAA,uBAAK,EAAC,4BAAU,CAAC,WAAW,CAAC;IAEzB,WAAA,IAAA,+BAAG,GAAE,CAAA;IACL,WAAA,IAAA,cAAI,GAAE,CAAA;;qCADK,gCAAc;;4DAI7B;AAlKQ,aAAa;IADzB,IAAA,kBAAQ,GAAE;qCAE2B,4BAAY,EAAsB,oCAAuB;GADlF,aAAa,CAmKzB;AAnKY,sCAAa"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MutationCreateProductOptionArgs, MutationCreateProductOptionGroupArgs, MutationUpdateProductOptionArgs, MutationUpdateProductOptionGroupArgs, QueryProductOptionGroupArgs, QueryProductOptionGroupsArgs } from '@vendure/common/lib/generated-types';
|
|
1
|
+
import { DeletionResponse, MutationCreateProductOptionArgs, MutationCreateProductOptionGroupArgs, MutationDeleteProductOptionArgs, MutationUpdateProductOptionArgs, MutationUpdateProductOptionGroupArgs, QueryProductOptionGroupArgs, QueryProductOptionGroupsArgs } from '@vendure/common/lib/generated-types';
|
|
2
2
|
import { Translated } from '../../../common/types/locale-types';
|
|
3
3
|
import { ProductOptionGroup } from '../../../entity/product-option-group/product-option-group.entity';
|
|
4
4
|
import { ProductOption } from '../../../entity/product-option/product-option.entity';
|
|
@@ -16,4 +16,5 @@ export declare class ProductOptionResolver {
|
|
|
16
16
|
updateProductOptionGroup(ctx: RequestContext, args: MutationUpdateProductOptionGroupArgs): Promise<Translated<ProductOptionGroup>>;
|
|
17
17
|
createProductOption(ctx: RequestContext, args: MutationCreateProductOptionArgs): Promise<Translated<ProductOption>>;
|
|
18
18
|
updateProductOption(ctx: RequestContext, args: MutationUpdateProductOptionArgs): Promise<Translated<ProductOption>>;
|
|
19
|
+
deleteProductOption(ctx: RequestContext, { id }: MutationDeleteProductOptionArgs): Promise<DeletionResponse>;
|
|
19
20
|
}
|
|
@@ -57,6 +57,9 @@ let ProductOptionResolver = class ProductOptionResolver {
|
|
|
57
57
|
const { input } = args;
|
|
58
58
|
return this.productOptionService.update(ctx, input);
|
|
59
59
|
}
|
|
60
|
+
async deleteProductOption(ctx, { id }) {
|
|
61
|
+
return this.productOptionService.delete(ctx, id);
|
|
62
|
+
}
|
|
60
63
|
};
|
|
61
64
|
__decorate([
|
|
62
65
|
(0, graphql_1.Query)(),
|
|
@@ -118,6 +121,16 @@ __decorate([
|
|
|
118
121
|
__metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
|
|
119
122
|
__metadata("design:returntype", Promise)
|
|
120
123
|
], ProductOptionResolver.prototype, "updateProductOption", null);
|
|
124
|
+
__decorate([
|
|
125
|
+
(0, transaction_decorator_1.Transaction)(),
|
|
126
|
+
(0, graphql_1.Mutation)(),
|
|
127
|
+
(0, allow_decorator_1.Allow)(generated_types_1.Permission.DeleteCatalog, generated_types_1.Permission.DeleteProduct),
|
|
128
|
+
__param(0, (0, request_context_decorator_1.Ctx)()),
|
|
129
|
+
__param(1, (0, graphql_1.Args)()),
|
|
130
|
+
__metadata("design:type", Function),
|
|
131
|
+
__metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
|
|
132
|
+
__metadata("design:returntype", Promise)
|
|
133
|
+
], ProductOptionResolver.prototype, "deleteProductOption", null);
|
|
121
134
|
ProductOptionResolver = __decorate([
|
|
122
135
|
(0, graphql_1.Resolver)(),
|
|
123
136
|
__metadata("design:paramtypes", [product_option_group_service_1.ProductOptionGroupService,
|
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"product-option.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/admin/product-option.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAkE;AAClE,yEAW6C;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,GAAmB,EAClB,IAAkC,EACX,SAA4C;QAE3E,OAAO,IAAI,CAAC,yBAAyB,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,UAAU,IAAI,SAAS,CAAC,CAAC;IACrF,CAAC;IAID,kBAAkB,CACP,GAAmB,EAClB,IAAiC,EACV,SAA4C;QAE3E,OAAO,IAAI,CAAC,yBAAyB,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IAChE,CAAC;IAKD,KAAK,CAAC,wBAAwB,CACnB,GAAmB,EAClB,IAA0C;QAElD,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;QACvB,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAEtE,IAAI,KAAK,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AAA;IACL,WAAA,IAAA,cAAI,GAAE,CAAA;;qCADK,gCAAc;;gEAK7B;AAKD;IAHC,IAAA,mCAAW,GAAE;IACb,IAAA,kBAAQ,GAAE;IACV,IAAA,uBAAK,EAAC,4BAAU,CAAC,aAAa,EAAE,4BAAU,CAAC,aAAa,CAAC;IAErD,WAAA,IAAA,+BAAG,GAAE,CAAA;IACL,WAAA,IAAA,cAAI,GAAE,CAAA;;qCADK,gCAAc;;gEAI7B;AAtFQ,qBAAqB;IADjC,IAAA,kBAAQ,GAAE;qCAGgC,wDAAyB;QAC9B,6CAAoB;GAH7C,qBAAqB,CAuFjC;AAvFY,sDAAqB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthenticationResult as ShopAuthenticationResult } from '@vendure/common/lib/generated-shop-types';
|
|
1
|
+
import { AuthenticationResult as ShopAuthenticationResult, PasswordValidationError } from '@vendure/common/lib/generated-shop-types';
|
|
2
2
|
import { AuthenticationResult as AdminAuthenticationResult, CurrentUser, MutationAuthenticateArgs, MutationLoginArgs, Success } from '@vendure/common/lib/generated-types';
|
|
3
3
|
import { Request, Response } from 'express';
|
|
4
4
|
import { NativeAuthStrategyError as AdminNativeAuthStrategyError } from '../../../common/error/generated-graphql-admin-errors';
|
|
@@ -34,7 +34,7 @@ export declare class BaseAuthResolver {
|
|
|
34
34
|
/**
|
|
35
35
|
* Updates the password of an existing User.
|
|
36
36
|
*/
|
|
37
|
-
protected updatePassword(ctx: RequestContext, currentPassword: string, newPassword: string): Promise<boolean | InvalidCredentialsError>;
|
|
37
|
+
protected updatePassword(ctx: RequestContext, currentPassword: string, newPassword: string): Promise<boolean | InvalidCredentialsError | PasswordValidationError>;
|
|
38
38
|
/**
|
|
39
39
|
* Exposes a subset of the User properties which we want to expose to the public API.
|
|
40
40
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-auth.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/base/base-auth.resolver.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"base-auth.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/base/base-auth.resolver.ts"],"names":[],"mappings":";;;AAcA,qEAA0E;AAC1E,yDAA8D;AAC9D,yGAA+H;AAC/H,uGAI6D;AAC7D,wGAAgG;AAEhG,0EAAyE;AAEzE,gHAA0G;AAI1G,8EAAyE;AAGzE,sEAAiE;AAEjE,MAAa,gBAAgB;IAGzB,YACc,WAAwB,EACxB,WAAwB,EACxB,oBAA0C,EAC1C,aAA4B;QAH5B,gBAAW,GAAX,WAAW,CAAa;QACxB,gBAAW,GAAX,WAAW,CAAa;QACxB,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,kBAAa,GAAb,aAAa,CAAe;QAEtC,IAAI,CAAC,8BAA8B;YAC/B,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,0BAA0B,CAAC,IAAI,CAC5D,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,KAAK,0DAAyB,CAC1D,CAAC;IACV,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,SAAS,CACX,IAAuB,EACvB,GAAmB,EACnB,GAAY,EACZ,GAAa;QAEb,OAAO,MAAM,IAAI,CAAC,4BAA4B,CAC1C,GAAG,EACH;YACI,KAAK,EAAE,EAAE,CAAC,0DAAyB,CAAC,EAAE,IAAI,EAAE;YAC5C,UAAU,EAAE,IAAI,CAAC,UAAU;SAC9B,EACD,GAAG,EACH,GAAG,CACN,CAAC;IACN,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,GAAmB,EAAE,GAAY,EAAE,GAAa;QACzD,MAAM,KAAK,GAAG,IAAA,2CAAmB,EAAC,GAAG,EAAE,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QACnF,IAAI,CAAC,KAAK,EAAE;YACR,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;SAC7B;QACD,MAAM,IAAI,CA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AA0B,EAAC,IAAI,CAAyB;SACrE,CAAC;IACN,CAAC;IAES,yBAAyB;QAI/B,IAAI,CAAC,IAAI,CAAC,8BAA8B,EAAE;YACtC,MAAM,iBAAiB,GAAG,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,0BAA0B;iBAC9E,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;iBAChB,IAAI,CAAC,IAAI,CAAC,CAAC;YAChB,MAAM,YAAY,GACd,yGAAyG;gBACzG,iEAAiE,iBAAiB,EAAE,CAAC;YACzF,uBAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;YAC3B,OAAO,IAAI,wDAA4B,EAAE,CAAC;SAC7C;IACL,CAAC;CACJ;AA9ID,4CA8IC"}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
+
import { RequestContextCacheService } from '../../../cache/index';
|
|
1
2
|
import { Fulfillment } from '../../../entity/fulfillment/fulfillment.entity';
|
|
2
3
|
import { FulfillmentService } from '../../../service/services/fulfillment.service';
|
|
3
4
|
import { RequestContext } from '../../common/request-context';
|
|
4
5
|
export declare class FulfillmentEntityResolver {
|
|
5
6
|
private fulfillmentService;
|
|
6
|
-
|
|
7
|
+
private requestContextCache;
|
|
8
|
+
constructor(fulfillmentService: FulfillmentService, requestContextCache: RequestContextCacheService);
|
|
7
9
|
orderItems(ctx: RequestContext, fulfillment: Fulfillment): Promise<import("../../..").OrderItem[]>;
|
|
10
|
+
summary(ctx: RequestContext, fulfillment: Fulfillment): Promise<{
|
|
11
|
+
orderLine: import("../../..").OrderLine;
|
|
12
|
+
quantity: number;
|
|
13
|
+
}[]>;
|
|
8
14
|
}
|
|
9
15
|
export declare class FulfillmentAdminEntityResolver {
|
|
10
16
|
private fulfillmentService;
|
|
11
17
|
constructor(fulfillmentService: FulfillmentService);
|
|
12
|
-
nextStates(fulfillment: Fulfillment): Promise<readonly import("
|
|
18
|
+
nextStates(fulfillment: Fulfillment): Promise<readonly import("../../../service/index").FulfillmentState[]>;
|
|
13
19
|
}
|
|
@@ -14,16 +14,21 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.FulfillmentAdminEntityResolver = exports.FulfillmentEntityResolver = void 0;
|
|
16
16
|
const graphql_1 = require("@nestjs/graphql");
|
|
17
|
+
const index_1 = require("../../../cache/index");
|
|
17
18
|
const fulfillment_entity_1 = require("../../../entity/fulfillment/fulfillment.entity");
|
|
18
19
|
const fulfillment_service_1 = require("../../../service/services/fulfillment.service");
|
|
19
20
|
const request_context_1 = require("../../common/request-context");
|
|
20
21
|
const request_context_decorator_1 = require("../../decorators/request-context.decorator");
|
|
21
22
|
let FulfillmentEntityResolver = class FulfillmentEntityResolver {
|
|
22
|
-
constructor(fulfillmentService) {
|
|
23
|
+
constructor(fulfillmentService, requestContextCache) {
|
|
23
24
|
this.fulfillmentService = fulfillmentService;
|
|
25
|
+
this.requestContextCache = requestContextCache;
|
|
24
26
|
}
|
|
25
27
|
async orderItems(ctx, fulfillment) {
|
|
26
|
-
return this.fulfillmentService.getOrderItemsByFulfillmentId(ctx, fulfillment.id);
|
|
28
|
+
return this.requestContextCache.get(ctx, `FulfillmentEntityResolver.orderItems(${fulfillment.id})`, () => this.fulfillmentService.getOrderItemsByFulfillmentId(ctx, fulfillment.id));
|
|
29
|
+
}
|
|
30
|
+
async summary(ctx, fulfillment) {
|
|
31
|
+
return this.requestContextCache.get(ctx, `FulfillmentEntityResolver.summary(${fulfillment.id})`, () => this.fulfillmentService.getFulfillmentLineSummary(ctx, fulfillment.id));
|
|
27
32
|
}
|
|
28
33
|
};
|
|
29
34
|
__decorate([
|
|
@@ -34,9 +39,18 @@ __decorate([
|
|
|
34
39
|
__metadata("design:paramtypes", [request_context_1.RequestContext, fulfillment_entity_1.Fulfillment]),
|
|
35
40
|
__metadata("design:returntype", Promise)
|
|
36
41
|
], FulfillmentEntityResolver.prototype, "orderItems", null);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, graphql_1.ResolveField)(),
|
|
44
|
+
__param(0, (0, request_context_decorator_1.Ctx)()),
|
|
45
|
+
__param(1, (0, graphql_1.Parent)()),
|
|
46
|
+
__metadata("design:type", Function),
|
|
47
|
+
__metadata("design:paramtypes", [request_context_1.RequestContext, fulfillment_entity_1.Fulfillment]),
|
|
48
|
+
__metadata("design:returntype", Promise)
|
|
49
|
+
], FulfillmentEntityResolver.prototype, "summary", null);
|
|
37
50
|
FulfillmentEntityResolver = __decorate([
|
|
38
51
|
(0, graphql_1.Resolver)('Fulfillment'),
|
|
39
|
-
__metadata("design:paramtypes", [fulfillment_service_1.FulfillmentService
|
|
52
|
+
__metadata("design:paramtypes", [fulfillment_service_1.FulfillmentService,
|
|
53
|
+
index_1.RequestContextCacheService])
|
|
40
54
|
], FulfillmentEntityResolver);
|
|
41
55
|
exports.FulfillmentEntityResolver = FulfillmentEntityResolver;
|
|
42
56
|
let FulfillmentAdminEntityResolver = class FulfillmentAdminEntityResolver {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fulfillment-entity.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/entity/fulfillment-entity.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAiE;
|
|
1
|
+
{"version":3,"file":"fulfillment-entity.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/entity/fulfillment-entity.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAiE;AAGjE,gDAAkE;AAClE,uFAA6E;AAE7E,uFAAmF;AACnF,kEAA8D;AAC9D,0FAAiE;AAGjE,IAAa,yBAAyB,GAAtC,MAAa,yBAAyB;IAClC,YACY,kBAAsC,EACtC,mBAA+C;QAD/C,uBAAkB,GAAlB,kBAAkB,CAAoB;QACtC,wBAAmB,GAAnB,mBAAmB,CAA4B;IACxD,CAAC;IAGJ,KAAK,CAAC,UAAU,CAAQ,GAAm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AAM,GAAE,CAAA;;qCAAc,gCAAW;;gEAElD;AANQ,8BAA8B;IAD1C,IAAA,kBAAQ,EAAC,aAAa,CAAC;qCAEoB,wCAAkB;GADjD,8BAA8B,CAO1C;AAPY,wEAA8B"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { RequestContextCacheService } from '../../../cache/index';
|
|
1
2
|
import { Fulfillment, OrderItem } from '../../../entity';
|
|
2
3
|
import { FulfillmentService } from '../../../service';
|
|
3
4
|
import { RequestContext } from '../../common/request-context';
|
|
4
5
|
export declare class OrderItemEntityResolver {
|
|
5
6
|
private fulfillmentService;
|
|
6
|
-
|
|
7
|
+
private requestContextCache;
|
|
8
|
+
constructor(fulfillmentService: FulfillmentService, requestContextCache: RequestContextCacheService);
|
|
7
9
|
fulfillment(ctx: RequestContext, orderItem: OrderItem): Promise<Fulfillment | undefined>;
|
|
8
10
|
}
|
|
@@ -14,19 +14,24 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.OrderItemEntityResolver = void 0;
|
|
16
16
|
const graphql_1 = require("@nestjs/graphql");
|
|
17
|
+
const index_1 = require("../../../cache/index");
|
|
17
18
|
const entity_1 = require("../../../entity");
|
|
18
19
|
const service_1 = require("../../../service");
|
|
19
20
|
const request_context_1 = require("../../common/request-context");
|
|
20
21
|
const request_context_decorator_1 = require("../../decorators/request-context.decorator");
|
|
21
22
|
let OrderItemEntityResolver = class OrderItemEntityResolver {
|
|
22
|
-
constructor(fulfillmentService) {
|
|
23
|
+
constructor(fulfillmentService, requestContextCache) {
|
|
23
24
|
this.fulfillmentService = fulfillmentService;
|
|
25
|
+
this.requestContextCache = requestContextCache;
|
|
24
26
|
}
|
|
25
27
|
async fulfillment(ctx, orderItem) {
|
|
28
|
+
var _a;
|
|
26
29
|
if (orderItem.fulfillment) {
|
|
27
30
|
return orderItem.fulfillment;
|
|
28
31
|
}
|
|
29
|
-
|
|
32
|
+
const lineFulfillments = await this.requestContextCache.get(ctx, `OrderItemEntityResolver.fulfillment(${orderItem.lineId})`, () => this.fulfillmentService.getFulfillmentsByOrderLineId(ctx, orderItem.lineId));
|
|
33
|
+
const otherResult = (_a = lineFulfillments.find(({ orderItemIds }) => orderItemIds.has(orderItem.id))) === null || _a === void 0 ? void 0 : _a.fulfillment;
|
|
34
|
+
return otherResult;
|
|
30
35
|
}
|
|
31
36
|
};
|
|
32
37
|
__decorate([
|
|
@@ -40,7 +45,8 @@ __decorate([
|
|
|
40
45
|
], OrderItemEntityResolver.prototype, "fulfillment", null);
|
|
41
46
|
OrderItemEntityResolver = __decorate([
|
|
42
47
|
(0, graphql_1.Resolver)('OrderItem'),
|
|
43
|
-
__metadata("design:paramtypes", [service_1.FulfillmentService
|
|
48
|
+
__metadata("design:paramtypes", [service_1.FulfillmentService,
|
|
49
|
+
index_1.RequestContextCacheService])
|
|
44
50
|
], OrderItemEntityResolver);
|
|
45
51
|
exports.OrderItemEntityResolver = OrderItemEntityResolver;
|
|
46
52
|
//# sourceMappingURL=order-item-entity.resolver.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order-item-entity.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/entity/order-item-entity.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAiE;AAEjE,4CAAyD;AACzD,8CAAsD;AACtD,kEAA8D;AAC9D,0FAAiE;AAGjE,IAAa,uBAAuB,GAApC,MAAa,uBAAuB;IAChC,
|
|
1
|
+
{"version":3,"file":"order-item-entity.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/entity/order-item-entity.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAiE;AAEjE,gDAAkE;AAClE,4CAAyD;AACzD,8CAAsD;AACtD,kEAA8D;AAC9D,0FAAiE;AAGjE,IAAa,uBAAuB,GAApC,MAAa,uBAAuB;IAChC,YACY,kBAAsC,EACtC,mBAA+C;QAD/C,uBAAkB,GAAlB,kBAAkB,CAAoB;QACtC,wBAAmB,GAAnB,mBAAmB,CAA4B;IACxD,CAAC;IAGJ,KAAK,CAAC,WAAW,CACN,GAAmB,EAChB,SAAoB;;QAE9B,IAAI,SAAS,CAAC,WAAW,EAAE;YACvB,OAAO,SAAS,CAAC,WAAW,CAAC;SAChC;QACD,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,GAAG,CACvD,GAAG,EACH,uCAAuC,SAAS,CAAC,MAAM,GAAG,EAC1D,GAAG,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,4BAA4B,CAAC,GAAG,EAAE,SAAS,CAAC,MAAM,CAAC,CACpF,CAAC;QACF,MAAM,WAAW,GAAG,MAAA,gBAAgB,CAAC,IAAI,CAAC,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAC3D,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,CACjC,0CAAE,WAAW,CAAC;QACf,OAAO,WAAW,CAAC;IACvB,CAAC;CACJ,CAAA;AAjBG;IADC,IAAA,sBAAY,GAAE;IAEV,WAAA,IAAA,+BAAG,GAAE,CAAA;IACL,WAAA,IAAA,gBAAM,GAAE,CAAA;;qCADG,gCAAc;QACL,kBAAS;;0DAcjC;AAvBQ,uBAAuB;IADnC,IAAA,kBAAQ,EAAC,WAAW,CAAC;qCAGc,4BAAkB;QACjB,kCAA0B;GAHlD,uBAAuB,CAwBnC;AAxBY,0DAAuB"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { Asset, Order, OrderLine, ProductVariant } from '../../../entity';
|
|
2
|
-
import { AssetService, OrderService, ProductVariantService } from '../../../service';
|
|
1
|
+
import { Asset, Fulfillment, Order, OrderLine, ProductVariant } from '../../../entity';
|
|
2
|
+
import { AssetService, FulfillmentService, OrderService, ProductVariantService } from '../../../service';
|
|
3
3
|
import { RequestContext } from '../../common/request-context';
|
|
4
4
|
import { RelationPaths } from '../../decorators/relations.decorator';
|
|
5
5
|
export declare class OrderLineEntityResolver {
|
|
6
6
|
private productVariantService;
|
|
7
7
|
private assetService;
|
|
8
8
|
private orderService;
|
|
9
|
-
|
|
9
|
+
private fulfillmentService;
|
|
10
|
+
constructor(productVariantService: ProductVariantService, assetService: AssetService, orderService: OrderService, fulfillmentService: FulfillmentService);
|
|
10
11
|
productVariant(ctx: RequestContext, orderLine: OrderLine): Promise<ProductVariant>;
|
|
11
12
|
featuredAsset(ctx: RequestContext, orderLine: OrderLine): Promise<Asset | undefined>;
|
|
12
13
|
order(ctx: RequestContext, orderLine: OrderLine, relations: RelationPaths<Order>): Promise<Order | undefined>;
|
|
14
|
+
fulfillments(ctx: RequestContext, orderLine: OrderLine, relations: RelationPaths<Order>): Promise<Fulfillment[]>;
|
|
13
15
|
}
|
|
@@ -20,10 +20,11 @@ const request_context_1 = require("../../common/request-context");
|
|
|
20
20
|
const relations_decorator_1 = require("../../decorators/relations.decorator");
|
|
21
21
|
const request_context_decorator_1 = require("../../decorators/request-context.decorator");
|
|
22
22
|
let OrderLineEntityResolver = class OrderLineEntityResolver {
|
|
23
|
-
constructor(productVariantService, assetService, orderService) {
|
|
23
|
+
constructor(productVariantService, assetService, orderService, fulfillmentService) {
|
|
24
24
|
this.productVariantService = productVariantService;
|
|
25
25
|
this.assetService = assetService;
|
|
26
26
|
this.orderService = orderService;
|
|
27
|
+
this.fulfillmentService = fulfillmentService;
|
|
27
28
|
}
|
|
28
29
|
async productVariant(ctx, orderLine) {
|
|
29
30
|
if (orderLine.productVariant) {
|
|
@@ -42,6 +43,11 @@ let OrderLineEntityResolver = class OrderLineEntityResolver {
|
|
|
42
43
|
async order(ctx, orderLine, relations) {
|
|
43
44
|
return this.orderService.findOneByOrderLineId(ctx, orderLine.id, relations);
|
|
44
45
|
}
|
|
46
|
+
async fulfillments(ctx, orderLine, relations) {
|
|
47
|
+
return this.fulfillmentService
|
|
48
|
+
.getFulfillmentsByOrderLineId(ctx, orderLine.id)
|
|
49
|
+
.then(results => results.map(r => r.fulfillment));
|
|
50
|
+
}
|
|
45
51
|
};
|
|
46
52
|
__decorate([
|
|
47
53
|
(0, graphql_1.ResolveField)(),
|
|
@@ -71,11 +77,22 @@ __decorate([
|
|
|
71
77
|
entity_1.OrderLine, Array]),
|
|
72
78
|
__metadata("design:returntype", Promise)
|
|
73
79
|
], OrderLineEntityResolver.prototype, "order", null);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, graphql_1.ResolveField)(),
|
|
82
|
+
__param(0, (0, request_context_decorator_1.Ctx)()),
|
|
83
|
+
__param(1, (0, graphql_1.Parent)()),
|
|
84
|
+
__param(2, (0, relations_decorator_1.Relations)(entity_1.Order)),
|
|
85
|
+
__metadata("design:type", Function),
|
|
86
|
+
__metadata("design:paramtypes", [request_context_1.RequestContext,
|
|
87
|
+
entity_1.OrderLine, Array]),
|
|
88
|
+
__metadata("design:returntype", Promise)
|
|
89
|
+
], OrderLineEntityResolver.prototype, "fulfillments", null);
|
|
74
90
|
OrderLineEntityResolver = __decorate([
|
|
75
91
|
(0, graphql_1.Resolver)('OrderLine'),
|
|
76
92
|
__metadata("design:paramtypes", [service_1.ProductVariantService,
|
|
77
93
|
service_1.AssetService,
|
|
78
|
-
service_1.OrderService
|
|
94
|
+
service_1.OrderService,
|
|
95
|
+
service_1.FulfillmentService])
|
|
79
96
|
], OrderLineEntityResolver);
|
|
80
97
|
exports.OrderLineEntityResolver = OrderLineEntityResolver;
|
|
81
98
|
//# sourceMappingURL=order-line-entity.resolver.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order-line-entity.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/entity/order-line-entity.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAiE;AAEjE,
|
|
1
|
+
{"version":3,"file":"order-line-entity.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/entity/order-line-entity.resolver.ts"],"names":[],"mappings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G,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;IAC1D,CAAC;CACJ,CAAA;AAzCG;IADC,IAAA,sBAAY,GAAE;IAEV,WAAA,IAAA,+BAAG,GAAE,CAAA;IACL,WAAA,IAAA,gBAAM,GAAE,CAAA;;qCADG,gCAAc;QACL,kBAAS;;6DAMjC;AAGD;IADC,IAAA,sBAAY,GAAE;IAEV,WAAA,IAAA,+BAAG,GAAE,CAAA;IACL,WAAA,IAAA,gBAAM,GAAE,CAAA;;qCADG,gCAAc;QACL,kBAAS;;4DAOjC;AAGD;IADC,IAAA,sBAAY,GAAE;IAEV,WAAA,IAAA,+BAAG,GAAE,CAAA;IACL,WAAA,IAAA,gBAAM,GAAE,CAAA;IACR,WAAA,IAAA,+BAAS,EAAC,cAAK,CAAC,CAAA;;qCAFL,gCAAc;QACL,kBAAS;;oDAIjC;AAGD;IADC,IAAA,sBAAY,GAAE;IAEV,WAAA,IAAA,+BAAG,GAAE,CAAA;IACL,WAAA,IAAA,gBAAM,GAAE,CAAA;IACR,WAAA,IAAA,+BAAS,EAAC,cAAK,CAAC,CAAA;;qCAFL,gCAAc;QACL,kBAAS;;2DAMjC;AAjDQ,uBAAuB;IADnC,IAAA,kBAAQ,EAAC,WAAW,CAAC;qCAGiB,+BAAqB;QAC9B,sBAAY;QACZ,sBAAY;QACN,4BAAkB;GALzC,uBAAuB,CAkDnC;AAlDY,0DAAuB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RequestContextCacheService } from '../../../cache/index';
|
|
1
2
|
import { PaymentMetadata } from '../../../common/types/common-types';
|
|
2
3
|
import { Payment } from '../../../entity/payment/payment.entity';
|
|
3
4
|
import { Refund } from '../../../entity/refund/refund.entity';
|
|
@@ -7,7 +8,8 @@ import { ApiType } from '../../common/get-api-type';
|
|
|
7
8
|
import { RequestContext } from '../../common/request-context';
|
|
8
9
|
export declare class PaymentEntityResolver {
|
|
9
10
|
private orderService;
|
|
10
|
-
|
|
11
|
+
private requestContextCache;
|
|
12
|
+
constructor(orderService: OrderService, requestContextCache: RequestContextCacheService);
|
|
11
13
|
refunds(ctx: RequestContext, payment: Payment): Promise<Refund[]>;
|
|
12
14
|
metadata(apiType: ApiType, payment: Payment): PaymentMetadata;
|
|
13
15
|
}
|
|
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.PaymentAdminEntityResolver = exports.PaymentEntityResolver = void 0;
|
|
16
16
|
const graphql_1 = require("@nestjs/graphql");
|
|
17
17
|
const pick_1 = require("@vendure/common/lib/pick");
|
|
18
|
+
const index_1 = require("../../../cache/index");
|
|
18
19
|
const payment_entity_1 = require("../../../entity/payment/payment.entity");
|
|
19
20
|
const service_1 = require("../../../service");
|
|
20
21
|
const order_service_1 = require("../../../service/services/order.service");
|
|
@@ -22,15 +23,16 @@ const request_context_1 = require("../../common/request-context");
|
|
|
22
23
|
const api_decorator_1 = require("../../decorators/api.decorator");
|
|
23
24
|
const request_context_decorator_1 = require("../../decorators/request-context.decorator");
|
|
24
25
|
let PaymentEntityResolver = class PaymentEntityResolver {
|
|
25
|
-
constructor(orderService) {
|
|
26
|
+
constructor(orderService, requestContextCache) {
|
|
26
27
|
this.orderService = orderService;
|
|
28
|
+
this.requestContextCache = requestContextCache;
|
|
27
29
|
}
|
|
28
30
|
async refunds(ctx, payment) {
|
|
29
31
|
if (payment.refunds) {
|
|
30
32
|
return payment.refunds;
|
|
31
33
|
}
|
|
32
34
|
else {
|
|
33
|
-
return this.orderService.getPaymentRefunds(ctx, payment.id);
|
|
35
|
+
return this.requestContextCache.get(ctx, `PaymentEntityResolver.refunds(${payment.id})`, () => this.orderService.getPaymentRefunds(ctx, payment.id));
|
|
34
36
|
}
|
|
35
37
|
}
|
|
36
38
|
metadata(apiType, payment) {
|
|
@@ -55,7 +57,8 @@ __decorate([
|
|
|
55
57
|
], PaymentEntityResolver.prototype, "metadata", null);
|
|
56
58
|
PaymentEntityResolver = __decorate([
|
|
57
59
|
(0, graphql_1.Resolver)('Payment'),
|
|
58
|
-
__metadata("design:paramtypes", [order_service_1.OrderService
|
|
60
|
+
__metadata("design:paramtypes", [order_service_1.OrderService,
|
|
61
|
+
index_1.RequestContextCacheService])
|
|
59
62
|
], PaymentEntityResolver);
|
|
60
63
|
exports.PaymentEntityResolver = PaymentEntityResolver;
|
|
61
64
|
let PaymentAdminEntityResolver = class PaymentAdminEntityResolver {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment-entity.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/entity/payment-entity.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAiE;AACjE,mDAAgD;
|
|
1
|
+
{"version":3,"file":"payment-entity.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/entity/payment-entity.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAiE;AACjE,mDAAgD;AAEhD,gDAAkE;AAElE,2EAAiE;AAEjE,8CAAkD;AAClD,2EAAuE;AAEvE,kEAA8D;AAC9D,kEAAqD;AACrD,0FAAiE;AAGjE,IAAa,qBAAqB,GAAlC,MAAa,qBAAqB;IAC9B,YACY,YAA0B,EAC1B,mBAA+C;QAD/C,iBAAY,GAAZ,YAAY,CAAc;QAC1B,wBAAmB,GAAnB,mBAAmB,CAA4B;IACxD,CAAC;IAGJ,KAAK,CAAC,OAAO,CAAQ,GAAmB,EAAY,OAAgB;QAChE,IAAI,OAAO,CAAC,OAAO,EAAE;YACjB,OAAO,OAAO,CAAC,OAAO,CAAC;SAC1B;aAAM;YACH,OAAO,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,GAAG,EAAE,iCAAiC,OAAO,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAC1F,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,CAAC,CACvD,CAAC;SACL;IAC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