alepha 0.20.2 → 0.20.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (208) hide show
  1. package/README.md +0 -1
  2. package/assets/swagger-ui/swagger-ui-bundle.js +1 -1
  3. package/assets/swagger-ui/swagger-ui.css +1 -1
  4. package/dist/api/audits/index.browser.js +49 -0
  5. package/dist/api/audits/index.browser.js.map +1 -1
  6. package/dist/api/audits/index.d.ts.map +1 -1
  7. package/dist/api/audits/index.js +49 -0
  8. package/dist/api/audits/index.js.map +1 -1
  9. package/dist/api/files/index.d.ts.map +1 -1
  10. package/dist/api/files/index.js.map +1 -1
  11. package/dist/api/jobs/index.d.ts +16 -75
  12. package/dist/api/jobs/index.d.ts.map +1 -1
  13. package/dist/api/jobs/index.js.map +1 -1
  14. package/dist/api/keys/index.js.map +1 -1
  15. package/dist/api/notifications/index.d.ts +1 -10
  16. package/dist/api/notifications/index.d.ts.map +1 -1
  17. package/dist/api/organizations/index.d.ts.map +1 -1
  18. package/dist/api/parameters/index.browser.js +37 -0
  19. package/dist/api/parameters/index.browser.js.map +1 -1
  20. package/dist/api/parameters/index.d.ts +4 -65
  21. package/dist/api/parameters/index.d.ts.map +1 -1
  22. package/dist/api/parameters/index.js +37 -0
  23. package/dist/api/parameters/index.js.map +1 -1
  24. package/dist/api/payments/index.d.ts.map +1 -1
  25. package/dist/api/payments/index.js.map +1 -1
  26. package/dist/api/users/index.d.ts +207 -5184
  27. package/dist/api/users/index.d.ts.map +1 -1
  28. package/dist/api/users/index.js +2 -4
  29. package/dist/api/users/index.js.map +1 -1
  30. package/dist/api/verifications/index.d.ts.map +1 -1
  31. package/dist/api/verifications/index.js +2 -1
  32. package/dist/api/verifications/index.js.map +1 -1
  33. package/dist/bucket/index.js +5 -1
  34. package/dist/bucket/index.js.map +1 -1
  35. package/dist/bucket/index.workerd.js +5 -1
  36. package/dist/bucket/index.workerd.js.map +1 -1
  37. package/dist/cache/core/index.js.map +1 -1
  38. package/dist/cache/core/index.workerd.js.map +1 -1
  39. package/dist/captcha/index.js.map +1 -1
  40. package/dist/cli/core/index.d.ts +217 -11647
  41. package/dist/cli/core/index.d.ts.map +1 -1
  42. package/dist/cli/core/index.js +706 -42
  43. package/dist/cli/core/index.js.map +1 -1
  44. package/dist/cli/devtools/index.js +7 -1
  45. package/dist/cli/devtools/index.js.map +1 -1
  46. package/dist/cli/platform/index.d.ts +41 -64
  47. package/dist/cli/platform/index.d.ts.map +1 -1
  48. package/dist/cli/platform/index.js +47 -0
  49. package/dist/cli/platform/index.js.map +1 -1
  50. package/dist/cli/vendor/index.js +15 -0
  51. package/dist/cli/vendor/index.js.map +1 -1
  52. package/dist/command/index.js +1 -1
  53. package/dist/command/index.js.map +1 -1
  54. package/dist/core/index.browser.js.map +1 -1
  55. package/dist/core/index.d.ts +2 -8
  56. package/dist/core/index.d.ts.map +1 -1
  57. package/dist/core/index.js.map +1 -1
  58. package/dist/core/index.native.js.map +1 -1
  59. package/dist/core/index.workerd.js.map +1 -1
  60. package/dist/crypto/index.js.map +1 -1
  61. package/dist/datetime/index.js.map +1 -1
  62. package/dist/email/core/index.js.map +1 -1
  63. package/dist/email/smtp/index.js +2 -10522
  64. package/dist/email/smtp/index.js.map +1 -1
  65. package/dist/fake/index.d.ts +4 -8085
  66. package/dist/fake/index.d.ts.map +1 -1
  67. package/dist/fake/index.js +3 -33554
  68. package/dist/fake/index.js.map +1 -1
  69. package/dist/lock/core/index.js.map +1 -1
  70. package/dist/lock/redis/index.js.map +1 -1
  71. package/dist/logger/index.js +32 -1
  72. package/dist/logger/index.js.map +1 -1
  73. package/dist/mcp/index.js +5 -1
  74. package/dist/mcp/index.js.map +1 -1
  75. package/dist/orm/core/index.browser.js +1 -361
  76. package/dist/orm/core/index.browser.js.map +1 -1
  77. package/dist/orm/core/index.bun.js +14 -406
  78. package/dist/orm/core/index.bun.js.map +1 -1
  79. package/dist/orm/core/index.d.ts +96 -5117
  80. package/dist/orm/core/index.d.ts.map +1 -1
  81. package/dist/orm/core/index.js +23 -419
  82. package/dist/orm/core/index.js.map +1 -1
  83. package/dist/orm/postgres/index.bun.js +17 -20
  84. package/dist/orm/postgres/index.bun.js.map +1 -1
  85. package/dist/orm/postgres/index.d.ts +2 -613
  86. package/dist/orm/postgres/index.d.ts.map +1 -1
  87. package/dist/orm/postgres/index.js +17 -20
  88. package/dist/orm/postgres/index.js.map +1 -1
  89. package/dist/react/core/index.js.map +1 -1
  90. package/dist/react/i18n/index.js.map +1 -1
  91. package/dist/react/intro/index.js +22 -17
  92. package/dist/react/intro/index.js.map +1 -1
  93. package/dist/react/router/index.browser.js +78 -2
  94. package/dist/react/router/index.browser.js.map +1 -1
  95. package/dist/react/router/index.d.ts +22 -1
  96. package/dist/react/router/index.d.ts.map +1 -1
  97. package/dist/react/router/index.js +102 -4
  98. package/dist/react/router/index.js.map +1 -1
  99. package/dist/react/testing/index.d.ts +1 -411
  100. package/dist/react/testing/index.d.ts.map +1 -1
  101. package/dist/react/testing/index.js +13 -12293
  102. package/dist/react/testing/index.js.map +1 -1
  103. package/dist/react/ui/index.js +3 -0
  104. package/dist/react/ui/index.js.map +1 -1
  105. package/dist/react/websocket/index.js.map +1 -1
  106. package/dist/redis/index.js.map +1 -1
  107. package/dist/scheduler/index.d.ts +1 -83
  108. package/dist/scheduler/index.d.ts.map +1 -1
  109. package/dist/scheduler/index.js +2 -391
  110. package/dist/scheduler/index.js.map +1 -1
  111. package/dist/scheduler/index.workerd.js +2 -391
  112. package/dist/scheduler/index.workerd.js.map +1 -1
  113. package/dist/security/index.browser.js.map +1 -1
  114. package/dist/security/index.d.ts +2 -325
  115. package/dist/security/index.d.ts.map +1 -1
  116. package/dist/security/index.js +3 -1362
  117. package/dist/security/index.js.map +1 -1
  118. package/dist/server/auth/index.d.ts +1 -1054
  119. package/dist/server/auth/index.d.ts.map +1 -1
  120. package/dist/server/auth/index.js +16 -1224
  121. package/dist/server/auth/index.js.map +1 -1
  122. package/dist/server/cookies/index.js.map +1 -1
  123. package/dist/server/core/index.browser.js.map +1 -1
  124. package/dist/server/core/index.d.ts +1 -4
  125. package/dist/server/core/index.d.ts.map +1 -1
  126. package/dist/server/core/index.js +19 -4
  127. package/dist/server/core/index.js.map +1 -1
  128. package/dist/server/links/index.browser.js.map +1 -1
  129. package/dist/server/links/index.js.map +1 -1
  130. package/dist/server/metrics/index.d.ts +1 -514
  131. package/dist/server/metrics/index.d.ts.map +1 -1
  132. package/dist/server/metrics/index.js +4 -4356
  133. package/dist/server/metrics/index.js.map +1 -1
  134. package/dist/server/rate-limit/index.js.map +1 -1
  135. package/dist/server/static/index.js.map +1 -1
  136. package/dist/server/swagger/index.js +1 -1
  137. package/dist/server/swagger/index.js.map +1 -1
  138. package/dist/sms/index.js.map +1 -1
  139. package/dist/system/index.browser.js.map +1 -1
  140. package/dist/system/index.js.map +1 -1
  141. package/dist/system/index.workerd.js.map +1 -1
  142. package/dist/topic/core/index.js.map +1 -1
  143. package/dist/websocket/index.browser.js +21 -0
  144. package/dist/websocket/index.browser.js.map +1 -1
  145. package/dist/websocket/index.js +21 -0
  146. package/dist/websocket/index.js.map +1 -1
  147. package/package.json +18 -15
  148. package/src/api/files/__tests__/FileController.spec.ts +1 -1
  149. package/src/api/jobs/__tests__/$job.spec.ts +5 -1
  150. package/src/api/users/schemas/userQuerySchema.ts +0 -1
  151. package/src/api/users/services/UserService.ts +1 -5
  152. package/src/api/verifications/__tests__/CodeVerification.spec.ts +14 -0
  153. package/src/api/verifications/__tests__/LinkVerification.spec.ts +14 -0
  154. package/src/api/verifications/services/VerificationService.ts +1 -0
  155. package/src/cli/core/__tests__/init.spec.ts +208 -0
  156. package/src/cli/core/commands/init.ts +12 -0
  157. package/src/cli/core/services/PackageManagerUtils.ts +23 -6
  158. package/src/cli/core/services/ProjectScaffolder.ts +298 -20
  159. package/src/cli/core/tasks/BuildDockerTask.ts +9 -10
  160. package/src/cli/core/tasks/BuildServerTask.ts +8 -0
  161. package/src/cli/core/templates/apiIndexTs.ts +23 -1
  162. package/src/cli/core/templates/componentsJsonTs.ts +39 -0
  163. package/src/cli/core/templates/mainCss.ts +1 -0
  164. package/src/cli/core/templates/saasAdminLayoutTsx.ts +77 -0
  165. package/src/cli/core/templates/saasAdminPagesTsx.ts +26 -0
  166. package/src/cli/core/templates/saasAuthLayoutTsx.ts +20 -0
  167. package/src/cli/core/templates/saasAuthPagesTsx.ts +62 -0
  168. package/src/cli/core/templates/saasRealmProviderTs.ts +46 -0
  169. package/src/cli/core/templates/webAppRouterTs.ts +104 -1
  170. package/src/cli/core/templates/webIndexTs.ts +23 -1
  171. package/src/cli/platform/__tests__/SecretsCommand.spec.ts +2 -0
  172. package/src/command/providers/CliProvider.ts +1 -1
  173. package/src/core/interfaces/Service.ts +3 -1
  174. package/src/core/providers/TypeProvider.ts +1 -1
  175. package/src/logger/services/Logger.ts +1 -1
  176. package/src/mcp/__tests__/$resource.spec.ts +1 -1
  177. package/src/mcp/__tests__/$tool.spec.ts +1 -1
  178. package/src/mcp/__tests__/McpServerProvider.spec.ts +1 -1
  179. package/src/orm/__tests__/$repository-tests.ts +1 -0
  180. package/src/orm/__tests__/orm-next-tests.ts +2 -67
  181. package/src/orm/__tests__/orm-next.spec.ts +0 -21
  182. package/src/orm/core/index.shared.ts +0 -2
  183. package/src/orm/core/index.ts +1 -2
  184. package/src/orm/core/primitives/$repository.ts +3 -6
  185. package/src/orm/core/providers/drivers/DatabaseProvider.ts +0 -5
  186. package/src/orm/core/providers/drivers/NodeSqliteProvider.ts +11 -13
  187. package/src/orm/core/services/ModelBuilder.ts +1 -13
  188. package/src/orm/core/services/Repository.ts +1 -42
  189. package/src/orm/core/services/SqliteModelBuilder.ts +2 -33
  190. package/src/orm/postgres/services/PostgresModelBuilder.ts +10 -45
  191. package/src/react/intro/components/GettingStartedAuthSlide.tsx +11 -4
  192. package/src/react/router/__tests__/ReactBrowserProvider.browser.spec.ts +213 -2
  193. package/src/react/router/providers/ReactBrowserProvider.ts +73 -0
  194. package/src/react/router/providers/ReactBrowserRouterProvider.ts +1 -1
  195. package/src/react/router/providers/ReactPreloadProvider.ts +1 -1
  196. package/src/react/router/providers/ReactServerProvider.ts +1 -0
  197. package/src/scheduler/providers/CronProvider.ts +1 -1
  198. package/src/security/primitives/$basicAuth.ts +1 -1
  199. package/src/server/auth/providers/ServerAuthProvider.ts +5 -1
  200. package/src/server/core/interfaces/ServerRequest.ts +1 -0
  201. package/src/server/core/providers/ServerProvider.ts +1 -1
  202. package/src/server/core/providers/ServerRouterProvider.ts +2 -2
  203. package/src/server/core/services/HttpClient.ts +1 -1
  204. package/src/server/swagger/providers/ServerSwaggerProvider.ts +1 -1
  205. package/dist/react/testing/chunk-DBEY4PJZ.js +0 -16
  206. package/src/orm/core/__tests__/parseQueryString.spec.ts +0 -196
  207. package/src/orm/core/helpers/parseQueryString.ts +0 -502
  208. package/src/orm/core/primitives/$view.ts +0 -88
