@vendure/core 1.4.0-beta.0 → 1.4.3
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/config/configure-graphql-module.js +2 -0
- package/dist/api/config/configure-graphql-module.js.map +1 -1
- package/dist/api/config/generate-list-options.js +7 -2
- package/dist/api/config/generate-list-options.js.map +1 -1
- package/dist/api/config/graphql-custom-fields.d.ts +2 -0
- package/dist/api/config/graphql-custom-fields.js +155 -113
- package/dist/api/config/graphql-custom-fields.js.map +1 -1
- package/dist/api/resolvers/admin/tax-category.resolver.js +2 -2
- package/dist/api/resolvers/admin/tax-category.resolver.js.map +1 -1
- package/dist/api/resolvers/admin/tax-rate.resolver.js +2 -2
- package/dist/api/resolvers/admin/tax-rate.resolver.js.map +1 -1
- package/dist/api/schema/common/common-types.graphql +12 -0
- package/dist/api/schema/{admin-api → common}/payment-method.type.graphql +1 -0
- package/dist/common/configurable-operation.d.ts +1 -1
- package/dist/common/types/entity-relation-paths.d.ts +2 -2
- package/dist/config/auth/bcrypt-password-hashing-strategy.d.ts +1 -1
- package/dist/config/auth/bcrypt-password-hashing-strategy.js +11 -7
- package/dist/config/auth/bcrypt-password-hashing-strategy.js.map +1 -1
- package/dist/config/catalog/collection-filter.d.ts +1 -1
- package/dist/config/catalog/collection-filter.js +1 -1
- package/dist/config/catalog/default-collection-filters.d.ts +4 -4
- package/dist/config/custom-field/custom-field-types.d.ts +8 -8
- package/dist/config/promotion/actions/buy-x-get-y-free-action.d.ts +2 -2
- package/dist/config/promotion/actions/facet-values-percentage-discount-action.d.ts +2 -2
- package/dist/config/promotion/actions/order-fixed-discount-action.d.ts +1 -1
- package/dist/config/promotion/actions/order-percentage-discount-action.d.ts +1 -1
- package/dist/config/promotion/actions/product-percentage-discount-action.d.ts +2 -2
- package/dist/config/promotion/conditions/buy-x-get-y-free-condition.d.ts +2 -2
- package/dist/config/promotion/conditions/contains-products-condition.d.ts +1 -1
- package/dist/config/promotion/conditions/customer-group-condition.d.ts +1 -1
- package/dist/config/promotion/conditions/has-facet-values-condition.d.ts +1 -1
- package/dist/config/promotion/conditions/min-order-amount-condition.d.ts +1 -1
- package/dist/config/promotion/index.d.ts +13 -21
- package/dist/config/shipping-method/default-shipping-calculator.d.ts +4 -4
- package/dist/config/shipping-method/default-shipping-eligibility-checker.d.ts +1 -1
- package/dist/i18n/messages/en.json +2 -0
- package/dist/job-queue/subscribable-job.js +1 -1
- package/dist/job-queue/subscribable-job.js.map +1 -1
- package/dist/plugin/default-search-plugin/search-job-buffer/search-job-buffer.service.js +6 -1
- package/dist/plugin/default-search-plugin/search-job-buffer/search-job-buffer.service.js.map +1 -1
- package/dist/plugin/default-search-plugin/search-strategy/mysql-search-strategy.js +8 -8
- package/dist/plugin/default-search-plugin/search-strategy/mysql-search-strategy.js.map +1 -1
- package/dist/plugin/default-search-plugin/search-strategy/postgres-search-strategy.js +12 -6
- package/dist/plugin/default-search-plugin/search-strategy/postgres-search-strategy.js.map +1 -1
- package/dist/service/helpers/entity-hydrator/entity-hydrator.service.d.ts +12 -1
- package/dist/service/helpers/entity-hydrator/entity-hydrator.service.js +13 -2
- package/dist/service/helpers/entity-hydrator/entity-hydrator.service.js.map +1 -1
- package/dist/service/helpers/order-modifier/order-modifier.js +10 -2
- package/dist/service/helpers/order-modifier/order-modifier.js.map +1 -1
- package/dist/service/services/administrator.service.d.ts +6 -0
- package/dist/service/services/administrator.service.js +57 -0
- package/dist/service/services/administrator.service.js.map +1 -1
- package/dist/service/services/customer.service.js +2 -4
- package/dist/service/services/customer.service.js.map +1 -1
- package/dist/service/services/order.service.js +4 -1
- package/dist/service/services/order.service.js.map +1 -1
- package/dist/service/services/payment-method.service.js +1 -0
- package/dist/service/services/payment-method.service.js.map +1 -1
- package/package.json +3 -3
|
@@ -73,6 +73,7 @@ input ConfigurableOperationInput {
|
|
|
73
73
|
arguments: [ConfigArgInput!]!
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
"Operators for filtering on a String field"
|
|
76
77
|
input StringOperators {
|
|
77
78
|
eq: String
|
|
78
79
|
notEq: String
|
|
@@ -83,6 +84,15 @@ input StringOperators {
|
|
|
83
84
|
regex: String
|
|
84
85
|
}
|
|
85
86
|
|
|
87
|
+
"Operators for filtering on an ID field"
|
|
88
|
+
input IDOperators {
|
|
89
|
+
eq: String
|
|
90
|
+
notEq: String
|
|
91
|
+
in: [String!]
|
|
92
|
+
notIn: [String!]
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
"Operators for filtering on a Boolean field"
|
|
86
96
|
input BooleanOperators {
|
|
87
97
|
eq: Boolean
|
|
88
98
|
}
|
|
@@ -92,6 +102,7 @@ input NumberRange {
|
|
|
92
102
|
end: Float!
|
|
93
103
|
}
|
|
94
104
|
|
|
105
|
+
"Operators for filtering on a Int or Float field"
|
|
95
106
|
input NumberOperators {
|
|
96
107
|
eq: Float
|
|
97
108
|
lt: Float
|
|
@@ -106,6 +117,7 @@ input DateRange {
|
|
|
106
117
|
end: DateTime!
|
|
107
118
|
}
|
|
108
119
|
|
|
120
|
+
"Operators for filtering on a DateTime field"
|
|
109
121
|
input DateOperators {
|
|
110
122
|
eq: DateTime
|
|
111
123
|
before: DateTime
|
|
@@ -28,7 +28,7 @@ export interface ConfigArgCommonDef<T extends ConfigArgType> {
|
|
|
28
28
|
list?: boolean;
|
|
29
29
|
label?: LocalizedStringArray;
|
|
30
30
|
description?: LocalizedStringArray;
|
|
31
|
-
ui?: UiComponentConfig
|
|
31
|
+
ui?: UiComponentConfig<string>;
|
|
32
32
|
}
|
|
33
33
|
export declare type ConfigArgListDef<T extends ConfigArgType, C extends ConfigArgCommonDef<T> = ConfigArgCommonDef<T>> = C & {
|
|
34
34
|
list: true;
|
|
@@ -19,9 +19,9 @@ import { VendureEntity } from '../../entity/base/base.entity';
|
|
|
19
19
|
*
|
|
20
20
|
* @docsCategory Common
|
|
21
21
|
*/
|
|
22
|
-
export declare type EntityRelationPaths<T extends VendureEntity> = PathsToStringProps1<T> | Join<PathsToStringProps2<T>, '.'> | TripleDotPath;
|
|
22
|
+
export declare type EntityRelationPaths<T extends VendureEntity> = `customFields.${string}` | PathsToStringProps1<T> | Join<PathsToStringProps2<T>, '.'> | TripleDotPath;
|
|
23
23
|
export declare type EntityRelationKeys<T extends VendureEntity> = {
|
|
24
|
-
[K in Extract<keyof T, string>]: T[K] extends VendureEntity ? K : T[K] extends VendureEntity[] ? K : never;
|
|
24
|
+
[K in Extract<keyof T, string>]: Required<T>[K] extends VendureEntity ? K : Required<T>[K] extends VendureEntity[] ? K : never;
|
|
25
25
|
}[Extract<keyof T, string>];
|
|
26
26
|
export declare type EntityRelations<T extends VendureEntity> = {
|
|
27
27
|
[K in EntityRelationKeys<T>]: T[K];
|
|
@@ -8,7 +8,7 @@ import { PasswordHashingStrategy } from './password-hashing-strategy';
|
|
|
8
8
|
*/
|
|
9
9
|
export declare class BcryptPasswordHashingStrategy implements PasswordHashingStrategy {
|
|
10
10
|
private bcrypt;
|
|
11
|
-
constructor();
|
|
12
11
|
hash(plaintext: string): Promise<string>;
|
|
13
12
|
check(plaintext: string, hash: string): Promise<boolean>;
|
|
13
|
+
private getBcrypt;
|
|
14
14
|
}
|
|
@@ -10,19 +10,23 @@ const SALT_ROUNDS = 12;
|
|
|
10
10
|
* @since 1.3.0
|
|
11
11
|
*/
|
|
12
12
|
class BcryptPasswordHashingStrategy {
|
|
13
|
-
constructor() {
|
|
14
|
-
// The bcrypt lib is lazily loaded so that if we want to run Vendure
|
|
15
|
-
// in an environment that does not support native Node modules
|
|
16
|
-
// (such as an online sandbox like Stackblitz) the bcrypt dependency
|
|
17
|
-
// does not get loaded when linking the source files on startup.
|
|
18
|
-
this.bcrypt = require('bcrypt');
|
|
19
|
-
}
|
|
20
13
|
hash(plaintext) {
|
|
14
|
+
this.getBcrypt();
|
|
21
15
|
return this.bcrypt.hash(plaintext, SALT_ROUNDS);
|
|
22
16
|
}
|
|
23
17
|
check(plaintext, hash) {
|
|
18
|
+
this.getBcrypt();
|
|
24
19
|
return this.bcrypt.compare(plaintext, hash);
|
|
25
20
|
}
|
|
21
|
+
getBcrypt() {
|
|
22
|
+
if (!this.bcrypt) {
|
|
23
|
+
// The bcrypt lib is lazily loaded so that if we want to run Vendure
|
|
24
|
+
// in an environment that does not support native Node modules
|
|
25
|
+
// (such as an online sandbox like Stackblitz) the bcrypt dependency
|
|
26
|
+
// does not get loaded when linking the source files on startup.
|
|
27
|
+
this.bcrypt = require('bcrypt');
|
|
28
|
+
}
|
|
29
|
+
}
|
|
26
30
|
}
|
|
27
31
|
exports.BcryptPasswordHashingStrategy = BcryptPasswordHashingStrategy;
|
|
28
32
|
//# sourceMappingURL=bcrypt-password-hashing-strategy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bcrypt-password-hashing-strategy.js","sourceRoot":"","sources":["../../../src/config/auth/bcrypt-password-hashing-strategy.ts"],"names":[],"mappings":";;;AAEA,MAAM,WAAW,GAAG,EAAE,CAAC;AAEvB;;;;;;GAMG;AACH,MAAa,6BAA6B;IAGtC
|
|
1
|
+
{"version":3,"file":"bcrypt-password-hashing-strategy.js","sourceRoot":"","sources":["../../../src/config/auth/bcrypt-password-hashing-strategy.ts"],"names":[],"mappings":";;;AAEA,MAAM,WAAW,GAAG,EAAE,CAAC;AAEvB;;;;;;GAMG;AACH,MAAa,6BAA6B;IAGtC,IAAI,CAAC,SAAiB;QAClB,IAAI,CAAC,SAAS,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,SAAiB,EAAE,IAAY;QACjC,IAAI,CAAC,SAAS,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAChD,CAAC;IAEO,SAAS;QACb,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YACd,oEAAoE;YACpE,8DAA8D;YAC9D,oEAAoE;YACpE,gEAAgE;YAChE,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;SACnC;IACL,CAAC;CACJ;AAtBD,sEAsBC"}
|
|
@@ -13,7 +13,7 @@ export interface CollectionFilterConfig<T extends ConfigArgs> extends Configurab
|
|
|
13
13
|
* [`QueryBuilder`](https://typeorm.io/#/select-query-builder) object to which clauses may be added.
|
|
14
14
|
*
|
|
15
15
|
* Creating a CollectionFilter is considered an advanced Vendure topic. For more insight into how
|
|
16
|
-
* they work, study the [default collection filters](https://github.com/vendure-ecommerce/vendure/blob/master/packages/core/src/config/
|
|
16
|
+
* they work, study the [default collection filters](https://github.com/vendure-ecommerce/vendure/blob/master/packages/core/src/config/catalog/default-collection-filters.ts)
|
|
17
17
|
*
|
|
18
18
|
* @docsCategory configuration
|
|
19
19
|
*/
|
|
@@ -10,7 +10,7 @@ const configurable_operation_1 = require("../../common/configurable-operation");
|
|
|
10
10
|
* [`QueryBuilder`](https://typeorm.io/#/select-query-builder) object to which clauses may be added.
|
|
11
11
|
*
|
|
12
12
|
* Creating a CollectionFilter is considered an advanced Vendure topic. For more insight into how
|
|
13
|
-
* they work, study the [default collection filters](https://github.com/vendure-ecommerce/vendure/blob/master/packages/core/src/config/
|
|
13
|
+
* they work, study the [default collection filters](https://github.com/vendure-ecommerce/vendure/blob/master/packages/core/src/config/catalog/default-collection-filters.ts)
|
|
14
14
|
*
|
|
15
15
|
* @docsCategory configuration
|
|
16
16
|
*/
|
|
@@ -7,7 +7,7 @@ export declare const facetValueCollectionFilter: CollectionFilter<{
|
|
|
7
7
|
type: "ID";
|
|
8
8
|
list: true;
|
|
9
9
|
ui: {
|
|
10
|
-
component:
|
|
10
|
+
component: string;
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
containsAny: {
|
|
@@ -18,7 +18,7 @@ export declare const variantNameCollectionFilter: CollectionFilter<{
|
|
|
18
18
|
operator: {
|
|
19
19
|
type: "string";
|
|
20
20
|
ui: {
|
|
21
|
-
component:
|
|
21
|
+
component: string;
|
|
22
22
|
options: {
|
|
23
23
|
value: string;
|
|
24
24
|
}[];
|
|
@@ -33,7 +33,7 @@ export declare const defaultCollectionFilters: (CollectionFilter<{
|
|
|
33
33
|
type: "ID";
|
|
34
34
|
list: true;
|
|
35
35
|
ui: {
|
|
36
|
-
component:
|
|
36
|
+
component: string;
|
|
37
37
|
};
|
|
38
38
|
};
|
|
39
39
|
containsAny: {
|
|
@@ -43,7 +43,7 @@ export declare const defaultCollectionFilters: (CollectionFilter<{
|
|
|
43
43
|
operator: {
|
|
44
44
|
type: "string";
|
|
45
45
|
ui: {
|
|
46
|
-
component:
|
|
46
|
+
component: string;
|
|
47
47
|
options: {
|
|
48
48
|
value: string;
|
|
49
49
|
}[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BooleanCustomFieldConfig as GraphQLBooleanCustomFieldConfig, CustomField, DateTimeCustomFieldConfig as GraphQLDateTimeCustomFieldConfig, FloatCustomFieldConfig as GraphQLFloatCustomFieldConfig, IntCustomFieldConfig as GraphQLIntCustomFieldConfig, LocaleStringCustomFieldConfig as GraphQLLocaleStringCustomFieldConfig, LocalizedString, RelationCustomFieldConfig as GraphQLRelationCustomFieldConfig, StringCustomFieldConfig as GraphQLStringCustomFieldConfig, TextCustomFieldConfig as GraphQLTextCustomFieldConfig } from '@vendure/common/lib/generated-types';
|
|
2
|
-
import { CustomFieldsObject, CustomFieldType, Type, UiComponentConfig } from '@vendure/common/lib/shared-types';
|
|
2
|
+
import { CustomFieldsObject, CustomFieldType, DefaultFormComponentId, Type, UiComponentConfig } from '@vendure/common/lib/shared-types';
|
|
3
3
|
import { Injector } from '../../common/injector';
|
|
4
4
|
import { VendureEntity } from '../../entity/base/base.entity';
|
|
5
5
|
export declare type DefaultValueType<T extends CustomFieldType> = T extends 'string' | 'localeString' ? string : T extends 'int' | 'float' ? number : T extends 'boolean' ? boolean : T extends 'datetime' ? Date : T extends 'relation' ? any : never;
|
|
@@ -12,7 +12,7 @@ export declare type BaseTypedCustomFieldConfig<T extends CustomFieldType, C exte
|
|
|
12
12
|
*/
|
|
13
13
|
public?: boolean;
|
|
14
14
|
nullable?: boolean;
|
|
15
|
-
ui?: UiComponentConfig
|
|
15
|
+
ui?: UiComponentConfig<DefaultFormComponentId | string>;
|
|
16
16
|
};
|
|
17
17
|
/**
|
|
18
18
|
* @description
|
|
@@ -59,14 +59,14 @@ export declare type CustomFieldConfig = StringCustomFieldConfig | LocaleStringCu
|
|
|
59
59
|
*
|
|
60
60
|
* All custom fields share some common properties:
|
|
61
61
|
*
|
|
62
|
-
* * `name: string`: The name of the field
|
|
63
|
-
* * `type: string`: A string of type {@link CustomFieldType}
|
|
64
|
-
* * `list: boolean`: If set to `true`, then the field will be an array of the specified type
|
|
62
|
+
* * `name: string`: The name of the field.
|
|
63
|
+
* * `type: string`: A string of type {@link CustomFieldType}.
|
|
64
|
+
* * `list: boolean`: If set to `true`, then the field will be an array of the specified type.
|
|
65
65
|
* * `label?: LocalizedString[]`: An array of localized labels for the field.
|
|
66
66
|
* * `description?: LocalizedString[]`: An array of localized descriptions for the field.
|
|
67
|
-
* * `public?: boolean`: Whether or not the custom field is available via the Shop API. Defaults to `true
|
|
68
|
-
* * `readonly?: boolean`: Whether or not the custom field can be updated via the GraphQL APIs. Defaults to `false
|
|
69
|
-
* * `internal?: boolean`: Whether or not the custom field is exposed at all via the GraphQL APIs. Defaults to `false
|
|
67
|
+
* * `public?: boolean`: Whether or not the custom field is available via the Shop API. Defaults to `true`.
|
|
68
|
+
* * `readonly?: boolean`: Whether or not the custom field can be updated via the GraphQL APIs. Defaults to `false`.
|
|
69
|
+
* * `internal?: boolean`: Whether or not the custom field is exposed at all via the GraphQL APIs. Defaults to `false`.
|
|
70
70
|
* * `defaultValue?: any`: The default value when an Entity is created with this field.
|
|
71
71
|
* * `nullable?: boolean`: Whether the field is nullable in the database. If set to `false`, then a `defaultValue` should be provided.
|
|
72
72
|
* * `validate?: (value: any) => string | LocalizedString[] | void`: A custom validation function. If the value is valid, then
|
|
@@ -10,7 +10,7 @@ export declare const buyXGetYFreeAction: PromotionItemAction<{}, import("..").Pr
|
|
|
10
10
|
type: "ID";
|
|
11
11
|
list: true;
|
|
12
12
|
ui: {
|
|
13
|
-
component:
|
|
13
|
+
component: string;
|
|
14
14
|
};
|
|
15
15
|
label: {
|
|
16
16
|
languageCode: LanguageCode.en;
|
|
@@ -25,7 +25,7 @@ export declare const buyXGetYFreeAction: PromotionItemAction<{}, import("..").Pr
|
|
|
25
25
|
type: "ID";
|
|
26
26
|
list: true;
|
|
27
27
|
ui: {
|
|
28
|
-
component:
|
|
28
|
+
component: string;
|
|
29
29
|
};
|
|
30
30
|
label: {
|
|
31
31
|
languageCode: LanguageCode.en;
|
|
@@ -3,7 +3,7 @@ export declare const discountOnItemWithFacets: PromotionItemAction<{
|
|
|
3
3
|
discount: {
|
|
4
4
|
type: "int";
|
|
5
5
|
ui: {
|
|
6
|
-
component:
|
|
6
|
+
component: string;
|
|
7
7
|
suffix: string;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
@@ -11,7 +11,7 @@ export declare const discountOnItemWithFacets: PromotionItemAction<{
|
|
|
11
11
|
type: "ID";
|
|
12
12
|
list: true;
|
|
13
13
|
ui: {
|
|
14
|
-
component:
|
|
14
|
+
component: string;
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
17
|
}, []>;
|
|
@@ -4,7 +4,7 @@ export declare const productsPercentageDiscount: PromotionItemAction<{
|
|
|
4
4
|
discount: {
|
|
5
5
|
type: "int";
|
|
6
6
|
ui: {
|
|
7
|
-
component:
|
|
7
|
+
component: string;
|
|
8
8
|
suffix: string;
|
|
9
9
|
};
|
|
10
10
|
};
|
|
@@ -12,7 +12,7 @@ export declare const productsPercentageDiscount: PromotionItemAction<{
|
|
|
12
12
|
type: "ID";
|
|
13
13
|
list: true;
|
|
14
14
|
ui: {
|
|
15
|
-
component:
|
|
15
|
+
component: string;
|
|
16
16
|
};
|
|
17
17
|
label: {
|
|
18
18
|
languageCode: LanguageCode.en;
|
|
@@ -10,7 +10,7 @@ export declare const buyXGetYFreeCondition: PromotionCondition<{
|
|
|
10
10
|
type: "ID";
|
|
11
11
|
list: true;
|
|
12
12
|
ui: {
|
|
13
|
-
component:
|
|
13
|
+
component: string;
|
|
14
14
|
};
|
|
15
15
|
label: {
|
|
16
16
|
languageCode: LanguageCode.en;
|
|
@@ -25,7 +25,7 @@ export declare const buyXGetYFreeCondition: PromotionCondition<{
|
|
|
25
25
|
type: "ID";
|
|
26
26
|
list: true;
|
|
27
27
|
ui: {
|
|
28
|
-
component:
|
|
28
|
+
component: string;
|
|
29
29
|
};
|
|
30
30
|
label: {
|
|
31
31
|
languageCode: LanguageCode.en;
|
|
@@ -17,7 +17,7 @@ export declare const defaultPromotionActions: (import("./promotion-action").Prom
|
|
|
17
17
|
type: "ID";
|
|
18
18
|
list: true;
|
|
19
19
|
ui: {
|
|
20
|
-
component:
|
|
20
|
+
component: string;
|
|
21
21
|
};
|
|
22
22
|
label: {
|
|
23
23
|
languageCode: import("@vendure/common/lib/generated-types").LanguageCode.en;
|
|
@@ -32,7 +32,7 @@ export declare const defaultPromotionActions: (import("./promotion-action").Prom
|
|
|
32
32
|
type: "ID";
|
|
33
33
|
list: true;
|
|
34
34
|
ui: {
|
|
35
|
-
component:
|
|
35
|
+
component: string;
|
|
36
36
|
};
|
|
37
37
|
label: {
|
|
38
38
|
languageCode: import("@vendure/common/lib/generated-types").LanguageCode.en;
|
|
@@ -45,7 +45,7 @@ export declare const defaultPromotionActions: (import("./promotion-action").Prom
|
|
|
45
45
|
discount: {
|
|
46
46
|
type: "int";
|
|
47
47
|
ui: {
|
|
48
|
-
component:
|
|
48
|
+
component: string;
|
|
49
49
|
suffix: string;
|
|
50
50
|
};
|
|
51
51
|
};
|
|
@@ -53,29 +53,21 @@ export declare const defaultPromotionActions: (import("./promotion-action").Prom
|
|
|
53
53
|
type: "ID";
|
|
54
54
|
list: true;
|
|
55
55
|
ui: {
|
|
56
|
-
component:
|
|
56
|
+
component: string;
|
|
57
57
|
};
|
|
58
58
|
};
|
|
59
59
|
}, []> | import("./promotion-action").PromotionShippingAction<{}, []> | import("./promotion-action").PromotionOrderAction<{
|
|
60
60
|
discount: {
|
|
61
61
|
type: "int";
|
|
62
62
|
ui: {
|
|
63
|
-
component:
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
}, []> | import("./promotion-action").PromotionOrderAction<{
|
|
67
|
-
discount: {
|
|
68
|
-
type: "int";
|
|
69
|
-
ui: {
|
|
70
|
-
component: "number-form-input";
|
|
71
|
-
suffix: string;
|
|
63
|
+
component: string;
|
|
72
64
|
};
|
|
73
65
|
};
|
|
74
66
|
}, []> | import("./promotion-action").PromotionItemAction<{
|
|
75
67
|
discount: {
|
|
76
68
|
type: "int";
|
|
77
69
|
ui: {
|
|
78
|
-
component:
|
|
70
|
+
component: string;
|
|
79
71
|
suffix: string;
|
|
80
72
|
};
|
|
81
73
|
};
|
|
@@ -83,7 +75,7 @@ export declare const defaultPromotionActions: (import("./promotion-action").Prom
|
|
|
83
75
|
type: "ID";
|
|
84
76
|
list: true;
|
|
85
77
|
ui: {
|
|
86
|
-
component:
|
|
78
|
+
component: string;
|
|
87
79
|
};
|
|
88
80
|
label: {
|
|
89
81
|
languageCode: import("@vendure/common/lib/generated-types").LanguageCode.en;
|
|
@@ -100,7 +92,7 @@ export declare const defaultPromotionConditions: (import("./promotion-condition"
|
|
|
100
92
|
type: "ID";
|
|
101
93
|
list: true;
|
|
102
94
|
ui: {
|
|
103
|
-
component:
|
|
95
|
+
component: string;
|
|
104
96
|
};
|
|
105
97
|
label: {
|
|
106
98
|
languageCode: import("@vendure/common/lib/generated-types").LanguageCode.en;
|
|
@@ -115,7 +107,7 @@ export declare const defaultPromotionConditions: (import("./promotion-condition"
|
|
|
115
107
|
type: "ID";
|
|
116
108
|
list: true;
|
|
117
109
|
ui: {
|
|
118
|
-
component:
|
|
110
|
+
component: string;
|
|
119
111
|
};
|
|
120
112
|
label: {
|
|
121
113
|
languageCode: import("@vendure/common/lib/generated-types").LanguageCode.en;
|
|
@@ -133,7 +125,7 @@ export declare const defaultPromotionConditions: (import("./promotion-condition"
|
|
|
133
125
|
type: "ID";
|
|
134
126
|
list: true;
|
|
135
127
|
ui: {
|
|
136
|
-
component:
|
|
128
|
+
component: string;
|
|
137
129
|
};
|
|
138
130
|
label: {
|
|
139
131
|
languageCode: import("@vendure/common/lib/generated-types").LanguageCode.en;
|
|
@@ -144,7 +136,7 @@ export declare const defaultPromotionConditions: (import("./promotion-condition"
|
|
|
144
136
|
customerGroupId: {
|
|
145
137
|
type: "ID";
|
|
146
138
|
ui: {
|
|
147
|
-
component:
|
|
139
|
+
component: string;
|
|
148
140
|
};
|
|
149
141
|
label: {
|
|
150
142
|
languageCode: import("@vendure/common/lib/generated-types").LanguageCode.en;
|
|
@@ -160,7 +152,7 @@ export declare const defaultPromotionConditions: (import("./promotion-condition"
|
|
|
160
152
|
type: "ID";
|
|
161
153
|
list: true;
|
|
162
154
|
ui: {
|
|
163
|
-
component:
|
|
155
|
+
component: string;
|
|
164
156
|
};
|
|
165
157
|
};
|
|
166
158
|
}, "at_least_n_with_facets", boolean> | import("./promotion-condition").PromotionCondition<{
|
|
@@ -168,7 +160,7 @@ export declare const defaultPromotionConditions: (import("./promotion-condition"
|
|
|
168
160
|
type: "int";
|
|
169
161
|
defaultValue: number;
|
|
170
162
|
ui: {
|
|
171
|
-
component:
|
|
163
|
+
component: string;
|
|
172
164
|
};
|
|
173
165
|
};
|
|
174
166
|
taxInclusive: {
|
|
@@ -10,7 +10,7 @@ export declare const defaultShippingCalculator: ShippingCalculator<{
|
|
|
10
10
|
type: "int";
|
|
11
11
|
defaultValue: number;
|
|
12
12
|
ui: {
|
|
13
|
-
component:
|
|
13
|
+
component: string;
|
|
14
14
|
};
|
|
15
15
|
label: {
|
|
16
16
|
languageCode: LanguageCode.en;
|
|
@@ -21,10 +21,10 @@ export declare const defaultShippingCalculator: ShippingCalculator<{
|
|
|
21
21
|
type: "string";
|
|
22
22
|
defaultValue: TaxSetting;
|
|
23
23
|
ui: {
|
|
24
|
-
component:
|
|
24
|
+
component: string;
|
|
25
25
|
options: {
|
|
26
26
|
label: {
|
|
27
|
-
languageCode: LanguageCode
|
|
27
|
+
languageCode: LanguageCode;
|
|
28
28
|
value: string;
|
|
29
29
|
}[];
|
|
30
30
|
value: TaxSetting;
|
|
@@ -39,7 +39,7 @@ export declare const defaultShippingCalculator: ShippingCalculator<{
|
|
|
39
39
|
type: "int";
|
|
40
40
|
defaultValue: number;
|
|
41
41
|
ui: {
|
|
42
|
-
component:
|
|
42
|
+
component: string;
|
|
43
43
|
suffix: string;
|
|
44
44
|
};
|
|
45
45
|
label: {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"error": {
|
|
3
3
|
"cannot-delete-role": "The role '{ roleCode }' cannot be deleted",
|
|
4
|
+
"cannot-delete-sole-superadmin": "The sole SuperAdmin cannot be deleted",
|
|
4
5
|
"cannot-locate-customer-for-user": "Cannot locate a Customer for the user",
|
|
5
6
|
"cannot-modify-role": "The role '{ roleCode }' cannot be modified",
|
|
6
7
|
"cannot-create-sales-for-active-order": "Cannot create a Sale for an Order which is still active",
|
|
@@ -43,6 +44,7 @@
|
|
|
43
44
|
"product-variant-options-combination-already-exists": "A ProductVariant with the selected options already exists: {variantName}",
|
|
44
45
|
"promotion-channels-can-only-be-changed-from-default-channel": "Promotions channels may only be changed from the Default Channel",
|
|
45
46
|
"stockonhand-cannot-be-negative": "stockOnHand cannot be a negative value",
|
|
47
|
+
"superadmin-must-have-superadmin-role": "Cannot remove the SuperAdmin role from the sole SuperAdmin",
|
|
46
48
|
"unauthorized": "The credentials did not match. Please check and try again"
|
|
47
49
|
},
|
|
48
50
|
"errorResult": {
|
|
@@ -48,7 +48,7 @@ class SubscribableJob extends job_1.Job {
|
|
|
48
48
|
// tslint:disable-next-line:no-non-null-assertion
|
|
49
49
|
return rxjs_1.interval(pollInterval).pipe(operators_1.tap(i => {
|
|
50
50
|
if (timeoutMs < i * pollInterval) {
|
|
51
|
-
throw new Error(`Job ${this.id} update polling timed out after ${timeoutMs}ms. The job may still be running.`);
|
|
51
|
+
throw new Error(`Job ${this.id} SubscribableJob update polling timed out after ${timeoutMs}ms. The job may still be running.`);
|
|
52
52
|
}
|
|
53
53
|
}), operators_1.switchMap(() => {
|
|
54
54
|
const id = this.id;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscribable-job.js","sourceRoot":"","sources":["../../src/job-queue/subscribable-job.ts"],"names":[],"mappings":";;;;;;AAAA,yEAA+D;AAC/D,mDAAgD;AAChD,mEAAsE;AACtE,4CAAoB;AACpB,+BAA4C;AAC5C,8CAA8F;AAE9F,mDAA6D;AAC7D,uGAAmG;AAGnG,+BAA4B;AAe5B;;;;;;;;GAQG;AACH,MAAa,eAA4C,SAAQ,SAAM;IAGnE,YAAY,GAAW,EAAE,gBAAkC;QACvD,MAAM,MAAM,mCACL,GAAG,KACN,KAAK,EAAE,GAAG,CAAC,KAAK,EAChB,IAAI,EAAE,GAAG,CAAC,IAAI,EACd,EAAE,EAAE,GAAG,CAAC,EAAE,IAAI,SAAS,GAC1B,CAAC;QACF,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC7C,CAAC;IAED;;;;;;;OAOG;IACH,OAAO,CAAC,OAAuD;;QAC3D,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY,mCAAI,GAAG,CAAC,CAAC;QAChE,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,mCAAI,YAAE,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AK,KAAK,0BAAQ,CAAC,SAAS,EACpC,IAAI,CACP,EACD,eAAG,CAAC,GAAG,CAAC,EAAE;gBACN,IAAI,GAAG,CAAC,KAAK,KAAK,0BAAQ,CAAC,MAAM,EAAE;oBAC/B,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;iBAC9B;YACL,CAAC,CAAC,EACF,eAAG,CAAC,GAAG,CAAC,EAAE,CAAC,WAAI,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAChF,CAAC;SACL;IACL,CAAC;CACJ;AAjED,0CAiEC"}
|
|
@@ -17,6 +17,7 @@ const common_1 = require("@nestjs/common");
|
|
|
17
17
|
const rxjs_1 = require("rxjs");
|
|
18
18
|
const config_service_1 = require("../../../config/config.service");
|
|
19
19
|
const inspectable_job_queue_strategy_1 = require("../../../config/job-queue/inspectable-job-queue-strategy");
|
|
20
|
+
const vendure_logger_1 = require("../../../config/logger/vendure-logger");
|
|
20
21
|
const job_queue_service_1 = require("../../../job-queue/job-queue.service");
|
|
21
22
|
const subscribable_job_1 = require("../../../job-queue/subscribable-job");
|
|
22
23
|
const constants_1 = require("../constants");
|
|
@@ -52,7 +53,11 @@ let SearchJobBufferService = class SearchJobBufferService {
|
|
|
52
53
|
const collectionFilterJobs = await this.jobQueueService.flush(this.collectionJobBuffer);
|
|
53
54
|
if (collectionFilterJobs.length && inspectable_job_queue_strategy_1.isInspectableJobQueueStrategy(jobQueueStrategy)) {
|
|
54
55
|
const subscribableCollectionJobs = collectionFilterJobs.map(job => new subscribable_job_1.SubscribableJob(job, jobQueueStrategy));
|
|
55
|
-
await rxjs_1.forkJoin(...subscribableCollectionJobs.map(sj => sj.updates({ pollInterval: 500, timeoutMs:
|
|
56
|
+
await rxjs_1.forkJoin(...subscribableCollectionJobs.map(sj => sj.updates({ pollInterval: 500, timeoutMs: 15 * 60 * 1000 })))
|
|
57
|
+
.toPromise()
|
|
58
|
+
.catch(err => {
|
|
59
|
+
vendure_logger_1.Logger.error(err.message);
|
|
60
|
+
});
|
|
56
61
|
}
|
|
57
62
|
await this.jobQueueService.flush(this.searchIndexJobBuffer);
|
|
58
63
|
}
|
package/dist/plugin/default-search-plugin/search-job-buffer/search-job-buffer.service.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-job-buffer.service.js","sourceRoot":"","sources":["../../../../src/plugin/default-search-plugin/search-job-buffer/search-job-buffer.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4E;AAC5E,+BAAgC;AAEhC,mEAA+D;AAC/D,6GAAyG;AACzG,4EAAuE;AACvE,0EAAsE;AACtE,4CAA2D;AAE3D,mEAA8D;AAC9D,uEAAiE;AAGjE,IAAa,sBAAsB,GAAnC,MAAa,sBAAsB;IAI/B,YACY,eAAgC,EAChC,aAA4B,EACS,aAAsB;QAF3D,oBAAe,GAAf,eAAe,CAAiB;QAChC,kBAAa,GAAb,aAAa,CAAe;QACS,kBAAa,GAAb,aAAa,CAAS;QAN9D,yBAAoB,GAAG,IAAI,8CAAoB,EAAE,CAAC;QAClD,wBAAmB,GAAG,IAAI,2CAAmB,EAAE,CAAC;IAMtD,CAAC;IAEJ,sBAAsB;QAClB,IAAI,IAAI,CAAC,aAAa,KAAK,IAAI,EAAE;YAC7B,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;YAC1D,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;SAC5D;IACL,CAAC;IAED,KAAK,CAAC,uBAAuB;;QACzB,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;YACrB,OAAO,CAAC,CAAC;SACZ;QACD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,UAAU,CACrD,IAAI,CAAC,oBAAoB,EACzB,IAAI,CAAC,mBAAmB,CAC3B,CAAC;QACF,OAAO,CACH,CAAC,MAAA,WAAW,CAAC,IAAI,CAAC,oBAAoB,CAAC,EAAE,CAAC,mCAAI,CAAC,CAAC,GAAG,CAAC,MAAA,WAAW,CAAC,IAAI,CAAC,mBAAmB,CAAC,EAAE,CAAC,mCAAI,CAAC,CAAC,CACrG,CAAC;IACN,CAAC;IAED,KAAK,CAAC,uBAAuB;QACzB,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;YACrB,OAAO;SACV;QACD,MAAM,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC;QAEhE,MAAM,oBAAoB,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QACxF,IAAI,oBAAoB,CAAC,MAAM,IAAI,8DAA6B,CAAC,gBAAgB,CAAC,EAAE;YAChF,MAAM,0BAA0B,GAAG,oBAAoB,CAAC,GAAG,CACvD,GAAG,CAAC,EAAE,CAAC,IAAI,kCAAe,CAAC,GAAG,EAAE,gBAAgB,CAAC,CACpD,CAAC;YACF,MAAM,eAAQ,CACV,GAAG,0BAA0B,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CACnC,EAAE,CAAC,OAAO,CAAC,EAAE,YAAY,EAAE,GAAG,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"search-job-buffer.service.js","sourceRoot":"","sources":["../../../../src/plugin/default-search-plugin/search-job-buffer/search-job-buffer.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4E;AAC5E,+BAAgC;AAEhC,mEAA+D;AAC/D,6GAAyG;AACzG,0EAA+D;AAC/D,4EAAuE;AACvE,0EAAsE;AACtE,4CAA2D;AAE3D,mEAA8D;AAC9D,uEAAiE;AAGjE,IAAa,sBAAsB,GAAnC,MAAa,sBAAsB;IAI/B,YACY,eAAgC,EAChC,aAA4B,EACS,aAAsB;Q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oB,CAAC,GAAG,CACvD,GAAG,CAAC,EAAE,CAAC,IAAI,kCAAe,CAAC,GAAG,EAAE,gBAAgB,CAAC,CACpD,CAAC;YACF,MAAM,eAAQ,CACV,GAAG,0BAA0B,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CACnC,EAAE,CAAC,OAAO,CAAC,EAAE,YAAY,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC,CAC/D,CACJ;iBACI,SAAS,EAAE;iBACX,KAAK,CAAC,GAAG,CAAC,EAAE;gBACT,uBAAM,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAC9B,CAAC,CAAC,CAAC;SACV;QACD,MAAM,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;IAChE,CAAC;CACJ,CAAA;AArDY,sBAAsB;IADlC,mBAAU,EAAE;IAQJ,WAAA,eAAM,CAAC,uCAA2B,CAAC,CAAA;qCAFX,mCAAe;QACjB,8BAAa;GAN/B,sBAAsB,CAqDlC;AArDY,wDAAsB"}
|
|
@@ -109,18 +109,18 @@ class MysqlSearchStrategy {
|
|
|
109
109
|
.select('si_inner.productId', 'inner_productId')
|
|
110
110
|
.addSelect('si_inner.productVariantId', 'inner_productVariantId')
|
|
111
111
|
.addSelect(`IF (sku LIKE :like_term, 10, 0)`, 'sku_score')
|
|
112
|
-
.addSelect(`(SELECT sku_score) +
|
|
113
|
-
MATCH (productName) AGAINST (:term) * 2 +
|
|
114
|
-
MATCH (productVariantName) AGAINST (:term) * 1.5 +
|
|
115
|
-
MATCH (description) AGAINST (:term)* 1`, 'score')
|
|
112
|
+
.addSelect(`(SELECT sku_score) +
|
|
113
|
+
MATCH (productName) AGAINST (:term IN BOOLEAN MODE) * 2 +
|
|
114
|
+
MATCH (productVariantName) AGAINST (:term IN BOOLEAN MODE) * 1.5 +
|
|
115
|
+
MATCH (description) AGAINST (:term IN BOOLEAN MODE) * 1`, 'score')
|
|
116
116
|
.where(new typeorm_1.Brackets(qb1 => {
|
|
117
117
|
qb1.where('sku LIKE :like_term')
|
|
118
|
-
.orWhere('MATCH (productName) AGAINST (:term)')
|
|
119
|
-
.orWhere('MATCH (productVariantName) AGAINST (:term)')
|
|
120
|
-
.orWhere('MATCH (description) AGAINST (:term)');
|
|
118
|
+
.orWhere('MATCH (productName) AGAINST (:term IN BOOLEAN MODE)')
|
|
119
|
+
.orWhere('MATCH (productVariantName) AGAINST (:term IN BOOLEAN MODE)')
|
|
120
|
+
.orWhere('MATCH (description) AGAINST (:term IN BOOLEAN MODE)');
|
|
121
121
|
}))
|
|
122
122
|
.andWhere('channelId = :channelId')
|
|
123
|
-
.setParameters({ term
|
|
123
|
+
.setParameters({ term: `${term}*`, like_term: `%${term}%`, channelId: ctx.channelId });
|
|
124
124
|
qb.innerJoin(`(${termScoreQuery.getQuery()})`, 'term_result', 'inner_productId = si.productId')
|
|
125
125
|
.addSelect(input.groupByProduct ? 'MAX(term_result.score)' : 'term_result.score', 'score')
|
|
126
126
|
.andWhere('term_result.inner_productVariantId = si.productVariantId')
|