@greensecurity/javascript-sdk 0.9.1

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 (432) hide show
  1. package/.devcontainer/README.md +35 -0
  2. package/.devcontainer/devcontainer.json +45 -0
  3. package/FUNCTIONS.md +109 -0
  4. package/REACT_QUERY.md +318 -0
  5. package/README.md +561 -0
  6. package/RUNTIMES.md +48 -0
  7. package/core.d.ts +10 -0
  8. package/core.d.ts.map +1 -0
  9. package/core.js +17 -0
  10. package/core.js.map +1 -0
  11. package/docs/sdks/greensecurity/README.md +14 -0
  12. package/docs/sdks/organizations/README.md +252 -0
  13. package/docs/sdks/user/README.md +348 -0
  14. package/docs/sdks/vendors/README.md +219 -0
  15. package/funcs/organizationsGetFacility.d.ts +17 -0
  16. package/funcs/organizationsGetFacility.d.ts.map +1 -0
  17. package/funcs/organizationsGetFacility.js +117 -0
  18. package/funcs/organizationsGetFacility.js.map +1 -0
  19. package/funcs/organizationsListOrSearchFacilities.d.ts +28 -0
  20. package/funcs/organizationsListOrSearchFacilities.d.ts.map +1 -0
  21. package/funcs/organizationsListOrSearchFacilities.js +131 -0
  22. package/funcs/organizationsListOrSearchFacilities.js.map +1 -0
  23. package/funcs/userGetCurrentUser.d.ts +16 -0
  24. package/funcs/userGetCurrentUser.d.ts.map +1 -0
  25. package/funcs/userGetCurrentUser.js +101 -0
  26. package/funcs/userGetCurrentUser.js.map +1 -0
  27. package/funcs/userGetUserById.d.ts +17 -0
  28. package/funcs/userGetUserById.d.ts.map +1 -0
  29. package/funcs/userGetUserById.js +117 -0
  30. package/funcs/userGetUserById.js.map +1 -0
  31. package/funcs/userLogsUserIntoTheSystem.d.ts +46 -0
  32. package/funcs/userLogsUserIntoTheSystem.d.ts.map +1 -0
  33. package/funcs/userLogsUserIntoTheSystem.js +137 -0
  34. package/funcs/userLogsUserIntoTheSystem.js.map +1 -0
  35. package/funcs/vendorsCreateVendorRegistration.d.ts +16 -0
  36. package/funcs/vendorsCreateVendorRegistration.d.ts.map +1 -0
  37. package/funcs/vendorsCreateVendorRegistration.js +107 -0
  38. package/funcs/vendorsCreateVendorRegistration.js.map +1 -0
  39. package/funcs/vendorsListVendorJobTitles.d.ts +16 -0
  40. package/funcs/vendorsListVendorJobTitles.d.ts.map +1 -0
  41. package/funcs/vendorsListVendorJobTitles.js +114 -0
  42. package/funcs/vendorsListVendorJobTitles.js.map +1 -0
  43. package/hooks/hooks.d.ts +24 -0
  44. package/hooks/hooks.d.ts.map +1 -0
  45. package/hooks/hooks.js +86 -0
  46. package/hooks/hooks.js.map +1 -0
  47. package/hooks/index.d.ts +3 -0
  48. package/hooks/index.d.ts.map +1 -0
  49. package/hooks/index.js +22 -0
  50. package/hooks/index.js.map +1 -0
  51. package/hooks/registration.d.ts +3 -0
  52. package/hooks/registration.d.ts.map +1 -0
  53. package/hooks/registration.js +15 -0
  54. package/hooks/registration.js.map +1 -0
  55. package/hooks/types.d.ts +78 -0
  56. package/hooks/types.d.ts.map +1 -0
  57. package/hooks/types.js +6 -0
  58. package/hooks/types.js.map +1 -0
  59. package/index.d.ts +4 -0
  60. package/index.d.ts.map +1 -0
  61. package/index.js +46 -0
  62. package/index.js.map +1 -0
  63. package/jsr.json +27 -0
  64. package/lib/base64.d.ts +10 -0
  65. package/lib/base64.d.ts.map +1 -0
  66. package/lib/base64.js +71 -0
  67. package/lib/base64.js.map +1 -0
  68. package/lib/config.d.ts +38 -0
  69. package/lib/config.d.ts.map +1 -0
  70. package/lib/config.js +46 -0
  71. package/lib/config.js.map +1 -0
  72. package/lib/dlv.d.ts +14 -0
  73. package/lib/dlv.d.ts.map +1 -0
  74. package/lib/dlv.js +49 -0
  75. package/lib/dlv.js.map +1 -0
  76. package/lib/encodings.d.ts +52 -0
  77. package/lib/encodings.d.ts.map +1 -0
  78. package/lib/encodings.js +368 -0
  79. package/lib/encodings.js.map +1 -0
  80. package/lib/env.d.ts +16 -0
  81. package/lib/env.d.ts.map +1 -0
  82. package/lib/env.js +66 -0
  83. package/lib/env.js.map +1 -0
  84. package/lib/files.d.ts +8 -0
  85. package/lib/files.d.ts.map +1 -0
  86. package/lib/files.js +36 -0
  87. package/lib/files.js.map +1 -0
  88. package/lib/http.d.ts +67 -0
  89. package/lib/http.d.ts.map +1 -0
  90. package/lib/http.js +217 -0
  91. package/lib/http.js.map +1 -0
  92. package/lib/is-plain-object.d.ts +2 -0
  93. package/lib/is-plain-object.d.ts.map +1 -0
  94. package/lib/is-plain-object.js +41 -0
  95. package/lib/is-plain-object.js.map +1 -0
  96. package/lib/logger.d.ts +6 -0
  97. package/lib/logger.d.ts.map +1 -0
  98. package/lib/logger.js +6 -0
  99. package/lib/logger.js.map +1 -0
  100. package/lib/matchers.d.ts +64 -0
  101. package/lib/matchers.d.ts.map +1 -0
  102. package/lib/matchers.js +204 -0
  103. package/lib/matchers.js.map +1 -0
  104. package/lib/primitives.d.ts +23 -0
  105. package/lib/primitives.d.ts.map +1 -0
  106. package/lib/primitives.js +104 -0
  107. package/lib/primitives.js.map +1 -0
  108. package/lib/retries.d.ts +38 -0
  109. package/lib/retries.d.ts.map +1 -0
  110. package/lib/retries.js +153 -0
  111. package/lib/retries.js.map +1 -0
  112. package/lib/schemas.d.ts +19 -0
  113. package/lib/schemas.d.ts.map +1 -0
  114. package/lib/schemas.js +62 -0
  115. package/lib/schemas.js.map +1 -0
  116. package/lib/sdks.d.ts +60 -0
  117. package/lib/sdks.d.ts.map +1 -0
  118. package/lib/sdks.js +280 -0
  119. package/lib/sdks.js.map +1 -0
  120. package/lib/security.d.ts +82 -0
  121. package/lib/security.d.ts.map +1 -0
  122. package/lib/security.js +145 -0
  123. package/lib/security.js.map +1 -0
  124. package/lib/url.d.ts +5 -0
  125. package/lib/url.d.ts.map +1 -0
  126. package/lib/url.js +25 -0
  127. package/lib/url.js.map +1 -0
  128. package/models/components/contact.d.ts +135 -0
  129. package/models/components/contact.d.ts.map +1 -0
  130. package/models/components/contact.js +172 -0
  131. package/models/components/contact.js.map +1 -0
  132. package/models/components/departmentsummary.d.ts +34 -0
  133. package/models/components/departmentsummary.d.ts.map +1 -0
  134. package/models/components/departmentsummary.js +71 -0
  135. package/models/components/departmentsummary.js.map +1 -0
  136. package/models/components/desc.d.ts +25 -0
  137. package/models/components/desc.d.ts.map +1 -0
  138. package/models/components/desc.js +66 -0
  139. package/models/components/desc.js.map +1 -0
  140. package/models/components/expand.d.ts +79 -0
  141. package/models/components/expand.d.ts.map +1 -0
  142. package/models/components/expand.js +79 -0
  143. package/models/components/expand.js.map +1 -0
  144. package/models/components/facility.d.ts +544 -0
  145. package/models/components/facility.d.ts.map +1 -0
  146. package/models/components/facility.js +797 -0
  147. package/models/components/facility.js.map +1 -0
  148. package/models/components/facilitysummary.d.ts +34 -0
  149. package/models/components/facilitysummary.d.ts.map +1 -0
  150. package/models/components/facilitysummary.js +71 -0
  151. package/models/components/facilitysummary.js.map +1 -0
  152. package/models/components/imageset.d.ts +38 -0
  153. package/models/components/imageset.d.ts.map +1 -0
  154. package/models/components/imageset.js +75 -0
  155. package/models/components/imageset.js.map +1 -0
  156. package/models/components/index.d.ts +20 -0
  157. package/models/components/index.d.ts.map +1 -0
  158. package/models/components/index.js +39 -0
  159. package/models/components/index.js.map +1 -0
  160. package/models/components/loginemailandpassword.d.ts +45 -0
  161. package/models/components/loginemailandpassword.d.ts.map +1 -0
  162. package/models/components/loginemailandpassword.js +82 -0
  163. package/models/components/loginemailandpassword.js.map +1 -0
  164. package/models/components/loginrequirementsfromemail.d.ts +40 -0
  165. package/models/components/loginrequirementsfromemail.d.ts.map +1 -0
  166. package/models/components/loginrequirementsfromemail.js +80 -0
  167. package/models/components/loginrequirementsfromemail.js.map +1 -0
  168. package/models/components/mfarequiredresponse.d.ts +98 -0
  169. package/models/components/mfarequiredresponse.d.ts.map +1 -0
  170. package/models/components/mfarequiredresponse.js +126 -0
  171. package/models/components/mfarequiredresponse.js.map +1 -0
  172. package/models/components/pager.d.ts +69 -0
  173. package/models/components/pager.d.ts.map +1 -0
  174. package/models/components/pager.js +97 -0
  175. package/models/components/pager.js.map +1 -0
  176. package/models/components/passwordrequiredresponse.d.ts +62 -0
  177. package/models/components/passwordrequiredresponse.d.ts.map +1 -0
  178. package/models/components/passwordrequiredresponse.js +92 -0
  179. package/models/components/passwordrequiredresponse.js.map +1 -0
  180. package/models/components/samlloginrequiredresponse.d.ts +73 -0
  181. package/models/components/samlloginrequiredresponse.d.ts.map +1 -0
  182. package/models/components/samlloginrequiredresponse.js +106 -0
  183. package/models/components/samlloginrequiredresponse.js.map +1 -0
  184. package/models/components/security.d.ts +31 -0
  185. package/models/components/security.d.ts.map +1 -0
  186. package/models/components/security.js +80 -0
  187. package/models/components/security.js.map +1 -0
  188. package/models/components/status.d.ts +37 -0
  189. package/models/components/status.d.ts.map +1 -0
  190. package/models/components/status.js +65 -0
  191. package/models/components/status.js.map +1 -0
  192. package/models/components/systemsummary.d.ts +34 -0
  193. package/models/components/systemsummary.d.ts.map +1 -0
  194. package/models/components/systemsummary.js +71 -0
  195. package/models/components/systemsummary.js.map +1 -0
  196. package/models/components/user.d.ts +265 -0
  197. package/models/components/user.d.ts.map +1 -0
  198. package/models/components/user.js +284 -0
  199. package/models/components/user.js.map +1 -0
  200. package/models/components/vendorjobtitle.d.ts +41 -0
  201. package/models/components/vendorjobtitle.d.ts.map +1 -0
  202. package/models/components/vendorjobtitle.js +71 -0
  203. package/models/components/vendorjobtitle.js.map +1 -0
  204. package/models/components/vendortype.d.ts +69 -0
  205. package/models/components/vendortype.d.ts.map +1 -0
  206. package/models/components/vendortype.js +135 -0
  207. package/models/components/vendortype.js.map +1 -0
  208. package/models/errors/apierror.d.ts +8 -0
  209. package/models/errors/apierror.d.ts.map +1 -0
  210. package/models/errors/apierror.js +21 -0
  211. package/models/errors/apierror.js.map +1 -0
  212. package/models/errors/apierrorresponse.d.ts +51 -0
  213. package/models/errors/apierrorresponse.d.ts.map +1 -0
  214. package/models/errors/apierrorresponse.js +91 -0
  215. package/models/errors/apierrorresponse.js.map +1 -0
  216. package/models/errors/httpclienterrors.d.ts +44 -0
  217. package/models/errors/httpclienterrors.d.ts.map +1 -0
  218. package/models/errors/httpclienterrors.js +78 -0
  219. package/models/errors/httpclienterrors.js.map +1 -0
  220. package/models/errors/index.d.ts +5 -0
  221. package/models/errors/index.d.ts.map +1 -0
  222. package/models/errors/index.js +24 -0
  223. package/models/errors/index.js.map +1 -0
  224. package/models/errors/sdkvalidationerror.d.ts +20 -0
  225. package/models/errors/sdkvalidationerror.d.ts.map +1 -0
  226. package/models/errors/sdkvalidationerror.js +115 -0
  227. package/models/errors/sdkvalidationerror.js.map +1 -0
  228. package/models/operations/createvendorregistration.d.ts +115 -0
  229. package/models/operations/createvendorregistration.d.ts.map +1 -0
  230. package/models/operations/createvendorregistration.js +143 -0
  231. package/models/operations/createvendorregistration.js.map +1 -0
  232. package/models/operations/getfacility.d.ts +32 -0
  233. package/models/operations/getfacility.d.ts.map +1 -0
  234. package/models/operations/getfacility.js +69 -0
  235. package/models/operations/getfacility.js.map +1 -0
  236. package/models/operations/getuserbyid.d.ts +32 -0
  237. package/models/operations/getuserbyid.d.ts.map +1 -0
  238. package/models/operations/getuserbyid.js +69 -0
  239. package/models/operations/getuserbyid.js.map +1 -0
  240. package/models/operations/index.d.ts +7 -0
  241. package/models/operations/index.d.ts.map +1 -0
  242. package/models/operations/index.js +26 -0
  243. package/models/operations/index.js.map +1 -0
  244. package/models/operations/listorsearchfacilities.d.ts +110 -0
  245. package/models/operations/listorsearchfacilities.d.ts.map +1 -0
  246. package/models/operations/listorsearchfacilities.js +130 -0
  247. package/models/operations/listorsearchfacilities.js.map +1 -0
  248. package/models/operations/listvendorjobtitles.d.ts +86 -0
  249. package/models/operations/listvendorjobtitles.d.ts.map +1 -0
  250. package/models/operations/listvendorjobtitles.js +118 -0
  251. package/models/operations/listvendorjobtitles.js.map +1 -0
  252. package/models/operations/logsuserintothesystem.d.ts +98 -0
  253. package/models/operations/logsuserintothesystem.d.ts.map +1 -0
  254. package/models/operations/logsuserintothesystem.js +164 -0
  255. package/models/operations/logsuserintothesystem.js.map +1 -0
  256. package/package.json +41 -0
  257. package/react-query/_context.d.ts +8 -0
  258. package/react-query/_context.d.ts.map +1 -0
  259. package/react-query/_context.js +21 -0
  260. package/react-query/_context.js.map +1 -0
  261. package/react-query/_types.d.ts +14 -0
  262. package/react-query/_types.d.ts.map +1 -0
  263. package/react-query/_types.js +6 -0
  264. package/react-query/_types.js.map +1 -0
  265. package/react-query/index.d.ts +10 -0
  266. package/react-query/index.d.ts.map +1 -0
  267. package/react-query/index.js +32 -0
  268. package/react-query/index.js.map +1 -0
  269. package/react-query/organizationsGetFacility.d.ts +31 -0
  270. package/react-query/organizationsGetFacility.d.ts.map +1 -0
  271. package/react-query/organizationsGetFacility.js +87 -0
  272. package/react-query/organizationsGetFacility.js.map +1 -0
  273. package/react-query/organizationsListOrSearchFacilities.d.ts +91 -0
  274. package/react-query/organizationsListOrSearchFacilities.d.ts.map +1 -0
  275. package/react-query/organizationsListOrSearchFacilities.js +132 -0
  276. package/react-query/organizationsListOrSearchFacilities.js.map +1 -0
  277. package/react-query/userGetCurrentUser.d.ts +29 -0
  278. package/react-query/userGetCurrentUser.d.ts.map +1 -0
  279. package/react-query/userGetCurrentUser.js +75 -0
  280. package/react-query/userGetCurrentUser.js.map +1 -0
  281. package/react-query/userGetUserById.d.ts +31 -0
  282. package/react-query/userGetUserById.d.ts.map +1 -0
  283. package/react-query/userGetUserById.js +87 -0
  284. package/react-query/userGetUserById.js.map +1 -0
  285. package/react-query/userLogsUserIntoTheSystem.d.ts +53 -0
  286. package/react-query/userLogsUserIntoTheSystem.d.ts.map +1 -0
  287. package/react-query/userLogsUserIntoTheSystem.js +77 -0
  288. package/react-query/userLogsUserIntoTheSystem.js.map +1 -0
  289. package/react-query/vendorsCreateVendorRegistration.d.ts +23 -0
  290. package/react-query/vendorsCreateVendorRegistration.d.ts.map +1 -0
  291. package/react-query/vendorsCreateVendorRegistration.js +51 -0
  292. package/react-query/vendorsCreateVendorRegistration.js.map +1 -0
  293. package/react-query/vendorsListVendorJobTitles.d.ts +53 -0
  294. package/react-query/vendorsListVendorJobTitles.d.ts.map +1 -0
  295. package/react-query/vendorsListVendorJobTitles.js +102 -0
  296. package/react-query/vendorsListVendorJobTitles.js.map +1 -0
  297. package/sdk/index.d.ts +2 -0
  298. package/sdk/index.d.ts.map +1 -0
  299. package/sdk/index.js +21 -0
  300. package/sdk/index.js.map +1 -0
  301. package/sdk/organizations.d.ts +33 -0
  302. package/sdk/organizations.d.ts.map +1 -0
  303. package/sdk/organizations.js +45 -0
  304. package/sdk/organizations.js.map +1 -0
  305. package/sdk/sdk.d.ts +13 -0
  306. package/sdk/sdk.d.ts.map +1 -0
  307. package/sdk/sdk.js +23 -0
  308. package/sdk/sdk.js.map +1 -0
  309. package/sdk/user.d.ts +57 -0
  310. package/sdk/user.d.ts.map +1 -0
  311. package/sdk/user.js +72 -0
  312. package/sdk/user.js.map +1 -0
  313. package/sdk/vendors.d.ts +19 -0
  314. package/sdk/vendors.d.ts.map +1 -0
  315. package/sdk/vendors.js +32 -0
  316. package/sdk/vendors.js.map +1 -0
  317. package/src/core.ts +13 -0
  318. package/src/funcs/organizationsGetFacility.ts +144 -0
  319. package/src/funcs/organizationsListOrSearchFacilities.ts +152 -0
  320. package/src/funcs/userGetCurrentUser.ts +118 -0
  321. package/src/funcs/userGetUserById.ts +141 -0
  322. package/src/funcs/userLogsUserIntoTheSystem.ts +161 -0
  323. package/src/funcs/vendorsCreateVendorRegistration.ts +132 -0
  324. package/src/funcs/vendorsListVendorJobTitles.ts +141 -0
  325. package/src/hooks/hooks.ts +132 -0
  326. package/src/hooks/index.ts +6 -0
  327. package/src/hooks/registration.ts +14 -0
  328. package/src/hooks/types.ts +110 -0
  329. package/src/index.ts +7 -0
  330. package/src/lib/base64.ts +37 -0
  331. package/src/lib/config.ts +76 -0
  332. package/src/lib/dlv.ts +53 -0
  333. package/src/lib/encodings.ts +483 -0
  334. package/src/lib/env.ts +43 -0
  335. package/src/lib/files.ts +40 -0
  336. package/src/lib/http.ts +323 -0
  337. package/src/lib/is-plain-object.ts +43 -0
  338. package/src/lib/logger.ts +9 -0
  339. package/src/lib/matchers.ts +322 -0
  340. package/src/lib/primitives.ts +136 -0
  341. package/src/lib/retries.ts +218 -0
  342. package/src/lib/schemas.ts +91 -0
  343. package/src/lib/sdks.ts +400 -0
  344. package/src/lib/security.ts +260 -0
  345. package/src/lib/url.ts +33 -0
  346. package/src/models/components/contact.ts +268 -0
  347. package/src/models/components/departmentsummary.ts +73 -0
  348. package/src/models/components/desc.ts +48 -0
  349. package/src/models/components/expand.ts +52 -0
  350. package/src/models/components/facility.ts +1334 -0
  351. package/src/models/components/facilitysummary.ts +71 -0
  352. package/src/models/components/imageset.ts +77 -0
  353. package/src/models/components/index.ts +23 -0
  354. package/src/models/components/loginemailandpassword.ts +95 -0
  355. package/src/models/components/loginrequirementsfromemail.ts +88 -0
  356. package/src/models/components/mfarequiredresponse.ts +160 -0
  357. package/src/models/components/pager.ts +126 -0
  358. package/src/models/components/passwordrequiredresponse.ts +105 -0
  359. package/src/models/components/samlloginrequiredresponse.ts +136 -0
  360. package/src/models/components/security.ts +75 -0
  361. package/src/models/components/status.ts +38 -0
  362. package/src/models/components/systemsummary.ts +69 -0
  363. package/src/models/components/user.ts +451 -0
  364. package/src/models/components/vendorjobtitle.ts +76 -0
  365. package/src/models/components/vendortype.ts +170 -0
  366. package/src/models/errors/apierror.ts +27 -0
  367. package/src/models/errors/apierrorresponse.ts +95 -0
  368. package/src/models/errors/httpclienterrors.ts +62 -0
  369. package/src/models/errors/index.ts +8 -0
  370. package/src/models/errors/sdkvalidationerror.ts +97 -0
  371. package/src/models/operations/createvendorregistration.ts +237 -0
  372. package/src/models/operations/getfacility.ts +69 -0
  373. package/src/models/operations/getuserbyid.ts +69 -0
  374. package/src/models/operations/index.ts +10 -0
  375. package/src/models/operations/listorsearchfacilities.ts +219 -0
  376. package/src/models/operations/listvendorjobtitles.ts +179 -0
  377. package/src/models/operations/logsuserintothesystem.ts +270 -0
  378. package/src/react-query/_types.ts +91 -0
  379. package/src/react-query/index.ts +14 -0
  380. package/src/react-query/organizationsGetFacility.ts +154 -0
  381. package/src/react-query/organizationsListOrSearchFacilities.ts +241 -0
  382. package/src/react-query/userGetCurrentUser.ts +124 -0
  383. package/src/react-query/userGetUserById.ts +152 -0
  384. package/src/react-query/userLogsUserIntoTheSystem.ts +119 -0
  385. package/src/react-query/vendorsCreateVendorRegistration.ts +93 -0
  386. package/src/react-query/vendorsListVendorJobTitles.ts +194 -0
  387. package/src/sdk/index.ts +5 -0
  388. package/src/sdk/organizations.ts +59 -0
  389. package/src/sdk/sdk.ts +25 -0
  390. package/src/sdk/user.ts +92 -0
  391. package/src/sdk/vendors.ts +45 -0
  392. package/src/types/blobs.ts +31 -0
  393. package/src/types/constdatetime.ts +15 -0
  394. package/src/types/enums.ts +16 -0
  395. package/src/types/fp.ts +50 -0
  396. package/src/types/index.ts +11 -0
  397. package/src/types/operations.ts +105 -0
  398. package/src/types/rfcdate.ts +54 -0
  399. package/src/types/streams.ts +21 -0
  400. package/tsconfig.json +41 -0
  401. package/types/blobs.d.ts +4 -0
  402. package/types/blobs.d.ts.map +1 -0
  403. package/types/blobs.js +62 -0
  404. package/types/blobs.js.map +1 -0
  405. package/types/constdatetime.d.ts +3 -0
  406. package/types/constdatetime.d.ts.map +1 -0
  407. package/types/constdatetime.js +46 -0
  408. package/types/constdatetime.js.map +1 -0
  409. package/types/enums.d.ts +12 -0
  410. package/types/enums.d.ts.map +1 -0
  411. package/types/enums.js +10 -0
  412. package/types/enums.js.map +1 -0
  413. package/types/fp.d.ts +31 -0
  414. package/types/fp.d.ts.map +1 -0
  415. package/types/fp.js +37 -0
  416. package/types/fp.js.map +1 -0
  417. package/types/index.d.ts +8 -0
  418. package/types/index.d.ts.map +1 -0
  419. package/types/index.js +16 -0
  420. package/types/index.js.map +1 -0
  421. package/types/operations.d.ts +27 -0
  422. package/types/operations.d.ts.map +1 -0
  423. package/types/operations.js +83 -0
  424. package/types/operations.js.map +1 -0
  425. package/types/rfcdate.d.ts +21 -0
  426. package/types/rfcdate.d.ts.map +1 -0
  427. package/types/rfcdate.js +46 -0
  428. package/types/rfcdate.js.map +1 -0
  429. package/types/streams.d.ts +2 -0
  430. package/types/streams.d.ts.map +1 -0
  431. package/types/streams.js +18 -0
  432. package/types/streams.js.map +1 -0
