@vendure/core 2.0.0-next.21 → 2.0.0-next.22
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/api-internal-modules.d.ts +2 -1
- package/dist/api/api-internal-modules.js +2 -0
- package/dist/api/api-internal-modules.js.map +1 -1
- package/dist/api/config/configure-graphql-module.js +2 -0
- package/dist/api/config/configure-graphql-module.js.map +1 -1
- package/dist/api/config/generate-active-order-types.d.ts +14 -0
- package/dist/api/config/generate-active-order-types.js +91 -0
- package/dist/api/config/generate-active-order-types.js.map +1 -0
- package/dist/api/resolvers/entity/zone-entity.resolver.d.ts +8 -0
- package/dist/api/resolvers/entity/zone-entity.resolver.js +47 -0
- package/dist/api/resolvers/entity/zone-entity.resolver.js.map +1 -0
- package/dist/api/resolvers/shop/shop-order.resolver.d.ts +22 -18
- package/dist/api/resolvers/shop/shop-order.resolver.js +32 -27
- package/dist/api/resolvers/shop/shop-order.resolver.js.map +1 -1
- package/dist/config/config.module.js +2 -1
- package/dist/config/config.module.js.map +1 -1
- package/dist/config/default-config.js +3 -0
- package/dist/config/default-config.js.map +1 -1
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.js +2 -0
- package/dist/config/index.js.map +1 -1
- package/dist/config/order/active-order-strategy.d.ts +78 -0
- package/dist/config/order/active-order-strategy.js +5 -0
- package/dist/config/order/active-order-strategy.js.map +1 -0
- package/dist/config/order/default-active-order-strategy.d.ts +21 -0
- package/dist/config/order/default-active-order-strategy.js +74 -0
- package/dist/config/order/default-active-order-strategy.js.map +1 -0
- package/dist/config/vendure-config.d.ts +24 -0
- package/dist/connection/transactional-connection.d.ts +5 -5
- package/dist/i18n/messages/de.json +3 -3
- package/dist/i18n/messages/en.json +2 -1
- package/dist/service/helpers/active-order/active-order.service.d.ts +18 -2
- package/dist/service/helpers/active-order/active-order.service.js +42 -5
- package/dist/service/helpers/active-order/active-order.service.js.map +1 -1
- package/dist/service/helpers/external-authentication/external-authentication.service.d.ts +5 -1
- package/dist/service/helpers/external-authentication/external-authentication.service.js +6 -2
- package/dist/service/helpers/external-authentication/external-authentication.service.js.map +1 -1
- package/dist/service/helpers/order-modifier/order-modifier.d.ts +7 -1
- package/dist/service/helpers/order-modifier/order-modifier.js +18 -26
- package/dist/service/helpers/order-modifier/order-modifier.js.map +1 -1
- package/dist/service/initializer.service.d.ts +3 -1
- package/dist/service/initializer.service.js +5 -1
- package/dist/service/initializer.service.js.map +1 -1
- package/dist/service/services/channel.service.js +2 -1
- package/dist/service/services/channel.service.js.map +1 -1
- package/dist/service/services/collection.service.js +4 -2
- package/dist/service/services/collection.service.js.map +1 -1
- package/dist/service/services/country.service.js +2 -1
- package/dist/service/services/country.service.js.map +1 -1
- package/dist/service/services/customer-group.service.js +2 -1
- package/dist/service/services/customer-group.service.js.map +1 -1
- package/dist/service/services/customer.service.js +2 -1
- package/dist/service/services/customer.service.js.map +1 -1
- package/dist/service/services/facet-value.service.js +12 -4
- package/dist/service/services/facet-value.service.js.map +1 -1
- package/dist/service/services/facet.service.js +3 -1
- package/dist/service/services/facet.service.js.map +1 -1
- package/dist/service/services/history.service.js +4 -2
- package/dist/service/services/history.service.js.map +1 -1
- package/dist/service/services/payment-method.service.js +2 -1
- package/dist/service/services/payment-method.service.js.map +1 -1
- package/dist/service/services/payment.service.js +19 -7
- package/dist/service/services/payment.service.js.map +1 -1
- package/dist/service/services/product-option-group.service.js +2 -1
- package/dist/service/services/product-option-group.service.js.map +1 -1
- package/dist/service/services/product-option.service.js +2 -1
- package/dist/service/services/product-option.service.js.map +1 -1
- package/dist/service/services/role.service.js +2 -1
- package/dist/service/services/role.service.js.map +1 -1
- package/dist/service/services/tax-category.service.js +2 -1
- package/dist/service/services/tax-category.service.js.map +1 -1
- package/dist/service/services/tax-rate.service.d.ts +13 -3
- package/dist/service/services/tax-rate.service.js +30 -8
- package/dist/service/services/tax-rate.service.js.map +1 -1
- package/dist/service/services/zone.service.js +2 -1
- package/dist/service/services/zone.service.js.map +1 -1
- package/package.json +3 -3
|
@@ -19,6 +19,7 @@ const default_stock_display_strategy_1 = require("./catalog/default-stock-displa
|
|
|
19
19
|
const auto_increment_id_strategy_1 = require("./entity-id-strategy/auto-increment-id-strategy");
|
|
20
20
|
const manual_fulfillment_handler_1 = require("./fulfillment/manual-fulfillment-handler");
|
|
21
21
|
const default_logger_1 = require("./logger/default-logger");
|
|
22
|
+
const default_active_order_strategy_1 = require("./order/default-active-order-strategy");
|
|
22
23
|
const default_changed_price_handling_strategy_1 = require("./order/default-changed-price-handling-strategy");
|
|
23
24
|
const default_order_item_price_calculation_strategy_1 = require("./order/default-order-item-price-calculation-strategy");
|
|
24
25
|
const default_order_placed_strategy_1 = require("./order/default-order-placed-strategy");
|
|
@@ -108,6 +109,7 @@ exports.defaultConfig = {
|
|
|
108
109
|
entityOptions: {
|
|
109
110
|
channelCacheTtl: 30000,
|
|
110
111
|
zoneCacheTtl: 30000,
|
|
112
|
+
taxRateCacheTtl: 30000,
|
|
111
113
|
metadataModifiers: [],
|
|
112
114
|
},
|
|
113
115
|
promotionOptions: {
|
|
@@ -132,6 +134,7 @@ exports.defaultConfig = {
|
|
|
132
134
|
orderByCodeAccessStrategy: new order_by_code_access_strategy_1.DefaultOrderByCodeAccessStrategy('2h'),
|
|
133
135
|
changedPriceHandlingStrategy: new default_changed_price_handling_strategy_1.DefaultChangedPriceHandlingStrategy(),
|
|
134
136
|
orderPlacedStrategy: new default_order_placed_strategy_1.DefaultOrderPlacedStrategy(),
|
|
137
|
+
activeOrderStrategy: new default_active_order_strategy_1.DefaultActiveOrderStrategy(),
|
|
135
138
|
},
|
|
136
139
|
paymentOptions: {
|
|
137
140
|
paymentMethodEligibilityCheckers: [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-config.js","sourceRoot":"","sources":["../../src/config/default-config.ts"],"names":[],"mappings":";;;AAAA,yEAAmE;AACnE,2EAI8C;AAE9C,iGAA2F;AAC3F,4FAAqF;AACr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AAE;QACX,QAAQ,EAAE,EAAE;QACZ,aAAa,EAAE,EAAE;QACjB,KAAK,EAAE,EAAE;QACT,UAAU,EAAE,EAAE;QACd,WAAW,EAAE,EAAE;QACf,cAAc,EAAE,EAAE;QAClB,KAAK,EAAE,EAAE;QACT,SAAS,EAAE,EAAE;QACb,aAAa,EAAE,EAAE;QACjB,OAAO,EAAE,EAAE;QACX,aAAa,EAAE,EAAE;QACjB,kBAAkB,EAAE,EAAE;QACtB,cAAc,EAAE,EAAE;QAClB,SAAS,EAAE,EAAE;QACb,cAAc,EAAE,EAAE;QAClB,WAAW,EAAE,EAAE;QACf,OAAO,EAAE,EAAE;QACX,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,EAAE;KACX;IACD,OAAO,EAAE,EAAE;IACX,aAAa,EAAE;QACX,YAAY,EAAE,CAAC,IAAI,0DAA0B,EAAE,CAAC;KACnD;CACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"default-config.js","sourceRoot":"","sources":["../../src/config/default-config.ts"],"names":[],"mappings":";;;AAAA,yEAAmE;AACnE,2EAI8C;AAE9C,iGAA2F;AAC3F,4FAAqF;AACrF,yHAAiH;AAEjH,yGAAmG;AACnG,yGAAmG;AACnG,kGAA4F;AAC5F,kGAA4F;AAC5F,8FAAwF;AACxF,sGAAgG;AAChG,0FAAqF;AACrF,qFAAgF;AAChF,qIAA6H;AAC7H,6FAAuF;AACvF,gGAA0F;AAC1F,yFAAoF;AACpF,4DAAwD;AACxD,yFAAmF;AACnF,6GAAsG;AACtG,yHAAiH;AACjH,yFAAmF;AACnF,iGAA2F;AAC3F,yEAAoE;AACpE,yFAAyF;AACzF,qEAAuE;AACvE,mEAA8D;AAC9D,2CAAkF;AAClF,uGAAgG;AAChG,+FAA0F;AAC1F,iHAA2G;AAC3G,uGAAgG;AAChG,+EAAyE;AAGzE;;;;;GAKG;AACU,QAAA,aAAa,GAAyB;IAC/C,mBAAmB,EAAE,IAAI;IACzB,mBAAmB,EAAE,8BAAY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AE,EAAE;KACX;IACD,OAAO,EAAE,EAAE;IACX,aAAa,EAAE;QACX,YAAY,EAAE,CAAC,IAAI,0DAA0B,EAAE,CAAC;KACnD;CACJ,CAAC"}
|
package/dist/config/index.d.ts
CHANGED
|
@@ -30,6 +30,8 @@ export * from './logger/default-logger';
|
|
|
30
30
|
export * from './logger/noop-logger';
|
|
31
31
|
export * from './logger/vendure-logger';
|
|
32
32
|
export * from './merge-config';
|
|
33
|
+
export * from './order/active-order-strategy';
|
|
34
|
+
export * from './order/default-active-order-strategy';
|
|
33
35
|
export * from './order/changed-price-handling-strategy';
|
|
34
36
|
export * from './order/custom-order-process';
|
|
35
37
|
export * from './order/default-changed-price-handling-strategy';
|
package/dist/config/index.js
CHANGED
|
@@ -42,6 +42,8 @@ __exportStar(require("./logger/default-logger"), exports);
|
|
|
42
42
|
__exportStar(require("./logger/noop-logger"), exports);
|
|
43
43
|
__exportStar(require("./logger/vendure-logger"), exports);
|
|
44
44
|
__exportStar(require("./merge-config"), exports);
|
|
45
|
+
__exportStar(require("./order/active-order-strategy"), exports);
|
|
46
|
+
__exportStar(require("./order/default-active-order-strategy"), exports);
|
|
45
47
|
__exportStar(require("./order/changed-price-handling-strategy"), exports);
|
|
46
48
|
__exportStar(require("./order/custom-order-process"), exports);
|
|
47
49
|
__exportStar(require("./order/default-changed-price-handling-strategy"), exports);
|
package/dist/config/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gFAA8D;AAC9D,gFAA8D;AAC9D,wFAAsE;AACtE,kFAAgE;AAChE,kFAAgE;AAChE,iEAA+C;AAC/C,0EAAwD;AACxD,8EAA4D;AAC5D,wEAAsD;AACtD,mEAAiD;AACjD,sEAAoD;AACpD,8DAA4C;AAC5C,uEAAqD;AACrD,uFAAqE;AACrE,kDAAgC;AAChC,mDAAiC;AACjC,oEAAkD;AAClD,mDAAiC;AACjC,kFAAgE;AAChE,0EAAwD;AACxD,wEAAsD;AACtD,6EAA2D;AAC3D,4EAA0D;AAC1D,2EAAyD;AACzD,oEAAkD;AAClD,2EAAyD;AACzD,6EAA2D;AAC3D,iEAA+C;AAC/C,0DAAwC;AACxC,uDAAqC;AACrC,0DAAwC;AACxC,iDAA+B;AAC/B,0EAAwD;AACxD,+DAA6C;AAC7C,kFAAgE;AAChE,wEAAsD;AACtD,4EAA0D;AAC1D,gEAA8C;AAC9C,8DAA4C;AAC5C,gFAA8D;AAC9D,+DAA6C;AAC7C,gEAA8C;AAC9C,oEAAkD;AAClD,gEAA8C;AAC9C,+EAA6D;AAC7D,6DAA2C;AAC3C,mEAAiD;AACjD,yEAAuD;AACvD,2EAAyD;AACzD,+EAA6D;AAC7D,mEAAiD;AACjD,8CAA4B;AAC5B,mFAAiE;AACjE,8EAA4D;AAC5D,yEAAuD;AACvD,gFAA8D;AAC9D,yFAAuE;AACvE,wEAAsD;AACtD,iFAA+D;AAC/D,iEAA+C;AAC/C,8EAA4D;AAC5D,kEAAgD;AAChD,sEAAoD;AACpD,0DAAwC;AACxC,mDAAiC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gFAA8D;AAC9D,gFAA8D;AAC9D,wFAAsE;AACtE,kFAAgE;AAChE,kFAAgE;AAChE,iEAA+C;AAC/C,0EAAwD;AACxD,8EAA4D;AAC5D,wEAAsD;AACtD,mEAAiD;AACjD,sEAAoD;AACpD,8DAA4C;AAC5C,uEAAqD;AACrD,uFAAqE;AACrE,kDAAgC;AAChC,mDAAiC;AACjC,oEAAkD;AAClD,mDAAiC;AACjC,kFAAgE;AAChE,0EAAwD;AACxD,wEAAsD;AACtD,6EAA2D;AAC3D,4EAA0D;AAC1D,2EAAyD;AACzD,oEAAkD;AAClD,2EAAyD;AACzD,6EAA2D;AAC3D,iEAA+C;AAC/C,0DAAwC;AACxC,uDAAqC;AACrC,0DAAwC;AACxC,iDAA+B;AAC/B,gEAA8C;AAC9C,wEAAsD;AACtD,0EAAwD;AACxD,+DAA6C;AAC7C,kFAAgE;AAChE,wEAAsD;AACtD,4EAA0D;AAC1D,gEAA8C;AAC9C,8DAA4C;AAC5C,gFAA8D;AAC9D,+DAA6C;AAC7C,gEAA8C;AAC9C,oEAAkD;AAClD,gEAA8C;AAC9C,+EAA6D;AAC7D,6DAA2C;AAC3C,mEAAiD;AACjD,yEAAuD;AACvD,2EAAyD;AACzD,+EAA6D;AAC7D,mEAAiD;AACjD,8CAA4B;AAC5B,mFAAiE;AACjE,8EAA4D;AAC5D,yEAAuD;AACvD,gFAA8D;AAC9D,yFAAuE;AACvE,wEAAsD;AACtD,iFAA+D;AAC/D,iEAA+C;AAC/C,8EAA4D;AAC5D,kEAAgD;AAChD,sEAAoD;AACpD,0DAAwC;AACxC,mDAAiC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { DocumentNode } from 'graphql';
|
|
2
|
+
import { RequestContext } from '../../api/index';
|
|
3
|
+
import { InjectableStrategy } from '../../common/index';
|
|
4
|
+
import { Order } from '../../entity/index';
|
|
5
|
+
export declare const ACTIVE_ORDER_INPUT_FIELD_NAME = "activeOrderInput";
|
|
6
|
+
/**
|
|
7
|
+
* @description
|
|
8
|
+
* This strategy is used to determine the active Order for all order-related operations in
|
|
9
|
+
* the Shop API. By default, all the Shop API operations that relate to the active Order (e.g.
|
|
10
|
+
* `activeOrder`, `addItemToOrder`, `applyCouponCode` etc.) will implicitly create a new Order
|
|
11
|
+
* and set it on the current Session, and then read the session to obtain the active Order.
|
|
12
|
+
* This behaviour is defined by the {@link DefaultActiveOrderStrategy}.
|
|
13
|
+
*
|
|
14
|
+
* @since 1.9.0
|
|
15
|
+
*/
|
|
16
|
+
export interface ActiveOrderStrategy extends InjectableStrategy {
|
|
17
|
+
/**
|
|
18
|
+
* @description
|
|
19
|
+
* The name of the strategy, e.g. "orderByToken", which will also be used as the
|
|
20
|
+
* field name in the ActiveOrderInput type.
|
|
21
|
+
*/
|
|
22
|
+
readonly name: string;
|
|
23
|
+
/**
|
|
24
|
+
* @description
|
|
25
|
+
* Defines the type of the GraphQL Input object expected by the `authenticate`
|
|
26
|
+
* mutation. The final input object will be a map, with the key being the name
|
|
27
|
+
* of the strategy. The shape of the input object should match the generic `Data`
|
|
28
|
+
* type argument.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* For example, given the following:
|
|
32
|
+
*
|
|
33
|
+
* ```TypeScript
|
|
34
|
+
* defineInputType() {
|
|
35
|
+
* return gql`
|
|
36
|
+
* input OrderTokenInput {
|
|
37
|
+
* token: String!
|
|
38
|
+
* }
|
|
39
|
+
* `;
|
|
40
|
+
* }
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* assuming the strategy name is "my_auth", then the resulting call to `authenticate`
|
|
44
|
+
* would look like:
|
|
45
|
+
*
|
|
46
|
+
* ```GraphQL
|
|
47
|
+
* activeOrder(activeOrderInput: {
|
|
48
|
+
* orderByToken: {
|
|
49
|
+
* token: "foo"
|
|
50
|
+
* }
|
|
51
|
+
* }) {
|
|
52
|
+
* # ...
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* **Note:** if more than one graphql `input` type is being defined (as in a nested input type), then
|
|
57
|
+
* the _first_ input will be assumed to be the top-level input.
|
|
58
|
+
*/
|
|
59
|
+
defineInputType?: () => DocumentNode;
|
|
60
|
+
/**
|
|
61
|
+
* @description
|
|
62
|
+
* Certain mutations such as `addItemToOrder` can automatically create a new Order if one does not exist.
|
|
63
|
+
* In these cases, this method will be called to create the new Order.
|
|
64
|
+
*
|
|
65
|
+
* If automatic creation of an Order does not make sense in your strategy, then leave this method
|
|
66
|
+
* undefined. You'll then need to take care of creating an order manually by defining a custom mutation.
|
|
67
|
+
*/
|
|
68
|
+
createActiveOrder?: (ctx: RequestContext, inputs: any) => Promise<Order>;
|
|
69
|
+
/**
|
|
70
|
+
* @description
|
|
71
|
+
* This method is used to determine the active Order based on the current RequestContext in addition to any
|
|
72
|
+
* input values provided, as defined by the `defineInputType` method of this strategy.
|
|
73
|
+
*
|
|
74
|
+
* Note that this method is invoked frequently so you should aim to keep it efficient. The returned Order,
|
|
75
|
+
* for example, does not need to have its various relations joined.
|
|
76
|
+
*/
|
|
77
|
+
determineActiveOrder(ctx: RequestContext, inputs: any): Promise<Order | undefined>;
|
|
78
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"active-order-strategy.js","sourceRoot":"","sources":["../../../src/config/order/active-order-strategy.ts"],"names":[],"mappings":";;;AAMa,QAAA,6BAA6B,GAAG,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { RequestContext } from '../../api/common/request-context';
|
|
2
|
+
import { Injector } from '../../common/injector';
|
|
3
|
+
import { Order } from '../../entity/order/order.entity';
|
|
4
|
+
import { ActiveOrderStrategy } from './active-order-strategy';
|
|
5
|
+
/**
|
|
6
|
+
* @description
|
|
7
|
+
* The default {@link ActiveOrderStrategy}, which uses the current {@link Session} to determine
|
|
8
|
+
* the active Order, and requires no additional input in the Shop API since it is based on the
|
|
9
|
+
* session which is part of the RequestContext.
|
|
10
|
+
*
|
|
11
|
+
* @since 1.9.0
|
|
12
|
+
*/
|
|
13
|
+
export declare class DefaultActiveOrderStrategy implements ActiveOrderStrategy {
|
|
14
|
+
private connection;
|
|
15
|
+
private orderService;
|
|
16
|
+
private sessionService;
|
|
17
|
+
name: 'default-active-order-strategy';
|
|
18
|
+
init(injector: Injector): Promise<void>;
|
|
19
|
+
createActiveOrder(ctx: RequestContext): Promise<Order>;
|
|
20
|
+
determineActiveOrder(ctx: RequestContext): Promise<Order | undefined>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.DefaultActiveOrderStrategy = void 0;
|
|
23
|
+
const errors_1 = require("../../common/error/errors");
|
|
24
|
+
const transactional_connection_1 = require("../../connection/transactional-connection");
|
|
25
|
+
const order_entity_1 = require("../../entity/order/order.entity");
|
|
26
|
+
/**
|
|
27
|
+
* @description
|
|
28
|
+
* The default {@link ActiveOrderStrategy}, which uses the current {@link Session} to determine
|
|
29
|
+
* the active Order, and requires no additional input in the Shop API since it is based on the
|
|
30
|
+
* session which is part of the RequestContext.
|
|
31
|
+
*
|
|
32
|
+
* @since 1.9.0
|
|
33
|
+
*/
|
|
34
|
+
class DefaultActiveOrderStrategy {
|
|
35
|
+
async init(injector) {
|
|
36
|
+
this.connection = injector.get(transactional_connection_1.TransactionalConnection);
|
|
37
|
+
// Lazy import these dependencies to avoid a circular dependency issue in NestJS.
|
|
38
|
+
const { OrderService } = await Promise.resolve().then(() => __importStar(require('../../service/services/order.service')));
|
|
39
|
+
const { SessionService } = await Promise.resolve().then(() => __importStar(require('../../service/services/session.service')));
|
|
40
|
+
this.orderService = injector.get(OrderService);
|
|
41
|
+
this.sessionService = injector.get(SessionService);
|
|
42
|
+
}
|
|
43
|
+
createActiveOrder(ctx) {
|
|
44
|
+
return this.orderService.create(ctx, ctx.activeUserId);
|
|
45
|
+
}
|
|
46
|
+
async determineActiveOrder(ctx) {
|
|
47
|
+
if (!ctx.session) {
|
|
48
|
+
throw new errors_1.InternalServerError(`error.no-active-session`);
|
|
49
|
+
}
|
|
50
|
+
let order = ctx.session.activeOrderId
|
|
51
|
+
? await this.connection
|
|
52
|
+
.getRepository(ctx, order_entity_1.Order)
|
|
53
|
+
.createQueryBuilder('order')
|
|
54
|
+
.leftJoin('order.channels', 'channel')
|
|
55
|
+
.where('order.id = :orderId', { orderId: ctx.session.activeOrderId })
|
|
56
|
+
.andWhere('channel.id = :channelId', { channelId: ctx.channelId })
|
|
57
|
+
.getOne()
|
|
58
|
+
: undefined;
|
|
59
|
+
if (order && order.active === false) {
|
|
60
|
+
// edge case where an inactive order may not have been
|
|
61
|
+
// removed from the session, i.e. the regular process was interrupted
|
|
62
|
+
await this.sessionService.unsetActiveOrder(ctx, ctx.session);
|
|
63
|
+
order = undefined;
|
|
64
|
+
}
|
|
65
|
+
if (!order) {
|
|
66
|
+
if (ctx.activeUserId) {
|
|
67
|
+
order = await this.orderService.getActiveOrderForUser(ctx, ctx.activeUserId);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return order || undefined;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.DefaultActiveOrderStrategy = DefaultActiveOrderStrategy;
|
|
74
|
+
//# sourceMappingURL=default-active-order-strategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-active-order-strategy.js","sourceRoot":"","sources":["../../../src/config/order/default-active-order-strategy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AACA,sDA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,KAAK,CAAC,MAAM,KAAK,KAAK,EAAE;YACjC,sDAAsD;YACtD,qEAAqE;YACrE,MAAM,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;YAC7D,KAAK,GAAG,SAAS,CAAC;SACrB;QACD,IAAI,CAAC,KAAK,EAAE;YACR,IAAI,GAAG,CAAC,YAAY,EAAE;gBAClB,KAAK,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,qBAAqB,CAAC,GAAG,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC;aAChF;SACJ;QACD,OAAO,KAAK,IAAI,SAAS,CAAC;IAC9B,CAAC;CACJ;AA9CD,gEA8CC"}
|
|
@@ -24,6 +24,7 @@ import { CustomFulfillmentProcess } from './fulfillment/custom-fulfillment-proce
|
|
|
24
24
|
import { FulfillmentHandler } from './fulfillment/fulfillment-handler';
|
|
25
25
|
import { JobQueueStrategy } from './job-queue/job-queue-strategy';
|
|
26
26
|
import { VendureLogger } from './logger/vendure-logger';
|
|
27
|
+
import { ActiveOrderStrategy } from './order/active-order-strategy';
|
|
27
28
|
import { ChangedPriceHandlingStrategy } from './order/changed-price-handling-strategy';
|
|
28
29
|
import { CustomOrderProcess } from './order/custom-order-process';
|
|
29
30
|
import { OrderByCodeAccessStrategy } from './order/order-by-code-access-strategy';
|
|
@@ -542,6 +543,18 @@ export interface OrderOptions {
|
|
|
542
543
|
* @default DefaultOrderPlacedStrategy
|
|
543
544
|
*/
|
|
544
545
|
orderPlacedStrategy?: OrderPlacedStrategy;
|
|
546
|
+
/**
|
|
547
|
+
* @description
|
|
548
|
+
* Defines the strategy used to determine the active Order when interacting with Shop API operations
|
|
549
|
+
* such as `activeOrder` and `addItemToOrder`. By default, the strategy uses the active Session.
|
|
550
|
+
*
|
|
551
|
+
* Note that if multiple strategies are defined, they will be checked in order and the first one that
|
|
552
|
+
* returns an Order will be used.
|
|
553
|
+
*
|
|
554
|
+
* @since 1.9.0
|
|
555
|
+
* @default DefaultActiveOrderStrategy
|
|
556
|
+
*/
|
|
557
|
+
activeOrderStrategy?: ActiveOrderStrategy | ActiveOrderStrategy[];
|
|
545
558
|
}
|
|
546
559
|
/**
|
|
547
560
|
* @description
|
|
@@ -858,6 +871,17 @@ export interface EntityOptions {
|
|
|
858
871
|
* @default 30000
|
|
859
872
|
*/
|
|
860
873
|
zoneCacheTtl?: number;
|
|
874
|
+
/**
|
|
875
|
+
* @description
|
|
876
|
+
* TaxRates get cached in-memory as they are accessed very frequently. This
|
|
877
|
+
* setting determines how long the cache lives (in ms) until it is considered stale and
|
|
878
|
+
* refreshed. For multi-instance deployments (e.g. serverless, load-balanced), a
|
|
879
|
+
* smaller value here will prevent data inconsistencies between instances.
|
|
880
|
+
*
|
|
881
|
+
* @since 1.9.0
|
|
882
|
+
* @default 30000
|
|
883
|
+
*/
|
|
884
|
+
taxRateCacheTtl?: number;
|
|
861
885
|
/**
|
|
862
886
|
* @description
|
|
863
887
|
* Allows the metadata of the built-in TypeORM entities to be manipulated. This allows you
|
|
@@ -67,18 +67,18 @@ export declare class TransactionalConnection {
|
|
|
67
67
|
* @example
|
|
68
68
|
* ```TypeScript
|
|
69
69
|
* private async transferCredit(outerCtx: RequestContext, fromId: ID, toId: ID, amount: number) {
|
|
70
|
-
* await this.connection.withTransaction(outerCtx, ctx => {
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* // Note you must not use outerCtx here, instead use ctx. Otherwise this query
|
|
70
|
+
* await this.connection.withTransaction(outerCtx, async ctx => {
|
|
71
|
+
* // Note you must not use `outerCtx` here, instead use `ctx`. Otherwise, this query
|
|
74
72
|
* // will be executed outside of transaction
|
|
73
|
+
* await this.giftCardService.updateCustomerCredit(ctx, fromId, -amount);
|
|
74
|
+
*
|
|
75
75
|
* await this.connection.getRepository(ctx, GiftCard).update(fromId, { transferred: true })
|
|
76
76
|
*
|
|
77
77
|
* // If some intermediate logic here throws an Error,
|
|
78
78
|
* // then all DB transactions will be rolled back and neither Customer's
|
|
79
79
|
* // credit balance will have changed.
|
|
80
80
|
*
|
|
81
|
-
* await this.giftCardService.updateCustomerCredit(toId, amount);
|
|
81
|
+
* await this.giftCardService.updateCustomerCredit(ctx, toId, amount);
|
|
82
82
|
* })
|
|
83
83
|
* }
|
|
84
84
|
* ```
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"NO_ACTIVE_ORDER_ERROR": "Es gibt keine aktive Bestellung in der aktuellen Sitzung",
|
|
71
71
|
"NOTHING_TO_REFUND_ERROR": "Es gibt nichts zurückzuerstatten",
|
|
72
72
|
"NOT_VERIFIED_ERROR": "Bitte bestätige deine E-Mail-Adresse, bevor du dich anmeldest",
|
|
73
|
-
"ORDER_LIMIT_ERROR": "Der Artikel konnte nicht hinzugefügt werden. Eine Bestellung kann maximal { maxItems } Artikel enthalten",
|
|
73
|
+
"ORDER_LIMIT_ERROR": "Der Artikel konnte nicht hinzugefügt werden. Eine Bestellung kann maximal { maxItems } Artikel enthalten",
|
|
74
74
|
"ORDER_MODIFICATION_ERROR": "Der Inhalt der Bestellung kann nur im Status \"AddingItems\" geändert werden",
|
|
75
75
|
"ORDER_PAYMENT_STATE_ERROR": "Eine Zahlung kann nur im Status \"ArrangingPayment\" hinzugefügt werden",
|
|
76
76
|
"ORDER_STATE_TRANSITION_ERROR": "Der Status der Bestellung kan nicht von \"{ fromState }\" zu \"{ toState }\" geändert werden",
|
|
@@ -108,9 +108,9 @@
|
|
|
108
108
|
"facet-force-deleted": "Die Facette wurde gelöscht und ihre FacetValues wurden von {products, plural, =0 {} one {einem Produkt} other {# Produkten}}{both, select, both { und } single {}}{variants, plural, =0 {} one {einer Produktvariante} other {# Produktvariantem}} entfernt",
|
|
109
109
|
"facet-used": "Die ausgewählte Facette enthält FacetValues, die {products, plural, =0 {} one {einem Produkt} other {# Produkten}}{both, select, both { und } single {}}{variants, plural, =0 {} one {einer Produktvariante} other {# Produktvarianten}} zugewiesen sind",
|
|
110
110
|
"facet-value-force-deleted": "Der gewählte FacetValue wurde von {products, plural, =0 {} one {einem Produkt} other {# Produkten}}{both, select, both { und } single {}}{variants, plural, =0 {} one {einer Produktvariante} other {# Produktvarianten}} entfernt und gelöscht",
|
|
111
|
-
"facet-value-used": "Der
|
|
111
|
+
"facet-value-used": "Der FacetValue \"{ facetValueCode }\" wurde {products, plural, =0 {} one {einem Produkt} other {# Produkten}}{both, select, both { und } single {}}{variants, plural, =0 {} one {einer Produktvariante} other {# Produktvarianten}} zugewiesen",
|
|
112
112
|
"payment-method-used-in-channels": "Die gewählte Zahlungsmethode wird von den folgenden Kanälen verwendet: { channelCodes }. Mit \"force: true\" wird sie von allen Kanälen entfernt.",
|
|
113
113
|
"zone-used-in-channels": "Die ausgewählte Zone kann nicht gelöscht werden, da sie als Standard in den folgenden Kanälen verwendet wird: { channelCodes }",
|
|
114
114
|
"zone-used-in-tax-rates": "Die ausgewählte Zone kann nicht gelöscht werden, da sie in den folgenden Steuersätzen verwendet wird: { taxRateNames }"
|
|
115
115
|
}
|
|
116
|
-
}
|
|
116
|
+
}
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"no-configurable-operation-def-with-code-found": "No { type } with the code '{ code }' could be found",
|
|
38
38
|
"no-price-found-for-channel": "No price information was found for ProductVariant ID '{ variantId}' in the Channel '{ channel }'.",
|
|
39
39
|
"no-search-plugin-configured": "No search plugin has been configured",
|
|
40
|
+
"order-could-not-be-determined-or-created": "No active Order could be determined nor created",
|
|
40
41
|
"order-does-not-contain-line-with-id": "This order does not contain an OrderLine with the id { id }",
|
|
41
42
|
"pending-identifier-missing": "Could not find the pending email address to update",
|
|
42
43
|
"permission-invalid": "The permission \"{ permission }\" may not be assigned",
|
|
@@ -120,7 +121,7 @@
|
|
|
120
121
|
"facet-force-deleted": "The Facet was deleted and its FacetValues were removed from {products, plural, =0 {} one {1 Product} other {# Products}}{both, select, both { , } single {}}{variants, plural, =0 {} one {1 ProductVariant} other {# ProductVariants}}",
|
|
121
122
|
"facet-used": "The Facet \"{ facetCode }\" includes FacetValues which are assigned to {products, plural, =0 {} one {1 Product} other {# Products}}{both, select, both { , } single {}}{variants, plural, =0 {} one {1 ProductVariant} other {# ProductVariants}}",
|
|
122
123
|
"facet-value-force-deleted": "The selected FacetValue was removed from {products, plural, =0 {} one {1 Product} other {# Products}}{both, select, both { , } single {}}{variants, plural, =0 {} one {1 ProductVariant} other {# ProductVariants}} and deleted",
|
|
123
|
-
"facet-value-used": "The
|
|
124
|
+
"facet-value-used": "The FacetValue \"{ facetValueCode }\" is assigned to {products, plural, =0 {} one {1 Product} other {# Products}}{both, select, both { , } single {}}{variants, plural, =0 {} one {1 ProductVariant} other {# ProductVariants}}",
|
|
124
125
|
"payment-method-used-in-channels": "The selected PaymentMethod is assigned to the following Channels: { channelCodes }. Set \"force: true\" to delete from all Channels.",
|
|
125
126
|
"product-option-used": "Cannot delete the option \"{code}\" as it is being used by {count, plural, =0 {} one {1 ProductVariant} other {# ProductVariants}}",
|
|
126
127
|
"zone-used-in-channels": "The selected Zone cannot be deleted as it used as a default in the following Channels: { channelCodes }",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { RequestContext } from '../../../api/common/request-context';
|
|
2
|
-
import {
|
|
2
|
+
import { ConfigService } from '../../../config/index';
|
|
3
|
+
import { TransactionalConnection } from '../../../connection/index';
|
|
3
4
|
import { Order } from '../../../entity/order/order.entity';
|
|
4
5
|
import { OrderService } from '../../services/order.service';
|
|
5
6
|
import { SessionService } from '../../services/session.service';
|
|
@@ -13,7 +14,8 @@ export declare class ActiveOrderService {
|
|
|
13
14
|
private sessionService;
|
|
14
15
|
private orderService;
|
|
15
16
|
private connection;
|
|
16
|
-
|
|
17
|
+
private configService;
|
|
18
|
+
constructor(sessionService: SessionService, orderService: OrderService, connection: TransactionalConnection, configService: ConfigService);
|
|
17
19
|
/**
|
|
18
20
|
* @description
|
|
19
21
|
* Gets the active Order object from the current Session. Optionally can create a new Order if
|
|
@@ -21,7 +23,21 @@ export declare class ActiveOrderService {
|
|
|
21
23
|
*
|
|
22
24
|
* Intended to be used at the Resolver layer for those resolvers that depend upon an active Order
|
|
23
25
|
* being present.
|
|
26
|
+
*
|
|
27
|
+
* @deprecated From v1.9.0, use the `getActiveOrder` method which uses any configured ActiveOrderStrategies
|
|
24
28
|
*/
|
|
25
29
|
getOrderFromContext(ctx: RequestContext): Promise<Order | undefined>;
|
|
26
30
|
getOrderFromContext(ctx: RequestContext, createIfNotExists: true): Promise<Order>;
|
|
31
|
+
/**
|
|
32
|
+
* @description
|
|
33
|
+
* Retrieves the active Order based on the configured {@link ActiveOrderStrategy}.
|
|
34
|
+
*
|
|
35
|
+
* @since 1.9.0
|
|
36
|
+
*/
|
|
37
|
+
getActiveOrder(ctx: RequestContext, input: {
|
|
38
|
+
[strategyName: string]: any;
|
|
39
|
+
} | undefined): Promise<Order | undefined>;
|
|
40
|
+
getActiveOrder(ctx: RequestContext, input: {
|
|
41
|
+
[strategyName: string]: any;
|
|
42
|
+
} | undefined, createIfNotExists: true): Promise<Order>;
|
|
27
43
|
}
|
|
@@ -11,8 +11,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.ActiveOrderService = void 0;
|
|
13
13
|
const common_1 = require("@nestjs/common");
|
|
14
|
-
const
|
|
15
|
-
const
|
|
14
|
+
const index_1 = require("../../../common/index");
|
|
15
|
+
const index_2 = require("../../../config/index");
|
|
16
|
+
const index_3 = require("../../../connection/index");
|
|
16
17
|
const order_entity_1 = require("../../../entity/order/order.entity");
|
|
17
18
|
const order_service_1 = require("../../services/order.service");
|
|
18
19
|
const session_service_1 = require("../../services/session.service");
|
|
@@ -23,14 +24,15 @@ const session_service_1 = require("../../services/session.service");
|
|
|
23
24
|
* @docsCategory orders
|
|
24
25
|
*/
|
|
25
26
|
let ActiveOrderService = class ActiveOrderService {
|
|
26
|
-
constructor(sessionService, orderService, connection) {
|
|
27
|
+
constructor(sessionService, orderService, connection, configService) {
|
|
27
28
|
this.sessionService = sessionService;
|
|
28
29
|
this.orderService = orderService;
|
|
29
30
|
this.connection = connection;
|
|
31
|
+
this.configService = configService;
|
|
30
32
|
}
|
|
31
33
|
async getOrderFromContext(ctx, createIfNotExists = false) {
|
|
32
34
|
if (!ctx.session) {
|
|
33
|
-
throw new
|
|
35
|
+
throw new index_1.InternalServerError(`error.no-active-session`);
|
|
34
36
|
}
|
|
35
37
|
let order = ctx.session.activeOrderId
|
|
36
38
|
? await this.connection
|
|
@@ -60,12 +62,47 @@ let ActiveOrderService = class ActiveOrderService {
|
|
|
60
62
|
}
|
|
61
63
|
return order || undefined;
|
|
62
64
|
}
|
|
65
|
+
async getActiveOrder(ctx, input, createIfNotExists = false) {
|
|
66
|
+
var _a;
|
|
67
|
+
let order;
|
|
68
|
+
if (!order) {
|
|
69
|
+
const { activeOrderStrategy } = this.configService.orderOptions;
|
|
70
|
+
const strategyArray = Array.isArray(activeOrderStrategy)
|
|
71
|
+
? activeOrderStrategy
|
|
72
|
+
: [activeOrderStrategy];
|
|
73
|
+
for (const strategy of strategyArray) {
|
|
74
|
+
const strategyInput = (_a = input === null || input === void 0 ? void 0 : input[strategy.name]) !== null && _a !== void 0 ? _a : {};
|
|
75
|
+
order = await strategy.determineActiveOrder(ctx, strategyInput);
|
|
76
|
+
if (order) {
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
if (createIfNotExists && typeof strategy.createActiveOrder === 'function') {
|
|
80
|
+
order = await strategy.createActiveOrder(ctx, input);
|
|
81
|
+
}
|
|
82
|
+
if (order) {
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (!order && createIfNotExists) {
|
|
87
|
+
// No order has been found, and none could be created, which indicates that
|
|
88
|
+
// none of the configured strategies have a `createActiveOrder` method defined.
|
|
89
|
+
// In this case, we should throw an error because it is assumed that such a configuration
|
|
90
|
+
// indicates that an external order creation mechanism should be defined.
|
|
91
|
+
throw new index_1.UserInputError('error.order-could-not-be-determined-or-created');
|
|
92
|
+
}
|
|
93
|
+
if (order && ctx.session) {
|
|
94
|
+
await this.sessionService.setActiveOrder(ctx, ctx.session, order);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return order || undefined;
|
|
98
|
+
}
|
|
63
99
|
};
|
|
64
100
|
ActiveOrderService = __decorate([
|
|
65
101
|
(0, common_1.Injectable)(),
|
|
66
102
|
__metadata("design:paramtypes", [session_service_1.SessionService,
|
|
67
103
|
order_service_1.OrderService,
|
|
68
|
-
|
|
104
|
+
index_3.TransactionalConnection,
|
|
105
|
+
index_2.ConfigService])
|
|
69
106
|
], ActiveOrderService);
|
|
70
107
|
exports.ActiveOrderService = ActiveOrderService;
|
|
71
108
|
//# sourceMappingURL=active-order.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"active-order.service.js","sourceRoot":"","sources":["../../../../src/service/helpers/active-order/active-order.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAG5C,
|
|
1
|
+
{"version":3,"file":"active-order.service.js","sourceRoot":"","sources":["../../../../src/service/helpers/active-order/active-order.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAG5C,iDAA4E;AAC5E,iDAAsD;AACtD,qDAAoE;AACpE,qEAA2D;AAC3D,gEAA4D;AAC5D,oEAAgE;AAEhE;;;;;GAKG;AAEH,IAAa,kBAAkB,GAA/B,MAAa,kBAAkB;IAC3B,YACY,cAA8B,EAC9B,YAA0B,EAC1B,UAAmC,EACnC,aAA4B;QAH5B,mBAAc,GAAd,cAAc,CAAgB;QAC9B,iBAAY,GAAZ,YAAY,CAAc;QAC1B,eAAU,GAAV,UAAU,CAAyB;QACnC,kBAAa,GAAb,aAAa,CAAe;IACrC,CAAC;IAcJ,KAAK,CAAC,mBAAmB,CAAC,GAAmB,EAAE,iBAAiB,GAAG,KAAK;QACpE,IAAI,CAAC,G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C;IAC9B,CAAC;CACJ,CAAA;AA7GY,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;qCAGmB,gCAAc;QAChB,4BAAY;QACd,+BAAuB;QACpB,qBAAa;GAL/B,kBAAkB,CA6G9B;AA7GY,gDAAkB"}
|
|
@@ -26,8 +26,12 @@ export declare class ExternalAuthenticationService {
|
|
|
26
26
|
* @description
|
|
27
27
|
* Looks up a User based on their identifier from an external authentication
|
|
28
28
|
* provider, ensuring this User is associated with a Customer account.
|
|
29
|
+
*
|
|
30
|
+
* By default, only customers in the currently-active Channel will be checked.
|
|
31
|
+
* By passing `false` as the `checkCurrentChannelOnly` argument, _all_ channels
|
|
32
|
+
* will be checked.
|
|
29
33
|
*/
|
|
30
|
-
findCustomerUser(ctx: RequestContext, strategy: string, externalIdentifier: string): Promise<User | undefined>;
|
|
34
|
+
findCustomerUser(ctx: RequestContext, strategy: string, externalIdentifier: string, checkCurrentChannelOnly?: boolean): Promise<User | undefined>;
|
|
31
35
|
/**
|
|
32
36
|
* @description
|
|
33
37
|
* Looks up a User based on their identifier from an external authentication
|
|
@@ -42,12 +42,16 @@ let ExternalAuthenticationService = class ExternalAuthenticationService {
|
|
|
42
42
|
* @description
|
|
43
43
|
* Looks up a User based on their identifier from an external authentication
|
|
44
44
|
* provider, ensuring this User is associated with a Customer account.
|
|
45
|
+
*
|
|
46
|
+
* By default, only customers in the currently-active Channel will be checked.
|
|
47
|
+
* By passing `false` as the `checkCurrentChannelOnly` argument, _all_ channels
|
|
48
|
+
* will be checked.
|
|
45
49
|
*/
|
|
46
|
-
async findCustomerUser(ctx, strategy, externalIdentifier) {
|
|
50
|
+
async findCustomerUser(ctx, strategy, externalIdentifier, checkCurrentChannelOnly = true) {
|
|
47
51
|
const user = await this.findUser(ctx, strategy, externalIdentifier);
|
|
48
52
|
if (user) {
|
|
49
53
|
// Ensure this User is associated with a Customer
|
|
50
|
-
const customer = await this.customerService.findOneByUserId(ctx, user.id);
|
|
54
|
+
const customer = await this.customerService.findOneByUserId(ctx, user.id, checkCurrentChannelOnly);
|
|
51
55
|
if (customer) {
|
|
52
56
|
return user;
|
|
53
57
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"external-authentication.service.js","sourceRoot":"","sources":["../../../../src/service/helpers/external-authentication/external-authentication.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,yEAAuE;AAGvE,2FAAuF;AACvF,6FAAmF;AACnF,uIAA2H;AAC3H,8EAAoE;AAEpE,kEAAwD;AACxD,gFAA4E;AAC5E,oEAAgE;AAChE,sEAAkE;AAClE,oEAAgE;AAChE,8DAA0D;AAE1D;;;;;;GAMG;AAEH,IAAa,6BAA6B,GAA1C,MAAa,6BAA6B;IACtC,YACY,UAAmC,EACnC,WAAwB,EACxB,cAA8B,EAC9B,eAAgC,EAChC,oBAA0C,EAC1C,cAA8B;QAL9B,eAAU,GAAV,UAAU,CAAyB;QACnC,gBAAW,GAAX,WAAW,CAAa;QACxB,mBAAc,GAAd,cAAc,CAAgB;QAC9B,oBAAe,GAAf,eAAe,CAAiB;QAChC,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,mBAAc,GAAd,cAAc,CAAgB;IACvC,CAAC;IAEJ
|
|
1
|
+
{"version":3,"file":"external-authentication.service.js","sourceRoot":"","sources":["../../../../src/service/helpers/external-authentication/external-authentication.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,yEAAuE;AAGvE,2FAAuF;AACvF,6FAAmF;AACnF,uIAA2H;AAC3H,8EAAoE;AAEpE,kEAAwD;AACxD,gFAA4E;AAC5E,oEAAgE;AAChE,sEAAkE;AAClE,oEAAgE;AAChE,8DAA0D;AAE1D;;;;;;GAMG;AAEH,IAAa,6BAA6B,GAA1C,MAAa,6BAA6B;IACtC,YACY,UAAmC,EACnC,WAAwB,EACxB,cAA8B,EAC9B,eAAgC,EAChC,oBAA0C,EAC1C,cAA8B;QAL9B,eAAU,GAA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0BAAQ,CAAC;aAC5B,kBAAkB,CAAC,UAAU,CAAC;aAC9B,iBAAiB,CAAC,eAAe,EAAE,MAAM,CAAC;aAC1C,QAAQ,CAAC,mBAAmB,EAAE,SAAS,CAAC;aACxC,iBAAiB,CAAC,4BAA4B,EAAE,YAAY,CAAC;aAC7D,QAAQ,CAAC,uCAAuC,EAAE,EAAE,YAAY,EAAE,CAAC;aACnE,QAAQ,CAAC,wBAAwB,CAAC;aAClC,MAAM,EAAE,CAAC;QAEd,OAAO,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,CAAC;IAC1B,CAAC;CACJ,CAAA;AA9NY,6BAA6B;IADzC,IAAA,mBAAU,GAAE;qCAGe,kDAAuB;QACtB,0BAAW;QACR,gCAAc;QACb,kCAAe;QACV,4CAAoB;QAC1B,gCAAc;GAPjC,6BAA6B,CA8NzC;AA9NY,sEAA6B"}
|
|
@@ -81,7 +81,13 @@ export declare class OrderModifier {
|
|
|
81
81
|
modification: OrderModification;
|
|
82
82
|
}>;
|
|
83
83
|
private noChangesSpecified;
|
|
84
|
-
|
|
84
|
+
/**
|
|
85
|
+
* @description
|
|
86
|
+
* Because a Refund's amount is calculated based on the orderItems changed, plus shipping change,
|
|
87
|
+
* we need to make sure the amount gets adjusted to match any changes caused by other factors,
|
|
88
|
+
* i.e. promotions that were previously active but are no longer.
|
|
89
|
+
*/
|
|
90
|
+
private calculateRefundAdjustment;
|
|
85
91
|
private getOrderPayments;
|
|
86
92
|
private customFieldsAreEqual;
|
|
87
93
|
/**
|