@greensecurity/javascript-sdk 0.15.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (333) hide show
  1. package/README.md +31 -19
  2. package/bin/mcp-server.js +834 -198
  3. package/bin/mcp-server.js.map +45 -32
  4. package/funcs/organizationsListOrSearchFacilities.d.ts +1 -1
  5. package/funcs/organizationsListOrSearchFacilities.d.ts.map +1 -1
  6. package/funcs/organizationsListOrSearchFacilities.js +2 -2
  7. package/funcs/organizationsListOrSearchFacilities.js.map +1 -1
  8. package/funcs/supportArticlesGetSupportArticle.d.ts +25 -0
  9. package/funcs/supportArticlesGetSupportArticle.d.ts.map +1 -0
  10. package/funcs/supportArticlesGetSupportArticle.js +132 -0
  11. package/funcs/supportArticlesGetSupportArticle.js.map +1 -0
  12. package/funcs/supportArticlesListOrSearchSupportArticles.d.ts +16 -0
  13. package/funcs/supportArticlesListOrSearchSupportArticles.d.ts.map +1 -0
  14. package/funcs/supportArticlesListOrSearchSupportArticles.js +118 -0
  15. package/funcs/supportArticlesListOrSearchSupportArticles.js.map +1 -0
  16. package/funcs/{userGetCurrentUser.d.ts → usersGetCurrentUser.d.ts} +2 -2
  17. package/funcs/usersGetCurrentUser.d.ts.map +1 -0
  18. package/funcs/{userGetCurrentUser.js → usersGetCurrentUser.js} +3 -3
  19. package/funcs/usersGetCurrentUser.js.map +1 -0
  20. package/funcs/{userGetUserById.d.ts → usersGetUserById.d.ts} +2 -2
  21. package/funcs/usersGetUserById.d.ts.map +1 -0
  22. package/funcs/{userGetUserById.js → usersGetUserById.js} +3 -3
  23. package/funcs/usersGetUserById.js.map +1 -0
  24. package/funcs/{userLogsUserIntoTheSystem.d.ts → usersLogsUserIntoTheSystem.d.ts} +2 -2
  25. package/funcs/usersLogsUserIntoTheSystem.d.ts.map +1 -0
  26. package/funcs/{userLogsUserIntoTheSystem.js → usersLogsUserIntoTheSystem.js} +3 -3
  27. package/funcs/usersLogsUserIntoTheSystem.js.map +1 -0
  28. package/funcs/{userMagiclink.d.ts → usersMagiclink.d.ts} +2 -2
  29. package/funcs/usersMagiclink.d.ts.map +1 -0
  30. package/funcs/{userMagiclink.js → usersMagiclink.js} +4 -4
  31. package/funcs/usersMagiclink.js.map +1 -0
  32. package/funcs/{userPassword.d.ts → usersPassword.d.ts} +2 -2
  33. package/funcs/usersPassword.d.ts.map +1 -0
  34. package/funcs/{userPassword.js → usersPassword.js} +4 -4
  35. package/funcs/usersPassword.js.map +1 -0
  36. package/funcs/{userPasswordResetRequest.d.ts → usersPasswordResetRequest.d.ts} +2 -2
  37. package/funcs/usersPasswordResetRequest.d.ts.map +1 -0
  38. package/funcs/{userPasswordResetRequest.js → usersPasswordResetRequest.js} +4 -4
  39. package/funcs/usersPasswordResetRequest.js.map +1 -0
  40. package/funcs/vendorsCreateVendorRegistration.d.ts +1 -1
  41. package/funcs/vendorsCreateVendorRegistration.d.ts.map +1 -1
  42. package/funcs/vendorsCreateVendorRegistration.js +2 -1
  43. package/funcs/vendorsCreateVendorRegistration.js.map +1 -1
  44. package/funcs/vendorsListVendorCredentials.d.ts +16 -0
  45. package/funcs/vendorsListVendorCredentials.d.ts.map +1 -0
  46. package/funcs/vendorsListVendorCredentials.js +124 -0
  47. package/funcs/vendorsListVendorCredentials.js.map +1 -0
  48. package/funcs/vendorsListVendorJobTitles.d.ts +1 -1
  49. package/funcs/vendorsListVendorJobTitles.d.ts.map +1 -1
  50. package/funcs/vendorsListVendorJobTitles.js +1 -1
  51. package/funcs/vendorsListVendorJobTitles.js.map +1 -1
  52. package/jsr.json +1 -1
  53. package/lib/config.d.ts +3 -3
  54. package/lib/config.js +3 -3
  55. package/mcp-server/mcp-server.js +1 -1
  56. package/mcp-server/server.d.ts.map +1 -1
  57. package/mcp-server/server.js +19 -13
  58. package/mcp-server/server.js.map +1 -1
  59. package/mcp-server/tools/supportArticlesGetSupportArticle.d.ts +8 -0
  60. package/mcp-server/tools/supportArticlesGetSupportArticle.d.ts.map +1 -0
  61. package/mcp-server/tools/supportArticlesGetSupportArticle.js +71 -0
  62. package/mcp-server/tools/supportArticlesGetSupportArticle.js.map +1 -0
  63. package/mcp-server/tools/supportArticlesListOrSearchSupportArticles.d.ts +8 -0
  64. package/mcp-server/tools/supportArticlesListOrSearchSupportArticles.d.ts.map +1 -0
  65. package/mcp-server/tools/supportArticlesListOrSearchSupportArticles.js +64 -0
  66. package/mcp-server/tools/supportArticlesListOrSearchSupportArticles.js.map +1 -0
  67. package/mcp-server/tools/usersGetCurrentUser.d.ts +3 -0
  68. package/mcp-server/tools/usersGetCurrentUser.d.ts.map +1 -0
  69. package/mcp-server/tools/usersGetCurrentUser.js +26 -0
  70. package/mcp-server/tools/usersGetCurrentUser.js.map +1 -0
  71. package/mcp-server/tools/usersGetUserById.d.ts +8 -0
  72. package/mcp-server/tools/usersGetUserById.d.ts.map +1 -0
  73. package/mcp-server/tools/usersGetUserById.js +64 -0
  74. package/mcp-server/tools/usersGetUserById.js.map +1 -0
  75. package/mcp-server/tools/usersLogsUserIntoTheSystem.d.ts +8 -0
  76. package/mcp-server/tools/usersLogsUserIntoTheSystem.d.ts.map +1 -0
  77. package/mcp-server/tools/usersLogsUserIntoTheSystem.js +94 -0
  78. package/mcp-server/tools/usersLogsUserIntoTheSystem.js.map +1 -0
  79. package/mcp-server/tools/usersMagiclink.d.ts +8 -0
  80. package/mcp-server/tools/usersMagiclink.d.ts.map +1 -0
  81. package/mcp-server/tools/usersMagiclink.js +64 -0
  82. package/mcp-server/tools/usersMagiclink.js.map +1 -0
  83. package/mcp-server/tools/usersPassword.d.ts +8 -0
  84. package/mcp-server/tools/usersPassword.d.ts.map +1 -0
  85. package/mcp-server/tools/usersPassword.js +65 -0
  86. package/mcp-server/tools/usersPassword.js.map +1 -0
  87. package/mcp-server/tools/usersPasswordResetRequest.d.ts +8 -0
  88. package/mcp-server/tools/usersPasswordResetRequest.d.ts.map +1 -0
  89. package/mcp-server/tools/usersPasswordResetRequest.js +64 -0
  90. package/mcp-server/tools/usersPasswordResetRequest.js.map +1 -0
  91. package/mcp-server/tools/vendorsListVendorCredentials.d.ts +8 -0
  92. package/mcp-server/tools/vendorsListVendorCredentials.d.ts.map +1 -0
  93. package/mcp-server/tools/vendorsListVendorCredentials.js +64 -0
  94. package/mcp-server/tools/vendorsListVendorCredentials.js.map +1 -0
  95. package/models/components/{status.d.ts → activestatus.d.ts} +8 -8
  96. package/models/components/activestatus.d.ts.map +1 -0
  97. package/models/components/{status.js → activestatus.js} +12 -13
  98. package/models/components/activestatus.js.map +1 -0
  99. package/models/components/contact.d.ts +8 -8
  100. package/models/components/contact.d.ts.map +1 -1
  101. package/models/components/contact.js +14 -13
  102. package/models/components/contact.js.map +1 -1
  103. package/models/components/credentialstatus.d.ts +49 -0
  104. package/models/components/credentialstatus.d.ts.map +1 -0
  105. package/models/components/credentialstatus.js +68 -0
  106. package/models/components/credentialstatus.js.map +1 -0
  107. package/models/components/expand.d.ts +12 -0
  108. package/models/components/expand.d.ts.map +1 -1
  109. package/models/components/expand.js +4 -0
  110. package/models/components/expand.js.map +1 -1
  111. package/models/components/index.d.ts +5 -1
  112. package/models/components/index.d.ts.map +1 -1
  113. package/models/components/index.js +5 -1
  114. package/models/components/index.js.map +1 -1
  115. package/models/components/supportarticle.d.ts +43 -0
  116. package/models/components/supportarticle.d.ts.map +1 -0
  117. package/models/components/supportarticle.js +92 -0
  118. package/models/components/supportarticle.js.map +1 -0
  119. package/models/components/vendorcredentialslim.d.ts +44 -0
  120. package/models/components/vendorcredentialslim.d.ts.map +1 -0
  121. package/models/components/vendorcredentialslim.js +94 -0
  122. package/models/components/vendorcredentialslim.js.map +1 -0
  123. package/models/components/vendorrequiredcredential.d.ts +42 -0
  124. package/models/components/vendorrequiredcredential.d.ts.map +1 -0
  125. package/models/components/vendorrequiredcredential.js +96 -0
  126. package/models/components/vendorrequiredcredential.js.map +1 -0
  127. package/models/operations/createvendorregistration.d.ts +13 -13
  128. package/models/operations/createvendorregistration.d.ts.map +1 -1
  129. package/models/operations/createvendorregistration.js +18 -16
  130. package/models/operations/createvendorregistration.js.map +1 -1
  131. package/models/operations/getsupportarticle.d.ts +38 -0
  132. package/models/operations/getsupportarticle.d.ts.map +1 -0
  133. package/models/operations/getsupportarticle.js +72 -0
  134. package/models/operations/getsupportarticle.js.map +1 -0
  135. package/models/operations/index.d.ts +3 -0
  136. package/models/operations/index.d.ts.map +1 -1
  137. package/models/operations/index.js +3 -0
  138. package/models/operations/index.js.map +1 -1
  139. package/models/operations/listorsearchfacilities.d.ts +15 -15
  140. package/models/operations/listorsearchfacilities.d.ts.map +1 -1
  141. package/models/operations/listorsearchfacilities.js +20 -18
  142. package/models/operations/listorsearchfacilities.js.map +1 -1
  143. package/models/operations/listorsearchsupportarticles.d.ts +81 -0
  144. package/models/operations/listorsearchsupportarticles.d.ts.map +1 -0
  145. package/models/operations/listorsearchsupportarticles.js +114 -0
  146. package/models/operations/listorsearchsupportarticles.js.map +1 -0
  147. package/models/operations/listvendorcredentials.d.ts +122 -0
  148. package/models/operations/listvendorcredentials.d.ts.map +1 -0
  149. package/models/operations/listvendorcredentials.js +169 -0
  150. package/models/operations/listvendorcredentials.js.map +1 -0
  151. package/models/operations/listvendorjobtitles.d.ts +13 -13
  152. package/models/operations/listvendorjobtitles.d.ts.map +1 -1
  153. package/models/operations/listvendorjobtitles.js +16 -16
  154. package/models/operations/listvendorjobtitles.js.map +1 -1
  155. package/models/operations/magiclink.d.ts +13 -13
  156. package/models/operations/magiclink.d.ts.map +1 -1
  157. package/models/operations/magiclink.js +16 -16
  158. package/models/operations/magiclink.js.map +1 -1
  159. package/models/operations/password.d.ts +13 -13
  160. package/models/operations/password.d.ts.map +1 -1
  161. package/models/operations/password.js +16 -16
  162. package/models/operations/password.js.map +1 -1
  163. package/models/operations/passwordresetrequest.d.ts +13 -13
  164. package/models/operations/passwordresetrequest.d.ts.map +1 -1
  165. package/models/operations/passwordresetrequest.js +16 -16
  166. package/models/operations/passwordresetrequest.js.map +1 -1
  167. package/package.json +1 -1
  168. package/react-query/index.d.ts +9 -6
  169. package/react-query/index.d.ts.map +1 -1
  170. package/react-query/index.js +9 -6
  171. package/react-query/index.js.map +1 -1
  172. package/react-query/organizationsListOrSearchFacilities.d.ts +4 -4
  173. package/react-query/organizationsListOrSearchFacilities.d.ts.map +1 -1
  174. package/react-query/organizationsListOrSearchFacilities.js +1 -1
  175. package/react-query/organizationsListOrSearchFacilities.js.map +1 -1
  176. package/react-query/supportArticlesGetSupportArticle.d.ts +57 -0
  177. package/react-query/supportArticlesGetSupportArticle.d.ts.map +1 -0
  178. package/react-query/supportArticlesGetSupportArticle.js +113 -0
  179. package/react-query/supportArticlesGetSupportArticle.js.map +1 -0
  180. package/react-query/supportArticlesListOrSearchSupportArticles.d.ts +50 -0
  181. package/react-query/supportArticlesListOrSearchSupportArticles.d.ts.map +1 -0
  182. package/react-query/supportArticlesListOrSearchSupportArticles.js +101 -0
  183. package/react-query/supportArticlesListOrSearchSupportArticles.js.map +1 -0
  184. package/react-query/usersGetCurrentUser.d.ts +29 -0
  185. package/react-query/usersGetCurrentUser.d.ts.map +1 -0
  186. package/react-query/usersGetCurrentUser.js +75 -0
  187. package/react-query/usersGetCurrentUser.js.map +1 -0
  188. package/react-query/usersGetUserById.d.ts +31 -0
  189. package/react-query/usersGetUserById.d.ts.map +1 -0
  190. package/react-query/usersGetUserById.js +87 -0
  191. package/react-query/usersGetUserById.js.map +1 -0
  192. package/react-query/{userLogsUserIntoTheSystem.d.ts → usersLogsUserIntoTheSystem.d.ts} +7 -7
  193. package/react-query/usersLogsUserIntoTheSystem.d.ts.map +1 -0
  194. package/react-query/{userLogsUserIntoTheSystem.js → usersLogsUserIntoTheSystem.js} +13 -13
  195. package/react-query/usersLogsUserIntoTheSystem.js.map +1 -0
  196. package/react-query/usersMagiclink.d.ts +23 -0
  197. package/react-query/usersMagiclink.d.ts.map +1 -0
  198. package/react-query/{userMagiclink.js → usersMagiclink.js} +13 -13
  199. package/react-query/usersMagiclink.js.map +1 -0
  200. package/react-query/usersPassword.d.ts +24 -0
  201. package/react-query/usersPassword.d.ts.map +1 -0
  202. package/react-query/{userPassword.js → usersPassword.js} +13 -13
  203. package/react-query/usersPassword.js.map +1 -0
  204. package/react-query/usersPasswordResetRequest.d.ts +23 -0
  205. package/react-query/usersPasswordResetRequest.d.ts.map +1 -0
  206. package/react-query/{userPasswordResetRequest.js → usersPasswordResetRequest.js} +13 -13
  207. package/react-query/usersPasswordResetRequest.js.map +1 -0
  208. package/react-query/vendorsCreateVendorRegistration.d.ts +1 -1
  209. package/react-query/vendorsCreateVendorRegistration.d.ts.map +1 -1
  210. package/react-query/vendorsListVendorCredentials.d.ts +55 -0
  211. package/react-query/vendorsListVendorCredentials.d.ts.map +1 -0
  212. package/react-query/vendorsListVendorCredentials.js +103 -0
  213. package/react-query/vendorsListVendorCredentials.js.map +1 -0
  214. package/react-query/vendorsListVendorJobTitles.d.ts +1 -1
  215. package/react-query/vendorsListVendorJobTitles.d.ts.map +1 -1
  216. package/sdk/organizations.d.ts +1 -1
  217. package/sdk/organizations.d.ts.map +1 -1
  218. package/sdk/sdk.d.ts +6 -3
  219. package/sdk/sdk.d.ts.map +1 -1
  220. package/sdk/sdk.js +7 -3
  221. package/sdk/sdk.js.map +1 -1
  222. package/sdk/supportarticles.d.ts +27 -0
  223. package/sdk/supportarticles.d.ts.map +1 -0
  224. package/sdk/supportarticles.js +39 -0
  225. package/sdk/supportarticles.js.map +1 -0
  226. package/sdk/{user.d.ts → users.d.ts} +5 -5
  227. package/sdk/users.d.ts.map +1 -0
  228. package/sdk/{user.js → users.js} +16 -16
  229. package/sdk/users.js.map +1 -0
  230. package/sdk/vendors.d.ts +9 -2
  231. package/sdk/vendors.d.ts.map +1 -1
  232. package/sdk/vendors.js +10 -0
  233. package/sdk/vendors.js.map +1 -1
  234. package/src/__tests__/organizations.test.ts +5 -175
  235. package/src/__tests__/supportarticles.test.ts +63 -0
  236. package/src/__tests__/user.test.ts +13 -7
  237. package/src/__tests__/vendors.test.ts +7 -1
  238. package/src/funcs/organizationsListOrSearchFacilities.ts +8 -5
  239. package/src/funcs/supportArticlesGetSupportArticle.ts +181 -0
  240. package/src/funcs/supportArticlesListOrSearchSupportArticles.ts +165 -0
  241. package/src/funcs/{userGetCurrentUser.ts → usersGetCurrentUser.ts} +1 -1
  242. package/src/funcs/{userGetUserById.ts → usersGetUserById.ts} +1 -1
  243. package/src/funcs/{userLogsUserIntoTheSystem.ts → usersLogsUserIntoTheSystem.ts} +1 -1
  244. package/src/funcs/{userMagiclink.ts → usersMagiclink.ts} +5 -5
  245. package/src/funcs/{userPassword.ts → usersPassword.ts} +5 -5
  246. package/src/funcs/{userPasswordResetRequest.ts → usersPasswordResetRequest.ts} +8 -5
  247. package/src/funcs/vendorsCreateVendorRegistration.ts +8 -4
  248. package/src/funcs/vendorsListVendorCredentials.ts +169 -0
  249. package/src/funcs/vendorsListVendorJobTitles.ts +7 -4
  250. package/src/lib/config.ts +3 -3
  251. package/src/mcp-server/mcp-server.ts +1 -1
  252. package/src/mcp-server/server.ts +19 -13
  253. package/src/mcp-server/tools/supportArticlesGetSupportArticle.ts +46 -0
  254. package/src/mcp-server/tools/supportArticlesListOrSearchSupportArticles.ts +39 -0
  255. package/src/mcp-server/tools/{userGetCurrentUser.ts → usersGetCurrentUser.ts} +4 -4
  256. package/src/mcp-server/tools/{userGetUserById.ts → usersGetUserById.ts} +4 -4
  257. package/src/mcp-server/tools/{userLogsUserIntoTheSystem.ts → usersLogsUserIntoTheSystem.ts} +4 -4
  258. package/src/mcp-server/tools/{userMagiclink.ts → usersMagiclink.ts} +4 -4
  259. package/src/mcp-server/tools/{userPassword.ts → usersPassword.ts} +4 -4
  260. package/src/mcp-server/tools/{userPasswordResetRequest.ts → usersPasswordResetRequest.ts} +4 -4
  261. package/src/mcp-server/tools/vendorsListVendorCredentials.ts +37 -0
  262. package/src/models/components/activestatus.ts +38 -0
  263. package/src/models/components/contact.ts +14 -16
  264. package/src/models/components/credentialstatus.ts +44 -0
  265. package/src/models/components/expand.ts +4 -0
  266. package/src/models/components/index.ts +5 -1
  267. package/src/models/components/supportarticle.ts +99 -0
  268. package/src/models/components/vendorcredentialslim.ts +106 -0
  269. package/src/models/components/vendorrequiredcredential.ts +106 -0
  270. package/src/models/operations/createvendorregistration.ts +39 -32
  271. package/src/models/operations/getsupportarticle.ts +77 -0
  272. package/src/models/operations/index.ts +3 -0
  273. package/src/models/operations/listorsearchfacilities.ts +49 -37
  274. package/src/models/operations/listorsearchsupportarticles.ts +186 -0
  275. package/src/models/operations/listvendorcredentials.ts +281 -0
  276. package/src/models/operations/listvendorjobtitles.ts +31 -22
  277. package/src/models/operations/magiclink.ts +21 -21
  278. package/src/models/operations/password.ts +21 -21
  279. package/src/models/operations/passwordresetrequest.ts +39 -31
  280. package/src/react-query/index.ts +9 -6
  281. package/src/react-query/organizationsListOrSearchFacilities.ts +5 -5
  282. package/src/react-query/supportArticlesGetSupportArticle.ts +192 -0
  283. package/src/react-query/supportArticlesListOrSearchSupportArticles.ts +201 -0
  284. package/src/react-query/{userGetCurrentUser.ts → usersGetCurrentUser.ts} +27 -27
  285. package/src/react-query/{userGetUserById.ts → usersGetUserById.ts} +31 -29
  286. package/src/react-query/{userLogsUserIntoTheSystem.ts → usersLogsUserIntoTheSystem.ts} +18 -18
  287. package/src/react-query/{userMagiclink.ts → usersMagiclink.ts} +18 -18
  288. package/src/react-query/{userPassword.ts → usersPassword.ts} +18 -18
  289. package/src/react-query/{userPasswordResetRequest.ts → usersPasswordResetRequest.ts} +19 -19
  290. package/src/react-query/vendorsCreateVendorRegistration.ts +1 -1
  291. package/src/react-query/vendorsListVendorCredentials.ts +200 -0
  292. package/src/react-query/vendorsListVendorJobTitles.ts +1 -1
  293. package/src/sdk/organizations.ts +1 -1
  294. package/src/sdk/sdk.ts +10 -4
  295. package/src/sdk/supportarticles.ts +53 -0
  296. package/src/sdk/{user.ts → users.ts} +16 -16
  297. package/src/sdk/vendors.ts +22 -2
  298. package/funcs/userGetCurrentUser.d.ts.map +0 -1
  299. package/funcs/userGetCurrentUser.js.map +0 -1
  300. package/funcs/userGetUserById.d.ts.map +0 -1
  301. package/funcs/userGetUserById.js.map +0 -1
  302. package/funcs/userLogsUserIntoTheSystem.d.ts.map +0 -1
  303. package/funcs/userLogsUserIntoTheSystem.js.map +0 -1
  304. package/funcs/userMagiclink.d.ts.map +0 -1
  305. package/funcs/userMagiclink.js.map +0 -1
  306. package/funcs/userPassword.d.ts.map +0 -1
  307. package/funcs/userPassword.js.map +0 -1
  308. package/funcs/userPasswordResetRequest.d.ts.map +0 -1
  309. package/funcs/userPasswordResetRequest.js.map +0 -1
  310. package/models/components/status.d.ts.map +0 -1
  311. package/models/components/status.js.map +0 -1
  312. package/react-query/userGetCurrentUser.d.ts +0 -29
  313. package/react-query/userGetCurrentUser.d.ts.map +0 -1
  314. package/react-query/userGetCurrentUser.js +0 -75
  315. package/react-query/userGetCurrentUser.js.map +0 -1
  316. package/react-query/userGetUserById.d.ts +0 -31
  317. package/react-query/userGetUserById.d.ts.map +0 -1
  318. package/react-query/userGetUserById.js +0 -87
  319. package/react-query/userGetUserById.js.map +0 -1
  320. package/react-query/userLogsUserIntoTheSystem.d.ts.map +0 -1
  321. package/react-query/userLogsUserIntoTheSystem.js.map +0 -1
  322. package/react-query/userMagiclink.d.ts +0 -23
  323. package/react-query/userMagiclink.d.ts.map +0 -1
  324. package/react-query/userMagiclink.js.map +0 -1
  325. package/react-query/userPassword.d.ts +0 -24
  326. package/react-query/userPassword.d.ts.map +0 -1
  327. package/react-query/userPassword.js.map +0 -1
  328. package/react-query/userPasswordResetRequest.d.ts +0 -23
  329. package/react-query/userPasswordResetRequest.d.ts.map +0 -1
  330. package/react-query/userPasswordResetRequest.js.map +0 -1
  331. package/sdk/user.d.ts.map +0 -1
  332. package/sdk/user.js.map +0 -1
  333. package/src/models/components/status.ts +0 -38
