alinea 1.7.0 → 2.0.0-preview.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1383) hide show
  1. package/dist/.init/content/pages/welcome.json +1 -1
  2. package/dist/.init/src/app/(alinea)/api/cms/route.ts +8 -8
  3. package/dist/.init/src/cms.ts +45 -47
  4. package/dist/LICENSES.md +208 -560
  5. package/dist/adapter/core/cms.js +1 -1
  6. package/dist/adapter/core/handler.js +1 -1
  7. package/dist/adapter/core/preview.js +2 -2
  8. package/dist/adapter/core/previewContext.d.ts +1 -1
  9. package/dist/adapter/core/previewContext.js +1 -1
  10. package/dist/adapter/next/cms.d.ts +1 -1
  11. package/dist/adapter/next/cms.js +7 -7
  12. package/dist/adapter/next/context.js +1 -1
  13. package/dist/adapter/next/handler.d.ts +2 -4
  14. package/dist/adapter/next/handler.js +11 -5
  15. package/dist/adapter/next/previews.d.ts +2 -2
  16. package/dist/adapter/next/previews.js +13 -17
  17. package/dist/adapter/next/with-alinea.js +20 -10
  18. package/dist/adapter/vite/plugin.d.ts +2 -0
  19. package/dist/adapter/vite/plugin.js +66 -0
  20. package/dist/backend/Auth.js +1 -1
  21. package/dist/backend/HandleAction.d.ts +1 -0
  22. package/dist/backend/HandleAction.js +2 -1
  23. package/dist/backend/Handler.js +125 -17
  24. package/dist/backend/Previews.d.ts +2 -5
  25. package/dist/backend/api/BasicAuth.d.ts +2 -2
  26. package/dist/backend/api/BasicAuth.js +5 -3
  27. package/dist/backend/api/CreateBackend.d.ts +11 -2
  28. package/dist/backend/api/CreateBackend.js +45 -2502
  29. package/dist/backend/api/DatabaseApi.d.ts +8 -2
  30. package/dist/backend/api/DatabaseApi.js +252 -123
  31. package/dist/backend/api/GithubApi.d.ts +0 -4
  32. package/dist/backend/api/GithubApi.js +11 -7
  33. package/dist/backend/api/OAuth2.d.ts +3 -3
  34. package/dist/backend/api/OAuth2.js +36 -25
  35. package/dist/backend/api/S3Uploads.d.ts +32 -0
  36. package/dist/backend/api/S3Uploads.js +178 -0
  37. package/dist/backend/api/SupabaseUploads.d.ts +28 -0
  38. package/dist/backend/api/SupabaseUploads.js +41 -0
  39. package/dist/backend/api/UploadPaths.d.ts +7 -0
  40. package/dist/backend/api/UploadPaths.js +53 -0
  41. package/dist/backend/api/auth.d.ts +5 -0
  42. package/dist/backend/api/auth.js +15 -0
  43. package/dist/backend/api/database.d.ts +2 -0
  44. package/dist/backend/api/database.js +16 -0
  45. package/dist/backend/api/github.d.ts +3 -0
  46. package/dist/backend/api/github.js +10 -0
  47. package/dist/backend/api/uploads.d.ts +9 -0
  48. package/dist/backend/api/uploads.js +23 -0
  49. package/dist/backend/loader/JsonLoader.js +1 -1
  50. package/dist/backend/resolver/ParsePreview.js +2 -2
  51. package/dist/backend/router/NodeHandler.js +1 -1
  52. package/dist/backend/router/Router.js +32 -6
  53. package/dist/backend/store/GeneratedRelease.js +1 -1
  54. package/dist/backend/store/GeneratedSource.js +1 -1
  55. package/dist/backend/util/ExecGit.js +4 -4
  56. package/dist/backend/util/JWTPreviews.d.ts +3 -3
  57. package/dist/backend/util/JWTPreviews.js +19 -5
  58. package/dist/backend/util/JsonPatch.js +1 -1
  59. package/dist/backend/util/ORM.js +2 -2
  60. package/dist/backend/util/Syncable.js +2 -2
  61. package/dist/backend.d.ts +5 -0
  62. package/dist/backend.js +17 -0
  63. package/dist/bundled.d.ts +8233 -8178
  64. package/dist/chunks/chunk-53DZYORR.js +3705 -0
  65. package/dist/chunks/chunk-7ORQ7BYK.js +1187 -0
  66. package/dist/chunks/chunk-AC4U3IMS.js +205 -0
  67. package/dist/chunks/chunk-BYJRQTFR.js +57 -0
  68. package/dist/chunks/chunk-CQ52GEHY.js +39 -0
  69. package/dist/chunks/chunk-EQ3TDHYD.js +79 -0
  70. package/dist/chunks/chunk-F36YGSHN.js +335 -0
  71. package/dist/chunks/chunk-G6E35DMJ.js +1997 -0
  72. package/dist/chunks/chunk-I4GC3E65.js +170 -0
  73. package/dist/chunks/chunk-I4OYYAX5.js +63 -0
  74. package/dist/chunks/chunk-I7X64JTZ.js +10402 -0
  75. package/dist/chunks/chunk-IWN3T3FL.js +19493 -0
  76. package/dist/chunks/chunk-IYAQC63Y.js +1265 -0
  77. package/dist/chunks/chunk-JFROOUG6.js +6363 -0
  78. package/dist/chunks/chunk-LB3UYTOL.js +95 -0
  79. package/dist/chunks/chunk-LUBOGJCG.js +129 -0
  80. package/dist/chunks/chunk-NWQXN4SB.js +227 -0
  81. package/dist/chunks/chunk-RKDPDEF7.js +160 -0
  82. package/dist/chunks/chunk-SJBZFMQ2.js +2966 -0
  83. package/dist/chunks/chunk-STAJCW4Z.js +322 -0
  84. package/dist/chunks/chunk-TL7ZW6BX.js +17963 -0
  85. package/dist/chunks/chunk-U4VOHNR2.js +210 -0
  86. package/dist/chunks/chunk-U5Z2VE7Z.js +120 -0
  87. package/dist/chunks/chunk-X47OVDF3.js +1974 -0
  88. package/dist/chunks/chunk-Y7XOMJOC.js +791 -0
  89. package/dist/chunks/chunk-YK3OSMDM.js +5473 -0
  90. package/dist/chunks/crypto-UO2XRCJS.js +11 -0
  91. package/dist/cli/Generate.js +9 -4
  92. package/dist/cli/Init.js +1 -1
  93. package/dist/cli/Serve.d.ts +2 -2
  94. package/dist/cli/Serve.js +54 -100
  95. package/dist/cli/bin.js +85 -12
  96. package/dist/cli/build/BuildEmitter.js +1 -1
  97. package/dist/cli/build/BuildOptions.js +1 -1
  98. package/dist/cli/generate/CompileConfig.d.ts +1 -1
  99. package/dist/cli/generate/CompileConfig.js +1 -1
  100. package/dist/cli/generate/CopyStaticFiles.js +2 -1
  101. package/dist/cli/generate/DevDB.js +2 -8
  102. package/dist/cli/generate/FillCache.js +2 -2
  103. package/dist/cli/generate/GenerateDashboard.js +1 -1
  104. package/dist/cli/generate/LoadConfig.js +2 -3
  105. package/dist/cli/serve/CreateLocalServer.d.ts +1 -1
  106. package/dist/cli/serve/CreateLocalServer.js +81 -26
  107. package/dist/cli/serve/DevServer.d.ts +19 -0
  108. package/dist/cli/serve/DevServer.js +134 -0
  109. package/dist/cli/serve/GitHistory.d.ts +1 -2
  110. package/dist/cli/serve/GitHistory.js +15 -2
  111. package/dist/cli/serve/LiveReload.js +1 -1
  112. package/dist/cli/serve/LocalAuth.js +1 -1
  113. package/dist/cli/serve/MemoryDrafts.js +1 -1
  114. package/dist/cli/serve/StartServer.js +1 -1
  115. package/dist/cli/static/init/cms.js +45 -47
  116. package/dist/cli/static/init/next-handler.js +8 -8
  117. package/dist/cli/util/CommitMessage.js +1 -1
  118. package/dist/cli/util/CommitSha.js +1 -1
  119. package/dist/cli/util/Dirname.js +1 -1
  120. package/dist/cli/util/Emitter.js +1 -1
  121. package/dist/cli/util/EnsureEnv.js +1 -1
  122. package/dist/cli/util/EnsureLibs.js +1 -1
  123. package/dist/cli/util/EnsureNode.js +1 -1
  124. package/dist/cli/util/ExternalPlugin.js +595 -486
  125. package/dist/cli/util/FS.js +1 -1
  126. package/dist/cli/util/FindConfigFile.js +1 -1
  127. package/dist/cli/util/ForwardCommand.js +1 -1
  128. package/dist/cli/util/IgnorePlugin.js +1 -1
  129. package/dist/cli/util/PublicDefines.js +1 -1
  130. package/dist/cli/util/Report.js +1 -1
  131. package/dist/cli/util/ViewsPlugin.js +2 -2
  132. package/dist/cli/util/WarnPublicEnv.js +1 -1
  133. package/dist/cli/util/Watcher.js +1 -1
  134. package/dist/cloud/AuthResult.js +1 -1
  135. package/dist/cloud/CloudConfig.d.ts +1 -0
  136. package/dist/cloud/CloudConfig.js +2 -1
  137. package/dist/cloud/CloudRemote.d.ts +10 -4
  138. package/dist/cloud/CloudRemote.js +56 -9
  139. package/dist/components/Breadcrumbs.d.ts +3 -0
  140. package/dist/components/Breadcrumbs.js +42 -0
  141. package/dist/components/Button.d.ts +10 -0
  142. package/dist/components/Button.js +57 -0
  143. package/dist/components/Calendar.d.ts +3 -0
  144. package/dist/components/Calendar.js +94 -0
  145. package/dist/components/Checkbox.d.ts +9 -0
  146. package/dist/components/Checkbox.js +75 -0
  147. package/dist/components/CheckboxGroup.d.ts +6 -0
  148. package/dist/components/CheckboxGroup.js +45 -0
  149. package/dist/components/ColorSwatch.d.ts +2 -0
  150. package/dist/components/ColorSwatch.js +45 -0
  151. package/dist/components/ColorSwatchPicker.d.ts +3 -0
  152. package/dist/components/ColorSwatchPicker.js +66 -0
  153. package/dist/components/ComboBox.d.ts +13 -0
  154. package/dist/components/ComboBox.js +147 -0
  155. package/dist/components/DateField.d.ts +5 -0
  156. package/dist/components/DateField.js +61 -0
  157. package/dist/components/DatePicker.d.ts +5 -0
  158. package/dist/components/DatePicker.js +78 -0
  159. package/dist/components/DateRangePicker.d.ts +5 -0
  160. package/dist/components/DateRangePicker.js +95 -0
  161. package/dist/components/Dialog.d.ts +3 -0
  162. package/dist/components/Dialog.js +43 -0
  163. package/dist/components/Disclosure.d.ts +5 -0
  164. package/dist/components/Disclosure.js +106 -0
  165. package/dist/components/DropZone.d.ts +4 -0
  166. package/dist/components/DropZone.js +41 -0
  167. package/dist/components/FoldIcon.d.ts +6 -0
  168. package/dist/components/FoldIcon.js +31 -0
  169. package/dist/components/Icon.d.ts +7 -0
  170. package/dist/components/Icon.js +40 -0
  171. package/dist/components/Label.d.ts +48 -0
  172. package/dist/components/Label.js +210 -0
  173. package/dist/components/Link.d.ts +5 -0
  174. package/dist/components/Link.js +42 -0
  175. package/dist/components/List.d.ts +99 -0
  176. package/dist/components/List.js +397 -0
  177. package/dist/components/Menu.d.ts +16 -0
  178. package/dist/components/Menu.js +95 -0
  179. package/dist/components/Modal.d.ts +7 -0
  180. package/dist/components/Modal.js +58 -0
  181. package/dist/components/MultipleSelect.d.ts +25 -0
  182. package/dist/components/MultipleSelect.js +278 -0
  183. package/dist/components/NumberField.d.ts +6 -0
  184. package/dist/components/NumberField.js +90 -0
  185. package/dist/components/Popover.d.ts +6 -0
  186. package/dist/components/Popover.js +42 -0
  187. package/dist/components/ProgressCircle.d.ts +6 -0
  188. package/dist/components/ProgressCircle.js +96 -0
  189. package/dist/components/RadioGroup.d.ts +8 -0
  190. package/dist/components/RadioGroup.js +64 -0
  191. package/dist/components/SearchField.d.ts +8 -0
  192. package/dist/components/SearchField.js +86 -0
  193. package/dist/components/Select.d.ts +13 -0
  194. package/dist/components/Select.js +150 -0
  195. package/dist/components/Surface.d.ts +15 -0
  196. package/dist/components/Surface.js +53 -0
  197. package/dist/components/Switch.d.ts +5 -0
  198. package/dist/components/Switch.js +47 -0
  199. package/dist/components/Table.d.ts +14 -0
  200. package/dist/components/Table.js +147 -0
  201. package/dist/components/Tabs.d.ts +13 -0
  202. package/dist/components/Tabs.js +96 -0
  203. package/dist/components/TagGroup.d.ts +10 -0
  204. package/dist/components/TagGroup.js +81 -0
  205. package/dist/components/TextField.d.ts +13 -0
  206. package/dist/components/TextField.js +77 -0
  207. package/dist/components/TimeField.d.ts +5 -0
  208. package/dist/components/TimeField.js +55 -0
  209. package/dist/components/Toggle.d.ts +8 -0
  210. package/dist/components/Toggle.js +61 -0
  211. package/dist/components/Toolbar.d.ts +8 -0
  212. package/dist/components/Toolbar.js +80 -0
  213. package/dist/components/Tooltip.d.ts +7 -0
  214. package/dist/components/Tooltip.js +54 -0
  215. package/dist/components/Tree.d.ts +23 -0
  216. package/dist/components/Tree.js +130 -0
  217. package/dist/components.d.ts +38 -0
  218. package/dist/components.js +39 -0
  219. package/dist/config.js +1 -1
  220. package/dist/core/CMS.js +1 -1
  221. package/dist/core/Client.d.ts +11 -7
  222. package/dist/core/Client.js +53 -10
  223. package/dist/core/Config.d.ts +2 -0
  224. package/dist/core/Config.js +1 -3
  225. package/dist/core/Connection.d.ts +28 -9
  226. package/dist/core/Document.js +10 -8
  227. package/dist/core/Draft.js +1 -1
  228. package/dist/core/Entry.d.ts +6 -0
  229. package/dist/core/Entry.js +16 -1
  230. package/dist/core/EntryFields.d.ts +4 -0
  231. package/dist/core/EntryFields.js +4 -2
  232. package/dist/core/EntryRecord.js +1 -1
  233. package/dist/core/Expr.d.ts +1 -0
  234. package/dist/core/Expr.js +1 -1
  235. package/dist/core/Field.d.ts +46 -5
  236. package/dist/core/Field.js +56 -10
  237. package/dist/core/Graph.d.ts +6 -0
  238. package/dist/core/Graph.js +1 -1
  239. package/dist/core/HttpError.js +1 -1
  240. package/dist/core/Id.js +1 -1
  241. package/dist/core/Infer.d.ts +1 -1
  242. package/dist/core/Internal.js +6 -6
  243. package/dist/core/ListRow.d.ts +10 -0
  244. package/dist/core/ListRow.js +12 -0
  245. package/dist/core/Outcome.js +1 -1
  246. package/dist/core/Page.js +2 -2
  247. package/dist/core/Picker.d.ts +0 -2
  248. package/dist/core/Picker.js +1 -1
  249. package/dist/core/Reference.js +1 -1
  250. package/dist/core/Role.d.ts +3 -0
  251. package/dist/core/Role.js +7 -1
  252. package/dist/core/Root.d.ts +4 -0
  253. package/dist/core/Root.js +7 -2
  254. package/dist/core/Schema.d.ts +0 -2
  255. package/dist/core/Schema.js +2 -16
  256. package/dist/core/Scope.js +1 -1
  257. package/dist/core/Section.js +2 -2
  258. package/dist/core/TextDoc.d.ts +4 -0
  259. package/dist/core/TextDoc.js +3 -1
  260. package/dist/core/Tracker.d.ts +1 -6
  261. package/dist/core/Tracker.js +2 -12
  262. package/dist/core/Trigger.js +1 -1
  263. package/dist/core/Type.d.ts +15 -6
  264. package/dist/core/Type.js +108 -28
  265. package/dist/core/UnionRow.d.ts +11 -0
  266. package/dist/core/UnionRow.js +11 -0
  267. package/dist/core/User.d.ts +7 -1
  268. package/dist/core/User.js +1 -1
  269. package/dist/core/View.js +1 -1
  270. package/dist/core/Workspace.d.ts +4 -1
  271. package/dist/core/Workspace.js +1 -1
  272. package/dist/core/db/CommitRequest.d.ts +2 -0
  273. package/dist/core/db/CommitRequest.js +1 -1
  274. package/dist/core/db/EntryAliases.d.ts +2 -0
  275. package/dist/core/db/EntryAliases.js +28 -0
  276. package/dist/core/db/EntryDB.d.ts +2 -2
  277. package/dist/core/db/EntryDB.js +3 -3
  278. package/dist/core/db/EntryIndex.d.ts +7 -0
  279. package/dist/core/db/EntryIndex.js +168 -26
  280. package/dist/core/db/EntryReference.d.ts +44 -0
  281. package/dist/core/db/EntryReference.js +9 -0
  282. package/dist/core/db/EntryReferenceIndex.d.ts +21 -0
  283. package/dist/core/db/EntryReferenceIndex.js +131 -0
  284. package/dist/core/db/EntryResolver.d.ts +10 -7
  285. package/dist/core/db/EntryResolver.js +90 -35
  286. package/dist/core/db/EntryTransaction.d.ts +1 -1
  287. package/dist/core/db/EntryTransaction.js +395 -57
  288. package/dist/core/db/EntryUrlConflictError.d.ts +11 -0
  289. package/dist/core/db/EntryUrlConflictError.js +16 -0
  290. package/dist/core/db/IndexEvent.d.ts +5 -2
  291. package/dist/core/db/IndexEvent.js +2 -1
  292. package/dist/core/db/LinkResolver.d.ts +1 -1
  293. package/dist/core/db/LinkResolver.js +4 -1
  294. package/dist/core/db/LocalDB.d.ts +4 -2
  295. package/dist/core/db/LocalDB.js +8 -6
  296. package/dist/core/db/Mutation.d.ts +3 -3
  297. package/dist/core/db/Operation.d.ts +8 -3
  298. package/dist/core/db/Operation.js +67 -23
  299. package/dist/core/db/TestDB.d.ts +9 -1
  300. package/dist/core/db/TestDB.js +24 -1
  301. package/dist/core/db/WriteableGraph.d.ts +15 -4
  302. package/dist/core/db/WriteableGraph.js +14 -2
  303. package/dist/core/field/CreateField.d.ts +5 -4
  304. package/dist/core/field/CreateField.js +9 -5
  305. package/dist/core/field/ListField.d.ts +13 -4
  306. package/dist/core/field/ListField.js +146 -13
  307. package/dist/core/field/RecordField.d.ts +5 -3
  308. package/dist/core/field/RecordField.js +58 -2
  309. package/dist/core/field/RichTextField.d.ts +7 -2
  310. package/dist/core/field/RichTextField.js +325 -10
  311. package/dist/core/field/ScalarField.js +9 -7
  312. package/dist/core/field/UnionField.d.ts +2 -3
  313. package/dist/core/field/UnionField.js +61 -12
  314. package/dist/core/media/CreatePreview.browser.js +5 -5
  315. package/dist/core/media/CreatePreview.js +15 -10
  316. package/dist/core/media/IsImage.js +1 -1
  317. package/dist/core/media/MediaAltField.d.ts +9 -0
  318. package/dist/core/media/MediaAltField.js +17 -0
  319. package/dist/core/media/MediaLocation.d.ts +39 -0
  320. package/dist/core/media/MediaLocation.js +55 -2
  321. package/dist/core/media/MediaRoot.d.ts +2 -2
  322. package/dist/core/media/MediaRoot.js +12 -11
  323. package/dist/core/media/MediaTypes.d.ts +21 -15
  324. package/dist/core/media/MediaTypes.js +33 -16
  325. package/dist/core/media/Summary.d.ts +8 -8
  326. package/dist/core/media/Summary.js +1 -1
  327. package/dist/core/media/UploadLimits.d.ts +1 -0
  328. package/dist/core/media/UploadLimits.js +20 -0
  329. package/dist/core/pages/Snippet.js +1 -1
  330. package/dist/core/shape/ListShape.d.ts +1 -47
  331. package/dist/core/shape/ListShape.js +1 -224
  332. package/dist/core/source/CombinedSource.js +1 -1
  333. package/dist/core/source/FSSource.d.ts +3 -2
  334. package/dist/core/source/FSSource.js +25 -12
  335. package/dist/core/source/FilePatch.js +5 -2
  336. package/dist/core/source/GitDelta.js +1 -1
  337. package/dist/core/source/GitUtils.js +1 -1
  338. package/dist/core/source/GithubSource.d.ts +1 -0
  339. package/dist/core/source/GithubSource.js +17 -4
  340. package/dist/core/source/IndexedDBSource.js +23 -11
  341. package/dist/core/source/MemorySource.js +1 -1
  342. package/dist/core/source/ShaMismatchError.js +3 -1
  343. package/dist/core/source/Source.js +1 -1
  344. package/dist/core/source/SourceExport.js +3 -3
  345. package/dist/core/source/Tree.js +1 -1
  346. package/dist/core/source/Utils.js +2 -5
  347. package/dist/core/util/Anchors.d.ts +4 -0
  348. package/dist/core/util/Anchors.js +45 -0
  349. package/dist/core/util/ArrayBuffers.js +1 -1
  350. package/dist/core/util/Assert.js +1 -1
  351. package/dist/core/util/Async.js +1 -1
  352. package/dist/core/util/BufferToBase64.js +1 -1
  353. package/dist/core/util/Callable.js +1 -1
  354. package/dist/core/util/Checks.js +2 -2
  355. package/dist/core/util/CodeGen.js +3 -1
  356. package/dist/core/util/ContentHash.js +1 -1
  357. package/dist/core/util/Debounce.js +1 -1
  358. package/dist/core/util/DeepMap.d.ts +14 -0
  359. package/dist/core/util/DeepMap.js +75 -0
  360. package/dist/core/util/Encoding.js +1 -1
  361. package/dist/core/util/EntryFilenames.d.ts +0 -1
  362. package/dist/core/util/EntryFilenames.js +2 -6
  363. package/dist/core/util/EntryRows.js +1 -1
  364. package/dist/core/util/FractionalIndexing.js +1 -1
  365. package/dist/core/util/GetRandomColor.js +20 -20
  366. package/dist/core/util/Identifiers.js +1 -1
  367. package/dist/core/util/JWT.js +1 -1
  368. package/dist/core/util/Lazy.js +1 -1
  369. package/dist/core/util/LazyRecord.js +1 -1
  370. package/dist/core/util/Logger.js +2 -1
  371. package/dist/core/util/Objects.d.ts +1 -0
  372. package/dist/core/util/Objects.js +5 -1
  373. package/dist/core/util/Paths.js +2 -2
  374. package/dist/core/util/RowId.js +1 -1
  375. package/dist/core/util/Slugs.js +1 -1
  376. package/dist/core/util/Timer.js +1 -1
  377. package/dist/core/util/Types.js +1 -1
  378. package/dist/core/util/Urls.js +1 -1
  379. package/dist/core.d.ts +1 -0
  380. package/dist/core.js +2 -1
  381. package/dist/dashboard/App.css +319 -0
  382. package/dist/dashboard/App.d.ts +8 -8
  383. package/dist/dashboard/App.js +188 -142
  384. package/dist/dashboard/StoryProvider.d.ts +12 -0
  385. package/dist/dashboard/StoryProvider.js +82 -0
  386. package/dist/dashboard/ViewKeys.d.ts +26 -0
  387. package/dist/dashboard/ViewKeys.js +32 -0
  388. package/dist/dashboard/app/AccessDenied.d.ts +5 -0
  389. package/dist/dashboard/app/AccessDenied.js +53 -0
  390. package/dist/dashboard/app/ActivityStatus.d.ts +10 -0
  391. package/dist/dashboard/app/ActivityStatus.js +459 -0
  392. package/dist/dashboard/app/AlineaLogo.d.ts +4 -0
  393. package/dist/dashboard/app/AlineaLogo.js +26 -0
  394. package/dist/dashboard/app/AppShell.d.ts +4 -0
  395. package/dist/dashboard/app/AppShell.js +29 -0
  396. package/dist/dashboard/app/AuthView.d.ts +8 -0
  397. package/dist/dashboard/app/AuthView.js +111 -0
  398. package/dist/dashboard/app/Badge.d.ts +8 -0
  399. package/dist/dashboard/app/Badge.js +42 -0
  400. package/dist/dashboard/app/CompactField.d.ts +14 -0
  401. package/dist/dashboard/app/CompactField.js +178 -0
  402. package/dist/dashboard/app/DashboardErrorBoundary.d.ts +2 -0
  403. package/dist/dashboard/app/DashboardErrorBoundary.js +122 -0
  404. package/dist/dashboard/app/DashboardLayout.d.ts +18 -0
  405. package/dist/dashboard/app/DashboardLayout.js +88 -0
  406. package/dist/dashboard/app/DashboardMeta.d.ts +7 -0
  407. package/dist/dashboard/app/DashboardMeta.js +28 -0
  408. package/dist/dashboard/app/EditorBackButton.d.ts +5 -0
  409. package/dist/dashboard/app/EditorBackButton.js +33 -0
  410. package/dist/dashboard/app/EntryFields.d.ts +21 -0
  411. package/dist/dashboard/app/EntryFields.js +101 -0
  412. package/dist/dashboard/app/EntryHeader.d.ts +15 -0
  413. package/dist/dashboard/app/EntryHeader.js +452 -0
  414. package/dist/dashboard/app/EntryHeaderActions.d.ts +37 -0
  415. package/dist/dashboard/app/EntryHeaderActions.js +71 -0
  416. package/dist/dashboard/app/EntryReferences.d.ts +6 -0
  417. package/dist/dashboard/app/EntryReferences.js +209 -0
  418. package/dist/dashboard/app/EntrySidebar.d.ts +25 -0
  419. package/dist/dashboard/app/EntrySidebar.js +378 -0
  420. package/dist/dashboard/app/EntrySidebarPreview.d.ts +10 -0
  421. package/dist/dashboard/app/EntrySidebarPreview.js +260 -0
  422. package/dist/dashboard/app/EntrySidebarPreview.story.d.ts +1 -0
  423. package/dist/dashboard/app/EntrySidebarToggle.d.ts +6 -0
  424. package/dist/dashboard/app/EntrySidebarToggle.js +29 -0
  425. package/dist/dashboard/app/EntryTranslationBanner.d.ts +7 -0
  426. package/dist/dashboard/app/EntryTranslationBanner.js +60 -0
  427. package/dist/dashboard/app/Explorer.d.ts +41 -0
  428. package/dist/dashboard/app/Explorer.js +804 -0
  429. package/dist/dashboard/app/ExplorerCards.d.ts +12 -0
  430. package/dist/dashboard/app/ExplorerCards.js +389 -0
  431. package/dist/dashboard/app/ExplorerFileCard.d.ts +10 -0
  432. package/dist/dashboard/app/ExplorerFileCard.js +115 -0
  433. package/dist/dashboard/app/ExplorerList.d.ts +9 -0
  434. package/dist/dashboard/app/ExplorerList.js +165 -0
  435. package/dist/dashboard/app/ExplorerModal.d.ts +16 -0
  436. package/dist/dashboard/app/ExplorerModal.js +89 -0
  437. package/dist/dashboard/app/ExplorerPickerContent.d.ts +13 -0
  438. package/dist/dashboard/app/ExplorerPickerContent.js +114 -0
  439. package/dist/dashboard/app/ExplorerTable.d.ts +14 -0
  440. package/dist/dashboard/app/ExplorerTable.js +497 -0
  441. package/dist/dashboard/app/ExternalLinkPicker.d.ts +12 -0
  442. package/dist/dashboard/app/ExternalLinkPicker.js +97 -0
  443. package/dist/dashboard/app/ImagePicker.d.ts +6 -0
  444. package/dist/dashboard/app/ImagePicker.js +145 -0
  445. package/dist/dashboard/app/LinkPicker.d.ts +9 -0
  446. package/dist/dashboard/app/LinkPicker.js +317 -0
  447. package/dist/dashboard/app/LocaleMenu.d.ts +8 -0
  448. package/dist/dashboard/app/LocaleMenu.js +110 -0
  449. package/dist/dashboard/app/LogoShape.d.ts +8 -0
  450. package/dist/dashboard/app/LogoShape.js +60 -0
  451. package/dist/dashboard/app/SidebarTree.d.ts +37 -0
  452. package/dist/dashboard/app/SidebarTree.js +433 -0
  453. package/dist/dashboard/app/StatusBadge.d.ts +6 -0
  454. package/dist/dashboard/app/StatusBadge.js +26 -0
  455. package/dist/dashboard/app/ViewToggle.d.ts +7 -0
  456. package/dist/dashboard/app/ViewToggle.js +27 -0
  457. package/dist/dashboard/app/WorkspaceMenu.d.ts +24 -0
  458. package/dist/dashboard/app/WorkspaceMenu.js +264 -0
  459. package/dist/dashboard/app/WorkspaceMenu.stories.d.ts +5 -0
  460. package/dist/dashboard/app/WorkspaceRoots.d.ts +6 -0
  461. package/dist/dashboard/app/WorkspaceRoots.js +285 -0
  462. package/dist/dashboard/app/editor/FileEditor.d.ts +5 -0
  463. package/dist/dashboard/app/editor/FileEditor.js +190 -0
  464. package/dist/dashboard/app/editor/FilePreview.d.ts +13 -0
  465. package/dist/dashboard/app/editor/FilePreview.js +196 -0
  466. package/dist/dashboard/app/editor/MediaAltField.view.d.ts +5 -0
  467. package/dist/dashboard/app/editor/MediaAltField.view.js +98 -0
  468. package/dist/dashboard/app/modals/CreateEntry.d.ts +1 -0
  469. package/dist/dashboard/app/modals/CreateEntry.js +283 -0
  470. package/dist/dashboard/app/pages/EntryPage.d.ts +11 -0
  471. package/dist/dashboard/app/pages/EntryPage.js +354 -0
  472. package/dist/dashboard/app/pages/RootPage.d.ts +9 -0
  473. package/dist/dashboard/app/pages/RootPage.js +90 -0
  474. package/dist/dashboard/app/pages/UsersPage.d.ts +7 -0
  475. package/dist/dashboard/app/pages/UsersPage.js +552 -0
  476. package/dist/dashboard/app/ui/DashboardModal.d.ts +34 -0
  477. package/dist/dashboard/app/ui/DashboardModal.js +192 -0
  478. package/dist/dashboard/app/ui/Rail.d.ts +18 -0
  479. package/dist/dashboard/app/ui/Rail.js +41 -0
  480. package/dist/dashboard/app/ui/Sidebar.d.ts +15 -0
  481. package/dist/dashboard/app/ui/Sidebar.js +55 -0
  482. package/dist/dashboard/atoms/ReactiveNode.d.ts +41 -0
  483. package/dist/dashboard/atoms/ReactiveNode.js +248 -0
  484. package/dist/dashboard/atoms/activity.d.ts +48 -0
  485. package/dist/dashboard/atoms/activity.js +189 -0
  486. package/dist/dashboard/atoms/auth.d.ts +38 -0
  487. package/dist/dashboard/atoms/auth.js +106 -0
  488. package/dist/dashboard/atoms/config.d.ts +27 -0
  489. package/dist/dashboard/atoms/config.js +49 -0
  490. package/dist/dashboard/atoms/core.d.ts +15 -0
  491. package/dist/dashboard/atoms/core.js +37 -0
  492. package/dist/dashboard/atoms/create.d.ts +13 -0
  493. package/dist/dashboard/atoms/create.js +79 -0
  494. package/dist/dashboard/atoms/dashboard.d.ts +12 -0
  495. package/dist/dashboard/atoms/dashboard.js +71 -0
  496. package/dist/dashboard/atoms/editor.d.ts +80 -0
  497. package/dist/dashboard/atoms/editor.js +132 -0
  498. package/dist/dashboard/atoms/entry.d.ts +223 -0
  499. package/dist/dashboard/atoms/entry.js +609 -0
  500. package/dist/dashboard/atoms/explorer.d.ts +257 -0
  501. package/dist/dashboard/atoms/explorer.js +677 -0
  502. package/dist/dashboard/atoms/graph.d.ts +5 -0
  503. package/dist/dashboard/atoms/graph.js +62 -0
  504. package/dist/dashboard/atoms/link.d.ts +24 -0
  505. package/dist/dashboard/atoms/link.js +82 -0
  506. package/dist/dashboard/atoms/nav.d.ts +47 -0
  507. package/dist/dashboard/atoms/nav.js +220 -0
  508. package/dist/dashboard/atoms/preview.d.ts +4 -0
  509. package/dist/dashboard/atoms/preview.js +10 -0
  510. package/dist/dashboard/atoms/root.d.ts +88 -0
  511. package/dist/dashboard/atoms/root.js +444 -0
  512. package/dist/dashboard/atoms/upload.d.ts +9 -0
  513. package/dist/dashboard/atoms/upload.js +81 -0
  514. package/dist/dashboard/atoms/user.d.ts +9 -0
  515. package/dist/dashboard/atoms/user.js +75 -0
  516. package/dist/dashboard/atoms/utils.d.ts +17 -0
  517. package/dist/dashboard/atoms/utils.js +151 -0
  518. package/dist/dashboard/boot/ActivityEvent.d.ts +44 -0
  519. package/dist/dashboard/boot/ActivityEvent.js +14 -0
  520. package/dist/dashboard/boot/Boot.js +9 -5
  521. package/dist/dashboard/boot/BootDev.js +2 -1
  522. package/dist/dashboard/boot/BootProd.js +1 -1
  523. package/dist/dashboard/boot/DashboardWorker.d.ts +7 -7
  524. package/dist/dashboard/boot/DashboardWorker.js +370 -30
  525. package/dist/dashboard/boot/LoadWorker.js +6 -3
  526. package/dist/dashboard/boot/WorkerDB.d.ts +9 -2
  527. package/dist/dashboard/boot/WorkerDB.js +20 -3
  528. package/dist/dashboard/editor/UseField.d.ts +29 -10
  529. package/dist/dashboard/editor/UseField.js +27 -59
  530. package/dist/dashboard/fixture/cms.d.ts +116 -0
  531. package/dist/dashboard/fixture/cms.js +230 -0
  532. package/dist/dashboard/hook/UseEntryEditor.d.ts +25 -6
  533. package/dist/dashboard/hook/UseEntryEditor.js +34 -12
  534. package/dist/dashboard/hook/UseGraph.d.ts +3 -0
  535. package/dist/dashboard/hook/UseGraph.js +5 -5
  536. package/dist/dashboard/hook/UseLocale.d.ts +4 -1
  537. package/dist/dashboard/hook/UseLocale.js +5 -7
  538. package/dist/dashboard/hook/UseRoot.d.ts +7 -12
  539. package/dist/dashboard/hook/UseRoot.js +8 -5
  540. package/dist/dashboard/hook/UseWorkspace.d.ts +7 -9
  541. package/dist/dashboard/hook/UseWorkspace.js +5 -7
  542. package/dist/dashboard/hooks.d.ts +157 -0
  543. package/dist/dashboard/hooks.js +229 -0
  544. package/dist/dashboard/icons.d.ts +171 -0
  545. package/dist/dashboard/icons.js +2686 -0
  546. package/dist/dashboard/plugins/alineaFixturePlugin.d.ts +2 -0
  547. package/dist/dashboard/plugins/alineaFixturePlugin.js +200 -0
  548. package/dist/dashboard.d.ts +1 -2
  549. package/dist/dashboard.js +6 -2
  550. package/dist/edit.d.ts +1 -1
  551. package/dist/edit.js +2 -4
  552. package/dist/field/check/CheckField.js +3 -3
  553. package/dist/field/check/CheckField.view.d.ts +3 -3
  554. package/dist/field/check/CheckField.view.js +37 -84
  555. package/dist/field/code/CodeField.js +2 -2
  556. package/dist/field/code/CodeField.view.d.ts +21 -3
  557. package/dist/field/code/CodeField.view.js +177 -39
  558. package/dist/field/code/SimpleCodeEditor.d.ts +50 -0
  559. package/dist/field/code/SimpleCodeEditor.js +452 -0
  560. package/dist/field/date/DateField.js +3 -3
  561. package/dist/field/date/DateField.view.d.ts +3 -3
  562. package/dist/field/date/DateField.view.js +26 -26
  563. package/dist/field/hidden/HiddenField.js +2 -2
  564. package/dist/field/hidden/HiddenField.view.js +1 -1
  565. package/dist/field/json/JsonField.js +2 -2
  566. package/dist/field/json/JsonField.view.d.ts +4 -4
  567. package/dist/field/json/JsonField.view.js +53 -76
  568. package/dist/field/link/EntryLink.d.ts +9 -8
  569. package/dist/field/link/EntryLink.js +4 -2
  570. package/dist/field/link/FileLink.d.ts +5 -5
  571. package/dist/field/link/FileLink.js +7 -3
  572. package/dist/field/link/ImageLink.d.ts +4 -2
  573. package/dist/field/link/ImageLink.js +4 -1
  574. package/dist/field/link/Link.d.ts +1 -1
  575. package/dist/field/link/Link.js +1 -1
  576. package/dist/field/link/LinkEditor.d.ts +1 -1
  577. package/dist/field/link/LinkEditor.js +1 -1
  578. package/dist/field/link/LinkField.d.ts +5 -3
  579. package/dist/field/link/LinkField.js +56 -17
  580. package/dist/field/link/LinkField.stories.d.ts +11 -1
  581. package/dist/field/link/LinkField.view.d.ts +8 -10
  582. package/dist/field/link/LinkField.view.js +1444 -362
  583. package/dist/field/link/UrlLink.d.ts +2 -2
  584. package/dist/field/link/UrlLink.js +4 -2
  585. package/dist/field/list/ListField.d.ts +3 -3
  586. package/dist/field/list/ListField.js +5 -6
  587. package/dist/field/list/ListField.stories.d.ts +2 -1
  588. package/dist/field/list/ListField.view.d.ts +15 -7
  589. package/dist/field/list/ListField.view.js +888 -377
  590. package/dist/field/localiser/LocalisedField.view.d.ts +5 -0
  591. package/dist/field/localiser/LocalisedField.view.js +63 -0
  592. package/dist/field/localiser/LocalisedFieldTabs.d.ts +8 -0
  593. package/dist/field/localiser/LocalisedFieldTabs.js +38 -0
  594. package/dist/field/localiser/Localiser.d.ts +25 -0
  595. package/dist/field/localiser/Localiser.js +140 -0
  596. package/dist/field/localiser.d.ts +1 -0
  597. package/dist/field/localiser.js +2 -0
  598. package/dist/field/metadata/MetadataAliases.d.ts +20 -0
  599. package/dist/field/metadata/MetadataAliases.js +22 -0
  600. package/dist/field/metadata/MetadataField.d.ts +31 -8
  601. package/dist/field/metadata/MetadataField.js +127 -11
  602. package/dist/field/metadata/MetadataField.view.d.ts +11 -3
  603. package/dist/field/metadata/MetadataField.view.js +130 -96
  604. package/dist/field/number/NumberField.js +3 -3
  605. package/dist/field/number/NumberField.view.d.ts +3 -3
  606. package/dist/field/number/NumberField.view.js +22 -54
  607. package/dist/field/object/ObjectField.d.ts +1 -1
  608. package/dist/field/object/ObjectField.js +11 -4
  609. package/dist/field/object/ObjectField.view.d.ts +4 -4
  610. package/dist/field/object/ObjectField.view.js +28 -19
  611. package/dist/field/path/PathField.js +3 -3
  612. package/dist/field/path/PathField.view.d.ts +3 -3
  613. package/dist/field/path/PathField.view.js +33 -133
  614. package/dist/field/path/SlugField.d.ts +16 -0
  615. package/dist/field/path/SlugField.js +52 -0
  616. package/dist/field/richtext/Extensions.d.ts +1 -28
  617. package/dist/field/richtext/Extensions.js +2 -4146
  618. package/dist/field/richtext/PickTextAnchor.d.ts +19 -0
  619. package/dist/field/richtext/PickTextAnchor.js +99 -0
  620. package/dist/field/richtext/PickTextLink.d.ts +18 -17
  621. package/dist/field/richtext/PickTextLink.js +133 -88
  622. package/dist/field/richtext/ReferenceLink.d.ts +2 -0
  623. package/dist/field/richtext/ReferenceLink.js +13 -4
  624. package/dist/field/richtext/RichTextBlock.d.ts +11 -0
  625. package/dist/field/richtext/RichTextBlock.js +143 -0
  626. package/dist/field/richtext/RichTextBlockHost.d.ts +13 -0
  627. package/dist/field/richtext/RichTextBlockHost.js +56 -0
  628. package/dist/field/richtext/RichTextBlockValue.d.ts +5 -0
  629. package/dist/field/richtext/RichTextBlockValue.js +34 -0
  630. package/dist/field/richtext/RichTextBlocks.d.ts +16 -0
  631. package/dist/field/richtext/RichTextBlocks.js +40 -0
  632. package/dist/field/richtext/RichTextDocument.d.ts +4 -0
  633. package/dist/field/richtext/RichTextDocument.js +162 -0
  634. package/dist/field/richtext/RichTextExtensions.d.ts +67 -0
  635. package/dist/field/richtext/RichTextExtensions.js +8219 -0
  636. package/dist/field/richtext/RichTextField.d.ts +10 -3
  637. package/dist/field/richtext/RichTextField.js +13 -3
  638. package/dist/field/richtext/RichTextField.story.d.ts +8 -0
  639. package/dist/field/richtext/RichTextField.view.d.ts +11 -5
  640. package/dist/field/richtext/RichTextField.view.js +385 -2447
  641. package/dist/field/richtext/RichTextInsertMenu.d.ts +9 -0
  642. package/dist/field/richtext/RichTextInsertMenu.js +1014 -0
  643. package/dist/field/richtext/RichTextState.d.ts +6 -0
  644. package/dist/field/richtext/RichTextState.js +58 -0
  645. package/dist/field/richtext/RichTextToolbar.d.ts +9 -36
  646. package/dist/field/richtext/RichTextToolbar.js +206 -178
  647. package/dist/field/richtext/Toolbar.d.ts +111 -65
  648. package/dist/field/richtext/Toolbar.js +60 -45
  649. package/dist/field/richtext/extensions/Anchor.d.ts +19 -0
  650. package/dist/field/richtext/extensions/Anchor.js +94 -0
  651. package/dist/field/richtext/extensions/Link.d.ts +3 -13
  652. package/dist/field/richtext/extensions/Link.js +15 -37
  653. package/dist/field/richtext/extensions/Small.d.ts +1 -10
  654. package/dist/field/richtext/extensions/Small.js +7 -19
  655. package/dist/field/select/SelectField.d.ts +15 -4
  656. package/dist/field/select/SelectField.js +17 -2
  657. package/dist/field/select/SelectField.view.d.ts +7 -3
  658. package/dist/field/select/SelectField.view.js +112 -155
  659. package/dist/field/tabs/Tabs.js +3 -2
  660. package/dist/field/tabs/Tabs.view.d.ts +1 -6
  661. package/dist/field/tabs/Tabs.view.js +22 -29
  662. package/dist/field/text/TextField.js +8 -3
  663. package/dist/field/text/TextField.view.d.ts +2 -2
  664. package/dist/field/text/TextField.view.js +40 -60
  665. package/dist/field/time/TimeField.js +3 -3
  666. package/dist/field/time/TimeField.view.d.ts +3 -3
  667. package/dist/field/time/TimeField.view.js +30 -30
  668. package/dist/field/view/View.js +1 -1
  669. package/dist/field/views.d.ts +2 -0
  670. package/dist/field/views.js +65 -0
  671. package/dist/field.d.ts +1 -0
  672. package/dist/field.js +3 -1
  673. package/dist/index.css +7034 -3625
  674. package/dist/index.js +1 -1
  675. package/dist/inter-latin-500-normal-JSHNAZJU.woff2 +0 -0
  676. package/dist/inter-latin-ext-500-normal-5ARINTHO.woff2 +0 -0
  677. package/dist/next.cjs +19 -9
  678. package/dist/next.edge.js +1 -1
  679. package/dist/next.js +1 -1
  680. package/dist/picker/entry/EntryPicker.d.ts +9 -4
  681. package/dist/picker/entry/EntryPicker.js +97 -19
  682. package/dist/picker/entry/EntryReference.d.ts +4 -0
  683. package/dist/picker/entry/EntryReference.js +3 -1
  684. package/dist/picker/url/UrlPicker.js +2 -12
  685. package/dist/preview/ChunkCookieValue.js +1 -1
  686. package/dist/preview/PreviewCookies.js +1 -1
  687. package/dist/preview/PreviewMessage.js +1 -1
  688. package/dist/preview/PreviewPayload.js +237 -10
  689. package/dist/preview/RegisterPreview.js +1 -1
  690. package/dist/preview/react.js +10 -3
  691. package/dist/preview/widget.js +1 -1
  692. package/dist/query.d.ts +116 -92
  693. package/dist/query.js +7 -1
  694. package/dist/types.d.ts +1 -0
  695. package/dist/ui/Link.d.ts +6 -5
  696. package/dist/ui/Link.js +37 -13
  697. package/dist/ui/RichText.d.ts +37 -11
  698. package/dist/ui/RichText.js +81 -44
  699. package/dist/ui/Stack.d.ts +11 -22
  700. package/dist/ui/Stack.js +54 -67
  701. package/dist/ui/icons/IcAlignCenter.d.ts +4 -2
  702. package/dist/ui/icons/IcAlignCenter.js +6 -12
  703. package/dist/ui/icons/IcOutlineGridView.d.ts +3 -2
  704. package/dist/ui/icons/IcOutlineGridView.js +3 -11
  705. package/dist/ui/icons/IcOutlineSettings.d.ts +3 -2
  706. package/dist/ui/icons/IcOutlineSettings.js +3 -11
  707. package/dist/ui/icons/IcRoundAccountTree.d.ts +4 -2
  708. package/dist/ui/icons/IcRoundAccountTree.js +6 -22
  709. package/dist/ui/icons/IcRoundClose.d.ts +4 -2
  710. package/dist/ui/icons/IcRoundClose.js +6 -12
  711. package/dist/ui/icons/IcRoundCode.d.ts +4 -2
  712. package/dist/ui/icons/IcRoundCode.js +6 -12
  713. package/dist/ui/icons/IcRoundDateRange.d.ts +3 -2
  714. package/dist/ui/icons/IcRoundDateRange.js +3 -11
  715. package/dist/ui/icons/IcRoundDelete.d.ts +4 -2
  716. package/dist/ui/icons/IcRoundDelete.js +6 -12
  717. package/dist/ui/icons/IcRoundEdit.d.ts +4 -2
  718. package/dist/ui/icons/IcRoundEdit.js +6 -12
  719. package/dist/ui/icons/IcRoundFormatListNumbered.d.ts +3 -2
  720. package/dist/ui/icons/IcRoundFormatListNumbered.js +3 -11
  721. package/dist/ui/icons/IcRoundLink.d.ts +4 -2
  722. package/dist/ui/icons/IcRoundLink.js +6 -12
  723. package/dist/ui/icons/IcRoundOpenInNew.d.ts +4 -2
  724. package/dist/ui/icons/IcRoundOpenInNew.js +6 -12
  725. package/dist/ui/icons/IcRoundPanorama.d.ts +4 -2
  726. package/dist/ui/icons/IcRoundPanorama.js +6 -6
  727. package/dist/ui/icons/IcRoundRefresh.d.ts +3 -2
  728. package/dist/ui/icons/IcRoundRefresh.js +3 -11
  729. package/dist/ui/icons/IcRoundSave.d.ts +4 -2
  730. package/dist/ui/icons/IcRoundSave.js +6 -22
  731. package/dist/ui/icons/IcRoundSearch.d.ts +4 -2
  732. package/dist/ui/icons/IcRoundSearch.js +6 -12
  733. package/dist/ui/icons/IcRoundShare.d.ts +4 -2
  734. package/dist/ui/icons/IcRoundShare.js +6 -12
  735. package/dist/ui/icons/IcRoundSync.d.ts +4 -2
  736. package/dist/ui/icons/IcRoundSync.js +6 -22
  737. package/dist/ui/icons/MaterialSymbolsDatabase.d.ts +4 -2
  738. package/dist/ui/icons/MaterialSymbolsDatabase.js +6 -22
  739. package/dist/ui/icons/TableInsert.d.ts +4 -2
  740. package/dist/ui/icons/TableInsert.js +6 -12
  741. package/dist/ui/util/ImageBlurUrl.js +1 -1
  742. package/dist/ui.d.ts +0 -8
  743. package/dist/ui.js +0 -8
  744. package/package.json +49 -64
  745. package/dist/backend/router/Proxy.d.ts +0 -1
  746. package/dist/backend/router/Proxy.js +0 -32
  747. package/dist/chunks/chunk-2NTSADJL.js +0 -20
  748. package/dist/chunks/chunk-2STBQ2Y4.js +0 -166
  749. package/dist/chunks/chunk-2X5P2RZV.js +0 -94
  750. package/dist/chunks/chunk-3DIW62EI.js +0 -2900
  751. package/dist/chunks/chunk-3TNMMA3W.js +0 -249
  752. package/dist/chunks/chunk-467JA2PB.js +0 -29
  753. package/dist/chunks/chunk-5LTN67OE.js +0 -51
  754. package/dist/chunks/chunk-76QF5YTJ.js +0 -107
  755. package/dist/chunks/chunk-A5O3N2GS.js +0 -63
  756. package/dist/chunks/chunk-AICQFCVN.js +0 -19
  757. package/dist/chunks/chunk-AJJSW27C.js +0 -728
  758. package/dist/chunks/chunk-C53YJRET.js +0 -112
  759. package/dist/chunks/chunk-CKT37OYJ.js +0 -9
  760. package/dist/chunks/chunk-F2HHHLEQ.js +0 -72
  761. package/dist/chunks/chunk-FKWEJTSK.js +0 -16282
  762. package/dist/chunks/chunk-G2AFWRAD.js +0 -12
  763. package/dist/chunks/chunk-HSIHEWFC.js +0 -101
  764. package/dist/chunks/chunk-I26ZIF6Q.js +0 -360
  765. package/dist/chunks/chunk-JL5K3F7X.js +0 -1116
  766. package/dist/chunks/chunk-NZLE2WMY.js +0 -35
  767. package/dist/chunks/chunk-ORDS5C6Z.js +0 -83
  768. package/dist/chunks/chunk-PNILF4WM.js +0 -251
  769. package/dist/chunks/chunk-QUIANN6B.js +0 -8001
  770. package/dist/chunks/chunk-RSX2DILK.js +0 -335
  771. package/dist/chunks/chunk-SKF4L7JN.js +0 -401
  772. package/dist/chunks/chunk-SOTBYUJY.js +0 -120
  773. package/dist/chunks/chunk-TOJF2G3X.js +0 -96
  774. package/dist/chunks/chunk-TPUTTEHF.js +0 -3002
  775. package/dist/chunks/chunk-VUACWPFC.js +0 -892
  776. package/dist/chunks/chunk-WD7H5L2L.js +0 -168
  777. package/dist/chunks/chunk-WDCPVJJC.js +0 -341
  778. package/dist/chunks/chunk-WJ67RR7S.js +0 -554
  779. package/dist/chunks/chunk-WKC37UOZ.js +0 -143
  780. package/dist/chunks/chunk-WLKPH7JA.js +0 -2786
  781. package/dist/chunks/chunk-YWCPLD22.js +0 -2343
  782. package/dist/chunks/crypto-HZTUU327.js +0 -11
  783. package/dist/cloud/view/CloudAuth.browser.d.ts +0 -2
  784. package/dist/cloud/view/CloudAuth.browser.js +0 -111
  785. package/dist/cloud/view/CloudAuth.d.ts +0 -1
  786. package/dist/cloud/view/CloudAuth.js +0 -9
  787. package/dist/core/Doc.d.ts +0 -11
  788. package/dist/core/Doc.js +0 -44
  789. package/dist/core/Role.test.d.ts +0 -1
  790. package/dist/core/Shape.d.ts +0 -19
  791. package/dist/core/Trigger.test.d.ts +0 -1
  792. package/dist/core/Type.test.d.ts +0 -1
  793. package/dist/core/db/EntryIndex.test.d.ts +0 -1
  794. package/dist/core/db/EntryResolver.test.d.ts +0 -1
  795. package/dist/core/db/LocalDB.test.d.ts +0 -1
  796. package/dist/core/field/RichTextField.test.d.ts +0 -1
  797. package/dist/core/shape/ListShape.test.d.ts +0 -1
  798. package/dist/core/shape/RecordShape.d.ts +0 -26
  799. package/dist/core/shape/RecordShape.js +0 -102
  800. package/dist/core/shape/RecordShape.test.d.ts +0 -1
  801. package/dist/core/shape/RichTextShape.d.ts +0 -75
  802. package/dist/core/shape/RichTextShape.js +0 -435
  803. package/dist/core/shape/RichTextShape.test.d.ts +0 -1
  804. package/dist/core/shape/ScalarShape.d.ts +0 -20
  805. package/dist/core/shape/ScalarShape.js +0 -53
  806. package/dist/core/shape/ScalarShape.test.d.ts +0 -1
  807. package/dist/core/shape/UnionShape.d.ts +0 -34
  808. package/dist/core/shape/UnionShape.js +0 -141
  809. package/dist/core/shape/UnionShape.test.d.ts +0 -1
  810. package/dist/core/source/CombinedSource.test.d.ts +0 -1
  811. package/dist/core/source/FSSource.test.d.ts +0 -1
  812. package/dist/core/source/FilePatch.test.d.ts +0 -1
  813. package/dist/core/source/GitDelta.test.d.ts +0 -1
  814. package/dist/core/source/GitUtils.test.d.ts +0 -1
  815. package/dist/core/source/GithubSource.test.d.ts +0 -1
  816. package/dist/core/source/IndexedDBSource.test.d.ts +0 -1
  817. package/dist/core/source/MemorySource.test.d.ts +0 -1
  818. package/dist/core/source/SourceExport.test.d.ts +0 -1
  819. package/dist/core/source/Tree.test.d.ts +0 -1
  820. package/dist/core/source/Utils.test.d.ts +0 -1
  821. package/dist/core/util/CodeGen.test.d.ts +0 -1
  822. package/dist/core/util/EntryFilenames.test.d.ts +0 -1
  823. package/dist/core/util/JWT.test.d.ts +0 -1
  824. package/dist/core/util/Paths.test.d.ts +0 -1
  825. package/dist/core/util/Slugs.test.d.ts +0 -1
  826. package/dist/dashboard/DashboardNav.d.ts +0 -22
  827. package/dist/dashboard/DashboardNav.js +0 -44
  828. package/dist/dashboard/DashboardProvider.d.ts +0 -16
  829. package/dist/dashboard/DashboardProvider.js +0 -28
  830. package/dist/dashboard/Routes.d.ts +0 -111
  831. package/dist/dashboard/Routes.js +0 -78
  832. package/dist/dashboard/Welcome.d.ts +0 -1
  833. package/dist/dashboard/Welcome.js +0 -21
  834. package/dist/dashboard/atoms/DashboardAtoms.d.ts +0 -18
  835. package/dist/dashboard/atoms/DashboardAtoms.js +0 -86
  836. package/dist/dashboard/atoms/DbAtoms.d.ts +0 -5
  837. package/dist/dashboard/atoms/DbAtoms.js +0 -95
  838. package/dist/dashboard/atoms/Edits.d.ts +0 -31
  839. package/dist/dashboard/atoms/Edits.js +0 -93
  840. package/dist/dashboard/atoms/EntryAtoms.d.ts +0 -34
  841. package/dist/dashboard/atoms/EntryAtoms.js +0 -298
  842. package/dist/dashboard/atoms/EntryEditorAtoms.d.ts +0 -255
  843. package/dist/dashboard/atoms/EntryEditorAtoms.js +0 -629
  844. package/dist/dashboard/atoms/EntrySummaryAtoms.d.ts +0 -21
  845. package/dist/dashboard/atoms/EntrySummaryAtoms.js +0 -58
  846. package/dist/dashboard/atoms/ErrorAtoms.d.ts +0 -4
  847. package/dist/dashboard/atoms/ErrorAtoms.js +0 -18
  848. package/dist/dashboard/atoms/FormAtoms.d.ts +0 -56
  849. package/dist/dashboard/atoms/FormAtoms.js +0 -189
  850. package/dist/dashboard/atoms/LocationAtoms.d.ts +0 -25
  851. package/dist/dashboard/atoms/LocationAtoms.js +0 -104
  852. package/dist/dashboard/atoms/NavigationAtoms.d.ts +0 -38
  853. package/dist/dashboard/atoms/NavigationAtoms.js +0 -124
  854. package/dist/dashboard/atoms/PolicyAtom.d.ts +0 -6
  855. package/dist/dashboard/atoms/PolicyAtom.js +0 -29
  856. package/dist/dashboard/atoms/PreferencesAtoms.d.ts +0 -16
  857. package/dist/dashboard/atoms/PreferencesAtoms.js +0 -53
  858. package/dist/dashboard/atoms/RouterAtoms.d.ts +0 -78
  859. package/dist/dashboard/atoms/RouterAtoms.js +0 -161
  860. package/dist/dashboard/atoms/StyleAtoms.d.ts +0 -1
  861. package/dist/dashboard/atoms/StyleAtoms.js +0 -14
  862. package/dist/dashboard/atoms/YAtom.d.ts +0 -2
  863. package/dist/dashboard/atoms/YAtom.js +0 -24
  864. package/dist/dashboard/editor/DefaultViews.d.ts +0 -19
  865. package/dist/dashboard/editor/DefaultViews.js +0 -52
  866. package/dist/dashboard/editor/InputForm.d.ts +0 -26
  867. package/dist/dashboard/editor/InputForm.js +0 -53
  868. package/dist/dashboard/editor/ViewKeys.d.ts +0 -23
  869. package/dist/dashboard/editor/ViewKeys.js +0 -29
  870. package/dist/dashboard/hook/UseConfig.d.ts +0 -1
  871. package/dist/dashboard/hook/UseConfig.js +0 -12
  872. package/dist/dashboard/hook/UseDashboard.d.ts +0 -1
  873. package/dist/dashboard/hook/UseDashboard.js +0 -12
  874. package/dist/dashboard/hook/UseDb.d.ts +0 -2
  875. package/dist/dashboard/hook/UseDb.js +0 -14
  876. package/dist/dashboard/hook/UseDebounce.d.ts +0 -1
  877. package/dist/dashboard/hook/UseDebounce.js +0 -23
  878. package/dist/dashboard/hook/UseEntryLocation.d.ts +0 -1
  879. package/dist/dashboard/hook/UseEntryLocation.js +0 -12
  880. package/dist/dashboard/hook/UseEntrySummary.d.ts +0 -1
  881. package/dist/dashboard/hook/UseEntrySummary.js +0 -16
  882. package/dist/dashboard/hook/UseExplorer.d.ts +0 -14
  883. package/dist/dashboard/hook/UseExplorer.js +0 -13
  884. package/dist/dashboard/hook/UseFocusList.d.ts +0 -14
  885. package/dist/dashboard/hook/UseFocusList.js +0 -113
  886. package/dist/dashboard/hook/UseNav.d.ts +0 -10
  887. package/dist/dashboard/hook/UseNav.js +0 -12
  888. package/dist/dashboard/hook/UsePolicy.d.ts +0 -1
  889. package/dist/dashboard/hook/UsePolicy.js +0 -14
  890. package/dist/dashboard/hook/UsePreferences.d.ts +0 -6
  891. package/dist/dashboard/hook/UsePreferences.js +0 -30
  892. package/dist/dashboard/hook/UseSession.d.ts +0 -1
  893. package/dist/dashboard/hook/UseSession.js +0 -12
  894. package/dist/dashboard/hook/UseUploads.d.ts +0 -42
  895. package/dist/dashboard/hook/UseUploads.js +0 -91
  896. package/dist/dashboard/pages/ContentView.d.ts +0 -5
  897. package/dist/dashboard/pages/ContentView.js +0 -96
  898. package/dist/dashboard/util/Atoms.d.ts +0 -2
  899. package/dist/dashboard/util/Atoms.js +0 -21
  900. package/dist/dashboard/util/DebounceAtom.d.ts +0 -2
  901. package/dist/dashboard/util/DebounceAtom.js +0 -26
  902. package/dist/dashboard/util/HashRouter.d.ts +0 -1
  903. package/dist/dashboard/util/HashRouter.js +0 -2
  904. package/dist/dashboard/util/Head.d.ts +0 -2
  905. package/dist/dashboard/util/Head.js +0 -10
  906. package/dist/dashboard/util/KeepInView.d.ts +0 -2
  907. package/dist/dashboard/util/KeepInView.js +0 -19
  908. package/dist/dashboard/util/KeepPreviousData.d.ts +0 -9
  909. package/dist/dashboard/util/KeepPreviousData.js +0 -32
  910. package/dist/dashboard/util/Loader.d.ts +0 -17
  911. package/dist/dashboard/util/Loader.js +0 -31
  912. package/dist/dashboard/util/SuspenseBoundary.d.ts +0 -4
  913. package/dist/dashboard/util/SuspenseBoundary.js +0 -23
  914. package/dist/dashboard/util/WithResolvers.d.ts +0 -2
  915. package/dist/dashboard/util/WithResolvers.js +0 -16
  916. package/dist/dashboard/view/AlineaLogo.d.ts +0 -2
  917. package/dist/dashboard/view/AlineaLogo.js +0 -16
  918. package/dist/dashboard/view/Breadcrumbs.d.ts +0 -3
  919. package/dist/dashboard/view/Breadcrumbs.js +0 -33
  920. package/dist/dashboard/view/Create.d.ts +0 -13
  921. package/dist/dashboard/view/Create.js +0 -75
  922. package/dist/dashboard/view/EntryEdit.d.ts +0 -5
  923. package/dist/dashboard/view/EntryEdit.js +0 -222
  924. package/dist/dashboard/view/EntryTree.d.ts +0 -5
  925. package/dist/dashboard/view/EntryTree.js +0 -1463
  926. package/dist/dashboard/view/ErrorBoundary.d.ts +0 -6
  927. package/dist/dashboard/view/ErrorBoundary.js +0 -95
  928. package/dist/dashboard/view/IconButton.d.ts +0 -18
  929. package/dist/dashboard/view/IconButton.js +0 -51
  930. package/dist/dashboard/view/InputLabel.d.ts +0 -36
  931. package/dist/dashboard/view/InputLabel.js +0 -151
  932. package/dist/dashboard/view/MediaExplorer.d.ts +0 -7
  933. package/dist/dashboard/view/MediaExplorer.js +0 -121
  934. package/dist/dashboard/view/Modal.d.ts +0 -8
  935. package/dist/dashboard/view/Modal.js +0 -63
  936. package/dist/dashboard/view/PageHeader.d.ts +0 -5
  937. package/dist/dashboard/view/PageHeader.js +0 -26
  938. package/dist/dashboard/view/Preview.d.ts +0 -3
  939. package/dist/dashboard/view/Preview.js +0 -20
  940. package/dist/dashboard/view/RootOverview.d.ts +0 -5
  941. package/dist/dashboard/view/RootOverview.js +0 -46
  942. package/dist/dashboard/view/SearchBox.d.ts +0 -1
  943. package/dist/dashboard/view/SearchBox.js +0 -126
  944. package/dist/dashboard/view/Sidebar.d.ts +0 -21
  945. package/dist/dashboard/view/Sidebar.js +0 -312
  946. package/dist/dashboard/view/Toolbar.d.ts +0 -9
  947. package/dist/dashboard/view/Toolbar.js +0 -240
  948. package/dist/dashboard/view/Viewport.d.ts +0 -8
  949. package/dist/dashboard/view/Viewport.js +0 -69
  950. package/dist/dashboard/view/WorkspaceLabel.d.ts +0 -7
  951. package/dist/dashboard/view/WorkspaceLabel.js +0 -32
  952. package/dist/dashboard/view/diff/ChangeBox.d.ts +0 -14
  953. package/dist/dashboard/view/diff/ChangeBox.js +0 -36
  954. package/dist/dashboard/view/diff/DiffUtils.d.ts +0 -16
  955. package/dist/dashboard/view/diff/DiffUtils.js +0 -82
  956. package/dist/dashboard/view/diff/DiffUtils.test.d.ts +0 -1
  957. package/dist/dashboard/view/diff/EntryDiff.d.ts +0 -6
  958. package/dist/dashboard/view/diff/EntryDiff.js +0 -45
  959. package/dist/dashboard/view/diff/FieldDiff.d.ts +0 -10
  960. package/dist/dashboard/view/diff/FieldDiff.js +0 -51
  961. package/dist/dashboard/view/diff/FieldsDiff.d.ts +0 -7
  962. package/dist/dashboard/view/diff/FieldsDiff.js +0 -24
  963. package/dist/dashboard/view/diff/ListDiff.d.ts +0 -10
  964. package/dist/dashboard/view/diff/ListDiff.js +0 -32
  965. package/dist/dashboard/view/diff/RichTextDiff.d.ts +0 -11
  966. package/dist/dashboard/view/diff/RichTextDiff.js +0 -94
  967. package/dist/dashboard/view/diff/ScalarDiff.d.ts +0 -5
  968. package/dist/dashboard/view/diff/ScalarDiff.js +0 -1520
  969. package/dist/dashboard/view/entry/EditModeToggle.d.ts +0 -9
  970. package/dist/dashboard/view/entry/EditModeToggle.js +0 -51
  971. package/dist/dashboard/view/entry/EntryHeader.d.ts +0 -5
  972. package/dist/dashboard/view/entry/EntryHeader.js +0 -414
  973. package/dist/dashboard/view/entry/EntryHistory.d.ts +0 -2
  974. package/dist/dashboard/view/entry/EntryHistory.js +0 -78
  975. package/dist/dashboard/view/entry/EntryNotice.d.ts +0 -7
  976. package/dist/dashboard/view/entry/EntryNotice.js +0 -44
  977. package/dist/dashboard/view/entry/EntryPreview.d.ts +0 -10
  978. package/dist/dashboard/view/entry/EntryPreview.js +0 -44
  979. package/dist/dashboard/view/entry/EntrySummary.d.ts +0 -3
  980. package/dist/dashboard/view/entry/EntrySummary.js +0 -75
  981. package/dist/dashboard/view/entry/EntryTitle.d.ts +0 -7
  982. package/dist/dashboard/view/entry/EntryTitle.js +0 -64
  983. package/dist/dashboard/view/entry/FieldToolbar.d.ts +0 -11
  984. package/dist/dashboard/view/entry/FieldToolbar.js +0 -41
  985. package/dist/dashboard/view/entry/LangSwitch.d.ts +0 -7
  986. package/dist/dashboard/view/entry/LangSwitch.js +0 -110
  987. package/dist/dashboard/view/entry/NewEntry.d.ts +0 -4
  988. package/dist/dashboard/view/entry/NewEntry.js +0 -288
  989. package/dist/dashboard/view/entry/RootHeader.d.ts +0 -4
  990. package/dist/dashboard/view/entry/RootHeader.js +0 -61
  991. package/dist/dashboard/view/explorer/Explorer.d.ts +0 -24
  992. package/dist/dashboard/view/explorer/Explorer.js +0 -2230
  993. package/dist/dashboard/view/explorer/ExplorerItem.d.ts +0 -11
  994. package/dist/dashboard/view/explorer/ExplorerItem.js +0 -128
  995. package/dist/dashboard/view/explorer/ExplorerRow.d.ts +0 -15
  996. package/dist/dashboard/view/explorer/ExplorerRow.js +0 -73
  997. package/dist/dashboard/view/media/CardOverview.d.ts +0 -1
  998. package/dist/dashboard/view/media/CardOverview.js +0 -10
  999. package/dist/dashboard/view/media/FileEntry.d.ts +0 -6
  1000. package/dist/dashboard/view/media/FileEntry.js +0 -223
  1001. package/dist/dashboard/view/media/FileSummary.d.ts +0 -3
  1002. package/dist/dashboard/view/media/FileSummary.js +0 -102
  1003. package/dist/dashboard/view/media/FileUploadRow.d.ts +0 -2
  1004. package/dist/dashboard/view/media/FileUploadRow.js +0 -53
  1005. package/dist/dashboard/view/media/FileUploader.d.ts +0 -10
  1006. package/dist/dashboard/view/media/FileUploader.js +0 -151
  1007. package/dist/dashboard/view/media/MediaThumbnail.d.ts +0 -11
  1008. package/dist/dashboard/view/media/MediaThumbnail.js +0 -55
  1009. package/dist/dashboard/view/preview/BrowserPreview.d.ts +0 -12
  1010. package/dist/dashboard/view/preview/BrowserPreview.js +0 -210
  1011. package/dist/dashboard/view/sidebar/SidebarSettings.d.ts +0 -1
  1012. package/dist/dashboard/view/sidebar/SidebarSettings.js +0 -192
  1013. package/dist/field/check/CheckField.stories.d.ts +0 -5
  1014. package/dist/field/code/CodeField.stories.d.ts +0 -5
  1015. package/dist/field/date/DateField.stories.d.ts +0 -5
  1016. package/dist/field/json/JsonField.stories.d.ts +0 -5
  1017. package/dist/field/metadata/MetadataField.stories.d.ts +0 -5
  1018. package/dist/field/number/NumberField.stories.d.ts +0 -5
  1019. package/dist/field/object/ObjectField.stories.d.ts +0 -5
  1020. package/dist/field/path/PathField.stories.d.ts +0 -5
  1021. package/dist/field/richtext/RichText.stories.d.ts +0 -5
  1022. package/dist/field/select/SelectField.stories.d.ts +0 -5
  1023. package/dist/field/tabs/Tabs.stories.d.ts +0 -5
  1024. package/dist/field/text/TextField.stories.d.ts +0 -5
  1025. package/dist/field/time/TimeField.stories.d.ts +0 -5
  1026. package/dist/picker/entry/EntryPicker.browser.d.ts +0 -7
  1027. package/dist/picker/entry/EntryPicker.browser.js +0 -373
  1028. package/dist/picker/entry/EntryPicker.stories.d.ts +0 -2
  1029. package/dist/picker/entry/EntryPickerRow.d.ts +0 -5
  1030. package/dist/picker/entry/EntryPickerRow.js +0 -24
  1031. package/dist/picker/url/UrlPicker.browser.d.ts +0 -6
  1032. package/dist/picker/url/UrlPicker.browser.js +0 -83
  1033. package/dist/picker/url/UrlPicker.stories.d.ts +0 -5
  1034. package/dist/picker/url/UrlPickerRow.d.ts +0 -5
  1035. package/dist/picker/url/UrlPickerRow.js +0 -38
  1036. package/dist/preview/ChunkCookieValue.test.d.ts +0 -1
  1037. package/dist/preview/PreviewPayload.test.d.ts +0 -1
  1038. package/dist/test/EntryFixture.d.ts +0 -30
  1039. package/dist/test/EntryFixture.js +0 -91
  1040. package/dist/test/broken-index.test.d.ts +0 -1
  1041. package/dist/test/cms.d.ts +0 -17
  1042. package/dist/test/cms.js +0 -38
  1043. package/dist/test/drafts.test.d.ts +0 -1
  1044. package/dist/test/example.d.ts +0 -137
  1045. package/dist/test/example.js +0 -230
  1046. package/dist/test/insert-order.test.d.ts +0 -1
  1047. package/dist/test/links.test.d.ts +0 -1
  1048. package/dist/test/locales.test.d.ts +0 -1
  1049. package/dist/test/moves.test.d.ts +0 -1
  1050. package/dist/test/mutate.test.d.ts +0 -1
  1051. package/dist/test/query.test.d.ts +0 -1
  1052. package/dist/test/renames.test.d.ts +0 -1
  1053. package/dist/test/roles.test.d.ts +0 -1
  1054. package/dist/test/schema/DemoHome.d.ts +0 -25
  1055. package/dist/test/schema/DemoHome.js +0 -25
  1056. package/dist/test/schema/DemoRecipe.d.ts +0 -14
  1057. package/dist/test/schema/DemoRecipe.js +0 -22
  1058. package/dist/test/schema/DemoRecipes.d.ts +0 -4
  1059. package/dist/test/schema/DemoRecipes.js +0 -14
  1060. package/dist/test/schema/index.d.ts +0 -3
  1061. package/dist/test/schema/index.js +0 -4
  1062. package/dist/test/seeding.test.d.ts +0 -1
  1063. package/dist/test/shared.test.d.ts +0 -1
  1064. package/dist/test/status.test.d.ts +0 -1
  1065. package/dist/test/uploads.test.d.ts +0 -1
  1066. package/dist/ui/AppBar.d.ts +0 -14
  1067. package/dist/ui/AppBar.js +0 -68
  1068. package/dist/ui/Avatar.d.ts +0 -6
  1069. package/dist/ui/Avatar.js +0 -33
  1070. package/dist/ui/Badge.d.ts +0 -9
  1071. package/dist/ui/Badge.js +0 -44
  1072. package/dist/ui/Button.d.ts +0 -9
  1073. package/dist/ui/Button.js +0 -57
  1074. package/dist/ui/Button.stories.d.ts +0 -6
  1075. package/dist/ui/Chip.d.ts +0 -8
  1076. package/dist/ui/Chip.js +0 -46
  1077. package/dist/ui/DropdownMenu.d.ts +0 -12
  1078. package/dist/ui/DropdownMenu.js +0 -415
  1079. package/dist/ui/Ellipsis.d.ts +0 -2
  1080. package/dist/ui/Ellipsis.js +0 -33
  1081. package/dist/ui/ErrorMessage.d.ts +0 -4
  1082. package/dist/ui/ErrorMessage.js +0 -17
  1083. package/dist/ui/Icon.d.ts +0 -9
  1084. package/dist/ui/Icon.js +0 -41
  1085. package/dist/ui/Lift.d.ts +0 -3
  1086. package/dist/ui/Lift.js +0 -22
  1087. package/dist/ui/Loader.d.ts +0 -8
  1088. package/dist/ui/Loader.js +0 -32
  1089. package/dist/ui/Main.d.ts +0 -12
  1090. package/dist/ui/Main.js +0 -56
  1091. package/dist/ui/Pane.d.ts +0 -9
  1092. package/dist/ui/Pane.js +0 -132
  1093. package/dist/ui/PopoverMenu.d.ts +0 -12
  1094. package/dist/ui/PopoverMenu.js +0 -418
  1095. package/dist/ui/Property.d.ts +0 -1
  1096. package/dist/ui/Property.js +0 -7
  1097. package/dist/ui/Sink.d.ts +0 -9
  1098. package/dist/ui/Sink.js +0 -49
  1099. package/dist/ui/Statusbar.d.ts +0 -15
  1100. package/dist/ui/Statusbar.js +0 -54
  1101. package/dist/ui/Tabs.d.ts +0 -11
  1102. package/dist/ui/Tabs.js +0 -293
  1103. package/dist/ui/TextLabel.d.ts +0 -5
  1104. package/dist/ui/TextLabel.js +0 -10
  1105. package/dist/ui/Typo.d.ts +0 -35
  1106. package/dist/ui/Typo.js +0 -28
  1107. package/dist/ui/UIStory.d.ts +0 -8
  1108. package/dist/ui/branding/FavIcon.d.ts +0 -5
  1109. package/dist/ui/branding/FavIcon.js +0 -56
  1110. package/dist/ui/branding/LogoShape.d.ts +0 -6
  1111. package/dist/ui/branding/LogoShape.js +0 -52
  1112. package/dist/ui/hook/UseAutoHide.d.ts +0 -8
  1113. package/dist/ui/hook/UseAutoHide.js +0 -43
  1114. package/dist/ui/hook/UseColorScheme.d.ts +0 -4
  1115. package/dist/ui/hook/UseColorScheme.js +0 -13
  1116. package/dist/ui/hook/UseContrastColor.d.ts +0 -1
  1117. package/dist/ui/hook/UseContrastColor.js +0 -12
  1118. package/dist/ui/hook/UseElementSize.d.ts +0 -6
  1119. package/dist/ui/hook/UseElementSize.js +0 -52
  1120. package/dist/ui/hook/UseForceUpdate.d.ts +0 -1
  1121. package/dist/ui/hook/UseForceUpdate.js +0 -11
  1122. package/dist/ui/hook/UseHash.d.ts +0 -1
  1123. package/dist/ui/hook/UseHash.js +0 -24
  1124. package/dist/ui/hook/UseInitialEffect.d.ts +0 -2
  1125. package/dist/ui/hook/UseInitialEffect.js +0 -15
  1126. package/dist/ui/hook/UseLocalStorage.d.ts +0 -1
  1127. package/dist/ui/hook/UseLocalStorage.js +0 -36
  1128. package/dist/ui/hook/UseNonInitialEffect.d.ts +0 -2
  1129. package/dist/ui/hook/UseNonInitialEffect.js +0 -17
  1130. package/dist/ui/hook/UseTrigger.d.ts +0 -7
  1131. package/dist/ui/hook/UseTrigger.js +0 -29
  1132. package/dist/ui/icons/IcAlignJustify.d.ts +0 -3
  1133. package/dist/ui/icons/IcAlignJustify.js +0 -18
  1134. package/dist/ui/icons/IcAlignLeft.d.ts +0 -2
  1135. package/dist/ui/icons/IcAlignLeft.js +0 -16
  1136. package/dist/ui/icons/IcAlignRight.d.ts +0 -2
  1137. package/dist/ui/icons/IcAlignRight.js +0 -16
  1138. package/dist/ui/icons/IcBaselineAccountCircle.d.ts +0 -2
  1139. package/dist/ui/icons/IcBaselineAccountCircle.js +0 -26
  1140. package/dist/ui/icons/IcBaselineContentCopy.d.ts +0 -2
  1141. package/dist/ui/icons/IcBaselineContentCopy.js +0 -26
  1142. package/dist/ui/icons/IcBaselineContentPasteGo.d.ts +0 -2
  1143. package/dist/ui/icons/IcBaselineContentPasteGo.js +0 -35
  1144. package/dist/ui/icons/IcBaselineDesktopMac.d.ts +0 -2
  1145. package/dist/ui/icons/IcBaselineDesktopMac.js +0 -16
  1146. package/dist/ui/icons/IcBaselineErrorOutline.d.ts +0 -2
  1147. package/dist/ui/icons/IcBaselineErrorOutline.js +0 -26
  1148. package/dist/ui/icons/IcBaselinePause.d.ts +0 -2
  1149. package/dist/ui/icons/IcBaselinePause.js +0 -20
  1150. package/dist/ui/icons/IcBaselinePhoneIphone.d.ts +0 -2
  1151. package/dist/ui/icons/IcBaselinePhoneIphone.js +0 -16
  1152. package/dist/ui/icons/IcBaselineWifiTethering.d.ts +0 -2
  1153. package/dist/ui/icons/IcBaselineWifiTethering.js +0 -26
  1154. package/dist/ui/icons/IcOutlineArchive.d.ts +0 -2
  1155. package/dist/ui/icons/IcOutlineArchive.js +0 -26
  1156. package/dist/ui/icons/IcOutlineArrowCircleRight.d.ts +0 -2
  1157. package/dist/ui/icons/IcOutlineArrowCircleRight.js +0 -16
  1158. package/dist/ui/icons/IcOutlineAvTimer.d.ts +0 -2
  1159. package/dist/ui/icons/IcOutlineAvTimer.js +0 -26
  1160. package/dist/ui/icons/IcOutlineCloudUpload.d.ts +0 -2
  1161. package/dist/ui/icons/IcOutlineCloudUpload.js +0 -26
  1162. package/dist/ui/icons/IcOutlineDarkMode.d.ts +0 -2
  1163. package/dist/ui/icons/IcOutlineDarkMode.js +0 -16
  1164. package/dist/ui/icons/IcOutlineDescription.d.ts +0 -2
  1165. package/dist/ui/icons/IcOutlineDescription.js +0 -26
  1166. package/dist/ui/icons/IcOutlineDrafts.d.ts +0 -2
  1167. package/dist/ui/icons/IcOutlineDrafts.js +0 -26
  1168. package/dist/ui/icons/IcOutlineFolder.d.ts +0 -2
  1169. package/dist/ui/icons/IcOutlineFolder.js +0 -26
  1170. package/dist/ui/icons/IcOutlineInsertDriveFile.d.ts +0 -2
  1171. package/dist/ui/icons/IcOutlineInsertDriveFile.js +0 -26
  1172. package/dist/ui/icons/IcOutlineKeyboardTab.d.ts +0 -2
  1173. package/dist/ui/icons/IcOutlineKeyboardTab.js +0 -26
  1174. package/dist/ui/icons/IcOutlineLightMode.d.ts +0 -2
  1175. package/dist/ui/icons/IcOutlineLightMode.js +0 -16
  1176. package/dist/ui/icons/IcOutlineList.d.ts +0 -3
  1177. package/dist/ui/icons/IcOutlineList.js +0 -18
  1178. package/dist/ui/icons/IcOutlineLock.d.ts +0 -2
  1179. package/dist/ui/icons/IcOutlineLock.js +0 -26
  1180. package/dist/ui/icons/IcOutlineMoreHoriz.d.ts +0 -3
  1181. package/dist/ui/icons/IcOutlineMoreHoriz.js +0 -18
  1182. package/dist/ui/icons/IcOutlinePreview.d.ts +0 -2
  1183. package/dist/ui/icons/IcOutlinePreview.js +0 -16
  1184. package/dist/ui/icons/IcOutlineRemoveRedEye.d.ts +0 -2
  1185. package/dist/ui/icons/IcOutlineRemoveRedEye.js +0 -26
  1186. package/dist/ui/icons/IcOutlineScreenshot.d.ts +0 -2
  1187. package/dist/ui/icons/IcOutlineScreenshot.js +0 -16
  1188. package/dist/ui/icons/IcOutlineTableRows.d.ts +0 -2
  1189. package/dist/ui/icons/IcOutlineTableRows.js +0 -26
  1190. package/dist/ui/icons/IcRoundAdd.d.ts +0 -2
  1191. package/dist/ui/icons/IcRoundAdd.js +0 -16
  1192. package/dist/ui/icons/IcRoundAddCircle.d.ts +0 -3
  1193. package/dist/ui/icons/IcRoundAddCircle.js +0 -18
  1194. package/dist/ui/icons/IcRoundAddCircleOutline.d.ts +0 -2
  1195. package/dist/ui/icons/IcRoundAddCircleOutline.js +0 -16
  1196. package/dist/ui/icons/IcRoundArchive.d.ts +0 -2
  1197. package/dist/ui/icons/IcRoundArchive.js +0 -16
  1198. package/dist/ui/icons/IcRoundArrowBack.d.ts +0 -2
  1199. package/dist/ui/icons/IcRoundArrowBack.js +0 -16
  1200. package/dist/ui/icons/IcRoundArrowDownward.d.ts +0 -2
  1201. package/dist/ui/icons/IcRoundArrowDownward.js +0 -26
  1202. package/dist/ui/icons/IcRoundArrowDropDown.d.ts +0 -3
  1203. package/dist/ui/icons/IcRoundArrowDropDown.js +0 -18
  1204. package/dist/ui/icons/IcRoundArrowDropDownCircle.d.ts +0 -3
  1205. package/dist/ui/icons/IcRoundArrowDropDownCircle.js +0 -18
  1206. package/dist/ui/icons/IcRoundArrowDropUp.d.ts +0 -3
  1207. package/dist/ui/icons/IcRoundArrowDropUp.js +0 -18
  1208. package/dist/ui/icons/IcRoundArrowForward.d.ts +0 -2
  1209. package/dist/ui/icons/IcRoundArrowForward.js +0 -16
  1210. package/dist/ui/icons/IcRoundArrowUpward.d.ts +0 -2
  1211. package/dist/ui/icons/IcRoundArrowUpward.js +0 -26
  1212. package/dist/ui/icons/IcRoundAttachFile.d.ts +0 -2
  1213. package/dist/ui/icons/IcRoundAttachFile.js +0 -10
  1214. package/dist/ui/icons/IcRoundCheck.d.ts +0 -2
  1215. package/dist/ui/icons/IcRoundCheck.js +0 -16
  1216. package/dist/ui/icons/IcRoundCheckBox.d.ts +0 -2
  1217. package/dist/ui/icons/IcRoundCheckBox.js +0 -16
  1218. package/dist/ui/icons/IcRoundCheckBoxOutlineBlank.d.ts +0 -2
  1219. package/dist/ui/icons/IcRoundCheckBoxOutlineBlank.js +0 -16
  1220. package/dist/ui/icons/IcRoundChevronRight.d.ts +0 -2
  1221. package/dist/ui/icons/IcRoundChevronRight.js +0 -26
  1222. package/dist/ui/icons/IcRoundDescription.d.ts +0 -2
  1223. package/dist/ui/icons/IcRoundDescription.js +0 -26
  1224. package/dist/ui/icons/IcRoundDragHandle.d.ts +0 -3
  1225. package/dist/ui/icons/IcRoundDragHandle.js +0 -18
  1226. package/dist/ui/icons/IcRoundExitToApp.d.ts +0 -2
  1227. package/dist/ui/icons/IcRoundExitToApp.js +0 -26
  1228. package/dist/ui/icons/IcRoundFeed.d.ts +0 -2
  1229. package/dist/ui/icons/IcRoundFeed.js +0 -16
  1230. package/dist/ui/icons/IcRoundFormatBold.d.ts +0 -3
  1231. package/dist/ui/icons/IcRoundFormatBold.js +0 -18
  1232. package/dist/ui/icons/IcRoundFormatClear.d.ts +0 -3
  1233. package/dist/ui/icons/IcRoundFormatClear.js +0 -18
  1234. package/dist/ui/icons/IcRoundFormatItalic.d.ts +0 -3
  1235. package/dist/ui/icons/IcRoundFormatItalic.js +0 -18
  1236. package/dist/ui/icons/IcRoundFormatListBulleted.d.ts +0 -3
  1237. package/dist/ui/icons/IcRoundFormatListBulleted.js +0 -18
  1238. package/dist/ui/icons/IcRoundFormatPaint.d.ts +0 -2
  1239. package/dist/ui/icons/IcRoundFormatPaint.js +0 -10
  1240. package/dist/ui/icons/IcRoundHamburger.d.ts +0 -3
  1241. package/dist/ui/icons/IcRoundHamburger.js +0 -18
  1242. package/dist/ui/icons/IcRoundHdrStrong.d.ts +0 -3
  1243. package/dist/ui/icons/IcRoundHdrStrong.js +0 -18
  1244. package/dist/ui/icons/IcRoundHorizontalRule.d.ts +0 -3
  1245. package/dist/ui/icons/IcRoundHorizontalRule.js +0 -19
  1246. package/dist/ui/icons/IcRoundInsertDriveFile.d.ts +0 -2
  1247. package/dist/ui/icons/IcRoundInsertDriveFile.js +0 -16
  1248. package/dist/ui/icons/IcRoundKeyboardArrowDown.d.ts +0 -2
  1249. package/dist/ui/icons/IcRoundKeyboardArrowDown.js +0 -16
  1250. package/dist/ui/icons/IcRoundKeyboardArrowLeft.d.ts +0 -3
  1251. package/dist/ui/icons/IcRoundKeyboardArrowLeft.js +0 -18
  1252. package/dist/ui/icons/IcRoundKeyboardArrowRight.d.ts +0 -2
  1253. package/dist/ui/icons/IcRoundKeyboardArrowRight.js +0 -16
  1254. package/dist/ui/icons/IcRoundKeyboardArrowUp.d.ts +0 -2
  1255. package/dist/ui/icons/IcRoundKeyboardArrowUp.js +0 -16
  1256. package/dist/ui/icons/IcRoundLanguage.d.ts +0 -2
  1257. package/dist/ui/icons/IcRoundLanguage.js +0 -16
  1258. package/dist/ui/icons/IcRoundLastPage.d.ts +0 -2
  1259. package/dist/ui/icons/IcRoundLastPage.js +0 -26
  1260. package/dist/ui/icons/IcRoundLock.d.ts +0 -3
  1261. package/dist/ui/icons/IcRoundLock.js +0 -18
  1262. package/dist/ui/icons/IcRoundMenu.d.ts +0 -2
  1263. package/dist/ui/icons/IcRoundMenu.js +0 -16
  1264. package/dist/ui/icons/IcRoundMoreHoriz.d.ts +0 -2
  1265. package/dist/ui/icons/IcRoundMoreHoriz.js +0 -16
  1266. package/dist/ui/icons/IcRoundMoreVert.d.ts +0 -2
  1267. package/dist/ui/icons/IcRoundMoreVert.js +0 -26
  1268. package/dist/ui/icons/IcRoundNorthEast.d.ts +0 -2
  1269. package/dist/ui/icons/IcRoundNorthEast.js +0 -16
  1270. package/dist/ui/icons/IcRoundNotes.d.ts +0 -2
  1271. package/dist/ui/icons/IcRoundNotes.js +0 -16
  1272. package/dist/ui/icons/IcRoundNumbers.d.ts +0 -2
  1273. package/dist/ui/icons/IcRoundNumbers.js +0 -16
  1274. package/dist/ui/icons/IcRoundPermMedia.d.ts +0 -2
  1275. package/dist/ui/icons/IcRoundPermMedia.js +0 -25
  1276. package/dist/ui/icons/IcRoundPublish.d.ts +0 -2
  1277. package/dist/ui/icons/IcRoundPublish.js +0 -16
  1278. package/dist/ui/icons/IcRoundPublishedWithChanges.d.ts +0 -2
  1279. package/dist/ui/icons/IcRoundPublishedWithChanges.js +0 -26
  1280. package/dist/ui/icons/IcRoundQuote.d.ts +0 -2
  1281. package/dist/ui/icons/IcRoundQuote.js +0 -16
  1282. package/dist/ui/icons/IcRoundRedo.d.ts +0 -3
  1283. package/dist/ui/icons/IcRoundRedo.js +0 -18
  1284. package/dist/ui/icons/IcRoundRemoveCircleOutline.d.ts +0 -2
  1285. package/dist/ui/icons/IcRoundRemoveCircleOutline.js +0 -16
  1286. package/dist/ui/icons/IcRoundRotateLeft.d.ts +0 -2
  1287. package/dist/ui/icons/IcRoundRotateLeft.js +0 -16
  1288. package/dist/ui/icons/IcRoundSend.d.ts +0 -2
  1289. package/dist/ui/icons/IcRoundSend.js +0 -26
  1290. package/dist/ui/icons/IcRoundSouthWest.d.ts +0 -2
  1291. package/dist/ui/icons/IcRoundSouthWest.js +0 -16
  1292. package/dist/ui/icons/IcRoundSubscript.d.ts +0 -2
  1293. package/dist/ui/icons/IcRoundSubscript.js +0 -26
  1294. package/dist/ui/icons/IcRoundSuperscript.d.ts +0 -2
  1295. package/dist/ui/icons/IcRoundSuperscript.js +0 -26
  1296. package/dist/ui/icons/IcRoundTabletMac.d.ts +0 -2
  1297. package/dist/ui/icons/IcRoundTabletMac.js +0 -16
  1298. package/dist/ui/icons/IcRoundTextFields.d.ts +0 -2
  1299. package/dist/ui/icons/IcRoundTextFields.js +0 -16
  1300. package/dist/ui/icons/IcRoundTranslate.d.ts +0 -2
  1301. package/dist/ui/icons/IcRoundTranslate.js +0 -26
  1302. package/dist/ui/icons/IcRoundUndo.d.ts +0 -3
  1303. package/dist/ui/icons/IcRoundUndo.js +0 -18
  1304. package/dist/ui/icons/IcRoundUnfoldLess.d.ts +0 -2
  1305. package/dist/ui/icons/IcRoundUnfoldLess.js +0 -26
  1306. package/dist/ui/icons/IcRoundUnfoldMore.d.ts +0 -2
  1307. package/dist/ui/icons/IcRoundUnfoldMore.js +0 -16
  1308. package/dist/ui/icons/IcRoundUploadFile.d.ts +0 -3
  1309. package/dist/ui/icons/IcRoundUploadFile.js +0 -18
  1310. package/dist/ui/icons/IcRoundVisibilityOff.d.ts +0 -2
  1311. package/dist/ui/icons/IcRoundVisibilityOff.js +0 -16
  1312. package/dist/ui/icons/IcRoundWarning.d.ts +0 -2
  1313. package/dist/ui/icons/IcRoundWarning.js +0 -16
  1314. package/dist/ui/icons/IcSharpBrightnessMedium.d.ts +0 -2
  1315. package/dist/ui/icons/IcSharpBrightnessMedium.js +0 -16
  1316. package/dist/ui/icons/IcSharpVerticalAlignCenter.d.ts +0 -2
  1317. package/dist/ui/icons/IcSharpVerticalAlignCenter.js +0 -16
  1318. package/dist/ui/icons/IcTwotoneDescription.d.ts +0 -2
  1319. package/dist/ui/icons/IcTwotoneDescription.js +0 -37
  1320. package/dist/ui/icons/IcTwotoneFolder.d.ts +0 -2
  1321. package/dist/ui/icons/IcTwotoneFolder.js +0 -37
  1322. package/dist/ui/icons/IcTwotoneInsertDriveFile.d.ts +0 -2
  1323. package/dist/ui/icons/IcTwotoneInsertDriveFile.js +0 -30
  1324. package/dist/ui/icons/MdiGithub.d.ts +0 -3
  1325. package/dist/ui/icons/MdiGithub.js +0 -18
  1326. package/dist/ui/icons/MdiSourceBranch.d.ts +0 -2
  1327. package/dist/ui/icons/MdiSourceBranch.js +0 -16
  1328. package/dist/ui/icons/MdiTwitterCircle.d.ts +0 -2
  1329. package/dist/ui/icons/MdiTwitterCircle.js +0 -26
  1330. package/dist/ui/icons/MiLayers.d.ts +0 -3
  1331. package/dist/ui/icons/MiLayers.js +0 -16
  1332. package/dist/ui/icons/PhGlobe.d.ts +0 -2
  1333. package/dist/ui/icons/PhGlobe.js +0 -26
  1334. package/dist/ui/icons/RiFlashlightFill.d.ts +0 -2
  1335. package/dist/ui/icons/RiFlashlightFill.js +0 -10
  1336. package/dist/ui/icons/TableDelete.d.ts +0 -2
  1337. package/dist/ui/icons/TableDelete.js +0 -25
  1338. package/dist/ui/icons/TableDeleteColumn.d.ts +0 -2
  1339. package/dist/ui/icons/TableDeleteColumn.js +0 -16
  1340. package/dist/ui/icons/TableDeleteRow.d.ts +0 -2
  1341. package/dist/ui/icons/TableDeleteRow.js +0 -16
  1342. package/dist/ui/icons/TableHeaderCell.d.ts +0 -2
  1343. package/dist/ui/icons/TableHeaderCell.js +0 -16
  1344. package/dist/ui/icons/TableHeaderColumn.d.ts +0 -2
  1345. package/dist/ui/icons/TableHeaderColumn.js +0 -16
  1346. package/dist/ui/icons/TableHeaderRow.d.ts +0 -2
  1347. package/dist/ui/icons/TableHeaderRow.js +0 -16
  1348. package/dist/ui/icons/TableInsertColumnAfter.d.ts +0 -2
  1349. package/dist/ui/icons/TableInsertColumnAfter.js +0 -16
  1350. package/dist/ui/icons/TableInsertColumnBefore.d.ts +0 -2
  1351. package/dist/ui/icons/TableInsertColumnBefore.js +0 -16
  1352. package/dist/ui/icons/TableInsertRowAfter.d.ts +0 -2
  1353. package/dist/ui/icons/TableInsertRowAfter.js +0 -16
  1354. package/dist/ui/icons/TableInsertRowBefore.d.ts +0 -2
  1355. package/dist/ui/icons/TableInsertRowBefore.js +0 -16
  1356. package/dist/ui/icons/TableMergeCells.d.ts +0 -2
  1357. package/dist/ui/icons/TableMergeCells.js +0 -16
  1358. package/dist/ui/icons/TableSplitCell.d.ts +0 -2
  1359. package/dist/ui/icons/TableSplitCell.js +0 -16
  1360. package/dist/ui/util/ContrastColor.d.ts +0 -1
  1361. package/dist/ui/util/ContrastColor.js +0 -17
  1362. package/dist/ui/util/CreateTypo.d.ts +0 -62
  1363. package/dist/ui/util/CreateTypo.js +0 -119
  1364. package/dist/ui/util/Elevation.d.ts +0 -12
  1365. package/dist/ui/util/Elevation.js +0 -20
  1366. package/dist/ui/util/PropsWithAs.d.ts +0 -12
  1367. package/dist/ui/util/PropsWithAs.js +0 -10
  1368. package/dist/ui/util/Slots.d.ts +0 -11
  1369. package/dist/ui/util/Slots.js +0 -50
  1370. package/dist/ui/util/TextareaAutosize.d.ts +0 -2
  1371. package/dist/ui/util/TextareaAutosize.js +0 -40
  1372. package/dist/ui/util/Units.d.ts +0 -1
  1373. package/dist/ui/util/Units.js +0 -7
  1374. package/dist/ui/util/UseId.d.ts +0 -1
  1375. package/dist/ui/util/UseId.js +0 -11
  1376. package/dist/yjs.d.ts +0 -1
  1377. package/dist/yjs.js +0 -206
  1378. /package/dist/{core/Shape.js → chunks/chunk-NUFRM6SI.js} +0 -0
  1379. /package/dist/{backend/Handler.test.d.ts → dashboard/app/EntrySidebarPreview.spec.d.ts} +0 -0
  1380. /package/dist/{backend/router/Router.test.d.ts → dashboard/app/WorkspaceMenu.spec.d.ts} +0 -0
  1381. /package/dist/{cli/Init.test.d.ts → field/link/LinkField.spec.d.ts} +0 -0
  1382. /package/dist/{cli/util/CommitMessage.test.d.ts → field/list/ListField.spec.d.ts} +0 -0
  1383. /package/dist/{core/Config.test.d.ts → field/richtext/RichTextField.spec.d.ts} +0 -0
