@lobehub/chat 0.119.12 → 0.120.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.
@@ -26,6 +26,7 @@ vi.mock('@/database/models/message', () => {
26
26
  clearTable: vi.fn(),
27
27
  batchUpdate: vi.fn(),
28
28
  queryAll: vi.fn(),
29
+ updatePluginState: vi.fn(),
29
30
  },
30
31
  };
31
32
  });
@@ -255,7 +256,7 @@ describe('MessageService', () => {
255
256
  const key = 'stateKey';
256
257
  const value = 'stateValue';
257
258
  const newPluginState = { [key]: value };
258
- (MessageModel.update as Mock).mockResolvedValue({
259
+ (MessageModel.updatePluginState as Mock).mockResolvedValue({
259
260
  ...mockMessage,
260
261
  pluginState: newPluginState,
261
262
  });
@@ -264,9 +265,7 @@ describe('MessageService', () => {
264
265
  const result = await messageService.updateMessagePluginState(mockMessageId, key, value);
265
266
 
266
267
  // Assert
267
- expect(MessageModel.update).toHaveBeenCalledWith(mockMessageId, {
268
- pluginState: newPluginState,
269
- });
268
+ expect(MessageModel.updatePluginState).toHaveBeenCalledWith(mockMessageId, key, value);
270
269
  expect(result).toEqual({ ...mockMessage, pluginState: newPluginState });
271
270
  });
272
271
  });
@@ -53,8 +53,9 @@ export class MessageService {
53
53
  async updateMessagePlugin(id: string, plugin: ChatPluginPayload) {
54
54
  return MessageModel.update(id, { plugin });
55
55
  }
56
+
56
57
  async updateMessagePluginState(id: string, key: string, value: any) {
57
- return MessageModel.update(id, { pluginState: { [key]: value } });
58
+ return MessageModel.updatePluginState(id, key, value);
58
59
  }
59
60
 
60
61
  async getAllMessages() {
package/vercel.json CHANGED
@@ -1,3 +1,3 @@
1
1
  {
2
- "installCommand": "npx bun@1.0.15 install"
2
+ "installCommand": "bun install"
3
3
  }