@unchainedshop/api 4.8.14 → 4.8.15

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.
@@ -50,16 +50,15 @@ const setupMCPChatHandler = (chatConfiguration) => {
50
50
  });
51
51
  const sdkClient = new Client({ name: 'unchained-chat-client', version: '1.0.0' });
52
52
  await sdkClient.connect(resourceTransport);
53
- const transport = new StreamableHTTPClientTransport(new URL(unchainedMCPUrl), {
54
- requestInit: {
53
+ client = await createMCPClient({
54
+ transport: {
55
+ type: 'http',
56
+ url: unchainedMCPUrl,
55
57
  headers: {
56
58
  Cookie: req.headers.cookie || '',
57
59
  },
58
60
  },
59
61
  });
60
- client = await createMCPClient({
61
- transport,
62
- });
63
62
  const defaultUnchainedTools = await client.tools();
64
63
  let resourceContext = '';
65
64
  try {
@@ -127,7 +126,6 @@ const setupMCPChatHandler = (chatConfiguration) => {
127
126
  const messagesToInclude = normalizedMessages.slice(startIndex);
128
127
  const result = streamText({
129
128
  stopWhen: stepCountIs(500),
130
- temperature: 0.2,
131
129
  maxRetries: 3,
132
130
  ...restChatConfig,
133
131
  messages: messagesToInclude,
@@ -1,4 +1,4 @@
1
1
  import type { Context } from '../../../context.ts';
2
2
  export default function removeOrder(root: never, { orderId }: {
3
3
  orderId: string;
4
- }, { modules, userId }: Context): Promise<import("@unchainedshop/core-orders").Order>;
4
+ }, { modules, services, userId }: Context): Promise<import("@unchainedshop/core-orders").Order>;
@@ -1,6 +1,6 @@
1
1
  import { log } from '@unchainedshop/logger';
2
2
  import { OrderNotFoundError, OrderWrongStatusError, InvalidIdError } from "../../../errors.js";
3
- export default async function removeOrder(root, { orderId }, { modules, userId }) {
3
+ export default async function removeOrder(root, { orderId }, { modules, services, userId }) {
4
4
  log('mutation removeOrder', { userId, orderId });
5
5
  if (!orderId)
6
6
  throw new InvalidIdError({ orderId });
@@ -10,6 +10,6 @@ export default async function removeOrder(root, { orderId }, { modules, userId }
10
10
  if (!modules.orders.isCart(order)) {
11
11
  throw new OrderWrongStatusError({ status: order.status });
12
12
  }
13
- await modules.orders.delete(orderId);
13
+ await services.orders.deleteCart(orderId);
14
14
  return order;
15
15
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unchainedshop/api",
3
3
  "description": "GraphQL API layer for the Unchained Engine with Express/Fastify adapters and MCP server",
4
- "version": "4.8.14",
4
+ "version": "4.8.15",
5
5
  "main": "lib/api-index.js",
6
6
  "types": "lib/api-index.d.ts",
7
7
  "type": "module",