@@ -4,6 +4,7 @@ import * as _$alepha_server_cookies0 from "alepha/server/cookies";
4
4
  import { Cookies, ServerCookiesProvider } from "alepha/server/cookies";
5
5
  import { DateTimeProvider } from "alepha/datetime";
6
6
  import { AccessTokenResponse, IssuerPrimitive, SecurityProvider, UserAccount } from "alepha/security";
7
+ import { Configuration } from "openid-client";
7
8
  import * as _$alepha_logger0 from "alepha/logger";
8
9
  import * as _$alepha_server0 from "alepha/server";
9
10
  import { ServerRawRequest, ServerReply } from "alepha/server";
@@ -103,1060 +104,6 @@ declare const userinfoResponseSchema: _$alepha.TObject<{
103
104
  }>;
104
105
  type UserinfoResponse = Static<typeof userinfoResponseSchema>;
105
106
  //#endregion
106
- //#region ../../../../node_modules/oauth4webapi/build/index.d.ts
107
- /**
108
- * JSON Object
109
- */
110
- type JsonObject = { [Key in string]?: JsonValue };
111
- /**
112
- * JSON Array
113
- */
114
- type JsonArray = JsonValue[];
115
- /**
116
- * JSON Primitives
117
- */
118
- type JsonPrimitive = string | number | boolean | null;
119
- /**
120
- * JSON Values
121
- */
122
- type JsonValue = JsonPrimitive | JsonObject | JsonArray;
123
- /**
124
- * Use to adjust the assumed current time. Positive and negative finite values representing seconds
125
- * are allowed. Default is `0` (Date.now() + 0 seconds is used).
126
- *
127
- * @example
128
- *
129
- * When the local clock is mistakenly 1 hour in the past
130
- *
131
- * ```ts
132
- * let client: oauth.Client = {
133
- * client_id: 'abc4ba37-4ab8-49b5-99d4-9441ba35d428',
134
- * // ... other metadata
135
- * [oauth.clockSkew]: +(60 * 60),
136
- * }
137
- * ```
138
- *
139
- * @example
140
- *
141
- * When the local clock is mistakenly 1 hour in the future
142
- *
143
- * ```ts
144
- * let client: oauth.Client = {
145
- * client_id: 'abc4ba37-4ab8-49b5-99d4-9441ba35d428',
146
- * // ... other metadata
147
- * [oauth.clockSkew]: -(60 * 60),
148
- * }
149
- * ```
150
- */
151
- declare const clockSkew: unique symbol;
152
- /**
153
- * Use to set allowed clock tolerance when checking DateTime JWT Claims. Only positive finite values
154
- * representing seconds are allowed. Default is `30` (30 seconds).
155
- *
156
- * @example
157
- *
158
- * Tolerate 30 seconds clock skew when validating JWT claims like exp or nbf.
159
- *
160
- * ```ts
161
- * let client: oauth.Client = {
162
- * client_id: 'abc4ba37-4ab8-49b5-99d4-9441ba35d428',
163
- * // ... other metadata
164
- * [oauth.clockTolerance]: 30,
165
- * }
166
- * ```
167
- */
168
- declare const clockTolerance: unique symbol;
169
- /**
170
- * When configured on an interface that extends {@link HttpRequestOptions}, this applies to `options`
171
- * parameter for functions that may trigger HTTP requests, this replaces the use of global fetch. As
172
- * a fetch replacement the arguments and expected return are the same as fetch.
173
- *
174
- * In theory any module that claims to be compatible with the Fetch API can be used but your mileage
175
- * may vary. No workarounds to allow use of non-conform {@link !Response}s will be considered.
176
- *
177
- * If you only need to update the {@link !Request} properties you do not need to use a Fetch API
178
- * module, just change what you need and pass it to globalThis.fetch just like this module would
179
- * normally do.
180
- *
181
- * Its intended use cases are:
182
- *
183
- * - {@link !Request}/{@link !Response} tracing and logging
184
- * - Custom caching strategies for responses of Authorization Server Metadata and JSON Web Key Set
185
- * (JWKS) endpoints
186
- * - Changing the {@link !Request} properties like headers, body, credentials, mode before it is passed
187
- * to fetch
188
- *
189
- * Known caveats:
190
- *
191
- * - Expect Type-related issues when passing the inputs through to fetch-like modules, they hardly
192
- * ever get their typings inline with actual fetch, you should `@ts-expect-error` them.
193
- *
194
- * @example
195
- *
196
- * Using [sindresorhus/ky](https://github.com/sindresorhus/ky) for retries and its hooks feature for
197
- * logging outgoing requests and their responses.
198
- *
199
- * ```js
200
- * import ky from 'ky'
201
- *
202
- * // example use
203
- * await oauth.discoveryRequest(new URL('https://as.example.com'), {
204
- * [oauth.customFetch]: (...args) =>
205
- * ky(args[0], {
206
- * ...args[1],
207
- * hooks: {
208
- * beforeRequest: [
209
- * (request) => {
210
- * logRequest(request)
211
- * },
212
- * ],
213
- * beforeRetry: [
214
- * ({ request, error, retryCount }) => {
215
- * logRetry(request, error, retryCount)
216
- * },
217
- * ],
218
- * afterResponse: [
219
- * (request, _, response) => {
220
- * logResponse(request, response)
221
- * },
222
- * ],
223
- * },
224
- * }),
225
- * })
226
- * ```
227
- *
228
- * @example
229
- *
230
- * Using [nodejs/undici](https://github.com/nodejs/undici) to detect and use HTTP proxies.
231
- *
232
- * ```ts
233
- * import * as undici from 'undici'
234
- *
235
- * // see https://undici.nodejs.org/#/docs/api/EnvHttpProxyAgent
236
- * let envHttpProxyAgent = new undici.EnvHttpProxyAgent()
237
- *
238
- * // example use
239
- * await oauth.discoveryRequest(new URL('https://as.example.com'), {
240
- * // @ts-ignore
241
- * [oauth.customFetch](...args) {
242
- * return undici.fetch(args[0], { ...args[1], dispatcher: envHttpProxyAgent }) // prettier-ignore
243
- * },
244
- * })
245
- * ```
246
- *
247
- * @example
248
- *
249
- * Using [nodejs/undici](https://github.com/nodejs/undici) to automatically retry network errors.
250
- *
251
- * ```ts
252
- * import * as undici from 'undici'
253
- *
254
- * // see https://undici.nodejs.org/#/docs/api/RetryAgent
255
- * let retryAgent = new undici.RetryAgent(new undici.Agent(), {
256
- * statusCodes: [],
257
- * errorCodes: [
258
- * 'ECONNRESET',
259
- * 'ECONNREFUSED',
260
- * 'ENOTFOUND',
261
- * 'ENETDOWN',
262
- * 'ENETUNREACH',
263
- * 'EHOSTDOWN',
264
- * 'UND_ERR_SOCKET',
265
- * ],
266
- * })
267
- *
268
- * // example use
269
- * await oauth.discoveryRequest(new URL('https://as.example.com'), {
270
- * // @ts-ignore
271
- * [oauth.customFetch](...args) {
272
- * return undici.fetch(args[0], { ...args[1], dispatcher: retryAgent }) // prettier-ignore
273
- * },
274
- * })
275
- * ```
276
- *
277
- * @example
278
- *
279
- * Using [nodejs/undici](https://github.com/nodejs/undici) to mock responses in tests.
280
- *
281
- * ```ts
282
- * import * as undici from 'undici'
283
- *
284
- * // see https://undici.nodejs.org/#/docs/api/MockAgent
285
- * let mockAgent = new undici.MockAgent()
286
- * mockAgent.disableNetConnect()
287
- *
288
- * // example use
289
- * await oauth.discoveryRequest(new URL('https://as.example.com'), {
290
- * // @ts-ignore
291
- * [oauth.customFetch](...args) {
292
- * return undici.fetch(args[0], { ...args[1], dispatcher: mockAgent }) // prettier-ignore
293
- * },
294
- * })
295
- * ```
296
- */
297
- declare const customFetch$1: unique symbol;
298
- /**
299
- * Authorization Server Metadata
300
- *
301
- * @group Authorization Server Metadata
302
- *
303
- * @see [IANA OAuth Authorization Server Metadata registry](https://www.iana.org/assignments/oauth-parameters/oauth-parameters.xhtml#authorization-server-metadata)
304
- */
305
- interface AuthorizationServer {
306
- /**
307
- * Authorization server's Issuer Identifier URL.
308
- */
309
- readonly issuer: string;
310
- /**
311
- * URL of the authorization server's authorization endpoint.
312
- */
313
- readonly authorization_endpoint?: string;
314
- /**
315
- * URL of the authorization server's token endpoint.
316
- */
317
- readonly token_endpoint?: string;
318
- /**
319
- * URL of the authorization server's JWK Set document.
320
- */
321
- readonly jwks_uri?: string;
322
- /**
323
- * URL of the authorization server's Dynamic Client Registration Endpoint.
324
- */
325
- readonly registration_endpoint?: string;
326
- /**
327
- * JSON array containing a list of the `scope` values that this authorization server supports.
328
- */
329
- readonly scopes_supported?: string[];
330
- /**
331
- * JSON array containing a list of the `response_type` values that this authorization server
332
- * supports.
333
- */
334
- readonly response_types_supported?: string[];
335
- /**
336
- * JSON array containing a list of the `response_mode` values that this authorization server
337
- * supports.
338
- */
339
- readonly response_modes_supported?: string[];
340
- /**
341
- * JSON array containing a list of the `grant_type` values that this authorization server
342
- * supports.
343
- */
344
- readonly grant_types_supported?: string[];
345
- /**
346
- * JSON array containing a list of client authentication methods supported by this token endpoint.
347
- */
348
- readonly token_endpoint_auth_methods_supported?: string[];
349
- /**
350
- * JSON array containing a list of the JWS signing algorithms supported by the token endpoint for
351
- * the signature on the JWT used to authenticate the client at the token endpoint.
352
- */
353
- readonly token_endpoint_auth_signing_alg_values_supported?: string[];
354
- /**
355
- * URL of a page containing human-readable information that developers might want or need to know
356
- * when using the authorization server.
357
- */
358
- readonly service_documentation?: string;
359
- /**
360
- * Languages and scripts supported for the user interface, represented as a JSON array of language
361
- * tag values from RFC 5646.
362
- */
363
- readonly ui_locales_supported?: string[];
364
- /**
365
- * URL that the authorization server provides to the person registering the client to read about
366
- * the authorization server's requirements on how the client can use the data provided by the
367
- * authorization server.
368
- */
369
- readonly op_policy_uri?: string;
370
- /**
371
- * URL that the authorization server provides to the person registering the client to read about
372
- * the authorization server's terms of service.
373
- */
374
- readonly op_tos_uri?: string;
375
- /**
376
- * URL of the authorization server's revocation endpoint.
377
- */
378
- readonly revocation_endpoint?: string;
379
- /**
380
- * JSON array containing a list of client authentication methods supported by this revocation
381
- * endpoint.
382
- */
383
- readonly revocation_endpoint_auth_methods_supported?: string[];
384
- /**
385
- * JSON array containing a list of the JWS signing algorithms supported by the revocation endpoint
386
- * for the signature on the JWT used to authenticate the client at the revocation endpoint.
387
- */
388
- readonly revocation_endpoint_auth_signing_alg_values_supported?: string[];
389
- /**
390
- * URL of the authorization server's introspection endpoint.
391
- */
392
- readonly introspection_endpoint?: string;
393
- /**
394
- * JSON array containing a list of client authentication methods supported by this introspection
395
- * endpoint.
396
- */
397
- readonly introspection_endpoint_auth_methods_supported?: string[];
398
- /**
399
- * JSON array containing a list of the JWS signing algorithms supported by the introspection
400
- * endpoint for the signature on the JWT used to authenticate the client at the introspection
401
- * endpoint.
402
- */
403
- readonly introspection_endpoint_auth_signing_alg_values_supported?: string[];
404
- /**
405
- * PKCE code challenge methods supported by this authorization server.
406
- */
407
- readonly code_challenge_methods_supported?: string[];
408
- /**
409
- * Signed JWT containing metadata values about the authorization server as claims.
410
- */
411
- readonly signed_metadata?: string;
412
- /**
413
- * URL of the authorization server's device authorization endpoint.
414
- */
415
- readonly device_authorization_endpoint?: string;
416
- /**
417
- * Indicates authorization server support for mutual-TLS client certificate-bound access tokens.
418
- */
419
- readonly tls_client_certificate_bound_access_tokens?: boolean;
420
- /**
421
- * JSON object containing alternative authorization server endpoints, which a client intending to
422
- * do mutual TLS will use in preference to the conventional endpoints.
423
- */
424
- readonly mtls_endpoint_aliases?: MTLSEndpointAliases;
425
- /**
426
- * URL of the authorization server's UserInfo Endpoint.
427
- */
428
- readonly userinfo_endpoint?: string;
429
- /**
430
- * JSON array containing a list of the Authentication Context Class References that this
431
- * authorization server supports.
432
- */
433
- readonly acr_values_supported?: string[];
434
- /**
435
- * JSON array containing a list of the Subject Identifier types that this authorization server
436
- * supports.
437
- */
438
- readonly subject_types_supported?: string[];
439
- /**
440
- * JSON array containing a list of the JWS `alg` values supported by the authorization server for
441
- * the ID Token.
442
- */
443
- readonly id_token_signing_alg_values_supported?: string[];
444
- /**
445
- * JSON array containing a list of the JWE `alg` values supported by the authorization server for
446
- * the ID Token.
447
- */
448
- readonly id_token_encryption_alg_values_supported?: string[];
449
- /**
450
- * JSON array containing a list of the JWE `enc` values supported by the authorization server for
451
- * the ID Token.
452
- */
453
- readonly id_token_encryption_enc_values_supported?: string[];
454
- /**
455
- * JSON array containing a list of the JWS `alg` values supported by the UserInfo Endpoint.
456
- */
457
- readonly userinfo_signing_alg_values_supported?: string[];
458
- /**
459
- * JSON array containing a list of the JWE `alg` values supported by the UserInfo Endpoint.
460
- */
461
- readonly userinfo_encryption_alg_values_supported?: string[];
462
- /**
463
- * JSON array containing a list of the JWE `enc` values supported by the UserInfo Endpoint.
464
- */
465
- readonly userinfo_encryption_enc_values_supported?: string[];
466
- /**
467
- * JSON array containing a list of the JWS `alg` values supported by the authorization server for
468
- * Request Objects.
469
- */
470
- readonly request_object_signing_alg_values_supported?: string[];
471
- /**
472
- * JSON array containing a list of the JWE `alg` values supported by the authorization server for
473
- * Request Objects.
474
- */
475
- readonly request_object_encryption_alg_values_supported?: string[];
476
- /**
477
- * JSON array containing a list of the JWE `enc` values supported by the authorization server for
478
- * Request Objects.
479
- */
480
- readonly request_object_encryption_enc_values_supported?: string[];
481
- /**
482
- * JSON array containing a list of the `display` parameter values that the authorization server
483
- * supports.
484
- */
485
- readonly display_values_supported?: string[];
486
- /**
487
- * JSON array containing a list of the Claim Types that the authorization server supports.
488
- */
489
- readonly claim_types_supported?: string[];
490
- /**
491
- * JSON array containing a list of the Claim Names of the Claims that the authorization server MAY
492
- * be able to supply values for.
493
- */
494
- readonly claims_supported?: string[];
495
- /**
496
- * Languages and scripts supported for values in Claims being returned, represented as a JSON
497
- * array of RFC 5646 language tag values.
498
- */
499
- readonly claims_locales_supported?: string[];
500
- /**
501
- * Boolean value specifying whether the authorization server supports use of the `claims`
502
- * parameter.
503
- */
504
- readonly claims_parameter_supported?: boolean;
505
- /**
506
- * Boolean value specifying whether the authorization server supports use of the `request`
507
- * parameter.
508
- */
509
- readonly request_parameter_supported?: boolean;
510
- /**
511
- * Boolean value specifying whether the authorization server supports use of the `request_uri`
512
- * parameter.
513
- */
514
- readonly request_uri_parameter_supported?: boolean;
515
- /**
516
- * Boolean value specifying whether the authorization server requires any `request_uri` values
517
- * used to be pre-registered.
518
- */
519
- readonly require_request_uri_registration?: boolean;
520
- /**
521
- * Indicates where authorization request needs to be protected as Request Object and provided
522
- * through either `request` or `request_uri` parameter.
523
- */
524
- readonly require_signed_request_object?: boolean;
525
- /**
526
- * URL of the authorization server's pushed authorization request endpoint.
527
- */
528
- readonly pushed_authorization_request_endpoint?: string;
529
- /**
530
- * Indicates whether the authorization server accepts authorization requests only via PAR.
531
- */
532
- readonly require_pushed_authorization_requests?: boolean;
533
- /**
534
- * JSON array containing a list of algorithms supported by the authorization server for
535
- * introspection response signing.
536
- */
537
- readonly introspection_signing_alg_values_supported?: string[];
538
- /**
539
- * JSON array containing a list of algorithms supported by the authorization server for
540
- * introspection response content key encryption (`alg` value).
541
- */
542
- readonly introspection_encryption_alg_values_supported?: string[];
543
- /**
544
- * JSON array containing a list of algorithms supported by the authorization server for
545
- * introspection response content encryption (`enc` value).
546
- */
547
- readonly introspection_encryption_enc_values_supported?: string[];
548
- /**
549
- * Boolean value indicating whether the authorization server provides the `iss` parameter in the
550
- * authorization response.
551
- */
552
- readonly authorization_response_iss_parameter_supported?: boolean;
553
- /**
554
- * JSON array containing a list of algorithms supported by the authorization server for
555
- * introspection response signing.
556
- */
557
- readonly authorization_signing_alg_values_supported?: string[];
558
- /**
559
- * JSON array containing a list of algorithms supported by the authorization server for
560
- * introspection response encryption (`alg` value).
561
- */
562
- readonly authorization_encryption_alg_values_supported?: string[];
563
- /**
564
- * JSON array containing a list of algorithms supported by the authorization server for
565
- * introspection response encryption (`enc` value).
566
- */
567
- readonly authorization_encryption_enc_values_supported?: string[];
568
- /**
569
- * CIBA Backchannel Authentication Endpoint.
570
- */
571
- readonly backchannel_authentication_endpoint?: string;
572
- /**
573
- * JSON array containing a list of the JWS signing algorithms supported for validation of signed
574
- * CIBA authentication requests.
575
- */
576
- readonly backchannel_authentication_request_signing_alg_values_supported?: string[];
577
- /**
578
- * Supported CIBA authentication result delivery modes.
579
- */
580
- readonly backchannel_token_delivery_modes_supported?: string[];
581
- /**
582
- * Indicates whether the authorization server supports the use of the CIBA `user_code` parameter.
583
- */
584
- readonly backchannel_user_code_parameter_supported?: boolean;
585
- /**
586
- * URL of an authorization server iframe that supports cross-origin communications for session
587
- * state information with the RP Client, using the HTML5 postMessage API.
588
- */
589
- readonly check_session_iframe?: string;
590
- /**
591
- * JSON array containing a list of the JWS algorithms supported for DPoP Proof JWTs.
592
- */
593
- readonly dpop_signing_alg_values_supported?: string[];
594
- /**
595
- * URL at the authorization server to which an RP can perform a redirect to request that the
596
- * End-User be logged out at the authorization server.
597
- */
598
- readonly end_session_endpoint?: string;
599
- /**
600
- * Boolean value specifying whether the authorization server can pass `iss` (issuer) and `sid`
601
- * (session ID) query parameters to identify the RP session with the authorization server when the
602
- * `frontchannel_logout_uri` is used.
603
- */
604
- readonly frontchannel_logout_session_supported?: boolean;
605
- /**
606
- * Boolean value specifying whether the authorization server supports HTTP-based logout.
607
- */
608
- readonly frontchannel_logout_supported?: boolean;
609
- /**
610
- * Boolean value specifying whether the authorization server can pass a `sid` (session ID) Claim
611
- * in the Logout Token to identify the RP session with the OP.
612
- */
613
- readonly backchannel_logout_session_supported?: boolean;
614
- /**
615
- * Boolean value specifying whether the authorization server supports back-channel logout.
616
- */
617
- readonly backchannel_logout_supported?: boolean;
618
- /**
619
- * JSON array containing a list of resource identifiers for OAuth protected resources.
620
- */
621
- readonly protected_resources?: string[];
622
- readonly [metadata: string]: JsonValue | undefined;
623
- }
624
- interface MTLSEndpointAliases extends Pick<AuthorizationServer, 'backchannel_authentication_endpoint' | 'device_authorization_endpoint' | 'introspection_endpoint' | 'pushed_authorization_request_endpoint' | 'revocation_endpoint' | 'token_endpoint' | 'userinfo_endpoint'> {
625
- readonly [metadata: string]: string | undefined;
626
- }
627
- /**
628
- * Recognized Client Metadata that have an effect on the exposed functionality.
629
- *
630
- * @see [IANA OAuth Client Registration Metadata registry](https://www.iana.org/assignments/oauth-parameters/oauth-parameters.xhtml#client-metadata)
631
- */
632
- interface Client {
633
- /**
634
- * Client identifier.
635
- */
636
- client_id: string;
637
- /**
638
- * JWS `alg` algorithm required for signing the ID Token issued to this Client. When not
639
- * configured the default is to allow only algorithms listed in
640
- * {@link AuthorizationServer.id_token_signing_alg_values_supported `as.id_token_signing_alg_values_supported`}
641
- * and fall back to `RS256` when the authorization server metadata is not set.
642
- */
643
- id_token_signed_response_alg?: string;
644
- /**
645
- * JWS `alg` algorithm required for signing authorization responses. When not configured the
646
- * default is to allow only algorithms listed in
647
- * {@link AuthorizationServer.authorization_signing_alg_values_supported `as.authorization_signing_alg_values_supported`}
648
- * and fall back to `RS256` when the authorization server metadata is not set.
649
- */
650
- authorization_signed_response_alg?: string;
651
- /**
652
- * Boolean value specifying whether the {@link IDToken.auth_time `auth_time`} Claim in the ID Token
653
- * is REQUIRED. Default is `false`.
654
- */
655
- require_auth_time?: boolean;
656
- /**
657
- * JWS `alg` algorithm REQUIRED for signing UserInfo Responses. When not configured the default is
658
- * to allow only algorithms listed in
659
- * {@link AuthorizationServer.userinfo_signing_alg_values_supported `as.userinfo_signing_alg_values_supported`}
660
- * and fail otherwise.
661
- */
662
- userinfo_signed_response_alg?: string;
663
- /**
664
- * JWS `alg` algorithm REQUIRED for signed introspection responses. When not configured the
665
- * default is to allow only algorithms listed in
666
- * {@link AuthorizationServer.introspection_signing_alg_values_supported `as.introspection_signing_alg_values_supported`}
667
- * and fall back to `RS256` when the authorization server metadata is not set.
668
- */
669
- introspection_signed_response_alg?: string;
670
- /**
671
- * Default Maximum Authentication Age.
672
- */
673
- default_max_age?: number;
674
- /**
675
- * Indicates the requirement for a client to use mutual TLS endpoint aliases defined by the AS
676
- * where present. Default is `false`.
677
- *
678
- * When combined with {@link customFetch} (to use a Fetch API implementation that supports client
679
- * certificates) this can be used to target security profiles that utilize Mutual-TLS for either
680
- * client authentication or sender constraining.
681
- *
682
- * @example
683
- *
684
- * (Node.js) Using [nodejs/undici](https://github.com/nodejs/undici) for Mutual-TLS Client
685
- * Authentication and Certificate-Bound Access Tokens support.
686
- *
687
- * ```ts
688
- * import * as undici from 'undici'
689
- *
690
- * let as!: oauth.AuthorizationServer
691
- * let client!: oauth.Client & { use_mtls_endpoint_aliases: true }
692
- * let params!: URLSearchParams
693
- * let key!: string // PEM-encoded key
694
- * let cert!: string // PEM-encoded certificate
695
- *
696
- * let clientAuth = oauth.TlsClientAuth()
697
- * let agent = new undici.Agent({ connect: { key, cert } })
698
- *
699
- * let response = await oauth.pushedAuthorizationRequest(as, client, clientAuth, params, {
700
- * // @ts-ignore
701
- * [oauth.customFetch]: (...args) =>
702
- * undici.fetch(args[0], { ...args[1], dispatcher: agent }),
703
- * })
704
- * ```
705
- *
706
- * @example
707
- *
708
- * (Deno) Using Deno.createHttpClient API for Mutual-TLS Client Authentication and
709
- * Certificate-Bound Access Tokens support.
710
- *
711
- * ```ts
712
- * let as!: oauth.AuthorizationServer
713
- * let client!: oauth.Client & { use_mtls_endpoint_aliases: true }
714
- * let params!: URLSearchParams
715
- * let key!: string // PEM-encoded key
716
- * let cert!: string // PEM-encoded certificate
717
- *
718
- * let clientAuth = oauth.TlsClientAuth()
719
- * // @ts-ignore
720
- * let agent = Deno.createHttpClient({ key, cert })
721
- *
722
- * let response = await oauth.pushedAuthorizationRequest(as, client, clientAuth, params, {
723
- * // @ts-ignore
724
- * [oauth.customFetch]: (...args) => fetch(args[0], { ...args[1], client: agent }),
725
- * })
726
- * ```
727
- *
728
- * @see [RFC 8705 - OAuth 2.0 Mutual-TLS Client Authentication and Certificate-Bound Access Tokens](https://www.rfc-editor.org/rfc/rfc8705.html)
729
- */
730
- use_mtls_endpoint_aliases?: boolean;
731
- /**
732
- * See {@link clockSkew}.
733
- */
734
- [clockSkew]?: number;
735
- /**
736
- * See {@link clockTolerance}.
737
- */
738
- [clockTolerance]?: number;
739
- [metadata: string]: JsonValue | undefined;
740
- }
741
- /**
742
- * Removes all Symbol properties from a type
743
- */
744
- type OmitSymbolProperties<T> = { [K in keyof T as K extends symbol ? never : K]: T[K] };
745
- //#endregion
746
- //#region ../../../../node_modules/openid-client/build/index.d.ts
747
- /**
748
- * Implementation of the Client's Authentication Method at the Authorization
749
- * Server.
750
- *
751
- * The default is {@link ClientSecretPost} if {@link ClientMetadata.client_secret}
752
- * is present, {@link None} otherwise.
753
- *
754
- * Other Client Authentication Methods must be provided explicitly and their
755
- * implementations are linked below.
756
- *
757
- * @see {@link ClientSecretBasic}
758
- * @see {@link ClientSecretJwt}
759
- * @see {@link ClientSecretPost}
760
- * @see {@link None}
761
- * @see {@link PrivateKeyJwt}
762
- * @see {@link TlsClientAuth}
763
- */
764
- type ClientAuth = (as: ServerMetadata, client: ClientMetadata, body: URLSearchParams, headers: Headers) => void;
765
- /**
766
- * When set on a {@link Configuration}, this replaces the use of global fetch. As
767
- * a fetch replacement the arguments and expected return are the same as fetch.
768
- *
769
- * In theory any module that claims to be compatible with the
770
- * {@link !fetch Fetch API} can be used but your mileage may vary. No workarounds
771
- * to allow use of non-conform {@link !Response} instances will be considered.
772
- *
773
- * If you only need to update the {@link !Request} properties you do not need to
774
- * use a {@link !fetch Fetch API} module, just change what you need and pass it
775
- * to globalThis.fetch just like this module would normally do.
776
- *
777
- * Its intended use cases are:
778
- *
779
- * - {@link !Request}/{@link !Response} tracing and logging
780
- * - Custom caching strategies
781
- * - Changing the {@link !Request} properties like headers, body, credentials, mode
782
- * before it is passed to fetch
783
- *
784
- * Known caveats:
785
- *
786
- * - Expect Type-related issues when passing the inputs through to fetch-like
787
- * modules, they hardly ever get their typings inline with actual fetch, you
788
- * should `@ts-expect-error` them.
789
- *
790
- * @example
791
- *
792
- * Using [sindresorhus/ky](https://github.com/sindresorhus/ky) for retries and
793
- * its hooks feature for logging outgoing requests and their responses.
794
- *
795
- * ```ts
796
- * import ky from 'ky'
797
- *
798
- * let config!: client.Configuration
799
- * let logRequest!: (request: Request) => void
800
- * let logResponse!: (request: Request, response: Response) => void
801
- * let logRetry!: (
802
- * request: Request,
803
- * error: Error,
804
- * retryCount: number,
805
- * ) => void
806
- *
807
- * config[client.customFetch] = (...args) =>
808
- * // @ts-expect-error
809
- * ky(args[0], {
810
- * ...args[1],
811
- * hooks: {
812
- * beforeRequest: [
813
- * (request) => {
814
- * logRequest(request)
815
- * },
816
- * ],
817
- * beforeRetry: [
818
- * ({ request, error, retryCount }) => {
819
- * logRetry(request, error, retryCount)
820
- * },
821
- * ],
822
- * afterResponse: [
823
- * (request, _, response) => {
824
- * logResponse(request, response)
825
- * },
826
- * ],
827
- * },
828
- * })
829
- * ```
830
- *
831
- * @example
832
- *
833
- * Using [nodejs/undici](https://github.com/nodejs/undici) to detect and use
834
- * HTTP proxies.
835
- *
836
- * ```ts
837
- * import * as undici from 'undici'
838
- *
839
- * // see https://undici.nodejs.org/#/docs/api/EnvHttpProxyAgent
840
- * let envHttpProxyAgent = new undici.EnvHttpProxyAgent()
841
- *
842
- * let config!: client.Configuration
843
- *
844
- * // @ts-ignore
845
- * config[client.customFetch] = (...args) => {
846
- * // @ts-ignore
847
- * return undici.fetch(args[0], { ...args[1], dispatcher: envHttpProxyAgent }) // prettier-ignore
848
- * }
849
- * ```
850
- *
851
- * @example
852
- *
853
- * Using [nodejs/undici](https://github.com/nodejs/undici) to automatically
854
- * retry network errors.
855
- *
856
- * ```ts
857
- * import * as undici from 'undici'
858
- *
859
- * // see https://undici.nodejs.org/#/docs/api/RetryAgent
860
- * let retryAgent = new undici.RetryAgent(new undici.Agent(), {
861
- * statusCodes: [],
862
- * errorCodes: [
863
- * 'ECONNRESET',
864
- * 'ECONNREFUSED',
865
- * 'ENOTFOUND',
866
- * 'ENETDOWN',
867
- * 'ENETUNREACH',
868
- * 'EHOSTDOWN',
869
- * 'UND_ERR_SOCKET',
870
- * ],
871
- * })
872
- *
873
- * let config!: client.Configuration
874
- *
875
- * // @ts-ignore
876
- * config[client.customFetch] = (...args) => {
877
- * // @ts-ignore
878
- * return undici.fetch(args[0], { ...args[1], dispatcher: retryAgent }) // prettier-ignore
879
- * }
880
- * ```
881
- *
882
- * @example
883
- *
884
- * Using [nodejs/undici](https://github.com/nodejs/undici) to mock responses in
885
- * tests.
886
- *
887
- * ```ts
888
- * import * as undici from 'undici'
889
- *
890
- * // see https://undici.nodejs.org/#/docs/api/MockAgent
891
- * let mockAgent = new undici.MockAgent()
892
- * mockAgent.disableNetConnect()
893
- *
894
- * let config!: client.Configuration
895
- *
896
- * // @ts-ignore
897
- * config[client.customFetch] = (...args) => {
898
- * // @ts-ignore
899
- * return undici.fetch(args[0], { ...args[1], dispatcher: mockAgent }) // prettier-ignore
900
- * }
901
- * ```
902
- *
903
- * @example
904
- *
905
- * Correcting the `redirect_uri` token endpoint request parameter when the
906
- * registered redirect URI contains query string components or when URL
907
- * normalization alters it (e.g. adding a trailing slash to a bare origin). The
908
- * module derives `redirect_uri` from the callback URL by stripping all query
909
- * parameters but it cannot distinguish the redirect URI's own parameters from
910
- * those added by the authorization server response.
911
- *
912
- * ```ts
913
- * let config!: client.Configuration
914
- * let registeredRedirectUri!: string
915
- *
916
- * // @ts-ignore
917
- * config[client.customFetch] = (...args) => {
918
- * let [url, options] = args
919
- * if (
920
- * options.body instanceof URLSearchParams &&
921
- * options.body.get('grant_type') === 'authorization_code'
922
- * ) {
923
- * options.body.set('redirect_uri', registeredRedirectUri)
924
- * }
925
- *
926
- * // @ts-ignore
927
- * return fetch(...args)
928
- * }
929
- * ```
930
- */
931
- declare const customFetch: typeof customFetch$1;
932
- type FetchBody = ArrayBuffer | null | ReadableStream | string | Uint8Array | undefined | URLSearchParams;
933
- /**
934
- * A subset of the [IANA OAuth Client Metadata
935
- * registry](https://www.iana.org/assignments/oauth-parameters/oauth-parameters.xhtml#client-metadata)
936
- * that has an effect on how the Client functions
937
- *
938
- * @group You are probably looking for this
939
- */
940
- interface ClientMetadata extends Client {
941
- /**
942
- * Client secret.
943
- */
944
- client_secret?: string;
945
- /**
946
- * Indicates the requirement for a client to use mutual TLS endpoint aliases
947
- * indicated by the
948
- * {@link ServerMetadata.mtls_endpoint_aliases Authorization Server Metadata}.
949
- * Default is `false`.
950
- *
951
- * When combined with {@link customFetch} (to use a {@link !fetch Fetch API}
952
- * implementation that supports client certificates) this can be used to
953
- * target security profiles that utilize Mutual-TLS for either client
954
- * authentication or sender constraining.
955
- *
956
- * @example
957
- *
958
- * (Node.js) Using [nodejs/undici](https://github.com/nodejs/undici) for
959
- * Mutual-TLS Client Authentication and Certificate-Bound Access Tokens
960
- * support.
961
- *
962
- * ```ts
963
- * import * as undici from 'undici'
964
- *
965
- * let config!: client.Configuration
966
- * let key!: string // PEM-encoded key
967
- * let cert!: string // PEM-encoded certificate
968
- *
969
- * let agent = new undici.Agent({ connect: { key, cert } })
970
- *
971
- * config[client.customFetch] = (...args) =>
972
- * // @ts-expect-error
973
- * undici.fetch(args[0], { ...args[1], dispatcher: agent })
974
- * ```
975
- *
976
- * @example
977
- *
978
- * (Deno) Using Deno.createHttpClient API for Mutual-TLS Client Authentication
979
- * and Certificate-Bound Access Tokens support.
980
- *
981
- * ```ts
982
- * let config!: client.Configuration
983
- * let key!: string // PEM-encoded key
984
- * let cert!: string // PEM-encoded certificate
985
- *
986
- * // @ts-expect-error
987
- * let agent = Deno.createHttpClient({ key, cert })
988
- *
989
- * config[client.customFetch] = (...args) =>
990
- * // @ts-expect-error
991
- * fetch(args[0], { ...args[1], client: agent })
992
- * ```
993
- *
994
- * @see [RFC 8705 - OAuth 2.0 Mutual-TLS Client Authentication and Certificate-Bound Access Tokens](https://www.rfc-editor.org/rfc/rfc8705.html)
995
- */
996
- use_mtls_endpoint_aliases?: boolean;
997
- }
998
- /**
999
- * Authorization Server Metadata
1000
- *
1001
- * @group You are probably looking for this
1002
- *
1003
- * @see [IANA OAuth Authorization Server Metadata registry](https://www.iana.org/assignments/oauth-parameters/oauth-parameters.xhtml#authorization-server-metadata)
1004
- */
1005
- interface ServerMetadata extends AuthorizationServer {}
1006
- interface ServerMetadataHelpers {
1007
- /**
1008
- * Determines whether the Authorization Server supports a given Code Challenge
1009
- * Method
1010
- *
1011
- * @param method Code Challenge Method. Default is `S256`
1012
- */
1013
- supportsPKCE(method?: string): boolean;
1014
- }
1015
- /**
1016
- * Public methods available on a {@link Configuration} instance
1017
- */
1018
- interface ConfigurationMethods {
1019
- /**
1020
- * Used to retrieve the Authorization Server Metadata
1021
- */
1022
- serverMetadata(): Readonly<ServerMetadata> & ServerMetadataHelpers;
1023
- /**
1024
- * Used to retrieve the Client Metadata
1025
- */
1026
- clientMetadata(): Readonly<OmitSymbolProperties<ClientMetadata>>;
1027
- }
1028
- interface CustomFetchOptions {
1029
- /**
1030
- * The request body content to send to the server
1031
- */
1032
- body: FetchBody;
1033
- /**
1034
- * HTTP Headers
1035
- */
1036
- headers: Record<string, string>;
1037
- /**
1038
- * The
1039
- * {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods request method}
1040
- */
1041
- method: string;
1042
- /**
1043
- * See {@link !Request.redirect}
1044
- */
1045
- redirect: 'manual';
1046
- /**
1047
- * An AbortSignal configured as per the {@link ConfigurationProperties.timeout}
1048
- * value
1049
- */
1050
- signal?: AbortSignal;
1051
- }
1052
- /**
1053
- * @see {@link customFetch}
1054
- */
1055
- type CustomFetch = (
1056
- /**
1057
- * URL the request is being made sent to {@link !fetch} as the `resource`
1058
- * argument
1059
- */
1060
- url: string,
1061
- /**
1062
- * Options otherwise sent to {@link !fetch} as the `options` argument
1063
- */
1064
- options: CustomFetchOptions) => Promise<Response>;
1065
- /**
1066
- * Public properties available on a {@link Configuration} instance
1067
- */
1068
- interface ConfigurationProperties {
1069
- /**
1070
- * Custom {@link !fetch Fetch API} implementation to use for the HTTP Requests
1071
- * the client will be making.
1072
- *
1073
- * @see {@link customFetch}
1074
- */
1075
- [customFetch]?: CustomFetch;
1076
- /**
1077
- * Timeout (in seconds) for the HTTP Requests the client will be making.
1078
- * Default is `30` (seconds)
1079
- */
1080
- timeout?: number;
1081
- }
1082
- /**
1083
- * Configuration is an abstraction over the
1084
- * {@link ServerMetadata OAuth 2.0 Authorization Server metadata} and
1085
- * {@link ClientMetadata OAuth 2.0 Client metadata}
1086
- *
1087
- * Configuration instances are obtained either through
1088
- *
1089
- * - (RECOMMENDED) the {@link discovery} function that discovers the
1090
- * {@link ServerMetadata OAuth 2.0 Authorization Server metadata} using the
1091
- * Authorization Server's Issuer Identifier, or
1092
- * - The {@link Configuration} constructor if the
1093
- * {@link ServerMetadata OAuth 2.0 Authorization Server metadata} is known
1094
- * upfront
1095
- *
1096
- * @example
1097
- *
1098
- * (RECOMMENDED) Setting up a Configuration with a Server Metadata discovery
1099
- * step
1100
- *
1101
- * ```ts
1102
- * let server!: URL
1103
- * let clientId!: string
1104
- * let clientSecret!: string | undefined
1105
- *
1106
- * let config = await client.discovery(server, clientId, clientSecret)
1107
- * ```
1108
- *
1109
- * @example
1110
- *
1111
- * Setting up a Configuration with a constructor
1112
- *
1113
- * ```ts
1114
- * let server!: client.ServerMetadata
1115
- * let clientId!: string
1116
- * let clientSecret!: string | undefined
1117
- *
1118
- * let config = new client.Configuration(server, clientId, clientSecret)
1119
- * ```
1120
- *
1121
- * @group Configuration
1122
- */
1123
- declare class Configuration implements ConfigurationMethods, ConfigurationProperties {
1124
- /**
1125
- * @param server Authorization Server Metadata
1126
- * @param clientId Client Identifier at the Authorization Server
1127
- * @param metadata Client Metadata, when a string is passed it is a shorthand
1128
- * for passing just {@link ClientMetadata.client_secret}.
1129
- * @param clientAuthentication Implementation of the Client's Authentication
1130
- * Method at the Authorization Server. Default is {@link ClientSecretPost}
1131
- * using the {@link ClientMetadata.client_secret}.
1132
- */
1133
- constructor(server: ServerMetadata, clientId: string, metadata?: Partial<ClientMetadata> | string, clientAuthentication?: ClientAuth);
1134
- /**
1135
- * @ignore
1136
- */
1137
- serverMetadata(): Readonly<ServerMetadata> & ServerMetadataHelpers;
1138
- /**
1139
- * @ignore
1140
- */
1141
- clientMetadata(): Readonly<OmitSymbolProperties<ClientMetadata>>;
1142
- /**
1143
- * @ignore
1144
- */
1145
- get timeout(): number | undefined;
1146
- /**
1147
- * @ignore
1148
- */
1149
- set timeout(value: number | undefined);
1150
- /**
1151
- * @ignore
1152
- */
1153
- get [customFetch](): CustomFetch | undefined;
1154
- /**
1155
- * @ignore
1156
- */
1157
- set [customFetch](value: CustomFetch);
1158
- }
1159
- //#endregion
1160
107
  //#region ../../src/server/auth/providers/ServerAuthProvider.d.ts
1161
108
  declare class ServerAuthProvider {
1162
109
  protected readonly log: _$alepha_logger0.Logger;