@greensecurity/javascript-sdk 0.19.0 → 0.21.3

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 (338) hide show
  1. package/REACT_QUERY.md +15 -15
  2. package/README.md +93 -9
  3. package/bin/mcp-server.js +1734 -271
  4. package/bin/mcp-server.js.map +50 -26
  5. package/funcs/organizationsListOrSearchFacilities.d.ts +2 -1
  6. package/funcs/organizationsListOrSearchFacilities.d.ts.map +1 -1
  7. package/funcs/organizationsListOrSearchFacilities.js +3 -2
  8. package/funcs/organizationsListOrSearchFacilities.js.map +1 -1
  9. package/funcs/vendorScansVendorScanOut.d.ts +17 -0
  10. package/funcs/vendorScansVendorScanOut.d.ts.map +1 -0
  11. package/funcs/vendorScansVendorScanOut.js +120 -0
  12. package/funcs/vendorScansVendorScanOut.js.map +1 -0
  13. package/funcs/vendorsGetVendorsDetails.d.ts +32 -0
  14. package/funcs/vendorsGetVendorsDetails.d.ts.map +1 -0
  15. package/funcs/vendorsGetVendorsDetails.js +139 -0
  16. package/funcs/vendorsGetVendorsDetails.js.map +1 -0
  17. package/funcs/vendorsListVendorCredentials.d.ts +4 -1
  18. package/funcs/vendorsListVendorCredentials.d.ts.map +1 -1
  19. package/funcs/vendorsListVendorCredentials.js +46 -6
  20. package/funcs/vendorsListVendorCredentials.js.map +1 -1
  21. package/funcs/vendorsListVendorFacilityStatuses.d.ts +1 -1
  22. package/funcs/vendorsListVendorFacilityStatuses.d.ts.map +1 -1
  23. package/funcs/vendorsListVendorFacilityStatuses.js +3 -2
  24. package/funcs/vendorsListVendorFacilityStatuses.js.map +1 -1
  25. package/funcs/vendorsListVendorJobTitles.d.ts +1 -1
  26. package/funcs/vendorsListVendorJobTitles.d.ts.map +1 -1
  27. package/funcs/vendorsListVendorJobTitles.js +21 -6
  28. package/funcs/vendorsListVendorJobTitles.js.map +1 -1
  29. package/funcs/vendorsListVendorScrubDetails.d.ts +18 -0
  30. package/funcs/vendorsListVendorScrubDetails.d.ts.map +1 -0
  31. package/funcs/vendorsListVendorScrubDetails.js +121 -0
  32. package/funcs/vendorsListVendorScrubDetails.js.map +1 -0
  33. package/funcs/vendorsListVendorScrubPurchases.d.ts +20 -0
  34. package/funcs/vendorsListVendorScrubPurchases.d.ts.map +1 -0
  35. package/funcs/vendorsListVendorScrubPurchases.js +160 -0
  36. package/funcs/vendorsListVendorScrubPurchases.js.map +1 -0
  37. package/funcs/webhooksGetWebhookEndpoint.d.ts +18 -0
  38. package/funcs/webhooksGetWebhookEndpoint.d.ts.map +1 -0
  39. package/funcs/webhooksGetWebhookEndpoint.js +121 -0
  40. package/funcs/webhooksGetWebhookEndpoint.js.map +1 -0
  41. package/funcs/webhooksListAllWebhookEndpoints.d.ts +17 -0
  42. package/funcs/webhooksListAllWebhookEndpoints.d.ts.map +1 -0
  43. package/funcs/webhooksListAllWebhookEndpoints.js +121 -0
  44. package/funcs/webhooksListAllWebhookEndpoints.js.map +1 -0
  45. package/jsr.json +1 -1
  46. package/lib/config.d.ts +3 -3
  47. package/lib/config.js +3 -3
  48. package/lib/security.d.ts +4 -3
  49. package/lib/security.d.ts.map +1 -1
  50. package/lib/security.js +6 -1
  51. package/lib/security.js.map +1 -1
  52. package/mcp-server/extensions.d.ts +2 -0
  53. package/mcp-server/extensions.d.ts.map +1 -1
  54. package/mcp-server/mcp-server.js +1 -1
  55. package/mcp-server/prompts.d.ts +26 -0
  56. package/mcp-server/prompts.d.ts.map +1 -0
  57. package/mcp-server/prompts.js +47 -0
  58. package/mcp-server/prompts.js.map +1 -0
  59. package/mcp-server/resources.d.ts.map +1 -1
  60. package/mcp-server/resources.js +1 -0
  61. package/mcp-server/resources.js.map +1 -1
  62. package/mcp-server/server.d.ts.map +1 -1
  63. package/mcp-server/server.js +16 -4
  64. package/mcp-server/server.js.map +1 -1
  65. package/mcp-server/tools/vendorScansVendorScanOut.d.ts +8 -0
  66. package/mcp-server/tools/vendorScansVendorScanOut.d.ts.map +1 -0
  67. package/mcp-server/tools/{userPasswordResetRequest.js → vendorScansVendorScanOut.js} +9 -9
  68. package/mcp-server/tools/{userPasswordResetRequest.js.map → vendorScansVendorScanOut.js.map} +1 -1
  69. package/mcp-server/tools/vendorsGetVendorsDetails.d.ts +8 -0
  70. package/mcp-server/tools/vendorsGetVendorsDetails.d.ts.map +1 -0
  71. package/mcp-server/tools/vendorsGetVendorsDetails.js +78 -0
  72. package/mcp-server/tools/vendorsGetVendorsDetails.js.map +1 -0
  73. package/mcp-server/tools/vendorsListVendorCredentials.js +1 -1
  74. package/mcp-server/tools/vendorsListVendorCredentials.js.map +1 -1
  75. package/mcp-server/tools/vendorsListVendorScrubDetails.d.ts +8 -0
  76. package/mcp-server/tools/vendorsListVendorScrubDetails.d.ts.map +1 -0
  77. package/mcp-server/tools/{userGetUserById.js → vendorsListVendorScrubDetails.js} +9 -9
  78. package/mcp-server/tools/vendorsListVendorScrubDetails.js.map +1 -0
  79. package/mcp-server/tools/vendorsListVendorScrubPurchases.d.ts +8 -0
  80. package/mcp-server/tools/vendorsListVendorScrubPurchases.d.ts.map +1 -0
  81. package/mcp-server/tools/{userPassword.js → vendorsListVendorScrubPurchases.js} +10 -11
  82. package/mcp-server/tools/vendorsListVendorScrubPurchases.js.map +1 -0
  83. package/mcp-server/tools/webhooksGetWebhookEndpoint.d.ts +8 -0
  84. package/mcp-server/tools/webhooksGetWebhookEndpoint.d.ts.map +1 -0
  85. package/mcp-server/tools/{vendorsListVendorJobTitles.js → webhooksGetWebhookEndpoint.js} +10 -10
  86. package/mcp-server/tools/webhooksGetWebhookEndpoint.js.map +1 -0
  87. package/mcp-server/tools/webhooksListAllWebhookEndpoints.d.ts +8 -0
  88. package/mcp-server/tools/webhooksListAllWebhookEndpoints.d.ts.map +1 -0
  89. package/mcp-server/tools/{userMagiclink.js → webhooksListAllWebhookEndpoints.js} +9 -9
  90. package/mcp-server/tools/webhooksListAllWebhookEndpoints.js.map +1 -0
  91. package/mcp-server/tools.d.ts.map +1 -1
  92. package/mcp-server/tools.js +1 -0
  93. package/mcp-server/tools.js.map +1 -1
  94. package/models/components/company.d.ts +15 -15
  95. package/models/components/company.d.ts.map +1 -1
  96. package/models/components/company.js +19 -18
  97. package/models/components/company.js.map +1 -1
  98. package/models/components/contact.d.ts +13 -13
  99. package/models/components/contact.d.ts.map +1 -1
  100. package/models/components/contact.js +16 -16
  101. package/models/components/contact.js.map +1 -1
  102. package/models/components/department.d.ts +34 -0
  103. package/models/components/department.d.ts.map +1 -0
  104. package/models/components/department.js +71 -0
  105. package/models/components/department.js.map +1 -0
  106. package/models/components/expand.d.ts +24 -0
  107. package/models/components/expand.d.ts.map +1 -1
  108. package/models/components/expand.js +8 -0
  109. package/models/components/expand.js.map +1 -1
  110. package/models/components/facility.d.ts +17 -17
  111. package/models/components/facility.d.ts.map +1 -1
  112. package/models/components/facility.js +20 -20
  113. package/models/components/facility.js.map +1 -1
  114. package/models/components/index.d.ts +7 -0
  115. package/models/components/index.d.ts.map +1 -1
  116. package/models/components/index.js +7 -0
  117. package/models/components/index.js.map +1 -1
  118. package/models/components/scantype.d.ts +31 -0
  119. package/models/components/scantype.d.ts.map +1 -0
  120. package/models/components/scantype.js +62 -0
  121. package/models/components/scantype.js.map +1 -0
  122. package/models/components/subscription.d.ts +42 -0
  123. package/models/components/subscription.d.ts.map +1 -0
  124. package/models/components/subscription.js +92 -0
  125. package/models/components/subscription.js.map +1 -0
  126. package/models/components/user.d.ts +8 -25
  127. package/models/components/user.d.ts.map +1 -1
  128. package/models/components/user.js +8 -31
  129. package/models/components/user.js.map +1 -1
  130. package/models/components/vendor.d.ts +374 -0
  131. package/models/components/vendor.d.ts.map +1 -0
  132. package/models/components/vendor.js +523 -0
  133. package/models/components/vendor.js.map +1 -0
  134. package/models/components/vendorscrubdetails.d.ts +42 -0
  135. package/models/components/vendorscrubdetails.d.ts.map +1 -0
  136. package/models/components/vendorscrubdetails.js +98 -0
  137. package/models/components/vendorscrubdetails.js.map +1 -0
  138. package/models/components/vendorscrubpurchase.d.ts +38 -0
  139. package/models/components/vendorscrubpurchase.d.ts.map +1 -0
  140. package/models/components/vendorscrubpurchase.js +84 -0
  141. package/models/components/vendorscrubpurchase.js.map +1 -0
  142. package/models/components/webhookendpoint.d.ts +135 -0
  143. package/models/components/webhookendpoint.d.ts.map +1 -0
  144. package/models/components/webhookendpoint.js +158 -0
  145. package/models/components/webhookendpoint.js.map +1 -0
  146. package/models/operations/getvendorsdetails.d.ts +38 -0
  147. package/models/operations/getvendorsdetails.d.ts.map +1 -0
  148. package/models/operations/getvendorsdetails.js +81 -0
  149. package/models/operations/getvendorsdetails.js.map +1 -0
  150. package/models/operations/getwebhookendpoint.d.ts +32 -0
  151. package/models/operations/getwebhookendpoint.d.ts.map +1 -0
  152. package/models/operations/getwebhookendpoint.js +69 -0
  153. package/models/operations/getwebhookendpoint.js.map +1 -0
  154. package/models/operations/index.d.ts +6 -0
  155. package/models/operations/index.d.ts.map +1 -1
  156. package/models/operations/index.js +6 -0
  157. package/models/operations/index.js.map +1 -1
  158. package/models/operations/listallwebhookendpoints.d.ts +81 -0
  159. package/models/operations/listallwebhookendpoints.d.ts.map +1 -0
  160. package/models/operations/listallwebhookendpoints.js +114 -0
  161. package/models/operations/listallwebhookendpoints.js.map +1 -0
  162. package/models/operations/listorsearchfacilities.d.ts +2 -2
  163. package/models/operations/listorsearchfacilities.d.ts.map +1 -1
  164. package/models/operations/listorsearchfacilities.js +2 -2
  165. package/models/operations/listorsearchfacilities.js.map +1 -1
  166. package/models/operations/listvendorcredentials.d.ts +77 -5
  167. package/models/operations/listvendorcredentials.d.ts.map +1 -1
  168. package/models/operations/listvendorcredentials.js +78 -3
  169. package/models/operations/listvendorcredentials.js.map +1 -1
  170. package/models/operations/listvendorfacilitystatuses.d.ts +5 -0
  171. package/models/operations/listvendorfacilitystatuses.d.ts.map +1 -1
  172. package/models/operations/listvendorfacilitystatuses.js +4 -0
  173. package/models/operations/listvendorfacilitystatuses.js.map +1 -1
  174. package/models/operations/listvendorjobtitles.d.ts +27 -0
  175. package/models/operations/listvendorjobtitles.d.ts.map +1 -1
  176. package/models/operations/listvendorjobtitles.js +38 -1
  177. package/models/operations/listvendorjobtitles.js.map +1 -1
  178. package/models/operations/listvendorscrubdetails.d.ts +32 -0
  179. package/models/operations/listvendorscrubdetails.d.ts.map +1 -0
  180. package/models/operations/listvendorscrubdetails.js +78 -0
  181. package/models/operations/listvendorscrubdetails.js.map +1 -0
  182. package/models/operations/listvendorscrubpurchases.d.ts +111 -0
  183. package/models/operations/listvendorscrubpurchases.d.ts.map +1 -0
  184. package/models/operations/listvendorscrubpurchases.js +153 -0
  185. package/models/operations/listvendorscrubpurchases.js.map +1 -0
  186. package/models/operations/vendorscanout.d.ts +64 -0
  187. package/models/operations/vendorscanout.d.ts.map +1 -0
  188. package/models/operations/vendorscanout.js +100 -0
  189. package/models/operations/vendorscanout.js.map +1 -0
  190. package/package.json +1 -1
  191. package/react-query/index.d.ts +6 -0
  192. package/react-query/index.d.ts.map +1 -1
  193. package/react-query/index.js +6 -0
  194. package/react-query/index.js.map +1 -1
  195. package/react-query/vendorScansVendorScanOut.d.ts +23 -0
  196. package/react-query/vendorScansVendorScanOut.d.ts.map +1 -0
  197. package/react-query/vendorScansVendorScanOut.js +47 -0
  198. package/react-query/vendorScansVendorScanOut.js.map +1 -0
  199. package/react-query/vendorsGetVendorsDetails.d.ts +71 -0
  200. package/react-query/vendorsGetVendorsDetails.d.ts.map +1 -0
  201. package/react-query/vendorsGetVendorsDetails.js +123 -0
  202. package/react-query/vendorsGetVendorsDetails.js.map +1 -0
  203. package/react-query/vendorsListVendorCredentials.d.ts +40 -3
  204. package/react-query/vendorsListVendorCredentials.d.ts.map +1 -1
  205. package/react-query/vendorsListVendorCredentials.js +67 -0
  206. package/react-query/vendorsListVendorCredentials.js.map +1 -1
  207. package/react-query/vendorsListVendorFacilityStatuses.d.ts +3 -0
  208. package/react-query/vendorsListVendorFacilityStatuses.d.ts.map +1 -1
  209. package/react-query/vendorsListVendorFacilityStatuses.js +2 -0
  210. package/react-query/vendorsListVendorFacilityStatuses.js.map +1 -1
  211. package/react-query/vendorsListVendorJobTitles.d.ts +7 -7
  212. package/react-query/vendorsListVendorJobTitles.d.ts.map +1 -1
  213. package/react-query/vendorsListVendorJobTitles.js +15 -15
  214. package/react-query/vendorsListVendorJobTitles.js.map +1 -1
  215. package/react-query/vendorsListVendorScrubDetails.d.ts +31 -0
  216. package/react-query/vendorsListVendorScrubDetails.d.ts.map +1 -0
  217. package/react-query/vendorsListVendorScrubDetails.js +96 -0
  218. package/react-query/vendorsListVendorScrubDetails.js.map +1 -0
  219. package/react-query/vendorsListVendorScrubPurchases.d.ts +77 -0
  220. package/react-query/vendorsListVendorScrubPurchases.d.ts.map +1 -0
  221. package/react-query/vendorsListVendorScrubPurchases.js +160 -0
  222. package/react-query/vendorsListVendorScrubPurchases.js.map +1 -0
  223. package/react-query/webhooksGetWebhookEndpoint.d.ts +31 -0
  224. package/react-query/webhooksGetWebhookEndpoint.d.ts.map +1 -0
  225. package/react-query/webhooksGetWebhookEndpoint.js +96 -0
  226. package/react-query/webhooksGetWebhookEndpoint.js.map +1 -0
  227. package/react-query/webhooksListAllWebhookEndpoints.d.ts +50 -0
  228. package/react-query/webhooksListAllWebhookEndpoints.d.ts.map +1 -0
  229. package/react-query/webhooksListAllWebhookEndpoints.js +101 -0
  230. package/react-query/webhooksListAllWebhookEndpoints.js.map +1 -0
  231. package/sdk/sdk.d.ts +6 -0
  232. package/sdk/sdk.d.ts.map +1 -1
  233. package/sdk/sdk.js +8 -0
  234. package/sdk/sdk.js.map +1 -1
  235. package/sdk/vendors.d.ts +41 -2
  236. package/sdk/vendors.d.ts.map +1 -1
  237. package/sdk/vendors.js +47 -3
  238. package/sdk/vendors.js.map +1 -1
  239. package/sdk/vendorscans.d.ts +12 -0
  240. package/sdk/vendorscans.d.ts.map +1 -0
  241. package/sdk/vendorscans.js +22 -0
  242. package/sdk/vendorscans.js.map +1 -0
  243. package/sdk/webhooks.d.ts +20 -0
  244. package/sdk/webhooks.d.ts.map +1 -0
  245. package/sdk/webhooks.js +32 -0
  246. package/sdk/webhooks.js.map +1 -0
  247. package/src/__tests__/vendors.test.ts +50 -152
  248. package/src/__tests__/vendorscans.test.ts +27 -0
  249. package/src/__tests__/webhooks.test.ts +45 -0
  250. package/src/funcs/organizationsListOrSearchFacilities.ts +12 -1
  251. package/src/funcs/vendorScansVendorScanOut.ts +172 -0
  252. package/src/funcs/vendorsGetVendorsDetails.ts +192 -0
  253. package/src/funcs/vendorsListVendorCredentials.ts +104 -27
  254. package/src/funcs/vendorsListVendorFacilityStatuses.ts +7 -1
  255. package/src/funcs/vendorsListVendorJobTitles.ts +25 -2
  256. package/src/funcs/vendorsListVendorScrubDetails.ts +172 -0
  257. package/src/funcs/vendorsListVendorScrubPurchases.ts +249 -0
  258. package/src/funcs/webhooksGetWebhookEndpoint.ts +173 -0
  259. package/src/funcs/webhooksListAllWebhookEndpoints.ts +174 -0
  260. package/src/lib/config.ts +3 -3
  261. package/src/lib/security.ts +11 -3
  262. package/src/mcp-server/extensions.ts +4 -0
  263. package/src/mcp-server/mcp-server.ts +1 -1
  264. package/src/mcp-server/prompts.ts +110 -0
  265. package/src/mcp-server/resources.ts +1 -0
  266. package/src/mcp-server/server.ts +16 -4
  267. package/src/mcp-server/tools/vendorScansVendorScanOut.ts +37 -0
  268. package/src/mcp-server/tools/vendorsGetVendorsDetails.ts +51 -0
  269. package/src/mcp-server/tools/vendorsListVendorCredentials.ts +1 -1
  270. package/src/mcp-server/tools/vendorsListVendorScrubDetails.ts +37 -0
  271. package/src/mcp-server/tools/vendorsListVendorScrubPurchases.ts +38 -0
  272. package/src/mcp-server/tools/{vendorsListVendorJobTitles.ts → webhooksGetWebhookEndpoint.ts} +8 -8
  273. package/src/mcp-server/tools/webhooksListAllWebhookEndpoints.ts +38 -0
  274. package/src/mcp-server/tools.ts +1 -0
  275. package/src/models/components/company.ts +27 -24
  276. package/src/models/components/contact.ts +24 -20
  277. package/src/models/components/department.ts +69 -0
  278. package/src/models/components/expand.ts +8 -0
  279. package/src/models/components/facility.ts +28 -32
  280. package/src/models/components/index.ts +7 -0
  281. package/src/models/components/scantype.ts +32 -0
  282. package/src/models/components/subscription.ts +98 -0
  283. package/src/models/components/user.ts +19 -53
  284. package/src/models/components/vendor.ts +925 -0
  285. package/src/models/components/vendorscrubdetails.ts +108 -0
  286. package/src/models/components/vendorscrubpurchase.ts +90 -0
  287. package/src/models/components/webhookendpoint.ts +244 -0
  288. package/src/models/operations/getvendorsdetails.ts +86 -0
  289. package/src/models/operations/getwebhookendpoint.ts +69 -0
  290. package/src/models/operations/index.ts +6 -0
  291. package/src/models/operations/listallwebhookendpoints.ts +175 -0
  292. package/src/models/operations/listorsearchfacilities.ts +4 -4
  293. package/src/models/operations/listvendorcredentials.ts +160 -7
  294. package/src/models/operations/listvendorfacilitystatuses.ts +9 -0
  295. package/src/models/operations/listvendorjobtitles.ts +72 -0
  296. package/src/models/operations/listvendorscrubdetails.ts +80 -0
  297. package/src/models/operations/listvendorscrubpurchases.ts +252 -0
  298. package/src/models/operations/vendorscanout.ts +138 -0
  299. package/src/react-query/index.ts +6 -0
  300. package/src/react-query/vendorScansVendorScanOut.ts +89 -0
  301. package/src/react-query/vendorsGetVendorsDetails.ts +201 -0
  302. package/src/react-query/vendorsListVendorCredentials.ts +169 -1
  303. package/src/react-query/vendorsListVendorFacilityStatuses.ts +5 -0
  304. package/src/react-query/vendorsListVendorJobTitles.ts +15 -0
  305. package/src/react-query/vendorsListVendorScrubDetails.ts +166 -0
  306. package/src/react-query/vendorsListVendorScrubPurchases.ts +346 -0
  307. package/src/react-query/webhooksGetWebhookEndpoint.ts +163 -0
  308. package/src/react-query/webhooksListAllWebhookEndpoints.ts +193 -0
  309. package/src/sdk/sdk.ts +12 -0
  310. package/src/sdk/vendors.ts +76 -2
  311. package/src/sdk/vendorscans.ts +27 -0
  312. package/src/sdk/webhooks.ts +46 -0
  313. package/mcp-server/tools/userGetCurrentUser.d.ts +0 -3
  314. package/mcp-server/tools/userGetCurrentUser.d.ts.map +0 -1
  315. package/mcp-server/tools/userGetCurrentUser.js +0 -26
  316. package/mcp-server/tools/userGetCurrentUser.js.map +0 -1
  317. package/mcp-server/tools/userGetUserById.d.ts +0 -8
  318. package/mcp-server/tools/userGetUserById.d.ts.map +0 -1
  319. package/mcp-server/tools/userGetUserById.js.map +0 -1
  320. package/mcp-server/tools/userLogsUserIntoTheSystem.d.ts +0 -8
  321. package/mcp-server/tools/userLogsUserIntoTheSystem.d.ts.map +0 -1
  322. package/mcp-server/tools/userLogsUserIntoTheSystem.js +0 -94
  323. package/mcp-server/tools/userLogsUserIntoTheSystem.js.map +0 -1
  324. package/mcp-server/tools/userMagiclink.d.ts +0 -8
  325. package/mcp-server/tools/userMagiclink.d.ts.map +0 -1
  326. package/mcp-server/tools/userMagiclink.js.map +0 -1
  327. package/mcp-server/tools/userPassword.d.ts +0 -8
  328. package/mcp-server/tools/userPassword.d.ts.map +0 -1
  329. package/mcp-server/tools/userPassword.js.map +0 -1
  330. package/mcp-server/tools/userPasswordResetRequest.d.ts +0 -8
  331. package/mcp-server/tools/userPasswordResetRequest.d.ts.map +0 -1
  332. package/mcp-server/tools/vendorsListVendorJobTitles.d.ts +0 -8
  333. package/mcp-server/tools/vendorsListVendorJobTitles.d.ts.map +0 -1
  334. package/mcp-server/tools/vendorsListVendorJobTitles.js.map +0 -1
  335. package/src/__tests__/organizations.test.ts +0 -78
  336. package/src/__tests__/supportarticles.test.ts +0 -64
  337. package/src/__tests__/user.test.ts +0 -218
  338. package/vitest.config.ts +0 -8