@@ -0,0 +1,260 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as components from "../models/components/index.js";
6
+ import { env } from "./env.js";
7
+ type OAuth2PasswordFlow = {
8
+ username: string;
9
+ password?: string | undefined;
10
+ clientID: string;
11
+ clientSecret?: string | undefined;
12
+ tokenURL: string;
13
+ };
14
+
15
+ export enum SecurityErrorCode {
16
+ Incomplete = "incomplete",
17
+ UnrecognisedSecurityType = "unrecognized_security_type",
18
+ }
19
+
20
+ export class SecurityError extends Error {
21
+ constructor(
22
+ public code: SecurityErrorCode,
23
+ message: string,
24
+ ) {
25
+ super(message);
26
+ this.name = "SecurityError";
27
+ }
28
+
29
+ static incomplete(): SecurityError {
30
+ return new SecurityError(
31
+ SecurityErrorCode.Incomplete,
32
+ "Security requirements not met in order to perform the operation",
33
+ );
34
+ }
35
+ static unrecognizedType(type: string): SecurityError {
36
+ return new SecurityError(
37
+ SecurityErrorCode.UnrecognisedSecurityType,
38
+ `Unrecognised security type: ${type}`,
39
+ );
40
+ }
41
+ }
42
+
43
+ export type SecurityState = {
44
+ basic: { username?: string | undefined; password?: string | undefined };
45
+ headers: Record<string, string>;
46
+ queryParams: Record<string, string>;
47
+ cookies: Record<string, string>;
48
+ oauth2: ({ type: "password" } & OAuth2PasswordFlow) | { type: "none" };
49
+ };
50
+
51
+ type SecurityInputBasic = {
52
+ type: "http:basic";
53
+ value:
54
+ | { username?: string | undefined; password?: string | undefined }
55
+ | null
56
+ | undefined;
57
+ };
58
+
59
+ type SecurityInputBearer = {
60
+ type: "http:bearer";
61
+ value: string | null | undefined;
62
+ fieldName: string;
63
+ };
64
+
65
+ type SecurityInputAPIKey = {
66
+ type: "apiKey:header" | "apiKey:query" | "apiKey:cookie";
67
+ value: string | null | undefined;
68
+ fieldName: string;
69
+ };
70
+
71
+ type SecurityInputOIDC = {
72
+ type: "openIdConnect";
73
+ value: string | null | undefined;
74
+ fieldName: string;
75
+ };
76
+
77
+ type SecurityInputOAuth2 = {
78
+ type: "oauth2";
79
+ value: string | null | undefined;
80
+ fieldName: string;
81
+ };
82
+
83
+ type SecurityInputOAuth2ClientCredentials = {
84
+ type: "oauth2:client_credentials";
85
+ value:
86
+ | { clientID?: string | undefined; clientSecret?: string | undefined }
87
+ | null
88
+ | undefined;
89
+ };
90
+
91
+ type SecurityInputOAuth2PasswordCredentials = {
92
+ type: "oauth2:password";
93
+ value:
94
+ | string
95
+ | null
96
+ | undefined;
97
+ fieldName: string;
98
+ };
99
+
100
+ type SecurityInputCustom = {
101
+ type: "http:custom";
102
+ value: any | null | undefined;
103
+ fieldName: string;
104
+ };
105
+
106
+ export type SecurityInput =
107
+ | SecurityInputBasic
108
+ | SecurityInputBearer
109
+ | SecurityInputAPIKey
110
+ | SecurityInputOAuth2
111
+ | SecurityInputOAuth2ClientCredentials
112
+ | SecurityInputOAuth2PasswordCredentials
113
+ | SecurityInputOIDC
114
+ | SecurityInputCustom;
115
+
116
+ export function resolveSecurity(
117
+ ...options: SecurityInput[][]
118
+ ): SecurityState | null {
119
+ const state: SecurityState = {
120
+ basic: {},
121
+ headers: {},
122
+ queryParams: {},
123
+ cookies: {},
124
+ oauth2: { type: "none" },
125
+ };
126
+
127
+ const option = options.find((opts) => {
128
+ return opts.every((o) => {
129
+ if (o.value == null) {
130
+ return false;
131
+ } else if (o.type === "http:basic") {
132
+ return o.value.username != null || o.value.password != null;
133
+ } else if (o.type === "http:custom") {
134
+ return null;
135
+ } else if (o.type === "oauth2:password") {
136
+ return (
137
+ typeof o.value === "string" && !!o.value
138
+ );
139
+ } else if (o.type === "oauth2:client_credentials") {
140
+ return o.value.clientID != null || o.value.clientSecret != null;
141
+ } else if (typeof o.value === "string") {
142
+ return !!o.value;
143
+ } else {
144
+ throw new Error(
145
+ `Unrecognized security type: ${o.type} (value type: ${typeof o
146
+ .value})`,
147
+ );
148
+ }
149
+ });
150
+ });
151
+ if (option == null) {
152
+ return null;
153
+ }
154
+
155
+ option.forEach((spec) => {
156
+ if (spec.value == null) {
157
+ return;
158
+ }
159
+
160
+ const { type } = spec;
161
+
162
+ switch (type) {
163
+ case "apiKey:header":
164
+ state.headers[spec.fieldName] = spec.value;
165
+ break;
166
+ case "apiKey:query":
167
+ state.queryParams[spec.fieldName] = spec.value;
168
+ break;
169
+ case "apiKey:cookie":
170
+ state.cookies[spec.fieldName] = spec.value;
171
+ break;
172
+ case "http:basic":
173
+ applyBasic(state, spec);
174
+ break;
175
+ case "http:custom":
176
+ break;
177
+ case "http:bearer":
178
+ applyBearer(state, spec);
179
+ break;
180
+ case "oauth2":
181
+ applyBearer(state, spec);
182
+ break;
183
+ case "oauth2:password":
184
+ applyBearer(state, spec);
185
+ break;
186
+ case "oauth2:client_credentials":
187
+ break;
188
+ case "openIdConnect":
189
+ applyBearer(state, spec);
190
+ break;
191
+ default:
192
+ spec satisfies never;
193
+ throw SecurityError.unrecognizedType(type);
194
+ }
195
+ });
196
+
197
+ return state;
198
+ }
199
+
200
+ function applyBasic(
201
+ state: SecurityState,
202
+ spec: SecurityInputBasic,
203
+ ) {
204
+ if (spec.value == null) {
205
+ return;
206
+ }
207
+
208
+ state.basic = spec.value;
209
+ }
210
+
211
+ function applyBearer(
212
+ state: SecurityState,
213
+ spec:
214
+ | SecurityInputBearer
215
+ | SecurityInputOAuth2
216
+ | SecurityInputOIDC
217
+ | SecurityInputOAuth2PasswordCredentials,
218
+ ) {
219
+ if (typeof spec.value !== "string" || !spec.value) {
220
+ return;
221
+ }
222
+
223
+ let value = spec.value;
224
+ if (value.slice(0, 7).toLowerCase() !== "bearer ") {
225
+ value = `Bearer ${value}`;
226
+ }
227
+
228
+ state.headers[spec.fieldName] = value;
229
+ }
230
+
231
+ export function resolveGlobalSecurity(
232
+ security: Partial<components.Security> | null | undefined,
233
+ ): SecurityState | null {
234
+ return resolveSecurity(
235
+ [
236
+ {
237
+ fieldName: "token",
238
+ type: "apiKey:query",
239
+ value: security?.token ?? env().GREEN_SECURITY_TOKEN,
240
+ },
241
+ ],
242
+ [
243
+ {
244
+ fieldName: "Authorization",
245
+ type: "http:bearer",
246
+ value: security?.bearerJwt ?? env().GREEN_SECURITY_BEARER_JWT,
247
+ },
248
+ ],
249
+ );
250
+ }
251
+
252
+ export async function extractSecurity<
253
+ T extends string | Record<string, unknown>,
254
+ >(sec: T | (() => Promise<T>) | undefined): Promise<T | undefined> {
255
+ if (sec == null) {
256
+ return;
257
+ }
258
+
259
+ return typeof sec === "function" ? sec() : sec;
260
+ }
package/src/lib/url.ts ADDED
@@ -0,0 +1,33 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ const hasOwn = Object.prototype.hasOwnProperty;
6
+
7
+ export type Params = Partial<Record<string, string | number>>;
8
+
9
+ export function pathToFunc(
10
+ pathPattern: string,
11
+ options?: { charEncoding?: "percent" | "none" },
12
+ ): (params?: Params) => string {
13
+ const paramRE = /\{([a-zA-Z0-9_]+?)\}/g;
14
+
15
+ return function buildURLPath(params: Record<string, unknown> = {}): string {
16
+ return pathPattern.replace(paramRE, function (_, placeholder) {
17
+ if (!hasOwn.call(params, placeholder)) {
18
+ throw new Error(`Parameter '${placeholder}' is required`);
19
+ }
20
+
21
+ const value = params[placeholder];
22
+ if (typeof value !== "string" && typeof value !== "number") {
23
+ throw new Error(
24
+ `Parameter '${placeholder}' must be a string or number`,
25
+ );
26
+ }
27
+
28
+ return options?.charEncoding === "percent"
29
+ ? encodeURIComponent(`${value}`)
30
+ : `${value}`;
31
+ });
32
+ };
33
+ }
@@ -0,0 +1,268 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { ClosedEnum } from "../../types/enums.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ DepartmentSummary,
12
+ DepartmentSummary$inboundSchema,
13
+ DepartmentSummary$Outbound,
14
+ DepartmentSummary$outboundSchema,
15
+ } from "./departmentsummary.js";
16
+ import {
17
+ FacilitySummary,
18
+ FacilitySummary$inboundSchema,
19
+ FacilitySummary$Outbound,
20
+ FacilitySummary$outboundSchema,
21
+ } from "./facilitysummary.js";
22
+ import {
23
+ SystemSummary,
24
+ SystemSummary$inboundSchema,
25
+ SystemSummary$Outbound,
26
+ SystemSummary$outboundSchema,
27
+ } from "./systemsummary.js";
28
+
29
+ export type ContactFacility = FacilitySummary | number;
30
+
31
+ export type System = SystemSummary | number;
32
+
33
+ export const ContactStatus = {
34
+ Active: "Active",
35
+ Inactive: "Inactive",
36
+ Deleted: "Deleted",
37
+ } as const;
38
+ export type ContactStatus = ClosedEnum<typeof ContactStatus>;
39
+
40
+ export type Department = DepartmentSummary | number;
41
+
42
+ /**
43
+ * This object represents a contact at the system or facility level. Use it to verify vendors, create appointments, or check in visitors.
44
+ */
45
+ export type Contact = {
46
+ facility?: FacilitySummary | number | undefined;
47
+ system?: SystemSummary | number | undefined;
48
+ status: ContactStatus;
49
+ position?: string | null | undefined;
50
+ department?: DepartmentSummary | number | null | undefined;
51
+ };
52
+
53
+ /** @internal */
54
+ export const ContactFacility$inboundSchema: z.ZodType<
55
+ ContactFacility,
56
+ z.ZodTypeDef,
57
+ unknown
58
+ > = z.union([FacilitySummary$inboundSchema, z.number().int()]);
59
+
60
+ /** @internal */
61
+ export type ContactFacility$Outbound = FacilitySummary$Outbound | number;
62
+
63
+ /** @internal */
64
+ export const ContactFacility$outboundSchema: z.ZodType<
65
+ ContactFacility$Outbound,
66
+ z.ZodTypeDef,
67
+ ContactFacility
68
+ > = z.union([FacilitySummary$outboundSchema, z.number().int()]);
69
+
70
+ /**
71
+ * @internal
72
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
73
+ */
74
+ export namespace ContactFacility$ {
75
+ /** @deprecated use `ContactFacility$inboundSchema` instead. */
76
+ export const inboundSchema = ContactFacility$inboundSchema;
77
+ /** @deprecated use `ContactFacility$outboundSchema` instead. */
78
+ export const outboundSchema = ContactFacility$outboundSchema;
79
+ /** @deprecated use `ContactFacility$Outbound` instead. */
80
+ export type Outbound = ContactFacility$Outbound;
81
+ }
82
+
83
+ export function contactFacilityToJSON(
84
+ contactFacility: ContactFacility,
85
+ ): string {
86
+ return JSON.stringify(ContactFacility$outboundSchema.parse(contactFacility));
87
+ }
88
+
89
+ export function contactFacilityFromJSON(
90
+ jsonString: string,
91
+ ): SafeParseResult<ContactFacility, SDKValidationError> {
92
+ return safeParse(
93
+ jsonString,
94
+ (x) => ContactFacility$inboundSchema.parse(JSON.parse(x)),
95
+ `Failed to parse 'ContactFacility' from JSON`,
96
+ );
97
+ }
98
+
99
+ /** @internal */
100
+ export const System$inboundSchema: z.ZodType<System, z.ZodTypeDef, unknown> = z
101
+ .union([SystemSummary$inboundSchema, z.number().int()]);
102
+
103
+ /** @internal */
104
+ export type System$Outbound = SystemSummary$Outbound | number;
105
+
106
+ /** @internal */
107
+ export const System$outboundSchema: z.ZodType<
108
+ System$Outbound,
109
+ z.ZodTypeDef,
110
+ System
111
+ > = z.union([SystemSummary$outboundSchema, z.number().int()]);
112
+
113
+ /**
114
+ * @internal
115
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
116
+ */
117
+ export namespace System$ {
118
+ /** @deprecated use `System$inboundSchema` instead. */
119
+ export const inboundSchema = System$inboundSchema;
120
+ /** @deprecated use `System$outboundSchema` instead. */
121
+ export const outboundSchema = System$outboundSchema;
122
+ /** @deprecated use `System$Outbound` instead. */
123
+ export type Outbound = System$Outbound;
124
+ }
125
+
126
+ export function systemToJSON(system: System): string {
127
+ return JSON.stringify(System$outboundSchema.parse(system));
128
+ }
129
+
130
+ export function systemFromJSON(
131
+ jsonString: string,
132
+ ): SafeParseResult<System, SDKValidationError> {
133
+ return safeParse(
134
+ jsonString,
135
+ (x) => System$inboundSchema.parse(JSON.parse(x)),
136
+ `Failed to parse 'System' from JSON`,
137
+ );
138
+ }
139
+
140
+ /** @internal */
141
+ export const ContactStatus$inboundSchema: z.ZodNativeEnum<
142
+ typeof ContactStatus
143
+ > = z.nativeEnum(ContactStatus);
144
+
145
+ /** @internal */
146
+ export const ContactStatus$outboundSchema: z.ZodNativeEnum<
147
+ typeof ContactStatus
148
+ > = ContactStatus$inboundSchema;
149
+
150
+ /**
151
+ * @internal
152
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
153
+ */
154
+ export namespace ContactStatus$ {
155
+ /** @deprecated use `ContactStatus$inboundSchema` instead. */
156
+ export const inboundSchema = ContactStatus$inboundSchema;
157
+ /** @deprecated use `ContactStatus$outboundSchema` instead. */
158
+ export const outboundSchema = ContactStatus$outboundSchema;
159
+ }
160
+
161
+ /** @internal */
162
+ export const Department$inboundSchema: z.ZodType<
163
+ Department,
164
+ z.ZodTypeDef,
165
+ unknown
166
+ > = z.union([DepartmentSummary$inboundSchema, z.number().int()]);
167
+
168
+ /** @internal */
169
+ export type Department$Outbound = DepartmentSummary$Outbound | number;
170
+
171
+ /** @internal */
172
+ export const Department$outboundSchema: z.ZodType<
173
+ Department$Outbound,
174
+ z.ZodTypeDef,
175
+ Department
176
+ > = z.union([DepartmentSummary$outboundSchema, z.number().int()]);
177
+
178
+ /**
179
+ * @internal
180
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
181
+ */
182
+ export namespace Department$ {
183
+ /** @deprecated use `Department$inboundSchema` instead. */
184
+ export const inboundSchema = Department$inboundSchema;
185
+ /** @deprecated use `Department$outboundSchema` instead. */
186
+ export const outboundSchema = Department$outboundSchema;
187
+ /** @deprecated use `Department$Outbound` instead. */
188
+ export type Outbound = Department$Outbound;
189
+ }
190
+
191
+ export function departmentToJSON(department: Department): string {
192
+ return JSON.stringify(Department$outboundSchema.parse(department));
193
+ }
194
+
195
+ export function departmentFromJSON(
196
+ jsonString: string,
197
+ ): SafeParseResult<Department, SDKValidationError> {
198
+ return safeParse(
199
+ jsonString,
200
+ (x) => Department$inboundSchema.parse(JSON.parse(x)),
201
+ `Failed to parse 'Department' from JSON`,
202
+ );
203
+ }
204
+
205
+ /** @internal */
206
+ export const Contact$inboundSchema: z.ZodType<Contact, z.ZodTypeDef, unknown> =
207
+ z.object({
208
+ facility: z.union([FacilitySummary$inboundSchema, z.number().int()])
209
+ .optional(),
210
+ system: z.union([SystemSummary$inboundSchema, z.number().int()]).optional(),
211
+ status: ContactStatus$inboundSchema,
212
+ position: z.nullable(z.string()).optional(),
213
+ department: z.nullable(
214
+ z.union([DepartmentSummary$inboundSchema, z.number().int()]),
215
+ ).optional(),
216
+ });
217
+
218
+ /** @internal */
219
+ export type Contact$Outbound = {
220
+ facility?: FacilitySummary$Outbound | number | undefined;
221
+ system?: SystemSummary$Outbound | number | undefined;
222
+ status: string;
223
+ position?: string | null | undefined;
224
+ department?: DepartmentSummary$Outbound | number | null | undefined;
225
+ };
226
+
227
+ /** @internal */
228
+ export const Contact$outboundSchema: z.ZodType<
229
+ Contact$Outbound,
230
+ z.ZodTypeDef,
231
+ Contact
232
+ > = z.object({
233
+ facility: z.union([FacilitySummary$outboundSchema, z.number().int()])
234
+ .optional(),
235
+ system: z.union([SystemSummary$outboundSchema, z.number().int()]).optional(),
236
+ status: ContactStatus$outboundSchema,
237
+ position: z.nullable(z.string()).optional(),
238
+ department: z.nullable(
239
+ z.union([DepartmentSummary$outboundSchema, z.number().int()]),
240
+ ).optional(),
241
+ });
242
+
243
+ /**
244
+ * @internal
245
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
246
+ */
247
+ export namespace Contact$ {
248
+ /** @deprecated use `Contact$inboundSchema` instead. */
249
+ export const inboundSchema = Contact$inboundSchema;
250
+ /** @deprecated use `Contact$outboundSchema` instead. */
251
+ export const outboundSchema = Contact$outboundSchema;
252
+ /** @deprecated use `Contact$Outbound` instead. */
253
+ export type Outbound = Contact$Outbound;
254
+ }
255
+
256
+ export function contactToJSON(contact: Contact): string {
257
+ return JSON.stringify(Contact$outboundSchema.parse(contact));
258
+ }
259
+
260
+ export function contactFromJSON(
261
+ jsonString: string,
262
+ ): SafeParseResult<Contact, SDKValidationError> {
263
+ return safeParse(
264
+ jsonString,
265
+ (x) => Contact$inboundSchema.parse(JSON.parse(x)),
266
+ `Failed to parse 'Contact' from JSON`,
267
+ );
268
+ }
@@ -0,0 +1,73 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ /**
11
+ * A simplified representation of a Department, typically used in list views.
12
+ */
13
+ export type DepartmentSummary = {
14
+ id: number;
15
+ name: string;
16
+ };
17
+
18
+ /** @internal */
19
+ export const DepartmentSummary$inboundSchema: z.ZodType<
20
+ DepartmentSummary,
21
+ z.ZodTypeDef,
22
+ unknown
23
+ > = z.object({
24
+ id: z.number().int(),
25
+ name: z.string(),
26
+ });
27
+
28
+ /** @internal */
29
+ export type DepartmentSummary$Outbound = {
30
+ id: number;
31
+ name: string;
32
+ };
33
+
34
+ /** @internal */
35
+ export const DepartmentSummary$outboundSchema: z.ZodType<
36
+ DepartmentSummary$Outbound,
37
+ z.ZodTypeDef,
38
+ DepartmentSummary
39
+ > = z.object({
40
+ id: z.number().int(),
41
+ name: z.string(),
42
+ });
43
+
44
+ /**
45
+ * @internal
46
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
47
+ */
48
+ export namespace DepartmentSummary$ {
49
+ /** @deprecated use `DepartmentSummary$inboundSchema` instead. */
50
+ export const inboundSchema = DepartmentSummary$inboundSchema;
51
+ /** @deprecated use `DepartmentSummary$outboundSchema` instead. */
52
+ export const outboundSchema = DepartmentSummary$outboundSchema;
53
+ /** @deprecated use `DepartmentSummary$Outbound` instead. */
54
+ export type Outbound = DepartmentSummary$Outbound;
55
+ }
56
+
57
+ export function departmentSummaryToJSON(
58
+ departmentSummary: DepartmentSummary,
59
+ ): string {
60
+ return JSON.stringify(
61
+ DepartmentSummary$outboundSchema.parse(departmentSummary),
62
+ );
63
+ }
64
+
65
+ export function departmentSummaryFromJSON(
66
+ jsonString: string,
67
+ ): SafeParseResult<DepartmentSummary, SDKValidationError> {
68
+ return safeParse(
69
+ jsonString,
70
+ (x) => DepartmentSummary$inboundSchema.parse(JSON.parse(x)),
71
+ `Failed to parse 'DepartmentSummary' from JSON`,
72
+ );
73
+ }
@@ -0,0 +1,48 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ export type Desc = boolean | number;
11
+
12
+ /** @internal */
13
+ export const Desc$inboundSchema: z.ZodType<Desc, z.ZodTypeDef, unknown> = z
14
+ .union([z.boolean(), z.number().int()]);
15
+
16
+ /** @internal */
17
+ export type Desc$Outbound = boolean | number;
18
+
19
+ /** @internal */
20
+ export const Desc$outboundSchema: z.ZodType<Desc$Outbound, z.ZodTypeDef, Desc> =
21
+ z.union([z.boolean(), z.number().int()]);
22
+
23
+ /**
24
+ * @internal
25
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
26
+ */
27
+ export namespace Desc$ {
28
+ /** @deprecated use `Desc$inboundSchema` instead. */
29
+ export const inboundSchema = Desc$inboundSchema;
30
+ /** @deprecated use `Desc$outboundSchema` instead. */
31
+ export const outboundSchema = Desc$outboundSchema;
32
+ /** @deprecated use `Desc$Outbound` instead. */
33
+ export type Outbound = Desc$Outbound;
34
+ }
35
+
36
+ export function descToJSON(desc: Desc): string {
37
+ return JSON.stringify(Desc$outboundSchema.parse(desc));
38
+ }
39
+
40
+ export function descFromJSON(
41
+ jsonString: string,
42
+ ): SafeParseResult<Desc, SDKValidationError> {
43
+ return safeParse(
44
+ jsonString,
45
+ (x) => Desc$inboundSchema.parse(JSON.parse(x)),
46
+ `Failed to parse 'Desc' from JSON`,
47
+ );
48
+ }