@effect-auth/core 0.1.0-alpha.1 → 0.1.0-alpha.13

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 (255) hide show
  1. package/README.md +790 -73
  2. package/dist/ApiKey.d.ts +207 -0
  3. package/dist/ApiKey.d.ts.map +1 -0
  4. package/dist/ApiKey.js +275 -0
  5. package/dist/ApiKey.js.map +1 -0
  6. package/dist/AuditLog.d.ts +335 -1
  7. package/dist/AuditLog.d.ts.map +1 -1
  8. package/dist/AuditLog.js +318 -1
  9. package/dist/AuditLog.js.map +1 -1
  10. package/dist/AuthConfig.d.ts +42 -0
  11. package/dist/AuthConfig.d.ts.map +1 -0
  12. package/dist/AuthConfig.js +43 -0
  13. package/dist/AuthConfig.js.map +1 -0
  14. package/dist/AuthFlow.d.ts +462 -36
  15. package/dist/AuthFlow.d.ts.map +1 -1
  16. package/dist/AuthFlow.js +657 -5
  17. package/dist/AuthFlow.js.map +1 -1
  18. package/dist/AuthKernel.d.ts +3 -0
  19. package/dist/AuthKernel.d.ts.map +1 -0
  20. package/dist/AuthKernel.js +9 -0
  21. package/dist/AuthKernel.js.map +1 -0
  22. package/dist/Challenge.d.ts +24 -4
  23. package/dist/Challenge.d.ts.map +1 -1
  24. package/dist/Challenge.js +167 -1
  25. package/dist/Challenge.js.map +1 -1
  26. package/dist/Client.d.ts +449 -0
  27. package/dist/Client.d.ts.map +1 -0
  28. package/dist/Client.js +985 -0
  29. package/dist/Client.js.map +1 -0
  30. package/dist/Crypto.d.ts +6 -1
  31. package/dist/Crypto.d.ts.map +1 -1
  32. package/dist/Crypto.js +62 -1
  33. package/dist/Crypto.js.map +1 -1
  34. package/dist/DomainVerification.d.ts +200 -0
  35. package/dist/DomainVerification.d.ts.map +1 -0
  36. package/dist/DomainVerification.js +304 -0
  37. package/dist/DomainVerification.js.map +1 -0
  38. package/dist/EffectQbSqliteStorage.d.ts +985 -0
  39. package/dist/EffectQbSqliteStorage.d.ts.map +1 -0
  40. package/dist/EffectQbSqliteStorage.js +2824 -0
  41. package/dist/EffectQbSqliteStorage.js.map +1 -0
  42. package/dist/EmailOtp.d.ts +120 -0
  43. package/dist/EmailOtp.d.ts.map +1 -0
  44. package/dist/EmailOtp.js +286 -0
  45. package/dist/EmailOtp.js.map +1 -0
  46. package/dist/EmailVerification.d.ts +121 -0
  47. package/dist/EmailVerification.d.ts.map +1 -0
  48. package/dist/EmailVerification.js +200 -0
  49. package/dist/EmailVerification.js.map +1 -0
  50. package/dist/HttpApi/Api.d.ts +2410 -0
  51. package/dist/HttpApi/Api.d.ts.map +1 -0
  52. package/dist/HttpApi/Api.js +3026 -0
  53. package/dist/HttpApi/Api.js.map +1 -0
  54. package/dist/HttpApi/Endpoints.d.ts +1073 -0
  55. package/dist/HttpApi/Endpoints.d.ts.map +1 -0
  56. package/dist/HttpApi/Endpoints.js +428 -0
  57. package/dist/HttpApi/Endpoints.js.map +1 -0
  58. package/dist/HttpApi/Errors.d.ts +114 -0
  59. package/dist/HttpApi/Errors.d.ts.map +1 -0
  60. package/dist/HttpApi/Errors.js +230 -0
  61. package/dist/HttpApi/Errors.js.map +1 -0
  62. package/dist/HttpApi/Schemas.d.ts +1254 -0
  63. package/dist/HttpApi/Schemas.d.ts.map +1 -0
  64. package/dist/HttpApi/Schemas.js +862 -0
  65. package/dist/HttpApi/Schemas.js.map +1 -0
  66. package/dist/HttpApi/Security.d.ts +159 -0
  67. package/dist/HttpApi/Security.d.ts.map +1 -0
  68. package/dist/HttpApi/Security.js +530 -0
  69. package/dist/HttpApi/Security.js.map +1 -0
  70. package/dist/HttpApi/Transport.d.ts +65 -0
  71. package/dist/HttpApi/Transport.d.ts.map +1 -0
  72. package/dist/HttpApi/Transport.js +311 -0
  73. package/dist/HttpApi/Transport.js.map +1 -0
  74. package/dist/HttpApi/index.d.ts +8 -0
  75. package/dist/HttpApi/index.d.ts.map +1 -0
  76. package/dist/HttpApi/index.js +7 -0
  77. package/dist/HttpApi/index.js.map +1 -0
  78. package/dist/HttpApi.d.ts +2 -0
  79. package/dist/HttpApi.d.ts.map +1 -0
  80. package/dist/HttpApi.js +2 -0
  81. package/dist/HttpApi.js.map +1 -0
  82. package/dist/Identifiers.d.ts +3 -0
  83. package/dist/Identifiers.d.ts.map +1 -1
  84. package/dist/Identifiers.js +2 -0
  85. package/dist/Identifiers.js.map +1 -1
  86. package/dist/IncidentAction.d.ts +80 -0
  87. package/dist/IncidentAction.d.ts.map +1 -0
  88. package/dist/IncidentAction.js +158 -0
  89. package/dist/IncidentAction.js.map +1 -0
  90. package/dist/Internal.d.ts +7 -0
  91. package/dist/Internal.d.ts.map +1 -0
  92. package/dist/Internal.js +12 -0
  93. package/dist/Internal.js.map +1 -0
  94. package/dist/Jwt.d.ts +281 -0
  95. package/dist/Jwt.d.ts.map +1 -0
  96. package/dist/Jwt.js +721 -0
  97. package/dist/Jwt.js.map +1 -0
  98. package/dist/LoginApproval.d.ts +314 -0
  99. package/dist/LoginApproval.d.ts.map +1 -0
  100. package/dist/LoginApproval.js +551 -0
  101. package/dist/LoginApproval.js.map +1 -0
  102. package/dist/LoginNotification.d.ts +183 -0
  103. package/dist/LoginNotification.d.ts.map +1 -0
  104. package/dist/LoginNotification.js +329 -0
  105. package/dist/LoginNotification.js.map +1 -0
  106. package/dist/LoginRisk.d.ts +344 -0
  107. package/dist/LoginRisk.d.ts.map +1 -0
  108. package/dist/LoginRisk.js +484 -0
  109. package/dist/LoginRisk.js.map +1 -0
  110. package/dist/MachineAuth.d.ts +73 -0
  111. package/dist/MachineAuth.d.ts.map +1 -0
  112. package/dist/MachineAuth.js +147 -0
  113. package/dist/MachineAuth.js.map +1 -0
  114. package/dist/MagicLink.d.ts +85 -0
  115. package/dist/MagicLink.d.ts.map +1 -0
  116. package/dist/MagicLink.js +206 -0
  117. package/dist/MagicLink.js.map +1 -0
  118. package/dist/Mailer.d.ts +147 -0
  119. package/dist/Mailer.d.ts.map +1 -0
  120. package/dist/Mailer.js +208 -0
  121. package/dist/Mailer.js.map +1 -0
  122. package/dist/OAuth.d.ts +1890 -0
  123. package/dist/OAuth.d.ts.map +1 -0
  124. package/dist/OAuth.js +3063 -0
  125. package/dist/OAuth.js.map +1 -0
  126. package/dist/Passkey.d.ts +334 -0
  127. package/dist/Passkey.d.ts.map +1 -0
  128. package/dist/Passkey.js +422 -0
  129. package/dist/Passkey.js.map +1 -0
  130. package/dist/PasskeySimpleWebAuthn.d.ts +11 -0
  131. package/dist/PasskeySimpleWebAuthn.d.ts.map +1 -0
  132. package/dist/PasskeySimpleWebAuthn.js +181 -0
  133. package/dist/PasskeySimpleWebAuthn.js.map +1 -0
  134. package/dist/Password.d.ts +237 -0
  135. package/dist/Password.d.ts.map +1 -0
  136. package/dist/Password.js +641 -0
  137. package/dist/Password.js.map +1 -0
  138. package/dist/Policy.d.ts +7 -4
  139. package/dist/Policy.d.ts.map +1 -1
  140. package/dist/Policy.js +28 -5
  141. package/dist/Policy.js.map +1 -1
  142. package/dist/Privacy.d.ts +15 -0
  143. package/dist/Privacy.d.ts.map +1 -1
  144. package/dist/Privacy.js +58 -1
  145. package/dist/Privacy.js.map +1 -1
  146. package/dist/RateLimiter.d.ts +104 -0
  147. package/dist/RateLimiter.d.ts.map +1 -0
  148. package/dist/RateLimiter.js +118 -0
  149. package/dist/RateLimiter.js.map +1 -0
  150. package/dist/RecoveryCode.d.ts +169 -0
  151. package/dist/RecoveryCode.d.ts.map +1 -0
  152. package/dist/RecoveryCode.js +299 -0
  153. package/dist/RecoveryCode.js.map +1 -0
  154. package/dist/RefreshToken.d.ts +222 -0
  155. package/dist/RefreshToken.d.ts.map +1 -0
  156. package/dist/RefreshToken.js +342 -0
  157. package/dist/RefreshToken.js.map +1 -0
  158. package/dist/Retention.d.ts +98 -0
  159. package/dist/Retention.d.ts.map +1 -0
  160. package/dist/Retention.js +204 -0
  161. package/dist/Retention.js.map +1 -0
  162. package/dist/SecurityTimeline.d.ts +78 -0
  163. package/dist/SecurityTimeline.d.ts.map +1 -0
  164. package/dist/SecurityTimeline.js +461 -0
  165. package/dist/SecurityTimeline.js.map +1 -0
  166. package/dist/Sessions.d.ts +123 -11
  167. package/dist/Sessions.d.ts.map +1 -1
  168. package/dist/Sessions.js +534 -1
  169. package/dist/Sessions.js.map +1 -1
  170. package/dist/StepUp.d.ts +44 -0
  171. package/dist/StepUp.d.ts.map +1 -0
  172. package/dist/StepUp.js +82 -0
  173. package/dist/StepUp.js.map +1 -0
  174. package/dist/Storage.d.ts +73 -5
  175. package/dist/Storage.d.ts.map +1 -1
  176. package/dist/Storage.js +11 -1
  177. package/dist/Storage.js.map +1 -1
  178. package/dist/StorageMigrations.d.ts +23 -1
  179. package/dist/StorageMigrations.d.ts.map +1 -1
  180. package/dist/StorageMigrations.js +462 -2
  181. package/dist/StorageMigrations.js.map +1 -1
  182. package/dist/Testing.d.ts +9 -1
  183. package/dist/Testing.d.ts.map +1 -1
  184. package/dist/Testing.js +30 -2
  185. package/dist/Testing.js.map +1 -1
  186. package/dist/Totp.d.ts +220 -0
  187. package/dist/Totp.d.ts.map +1 -0
  188. package/dist/Totp.js +477 -0
  189. package/dist/Totp.js.map +1 -0
  190. package/dist/TrustedDevice.d.ts +127 -0
  191. package/dist/TrustedDevice.d.ts.map +1 -0
  192. package/dist/TrustedDevice.js +252 -0
  193. package/dist/TrustedDevice.js.map +1 -0
  194. package/dist/WaitUntil.d.ts.map +1 -1
  195. package/dist/WaitUntil.js +1 -1
  196. package/dist/WaitUntil.js.map +1 -1
  197. package/dist/Webhook.d.ts +380 -0
  198. package/dist/Webhook.d.ts.map +1 -0
  199. package/dist/Webhook.js +592 -0
  200. package/dist/Webhook.js.map +1 -0
  201. package/dist/alchemy/cloudflare/Email.d.ts +25 -0
  202. package/dist/alchemy/cloudflare/Email.d.ts.map +1 -0
  203. package/dist/alchemy/cloudflare/Email.js +117 -0
  204. package/dist/alchemy/cloudflare/Email.js.map +1 -0
  205. package/dist/alchemy/cloudflare/RateLimitDurableObject.d.ts +34 -0
  206. package/dist/alchemy/cloudflare/RateLimitDurableObject.d.ts.map +1 -0
  207. package/dist/alchemy/cloudflare/RateLimitDurableObject.js +30 -0
  208. package/dist/alchemy/cloudflare/RateLimitDurableObject.js.map +1 -0
  209. package/dist/cloudflare/Email.d.ts +25 -0
  210. package/dist/cloudflare/Email.d.ts.map +1 -0
  211. package/dist/cloudflare/Email.js +153 -0
  212. package/dist/cloudflare/Email.js.map +1 -0
  213. package/dist/cloudflare/RateLimitDurableObject.d.ts +50 -0
  214. package/dist/cloudflare/RateLimitDurableObject.d.ts.map +1 -0
  215. package/dist/cloudflare/RateLimitDurableObject.js +51 -0
  216. package/dist/cloudflare/RateLimitDurableObject.js.map +1 -0
  217. package/dist/index.d.ts +25 -0
  218. package/dist/index.d.ts.map +1 -1
  219. package/dist/index.js +25 -0
  220. package/dist/index.js.map +1 -1
  221. package/dist/internal/RateLimitDurableObject.d.ts +32 -0
  222. package/dist/internal/RateLimitDurableObject.d.ts.map +1 -0
  223. package/dist/internal/RateLimitDurableObject.js +80 -0
  224. package/dist/internal/RateLimitDurableObject.js.map +1 -0
  225. package/migrations/0002_auth_password.sql +25 -0
  226. package/migrations/0003_auth_login_approval_review.sql +22 -0
  227. package/migrations/0004_auth_trusted_device.sql +12 -0
  228. package/migrations/0005_auth_passkey.sql +17 -0
  229. package/migrations/0006_auth_totp_factor.sql +17 -0
  230. package/migrations/0007_auth_recovery_code.sql +13 -0
  231. package/migrations/0008_auth_api_key.sql +17 -0
  232. package/migrations/0009_auth_refresh_token.sql +21 -0
  233. package/migrations/0010_auth_jwt_revocation.sql +8 -0
  234. package/migrations/0011_auth_oauth_account.sql +16 -0
  235. package/migrations/0012_auth_oauth_provider_token_vault.sql +20 -0
  236. package/migrations/0013_auth_security_timeline.sql +16 -0
  237. package/migrations/0014_auth_webhook_outbox.sql +16 -0
  238. package/migrations/0015_auth_webhook_replay.sql +7 -0
  239. package/migrations/0016_auth_login_risk_history.sql +23 -0
  240. package/migrations/0017_auth_audit_log.sql +17 -0
  241. package/migrations/0018_auth_domain_verification.sql +18 -0
  242. package/migrations/0019_auth_oauth_authorization_code.sql +17 -0
  243. package/migrations/0020_auth_oauth_provider_mode_token.sql +24 -0
  244. package/migrations/0021_auth_oauth_client_secret.sql +14 -0
  245. package/migrations/0022_auth_oauth_client.sql +15 -0
  246. package/migrations/0023_auth_oauth_consent.sql +15 -0
  247. package/package.json +162 -26
  248. package/dist/D1Kysely.d.ts +0 -40
  249. package/dist/D1Kysely.d.ts.map +0 -1
  250. package/dist/D1Kysely.js +0 -75
  251. package/dist/D1Kysely.js.map +0 -1
  252. package/dist/KyselyStorage.d.ts +0 -41
  253. package/dist/KyselyStorage.d.ts.map +0 -1
  254. package/dist/KyselyStorage.js +0 -176
  255. package/dist/KyselyStorage.js.map +0 -1