@@ -0,0 +1,110 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
6
+ import { RequestHandlerExtra } from "@modelcontextprotocol/sdk/shared/protocol.js";
7
+ import { GetPromptResult } from "@modelcontextprotocol/sdk/types.js";
8
+ import {
9
+ objectOutputType,
10
+ ZodOptional,
11
+ ZodType,
12
+ ZodTypeAny,
13
+ ZodTypeDef,
14
+ } from "zod";
15
+ import { GreenSecurityCore } from "../core.js";
16
+ import { ConsoleLogger } from "./console-logger.js";
17
+ import { MCPScope } from "./scopes.js";
18
+
19
+ // '@modelcontextprotocol/sdk' currently does not export this type
20
+ export type PromptArgsRawShape = {
21
+ [k: string]:
22
+ | ZodType<string, ZodTypeDef, string>
23
+ | ZodOptional<ZodType<string, ZodTypeDef, string>>;
24
+ };
25
+
26
+ export type PromptDefinition<
27
+ Args extends undefined | PromptArgsRawShape = undefined,
28
+ > = Args extends PromptArgsRawShape ? {
29
+ name: string;
30
+ description?: string;
31
+ scopes?: MCPScope[];
32
+ args: Args;
33
+ prompt: (
34
+ client: GreenSecurityCore,
35
+ args: objectOutputType<Args, ZodTypeAny>,
36
+ extra: RequestHandlerExtra,
37
+ ) => GetPromptResult | Promise<GetPromptResult>;
38
+ }
39
+ : {
40
+ name: string;
41
+ description?: string;
42
+ scopes?: MCPScope[];
43
+ args?: undefined;
44
+ prompt: (
45
+ client: GreenSecurityCore,
46
+ extra: RequestHandlerExtra,
47
+ ) => GetPromptResult | Promise<GetPromptResult>;
48
+ };
49
+
50
+ // Optional function to assist with formatting prompt results
51
+ export async function formatResult(value: string): Promise<GetPromptResult> {
52
+ return {
53
+ messages: [
54
+ {
55
+ role: "user",
56
+ content: {
57
+ type: "text",
58
+ text: value,
59
+ },
60
+ },
61
+ ],
62
+ };
63
+ }
64
+
65
+ export function createRegisterPrompt(
66
+ logger: ConsoleLogger,
67
+ server: McpServer,
68
+ sdk: GreenSecurityCore,
69
+ allowedScopes: Set<MCPScope>,
70
+ ): <A extends PromptArgsRawShape | undefined>(
71
+ prompt: PromptDefinition<A>,
72
+ ) => void {
73
+ return <A extends PromptArgsRawShape | undefined>(
74
+ prompt: PromptDefinition<A>,
75
+ ): void => {
76
+ const scopes = prompt.scopes ?? [];
77
+ if (!scopes.every((s: MCPScope) => allowedScopes.has(s))) {
78
+ return;
79
+ }
80
+
81
+ if (prompt.args) {
82
+ if (prompt.description) {
83
+ server.prompt(
84
+ prompt.name,
85
+ prompt.description,
86
+ prompt.args,
87
+ async (args, ctx) => prompt.prompt(sdk, args, ctx),
88
+ );
89
+ } else {
90
+ server.prompt(
91
+ prompt.name,
92
+ prompt.args,
93
+ async (args, ctx) => prompt.prompt(sdk, args, ctx),
94
+ );
95
+ }
96
+ } else {
97
+ if (prompt.description) {
98
+ server.prompt(
99
+ prompt.name,
100
+ prompt.description,
101
+ async (ctx) => prompt.prompt(sdk, ctx),
102
+ );
103
+ } else {
104
+ server.prompt(prompt.name, async (ctx) => prompt.prompt(sdk, ctx));
105
+ }
106
+ }
107
+
108
+ logger.debug("Registered prompt", { name: prompt.name });
109
+ };
110
+ }
@@ -46,6 +46,7 @@ export type ResourceTemplateDefinition = {
46
46
  read: ReadResourceTemplateCallback;
47
47
  };
