@fern-api/venus-api-sdk 0.22.4 → 0.22.34

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 (305) hide show
  1. package/README.md +270 -0
  2. package/dist/cjs/BaseClient.d.ts +17 -4
  3. package/dist/cjs/BaseClient.js +59 -0
  4. package/dist/cjs/Client.d.ts +19 -16
  5. package/dist/cjs/Client.js +15 -50
  6. package/dist/cjs/api/resources/apiKeys/client/Client.d.ts +16 -17
  7. package/dist/cjs/api/resources/apiKeys/client/Client.js +41 -34
  8. package/dist/cjs/api/resources/apiKeys/client/create.js +1 -1
  9. package/dist/cjs/api/resources/apiKeys/client/getTokenMetadata.js +1 -1
  10. package/dist/cjs/api/resources/apiKeys/client/getTokensForOrganization.js +1 -1
  11. package/dist/cjs/api/resources/apiKeys/client/revokeToken.js +1 -1
  12. package/dist/cjs/api/resources/apiKeys/client/revokeTokenById.js +1 -1
  13. package/dist/cjs/api/resources/auth/client/Client.d.ts +69 -0
  14. package/dist/cjs/api/resources/auth/client/Client.js +295 -0
  15. package/dist/cjs/api/resources/auth/client/getAutopilotToken.d.ts +24 -0
  16. package/dist/cjs/api/resources/auth/client/getAutopilotToken.js +65 -0
  17. package/dist/cjs/api/resources/auth/client/getJwt.d.ts +24 -0
  18. package/dist/cjs/api/resources/auth/client/getJwt.js +65 -0
  19. package/dist/cjs/api/resources/auth/client/getOrgForGithubOwner.d.ts +19 -0
  20. package/dist/cjs/api/resources/auth/client/getOrgForGithubOwner.js +55 -0
  21. package/dist/cjs/api/resources/auth/client/index.d.ts +4 -0
  22. package/dist/cjs/api/resources/auth/client/index.js +43 -0
  23. package/dist/cjs/api/resources/auth/client/requests/GetAutopilotTokenRequest.d.ts +22 -0
  24. package/dist/cjs/api/resources/auth/client/requests/GetAutopilotTokenRequest.js +3 -0
  25. package/dist/cjs/api/resources/auth/client/requests/GetJwtRequest.d.ts +16 -0
  26. package/dist/cjs/api/resources/auth/client/requests/GetJwtRequest.js +3 -0
  27. package/dist/cjs/api/resources/auth/client/requests/index.d.ts +2 -0
  28. package/dist/cjs/api/resources/auth/client/requests/index.js +2 -0
  29. package/dist/cjs/api/resources/auth/index.d.ts +2 -0
  30. package/dist/cjs/api/resources/auth/index.js +18 -0
  31. package/dist/cjs/api/resources/auth/types/JwtResponse.d.ts +11 -0
  32. package/dist/cjs/api/resources/auth/types/JwtResponse.js +3 -0
  33. package/dist/cjs/api/resources/auth/types/index.d.ts +1 -0
  34. package/dist/cjs/api/resources/auth/types/index.js +17 -0
  35. package/dist/cjs/api/resources/index.d.ts +3 -0
  36. package/dist/cjs/api/resources/index.js +4 -1
  37. package/dist/cjs/api/resources/organization/client/Client.d.ts +37 -27
  38. package/dist/cjs/api/resources/organization/client/Client.js +152 -60
  39. package/dist/cjs/api/resources/organization/client/addUser.js +1 -1
  40. package/dist/cjs/api/resources/organization/client/create.js +1 -1
  41. package/dist/cjs/api/resources/organization/client/delete.js +1 -1
  42. package/dist/cjs/api/resources/organization/client/get.js +1 -1
  43. package/dist/cjs/api/resources/organization/client/getByPostmanTeamId.d.ts +24 -0
  44. package/dist/cjs/api/resources/organization/client/getByPostmanTeamId.js +65 -0
  45. package/dist/cjs/api/resources/organization/client/getMyOrganizationFromScopedToken.js +1 -1
  46. package/dist/cjs/api/resources/organization/client/getOrgIdsFromToken.js +1 -1
  47. package/dist/cjs/api/resources/organization/client/index.d.ts +1 -0
  48. package/dist/cjs/api/resources/organization/client/index.js +2 -1
  49. package/dist/cjs/api/resources/organization/client/inviteUser.js +1 -1
  50. package/dist/cjs/api/resources/organization/client/isMember.js +1 -1
  51. package/dist/cjs/api/resources/organization/client/removeUser.js +1 -1
  52. package/dist/cjs/api/resources/organization/client/requests/CreateOrganizationRequest.d.ts +8 -0
  53. package/dist/cjs/api/resources/organization/client/update.js +1 -1
  54. package/dist/cjs/api/resources/organization/types/Organization.d.ts +2 -0
  55. package/dist/cjs/api/resources/registry/client/Client.d.ts +12 -13
  56. package/dist/cjs/api/resources/registry/client/Client.js +28 -26
  57. package/dist/cjs/api/resources/registry/client/generateRegistryTokens.d.ts +6 -1
  58. package/dist/cjs/api/resources/registry/client/generateRegistryTokens.js +11 -1
  59. package/dist/cjs/api/resources/registry/client/hasRegistryPermission.js +1 -1
  60. package/dist/cjs/api/resources/registry/client/revokeToken.d.ts +6 -1
  61. package/dist/cjs/api/resources/registry/client/revokeToken.js +11 -1
  62. package/dist/cjs/api/resources/user/client/Client.d.ts +12 -13
  63. package/dist/cjs/api/resources/user/client/Client.js +27 -25
  64. package/dist/cjs/api/resources/user/client/getMyOrganizations.js +1 -1
  65. package/dist/cjs/api/resources/user/client/getMyself.js +1 -1
  66. package/dist/cjs/api/resources/user/client/linkAccounts.js +1 -1
  67. package/dist/cjs/auth/BearerAuthProvider.d.ts +20 -0
  68. package/dist/cjs/auth/BearerAuthProvider.js +76 -0
  69. package/dist/cjs/auth/index.d.ts +1 -0
  70. package/dist/cjs/auth/index.js +5 -0
  71. package/dist/cjs/core/auth/AuthProvider.d.ts +4 -1
  72. package/dist/cjs/core/auth/BearerToken.d.ts +3 -1
  73. package/dist/cjs/core/auth/BearerToken.js +7 -6
  74. package/dist/cjs/core/auth/NoOpAuthProvider.d.ts +5 -0
  75. package/dist/cjs/core/auth/NoOpAuthProvider.js +9 -0
  76. package/dist/cjs/core/auth/index.d.ts +1 -0
  77. package/dist/cjs/core/auth/index.js +3 -1
  78. package/dist/cjs/core/exports.d.ts +1 -0
  79. package/dist/cjs/core/exports.js +17 -0
  80. package/dist/cjs/core/fetcher/BinaryResponse.d.ts +6 -7
  81. package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +2 -2
  82. package/dist/cjs/core/fetcher/Fetcher.d.ts +10 -4
  83. package/dist/cjs/core/fetcher/Fetcher.js +210 -10
  84. package/dist/cjs/core/fetcher/getRequestBody.d.ts +1 -1
  85. package/dist/cjs/core/fetcher/getRequestBody.js +4 -0
  86. package/dist/cjs/core/fetcher/getResponseBody.js +18 -4
  87. package/dist/cjs/core/fetcher/makeRequest.d.ts +1 -1
  88. package/dist/cjs/core/fetcher/makeRequest.js +0 -2
  89. package/dist/cjs/core/fetcher/requestWithRetries.js +0 -9
  90. package/dist/cjs/core/fetcher/signals.d.ts +1 -7
  91. package/dist/cjs/core/fetcher/signals.js +0 -12
  92. package/dist/cjs/core/headers.d.ts +2 -2
  93. package/dist/cjs/core/headers.js +6 -4
  94. package/dist/cjs/core/index.d.ts +1 -0
  95. package/dist/cjs/core/index.js +2 -1
  96. package/dist/cjs/core/logging/exports.d.ts +18 -0
  97. package/dist/cjs/core/logging/exports.js +45 -0
  98. package/dist/cjs/core/logging/index.d.ts +1 -0
  99. package/dist/cjs/core/logging/index.js +17 -0
  100. package/dist/cjs/core/logging/logger.d.ts +126 -0
  101. package/dist/cjs/core/logging/logger.js +144 -0
  102. package/dist/cjs/core/runtime/runtime.js +11 -10
  103. package/dist/cjs/core/schemas/Schema.d.ts +1 -0
  104. package/dist/cjs/core/schemas/Schema.js +1 -0
  105. package/dist/cjs/core/schemas/builders/object/object.js +34 -3
  106. package/dist/cjs/core/schemas/builders/primitives/index.d.ts +1 -0
  107. package/dist/cjs/core/schemas/builders/primitives/index.js +3 -1
  108. package/dist/cjs/core/schemas/builders/primitives/never.d.ts +2 -0
  109. package/dist/cjs/core/schemas/builders/primitives/never.js +14 -0
  110. package/dist/cjs/core/url/join.js +0 -1
  111. package/dist/cjs/exports.d.ts +1 -0
  112. package/dist/cjs/exports.js +17 -0
  113. package/dist/cjs/index.d.ts +1 -0
  114. package/dist/cjs/index.js +4 -0
  115. package/dist/cjs/serialization/resources/auth/client/getAutopilotToken.d.ts +10 -0
  116. package/dist/cjs/serialization/resources/auth/client/getAutopilotToken.js +66 -0
  117. package/dist/cjs/serialization/resources/auth/client/getJwt.d.ts +10 -0
  118. package/dist/cjs/serialization/resources/auth/client/getJwt.js +66 -0
  119. package/dist/cjs/serialization/resources/auth/client/getOrgForGithubOwner.d.ts +8 -0
  120. package/dist/cjs/serialization/resources/auth/client/getOrgForGithubOwner.js +6 -0
  121. package/dist/cjs/serialization/resources/auth/client/index.d.ts +4 -0
  122. package/dist/cjs/serialization/resources/auth/client/index.js +43 -0
  123. package/dist/cjs/serialization/resources/auth/client/requests/GetAutopilotTokenRequest.d.ts +11 -0
  124. package/dist/cjs/serialization/resources/auth/client/requests/GetAutopilotTokenRequest.js +43 -0
  125. package/dist/cjs/serialization/resources/auth/client/requests/GetJwtRequest.d.ts +10 -0
  126. package/dist/cjs/serialization/resources/auth/client/requests/GetJwtRequest.js +42 -0
  127. package/dist/cjs/serialization/resources/auth/client/requests/index.d.ts +2 -0
  128. package/dist/cjs/serialization/resources/auth/client/requests/index.js +7 -0
  129. package/dist/cjs/serialization/resources/auth/index.d.ts +2 -0
  130. package/dist/cjs/serialization/resources/auth/index.js +18 -0
  131. package/dist/cjs/serialization/resources/auth/types/JwtResponse.d.ts +10 -0
  132. package/dist/cjs/serialization/resources/auth/types/JwtResponse.js +42 -0
  133. package/dist/cjs/serialization/resources/auth/types/index.d.ts +1 -0
  134. package/dist/cjs/serialization/resources/auth/types/index.js +17 -0
  135. package/dist/cjs/serialization/resources/index.d.ts +3 -0
  136. package/dist/cjs/serialization/resources/index.js +4 -1
  137. package/dist/cjs/serialization/resources/organization/client/getByPostmanTeamId.d.ts +10 -0
  138. package/dist/cjs/serialization/resources/organization/client/getByPostmanTeamId.js +66 -0
  139. package/dist/cjs/serialization/resources/organization/client/index.d.ts +1 -0
  140. package/dist/cjs/serialization/resources/organization/client/index.js +2 -1
  141. package/dist/cjs/serialization/resources/organization/client/requests/CreateOrganizationRequest.d.ts +2 -0
  142. package/dist/cjs/serialization/resources/organization/client/requests/CreateOrganizationRequest.js +2 -0
  143. package/dist/cjs/serialization/resources/organization/types/Organization.d.ts +1 -0
  144. package/dist/cjs/serialization/resources/organization/types/Organization.js +1 -0
  145. package/dist/cjs/serialization/resources/registry/client/generateRegistryTokens.d.ts +4 -1
  146. package/dist/cjs/serialization/resources/registry/client/generateRegistryTokens.js +3 -0
  147. package/dist/cjs/serialization/resources/registry/client/revokeToken.d.ts +4 -1
  148. package/dist/cjs/serialization/resources/registry/client/revokeToken.js +3 -0
  149. package/dist/cjs/version.d.ts +1 -1
  150. package/dist/cjs/version.js +1 -1
  151. package/dist/esm/BaseClient.d.mts +17 -4
  152. package/dist/esm/BaseClient.mjs +24 -1
  153. package/dist/esm/Client.d.mts +19 -16
  154. package/dist/esm/Client.mjs +16 -18
  155. package/dist/esm/api/resources/apiKeys/client/Client.d.mts +16 -17
  156. package/dist/esm/api/resources/apiKeys/client/Client.mjs +40 -33
  157. package/dist/esm/api/resources/apiKeys/client/create.mjs +1 -1
  158. package/dist/esm/api/resources/apiKeys/client/getTokenMetadata.mjs +1 -1
  159. package/dist/esm/api/resources/apiKeys/client/getTokensForOrganization.mjs +1 -1
  160. package/dist/esm/api/resources/apiKeys/client/revokeToken.mjs +1 -1
  161. package/dist/esm/api/resources/apiKeys/client/revokeTokenById.mjs +1 -1
  162. package/dist/esm/api/resources/auth/client/Client.d.mts +69 -0
  163. package/dist/esm/api/resources/auth/client/Client.mjs +258 -0
  164. package/dist/esm/api/resources/auth/client/getAutopilotToken.d.mts +24 -0
  165. package/dist/esm/api/resources/auth/client/getAutopilotToken.mjs +29 -0
  166. package/dist/esm/api/resources/auth/client/getJwt.d.mts +24 -0
  167. package/dist/esm/api/resources/auth/client/getJwt.mjs +29 -0
  168. package/dist/esm/api/resources/auth/client/getOrgForGithubOwner.d.mts +19 -0
  169. package/dist/esm/api/resources/auth/client/getOrgForGithubOwner.mjs +19 -0
  170. package/dist/esm/api/resources/auth/client/index.d.mts +4 -0
  171. package/dist/esm/api/resources/auth/client/index.mjs +4 -0
  172. package/dist/esm/api/resources/auth/client/requests/GetAutopilotTokenRequest.d.mts +22 -0
  173. package/dist/esm/api/resources/auth/client/requests/GetAutopilotTokenRequest.mjs +2 -0
  174. package/dist/esm/api/resources/auth/client/requests/GetJwtRequest.d.mts +16 -0
  175. package/dist/esm/api/resources/auth/client/requests/GetJwtRequest.mjs +2 -0
  176. package/dist/esm/api/resources/auth/client/requests/index.d.mts +2 -0
  177. package/dist/esm/api/resources/auth/client/requests/index.mjs +1 -0
  178. package/dist/esm/api/resources/auth/index.d.mts +2 -0
  179. package/dist/esm/api/resources/auth/index.mjs +2 -0
  180. package/dist/esm/api/resources/auth/types/JwtResponse.d.mts +11 -0
  181. package/dist/esm/api/resources/auth/types/JwtResponse.mjs +2 -0
  182. package/dist/esm/api/resources/auth/types/index.d.mts +1 -0
  183. package/dist/esm/api/resources/auth/types/index.mjs +1 -0
  184. package/dist/esm/api/resources/index.d.mts +3 -0
  185. package/dist/esm/api/resources/index.mjs +3 -0
  186. package/dist/esm/api/resources/organization/client/Client.d.mts +37 -27
  187. package/dist/esm/api/resources/organization/client/Client.mjs +151 -59
  188. package/dist/esm/api/resources/organization/client/addUser.mjs +1 -1
  189. package/dist/esm/api/resources/organization/client/create.mjs +1 -1
  190. package/dist/esm/api/resources/organization/client/delete.mjs +1 -1
  191. package/dist/esm/api/resources/organization/client/get.mjs +1 -1
  192. package/dist/esm/api/resources/organization/client/getByPostmanTeamId.d.mts +24 -0
  193. package/dist/esm/api/resources/organization/client/getByPostmanTeamId.mjs +29 -0
  194. package/dist/esm/api/resources/organization/client/getMyOrganizationFromScopedToken.mjs +1 -1
  195. package/dist/esm/api/resources/organization/client/getOrgIdsFromToken.mjs +1 -1
  196. package/dist/esm/api/resources/organization/client/index.d.mts +1 -0
  197. package/dist/esm/api/resources/organization/client/index.mjs +1 -0
  198. package/dist/esm/api/resources/organization/client/inviteUser.mjs +1 -1
  199. package/dist/esm/api/resources/organization/client/isMember.mjs +1 -1
  200. package/dist/esm/api/resources/organization/client/removeUser.mjs +1 -1
  201. package/dist/esm/api/resources/organization/client/requests/CreateOrganizationRequest.d.mts +8 -0
  202. package/dist/esm/api/resources/organization/client/update.mjs +1 -1
  203. package/dist/esm/api/resources/organization/types/Organization.d.mts +2 -0
  204. package/dist/esm/api/resources/registry/client/Client.d.mts +12 -13
  205. package/dist/esm/api/resources/registry/client/Client.mjs +27 -25
  206. package/dist/esm/api/resources/registry/client/generateRegistryTokens.d.mts +6 -1
  207. package/dist/esm/api/resources/registry/client/generateRegistryTokens.mjs +11 -1
  208. package/dist/esm/api/resources/registry/client/hasRegistryPermission.mjs +1 -1
  209. package/dist/esm/api/resources/registry/client/revokeToken.d.mts +6 -1
  210. package/dist/esm/api/resources/registry/client/revokeToken.mjs +11 -1
  211. package/dist/esm/api/resources/user/client/Client.d.mts +12 -13
  212. package/dist/esm/api/resources/user/client/Client.mjs +26 -24
  213. package/dist/esm/api/resources/user/client/getMyOrganizations.mjs +1 -1
  214. package/dist/esm/api/resources/user/client/getMyself.mjs +1 -1
  215. package/dist/esm/api/resources/user/client/linkAccounts.mjs +1 -1
  216. package/dist/esm/auth/BearerAuthProvider.d.mts +20 -0
  217. package/dist/esm/auth/BearerAuthProvider.mjs +39 -0
  218. package/dist/esm/auth/index.d.mts +1 -0
  219. package/dist/esm/auth/index.mjs +1 -0
  220. package/dist/esm/core/auth/AuthProvider.d.mts +4 -1
  221. package/dist/esm/core/auth/BearerToken.d.mts +3 -1
  222. package/dist/esm/core/auth/BearerToken.mjs +7 -6
  223. package/dist/esm/core/auth/NoOpAuthProvider.d.mts +5 -0
  224. package/dist/esm/core/auth/NoOpAuthProvider.mjs +5 -0
  225. package/dist/esm/core/auth/index.d.mts +1 -0
  226. package/dist/esm/core/auth/index.mjs +1 -0
  227. package/dist/esm/core/exports.d.mts +1 -0
  228. package/dist/esm/core/exports.mjs +1 -0
  229. package/dist/esm/core/fetcher/BinaryResponse.d.mts +6 -7
  230. package/dist/esm/core/fetcher/EndpointSupplier.d.mts +2 -2
  231. package/dist/esm/core/fetcher/Fetcher.d.mts +10 -4
  232. package/dist/esm/core/fetcher/Fetcher.mjs +210 -10
  233. package/dist/esm/core/fetcher/getRequestBody.d.mts +1 -1
  234. package/dist/esm/core/fetcher/getRequestBody.mjs +4 -0
  235. package/dist/esm/core/fetcher/getResponseBody.mjs +18 -4
  236. package/dist/esm/core/fetcher/makeRequest.d.mts +1 -1
  237. package/dist/esm/core/fetcher/makeRequest.mjs +0 -2
  238. package/dist/esm/core/fetcher/requestWithRetries.mjs +0 -9
  239. package/dist/esm/core/fetcher/signals.d.mts +1 -7
  240. package/dist/esm/core/fetcher/signals.mjs +0 -12
  241. package/dist/esm/core/headers.d.mts +2 -2
  242. package/dist/esm/core/headers.mjs +6 -4
  243. package/dist/esm/core/index.d.mts +1 -0
  244. package/dist/esm/core/index.mjs +1 -0
  245. package/dist/esm/core/logging/exports.d.mts +18 -0
  246. package/dist/esm/core/logging/exports.mjs +9 -0
  247. package/dist/esm/core/logging/index.d.mts +1 -0
  248. package/dist/esm/core/logging/index.mjs +1 -0
  249. package/dist/esm/core/logging/logger.d.mts +126 -0
  250. package/dist/esm/core/logging/logger.mjs +138 -0
  251. package/dist/esm/core/runtime/runtime.mjs +11 -10
  252. package/dist/esm/core/schemas/Schema.d.mts +1 -0
  253. package/dist/esm/core/schemas/Schema.mjs +1 -0
  254. package/dist/esm/core/schemas/builders/object/object.mjs +34 -3
  255. package/dist/esm/core/schemas/builders/primitives/index.d.mts +1 -0
  256. package/dist/esm/core/schemas/builders/primitives/index.mjs +1 -0
  257. package/dist/esm/core/schemas/builders/primitives/never.d.mts +2 -0
  258. package/dist/esm/core/schemas/builders/primitives/never.mjs +11 -0
  259. package/dist/esm/core/url/join.mjs +0 -1
  260. package/dist/esm/exports.d.mts +1 -0
  261. package/dist/esm/exports.mjs +1 -0
  262. package/dist/esm/index.d.mts +1 -0
  263. package/dist/esm/index.mjs +1 -0
  264. package/dist/esm/serialization/resources/auth/client/getAutopilotToken.d.mts +10 -0
  265. package/dist/esm/serialization/resources/auth/client/getAutopilotToken.mjs +30 -0
  266. package/dist/esm/serialization/resources/auth/client/getJwt.d.mts +10 -0
  267. package/dist/esm/serialization/resources/auth/client/getJwt.mjs +30 -0
  268. package/dist/esm/serialization/resources/auth/client/getOrgForGithubOwner.d.mts +8 -0
  269. package/dist/esm/serialization/resources/auth/client/getOrgForGithubOwner.mjs +3 -0
  270. package/dist/esm/serialization/resources/auth/client/index.d.mts +4 -0
  271. package/dist/esm/serialization/resources/auth/client/index.mjs +4 -0
  272. package/dist/esm/serialization/resources/auth/client/requests/GetAutopilotTokenRequest.d.mts +11 -0
  273. package/dist/esm/serialization/resources/auth/client/requests/GetAutopilotTokenRequest.mjs +7 -0
  274. package/dist/esm/serialization/resources/auth/client/requests/GetJwtRequest.d.mts +10 -0
  275. package/dist/esm/serialization/resources/auth/client/requests/GetJwtRequest.mjs +6 -0
  276. package/dist/esm/serialization/resources/auth/client/requests/index.d.mts +2 -0
  277. package/dist/esm/serialization/resources/auth/client/requests/index.mjs +2 -0
  278. package/dist/esm/serialization/resources/auth/index.d.mts +2 -0
  279. package/dist/esm/serialization/resources/auth/index.mjs +2 -0
  280. package/dist/esm/serialization/resources/auth/types/JwtResponse.d.mts +10 -0
  281. package/dist/esm/serialization/resources/auth/types/JwtResponse.mjs +6 -0
  282. package/dist/esm/serialization/resources/auth/types/index.d.mts +1 -0
  283. package/dist/esm/serialization/resources/auth/types/index.mjs +1 -0
  284. package/dist/esm/serialization/resources/index.d.mts +3 -0
  285. package/dist/esm/serialization/resources/index.mjs +3 -0
  286. package/dist/esm/serialization/resources/organization/client/getByPostmanTeamId.d.mts +10 -0
  287. package/dist/esm/serialization/resources/organization/client/getByPostmanTeamId.mjs +30 -0
  288. package/dist/esm/serialization/resources/organization/client/index.d.mts +1 -0
  289. package/dist/esm/serialization/resources/organization/client/index.mjs +1 -0
  290. package/dist/esm/serialization/resources/organization/client/requests/CreateOrganizationRequest.d.mts +2 -0
  291. package/dist/esm/serialization/resources/organization/client/requests/CreateOrganizationRequest.mjs +2 -0
  292. package/dist/esm/serialization/resources/organization/types/Organization.d.mts +1 -0
  293. package/dist/esm/serialization/resources/organization/types/Organization.mjs +1 -0
  294. package/dist/esm/serialization/resources/registry/client/generateRegistryTokens.d.mts +4 -1
  295. package/dist/esm/serialization/resources/registry/client/generateRegistryTokens.mjs +3 -0
  296. package/dist/esm/serialization/resources/registry/client/revokeToken.d.mts +4 -1
  297. package/dist/esm/serialization/resources/registry/client/revokeToken.mjs +3 -0
  298. package/dist/esm/version.d.mts +1 -1
  299. package/dist/esm/version.mjs +1 -1
  300. package/package.json +8 -3
  301. package/reference.md +1369 -0
  302. package/dist/cjs/core/fetcher/ResponseWithBody.d.ts +0 -4
  303. package/dist/cjs/core/fetcher/ResponseWithBody.js +0 -6
  304. package/dist/esm/core/fetcher/ResponseWithBody.d.mts +0 -4
  305. package/dist/esm/core/fetcher/ResponseWithBody.mjs +0 -3
