@crevio/sdk 0.1.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 (640) hide show
  1. package/.devcontainer/README.md +30 -0
  2. package/.devcontainer/devcontainer.json +45 -0
  3. package/FUNCTIONS.md +87 -0
  4. package/README.md +464 -0
  5. package/RUNTIMES.md +48 -0
  6. package/dist/commonjs/core.d.ts +10 -0
  7. package/dist/commonjs/core.d.ts.map +1 -0
  8. package/dist/commonjs/core.js +17 -0
  9. package/dist/commonjs/core.js.map +1 -0
  10. package/dist/commonjs/funcs/accountsGet.d.ts +19 -0
  11. package/dist/commonjs/funcs/accountsGet.d.ts.map +1 -0
  12. package/dist/commonjs/funcs/accountsGet.js +124 -0
  13. package/dist/commonjs/funcs/accountsGet.js.map +1 -0
  14. package/dist/commonjs/funcs/checkoutsCreate.d.ts +18 -0
  15. package/dist/commonjs/funcs/checkoutsCreate.d.ts.map +1 -0
  16. package/dist/commonjs/funcs/checkoutsCreate.js +118 -0
  17. package/dist/commonjs/funcs/checkoutsCreate.js.map +1 -0
  18. package/dist/commonjs/funcs/productsGet.d.ts +19 -0
  19. package/dist/commonjs/funcs/productsGet.d.ts.map +1 -0
  20. package/dist/commonjs/funcs/productsGet.js +124 -0
  21. package/dist/commonjs/funcs/productsGet.js.map +1 -0
  22. package/dist/commonjs/funcs/productsList.d.ts +18 -0
  23. package/dist/commonjs/funcs/productsList.d.ts.map +1 -0
  24. package/dist/commonjs/funcs/productsList.js +109 -0
  25. package/dist/commonjs/funcs/productsList.js.map +1 -0
  26. package/dist/commonjs/funcs/userDelete.d.ts +18 -0
  27. package/dist/commonjs/funcs/userDelete.d.ts.map +1 -0
  28. package/dist/commonjs/funcs/userDelete.js +108 -0
  29. package/dist/commonjs/funcs/userDelete.js.map +1 -0
  30. package/dist/commonjs/funcs/userGet.d.ts +18 -0
  31. package/dist/commonjs/funcs/userGet.d.ts.map +1 -0
  32. package/dist/commonjs/funcs/userGet.js +108 -0
  33. package/dist/commonjs/funcs/userGet.js.map +1 -0
  34. package/dist/commonjs/hooks/hooks.d.ts +25 -0
  35. package/dist/commonjs/hooks/hooks.d.ts.map +1 -0
  36. package/dist/commonjs/hooks/hooks.js +86 -0
  37. package/dist/commonjs/hooks/hooks.js.map +1 -0
  38. package/dist/commonjs/hooks/index.d.ts +3 -0
  39. package/dist/commonjs/hooks/index.d.ts.map +1 -0
  40. package/dist/commonjs/hooks/index.js +22 -0
  41. package/dist/commonjs/hooks/index.js.map +1 -0
  42. package/dist/commonjs/hooks/registration.d.ts +3 -0
  43. package/dist/commonjs/hooks/registration.d.ts.map +1 -0
  44. package/dist/commonjs/hooks/registration.js +15 -0
  45. package/dist/commonjs/hooks/registration.js.map +1 -0
  46. package/dist/commonjs/hooks/types.d.ts +76 -0
  47. package/dist/commonjs/hooks/types.d.ts.map +1 -0
  48. package/dist/commonjs/hooks/types.js +6 -0
  49. package/dist/commonjs/hooks/types.js.map +1 -0
  50. package/dist/commonjs/index.d.ts +6 -0
  51. package/dist/commonjs/index.d.ts.map +1 -0
  52. package/dist/commonjs/index.js +48 -0
  53. package/dist/commonjs/index.js.map +1 -0
  54. package/dist/commonjs/lib/base64.d.ts +10 -0
  55. package/dist/commonjs/lib/base64.d.ts.map +1 -0
  56. package/dist/commonjs/lib/base64.js +71 -0
  57. package/dist/commonjs/lib/base64.js.map +1 -0
  58. package/dist/commonjs/lib/config.d.ts +38 -0
  59. package/dist/commonjs/lib/config.d.ts.map +1 -0
  60. package/dist/commonjs/lib/config.js +42 -0
  61. package/dist/commonjs/lib/config.js.map +1 -0
  62. package/dist/commonjs/lib/dlv.d.ts +14 -0
  63. package/dist/commonjs/lib/dlv.d.ts.map +1 -0
  64. package/dist/commonjs/lib/dlv.js +49 -0
  65. package/dist/commonjs/lib/dlv.js.map +1 -0
  66. package/dist/commonjs/lib/encodings.d.ts +52 -0
  67. package/dist/commonjs/lib/encodings.d.ts.map +1 -0
  68. package/dist/commonjs/lib/encodings.js +368 -0
  69. package/dist/commonjs/lib/encodings.js.map +1 -0
  70. package/dist/commonjs/lib/env.d.ts +15 -0
  71. package/dist/commonjs/lib/env.d.ts.map +1 -0
  72. package/dist/commonjs/lib/env.js +65 -0
  73. package/dist/commonjs/lib/env.js.map +1 -0
  74. package/dist/commonjs/lib/files.d.ts +13 -0
  75. package/dist/commonjs/lib/files.d.ts.map +1 -0
  76. package/dist/commonjs/lib/files.js +77 -0
  77. package/dist/commonjs/lib/files.js.map +1 -0
  78. package/dist/commonjs/lib/http.d.ts +67 -0
  79. package/dist/commonjs/lib/http.d.ts.map +1 -0
  80. package/dist/commonjs/lib/http.js +217 -0
  81. package/dist/commonjs/lib/http.js.map +1 -0
  82. package/dist/commonjs/lib/is-plain-object.d.ts +2 -0
  83. package/dist/commonjs/lib/is-plain-object.d.ts.map +1 -0
  84. package/dist/commonjs/lib/is-plain-object.js +41 -0
  85. package/dist/commonjs/lib/is-plain-object.js.map +1 -0
  86. package/dist/commonjs/lib/logger.d.ts +6 -0
  87. package/dist/commonjs/lib/logger.d.ts.map +1 -0
  88. package/dist/commonjs/lib/logger.js +6 -0
  89. package/dist/commonjs/lib/logger.js.map +1 -0
  90. package/dist/commonjs/lib/matchers.d.ts +59 -0
  91. package/dist/commonjs/lib/matchers.d.ts.map +1 -0
  92. package/dist/commonjs/lib/matchers.js +222 -0
  93. package/dist/commonjs/lib/matchers.js.map +1 -0
  94. package/dist/commonjs/lib/primitives.d.ts +26 -0
  95. package/dist/commonjs/lib/primitives.d.ts.map +1 -0
  96. package/dist/commonjs/lib/primitives.js +111 -0
  97. package/dist/commonjs/lib/primitives.js.map +1 -0
  98. package/dist/commonjs/lib/retries.d.ts +38 -0
  99. package/dist/commonjs/lib/retries.d.ts.map +1 -0
  100. package/dist/commonjs/lib/retries.js +153 -0
  101. package/dist/commonjs/lib/retries.js.map +1 -0
  102. package/dist/commonjs/lib/schemas.d.ts +19 -0
  103. package/dist/commonjs/lib/schemas.d.ts.map +1 -0
  104. package/dist/commonjs/lib/schemas.js +62 -0
  105. package/dist/commonjs/lib/schemas.js.map +1 -0
  106. package/dist/commonjs/lib/sdks.d.ts +63 -0
  107. package/dist/commonjs/lib/sdks.d.ts.map +1 -0
  108. package/dist/commonjs/lib/sdks.js +273 -0
  109. package/dist/commonjs/lib/sdks.js.map +1 -0
  110. package/dist/commonjs/lib/security.d.ts +83 -0
  111. package/dist/commonjs/lib/security.d.ts.map +1 -0
  112. package/dist/commonjs/lib/security.js +144 -0
  113. package/dist/commonjs/lib/security.js.map +1 -0
  114. package/dist/commonjs/lib/url.d.ts +5 -0
  115. package/dist/commonjs/lib/url.d.ts.map +1 -0
  116. package/dist/commonjs/lib/url.js +25 -0
  117. package/dist/commonjs/lib/url.js.map +1 -0
  118. package/dist/commonjs/models/account.d.ts +44 -0
  119. package/dist/commonjs/models/account.d.ts.map +1 -0
  120. package/dist/commonjs/models/account.js +99 -0
  121. package/dist/commonjs/models/account.js.map +1 -0
  122. package/dist/commonjs/models/accountslim.d.ts +33 -0
  123. package/dist/commonjs/models/accountslim.d.ts.map +1 -0
  124. package/dist/commonjs/models/accountslim.js +73 -0
  125. package/dist/commonjs/models/accountslim.js.map +1 -0
  126. package/dist/commonjs/models/checkoutrequest.d.ts +94 -0
  127. package/dist/commonjs/models/checkoutrequest.d.ts.map +1 -0
  128. package/dist/commonjs/models/checkoutrequest.js +160 -0
  129. package/dist/commonjs/models/checkoutrequest.js.map +1 -0
  130. package/dist/commonjs/models/checkoutresponse.d.ts +31 -0
  131. package/dist/commonjs/models/checkoutresponse.d.ts.map +1 -0
  132. package/dist/commonjs/models/checkoutresponse.js +82 -0
  133. package/dist/commonjs/models/checkoutresponse.js.map +1 -0
  134. package/dist/commonjs/models/errors/creviodefaulterror.d.ts +10 -0
  135. package/dist/commonjs/models/errors/creviodefaulterror.d.ts.map +1 -0
  136. package/dist/commonjs/models/errors/creviodefaulterror.js +34 -0
  137. package/dist/commonjs/models/errors/creviodefaulterror.js.map +1 -0
  138. package/dist/commonjs/models/errors/crevioerror.d.ts +19 -0
  139. package/dist/commonjs/models/errors/crevioerror.d.ts.map +1 -0
  140. package/dist/commonjs/models/errors/crevioerror.js +20 -0
  141. package/dist/commonjs/models/errors/crevioerror.js.map +1 -0
  142. package/dist/commonjs/models/errors/error.d.ts +45 -0
  143. package/dist/commonjs/models/errors/error.d.ts.map +1 -0
  144. package/dist/commonjs/models/errors/error.js +94 -0
  145. package/dist/commonjs/models/errors/error.js.map +1 -0
  146. package/dist/commonjs/models/errors/httpclienterrors.d.ts +44 -0
  147. package/dist/commonjs/models/errors/httpclienterrors.d.ts.map +1 -0
  148. package/dist/commonjs/models/errors/httpclienterrors.js +78 -0
  149. package/dist/commonjs/models/errors/httpclienterrors.js.map +1 -0
  150. package/dist/commonjs/models/errors/index.d.ts +6 -0
  151. package/dist/commonjs/models/errors/index.d.ts.map +1 -0
  152. package/dist/commonjs/models/errors/index.js +25 -0
  153. package/dist/commonjs/models/errors/index.js.map +1 -0
  154. package/dist/commonjs/models/errors/responsevalidationerror.d.ts +26 -0
  155. package/dist/commonjs/models/errors/responsevalidationerror.d.ts.map +1 -0
  156. package/dist/commonjs/models/errors/responsevalidationerror.js +66 -0
  157. package/dist/commonjs/models/errors/responsevalidationerror.js.map +1 -0
  158. package/dist/commonjs/models/errors/sdkvalidationerror.d.ts +21 -0
  159. package/dist/commonjs/models/errors/sdkvalidationerror.d.ts.map +1 -0
  160. package/dist/commonjs/models/errors/sdkvalidationerror.js +129 -0
  161. package/dist/commonjs/models/errors/sdkvalidationerror.js.map +1 -0
  162. package/dist/commonjs/models/fileattachment.d.ts +37 -0
  163. package/dist/commonjs/models/fileattachment.d.ts.map +1 -0
  164. package/dist/commonjs/models/fileattachment.js +88 -0
  165. package/dist/commonjs/models/fileattachment.js.map +1 -0
  166. package/dist/commonjs/models/imageattachment.d.ts +37 -0
  167. package/dist/commonjs/models/imageattachment.d.ts.map +1 -0
  168. package/dist/commonjs/models/imageattachment.js +88 -0
  169. package/dist/commonjs/models/imageattachment.js.map +1 -0
  170. package/dist/commonjs/models/index.d.ts +15 -0
  171. package/dist/commonjs/models/index.d.ts.map +1 -0
  172. package/dist/commonjs/models/index.js +34 -0
  173. package/dist/commonjs/models/index.js.map +1 -0
  174. package/dist/commonjs/models/linkinbiopage.d.ts +33 -0
  175. package/dist/commonjs/models/linkinbiopage.d.ts.map +1 -0
  176. package/dist/commonjs/models/linkinbiopage.js +73 -0
  177. package/dist/commonjs/models/linkinbiopage.js.map +1 -0
  178. package/dist/commonjs/models/operations/delete.d.ts +28 -0
  179. package/dist/commonjs/models/operations/delete.d.ts.map +1 -0
  180. package/dist/commonjs/models/operations/delete.js +65 -0
  181. package/dist/commonjs/models/operations/delete.js.map +1 -0
  182. package/dist/commonjs/models/operations/getaccount.d.ts +32 -0
  183. package/dist/commonjs/models/operations/getaccount.d.ts.map +1 -0
  184. package/dist/commonjs/models/operations/getaccount.js +78 -0
  185. package/dist/commonjs/models/operations/getaccount.js.map +1 -0
  186. package/dist/commonjs/models/operations/getproduct.d.ts +32 -0
  187. package/dist/commonjs/models/operations/getproduct.d.ts.map +1 -0
  188. package/dist/commonjs/models/operations/getproduct.js +78 -0
  189. package/dist/commonjs/models/operations/getproduct.js.map +1 -0
  190. package/dist/commonjs/models/operations/index.d.ts +4 -0
  191. package/dist/commonjs/models/operations/index.d.ts.map +1 -0
  192. package/dist/commonjs/models/operations/index.js +23 -0
  193. package/dist/commonjs/models/operations/index.js.map +1 -0
  194. package/dist/commonjs/models/pricevariant.d.ts +46 -0
  195. package/dist/commonjs/models/pricevariant.d.ts.map +1 -0
  196. package/dist/commonjs/models/pricevariant.js +92 -0
  197. package/dist/commonjs/models/pricevariant.js.map +1 -0
  198. package/dist/commonjs/models/product.d.ts +94 -0
  199. package/dist/commonjs/models/product.d.ts.map +1 -0
  200. package/dist/commonjs/models/product.js +149 -0
  201. package/dist/commonjs/models/product.js.map +1 -0
  202. package/dist/commonjs/models/review.d.ts +35 -0
  203. package/dist/commonjs/models/review.d.ts.map +1 -0
  204. package/dist/commonjs/models/review.js +85 -0
  205. package/dist/commonjs/models/review.js.map +1 -0
  206. package/dist/commonjs/models/security.d.ts +29 -0
  207. package/dist/commonjs/models/security.d.ts.map +1 -0
  208. package/dist/commonjs/models/security.js +78 -0
  209. package/dist/commonjs/models/security.js.map +1 -0
  210. package/dist/commonjs/models/seo.d.ts +33 -0
  211. package/dist/commonjs/models/seo.d.ts.map +1 -0
  212. package/dist/commonjs/models/seo.js +75 -0
  213. package/dist/commonjs/models/seo.js.map +1 -0
  214. package/dist/commonjs/models/sociallink.d.ts +35 -0
  215. package/dist/commonjs/models/sociallink.d.ts.map +1 -0
  216. package/dist/commonjs/models/sociallink.js +75 -0
  217. package/dist/commonjs/models/sociallink.js.map +1 -0
  218. package/dist/commonjs/models/user.d.ts +65 -0
  219. package/dist/commonjs/models/user.d.ts.map +1 -0
  220. package/dist/commonjs/models/user.js +138 -0
  221. package/dist/commonjs/models/user.js.map +1 -0
  222. package/dist/commonjs/package.json +3 -0
  223. package/dist/commonjs/sdk/accounts.d.ts +13 -0
  224. package/dist/commonjs/sdk/accounts.d.ts.map +1 -0
  225. package/dist/commonjs/sdk/accounts.js +22 -0
  226. package/dist/commonjs/sdk/accounts.js.map +1 -0
  227. package/dist/commonjs/sdk/checkouts.d.ts +12 -0
  228. package/dist/commonjs/sdk/checkouts.d.ts.map +1 -0
  229. package/dist/commonjs/sdk/checkouts.js +22 -0
  230. package/dist/commonjs/sdk/checkouts.js.map +1 -0
  231. package/dist/commonjs/sdk/index.d.ts +2 -0
  232. package/dist/commonjs/sdk/index.d.ts.map +1 -0
  233. package/dist/commonjs/sdk/index.js +21 -0
  234. package/dist/commonjs/sdk/index.js.map +1 -0
  235. package/dist/commonjs/sdk/products.d.ts +20 -0
  236. package/dist/commonjs/sdk/products.d.ts.map +1 -0
  237. package/dist/commonjs/sdk/products.js +32 -0
  238. package/dist/commonjs/sdk/products.js.map +1 -0
  239. package/dist/commonjs/sdk/sdk.d.ts +16 -0
  240. package/dist/commonjs/sdk/sdk.d.ts.map +1 -0
  241. package/dist/commonjs/sdk/sdk.js +27 -0
  242. package/dist/commonjs/sdk/sdk.js.map +1 -0
  243. package/dist/commonjs/sdk/user.d.ts +20 -0
  244. package/dist/commonjs/sdk/user.d.ts.map +1 -0
  245. package/dist/commonjs/sdk/user.js +32 -0
  246. package/dist/commonjs/sdk/user.js.map +1 -0
  247. package/dist/commonjs/types/async.d.ts +23 -0
  248. package/dist/commonjs/types/async.d.ts.map +1 -0
  249. package/dist/commonjs/types/async.js +44 -0
  250. package/dist/commonjs/types/async.js.map +1 -0
  251. package/dist/commonjs/types/blobs.d.ts +4 -0
  252. package/dist/commonjs/types/blobs.d.ts.map +1 -0
  253. package/dist/commonjs/types/blobs.js +62 -0
  254. package/dist/commonjs/types/blobs.js.map +1 -0
  255. package/dist/commonjs/types/constdatetime.d.ts +3 -0
  256. package/dist/commonjs/types/constdatetime.d.ts.map +1 -0
  257. package/dist/commonjs/types/constdatetime.js +46 -0
  258. package/dist/commonjs/types/constdatetime.js.map +1 -0
  259. package/dist/commonjs/types/enums.d.ts +12 -0
  260. package/dist/commonjs/types/enums.d.ts.map +1 -0
  261. package/dist/commonjs/types/enums.js +10 -0
  262. package/dist/commonjs/types/enums.js.map +1 -0
  263. package/dist/commonjs/types/fp.d.ts +31 -0
  264. package/dist/commonjs/types/fp.d.ts.map +1 -0
  265. package/dist/commonjs/types/fp.js +37 -0
  266. package/dist/commonjs/types/fp.js.map +1 -0
  267. package/dist/commonjs/types/index.d.ts +8 -0
  268. package/dist/commonjs/types/index.d.ts.map +1 -0
  269. package/dist/commonjs/types/index.js +16 -0
  270. package/dist/commonjs/types/index.js.map +1 -0
  271. package/dist/commonjs/types/operations.d.ts +27 -0
  272. package/dist/commonjs/types/operations.d.ts.map +1 -0
  273. package/dist/commonjs/types/operations.js +83 -0
  274. package/dist/commonjs/types/operations.js.map +1 -0
  275. package/dist/commonjs/types/rfcdate.d.ts +21 -0
  276. package/dist/commonjs/types/rfcdate.d.ts.map +1 -0
  277. package/dist/commonjs/types/rfcdate.js +46 -0
  278. package/dist/commonjs/types/rfcdate.js.map +1 -0
  279. package/dist/commonjs/types/streams.d.ts +2 -0
  280. package/dist/commonjs/types/streams.d.ts.map +1 -0
  281. package/dist/commonjs/types/streams.js +18 -0
  282. package/dist/commonjs/types/streams.js.map +1 -0
  283. package/dist/esm/core.d.ts +10 -0
  284. package/dist/esm/core.d.ts.map +1 -0
  285. package/dist/esm/core.js +13 -0
  286. package/dist/esm/core.js.map +1 -0
  287. package/dist/esm/funcs/accountsGet.d.ts +19 -0
  288. package/dist/esm/funcs/accountsGet.d.ts.map +1 -0
  289. package/dist/esm/funcs/accountsGet.js +88 -0
  290. package/dist/esm/funcs/accountsGet.js.map +1 -0
  291. package/dist/esm/funcs/checkoutsCreate.d.ts +18 -0
  292. package/dist/esm/funcs/checkoutsCreate.d.ts.map +1 -0
  293. package/dist/esm/funcs/checkoutsCreate.js +82 -0
  294. package/dist/esm/funcs/checkoutsCreate.js.map +1 -0
  295. package/dist/esm/funcs/productsGet.d.ts +19 -0
  296. package/dist/esm/funcs/productsGet.d.ts.map +1 -0
  297. package/dist/esm/funcs/productsGet.js +88 -0
  298. package/dist/esm/funcs/productsGet.js.map +1 -0
  299. package/dist/esm/funcs/productsList.d.ts +18 -0
  300. package/dist/esm/funcs/productsList.d.ts.map +1 -0
  301. package/dist/esm/funcs/productsList.js +73 -0
  302. package/dist/esm/funcs/productsList.js.map +1 -0
  303. package/dist/esm/funcs/userDelete.d.ts +18 -0
  304. package/dist/esm/funcs/userDelete.d.ts.map +1 -0
  305. package/dist/esm/funcs/userDelete.js +72 -0
  306. package/dist/esm/funcs/userDelete.js.map +1 -0
  307. package/dist/esm/funcs/userGet.d.ts +18 -0
  308. package/dist/esm/funcs/userGet.d.ts.map +1 -0
  309. package/dist/esm/funcs/userGet.js +72 -0
  310. package/dist/esm/funcs/userGet.js.map +1 -0
  311. package/dist/esm/hooks/hooks.d.ts +25 -0
  312. package/dist/esm/hooks/hooks.d.ts.map +1 -0
  313. package/dist/esm/hooks/hooks.js +82 -0
  314. package/dist/esm/hooks/hooks.js.map +1 -0
  315. package/dist/esm/hooks/index.d.ts +3 -0
  316. package/dist/esm/hooks/index.d.ts.map +1 -0
  317. package/dist/esm/hooks/index.js +6 -0
  318. package/dist/esm/hooks/index.js.map +1 -0
  319. package/dist/esm/hooks/registration.d.ts +3 -0
  320. package/dist/esm/hooks/registration.d.ts.map +1 -0
  321. package/dist/esm/hooks/registration.js +12 -0
  322. package/dist/esm/hooks/registration.js.map +1 -0
  323. package/dist/esm/hooks/types.d.ts +76 -0
  324. package/dist/esm/hooks/types.d.ts.map +1 -0
  325. package/dist/esm/hooks/types.js +5 -0
  326. package/dist/esm/hooks/types.js.map +1 -0
  327. package/dist/esm/index.d.ts +6 -0
  328. package/dist/esm/index.d.ts.map +1 -0
  329. package/dist/esm/index.js +8 -0
  330. package/dist/esm/index.js.map +1 -0
  331. package/dist/esm/lib/base64.d.ts +10 -0
  332. package/dist/esm/lib/base64.d.ts.map +1 -0
  333. package/dist/esm/lib/base64.js +29 -0
  334. package/dist/esm/lib/base64.js.map +1 -0
  335. package/dist/esm/lib/config.d.ts +38 -0
  336. package/dist/esm/lib/config.d.ts.map +1 -0
  337. package/dist/esm/lib/config.js +38 -0
  338. package/dist/esm/lib/config.js.map +1 -0
  339. package/dist/esm/lib/dlv.d.ts +14 -0
  340. package/dist/esm/lib/dlv.d.ts.map +1 -0
  341. package/dist/esm/lib/dlv.js +46 -0
  342. package/dist/esm/lib/dlv.js.map +1 -0
  343. package/dist/esm/lib/encodings.d.ts +52 -0
  344. package/dist/esm/lib/encodings.d.ts.map +1 -0
  345. package/dist/esm/lib/encodings.js +354 -0
  346. package/dist/esm/lib/encodings.js.map +1 -0
  347. package/dist/esm/lib/env.d.ts +15 -0
  348. package/dist/esm/lib/env.d.ts.map +1 -0
  349. package/dist/esm/lib/env.js +27 -0
  350. package/dist/esm/lib/env.js.map +1 -0
  351. package/dist/esm/lib/files.d.ts +13 -0
  352. package/dist/esm/lib/files.d.ts.map +1 -0
  353. package/dist/esm/lib/files.js +73 -0
  354. package/dist/esm/lib/files.js.map +1 -0
  355. package/dist/esm/lib/http.d.ts +67 -0
  356. package/dist/esm/lib/http.d.ts.map +1 -0
  357. package/dist/esm/lib/http.js +207 -0
  358. package/dist/esm/lib/http.js.map +1 -0
  359. package/dist/esm/lib/is-plain-object.d.ts +2 -0
  360. package/dist/esm/lib/is-plain-object.d.ts.map +1 -0
  361. package/dist/esm/lib/is-plain-object.js +38 -0
  362. package/dist/esm/lib/is-plain-object.js.map +1 -0
  363. package/dist/esm/lib/logger.d.ts +6 -0
  364. package/dist/esm/lib/logger.d.ts.map +1 -0
  365. package/dist/esm/lib/logger.js +5 -0
  366. package/dist/esm/lib/logger.js.map +1 -0
  367. package/dist/esm/lib/matchers.d.ts +59 -0
  368. package/dist/esm/lib/matchers.d.ts.map +1 -0
  369. package/dist/esm/lib/matchers.js +203 -0
  370. package/dist/esm/lib/matchers.js.map +1 -0
  371. package/dist/esm/lib/primitives.d.ts +26 -0
  372. package/dist/esm/lib/primitives.d.ts.map +1 -0
  373. package/dist/esm/lib/primitives.js +103 -0
  374. package/dist/esm/lib/primitives.js.map +1 -0
  375. package/dist/esm/lib/retries.d.ts +38 -0
  376. package/dist/esm/lib/retries.d.ts.map +1 -0
  377. package/dist/esm/lib/retries.js +147 -0
  378. package/dist/esm/lib/retries.js.map +1 -0
  379. package/dist/esm/lib/schemas.d.ts +19 -0
  380. package/dist/esm/lib/schemas.d.ts.map +1 -0
  381. package/dist/esm/lib/schemas.js +57 -0
  382. package/dist/esm/lib/schemas.js.map +1 -0
  383. package/dist/esm/lib/sdks.d.ts +63 -0
  384. package/dist/esm/lib/sdks.d.ts.map +1 -0
  385. package/dist/esm/lib/sdks.js +269 -0
  386. package/dist/esm/lib/sdks.js.map +1 -0
  387. package/dist/esm/lib/security.d.ts +83 -0
  388. package/dist/esm/lib/security.d.ts.map +1 -0
  389. package/dist/esm/lib/security.js +137 -0
  390. package/dist/esm/lib/security.js.map +1 -0
  391. package/dist/esm/lib/url.d.ts +5 -0
  392. package/dist/esm/lib/url.d.ts.map +1 -0
  393. package/dist/esm/lib/url.js +22 -0
  394. package/dist/esm/lib/url.js.map +1 -0
  395. package/dist/esm/models/account.d.ts +44 -0
  396. package/dist/esm/models/account.d.ts.map +1 -0
  397. package/dist/esm/models/account.js +61 -0
  398. package/dist/esm/models/account.js.map +1 -0
  399. package/dist/esm/models/accountslim.d.ts +33 -0
  400. package/dist/esm/models/accountslim.d.ts.map +1 -0
  401. package/dist/esm/models/accountslim.js +35 -0
  402. package/dist/esm/models/accountslim.js.map +1 -0
  403. package/dist/esm/models/checkoutrequest.d.ts +94 -0
  404. package/dist/esm/models/checkoutrequest.d.ts.map +1 -0
  405. package/dist/esm/models/checkoutrequest.js +118 -0
  406. package/dist/esm/models/checkoutrequest.js.map +1 -0
  407. package/dist/esm/models/checkoutresponse.d.ts +31 -0
  408. package/dist/esm/models/checkoutresponse.d.ts.map +1 -0
  409. package/dist/esm/models/checkoutresponse.js +44 -0
  410. package/dist/esm/models/checkoutresponse.js.map +1 -0
  411. package/dist/esm/models/errors/creviodefaulterror.d.ts +10 -0
  412. package/dist/esm/models/errors/creviodefaulterror.d.ts.map +1 -0
  413. package/dist/esm/models/errors/creviodefaulterror.js +30 -0
  414. package/dist/esm/models/errors/creviodefaulterror.js.map +1 -0
  415. package/dist/esm/models/errors/crevioerror.d.ts +19 -0
  416. package/dist/esm/models/errors/crevioerror.d.ts.map +1 -0
  417. package/dist/esm/models/errors/crevioerror.js +16 -0
  418. package/dist/esm/models/errors/crevioerror.js.map +1 -0
  419. package/dist/esm/models/errors/error.d.ts +45 -0
  420. package/dist/esm/models/errors/error.d.ts.map +1 -0
  421. package/dist/esm/models/errors/error.js +57 -0
  422. package/dist/esm/models/errors/error.js.map +1 -0
  423. package/dist/esm/models/errors/httpclienterrors.d.ts +44 -0
  424. package/dist/esm/models/errors/httpclienterrors.d.ts.map +1 -0
  425. package/dist/esm/models/errors/httpclienterrors.js +69 -0
  426. package/dist/esm/models/errors/httpclienterrors.js.map +1 -0
  427. package/dist/esm/models/errors/index.d.ts +6 -0
  428. package/dist/esm/models/errors/index.d.ts.map +1 -0
  429. package/dist/esm/models/errors/index.js +9 -0
  430. package/dist/esm/models/errors/index.js.map +1 -0
  431. package/dist/esm/models/errors/responsevalidationerror.d.ts +26 -0
  432. package/dist/esm/models/errors/responsevalidationerror.d.ts.map +1 -0
  433. package/dist/esm/models/errors/responsevalidationerror.js +29 -0
  434. package/dist/esm/models/errors/responsevalidationerror.js.map +1 -0
  435. package/dist/esm/models/errors/sdkvalidationerror.d.ts +21 -0
  436. package/dist/esm/models/errors/sdkvalidationerror.d.ts.map +1 -0
  437. package/dist/esm/models/errors/sdkvalidationerror.js +91 -0
  438. package/dist/esm/models/errors/sdkvalidationerror.js.map +1 -0
  439. package/dist/esm/models/fileattachment.d.ts +37 -0
  440. package/dist/esm/models/fileattachment.d.ts.map +1 -0
  441. package/dist/esm/models/fileattachment.js +50 -0
  442. package/dist/esm/models/fileattachment.js.map +1 -0
  443. package/dist/esm/models/imageattachment.d.ts +37 -0
  444. package/dist/esm/models/imageattachment.d.ts.map +1 -0
  445. package/dist/esm/models/imageattachment.js +50 -0
  446. package/dist/esm/models/imageattachment.js.map +1 -0
  447. package/dist/esm/models/index.d.ts +15 -0
  448. package/dist/esm/models/index.d.ts.map +1 -0
  449. package/dist/esm/models/index.js +18 -0
  450. package/dist/esm/models/index.js.map +1 -0
  451. package/dist/esm/models/linkinbiopage.d.ts +33 -0
  452. package/dist/esm/models/linkinbiopage.d.ts.map +1 -0
  453. package/dist/esm/models/linkinbiopage.js +35 -0
  454. package/dist/esm/models/linkinbiopage.js.map +1 -0
  455. package/dist/esm/models/operations/delete.d.ts +28 -0
  456. package/dist/esm/models/operations/delete.d.ts.map +1 -0
  457. package/dist/esm/models/operations/delete.js +27 -0
  458. package/dist/esm/models/operations/delete.js.map +1 -0
  459. package/dist/esm/models/operations/getaccount.d.ts +32 -0
  460. package/dist/esm/models/operations/getaccount.d.ts.map +1 -0
  461. package/dist/esm/models/operations/getaccount.js +40 -0
  462. package/dist/esm/models/operations/getaccount.js.map +1 -0
  463. package/dist/esm/models/operations/getproduct.d.ts +32 -0
  464. package/dist/esm/models/operations/getproduct.d.ts.map +1 -0
  465. package/dist/esm/models/operations/getproduct.js +40 -0
  466. package/dist/esm/models/operations/getproduct.js.map +1 -0
  467. package/dist/esm/models/operations/index.d.ts +4 -0
  468. package/dist/esm/models/operations/index.d.ts.map +1 -0
  469. package/dist/esm/models/operations/index.js +7 -0
  470. package/dist/esm/models/operations/index.js.map +1 -0
  471. package/dist/esm/models/pricevariant.d.ts +46 -0
  472. package/dist/esm/models/pricevariant.d.ts.map +1 -0
  473. package/dist/esm/models/pricevariant.js +54 -0
  474. package/dist/esm/models/pricevariant.js.map +1 -0
  475. package/dist/esm/models/product.d.ts +94 -0
  476. package/dist/esm/models/product.d.ts.map +1 -0
  477. package/dist/esm/models/product.js +111 -0
  478. package/dist/esm/models/product.js.map +1 -0
  479. package/dist/esm/models/review.d.ts +35 -0
  480. package/dist/esm/models/review.d.ts.map +1 -0
  481. package/dist/esm/models/review.js +47 -0
  482. package/dist/esm/models/review.js.map +1 -0
  483. package/dist/esm/models/security.d.ts +29 -0
  484. package/dist/esm/models/security.d.ts.map +1 -0
  485. package/dist/esm/models/security.js +40 -0
  486. package/dist/esm/models/security.js.map +1 -0
  487. package/dist/esm/models/seo.d.ts +33 -0
  488. package/dist/esm/models/seo.d.ts.map +1 -0
  489. package/dist/esm/models/seo.js +37 -0
  490. package/dist/esm/models/seo.js.map +1 -0
  491. package/dist/esm/models/sociallink.d.ts +35 -0
  492. package/dist/esm/models/sociallink.d.ts.map +1 -0
  493. package/dist/esm/models/sociallink.js +37 -0
  494. package/dist/esm/models/sociallink.js.map +1 -0
  495. package/dist/esm/models/user.d.ts +65 -0
  496. package/dist/esm/models/user.d.ts.map +1 -0
  497. package/dist/esm/models/user.js +100 -0
  498. package/dist/esm/models/user.js.map +1 -0
  499. package/dist/esm/package.json +3 -0
  500. package/dist/esm/sdk/accounts.d.ts +13 -0
  501. package/dist/esm/sdk/accounts.d.ts.map +1 -0
  502. package/dist/esm/sdk/accounts.js +18 -0
  503. package/dist/esm/sdk/accounts.js.map +1 -0
  504. package/dist/esm/sdk/checkouts.d.ts +12 -0
  505. package/dist/esm/sdk/checkouts.d.ts.map +1 -0
  506. package/dist/esm/sdk/checkouts.js +18 -0
  507. package/dist/esm/sdk/checkouts.js.map +1 -0
  508. package/dist/esm/sdk/index.d.ts +2 -0
  509. package/dist/esm/sdk/index.d.ts.map +1 -0
  510. package/dist/esm/sdk/index.js +5 -0
  511. package/dist/esm/sdk/index.js.map +1 -0
  512. package/dist/esm/sdk/products.d.ts +20 -0
  513. package/dist/esm/sdk/products.d.ts.map +1 -0
  514. package/dist/esm/sdk/products.js +28 -0
  515. package/dist/esm/sdk/products.js.map +1 -0
  516. package/dist/esm/sdk/sdk.d.ts +16 -0
  517. package/dist/esm/sdk/sdk.d.ts.map +1 -0
  518. package/dist/esm/sdk/sdk.js +23 -0
  519. package/dist/esm/sdk/sdk.js.map +1 -0
  520. package/dist/esm/sdk/user.d.ts +20 -0
  521. package/dist/esm/sdk/user.d.ts.map +1 -0
  522. package/dist/esm/sdk/user.js +28 -0
  523. package/dist/esm/sdk/user.js.map +1 -0
  524. package/dist/esm/types/async.d.ts +23 -0
  525. package/dist/esm/types/async.d.ts.map +1 -0
  526. package/dist/esm/types/async.js +40 -0
  527. package/dist/esm/types/async.js.map +1 -0
  528. package/dist/esm/types/blobs.d.ts +4 -0
  529. package/dist/esm/types/blobs.d.ts.map +1 -0
  530. package/dist/esm/types/blobs.js +25 -0
  531. package/dist/esm/types/blobs.js.map +1 -0
  532. package/dist/esm/types/constdatetime.d.ts +3 -0
  533. package/dist/esm/types/constdatetime.d.ts.map +1 -0
  534. package/dist/esm/types/constdatetime.js +10 -0
  535. package/dist/esm/types/constdatetime.js.map +1 -0
  536. package/dist/esm/types/enums.d.ts +12 -0
  537. package/dist/esm/types/enums.d.ts.map +1 -0
  538. package/dist/esm/types/enums.js +7 -0
  539. package/dist/esm/types/enums.js.map +1 -0
  540. package/dist/esm/types/fp.d.ts +31 -0
  541. package/dist/esm/types/fp.d.ts.map +1 -0
  542. package/dist/esm/types/fp.js +31 -0
  543. package/dist/esm/types/fp.js.map +1 -0
  544. package/dist/esm/types/index.d.ts +8 -0
  545. package/dist/esm/types/index.d.ts.map +1 -0
  546. package/dist/esm/types/index.js +8 -0
  547. package/dist/esm/types/index.js.map +1 -0
  548. package/dist/esm/types/operations.d.ts +27 -0
  549. package/dist/esm/types/operations.d.ts.map +1 -0
  550. package/dist/esm/types/operations.js +77 -0
  551. package/dist/esm/types/operations.js.map +1 -0
  552. package/dist/esm/types/rfcdate.d.ts +21 -0
  553. package/dist/esm/types/rfcdate.d.ts.map +1 -0
  554. package/dist/esm/types/rfcdate.js +42 -0
  555. package/dist/esm/types/rfcdate.js.map +1 -0
  556. package/dist/esm/types/streams.d.ts +2 -0
  557. package/dist/esm/types/streams.d.ts.map +1 -0
  558. package/dist/esm/types/streams.js +15 -0
  559. package/dist/esm/types/streams.js.map +1 -0
  560. package/docs/sdks/accounts/README.md +84 -0
  561. package/docs/sdks/checkouts/README.md +96 -0
  562. package/docs/sdks/crevio/README.md +7 -0
  563. package/docs/sdks/products/README.md +154 -0
  564. package/docs/sdks/user/README.md +149 -0
  565. package/examples/README.md +31 -0
  566. package/examples/package-lock.json +611 -0
  567. package/examples/package.json +18 -0
  568. package/examples/userGet.example.ts +26 -0
  569. package/jsr.json +27 -0
  570. package/package.json +122 -0
  571. package/src/core.ts +13 -0
  572. package/src/funcs/accountsGet.ts +176 -0
  573. package/src/funcs/checkoutsCreate.ts +169 -0
  574. package/src/funcs/productsGet.ts +176 -0
  575. package/src/funcs/productsList.ts +152 -0
  576. package/src/funcs/userDelete.ts +151 -0
  577. package/src/funcs/userGet.ts +151 -0
  578. package/src/hooks/hooks.ts +132 -0
  579. package/src/hooks/index.ts +6 -0
  580. package/src/hooks/registration.ts +14 -0
  581. package/src/hooks/types.ts +107 -0
  582. package/src/index.ts +9 -0
  583. package/src/lib/base64.ts +37 -0
  584. package/src/lib/config.ts +71 -0
  585. package/src/lib/dlv.ts +53 -0
  586. package/src/lib/encodings.ts +483 -0
  587. package/src/lib/env.ts +41 -0
  588. package/src/lib/files.ts +82 -0
  589. package/src/lib/http.ts +323 -0
  590. package/src/lib/is-plain-object.ts +43 -0
  591. package/src/lib/logger.ts +9 -0
  592. package/src/lib/matchers.ts +352 -0
  593. package/src/lib/primitives.ts +150 -0
  594. package/src/lib/retries.ts +218 -0
  595. package/src/lib/schemas.ts +91 -0
  596. package/src/lib/sdks.ts +406 -0
  597. package/src/lib/security.ts +261 -0
  598. package/src/lib/url.ts +33 -0
  599. package/src/models/account.ts +116 -0
  600. package/src/models/accountslim.ts +70 -0
  601. package/src/models/checkoutrequest.ts +232 -0
  602. package/src/models/checkoutresponse.ts +81 -0
  603. package/src/models/errors/creviodefaulterror.ts +40 -0
  604. package/src/models/errors/crevioerror.ts +35 -0
  605. package/src/models/errors/error.ts +88 -0
  606. package/src/models/errors/httpclienterrors.ts +62 -0
  607. package/src/models/errors/index.ts +9 -0
  608. package/src/models/errors/responsevalidationerror.ts +50 -0
  609. package/src/models/errors/sdkvalidationerror.ts +109 -0
  610. package/src/models/fileattachment.ts +89 -0
  611. package/src/models/imageattachment.ts +91 -0
  612. package/src/models/index.ts +18 -0
  613. package/src/models/linkinbiopage.ts +70 -0
  614. package/src/models/operations/delete.ts +57 -0
  615. package/src/models/operations/getaccount.ts +78 -0
  616. package/src/models/operations/getproduct.ts +78 -0
  617. package/src/models/operations/index.ts +7 -0
  618. package/src/models/pricevariant.ts +102 -0
  619. package/src/models/product.ts +205 -0
  620. package/src/models/review.ts +80 -0
  621. package/src/models/security.ts +71 -0
  622. package/src/models/seo.ts +64 -0
  623. package/src/models/sociallink.ts +74 -0
  624. package/src/models/user.ts +172 -0
  625. package/src/sdk/accounts.ts +28 -0
  626. package/src/sdk/checkouts.ts +27 -0
  627. package/src/sdk/index.ts +5 -0
  628. package/src/sdk/products.ts +44 -0
  629. package/src/sdk/sdk.ts +31 -0
  630. package/src/sdk/user.ts +42 -0
  631. package/src/types/async.ts +68 -0
  632. package/src/types/blobs.ts +31 -0
  633. package/src/types/constdatetime.ts +15 -0
  634. package/src/types/enums.ts +16 -0
  635. package/src/types/fp.ts +50 -0
  636. package/src/types/index.ts +11 -0
  637. package/src/types/operations.ts +105 -0
  638. package/src/types/rfcdate.ts +54 -0
  639. package/src/types/streams.ts +21 -0
  640. package/tsconfig.json +41 -0
