@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.
- package/.i18nrc.js +1 -0
- package/CHANGELOG.md +50 -0
- package/LICENSE +1 -1
- package/README.md +8 -8
- package/README.zh-CN.md +50 -7
- package/locales/ar/chat.json +96 -0
- package/locales/ar/common.json +114 -0
- package/locales/ar/error.json +72 -0
- package/locales/ar/market.json +30 -0
- package/locales/ar/migration.json +45 -0
- package/locales/ar/plugin.json +166 -0
- package/locales/ar/setting.json +306 -0
- package/locales/ar/tool.json +9 -0
- package/locales/ar/welcome.json +14 -0
- package/package.json +5 -3
- package/src/app/home/Redirect.tsx +4 -0
- package/src/app/layout.tsx +3 -2
- package/src/database/models/message.ts +6 -0
- package/src/features/Conversation/Actions/Function.tsx +2 -2
- package/src/locales/create.ts +8 -1
- package/src/locales/default/common.ts +1 -0
- package/src/locales/resources.ts +5 -0
- package/src/services/__tests__/message.test.ts +3 -4
- package/src/services/message.ts +2 -1
- package/vercel.json +1 -1
|
@@ -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.
|
|
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.
|
|
268
|
-
pluginState: newPluginState,
|
|
269
|
-
});
|
|
268
|
+
expect(MessageModel.updatePluginState).toHaveBeenCalledWith(mockMessageId, key, value);
|
|
270
269
|
expect(result).toEqual({ ...mockMessage, pluginState: newPluginState });
|
|
271
270
|
});
|
|
272
271
|
});
|
package/src/services/message.ts
CHANGED
|
@@ -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.
|
|
58
|
+
return MessageModel.updatePluginState(id, key, value);
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
async getAllMessages() {
|
package/vercel.json
CHANGED