@@ -33,7 +33,7 @@ export const Error = {
33
33
  case "UserIdDoesNotExistError":
34
34
  return visitor.userIdDoesNotExistError();
35
35
  default:
36
- return visitor._other(value);
36
+ return visitor._other(value.content);
37
37
  }
38
38
  },
39
39
  };
@@ -22,4 +22,12 @@ export interface CreateOrganizationRequest {
22
22
  * This is a field to allow for us to create organizations without this in the future if necessary.
23
23
  */
24
24
  enableGoogleConnection?: boolean;
25
+ /**
26
+ * Allow users to log into the organization with their Postman account.
27
+ * True by default.
28
+ * This is a field to allow for us to create organizations without this in the future if necessary.
29
+ */
30
+ enablePostmanConnection?: boolean;
31
+ /** The Postman team ID to associate with this organization. */
32
+ postmanTeamId?: string;
25
33
  }
@@ -23,7 +23,7 @@ export const Error = {
23
23
  case "UnauthorizedError":
24
24
  return visitor.unauthorizedError();
25
25
  default:
26
- return visitor._other(value);
26
+ return visitor._other(value.content);
27
27
  }
28
28
  },
29
29
  };
@@ -31,4 +31,6 @@ export interface Organization {
31
31
  workosOrganizationId?: string;
32
32
  /** If the organization has self hosted SDKs enabled. */
33
33
  selfHostedSdKs: boolean;
34
+ /** The Postman team ID associated with this organization. */
35
+ postmanTeamId?: string;
34
36
  }
