@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,1904 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "71ef2cdd-6368-42ad-84e2-6c1d9da5bdaa",
5
+ "prevId": "abda2583-4dbb-43e5-9bad-5d5c343d34f4",
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
+ },
187
+ "indexes": {},
188
+ "foreignKeys": {
189
+ "accounts_currency_currencies_code_fk": {
190
+ "name": "accounts_currency_currencies_code_fk",
191
+ "tableFrom": "accounts",
192
+ "tableTo": "currencies",
193
+ "columnsFrom": [
194
+ "currency"
195
+ ],
196
+ "columnsTo": [
197
+ "code"
198
+ ],
199
+ "onDelete": "no action",
200
+ "onUpdate": "no action"
201
+ }
202
+ },
203
+ "compositePrimaryKeys": {},
204
+ "uniqueConstraints": {},
205
+ "checkConstraints": {}
206
+ },
207
+ "bills": {
208
+ "name": "bills",
209
+ "columns": {
210
+ "id": {
211
+ "name": "id",
212
+ "type": "text",
213
+ "primaryKey": true,
214
+ "notNull": true,
215
+ "autoincrement": false
216
+ },
217
+ "credit_card_id": {
218
+ "name": "credit_card_id",
219
+ "type": "text",
220
+ "primaryKey": false,
221
+ "notNull": true,
222
+ "autoincrement": false
223
+ },
224
+ "month": {
225
+ "name": "month",
226
+ "type": "integer",
227
+ "primaryKey": false,
228
+ "notNull": true,
229
+ "autoincrement": false
230
+ },
231
+ "year": {
232
+ "name": "year",
233
+ "type": "integer",
234
+ "primaryKey": false,
235
+ "notNull": true,
236
+ "autoincrement": false
237
+ },
238
+ "close_date": {
239
+ "name": "close_date",
240
+ "type": "text",
241
+ "primaryKey": false,
242
+ "notNull": true,
243
+ "autoincrement": false
244
+ },
245
+ "due_date": {
246
+ "name": "due_date",
247
+ "type": "text",
248
+ "primaryKey": false,
249
+ "notNull": true,
250
+ "autoincrement": false
251
+ },
252
+ "status": {
253
+ "name": "status",
254
+ "type": "text",
255
+ "primaryKey": false,
256
+ "notNull": true,
257
+ "autoincrement": false
258
+ },
259
+ "payment_transaction_id": {
260
+ "name": "payment_transaction_id",
261
+ "type": "text",
262
+ "primaryKey": false,
263
+ "notNull": false,
264
+ "autoincrement": false
265
+ },
266
+ "version": {
267
+ "name": "version",
268
+ "type": "integer",
269
+ "primaryKey": false,
270
+ "notNull": true,
271
+ "autoincrement": false,
272
+ "default": 0
273
+ }
274
+ },
275
+ "indexes": {
276
+ "bills_card_month_year": {
277
+ "name": "bills_card_month_year",
278
+ "columns": [
279
+ "credit_card_id",
280
+ "month",
281
+ "year"
282
+ ],
283
+ "isUnique": true
284
+ }
285
+ },
286
+ "foreignKeys": {
287
+ "bills_credit_card_id_credit_cards_id_fk": {
288
+ "name": "bills_credit_card_id_credit_cards_id_fk",
289
+ "tableFrom": "bills",
290
+ "tableTo": "credit_cards",
291
+ "columnsFrom": [
292
+ "credit_card_id"
293
+ ],
294
+ "columnsTo": [
295
+ "id"
296
+ ],
297
+ "onDelete": "no action",
298
+ "onUpdate": "no action"
299
+ },
300
+ "bills_payment_transaction_id_transactions_id_fk": {
301
+ "name": "bills_payment_transaction_id_transactions_id_fk",
302
+ "tableFrom": "bills",
303
+ "tableTo": "transactions",
304
+ "columnsFrom": [
305
+ "payment_transaction_id"
306
+ ],
307
+ "columnsTo": [
308
+ "id"
309
+ ],
310
+ "onDelete": "no action",
311
+ "onUpdate": "no action"
312
+ }
313
+ },
314
+ "compositePrimaryKeys": {},
315
+ "uniqueConstraints": {},
316
+ "checkConstraints": {}
317
+ },
318
+ "budgets": {
319
+ "name": "budgets",
320
+ "columns": {
321
+ "id": {
322
+ "name": "id",
323
+ "type": "text",
324
+ "primaryKey": true,
325
+ "notNull": true,
326
+ "autoincrement": false
327
+ },
328
+ "category_id": {
329
+ "name": "category_id",
330
+ "type": "text",
331
+ "primaryKey": false,
332
+ "notNull": true,
333
+ "autoincrement": false
334
+ },
335
+ "currency": {
336
+ "name": "currency",
337
+ "type": "text",
338
+ "primaryKey": false,
339
+ "notNull": true,
340
+ "autoincrement": false
341
+ },
342
+ "limit_amount": {
343
+ "name": "limit_amount",
344
+ "type": "real",
345
+ "primaryKey": false,
346
+ "notNull": true,
347
+ "autoincrement": false
348
+ },
349
+ "period": {
350
+ "name": "period",
351
+ "type": "text",
352
+ "primaryKey": false,
353
+ "notNull": true,
354
+ "autoincrement": false,
355
+ "default": "'monthly'"
356
+ },
357
+ "version": {
358
+ "name": "version",
359
+ "type": "integer",
360
+ "primaryKey": false,
361
+ "notNull": true,
362
+ "autoincrement": false,
363
+ "default": 0
364
+ }
365
+ },
366
+ "indexes": {
367
+ "budgets_category_currency_period": {
368
+ "name": "budgets_category_currency_period",
369
+ "columns": [
370
+ "category_id",
371
+ "currency",
372
+ "period"
373
+ ],
374
+ "isUnique": true
375
+ }
376
+ },
377
+ "foreignKeys": {
378
+ "budgets_category_id_categories_id_fk": {
379
+ "name": "budgets_category_id_categories_id_fk",
380
+ "tableFrom": "budgets",
381
+ "tableTo": "categories",
382
+ "columnsFrom": [
383
+ "category_id"
384
+ ],
385
+ "columnsTo": [
386
+ "id"
387
+ ],
388
+ "onDelete": "no action",
389
+ "onUpdate": "no action"
390
+ },
391
+ "budgets_currency_currencies_code_fk": {
392
+ "name": "budgets_currency_currencies_code_fk",
393
+ "tableFrom": "budgets",
394
+ "tableTo": "currencies",
395
+ "columnsFrom": [
396
+ "currency"
397
+ ],
398
+ "columnsTo": [
399
+ "code"
400
+ ],
401
+ "onDelete": "no action",
402
+ "onUpdate": "no action"
403
+ }
404
+ },
405
+ "compositePrimaryKeys": {},
406
+ "uniqueConstraints": {},
407
+ "checkConstraints": {}
408
+ },
409
+ "categories": {
410
+ "name": "categories",
411
+ "columns": {
412
+ "id": {
413
+ "name": "id",
414
+ "type": "text",
415
+ "primaryKey": true,
416
+ "notNull": true,
417
+ "autoincrement": false
418
+ },
419
+ "name": {
420
+ "name": "name",
421
+ "type": "text",
422
+ "primaryKey": false,
423
+ "notNull": true,
424
+ "autoincrement": false
425
+ },
426
+ "kind": {
427
+ "name": "kind",
428
+ "type": "text",
429
+ "primaryKey": false,
430
+ "notNull": true,
431
+ "autoincrement": false
432
+ },
433
+ "parent_id": {
434
+ "name": "parent_id",
435
+ "type": "text",
436
+ "primaryKey": false,
437
+ "notNull": false,
438
+ "autoincrement": false
439
+ },
440
+ "names": {
441
+ "name": "names",
442
+ "type": "text",
443
+ "primaryKey": false,
444
+ "notNull": false,
445
+ "autoincrement": false
446
+ },
447
+ "version": {
448
+ "name": "version",
449
+ "type": "integer",
450
+ "primaryKey": false,
451
+ "notNull": true,
452
+ "autoincrement": false,
453
+ "default": 0
454
+ }
455
+ },
456
+ "indexes": {},
457
+ "foreignKeys": {
458
+ "categories_parent_id_categories_id_fk": {
459
+ "name": "categories_parent_id_categories_id_fk",
460
+ "tableFrom": "categories",
461
+ "tableTo": "categories",
462
+ "columnsFrom": [
463
+ "parent_id"
464
+ ],
465
+ "columnsTo": [
466
+ "id"
467
+ ],
468
+ "onDelete": "no action",
469
+ "onUpdate": "no action"
470
+ }
471
+ },
472
+ "compositePrimaryKeys": {},
473
+ "uniqueConstraints": {},
474
+ "checkConstraints": {}
475
+ },
476
+ "client_grants": {
477
+ "name": "client_grants",
478
+ "columns": {
479
+ "id": {
480
+ "name": "id",
481
+ "type": "text",
482
+ "primaryKey": true,
483
+ "notNull": true,
484
+ "autoincrement": false
485
+ },
486
+ "device_code_hash": {
487
+ "name": "device_code_hash",
488
+ "type": "text",
489
+ "primaryKey": false,
490
+ "notNull": true,
491
+ "autoincrement": false
492
+ },
493
+ "user_code": {
494
+ "name": "user_code",
495
+ "type": "text",
496
+ "primaryKey": false,
497
+ "notNull": true,
498
+ "autoincrement": false
499
+ },
500
+ "client_name": {
501
+ "name": "client_name",
502
+ "type": "text",
503
+ "primaryKey": false,
504
+ "notNull": true,
505
+ "autoincrement": false
506
+ },
507
+ "client_version": {
508
+ "name": "client_version",
509
+ "type": "text",
510
+ "primaryKey": false,
511
+ "notNull": true,
512
+ "autoincrement": false
513
+ },
514
+ "profile": {
515
+ "name": "profile",
516
+ "type": "text",
517
+ "primaryKey": false,
518
+ "notNull": true,
519
+ "autoincrement": false
520
+ },
521
+ "channel": {
522
+ "name": "channel",
523
+ "type": "text",
524
+ "primaryKey": false,
525
+ "notNull": true,
526
+ "autoincrement": false,
527
+ "default": "'stdio'"
528
+ },
529
+ "hint_access": {
530
+ "name": "hint_access",
531
+ "type": "text",
532
+ "primaryKey": false,
533
+ "notNull": false,
534
+ "autoincrement": false
535
+ },
536
+ "hint_duration": {
537
+ "name": "hint_duration",
538
+ "type": "text",
539
+ "primaryKey": false,
540
+ "notNull": false,
541
+ "autoincrement": false
542
+ },
543
+ "status": {
544
+ "name": "status",
545
+ "type": "text",
546
+ "primaryKey": false,
547
+ "notNull": true,
548
+ "autoincrement": false,
549
+ "default": "'pending'"
550
+ },
551
+ "user_id": {
552
+ "name": "user_id",
553
+ "type": "text",
554
+ "primaryKey": false,
555
+ "notNull": false,
556
+ "autoincrement": false
557
+ },
558
+ "scopes": {
559
+ "name": "scopes",
560
+ "type": "text",
561
+ "primaryKey": false,
562
+ "notNull": false,
563
+ "autoincrement": false
564
+ },
565
+ "duration": {
566
+ "name": "duration",
567
+ "type": "text",
568
+ "primaryKey": false,
569
+ "notNull": false,
570
+ "autoincrement": false
571
+ },
572
+ "created_at": {
573
+ "name": "created_at",
574
+ "type": "text",
575
+ "primaryKey": false,
576
+ "notNull": true,
577
+ "autoincrement": false
578
+ },
579
+ "approved_at": {
580
+ "name": "approved_at",
581
+ "type": "text",
582
+ "primaryKey": false,
583
+ "notNull": false,
584
+ "autoincrement": false
585
+ },
586
+ "expires_at": {
587
+ "name": "expires_at",
588
+ "type": "text",
589
+ "primaryKey": false,
590
+ "notNull": true,
591
+ "autoincrement": false
592
+ },
593
+ "version": {
594
+ "name": "version",
595
+ "type": "integer",
596
+ "primaryKey": false,
597
+ "notNull": true,
598
+ "autoincrement": false,
599
+ "default": 0
600
+ }
601
+ },
602
+ "indexes": {
603
+ "client_grants_device_code_hash_unique": {
604
+ "name": "client_grants_device_code_hash_unique",
605
+ "columns": [
606
+ "device_code_hash"
607
+ ],
608
+ "isUnique": true
609
+ },
610
+ "client_grants_pending_user_code": {
611
+ "name": "client_grants_pending_user_code",
612
+ "columns": [
613
+ "user_code"
614
+ ],
615
+ "isUnique": true,
616
+ "where": "\"client_grants\".\"status\" = 'pending'"
617
+ },
618
+ "client_grants_user_code_idx": {
619
+ "name": "client_grants_user_code_idx",
620
+ "columns": [
621
+ "user_code"
622
+ ],
623
+ "isUnique": false
624
+ }
625
+ },
626
+ "foreignKeys": {
627
+ "client_grants_user_id_users_id_fk": {
628
+ "name": "client_grants_user_id_users_id_fk",
629
+ "tableFrom": "client_grants",
630
+ "tableTo": "users",
631
+ "columnsFrom": [
632
+ "user_id"
633
+ ],
634
+ "columnsTo": [
635
+ "id"
636
+ ],
637
+ "onDelete": "cascade",
638
+ "onUpdate": "no action"
639
+ }
640
+ },
641
+ "compositePrimaryKeys": {},
642
+ "uniqueConstraints": {},
643
+ "checkConstraints": {}
644
+ },
645
+ "credit_cards": {
646
+ "name": "credit_cards",
647
+ "columns": {
648
+ "id": {
649
+ "name": "id",
650
+ "type": "text",
651
+ "primaryKey": true,
652
+ "notNull": true,
653
+ "autoincrement": false
654
+ },
655
+ "name": {
656
+ "name": "name",
657
+ "type": "text",
658
+ "primaryKey": false,
659
+ "notNull": true,
660
+ "autoincrement": false
661
+ },
662
+ "closing_day": {
663
+ "name": "closing_day",
664
+ "type": "integer",
665
+ "primaryKey": false,
666
+ "notNull": true,
667
+ "autoincrement": false
668
+ },
669
+ "due_day": {
670
+ "name": "due_day",
671
+ "type": "integer",
672
+ "primaryKey": false,
673
+ "notNull": true,
674
+ "autoincrement": false
675
+ },
676
+ "limit_amount": {
677
+ "name": "limit_amount",
678
+ "type": "real",
679
+ "primaryKey": false,
680
+ "notNull": false,
681
+ "autoincrement": false
682
+ },
683
+ "currency": {
684
+ "name": "currency",
685
+ "type": "text",
686
+ "primaryKey": false,
687
+ "notNull": true,
688
+ "autoincrement": false
689
+ },
690
+ "account_id": {
691
+ "name": "account_id",
692
+ "type": "text",
693
+ "primaryKey": false,
694
+ "notNull": true,
695
+ "autoincrement": false
696
+ },
697
+ "payment_account_id": {
698
+ "name": "payment_account_id",
699
+ "type": "text",
700
+ "primaryKey": false,
701
+ "notNull": false,
702
+ "autoincrement": false
703
+ },
704
+ "version": {
705
+ "name": "version",
706
+ "type": "integer",
707
+ "primaryKey": false,
708
+ "notNull": true,
709
+ "autoincrement": false,
710
+ "default": 0
711
+ }
712
+ },
713
+ "indexes": {},
714
+ "foreignKeys": {
715
+ "credit_cards_currency_currencies_code_fk": {
716
+ "name": "credit_cards_currency_currencies_code_fk",
717
+ "tableFrom": "credit_cards",
718
+ "tableTo": "currencies",
719
+ "columnsFrom": [
720
+ "currency"
721
+ ],
722
+ "columnsTo": [
723
+ "code"
724
+ ],
725
+ "onDelete": "no action",
726
+ "onUpdate": "no action"
727
+ },
728
+ "credit_cards_account_id_accounts_id_fk": {
729
+ "name": "credit_cards_account_id_accounts_id_fk",
730
+ "tableFrom": "credit_cards",
731
+ "tableTo": "accounts",
732
+ "columnsFrom": [
733
+ "account_id"
734
+ ],
735
+ "columnsTo": [
736
+ "id"
737
+ ],
738
+ "onDelete": "no action",
739
+ "onUpdate": "no action"
740
+ },
741
+ "credit_cards_payment_account_id_accounts_id_fk": {
742
+ "name": "credit_cards_payment_account_id_accounts_id_fk",
743
+ "tableFrom": "credit_cards",
744
+ "tableTo": "accounts",
745
+ "columnsFrom": [
746
+ "payment_account_id"
747
+ ],
748
+ "columnsTo": [
749
+ "id"
750
+ ],
751
+ "onDelete": "no action",
752
+ "onUpdate": "no action"
753
+ }
754
+ },
755
+ "compositePrimaryKeys": {},
756
+ "uniqueConstraints": {},
757
+ "checkConstraints": {}
758
+ },
759
+ "currencies": {
760
+ "name": "currencies",
761
+ "columns": {
762
+ "code": {
763
+ "name": "code",
764
+ "type": "text",
765
+ "primaryKey": true,
766
+ "notNull": true,
767
+ "autoincrement": false
768
+ },
769
+ "symbol": {
770
+ "name": "symbol",
771
+ "type": "text",
772
+ "primaryKey": false,
773
+ "notNull": true,
774
+ "autoincrement": false
775
+ },
776
+ "name": {
777
+ "name": "name",
778
+ "type": "text",
779
+ "primaryKey": false,
780
+ "notNull": true,
781
+ "autoincrement": false
782
+ },
783
+ "decimals": {
784
+ "name": "decimals",
785
+ "type": "integer",
786
+ "primaryKey": false,
787
+ "notNull": true,
788
+ "autoincrement": false,
789
+ "default": 2
790
+ }
791
+ },
792
+ "indexes": {},
793
+ "foreignKeys": {},
794
+ "compositePrimaryKeys": {},
795
+ "uniqueConstraints": {},
796
+ "checkConstraints": {}
797
+ },
798
+ "currency_rates": {
799
+ "name": "currency_rates",
800
+ "columns": {
801
+ "id": {
802
+ "name": "id",
803
+ "type": "text",
804
+ "primaryKey": true,
805
+ "notNull": true,
806
+ "autoincrement": false
807
+ },
808
+ "from_code": {
809
+ "name": "from_code",
810
+ "type": "text",
811
+ "primaryKey": false,
812
+ "notNull": true,
813
+ "autoincrement": false
814
+ },
815
+ "to_code": {
816
+ "name": "to_code",
817
+ "type": "text",
818
+ "primaryKey": false,
819
+ "notNull": true,
820
+ "autoincrement": false
821
+ },
822
+ "rate": {
823
+ "name": "rate",
824
+ "type": "real",
825
+ "primaryKey": false,
826
+ "notNull": true,
827
+ "autoincrement": false
828
+ },
829
+ "as_of": {
830
+ "name": "as_of",
831
+ "type": "text",
832
+ "primaryKey": false,
833
+ "notNull": true,
834
+ "autoincrement": false
835
+ },
836
+ "source": {
837
+ "name": "source",
838
+ "type": "text",
839
+ "primaryKey": false,
840
+ "notNull": false,
841
+ "autoincrement": false
842
+ },
843
+ "version": {
844
+ "name": "version",
845
+ "type": "integer",
846
+ "primaryKey": false,
847
+ "notNull": true,
848
+ "autoincrement": false,
849
+ "default": 0
850
+ }
851
+ },
852
+ "indexes": {
853
+ "currency_rates_from_to": {
854
+ "name": "currency_rates_from_to",
855
+ "columns": [
856
+ "from_code",
857
+ "to_code"
858
+ ],
859
+ "isUnique": true
860
+ }
861
+ },
862
+ "foreignKeys": {
863
+ "currency_rates_from_code_currencies_code_fk": {
864
+ "name": "currency_rates_from_code_currencies_code_fk",
865
+ "tableFrom": "currency_rates",
866
+ "tableTo": "currencies",
867
+ "columnsFrom": [
868
+ "from_code"
869
+ ],
870
+ "columnsTo": [
871
+ "code"
872
+ ],
873
+ "onDelete": "no action",
874
+ "onUpdate": "no action"
875
+ },
876
+ "currency_rates_to_code_currencies_code_fk": {
877
+ "name": "currency_rates_to_code_currencies_code_fk",
878
+ "tableFrom": "currency_rates",
879
+ "tableTo": "currencies",
880
+ "columnsFrom": [
881
+ "to_code"
882
+ ],
883
+ "columnsTo": [
884
+ "code"
885
+ ],
886
+ "onDelete": "no action",
887
+ "onUpdate": "no action"
888
+ }
889
+ },
890
+ "compositePrimaryKeys": {},
891
+ "uniqueConstraints": {},
892
+ "checkConstraints": {}
893
+ },
894
+ "dashboards": {
895
+ "name": "dashboards",
896
+ "columns": {
897
+ "id": {
898
+ "name": "id",
899
+ "type": "text",
900
+ "primaryKey": true,
901
+ "notNull": true,
902
+ "autoincrement": false
903
+ },
904
+ "name": {
905
+ "name": "name",
906
+ "type": "text",
907
+ "primaryKey": false,
908
+ "notNull": true,
909
+ "autoincrement": false
910
+ },
911
+ "html": {
912
+ "name": "html",
913
+ "type": "text",
914
+ "primaryKey": false,
915
+ "notNull": false,
916
+ "autoincrement": false
917
+ },
918
+ "source": {
919
+ "name": "source",
920
+ "type": "text",
921
+ "primaryKey": false,
922
+ "notNull": true,
923
+ "autoincrement": false,
924
+ "default": "'inline'"
925
+ },
926
+ "path": {
927
+ "name": "path",
928
+ "type": "text",
929
+ "primaryKey": false,
930
+ "notNull": false,
931
+ "autoincrement": false
932
+ },
933
+ "updated_at": {
934
+ "name": "updated_at",
935
+ "type": "text",
936
+ "primaryKey": false,
937
+ "notNull": true,
938
+ "autoincrement": false
939
+ },
940
+ "version": {
941
+ "name": "version",
942
+ "type": "integer",
943
+ "primaryKey": false,
944
+ "notNull": true,
945
+ "autoincrement": false,
946
+ "default": 0
947
+ }
948
+ },
949
+ "indexes": {
950
+ "dashboards_name_unique": {
951
+ "name": "dashboards_name_unique",
952
+ "columns": [
953
+ "name"
954
+ ],
955
+ "isUnique": true
956
+ }
957
+ },
958
+ "foreignKeys": {},
959
+ "compositePrimaryKeys": {},
960
+ "uniqueConstraints": {},
961
+ "checkConstraints": {
962
+ "dashboard_source_content": {
963
+ "name": "dashboard_source_content",
964
+ "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)"
965
+ }
966
+ }
967
+ },
968
+ "merchant_category": {
969
+ "name": "merchant_category",
970
+ "columns": {
971
+ "merchant_key": {
972
+ "name": "merchant_key",
973
+ "type": "text",
974
+ "primaryKey": false,
975
+ "notNull": true,
976
+ "autoincrement": false
977
+ },
978
+ "category_id": {
979
+ "name": "category_id",
980
+ "type": "text",
981
+ "primaryKey": false,
982
+ "notNull": true,
983
+ "autoincrement": false
984
+ },
985
+ "weight": {
986
+ "name": "weight",
987
+ "type": "real",
988
+ "primaryKey": false,
989
+ "notNull": true,
990
+ "autoincrement": false,
991
+ "default": 1
992
+ },
993
+ "origin": {
994
+ "name": "origin",
995
+ "type": "text",
996
+ "primaryKey": false,
997
+ "notNull": true,
998
+ "autoincrement": false
999
+ },
1000
+ "last_seen": {
1001
+ "name": "last_seen",
1002
+ "type": "integer",
1003
+ "primaryKey": false,
1004
+ "notNull": false,
1005
+ "autoincrement": false
1006
+ }
1007
+ },
1008
+ "indexes": {},
1009
+ "foreignKeys": {
1010
+ "merchant_category_merchant_key_merchants_key_fk": {
1011
+ "name": "merchant_category_merchant_key_merchants_key_fk",
1012
+ "tableFrom": "merchant_category",
1013
+ "tableTo": "merchants",
1014
+ "columnsFrom": [
1015
+ "merchant_key"
1016
+ ],
1017
+ "columnsTo": [
1018
+ "key"
1019
+ ],
1020
+ "onDelete": "no action",
1021
+ "onUpdate": "no action"
1022
+ },
1023
+ "merchant_category_category_id_categories_id_fk": {
1024
+ "name": "merchant_category_category_id_categories_id_fk",
1025
+ "tableFrom": "merchant_category",
1026
+ "tableTo": "categories",
1027
+ "columnsFrom": [
1028
+ "category_id"
1029
+ ],
1030
+ "columnsTo": [
1031
+ "id"
1032
+ ],
1033
+ "onDelete": "cascade",
1034
+ "onUpdate": "no action"
1035
+ }
1036
+ },
1037
+ "compositePrimaryKeys": {
1038
+ "merchant_category_merchant_key_category_id_pk": {
1039
+ "columns": [
1040
+ "merchant_key",
1041
+ "category_id"
1042
+ ],
1043
+ "name": "merchant_category_merchant_key_category_id_pk"
1044
+ }
1045
+ },
1046
+ "uniqueConstraints": {},
1047
+ "checkConstraints": {}
1048
+ },
1049
+ "merchants": {
1050
+ "name": "merchants",
1051
+ "columns": {
1052
+ "key": {
1053
+ "name": "key",
1054
+ "type": "text",
1055
+ "primaryKey": true,
1056
+ "notNull": true,
1057
+ "autoincrement": false
1058
+ }
1059
+ },
1060
+ "indexes": {},
1061
+ "foreignKeys": {},
1062
+ "compositePrimaryKeys": {},
1063
+ "uniqueConstraints": {},
1064
+ "checkConstraints": {}
1065
+ },
1066
+ "recurring_rules": {
1067
+ "name": "recurring_rules",
1068
+ "columns": {
1069
+ "id": {
1070
+ "name": "id",
1071
+ "type": "text",
1072
+ "primaryKey": true,
1073
+ "notNull": true,
1074
+ "autoincrement": false
1075
+ },
1076
+ "description": {
1077
+ "name": "description",
1078
+ "type": "text",
1079
+ "primaryKey": false,
1080
+ "notNull": true,
1081
+ "autoincrement": false
1082
+ },
1083
+ "amount": {
1084
+ "name": "amount",
1085
+ "type": "real",
1086
+ "primaryKey": false,
1087
+ "notNull": true,
1088
+ "autoincrement": false
1089
+ },
1090
+ "type": {
1091
+ "name": "type",
1092
+ "type": "text",
1093
+ "primaryKey": false,
1094
+ "notNull": true,
1095
+ "autoincrement": false
1096
+ },
1097
+ "period": {
1098
+ "name": "period",
1099
+ "type": "text",
1100
+ "primaryKey": false,
1101
+ "notNull": true,
1102
+ "autoincrement": false
1103
+ },
1104
+ "next_due": {
1105
+ "name": "next_due",
1106
+ "type": "text",
1107
+ "primaryKey": false,
1108
+ "notNull": true,
1109
+ "autoincrement": false
1110
+ },
1111
+ "currency": {
1112
+ "name": "currency",
1113
+ "type": "text",
1114
+ "primaryKey": false,
1115
+ "notNull": true,
1116
+ "autoincrement": false
1117
+ },
1118
+ "account_id": {
1119
+ "name": "account_id",
1120
+ "type": "text",
1121
+ "primaryKey": false,
1122
+ "notNull": false,
1123
+ "autoincrement": false
1124
+ },
1125
+ "category_id": {
1126
+ "name": "category_id",
1127
+ "type": "text",
1128
+ "primaryKey": false,
1129
+ "notNull": false,
1130
+ "autoincrement": false
1131
+ },
1132
+ "merchant_key": {
1133
+ "name": "merchant_key",
1134
+ "type": "text",
1135
+ "primaryKey": false,
1136
+ "notNull": false,
1137
+ "autoincrement": false
1138
+ },
1139
+ "version": {
1140
+ "name": "version",
1141
+ "type": "integer",
1142
+ "primaryKey": false,
1143
+ "notNull": true,
1144
+ "autoincrement": false,
1145
+ "default": 0
1146
+ }
1147
+ },
1148
+ "indexes": {},
1149
+ "foreignKeys": {
1150
+ "recurring_rules_currency_currencies_code_fk": {
1151
+ "name": "recurring_rules_currency_currencies_code_fk",
1152
+ "tableFrom": "recurring_rules",
1153
+ "tableTo": "currencies",
1154
+ "columnsFrom": [
1155
+ "currency"
1156
+ ],
1157
+ "columnsTo": [
1158
+ "code"
1159
+ ],
1160
+ "onDelete": "no action",
1161
+ "onUpdate": "no action"
1162
+ },
1163
+ "recurring_rules_account_id_accounts_id_fk": {
1164
+ "name": "recurring_rules_account_id_accounts_id_fk",
1165
+ "tableFrom": "recurring_rules",
1166
+ "tableTo": "accounts",
1167
+ "columnsFrom": [
1168
+ "account_id"
1169
+ ],
1170
+ "columnsTo": [
1171
+ "id"
1172
+ ],
1173
+ "onDelete": "no action",
1174
+ "onUpdate": "no action"
1175
+ },
1176
+ "recurring_rules_category_id_categories_id_fk": {
1177
+ "name": "recurring_rules_category_id_categories_id_fk",
1178
+ "tableFrom": "recurring_rules",
1179
+ "tableTo": "categories",
1180
+ "columnsFrom": [
1181
+ "category_id"
1182
+ ],
1183
+ "columnsTo": [
1184
+ "id"
1185
+ ],
1186
+ "onDelete": "no action",
1187
+ "onUpdate": "no action"
1188
+ },
1189
+ "recurring_rules_merchant_key_merchants_key_fk": {
1190
+ "name": "recurring_rules_merchant_key_merchants_key_fk",
1191
+ "tableFrom": "recurring_rules",
1192
+ "tableTo": "merchants",
1193
+ "columnsFrom": [
1194
+ "merchant_key"
1195
+ ],
1196
+ "columnsTo": [
1197
+ "key"
1198
+ ],
1199
+ "onDelete": "no action",
1200
+ "onUpdate": "no action"
1201
+ }
1202
+ },
1203
+ "compositePrimaryKeys": {},
1204
+ "uniqueConstraints": {},
1205
+ "checkConstraints": {}
1206
+ },
1207
+ "sessions": {
1208
+ "name": "sessions",
1209
+ "columns": {
1210
+ "id": {
1211
+ "name": "id",
1212
+ "type": "text",
1213
+ "primaryKey": true,
1214
+ "notNull": true,
1215
+ "autoincrement": false
1216
+ },
1217
+ "user_id": {
1218
+ "name": "user_id",
1219
+ "type": "text",
1220
+ "primaryKey": false,
1221
+ "notNull": true,
1222
+ "autoincrement": false
1223
+ },
1224
+ "token_hash": {
1225
+ "name": "token_hash",
1226
+ "type": "text",
1227
+ "primaryKey": false,
1228
+ "notNull": true,
1229
+ "autoincrement": false
1230
+ },
1231
+ "created_at": {
1232
+ "name": "created_at",
1233
+ "type": "text",
1234
+ "primaryKey": false,
1235
+ "notNull": true,
1236
+ "autoincrement": false
1237
+ },
1238
+ "last_seen_at": {
1239
+ "name": "last_seen_at",
1240
+ "type": "text",
1241
+ "primaryKey": false,
1242
+ "notNull": true,
1243
+ "autoincrement": false
1244
+ },
1245
+ "expires_at": {
1246
+ "name": "expires_at",
1247
+ "type": "text",
1248
+ "primaryKey": false,
1249
+ "notNull": true,
1250
+ "autoincrement": false
1251
+ },
1252
+ "version": {
1253
+ "name": "version",
1254
+ "type": "integer",
1255
+ "primaryKey": false,
1256
+ "notNull": true,
1257
+ "autoincrement": false,
1258
+ "default": 0
1259
+ }
1260
+ },
1261
+ "indexes": {
1262
+ "sessions_token_hash_unique": {
1263
+ "name": "sessions_token_hash_unique",
1264
+ "columns": [
1265
+ "token_hash"
1266
+ ],
1267
+ "isUnique": true
1268
+ }
1269
+ },
1270
+ "foreignKeys": {
1271
+ "sessions_user_id_users_id_fk": {
1272
+ "name": "sessions_user_id_users_id_fk",
1273
+ "tableFrom": "sessions",
1274
+ "tableTo": "users",
1275
+ "columnsFrom": [
1276
+ "user_id"
1277
+ ],
1278
+ "columnsTo": [
1279
+ "id"
1280
+ ],
1281
+ "onDelete": "cascade",
1282
+ "onUpdate": "no action"
1283
+ }
1284
+ },
1285
+ "compositePrimaryKeys": {},
1286
+ "uniqueConstraints": {},
1287
+ "checkConstraints": {}
1288
+ },
1289
+ "settings": {
1290
+ "name": "settings",
1291
+ "columns": {
1292
+ "id": {
1293
+ "name": "id",
1294
+ "type": "text",
1295
+ "primaryKey": true,
1296
+ "notNull": true,
1297
+ "autoincrement": false,
1298
+ "default": "'singleton'"
1299
+ },
1300
+ "locale": {
1301
+ "name": "locale",
1302
+ "type": "text",
1303
+ "primaryKey": false,
1304
+ "notNull": true,
1305
+ "autoincrement": false,
1306
+ "default": "'en'"
1307
+ },
1308
+ "locale_source": {
1309
+ "name": "locale_source",
1310
+ "type": "text",
1311
+ "primaryKey": false,
1312
+ "notNull": true,
1313
+ "autoincrement": false,
1314
+ "default": "'default'"
1315
+ },
1316
+ "base_currency": {
1317
+ "name": "base_currency",
1318
+ "type": "text",
1319
+ "primaryKey": false,
1320
+ "notNull": false,
1321
+ "autoincrement": false
1322
+ },
1323
+ "version": {
1324
+ "name": "version",
1325
+ "type": "integer",
1326
+ "primaryKey": false,
1327
+ "notNull": true,
1328
+ "autoincrement": false,
1329
+ "default": 0
1330
+ }
1331
+ },
1332
+ "indexes": {},
1333
+ "foreignKeys": {
1334
+ "settings_base_currency_currencies_code_fk": {
1335
+ "name": "settings_base_currency_currencies_code_fk",
1336
+ "tableFrom": "settings",
1337
+ "tableTo": "currencies",
1338
+ "columnsFrom": [
1339
+ "base_currency"
1340
+ ],
1341
+ "columnsTo": [
1342
+ "code"
1343
+ ],
1344
+ "onDelete": "no action",
1345
+ "onUpdate": "no action"
1346
+ }
1347
+ },
1348
+ "compositePrimaryKeys": {},
1349
+ "uniqueConstraints": {},
1350
+ "checkConstraints": {}
1351
+ },
1352
+ "setup_codes": {
1353
+ "name": "setup_codes",
1354
+ "columns": {
1355
+ "id": {
1356
+ "name": "id",
1357
+ "type": "text",
1358
+ "primaryKey": true,
1359
+ "notNull": true,
1360
+ "autoincrement": false
1361
+ },
1362
+ "code_hash": {
1363
+ "name": "code_hash",
1364
+ "type": "text",
1365
+ "primaryKey": false,
1366
+ "notNull": true,
1367
+ "autoincrement": false
1368
+ },
1369
+ "created_at": {
1370
+ "name": "created_at",
1371
+ "type": "text",
1372
+ "primaryKey": false,
1373
+ "notNull": true,
1374
+ "autoincrement": false
1375
+ },
1376
+ "expires_at": {
1377
+ "name": "expires_at",
1378
+ "type": "text",
1379
+ "primaryKey": false,
1380
+ "notNull": true,
1381
+ "autoincrement": false
1382
+ },
1383
+ "used_at": {
1384
+ "name": "used_at",
1385
+ "type": "text",
1386
+ "primaryKey": false,
1387
+ "notNull": false,
1388
+ "autoincrement": false
1389
+ },
1390
+ "version": {
1391
+ "name": "version",
1392
+ "type": "integer",
1393
+ "primaryKey": false,
1394
+ "notNull": true,
1395
+ "autoincrement": false,
1396
+ "default": 0
1397
+ }
1398
+ },
1399
+ "indexes": {
1400
+ "setup_codes_code_hash_unique": {
1401
+ "name": "setup_codes_code_hash_unique",
1402
+ "columns": [
1403
+ "code_hash"
1404
+ ],
1405
+ "isUnique": true
1406
+ }
1407
+ },
1408
+ "foreignKeys": {},
1409
+ "compositePrimaryKeys": {},
1410
+ "uniqueConstraints": {},
1411
+ "checkConstraints": {}
1412
+ },
1413
+ "tags": {
1414
+ "name": "tags",
1415
+ "columns": {
1416
+ "id": {
1417
+ "name": "id",
1418
+ "type": "text",
1419
+ "primaryKey": true,
1420
+ "notNull": true,
1421
+ "autoincrement": false
1422
+ },
1423
+ "name": {
1424
+ "name": "name",
1425
+ "type": "text",
1426
+ "primaryKey": false,
1427
+ "notNull": true,
1428
+ "autoincrement": false
1429
+ },
1430
+ "version": {
1431
+ "name": "version",
1432
+ "type": "integer",
1433
+ "primaryKey": false,
1434
+ "notNull": true,
1435
+ "autoincrement": false,
1436
+ "default": 0
1437
+ }
1438
+ },
1439
+ "indexes": {
1440
+ "tags_name_unique": {
1441
+ "name": "tags_name_unique",
1442
+ "columns": [
1443
+ "name"
1444
+ ],
1445
+ "isUnique": true
1446
+ }
1447
+ },
1448
+ "foreignKeys": {},
1449
+ "compositePrimaryKeys": {},
1450
+ "uniqueConstraints": {},
1451
+ "checkConstraints": {}
1452
+ },
1453
+ "transaction_tags": {
1454
+ "name": "transaction_tags",
1455
+ "columns": {
1456
+ "transaction_id": {
1457
+ "name": "transaction_id",
1458
+ "type": "text",
1459
+ "primaryKey": false,
1460
+ "notNull": true,
1461
+ "autoincrement": false
1462
+ },
1463
+ "tag_id": {
1464
+ "name": "tag_id",
1465
+ "type": "text",
1466
+ "primaryKey": false,
1467
+ "notNull": true,
1468
+ "autoincrement": false
1469
+ }
1470
+ },
1471
+ "indexes": {},
1472
+ "foreignKeys": {
1473
+ "transaction_tags_transaction_id_transactions_id_fk": {
1474
+ "name": "transaction_tags_transaction_id_transactions_id_fk",
1475
+ "tableFrom": "transaction_tags",
1476
+ "tableTo": "transactions",
1477
+ "columnsFrom": [
1478
+ "transaction_id"
1479
+ ],
1480
+ "columnsTo": [
1481
+ "id"
1482
+ ],
1483
+ "onDelete": "cascade",
1484
+ "onUpdate": "no action"
1485
+ },
1486
+ "transaction_tags_tag_id_tags_id_fk": {
1487
+ "name": "transaction_tags_tag_id_tags_id_fk",
1488
+ "tableFrom": "transaction_tags",
1489
+ "tableTo": "tags",
1490
+ "columnsFrom": [
1491
+ "tag_id"
1492
+ ],
1493
+ "columnsTo": [
1494
+ "id"
1495
+ ],
1496
+ "onDelete": "cascade",
1497
+ "onUpdate": "no action"
1498
+ }
1499
+ },
1500
+ "compositePrimaryKeys": {
1501
+ "transaction_tags_transaction_id_tag_id_pk": {
1502
+ "columns": [
1503
+ "transaction_id",
1504
+ "tag_id"
1505
+ ],
1506
+ "name": "transaction_tags_transaction_id_tag_id_pk"
1507
+ }
1508
+ },
1509
+ "uniqueConstraints": {},
1510
+ "checkConstraints": {}
1511
+ },
1512
+ "transactions": {
1513
+ "name": "transactions",
1514
+ "columns": {
1515
+ "id": {
1516
+ "name": "id",
1517
+ "type": "text",
1518
+ "primaryKey": true,
1519
+ "notNull": true,
1520
+ "autoincrement": false
1521
+ },
1522
+ "description": {
1523
+ "name": "description",
1524
+ "type": "text",
1525
+ "primaryKey": false,
1526
+ "notNull": true,
1527
+ "autoincrement": false
1528
+ },
1529
+ "amount": {
1530
+ "name": "amount",
1531
+ "type": "real",
1532
+ "primaryKey": false,
1533
+ "notNull": true,
1534
+ "autoincrement": false
1535
+ },
1536
+ "type": {
1537
+ "name": "type",
1538
+ "type": "text",
1539
+ "primaryKey": false,
1540
+ "notNull": true,
1541
+ "autoincrement": false
1542
+ },
1543
+ "status": {
1544
+ "name": "status",
1545
+ "type": "text",
1546
+ "primaryKey": false,
1547
+ "notNull": true,
1548
+ "autoincrement": false,
1549
+ "default": "'effective'"
1550
+ },
1551
+ "date": {
1552
+ "name": "date",
1553
+ "type": "text",
1554
+ "primaryKey": false,
1555
+ "notNull": true,
1556
+ "autoincrement": false
1557
+ },
1558
+ "currency": {
1559
+ "name": "currency",
1560
+ "type": "text",
1561
+ "primaryKey": false,
1562
+ "notNull": true,
1563
+ "autoincrement": false
1564
+ },
1565
+ "source": {
1566
+ "name": "source",
1567
+ "type": "text",
1568
+ "primaryKey": false,
1569
+ "notNull": true,
1570
+ "autoincrement": false
1571
+ },
1572
+ "idempotency_key": {
1573
+ "name": "idempotency_key",
1574
+ "type": "text",
1575
+ "primaryKey": false,
1576
+ "notNull": true,
1577
+ "autoincrement": false
1578
+ },
1579
+ "classification_method": {
1580
+ "name": "classification_method",
1581
+ "type": "text",
1582
+ "primaryKey": false,
1583
+ "notNull": true,
1584
+ "autoincrement": false
1585
+ },
1586
+ "confidence": {
1587
+ "name": "confidence",
1588
+ "type": "real",
1589
+ "primaryKey": false,
1590
+ "notNull": true,
1591
+ "autoincrement": false
1592
+ },
1593
+ "raw_input": {
1594
+ "name": "raw_input",
1595
+ "type": "text",
1596
+ "primaryKey": false,
1597
+ "notNull": false,
1598
+ "autoincrement": false
1599
+ },
1600
+ "from_account_id": {
1601
+ "name": "from_account_id",
1602
+ "type": "text",
1603
+ "primaryKey": false,
1604
+ "notNull": false,
1605
+ "autoincrement": false
1606
+ },
1607
+ "to_account_id": {
1608
+ "name": "to_account_id",
1609
+ "type": "text",
1610
+ "primaryKey": false,
1611
+ "notNull": false,
1612
+ "autoincrement": false
1613
+ },
1614
+ "credit_card_id": {
1615
+ "name": "credit_card_id",
1616
+ "type": "text",
1617
+ "primaryKey": false,
1618
+ "notNull": false,
1619
+ "autoincrement": false
1620
+ },
1621
+ "category_id": {
1622
+ "name": "category_id",
1623
+ "type": "text",
1624
+ "primaryKey": false,
1625
+ "notNull": false,
1626
+ "autoincrement": false
1627
+ },
1628
+ "subcategory_id": {
1629
+ "name": "subcategory_id",
1630
+ "type": "text",
1631
+ "primaryKey": false,
1632
+ "notNull": false,
1633
+ "autoincrement": false
1634
+ },
1635
+ "merchant_key": {
1636
+ "name": "merchant_key",
1637
+ "type": "text",
1638
+ "primaryKey": false,
1639
+ "notNull": false,
1640
+ "autoincrement": false
1641
+ },
1642
+ "note": {
1643
+ "name": "note",
1644
+ "type": "text",
1645
+ "primaryKey": false,
1646
+ "notNull": false,
1647
+ "autoincrement": false
1648
+ },
1649
+ "bill_id": {
1650
+ "name": "bill_id",
1651
+ "type": "text",
1652
+ "primaryKey": false,
1653
+ "notNull": false,
1654
+ "autoincrement": false
1655
+ },
1656
+ "version": {
1657
+ "name": "version",
1658
+ "type": "integer",
1659
+ "primaryKey": false,
1660
+ "notNull": true,
1661
+ "autoincrement": false,
1662
+ "default": 0
1663
+ }
1664
+ },
1665
+ "indexes": {
1666
+ "transactions_idempotency_key_unique": {
1667
+ "name": "transactions_idempotency_key_unique",
1668
+ "columns": [
1669
+ "idempotency_key"
1670
+ ],
1671
+ "isUnique": true
1672
+ },
1673
+ "idx_transactions_date": {
1674
+ "name": "idx_transactions_date",
1675
+ "columns": [
1676
+ "date"
1677
+ ],
1678
+ "isUnique": false
1679
+ },
1680
+ "idx_transactions_from_account": {
1681
+ "name": "idx_transactions_from_account",
1682
+ "columns": [
1683
+ "from_account_id"
1684
+ ],
1685
+ "isUnique": false
1686
+ },
1687
+ "idx_transactions_to_account": {
1688
+ "name": "idx_transactions_to_account",
1689
+ "columns": [
1690
+ "to_account_id"
1691
+ ],
1692
+ "isUnique": false
1693
+ },
1694
+ "idx_transactions_category": {
1695
+ "name": "idx_transactions_category",
1696
+ "columns": [
1697
+ "category_id"
1698
+ ],
1699
+ "isUnique": false
1700
+ },
1701
+ "idx_transactions_status_date": {
1702
+ "name": "idx_transactions_status_date",
1703
+ "columns": [
1704
+ "status",
1705
+ "date"
1706
+ ],
1707
+ "isUnique": false
1708
+ }
1709
+ },
1710
+ "foreignKeys": {
1711
+ "transactions_currency_currencies_code_fk": {
1712
+ "name": "transactions_currency_currencies_code_fk",
1713
+ "tableFrom": "transactions",
1714
+ "tableTo": "currencies",
1715
+ "columnsFrom": [
1716
+ "currency"
1717
+ ],
1718
+ "columnsTo": [
1719
+ "code"
1720
+ ],
1721
+ "onDelete": "no action",
1722
+ "onUpdate": "no action"
1723
+ },
1724
+ "transactions_from_account_id_accounts_id_fk": {
1725
+ "name": "transactions_from_account_id_accounts_id_fk",
1726
+ "tableFrom": "transactions",
1727
+ "tableTo": "accounts",
1728
+ "columnsFrom": [
1729
+ "from_account_id"
1730
+ ],
1731
+ "columnsTo": [
1732
+ "id"
1733
+ ],
1734
+ "onDelete": "no action",
1735
+ "onUpdate": "no action"
1736
+ },
1737
+ "transactions_to_account_id_accounts_id_fk": {
1738
+ "name": "transactions_to_account_id_accounts_id_fk",
1739
+ "tableFrom": "transactions",
1740
+ "tableTo": "accounts",
1741
+ "columnsFrom": [
1742
+ "to_account_id"
1743
+ ],
1744
+ "columnsTo": [
1745
+ "id"
1746
+ ],
1747
+ "onDelete": "no action",
1748
+ "onUpdate": "no action"
1749
+ },
1750
+ "transactions_credit_card_id_credit_cards_id_fk": {
1751
+ "name": "transactions_credit_card_id_credit_cards_id_fk",
1752
+ "tableFrom": "transactions",
1753
+ "tableTo": "credit_cards",
1754
+ "columnsFrom": [
1755
+ "credit_card_id"
1756
+ ],
1757
+ "columnsTo": [
1758
+ "id"
1759
+ ],
1760
+ "onDelete": "no action",
1761
+ "onUpdate": "no action"
1762
+ },
1763
+ "transactions_category_id_categories_id_fk": {
1764
+ "name": "transactions_category_id_categories_id_fk",
1765
+ "tableFrom": "transactions",
1766
+ "tableTo": "categories",
1767
+ "columnsFrom": [
1768
+ "category_id"
1769
+ ],
1770
+ "columnsTo": [
1771
+ "id"
1772
+ ],
1773
+ "onDelete": "no action",
1774
+ "onUpdate": "no action"
1775
+ },
1776
+ "transactions_subcategory_id_categories_id_fk": {
1777
+ "name": "transactions_subcategory_id_categories_id_fk",
1778
+ "tableFrom": "transactions",
1779
+ "tableTo": "categories",
1780
+ "columnsFrom": [
1781
+ "subcategory_id"
1782
+ ],
1783
+ "columnsTo": [
1784
+ "id"
1785
+ ],
1786
+ "onDelete": "no action",
1787
+ "onUpdate": "no action"
1788
+ },
1789
+ "transactions_merchant_key_merchants_key_fk": {
1790
+ "name": "transactions_merchant_key_merchants_key_fk",
1791
+ "tableFrom": "transactions",
1792
+ "tableTo": "merchants",
1793
+ "columnsFrom": [
1794
+ "merchant_key"
1795
+ ],
1796
+ "columnsTo": [
1797
+ "key"
1798
+ ],
1799
+ "onDelete": "no action",
1800
+ "onUpdate": "no action"
1801
+ },
1802
+ "transactions_bill_id_bills_id_fk": {
1803
+ "name": "transactions_bill_id_bills_id_fk",
1804
+ "tableFrom": "transactions",
1805
+ "tableTo": "bills",
1806
+ "columnsFrom": [
1807
+ "bill_id"
1808
+ ],
1809
+ "columnsTo": [
1810
+ "id"
1811
+ ],
1812
+ "onDelete": "no action",
1813
+ "onUpdate": "no action"
1814
+ }
1815
+ },
1816
+ "compositePrimaryKeys": {},
1817
+ "uniqueConstraints": {},
1818
+ "checkConstraints": {
1819
+ "subcategory_requires_category": {
1820
+ "name": "subcategory_requires_category",
1821
+ "value": "\"transactions\".\"subcategory_id\" IS NULL OR \"transactions\".\"category_id\" IS NOT NULL"
1822
+ }
1823
+ }
1824
+ },
1825
+ "users": {
1826
+ "name": "users",
1827
+ "columns": {
1828
+ "id": {
1829
+ "name": "id",
1830
+ "type": "text",
1831
+ "primaryKey": true,
1832
+ "notNull": true,
1833
+ "autoincrement": false
1834
+ },
1835
+ "username": {
1836
+ "name": "username",
1837
+ "type": "text",
1838
+ "primaryKey": false,
1839
+ "notNull": false,
1840
+ "autoincrement": false
1841
+ },
1842
+ "password_hash": {
1843
+ "name": "password_hash",
1844
+ "type": "text",
1845
+ "primaryKey": false,
1846
+ "notNull": false,
1847
+ "autoincrement": false
1848
+ },
1849
+ "role": {
1850
+ "name": "role",
1851
+ "type": "text",
1852
+ "primaryKey": false,
1853
+ "notNull": true,
1854
+ "autoincrement": false
1855
+ },
1856
+ "created_at": {
1857
+ "name": "created_at",
1858
+ "type": "text",
1859
+ "primaryKey": false,
1860
+ "notNull": true,
1861
+ "autoincrement": false
1862
+ },
1863
+ "disabled_at": {
1864
+ "name": "disabled_at",
1865
+ "type": "text",
1866
+ "primaryKey": false,
1867
+ "notNull": false,
1868
+ "autoincrement": false
1869
+ },
1870
+ "version": {
1871
+ "name": "version",
1872
+ "type": "integer",
1873
+ "primaryKey": false,
1874
+ "notNull": true,
1875
+ "autoincrement": false,
1876
+ "default": 0
1877
+ }
1878
+ },
1879
+ "indexes": {
1880
+ "users_username_unique": {
1881
+ "name": "users_username_unique",
1882
+ "columns": [
1883
+ "username"
1884
+ ],
1885
+ "isUnique": true
1886
+ }
1887
+ },
1888
+ "foreignKeys": {},
1889
+ "compositePrimaryKeys": {},
1890
+ "uniqueConstraints": {},
1891
+ "checkConstraints": {}
1892
+ }
1893
+ },
1894
+ "views": {},
1895
+ "enums": {},
1896
+ "_meta": {
1897
+ "schemas": {},
1898
+ "tables": {},
1899
+ "columns": {}
1900
+ },
1901
+ "internal": {
1902
+ "indexes": {}
1903
+ }
1904
+ }