@vendure/core 1.7.3 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/api-internal-modules.js +2 -0
- package/dist/api/api-internal-modules.js.map +1 -1
- package/dist/api/config/generate-resolvers.d.ts +18 -0
- package/dist/api/config/graphql-custom-fields.js +16 -0
- package/dist/api/config/graphql-custom-fields.js.map +1 -1
- package/dist/api/resolvers/admin/collection.resolver.d.ts +4 -5
- package/dist/api/resolvers/admin/collection.resolver.js +44 -17
- package/dist/api/resolvers/admin/collection.resolver.js.map +1 -1
- package/dist/api/resolvers/admin/draft-order.resolver.d.ts +25 -0
- package/dist/api/resolvers/admin/draft-order.resolver.js +232 -0
- package/dist/api/resolvers/admin/draft-order.resolver.js.map +1 -0
- package/dist/api/resolvers/admin/facet.resolver.d.ts +5 -1
- package/dist/api/resolvers/admin/facet.resolver.js +39 -1
- package/dist/api/resolvers/admin/facet.resolver.js.map +1 -1
- package/dist/api/resolvers/admin/product.resolver.d.ts +4 -1
- package/dist/api/resolvers/admin/product.resolver.js +40 -0
- package/dist/api/resolvers/admin/product.resolver.js.map +1 -1
- package/dist/api/resolvers/entity/collection-entity.resolver.d.ts +5 -2
- package/dist/api/resolvers/entity/collection-entity.resolver.js +24 -2
- package/dist/api/resolvers/entity/collection-entity.resolver.js.map +1 -1
- package/dist/api/schema/admin-api/collection.api.graphql +19 -0
- package/dist/api/schema/admin-api/facet.api.graphql +30 -0
- package/dist/api/schema/admin-api/order.api.graphql +40 -0
- package/dist/api/schema/admin-api/product.api.graphql +9 -0
- package/dist/api/schema/common/common-error-results.graphql +21 -0
- package/dist/api/schema/common/common-types.graphql +15 -0
- package/dist/api/schema/shop-api/shop-error-results.graphql +0 -21
- package/dist/api/schema/shop-api/shop.api.graphql +0 -13
- package/dist/common/configurable-operation.js +1 -1
- package/dist/common/configurable-operation.js.map +1 -1
- package/dist/common/error/generated-graphql-admin-errors.d.ts +45 -0
- package/dist/common/error/generated-graphql-admin-errors.js +71 -2
- package/dist/common/error/generated-graphql-admin-errors.js.map +1 -1
- package/dist/config/order/changed-price-handling-strategy.d.ts +2 -1
- package/dist/config/order/order-item-price-calculation-strategy.d.ts +2 -1
- package/dist/config/promotion/actions/facet-values-percentage-discount-action.d.ts +1 -1
- package/dist/config/promotion/actions/facet-values-percentage-discount-action.js +1 -1
- package/dist/config/promotion/actions/facet-values-percentage-discount-action.js.map +1 -1
- package/dist/config/promotion/actions/order-fixed-discount-action.js +2 -1
- package/dist/config/promotion/actions/order-fixed-discount-action.js.map +1 -1
- package/dist/config/promotion/actions/order-percentage-discount-action.d.ts +1 -1
- package/dist/config/promotion/actions/order-percentage-discount-action.js +1 -1
- package/dist/config/promotion/actions/order-percentage-discount-action.js.map +1 -1
- package/dist/config/promotion/actions/product-percentage-discount-action.d.ts +1 -1
- package/dist/config/promotion/actions/product-percentage-discount-action.js +1 -1
- package/dist/config/promotion/actions/product-percentage-discount-action.js.map +1 -1
- package/dist/config/promotion/index.d.ts +10 -2
- package/dist/config/promotion/promotion-action.d.ts +55 -7
- package/dist/config/promotion/promotion-action.js +24 -8
- package/dist/config/promotion/promotion-action.js.map +1 -1
- package/dist/config/promotion/promotion-condition.d.ts +3 -2
- package/dist/config/promotion/promotion-condition.js +2 -2
- package/dist/config/promotion/promotion-condition.js.map +1 -1
- package/dist/config/session-cache/session-cache-strategy.d.ts +75 -1
- package/dist/entity/promotion/promotion.entity.d.ts +2 -0
- package/dist/entity/promotion/promotion.entity.js +16 -4
- package/dist/entity/promotion/promotion.entity.js.map +1 -1
- package/dist/i18n/messages/en.json +5 -1
- package/dist/plugin/default-search-plugin/search-strategy/mysql-search-strategy.js +6 -1
- package/dist/plugin/default-search-plugin/search-strategy/mysql-search-strategy.js.map +1 -1
- package/dist/service/helpers/list-query-builder/list-query-builder.js +13 -1
- package/dist/service/helpers/list-query-builder/list-query-builder.js.map +1 -1
- package/dist/service/helpers/order-calculator/order-calculator.d.ts +1 -0
- package/dist/service/helpers/order-calculator/order-calculator.js +11 -0
- package/dist/service/helpers/order-calculator/order-calculator.js.map +1 -1
- package/dist/service/helpers/order-modifier/order-modifier.js +7 -17
- package/dist/service/helpers/order-modifier/order-modifier.js.map +1 -1
- package/dist/service/helpers/order-state-machine/order-state-machine.js +0 -1
- package/dist/service/helpers/order-state-machine/order-state-machine.js.map +1 -1
- package/dist/service/helpers/order-state-machine/order-state.d.ts +1 -1
- package/dist/service/helpers/order-state-machine/order-state.js +4 -1
- package/dist/service/helpers/order-state-machine/order-state.js.map +1 -1
- package/dist/service/index.d.ts +2 -0
- package/dist/service/index.js +2 -0
- package/dist/service/index.js.map +1 -1
- package/dist/service/services/collection.service.d.ts +14 -2
- package/dist/service/services/collection.service.js +69 -3
- package/dist/service/services/collection.service.js.map +1 -1
- package/dist/service/services/facet-value.service.d.ts +1 -1
- package/dist/service/services/facet-value.service.js +21 -7
- package/dist/service/services/facet-value.service.js.map +1 -1
- package/dist/service/services/facet.service.d.ts +15 -2
- package/dist/service/services/facet.service.js +80 -3
- package/dist/service/services/facet.service.js.map +1 -1
- package/dist/service/services/order-testing.service.js +1 -1
- package/dist/service/services/order-testing.service.js.map +1 -1
- package/dist/service/services/order.service.d.ts +3 -1
- package/dist/service/services/order.service.js +57 -35
- package/dist/service/services/order.service.js.map +1 -1
- package/dist/service/services/product.service.js +14 -19
- package/dist/service/services/product.service.js.map +1 -1
- package/dist/service/services/promotion.service.d.ts +8 -1
- package/dist/service/services/promotion.service.js +45 -2
- package/dist/service/services/promotion.service.js.map +1 -1
- package/dist/service/services/role.service.d.ts +5 -0
- package/dist/service/services/role.service.js +13 -1
- package/dist/service/services/role.service.js.map +1 -1
- package/package.json +4 -4
|
@@ -55,6 +55,9 @@ let FacetResolver = class FacetResolver {
|
|
|
55
55
|
async deleteFacet(ctx, args) {
|
|
56
56
|
return this.facetService.delete(ctx, args.id, args.force || false);
|
|
57
57
|
}
|
|
58
|
+
async deleteFacets(ctx, args) {
|
|
59
|
+
return Promise.all(args.ids.map(id => this.facetService.delete(ctx, id, args.force || false)));
|
|
60
|
+
}
|
|
58
61
|
async createFacetValues(ctx, args) {
|
|
59
62
|
const { input } = args;
|
|
60
63
|
const facetId = input[0].facetId;
|
|
@@ -74,13 +77,18 @@ let FacetResolver = class FacetResolver {
|
|
|
74
77
|
return Promise.all(input.map(facetValue => this.facetValueService.update(ctx, facetValue)));
|
|
75
78
|
}
|
|
76
79
|
async deleteFacetValues(ctx, args) {
|
|
77
|
-
// return Promise.all(args.ids.map(id => this.facetValueService.delete(ctx, id, args.force || false)));
|
|
78
80
|
const results = [];
|
|
79
81
|
for (const id of args.ids) {
|
|
80
82
|
results.push(await this.facetValueService.delete(ctx, id, args.force || false));
|
|
81
83
|
}
|
|
82
84
|
return results;
|
|
83
85
|
}
|
|
86
|
+
async assignFacetsToChannel(ctx, args) {
|
|
87
|
+
return await this.facetService.assignFacetsToChannel(ctx, args.input);
|
|
88
|
+
}
|
|
89
|
+
async removeFacetsFromChannel(ctx, args) {
|
|
90
|
+
return await this.facetService.removeFacetsFromChannel(ctx, args.input);
|
|
91
|
+
}
|
|
84
92
|
};
|
|
85
93
|
__decorate([
|
|
86
94
|
graphql_1.Query(),
|
|
@@ -132,6 +140,16 @@ __decorate([
|
|
|
132
140
|
__metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
|
|
133
141
|
__metadata("design:returntype", Promise)
|
|
134
142
|
], FacetResolver.prototype, "deleteFacet", null);
|
|
143
|
+
__decorate([
|
|
144
|
+
transaction_decorator_1.Transaction(),
|
|
145
|
+
graphql_1.Mutation(),
|
|
146
|
+
allow_decorator_1.Allow(generated_types_1.Permission.DeleteCatalog, generated_types_1.Permission.DeleteFacet),
|
|
147
|
+
__param(0, request_context_decorator_1.Ctx()),
|
|
148
|
+
__param(1, graphql_1.Args()),
|
|
149
|
+
__metadata("design:type", Function),
|
|
150
|
+
__metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
|
|
151
|
+
__metadata("design:returntype", Promise)
|
|
152
|
+
], FacetResolver.prototype, "deleteFacets", null);
|
|
135
153
|
__decorate([
|
|
136
154
|
transaction_decorator_1.Transaction(),
|
|
137
155
|
graphql_1.Mutation(),
|
|
@@ -162,6 +180,26 @@ __decorate([
|
|
|
162
180
|
__metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
|
|
163
181
|
__metadata("design:returntype", Promise)
|
|
164
182
|
], FacetResolver.prototype, "deleteFacetValues", null);
|
|
183
|
+
__decorate([
|
|
184
|
+
transaction_decorator_1.Transaction(),
|
|
185
|
+
graphql_1.Mutation(),
|
|
186
|
+
allow_decorator_1.Allow(generated_types_1.Permission.CreateCatalog, generated_types_1.Permission.CreateFacet),
|
|
187
|
+
__param(0, request_context_decorator_1.Ctx()),
|
|
188
|
+
__param(1, graphql_1.Args()),
|
|
189
|
+
__metadata("design:type", Function),
|
|
190
|
+
__metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
|
|
191
|
+
__metadata("design:returntype", Promise)
|
|
192
|
+
], FacetResolver.prototype, "assignFacetsToChannel", null);
|
|
193
|
+
__decorate([
|
|
194
|
+
transaction_decorator_1.Transaction(),
|
|
195
|
+
graphql_1.Mutation(),
|
|
196
|
+
allow_decorator_1.Allow(generated_types_1.Permission.DeleteCatalog, generated_types_1.Permission.DeleteFacet),
|
|
197
|
+
__param(0, request_context_decorator_1.Ctx()),
|
|
198
|
+
__param(1, graphql_1.Args()),
|
|
199
|
+
__metadata("design:type", Function),
|
|
200
|
+
__metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
|
|
201
|
+
__metadata("design:returntype", Promise)
|
|
202
|
+
], FacetResolver.prototype, "removeFacetsFromChannel", null);
|
|
165
203
|
FacetResolver = __decorate([
|
|
166
204
|
graphql_1.Resolver('Facet'),
|
|
167
205
|
__metadata("design:paramtypes", [facet_service_1.FacetService,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facet.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/admin/facet.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAkE;AAClE,
|
|
1
|
+
{"version":3,"file":"facet.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/admin/facet.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAkE;AAClE,yEAe6C;AAG7C,yDAAmE;AAGnE,mEAA+D;AAE/D,qEAA2D;AAC3D,uFAAkF;AAClF,2EAAuE;AACvE,kEAA8D;AAC9D,sEAAyD;AACzD,8EAAgF;AAChF,0FAAiE;AACjE,kFAAqE;AAGrE,IAAa,aAAa,GAA1B,MAAa,aAAa;IACtB,YACY,YAA0B,EAC1B,iBAAoC,EACpC,aAA4B;QAF5B,iBAAY,GAAZ,YAAY,CAAc;QAC1B,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,kBAAa,GAAb,aAAa,CAAe;IACrC,CAAC;IAIJ,MAAM,CACK,GAAmB,EAClB,IAAqB,EACX,SAA+B;QAEjD,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,IAAI,SAAS,EAAE,SAAS,CAAC,CAAC;IAChF,CAAC;IAID,KAAK,CAAC,KAAK,CACA,GAAmB,EAClB,IAAoB,EACV,SAA+B;QAEjD,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;IAC9D,CAAC;IAKD,KAAK,CAAC,WAAW,CACN,GAAmB,EAClB,IAA6B;QAErC,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;QACvB,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QAE9D,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE;YACrC,KAAK,MAAM,KAAK,IAAI,K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,4 +1,4 @@
|
|
|
1
|
-
import { DeletionResponse, MutationAddOptionGroupToProductArgs, MutationAssignProductsToChannelArgs, MutationAssignProductVariantsToChannelArgs, MutationCreateProductArgs, MutationCreateProductVariantsArgs, MutationDeleteProductArgs, MutationDeleteProductVariantArgs, MutationRemoveOptionGroupFromProductArgs, MutationRemoveProductsFromChannelArgs, MutationRemoveProductVariantsFromChannelArgs, MutationUpdateProductArgs, MutationUpdateProductVariantsArgs, QueryProductArgs, QueryProductsArgs, QueryProductVariantArgs, QueryProductVariantsArgs, RemoveOptionGroupFromProductResult } from '@vendure/common/lib/generated-types';
|
|
1
|
+
import { DeletionResponse, MutationAddOptionGroupToProductArgs, MutationAssignProductsToChannelArgs, MutationAssignProductVariantsToChannelArgs, MutationCreateProductArgs, MutationCreateProductVariantsArgs, MutationDeleteProductArgs, MutationDeleteProductsArgs, MutationDeleteProductVariantArgs, MutationDeleteProductVariantsArgs, MutationRemoveOptionGroupFromProductArgs, MutationRemoveProductsFromChannelArgs, MutationRemoveProductVariantsFromChannelArgs, MutationUpdateProductArgs, MutationUpdateProductsArgs, MutationUpdateProductVariantsArgs, QueryProductArgs, QueryProductsArgs, QueryProductVariantArgs, QueryProductVariantsArgs, RemoveOptionGroupFromProductResult } from '@vendure/common/lib/generated-types';
|
|
2
2
|
import { PaginatedList } from '@vendure/common/lib/shared-types';
|
|
3
3
|
import { ErrorResultUnion } from '../../../common/error/error-result';
|
|
4
4
|
import { Translated } from '../../../common/types/locale-types';
|
|
@@ -20,12 +20,15 @@ export declare class ProductResolver {
|
|
|
20
20
|
productVariant(ctx: RequestContext, args: QueryProductVariantArgs): Promise<Translated<ProductVariant> | undefined>;
|
|
21
21
|
createProduct(ctx: RequestContext, args: MutationCreateProductArgs): Promise<Translated<Product>>;
|
|
22
22
|
updateProduct(ctx: RequestContext, args: MutationUpdateProductArgs): Promise<Translated<Product>>;
|
|
23
|
+
updateProducts(ctx: RequestContext, args: MutationUpdateProductsArgs): Promise<Array<Translated<Product>>>;
|
|
23
24
|
deleteProduct(ctx: RequestContext, args: MutationDeleteProductArgs): Promise<DeletionResponse>;
|
|
25
|
+
deleteProducts(ctx: RequestContext, args: MutationDeleteProductsArgs): Promise<DeletionResponse[]>;
|
|
24
26
|
addOptionGroupToProduct(ctx: RequestContext, args: MutationAddOptionGroupToProductArgs): Promise<Translated<Product>>;
|
|
25
27
|
removeOptionGroupFromProduct(ctx: RequestContext, args: MutationRemoveOptionGroupFromProductArgs): Promise<ErrorResultUnion<RemoveOptionGroupFromProductResult, Translated<Product>>>;
|
|
26
28
|
createProductVariants(ctx: RequestContext, args: MutationCreateProductVariantsArgs): Promise<Array<Translated<ProductVariant>>>;
|
|
27
29
|
updateProductVariants(ctx: RequestContext, args: MutationUpdateProductVariantsArgs): Promise<Array<Translated<ProductVariant>>>;
|
|
28
30
|
deleteProductVariant(ctx: RequestContext, args: MutationDeleteProductVariantArgs): Promise<DeletionResponse>;
|
|
31
|
+
deleteProductVariants(ctx: RequestContext, args: MutationDeleteProductVariantsArgs): Promise<DeletionResponse[]>;
|
|
29
32
|
assignProductsToChannel(ctx: RequestContext, args: MutationAssignProductsToChannelArgs): Promise<Array<Translated<Product>>>;
|
|
30
33
|
removeProductsFromChannel(ctx: RequestContext, args: MutationRemoveProductsFromChannelArgs): Promise<Array<Translated<Product>>>;
|
|
31
34
|
assignProductVariantsToChannel(ctx: RequestContext, args: MutationAssignProductVariantsToChannelArgs): Promise<Array<Translated<ProductVariant>>>;
|
|
@@ -67,9 +67,16 @@ let ProductResolver = class ProductResolver {
|
|
|
67
67
|
const { input } = args;
|
|
68
68
|
return await this.productService.update(ctx, input);
|
|
69
69
|
}
|
|
70
|
+
async updateProducts(ctx, args) {
|
|
71
|
+
const { input } = args;
|
|
72
|
+
return await Promise.all(args.input.map(i => this.productService.update(ctx, i)));
|
|
73
|
+
}
|
|
70
74
|
async deleteProduct(ctx, args) {
|
|
71
75
|
return this.productService.softDelete(ctx, args.id);
|
|
72
76
|
}
|
|
77
|
+
async deleteProducts(ctx, args) {
|
|
78
|
+
return Promise.all(args.ids.map(id => this.productService.softDelete(ctx, id)));
|
|
79
|
+
}
|
|
73
80
|
async addOptionGroupToProduct(ctx, args) {
|
|
74
81
|
const { productId, optionGroupId } = args;
|
|
75
82
|
return this.productService.addOptionGroupToProduct(ctx, productId, optionGroupId);
|
|
@@ -89,6 +96,9 @@ let ProductResolver = class ProductResolver {
|
|
|
89
96
|
async deleteProductVariant(ctx, args) {
|
|
90
97
|
return this.productVariantService.softDelete(ctx, args.id);
|
|
91
98
|
}
|
|
99
|
+
async deleteProductVariants(ctx, args) {
|
|
100
|
+
return Promise.all(args.ids.map(id => this.productVariantService.softDelete(ctx, id)));
|
|
101
|
+
}
|
|
92
102
|
async assignProductsToChannel(ctx, args) {
|
|
93
103
|
return this.productService.assignProductsToChannel(ctx, args.input);
|
|
94
104
|
}
|
|
@@ -161,6 +171,16 @@ __decorate([
|
|
|
161
171
|
__metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
|
|
162
172
|
__metadata("design:returntype", Promise)
|
|
163
173
|
], ProductResolver.prototype, "updateProduct", null);
|
|
174
|
+
__decorate([
|
|
175
|
+
transaction_decorator_1.Transaction(),
|
|
176
|
+
graphql_1.Mutation(),
|
|
177
|
+
allow_decorator_1.Allow(generated_types_1.Permission.UpdateCatalog, generated_types_1.Permission.UpdateProduct),
|
|
178
|
+
__param(0, request_context_decorator_1.Ctx()),
|
|
179
|
+
__param(1, graphql_1.Args()),
|
|
180
|
+
__metadata("design:type", Function),
|
|
181
|
+
__metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
|
|
182
|
+
__metadata("design:returntype", Promise)
|
|
183
|
+
], ProductResolver.prototype, "updateProducts", null);
|
|
164
184
|
__decorate([
|
|
165
185
|
transaction_decorator_1.Transaction(),
|
|
166
186
|
graphql_1.Mutation(),
|
|
@@ -171,6 +191,16 @@ __decorate([
|
|
|
171
191
|
__metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
|
|
172
192
|
__metadata("design:returntype", Promise)
|
|
173
193
|
], ProductResolver.prototype, "deleteProduct", null);
|
|
194
|
+
__decorate([
|
|
195
|
+
transaction_decorator_1.Transaction(),
|
|
196
|
+
graphql_1.Mutation(),
|
|
197
|
+
allow_decorator_1.Allow(generated_types_1.Permission.DeleteCatalog, generated_types_1.Permission.DeleteProduct),
|
|
198
|
+
__param(0, request_context_decorator_1.Ctx()),
|
|
199
|
+
__param(1, graphql_1.Args()),
|
|
200
|
+
__metadata("design:type", Function),
|
|
201
|
+
__metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
|
|
202
|
+
__metadata("design:returntype", Promise)
|
|
203
|
+
], ProductResolver.prototype, "deleteProducts", null);
|
|
174
204
|
__decorate([
|
|
175
205
|
transaction_decorator_1.Transaction(),
|
|
176
206
|
graphql_1.Mutation(),
|
|
@@ -221,6 +251,16 @@ __decorate([
|
|
|
221
251
|
__metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
|
|
222
252
|
__metadata("design:returntype", Promise)
|
|
223
253
|
], ProductResolver.prototype, "deleteProductVariant", null);
|
|
254
|
+
__decorate([
|
|
255
|
+
transaction_decorator_1.Transaction(),
|
|
256
|
+
graphql_1.Mutation(),
|
|
257
|
+
allow_decorator_1.Allow(generated_types_1.Permission.DeleteCatalog, generated_types_1.Permission.DeleteProduct),
|
|
258
|
+
__param(0, request_context_decorator_1.Ctx()),
|
|
259
|
+
__param(1, graphql_1.Args()),
|
|
260
|
+
__metadata("design:type", Function),
|
|
261
|
+
__metadata("design:paramtypes", [request_context_1.RequestContext, Object]),
|
|
262
|
+
__metadata("design:returntype", Promise)
|
|
263
|
+
], ProductResolver.prototype, "deleteProductVariants", null);
|
|
224
264
|
__decorate([
|
|
225
265
|
transaction_decorator_1.Transaction(),
|
|
226
266
|
graphql_1.Mutation(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/admin/product.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAkE;AAClE,
|
|
1
|
+
{"version":3,"file":"product.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/admin/product.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAkE;AAClE,yEAuB6C;AAI7C,yDAA8D;AAE9D,mGAAwF;AACxF,2EAAiE;AACjE,uFAAkF;AAClF,+FAA0F;AAC1F,+EAA2E;AAC3E,kEAA8D;AAC9D,sEAAyD;AACzD,8EAAgF;AAChF,0FAAiE;AACjE,kFAAqE;AAGrE,IAAa,eAAe,GAA5B,MAAa,eAAe;IACxB,YACY,cAA8B,EAC9B,qBAA4C,EAC5C,iBAAoC;QAFpC,mBAAc,GAAd,cAAc,CAAgB;QAC9B,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,sBAAiB,GAAjB,iBAAiB,CAAmB;IAC7C,CAAC;IAIJ,KAAK,CAAC,QAAQ,CACH,GAAmB,EAClB,IAAuB,EAC+B,SAAiC;QAE/F,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,IAAI,SAAS,EAAE,SAAS,CAAC,CAAC;IAClF,CAAC;IAID,KAAK,CAAC,OAAO,CACF,GAAmB,EAClB,IAAsB,EACgC,SAAiC;QAE/F,IAAI,IAAI,CAAC,EAAE,EAAE;YACT,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;YAC3E,IAAI,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,EAAE;gBACpD,MAAM,IAAI,uBAAc,CAAC,gCAAgC,CAAC,CAAC;aAC9D;YACD,OAAO,OAAO,CAAC;SAClB;aAAM,IAAI,IAAI,CAAC,IAAI,EAAE;YAClB,OAAO,IAAI,CAAC,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AAA,cAAI,EAAE,CAAA;;qCADK,gCAAc;;qEAI7B;AAKD;IAHC,mCAAW,EAAE;IACb,kBAAQ,EAAE;IACV,uBAAK,CAAC,4BAAU,CAAC,aAAa,EAAE,4BAAU,CAAC,aAAa,CAAC;IAErD,WAAA,+BAAG,EAAE,CAAA;IACL,WAAA,cAAI,EAAE,CAAA;;qCADK,gCAAc;;uEAI7B;AA5NQ,eAAe;IAD3B,kBAAQ,EAAE;qCAGqB,gCAAc;QACP,+CAAqB;QACzB,uCAAiB;GAJvC,eAAe,CA6N3B;AA7NY,0CAAe"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CollectionBreadcrumb, ProductVariantListOptions } from '@vendure/common/lib/generated-types';
|
|
1
|
+
import { CollectionBreadcrumb, ConfigurableOperation, ProductVariantListOptions } from '@vendure/common/lib/generated-types';
|
|
2
2
|
import { PaginatedList } from '@vendure/common/lib/shared-types';
|
|
3
3
|
import { Translated } from '../../../common/types/locale-types';
|
|
4
4
|
import { Asset, Collection, ProductVariant } from '../../../entity';
|
|
@@ -6,6 +6,7 @@ import { LocaleStringHydrator } from '../../../service/helpers/locale-string-hyd
|
|
|
6
6
|
import { AssetService } from '../../../service/services/asset.service';
|
|
7
7
|
import { CollectionService } from '../../../service/services/collection.service';
|
|
8
8
|
import { ProductVariantService } from '../../../service/services/product-variant.service';
|
|
9
|
+
import { ConfigurableOperationCodec } from '../../common/configurable-operation-codec';
|
|
9
10
|
import { ApiType } from '../../common/get-api-type';
|
|
10
11
|
import { RequestContext } from '../../common/request-context';
|
|
11
12
|
import { RelationPaths } from '../../decorators/relations.decorator';
|
|
@@ -14,7 +15,8 @@ export declare class CollectionEntityResolver {
|
|
|
14
15
|
private collectionService;
|
|
15
16
|
private assetService;
|
|
16
17
|
private localeStringHydrator;
|
|
17
|
-
|
|
18
|
+
private configurableOperationCodec;
|
|
19
|
+
constructor(productVariantService: ProductVariantService, collectionService: CollectionService, assetService: AssetService, localeStringHydrator: LocaleStringHydrator, configurableOperationCodec: ConfigurableOperationCodec);
|
|
18
20
|
name(ctx: RequestContext, collection: Collection): Promise<string>;
|
|
19
21
|
slug(ctx: RequestContext, collection: Collection): Promise<string>;
|
|
20
22
|
description(ctx: RequestContext, collection: Collection): Promise<string>;
|
|
@@ -27,4 +29,5 @@ export declare class CollectionEntityResolver {
|
|
|
27
29
|
children(ctx: RequestContext, collection: Collection, apiType: ApiType): Promise<Collection[]>;
|
|
28
30
|
featuredAsset(ctx: RequestContext, collection: Collection): Promise<Asset | undefined>;
|
|
29
31
|
assets(ctx: RequestContext, collection: Collection): Promise<Asset[] | undefined>;
|
|
32
|
+
filters(ctx: RequestContext, collection: Collection): ConfigurableOperation[];
|
|
30
33
|
}
|
|
@@ -13,22 +13,26 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.CollectionEntityResolver = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
16
17
|
const graphql_1 = require("@nestjs/graphql");
|
|
18
|
+
const index_1 = require("../../../config/index");
|
|
17
19
|
const entity_1 = require("../../../entity");
|
|
18
20
|
const locale_string_hydrator_1 = require("../../../service/helpers/locale-string-hydrator/locale-string-hydrator");
|
|
19
21
|
const asset_service_1 = require("../../../service/services/asset.service");
|
|
20
22
|
const collection_service_1 = require("../../../service/services/collection.service");
|
|
21
23
|
const product_variant_service_1 = require("../../../service/services/product-variant.service");
|
|
24
|
+
const configurable_operation_codec_1 = require("../../common/configurable-operation-codec");
|
|
22
25
|
const request_context_1 = require("../../common/request-context");
|
|
23
26
|
const api_decorator_1 = require("../../decorators/api.decorator");
|
|
24
27
|
const relations_decorator_1 = require("../../decorators/relations.decorator");
|
|
25
28
|
const request_context_decorator_1 = require("../../decorators/request-context.decorator");
|
|
26
29
|
let CollectionEntityResolver = class CollectionEntityResolver {
|
|
27
|
-
constructor(productVariantService, collectionService, assetService, localeStringHydrator) {
|
|
30
|
+
constructor(productVariantService, collectionService, assetService, localeStringHydrator, configurableOperationCodec) {
|
|
28
31
|
this.productVariantService = productVariantService;
|
|
29
32
|
this.collectionService = collectionService;
|
|
30
33
|
this.assetService = assetService;
|
|
31
34
|
this.localeStringHydrator = localeStringHydrator;
|
|
35
|
+
this.configurableOperationCodec = configurableOperationCodec;
|
|
32
36
|
}
|
|
33
37
|
name(ctx, collection) {
|
|
34
38
|
return this.localeStringHydrator.hydrateLocaleStringField(ctx, collection, 'name');
|
|
@@ -81,6 +85,15 @@ let CollectionEntityResolver = class CollectionEntityResolver {
|
|
|
81
85
|
async assets(ctx, collection) {
|
|
82
86
|
return this.assetService.getEntityAssets(ctx, collection);
|
|
83
87
|
}
|
|
88
|
+
filters(ctx, collection) {
|
|
89
|
+
try {
|
|
90
|
+
return this.configurableOperationCodec.encodeConfigurableOperationIds(index_1.CollectionFilter, collection.filters);
|
|
91
|
+
}
|
|
92
|
+
catch (e) {
|
|
93
|
+
common_1.Logger.error(`Could not decode the collection filter arguments for "${collection.name}" (id: ${collection.id}). Error message: ${e.message}`);
|
|
94
|
+
return [];
|
|
95
|
+
}
|
|
96
|
+
}
|
|
84
97
|
};
|
|
85
98
|
__decorate([
|
|
86
99
|
graphql_1.ResolveField(),
|
|
@@ -172,12 +185,21 @@ __decorate([
|
|
|
172
185
|
__metadata("design:paramtypes", [request_context_1.RequestContext, entity_1.Collection]),
|
|
173
186
|
__metadata("design:returntype", Promise)
|
|
174
187
|
], CollectionEntityResolver.prototype, "assets", null);
|
|
188
|
+
__decorate([
|
|
189
|
+
graphql_1.ResolveField(),
|
|
190
|
+
__param(0, request_context_decorator_1.Ctx()),
|
|
191
|
+
__param(1, graphql_1.Parent()),
|
|
192
|
+
__metadata("design:type", Function),
|
|
193
|
+
__metadata("design:paramtypes", [request_context_1.RequestContext, entity_1.Collection]),
|
|
194
|
+
__metadata("design:returntype", Array)
|
|
195
|
+
], CollectionEntityResolver.prototype, "filters", null);
|
|
175
196
|
CollectionEntityResolver = __decorate([
|
|
176
197
|
graphql_1.Resolver('Collection'),
|
|
177
198
|
__metadata("design:paramtypes", [product_variant_service_1.ProductVariantService,
|
|
178
199
|
collection_service_1.CollectionService,
|
|
179
200
|
asset_service_1.AssetService,
|
|
180
|
-
locale_string_hydrator_1.LocaleStringHydrator
|
|
201
|
+
locale_string_hydrator_1.LocaleStringHydrator,
|
|
202
|
+
configurable_operation_codec_1.ConfigurableOperationCodec])
|
|
181
203
|
], CollectionEntityResolver);
|
|
182
204
|
exports.CollectionEntityResolver = CollectionEntityResolver;
|
|
183
205
|
//# sourceMappingURL=collection-entity.resolver.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-entity.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/entity/collection-entity.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAuE;
|
|
1
|
+
{"version":3,"file":"collection-entity.resolver.js","sourceRoot":"","sources":["../../../../src/api/resolvers/entity/collection-entity.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAwC;AACxC,6CAAuE;AAUvE,iDAAyD;AACzD,4CAA6E;AAC7E,mHAA8G;AAC9G,2EAAuE;AACvE,qFAAiF;AACjF,+FAA0F;AAC1F,4FAAuF;AAEvF,kEAA8D;AAC9D,kEAAqD;AACrD,8EAAgF;AAChF,0FAAiE;AAGjE,IAAa,wBAAwB,GAArC,MAAa,wBAAwB;IACjC,YACY,qBAA4C,EAC5C,iBAAoC,EACpC,YAA0B,EAC1B,oBAA0C,EAC1C,0BAAsD;QAJtD,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,iBAAY,GAAZ,YAAY,CAAc;QAC1B,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,+BAA0B,GAA1B,0BAA0B,CAA4B;IAC/D,CAAC;IAGJ,IAAI,CAAQ,GAAmB,EAAY,UAA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,uBAAc,EAAE,IAAI,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;;qCAJ5C,gCAAc;QACJ,mBAAU;;+DAgBnC;AAGD;IADC,sBAAY,EAAE;IAEV,WAAA,+BAAG,EAAE,CAAA;IACL,WAAA,gBAAM,EAAE,CAAA;;qCADG,gCAAc;QACJ,mBAAU;;2DAGnC;AAGD;IADC,sBAAY,EAAE;IAEV,WAAA,+BAAG,EAAE,CAAA;IACL,WAAA,gBAAM,EAAE,CAAA;IACR,WAAA,mBAAG,EAAE,CAAA;;qCAFM,gCAAc;QACJ,mBAAU;;sDAUnC;AAGD;IADC,sBAAY,EAAE;IAEV,WAAA,+BAAG,EAAE,CAAA;IACL,WAAA,gBAAM,EAAE,CAAA;IACR,WAAA,mBAAG,EAAE,CAAA;;qCAFM,gCAAc;QACJ,mBAAU;;wDAUnC;AAGD;IADC,sBAAY,EAAE;IAEV,WAAA,+BAAG,EAAE,CAAA;IACL,WAAA,gBAAM,EAAE,CAAA;;qCADG,gCAAc;QACJ,mBAAU;;6DAMnC;AAGD;IADC,sBAAY,EAAE;IACD,WAAA,+BAAG,EAAE,CAAA;IAAuB,WAAA,gBAAM,EAAE,CAAA;;qCAAzB,gCAAc,EAAwB,mBAAU;;sDAExE;AAGD;IADC,sBAAY,EAAE;IACN,WAAA,+BAAG,EAAE,CAAA;IAAuB,WAAA,gBAAM,EAAE,CAAA;;qCAAzB,gCAAc,EAAwB,mBAAU;;uDAYnE;AArHQ,wBAAwB;IADpC,kBAAQ,CAAC,YAAY,CAAC;qCAGgB,+CAAqB;QACzB,sCAAiB;QACtB,4BAAY;QACJ,6CAAoB;QACd,yDAA0B;GANzD,wBAAwB,CAsHpC;AAtHY,4DAAwB"}
|
|
@@ -17,8 +17,17 @@ type Mutation {
|
|
|
17
17
|
"Delete a Collection and all of its descendants"
|
|
18
18
|
deleteCollection(id: ID!): DeletionResponse!
|
|
19
19
|
|
|
20
|
+
"Delete multiple Collections and all of their descendants"
|
|
21
|
+
deleteCollections(ids: [ID!]!): [DeletionResponse!]!
|
|
22
|
+
|
|
20
23
|
"Move a Collection to a different parent or index"
|
|
21
24
|
moveCollection(input: MoveCollectionInput!): Collection!
|
|
25
|
+
|
|
26
|
+
"Assigns Collections to the specified Channel"
|
|
27
|
+
assignCollectionsToChannel(input: AssignCollectionsToChannelInput!): [Collection!]!
|
|
28
|
+
|
|
29
|
+
"Removes Collections from the specified Channel"
|
|
30
|
+
removeCollectionsFromChannel(input: RemoveCollectionsFromChannelInput!): [Collection!]!
|
|
22
31
|
}
|
|
23
32
|
|
|
24
33
|
# generated by generateListOptions function
|
|
@@ -68,3 +77,13 @@ input UpdateCollectionInput {
|
|
|
68
77
|
filters: [ConfigurableOperationInput!]
|
|
69
78
|
translations: [UpdateCollectionTranslationInput!]
|
|
70
79
|
}
|
|
80
|
+
|
|
81
|
+
input AssignCollectionsToChannelInput {
|
|
82
|
+
collectionIds: [ID!]!
|
|
83
|
+
channelId: ID!
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
input RemoveCollectionsFromChannelInput {
|
|
87
|
+
collectionIds: [ID!]!
|
|
88
|
+
channelId: ID!
|
|
89
|
+
}
|
|
@@ -13,6 +13,9 @@ type Mutation {
|
|
|
13
13
|
"Delete an existing Facet"
|
|
14
14
|
deleteFacet(id: ID!, force: Boolean): DeletionResponse!
|
|
15
15
|
|
|
16
|
+
"Delete multiple existing Facets"
|
|
17
|
+
deleteFacets(ids: [ID!]!, force: Boolean): [DeletionResponse!]!
|
|
18
|
+
|
|
16
19
|
"Create one or more FacetValues"
|
|
17
20
|
createFacetValues(input: [CreateFacetValueInput!]!): [FacetValue!]!
|
|
18
21
|
|
|
@@ -21,6 +24,12 @@ type Mutation {
|
|
|
21
24
|
|
|
22
25
|
"Delete one or more FacetValues"
|
|
23
26
|
deleteFacetValues(ids: [ID!]!, force: Boolean): [DeletionResponse!]!
|
|
27
|
+
|
|
28
|
+
"Assigns Facets to the specified Channel"
|
|
29
|
+
assignFacetsToChannel(input: AssignFacetsToChannelInput!): [Facet!]!
|
|
30
|
+
|
|
31
|
+
"Removes Facets from the specified Channel"
|
|
32
|
+
removeFacetsFromChannel(input: RemoveFacetsFromChannelInput!): [RemoveFacetFromChannelResult!]!
|
|
24
33
|
}
|
|
25
34
|
|
|
26
35
|
# generated by generateListOptions function
|
|
@@ -67,3 +76,24 @@ input UpdateFacetValueInput {
|
|
|
67
76
|
code: String
|
|
68
77
|
translations: [FacetValueTranslationInput!]
|
|
69
78
|
}
|
|
79
|
+
|
|
80
|
+
input AssignFacetsToChannelInput {
|
|
81
|
+
facetIds: [ID!]!
|
|
82
|
+
channelId: ID!
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
input RemoveFacetsFromChannelInput {
|
|
86
|
+
facetIds: [ID!]!
|
|
87
|
+
channelId: ID!
|
|
88
|
+
force: Boolean
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
type FacetInUseError implements ErrorResult {
|
|
92
|
+
errorCode: ErrorCode!
|
|
93
|
+
message: String!
|
|
94
|
+
facetCode: String!
|
|
95
|
+
productCount: Int!
|
|
96
|
+
variantCount: Int!
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
union RemoveFacetFromChannelResult = Facet | FacetInUseError
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
type Query {
|
|
2
2
|
order(id: ID!): Order
|
|
3
3
|
orders(options: OrderListOptions): OrderList!
|
|
4
|
+
"Returns a list of eligible shipping methods for the draft Order"
|
|
5
|
+
eligibleShippingMethodsForDraftOrder(orderId: ID!): [ShippingMethodQuote!]!
|
|
4
6
|
}
|
|
5
7
|
|
|
6
8
|
type Mutation {
|
|
@@ -32,6 +34,33 @@ type Mutation {
|
|
|
32
34
|
Payment.
|
|
33
35
|
"""
|
|
34
36
|
addManualPaymentToOrder(input: ManualPaymentInput!): AddManualPaymentToOrderResult!
|
|
37
|
+
"Creates a draft Order"
|
|
38
|
+
createDraftOrder: Order!
|
|
39
|
+
"Deletes a draft Order"
|
|
40
|
+
deleteDraftOrder(orderId: ID!): DeletionResponse!
|
|
41
|
+
"Adds an item to the draft Order."
|
|
42
|
+
addItemToDraftOrder(orderId: ID!, input: AddItemToDraftOrderInput!): UpdateOrderItemsResult!
|
|
43
|
+
"Adjusts a draft OrderLine. If custom fields are defined on the OrderLine entity, a third argument 'customFields' of type `OrderLineCustomFieldsInput` will be available."
|
|
44
|
+
adjustDraftOrderLine(orderId: ID!, input: AdjustDraftOrderLineInput!): UpdateOrderItemsResult!
|
|
45
|
+
"Remove an OrderLine from the draft Order"
|
|
46
|
+
removeDraftOrderLine(orderId: ID!, orderLineId: ID!): RemoveOrderItemsResult!
|
|
47
|
+
setCustomerForDraftOrder(
|
|
48
|
+
orderId: ID!
|
|
49
|
+
customerId: ID
|
|
50
|
+
input: CreateCustomerInput
|
|
51
|
+
): SetCustomerForDraftOrderResult!
|
|
52
|
+
"Sets the shipping address for a draft Order"
|
|
53
|
+
setDraftOrderShippingAddress(orderId: ID!, input: CreateAddressInput!): Order!
|
|
54
|
+
"Sets the billing address for a draft Order"
|
|
55
|
+
setDraftOrderBillingAddress(orderId: ID!, input: CreateAddressInput!): Order!
|
|
56
|
+
"Allows any custom fields to be set for the active order"
|
|
57
|
+
setDraftOrderCustomFields(orderId: ID!, input: UpdateOrderInput!): Order!
|
|
58
|
+
"Applies the given coupon code to the draft Order"
|
|
59
|
+
applyCouponCodeToDraftOrder(orderId: ID!, couponCode: String!): ApplyCouponCodeResult!
|
|
60
|
+
"Removes the given coupon code from the draft Order"
|
|
61
|
+
removeCouponCodeFromDraftOrder(orderId: ID!, couponCode: String!): Order
|
|
62
|
+
"Sets the shipping method by id, which can be obtained with the `eligibleShippingMethodsForDraftOrder` query"
|
|
63
|
+
setDraftOrderShippingMethod(orderId: ID!, shippingMethodId: ID!): SetOrderShippingMethodResult!
|
|
35
64
|
}
|
|
36
65
|
|
|
37
66
|
type Order {
|
|
@@ -173,6 +202,16 @@ input ManualPaymentInput {
|
|
|
173
202
|
metadata: JSON
|
|
174
203
|
}
|
|
175
204
|
|
|
205
|
+
input AddItemToDraftOrderInput {
|
|
206
|
+
productVariantId: ID!
|
|
207
|
+
quantity: Int!
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
input AdjustDraftOrderLineInput {
|
|
211
|
+
orderLineId: ID!
|
|
212
|
+
quantity: Int!
|
|
213
|
+
}
|
|
214
|
+
|
|
176
215
|
"Returned if the Payment settlement fails"
|
|
177
216
|
type SettlePaymentError implements ErrorResult {
|
|
178
217
|
errorCode: ErrorCode!
|
|
@@ -383,3 +422,4 @@ union ModifyOrderResult =
|
|
|
383
422
|
| CouponCodeInvalidError
|
|
384
423
|
| CouponCodeLimitError
|
|
385
424
|
union AddManualPaymentToOrderResult = Order | ManualPaymentStateError
|
|
425
|
+
union SetCustomerForDraftOrderResult = Order | EmailAddressConflictError
|
|
@@ -16,9 +16,15 @@ type Mutation {
|
|
|
16
16
|
"Update an existing Product"
|
|
17
17
|
updateProduct(input: UpdateProductInput!): Product!
|
|
18
18
|
|
|
19
|
+
"Update multiple existing Products"
|
|
20
|
+
updateProducts(input: [UpdateProductInput!]!): [Product!]!
|
|
21
|
+
|
|
19
22
|
"Delete a Product"
|
|
20
23
|
deleteProduct(id: ID!): DeletionResponse!
|
|
21
24
|
|
|
25
|
+
"Delete multiple Products"
|
|
26
|
+
deleteProducts(ids: [ID!]!): [DeletionResponse!]!
|
|
27
|
+
|
|
22
28
|
"Add an OptionGroup to a Product"
|
|
23
29
|
addOptionGroupToProduct(productId: ID!, optionGroupId: ID!): Product!
|
|
24
30
|
|
|
@@ -34,6 +40,9 @@ type Mutation {
|
|
|
34
40
|
"Delete a ProductVariant"
|
|
35
41
|
deleteProductVariant(id: ID!): DeletionResponse!
|
|
36
42
|
|
|
43
|
+
"Delete multiple ProductVariants"
|
|
44
|
+
deleteProductVariants(ids: [ID!]!): [DeletionResponse!]!
|
|
45
|
+
|
|
37
46
|
"Assigns all ProductVariants of Product to the specified Channel"
|
|
38
47
|
assignProductsToChannel(input: AssignProductsToChannelInput!): [Product!]!
|
|
39
48
|
|
|
@@ -68,3 +68,24 @@ type CouponCodeLimitError implements ErrorResult {
|
|
|
68
68
|
couponCode: String!
|
|
69
69
|
limit: Int!
|
|
70
70
|
}
|
|
71
|
+
|
|
72
|
+
"Returned when attempting to modify the contents of an Order that is not in the `AddingItems` state."
|
|
73
|
+
type OrderModificationError implements ErrorResult {
|
|
74
|
+
errorCode: ErrorCode!
|
|
75
|
+
message: String!
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
"Returned when attempting to set a ShippingMethod for which the Order is not eligible"
|
|
79
|
+
type IneligibleShippingMethodError implements ErrorResult {
|
|
80
|
+
errorCode: ErrorCode!
|
|
81
|
+
message: String!
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
"""
|
|
85
|
+
Returned when invoking a mutation which depends on there being an active Order on the
|
|
86
|
+
current session.
|
|
87
|
+
"""
|
|
88
|
+
type NoActiveOrderError implements ErrorResult {
|
|
89
|
+
errorCode: ErrorCode!
|
|
90
|
+
message: String!
|
|
91
|
+
}
|
|
@@ -244,3 +244,18 @@ type PaymentMethodQuote {
|
|
|
244
244
|
isEligible: Boolean!
|
|
245
245
|
eligibilityMessage: String
|
|
246
246
|
}
|
|
247
|
+
|
|
248
|
+
union UpdateOrderItemsResult =
|
|
249
|
+
Order
|
|
250
|
+
| OrderModificationError
|
|
251
|
+
| OrderLimitError
|
|
252
|
+
| NegativeQuantityError
|
|
253
|
+
| InsufficientStockError
|
|
254
|
+
union RemoveOrderItemsResult = Order | OrderModificationError
|
|
255
|
+
union SetOrderShippingMethodResult =
|
|
256
|
+
Order
|
|
257
|
+
| OrderModificationError
|
|
258
|
+
| IneligibleShippingMethodError
|
|
259
|
+
| NoActiveOrderError
|
|
260
|
+
union ApplyCouponCodeResult = Order | CouponCodeExpiredError | CouponCodeInvalidError | CouponCodeLimitError
|
|
261
|
+
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
"Returned when attempting to modify the contents of an Order that is not in the `AddingItems` state."
|
|
2
|
-
type OrderModificationError implements ErrorResult {
|
|
3
|
-
errorCode: ErrorCode!
|
|
4
|
-
message: String!
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
"Returned when attempting to set a ShippingMethod for which the Order is not eligible"
|
|
8
|
-
type IneligibleShippingMethodError implements ErrorResult {
|
|
9
|
-
errorCode: ErrorCode!
|
|
10
|
-
message: String!
|
|
11
|
-
}
|
|
12
|
-
|
|
13
1
|
"Returned when attempting to add a Payment to an Order that is not in the `ArrangingPayment` state."
|
|
14
2
|
type OrderPaymentStateError implements ErrorResult {
|
|
15
3
|
errorCode: ErrorCode!
|
|
@@ -124,12 +112,3 @@ type NotVerifiedError implements ErrorResult {
|
|
|
124
112
|
errorCode: ErrorCode!
|
|
125
113
|
message: String!
|
|
126
114
|
}
|
|
127
|
-
|
|
128
|
-
"""
|
|
129
|
-
Returned when invoking a mutation which depends on there being an active Order on the
|
|
130
|
-
current session.
|
|
131
|
-
"""
|
|
132
|
-
type NoActiveOrderError implements ErrorResult {
|
|
133
|
-
errorCode: ErrorCode!
|
|
134
|
-
message: String!
|
|
135
|
-
}
|
|
@@ -190,19 +190,6 @@ input ProductListOptions
|
|
|
190
190
|
# generated by generateListOptions function
|
|
191
191
|
input ProductVariantListOptions
|
|
192
192
|
|
|
193
|
-
union UpdateOrderItemsResult =
|
|
194
|
-
Order
|
|
195
|
-
| OrderModificationError
|
|
196
|
-
| OrderLimitError
|
|
197
|
-
| NegativeQuantityError
|
|
198
|
-
| InsufficientStockError
|
|
199
|
-
union RemoveOrderItemsResult = Order | OrderModificationError
|
|
200
|
-
union SetOrderShippingMethodResult =
|
|
201
|
-
Order
|
|
202
|
-
| OrderModificationError
|
|
203
|
-
| IneligibleShippingMethodError
|
|
204
|
-
| NoActiveOrderError
|
|
205
|
-
union ApplyCouponCodeResult = Order | CouponCodeExpiredError | CouponCodeInvalidError | CouponCodeLimitError
|
|
206
193
|
union AddPaymentToOrderResult =
|
|
207
194
|
Order
|
|
208
195
|
| OrderPaymentStateError
|
|
@@ -169,7 +169,7 @@ function coerceValueToType(value, type, isList) {
|
|
|
169
169
|
return JSON.parse(value).map(v => coerceValueToType(v, type, false));
|
|
170
170
|
}
|
|
171
171
|
catch (err) {
|
|
172
|
-
throw new errors_1.InternalServerError(err.message);
|
|
172
|
+
throw new errors_1.InternalServerError(`Could not parse list value "${value}": ` + err.message);
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
switch (type) {
|