@@ -0,0 +1,181 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { GreenSecurityCore } from "../core.js";
6
+ import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { RequestOptions } from "../lib/sdks.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import * as components from "../models/components/index.js";
14
+ import { APIError } from "../models/errors/apierror.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/httpclienterrors.js";
22
+ import * as errors from "../models/errors/index.js";
23
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
24
+ import * as operations from "../models/operations/index.js";
25
+ import { APICall, APIPromise } from "../types/async.js";
26
+ import { Result } from "../types/fp.js";
27
+
28
+ /**
29
+ * Get support article
30
+ *
31
+ * @remarks
32
+ * Retrieve an individual support article.
33
+ *
34
+ * Available `expand` scopes are:
35
+ *
36
+ * - support_article.description
37
+ * - support_article.published
38
+ * - support_article.notes
39
+ * - support_article.support_category
40
+ */
41
+ export function supportArticlesGetSupportArticle(
42
+ client: GreenSecurityCore,
43
+ request: operations.GetSupportArticleRequest,
44
+ options?: RequestOptions,
45
+ ): APIPromise<
46
+ Result<
47
+ components.SupportArticle,
48
+ | errors.ApiErrorResponse
49
+ | APIError
50
+ | SDKValidationError
51
+ | UnexpectedClientError
52
+ | InvalidRequestError
53
+ | RequestAbortedError
54
+ | RequestTimeoutError
55
+ | ConnectionError
56
+ >
57
+ > {
58
+ return new APIPromise($do(
59
+ client,
60
+ request,
61
+ options,
62
+ ));
63
+ }
64
+
65
+ async function $do(
66
+ client: GreenSecurityCore,
67
+ request: operations.GetSupportArticleRequest,
68
+ options?: RequestOptions,
69
+ ): Promise<
70
+ [
71
+ Result<
72
+ components.SupportArticle,
73
+ | errors.ApiErrorResponse
74
+ | APIError
75
+ | SDKValidationError
76
+ | UnexpectedClientError
77
+ | InvalidRequestError
78
+ | RequestAbortedError
79
+ | RequestTimeoutError
80
+ | ConnectionError
81
+ >,
82
+ APICall,
83
+ ]
84
+ > {
85
+ const parsed = safeParse(
86
+ request,
87
+ (value) => operations.GetSupportArticleRequest$outboundSchema.parse(value),
88
+ "Input validation failed",
89
+ );
90
+ if (!parsed.ok) {
91
+ return [parsed, { status: "invalid" }];
92
+ }
93
+ const payload = parsed.value;
94
+ const body = null;
95
+
96
+ const pathParams = {
97
+ id: encodeSimple("id", payload.id, {
98
+ explode: false,
99
+ charEncoding: "percent",
100
+ }),
101
+ };
102
+
103
+ const path = pathToFunc("/support_articles/{id}")(pathParams);
104
+
105
+ const query = encodeFormQuery({
106
+ "expand": payload.expand,
107
+ });
108
+
109
+ const headers = new Headers(compactMap({
110
+ Accept: "application/json",
111
+ }));
112
+
113
+ const securityInput = await extractSecurity(client._options.security);
114
+ const requestSecurity = resolveGlobalSecurity(securityInput);
115
+
116
+ const context = {
117
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
118
+ operationID: "getSupportArticle",
119
+ oAuth2Scopes: [],
120
+
121
+ resolvedSecurity: requestSecurity,
122
+
123
+ securitySource: client._options.security,
124
+ retryConfig: options?.retries
125
+ || client._options.retryConfig
126
+ || { strategy: "none" },
127
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
128
+ };
129
+
130
+ const requestRes = client._createRequest(context, {
131
+ security: requestSecurity,
132
+ method: "GET",
133
+ baseURL: options?.serverURL,
134
+ path: path,
135
+ headers: headers,
136
+ query: query,
137
+ body: body,
138
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
139
+ }, options);
140
+ if (!requestRes.ok) {
141
+ return [requestRes, { status: "invalid" }];
142
+ }
143
+ const req = requestRes.value;
144
+
145
+ const doResult = await client._do(req, {
146
+ context,
147
+ errorCodes: ["404", "4XX", "5XX"],
148
+ retryConfig: context.retryConfig,
149
+ retryCodes: context.retryCodes,
150
+ });
151
+ if (!doResult.ok) {
152
+ return [doResult, { status: "request-error", request: req }];
153
+ }
154
+ const response = doResult.value;
155
+
156
+ const responseFields = {
157
+ HttpMeta: { Response: response, Request: req },
158
+ };
159
+
160
+ const [result] = await M.match<
161
+ components.SupportArticle,
162
+ | errors.ApiErrorResponse
163
+ | APIError
164
+ | SDKValidationError
165
+ | UnexpectedClientError
166
+ | InvalidRequestError
167
+ | RequestAbortedError
168
+ | RequestTimeoutError
169
+ | ConnectionError
170
+ >(
171
+ M.json(200, components.SupportArticle$inboundSchema),
172
+ M.jsonErr(404, errors.ApiErrorResponse$inboundSchema),
173
+ M.fail("4XX"),
174
+ M.fail("5XX"),
175
+ )(response, { extraFields: responseFields });
176
+ if (!result.ok) {
177
+ return [result, { status: "complete", request: req, response }];
178
+ }
179
+
180
+ return [result, { status: "complete", request: req, response }];
181
+ }
@@ -0,0 +1,165 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { GreenSecurityCore } from "../core.js";
6
+ import { encodeFormQuery } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { RequestOptions } from "../lib/sdks.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import { APIError } from "../models/errors/apierror.js";
14
+ import {
15
+ ConnectionError,
16
+ InvalidRequestError,
17
+ RequestAbortedError,
18
+ RequestTimeoutError,
19
+ UnexpectedClientError,
20
+ } from "../models/errors/httpclienterrors.js";
21
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
22
+ import * as operations from "../models/operations/index.js";
23
+ import { APICall, APIPromise } from "../types/async.js";
24
+ import { Result } from "../types/fp.js";
25
+
26
+ /**
27
+ * List or search support articles
28
+ *
29
+ * @remarks
30
+ * List or search support articles for FAQ.
31
+ */
32
+ export function supportArticlesListOrSearchSupportArticles(
33
+ client: GreenSecurityCore,
34
+ request: operations.ListOrSearchSupportArticlesRequest,
35
+ options?: RequestOptions,
36
+ ): APIPromise<
37
+ Result<
38
+ operations.ListOrSearchSupportArticlesListOrSearchArticlesOk,
39
+ | APIError
40
+ | SDKValidationError
41
+ | UnexpectedClientError
42
+ | InvalidRequestError
43
+ | RequestAbortedError
44
+ | RequestTimeoutError
45
+ | ConnectionError
46
+ >
47
+ > {
48
+ return new APIPromise($do(
49
+ client,
50
+ request,
51
+ options,
52
+ ));
53
+ }
54
+
55
+ async function $do(
56
+ client: GreenSecurityCore,
57
+ request: operations.ListOrSearchSupportArticlesRequest,
58
+ options?: RequestOptions,
59
+ ): Promise<
60
+ [
61
+ Result<
62
+ operations.ListOrSearchSupportArticlesListOrSearchArticlesOk,
63
+ | APIError
64
+ | SDKValidationError
65
+ | UnexpectedClientError
66
+ | InvalidRequestError
67
+ | RequestAbortedError
68
+ | RequestTimeoutError
69
+ | ConnectionError
70
+ >,
71
+ APICall,
72
+ ]
73
+ > {
74
+ const parsed = safeParse(
75
+ request,
76
+ (value) =>
77
+ operations.ListOrSearchSupportArticlesRequest$outboundSchema.parse(value),
78
+ "Input validation failed",
79
+ );
80
+ if (!parsed.ok) {
81
+ return [parsed, { status: "invalid" }];
82
+ }
83
+ const payload = parsed.value;
84
+ const body = null;
85
+
86
+ const path = pathToFunc("/support_articles")();
87
+
88
+ const query = encodeFormQuery({
89
+ "desc": payload.desc,
90
+ "items_per_page": payload.items_per_page,
91
+ "page": payload.page,
92
+ "sort": payload.sort,
93
+ });
94
+
95
+ const headers = new Headers(compactMap({
96
+ Accept: "application/json",
97
+ }));
98
+
99
+ const securityInput = await extractSecurity(client._options.security);
100
+ const requestSecurity = resolveGlobalSecurity(securityInput);
101
+
102
+ const context = {
103
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
104
+ operationID: "listOrSearchSupportArticles",
105
+ oAuth2Scopes: [],
106
+
107
+ resolvedSecurity: requestSecurity,
108
+
109
+ securitySource: client._options.security,
110
+ retryConfig: options?.retries
111
+ || client._options.retryConfig
112
+ || { strategy: "none" },
113
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
114
+ };
115
+
116
+ const requestRes = client._createRequest(context, {
117
+ security: requestSecurity,
118
+ method: "GET",
119
+ baseURL: options?.serverURL,
120
+ path: path,
121
+ headers: headers,
122
+ query: query,
123
+ body: body,
124
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
125
+ }, options);
126
+ if (!requestRes.ok) {
127
+ return [requestRes, { status: "invalid" }];
128
+ }
129
+ const req = requestRes.value;
130
+
131
+ const doResult = await client._do(req, {
132
+ context,
133
+ errorCodes: ["4XX", "5XX"],
134
+ retryConfig: context.retryConfig,
135
+ retryCodes: context.retryCodes,
136
+ });
137
+ if (!doResult.ok) {
138
+ return [doResult, { status: "request-error", request: req }];
139
+ }
140
+ const response = doResult.value;
141
+
142
+ const [result] = await M.match<
143
+ operations.ListOrSearchSupportArticlesListOrSearchArticlesOk,
144
+ | APIError
145
+ | SDKValidationError
146
+ | UnexpectedClientError
147
+ | InvalidRequestError
148
+ | RequestAbortedError
149
+ | RequestTimeoutError
150
+ | ConnectionError
151
+ >(
152
+ M.json(
153
+ 200,
154
+ operations
155
+ .ListOrSearchSupportArticlesListOrSearchArticlesOk$inboundSchema,
156
+ ),
157
+ M.fail("4XX"),
158
+ M.fail("5XX"),
159
+ )(response);
160
+ if (!result.ok) {
161
+ return [result, { status: "complete", request: req, response }];
162
+ }
163
+
164
+ return [result, { status: "complete", request: req, response }];
165
+ }
@@ -28,7 +28,7 @@ import { Result } from "../types/fp.js";
28
28
  * @remarks
