fluidapi 0.0.3

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 (321) hide show
  1. package/FUNCTIONS.md +85 -0
  2. package/README.md +429 -0
  3. package/RUNTIMES.md +48 -0
  4. package/esm/core.d.ts +10 -0
  5. package/esm/core.d.ts.map +1 -0
  6. package/esm/core.js +13 -0
  7. package/esm/core.js.map +1 -0
  8. package/esm/funcs/metadata-get-jwks.d.ts +18 -0
  9. package/esm/funcs/metadata-get-jwks.d.ts.map +1 -0
  10. package/esm/funcs/metadata-get-jwks.js +67 -0
  11. package/esm/funcs/metadata-get-jwks.js.map +1 -0
  12. package/esm/funcs/metadata-health-check.d.ts +15 -0
  13. package/esm/funcs/metadata-health-check.d.ts.map +1 -0
  14. package/esm/funcs/metadata-health-check.js +64 -0
  15. package/esm/funcs/metadata-health-check.js.map +1 -0
  16. package/esm/funcs/tokens-issue-fluid-token.d.ts +25 -0
  17. package/esm/funcs/tokens-issue-fluid-token.d.ts.map +1 -0
  18. package/esm/funcs/tokens-issue-fluid-token.js +87 -0
  19. package/esm/funcs/tokens-issue-fluid-token.js.map +1 -0
  20. package/esm/funcs/tokens-issue-token.d.ts +31 -0
  21. package/esm/funcs/tokens-issue-token.d.ts.map +1 -0
  22. package/esm/funcs/tokens-issue-token.js +93 -0
  23. package/esm/funcs/tokens-issue-token.js.map +1 -0
  24. package/esm/funcs/tokens-issue-user-token.d.ts +37 -0
  25. package/esm/funcs/tokens-issue-user-token.d.ts.map +1 -0
  26. package/esm/funcs/tokens-issue-user-token.js +97 -0
  27. package/esm/funcs/tokens-issue-user-token.js.map +1 -0
  28. package/esm/hooks/hooks.d.ts +25 -0
  29. package/esm/hooks/hooks.d.ts.map +1 -0
  30. package/esm/hooks/hooks.js +82 -0
  31. package/esm/hooks/hooks.js.map +1 -0
  32. package/esm/hooks/index.d.ts +3 -0
  33. package/esm/hooks/index.d.ts.map +1 -0
  34. package/esm/hooks/index.js +6 -0
  35. package/esm/hooks/index.js.map +1 -0
  36. package/esm/hooks/registration.d.ts +3 -0
  37. package/esm/hooks/registration.d.ts.map +1 -0
  38. package/esm/hooks/registration.js +12 -0
  39. package/esm/hooks/registration.js.map +1 -0
  40. package/esm/hooks/types.d.ts +76 -0
  41. package/esm/hooks/types.d.ts.map +1 -0
  42. package/esm/hooks/types.js +5 -0
  43. package/esm/hooks/types.js.map +1 -0
  44. package/esm/index.d.ts +6 -0
  45. package/esm/index.d.ts.map +1 -0
  46. package/esm/index.js +8 -0
  47. package/esm/index.js.map +1 -0
  48. package/esm/lib/base64.d.ts +10 -0
  49. package/esm/lib/base64.d.ts.map +1 -0
  50. package/esm/lib/base64.js +31 -0
  51. package/esm/lib/base64.js.map +1 -0
  52. package/esm/lib/config.d.ts +57 -0
  53. package/esm/lib/config.d.ts.map +1 -0
  54. package/esm/lib/config.js +50 -0
  55. package/esm/lib/config.js.map +1 -0
  56. package/esm/lib/dlv.d.ts +14 -0
  57. package/esm/lib/dlv.d.ts.map +1 -0
  58. package/esm/lib/dlv.js +46 -0
  59. package/esm/lib/dlv.js.map +1 -0
  60. package/esm/lib/encodings.d.ts +53 -0
  61. package/esm/lib/encodings.d.ts.map +1 -0
  62. package/esm/lib/encodings.js +370 -0
  63. package/esm/lib/encodings.js.map +1 -0
  64. package/esm/lib/env.d.ts +14 -0
  65. package/esm/lib/env.d.ts.map +1 -0
  66. package/esm/lib/env.js +43 -0
  67. package/esm/lib/env.js.map +1 -0
  68. package/esm/lib/files.d.ts +13 -0
  69. package/esm/lib/files.d.ts.map +1 -0
  70. package/esm/lib/files.js +73 -0
  71. package/esm/lib/files.js.map +1 -0
  72. package/esm/lib/http.d.ts +67 -0
  73. package/esm/lib/http.d.ts.map +1 -0
  74. package/esm/lib/http.js +209 -0
  75. package/esm/lib/http.js.map +1 -0
  76. package/esm/lib/is-plain-object.d.ts +2 -0
  77. package/esm/lib/is-plain-object.d.ts.map +1 -0
  78. package/esm/lib/is-plain-object.js +38 -0
  79. package/esm/lib/is-plain-object.js.map +1 -0
  80. package/esm/lib/logger.d.ts +6 -0
  81. package/esm/lib/logger.d.ts.map +1 -0
  82. package/esm/lib/logger.js +5 -0
  83. package/esm/lib/logger.js.map +1 -0
  84. package/esm/lib/matchers.d.ts +59 -0
  85. package/esm/lib/matchers.d.ts.map +1 -0
  86. package/esm/lib/matchers.js +202 -0
  87. package/esm/lib/matchers.js.map +1 -0
  88. package/esm/lib/primitives.d.ts +26 -0
  89. package/esm/lib/primitives.d.ts.map +1 -0
  90. package/esm/lib/primitives.js +103 -0
  91. package/esm/lib/primitives.js.map +1 -0
  92. package/esm/lib/retries.d.ts +38 -0
  93. package/esm/lib/retries.d.ts.map +1 -0
  94. package/esm/lib/retries.js +150 -0
  95. package/esm/lib/retries.js.map +1 -0
  96. package/esm/lib/schemas.d.ts +21 -0
  97. package/esm/lib/schemas.d.ts.map +1 -0
  98. package/esm/lib/schemas.js +57 -0
  99. package/esm/lib/schemas.js.map +1 -0
  100. package/esm/lib/sdks.d.ts +63 -0
  101. package/esm/lib/sdks.d.ts.map +1 -0
  102. package/esm/lib/sdks.js +258 -0
  103. package/esm/lib/sdks.js.map +1 -0
  104. package/esm/lib/security.d.ts +80 -0
  105. package/esm/lib/security.d.ts.map +1 -0
  106. package/esm/lib/security.js +122 -0
  107. package/esm/lib/security.js.map +1 -0
  108. package/esm/lib/url.d.ts +5 -0
  109. package/esm/lib/url.d.ts.map +1 -0
  110. package/esm/lib/url.js +22 -0
  111. package/esm/lib/url.js.map +1 -0
  112. package/esm/models/error-response.d.ts +17 -0
  113. package/esm/models/error-response.d.ts.map +1 -0
  114. package/esm/models/error-response.js +15 -0
  115. package/esm/models/error-response.js.map +1 -0
  116. package/esm/models/errors/error-response.d.ts +21 -0
  117. package/esm/models/errors/error-response.d.ts.map +1 -0
  118. package/esm/models/errors/error-response.js +37 -0
  119. package/esm/models/errors/error-response.js.map +1 -0
  120. package/esm/models/errors/fluidapi-default-error.d.ts +10 -0
  121. package/esm/models/errors/fluidapi-default-error.d.ts.map +1 -0
  122. package/esm/models/errors/fluidapi-default-error.js +30 -0
  123. package/esm/models/errors/fluidapi-default-error.js.map +1 -0
  124. package/esm/models/errors/fluidapi-error.d.ts +19 -0
  125. package/esm/models/errors/fluidapi-error.d.ts.map +1 -0
  126. package/esm/models/errors/fluidapi-error.js +26 -0
  127. package/esm/models/errors/fluidapi-error.js.map +1 -0
  128. package/esm/models/errors/http-client-errors.d.ts +44 -0
  129. package/esm/models/errors/http-client-errors.d.ts.map +1 -0
  130. package/esm/models/errors/http-client-errors.js +56 -0
  131. package/esm/models/errors/http-client-errors.js.map +1 -0
  132. package/esm/models/errors/index.d.ts +7 -0
  133. package/esm/models/errors/index.d.ts.map +1 -0
  134. package/esm/models/errors/index.js +10 -0
  135. package/esm/models/errors/index.js.map +1 -0
  136. package/esm/models/errors/response-validation-error.d.ts +26 -0
  137. package/esm/models/errors/response-validation-error.d.ts.map +1 -0
  138. package/esm/models/errors/response-validation-error.js +37 -0
  139. package/esm/models/errors/response-validation-error.js.map +1 -0
  140. package/esm/models/errors/sdk-validation-error.d.ts +21 -0
  141. package/esm/models/errors/sdk-validation-error.d.ts.map +1 -0
  142. package/esm/models/errors/sdk-validation-error.js +52 -0
  143. package/esm/models/errors/sdk-validation-error.js.map +1 -0
  144. package/esm/models/health-response.d.ts +10 -0
  145. package/esm/models/health-response.d.ts.map +1 -0
  146. package/esm/models/health-response.js +14 -0
  147. package/esm/models/health-response.js.map +1 -0
  148. package/esm/models/index.d.ts +8 -0
  149. package/esm/models/index.d.ts.map +1 -0
  150. package/esm/models/index.js +11 -0
  151. package/esm/models/index.js.map +1 -0
  152. package/esm/models/issue-token-request.d.ts +31 -0
  153. package/esm/models/issue-token-request.d.ts.map +1 -0
  154. package/esm/models/issue-token-request.js +27 -0
  155. package/esm/models/issue-token-request.js.map +1 -0
  156. package/esm/models/jwk-set.d.ts +21 -0
  157. package/esm/models/jwk-set.d.ts.map +1 -0
  158. package/esm/models/jwk-set.js +26 -0
  159. package/esm/models/jwk-set.js.map +1 -0
  160. package/esm/models/operations/index.d.ts +4 -0
  161. package/esm/models/operations/index.d.ts.map +1 -0
  162. package/esm/models/operations/index.js +7 -0
  163. package/esm/models/operations/index.js.map +1 -0
  164. package/esm/models/operations/issue-fluid-token.d.ts +15 -0
  165. package/esm/models/operations/issue-fluid-token.d.ts.map +1 -0
  166. package/esm/models/operations/issue-fluid-token.js +16 -0
  167. package/esm/models/operations/issue-fluid-token.js.map +1 -0
  168. package/esm/models/operations/issue-token.d.ts +15 -0
  169. package/esm/models/operations/issue-token.d.ts.map +1 -0
  170. package/esm/models/operations/issue-token.js +16 -0
  171. package/esm/models/operations/issue-token.js.map +1 -0
  172. package/esm/models/operations/issue-user-token.d.ts +15 -0
  173. package/esm/models/operations/issue-user-token.d.ts.map +1 -0
  174. package/esm/models/operations/issue-user-token.js +16 -0
  175. package/esm/models/operations/issue-user-token.js.map +1 -0
  176. package/esm/models/token-data.d.ts +29 -0
  177. package/esm/models/token-data.d.ts.map +1 -0
  178. package/esm/models/token-data.js +30 -0
  179. package/esm/models/token-data.js.map +1 -0
  180. package/esm/models/user-token-data.d.ts +12 -0
  181. package/esm/models/user-token-data.d.ts.map +1 -0
  182. package/esm/models/user-token-data.js +23 -0
  183. package/esm/models/user-token-data.js.map +1 -0
  184. package/esm/models/user-token-request.d.ts +25 -0
  185. package/esm/models/user-token-request.d.ts.map +1 -0
  186. package/esm/models/user-token-request.js +26 -0
  187. package/esm/models/user-token-request.js.map +1 -0
  188. package/esm/sdk/index.d.ts +2 -0
  189. package/esm/sdk/index.d.ts.map +1 -0
  190. package/esm/sdk/index.js +5 -0
  191. package/esm/sdk/index.js.map +1 -0
  192. package/esm/sdk/metadata.d.ts +16 -0
  193. package/esm/sdk/metadata.d.ts.map +1 -0
  194. package/esm/sdk/metadata.js +25 -0
  195. package/esm/sdk/metadata.js.map +1 -0
  196. package/esm/sdk/sdk.d.ts +10 -0
  197. package/esm/sdk/sdk.d.ts.map +1 -0
  198. package/esm/sdk/sdk.js +17 -0
  199. package/esm/sdk/sdk.js.map +1 -0
  200. package/esm/sdk/tokens.d.ts +63 -0
  201. package/esm/sdk/tokens.d.ts.map +1 -0
  202. package/esm/sdk/tokens.js +74 -0
  203. package/esm/sdk/tokens.js.map +1 -0
  204. package/esm/types/async.d.ts +23 -0
  205. package/esm/types/async.d.ts.map +1 -0
  206. package/esm/types/async.js +28 -0
  207. package/esm/types/async.js.map +1 -0
  208. package/esm/types/blobs.d.ts +4 -0
  209. package/esm/types/blobs.d.ts.map +1 -0
  210. package/esm/types/blobs.js +25 -0
  211. package/esm/types/blobs.js.map +1 -0
  212. package/esm/types/const-date-time.d.ts +3 -0
  213. package/esm/types/const-date-time.d.ts.map +1 -0
  214. package/esm/types/const-date-time.js +10 -0
  215. package/esm/types/const-date-time.js.map +1 -0
  216. package/esm/types/default-to-zero-value.d.ts +12 -0
  217. package/esm/types/default-to-zero-value.d.ts.map +1 -0
  218. package/esm/types/default-to-zero-value.js +31 -0
  219. package/esm/types/default-to-zero-value.js.map +1 -0
  220. package/esm/types/enums.d.ts +9 -0
  221. package/esm/types/enums.d.ts.map +1 -0
  222. package/esm/types/enums.js +27 -0
  223. package/esm/types/enums.js.map +1 -0
  224. package/esm/types/fp.d.ts +31 -0
  225. package/esm/types/fp.d.ts.map +1 -0
  226. package/esm/types/fp.js +31 -0
  227. package/esm/types/fp.js.map +1 -0
  228. package/esm/types/index.d.ts +10 -0
  229. package/esm/types/index.d.ts.map +1 -0
  230. package/esm/types/index.js +10 -0
  231. package/esm/types/index.js.map +1 -0
  232. package/esm/types/operations.d.ts +27 -0
  233. package/esm/types/operations.d.ts.map +1 -0
  234. package/esm/types/operations.js +77 -0
  235. package/esm/types/operations.js.map +1 -0
  236. package/esm/types/primitives.d.ts +11 -0
  237. package/esm/types/primitives.d.ts.map +1 -0
  238. package/esm/types/primitives.js +132 -0
  239. package/esm/types/primitives.js.map +1 -0
  240. package/esm/types/rfcdate.d.ts +21 -0
  241. package/esm/types/rfcdate.d.ts.map +1 -0
  242. package/esm/types/rfcdate.js +43 -0
  243. package/esm/types/rfcdate.js.map +1 -0
  244. package/esm/types/smart-union.d.ts +7 -0
  245. package/esm/types/smart-union.d.ts.map +1 -0
  246. package/esm/types/smart-union.js +117 -0
  247. package/esm/types/smart-union.js.map +1 -0
  248. package/esm/types/streams.d.ts +2 -0
  249. package/esm/types/streams.d.ts.map +1 -0
  250. package/esm/types/streams.js +15 -0
  251. package/esm/types/streams.js.map +1 -0
  252. package/esm/types/unrecognized.d.ts +16 -0
  253. package/esm/types/unrecognized.d.ts.map +1 -0
  254. package/esm/types/unrecognized.js +31 -0
  255. package/esm/types/unrecognized.js.map +1 -0
  256. package/examples/metadataHealthCheck.example.ts +24 -0
  257. package/jsr.json +27 -0
  258. package/package.json +62 -0
  259. package/src/core.ts +13 -0
  260. package/src/funcs/metadata-get-jwks.ts +145 -0
  261. package/src/funcs/metadata-health-check.ts +142 -0
  262. package/src/funcs/tokens-issue-fluid-token.ts +175 -0
  263. package/src/funcs/tokens-issue-token.ts +181 -0
  264. package/src/funcs/tokens-issue-user-token.ts +184 -0
  265. package/src/hooks/hooks.ts +132 -0
  266. package/src/hooks/index.ts +6 -0
  267. package/src/hooks/registration.ts +14 -0
  268. package/src/hooks/types.ts +107 -0
  269. package/src/index.ts +9 -0
  270. package/src/lib/base64.ts +39 -0
  271. package/src/lib/config.ts +94 -0
  272. package/src/lib/dlv.ts +53 -0
  273. package/src/lib/encodings.ts +501 -0
  274. package/src/lib/env.ts +53 -0
  275. package/src/lib/files.ts +82 -0
  276. package/src/lib/http.ts +323 -0
  277. package/src/lib/is-plain-object.ts +43 -0
  278. package/src/lib/logger.ts +9 -0
  279. package/src/lib/matchers.ts +353 -0
  280. package/src/lib/primitives.ts +150 -0
  281. package/src/lib/retries.ts +218 -0
  282. package/src/lib/schemas.ts +94 -0
  283. package/src/lib/sdks.ts +406 -0
  284. package/src/lib/security.ts +236 -0
  285. package/src/lib/url.ts +33 -0
  286. package/src/models/error-response.ts +36 -0
  287. package/src/models/errors/error-response.ts +56 -0
  288. package/src/models/errors/fluidapi-default-error.ts +40 -0
  289. package/src/models/errors/fluidapi-error.ts +35 -0
  290. package/src/models/errors/http-client-errors.ts +62 -0
  291. package/src/models/errors/index.ts +10 -0
  292. package/src/models/errors/response-validation-error.ts +50 -0
  293. package/src/models/errors/sdk-validation-error.ts +54 -0
  294. package/src/models/health-response.ts +31 -0
  295. package/src/models/index.ts +11 -0
  296. package/src/models/issue-token-request.ts +66 -0
  297. package/src/models/jwk-set.ts +57 -0
  298. package/src/models/operations/index.ts +7 -0
  299. package/src/models/operations/issue-fluid-token.ts +37 -0
  300. package/src/models/operations/issue-token.ts +37 -0
  301. package/src/models/operations/issue-user-token.ts +37 -0
  302. package/src/models/token-data.ts +65 -0
  303. package/src/models/user-token-data.ts +45 -0
  304. package/src/models/user-token-request.ts +60 -0
  305. package/src/sdk/index.ts +5 -0
  306. package/src/sdk/metadata.ts +38 -0
  307. package/src/sdk/sdk.ts +19 -0
  308. package/src/sdk/tokens.ts +100 -0
  309. package/src/types/async.ts +68 -0
  310. package/src/types/blobs.ts +33 -0
  311. package/src/types/const-date-time.ts +15 -0
  312. package/src/types/default-to-zero-value.ts +33 -0
  313. package/src/types/enums.ts +45 -0
  314. package/src/types/fp.ts +50 -0
  315. package/src/types/index.ts +13 -0
  316. package/src/types/operations.ts +105 -0
  317. package/src/types/primitives.ts +168 -0
  318. package/src/types/rfcdate.ts +54 -0
  319. package/src/types/smart-union.ts +153 -0
  320. package/src/types/streams.ts +21 -0
  321. package/src/types/unrecognized.ts +35 -0
