alepha 0.14.4 → 0.15.0

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 (277) hide show
  1. package/README.md +1 -4
  2. package/dist/api/audits/index.d.ts +619 -731
  3. package/dist/api/audits/index.d.ts.map +1 -1
  4. package/dist/api/files/index.d.ts +185 -298
  5. package/dist/api/files/index.d.ts.map +1 -1
  6. package/dist/api/files/index.js +0 -1
  7. package/dist/api/files/index.js.map +1 -1
  8. package/dist/api/jobs/index.d.ts +245 -356
  9. package/dist/api/jobs/index.d.ts.map +1 -1
  10. package/dist/api/notifications/index.d.ts +238 -350
  11. package/dist/api/notifications/index.d.ts.map +1 -1
  12. package/dist/api/parameters/index.d.ts +499 -611
  13. package/dist/api/parameters/index.d.ts.map +1 -1
  14. package/dist/api/users/index.browser.js +1 -2
  15. package/dist/api/users/index.browser.js.map +1 -1
  16. package/dist/api/users/index.d.ts +1697 -1804
  17. package/dist/api/users/index.d.ts.map +1 -1
  18. package/dist/api/users/index.js +178 -151
  19. package/dist/api/users/index.js.map +1 -1
  20. package/dist/api/verifications/index.d.ts +132 -132
  21. package/dist/api/verifications/index.d.ts.map +1 -1
  22. package/dist/batch/index.d.ts +122 -122
  23. package/dist/batch/index.d.ts.map +1 -1
  24. package/dist/batch/index.js +1 -2
  25. package/dist/batch/index.js.map +1 -1
  26. package/dist/bucket/index.d.ts +163 -163
  27. package/dist/bucket/index.d.ts.map +1 -1
  28. package/dist/cache/core/index.d.ts +46 -46
  29. package/dist/cache/core/index.d.ts.map +1 -1
  30. package/dist/cache/redis/index.d.ts.map +1 -1
  31. package/dist/cli/index.d.ts +302 -299
  32. package/dist/cli/index.d.ts.map +1 -1
  33. package/dist/cli/index.js +966 -564
  34. package/dist/cli/index.js.map +1 -1
  35. package/dist/command/index.d.ts +303 -299
  36. package/dist/command/index.d.ts.map +1 -1
  37. package/dist/command/index.js +11 -7
  38. package/dist/command/index.js.map +1 -1
  39. package/dist/core/index.browser.js +419 -99
  40. package/dist/core/index.browser.js.map +1 -1
  41. package/dist/core/index.d.ts +718 -625
  42. package/dist/core/index.d.ts.map +1 -1
  43. package/dist/core/index.js +420 -99
  44. package/dist/core/index.js.map +1 -1
  45. package/dist/core/index.native.js +419 -99
  46. package/dist/core/index.native.js.map +1 -1
  47. package/dist/datetime/index.d.ts +44 -44
  48. package/dist/datetime/index.d.ts.map +1 -1
  49. package/dist/datetime/index.js +4 -4
  50. package/dist/datetime/index.js.map +1 -1
  51. package/dist/email/index.d.ts +97 -50
  52. package/dist/email/index.d.ts.map +1 -1
  53. package/dist/email/index.js +129 -33
  54. package/dist/email/index.js.map +1 -1
  55. package/dist/fake/index.d.ts +7981 -14
  56. package/dist/fake/index.d.ts.map +1 -1
  57. package/dist/file/index.d.ts +523 -390
  58. package/dist/file/index.d.ts.map +1 -1
  59. package/dist/file/index.js +253 -1
  60. package/dist/file/index.js.map +1 -1
  61. package/dist/lock/core/index.d.ts +208 -208
  62. package/dist/lock/core/index.d.ts.map +1 -1
  63. package/dist/lock/redis/index.d.ts.map +1 -1
  64. package/dist/logger/index.d.ts +25 -26
  65. package/dist/logger/index.d.ts.map +1 -1
  66. package/dist/mcp/index.d.ts +197 -197
  67. package/dist/mcp/index.d.ts.map +1 -1
  68. package/dist/orm/chunk-DtkW-qnP.js +38 -0
  69. package/dist/orm/index.browser.js.map +1 -1
  70. package/dist/orm/index.bun.js +2814 -0
  71. package/dist/orm/index.bun.js.map +1 -0
  72. package/dist/orm/index.d.ts +1205 -1057
  73. package/dist/orm/index.d.ts.map +1 -1
  74. package/dist/orm/index.js +2056 -1753
  75. package/dist/orm/index.js.map +1 -1
  76. package/dist/queue/core/index.d.ts +248 -248
  77. package/dist/queue/core/index.d.ts.map +1 -1
  78. package/dist/queue/redis/index.d.ts.map +1 -1
  79. package/dist/redis/index.bun.js +285 -0
  80. package/dist/redis/index.bun.js.map +1 -0
  81. package/dist/redis/index.d.ts +118 -136
  82. package/dist/redis/index.d.ts.map +1 -1
  83. package/dist/redis/index.js +18 -38
  84. package/dist/redis/index.js.map +1 -1
  85. package/dist/retry/index.d.ts +69 -69
  86. package/dist/retry/index.d.ts.map +1 -1
  87. package/dist/router/index.d.ts +6 -6
  88. package/dist/router/index.d.ts.map +1 -1
  89. package/dist/scheduler/index.d.ts +25 -25
  90. package/dist/scheduler/index.d.ts.map +1 -1
  91. package/dist/security/index.browser.js +5 -1
  92. package/dist/security/index.browser.js.map +1 -1
  93. package/dist/security/index.d.ts +417 -254
  94. package/dist/security/index.d.ts.map +1 -1
  95. package/dist/security/index.js +386 -86
  96. package/dist/security/index.js.map +1 -1
  97. package/dist/server/auth/index.d.ts +277 -277
  98. package/dist/server/auth/index.d.ts.map +1 -1
  99. package/dist/server/auth/index.js +20 -20
  100. package/dist/server/auth/index.js.map +1 -1
  101. package/dist/server/cache/index.d.ts +60 -57
  102. package/dist/server/cache/index.d.ts.map +1 -1
  103. package/dist/server/cache/index.js +1 -1
  104. package/dist/server/cache/index.js.map +1 -1
  105. package/dist/server/compress/index.d.ts +3 -3
  106. package/dist/server/compress/index.d.ts.map +1 -1
  107. package/dist/server/cookies/index.d.ts +6 -6
  108. package/dist/server/cookies/index.d.ts.map +1 -1
  109. package/dist/server/cookies/index.js +3 -3
  110. package/dist/server/cookies/index.js.map +1 -1
  111. package/dist/server/core/index.d.ts +242 -150
  112. package/dist/server/core/index.d.ts.map +1 -1
  113. package/dist/server/core/index.js +288 -122
  114. package/dist/server/core/index.js.map +1 -1
  115. package/dist/server/cors/index.d.ts +11 -12
  116. package/dist/server/cors/index.d.ts.map +1 -1
  117. package/dist/server/health/index.d.ts +0 -1
  118. package/dist/server/health/index.d.ts.map +1 -1
  119. package/dist/server/helmet/index.d.ts +2 -2
  120. package/dist/server/helmet/index.d.ts.map +1 -1
  121. package/dist/server/links/index.browser.js.map +1 -1
  122. package/dist/server/links/index.d.ts +84 -85
  123. package/dist/server/links/index.d.ts.map +1 -1
  124. package/dist/server/links/index.js +1 -2
  125. package/dist/server/links/index.js.map +1 -1
  126. package/dist/server/metrics/index.d.ts.map +1 -1
  127. package/dist/server/multipart/index.d.ts +6 -6
  128. package/dist/server/multipart/index.d.ts.map +1 -1
  129. package/dist/server/proxy/index.d.ts +102 -103
  130. package/dist/server/proxy/index.d.ts.map +1 -1
  131. package/dist/server/rate-limit/index.d.ts +16 -16
  132. package/dist/server/rate-limit/index.d.ts.map +1 -1
  133. package/dist/server/static/index.d.ts +44 -44
  134. package/dist/server/static/index.d.ts.map +1 -1
  135. package/dist/server/swagger/index.d.ts +48 -49
  136. package/dist/server/swagger/index.d.ts.map +1 -1
  137. package/dist/server/swagger/index.js +1 -2
  138. package/dist/server/swagger/index.js.map +1 -1
  139. package/dist/sms/index.d.ts +13 -11
  140. package/dist/sms/index.d.ts.map +1 -1
  141. package/dist/sms/index.js +7 -7
  142. package/dist/sms/index.js.map +1 -1
  143. package/dist/thread/index.d.ts +71 -72
  144. package/dist/thread/index.d.ts.map +1 -1
  145. package/dist/topic/core/index.d.ts +318 -318
  146. package/dist/topic/core/index.d.ts.map +1 -1
  147. package/dist/topic/redis/index.d.ts +6 -6
  148. package/dist/topic/redis/index.d.ts.map +1 -1
  149. package/dist/vite/index.d.ts +5720 -159
  150. package/dist/vite/index.d.ts.map +1 -1
  151. package/dist/vite/index.js +41 -18
  152. package/dist/vite/index.js.map +1 -1
  153. package/dist/websocket/index.browser.js +6 -6
  154. package/dist/websocket/index.browser.js.map +1 -1
  155. package/dist/websocket/index.d.ts +247 -247
  156. package/dist/websocket/index.d.ts.map +1 -1
  157. package/dist/websocket/index.js +6 -6
  158. package/dist/websocket/index.js.map +1 -1
  159. package/package.json +9 -14
  160. package/src/api/files/controllers/AdminFileStatsController.ts +0 -1
  161. package/src/api/users/atoms/realmAuthSettingsAtom.ts +5 -0
  162. package/src/api/users/controllers/{UserRealmController.ts → RealmController.ts} +11 -11
  163. package/src/api/users/entities/users.ts +1 -1
  164. package/src/api/users/index.ts +8 -8
  165. package/src/api/users/primitives/{$userRealm.ts → $realm.ts} +17 -19
  166. package/src/api/users/providers/{UserRealmProvider.ts → RealmProvider.ts} +26 -30
  167. package/src/api/users/schemas/{userRealmConfigSchema.ts → realmConfigSchema.ts} +2 -2
  168. package/src/api/users/services/CredentialService.ts +7 -7
  169. package/src/api/users/services/IdentityService.ts +4 -4
  170. package/src/api/users/services/RegistrationService.spec.ts +25 -27
  171. package/src/api/users/services/RegistrationService.ts +38 -27
  172. package/src/api/users/services/SessionCrudService.ts +3 -3
  173. package/src/api/users/services/SessionService.spec.ts +3 -3
  174. package/src/api/users/services/SessionService.ts +28 -9
  175. package/src/api/users/services/UserService.ts +7 -7
  176. package/src/batch/providers/BatchProvider.ts +1 -2
  177. package/src/cli/apps/AlephaPackageBuilderCli.ts +38 -19
  178. package/src/cli/assets/apiHelloControllerTs.ts +18 -0
  179. package/src/cli/assets/apiIndexTs.ts +16 -0
  180. package/src/cli/assets/claudeMd.ts +303 -0
  181. package/src/cli/assets/mainBrowserTs.ts +2 -2
  182. package/src/cli/assets/mainServerTs.ts +24 -0
  183. package/src/cli/assets/webAppRouterTs.ts +15 -0
  184. package/src/cli/assets/webHelloComponentTsx.ts +16 -0
  185. package/src/cli/assets/webIndexTs.ts +16 -0
  186. package/src/cli/commands/build.ts +41 -21
  187. package/src/cli/commands/db.ts +21 -18
  188. package/src/cli/commands/deploy.ts +17 -5
  189. package/src/cli/commands/dev.ts +13 -17
  190. package/src/cli/commands/format.ts +8 -2
  191. package/src/cli/commands/init.ts +74 -29
  192. package/src/cli/commands/lint.ts +8 -2
  193. package/src/cli/commands/test.ts +8 -2
  194. package/src/cli/commands/typecheck.ts +5 -1
  195. package/src/cli/commands/verify.ts +4 -2
  196. package/src/cli/services/AlephaCliUtils.ts +39 -600
  197. package/src/cli/services/PackageManagerUtils.ts +301 -0
  198. package/src/cli/services/ProjectScaffolder.ts +306 -0
  199. package/src/command/helpers/Runner.ts +15 -3
  200. package/src/core/__tests__/Alepha-graph.spec.ts +4 -0
  201. package/src/core/index.shared.ts +1 -0
  202. package/src/core/index.ts +2 -0
  203. package/src/core/primitives/$hook.ts +6 -2
  204. package/src/core/primitives/$module.spec.ts +4 -0
  205. package/src/core/providers/AlsProvider.ts +1 -1
  206. package/src/core/providers/CodecManager.spec.ts +12 -6
  207. package/src/core/providers/CodecManager.ts +26 -6
  208. package/src/core/providers/EventManager.ts +169 -13
  209. package/src/core/providers/KeylessJsonSchemaCodec.spec.ts +621 -0
  210. package/src/core/providers/KeylessJsonSchemaCodec.ts +407 -0
  211. package/src/core/providers/StateManager.spec.ts +27 -16
  212. package/src/email/providers/LocalEmailProvider.spec.ts +111 -87
  213. package/src/email/providers/LocalEmailProvider.ts +52 -15
  214. package/src/email/providers/NodemailerEmailProvider.ts +167 -56
  215. package/src/file/errors/FileError.ts +7 -0
  216. package/src/file/index.ts +9 -1
  217. package/src/file/providers/MemoryFileSystemProvider.ts +393 -0
  218. package/src/orm/index.browser.ts +1 -19
  219. package/src/orm/index.bun.ts +77 -0
  220. package/src/orm/index.shared-server.ts +22 -0
  221. package/src/orm/index.shared.ts +15 -0
  222. package/src/orm/index.ts +19 -39
  223. package/src/orm/providers/drivers/BunPostgresProvider.ts +3 -5
  224. package/src/orm/providers/drivers/BunSqliteProvider.ts +1 -1
  225. package/src/orm/providers/drivers/CloudflareD1Provider.ts +4 -0
  226. package/src/orm/providers/drivers/DatabaseProvider.ts +4 -0
  227. package/src/orm/providers/drivers/PglitePostgresProvider.ts +4 -0
  228. package/src/orm/services/Repository.ts +8 -0
  229. package/src/redis/index.bun.ts +35 -0
  230. package/src/redis/providers/BunRedisProvider.ts +12 -43
  231. package/src/redis/providers/BunRedisSubscriberProvider.ts +2 -3
  232. package/src/redis/providers/NodeRedisProvider.ts +16 -34
  233. package/src/{server/security → security}/__tests__/BasicAuth.spec.ts +11 -11
  234. package/src/{server/security → security}/__tests__/ServerSecurityProvider-realm.spec.ts +21 -16
  235. package/src/{server/security/providers → security/__tests__}/ServerSecurityProvider.spec.ts +5 -5
  236. package/src/security/index.browser.ts +5 -0
  237. package/src/security/index.ts +90 -7
  238. package/src/security/primitives/{$realm.spec.ts → $issuer.spec.ts} +11 -11
  239. package/src/security/primitives/{$realm.ts → $issuer.ts} +20 -17
  240. package/src/security/primitives/$role.ts +5 -5
  241. package/src/security/primitives/$serviceAccount.spec.ts +5 -5
  242. package/src/security/primitives/$serviceAccount.ts +3 -3
  243. package/src/{server/security → security}/providers/ServerSecurityProvider.ts +5 -7
  244. package/src/server/auth/primitives/$auth.ts +10 -10
  245. package/src/server/auth/primitives/$authCredentials.ts +3 -3
  246. package/src/server/auth/primitives/$authGithub.ts +3 -3
  247. package/src/server/auth/primitives/$authGoogle.ts +3 -3
  248. package/src/server/auth/providers/ServerAuthProvider.ts +13 -13
  249. package/src/server/cache/providers/ServerCacheProvider.ts +1 -1
  250. package/src/server/cookies/providers/ServerCookiesProvider.ts +3 -3
  251. package/src/server/core/providers/NodeHttpServerProvider.ts +25 -6
  252. package/src/server/core/providers/ServerBodyParserProvider.ts +19 -23
  253. package/src/server/core/providers/ServerLoggerProvider.ts +23 -19
  254. package/src/server/core/providers/ServerProvider.ts +144 -21
  255. package/src/server/core/providers/ServerRouterProvider.ts +259 -115
  256. package/src/server/core/providers/ServerTimingProvider.ts +2 -2
  257. package/src/server/links/index.ts +1 -1
  258. package/src/server/links/providers/LinkProvider.ts +1 -1
  259. package/src/server/swagger/index.ts +1 -1
  260. package/src/sms/providers/LocalSmsProvider.spec.ts +153 -111
  261. package/src/sms/providers/LocalSmsProvider.ts +8 -7
  262. package/src/vite/helpers/boot.ts +28 -17
  263. package/src/vite/tasks/buildServer.ts +12 -1
  264. package/src/vite/tasks/devServer.ts +3 -1
  265. package/src/vite/tasks/generateCloudflare.ts +7 -0
  266. package/dist/server/security/index.browser.js +0 -13
  267. package/dist/server/security/index.browser.js.map +0 -1
  268. package/dist/server/security/index.d.ts +0 -173
  269. package/dist/server/security/index.d.ts.map +0 -1
  270. package/dist/server/security/index.js +0 -311
  271. package/dist/server/security/index.js.map +0 -1
  272. package/src/cli/assets/appRouterTs.ts +0 -9
  273. package/src/cli/assets/mainTs.ts +0 -13
  274. package/src/server/security/index.browser.ts +0 -10
  275. package/src/server/security/index.ts +0 -94
  276. /package/src/{server/security → security}/primitives/$basicAuth.ts +0 -0
  277. /package/src/{server/security → security}/providers/ServerBasicAuthProvider.ts +0 -0
