@rfc0/patty 0.0.0-stage → 1.0.2

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 (465) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +214 -2
  3. package/dist/adapters/access-tokens.js +7 -0
  4. package/dist/adapters/accounts.js +37 -0
  5. package/dist/adapters/auth.js +11 -0
  6. package/dist/adapters/bills.js +32 -0
  7. package/dist/adapters/budgets.js +29 -0
  8. package/dist/adapters/categories.js +32 -0
  9. package/dist/adapters/client-grants.js +7 -0
  10. package/dist/adapters/credit-cards.js +33 -0
  11. package/dist/adapters/currencies.js +2 -0
  12. package/dist/adapters/currency-rates.js +18 -0
  13. package/dist/adapters/dashboards.js +43 -0
  14. package/dist/adapters/demo.js +13 -0
  15. package/dist/adapters/instance-settings.js +7 -0
  16. package/dist/adapters/invites.js +7 -0
  17. package/dist/adapters/recurring.js +55 -0
  18. package/dist/adapters/sessions.js +7 -0
  19. package/dist/adapters/settings.js +4 -0
  20. package/dist/adapters/setup-codes.js +7 -0
  21. package/dist/adapters/tags.js +9 -0
  22. package/dist/adapters/transactions.js +95 -0
  23. package/dist/adapters/users.js +7 -0
  24. package/dist/common/build-version.js +5 -0
  25. package/dist/common/errors.js +118 -0
  26. package/dist/common/net.js +71 -0
  27. package/dist/common/result.js +7 -0
  28. package/dist/composition/auth.js +106 -0
  29. package/dist/composition/boot.js +27 -0
  30. package/dist/composition/cli.js +86 -0
  31. package/dist/composition/demo/seed.js +92 -0
  32. package/dist/composition/demo/shell.js +107 -0
  33. package/dist/composition/export.js +89 -0
  34. package/dist/composition/http.js +110 -0
  35. package/dist/composition/import.js +55 -0
  36. package/dist/composition/lazy-modules.js +2 -0
  37. package/dist/composition/runtime.js +115 -0
  38. package/dist/composition/sign-in/interpreter.js +154 -0
  39. package/dist/composition/sign-in/server.js +36 -0
  40. package/dist/composition/sign-in/wiring.js +23 -0
  41. package/dist/composition/stdio.js +69 -0
  42. package/dist/config.js +136 -0
  43. package/dist/controllers/account/account.js +88 -0
  44. package/dist/controllers/account/transaction.js +119 -0
  45. package/dist/controllers/account/transfer.js +34 -0
  46. package/dist/controllers/aggregate.js +40 -0
  47. package/dist/controllers/auth/access-tokens.js +61 -0
  48. package/dist/controllers/auth/grants.js +136 -0
  49. package/dist/controllers/auth/key-export.js +20 -0
  50. package/dist/controllers/auth/owner.js +80 -0
  51. package/dist/controllers/auth/password.js +35 -0
  52. package/dist/controllers/auth/session.js +50 -0
  53. package/dist/controllers/auth/step-up.js +8 -0
  54. package/dist/controllers/auth/users.js +183 -0
  55. package/dist/controllers/budgets.js +87 -0
  56. package/dist/controllers/categories.js +67 -0
  57. package/dist/controllers/correlations.js +112 -0
  58. package/dist/controllers/credit-card/bill.js +105 -0
  59. package/dist/controllers/credit-card/credit-card.js +129 -0
  60. package/dist/controllers/credit-card/transaction.js +181 -0
  61. package/dist/controllers/currencies.js +1 -0
  62. package/dist/controllers/currency-rates.js +40 -0
  63. package/dist/controllers/dashboards.js +68 -0
  64. package/dist/controllers/demo/seed.js +31 -0
  65. package/dist/controllers/demo/tour.js +12 -0
  66. package/dist/controllers/deps.js +6 -0
  67. package/dist/controllers/instance.js +6 -0
  68. package/dist/controllers/merchants.js +12 -0
  69. package/dist/controllers/recurring.js +70 -0
  70. package/dist/controllers/resolve.js +37 -0
  71. package/dist/controllers/settings.js +47 -0
  72. package/dist/controllers/status.js +19 -0
  73. package/dist/controllers/summary.js +21 -0
  74. package/dist/controllers/tags.js +19 -0
  75. package/dist/controllers/transaction/bulk.js +6 -0
  76. package/dist/controllers/transaction/core.js +49 -0
  77. package/dist/controllers/transaction/read.js +28 -0
  78. package/dist/diplomat/auth/credentials.js +58 -0
  79. package/dist/diplomat/auth/sign-in-store.js +18 -0
  80. package/dist/diplomat/cli/commands/auth.js +100 -0
  81. package/dist/diplomat/cli/commands/db.js +72 -0
  82. package/dist/diplomat/cli/commands/demo.js +68 -0
  83. package/dist/diplomat/cli/commands/key.js +119 -0
  84. package/dist/diplomat/cli/commands/login.js +151 -0
  85. package/dist/diplomat/cli/commands/setup.js +132 -0
  86. package/dist/diplomat/cli/commands/users.js +123 -0
  87. package/dist/diplomat/cli/commands.js +61 -0
  88. package/dist/diplomat/cli/export-file.js +37 -0
  89. package/dist/diplomat/cli/import-file.js +44 -0
  90. package/dist/diplomat/cli/io.js +61 -0
  91. package/dist/diplomat/cli/key-export-approval.js +37 -0
  92. package/dist/diplomat/cli/messages.js +96 -0
  93. package/dist/diplomat/cli/prompt.js +74 -0
  94. package/dist/diplomat/cli/terminal.js +81 -0
  95. package/dist/diplomat/client-config/clients.js +150 -0
  96. package/dist/diplomat/client-config/merge.js +41 -0
  97. package/dist/diplomat/db/bootstrap.js +98 -0
  98. package/dist/diplomat/db/database-files.js +147 -0
  99. package/dist/diplomat/db/driver.js +167 -0
  100. package/dist/diplomat/db/effects.js +101 -0
  101. package/dist/diplomat/db/engine.js +9 -0
  102. package/dist/diplomat/db/export.js +22 -0
  103. package/dist/diplomat/db/file-lock.js +82 -0
  104. package/dist/diplomat/db/key-lock.js +14 -0
  105. package/dist/diplomat/db/locale-cache.js +23 -0
  106. package/dist/diplomat/db/migration-barrier.js +57 -0
  107. package/dist/diplomat/db/migration-journal.js +18 -0
  108. package/dist/diplomat/db/migration-lock.js +15 -0
  109. package/dist/diplomat/db/migrations.js +11 -0
  110. package/dist/diplomat/db/present.js +17 -0
  111. package/dist/diplomat/db/queries/aggregate-whitelist.js +35 -0
  112. package/dist/diplomat/db/queries/filters.js +59 -0
  113. package/dist/diplomat/db/queries/fts.js +18 -0
  114. package/dist/diplomat/db/queries/scope.js +8 -0
  115. package/dist/diplomat/db/queries/transaction-select.js +26 -0
  116. package/dist/diplomat/db/queries/tx-predicates.js +13 -0
  117. package/dist/diplomat/db/repos/access-tokens.js +27 -0
  118. package/dist/diplomat/db/repos/accounts.js +91 -0
  119. package/dist/diplomat/db/repos/bills.js +93 -0
  120. package/dist/diplomat/db/repos/budgets.js +72 -0
  121. package/dist/diplomat/db/repos/categories.js +53 -0
  122. package/dist/diplomat/db/repos/client-grants.js +67 -0
  123. package/dist/diplomat/db/repos/correlations.js +66 -0
  124. package/dist/diplomat/db/repos/credit-cards.js +67 -0
  125. package/dist/diplomat/db/repos/currencies.js +8 -0
  126. package/dist/diplomat/db/repos/currency-rates.js +40 -0
  127. package/dist/diplomat/db/repos/dashboards.js +123 -0
  128. package/dist/diplomat/db/repos/health.js +12 -0
  129. package/dist/diplomat/db/repos/instance-settings.js +14 -0
  130. package/dist/diplomat/db/repos/instance.js +58 -0
  131. package/dist/diplomat/db/repos/invites.js +43 -0
  132. package/dist/diplomat/db/repos/merchants.js +121 -0
  133. package/dist/diplomat/db/repos/recurring.js +29 -0
  134. package/dist/diplomat/db/repos/sessions.js +19 -0
  135. package/dist/diplomat/db/repos/settings.js +41 -0
  136. package/dist/diplomat/db/repos/setup-codes.js +28 -0
  137. package/dist/diplomat/db/repos/sub-categories.js +67 -0
  138. package/dist/diplomat/db/repos/tags.js +51 -0
  139. package/dist/diplomat/db/repos/transaction-tags.js +57 -0
  140. package/dist/diplomat/db/repos/transactions.js +163 -0
  141. package/dist/diplomat/db/repos/users.js +47 -0
  142. package/dist/diplomat/db/safety-copy.js +87 -0
  143. package/dist/diplomat/db/schema.js +348 -0
  144. package/dist/diplomat/db/seed/categories.js +112 -0
  145. package/dist/diplomat/db/seed/currencies.js +9 -0
  146. package/dist/diplomat/db/seed/demo/br.js +98 -0
  147. package/dist/diplomat/db/seed/demo/co.js +89 -0
  148. package/dist/diplomat/db/seed/demo/index.js +12 -0
  149. package/dist/diplomat/db/seed/demo/mx.js +90 -0
  150. package/dist/diplomat/db/seed/demo/shared.js +39 -0
  151. package/dist/diplomat/db/seed/demo/us.js +90 -0
  152. package/dist/diplomat/db/seed/merchant-rules.js +188 -0
  153. package/dist/diplomat/db/sqlite-errors.js +40 -0
  154. package/dist/diplomat/db/tenancy-integrity.js +45 -0
  155. package/dist/diplomat/db/version-guard.js +16 -0
  156. package/dist/diplomat/http/auth-pages.js +41 -0
  157. package/dist/diplomat/http/auth-paths.js +46 -0
  158. package/dist/diplomat/http/bearer.js +15 -0
  159. package/dist/diplomat/http/connect-pages.js +51 -0
  160. package/dist/diplomat/http/context.js +17 -0
  161. package/dist/diplomat/http/cookies.js +27 -0
  162. package/dist/diplomat/http/form-pages.js +38 -0
  163. package/dist/diplomat/http/hooks/auth.js +106 -0
  164. package/dist/diplomat/http/hooks/demo-marker.js +59 -0
  165. package/dist/diplomat/http/openapi.js +73 -0
  166. package/dist/diplomat/http/principal.js +1 -0
  167. package/dist/diplomat/http/rate-limiter.js +78 -0
  168. package/dist/diplomat/http/remedy.js +26 -0
  169. package/dist/diplomat/http/respond.js +50 -0
  170. package/dist/diplomat/http/routes/account.js +226 -0
  171. package/dist/diplomat/http/routes/aggregate.js +28 -0
  172. package/dist/diplomat/http/routes/auth.js +105 -0
  173. package/dist/diplomat/http/routes/budget.js +34 -0
  174. package/dist/diplomat/http/routes/category.js +109 -0
  175. package/dist/diplomat/http/routes/connect.js +124 -0
  176. package/dist/diplomat/http/routes/credit-card.js +263 -0
  177. package/dist/diplomat/http/routes/currency-rates.js +60 -0
  178. package/dist/diplomat/http/routes/currency.js +16 -0
  179. package/dist/diplomat/http/routes/dashboard.js +93 -0
  180. package/dist/diplomat/http/routes/invite.js +63 -0
  181. package/dist/diplomat/http/routes/recurring.js +65 -0
  182. package/dist/diplomat/http/routes/settings.js +38 -0
  183. package/dist/diplomat/http/routes/summary.js +23 -0
  184. package/dist/diplomat/http/routes/system.js +29 -0
  185. package/dist/diplomat/http/routes/tag.js +51 -0
  186. package/dist/diplomat/http/routes/tokens.js +72 -0
  187. package/dist/diplomat/http/routes/transaction.js +55 -0
  188. package/dist/diplomat/http/routes/transfer.js +35 -0
  189. package/dist/diplomat/http/routes/ui.js +110 -0
  190. package/dist/diplomat/http/routes/users.js +156 -0
  191. package/dist/diplomat/http/routes/well-known.js +26 -0
  192. package/dist/diplomat/http/routes.js +85 -0
  193. package/dist/diplomat/http/session.js +34 -0
  194. package/dist/diplomat/http/token-pages.js +75 -0
  195. package/dist/diplomat/http/ui-files.js +21 -0
  196. package/dist/diplomat/http/user-pages.js +93 -0
  197. package/dist/diplomat/mcp/annotations.js +8 -0
  198. package/dist/diplomat/mcp/auth-info.js +20 -0
  199. package/dist/diplomat/mcp/context.js +14 -0
  200. package/dist/diplomat/mcp/definition.js +3 -0
  201. package/dist/diplomat/mcp/gate.js +15 -0
  202. package/dist/diplomat/mcp/instructions.js +19 -0
  203. package/dist/diplomat/mcp/prompts.js +125 -0
  204. package/dist/diplomat/mcp/register.js +12 -0
  205. package/dist/diplomat/mcp/remedy.js +17 -0
  206. package/dist/diplomat/mcp/resources.js +93 -0
  207. package/dist/diplomat/mcp/respond.js +20 -0
  208. package/dist/diplomat/mcp/route.js +62 -0
  209. package/dist/diplomat/mcp/scopes.js +53 -0
  210. package/dist/diplomat/mcp/server.js +26 -0
  211. package/dist/diplomat/mcp/shared.js +5 -0
  212. package/dist/diplomat/mcp/stdio-session.js +94 -0
  213. package/dist/diplomat/mcp/stdio.js +23 -0
  214. package/dist/diplomat/mcp/tool-name.js +59 -0
  215. package/dist/diplomat/mcp/tools/account.js +218 -0
  216. package/dist/diplomat/mcp/tools/aggregate.js +32 -0
  217. package/dist/diplomat/mcp/tools/budget.js +99 -0
  218. package/dist/diplomat/mcp/tools/category.js +103 -0
  219. package/dist/diplomat/mcp/tools/correlations.js +70 -0
  220. package/dist/diplomat/mcp/tools/credit-card.js +239 -0
  221. package/dist/diplomat/mcp/tools/currency-rates.js +62 -0
  222. package/dist/diplomat/mcp/tools/dashboard.js +75 -0
  223. package/dist/diplomat/mcp/tools/index.js +31 -0
  224. package/dist/diplomat/mcp/tools/recurring.js +62 -0
  225. package/dist/diplomat/mcp/tools/summary.js +30 -0
  226. package/dist/diplomat/mcp/tools/system.js +83 -0
  227. package/dist/diplomat/mcp/tools/tag.js +48 -0
  228. package/dist/diplomat/mcp/tools/transaction.js +53 -0
  229. package/dist/diplomat/mcp/tools/transfer.js +28 -0
  230. package/dist/diplomat/mcp/tour.js +87 -0
  231. package/dist/logic/account.js +79 -0
  232. package/dist/logic/aggregate.js +37 -0
  233. package/dist/logic/auth/bearer.js +35 -0
  234. package/dist/logic/auth/grant.js +126 -0
  235. package/dist/logic/auth/key-export.js +10 -0
  236. package/dist/logic/auth/keychain.js +3 -0
  237. package/dist/logic/auth/message.js +22 -0
  238. package/dist/logic/auth/origin.js +57 -0
  239. package/dist/logic/auth/owner.js +22 -0
  240. package/dist/logic/auth/password.js +3 -0
  241. package/dist/logic/auth/redact.js +25 -0
  242. package/dist/logic/auth/revoke.js +28 -0
  243. package/dist/logic/auth/scope.js +17 -0
  244. package/dist/logic/auth/session.js +30 -0
  245. package/dist/logic/auth/sign-in-flow.js +305 -0
  246. package/dist/logic/auth/time.js +2 -0
  247. package/dist/logic/auth/token.js +74 -0
  248. package/dist/logic/auth/user-plans.js +84 -0
  249. package/dist/logic/auth/users.js +78 -0
  250. package/dist/logic/balance.js +2 -0
  251. package/dist/logic/bill.js +74 -0
  252. package/dist/logic/budget.js +78 -0
  253. package/dist/logic/category.js +37 -0
  254. package/dist/logic/classify.js +21 -0
  255. package/dist/logic/correlations.js +147 -0
  256. package/dist/logic/credit-card.js +2 -0
  257. package/dist/logic/currency-rate.js +69 -0
  258. package/dist/logic/dashboard.js +40 -0
  259. package/dist/logic/demo/database.js +30 -0
  260. package/dist/logic/demo/plan.js +308 -0
  261. package/dist/logic/demo/tour.js +33 -0
  262. package/dist/logic/export-destination.js +12 -0
  263. package/dist/logic/key-import.js +15 -0
  264. package/dist/logic/locale.js +5 -0
  265. package/dist/logic/localize.js +12 -0
  266. package/dist/logic/merchant.js +31 -0
  267. package/dist/logic/migration.js +1 -0
  268. package/dist/logic/money.js +12 -0
  269. package/dist/logic/period.js +45 -0
  270. package/dist/logic/persistence.js +48 -0
  271. package/dist/logic/recurring.js +51 -0
  272. package/dist/logic/resolve.js +44 -0
  273. package/dist/logic/summary.js +29 -0
  274. package/dist/logic/tag.js +13 -0
  275. package/dist/logic/transaction.js +197 -0
  276. package/dist/main.js +42 -0
  277. package/dist/models/account.js +197 -0
  278. package/dist/models/aggregate.js +61 -0
  279. package/dist/models/auth/bearer.js +11 -0
  280. package/dist/models/auth/entity.js +17 -0
  281. package/dist/models/auth/errors.js +42 -0
  282. package/dist/models/auth/grant.js +58 -0
  283. package/dist/models/auth/key-export.js +11 -0
  284. package/dist/models/auth/message.js +50 -0
  285. package/dist/models/auth/mode.js +7 -0
  286. package/dist/models/auth/origin.js +16 -0
  287. package/dist/models/auth/owner.js +36 -0
  288. package/dist/models/auth/password.js +24 -0
  289. package/dist/models/auth/principal.js +26 -0
  290. package/dist/models/auth/redact.js +4 -0
  291. package/dist/models/auth/scope.js +9 -0
  292. package/dist/models/auth/session.js +19 -0
  293. package/dist/models/auth/sign-in-flow.js +102 -0
  294. package/dist/models/auth/sign-in.js +41 -0
  295. package/dist/models/auth/time.js +5 -0
  296. package/dist/models/auth/token.js +50 -0
  297. package/dist/models/auth/users.js +52 -0
  298. package/dist/models/bill.js +55 -0
  299. package/dist/models/budget.js +106 -0
  300. package/dist/models/category.js +52 -0
  301. package/dist/models/client-config.js +18 -0
  302. package/dist/models/correlations.js +215 -0
  303. package/dist/models/credit-card.js +156 -0
  304. package/dist/models/currency-rate.js +83 -0
  305. package/dist/models/dashboard.js +54 -0
  306. package/dist/models/database.js +16 -0
  307. package/dist/models/date.js +8 -0
  308. package/dist/models/demo/core.js +58 -0
  309. package/dist/models/demo/tour.js +41 -0
  310. package/dist/models/encryption-key.js +2 -0
  311. package/dist/models/error.js +13 -0
  312. package/dist/models/export.js +9 -0
  313. package/dist/models/id.js +2 -0
  314. package/dist/models/instance.js +7 -0
  315. package/dist/models/key-import.js +6 -0
  316. package/dist/models/locale.js +25 -0
  317. package/dist/models/merchant.js +12 -0
  318. package/dist/models/money.js +14 -0
  319. package/dist/models/package.js +12 -0
  320. package/dist/models/page.js +56 -0
  321. package/dist/models/persistence.js +1 -0
  322. package/dist/models/prompts.js +5 -0
  323. package/dist/models/recurring.js +54 -0
  324. package/dist/models/remedy.js +17 -0
  325. package/dist/models/resolution.js +1 -0
  326. package/dist/models/startup.js +7 -0
  327. package/dist/models/summary.js +24 -0
  328. package/dist/models/tag.js +14 -0
  329. package/dist/models/tenancy.js +10 -0
  330. package/dist/models/transaction-tag.js +6 -0
  331. package/dist/models/transaction.js +275 -0
  332. package/dist/wire/db/access-tokens.js +1 -0
  333. package/dist/wire/db/accounts.js +7 -0
  334. package/dist/wire/db/aggregate.js +16 -0
  335. package/dist/wire/db/bills.js +14 -0
  336. package/dist/wire/db/budgets.js +33 -0
  337. package/dist/wire/db/categories.js +14 -0
  338. package/dist/wire/db/client-grants.js +1 -0
  339. package/dist/wire/db/correlations.js +49 -0
  340. package/dist/wire/db/credit-cards.js +1 -0
  341. package/dist/wire/db/currencies.js +1 -0
  342. package/dist/wire/db/currency-rates.js +1 -0
  343. package/dist/wire/db/dashboards.js +1 -0
  344. package/dist/wire/db/instance-settings.js +1 -0
  345. package/dist/wire/db/invites.js +1 -0
  346. package/dist/wire/db/merchants.js +18 -0
  347. package/dist/wire/db/recurring.js +19 -0
  348. package/dist/wire/db/sessions.js +1 -0
  349. package/dist/wire/db/settings.js +1 -0
  350. package/dist/wire/db/setup-codes.js +1 -0
  351. package/dist/wire/db/tags.js +1 -0
  352. package/dist/wire/db/tenancy.js +1 -0
  353. package/dist/wire/db/transactions.js +89 -0
  354. package/dist/wire/db/users.js +1 -0
  355. package/dist/wire/in/accounts.js +26 -0
  356. package/dist/wire/in/aggregate.js +10 -0
  357. package/dist/wire/in/auth.js +107 -0
  358. package/dist/wire/in/bills.js +11 -0
  359. package/dist/wire/in/budgets.js +11 -0
  360. package/dist/wire/in/categories.js +9 -0
  361. package/dist/wire/in/cli.js +106 -0
  362. package/dist/wire/in/coerce.js +6 -0
  363. package/dist/wire/in/common.js +17 -0
  364. package/dist/wire/in/credit-cards.js +16 -0
  365. package/dist/wire/in/currency-rates.js +8 -0
  366. package/dist/wire/in/period.js +7 -0
  367. package/dist/wire/in/recurring.js +6 -0
  368. package/dist/wire/in/settings.js +5 -0
  369. package/dist/wire/in/summary.js +5 -0
  370. package/dist/wire/in/tags.js +2 -0
  371. package/dist/wire/in/transactions.js +31 -0
  372. package/dist/wire/out/bills.js +9 -0
  373. package/dist/wire/out/budgets.js +10 -0
  374. package/dist/wire/out/client-config.js +2 -0
  375. package/dist/wire/out/common.js +4 -0
  376. package/dist/wire/out/credit-cards.js +15 -0
  377. package/dist/wire/out/currency-rates.js +11 -0
  378. package/dist/wire/out/errors.js +58 -0
  379. package/dist/wire/out/recurring.js +6 -0
  380. package/dist/wire/out/status.js +10 -0
  381. package/dist/wire/out/summary.js +9 -0
  382. package/dist/wire/out/transactions.js +52 -0
  383. package/drizzle/0000_futuristic_umar.sql +124 -0
  384. package/drizzle/0001_fts5_search.sql +23 -0
  385. package/drizzle/0002_rename_graph_to_history.sql +7 -0
  386. package/drizzle/0003_lyrical_hairball.sql +2 -0
  387. package/drizzle/0004_misty_ikaris.sql +7 -0
  388. package/drizzle/0005_credit-liability-accounts.sql +14 -0
  389. package/drizzle/0006_smart_aqueduct.sql +1 -0
  390. package/drizzle/0007_add_dashboards.sql +5 -0
  391. package/drizzle/0008_yummy_madripoor.sql +1 -0
  392. package/drizzle/0009_version_groundwork.sql +9 -0
  393. package/drizzle/0010_category_merchant_association_cascade.sql +16 -0
  394. package/drizzle/0011_dashboard_id_normalization.sql +16 -0
  395. package/drizzle/0012_hot_the_spike.sql +12 -0
  396. package/drizzle/0013_recurring_rules_merchant.sql +1 -0
  397. package/drizzle/0014_dashboard_source_discriminator.sql +17 -0
  398. package/drizzle/0015_currencies_decimals.sql +1 -0
  399. package/drizzle/0016_unusual_zaran.sql +13 -0
  400. package/drizzle/0017_premium_blur.sql +1 -0
  401. package/drizzle/0018_auth_identity.sql +39 -0
  402. package/drizzle/0019_access_tokens.sql +16 -0
  403. package/drizzle/0020_stdio_sign_in.sql +27 -0
  404. package/drizzle/0021_tenancy_data.sql +289 -0
  405. package/drizzle/0022_user_management.sql +17 -0
  406. package/drizzle/0023_instance_settings_row.sql +2 -0
  407. package/drizzle/0024_credentials_changed_at.sql +2 -0
  408. package/drizzle/0025_instance_kind.sql +2 -0
  409. package/drizzle/0026_demo_seeded_at.sql +2 -0
  410. package/drizzle/0027_demo_country.sql +2 -0
  411. package/drizzle/0028_reset_sign_ins.sql +2 -0
  412. package/drizzle/meta/0000_snapshot.json +894 -0
  413. package/drizzle/meta/0003_snapshot.json +910 -0
  414. package/drizzle/meta/0004_snapshot.json +951 -0
  415. package/drizzle/meta/0005_snapshot.json +991 -0
  416. package/drizzle/meta/0006_snapshot.json +998 -0
  417. package/drizzle/meta/0007_snapshot.json +1029 -0
  418. package/drizzle/meta/0008_snapshot.json +1049 -0
  419. package/drizzle/meta/0009_snapshot.json +1121 -0
  420. package/drizzle/meta/0010_snapshot.json +1121 -0
  421. package/drizzle/meta/0011_snapshot.json +1136 -0
  422. package/drizzle/meta/0012_snapshot.json +1227 -0
  423. package/drizzle/meta/0013_snapshot.json +1247 -0
  424. package/drizzle/meta/0014_snapshot.json +1267 -0
  425. package/drizzle/meta/0015_snapshot.json +1275 -0
  426. package/drizzle/meta/0016_snapshot.json +1371 -0
  427. package/drizzle/meta/0017_snapshot.json +1392 -0
  428. package/drizzle/meta/0018_snapshot.json +1603 -0
  429. package/drizzle/meta/0019_snapshot.json +1713 -0
  430. package/drizzle/meta/0020_snapshot.json +1904 -0
  431. package/drizzle/meta/0021_snapshot.json +2186 -0
  432. package/drizzle/meta/0022_snapshot.json +2311 -0
  433. package/drizzle/meta/0023_snapshot.json +2311 -0
  434. package/drizzle/meta/0024_snapshot.json +2318 -0
  435. package/drizzle/meta/0025_snapshot.json +2326 -0
  436. package/drizzle/meta/0026_snapshot.json +2333 -0
  437. package/drizzle/meta/0027_snapshot.json +2340 -0
  438. package/drizzle/meta/0028_snapshot.json +2340 -0
  439. package/drizzle/meta/_journal.json +209 -0
  440. package/package.json +106 -4
  441. package/skills/dashboard-building/SKILL.md +201 -0
  442. package/skills/patty-tour/SKILL.md +34 -0
  443. package/ui/app.css +758 -0
  444. package/ui/app.js +543 -0
  445. package/ui/connect-result.html +16 -0
  446. package/ui/connect.html +53 -0
  447. package/ui/dashboards/accounts.html +3189 -0
  448. package/ui/dashboards/budget.html +1734 -0
  449. package/ui/dashboards/cards.html +4032 -0
  450. package/ui/dashboards/categories.html +4694 -0
  451. package/ui/dashboards/comparative.html +2475 -0
  452. package/ui/dashboards/dashboards.html +839 -0
  453. package/ui/dashboards/overview.html +2405 -0
  454. package/ui/dashboards/pending.html +2973 -0
  455. package/ui/dashboards/projections.html +2528 -0
  456. package/ui/dashboards/tags.html +1365 -0
  457. package/ui/invite.html +44 -0
  458. package/ui/login.html +26 -0
  459. package/ui/money.js +175 -0
  460. package/ui/setup.html +29 -0
  461. package/ui/shell.html +96 -0
  462. package/ui/token-created.html +24 -0
  463. package/ui/tokens.html +58 -0
  464. package/ui/user-invited.html +27 -0
  465. package/ui/users.html +60 -0