@@ -0,0 +1,30 @@
1
+
2
+ > **Remember to shutdown a GitHub Codespace when it is not in use!**
3
+
4
+ # Dev Containers Quick Start
5
+
6
+ The default location for usage snippets is the `samples` directory.
7
+
8
+ ## Running a Usage Sample
9
+
10
+ A sample usage example has been provided in a `root.ts` file. As you work with the SDK, it's expected that you will modify these samples to fit your needs. To execute this particular snippet, use the command below.
11
+
12
+ ```
13
+ ts-node root.ts
14
+ ```
15
+
16
+ ## Generating Additional Usage Samples
17
+
18
+ The speakeasy CLI allows you to generate more usage snippets. Here's how:
19
+
20
+ - To generate a sample for a specific operation by providing an operation ID, use:
21
+
22
+ ```
23
+ speakeasy generate usage -s .speakeasy/out.openapi.yaml -l typescript -i {INPUT_OPERATION_ID} -o ./samples
24
+ ```
25
+
26
+ - To generate samples for an entire namespace (like a tag or group name), use:
27
+
28
+ ```
29
+ speakeasy generate usage -s .speakeasy/out.openapi.yaml -l typescript -n {INPUT_TAG_NAME} -o ./samples
30
+ ```
@@ -0,0 +1,45 @@
1
+ // For format details, see https://aka.ms/devcontainer.json. For config options, see the
2
+ // README at: https://github.com/devcontainers/images/tree/main/src/typescript-node
3
+ {
4
+ "name": "TypeScript",
5
+ "image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye",
6
+ // Features to add to the dev container. More info: https://containers.dev/features.
7
+ // "features": {},
8
+ // Use 'forwardPorts' to make a list of ports inside the container available locally.
9
+ // "forwardPorts": [],
10
+ // Use 'postCreateCommand' to run commands after the container is created.
11
+ "postCreateCommand": "sudo chmod +x ./.devcontainer/setup.sh && ./.devcontainer/setup.sh",
12
+ "customizations": {
13
+ "vscode": {
14
+ "extensions": [
15
+ "ms-vscode.vscode-typescript-tslint-plugin",
16
+ "esbenp.prettier-vscode",
17
+ "github.vscode-pull-request-github"
18
+ ],
19
+ "settings": {
20
+ "files.eol": "\n",
21
+ "editor.formatOnSave": true,
22
+ "typescript.tsc.autoDetect": "on",
23
+ "typescript.updateImportsOnFileMove.enabled": "always",
24
+ "typescript.preferences.importModuleSpecifier": "relative",
25
+ "[typescript]": {
26
+ "editor.codeActionsOnSave": {
27
+ "source.organizeImports": true
28
+ }
29
+ },
30
+ "[typescriptreact]": {
31
+ "editor.codeActionsOnSave": {
32
+ "source.organizeImports": true
33
+ }
34
+ }
35
+ }
36
+ },
37
+ "codespaces": {
38
+ "openFiles": [
39
+ ".devcontainer/README.md"
40
+ ]
41
+ }
42
+ }
43
+ // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
44
+ // "remoteUser": "root"
45
+ }
package/FUNCTIONS.md ADDED
@@ -0,0 +1,87 @@
1
+ # Standalone Functions
2
+
3
+ > [!NOTE]
4
+ > This section is useful if you are using a bundler and targetting browsers and
5
+ > runtimes where the size of an application affects performance and load times.
6
+
7
+ Every method in this SDK is also available as a standalone function. This
8
+ alternative API is suitable when targetting the browser or serverless runtimes
9
+ and using a bundler to build your application since all unused functionality
10
+ will be tree-shaken away. This includes code for unused methods, Zod schemas,
11
+ encoding helpers and response handlers. The result is dramatically smaller
12
+ impact on the application's final bundle size which grows very slowly as you use
13
+ more and more functionality from this SDK.
14
+
15
+ Calling methods through the main SDK class remains a valid and generally more
16
+ more ergonomic option. Standalone functions represent an optimisation for a
17
+ specific category of applications.
18
+
19
+ ## Example
20
+
21
+ ```typescript
22
+ import { CrevioCore } from "@crevio/sdk/core.js";
23
+ import { userGet } from "@crevio/sdk/funcs/userGet.js";
24
+
25
+ // Use `CrevioCore` for best tree-shaking performance.
26
+ // You can create one instance of it to use across an application.
27
+ const crevio = new CrevioCore({
28
+ apiKeyAuth: process.env["CREVIO_API_KEY_AUTH"] ?? "",
29
+ });
30
+
31
+ async function run() {
32
+ const res = await userGet(crevio);
33
+ if (res.ok) {
34
+ const { value: result } = res;
35
+ console.log(result);
36
+ } else {
37
+ console.log("userGet failed:", res.error);
38
+ }
39
+ }
40
+
41
+ run();
42
+ ```
43
+
44
+ ## Result types
45
+
46
+ Standalone functions differ from SDK methods in that they return a
47
+ `Result<Value, Error>` type to capture _known errors_ and document them using
48
+ the type system. By avoiding throwing errors, application code maintains clear
49
+ control flow and error-handling become part of the regular flow of application
50
+ code.
51
+
52
+ > We use the term "known errors" because standalone functions, and JavaScript
53
+ > code in general, can still throw unexpected errors such as `TypeError`s,
54
+ > `RangeError`s and `DOMException`s. Exhaustively catching all errors may be
55
+ > something this SDK addresses in the future. Nevertheless, there is still a lot
56
+ > of benefit from capturing most errors and turning them into values.
57
+
58
+ The second reason for this style of programming is because these functions will
59
+ typically be used in front-end applications where exception throwing is
60
+ sometimes discouraged or considered unidiomatic. React and similar ecosystems
61
+ and libraries tend to promote this style of programming so that components
62
+ render useful content under all states (loading, success, error and so on).
63
+
64
+ The general pattern when calling standalone functions looks like this:
65
+
66
+ ```typescript
67
+ import { Core } from "<sdk-package-name>";
68
+ import { fetchSomething } from "<sdk-package-name>/funcs/fetchSomething.js";
69
+
70
+ const client = new Core();
71
+
72
+ async function run() {
73
+ const result = await fetchSomething(client, { id: "123" });
74
+ if (!result.ok) {
75
+ // You can throw the error or handle it. It's your choice now.
76
+ throw result.error;
77
+ }
78
+
79
+ console.log(result.value);
80
+ }
81
+
82
+ run();
83
+ ```
84
+
85
+ Notably, `result.error` above will have an explicit type compared to a try-catch
86
+ variation where the error in the catch block can only be of type `unknown` (or
87
+ `any` depending on your TypeScript settings).
package/README.md ADDED
@@ -0,0 +1,464 @@
1
+ # @crevio/sdk
2
+
3
+ Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@crevio/sdk* API.
4
+
5
+ <div align="left">
6
+ <a href="https://www.speakeasy.com/?utm_source=@crevio/sdk&utm_campaign=typescript"><img src="https://custom-icon-badges.demolab.com/badge/-Built%20By%20Speakeasy-212015?style=for-the-badge&logoColor=FBE331&logo=speakeasy&labelColor=545454" /></a>
7
+ <a href="https://opensource.org/licenses/MIT">
8
+ <img src="https://img.shields.io/badge/License-MIT-blue.svg" style="width: 100px; height: 28px;" />
9
+ </a>
10
+ </div>
11
+
12
+
13
+ <br /><br />
14
+ > [!IMPORTANT]
15
+ > This SDK is not yet ready for production use. To complete setup please follow the steps outlined in your [workspace](https://app.speakeasy.com/org/crevio/crevio). Delete this section before > publishing to a package manager.
16
+
17
+ <!-- Start Summary [summary] -->
18
+ ## Summary
19
+
20
+ Crevio API: API for the Crevio creator platform - a multi-tenant SaaS for digital product sales
21
+ <!-- End Summary [summary] -->
22
+
23
+ <!-- Start Table of Contents [toc] -->
24
+ ## Table of Contents
25
+ <!-- $toc-max-depth=2 -->
26
+ * [@crevio/sdk](#creviosdk)
27
+ * [SDK Installation](#sdk-installation)
28
+ * [Requirements](#requirements)
29
+ * [SDK Example Usage](#sdk-example-usage)
30
+ * [Authentication](#authentication)
31
+ * [Available Resources and Operations](#available-resources-and-operations)
32
+ * [Standalone functions](#standalone-functions)
33
+ * [Retries](#retries)
34
+ * [Error Handling](#error-handling)
35
+ * [Server Selection](#server-selection)
36
+ * [Custom HTTP Client](#custom-http-client)
37
+ * [Debugging](#debugging)
38
+ * [Development](#development)
39
+ * [Maturity](#maturity)
40
+ * [Contributions](#contributions)
41
+
42
+ <!-- End Table of Contents [toc] -->
43
+
44
+ <!-- Start SDK Installation [installation] -->
45
+ ## SDK Installation
46
+
47
+ The SDK can be installed with either [npm](https://www.npmjs.com/), [pnpm](https://pnpm.io/), [bun](https://bun.sh/) or [yarn](https://classic.yarnpkg.com/en/) package managers.
48
+
49
+ ### NPM
50
+
51
+ ```bash
52
+ npm add @crevio/sdk
53
+ ```
54
+
55
+ ### PNPM
56
+
57
+ ```bash
58
+ pnpm add @crevio/sdk
59
+ ```
60
+
61
+ ### Bun
62
+
63
+ ```bash
64
+ bun add @crevio/sdk
65
+ ```
66
+
67
+ ### Yarn
68
+
69
+ ```bash
70
+ yarn add @crevio/sdk zod
71
+
72
+ # Note that Yarn does not install peer dependencies automatically. You will need
73
+ # to install zod as shown above.
74
+ ```
75
+
76
+ > [!NOTE]
77
+ > This package is published with CommonJS and ES Modules (ESM) support.
78
+ <!-- End SDK Installation [installation] -->
79
+
80
+ <!-- Start Requirements [requirements] -->
81
+ ## Requirements
82
+
83
+ For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).
84
+ <!-- End Requirements [requirements] -->
85
+
86
+ <!-- Start SDK Example Usage [usage] -->
87
+ ## SDK Example Usage
88
+
89
+ ### Example
90
+
91
+ ```typescript
92
+ import { Crevio } from "@crevio/sdk";
93
+
94
+ const crevio = new Crevio({
95
+ apiKeyAuth: process.env["CREVIO_API_KEY_AUTH"] ?? "",
96
+ });
97
+
98
+ async function run() {
99
+ const result = await crevio.user.get();
100
+
101
+ console.log(result);
102
+ }
103
+
104
+ run();
105
+
106
+ ```
107
+ <!-- End SDK Example Usage [usage] -->
108
+
109
+ <!-- Start Authentication [security] -->
110
+ ## Authentication
111
+
112
+ ### Per-Client Security Schemes
113
+
114
+ This SDK supports the following security scheme globally:
115
+
116
+ | Name | Type | Scheme | Environment Variable |
117
+ | ------------ | ------ | ------- | --------------------- |
118
+ | `apiKeyAuth` | apiKey | API key | `CREVIO_API_KEY_AUTH` |
119
+
120
+ To authenticate with the API the `apiKeyAuth` parameter must be set when initializing the SDK client instance. For example:
121
+ ```typescript
122
+ import { Crevio } from "@crevio/sdk";
123
+
124
+ const crevio = new Crevio({
125
+ apiKeyAuth: process.env["CREVIO_API_KEY_AUTH"] ?? "",
126
+ });
127
+
128
+ async function run() {
129
+ const result = await crevio.user.get();
130
+
131
+ console.log(result);
132
+ }
133
+
134
+ run();
135
+
136
+ ```
137
+ <!-- End Authentication [security] -->
138
+
139
+ <!-- Start Available Resources and Operations [operations] -->
140
+ ## Available Resources and Operations
141
+
142
+ <details open>
143
+ <summary>Available methods</summary>
144
+
145
+ ### [accounts](docs/sdks/accounts/README.md)
146
+
147
+ * [get](docs/sdks/accounts/README.md#get) - Get account information
148
+
149
+ ### [checkouts](docs/sdks/checkouts/README.md)
150
+
151
+ * [create](docs/sdks/checkouts/README.md#create) - Create checkout session
152
+
153
+
154
+ ### [products](docs/sdks/products/README.md)
155
+
156
+ * [list](docs/sdks/products/README.md#list) - List products
157
+ * [get](docs/sdks/products/README.md#get) - Get product details
158
+
159
+ ### [user](docs/sdks/user/README.md)
160
+
161
+ * [get](docs/sdks/user/README.md#get) - Get current user information
162
+ * [delete](docs/sdks/user/README.md#delete) - Delete current user account
163
+
164
+ </details>
165
+ <!-- End Available Resources and Operations [operations] -->
166
+
167
+ <!-- Start Standalone functions [standalone-funcs] -->
168
+ ## Standalone functions
169
+
170
+ All the methods listed above are available as standalone functions. These
171
+ functions are ideal for use in applications running in the browser, serverless
172
+ runtimes or other environments where application bundle size is a primary
173
+ concern. When using a bundler to build your application, all unused
174
+ functionality will be either excluded from the final bundle or tree-shaken away.
175
+
176
+ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
177
+
178
+ <details>
179
+
180
+ <summary>Available standalone functions</summary>
181
+
182
+ - [`accountsGet`](docs/sdks/accounts/README.md#get) - Get account information
183
+ - [`checkoutsCreate`](docs/sdks/checkouts/README.md#create) - Create checkout session
184
+ - [`productsGet`](docs/sdks/products/README.md#get) - Get product details
185
+ - [`productsList`](docs/sdks/products/README.md#list) - List products
186
+ - [`userDelete`](docs/sdks/user/README.md#delete) - Delete current user account
187
+ - [`userGet`](docs/sdks/user/README.md#get) - Get current user information
188
+
189
+ </details>
190
+ <!-- End Standalone functions [standalone-funcs] -->
191
+
192
+ <!-- Start Retries [retries] -->
193
+ ## Retries
194
+
195
+ Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
196
+
197
+ To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
198
+ ```typescript
199
+ import { Crevio } from "@crevio/sdk";
200
+
201
+ const crevio = new Crevio({
202
+ apiKeyAuth: process.env["CREVIO_API_KEY_AUTH"] ?? "",
203
+ });
204
+
205
+ async function run() {
206
+ const result = await crevio.user.get({
207
+ retries: {
208
+ strategy: "backoff",
209
+ backoff: {
210
+ initialInterval: 1,
211
+ maxInterval: 50,
212
+ exponent: 1.1,
213
+ maxElapsedTime: 100,
214
+ },
215
+ retryConnectionErrors: false,
216
+ },
217
+ });
218
+
219
+ console.log(result);
220
+ }
221
+
222
+ run();
223
+
224
+ ```
225
+
226
+ If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
227
+ ```typescript
228
+ import { Crevio } from "@crevio/sdk";
229
+
230
+ const crevio = new Crevio({
231
+ retryConfig: {
232
+ strategy: "backoff",
233
+ backoff: {
234
+ initialInterval: 1,
235
+ maxInterval: 50,
236
+ exponent: 1.1,
237
+ maxElapsedTime: 100,
238
+ },
239
+ retryConnectionErrors: false,
240
+ },
241
+ apiKeyAuth: process.env["CREVIO_API_KEY_AUTH"] ?? "",
242
+ });
243
+
244
+ async function run() {
245
+ const result = await crevio.user.get();
246
+
247
+ console.log(result);
248
+ }
249
+
250
+ run();
251
+
252
+ ```
253
+ <!-- End Retries [retries] -->
254
+
255
+ <!-- Start Error Handling [errors] -->
256
+ ## Error Handling
257
+
258
+ [`CrevioError`](./src/models/errors/crevioerror.ts) is the base class for all HTTP error responses. It has the following properties:
259
+
260
+ | Property | Type | Description |
261
+ | ------------------- | ---------- | --------------------------------------------------------------------------------------- |
262
+ | `error.message` | `string` | Error message |
263
+ | `error.statusCode` | `number` | HTTP response status code eg `404` |
264
+ | `error.headers` | `Headers` | HTTP response headers |
265
+ | `error.body` | `string` | HTTP body. Can be empty string if no body is returned. |
266
+ | `error.rawResponse` | `Response` | Raw HTTP response |
267
+ | `error.data$` | | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). |
268
+
269
+ ### Example
270
+ ```typescript
271
+ import { Crevio } from "@crevio/sdk";
272
+ import * as errors from "@crevio/sdk/models/errors";
273
+
274
+ const crevio = new Crevio({
275
+ apiKeyAuth: process.env["CREVIO_API_KEY_AUTH"] ?? "",
276
+ });
277
+
278
+ async function run() {
279
+ try {
280
+ const result = await crevio.user.get();
281
+
282
+ console.log(result);
283
+ } catch (error) {
284
+ // The base class for HTTP error responses
285
+ if (error instanceof errors.CrevioError) {
286
+ console.log(error.message);
287
+ console.log(error.statusCode);
288
+ console.log(error.body);
289
+ console.log(error.headers);
290
+
291
+ // Depending on the method different errors may be thrown
292
+ if (error instanceof errors.ErrorT) {
293
+ console.log(error.data$.error); // string
294
+ console.log(error.data$.details); // string[]
295
+ }
296
+ }
297
+ }
298
+ }
299
+
300
+ run();
301
+
302
+ ```
303
+
304
+ ### Error Classes
305
+ **Primary errors:**
306
+ * [`CrevioError`](./src/models/errors/crevioerror.ts): The base class for HTTP error responses.
307
+ * [`ErrorT`](./src/models/errors/errort.ts): Authentication required.
308
+
309
+ <details><summary>Less common errors (6)</summary>
310
+
311
+ <br />
312
+
313
+ **Network errors:**
314
+ * [`ConnectionError`](./src/models/errors/httpclienterrors.ts): HTTP client was unable to make a request to a server.
315
+ * [`RequestTimeoutError`](./src/models/errors/httpclienterrors.ts): HTTP request timed out due to an AbortSignal signal.
316
+ * [`RequestAbortedError`](./src/models/errors/httpclienterrors.ts): HTTP request was aborted by the client.
317
+ * [`InvalidRequestError`](./src/models/errors/httpclienterrors.ts): Any input used to create a request is invalid.
318
+ * [`UnexpectedClientError`](./src/models/errors/httpclienterrors.ts): Unrecognised or unexpected error.
319
+
320
+
321
+ **Inherit from [`CrevioError`](./src/models/errors/crevioerror.ts)**:
322
+ * [`ResponseValidationError`](./src/models/errors/responsevalidationerror.ts): Type mismatch between the data returned from the server and the structure expected by the SDK. See `error.rawValue` for the raw value and `error.pretty()` for a nicely formatted multi-line string.
323
+
324
+ </details>
325
+ <!-- End Error Handling [errors] -->
326
+
327
+ <!-- Start Server Selection [server] -->
328
+ ## Server Selection
329
+
330
+ ### Select Server by Index
331
+
332
+ You can override the default server globally by passing a server index to the `serverIdx: number` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:
333
+
334
+ | # | Server | Description |
335
+ | --- | --------------------------------- | ------------------------ |
336
+ | 0 | `https://crevio.localhost/api/v1` | Local development server |
337
+ | 1 | `https://api.crevio.com/v1` | Production server |
338
+
339
+ #### Example
340
+
341
+ ```typescript
342
+ import { Crevio } from "@crevio/sdk";
343
+
344
+ const crevio = new Crevio({
345
+ serverIdx: 1,
346
+ apiKeyAuth: process.env["CREVIO_API_KEY_AUTH"] ?? "",
347
+ });
348
+
349
+ async function run() {
350
+ const result = await crevio.user.get();
351
+
352
+ console.log(result);
353
+ }
354
+
355
+ run();
356
+
357
+ ```
358
+
359
+ ### Override Server URL Per-Client
360
+
361
+ The default server can also be overridden globally by passing a URL to the `serverURL: string` optional parameter when initializing the SDK client instance. For example:
362
+ ```typescript
363
+ import { Crevio } from "@crevio/sdk";
364
+
365
+ const crevio = new Crevio({
366
+ serverURL: "https://api.crevio.com/v1",
367
+ apiKeyAuth: process.env["CREVIO_API_KEY_AUTH"] ?? "",
368
+ });
369
+
370
+ async function run() {
371
+ const result = await crevio.user.get();
372
+
373
+ console.log(result);
374
+ }
375
+
376
+ run();
377
+
378
+ ```
379
+ <!-- End Server Selection [server] -->
380
+
381
+ <!-- Start Custom HTTP Client [http-client] -->
382
+ ## Custom HTTP Client
383
+
384
+ The TypeScript SDK makes API calls using an `HTTPClient` that wraps the native
385
+ [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). This
386
+ client is a thin wrapper around `fetch` and provides the ability to attach hooks
387
+ around the request lifecycle that can be used to modify the request or handle
388
+ errors and response.
389
+
390
+ The `HTTPClient` constructor takes an optional `fetcher` argument that can be
391
+ used to integrate a third-party HTTP client or when writing tests to mock out
392
+ the HTTP client and feed in fixtures.
393
+
394
+ The following example shows how to use the `"beforeRequest"` hook to to add a
395
+ custom header and a timeout to requests and how to use the `"requestError"` hook
396
+ to log errors:
397
+
398
+ ```typescript
399
+ import { Crevio } from "@crevio/sdk";
400
+ import { HTTPClient } from "@crevio/sdk/lib/http";
401
+
402
+ const httpClient = new HTTPClient({
403
+ // fetcher takes a function that has the same signature as native `fetch`.
404
+ fetcher: (request) => {
405
+ return fetch(request);
406
+ }
407
+ });
408
+
409
+ httpClient.addHook("beforeRequest", (request) => {
410
+ const nextRequest = new Request(request, {
411
+ signal: request.signal || AbortSignal.timeout(5000)
412
+ });
413
+
414
+ nextRequest.headers.set("x-custom-header", "custom value");
415
+
416
+ return nextRequest;
417
+ });
418
+
419
+ httpClient.addHook("requestError", (error, request) => {
420
+ console.group("Request Error");
421
+ console.log("Reason:", `${error}`);
422
+ console.log("Endpoint:", `${request.method} ${request.url}`);
423
+ console.groupEnd();
424
+ });
425
+
426
+ const sdk = new Crevio({ httpClient });
427
+ ```
428
+ <!-- End Custom HTTP Client [http-client] -->
429
+
430
+ <!-- Start Debugging [debug] -->
431
+ ## Debugging
432
+
433
+ You can setup your SDK to emit debug logs for SDK requests and responses.
434
+
435
+ You can pass a logger that matches `console`'s interface as an SDK option.
436
+
437
+ > [!WARNING]
438
+ > Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production.
439
+
440
+ ```typescript
441
+ import { Crevio } from "@crevio/sdk";
442
+
443
+ const sdk = new Crevio({ debugLogger: console });
444
+ ```
445
+
446
+ You can also enable a default debug logger by setting an environment variable `CREVIO_DEBUG` to true.
447
+ <!-- End Debugging [debug] -->
448
+
449
+ <!-- Placeholder for Future Speakeasy SDK Sections -->
450
+
451
+ # Development
452
+
453
+ ## Maturity
454
+
455
+ This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage
456
+ to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally
457
+ looking for the latest version.
458
+
459
+ ## Contributions
460
+
461
+ While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation.
462
+ We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.
463
+
464
+ ### SDK Created by [Speakeasy](https://www.speakeasy.com/?utm_source=@crevio/sdk&utm_campaign=typescript)
package/RUNTIMES.md ADDED
@@ -0,0 +1,48 @@
1
+ # Supported JavaScript runtimes
2
+
3
+ This SDK is intended to be used in JavaScript runtimes that support ECMAScript 2020 or newer. The SDK uses the following features:
4
+
5
+ * [Web Fetch API][web-fetch]
6
+ * [Web Streams API][web-streams] and in particular `ReadableStream`
7
+ * [Async iterables][async-iter] using `Symbol.asyncIterator`
8
+
9
+ [web-fetch]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
10
+ [web-streams]: https://developer.mozilla.org/en-US/docs/Web/API/Streams_API
11
+ [async-iter]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols
12
+
13
+ Runtime environments that are explicitly supported are:
14
+
15
+ - Evergreen browsers which include: Chrome, Safari, Edge, Firefox
16
+ - Node.js active and maintenance LTS releases
17
+ - Currently, this is v18 and v20
18
+ - Bun v1 and above
19
+ - Deno v1.39
20
+ - Note that Deno does not currently have native support for streaming file uploads backed by the filesystem ([issue link][deno-file-streaming])
21
+
22
+ [deno-file-streaming]: https://github.com/denoland/deno/issues/11018
23
+
24
+ ## Recommended TypeScript compiler options
25
+
26
+ The following `tsconfig.json` options are recommended for projects using this
27
+ SDK in order to get static type support for features like async iterables,
28
+ streams and `fetch`-related APIs ([`for await...of`][for-await-of],
29
+ [`AbortSignal`][abort-signal], [`Request`][request], [`Response`][response] and
30
+ so on):
31
+
32
+ [for-await-of]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of
33
+ [abort-signal]: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
34
+ [request]: https://developer.mozilla.org/en-US/docs/Web/API/Request
35
+ [response]: https://developer.mozilla.org/en-US/docs/Web/API/Response
36
+
37
+ ```jsonc
38
+ {
39
+ "compilerOptions": {
40
+ "target": "es2020", // or higher
41
+ "lib": ["es2020", "dom", "dom.iterable"],
42
+ }
43
+ }
44
+ ```
45
+
46
+ While `target` can be set to older ECMAScript versions, it may result in extra,
47
+ unnecessary compatibility code being generated if you are not targeting old
48
+ runtimes.
@@ -0,0 +1,10 @@
1
+ import { ClientSDK } from "./lib/sdks.js";
2
+ /**
3
+ * A minimal client to use when calling standalone SDK functions. Typically, an
4
+ * instance of this class would be instantiated once at the start of an
5
+ * application and passed around through some dependency injection mechanism to
6
+ * parts of an application that need to make SDK calls.
7
+ */
8
+ export declare class CrevioCore extends ClientSDK {
9
+ }
10
+ //# sourceMappingURL=core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/core.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C;;;;;GAKG;AACH,qBAAa,UAAW,SAAQ,SAAS;CAAG"}