alepha 0.14.4 → 0.15.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 (322) hide show
  1. package/README.md +44 -102
  2. package/dist/api/audits/index.d.ts +331 -443
  3. package/dist/api/audits/index.d.ts.map +1 -1
  4. package/dist/api/audits/index.js +2 -2
  5. package/dist/api/audits/index.js.map +1 -1
  6. package/dist/api/files/index.d.ts +0 -113
  7. package/dist/api/files/index.d.ts.map +1 -1
  8. package/dist/api/files/index.js +2 -3
  9. package/dist/api/files/index.js.map +1 -1
  10. package/dist/api/jobs/index.d.ts +151 -262
  11. package/dist/api/jobs/index.d.ts.map +1 -1
  12. package/dist/api/notifications/index.browser.js +4 -4
  13. package/dist/api/notifications/index.browser.js.map +1 -1
  14. package/dist/api/notifications/index.d.ts +164 -276
  15. package/dist/api/notifications/index.d.ts.map +1 -1
  16. package/dist/api/notifications/index.js +4 -4
  17. package/dist/api/notifications/index.js.map +1 -1
  18. package/dist/api/parameters/index.d.ts +265 -377
  19. package/dist/api/parameters/index.d.ts.map +1 -1
  20. package/dist/api/users/index.browser.js +1 -2
  21. package/dist/api/users/index.browser.js.map +1 -1
  22. package/dist/api/users/index.d.ts +195 -301
  23. package/dist/api/users/index.d.ts.map +1 -1
  24. package/dist/api/users/index.js +203 -184
  25. package/dist/api/users/index.js.map +1 -1
  26. package/dist/api/verifications/index.d.ts.map +1 -1
  27. package/dist/batch/index.d.ts.map +1 -1
  28. package/dist/batch/index.js +1 -2
  29. package/dist/batch/index.js.map +1 -1
  30. package/dist/bucket/index.d.ts.map +1 -1
  31. package/dist/cache/core/index.d.ts.map +1 -1
  32. package/dist/cache/redis/index.d.ts.map +1 -1
  33. package/dist/cache/redis/index.js +2 -2
  34. package/dist/cache/redis/index.js.map +1 -1
  35. package/dist/cli/index.d.ts +5900 -165
  36. package/dist/cli/index.d.ts.map +1 -1
  37. package/dist/cli/index.js +1481 -639
  38. package/dist/cli/index.js.map +1 -1
  39. package/dist/command/index.d.ts +8 -4
  40. package/dist/command/index.d.ts.map +1 -1
  41. package/dist/command/index.js +29 -25
  42. package/dist/command/index.js.map +1 -1
  43. package/dist/core/index.browser.js +563 -54
  44. package/dist/core/index.browser.js.map +1 -1
  45. package/dist/core/index.d.ts +175 -8
  46. package/dist/core/index.d.ts.map +1 -1
  47. package/dist/core/index.js +564 -54
  48. package/dist/core/index.js.map +1 -1
  49. package/dist/core/index.native.js +563 -54
  50. package/dist/core/index.native.js.map +1 -1
  51. package/dist/datetime/index.d.ts.map +1 -1
  52. package/dist/datetime/index.js +4 -4
  53. package/dist/datetime/index.js.map +1 -1
  54. package/dist/email/index.d.ts +89 -42
  55. package/dist/email/index.d.ts.map +1 -1
  56. package/dist/email/index.js +129 -33
  57. package/dist/email/index.js.map +1 -1
  58. package/dist/fake/index.d.ts +7969 -2
  59. package/dist/fake/index.d.ts.map +1 -1
  60. package/dist/fake/index.js +22 -22
  61. package/dist/fake/index.js.map +1 -1
  62. package/dist/file/index.d.ts +134 -1
  63. package/dist/file/index.d.ts.map +1 -1
  64. package/dist/file/index.js +253 -1
  65. package/dist/file/index.js.map +1 -1
  66. package/dist/lock/core/index.d.ts.map +1 -1
  67. package/dist/lock/redis/index.d.ts.map +1 -1
  68. package/dist/logger/index.d.ts +1 -2
  69. package/dist/logger/index.d.ts.map +1 -1
  70. package/dist/logger/index.js +1 -5
  71. package/dist/logger/index.js.map +1 -1
  72. package/dist/mcp/index.d.ts +19 -1
  73. package/dist/mcp/index.d.ts.map +1 -1
  74. package/dist/mcp/index.js +28 -4
  75. package/dist/mcp/index.js.map +1 -1
  76. package/dist/orm/chunk-DH6iiROE.js +38 -0
  77. package/dist/orm/index.browser.js +9 -9
  78. package/dist/orm/index.browser.js.map +1 -1
  79. package/dist/orm/index.bun.js +2821 -0
  80. package/dist/orm/index.bun.js.map +1 -0
  81. package/dist/orm/index.d.ts +318 -169
  82. package/dist/orm/index.d.ts.map +1 -1
  83. package/dist/orm/index.js +2086 -1776
  84. package/dist/orm/index.js.map +1 -1
  85. package/dist/queue/core/index.d.ts +4 -4
  86. package/dist/queue/core/index.d.ts.map +1 -1
  87. package/dist/queue/redis/index.d.ts.map +1 -1
  88. package/dist/redis/index.bun.js +285 -0
  89. package/dist/redis/index.bun.js.map +1 -0
  90. package/dist/redis/index.d.ts +13 -31
  91. package/dist/redis/index.d.ts.map +1 -1
  92. package/dist/redis/index.js +18 -38
  93. package/dist/redis/index.js.map +1 -1
  94. package/dist/retry/index.d.ts.map +1 -1
  95. package/dist/router/index.d.ts.map +1 -1
  96. package/dist/scheduler/index.d.ts +83 -1
  97. package/dist/scheduler/index.d.ts.map +1 -1
  98. package/dist/scheduler/index.js +393 -1
  99. package/dist/scheduler/index.js.map +1 -1
  100. package/dist/security/index.browser.js +5 -1
  101. package/dist/security/index.browser.js.map +1 -1
  102. package/dist/security/index.d.ts +598 -112
  103. package/dist/security/index.d.ts.map +1 -1
  104. package/dist/security/index.js +1808 -97
  105. package/dist/security/index.js.map +1 -1
  106. package/dist/server/auth/index.d.ts +1200 -175
  107. package/dist/server/auth/index.d.ts.map +1 -1
  108. package/dist/server/auth/index.js +1268 -37
  109. package/dist/server/auth/index.js.map +1 -1
  110. package/dist/server/cache/index.d.ts +6 -3
  111. package/dist/server/cache/index.d.ts.map +1 -1
  112. package/dist/server/cache/index.js +1 -1
  113. package/dist/server/cache/index.js.map +1 -1
  114. package/dist/server/compress/index.d.ts.map +1 -1
  115. package/dist/server/cookies/index.d.ts.map +1 -1
  116. package/dist/server/cookies/index.js +3 -3
  117. package/dist/server/cookies/index.js.map +1 -1
  118. package/dist/server/core/index.d.ts +115 -13
  119. package/dist/server/core/index.d.ts.map +1 -1
  120. package/dist/server/core/index.js +321 -139
  121. package/dist/server/core/index.js.map +1 -1
  122. package/dist/server/cors/index.d.ts +0 -1
  123. package/dist/server/cors/index.d.ts.map +1 -1
  124. package/dist/server/health/index.d.ts +0 -1
  125. package/dist/server/health/index.d.ts.map +1 -1
  126. package/dist/server/helmet/index.d.ts.map +1 -1
  127. package/dist/server/links/index.browser.js +9 -1
  128. package/dist/server/links/index.browser.js.map +1 -1
  129. package/dist/server/links/index.d.ts +1 -2
  130. package/dist/server/links/index.d.ts.map +1 -1
  131. package/dist/server/links/index.js +14 -7
  132. package/dist/server/links/index.js.map +1 -1
  133. package/dist/server/metrics/index.d.ts +514 -1
  134. package/dist/server/metrics/index.d.ts.map +1 -1
  135. package/dist/server/metrics/index.js +4462 -4
  136. package/dist/server/metrics/index.js.map +1 -1
  137. package/dist/server/multipart/index.d.ts.map +1 -1
  138. package/dist/server/proxy/index.d.ts +0 -1
  139. package/dist/server/proxy/index.d.ts.map +1 -1
  140. package/dist/server/rate-limit/index.d.ts.map +1 -1
  141. package/dist/server/static/index.d.ts.map +1 -1
  142. package/dist/server/swagger/index.d.ts +1 -2
  143. package/dist/server/swagger/index.d.ts.map +1 -1
  144. package/dist/server/swagger/index.js +1 -2
  145. package/dist/server/swagger/index.js.map +1 -1
  146. package/dist/sms/index.d.ts +3 -1
  147. package/dist/sms/index.d.ts.map +1 -1
  148. package/dist/sms/index.js +10 -10
  149. package/dist/sms/index.js.map +1 -1
  150. package/dist/thread/index.d.ts +0 -1
  151. package/dist/thread/index.d.ts.map +1 -1
  152. package/dist/thread/index.js +2 -2
  153. package/dist/thread/index.js.map +1 -1
  154. package/dist/topic/core/index.d.ts.map +1 -1
  155. package/dist/topic/redis/index.d.ts.map +1 -1
  156. package/dist/vite/index.d.ts +6315 -149
  157. package/dist/vite/index.d.ts.map +1 -1
  158. package/dist/vite/index.js +140 -469
  159. package/dist/vite/index.js.map +1 -1
  160. package/dist/websocket/index.browser.js +9 -9
  161. package/dist/websocket/index.browser.js.map +1 -1
  162. package/dist/websocket/index.d.ts +28 -28
  163. package/dist/websocket/index.d.ts.map +1 -1
  164. package/dist/websocket/index.js +9 -9
  165. package/dist/websocket/index.js.map +1 -1
  166. package/package.json +13 -18
  167. package/src/api/files/controllers/AdminFileStatsController.ts +0 -1
  168. package/src/api/users/atoms/realmAuthSettingsAtom.ts +5 -0
  169. package/src/api/users/controllers/{UserRealmController.ts → RealmController.ts} +11 -11
  170. package/src/api/users/entities/users.ts +1 -1
  171. package/src/api/users/index.ts +8 -8
  172. package/src/api/users/primitives/{$userRealm.ts → $realm.ts} +17 -19
  173. package/src/api/users/providers/{UserRealmProvider.ts → RealmProvider.ts} +26 -30
  174. package/src/api/users/schemas/{userRealmConfigSchema.ts → realmConfigSchema.ts} +2 -2
  175. package/src/api/users/services/CredentialService.ts +7 -7
  176. package/src/api/users/services/IdentityService.ts +4 -4
  177. package/src/api/users/services/RegistrationService.spec.ts +25 -27
  178. package/src/api/users/services/RegistrationService.ts +38 -27
  179. package/src/api/users/services/SessionCrudService.ts +3 -3
  180. package/src/api/users/services/SessionService.spec.ts +3 -3
  181. package/src/api/users/services/SessionService.ts +27 -18
  182. package/src/api/users/services/UserService.ts +7 -7
  183. package/src/batch/providers/BatchProvider.ts +1 -2
  184. package/src/cli/apps/AlephaCli.ts +2 -2
  185. package/src/cli/apps/AlephaPackageBuilderCli.ts +47 -20
  186. package/src/cli/assets/apiHelloControllerTs.ts +19 -0
  187. package/src/cli/assets/apiIndexTs.ts +16 -0
  188. package/src/cli/assets/biomeJson.ts +2 -1
  189. package/src/cli/assets/claudeMd.ts +308 -0
  190. package/src/cli/assets/dummySpecTs.ts +2 -1
  191. package/src/cli/assets/editorconfig.ts +2 -1
  192. package/src/cli/assets/mainBrowserTs.ts +4 -3
  193. package/src/cli/assets/mainCss.ts +24 -0
  194. package/src/cli/assets/mainServerTs.ts +24 -0
  195. package/src/cli/assets/tsconfigJson.ts +2 -1
  196. package/src/cli/assets/webAppRouterTs.ts +16 -0
  197. package/src/cli/assets/webHelloComponentTsx.ts +20 -0
  198. package/src/cli/assets/webIndexTs.ts +16 -0
  199. package/src/cli/atoms/appEntryOptions.ts +13 -0
  200. package/src/cli/atoms/buildOptions.ts +1 -1
  201. package/src/cli/atoms/changelogOptions.ts +1 -1
  202. package/src/cli/commands/build.ts +97 -61
  203. package/src/cli/commands/db.ts +21 -18
  204. package/src/cli/commands/deploy.ts +17 -5
  205. package/src/cli/commands/dev.ts +26 -47
  206. package/src/cli/commands/gen/env.ts +1 -1
  207. package/src/cli/commands/init.ts +79 -25
  208. package/src/cli/commands/lint.ts +9 -3
  209. package/src/cli/commands/test.ts +8 -2
  210. package/src/cli/commands/typecheck.ts +5 -1
  211. package/src/cli/commands/verify.ts +4 -2
  212. package/src/cli/defineConfig.ts +9 -0
  213. package/src/cli/index.ts +2 -1
  214. package/src/cli/providers/AppEntryProvider.ts +131 -0
  215. package/src/cli/providers/ViteBuildProvider.ts +82 -0
  216. package/src/cli/providers/ViteDevServerProvider.ts +350 -0
  217. package/src/cli/providers/ViteTemplateProvider.ts +27 -0
  218. package/src/cli/services/AlephaCliUtils.ts +72 -602
  219. package/src/cli/services/PackageManagerUtils.ts +308 -0
  220. package/src/cli/services/ProjectScaffolder.ts +329 -0
  221. package/src/command/helpers/Runner.ts +15 -3
  222. package/src/core/Alepha.ts +2 -8
  223. package/src/core/__tests__/Alepha-graph.spec.ts +4 -0
  224. package/src/core/index.shared.ts +1 -0
  225. package/src/core/index.ts +2 -0
  226. package/src/core/primitives/$hook.ts +6 -2
  227. package/src/core/primitives/$module.spec.ts +4 -0
  228. package/src/core/primitives/$module.ts +12 -0
  229. package/src/core/providers/AlsProvider.ts +1 -1
  230. package/src/core/providers/CodecManager.spec.ts +12 -6
  231. package/src/core/providers/CodecManager.ts +26 -6
  232. package/src/core/providers/EventManager.ts +169 -13
  233. package/src/core/providers/KeylessJsonSchemaCodec.spec.ts +878 -0
  234. package/src/core/providers/KeylessJsonSchemaCodec.ts +789 -0
  235. package/src/core/providers/SchemaValidator.spec.ts +236 -0
  236. package/src/core/providers/StateManager.spec.ts +27 -16
  237. package/src/email/providers/LocalEmailProvider.spec.ts +111 -87
  238. package/src/email/providers/LocalEmailProvider.ts +52 -15
  239. package/src/email/providers/NodemailerEmailProvider.ts +167 -56
  240. package/src/file/errors/FileError.ts +7 -0
  241. package/src/file/index.ts +9 -1
  242. package/src/file/providers/MemoryFileSystemProvider.ts +393 -0
  243. package/src/logger/providers/PrettyFormatterProvider.ts +0 -9
  244. package/src/mcp/errors/McpError.ts +30 -0
  245. package/src/mcp/index.ts +3 -0
  246. package/src/mcp/transports/SseMcpTransport.ts +16 -6
  247. package/src/orm/index.browser.ts +1 -19
  248. package/src/orm/index.bun.ts +77 -0
  249. package/src/orm/index.shared-server.ts +22 -0
  250. package/src/orm/index.shared.ts +15 -0
  251. package/src/orm/index.ts +19 -39
  252. package/src/orm/providers/DrizzleKitProvider.ts +3 -5
  253. package/src/orm/providers/drivers/BunPostgresProvider.ts +3 -5
  254. package/src/orm/providers/drivers/BunSqliteProvider.ts +1 -1
  255. package/src/orm/providers/drivers/CloudflareD1Provider.ts +4 -0
  256. package/src/orm/providers/drivers/DatabaseProvider.ts +4 -0
  257. package/src/orm/providers/drivers/PglitePostgresProvider.ts +4 -0
  258. package/src/orm/services/Repository.ts +19 -0
  259. package/src/redis/index.bun.ts +35 -0
  260. package/src/redis/providers/BunRedisProvider.ts +12 -43
  261. package/src/redis/providers/BunRedisSubscriberProvider.ts +2 -3
  262. package/src/redis/providers/NodeRedisProvider.ts +16 -34
  263. package/src/{server/security → security}/__tests__/BasicAuth.spec.ts +11 -11
  264. package/src/{server/security → security}/__tests__/ServerSecurityProvider-realm.spec.ts +21 -16
  265. package/src/{server/security/providers → security/__tests__}/ServerSecurityProvider.spec.ts +5 -5
  266. package/src/security/index.browser.ts +5 -0
  267. package/src/security/index.ts +90 -7
  268. package/src/security/primitives/{$realm.spec.ts → $issuer.spec.ts} +11 -11
  269. package/src/security/primitives/{$realm.ts → $issuer.ts} +20 -17
  270. package/src/security/primitives/$role.ts +5 -5
  271. package/src/security/primitives/$serviceAccount.spec.ts +5 -5
  272. package/src/security/primitives/$serviceAccount.ts +3 -3
  273. package/src/{server/security → security}/providers/ServerSecurityProvider.ts +5 -7
  274. package/src/server/auth/primitives/$auth.ts +10 -10
  275. package/src/server/auth/primitives/$authCredentials.ts +3 -3
  276. package/src/server/auth/primitives/$authGithub.ts +3 -3
  277. package/src/server/auth/primitives/$authGoogle.ts +3 -3
  278. package/src/server/auth/providers/ServerAuthProvider.ts +13 -13
  279. package/src/server/cache/providers/ServerCacheProvider.ts +1 -1
  280. package/src/server/cookies/providers/ServerCookiesProvider.ts +3 -3
  281. package/src/server/core/index.ts +1 -1
  282. package/src/server/core/providers/BunHttpServerProvider.ts +1 -1
  283. package/src/server/core/providers/NodeHttpServerProvider.spec.ts +125 -0
  284. package/src/server/core/providers/NodeHttpServerProvider.ts +92 -24
  285. package/src/server/core/providers/ServerBodyParserProvider.ts +19 -23
  286. package/src/server/core/providers/ServerLoggerProvider.ts +23 -19
  287. package/src/server/core/providers/ServerProvider.ts +144 -24
  288. package/src/server/core/providers/ServerRouterProvider.ts +259 -115
  289. package/src/server/core/providers/ServerTimingProvider.ts +2 -2
  290. package/src/server/links/atoms/apiLinksAtom.ts +7 -0
  291. package/src/server/links/index.browser.ts +2 -0
  292. package/src/server/links/index.ts +3 -1
  293. package/src/server/links/providers/LinkProvider.ts +1 -1
  294. package/src/server/swagger/index.ts +1 -1
  295. package/src/sms/providers/LocalSmsProvider.spec.ts +153 -111
  296. package/src/sms/providers/LocalSmsProvider.ts +8 -7
  297. package/src/vite/index.ts +3 -2
  298. package/src/vite/tasks/buildClient.ts +0 -1
  299. package/src/vite/tasks/buildServer.ts +80 -22
  300. package/src/vite/tasks/copyAssets.ts +5 -4
  301. package/src/vite/tasks/generateCloudflare.ts +7 -0
  302. package/src/vite/tasks/generateSitemap.ts +64 -23
  303. package/src/vite/tasks/index.ts +0 -2
  304. package/src/vite/tasks/prerenderPages.ts +49 -24
  305. package/dist/server/security/index.browser.js +0 -13
  306. package/dist/server/security/index.browser.js.map +0 -1
  307. package/dist/server/security/index.d.ts +0 -173
  308. package/dist/server/security/index.d.ts.map +0 -1
  309. package/dist/server/security/index.js +0 -311
  310. package/dist/server/security/index.js.map +0 -1
  311. package/src/cli/assets/appRouterTs.ts +0 -9
  312. package/src/cli/assets/indexHtml.ts +0 -15
  313. package/src/cli/assets/mainTs.ts +0 -13
  314. package/src/cli/commands/format.ts +0 -17
  315. package/src/server/security/index.browser.ts +0 -10
  316. package/src/server/security/index.ts +0 -94
  317. package/src/vite/helpers/boot.ts +0 -106
  318. package/src/vite/plugins/viteAlephaDev.ts +0 -177
  319. package/src/vite/tasks/devServer.ts +0 -69
  320. package/src/vite/tasks/runAlepha.ts +0 -270
  321. /package/src/{server/security → security}/primitives/$basicAuth.ts +0 -0
  322. /package/src/{server/security → security}/providers/ServerBasicAuthProvider.ts +0 -0
