@nhost/nhost-js 3.3.1 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/README.md +67 -32
  2. package/dist/fetch-2PHmQBIJ.mjs +61 -0
  3. package/dist/fetch-2PHmQBIJ.mjs.map +1 -0
  4. package/dist/fetch-DWXwEnoe.js +2 -0
  5. package/dist/fetch-DWXwEnoe.js.map +1 -0
  6. package/dist/nhost-js/auth.cjs.js +2 -0
  7. package/dist/nhost-js/auth.cjs.js.map +1 -0
  8. package/dist/nhost-js/auth.es.js +917 -0
  9. package/dist/nhost-js/auth.es.js.map +1 -0
  10. package/dist/nhost-js/fetch.cjs.js +2 -0
  11. package/dist/nhost-js/fetch.cjs.js.map +1 -0
  12. package/dist/nhost-js/fetch.es.js +90 -0
  13. package/dist/nhost-js/fetch.es.js.map +1 -0
  14. package/dist/nhost-js/functions.cjs.js +2 -0
  15. package/dist/nhost-js/functions.cjs.js.map +1 -0
  16. package/dist/nhost-js/functions.es.js +45 -0
  17. package/dist/nhost-js/functions.es.js.map +1 -0
  18. package/dist/nhost-js/graphql.cjs.js +2 -0
  19. package/dist/nhost-js/graphql.cjs.js.map +1 -0
  20. package/dist/nhost-js/graphql.es.js +48 -0
  21. package/dist/nhost-js/graphql.es.js.map +1 -0
  22. package/dist/nhost-js/session.cjs.js +2 -0
  23. package/dist/nhost-js/session.cjs.js.map +1 -0
  24. package/dist/nhost-js/session.es.js +234 -0
  25. package/dist/nhost-js/session.es.js.map +1 -0
  26. package/dist/nhost-js/storage.cjs.js +2 -0
  27. package/dist/nhost-js/storage.cjs.js.map +1 -0
  28. package/dist/nhost-js/storage.es.js +324 -0
  29. package/dist/nhost-js/storage.es.js.map +1 -0
  30. package/dist/nhost-js.cjs.js +2 -0
  31. package/dist/nhost-js.cjs.js.map +1 -0
  32. package/dist/nhost-js.es.js +228 -0
  33. package/dist/nhost-js.es.js.map +1 -0
  34. package/dist/nhost-js.umd.js +2 -0
  35. package/dist/nhost-js.umd.js.map +1 -0
  36. package/dist/refreshSession-Bw715ZmX.js +2 -0
  37. package/dist/refreshSession-Bw715ZmX.js.map +1 -0
  38. package/dist/refreshSession-WwGlzgtM.mjs +95 -0
  39. package/dist/refreshSession-WwGlzgtM.mjs.map +1 -0
  40. package/dist/src/auth/client.d.ts +1763 -0
  41. package/dist/src/auth/client.d.ts.map +1 -0
  42. package/dist/src/auth/client.js +1043 -0
  43. package/dist/src/auth/client.js.map +1 -0
  44. package/dist/src/auth/index.d.ts +35 -0
  45. package/dist/src/auth/index.d.ts.map +1 -0
  46. package/dist/src/auth/index.js +35 -0
  47. package/dist/src/auth/index.js.map +1 -0
  48. package/dist/src/fetch/fetch.d.ts +88 -0
  49. package/dist/src/fetch/fetch.d.ts.map +1 -0
  50. package/dist/src/fetch/fetch.js +98 -0
  51. package/dist/src/fetch/fetch.js.map +1 -0
  52. package/dist/src/fetch/index.d.ts +38 -0
  53. package/dist/src/fetch/index.d.ts.map +1 -0
  54. package/dist/src/fetch/index.js +38 -0
  55. package/dist/src/fetch/index.js.map +1 -0
  56. package/dist/src/fetch/middlewareAttachAccessToken.d.ts +24 -0
  57. package/dist/src/fetch/middlewareAttachAccessToken.d.ts.map +1 -0
  58. package/dist/src/fetch/middlewareAttachAccessToken.js +54 -0
  59. package/dist/src/fetch/middlewareAttachAccessToken.js.map +1 -0
  60. package/dist/src/fetch/middlewareSessionRefresh.d.ts +30 -0
  61. package/dist/src/fetch/middlewareSessionRefresh.d.ts.map +1 -0
  62. package/dist/src/fetch/middlewareSessionRefresh.js +61 -0
  63. package/dist/src/fetch/middlewareSessionRefresh.js.map +1 -0
  64. package/dist/src/fetch/middlewareUpdateSessionFromResponse.d.ts +26 -0
  65. package/dist/src/fetch/middlewareUpdateSessionFromResponse.d.ts.map +1 -0
  66. package/dist/src/fetch/middlewareUpdateSessionFromResponse.js +79 -0
  67. package/dist/src/fetch/middlewareUpdateSessionFromResponse.js.map +1 -0
  68. package/dist/src/functions/client.d.ts +52 -0
  69. package/dist/src/functions/client.d.ts.map +1 -0
  70. package/dist/src/functions/client.js +89 -0
  71. package/dist/src/functions/client.js.map +1 -0
  72. package/dist/src/functions/index.d.ts +43 -0
  73. package/dist/src/functions/index.d.ts.map +1 -0
  74. package/dist/src/functions/index.js +43 -0
  75. package/dist/src/functions/index.js.map +1 -0
  76. package/dist/src/graphql/client.d.ts +93 -0
  77. package/dist/src/graphql/client.d.ts.map +1 -0
  78. package/dist/src/graphql/client.js +66 -0
  79. package/dist/src/graphql/client.js.map +1 -0
  80. package/dist/src/graphql/index.d.ts +65 -0
  81. package/dist/src/graphql/index.d.ts.map +1 -0
  82. package/dist/src/graphql/index.js +65 -0
  83. package/dist/src/graphql/index.js.map +1 -0
  84. package/dist/src/index.d.ts +35 -0
  85. package/dist/src/index.d.ts.map +1 -0
  86. package/dist/src/index.js +45 -0
  87. package/dist/src/index.js.map +1 -0
  88. package/dist/src/nhost.d.ts +301 -0
  89. package/dist/src/nhost.d.ts.map +1 -0
  90. package/dist/src/nhost.js +323 -0
  91. package/dist/src/nhost.js.map +1 -0
  92. package/dist/src/session/index.d.ts +20 -0
  93. package/dist/src/session/index.d.ts.map +1 -0
  94. package/dist/src/session/index.js +19 -0
  95. package/dist/src/session/index.js.map +1 -0
  96. package/dist/src/session/refreshSession.d.ts +17 -0
  97. package/dist/src/session/refreshSession.d.ts.map +1 -0
  98. package/dist/src/session/refreshSession.js +120 -0
  99. package/dist/src/session/refreshSession.js.map +1 -0
  100. package/dist/src/session/session.d.ts +24 -0
  101. package/dist/src/session/session.d.ts.map +1 -0
  102. package/dist/src/session/session.js +48 -0
  103. package/dist/src/session/session.js.map +1 -0
  104. package/dist/src/session/storage.d.ts +62 -0
  105. package/dist/src/session/storage.d.ts.map +1 -0
  106. package/dist/src/session/storage.js +91 -0
  107. package/dist/src/session/storage.js.map +1 -0
  108. package/dist/src/session/storageBackend.d.ts +122 -0
  109. package/dist/src/session/storageBackend.d.ts.map +1 -0
  110. package/dist/src/session/storageBackend.js +145 -0
  111. package/dist/src/session/storageBackend.js.map +1 -0
  112. package/dist/src/storage/client.d.ts +546 -0
  113. package/dist/src/storage/client.d.ts.map +1 -0
  114. package/dist/src/storage/client.js +368 -0
  115. package/dist/src/storage/client.js.map +1 -0
  116. package/dist/src/storage/index.d.ts +37 -0
  117. package/dist/src/storage/index.d.ts.map +1 -0
  118. package/dist/src/storage/index.js +37 -0
  119. package/dist/src/storage/index.js.map +1 -0
  120. package/dist/tsconfig.tsbuildinfo +1 -0
  121. package/package.json +103 -59
  122. package/dist/clients/auth.d.ts +0 -8
  123. package/dist/clients/auth.d.ts.map +0 -1
  124. package/dist/clients/functions/index.d.ts +0 -107
  125. package/dist/clients/functions/index.d.ts.map +0 -1
  126. package/dist/clients/functions/types.d.ts +0 -28
  127. package/dist/clients/functions/types.d.ts.map +0 -1
  128. package/dist/clients/graphql.d.ts +0 -8
  129. package/dist/clients/graphql.d.ts.map +0 -1
  130. package/dist/clients/index.d.ts +0 -6
  131. package/dist/clients/index.d.ts.map +0 -1
  132. package/dist/clients/nhost.d.ts +0 -83
  133. package/dist/clients/nhost.d.ts.map +0 -1
  134. package/dist/clients/storage.d.ts +0 -8
  135. package/dist/clients/storage.d.ts.map +0 -1
  136. package/dist/index.cjs.js +0 -2
  137. package/dist/index.cjs.js.map +0 -1
  138. package/dist/index.d.ts +0 -6
  139. package/dist/index.d.ts.map +0 -1
  140. package/dist/index.esm.js +0 -356
  141. package/dist/index.esm.js.map +0 -1
  142. package/dist/utils/helpers.d.ts +0 -20
  143. package/dist/utils/helpers.d.ts.map +0 -1
  144. package/dist/utils/types.d.ts +0 -57
  145. package/dist/utils/types.d.ts.map +0 -1
  146. package/umd/nhost-js.umd.js +0 -22
  147. package/umd/nhost-js.umd.js.map +0 -1
package/README.md CHANGED
@@ -1,52 +1,87 @@
1
- <h1 align="center">@nhost/nhost-js</h1>
2
- <h2 align="center">Nhost JavaScript SDK</h2>
1
+ # Nhost JavaScript SDK
3
2
 
4
- <p align="center">
5
- <img alt="npm" src="https://img.shields.io/npm/v/@nhost/nhost-js">
6
- <img alt="npm" src="https://img.shields.io/npm/dm/@nhost/nhost-js">
7
- <a href="LICENSE">
8
- <img src="https://img.shields.io/badge/license-MIT-yellow.svg" alt="license: MIT" />
9
- </a>
10
- </p>
3
+ The Nhost JavaScript SDK provides a client-side interface to interact with Nhost services, including authentication, storage, and GraphQL operations.
11
4
 