29
29
  * Returns a user object for the user represented by the authorization token
30
30
  */
31
- export function userGetCurrentUser(
31
+ export function usersGetCurrentUser(
32
32
  client: GreenSecurityCore,
33
33
  options?: RequestOptions,
34
34
  ): APIPromise<
@@ -31,7 +31,7 @@ import { Result } from "../types/fp.js";
31
31
  * @remarks
32
32
  * Returns a user object for the user represented by the identifier in the path.
33
33
  */
34
- export function userGetUserById(
34
+ export function usersGetUserById(
35
35
  client: GreenSecurityCore,
36
36
  request: operations.GetUserByIdRequest,
37
37
  options?: RequestOptions,
@@ -59,7 +59,7 @@ import { Result } from "../types/fp.js";
59
59
  * 4. The `user_token` will be appended as a query string parameter to your `return_url` - you must parse this token and store it
60
60
  * 5. Fetch the user object from `/users/me` using the token
61
61
  */
62
- export function userLogsUserIntoTheSystem(
62
+ export function usersLogsUserIntoTheSystem(
63
63
  client: GreenSecurityCore,
64
64
  request: operations.LogsUserIntoTheSystemRequestBody,
65
65
  options?: RequestOptions,
@@ -30,13 +30,13 @@ import { Result } from "../types/fp.js";
30
30
  * @remarks
31
31
  * It sends an email with a magic link to allow the user to log in.
32
32
  */
33
- export function userMagiclink(
33
+ export function usersMagiclink(
34
34
  client: GreenSecurityCore,
35
35
  request: operations.MagiclinkRequestBody,
36
36
  options?: RequestOptions,
37
37
  ): APIPromise<
38
38
  Result<
39
- operations.MagiclinkResponseBody,
39
+ operations.MagiclinkMagiclinkOk,
40
40
  | errors.ApiErrorResponse
41
41
  | APIError
42
42
  | SDKValidationError
@@ -61,7 +61,7 @@ async function $do(
61
61
  ): Promise<
62
62
  [
63
63
  Result<
64
- operations.MagiclinkResponseBody,
64
+ operations.MagiclinkMagiclinkOk,
65
65
  | errors.ApiErrorResponse
66
66
  | APIError
67
67
  | SDKValidationError
@@ -139,7 +139,7 @@ async function $do(
139
139
  };
140
140
 
141
141
  const [result] = await M.match<
142
- operations.MagiclinkResponseBody,
142
+ operations.MagiclinkMagiclinkOk,
143
143
  | errors.ApiErrorResponse
144
144
  | APIError
145
145
  | SDKValidationError
@@ -149,7 +149,7 @@ async function $do(
149
149
  | RequestTimeoutError
150
150
  | ConnectionError
151
151
  >(
152
- M.json(200, operations.MagiclinkResponseBody$inboundSchema),
152
+ M.json(200, operations.MagiclinkMagiclinkOk$inboundSchema),
153
153
  M.jsonErr(404, errors.ApiErrorResponse$inboundSchema),
154
154
  M.fail("4XX"),
155
155
  M.fail("5XX"),
@@ -31,13 +31,13 @@ import { Result } from "../types/fp.js";
31
31
  * Resets the a user's password using a password_reset_id that was sent to them via email.
32
32
  * See /users/passwordresetrequest to initiate a password reset flow.
33
33
  */
34
- export function userPassword(
34
+ export function usersPassword(
35
35
  client: GreenSecurityCore,
36
36
  request: operations.PasswordRequestBody,
37
37
  options?: RequestOptions,
38
38
  ): APIPromise<
39
39
  Result<
40
- operations.PasswordResponseBody,
40
+ operations.PasswordPasswordOk,
41
41
  | errors.ApiErrorResponse
42
42
  | APIError
43
43
  | SDKValidationError
@@ -62,7 +62,7 @@ async function $do(
62
62
  ): Promise<
63
63
  [
64
64
  Result<
65
- operations.PasswordResponseBody,
65
+ operations.PasswordPasswordOk,
66
66
  | errors.ApiErrorResponse
67
67
  | APIError
68
68
  | SDKValidationError
@@ -140,7 +140,7 @@ async function $do(
140
140
  };
141
141
 
142
142
  const [result] = await M.match<
143
- operations.PasswordResponseBody,
143
+ operations.PasswordPasswordOk,
144
144
  | errors.ApiErrorResponse
145
145
  | APIError
146
146
  | SDKValidationError
@@ -150,7 +150,7 @@ async function $do(
150
150
  | RequestTimeoutError
151
151
  | ConnectionError
152
152
  >(
153
- M.json(200, operations.PasswordResponseBody$inboundSchema),
153
+ M.json(200, operations.PasswordPasswordOk$inboundSchema),
154
154
  M.jsonErr(404, errors.ApiErrorResponse$inboundSchema),
155
155
  M.fail("4XX"),
156
156
  M.fail("5XX"),
@@ -30,13 +30,13 @@ import { Result } from "../types/fp.js";
30
30
  * @remarks
31
31
  * It sends an email with a link for resetting a user's password.
32
32
  */
33
- export function userPasswordResetRequest(
33
+ export function usersPasswordResetRequest(
34
34
  client: GreenSecurityCore,
35
35
  request: operations.PasswordResetRequestRequestBody,
36
36
  options?: RequestOptions,
37
37
  ): APIPromise<
38
38
  Result<
39
- operations.PasswordResetRequestResponseBody,
39
+ operations.PasswordResetRequestPasswordResetRequestOk,
40
40
  | errors.ApiErrorResponse
41
41
  | APIError
42
42
  | SDKValidationError
@@ -61,7 +61,7 @@ async function $do(
61
61
  ): Promise<
62
62
  [
63
63
  Result<
64
- operations.PasswordResetRequestResponseBody,
64
+ operations.PasswordResetRequestPasswordResetRequestOk,
65
65
  | errors.ApiErrorResponse
66
66
  | APIError
67
67
  | SDKValidationError
@@ -140,7 +140,7 @@ async function $do(
140
140
  };
141
141
 
142
142
  const [result] = await M.match<
143
- operations.PasswordResetRequestResponseBody,
143
+ operations.PasswordResetRequestPasswordResetRequestOk,
144
144
  | errors.ApiErrorResponse
145
145
  | APIError
146
146
  | SDKValidationError
@@ -150,7 +150,10 @@ async function $do(
150
150
  | RequestTimeoutError
151
151
  | ConnectionError
152
152
  >(
153
- M.json(200, operations.PasswordResetRequestResponseBody$inboundSchema),
153
+ M.json(
154
+ 200,
155
+ operations.PasswordResetRequestPasswordResetRequestOk$inboundSchema,
156
+ ),
154
157
  M.jsonErr(404, errors.ApiErrorResponse$inboundSchema),
155
158
  M.fail("4XX"),
156
159
  M.fail("5XX"),
@@ -35,7 +35,7 @@ export function vendorsCreateVendorRegistration(
35
35
  options?: RequestOptions,
36
36
  ): APIPromise<
37
37
  Result<
38
- operations.CreateVendorRegistrationResponseBody,
38
+ operations.CreateVendorRegistrationCreateVendorRegistrationCreated,
39
39
  | errors.ApiErrorResponse
40
40
  | APIError
41
41
  | SDKValidationError
@@ -60,7 +60,7 @@ async function $do(
60
60
  ): Promise<
61
61
  [
62
62
  Result<
63
- operations.CreateVendorRegistrationResponseBody,
63
+ operations.CreateVendorRegistrationCreateVendorRegistrationCreated,
64
64
  | errors.ApiErrorResponse
65
65
  | APIError
66
66
  | SDKValidationError
@@ -137,7 +137,7 @@ async function $do(
137
137
  };
138
138
 
139
139
  const [result] = await M.match<
140
- operations.CreateVendorRegistrationResponseBody,
140
+ operations.CreateVendorRegistrationCreateVendorRegistrationCreated,
141
141
  | errors.ApiErrorResponse
142
142
  | APIError
143
143
  | SDKValidationError
@@ -147,7 +147,11 @@ async function $do(
147
147
  | RequestTimeoutError
148
148
  | ConnectionError
149
149
  >(
150
- M.json(201, operations.CreateVendorRegistrationResponseBody$inboundSchema),
150
+ M.json(
151
+ 201,
152
+ operations
153
+ .CreateVendorRegistrationCreateVendorRegistrationCreated$inboundSchema,
154
+ ),
151
155
  M.jsonErr([400, 401, 403, 409], errors.ApiErrorResponse$inboundSchema),
152
156
  M.fail("4XX"),
153
157
  M.fail("5XX"),