shutro-erp 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (513) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +411 -2
  3. package/dist/accounting/.kosh/bindings.d.ts +22 -0
  4. package/dist/accounting/.kosh/bindings.js +15 -0
  5. package/dist/accounting/.kosh/schema.d.ts +1140 -0
  6. package/dist/accounting/chart.d.ts +57 -0
  7. package/dist/accounting/chart.js +213 -0
  8. package/dist/accounting/closing.d.ts +47 -0
  9. package/dist/accounting/closing.js +223 -0
  10. package/dist/accounting/demo.d.ts +7 -0
  11. package/dist/accounting/demo.js +132 -0
  12. package/dist/accounting/index.d.ts +20 -0
  13. package/dist/accounting/index.js +910 -0
  14. package/dist/accounting/module.d.ts +6982 -0
  15. package/dist/accounting/module.js +1094 -0
  16. package/dist/accounting/payments.d.ts +63 -0
  17. package/dist/accounting/payments.js +451 -0
  18. package/dist/accounting/web/AgingPage.d.ts +4 -0
  19. package/dist/accounting/web/AgingPage.js +19 -0
  20. package/dist/accounting/web/ReconcilePage.d.ts +7 -0
  21. package/dist/accounting/web/ReconcilePage.js +79 -0
  22. package/dist/accounting/web/RegisterPayment.d.ts +8 -0
  23. package/dist/accounting/web/RegisterPayment.js +52 -0
  24. package/dist/accounting/web/SettingsPage.d.ts +7 -0
  25. package/dist/accounting/web/SettingsPage.js +58 -0
  26. package/dist/accounting/web/index.d.ts +15 -0
  27. package/dist/accounting/web/index.js +26 -0
  28. package/dist/accounting/web/messages.d.ts +2 -0
  29. package/dist/accounting/web/messages.js +117 -0
  30. package/dist/assistant/client.d.ts +62 -0
  31. package/dist/assistant/client.js +120 -0
  32. package/dist/assistant/form.d.ts +41 -0
  33. package/dist/assistant/form.js +134 -0
  34. package/dist/assistant/index.d.ts +31 -0
  35. package/dist/assistant/index.js +63 -0
  36. package/dist/assistant/models.d.ts +2 -0
  37. package/dist/assistant/models.js +47 -0
  38. package/dist/assistant/record.d.ts +26 -0
  39. package/dist/assistant/record.js +125 -0
  40. package/dist/assistant/routes.d.ts +31 -0
  41. package/dist/assistant/routes.js +498 -0
  42. package/dist/assistant/search.d.ts +38 -0
  43. package/dist/assistant/search.js +168 -0
  44. package/dist/assistant/web/AskButton.d.ts +17 -0
  45. package/dist/assistant/web/AskButton.js +48 -0
  46. package/dist/assistant/web/AssistantSettings.d.ts +8 -0
  47. package/dist/assistant/web/AssistantSettings.js +42 -0
  48. package/dist/assistant/web/ChatterAssist.d.ts +8 -0
  49. package/dist/assistant/web/ChatterAssist.js +77 -0
  50. package/dist/assistant/web/FillButton.d.ts +8 -0
  51. package/dist/assistant/web/FillButton.js +74 -0
  52. package/dist/assistant/web/index.d.ts +15 -0
  53. package/dist/assistant/web/index.js +26 -0
  54. package/dist/assistant/web/messages.d.ts +2 -0
  55. package/dist/assistant/web/messages.js +126 -0
  56. package/dist/automation/cron.d.ts +18 -0
  57. package/dist/automation/cron.js +82 -0
  58. package/dist/automation/engine.d.ts +186 -0
  59. package/dist/automation/engine.js +1082 -0
  60. package/dist/automation/index.d.ts +24 -0
  61. package/dist/automation/index.js +177 -0
  62. package/dist/automation/models.d.ts +6 -0
  63. package/dist/automation/models.js +130 -0
  64. package/dist/automation/module-rules.d.ts +19 -0
  65. package/dist/automation/module-rules.js +78 -0
  66. package/dist/automation/routes.d.ts +14 -0
  67. package/dist/automation/routes.js +81 -0
  68. package/dist/automation/web/RetryRun.d.ts +4 -0
  69. package/dist/automation/web/RetryRun.js +20 -0
  70. package/dist/automation/web/RuleEditor.d.ts +9 -0
  71. package/dist/automation/web/RuleEditor.js +316 -0
  72. package/dist/automation/web/index.d.ts +13 -0
  73. package/dist/automation/web/index.js +20 -0
  74. package/dist/automation/web/messages.d.ts +2 -0
  75. package/dist/automation/web/messages.js +217 -0
  76. package/dist/cli/apps.d.ts +12 -0
  77. package/dist/cli/apps.js +249 -0
  78. package/dist/cli/bin.d.ts +2 -0
  79. package/dist/cli/bin.js +6 -0
  80. package/dist/cli/index.d.ts +21 -0
  81. package/dist/cli/index.js +145 -0
  82. package/dist/cli/init.d.ts +13 -0
  83. package/dist/cli/init.js +832 -0
  84. package/dist/cli/project.d.ts +36 -0
  85. package/dist/cli/project.js +473 -0
  86. package/dist/cli/prompt.d.ts +33 -0
  87. package/dist/cli/prompt.js +118 -0
  88. package/dist/cli/templates.d.ts +56 -0
  89. package/dist/cli/templates.js +443 -0
  90. package/dist/cli/ui.d.ts +87 -0
  91. package/dist/cli/ui.js +231 -0
  92. package/dist/contacts/.kosh/bindings.d.ts +22 -0
  93. package/dist/contacts/.kosh/bindings.js +15 -0
  94. package/dist/contacts/.kosh/schema.d.ts +267 -0
  95. package/dist/contacts/demo.d.ts +9 -0
  96. package/dist/contacts/demo.js +38 -0
  97. package/dist/contacts/index.d.ts +9 -0
  98. package/dist/contacts/index.js +81 -0
  99. package/dist/contacts/module.d.ts +780 -0
  100. package/dist/contacts/module.js +63 -0
  101. package/dist/mail/inbound/handle.d.ts +72 -0
  102. package/dist/mail/inbound/handle.js +509 -0
  103. package/dist/mail/inbound/index.d.ts +7 -0
  104. package/dist/mail/inbound/index.js +7 -0
  105. package/dist/mail/inbound/models.d.ts +4 -0
  106. package/dist/mail/inbound/models.js +66 -0
  107. package/dist/mail/inbound/parse.d.ts +52 -0
  108. package/dist/mail/inbound/parse.js +310 -0
  109. package/dist/mail/inbound/poller.d.ts +26 -0
  110. package/dist/mail/inbound/poller.js +100 -0
  111. package/dist/mail/inbound/routes.d.ts +6 -0
  112. package/dist/mail/inbound/routes.js +88 -0
  113. package/dist/mail/inbound/token.d.ts +22 -0
  114. package/dist/mail/inbound/token.js +65 -0
  115. package/dist/mail/index.d.ts +77 -0
  116. package/dist/mail/index.js +172 -0
  117. package/dist/mail/web/InboundPage.d.ts +7 -0
  118. package/dist/mail/web/InboundPage.js +74 -0
  119. package/dist/mail/web/index.d.ts +12 -0
  120. package/dist/mail/web/index.js +17 -0
  121. package/dist/mail/web/messages.d.ts +2 -0
  122. package/dist/mail/web/messages.js +81 -0
  123. package/dist/messaging/body.d.ts +17 -0
  124. package/dist/messaging/body.js +98 -0
  125. package/dist/messaging/chat-routes.d.ts +20 -0
  126. package/dist/messaging/chat-routes.js +83 -0
  127. package/dist/messaging/chat.d.ts +108 -0
  128. package/dist/messaging/chat.js +524 -0
  129. package/dist/messaging/chatter.d.ts +173 -0
  130. package/dist/messaging/chatter.js +657 -0
  131. package/dist/messaging/index.d.ts +22 -0
  132. package/dist/messaging/index.js +71 -0
  133. package/dist/messaging/models.d.ts +15 -0
  134. package/dist/messaging/models.js +194 -0
  135. package/dist/messaging/routes.d.ts +21 -0
  136. package/dist/messaging/routes.js +97 -0
  137. package/dist/messaging/web/Chat.d.ts +25 -0
  138. package/dist/messaging/web/Chat.js +382 -0
  139. package/dist/messaging/web/ChatDock.d.ts +8 -0
  140. package/dist/messaging/web/ChatDock.js +72 -0
  141. package/dist/messaging/web/Chatter.d.ts +47 -0
  142. package/dist/messaging/web/Chatter.js +441 -0
  143. package/dist/messaging/web/index.d.ts +15 -0
  144. package/dist/messaging/web/index.js +24 -0
  145. package/dist/messaging/web/messages.d.ts +2 -0
  146. package/dist/messaging/web/messages.js +229 -0
  147. package/dist/modules-sdk/apps.d.ts +74 -0
  148. package/dist/modules-sdk/apps.js +213 -0
  149. package/dist/modules-sdk/demo.d.ts +3 -0
  150. package/dist/modules-sdk/demo.js +9 -0
  151. package/dist/modules-sdk/errors.d.ts +11 -0
  152. package/dist/modules-sdk/errors.js +20 -0
  153. package/dist/modules-sdk/index.d.ts +10 -0
  154. package/dist/modules-sdk/index.js +10 -0
  155. package/dist/modules-sdk/loader.d.ts +25 -0
  156. package/dist/modules-sdk/loader.js +111 -0
  157. package/dist/modules-sdk/manifest.d.ts +264 -0
  158. package/dist/modules-sdk/manifest.js +84 -0
  159. package/dist/modules-sdk/semver.d.ts +7 -0
  160. package/dist/modules-sdk/semver.js +70 -0
  161. package/dist/notify/digest.d.ts +17 -0
  162. package/dist/notify/digest.js +137 -0
  163. package/dist/notify/email.d.ts +71 -0
  164. package/dist/notify/email.js +271 -0
  165. package/dist/notify/fallback.d.ts +24 -0
  166. package/dist/notify/fallback.js +101 -0
  167. package/dist/notify/inbox.d.ts +36 -0
  168. package/dist/notify/inbox.js +240 -0
  169. package/dist/notify/index.d.ts +43 -0
  170. package/dist/notify/index.js +89 -0
  171. package/dist/notify/jobs.d.ts +9 -0
  172. package/dist/notify/jobs.js +7 -0
  173. package/dist/notify/messages.d.ts +24 -0
  174. package/dist/notify/messages.js +61 -0
  175. package/dist/notify/messenger.d.ts +45 -0
  176. package/dist/notify/messenger.js +90 -0
  177. package/dist/notify/models.d.ts +8 -0
  178. package/dist/notify/models.js +145 -0
  179. package/dist/notify/prefs.d.ts +20 -0
  180. package/dist/notify/prefs.js +60 -0
  181. package/dist/notify/push.d.ts +87 -0
  182. package/dist/notify/push.js +172 -0
  183. package/dist/notify/quiet.d.ts +34 -0
  184. package/dist/notify/quiet.js +92 -0
  185. package/dist/notify/routes.d.ts +33 -0
  186. package/dist/notify/routes.js +211 -0
  187. package/dist/notify/web/NotificationBell.d.ts +8 -0
  188. package/dist/notify/web/NotificationBell.js +72 -0
  189. package/dist/notify/web/NotificationSettings.d.ts +12 -0
  190. package/dist/notify/web/NotificationSettings.js +75 -0
  191. package/dist/notify/web/index.d.ts +13 -0
  192. package/dist/notify/web/index.js +18 -0
  193. package/dist/notify/web/messages.d.ts +1 -0
  194. package/dist/notify/web/messages.js +116 -0
  195. package/dist/notify/web/push.d.ts +12 -0
  196. package/dist/notify/web/push.js +83 -0
  197. package/dist/permissions/admin.d.ts +13 -0
  198. package/dist/permissions/admin.js +389 -0
  199. package/dist/permissions/approvals.d.ts +56 -0
  200. package/dist/permissions/approvals.js +273 -0
  201. package/dist/permissions/index.d.ts +18 -0
  202. package/dist/permissions/index.js +41 -0
  203. package/dist/permissions/models.d.ts +3 -0
  204. package/dist/permissions/models.js +142 -0
  205. package/dist/permissions/routes.d.ts +11 -0
  206. package/dist/permissions/routes.js +41 -0
  207. package/dist/permissions/web/ApprovalPanel.d.ts +9 -0
  208. package/dist/permissions/web/ApprovalPanel.js +48 -0
  209. package/dist/permissions/web/index.d.ts +9 -0
  210. package/dist/permissions/web/index.js +6 -0
  211. package/dist/product/.kosh/bindings.d.ts +22 -0
  212. package/dist/product/.kosh/bindings.js +15 -0
  213. package/dist/product/.kosh/schema.d.ts +330 -0
  214. package/dist/product/demo.d.ts +3 -0
  215. package/dist/product/demo.js +74 -0
  216. package/dist/product/index.d.ts +8 -0
  217. package/dist/product/index.js +117 -0
  218. package/dist/product/module.d.ts +1251 -0
  219. package/dist/product/module.js +136 -0
  220. package/dist/project/.kosh/bindings.d.ts +22 -0
  221. package/dist/project/.kosh/bindings.js +15 -0
  222. package/dist/project/.kosh/schema.d.ts +592 -0
  223. package/dist/project/demo.d.ts +11 -0
  224. package/dist/project/demo.js +148 -0
  225. package/dist/project/index.d.ts +4 -0
  226. package/dist/project/index.js +222 -0
  227. package/dist/project/module.d.ts +2069 -0
  228. package/dist/project/module.js +193 -0
  229. package/dist/purchase/.kosh/bindings.d.ts +22 -0
  230. package/dist/purchase/.kosh/bindings.js +15 -0
  231. package/dist/purchase/.kosh/schema.d.ts +734 -0
  232. package/dist/purchase/demo.d.ts +12 -0
  233. package/dist/purchase/demo.js +101 -0
  234. package/dist/purchase/index.d.ts +3 -0
  235. package/dist/purchase/index.js +177 -0
  236. package/dist/purchase/module.d.ts +2321 -0
  237. package/dist/purchase/module.js +207 -0
  238. package/dist/purchase_account/.kosh/bindings.d.ts +22 -0
  239. package/dist/purchase_account/.kosh/bindings.js +15 -0
  240. package/dist/purchase_account/.kosh/schema.d.ts +1216 -0
  241. package/dist/purchase_account/demo.d.ts +3 -0
  242. package/dist/purchase_account/demo.js +19 -0
  243. package/dist/purchase_account/index.d.ts +3 -0
  244. package/dist/purchase_account/index.js +52 -0
  245. package/dist/purchase_account/module.d.ts +5643 -0
  246. package/dist/purchase_account/module.js +105 -0
  247. package/dist/realtime/gateway.d.ts +29 -0
  248. package/dist/realtime/gateway.js +364 -0
  249. package/dist/realtime/index.d.ts +18 -0
  250. package/dist/realtime/index.js +34 -0
  251. package/dist/reporting/documents.d.ts +51 -0
  252. package/dist/reporting/documents.js +321 -0
  253. package/dist/reporting/index.d.ts +25 -0
  254. package/dist/reporting/index.js +142 -0
  255. package/dist/reporting/models.d.ts +2 -0
  256. package/dist/reporting/models.js +125 -0
  257. package/dist/reporting/pivot.d.ts +91 -0
  258. package/dist/reporting/pivot.js +427 -0
  259. package/dist/reporting/routes-documents.d.ts +36 -0
  260. package/dist/reporting/routes-documents.js +430 -0
  261. package/dist/reporting/routes.d.ts +22 -0
  262. package/dist/reporting/routes.js +314 -0
  263. package/dist/reporting/schedules.d.ts +68 -0
  264. package/dist/reporting/schedules.js +204 -0
  265. package/dist/reporting/web/CalendarView.d.ts +10 -0
  266. package/dist/reporting/web/CalendarView.js +105 -0
  267. package/dist/reporting/web/CohortView.d.ts +19 -0
  268. package/dist/reporting/web/CohortView.js +77 -0
  269. package/dist/reporting/web/DashboardView.d.ts +23 -0
  270. package/dist/reporting/web/DashboardView.js +214 -0
  271. package/dist/reporting/web/DesignerView.d.ts +3 -0
  272. package/dist/reporting/web/DesignerView.js +229 -0
  273. package/dist/reporting/web/GanttView.d.ts +12 -0
  274. package/dist/reporting/web/GanttView.js +93 -0
  275. package/dist/reporting/web/GraphView.d.ts +37 -0
  276. package/dist/reporting/web/GraphView.js +158 -0
  277. package/dist/reporting/web/HierarchyView.d.ts +8 -0
  278. package/dist/reporting/web/HierarchyView.js +89 -0
  279. package/dist/reporting/web/MapView.d.ts +10 -0
  280. package/dist/reporting/web/MapView.js +97 -0
  281. package/dist/reporting/web/PivotView.d.ts +8 -0
  282. package/dist/reporting/web/PivotView.js +148 -0
  283. package/dist/reporting/web/SpreadsheetView.d.ts +8 -0
  284. package/dist/reporting/web/SpreadsheetView.js +159 -0
  285. package/dist/reporting/web/components.d.ts +9 -0
  286. package/dist/reporting/web/components.js +48 -0
  287. package/dist/reporting/web/formula.d.ts +24 -0
  288. package/dist/reporting/web/formula.js +357 -0
  289. package/dist/reporting/web/index.d.ts +24 -0
  290. package/dist/reporting/web/index.js +51 -0
  291. package/dist/reporting/web/messages.d.ts +2 -0
  292. package/dist/reporting/web/messages.js +125 -0
  293. package/dist/reporting/web/shared.d.ts +33 -0
  294. package/dist/reporting/web/shared.js +88 -0
  295. package/dist/reporting/xlsx.d.ts +26 -0
  296. package/dist/reporting/xlsx.js +178 -0
  297. package/dist/sale_account/.kosh/bindings.d.ts +22 -0
  298. package/dist/sale_account/.kosh/bindings.js +15 -0
  299. package/dist/sale_account/.kosh/schema.d.ts +1213 -0
  300. package/dist/sale_account/demo.d.ts +3 -0
  301. package/dist/sale_account/demo.js +15 -0
  302. package/dist/sale_account/index.d.ts +3 -0
  303. package/dist/sale_account/index.js +52 -0
  304. package/dist/sale_account/module.d.ts +5603 -0
  305. package/dist/sale_account/module.js +105 -0
  306. package/dist/sale_project/.kosh/bindings.d.ts +22 -0
  307. package/dist/sale_project/.kosh/bindings.js +15 -0
  308. package/dist/sale_project/.kosh/schema.d.ts +769 -0
  309. package/dist/sale_project/demo.d.ts +6 -0
  310. package/dist/sale_project/demo.js +28 -0
  311. package/dist/sale_project/index.d.ts +13 -0
  312. package/dist/sale_project/index.js +60 -0
  313. package/dist/sale_project/module.d.ts +3615 -0
  314. package/dist/sale_project/module.js +110 -0
  315. package/dist/sales/.kosh/bindings.d.ts +22 -0
  316. package/dist/sales/.kosh/bindings.js +15 -0
  317. package/dist/sales/.kosh/schema.d.ts +648 -0
  318. package/dist/sales/demo.d.ts +9 -0
  319. package/dist/sales/demo.js +91 -0
  320. package/dist/sales/index.d.ts +3 -0
  321. package/dist/sales/index.js +144 -0
  322. package/dist/sales/module.d.ts +2245 -0
  323. package/dist/sales/module.js +195 -0
  324. package/dist/search/index.d.ts +62 -0
  325. package/dist/search/index.js +141 -0
  326. package/dist/server/api/changes.d.ts +29 -0
  327. package/dist/server/api/changes.js +40 -0
  328. package/dist/server/api/client.d.ts +17 -0
  329. package/dist/server/api/client.js +379 -0
  330. package/dist/server/api/idempotency.d.ts +22 -0
  331. package/dist/server/api/idempotency.js +56 -0
  332. package/dist/server/api/metadata.d.ts +64 -0
  333. package/dist/server/api/metadata.js +87 -0
  334. package/dist/server/api/navigation.d.ts +74 -0
  335. package/dist/server/api/navigation.js +195 -0
  336. package/dist/server/api/openapi.d.ts +21 -0
  337. package/dist/server/api/openapi.js +348 -0
  338. package/dist/server/api/rest.d.ts +27 -0
  339. package/dist/server/api/rest.js +449 -0
  340. package/dist/server/api/views.d.ts +66 -0
  341. package/dist/server/api/views.js +306 -0
  342. package/dist/server/apps.d.ts +131 -0
  343. package/dist/server/apps.js +445 -0
  344. package/dist/server/audit.d.ts +20 -0
  345. package/dist/server/audit.js +25 -0
  346. package/dist/server/auth/admins.d.ts +25 -0
  347. package/dist/server/auth/admins.js +69 -0
  348. package/dist/server/auth/base.d.ts +11 -0
  349. package/dist/server/auth/base.js +193 -0
  350. package/dist/server/auth/crypto.d.ts +19 -0
  351. package/dist/server/auth/crypto.js +99 -0
  352. package/dist/server/auth/install.d.ts +23 -0
  353. package/dist/server/auth/install.js +17 -0
  354. package/dist/server/auth/routes.d.ts +19 -0
  355. package/dist/server/auth/routes.js +55 -0
  356. package/dist/server/auth/service.d.ts +107 -0
  357. package/dist/server/auth/service.js +481 -0
  358. package/dist/server/demo.d.ts +28 -0
  359. package/dist/server/demo.js +84 -0
  360. package/dist/server/errors.d.ts +20 -0
  361. package/dist/server/errors.js +88 -0
  362. package/dist/server/host.d.ts +48 -0
  363. package/dist/server/host.js +179 -0
  364. package/dist/server/identity.d.ts +48 -0
  365. package/dist/server/identity.js +57 -0
  366. package/dist/server/index.d.ts +29 -0
  367. package/dist/server/index.js +29 -0
  368. package/dist/server/orm.d.ts +25 -0
  369. package/dist/server/orm.js +24 -0
  370. package/dist/server/registry.d.ts +20 -0
  371. package/dist/server/registry.js +58 -0
  372. package/dist/server/server.d.ts +115 -0
  373. package/dist/server/server.js +230 -0
  374. package/dist/server/telemetry.d.ts +22 -0
  375. package/dist/server/telemetry.js +37 -0
  376. package/dist/settings/index.d.ts +18 -0
  377. package/dist/settings/index.js +51 -0
  378. package/dist/settings/routes.d.ts +45 -0
  379. package/dist/settings/routes.js +155 -0
  380. package/dist/settings/web/AppsPage.d.ts +9 -0
  381. package/dist/settings/web/AppsPage.js +135 -0
  382. package/dist/settings/web/index.d.ts +12 -0
  383. package/dist/settings/web/index.js +17 -0
  384. package/dist/settings/web/messages.d.ts +2 -0
  385. package/dist/settings/web/messages.js +113 -0
  386. package/dist/storage/attachments.d.ts +48 -0
  387. package/dist/storage/attachments.js +137 -0
  388. package/dist/storage/backends.d.ts +49 -0
  389. package/dist/storage/backends.js +162 -0
  390. package/dist/storage/index.d.ts +20 -0
  391. package/dist/storage/index.js +29 -0
  392. package/dist/storage/models.d.ts +2 -0
  393. package/dist/storage/models.js +34 -0
  394. package/dist/storage/routes.d.ts +24 -0
  395. package/dist/storage/routes.js +134 -0
  396. package/dist/storage/sigv4.d.ts +20 -0
  397. package/dist/storage/sigv4.js +70 -0
  398. package/dist/studio/build.d.ts +16 -0
  399. package/dist/studio/build.js +67 -0
  400. package/dist/studio/diff.d.ts +9 -0
  401. package/dist/studio/diff.js +106 -0
  402. package/dist/studio/edit.d.ts +74 -0
  403. package/dist/studio/edit.js +150 -0
  404. package/dist/studio/generate.d.ts +26 -0
  405. package/dist/studio/generate.js +278 -0
  406. package/dist/studio/git.d.ts +43 -0
  407. package/dist/studio/git.js +167 -0
  408. package/dist/studio/index.d.ts +18 -0
  409. package/dist/studio/index.js +18 -0
  410. package/dist/studio/module.d.ts +45 -0
  411. package/dist/studio/module.js +488 -0
  412. package/dist/studio/spec.d.ts +148 -0
  413. package/dist/studio/spec.js +173 -0
  414. package/dist/studio/web/FieldEditor.d.ts +31 -0
  415. package/dist/studio/web/FieldEditor.js +54 -0
  416. package/dist/studio/web/Review.d.ts +24 -0
  417. package/dist/studio/web/Review.js +65 -0
  418. package/dist/studio/web/Sections.d.ts +24 -0
  419. package/dist/studio/web/Sections.js +59 -0
  420. package/dist/studio/web/StudioPage.d.ts +8 -0
  421. package/dist/studio/web/StudioPage.js +47 -0
  422. package/dist/studio/web/StudioToggle.d.ts +34 -0
  423. package/dist/studio/web/StudioToggle.js +86 -0
  424. package/dist/studio/web/index.d.ts +15 -0
  425. package/dist/studio/web/index.js +22 -0
  426. package/dist/studio/web/messages.d.ts +2 -0
  427. package/dist/studio/web/messages.js +151 -0
  428. package/dist/ui/api.d.ts +198 -0
  429. package/dist/ui/api.js +307 -0
  430. package/dist/ui/app.d.ts +13 -0
  431. package/dist/ui/app.js +539 -0
  432. package/dist/ui/components/AppIcon.d.ts +6 -0
  433. package/dist/ui/components/AppIcon.js +45 -0
  434. package/dist/ui/components/primitives.d.ts +70 -0
  435. package/dist/ui/components/primitives.js +114 -0
  436. package/dist/ui/context.d.ts +41 -0
  437. package/dist/ui/context.js +67 -0
  438. package/dist/ui/design.d.ts +40 -0
  439. package/dist/ui/design.js +34 -0
  440. package/dist/ui/i18n/index.d.ts +13 -0
  441. package/dist/ui/i18n/index.js +42 -0
  442. package/dist/ui/i18n/messages.d.ts +262 -0
  443. package/dist/ui/i18n/messages.js +490 -0
  444. package/dist/ui/index.d.ts +41 -0
  445. package/dist/ui/index.js +52 -0
  446. package/dist/ui/lib/cn.d.ts +3 -0
  447. package/dist/ui/lib/cn.js +6 -0
  448. package/dist/ui/lib/format.d.ts +17 -0
  449. package/dist/ui/lib/format.js +47 -0
  450. package/dist/ui/live.d.ts +16 -0
  451. package/dist/ui/live.js +75 -0
  452. package/dist/ui/offline/db.d.ts +4 -0
  453. package/dist/ui/offline/db.js +37 -0
  454. package/dist/ui/offline/persist.d.ts +27 -0
  455. package/dist/ui/offline/persist.js +100 -0
  456. package/dist/ui/offline/queue.d.ts +61 -0
  457. package/dist/ui/offline/queue.js +155 -0
  458. package/dist/ui/prefill.d.ts +13 -0
  459. package/dist/ui/prefill.js +15 -0
  460. package/dist/ui/pwa/register.d.ts +3 -0
  461. package/dist/ui/pwa/register.js +37 -0
  462. package/dist/ui/pwa/vite.d.ts +17 -0
  463. package/dist/ui/pwa/vite.js +44 -0
  464. package/dist/ui/pwa/worker.d.ts +15 -0
  465. package/dist/ui/pwa/worker.js +92 -0
  466. package/dist/ui/realtime.d.ts +39 -0
  467. package/dist/ui/realtime.js +148 -0
  468. package/dist/ui/registry.d.ts +157 -0
  469. package/dist/ui/registry.js +112 -0
  470. package/dist/ui/search/SearchBar.d.ts +18 -0
  471. package/dist/ui/search/SearchBar.js +88 -0
  472. package/dist/ui/shell/CommandPalette.d.ts +11 -0
  473. package/dist/ui/shell/CommandPalette.js +273 -0
  474. package/dist/ui/shell/Home.d.ts +2 -0
  475. package/dist/ui/shell/Home.js +75 -0
  476. package/dist/ui/shell/Login.d.ts +6 -0
  477. package/dist/ui/shell/Login.js +40 -0
  478. package/dist/ui/shell/OfflineMenu.d.ts +4 -0
  479. package/dist/ui/shell/OfflineMenu.js +64 -0
  480. package/dist/ui/shell/recent.d.ts +17 -0
  481. package/dist/ui/shell/recent.js +27 -0
  482. package/dist/ui/shell/shortcuts.d.ts +29 -0
  483. package/dist/ui/shell/shortcuts.js +118 -0
  484. package/dist/ui/shell/toast.d.ts +22 -0
  485. package/dist/ui/shell/toast.js +44 -0
  486. package/dist/ui/styles.css +105 -0
  487. package/dist/ui/views/FormView.d.ts +4 -0
  488. package/dist/ui/views/FormView.js +401 -0
  489. package/dist/ui/views/KanbanView.d.ts +12 -0
  490. package/dist/ui/views/KanbanView.js +235 -0
  491. package/dist/ui/views/ListView.d.ts +4 -0
  492. package/dist/ui/views/ListView.js +838 -0
  493. package/dist/ui/views/grid.d.ts +48 -0
  494. package/dist/ui/views/grid.js +216 -0
  495. package/dist/ui/views/listMemory.d.ts +9 -0
  496. package/dist/ui/views/listMemory.js +24 -0
  497. package/dist/ui/views/widgets.d.ts +14 -0
  498. package/dist/ui/views/widgets.js +252 -0
  499. package/dist/views/builders.d.ts +139 -0
  500. package/dist/views/builders.js +175 -0
  501. package/dist/views/condition.d.ts +23 -0
  502. package/dist/views/condition.js +121 -0
  503. package/dist/views/documents.d.ts +63 -0
  504. package/dist/views/documents.js +1 -0
  505. package/dist/views/extend.d.ts +23 -0
  506. package/dist/views/extend.js +221 -0
  507. package/dist/views/index.d.ts +17 -0
  508. package/dist/views/index.js +15 -0
  509. package/dist/views/types.d.ts +291 -0
  510. package/dist/views/types.js +6 -0
  511. package/dist/views/validate.d.ts +17 -0
  512. package/dist/views/validate.js +228 -0
  513. package/package.json +266 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Isahaq
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,412 @@
1
- # Temporary Holding Version
1
+ # shutro-erp
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ **Kosh** is an ERP framework for Node.js, TypeScript and PostgreSQL, built on the
4
+ [Shutro](https://www.npmjs.com/package/shutro) ORM. Define a model once and get a REST API with OpenAPI, a typed
5
+ client, list / form / kanban / pivot / graph / calendar / gantt / map / dashboard views, exports, PDF documents and a
6
+ chatter on every record. Permissions are checked on the server on every route.
7
+
8
+ - [Requirements](#requirements)
9
+ - [Install with the terminal](#install-with-the-terminal)
10
+ - [Install with Docker](#install-with-docker)
11
+ - [Project structure](#project-structure)
12
+ - [Modules](#modules): structure, create, install, remove
13
+ - [Migrations](#migrations): schema and per-module data migrations
14
+ - [Seed data](#seed-data): per-module seeders
15
+ - [Users and roles](#users-and-roles)
16
+ - [Configuration (.env)](#configuration-env)
17
+ - [Command reference](#command-reference)
18
+ - [Entry points](#entry-points) · [Troubleshooting](#troubleshooting)
19
+
20
+ ## Requirements
21
+
22
+ - **Node.js 24** or later (`node --version`)
23
+ - **PostgreSQL 16** or later, or **Docker** (Kosh can start PostgreSQL for you)
24
+ - An authenticator app for the administrator's second factor (Google Authenticator, Microsoft Authenticator,
25
+ 1Password, …)
26
+
27
+ ## Install with the terminal
28
+
29
+ One command creates the project, installs Kosh and asks for everything it needs:
30
+
31
+ ```sh
32
+ npx shutro-erp@latest init my-erp # the project my-erp
33
+ npx shutro-erp@latest init # asks for the project name first
34
+ ```
35
+
36
+ (`pnpm dlx shutro-erp init my-erp` and `yarn dlx shutro-erp init my-erp` work too.) In an existing folder:
37
+
38
+ ```sh
39
+ npm install shutro-erp # Shutro, the ORM, comes with it
40
+ npx kosh init
41
+ ```
42
+
43
+ The setup asks for what the installation needs. Press **Enter** to keep the value in `[brackets]`:
44
+
45
+ | Question | Example | Notes |
46
+ |---|---|---|
47
+ | PostgreSQL | `1` your server, `2` start one in Docker | `2` needs Docker Desktop running; it writes `compose.yaml` and starts the `db` service |
48
+ | Username, password, port, host, database name | `postgres`, (hidden), `5432`, `localhost`, `my_erp` | for `1`; a missing database is created after you confirm; if nothing answers, it offers Docker instead |
49
+ | Company name, currency | `Padma Traders`, `BDT` | the first company; more companies later |
50
+ | Language, time zone | `bn`, `Asia/Dhaka` | the administrator's |
51
+ | Administrator login, name, email, password | `admin`, …, 12+ characters | the password is typed hidden and stored only as a hash |
52
+ | Apps | `permissions,reporting,messaging` | roles and approvals, reports and documents, chatter and attachments |
53
+ | File storage | `1` a folder, `2` S3-compatible | S3, SeaweedFS, MinIO; the bucket is created |
54
+ | Valkey/Redis URL | empty | optional: rate limits and caches shared by several servers |
55
+ | API port | `3000` | |
56
+ | Authenticator code | `123456` | scan the printed secret, type a code; **keep the recovery codes** it prints |
57
+
58
+ Then it writes the project, creates the database tables (`migrations/0001_init.sql`), the company and the
59
+ administrator, and loads the apps' default data. Run `npm install` once in the project, then start it:
60
+
61
+ ```sh
62
+ npm start # the API on http://localhost:3000
63
+ npm run web # the back-office on http://localhost:5173, in a second terminal
64
+ ```
65
+
66
+ Sign in with the administrator's login, password and a code from the authenticator app.
67
+
68
+ **Without questions** (scripts, CI): pass the answers as flags.
69
+
70
+ ```sh
71
+ npx shutro-erp@latest init my-erp --yes --docker-db --admin-password "a long passphrase here"
72
+
73
+ npx kosh init --yes \
74
+ --database-url postgres://postgres:postgres@localhost:5432/my_erp --create-database \
75
+ --company "Padma Traders" --currency BDT --lang bn --tz Asia/Dhaka \
76
+ --admin-login admin --admin-password "a long passphrase here" \
77
+ --apps permissions,reporting,messaging --storage-dir ./var/attachments --port 3000
78
+ ```
79
+
80
+ With `--yes` nothing is asked, so the authenticator is not enrolled: run `npx kosh init` again in a terminal to
81
+ enrol it (administrator rights wait for it). `npx kosh init --help` lists every flag. Replies by email: set `MAIL_INBOUND_DOMAIN` in `.env` (the secrets are generated) and point your email provider's inbound webhook at `/api/v1/mail/inbound` with the `MAIL_INBOUND_WEBHOOK_SECRET`. `--demo` (or a yes to the
82
+ question after the apps) loads a sample company with contacts, products, orders, invoices and projects, made by
83
+ the demo users `dina`, `rahim`, `karim` and `sumi` (one shared password, printed at the end); not for production.
84
+
85
+ ## Install with Docker
86
+
87
+ `kosh init` writes `Dockerfile`, `compose.yaml`, `nginx.conf` and `.dockerignore` into every project.
88
+
89
+ **PostgreSQL in Docker, the app on your machine** (development):
90
+
91
+ ```sh
92
+ npx shutro-erp@latest init my-erp # answer 2 to "PostgreSQL": it starts the db service for you
93
+ cd my-erp && npm start # the API; npm run web for the back-office
94
+ ```
95
+
96
+ or start the database yourself first:
97
+
98
+ ```sh
99
+ docker compose up -d db # uses POSTGRES_USER / POSTGRES_PASSWORD / POSTGRES_DB / POSTGRES_PORT from .env
100
+ ```
101
+
102
+ **Everything in Docker** (a server, a demo):
103
+
104
+ ```sh
105
+ npx shutro-erp@latest init my-erp # once: the project, .env, tables, administrator (answer 2 for PostgreSQL)
106
+ cd my-erp
107
+ docker compose up -d --build # db + api + web; the back-office on http://localhost:8080
108
+ ```
109
+
110
+ | Service | What | Port |
111
+ |---|---|---|
112
+ | `db` | PostgreSQL 18, data in the `db` volume | `127.0.0.1:5432` (`POSTGRES_PORT`) |
113
+ | `api` | the Kosh API; runs `kosh migrate` on every start, then serves | inside the network (`api:3000`) |
114
+ | `web` | nginx with the built back-office, `/api` proxied to `api` | `8080` (`WEB_PORT`) |
115
+
116
+ Useful commands:
117
+
118
+ ```sh
119
+ docker compose logs -f api # the API's log
120
+ docker compose exec api npx kosh migrate status # any kosh command inside the container
121
+ docker compose exec api npx kosh seed
122
+ docker compose up -d --build api # after changing modules: rebuild and migrate
123
+ docker compose down # stop (volumes keep the data)
124
+ docker compose exec db pg_dump -U kosh my_erp > backup.sql # a backup
125
+ ```
126
+
127
+ Behind HTTPS, set `KOSH_SECURE_COOKIES: "true"` in `compose.yaml`. To use a PostgreSQL server outside Docker, set
128
+ `DOCKER_DATABASE_URL` in `.env` (an address the container can reach, not `localhost`).
129
+
130
+ ## Project structure
131
+
132
+ ```text
133
+ my-erp/
134
+ ├── .env settings and credentials (not committed)
135
+ ├── package.json scripts: start, web, build:web, migrate, seed, docker:up
136
+ ├── migrations/ versioned schema migrations: 0001_init.sql, 0002_update.sql, … (commit them)
137
+ ├── src/
138
+ │ ├── modules.ts the installed modules: base, the apps, your modules
139
+ │ ├── server.ts the API server (npm start)
140
+ │ ├── modules/ your modules (kosh module create <name>)
141
+ │ │ └── library/
142
+ │ │ ├── index.ts the module: groups, access levels, app, menus, actions, views
143
+ │ │ ├── models.ts its models (fields, access per group, record rules)
144
+ │ │ ├── data.ts its seed data
145
+ │ │ └── migrations.ts its data migrations
146
+ │ └── web/
147
+ │ ├── main.tsx the back-office (React): renderers of each installed app
148
+ │ └── index.css Tailwind + Kosh's design tokens
149
+ ├── index.html, vite.config.ts the back-office build (npm run web / build:web)
150
+ ├── Dockerfile, compose.yaml, nginx.conf, .dockerignore
151
+ └── var/attachments/ uploaded files (with folder storage)
152
+ ```
153
+
154
+ ## Modules
155
+
156
+ A module is a folder with its models and a manifest. Create one:
157
+
158
+ ```sh
159
+ npx kosh module create library
160
+ npx kosh migrate # creates its tables, records it, loads its seed data
161
+ ```
162
+
163
+ It writes `src/modules/library/` and adds `library` to `src/modules.ts`. After `npm start` and a reload of the
164
+ back-office, the **Library** app appears for the administrator.
165
+
166
+ **`models.ts`**: models and their fields, with access per group (nobody has access by default):
167
+
168
+ ```ts
169
+ import { orm } from 'shutro-erp/orm';
170
+ const { defineModel, f } = orm;
171
+
172
+ export const Book = defineModel('library.book', {
173
+ archivable: true,
174
+ access: {
175
+ 'library.user': ['read', 'write', 'create'],
176
+ 'library.manager': ['read', 'write', 'create', 'unlink', 'export', 'import'],
177
+ },
178
+ order: ['title asc'],
179
+ fields: {
180
+ title: f.char({ required: true }),
181
+ isbn: f.char({ index: 'unique' }),
182
+ author: f.many2one('res.partner'),
183
+ price: f.decimal({ scale: 2 }),
184
+ state: f.state({
185
+ states: { draft: 'Draft', available: 'Available', lent: 'Lent' },
186
+ initial: 'draft',
187
+ transitions: { publish: { from: ['draft'], to: 'available' }, lend: { from: ['available'], to: 'lent' } },
188
+ }),
189
+ },
190
+ });
191
+ ```
192
+
193
+ **`index.ts`**: the module: its Shutro part (name, version, groups, models, seed data, data migrations) and its
194
+ Kosh part (access levels, app, menus, actions, views):
195
+
196
+ ```ts
197
+ import { base, baseShutro } from 'shutro-erp';
198
+ import { defineModule } from 'shutro-erp/modules-sdk';
199
+ import { orm } from 'shutro-erp/orm';
200
+ import { form, list } from 'shutro-erp/views';
201
+ import { data } from './data.ts';
202
+ import { migrations } from './migrations.ts';
203
+ import { Book } from './models.ts';
204
+
205
+ export const libraryShutro = orm.defineModule({
206
+ name: 'library',
207
+ version: '0.1.0', // raise it when data migrations must run
208
+ depends: [baseShutro],
209
+ groups: [
210
+ orm.defineGroup({ code: 'library.user', label: 'Library user', implies: ['base.user'] }),
211
+ orm.defineGroup({ code: 'library.manager', label: 'Library manager', implies: ['library.user'] }),
212
+ ],
213
+ models: [Book],
214
+ data,
215
+ migrations,
216
+ });
217
+
218
+ export const library = defineModule({
219
+ shutro: libraryShutro,
220
+ kosh: '^0.1.0',
221
+ depends: [base], // also messaging, reporting, other modules
222
+ accessLevels: { // what administrators grant (roles: library.user, library.manager)
223
+ user: { label: 'User', groups: ['library.user'] },
224
+ manager: { label: 'Manager', groups: ['library.manager'], implies: ['user'] },
225
+ },
226
+ app: { code: 'library', label: 'Library', icon: 'box', sequence: 50 },
227
+ actions: { 'library.action_books': { model: 'library.book', label: 'Books', views: ['list', 'form'] } },
228
+ menus: [
229
+ { id: 'library.root', label: 'Library', app: 'library' },
230
+ { id: 'library.books', parent: 'library.root', label: 'Books', action: 'library.action_books' },
231
+ ],
232
+ views: {
233
+ 'library.book.list': list(Book, { columns: ['title', 'isbn', 'author', 'state'] }),
234
+ 'library.book.form': form(Book, (f) => ({
235
+ header: { statusbar: 'state', buttons: [f.button('publish', { primary: true, label: 'Publish' })] },
236
+ sheet: [f.group('main', ['title', 'isbn', 'author', 'price'])],
237
+ chatter: true, // messages, activities and the change log (needs messaging)
238
+ })),
239
+ },
240
+ });
241
+ ```
242
+
243
+ **Install a module**: list it in `src/modules.ts`, then migrate:
244
+
245
+ ```ts
246
+ // src/modules.ts
247
+ import { base } from 'shutro-erp';
248
+ import { messaging } from 'shutro-erp/messaging';
249
+ import { library } from './modules/library/index.ts';
250
+
251
+ export const modules = [base, messaging, library];
252
+ ```
253
+
254
+ ```sh
255
+ npx kosh migrate # tables, the module's version (shutro_module), its seed data
256
+ ```
257
+
258
+ A module published on npm installs the same way: `npm install <package>`, import it in `src/modules.ts`, then
259
+ `npx kosh migrate`. Installing does not give anyone access: grant its roles to users ([Users and roles](#users-and-roles)).
260
+
261
+ **Remove a module**: take it out of `src/modules.ts`; `npx kosh migrate` then plans dropping its tables, which is
262
+ destructive: it stops for review, and `npx kosh migrate --allow-destructive` applies it. Back up first.
263
+
264
+ ## Migrations
265
+
266
+ ```sh
267
+ npx kosh migrate # plan + apply + seed
268
+ npx kosh migrate --plan # only write the plan, to review it
269
+ npx kosh migrate --name add_isbn # name the new file (migrations/0002_add_isbn.sql)
270
+ npx kosh migrate status # applied and pending files
271
+ npx kosh migrate --allow-destructive
272
+ ```
273
+
274
+ - **Schema migrations** are SQL files in `migrations/`. `kosh migrate` compares your modules with the live database
275
+ and writes the differences as the next file (`0002_update.sql`), applies every pending file in order (each in its
276
+ own transaction, recorded in `shutro_migration`), then loads the seed data. Commit the files: a deployment runs the
277
+ same ones (the Docker `api` service runs `kosh migrate` on start).
278
+ - **Destructive changes** (dropping a column or a table, narrowing a type) are written but not applied without
279
+ `--allow-destructive`. A file written earlier and not applied yet is applied first.
280
+ - **Per-module data migrations** change existing data when a module is upgraded. Declare them in the module's
281
+ `migrations.ts` and raise the module's `version`; each runs once, in version order, when the installed version
282
+ goes past it (never on a fresh install):
283
+
284
+ ```ts
285
+ // src/modules/library/migrations.ts
286
+ import type { DataMigration } from 'shutro-erp/orm';
287
+
288
+ export const migrations: DataMigration[] = [
289
+ {
290
+ version: '0.2.0',
291
+ description: 'ISBNs without dashes',
292
+ up: async ({ sql }) => {
293
+ await sql`UPDATE library_book SET isbn = replace(isbn, '-', '')`;
294
+ },
295
+ },
296
+ ];
297
+ ```
298
+
299
+ ```sh
300
+ # index.ts: version: '0.2.0'
301
+ npx kosh migrate # … module library: 0.1.0 → 0.2.0, data migration library@0.2.0
302
+ ```
303
+
304
+ ## Seed data
305
+
306
+ Each module declares its seed data in `data.ts` as records with external ids (`library.book_welcome`). Seeding is
307
+ idempotent: new records are created, changed ones updated, records removed from the list deleted, and `noupdate`
308
+ records created once and then left to the users.
309
+
310
+ ```ts
311
+ // src/modules/library/data.ts
312
+ import { orm } from 'shutro-erp/orm';
313
+
314
+ export const data = [
315
+ orm.record('res.partner', 'author_tagore', { name: 'Rabindranath Tagore' }),
316
+ orm.record('library.book', 'book_gitanjali', {
317
+ title: 'Gitanjali',
318
+ author: orm.ref('res.partner', 'library.author_tagore'), // by external id
319
+ }),
320
+ orm.record('library.book', 'book_sample', { title: 'Sample' }, { noupdate: true }),
321
+ ];
322
+ ```
323
+
324
+ ```sh
325
+ npx kosh seed # every module's seed data, and the apps' defaults
326
+ npx kosh seed library # one module (or several: kosh seed library inventory)
327
+ ```
328
+
329
+ `kosh migrate` seeds too (skip with `--no-seed`). The apps' defaults are also seeded: approval policies
330
+ (permissions), document templates (reporting), activity types (messaging); users may edit them afterwards.
331
+
332
+ ## Users and roles
333
+
334
+ ```sh
335
+ npx kosh user create rahim --name "Rahim Uddin" --email rahim@example.com --roles library.user,messaging.user
336
+ npx kosh user password rahim # a new password (asked, hidden)
337
+ ```
338
+
339
+ Roles are the groups of the installed modules' access levels (`library.user`, `library.manager`,
340
+ `reporting.user`, `messaging.user`, …; `base.admin` is the administrator). Users see an app only when one of
341
+ their roles grants it. Administrators manage roles, field security and grants in the admin API
342
+ (`/api/v1/admin/...`, with the permissions app) and every change is audited.
343
+
344
+ ## Configuration (.env)
345
+
346
+ | Variable | Meaning |
347
+ |---|---|
348
+ | `DATABASE_URL` | PostgreSQL: `postgres://user:password@host:5432/database` |
349
+ | `PORT`, `HOST` | the API's port (3000) and address (127.0.0.1; 0.0.0.0 in Docker) |
350
+ | `KOSH_STORAGE_DIR` | attachments in this folder, or: |
351
+ | `S3_ENDPOINT`, `S3_BUCKET`, `S3_ACCESS_KEY`, `S3_SECRET_KEY`, `S3_REGION` | S3-compatible storage |
352
+ | `KOSH_ATTACHMENT_MAX_BYTES` | upload limit (25 MB) |
353
+ | `VALKEY_URL` | optional Valkey/Redis: rate limits and caches across servers |
354
+ | `KOSH_SECURE_COOKIES` | `true` behind HTTPS (default in production), `false` for plain HTTP |
355
+ | `KOSH_SCHEDULES` | `off` stops the scheduled-report ticker on this server |
356
+ | `POSTGRES_USER`, `POSTGRES_PASSWORD`, `POSTGRES_DB`, `POSTGRES_PORT` | the Docker `db` service |
357
+ | `DOCKER_DATABASE_URL`, `WEB_PORT` | Docker: another database for `api`; the back-office's port (8080) |
358
+
359
+ ## Command reference
360
+
361
+ Run them in the project folder (`npx kosh …`, or `npm run migrate` / `npm run seed`). They read `.env` and
362
+ `src/modules.ts` (`--modules <file>` for another list).
363
+
364
+ | Command | What |
365
+ |---|---|
366
+ | `kosh init [folder]` | set up an installation (questions, or flags with `--yes`); again later to enrol 2FA |
367
+ | `kosh migrate` | apply pending files, plan what is missing into a new file and apply it, run data migrations, seed |
368
+ | `kosh migrate --plan` · `--name <n>` · `--allow-destructive` · `--no-seed` | review only · file name · drops · no seeding |
369
+ | `kosh migrate status` | applied and pending migration files |
370
+ | `kosh seed [module …]` | seed data of all modules, or of those named |
371
+ | `kosh module create <name>` | a new module in `src/modules/<name>/`, listed in `src/modules.ts` |
372
+ | `kosh user create <login>` | a user: `--name`, `--email`, `--roles`, `--password` (asked when missing) |
373
+ | `kosh user password <login>` | a new password |
374
+ | `kosh generate client` | a typed API client for your front-end (`--out src/api/kosh.gen.ts`) |
375
+ | `npm start` · `npm run web` · `npm run build:web` | the API · the back-office (dev) · the back-office build (`dist/`) |
376
+ | `npm run docker:up` | `docker compose up -d --build` |
377
+
378
+ ## Entry points
379
+
380
+ | Import | What |
381
+ |---|---|
382
+ | `shutro-erp` | the server: `createServer`, `startServer`, `base`, REST + OpenAPI, sessions and 2FA |
383
+ | `shutro-erp/orm` | Shutro (models, fields, groups, records, migrations) as Kosh uses it |
384
+ | `shutro-erp/modules-sdk` | `defineModule`: manifests, access levels, menus, actions |
385
+ | `shutro-erp/views`, `shutro-erp/search` | view definitions (`list`, `form`, `kanban`, `pivot`, …) and the search layer |
386
+ | `shutro-erp/permissions` | roles, field security, approvals (`/web`: the approval panel) |
387
+ | `shutro-erp/reporting` | pivots, exports, documents, scheduled reports (`/web`: the report views) |
388
+ | `shutro-erp/messaging`, `shutro-erp/storage` | the chatter, activities, attachments (`/web`: the chatter) |
389
+ | `shutro-erp/ui` | the React app shell, design system and renderers; `shutro-erp/ui/styles.css` the tokens |
390
+ | `shutro-erp/cli` | the `kosh` command's functions |
391
+
392
+ ## Troubleshooting
393
+
394
+ - **"PostgreSQL did not answer"**: nothing listens at that host and port. Start your PostgreSQL service, or
395
+ answer `2` (Docker) to the first question; Docker Desktop must be running.
396
+ - **"password authentication failed"**: the user or password in `DATABASE_URL` is wrong.
397
+ - **Signed in but no apps**: the user has no role granting them (`kosh user create … --roles`); administrators need
398
+ their authenticator enrolled (`npx kosh init` again).
399
+ - **Sign-in works on the API but not in the browser over plain HTTP**: `KOSH_SECURE_COOKIES=false`.
400
+ - **Lost the phone**: sign in with one of the recovery codes `kosh init` printed.
401
+ - **"It drops or changes existing data"**: `kosh migrate` found a destructive change; read the new file in
402
+ `migrations/`, back up, then `npx kosh migrate --allow-destructive`.
403
+
404
+ Documentation, design notes and the source: https://github.com/isahaq1/kosh
405
+
406
+ ## Author
407
+
408
+ **Isahaq**, hmisahaq01@gmail.com, mobile +8801852376598
409
+
410
+ ## License
411
+
412
+ MIT
@@ -0,0 +1,22 @@
1
+ export { defineModel, defineModule, extendModel, f, replace } from '../../server/orm.js';
2
+ import { type DefinitionHelpers } from '../../server/orm.js';
3
+ import type { DefaultLoaded, Env as CoreEnv, RecordSet as CoreRecordSet, Shutro as CoreShutro } from '../../server/orm.js';
4
+ import type { SchemaView } from './schema.js';
5
+ export type { SchemaView };
6
+ /** Every model visible in this view. */
7
+ export type ModelName = keyof SchemaView & string;
8
+ /** `Env` typed to this view. */
9
+ export type Env = CoreEnv<SchemaView>;
10
+ /** `Shutro` typed to this view. */
11
+ export type Shutro = CoreShutro<SchemaView>;
12
+ /** A recordset of `M`, with the default loaded shape unless `L` is given. */
13
+ export type Records<M extends ModelName, L = DefaultLoaded<SchemaView, M>> = CoreRecordSet<SchemaView, M, L>;
14
+ export declare const compute: DefinitionHelpers<SchemaView>['compute'];
15
+ export declare const check: DefinitionHelpers<SchemaView>['check'];
16
+ export declare const onchange: DefinitionHelpers<SchemaView>['onchange'];
17
+ export declare const records: DefinitionHelpers<SchemaView>['records'];
18
+ export declare const method: DefinitionHelpers<SchemaView>['method'];
19
+ /** Module data (RFC 0017): records, overrides of dependencies' records, and references, typed like creates. */
20
+ export declare const record: DefinitionHelpers<SchemaView>['record'];
21
+ export declare const override: DefinitionHelpers<SchemaView>['override'];
22
+ export declare const ref: DefinitionHelpers<SchemaView>['ref'];
@@ -0,0 +1,15 @@
1
+ // GENERATED by `pnpm generate:models` (Shutro’s generator). Do not edit. definitions-hash: 5dbc1f9f7f888acd
2
+ // Bindings of module `accounting`: import the definition API from here to get types scoped to what it can see.
3
+ export { defineModel, defineModule, extendModel, f, replace } from '../../server/orm.js';
4
+ import { definitions } from '../../server/orm.js';
5
+ /** Definition callbacks typed against this module's view: no casts in computes, checks, onchange, methods. */
6
+ const helpers = definitions();
7
+ export const compute = helpers.compute;
8
+ export const check = helpers.check;
9
+ export const onchange = helpers.onchange;
10
+ export const records = helpers.records;
11
+ export const method = helpers.method;
12
+ /** Module data (RFC 0017): records, overrides of dependencies' records, and references, typed like creates. */
13
+ export const record = helpers.record;
14
+ export const override = helpers.override;
15
+ export const ref = helpers.ref;