@@ -1,9 +1,9 @@
1
- import * as alepha165 from "alepha";
1
+ import * as alepha181 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";
6
+ import { AccessTokenResponse, IssuerPrimitive, SecurityProvider, UserAccount } from "alepha/security";
7
7
  import { Configuration } from "openid-client";
8
8
  import * as alepha_logger0 from "alepha/logger";
9
9
  import * as alepha_server0 from "alepha/server";
@@ -20,45 +20,45 @@ declare const alephaServerAuthRoutes: {
20
20
  };
21
21
  //#endregion
22
22
  //#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">;
23
+ declare const authenticationProviderSchema: alepha181.TObject<{
24
+ name: alepha181.TString;
25
+ type: alepha181.TUnsafe<"OAUTH2" | "OIDC" | "CREDENTIALS">;
26
26
  }>;
27
27
  type AuthenticationProvider = Static<typeof authenticationProviderSchema>;
28
28
  //#endregion
29
29
  //#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>>;
30
+ declare const tokenResponseSchema: alepha181.TObject<{
31
+ provider: alepha181.TString;
32
+ access_token: alepha181.TString;
33
+ issued_at: alepha181.TNumber;
34
+ expires_in: alepha181.TOptional<alepha181.TNumber>;
35
+ refresh_token: alepha181.TOptional<alepha181.TString>;
36
+ refresh_token_expires_in: alepha181.TOptional<alepha181.TNumber>;
37
+ refresh_expires_in: alepha181.TOptional<alepha181.TNumber>;
38
+ id_token: alepha181.TOptional<alepha181.TString>;
39
+ scope: alepha181.TOptional<alepha181.TString>;
40
+ user: alepha181.TObject<{
41
+ id: alepha181.TString;
42
+ name: alepha181.TOptional<alepha181.TString>;
43
+ email: alepha181.TOptional<alepha181.TString>;
44
+ username: alepha181.TOptional<alepha181.TString>;
45
+ picture: alepha181.TOptional<alepha181.TString>;
46
+ sessionId: alepha181.TOptional<alepha181.TString>;
47
+ organizations: alepha181.TOptional<alepha181.TArray<alepha181.TString>>;
48
+ roles: alepha181.TOptional<alepha181.TArray<alepha181.TString>>;
49
49
  }>;
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>;
50
+ api: alepha181.TObject<{
51
+ prefix: alepha181.TOptional<alepha181.TString>;
52
+ links: alepha181.TArray<alepha181.TObject<{
53
+ name: alepha181.TString;
54
+ group: alepha181.TOptional<alepha181.TString>;
55
+ path: alepha181.TString;
56
+ method: alepha181.TOptional<alepha181.TString>;
57
+ requestBodyType: alepha181.TOptional<alepha181.TString>;
58
+ service: alepha181.TOptional<alepha181.TString>;
59
+ rawSchema: alepha181.TOptional<alepha181.TObject<{
60
+ body: alepha181.TOptional<alepha181.TString>;
61
+ response: alepha181.TOptional<alepha181.TString>;
62
62
  }>>;
63
63
  }>>;
64
64
  }>;
@@ -66,43 +66,43 @@ declare const tokenResponseSchema: alepha165.TObject<{
66
66
  type TokenResponse = Static<typeof tokenResponseSchema>;
67
67
  //#endregion
68
68
  //#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>;
69
+ declare const tokensSchema: alepha181.TObject<{
70
+ provider: alepha181.TString;
71
+ access_token: alepha181.TString;
72
+ issued_at: alepha181.TNumber;
73
+ expires_in: alepha181.TOptional<alepha181.TNumber>;
74
+ refresh_token: alepha181.TOptional<alepha181.TString>;
75
+ refresh_token_expires_in: alepha181.TOptional<alepha181.TNumber>;
76
+ refresh_expires_in: alepha181.TOptional<alepha181.TNumber>;
77
+ id_token: alepha181.TOptional<alepha181.TString>;
78
+ scope: alepha181.TOptional<alepha181.TString>;
79
79
  }>;
80
80
  type Tokens = Static<typeof tokensSchema>;
81
81
  //#endregion
82
82
  //#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>>;
83
+ declare const userinfoResponseSchema: alepha181.TObject<{
84
+ user: alepha181.TOptional<alepha181.TObject<{
85
+ id: alepha181.TString;
86
+ name: alepha181.TOptional<alepha181.TString>;
87
+ email: alepha181.TOptional<alepha181.TString>;
88
+ username: alepha181.TOptional<alepha181.TString>;
89
+ picture: alepha181.TOptional<alepha181.TString>;
90
+ sessionId: alepha181.TOptional<alepha181.TString>;
91
+ organizations: alepha181.TOptional<alepha181.TArray<alepha181.TString>>;
92
+ roles: alepha181.TOptional<alepha181.TArray<alepha181.TString>>;
93
93
  }>>;
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>;
94
+ api: alepha181.TObject<{
95
+ prefix: alepha181.TOptional<alepha181.TString>;
96
+ links: alepha181.TArray<alepha181.TObject<{
97
+ name: alepha181.TString;
98
+ group: alepha181.TOptional<alepha181.TString>;
99
+ path: alepha181.TString;
100
+ method: alepha181.TOptional<alepha181.TString>;
101
+ requestBodyType: alepha181.TOptional<alepha181.TString>;
102
+ service: alepha181.TOptional<alepha181.TString>;
103
+ rawSchema: alepha181.TOptional<alepha181.TObject<{
104
+ body: alepha181.TOptional<alepha181.TString>;
105
+ response: alepha181.TOptional<alepha181.TString>;
106
106
  }>>;
107
107
  }>>;
108
108
  }>;
@@ -116,173 +116,173 @@ declare class ServerAuthProvider {
116
116
  protected readonly serverCookiesProvider: ServerCookiesProvider;
117
117
  protected readonly dateTimeProvider: DateTimeProvider;
118
118
  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>;
119
+ protected readonly authorizationCode: alepha_server_cookies0.AbstractCookiePrimitive<alepha181.TObject<{
120
+ provider: alepha181.TString;
121
+ realm: alepha181.TOptional<alepha181.TString>;
122
+ codeVerifier: alepha181.TOptional<alepha181.TString>;
123
+ redirectUri: alepha181.TOptional<alepha181.TString>;
124
+ state: alepha181.TOptional<alepha181.TString>;
125
+ nonce: alepha181.TOptional<alepha181.TString>;
126
126
  }>>;
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>;
127
+ readonly tokens: alepha_server_cookies0.AbstractCookiePrimitive<alepha181.TObject<{
128
+ provider: alepha181.TString;
129
+ access_token: alepha181.TString;
130
+ issued_at: alepha181.TNumber;
131
+ expires_in: alepha181.TOptional<alepha181.TNumber>;
132
+ refresh_token: alepha181.TOptional<alepha181.TString>;
133
+ refresh_token_expires_in: alepha181.TOptional<alepha181.TNumber>;
134
+ refresh_expires_in: alepha181.TOptional<alepha181.TNumber>;
135
+ id_token: alepha181.TOptional<alepha181.TString>;
136
+ scope: alepha181.TOptional<alepha181.TString>;
137
137
  }>>;
138
138
  get identities(): Array<AuthPrimitive>;
139
139
  getAuthenticationProviders(filters?: {
140
140
  realmName?: string;
141
141
  }): AuthenticationProvider[];
142
- protected readonly configure: alepha165.HookPrimitive<"configure">;
142
+ protected readonly configure: alepha181.HookPrimitive<"configure">;
143
143
  protected getAccessTokens(tokens: Tokens): string | undefined;
144
144
  /**
145
- * Fill request headers with access token from cookies or fallback to provider's fallback function.
146
- */
147
- protected readonly onRequest: alepha165.HookPrimitive<"server:onRequest">;
145
+ * Fill request headers with access token from cookies or fallback to provider's fallback function.
146
+ */
147
+ protected readonly onRequest: alepha181.HookPrimitive<"server:onRequest">;
148
148
  /**
149
- * Convert cookies to tokens.
150
- * If the tokens are expired, try to refresh them using the refresh token.
151
- */
149
+ * Convert cookies to tokens.
150
+ * If the tokens are expired, try to refresh them using the refresh token.
151
+ */
152
152
  protected cookiesToTokens(cookies: Cookies): Promise<Tokens | undefined>;
153
153
  protected refreshTokens(tokens: Tokens): Promise<Tokens | undefined>;
154
154
  /**
155
- * Get user information.
156
- */
155
+ * Get user information.
156
+ */
157
157
  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>>;
158
+ response: alepha181.TObject<{
159
+ user: alepha181.TOptional<alepha181.TObject<{
160
+ id: alepha181.TString;
161
+ name: alepha181.TOptional<alepha181.TString>;
162
+ email: alepha181.TOptional<alepha181.TString>;
163
+ username: alepha181.TOptional<alepha181.TString>;
164
+ picture: alepha181.TOptional<alepha181.TString>;
165
+ sessionId: alepha181.TOptional<alepha181.TString>;
166
+ organizations: alepha181.TOptional<alepha181.TArray<alepha181.TString>>;
167
+ roles: alepha181.TOptional<alepha181.TArray<alepha181.TString>>;
168
168
  }>>;
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>;
169
+ api: alepha181.TObject<{
170
+ prefix: alepha181.TOptional<alepha181.TString>;
171
+ links: alepha181.TArray<alepha181.TObject<{
172
+ name: alepha181.TString;
173
+ group: alepha181.TOptional<alepha181.TString>;
174
+ path: alepha181.TString;
175
+ method: alepha181.TOptional<alepha181.TString>;
176
+ requestBodyType: alepha181.TOptional<alepha181.TString>;
177
+ service: alepha181.TOptional<alepha181.TString>;
178
+ rawSchema: alepha181.TOptional<alepha181.TObject<{
179
+ body: alepha181.TOptional<alepha181.TString>;
180
+ response: alepha181.TOptional<alepha181.TString>;
181
181
  }>>;
182
182
  }>>;
183
183
  }>;
184
184
  }>;
185
185
  }>;
186
186
  /**
187
- * Refresh a token for internal providers.
188
- */
187
+ * Refresh a token for internal providers.
188
+ */
189
189
  readonly refresh: alepha_server0.RoutePrimitive<{
190
- query: alepha165.TObject<{
191
- provider: alepha165.TString;
190
+ query: alepha181.TObject<{
191
+ provider: alepha181.TString;
192
192
  }>;
193
- body: alepha165.TObject<{
194
- refresh_token: alepha165.TString;
195
- access_token: alepha165.TOptional<alepha165.TString>;
193
+ body: alepha181.TObject<{
194
+ refresh_token: alepha181.TString;
195
+ access_token: alepha181.TOptional<alepha181.TString>;
196
196
  }>;
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>;
197
+ response: alepha181.TObject<{
198
+ provider: alepha181.TString;
199
+ access_token: alepha181.TString;
200
+ issued_at: alepha181.TNumber;
201
+ expires_in: alepha181.TOptional<alepha181.TNumber>;
202
+ refresh_token: alepha181.TOptional<alepha181.TString>;
203
+ refresh_token_expires_in: alepha181.TOptional<alepha181.TNumber>;
204
+ refresh_expires_in: alepha181.TOptional<alepha181.TNumber>;
205
+ id_token: alepha181.TOptional<alepha181.TString>;
206
+ scope: alepha181.TOptional<alepha181.TString>;
207
207
  }>;
208
208
  }>;
209
209
  /**
210
- * Login for local password-based authentication.
211
- */
210
+ * Login for local password-based authentication.
211
+ */
212
212
  readonly token: alepha_server0.RoutePrimitive<{
213
- query: alepha165.TObject<{
214
- provider: alepha165.TString;
215
- realm: alepha165.TOptional<alepha165.TString>;
213
+ query: alepha181.TObject<{
214
+ provider: alepha181.TString;
215
+ realm: alepha181.TOptional<alepha181.TString>;
216
216
  }>;
217
- body: alepha165.TObject<{
218
- username: alepha165.TString;
219
- password: alepha165.TString;
217
+ body: alepha181.TObject<{
218
+ username: alepha181.TString;
219
+ password: alepha181.TString;
220
220
  }>;
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>>;
221
+ response: alepha181.TObject<{
222
+ provider: alepha181.TString;
223
+ access_token: alepha181.TString;
224
+ issued_at: alepha181.TNumber;
225
+ expires_in: alepha181.TOptional<alepha181.TNumber>;
226
+ refresh_token: alepha181.TOptional<alepha181.TString>;
227
+ refresh_token_expires_in: alepha181.TOptional<alepha181.TNumber>;
228
+ refresh_expires_in: alepha181.TOptional<alepha181.TNumber>;
229
+ id_token: alepha181.TOptional<alepha181.TString>;
230
+ scope: alepha181.TOptional<alepha181.TString>;
231
+ user: alepha181.TObject<{
232
+ id: alepha181.TString;
233
+ name: alepha181.TOptional<alepha181.TString>;
234
+ email: alepha181.TOptional<alepha181.TString>;
235
+ username: alepha181.TOptional<alepha181.TString>;
236
+ picture: alepha181.TOptional<alepha181.TString>;
237
+ sessionId: alepha181.TOptional<alepha181.TString>;
238
+ organizations: alepha181.TOptional<alepha181.TArray<alepha181.TString>>;
239
+ roles: alepha181.TOptional<alepha181.TArray<alepha181.TString>>;
240
240
  }>;
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>;
241
+ api: alepha181.TObject<{
242
+ prefix: alepha181.TOptional<alepha181.TString>;
243
+ links: alepha181.TArray<alepha181.TObject<{
244
+ name: alepha181.TString;
245
+ group: alepha181.TOptional<alepha181.TString>;
246
+ path: alepha181.TString;
247
+ method: alepha181.TOptional<alepha181.TString>;
248
+ requestBodyType: alepha181.TOptional<alepha181.TString>;
249
+ service: alepha181.TOptional<alepha181.TString>;
250
+ rawSchema: alepha181.TOptional<alepha181.TObject<{
251
+ body: alepha181.TOptional<alepha181.TString>;
252
+ response: alepha181.TOptional<alepha181.TString>;
253
253
  }>>;
254
254
  }>>;
255
255
  }>;
256
256
  }>;
257
257
  }>;
258
258
  /**
259
- * Oauth2/OIDC login route.
260
- */
259
+ * Oauth2/OIDC login route.
260
+ */
261
261
  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>;
262
+ query: alepha181.TObject<{
263
+ provider: alepha181.TString;
264
+ realm: alepha181.TOptional<alepha181.TString>;
265
+ redirect_uri: alepha181.TOptional<alepha181.TString>;
266
266
  }>;
267
267
  }>;
268
268
  /**
269
- * Callback for OAuth2/OIDC providers.
270
- * It handles the authorization code flow and retrieves the access token.
271
- */
269
+ * Callback for OAuth2/OIDC providers.
270
+ * It handles the authorization code flow and retrieves the access token.
271
+ */
272
272
  readonly callback: alepha_server0.RoutePrimitive<alepha_server0.RequestConfigSchema>;
273
273
  /**
274
- * Logout route for OAuth2/OIDC providers.
275
- */
274
+ * Logout route for OAuth2/OIDC providers.
275
+ */
276
276
  readonly logout: alepha_server0.RoutePrimitive<{
277
- query: alepha165.TObject<{
278
- post_logout_redirect_uri: alepha165.TOptional<alepha165.TString>;
277
+ query: alepha181.TObject<{
278
+ post_logout_redirect_uri: alepha181.TOptional<alepha181.TString>;
279
279
  }>;
280
280
  }>;
281
281
  /**
282
- * Find an auth provider by name and optionally by realm.
283
- * When realm is specified, it filters providers by both name and realm.
284
- * This enables multi-realm setups where multiple providers share the same name (e.g., "credentials").
285
- */
282
+ * Find an auth provider by name and optionally by realm.
283
+ * When realm is specified, it filters providers by both name and realm.
284
+ * This enables multi-realm setups where multiple providers share the same name (e.g., "credentials").
285
+ */
286
286
  protected provider(opts: string | {
287
287
  provider: string;
288
288
  realm?: string;
@@ -362,13 +362,13 @@ declare const $auth: {
362
362
  };
363
363
  type AuthPrimitiveOptions = {
364
364
  /**
365
- * Name of the identity provider.
366
- * If not provided, it will be derived from the property key.
367
- */
365
+ * Name of the identity provider.
366
+ * If not provided, it will be derived from the property key.
367
+ */
368
368
  name?: string;
369
369
  /**
370
- * If true, auth provider will be skipped.
371
- */
370
+ * If true, auth provider will be skipped.
371
+ */
372
372
  disabled?: boolean;
373
373
  } & (AuthExternal | AuthInternal);
374
374
  /**
@@ -376,60 +376,60 @@ type AuthPrimitiveOptions = {
376
376
  */
377
377
  type AuthExternal = {
378
378
  /**
379
- * Only OIDC is supported for external authentication.
380
- */
379
+ * Only OIDC is supported for external authentication.
380
+ */
381
381
  oidc: OidcOptions;
382
382
  /**
383
- * For anonymous access, this will expect a service account access token.
384
- *
385
- * ```ts
386
- * class App {
387
- * anonymous = $serviceAccount(...);
388
- * auth = $auth({
389
- * // ... config ...
390
- * fallback: this.anonymous,
391
- * })
392
- * }
393
- * ```
394
- */
383
+ * For anonymous access, this will expect a service account access token.
384
+ *
385
+ * ```ts
386
+ * class App {
387
+ * anonymous = $serviceAccount(...);
388
+ * auth = $auth({
389
+ * // ... config ...
390
+ * fallback: this.anonymous,
391
+ * })
392
+ * }
393
+ * ```
394
+ */
395
395
  fallback?: () => Async<AccessToken>;
396
396
  };
397
397
  /**
398
398
  * When using your own authentication system, e.g. using a database to store user accounts.
399
399
  * This is usually used with a custom login form.
400
400
  *
401
- * This relies on the `realm`, which is used to create/verify the access token.
401
+ * This relies on the `issuer`, which is used to create/verify the access token.
402
402
  */
403
403
  type AuthInternal = {
404
- realm: RealmPrimitive;
404
+ issuer: IssuerPrimitive;
405
405
  } & ({
406
406
  /**
407
- * The common username/password authentication.
408
- *
409
- * - It uses the OAuth2 Client Credentials flow to obtain an access token.
410
- *
411
- * This is usually used with a custom login form on your website or mobile app.
412
- */
407
+ * The common username/password authentication.
408
+ *
409
+ * - It uses the OAuth2 Client Credentials flow to obtain an access token.
410
+ *
411
+ * This is usually used with a custom login form on your website or mobile app.
412
+ */
413
413
  credentials: CredentialsOptions;
414
414
  } | {
415
415
  /**
416
- * OAuth2 authentication. Delegates authentication to an OAuth2 provider. (e.g. Google, GitHub, etc.)
417
- *
418
- * - It uses the OAuth2 Authorization Code flow to obtain an access token and user information.
419
- *
420
- * This is usually used with a login button that redirects to the OAuth2 provider.
421
- */
416
+ * OAuth2 authentication. Delegates authentication to an OAuth2 provider. (e.g. Google, GitHub, etc.)
417
+ *
418
+ * - It uses the OAuth2 Authorization Code flow to obtain an access token and user information.
419
+ *
420
+ * This is usually used with a login button that redirects to the OAuth2 provider.
421
+ */
422
422
  oauth: OAuth2Options;
423
423
  } | {
424
424
  /**
425
- * Like OAuth2, but uses OIDC (OpenID Connect) for authentication and user information retrieval.
426
- * OIDC is an identity layer on top of OAuth2, providing user authentication and profile information.
427
- *
428
- * - It uses the OAuth2 Authorization Code flow to obtain an access token and user information.
429
- * - PCKE (Proof Key for Code Exchange) is recommended for security.
430
- *
431
- * This is usually used with a login button that redirects to the OIDC provider.
432
- */
425
+ * Like OAuth2, but uses OIDC (OpenID Connect) for authentication and user information retrieval.
426
+ * OIDC is an identity layer on top of OAuth2, providing user authentication and profile information.
427
+ *
428
+ * - It uses the OAuth2 Authorization Code flow to obtain an access token and user information.
429
+ * - PCKE (Proof Key for Code Exchange) is recommended for security.
430
+ *
431
+ * This is usually used with a login button that redirects to the OIDC provider.
432
+ */
433
433
  oidc: OidcOptions;
434
434
  });
435
435
  type CredentialsOptions = {
@@ -442,36 +442,36 @@ interface Credentials {
442
442
  }
443
443
  interface OidcOptions {
444
444
  /**
445
- * URL of the OIDC issuer.
446
- */
445
+ * URL of the OIDC issuer.
446
+ */
447
447
  issuer: string;
448
448
  /**
449
- * Client ID for the OIDC client.
450
- */
449
+ * Client ID for the OIDC client.
450
+ */
451
451
  clientId: string;
452
452
  /**
453
- * Client secret for the OIDC client.
454
- * Optional if PKCE (Proof Key for Code Exchange) is used.
455
- */
453
+ * Client secret for the OIDC client.
454
+ * Optional if PKCE (Proof Key for Code Exchange) is used.
455
+ */
456
456
  clientSecret?: string;
457
457
  /**
458
- * Redirect URI for the OIDC client.
459
- * This is where the user will be redirected after authentication.
460
- */
458
+ * Redirect URI for the OIDC client.
459
+ * This is where the user will be redirected after authentication.
460
+ */
461
461
  redirectUri?: string;
462
462
  /**
463
- * For external auth providers only.
464
- * Take the ID token instead of the access token for validation.
465
- */
463
+ * For external auth providers only.
464
+ * Take the ID token instead of the access token for validation.
465
+ */
466
466
  useIdToken?: boolean;
467
467
  /**
468
- * URI to redirect the user after logout.
469
- */
468
+ * URI to redirect the user after logout.
469
+ */
470
470
  logoutUri?: string;
471
471
  /**
472
- * Optional scope for the OIDC client.
473
- * @default "openid profile email".
474
- */
472
+ * Optional scope for the OIDC client.
473
+ * @default "openid profile email".
474
+ */
475
475
  scope?: string;
476
476
  account?: LinkAccountFn;
477
477
  }
@@ -485,33 +485,33 @@ interface LinkAccountOptions {
485
485
  type LinkAccountFn = (tokens: LinkAccountOptions) => Async<UserAccount>;
486
486
  interface OAuth2Options {
487
487
  /**
488
- * URL of the OAuth2 authorization endpoint.
489
- */
488
+ * URL of the OAuth2 authorization endpoint.
489
+ */
490
490
  clientId: string;
491
491
  /**
492
- * Client secret for the OAuth2 client.
493
- */
492
+ * Client secret for the OAuth2 client.
493
+ */
494
494
  clientSecret: string;
495
495
  /**
496
- * URL of the OAuth2 authorization endpoint.
497
- */
496
+ * URL of the OAuth2 authorization endpoint.
497
+ */
498
498
  authorization: string;
499
499
  /**
500
- * URL of the OAuth2 token endpoint.
501
- */
500
+ * URL of the OAuth2 token endpoint.
501
+ */
502
502
  token: string;
503
503
  /**
504
- * Function to retrieve user profile information from the OAuth2 tokens.
505
- */
504
+ * Function to retrieve user profile information from the OAuth2 tokens.
505
+ */
506
506
  userinfo: (tokens: Tokens) => Async<OAuth2Profile>;
507
507
  account?: LinkAccountFn;
508
508
  /**
509
- * URL of the OAuth2 authorization endpoint.
510
- */
509
+ * URL of the OAuth2 authorization endpoint.
510
+ */
511
511
  redirectUri?: string;
512
512
  /**
513
- * URL of the OAuth2 authorization endpoint.
514
- */
513
+ * URL of the OAuth2 authorization endpoint.
514
+ */
515
515
  scope?: string;
516
516
  }
517
517
  declare class AuthPrimitive extends Primitive<AuthPrimitiveOptions> {
@@ -519,19 +519,19 @@ declare class AuthPrimitive extends Primitive<AuthPrimitiveOptions> {
519
519
  protected readonly dateTimeProvider: DateTimeProvider;
520
520
  oauth?: Configuration;
521
521
  get name(): string;
522
- get realm(): RealmPrimitive | undefined;
522
+ get issuer(): IssuerPrimitive | undefined;
523
523
  get jwks_uri(): string;
524
524
  get scope(): string | undefined;
525
525
  get redirect_uri(): string | undefined;
526
526
  /**
527
- * Refreshes the access token using the refresh token.
528
- * Can be used on oauth2, oidc or credentials auth providers.
529
- */
527
+ * Refreshes the access token using the refresh token.
528
+ * Can be used on oauth2, oidc or credentials auth providers.
529
+ */
530
530
  refresh(refreshToken: string, accessToken?: string): Promise<AccessTokenResponse>;
531
531
  /**
532
- * Extracts user information from the access token.
533
- * This is used to create a user account from the access token.
534
- */
532
+ * Extracts user information from the access token.
533
+ * This is used to create a user account from the access token.
534
+ */
535
535
  user(tokens: Tokens): Promise<UserAccount>;
536
536
  protected getUserFromIdToken(idToken: string): OAuth2Profile;
537
537
  prepare(): Promise<void>;
@@ -552,7 +552,7 @@ interface WithLoginFn {
552
552
  *
553
553
  * Uses username and password to authenticate users.
554
554
  */
555
- declare const $authCredentials: (realm: RealmPrimitive & WithLoginFn, options?: Partial<CredentialsOptions>) => AuthPrimitive;
555
+ declare const $authCredentials: (realm: IssuerPrimitive & WithLoginFn, options?: Partial<CredentialsOptions>) => AuthPrimitive;
556
556
  //#endregion
557
557
  //#region ../../src/server/auth/primitives/$authGithub.d.ts
558
558
  /**
@@ -565,7 +565,7 @@ declare const $authCredentials: (realm: RealmPrimitive & WithLoginFn, options?:
565
565
  * - `GITHUB_CLIENT_ID`: The client ID obtained from the GitHub Developer Settings.
566
566
  * - `GITHUB_CLIENT_SECRET`: The client secret obtained from the GitHub Developer Settings.
567
567
  */
568
- declare const $authGithub: (realm: RealmPrimitive & WithLinkFn, options?: Partial<OidcOptions>) => AuthPrimitive;
568
+ declare const $authGithub: (realm: IssuerPrimitive & WithLinkFn, options?: Partial<OidcOptions>) => AuthPrimitive;
569
569
  //#endregion
570
570
  //#region ../../src/server/auth/primitives/$authGoogle.d.ts
571
571
  /**
@@ -578,16 +578,16 @@ declare const $authGithub: (realm: RealmPrimitive & WithLinkFn, options?: Partia
578
578
  * - `GOOGLE_CLIENT_ID`: The client ID obtained from the Google Developer Console.
579
579
  * - `GOOGLE_CLIENT_SECRET`: The client secret obtained from the Google Developer Console.
580
580
  */
581
- declare const $authGoogle: (realm: RealmPrimitive & WithLinkFn, options?: Partial<OidcOptions>) => AuthPrimitive;
581
+ declare const $authGoogle: (realm: IssuerPrimitive & WithLinkFn, options?: Partial<OidcOptions>) => AuthPrimitive;
582
582
  //#endregion
583
583
  //#region ../../src/server/auth/index.d.ts
584
584
  declare module "alepha" {
585
585
  interface State {
586
586
  /**
587
- * The authenticated user account attached to the server request state.
588
- *
589
- * @internal
590
- */
587
+ * The authenticated user account attached to the server request state.
588
+ *
589
+ * @internal
590
+ */
591
591
  "alepha.server.request.user"?: UserAccount;
592
592
  }
593
593
  }
@@ -604,7 +604,7 @@ declare module "alepha" {
604
604
  * @see {@link ServerAuthProvider}
605
605
  * @module alepha.server.auth
606
606
  */
607
- declare const AlephaServerAuth: alepha165.Service<alepha165.Module>;
607
+ declare const AlephaServerAuth: alepha181.Service<alepha181.Module>;
608
608
  //#endregion
609
609
  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
610
  //# sourceMappingURL=index.d.ts.map