package/FUNCTIONS.md ADDED
@@ -0,0 +1,85 @@
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 { FluidapiCore } from "fluidapi/core.js";
23
+ import { metadataHealthCheck } from "fluidapi/funcs/metadata-health-check.js";
24
+
25
+ // Use `FluidapiCore` for best tree-shaking performance.
26
+ // You can create one instance of it to use across an application.
27
+ const fluidapi = new FluidapiCore();
28
+
29
+ async function run() {
30
+ const res = await metadataHealthCheck(fluidapi);
31
+ if (res.ok) {
32
+ const { value: result } = res;
33
+ console.log(result);
34
+ } else {
35
+ console.log("metadataHealthCheck failed:", res.error);
36
+ }
37
+ }
38
+
39
+ run();
40
+ ```
41
+
42
+ ## Result types
43
+
44
+ Standalone functions differ from SDK methods in that they return a
45
+ `Result<Value, Error>` type to capture _known errors_ and document them using
46
+ the type system. By avoiding throwing errors, application code maintains clear
47
+ control flow and error-handling become part of the regular flow of application
48
+ code.
49
+
50
+ > We use the term "known errors" because standalone functions, and JavaScript
51
+ > code in general, can still throw unexpected errors such as `TypeError`s,
52
+ > `RangeError`s and `DOMException`s. Exhaustively catching all errors may be
53
+ > something this SDK addresses in the future. Nevertheless, there is still a lot
54
+ > of benefit from capturing most errors and turning them into values.
55
+
56
+ The second reason for this style of programming is because these functions will
57
+ typically be used in front-end applications where exception throwing is
58
+ sometimes discouraged or considered unidiomatic. React and similar ecosystems
59
+ and libraries tend to promote this style of programming so that components
60
+ render useful content under all states (loading, success, error and so on).
61
+
62
+ The general pattern when calling standalone functions looks like this:
63
+
64
+ ```typescript
65
+ import { Core } from "<sdk-package-name>";
66
+ import { fetchSomething } from "<sdk-package-name>/funcs/fetchSomething.js";
67
+
68
+ const client = new Core();
69
+
70
+ async function run() {
71
+ const result = await fetchSomething(client, { id: "123" });
72
+ if (!result.ok) {
73
+ // You can throw the error or handle it. It's your choice now.
74
+ throw result.error;
75
+ }
76
+
77
+ console.log(result.value);
78
+ }
79
+
80
+ run();
81
+ ```
82
+
83
+ Notably, `result.error` above will have an explicit type compared to a try-catch
84
+ variation where the error in the catch block can only be of type `unknown` (or
85
+ `any` depending on your TypeScript settings).
package/README.md ADDED
@@ -0,0 +1,429 @@
1
+ # fluidapi
2
+
3
+ Developer-friendly & type-safe Typescript SDK specifically catered to leverage *fluidapi* 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=fluidapi&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/fluid/iam-sjd). Delete this section before > publishing to a package manager.
12
+
13
+ <!-- Start Summary [summary] -->
14
+ ## Summary
15
+
16
+ Fluid Token API — Public: Public contract for token issuance and token-related public endpoints.
17
+
18
+ ## Authentication
19
+
20
+ - **`/oauth2/token`** — public endpoint, no authentication required (client authenticates via `client_id` + `client_secret`).
21
+ - **`/oauth2/token-fluid`** — public endpoint for Fluid-signed M2M JWT issuance.
22
+ - **`/users/token`** — public endpoint for end-user token issuance. Supports Bearer M2M or HTTP Basic Auth.
23
+ - **`/.well-known/jwks.json`** — public key discovery for Fluid-signed JWT validation.
24
+
25
+ ## Scopes
26
+
27
+ | Scope | Description |
28
+ |---|---|
29
+ | `fluid:api` | Full access to the Fluid API |
30
+ <!-- End Summary [summary] -->
31
+
32
+ <!-- Start Table of Contents [toc] -->
33
+ ## Table of Contents
34
+ <!-- $toc-max-depth=2 -->
35
+ * [fluidapi](#fluidapi)
36
+ * [Scopes](#scopes)
37
+ * [SDK Installation](#sdk-installation)
38
+ * [Requirements](#requirements)
39
+ * [SDK Example Usage](#sdk-example-usage)
40
+ * [Available Resources and Operations](#available-resources-and-operations)
41
+ * [Standalone functions](#standalone-functions)
42
+ * [Retries](#retries)
43
+ * [Error Handling](#error-handling)
44
+ * [Server Selection](#server-selection)
45
+ * [Custom HTTP Client](#custom-http-client)
46
+ * [Debugging](#debugging)
47
+ * [Development](#development)
48
+ * [Maturity](#maturity)
49
+ * [Contributions](#contributions)
50
+
51
+ <!-- End Table of Contents [toc] -->
52
+
53
+ <!-- Start SDK Installation [installation] -->
54
+ ## SDK Installation
55
+
56
+ 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.
57
+
58
+ ### NPM
59
+
60
+ ```bash
61
+ npm add fluidapi
62
+ ```
63
+
64
+ ### PNPM
65
+
66
+ ```bash
67
+ pnpm add fluidapi
68
+ ```
69
+
70
+ ### Bun
71
+
72
+ ```bash
73
+ bun add fluidapi
74
+ ```
75
+
76
+ ### Yarn
77
+
78
+ ```bash
79
+ yarn add fluidapi
80
+ ```
81
+
82
+ > [!NOTE]
83
+ > This package is published as an ES Module (ESM) only. For applications using
84
+ > CommonJS, use `await import("fluidapi")` to import and use this package.
85
+ <!-- End SDK Installation [installation] -->
86
+
87
+ <!-- Start Requirements [requirements] -->
88
+ ## Requirements
89
+
90
+ For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).
91
+ <!-- End Requirements [requirements] -->
92
+
93
+ <!-- Start SDK Example Usage [usage] -->
94
+ ## SDK Example Usage
95
+
96
+ ### Example
97
+
98
+ ```typescript
99
+ import { Fluidapi } from "fluidapi";
100
+
101
+ const fluidapi = new Fluidapi();
102
+
103
+ async function run() {
104
+ const result = await fluidapi.metadata.healthCheck();
105
+
106
+ console.log(result);
107
+ }
108
+
109
+ run();
110
+
111
+ ```
112
+ <!-- End SDK Example Usage [usage] -->
113
+
114
+ <!-- Start Available Resources and Operations [operations] -->
115
+ ## Available Resources and Operations
116
+
117
+ <details open>
118
+ <summary>Available methods</summary>
119
+
120
+ ### [Metadata](docs/sdks/metadata/README.md)
121
+
122
+ * [healthCheck](docs/sdks/metadata/README.md#healthcheck) - Health check
123
+ * [getJWKS](docs/sdks/metadata/README.md#getjwks) - Get public signing keys
124
+
125
+ ### [Tokens](docs/sdks/tokens/README.md)
126
+
127
+ * [issueToken](docs/sdks/tokens/README.md#issuetoken) - Issue access token (client_credentials)
128
+ * [issueFluidToken](docs/sdks/tokens/README.md#issuefluidtoken) - Issue Fluid-signed M2M token
129
+ * [issueUserToken](docs/sdks/tokens/README.md#issueusertoken) - Issue end-user token
130
+
131
+ </details>
132
+ <!-- End Available Resources and Operations [operations] -->
133
+
134
+ <!-- Start Standalone functions [standalone-funcs] -->
135
+ ## Standalone functions
136
+
137
+ All the methods listed above are available as standalone functions. These
138
+ functions are ideal for use in applications running in the browser, serverless
139
+ runtimes or other environments where application bundle size is a primary
140
+ concern. When using a bundler to build your application, all unused
141
+ functionality will be either excluded from the final bundle or tree-shaken away.
142
+
143
+ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
144
+
145
+ <details>
146
+
147
+ <summary>Available standalone functions</summary>
148
+
149
+ - [`metadataGetJWKS`](docs/sdks/metadata/README.md#getjwks) - Get public signing keys
150
+ - [`metadataHealthCheck`](docs/sdks/metadata/README.md#healthcheck) - Health check
151
+ - [`tokensIssueFluidToken`](docs/sdks/tokens/README.md#issuefluidtoken) - Issue Fluid-signed M2M token
152
+ - [`tokensIssueToken`](docs/sdks/tokens/README.md#issuetoken) - Issue access token (client_credentials)
153
+ - [`tokensIssueUserToken`](docs/sdks/tokens/README.md#issueusertoken) - Issue end-user token
154
+
155
+ </details>
156
+ <!-- End Standalone functions [standalone-funcs] -->
157
+
158
+ <!-- Start Retries [retries] -->
159
+ ## Retries
160
+
161
+ 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.
162
+
163
+ To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
164
+ ```typescript
165
+ import { Fluidapi } from "fluidapi";
166
+
167
+ const fluidapi = new Fluidapi();
168
+
169
+ async function run() {
170
+ const result = await fluidapi.metadata.healthCheck({
171
+ retries: {
172
+ strategy: "backoff",
173
+ backoff: {
174
+ initialInterval: 1,
175
+ maxInterval: 50,
176
+ exponent: 1.1,
177
+ maxElapsedTime: 100,
178
+ },
179
+ retryConnectionErrors: false,
180
+ },
181
+ });
182
+
183
+ console.log(result);
184
+ }
185
+
186
+ run();
187
+
188
+ ```
189
+
190
+ If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
191
+ ```typescript
192
+ import { Fluidapi } from "fluidapi";
193
+
194
+ const fluidapi = new Fluidapi({
195
+ retryConfig: {
196
+ strategy: "backoff",
197
+ backoff: {
198
+ initialInterval: 1,
199
+ maxInterval: 50,
200
+ exponent: 1.1,
201
+ maxElapsedTime: 100,
202
+ },
203
+ retryConnectionErrors: false,
204
+ },
205
+ });
206
+
207
+ async function run() {
208
+ const result = await fluidapi.metadata.healthCheck();
209
+
210
+ console.log(result);
211
+ }
212
+
213
+ run();
214
+
215
+ ```
216
+ <!-- End Retries [retries] -->
217
+
218
+ <!-- Start Error Handling [errors] -->
219
+ ## Error Handling
220
+
221
+ [`FluidapiError`](./src/models/errors/fluidapi-error.ts) is the base class for all HTTP error responses. It has the following properties:
222
+
223
+ | Property | Type | Description |
224
+ | ------------------- | ---------- | --------------------------------------------------------------------------------------- |
225
+ | `error.message` | `string` | Error message |
226
+ | `error.statusCode` | `number` | HTTP response status code eg `404` |
227
+ | `error.headers` | `Headers` | HTTP response headers |
228
+ | `error.body` | `string` | HTTP body. Can be empty string if no body is returned. |
229
+ | `error.rawResponse` | `Response` | Raw HTTP response |
230
+ | `error.data$` | | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). |
231
+
232
+ ### Example
233
+ ```typescript
234
+ import { Fluidapi } from "fluidapi";
235
+ import * as errors from "fluidapi/models/errors";
236
+
237
+ const fluidapi = new Fluidapi();
238
+
239
+ async function run() {
240
+ try {
241
+ const result = await fluidapi.metadata.healthCheck();
242
+
243
+ console.log(result);
244
+ } catch (error) {
245
+ // The base class for HTTP error responses
246
+ if (error instanceof errors.FluidapiError) {
247
+ console.log(error.message);
248
+ console.log(error.statusCode);
249
+ console.log(error.body);
250
+ console.log(error.headers);
251
+
252
+ // Depending on the method different errors may be thrown
253
+ if (error instanceof errors.ErrorResponse) {
254
+ console.log(error.data$.ok); // boolean
255
+ console.log(error.data$.error); // models.ErrorT
256
+ }
257
+ }
258
+ }
259
+ }
260
+
261
+ run();
262
+
263
+ ```
264
+
265
+ ### Error Classes
266
+ **Primary errors:**
267
+ * [`FluidapiError`](./src/models/errors/fluidapi-error.ts): The base class for HTTP error responses.
268
+ * [`ErrorResponse`](./src/models/errors/error-response.ts): Generic error.
269
+
270
+ <details><summary>Less common errors (6)</summary>
271
+
272
+ <br />
273
+
274
+ **Network errors:**
275
+ * [`ConnectionError`](./src/models/errors/http-client-errors.ts): HTTP client was unable to make a request to a server.
276
+ * [`RequestTimeoutError`](./src/models/errors/http-client-errors.ts): HTTP request timed out due to an AbortSignal signal.
277
+ * [`RequestAbortedError`](./src/models/errors/http-client-errors.ts): HTTP request was aborted by the client.
278
+ * [`InvalidRequestError`](./src/models/errors/http-client-errors.ts): Any input used to create a request is invalid.
279
+ * [`UnexpectedClientError`](./src/models/errors/http-client-errors.ts): Unrecognised or unexpected error.
280
+
281
+
282
+ **Inherit from [`FluidapiError`](./src/models/errors/fluidapi-error.ts)**:
283
+ * [`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.
284
+
285
+ </details>
286
+ <!-- End Error Handling [errors] -->
287
+
288
+ <!-- Start Server Selection [server] -->
289
+ ## Server Selection
290
+
291
+ ### Server Variables
292
+
293
+ The default server `{scheme}://{host}` contains variables and is set to `https://id.dev.api.fluidapi.io` by default. To override default values, the following parameters are available when initializing the SDK client instance:
294
+
295
+ | Variable | Parameter | Supported Values | Default | Description |
296
+ | -------- | ----------------------------- | ---------------------------------------------------------------------------------- | -------------------------- | ----------- |
297
+ | `scheme` | `scheme: models.ServerScheme` | - `"http"`<br/>- `"https"` | `"https"` | |
298
+ | `host` | `host: models.ServerHost` | - `"id.dev.api.fluidapi.io"`<br/>- `"id.api.fluidapi.io"`<br/>- `"localhost:9999"` | `"id.dev.api.fluidapi.io"` | |
299
+
300
+ #### Example
301
+
302
+ ```typescript
303
+ import { Fluidapi } from "fluidapi";
304
+
305
+ const fluidapi = new Fluidapi({
306
+ serverIdx: 0,
307
+ scheme: "https",
308
+ host: "localhost:9999",
309
+ });
310
+
311
+ async function run() {
312
+ const result = await fluidapi.metadata.healthCheck();
313
+
314
+ console.log(result);
315
+ }
316
+
317
+ run();
318
+
319
+ ```
320
+
321
+ ### Override Server URL Per-Client
322
+
323
+ 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:
324
+ ```typescript
325
+ import { Fluidapi } from "fluidapi";
326
+
327
+ const fluidapi = new Fluidapi({
328
+ serverURL: "https://id.dev.api.fluidapi.io",
329
+ });
330
+
331
+ async function run() {
332
+ const result = await fluidapi.metadata.healthCheck();
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 { Fluidapi } from "fluidapi";
362
+ import { ProxyAgent } from "undici";
363
+ import { HTTPClient } from "fluidapi/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 Fluidapi({ 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 { Fluidapi } from "fluidapi";
407
+
408
+ const sdk = new Fluidapi({ debugLogger: console });
409
+ ```
410
+
411
+ You can also enable a default debug logger by setting an environment variable `FLUIDAPI_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=fluidapi&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.
package/esm/core.d.ts ADDED
@@ -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 FluidapiCore 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,YAAa,SAAQ,SAAS;CAAG"}
package/esm/core.js ADDED
@@ -0,0 +1,13 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import { ClientSDK } from "./lib/sdks.js";
5
+ /**
6
+ * A minimal client to use when calling standalone SDK functions. Typically, an
7
+ * instance of this class would be instantiated once at the start of an
8
+ * application and passed around through some dependency injection mechanism to
9
+ * parts of an application that need to make SDK calls.
10
+ */
11
+ export class FluidapiCore extends ClientSDK {
12
+ }
13
+ //# sourceMappingURL=core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,OAAO,YAAa,SAAQ,SAAS;CAAG"}
@@ -0,0 +1,18 @@
1
+ import { FluidapiCore } from "../core.js";
2
+ import { RequestOptions } from "../lib/sdks.js";
3
+ import { FluidapiError } from "../models/errors/fluidapi-error.js";
4
+ import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/http-client-errors.js";
5
+ import * as errors from "../models/errors/index.js";
6
+ import { ResponseValidationError } from "../models/errors/response-validation-error.js";
7
+ import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
8
+ import * as models from "../models/index.js";
9
+ import { APIPromise } from "../types/async.js";
10
+ import { Result } from "../types/fp.js";
11
+ /**
12
+ * Get public signing keys
13
+ *
14
+ * @remarks
15
+ * Returns the JWKS used to validate Fluid-signed JWTs.
16
+ */
17
+ export declare function metadataGetJWKS(client: FluidapiCore, options?: RequestOptions): APIPromise<Result<models.JWKSet, errors.ErrorResponse | FluidapiError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
18
+ //# sourceMappingURL=metadata-get-jwks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metadata-get-jwks.d.ts","sourceRoot":"","sources":["../../src/funcs/metadata-get-jwks.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG1C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,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,uBAAuB,EAAE,MAAM,+CAA+C,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAC9E,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,YAAY,EACpB,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,MAAM,CAAC,MAAM,EACX,MAAM,CAAC,aAAa,GACpB,aAAa,GACb,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CACrB,CACF,CAKA"}
@@ -0,0 +1,67 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import * as M from "../lib/matchers.js";
5
+ import { compactMap } from "../lib/primitives.js";
6
+ import { pathToFunc } from "../lib/url.js";
7
+ import * as errors from "../models/errors/index.js";
8
+ import * as models from "../models/index.js";
9
+ import { APIPromise } from "../types/async.js";
10
+ /**
11
+ * Get public signing keys
12
+ *
13
+ * @remarks
14
+ * Returns the JWKS used to validate Fluid-signed JWTs.
15
+ */
16
+ export function metadataGetJWKS(client, options) {
17
+ return new APIPromise($do(client, options));
18
+ }
19
+ async function $do(client, options) {
20
+ const path = pathToFunc("/.well-known/jwks.json")();
21
+ const headers = new Headers(compactMap({
22
+ Accept: "application/json",
23
+ }));
24
+ const context = {
25
+ options: client._options,
26
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
27
+ operationID: "getJWKS",
28
+ oAuth2Scopes: null,
29
+ resolvedSecurity: null,
30
+ securitySource: null,
31
+ retryConfig: options?.retries
32
+ || client._options.retryConfig
33
+ || { strategy: "none" },
34
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
35
+ };
36
+ const requestRes = client._createRequest(context, {
37
+ method: "GET",
38
+ baseURL: options?.serverURL,
39
+ path: path,
40
+ headers: headers,
41
+ userAgent: client._options.userAgent,
42
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
43
+ }, options);
44
+ if (!requestRes.ok) {
45
+ return [requestRes, { status: "invalid" }];
46
+ }
47
+ const req = requestRes.value;
48
+ const doResult = await client._do(req, {
49
+ context,
50
+ errorCodes: ["4XX", "503", "5XX"],
51
+ retryConfig: context.retryConfig,
52
+ retryCodes: context.retryCodes,
53
+ });
54
+ if (!doResult.ok) {
55
+ return [doResult, { status: "request-error", request: req }];
56
+ }
57
+ const response = doResult.value;
58
+ const responseFields = {
59
+ HttpMeta: { Response: response, Request: req },
60
+ };
61
+ const [result] = await M.match(M.json(200, models.JWKSet$inboundSchema), M.jsonErr(503, errors.ErrorResponse$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
62
+ if (!result.ok) {
63
+ return [result, { status: "complete", request: req, response }];
64
+ }
65
+ return [result, { status: "complete", request: req, response }];
66
+ }
67
+ //# sourceMappingURL=metadata-get-jwks.js.map