@@ -0,0 +1,158 @@
1
+ import { Context, Data, Effect, Layer } from "effect";
2
+ import { ApiKeyManagement, } from "./ApiKey.js";
3
+ import { RefreshTokenManagement, } from "./RefreshToken.js";
4
+ import { currentUnixMillis } from "./Internal.js";
5
+ import { Sessions, } from "./Sessions.js";
6
+ import { TrustedDeviceStore, } from "./TrustedDevice.js";
7
+ export class IncidentActionError extends Data.TaggedError("IncidentActionError") {
8
+ }
9
+ export class IncidentAction extends Context.Service()("auth/IncidentAction") {
10
+ }
11
+ (function (IncidentAction) {
12
+ IncidentAction.make = (service) => IncidentAction.of(service);
13
+ })(IncidentAction || (IncidentAction = {}));
14
+ const incidentActionError = (operation, message, cause) => new IncidentActionError({
15
+ operation,
16
+ message,
17
+ ...(cause === undefined ? {} : { cause }),
18
+ });
19
+ const requireDependency = (dependency, operation, name) => dependency === undefined
20
+ ? Effect.fail(incidentActionError(operation, `${name} dependency is not available`))
21
+ : Effect.succeed(dependency);
22
+ const actionNow = (input) => input.now === undefined ? currentUnixMillis : Effect.succeed(input.now);
23
+ const resultBase = (input) => ({
24
+ userId: input.userId,
25
+ ...(input.reason === undefined ? {} : { reason: input.reason }),
26
+ });
27
+ const unique = (items) => [...new Set(items)];
28
+ export const makeIncidentAction = (dependencies) => {
29
+ const revokeSessionsSummary = Effect.fn("auth.incident_action.revoke_sessions")(function* (input) {
30
+ const sessions = yield* requireDependency(dependencies.sessions, "revoke_sessions", "Sessions");
31
+ const activeSessions = yield* sessions.listForUser({ userId: input.userId }).pipe(Effect.mapError((cause) => incidentActionError("revoke_sessions", "Failed to list user sessions before incident action", cause)));
32
+ yield* sessions.revokeAllForUser(input.userId).pipe(Effect.mapError((cause) => incidentActionError("revoke_sessions", "Failed to revoke user sessions", cause)));
33
+ return {
34
+ revokedAll: true,
35
+ activeBefore: activeSessions.length,
36
+ sessionIds: activeSessions.map((session) => session.sessionId),
37
+ };
38
+ });
39
+ const revokeTrustedDevicesSummary = Effect.fn("auth.incident_action.revoke_trusted_devices")(function* (input) {
40
+ const trustedDevices = yield* requireDependency(dependencies.trustedDevices, "revoke_trusted_devices", "TrustedDeviceStore");
41
+ const now = yield* actionNow(input);
42
+ const devices = yield* trustedDevices
43
+ .listForUser({ userId: input.userId, now })
44
+ .pipe(Effect.mapError((cause) => incidentActionError("revoke_trusted_devices", "Failed to list trusted devices before incident action", cause)));
45
+ yield* Effect.forEach(devices, (device) => trustedDevices
46
+ .revokeForUser({ userId: input.userId, tokenHash: device.tokenHash })
47
+ .pipe(Effect.mapError((cause) => incidentActionError("revoke_trusted_devices", "Failed to revoke trusted device", cause))), { discard: true });
48
+ return {
49
+ revoked: devices.length,
50
+ deviceIds: devices.map((device) => device.tokenHash),
51
+ };
52
+ });
53
+ const revokeApiKeysSummary = Effect.fn("auth.incident_action.revoke_api_keys")(function* (input) {
54
+ const apiKeys = yield* requireDependency(dependencies.apiKeys, "revoke_api_keys", "ApiKeyManagement");
55
+ const now = yield* actionNow(input);
56
+ const keys = yield* apiKeys
57
+ .listForUser({ userId: input.userId, includeRevoked: false })
58
+ .pipe(Effect.mapError((cause) => incidentActionError("revoke_api_keys", "Failed to list API keys before incident action", cause)));
59
+ yield* Effect.forEach(keys, (key) => apiKeys
60
+ .revokeForUser({
61
+ userId: input.userId,
62
+ keyId: key.id,
63
+ revokedAt: now,
64
+ reason: input.reason,
65
+ })
66
+ .pipe(Effect.mapError((cause) => incidentActionError("revoke_api_keys", "Failed to revoke API key", cause))), { discard: true });
67
+ return {
68
+ revoked: keys.length,
69
+ keyIds: keys.map((key) => key.id),
70
+ };
71
+ });
72
+ const revokeRefreshTokensSummary = Effect.fn("auth.incident_action.revoke_refresh_tokens")(function* (input) {
73
+ const refreshTokens = yield* requireDependency(dependencies.refreshTokens, "revoke_refresh_tokens", "RefreshTokenManagement");
74
+ const now = yield* actionNow(input);
75
+ const tokens = yield* refreshTokens
76
+ .listForUser({ userId: input.userId, includeRevoked: false })
77
+ .pipe(Effect.mapError((cause) => incidentActionError("revoke_refresh_tokens", "Failed to list refresh tokens before incident action", cause)));
78
+ const familyIds = unique(tokens.map((token) => token.familyId));
79
+ yield* Effect.forEach(familyIds, (familyId) => refreshTokens
80
+ .revokeFamilyForUser({
81
+ userId: input.userId,
82
+ familyId,
83
+ revokedAt: now,
84
+ reason: input.reason,
85
+ })
86
+ .pipe(Effect.mapError((cause) => incidentActionError("revoke_refresh_tokens", "Failed to revoke refresh token family", cause))), { discard: true });
87
+ return {
88
+ revokedFamilies: familyIds.length,
89
+ activeBefore: tokens.length,
90
+ tokenIds: tokens.map((token) => token.id),
91
+ familyIds,
92
+ };
93
+ });
94
+ return IncidentAction.make({
95
+ revokeUserSessions: Effect.fn("auth.incident_action.result.revoke_sessions")(function* (input) {
96
+ const sessions = yield* revokeSessionsSummary(input);
97
+ return { ...resultBase(input), sessions };
98
+ }),
99
+ revokeTrustedDevices: Effect.fn("auth.incident_action.result.revoke_trusted_devices")(function* (input) {
100
+ const trustedDevices = yield* revokeTrustedDevicesSummary(input);
101
+ return {
102
+ ...resultBase(input),
103
+ trustedDevices,
104
+ };
105
+ }),
106
+ revokeApiKeys: Effect.fn("auth.incident_action.result.revoke_api_keys")(function* (input) {
107
+ const apiKeys = yield* revokeApiKeysSummary(input);
108
+ return { ...resultBase(input), apiKeys };
109
+ }),
110
+ revokeRefreshTokens: Effect.fn("auth.incident_action.result.revoke_refresh_tokens")(function* (input) {
111
+ const refreshTokens = yield* revokeRefreshTokensSummary(input);
112
+ return { ...resultBase(input), refreshTokens };
113
+ }),
114
+ containUser: Effect.fn("auth.incident_action.contain_user")(function* (input) {
115
+ const { actions } = input;
116
+ if (actions.revokeSessions !== true &&
117
+ actions.revokeTrustedDevices !== true &&
118
+ actions.revokeApiKeys !== true &&
119
+ actions.revokeRefreshTokens !== true) {
120
+ return yield* Effect.fail(incidentActionError("contain_user", "No incident actions selected"));
121
+ }
122
+ const sessions = actions.revokeSessions === true
123
+ ? yield* revokeSessionsSummary(input)
124
+ : undefined;
125
+ const trustedDevices = actions.revokeTrustedDevices === true
126
+ ? yield* revokeTrustedDevicesSummary(input)
127
+ : undefined;
128
+ const apiKeys = actions.revokeApiKeys === true ? yield* revokeApiKeysSummary(input) : undefined;
129
+ const refreshTokens = actions.revokeRefreshTokens === true
130
+ ? yield* revokeRefreshTokensSummary(input)
131
+ : undefined;
132
+ return {
133
+ ...resultBase(input),
134
+ ...(sessions === undefined ? {} : { sessions }),
135
+ ...(trustedDevices === undefined ? {} : { trustedDevices }),
136
+ ...(apiKeys === undefined ? {} : { apiKeys }),
137
+ ...(refreshTokens === undefined ? {} : { refreshTokens }),
138
+ };
139
+ }),
140
+ });
141
+ };
142
+ export const IncidentActionLive = Layer.effect(IncidentAction)(Effect.gen(function* () {
143
+ const sessions = yield* Effect.serviceOption(Sessions);
144
+ const trustedDevices = yield* Effect.serviceOption(TrustedDeviceStore);
145
+ const apiKeys = yield* Effect.serviceOption(ApiKeyManagement);
146
+ const refreshTokens = yield* Effect.serviceOption(RefreshTokenManagement);
147
+ return makeIncidentAction({
148
+ ...(sessions._tag === "Some" ? { sessions: sessions.value } : {}),
149
+ ...(trustedDevices._tag === "Some"
150
+ ? { trustedDevices: trustedDevices.value }
151
+ : {}),
152
+ ...(apiKeys._tag === "Some" ? { apiKeys: apiKeys.value } : {}),
153
+ ...(refreshTokens._tag === "Some"
154
+ ? { refreshTokens: refreshTokens.value }
155
+ : {}),
156
+ });
157
+ }));
158
+ //# sourceMappingURL=IncidentAction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IncidentAction.js","sourceRoot":"","sources":["../src/IncidentAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEtD,OAAO,EACL,gBAAgB,GAKjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,sBAAsB,GAMvB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EACL,QAAQ,GAIT,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,kBAAkB,GAInB,MAAM,oBAAoB,CAAC;AAS5B,MAAM,OAAO,mBAAoB,SAAQ,IAAI,CAAC,WAAW,CACvD,qBAAqB,CAKrB;CAAG;AAqEL,MAAM,OAAO,cAAe,SAAQ,OAAO,CAAC,OAAO,EAGhD,CAAC,qBAAqB,CAAC;CAAG;AAE7B,WAAiB,cAAc;IAChB,mBAAI,GAAG,CAAC,OAA8B,EAAyB,EAAE,CAC5E,cAAc,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;AAC/B,CAAC,EAHgB,cAAc,KAAd,cAAc,QAG9B;AASD,MAAM,mBAAmB,GAAG,CAC1B,SAAkC,EAClC,OAAe,EACf,KAAe,EACM,EAAE,CACvB,IAAI,mBAAmB,CAAC;IACtB,SAAS;IACT,OAAO;IACP,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;CAC1C,CAAC,CAAC;AAEL,MAAM,iBAAiB,GAAG,CACxB,UAAyB,EACzB,SAAkC,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AC,CAAC,CAAC,EAAE,CAAC;QACjE,GAAG,CAAC,cAAc,CAAC,IAAI,KAAK,MAAM;YAChC,CAAC,CAAC,EAAE,cAAc,EAAE,cAAc,CAAC,KAAK,EAAE;YAC1C,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,CAAC,OAAO,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9D,GAAG,CAAC,aAAa,CAAC,IAAI,KAAK,MAAM;YAC/B,CAAC,CAAC,EAAE,aAAa,EAAE,aAAa,CAAC,KAAK,EAAE;YACxC,CAAC,CAAC,EAAE,CAAC;KACR,CAAC,CAAC;AACL,CAAC,CAAC,CACH,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { Effect } from "effect";
2
+ import type { CryptoService } from "./Crypto.js";
3
+ import { UnixMillis } from "./Identifiers.js";
4
+ export declare const currentUnixMillis: Effect.Effect<UnixMillis>;
5
+ export declare const addMillis: (value: UnixMillis, millis: number) => UnixMillis;
6
+ export declare const timingSafeEqualString: (crypto: CryptoService, left: string, right: string) => Effect.Effect<boolean, import("./Crypto.js").CryptoError, never>;
7
+ //# sourceMappingURL=Internal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Internal.d.ts","sourceRoot":"","sources":["../src/Internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAI9C,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU,CAGvD,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,OAAO,UAAU,EAAE,QAAQ,MAAM,KAAG,UAC1B,CAAC;AAErC,eAAO,MAAM,qBAAqB,GAChC,QAAQ,aAAa,EACrB,MAAM,MAAM,EACZ,OAAO,MAAM,qEAOY,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { Clock, Effect } from "effect";
2
+ import { UnixMillis } from "./Identifiers.js";
3
+ const textEncoder = new TextEncoder();
4
+ export const currentUnixMillis = Effect.map(Clock.currentTimeMillis, UnixMillis);
5
+ export const addMillis = (value, millis) => UnixMillis(Number(value) + millis);
6
+ export const timingSafeEqualString = (crypto, left, right) => left.length === right.length
7
+ ? crypto.timingSafeEqual({
8
+ left: textEncoder.encode(left),
9
+ right: textEncoder.encode(right),
10
+ })
11
+ : Effect.succeed(false);
12
+ //# sourceMappingURL=Internal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Internal.js","sourceRoot":"","sources":["../src/Internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGvC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;AAEtC,MAAM,CAAC,MAAM,iBAAiB,GAA8B,MAAM,CAAC,GAAG,CACpE,KAAK,CAAC,iBAAiB,EACvB,UAAU,CACX,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAiB,EAAE,MAAc,EAAc,EAAE,CACzE,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,CAAC;AAErC,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,MAAqB,EACrB,IAAY,EACZ,KAAa,EACb,EAAE,CACF,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;IAC1B,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC;QACrB,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC;QAC9B,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC;KACjC,CAAC;IACJ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
package/dist/Jwt.d.ts ADDED
@@ -0,0 +1,281 @@
1
+ import { Brand, Context, Duration, Effect, Layer, Redacted } from "effect";
2
+ import type * as OptionTypes from "effect/Option";
3
+ import { Crypto } from "./Crypto.js";
4
+ import type { CryptoKey, CryptoService } from "./Crypto.js";
5
+ import { UnixMillis } from "./Identifiers.js";
6
+ export type JwtKeyId = Brand.Branded<string, "auth/JwtKeyId">;
7
+ export declare const JwtKeyId: Brand.Constructor<JwtKeyId>;
8
+ export type JwtToken = Brand.Branded<string, "auth/JwtToken">;
9
+ export declare const JwtToken: Brand.Constructor<JwtToken>;
10
+ export declare const JwtAlgorithms: readonly ["HS256", "RS256", "ES256", "EdDSA"];
11
+ export type JwtAlgorithm = (typeof JwtAlgorithms)[number];
12
+ export type JwtKeyStatus = "active" | "retired" | "disabled";
13
+ export type JwtAudience = string | readonly string[];
14
+ export interface JwtClaims extends Readonly<Record<string, unknown>> {
15
+ readonly iss?: string;
16
+ readonly sub?: string;
17
+ readonly aud?: JwtAudience;
18
+ readonly exp?: number;
19
+ readonly nbf?: number;
20
+ readonly iat?: number;
21
+ readonly jti?: string;
22
+ }
23
+ export interface JwtHeader extends Readonly<Record<string, unknown>> {
24
+ readonly typ: "JWT";
25
+ readonly alg: JwtAlgorithm;
26
+ readonly kid: JwtKeyId;
27
+ }
28
+ export interface JwtPublicJwk extends Readonly<Record<string, unknown>> {
29
+ readonly kty: string;
30
+ readonly kid?: string;
31
+ readonly use?: string;
32
+ readonly key_ops?: readonly string[];
33
+ readonly alg?: string;
34
+ }
35
+ export interface JwtPrivateJwk extends JwtPublicJwk {
36
+ }
37
+ export interface JwksDocument {
38
+ readonly keys: readonly JwtPublicJwk[];
39
+ }
40
+ export interface JwtKeyRecord {
41
+ readonly id: JwtKeyId;
42
+ readonly alg: JwtAlgorithm;
43
+ readonly status: JwtKeyStatus;
44
+ readonly secret?: CryptoKey;
45
+ readonly publicJwk?: JwtPublicJwk;
46
+ readonly privateJwk?: JwtPrivateJwk;
47
+ readonly createdAt?: UnixMillis;
48
+ readonly expiresAt?: UnixMillis;
49
+ readonly metadata?: Readonly<Record<string, unknown>>;
50
+ }
51
+ export interface JwtKeyInfo {
52
+ readonly id: JwtKeyId;
53
+ readonly alg: JwtAlgorithm;
54
+ readonly status: JwtKeyStatus;
55
+ readonly createdAt?: UnixMillis;
56
+ readonly expiresAt?: UnixMillis;
57
+ readonly metadata?: Readonly<Record<string, unknown>>;
58
+ }
59
+ export interface JwtSelectSigningKeyInput {
60
+ readonly alg?: JwtAlgorithm;
61
+ readonly now?: UnixMillis;
62
+ }
63
+ export interface JwtFindVerificationKeyInput extends JwtSelectSigningKeyInput {
64
+ readonly kid: JwtKeyId;
65
+ }
66
+ export interface JwtListPublicJwksInput {
67
+ readonly now?: UnixMillis;
68
+ }
69
+ export type JwtOperation = "issue" | "verify" | "keys" | "jwks" | "revocation" | "signature";
70
+ declare const JwtError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
71
+ readonly _tag: "JwtError";
72
+ } & Readonly<A>;
73
+ export declare class JwtError extends JwtError_base<{
74
+ readonly operation: JwtOperation;
75
+ readonly message: string;
76
+ readonly cause?: unknown;
77
+ }> {
78
+ }
79
+ export interface JwtKeysService {
80
+ readonly selectSigningKey: (input?: JwtSelectSigningKeyInput) => Effect.Effect<OptionTypes.Option<JwtKeyRecord>, JwtError>;
81
+ readonly findVerificationKey: (input: JwtFindVerificationKeyInput) => Effect.Effect<OptionTypes.Option<JwtKeyRecord>, JwtError>;
82
+ readonly listPublicJwks: (input?: JwtListPublicJwksInput) => Effect.Effect<readonly JwtPublicJwk[], JwtError>;
83
+ }
84
+ declare const JwtKeys_base: Context.ServiceClass<JwtKeys, "auth/JwtKeys", JwtKeysService>;
85
+ export declare class JwtKeys extends JwtKeys_base {
86
+ }
87
+ export declare namespace JwtKeys {
88
+ const make: (service: JwtKeysService) => JwtKeysService;
89
+ }
90
+ export interface JwtIssueInput {
91
+ readonly alg?: JwtAlgorithm;
92
+ readonly issuer?: string;
93
+ readonly subject?: string;
94
+ readonly audience?: JwtAudience;
95
+ readonly expiresAt?: UnixMillis;
96
+ readonly expiresIn?: Duration.Duration;
97
+ readonly notBefore?: UnixMillis;
98
+ readonly issuedAt?: UnixMillis;
99
+ readonly jwtId?: string;
100
+ readonly claims?: Readonly<Record<string, unknown>>;
101
+ }
102
+ export interface IssuedJwt {
103
+ readonly token: Redacted.Redacted<JwtToken>;
104
+ readonly header: JwtHeader;
105
+ readonly claims: JwtClaims;
106
+ readonly key: JwtKeyInfo;
107
+ }
108
+ export interface JwtIssuerService {
109
+ readonly issue: (input: JwtIssueInput) => Effect.Effect<IssuedJwt, JwtError>;
110
+ }
111
+ declare const JwtIssuer_base: Context.ServiceClass<JwtIssuer, "auth/JwtIssuer", JwtIssuerService>;
112
+ export declare class JwtIssuer extends JwtIssuer_base {
113
+ }
114
+ export declare namespace JwtIssuer {
115
+ const make: (service: JwtIssuerService) => JwtIssuerService;
116
+ }
117
+ export type JwtVerificationFailureReason = "malformed" | "unsupported_alg" | "unknown_key" | "invalid_signature" | "expired" | "not_yet_valid" | "issuer_mismatch" | "audience_mismatch";
118
+ export interface JwtVerifyInput {
119
+ readonly token: Redacted.Redacted<string>;
120
+ readonly issuer?: string;
121
+ readonly audience?: JwtAudience;
122
+ readonly now?: UnixMillis;
123
+ readonly clockTolerance?: Duration.Duration;
124
+ }
125
+ export type JwtVerificationResult = {
126
+ readonly valid: true;
127
+ readonly header: JwtHeader;
128
+ readonly claims: JwtClaims;
129
+ readonly key: JwtKeyInfo;
130
+ } | {
131
+ readonly valid: false;
132
+ readonly reason: JwtVerificationFailureReason;
133
+ };
134
+ export interface JwtVerifierService {
135
+ readonly verify: (input: JwtVerifyInput) => Effect.Effect<JwtVerificationResult, JwtError>;
136
+ }
137
+ declare const JwtVerifier_base: Context.ServiceClass<JwtVerifier, "auth/JwtVerifier", JwtVerifierService>;
138
+ export declare class JwtVerifier extends JwtVerifier_base {
139
+ }
140
+ export declare namespace JwtVerifier {
141
+ const make: (service: JwtVerifierService) => JwtVerifierService;
142
+ }
143
+ export interface JwtSignatureKeyInput {
144
+ readonly alg: JwtAlgorithm;
145
+ readonly key: JwtKeyRecord;
146
+ }
147
+ export interface JwtSignatureSignInput extends JwtSignatureKeyInput {
148
+ readonly signingInput: string;
149
+ }
150
+ export interface JwtSignatureVerifyInput extends JwtSignatureSignInput {
151
+ readonly signature: string;
152
+ }
153
+ export interface JwtSignatureService {
154
+ readonly supports: (alg: JwtAlgorithm) => boolean;
155
+ readonly canSign: (input: JwtSignatureKeyInput) => boolean;
156
+ readonly canVerify: (input: JwtSignatureKeyInput) => boolean;
157
+ readonly sign: (input: JwtSignatureSignInput) => Effect.Effect<string, JwtError>;
158
+ readonly verify: (input: JwtSignatureVerifyInput) => Effect.Effect<boolean, JwtError>;
159
+ }
160
+ declare const JwtSignature_base: Context.ServiceClass<JwtSignature, "auth/JwtSignature", JwtSignatureService>;
161
+ export declare class JwtSignature extends JwtSignature_base {
162
+ }
163
+ export declare namespace JwtSignature {
164
+ const make: (service: JwtSignatureService) => JwtSignatureService;
165
+ }
166
+ export interface JwksService {
167
+ readonly document: (input?: JwtListPublicJwksInput) => Effect.Effect<JwksDocument, JwtError>;
168
+ }
169
+ declare const Jwks_base: Context.ServiceClass<Jwks, "auth/Jwks", JwksService>;
170
+ export declare class Jwks extends Jwks_base {
171
+ }
172
+ export declare namespace Jwks {
173
+ const make: (service: JwksService) => JwksService;
174
+ }
175
+ export interface JwtRevocationRecord {
176
+ readonly jwtId: string;
177
+ readonly revokedAt: UnixMillis;
178
+ readonly expiresAt?: UnixMillis;
179
+ readonly reason?: string;
180
+ }
181
+ export interface JwtRevocationStoreService {
182
+ readonly revoke: (record: JwtRevocationRecord) => Effect.Effect<void, JwtError>;
183
+ readonly find: (jwtId: string) => Effect.Effect<OptionTypes.Option<JwtRevocationRecord>, JwtError>;
184
+ }
185
+ declare const JwtRevocationStore_base: Context.ServiceClass<JwtRevocationStore, "auth/JwtRevocationStore", JwtRevocationStoreService>;
186
+ export declare class JwtRevocationStore extends JwtRevocationStore_base {
187
+ }
188
+ export declare namespace JwtRevocationStore {
189
+ const make: (service: JwtRevocationStoreService) => JwtRevocationStoreService;
190
+ }
191
+ export interface JwtRevokeJwtIdInput {
192
+ readonly jwtId: string;
193
+ readonly revokedAt?: UnixMillis;
194
+ readonly expiresAt?: UnixMillis;
195
+ readonly reason?: string;
196
+ }
197
+ export interface JwtIsRevokedInput {
198
+ readonly jwtId: string;
199
+ readonly now?: UnixMillis;
200
+ }
201
+ export type JwtIntrospectionInactiveReason = JwtVerificationFailureReason | "revoked";
202
+ export type JwtIntrospectionResult = {
203
+ readonly active: true;
204
+ readonly header: JwtHeader;
205
+ readonly claims: JwtClaims;
206
+ readonly key: JwtKeyInfo;
207
+ readonly jwtId?: string;
208
+ readonly expiresAt?: UnixMillis;
209
+ readonly revoked: false;
210
+ } | {
211
+ readonly active: false;
212
+ readonly reason: JwtIntrospectionInactiveReason;
213
+ readonly jwtId?: string;
214
+ readonly expiresAt?: UnixMillis;
215
+ readonly revokedAt?: UnixMillis;
216
+ readonly revokedReason?: string;
217
+ };
218
+ export interface JwtRevocationService {
219
+ readonly revokeJwtId: (input: JwtRevokeJwtIdInput) => Effect.Effect<JwtRevocationRecord, JwtError>;
220
+ readonly isRevoked: (input: JwtIsRevokedInput) => Effect.Effect<boolean, JwtError>;
221
+ readonly introspect: (input: JwtVerifyInput) => Effect.Effect<JwtIntrospectionResult, JwtError>;
222
+ }
223
+ declare const JwtRevocation_base: Context.ServiceClass<JwtRevocation, "auth/JwtRevocation", JwtRevocationService>;
224
+ export declare class JwtRevocation extends JwtRevocation_base {
225
+ }
226
+ export declare namespace JwtRevocation {
227
+ const make: (service: JwtRevocationService) => JwtRevocationService;
228
+ }
229
+ export type JwtServiceDependencies = {
230
+ readonly keys: JwtKeysService;
231
+ } & ({
232
+ readonly crypto: CryptoService;
233
+ readonly signature?: JwtSignatureService;
234
+ } | {
235
+ readonly crypto?: CryptoService;
236
+ readonly signature: JwtSignatureService;
237
+ });
238
+ export interface JwtSignatureDependencies {
239
+ readonly crypto: CryptoService;
240
+ }
241
+ export interface JwtWebCryptoRs256SignatureOptions {
242
+ readonly crypto?: typeof globalThis.crypto;
243
+ }
244
+ export interface JwtWebCryptoEs256SignatureOptions {
245
+ readonly crypto?: typeof globalThis.crypto;
246
+ }
247
+ export interface JwtWebCryptoEdDsaSignatureOptions {
248
+ readonly crypto?: typeof globalThis.crypto;
249
+ }
250
+ export interface JwtRevocationDependencies {
251
+ readonly verifier: JwtVerifierService;
252
+ readonly store: JwtRevocationStoreService;
253
+ }
254
+ export declare const makeJwtKeysMemory: (records: readonly JwtKeyRecord[]) => JwtKeysService;
255
+ export declare const JwtKeysMemoryLive: (records: readonly JwtKeyRecord[]) => Layer.Layer<JwtKeys, never, never>;
256
+ export declare const makeJwtRevocationStoreMemory: () => JwtRevocationStoreService;
257
+ export declare const JwtRevocationStoreMemoryLive: Layer.Layer<JwtRevocationStore, never, never>;
258
+ export declare const makeJwtRevocation: (dependencies: JwtRevocationDependencies) => JwtRevocationService;
259
+ export declare const makeJwtSignature: (dependencies: JwtSignatureDependencies) => JwtSignatureService;
260
+ export declare const makeJwtWebCryptoRs256Signature: (options?: JwtWebCryptoRs256SignatureOptions) => JwtSignatureService;
261
+ export declare const makeJwtWebCryptoEs256Signature: (options?: JwtWebCryptoEs256SignatureOptions) => JwtSignatureService;
262
+ export declare const makeJwtWebCryptoEdDsaSignature: (options?: JwtWebCryptoEdDsaSignatureOptions) => JwtSignatureService;
263
+ export declare const makeJwtIssuer: (dependencies: JwtServiceDependencies) => JwtIssuerService;
264
+ export declare const makeJwtVerifier: (dependencies: JwtServiceDependencies) => JwtVerifierService;
265
+ export declare const makeJwks: (dependencies: {
266
+ readonly keys: JwtKeysService;
267
+ }) => JwksService;
268
+ export declare const JwtSignatureLive: Layer.Layer<JwtSignature, never, Crypto>;
269
+ export declare const JwtWebCryptoRs256SignatureLive: (options?: JwtWebCryptoRs256SignatureOptions) => Layer.Layer<JwtSignature, never, never>;
270
+ export declare const JwtWebCryptoEs256SignatureLive: (options?: JwtWebCryptoEs256SignatureOptions) => Layer.Layer<JwtSignature, never, never>;
271
+ export declare const JwtWebCryptoEdDsaSignatureLive: (options?: JwtWebCryptoEdDsaSignatureOptions) => Layer.Layer<JwtSignature, never, never>;
272
+ export declare const JwtIssuerWithSignatureLive: Layer.Layer<JwtIssuer, never, JwtKeys | JwtSignature>;
273
+ export declare const JwtVerifierWithSignatureLive: Layer.Layer<JwtVerifier, never, JwtKeys | JwtSignature>;
274
+ export declare const JwtIssuerLive: Layer.Layer<JwtIssuer, never, Crypto | JwtKeys>;
275
+ export declare const JwtVerifierLive: Layer.Layer<JwtVerifier, never, Crypto | JwtKeys>;
276
+ export declare const JwksLive: Layer.Layer<Jwks, never, JwtKeys>;
277
+ export declare const JwtRevocationLive: Layer.Layer<JwtRevocation, never, JwtVerifier | JwtRevocationStore>;
278
+ export declare const JwtWithSignatureLive: Layer.Layer<JwtIssuer | JwtVerifier | Jwks, never, JwtKeys | JwtSignature>;
279
+ export declare const JwtLive: Layer.Layer<JwtIssuer | JwtVerifier | Jwks, never, Crypto | JwtKeys>;
280
+ export {};
281
+ //# sourceMappingURL=Jwt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Jwt.d.ts","sourceRoot":"","sources":["../src/Jwt.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,OAAO,EAEP,QAAQ,EACR,MAAM,EAEN,KAAK,EAEL,QAAQ,EAET,MAAM,QAAQ,CAAC;AAChB,OAAO,KAAK,KAAK,WAAW,MAAM,eAAe,CAAC;AAElD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,KAAK,EAAE,SAAS,EAAE,aA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