@hasna/microservices 0.0.16 → 0.0.18

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 (293) hide show
  1. package/README.md +143 -23
  2. package/bin/index.js +784 -13987
  3. package/bin/mcp.js +298 -10973
  4. package/dist/index.js +251 -10056
  5. package/package.json +36 -26
  6. package/microservices/microservice-ads/package.json +0 -28
  7. package/microservices/microservice-ads/src/cli/index.ts +0 -605
  8. package/microservices/microservice-ads/src/db/campaigns.ts +0 -797
  9. package/microservices/microservice-ads/src/db/database.ts +0 -91
  10. package/microservices/microservice-ads/src/db/migrations.ts +0 -60
  11. package/microservices/microservice-ads/src/index.ts +0 -39
  12. package/microservices/microservice-ads/src/mcp/index.ts +0 -480
  13. package/microservices/microservice-analytics/package.json +0 -28
  14. package/microservices/microservice-analytics/src/cli/index.ts +0 -373
  15. package/microservices/microservice-analytics/src/db/analytics.ts +0 -564
  16. package/microservices/microservice-analytics/src/db/database.ts +0 -91
  17. package/microservices/microservice-analytics/src/db/migrations.ts +0 -50
  18. package/microservices/microservice-analytics/src/index.ts +0 -37
  19. package/microservices/microservice-analytics/src/mcp/index.ts +0 -334
  20. package/microservices/microservice-assets/package.json +0 -28
  21. package/microservices/microservice-assets/src/cli/index.ts +0 -375
  22. package/microservices/microservice-assets/src/db/assets.ts +0 -370
  23. package/microservices/microservice-assets/src/db/database.ts +0 -91
  24. package/microservices/microservice-assets/src/db/migrations.ts +0 -51
  25. package/microservices/microservice-assets/src/index.ts +0 -32
  26. package/microservices/microservice-assets/src/mcp/index.ts +0 -346
  27. package/microservices/microservice-bookkeeping/package.json +0 -28
  28. package/microservices/microservice-bookkeeping/src/cli/index.ts +0 -386
  29. package/microservices/microservice-bookkeeping/src/db/bookkeeping.ts +0 -591
  30. package/microservices/microservice-bookkeeping/src/db/database.ts +0 -91
  31. package/microservices/microservice-bookkeeping/src/db/migrations.ts +0 -52
  32. package/microservices/microservice-bookkeeping/src/index.ts +0 -32
  33. package/microservices/microservice-bookkeeping/src/mcp/index.ts +0 -284
  34. package/microservices/microservice-calendar/package.json +0 -28
  35. package/microservices/microservice-calendar/src/cli/index.ts +0 -287
  36. package/microservices/microservice-calendar/src/db/calendar.ts +0 -328
  37. package/microservices/microservice-calendar/src/db/database.ts +0 -91
  38. package/microservices/microservice-calendar/src/db/migrations.ts +0 -47
  39. package/microservices/microservice-calendar/src/index.ts +0 -24
  40. package/microservices/microservice-calendar/src/mcp/index.ts +0 -226
  41. package/microservices/microservice-company/package.json +0 -28
  42. package/microservices/microservice-company/src/cli/index.ts +0 -1126
  43. package/microservices/microservice-company/src/db/company.ts +0 -854
  44. package/microservices/microservice-company/src/db/database.ts +0 -91
  45. package/microservices/microservice-company/src/db/migrations.ts +0 -214
  46. package/microservices/microservice-company/src/db/workflow-migrations.ts +0 -44
  47. package/microservices/microservice-company/src/index.ts +0 -60
  48. package/microservices/microservice-company/src/lib/audit.ts +0 -168
  49. package/microservices/microservice-company/src/lib/finance.ts +0 -299
  50. package/microservices/microservice-company/src/lib/settings.ts +0 -85
  51. package/microservices/microservice-company/src/lib/workflows.ts +0 -698
  52. package/microservices/microservice-company/src/mcp/index.ts +0 -991
  53. package/microservices/microservice-compliance/package.json +0 -28
  54. package/microservices/microservice-compliance/src/cli/index.ts +0 -467
  55. package/microservices/microservice-compliance/src/db/compliance.ts +0 -633
  56. package/microservices/microservice-compliance/src/db/database.ts +0 -91
  57. package/microservices/microservice-compliance/src/db/migrations.ts +0 -63
  58. package/microservices/microservice-compliance/src/index.ts +0 -46
  59. package/microservices/microservice-compliance/src/mcp/index.ts +0 -438
  60. package/microservices/microservice-contacts/package.json +0 -28
  61. package/microservices/microservice-contacts/src/cli/index.ts +0 -393
  62. package/microservices/microservice-contacts/src/db/companies.ts +0 -167
  63. package/microservices/microservice-contacts/src/db/contacts.ts +0 -249
  64. package/microservices/microservice-contacts/src/db/database.ts +0 -91
  65. package/microservices/microservice-contacts/src/db/migrations.ts +0 -71
  66. package/microservices/microservice-contacts/src/db/relationships.ts +0 -53
  67. package/microservices/microservice-contacts/src/index.ts +0 -42
  68. package/microservices/microservice-contacts/src/mcp/index.ts +0 -303
  69. package/microservices/microservice-contracts/package.json +0 -28
  70. package/microservices/microservice-contracts/src/cli/index.ts +0 -770
  71. package/microservices/microservice-contracts/src/db/contracts.ts +0 -925
  72. package/microservices/microservice-contracts/src/db/database.ts +0 -91
  73. package/microservices/microservice-contracts/src/db/migrations.ts +0 -141
  74. package/microservices/microservice-contracts/src/index.ts +0 -43
  75. package/microservices/microservice-contracts/src/mcp/index.ts +0 -617
  76. package/microservices/microservice-crm/package.json +0 -28
  77. package/microservices/microservice-crm/src/cli/index.ts +0 -396
  78. package/microservices/microservice-crm/src/db/database.ts +0 -91
  79. package/microservices/microservice-crm/src/db/migrations.ts +0 -66
  80. package/microservices/microservice-crm/src/db/pipeline.ts +0 -397
  81. package/microservices/microservice-crm/src/index.ts +0 -34
  82. package/microservices/microservice-crm/src/mcp/index.ts +0 -294
  83. package/microservices/microservice-documents/package.json +0 -28
  84. package/microservices/microservice-documents/src/cli/index.ts +0 -246
  85. package/microservices/microservice-documents/src/db/database.ts +0 -91
  86. package/microservices/microservice-documents/src/db/documents.ts +0 -316
  87. package/microservices/microservice-documents/src/db/migrations.ts +0 -49
  88. package/microservices/microservice-documents/src/index.ts +0 -24
  89. package/microservices/microservice-documents/src/mcp/index.ts +0 -202
  90. package/microservices/microservice-domains/package.json +0 -28
  91. package/microservices/microservice-domains/src/cli/index.ts +0 -1111
  92. package/microservices/microservice-domains/src/db/database.ts +0 -91
  93. package/microservices/microservice-domains/src/db/domains.ts +0 -1164
  94. package/microservices/microservice-domains/src/db/migrations.ts +0 -60
  95. package/microservices/microservice-domains/src/index.ts +0 -65
  96. package/microservices/microservice-domains/src/lib/brandsight.ts +0 -350
  97. package/microservices/microservice-domains/src/lib/godaddy.ts +0 -338
  98. package/microservices/microservice-domains/src/lib/namecheap.ts +0 -262
  99. package/microservices/microservice-domains/src/lib/registrar.ts +0 -355
  100. package/microservices/microservice-domains/src/mcp/index.ts +0 -781
  101. package/microservices/microservice-expenses/package.json +0 -28
  102. package/microservices/microservice-expenses/src/cli/index.ts +0 -267
  103. package/microservices/microservice-expenses/src/db/database.ts +0 -91
  104. package/microservices/microservice-expenses/src/db/expenses.ts +0 -345
  105. package/microservices/microservice-expenses/src/db/migrations.ts +0 -45
  106. package/microservices/microservice-expenses/src/index.ts +0 -25
  107. package/microservices/microservice-expenses/src/mcp/index.ts +0 -196
  108. package/microservices/microservice-habits/package.json +0 -28
  109. package/microservices/microservice-habits/src/cli/index.ts +0 -315
  110. package/microservices/microservice-habits/src/db/database.ts +0 -91
  111. package/microservices/microservice-habits/src/db/habits.ts +0 -451
  112. package/microservices/microservice-habits/src/db/migrations.ts +0 -46
  113. package/microservices/microservice-habits/src/index.ts +0 -31
  114. package/microservices/microservice-habits/src/mcp/index.ts +0 -313
  115. package/microservices/microservice-health/package.json +0 -28
  116. package/microservices/microservice-health/src/cli/index.ts +0 -484
  117. package/microservices/microservice-health/src/db/database.ts +0 -91
  118. package/microservices/microservice-health/src/db/health.ts +0 -708
  119. package/microservices/microservice-health/src/db/migrations.ts +0 -70
  120. package/microservices/microservice-health/src/index.ts +0 -63
  121. package/microservices/microservice-health/src/mcp/index.ts +0 -437
  122. package/microservices/microservice-hiring/package.json +0 -28
  123. package/microservices/microservice-hiring/src/cli/index.ts +0 -741
  124. package/microservices/microservice-hiring/src/db/database.ts +0 -91
  125. package/microservices/microservice-hiring/src/db/hiring.ts +0 -1085
  126. package/microservices/microservice-hiring/src/db/migrations.ts +0 -89
  127. package/microservices/microservice-hiring/src/index.ts +0 -80
  128. package/microservices/microservice-hiring/src/lib/scoring.ts +0 -206
  129. package/microservices/microservice-hiring/src/mcp/index.ts +0 -709
  130. package/microservices/microservice-inventory/package.json +0 -28
  131. package/microservices/microservice-inventory/src/cli/index.ts +0 -365
  132. package/microservices/microservice-inventory/src/db/database.ts +0 -91
  133. package/microservices/microservice-inventory/src/db/inventory.ts +0 -393
  134. package/microservices/microservice-inventory/src/db/migrations.ts +0 -54
  135. package/microservices/microservice-inventory/src/index.ts +0 -28
  136. package/microservices/microservice-inventory/src/mcp/index.ts +0 -250
  137. package/microservices/microservice-invoices/dashboard/index.html +0 -12
  138. package/microservices/microservice-invoices/dashboard/package.json +0 -29
  139. package/microservices/microservice-invoices/dashboard/tsconfig.json +0 -14
  140. package/microservices/microservice-invoices/dashboard/vite.config.ts +0 -15
  141. package/microservices/microservice-invoices/package.json +0 -31
  142. package/microservices/microservice-invoices/src/cli/index.ts +0 -308
  143. package/microservices/microservice-invoices/src/db/business.ts +0 -241
  144. package/microservices/microservice-invoices/src/db/clients.ts +0 -127
  145. package/microservices/microservice-invoices/src/db/database.ts +0 -91
  146. package/microservices/microservice-invoices/src/db/invoices.ts +0 -345
  147. package/microservices/microservice-invoices/src/db/migrations.ts +0 -184
  148. package/microservices/microservice-invoices/src/index.ts +0 -56
  149. package/microservices/microservice-invoices/src/mcp/index.ts +0 -242
  150. package/microservices/microservice-invoices/src/server/index.ts +0 -162
  151. package/microservices/microservice-leads/package.json +0 -28
  152. package/microservices/microservice-leads/src/cli/index.ts +0 -596
  153. package/microservices/microservice-leads/src/db/database.ts +0 -91
  154. package/microservices/microservice-leads/src/db/leads.ts +0 -520
  155. package/microservices/microservice-leads/src/db/lists.ts +0 -151
  156. package/microservices/microservice-leads/src/db/migrations.ts +0 -93
  157. package/microservices/microservice-leads/src/index.ts +0 -65
  158. package/microservices/microservice-leads/src/lib/enrichment.ts +0 -202
  159. package/microservices/microservice-leads/src/lib/scoring.ts +0 -134
  160. package/microservices/microservice-leads/src/mcp/index.ts +0 -533
  161. package/microservices/microservice-notes/package.json +0 -28
  162. package/microservices/microservice-notes/src/cli/index.ts +0 -63
  163. package/microservices/microservice-notes/src/db/database.ts +0 -91
  164. package/microservices/microservice-notes/src/db/migrations.ts +0 -40
  165. package/microservices/microservice-notes/src/db/notes.ts +0 -114
  166. package/microservices/microservice-notes/src/index.ts +0 -2
  167. package/microservices/microservice-notes/src/mcp/index.ts +0 -37
  168. package/microservices/microservice-notifications/package.json +0 -28
  169. package/microservices/microservice-notifications/src/cli/index.ts +0 -349
  170. package/microservices/microservice-notifications/src/db/database.ts +0 -91
  171. package/microservices/microservice-notifications/src/db/migrations.ts +0 -62
  172. package/microservices/microservice-notifications/src/db/notifications.ts +0 -509
  173. package/microservices/microservice-notifications/src/index.ts +0 -41
  174. package/microservices/microservice-notifications/src/mcp/index.ts +0 -422
  175. package/microservices/microservice-payments/package.json +0 -28
  176. package/microservices/microservice-payments/src/cli/index.ts +0 -609
  177. package/microservices/microservice-payments/src/db/database.ts +0 -91
  178. package/microservices/microservice-payments/src/db/migrations.ts +0 -81
  179. package/microservices/microservice-payments/src/db/payments.ts +0 -1204
  180. package/microservices/microservice-payments/src/index.ts +0 -51
  181. package/microservices/microservice-payments/src/mcp/index.ts +0 -683
  182. package/microservices/microservice-payroll/package.json +0 -28
  183. package/microservices/microservice-payroll/src/cli/index.ts +0 -643
  184. package/microservices/microservice-payroll/src/db/database.ts +0 -91
  185. package/microservices/microservice-payroll/src/db/migrations.ts +0 -95
  186. package/microservices/microservice-payroll/src/db/payroll.ts +0 -1377
  187. package/microservices/microservice-payroll/src/index.ts +0 -48
  188. package/microservices/microservice-payroll/src/mcp/index.ts +0 -666
  189. package/microservices/microservice-products/package.json +0 -28
  190. package/microservices/microservice-products/src/cli/index.ts +0 -416
  191. package/microservices/microservice-products/src/db/categories.ts +0 -154
  192. package/microservices/microservice-products/src/db/database.ts +0 -91
  193. package/microservices/microservice-products/src/db/migrations.ts +0 -58
  194. package/microservices/microservice-products/src/db/pricing-tiers.ts +0 -66
  195. package/microservices/microservice-products/src/db/products.ts +0 -452
  196. package/microservices/microservice-products/src/index.ts +0 -53
  197. package/microservices/microservice-products/src/mcp/index.ts +0 -453
  198. package/microservices/microservice-projects/package.json +0 -28
  199. package/microservices/microservice-projects/src/cli/index.ts +0 -480
  200. package/microservices/microservice-projects/src/db/database.ts +0 -91
  201. package/microservices/microservice-projects/src/db/migrations.ts +0 -65
  202. package/microservices/microservice-projects/src/db/projects.ts +0 -715
  203. package/microservices/microservice-projects/src/index.ts +0 -57
  204. package/microservices/microservice-projects/src/mcp/index.ts +0 -501
  205. package/microservices/microservice-proposals/package.json +0 -28
  206. package/microservices/microservice-proposals/src/cli/index.ts +0 -400
  207. package/microservices/microservice-proposals/src/db/database.ts +0 -91
  208. package/microservices/microservice-proposals/src/db/migrations.ts +0 -52
  209. package/microservices/microservice-proposals/src/db/proposals.ts +0 -532
  210. package/microservices/microservice-proposals/src/index.ts +0 -37
  211. package/microservices/microservice-proposals/src/mcp/index.ts +0 -375
  212. package/microservices/microservice-reading/package.json +0 -28
  213. package/microservices/microservice-reading/src/cli/index.ts +0 -464
  214. package/microservices/microservice-reading/src/db/database.ts +0 -91
  215. package/microservices/microservice-reading/src/db/migrations.ts +0 -59
  216. package/microservices/microservice-reading/src/db/reading.ts +0 -524
  217. package/microservices/microservice-reading/src/index.ts +0 -51
  218. package/microservices/microservice-reading/src/mcp/index.ts +0 -368
  219. package/microservices/microservice-shipping/package.json +0 -28
  220. package/microservices/microservice-shipping/src/cli/index.ts +0 -606
  221. package/microservices/microservice-shipping/src/db/database.ts +0 -91
  222. package/microservices/microservice-shipping/src/db/migrations.ts +0 -69
  223. package/microservices/microservice-shipping/src/db/shipping.ts +0 -1093
  224. package/microservices/microservice-shipping/src/index.ts +0 -53
  225. package/microservices/microservice-shipping/src/mcp/index.ts +0 -533
  226. package/microservices/microservice-social/package.json +0 -29
  227. package/microservices/microservice-social/src/cli/index.ts +0 -1583
  228. package/microservices/microservice-social/src/db/database.ts +0 -91
  229. package/microservices/microservice-social/src/db/migrations.ts +0 -160
  230. package/microservices/microservice-social/src/db/social.ts +0 -1076
  231. package/microservices/microservice-social/src/index.ts +0 -46
  232. package/microservices/microservice-social/src/lib/audience.ts +0 -353
  233. package/microservices/microservice-social/src/lib/content-ai.ts +0 -278
  234. package/microservices/microservice-social/src/lib/media.ts +0 -311
  235. package/microservices/microservice-social/src/lib/mentions.ts +0 -434
  236. package/microservices/microservice-social/src/lib/metrics-sync.ts +0 -264
  237. package/microservices/microservice-social/src/lib/publisher.ts +0 -377
  238. package/microservices/microservice-social/src/lib/scheduler.ts +0 -229
  239. package/microservices/microservice-social/src/lib/sentiment.ts +0 -256
  240. package/microservices/microservice-social/src/lib/threads.ts +0 -291
  241. package/microservices/microservice-social/src/mcp/index.ts +0 -1425
  242. package/microservices/microservice-social/src/server/index.ts +0 -441
  243. package/microservices/microservice-subscriptions/package.json +0 -28
  244. package/microservices/microservice-subscriptions/src/cli/index.ts +0 -715
  245. package/microservices/microservice-subscriptions/src/db/database.ts +0 -91
  246. package/microservices/microservice-subscriptions/src/db/migrations.ts +0 -125
  247. package/microservices/microservice-subscriptions/src/db/subscriptions.ts +0 -1256
  248. package/microservices/microservice-subscriptions/src/index.ts +0 -41
  249. package/microservices/microservice-subscriptions/src/mcp/index.ts +0 -631
  250. package/microservices/microservice-timesheets/package.json +0 -28
  251. package/microservices/microservice-timesheets/src/cli/index.ts +0 -373
  252. package/microservices/microservice-timesheets/src/db/database.ts +0 -91
  253. package/microservices/microservice-timesheets/src/db/locale.ts +0 -217
  254. package/microservices/microservice-timesheets/src/db/migrations.ts +0 -74
  255. package/microservices/microservice-timesheets/src/db/timesheets.ts +0 -447
  256. package/microservices/microservice-timesheets/src/index.ts +0 -44
  257. package/microservices/microservice-timesheets/src/mcp/index.ts +0 -269
  258. package/microservices/microservice-transcriber/package.json +0 -29
  259. package/microservices/microservice-transcriber/src/cli/index.ts +0 -1593
  260. package/microservices/microservice-transcriber/src/db/annotations.ts +0 -37
  261. package/microservices/microservice-transcriber/src/db/comments.ts +0 -166
  262. package/microservices/microservice-transcriber/src/db/database.ts +0 -91
  263. package/microservices/microservice-transcriber/src/db/migrations.ts +0 -118
  264. package/microservices/microservice-transcriber/src/db/proofread.ts +0 -119
  265. package/microservices/microservice-transcriber/src/db/transcripts.ts +0 -395
  266. package/microservices/microservice-transcriber/src/index.ts +0 -43
  267. package/microservices/microservice-transcriber/src/lib/config.ts +0 -77
  268. package/microservices/microservice-transcriber/src/lib/diff.ts +0 -91
  269. package/microservices/microservice-transcriber/src/lib/downloader.ts +0 -638
  270. package/microservices/microservice-transcriber/src/lib/feeds.ts +0 -62
  271. package/microservices/microservice-transcriber/src/lib/live.ts +0 -94
  272. package/microservices/microservice-transcriber/src/lib/notion.ts +0 -129
  273. package/microservices/microservice-transcriber/src/lib/proofread.ts +0 -296
  274. package/microservices/microservice-transcriber/src/lib/providers.ts +0 -713
  275. package/microservices/microservice-transcriber/src/lib/summarizer.ts +0 -147
  276. package/microservices/microservice-transcriber/src/lib/translator.ts +0 -75
  277. package/microservices/microservice-transcriber/src/lib/webhook.ts +0 -37
  278. package/microservices/microservice-transcriber/src/mcp/index.ts +0 -1330
  279. package/microservices/microservice-transcriber/src/server/index.ts +0 -199
  280. package/microservices/microservice-travel/package.json +0 -28
  281. package/microservices/microservice-travel/src/cli/index.ts +0 -505
  282. package/microservices/microservice-travel/src/db/database.ts +0 -91
  283. package/microservices/microservice-travel/src/db/migrations.ts +0 -77
  284. package/microservices/microservice-travel/src/db/travel.ts +0 -802
  285. package/microservices/microservice-travel/src/index.ts +0 -60
  286. package/microservices/microservice-travel/src/mcp/index.ts +0 -495
  287. package/microservices/microservice-wiki/package.json +0 -28
  288. package/microservices/microservice-wiki/src/cli/index.ts +0 -345
  289. package/microservices/microservice-wiki/src/db/database.ts +0 -91
  290. package/microservices/microservice-wiki/src/db/migrations.ts +0 -55
  291. package/microservices/microservice-wiki/src/db/wiki.ts +0 -395
  292. package/microservices/microservice-wiki/src/index.ts +0 -32
  293. package/microservices/microservice-wiki/src/mcp/index.ts +0 -344