@@ -1,2516 +1,52 @@
1
1
  import {
2
- Field,
3
- Functions,
4
- and,
5
- asc,
6
- callFunction,
7
- column,
8
- eq,
9
- gt,
10
- isNotNull,
11
- isNull,
12
- jsonAggregateArray,
13
- jsonArray,
14
- like,
15
- not,
16
- or,
17
- table,
18
- when
19
- } from "../../chunks/chunk-SKF4L7JN.js";
20
- import {
21
- Sql,
22
- getData,
23
- getField,
24
- getQuery,
25
- getResolver,
26
- getSelection,
27
- getSql,
28
- getTable,
29
- getTarget,
30
- hasField,
31
- hasQuery,
32
- hasSelection,
33
- hasSql,
34
- hasTable,
35
- hasTarget,
36
- input,
37
- internalData,
38
- internalQuery,
39
- internalResolver,
40
- internalSelection,
41
- internalSql,
42
- internalTarget,
43
- sql
44
- } from "../../chunks/chunk-PNILF4WM.js";
45
- import {
46
- __export
47
- } from "../../chunks/chunk-NZLE2WMY.js";
2
+ driver_exports
3
+ } from "../../chunks/chunk-X47OVDF3.js";
4
+ import "../../chunks/chunk-G6E35DMJ.js";
5
+ import "../../chunks/chunk-NWQXN4SB.js";
6
+ import "../../chunks/chunk-CQ52GEHY.js";
48
7
 
