@vendure/core 3.1.2 → 3.1.4
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/graphql-value-transformer.d.ts +1 -0
- package/dist/api/common/graphql-value-transformer.js +23 -3
- package/dist/api/common/graphql-value-transformer.js.map +1 -1
- package/dist/api/config/configure-graphql-module.js +1 -1
- package/dist/api/config/configure-graphql-module.js.map +1 -1
- package/dist/api/config/graphql-custom-fields.d.ts +1 -1
- package/dist/api/config/graphql-custom-fields.js +174 -166
- package/dist/api/config/graphql-custom-fields.js.map +1 -1
- package/dist/api/schema/admin-api/product.api.graphql +1 -0
- package/dist/plugin/default-job-queue-plugin/sql-job-buffer-storage-strategy.js +14 -1
- package/dist/plugin/default-job-queue-plugin/sql-job-buffer-storage-strategy.js.map +1 -1
- package/dist/service/helpers/order-calculator/order-calculator.js +1 -10
- package/dist/service/helpers/order-calculator/order-calculator.js.map +1 -1
- package/dist/service/services/collection.service.d.ts +39 -4
- package/dist/service/services/collection.service.js +81 -30
- package/dist/service/services/collection.service.js.map +1 -1
- package/dist/service/services/product-option-group.service.js +4 -1
- package/dist/service/services/product-option-group.service.js.map +1 -1
- package/package.json +3 -3
|
@@ -41,6 +41,7 @@ export declare class GraphqlValueTransformer {
|
|
|
41
41
|
getInputTypeTree(definition: OperationDefinitionNode): TypeTree;
|
|
42
42
|
private getChildrenTreeNodes;
|
|
43
43
|
private isList;
|
|
44
|
+
private deepMergeChildren;
|
|
44
45
|
private getTypeNodeByPath;
|
|
45
46
|
private traverse;
|
|
46
47
|
private isTypeTree;
|
|
@@ -172,6 +172,23 @@ class GraphqlValueTransformer {
|
|
|
172
172
|
isList(t) {
|
|
173
173
|
return (0, graphql_1.isListType)(t) || ((0, graphql_1.isNonNullType)(t) && (0, graphql_1.isListType)(t.ofType));
|
|
174
174
|
}
|
|
175
|
+
deepMergeChildren(target, source) {
|
|
176
|
+
const merged = Object.assign({}, target);
|
|
177
|
+
for (const key in source) {
|
|
178
|
+
if (source.hasOwnProperty(key)) {
|
|
179
|
+
if (merged[key]) {
|
|
180
|
+
// If the key already exists, merge recursively
|
|
181
|
+
if (source[key].children && Object.keys(source[key].children).length > 0) {
|
|
182
|
+
merged[key].children = this.deepMergeChildren(merged[key].children, source[key].children);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
merged[key] = source[key];
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return merged;
|
|
191
|
+
}
|
|
175
192
|
getTypeNodeByPath(typeTree, path) {
|
|
176
193
|
let targetNode = typeTree.operation;
|
|
177
194
|
for (const segment of path) {
|
|
@@ -184,9 +201,12 @@ class GraphqlValueTransformer {
|
|
|
184
201
|
const ref = fragmentRefs.pop();
|
|
185
202
|
if (ref) {
|
|
186
203
|
const fragment = typeTree.fragments[ref];
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
204
|
+
if (fragment) {
|
|
205
|
+
// Deeply merge the children
|
|
206
|
+
children = this.deepMergeChildren(children, fragment.children);
|
|
207
|
+
if (fragment.fragmentRefs) {
|
|
208
|
+
fragmentRefs.push(...fragment.fragmentRefs);
|
|
209
|
+
}
|
|
190
210
|
}
|
|
191
211
|
}
|
|
192
212
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-value-transformer.js","sourceRoot":"","sources":["../../../src/api/common/graphql-value-transformer.ts"],"names":[],"mappings":";;;AAAA,qCAciB;AAoBjB;;GAEG;AACH,MAAa,uBAAuB;IAGhC,YAAoB,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;QAFjC,gBAAW,GAAG,IAAI,OAAO,EAA0B,CAAC;QACpD,eAAU,GAAG,IAAI,OAAO,EAAqC,CAAC;IAC1B,CAAC;IAE7C;;OAEG;IACH,eAAe,CACX,QAAkB,EAClB,IAA6B,EAC7B,SAAsD;QAEtD,IAAI,CAAC,QAAQ,CAAC,IAAI,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S,IAAI,SAAS;4BAC5B,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;4BACzB,MAAM,EAAE,WAAW;4BACnB,YAAY,EAAE,EAAE;4BAChB,QAAQ,EAAE,EAAE;yBACf,CAAC;wBACF,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC;wBAC1C,IAAI,IAAA,2BAAiB,EAAC,SAAS,CAAC,EAAE,CAAC;4BAC/B,IAAI,IAAA,2BAAiB,EAAC,SAAS,CAAC,EAAE,CAAC;gCAC/B,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,oBAAoB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;4BACrE,CAAC;wBACL,CAAC;wBACD,WAAW,GAAG,OAAO,CAAC;oBAC1B,CAAC;gBACL,CAAC;YACL,CAAC;YACD,KAAK,EAAE,IAAI,CAAC,EAAE;gBACV,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;oBAC3B,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC;wBACvC,WAAW,GAAG,WAAW,CAAC,MAAM,CAAC;oBACrC,CAAC;gBACL,CAAC;YACL,CAAC;SACJ,CAAC;QACF,IAAA,eAAK,EAAC,UAAU,EAAE,IAAA,2BAAiB,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;QACxD,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QAC1C,OAAO,QAAQ,CAAC;IACpB,CAAC;IAEO,oBAAoB,CACxB,SAAiC,EACjC,MAAoB;QAEpB,OAAO,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"graphql-value-transformer.js","sourceRoot":"","sources":["../../../src/api/common/graphql-value-transformer.ts"],"names":[],"mappings":";;;AAAA,qCAciB;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= (0, graphql_2.extendSchema)(schema, documentNode)));
|
|
108
108
|
schema = (0, generate_list_options_1.generateListOptions)(schema);
|
|
109
109
|
schema = (0, graphql_custom_fields_1.addGraphQLCustomFields)(schema, customFields, apiType === 'shop');
|
|
110
|
-
schema = (0, graphql_custom_fields_1.addOrderLineCustomFieldsInput)(schema, customFields.OrderLine || []);
|
|
110
|
+
schema = (0, graphql_custom_fields_1.addOrderLineCustomFieldsInput)(schema, customFields.OrderLine || [], apiType === 'shop');
|
|
111
111
|
schema = (0, graphql_custom_fields_1.addModifyOrderCustomFields)(schema, customFields.Order || []);
|
|
112
112
|
schema = (0, graphql_custom_fields_1.addShippingMethodQuoteCustomFields)(schema, customFields.ShippingMethod || []);
|
|
113
113
|
schema = (0, graphql_custom_fields_1.addPaymentMethodQuoteCustomFields)(schema, customFields.PaymentMethod || []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configure-graphql-module.js","sourceRoot":"","sources":["../../../src/api/config/configure-graphql-module.ts"],"names":[],"mappings":";;;;;;AAAA,2CAAkE;AAElE,6CAAoE;AACpE,mEAAsE;AACtE,qCAAmG;AACnG,gDAAwB;AAExB,8DAA0D;AAC1D,gEAA4D;AAC5D,8CAA+F;AAC/F,wDAAoD;AACpD,0DAAsD;AACtD,kEAAsE;AACtE,iEAA6D;AAC7D,kEAA0D;AAC1D,6GAAsG;AACtG,iEAA4D;AAC5D,qFAAgF;AAChF,mEAA8D;AAC9D,mFAA8E;AAE9E,+EAAyE;AACzE,+DAAoE;AACpE,yEAAmE;AACnE,mEAA8D;AAC9D,iEAAgE;AAChE,6DAAyD;AACzD,mEASiC;AAajC;;GAEG;AACH,SAAgB,sBAAsB,CAClC,UAA+D;IAE/D,OAAO,uBAAa,CAAC,YAAY,CAAqB;QAClD,MAAM,EAAE,qBAAY;QACpB,UAAU,EAAE,CACR,aAA4B,EAC5B,WAAwB,EACxB,cAA8B,EAC9B,WAA+B,EAC/B,kCAAsE,EACxE,EAAE;YACA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,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;aAClE,MAAM,CAAC,iCAAkB,CAAC;aAC1B,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,MAAM,GAAG,IAAA,sBAAY,EAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;QAC5E,MAAM,GAAG,IAAA,2CAAmB,EAAC,MAAM,CAAC,CAAC;QACrC,MAAM,GAAG,IAAA,8CAAsB,EAAC,MAAM,EAAE,YAAY,EAAE,OAAO,KAAK,MAAM,CAAC,CAAC;QAC1E,MAAM,GAAG,IAAA,qDAA6B,EAAC,MAAM,EAAE,YAAY,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"configure-graphql-module.js","sourceRoot":"","sources":["../../../src/api/config/configure-graphql-module.ts"],"names":[],"mappings":";;;;;;AAAA,2CAAkE;AAElE,6CAAoE;AACpE,mEAAsE;AACtE,qCAAmG;AACnG,gDAAwB;AAExB,8DAA0D;AAC1D,gEAA4D;AAC5D,8CAA+F;AAC/F,wDAAoD;AACpD,0DAAsD;AACtD,kEAAsE;AACtE,iEAA6D;AAC7D,kEAA0D;AAC1D,6GAAsG;AACtG,iEAA4D;AAC5D,qFAAgF;AAChF,mEAA8D;AAC9D,mFAA8E;AAE9E,+EAAyE;AACzE,+DAAoE;AACpE,yEAAmE;AACnE,mEAA8D;AAC9D,iEAAgE;AAChE,6DAAyD;AACzD,mEASiC;AAajC;;GAEG;AACH,SAAgB,sBAAsB,CAClC,UAA+D;IAE/D,OAAO,uBAAa,CAAC,YAAY,CAAqB;QAClD,MAAM,EAAE,qBAAY;QACpB,UAAU,EAAE,CACR,aAA4B,EAC5B,WAAwB,EACxB,cAA8B,EAC9B,WAA+B,EAC/B,kCAAsE,EACxE,EAAE;YACA,OAAO,oBAAoB,CACvB,WAAW,EACX,aAAa,EACb,cAAc,EACd,WAAW,EACX,kCAAkC,EAClC,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AAmB,CAAC,CAAC;QAC9F,CAAC;QACD,MAAM,GAAG,IAAA,6CAAsB,EAAC,MAAM,EAAE,aAAa,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;QAErF,OAAO,MAAM,CAAC;IAClB,CAAC;AACL,CAAC;AAED,SAAS,8BAA8B,CAAC,gBAAuC;IAC3E,OAAO,CACH,gBAAgB,CAAC,WAAW,KAAK,+BAAuB;QACxD,gBAAgB,CAAC,WAAW,KAAK,sBAAc,CAClD,CAAC;AACN,CAAC"}
|
|
@@ -24,6 +24,6 @@ export declare function addModifyOrderCustomFields(typeDefsOrSchema: string | Gr
|
|
|
24
24
|
* must be added to the `addItemToOrder` and `adjustOrderLine` mutations, as well as the related
|
|
25
25
|
* fields in the `ModifyOrderInput` type.
|
|
26
26
|
*/
|
|
27
|
-
export declare function addOrderLineCustomFieldsInput(typeDefsOrSchema: string | GraphQLSchema, orderLineCustomFields: CustomFieldConfig[]): GraphQLSchema;
|
|
27
|
+
export declare function addOrderLineCustomFieldsInput(typeDefsOrSchema: string | GraphQLSchema, orderLineCustomFields: CustomFieldConfig[], publicOnly: boolean): GraphQLSchema;
|
|
28
28
|
export declare function addShippingMethodQuoteCustomFields(typeDefsOrSchema: string | GraphQLSchema, shippingMethodCustomFields: CustomFieldConfig[]): GraphQLSchema;
|
|
29
29
|
export declare function addPaymentMethodQuoteCustomFields(typeDefsOrSchema: string | GraphQLSchema, paymentMethodCustomFields: CustomFieldConfig[]): GraphQLSchema;
|
|
@@ -15,13 +15,13 @@ function addGraphQLCustomFields(typeDefsOrSchema, customFieldConfig, publicOnly)
|
|
|
15
15
|
const schema = typeof typeDefsOrSchema === 'string' ? (0, graphql_1.buildSchema)(typeDefsOrSchema) : typeDefsOrSchema;
|
|
16
16
|
let customFieldTypeDefs = '';
|
|
17
17
|
if (!schema.getType('JSON')) {
|
|
18
|
-
customFieldTypeDefs += `
|
|
19
|
-
scalar JSON
|
|
18
|
+
customFieldTypeDefs += `
|
|
19
|
+
scalar JSON
|
|
20
20
|
`;
|
|
21
21
|
}
|
|
22
22
|
if (!schema.getType('DateTime')) {
|
|
23
|
-
customFieldTypeDefs += `
|
|
24
|
-
scalar DateTime
|
|
23
|
+
customFieldTypeDefs += `
|
|
24
|
+
scalar DateTime
|
|
25
25
|
`;
|
|
26
26
|
}
|
|
27
27
|
const customFieldsConfig = (0, get_custom_fields_config_without_interfaces_1.getCustomFieldsConfigWithoutInterfaces)(customFieldConfig, schema);
|
|
@@ -62,102 +62,108 @@ function addGraphQLCustomFields(typeDefsOrSchema, customFieldConfig, publicOnly)
|
|
|
62
62
|
if (schema.getType(entityName)) {
|
|
63
63
|
if (customEntityFields.length) {
|
|
64
64
|
for (const structCustomField of structCustomFields) {
|
|
65
|
-
customFieldTypeDefs += `
|
|
66
|
-
type ${getStructTypeName(entityName, structCustomField)} {
|
|
67
|
-
${mapToStructFields(structCustomField.fields, wrapListType(getGraphQlTypeForStructField))}
|
|
68
|
-
}
|
|
65
|
+
customFieldTypeDefs += `
|
|
66
|
+
type ${getStructTypeName(entityName, structCustomField)} {
|
|
67
|
+
${mapToStructFields(structCustomField.fields, wrapListType(getGraphQlTypeForStructField))}
|
|
68
|
+
}
|
|
69
69
|
`;
|
|
70
70
|
}
|
|
71
|
-
customFieldTypeDefs += `
|
|
72
|
-
type ${entityName}CustomFields {
|
|
73
|
-
${mapToFields(customEntityFields, wrapListType(getGraphQlType(entityName)))}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
extend type ${entityName} {
|
|
77
|
-
customFields: ${entityName}CustomFields
|
|
78
|
-
}
|
|
71
|
+
customFieldTypeDefs += `
|
|
72
|
+
type ${entityName}CustomFields {
|
|
73
|
+
${mapToFields(customEntityFields, wrapListType(getGraphQlType(entityName)))}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
extend type ${entityName} {
|
|
77
|
+
customFields: ${entityName}CustomFields
|
|
78
|
+
}
|
|
79
79
|
`;
|
|
80
80
|
}
|
|
81
81
|
else {
|
|
82
|
-
customFieldTypeDefs += `
|
|
83
|
-
extend type ${entityName} {
|
|
84
|
-
customFields: JSON
|
|
85
|
-
}
|
|
82
|
+
customFieldTypeDefs += `
|
|
83
|
+
extend type ${entityName} {
|
|
84
|
+
customFields: JSON
|
|
85
|
+
}
|
|
86
86
|
`;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
if (localizedFields.length && schema.getType(`${entityName}Translation`)) {
|
|
90
|
-
customFieldTypeDefs += `
|
|
91
|
-
type ${entityName}TranslationCustomFields {
|
|
92
|
-
${mapToFields(localizedFields, wrapListType(getGraphQlType(entityName)))}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
extend type ${entityName}Translation {
|
|
96
|
-
customFields: ${entityName}TranslationCustomFields
|
|
97
|
-
}
|
|
90
|
+
customFieldTypeDefs += `
|
|
91
|
+
type ${entityName}TranslationCustomFields {
|
|
92
|
+
${mapToFields(localizedFields, wrapListType(getGraphQlType(entityName)))}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
extend type ${entityName}Translation {
|
|
96
|
+
customFields: ${entityName}TranslationCustomFields
|
|
97
|
+
}
|
|
98
98
|
`;
|
|
99
99
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
100
|
+
const hasCreateInputType = schema.getType(`Create${entityName}Input`);
|
|
101
|
+
const hasUpdateInputType = schema.getType(`Update${entityName}Input`);
|
|
102
|
+
if ((hasCreateInputType || hasUpdateInputType) && writeableNonLocalizedFields.length) {
|
|
103
|
+
// Define any Struct input types that are required by
|
|
104
|
+
// the create and/or update input types.
|
|
105
|
+
for (const structCustomField of structCustomFields) {
|
|
106
|
+
customFieldTypeDefs += `
|
|
107
|
+
input ${getStructInputName(entityName, structCustomField)} {
|
|
108
|
+
${mapToStructFields(structCustomField.fields, wrapListType(getGraphQlInputType(entityName)))}
|
|
109
|
+
}
|
|
107
110
|
`;
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
if (hasCreateInputType) {
|
|
114
|
+
if (writeableNonLocalizedFields.length) {
|
|
115
|
+
customFieldTypeDefs += `
|
|
116
|
+
input Create${entityName}CustomFieldsInput {
|
|
117
|
+
${mapToFields(writeableNonLocalizedFields, wrapListType(getGraphQlInputType(entityName)), shared_utils_1.getGraphQlInputName)}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
extend input Create${entityName}Input {
|
|
121
|
+
customFields: Create${entityName}CustomFieldsInput
|
|
122
|
+
}
|
|
117
123
|
`;
|
|
118
124
|
}
|
|
119
125
|
else {
|
|
120
|
-
customFieldTypeDefs += `
|
|
121
|
-
extend input Create${entityName}Input {
|
|
122
|
-
customFields: JSON
|
|
123
|
-
}
|
|
126
|
+
customFieldTypeDefs += `
|
|
127
|
+
extend input Create${entityName}Input {
|
|
128
|
+
customFields: JSON
|
|
129
|
+
}
|
|
124
130
|
`;
|
|
125
131
|
}
|
|
126
132
|
}
|
|
127
|
-
if (
|
|
133
|
+
if (hasUpdateInputType) {
|
|
128
134
|
if (writeableNonLocalizedFields.length) {
|
|
129
|
-
customFieldTypeDefs += `
|
|
130
|
-
input Update${entityName}CustomFieldsInput {
|
|
131
|
-
${mapToFields(writeableNonLocalizedFields, wrapListType(getGraphQlInputType(entityName)), shared_utils_1.getGraphQlInputName)}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
extend input Update${entityName}Input {
|
|
135
|
-
customFields: Update${entityName}CustomFieldsInput
|
|
136
|
-
}
|
|
135
|
+
customFieldTypeDefs += `
|
|
136
|
+
input Update${entityName}CustomFieldsInput {
|
|
137
|
+
${mapToFields(writeableNonLocalizedFields, wrapListType(getGraphQlInputType(entityName)), shared_utils_1.getGraphQlInputName)}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
extend input Update${entityName}Input {
|
|
141
|
+
customFields: Update${entityName}CustomFieldsInput
|
|
142
|
+
}
|
|
137
143
|
`;
|
|
138
144
|
}
|
|
139
145
|
else {
|
|
140
|
-
customFieldTypeDefs += `
|
|
141
|
-
extend input Update${entityName}Input {
|
|
142
|
-
customFields: JSON
|
|
143
|
-
}
|
|
146
|
+
customFieldTypeDefs += `
|
|
147
|
+
extend input Update${entityName}Input {
|
|
148
|
+
customFields: JSON
|
|
149
|
+
}
|
|
144
150
|
`;
|
|
145
151
|
}
|
|
146
152
|
}
|
|
147
153
|
if (sortableFields.length && schema.getType(`${entityName}SortParameter`)) {
|
|
148
154
|
// Sorting list fields makes no sense, so we only add "sort" fields
|
|
149
155
|
// to non-list fields.
|
|
150
|
-
customFieldTypeDefs += `
|
|
151
|
-
extend input ${entityName}SortParameter {
|
|
152
|
-
${mapToFields(sortableFields, () => 'SortOrder')}
|
|
153
|
-
}
|
|
156
|
+
customFieldTypeDefs += `
|
|
157
|
+
extend input ${entityName}SortParameter {
|
|
158
|
+
${mapToFields(sortableFields, () => 'SortOrder')}
|
|
159
|
+
}
|
|
154
160
|
`;
|
|
155
161
|
}
|
|
156
162
|
if (filterableFields.length && schema.getType(`${entityName}FilterParameter`)) {
|
|
157
|
-
customFieldTypeDefs += `
|
|
158
|
-
extend input ${entityName}FilterParameter {
|
|
159
|
-
${mapToFields(filterableFields, getFilterOperator)}
|
|
160
|
-
}
|
|
163
|
+
customFieldTypeDefs += `
|
|
164
|
+
extend input ${entityName}FilterParameter {
|
|
165
|
+
${mapToFields(filterableFields, getFilterOperator)}
|
|
166
|
+
}
|
|
161
167
|
`;
|
|
162
168
|
}
|
|
163
169
|
if (writeableLocalizedFields) {
|
|
@@ -169,21 +175,21 @@ function addGraphQLCustomFields(typeDefsOrSchema, customFieldConfig, publicOnly)
|
|
|
169
175
|
for (const inputName of translationInputs) {
|
|
170
176
|
if (schema.getType(inputName)) {
|
|
171
177
|
if (writeableLocalizedFields.length) {
|
|
172
|
-
customFieldTypeDefs += `
|
|
173
|
-
input ${inputName}CustomFields {
|
|
174
|
-
${mapToFields(writeableLocalizedFields, wrapListType(getGraphQlType(entityName)))}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
extend input ${inputName} {
|
|
178
|
-
customFields: ${inputName}CustomFields
|
|
179
|
-
}
|
|
178
|
+
customFieldTypeDefs += `
|
|
179
|
+
input ${inputName}CustomFields {
|
|
180
|
+
${mapToFields(writeableLocalizedFields, wrapListType(getGraphQlType(entityName)))}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
extend input ${inputName} {
|
|
184
|
+
customFields: ${inputName}CustomFields
|
|
185
|
+
}
|
|
180
186
|
`;
|
|
181
187
|
}
|
|
182
188
|
else {
|
|
183
|
-
customFieldTypeDefs += `
|
|
184
|
-
extend input ${inputName} {
|
|
185
|
-
customFields: JSON
|
|
186
|
-
}
|
|
189
|
+
customFieldTypeDefs += `
|
|
190
|
+
extend input ${inputName} {
|
|
191
|
+
customFields: JSON
|
|
192
|
+
}
|
|
187
193
|
`;
|
|
188
194
|
}
|
|
189
195
|
}
|
|
@@ -196,26 +202,26 @@ function addGraphQLCustomFields(typeDefsOrSchema, customFieldConfig, publicOnly)
|
|
|
196
202
|
// For custom fields on the Address entity, we also extend the OrderAddress
|
|
197
203
|
// type (which is used to store address snapshots on Orders)
|
|
198
204
|
if (schema.getType('OrderAddress')) {
|
|
199
|
-
customFieldTypeDefs += `
|
|
200
|
-
extend type OrderAddress {
|
|
201
|
-
customFields: AddressCustomFields
|
|
202
|
-
}
|
|
205
|
+
customFieldTypeDefs += `
|
|
206
|
+
extend type OrderAddress {
|
|
207
|
+
customFields: AddressCustomFields
|
|
208
|
+
}
|
|
203
209
|
`;
|
|
204
210
|
}
|
|
205
211
|
if (schema.getType('UpdateOrderAddressInput') && (writeablePublicAddressFields === null || writeablePublicAddressFields === void 0 ? void 0 : writeablePublicAddressFields.length)) {
|
|
206
|
-
customFieldTypeDefs += `
|
|
207
|
-
extend input UpdateOrderAddressInput {
|
|
208
|
-
customFields: UpdateAddressCustomFieldsInput
|
|
209
|
-
}
|
|
212
|
+
customFieldTypeDefs += `
|
|
213
|
+
extend input UpdateOrderAddressInput {
|
|
214
|
+
customFields: UpdateAddressCustomFieldsInput
|
|
215
|
+
}
|
|
210
216
|
`;
|
|
211
217
|
}
|
|
212
218
|
}
|
|
213
219
|
else {
|
|
214
220
|
if (schema.getType('OrderAddress')) {
|
|
215
|
-
customFieldTypeDefs += `
|
|
216
|
-
extend type OrderAddress {
|
|
217
|
-
customFields: JSON
|
|
218
|
-
}
|
|
221
|
+
customFieldTypeDefs += `
|
|
222
|
+
extend type OrderAddress {
|
|
223
|
+
customFields: JSON
|
|
224
|
+
}
|
|
219
225
|
`;
|
|
220
226
|
}
|
|
221
227
|
}
|
|
@@ -224,28 +230,28 @@ function addGraphQLCustomFields(typeDefsOrSchema, customFieldConfig, publicOnly)
|
|
|
224
230
|
exports.addGraphQLCustomFields = addGraphQLCustomFields;
|
|
225
231
|
function addServerConfigCustomFields(typeDefsOrSchema, customFieldConfig) {
|
|
226
232
|
const schema = typeof typeDefsOrSchema === 'string' ? (0, graphql_1.buildSchema)(typeDefsOrSchema) : typeDefsOrSchema;
|
|
227
|
-
const customFieldTypeDefs = `
|
|
228
|
-
"""
|
|
229
|
-
This type is deprecated in v2.2 in favor of the EntityCustomFields type,
|
|
230
|
-
which allows custom fields to be defined on user-supplied entities.
|
|
231
|
-
"""
|
|
232
|
-
type CustomFields {
|
|
233
|
-
${Object.keys(customFieldConfig).reduce((output, name) => output + name + ': [CustomFieldConfig!]!\n', '')}
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
type EntityCustomFields {
|
|
237
|
-
entityName: String!
|
|
238
|
-
customFields: [CustomFieldConfig!]!
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
extend type ServerConfig {
|
|
242
|
-
"""
|
|
243
|
-
This field is deprecated in v2.2 in favor of the entityCustomFields field,
|
|
244
|
-
which allows custom fields to be defined on user-supplies entities.
|
|
245
|
-
"""
|
|
246
|
-
customFieldConfig: CustomFields!
|
|
247
|
-
entityCustomFields: [EntityCustomFields!]!
|
|
248
|
-
}
|
|
233
|
+
const customFieldTypeDefs = `
|
|
234
|
+
"""
|
|
235
|
+
This type is deprecated in v2.2 in favor of the EntityCustomFields type,
|
|
236
|
+
which allows custom fields to be defined on user-supplied entities.
|
|
237
|
+
"""
|
|
238
|
+
type CustomFields {
|
|
239
|
+
${Object.keys(customFieldConfig).reduce((output, name) => output + name + ': [CustomFieldConfig!]!\n', '')}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
type EntityCustomFields {
|
|
243
|
+
entityName: String!
|
|
244
|
+
customFields: [CustomFieldConfig!]!
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
extend type ServerConfig {
|
|
248
|
+
"""
|
|
249
|
+
This field is deprecated in v2.2 in favor of the entityCustomFields field,
|
|
250
|
+
which allows custom fields to be defined on user-supplies entities.
|
|
251
|
+
"""
|
|
252
|
+
customFieldConfig: CustomFields!
|
|
253
|
+
entityCustomFields: [EntityCustomFields!]!
|
|
254
|
+
}
|
|
249
255
|
`;
|
|
250
256
|
return (0, graphql_1.extendSchema)(schema, (0, graphql_1.parse)(customFieldTypeDefs));
|
|
251
257
|
}
|
|
@@ -253,10 +259,10 @@ exports.addServerConfigCustomFields = addServerConfigCustomFields;
|
|
|
253
259
|
function addActiveAdministratorCustomFields(typeDefsOrSchema, administratorCustomFields) {
|
|
254
260
|
const schema = typeof typeDefsOrSchema === 'string' ? (0, graphql_1.buildSchema)(typeDefsOrSchema) : typeDefsOrSchema;
|
|
255
261
|
const writableCustomFields = administratorCustomFields === null || administratorCustomFields === void 0 ? void 0 : administratorCustomFields.filter(field => field.readonly !== true && field.internal !== true);
|
|
256
|
-
const extension = `
|
|
257
|
-
extend input UpdateActiveAdministratorInput {
|
|
258
|
-
customFields: ${0 < (writableCustomFields === null || writableCustomFields === void 0 ? void 0 : writableCustomFields.length) ? 'UpdateAdministratorCustomFieldsInput' : 'JSON'}
|
|
259
|
-
}
|
|
262
|
+
const extension = `
|
|
263
|
+
extend input UpdateActiveAdministratorInput {
|
|
264
|
+
customFields: ${0 < (writableCustomFields === null || writableCustomFields === void 0 ? void 0 : writableCustomFields.length) ? 'UpdateAdministratorCustomFieldsInput' : 'JSON'}
|
|
265
|
+
}
|
|
260
266
|
`;
|
|
261
267
|
return (0, graphql_1.extendSchema)(schema, (0, graphql_1.parse)(extension));
|
|
262
268
|
}
|
|
@@ -277,14 +283,14 @@ function addRegisterCustomerCustomFieldsInput(typeDefsOrSchema, customerCustomFi
|
|
|
277
283
|
if (publicWritableCustomFields.length < 1) {
|
|
278
284
|
return schema;
|
|
279
285
|
}
|
|
280
|
-
const customFieldTypeDefs = `
|
|
281
|
-
input RegisterCustomerCustomFieldsInput {
|
|
282
|
-
${mapToFields(publicWritableCustomFields, wrapListType(getGraphQlInputType('Customer')), shared_utils_1.getGraphQlInputName)}
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
extend input RegisterCustomerInput {
|
|
286
|
-
customFields: RegisterCustomerCustomFieldsInput
|
|
287
|
-
}
|
|
286
|
+
const customFieldTypeDefs = `
|
|
287
|
+
input RegisterCustomerCustomFieldsInput {
|
|
288
|
+
${mapToFields(publicWritableCustomFields, wrapListType(getGraphQlInputType('Customer')), shared_utils_1.getGraphQlInputName)}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
extend input RegisterCustomerInput {
|
|
292
|
+
customFields: RegisterCustomerCustomFieldsInput
|
|
293
|
+
}
|
|
288
294
|
`;
|
|
289
295
|
return (0, graphql_1.extendSchema)(schema, (0, graphql_1.parse)(customFieldTypeDefs));
|
|
290
296
|
}
|
|
@@ -299,10 +305,10 @@ function addModifyOrderCustomFields(typeDefsOrSchema, orderCustomFields) {
|
|
|
299
305
|
return schema;
|
|
300
306
|
}
|
|
301
307
|
if (schema.getType('ModifyOrderInput') && schema.getType('UpdateOrderCustomFieldsInput')) {
|
|
302
|
-
const customFieldTypeDefs = `
|
|
303
|
-
extend input ModifyOrderInput {
|
|
304
|
-
customFields: UpdateOrderCustomFieldsInput
|
|
305
|
-
}
|
|
308
|
+
const customFieldTypeDefs = `
|
|
309
|
+
extend input ModifyOrderInput {
|
|
310
|
+
customFields: UpdateOrderCustomFieldsInput
|
|
311
|
+
}
|
|
306
312
|
`;
|
|
307
313
|
return (0, graphql_1.extendSchema)(schema, (0, graphql_1.parse)(customFieldTypeDefs));
|
|
308
314
|
}
|
|
@@ -314,10 +320,12 @@ exports.addModifyOrderCustomFields = addModifyOrderCustomFields;
|
|
|
314
320
|
* must be added to the `addItemToOrder` and `adjustOrderLine` mutations, as well as the related
|
|
315
321
|
* fields in the `ModifyOrderInput` type.
|
|
316
322
|
*/
|
|
317
|
-
function addOrderLineCustomFieldsInput(typeDefsOrSchema, orderLineCustomFields) {
|
|
323
|
+
function addOrderLineCustomFieldsInput(typeDefsOrSchema, orderLineCustomFields, publicOnly) {
|
|
318
324
|
const schema = typeof typeDefsOrSchema === 'string' ? (0, graphql_1.buildSchema)(typeDefsOrSchema) : typeDefsOrSchema;
|
|
325
|
+
orderLineCustomFields = orderLineCustomFields.filter(f => f.internal !== true);
|
|
319
326
|
const publicCustomFields = orderLineCustomFields.filter(f => f.public !== false);
|
|
320
|
-
|
|
327
|
+
const customFields = publicOnly ? publicCustomFields : orderLineCustomFields;
|
|
328
|
+
if (!customFields || customFields.length === 0) {
|
|
321
329
|
return schema;
|
|
322
330
|
}
|
|
323
331
|
const schemaConfig = schema.toConfig();
|
|
@@ -344,7 +352,7 @@ function addOrderLineCustomFieldsInput(typeDefsOrSchema, orderLineCustomFields)
|
|
|
344
352
|
}
|
|
345
353
|
const input = new graphql_1.GraphQLInputObjectType({
|
|
346
354
|
name: 'OrderLineCustomFieldsInput',
|
|
347
|
-
fields:
|
|
355
|
+
fields: customFields.reduce((fields, field) => {
|
|
348
356
|
var _a;
|
|
349
357
|
const name = (0, shared_utils_1.getGraphQlInputName)(field);
|
|
350
358
|
const inputTypeName = getGraphQlInputType('OrderLine')(field);
|
|
@@ -390,34 +398,34 @@ function addOrderLineCustomFieldsInput(typeDefsOrSchema, orderLineCustomFields)
|
|
|
390
398
|
}
|
|
391
399
|
let extendedSchema = new graphql_1.GraphQLSchema(schemaConfig);
|
|
392
400
|
if (schema.getType('AddItemInput')) {
|
|
393
|
-
const customFieldTypeDefs = `
|
|
394
|
-
extend input AddItemInput {
|
|
395
|
-
customFields: OrderLineCustomFieldsInput
|
|
396
|
-
}
|
|
401
|
+
const customFieldTypeDefs = `
|
|
402
|
+
extend input AddItemInput {
|
|
403
|
+
customFields: OrderLineCustomFieldsInput
|
|
404
|
+
}
|
|
397
405
|
`;
|
|
398
406
|
extendedSchema = (0, graphql_1.extendSchema)(extendedSchema, (0, graphql_1.parse)(customFieldTypeDefs));
|
|
399
407
|
}
|
|
400
408
|
if (schema.getType('OrderLineInput')) {
|
|
401
|
-
const customFieldTypeDefs = `
|
|
402
|
-
extend input OrderLineInput {
|
|
403
|
-
customFields: OrderLineCustomFieldsInput
|
|
404
|
-
}
|
|
409
|
+
const customFieldTypeDefs = `
|
|
410
|
+
extend input OrderLineInput {
|
|
411
|
+
customFields: OrderLineCustomFieldsInput
|
|
412
|
+
}
|
|
405
413
|
`;
|
|
406
414
|
extendedSchema = (0, graphql_1.extendSchema)(extendedSchema, (0, graphql_1.parse)(customFieldTypeDefs));
|
|
407
415
|
}
|
|
408
416
|
if (schema.getType('AddItemToDraftOrderInput')) {
|
|
409
|
-
const customFieldTypeDefs = `
|
|
410
|
-
extend input AddItemToDraftOrderInput {
|
|
411
|
-
customFields: OrderLineCustomFieldsInput
|
|
412
|
-
}
|
|
417
|
+
const customFieldTypeDefs = `
|
|
418
|
+
extend input AddItemToDraftOrderInput {
|
|
419
|
+
customFields: OrderLineCustomFieldsInput
|
|
420
|
+
}
|
|
413
421
|
`;
|
|
414
422
|
extendedSchema = (0, graphql_1.extendSchema)(extendedSchema, (0, graphql_1.parse)(customFieldTypeDefs));
|
|
415
423
|
}
|
|
416
424
|
if (schema.getType('AdjustDraftOrderLineInput')) {
|
|
417
|
-
const customFieldTypeDefs = `
|
|
418
|
-
extend input AdjustDraftOrderLineInput {
|
|
419
|
-
customFields: OrderLineCustomFieldsInput
|
|
420
|
-
}
|
|
425
|
+
const customFieldTypeDefs = `
|
|
426
|
+
extend input AdjustDraftOrderLineInput {
|
|
427
|
+
customFields: OrderLineCustomFieldsInput
|
|
428
|
+
}
|
|
421
429
|
`;
|
|
422
430
|
extendedSchema = (0, graphql_1.extendSchema)(extendedSchema, (0, graphql_1.parse)(customFieldTypeDefs));
|
|
423
431
|
}
|
|
@@ -429,17 +437,17 @@ function addShippingMethodQuoteCustomFields(typeDefsOrSchema, shippingMethodCust
|
|
|
429
437
|
let customFieldTypeDefs = '';
|
|
430
438
|
const publicCustomFields = shippingMethodCustomFields.filter(f => f.public !== false);
|
|
431
439
|
if (0 < publicCustomFields.length) {
|
|
432
|
-
customFieldTypeDefs = `
|
|
433
|
-
extend type ShippingMethodQuote {
|
|
434
|
-
customFields: ShippingMethodCustomFields
|
|
435
|
-
}
|
|
440
|
+
customFieldTypeDefs = `
|
|
441
|
+
extend type ShippingMethodQuote {
|
|
442
|
+
customFields: ShippingMethodCustomFields
|
|
443
|
+
}
|
|
436
444
|
`;
|
|
437
445
|
}
|
|
438
446
|
else {
|
|
439
|
-
customFieldTypeDefs = `
|
|
440
|
-
extend type ShippingMethodQuote {
|
|
441
|
-
customFields: JSON
|
|
442
|
-
}
|
|
447
|
+
customFieldTypeDefs = `
|
|
448
|
+
extend type ShippingMethodQuote {
|
|
449
|
+
customFields: JSON
|
|
450
|
+
}
|
|
443
451
|
`;
|
|
444
452
|
}
|
|
445
453
|
return (0, graphql_1.extendSchema)(schema, (0, graphql_1.parse)(customFieldTypeDefs));
|
|
@@ -450,17 +458,17 @@ function addPaymentMethodQuoteCustomFields(typeDefsOrSchema, paymentMethodCustom
|
|
|
450
458
|
let customFieldTypeDefs = '';
|
|
451
459
|
const publicCustomFields = paymentMethodCustomFields.filter(f => f.public !== false);
|
|
452
460
|
if (0 < publicCustomFields.length) {
|
|
453
|
-
customFieldTypeDefs = `
|
|
454
|
-
extend type PaymentMethodQuote {
|
|
455
|
-
customFields: PaymentMethodCustomFields
|
|
456
|
-
}
|
|
461
|
+
customFieldTypeDefs = `
|
|
462
|
+
extend type PaymentMethodQuote {
|
|
463
|
+
customFields: PaymentMethodCustomFields
|
|
464
|
+
}
|
|
457
465
|
`;
|
|
458
466
|
}
|
|
459
467
|
else {
|
|
460
|
-
customFieldTypeDefs = `
|
|
461
|
-
extend type PaymentMethodQuote {
|
|
462
|
-
customFields: JSON
|
|
463
|
-
}
|
|
468
|
+
customFieldTypeDefs = `
|
|
469
|
+
extend type PaymentMethodQuote {
|
|
470
|
+
customFields: JSON
|
|
471
|
+
}
|
|
464
472
|
`;
|
|
465
473
|
}
|
|
466
474
|
return (0, graphql_1.extendSchema)(schema, (0, graphql_1.parse)(customFieldTypeDefs));
|