@hasna/microservices 0.0.16 → 0.0.17

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 +711 -13998
  3. package/bin/mcp.js +228 -10987
  4. package/dist/index.js +166 -10056
  5. package/package.json +25 -25
  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,60 +0,0 @@
1
- /**
2
- * microservice-travel — Travel management microservice
3
- */
4
-
5
- export {
6
- createTrip,
7
- getTrip,
8
- listTrips,
9
- updateTrip,
10
- deleteTrip,
11
- type Trip,
12
- type CreateTripInput,
13
- type UpdateTripInput,
14
- type ListTripsOptions,
15
- } from "./db/travel.js";
16
-
17
- export {
18
- createBooking,
19
- getBooking,
20
- listBookings,
21
- cancelBooking,
22
- deleteBooking,
23
- type Booking,
24
- type CreateBookingInput,
25
- type ListBookingsOptions,
26
- } from "./db/travel.js";
27
-
28
- export {
29
- createDocument,
30
- getDocument,
31
- listDocuments,
32
- deleteDocument,
33
- type TravelDocument,
34
- type CreateDocumentInput,
35
- type ListDocumentsOptions,
36
- } from "./db/travel.js";
37
-
38
- export {
39
- createLoyaltyProgram,
40
- getLoyaltyProgram,
41
- listLoyaltyPrograms,
42
- updateLoyaltyProgram,
43
- deleteLoyaltyProgram,
44
- type LoyaltyProgram,
45
- type CreateLoyaltyInput,
46
- type UpdateLoyaltyInput,
47
- } from "./db/travel.js";
48
-
49
- export {
50
- getUpcomingTrips,
51
- getTripBudgetVsActual,
52
- getExpiringDocuments,
53
- getLoyaltyPointsSummary,
54
- getTravelStats,
55
- type BudgetVsActual,
56
- type LoyaltyPointsSummary,
57
- type TravelStats,
58
- } from "./db/travel.js";
59
-
60
- export { getDatabase, closeDatabase } from "./db/database.js";
@@ -1,495 +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
- createTrip,
8
- getTrip,
9
- listTrips,
10
- updateTrip,
11
- deleteTrip,
12
- getUpcomingTrips,
13
- getTripBudgetVsActual,
14
- getTravelStats,
15
- } from "../db/travel.js";
16
- import {
17
- createBooking,
18
- getBooking,
19
- listBookings,
20
- cancelBooking,
21
- deleteBooking,
22
- } from "../db/travel.js";
23
- import {
24
- createDocument,
25
- getDocument,
26
- listDocuments,
27
- deleteDocument,
28
- getExpiringDocuments,
29
- } from "../db/travel.js";
30
- import {
31
- createLoyaltyProgram,
32
- getLoyaltyProgram,
33
- listLoyaltyPrograms,
34
- updateLoyaltyProgram,
35
- deleteLoyaltyProgram,
36
- getLoyaltyPointsSummary,
37
- } from "../db/travel.js";
38
-
39
- const server = new McpServer({
40
- name: "microservice-travel",
41
- version: "0.0.1",
42
- });
43
-
44
- // --- Trips ---
45
-
46
- server.registerTool(
47
- "create_trip",
48
- {
49
- title: "Create Trip",
50
- description: "Create a new trip.",
51
- inputSchema: {
52
- name: z.string(),
53
- destination: z.string().optional(),
54
- start_date: z.string().optional(),
55
- end_date: z.string().optional(),
56
- status: z.enum(["planning", "booked", "in_progress", "completed", "cancelled"]).optional(),
57
- budget: z.number().optional(),
58
- currency: z.string().optional(),
59
- notes: z.string().optional(),
60
- },
61
- },
62
- async (params) => {
63
- const trip = createTrip(params);
64
- return { content: [{ type: "text", text: JSON.stringify(trip, null, 2) }] };
65
- }
66
- );
67
-
68
- server.registerTool(
69
- "get_trip",
70
- {
71
- title: "Get Trip",
72
- description: "Get a trip by ID.",
73
- inputSchema: { id: z.string() },
74
- },
75
- async ({ id }) => {
76
- const trip = getTrip(id);
77
- if (!trip) {
78
- return { content: [{ type: "text", text: `Trip '${id}' not found.` }], isError: true };
79
- }
80
- return { content: [{ type: "text", text: JSON.stringify(trip, null, 2) }] };
81
- }
82
- );
83
-
84
- server.registerTool(
85
- "list_trips",
86
- {
87
- title: "List Trips",
88
- description: "List trips with optional filters.",
89
- inputSchema: {
90
- search: z.string().optional(),
91
- status: z.string().optional(),
92
- destination: z.string().optional(),
93
- limit: z.number().optional(),
94
- },
95
- },
96
- async (params) => {
97
- const trips = listTrips(params);
98
- return {
99
- content: [
100
- { type: "text", text: JSON.stringify({ trips, count: trips.length }, null, 2) },
101
- ],
102
- };
103
- }
104
- );
105
-
106
- server.registerTool(
107
- "update_trip",
108
- {
109
- title: "Update Trip",
110
- description: "Update an existing trip.",
111
- inputSchema: {
112
- id: z.string(),
113
- name: z.string().optional(),
114
- destination: z.string().optional(),
115
- start_date: z.string().optional(),
116
- end_date: z.string().optional(),
117
- status: z.enum(["planning", "booked", "in_progress", "completed", "cancelled"]).optional(),
118
- budget: z.number().optional(),
119
- spent: z.number().optional(),
120
- currency: z.string().optional(),
121
- notes: z.string().optional(),
122
- },
123
- },
124
- async ({ id, ...input }) => {
125
- const trip = updateTrip(id, input);
126
- if (!trip) {
127
- return { content: [{ type: "text", text: `Trip '${id}' not found.` }], isError: true };
128
- }
129
- return { content: [{ type: "text", text: JSON.stringify(trip, null, 2) }] };
130
- }
131
- );
132
-
133
- server.registerTool(
134
- "delete_trip",
135
- {
136
- title: "Delete Trip",
137
- description: "Delete a trip by ID.",
138
- inputSchema: { id: z.string() },
139
- },
140
- async ({ id }) => {
141
- const deleted = deleteTrip(id);
142
- return { content: [{ type: "text", text: JSON.stringify({ id, deleted }) }] };
143
- }
144
- );
145
-
146
- // --- Bookings ---
147
-
148
- server.registerTool(
149
- "create_booking",
150
- {
151
- title: "Create Booking",
152
- description: "Add a booking to a trip.",
153
- inputSchema: {
154
- trip_id: z.string(),
155
- type: z.enum(["flight", "hotel", "car", "train", "activity"]),
156
- provider: z.string().optional(),
157
- confirmation_code: z.string().optional(),
158
- status: z.enum(["confirmed", "pending", "cancelled"]).optional(),
159
- check_in: z.string().optional(),
160
- check_out: z.string().optional(),
161
- cost: z.number().optional(),
162
- },
163
- },
164
- async (params) => {
165
- const booking = createBooking(params);
166
- return { content: [{ type: "text", text: JSON.stringify(booking, null, 2) }] };
167
- }
168
- );
169
-
170
- server.registerTool(
171
- "get_booking",
172
- {
173
- title: "Get Booking",
174
- description: "Get a booking by ID.",
175
- inputSchema: { id: z.string() },
176
- },
177
- async ({ id }) => {
178
- const booking = getBooking(id);
179
- if (!booking) {
180
- return { content: [{ type: "text", text: `Booking '${id}' not found.` }], isError: true };
181
- }
182
- return { content: [{ type: "text", text: JSON.stringify(booking, null, 2) }] };
183
- }
184
- );
185
-
186
- server.registerTool(
187
- "list_bookings",
188
- {
189
- title: "List Bookings",
190
- description: "List bookings with optional filters.",
191
- inputSchema: {
192
- trip_id: z.string().optional(),
193
- type: z.string().optional(),
194
- status: z.string().optional(),
195
- limit: z.number().optional(),
196
- },
197
- },
198
- async (params) => {
199
- const bookings = listBookings(params);
200
- return {
201
- content: [
202
- { type: "text", text: JSON.stringify({ bookings, count: bookings.length }, null, 2) },
203
- ],
204
- };
205
- }
206
- );
207
-
208
- server.registerTool(
209
- "cancel_booking",
210
- {
211
- title: "Cancel Booking",
212
- description: "Cancel a booking by ID.",
213
- inputSchema: { id: z.string() },
214
- },
215
- async ({ id }) => {
216
- const booking = cancelBooking(id);
217
- if (!booking) {
218
- return { content: [{ type: "text", text: `Booking '${id}' not found.` }], isError: true };
219
- }
220
- return { content: [{ type: "text", text: JSON.stringify(booking, null, 2) }] };
221
- }
222
- );
223
-
224
- server.registerTool(
225
- "delete_booking",
226
- {
227
- title: "Delete Booking",
228
- description: "Delete a booking by ID.",
229
- inputSchema: { id: z.string() },
230
- },
231
- async ({ id }) => {
232
- const deleted = deleteBooking(id);
233
- return { content: [{ type: "text", text: JSON.stringify({ id, deleted }) }] };
234
- }
235
- );
236
-
237
- // --- Documents ---
238
-
239
- server.registerTool(
240
- "create_document",
241
- {
242
- title: "Create Travel Document",
243
- description: "Add a travel document to a trip.",
244
- inputSchema: {
245
- trip_id: z.string(),
246
- type: z.enum(["passport", "visa", "insurance", "ticket", "voucher"]),
247
- name: z.string(),
248
- number: z.string().optional(),
249
- expires_at: z.string().optional(),
250
- file_path: z.string().optional(),
251
- },
252
- },
253
- async (params) => {
254
- const doc = createDocument(params);
255
- return { content: [{ type: "text", text: JSON.stringify(doc, null, 2) }] };
256
- }
257
- );
258
-
259
- server.registerTool(
260
- "get_document",
261
- {
262
- title: "Get Travel Document",
263
- description: "Get a travel document by ID.",
264
- inputSchema: { id: z.string() },
265
- },
266
- async ({ id }) => {
267
- const doc = getDocument(id);
268
- if (!doc) {
269
- return { content: [{ type: "text", text: `Document '${id}' not found.` }], isError: true };
270
- }
271
- return { content: [{ type: "text", text: JSON.stringify(doc, null, 2) }] };
272
- }
273
- );
274
-
275
- server.registerTool(
276
- "list_documents",
277
- {
278
- title: "List Travel Documents",
279
- description: "List travel documents with optional filters.",
280
- inputSchema: {
281
- trip_id: z.string().optional(),
282
- type: z.string().optional(),
283
- limit: z.number().optional(),
284
- },
285
- },
286
- async (params) => {
287
- const docs = listDocuments(params);
288
- return {
289
- content: [
290
- { type: "text", text: JSON.stringify({ documents: docs, count: docs.length }, null, 2) },
291
- ],
292
- };
293
- }
294
- );
295
-
296
- server.registerTool(
297
- "delete_document",
298
- {
299
- title: "Delete Travel Document",
300
- description: "Delete a travel document by ID.",
301
- inputSchema: { id: z.string() },
302
- },
303
- async ({ id }) => {
304
- const deleted = deleteDocument(id);
305
- return { content: [{ type: "text", text: JSON.stringify({ id, deleted }) }] };
306
- }
307
- );
308
-
309
- server.registerTool(
310
- "get_expiring_documents",
311
- {
312
- title: "Get Expiring Documents",
313
- description: "Get travel documents expiring within a given number of days.",
314
- inputSchema: {
315
- days: z.number().optional(),
316
- },
317
- },
318
- async ({ days }) => {
319
- const docs = getExpiringDocuments(days ?? 90);
320
- return {
321
- content: [
322
- { type: "text", text: JSON.stringify({ documents: docs, count: docs.length }, null, 2) },
323
- ],
324
- };
325
- }
326
- );
327
-
328
- // --- Loyalty Programs ---
329
-
330
- server.registerTool(
331
- "create_loyalty_program",
332
- {
333
- title: "Create Loyalty Program",
334
- description: "Add a loyalty program.",
335
- inputSchema: {
336
- program_name: z.string(),
337
- member_id: z.string().optional(),
338
- tier: z.string().optional(),
339
- points: z.number().optional(),
340
- miles: z.number().optional(),
341
- expires_at: z.string().optional(),
342
- },
343
- },
344
- async (params) => {
345
- const program = createLoyaltyProgram(params);
346
- return { content: [{ type: "text", text: JSON.stringify(program, null, 2) }] };
347
- }
348
- );
349
-
350
- server.registerTool(
351
- "get_loyalty_program",
352
- {
353
- title: "Get Loyalty Program",
354
- description: "Get a loyalty program by ID.",
355
- inputSchema: { id: z.string() },
356
- },
357
- async ({ id }) => {
358
- const program = getLoyaltyProgram(id);
359
- if (!program) {
360
- return { content: [{ type: "text", text: `Loyalty program '${id}' not found.` }], isError: true };
361
- }
362
- return { content: [{ type: "text", text: JSON.stringify(program, null, 2) }] };
363
- }
364
- );
365
-
366
- server.registerTool(
367
- "list_loyalty_programs",
368
- {
369
- title: "List Loyalty Programs",
370
- description: "List all loyalty programs.",
371
- inputSchema: {},
372
- },
373
- async () => {
374
- const programs = listLoyaltyPrograms();
375
- return {
376
- content: [
377
- { type: "text", text: JSON.stringify({ programs, count: programs.length }, null, 2) },
378
- ],
379
- };
380
- }
381
- );
382
-
383
- server.registerTool(
384
- "update_loyalty_program",
385
- {
386
- title: "Update Loyalty Program",
387
- description: "Update a loyalty program.",
388
- inputSchema: {
389
- id: z.string(),
390
- program_name: z.string().optional(),
391
- member_id: z.string().optional(),
392
- tier: z.string().optional(),
393
- points: z.number().optional(),
394
- miles: z.number().optional(),
395
- expires_at: z.string().optional(),
396
- },
397
- },
398
- async ({ id, ...input }) => {
399
- const program = updateLoyaltyProgram(id, input);
400
- if (!program) {
401
- return { content: [{ type: "text", text: `Loyalty program '${id}' not found.` }], isError: true };
402
- }
403
- return { content: [{ type: "text", text: JSON.stringify(program, null, 2) }] };
404
- }
405
- );
406
-
407
- server.registerTool(
408
- "delete_loyalty_program",
409
- {
410
- title: "Delete Loyalty Program",
411
- description: "Delete a loyalty program by ID.",
412
- inputSchema: { id: z.string() },
413
- },
414
- async ({ id }) => {
415
- const deleted = deleteLoyaltyProgram(id);
416
- return { content: [{ type: "text", text: JSON.stringify({ id, deleted }) }] };
417
- }
418
- );
419
-
420
- server.registerTool(
421
- "get_loyalty_summary",
422
- {
423
- title: "Get Loyalty Points Summary",
424
- description: "Get a summary of all loyalty points and miles.",
425
- inputSchema: {},
426
- },
427
- async () => {
428
- const summary = getLoyaltyPointsSummary();
429
- return { content: [{ type: "text", text: JSON.stringify(summary, null, 2) }] };
430
- }
431
- );
432
-
433
- // --- Special Queries ---
434
-
435
- server.registerTool(
436
- "get_upcoming_trips",
437
- {
438
- title: "Get Upcoming Trips",
439
- description: "Get trips starting within a given number of days.",
440
- inputSchema: {
441
- days: z.number().optional(),
442
- },
443
- },
444
- async ({ days }) => {
445
- const trips = getUpcomingTrips(days ?? 30);
446
- return {
447
- content: [
448
- { type: "text", text: JSON.stringify({ trips, count: trips.length }, null, 2) },
449
- ],
450
- };
451
- }
452
- );
453
-
454
- server.registerTool(
455
- "get_trip_budget",
456
- {
457
- title: "Get Trip Budget vs Actual",
458
- description: "Get budget vs actual spending for a trip.",
459
- inputSchema: { trip_id: z.string() },
460
- },
461
- async ({ trip_id }) => {
462
- const budget = getTripBudgetVsActual(trip_id);
463
- if (!budget) {
464
- return { content: [{ type: "text", text: `Trip '${trip_id}' not found.` }], isError: true };
465
- }
466
- return { content: [{ type: "text", text: JSON.stringify(budget, null, 2) }] };
467
- }
468
- );
469
-
470
- server.registerTool(
471
- "get_travel_stats",
472
- {
473
- title: "Get Travel Statistics",
474
- description: "Get travel statistics, optionally filtered by year.",
475
- inputSchema: {
476
- year: z.number().optional(),
477
- },
478
- },
479
- async ({ year }) => {
480
- const stats = getTravelStats(year);
481
- return { content: [{ type: "text", text: JSON.stringify(stats, null, 2) }] };
482
- }
483
- );
484
-
485
- // --- Start ---
486
- async function main() {
487
- const transport = new StdioServerTransport();
488
- await server.connect(transport);
489
- console.error("microservice-travel MCP server running on stdio");
490
- }
491
-
492
- main().catch((error) => {
493
- console.error("Fatal error:", error);
494
- process.exit(1);
495
- });
@@ -1,28 +0,0 @@
1
- {
2
- "name": "@hasna/microservice-wiki",
3
- "version": "0.0.1",
4
- "description": "Wiki microservice with SQLite — manage pages, versions, and internal links",
5
- "type": "module",
6
- "bin": {
7
- "microservice-wiki": "./src/cli/index.ts",
8
- "microservice-wiki-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
- }