49
8
  // src/backend/api/CreateBackend.ts
50
9
  import { assert } from "alinea/core/util/Assert";
51
-
52
- // node_modules/rado/dist/driver.js
53
- var driver_exports = {};
54
- __export(driver_exports, {
55
- "@electric-sql/pglite": () => connect7,
56
- "@libsql/client": () => connect4,
57
- "@neondatabase/serverless": () => connect6,
58
- "@vercel/postgres": () => connect6,
59
- "better-sqlite3": () => connect,
60
- "bun:sqlite": () => connect2,
61
- d1: () => connect3,
62
- mysql2: () => connect5,
63
- pg: () => connect6,
64
- "sql.js": () => connect8
65
- });
66
-
67
- // node_modules/rado/dist/universal/functions.js
68
- var insertId = sql.universal({
69
- sqlite: Functions.last_insert_rowid(),
70
- postgres: Functions.lastval(),
71
- mysql: Functions.last_insert_id()
72
- }).mapWith(Number);
73
- function concat(...slices) {
74
- return sql.universal({
75
- mysql: Functions.concat(...slices),
76
- default: sql.join(slices.map(input), sql` || `)
77
- });
78
- }
79
-
80
- // node_modules/rado/dist/universal/transactions.js
81
- function txGenerator(create) {
82
- function run(tx) {
83
- const iter = create(tx);
84
- const next = (inner) => {
85
- if (inner instanceof Promise)
86
- return inner.then(iter.next.bind(iter)).catch(iter.throw.bind(iter)).then(handle);
87
- try {
88
- return handle(iter.next(inner));
89
- } catch (err) {
90
- return handle(iter.throw(err));
91
- }
92
- };
93
- const handle = ({ done, value }) => {
94
- if (done) return value;
95
- return next(typeof value === "function" ? tx.transaction(value) : value);
96
- };
97
- return next();
98
- }
99
- return Object.assign(run, {
100
- *[Symbol.iterator]() {
101
- return yield run;
102
- }
103
- });
104
- }
105
-
106
- // node_modules/rado/dist/core/Virtual.js
107
- function virtual(alias, source) {
108
- const target = { [internalTarget]: sql.identifier(alias) };
109
- if (source && hasSql(source)) {
110
- const expr = getSql(source);
111
- const name = expr.alias;
112
- if (!name) throw new Error("Cannot alias a virtual field without a name");
113
- return Object.assign(new Field(alias, name, expr), target);
114
- }
115
- return new Proxy(target, {
116
- get(target2, field) {
117
- if (field in target2) return target2[field];
118
- const from = source?.[field];
119
- if (typeof field !== "string") return from;
120
- return target2[field] = new Field(
121
- alias,
122
- field,
123
- from ? getSql(from) : void 0
124
- );
125
- }
126
- });
127
- }
128
-
129
- // node_modules/rado/dist/core/Selection.js
130
- var SqlColumn = class {
131
- constructor(sql2, targetName) {
132
- this.sql = sql2;
133
- this.targetName = targetName;
134
- }
135
- result(ctx) {
136
- const value = ctx.values[ctx.index++];
137
- if (!this.sql.mapFromDriverValue) return value;
138
- return this.sql.mapFromDriverValue(value, ctx.specs);
139
- }
140
- };
141
- var ObjectColumn = class {
142
- constructor(nullable, entries) {
143
- this.nullable = nullable;
144
- this.entries = entries;
145
- }
146
- result(ctx) {
147
- const result = {};
148
- let isNullable = this.nullable.size > 0;
149
- for (const entry of this.entries) {
150
- const name = entry[0];
151
- const col = entry[1];
152
- const value = col.result(ctx);
153
- result[name] = value;
154
- if (isNullable) {
155
- if (value === null) {
156
- if (col.targetName && !this.nullable.has(col.targetName))
157
- isNullable = false;
158
- } else {
159
- isNullable = false;
160
- }
161
- }
162
- }
163
- if (isNullable) return null;
164
- return result;
165
- }
166
- };
167
- var Selection = class {
168
- constructor(input2, nullable) {
169
- this.input = input2;
170
- this.nullable = nullable;
171
- const root = this.#defineColumn(nullable, input2);
172
- this.mapRow = root.result.bind(root);
173
- }
174
- mapRow;
175
- makeVirtual(name) {
176
- return virtual(name, this.input);
177
- }
178
- #defineColumn(nullable, input2) {
179
- const expr = getSql(input2);
180
- if (expr) return new SqlColumn(expr, getField(input2)?.targetName);
181
- return new ObjectColumn(
182
- nullable,
183
- Object.entries(input2).map(([name, value]) => [
184
- name,
185
- this.#defineColumn(nullable, value)
186
- ])
187
- );
188
- }
189
- fieldNames() {
190
- return this.#fieldNames(this.input, /* @__PURE__ */ new Set());
191
- }
192
- #fieldNames(input2, names, name) {
193
- const expr = getSql(input2);
194
- if (expr) {
195
- let exprName = name ?? expr.alias;
196
- if (!exprName) throw new Error("Missing field name");
197
- while (names.has(exprName)) exprName = `${exprName}_`;
198
- return [exprName];
199
- }
200
- return Object.entries(input2).flatMap(
201
- ([name2, value]) => this.#fieldNames(value, names, name2)
202
- );
203
- }
204
- #selectionToSql(input2, names, name) {
205
- const expr = getSql(input2);
206
- if (expr) {
207
- let exprName = name ?? expr.alias;
208
- if (exprName) {
209
- while (names.has(exprName)) exprName = `${exprName}_`;
210
- names.add(exprName);
211
- if (hasField(input2)) {
212
- const field = getField(input2);
213
- if (field.fieldName === exprName) return [expr];
214
- }
215
- return [sql`${expr.forSelection()} as ${sql.identifier(exprName)}`];
216
- }
217
- return [expr];
218
- }
219
- return Object.entries(input2).flatMap(
220
- ([name2, value]) => this.#selectionToSql(value, names, name2)
221
- );
222
- }
223
- get [internalSql]() {
224
- return sql.join(this.#selectionToSql(this.input, /* @__PURE__ */ new Set()), sql`, `);
225
- }
226
- join(right, operator) {
227
- return this;
228
- }
229
- };
230
- var TableSelection = class extends Selection {
231
- constructor(table2) {
232
- super(table2, /* @__PURE__ */ new Set());
233
- this.table = table2;
234
- }
235
- join(right, operator) {
236
- const leftTable = getTable(this.table);
237
- const rightTable = getTable(right);
238
- const nullable = new Set(this.nullable);
239
- if (operator === "right" || operator === "full")
240
- nullable.add(leftTable.aliased);
241
- if (operator === "left" || operator === "full")
242
- nullable.add(rightTable.aliased);
243
- return new JoinSelection([this.table, right], nullable);
244
- }
245
- };
246
- var JoinSelection = class _JoinSelection extends Selection {
247
- constructor(tables, nullable) {
248
- super(
249
- Object.fromEntries(tables.map((table2) => [getTable(table2).aliased, table2])),
250
- nullable
251
- );
252
- this.tables = tables;
253
- }
254
- join(right, operator) {
255
- const rightTable = getTable(right);
256
- const nullable = new Set(this.nullable);
257
- if (operator === "right" || operator === "full")
258
- this.tables.map((table2) => getTable(table2).aliased).forEach(nullable.add, nullable);
259
- if (operator === "left" || operator === "full")
260
- nullable.add(rightTable.aliased);
261
- return new _JoinSelection([...this.tables, right], nullable);
262
- }
263
- };
264
- function selection(input2, nullable = []) {
265
- return new Selection(input2, new Set(nullable));
266
- }
267
- ((selection2) => {
268
- function table2(table22) {
269
- return new TableSelection(table22);
270
- }
271
- selection2.table = table2;
272
- })(selection || (selection = {}));
273
-
274
- // node_modules/rado/dist/core/Query.js
275
- var Executable = class {
276
- #execute;
277
- constructor(exec) {
278
- this.#execute = exec;
279
- }
280
- *[Symbol.iterator]() {
281
- const interim = this.#execute();
282
- const isAsync = interim instanceof Promise;
283
- if (!isAsync) return interim;
284
- let result;
285
- yield interim.then((v) => result = v);
286
- return result;
287
- }
288
- run() {
289
- return this.#execute();
290
- }
291
- // biome-ignore lint/suspicious/noThenProperty:
292
- async then(onfulfilled, onrejected) {
293
- try {
294
- const result = await this.#execute();
295
- return onfulfilled ? onfulfilled(result) : result;
296
- } catch (error) {
297
- return onrejected ? onrejected(error) : Promise.reject(error);
298
- }
299
- }
300
- catch(onrejected) {
301
- return this.then().catch(onrejected);
302
- }
303
- finally(onfinally) {
304
- return this.then().finally(onfinally);
305
- }
306
- };
307
- var QueryBatch = class extends Executable {
308
- constructor(queryResolver, queries) {
309
- super(() => {
310
- return queryResolver.batch(queries).execute();
311
- });
312
- }
313
- };
314
- var Query = class extends Executable {
315
- [internalData];
316
- constructor(data) {
317
- super(() => this.#exec(void 0));
318
- this[internalData] = data;
319
- }
320
- #exec(method, db) {
321
- const data = getData(this);
322
- const resolver = db ? getResolver(db) : data.resolver;
323
- const isSelection = hasSelection(this);
324
- const prepared = resolver.prepare(this, "");
325
- const resultType = method ?? (isSelection ? "all" : "run");
326
- try {
327
- const result = prepared[resultType]();
328
- if (result instanceof Promise)
329
- return result.then((res) => res ?? null).finally(prepared.free.bind(prepared));
330
- prepared.free();
331
- return result ?? null;
332
- } catch (error) {
333
- prepared.free();
334
- throw error;
335
- }
336
- }
337
- all(db) {
338
- return this.#exec("all", db);
339
- }
340
- get(db) {
341
- return this.#exec("get", db);
342
- }
343
- run(db) {
344
- return this.#exec("run", db);
345
- }
346
- prepare(name) {
347
- return getData(this).resolver.prepare(this, name);
348
- }
349
- toSQL(db) {
350
- const resolver = db ? getResolver(db) : getData(this).resolver;
351
- if (!resolver) throw new Error("Query has no resolver");
352
- return resolver.toSQL(this);
353
- }
354
- };
355
-
356
- // node_modules/rado/dist/core/query/Delete.js
357
- var Delete = class extends Query {
358
- [internalData];
359
- constructor(data) {
360
- super(data);
361
- this[internalData] = data;
362
- if (data.returning) this[internalSelection] = data.returning;
363
- }
364
- get [internalQuery]() {
365
- return sql.chunk("emitDelete", this);
366
- }
367
- };
368
- var DeleteFrom = class _DeleteFrom extends Delete {
369
- where(...where) {
370
- return new _DeleteFrom({ ...getData(this), where: and(...where) });
371
- }
372
- returning(returning) {
373
- const data = getData(this);
374
- return new Delete({
375
- ...data,
376
- returning: returning ? selection(returning) : selection.table(data.from)
377
- });
378
- }
379
- };
380
-
381
- // node_modules/rado/dist/core/query/Insert.js
382
- var Insert = class extends Query {
383
- [internalData];
384
- constructor(data) {
385
- super(data);
386
- this[internalData] = data;
387
- if (data.returning) this[internalSelection] = data.returning;
388
- }
389
- get [internalQuery]() {
390
- return sql.chunk("emitInsert", this);
391
- }
392
- };
393
- var InsertCanReturn = class extends Insert {
394
- returning(returning) {
395
- const data = getData(this);
396
- return new Insert({
397
- ...data,
398
- returning: returning ? selection(returning) : selection.table(data.into)
399
- });
400
- }
401
- };
402
- var InsertCanConflict = class extends InsertCanReturn {
403
- onConflictDoNothing(onConflict) {
404
- return this.#onConflict(onConflict ?? {});
405
- }
406
- onConflictDoUpdate(onConflict) {
407
- return this.#onConflict(onConflict);
408
- }
409
- onDuplicateKeyUpdate(update) {
410
- return new InsertCanReturn({
411
- ...getData(this),
412
- onDuplicateKeyUpdate: this.#updateFields(update.set)
413
- });
414
- }
415
- #updateFields(update) {
416
- return sql.join(
417
- Object.entries(update).map(
418
- ([key, value]) => sql`${sql.identifier(key)} = ${input(value)}`
419
- ),
420
- sql`, `
421
- );
422
- }
423
- #onConflict({
424
- target,
425
- targetWhere,
426
- set,
427
- setWhere
428
- }) {
429
- const update = set && this.#updateFields(set);
430
- return new InsertCanReturn({
431
- ...getData(this),
432
- onConflict: sql.join([
433
- target && sql`(${Array.isArray(target) ? sql.join(target, sql`, `) : target})`,
434
- targetWhere && sql`where ${targetWhere}`,
435
- update ? sql.join([
436
- sql`do update set ${update}`,
437
- setWhere && sql`where ${setWhere}`
438
- ]) : sql`do nothing`
439
- ])
440
- });
441
- }
442
- };
443
- var defaultKeyword = sql.universal({
444
- sqlite: sql`null`,
445
- default: sql`default`
446
- });
447
- var InsertInto = class {
448
- [internalData];
449
- constructor(data) {
450
- this[internalData] = data;
451
- }
452
- values(insert) {
453
- const { into } = getData(this);
454
- const rows = Array.isArray(insert) ? insert : [insert];
455
- const table2 = getTable(into);
456
- const values = sql.join(
457
- rows.map((row) => {
458
- return sql`(${sql.join(
459
- Object.entries(table2.columns).map(([key, column2]) => {
460
- const value = row[key];
461
- const { $default, mapToDriverValue } = getData(column2);
462
- if (value !== void 0) {
463
- if (value && typeof value === "object" && hasSql(value))
464
- return value;
465
- return input(mapToDriverValue?.(value) ?? value);
466
- }
467
- if ($default) return $default();
468
- return defaultKeyword;
469
- }),
470
- sql`, `
471
- )})`;
472
- }),
473
- sql`, `
474
- );
475
- return new InsertCanConflict({ ...getData(this), values });
476
- }
477
- select(query) {
478
- return new InsertCanConflict({
479
- ...getData(this),
480
- select: getQuery(query)
481
- });
482
- }
483
- };
484
-
485
- // node_modules/rado/dist/core/query/Union.js
486
- var UnionBase = class extends Query {
487
- [internalData];
488
- #makeSelf() {
489
- const { select } = getData(this);
490
- return select.makeVirtual(Sql.SELF_TARGET);
491
- }
492
- union(right) {
493
- return new Union({
494
- ...getData(this),
495
- left: this,
496
- operator: sql`union`,
497
- right: typeof right === "function" ? right(this.#makeSelf()) : right
498
- });
499
- }
500
- unionAll(right) {
501
- return new Union({
502
- ...getData(this),
503
- left: this,
504
- operator: sql`union all`,
505
- right: typeof right === "function" ? right(this.#makeSelf()) : right
506
- });
507
- }
508
- intersect(right) {
509
- return new Union({
510
- ...getData(this),
511
- left: this,
512
- operator: sql`intersect`,
513
- right: typeof right === "function" ? right(this.#makeSelf()) : right
514
- });
515
- }
516
- intersectAll(right) {
517
- return new Union({
518
- ...getData(this),
519
- left: this,
520
- operator: sql`intersect all`,
521
- right: typeof right === "function" ? right(this.#makeSelf()) : right
522
- });
523
- }
524
- except(right) {
525
- return new Union({
526
- ...getData(this),
527
- left: this,
528
- operator: sql`except`,
529
- right: typeof right === "function" ? right(this.#makeSelf()) : right
530
- });
531
- }
532
- exceptAll(right) {
533
- return new Union({
534
- ...getData(this),
535
- left: this,
536
- operator: sql`except all`,
537
- right: typeof right === "function" ? right(this.#makeSelf()) : right
538
- });
539
- }
540
- };
541
- var Union = class extends UnionBase {
542
- [internalData];
543
- [internalSelection];
544
- constructor(data) {
545
- super(data);
546
- this[internalData] = data;
547
- this[internalSelection] = data.select;
548
- }
549
- get [internalQuery]() {
550
- return sql.chunk("emitUnion", getData(this));
551
- }
552
- };
553
-
554
- // node_modules/rado/dist/core/query/Select.js
555
- var Select = class _Select extends UnionBase {
556
- [internalData];
557
- constructor(data) {
558
- super(data);
559
- this[internalData] = data;
560
- }
561
- as(alias) {
562
- const fields = getSelection(this).makeVirtual(alias);
563
- return Object.assign(fields, {
564
- [internalTarget]: sql`(${getQuery(this)}) as ${sql.identifier(
565
- alias
566
- )}`.inlineFields(true)
567
- });
568
- }
569
- from(target) {
570
- const { select: current } = getData(this);
571
- const from = hasTarget(target) ? getTarget(target) : getSql(target);
572
- const isTable = hasTable(target);
573
- const selected = current ?? (isTable ? selection.table(target) : selection(sql`*`));
574
- return new _Select({
575
- ...getData(this),
576
- select: selected,
577
- from
578
- });
579
- }
580
- #join(operator, right, on) {
581
- const { from, select: current } = getData(this);
582
- return new _Select({
583
- ...getData(this),
584
- select: hasTable(right) ? current?.join(right, operator) : current,
585
- from: sql.join([
586
- from,
587
- sql.unsafe(`${operator} join`),
588
- getTarget(right),
589
- sql`on ${on}`
590
- ])
591
- });
592
- }
593
- leftJoin(right, on) {
594
- return this.#join("left", right, on);
595
- }
596
- rightJoin(right, on) {
597
- return this.#join("right", right, on);
598
- }
599
- innerJoin(right, on) {
600
- return this.#join("inner", right, on);
601
- }
602
- fullJoin(right, on) {
603
- return this.#join("full", right, on);
604
- }
605
- where(...where) {
606
- return new _Select({ ...getData(this), where: and(...where) });
607
- }
608
- groupBy(...exprs) {
609
- return new _Select({
610
- ...getData(this),
611
- groupBy: sql.join(exprs, sql.unsafe(", "))
612
- });
613
- }
614
- having(having) {
615
- return new _Select({
616
- ...getData(this),
617
- having: typeof having === "function" ? having(getSelection(this).input) : having
618
- });
619
- }
620
- orderBy(...exprs) {
621
- return new _Select({
622
- ...getData(this),
623
- orderBy: sql.join(exprs, sql.unsafe(", "))
624
- });
625
- }
626
- limit(limit) {
627
- return new _Select({ ...getData(this), limit: input(limit) });
628
- }
629
- offset(offset) {
630
- return new _Select({
631
- ...getData(this),
632
- offset: input(offset)
633
- });
634
- }
635
- get [internalSelection]() {
636
- const { select } = getData(this);
637
- if (!select) throw new Error("No selection defined");
638
- return select;
639
- }
640
- get [internalQuery]() {
641
- return sql.chunk("emitSelect", getData(this));
642
- }
643
- get [internalSql]() {
644
- return sql`(${getQuery(this)})`;
645
- }
646
- };
647
-
648
- // node_modules/rado/dist/core/query/Update.js
649
- var Update = class extends Query {
650
- [internalData];
651
- constructor(data) {
652
- super(data);
653
- this[internalData] = data;
654
- if (data.returning) this[internalSelection] = data.returning;
655
- }
656
- get [internalQuery]() {
657
- return sql.chunk("emitUpdate", this);
658
- }
659
- };
660
- var UpdateTable = class _UpdateTable extends Update {
661
- set(values) {
662
- const { table: table2 } = getData(this);
663
- const set = sql.join(
664
- Object.entries(values).map(([key, value]) => {
665
- const column2 = getTable(table2).columns[key];
666
- const { mapToDriverValue } = getData(column2);
667
- const expr = value && typeof value === "object" && hasSql(value) ? value : input(mapToDriverValue?.(value) ?? value);
668
- return sql`${sql.identifier(key)} = ${expr}`;
669
- }),
670
- sql`, `
671
- );
672
- return new _UpdateTable({ ...getData(this), set });
673
- }
674
- where(...where) {
675
- return new _UpdateTable({
676
- ...getData(this),
677
- where: and(...where)
678
- });
679
- }
680
- returning(returning) {
681
- const data = getData(this);
682
- return new Update({
683
- ...data,
684
- returning: returning ? selection(returning) : selection.table(data.table)
685
- });
686
- }
687
- };
688
-
689
- // node_modules/rado/dist/core/Builder.js
690
- var BuilderBase = class {
691
- [internalData];
692
- constructor(data = {}) {
693
- this[internalData] = data;
694
- }
695
- select(input2) {
696
- return new Select({
697
- ...getData(this),
698
- select: input2 && selection(input2)
699
- });
700
- }
701
- selectDistinct(input2) {
702
- return new Select({
703
- ...getData(this),
704
- select: input2 && selection(input2),
705
- distinct: true
706
- });
707
- }
708
- selectDistinctOn(columns, input2) {
709
- return new Select({
710
- ...getData(this),
711
- select: input2 && selection(input2),
712
- distinctOn: columns
713
- });
714
- }
715
- update(table2) {
716
- return new UpdateTable({ ...getData(this), table: table2 });
717
- }
718
- insert(into) {
719
- return new InsertInto({ ...getData(this), into });
720
- }
721
- delete(from) {
722
- return new DeleteFrom({ ...getData(this), from });
723
- }
724
- };
725
- var Builder = class extends BuilderBase {
726
- $with(cteName) {
727
- return {
728
- as(query) {
729
- const fields = getSelection(query).makeVirtual(cteName);
730
- return Object.assign(fields, {
731
- [internalQuery]: getQuery(query).nameSelf(cteName)
732
- });
733
- }
734
- };
735
- }
736
- with(...definitions) {
737
- return new BuilderBase({
738
- ...getData(this),
739
- cte: { recursive: false, definitions }
740
- });
741
- }
742
- withRecursive(...definitions) {
743
- return new BuilderBase({
744
- ...getData(this),
745
- cte: { recursive: true, definitions }
746
- });
747
- }
748
- };
749
-
750
- // node_modules/rado/dist/core/Resolver.js
751
- var Resolver = class {
752
- #driver;
753
- #dialect;
754
- constructor(driver, dialect) {
755
- this.#driver = driver;
756
- this.#dialect = dialect;
757
- }
758
- toSQL(query) {
759
- const emitter = this.#dialect.emit(query);
760
- return { sql: emitter.sql, params: emitter.bind() };
761
- }
762
- prepare(query, name) {
763
- const isSelection = hasSelection(query);
764
- const mapRow = isSelection ? getSelection(query).mapRow : void 0;
765
- const emitter = this.#dialect.emit(query);
766
- const stmt = this.#driver.prepare(emitter.sql, {
767
- isSelection,
768
- name
769
- });
770
- return new PreparedStatement(emitter, stmt, mapRow, this.#driver);
771
- }
772
- batch(queries) {
773
- return new Batch(
774
- this.#driver,
775
- queries.map((query) => {
776
- const isSelection = hasSelection(query);
777
- const mapRow = isSelection ? getSelection(query).mapRow : void 0;
778
- const emitter = this.#dialect.emit(query);
779
- return { sql: emitter.sql, params: emitter.bind(), isSelection, mapRow };
780
- })
781
- );
782
- }
783
- };
784
- var Batch = class {
785
- #driver;
786
- #queries;
787
- constructor(driver, queries) {
788
- this.#driver = driver;
789
- this.#queries = queries;
790
- }
791
- #transform = (results) => {
792
- const ctx = {
793
- values: void 0,
794
- index: 0,
795
- specs: this.#driver
796
- };
797
- for (let i = 0; i < this.#queries.length; i++) {
798
- const { mapRow } = this.#queries[i];
799
- if (!mapRow) continue;
800
- const rows = results[i];
801
- for (let j = 0; j < results[i].length; j++) {
802
- ctx.values = rows[i];
803
- ctx.index = 0;
804
- rows[i] = mapRow(ctx);
805
- }
806
- }
807
- return results;
808
- };
809
- execute() {
810
- const results = this.#driver.batch(this.#queries);
811
- if (results instanceof Promise) return results.then(this.#transform);
812
- return this.#transform(results);
813
- }
814
- };
815
- var PreparedStatement = class {
816
- #emitter;
817
- #stmt;
818
- #mapRow;
819
- #specs;
820
- constructor(emitter, stmt, mapRow, specs) {
821
- this.#emitter = emitter;
822
- this.#stmt = stmt;
823
- this.#mapRow = mapRow;
824
- this.#specs = specs;
825
- }
826
- #transform = (rows) => {
827
- if (!this.#mapRow) return rows;
828
- const ctx = {
829
- values: void 0,
830
- index: 0,
831
- specs: this.#specs
832
- };
833
- for (let i = 0; i < rows.length; i++) {
834
- ctx.values = rows[i];
835
- ctx.index = 0;
836
- rows[i] = this.#mapRow(ctx);
837
- }
838
- return rows;
839
- };
840
- all(inputs) {
841
- const rows = this.#stmt.values(this.#emitter.bind(inputs));
842
- if (rows instanceof Promise) return rows.then(this.#transform);
843
- return this.#transform(rows);
844
- }
845
- get(inputs) {
846
- const rows = this.all(inputs);
847
- if (rows instanceof Promise) return rows.then((rows2) => rows2[0]);
848
- return rows[0];
849
- }
850
- run(inputs) {
851
- return this.#stmt.run(this.#emitter.bind(inputs));
852
- }
853
- async execute(inputs) {
854
- return this.all(inputs);
855
- }
856
- free() {
857
- this.#stmt.free();
858
- }
859
- };
860
-
861
- // node_modules/rado/dist/core/Database.js
862
- var Database = class extends Builder {
863
- driver;
864
- dialect;
865
- diff;
866
- [internalResolver];
867
- constructor(driver, dialect, diff) {
868
- const resolver = new Resolver(driver, dialect);
869
- super({ resolver });
870
- this[internalResolver] = resolver;
871
- this.driver = driver;
872
- this.dialect = dialect;
873
- this.diff = diff;
874
- }
875
- close() {
876
- return this.driver.close();
877
- }
878
- [Symbol.dispose]() {
879
- this.close();
880
- }
881
- async [Symbol.asyncDispose]() {
882
- return this.close();
883
- }
884
- create(...tables) {
885
- return new QueryBatch(
886
- getResolver(this),
887
- tables.flatMap((table2) => getTable(table2).create())
888
- );
889
- }
890
- drop(...tables) {
891
- return new QueryBatch(
892
- getResolver(this),
893
- tables.map((table2) => getTable(table2).drop())
894
- );
895
- }
896
- migrate(...tables) {
897
- const computeDiff = this.diff;
898
- return this.transaction(
899
- txGenerator(function* (tx) {
900
- for (const table2 of tables) {
901
- const diff = yield* computeDiff(table2);
902
- if (diff.length > 0) yield* tx.batch(diff.map(sql.unsafe));
903
- }
904
- })
905
- );
906
- }
907
- batch(queries) {
908
- return new QueryBatch(getResolver(this), queries);
909
- }
910
- execute(input2) {
911
- const emitter = this.dialect.emit(input2);
912
- if (emitter.hasParams) throw new Error("Query has parameters");
913
- return this.driver.exec(emitter.sql);
914
- }
915
- transaction(run, options = {}) {
916
- return this.driver.transaction(
917
- (inner) => {
918
- const tx = new Transaction(inner, this.dialect, this.diff);
919
- return run(tx);
920
- },
921
- { async: run.constructor.name === "AsyncFunction", ...options }
922
- );
923
- }
924
- };
925
- var Rollback = class extends Error {
926
- constructor(data) {
927
- super("Rollback");
928
- this.data = data;
929
- }
930
- };
931
- var Transaction = class extends Database {
932
- rollback(data) {
933
- throw new Rollback(data);
934
- }
935
- };
936
- var SyncDatabase = class extends Database {
937
- };
938
- var AsyncDatabase = class extends Database {
939
- };
940
-
941
- // node_modules/rado/dist/sqlite/columns.js
942
- function boolean(name) {
943
- return column({
944
- name,
945
- type: column.integer(),
946
- mapFromDriverValue(value) {
947
- return value === 1;
948
- },
949
- mapToDriverValue(value) {
950
- return value ? 1 : 0;
951
- }
952
- });
953
- }
954
- function integer(name) {
955
- return column({ name, type: column.integer() });
956
- }
957
- function text(name) {
958
- return column({ name, type: column.text() });
959
- }
960
-
961
- // node_modules/rado/dist/core/Dialect.js
962
- var Dialect = class {
963
- runtime;
964
- #createEmitter;
965
- constructor(runtime, createEmitter) {
966
- this.runtime = runtime;
967
- this.#createEmitter = createEmitter;
968
- }
969
- emit = (input2) => {
970
- const sql2 = hasQuery(input2) ? getQuery(input2) : getSql(input2);
971
- const emitter = new this.#createEmitter(this.runtime);
972
- sql2.emitTo(emitter);
973
- return emitter;
974
- };
975
- inline = (input2) => {
976
- const sql2 = hasQuery(input2) ? getQuery(input2) : getSql(input2);
977
- const emitter = new this.#createEmitter(this.runtime);
978
- sql2.inlineValues().emitTo(emitter);
979
- return emitter.sql;
980
- };
981
- };
982
-
983
- // node_modules/rado/dist/core/Param.js
984
- var NamedParam = class {
985
- constructor(name) {
986
- this.name = name;
987
- }
988
- };
989
- var ValueParam = class {
990
- constructor(value) {
991
- this.value = value;
992
- }
993
- };
994
-
995
- // node_modules/rado/dist/core/Emitter.js
996
- var Emitter = class {
997
- #runtime;
998
- sql = "";
999
- params = [];
1000
- constructor(runtime) {
1001
- this.#runtime = runtime;
1002
- }
1003
- get hasParams() {
1004
- return this.params.length > 0;
1005
- }
1006
- bind(inputs) {
1007
- return this.params.map((param) => {
1008
- if (param instanceof ValueParam) return this.processValue(param.value);
1009
- if (inputs && param.name in inputs)
1010
- return this.processValue(inputs[param.name]);
1011
- throw new Error(`Missing input for named parameter: ${param.name}`);
1012
- });
1013
- }
1014
- processValue(value) {
1015
- return value;
1016
- }
1017
- emitIdentifierOrSelf(value) {
1018
- if (value === Sql.SELF_TARGET) {
1019
- if (!this.selfName) throw new Error("Self target not defined");
1020
- this.emitIdentifier(this.selfName);
1021
- } else {
1022
- this.emitIdentifier(value);
1023
- }
1024
- }
1025
- selfName;
1026
- emitSelf({ name, inner }) {
1027
- this.selfName = name;
1028
- inner.emitTo(this);
1029
- this.selfName = void 0;
1030
- }
1031
- emitUnsafe(value) {
1032
- this.sql += value;
1033
- }
1034
- emitField({ targetName, fieldName }) {
1035
- this.emitIdentifierOrSelf(targetName);
1036
- this.emitUnsafe(".");
1037
- this.emitIdentifier(fieldName);
1038
- }
1039
- emitCreateTable(tableApi) {
1040
- sql.join([
1041
- sql`create table`,
1042
- //ifNotExists ? sql`if not exists` : undefined,
1043
- tableApi.target(),
1044
- sql`(${tableApi.createDefinition()})`
1045
- ]).emitTo(this);
1046
- }
1047
- emitColumn(column2) {
1048
- sql.join([
1049
- column2.type,
1050
- column2.primary && sql`primary key`,
1051
- column2.notNull && sql`not null`,
1052
- column2.isUnique && sql`unique`,
1053
- column2.autoIncrement && sql`autoincrement`,
1054
- column2.defaultValue && sql`default ${column2.defaultValue}`,
1055
- column2.references && sql`references ${sql.chunk("emitReferences", [column2.references()])}`,
1056
- column2.onUpdate && sql`on update ${column2.onUpdate}`
1057
- ]).emitTo(this);
1058
- }
1059
- emitReferences(fields) {
1060
- callFunction(
1061
- sql.identifier(fields[0].targetName),
1062
- fields.map((field) => sql.identifier(field.fieldName))
1063
- ).emitTo(this);
1064
- }
1065
- emitDelete(deleteOp) {
1066
- const { cte, from, where, returning } = getData(deleteOp);
1067
- if (cte) this.emitWith(cte);
1068
- const table2 = getTable(from);
1069
- sql.query({
1070
- deleteFrom: sql.identifier(table2.name),
1071
- where,
1072
- returning
1073
- }).emitTo(this);
1074
- }
1075
- emitInsert(insert) {
1076
- const {
1077
- cte,
1078
- into,
1079
- values,
1080
- select,
1081
- onConflict,
1082
- onDuplicateKeyUpdate,
1083
- returning
1084
- } = getData(insert);
1085
- if (cte) this.emitWith(cte);
1086
- const table2 = getTable(into);
1087
- const tableName = sql.identifier(table2.name);
1088
- sql.query({
1089
- insertInto: sql`${tableName}(${table2.listColumns()})`,
1090
- ...values ? { values } : { "": select },
1091
- onConflict,
1092
- onDuplicateKeyUpdate,
1093
- returning
1094
- }).inlineFields(false).emitTo(this);
1095
- }
1096
- emitSelect({
1097
- select,
1098
- cte,
1099
- from,
1100
- distinct,
1101
- distinctOn,
1102
- where,
1103
- groupBy,
1104
- orderBy,
1105
- having,
1106
- limit,
1107
- offset
1108
- }) {
1109
- if (cte) this.emitWith(cte);
1110
- const prefix = distinctOn ? sql`distinct on (${sql.join(distinctOn, sql`, `)})` : distinct && sql`distinct`;
1111
- sql.query({
1112
- select: sql.join([prefix, select]),
1113
- from,
1114
- where,
1115
- groupBy,
1116
- orderBy,
1117
- having,
1118
- limit,
1119
- offset
1120
- }).emitTo(this);
1121
- }
1122
- emitUnion({ left, operator, right }) {
1123
- sql.join([getQuery(left), operator, getQuery(right)]).emitTo(this);
1124
- }
1125
- emitUpdate(update) {
1126
- const { cte, table: table2, set, where, returning } = getData(update);
1127
- const tableApi = getTable(table2);
1128
- if (cte) this.emitWith(cte);
1129
- sql.query({
1130
- update: sql.identifier(tableApi.name),
1131
- set,
1132
- where,
1133
- returning
1134
- }).inlineFields(false).emitTo(this);
1135
- }
1136
- emitWith(cte) {
1137
- sql.query({
1138
- [cte.recursive ? "withRecursive" : "with"]: sql.join(
1139
- cte.definitions.map((cte2) => {
1140
- const query = getQuery(cte2);
1141
- const target = getTarget(cte2);
1142
- return sql`${target} as (${query})`;
1143
- }),
1144
- sql`, `
1145
- )
1146
- }).add(sql` `).emitTo(this);
1147
- }
1148
- emitInclude(data) {
1149
- const wrapQuery = Boolean(data.limit || data.offset || data.orderBy);
1150
- const innerQuery = sql.chunk("emitSelect", data);
1151
- const inner = wrapQuery ? sql`select * from (${innerQuery})` : innerQuery;
1152
- if (!data.select) throw new Error("No selection defined");
1153
- const fields = data.select.fieldNames();
1154
- const subject = jsonArray(
1155
- ...fields.map((name) => sql`_.${sql.identifier(name)}`)
1156
- );
1157
- sql`(select ${data.first ? subject : jsonAggregateArray(subject)} from (${inner}) as _)`.emitTo(this);
1158
- }
1159
- emitUniversal(runtimes) {
1160
- const sql2 = runtimes[this.#runtime] ?? runtimes.default;
1161
- if (!sql2) throw new Error("Unsupported runtime");
1162
- sql2.emitTo(this);
1163
- }
1164
- };
1165
-
1166
- // node_modules/rado/dist/sqlite/dialect.js
1167
- var DOUBLE_QUOTE = '"';
1168
- var ESCAPE_DOUBLE_QUOTE = '""';
1169
- var MATCH_DOUBLE_QUOTE = /"/g;
1170
- var SINGLE_QUOTE = "'";
1171
- var ESCAPE_SINGLE_QUOTE = "''";
1172
- var MATCH_SINGLE_QUOTE = /'/g;
1173
- var sqliteDialect = new Dialect(
1174
- "sqlite",
1175
- class extends Emitter {
1176
- processValue(value) {
1177
- return typeof value === "boolean" ? value ? 1 : 0 : value;
1178
- }
1179
- emitValue(value) {
1180
- this.sql += "?";
1181
- this.params.push(new ValueParam(value));
1182
- }
1183
- emitJsonPath({ target, asSql, segments }) {
1184
- target.emitTo(this);
1185
- this.sql += asSql ? "->>" : "->";
1186
- this.sql += this.quoteString(
1187
- `$${segments.map((p) => typeof p === "number" ? `[${p}]` : `.${p}`).join("")}`
1188
- );
1189
- }
1190
- emitInline(value) {
1191
- if (value === null || value === void 0) return this.sql += "null";
1192
- if (typeof value === "number") return this.sql += value;
1193
- if (typeof value === "string")
1194
- return this.sql += this.quoteString(value);
1195
- if (typeof value === "boolean") return this.sql += value ? "1" : "0";
1196
- this.sql += `json(${this.quoteString(JSON.stringify(value))})`;
1197
- }
1198
- emitPlaceholder(name) {
1199
- this.sql += "?";
1200
- this.params.push(new NamedParam(name));
1201
- }
1202
- emitIdentifier(identifier) {
1203
- this.sql += DOUBLE_QUOTE + identifier.replace(MATCH_DOUBLE_QUOTE, ESCAPE_DOUBLE_QUOTE) + DOUBLE_QUOTE;
1204
- }
1205
- quoteString(input2) {
1206
- return SINGLE_QUOTE + input2.replace(MATCH_SINGLE_QUOTE, ESCAPE_SINGLE_QUOTE) + SINGLE_QUOTE;
1207
- }
1208
- }
1209
- );
1210
-
1211
- // node_modules/rado/dist/sqlite/diff.js
1212
- var TableInfo = table("TableInfo", {
1213
- cid: integer().notNull(),
1214
- name: text().notNull(),
1215
- type: text().notNull(),
1216
- notnull: boolean().notNull(),
1217
- dflt_value: text(),
1218
- pk: integer().notNull()
1219
- });
1220
- var SqliteMaster = table("SqliteMaster", {
1221
- type: text().notNull(),
1222
- name: text().notNull(),
1223
- tbl_name: text().notNull(),
1224
- rootpage: integer().notNull(),
1225
- sql: text().notNull()
1226
- });
1227
- var inline = (sql2) => sqliteDialect.inline(sql2);
1228
- var sqliteDiff = (targetTable) => {
1229
- return txGenerator(function* (tx) {
1230
- const tableApi = getTable(targetTable);
1231
- const columnInfo = yield* tx.select(TableInfo).from(sql`pragma_table_info(${sql.inline(tableApi.name)}) as "TableInfo"`);
1232
- const indexInfo = yield* tx.select(SqliteMaster).from(sql`sqlite_master as "SqliteMaster"`).where(
1233
- eq(SqliteMaster.tbl_name, tableApi.name),
1234
- eq(SqliteMaster.type, "index")
1235
- );
1236
- const hasSinglePrimaryKey = columnInfo.reduce((acc, column2) => acc + column2.pk, 0) === 1;
1237
- const localColumns = new Map(
1238
- columnInfo.map((column2) => {
1239
- return [
1240
- column2.name,
1241
- inline(
1242
- sql.chunk("emitColumn", {
1243
- type: sql.unsafe(column2.type.toLowerCase()),
1244
- notNull: column2.notnull,
1245
- primary: hasSinglePrimaryKey && column2.pk === 1,
1246
- defaultValue: column2.dflt_value !== null ? sql.unsafe(column2.dflt_value) : void 0
1247
- })
1248
- )
1249
- ];
1250
- })
1251
- );
1252
- const schemaColumns = new Map(
1253
- Object.entries(tableApi.columns).map(([name, column2]) => {
1254
- const columnApi = getData(column2);
1255
- return [
1256
- columnApi.name ?? name,
1257
- inline(sql.chunk("emitColumn", columnApi))
1258
- ];
1259
- })
1260
- );
1261
- const localIndexes = new Map(
1262
- indexInfo.filter((index) => !index.name.startsWith("sqlite_autoindex_")).map((index) => [index.name, index.sql])
1263
- );
1264
- const schemaIndexes = new Map(
1265
- Object.entries(tableApi.indexes()).map(([name, index]) => {
1266
- const indexApi = getData(index);
1267
- return [name, inline(indexApi.toSql(tableApi.name, name, false))];
1268
- })
1269
- );
1270
- const stmts = [];
1271
- const columnNames = /* @__PURE__ */ new Set([
1272
- ...localColumns.keys(),
1273
- ...schemaColumns.keys()
1274
- ]);
1275
- for (const columnName of columnNames) {
1276
- const localInstruction = localColumns.get(columnName);
1277
- const schemaInstruction = schemaColumns.get(columnName);
1278
- if (!schemaInstruction) {
1279
- stmts.push(
1280
- sql.query({
1281
- alterTable: sql.identifier(tableApi.name),
1282
- dropColumn: sql.identifier(columnName)
1283
- })
1284
- );
1285
- } else if (!localInstruction) {
1286
- stmts.push(
1287
- sql.query({
1288
- alterTable: sql.identifier(tableApi.name),
1289
- addColumn: [
1290
- sql.identifier(columnName),
1291
- sql.unsafe(schemaInstruction)
1292
- ]
1293
- })
1294
- );
1295
- } else if (localInstruction !== schemaInstruction) {
1296
- return recreate();
1297
- }
1298
- }
1299
- const indexNames = /* @__PURE__ */ new Set([
1300
- ...localIndexes.keys(),
1301
- ...schemaIndexes.keys()
1302
- ]);
1303
- for (const indexName of indexNames) {
1304
- const localInstruction = localIndexes.get(indexName);
1305
- const schemaInstruction = schemaIndexes.get(indexName);
1306
- const dropLocal = sql.query({
1307
- dropIndex: sql.identifier(indexName)
1308
- });
1309
- if (!schemaInstruction) {
1310
- stmts.unshift(dropLocal);
1311
- } else if (schemaInstruction && !localInstruction) {
1312
- stmts.push(sql.unsafe(schemaInstruction));
1313
- } else if (schemaInstruction && localInstruction !== schemaInstruction) {
1314
- stmts.unshift(dropLocal);
1315
- stmts.push(sql.unsafe(schemaInstruction));
1316
- }
1317
- }
1318
- try {
1319
- yield* txGenerator(function* (sp) {
1320
- yield* sp.batch(stmts);
1321
- const [tableInfo] = yield* sp.select(SqliteMaster.sql).from(sql`sqlite_master as "SqliteMaster"`).where(
1322
- eq(SqliteMaster.tbl_name, tableApi.name),
1323
- eq(SqliteMaster.type, "table")
1324
- );
1325
- sp.rollback(tableInfo);
1326
- });
1327
- } catch (err) {
1328
- if (!(err instanceof Rollback)) throw err;
1329
- const localInstruction = err.data;
1330
- const schemaInstruction = inline(tableApi.createTable());
1331
- const stripStmt = (q) => q.slice("create table ".length);
1332
- if (stripStmt(localInstruction) !== stripStmt(schemaInstruction)) {
1333
- return recreate();
1334
- }
1335
- }
1336
- return stmts.map(inline);
1337
- function recreate() {
1338
- const tempName = `new_${tableApi.name}`;
1339
- const tempTable = table(tempName, tableApi.columns);
1340
- const missingColumns = new Set(
1341
- Array.from(columnNames).filter((name) => !localColumns.has(name))
1342
- );
1343
- const selection2 = Object.fromEntries(
1344
- Object.entries(tableApi.columns).map(([name, column2]) => {
1345
- const columnApi = getData(column2);
1346
- const key = columnApi.name ?? name;
1347
- if (missingColumns.has(key))
1348
- return [name, columnApi.defaultValue ?? sql`null`];
1349
- return [name, targetTable[name]];
1350
- })
1351
- );
1352
- return [
1353
- // Create a new temporary table with the new definition
1354
- tableApi.createTable(tempName),
1355
- // Copy the data from the old table to the new table
1356
- getQuery(
1357
- tx.insert(tempTable).select(tx.select(selection2).from(targetTable))
1358
- ),
1359
- // Drop the old table
1360
- sql.query({ dropTable: sql.identifier(tableApi.name) }),
1361
- // Rename the temporary table to the old table name
1362
- sql.query({
1363
- alterTable: sql.identifier(tempName),
1364
- renameTo: sql.identifier(tableApi.name)
1365
- }),
1366
- // Create missing indexes
1367
- ...tableApi.createIndexes()
1368
- ].map(inline);
1369
- }
1370
- });
1371
- };
1372
-
1373
- // node_modules/rado/dist/sqlite/transactions.js
1374
- var locks = /* @__PURE__ */ new WeakMap();
1375
- function execTransaction(driver, depth, wrap, run, options) {
1376
- const needsLock = options.async;
1377
- const behavior = options.behavior ?? "deferred";
1378
- if (!needsLock) return transact();
1379
- let trigger;
1380
- const lock = new Promise((resolve) => trigger = resolve);
1381
- const current = Promise.resolve(locks.get(driver));
1382
- locks.set(driver, lock);
1383
- return current.then(transact).finally(trigger);
1384
- function transact() {
1385
- try {
1386
- driver.exec(depth > 0 ? `savepoint d${depth}` : `begin ${behavior}`);
1387
- const result = run(wrap(depth + 1));
1388
- if (result instanceof Promise) return result.then(release, rollback);
1389
- return release(result);
1390
- } catch (error) {
1391
- return rollback(error);
1392
- }
1393
- }
1394
- function release(result) {
1395
- driver.exec(depth > 0 ? `release d${depth}` : "commit");
1396
- return result;
1397
- }
1398
- function rollback(error) {
1399
- driver.exec(depth > 0 ? `rollback to d${depth}` : "rollback");
1400
- throw error;
1401
- }
1402
- }
1403
-
1404
- // node_modules/rado/dist/driver/better-sqlite3.js
1405
- var PreparedStatement2 = class {
1406
- constructor(stmt, isSelection) {
1407
- this.stmt = stmt;
1408
- this.isSelection = isSelection;
1409
- }
1410
- all(params) {
1411
- return this.stmt.all(...params);
1412
- }
1413
- run(params) {
1414
- return this.stmt.run(...params);
1415
- }
1416
- get(params) {
1417
- return this.stmt.get(...params);
1418
- }
1419
- values(params) {
1420
- if (this.isSelection)
1421
- return this.stmt.raw(true).all(...params);
1422
- this.stmt.run(...params);
1423
- return [];
1424
- }
1425
- free() {
1426
- }
1427
- };
1428
- var BetterSqlite3Driver = class _BetterSqlite3Driver {
1429
- constructor(client, depth = 0) {
1430
- this.client = client;
1431
- this.depth = depth;
1432
- }
1433
- parsesJson = false;
1434
- supportsTransactions = true;
1435
- exec(query) {
1436
- this.client.exec(query);
1437
- }
1438
- close() {
1439
- this.client.close();
1440
- }
1441
- prepare(sql2, options) {
1442
- return new PreparedStatement2(this.client.prepare(sql2), options.isSelection);
1443
- }
1444
- batch(queries) {
1445
- return this.transaction(
1446
- (tx) => queries.map(
1447
- ({ sql: sql2, params, isSelection }) => tx.prepare(sql2, { isSelection }).values(params)
1448
- ),
1449
- {}
1450
- );
1451
- }
1452
- transaction(run, options) {
1453
- return execTransaction(
1454
- this,
1455
- this.depth,
1456
- (depth) => new _BetterSqlite3Driver(this.client, depth),
1457
- run,
1458
- options
1459
- );
1460
- }
1461
- };
1462
- function connect(db) {
1463
- return new SyncDatabase(
1464
- new BetterSqlite3Driver(db),
1465
- sqliteDialect,
1466
- sqliteDiff
1467
- );
1468
- }
1469
-
1470
- // node_modules/rado/dist/driver/bun-sqlite.js
1471
- var PreparedStatement3 = class {
1472
- constructor(stmt) {
1473
- this.stmt = stmt;
1474
- }
1475
- all(params) {
1476
- return this.stmt.all(...params);
1477
- }
1478
- run(params) {
1479
- return this.stmt.run(...params);
1480
- }
1481
- get(params) {
1482
- return this.stmt.get(...params);
1483
- }
1484
- values(params) {
1485
- return this.stmt.values(...params);
1486
- }
1487
- free() {
1488
- this.stmt.finalize();
1489
- }
1490
- };
1491
- var BunSqliteDriver = class _BunSqliteDriver {
1492
- constructor(client, depth = 0) {
1493
- this.client = client;
1494
- this.depth = depth;
1495
- }
1496
- parsesJson = false;
1497
- supportsTransactions = true;
1498
- exec(query) {
1499
- this.client.exec(query);
1500
- }
1501
- close() {
1502
- this.client.close();
1503
- }
1504
- prepare(sql2) {
1505
- return new PreparedStatement3(this.client.prepare(sql2));
1506
- }
1507
- batch(queries) {
1508
- return this.transaction((tx) => {
1509
- return queries.map(({ sql: sql2, params }) => tx.prepare(sql2).values(params));
1510
- }, {});
1511
- }
1512
- transaction(run, options) {
1513
- return execTransaction(
1514
- this,
1515
- this.depth,
1516
- (depth) => new _BunSqliteDriver(this.client, depth),
1517
- run,
1518
- options
1519
- );
1520
- }
1521
- };
1522
- function connect2(db) {
1523
- return new SyncDatabase(new BunSqliteDriver(db), sqliteDialect, sqliteDiff);
1524
- }
1525
-
1526
- // node_modules/rado/dist/driver/d1.js
1527
- var PreparedStatement4 = class {
1528
- constructor(stmt, isSelection) {
1529
- this.stmt = stmt;
1530
- this.isSelection = isSelection;
1531
- }
1532
- async all(params) {
1533
- return this.stmt.bind(...params).all().then(({ results }) => results);
1534
- }
1535
- async run(params) {
1536
- const results = await this.stmt.bind(...params).run();
1537
- }
1538
- async get(params) {
1539
- return this.stmt.bind(...params).first();
1540
- }
1541
- async values(params) {
1542
- if (this.isSelection) return this.stmt.bind(...params).raw();
1543
- await this.stmt.bind(...params).run();
1544
- return [];
1545
- }
1546
- free() {
1547
- }
1548
- };
1549
- var D1Driver = class {
1550
- constructor(client) {
1551
- this.client = client;
1552
- }
1553
- parsesJson = false;
1554
- supportsTransactions = false;
1555
- async exec(query) {
1556
- await this.client.exec(query);
1557
- }
1558
- prepare(sql2, options) {
1559
- return new PreparedStatement4(this.client.prepare(sql2), options.isSelection);
1560
- }
1561
- async close() {
1562
- }
1563
- async batch(queries) {
1564
- const stmts = queries.map(
1565
- ({ sql: sql2, params }) => this.client.prepare(sql2).bind(...params)
1566
- );
1567
- const rows = await this.client.batch(stmts);
1568
- return rows.map((row) => row.results);
1569
- }
1570
- async transaction() {
1571
- throw new Error("Transactions are not supported in D1");
1572
- }
1573
- };
1574
- function connect3(client) {
1575
- return new AsyncDatabase(new D1Driver(client), sqliteDialect, sqliteDiff);
1576
- }
1577
-
1578
- // node_modules/rado/dist/driver/libsql.js
1579
- var PreparedStatement5 = class {
1580
- constructor(client, sql2) {
1581
- this.client = client;
1582
- this.sql = sql2;
1583
- }
1584
- async all(params) {
1585
- const result = await this.client.execute({ sql: this.sql, args: params });
1586
- return result.rows;
1587
- }
1588
- async run(params) {
1589
- const result = await this.client.execute({ sql: this.sql, args: params });
1590
- }
1591
- async get(params) {
1592
- return (await this.all(params))[0] ?? null;
1593
- }
1594
- async values(params) {
1595
- const result = await this.client.execute({ sql: this.sql, args: params });
1596
- return result.rows;
1597
- }
1598
- free() {
1599
- }
1600
- };
1601
- var LibSQLClient = class _LibSQLClient {
1602
- constructor(client, depth = 0) {
1603
- this.client = client;
1604
- this.depth = depth;
1605
- }
1606
- parsesJson = false;
1607
- supportsTransactions = true;
1608
- async exec(query) {
1609
- await this.client.execute(query);
1610
- }
1611
- prepare(sql2, options) {
1612
- return new PreparedStatement5(this.client, sql2);
1613
- }
1614
- async close() {
1615
- if ("close" in this.client) return this.client.close();
1616
- }
1617
- async batch(queries) {
1618
- const stmts = queries.map(({ sql: sql2, params }) => {
1619
- return { sql: sql2, args: params };
1620
- });
1621
- const rows = await this.client.batch(stmts);
1622
- return rows.map((row) => row.rows);
1623
- }
1624
- async transaction(run, options) {
1625
- const client = "transaction" in this.client ? await this.client.transaction() : this.client;
1626
- const driver = new _LibSQLClient(client, this.depth + 1);
1627
- if (this.depth > 0) await client.execute(`savepoint d${this.depth}`);
1628
- try {
1629
- const result = await run(driver);
1630
- if (this.depth > 0)
1631
- await client.execute(`release savepoint d${this.depth}`);
1632
- else await client.commit();
1633
- return result;
1634
- } catch (error) {
1635
- if (this.depth > 0)
1636
- await client.execute(`rollback to savepoint d${this.depth}`);
1637
- else await client.rollback();
1638
- throw error;
1639
- } finally {
1640
- if (this.depth === 0) client.close();
1641
- }
1642
- }
1643
- };
1644
- function connect4(client) {
1645
- return new AsyncDatabase(new LibSQLClient(client), sqliteDialect, sqliteDiff);
1646
- }
1647
-
1648
- // node_modules/rado/dist/mysql/dialect.js
1649
- var BACKTICK = "`";
1650
- var ESCAPE_BACKTICK = "``";
1651
- var MATCH_BACKTICK = /`/g;
1652
- var SINGLE_QUOTE2 = "'";
1653
- var ESCAPE_SINGLE_QUOTE2 = "''";
1654
- var MATCH_SINGLE_QUOTE2 = /'/g;
1655
- var mysqlDialect = new Dialect(
1656
- "mysql",
1657
- class extends Emitter {
1658
- runtime = "mysql";
1659
- paramIndex = 0;
1660
- emitValue(value) {
1661
- this.sql += "?";
1662
- this.params.push(new ValueParam(value));
1663
- }
1664
- emitJsonPath({ target, asSql, segments }) {
1665
- target.emitTo(this);
1666
- this.sql += asSql ? "->>" : "->";
1667
- this.sql += this.quoteString(
1668
- `$${segments.map((p) => typeof p === "number" ? `[${p}]` : `.${p}`).join("")}`
1669
- );
1670
- }
1671
- emitInline(value) {
1672
- if (value === null || value === void 0) return this.sql += "null";
1673
- if (typeof value === "number" || typeof value === "boolean")
1674
- return this.sql += value;
1675
- if (typeof value === "string")
1676
- return this.sql += this.quoteString(value);
1677
- this.sql += this.quoteString(JSON.stringify(value));
1678
- }
1679
- emitPlaceholder(name) {
1680
- this.sql += "?";
1681
- this.params.push(new NamedParam(name));
1682
- }
1683
- quoteString(input2) {
1684
- return SINGLE_QUOTE2 + input2.replace(MATCH_SINGLE_QUOTE2, ESCAPE_SINGLE_QUOTE2) + SINGLE_QUOTE2;
1685
- }
1686
- emitIdentifier(identifier) {
1687
- this.sql += BACKTICK + identifier.replace(MATCH_BACKTICK, ESCAPE_BACKTICK) + BACKTICK;
1688
- }
1689
- }
1690
- );
1691
-
1692
- // node_modules/rado/dist/core/Schema.js
1693
- function schema(schemaName) {
1694
- return {
1695
- table(tableName, columns, config) {
1696
- return table(tableName, columns, config, schemaName);
1697
- }
1698
- };
1699
- }
1700
-
1701
- // node_modules/rado/dist/mysql/columns.js
1702
- function integer2(name) {
1703
- return column({ name, type: column.integer() });
1704
- }
1705
- function text2(name) {
1706
- return column({ name, type: column.text() });
1707
- }
1708
-
1709
- // node_modules/rado/dist/mysql/diff.js
1710
- var ns = schema("information_schema");
1711
- var Information = ns.table("columns", {
1712
- table_name: text2().notNull(),
1713
- column_name: text2().notNull(),
1714
- column_type: text2().notNull(),
1715
- is_nullable: text2().notNull(),
1716
- column_default: text2(),
1717
- extra: text2().notNull(),
1718
- table_schema: text2().notNull()
1719
- });
1720
- var Statistics = ns.table("statistics", {
1721
- table_name: text2().notNull(),
1722
- column_name: text2().notNull(),
1723
- index_name: text2().notNull(),
1724
- non_unique: integer2().notNull(),
1725
- seq_in_index: integer2().notNull(),
1726
- table_schema: text2().notNull()
1727
- });
1728
- var TableConstraints = ns.table("table_constraints", {
1729
- constraint_name: text2().notNull(),
1730
- table_name: text2().notNull(),
1731
- constraint_type: text2().notNull(),
1732
- table_schema: text2().notNull()
1733
- });
1734
- var inline2 = (sql2) => mysqlDialect.inline(sql2);
1735
- var mysqlDiff = (hasTable2) => {
1736
- return txGenerator(function* (tx) {
1737
- const tableApi = getTable(hasTable2);
1738
- const stmts = [];
1739
- const columnInfo = yield* tx.select({
1740
- name: Information.column_name,
1741
- type: Information.column_type,
1742
- notNull: eq(Information.is_nullable, "NO"),
1743
- defaultValue: Information.column_default,
1744
- extra: Information.extra
1745
- }).from(Information).where(
1746
- eq(Information.table_name, tableApi.name),
1747
- eq(Information.table_schema, sql`database()`)
1748
- );
1749
- const indexInfo = yield* tx.select({
1750
- index_name: Statistics.index_name,
1751
- column_name: Statistics.column_name,
1752
- non_unique: Statistics.non_unique,
1753
- seq_in_index: Statistics.seq_in_index
1754
- }).from(Statistics).where(
1755
- eq(Statistics.table_name, tableApi.name),
1756
- eq(Statistics.table_schema, sql`database()`)
1757
- ).orderBy(Statistics.index_name, Statistics.seq_in_index);
1758
- const indexMap = /* @__PURE__ */ new Map();
1759
- for (const index of indexInfo) {
1760
- if (!indexMap.has(index.index_name)) {
1761
- indexMap.set(index.index_name, []);
1762
- }
1763
- indexMap.get(index.index_name).push(index.column_name);
1764
- }
1765
- const localColumns = new Map(
1766
- columnInfo.map((column2) => {
1767
- let type = column2.type.toLowerCase();
1768
- const isAutoIncrement = column2.extra.toLowerCase().includes("auto_increment");
1769
- if (isAutoIncrement) {
1770
- if (type.includes("bigint")) type = "bigserial";
1771
- else if (type.includes("smallint")) type = "smallserial";
1772
- else type = "serial";
1773
- }
1774
- return [
1775
- column2.name,
1776
- {
1777
- type: sql.unsafe(type),
1778
- notNull: column2.notNull && !isAutoIncrement,
1779
- defaultValue: column2.defaultValue && !isAutoIncrement ? sql.unsafe(column2.defaultValue) : void 0
1780
- }
1781
- ];
1782
- })
1783
- );
1784
- const schemaColumns = new Map(
1785
- Object.entries(tableApi.columns).map(([name, column2]) => {
1786
- const columnApi = getData(column2);
1787
- return [columnApi.name ?? name, columnApi];
1788
- })
1789
- );
1790
- const columnNames = /* @__PURE__ */ new Set([
1791
- ...localColumns.keys(),
1792
- ...schemaColumns.keys()
1793
- ]);
1794
- for (const columnName of columnNames) {
1795
- const alterTable = sql.identifier(tableApi.name);
1796
- const column2 = sql.identifier(columnName);
1797
- const localInstruction = localColumns.get(columnName);
1798
- const schemaInstruction = schemaColumns.get(columnName);
1799
- if (!schemaInstruction) {
1800
- stmts.push(
1801
- sql.query({
1802
- alterTable,
1803
- dropColumn: column2
1804
- })
1805
- );
1806
- } else if (!localInstruction) {
1807
- stmts.push(
1808
- sql.query({
1809
- alterTable,
1810
- addColumn: [column2, sql.chunk("emitColumn", schemaInstruction)]
1811
- })
1812
- );
1813
- } else {
1814
- if (inline2(localInstruction.type) !== inline2(schemaInstruction.type)) {
1815
- stmts.push(
1816
- sql.query({
1817
- alterTable,
1818
- modifyColumn: [column2, schemaInstruction.type]
1819
- })
1820
- );
1821
- }
1822
- if (Boolean(localInstruction.notNull) !== Boolean(schemaInstruction.notNull)) {
1823
- stmts.push(
1824
- sql.query({
1825
- alterTable,
1826
- modifyColumn: [
1827
- column2,
1828
- schemaInstruction.notNull ? sql`${schemaInstruction.type} not null` : sql`${schemaInstruction.type} null`
1829
- ]
1830
- })
1831
- );
1832
- }
1833
- const localDefault = localInstruction.defaultValue;
1834
- const schemaDefault = schemaInstruction.defaultValue;
1835
- const localDefaultStr = localDefault && inline2(localDefault);
1836
- const schemaDefaultStr = schemaDefault && inline2(schemaDefault);
1837
- if (localDefaultStr !== schemaDefaultStr) {
1838
- stmts.push(
1839
- sql.query({
1840
- alterTable,
1841
- alterColumn: [
1842
- column2,
1843
- schemaDefault ? sql`set default ${schemaDefault}` : sql`drop default`
1844
- ]
1845
- })
1846
- );
1847
- }
1848
- }
1849
- }
1850
- const localIndexes = new Map(
1851
- Array.from(indexMap.entries()).filter(([name]) => name !== "PRIMARY").map(([name, columns]) => {
1852
- return [
1853
- name,
1854
- sql`index ${sql.identifier(name)} (${sql.join(columns.map(sql.identifier), sql`, `)})`
1855
- ];
1856
- })
1857
- );
1858
- const schemaIndexes = new Map(
1859
- Object.entries(tableApi.indexes()).map(([name, index]) => {
1860
- const indexApi = getData(index);
1861
- return [name, indexApi.toSql(tableApi.name, name, false)];
1862
- })
1863
- );
1864
- const indexNames = /* @__PURE__ */ new Set([
1865
- ...localIndexes.keys(),
1866
- ...schemaIndexes.keys()
1867
- ]);
1868
- for (const indexName of indexNames) {
1869
- const localInstruction = localIndexes.get(indexName);
1870
- const schemaInstruction = schemaIndexes.get(indexName);
1871
- if (!schemaInstruction) {
1872
- stmts.unshift(
1873
- sql.query({
1874
- alterTable: sql.identifier(tableApi.name),
1875
- dropIndex: sql.identifier(indexName)
1876
- })
1877
- );
1878
- } else if (!localInstruction) {
1879
- stmts.push(schemaInstruction);
1880
- } else if (inline2(localInstruction) !== inline2(schemaInstruction)) {
1881
- if (indexName === "PRIMARY") {
1882
- stmts.unshift(
1883
- sql.query({
1884
- alterTable: sql.identifier(tableApi.name),
1885
- dropPrimaryKey: true
1886
- })
1887
- );
1888
- stmts.push(schemaInstruction);
1889
- } else {
1890
- stmts.unshift(
1891
- sql.query({
1892
- alterTable: sql.identifier(tableApi.name),
1893
- dropIndex: sql.identifier(indexName)
1894
- })
1895
- );
1896
- stmts.push(schemaInstruction);
1897
- }
1898
- }
1899
- }
1900
- return stmts.map(inline2);
1901
- });
1902
- };
1903
-
1904
- // node_modules/rado/dist/mysql/transactions.js
1905
- function startTransaction(options) {
1906
- return [
1907
- "start transaction",
1908
- options.withConsistentSnapshot && "with consistent snapshot",
1909
- options.accessMode
1910
- ].filter(Boolean).join(" ");
1911
- }
1912
- function setTransaction(options) {
1913
- if (!options.isolationLevel) return;
1914
- return [
1915
- "set transaction",
1916
- options.isolationLevel && `isolation level ${options.isolationLevel}`
1917
- ].filter(Boolean).join(" ");
1918
- }
1919
-
1920
- // node_modules/rado/dist/driver/mysql2.js
1921
- var PreparedStatement6 = class {
1922
- constructor(client, sql2, name) {
1923
- this.client = client;
1924
- this.sql = sql2;
1925
- this.name = name;
1926
- }
1927
- #transformParam = (param) => {
1928
- if (param instanceof Uint8Array) return Buffer.from(param);
1929
- return param;
1930
- };
1931
- all(params) {
1932
- return this.client.query(this.sql, params.map(this.#transformParam)).then((res) => res[0]);
1933
- }
1934
- async run(params) {
1935
- await this.client.query(this.sql, params.map(this.#transformParam));
1936
- }
1937
- get(params) {
1938
- return this.all(params).then((rows) => rows[0] ?? null);
1939
- }
1940
- values(params) {
1941
- return this.client.query({
1942
- sql: this.sql,
1943
- values: params.map(this.#transformParam),
1944
- rowsAsArray: true
1945
- }).then((res) => res[0]);
1946
- }
1947
- free() {
1948
- }
1949
- };
1950
- var Mysql2Driver = class _Mysql2Driver {
1951
- constructor(client, depth = 0) {
1952
- this.client = client;
1953
- this.depth = depth;
1954
- }
1955
- parsesJson = true;
1956
- supportsTransactions = true;
1957
- async exec(query) {
1958
- await this.client.query(query);
1959
- }
1960
- prepare(sql2, options) {
1961
- return new PreparedStatement6(this.client, sql2, options?.name);
1962
- }
1963
- async close() {
1964
- if ("end" in this.client) return this.client.end();
1965
- }
1966
- async batch(queries) {
1967
- const transact = async (tx) => {
1968
- const results = [];
1969
- for (const { sql: sql2, params } of queries)
1970
- results.push(await tx.prepare(sql2).values(params));
1971
- return results;
1972
- };
1973
- if (this.depth > 0) return transact(this);
1974
- return this.transaction(transact, {});
1975
- }
1976
- async transaction(run, options) {
1977
- const client = isPool(this.client) ? await this.client.getConnection() : this.client;
1978
- const driver = new _Mysql2Driver(client, this.depth + 1);
1979
- try {
1980
- await client.query(
1981
- this.depth > 0 ? `savepoint d${this.depth}` : startTransaction(options)
1982
- );
1983
- if (this.depth === 0) {
1984
- const setOptions = setTransaction(options);
1985
- if (setOptions) await client.query(setOptions);
1986
- }
1987
- const result = await run(driver);
1988
- await client.query(
1989
- this.depth > 0 ? `release savepoint d${this.depth}` : "commit"
1990
- );
1991
- return result;
1992
- } catch (error) {
1993
- await client.query(
1994
- this.depth > 0 ? `rollback to savepoint d${this.depth}` : "rollback"
1995
- );
1996
- throw error;
1997
- } finally {
1998
- if (isPool(this.client))
1999
- this.client.releaseConnection(client);
2000
- }
2001
- }
2002
- };
2003
- function isPool(client) {
2004
- return "getConnection" in client;
2005
- }
2006
- function connect5(client) {
2007
- return new AsyncDatabase(
2008
- new Mysql2Driver("promise" in client ? client.promise() : client),
2009
- mysqlDialect,
2010
- mysqlDiff
2011
- );
2012
- }
2013
-
2014
- // node_modules/rado/dist/postgres/dialect.js
2015
- var DOUBLE_QUOTE2 = '"';
2016
- var ESCAPE_DOUBLE_QUOTE2 = '""';
2017
- var MATCH_DOUBLE_QUOTE2 = /"/g;
2018
- var SINGLE_QUOTE3 = "'";
2019
- var ESCAPE_SINGLE_QUOTE3 = "''";
2020
- var MATCH_SINGLE_QUOTE3 = /'/g;
2021
- var postgresDialect = new Dialect(
2022
- "postgres",
2023
- class extends Emitter {
2024
- runtime = "postgres";
2025
- paramIndex = 0;
2026
- emitValue(value) {
2027
- this.sql += `$${++this.paramIndex}`;
2028
- this.params.push(new ValueParam(value));
2029
- }
2030
- emitJsonPath({ target, asSql, segments }) {
2031
- target.emitTo(this);
2032
- for (let i = 0; i < segments.length; i++) {
2033
- const access = segments[i];
2034
- if (i <= segments.length - 2) this.sql += "->";
2035
- else if (i === segments.length - 1) this.sql += asSql ? "->>" : "->";
2036
- if (typeof access === "number") this.sql += access;
2037
- else this.sql += this.quoteString(access);
2038
- }
2039
- }
2040
- emitInline(value) {
2041
- if (value === null || value === void 0) return this.sql += "null";
2042
- if (typeof value === "number" || typeof value === "boolean")
2043
- return this.sql += value;
2044
- if (typeof value === "string")
2045
- return this.sql += this.quoteString(value);
2046
- this.sql += this.quoteString(JSON.stringify(value));
2047
- }
2048
- emitPlaceholder(name) {
2049
- this.sql += `$${++this.paramIndex}`;
2050
- this.params.push(new NamedParam(name));
2051
- }
2052
- quoteString(input2) {
2053
- return SINGLE_QUOTE3 + input2.replace(MATCH_SINGLE_QUOTE3, ESCAPE_SINGLE_QUOTE3) + SINGLE_QUOTE3;
2054
- }
2055
- emitIdentifier(identifier) {
2056
- this.sql += DOUBLE_QUOTE2 + identifier.replace(MATCH_DOUBLE_QUOTE2, ESCAPE_DOUBLE_QUOTE2) + DOUBLE_QUOTE2;
2057
- }
2058
- }
2059
- );
2060
-
2061
- // node_modules/rado/dist/postgres/columns.js
2062
- function integer3(name) {
2063
- return column({ name, type: column.integer() });
2064
- }
2065
- function oid(name) {
2066
- return column({ name, type: column.oid() });
2067
- }
2068
- function boolean2(name) {
2069
- return column({ name, type: column.boolean() });
2070
- }
2071
- function text3(name) {
2072
- return column({ name, type: column.text() });
2073
- }
2074
-
2075
- // node_modules/rado/dist/postgres/diff.js
2076
- var Attr = table("pg_attribute", {
2077
- name: text3("attname").notNull(),
2078
- typId: oid("atttypid").notNull(),
2079
- typMod: integer3("atttypmod").notNull(),
2080
- notNull: boolean2("attnotnull").notNull(),
2081
- relId: oid("attrelid").notNull(),
2082
- isDropped: boolean2("attisdropped").notNull(),
2083
- num: integer3("attnum").notNull(),
2084
- identity: text3("attidentity"),
2085
- hasDef: boolean2("atthasdef").notNull()
2086
- });
2087
- var Class = table("pg_class", {
2088
- oid: oid().notNull(),
2089
- relname: text3().notNull(),
2090
- relnamespace: oid().notNull()
2091
- });
2092
- var Namespace = table("pg_namespace", {
2093
- oid: oid().notNull(),
2094
- name: text3("nspname").notNull()
2095
- });
2096
- var Type = table("pg_type", {
2097
- oid: oid().notNull(),
2098
- name: text3("typname").notNull()
2099
- });
2100
- var AttrDef = table("pg_attrdef", {
2101
- relId: oid("adrelid").notNull(),
2102
- num: integer3("adnum").notNull(),
2103
- bin: text3("adbin").notNull()
2104
- });
2105
- var inline3 = (sql2) => postgresDialect.inline(sql2);
2106
- var columnType = sql`pg_catalog.format_type(${Attr.typId}, ${Attr.typMod})`;
2107
- var columnDefaultValue = when(
2108
- [Attr.hasDef, sql`pg_catalog.pg_get_expr(${AttrDef.bin}, ${AttrDef.relId})`],
2109
- null
2110
- );
2111
- var identity = when(
2112
- [eq(Attr.identity, "a"), sql`'generated always as identity'`],
2113
- [eq(Attr.identity, "d"), sql`'generated by default as identity'`],
2114
- null
2115
- );
2116
- var postgresDiff = (hasTable2) => {
2117
- return txGenerator(function* (tx) {
2118
- const tableApi = getTable(hasTable2);
2119
- const def = tx.select({
2120
- table_name: Class.relname,
2121
- name: Attr.name,
2122
- type: columnType,
2123
- notNull: Attr.notNull,
2124
- defaultValue: columnDefaultValue,
2125
- identity,
2126
- schema_name: Namespace.name
2127
- }).from(Class).innerJoin(Namespace, eq(Namespace.oid, Class.relnamespace)).innerJoin(Attr, and(gt(Attr.num, 0), eq(Attr.relId, Class.oid))).innerJoin(Type, eq(Attr.typId, Type.oid)).leftJoin(
2128
- AttrDef,
2129
- and(eq(Attr.relId, AttrDef.relId), eq(Attr.num, AttrDef.num))
2130
- ).where(eq(Class.relname, tableApi.name)).orderBy(asc(Attr.num)).as("def");
2131
- const mapSequenceType = when(
2132
- def.type,
2133
- ["integer", "serial"],
2134
- ["smallint", "smallserial"],
2135
- ["bigint", "bigserial"],
2136
- def.type
2137
- );
2138
- const isSequence = like(def.defaultValue, "nextval(%_seq%");
2139
- const type = concat(
2140
- when([isSequence, mapSequenceType], def.type),
2141
- when(
2142
- [isNotNull(def.identity), concat(" ", def.identity).inlineValues()],
2143
- ""
2144
- )
2145
- ).inlineValues();
2146
- const isNumeric = or(
2147
- eq(def.type, "integer"),
2148
- eq(def.type, "smallint"),
2149
- eq(def.type, "bigint")
2150
- );
2151
- const isNumericSequence = and(isSequence, isNumeric);
2152
- const defaultValue = when(
2153
- [
2154
- and(isNotNull(def.defaultValue), not(isNumericSequence)),
2155
- def.defaultValue
2156
- ],
2157
- ""
2158
- );
2159
- const columnInfo = yield* tx.select({
2160
- name: def.name,
2161
- type,
2162
- notNull: and(def.notNull, isNull(def.identity)),
2163
- defaultValue
2164
- }).from(def);
2165
- const localColumns = new Map(
2166
- columnInfo.map((column2) => {
2167
- return [
2168
- column2.name,
2169
- {
2170
- type: sql.unsafe(column2.type.toLowerCase()),
2171
- notNull: column2.notNull,
2172
- defaultValue: column2.defaultValue ? sql.unsafe(column2.defaultValue) : void 0
2173
- }
2174
- ];
2175
- })
2176
- );
2177
- const schemaColumns = new Map(
2178
- Object.entries(tableApi.columns).map(([name, column2]) => {
2179
- const columnApi = getData(column2);
2180
- return [columnApi.name ?? name, columnApi];
2181
- })
2182
- );
2183
- const stmts = [];
2184
- const columnNames = /* @__PURE__ */ new Set([
2185
- ...localColumns.keys(),
2186
- ...schemaColumns.keys()
2187
- ]);
2188
- for (const columnName of columnNames) {
2189
- const alterTable = sql.identifier(tableApi.name);
2190
- const column2 = sql.identifier(columnName);
2191
- const localInstruction = localColumns.get(columnName);
2192
- const schemaInstruction = schemaColumns.get(columnName);
2193
- if (!schemaInstruction) {
2194
- stmts.push(
2195
- sql.query({
2196
- alterTable,
2197
- dropColumn: column2
2198
- })
2199
- );
2200
- } else if (!localInstruction) {
2201
- stmts.push(
2202
- sql.query({
2203
- alterTable,
2204
- addColumn: [column2, sql.chunk("emitColumn", schemaInstruction)]
2205
- })
2206
- );
2207
- } else {
2208
- if (inline3(localInstruction.type) !== inline3(schemaInstruction.type)) {
2209
- stmts.push(
2210
- sql.query({
2211
- alterTable,
2212
- alterColumn: [column2, sql`type ${schemaInstruction.type}`]
2213
- })
2214
- );
2215
- }
2216
- if (Boolean(localInstruction.notNull) !== Boolean(schemaInstruction.notNull)) {
2217
- stmts.push(
2218
- sql.query({
2219
- alterTable,
2220
- alterColumn: [
2221
- column2,
2222
- schemaInstruction.notNull ? sql`set not null` : sql`drop not null`
2223
- ]
2224
- })
2225
- );
2226
- }
2227
- const localDefault = localInstruction.defaultValue;
2228
- const schemaDefault = schemaInstruction.defaultValue;
2229
- const localDefaultStr = localDefault && inline3(localDefault);
2230
- const schemaDefaultStr = schemaDefault && inline3(schemaDefault);
2231
- if (localDefaultStr !== schemaDefaultStr) {
2232
- stmts.push(
2233
- sql.query({
2234
- alterTable,
2235
- alterColumn: [
2236
- column2,
2237
- schemaDefault ? sql`set default ${schemaDefault}` : sql`drop default`
2238
- ]
2239
- })
2240
- );
2241
- }
2242
- }
2243
- }
2244
- return stmts.map(inline3);
2245
- });
2246
- };
2247
-
2248
- // node_modules/rado/dist/postgres/transactions.js
2249
- function setTransaction2(options) {
2250
- return [
2251
- "set transaction",
2252
- options.isolationLevel && `isolation level ${options.isolationLevel}`,
2253
- options.accessMode,
2254
- options.deferrable ? "deferrable" : "not deferrable"
2255
- ].filter(Boolean).join(" ");
2256
- }
2257
-
2258
- // node_modules/rado/dist/driver/pg.js
2259
- var PreparedStatement7 = class {
2260
- constructor(client, sql2, name) {
2261
- this.client = client;
2262
- this.sql = sql2;
2263
- this.name = name;
2264
- }
2265
- all(params) {
2266
- return this.client.query({
2267
- name: this.name,
2268
- text: this.sql,
2269
- values: params
2270
- }).then((res) => res.rows);
2271
- }
2272
- async run(params) {
2273
- await this.client.query(
2274
- {
2275
- name: this.name,
2276
- text: this.sql,
2277
- values: params
2278
- },
2279
- params
2280
- );
2281
- }
2282
- get(params) {
2283
- return this.all(params).then((rows) => rows[0] ?? null);
2284
- }
2285
- values(params) {
2286
- return this.client.query({
2287
- name: this.name,
2288
- text: this.sql,
2289
- values: params,
2290
- rowMode: "array"
2291
- }).then((res) => res.rows);
2292
- }
2293
- free() {
2294
- }
2295
- };
2296
- var PgDriver = class _PgDriver {
2297
- constructor(client, depth = 0) {
2298
- this.client = client;
2299
- this.depth = depth;
2300
- }
2301
- parsesJson = true;
2302
- supportsTransactions = true;
2303
- async exec(query) {
2304
- await this.client.query(query);
2305
- }
2306
- prepare(sql2, options) {
2307
- return new PreparedStatement7(this.client, sql2, options?.name);
2308
- }
2309
- async close() {
2310
- if ("end" in this.client) return this.client.end();
2311
- if ("release" in this.client) return this.client.release();
2312
- }
2313
- async batch(queries) {
2314
- return this.transaction(async (tx) => {
2315
- const results = [];
2316
- for (const { sql: sql2, params } of queries)
2317
- results.push(await tx.prepare(sql2).values(params));
2318
- return results;
2319
- }, {});
2320
- }
2321
- async transaction(run, options) {
2322
- const client = "totalCount" in this.client ? await this.client.connect() : this.client;
2323
- try {
2324
- await client.query(this.depth > 0 ? `savepoint d${this.depth}` : "begin");
2325
- if (this.depth === 0) await client.query(setTransaction2(options));
2326
- const result = await run(new _PgDriver(client, this.depth + 1));
2327
- await client.query(
2328
- this.depth > 0 ? `release savepoint d${this.depth}` : "commit"
2329
- );
2330
- return result;
2331
- } catch (error) {
2332
- await client.query(
2333
- this.depth > 0 ? `rollback to savepoint d${this.depth}` : "rollback"
2334
- );
2335
- throw error;
2336
- } finally {
2337
- if ("release" in client) client.release();
2338
- }
2339
- }
2340
- };
2341
- function connect6(client) {
2342
- return new AsyncDatabase(new PgDriver(client), postgresDialect, postgresDiff);
2343
- }
2344
-
2345
- // node_modules/rado/dist/driver/pglite.js
2346
- var PreparedStatement8 = class {
2347
- constructor(client, sql2) {
2348
- this.client = client;
2349
- this.sql = sql2;
2350
- }
2351
- all(params) {
2352
- return this.client.query(this.sql, params, {
2353
- rowMode: "object"
2354
- }).then((res) => res.rows);
2355
- }
2356
- async run(params) {
2357
- await this.client.query(this.sql, params, {
2358
- rowMode: "array"
2359
- });
2360
- }
2361
- get(params) {
2362
- return this.all(params).then((rows) => rows[0] ?? null);
2363
- }
2364
- values(params) {
2365
- return this.client.query(this.sql, params, {
2366
- rowMode: "array"
2367
- }).then((res) => res.rows);
2368
- }
2369
- free() {
2370
- }
2371
- };
2372
- var PGliteDriver = class _PGliteDriver {
2373
- constructor(client, depth = 0) {
2374
- this.client = client;
2375
- this.depth = depth;
2376
- }
2377
- parsesJson = true;
2378
- supportsTransactions = true;
2379
- async exec(query) {
2380
- await this.client.exec(query);
2381
- }
2382
- close() {
2383
- if ("close" in this.client) {
2384
- return Promise.resolve();
2385
- }
2386
- throw new Error("Cannot close a transaction");
2387
- }
2388
- prepare(sql2) {
2389
- return new PreparedStatement8(this.client, sql2);
2390
- }
2391
- async batch(queries) {
2392
- const transact = async (tx) => {
2393
- const results = [];
2394
- for (const { sql: sql2, params } of queries)
2395
- results.push(await tx.prepare(sql2).values(params));
2396
- return results;
2397
- };
2398
- if (this.depth > 0) return transact(this);
2399
- return this.transaction(transact, {});
2400
- }
2401
- async transaction(run, options) {
2402
- if (this.depth === 0 && "transaction" in this.client)
2403
- return this.client.transaction(async (tx) => {
2404
- await tx.query(setTransaction2(options));
2405
- return run(new _PGliteDriver(tx, this.depth + 1));
2406
- });
2407
- await this.exec(`savepoint d${this.depth}`);
2408
- try {
2409
- const result = await run(new _PGliteDriver(this.client, this.depth + 1));
2410
- await this.exec(`release d${this.depth}`);
2411
- return result;
2412
- } catch (error) {
2413
- await this.exec(`rollback to d${this.depth}`);
2414
- throw error;
2415
- }
2416
- }
2417
- };
2418
- function connect7(db) {
2419
- return new AsyncDatabase(new PGliteDriver(db), postgresDialect, postgresDiff);
2420
- }
2421
-
2422
- // node_modules/rado/dist/driver/sql.js.js
2423
- var PreparedStatement9 = class {
2424
- constructor(client, stmt) {
2425
- this.client = client;
2426
- this.stmt = stmt;
2427
- }
2428
- *iterate(params) {
2429
- this.stmt.bind(params);
2430
- while (this.stmt.step()) yield this.stmt.getAsObject();
2431
- this.stmt.reset();
2432
- }
2433
- *iterateValues(params) {
2434
- this.stmt.bind(params);
2435
- while (this.stmt.step()) yield this.stmt.get();
2436
- this.stmt.reset();
2437
- }
2438
- all(params) {
2439
- return Array.from(this.iterate(params));
2440
- }
2441
- run(params) {
2442
- this.stmt.run(params);
2443
- this.stmt.reset();
2444
- return { rowsAffected: this.client.getRowsModified() };
2445
- }
2446
- get(params) {
2447
- return this.all(params)[0] ?? null;
2448
- }
2449
- values(params) {
2450
- return Array.from(this.iterateValues(params));
2451
- }
2452
- free() {
2453
- this.stmt.free();
2454
- }
2455
- };
2456
- var SqlJsDriver = class _SqlJsDriver {
2457
- constructor(client, depth = 0) {
2458
- this.client = client;
2459
- this.depth = depth;
2460
- }
2461
- parsesJson = false;
2462
- supportsTransactions = true;
2463
- exec(query) {
2464
- this.client.exec(query);
2465
- }
2466
- close() {
2467
- this.client.close();
2468
- }
2469
- prepare(sql2) {
2470
- return new PreparedStatement9(this.client, this.client.prepare(sql2));
2471
- }
2472
- batch(queries) {
2473
- return this.transaction(
2474
- (tx) => queries.map(({ sql: sql2, params }) => tx.prepare(sql2).values(params)),
2475
- {}
2476
- );
2477
- }
2478
- transaction(run, options) {
2479
- return execTransaction(
2480
- this,
2481
- this.depth,
2482
- (depth) => new _SqlJsDriver(this.client, depth),
2483
- run,
2484
- options
2485
- );
2486
- }
2487
- };
2488
- function connect8(db) {
2489
- return new SyncDatabase(new SqlJsDriver(db), sqliteDialect, sqliteDiff);
2490
- }
2491
-
2492
- // src/backend/api/CreateBackend.ts
2493
10
  import { BasicAuth } from "./BasicAuth.js";
2494
11
  import { DatabaseApi } from "./DatabaseApi.js";
2495
12
  import { GithubApi } from "./GithubApi.js";
2496
13
  import { OAuth2 } from "./OAuth2.js";
2497
- function createBackend(config, options) {
14
+ import { S3Uploads } from "./S3Uploads.js";
15
+ function backendFromOptions(options) {
2498
16
  const db = driver_exports[options.database.driver](options.database.client);
2499
- return (context) => {
2500
- const { user } = context;
2501
- const author = user?.name && user.email ? { name: user.name, email: user.email } : void 0;
2502
- const ghApi = new GithubApi({
2503
- author,
2504
- ...options.github
2505
- });
17
+ return (context, config) => {
18
+ const ghApi = new GithubApi(options.github);
2506
19
  const dbApi = new DatabaseApi(context, { db });
20
+ const uploadsApi = options.uploads?.s3 ? new S3Uploads(options.uploads.s3, config.maxUploadSize) : void 0;
2507
21
  assert(options.oauth2 ?? options.auth, "No auth method provided");
2508
22
  const auth = options.oauth2 ? new OAuth2(context, config, options.oauth2) : new BasicAuth(context, options.auth);
2509
- return createRemote(ghApi, dbApi, auth);
23
+ return composeBackend(ghApi, dbApi, uploadsApi ?? {}, auth);
24
+ };
25
+ }
26
+ function createBackend(...parts) {
27
+ return (context, config) => {
28
+ return composeBackend(
29
+ ...parts.map(
30
+ (part) => typeof part === "function" ? part(context, config) : part
31
+ )
32
+ );
2510
33
  };
2511
34
  }
2512
- function createRemote(...impl) {
2513
- const reversed = impl.reverse();
35
+ function composeBackend(...impl) {
36
+ const hasMethod = (name) => {
37
+ return impl.some((i) => typeof i[name] === "function");
38
+ };
39
+ const fallback = {
40
+ async enrichUser(user) {
41
+ return user;
42
+ },
43
+ async capabilities() {
44
+ return {
45
+ users: hasMethod("listUsers")
46
+ };
47
+ }
48
+ };
49
+ const reversed = [...impl].reverse().concat(fallback);
2514
50
  const call = (name) => {
2515
51
  const use = reversed.find((i) => name in i);
2516
52
  return use ? use[name].bind(use) : () => {
@@ -2520,6 +56,7 @@ function createRemote(...impl) {
2520
56
  return {
2521
57
  authenticate: call("authenticate"),
2522
58
  verify: call("verify"),
59
+ capabilities: call("capabilities"),
2523
60
  getTreeIfDifferent: call("getTreeIfDifferent"),
2524
61
  getBlobs: call("getBlobs"),
2525
62
  write: call("write"),
@@ -2529,10 +66,16 @@ function createRemote(...impl) {
2529
66
  storeDraft: call("storeDraft"),
2530
67
  prepareUpload: call("prepareUpload"),
2531
68
  handleUpload: call("handleUpload"),
2532
- previewUpload: call("previewUpload")
69
+ previewUpload: call("previewUpload"),
70
+ enrichUser: call("enrichUser"),
71
+ listUsers: call("listUsers"),
72
+ createUser: call("createUser"),
73
+ updateUser: call("updateUser"),
74
+ removeUser: call("removeUser")
2533
75
  };
2534
76
  }
2535
77
  export {
2536
- createBackend,
2537
- createRemote
78
+ backendFromOptions,
79
+ composeBackend,
80
+ createBackend
2538
81
  };