@unchainedshop/api 4.0.0-rc.14 → 4.0.0-rc.16
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/lib/chat/defaultSystemPrompt.d.ts +3 -0
- package/lib/chat/defaultSystemPrompt.d.ts.map +1 -0
- package/lib/chat/defaultSystemPrompt.js +7 -0
- package/lib/chat/defaultSystemPrompt.js.map +1 -0
- package/lib/chat/generateImageHandler.d.ts +7 -0
- package/lib/chat/generateImageHandler.d.ts.map +1 -0
- package/lib/chat/generateImageHandler.js +64 -0
- package/lib/chat/generateImageHandler.js.map +1 -0
- package/lib/chat/normalizeToolsIndex.d.ts +7 -0
- package/lib/chat/normalizeToolsIndex.d.ts.map +1 -0
- package/lib/chat/normalizeToolsIndex.js +11 -0
- package/lib/chat/normalizeToolsIndex.js.map +1 -0
- package/lib/chat/utils.d.ts +13 -0
- package/lib/chat/utils.d.ts.map +1 -0
- package/lib/chat/utils.js +32 -0
- package/lib/chat/utils.js.map +1 -0
- package/lib/context.d.ts +3 -0
- package/lib/context.d.ts.map +1 -1
- package/lib/context.js.map +1 -1
- package/lib/express/chatHandler.d.ts +5 -0
- package/lib/express/chatHandler.d.ts.map +1 -0
- package/lib/express/chatHandler.js +116 -0
- package/lib/express/chatHandler.js.map +1 -0
- package/lib/express/createBulkImportMiddleware.d.ts.map +1 -1
- package/lib/express/createBulkImportMiddleware.js +6 -7
- package/lib/express/createBulkImportMiddleware.js.map +1 -1
- package/lib/express/createERCMetadataMiddleware.d.ts.map +1 -1
- package/lib/express/createERCMetadataMiddleware.js +12 -15
- package/lib/express/createERCMetadataMiddleware.js.map +1 -1
- package/lib/express/createTempUploadMiddleware.d.ts.map +1 -1
- package/lib/express/createTempUploadMiddleware.js +4 -8
- package/lib/express/createTempUploadMiddleware.js.map +1 -1
- package/lib/express/index.d.ts +1 -0
- package/lib/express/index.d.ts.map +1 -1
- package/lib/express/index.js +1 -0
- package/lib/express/index.js.map +1 -1
- package/lib/fastify/bulkImportHandler.js +5 -6
- package/lib/fastify/bulkImportHandler.js.map +1 -1
- package/lib/fastify/chatHandler.d.ts +4 -0
- package/lib/fastify/chatHandler.d.ts.map +1 -0
- package/lib/fastify/chatHandler.js +110 -0
- package/lib/fastify/chatHandler.js.map +1 -0
- package/lib/fastify/ercMetadataHandler.d.ts.map +1 -1
- package/lib/fastify/ercMetadataHandler.js +3 -6
- package/lib/fastify/ercMetadataHandler.js.map +1 -1
- package/lib/fastify/index.d.ts +6 -1
- package/lib/fastify/index.d.ts.map +1 -1
- package/lib/fastify/index.js +28 -0
- package/lib/fastify/index.js.map +1 -1
- package/lib/fastify/mcpHandler.js +2 -2
- package/lib/fastify/mcpHandler.js.map +1 -1
- package/lib/fastify/tempUploadHandler.d.ts.map +1 -1
- package/lib/fastify/tempUploadHandler.js +3 -6
- package/lib/fastify/tempUploadHandler.js.map +1 -1
- package/lib/mcp/tools/order/schemas.d.ts +2 -2
- package/lib/mcp/tools/product/handlers/addProductMedia.d.ts +26 -1
- package/lib/mcp/tools/product/handlers/addProductMedia.d.ts.map +1 -1
- package/lib/mcp/tools/product/handlers/addProductMedia.js +4 -4
- package/lib/mcp/tools/product/handlers/addProductMedia.js.map +1 -1
- package/lib/mcp/tools/product/handlers/updateProduct.d.ts.map +1 -1
- package/lib/mcp/tools/product/handlers/updateProduct.js +10 -2
- package/lib/mcp/tools/product/handlers/updateProduct.js.map +1 -1
- package/lib/mcp/tools/product/schemas.d.ts +62 -62
- package/lib/mcp/tools/product/schemas.d.ts.map +1 -1
- package/lib/mcp/tools/product/schemas.js +3 -3
- package/lib/mcp/tools/product/schemas.js.map +1 -1
- package/lib/mcp/tools/users/schemas.d.ts +16 -16
- package/lib/mcp/utils/getNormalizedProductDetails.d.ts.map +1 -1
- package/lib/mcp/utils/getNormalizedProductDetails.js +3 -1
- package/lib/mcp/utils/getNormalizedProductDetails.js.map +1 -1
- package/lib/resolvers/mutations/index.d.ts +4 -1
- package/lib/resolvers/mutations/index.d.ts.map +1 -1
- package/lib/resolvers/mutations/index.js +8 -2
- package/lib/resolvers/mutations/index.js.map +1 -1
- package/lib/resolvers/mutations/orders/checkoutCart.js +1 -1
- package/lib/resolvers/mutations/orders/checkoutCart.js.map +1 -1
- package/lib/resolvers/mutations/orders/updateCart.js +6 -6
- package/lib/resolvers/mutations/orders/updateCart.js.map +1 -1
- package/lib/resolvers/mutations/orders/updateCartDeliveryPickUp.d.ts +8 -0
- package/lib/resolvers/mutations/orders/updateCartDeliveryPickUp.d.ts.map +1 -0
- package/lib/resolvers/mutations/orders/updateCartDeliveryPickUp.js +38 -0
- package/lib/resolvers/mutations/orders/updateCartDeliveryPickUp.js.map +1 -0
- package/lib/resolvers/mutations/orders/updateCartDeliveryShipping.d.ts +8 -0
- package/lib/resolvers/mutations/orders/updateCartDeliveryShipping.d.ts.map +1 -0
- package/lib/resolvers/mutations/orders/updateCartDeliveryShipping.js +38 -0
- package/lib/resolvers/mutations/orders/updateCartDeliveryShipping.js.map +1 -0
- package/lib/resolvers/mutations/orders/updateCartPaymentGeneric.d.ts +7 -0
- package/lib/resolvers/mutations/orders/updateCartPaymentGeneric.d.ts.map +1 -0
- package/lib/resolvers/mutations/orders/updateCartPaymentGeneric.js +37 -0
- package/lib/resolvers/mutations/orders/updateCartPaymentGeneric.js.map +1 -0
- package/lib/resolvers/mutations/orders/updateCartPaymentInvoice.d.ts +7 -0
- package/lib/resolvers/mutations/orders/updateCartPaymentInvoice.d.ts.map +1 -0
- package/lib/resolvers/mutations/orders/updateCartPaymentInvoice.js +37 -0
- package/lib/resolvers/mutations/orders/updateCartPaymentInvoice.js.map +1 -0
- package/lib/resolvers/mutations/products/updateProductCommerce.d.ts.map +1 -1
- package/lib/resolvers/mutations/products/updateProductCommerce.js +11 -2
- package/lib/resolvers/mutations/products/updateProductCommerce.js.map +1 -1
- package/lib/resolvers/queries/shopInfo.d.ts.map +1 -1
- package/lib/resolvers/queries/shopInfo.js +49 -3
- package/lib/resolvers/queries/shopInfo.js.map +1 -1
- package/lib/resolvers/type/index.d.ts +21 -1
- package/lib/resolvers/type/index.d.ts.map +1 -1
- package/lib/resolvers/type/media-types.d.ts.map +1 -1
- package/lib/resolvers/type/media-types.js +3 -1
- package/lib/resolvers/type/media-types.js.map +1 -1
- package/lib/resolvers/type/order/order-payment-types.d.ts.map +1 -1
- package/lib/resolvers/type/order/order-payment-types.js +0 -1
- package/lib/resolvers/type/order/order-payment-types.js.map +1 -1
- package/lib/resolvers/type/price-types.d.ts +1 -1
- package/lib/resolvers/type/price-types.d.ts.map +1 -1
- package/lib/resolvers/type/price-types.js +5 -2
- package/lib/resolvers/type/price-types.js.map +1 -1
- package/lib/resolvers/type/product/product-bundle-types.d.ts +20 -0
- package/lib/resolvers/type/product/product-bundle-types.d.ts.map +1 -1
- package/lib/resolvers/type/product/product-bundle-types.js +2 -2
- package/lib/resolvers/type/product/product-bundle-types.js.map +1 -1
- package/lib/resolvers/type/shop-types.d.ts.map +1 -1
- package/lib/resolvers/type/shop-types.js.map +1 -1
- package/lib/schema/mutation.d.ts.map +1 -1
- package/lib/schema/mutation.js +36 -7
- package/lib/schema/mutation.js.map +1 -1
- package/lib/schema/query.d.ts.map +1 -1
- package/lib/schema/query.js +2 -0
- package/lib/schema/query.js.map +1 -1
- package/lib/schema/types/payment.d.ts.map +1 -1
- package/lib/schema/types/payment.js +0 -5
- package/lib/schema/types/payment.js.map +1 -1
- package/lib/schema/types/product/bundle-product.d.ts.map +1 -1
- package/lib/schema/types/product/bundle-product.js +18 -7
- package/lib/schema/types/product/bundle-product.js.map +1 -1
- package/lib/schema/types/shop.d.ts.map +1 -1
- package/lib/schema/types/shop.js +3 -0
- package/lib/schema/types/shop.js.map +1 -1
- package/package.json +18 -8
- package/src/chat/defaultSystemPrompt.ts +7 -0
- package/src/chat/generateImageHandler.ts +78 -0
- package/src/chat/normalizeToolsIndex.ts +11 -0
- package/src/chat/utils.ts +31 -0
- package/src/context.ts +3 -0
- package/src/express/chatHandler.ts +147 -0
- package/src/express/createBulkImportMiddleware.ts +7 -7
- package/src/express/createERCMetadataMiddleware.ts +13 -15
- package/src/express/createTempUploadMiddleware.ts +4 -9
- package/src/express/index.ts +2 -0
- package/src/fastify/bulkImportHandler.ts +6 -6
- package/src/fastify/chatHandler.ts +140 -0
- package/src/fastify/ercMetadataHandler.ts +3 -6
- package/src/fastify/index.ts +37 -1
- package/src/fastify/mcpHandler.ts +2 -2
- package/src/fastify/tempUploadHandler.ts +3 -6
- package/src/mcp/tools/product/handlers/addProductMedia.ts +4 -5
- package/src/mcp/tools/product/handlers/updateProduct.ts +12 -1
- package/src/mcp/tools/product/schemas.ts +7 -3
- package/src/mcp/utils/getNormalizedProductDetails.ts +4 -1
- package/src/resolvers/mutations/index.ts +8 -2
- package/src/resolvers/mutations/orders/checkoutCart.ts +1 -1
- package/src/resolvers/mutations/orders/updateCart.ts +6 -6
- package/src/resolvers/mutations/orders/updateCartDeliveryPickUp.ts +51 -0
- package/src/resolvers/mutations/orders/updateCartDeliveryShipping.ts +51 -0
- package/src/resolvers/mutations/orders/updateCartPaymentGeneric.ts +50 -0
- package/src/resolvers/mutations/orders/updateCartPaymentInvoice.ts +50 -0
- package/src/resolvers/mutations/products/updateProductCommerce.ts +12 -4
- package/src/resolvers/queries/shopInfo.ts +49 -3
- package/src/resolvers/type/media-types.ts +4 -1
- package/src/resolvers/type/order/order-payment-types.ts +0 -1
- package/src/resolvers/type/price-types.ts +5 -3
- package/src/resolvers/type/product/product-bundle-types.ts +2 -2
- package/src/resolvers/type/shop-types.ts +0 -1
- package/src/schema/mutation.ts +36 -7
- package/src/schema/query.ts +2 -0
- package/src/schema/types/payment.ts +0 -5
- package/src/schema/types/product/bundle-product.ts +18 -7
- package/src/schema/types/shop.ts +3 -0
- package/src/resolvers/mutations/orders/updateOrderPaymentCard.ts +0 -37
|
@@ -37,15 +37,12 @@ const tempUploadHandler: RouteHandlerMethod = async (
|
|
|
37
37
|
const fileUploadAdapter = getFileAdapter();
|
|
38
38
|
const rawUrl = await fileUploadAdapter.createDownloadURL(file);
|
|
39
39
|
const url = context.modules.files.normalizeUrl(rawUrl, {});
|
|
40
|
-
const body = JSON.stringify({ fileId: file._id, url, expires: expires.toISOString() });
|
|
41
40
|
res.status(200);
|
|
42
|
-
res.
|
|
43
|
-
res.header('Content-Type', 'application/json');
|
|
44
|
-
return res.send(body);
|
|
41
|
+
return res.send({ fileId: file._id, url, expires: expires.toISOString() });
|
|
45
42
|
} catch (e) {
|
|
46
|
-
logger.error(e
|
|
43
|
+
logger.error(e);
|
|
47
44
|
res.status(503);
|
|
48
|
-
return res.send(
|
|
45
|
+
return res.send({ name: e.name, code: e.code, message: e.message });
|
|
49
46
|
}
|
|
50
47
|
};
|
|
51
48
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Context } from '../../../../context.js';
|
|
2
2
|
import { ProductNotFoundError } from '../../../../errors.js';
|
|
3
|
-
import
|
|
3
|
+
import { getNormalizedProductDetails } from '../../../utils/getNormalizedProductDetails.js';
|
|
4
4
|
import { Params } from '../schemas.js';
|
|
5
5
|
|
|
6
6
|
export default async function addProductMedia(context: Context, params: Params<'ADD_MEDIA'>) {
|
|
@@ -39,8 +39,7 @@ export default async function addProductMedia(context: Context, params: Params<'
|
|
|
39
39
|
if (file.expires && new Date(file.expires).getTime() < Date.now()) {
|
|
40
40
|
throw new Error(`File upload expired: ${fileId}`);
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
return { media };
|
|
42
|
+
await services.files.linkFile({ fileId, size, type });
|
|
43
|
+
const updatedProduct = await getNormalizedProductDetails(productId, context);
|
|
44
|
+
return { product: updatedProduct };
|
|
46
45
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Context } from '../../../../context.js';
|
|
2
2
|
import { ProductTypes } from '@unchainedshop/core-products';
|
|
3
3
|
import {
|
|
4
|
+
CountryNotFoundError,
|
|
5
|
+
CurrencyNotFoundError,
|
|
4
6
|
ProductNotFoundError,
|
|
5
7
|
ProductWrongStatusError,
|
|
6
8
|
ProductWrongTypeError,
|
|
@@ -9,7 +11,7 @@ import { getNormalizedProductDetails } from '../../../utils/getNormalizedProduct
|
|
|
9
11
|
import { Params } from '../schemas.js';
|
|
10
12
|
|
|
11
13
|
export default async function updateProduct(context: Context, params: Params<'UPDATE'>) {
|
|
12
|
-
const { modules } = context;
|
|
14
|
+
const { modules, loaders } = context;
|
|
13
15
|
const { productId, product } = params;
|
|
14
16
|
|
|
15
17
|
const existingProduct = await modules.products.findProduct({ productId });
|
|
@@ -64,6 +66,15 @@ export default async function updateProduct(context: Context, params: Params<'UP
|
|
|
64
66
|
}
|
|
65
67
|
|
|
66
68
|
if (product.commerce !== undefined) {
|
|
69
|
+
await Promise.all(
|
|
70
|
+
product.commerce.pricing.map(async ({ countryCode, currencyCode }) => {
|
|
71
|
+
const currency = await loaders.currencyLoader.load({ isoCode: currencyCode });
|
|
72
|
+
if (!currency) throw new CurrencyNotFoundError({ currencyCode });
|
|
73
|
+
|
|
74
|
+
const country = await loaders.countryLoader.load({ isoCode: countryCode });
|
|
75
|
+
if (!country) throw new CountryNotFoundError({ countryCode });
|
|
76
|
+
}),
|
|
77
|
+
);
|
|
67
78
|
updateData.commerce = product.commerce;
|
|
68
79
|
}
|
|
69
80
|
|
|
@@ -111,15 +111,19 @@ export const ProductSchema = z.object({
|
|
|
111
111
|
.min(2)
|
|
112
112
|
.max(2)
|
|
113
113
|
.describe(
|
|
114
|
-
'ISO country code (e.g., US, DE) make sure the country exists in the system before using it. if it does not exists prompt the user to add the country. NEVER add it automatically',
|
|
114
|
+
'ISO country code (e.g., US, DE) make sure the country/countryCode exists in the system before using it. if it does not exists prompt the user to add the country. NEVER add it automatically',
|
|
115
115
|
),
|
|
116
116
|
}),
|
|
117
117
|
)
|
|
118
118
|
.nonempty()
|
|
119
|
-
.describe(
|
|
119
|
+
.describe(
|
|
120
|
+
"List of price configurations always use countryCode and currencyCodes that are already registered in the system, don't use non existing iso codes.",
|
|
121
|
+
),
|
|
120
122
|
})
|
|
121
123
|
.optional()
|
|
122
|
-
.describe(
|
|
124
|
+
.describe(
|
|
125
|
+
"Commerce info - Available for ALL except CONFIGURABLE_PRODUCT. always use countryCode and currencyCodes that are already registered in the system, don't use non existing iso codes.",
|
|
126
|
+
),
|
|
123
127
|
});
|
|
124
128
|
|
|
125
129
|
export const actionValidators = {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { ProductTypes } from '@unchainedshop/core-products';
|
|
2
2
|
import { Context } from '../../context.js';
|
|
3
3
|
import normalizeMediaUrl from './normalizeMediaUrl.js';
|
|
4
|
+
import { createLogger } from '@unchainedshop/logger';
|
|
5
|
+
|
|
6
|
+
const logger = createLogger('unchained:api:mcp');
|
|
4
7
|
|
|
5
8
|
export async function getNormalizedProductDetails(productId: string, context: Context) {
|
|
6
9
|
const { modules, locale, loaders } = context;
|
|
@@ -84,7 +87,7 @@ export async function getNormalizedProductDetails(productId: string, context: Co
|
|
|
84
87
|
});
|
|
85
88
|
} catch {
|
|
86
89
|
// Pricing might not be available for all products
|
|
87
|
-
|
|
90
|
+
logger.warn('Pricing not available for product:', product._id);
|
|
88
91
|
}
|
|
89
92
|
|
|
90
93
|
const productMedias = await modules.products.media.findProductMedias({ productId });
|
|
@@ -138,7 +138,6 @@ import removePaymentCredentials from './payment/removePaymentCredentials.js';
|
|
|
138
138
|
import updateOrderDeliveryShipping from './orders/updateOrderDeliveryShipping.js';
|
|
139
139
|
import updateOrderDeliveryPickUp from './orders/updateOrderDeliveryPickUp.js';
|
|
140
140
|
import updateOrderPaymentGeneric from './orders/updateOrderPaymentGeneric.js';
|
|
141
|
-
import updateOrderPaymentCard from './orders/updateOrderPaymentCard.js';
|
|
142
141
|
import updateOrderPaymentInvoice from './orders/updateOrderPaymentInvoice.js';
|
|
143
142
|
import signPaymentProviderForCredentialRegistration from './payment/signPaymentProviderForCredentialRegistration.js';
|
|
144
143
|
import signPaymentProviderForCheckout from './orders/signPaymentProviderForCheckout.js';
|
|
@@ -153,6 +152,10 @@ import rejectOrder from './orders/rejectOrder.js';
|
|
|
153
152
|
import removePushSubscription from './users/removePushSubscription.js';
|
|
154
153
|
import addPushSubscription from './users/addPushSubscription.js';
|
|
155
154
|
import removeUserProductReviews from './users/removeUserProductReviews.js';
|
|
155
|
+
import updateCartDeliveryPickUp from './orders/updateCartDeliveryPickUp.js';
|
|
156
|
+
import updateCartDeliveryShipping from './orders/updateCartDeliveryShipping.js';
|
|
157
|
+
import updateCartPaymentGeneric from './orders/updateCartPaymentGeneric.js';
|
|
158
|
+
import updateCartPaymentInvoice from './orders/updateCartPaymentInvoice.js';
|
|
156
159
|
|
|
157
160
|
export default {
|
|
158
161
|
logout: acl(actions.logout)(logout),
|
|
@@ -244,12 +247,15 @@ export default {
|
|
|
244
247
|
updateCartItem: acl(actions.updateOrderItem)(updateCartItem),
|
|
245
248
|
removeCartItem: acl(actions.updateOrderItem)(removeCartItem),
|
|
246
249
|
removeCartDiscount: acl(actions.updateOrderDiscount)(removeCartDiscount),
|
|
250
|
+
updateCartDeliveryPickUp: acl(actions.updateCart)(updateCartDeliveryPickUp),
|
|
251
|
+
updateCartDeliveryShipping: acl(actions.updateCart)(updateCartDeliveryShipping),
|
|
252
|
+
updateCartPaymentGeneric: acl(actions.updateCart)(updateCartPaymentGeneric),
|
|
253
|
+
updateCartPaymentInvoice: acl(actions.updateCart)(updateCartPaymentInvoice),
|
|
247
254
|
setOrderPaymentProvider: acl(actions.updateOrder)(setOrderPaymentProvider),
|
|
248
255
|
setOrderDeliveryProvider: acl(actions.updateOrder)(setOrderDeliveryProvider),
|
|
249
256
|
updateOrderDeliveryShipping: acl(actions.updateOrderDelivery)(updateOrderDeliveryShipping),
|
|
250
257
|
updateOrderDeliveryPickUp: acl(actions.updateOrderDelivery)(updateOrderDeliveryPickUp),
|
|
251
258
|
updateOrderPaymentGeneric: acl(actions.updateOrderPayment)(updateOrderPaymentGeneric),
|
|
252
|
-
updateOrderPaymentCard: acl(actions.updateOrderPayment)(updateOrderPaymentCard),
|
|
253
259
|
updateOrderPaymentInvoice: acl(actions.updateOrderPayment)(updateOrderPaymentInvoice),
|
|
254
260
|
removeOrder: acl(actions.updateOrder)(removeOrder),
|
|
255
261
|
confirmOrder: acl(actions.markOrderConfirmed)(confirmOrder),
|
|
@@ -30,7 +30,7 @@ export default async function checkoutCart(
|
|
|
30
30
|
const checkedOutOrder = await services.orders.checkoutOrder(order._id, transactionContext);
|
|
31
31
|
return checkedOutOrder;
|
|
32
32
|
} catch (error) {
|
|
33
|
-
logger.error(error
|
|
33
|
+
logger.error(error, { userId, orderId: order._id });
|
|
34
34
|
throw new OrderCheckoutError({
|
|
35
35
|
userId,
|
|
36
36
|
orderId: order._id,
|
|
@@ -19,7 +19,7 @@ export default async function updateCart(root: never, params: UpdateCartParams,
|
|
|
19
19
|
|
|
20
20
|
log('mutation updateCart', { userId });
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
const order = await services.orders.findOrInitCart({
|
|
23
23
|
orderId,
|
|
24
24
|
user,
|
|
25
25
|
countryCode: context.countryCode,
|
|
@@ -28,23 +28,23 @@ export default async function updateCart(root: never, params: UpdateCartParams,
|
|
|
28
28
|
if (!modules.orders.isCart(order)) throw new OrderWrongStatusError({ status: order.status });
|
|
29
29
|
|
|
30
30
|
if (meta) {
|
|
31
|
-
|
|
31
|
+
await modules.orders.updateContext(order._id, meta);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
if (billingAddress) {
|
|
35
|
-
|
|
35
|
+
await modules.orders.updateBillingAddress(order._id, billingAddress);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
if (contact) {
|
|
39
|
-
|
|
39
|
+
await modules.orders.updateContact(order._id, contact);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
if (paymentProviderId) {
|
|
43
|
-
|
|
43
|
+
await modules.orders.setPaymentProvider(order._id, paymentProviderId);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
if (deliveryProviderId) {
|
|
47
|
-
|
|
47
|
+
await modules.orders.setDeliveryProvider(order._id, deliveryProviderId);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
// Recalculate, then return
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Context } from '../../../context.js';
|
|
2
|
+
import { DeliveryProviderType } from '@unchainedshop/core-delivery';
|
|
3
|
+
import { log } from '@unchainedshop/logger';
|
|
4
|
+
import {
|
|
5
|
+
InvalidIdError,
|
|
6
|
+
OrderDeliveryTypeError,
|
|
7
|
+
OrderNotFoundError,
|
|
8
|
+
OrderWrongStatusError,
|
|
9
|
+
} from '../../../errors.js';
|
|
10
|
+
|
|
11
|
+
export default async function updateCartDeliveryPickUp(
|
|
12
|
+
root: never,
|
|
13
|
+
params: { orderId: string; deliveryProviderId: string; orderPickUpLocationId: string; meta: any },
|
|
14
|
+
context: Context,
|
|
15
|
+
) {
|
|
16
|
+
const { modules, services, userId, user } = context;
|
|
17
|
+
const { orderId, deliveryProviderId, orderPickUpLocationId, meta } = params;
|
|
18
|
+
log(`mutation updateCartDeliveryPickUp provider ${deliveryProviderId}`, {
|
|
19
|
+
userId,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
if (!deliveryProviderId) throw new InvalidIdError({ deliveryProviderId });
|
|
23
|
+
|
|
24
|
+
let order = await services.orders.findOrInitCart({
|
|
25
|
+
orderId,
|
|
26
|
+
user,
|
|
27
|
+
countryCode: context.countryCode,
|
|
28
|
+
});
|
|
29
|
+
if (!order) throw new OrderNotFoundError({ orderId });
|
|
30
|
+
if (!modules.orders.isCart(order)) throw new OrderWrongStatusError({ status: order.status });
|
|
31
|
+
|
|
32
|
+
const provider = await modules.delivery.findProvider({
|
|
33
|
+
deliveryProviderId,
|
|
34
|
+
});
|
|
35
|
+
const deliveryProviderType = provider?.type;
|
|
36
|
+
|
|
37
|
+
if (deliveryProviderType !== DeliveryProviderType.PICKUP)
|
|
38
|
+
throw new OrderDeliveryTypeError({
|
|
39
|
+
orderId: order._id,
|
|
40
|
+
received: deliveryProviderType,
|
|
41
|
+
required: DeliveryProviderType.PICKUP,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
order = (await modules.orders.setDeliveryProvider(order._id, deliveryProviderId)) || order;
|
|
45
|
+
|
|
46
|
+
await modules.orders.deliveries.updateContext(order.deliveryId, {
|
|
47
|
+
orderPickUpLocationId,
|
|
48
|
+
meta,
|
|
49
|
+
});
|
|
50
|
+
return services.orders.updateCalculation(order._id);
|
|
51
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Context } from '../../../context.js';
|
|
2
|
+
import { DeliveryProviderType } from '@unchainedshop/core-delivery';
|
|
3
|
+
import { log } from '@unchainedshop/logger';
|
|
4
|
+
import {
|
|
5
|
+
InvalidIdError,
|
|
6
|
+
OrderDeliveryTypeError,
|
|
7
|
+
OrderNotFoundError,
|
|
8
|
+
OrderWrongStatusError,
|
|
9
|
+
} from '../../../errors.js';
|
|
10
|
+
|
|
11
|
+
export default async function updateCartDeliveryShipping(
|
|
12
|
+
root: never,
|
|
13
|
+
params: { orderId: string; deliveryProviderId: string; address: any; meta: any },
|
|
14
|
+
context: Context,
|
|
15
|
+
) {
|
|
16
|
+
const { modules, services, userId, user } = context;
|
|
17
|
+
const { orderId, deliveryProviderId, address, meta } = params;
|
|
18
|
+
log(`mutation updateCartDeliveryShipping provider ${deliveryProviderId}`, {
|
|
19
|
+
userId,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
if (!deliveryProviderId) throw new InvalidIdError({ deliveryProviderId });
|
|
23
|
+
|
|
24
|
+
let order = await services.orders.findOrInitCart({
|
|
25
|
+
orderId,
|
|
26
|
+
user,
|
|
27
|
+
countryCode: context.countryCode,
|
|
28
|
+
});
|
|
29
|
+
if (!order) throw new OrderNotFoundError({ orderId });
|
|
30
|
+
if (!modules.orders.isCart(order)) throw new OrderWrongStatusError({ status: order.status });
|
|
31
|
+
|
|
32
|
+
const provider = await modules.delivery.findProvider({
|
|
33
|
+
deliveryProviderId,
|
|
34
|
+
});
|
|
35
|
+
const deliveryProviderType = provider?.type;
|
|
36
|
+
|
|
37
|
+
if (deliveryProviderType !== DeliveryProviderType.SHIPPING)
|
|
38
|
+
throw new OrderDeliveryTypeError({
|
|
39
|
+
orderId: order._id,
|
|
40
|
+
received: deliveryProviderType,
|
|
41
|
+
required: DeliveryProviderType.SHIPPING,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
order = (await modules.orders.setDeliveryProvider(order._id, deliveryProviderId)) || order;
|
|
45
|
+
|
|
46
|
+
await modules.orders.deliveries.updateContext(order.deliveryId, {
|
|
47
|
+
address,
|
|
48
|
+
meta,
|
|
49
|
+
});
|
|
50
|
+
return services.orders.updateCalculation(order._id);
|
|
51
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Context } from '../../../context.js';
|
|
2
|
+
import { PaymentProviderType } from '@unchainedshop/core-payment';
|
|
3
|
+
import { log } from '@unchainedshop/logger';
|
|
4
|
+
import {
|
|
5
|
+
InvalidIdError,
|
|
6
|
+
OrderNotFoundError,
|
|
7
|
+
OrderPaymentTypeError,
|
|
8
|
+
OrderWrongStatusError,
|
|
9
|
+
} from '../../../errors.js';
|
|
10
|
+
|
|
11
|
+
export default async function updateCartPaymentGeneric(
|
|
12
|
+
root: never,
|
|
13
|
+
params: { orderId: string; paymentProviderId: string; meta?: any },
|
|
14
|
+
context: Context,
|
|
15
|
+
) {
|
|
16
|
+
const { modules, services, userId, user } = context;
|
|
17
|
+
const { orderId, paymentProviderId, meta } = params;
|
|
18
|
+
log(`mutation updateCartPaymentGeneric provider ${paymentProviderId}`, {
|
|
19
|
+
userId,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
if (!paymentProviderId) throw new InvalidIdError({ paymentProviderId });
|
|
23
|
+
|
|
24
|
+
let order = await services.orders.findOrInitCart({
|
|
25
|
+
orderId,
|
|
26
|
+
user,
|
|
27
|
+
countryCode: context.countryCode,
|
|
28
|
+
});
|
|
29
|
+
if (!order) throw new OrderNotFoundError({ orderId });
|
|
30
|
+
if (!modules.orders.isCart(order)) throw new OrderWrongStatusError({ status: order.status });
|
|
31
|
+
|
|
32
|
+
const provider = await modules.payment.paymentProviders.findProvider({
|
|
33
|
+
paymentProviderId,
|
|
34
|
+
});
|
|
35
|
+
const paymentProviderType = provider?.type;
|
|
36
|
+
|
|
37
|
+
if (paymentProviderType !== PaymentProviderType.GENERIC)
|
|
38
|
+
throw new OrderPaymentTypeError({
|
|
39
|
+
orderId: order._id,
|
|
40
|
+
received: paymentProviderType,
|
|
41
|
+
required: PaymentProviderType.GENERIC,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
order = (await modules.orders.setPaymentProvider(order._id, paymentProviderId)) || order;
|
|
45
|
+
|
|
46
|
+
await modules.orders.payments.updateContext(order.paymentId, {
|
|
47
|
+
meta,
|
|
48
|
+
});
|
|
49
|
+
return services.orders.updateCalculation(order._id);
|
|
50
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Context } from '../../../context.js';
|
|
2
|
+
import { PaymentProviderType } from '@unchainedshop/core-payment';
|
|
3
|
+
import { log } from '@unchainedshop/logger';
|
|
4
|
+
import {
|
|
5
|
+
InvalidIdError,
|
|
6
|
+
OrderNotFoundError,
|
|
7
|
+
OrderPaymentTypeError,
|
|
8
|
+
OrderWrongStatusError,
|
|
9
|
+
} from '../../../errors.js';
|
|
10
|
+
|
|
11
|
+
export default async function updateCartPaymentInvoice(
|
|
12
|
+
root: never,
|
|
13
|
+
params: { orderId: string; paymentProviderId: string; meta?: any },
|
|
14
|
+
context: Context,
|
|
15
|
+
) {
|
|
16
|
+
const { modules, services, userId, user } = context;
|
|
17
|
+
const { orderId, paymentProviderId, meta } = params;
|
|
18
|
+
log(`mutation updateCartPaymentInvoice provider ${paymentProviderId}`, {
|
|
19
|
+
userId,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
if (!paymentProviderId) throw new InvalidIdError({ paymentProviderId });
|
|
23
|
+
|
|
24
|
+
let order = await services.orders.findOrInitCart({
|
|
25
|
+
orderId,
|
|
26
|
+
user,
|
|
27
|
+
countryCode: context.countryCode,
|
|
28
|
+
});
|
|
29
|
+
if (!order) throw new OrderNotFoundError({ orderId });
|
|
30
|
+
if (!modules.orders.isCart(order)) throw new OrderWrongStatusError({ status: order.status });
|
|
31
|
+
|
|
32
|
+
const provider = await modules.payment.paymentProviders.findProvider({
|
|
33
|
+
paymentProviderId,
|
|
34
|
+
});
|
|
35
|
+
const paymentProviderType = provider?.type;
|
|
36
|
+
|
|
37
|
+
if (paymentProviderType !== PaymentProviderType.INVOICE)
|
|
38
|
+
throw new OrderPaymentTypeError({
|
|
39
|
+
orderId: order._id,
|
|
40
|
+
received: paymentProviderType,
|
|
41
|
+
required: PaymentProviderType.INVOICE,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
order = (await modules.orders.setPaymentProvider(order._id, paymentProviderId)) || order;
|
|
45
|
+
|
|
46
|
+
await modules.orders.payments.updateContext(order.paymentId, {
|
|
47
|
+
meta,
|
|
48
|
+
});
|
|
49
|
+
return services.orders.updateCalculation(order._id);
|
|
50
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { log } from '@unchainedshop/logger';
|
|
2
|
-
import { ProductCommerce } from '@unchainedshop/core-products';
|
|
3
|
-
import { ProductNotFoundError, InvalidIdError } from '../../../errors.js';
|
|
2
|
+
import { ProductCommerce, ProductTypes } from '@unchainedshop/core-products';
|
|
3
|
+
import { ProductNotFoundError, InvalidIdError, ProductWrongTypeError } from '../../../errors.js';
|
|
4
4
|
import { Context } from '../../../context.js';
|
|
5
5
|
|
|
6
6
|
export default async function updateProductCommerce(
|
|
@@ -12,8 +12,16 @@ export default async function updateProductCommerce(
|
|
|
12
12
|
|
|
13
13
|
if (!productId) throw new InvalidIdError({ productId });
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
const product = await modules.products.findProduct({ productId });
|
|
16
|
+
if (!product) throw new ProductNotFoundError({ productId });
|
|
17
|
+
|
|
18
|
+
if (product.type === ProductTypes.ConfigurableProduct) {
|
|
19
|
+
throw new ProductWrongTypeError({
|
|
20
|
+
productId: productId,
|
|
21
|
+
received: product.type,
|
|
22
|
+
required: { not: ProductTypes.ConfigurableProduct },
|
|
23
|
+
});
|
|
24
|
+
}
|
|
17
25
|
|
|
18
26
|
await modules.products.update(productId, { commerce });
|
|
19
27
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { readFile } from 'fs/promises';
|
|
1
2
|
import { Context } from '../../context.js';
|
|
2
3
|
import { log } from '@unchainedshop/logger';
|
|
3
4
|
|
|
@@ -10,14 +11,23 @@ export default function shopInfo(
|
|
|
10
11
|
adminUiConfig?: Record<string, any>;
|
|
11
12
|
vapidPublicKey?: string;
|
|
12
13
|
} {
|
|
13
|
-
const { adminUiConfig } = context;
|
|
14
|
+
const { adminUiConfig, modules } = context;
|
|
14
15
|
log('query shopInfo', { userId: context.userId });
|
|
15
16
|
|
|
16
17
|
return {
|
|
17
18
|
version: context.version,
|
|
18
19
|
adminUiConfig: {
|
|
19
|
-
customProperties:
|
|
20
|
-
|
|
20
|
+
customProperties: async () => {
|
|
21
|
+
try {
|
|
22
|
+
const raw = await readFile(process.env.UNCHAINED_ADMIN_UI_CUSTOM_PROPERTIES, 'utf-8');
|
|
23
|
+
const parsed = JSON.parse(raw);
|
|
24
|
+
return parsed;
|
|
25
|
+
} catch {
|
|
26
|
+
return adminUiConfig?.customProperties ?? [];
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
singleSignOnURL:
|
|
30
|
+
process.env.UNCHAINED_ADMIN_UI_SINGLE_SIGN_ON_URL || adminUiConfig?.singleSignOnURL,
|
|
21
31
|
externalLinks: () => {
|
|
22
32
|
try {
|
|
23
33
|
const parsed = JSON.parse(process.env.EXTERNAL_LINKS);
|
|
@@ -26,6 +36,42 @@ export default function shopInfo(
|
|
|
26
36
|
return [];
|
|
27
37
|
}
|
|
28
38
|
},
|
|
39
|
+
productTags: async () => {
|
|
40
|
+
const existingProductTags = await modules.products.existingTags();
|
|
41
|
+
const envTags = (process.env.UNCHAINED_ADMIN_UI_DEFAULT_PRODUCT_TAGS || '')
|
|
42
|
+
.split(',')
|
|
43
|
+
.map((t) => t.trim())
|
|
44
|
+
.filter(Boolean);
|
|
45
|
+
const normalizedDefaultTags = envTags?.length
|
|
46
|
+
? envTags
|
|
47
|
+
: (adminUiConfig?.defaultProductTags || []).filter(Boolean);
|
|
48
|
+
const normalizedTags = Array.from(new Set(normalizedDefaultTags.concat(existingProductTags)));
|
|
49
|
+
return normalizedTags;
|
|
50
|
+
},
|
|
51
|
+
assortmentTags: async () => {
|
|
52
|
+
const existingAssortmentTags = await modules.assortments.existingTags();
|
|
53
|
+
const envTags = (process.env.UNCHAINED_ADMIN_UI_DEFAULT_ASSORTMENT_TAGS || '')
|
|
54
|
+
.split(',')
|
|
55
|
+
.map((t) => t.trim())
|
|
56
|
+
.filter(Boolean);
|
|
57
|
+
const normalizedDefaultTags = envTags?.length
|
|
58
|
+
? envTags
|
|
59
|
+
: (adminUiConfig?.defaultAssortmentTags || []).filter(Boolean);
|
|
60
|
+
const normalizedTags = Array.from(new Set(normalizedDefaultTags.concat(existingAssortmentTags)));
|
|
61
|
+
return normalizedTags;
|
|
62
|
+
},
|
|
63
|
+
userTags: async () => {
|
|
64
|
+
const existingUserTags = await modules.users.existingTags();
|
|
65
|
+
const envTags = (process.env.UNCHAINED_ADMIN_UI_DEFAULT_USER_TAGS || '')
|
|
66
|
+
.split(',')
|
|
67
|
+
.map((t) => t.trim())
|
|
68
|
+
.filter(Boolean);
|
|
69
|
+
const normalizedDefaultTags = envTags?.length
|
|
70
|
+
? envTags
|
|
71
|
+
: (adminUiConfig?.defaultUserTags || []).filter(Boolean);
|
|
72
|
+
const normalizedTags = Array.from(new Set(normalizedDefaultTags.concat(existingUserTags)));
|
|
73
|
+
return normalizedTags;
|
|
74
|
+
},
|
|
29
75
|
},
|
|
30
76
|
vapidPublicKey: process.env?.PUSH_NOTIFICATION_PUBLIC_KEY,
|
|
31
77
|
};
|
|
@@ -2,6 +2,9 @@ import { File as FileType, getFileAdapter } from '@unchainedshop/core-files';
|
|
|
2
2
|
import { Context } from '../../context.js';
|
|
3
3
|
import { checkAction } from '../../acl.js';
|
|
4
4
|
import { actions } from '../../roles/index.js';
|
|
5
|
+
import { createLogger } from '@unchainedshop/logger';
|
|
6
|
+
|
|
7
|
+
const logger = createLogger('unchained:api');
|
|
5
8
|
export interface MediaHelperTypes {
|
|
6
9
|
url: (language: FileType, params: Record<string, any>, context: Context) => Promise<string>;
|
|
7
10
|
}
|
|
@@ -16,7 +19,7 @@ export const Media: MediaHelperTypes = {
|
|
|
16
19
|
const url = await fileUploadAdapter.createDownloadURL(file, params?.expires);
|
|
17
20
|
return modules.files.normalizeUrl(url, params);
|
|
18
21
|
} catch (e) {
|
|
19
|
-
|
|
22
|
+
logger.error(e);
|
|
20
23
|
return null;
|
|
21
24
|
}
|
|
22
25
|
},
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import accounting from 'accounting';
|
|
2
|
-
|
|
3
1
|
export interface PriceType {
|
|
4
2
|
isTaxable?: boolean;
|
|
5
3
|
isNetPrice?: boolean;
|
|
@@ -21,7 +19,11 @@ export const Price = {
|
|
|
21
19
|
},
|
|
22
20
|
amount(obj: PriceType) {
|
|
23
21
|
if (obj.amount) {
|
|
24
|
-
return
|
|
22
|
+
return Number(obj.amount).toLocaleString(undefined, {
|
|
23
|
+
minimumFractionDigits: 0,
|
|
24
|
+
maximumFractionDigits: 0,
|
|
25
|
+
useGrouping: false,
|
|
26
|
+
});
|
|
25
27
|
}
|
|
26
28
|
return 0;
|
|
27
29
|
},
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ProductBundleItem } from '@unchainedshop/core-products';
|
|
2
|
-
import {
|
|
2
|
+
import { PlanProduct } from './product-plan-types.js';
|
|
3
3
|
|
|
4
4
|
export const BundleProduct = {
|
|
5
|
-
...
|
|
5
|
+
...PlanProduct,
|
|
6
6
|
|
|
7
7
|
bundleItems(product): ProductBundleItem[] {
|
|
8
8
|
return product.bundleItems ? product.bundleItems : [];
|
|
@@ -5,7 +5,6 @@ import { checkAction } from '../../acl.js';
|
|
|
5
5
|
import { allRoles, actions } from '../../roles/index.js';
|
|
6
6
|
|
|
7
7
|
type HelperType<T> = (root: never, params: never, context: Context) => Promise<T>;
|
|
8
|
-
|
|
9
8
|
export interface ShopHelperTypes {
|
|
10
9
|
_id: () => string;
|
|
11
10
|
country: HelperType<Country>;
|
package/src/schema/mutation.ts
CHANGED
|
@@ -226,12 +226,44 @@ export default [
|
|
|
226
226
|
doesn’t exists new delivery provider will be created with the provided ID.
|
|
227
227
|
"""
|
|
228
228
|
setOrderDeliveryProvider(orderId: ID!, deliveryProviderId: ID!): Order!
|
|
229
|
+
@deprecated(reason: "Use updateCart or updateCartDelivery* mutations instead")
|
|
229
230
|
|
|
230
231
|
"""
|
|
231
232
|
Change the payment method/provider to an order. If the payment provider
|
|
232
233
|
doesn’t exists new payment provider will be created with the provided ID.
|
|
233
234
|
"""
|
|
234
235
|
setOrderPaymentProvider(orderId: ID!, paymentProviderId: ID!): Order!
|
|
236
|
+
@deprecated(reason: "Use updateCart or updateCartPayment* mutations instead")
|
|
237
|
+
|
|
238
|
+
"""
|
|
239
|
+
Update the cart by changing the delivery provider and using a shipping specific configuration
|
|
240
|
+
"""
|
|
241
|
+
updateCartDeliveryShipping(
|
|
242
|
+
orderId: ID
|
|
243
|
+
deliveryProviderId: ID!
|
|
244
|
+
address: AddressInput
|
|
245
|
+
meta: JSON
|
|
246
|
+
): Order!
|
|
247
|
+
|
|
248
|
+
"""
|
|
249
|
+
Update the cart by changing the delivery provider and using a pick up specific configuration
|
|
250
|
+
"""
|
|
251
|
+
updateCartDeliveryPickUp(
|
|
252
|
+
orderId: ID
|
|
253
|
+
deliveryProviderId: ID!
|
|
254
|
+
orderPickUpLocationId: ID!
|
|
255
|
+
meta: JSON
|
|
256
|
+
): Order!
|
|
257
|
+
|
|
258
|
+
"""
|
|
259
|
+
Update the cart by changing the payment provider and using an invoice-type specific configuration
|
|
260
|
+
"""
|
|
261
|
+
updateCartPaymentInvoice(orderId: ID, paymentProviderId: ID!, meta: JSON): Order!
|
|
262
|
+
|
|
263
|
+
"""
|
|
264
|
+
Update the cart by changing the payment provider and using a generic specific configuration
|
|
265
|
+
"""
|
|
266
|
+
updateCartPaymentGeneric(orderId: ID, paymentProviderId: ID!, meta: JSON): Order!
|
|
235
267
|
|
|
236
268
|
"""
|
|
237
269
|
Update a Shipping Delivery Provider's specific configuration
|
|
@@ -240,7 +272,7 @@ export default [
|
|
|
240
272
|
orderDeliveryId: ID!
|
|
241
273
|
address: AddressInput
|
|
242
274
|
meta: JSON
|
|
243
|
-
): OrderDeliveryShipping!
|
|
275
|
+
): OrderDeliveryShipping! @deprecated(reason: "Use updateCartDeliveryShipping instead")
|
|
244
276
|
|
|
245
277
|
"""
|
|
246
278
|
Update a Pick Up Delivery Provider's specific configuration
|
|
@@ -249,22 +281,19 @@ export default [
|
|
|
249
281
|
orderDeliveryId: ID!
|
|
250
282
|
orderPickUpLocationId: ID!
|
|
251
283
|
meta: JSON
|
|
252
|
-
): OrderDeliveryPickUp!
|
|
253
|
-
|
|
254
|
-
"""
|
|
255
|
-
Update a Card Payment Provider's specific configuration
|
|
256
|
-
"""
|
|
257
|
-
updateOrderPaymentCard(orderPaymentId: ID!, meta: JSON): OrderPaymentCard!
|
|
284
|
+
): OrderDeliveryPickUp! @deprecated(reason: "Use updateCartDeliveryPickUp instead")
|
|
258
285
|
|
|
259
286
|
"""
|
|
260
287
|
Update an Invoice Payment Provider's specific configuration
|
|
261
288
|
"""
|
|
262
289
|
updateOrderPaymentInvoice(orderPaymentId: ID!, meta: JSON): OrderPaymentInvoice!
|
|
290
|
+
@deprecated(reason: "Use updateCartPaymentInvoice instead")
|
|
263
291
|
|
|
264
292
|
"""
|
|
265
293
|
Update a Generic Payment Provider's specific configuration
|
|
266
294
|
"""
|
|
267
295
|
updateOrderPaymentGeneric(orderPaymentId: ID!, meta: JSON): OrderPaymentGeneric!
|
|
296
|
+
@deprecated(reason: "Use updateCartPaymentGeneric instead")
|
|
268
297
|
|
|
269
298
|
"""
|
|
270
299
|
Remove an order while it's still open
|