@usenotra/sdk 0.0.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 (476) hide show
  1. package/FUNCTIONS.md +89 -0
  2. package/README.md +429 -0
  3. package/RUNTIMES.md +48 -0
  4. package/dist/commonjs/core.d.ts +10 -0
  5. package/dist/commonjs/core.d.ts.map +1 -0
  6. package/dist/commonjs/core.js +17 -0
  7. package/dist/commonjs/core.js.map +1 -0
  8. package/dist/commonjs/funcs/content-get-post.d.ts +15 -0
  9. package/dist/commonjs/funcs/content-get-post.d.ts.map +1 -0
  10. package/dist/commonjs/funcs/content-get-post.js +129 -0
  11. package/dist/commonjs/funcs/content-get-post.js.map +1 -0
  12. package/dist/commonjs/funcs/content-list-posts.d.ts +15 -0
  13. package/dist/commonjs/funcs/content-list-posts.d.ts.map +1 -0
  14. package/dist/commonjs/funcs/content-list-posts.js +128 -0
  15. package/dist/commonjs/funcs/content-list-posts.js.map +1 -0
  16. package/dist/commonjs/hooks/hooks.d.ts +25 -0
  17. package/dist/commonjs/hooks/hooks.d.ts.map +1 -0
  18. package/dist/commonjs/hooks/hooks.js +86 -0
  19. package/dist/commonjs/hooks/hooks.js.map +1 -0
  20. package/dist/commonjs/hooks/index.d.ts +3 -0
  21. package/dist/commonjs/hooks/index.d.ts.map +1 -0
  22. package/dist/commonjs/hooks/index.js +22 -0
  23. package/dist/commonjs/hooks/index.js.map +1 -0
  24. package/dist/commonjs/hooks/registration.d.ts +3 -0
  25. package/dist/commonjs/hooks/registration.d.ts.map +1 -0
  26. package/dist/commonjs/hooks/registration.js +15 -0
  27. package/dist/commonjs/hooks/registration.js.map +1 -0
  28. package/dist/commonjs/hooks/types.d.ts +76 -0
  29. package/dist/commonjs/hooks/types.d.ts.map +1 -0
  30. package/dist/commonjs/hooks/types.js +6 -0
  31. package/dist/commonjs/hooks/types.js.map +1 -0
  32. package/dist/commonjs/index.d.ts +6 -0
  33. package/dist/commonjs/index.d.ts.map +1 -0
  34. package/dist/commonjs/index.js +48 -0
  35. package/dist/commonjs/index.js.map +1 -0
  36. package/dist/commonjs/lib/base64.d.ts +10 -0
  37. package/dist/commonjs/lib/base64.d.ts.map +1 -0
  38. package/dist/commonjs/lib/base64.js +73 -0
  39. package/dist/commonjs/lib/base64.js.map +1 -0
  40. package/dist/commonjs/lib/config.d.ts +38 -0
  41. package/dist/commonjs/lib/config.d.ts.map +1 -0
  42. package/dist/commonjs/lib/config.js +38 -0
  43. package/dist/commonjs/lib/config.js.map +1 -0
  44. package/dist/commonjs/lib/dlv.d.ts +14 -0
  45. package/dist/commonjs/lib/dlv.d.ts.map +1 -0
  46. package/dist/commonjs/lib/dlv.js +49 -0
  47. package/dist/commonjs/lib/dlv.js.map +1 -0
  48. package/dist/commonjs/lib/encodings.d.ts +53 -0
  49. package/dist/commonjs/lib/encodings.d.ts.map +1 -0
  50. package/dist/commonjs/lib/encodings.js +384 -0
  51. package/dist/commonjs/lib/encodings.js.map +1 -0
  52. package/dist/commonjs/lib/env.d.ts +15 -0
  53. package/dist/commonjs/lib/env.d.ts.map +1 -0
  54. package/dist/commonjs/lib/env.js +82 -0
  55. package/dist/commonjs/lib/env.js.map +1 -0
  56. package/dist/commonjs/lib/files.d.ts +13 -0
  57. package/dist/commonjs/lib/files.d.ts.map +1 -0
  58. package/dist/commonjs/lib/files.js +77 -0
  59. package/dist/commonjs/lib/files.js.map +1 -0
  60. package/dist/commonjs/lib/http.d.ts +67 -0
  61. package/dist/commonjs/lib/http.d.ts.map +1 -0
  62. package/dist/commonjs/lib/http.js +217 -0
  63. package/dist/commonjs/lib/http.js.map +1 -0
  64. package/dist/commonjs/lib/is-plain-object.d.ts +2 -0
  65. package/dist/commonjs/lib/is-plain-object.d.ts.map +1 -0
  66. package/dist/commonjs/lib/is-plain-object.js +41 -0
  67. package/dist/commonjs/lib/is-plain-object.js.map +1 -0
  68. package/dist/commonjs/lib/logger.d.ts +6 -0
  69. package/dist/commonjs/lib/logger.d.ts.map +1 -0
  70. package/dist/commonjs/lib/logger.js +6 -0
  71. package/dist/commonjs/lib/logger.js.map +1 -0
  72. package/dist/commonjs/lib/matchers.d.ts +59 -0
  73. package/dist/commonjs/lib/matchers.d.ts.map +1 -0
  74. package/dist/commonjs/lib/matchers.js +222 -0
  75. package/dist/commonjs/lib/matchers.js.map +1 -0
  76. package/dist/commonjs/lib/primitives.d.ts +26 -0
  77. package/dist/commonjs/lib/primitives.d.ts.map +1 -0
  78. package/dist/commonjs/lib/primitives.js +111 -0
  79. package/dist/commonjs/lib/primitives.js.map +1 -0
  80. package/dist/commonjs/lib/retries.d.ts +38 -0
  81. package/dist/commonjs/lib/retries.d.ts.map +1 -0
  82. package/dist/commonjs/lib/retries.js +153 -0
  83. package/dist/commonjs/lib/retries.js.map +1 -0
  84. package/dist/commonjs/lib/schemas.d.ts +21 -0
  85. package/dist/commonjs/lib/schemas.d.ts.map +1 -0
  86. package/dist/commonjs/lib/schemas.js +95 -0
  87. package/dist/commonjs/lib/schemas.js.map +1 -0
  88. package/dist/commonjs/lib/sdks.d.ts +63 -0
  89. package/dist/commonjs/lib/sdks.d.ts.map +1 -0
  90. package/dist/commonjs/lib/sdks.js +273 -0
  91. package/dist/commonjs/lib/sdks.js.map +1 -0
  92. package/dist/commonjs/lib/security.d.ts +83 -0
  93. package/dist/commonjs/lib/security.d.ts.map +1 -0
  94. package/dist/commonjs/lib/security.js +144 -0
  95. package/dist/commonjs/lib/security.js.map +1 -0
  96. package/dist/commonjs/lib/url.d.ts +5 -0
  97. package/dist/commonjs/lib/url.d.ts.map +1 -0
  98. package/dist/commonjs/lib/url.js +25 -0
  99. package/dist/commonjs/lib/url.js.map +1 -0
  100. package/dist/commonjs/models/errors/error-response.d.ts +18 -0
  101. package/dist/commonjs/models/errors/error-response.d.ts.map +1 -0
  102. package/dist/commonjs/models/errors/error-response.js +68 -0
  103. package/dist/commonjs/models/errors/error-response.js.map +1 -0
  104. package/dist/commonjs/models/errors/http-client-errors.d.ts +44 -0
  105. package/dist/commonjs/models/errors/http-client-errors.d.ts.map +1 -0
  106. package/dist/commonjs/models/errors/http-client-errors.js +78 -0
  107. package/dist/commonjs/models/errors/http-client-errors.js.map +1 -0
  108. package/dist/commonjs/models/errors/index.d.ts +7 -0
  109. package/dist/commonjs/models/errors/index.d.ts.map +1 -0
  110. package/dist/commonjs/models/errors/index.js +26 -0
  111. package/dist/commonjs/models/errors/index.js.map +1 -0
  112. package/dist/commonjs/models/errors/notra-default-error.d.ts +10 -0
  113. package/dist/commonjs/models/errors/notra-default-error.d.ts.map +1 -0
  114. package/dist/commonjs/models/errors/notra-default-error.js +34 -0
  115. package/dist/commonjs/models/errors/notra-default-error.js.map +1 -0
  116. package/dist/commonjs/models/errors/notra-error.d.ts +19 -0
  117. package/dist/commonjs/models/errors/notra-error.d.ts.map +1 -0
  118. package/dist/commonjs/models/errors/notra-error.js +20 -0
  119. package/dist/commonjs/models/errors/notra-error.js.map +1 -0
  120. package/dist/commonjs/models/errors/response-validation-error.d.ts +26 -0
  121. package/dist/commonjs/models/errors/response-validation-error.d.ts.map +1 -0
  122. package/dist/commonjs/models/errors/response-validation-error.js +66 -0
  123. package/dist/commonjs/models/errors/response-validation-error.js.map +1 -0
  124. package/dist/commonjs/models/errors/sdk-validation-error.d.ts +21 -0
  125. package/dist/commonjs/models/errors/sdk-validation-error.d.ts.map +1 -0
  126. package/dist/commonjs/models/errors/sdk-validation-error.js +82 -0
  127. package/dist/commonjs/models/errors/sdk-validation-error.js.map +1 -0
  128. package/dist/commonjs/models/index.d.ts +2 -0
  129. package/dist/commonjs/models/index.d.ts.map +1 -0
  130. package/dist/commonjs/models/index.js +21 -0
  131. package/dist/commonjs/models/index.js.map +1 -0
  132. package/dist/commonjs/models/operations/get-post.d.ts +89 -0
  133. package/dist/commonjs/models/operations/get-post.d.ts.map +1 -0
  134. package/dist/commonjs/models/operations/get-post.js +125 -0
  135. package/dist/commonjs/models/operations/get-post.js.map +1 -0
  136. package/dist/commonjs/models/operations/index.d.ts +3 -0
  137. package/dist/commonjs/models/operations/index.d.ts.map +1 -0
  138. package/dist/commonjs/models/operations/index.js +22 -0
  139. package/dist/commonjs/models/operations/index.js.map +1 -0
  140. package/dist/commonjs/models/operations/list-posts.d.ts +127 -0
  141. package/dist/commonjs/models/operations/list-posts.d.ts.map +1 -0
  142. package/dist/commonjs/models/operations/list-posts.js +150 -0
  143. package/dist/commonjs/models/operations/list-posts.js.map +1 -0
  144. package/dist/commonjs/models/security.d.ts +12 -0
  145. package/dist/commonjs/models/security.d.ts.map +1 -0
  146. package/dist/commonjs/models/security.js +54 -0
  147. package/dist/commonjs/models/security.js.map +1 -0
  148. package/dist/commonjs/package.json +3 -0
  149. package/dist/commonjs/sdk/content.d.ts +13 -0
  150. package/dist/commonjs/sdk/content.d.ts.map +1 -0
  151. package/dist/commonjs/sdk/content.js +26 -0
  152. package/dist/commonjs/sdk/content.js.map +1 -0
  153. package/dist/commonjs/sdk/index.d.ts +2 -0
  154. package/dist/commonjs/sdk/index.d.ts.map +1 -0
  155. package/dist/commonjs/sdk/index.js +21 -0
  156. package/dist/commonjs/sdk/index.js.map +1 -0
  157. package/dist/commonjs/sdk/sdk.d.ts +7 -0
  158. package/dist/commonjs/sdk/sdk.d.ts.map +1 -0
  159. package/dist/commonjs/sdk/sdk.js +15 -0
  160. package/dist/commonjs/sdk/sdk.js.map +1 -0
  161. package/dist/commonjs/types/async.d.ts +23 -0
  162. package/dist/commonjs/types/async.d.ts.map +1 -0
  163. package/dist/commonjs/types/async.js +44 -0
  164. package/dist/commonjs/types/async.js.map +1 -0
  165. package/dist/commonjs/types/blobs.d.ts +4 -0
  166. package/dist/commonjs/types/blobs.d.ts.map +1 -0
  167. package/dist/commonjs/types/blobs.js +62 -0
  168. package/dist/commonjs/types/blobs.js.map +1 -0
  169. package/dist/commonjs/types/const-date-time.d.ts +3 -0
  170. package/dist/commonjs/types/const-date-time.d.ts.map +1 -0
  171. package/dist/commonjs/types/const-date-time.js +46 -0
  172. package/dist/commonjs/types/const-date-time.js.map +1 -0
  173. package/dist/commonjs/types/default-to-zero-value.d.ts +12 -0
  174. package/dist/commonjs/types/default-to-zero-value.d.ts.map +1 -0
  175. package/dist/commonjs/types/default-to-zero-value.js +35 -0
  176. package/dist/commonjs/types/default-to-zero-value.js.map +1 -0
  177. package/dist/commonjs/types/enums.d.ts +9 -0
  178. package/dist/commonjs/types/enums.d.ts.map +1 -0
  179. package/dist/commonjs/types/enums.js +66 -0
  180. package/dist/commonjs/types/enums.js.map +1 -0
  181. package/dist/commonjs/types/fp.d.ts +31 -0
  182. package/dist/commonjs/types/fp.d.ts.map +1 -0
  183. package/dist/commonjs/types/fp.js +37 -0
  184. package/dist/commonjs/types/fp.js.map +1 -0
  185. package/dist/commonjs/types/index.d.ts +10 -0
  186. package/dist/commonjs/types/index.d.ts.map +1 -0
  187. package/dist/commonjs/types/index.js +31 -0
  188. package/dist/commonjs/types/index.js.map +1 -0
  189. package/dist/commonjs/types/operations.d.ts +27 -0
  190. package/dist/commonjs/types/operations.d.ts.map +1 -0
  191. package/dist/commonjs/types/operations.js +83 -0
  192. package/dist/commonjs/types/operations.js.map +1 -0
  193. package/dist/commonjs/types/primitives.d.ts +11 -0
  194. package/dist/commonjs/types/primitives.d.ts.map +1 -0
  195. package/dist/commonjs/types/primitives.js +176 -0
  196. package/dist/commonjs/types/primitives.js.map +1 -0
  197. package/dist/commonjs/types/rfcdate.d.ts +21 -0
  198. package/dist/commonjs/types/rfcdate.d.ts.map +1 -0
  199. package/dist/commonjs/types/rfcdate.js +46 -0
  200. package/dist/commonjs/types/rfcdate.js.map +1 -0
  201. package/dist/commonjs/types/smart-union.d.ts +7 -0
  202. package/dist/commonjs/types/smart-union.d.ts.map +1 -0
  203. package/dist/commonjs/types/smart-union.js +153 -0
  204. package/dist/commonjs/types/smart-union.js.map +1 -0
  205. package/dist/commonjs/types/streams.d.ts +2 -0
  206. package/dist/commonjs/types/streams.d.ts.map +1 -0
  207. package/dist/commonjs/types/streams.js +18 -0
  208. package/dist/commonjs/types/streams.js.map +1 -0
  209. package/dist/commonjs/types/unrecognized.d.ts +16 -0
  210. package/dist/commonjs/types/unrecognized.d.ts.map +1 -0
  211. package/dist/commonjs/types/unrecognized.js +34 -0
  212. package/dist/commonjs/types/unrecognized.js.map +1 -0
  213. package/dist/esm/core.d.ts +10 -0
  214. package/dist/esm/core.d.ts.map +1 -0
  215. package/dist/esm/core.js +13 -0
  216. package/dist/esm/core.js.map +1 -0
  217. package/dist/esm/funcs/content-get-post.d.ts +15 -0
  218. package/dist/esm/funcs/content-get-post.d.ts.map +1 -0
  219. package/dist/esm/funcs/content-get-post.js +93 -0
  220. package/dist/esm/funcs/content-get-post.js.map +1 -0
  221. package/dist/esm/funcs/content-list-posts.d.ts +15 -0
  222. package/dist/esm/funcs/content-list-posts.d.ts.map +1 -0
  223. package/dist/esm/funcs/content-list-posts.js +92 -0
  224. package/dist/esm/funcs/content-list-posts.js.map +1 -0
  225. package/dist/esm/hooks/hooks.d.ts +25 -0
  226. package/dist/esm/hooks/hooks.d.ts.map +1 -0
  227. package/dist/esm/hooks/hooks.js +82 -0
  228. package/dist/esm/hooks/hooks.js.map +1 -0
  229. package/dist/esm/hooks/index.d.ts +3 -0
  230. package/dist/esm/hooks/index.d.ts.map +1 -0
  231. package/dist/esm/hooks/index.js +6 -0
  232. package/dist/esm/hooks/index.js.map +1 -0
  233. package/dist/esm/hooks/registration.d.ts +3 -0
  234. package/dist/esm/hooks/registration.d.ts.map +1 -0
  235. package/dist/esm/hooks/registration.js +12 -0
  236. package/dist/esm/hooks/registration.js.map +1 -0
  237. package/dist/esm/hooks/types.d.ts +76 -0
  238. package/dist/esm/hooks/types.d.ts.map +1 -0
  239. package/dist/esm/hooks/types.js +5 -0
  240. package/dist/esm/hooks/types.js.map +1 -0
  241. package/dist/esm/index.d.ts +6 -0
  242. package/dist/esm/index.d.ts.map +1 -0
  243. package/dist/esm/index.js +8 -0
  244. package/dist/esm/index.js.map +1 -0
  245. package/dist/esm/lib/base64.d.ts +10 -0
  246. package/dist/esm/lib/base64.d.ts.map +1 -0
  247. package/dist/esm/lib/base64.js +31 -0
  248. package/dist/esm/lib/base64.js.map +1 -0
  249. package/dist/esm/lib/config.d.ts +38 -0
  250. package/dist/esm/lib/config.d.ts.map +1 -0
  251. package/dist/esm/lib/config.js +34 -0
  252. package/dist/esm/lib/config.js.map +1 -0
  253. package/dist/esm/lib/dlv.d.ts +14 -0
  254. package/dist/esm/lib/dlv.d.ts.map +1 -0
  255. package/dist/esm/lib/dlv.js +46 -0
  256. package/dist/esm/lib/dlv.js.map +1 -0
  257. package/dist/esm/lib/encodings.d.ts +53 -0
  258. package/dist/esm/lib/encodings.d.ts.map +1 -0
  259. package/dist/esm/lib/encodings.js +370 -0
  260. package/dist/esm/lib/encodings.js.map +1 -0
  261. package/dist/esm/lib/env.d.ts +15 -0
  262. package/dist/esm/lib/env.d.ts.map +1 -0
  263. package/dist/esm/lib/env.js +44 -0
  264. package/dist/esm/lib/env.js.map +1 -0
  265. package/dist/esm/lib/files.d.ts +13 -0
  266. package/dist/esm/lib/files.d.ts.map +1 -0
  267. package/dist/esm/lib/files.js +73 -0
  268. package/dist/esm/lib/files.js.map +1 -0
  269. package/dist/esm/lib/http.d.ts +67 -0
  270. package/dist/esm/lib/http.d.ts.map +1 -0
  271. package/dist/esm/lib/http.js +207 -0
  272. package/dist/esm/lib/http.js.map +1 -0
  273. package/dist/esm/lib/is-plain-object.d.ts +2 -0
  274. package/dist/esm/lib/is-plain-object.d.ts.map +1 -0
  275. package/dist/esm/lib/is-plain-object.js +38 -0
  276. package/dist/esm/lib/is-plain-object.js.map +1 -0
  277. package/dist/esm/lib/logger.d.ts +6 -0
  278. package/dist/esm/lib/logger.d.ts.map +1 -0
  279. package/dist/esm/lib/logger.js +5 -0
  280. package/dist/esm/lib/logger.js.map +1 -0
  281. package/dist/esm/lib/matchers.d.ts +59 -0
  282. package/dist/esm/lib/matchers.d.ts.map +1 -0
  283. package/dist/esm/lib/matchers.js +203 -0
  284. package/dist/esm/lib/matchers.js.map +1 -0
  285. package/dist/esm/lib/primitives.d.ts +26 -0
  286. package/dist/esm/lib/primitives.d.ts.map +1 -0
  287. package/dist/esm/lib/primitives.js +103 -0
  288. package/dist/esm/lib/primitives.js.map +1 -0
  289. package/dist/esm/lib/retries.d.ts +38 -0
  290. package/dist/esm/lib/retries.d.ts.map +1 -0
  291. package/dist/esm/lib/retries.js +147 -0
  292. package/dist/esm/lib/retries.js.map +1 -0
  293. package/dist/esm/lib/schemas.d.ts +21 -0
  294. package/dist/esm/lib/schemas.d.ts.map +1 -0
  295. package/dist/esm/lib/schemas.js +57 -0
  296. package/dist/esm/lib/schemas.js.map +1 -0
  297. package/dist/esm/lib/sdks.d.ts +63 -0
  298. package/dist/esm/lib/sdks.d.ts.map +1 -0
  299. package/dist/esm/lib/sdks.js +269 -0
  300. package/dist/esm/lib/sdks.js.map +1 -0
  301. package/dist/esm/lib/security.d.ts +83 -0
  302. package/dist/esm/lib/security.d.ts.map +1 -0
  303. package/dist/esm/lib/security.js +137 -0
  304. package/dist/esm/lib/security.js.map +1 -0
  305. package/dist/esm/lib/url.d.ts +5 -0
  306. package/dist/esm/lib/url.d.ts.map +1 -0
  307. package/dist/esm/lib/url.js +22 -0
  308. package/dist/esm/lib/url.js.map +1 -0
  309. package/dist/esm/models/errors/error-response.d.ts +18 -0
  310. package/dist/esm/models/errors/error-response.d.ts.map +1 -0
  311. package/dist/esm/models/errors/error-response.js +31 -0
  312. package/dist/esm/models/errors/error-response.js.map +1 -0
  313. package/dist/esm/models/errors/http-client-errors.d.ts +44 -0
  314. package/dist/esm/models/errors/http-client-errors.d.ts.map +1 -0
  315. package/dist/esm/models/errors/http-client-errors.js +69 -0
  316. package/dist/esm/models/errors/http-client-errors.js.map +1 -0
  317. package/dist/esm/models/errors/index.d.ts +7 -0
  318. package/dist/esm/models/errors/index.d.ts.map +1 -0
  319. package/dist/esm/models/errors/index.js +10 -0
  320. package/dist/esm/models/errors/index.js.map +1 -0
  321. package/dist/esm/models/errors/notra-default-error.d.ts +10 -0
  322. package/dist/esm/models/errors/notra-default-error.d.ts.map +1 -0
  323. package/dist/esm/models/errors/notra-default-error.js +30 -0
  324. package/dist/esm/models/errors/notra-default-error.js.map +1 -0
  325. package/dist/esm/models/errors/notra-error.d.ts +19 -0
  326. package/dist/esm/models/errors/notra-error.d.ts.map +1 -0
  327. package/dist/esm/models/errors/notra-error.js +16 -0
  328. package/dist/esm/models/errors/notra-error.js.map +1 -0
  329. package/dist/esm/models/errors/response-validation-error.d.ts +26 -0
  330. package/dist/esm/models/errors/response-validation-error.d.ts.map +1 -0
  331. package/dist/esm/models/errors/response-validation-error.js +29 -0
  332. package/dist/esm/models/errors/response-validation-error.js.map +1 -0
  333. package/dist/esm/models/errors/sdk-validation-error.d.ts +21 -0
  334. package/dist/esm/models/errors/sdk-validation-error.d.ts.map +1 -0
  335. package/dist/esm/models/errors/sdk-validation-error.js +44 -0
  336. package/dist/esm/models/errors/sdk-validation-error.js.map +1 -0
  337. package/dist/esm/models/index.d.ts +2 -0
  338. package/dist/esm/models/index.d.ts.map +1 -0
  339. package/dist/esm/models/index.js +5 -0
  340. package/dist/esm/models/index.js.map +1 -0
  341. package/dist/esm/models/operations/get-post.d.ts +89 -0
  342. package/dist/esm/models/operations/get-post.d.ts.map +1 -0
  343. package/dist/esm/models/operations/get-post.js +84 -0
  344. package/dist/esm/models/operations/get-post.js.map +1 -0
  345. package/dist/esm/models/operations/index.d.ts +3 -0
  346. package/dist/esm/models/operations/index.d.ts.map +1 -0
  347. package/dist/esm/models/operations/index.js +6 -0
  348. package/dist/esm/models/operations/index.js.map +1 -0
  349. package/dist/esm/models/operations/list-posts.d.ts +127 -0
  350. package/dist/esm/models/operations/list-posts.d.ts.map +1 -0
  351. package/dist/esm/models/operations/list-posts.js +108 -0
  352. package/dist/esm/models/operations/list-posts.js.map +1 -0
  353. package/dist/esm/models/security.d.ts +12 -0
  354. package/dist/esm/models/security.d.ts.map +1 -0
  355. package/dist/esm/models/security.js +17 -0
  356. package/dist/esm/models/security.js.map +1 -0
  357. package/dist/esm/package.json +3 -0
  358. package/dist/esm/sdk/content.d.ts +13 -0
  359. package/dist/esm/sdk/content.d.ts.map +1 -0
  360. package/dist/esm/sdk/content.js +22 -0
  361. package/dist/esm/sdk/content.js.map +1 -0
  362. package/dist/esm/sdk/index.d.ts +2 -0
  363. package/dist/esm/sdk/index.d.ts.map +1 -0
  364. package/dist/esm/sdk/index.js +5 -0
  365. package/dist/esm/sdk/index.js.map +1 -0
  366. package/dist/esm/sdk/sdk.d.ts +7 -0
  367. package/dist/esm/sdk/sdk.d.ts.map +1 -0
  368. package/dist/esm/sdk/sdk.js +11 -0
  369. package/dist/esm/sdk/sdk.js.map +1 -0
  370. package/dist/esm/types/async.d.ts +23 -0
  371. package/dist/esm/types/async.d.ts.map +1 -0
  372. package/dist/esm/types/async.js +40 -0
  373. package/dist/esm/types/async.js.map +1 -0
  374. package/dist/esm/types/blobs.d.ts +4 -0
  375. package/dist/esm/types/blobs.d.ts.map +1 -0
  376. package/dist/esm/types/blobs.js +25 -0
  377. package/dist/esm/types/blobs.js.map +1 -0
  378. package/dist/esm/types/const-date-time.d.ts +3 -0
  379. package/dist/esm/types/const-date-time.d.ts.map +1 -0
  380. package/dist/esm/types/const-date-time.js +10 -0
  381. package/dist/esm/types/const-date-time.js.map +1 -0
  382. package/dist/esm/types/default-to-zero-value.d.ts +12 -0
  383. package/dist/esm/types/default-to-zero-value.d.ts.map +1 -0
  384. package/dist/esm/types/default-to-zero-value.js +31 -0
  385. package/dist/esm/types/default-to-zero-value.js.map +1 -0
  386. package/dist/esm/types/enums.d.ts +9 -0
  387. package/dist/esm/types/enums.d.ts.map +1 -0
  388. package/dist/esm/types/enums.js +27 -0
  389. package/dist/esm/types/enums.js.map +1 -0
  390. package/dist/esm/types/fp.d.ts +31 -0
  391. package/dist/esm/types/fp.d.ts.map +1 -0
  392. package/dist/esm/types/fp.js +31 -0
  393. package/dist/esm/types/fp.js.map +1 -0
  394. package/dist/esm/types/index.d.ts +10 -0
  395. package/dist/esm/types/index.d.ts.map +1 -0
  396. package/dist/esm/types/index.js +10 -0
  397. package/dist/esm/types/index.js.map +1 -0
  398. package/dist/esm/types/operations.d.ts +27 -0
  399. package/dist/esm/types/operations.d.ts.map +1 -0
  400. package/dist/esm/types/operations.js +77 -0
  401. package/dist/esm/types/operations.js.map +1 -0
  402. package/dist/esm/types/primitives.d.ts +11 -0
  403. package/dist/esm/types/primitives.d.ts.map +1 -0
  404. package/dist/esm/types/primitives.js +132 -0
  405. package/dist/esm/types/primitives.js.map +1 -0
  406. package/dist/esm/types/rfcdate.d.ts +21 -0
  407. package/dist/esm/types/rfcdate.d.ts.map +1 -0
  408. package/dist/esm/types/rfcdate.js +42 -0
  409. package/dist/esm/types/rfcdate.js.map +1 -0
  410. package/dist/esm/types/smart-union.d.ts +7 -0
  411. package/dist/esm/types/smart-union.d.ts.map +1 -0
  412. package/dist/esm/types/smart-union.js +117 -0
  413. package/dist/esm/types/smart-union.js.map +1 -0
  414. package/dist/esm/types/streams.d.ts +2 -0
  415. package/dist/esm/types/streams.d.ts.map +1 -0
  416. package/dist/esm/types/streams.js +15 -0
  417. package/dist/esm/types/streams.js.map +1 -0
  418. package/dist/esm/types/unrecognized.d.ts +16 -0
  419. package/dist/esm/types/unrecognized.d.ts.map +1 -0
  420. package/dist/esm/types/unrecognized.js +31 -0
  421. package/dist/esm/types/unrecognized.js.map +1 -0
  422. package/examples/contentListPosts.example.ts +28 -0
  423. package/jsr.json +27 -0
  424. package/package.json +122 -0
  425. package/src/core.ts +13 -0
  426. package/src/funcs/content-get-post.ts +183 -0
  427. package/src/funcs/content-list-posts.ts +182 -0
  428. package/src/hooks/hooks.ts +132 -0
  429. package/src/hooks/index.ts +6 -0
  430. package/src/hooks/registration.ts +14 -0
  431. package/src/hooks/types.ts +107 -0
  432. package/src/index.ts +9 -0
  433. package/src/lib/base64.ts +39 -0
  434. package/src/lib/config.ts +67 -0
  435. package/src/lib/dlv.ts +53 -0
  436. package/src/lib/encodings.ts +501 -0
  437. package/src/lib/env.ts +57 -0
  438. package/src/lib/files.ts +82 -0
  439. package/src/lib/http.ts +323 -0
  440. package/src/lib/is-plain-object.ts +43 -0
  441. package/src/lib/logger.ts +9 -0
  442. package/src/lib/matchers.ts +352 -0
  443. package/src/lib/primitives.ts +150 -0
  444. package/src/lib/retries.ts +218 -0
  445. package/src/lib/schemas.ts +94 -0
  446. package/src/lib/sdks.ts +406 -0
  447. package/src/lib/security.ts +264 -0
  448. package/src/lib/url.ts +33 -0
  449. package/src/models/errors/error-response.ts +52 -0
  450. package/src/models/errors/http-client-errors.ts +62 -0
  451. package/src/models/errors/index.ts +10 -0
  452. package/src/models/errors/notra-default-error.ts +40 -0
  453. package/src/models/errors/notra-error.ts +35 -0
  454. package/src/models/errors/response-validation-error.ts +50 -0
  455. package/src/models/errors/sdk-validation-error.ts +54 -0
  456. package/src/models/index.ts +5 -0
  457. package/src/models/operations/get-post.ts +212 -0
  458. package/src/models/operations/index.ts +6 -0
  459. package/src/models/operations/list-posts.ts +280 -0
  460. package/src/models/security.ts +34 -0
  461. package/src/sdk/content.ts +39 -0
  462. package/src/sdk/index.ts +5 -0
  463. package/src/sdk/sdk.ts +13 -0
  464. package/src/types/async.ts +68 -0
  465. package/src/types/blobs.ts +33 -0
  466. package/src/types/const-date-time.ts +15 -0
  467. package/src/types/default-to-zero-value.ts +33 -0
  468. package/src/types/enums.ts +45 -0
  469. package/src/types/fp.ts +50 -0
  470. package/src/types/index.ts +13 -0
  471. package/src/types/operations.ts +105 -0
  472. package/src/types/primitives.ts +168 -0
  473. package/src/types/rfcdate.ts +54 -0
  474. package/src/types/smart-union.ts +153 -0
  475. package/src/types/streams.ts +21 -0
  476. package/src/types/unrecognized.ts +35 -0