@@ -1,10 +1,9 @@
1
- import * as alepha165 from "alepha";
1
+ import * as alepha206 from "alepha";
2
2
  import { Alepha, Async, KIND, Primitive, Static } from "alepha";
3
3
  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
- import { AccessTokenResponse, RealmPrimitive, SecurityProvider, UserAccount } from "alepha/security";
7
- import { Configuration } from "openid-client";
6
+ import { AccessTokenResponse, IssuerPrimitive, SecurityProvider, UserAccount } from "alepha/security";
8
7
  import * as alepha_logger0 from "alepha/logger";
9
8
  import * as alepha_server0 from "alepha/server";
10
9
  import { ServerLinksProvider } from "alepha/server/links";
@@ -20,45 +19,45 @@ declare const alephaServerAuthRoutes: {
20
19
  };
21
20
  //#endregion
22
21
  //#region ../../src/server/auth/schemas/authenticationProviderSchema.d.ts
23
- declare const authenticationProviderSchema: alepha165.TObject<{
24
- name: alepha165.TString;
25
- type: alepha165.TUnsafe<"OAUTH2" | "OIDC" | "CREDENTIALS">;
22
+ declare const authenticationProviderSchema: alepha206.TObject<{
23
+ name: alepha206.TString;
24
+ type: alepha206.TUnsafe<"OAUTH2" | "OIDC" | "CREDENTIALS">;
26
25
  }>;
27
26
  type AuthenticationProvider = Static<typeof authenticationProviderSchema>;
28
27
  //#endregion
29
28
  //#region ../../src/server/auth/schemas/tokenResponseSchema.d.ts
30
- declare const tokenResponseSchema: alepha165.TObject<{
31
- provider: alepha165.TString;
32
- access_token: alepha165.TString;
33
- issued_at: alepha165.TNumber;
34
- expires_in: alepha165.TOptional<alepha165.TNumber>;
35
- refresh_token: alepha165.TOptional<alepha165.TString>;
36
- refresh_token_expires_in: alepha165.TOptional<alepha165.TNumber>;
37
- refresh_expires_in: alepha165.TOptional<alepha165.TNumber>;
38
- id_token: alepha165.TOptional<alepha165.TString>;
39
- scope: alepha165.TOptional<alepha165.TString>;
40
- user: alepha165.TObject<{
41
- id: alepha165.TString;
42
- name: alepha165.TOptional<alepha165.TString>;
43
- email: alepha165.TOptional<alepha165.TString>;
44
- username: alepha165.TOptional<alepha165.TString>;
45
- picture: alepha165.TOptional<alepha165.TString>;
46
- sessionId: alepha165.TOptional<alepha165.TString>;
47
- organizations: alepha165.TOptional<alepha165.TArray<alepha165.TString>>;
48
- roles: alepha165.TOptional<alepha165.TArray<alepha165.TString>>;
29
+ declare const tokenResponseSchema: alepha206.TObject<{
30
+ provider: alepha206.TString;
31
+ access_token: alepha206.TString;
32
+ issued_at: alepha206.TNumber;
33
+ expires_in: alepha206.TOptional<alepha206.TNumber>;
34
+ refresh_token: alepha206.TOptional<alepha206.TString>;
35
+ refresh_token_expires_in: alepha206.TOptional<alepha206.TNumber>;
36
+ refresh_expires_in: alepha206.TOptional<alepha206.TNumber>;
37
+ id_token: alepha206.TOptional<alepha206.TString>;
38
+ scope: alepha206.TOptional<alepha206.TString>;
39
+ user: alepha206.TObject<{
40
+ id: alepha206.TString;
41
+ name: alepha206.TOptional<alepha206.TString>;
42
+ email: alepha206.TOptional<alepha206.TString>;
43
+ username: alepha206.TOptional<alepha206.TString>;
44
+ picture: alepha206.TOptional<alepha206.TString>;
45
+ sessionId: alepha206.TOptional<alepha206.TString>;
46
+ organizations: alepha206.TOptional<alepha206.TArray<alepha206.TString>>;
47
+ roles: alepha206.TOptional<alepha206.TArray<alepha206.TString>>;
49
48
  }>;
50
- api: alepha165.TObject<{
51
- prefix: alepha165.TOptional<alepha165.TString>;
52
- links: alepha165.TArray<alepha165.TObject<{
53
- name: alepha165.TString;
54
- group: alepha165.TOptional<alepha165.TString>;
55
- path: alepha165.TString;
56
- method: alepha165.TOptional<alepha165.TString>;
57
- requestBodyType: alepha165.TOptional<alepha165.TString>;
58
- service: alepha165.TOptional<alepha165.TString>;
59
- rawSchema: alepha165.TOptional<alepha165.TObject<{
60
- body: alepha165.TOptional<alepha165.TString>;
61
- response: alepha165.TOptional<alepha165.TString>;
49
+ api: alepha206.TObject<{
50
+ prefix: alepha206.TOptional<alepha206.TString>;
51
+ links: alepha206.TArray<alepha206.TObject<{
52
+ name: alepha206.TString;
53
+ group: alepha206.TOptional<alepha206.TString>;
54
+ path: alepha206.TString;
55
+ method: alepha206.TOptional<alepha206.TString>;
56
+ requestBodyType: alepha206.TOptional<alepha206.TString>;
57
+ service: alepha206.TOptional<alepha206.TString>;
58
+ rawSchema: alepha206.TOptional<alepha206.TObject<{
59
+ body: alepha206.TOptional<alepha206.TString>;
60
+ response: alepha206.TOptional<alepha206.TString>;
62
61
  }>>;
63
62
  }>>;
64
63
  }>;
@@ -66,49 +65,1075 @@ declare const tokenResponseSchema: alepha165.TObject<{
66
65
  type TokenResponse = Static<typeof tokenResponseSchema>;
67
66
  //#endregion
68
67
  //#region ../../src/server/auth/schemas/tokensSchema.d.ts
69
- declare const tokensSchema: alepha165.TObject<{
70
- provider: alepha165.TString;
71
- access_token: alepha165.TString;
72
- issued_at: alepha165.TNumber;
73
- expires_in: alepha165.TOptional<alepha165.TNumber>;
74
- refresh_token: alepha165.TOptional<alepha165.TString>;
75
- refresh_token_expires_in: alepha165.TOptional<alepha165.TNumber>;
76
- refresh_expires_in: alepha165.TOptional<alepha165.TNumber>;
77
- id_token: alepha165.TOptional<alepha165.TString>;
78
- scope: alepha165.TOptional<alepha165.TString>;
68
+ declare const tokensSchema: alepha206.TObject<{
69
+ provider: alepha206.TString;
70
+ access_token: alepha206.TString;
71
+ issued_at: alepha206.TNumber;
72
+ expires_in: alepha206.TOptional<alepha206.TNumber>;
73
+ refresh_token: alepha206.TOptional<alepha206.TString>;
74
+ refresh_token_expires_in: alepha206.TOptional<alepha206.TNumber>;
75
+ refresh_expires_in: alepha206.TOptional<alepha206.TNumber>;
76
+ id_token: alepha206.TOptional<alepha206.TString>;
77
+ scope: alepha206.TOptional<alepha206.TString>;
79
78
  }>;
80
79
  type Tokens = Static<typeof tokensSchema>;
81
80
  //#endregion
82
81
  //#region ../../src/server/auth/schemas/userinfoResponseSchema.d.ts
83
- declare const userinfoResponseSchema: alepha165.TObject<{
84
- user: alepha165.TOptional<alepha165.TObject<{
85
- id: alepha165.TString;
86
- name: alepha165.TOptional<alepha165.TString>;
87
- email: alepha165.TOptional<alepha165.TString>;
88
- username: alepha165.TOptional<alepha165.TString>;
89
- picture: alepha165.TOptional<alepha165.TString>;
90
- sessionId: alepha165.TOptional<alepha165.TString>;
91
- organizations: alepha165.TOptional<alepha165.TArray<alepha165.TString>>;
92
- roles: alepha165.TOptional<alepha165.TArray<alepha165.TString>>;
82
+ declare const userinfoResponseSchema: alepha206.TObject<{
83
+ user: alepha206.TOptional<alepha206.TObject<{
84
+ id: alepha206.TString;
85
+ name: alepha206.TOptional<alepha206.TString>;
86
+ email: alepha206.TOptional<alepha206.TString>;
87
+ username: alepha206.TOptional<alepha206.TString>;
88
+ picture: alepha206.TOptional<alepha206.TString>;
89
+ sessionId: alepha206.TOptional<alepha206.TString>;
90
+ organizations: alepha206.TOptional<alepha206.TArray<alepha206.TString>>;
91
+ roles: alepha206.TOptional<alepha206.TArray<alepha206.TString>>;
93
92
  }>>;
94
- api: alepha165.TObject<{
95
- prefix: alepha165.TOptional<alepha165.TString>;
96
- links: alepha165.TArray<alepha165.TObject<{
97
- name: alepha165.TString;
98
- group: alepha165.TOptional<alepha165.TString>;
99
- path: alepha165.TString;
100
- method: alepha165.TOptional<alepha165.TString>;
101
- requestBodyType: alepha165.TOptional<alepha165.TString>;
102
- service: alepha165.TOptional<alepha165.TString>;
103
- rawSchema: alepha165.TOptional<alepha165.TObject<{
104
- body: alepha165.TOptional<alepha165.TString>;
105
- response: alepha165.TOptional<alepha165.TString>;
93
+ api: alepha206.TObject<{
94
+ prefix: alepha206.TOptional<alepha206.TString>;
95
+ links: alepha206.TArray<alepha206.TObject<{
96
+ name: alepha206.TString;
97
+ group: alepha206.TOptional<alepha206.TString>;
98
+ path: alepha206.TString;
99
+ method: alepha206.TOptional<alepha206.TString>;
100
+ requestBodyType: alepha206.TOptional<alepha206.TString>;
101
+ service: alepha206.TOptional<alepha206.TString>;
102
+ rawSchema: alepha206.TOptional<alepha206.TObject<{
103
+ body: alepha206.TOptional<alepha206.TString>;
104
+ response: alepha206.TOptional<alepha206.TString>;
106
105
  }>>;
107
106
  }>>;
108
107
  }>;
109
108
  }>;
110
109
  type UserinfoResponse = Static<typeof userinfoResponseSchema>;
111
110
  //#endregion
111
+ //#region ../../../../node_modules/oauth4webapi/build/index.d.ts
112
+ /**
113
+ * JSON Object
114
+ */
115
+ type JsonObject = { [Key in string]?: JsonValue };
116
+ /**
117
+ * JSON Array
118
+ */
119
+ type JsonArray = JsonValue[];
120
+ /**
121
+ * JSON Primitives
122
+ */
123
+ type JsonPrimitive = string | number | boolean | null;
124
+ /**
125
+ * JSON Values
126
+ */
127
+ type JsonValue = JsonPrimitive | JsonObject | JsonArray;
128
+ /**
129
+ * Use to adjust the assumed current time. Positive and negative finite values representing seconds
130
+ * are allowed. Default is `0` (Date.now() + 0 seconds is used).
131
+ *
132
+ * @example
133
+ *
134
+ * When the local clock is mistakenly 1 hour in the past
135
+ *
136
+ * ```ts
137
+ * let client: oauth.Client = {
138
+ * client_id: 'abc4ba37-4ab8-49b5-99d4-9441ba35d428',
139
+ * // ... other metadata
140
+ * [oauth.clockSkew]: +(60 * 60),
141
+ * }
142
+ * ```
143
+ *
144
+ * @example
145
+ *
146
+ * When the local clock is mistakenly 1 hour in the future
147
+ *
148
+ * ```ts
149
+ * let client: oauth.Client = {
150
+ * client_id: 'abc4ba37-4ab8-49b5-99d4-9441ba35d428',
151
+ * // ... other metadata
152
+ * [oauth.clockSkew]: -(60 * 60),
153
+ * }
154
+ * ```
155
+ */
156
+ declare const clockSkew: unique symbol;
157
+ /**
158
+ * Use to set allowed clock tolerance when checking DateTime JWT Claims. Only positive finite values
159
+ * representing seconds are allowed. Default is `30` (30 seconds).
160
+ *
161
+ * @example
162
+ *
163
+ * Tolerate 30 seconds clock skew when validating JWT claims like exp or nbf.
164
+ *
165
+ * ```ts
166
+ * let client: oauth.Client = {
167
+ * client_id: 'abc4ba37-4ab8-49b5-99d4-9441ba35d428',
168
+ * // ... other metadata
169
+ * [oauth.clockTolerance]: 30,
170
+ * }
171
+ * ```
172
+ */
173
+ declare const clockTolerance: unique symbol;
174
+ /**
175
+ * When configured on an interface that extends {@link HttpRequestOptions}, this applies to `options`
176
+ * parameter for functions that may trigger HTTP requests, this replaces the use of global fetch. As
177
+ * a fetch replacement the arguments and expected return are the same as fetch.
178
+ *
179
+ * In theory any module that claims to be compatible with the Fetch API can be used but your mileage
180
+ * may vary. No workarounds to allow use of non-conform {@link !Response}s will be considered.
181
+ *
182
+ * If you only need to update the {@link !Request} properties you do not need to use a Fetch API
183
+ * module, just change what you need and pass it to globalThis.fetch just like this module would
184
+ * normally do.
185
+ *
186
+ * Its intended use cases are:
187
+ *
188
+ * - {@link !Request}/{@link !Response} tracing and logging
189
+ * - Custom caching strategies for responses of Authorization Server Metadata and JSON Web Key Set
190
+ * (JWKS) endpoints
191
+ * - Changing the {@link !Request} properties like headers, body, credentials, mode before it is passed
192
+ * to fetch
193
+ *
194
+ * Known caveats:
195
+ *
196
+ * - Expect Type-related issues when passing the inputs through to fetch-like modules, they hardly
197
+ * ever get their typings inline with actual fetch, you should `@ts-expect-error` them.
198
+ *
199
+ * @example
200
+ *
201
+ * Using [sindresorhus/ky](https://github.com/sindresorhus/ky) for retries and its hooks feature for
202
+ * logging outgoing requests and their responses.
203
+ *
204
+ * ```js
205
+ * import ky from 'ky'
206
+ *
207
+ * // example use
208
+ * await oauth.discoveryRequest(new URL('https://as.example.com'), {
209
+ * [oauth.customFetch]: (...args) =>
210
+ * ky(args[0], {
211
+ * ...args[1],
212
+ * hooks: {
213
+ * beforeRequest: [
214
+ * (request) => {
215
+ * logRequest(request)
216
+ * },
217
+ * ],
218
+ * beforeRetry: [
219
+ * ({ request, error, retryCount }) => {
220
+ * logRetry(request, error, retryCount)
221
+ * },
222
+ * ],
223
+ * afterResponse: [
224
+ * (request, _, response) => {
225
+ * logResponse(request, response)
226
+ * },
227
+ * ],
228
+ * },
229
+ * }),
230
+ * })
231
+ * ```
232
+ *
233
+ * @example
234
+ *
235
+ * Using [nodejs/undici](https://github.com/nodejs/undici) to detect and use HTTP proxies.
236
+ *
237
+ * ```ts
238
+ * import * as undici from 'undici'
239
+ *
240
+ * // see https://undici.nodejs.org/#/docs/api/EnvHttpProxyAgent
241
+ * let envHttpProxyAgent = new undici.EnvHttpProxyAgent()
242
+ *
243
+ * // example use
244
+ * await oauth.discoveryRequest(new URL('https://as.example.com'), {
245
+ * // @ts-ignore
246
+ * [oauth.customFetch](...args) {
247
+ * return undici.fetch(args[0], { ...args[1], dispatcher: envHttpProxyAgent }) // prettier-ignore
248
+ * },
249
+ * })
250
+ * ```
251
+ *
252
+ * @example
253
+ *
254
+ * Using [nodejs/undici](https://github.com/nodejs/undici) to automatically retry network errors.
255
+ *
256
+ * ```ts
257
+ * import * as undici from 'undici'
258
+ *
259
+ * // see https://undici.nodejs.org/#/docs/api/RetryAgent
260
+ * let retryAgent = new undici.RetryAgent(new undici.Agent(), {
261
+ * statusCodes: [],
262
+ * errorCodes: [
263
+ * 'ECONNRESET',
264
+ * 'ECONNREFUSED',
265
+ * 'ENOTFOUND',
266
+ * 'ENETDOWN',
267
+ * 'ENETUNREACH',
268
+ * 'EHOSTDOWN',
269
+ * 'UND_ERR_SOCKET',
270
+ * ],
271
+ * })
272
+ *
273
+ * // example use
274
+ * await oauth.discoveryRequest(new URL('https://as.example.com'), {
275
+ * // @ts-ignore
276
+ * [oauth.customFetch](...args) {
277
+ * return undici.fetch(args[0], { ...args[1], dispatcher: retryAgent }) // prettier-ignore
278
+ * },
279
+ * })
280
+ * ```
281
+ *
282
+ * @example
283
+ *
284
+ * Using [nodejs/undici](https://github.com/nodejs/undici) to mock responses in tests.
285
+ *
286
+ * ```ts
287
+ * import * as undici from 'undici'
288
+ *
289
+ * // see https://undici.nodejs.org/#/docs/api/MockAgent
290
+ * let mockAgent = new undici.MockAgent()
291
+ * mockAgent.disableNetConnect()
292
+ *
293
+ * // example use
294
+ * await oauth.discoveryRequest(new URL('https://as.example.com'), {
295
+ * // @ts-ignore
296
+ * [oauth.customFetch](...args) {
297
+ * return undici.fetch(args[0], { ...args[1], dispatcher: mockAgent }) // prettier-ignore
298
+ * },
299
+ * })
300
+ * ```
301
+ */
302
+ declare const customFetch$1: unique symbol;
303
+ /**
304
+ * Authorization Server Metadata
305
+ *
306
+ * @group Authorization Server Metadata
307
+ *
308
+ * @see [IANA OAuth Authorization Server Metadata registry](https://www.iana.org/assignments/oauth-parameters/oauth-parameters.xhtml#authorization-server-metadata)
309
+ */
310
+ interface AuthorizationServer {
311
+ /**
312
+ * Authorization server's Issuer Identifier URL.
313
+ */
314
+ readonly issuer: string;
315
+ /**
316
+ * URL of the authorization server's authorization endpoint.
317
+ */
318
+ readonly authorization_endpoint?: string;
319
+ /**
320
+ * URL of the authorization server's token endpoint.
321
+ */
322
+ readonly token_endpoint?: string;
323
+ /**
324
+ * URL of the authorization server's JWK Set document.
325
+ */
326
+ readonly jwks_uri?: string;
327
+ /**
328
+ * URL of the authorization server's Dynamic Client Registration Endpoint.
329
+ */
330
+ readonly registration_endpoint?: string;
331
+ /**
332
+ * JSON array containing a list of the `scope` values that this authorization server supports.
333
+ */
334
+ readonly scopes_supported?: string[];
335
+ /**
336
+ * JSON array containing a list of the `response_type` values that this authorization server
337
+ * supports.
338
+ */
339
+ readonly response_types_supported?: string[];
340
+ /**
341
+ * JSON array containing a list of the `response_mode` values that this authorization server
342
+ * supports.
343
+ */
344
+ readonly response_modes_supported?: string[];
345
+ /**
346
+ * JSON array containing a list of the `grant_type` values that this authorization server
347
+ * supports.
348
+ */
349
+ readonly grant_types_supported?: string[];
350
+ /**
351
+ * JSON array containing a list of client authentication methods supported by this token endpoint.
352
+ */
353
+ readonly token_endpoint_auth_methods_supported?: string[];
354
+ /**
355
+ * JSON array containing a list of the JWS signing algorithms supported by the token endpoint for
356
+ * the signature on the JWT used to authenticate the client at the token endpoint.
357
+ */
358
+ readonly token_endpoint_auth_signing_alg_values_supported?: string[];
359
+ /**
360
+ * URL of a page containing human-readable information that developers might want or need to know
361
+ * when using the authorization server.
362
+ */
363
+ readonly service_documentation?: string;
364
+ /**
365
+ * Languages and scripts supported for the user interface, represented as a JSON array of language
366
+ * tag values from RFC 5646.
367
+ */
368
+ readonly ui_locales_supported?: string[];
369
+ /**
370
+ * URL that the authorization server provides to the person registering the client to read about
371
+ * the authorization server's requirements on how the client can use the data provided by the
372
+ * authorization server.
373
+ */
374
+ readonly op_policy_uri?: string;
375
+ /**
376
+ * URL that the authorization server provides to the person registering the client to read about
377
+ * the authorization server's terms of service.
378
+ */
379
+ readonly op_tos_uri?: string;
380
+ /**
381
+ * URL of the authorization server's revocation endpoint.
382
+ */
383
+ readonly revocation_endpoint?: string;
384
+ /**
385
+ * JSON array containing a list of client authentication methods supported by this revocation
386
+ * endpoint.
387
+ */
388
+ readonly revocation_endpoint_auth_methods_supported?: string[];
389
+ /**
390
+ * JSON array containing a list of the JWS signing algorithms supported by the revocation endpoint
391
+ * for the signature on the JWT used to authenticate the client at the revocation endpoint.
392
+ */
393
+ readonly revocation_endpoint_auth_signing_alg_values_supported?: string[];
394
+ /**
395
+ * URL of the authorization server's introspection endpoint.
396
+ */
397
+ readonly introspection_endpoint?: string;
398
+ /**
399
+ * JSON array containing a list of client authentication methods supported by this introspection
400
+ * endpoint.
401
+ */
402
+ readonly introspection_endpoint_auth_methods_supported?: string[];
403
+ /**
404
+ * JSON array containing a list of the JWS signing algorithms supported by the introspection
405
+ * endpoint for the signature on the JWT used to authenticate the client at the introspection
406
+ * endpoint.
407
+ */
408
+ readonly introspection_endpoint_auth_signing_alg_values_supported?: string[];
409
+ /**
410
+ * PKCE code challenge methods supported by this authorization server.
411
+ */
412
+ readonly code_challenge_methods_supported?: string[];
413
+ /**
414
+ * Signed JWT containing metadata values about the authorization server as claims.
415
+ */
416
+ readonly signed_metadata?: string;
417
+ /**
418
+ * URL of the authorization server's device authorization endpoint.
419
+ */
420
+ readonly device_authorization_endpoint?: string;
421
+ /**
422
+ * Indicates authorization server support for mutual-TLS client certificate-bound access tokens.
423
+ */
424
+ readonly tls_client_certificate_bound_access_tokens?: boolean;
425
+ /**
426
+ * JSON object containing alternative authorization server endpoints, which a client intending to
427
+ * do mutual TLS will use in preference to the conventional endpoints.
428
+ */
429
+ readonly mtls_endpoint_aliases?: MTLSEndpointAliases;
430
+ /**
431
+ * URL of the authorization server's UserInfo Endpoint.
432
+ */
433
+ readonly userinfo_endpoint?: string;
434
+ /**
435
+ * JSON array containing a list of the Authentication Context Class References that this
436
+ * authorization server supports.
437
+ */
438
+ readonly acr_values_supported?: string[];
439
+ /**
440
+ * JSON array containing a list of the Subject Identifier types that this authorization server
441
+ * supports.
442
+ */
443
+ readonly subject_types_supported?: string[];
444
+ /**
445
+ * JSON array containing a list of the JWS `alg` values supported by the authorization server for
446
+ * the ID Token.
447
+ */
448
+ readonly id_token_signing_alg_values_supported?: string[];
449
+ /**
450
+ * JSON array containing a list of the JWE `alg` values supported by the authorization server for
451
+ * the ID Token.
452
+ */
453
+ readonly id_token_encryption_alg_values_supported?: string[];
454
+ /**
455
+ * JSON array containing a list of the JWE `enc` values supported by the authorization server for
456
+ * the ID Token.
457
+ */
458
+ readonly id_token_encryption_enc_values_supported?: string[];
459
+ /**
460
+ * JSON array containing a list of the JWS `alg` values supported by the UserInfo Endpoint.
461
+ */
462
+ readonly userinfo_signing_alg_values_supported?: string[];
463
+ /**
464
+ * JSON array containing a list of the JWE `alg` values supported by the UserInfo Endpoint.
465
+ */
466
+ readonly userinfo_encryption_alg_values_supported?: string[];
467
+ /**
468
+ * JSON array containing a list of the JWE `enc` values supported by the UserInfo Endpoint.
469
+ */
470
+ readonly userinfo_encryption_enc_values_supported?: string[];
471
+ /**
472
+ * JSON array containing a list of the JWS `alg` values supported by the authorization server for
473
+ * Request Objects.
474
+ */
475
+ readonly request_object_signing_alg_values_supported?: string[];
476
+ /**
477
+ * JSON array containing a list of the JWE `alg` values supported by the authorization server for
478
+ * Request Objects.
479
+ */
480
+ readonly request_object_encryption_alg_values_supported?: string[];
481
+ /**
482
+ * JSON array containing a list of the JWE `enc` values supported by the authorization server for
483
+ * Request Objects.
484
+ */
485
+ readonly request_object_encryption_enc_values_supported?: string[];
486
+ /**
487
+ * JSON array containing a list of the `display` parameter values that the authorization server
488
+ * supports.
489
+ */
490
+ readonly display_values_supported?: string[];
491
+ /**
492
+ * JSON array containing a list of the Claim Types that the authorization server supports.
493
+ */
494
+ readonly claim_types_supported?: string[];
495
+ /**
496
+ * JSON array containing a list of the Claim Names of the Claims that the authorization server MAY
497
+ * be able to supply values for.
498
+ */
499
+ readonly claims_supported?: string[];
500
+ /**
501
+ * Languages and scripts supported for values in Claims being returned, represented as a JSON
502
+ * array of RFC 5646 language tag values.
503
+ */
504
+ readonly claims_locales_supported?: string[];
505
+ /**
506
+ * Boolean value specifying whether the authorization server supports use of the `claims`
507
+ * parameter.
508
+ */
509
+ readonly claims_parameter_supported?: boolean;
510
+ /**
511
+ * Boolean value specifying whether the authorization server supports use of the `request`
512
+ * parameter.
513
+ */
514
+ readonly request_parameter_supported?: boolean;
515
+ /**
516
+ * Boolean value specifying whether the authorization server supports use of the `request_uri`
517
+ * parameter.
518
+ */
519
+ readonly request_uri_parameter_supported?: boolean;
520
+ /**
521
+ * Boolean value specifying whether the authorization server requires any `request_uri` values
522
+ * used to be pre-registered.
523
+ */
524
+ readonly require_request_uri_registration?: boolean;
525
+ /**
526
+ * Indicates where authorization request needs to be protected as Request Object and provided
527
+ * through either `request` or `request_uri` parameter.
528
+ */
529
+ readonly require_signed_request_object?: boolean;
530
+ /**
531
+ * URL of the authorization server's pushed authorization request endpoint.
532
+ */
533
+ readonly pushed_authorization_request_endpoint?: string;
534
+ /**
535
+ * Indicates whether the authorization server accepts authorization requests only via PAR.
536
+ */
537
+ readonly require_pushed_authorization_requests?: boolean;
538
+ /**
539
+ * JSON array containing a list of algorithms supported by the authorization server for
540
+ * introspection response signing.
541
+ */
542
+ readonly introspection_signing_alg_values_supported?: string[];
543
+ /**
544
+ * JSON array containing a list of algorithms supported by the authorization server for
545
+ * introspection response content key encryption (`alg` value).
546
+ */
547
+ readonly introspection_encryption_alg_values_supported?: string[];
548
+ /**
549
+ * JSON array containing a list of algorithms supported by the authorization server for
550
+ * introspection response content encryption (`enc` value).
551
+ */
552
+ readonly introspection_encryption_enc_values_supported?: string[];
553
+ /**
554
+ * Boolean value indicating whether the authorization server provides the `iss` parameter in the
555
+ * authorization response.
556
+ */
557
+ readonly authorization_response_iss_parameter_supported?: boolean;
558
+ /**
559
+ * JSON array containing a list of algorithms supported by the authorization server for
560
+ * introspection response signing.
561
+ */
562
+ readonly authorization_signing_alg_values_supported?: string[];
563
+ /**
564
+ * JSON array containing a list of algorithms supported by the authorization server for
565
+ * introspection response encryption (`alg` value).
566
+ */
567
+ readonly authorization_encryption_alg_values_supported?: string[];
568
+ /**
569
+ * JSON array containing a list of algorithms supported by the authorization server for
570
+ * introspection response encryption (`enc` value).
571
+ */
572
+ readonly authorization_encryption_enc_values_supported?: string[];
573
+ /**
574
+ * CIBA Backchannel Authentication Endpoint.
575
+ */
576
+ readonly backchannel_authentication_endpoint?: string;
577
+ /**
578
+ * JSON array containing a list of the JWS signing algorithms supported for validation of signed
579
+ * CIBA authentication requests.
580
+ */
581
+ readonly backchannel_authentication_request_signing_alg_values_supported?: string[];
582
+ /**
583
+ * Supported CIBA authentication result delivery modes.
584
+ */
585
+ readonly backchannel_token_delivery_modes_supported?: string[];
586
+ /**
587
+ * Indicates whether the authorization server supports the use of the CIBA `user_code` parameter.
588
+ */
589
+ readonly backchannel_user_code_parameter_supported?: boolean;
590
+ /**
591
+ * URL of an authorization server iframe that supports cross-origin communications for session
592
+ * state information with the RP Client, using the HTML5 postMessage API.
593
+ */
594
+ readonly check_session_iframe?: string;
595
+ /**
596
+ * JSON array containing a list of the JWS algorithms supported for DPoP Proof JWTs.
597
+ */
598
+ readonly dpop_signing_alg_values_supported?: string[];
599
+ /**
600
+ * URL at the authorization server to which an RP can perform a redirect to request that the
601
+ * End-User be logged out at the authorization server.
602
+ */
603
+ readonly end_session_endpoint?: string;
604
+ /**
605
+ * Boolean value specifying whether the authorization server can pass `iss` (issuer) and `sid`
606
+ * (session ID) query parameters to identify the RP session with the authorization server when the
607
+ * `frontchannel_logout_uri` is used.
608
+ */
609
+ readonly frontchannel_logout_session_supported?: boolean;
610
+ /**
611
+ * Boolean value specifying whether the authorization server supports HTTP-based logout.
612
+ */
613
+ readonly frontchannel_logout_supported?: boolean;
614
+ /**
615
+ * Boolean value specifying whether the authorization server can pass a `sid` (session ID) Claim
616
+ * in the Logout Token to identify the RP session with the OP.
617
+ */
618
+ readonly backchannel_logout_session_supported?: boolean;
619
+ /**
620
+ * Boolean value specifying whether the authorization server supports back-channel logout.
621
+ */
622
+ readonly backchannel_logout_supported?: boolean;
623
+ /**
624
+ * JSON array containing a list of resource identifiers for OAuth protected resources.
625
+ */
626
+ readonly protected_resources?: string[];
627
+ readonly [metadata: string]: JsonValue | undefined;
628
+ }
629
+ interface MTLSEndpointAliases extends Pick<AuthorizationServer, 'backchannel_authentication_endpoint' | 'device_authorization_endpoint' | 'introspection_endpoint' | 'pushed_authorization_request_endpoint' | 'revocation_endpoint' | 'token_endpoint' | 'userinfo_endpoint'> {
630
+ readonly [metadata: string]: string | undefined;
631
+ }
632
+ /**
633
+ * Recognized Client Metadata that have an effect on the exposed functionality.
634
+ *
635
+ * @see [IANA OAuth Client Registration Metadata registry](https://www.iana.org/assignments/oauth-parameters/oauth-parameters.xhtml#client-metadata)
636
+ */
637
+ interface Client {
638
+ /**
639
+ * Client identifier.
640
+ */
641
+ client_id: string;
642
+ /**
643
+ * JWS `alg` algorithm required for signing the ID Token issued to this Client. When not
644
+ * configured the default is to allow only algorithms listed in
645
+ * {@link AuthorizationServer.id_token_signing_alg_values_supported `as.id_token_signing_alg_values_supported`}
646
+ * and fall back to `RS256` when the authorization server metadata is not set.
647
+ */
648
+ id_token_signed_response_alg?: string;
649
+ /**
650
+ * JWS `alg` algorithm required for signing authorization responses. When not configured the
651
+ * default is to allow only algorithms listed in
652
+ * {@link AuthorizationServer.authorization_signing_alg_values_supported `as.authorization_signing_alg_values_supported`}
653
+ * and fall back to `RS256` when the authorization server metadata is not set.
654
+ */
655
+ authorization_signed_response_alg?: string;
656
+ /**
657
+ * Boolean value specifying whether the {@link IDToken.auth_time `auth_time`} Claim in the ID Token
658
+ * is REQUIRED. Default is `false`.
659
+ */
660
+ require_auth_time?: boolean;
661
+ /**
662
+ * JWS `alg` algorithm REQUIRED for signing UserInfo Responses. When not configured the default is
663
+ * to allow only algorithms listed in
664
+ * {@link AuthorizationServer.userinfo_signing_alg_values_supported `as.userinfo_signing_alg_values_supported`}
665
+ * and fail otherwise.
666
+ */
667
+ userinfo_signed_response_alg?: string;
668
+ /**
669
+ * JWS `alg` algorithm REQUIRED for signed introspection responses. When not configured the
670
+ * default is to allow only algorithms listed in
671
+ * {@link AuthorizationServer.introspection_signing_alg_values_supported `as.introspection_signing_alg_values_supported`}
672
+ * and fall back to `RS256` when the authorization server metadata is not set.
673
+ */
674
+ introspection_signed_response_alg?: string;
675
+ /**
676
+ * Default Maximum Authentication Age.
677
+ */
678
+ default_max_age?: number;
679
+ /**
680
+ * Indicates the requirement for a client to use mutual TLS endpoint aliases defined by the AS
681
+ * where present. Default is `false`.
682
+ *
683
+ * When combined with {@link customFetch} (to use a Fetch API implementation that supports client
684
+ * certificates) this can be used to target security profiles that utilize Mutual-TLS for either
685
+ * client authentication or sender constraining.
686
+ *
687
+ * @example
688
+ *
689
+ * (Node.js) Using [nodejs/undici](https://github.com/nodejs/undici) for Mutual-TLS Client
690
+ * Authentication and Certificate-Bound Access Tokens support.
691
+ *
692
+ * ```ts
693
+ * import * as undici from 'undici'
694
+ *
695
+ * let as!: oauth.AuthorizationServer
696
+ * let client!: oauth.Client & { use_mtls_endpoint_aliases: true }
697
+ * let params!: URLSearchParams
698
+ * let key!: string // PEM-encoded key
699
+ * let cert!: string // PEM-encoded certificate
700
+ *
701
+ * let clientAuth = oauth.TlsClientAuth()
702
+ * let agent = new undici.Agent({ connect: { key, cert } })
703
+ *
704
+ * let response = await oauth.pushedAuthorizationRequest(as, client, clientAuth, params, {
705
+ * // @ts-ignore
706
+ * [oauth.customFetch]: (...args) =>
707
+ * undici.fetch(args[0], { ...args[1], dispatcher: agent }),
708
+ * })
709
+ * ```
710
+ *
711
+ * @example
712
+ *
713
+ * (Deno) Using Deno.createHttpClient API for Mutual-TLS Client Authentication and
714
+ * Certificate-Bound Access Tokens support.
715
+ *
716
+ * ```ts
717
+ * let as!: oauth.AuthorizationServer
718
+ * let client!: oauth.Client & { use_mtls_endpoint_aliases: true }
719
+ * let params!: URLSearchParams
720
+ * let key!: string // PEM-encoded key
721
+ * let cert!: string // PEM-encoded certificate
722
+ *
723
+ * let clientAuth = oauth.TlsClientAuth()
724
+ * // @ts-ignore
725
+ * let agent = Deno.createHttpClient({ key, cert })
726
+ *
727
+ * let response = await oauth.pushedAuthorizationRequest(as, client, clientAuth, params, {
728
+ * // @ts-ignore
729
+ * [oauth.customFetch]: (...args) => fetch(args[0], { ...args[1], client: agent }),
730
+ * })
731
+ * ```
732
+ *
733
+ * @see [RFC 8705 - OAuth 2.0 Mutual-TLS Client Authentication and Certificate-Bound Access Tokens](https://www.rfc-editor.org/rfc/rfc8705.html)
734
+ */
735
+ use_mtls_endpoint_aliases?: boolean;
736
+ /**
737
+ * See {@link clockSkew}.
738
+ */
739
+ [clockSkew]?: number;
740
+ /**
741
+ * See {@link clockTolerance}.
742
+ */
743
+ [clockTolerance]?: number;
744
+ [metadata: string]: JsonValue | undefined;
745
+ }
746
+ /**
747
+ * Removes all Symbol properties from a type
748
+ */
749
+ type OmitSymbolProperties<T> = { [K in keyof T as K extends symbol ? never : K]: T[K] };
750
+ //#endregion
751
+ //#region ../../../../node_modules/openid-client/build/index.d.ts
752
+ /**
753
+ * Implementation of the Client's Authentication Method at the Authorization
754
+ * Server.
755
+ *
756
+ * The default is {@link ClientSecretPost} if {@link ClientMetadata.client_secret}
757
+ * is present, {@link None} otherwise.
758
+ *
759
+ * Other Client Authentication Methods must be provided explicitly and their
760
+ * implementations are linked below.
761
+ *
762
+ * @see {@link ClientSecretBasic}
763
+ * @see {@link ClientSecretJwt}
764
+ * @see {@link ClientSecretPost}
765
+ * @see {@link None}
766
+ * @see {@link PrivateKeyJwt}
767
+ * @see {@link TlsClientAuth}
768
+ */
769
+ type ClientAuth = (as: ServerMetadata, client: ClientMetadata, body: URLSearchParams, headers: Headers) => void;
770
+ /**
771
+ * When set on a {@link Configuration}, this replaces the use of global fetch. As
772
+ * a fetch replacement the arguments and expected return are the same as fetch.
773
+ *
774
+ * In theory any module that claims to be compatible with the
775
+ * {@link !fetch Fetch API} can be used but your mileage may vary. No workarounds
776
+ * to allow use of non-conform {@link !Response} instances will be considered.
777
+ *
778
+ * If you only need to update the {@link !Request} properties you do not need to
779
+ * use a {@link !fetch Fetch API} module, just change what you need and pass it
780
+ * to globalThis.fetch just like this module would normally do.
781
+ *
782
+ * Its intended use cases are:
783
+ *
784
+ * - {@link !Request}/{@link !Response} tracing and logging
785
+ * - Custom caching strategies
786
+ * - Changing the {@link !Request} properties like headers, body, credentials, mode
787
+ * before it is passed to fetch
788
+ *
789
+ * Known caveats:
790
+ *
791
+ * - Expect Type-related issues when passing the inputs through to fetch-like
792
+ * modules, they hardly ever get their typings inline with actual fetch, you
793
+ * should `@ts-expect-error` them.
794
+ *
795
+ * @example
796
+ *
797
+ * Using [sindresorhus/ky](https://github.com/sindresorhus/ky) for retries and
798
+ * its hooks feature for logging outgoing requests and their responses.
799
+ *
800
+ * ```ts
801
+ * import ky from 'ky'
802
+ *
803
+ * let config!: client.Configuration
804
+ * let logRequest!: (request: Request) => void
805
+ * let logResponse!: (request: Request, response: Response) => void
806
+ * let logRetry!: (
807
+ * request: Request,
808
+ * error: Error,
809
+ * retryCount: number,
810
+ * ) => void
811
+ *
812
+ * config[client.customFetch] = (...args) =>
813
+ * // @ts-expect-error
814
+ * ky(args[0], {
815
+ * ...args[1],
816
+ * hooks: {
817
+ * beforeRequest: [
818
+ * (request) => {
819
+ * logRequest(request)
820
+ * },
821
+ * ],
822
+ * beforeRetry: [
823
+ * ({ request, error, retryCount }) => {
824
+ * logRetry(request, error, retryCount)
825
+ * },
826
+ * ],
827
+ * afterResponse: [
828
+ * (request, _, response) => {
829
+ * logResponse(request, response)
830
+ * },
831
+ * ],
832
+ * },
833
+ * })
834
+ * ```
835
+ *
836
+ * @example
837
+ *
838
+ * Using [nodejs/undici](https://github.com/nodejs/undici) to detect and use
839
+ * HTTP proxies.
840
+ *
841
+ * ```ts
842
+ * import * as undici from 'undici'
843
+ *
844
+ * // see https://undici.nodejs.org/#/docs/api/EnvHttpProxyAgent
845
+ * let envHttpProxyAgent = new undici.EnvHttpProxyAgent()
846
+ *
847
+ * let config!: client.Configuration
848
+ *
849
+ * // @ts-ignore
850
+ * config[client.customFetch] = (...args) => {
851
+ * // @ts-ignore
852
+ * return undici.fetch(args[0], { ...args[1], dispatcher: envHttpProxyAgent }) // prettier-ignore
853
+ * }
854
+ * ```
855
+ *
856
+ * @example
857
+ *
858
+ * Using [nodejs/undici](https://github.com/nodejs/undici) to automatically
859
+ * retry network errors.
860
+ *
861
+ * ```ts
862
+ * import * as undici from 'undici'
863
+ *
864
+ * // see https://undici.nodejs.org/#/docs/api/RetryAgent
865
+ * let retryAgent = new undici.RetryAgent(new undici.Agent(), {
866
+ * statusCodes: [],
867
+ * errorCodes: [
868
+ * 'ECONNRESET',
869
+ * 'ECONNREFUSED',
870
+ * 'ENOTFOUND',
871
+ * 'ENETDOWN',
872
+ * 'ENETUNREACH',
873
+ * 'EHOSTDOWN',
874
+ * 'UND_ERR_SOCKET',
875
+ * ],
876
+ * })
877
+ *
878
+ * let config!: client.Configuration
879
+ *
880
+ * // @ts-ignore
881
+ * config[client.customFetch] = (...args) => {
882
+ * // @ts-ignore
883
+ * return undici.fetch(args[0], { ...args[1], dispatcher: retryAgent }) // prettier-ignore
884
+ * }
885
+ * ```
886
+ *
887
+ * @example
888
+ *
889
+ * Using [nodejs/undici](https://github.com/nodejs/undici) to mock responses in
890
+ * tests.
891
+ *
892
+ * ```ts
893
+ * import * as undici from 'undici'
894
+ *
895
+ * // see https://undici.nodejs.org/#/docs/api/MockAgent
896
+ * let mockAgent = new undici.MockAgent()
897
+ * mockAgent.disableNetConnect()
898
+ *
899
+ * let config!: client.Configuration
900
+ *
901
+ * // @ts-ignore
902
+ * config[client.customFetch] = (...args) => {
903
+ * // @ts-ignore
904
+ * return undici.fetch(args[0], { ...args[1], dispatcher: mockAgent }) // prettier-ignore
905
+ * }
906
+ * ```
907
+ */
908
+ declare const customFetch: typeof customFetch$1;
909
+ type FetchBody = ArrayBuffer | null | ReadableStream | string | Uint8Array | undefined | URLSearchParams;
910
+ /**
911
+ * A subset of the [IANA OAuth Client Metadata
912
+ * registry](https://www.iana.org/assignments/oauth-parameters/oauth-parameters.xhtml#client-metadata)
913
+ * that has an effect on how the Client functions
914
+ *
915
+ * @group You are probably looking for this
916
+ */
917
+ interface ClientMetadata extends Client {
918
+ /**
919
+ * Client secret.
920
+ */
921
+ client_secret?: string;
922
+ /**
923
+ * Indicates the requirement for a client to use mutual TLS endpoint aliases
924
+ * indicated by the
925
+ * {@link ServerMetadata.mtls_endpoint_aliases Authorization Server Metadata}.
926
+ * Default is `false`.
927
+ *
928
+ * When combined with {@link customFetch} (to use a {@link !fetch Fetch API}
929
+ * implementation that supports client certificates) this can be used to
930
+ * target security profiles that utilize Mutual-TLS for either client
931
+ * authentication or sender constraining.
932
+ *
933
+ * @example
934
+ *
935
+ * (Node.js) Using [nodejs/undici](https://github.com/nodejs/undici) for
936
+ * Mutual-TLS Client Authentication and Certificate-Bound Access Tokens
937
+ * support.
938
+ *
939
+ * ```ts
940
+ * import * as undici from 'undici'
941
+ *
942
+ * let config!: client.Configuration
943
+ * let key!: string // PEM-encoded key
944
+ * let cert!: string // PEM-encoded certificate
945
+ *
946
+ * let agent = new undici.Agent({ connect: { key, cert } })
947
+ *
948
+ * config[client.customFetch] = (...args) =>
949
+ * // @ts-expect-error
950
+ * undici.fetch(args[0], { ...args[1], dispatcher: agent })
951
+ * ```
952
+ *
953
+ * @example
954
+ *
955
+ * (Deno) Using Deno.createHttpClient API for Mutual-TLS Client Authentication
956
+ * and Certificate-Bound Access Tokens support.
957
+ *
958
+ * ```ts
959
+ * let config!: client.Configuration
960
+ * let key!: string // PEM-encoded key
961
+ * let cert!: string // PEM-encoded certificate
962
+ *
963
+ * // @ts-expect-error
964
+ * let agent = Deno.createHttpClient({ key, cert })
965
+ *
966
+ * config[client.customFetch] = (...args) =>
967
+ * // @ts-expect-error
968
+ * fetch(args[0], { ...args[1], client: agent })
969
+ * ```
970
+ *
971
+ * @see [RFC 8705 - OAuth 2.0 Mutual-TLS Client Authentication and Certificate-Bound Access Tokens](https://www.rfc-editor.org/rfc/rfc8705.html)
972
+ */
973
+ use_mtls_endpoint_aliases?: boolean;
974
+ }
975
+ /**
976
+ * Authorization Server Metadata
977
+ *
978
+ * @group You are probably looking for this
979
+ *
980
+ * @see [IANA OAuth Authorization Server Metadata registry](https://www.iana.org/assignments/oauth-parameters/oauth-parameters.xhtml#authorization-server-metadata)
981
+ */
982
+ interface ServerMetadata extends AuthorizationServer {}
983
+ interface ServerMetadataHelpers {
984
+ /**
985
+ * Determines whether the Authorization Server supports a given Code Challenge
986
+ * Method
987
+ *
988
+ * @param method Code Challenge Method. Default is `S256`
989
+ */
990
+ supportsPKCE(method?: string): boolean;
991
+ }
992
+ /**
993
+ * Public methods available on a {@link Configuration} instance
994
+ */
995
+ interface ConfigurationMethods {
996
+ /**
997
+ * Used to retrieve the Authorization Server Metadata
998
+ */
999
+ serverMetadata(): Readonly<ServerMetadata> & ServerMetadataHelpers;
1000
+ /**
1001
+ * Used to retrieve the Client Metadata
1002
+ */
1003
+ clientMetadata(): Readonly<OmitSymbolProperties<ClientMetadata>>;
1004
+ }
1005
+ interface CustomFetchOptions {
1006
+ /**
1007
+ * The request body content to send to the server
1008
+ */
1009
+ body: FetchBody;
1010
+ /**
1011
+ * HTTP Headers
1012
+ */
1013
+ headers: Record<string, string>;
1014
+ /**
1015
+ * The
1016
+ * {@link https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods request method}
1017
+ */
1018
+ method: string;
1019
+ /**
1020
+ * See {@link !Request.redirect}
1021
+ */
1022
+ redirect: 'manual';
1023
+ /**
1024
+ * An AbortSignal configured as per the {@link ConfigurationProperties.timeout}
1025
+ * value
1026
+ */
1027
+ signal?: AbortSignal;
1028
+ }
1029
+ /**
1030
+ * @see {@link customFetch}
1031
+ */
1032
+ type CustomFetch = (
1033
+ /**
1034
+ * URL the request is being made sent to {@link !fetch} as the `resource`
1035
+ * argument
1036
+ */
1037
+ url: string,
1038
+ /**
1039
+ * Options otherwise sent to {@link !fetch} as the `options` argument
1040
+ */
1041
+ options: CustomFetchOptions) => Promise<Response>;
1042
+ /**
1043
+ * Public properties available on a {@link Configuration} instance
1044
+ */
1045
+ interface ConfigurationProperties {
1046
+ /**
1047
+ * Custom {@link !fetch Fetch API} implementation to use for the HTTP Requests
1048
+ * the client will be making.
1049
+ *
1050
+ * @see {@link customFetch}
1051
+ */
1052
+ [customFetch]?: CustomFetch;
1053
+ /**
1054
+ * Timeout (in seconds) for the HTTP Requests the client will be making.
1055
+ * Default is `30` (seconds)
1056
+ */
1057
+ timeout?: number;
1058
+ }
1059
+ /**
1060
+ * Configuration is an abstraction over the
1061
+ * {@link ServerMetadata OAuth 2.0 Authorization Server metadata} and
1062
+ * {@link ClientMetadata OAuth 2.0 Client metadata}
1063
+ *
1064
+ * Configuration instances are obtained either through
1065
+ *
1066
+ * - (RECOMMENDED) the {@link discovery} function that discovers the
1067
+ * {@link ServerMetadata OAuth 2.0 Authorization Server metadata} using the
1068
+ * Authorization Server's Issuer Identifier, or
1069
+ * - The {@link Configuration} constructor if the
1070
+ * {@link ServerMetadata OAuth 2.0 Authorization Server metadata} is known
1071
+ * upfront
1072
+ *
1073
+ * @example
1074
+ *
1075
+ * (RECOMMENDED) Setting up a Configuration with a Server Metadata discovery
1076
+ * step
1077
+ *
1078
+ * ```ts
1079
+ * let server!: URL
1080
+ * let clientId!: string
1081
+ * let clientSecret!: string | undefined
1082
+ *
1083
+ * let config = await client.discovery(server, clientId, clientSecret)
1084
+ * ```
1085
+ *
1086
+ * @example
1087
+ *
1088
+ * Setting up a Configuration with a constructor
1089
+ *
1090
+ * ```ts
1091
+ * let server!: client.ServerMetadata
1092
+ * let clientId!: string
1093
+ * let clientSecret!: string | undefined
1094
+ *
1095
+ * let config = new client.Configuration(server, clientId, clientSecret)
1096
+ * ```
1097
+ *
1098
+ * @group Configuration
1099
+ */
1100
+ declare class Configuration implements ConfigurationMethods, ConfigurationProperties {
1101
+ /**
1102
+ * @param server Authorization Server Metadata
1103
+ * @param clientId Client Identifier at the Authorization Server
1104
+ * @param metadata Client Metadata, when a string is passed it is a shorthand
1105
+ * for passing just {@link ClientMetadata.client_secret}.
1106
+ * @param clientAuthentication Implementation of the Client's Authentication
1107
+ * Method at the Authorization Server. Default is {@link ClientSecretPost}
1108
+ * using the {@link ClientMetadata.client_secret}.
1109
+ */
1110
+ constructor(server: ServerMetadata, clientId: string, metadata?: Partial<ClientMetadata> | string, clientAuthentication?: ClientAuth);
1111
+ /**
1112
+ * @ignore
1113
+ */
1114
+ serverMetadata(): Readonly<ServerMetadata> & ServerMetadataHelpers;
1115
+ /**
1116
+ * @ignore
1117
+ */
1118
+ clientMetadata(): Readonly<OmitSymbolProperties<ClientMetadata>>;
1119
+ /**
1120
+ * @ignore
1121
+ */
1122
+ get timeout(): number | undefined;
1123
+ /**
1124
+ * @ignore
1125
+ */
1126
+ set timeout(value: number | undefined);
1127
+ /**
1128
+ * @ignore
1129
+ */
1130
+ get [customFetch](): CustomFetch | undefined;
1131
+ /**
1132
+ * @ignore
1133
+ */
1134
+ set [customFetch](value: CustomFetch);
1135
+ }
1136
+ //#endregion
112
1137
  //#region ../../src/server/auth/providers/ServerAuthProvider.d.ts
113
1138
  declare class ServerAuthProvider {
114
1139
  protected readonly log: alepha_logger0.Logger;
@@ -116,35 +1141,35 @@ declare class ServerAuthProvider {
116
1141
  protected readonly serverCookiesProvider: ServerCookiesProvider;
117
1142
  protected readonly dateTimeProvider: DateTimeProvider;
118
1143
  protected readonly serverLinksProvider: ServerLinksProvider;
119
- protected readonly authorizationCode: alepha_server_cookies0.AbstractCookiePrimitive<alepha165.TObject<{
120
- provider: alepha165.TString;
121
- realm: alepha165.TOptional<alepha165.TString>;
122
- codeVerifier: alepha165.TOptional<alepha165.TString>;
123
- redirectUri: alepha165.TOptional<alepha165.TString>;
124
- state: alepha165.TOptional<alepha165.TString>;
125
- nonce: alepha165.TOptional<alepha165.TString>;
1144
+ protected readonly authorizationCode: alepha_server_cookies0.AbstractCookiePrimitive<alepha206.TObject<{
1145
+ provider: alepha206.TString;
1146
+ realm: alepha206.TOptional<alepha206.TString>;
1147
+ codeVerifier: alepha206.TOptional<alepha206.TString>;
1148
+ redirectUri: alepha206.TOptional<alepha206.TString>;
1149
+ state: alepha206.TOptional<alepha206.TString>;
1150
+ nonce: alepha206.TOptional<alepha206.TString>;
126
1151
  }>>;
127
- readonly tokens: alepha_server_cookies0.AbstractCookiePrimitive<alepha165.TObject<{
128
- provider: alepha165.TString;
129
- access_token: alepha165.TString;
130
- issued_at: alepha165.TNumber;
131
- expires_in: alepha165.TOptional<alepha165.TNumber>;
132
- refresh_token: alepha165.TOptional<alepha165.TString>;
133
- refresh_token_expires_in: alepha165.TOptional<alepha165.TNumber>;
134
- refresh_expires_in: alepha165.TOptional<alepha165.TNumber>;
135
- id_token: alepha165.TOptional<alepha165.TString>;
136
- scope: alepha165.TOptional<alepha165.TString>;
1152
+ readonly tokens: alepha_server_cookies0.AbstractCookiePrimitive<alepha206.TObject<{
1153
+ provider: alepha206.TString;
1154
+ access_token: alepha206.TString;
1155
+ issued_at: alepha206.TNumber;
1156
+ expires_in: alepha206.TOptional<alepha206.TNumber>;
1157
+ refresh_token: alepha206.TOptional<alepha206.TString>;
1158
+ refresh_token_expires_in: alepha206.TOptional<alepha206.TNumber>;
1159
+ refresh_expires_in: alepha206.TOptional<alepha206.TNumber>;
1160
+ id_token: alepha206.TOptional<alepha206.TString>;
1161
+ scope: alepha206.TOptional<alepha206.TString>;
137
1162
  }>>;
138
1163
  get identities(): Array<AuthPrimitive>;
139
1164
  getAuthenticationProviders(filters?: {
140
1165
  realmName?: string;
141
1166
  }): AuthenticationProvider[];
142
- protected readonly configure: alepha165.HookPrimitive<"configure">;
1167
+ protected readonly configure: alepha206.HookPrimitive<"configure">;
143
1168
  protected getAccessTokens(tokens: Tokens): string | undefined;
144
1169
  /**
145
1170
  * Fill request headers with access token from cookies or fallback to provider's fallback function.
146
1171
  */
147
- protected readonly onRequest: alepha165.HookPrimitive<"server:onRequest">;
1172
+ protected readonly onRequest: alepha206.HookPrimitive<"server:onRequest">;
148
1173
  /**
149
1174
  * Convert cookies to tokens.
150
1175
  * If the tokens are expired, try to refresh them using the refresh token.
@@ -155,29 +1180,29 @@ declare class ServerAuthProvider {
155
1180
  * Get user information.
156
1181
  */
157
1182
  readonly userinfo: alepha_server0.RoutePrimitive<{
158
- response: alepha165.TObject<{
159
- user: alepha165.TOptional<alepha165.TObject<{
160
- id: alepha165.TString;
161
- name: alepha165.TOptional<alepha165.TString>;
162
- email: alepha165.TOptional<alepha165.TString>;
163
- username: alepha165.TOptional<alepha165.TString>;
164
- picture: alepha165.TOptional<alepha165.TString>;
165
- sessionId: alepha165.TOptional<alepha165.TString>;
166
- organizations: alepha165.TOptional<alepha165.TArray<alepha165.TString>>;
167
- roles: alepha165.TOptional<alepha165.TArray<alepha165.TString>>;
1183
+ response: alepha206.TObject<{
1184
+ user: alepha206.TOptional<alepha206.TObject<{
1185
+ id: alepha206.TString;
1186
+ name: alepha206.TOptional<alepha206.TString>;
1187
+ email: alepha206.TOptional<alepha206.TString>;
1188
+ username: alepha206.TOptional<alepha206.TString>;
1189
+ picture: alepha206.TOptional<alepha206.TString>;
1190
+ sessionId: alepha206.TOptional<alepha206.TString>;
1191
+ organizations: alepha206.TOptional<alepha206.TArray<alepha206.TString>>;
1192
+ roles: alepha206.TOptional<alepha206.TArray<alepha206.TString>>;
168
1193
  }>>;
169
- api: alepha165.TObject<{
170
- prefix: alepha165.TOptional<alepha165.TString>;
171
- links: alepha165.TArray<alepha165.TObject<{
172
- name: alepha165.TString;
173
- group: alepha165.TOptional<alepha165.TString>;
174
- path: alepha165.TString;
175
- method: alepha165.TOptional<alepha165.TString>;
176
- requestBodyType: alepha165.TOptional<alepha165.TString>;
177
- service: alepha165.TOptional<alepha165.TString>;
178
- rawSchema: alepha165.TOptional<alepha165.TObject<{
179
- body: alepha165.TOptional<alepha165.TString>;
180
- response: alepha165.TOptional<alepha165.TString>;
1194
+ api: alepha206.TObject<{
1195
+ prefix: alepha206.TOptional<alepha206.TString>;
1196
+ links: alepha206.TArray<alepha206.TObject<{
1197
+ name: alepha206.TString;
1198
+ group: alepha206.TOptional<alepha206.TString>;
1199
+ path: alepha206.TString;
1200
+ method: alepha206.TOptional<alepha206.TString>;
1201
+ requestBodyType: alepha206.TOptional<alepha206.TString>;
1202
+ service: alepha206.TOptional<alepha206.TString>;
1203
+ rawSchema: alepha206.TOptional<alepha206.TObject<{
1204
+ body: alepha206.TOptional<alepha206.TString>;
1205
+ response: alepha206.TOptional<alepha206.TString>;
181
1206
  }>>;
182
1207
  }>>;
183
1208
  }>;
@@ -187,69 +1212,69 @@ declare class ServerAuthProvider {
187
1212
  * Refresh a token for internal providers.
188
1213
  */
189
1214
  readonly refresh: alepha_server0.RoutePrimitive<{
190
- query: alepha165.TObject<{
191
- provider: alepha165.TString;
1215
+ query: alepha206.TObject<{
1216
+ provider: alepha206.TString;
192
1217
  }>;
193
- body: alepha165.TObject<{
194
- refresh_token: alepha165.TString;
195
- access_token: alepha165.TOptional<alepha165.TString>;
1218
+ body: alepha206.TObject<{
1219
+ refresh_token: alepha206.TString;
1220
+ access_token: alepha206.TOptional<alepha206.TString>;
196
1221
  }>;
197
- response: alepha165.TObject<{
198
- provider: alepha165.TString;
199
- access_token: alepha165.TString;
200
- issued_at: alepha165.TNumber;
201
- expires_in: alepha165.TOptional<alepha165.TNumber>;
202
- refresh_token: alepha165.TOptional<alepha165.TString>;
203
- refresh_token_expires_in: alepha165.TOptional<alepha165.TNumber>;
204
- refresh_expires_in: alepha165.TOptional<alepha165.TNumber>;
205
- id_token: alepha165.TOptional<alepha165.TString>;
206
- scope: alepha165.TOptional<alepha165.TString>;
1222
+ response: alepha206.TObject<{
1223
+ provider: alepha206.TString;
1224
+ access_token: alepha206.TString;
1225
+ issued_at: alepha206.TNumber;
1226
+ expires_in: alepha206.TOptional<alepha206.TNumber>;
1227
+ refresh_token: alepha206.TOptional<alepha206.TString>;
1228
+ refresh_token_expires_in: alepha206.TOptional<alepha206.TNumber>;
1229
+ refresh_expires_in: alepha206.TOptional<alepha206.TNumber>;
1230
+ id_token: alepha206.TOptional<alepha206.TString>;
1231
+ scope: alepha206.TOptional<alepha206.TString>;
207
1232
  }>;
208
1233
  }>;
209
1234
  /**
210
1235
  * Login for local password-based authentication.
211
1236
  */
212
1237
  readonly token: alepha_server0.RoutePrimitive<{
213
- query: alepha165.TObject<{
214
- provider: alepha165.TString;
215
- realm: alepha165.TOptional<alepha165.TString>;
1238
+ query: alepha206.TObject<{
1239
+ provider: alepha206.TString;
1240
+ realm: alepha206.TOptional<alepha206.TString>;
216
1241
  }>;
217
- body: alepha165.TObject<{
218
- username: alepha165.TString;
219
- password: alepha165.TString;
1242
+ body: alepha206.TObject<{
1243
+ username: alepha206.TString;
1244
+ password: alepha206.TString;
220
1245
  }>;
221
- response: alepha165.TObject<{
222
- provider: alepha165.TString;
223
- access_token: alepha165.TString;
224
- issued_at: alepha165.TNumber;
225
- expires_in: alepha165.TOptional<alepha165.TNumber>;
226
- refresh_token: alepha165.TOptional<alepha165.TString>;
227
- refresh_token_expires_in: alepha165.TOptional<alepha165.TNumber>;
228
- refresh_expires_in: alepha165.TOptional<alepha165.TNumber>;
229
- id_token: alepha165.TOptional<alepha165.TString>;
230
- scope: alepha165.TOptional<alepha165.TString>;
231
- user: alepha165.TObject<{
232
- id: alepha165.TString;
233
- name: alepha165.TOptional<alepha165.TString>;
234
- email: alepha165.TOptional<alepha165.TString>;
235
- username: alepha165.TOptional<alepha165.TString>;
236
- picture: alepha165.TOptional<alepha165.TString>;
237
- sessionId: alepha165.TOptional<alepha165.TString>;
238
- organizations: alepha165.TOptional<alepha165.TArray<alepha165.TString>>;
239
- roles: alepha165.TOptional<alepha165.TArray<alepha165.TString>>;
1246
+ response: alepha206.TObject<{
1247
+ provider: alepha206.TString;
1248
+ access_token: alepha206.TString;
1249
+ issued_at: alepha206.TNumber;
1250
+ expires_in: alepha206.TOptional<alepha206.TNumber>;
1251
+ refresh_token: alepha206.TOptional<alepha206.TString>;
1252
+ refresh_token_expires_in: alepha206.TOptional<alepha206.TNumber>;
1253
+ refresh_expires_in: alepha206.TOptional<alepha206.TNumber>;
1254
+ id_token: alepha206.TOptional<alepha206.TString>;
1255
+ scope: alepha206.TOptional<alepha206.TString>;
1256
+ user: alepha206.TObject<{
1257
+ id: alepha206.TString;
1258
+ name: alepha206.TOptional<alepha206.TString>;
1259
+ email: alepha206.TOptional<alepha206.TString>;
1260
+ username: alepha206.TOptional<alepha206.TString>;
1261
+ picture: alepha206.TOptional<alepha206.TString>;
1262
+ sessionId: alepha206.TOptional<alepha206.TString>;
1263
+ organizations: alepha206.TOptional<alepha206.TArray<alepha206.TString>>;
1264
+ roles: alepha206.TOptional<alepha206.TArray<alepha206.TString>>;
240
1265
  }>;
241
- api: alepha165.TObject<{
242
- prefix: alepha165.TOptional<alepha165.TString>;
243
- links: alepha165.TArray<alepha165.TObject<{
244
- name: alepha165.TString;
245
- group: alepha165.TOptional<alepha165.TString>;
246
- path: alepha165.TString;
247
- method: alepha165.TOptional<alepha165.TString>;
248
- requestBodyType: alepha165.TOptional<alepha165.TString>;
249
- service: alepha165.TOptional<alepha165.TString>;
250
- rawSchema: alepha165.TOptional<alepha165.TObject<{
251
- body: alepha165.TOptional<alepha165.TString>;
252
- response: alepha165.TOptional<alepha165.TString>;
1266
+ api: alepha206.TObject<{
1267
+ prefix: alepha206.TOptional<alepha206.TString>;
1268
+ links: alepha206.TArray<alepha206.TObject<{
1269
+ name: alepha206.TString;
1270
+ group: alepha206.TOptional<alepha206.TString>;
1271
+ path: alepha206.TString;
1272
+ method: alepha206.TOptional<alepha206.TString>;
1273
+ requestBodyType: alepha206.TOptional<alepha206.TString>;
1274
+ service: alepha206.TOptional<alepha206.TString>;
1275
+ rawSchema: alepha206.TOptional<alepha206.TObject<{
1276
+ body: alepha206.TOptional<alepha206.TString>;
1277
+ response: alepha206.TOptional<alepha206.TString>;
253
1278
  }>>;
254
1279
  }>>;
255
1280
  }>;
@@ -259,10 +1284,10 @@ declare class ServerAuthProvider {
259
1284
  * Oauth2/OIDC login route.
260
1285
  */
261
1286
  readonly login: alepha_server0.RoutePrimitive<{
262
- query: alepha165.TObject<{
263
- provider: alepha165.TString;
264
- realm: alepha165.TOptional<alepha165.TString>;
265
- redirect_uri: alepha165.TOptional<alepha165.TString>;
1287
+ query: alepha206.TObject<{
1288
+ provider: alepha206.TString;
1289
+ realm: alepha206.TOptional<alepha206.TString>;
1290
+ redirect_uri: alepha206.TOptional<alepha206.TString>;
266
1291
  }>;
267
1292
  }>;
268
1293
  /**
@@ -274,8 +1299,8 @@ declare class ServerAuthProvider {
274
1299
  * Logout route for OAuth2/OIDC providers.
275
1300
  */
276
1301
  readonly logout: alepha_server0.RoutePrimitive<{
277
- query: alepha165.TObject<{
278
- post_logout_redirect_uri: alepha165.TOptional<alepha165.TString>;
1302
+ query: alepha206.TObject<{
1303
+ post_logout_redirect_uri: alepha206.TOptional<alepha206.TString>;
279
1304
  }>;
280
1305
  }>;
281
1306
  /**
@@ -398,10 +1423,10 @@ type AuthExternal = {
398
1423
  * When using your own authentication system, e.g. using a database to store user accounts.
399
1424
  * This is usually used with a custom login form.
400
1425
  *
401
- * This relies on the `realm`, which is used to create/verify the access token.
1426
+ * This relies on the `issuer`, which is used to create/verify the access token.
402
1427
  */
403
1428
  type AuthInternal = {
404
- realm: RealmPrimitive;
1429
+ issuer: IssuerPrimitive;
405
1430
  } & ({
406
1431
  /**
407
1432
  * The common username/password authentication.
@@ -519,7 +1544,7 @@ declare class AuthPrimitive extends Primitive<AuthPrimitiveOptions> {
519
1544
  protected readonly dateTimeProvider: DateTimeProvider;
520
1545
  oauth?: Configuration;
521
1546
  get name(): string;
522
- get realm(): RealmPrimitive | undefined;
1547
+ get issuer(): IssuerPrimitive | undefined;
523
1548
  get jwks_uri(): string;
524
1549
  get scope(): string | undefined;
525
1550
  get redirect_uri(): string | undefined;
@@ -552,7 +1577,7 @@ interface WithLoginFn {
552
1577
  *
553
1578
  * Uses username and password to authenticate users.
554
1579
  */
555
- declare const $authCredentials: (realm: RealmPrimitive & WithLoginFn, options?: Partial<CredentialsOptions>) => AuthPrimitive;
1580
+ declare const $authCredentials: (realm: IssuerPrimitive & WithLoginFn, options?: Partial<CredentialsOptions>) => AuthPrimitive;
556
1581
  //#endregion
557
1582
  //#region ../../src/server/auth/primitives/$authGithub.d.ts
558
1583
  /**
@@ -565,7 +1590,7 @@ declare const $authCredentials: (realm: RealmPrimitive & WithLoginFn, options?:
565
1590
  * - `GITHUB_CLIENT_ID`: The client ID obtained from the GitHub Developer Settings.
566
1591
  * - `GITHUB_CLIENT_SECRET`: The client secret obtained from the GitHub Developer Settings.
567
1592
  */
568
- declare const $authGithub: (realm: RealmPrimitive & WithLinkFn, options?: Partial<OidcOptions>) => AuthPrimitive;
1593
+ declare const $authGithub: (realm: IssuerPrimitive & WithLinkFn, options?: Partial<OidcOptions>) => AuthPrimitive;
569
1594
  //#endregion
570
1595
  //#region ../../src/server/auth/primitives/$authGoogle.d.ts
571
1596
  /**
@@ -578,7 +1603,7 @@ declare const $authGithub: (realm: RealmPrimitive & WithLinkFn, options?: Partia
578
1603
  * - `GOOGLE_CLIENT_ID`: The client ID obtained from the Google Developer Console.
579
1604
  * - `GOOGLE_CLIENT_SECRET`: The client secret obtained from the Google Developer Console.
580
1605
  */
581
- declare const $authGoogle: (realm: RealmPrimitive & WithLinkFn, options?: Partial<OidcOptions>) => AuthPrimitive;
1606
+ declare const $authGoogle: (realm: IssuerPrimitive & WithLinkFn, options?: Partial<OidcOptions>) => AuthPrimitive;
582
1607
  //#endregion
583
1608
  //#region ../../src/server/auth/index.d.ts
584
1609
  declare module "alepha" {
@@ -604,7 +1629,7 @@ declare module "alepha" {
604
1629
  * @see {@link ServerAuthProvider}
605
1630
  * @module alepha.server.auth
606
1631
  */
607
- declare const AlephaServerAuth: alepha165.Service<alepha165.Module>;
1632
+ declare const AlephaServerAuth: alepha206.Service<alepha206.Module>;
608
1633
  //#endregion
609
1634
  export { $auth, $authCredentials, $authGithub, $authGoogle, AccessToken, AlephaServerAuth, AuthExternal, AuthInternal, AuthPrimitive, AuthPrimitiveOptions, AuthenticationProvider, Credentials, CredentialsFn, CredentialsOptions, LinkAccountFn, LinkAccountOptions, OAuth2Options, OAuth2Profile, OidcOptions, ServerAuthProvider, TokenResponse, Tokens, UserinfoResponse, WithLinkFn, WithLoginFn, alephaServerAuthRoutes, authenticationProviderSchema, tokenResponseSchema, tokensSchema, userinfoResponseSchema };
610
1635
  //# sourceMappingURL=index.d.ts.map