12
- ## Documentation
13
-
14
- [Reference documentation](https://docs.nhost.io/reference/javascript)
5
+ ## Installation
15
6
 
16
- ## Install
17
-
18
- ```
7
+ ```bash
8
+ # npm
19
9
  npm install @nhost/nhost-js
20
10
 
21
- # or yarn
11
+ # yarn
22
12
  yarn add @nhost/nhost-js
13
+
14
+ # pnpm
15
+ pnpm add @nhost/nhost-js
23
16
  ```
24
17
 
25
- ### Initialise
18
+ ## Quick Start
26
19
 
27
- ```js
28
- import { NhostClient } from '@nhost/nhost-js'
20
+ ```typescript
21
+ import { createClient } from '@nhost/nhost-js'
29
22
 
30
- const nhost = new NhostClient({
31
- subdomain: '<Your Nhost project subdomain>',
32
- region: '<Your Nhost project region>'
23
+ // Initialize the Nhost client
24
+ const nhost = createClient({
25
+ subdomain: 'your-project',
26
+ region: 'eu-central-1'
33
27
  })
34
- ```
35
28
 
36
- ## Features
29
+ // Use authentication features
30
+ const signinResponse = await nhost.auth.signInEmailPassword({
31
+ email: 'user@example.com',
32
+ password: 'password123'
33
+ })
37
34
 
38
- ### GraphQL
35
+ if (signinResponse.body.session) {
36
+ console.log('Signed in successfully!')
37
+ }
38
+
39
+ // Use GraphQL features
40
+ const graphqlResponse = await nhost.graphql.request({
41
+ query: `
42
+ query GetUsers {
43
+ users {
44
+ id
45
+ displayName
46
+ email
47
+ }
48
+ }
49
+ `
50
+ })
39
51
 
40
- Access Nhost GraphQL methods using `nhost.graphql`.
41
52
 
42
- ### Authentication
53
+ // Use storage features
54
+ const storageResponse = await nhost.storage.uploadFiles({
55
+ 'file[]': [file]
56
+ })
57
+
58
+ return storageResponse.body.processedFiles[0]
59
+
60
+ // call a serverless function
61
+ const functionsResponse = await nhost.functions.fetch('/echo', {
62
+ method: 'POST',
63
+ body: JSON.stringify({
64
+ message: 'Hello, world!'
65
+ }),
66
+ headers: {
67
+ 'Content-Type': 'application/json'
68
+ }
69
+ })
70
+ ```
43
71
 
44
- Access Nhost Auth methods using `nhost.auth`.
72
+ ## Modules
45
73
 
46
- ### Storage
74
+ The Nhost SDK consists of several modules:
75
+
76
+ - **Auth**: User authentication and session management
77
+ - **Storage**: File upload, download, and management
78
+ - **GraphQL**: Executing queries and mutations against your Hasura GraphQL API
79
+ - **Functions**: Invoking serverless functions
80
+
81
+ ## Documentation
47
82
 
48
- Access Nhost Storage methods using `nhost.storage`.
83
+ For detailed documentation and API reference, see the [Nhost Documentation](https://docs.nhost.io).
49
84
 
50
- ### Functions
85
+ ## License
51
86
 
52
- Access Nhost Functions methods via `nhost.functions`.
87
+ MIT
@@ -0,0 +1,61 @@
1
+ function createEnhancedFetch(chainFunctions = []) {
2
+ return chainFunctions.reduceRight(
3
+ (nextInChain, chainFunction) => chainFunction(nextInChain),
4
+ fetch
5
+ );
6
+ }
7
+ function extractMessage(body) {
8
+ if (body && typeof body === "string") {
9
+ return body;
10
+ }
11
+ if (body && typeof body === "object") {
12
+ const typedBody = body;
13
+ if ("message" in typedBody && typeof typedBody["message"] === "string") {
14
+ return typedBody["message"];
15
+ }
16
+ if ("error" in typedBody && typeof typedBody["error"] === "string") {
17
+ return typedBody["error"];
18
+ }
19
+ if ("error" in typedBody && typedBody["error"] && typeof typedBody["error"] === "object") {
20
+ const error = typedBody["error"];
21
+ if ("message" in error && typeof error["message"] === "string") {
22
+ return error["message"];
23
+ }
24
+ }
25
+ if ("errors" in typedBody && Array.isArray(typedBody["errors"])) {
26
+ const messages = typedBody["errors"].filter(
27
+ (error) => typeof error === "object" && error !== null && "message" in error && typeof error["message"] === "string"
28
+ ).map((error) => error["message"]);
29
+ if (messages.length > 0) {
30
+ return messages.join(", ");
31
+ }
32
+ }
33
+ }
34
+ return "An unexpected error occurred";
35
+ }
36
+ class FetchError extends Error {
37
+ /** The original response body */
38
+ body;
39
+ /** HTTP status code of the failed response */
40
+ status;
41
+ /** Response headers */
42
+ headers;
43
+ /**
44
+ * Creates a new FetchError instance
45
+ *
46
+ * @param body - The response body from the failed request
47
+ * @param status - The HTTP status code
48
+ * @param headers - The response headers
49
+ */
50
+ constructor(body, status, headers) {
51
+ super(extractMessage(body));
52
+ this.body = body;
53
+ this.status = status;
54
+ this.headers = headers;
55
+ }
56
+ }
57
+ export {
58
+ FetchError as F,
59
+ createEnhancedFetch as c
60
+ };
61
+ //# sourceMappingURL=fetch-2PHmQBIJ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch-2PHmQBIJ.mjs","sources":["../src/fetch/fetch.ts"],"sourcesContent":["/**\n * Type definition for a fetch-like function.\n * Takes the same parameters as fetch and returns the same type.\n * This allows middleware to intercept and modify requests and responses.\n */\nexport type FetchFunction = (\n url: string,\n options?: RequestInit,\n) => Promise<Response>;\n\n/**\n * Type definition for a chain function (middleware).\n * Takes a fetch-like function and returns another fetch-like function.\n *\n * Chain functions can be used to implement:\n * - Authentication token handling\n * - Error handling and retry logic\n * - Request and response transformations\n * - Logging and metrics\n */\nexport type ChainFunction = (next: FetchFunction) => FetchFunction;\n\n/**\n * Creates an enhanced fetch function using a chain of middleware functions.\n *\n * The fetch chain executes in the order of the array, with each middleware\n * wrapping the next one in the chain. This allows each middleware to\n * intercept both the request (before calling next) and the response\n * (after calling next).\n *\n * @example\n * ```typescript\n * // Simple logging middleware\n * const loggingMiddleware: ChainFunction = (next) => {\n * return async (url, options) => {\n * console.log(`Request to ${url}`);\n * const response = await next(url, options);\n * console.log(`Response from ${url}: ${response.status}`);\n * return response;\n * };\n * };\n *\n * const enhancedFetch = createEnhancedFetch([loggingMiddleware]);\n * const response = await enhancedFetch('https://api.example.com/data');\n * ```\n *\n * @param chainFunctions - Array of chain functions to apply in order\n * @returns Enhanced fetch function with all middleware applied\n */\nexport function createEnhancedFetch(\n chainFunctions: ChainFunction[] = [],\n): FetchFunction {\n // Build the chain starting with vanilla fetch, but apply functions in reverse\n // to achieve the desired execution order\n return chainFunctions.reduceRight(\n (nextInChain, chainFunction) => chainFunction(nextInChain),\n fetch as FetchFunction,\n );\n}\n\n/**\n * Interface representing a structured API response.\n *\n * This interface provides a consistent structure for responses across the SDK,\n * offering access to the parsed response body along with status and headers.\n *\n * @template T - The type of the response body\n */\nexport interface FetchResponse<T> {\n /** The parsed response body */\n body: T;\n /** HTTP status code of the response */\n status: number;\n /** Response headers */\n headers: Headers;\n}\n\nfunction extractMessage(body: unknown): string {\n if (body && typeof body === \"string\") {\n return body;\n }\n\n if (body && typeof body === \"object\") {\n const typedBody = body as Record<string, unknown>;\n\n if (\"message\" in typedBody && typeof typedBody[\"message\"] === \"string\") {\n return typedBody[\"message\"];\n }\n\n if (\"error\" in typedBody && typeof typedBody[\"error\"] === \"string\") {\n return typedBody[\"error\"];\n }\n\n if (\n \"error\" in typedBody &&\n typedBody[\"error\"] &&\n typeof typedBody[\"error\"] === \"object\"\n ) {\n const error = typedBody[\"error\"] as Record<string, unknown>;\n if (\"message\" in error && typeof error[\"message\"] === \"string\") {\n return error[\"message\"];\n }\n }\n\n if (\"errors\" in typedBody && Array.isArray(typedBody[\"errors\"])) {\n const messages = (typedBody[\"errors\"] as unknown[])\n .filter(\n (error): error is { message: string } =>\n typeof error === \"object\" &&\n error !== null &&\n \"message\" in error &&\n typeof (error as { message: unknown })[\"message\"] === \"string\",\n )\n .map((error) => error[\"message\"]);\n\n if (messages.length > 0) {\n return messages.join(\", \");\n }\n }\n }\n\n return \"An unexpected error occurred\";\n}\n\n/**\n * Error class for representing fetch operation failures.\n *\n * This class extends the standard Error to include additional\n * information about failed requests, including the response body,\n * status code, and headers. The error message is automatically\n * extracted from common error response formats.\n *\n * @template T - The type of the response body\n */\nexport class FetchError<T = unknown> extends Error {\n /** The original response body */\n body: T;\n /** HTTP status code of the failed response */\n status: number;\n /** Response headers */\n headers: Headers;\n\n /**\n * Creates a new FetchError instance\n *\n * @param body - The response body from the failed request\n * @param status - The HTTP status code\n * @param headers - The response headers\n */\n constructor(body: T, status: number, headers: Headers) {\n super(extractMessage(body));\n this.body = body;\n this.status = status;\n this.headers = headers;\n }\n}\n"],"names":[],"mappings":"AAiDO,SAAS,oBACd,iBAAkC,IACnB;AAGf,SAAO,eAAe;AAAA,IACpB,CAAC,aAAa,kBAAkB,cAAc,WAAW;AAAA,IACzD;AAAA,EAAA;AAEJ;AAmBA,SAAS,eAAe,MAAuB;AAC7C,MAAI,QAAQ,OAAO,SAAS,UAAU;AACpC,WAAO;AAAA,EACT;AAEA,MAAI,QAAQ,OAAO,SAAS,UAAU;AACpC,UAAM,YAAY;AAElB,QAAI,aAAa,aAAa,OAAO,UAAU,SAAS,MAAM,UAAU;AACtE,aAAO,UAAU,SAAS;AAAA,IAC5B;AAEA,QAAI,WAAW,aAAa,OAAO,UAAU,OAAO,MAAM,UAAU;AAClE,aAAO,UAAU,OAAO;AAAA,IAC1B;AAEA,QACE,WAAW,aACX,UAAU,OAAO,KACjB,OAAO,UAAU,OAAO,MAAM,UAC9B;AACA,YAAM,QAAQ,UAAU,OAAO;AAC/B,UAAI,aAAa,SAAS,OAAO,MAAM,SAAS,MAAM,UAAU;AAC9D,eAAO,MAAM,SAAS;AAAA,MACxB;AAAA,IACF;AAEA,QAAI,YAAY,aAAa,MAAM,QAAQ,UAAU,QAAQ,CAAC,GAAG;AAC/D,YAAM,WAAY,UAAU,QAAQ,EACjC;AAAA,QACC,CAAC,UACC,OAAO,UAAU,YACjB,UAAU,QACV,aAAa,SACb,OAAQ,MAA+B,SAAS,MAAM;AAAA,MAAA,EAEzD,IAAI,CAAC,UAAU,MAAM,SAAS,CAAC;AAElC,UAAI,SAAS,SAAS,GAAG;AACvB,eAAO,SAAS,KAAK,IAAI;AAAA,MAC3B;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;AAYO,MAAM,mBAAgC,MAAM;AAAA;AAAA,EAEjD;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,YAAY,MAAS,QAAgB,SAAkB;AACrD,UAAM,eAAe,IAAI,CAAC;AAC1B,SAAK,OAAO;AACZ,SAAK,SAAS;AACd,SAAK,UAAU;AAAA,EACjB;AACF;"}
@@ -0,0 +1,2 @@
1
+ "use strict";class r extends Error{body;status;headers;constructor(r,e,t){super(function(r){if(r&&"string"==typeof r)return r;if(r&&"object"==typeof r){const e=r;if("message"in e&&"string"==typeof e.message)return e.message;if("error"in e&&"string"==typeof e.error)return e.error;if("error"in e&&e.error&&"object"==typeof e.error){const r=e.error;if("message"in r&&"string"==typeof r.message)return r.message}if("errors"in e&&Array.isArray(e.errors)){const r=e.errors.filter((r=>"object"==typeof r&&null!==r&&"message"in r&&"string"==typeof r.message)).map((r=>r.message));if(r.length>0)return r.join(", ")}}return"An unexpected error occurred"}(r)),this.body=r,this.status=e,this.headers=t}}exports.FetchError=r,exports.createEnhancedFetch=function(r=[]){return r.reduceRight(((r,e)=>e(r)),fetch)};
2
+ //# sourceMappingURL=fetch-DWXwEnoe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch-DWXwEnoe.js","sources":["../src/fetch/fetch.ts"],"sourcesContent":["/**\n * Type definition for a fetch-like function.\n * Takes the same parameters as fetch and returns the same type.\n * This allows middleware to intercept and modify requests and responses.\n */\nexport type FetchFunction = (\n url: string,\n options?: RequestInit,\n) => Promise<Response>;\n\n/**\n * Type definition for a chain function (middleware).\n * Takes a fetch-like function and returns another fetch-like function.\n *\n * Chain functions can be used to implement:\n * - Authentication token handling\n * - Error handling and retry logic\n * - Request and response transformations\n * - Logging and metrics\n */\nexport type ChainFunction = (next: FetchFunction) => FetchFunction;\n\n/**\n * Creates an enhanced fetch function using a chain of middleware functions.\n *\n * The fetch chain executes in the order of the array, with each middleware\n * wrapping the next one in the chain. This allows each middleware to\n * intercept both the request (before calling next) and the response\n * (after calling next).\n *\n * @example\n * ```typescript\n * // Simple logging middleware\n * const loggingMiddleware: ChainFunction = (next) => {\n * return async (url, options) => {\n * console.log(`Request to ${url}`);\n * const response = await next(url, options);\n * console.log(`Response from ${url}: ${response.status}`);\n * return response;\n * };\n * };\n *\n * const enhancedFetch = createEnhancedFetch([loggingMiddleware]);\n * const response = await enhancedFetch('https://api.example.com/data');\n * ```\n *\n * @param chainFunctions - Array of chain functions to apply in order\n * @returns Enhanced fetch function with all middleware applied\n */\nexport function createEnhancedFetch(\n chainFunctions: ChainFunction[] = [],\n): FetchFunction {\n // Build the chain starting with vanilla fetch, but apply functions in reverse\n // to achieve the desired execution order\n return chainFunctions.reduceRight(\n (nextInChain, chainFunction) => chainFunction(nextInChain),\n fetch as FetchFunction,\n );\n}\n\n/**\n * Interface representing a structured API response.\n *\n * This interface provides a consistent structure for responses across the SDK,\n * offering access to the parsed response body along with status and headers.\n *\n * @template T - The type of the response body\n */\nexport interface FetchResponse<T> {\n /** The parsed response body */\n body: T;\n /** HTTP status code of the response */\n status: number;\n /** Response headers */\n headers: Headers;\n}\n\nfunction extractMessage(body: unknown): string {\n if (body && typeof body === \"string\") {\n return body;\n }\n\n if (body && typeof body === \"object\") {\n const typedBody = body as Record<string, unknown>;\n\n if (\"message\" in typedBody && typeof typedBody[\"message\"] === \"string\") {\n return typedBody[\"message\"];\n }\n\n if (\"error\" in typedBody && typeof typedBody[\"error\"] === \"string\") {\n return typedBody[\"error\"];\n }\n\n if (\n \"error\" in typedBody &&\n typedBody[\"error\"] &&\n typeof typedBody[\"error\"] === \"object\"\n ) {\n const error = typedBody[\"error\"] as Record<string, unknown>;\n if (\"message\" in error && typeof error[\"message\"] === \"string\") {\n return error[\"message\"];\n }\n }\n\n if (\"errors\" in typedBody && Array.isArray(typedBody[\"errors\"])) {\n const messages = (typedBody[\"errors\"] as unknown[])\n .filter(\n (error): error is { message: string } =>\n typeof error === \"object\" &&\n error !== null &&\n \"message\" in error &&\n typeof (error as { message: unknown })[\"message\"] === \"string\",\n )\n .map((error) => error[\"message\"]);\n\n if (messages.length > 0) {\n return messages.join(\", \");\n }\n }\n }\n\n return \"An unexpected error occurred\";\n}\n\n/**\n * Error class for representing fetch operation failures.\n *\n * This class extends the standard Error to include additional\n * information about failed requests, including the response body,\n * status code, and headers. The error message is automatically\n * extracted from common error response formats.\n *\n * @template T - The type of the response body\n */\nexport class FetchError<T = unknown> extends Error {\n /** The original response body */\n body: T;\n /** HTTP status code of the failed response */\n status: number;\n /** Response headers */\n headers: Headers;\n\n /**\n * Creates a new FetchError instance\n *\n * @param body - The response body from the failed request\n * @param status - The HTTP status code\n * @param headers - The response headers\n */\n constructor(body: T, status: number, headers: Headers) {\n super(extractMessage(body));\n this.body = body;\n this.status = status;\n this.headers = headers;\n }\n}\n"],"names":["FetchError","Error","body","status","headers","constructor","super","typedBody","error","Array","isArray","messages","filter","map","length","join","extractMessage","this","chainFunctions","reduceRight","nextInChain","chainFunction","fetch"],"mappings":"aAsIO,MAAMA,UAAgCC,MAE3CC,KAEAC,OAEAC,QASA,WAAAC,CAAYH,EAASC,EAAgBC,GACnCE,MAzEJ,SAAwBJ,GACtB,GAAIA,GAAwB,iBAATA,EACjB,OAAOA,EAGT,GAAIA,GAAwB,iBAATA,EAAmB,CACpC,MAAMK,EAAYL,EAElB,GAAI,YAAaK,GAA6C,iBAAzBA,EAAmB,QACtD,OAAOA,EAAmB,QAG5B,GAAI,UAAWA,GAA2C,iBAAvBA,EAAiB,MAClD,OAAOA,EAAiB,MAG1B,GACE,UAAWA,GACXA,EAAiB,OACa,iBAAvBA,EAAiB,MACxB,CACA,MAAMC,EAAQD,EAAiB,MAC/B,GAAI,YAAaC,GAAqC,iBAArBA,EAAe,QAC9C,OAAOA,EAAe,OAE1B,CAEA,GAAI,WAAYD,GAAaE,MAAMC,QAAQH,EAAkB,QAAI,CAC/D,MAAMI,EAAYJ,EAAkB,OACjCK,QACEJ,GACkB,iBAAVA,GACG,OAAVA,GACA,YAAaA,GACyC,iBAA9CA,EAAwC,UAEnDK,KAAKL,GAAUA,EAAe,UAEjC,GAAIG,EAASG,OAAS,EACpB,OAAOH,EAASI,KAAK,KAEzB,CACF,CAEA,MAAO,8BACT,CA4BUC,CAAed,IACrBe,KAAKf,KAAOA,EACZe,KAAKd,OAASA,EACdc,KAAKb,QAAUA,CACjB,mDAzGK,SACLc,EAAkC,IAIlC,OAAOA,EAAeC,aACpB,CAACC,EAAaC,IAAkBA,EAAcD,IAC9CE,MAEJ"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../fetch-DWXwEnoe.js");exports.createAPIClient=(s,e=[])=>{let a=t.createEnhancedFetch(e);return{baseURL:s,pushChainFunction:s=>{e.push(s),a=t.createEnhancedFetch(e)},getJWKs:async e=>{const n=`${s}/.well-known/jwks.json`,r=await a(n,{...e,method:"GET",headers:{...e?.headers}});if(r.status>=300){const s=[412].includes(r.status)?null:await r.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,r.status,r.headers)}const i=[204,205,304].includes(r.status)?null:await r.text();return{body:i?JSON.parse(i):{},status:r.status,headers:r.headers}},elevateWebauthn:async e=>{const n=`${s}/elevate/webauthn`,r=await a(n,{...e,method:"POST",headers:{...e?.headers}});if(r.status>=300){const s=[412].includes(r.status)?null:await r.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,r.status,r.headers)}const i=[204,205,304].includes(r.status)?null:await r.text();return{body:i?JSON.parse(i):{},status:r.status,headers:r.headers}},verifyElevateWebauthn:async(e,n)=>{const r=`${s}/elevate/webauthn/verify`,i=await a(r,{...n,method:"POST",headers:{"Content-Type":"application/json",...n?.headers},body:JSON.stringify(e)});if(i.status>=300){const s=[412].includes(i.status)?null:await i.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,i.status,i.headers)}const u=[204,205,304].includes(i.status)?null:await i.text();return{body:u?JSON.parse(u):{},status:i.status,headers:i.headers}},healthCheckGet:async e=>{const n=`${s}/healthz`,r=await a(n,{...e,method:"GET",headers:{...e?.headers}});if(r.status>=300){const s=[412].includes(r.status)?null:await r.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,r.status,r.headers)}const i=[204,205,304].includes(r.status)?null:await r.text();return{body:i?JSON.parse(i):{},status:r.status,headers:r.headers}},healthCheckHead:async e=>{const n=`${s}/healthz`,r=await a(n,{...e,method:"HEAD",headers:{...e?.headers}});if(r.status>=300){const s=[412].includes(r.status)?null:await r.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,r.status,r.headers)}return{body:void 0,status:r.status,headers:r.headers}},linkIdToken:async(e,n)=>{const r=`${s}/link/idtoken`,i=await a(r,{...n,method:"POST",headers:{"Content-Type":"application/json",...n?.headers},body:JSON.stringify(e)});if(i.status>=300){const s=[412].includes(i.status)?null:await i.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,i.status,i.headers)}const u=[204,205,304].includes(i.status)?null:await i.text();return{body:u?JSON.parse(u):{},status:i.status,headers:i.headers}},changeUserMfa:async e=>{const n=`${s}/mfa/totp/generate`,r=await a(n,{...e,method:"GET",headers:{...e?.headers}});if(r.status>=300){const s=[412].includes(r.status)?null:await r.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,r.status,r.headers)}const i=[204,205,304].includes(r.status)?null:await r.text();return{body:i?JSON.parse(i):{},status:r.status,headers:r.headers}},createPAT:async(e,n)=>{const r=`${s}/pat`,i=await a(r,{...n,method:"POST",headers:{"Content-Type":"application/json",...n?.headers},body:JSON.stringify(e)});if(i.status>=300){const s=[412].includes(i.status)?null:await i.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,i.status,i.headers)}const u=[204,205,304].includes(i.status)?null:await i.text();return{body:u?JSON.parse(u):{},status:i.status,headers:i.headers}},signInAnonymous:async(e,n)=>{const r=`${s}/signin/anonymous`,i=await a(r,{...n,method:"POST",headers:{"Content-Type":"application/json",...n?.headers},body:JSON.stringify(e)});if(i.status>=300){const s=[412].includes(i.status)?null:await i.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,i.status,i.headers)}const u=[204,205,304].includes(i.status)?null:await i.text();return{body:u?JSON.parse(u):{},status:i.status,headers:i.headers}},signInEmailPassword:async(e,n)=>{const r=`${s}/signin/email-password`,i=await a(r,{...n,method:"POST",headers:{"Content-Type":"application/json",...n?.headers},body:JSON.stringify(e)});if(i.status>=300){const s=[412].includes(i.status)?null:await i.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,i.status,i.headers)}const u=[204,205,304].includes(i.status)?null:await i.text();return{body:u?JSON.parse(u):{},status:i.status,headers:i.headers}},signInIdToken:async(e,n)=>{const r=`${s}/signin/idtoken`,i=await a(r,{...n,method:"POST",headers:{"Content-Type":"application/json",...n?.headers},body:JSON.stringify(e)});if(i.status>=300){const s=[412].includes(i.status)?null:await i.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,i.status,i.headers)}const u=[204,205,304].includes(i.status)?null:await i.text();return{body:u?JSON.parse(u):{},status:i.status,headers:i.headers}},verifySignInMfaTotp:async(e,n)=>{const r=`${s}/signin/mfa/totp`,i=await a(r,{...n,method:"POST",headers:{"Content-Type":"application/json",...n?.headers},body:JSON.stringify(e)});if(i.status>=300){const s=[412].includes(i.status)?null:await i.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,i.status,i.headers)}const u=[204,205,304].includes(i.status)?null:await i.text();return{body:u?JSON.parse(u):{},status:i.status,headers:i.headers}},signInOTPEmail:async(e,n)=>{const r=`${s}/signin/otp/email`,i=await a(r,{...n,method:"POST",headers:{"Content-Type":"application/json",...n?.headers},body:JSON.stringify(e)});if(i.status>=300){const s=[412].includes(i.status)?null:await i.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,i.status,i.headers)}const u=[204,205,304].includes(i.status)?null:await i.text();return{body:u?JSON.parse(u):{},status:i.status,headers:i.headers}},verifySignInOTPEmail:async(e,n)=>{const r=`${s}/signin/otp/email/verify`,i=await a(r,{...n,method:"POST",headers:{"Content-Type":"application/json",...n?.headers},body:JSON.stringify(e)});if(i.status>=300){const s=[412].includes(i.status)?null:await i.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,i.status,i.headers)}const u=[204,205,304].includes(i.status)?null:await i.text();return{body:u?JSON.parse(u):{},status:i.status,headers:i.headers}},signInPasswordlessEmail:async(e,n)=>{const r=`${s}/signin/passwordless/email`,i=await a(r,{...n,method:"POST",headers:{"Content-Type":"application/json",...n?.headers},body:JSON.stringify(e)});if(i.status>=300){const s=[412].includes(i.status)?null:await i.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,i.status,i.headers)}const u=[204,205,304].includes(i.status)?null:await i.text();return{body:u?JSON.parse(u):{},status:i.status,headers:i.headers}},signInPasswordlessSms:async(e,n)=>{const r=`${s}/signin/passwordless/sms`,i=await a(r,{...n,method:"POST",headers:{"Content-Type":"application/json",...n?.headers},body:JSON.stringify(e)});if(i.status>=300){const s=[412].includes(i.status)?null:await i.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,i.status,i.headers)}const u=[204,205,304].includes(i.status)?null:await i.text();return{body:u?JSON.parse(u):{},status:i.status,headers:i.headers}},verifySignInPasswordlessSms:async(e,n)=>{const r=`${s}/signin/passwordless/sms/otp`,i=await a(r,{...n,method:"POST",headers:{"Content-Type":"application/json",...n?.headers},body:JSON.stringify(e)});if(i.status>=300){const s=[412].includes(i.status)?null:await i.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,i.status,i.headers)}const u=[204,205,304].includes(i.status)?null:await i.text();return{body:u?JSON.parse(u):{},status:i.status,headers:i.headers}},signInPAT:async(e,n)=>{const r=`${s}/signin/pat`,i=await a(r,{...n,method:"POST",headers:{"Content-Type":"application/json",...n?.headers},body:JSON.stringify(e)});if(i.status>=300){const s=[412].includes(i.status)?null:await i.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,i.status,i.headers)}const u=[204,205,304].includes(i.status)?null:await i.text();return{body:u?JSON.parse(u):{},status:i.status,headers:i.headers}},signInProviderURL:(t,e)=>{const a=e&&Object.entries(e).map((([t,s])=>{const e=Array.isArray(s)?s.join(","):"object"==typeof s?JSON.stringify(s):s;return`${t}=${encodeURIComponent(e)}`})).join("&");return a?`${s}/signin/provider/${t}?${a}`:`${s}/signin/provider/${t}`},signInWebauthn:async(e,n)=>{const r=`${s}/signin/webauthn`,i=await a(r,{...n,method:"POST",headers:{"Content-Type":"application/json",...n?.headers},body:JSON.stringify(e)});if(i.status>=300){const s=[412].includes(i.status)?null:await i.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,i.status,i.headers)}const u=[204,205,304].includes(i.status)?null:await i.text();return{body:u?JSON.parse(u):{},status:i.status,headers:i.headers}},verifySignInWebauthn:async(e,n)=>{const r=`${s}/signin/webauthn/verify`,i=await a(r,{...n,method:"POST",headers:{"Content-Type":"application/json",...n?.headers},body:JSON.stringify(e)});if(i.status>=300){const s=[412].includes(i.status)?null:await i.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,i.status,i.headers)}const u=[204,205,304].includes(i.status)?null:await i.text();return{body:u?JSON.parse(u):{},status:i.status,headers:i.headers}},signOut:async(e,n)=>{const r=`${s}/signout`,i=await a(r,{...n,method:"POST",headers:{"Content-Type":"application/json",...n?.headers},body:JSON.stringify(e)});if(i.status>=300){const s=[412].includes(i.status)?null:await i.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,i.status,i.headers)}const u=[204,205,304].includes(i.status)?null:await i.text();return{body:u?JSON.parse(u):{},status:i.status,headers:i.headers}},signUpEmailPassword:async(e,n)=>{const r=`${s}/signup/email-password`,i=await a(r,{...n,method:"POST",headers:{"Content-Type":"application/json",...n?.headers},body:JSON.stringify(e)});if(i.status>=300){const s=[412].includes(i.status)?null:await i.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,i.status,i.headers)}const u=[204,205,304].includes(i.status)?null:await i.text();return{body:u?JSON.parse(u):{},status:i.status,headers:i.headers}},signUpWebauthn:async(e,n)=>{const r=`${s}/signup/webauthn`,i=await a(r,{...n,method:"POST",headers:{"Content-Type":"application/json",...n?.headers},body:JSON.stringify(e)});if(i.status>=300){const s=[412].includes(i.status)?null:await i.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,i.status,i.headers)}const u=[204,205,304].includes(i.status)?null:await i.text();return{body:u?JSON.parse(u):{},status:i.status,headers:i.headers}},verifySignUpWebauthn:async(e,n)=>{const r=`${s}/signup/webauthn/verify`,i=await a(r,{...n,method:"POST",headers:{"Content-Type":"application/json",...n?.headers},body:JSON.stringify(e)});if(i.status>=300){const s=[412].includes(i.status)?null:await i.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,i.status,i.headers)}const u=[204,205,304].includes(i.status)?null:await i.text();return{body:u?JSON.parse(u):{},status:i.status,headers:i.headers}},refreshToken:async(e,n)=>{const r=`${s}/token`,i=await a(r,{...n,method:"POST",headers:{"Content-Type":"application/json",...n?.headers},body:JSON.stringify(e)});if(i.status>=300){const s=[412].includes(i.status)?null:await i.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,i.status,i.headers)}const u=[204,205,304].includes(i.status)?null:await i.text();return{body:u?JSON.parse(u):{},status:i.status,headers:i.headers}},verifyToken:async(e,n)=>{const r=`${s}/token/verify`,i=await a(r,{...n,method:"POST",headers:{"Content-Type":"application/json",...n?.headers},body:JSON.stringify(e)});if(i.status>=300){const s=[412].includes(i.status)?null:await i.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,i.status,i.headers)}const u=[204,205,304].includes(i.status)?null:await i.text();return{body:u?JSON.parse(u):{},status:i.status,headers:i.headers}},getUser:async e=>{const n=`${s}/user`,r=await a(n,{...e,method:"GET",headers:{...e?.headers}});if(r.status>=300){const s=[412].includes(r.status)?null:await r.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,r.status,r.headers)}const i=[204,205,304].includes(r.status)?null:await r.text();return{body:i?JSON.parse(i):{},status:r.status,headers:r.headers}},deanonymizeUser:async(e,n)=>{const r=`${s}/user/deanonymize`,i=await a(r,{...n,method:"POST",headers:{"Content-Type":"application/json",...n?.headers},body:JSON.stringify(e)});if(i.status>=300){const s=[412].includes(i.status)?null:await i.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,i.status,i.headers)}const u=[204,205,304].includes(i.status)?null:await i.text();return{body:u?JSON.parse(u):{},status:i.status,headers:i.headers}},changeUserEmail:async(e,n)=>{const r=`${s}/user/email/change`,i=await a(r,{...n,method:"POST",headers:{"Content-Type":"application/json",...n?.headers},body:JSON.stringify(e)});if(i.status>=300){const s=[412].includes(i.status)?null:await i.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,i.status,i.headers)}const u=[204,205,304].includes(i.status)?null:await i.text();return{body:u?JSON.parse(u):{},status:i.status,headers:i.headers}},sendVerificationEmail:async(e,n)=>{const r=`${s}/user/email/send-verification-email`,i=await a(r,{...n,method:"POST",headers:{"Content-Type":"application/json",...n?.headers},body:JSON.stringify(e)});if(i.status>=300){const s=[412].includes(i.status)?null:await i.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,i.status,i.headers)}const u=[204,205,304].includes(i.status)?null:await i.text();return{body:u?JSON.parse(u):{},status:i.status,headers:i.headers}},verifyChangeUserMfa:async(e,n)=>{const r=`${s}/user/mfa`,i=await a(r,{...n,method:"POST",headers:{"Content-Type":"application/json",...n?.headers},body:JSON.stringify(e)});if(i.status>=300){const s=[412].includes(i.status)?null:await i.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,i.status,i.headers)}const u=[204,205,304].includes(i.status)?null:await i.text();return{body:u?JSON.parse(u):{},status:i.status,headers:i.headers}},changeUserPassword:async(e,n)=>{const r=`${s}/user/password`,i=await a(r,{...n,method:"POST",headers:{"Content-Type":"application/json",...n?.headers},body:JSON.stringify(e)});if(i.status>=300){const s=[412].includes(i.status)?null:await i.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,i.status,i.headers)}const u=[204,205,304].includes(i.status)?null:await i.text();return{body:u?JSON.parse(u):{},status:i.status,headers:i.headers}},sendPasswordResetEmail:async(e,n)=>{const r=`${s}/user/password/reset`,i=await a(r,{...n,method:"POST",headers:{"Content-Type":"application/json",...n?.headers},body:JSON.stringify(e)});if(i.status>=300){const s=[412].includes(i.status)?null:await i.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,i.status,i.headers)}const u=[204,205,304].includes(i.status)?null:await i.text();return{body:u?JSON.parse(u):{},status:i.status,headers:i.headers}},addSecurityKey:async e=>{const n=`${s}/user/webauthn/add`,r=await a(n,{...e,method:"POST",headers:{...e?.headers}});if(r.status>=300){const s=[412].includes(r.status)?null:await r.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,r.status,r.headers)}const i=[204,205,304].includes(r.status)?null:await r.text();return{body:i?JSON.parse(i):{},status:r.status,headers:r.headers}},verifyAddSecurityKey:async(e,n)=>{const r=`${s}/user/webauthn/verify`,i=await a(r,{...n,method:"POST",headers:{"Content-Type":"application/json",...n?.headers},body:JSON.stringify(e)});if(i.status>=300){const s=[412].includes(i.status)?null:await i.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,i.status,i.headers)}const u=[204,205,304].includes(i.status)?null:await i.text();return{body:u?JSON.parse(u):{},status:i.status,headers:i.headers}},verifyTicketURL:t=>{const e=t&&Object.entries(t).map((([t,s])=>{const e=Array.isArray(s)?s.join(","):"object"==typeof s?JSON.stringify(s):s;return`${t}=${encodeURIComponent(e)}`})).join("&");return e?`${s}/verify?${e}`:`${s}/verify`},getVersion:async e=>{const n=`${s}/version`,r=await a(n,{...e,method:"GET",headers:{...e?.headers}});if(r.status>=300){const s=[412].includes(r.status)?null:await r.text(),e=s?JSON.parse(s):{};throw new t.FetchError(e,r.status,r.headers)}const i=[204,205,304].includes(r.status)?null:await r.text();return{body:i?JSON.parse(i):{},status:r.status,headers:r.headers}}}};
2
+ //# sourceMappingURL=auth.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.cjs.js","sources":["../../src/auth/client.ts"],"sourcesContent":["/**\n * This file is auto-generated. Do not edit manually.\n */\n\nimport type { ChainFunction, FetchResponse } from \"../fetch\";\nimport { createEnhancedFetch, FetchError } from \"../fetch\";\n\n/**\n * The attestation statement format\n */\nexport type AttestationFormat =\n | \"packed\"\n | \"tpm\"\n | \"android-key\"\n | \"android-safetynet\"\n | \"fido-u2f\"\n | \"apple\"\n | \"none\";\n\n/**\n * Map of extension outputs from the client\n @property appid? (`boolean`) - Application identifier extension output\n @property credProps? (`CredentialPropertiesOutput`) - Credential properties extension output\n @property hmacCreateSecret? (`boolean`) - HMAC secret extension output*/\nexport interface AuthenticationExtensionsClientOutputs {\n /**\n * Application identifier extension output\n */\n appid?: boolean;\n /**\n * Credential properties extension output\n */\n credProps?: CredentialPropertiesOutput;\n /**\n * HMAC secret extension output\n */\n hmacCreateSecret?: boolean;\n}\n\n/**\n * \n @property clientDataJSON (`string`) - Base64url encoded client data JSON\n @property authenticatorData (`string`) - Base64url encoded authenticator data\n @property signature (`string`) - Base64url encoded assertion signature\n @property userHandle? (`string`) - Base64url encoded user handle*/\nexport interface AuthenticatorAssertionResponse {\n /**\n * Base64url encoded client data JSON\n */\n clientDataJSON: string;\n /**\n * Base64url encoded authenticator data\n */\n authenticatorData: string;\n /**\n * Base64url encoded assertion signature\n */\n signature: string;\n /**\n * Base64url encoded user handle\n */\n userHandle?: string;\n}\n\n/**\n * The authenticator attachment modality\n */\nexport type AuthenticatorAttachment = \"platform\" | \"cross-platform\";\n\n/**\n * \n @property clientDataJSON (`string`) - Base64url-encoded binary data\n * Format - byte\n @property transports? (`string[]`) - The authenticator transports\n @property authenticatorData? (`string`) - Base64url-encoded binary data\n * Format - byte\n @property publicKey? (`string`) - Base64url-encoded binary data\n * Format - byte\n @property publicKeyAlgorithm? (`number`) - The public key algorithm identifier\n * Format - int64\n @property attestationObject (`string`) - Base64url-encoded binary data\n * Format - byte*/\nexport interface AuthenticatorAttestationResponse {\n /**\n * Base64url-encoded binary data\n * Format - byte\n */\n clientDataJSON: string;\n /**\n * The authenticator transports\n */\n transports?: string[];\n /**\n * Base64url-encoded binary data\n * Format - byte\n */\n authenticatorData?: string;\n /**\n * Base64url-encoded binary data\n * Format - byte\n */\n publicKey?: string;\n /**\n * The public key algorithm identifier\n * Format - int64\n */\n publicKeyAlgorithm?: number;\n /**\n * Base64url-encoded binary data\n * Format - byte\n */\n attestationObject: string;\n}\n\n/**\n * \n @property authenticatorAttachment? (`AuthenticatorAttachment`) - The authenticator attachment modality\n @property requireResidentKey? (`boolean`) - Whether the authenticator must create a client-side-resident public key credential source\n @property residentKey? (`ResidentKeyRequirement`) - The resident key requirement\n @property userVerification? (`UserVerificationRequirement`) - A requirement for user verification for the operation*/\nexport interface AuthenticatorSelection {\n /**\n * The authenticator attachment modality\n */\n authenticatorAttachment?: AuthenticatorAttachment;\n /**\n * Whether the authenticator must create a client-side-resident public key credential source\n */\n requireResidentKey?: boolean;\n /**\n * The resident key requirement\n */\n residentKey?: ResidentKeyRequirement;\n /**\n * A requirement for user verification for the operation\n */\n userVerification?: UserVerificationRequirement;\n}\n\n/**\n * The authenticator transports that can be used\n */\nexport type AuthenticatorTransport =\n | \"usb\"\n | \"nfc\"\n | \"ble\"\n | \"smart-card\"\n | \"hybrid\"\n | \"internal\";\n\n/**\n * The attestation conveyance preference\n */\nexport type ConveyancePreference =\n | \"none\"\n | \"indirect\"\n | \"direct\"\n | \"enterprise\";\n\n/**\n * \n @property expiresAt (`string`) - Expiration date of the PAT\n * Format - date-time\n @property metadata? (`Record<string, unknown>`) - \n * Example - `{\"name\":\"my-pat\",\"used-by\":\"my-app-cli\"}`*/\nexport interface CreatePATRequest {\n /**\n * Expiration date of the PAT\n * Format - date-time\n */\n expiresAt: string;\n /**\n *\n * Example - `{\"name\":\"my-pat\",\"used-by\":\"my-app-cli\"}`\n */\n metadata?: Record<string, unknown>;\n}\n\n/**\n * \n @property id (`string`) - ID of the PAT\n * Example - `\"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24\"`\n * Pattern - \\b[0-9a-f]{8}\\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\\b[0-9a-f]{12}\\b\n @property personalAccessToken (`string`) - PAT\n * Example - `\"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24\"`\n * Pattern - \\b[0-9a-f]{8}\\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\\b[0-9a-f]{12}\\b*/\nexport interface CreatePATResponse {\n /**\n * ID of the PAT\n * Example - `\"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24\"`\n * Pattern - \\b[0-9a-f]{8}\\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\\b[0-9a-f]{12}\\b\n */\n id: string;\n /**\n * PAT\n * Example - `\"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24\"`\n * Pattern - \\b[0-9a-f]{8}\\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\\b[0-9a-f]{12}\\b\n */\n personalAccessToken: string;\n}\n\n/**\n * \n @property id (`string`) - The credential's identifier\n @property type (`string`) - The credential type represented by this object\n @property rawId (`string`) - Base64url-encoded binary data\n * Format - byte\n @property clientExtensionResults? (`AuthenticationExtensionsClientOutputs`) - Map of extension outputs from the client\n @property authenticatorAttachment? (`string`) - The authenticator attachment\n @property response (`AuthenticatorAssertionResponse`) - */\nexport interface CredentialAssertionResponse {\n /**\n * The credential's identifier\n */\n id: string;\n /**\n * The credential type represented by this object\n */\n type: string;\n /**\n * Base64url-encoded binary data\n * Format - byte\n */\n rawId: string;\n /**\n * Map of extension outputs from the client\n */\n clientExtensionResults?: AuthenticationExtensionsClientOutputs;\n /**\n * The authenticator attachment\n */\n authenticatorAttachment?: string;\n /**\n *\n */\n response: AuthenticatorAssertionResponse;\n}\n\n/**\n * \n @property id (`string`) - The credential's identifier\n @property type (`string`) - The credential type represented by this object\n @property rawId (`string`) - Base64url-encoded binary data\n * Format - byte\n @property clientExtensionResults? (`AuthenticationExtensionsClientOutputs`) - Map of extension outputs from the client\n @property authenticatorAttachment? (`string`) - The authenticator attachment\n @property response (`AuthenticatorAttestationResponse`) - */\nexport interface CredentialCreationResponse {\n /**\n * The credential's identifier\n */\n id: string;\n /**\n * The credential type represented by this object\n */\n type: string;\n /**\n * Base64url-encoded binary data\n * Format - byte\n */\n rawId: string;\n /**\n * Map of extension outputs from the client\n */\n clientExtensionResults?: AuthenticationExtensionsClientOutputs;\n /**\n * The authenticator attachment\n */\n authenticatorAttachment?: string;\n /**\n *\n */\n response: AuthenticatorAttestationResponse;\n}\n\n/**\n * \n @property type (`CredentialType`) - The valid credential types\n @property alg (`number`) - The cryptographic algorithm identifier*/\nexport interface CredentialParameter {\n /**\n * The valid credential types\n */\n type: CredentialType;\n /**\n * The cryptographic algorithm identifier\n */\n alg: number;\n}\n\n/**\n * Credential properties extension output\n @property rk? (`boolean`) - Indicates if the credential is a resident key*/\nexport interface CredentialPropertiesOutput {\n /**\n * Indicates if the credential is a resident key\n */\n rk?: boolean;\n}\n\n/**\n * The valid credential types\n */\nexport type CredentialType = \"public-key\";\n\n/**\n * Error code identifying the specific application error\n */\nexport type ErrorResponseError =\n | \"default-role-must-be-in-allowed-roles\"\n | \"disabled-endpoint\"\n | \"disabled-user\"\n | \"email-already-in-use\"\n | \"email-already-verified\"\n | \"forbidden-anonymous\"\n | \"internal-server-error\"\n | \"invalid-email-password\"\n | \"invalid-request\"\n | \"locale-not-allowed\"\n | \"password-too-short\"\n | \"password-in-hibp-database\"\n | \"redirectTo-not-allowed\"\n | \"role-not-allowed\"\n | \"signup-disabled\"\n | \"unverified-user\"\n | \"user-not-anonymous\"\n | \"invalid-pat\"\n | \"invalid-refresh-token\"\n | \"invalid-ticket\"\n | \"disabled-mfa-totp\"\n | \"no-totp-secret\"\n | \"invalid-totp\"\n | \"mfa-type-not-found\"\n | \"totp-already-active\"\n | \"invalid-state\"\n | \"oauth-token-echange-failed\"\n | \"oauth-profile-fetch-failed\"\n | \"oauth-provider-error\"\n | \"invalid-otp\"\n | \"cannot-send-sms\";\n\n/**\n * Standardized error response\n @property status (`number`) - HTTP status error code\n * Example - `400`\n @property message (`string`) - Human-friendly error message\n * Example - `\"Invalid email format\"`\n @property error (`ErrorResponseError`) - Error code identifying the specific application error*/\nexport interface ErrorResponse {\n /**\n * HTTP status error code\n * Example - `400`\n */\n status: number;\n /**\n * Human-friendly error message\n * Example - `\"Invalid email format\"`\n */\n message: string;\n /**\n * Error code identifying the specific application error\n */\n error: ErrorResponseError;\n}\n\n/**\n *\n */\nexport type IdTokenProvider = \"apple\" | \"google\";\n\n/**\n * JSON Web Key for JWT verification\n @property alg (`string`) - Algorithm used with this key\n * Example - `\"RS256\"`\n @property e (`string`) - RSA public exponent\n * Example - `\"AQAB\"`\n @property kid (`string`) - Key ID\n * Example - `\"key-id-1\"`\n @property kty (`string`) - Key type\n * Example - `\"RSA\"`\n @property n (`string`) - RSA modulus\n * Example - `\"abcd1234...\"`\n @property use (`string`) - Key usage\n * Example - `\"sig\"`*/\nexport interface JWK {\n /**\n * Algorithm used with this key\n * Example - `\"RS256\"`\n */\n alg: string;\n /**\n * RSA public exponent\n * Example - `\"AQAB\"`\n */\n e: string;\n /**\n * Key ID\n * Example - `\"key-id-1\"`\n */\n kid: string;\n /**\n * Key type\n * Example - `\"RSA\"`\n */\n kty: string;\n /**\n * RSA modulus\n * Example - `\"abcd1234...\"`\n */\n n: string;\n /**\n * Key usage\n * Example - `\"sig\"`\n */\n use: string;\n}\n\n/**\n * JSON Web Key Set for verifying JWT signatures\n @property keys (`JWK[]`) - Array of public keys*/\nexport interface JWKSet {\n /**\n * Array of public keys\n */\n keys: JWK[];\n}\n\n/**\n * \n @property provider (`IdTokenProvider`) - \n @property idToken (`string`) - Apple ID token\n @property nonce? (`string`) - Nonce used during sign in process*/\nexport interface LinkIdTokenRequest {\n /**\n *\n */\n provider: IdTokenProvider;\n /**\n * Apple ID token\n */\n idToken: string;\n /**\n * Nonce used during sign in process\n */\n nonce?: string;\n}\n\n/**\n * Challenge payload for multi-factor authentication\n @property ticket (`string`) - Ticket to use when completing the MFA challenge\n * Example - `\"mfaTotp:abc123def456\"`*/\nexport interface MFAChallengePayload {\n /**\n * Ticket to use when completing the MFA challenge\n * Example - `\"mfaTotp:abc123def456\"`\n */\n ticket: string;\n}\n\n/**\n *\n */\nexport type OKResponse = \"OK\";\n\n/**\n * \n @property redirectTo? (`string`) - \n * Example - `\"https://my-app.com/catch-redirection\"`\n * Format - uri*/\nexport interface OptionsRedirectTo {\n /**\n *\n * Example - `\"https://my-app.com/catch-redirection\"`\n * Format - uri\n */\n redirectTo?: string;\n}\n\n/**\n * \n @property rp (`RelyingPartyEntity`) - \n @property user (`UserEntity`) - \n @property challenge (`string`) - Base64url-encoded binary data\n * Format - byte\n @property pubKeyCredParams (`CredentialParameter[]`) - The desired credential types and their respective cryptographic parameters\n @property timeout? (`number`) - A time, in milliseconds, that the caller is willing to wait for the call to complete\n @property excludeCredentials? (`PublicKeyCredentialDescriptor[]`) - A list of PublicKeyCredentialDescriptor objects representing public key credentials that are not acceptable to the caller\n @property authenticatorSelection? (`AuthenticatorSelection`) - \n @property hints? (`PublicKeyCredentialHints[]`) - Hints to help guide the user through the experience\n @property attestation? (`ConveyancePreference`) - The attestation conveyance preference\n @property attestationFormats? (`AttestationFormat[]`) - The preferred attestation statement formats\n @property extensions? (`Record<string, unknown>`) - Additional parameters requesting additional processing by the client and authenticator*/\nexport interface PublicKeyCredentialCreationOptions {\n /**\n *\n */\n rp: RelyingPartyEntity;\n /**\n *\n */\n user: UserEntity;\n /**\n * Base64url-encoded binary data\n * Format - byte\n */\n challenge: string;\n /**\n * The desired credential types and their respective cryptographic parameters\n */\n pubKeyCredParams: CredentialParameter[];\n /**\n * A time, in milliseconds, that the caller is willing to wait for the call to complete\n */\n timeout?: number;\n /**\n * A list of PublicKeyCredentialDescriptor objects representing public key credentials that are not acceptable to the caller\n */\n excludeCredentials?: PublicKeyCredentialDescriptor[];\n /**\n *\n */\n authenticatorSelection?: AuthenticatorSelection;\n /**\n * Hints to help guide the user through the experience\n */\n hints?: PublicKeyCredentialHints[];\n /**\n * The attestation conveyance preference\n */\n attestation?: ConveyancePreference;\n /**\n * The preferred attestation statement formats\n */\n attestationFormats?: AttestationFormat[];\n /**\n * Additional parameters requesting additional processing by the client and authenticator\n */\n extensions?: Record<string, unknown>;\n}\n\n/**\n * \n @property type (`CredentialType`) - The valid credential types\n @property id (`string`) - Base64url-encoded binary data\n * Format - byte\n @property transports? (`AuthenticatorTransport[]`) - The authenticator transports that can be used*/\nexport interface PublicKeyCredentialDescriptor {\n /**\n * The valid credential types\n */\n type: CredentialType;\n /**\n * Base64url-encoded binary data\n * Format - byte\n */\n id: string;\n /**\n * The authenticator transports that can be used\n */\n transports?: AuthenticatorTransport[];\n}\n\n/**\n * Hints to help guide the user through the experience\n */\nexport type PublicKeyCredentialHints =\n | \"security-key\"\n | \"client-device\"\n | \"hybrid\";\n\n/**\n * \n @property challenge (`string`) - Base64url-encoded binary data\n * Format - byte\n @property timeout? (`number`) - A time, in milliseconds, that the caller is willing to wait for the call to complete\n @property rpId? (`string`) - The RP ID the credential should be scoped to\n @property allowCredentials? (`PublicKeyCredentialDescriptor[]`) - A list of CredentialDescriptor objects representing public key credentials acceptable to the caller\n @property userVerification? (`UserVerificationRequirement`) - A requirement for user verification for the operation\n @property hints? (`PublicKeyCredentialHints[]`) - Hints to help guide the user through the experience\n @property extensions? (`Record<string, unknown>`) - Additional parameters requesting additional processing by the client and authenticator*/\nexport interface PublicKeyCredentialRequestOptions {\n /**\n * Base64url-encoded binary data\n * Format - byte\n */\n challenge: string;\n /**\n * A time, in milliseconds, that the caller is willing to wait for the call to complete\n */\n timeout?: number;\n /**\n * The RP ID the credential should be scoped to\n */\n rpId?: string;\n /**\n * A list of CredentialDescriptor objects representing public key credentials acceptable to the caller\n */\n allowCredentials?: PublicKeyCredentialDescriptor[];\n /**\n * A requirement for user verification for the operation\n */\n userVerification?: UserVerificationRequirement;\n /**\n * Hints to help guide the user through the experience\n */\n hints?: PublicKeyCredentialHints[];\n /**\n * Additional parameters requesting additional processing by the client and authenticator\n */\n extensions?: Record<string, unknown>;\n}\n\n/**\n * Request to refresh an access token\n @property refreshToken (`string`) - Refresh token used to generate a new access token\n * Example - `\"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24\"`\n * Pattern - \\b[0-9a-f]{8}\\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\\b[0-9a-f]{12}\\b*/\nexport interface RefreshTokenRequest {\n /**\n * Refresh token used to generate a new access token\n * Example - `\"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24\"`\n * Pattern - \\b[0-9a-f]{8}\\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\\b[0-9a-f]{12}\\b\n */\n refreshToken: string;\n}\n\n/**\n * \n @property name (`string`) - A human-palatable name for the entity\n @property id (`string`) - A unique identifier for the Relying Party entity, which sets the RP ID*/\nexport interface RelyingPartyEntity {\n /**\n * A human-palatable name for the entity\n */\n name: string;\n /**\n * A unique identifier for the Relying Party entity, which sets the RP ID\n */\n id: string;\n}\n\n/**\n * The resident key requirement\n */\nexport type ResidentKeyRequirement = \"discouraged\" | \"preferred\" | \"required\";\n\n/**\n * User authentication session containing tokens and user information\n @property accessToken (`string`) - JWT token for authenticating API requests\n * Example - `\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\"`\n @property accessTokenExpiresIn (`number`) - Expiration time of the access token in seconds\n * Example - `900`\n * Format - int64\n @property refreshTokenId (`string`) - Identifier for the refresh token\n * Example - `\"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24\"`\n * Pattern - \\b[0-9a-f]{8}\\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\\b[0-9a-f]{12}\\b\n @property refreshToken (`string`) - Token used to refresh the access token\n * Example - `\"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24\"`\n * Pattern - \\b[0-9a-f]{8}\\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\\b[0-9a-f]{12}\\b\n @property user? (`User`) - User profile and account information*/\nexport interface Session {\n /**\n * JWT token for authenticating API requests\n * Example - `\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\"`\n */\n accessToken: string;\n /**\n * Expiration time of the access token in seconds\n * Example - `900`\n * Format - int64\n */\n accessTokenExpiresIn: number;\n /**\n * Identifier for the refresh token\n * Example - `\"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24\"`\n * Pattern - \\b[0-9a-f]{8}\\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\\b[0-9a-f]{12}\\b\n */\n refreshTokenId: string;\n /**\n * Token used to refresh the access token\n * Example - `\"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24\"`\n * Pattern - \\b[0-9a-f]{8}\\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\\b[0-9a-f]{12}\\b\n */\n refreshToken: string;\n /**\n * User profile and account information\n */\n user?: User;\n}\n\n/**\n * Container for session information\n @property session? (`Session`) - User authentication session containing tokens and user information*/\nexport interface SessionPayload {\n /**\n * User authentication session containing tokens and user information\n */\n session?: Session;\n}\n\n/**\n * \n @property displayName? (`string`) - \n * Example - `\"John Smith\"`\n @property locale? (`string`) - A two-characters locale\n * Example - `\"en\"`\n * MinLength - 2\n * MaxLength - 2\n @property metadata? (`Record<string, unknown>`) - \n * Example - `{\"firstName\":\"John\",\"lastName\":\"Smith\"}`*/\nexport interface SignInAnonymousRequest {\n /**\n *\n * Example - `\"John Smith\"`\n */\n displayName?: string;\n /**\n * A two-characters locale\n * Example - `\"en\"`\n * MinLength - 2\n * MaxLength - 2\n */\n locale?: string;\n /**\n *\n * Example - `{\"firstName\":\"John\",\"lastName\":\"Smith\"}`\n */\n metadata?: Record<string, unknown>;\n}\n\n/**\n * Request to authenticate using email and password\n @property email (`string`) - User's email address\n * Example - `\"john.smith@nhost.io\"`\n * Format - email\n @property password (`string`) - User's password\n * Example - `\"Str0ngPassw#ord-94|%\"`\n * MinLength - 3\n * MaxLength - 50*/\nexport interface SignInEmailPasswordRequest {\n /**\n * User's email address\n * Example - `\"john.smith@nhost.io\"`\n * Format - email\n */\n email: string;\n /**\n * User's password\n * Example - `\"Str0ngPassw#ord-94|%\"`\n * MinLength - 3\n * MaxLength - 50\n */\n password: string;\n}\n\n/**\n * Response for email-password authentication that may include a session or MFA challenge\n @property session? (`Session`) - User authentication session containing tokens and user information\n @property mfa? (`MFAChallengePayload`) - Challenge payload for multi-factor authentication*/\nexport interface SignInEmailPasswordResponse {\n /**\n * User authentication session containing tokens and user information\n */\n session?: Session;\n /**\n * Challenge payload for multi-factor authentication\n */\n mfa?: MFAChallengePayload;\n}\n\n/**\n * \n @property provider (`IdTokenProvider`) - \n @property idToken (`string`) - Apple ID token\n @property nonce? (`string`) - Nonce used during sign in process\n @property options? (`SignUpOptions`) - */\nexport interface SignInIdTokenRequest {\n /**\n *\n */\n provider: IdTokenProvider;\n /**\n * Apple ID token\n */\n idToken: string;\n /**\n * Nonce used during sign in process\n */\n nonce?: string;\n /**\n *\n */\n options?: SignUpOptions;\n}\n\n/**\n * \n @property ticket (`string`) - Ticket\n * Pattern - ^mfaTotp:.*$\n @property otp (`string`) - One time password*/\nexport interface SignInMfaTotpRequest {\n /**\n * Ticket\n * Pattern - ^mfaTotp:.*$\n */\n ticket: string;\n /**\n * One time password\n */\n otp: string;\n}\n\n/**\n * \n @property email (`string`) - A valid email\n * Example - `\"john.smith@nhost.io\"`\n * Format - email\n @property options? (`SignUpOptions`) - */\nexport interface SignInOTPEmailRequest {\n /**\n * A valid email\n * Example - `\"john.smith@nhost.io\"`\n * Format - email\n */\n email: string;\n /**\n *\n */\n options?: SignUpOptions;\n}\n\n/**\n * \n @property otp (`string`) - One time password\n @property email (`string`) - A valid email\n * Example - `\"john.smith@nhost.io\"`\n * Format - email*/\nexport interface SignInOTPEmailVerifyRequest {\n /**\n * One time password\n */\n otp: string;\n /**\n * A valid email\n * Example - `\"john.smith@nhost.io\"`\n * Format - email\n */\n email: string;\n}\n\n/**\n * \n @property session? (`Session`) - User authentication session containing tokens and user information*/\nexport interface SignInOTPEmailVerifyResponse {\n /**\n * User authentication session containing tokens and user information\n */\n session?: Session;\n}\n\n/**\n * \n @property personalAccessToken (`string`) - PAT\n * Example - `\"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24\"`\n * Pattern - \\b[0-9a-f]{8}\\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\\b[0-9a-f]{12}\\b*/\nexport interface SignInPATRequest {\n /**\n * PAT\n * Example - `\"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24\"`\n * Pattern - \\b[0-9a-f]{8}\\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\\b[0-9a-f]{12}\\b\n */\n personalAccessToken: string;\n}\n\n/**\n * \n @property email (`string`) - A valid email\n * Example - `\"john.smith@nhost.io\"`\n * Format - email\n @property options? (`SignUpOptions`) - */\nexport interface SignInPasswordlessEmailRequest {\n /**\n * A valid email\n * Example - `\"john.smith@nhost.io\"`\n * Format - email\n */\n email: string;\n /**\n *\n */\n options?: SignUpOptions;\n}\n\n/**\n * \n @property phoneNumber (`string`) - Phone number of the user\n * Example - `\"+123456789\"`\n @property otp (`string`) - One-time password received by SMS*/\nexport interface SignInPasswordlessSmsOtpRequest {\n /**\n * Phone number of the user\n * Example - `\"+123456789\"`\n */\n phoneNumber: string;\n /**\n * One-time password received by SMS\n */\n otp: string;\n}\n\n/**\n * \n @property session? (`Session`) - User authentication session containing tokens and user information\n @property mfa? (`MFAChallengePayload`) - Challenge payload for multi-factor authentication*/\nexport interface SignInPasswordlessSmsOtpResponse {\n /**\n * User authentication session containing tokens and user information\n */\n session?: Session;\n /**\n * Challenge payload for multi-factor authentication\n */\n mfa?: MFAChallengePayload;\n}\n\n/**\n * \n @property phoneNumber (`string`) - Phone number of the user\n * Example - `\"+123456789\"`\n @property options? (`SignUpOptions`) - */\nexport interface SignInPasswordlessSmsRequest {\n /**\n * Phone number of the user\n * Example - `\"+123456789\"`\n */\n phoneNumber: string;\n /**\n *\n */\n options?: SignUpOptions;\n}\n\n/**\n * \n @property email? (`string`) - A valid email\n * Example - `\"john.smith@nhost.io\"`\n * Format - email*/\nexport interface SignInWebauthnRequest {\n /**\n * A valid email\n * Example - `\"john.smith@nhost.io\"`\n * Format - email\n */\n email?: string;\n}\n\n/**\n * \n @property email? (`string`) - A valid email. Deprecated, no longer used\n * Example - `\"john.smith@nhost.io\"`\n * Format - email\n @property credential (`CredentialAssertionResponse`) - */\nexport interface SignInWebauthnVerifyRequest {\n /**\n * A valid email. Deprecated, no longer used\n * Example - `\"john.smith@nhost.io\"`\n * Format - email\n */\n email?: string;\n /**\n *\n */\n credential: CredentialAssertionResponse;\n}\n\n/**\n * \n @property refreshToken? (`string`) - Refresh token for the current session\n @property all? (`boolean`) - Sign out from all connected devices*/\nexport interface SignOutRequest {\n /**\n * Refresh token for the current session\n */\n refreshToken?: string;\n /**\n * Sign out from all connected devices\n */\n all?: boolean;\n}\n\n/**\n * Request to register a new user with email and password\n @property email (`string`) - Email address for the new user account\n * Example - `\"john.smith@nhost.io\"`\n * Format - email\n @property password (`string`) - Password for the new user account\n * Example - `\"Str0ngPassw#ord-94|%\"`\n * MinLength - 3\n * MaxLength - 50\n @property options? (`SignUpOptions`) - */\nexport interface SignUpEmailPasswordRequest {\n /**\n * Email address for the new user account\n * Example - `\"john.smith@nhost.io\"`\n * Format - email\n */\n email: string;\n /**\n * Password for the new user account\n * Example - `\"Str0ngPassw#ord-94|%\"`\n * MinLength - 3\n * MaxLength - 50\n */\n password: string;\n /**\n *\n */\n options?: SignUpOptions;\n}\n\n/**\n * \n @property allowedRoles? (`string[]`) - \n * Example - `[\"me\",\"user\"]`\n @property defaultRole? (`string`) - \n * Example - `\"user\"`\n @property displayName? (`string`) - \n * Example - `\"John Smith\"`\n * Pattern - ^[\\p{L}\\p{N}\\p{S} ,.'-]+$\n * MaxLength - 32\n @property locale? (`string`) - A two-characters locale\n * Example - `\"en\"`\n * MinLength - 2\n * MaxLength - 2\n @property metadata? (`Record<string, unknown>`) - \n * Example - `{\"firstName\":\"John\",\"lastName\":\"Smith\"}`\n @property redirectTo? (`string`) - \n * Example - `\"https://my-app.com/catch-redirection\"`\n * Format - uri*/\nexport interface SignUpOptions {\n /**\n *\n * Example - `[\"me\",\"user\"]`\n */\n allowedRoles?: string[];\n /**\n *\n * Example - `\"user\"`\n */\n defaultRole?: string;\n /**\n *\n * Example - `\"John Smith\"`\n * Pattern - ^[\\p{L}\\p{N}\\p{S} ,.'-]+$\n * MaxLength - 32\n */\n displayName?: string;\n /**\n * A two-characters locale\n * Example - `\"en\"`\n * MinLength - 2\n * MaxLength - 2\n */\n locale?: string;\n /**\n *\n * Example - `{\"firstName\":\"John\",\"lastName\":\"Smith\"}`\n */\n metadata?: Record<string, unknown>;\n /**\n *\n * Example - `\"https://my-app.com/catch-redirection\"`\n * Format - uri\n */\n redirectTo?: string;\n}\n\n/**\n * \n @property email (`string`) - A valid email\n * Example - `\"john.smith@nhost.io\"`\n * Format - email\n @property options? (`SignUpOptions`) - */\nexport interface SignUpWebauthnRequest {\n /**\n * A valid email\n * Example - `\"john.smith@nhost.io\"`\n * Format - email\n */\n email: string;\n /**\n *\n */\n options?: SignUpOptions;\n}\n\n/**\n * \n @property credential (`CredentialCreationResponse`) - \n @property options? (`SignUpOptions`) - \n @property nickname? (`string`) - Nickname for the security key*/\nexport interface SignUpWebauthnVerifyRequest {\n /**\n *\n */\n credential: CredentialCreationResponse;\n /**\n *\n */\n options?: SignUpOptions;\n /**\n * Nickname for the security key\n */\n nickname?: string;\n}\n\n/**\n * Response containing TOTP setup information for MFA\n @property imageUrl (`string`) - URL to QR code image for scanning with an authenticator app\n * Example - `\"data:image/png;base64,iVBORw0KGg...\"`\n @property totpSecret (`string`) - TOTP secret key for manual setup with an authenticator app\n * Example - `\"ABCDEFGHIJK23456\"`*/\nexport interface TotpGenerateResponse {\n /**\n * URL to QR code image for scanning with an authenticator app\n * Example - `\"data:image/png;base64,iVBORw0KGg...\"`\n */\n imageUrl: string;\n /**\n * TOTP secret key for manual setup with an authenticator app\n * Example - `\"ABCDEFGHIJK23456\"`\n */\n totpSecret: string;\n}\n\n/**\n * Base64url-encoded binary data\n */\nexport type URLEncodedBase64 = string;\n\n/**\n * User profile and account information\n @property avatarUrl (`string`) - URL to the user's profile picture\n * Example - `\"https://myapp.com/avatars/user123.jpg\"`\n @property createdAt (`string`) - Timestamp when the user account was created\n * Example - `\"2023-01-15T12:34:56Z\"`\n * Format - date-time\n @property defaultRole (`string`) - Default authorization role for the user\n * Example - `\"user\"`\n @property displayName (`string`) - User's display name\n * Example - `\"John Smith\"`\n @property email? (`string`) - User's email address\n * Example - `\"john.smith@nhost.io\"`\n * Format - email\n @property emailVerified (`boolean`) - Whether the user's email has been verified\n * Example - `true`\n @property id (`string`) - Unique identifier for the user\n * Example - `\"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24\"`\n * Pattern - \\b[0-9a-f]{8}\\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\\b[0-9a-f]{12}\\b\n @property isAnonymous (`boolean`) - Whether this is an anonymous user account\n * Example - `false`\n @property locale (`string`) - User's preferred locale (language code)\n * Example - `\"en\"`\n * MinLength - 2\n * MaxLength - 2\n @property metadata (`Record<string, unknown>`) - Custom metadata associated with the user\n * Example - `{\"firstName\":\"John\",\"lastName\":\"Smith\"}`\n @property phoneNumber? (`string`) - User's phone number\n * Example - `\"+12025550123\"`\n @property phoneNumberVerified (`boolean`) - Whether the user's phone number has been verified\n * Example - `false`\n @property roles (`string[]`) - List of roles assigned to the user\n * Example - `[\"user\",\"customer\"]`\n @property activeMfaType? (`string`) - Active MFA type for the user*/\nexport interface User {\n /**\n * URL to the user's profile picture\n * Example - `\"https://myapp.com/avatars/user123.jpg\"`\n */\n avatarUrl: string;\n /**\n * Timestamp when the user account was created\n * Example - `\"2023-01-15T12:34:56Z\"`\n * Format - date-time\n */\n createdAt: string;\n /**\n * Default authorization role for the user\n * Example - `\"user\"`\n */\n defaultRole: string;\n /**\n * User's display name\n * Example - `\"John Smith\"`\n */\n displayName: string;\n /**\n * User's email address\n * Example - `\"john.smith@nhost.io\"`\n * Format - email\n */\n email?: string;\n /**\n * Whether the user's email has been verified\n * Example - `true`\n */\n emailVerified: boolean;\n /**\n * Unique identifier for the user\n * Example - `\"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24\"`\n * Pattern - \\b[0-9a-f]{8}\\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\\b[0-9a-f]{12}\\b\n */\n id: string;\n /**\n * Whether this is an anonymous user account\n * Example - `false`\n */\n isAnonymous: boolean;\n /**\n * User's preferred locale (language code)\n * Example - `\"en\"`\n * MinLength - 2\n * MaxLength - 2\n */\n locale: string;\n /**\n * Custom metadata associated with the user\n * Example - `{\"firstName\":\"John\",\"lastName\":\"Smith\"}`\n */\n metadata: Record<string, unknown>;\n /**\n * User's phone number\n * Example - `\"+12025550123\"`\n */\n phoneNumber?: string;\n /**\n * Whether the user's phone number has been verified\n * Example - `false`\n */\n phoneNumberVerified: boolean;\n /**\n * List of roles assigned to the user\n * Example - `[\"user\",\"customer\"]`\n */\n roles: string[];\n /**\n * Active MFA type for the user\n */\n activeMfaType?: string;\n}\n\n/**\n * Which sign-in method to use\n */\nexport type UserDeanonymizeRequestSignInMethod =\n | \"email-password\"\n | \"passwordless\";\n\n/**\n * \n @property signInMethod (`UserDeanonymizeRequestSignInMethod`) - Which sign-in method to use\n @property email (`string`) - A valid email\n * Example - `\"john.smith@nhost.io\"`\n * Format - email\n @property password? (`string`) - A password of minimum 3 characters\n * Example - `\"Str0ngPassw#ord-94|%\"`\n * MinLength - 3\n * MaxLength - 50\n @property connection? (`string`) - Deprecated, will be ignored\n @property options? (`SignUpOptions`) - */\nexport interface UserDeanonymizeRequest {\n /**\n * Which sign-in method to use\n */\n signInMethod: UserDeanonymizeRequestSignInMethod;\n /**\n * A valid email\n * Example - `\"john.smith@nhost.io\"`\n * Format - email\n */\n email: string;\n /**\n * A password of minimum 3 characters\n * Example - `\"Str0ngPassw#ord-94|%\"`\n * MinLength - 3\n * MaxLength - 50\n */\n password?: string;\n /**\n * Deprecated, will be ignored\n */\n connection?: string;\n /**\n *\n */\n options?: SignUpOptions;\n}\n\n/**\n * \n @property newEmail (`string`) - A valid email\n * Example - `\"john.smith@nhost.io\"`\n * Format - email\n @property options? (`OptionsRedirectTo`) - */\nexport interface UserEmailChangeRequest {\n /**\n * A valid email\n * Example - `\"john.smith@nhost.io\"`\n * Format - email\n */\n newEmail: string;\n /**\n *\n */\n options?: OptionsRedirectTo;\n}\n\n/**\n * \n @property email (`string`) - A valid email\n * Example - `\"john.smith@nhost.io\"`\n * Format - email\n @property options? (`OptionsRedirectTo`) - */\nexport interface UserEmailSendVerificationEmailRequest {\n /**\n * A valid email\n * Example - `\"john.smith@nhost.io\"`\n * Format - email\n */\n email: string;\n /**\n *\n */\n options?: OptionsRedirectTo;\n}\n\n/**\n * \n @property name (`string`) - A human-palatable name for the entity\n @property displayName (`string`) - A human-palatable name for the user account, intended only for display\n @property id (`string`) - The user handle of the user account entity*/\nexport interface UserEntity {\n /**\n * A human-palatable name for the entity\n */\n name: string;\n /**\n * A human-palatable name for the user account, intended only for display\n */\n displayName: string;\n /**\n * The user handle of the user account entity\n */\n id: string;\n}\n\n/**\n * Type of MFA to activate. Use empty string to disable MFA.\n */\nexport type UserMfaRequestActiveMfaType = \"totp\" | \"\";\n\n/**\n * Request to activate or deactivate multi-factor authentication\n @property code (`string`) - Verification code from the authenticator app when activating MFA\n * Example - `\"123456\"`\n @property activeMfaType? (`UserMfaRequestActiveMfaType`) - Type of MFA to activate. Use empty string to disable MFA.\n * Example - `\"totp\"`*/\nexport interface UserMfaRequest {\n /**\n * Verification code from the authenticator app when activating MFA\n * Example - `\"123456\"`\n */\n code: string;\n /**\n * Type of MFA to activate. Use empty string to disable MFA.\n * Example - `\"totp\"`\n */\n activeMfaType?: UserMfaRequestActiveMfaType;\n}\n\n/**\n * \n @property newPassword (`string`) - A password of minimum 3 characters\n * Example - `\"Str0ngPassw#ord-94|%\"`\n * MinLength - 3\n * MaxLength - 50\n @property ticket? (`string`) - Ticket to reset the password, required if the user is not authenticated\n * Pattern - ^passwordReset\\:.*$*/\nexport interface UserPasswordRequest {\n /**\n * A password of minimum 3 characters\n * Example - `\"Str0ngPassw#ord-94|%\"`\n * MinLength - 3\n * MaxLength - 50\n */\n newPassword: string;\n /**\n * Ticket to reset the password, required if the user is not authenticated\n * Pattern - ^passwordReset\\:.*$\n */\n ticket?: string;\n}\n\n/**\n * \n @property email (`string`) - A valid email\n * Example - `\"john.smith@nhost.io\"`\n * Format - email\n @property options? (`OptionsRedirectTo`) - */\nexport interface UserPasswordResetRequest {\n /**\n * A valid email\n * Example - `\"john.smith@nhost.io\"`\n * Format - email\n */\n email: string;\n /**\n *\n */\n options?: OptionsRedirectTo;\n}\n\n/**\n * A requirement for user verification for the operation\n */\nexport type UserVerificationRequirement =\n | \"required\"\n | \"preferred\"\n | \"discouraged\";\n\n/**\n * \n @property credential (`CredentialCreationResponse`) - \n @property nickname? (`string`) - Optional nickname for the security key*/\nexport interface VerifyAddSecurityKeyRequest {\n /**\n *\n */\n credential: CredentialCreationResponse;\n /**\n * Optional nickname for the security key\n */\n nickname?: string;\n}\n\n/**\n * \n @property id (`string`) - The ID of the newly added security key\n * Example - `\"123e4567-e89b-12d3-a456-426614174000\"`\n @property nickname? (`string`) - The nickname of the security key if provided*/\nexport interface VerifyAddSecurityKeyResponse {\n /**\n * The ID of the newly added security key\n * Example - `\"123e4567-e89b-12d3-a456-426614174000\"`\n */\n id: string;\n /**\n * The nickname of the security key if provided\n */\n nickname?: string;\n}\n\n/**\n * \n @property token? (`string`) - JWT token to verify*/\nexport interface VerifyTokenRequest {\n /**\n * JWT token to verify\n */\n token?: string;\n}\n\n/**\n * Target URL for the redirect\n */\nexport type RedirectToQuery = string;\n\n/**\n *\n */\nexport type SignInProvider =\n | \"apple\"\n | \"github\"\n | \"google\"\n | \"linkedin\"\n | \"discord\"\n | \"spotify\"\n | \"twitch\"\n | \"gitlab\"\n | \"bitbucket\"\n | \"workos\"\n | \"azuread\"\n | \"strava\"\n | \"facebook\"\n | \"windowslive\"\n | \"twitter\";\n\n/**\n * Ticket\n */\nexport type TicketQuery = string;\n\n/**\n * Type of the ticket\n */\nexport type TicketTypeQuery =\n | \"emailVerify\"\n | \"emailConfirmChange\"\n | \"signinPasswordless\"\n | \"passwordReset\";\n\n/**\n * \n @property version (`string`) - The version of the authentication service\n * Example - `\"1.2.3\"`*/\nexport interface GetVersionResponse200 {\n /**\n * The version of the authentication service\n * Example - `\"1.2.3\"`\n */\n version: string;\n}\n\n/**\n * Parameters for the signInProvider method.\n @property allowedRoles? (string[]) - Array of allowed roles for the user\n \n @property defaultRole? (string) - Default role for the user\n \n @property displayName? (string) - Display name for the user\n \n @property locale? (string) - A two-characters locale\n \n @property metadata? (Record<string, unknown>) - Additional metadata for the user (JSON encoded string)\n \n @property redirectTo? (string) - URI to redirect to\n \n @property connect? (string) - If set, this means that the user is already authenticated and wants to link their account. This needs to be a valid JWT access token.\n */\nexport interface SignInProviderParams {\n /**\n * Array of allowed roles for the user\n \n */\n allowedRoles?: string[];\n /**\n * Default role for the user\n \n */\n defaultRole?: string;\n /**\n * Display name for the user\n \n */\n displayName?: string;\n /**\n * A two-characters locale\n \n */\n locale?: string;\n /**\n * Additional metadata for the user (JSON encoded string)\n \n */\n metadata?: Record<string, unknown>;\n /**\n * URI to redirect to\n \n */\n redirectTo?: string;\n /**\n * If set, this means that the user is already authenticated and wants to link their account. This needs to be a valid JWT access token.\n \n */\n connect?: string;\n}\n/**\n * Parameters for the verifyTicket method.\n @property ticket (TicketQuery) - Ticket\n \n * Ticket\n @property type? (TicketTypeQuery) - Type of the ticket. Deprecated, no longer used\n \n * Type of the ticket\n @property redirectTo (RedirectToQuery) - Target URL for the redirect\n \n * Target URL for the redirect*/\nexport interface VerifyTicketParams {\n /**\n * Ticket\n \n * Ticket\n */\n ticket: TicketQuery;\n /**\n * Type of the ticket. Deprecated, no longer used\n \n * Type of the ticket\n */\n type?: TicketTypeQuery;\n /**\n * Target URL for the redirect\n \n * Target URL for the redirect\n */\n redirectTo: RedirectToQuery;\n}\n\nexport interface Client {\n baseURL: string;\n pushChainFunction(chainFunction: ChainFunction): void;\n /**\n Summary: Get public keys for JWT verification in JWK Set format\n Retrieve the JSON Web Key Set (JWKS) containing public keys used to verify JWT signatures. This endpoint is used by clients to validate access tokens.\n\n This method may return different T based on the response code:\n - 200: JWKSet\n */\n getJWKs(options?: RequestInit): Promise<FetchResponse<JWKSet>>;\n\n /**\n Summary: Elevate access for an already signed in user using FIDO2 Webauthn\n Generate a Webauthn challenge for elevating user permissions\n\n This method may return different T based on the response code:\n - 200: PublicKeyCredentialRequestOptions\n */\n elevateWebauthn(\n options?: RequestInit,\n ): Promise<FetchResponse<PublicKeyCredentialRequestOptions>>;\n\n /**\n Summary: Verify FIDO2 Webauthn authentication using public-key cryptography for elevation\n Complete Webauthn elevation by verifying the authentication response\n\n This method may return different T based on the response code:\n - 200: SessionPayload\n */\n verifyElevateWebauthn(\n body: SignInWebauthnVerifyRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<SessionPayload>>;\n\n /**\n Summary: Health check (GET)\n Verify if the authentication service is operational using GET method\n\n This method may return different T based on the response code:\n - 200: OKResponse\n */\n healthCheckGet(options?: RequestInit): Promise<FetchResponse<OKResponse>>;\n\n /**\n Summary: Health check (HEAD)\n Verify if the authentication service is operational using HEAD method\n\n This method may return different T based on the response code:\n - 200: void\n */\n healthCheckHead(options?: RequestInit): Promise<FetchResponse<void>>;\n\n /**\n Summary: Link a user account with the provider's account using an id token\n Link the authenticated user's account with an external OAuth provider account using an ID token. Requires elevated permissions.\n\n This method may return different T based on the response code:\n - 200: OKResponse\n */\n linkIdToken(\n body: LinkIdTokenRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<OKResponse>>;\n\n /**\n Summary: Generate TOTP secret\n Generate a Time-based One-Time Password (TOTP) secret for setting up multi-factor authentication\n\n This method may return different T based on the response code:\n - 200: TotpGenerateResponse\n */\n changeUserMfa(\n options?: RequestInit,\n ): Promise<FetchResponse<TotpGenerateResponse>>;\n\n /**\n Summary: Create a Personal Access Token (PAT)\n Generate a new Personal Access Token for programmatic API access. PATs are long-lived tokens that can be used instead of regular authentication for automated systems. Requires elevated permissions.\n\n This method may return different T based on the response code:\n - 200: CreatePATResponse\n */\n createPAT(\n body: CreatePATRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<CreatePATResponse>>;\n\n /**\n Summary: Sign in anonymously\n Create an anonymous user session without providing credentials. Anonymous users can be converted to regular users later via the deanonymize endpoint.\n\n This method may return different T based on the response code:\n - 200: SessionPayload\n */\n signInAnonymous(\n body?: SignInAnonymousRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<SessionPayload>>;\n\n /**\n Summary: Sign in with email and password\n Authenticate a user with their email and password. Returns a session object or MFA challenge if two-factor authentication is enabled.\n\n This method may return different T based on the response code:\n - 200: SignInEmailPasswordResponse\n */\n signInEmailPassword(\n body: SignInEmailPasswordRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<SignInEmailPasswordResponse>>;\n\n /**\n Summary: Sign in with an ID token\n Authenticate using an ID token from a supported OAuth provider (Apple or Google). Creates a new user account if one doesn't exist.\n\n This method may return different T based on the response code:\n - 200: SessionPayload\n */\n signInIdToken(\n body: SignInIdTokenRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<SessionPayload>>;\n\n /**\n Summary: Verify TOTP for MFA\n Complete the multi-factor authentication by verifying a Time-based One-Time Password (TOTP). Returns a session if validation is successful.\n\n This method may return different T based on the response code:\n - 200: SessionPayload\n */\n verifySignInMfaTotp(\n body: SignInMfaTotpRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<SessionPayload>>;\n\n /**\n Summary: Sign in with email OTP\n Initiate email-based one-time password authentication. Sends an OTP to the specified email address. If the user doesn't exist, a new account will be created with the provided options.\n\n This method may return different T based on the response code:\n - 200: OKResponse\n */\n signInOTPEmail(\n body: SignInOTPEmailRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<OKResponse>>;\n\n /**\n Summary: Verify email OTP\n Complete email OTP authentication by verifying the one-time password. Returns a session if validation is successful.\n\n This method may return different T based on the response code:\n - 200: SignInOTPEmailVerifyResponse\n */\n verifySignInOTPEmail(\n body: SignInOTPEmailVerifyRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<SignInOTPEmailVerifyResponse>>;\n\n /**\n Summary: Sign in with magic link email\n Initiate passwordless authentication by sending a magic link to the user's email. If the user doesn't exist, a new account will be created with the provided options.\n\n This method may return different T based on the response code:\n - 200: OKResponse\n */\n signInPasswordlessEmail(\n body: SignInPasswordlessEmailRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<OKResponse>>;\n\n /**\n Summary: Sign in with SMS OTP\n Initiate passwordless authentication by sending a one-time password to the user's phone number. If the user doesn't exist, a new account will be created with the provided options.\n\n This method may return different T based on the response code:\n - 200: OKResponse\n */\n signInPasswordlessSms(\n body: SignInPasswordlessSmsRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<OKResponse>>;\n\n /**\n Summary: Verify SMS OTP\n Complete passwordless SMS authentication by verifying the one-time password. Returns a session if validation is successful.\n\n This method may return different T based on the response code:\n - 200: SignInPasswordlessSmsOtpResponse\n */\n verifySignInPasswordlessSms(\n body: SignInPasswordlessSmsOtpRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<SignInPasswordlessSmsOtpResponse>>;\n\n /**\n Summary: Sign in with Personal Access Token (PAT)\n Authenticate using a Personal Access Token. PATs are long-lived tokens that can be used for programmatic access to the API.\n\n This method may return different T based on the response code:\n - 200: SessionPayload\n */\n signInPAT(\n body: SignInPATRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<SessionPayload>>;\n\n /**\n Summary: Sign in with an OAuth2 provider\n Initiate OAuth2 authentication flow with a social provider. Redirects the user to the provider's authorization page.\n\n As this method is a redirect, it returns a URL string instead of a Promise\n */\n signInProviderURL(\n provider: SignInProvider,\n params?: SignInProviderParams,\n options?: RequestInit,\n ): string;\n\n /**\n Summary: Sign in with Webauthn\n Initiate a Webauthn sign-in process by sending a challenge to the user's device. The user must have previously registered a Webauthn credential.\n\n This method may return different T based on the response code:\n - 200: PublicKeyCredentialRequestOptions\n */\n signInWebauthn(\n body?: SignInWebauthnRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<PublicKeyCredentialRequestOptions>>;\n\n /**\n Summary: Verify Webauthn sign-in\n Complete the Webauthn sign-in process by verifying the response from the user's device. Returns a session if validation is successful.\n\n This method may return different T based on the response code:\n - 200: SessionPayload\n */\n verifySignInWebauthn(\n body: SignInWebauthnVerifyRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<SessionPayload>>;\n\n /**\n Summary: Sign out\n End the current user session by invalidating refresh tokens. Optionally sign out from all devices.\n\n This method may return different T based on the response code:\n - 200: OKResponse\n */\n signOut(\n body: SignOutRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<OKResponse>>;\n\n /**\n Summary: Sign up with email and password\n Register a new user account with email and password. Returns a session if email verification is not required, otherwise returns null session.\n\n This method may return different T based on the response code:\n - 200: SessionPayload\n */\n signUpEmailPassword(\n body: SignUpEmailPasswordRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<SessionPayload>>;\n\n /**\n Summary: Sign up with Webauthn\n Initiate a Webauthn sign-up process by sending a challenge to the user's device. The user must not have an existing account.\n\n This method may return different T based on the response code:\n - 200: PublicKeyCredentialCreationOptions\n */\n signUpWebauthn(\n body: SignUpWebauthnRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<PublicKeyCredentialCreationOptions>>;\n\n /**\n Summary: Verify Webauthn sign-up\n Complete the Webauthn sign-up process by verifying the response from the user's device. Returns a session if validation is successful.\n\n This method may return different T based on the response code:\n - 200: SessionPayload\n */\n verifySignUpWebauthn(\n body: SignUpWebauthnVerifyRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<SessionPayload>>;\n\n /**\n Summary: Refresh access token\n Generate a new JWT access token using a valid refresh token. The refresh token used will be revoked and a new one will be issued.\n\n This method may return different T based on the response code:\n - 200: Session\n */\n refreshToken(\n body: RefreshTokenRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<Session>>;\n\n /**\n Summary: Verify JWT token\n Verify the validity of a JWT access token. If no request body is provided, the Authorization header will be used for verification.\n\n This method may return different T based on the response code:\n - 200: string\n */\n verifyToken(\n body?: VerifyTokenRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<string>>;\n\n /**\n Summary: Get user information\n Retrieve the authenticated user's profile information including roles, metadata, and account status.\n\n This method may return different T based on the response code:\n - 200: User\n */\n getUser(options?: RequestInit): Promise<FetchResponse<User>>;\n\n /**\n Summary: Deanonymize an anonymous user\n Convert an anonymous user to a regular user by adding email and optionally password credentials. A confirmation email will be sent if the server is configured to do so.\n\n This method may return different T based on the response code:\n - 200: OKResponse\n */\n deanonymizeUser(\n body: UserDeanonymizeRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<OKResponse>>;\n\n /**\n Summary: Change user email\n Request to change the authenticated user's email address. A verification email will be sent to the new address to confirm the change. Requires elevated permissions.\n\n This method may return different T based on the response code:\n - 200: OKResponse\n */\n changeUserEmail(\n body: UserEmailChangeRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<OKResponse>>;\n\n /**\n Summary: Send verification email\n Send an email verification link to the specified email address. Used to verify email addresses for new accounts or email changes.\n\n This method may return different T based on the response code:\n - 200: OKResponse\n */\n sendVerificationEmail(\n body: UserEmailSendVerificationEmailRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<OKResponse>>;\n\n /**\n Summary: Manage multi-factor authentication\n Activate or deactivate multi-factor authentication for the authenticated user\n\n This method may return different T based on the response code:\n - 200: OKResponse\n */\n verifyChangeUserMfa(\n body: UserMfaRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<OKResponse>>;\n\n /**\n Summary: Change user password\n Change the user's password. The user must be authenticated with elevated permissions or provide a valid password reset ticket.\n\n This method may return different T based on the response code:\n - 200: OKResponse\n */\n changeUserPassword(\n body: UserPasswordRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<OKResponse>>;\n\n /**\n Summary: Request password reset\n Request a password reset for a user account. An email with a verification link will be sent to the user's email address to complete the password reset process.\n\n This method may return different T based on the response code:\n - 200: OKResponse\n */\n sendPasswordResetEmail(\n body: UserPasswordResetRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<OKResponse>>;\n\n /**\n Summary: Initialize adding of a new webauthn security key\n Start the process of adding a new WebAuthn security key to the user's account. Returns a challenge that must be completed by the user's authenticator device. Requires elevated permissions.\n\n This method may return different T based on the response code:\n - 200: PublicKeyCredentialCreationOptions\n */\n addSecurityKey(\n options?: RequestInit,\n ): Promise<FetchResponse<PublicKeyCredentialCreationOptions>>;\n\n /**\n Summary: Verify adding of a new webauthn security key\n Complete the process of adding a new WebAuthn security key by verifying the authenticator response. Requires elevated permissions.\n\n This method may return different T based on the response code:\n - 200: VerifyAddSecurityKeyResponse\n */\n verifyAddSecurityKey(\n body: VerifyAddSecurityKeyRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<VerifyAddSecurityKeyResponse>>;\n\n /**\n Summary: Verify email and authentication tickets\n Verify tickets created by email verification, magic link authentication, or password reset processes. Redirects the user to the appropriate destination upon successful verification.\n\n As this method is a redirect, it returns a URL string instead of a Promise\n */\n verifyTicketURL(params?: VerifyTicketParams, options?: RequestInit): string;\n\n /**\n Summary: Get service version\n Retrieve version information about the authentication service\n\n This method may return different T based on the response code:\n - 200: GetVersionResponse200\n */\n getVersion(\n options?: RequestInit,\n ): Promise<FetchResponse<GetVersionResponse200>>;\n}\n\nexport const createAPIClient = (\n baseURL: string,\n chainFunctions: ChainFunction[] = [],\n): Client => {\n let fetch = createEnhancedFetch(chainFunctions);\n\n const pushChainFunction = (chainFunction: ChainFunction) => {\n chainFunctions.push(chainFunction);\n fetch = createEnhancedFetch(chainFunctions);\n };\n const getJWKs = async (\n options?: RequestInit,\n ): Promise<FetchResponse<JWKSet>> => {\n const url = `${baseURL}/.well-known/jwks.json`;\n const res = await fetch(url, {\n ...options,\n method: \"GET\",\n headers: {\n ...options?.headers,\n },\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: JWKSet = responseBody ? JSON.parse(responseBody) : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<JWKSet>;\n };\n\n const elevateWebauthn = async (\n options?: RequestInit,\n ): Promise<FetchResponse<PublicKeyCredentialRequestOptions>> => {\n const url = `${baseURL}/elevate/webauthn`;\n const res = await fetch(url, {\n ...options,\n method: \"POST\",\n headers: {\n ...options?.headers,\n },\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: PublicKeyCredentialRequestOptions = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<PublicKeyCredentialRequestOptions>;\n };\n\n const verifyElevateWebauthn = async (\n body: SignInWebauthnVerifyRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<SessionPayload>> => {\n const url = `${baseURL}/elevate/webauthn/verify`;\n const res = await fetch(url, {\n ...options,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n body: JSON.stringify(body),\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: SessionPayload = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<SessionPayload>;\n };\n\n const healthCheckGet = async (\n options?: RequestInit,\n ): Promise<FetchResponse<OKResponse>> => {\n const url = `${baseURL}/healthz`;\n const res = await fetch(url, {\n ...options,\n method: \"GET\",\n headers: {\n ...options?.headers,\n },\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: OKResponse = responseBody ? JSON.parse(responseBody) : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<OKResponse>;\n };\n\n const healthCheckHead = async (\n options?: RequestInit,\n ): Promise<FetchResponse<void>> => {\n const url = `${baseURL}/healthz`;\n const res = await fetch(url, {\n ...options,\n method: \"HEAD\",\n headers: {\n ...options?.headers,\n },\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const payload: undefined = undefined;\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<void>;\n };\n\n const linkIdToken = async (\n body: LinkIdTokenRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<OKResponse>> => {\n const url = `${baseURL}/link/idtoken`;\n const res = await fetch(url, {\n ...options,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n body: JSON.stringify(body),\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: OKResponse = responseBody ? JSON.parse(responseBody) : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<OKResponse>;\n };\n\n const changeUserMfa = async (\n options?: RequestInit,\n ): Promise<FetchResponse<TotpGenerateResponse>> => {\n const url = `${baseURL}/mfa/totp/generate`;\n const res = await fetch(url, {\n ...options,\n method: \"GET\",\n headers: {\n ...options?.headers,\n },\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: TotpGenerateResponse = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<TotpGenerateResponse>;\n };\n\n const createPAT = async (\n body: CreatePATRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<CreatePATResponse>> => {\n const url = `${baseURL}/pat`;\n const res = await fetch(url, {\n ...options,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n body: JSON.stringify(body),\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: CreatePATResponse = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<CreatePATResponse>;\n };\n\n const signInAnonymous = async (\n body?: SignInAnonymousRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<SessionPayload>> => {\n const url = `${baseURL}/signin/anonymous`;\n const res = await fetch(url, {\n ...options,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n body: JSON.stringify(body),\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: SessionPayload = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<SessionPayload>;\n };\n\n const signInEmailPassword = async (\n body: SignInEmailPasswordRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<SignInEmailPasswordResponse>> => {\n const url = `${baseURL}/signin/email-password`;\n const res = await fetch(url, {\n ...options,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n body: JSON.stringify(body),\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: SignInEmailPasswordResponse = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<SignInEmailPasswordResponse>;\n };\n\n const signInIdToken = async (\n body: SignInIdTokenRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<SessionPayload>> => {\n const url = `${baseURL}/signin/idtoken`;\n const res = await fetch(url, {\n ...options,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n body: JSON.stringify(body),\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: SessionPayload = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<SessionPayload>;\n };\n\n const verifySignInMfaTotp = async (\n body: SignInMfaTotpRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<SessionPayload>> => {\n const url = `${baseURL}/signin/mfa/totp`;\n const res = await fetch(url, {\n ...options,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n body: JSON.stringify(body),\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: SessionPayload = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<SessionPayload>;\n };\n\n const signInOTPEmail = async (\n body: SignInOTPEmailRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<OKResponse>> => {\n const url = `${baseURL}/signin/otp/email`;\n const res = await fetch(url, {\n ...options,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n body: JSON.stringify(body),\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: OKResponse = responseBody ? JSON.parse(responseBody) : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<OKResponse>;\n };\n\n const verifySignInOTPEmail = async (\n body: SignInOTPEmailVerifyRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<SignInOTPEmailVerifyResponse>> => {\n const url = `${baseURL}/signin/otp/email/verify`;\n const res = await fetch(url, {\n ...options,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n body: JSON.stringify(body),\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: SignInOTPEmailVerifyResponse = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<SignInOTPEmailVerifyResponse>;\n };\n\n const signInPasswordlessEmail = async (\n body: SignInPasswordlessEmailRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<OKResponse>> => {\n const url = `${baseURL}/signin/passwordless/email`;\n const res = await fetch(url, {\n ...options,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n body: JSON.stringify(body),\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: OKResponse = responseBody ? JSON.parse(responseBody) : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<OKResponse>;\n };\n\n const signInPasswordlessSms = async (\n body: SignInPasswordlessSmsRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<OKResponse>> => {\n const url = `${baseURL}/signin/passwordless/sms`;\n const res = await fetch(url, {\n ...options,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n body: JSON.stringify(body),\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: OKResponse = responseBody ? JSON.parse(responseBody) : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<OKResponse>;\n };\n\n const verifySignInPasswordlessSms = async (\n body: SignInPasswordlessSmsOtpRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<SignInPasswordlessSmsOtpResponse>> => {\n const url = `${baseURL}/signin/passwordless/sms/otp`;\n const res = await fetch(url, {\n ...options,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n body: JSON.stringify(body),\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: SignInPasswordlessSmsOtpResponse = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<SignInPasswordlessSmsOtpResponse>;\n };\n\n const signInPAT = async (\n body: SignInPATRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<SessionPayload>> => {\n const url = `${baseURL}/signin/pat`;\n const res = await fetch(url, {\n ...options,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n body: JSON.stringify(body),\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: SessionPayload = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<SessionPayload>;\n };\n\n const signInProviderURL = (\n provider: SignInProvider,\n params?: SignInProviderParams,\n ): string => {\n const encodedParameters =\n params &&\n Object.entries(params)\n .map(([key, value]) => {\n const stringValue = Array.isArray(value)\n ? value.join(\",\")\n : typeof value === \"object\"\n ? JSON.stringify(value)\n : (value as string);\n return `${key}=${encodeURIComponent(stringValue)}`;\n })\n .join(\"&\");\n\n const url = encodedParameters\n ? `${baseURL}/signin/provider/${provider}?${encodedParameters}`\n : `${baseURL}/signin/provider/${provider}`;\n return url;\n };\n\n const signInWebauthn = async (\n body?: SignInWebauthnRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<PublicKeyCredentialRequestOptions>> => {\n const url = `${baseURL}/signin/webauthn`;\n const res = await fetch(url, {\n ...options,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n body: JSON.stringify(body),\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: PublicKeyCredentialRequestOptions = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<PublicKeyCredentialRequestOptions>;\n };\n\n const verifySignInWebauthn = async (\n body: SignInWebauthnVerifyRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<SessionPayload>> => {\n const url = `${baseURL}/signin/webauthn/verify`;\n const res = await fetch(url, {\n ...options,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n body: JSON.stringify(body),\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: SessionPayload = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<SessionPayload>;\n };\n\n const signOut = async (\n body: SignOutRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<OKResponse>> => {\n const url = `${baseURL}/signout`;\n const res = await fetch(url, {\n ...options,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n body: JSON.stringify(body),\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: OKResponse = responseBody ? JSON.parse(responseBody) : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<OKResponse>;\n };\n\n const signUpEmailPassword = async (\n body: SignUpEmailPasswordRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<SessionPayload>> => {\n const url = `${baseURL}/signup/email-password`;\n const res = await fetch(url, {\n ...options,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n body: JSON.stringify(body),\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: SessionPayload = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<SessionPayload>;\n };\n\n const signUpWebauthn = async (\n body: SignUpWebauthnRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<PublicKeyCredentialCreationOptions>> => {\n const url = `${baseURL}/signup/webauthn`;\n const res = await fetch(url, {\n ...options,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n body: JSON.stringify(body),\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: PublicKeyCredentialCreationOptions = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<PublicKeyCredentialCreationOptions>;\n };\n\n const verifySignUpWebauthn = async (\n body: SignUpWebauthnVerifyRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<SessionPayload>> => {\n const url = `${baseURL}/signup/webauthn/verify`;\n const res = await fetch(url, {\n ...options,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n body: JSON.stringify(body),\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: SessionPayload = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<SessionPayload>;\n };\n\n const refreshToken = async (\n body: RefreshTokenRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<Session>> => {\n const url = `${baseURL}/token`;\n const res = await fetch(url, {\n ...options,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n body: JSON.stringify(body),\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: Session = responseBody ? JSON.parse(responseBody) : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<Session>;\n };\n\n const verifyToken = async (\n body?: VerifyTokenRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<string>> => {\n const url = `${baseURL}/token/verify`;\n const res = await fetch(url, {\n ...options,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n body: JSON.stringify(body),\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: string = responseBody ? JSON.parse(responseBody) : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<string>;\n };\n\n const getUser = async (\n options?: RequestInit,\n ): Promise<FetchResponse<User>> => {\n const url = `${baseURL}/user`;\n const res = await fetch(url, {\n ...options,\n method: \"GET\",\n headers: {\n ...options?.headers,\n },\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: User = responseBody ? JSON.parse(responseBody) : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<User>;\n };\n\n const deanonymizeUser = async (\n body: UserDeanonymizeRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<OKResponse>> => {\n const url = `${baseURL}/user/deanonymize`;\n const res = await fetch(url, {\n ...options,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n body: JSON.stringify(body),\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: OKResponse = responseBody ? JSON.parse(responseBody) : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<OKResponse>;\n };\n\n const changeUserEmail = async (\n body: UserEmailChangeRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<OKResponse>> => {\n const url = `${baseURL}/user/email/change`;\n const res = await fetch(url, {\n ...options,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n body: JSON.stringify(body),\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: OKResponse = responseBody ? JSON.parse(responseBody) : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<OKResponse>;\n };\n\n const sendVerificationEmail = async (\n body: UserEmailSendVerificationEmailRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<OKResponse>> => {\n const url = `${baseURL}/user/email/send-verification-email`;\n const res = await fetch(url, {\n ...options,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n body: JSON.stringify(body),\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: OKResponse = responseBody ? JSON.parse(responseBody) : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<OKResponse>;\n };\n\n const verifyChangeUserMfa = async (\n body: UserMfaRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<OKResponse>> => {\n const url = `${baseURL}/user/mfa`;\n const res = await fetch(url, {\n ...options,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n body: JSON.stringify(body),\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: OKResponse = responseBody ? JSON.parse(responseBody) : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<OKResponse>;\n };\n\n const changeUserPassword = async (\n body: UserPasswordRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<OKResponse>> => {\n const url = `${baseURL}/user/password`;\n const res = await fetch(url, {\n ...options,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n body: JSON.stringify(body),\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: OKResponse = responseBody ? JSON.parse(responseBody) : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<OKResponse>;\n };\n\n const sendPasswordResetEmail = async (\n body: UserPasswordResetRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<OKResponse>> => {\n const url = `${baseURL}/user/password/reset`;\n const res = await fetch(url, {\n ...options,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n body: JSON.stringify(body),\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: OKResponse = responseBody ? JSON.parse(responseBody) : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<OKResponse>;\n };\n\n const addSecurityKey = async (\n options?: RequestInit,\n ): Promise<FetchResponse<PublicKeyCredentialCreationOptions>> => {\n const url = `${baseURL}/user/webauthn/add`;\n const res = await fetch(url, {\n ...options,\n method: \"POST\",\n headers: {\n ...options?.headers,\n },\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: PublicKeyCredentialCreationOptions = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<PublicKeyCredentialCreationOptions>;\n };\n\n const verifyAddSecurityKey = async (\n body: VerifyAddSecurityKeyRequest,\n options?: RequestInit,\n ): Promise<FetchResponse<VerifyAddSecurityKeyResponse>> => {\n const url = `${baseURL}/user/webauthn/verify`;\n const res = await fetch(url, {\n ...options,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n body: JSON.stringify(body),\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: VerifyAddSecurityKeyResponse = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<VerifyAddSecurityKeyResponse>;\n };\n\n const verifyTicketURL = (params?: VerifyTicketParams): string => {\n const encodedParameters =\n params &&\n Object.entries(params)\n .map(([key, value]) => {\n const stringValue = Array.isArray(value)\n ? value.join(\",\")\n : typeof value === \"object\"\n ? JSON.stringify(value)\n : (value as string);\n return `${key}=${encodeURIComponent(stringValue)}`;\n })\n .join(\"&\");\n\n const url = encodedParameters\n ? `${baseURL}/verify?${encodedParameters}`\n : `${baseURL}/verify`;\n return url;\n };\n\n const getVersion = async (\n options?: RequestInit,\n ): Promise<FetchResponse<GetVersionResponse200>> => {\n const url = `${baseURL}/version`;\n const res = await fetch(url, {\n ...options,\n method: \"GET\",\n headers: {\n ...options?.headers,\n },\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: GetVersionResponse200 = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<GetVersionResponse200>;\n };\n\n return {\n baseURL,\n pushChainFunction,\n getJWKs,\n elevateWebauthn,\n verifyElevateWebauthn,\n healthCheckGet,\n healthCheckHead,\n linkIdToken,\n changeUserMfa,\n createPAT,\n signInAnonymous,\n signInEmailPassword,\n signInIdToken,\n verifySignInMfaTotp,\n signInOTPEmail,\n verifySignInOTPEmail,\n signInPasswordlessEmail,\n signInPasswordlessSms,\n verifySignInPasswordlessSms,\n signInPAT,\n signInProviderURL,\n signInWebauthn,\n verifySignInWebauthn,\n signOut,\n signUpEmailPassword,\n signUpWebauthn,\n verifySignUpWebauthn,\n refreshToken,\n verifyToken,\n getUser,\n deanonymizeUser,\n changeUserEmail,\n sendVerificationEmail,\n verifyChangeUserMfa,\n changeUserPassword,\n sendPasswordResetEmail,\n addSecurityKey,\n verifyAddSecurityKey,\n verifyTicketURL,\n getVersion,\n };\n};\n"],"names":["baseURL","chainFunctions","fetch","createEnhancedFetch","pushChainFunction","chainFunction","push","getJWKs","async","options","url","res","method","headers","status","responseBody","includes","text","payload","JSON","parse","FetchError","body","elevateWebauthn","verifyElevateWebauthn","stringify","healthCheckGet","healthCheckHead","linkIdToken","changeUserMfa","createPAT","signInAnonymous","signInEmailPassword","signInIdToken","verifySignInMfaTotp","signInOTPEmail","verifySignInOTPEmail","signInPasswordlessEmail","signInPasswordlessSms","verifySignInPasswordlessSms","signInPAT","signInProviderURL","provider","params","encodedParameters","Object","entries","map","key","value","stringValue","Array","isArray","join","encodeURIComponent","signInWebauthn","verifySignInWebauthn","signOut","signUpEmailPassword","signUpWebauthn","verifySignUpWebauthn","refreshToken","verifyToken","getUser","deanonymizeUser","changeUserEmail","sendVerificationEmail","verifyChangeUserMfa","changeUserPassword","sendPasswordResetEmail","addSecurityKey","verifyAddSecurityKey","verifyTicketURL","getVersion"],"mappings":"gJAggE+B,CAC7BA,EACAC,EAAkC,MAElC,IAAIC,EAAQC,EAAAA,oBAAoBF,GAguChC,MAAO,CACLD,UACAI,kBAhuCyBC,IACzBJ,EAAeK,KAAKD,GACpBH,EAAQC,EAAAA,oBAAoBF,EAAc,EA+tC1CM,QA7tCcC,MACdC,IAEA,MAAMC,EAAM,GAAGV,0BACTW,QAAYT,EAAMQ,EAAK,IACxBD,EACHG,OAAQ,MACRC,QAAS,IACJJ,GAASI,WAIhB,GAAIF,EAAIG,QAAU,IAAK,CACrB,MAAMC,EAAe,CAAC,KAAKC,SAASL,EAAIG,QAAU,WAAaH,EAAIM,OAC7DC,EAAmBH,EAAeI,KAAKC,MAAML,GAAgB,CAAA,EACnE,MAAM,IAAIM,EAAAA,WAAWH,EAASP,EAAIG,OAAQH,EAAIE,QAChD,CAEA,MAAME,EAAe,CAAC,IAAK,IAAK,KAAKC,SAASL,EAAIG,QAC9C,WACMH,EAAIM,OAGd,MAAO,CACLK,KAHsBP,EAAeI,KAAKC,MAAML,GAAgB,CAAA,EAIhED,OAAQH,EAAIG,OACZD,QAASF,EAAIE,QAAA,EAosCfU,gBAhsCsBf,MACtBC,IAEA,MAAMC,EAAM,GAAGV,qBACTW,QAAYT,EAAMQ,EAAK,IACxBD,E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