package/FUNCTIONS.md ADDED
@@ -0,0 +1,89 @@
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 { NotraCore } from "@usenotra/sdk/core.js";
23
+ import { contentListPosts } from "@usenotra/sdk/funcs/content-list-posts.js";
24
+
25
+ // Use `NotraCore` for best tree-shaking performance.
26
+ // You can create one instance of it to use across an application.
27
+ const notra = new NotraCore({
28
+ bearerAuth: process.env["NOTRA_BEARER_AUTH"] ?? "",
29
+ });
30
+
31
+ async function run() {
32
+ const res = await contentListPosts(notra, {
33
+ organizationId: "org_123",
34
+ });
35
+ if (res.ok) {
36
+ const { value: result } = res;
37
+ console.log(result);
38
+ } else {
39
+ console.log("contentListPosts failed:", res.error);
40
+ }
41
+ }
42
+
43
+ run();
44
+ ```
45
+
46
+ ## Result types
47
+
48
+ Standalone functions differ from SDK methods in that they return a
49
+ `Result<Value, Error>` type to capture _known errors_ and document them using
50
+ the type system. By avoiding throwing errors, application code maintains clear
51
+ control flow and error-handling become part of the regular flow of application
52
+ code.
53
+
54
+ > We use the term "known errors" because standalone functions, and JavaScript
55
+ > code in general, can still throw unexpected errors such as `TypeError`s,
56
+ > `RangeError`s and `DOMException`s. Exhaustively catching all errors may be
57
+ > something this SDK addresses in the future. Nevertheless, there is still a lot
58
+ > of benefit from capturing most errors and turning them into values.
59
+
60
+ The second reason for this style of programming is because these functions will
61
+ typically be used in front-end applications where exception throwing is
62
+ sometimes discouraged or considered unidiomatic. React and similar ecosystems
63
+ and libraries tend to promote this style of programming so that components
64
+ render useful content under all states (loading, success, error and so on).
65
+
66
+ The general pattern when calling standalone functions looks like this:
67
+
68
+ ```typescript
69
+ import { Core } from "<sdk-package-name>";
70
+ import { fetchSomething } from "<sdk-package-name>/funcs/fetchSomething.js";
71
+
72
+ const client = new Core();
73
+
74
+ async function run() {
75
+ const result = await fetchSomething(client, { id: "123" });
76
+ if (!result.ok) {
77
+ // You can throw the error or handle it. It's your choice now.
78
+ throw result.error;
79
+ }
80
+
81
+ console.log(result.value);
82
+ }
83
+
84
+ run();
85
+ ```
86
+
87
+ Notably, `result.error` above will have an explicit type compared to a try-catch
88
+ variation where the error in the catch block can only be of type `unknown` (or
89
+ `any` depending on your TypeScript settings).
package/README.md ADDED
@@ -0,0 +1,429 @@
1
+ # @usenotra/sdk
2
+
3
+ Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@usenotra/sdk* API.
4
+
5
+ [![Built by Speakeasy](https://img.shields.io/badge/Built_by-SPEAKEASY-374151?style=for-the-badge&labelColor=f3f4f6)](https://www.speakeasy.com/?utm_source=@usenotra/sdk&utm_campaign=typescript)
6
+ [![License: MIT](https://img.shields.io/badge/LICENSE_//_MIT-3b5bdb?style=for-the-badge&labelColor=eff6ff)](https://opensource.org/licenses/MIT)
7
+
8
+
9
+ <br /><br />
10
+ > [!IMPORTANT]
11
+ > 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/notra/notra). Delete this section before > publishing to a package manager.
12
+
13
+ <!-- Start Summary [summary] -->
14
+ ## Summary
15
+
16
+ Notra API: OpenAPI schema for authenticated content endpoints.
17
+ <!-- End Summary [summary] -->
18
+
19
+ <!-- Start Table of Contents [toc] -->
20
+ ## Table of Contents
21
+ <!-- $toc-max-depth=2 -->
22
+ * [@usenotra/sdk](#usenotrasdk)
23
+ * [SDK Installation](#sdk-installation)
24
+ * [Requirements](#requirements)
25
+ * [SDK Example Usage](#sdk-example-usage)
26
+ * [Authentication](#authentication)
27
+ * [Available Resources and Operations](#available-resources-and-operations)
28
+ * [Standalone functions](#standalone-functions)
29
+ * [Retries](#retries)
30
+ * [Error Handling](#error-handling)
31
+ * [Server Selection](#server-selection)
32
+ * [Custom HTTP Client](#custom-http-client)
33
+ * [Debugging](#debugging)
34
+ * [Development](#development)
35
+ * [Maturity](#maturity)
36
+ * [Contributions](#contributions)
37
+
38
+ <!-- End Table of Contents [toc] -->
39
+
40
+ <!-- Start SDK Installation [installation] -->
41
+ ## SDK Installation
42
+
43
+ > [!TIP]
44
+ > To finish publishing your SDK to npm and others you must [run your first generation action](https://www.speakeasy.com/docs/github-setup#step-by-step-guide).
45
+
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 <UNSET>
53
+ ```
54
+
55
+ ### PNPM
56
+
57
+ ```bash
58
+ pnpm add <UNSET>
59
+ ```
60
+
61
+ ### Bun
62
+
63
+ ```bash
64
+ bun add <UNSET>
65
+ ```
66
+
67
+ ### Yarn
68
+
69
+ ```bash
70
+ yarn add <UNSET>
71
+ ```
72
+
73
+ > [!NOTE]
74
+ > This package is published with CommonJS and ES Modules (ESM) support.
75
+ <!-- End SDK Installation [installation] -->
76
+
77
+ <!-- Start Requirements [requirements] -->
78
+ ## Requirements
79
+
80
+ For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).
81
+ <!-- End Requirements [requirements] -->
82
+
83
+ <!-- Start SDK Example Usage [usage] -->
84
+ ## SDK Example Usage
85
+
86
+ ### Example
87
+
88
+ ```typescript
89
+ import { Notra } from "@usenotra/sdk";
90
+
91
+ const notra = new Notra({
92
+ bearerAuth: process.env["NOTRA_BEARER_AUTH"] ?? "",
93
+ });
94
+
95
+ async function run() {
96
+ const result = await notra.content.listPosts({
97
+ organizationId: "org_123",
98
+ });
99
+
100
+ console.log(result);
101
+ }
102
+
103
+ run();
104
+
105
+ ```
106
+ <!-- End SDK Example Usage [usage] -->
107
+
108
+ <!-- Start Authentication [security] -->
109
+ ## Authentication
110
+
111
+ ### Per-Client Security Schemes
112
+
113
+ This SDK supports the following security scheme globally:
114
+
115
+ | Name | Type | Scheme | Environment Variable |
116
+ | ------------ | ---- | ----------- | -------------------- |
117
+ | `bearerAuth` | http | HTTP Bearer | `NOTRA_BEARER_AUTH` |
118
+
119
+ To authenticate with the API the `bearerAuth` parameter must be set when initializing the SDK client instance. For example:
120
+ ```typescript
121
+ import { Notra } from "@usenotra/sdk";
122
+
123
+ const notra = new Notra({
124
+ bearerAuth: process.env["NOTRA_BEARER_AUTH"] ?? "",
125
+ });
126
+
127
+ async function run() {
128
+ const result = await notra.content.listPosts({
129
+ organizationId: "org_123",
130
+ });
131
+
132
+ console.log(result);
133
+ }
134
+
135
+ run();
136
+
137
+ ```
138
+ <!-- End Authentication [security] -->
139
+
140
+ <!-- Start Available Resources and Operations [operations] -->
141
+ ## Available Resources and Operations
142
+
143
+ <details open>
144
+ <summary>Available methods</summary>
145
+
146
+ ### [Content](docs/sdks/content/README.md)
147
+
148
+ * [listPosts](docs/sdks/content/README.md#listposts) - List posts
149
+ * [getPost](docs/sdks/content/README.md#getpost) - Get a single post
150
+
151
+ </details>
152
+ <!-- End Available Resources and Operations [operations] -->
153
+
154
+ <!-- Start Standalone functions [standalone-funcs] -->
155
+ ## Standalone functions
156
+
157
+ All the methods listed above are available as standalone functions. These
158
+ functions are ideal for use in applications running in the browser, serverless
159
+ runtimes or other environments where application bundle size is a primary
160
+ concern. When using a bundler to build your application, all unused
161
+ functionality will be either excluded from the final bundle or tree-shaken away.
162
+
163
+ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
164
+
165
+ <details>
166
+
167
+ <summary>Available standalone functions</summary>
168
+
169
+ - [`contentGetPost`](docs/sdks/content/README.md#getpost) - Get a single post
170
+ - [`contentListPosts`](docs/sdks/content/README.md#listposts) - List posts
171
+
172
+ </details>
173
+ <!-- End Standalone functions [standalone-funcs] -->
174
+
175
+ <!-- Start Retries [retries] -->
176
+ ## Retries
177
+
178
+ 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.
179
+
180
+ To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
181
+ ```typescript
182
+ import { Notra } from "@usenotra/sdk";
183
+
184
+ const notra = new Notra({
185
+ bearerAuth: process.env["NOTRA_BEARER_AUTH"] ?? "",
186
+ });
187
+
188
+ async function run() {
189
+ const result = await notra.content.listPosts({
190
+ organizationId: "org_123",
191
+ }, {
192
+ retries: {
193
+ strategy: "backoff",
194
+ backoff: {
195
+ initialInterval: 1,
196
+ maxInterval: 50,
197
+ exponent: 1.1,
198
+ maxElapsedTime: 100,
199
+ },
200
+ retryConnectionErrors: false,
201
+ },
202
+ });
203
+
204
+ console.log(result);
205
+ }
206
+
207
+ run();
208
+
209
+ ```
210
+
211
+ If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
212
+ ```typescript
213
+ import { Notra } from "@usenotra/sdk";
214
+
215
+ const notra = new Notra({
216
+ retryConfig: {
217
+ strategy: "backoff",
218
+ backoff: {
219
+ initialInterval: 1,
220
+ maxInterval: 50,
221
+ exponent: 1.1,
222
+ maxElapsedTime: 100,
223
+ },
224
+ retryConnectionErrors: false,
225
+ },
226
+ bearerAuth: process.env["NOTRA_BEARER_AUTH"] ?? "",
227
+ });
228
+
229
+ async function run() {
230
+ const result = await notra.content.listPosts({
231
+ organizationId: "org_123",
232
+ });
233
+
234
+ console.log(result);
235
+ }
236
+
237
+ run();
238
+
239
+ ```
240
+ <!-- End Retries [retries] -->
241
+
242
+ <!-- Start Error Handling [errors] -->
243
+ ## Error Handling
244
+
245
+ [`NotraError`](./src/models/errors/notra-error.ts) is the base class for all HTTP error responses. It has the following properties:
246
+
247
+ | Property | Type | Description |
248
+ | ------------------- | ---------- | --------------------------------------------------------------------------------------- |
249
+ | `error.message` | `string` | Error message |
250
+ | `error.statusCode` | `number` | HTTP response status code eg `404` |
251
+ | `error.headers` | `Headers` | HTTP response headers |
252
+ | `error.body` | `string` | HTTP body. Can be empty string if no body is returned. |
253
+ | `error.rawResponse` | `Response` | Raw HTTP response |
254
+ | `error.data$` | | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). |
255
+
256
+ ### Example
257
+ ```typescript
258
+ import { Notra } from "@usenotra/sdk";
259
+ import * as errors from "@usenotra/sdk/models/errors";
260
+
261
+ const notra = new Notra({
262
+ bearerAuth: process.env["NOTRA_BEARER_AUTH"] ?? "",
263
+ });
264
+
265
+ async function run() {
266
+ try {
267
+ const result = await notra.content.listPosts({
268
+ organizationId: "org_123",
269
+ });
270
+
271
+ console.log(result);
272
+ } catch (error) {
273
+ // The base class for HTTP error responses
274
+ if (error instanceof errors.NotraError) {
275
+ console.log(error.message);
276
+ console.log(error.statusCode);
277
+ console.log(error.body);
278
+ console.log(error.headers);
279
+
280
+ // Depending on the method different errors may be thrown
281
+ if (error instanceof errors.ErrorResponse) {
282
+ console.log(error.data$.error); // string
283
+ }
284
+ }
285
+ }
286
+ }
287
+
288
+ run();
289
+
290
+ ```
291
+
292
+ ### Error Classes
293
+ **Primary errors:**
294
+ * [`NotraError`](./src/models/errors/notra-error.ts): The base class for HTTP error responses.
295
+ * [`ErrorResponse`](./src/models/errors/error-response.ts): Invalid path params or query.
296
+
297
+ <details><summary>Less common errors (6)</summary>
298
+
299
+ <br />
300
+
301
+ **Network errors:**
302
+ * [`ConnectionError`](./src/models/errors/http-client-errors.ts): HTTP client was unable to make a request to a server.
303
+ * [`RequestTimeoutError`](./src/models/errors/http-client-errors.ts): HTTP request timed out due to an AbortSignal signal.
304
+ * [`RequestAbortedError`](./src/models/errors/http-client-errors.ts): HTTP request was aborted by the client.
305
+ * [`InvalidRequestError`](./src/models/errors/http-client-errors.ts): Any input used to create a request is invalid.
306
+ * [`UnexpectedClientError`](./src/models/errors/http-client-errors.ts): Unrecognised or unexpected error.
307
+
308
+
309
+ **Inherit from [`NotraError`](./src/models/errors/notra-error.ts)**:
310
+ * [`ResponseValidationError`](./src/models/errors/response-validation-error.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.
311
+
312
+ </details>
313
+ <!-- End Error Handling [errors] -->
314
+
315
+ <!-- Start Server Selection [server] -->
316
+ ## Server Selection
317
+
318
+ ### Override Server URL Per-Client
319
+
320
+ The default server can be overridden globally by passing a URL to the `serverURL: string` optional parameter when initializing the SDK client instance. For example:
321
+ ```typescript
322
+ import { Notra } from "@usenotra/sdk";
323
+
324
+ const notra = new Notra({
325
+ serverURL: "https://api.usenotra.com",
326
+ bearerAuth: process.env["NOTRA_BEARER_AUTH"] ?? "",
327
+ });
328
+
329
+ async function run() {
330
+ const result = await notra.content.listPosts({
331
+ organizationId: "org_123",
332
+ });
333
+
334
+ console.log(result);
335
+ }
336
+
337
+ run();
338
+
339
+ ```
340
+ <!-- End Server Selection [server] -->
341
+
342
+ <!-- Start Custom HTTP Client [http-client] -->
343
+ ## Custom HTTP Client
344
+
345
+ The TypeScript SDK makes API calls using an `HTTPClient` that wraps the native
346
+ [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). This
347
+ client is a thin wrapper around `fetch` and provides the ability to attach hooks
348
+ around the request lifecycle that can be used to modify the request or handle
349
+ errors and response.
350
+
351
+ The `HTTPClient` constructor takes an optional `fetcher` argument that can be
352
+ used to integrate a third-party HTTP client or when writing tests to mock out
353
+ the HTTP client and feed in fixtures.
354
+
355
+ The following example shows how to:
356
+ - route requests through a proxy server using [undici](https://www.npmjs.com/package/undici)'s ProxyAgent
357
+ - use the `"beforeRequest"` hook to add a custom header and a timeout to requests
358
+ - use the `"requestError"` hook to log errors
359
+
360
+ ```typescript
361
+ import { Notra } from "@usenotra/sdk";
362
+ import { ProxyAgent } from "undici";
363
+ import { HTTPClient } from "@usenotra/sdk/lib/http";
364
+
365
+ const dispatcher = new ProxyAgent("http://proxy.example.com:8080");
366
+
367
+ const httpClient = new HTTPClient({
368
+ // 'fetcher' takes a function that has the same signature as native 'fetch'.
369
+ fetcher: (input, init) =>
370
+ // 'dispatcher' is specific to undici and not part of the standard Fetch API.
371
+ fetch(input, { ...init, dispatcher } as RequestInit),
372
+ });
373
+
374
+ httpClient.addHook("beforeRequest", (request) => {
375
+ const nextRequest = new Request(request, {
376
+ signal: request.signal || AbortSignal.timeout(5000)
377
+ });
378
+
379
+ nextRequest.headers.set("x-custom-header", "custom value");
380
+
381
+ return nextRequest;
382
+ });
383
+
384
+ httpClient.addHook("requestError", (error, request) => {
385
+ console.group("Request Error");
386
+ console.log("Reason:", `${error}`);
387
+ console.log("Endpoint:", `${request.method} ${request.url}`);
388
+ console.groupEnd();
389
+ });
390
+
391
+ const sdk = new Notra({ httpClient: httpClient });
392
+ ```
393
+ <!-- End Custom HTTP Client [http-client] -->
394
+
395
+ <!-- Start Debugging [debug] -->
396
+ ## Debugging
397
+
398
+ You can setup your SDK to emit debug logs for SDK requests and responses.
399
+
400
+ You can pass a logger that matches `console`'s interface as an SDK option.
401
+
402
+ > [!WARNING]
403
+ > 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.
404
+
405
+ ```typescript
406
+ import { Notra } from "@usenotra/sdk";
407
+
408
+ const sdk = new Notra({ debugLogger: console });
409
+ ```
410
+
411
+ You can also enable a default debug logger by setting an environment variable `NOTRA_DEBUG` to true.
412
+ <!-- End Debugging [debug] -->
413
+
414
+ <!-- Placeholder for Future Speakeasy SDK Sections -->
415
+
416
+ # Development
417
+
418
+ ## Maturity
419
+
420
+ This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage
421
+ to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally
422
+ looking for the latest version.
423
+
424
+ ## Contributions
425
+
426
+ 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.
427
+ 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.
428
+
429
+ ### SDK Created by [Speakeasy](https://www.speakeasy.com/?utm_source=@usenotra/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 NotraCore 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,SAAU,SAAQ,SAAS;CAAG"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ /*
3
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.NotraCore = void 0;
7
+ const sdks_js_1 = require("./lib/sdks.js");
8
+ /**
9
+ * A minimal client to use when calling standalone SDK functions. Typically, an
10
+ * instance of this class would be instantiated once at the start of an
11
+ * application and passed around through some dependency injection mechanism to
12
+ * parts of an application that need to make SDK calls.
13
+ */
14
+ class NotraCore extends sdks_js_1.ClientSDK {
15
+ }
16
+ exports.NotraCore = NotraCore;
17
+ //# sourceMappingURL=core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.js","sourceRoot":"","sources":["../../src/core.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,2CAA0C;AAE1C;;;;;GAKG;AACH,MAAa,SAAU,SAAQ,mBAAS;CAAG;AAA3C,8BAA2C"}
@@ -0,0 +1,15 @@
1
+ import { NotraCore } from "../core.js";
2
+ import { RequestOptions } from "../lib/sdks.js";
3
+ import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/http-client-errors.js";
4
+ import * as errors from "../models/errors/index.js";
5
+ import { NotraError } from "../models/errors/notra-error.js";
6
+ import { ResponseValidationError } from "../models/errors/response-validation-error.js";
7
+ import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
8
+ import * as operations from "../models/operations/index.js";
9
+ import { APIPromise } from "../types/async.js";
10
+ import { Result } from "../types/fp.js";
11
+ /**
12
+ * Get a single post
13
+ */
14
+ export declare function contentGetPost(client: NotraCore, request: operations.GetPostRequest, options?: RequestOptions): APIPromise<Result<operations.GetPostResponse, errors.ErrorResponse | NotraError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
15
+ //# sourceMappingURL=content-get-post.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-get-post.d.ts","sourceRoot":"","sources":["../../../src/funcs/content-get-post.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAKvC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAC9E,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;GAEG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,UAAU,CAAC,cAAc,EAClC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,UAAU,CAAC,eAAe,EACxB,MAAM,CAAC,aAAa,GACpB,UAAU,GACV,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CACrB,CACF,CAMA"}