@@ -1,40 +1,40 @@
1
1
  import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
2
3
  import * as core from "../../../../core/index.mjs";
3
4
  import * as FernVenusApi from "../../../index.mjs";
4
- export declare namespace Registry {
5
- interface Options extends BaseClientOptions {
6
- }
5
+ export declare namespace RegistryClient {
6
+ type Options = BaseClientOptions;
7
7
  interface RequestOptions extends BaseRequestOptions {
8
8
  }
9
9
  }
10
- export declare class Registry {
11
- protected readonly _options: Registry.Options;
12
- constructor(_options?: Registry.Options);
10
+ export declare class RegistryClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<RegistryClient.Options>;
12
+ constructor(options?: RegistryClient.Options);
13
13
  /**
14
14
  * @param {FernVenusApi.GenerateRegistryTokensRequest} request
15
- * @param {Registry.RequestOptions} requestOptions - Request-specific configuration.
15
+ * @param {RegistryClient.RequestOptions} requestOptions - Request-specific configuration.
16
16
  *
17
17
  * @example
18
18
  * await client.registry.generateRegistryTokens({
19
19
  * organizationId: "organizationId"
20
20
  * })
21
21
  */
22
- generateRegistryTokens(request: FernVenusApi.GenerateRegistryTokensRequest, requestOptions?: Registry.RequestOptions): core.HttpResponsePromise<core.APIResponse<FernVenusApi.RegistryTokens, FernVenusApi.registry.generateRegistryTokens.Error>>;
22
+ generateRegistryTokens(request: FernVenusApi.GenerateRegistryTokensRequest, requestOptions?: RegistryClient.RequestOptions): core.HttpResponsePromise<core.APIResponse<FernVenusApi.RegistryTokens, FernVenusApi.registry.generateRegistryTokens.Error>>;
23
23
  private __generateRegistryTokens;
24
24
  /**
25
25
  * @param {FernVenusApi.CheckRegistryPermissionRequest} request
26
- * @param {Registry.RequestOptions} requestOptions - Request-specific configuration.
26
+ * @param {RegistryClient.RequestOptions} requestOptions - Request-specific configuration.
27
27
  *
28
28
  * @example
29
29
  * await client.registry.hasRegistryPermission({
30
30
  * organizationId: "organizationId"
31
31
  * })
32
32
  */
33
- hasRegistryPermission(request: FernVenusApi.CheckRegistryPermissionRequest, requestOptions?: Registry.RequestOptions): core.HttpResponsePromise<core.APIResponse<boolean, FernVenusApi.registry.hasRegistryPermission.Error>>;
33
+ hasRegistryPermission(request: FernVenusApi.CheckRegistryPermissionRequest, requestOptions?: RegistryClient.RequestOptions): core.HttpResponsePromise<core.APIResponse<boolean, FernVenusApi.registry.hasRegistryPermission.Error>>;
34
34
  private __hasRegistryPermission;
35
35
  /**
36
36
  * @param {FernVenusApi.RevokeTokenRequest} request
37
- * @param {Registry.RequestOptions} requestOptions - Request-specific configuration.
37
+ * @param {RegistryClient.RequestOptions} requestOptions - Request-specific configuration.
38
38
  *
39
39
  * @example
40
40
  * await client.registry.revokeToken({
@@ -42,7 +42,6 @@ export declare class Registry {
42
42
  * token: "token"
43
43
  * })
44
44
  */
45
- revokeToken(request: FernVenusApi.RevokeTokenRequest, requestOptions?: Registry.RequestOptions): core.HttpResponsePromise<core.APIResponse<void, FernVenusApi.registry.revokeToken.Error>>;
45
+ revokeToken(request: FernVenusApi.RevokeTokenRequest, requestOptions?: RegistryClient.RequestOptions): core.HttpResponsePromise<core.APIResponse<void, FernVenusApi.registry.revokeToken.Error>>;
46
46
  private __revokeToken;
47
- protected _getAuthorizationHeader(): Promise<string | undefined>;
48
47
  }
@@ -8,18 +8,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
11
+ import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
12
+ import { mergeHeaders } from "../../../../core/headers.mjs";
12
13
  import * as core from "../../../../core/index.mjs";
13
14
  import * as environments from "../../../../environments.mjs";
14
15
  import * as serializers from "../../../../serialization/index.mjs";
15
16
  import * as FernVenusApi from "../../../index.mjs";
16
- export class Registry {
17
- constructor(_options = {}) {
18
- this._options = _options;
17
+ export class RegistryClient {
18
+ constructor(options = {}) {
19
+ this._options = normalizeClientOptionsWithAuth(options);
19
20
  }
20
21
  /**
21
22
  * @param {FernVenusApi.GenerateRegistryTokensRequest} request
22
- * @param {Registry.RequestOptions} requestOptions - Request-specific configuration.
23
+ * @param {RegistryClient.RequestOptions} requestOptions - Request-specific configuration.
23
24
  *
24
25
  * @example
25
26
  * await client.registry.generateRegistryTokens({
@@ -31,8 +32,9 @@ export class Registry {
31
32
  }
32
33
  __generateRegistryTokens(request, requestOptions) {
33
34
  return __awaiter(this, void 0, void 0, function* () {
34
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
35
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
35
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
36
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
37
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
36
38
  const _response = yield core.fetcher({
37
39
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FernVenusApiEnvironment.Prod, "/registry/generate-tokens"),
38
40
  method: "POST",
@@ -47,6 +49,8 @@ export class Registry {
47
49
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
48
50
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
49
51
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
52
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
53
+ logging: this._options.logging,
50
54
  });
51
55
  if (_response.ok) {
52
56
  return {
@@ -66,9 +70,10 @@ export class Registry {
66
70
  };
67
71
  }
68
72
  if (_response.error.reason === "status-code") {
69
- switch ((_j = _response.error.body) === null || _j === void 0 ? void 0 : _j.error) {
73
+ switch ((_k = _response.error.body) === null || _k === void 0 ? void 0 : _k.error) {
70
74
  case "UnauthorizedError":
71
75
  case "OrganizationNotFoundError":
76
+ case "MissingOrgPermissionsError":
72
77
  return {
73
78
  data: {
74
79
  ok: false,
@@ -97,7 +102,7 @@ export class Registry {
97
102
  }
98
103
  /**
99
104
  * @param {FernVenusApi.CheckRegistryPermissionRequest} request
100
- * @param {Registry.RequestOptions} requestOptions - Request-specific configuration.
105
+ * @param {RegistryClient.RequestOptions} requestOptions - Request-specific configuration.
101
106
  *
102
107
  * @example
103
108
  * await client.registry.hasRegistryPermission({
@@ -109,8 +114,8 @@ export class Registry {
109
114
  }
110
115
  __hasRegistryPermission(request, requestOptions) {
111
116
  return __awaiter(this, void 0, void 0, function* () {
112
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
113
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
117
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
118
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
114
119
  const _response = yield core.fetcher({
115
120
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FernVenusApiEnvironment.Prod, "/registry/check-permissions"),
116
121
  method: "POST",
@@ -125,6 +130,8 @@ export class Registry {
125
130
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
126
131
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
127
132
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
133
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
134
+ logging: this._options.logging,
128
135
  });
129
136
  if (_response.ok) {
130
137
  return {
@@ -144,7 +151,7 @@ export class Registry {
144
151
  };
145
152
  }
146
153
  if (_response.error.reason === "status-code") {
147
- switch ((_j = _response.error.body) === null || _j === void 0 ? void 0 : _j.error) {
154
+ switch ((_k = _response.error.body) === null || _k === void 0 ? void 0 : _k.error) {
148
155
  case "UnauthorizedError":
149
156
  case "OrganizationNotFoundError":
150
157
  return {
@@ -175,7 +182,7 @@ export class Registry {
175
182
  }
176
183
  /**
177
184
  * @param {FernVenusApi.RevokeTokenRequest} request
178
- * @param {Registry.RequestOptions} requestOptions - Request-specific configuration.
185
+ * @param {RegistryClient.RequestOptions} requestOptions - Request-specific configuration.
179
186
  *
180
187
  * @example
181
188
  * await client.registry.revokeToken({
@@ -188,8 +195,9 @@ export class Registry {
188
195
  }
189
196
  __revokeToken(request, requestOptions) {
190
197
  return __awaiter(this, void 0, void 0, function* () {
191
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
192
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
198
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
199
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
200
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
193
201
  const _response = yield core.fetcher({
194
202
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FernVenusApiEnvironment.Prod, "/registry/revoke-token"),
195
203
  method: "POST",
@@ -204,6 +212,8 @@ export class Registry {
204
212
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
205
213
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
206
214
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
215
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
216
+ logging: this._options.logging,
207
217
  });
208
218
  if (_response.ok) {
209
219
  return {
@@ -217,9 +227,10 @@ export class Registry {
217
227
  };
218
228
  }
219
229
  if (_response.error.reason === "status-code") {
220
- switch ((_j = _response.error.body) === null || _j === void 0 ? void 0 : _j.error) {
230
+ switch ((_k = _response.error.body) === null || _k === void 0 ? void 0 : _k.error) {
221
231
  case "UnauthorizedError":
222
232
  case "OrganizationNotFoundError":
233
+ case "MissingOrgPermissionsError":
223
234
  return {
224
235
  data: {
225
236
  ok: false,
@@ -246,13 +257,4 @@ export class Registry {
246
257
  };
247
258
  });
248
259
  }
249
- _getAuthorizationHeader() {
250
- return __awaiter(this, void 0, void 0, function* () {
251
- const bearer = yield core.Supplier.get(this._options.token);
252
- if (bearer != null) {
253
- return `Bearer ${bearer}`;
254
- }
255
- return undefined;
256
- });
257
- }
258
260
  }
@@ -1,6 +1,6 @@
1
1
  import type * as core from "../../../../core/index.mjs";
2
2
  import * as FernVenusApi from "../../../index.mjs";
3
- export type Error = FernVenusApi.registry.generateRegistryTokens.Error.UnauthorizedError | FernVenusApi.registry.generateRegistryTokens.Error.OrganizationNotFoundError | FernVenusApi.registry.generateRegistryTokens.Error._Unknown;
3
+ export type Error = FernVenusApi.registry.generateRegistryTokens.Error.UnauthorizedError | FernVenusApi.registry.generateRegistryTokens.Error.OrganizationNotFoundError | FernVenusApi.registry.generateRegistryTokens.Error.MissingOrgPermissionsError | FernVenusApi.registry.generateRegistryTokens.Error._Unknown;
4
4
  export declare namespace Error {
5
5
  interface UnauthorizedError extends _Utils {
6
6
  error: "UnauthorizedError";
@@ -8,6 +8,9 @@ export declare namespace Error {
8
8
  interface OrganizationNotFoundError extends _Utils {
9
9
  error: "OrganizationNotFoundError";
10
10
  }
11
+ interface MissingOrgPermissionsError extends _Utils {
12
+ error: "MissingOrgPermissionsError";
13
+ }
11
14
  interface _Unknown extends _Utils {
12
15
  error: void;
13
16
  content: core.Fetcher.Error;
@@ -18,12 +21,14 @@ export declare namespace Error {
18
21
  interface _Visitor<_Result> {
19
22
  unauthorizedError: () => _Result;
20
23
  organizationNotFoundError: () => _Result;
24
+ missingOrgPermissionsError: () => _Result;
21
25
  _other: (value: core.Fetcher.Error) => _Result;
22
26
  }
23
27
  }
24
28
  export declare const Error: {
25
29
  readonly unauthorizedError: () => FernVenusApi.registry.generateRegistryTokens.Error.UnauthorizedError;
26
30
  readonly organizationNotFoundError: () => FernVenusApi.registry.generateRegistryTokens.Error.OrganizationNotFoundError;
31
+ readonly missingOrgPermissionsError: () => FernVenusApi.registry.generateRegistryTokens.Error.MissingOrgPermissionsError;
27
32
  readonly _unknown: (fetcherError: core.Fetcher.Error) => FernVenusApi.registry.generateRegistryTokens.Error._Unknown;
28
33
  readonly _visit: <_Result>(value: FernVenusApi.registry.generateRegistryTokens.Error, visitor: FernVenusApi.registry.generateRegistryTokens.Error._Visitor<_Result>) => _Result;
29
34
  };
@@ -17,6 +17,14 @@ export const Error = {
17
17
  },
18
18
  };
19
19
  },
20
+ missingOrgPermissionsError: () => {
21
+ return {
22
+ error: "MissingOrgPermissionsError",
23
+ _visit: function (visitor) {
24
+ return FernVenusApi.registry.generateRegistryTokens.Error._visit(this, visitor);
25
+ },
26
+ };
27
+ },
20
28
  _unknown: (fetcherError) => {
21
29
  return {
22
30
  error: undefined,
@@ -32,8 +40,10 @@ export const Error = {
32
40
  return visitor.unauthorizedError();
33
41
  case "OrganizationNotFoundError":
34
42
  return visitor.organizationNotFoundError();
43
+ case "MissingOrgPermissionsError":
44
+ return visitor.missingOrgPermissionsError();
35
45
  default:
36
- return visitor._other(value);
46
+ return visitor._other(value.content);
37
47
  }
38
48
  },
39
49
  };
@@ -33,7 +33,7 @@ export const Error = {
33
33
  case "OrganizationNotFoundError":
34
34
  return visitor.organizationNotFoundError();
35
35
  default:
36
- return visitor._other(value);
36
+ return visitor._other(value.content);
37
37
  }
38
38
  },
39
39
  };
@@ -1,6 +1,6 @@
1
1
  import type * as core from "../../../../core/index.mjs";
2
2
  import * as FernVenusApi from "../../../index.mjs";
3
- export type Error = FernVenusApi.registry.revokeToken.Error.UnauthorizedError | FernVenusApi.registry.revokeToken.Error.OrganizationNotFoundError | FernVenusApi.registry.revokeToken.Error._Unknown;
3
+ export type Error = FernVenusApi.registry.revokeToken.Error.UnauthorizedError | FernVenusApi.registry.revokeToken.Error.OrganizationNotFoundError | FernVenusApi.registry.revokeToken.Error.MissingOrgPermissionsError | FernVenusApi.registry.revokeToken.Error._Unknown;
4
4
  export declare namespace Error {
5
5
  interface UnauthorizedError extends _Utils {
6
6
  error: "UnauthorizedError";
@@ -8,6 +8,9 @@ export declare namespace Error {
8
8
  interface OrganizationNotFoundError extends _Utils {
9
9
  error: "OrganizationNotFoundError";
10
10
  }
11
+ interface MissingOrgPermissionsError extends _Utils {
12
+ error: "MissingOrgPermissionsError";
13
+ }
11
14
  interface _Unknown extends _Utils {
12
15
  error: void;
13
16
  content: core.Fetcher.Error;
@@ -18,12 +21,14 @@ export declare namespace Error {
18
21
  interface _Visitor<_Result> {
19
22
  unauthorizedError: () => _Result;
20
23
  organizationNotFoundError: () => _Result;
24
+ missingOrgPermissionsError: () => _Result;
21
25
  _other: (value: core.Fetcher.Error) => _Result;
22
26
  }
23
27
  }
24
28
  export declare const Error: {
25
29
  readonly unauthorizedError: () => FernVenusApi.registry.revokeToken.Error.UnauthorizedError;
26
30
  readonly organizationNotFoundError: () => FernVenusApi.registry.revokeToken.Error.OrganizationNotFoundError;
31
+ readonly missingOrgPermissionsError: () => FernVenusApi.registry.revokeToken.Error.MissingOrgPermissionsError;
27
32
  readonly _unknown: (fetcherError: core.Fetcher.Error) => FernVenusApi.registry.revokeToken.Error._Unknown;
28
33
  readonly _visit: <_Result>(value: FernVenusApi.registry.revokeToken.Error, visitor: FernVenusApi.registry.revokeToken.Error._Visitor<_Result>) => _Result;
29
34
  };
@@ -17,6 +17,14 @@ export const Error = {
17
17
  },
18
18
  };
19
19
  },
20
+ missingOrgPermissionsError: () => {
21
+ return {
22
+ error: "MissingOrgPermissionsError",
23
+ _visit: function (visitor) {
24
+ return FernVenusApi.registry.revokeToken.Error._visit(this, visitor);
25
+ },
26
+ };
27
+ },
20
28
  _unknown: (fetcherError) => {
21
29
  return {
22
30
  error: undefined,
@@ -32,8 +40,10 @@ export const Error = {
32
40
  return visitor.unauthorizedError();
33
41
  case "OrganizationNotFoundError":
34
42
  return visitor.organizationNotFoundError();
43
+ case "MissingOrgPermissionsError":
44
+ return visitor.missingOrgPermissionsError();
35
45
  default:
36
- return visitor._other(value);
46
+ return visitor._other(value.content);
37
47
  }
38
48
  },
39
49
  };
@@ -1,47 +1,46 @@
1
1
  import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
2
3
  import * as core from "../../../../core/index.mjs";
3
4
  import * as FernVenusApi from "../../../index.mjs";
4
- export declare namespace User {
5
- interface Options extends BaseClientOptions {
6
- }
5
+ export declare namespace UserClient {
6
+ type Options = BaseClientOptions;
7
7
  interface RequestOptions extends BaseRequestOptions {
8
8
  }
9
9
  }
10
- export declare class User {
11
- protected readonly _options: User.Options;
12
- constructor(_options?: User.Options);
10
+ export declare class UserClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<UserClient.Options>;
12
+ constructor(options?: UserClient.Options);
13
13
  /**
14
- * @param {User.RequestOptions} requestOptions - Request-specific configuration.
14
+ * @param {UserClient.RequestOptions} requestOptions - Request-specific configuration.
15
15
  *
16
16
  * @example
17
17
  * await client.user.getMyself()
18
18
  */
19
- getMyself(requestOptions?: User.RequestOptions): core.HttpResponsePromise<core.APIResponse<FernVenusApi.User, FernVenusApi.user.getMyself.Error>>;
19
+ getMyself(requestOptions?: UserClient.RequestOptions): core.HttpResponsePromise<core.APIResponse<FernVenusApi.User, FernVenusApi.user.getMyself.Error>>;
20
20
  private __getMyself;
21
21
  /**
22
22
  * @param {FernVenusApi.GetUserOrganizationsRequest} request
23
- * @param {User.RequestOptions} requestOptions - Request-specific configuration.
23
+ * @param {UserClient.RequestOptions} requestOptions - Request-specific configuration.
24
24
  *
25
25
  * @example
26
26
  * await client.user.getMyOrganizations({
27
27
  * pageId: 1
28
28
  * })
29
29
  */
30
- getMyOrganizations(request: FernVenusApi.GetUserOrganizationsRequest, requestOptions?: User.RequestOptions): core.HttpResponsePromise<core.APIResponse<FernVenusApi.OrganizationsPage, FernVenusApi.user.getMyOrganizations.Error>>;
30
+ getMyOrganizations(request: FernVenusApi.GetUserOrganizationsRequest, requestOptions?: UserClient.RequestOptions): core.HttpResponsePromise<core.APIResponse<FernVenusApi.OrganizationsPage, FernVenusApi.user.getMyOrganizations.Error>>;
31
31
  private __getMyOrganizations;
32
32
  /**
33
33
  * Link user accounts with the same verified email address.
34
34
  * Requires admin token authentication.
35
35
  *
36
36
  * @param {FernVenusApi.LinkAccountsRequest} request
37
- * @param {User.RequestOptions} requestOptions - Request-specific configuration.
37
+ * @param {UserClient.RequestOptions} requestOptions - Request-specific configuration.
38
38
  *
39
39
  * @example
40
40
  * await client.user.linkAccounts({
41
41
  * userId: "userId"
42
42
  * })
43
43
  */
44
- linkAccounts(request: FernVenusApi.LinkAccountsRequest, requestOptions?: User.RequestOptions): core.HttpResponsePromise<core.APIResponse<FernVenusApi.LinkAccountsResponse, FernVenusApi.user.linkAccounts.Error>>;
44
+ linkAccounts(request: FernVenusApi.LinkAccountsRequest, requestOptions?: UserClient.RequestOptions): core.HttpResponsePromise<core.APIResponse<FernVenusApi.LinkAccountsResponse, FernVenusApi.user.linkAccounts.Error>>;
45
45
  private __linkAccounts;
46
- protected _getAuthorizationHeader(): Promise<string | undefined>;
47
46
  }
@@ -8,17 +8,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
11
+ import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
12
+ import { mergeHeaders } from "../../../../core/headers.mjs";
12
13
  import * as core from "../../../../core/index.mjs";
13
14
  import * as environments from "../../../../environments.mjs";
14
15
  import * as serializers from "../../../../serialization/index.mjs";
15
16
  import * as FernVenusApi from "../../../index.mjs";
16
- export class User {
17
- constructor(_options = {}) {
18
- this._options = _options;
17
+ export class UserClient {
18
+ constructor(options = {}) {
19
+ this._options = normalizeClientOptionsWithAuth(options);
19
20
  }
20
21
  /**
21
- * @param {User.RequestOptions} requestOptions - Request-specific configuration.
22
+ * @param {UserClient.RequestOptions} requestOptions - Request-specific configuration.
22
23
  *
23
24
  * @example
24
25
  * await client.user.getMyself()
@@ -28,8 +29,9 @@ export class User {
28
29
  }
29
30
  __getMyself(requestOptions) {
30
31
  return __awaiter(this, void 0, void 0, function* () {
31
- var _a, _b, _c, _d, _e, _f, _g, _h;
32
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
32
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
33
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
34
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
33
35
  const _response = yield core.fetcher({
34
36
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FernVenusApiEnvironment.Prod, "/users"),
35
37
  method: "GET",
@@ -38,6 +40,8 @@ export class User {
38
40
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
39
41
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
40
42
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
43
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
44
+ logging: this._options.logging,
41
45
  });
42
46
  if (_response.ok) {
43
47
  return {
@@ -68,7 +72,7 @@ export class User {
68
72
  }
69
73
  /**
70
74
  * @param {FernVenusApi.GetUserOrganizationsRequest} request
71
- * @param {User.RequestOptions} requestOptions - Request-specific configuration.
75
+ * @param {UserClient.RequestOptions} requestOptions - Request-specific configuration.
72
76
  *
73
77
  * @example
74
78
  * await client.user.getMyOrganizations({
@@ -80,11 +84,13 @@ export class User {
80
84
  }
81
85
  __getMyOrganizations(request, requestOptions) {
82
86
  return __awaiter(this, void 0, void 0, function* () {
83
- var _a, _b, _c, _d, _e, _f, _g, _h;
87
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
84
88
  const { pageId } = request;
85
- const _queryParams = {};
86
- _queryParams.pageId = pageId.toString();
87
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
89
+ const _queryParams = {
90
+ pageId,
91
+ };
92
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
93
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
88
94
  const _response = yield core.fetcher({
89
95
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FernVenusApiEnvironment.Prod, "/users/organizations"),
90
96
  method: "GET",
@@ -93,6 +99,8 @@ export class User {
93
99
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
94
100
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
95
101
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
102
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
103
+ logging: this._options.logging,
96
104
  });
97
105
  if (_response.ok) {
98
106
  return {
@@ -126,7 +134,7 @@ export class User {
126
134
  * Requires admin token authentication.
127
135
  *
128
136
  * @param {FernVenusApi.LinkAccountsRequest} request
129
- * @param {User.RequestOptions} requestOptions - Request-specific configuration.
137
+ * @param {UserClient.RequestOptions} requestOptions - Request-specific configuration.
130
138
  *
131
139
  * @example
132
140
  * await client.user.linkAccounts({
@@ -138,8 +146,9 @@ export class User {
138
146
  }
139
147
  __linkAccounts(request, requestOptions) {
140
148
  return __awaiter(this, void 0, void 0, function* () {
141
- var _a, _b, _c, _d, _e, _f, _g, _h;
142
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
149
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
150
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
151
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
143
152
  const _response = yield core.fetcher({
144
153
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FernVenusApiEnvironment.Prod, "/users/link-accounts"),
145
154
  method: "POST",
@@ -154,6 +163,8 @@ export class User {
154
163
  timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
155
164
  maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
156
165
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
166
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
167
+ logging: this._options.logging,
157
168
  });
158
169
  if (_response.ok) {
159
170
  return {
@@ -182,13 +193,4 @@ export class User {
182
193
  };
183
194
  });
184
195
  }
185
- _getAuthorizationHeader() {
186
- return __awaiter(this, void 0, void 0, function* () {
187
- const bearer = yield core.Supplier.get(this._options.token);
188
- if (bearer != null) {
189
- return `Bearer ${bearer}`;
190
- }
191
- return undefined;
192
- });
193
- }
194
196
  }
@@ -13,7 +13,7 @@ export const Error = {
13
13
  _visit: (value, visitor) => {
14
14
  switch (value.error) {
15
15
  default:
16
- return visitor._other(value);
16
+ return visitor._other(value.content);
17
17
  }
18
18
  },
19
19
  };
@@ -13,7 +13,7 @@ export const Error = {
13
13
  _visit: (value, visitor) => {
14
14
  switch (value.error) {
15
15
  default:
16
- return visitor._other(value);
16
+ return visitor._other(value.content);
17
17
  }
18
18
  },
19
19
  };
@@ -13,7 +13,7 @@ export const Error = {
13
13
  _visit: (value, visitor) => {
14
14
  switch (value.error) {
15
15
  default:
16
- return visitor._other(value);
16
+ return visitor._other(value.content);
17
17
  }
18
18
  },
19
19
  };
@@ -0,0 +1,20 @@
1
+ import * as core from "../core/index.mjs";
2
+ declare const TOKEN_PARAM: "token";
3
+ export declare class BearerAuthProvider implements core.AuthProvider {
4
+ private readonly options;
5
+ constructor(options: BearerAuthProvider.Options);
6
+ static canCreate(options: Partial<BearerAuthProvider.Options>): boolean;
7
+ getAuthRequest({ endpointMetadata, }?: {
8
+ endpointMetadata?: core.EndpointMetadata;
9
+ }): Promise<core.AuthRequest>;
10
+ }
11
+ export declare namespace BearerAuthProvider {
12
+ const AUTH_SCHEME: "bearer";
13
+ const AUTH_CONFIG_ERROR_MESSAGE: string;
14
+ type Options = AuthOptions;
15
+ type AuthOptions = {
16
+ [TOKEN_PARAM]?: core.Supplier<core.BearerToken>;
17
+ };
18
+ function createInstance(options: Options): core.AuthProvider;
19
+ }
20
+ export {};