@rolder/kit 3.0.0-alpha.11 → 3.0.0-alpha.112

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.
Files changed (299) hide show
  1. package/dist/ai/index.d.ts +2 -0
  2. package/dist/ai/index.js +2 -0
  3. package/dist/ai/ui/chat/Root.d.ts +55 -0
  4. package/dist/ai/ui/chat/Root.js +18 -0
  5. package/dist/ai/ui/chat/chatInput/File.js +71 -0
  6. package/dist/ai/ui/chat/chatInput/FileIcon.js +43 -0
  7. package/dist/ai/ui/chat/chatInput/Root.d.ts +9 -0
  8. package/dist/ai/ui/chat/chatInput/Root.js +24 -0
  9. package/dist/ai/ui/chat/chatInput/Submit.js +23 -0
  10. package/dist/ai/ui/{promptInput → chat/chatInput}/Textarea.js +8 -7
  11. package/dist/ai/ui/{promptInput → chat/chatInput}/index.d.ts +2 -3
  12. package/dist/ai/ui/{promptInput → chat/chatInput}/index.js +2 -2
  13. package/dist/ai/ui/chat/chatInput/store/file.d.ts +8 -0
  14. package/dist/ai/ui/chat/chatInput/store/file.js +32 -0
  15. package/dist/ai/ui/chat/chatInput/store/fileErrorNotificaton.d.ts +2 -0
  16. package/dist/ai/ui/chat/chatInput/store/fileErrorNotificaton.js +21 -0
  17. package/dist/ai/ui/chat/chatInput/store/index.d.ts +2 -0
  18. package/dist/ai/ui/chat/chatInput/store/index.js +2 -0
  19. package/dist/ai/ui/chat/chatInput/store/input.d.ts +13 -0
  20. package/dist/ai/ui/chat/chatInput/store/input.js +81 -0
  21. package/dist/ai/ui/chat/chatInput/store/parseFile.d.ts +2 -0
  22. package/dist/ai/ui/chat/chatInput/store/parseFile.js +23 -0
  23. package/dist/ai/ui/chat/index.d.ts +12 -0
  24. package/dist/ai/ui/chat/index.js +15 -0
  25. package/dist/ai/ui/chat/messages/Empty.d.ts +4 -0
  26. package/dist/ai/ui/chat/messages/Empty.js +11 -0
  27. package/dist/ai/ui/chat/messages/Loader.d.ts +5 -0
  28. package/dist/ai/ui/chat/messages/Loader.js +12 -0
  29. package/dist/ai/ui/chat/messages/Message.d.ts +8 -0
  30. package/dist/ai/ui/chat/messages/Message.js +22 -0
  31. package/dist/ai/ui/chat/messages/Messages.d.ts +3 -0
  32. package/dist/ai/ui/chat/messages/Messages.js +40 -0
  33. package/dist/ai/ui/chat/messages/index.d.ts +2 -0
  34. package/dist/ai/ui/chat/messages/index.js +2 -0
  35. package/dist/ai/ui/chat/parts/File.d.ts +6 -0
  36. package/dist/ai/ui/{conversation → chat/parts}/File.js +10 -10
  37. package/dist/ai/ui/chat/parts/FileIcon.js +43 -0
  38. package/dist/ai/ui/chat/parts/PartPaper.d.ts +8 -0
  39. package/dist/ai/ui/chat/parts/PartPaper.js +14 -0
  40. package/dist/ai/ui/chat/parts/TextPart.d.ts +6 -0
  41. package/dist/ai/ui/chat/parts/TextPart.js +15 -0
  42. package/dist/ai/ui/chat/parts/ToolExecution.d.ts +7 -0
  43. package/dist/ai/ui/chat/parts/ToolExecution.js +56 -0
  44. package/dist/ai/ui/chat/parts/ToolPart.d.ts +10 -0
  45. package/dist/ai/ui/chat/parts/ToolPart.js +24 -0
  46. package/dist/ai/ui/chat/parts/index.d.ts +3 -0
  47. package/dist/ai/ui/chat/parts/index.js +3 -0
  48. package/dist/ai/ui/chat/store/index.d.ts +4 -0
  49. package/dist/ai/ui/chat/store/index.js +4 -0
  50. package/dist/ai/ui/chat/store/messages.d.ts +12 -0
  51. package/dist/ai/ui/chat/store/messages.js +40 -0
  52. package/dist/ai/ui/chat/store/send.d.ts +14 -0
  53. package/dist/ai/ui/chat/store/send.js +16 -0
  54. package/dist/ai/ui/chat/store/states.d.ts +11 -0
  55. package/dist/ai/ui/chat/store/states.js +20 -0
  56. package/dist/ai/ui/chat/store/useInitChat.d.ts +3 -0
  57. package/dist/ai/ui/chat/store/useInitChat.js +40 -0
  58. package/dist/ai/ui/index.d.ts +1 -0
  59. package/dist/ai/ui/index.js +1 -0
  60. package/dist/ai/utils/index.d.ts +2 -0
  61. package/dist/ai/utils/index.js +2 -0
  62. package/dist/app/AppDefaults.js +1 -1
  63. package/dist/app/DefaultApp.js +1 -1
  64. package/dist/app/cookieColorSchemeManager.js +1 -1
  65. package/dist/app/defaultTheme.d.ts +7 -7
  66. package/dist/app/index.d.ts +3 -0
  67. package/dist/app/index.js +3 -0
  68. package/dist/betterAuth/client/getAuthClient.d.ts +3050 -0
  69. package/dist/betterAuth/client/getAuthClient.js +18 -0
  70. package/dist/betterAuth/client/index.d.ts +1 -0
  71. package/dist/betterAuth/client/index.js +1 -0
  72. package/dist/betterAuth/index.d.ts +3 -0
  73. package/dist/betterAuth/index.js +3 -0
  74. package/dist/betterAuth/server/defaultAuthServerConfig.d.ts +452 -0
  75. package/dist/betterAuth/server/defaultAuthServerConfig.js +49 -0
  76. package/dist/betterAuth/server/env.d.ts +1 -0
  77. package/dist/betterAuth/server/env.js +8 -0
  78. package/dist/betterAuth/server/getDBSession.d.ts +2 -0
  79. package/dist/betterAuth/server/getDBSession.js +85 -0
  80. package/dist/betterAuth/server/getSessionToken.d.ts +1 -0
  81. package/dist/betterAuth/server/getSessionToken.js +14 -0
  82. package/dist/betterAuth/server/getSessionUser.d.ts +1 -0
  83. package/dist/betterAuth/server/getSessionUser.js +22 -0
  84. package/dist/betterAuth/server/index.d.ts +10 -0
  85. package/dist/betterAuth/server/index.js +11 -0
  86. package/dist/betterAuth/server/surrealDbAdapter/adapter.d.ts +8 -0
  87. package/dist/betterAuth/server/surrealDbAdapter/adapter.js +64 -0
  88. package/dist/betterAuth/server/surrealDbAdapter/adapter.test.d.ts +1 -0
  89. package/dist/betterAuth/server/surrealDbAdapter/adapter.test.js +84 -0
  90. package/dist/betterAuth/server/surrealDbAdapter/db/getDB.d.ts +2 -0
  91. package/dist/betterAuth/server/surrealDbAdapter/db/getDB.js +26 -0
  92. package/dist/betterAuth/server/surrealDbAdapter/db/index.d.ts +1 -0
  93. package/dist/betterAuth/server/surrealDbAdapter/db/index.js +1 -0
  94. package/dist/betterAuth/server/surrealDbAdapter/db/schema.d.ts +1 -0
  95. package/dist/betterAuth/server/surrealDbAdapter/db/schema.js +97 -0
  96. package/dist/betterAuth/server/surrealDbAdapter/index.d.ts +1 -0
  97. package/dist/betterAuth/server/surrealDbAdapter/index.js +1 -0
  98. package/dist/betterAuth/server/surrealDbAdapter/methods/count.d.ts +2 -0
  99. package/dist/betterAuth/server/surrealDbAdapter/methods/count.js +17 -0
  100. package/dist/betterAuth/server/surrealDbAdapter/methods/create.d.ts +2 -0
  101. package/dist/betterAuth/server/surrealDbAdapter/methods/create.js +21 -0
  102. package/dist/betterAuth/server/surrealDbAdapter/methods/delete.d.ts +2 -0
  103. package/dist/betterAuth/server/surrealDbAdapter/methods/delete.js +18 -0
  104. package/dist/betterAuth/server/surrealDbAdapter/methods/deleteMany.d.ts +2 -0
  105. package/dist/betterAuth/server/surrealDbAdapter/methods/deleteMany.js +19 -0
  106. package/dist/betterAuth/server/surrealDbAdapter/methods/findMany.d.ts +2 -0
  107. package/dist/betterAuth/server/surrealDbAdapter/methods/findMany.js +51 -0
  108. package/dist/betterAuth/server/surrealDbAdapter/methods/findOne.d.ts +2 -0
  109. package/dist/betterAuth/server/surrealDbAdapter/methods/findOne.js +42 -0
  110. package/dist/betterAuth/server/surrealDbAdapter/methods/index.d.ts +8 -0
  111. package/dist/betterAuth/server/surrealDbAdapter/methods/index.js +8 -0
  112. package/dist/betterAuth/server/surrealDbAdapter/methods/types.d.ts +56 -0
  113. package/dist/betterAuth/server/surrealDbAdapter/methods/update.d.ts +2 -0
  114. package/dist/betterAuth/server/surrealDbAdapter/methods/update.js +25 -0
  115. package/dist/betterAuth/server/surrealDbAdapter/methods/updateMany.d.ts +2 -0
  116. package/dist/betterAuth/server/surrealDbAdapter/methods/updateMany.js +21 -0
  117. package/dist/betterAuth/server/surrealDbAdapter/types.d.ts +2 -0
  118. package/dist/betterAuth/server/surrealDbAdapter/utils/applyJoinMappings.d.ts +2 -0
  119. package/dist/betterAuth/server/surrealDbAdapter/utils/applyJoinMappings.js +31 -0
  120. package/dist/betterAuth/server/surrealDbAdapter/utils/buildExpression.d.ts +3 -0
  121. package/dist/betterAuth/server/surrealDbAdapter/utils/buildExpression.js +58 -0
  122. package/dist/betterAuth/server/surrealDbAdapter/utils/buildJoinPlan.d.ts +9 -0
  123. package/dist/betterAuth/server/surrealDbAdapter/utils/buildJoinPlan.js +46 -0
  124. package/dist/betterAuth/server/surrealDbAdapter/utils/buildSelectFields.d.ts +1 -0
  125. package/dist/betterAuth/server/surrealDbAdapter/utils/buildSelectFields.js +5 -0
  126. package/dist/betterAuth/server/surrealDbAdapter/utils/index.d.ts +6 -0
  127. package/dist/betterAuth/server/surrealDbAdapter/utils/index.js +6 -0
  128. package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeOutputRecordIds.d.ts +2 -0
  129. package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeOutputRecordIds.js +43 -0
  130. package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeRecordIds.d.ts +2 -0
  131. package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeRecordIds.js +38 -0
  132. package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeWhereValue.d.ts +2 -0
  133. package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeWhereValue.js +33 -0
  134. package/dist/betterAuth/server/surrealDbAdapter/utils/types.d.ts +34 -0
  135. package/dist/betterAuth/server/types.d.ts +8 -0
  136. package/dist/betterAuth/useSessionUser.d.ts +1 -0
  137. package/dist/betterAuth/useSessionUser.js +8 -0
  138. package/dist/hooks/index.d.ts +2 -0
  139. package/dist/hooks/index.js +2 -0
  140. package/dist/styles.css +3 -8
  141. package/dist/surrealDB/deafaultCrud.d.ts +2 -0
  142. package/dist/{surreal → surrealDB}/deafaultCrud.js +6 -5
  143. package/dist/surrealDB/getDBInstance.d.ts +3 -0
  144. package/dist/surrealDB/getDBInstance.js +34 -0
  145. package/dist/surrealDB/getDBInstanceTanstack.d.ts +3 -0
  146. package/dist/{surreal/connection.js → surrealDB/getDBInstanceTanstack.js} +2 -2
  147. package/dist/surrealDB/index.d.ts +6 -0
  148. package/dist/surrealDB/index.js +6 -0
  149. package/dist/{surreal/connection.d.ts → surrealDB/types.d.ts} +3 -3
  150. package/dist/surrealDB/types.js +0 -0
  151. package/dist/tanstack/cookie/index.d.ts +3 -0
  152. package/dist/tanstack/cookie/index.js +4 -0
  153. package/dist/{functions → tanstack/cookie}/setCookie.d.ts +1 -1
  154. package/dist/tanstack/index.d.ts +3 -0
  155. package/dist/tanstack/index.js +3 -0
  156. package/dist/tanstack/middlewares/index.d.ts +6 -0
  157. package/dist/tanstack/middlewares/index.js +5 -0
  158. package/dist/tanstack/middlewares/locale.d.ts +4 -0
  159. package/dist/{app/defaultRequestMiddlewares.js → tanstack/middlewares/locale.js} +2 -5
  160. package/dist/tanstack/s3/getS3Client.d.ts +2 -0
  161. package/dist/tanstack/s3/getS3Client.js +18 -0
  162. package/dist/tanstack/s3/getSignedFileUrlFn.d.ts +4 -0
  163. package/dist/tanstack/s3/getSignedFileUrlFn.js +21 -0
  164. package/dist/tanstack/s3/index.d.ts +2 -0
  165. package/dist/tanstack/s3/index.js +2 -0
  166. package/dist/tanstack/s3/uploadRequest.d.ts +3 -0
  167. package/dist/tanstack/s3/uploadRequest.js +21 -0
  168. package/dist/ui/AnimatedChevron.d.ts +3 -4
  169. package/dist/ui/AnimatedChevron.js +6 -25
  170. package/dist/ui/JsonInput.d.ts +1 -1
  171. package/dist/ui/JsonInput.js +1 -1
  172. package/dist/ui/editor/Content.d.ts +2 -2
  173. package/dist/ui/editor/Content.js +2 -2
  174. package/dist/ui/editor/Root.d.ts +7 -1
  175. package/dist/ui/editor/Root.js +42 -5
  176. package/dist/ui/editor/Toolbar.d.ts +3 -2
  177. package/dist/ui/editor/Toolbar.js +7 -25
  178. package/dist/ui/editor/index.d.ts +5 -9
  179. package/dist/ui/editor/index.js +3 -4
  180. package/dist/ui/editor/store.d.ts +6 -0
  181. package/dist/ui/editor/store.js +10 -0
  182. package/dist/ui/error/DefaultError.d.ts +1 -1
  183. package/dist/ui/error/DefaultNotFound.d.ts +1 -1
  184. package/dist/ui/error/Forbidden.d.ts +1 -1
  185. package/dist/ui/form/buttons/CancelButton.d.ts +2 -2
  186. package/dist/ui/form/buttons/CancelButton.js +4 -26
  187. package/dist/ui/form/buttons/SubmitButton.d.ts +2 -2
  188. package/dist/ui/form/buttons/SubmitButton.js +4 -29
  189. package/dist/ui/form/buttons/SubscribeActionIcon.d.ts +2 -2
  190. package/dist/ui/form/buttons/SubscribeButton.d.ts +2 -2
  191. package/dist/ui/form/context.d.ts +55 -55
  192. package/dist/ui/form/context.js +3 -3
  193. package/dist/ui/form/fields/JsonField.d.ts +1 -1
  194. package/dist/ui/form/fields/MultiSelectField.d.ts +1 -1
  195. package/dist/ui/form/fields/NumberField.d.ts +1 -1
  196. package/dist/ui/form/fields/PasswordField.d.ts +2 -0
  197. package/dist/ui/form/fields/{PassowrdField.js → PasswordField.js} +2 -2
  198. package/dist/ui/form/fields/SelectField.d.ts +1 -1
  199. package/dist/ui/form/fields/SwitchField.d.ts +1 -1
  200. package/dist/ui/form/fields/TextField.d.ts +1 -1
  201. package/dist/ui/form/fields/TextPasswordField.d.ts +2 -0
  202. package/dist/ui/form/fields/TextPasswordField.js +29 -0
  203. package/dist/ui/form/fields/TextareaField.d.ts +1 -1
  204. package/dist/ui/form/fields/index.d.ts +2 -2
  205. package/dist/ui/form/fields/index.js +2 -2
  206. package/dist/ui/form/index.d.ts +0 -1
  207. package/dist/ui/form/index.js +1 -2
  208. package/dist/ui/index.d.ts +9 -0
  209. package/dist/ui/index.js +9 -0
  210. package/dist/ui/saveInput/JsonInput.d.ts +2 -2
  211. package/dist/ui/saveInput/NumberInput.d.ts +2 -2
  212. package/dist/ui/saveInput/SaveInput.d.ts +14 -14
  213. package/dist/ui/saveInput/Select.d.ts +2 -2
  214. package/dist/ui/saveInput/Switch.d.ts +2 -2
  215. package/dist/ui/saveInput/TextInput.d.ts +2 -2
  216. package/dist/ui/saveInput/Textarea.d.ts +2 -2
  217. package/dist/ui/scrollArea/Root.d.ts +7 -0
  218. package/dist/ui/scrollArea/Root.js +42 -0
  219. package/dist/ui/scrollArea/ScrollButton.d.ts +7 -0
  220. package/dist/ui/scrollArea/ScrollButton.js +30 -0
  221. package/dist/ui/scrollArea/index.d.ts +6 -3
  222. package/dist/ui/scrollArea/index.js +7 -3
  223. package/dist/ui/scrollArea/methods.d.ts +4 -0
  224. package/dist/ui/scrollArea/methods.js +32 -0
  225. package/dist/ui/scrollArea/store.d.ts +12 -0
  226. package/dist/ui/scrollArea/store.js +25 -0
  227. package/dist/{ui/form/fieldsSchema.d.ts → zodSchemas.d.ts} +1 -1
  228. package/dist/{ui/form/fieldsSchema.js → zodSchemas.js} +2 -2
  229. package/package.json +103 -71
  230. package/dist/ai/ui/conversation/ConversationContext.d.ts +0 -7
  231. package/dist/ai/ui/conversation/ConversationContext.js +0 -8
  232. package/dist/ai/ui/conversation/ConversationProvider.d.ts +0 -2
  233. package/dist/ai/ui/conversation/ConversationProvider.js +0 -14
  234. package/dist/ai/ui/conversation/Empty.d.ts +0 -1
  235. package/dist/ai/ui/conversation/Empty.js +0 -21
  236. package/dist/ai/ui/conversation/File.d.ts +0 -4
  237. package/dist/ai/ui/conversation/FileIcon.js +0 -225
  238. package/dist/ai/ui/conversation/Loader.d.ts +0 -2
  239. package/dist/ai/ui/conversation/Loader.js +0 -12
  240. package/dist/ai/ui/conversation/Message.d.ts +0 -4
  241. package/dist/ai/ui/conversation/Message.js +0 -25
  242. package/dist/ai/ui/conversation/Root.d.ts +0 -2
  243. package/dist/ai/ui/conversation/Root.js +0 -26
  244. package/dist/ai/ui/conversation/index.d.ts +0 -13
  245. package/dist/ai/ui/conversation/index.js +0 -14
  246. package/dist/ai/ui/conversation/types.d.ts +0 -7
  247. package/dist/ai/ui/conversation/useChatMessage.d.ts +0 -2
  248. package/dist/ai/ui/conversation/useChatMessage.js +0 -12
  249. package/dist/ai/ui/promptInput/File.js +0 -117
  250. package/dist/ai/ui/promptInput/FileIcon.js +0 -225
  251. package/dist/ai/ui/promptInput/PromptInputContext.d.ts +0 -12
  252. package/dist/ai/ui/promptInput/PromptInputContext.js +0 -8
  253. package/dist/ai/ui/promptInput/PromptInputProvider.d.ts +0 -2
  254. package/dist/ai/ui/promptInput/PromptInputProvider.js +0 -50
  255. package/dist/ai/ui/promptInput/Root.d.ts +0 -3
  256. package/dist/ai/ui/promptInput/Root.js +0 -17
  257. package/dist/ai/ui/promptInput/Submit.js +0 -40
  258. package/dist/ai/ui/promptInput/types.d.ts +0 -11
  259. package/dist/app/defaultRequestMiddlewares.d.ts +0 -4
  260. package/dist/index.d.ts +0 -26
  261. package/dist/index.js +0 -26
  262. package/dist/surreal/deafaultCrud.d.ts +0 -2
  263. package/dist/ui/editor/Provider.d.ts +0 -17
  264. package/dist/ui/editor/Provider.js +0 -80
  265. package/dist/ui/editor/types.d.ts +0 -7
  266. package/dist/ui/form/fields/PassowrdField.d.ts +0 -2
  267. package/dist/ui/form/fields/TextPassowrdField.d.ts +0 -2
  268. package/dist/ui/form/fields/TextPassowrdField.js +0 -51
  269. package/dist/ui/scrollArea/ScrollArea.d.ts +0 -62
  270. package/dist/ui/scrollArea/ScrollArea.js +0 -30
  271. package/dist/ui/scrollArea/ScrollAreaButton.d.ts +0 -5
  272. package/dist/ui/scrollArea/ScrollAreaButton.js +0 -51
  273. package/dist/ui/scrollArea/ScrollAreaContent.d.ts +0 -6
  274. package/dist/ui/scrollArea/ScrollAreaContent.js +0 -29
  275. package/dist/ui/scrollArea/context.d.ts +0 -28
  276. package/dist/ui/scrollArea/context.js +0 -10
  277. package/dist/ui/scrollArea/types.d.ts +0 -65
  278. package/dist/ui/scrollArea/useScrollArea.d.ts +0 -9
  279. package/dist/ui/scrollArea/useScrollArea.js +0 -146
  280. /package/dist/ai/ui/{promptInput → chat/chatInput}/File.d.ts +0 -0
  281. /package/dist/ai/ui/{conversation → chat/chatInput}/FileIcon.d.ts +0 -0
  282. /package/dist/ai/ui/{promptInput → chat/chatInput}/Footer.d.ts +0 -0
  283. /package/dist/ai/ui/{promptInput → chat/chatInput}/Footer.js +0 -0
  284. /package/dist/ai/ui/{promptInput → chat/chatInput}/Submit.d.ts +0 -0
  285. /package/dist/ai/ui/{promptInput → chat/chatInput}/Textarea.d.ts +0 -0
  286. /package/dist/ai/ui/{promptInput → chat/parts}/FileIcon.d.ts +0 -0
  287. /package/dist/{ai/ui/conversation → betterAuth/server/surrealDbAdapter/methods}/types.js +0 -0
  288. /package/dist/{ai/ui/promptInput → betterAuth/server/surrealDbAdapter}/types.js +0 -0
  289. /package/dist/{ui/editor → betterAuth/server/surrealDbAdapter/utils}/types.js +0 -0
  290. /package/dist/{ui/scrollArea → betterAuth/server}/types.js +0 -0
  291. /package/dist/{surreal → surrealDB}/deserialize.d.ts +0 -0
  292. /package/dist/{surreal → surrealDB}/deserialize.js +0 -0
  293. /package/dist/{surreal → surrealDB}/encryption.d.ts +0 -0
  294. /package/dist/{surreal → surrealDB}/encryption.js +0 -0
  295. /package/dist/{functions → tanstack/cookie}/getCookie.d.ts +0 -0
  296. /package/dist/{functions → tanstack/cookie}/getCookie.js +0 -0
  297. /package/dist/{functions → tanstack/cookie}/setCookie.js +0 -0
  298. /package/dist/{functions → tanstack/cookie}/setCookies.d.ts +0 -0
  299. /package/dist/{functions → tanstack/cookie}/setCookies.js +0 -0