@@ -1,70 +0,0 @@
1
- export interface MigrationEntry {
2
- id: number;
3
- name: string;
4
- sql: string;
5
- }
6
-
7
- export const MIGRATIONS: MigrationEntry[] = [
8
- {
9
- id: 1,
10
- name: "initial_schema",
11
- sql: `
12
- CREATE TABLE IF NOT EXISTS metrics (
13
- id TEXT PRIMARY KEY,
14
- type TEXT NOT NULL,
15
- value REAL NOT NULL,
16
- unit TEXT,
17
- notes TEXT,
18
- recorded_at TEXT NOT NULL,
19
- metadata TEXT NOT NULL DEFAULT '{}',
20
- created_at TEXT NOT NULL DEFAULT (datetime('now'))
21
- );
22
-
23
- CREATE TABLE IF NOT EXISTS medications (
24
- id TEXT PRIMARY KEY,
25
- name TEXT NOT NULL,
26
- dosage TEXT,
27
- frequency TEXT,
28
- start_date TEXT,
29
- end_date TEXT,
30
- refill_date TEXT,
31
- notes TEXT,
32
- active INTEGER NOT NULL DEFAULT 1,
33
- created_at TEXT NOT NULL DEFAULT (datetime('now'))
34
- );
35
-
36
- CREATE TABLE IF NOT EXISTS appointments (
37
- id TEXT PRIMARY KEY,
38
- provider TEXT NOT NULL,
39
- specialty TEXT,
40
- location TEXT,
41
- scheduled_at TEXT NOT NULL,
42
- status TEXT NOT NULL DEFAULT 'scheduled' CHECK(status IN ('scheduled','completed','cancelled','rescheduled')),
43
- notes TEXT,
44
- follow_up_date TEXT,
45
- metadata TEXT NOT NULL DEFAULT '{}',
46
- created_at TEXT NOT NULL DEFAULT (datetime('now'))
47
- );
48
-
49
- CREATE TABLE IF NOT EXISTS fitness_logs (
50
- id TEXT PRIMARY KEY,
51
- activity TEXT NOT NULL,
52
- duration_min INTEGER,
53
- calories_burned INTEGER,
54
- distance REAL,
55
- notes TEXT,
56
- logged_at TEXT NOT NULL,
57
- created_at TEXT NOT NULL DEFAULT (datetime('now'))
58
- );
59
-
60
- CREATE INDEX IF NOT EXISTS idx_metrics_type ON metrics(type);
61
- CREATE INDEX IF NOT EXISTS idx_metrics_recorded_at ON metrics(recorded_at);
62
- CREATE INDEX IF NOT EXISTS idx_medications_active ON medications(active);
63
- CREATE INDEX IF NOT EXISTS idx_medications_name ON medications(name);
64
- CREATE INDEX IF NOT EXISTS idx_appointments_scheduled_at ON appointments(scheduled_at);
65
- CREATE INDEX IF NOT EXISTS idx_appointments_status ON appointments(status);
66
- CREATE INDEX IF NOT EXISTS idx_fitness_logs_activity ON fitness_logs(activity);
67
- CREATE INDEX IF NOT EXISTS idx_fitness_logs_logged_at ON fitness_logs(logged_at);
68
- `,
69
- },
70
- ];
@@ -1,63 +0,0 @@
1
- /**
2
- * microservice-health — Health tracking microservice
3
- */
4
-
5
- export {
6
- createMetric,
7
- getMetric,
8
- listMetrics,
9
- deleteMetric,
10
- getMetricTrend,
11
- type Metric,
12
- type CreateMetricInput,
13
- type ListMetricsOptions,
14
- type MetricTrendPoint,
15
- } from "./db/health.js";
16
-
17
- export {
18
- createMedication,
19
- getMedication,
20
- listMedications,
21
- updateMedication,
22
- deactivateMedication,
23
- deleteMedication,
24
- getMedicationSchedule,
25
- type Medication,
26
- type CreateMedicationInput,
27
- type UpdateMedicationInput,
28
- type ListMedicationsOptions,
29
- } from "./db/health.js";
30
-
31
- export {
32
- createAppointment,
33
- getAppointment,
34
- listAppointments,
35
- updateAppointment,
36
- completeAppointment,
37
- cancelAppointment,
38
- deleteAppointment,
39
- getUpcomingAppointments,
40
- type Appointment,
41
- type CreateAppointmentInput,
42
- type UpdateAppointmentInput,
43
- type ListAppointmentsOptions,
44
- } from "./db/health.js";
45
-
46
- export {
47
- createFitnessLog,
48
- getFitnessLog,
49
- listFitnessLogs,
50
- deleteFitnessLog,
51
- getFitnessStats,
52
- type FitnessLog,
53
- type CreateFitnessLogInput,
54
- type ListFitnessLogsOptions,
55
- type FitnessStats,
56
- } from "./db/health.js";
57
-
58
- export {
59
- getHealthSummary,
60
- type HealthSummary,
61
- } from "./db/health.js";
62
-
63
- export { getDatabase, closeDatabase } from "./db/database.js";
@@ -1,437 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
4
- import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
5
- import { z } from "zod";
6
- import {
7
- createMetric,
8
- getMetric,
9
- listMetrics,
10
- deleteMetric,
11
- getMetricTrend,
12
- createMedication,
13
- getMedication,
14
- listMedications,
15
- updateMedication,
16
- deactivateMedication,
17
- getMedicationSchedule,
18
- createAppointment,
19
- getAppointment,
20
- listAppointments,
21
- updateAppointment,
22
- completeAppointment,
23
- cancelAppointment,
24
- getUpcomingAppointments,
25
- createFitnessLog,
26
- getFitnessLog,
27
- listFitnessLogs,
28
- deleteFitnessLog,
29
- getFitnessStats,
30
- getHealthSummary,
31
- } from "../db/health.js";
32
-
33
- const server = new McpServer({
34
- name: "microservice-health",
35
- version: "0.0.1",
36
- });
37
-
38
- // --- Metrics ---
39
-
40
- server.registerTool(
41
- "record_metric",
42
- {
43
- title: "Record Metric",
44
- description: "Record a health metric (e.g. weight, blood pressure, heart rate).",
45
- inputSchema: {
46
- type: z.string(),
47
- value: z.number(),
48
- unit: z.string().optional(),
49
- notes: z.string().optional(),
50
- recorded_at: z.string().optional(),
51
- },
52
- },
53
- async (params) => {
54
- const metric = createMetric(params);
55
- return { content: [{ type: "text", text: JSON.stringify(metric, null, 2) }] };
56
- }
57
- );
58
-
59
- server.registerTool(
60
- "get_metric",
61
- {
62
- title: "Get Metric",
63
- description: "Get a metric by ID.",
64
- inputSchema: { id: z.string() },
65
- },
66
- async ({ id }) => {
67
- const metric = getMetric(id);
68
- if (!metric) {
69
- return { content: [{ type: "text", text: `Metric '${id}' not found.` }], isError: true };
70
- }
71
- return { content: [{ type: "text", text: JSON.stringify(metric, null, 2) }] };
72
- }
73
- );
74
-
75
- server.registerTool(
76
- "list_metrics",
77
- {
78
- title: "List Metrics",
79
- description: "List health metrics with optional filters.",
80
- inputSchema: {
81
- type: z.string().optional(),
82
- limit: z.number().optional(),
83
- },
84
- },
85
- async (params) => {
86
- const metrics = listMetrics(params);
87
- return {
88
- content: [
89
- { type: "text", text: JSON.stringify({ metrics, count: metrics.length }, null, 2) },
90
- ],
91
- };
92
- }
93
- );
94
-
95
- server.registerTool(
96
- "delete_metric",
97
- {
98
- title: "Delete Metric",
99
- description: "Delete a metric by ID.",
100
- inputSchema: { id: z.string() },
101
- },
102
- async ({ id }) => {
103
- const deleted = deleteMetric(id);
104
- return { content: [{ type: "text", text: JSON.stringify({ id, deleted }) }] };
105
- }
106
- );
107
-
108
- server.registerTool(
109
- "get_metric_trend",
110
- {
111
- title: "Get Metric Trend",
112
- description: "Get daily average trend for a metric type over N days.",
113
- inputSchema: {
114
- type: z.string(),
115
- days: z.number().optional().default(30),
116
- },
117
- },
118
- async ({ type, days }) => {
119
- const trend = getMetricTrend(type, days);
120
- return {
121
- content: [{ type: "text", text: JSON.stringify({ type, days, trend }, null, 2) }],
122
- };
123
- }
124
- );
125
-
126
- // --- Medications ---
127
-
128
- server.registerTool(
129
- "add_medication",
130
- {
131
- title: "Add Medication",
132
- description: "Add a new medication.",
133
- inputSchema: {
134
- name: z.string(),
135
- dosage: z.string().optional(),
136
- frequency: z.string().optional(),
137
- start_date: z.string().optional(),
138
- end_date: z.string().optional(),
139
- refill_date: z.string().optional(),
140
- notes: z.string().optional(),
141
- },
142
- },
143
- async (params) => {
144
- const med = createMedication(params);
145
- return { content: [{ type: "text", text: JSON.stringify(med, null, 2) }] };
146
- }
147
- );
148
-
149
- server.registerTool(
150
- "get_medication",
151
- {
152
- title: "Get Medication",
153
- description: "Get a medication by ID.",
154
- inputSchema: { id: z.string() },
155
- },
156
- async ({ id }) => {
157
- const med = getMedication(id);
158
- if (!med) {
159
- return { content: [{ type: "text", text: `Medication '${id}' not found.` }], isError: true };
160
- }
161
- return { content: [{ type: "text", text: JSON.stringify(med, null, 2) }] };
162
- }
163
- );
164
-
165
- server.registerTool(
166
- "list_medications",
167
- {
168
- title: "List Medications",
169
- description: "List medications with optional filters.",
170
- inputSchema: {
171
- active: z.boolean().optional(),
172
- search: z.string().optional(),
173
- limit: z.number().optional(),
174
- },
175
- },
176
- async (params) => {
177
- const meds = listMedications(params);
178
- return {
179
- content: [
180
- { type: "text", text: JSON.stringify({ medications: meds, count: meds.length }, null, 2) },
181
- ],
182
- };
183
- }
184
- );
185
-
186
- server.registerTool(
187
- "update_medication",
188
- {
189
- title: "Update Medication",
190
- description: "Update an existing medication.",
191
- inputSchema: {
192
- id: z.string(),
193
- name: z.string().optional(),
194
- dosage: z.string().optional(),
195
- frequency: z.string().optional(),
196
- start_date: z.string().optional(),
197
- end_date: z.string().optional(),
198
- refill_date: z.string().optional(),
199
- notes: z.string().optional(),
200
- active: z.boolean().optional(),
201
- },
202
- },
203
- async ({ id, ...input }) => {
204
- const med = updateMedication(id, input);
205
- if (!med) {
206
- return { content: [{ type: "text", text: `Medication '${id}' not found.` }], isError: true };
207
- }
208
- return { content: [{ type: "text", text: JSON.stringify(med, null, 2) }] };
209
- }
210
- );
211
-
212
- server.registerTool(
213
- "deactivate_medication",
214
- {
215
- title: "Deactivate Medication",
216
- description: "Deactivate a medication (mark as no longer active).",
217
- inputSchema: { id: z.string() },
218
- },
219
- async ({ id }) => {
220
- const med = deactivateMedication(id);
221
- if (!med) {
222
- return { content: [{ type: "text", text: `Medication '${id}' not found.` }], isError: true };
223
- }
224
- return { content: [{ type: "text", text: JSON.stringify(med, null, 2) }] };
225
- }
226
- );
227
-
228
- server.registerTool(
229
- "get_medication_schedule",
230
- {
231
- title: "Get Medication Schedule",
232
- description: "Get all active medications (current medication schedule).",
233
- inputSchema: {},
234
- },
235
- async () => {
236
- const meds = getMedicationSchedule();
237
- return {
238
- content: [
239
- { type: "text", text: JSON.stringify({ medications: meds, count: meds.length }, null, 2) },
240
- ],
241
- };
242
- }
243
- );
244
-
245
- // --- Appointments ---
246
-
247
- server.registerTool(
248
- "schedule_appointment",
249
- {
250
- title: "Schedule Appointment",
251
- description: "Schedule a new appointment.",
252
- inputSchema: {
253
- provider: z.string(),
254
- scheduled_at: z.string(),
255
- specialty: z.string().optional(),
256
- location: z.string().optional(),
257
- notes: z.string().optional(),
258
- follow_up_date: z.string().optional(),
259
- },
260
- },
261
- async (params) => {
262
- const appt = createAppointment(params);
263
- return { content: [{ type: "text", text: JSON.stringify(appt, null, 2) }] };
264
- }
265
- );
266
-
267
- server.registerTool(
268
- "get_appointment",
269
- {
270
- title: "Get Appointment",
271
- description: "Get an appointment by ID.",
272
- inputSchema: { id: z.string() },
273
- },
274
- async ({ id }) => {
275
- const appt = getAppointment(id);
276
- if (!appt) {
277
- return { content: [{ type: "text", text: `Appointment '${id}' not found.` }], isError: true };
278
- }
279
- return { content: [{ type: "text", text: JSON.stringify(appt, null, 2) }] };
280
- }
281
- );
282
-
283
- server.registerTool(
284
- "list_appointments",
285
- {
286
- title: "List Appointments",
287
- description: "List appointments with optional filters.",
288
- inputSchema: {
289
- status: z.string().optional(),
290
- provider: z.string().optional(),
291
- limit: z.number().optional(),
292
- },
293
- },
294
- async (params) => {
295
- const appts = listAppointments(params);
296
- return {
297
- content: [
298
- { type: "text", text: JSON.stringify({ appointments: appts, count: appts.length }, null, 2) },
299
- ],
300
- };
301
- }
302
- );
303
-
304
- server.registerTool(
305
- "complete_appointment",
306
- {
307
- title: "Complete Appointment",
308
- description: "Mark an appointment as completed.",
309
- inputSchema: { id: z.string() },
310
- },
311
- async ({ id }) => {
312
- const appt = completeAppointment(id);
313
- if (!appt) {
314
- return { content: [{ type: "text", text: `Appointment '${id}' not found.` }], isError: true };
315
- }
316
- return { content: [{ type: "text", text: JSON.stringify(appt, null, 2) }] };
317
- }
318
- );
319
-
320
- server.registerTool(
321
- "cancel_appointment",
322
- {
323
- title: "Cancel Appointment",
324
- description: "Cancel an appointment.",
325
- inputSchema: { id: z.string() },
326
- },
327
- async ({ id }) => {
328
- const appt = cancelAppointment(id);
329
- if (!appt) {
330
- return { content: [{ type: "text", text: `Appointment '${id}' not found.` }], isError: true };
331
- }
332
- return { content: [{ type: "text", text: JSON.stringify(appt, null, 2) }] };
333
- }
334
- );
335
-
336
- server.registerTool(
337
- "get_upcoming_appointments",
338
- {
339
- title: "Get Upcoming Appointments",
340
- description: "Get scheduled appointments within the next N days.",
341
- inputSchema: {
342
- days: z.number().optional().default(30),
343
- },
344
- },
345
- async ({ days }) => {
346
- const appts = getUpcomingAppointments(days);
347
- return {
348
- content: [
349
- { type: "text", text: JSON.stringify({ appointments: appts, count: appts.length, days }, null, 2) },
350
- ],
351
- };
352
- }
353
- );
354
-
355
- // --- Fitness ---
356
-
357
- server.registerTool(
358
- "log_fitness",
359
- {
360
- title: "Log Fitness Activity",
361
- description: "Log a fitness activity (e.g. running, swimming, yoga).",
362
- inputSchema: {
363
- activity: z.string(),
364
- duration_min: z.number().optional(),
365
- calories_burned: z.number().optional(),
366
- distance: z.number().optional(),
367
- notes: z.string().optional(),
368
- logged_at: z.string().optional(),
369
- },
370
- },
371
- async (params) => {
372
- const log = createFitnessLog(params);
373
- return { content: [{ type: "text", text: JSON.stringify(log, null, 2) }] };
374
- }
375
- );
376
-
377
- server.registerTool(
378
- "list_fitness_logs",
379
- {
380
- title: "List Fitness Logs",
381
- description: "List fitness logs with optional filters.",
382
- inputSchema: {
383
- activity: z.string().optional(),
384
- limit: z.number().optional(),
385
- },
386
- },
387
- async (params) => {
388
- const logs = listFitnessLogs(params);
389
- return {
390
- content: [
391
- { type: "text", text: JSON.stringify({ logs, count: logs.length }, null, 2) },
392
- ],
393
- };
394
- }
395
- );
396
-
397
- server.registerTool(
398
- "get_fitness_stats",
399
- {
400
- title: "Get Fitness Stats",
401
- description: "Get fitness statistics for the last N days.",
402
- inputSchema: {
403
- days: z.number().optional().default(30),
404
- },
405
- },
406
- async ({ days }) => {
407
- const stats = getFitnessStats(days);
408
- return { content: [{ type: "text", text: JSON.stringify({ days, ...stats }, null, 2) }] };
409
- }
410
- );
411
-
412
- // --- Summary ---
413
-
414
- server.registerTool(
415
- "get_health_summary",
416
- {
417
- title: "Get Health Summary",
418
- description: "Get an overview of all health data: metrics, medications, appointments, and fitness.",
419
- inputSchema: {},
420
- },
421
- async () => {
422
- const summary = getHealthSummary();
423
- return { content: [{ type: "text", text: JSON.stringify(summary, null, 2) }] };
424
- }
425
- );
426
-
427
- // --- Start ---
428
- async function main() {
429
- const transport = new StdioServerTransport();
430
- await server.connect(transport);
431
- console.error("microservice-health MCP server running on stdio");
432
- }
433
-
434
- main().catch((error) => {
435
- console.error("Fatal error:", error);
436
- process.exit(1);
437
- });
@@ -1,28 +0,0 @@
1
- {
2
- "name": "@hasna/microservice-hiring",
3
- "version": "0.0.1",
4
- "description": "Applicant tracking and recruitment microservice with SQLite — manage jobs, applicants, and interviews",
5
- "type": "module",
6
- "bin": {
7
- "microservice-hiring": "./src/cli/index.ts",
8
- "microservice-hiring-mcp": "./src/mcp/index.ts"
9
- },
10
- "exports": {
11
- ".": "./src/index.ts"
12
- },
13
- "scripts": {
14
- "dev": "bun run ./src/cli/index.ts",
15
- "test": "bun test"
16
- },
17
- "dependencies": {
18
- "@hasna/cloud": "^0.1.24",
19
- "@modelcontextprotocol/sdk": "^1.26.0",
20
- "commander": "^12.1.0",
21
- "zod": "^3.24.0"
22
- },
23
- "license": "Apache-2.0",
24
- "publishConfig": {
25
- "registry": "https://registry.npmjs.org",
26
- "access": "public"
27
- }
28
- }