@rolder/kit 3.0.0-alpha.11 → 3.0.0-alpha.111
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/ai/index.d.ts +2 -0
- package/dist/ai/index.js +2 -0
- package/dist/ai/ui/chat/Root.d.ts +55 -0
- package/dist/ai/ui/chat/Root.js +18 -0
- package/dist/ai/ui/chat/chatInput/File.js +71 -0
- package/dist/ai/ui/chat/chatInput/FileIcon.js +43 -0
- package/dist/ai/ui/chat/chatInput/Root.d.ts +9 -0
- package/dist/ai/ui/chat/chatInput/Root.js +24 -0
- package/dist/ai/ui/chat/chatInput/Submit.js +23 -0
- package/dist/ai/ui/{promptInput → chat/chatInput}/Textarea.js +8 -7
- package/dist/ai/ui/{promptInput → chat/chatInput}/index.d.ts +2 -3
- package/dist/ai/ui/{promptInput → chat/chatInput}/index.js +2 -2
- package/dist/ai/ui/chat/chatInput/store/file.d.ts +8 -0
- package/dist/ai/ui/chat/chatInput/store/file.js +32 -0
- package/dist/ai/ui/chat/chatInput/store/fileErrorNotificaton.d.ts +2 -0
- package/dist/ai/ui/chat/chatInput/store/fileErrorNotificaton.js +21 -0
- package/dist/ai/ui/chat/chatInput/store/index.d.ts +2 -0
- package/dist/ai/ui/chat/chatInput/store/index.js +2 -0
- package/dist/ai/ui/chat/chatInput/store/input.d.ts +13 -0
- package/dist/ai/ui/chat/chatInput/store/input.js +81 -0
- package/dist/ai/ui/chat/chatInput/store/parseFile.d.ts +2 -0
- package/dist/ai/ui/chat/chatInput/store/parseFile.js +23 -0
- package/dist/ai/ui/chat/index.d.ts +12 -0
- package/dist/ai/ui/chat/index.js +15 -0
- package/dist/ai/ui/chat/messages/Empty.d.ts +4 -0
- package/dist/ai/ui/chat/messages/Empty.js +11 -0
- package/dist/ai/ui/chat/messages/Loader.d.ts +5 -0
- package/dist/ai/ui/chat/messages/Loader.js +12 -0
- package/dist/ai/ui/chat/messages/Message.d.ts +8 -0
- package/dist/ai/ui/chat/messages/Message.js +22 -0
- package/dist/ai/ui/chat/messages/Messages.d.ts +3 -0
- package/dist/ai/ui/chat/messages/Messages.js +40 -0
- package/dist/ai/ui/chat/messages/index.d.ts +2 -0
- package/dist/ai/ui/chat/messages/index.js +2 -0
- package/dist/ai/ui/chat/parts/File.d.ts +6 -0
- package/dist/ai/ui/{conversation → chat/parts}/File.js +10 -10
- package/dist/ai/ui/chat/parts/FileIcon.js +43 -0
- package/dist/ai/ui/chat/parts/PartPaper.d.ts +8 -0
- package/dist/ai/ui/chat/parts/PartPaper.js +14 -0
- package/dist/ai/ui/chat/parts/TextPart.d.ts +6 -0
- package/dist/ai/ui/chat/parts/TextPart.js +15 -0
- package/dist/ai/ui/chat/parts/ToolExecution.d.ts +7 -0
- package/dist/ai/ui/chat/parts/ToolExecution.js +56 -0
- package/dist/ai/ui/chat/parts/ToolPart.d.ts +10 -0
- package/dist/ai/ui/chat/parts/ToolPart.js +24 -0
- package/dist/ai/ui/chat/parts/index.d.ts +3 -0
- package/dist/ai/ui/chat/parts/index.js +3 -0
- package/dist/ai/ui/chat/store/index.d.ts +4 -0
- package/dist/ai/ui/chat/store/index.js +4 -0
- package/dist/ai/ui/chat/store/messages.d.ts +12 -0
- package/dist/ai/ui/chat/store/messages.js +40 -0
- package/dist/ai/ui/chat/store/send.d.ts +14 -0
- package/dist/ai/ui/chat/store/send.js +16 -0
- package/dist/ai/ui/chat/store/states.d.ts +11 -0
- package/dist/ai/ui/chat/store/states.js +20 -0
- package/dist/ai/ui/chat/store/useInitChat.d.ts +3 -0
- package/dist/ai/ui/chat/store/useInitChat.js +40 -0
- package/dist/ai/ui/index.d.ts +1 -0
- package/dist/ai/ui/index.js +1 -0
- package/dist/ai/utils/index.d.ts +2 -0
- package/dist/ai/utils/index.js +2 -0
- package/dist/app/AppDefaults.js +1 -1
- package/dist/app/DefaultApp.js +1 -1
- package/dist/app/cookieColorSchemeManager.js +1 -1
- package/dist/app/defaultTheme.d.ts +7 -7
- package/dist/app/index.d.ts +3 -0
- package/dist/app/index.js +3 -0
- package/dist/betterAuth/client/getAuthClient.d.ts +3050 -0
- package/dist/betterAuth/client/getAuthClient.js +18 -0
- package/dist/betterAuth/client/index.d.ts +1 -0
- package/dist/betterAuth/client/index.js +1 -0
- package/dist/betterAuth/index.d.ts +3 -0
- package/dist/betterAuth/index.js +3 -0
- package/dist/betterAuth/server/defaultAuthServerConfig.d.ts +1243 -0
- package/dist/betterAuth/server/defaultAuthServerConfig.js +50 -0
- package/dist/betterAuth/server/env.d.ts +1 -0
- package/dist/betterAuth/server/env.js +8 -0
- package/dist/betterAuth/server/getDBSession.d.ts +2 -0
- package/dist/betterAuth/server/getDBSession.js +85 -0
- package/dist/betterAuth/server/getSessionToken.d.ts +1 -0
- package/dist/betterAuth/server/getSessionToken.js +15 -0
- package/dist/betterAuth/server/getSessionUser.d.ts +1 -0
- package/dist/betterAuth/server/getSessionUser.js +22 -0
- package/dist/betterAuth/server/index.d.ts +10 -0
- package/dist/betterAuth/server/index.js +11 -0
- package/dist/betterAuth/server/surrealDbAdapter/adapter.d.ts +8 -0
- package/dist/betterAuth/server/surrealDbAdapter/adapter.js +64 -0
- package/dist/betterAuth/server/surrealDbAdapter/adapter.test.d.ts +1 -0
- package/dist/betterAuth/server/surrealDbAdapter/adapter.test.js +84 -0
- package/dist/betterAuth/server/surrealDbAdapter/db/getDB.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/db/getDB.js +26 -0
- package/dist/betterAuth/server/surrealDbAdapter/db/index.d.ts +1 -0
- package/dist/betterAuth/server/surrealDbAdapter/db/index.js +1 -0
- package/dist/betterAuth/server/surrealDbAdapter/db/schema.d.ts +1 -0
- package/dist/betterAuth/server/surrealDbAdapter/db/schema.js +97 -0
- package/dist/betterAuth/server/surrealDbAdapter/index.d.ts +1 -0
- package/dist/betterAuth/server/surrealDbAdapter/index.js +1 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/count.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/count.js +17 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/create.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/create.js +21 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/delete.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/delete.js +18 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/deleteMany.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/deleteMany.js +19 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/findMany.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/findMany.js +51 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/findOne.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/findOne.js +42 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/index.d.ts +8 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/index.js +8 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/types.d.ts +56 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/update.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/update.js +25 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/updateMany.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/methods/updateMany.js +21 -0
- package/dist/betterAuth/server/surrealDbAdapter/types.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/applyJoinMappings.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/applyJoinMappings.js +31 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/buildExpression.d.ts +3 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/buildExpression.js +58 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/buildJoinPlan.d.ts +9 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/buildJoinPlan.js +46 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/buildSelectFields.d.ts +1 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/buildSelectFields.js +5 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/index.d.ts +6 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/index.js +6 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeOutputRecordIds.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeOutputRecordIds.js +43 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeRecordIds.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeRecordIds.js +38 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeWhereValue.d.ts +2 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeWhereValue.js +33 -0
- package/dist/betterAuth/server/surrealDbAdapter/utils/types.d.ts +34 -0
- package/dist/betterAuth/server/types.d.ts +8 -0
- package/dist/betterAuth/useSessionUser.d.ts +1 -0
- package/dist/betterAuth/useSessionUser.js +8 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +2 -0
- package/dist/styles.css +3 -8
- package/dist/surrealDB/deafaultCrud.d.ts +2 -0
- package/dist/{surreal → surrealDB}/deafaultCrud.js +6 -5
- package/dist/surrealDB/getDBInstance.d.ts +3 -0
- package/dist/surrealDB/getDBInstance.js +34 -0
- package/dist/surrealDB/getDBInstanceTanstack.d.ts +3 -0
- package/dist/{surreal/connection.js → surrealDB/getDBInstanceTanstack.js} +2 -2
- package/dist/surrealDB/index.d.ts +6 -0
- package/dist/surrealDB/index.js +6 -0
- package/dist/{surreal/connection.d.ts → surrealDB/types.d.ts} +3 -3
- package/dist/surrealDB/types.js +0 -0
- package/dist/tanstack/cookie/index.d.ts +3 -0
- package/dist/tanstack/cookie/index.js +4 -0
- package/dist/{functions → tanstack/cookie}/setCookie.d.ts +1 -1
- package/dist/tanstack/index.d.ts +3 -0
- package/dist/tanstack/index.js +3 -0
- package/dist/tanstack/middlewares/index.d.ts +6 -0
- package/dist/tanstack/middlewares/index.js +5 -0
- package/dist/tanstack/middlewares/locale.d.ts +4 -0
- package/dist/{app/defaultRequestMiddlewares.js → tanstack/middlewares/locale.js} +2 -5
- package/dist/tanstack/s3/getS3Client.d.ts +2 -0
- package/dist/tanstack/s3/getS3Client.js +18 -0
- package/dist/tanstack/s3/getSignedFileUrlFn.d.ts +4 -0
- package/dist/tanstack/s3/getSignedFileUrlFn.js +21 -0
- package/dist/tanstack/s3/index.d.ts +2 -0
- package/dist/tanstack/s3/index.js +2 -0
- package/dist/tanstack/s3/uploadRequest.d.ts +3 -0
- package/dist/tanstack/s3/uploadRequest.js +21 -0
- package/dist/ui/AnimatedChevron.d.ts +3 -4
- package/dist/ui/AnimatedChevron.js +6 -25
- package/dist/ui/JsonInput.d.ts +1 -1
- package/dist/ui/JsonInput.js +1 -1
- package/dist/ui/editor/Content.d.ts +2 -2
- package/dist/ui/editor/Content.js +2 -2
- package/dist/ui/editor/Root.d.ts +7 -1
- package/dist/ui/editor/Root.js +42 -5
- package/dist/ui/editor/Toolbar.d.ts +3 -2
- package/dist/ui/editor/Toolbar.js +7 -25
- package/dist/ui/editor/index.d.ts +5 -9
- package/dist/ui/editor/index.js +3 -4
- package/dist/ui/editor/store.d.ts +6 -0
- package/dist/ui/editor/store.js +10 -0
- package/dist/ui/error/DefaultError.d.ts +1 -1
- package/dist/ui/error/DefaultNotFound.d.ts +1 -1
- package/dist/ui/error/Forbidden.d.ts +1 -1
- package/dist/ui/form/buttons/CancelButton.d.ts +2 -2
- package/dist/ui/form/buttons/CancelButton.js +4 -26
- package/dist/ui/form/buttons/SubmitButton.d.ts +2 -2
- package/dist/ui/form/buttons/SubmitButton.js +4 -29
- package/dist/ui/form/buttons/SubscribeActionIcon.d.ts +2 -2
- package/dist/ui/form/buttons/SubscribeButton.d.ts +2 -2
- package/dist/ui/form/context.d.ts +55 -55
- package/dist/ui/form/context.js +3 -3
- package/dist/ui/form/fields/JsonField.d.ts +1 -1
- package/dist/ui/form/fields/MultiSelectField.d.ts +1 -1
- package/dist/ui/form/fields/NumberField.d.ts +1 -1
- package/dist/ui/form/fields/PasswordField.d.ts +2 -0
- package/dist/ui/form/fields/{PassowrdField.js → PasswordField.js} +2 -2
- package/dist/ui/form/fields/SelectField.d.ts +1 -1
- package/dist/ui/form/fields/SwitchField.d.ts +1 -1
- package/dist/ui/form/fields/TextField.d.ts +1 -1
- package/dist/ui/form/fields/TextPasswordField.d.ts +2 -0
- package/dist/ui/form/fields/TextPasswordField.js +29 -0
- package/dist/ui/form/fields/TextareaField.d.ts +1 -1
- package/dist/ui/form/fields/index.d.ts +2 -2
- package/dist/ui/form/fields/index.js +2 -2
- package/dist/ui/form/index.d.ts +0 -1
- package/dist/ui/form/index.js +1 -2
- package/dist/ui/index.d.ts +9 -0
- package/dist/ui/index.js +9 -0
- package/dist/ui/saveInput/JsonInput.d.ts +2 -2
- package/dist/ui/saveInput/NumberInput.d.ts +2 -2
- package/dist/ui/saveInput/SaveInput.d.ts +14 -14
- package/dist/ui/saveInput/Select.d.ts +2 -2
- package/dist/ui/saveInput/Switch.d.ts +2 -2
- package/dist/ui/saveInput/TextInput.d.ts +2 -2
- package/dist/ui/saveInput/Textarea.d.ts +2 -2
- package/dist/ui/scrollArea/Root.d.ts +7 -0
- package/dist/ui/scrollArea/Root.js +42 -0
- package/dist/ui/scrollArea/ScrollButton.d.ts +7 -0
- package/dist/ui/scrollArea/ScrollButton.js +30 -0
- package/dist/ui/scrollArea/index.d.ts +6 -3
- package/dist/ui/scrollArea/index.js +7 -3
- package/dist/ui/scrollArea/methods.d.ts +4 -0
- package/dist/ui/scrollArea/methods.js +32 -0
- package/dist/ui/scrollArea/store.d.ts +12 -0
- package/dist/ui/scrollArea/store.js +25 -0
- package/dist/{ui/form/fieldsSchema.d.ts → zodSchemas.d.ts} +1 -1
- package/dist/{ui/form/fieldsSchema.js → zodSchemas.js} +2 -2
- package/package.json +103 -71
- package/dist/ai/ui/conversation/ConversationContext.d.ts +0 -7
- package/dist/ai/ui/conversation/ConversationContext.js +0 -8
- package/dist/ai/ui/conversation/ConversationProvider.d.ts +0 -2
- package/dist/ai/ui/conversation/ConversationProvider.js +0 -14
- package/dist/ai/ui/conversation/Empty.d.ts +0 -1
- package/dist/ai/ui/conversation/Empty.js +0 -21
- package/dist/ai/ui/conversation/File.d.ts +0 -4
- package/dist/ai/ui/conversation/FileIcon.js +0 -225
- package/dist/ai/ui/conversation/Loader.d.ts +0 -2
- package/dist/ai/ui/conversation/Loader.js +0 -12
- package/dist/ai/ui/conversation/Message.d.ts +0 -4
- package/dist/ai/ui/conversation/Message.js +0 -25
- package/dist/ai/ui/conversation/Root.d.ts +0 -2
- package/dist/ai/ui/conversation/Root.js +0 -26
- package/dist/ai/ui/conversation/index.d.ts +0 -13
- package/dist/ai/ui/conversation/index.js +0 -14
- package/dist/ai/ui/conversation/types.d.ts +0 -7
- package/dist/ai/ui/conversation/useChatMessage.d.ts +0 -2
- package/dist/ai/ui/conversation/useChatMessage.js +0 -12
- package/dist/ai/ui/promptInput/File.js +0 -117
- package/dist/ai/ui/promptInput/FileIcon.js +0 -225
- package/dist/ai/ui/promptInput/PromptInputContext.d.ts +0 -12
- package/dist/ai/ui/promptInput/PromptInputContext.js +0 -8
- package/dist/ai/ui/promptInput/PromptInputProvider.d.ts +0 -2
- package/dist/ai/ui/promptInput/PromptInputProvider.js +0 -50
- package/dist/ai/ui/promptInput/Root.d.ts +0 -3
- package/dist/ai/ui/promptInput/Root.js +0 -17
- package/dist/ai/ui/promptInput/Submit.js +0 -40
- package/dist/ai/ui/promptInput/types.d.ts +0 -11
- package/dist/app/defaultRequestMiddlewares.d.ts +0 -4
- package/dist/index.d.ts +0 -26
- package/dist/index.js +0 -26
- package/dist/surreal/deafaultCrud.d.ts +0 -2
- package/dist/ui/editor/Provider.d.ts +0 -17
- package/dist/ui/editor/Provider.js +0 -80
- package/dist/ui/editor/types.d.ts +0 -7
- package/dist/ui/form/fields/PassowrdField.d.ts +0 -2
- package/dist/ui/form/fields/TextPassowrdField.d.ts +0 -2
- package/dist/ui/form/fields/TextPassowrdField.js +0 -51
- package/dist/ui/scrollArea/ScrollArea.d.ts +0 -62
- package/dist/ui/scrollArea/ScrollArea.js +0 -30
- package/dist/ui/scrollArea/ScrollAreaButton.d.ts +0 -5
- package/dist/ui/scrollArea/ScrollAreaButton.js +0 -51
- package/dist/ui/scrollArea/ScrollAreaContent.d.ts +0 -6
- package/dist/ui/scrollArea/ScrollAreaContent.js +0 -29
- package/dist/ui/scrollArea/context.d.ts +0 -28
- package/dist/ui/scrollArea/context.js +0 -10
- package/dist/ui/scrollArea/types.d.ts +0 -65
- package/dist/ui/scrollArea/useScrollArea.d.ts +0 -9
- package/dist/ui/scrollArea/useScrollArea.js +0 -146
- /package/dist/ai/ui/{promptInput → chat/chatInput}/File.d.ts +0 -0
- /package/dist/ai/ui/{conversation → chat/chatInput}/FileIcon.d.ts +0 -0
- /package/dist/ai/ui/{promptInput → chat/chatInput}/Footer.d.ts +0 -0
- /package/dist/ai/ui/{promptInput → chat/chatInput}/Footer.js +0 -0
- /package/dist/ai/ui/{promptInput → chat/chatInput}/Submit.d.ts +0 -0
- /package/dist/ai/ui/{promptInput → chat/chatInput}/Textarea.d.ts +0 -0
- /package/dist/ai/ui/{promptInput → chat/parts}/FileIcon.d.ts +0 -0
- /package/dist/{ai/ui/conversation → betterAuth/server/surrealDbAdapter/methods}/types.js +0 -0
- /package/dist/{ai/ui/promptInput → betterAuth/server/surrealDbAdapter}/types.js +0 -0
- /package/dist/{ui/editor → betterAuth/server/surrealDbAdapter/utils}/types.js +0 -0
- /package/dist/{ui/scrollArea → betterAuth/server}/types.js +0 -0
- /package/dist/{surreal → surrealDB}/deserialize.d.ts +0 -0
- /package/dist/{surreal → surrealDB}/deserialize.js +0 -0
- /package/dist/{surreal → surrealDB}/encryption.d.ts +0 -0
- /package/dist/{surreal → surrealDB}/encryption.js +0 -0
- /package/dist/{functions → tanstack/cookie}/getCookie.d.ts +0 -0
- /package/dist/{functions → tanstack/cookie}/getCookie.js +0 -0
- /package/dist/{functions → tanstack/cookie}/setCookie.js +0 -0
- /package/dist/{functions → tanstack/cookie}/setCookies.d.ts +0 -0
- /package/dist/{functions → tanstack/cookie}/setCookies.js +0 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Table, raw, surql } from "surrealdb";
|
|
2
|
+
import { getDb } from "../db/index.js";
|
|
3
|
+
import { applyJoinMappings, buildExpression, buildJoinPlan, buildSelectFields, normalizeOutputRecordIds } from "../utils/index.js";
|
|
4
|
+
const findMany = async ({ model, where, limit, offset, sortBy, join, surrealDbProps, ...args })=>{
|
|
5
|
+
const db = await getDb(surrealDbProps);
|
|
6
|
+
const table = new Table(model);
|
|
7
|
+
const expression = buildExpression({
|
|
8
|
+
model,
|
|
9
|
+
where,
|
|
10
|
+
...args
|
|
11
|
+
});
|
|
12
|
+
const joinPlan = buildJoinPlan({
|
|
13
|
+
model,
|
|
14
|
+
join,
|
|
15
|
+
...args
|
|
16
|
+
});
|
|
17
|
+
const fields = buildSelectFields(void 0, (field)=>args.getFieldName({
|
|
18
|
+
model,
|
|
19
|
+
field
|
|
20
|
+
}));
|
|
21
|
+
const baseFields = fields.split(', ');
|
|
22
|
+
const joinFields = joinPlan.selectFields.filter((field)=>!baseFields.includes(field));
|
|
23
|
+
const finalFields = [
|
|
24
|
+
...baseFields,
|
|
25
|
+
...joinFields
|
|
26
|
+
].join(', ');
|
|
27
|
+
const query = surql`SELECT ${raw(finalFields)} FROM ${table}`;
|
|
28
|
+
if (expression) query.append(surql` WHERE ${expression}`);
|
|
29
|
+
if (sortBy) {
|
|
30
|
+
const orderField = args.getFieldName({
|
|
31
|
+
model,
|
|
32
|
+
field: sortBy.field
|
|
33
|
+
});
|
|
34
|
+
const direction = sortBy.direction.toUpperCase();
|
|
35
|
+
query.append(surql` ORDER BY ${raw(orderField)} ${raw(direction)}`);
|
|
36
|
+
}
|
|
37
|
+
if ('number' == typeof offset) query.append(surql` START ${offset}`);
|
|
38
|
+
query.append(surql` LIMIT ${limit}`);
|
|
39
|
+
if (joinPlan.fetchFields.size > 0) query.append(surql` FETCH ${raw(Array.from(joinPlan.fetchFields).join(', '))}`);
|
|
40
|
+
const [rows] = await db.query(query).json().collect();
|
|
41
|
+
return (rows ?? []).map((row)=>normalizeOutputRecordIds({
|
|
42
|
+
model,
|
|
43
|
+
data: applyJoinMappings({
|
|
44
|
+
row,
|
|
45
|
+
mappings: joinPlan.mappings,
|
|
46
|
+
...args
|
|
47
|
+
}),
|
|
48
|
+
...args
|
|
49
|
+
}));
|
|
50
|
+
};
|
|
51
|
+
export { findMany };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Table, raw, surql } from "surrealdb";
|
|
2
|
+
import { getDb } from "../db/index.js";
|
|
3
|
+
import { applyJoinMappings, buildExpression, buildJoinPlan, buildSelectFields, normalizeOutputRecordIds } from "../utils/index.js";
|
|
4
|
+
const findOne = async ({ model, where, select, join, surrealDbProps, ...args })=>{
|
|
5
|
+
const db = await getDb(surrealDbProps);
|
|
6
|
+
const table = new Table(model);
|
|
7
|
+
const expression = buildExpression({
|
|
8
|
+
model,
|
|
9
|
+
where,
|
|
10
|
+
...args
|
|
11
|
+
});
|
|
12
|
+
const joinPlan = buildJoinPlan({
|
|
13
|
+
model,
|
|
14
|
+
join,
|
|
15
|
+
...args
|
|
16
|
+
});
|
|
17
|
+
const fields = buildSelectFields(select, (field)=>args.getFieldName({
|
|
18
|
+
model,
|
|
19
|
+
field
|
|
20
|
+
}));
|
|
21
|
+
const baseFields = fields.split(', ');
|
|
22
|
+
const joinFields = joinPlan.selectFields.filter((field)=>!baseFields.includes(field));
|
|
23
|
+
const finalFields = [
|
|
24
|
+
...baseFields,
|
|
25
|
+
...joinFields
|
|
26
|
+
].join(', ');
|
|
27
|
+
const query = surql`SELECT ${raw(finalFields)} FROM ${table}`;
|
|
28
|
+
if (expression) query.append(surql` WHERE ${expression}`);
|
|
29
|
+
query.append(surql` LIMIT ${1}`);
|
|
30
|
+
if (joinPlan.fetchFields.size > 0) query.append(surql` FETCH ${raw(Array.from(joinPlan.fetchFields).join(', '))}`);
|
|
31
|
+
const [rows] = await db.query(query).json().collect();
|
|
32
|
+
return normalizeOutputRecordIds({
|
|
33
|
+
model,
|
|
34
|
+
data: applyJoinMappings({
|
|
35
|
+
row: rows?.[0] ?? null,
|
|
36
|
+
mappings: joinPlan.mappings,
|
|
37
|
+
...args
|
|
38
|
+
}),
|
|
39
|
+
...args
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
export { findOne };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { AdapterFactoryCustomizeAdapterCreator, JoinConfig, Where } from 'better-auth/adapters';
|
|
2
|
+
import type { SurrealDBProps } from '../../../../surrealDB/types';
|
|
3
|
+
type Args = Parameters<AdapterFactoryCustomizeAdapterCreator>[0];
|
|
4
|
+
export type Create<T> = Args & {
|
|
5
|
+
model: string;
|
|
6
|
+
data: T;
|
|
7
|
+
surrealDbProps?: SurrealDBProps;
|
|
8
|
+
};
|
|
9
|
+
export type FindOne = Args & {
|
|
10
|
+
model: string;
|
|
11
|
+
where: Required<Where>[];
|
|
12
|
+
select?: string[];
|
|
13
|
+
join?: JoinConfig;
|
|
14
|
+
surrealDbProps?: SurrealDBProps;
|
|
15
|
+
};
|
|
16
|
+
export type SortBy = {
|
|
17
|
+
field: string;
|
|
18
|
+
direction: 'asc' | 'desc';
|
|
19
|
+
};
|
|
20
|
+
export type FindMany = Args & {
|
|
21
|
+
model: string;
|
|
22
|
+
where?: Required<Where>[];
|
|
23
|
+
limit: number;
|
|
24
|
+
offset?: number;
|
|
25
|
+
sortBy?: SortBy;
|
|
26
|
+
join?: JoinConfig;
|
|
27
|
+
surrealDbProps?: SurrealDBProps;
|
|
28
|
+
};
|
|
29
|
+
export type Update<T> = Args & {
|
|
30
|
+
model: string;
|
|
31
|
+
where: Required<Where>[];
|
|
32
|
+
update: T;
|
|
33
|
+
surrealDbProps?: SurrealDBProps;
|
|
34
|
+
};
|
|
35
|
+
export type UpdateMany = Args & {
|
|
36
|
+
model: string;
|
|
37
|
+
where: Required<Where>[];
|
|
38
|
+
update: Record<string, unknown>;
|
|
39
|
+
surrealDbProps?: SurrealDBProps;
|
|
40
|
+
};
|
|
41
|
+
export type Delete = Args & {
|
|
42
|
+
model: string;
|
|
43
|
+
where: Required<Where>[];
|
|
44
|
+
surrealDbProps?: SurrealDBProps;
|
|
45
|
+
};
|
|
46
|
+
export type DeleteMany = Args & {
|
|
47
|
+
model: string;
|
|
48
|
+
where: Required<Where>[];
|
|
49
|
+
surrealDbProps?: SurrealDBProps;
|
|
50
|
+
};
|
|
51
|
+
export type Count = Args & {
|
|
52
|
+
model: string;
|
|
53
|
+
where?: Required<Where>[];
|
|
54
|
+
surrealDbProps?: SurrealDBProps;
|
|
55
|
+
};
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Table } from "surrealdb";
|
|
2
|
+
import { getDb } from "../db/index.js";
|
|
3
|
+
import { buildExpression, normalizeOutputRecordIds, normalizeRecordIds } from "../utils/index.js";
|
|
4
|
+
const update_update = async ({ model, where, update, surrealDbProps, ...args })=>{
|
|
5
|
+
if (!where || 0 === where.length) throw new Error('Update requires a where clause');
|
|
6
|
+
const db = await getDb(surrealDbProps);
|
|
7
|
+
const normalized = normalizeRecordIds({
|
|
8
|
+
model,
|
|
9
|
+
data: update,
|
|
10
|
+
...args
|
|
11
|
+
});
|
|
12
|
+
const table = new Table(model);
|
|
13
|
+
const expression = buildExpression({
|
|
14
|
+
model,
|
|
15
|
+
where,
|
|
16
|
+
...args
|
|
17
|
+
});
|
|
18
|
+
const [updated] = await db.update(table).merge(normalized).where(expression).json();
|
|
19
|
+
return normalizeOutputRecordIds({
|
|
20
|
+
model,
|
|
21
|
+
data: updated ?? null,
|
|
22
|
+
...args
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
export { update_update as update };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Table } from "surrealdb";
|
|
2
|
+
import { getDb } from "../db/index.js";
|
|
3
|
+
import { buildExpression, normalizeRecordIds } from "../utils/index.js";
|
|
4
|
+
const updateMany = async ({ model, where, update, surrealDbProps, ...args })=>{
|
|
5
|
+
if (!where || 0 === where.length) throw new Error('UpdateMany requires a where clause');
|
|
6
|
+
const db = await getDb(surrealDbProps);
|
|
7
|
+
const normalized = normalizeRecordIds({
|
|
8
|
+
model,
|
|
9
|
+
data: update,
|
|
10
|
+
...args
|
|
11
|
+
});
|
|
12
|
+
const table = new Table(model);
|
|
13
|
+
const expression = buildExpression({
|
|
14
|
+
model,
|
|
15
|
+
where,
|
|
16
|
+
...args
|
|
17
|
+
});
|
|
18
|
+
const updated = await db.update(table).merge(normalized).where(expression).json();
|
|
19
|
+
return updated?.length ?? 0;
|
|
20
|
+
};
|
|
21
|
+
export { updateMany };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { normalizeOutputRecordIds } from "./normalizeOutputRecordIds.js";
|
|
2
|
+
const applyJoinMappings = ({ row, mappings, ...args })=>{
|
|
3
|
+
if (!row || 0 === mappings.length) return row;
|
|
4
|
+
const normalized = {
|
|
5
|
+
...row
|
|
6
|
+
};
|
|
7
|
+
for (const mapping of mappings){
|
|
8
|
+
if (void 0 !== normalized[mapping.modelName]) continue;
|
|
9
|
+
if (void 0 === normalized[mapping.sourceField]) continue;
|
|
10
|
+
const sourceValue = normalized[mapping.sourceField];
|
|
11
|
+
if (Array.isArray(sourceValue)) {
|
|
12
|
+
normalized[mapping.modelName] = sourceValue.map((item)=>normalizeOutputRecordIds({
|
|
13
|
+
model: mapping.modelName,
|
|
14
|
+
data: item,
|
|
15
|
+
...args
|
|
16
|
+
}));
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
if (sourceValue && 'object' == typeof sourceValue) {
|
|
20
|
+
normalized[mapping.modelName] = normalizeOutputRecordIds({
|
|
21
|
+
model: mapping.modelName,
|
|
22
|
+
data: sourceValue,
|
|
23
|
+
...args
|
|
24
|
+
});
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
normalized[mapping.modelName] = sourceValue;
|
|
28
|
+
}
|
|
29
|
+
return normalized;
|
|
30
|
+
};
|
|
31
|
+
export { applyJoinMappings };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { and, contains, eq, gt, gte, inside, lt, lte, or } from "surrealdb";
|
|
2
|
+
import { normalizeWhereValue } from "./normalizeWhereValue.js";
|
|
3
|
+
const buildExpression = ({ model, where, ...args })=>{
|
|
4
|
+
if (!where || 0 === where.length) return;
|
|
5
|
+
const opExpression = (clause)=>{
|
|
6
|
+
const field = clause.field;
|
|
7
|
+
const value = normalizeWhereValue({
|
|
8
|
+
model,
|
|
9
|
+
field,
|
|
10
|
+
value: clause.value,
|
|
11
|
+
...args
|
|
12
|
+
});
|
|
13
|
+
const operator = clause.operator ?? 'eq';
|
|
14
|
+
switch(operator){
|
|
15
|
+
case 'ne':
|
|
16
|
+
return {
|
|
17
|
+
toSQL: (ctx)=>`${field} != ${ctx.def(value)}`
|
|
18
|
+
};
|
|
19
|
+
case 'gt':
|
|
20
|
+
return gt(field, value);
|
|
21
|
+
case 'gte':
|
|
22
|
+
return gte(field, value);
|
|
23
|
+
case 'lt':
|
|
24
|
+
return lt(field, value);
|
|
25
|
+
case 'lte':
|
|
26
|
+
return lte(field, value);
|
|
27
|
+
case 'contains':
|
|
28
|
+
return contains(field, value);
|
|
29
|
+
case 'starts_with':
|
|
30
|
+
return {
|
|
31
|
+
toSQL: (ctx)=>`string::starts_with(${field}, ${ctx.def(value)})`
|
|
32
|
+
};
|
|
33
|
+
case 'ends_with':
|
|
34
|
+
return {
|
|
35
|
+
toSQL: (ctx)=>`string::ends_with(${field}, ${ctx.def(value)})`
|
|
36
|
+
};
|
|
37
|
+
case 'in':
|
|
38
|
+
return inside(field, value);
|
|
39
|
+
case 'not_in':
|
|
40
|
+
return {
|
|
41
|
+
toSQL: (ctx)=>`${field} NOT IN ${ctx.def(value)}`
|
|
42
|
+
};
|
|
43
|
+
default:
|
|
44
|
+
return eq(field, value);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
let expression;
|
|
48
|
+
for (const clause of where){
|
|
49
|
+
const next = opExpression(clause);
|
|
50
|
+
if (!expression) {
|
|
51
|
+
expression = next;
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
expression = 'OR' === clause.connector ? or(expression, next) : and(expression, next);
|
|
55
|
+
}
|
|
56
|
+
return expression;
|
|
57
|
+
};
|
|
58
|
+
export { buildExpression };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BuildJoinPlan } from './types';
|
|
2
|
+
export declare const buildJoinPlan: ({ model, join, getDefaultModelName, }: BuildJoinPlan) => {
|
|
3
|
+
selectFields: string[];
|
|
4
|
+
fetchFields: Set<string>;
|
|
5
|
+
mappings: {
|
|
6
|
+
modelName: string;
|
|
7
|
+
sourceField: string;
|
|
8
|
+
}[];
|
|
9
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
const buildJoinPlan = ({ model, join, getDefaultModelName })=>{
|
|
2
|
+
const joinFieldsByModel = {
|
|
3
|
+
user: {
|
|
4
|
+
account: 'accounts',
|
|
5
|
+
session: 'sessions'
|
|
6
|
+
}
|
|
7
|
+
};
|
|
8
|
+
const selectFields = [];
|
|
9
|
+
const fetchFields = new Set();
|
|
10
|
+
const mappings = [];
|
|
11
|
+
if (!join || 0 === Object.keys(join).length) return {
|
|
12
|
+
selectFields,
|
|
13
|
+
fetchFields,
|
|
14
|
+
mappings
|
|
15
|
+
};
|
|
16
|
+
for (const [joinModel, joinConfig] of Object.entries(join)){
|
|
17
|
+
const baseModelName = getDefaultModelName(model);
|
|
18
|
+
const joinModelName = getDefaultModelName(joinModel);
|
|
19
|
+
const relation = joinConfig.relation ?? 'one-to-many';
|
|
20
|
+
if ('one-to-one' === relation) {
|
|
21
|
+
const fromField = joinConfig.on.from;
|
|
22
|
+
selectFields.push(fromField);
|
|
23
|
+
fetchFields.add(fromField);
|
|
24
|
+
mappings.push({
|
|
25
|
+
modelName: joinModel,
|
|
26
|
+
sourceField: fromField
|
|
27
|
+
});
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
const computedField = joinFieldsByModel[baseModelName]?.[joinModelName];
|
|
31
|
+
if (computedField) {
|
|
32
|
+
selectFields.push(computedField);
|
|
33
|
+
fetchFields.add(computedField);
|
|
34
|
+
mappings.push({
|
|
35
|
+
modelName: joinModel,
|
|
36
|
+
sourceField: computedField
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
selectFields,
|
|
42
|
+
fetchFields,
|
|
43
|
+
mappings
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export { buildJoinPlan };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const buildSelectFields: (select: string[] | undefined, mapField: (field: string) => string) => string;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { RecordId } from "surrealdb";
|
|
2
|
+
const normalizeOutputRecordIds = ({ model, data, getDefaultModelName, getDefaultFieldName, getFieldAttributes })=>{
|
|
3
|
+
if (!data) return data;
|
|
4
|
+
const normalized = {
|
|
5
|
+
...data
|
|
6
|
+
};
|
|
7
|
+
const defaultModelName = getDefaultModelName(model);
|
|
8
|
+
const stripRecordId = (raw)=>{
|
|
9
|
+
if (raw instanceof RecordId) return stripRecordId(String(raw));
|
|
10
|
+
if ('string' != typeof raw) return raw;
|
|
11
|
+
const separatorIndex = raw.indexOf(':');
|
|
12
|
+
if (-1 === separatorIndex) return raw;
|
|
13
|
+
let id = raw.slice(separatorIndex + 1);
|
|
14
|
+
if (id.startsWith('⟨') && id.endsWith('⟩')) id = id.slice(1, -1);
|
|
15
|
+
return id;
|
|
16
|
+
};
|
|
17
|
+
for (const [field, value] of Object.entries(normalized)){
|
|
18
|
+
let defaultField;
|
|
19
|
+
try {
|
|
20
|
+
defaultField = getDefaultFieldName({
|
|
21
|
+
model: defaultModelName,
|
|
22
|
+
field
|
|
23
|
+
});
|
|
24
|
+
} catch {
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
const applyStrip = (targetValue)=>{
|
|
28
|
+
if (Array.isArray(targetValue)) return targetValue.map((entry)=>stripRecordId(entry));
|
|
29
|
+
return stripRecordId(targetValue);
|
|
30
|
+
};
|
|
31
|
+
if ('id' === defaultField) {
|
|
32
|
+
normalized[field] = applyStrip(value);
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
const fieldAttr = getFieldAttributes({
|
|
36
|
+
model: defaultModelName,
|
|
37
|
+
field: defaultField
|
|
38
|
+
});
|
|
39
|
+
if (fieldAttr?.references?.field === 'id') normalized[field] = applyStrip(value);
|
|
40
|
+
}
|
|
41
|
+
return normalized;
|
|
42
|
+
};
|
|
43
|
+
export { normalizeOutputRecordIds };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { RecordId } from "surrealdb";
|
|
2
|
+
import { deserialize } from "../../../../surrealDB/index.js";
|
|
3
|
+
const normalizeRecordIds = ({ model, data, getDefaultModelName, getDefaultFieldName, getFieldAttributes, getModelName })=>{
|
|
4
|
+
const normalized = {
|
|
5
|
+
...data
|
|
6
|
+
};
|
|
7
|
+
const defaultModelName = getDefaultModelName(model);
|
|
8
|
+
const toRecordId = (target, raw)=>{
|
|
9
|
+
if (raw instanceof RecordId) return raw;
|
|
10
|
+
if ('string' == typeof raw) return raw.includes(':') ? deserialize(raw) : new RecordId(target, raw);
|
|
11
|
+
return raw;
|
|
12
|
+
};
|
|
13
|
+
for (const [field, value] of Object.entries(normalized)){
|
|
14
|
+
let defaultField;
|
|
15
|
+
try {
|
|
16
|
+
defaultField = getDefaultFieldName({
|
|
17
|
+
model: defaultModelName,
|
|
18
|
+
field
|
|
19
|
+
});
|
|
20
|
+
} catch {
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
if ('id' === defaultField) continue;
|
|
24
|
+
const fieldAttr = getFieldAttributes({
|
|
25
|
+
model: defaultModelName,
|
|
26
|
+
field: defaultField
|
|
27
|
+
});
|
|
28
|
+
if (fieldAttr?.references?.field !== 'id') continue;
|
|
29
|
+
const targetModel = getModelName(fieldAttr.references.model);
|
|
30
|
+
if (Array.isArray(value)) {
|
|
31
|
+
normalized[field] = value.map((entry)=>toRecordId(targetModel, entry));
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
normalized[field] = toRecordId(targetModel, value);
|
|
35
|
+
}
|
|
36
|
+
return normalized;
|
|
37
|
+
};
|
|
38
|
+
export { normalizeRecordIds };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { RecordId } from "surrealdb";
|
|
2
|
+
import { deserialize } from "../../../../surrealDB/index.js";
|
|
3
|
+
const normalizeWhereValue = ({ model, field, value, getDefaultModelName, getDefaultFieldName, getModelName, getFieldAttributes })=>{
|
|
4
|
+
const defaultModelName = getDefaultModelName(model);
|
|
5
|
+
const toRecordId = (target, raw)=>{
|
|
6
|
+
if (raw instanceof RecordId) return raw;
|
|
7
|
+
if ('string' == typeof raw) return raw.includes(':') ? deserialize(raw) : new RecordId(target, raw);
|
|
8
|
+
return raw;
|
|
9
|
+
};
|
|
10
|
+
let defaultField;
|
|
11
|
+
try {
|
|
12
|
+
defaultField = getDefaultFieldName({
|
|
13
|
+
model: defaultModelName,
|
|
14
|
+
field
|
|
15
|
+
});
|
|
16
|
+
} catch {
|
|
17
|
+
return value;
|
|
18
|
+
}
|
|
19
|
+
if ('id' === defaultField) {
|
|
20
|
+
const targetModel = getModelName(defaultModelName);
|
|
21
|
+
if (Array.isArray(value)) return value.map((entry)=>toRecordId(targetModel, entry));
|
|
22
|
+
return toRecordId(targetModel, value);
|
|
23
|
+
}
|
|
24
|
+
const fieldAttr = getFieldAttributes({
|
|
25
|
+
model: defaultModelName,
|
|
26
|
+
field: defaultField
|
|
27
|
+
});
|
|
28
|
+
if (fieldAttr?.references?.field !== 'id') return value;
|
|
29
|
+
const targetModel = getModelName(fieldAttr.references.model);
|
|
30
|
+
if (Array.isArray(value)) return value.map((entry)=>toRecordId(targetModel, entry));
|
|
31
|
+
return toRecordId(targetModel, value);
|
|
32
|
+
};
|
|
33
|
+
export { normalizeWhereValue };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { JoinConfig, Where } from 'better-auth/adapters';
|
|
2
|
+
import type { Args } from '../types';
|
|
3
|
+
export type NormalizeRecordIds = Args & {
|
|
4
|
+
model: string;
|
|
5
|
+
data: object;
|
|
6
|
+
};
|
|
7
|
+
export type NormalizeOutputRecordIds = Args & {
|
|
8
|
+
model: string;
|
|
9
|
+
data: object | null;
|
|
10
|
+
};
|
|
11
|
+
export type NormalizeWhereValue = Args & {
|
|
12
|
+
model: string;
|
|
13
|
+
field: string;
|
|
14
|
+
value: unknown;
|
|
15
|
+
};
|
|
16
|
+
export type BuildExpression = Args & {
|
|
17
|
+
model: string;
|
|
18
|
+
where: Required<Where>[] | undefined;
|
|
19
|
+
};
|
|
20
|
+
export type BuildJoinPlan = Args & {
|
|
21
|
+
model: string;
|
|
22
|
+
join?: JoinConfig;
|
|
23
|
+
};
|
|
24
|
+
export type ApplyJoinMappings = Args & {
|
|
25
|
+
row: object | null;
|
|
26
|
+
mappings: Array<{
|
|
27
|
+
modelName: string;
|
|
28
|
+
sourceField: string;
|
|
29
|
+
}>;
|
|
30
|
+
};
|
|
31
|
+
export type SortBy = {
|
|
32
|
+
field: string;
|
|
33
|
+
direction: 'asc' | 'desc';
|
|
34
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type * from 'better-auth/client/plugins';
|
|
2
|
+
export type * from 'better-auth/minimal';
|
|
3
|
+
export type * from 'better-auth/plugins';
|
|
4
|
+
export type InferUserWithRoles<TInferredUser extends {
|
|
5
|
+
role?: string | null;
|
|
6
|
+
}, TRoles extends Record<string, unknown>> = Omit<TInferredUser, 'role'> & {
|
|
7
|
+
role: keyof TRoles;
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useSessionUser: <TUser = unknown>() => TUser | undefined;
|
package/dist/styles.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.rolder-
|
|
1
|
+
.rolder-chat-input-root {
|
|
2
2
|
background-color: light-dark(var(--mantine-color-white), var(--mantine-color-dark-6));
|
|
3
3
|
|
|
4
4
|
&:focus-within {
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
.rolder-
|
|
11
|
+
.rolder-chat-input-textarea {
|
|
12
12
|
border: 0;
|
|
13
13
|
border-radius: 8px;
|
|
14
14
|
overflow: hidden;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
.rolder-
|
|
17
|
+
.rolder-chat-input-file-action-action {
|
|
18
18
|
color: light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-1));
|
|
19
19
|
|
|
20
20
|
&[data-disabled] {
|
|
@@ -62,11 +62,6 @@
|
|
|
62
62
|
border-radius: var(--radius);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
.rolder-scroll-area-content {
|
|
66
|
-
width: 100%;
|
|
67
|
-
height: 100%;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
65
|
.rolder-scroll-area-scrollbar {
|
|
71
66
|
border-top-right-radius: var(--radius);
|
|
72
67
|
border-bottom-right-radius: var(--radius);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const surrealDeleteFn: import("@tanstack/react-start").RequiredFetcher<undefined, import("zod").ZodString, Promise<void>>;
|
|
2
|
+
export declare const surrealUnsubscribeFn: import("@tanstack/react-start").RequiredFetcher<undefined, import("zod").ZodString, Promise<void>>;
|