@@ -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,2 @@
1
+ import type { UpdateMany } from './types';
2
+ export declare const updateMany: ({ model, where, update, surrealDbProps, ...args }: UpdateMany) => Promise<number>;
@@ -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,2 @@
1
+ import type { AdapterFactoryCustomizeAdapterCreator } from 'better-auth/adapters';
2
+ export type Args = Parameters<AdapterFactoryCustomizeAdapterCreator>[0];
@@ -0,0 +1,2 @@
1
+ import type { ApplyJoinMappings } from './types';
2
+ export declare const applyJoinMappings: ({ row, mappings, ...args }: ApplyJoinMappings) => object | null;
@@ -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,3 @@
1
+ import { type Expr } from 'surrealdb';
2
+ import type { BuildExpression } from './types';
3
+ export declare const buildExpression: ({ model, where, ...args }: BuildExpression) => Expr | undefined;
@@ -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,5 @@
1
+ const buildSelectFields = (select, mapField)=>{
2
+ if (!select || 0 === select.length) return '*';
3
+ return select.map(mapField).join(', ');
4
+ };
5
+ export { buildSelectFields };
@@ -0,0 +1,6 @@
1
+ export * from './applyJoinMappings';
2
+ export * from './buildExpression';
3
+ export * from './buildJoinPlan';
4
+ export * from './buildSelectFields';
5
+ export * from './normalizeOutputRecordIds';
6
+ export * from './normalizeRecordIds';
@@ -0,0 +1,6 @@
1
+ export * from "./applyJoinMappings.js";
2
+ export * from "./buildExpression.js";
3
+ export * from "./buildJoinPlan.js";
4
+ export * from "./buildSelectFields.js";
5
+ export * from "./normalizeOutputRecordIds.js";
6
+ export * from "./normalizeRecordIds.js";
@@ -0,0 +1,2 @@
1
+ import type { NormalizeOutputRecordIds } from './types';
2
+ export declare const normalizeOutputRecordIds: ({ model, data, getDefaultModelName, getDefaultFieldName, getFieldAttributes, }: NormalizeOutputRecordIds) => Record<string, unknown> | null;
@@ -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,2 @@
1
+ import type { NormalizeRecordIds } from './types';
2
+ export declare const normalizeRecordIds: ({ model, data, getDefaultModelName, getDefaultFieldName, getFieldAttributes, getModelName, }: NormalizeRecordIds) => Record<string, unknown>;
@@ -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,2 @@
1
+ import type { NormalizeWhereValue } from './types';
2
+ export declare const normalizeWhereValue: ({ model, field, value, getDefaultModelName, getDefaultFieldName, getModelName, getFieldAttributes, }: NormalizeWhereValue) => unknown;
@@ -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;
@@ -0,0 +1,8 @@
1
+ import { useRouteContext } from "@tanstack/react-router";
2
+ const useSessionUser = ()=>{
3
+ const { user } = useRouteContext({
4
+ from: '__root__'
5
+ });
6
+ return user;
7
+ };
8
+ export { useSessionUser };
@@ -0,0 +1,2 @@
1
+ export * from './useMutation';
2
+ export * from './useMutationWithInvalidate';
@@ -0,0 +1,2 @@
1
+ export * from "./useMutation.js";
2
+ export * from "./useMutationWithInvalidate.js";
package/dist/styles.css CHANGED
@@ -1,4 +1,4 @@
1
- .rolder-prompt-input-root {
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-prompt-input-textarea {
11
+ .rolder-chat-input-textarea {
12
12
  border: 0;
13
13
  border-radius: 8px;
14
14
  overflow: hidden;
15
15
  }
16
16
 
17
- .rolder-prompt-input-file-action-action {
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>>;
@@ -1,17 +1,18 @@
1
1
  import { createServerFn } from "@tanstack/react-start";
2
- import { getDB } from "./connection.js";
2
+ import { getDBSession } from "../betterAuth/index.js";
3
+ import { zodSchemas } from "../zodSchemas.js";
3
4
  import { deserialize } from "./deserialize.js";
4
5
  const surrealDeleteFn = createServerFn({
5
6
  method: 'POST'
6
- }).inputValidator((data)=>data).handler(async ({ data })=>{
7
- const db = await getDB();
7
+ }).inputValidator(zodSchemas.id).handler(async ({ data })=>{
8
+ const db = await getDBSession();
8
9
  const id = deserialize(data);
9
10
  await db.delete(id);
10
11
  });
11
12
  const surrealUnsubscribeFn = createServerFn({
12
13
  method: 'POST'
13
- }).inputValidator((data)=>data).handler(async ({ data })=>{
14
- const db = await getDB();
14
+ }).inputValidator(zodSchemas.id).handler(async ({ data })=>{
15
+ const db = await getDBSession();
15
16
  const live = await db.liveOf(data);
16
17
  await live.kill();
17
18
  });
@@ -0,0 +1,3 @@
1
+ import { Surreal } from 'surrealdb';
2
+ import type { SurrealDBProps } from './types';
3
+ export declare const getDBInstance: (params?: SurrealDBProps | undefined) => Promise<Surreal>;
@@ -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 };
@@ -0,0 +1,3 @@
1
+ import { Surreal } from 'surrealdb';
2
+ import type { SurrealDBProps } from './types';
3
+ export declare const getDBInstanceTanstack: (params?: SurrealDBProps | undefined) => Promise<Surreal>;
@@ -2,7 +2,7 @@ import { createServerOnlyFn } from "@tanstack/react-start";
2
2
  import { getCookie } from "@tanstack/react-start/server";
3
3
  import { DateTime, Surreal } from "surrealdb";
4
4
  let db = null;
5
- const getDB = createServerOnlyFn(async (params = {})=>{
5
+ const getDBInstanceTanstack = createServerOnlyFn(async (params = {})=>{
6
6
  if (db?.isConnected) return db;
7
7
  const locale = getCookie('locale') || 'ru-RU';
8
8
  const timeZone = getCookie('tz') || 'UTC';
@@ -46,4 +46,4 @@ const getDB = createServerOnlyFn(async (params = {})=>{
46
46
  throw error;
47
47
  }
48
48
  });
49
- export { getDB };
49
+ export { getDBInstanceTanstack };
@@ -0,0 +1,6 @@
1
+ export * from 'surrealdb';
2
+ export * from './deafaultCrud';
3
+ export * from './deserialize';
4
+ export * from './encryption';
5
+ export * from './getDBInstance';
6
+ export * from './getDBInstanceTanstack';
@@ -0,0 +1,6 @@
1
+ export * from "surrealdb";
2
+ export * from "./deafaultCrud.js";
3
+ export * from "./deserialize.js";
4
+ export * from "./encryption.js";
5
+ export * from "./getDBInstance.js";
6
+ export * from "./getDBInstanceTanstack.js";
@@ -1,9 +1,9 @@
1
- import { type CodecOptions, Surreal } from 'surrealdb';
2
- export declare const getDB: (params?: {
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
- } | undefined) => Promise<Surreal>;
9
+ }
File without changes
@@ -0,0 +1,3 @@
1
+ export { getCookie } from './getCookie';
2
+ export { setCookie } from './setCookie';
3
+ export { setCookies } from './setCookies';
@@ -0,0 +1,4 @@
1
+ import { getCookie } from "./getCookie.js";
2
+ import { setCookie } from "./setCookie.js";
3
+ import { setCookies } from "./setCookies.js";
4
+ export { getCookie, setCookie, setCookies };
@@ -7,4 +7,4 @@
7
7
  * @param {string} value - Значение куки, если не указано, кука будет удалена
8
8
  * @param {number} [expires=7] - Количество дней до истечения срока действия куки (по умолчанию 7 дней)
9
9
  */
10
- export declare const setCookie: import("@tanstack/start-fn-stubs").IsomorphicFn<[name: string, value?: string | undefined, expires?: number | undefined], void, void>;
10
+ export declare const setCookie: import("@tanstack/react-start").IsomorphicFn<[name: string, value?: string | undefined, expires?: number | undefined], void, void>;
@@ -0,0 +1,3 @@
1
+ export * from './cookie';
2
+ export * from './middlewares';
3
+ export * from './s3';
@@ -0,0 +1,3 @@
1
+ export * from "./cookie/index.js";
2
+ export * from "./middlewares/index.js";
3
+ export * from "./s3/index.js";
@@ -0,0 +1,6 @@
1
+ import { locale } from './locale';
2
+ export { locale };
3
+ export declare const defaultRequestMiddlewares: import("@tanstack/react-start").RequestMiddlewareAfterServer<{}, undefined, {
4
+ locale: string;
5
+ timeZone: string;
6
+ }>[];
@@ -0,0 +1,5 @@
1
+ import { locale } from "./locale.js";
2
+ const defaultRequestMiddlewares = [
3
+ locale
4
+ ];
5
+ export { defaultRequestMiddlewares, locale };
@@ -0,0 +1,4 @@
1
+ export declare const locale: import("@tanstack/react-start").RequestMiddlewareAfterServer<{}, undefined, {
2
+ locale: string;
3
+ timeZone: string;
4
+ }>;