@vendure/core 1.6.5 → 1.7.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/custom-field-relation-resolver.service.d.ts +3 -1
- package/dist/api/common/custom-field-relation-resolver.service.js +7 -5
- package/dist/api/common/custom-field-relation-resolver.service.js.map +1 -1
- package/dist/api/config/generate-resolvers.d.ts +3 -0
- package/dist/api/config/generate-resolvers.js +7 -1
- package/dist/api/config/generate-resolvers.js.map +1 -1
- package/dist/api/resolvers/admin/collection.resolver.js +8 -2
- package/dist/api/resolvers/admin/collection.resolver.js.map +1 -1
- package/dist/api/resolvers/admin/order.resolver.d.ts +3 -2
- package/dist/api/resolvers/admin/order.resolver.js +15 -3
- package/dist/api/resolvers/admin/order.resolver.js.map +1 -1
- package/dist/api/resolvers/admin/product-option.resolver.d.ts +2 -1
- package/dist/api/resolvers/admin/product-option.resolver.js +13 -0
- package/dist/api/resolvers/admin/product-option.resolver.js.map +1 -1
- package/dist/api/resolvers/entity/fulfillment-entity.resolver.d.ts +8 -2
- package/dist/api/resolvers/entity/fulfillment-entity.resolver.js +17 -3
- package/dist/api/resolvers/entity/fulfillment-entity.resolver.js.map +1 -1
- package/dist/api/resolvers/entity/order-item-entity.resolver.d.ts +3 -1
- package/dist/api/resolvers/entity/order-item-entity.resolver.js +9 -3
- package/dist/api/resolvers/entity/order-item-entity.resolver.js.map +1 -1
- package/dist/api/resolvers/entity/order-line-entity.resolver.d.ts +5 -3
- package/dist/api/resolvers/entity/order-line-entity.resolver.js +19 -2
- package/dist/api/resolvers/entity/order-line-entity.resolver.js.map +1 -1
- package/dist/api/resolvers/entity/payment-entity.resolver.d.ts +3 -1
- package/dist/api/resolvers/entity/payment-entity.resolver.js +6 -3
- package/dist/api/resolvers/entity/payment-entity.resolver.js.map +1 -1
- package/dist/api/resolvers/entity/product-option-group-entity.resolver.js +8 -3
- package/dist/api/resolvers/entity/product-option-group-entity.resolver.js.map +1 -1
- package/dist/api/resolvers/shop/shop-products.resolver.js +8 -2
- package/dist/api/resolvers/shop/shop-products.resolver.js.map +1 -1
- package/dist/api/schema/admin-api/order.api.graphql +11 -0
- package/dist/api/schema/admin-api/product-option-group.api.graphql +2 -0
- package/dist/api/schema/common/order.type.graphql +7 -0
- package/dist/bootstrap.js +2 -3
- package/dist/bootstrap.js.map +1 -1
- package/dist/common/configurable-operation.js +9 -4
- package/dist/common/configurable-operation.js.map +1 -1
- package/dist/common/error/errors.d.ts +1 -0
- package/dist/common/error/errors.js.map +1 -1
- package/dist/common/error/generated-graphql-admin-errors.d.ts +10 -0
- package/dist/common/error/generated-graphql-admin-errors.js +17 -2
- package/dist/common/error/generated-graphql-admin-errors.js.map +1 -1
- package/dist/config/asset-import-strategy/asset-import-strategy.d.ts +24 -0
- package/dist/config/asset-import-strategy/asset-import-strategy.js +3 -0
- package/dist/config/asset-import-strategy/asset-import-strategy.js.map +1 -0
- package/dist/config/asset-import-strategy/default-asset-import-strategy.d.ts +24 -0
- package/dist/config/asset-import-strategy/default-asset-import-strategy.js +91 -0
- package/dist/config/asset-import-strategy/default-asset-import-strategy.js.map +1 -0
- package/dist/config/asset-naming-strategy/default-asset-naming-strategy.js +1 -1
- package/dist/config/asset-naming-strategy/default-asset-naming-strategy.js.map +1 -1
- package/dist/config/config.module.js +2 -0
- package/dist/config/config.module.js.map +1 -1
- package/dist/config/default-config.js +3 -1
- package/dist/config/default-config.js.map +1 -1
- package/dist/config/entity-id-strategy/entity-id-strategy.d.ts +7 -0
- package/dist/config/fulfillment/custom-fulfillment-process.d.ts +2 -2
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.js +1 -0
- package/dist/config/index.js.map +1 -1
- package/dist/config/logger/vendure-logger.d.ts +1 -0
- package/dist/config/logger/vendure-logger.js.map +1 -1
- package/dist/config/order/custom-order-process.d.ts +2 -2
- package/dist/config/payment/custom-payment-process.d.ts +2 -2
- package/dist/config/payment/dummy-payment-method-handler.js +8 -0
- package/dist/config/payment/dummy-payment-method-handler.js.map +1 -1
- package/dist/config/payment/payment-method-handler.d.ts +66 -0
- package/dist/config/payment/payment-method-handler.js +11 -1
- package/dist/config/payment/payment-method-handler.js.map +1 -1
- package/dist/config/promotion/actions/order-fixed-discount-action.js +1 -1
- package/dist/config/promotion/actions/order-fixed-discount-action.js.map +1 -1
- package/dist/config/vendure-config.d.ts +18 -0
- package/dist/connection/connection.module.d.ts +1 -1
- package/dist/connection/transaction-subscriber.d.ts +16 -2
- package/dist/connection/transaction-subscriber.js +27 -7
- package/dist/connection/transaction-subscriber.js.map +1 -1
- package/dist/connection/transaction-wrapper.js +6 -9
- package/dist/connection/transaction-wrapper.js.map +1 -1
- package/dist/connection/transactional-connection.d.ts +2 -0
- package/dist/connection/transactional-connection.js +2 -2
- package/dist/connection/transactional-connection.js.map +1 -1
- package/dist/data-import/providers/asset-importer/asset-importer.js +12 -18
- package/dist/data-import/providers/asset-importer/asset-importer.js.map +1 -1
- package/dist/entity/order-line/order-line.entity.js +4 -0
- package/dist/entity/order-line/order-line.entity.js.map +1 -1
- package/dist/entity/product-option/product-option-translation.entity.js.map +1 -1
- package/dist/entity/product-option-group/product-option-group-translation.entity.js.map +1 -1
- package/dist/event-bus/event-bus.js +14 -3
- package/dist/event-bus/event-bus.js.map +1 -1
- package/dist/event-bus/events/initializer-event.d.ts +12 -0
- package/dist/event-bus/events/initializer-event.js +19 -0
- package/dist/event-bus/events/initializer-event.js.map +1 -0
- package/dist/event-bus/events/product-option-event.d.ts +1 -1
- package/dist/event-bus/events/product-option-event.js.map +1 -1
- package/dist/event-bus/events/product-option-group-event.d.ts +1 -1
- package/dist/event-bus/events/product-option-group-event.js.map +1 -1
- package/dist/event-bus/index.d.ts +1 -0
- package/dist/event-bus/index.js +1 -0
- package/dist/event-bus/index.js.map +1 -1
- package/dist/i18n/messages/en.json +3 -0
- package/dist/migrate.js +14 -0
- package/dist/migrate.js.map +1 -1
- package/dist/plugin/default-search-plugin/search-strategy/mysql-search-strategy.js +31 -31
- 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 +5 -5
- 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 +33 -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 +31 -28
- package/dist/plugin/default-search-plugin/search-strategy/sqlite-search-strategy.js.map +1 -1
- package/dist/plugin/plugin-metadata.js +2 -1
- package/dist/plugin/plugin-metadata.js.map +1 -1
- package/dist/plugin/vendure-plugin.d.ts +11 -2
- package/dist/plugin/vendure-plugin.js.map +1 -1
- package/dist/service/helpers/config-arg/config-arg.service.d.ts +1 -0
- package/dist/service/helpers/config-arg/config-arg.service.js +12 -1
- package/dist/service/helpers/config-arg/config-arg.service.js.map +1 -1
- package/dist/service/helpers/entity-hydrator/entity-hydrator.service.d.ts +3 -1
- package/dist/service/helpers/entity-hydrator/entity-hydrator.service.js +6 -4
- package/dist/service/helpers/entity-hydrator/entity-hydrator.service.js.map +1 -1
- package/dist/service/helpers/fulfillment-state-machine/fulfillment-state.d.ts +9 -1
- package/dist/service/helpers/fulfillment-state-machine/fulfillment-state.js.map +1 -1
- package/dist/service/helpers/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/order-state-machine/order-state.d.ts +9 -1
- package/dist/service/helpers/order-state-machine/order-state.js.map +1 -1
- package/dist/service/helpers/payment-state-machine/payment-state.d.ts +9 -1
- package/dist/service/helpers/payment-state-machine/payment-state.js.map +1 -1
- package/dist/service/helpers/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/initializer.service.d.ts +3 -1
- package/dist/service/initializer.service.js +7 -2
- package/dist/service/initializer.service.js.map +1 -1
- package/dist/service/service.module.js +2 -0
- package/dist/service/service.module.js.map +1 -1
- package/dist/service/services/asset.service.d.ts +2 -1
- package/dist/service/services/asset.service.js +19 -4
- package/dist/service/services/asset.service.js.map +1 -1
- package/dist/service/services/collection.service.d.ts +3 -1
- package/dist/service/services/collection.service.js +16 -16
- package/dist/service/services/collection.service.js.map +1 -1
- package/dist/service/services/country.service.d.ts +3 -1
- package/dist/service/services/country.service.js +9 -7
- package/dist/service/services/country.service.js.map +1 -1
- package/dist/service/services/customer.service.d.ts +3 -1
- package/dist/service/services/customer.service.js +8 -6
- package/dist/service/services/customer.service.js.map +1 -1
- package/dist/service/services/facet-value.service.d.ts +3 -1
- package/dist/service/services/facet-value.service.js +11 -6
- package/dist/service/services/facet-value.service.js.map +1 -1
- package/dist/service/services/facet.service.d.ts +3 -1
- package/dist/service/services/facet.service.js +18 -8
- package/dist/service/services/facet.service.js.map +1 -1
- package/dist/service/services/fulfillment.service.d.ts +9 -0
- package/dist/service/services/fulfillment.service.js +48 -8
- package/dist/service/services/fulfillment.service.js.map +1 -1
- package/dist/service/services/order-testing.service.d.ts +3 -1
- package/dist/service/services/order-testing.service.js +6 -4
- package/dist/service/services/order-testing.service.js.map +1 -1
- package/dist/service/services/order.service.d.ts +10 -2
- package/dist/service/services/order.service.js +49 -26
- 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 +42 -12
- 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/zone.service.d.ts +3 -1
- package/dist/service/services/zone.service.js +8 -6
- package/dist/service/services/zone.service.js.map +1 -1
- package/package.json +4 -4
|
@@ -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
|
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;I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FAAkC"}
|
|
@@ -36,6 +36,9 @@ export declare function generateResolvers(configService: ConfigService, customFi
|
|
|
36
36
|
SettlePaymentResult: {
|
|
37
37
|
__resolveType(value: any): any;
|
|
38
38
|
};
|
|
39
|
+
CancelPaymentResult: {
|
|
40
|
+
__resolveType(value: any): any;
|
|
41
|
+
};
|
|
39
42
|
AddFulfillmentToOrderResult: {
|
|
40
43
|
__resolveType(value: any): any;
|
|
41
44
|
};
|
|
@@ -7,6 +7,7 @@ const graphql_upload_1 = require("graphql-upload");
|
|
|
7
7
|
const constants_1 = require("../../common/constants");
|
|
8
8
|
const generated_graphql_admin_errors_1 = require("../../common/error/generated-graphql-admin-errors");
|
|
9
9
|
const generated_graphql_shop_errors_1 = require("../../common/error/generated-graphql-shop-errors");
|
|
10
|
+
const plugin_metadata_1 = require("../../plugin/plugin-metadata");
|
|
10
11
|
/**
|
|
11
12
|
* @description
|
|
12
13
|
* Generates additional resolvers required for things like resolution of union types,
|
|
@@ -83,7 +84,7 @@ function generateResolvers(configService, customFieldRelationResolverService, ap
|
|
|
83
84
|
const adminResolvers = Object.assign(Object.assign({ StockMovementItem: stockMovementResolveType, StockMovement: stockMovementResolveType }, generated_graphql_admin_errors_1.adminErrorOperationTypeResolvers), customFieldRelationResolvers.adminResolvers);
|
|
84
85
|
const shopResolvers = Object.assign(Object.assign({}, generated_graphql_shop_errors_1.shopErrorOperationTypeResolvers), customFieldRelationResolvers.shopResolvers);
|
|
85
86
|
const resolvers = apiType === 'admin'
|
|
86
|
-
? Object.assign(Object.assign({}, commonResolvers), adminResolvers) : Object.assign(Object.assign({}, commonResolvers), shopResolvers);
|
|
87
|
+
? Object.assign(Object.assign(Object.assign({}, commonResolvers), adminResolvers), getCustomScalars(configService, 'admin')) : Object.assign(Object.assign(Object.assign({}, commonResolvers), shopResolvers), getCustomScalars(configService, 'shop'));
|
|
87
88
|
return resolvers;
|
|
88
89
|
}
|
|
89
90
|
exports.generateResolvers = generateResolvers;
|
|
@@ -150,6 +151,11 @@ function generateCustomFieldRelationResolvers(configService, customFieldRelation
|
|
|
150
151
|
}
|
|
151
152
|
return { adminResolvers, shopResolvers };
|
|
152
153
|
}
|
|
154
|
+
function getCustomScalars(configService, apiType) {
|
|
155
|
+
return plugin_metadata_1.getPluginAPIExtensions(configService.plugins, apiType)
|
|
156
|
+
.map(e => { var _a; return (typeof e.scalars === 'function' ? e.scalars() : (_a = e.scalars) !== null && _a !== void 0 ? _a : {}); })
|
|
157
|
+
.reduce((all, scalarMap) => (Object.assign(Object.assign({}, all), scalarMap)), {});
|
|
158
|
+
}
|
|
153
159
|
function isRelationalType(input) {
|
|
154
160
|
return input.type === 'relation';
|
|
155
161
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-resolvers.js","sourceRoot":"","sources":["../../../src/api/config/generate-resolvers.ts"],"names":[],"mappings":";;;AAAA,yEAAwE;AAGxE,qDAA+D;AAC/D,mDAA+C;AAE/C,sDAA6D;AAC7D,sGAG2D;AAC3D,oGAAmG;
|
|
1
|
+
{"version":3,"file":"generate-resolvers.js","sourceRoot":"","sources":["../../../src/api/config/generate-resolvers.ts"],"names":[],"mappings":";;;AAAA,yEAAwE;AAGxE,qDAA+D;AAC/D,mDAA+C;AAE/C,sDAA6D;AAC7D,sGAG2D;AAC3D,oGAAmG;AAInG,kEAAsE;AAKtE;;;;GAIG;AACH,SAAgB,iBAAiB,CAC7B,aAA4B,EAC5B,kCAAsE,EACtE,OAAgB,EAChB,MAAqB;IAErB,uEAAuE;IACvE,iEAAiE;IACjE,MAAM,gBAAgB,GAAG;QACrB,aAAa;YACT,OAAO,IAAI,CAAC;QAChB,CAAC;KACJ,CAAC;IAEF,MAAM,wBAAwB,GAAG;QAC7B,aAAa,CAAC,KAAU;YACpB,QAAQ,KAAK,CAAC,IAAI,EAAE;gBAChB,KAAK,mCAAiB,CAAC,UAAU;oBAC7B,OAAO,iBAAiB,CAAC;gBAC7B,KAAK,mCAAiB,CAAC,UAAU;oB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AAc,CAAC,mBAAmB,CAAC,KACtC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,gBAAgB,GAC7B,CAAC;YAET,IAAI,QAAQ,CAAC,MAAM,KAAK,KAAK,IAAI,CAAC,kBAAkB,EAAE;gBAClD,aAAa,CAAC,mBAAmB,CAAC,GAAG,gCAC9B,aAAa,CAAC,mBAAmB,CAAC,KACrC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,gBAAgB,GAC7B,CAAC;aACZ;SACJ;KACJ;IACD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,CAAC;AAC7C,CAAC;AAED,SAAS,gBAAgB,CAAC,aAA4B,EAAE,OAAyB;IAC7E,OAAO,wCAAsB,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC;SACxD,GAAG,CAAC,CAAC,CAAC,EAAE,WAAC,OAAA,CAAC,OAAO,CAAC,CAAC,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,MAAA,CAAC,CAAC,OAAO,mCAAI,EAAE,CAAC,CAAA,EAAA,CAAC;SAC3E,MAAM,CACH,CAAC,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,iCACb,GAAG,GACH,SAAS,EACd,EACF,EAAE,CACL,CAAC;AACV,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAwB;IAC9C,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC;AACrC,CAAC;AAED,SAAS,cAAc,CAAC,KAAc;IAClC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;AAC9F,CAAC"}
|
|
@@ -102,7 +102,10 @@ __decorate([
|
|
|
102
102
|
allow_decorator_1.Allow(generated_types_1.Permission.ReadCatalog, generated_types_1.Permission.ReadCollection),
|
|
103
103
|
__param(0, request_context_decorator_1.Ctx()),
|
|
104
104
|
__param(1, graphql_1.Args()),
|
|
105
|
-
__param(2, relations_decorator_1.Relations({
|
|
105
|
+
__param(2, 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
|
allow_decorator_1.Allow(generated_types_1.Permission.ReadCatalog, generated_types_1.Permission.ReadCollection),
|
|
113
116
|
__param(0, request_context_decorator_1.Ctx()),
|
|
114
117
|
__param(1, graphql_1.Args()),
|
|
115
|
-
__param(2, relations_decorator_1.Relations({
|
|
118
|
+
__param(2, 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,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YACt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qCADK,gCAAc;;wDAK7B;AAKD;IAHC,mCAAW,EAAE;IACb,kBAAQ,EAAE;IACV,uBAAK,CAAC,4BAAU,CAAC,aAAa,EAAE,4BAAU,CAAC,gBAAgB,CAAC;IAExD,WAAA,+BAAG,EAAE,CAAA;IACL,WAAA,cAAI,EAAE,CAAA;;qCADK,gCAAc;;0DAI7B;AA7GQ,kBAAkB;IAD9B,kBAAQ,EAAE;qCAGwB,sCAAiB;QACjB,uCAAiB;QACR,yDAA0B;GAJzD,kBAAkB,CA2H9B;AA3HY,gDAAkB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
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
|
-
import { TransactionalConnection } from '../../../connection';
|
|
4
3
|
import { ErrorResultUnion } from '../../../common/error/error-result';
|
|
4
|
+
import { TransactionalConnection } from '../../../connection';
|
|
5
5
|
import { Fulfillment } from '../../../entity/fulfillment/fulfillment.entity';
|
|
6
6
|
import { Order } from '../../../entity/order/order.entity';
|
|
7
7
|
import { Payment } from '../../../entity/payment/payment.entity';
|
|
@@ -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>>;
|
|
@@ -15,8 +15,8 @@ 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
18
|
const error_result_1 = require("../../../common/error/error-result");
|
|
19
|
+
const connection_1 = require("../../../connection");
|
|
20
20
|
const order_entity_1 = require("../../../entity/order/order.entity");
|
|
21
21
|
const order_service_1 = require("../../../service/services/order.service");
|
|
22
22
|
const request_context_1 = require("../../common/request-context");
|
|
@@ -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
|
+
transaction_decorator_1.Transaction(),
|
|
124
|
+
graphql_1.Mutation(),
|
|
125
|
+
allow_decorator_1.Allow(generated_types_1.Permission.UpdateOrder),
|
|
126
|
+
__param(0, request_context_decorator_1.Ctx()),
|
|
127
|
+
__param(1, 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
|
transaction_decorator_1.Transaction(),
|
|
121
134
|
graphql_1.Mutation(),
|
|
@@ -248,8 +261,7 @@ __decorate([
|
|
|
248
261
|
], OrderResolver.prototype, "addManualPaymentToOrder", null);
|
|
249
262
|
OrderResolver = __decorate([
|
|
250
263
|
graphql_1.Resolver(),
|
|
251
|
-
__metadata("design:paramtypes", [order_service_1.OrderService,
|
|
252
|
-
connection_1.TransactionalConnection])
|
|
264
|
+
__metadata("design:paramtypes", [order_service_1.OrderService, connection_1.TransactionalConnection])
|
|
253
265
|
], OrderResolver);
|
|
254
266
|
exports.OrderResolver = OrderResolver;
|
|
255
267
|
//# 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,
|
|
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;QAAvE,iBAAY,GAAZ,YAAY,CAAc;QAAU,eAAU,GAAV,UAAU,CAAyB;IAAG,CAAC;IAI/F,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,aAAa,CACR,GAAmB,EAClB,IAA+B;QA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B;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;;iEAI7B;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;;6DAI7B;AAKD;IAHC,mCAAW,CAAC,QAAQ,CAAC;IACrB,kBAAQ,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;AAlKQ,aAAa;IADzB,kBAAQ,EAAE;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
|
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
|
+
transaction_decorator_1.Transaction(),
|
|
126
|
+
graphql_1.Mutation(),
|
|
127
|
+
allow_decorator_1.Allow(generated_types_1.Permission.DeleteCatalog, generated_types_1.Permission.DeleteProduct),
|
|
128
|
+
__param(0, request_context_decorator_1.Ctx()),
|
|
129
|
+
__param(1, 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
|
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,E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,aAAa,EAAE,4BAAU,CAAC,aAAa,CAAC;IAErD,WAAA,+BAAG,EAAE,CAAA;IACL,WAAA,cAAI,EAAE,CAAA;;qCADK,gCAAc;;gEAI7B;AAtFQ,qBAAqB;IADjC,kBAAQ,EAAE;qCAGgC,wDAAyB;QAC9B,6CAAoB;GAH7C,qBAAqB,CAuFjC;AAvFY,sDAAqB"}
|
|
@@ -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
|
+
graphql_1.ResolveField(),
|
|
44
|
+
__param(0, request_context_decorator_1.Ctx()),
|
|
45
|
+
__param(1, 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
|
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,GAAmB,EAAY,WAAwB;QAC3E,OAAO,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAC/B,GAAG,EACH,wCAAwC,WAAW,CAAC,EAAE,GAAG,EACzD,GAAG,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,4BAA4B,CAAC,GAAG,EAAE,WAAW,CAAC,EAAE,CAAC,CAClF,CAAC;IACN,CAAC;IAGD,KAAK,CAAC,OAAO,CAAQ,GAAmB,EAAY,WAAwB;QACxE,OAAO,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,GAAG,EAAE,qCAAqC,WAAW,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAClG,IAAI,CAAC,kBAAkB,CAAC,yBAAyB,CAAC,GAAG,EAAE,WAAW,CAAC,EAAE,CAAC,CACzE,CAAC;IACN,CAAC;CACJ,CAAA;AAdG;IADC,sBAAY,EAAE;IACG,WAAA,+BAAG,EAAE,CAAA;IAAuB,WAAA,gBAAM,EAAE,CAAA;;qCAAzB,gCAAc,EAAyB,gCAAW;;2DAM9E;AAGD;IADC,sBAAY,EAAE;IACA,WAAA,+BAAG,EAAE,CAAA;IAAuB,WAAA,gBAAM,EAAE,CAAA;;qCAAzB,gCAAc,EAAyB,gCAAW;;wDAI3E;AApBQ,yBAAyB;IADrC,kBAAQ,CAAC,aAAa,CAAC;qCAGY,wCAAkB;QACjB,kCAA0B;GAHlD,yBAAyB,CAqBrC;AArBY,8DAAyB;AAwBtC,IAAa,8BAA8B,GAA3C,MAAa,8BAA8B;IACvC,YAAoB,kBAAsC;QAAtC,uBAAkB,GAAlB,kBAAkB,CAAoB;IAAG,CAAC;IAG9D,KAAK,CAAC,UAAU,CAAW,WAAwB;QAC/C,OAAO,IAAI,CAAC,kBAAkB,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IAC9D,CAAC;CACJ,CAAA;AAHG;IADC,sBAAY,EAAE;IACG,WAAA,gBAAM,EAAE,CAAA;;qCAAc,gCAAW;;gEAElD;AANQ,8BAA8B;IAD1C,kBAAQ,CAAC,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
|
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,sBAAY,EAAE;IAEV,WAAA,+BAAG,EAAE,CAAA;IACL,WAAA,gBAAM,EAAE,CAAA;;qCADG,gCAAc;QACL,kBAAS;;0DAcjC;AAvBQ,uBAAuB;IADnC,kBAAQ,CAAC,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
|
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
|
+
graphql_1.ResolveField(),
|
|
82
|
+
__param(0, request_context_decorator_1.Ctx()),
|
|
83
|
+
__param(1, graphql_1.Parent()),
|
|
84
|
+
__param(2, 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
|
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":";;;;;;;;;;;;;;;AAAA,6CAAiE;AAEjE,4CAAuF;AACvF,8CAAyG;AACzG,kEAA8D;AAC9D,8EAAgF;AAChF,0FAAiE;AAGjE,IAAa,uBAAuB,GAApC,MAAa,uBAAuB;IAChC,YACY,qBAA4C,EAC5C,YAA0B,EAC1B,YAA0B,EAC1B,kBAAsC;QAHtC,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,iBAAY,GAAZ,YAAY,CAAc;QAC1B,iBAAY,GAAZ,YAAY,CAAc;QAC1B,uBAAkB,GAAlB,kBAAkB,CAAoB;IAC/C,CAAC;IAGJ,KAAK,C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E,CAAA;IACL,WAAA,gBAAM,EAAE,CAAA;IACR,WAAA,+BAAS,CAAC,cAAK,CAAC,CAAA;;qCAFL,gCAAc;QACL,kBAAS;;oDAIjC;AAGD;IADC,sBAAY,EAAE;IAEV,WAAA,+BAAG,EAAE,CAAA;IACL,WAAA,gBAAM,EAAE,CAAA;IACR,WAAA,+BAAS,CAAC,cAAK,CAAC,CAAA;;qCAFL,gCAAc;QACL,kBAAS;;2DAMjC;AAjDQ,uBAAuB;IADnC,kBAAQ,CAAC,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
|
}
|