@rolder/kit 3.0.0-alpha.91 → 3.0.0-alpha.93
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/ui/chat/chatInput/store/input.js +1 -1
- 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 +1 -1
- package/dist/app/index.d.ts +0 -1
- package/dist/app/index.js +0 -1
- 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/auth.test.d.ts +1 -0
- package/dist/betterAuth/server/auth.test.js +71 -0
- package/dist/betterAuth/server/getAuthServer.d.ts +8 -0
- package/dist/betterAuth/server/getAuthServer.js +69 -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 +13 -0
- package/dist/betterAuth/server/getSessionUser.d.ts +1 -0
- package/dist/betterAuth/server/getSessionUser.js +21 -0
- package/dist/betterAuth/server/index.d.ts +9 -0
- package/dist/betterAuth/server/index.js +10 -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 +31 -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/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/types.js +0 -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/types.js +0 -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/surrealDbAdapter/utils/types.js +0 -0
- package/dist/betterAuth/useSessionUser.d.ts +1 -0
- package/dist/betterAuth/useSessionUser.js +8 -0
- package/dist/surrealDB/deafaultCrud.d.ts +2 -0
- package/dist/{tanstackFunctions/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/{tanstackFunctions/surreal/connection.js → surrealDB/getDBInstanceTanstack.js} +3 -7
- package/dist/surrealDB/index.d.ts +6 -0
- package/dist/surrealDB/index.js +6 -0
- package/dist/{tanstackFunctions/surreal/connection.d.ts → surrealDB/types.d.ts} +3 -3
- package/dist/surrealDB/types.js +0 -0
- package/dist/{tanstackFunctions → tanstack}/index.d.ts +1 -1
- package/dist/{tanstackFunctions → tanstack}/index.js +1 -1
- package/dist/{app/defaultRequestMiddlewares.d.ts → tanstack/middlewares/index.d.ts} +2 -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/ui/JsonInput.js +1 -1
- package/dist/ui/form/index.d.ts +0 -1
- package/dist/ui/form/index.js +1 -2
- 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 +17 -15
- package/dist/index.d.ts +0 -5
- package/dist/index.js +0 -5
- package/dist/tanstackFunctions/surreal/deafaultCrud.d.ts +0 -2
- package/dist/tanstackFunctions/surreal/index.d.ts +0 -4
- package/dist/tanstackFunctions/surreal/index.js +0 -4
- /package/dist/{tanstackFunctions/surreal → surrealDB}/deserialize.d.ts +0 -0
- /package/dist/{tanstackFunctions/surreal → surrealDB}/deserialize.js +0 -0
- /package/dist/{tanstackFunctions/surreal → surrealDB}/encryption.d.ts +0 -0
- /package/dist/{tanstackFunctions/surreal → surrealDB}/encryption.js +0 -0
- /package/dist/{tanstackFunctions → tanstack}/cookie/getCookie.d.ts +0 -0
- /package/dist/{tanstackFunctions → tanstack}/cookie/getCookie.js +0 -0
- /package/dist/{tanstackFunctions → tanstack}/cookie/index.d.ts +0 -0
- /package/dist/{tanstackFunctions → tanstack}/cookie/index.js +0 -0
- /package/dist/{tanstackFunctions → tanstack}/cookie/setCookie.d.ts +0 -0
- /package/dist/{tanstackFunctions → tanstack}/cookie/setCookie.js +0 -0
- /package/dist/{tanstackFunctions → tanstack}/cookie/setCookies.d.ts +0 -0
- /package/dist/{tanstackFunctions → tanstack}/cookie/setCookies.js +0 -0
- /package/dist/{tanstackFunctions → tanstack}/s3/getS3Client.d.ts +0 -0
- /package/dist/{tanstackFunctions → tanstack}/s3/getS3Client.js +0 -0
- /package/dist/{tanstackFunctions → tanstack}/s3/getSignedFileUrlFn.d.ts +0 -0
- /package/dist/{tanstackFunctions → tanstack}/s3/getSignedFileUrlFn.js +0 -0
- /package/dist/{tanstackFunctions → tanstack}/s3/index.d.ts +0 -0
- /package/dist/{tanstackFunctions → tanstack}/s3/index.js +0 -0
- /package/dist/{tanstackFunctions → tanstack}/s3/uploadRequest.d.ts +0 -0
- /package/dist/{tanstackFunctions → tanstack}/s3/uploadRequest.js +0 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Surreal } from "surrealdb";
|
|
2
|
+
let db = null;
|
|
3
|
+
const getDBInstance = async (params = {})=>{
|
|
4
|
+
if (db?.isConnected) return db;
|
|
5
|
+
const instance = new Surreal();
|
|
6
|
+
try {
|
|
7
|
+
const url = params.url || process.env.SURREALDB_URL;
|
|
8
|
+
if (!url) throw new Error('Missing required SurrealDB URL');
|
|
9
|
+
const namespace = params.namespace || process.env.SURREALDB_NAMESPACE;
|
|
10
|
+
if (!namespace) throw new Error('Missing required SurrealDB namespace');
|
|
11
|
+
const database = params.database || process.env.SURREALDB_DATABASE;
|
|
12
|
+
if (!database) throw new Error('Missing required SurrealDB database');
|
|
13
|
+
const username = params.username || process.env.SURREALDB_USERNAME;
|
|
14
|
+
const password = params.password || process.env.SURREALDB_PASSWORD;
|
|
15
|
+
if (username && password) await instance.connect(url, {
|
|
16
|
+
authentication: {
|
|
17
|
+
username,
|
|
18
|
+
password
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
else await instance.connect(url);
|
|
22
|
+
await instance.use({
|
|
23
|
+
namespace,
|
|
24
|
+
database
|
|
25
|
+
});
|
|
26
|
+
db = instance;
|
|
27
|
+
return instance;
|
|
28
|
+
} catch (error) {
|
|
29
|
+
console.error('Failed to connect to SurrealDB:', error);
|
|
30
|
+
db = null;
|
|
31
|
+
throw error;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
export { getDBInstance };
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { createServerOnlyFn } from "@tanstack/react-start";
|
|
2
2
|
import { getCookie } from "@tanstack/react-start/server";
|
|
3
|
-
import { DateTime, Surreal
|
|
3
|
+
import { DateTime, Surreal } from "surrealdb";
|
|
4
4
|
let db = null;
|
|
5
|
-
const
|
|
6
|
-
console.log('DB');
|
|
5
|
+
const getDBInstanceTanstack = createServerOnlyFn(async (params = {})=>{
|
|
7
6
|
if (db?.isConnected) return db;
|
|
8
7
|
const locale = getCookie('locale') || 'ru-RU';
|
|
9
8
|
const timeZone = getCookie('tz') || 'UTC';
|
|
10
9
|
const instance = new Surreal({
|
|
11
|
-
engines: applyDiagnostics(createRemoteEngines(), (event)=>{
|
|
12
|
-
console.log(event);
|
|
13
|
-
}),
|
|
14
10
|
codecOptions: params.codecOptions || {
|
|
15
11
|
valueDecodeVisitor (value) {
|
|
16
12
|
if (value instanceof DateTime) return new Date(value.toDate()).toLocaleDateString(locale, {
|
|
@@ -50,4 +46,4 @@ const getDB = createServerOnlyFn(async (params = {})=>{
|
|
|
50
46
|
throw error;
|
|
51
47
|
}
|
|
52
48
|
});
|
|
53
|
-
export {
|
|
49
|
+
export { getDBInstanceTanstack };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
1
|
+
import type { CodecOptions } from 'surrealdb';
|
|
2
|
+
export interface SurrealDBProps {
|
|
3
3
|
url?: string;
|
|
4
4
|
namespace?: string;
|
|
5
5
|
database?: string;
|
|
6
6
|
username?: string;
|
|
7
7
|
password?: string;
|
|
8
8
|
codecOptions?: CodecOptions;
|
|
9
|
-
}
|
|
9
|
+
}
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createMiddleware } from "@tanstack/react-start";
|
|
2
2
|
import { getCookie, getRequestHeader, setCookie } from "@tanstack/react-start/server";
|
|
3
|
-
const
|
|
3
|
+
const locale_locale = createMiddleware().server(async ({ next })=>{
|
|
4
4
|
const header = getRequestHeader('accept-language');
|
|
5
5
|
const headerLocale = header?.split(',')[0] || 'ru-RU';
|
|
6
6
|
const cookieLocale = getCookie('locale');
|
|
@@ -18,7 +18,4 @@ const defaultRequestMiddlewares_locale = createMiddleware().server(async ({ next
|
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
});
|
|
21
|
-
|
|
22
|
-
defaultRequestMiddlewares_locale
|
|
23
|
-
];
|
|
24
|
-
export { defaultRequestMiddlewares };
|
|
21
|
+
export { locale_locale as locale };
|
package/dist/ui/JsonInput.js
CHANGED
|
@@ -5,7 +5,7 @@ import { linter } from "@codemirror/lint";
|
|
|
5
5
|
import { keymap } from "@codemirror/view";
|
|
6
6
|
import { vscodeDark, vscodeLight } from "@uiw/codemirror-theme-vscode";
|
|
7
7
|
import react_codemirror from "@uiw/react-codemirror";
|
|
8
|
-
import { getCookie } from "../
|
|
8
|
+
import { getCookie } from "../tanstack/index.js";
|
|
9
9
|
const formatJson = (view)=>{
|
|
10
10
|
try {
|
|
11
11
|
const text = view.state.doc.toString();
|
package/dist/ui/form/index.d.ts
CHANGED
package/dist/ui/form/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { blurOnError } from "./blurOnError.js";
|
|
2
2
|
import { useAppForm, useFieldContext, withForm } from "./context.js";
|
|
3
|
-
|
|
4
|
-
export { blurOnError, fieldsSchema, useAppForm, useFieldContext, withForm };
|
|
3
|
+
export { blurOnError, useAppForm, useFieldContext, withForm };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import v4 from "zod/v4";
|
|
2
|
-
const
|
|
2
|
+
const zodSchemas = {
|
|
3
3
|
id: v4.string().min(1, 'ID не может быть пустым'),
|
|
4
4
|
str: v4.string().min(1, 'Значение не может быть пустым'),
|
|
5
5
|
strArr: v4.array(v4.string().min(1, 'Значение не может быть пустым')),
|
|
@@ -10,4 +10,4 @@ const fieldsSchema = {
|
|
|
10
10
|
password: v4.string('Пароль не может быть пустым').min(8, 'Пароль должен содержать не менее 8 символов'),
|
|
11
11
|
kebab: v4.string().min(3, 'Минимум 3 символа').regex(/^[a-z0-9]+(-[a-z0-9]+)*$/, 'Должен быть в формате kebab-case (только строчные буквы, цифры и дефисы)')
|
|
12
12
|
};
|
|
13
|
-
export {
|
|
13
|
+
export { zodSchemas };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rolder/kit",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.93",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -17,30 +17,32 @@
|
|
|
17
17
|
"build": "rslib build",
|
|
18
18
|
"dev": "rslib build --watch",
|
|
19
19
|
"prepublishOnly": "bun run build",
|
|
20
|
-
"check": "biome check --write &&
|
|
20
|
+
"check": "biome check --write && tsc --noEmit"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@rsbuild/plugin-react": "^1.4.5",
|
|
24
24
|
"@rslib/core": "^0.19.5",
|
|
25
25
|
"@types/js-cookie": "^3.0.6",
|
|
26
|
-
"@types/omgopass": "^3.2.3"
|
|
26
|
+
"@types/omgopass": "^3.2.3",
|
|
27
|
+
"vitest": "^4.0.18"
|
|
27
28
|
},
|
|
28
29
|
"peerDependencies": {
|
|
29
|
-
"
|
|
30
|
-
"@
|
|
31
|
-
"@better-upload/
|
|
30
|
+
"better-auth": "^1.4.18",
|
|
31
|
+
"@ai-sdk/react": "^3.0.87",
|
|
32
|
+
"@better-upload/client": "^3.0.14",
|
|
33
|
+
"@better-upload/server": "^3.0.14",
|
|
32
34
|
"@codemirror/lang-json": "^6.0.2",
|
|
33
|
-
"@codemirror/lint": "^6.9.
|
|
35
|
+
"@codemirror/lint": "^6.9.4",
|
|
34
36
|
"@mantine/core": "^8.3.14",
|
|
35
37
|
"@mantine/hooks": "^8.3.14",
|
|
36
38
|
"@mantine/notifications": "^8.3.14",
|
|
37
39
|
"@mantine/tiptap": "^8.3.14",
|
|
38
40
|
"@nanostores/react": "^1.0.0",
|
|
39
|
-
"@tanstack/react-form": "^1.28.
|
|
40
|
-
"@tanstack/react-query": "^5.90.
|
|
41
|
-
"@tanstack/react-router": "^1.
|
|
42
|
-
"@tanstack/react-router-ssr-query": "^1.
|
|
43
|
-
"@tanstack/react-start": "^1.159.
|
|
41
|
+
"@tanstack/react-form": "^1.28.1",
|
|
42
|
+
"@tanstack/react-query": "^5.90.21",
|
|
43
|
+
"@tanstack/react-router": "^1.159.5",
|
|
44
|
+
"@tanstack/react-router-ssr-query": "^1.159.5",
|
|
45
|
+
"@tanstack/react-start": "^1.159.5",
|
|
44
46
|
"@tiptap/extension-highlight": "^3.19.0",
|
|
45
47
|
"@tiptap/extension-placeholder": "^3.19.0",
|
|
46
48
|
"@tiptap/extension-table": "^3.19.0",
|
|
@@ -52,8 +54,8 @@
|
|
|
52
54
|
"@uiw/codemirror-theme-vscode": "^4.25.4",
|
|
53
55
|
"@uiw/react-codemirror": "^4.25.4",
|
|
54
56
|
"@codemirror/commands": "^6.10.2",
|
|
55
|
-
"@codemirror/view": "^6.39.
|
|
56
|
-
"ai": "^6.0.
|
|
57
|
+
"@codemirror/view": "^6.39.14",
|
|
58
|
+
"ai": "^6.0.85",
|
|
57
59
|
"clsx": "^2.1.1",
|
|
58
60
|
"js-cookie": "^3.0.5",
|
|
59
61
|
"mammoth": "^1.11.0",
|
|
@@ -62,7 +64,7 @@
|
|
|
62
64
|
"omgopass": "^3.2.1",
|
|
63
65
|
"react": "^19.2.4",
|
|
64
66
|
"react-dom": "^19.2.4",
|
|
65
|
-
"streamdown": "^2.
|
|
67
|
+
"streamdown": "^2.2.0",
|
|
66
68
|
"surrealdb": "^2.0.0-alpha.18",
|
|
67
69
|
"xlsx": "^0.18.5",
|
|
68
70
|
"zod": "^4.3.6",
|
package/dist/index.d.ts
DELETED
package/dist/index.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export declare const surrealDeleteFn: import("@tanstack/react-start").RequiredFetcher<undefined, (data: string) => string, Promise<void>>;
|
|
2
|
-
export declare const surrealUnsubscribeFn: import("@tanstack/react-start").RequiredFetcher<undefined, (data: string) => string, Promise<void>>;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|