@@ -0,0 +1,2186 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "40fe37de-98e3-46a2-9ff3-8220ca178bb0",
5
+ "prevId": "71ef2cdd-6368-42ad-84e2-6c1d9da5bdaa",
6
+ "tables": {
7
+ "access_tokens": {
8
+ "name": "access_tokens",
9
+ "columns": {
10
+ "id": {
11
+ "name": "id",
12
+ "type": "text",
13
+ "primaryKey": true,
14
+ "notNull": true,
15
+ "autoincrement": false
16
+ },
17
+ "user_id": {
18
+ "name": "user_id",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true,
22
+ "autoincrement": false
23
+ },
24
+ "kind": {
25
+ "name": "kind",
26
+ "type": "text",
27
+ "primaryKey": false,
28
+ "notNull": true,
29
+ "autoincrement": false,
30
+ "default": "'pat'"
31
+ },
32
+ "client_name": {
33
+ "name": "client_name",
34
+ "type": "text",
35
+ "primaryKey": false,
36
+ "notNull": false,
37
+ "autoincrement": false
38
+ },
39
+ "profile": {
40
+ "name": "profile",
41
+ "type": "text",
42
+ "primaryKey": false,
43
+ "notNull": false,
44
+ "autoincrement": false
45
+ },
46
+ "name": {
47
+ "name": "name",
48
+ "type": "text",
49
+ "primaryKey": false,
50
+ "notNull": true,
51
+ "autoincrement": false
52
+ },
53
+ "token_hash": {
54
+ "name": "token_hash",
55
+ "type": "text",
56
+ "primaryKey": false,
57
+ "notNull": true,
58
+ "autoincrement": false
59
+ },
60
+ "prefix": {
61
+ "name": "prefix",
62
+ "type": "text",
63
+ "primaryKey": false,
64
+ "notNull": true,
65
+ "autoincrement": false
66
+ },
67
+ "scopes": {
68
+ "name": "scopes",
69
+ "type": "text",
70
+ "primaryKey": false,
71
+ "notNull": true,
72
+ "autoincrement": false
73
+ },
74
+ "created_at": {
75
+ "name": "created_at",
76
+ "type": "text",
77
+ "primaryKey": false,
78
+ "notNull": true,
79
+ "autoincrement": false
80
+ },
81
+ "last_used_at": {
82
+ "name": "last_used_at",
83
+ "type": "text",
84
+ "primaryKey": false,
85
+ "notNull": false,
86
+ "autoincrement": false
87
+ },
88
+ "expires_at": {
89
+ "name": "expires_at",
90
+ "type": "text",
91
+ "primaryKey": false,
92
+ "notNull": false,
93
+ "autoincrement": false
94
+ },
95
+ "revoked_at": {
96
+ "name": "revoked_at",
97
+ "type": "text",
98
+ "primaryKey": false,
99
+ "notNull": false,
100
+ "autoincrement": false
101
+ },
102
+ "version": {
103
+ "name": "version",
104
+ "type": "integer",
105
+ "primaryKey": false,
106
+ "notNull": true,
107
+ "autoincrement": false,
108
+ "default": 0
109
+ }
110
+ },
111
+ "indexes": {
112
+ "access_tokens_token_hash_unique": {
113
+ "name": "access_tokens_token_hash_unique",
114
+ "columns": [
115
+ "token_hash"
116
+ ],
117
+ "isUnique": true
118
+ }
119
+ },
120
+ "foreignKeys": {
121
+ "access_tokens_user_id_users_id_fk": {
122
+ "name": "access_tokens_user_id_users_id_fk",
123
+ "tableFrom": "access_tokens",
124
+ "tableTo": "users",
125
+ "columnsFrom": [
126
+ "user_id"
127
+ ],
128
+ "columnsTo": [
129
+ "id"
130
+ ],
131
+ "onDelete": "cascade",
132
+ "onUpdate": "no action"
133
+ }
134
+ },
135
+ "compositePrimaryKeys": {},
136
+ "uniqueConstraints": {},
137
+ "checkConstraints": {}
138
+ },
139
+ "accounts": {
140
+ "name": "accounts",
141
+ "columns": {
142
+ "id": {
143
+ "name": "id",
144
+ "type": "text",
145
+ "primaryKey": true,
146
+ "notNull": true,
147
+ "autoincrement": false
148
+ },
149
+ "name": {
150
+ "name": "name",
151
+ "type": "text",
152
+ "primaryKey": false,
153
+ "notNull": true,
154
+ "autoincrement": false
155
+ },
156
+ "type": {
157
+ "name": "type",
158
+ "type": "text",
159
+ "primaryKey": false,
160
+ "notNull": true,
161
+ "autoincrement": false
162
+ },
163
+ "initial_balance": {
164
+ "name": "initial_balance",
165
+ "type": "real",
166
+ "primaryKey": false,
167
+ "notNull": true,
168
+ "autoincrement": false,
169
+ "default": 0
170
+ },
171
+ "currency": {
172
+ "name": "currency",
173
+ "type": "text",
174
+ "primaryKey": false,
175
+ "notNull": true,
176
+ "autoincrement": false
177
+ },
178
+ "version": {
179
+ "name": "version",
180
+ "type": "integer",
181
+ "primaryKey": false,
182
+ "notNull": true,
183
+ "autoincrement": false,
184
+ "default": 0
185
+ },
186
+ "user_id": {
187
+ "name": "user_id",
188
+ "type": "text",
189
+ "primaryKey": false,
190
+ "notNull": true,
191
+ "autoincrement": false
192
+ }
193
+ },
194
+ "indexes": {},
195
+ "foreignKeys": {
196
+ "accounts_currency_currencies_code_fk": {
197
+ "name": "accounts_currency_currencies_code_fk",
198
+ "tableFrom": "accounts",
199
+ "tableTo": "currencies",
200
+ "columnsFrom": [
201
+ "currency"
202
+ ],
203
+ "columnsTo": [
204
+ "code"
205
+ ],
206
+ "onDelete": "no action",
207
+ "onUpdate": "no action"
208
+ },
209
+ "accounts_user_id_users_id_fk": {
210
+ "name": "accounts_user_id_users_id_fk",
211
+ "tableFrom": "accounts",
212
+ "tableTo": "users",
213
+ "columnsFrom": [
214
+ "user_id"
215
+ ],
216
+ "columnsTo": [
217
+ "id"
218
+ ],
219
+ "onDelete": "restrict",
220
+ "onUpdate": "no action"
221
+ }
222
+ },
223
+ "compositePrimaryKeys": {},
224
+ "uniqueConstraints": {},
225
+ "checkConstraints": {}
226
+ },
227
+ "bills": {
228
+ "name": "bills",
229
+ "columns": {
230
+ "id": {
231
+ "name": "id",
232
+ "type": "text",
233
+ "primaryKey": true,
234
+ "notNull": true,
235
+ "autoincrement": false
236
+ },
237
+ "credit_card_id": {
238
+ "name": "credit_card_id",
239
+ "type": "text",
240
+ "primaryKey": false,
241
+ "notNull": true,
242
+ "autoincrement": false
243
+ },
244
+ "month": {
245
+ "name": "month",
246
+ "type": "integer",
247
+ "primaryKey": false,
248
+ "notNull": true,
249
+ "autoincrement": false
250
+ },
251
+ "year": {
252
+ "name": "year",
253
+ "type": "integer",
254
+ "primaryKey": false,
255
+ "notNull": true,
256
+ "autoincrement": false
257
+ },
258
+ "close_date": {
259
+ "name": "close_date",
260
+ "type": "text",
261
+ "primaryKey": false,
262
+ "notNull": true,
263
+ "autoincrement": false
264
+ },
265
+ "due_date": {
266
+ "name": "due_date",
267
+ "type": "text",
268
+ "primaryKey": false,
269
+ "notNull": true,
270
+ "autoincrement": false
271
+ },
272
+ "status": {
273
+ "name": "status",
274
+ "type": "text",
275
+ "primaryKey": false,
276
+ "notNull": true,
277
+ "autoincrement": false
278
+ },
279
+ "payment_transaction_id": {
280
+ "name": "payment_transaction_id",
281
+ "type": "text",
282
+ "primaryKey": false,
283
+ "notNull": false,
284
+ "autoincrement": false
285
+ },
286
+ "version": {
287
+ "name": "version",
288
+ "type": "integer",
289
+ "primaryKey": false,
290
+ "notNull": true,
291
+ "autoincrement": false,
292
+ "default": 0
293
+ },
294
+ "user_id": {
295
+ "name": "user_id",
296
+ "type": "text",
297
+ "primaryKey": false,
298
+ "notNull": true,
299
+ "autoincrement": false
300
+ }
301
+ },
302
+ "indexes": {
303
+ "bills_card_month_year": {
304
+ "name": "bills_card_month_year",
305
+ "columns": [
306
+ "credit_card_id",
307
+ "month",
308
+ "year"
309
+ ],
310
+ "isUnique": true
311
+ }
312
+ },
313
+ "foreignKeys": {
314
+ "bills_credit_card_id_credit_cards_id_fk": {
315
+ "name": "bills_credit_card_id_credit_cards_id_fk",
316
+ "tableFrom": "bills",
317
+ "tableTo": "credit_cards",
318
+ "columnsFrom": [
319
+ "credit_card_id"
320
+ ],
321
+ "columnsTo": [
322
+ "id"
323
+ ],
324
+ "onDelete": "no action",
325
+ "onUpdate": "no action"
326
+ },
327
+ "bills_payment_transaction_id_transactions_id_fk": {
328
+ "name": "bills_payment_transaction_id_transactions_id_fk",
329
+ "tableFrom": "bills",
330
+ "tableTo": "transactions",
331
+ "columnsFrom": [
332
+ "payment_transaction_id"
333
+ ],
334
+ "columnsTo": [
335
+ "id"
336
+ ],
337
+ "onDelete": "no action",
338
+ "onUpdate": "no action"
339
+ },
340
+ "bills_user_id_users_id_fk": {
341
+ "name": "bills_user_id_users_id_fk",
342
+ "tableFrom": "bills",
343
+ "tableTo": "users",
344
+ "columnsFrom": [
345
+ "user_id"
346
+ ],
347
+ "columnsTo": [
348
+ "id"
349
+ ],
350
+ "onDelete": "restrict",
351
+ "onUpdate": "no action"
352
+ }
353
+ },
354
+ "compositePrimaryKeys": {},
355
+ "uniqueConstraints": {},
356
+ "checkConstraints": {}
357
+ },
358
+ "budgets": {
359
+ "name": "budgets",
360
+ "columns": {
361
+ "id": {
362
+ "name": "id",
363
+ "type": "text",
364
+ "primaryKey": true,
365
+ "notNull": true,
366
+ "autoincrement": false
367
+ },
368
+ "category_id": {
369
+ "name": "category_id",
370
+ "type": "text",
371
+ "primaryKey": false,
372
+ "notNull": true,
373
+ "autoincrement": false
374
+ },
375
+ "currency": {
376
+ "name": "currency",
377
+ "type": "text",
378
+ "primaryKey": false,
379
+ "notNull": true,
380
+ "autoincrement": false
381
+ },
382
+ "limit_amount": {
383
+ "name": "limit_amount",
384
+ "type": "real",
385
+ "primaryKey": false,
386
+ "notNull": true,
387
+ "autoincrement": false
388
+ },
389
+ "period": {
390
+ "name": "period",
391
+ "type": "text",
392
+ "primaryKey": false,
393
+ "notNull": true,
394
+ "autoincrement": false,
395
+ "default": "'monthly'"
396
+ },
397
+ "version": {
398
+ "name": "version",
399
+ "type": "integer",
400
+ "primaryKey": false,
401
+ "notNull": true,
402
+ "autoincrement": false,
403
+ "default": 0
404
+ },
405
+ "user_id": {
406
+ "name": "user_id",
407
+ "type": "text",
408
+ "primaryKey": false,
409
+ "notNull": true,
410
+ "autoincrement": false
411
+ }
412
+ },
413
+ "indexes": {
414
+ "budgets_user_category_currency_period": {
415
+ "name": "budgets_user_category_currency_period",
416
+ "columns": [
417
+ "user_id",
418
+ "category_id",
419
+ "currency",
420
+ "period"
421
+ ],
422
+ "isUnique": true
423
+ }
424
+ },
425
+ "foreignKeys": {
426
+ "budgets_category_id_categories_id_fk": {
427
+ "name": "budgets_category_id_categories_id_fk",
428
+ "tableFrom": "budgets",
429
+ "tableTo": "categories",
430
+ "columnsFrom": [
431
+ "category_id"
432
+ ],
433
+ "columnsTo": [
434
+ "id"
435
+ ],
436
+ "onDelete": "no action",
437
+ "onUpdate": "no action"
438
+ },
439
+ "budgets_currency_currencies_code_fk": {
440
+ "name": "budgets_currency_currencies_code_fk",
441
+ "tableFrom": "budgets",
442
+ "tableTo": "currencies",
443
+ "columnsFrom": [
444
+ "currency"
445
+ ],
446
+ "columnsTo": [
447
+ "code"
448
+ ],
449
+ "onDelete": "no action",
450
+ "onUpdate": "no action"
451
+ },
452
+ "budgets_user_id_users_id_fk": {
453
+ "name": "budgets_user_id_users_id_fk",
454
+ "tableFrom": "budgets",
455
+ "tableTo": "users",
456
+ "columnsFrom": [
457
+ "user_id"
458
+ ],
459
+ "columnsTo": [
460
+ "id"
461
+ ],
462
+ "onDelete": "restrict",
463
+ "onUpdate": "no action"
464
+ }
465
+ },
466
+ "compositePrimaryKeys": {},
467
+ "uniqueConstraints": {},
468
+ "checkConstraints": {}
469
+ },
470
+ "categories": {
471
+ "name": "categories",
472
+ "columns": {
473
+ "id": {
474
+ "name": "id",
475
+ "type": "text",
476
+ "primaryKey": true,
477
+ "notNull": true,
478
+ "autoincrement": false
479
+ },
480
+ "name": {
481
+ "name": "name",
482
+ "type": "text",
483
+ "primaryKey": false,
484
+ "notNull": true,
485
+ "autoincrement": false
486
+ },
487
+ "kind": {
488
+ "name": "kind",
489
+ "type": "text",
490
+ "primaryKey": false,
491
+ "notNull": true,
492
+ "autoincrement": false
493
+ },
494
+ "parent_id": {
495
+ "name": "parent_id",
496
+ "type": "text",
497
+ "primaryKey": false,
498
+ "notNull": false,
499
+ "autoincrement": false
500
+ },
501
+ "names": {
502
+ "name": "names",
503
+ "type": "text",
504
+ "primaryKey": false,
505
+ "notNull": false,
506
+ "autoincrement": false
507
+ },
508
+ "version": {
509
+ "name": "version",
510
+ "type": "integer",
511
+ "primaryKey": false,
512
+ "notNull": true,
513
+ "autoincrement": false,
514
+ "default": 0
515
+ },
516
+ "user_id": {
517
+ "name": "user_id",
518
+ "type": "text",
519
+ "primaryKey": false,
520
+ "notNull": false,
521
+ "autoincrement": false
522
+ }
523
+ },
524
+ "indexes": {},
525
+ "foreignKeys": {
526
+ "categories_user_id_users_id_fk": {
527
+ "name": "categories_user_id_users_id_fk",
528
+ "tableFrom": "categories",
529
+ "tableTo": "users",
530
+ "columnsFrom": [
531
+ "user_id"
532
+ ],
533
+ "columnsTo": [
534
+ "id"
535
+ ],
536
+ "onDelete": "restrict",
537
+ "onUpdate": "no action"
538
+ },
539
+ "categories_parent_id_categories_id_fk": {
540
+ "name": "categories_parent_id_categories_id_fk",
541
+ "tableFrom": "categories",
542
+ "tableTo": "categories",
543
+ "columnsFrom": [
544
+ "parent_id"
545
+ ],
546
+ "columnsTo": [
547
+ "id"
548
+ ],
549
+ "onDelete": "no action",
550
+ "onUpdate": "no action"
551
+ }
552
+ },
553
+ "compositePrimaryKeys": {},
554
+ "uniqueConstraints": {},
555
+ "checkConstraints": {}
556
+ },
557
+ "client_grants": {
558
+ "name": "client_grants",
559
+ "columns": {
560
+ "id": {
561
+ "name": "id",
562
+ "type": "text",
563
+ "primaryKey": true,
564
+ "notNull": true,
565
+ "autoincrement": false
566
+ },
567
+ "device_code_hash": {
568
+ "name": "device_code_hash",
569
+ "type": "text",
570
+ "primaryKey": false,
571
+ "notNull": true,
572
+ "autoincrement": false
573
+ },
574
+ "user_code": {
575
+ "name": "user_code",
576
+ "type": "text",
577
+ "primaryKey": false,
578
+ "notNull": true,
579
+ "autoincrement": false
580
+ },
581
+ "client_name": {
582
+ "name": "client_name",
583
+ "type": "text",
584
+ "primaryKey": false,
585
+ "notNull": true,
586
+ "autoincrement": false
587
+ },
588
+ "client_version": {
589
+ "name": "client_version",
590
+ "type": "text",
591
+ "primaryKey": false,
592
+ "notNull": true,
593
+ "autoincrement": false
594
+ },
595
+ "profile": {
596
+ "name": "profile",
597
+ "type": "text",
598
+ "primaryKey": false,
599
+ "notNull": true,
600
+ "autoincrement": false
601
+ },
602
+ "channel": {
603
+ "name": "channel",
604
+ "type": "text",
605
+ "primaryKey": false,
606
+ "notNull": true,
607
+ "autoincrement": false,
608
+ "default": "'stdio'"
609
+ },
610
+ "hint_access": {
611
+ "name": "hint_access",
612
+ "type": "text",
613
+ "primaryKey": false,
614
+ "notNull": false,
615
+ "autoincrement": false
616
+ },
617
+ "hint_duration": {
618
+ "name": "hint_duration",
619
+ "type": "text",
620
+ "primaryKey": false,
621
+ "notNull": false,
622
+ "autoincrement": false
623
+ },
624
+ "status": {
625
+ "name": "status",
626
+ "type": "text",
627
+ "primaryKey": false,
628
+ "notNull": true,
629
+ "autoincrement": false,
630
+ "default": "'pending'"
631
+ },
632
+ "user_id": {
633
+ "name": "user_id",
634
+ "type": "text",
635
+ "primaryKey": false,
636
+ "notNull": false,
637
+ "autoincrement": false
638
+ },
639
+ "scopes": {
640
+ "name": "scopes",
641
+ "type": "text",
642
+ "primaryKey": false,
643
+ "notNull": false,
644
+ "autoincrement": false
645
+ },
646
+ "duration": {
647
+ "name": "duration",
648
+ "type": "text",
649
+ "primaryKey": false,
650
+ "notNull": false,
651
+ "autoincrement": false
652
+ },
653
+ "created_at": {
654
+ "name": "created_at",
655
+ "type": "text",
656
+ "primaryKey": false,
657
+ "notNull": true,
658
+ "autoincrement": false
659
+ },
660
+ "approved_at": {
661
+ "name": "approved_at",
662
+ "type": "text",
663
+ "primaryKey": false,
664
+ "notNull": false,
665
+ "autoincrement": false
666
+ },
667
+ "expires_at": {
668
+ "name": "expires_at",
669
+ "type": "text",
670
+ "primaryKey": false,
671
+ "notNull": true,
672
+ "autoincrement": false
673
+ },
674
+ "version": {
675
+ "name": "version",
676
+ "type": "integer",
677
+ "primaryKey": false,
678
+ "notNull": true,
679
+ "autoincrement": false,
680
+ "default": 0
681
+ }
682
+ },
683
+ "indexes": {
684
+ "client_grants_device_code_hash_unique": {
685
+ "name": "client_grants_device_code_hash_unique",
686
+ "columns": [
687
+ "device_code_hash"
688
+ ],
689
+ "isUnique": true
690
+ },
691
+ "client_grants_pending_user_code": {
692
+ "name": "client_grants_pending_user_code",
693
+ "columns": [
694
+ "user_code"
695
+ ],
696
+ "isUnique": true,
697
+ "where": "\"client_grants\".\"status\" = 'pending'"
698
+ },
699
+ "client_grants_user_code_idx": {
700
+ "name": "client_grants_user_code_idx",
701
+ "columns": [
702
+ "user_code"
703
+ ],
704
+ "isUnique": false
705
+ }
706
+ },
707
+ "foreignKeys": {
708
+ "client_grants_user_id_users_id_fk": {
709
+ "name": "client_grants_user_id_users_id_fk",
710
+ "tableFrom": "client_grants",
711
+ "tableTo": "users",
712
+ "columnsFrom": [
713
+ "user_id"
714
+ ],
715
+ "columnsTo": [
716
+ "id"
717
+ ],
718
+ "onDelete": "cascade",
719
+ "onUpdate": "no action"
720
+ }
721
+ },
722
+ "compositePrimaryKeys": {},
723
+ "uniqueConstraints": {},
724
+ "checkConstraints": {}
725
+ },
726
+ "credit_cards": {
727
+ "name": "credit_cards",
728
+ "columns": {
729
+ "id": {
730
+ "name": "id",
731
+ "type": "text",
732
+ "primaryKey": true,
733
+ "notNull": true,
734
+ "autoincrement": false
735
+ },
736
+ "name": {
737
+ "name": "name",
738
+ "type": "text",
739
+ "primaryKey": false,
740
+ "notNull": true,
741
+ "autoincrement": false
742
+ },
743
+ "closing_day": {
744
+ "name": "closing_day",
745
+ "type": "integer",
746
+ "primaryKey": false,
747
+ "notNull": true,
748
+ "autoincrement": false
749
+ },
750
+ "due_day": {
751
+ "name": "due_day",
752
+ "type": "integer",
753
+ "primaryKey": false,
754
+ "notNull": true,
755
+ "autoincrement": false
756
+ },
757
+ "limit_amount": {
758
+ "name": "limit_amount",
759
+ "type": "real",
760
+ "primaryKey": false,
761
+ "notNull": false,
762
+ "autoincrement": false
763
+ },
764
+ "currency": {
765
+ "name": "currency",
766
+ "type": "text",
767
+ "primaryKey": false,
768
+ "notNull": true,
769
+ "autoincrement": false
770
+ },
771
+ "account_id": {
772
+ "name": "account_id",
773
+ "type": "text",
774
+ "primaryKey": false,
775
+ "notNull": true,
776
+ "autoincrement": false
777
+ },
778
+ "payment_account_id": {
779
+ "name": "payment_account_id",
780
+ "type": "text",
781
+ "primaryKey": false,
782
+ "notNull": false,
783
+ "autoincrement": false
784
+ },
785
+ "version": {
786
+ "name": "version",
787
+ "type": "integer",
788
+ "primaryKey": false,
789
+ "notNull": true,
790
+ "autoincrement": false,
791
+ "default": 0
792
+ },
793
+ "user_id": {
794
+ "name": "user_id",
795
+ "type": "text",
796
+ "primaryKey": false,
797
+ "notNull": true,
798
+ "autoincrement": false
799
+ }
800
+ },
801
+ "indexes": {},
802
+ "foreignKeys": {
803
+ "credit_cards_currency_currencies_code_fk": {
804
+ "name": "credit_cards_currency_currencies_code_fk",
805
+ "tableFrom": "credit_cards",
806
+ "tableTo": "currencies",
807
+ "columnsFrom": [
808
+ "currency"
809
+ ],
810
+ "columnsTo": [
811
+ "code"
812
+ ],
813
+ "onDelete": "no action",
814
+ "onUpdate": "no action"
815
+ },
816
+ "credit_cards_account_id_accounts_id_fk": {
817
+ "name": "credit_cards_account_id_accounts_id_fk",
818
+ "tableFrom": "credit_cards",
819
+ "tableTo": "accounts",
820
+ "columnsFrom": [
821
+ "account_id"
822
+ ],
823
+ "columnsTo": [
824
+ "id"
825
+ ],
826
+ "onDelete": "no action",
827
+ "onUpdate": "no action"
828
+ },
829
+ "credit_cards_payment_account_id_accounts_id_fk": {
830
+ "name": "credit_cards_payment_account_id_accounts_id_fk",
831
+ "tableFrom": "credit_cards",
832
+ "tableTo": "accounts",
833
+ "columnsFrom": [
834
+ "payment_account_id"
835
+ ],
836
+ "columnsTo": [
837
+ "id"
838
+ ],
839
+ "onDelete": "no action",
840
+ "onUpdate": "no action"
841
+ },
842
+ "credit_cards_user_id_users_id_fk": {
843
+ "name": "credit_cards_user_id_users_id_fk",
844
+ "tableFrom": "credit_cards",
845
+ "tableTo": "users",
846
+ "columnsFrom": [
847
+ "user_id"
848
+ ],
849
+ "columnsTo": [
850
+ "id"
851
+ ],
852
+ "onDelete": "restrict",
853
+ "onUpdate": "no action"
854
+ }
855
+ },
856
+ "compositePrimaryKeys": {},
857
+ "uniqueConstraints": {},
858
+ "checkConstraints": {}
859
+ },
860
+ "currencies": {
861
+ "name": "currencies",
862
+ "columns": {
863
+ "code": {
864
+ "name": "code",
865
+ "type": "text",
866
+ "primaryKey": true,
867
+ "notNull": true,
868
+ "autoincrement": false
869
+ },
870
+ "symbol": {
871
+ "name": "symbol",
872
+ "type": "text",
873
+ "primaryKey": false,
874
+ "notNull": true,
875
+ "autoincrement": false
876
+ },
877
+ "name": {
878
+ "name": "name",
879
+ "type": "text",
880
+ "primaryKey": false,
881
+ "notNull": true,
882
+ "autoincrement": false
883
+ },
884
+ "decimals": {
885
+ "name": "decimals",
886
+ "type": "integer",
887
+ "primaryKey": false,
888
+ "notNull": true,
889
+ "autoincrement": false,
890
+ "default": 2
891
+ }
892
+ },
893
+ "indexes": {},
894
+ "foreignKeys": {},
895
+ "compositePrimaryKeys": {},
896
+ "uniqueConstraints": {},
897
+ "checkConstraints": {}
898
+ },
899
+ "currency_rates": {
900
+ "name": "currency_rates",
901
+ "columns": {
902
+ "id": {
903
+ "name": "id",
904
+ "type": "text",
905
+ "primaryKey": true,
906
+ "notNull": true,
907
+ "autoincrement": false
908
+ },
909
+ "from_code": {
910
+ "name": "from_code",
911
+ "type": "text",
912
+ "primaryKey": false,
913
+ "notNull": true,
914
+ "autoincrement": false
915
+ },
916
+ "to_code": {
917
+ "name": "to_code",
918
+ "type": "text",
919
+ "primaryKey": false,
920
+ "notNull": true,
921
+ "autoincrement": false
922
+ },
923
+ "rate": {
924
+ "name": "rate",
925
+ "type": "real",
926
+ "primaryKey": false,
927
+ "notNull": true,
928
+ "autoincrement": false
929
+ },
930
+ "as_of": {
931
+ "name": "as_of",
932
+ "type": "text",
933
+ "primaryKey": false,
934
+ "notNull": true,
935
+ "autoincrement": false
936
+ },
937
+ "source": {
938
+ "name": "source",
939
+ "type": "text",
940
+ "primaryKey": false,
941
+ "notNull": false,
942
+ "autoincrement": false
943
+ },
944
+ "version": {
945
+ "name": "version",
946
+ "type": "integer",
947
+ "primaryKey": false,
948
+ "notNull": true,
949
+ "autoincrement": false,
950
+ "default": 0
951
+ }
952
+ },
953
+ "indexes": {
954
+ "currency_rates_from_to": {
955
+ "name": "currency_rates_from_to",
956
+ "columns": [
957
+ "from_code",
958
+ "to_code"
959
+ ],
960
+ "isUnique": true
961
+ }
962
+ },
963
+ "foreignKeys": {
964
+ "currency_rates_from_code_currencies_code_fk": {
965
+ "name": "currency_rates_from_code_currencies_code_fk",
966
+ "tableFrom": "currency_rates",
967
+ "tableTo": "currencies",
968
+ "columnsFrom": [
969
+ "from_code"
970
+ ],
971
+ "columnsTo": [
972
+ "code"
973
+ ],
974
+ "onDelete": "no action",
975
+ "onUpdate": "no action"
976
+ },
977
+ "currency_rates_to_code_currencies_code_fk": {
978
+ "name": "currency_rates_to_code_currencies_code_fk",
979
+ "tableFrom": "currency_rates",
980
+ "tableTo": "currencies",
981
+ "columnsFrom": [
982
+ "to_code"
983
+ ],
984
+ "columnsTo": [
985
+ "code"
986
+ ],
987
+ "onDelete": "no action",
988
+ "onUpdate": "no action"
989
+ }
990
+ },
991
+ "compositePrimaryKeys": {},
992
+ "uniqueConstraints": {},
993
+ "checkConstraints": {}
994
+ },
995
+ "dashboards": {
996
+ "name": "dashboards",
997
+ "columns": {
998
+ "id": {
999
+ "name": "id",
1000
+ "type": "text",
1001
+ "primaryKey": true,
1002
+ "notNull": true,
1003
+ "autoincrement": false
1004
+ },
1005
+ "name": {
1006
+ "name": "name",
1007
+ "type": "text",
1008
+ "primaryKey": false,
1009
+ "notNull": true,
1010
+ "autoincrement": false
1011
+ },
1012
+ "html": {
1013
+ "name": "html",
1014
+ "type": "text",
1015
+ "primaryKey": false,
1016
+ "notNull": false,
1017
+ "autoincrement": false
1018
+ },
1019
+ "source": {
1020
+ "name": "source",
1021
+ "type": "text",
1022
+ "primaryKey": false,
1023
+ "notNull": true,
1024
+ "autoincrement": false,
1025
+ "default": "'inline'"
1026
+ },
1027
+ "path": {
1028
+ "name": "path",
1029
+ "type": "text",
1030
+ "primaryKey": false,
1031
+ "notNull": false,
1032
+ "autoincrement": false
1033
+ },
1034
+ "updated_at": {
1035
+ "name": "updated_at",
1036
+ "type": "text",
1037
+ "primaryKey": false,
1038
+ "notNull": true,
1039
+ "autoincrement": false
1040
+ },
1041
+ "version": {
1042
+ "name": "version",
1043
+ "type": "integer",
1044
+ "primaryKey": false,
1045
+ "notNull": true,
1046
+ "autoincrement": false,
1047
+ "default": 0
1048
+ },
1049
+ "user_id": {
1050
+ "name": "user_id",
1051
+ "type": "text",
1052
+ "primaryKey": false,
1053
+ "notNull": false,
1054
+ "autoincrement": false
1055
+ }
1056
+ },
1057
+ "indexes": {
1058
+ "dashboards_shared_name": {
1059
+ "name": "dashboards_shared_name",
1060
+ "columns": [
1061
+ "name"
1062
+ ],
1063
+ "isUnique": true,
1064
+ "where": "\"dashboards\".\"user_id\" IS NULL"
1065
+ },
1066
+ "dashboards_user_name": {
1067
+ "name": "dashboards_user_name",
1068
+ "columns": [
1069
+ "user_id",
1070
+ "name"
1071
+ ],
1072
+ "isUnique": true,
1073
+ "where": "\"dashboards\".\"user_id\" IS NOT NULL"
1074
+ }
1075
+ },
1076
+ "foreignKeys": {
1077
+ "dashboards_user_id_users_id_fk": {
1078
+ "name": "dashboards_user_id_users_id_fk",
1079
+ "tableFrom": "dashboards",
1080
+ "tableTo": "users",
1081
+ "columnsFrom": [
1082
+ "user_id"
1083
+ ],
1084
+ "columnsTo": [
1085
+ "id"
1086
+ ],
1087
+ "onDelete": "restrict",
1088
+ "onUpdate": "no action"
1089
+ }
1090
+ },
1091
+ "compositePrimaryKeys": {},
1092
+ "uniqueConstraints": {},
1093
+ "checkConstraints": {
1094
+ "dashboard_source_owner": {
1095
+ "name": "dashboard_source_owner",
1096
+ "value": "(\"dashboards\".\"source\" = 'file' AND \"dashboards\".\"user_id\" IS NULL) OR (\"dashboards\".\"source\" = 'inline' AND \"dashboards\".\"user_id\" IS NOT NULL)"
1097
+ },
1098
+ "dashboard_source_content": {
1099
+ "name": "dashboard_source_content",
1100
+ "value": "(\"dashboards\".\"source\" = 'inline' AND \"dashboards\".\"html\" IS NOT NULL AND \"dashboards\".\"path\" IS NULL) OR (\"dashboards\".\"source\" = 'file' AND \"dashboards\".\"html\" IS NULL AND \"dashboards\".\"path\" IS NOT NULL)"
1101
+ }
1102
+ }
1103
+ },
1104
+ "merchant_category": {
1105
+ "name": "merchant_category",
1106
+ "columns": {
1107
+ "merchant_key": {
1108
+ "name": "merchant_key",
1109
+ "type": "text",
1110
+ "primaryKey": false,
1111
+ "notNull": true,
1112
+ "autoincrement": false
1113
+ },
1114
+ "category_id": {
1115
+ "name": "category_id",
1116
+ "type": "text",
1117
+ "primaryKey": false,
1118
+ "notNull": true,
1119
+ "autoincrement": false
1120
+ },
1121
+ "weight": {
1122
+ "name": "weight",
1123
+ "type": "real",
1124
+ "primaryKey": false,
1125
+ "notNull": true,
1126
+ "autoincrement": false,
1127
+ "default": 1
1128
+ },
1129
+ "origin": {
1130
+ "name": "origin",
1131
+ "type": "text",
1132
+ "primaryKey": false,
1133
+ "notNull": true,
1134
+ "autoincrement": false
1135
+ },
1136
+ "last_seen": {
1137
+ "name": "last_seen",
1138
+ "type": "integer",
1139
+ "primaryKey": false,
1140
+ "notNull": false,
1141
+ "autoincrement": false
1142
+ },
1143
+ "user_id": {
1144
+ "name": "user_id",
1145
+ "type": "text",
1146
+ "primaryKey": false,
1147
+ "notNull": false,
1148
+ "autoincrement": false
1149
+ }
1150
+ },
1151
+ "indexes": {
1152
+ "merchant_category_shared_key": {
1153
+ "name": "merchant_category_shared_key",
1154
+ "columns": [
1155
+ "merchant_key",
1156
+ "category_id"
1157
+ ],
1158
+ "isUnique": true,
1159
+ "where": "\"merchant_category\".\"user_id\" IS NULL"
1160
+ },
1161
+ "merchant_category_user_key": {
1162
+ "name": "merchant_category_user_key",
1163
+ "columns": [
1164
+ "user_id",
1165
+ "merchant_key",
1166
+ "category_id"
1167
+ ],
1168
+ "isUnique": true,
1169
+ "where": "\"merchant_category\".\"user_id\" IS NOT NULL"
1170
+ }
1171
+ },
1172
+ "foreignKeys": {
1173
+ "merchant_category_merchant_key_merchants_key_fk": {
1174
+ "name": "merchant_category_merchant_key_merchants_key_fk",
1175
+ "tableFrom": "merchant_category",
1176
+ "tableTo": "merchants",
1177
+ "columnsFrom": [
1178
+ "merchant_key"
1179
+ ],
1180
+ "columnsTo": [
1181
+ "key"
1182
+ ],
1183
+ "onDelete": "no action",
1184
+ "onUpdate": "no action"
1185
+ },
1186
+ "merchant_category_category_id_categories_id_fk": {
1187
+ "name": "merchant_category_category_id_categories_id_fk",
1188
+ "tableFrom": "merchant_category",
1189
+ "tableTo": "categories",
1190
+ "columnsFrom": [
1191
+ "category_id"
1192
+ ],
1193
+ "columnsTo": [
1194
+ "id"
1195
+ ],
1196
+ "onDelete": "cascade",
1197
+ "onUpdate": "no action"
1198
+ },
1199
+ "merchant_category_user_id_users_id_fk": {
1200
+ "name": "merchant_category_user_id_users_id_fk",
1201
+ "tableFrom": "merchant_category",
1202
+ "tableTo": "users",
1203
+ "columnsFrom": [
1204
+ "user_id"
1205
+ ],
1206
+ "columnsTo": [
1207
+ "id"
1208
+ ],
1209
+ "onDelete": "restrict",
1210
+ "onUpdate": "no action"
1211
+ }
1212
+ },
1213
+ "compositePrimaryKeys": {},
1214
+ "uniqueConstraints": {},
1215
+ "checkConstraints": {
1216
+ "merchant_category_origin_owner": {
1217
+ "name": "merchant_category_origin_owner",
1218
+ "value": "(\"merchant_category\".\"origin\" = 'rule' AND \"merchant_category\".\"user_id\" IS NULL) OR (\"merchant_category\".\"origin\" = 'history' AND \"merchant_category\".\"user_id\" IS NOT NULL)"
1219
+ }
1220
+ }
1221
+ },
1222
+ "merchants": {
1223
+ "name": "merchants",
1224
+ "columns": {
1225
+ "key": {
1226
+ "name": "key",
1227
+ "type": "text",
1228
+ "primaryKey": true,
1229
+ "notNull": true,
1230
+ "autoincrement": false
1231
+ }
1232
+ },
1233
+ "indexes": {},
1234
+ "foreignKeys": {},
1235
+ "compositePrimaryKeys": {},
1236
+ "uniqueConstraints": {},
1237
+ "checkConstraints": {}
1238
+ },
1239
+ "recurring_rules": {
1240
+ "name": "recurring_rules",
1241
+ "columns": {
1242
+ "id": {
1243
+ "name": "id",
1244
+ "type": "text",
1245
+ "primaryKey": true,
1246
+ "notNull": true,
1247
+ "autoincrement": false
1248
+ },
1249
+ "description": {
1250
+ "name": "description",
1251
+ "type": "text",
1252
+ "primaryKey": false,
1253
+ "notNull": true,
1254
+ "autoincrement": false
1255
+ },
1256
+ "amount": {
1257
+ "name": "amount",
1258
+ "type": "real",
1259
+ "primaryKey": false,
1260
+ "notNull": true,
1261
+ "autoincrement": false
1262
+ },
1263
+ "type": {
1264
+ "name": "type",
1265
+ "type": "text",
1266
+ "primaryKey": false,
1267
+ "notNull": true,
1268
+ "autoincrement": false
1269
+ },
1270
+ "period": {
1271
+ "name": "period",
1272
+ "type": "text",
1273
+ "primaryKey": false,
1274
+ "notNull": true,
1275
+ "autoincrement": false
1276
+ },
1277
+ "next_due": {
1278
+ "name": "next_due",
1279
+ "type": "text",
1280
+ "primaryKey": false,
1281
+ "notNull": true,
1282
+ "autoincrement": false
1283
+ },
1284
+ "currency": {
1285
+ "name": "currency",
1286
+ "type": "text",
1287
+ "primaryKey": false,
1288
+ "notNull": true,
1289
+ "autoincrement": false
1290
+ },
1291
+ "account_id": {
1292
+ "name": "account_id",
1293
+ "type": "text",
1294
+ "primaryKey": false,
1295
+ "notNull": false,
1296
+ "autoincrement": false
1297
+ },
1298
+ "category_id": {
1299
+ "name": "category_id",
1300
+ "type": "text",
1301
+ "primaryKey": false,
1302
+ "notNull": false,
1303
+ "autoincrement": false
1304
+ },
1305
+ "merchant_key": {
1306
+ "name": "merchant_key",
1307
+ "type": "text",
1308
+ "primaryKey": false,
1309
+ "notNull": false,
1310
+ "autoincrement": false
1311
+ },
1312
+ "version": {
1313
+ "name": "version",
1314
+ "type": "integer",
1315
+ "primaryKey": false,
1316
+ "notNull": true,
1317
+ "autoincrement": false,
1318
+ "default": 0
1319
+ },
1320
+ "user_id": {
1321
+ "name": "user_id",
1322
+ "type": "text",
1323
+ "primaryKey": false,
1324
+ "notNull": true,
1325
+ "autoincrement": false
1326
+ }
1327
+ },
1328
+ "indexes": {},
1329
+ "foreignKeys": {
1330
+ "recurring_rules_currency_currencies_code_fk": {
1331
+ "name": "recurring_rules_currency_currencies_code_fk",
1332
+ "tableFrom": "recurring_rules",
1333
+ "tableTo": "currencies",
1334
+ "columnsFrom": [
1335
+ "currency"
1336
+ ],
1337
+ "columnsTo": [
1338
+ "code"
1339
+ ],
1340
+ "onDelete": "no action",
1341
+ "onUpdate": "no action"
1342
+ },
1343
+ "recurring_rules_account_id_accounts_id_fk": {
1344
+ "name": "recurring_rules_account_id_accounts_id_fk",
1345
+ "tableFrom": "recurring_rules",
1346
+ "tableTo": "accounts",
1347
+ "columnsFrom": [
1348
+ "account_id"
1349
+ ],
1350
+ "columnsTo": [
1351
+ "id"
1352
+ ],
1353
+ "onDelete": "no action",
1354
+ "onUpdate": "no action"
1355
+ },
1356
+ "recurring_rules_category_id_categories_id_fk": {
1357
+ "name": "recurring_rules_category_id_categories_id_fk",
1358
+ "tableFrom": "recurring_rules",
1359
+ "tableTo": "categories",
1360
+ "columnsFrom": [
1361
+ "category_id"
1362
+ ],
1363
+ "columnsTo": [
1364
+ "id"
1365
+ ],
1366
+ "onDelete": "no action",
1367
+ "onUpdate": "no action"
1368
+ },
1369
+ "recurring_rules_merchant_key_merchants_key_fk": {
1370
+ "name": "recurring_rules_merchant_key_merchants_key_fk",
1371
+ "tableFrom": "recurring_rules",
1372
+ "tableTo": "merchants",
1373
+ "columnsFrom": [
1374
+ "merchant_key"
1375
+ ],
1376
+ "columnsTo": [
1377
+ "key"
1378
+ ],
1379
+ "onDelete": "no action",
1380
+ "onUpdate": "no action"
1381
+ },
1382
+ "recurring_rules_user_id_users_id_fk": {
1383
+ "name": "recurring_rules_user_id_users_id_fk",
1384
+ "tableFrom": "recurring_rules",
1385
+ "tableTo": "users",
1386
+ "columnsFrom": [
1387
+ "user_id"
1388
+ ],
1389
+ "columnsTo": [
1390
+ "id"
1391
+ ],
1392
+ "onDelete": "restrict",
1393
+ "onUpdate": "no action"
1394
+ }
1395
+ },
1396
+ "compositePrimaryKeys": {},
1397
+ "uniqueConstraints": {},
1398
+ "checkConstraints": {}
1399
+ },
1400
+ "sessions": {
1401
+ "name": "sessions",
1402
+ "columns": {
1403
+ "id": {
1404
+ "name": "id",
1405
+ "type": "text",
1406
+ "primaryKey": true,
1407
+ "notNull": true,
1408
+ "autoincrement": false
1409
+ },
1410
+ "user_id": {
1411
+ "name": "user_id",
1412
+ "type": "text",
1413
+ "primaryKey": false,
1414
+ "notNull": true,
1415
+ "autoincrement": false
1416
+ },
1417
+ "token_hash": {
1418
+ "name": "token_hash",
1419
+ "type": "text",
1420
+ "primaryKey": false,
1421
+ "notNull": true,
1422
+ "autoincrement": false
1423
+ },
1424
+ "created_at": {
1425
+ "name": "created_at",
1426
+ "type": "text",
1427
+ "primaryKey": false,
1428
+ "notNull": true,
1429
+ "autoincrement": false
1430
+ },
1431
+ "last_seen_at": {
1432
+ "name": "last_seen_at",
1433
+ "type": "text",
1434
+ "primaryKey": false,
1435
+ "notNull": true,
1436
+ "autoincrement": false
1437
+ },
1438
+ "expires_at": {
1439
+ "name": "expires_at",
1440
+ "type": "text",
1441
+ "primaryKey": false,
1442
+ "notNull": true,
1443
+ "autoincrement": false
1444
+ },
1445
+ "version": {
1446
+ "name": "version",
1447
+ "type": "integer",
1448
+ "primaryKey": false,
1449
+ "notNull": true,
1450
+ "autoincrement": false,
1451
+ "default": 0
1452
+ }
1453
+ },
1454
+ "indexes": {
1455
+ "sessions_token_hash_unique": {
1456
+ "name": "sessions_token_hash_unique",
1457
+ "columns": [
1458
+ "token_hash"
1459
+ ],
1460
+ "isUnique": true
1461
+ }
1462
+ },
1463
+ "foreignKeys": {
1464
+ "sessions_user_id_users_id_fk": {
1465
+ "name": "sessions_user_id_users_id_fk",
1466
+ "tableFrom": "sessions",
1467
+ "tableTo": "users",
1468
+ "columnsFrom": [
1469
+ "user_id"
1470
+ ],
1471
+ "columnsTo": [
1472
+ "id"
1473
+ ],
1474
+ "onDelete": "cascade",
1475
+ "onUpdate": "no action"
1476
+ }
1477
+ },
1478
+ "compositePrimaryKeys": {},
1479
+ "uniqueConstraints": {},
1480
+ "checkConstraints": {}
1481
+ },
1482
+ "settings": {
1483
+ "name": "settings",
1484
+ "columns": {
1485
+ "id": {
1486
+ "name": "id",
1487
+ "type": "text",
1488
+ "primaryKey": true,
1489
+ "notNull": true,
1490
+ "autoincrement": false,
1491
+ "default": "'singleton'"
1492
+ },
1493
+ "version": {
1494
+ "name": "version",
1495
+ "type": "integer",
1496
+ "primaryKey": false,
1497
+ "notNull": true,
1498
+ "autoincrement": false,
1499
+ "default": 0
1500
+ }
1501
+ },
1502
+ "indexes": {},
1503
+ "foreignKeys": {},
1504
+ "compositePrimaryKeys": {},
1505
+ "uniqueConstraints": {},
1506
+ "checkConstraints": {}
1507
+ },
1508
+ "setup_codes": {
1509
+ "name": "setup_codes",
1510
+ "columns": {
1511
+ "id": {
1512
+ "name": "id",
1513
+ "type": "text",
1514
+ "primaryKey": true,
1515
+ "notNull": true,
1516
+ "autoincrement": false
1517
+ },
1518
+ "code_hash": {
1519
+ "name": "code_hash",
1520
+ "type": "text",
1521
+ "primaryKey": false,
1522
+ "notNull": true,
1523
+ "autoincrement": false
1524
+ },
1525
+ "created_at": {
1526
+ "name": "created_at",
1527
+ "type": "text",
1528
+ "primaryKey": false,
1529
+ "notNull": true,
1530
+ "autoincrement": false
1531
+ },
1532
+ "expires_at": {
1533
+ "name": "expires_at",
1534
+ "type": "text",
1535
+ "primaryKey": false,
1536
+ "notNull": true,
1537
+ "autoincrement": false
1538
+ },
1539
+ "used_at": {
1540
+ "name": "used_at",
1541
+ "type": "text",
1542
+ "primaryKey": false,
1543
+ "notNull": false,
1544
+ "autoincrement": false
1545
+ },
1546
+ "version": {
1547
+ "name": "version",
1548
+ "type": "integer",
1549
+ "primaryKey": false,
1550
+ "notNull": true,
1551
+ "autoincrement": false,
1552
+ "default": 0
1553
+ }
1554
+ },
1555
+ "indexes": {
1556
+ "setup_codes_code_hash_unique": {
1557
+ "name": "setup_codes_code_hash_unique",
1558
+ "columns": [
1559
+ "code_hash"
1560
+ ],
1561
+ "isUnique": true
1562
+ }
1563
+ },
1564
+ "foreignKeys": {},
1565
+ "compositePrimaryKeys": {},
1566
+ "uniqueConstraints": {},
1567
+ "checkConstraints": {}
1568
+ },
1569
+ "tags": {
1570
+ "name": "tags",
1571
+ "columns": {
1572
+ "id": {
1573
+ "name": "id",
1574
+ "type": "text",
1575
+ "primaryKey": true,
1576
+ "notNull": true,
1577
+ "autoincrement": false
1578
+ },
1579
+ "name": {
1580
+ "name": "name",
1581
+ "type": "text",
1582
+ "primaryKey": false,
1583
+ "notNull": true,
1584
+ "autoincrement": false
1585
+ },
1586
+ "version": {
1587
+ "name": "version",
1588
+ "type": "integer",
1589
+ "primaryKey": false,
1590
+ "notNull": true,
1591
+ "autoincrement": false,
1592
+ "default": 0
1593
+ },
1594
+ "user_id": {
1595
+ "name": "user_id",
1596
+ "type": "text",
1597
+ "primaryKey": false,
1598
+ "notNull": true,
1599
+ "autoincrement": false
1600
+ }
1601
+ },
1602
+ "indexes": {
1603
+ "tags_user_name": {
1604
+ "name": "tags_user_name",
1605
+ "columns": [
1606
+ "user_id",
1607
+ "name"
1608
+ ],
1609
+ "isUnique": true
1610
+ }
1611
+ },
1612
+ "foreignKeys": {
1613
+ "tags_user_id_users_id_fk": {
1614
+ "name": "tags_user_id_users_id_fk",
1615
+ "tableFrom": "tags",
1616
+ "tableTo": "users",
1617
+ "columnsFrom": [
1618
+ "user_id"
1619
+ ],
1620
+ "columnsTo": [
1621
+ "id"
1622
+ ],
1623
+ "onDelete": "restrict",
1624
+ "onUpdate": "no action"
1625
+ }
1626
+ },
1627
+ "compositePrimaryKeys": {},
1628
+ "uniqueConstraints": {},
1629
+ "checkConstraints": {}
1630
+ },
1631
+ "transaction_tags": {
1632
+ "name": "transaction_tags",
1633
+ "columns": {
1634
+ "transaction_id": {
1635
+ "name": "transaction_id",
1636
+ "type": "text",
1637
+ "primaryKey": false,
1638
+ "notNull": true,
1639
+ "autoincrement": false
1640
+ },
1641
+ "tag_id": {
1642
+ "name": "tag_id",
1643
+ "type": "text",
1644
+ "primaryKey": false,
1645
+ "notNull": true,
1646
+ "autoincrement": false
1647
+ }
1648
+ },
1649
+ "indexes": {},
1650
+ "foreignKeys": {
1651
+ "transaction_tags_transaction_id_transactions_id_fk": {
1652
+ "name": "transaction_tags_transaction_id_transactions_id_fk",
1653
+ "tableFrom": "transaction_tags",
1654
+ "tableTo": "transactions",
1655
+ "columnsFrom": [
1656
+ "transaction_id"
1657
+ ],
1658
+ "columnsTo": [
1659
+ "id"
1660
+ ],
1661
+ "onDelete": "cascade",
1662
+ "onUpdate": "no action"
1663
+ },
1664
+ "transaction_tags_tag_id_tags_id_fk": {
1665
+ "name": "transaction_tags_tag_id_tags_id_fk",
1666
+ "tableFrom": "transaction_tags",
1667
+ "tableTo": "tags",
1668
+ "columnsFrom": [
1669
+ "tag_id"
1670
+ ],
1671
+ "columnsTo": [
1672
+ "id"
1673
+ ],
1674
+ "onDelete": "cascade",
1675
+ "onUpdate": "no action"
1676
+ }
1677
+ },
1678
+ "compositePrimaryKeys": {
1679
+ "transaction_tags_transaction_id_tag_id_pk": {
1680
+ "columns": [
1681
+ "transaction_id",
1682
+ "tag_id"
1683
+ ],
1684
+ "name": "transaction_tags_transaction_id_tag_id_pk"
1685
+ }
1686
+ },
1687
+ "uniqueConstraints": {},
1688
+ "checkConstraints": {}
1689
+ },
1690
+ "transactions": {
1691
+ "name": "transactions",
1692
+ "columns": {
1693
+ "id": {
1694
+ "name": "id",
1695
+ "type": "text",
1696
+ "primaryKey": true,
1697
+ "notNull": true,
1698
+ "autoincrement": false
1699
+ },
1700
+ "description": {
1701
+ "name": "description",
1702
+ "type": "text",
1703
+ "primaryKey": false,
1704
+ "notNull": true,
1705
+ "autoincrement": false
1706
+ },
1707
+ "amount": {
1708
+ "name": "amount",
1709
+ "type": "real",
1710
+ "primaryKey": false,
1711
+ "notNull": true,
1712
+ "autoincrement": false
1713
+ },
1714
+ "type": {
1715
+ "name": "type",
1716
+ "type": "text",
1717
+ "primaryKey": false,
1718
+ "notNull": true,
1719
+ "autoincrement": false
1720
+ },
1721
+ "status": {
1722
+ "name": "status",
1723
+ "type": "text",
1724
+ "primaryKey": false,
1725
+ "notNull": true,
1726
+ "autoincrement": false,
1727
+ "default": "'effective'"
1728
+ },
1729
+ "date": {
1730
+ "name": "date",
1731
+ "type": "text",
1732
+ "primaryKey": false,
1733
+ "notNull": true,
1734
+ "autoincrement": false
1735
+ },
1736
+ "currency": {
1737
+ "name": "currency",
1738
+ "type": "text",
1739
+ "primaryKey": false,
1740
+ "notNull": true,
1741
+ "autoincrement": false
1742
+ },
1743
+ "source": {
1744
+ "name": "source",
1745
+ "type": "text",
1746
+ "primaryKey": false,
1747
+ "notNull": true,
1748
+ "autoincrement": false
1749
+ },
1750
+ "idempotency_key": {
1751
+ "name": "idempotency_key",
1752
+ "type": "text",
1753
+ "primaryKey": false,
1754
+ "notNull": true,
1755
+ "autoincrement": false
1756
+ },
1757
+ "classification_method": {
1758
+ "name": "classification_method",
1759
+ "type": "text",
1760
+ "primaryKey": false,
1761
+ "notNull": true,
1762
+ "autoincrement": false
1763
+ },
1764
+ "confidence": {
1765
+ "name": "confidence",
1766
+ "type": "real",
1767
+ "primaryKey": false,
1768
+ "notNull": true,
1769
+ "autoincrement": false
1770
+ },
1771
+ "raw_input": {
1772
+ "name": "raw_input",
1773
+ "type": "text",
1774
+ "primaryKey": false,
1775
+ "notNull": false,
1776
+ "autoincrement": false
1777
+ },
1778
+ "from_account_id": {
1779
+ "name": "from_account_id",
1780
+ "type": "text",
1781
+ "primaryKey": false,
1782
+ "notNull": false,
1783
+ "autoincrement": false
1784
+ },
1785
+ "to_account_id": {
1786
+ "name": "to_account_id",
1787
+ "type": "text",
1788
+ "primaryKey": false,
1789
+ "notNull": false,
1790
+ "autoincrement": false
1791
+ },
1792
+ "credit_card_id": {
1793
+ "name": "credit_card_id",
1794
+ "type": "text",
1795
+ "primaryKey": false,
1796
+ "notNull": false,
1797
+ "autoincrement": false
1798
+ },
1799
+ "category_id": {
1800
+ "name": "category_id",
1801
+ "type": "text",
1802
+ "primaryKey": false,
1803
+ "notNull": false,
1804
+ "autoincrement": false
1805
+ },
1806
+ "subcategory_id": {
1807
+ "name": "subcategory_id",
1808
+ "type": "text",
1809
+ "primaryKey": false,
1810
+ "notNull": false,
1811
+ "autoincrement": false
1812
+ },
1813
+ "merchant_key": {
1814
+ "name": "merchant_key",
1815
+ "type": "text",
1816
+ "primaryKey": false,
1817
+ "notNull": false,
1818
+ "autoincrement": false
1819
+ },
1820
+ "note": {
1821
+ "name": "note",
1822
+ "type": "text",
1823
+ "primaryKey": false,
1824
+ "notNull": false,
1825
+ "autoincrement": false
1826
+ },
1827
+ "bill_id": {
1828
+ "name": "bill_id",
1829
+ "type": "text",
1830
+ "primaryKey": false,
1831
+ "notNull": false,
1832
+ "autoincrement": false
1833
+ },
1834
+ "version": {
1835
+ "name": "version",
1836
+ "type": "integer",
1837
+ "primaryKey": false,
1838
+ "notNull": true,
1839
+ "autoincrement": false,
1840
+ "default": 0
1841
+ },
1842
+ "user_id": {
1843
+ "name": "user_id",
1844
+ "type": "text",
1845
+ "primaryKey": false,
1846
+ "notNull": true,
1847
+ "autoincrement": false
1848
+ }
1849
+ },
1850
+ "indexes": {
1851
+ "transactions_user_idempotency_key": {
1852
+ "name": "transactions_user_idempotency_key",
1853
+ "columns": [
1854
+ "user_id",
1855
+ "idempotency_key"
1856
+ ],
1857
+ "isUnique": true
1858
+ },
1859
+ "idx_transactions_user_date": {
1860
+ "name": "idx_transactions_user_date",
1861
+ "columns": [
1862
+ "user_id",
1863
+ "date"
1864
+ ],
1865
+ "isUnique": false
1866
+ },
1867
+ "idx_transactions_date": {
1868
+ "name": "idx_transactions_date",
1869
+ "columns": [
1870
+ "date"
1871
+ ],
1872
+ "isUnique": false
1873
+ },
1874
+ "idx_transactions_from_account": {
1875
+ "name": "idx_transactions_from_account",
1876
+ "columns": [
1877
+ "from_account_id"
1878
+ ],
1879
+ "isUnique": false
1880
+ },
1881
+ "idx_transactions_to_account": {
1882
+ "name": "idx_transactions_to_account",
1883
+ "columns": [
1884
+ "to_account_id"
1885
+ ],
1886
+ "isUnique": false
1887
+ },
1888
+ "idx_transactions_category": {
1889
+ "name": "idx_transactions_category",
1890
+ "columns": [
1891
+ "category_id"
1892
+ ],
1893
+ "isUnique": false
1894
+ },
1895
+ "idx_transactions_status_date": {
1896
+ "name": "idx_transactions_status_date",
1897
+ "columns": [
1898
+ "status",
1899
+ "date"
1900
+ ],
1901
+ "isUnique": false
1902
+ }
1903
+ },
1904
+ "foreignKeys": {
1905
+ "transactions_currency_currencies_code_fk": {
1906
+ "name": "transactions_currency_currencies_code_fk",
1907
+ "tableFrom": "transactions",
1908
+ "tableTo": "currencies",
1909
+ "columnsFrom": [
1910
+ "currency"
1911
+ ],
1912
+ "columnsTo": [
1913
+ "code"
1914
+ ],
1915
+ "onDelete": "no action",
1916
+ "onUpdate": "no action"
1917
+ },
1918
+ "transactions_from_account_id_accounts_id_fk": {
1919
+ "name": "transactions_from_account_id_accounts_id_fk",
1920
+ "tableFrom": "transactions",
1921
+ "tableTo": "accounts",
1922
+ "columnsFrom": [
1923
+ "from_account_id"
1924
+ ],
1925
+ "columnsTo": [
1926
+ "id"
1927
+ ],
1928
+ "onDelete": "no action",
1929
+ "onUpdate": "no action"
1930
+ },
1931
+ "transactions_to_account_id_accounts_id_fk": {
1932
+ "name": "transactions_to_account_id_accounts_id_fk",
1933
+ "tableFrom": "transactions",
1934
+ "tableTo": "accounts",
1935
+ "columnsFrom": [
1936
+ "to_account_id"
1937
+ ],
1938
+ "columnsTo": [
1939
+ "id"
1940
+ ],
1941
+ "onDelete": "no action",
1942
+ "onUpdate": "no action"
1943
+ },
1944
+ "transactions_credit_card_id_credit_cards_id_fk": {
1945
+ "name": "transactions_credit_card_id_credit_cards_id_fk",
1946
+ "tableFrom": "transactions",
1947
+ "tableTo": "credit_cards",
1948
+ "columnsFrom": [
1949
+ "credit_card_id"
1950
+ ],
1951
+ "columnsTo": [
1952
+ "id"
1953
+ ],
1954
+ "onDelete": "no action",
1955
+ "onUpdate": "no action"
1956
+ },
1957
+ "transactions_category_id_categories_id_fk": {
1958
+ "name": "transactions_category_id_categories_id_fk",
1959
+ "tableFrom": "transactions",
1960
+ "tableTo": "categories",
1961
+ "columnsFrom": [
1962
+ "category_id"
1963
+ ],
1964
+ "columnsTo": [
1965
+ "id"
1966
+ ],
1967
+ "onDelete": "no action",
1968
+ "onUpdate": "no action"
1969
+ },
1970
+ "transactions_subcategory_id_categories_id_fk": {
1971
+ "name": "transactions_subcategory_id_categories_id_fk",
1972
+ "tableFrom": "transactions",
1973
+ "tableTo": "categories",
1974
+ "columnsFrom": [
1975
+ "subcategory_id"
1976
+ ],
1977
+ "columnsTo": [
1978
+ "id"
1979
+ ],
1980
+ "onDelete": "no action",
1981
+ "onUpdate": "no action"
1982
+ },
1983
+ "transactions_merchant_key_merchants_key_fk": {
1984
+ "name": "transactions_merchant_key_merchants_key_fk",
1985
+ "tableFrom": "transactions",
1986
+ "tableTo": "merchants",
1987
+ "columnsFrom": [
1988
+ "merchant_key"
1989
+ ],
1990
+ "columnsTo": [
1991
+ "key"
1992
+ ],
1993
+ "onDelete": "no action",
1994
+ "onUpdate": "no action"
1995
+ },
1996
+ "transactions_bill_id_bills_id_fk": {
1997
+ "name": "transactions_bill_id_bills_id_fk",
1998
+ "tableFrom": "transactions",
1999
+ "tableTo": "bills",
2000
+ "columnsFrom": [
2001
+ "bill_id"
2002
+ ],
2003
+ "columnsTo": [
2004
+ "id"
2005
+ ],
2006
+ "onDelete": "no action",
2007
+ "onUpdate": "no action"
2008
+ },
2009
+ "transactions_user_id_users_id_fk": {
2010
+ "name": "transactions_user_id_users_id_fk",
2011
+ "tableFrom": "transactions",
2012
+ "tableTo": "users",
2013
+ "columnsFrom": [
2014
+ "user_id"
2015
+ ],
2016
+ "columnsTo": [
2017
+ "id"
2018
+ ],
2019
+ "onDelete": "restrict",
2020
+ "onUpdate": "no action"
2021
+ }
2022
+ },
2023
+ "compositePrimaryKeys": {},
2024
+ "uniqueConstraints": {},
2025
+ "checkConstraints": {
2026
+ "subcategory_requires_category": {
2027
+ "name": "subcategory_requires_category",
2028
+ "value": "\"transactions\".\"subcategory_id\" IS NULL OR \"transactions\".\"category_id\" IS NOT NULL"
2029
+ }
2030
+ }
2031
+ },
2032
+ "user_settings": {
2033
+ "name": "user_settings",
2034
+ "columns": {
2035
+ "user_id": {
2036
+ "name": "user_id",
2037
+ "type": "text",
2038
+ "primaryKey": true,
2039
+ "notNull": true,
2040
+ "autoincrement": false
2041
+ },
2042
+ "locale": {
2043
+ "name": "locale",
2044
+ "type": "text",
2045
+ "primaryKey": false,
2046
+ "notNull": true,
2047
+ "autoincrement": false,
2048
+ "default": "'en'"
2049
+ },
2050
+ "locale_source": {
2051
+ "name": "locale_source",
2052
+ "type": "text",
2053
+ "primaryKey": false,
2054
+ "notNull": true,
2055
+ "autoincrement": false,
2056
+ "default": "'default'"
2057
+ },
2058
+ "base_currency": {
2059
+ "name": "base_currency",
2060
+ "type": "text",
2061
+ "primaryKey": false,
2062
+ "notNull": false,
2063
+ "autoincrement": false
2064
+ },
2065
+ "version": {
2066
+ "name": "version",
2067
+ "type": "integer",
2068
+ "primaryKey": false,
2069
+ "notNull": true,
2070
+ "autoincrement": false,
2071
+ "default": 0
2072
+ }
2073
+ },
2074
+ "indexes": {},
2075
+ "foreignKeys": {
2076
+ "user_settings_user_id_users_id_fk": {
2077
+ "name": "user_settings_user_id_users_id_fk",
2078
+ "tableFrom": "user_settings",
2079
+ "tableTo": "users",
2080
+ "columnsFrom": [
2081
+ "user_id"
2082
+ ],
2083
+ "columnsTo": [
2084
+ "id"
2085
+ ],
2086
+ "onDelete": "cascade",
2087
+ "onUpdate": "no action"
2088
+ },
2089
+ "user_settings_base_currency_currencies_code_fk": {
2090
+ "name": "user_settings_base_currency_currencies_code_fk",
2091
+ "tableFrom": "user_settings",
2092
+ "tableTo": "currencies",
2093
+ "columnsFrom": [
2094
+ "base_currency"
2095
+ ],
2096
+ "columnsTo": [
2097
+ "code"
2098
+ ],
2099
+ "onDelete": "no action",
2100
+ "onUpdate": "no action"
2101
+ }
2102
+ },
2103
+ "compositePrimaryKeys": {},
2104
+ "uniqueConstraints": {},
2105
+ "checkConstraints": {}
2106
+ },
2107
+ "users": {
2108
+ "name": "users",
2109
+ "columns": {
2110
+ "id": {
2111
+ "name": "id",
2112
+ "type": "text",
2113
+ "primaryKey": true,
2114
+ "notNull": true,
2115
+ "autoincrement": false
2116
+ },
2117
+ "username": {
2118
+ "name": "username",
2119
+ "type": "text",
2120
+ "primaryKey": false,
2121
+ "notNull": false,
2122
+ "autoincrement": false
2123
+ },
2124
+ "password_hash": {
2125
+ "name": "password_hash",
2126
+ "type": "text",
2127
+ "primaryKey": false,
2128
+ "notNull": false,
2129
+ "autoincrement": false
2130
+ },
2131
+ "role": {
2132
+ "name": "role",
2133
+ "type": "text",
2134
+ "primaryKey": false,
2135
+ "notNull": true,
2136
+ "autoincrement": false
2137
+ },
2138
+ "created_at": {
2139
+ "name": "created_at",
2140
+ "type": "text",
2141
+ "primaryKey": false,
2142
+ "notNull": true,
2143
+ "autoincrement": false
2144
+ },
2145
+ "disabled_at": {
2146
+ "name": "disabled_at",
2147
+ "type": "text",
2148
+ "primaryKey": false,
2149
+ "notNull": false,
2150
+ "autoincrement": false
2151
+ },
2152
+ "version": {
2153
+ "name": "version",
2154
+ "type": "integer",
2155
+ "primaryKey": false,
2156
+ "notNull": true,
2157
+ "autoincrement": false,
2158
+ "default": 0
2159
+ }
2160
+ },
2161
+ "indexes": {
2162
+ "users_username_unique": {
2163
+ "name": "users_username_unique",
2164
+ "columns": [
2165
+ "username"
2166
+ ],
2167
+ "isUnique": true
2168
+ }
2169
+ },
2170
+ "foreignKeys": {},
2171
+ "compositePrimaryKeys": {},
2172
+ "uniqueConstraints": {},
2173
+ "checkConstraints": {}
2174
+ }
2175
+ },
2176
+ "views": {},
2177
+ "enums": {},
2178
+ "_meta": {
2179
+ "schemas": {},
2180
+ "tables": {},
2181
+ "columns": {}
2182
+ },
2183
+ "internal": {
2184
+ "indexes": {}
2185
+ }
2186
+ }