48
48
 
49
+ // Optional function to assist with formatting resource results
49
50
  export async function formatResult(
50
51
  value: unknown,
51
52
  uri: URL,
@@ -6,6 +6,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
6
6
  import { GreenSecurityCore } from "../core.js";
7
7
  import { SDKOptions } from "../lib/config.js";
8
8
  import type { ConsoleLogger } from "./console-logger.js";
9
+ import { createRegisterPrompt } from "./prompts.js";
9
10
  import {
10
11
  createRegisterResource,
11
12
  createRegisterResourceTemplate,
@@ -22,13 +23,18 @@ import { tool$usersLogsUserIntoTheSystem } from "./tools/usersLogsUserIntoTheSys
22
23
  import { tool$usersMagiclink } from "./tools/usersMagiclink.js";
23
24
  import { tool$usersPassword } from "./tools/usersPassword.js";
24
25
  import { tool$usersPasswordResetRequest } from "./tools/usersPasswordResetRequest.js";
26
+ import { tool$vendorScansVendorScanOut } from "./tools/vendorScansVendorScanOut.js";
25
27
  import { tool$vendorsCreateVendorRegistration } from "./tools/vendorsCreateVendorRegistration.js";
26
28
  import { tool$vendorsExpediteTimeRemaining } from "./tools/vendorsExpediteTimeRemaining.js";
27
29
  import { tool$vendorsGetVendorInvoiceDetails } from "./tools/vendorsGetVendorInvoiceDetails.js";
30
+ import { tool$vendorsGetVendorsDetails } from "./tools/vendorsGetVendorsDetails.js";
28
31
  import { tool$vendorsListVendorCredentials } from "./tools/vendorsListVendorCredentials.js";
29
32
  import { tool$vendorsListVendorFacilityStatuses } from "./tools/vendorsListVendorFacilityStatuses.js";
30
33
  import { tool$vendorsListVendorInvoices } from "./tools/vendorsListVendorInvoices.js";
31
- import { tool$vendorsListVendorJobTitles } from "./tools/vendorsListVendorJobTitles.js";
34
+ import { tool$vendorsListVendorScrubDetails } from "./tools/vendorsListVendorScrubDetails.js";
35
+ import { tool$vendorsListVendorScrubPurchases } from "./tools/vendorsListVendorScrubPurchases.js";
36
+ import { tool$webhooksGetWebhookEndpoint } from "./tools/webhooksGetWebhookEndpoint.js";
37
+ import { tool$webhooksListAllWebhookEndpoints } from "./tools/webhooksListAllWebhookEndpoints.js";
32
38
 
33
39
  export function createMCPServer(deps: {
34
40
  logger: ConsoleLogger;
@@ -40,7 +46,7 @@ export function createMCPServer(deps: {
40
46
  }) {
41
47
  const server = new McpServer({
42
48
  name: "GreenSecurity",
43
- version: "0.19.0",
49
+ version: "0.21.3",
44
50
  });
45
51
 
46
52
  const client = new GreenSecurityCore({
@@ -66,16 +72,19 @@ export function createMCPServer(deps: {
66
72
  client,
67
73
  scopes,
68
74
  );
69
- const register = { tool, resource, resourceTemplate };
75
+ const prompt = createRegisterPrompt(deps.logger, server, client, scopes);
76
+ const register = { tool, resource, resourceTemplate, prompt };
70
77
  void register; // suppress unused warnings
71
78
 
72
79
  tool(tool$vendorsCreateVendorRegistration);
73
- tool(tool$vendorsListVendorJobTitles);
74
80
  tool(tool$vendorsListVendorCredentials);
75
81
  tool(tool$vendorsExpediteTimeRemaining);
76
82
  tool(tool$vendorsListVendorInvoices);
77
83
  tool(tool$vendorsGetVendorInvoiceDetails);
78
84
  tool(tool$vendorsListVendorFacilityStatuses);
85
+ tool(tool$vendorsListVendorScrubPurchases);
86
+ tool(tool$vendorsListVendorScrubDetails);
87
+ tool(tool$vendorsGetVendorsDetails);
79
88
  tool(tool$usersGetCurrentUser);
80
89
  tool(tool$usersGetUserById);
81
90
  tool(tool$usersLogsUserIntoTheSystem);
@@ -86,6 +95,9 @@ export function createMCPServer(deps: {
86
95
  tool(tool$organizationsGetFacility);
87
96
  tool(tool$supportArticlesListOrSearchSupportArticles);
88
97
  tool(tool$supportArticlesGetSupportArticle);
98
+ tool(tool$webhooksListAllWebhookEndpoints);
99
+ tool(tool$webhooksGetWebhookEndpoint);
100
+ tool(tool$vendorScansVendorScanOut);
89
101
 
90
102
  return server;
91
103
  }
@@ -0,0 +1,37 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { vendorScansVendorScanOut } from "../../funcs/vendorScansVendorScanOut.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.VendorScanOutRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$vendorScansVendorScanOut: ToolDefinition<typeof args> = {
14
+ name: "vendor-scans-vendor-scan-out",
15
+ description: `Vendor scan out
16
+
17
+ It scans out vendor from facility`,
18
+ args,
19
+ tool: async (client, args, ctx) => {
20
+ const [result, apiCall] = await vendorScansVendorScanOut(
21
+ client,
22
+ args.request,
23
+ { fetchOptions: { signal: ctx.signal } },
24
+ ).$inspect();
25
+
26
+ if (!result.ok) {
27
+ return {
28
+ content: [{ type: "text", text: result.error.message }],
29
+ isError: true,
30
+ };
31
+ }
32
+
33
+ const value = result.value;
34
+
35
+ return formatResult(value, apiCall);
36
+ },
37
+ };
@@ -0,0 +1,51 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { vendorsGetVendorsDetails } from "../../funcs/vendorsGetVendorsDetails.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.GetVendorsDetailsRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$vendorsGetVendorsDetails: ToolDefinition<typeof args> = {
14
+ name: "vendors-get-vendors-details",
15
+ description: `Get vendors details
16
+
17
+ Retrieve an individual vendor detais.
18
+
19
+ Available \`expand\` scopes are:
20
+
21
+ vendor.user
22
+ vendor.vendor_type
23
+ vendor.image_urls
24
+ vendor.payment_profile
25
+ vendor.primary_facility
26
+ vendor.primary_department
27
+ vendor.company
28
+ vendor.credentialing_subscription
29
+ vendor.scrubs_subscription
30
+ vendor.payment_responsibility
31
+ vendor.background_check_date_expires`,
32
+ args,
33
+ tool: async (client, args, ctx) => {
34
+ const [result, apiCall] = await vendorsGetVendorsDetails(
35
+ client,
36
+ args.request,
37
+ { fetchOptions: { signal: ctx.signal } },
38
+ ).$inspect();
39
+
40
+ if (!result.ok) {
41
+ return {
42
+ content: [{ type: "text", text: result.error.message }],
43
+ isError: true,
44
+ };
45
+ }
46
+
47
+ const value = result.value;
48
+
49
+ return formatResult(value, apiCall);
50
+ },
51
+ };
@@ -30,7 +30,7 @@ Lists vendor credentials, required credentials, and company credentials. Utilize
30
30
  };
31
31
  }
32
32
 
33
- const value = result.value;
33
+ const value = result.value.result;
34
34
 
35
35
  return formatResult(value, apiCall);
36
36
  },
@@ -0,0 +1,37 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { vendorsListVendorScrubDetails } from "../../funcs/vendorsListVendorScrubDetails.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.ListVendorScrubDetailsRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$vendorsListVendorScrubDetails: ToolDefinition<typeof args> = {
14
+ name: "vendors-list-vendor-scrub-details",
15
+ description: `List vendor scrub details
16
+
17
+ List vendor scrub details`,
18
+ args,
19
+ tool: async (client, args, ctx) => {
20
+ const [result, apiCall] = await vendorsListVendorScrubDetails(
21
+ client,
22
+ args.request,
23
+ { fetchOptions: { signal: ctx.signal } },
24
+ ).$inspect();
25
+
26
+ if (!result.ok) {
27
+ return {
28
+ content: [{ type: "text", text: result.error.message }],
29
+ isError: true,
30
+ };
31
+ }
32
+
33
+ const value = result.value;
34
+
35
+ return formatResult(value, apiCall);
36
+ },
37
+ };
@@ -0,0 +1,38 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { vendorsListVendorScrubPurchases } from "../../funcs/vendorsListVendorScrubPurchases.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.ListVendorScrubPurchasesRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$vendorsListVendorScrubPurchases: ToolDefinition<typeof args> =
14
+ {
15
+ name: "vendors-list-vendor-scrub-purchases",
16
+ description: `List vendor scrub purchases
17
+
18
+ List vendor scrub purchases`,
19
+ args,
20
+ tool: async (client, args, ctx) => {
21
+ const [result, apiCall] = await vendorsListVendorScrubPurchases(
22
+ client,
23
+ args.request,
24
+ { fetchOptions: { signal: ctx.signal } },
25
+ ).$inspect();
26
+
27
+ if (!result.ok) {
28
+ return {
29
+ content: [{ type: "text", text: result.error.message }],
30
+ isError: true,
31
+ };
32
+ }
33
+
34
+ const value = result.value.result;
35
+
36
+ return formatResult(value, apiCall);
37
+ },
38
+ };
@@ -2,22 +2,22 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
 
5
- import { vendorsListVendorJobTitles } from "../../funcs/vendorsListVendorJobTitles.js";
5
+ import { webhooksGetWebhookEndpoint } from "../../funcs/webhooksGetWebhookEndpoint.js";
6
6
  import * as operations from "../../models/operations/index.js";
7
7
  import { formatResult, ToolDefinition } from "../tools.js";
8
8
 
9
9
  const args = {
10
- request: operations.ListVendorJobTitlesRequest$inboundSchema,
10
+ request: operations.GetWebhookEndpointRequest$inboundSchema,
11
11
  };
12
12
 
13
- export const tool$vendorsListVendorJobTitles: ToolDefinition<typeof args> = {
14
- name: "vendors-list-vendor-job-titles",
15
- description: `List vendor job titles
13
+ export const tool$webhooksGetWebhookEndpoint: ToolDefinition<typeof args> = {
14
+ name: "webhooks-get-webhook-endpoint",
15
+ description: `Retrieves the webhook endpoint with the given ID.
16
16
 
17
- List valid job titles for Vendors. This can be used during sign up or in a filter.`,
17
+ Returns the definition of a webhook endpoint by ID.`,
18
18
  args,
19
19
  tool: async (client, args, ctx) => {
20
- const [result, apiCall] = await vendorsListVendorJobTitles(
20
+ const [result, apiCall] = await webhooksGetWebhookEndpoint(
21
21
  client,
22
22
  args.request,
23
23
  { fetchOptions: { signal: ctx.signal } },
@@ -30,7 +30,7 @@ List valid job titles for Vendors. This can be used during sign up or in a filte
30
30
  };
31
31
  }
32
32
 
33
- const value = result.value.result;
33
+ const value = result.value;
34
34
 
35
35
  return formatResult(value, apiCall);
36
36
  },
@@ -0,0 +1,38 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { webhooksListAllWebhookEndpoints } from "../../funcs/webhooksListAllWebhookEndpoints.js";
6
+ import * as operations from "../../models/operations/index.js";
7
+ import { formatResult, ToolDefinition } from "../tools.js";
8
+
9
+ const args = {
10
+ request: operations.ListAllWebhookEndpointsRequest$inboundSchema,
11
+ };
12
+
13
+ export const tool$webhooksListAllWebhookEndpoints: ToolDefinition<typeof args> =
14
+ {
15
+ name: "webhooks-list-all-webhook-endpoints",
16
+ description: `List all webhook endpoints
17
+
18
+ Returns a list of your webhook endpoints.`,
19
+ args,
20
+ tool: async (client, args, ctx) => {
21
+ const [result, apiCall] = await webhooksListAllWebhookEndpoints(
22
+ client,
23
+ args.request,
24
+ { fetchOptions: { signal: ctx.signal } },
25
+ ).$inspect();
26
+
27
+ if (!result.ok) {
28
+ return {
29
+ content: [{ type: "text", text: result.error.message }],
30
+ isError: true,
31
+ };
32
+ }
33
+
34
+ const value = result.value;
35
+
36
+ return formatResult(value, apiCall);
37
+ },
38
+ };
@@ -34,6 +34,7 @@ export type ToolDefinition<Args extends undefined | ZodRawShape = undefined> =
34
34
  ) => CallToolResult | Promise<CallToolResult>;
35
35
  };
36
36
 
37
+ // Optional function to assist with formatting tool results
37
38
  export async function formatResult(
38
39
  value: unknown,
39
40
  init: { response?: Response | undefined },
@@ -9,7 +9,7 @@ import { Result as SafeParseResult } from "../../types/fp.js";
9
9
  import { RFCDate } from "../../types/rfcdate.js";
10
10
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
11
 
12
- export type Location = {
12
+ export type CompanyLocation = {
13
13
  address: string | null;
14
14
  phone?: string | null | undefined;
15
15
  city?: string | null | undefined;
@@ -48,15 +48,15 @@ export type Company = {
48
48
  name: string | null;
49
49
  status?: string | null | undefined;
50
50
  creditBalance?: string | null | undefined;
51
- location?: Location | null | undefined;
51
+ location?: CompanyLocation | null | undefined;
52
52
  contact?: CompanyContact | undefined;
53
53
  tax?: Tax | undefined;
54
54
  stats?: Stats | undefined;
55
55
  };
56
56
 
57
57
  /** @internal */
58
- export const Location$inboundSchema: z.ZodType<
59
- Location,
58
+ export const CompanyLocation$inboundSchema: z.ZodType<
59
+ CompanyLocation,
60
60
  z.ZodTypeDef,
61
61
  unknown
62
62
  > = z.object({
@@ -69,7 +69,7 @@ export const Location$inboundSchema: z.ZodType<
69
69
  });
70
70
 
71
71
  /** @internal */
72
- export type Location$Outbound = {
72
+ export type CompanyLocation$Outbound = {
73
73
  address: string | null;
74
74
  phone?: string | null | undefined;
75
75
  city?: string | null | undefined;
@@ -79,10 +79,10 @@ export type Location$Outbound = {
79
79
  };
80
80
 
81
81
  /** @internal */
82
- export const Location$outboundSchema: z.ZodType<
83
- Location$Outbound,
82
+ export const CompanyLocation$outboundSchema: z.ZodType<
83
+ CompanyLocation$Outbound,
84
84
  z.ZodTypeDef,
85
- Location
85
+ CompanyLocation
86
86
  > = z.object({
87
87
  address: z.nullable(z.string()),
88
88
  phone: z.nullable(z.string()).optional(),
@@ -96,26 +96,28 @@ export const Location$outboundSchema: z.ZodType<
96
96
  * @internal
97
97
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
98
98
  */
99
- export namespace Location$ {
100
- /** @deprecated use `Location$inboundSchema` instead. */
101
- export const inboundSchema = Location$inboundSchema;
102
- /** @deprecated use `Location$outboundSchema` instead. */
103
- export const outboundSchema = Location$outboundSchema;
104
- /** @deprecated use `Location$Outbound` instead. */
105
- export type Outbound = Location$Outbound;
99
+ export namespace CompanyLocation$ {
100
+ /** @deprecated use `CompanyLocation$inboundSchema` instead. */
101
+ export const inboundSchema = CompanyLocation$inboundSchema;
102
+ /** @deprecated use `CompanyLocation$outboundSchema` instead. */
103
+ export const outboundSchema = CompanyLocation$outboundSchema;
104
+ /** @deprecated use `CompanyLocation$Outbound` instead. */
105
+ export type Outbound = CompanyLocation$Outbound;
106
106
  }
107
107
 
108
- export function locationToJSON(location: Location): string {
109
- return JSON.stringify(Location$outboundSchema.parse(location));
108
+ export function companyLocationToJSON(
109
+ companyLocation: CompanyLocation,
110
+ ): string {
111
+ return JSON.stringify(CompanyLocation$outboundSchema.parse(companyLocation));
110
112
  }
111
113
 
112
- export function locationFromJSON(
114
+ export function companyLocationFromJSON(
113
115
  jsonString: string,
114
- ): SafeParseResult<Location, SDKValidationError> {
116
+ ): SafeParseResult<CompanyLocation, SDKValidationError> {
115
117
  return safeParse(
116
118
  jsonString,
117
- (x) => Location$inboundSchema.parse(JSON.parse(x)),
118
- `Failed to parse 'Location' from JSON`,
119
+ (x) => CompanyLocation$inboundSchema.parse(JSON.parse(x)),
120
+ `Failed to parse 'CompanyLocation' from JSON`,
119
121
  );
120
122
  }
121
123
 
@@ -333,7 +335,8 @@ export const Company$inboundSchema: z.ZodType<Company, z.ZodTypeDef, unknown> =
333
335
  name: z.nullable(z.string()),
334
336
  status: z.nullable(z.string()).optional(),
335
337
  credit_balance: z.nullable(z.string()).optional(),
336
- location: z.nullable(z.lazy(() => Location$inboundSchema)).optional(),
338
+ location: z.nullable(z.lazy(() => CompanyLocation$inboundSchema))
339
+ .optional(),
337
340
  contact: z.lazy(() => CompanyContact$inboundSchema).optional(),
338
341
  tax: z.lazy(() => Tax$inboundSchema).optional(),
339
342
  stats: z.lazy(() => Stats$inboundSchema).optional(),
@@ -349,7 +352,7 @@ export type Company$Outbound = {
349
352
  name: string | null;
350
353
  status?: string | null | undefined;
351
354
  credit_balance?: string | null | undefined;
352
- location?: Location$Outbound | null | undefined;
355
+ location?: CompanyLocation$Outbound | null | undefined;
353
356
  contact?: CompanyContact$Outbound | undefined;
354
357
  tax?: Tax$Outbound | undefined;
355
358
  stats?: Stats$Outbound | undefined;
@@ -365,7 +368,7 @@ export const Company$outboundSchema: z.ZodType<
365
368
  name: z.nullable(z.string()),
366
369
  status: z.nullable(z.string()).optional(),
367
370
  creditBalance: z.nullable(z.string()).optional(),
368
- location: z.nullable(z.lazy(() => Location$outboundSchema)).optional(),
371
+ location: z.nullable(z.lazy(() => CompanyLocation$outboundSchema)).optional(),
369
372
  contact: z.lazy(() => CompanyContact$outboundSchema).optional(),
370
373
  tax: z.lazy(() => Tax$outboundSchema).optional(),
371
374
  stats: z.lazy(() => Stats$outboundSchema).optional(),
@@ -37,7 +37,7 @@ export const Status = {
37
37
  } as const;
38
38
  export type Status = ClosedEnum<typeof Status>;
39
39
 
40
- export type Department = DepartmentSummary | number;
40
+ export type ContactDepartment = DepartmentSummary | number;
41
41
 
42
42
  /**
43
43
  * This object represents a contact at the system or facility level. Use it to verify vendors, create appointments, or check in visitors.
@@ -157,46 +157,50 @@ export namespace Status$ {
157
157
  }
158
158
 
159
159
  /** @internal */
160
- export const Department$inboundSchema: z.ZodType<
161
- Department,
160
+ export const ContactDepartment$inboundSchema: z.ZodType<
161
+ ContactDepartment,
162
162
  z.ZodTypeDef,
163
163
  unknown
164
164
  > = z.union([DepartmentSummary$inboundSchema, z.number().int()]);
165
165
 
166
166
  /** @internal */
167
- export type Department$Outbound = DepartmentSummary$Outbound | number;
167
+ export type ContactDepartment$Outbound = DepartmentSummary$Outbound | number;
168
168
 
169
169
  /** @internal */
170
- export const Department$outboundSchema: z.ZodType<
171
- Department$Outbound,
170
+ export const ContactDepartment$outboundSchema: z.ZodType<
171
+ ContactDepartment$Outbound,
172
172
  z.ZodTypeDef,
173
- Department
173
+ ContactDepartment
174
174
  > = z.union([DepartmentSummary$outboundSchema, z.number().int()]);
175
175
 
176
176
  /**
177
177
  * @internal
178
178
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
179
179
  */
180
- export namespace Department$ {
181
- /** @deprecated use `Department$inboundSchema` instead. */
182
- export const inboundSchema = Department$inboundSchema;
183
- /** @deprecated use `Department$outboundSchema` instead. */
184
- export const outboundSchema = Department$outboundSchema;
185
- /** @deprecated use `Department$Outbound` instead. */
186
- export type Outbound = Department$Outbound;
180
+ export namespace ContactDepartment$ {
181
+ /** @deprecated use `ContactDepartment$inboundSchema` instead. */
182
+ export const inboundSchema = ContactDepartment$inboundSchema;
183
+ /** @deprecated use `ContactDepartment$outboundSchema` instead. */
184
+ export const outboundSchema = ContactDepartment$outboundSchema;
185
+ /** @deprecated use `ContactDepartment$Outbound` instead. */
186
+ export type Outbound = ContactDepartment$Outbound;
187
187
  }
188
188
 
189
- export function departmentToJSON(department: Department): string {
190
- return JSON.stringify(Department$outboundSchema.parse(department));
189
+ export function contactDepartmentToJSON(
190
+ contactDepartment: ContactDepartment,
191
+ ): string {
192
+ return JSON.stringify(
193
+ ContactDepartment$outboundSchema.parse(contactDepartment),
194
+ );
191
195
  }
192
196
 
193
- export function departmentFromJSON(
197
+ export function contactDepartmentFromJSON(
194
198
  jsonString: string,
195
- ): SafeParseResult<Department, SDKValidationError> {
199
+ ): SafeParseResult<ContactDepartment, SDKValidationError> {
196
200
  return safeParse(
197
201
  jsonString,
198
- (x) => Department$inboundSchema.parse(JSON.parse(x)),
199
- `Failed to parse 'Department' from JSON`,
202
+ (x) => ContactDepartment$inboundSchema.parse(JSON.parse(x)),
203
+ `Failed to parse 'ContactDepartment' from JSON`,
200
204
  );
201
205
  }
202
206