@effect-auth/core 0.1.0-alpha.10 → 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 (93) hide show
  1. package/README.md +65 -4
  2. package/dist/AuditLog.d.ts +60 -0
  3. package/dist/AuditLog.d.ts.map +1 -1
  4. package/dist/AuditLog.js +105 -0
  5. package/dist/AuditLog.js.map +1 -1
  6. package/dist/AuthKernel.d.ts +1 -1
  7. package/dist/Client.d.ts +72 -1
  8. package/dist/Client.d.ts.map +1 -1
  9. package/dist/Client.js +218 -1
  10. package/dist/Client.js.map +1 -1
  11. package/dist/DomainVerification.d.ts +200 -0
  12. package/dist/DomainVerification.d.ts.map +1 -0
  13. package/dist/DomainVerification.js +304 -0
  14. package/dist/DomainVerification.js.map +1 -0
  15. package/dist/EffectQbSqliteStorage.d.ts +389 -4
  16. package/dist/EffectQbSqliteStorage.d.ts.map +1 -1
  17. package/dist/EffectQbSqliteStorage.js +1191 -4
  18. package/dist/EffectQbSqliteStorage.js.map +1 -1
  19. package/dist/EmailOtp.d.ts +2 -2
  20. package/dist/HttpApi/Api.d.ts +477 -23
  21. package/dist/HttpApi/Api.d.ts.map +1 -1
  22. package/dist/HttpApi/Api.js +705 -4
  23. package/dist/HttpApi/Api.js.map +1 -1
  24. package/dist/HttpApi/Endpoints.d.ts +133 -5
  25. package/dist/HttpApi/Endpoints.d.ts.map +1 -1
  26. package/dist/HttpApi/Endpoints.js +57 -2
  27. package/dist/HttpApi/Endpoints.js.map +1 -1
  28. package/dist/HttpApi/Errors.d.ts +32 -0
  29. package/dist/HttpApi/Errors.d.ts.map +1 -1
  30. package/dist/HttpApi/Errors.js +46 -0
  31. package/dist/HttpApi/Errors.js.map +1 -1
  32. package/dist/HttpApi/Schemas.d.ts +149 -8
  33. package/dist/HttpApi/Schemas.d.ts.map +1 -1
  34. package/dist/HttpApi/Schemas.js +128 -0
  35. package/dist/HttpApi/Schemas.js.map +1 -1
  36. package/dist/Identifiers.d.ts +3 -0
  37. package/dist/Identifiers.d.ts.map +1 -1
  38. package/dist/Identifiers.js +2 -0
  39. package/dist/Identifiers.js.map +1 -1
  40. package/dist/IncidentAction.d.ts +80 -0
  41. package/dist/IncidentAction.d.ts.map +1 -0
  42. package/dist/IncidentAction.js +158 -0
  43. package/dist/IncidentAction.js.map +1 -0
  44. package/dist/Jwt.d.ts +10 -0
  45. package/dist/Jwt.d.ts.map +1 -1
  46. package/dist/Jwt.js +209 -0
  47. package/dist/Jwt.js.map +1 -1
  48. package/dist/LoginNotification.d.ts +1 -1
  49. package/dist/LoginRisk.d.ts +272 -1
  50. package/dist/LoginRisk.d.ts.map +1 -1
  51. package/dist/LoginRisk.js +427 -0
  52. package/dist/LoginRisk.js.map +1 -1
  53. package/dist/MachineAuth.d.ts +73 -0
  54. package/dist/MachineAuth.d.ts.map +1 -0
  55. package/dist/MachineAuth.js +147 -0
  56. package/dist/MachineAuth.js.map +1 -0
  57. package/dist/MagicLink.d.ts +2 -2
  58. package/dist/OAuth.d.ts +957 -1
  59. package/dist/OAuth.d.ts.map +1 -1
  60. package/dist/OAuth.js +1403 -1
  61. package/dist/OAuth.js.map +1 -1
  62. package/dist/Password.d.ts +2 -2
  63. package/dist/Retention.d.ts +98 -0
  64. package/dist/Retention.d.ts.map +1 -0
  65. package/dist/Retention.js +204 -0
  66. package/dist/Retention.js.map +1 -0
  67. package/dist/SecurityTimeline.d.ts +8 -2
  68. package/dist/SecurityTimeline.d.ts.map +1 -1
  69. package/dist/SecurityTimeline.js +75 -0
  70. package/dist/SecurityTimeline.js.map +1 -1
  71. package/dist/StorageMigrations.d.ts +11 -1
  72. package/dist/StorageMigrations.d.ts.map +1 -1
  73. package/dist/StorageMigrations.js +206 -0
  74. package/dist/StorageMigrations.js.map +1 -1
  75. package/dist/Webhook.d.ts +310 -2
  76. package/dist/Webhook.d.ts.map +1 -1
  77. package/dist/Webhook.js +511 -1
  78. package/dist/Webhook.js.map +1 -1
  79. package/dist/index.d.ts +4 -0
  80. package/dist/index.d.ts.map +1 -1
  81. package/dist/index.js +4 -0
  82. package/dist/index.js.map +1 -1
  83. package/migrations/0014_auth_webhook_outbox.sql +16 -0
  84. package/migrations/0015_auth_webhook_replay.sql +7 -0
  85. package/migrations/0016_auth_login_risk_history.sql +23 -0
  86. package/migrations/0017_auth_audit_log.sql +17 -0
  87. package/migrations/0018_auth_domain_verification.sql +18 -0
  88. package/migrations/0019_auth_oauth_authorization_code.sql +17 -0
  89. package/migrations/0020_auth_oauth_provider_mode_token.sql +24 -0
  90. package/migrations/0021_auth_oauth_client_secret.sql +14 -0
  91. package/migrations/0022_auth_oauth_client.sql +15 -0
  92. package/migrations/0023_auth_oauth_consent.sql +15 -0
  93. package/package.json +17 -1
package/dist/index.js CHANGED
@@ -6,13 +6,16 @@ export * from "./AuthFlow.js";
6
6
  export * from "./AuthKernel.js";
7
7
  export * from "./Challenge.js";
8
8
  export * from "./Crypto.js";
9
+ export * from "./DomainVerification.js";
9
10
  export * from "./EmailOtp.js";
10
11
  export * from "./EmailVerification.js";
11
12
  export * from "./Identifiers.js";
13
+ export * from "./IncidentAction.js";
12
14
  export * from "./Jwt.js";
13
15
  export * from "./LoginApproval.js";
14
16
  export * from "./LoginNotification.js";
15
17
  export * from "./LoginRisk.js";
18
+ export * from "./MachineAuth.js";
16
19
  export * from "./Mailer.js";
17
20
  export * from "./MagicLink.js";
18
21
  export * from "./OAuth.js";
@@ -22,6 +25,7 @@ export * from "./Policy.js";
22
25
  export * from "./Privacy.js";
23
26
  export * from "./RecoveryCode.js";
24
27
  export * from "./RefreshToken.js";
28
+ export * from "./Retention.js";
25
29
  export * from "./Sessions.js";
26
30
  export * from "./SecurityTimeline.js";
27
31
  export * from "./Storage.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,mBAA4B,C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C;AACpC,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC"}
@@ -0,0 +1,16 @@
1
+ create table if not exists auth_webhook_outbox (
2
+ id text primary key,
3
+ endpoint_key text not null,
4
+ event text not null,
5
+ status text not null,
6
+ attempts integer not null,
7
+ next_attempt_at integer not null,
8
+ created_at integer not null,
9
+ updated_at integer not null,
10
+ delivered_at integer,
11
+ last_error text
12
+ );
13
+
14
+ create index if not exists auth_webhook_outbox_due_idx on auth_webhook_outbox (next_attempt_at, status);
15
+ create index if not exists auth_webhook_outbox_endpoint_due_idx on auth_webhook_outbox (endpoint_key, next_attempt_at);
16
+ create index if not exists auth_webhook_outbox_status_idx on auth_webhook_outbox (status);
@@ -0,0 +1,7 @@
1
+ create table if not exists auth_webhook_replay (
2
+ id text primary key,
3
+ expires_at integer not null,
4
+ created_at integer not null
5
+ );
6
+
7
+ create index if not exists auth_webhook_replay_expires_at_idx on auth_webhook_replay (expires_at);
@@ -0,0 +1,23 @@
1
+ create table if not exists auth_login_risk_history (
2
+ id text primary key,
3
+ user_id text not null,
4
+ occurred_at integer not null,
5
+ outcome text not null,
6
+ method text not null,
7
+ amr text not null,
8
+ aal text not null,
9
+ device_status text not null,
10
+ device_key text,
11
+ location_key text,
12
+ country text,
13
+ region text,
14
+ latitude_micro integer,
15
+ longitude_micro integer,
16
+ risk_level text,
17
+ created_at integer not null
18
+ );
19
+
20
+ create index if not exists auth_login_risk_history_user_occurred_at_idx on auth_login_risk_history (user_id, occurred_at);
21
+ create index if not exists auth_login_risk_history_user_device_key_idx on auth_login_risk_history (user_id, device_key);
22
+ create index if not exists auth_login_risk_history_user_location_key_idx on auth_login_risk_history (user_id, location_key);
23
+ create index if not exists auth_login_risk_history_occurred_at_idx on auth_login_risk_history (occurred_at);
@@ -0,0 +1,17 @@
1
+ create table if not exists auth_audit_log (
2
+ id text,
3
+ type text not null,
4
+ user_id text,
5
+ actor_user_id text,
6
+ occurred_at integer not null,
7
+ request_ip_hash text,
8
+ request_user_agent_hash text,
9
+ event text not null,
10
+ created_at integer not null
11
+ );
12
+
13
+ create index if not exists auth_audit_log_id_idx on auth_audit_log (id);
14
+ create index if not exists auth_audit_log_user_occurred_at_idx on auth_audit_log (user_id, occurred_at);
15
+ create index if not exists auth_audit_log_actor_user_occurred_at_idx on auth_audit_log (actor_user_id, occurred_at);
16
+ create index if not exists auth_audit_log_type_occurred_at_idx on auth_audit_log (type, occurred_at);
17
+ create index if not exists auth_audit_log_occurred_at_idx on auth_audit_log (occurred_at);
@@ -0,0 +1,18 @@
1
+ create table if not exists auth_domain_verification (
2
+ id text primary key,
3
+ owner_id text not null,
4
+ domain text not null,
5
+ proof_method text not null,
6
+ proof_token text not null,
7
+ status text not null,
8
+ created_at integer not null,
9
+ expires_at integer not null,
10
+ verified_at integer,
11
+ revoked_at integer,
12
+ last_checked_at integer,
13
+ metadata text
14
+ );
15
+
16
+ create unique index if not exists auth_domain_verification_owner_domain_idx on auth_domain_verification (owner_id, domain);
17
+ create index if not exists auth_domain_verification_domain_idx on auth_domain_verification (domain);
18
+ create index if not exists auth_domain_verification_status_expires_at_idx on auth_domain_verification (status, expires_at);
@@ -0,0 +1,17 @@
1
+ create table if not exists auth_oauth_authorization_code (
2
+ code_hash text primary key,
3
+ client_id text not null,
4
+ subject text not null,
5
+ redirect_uri text not null,
6
+ scopes text not null,
7
+ code_challenge text,
8
+ code_challenge_method text,
9
+ issued_at integer not null,
10
+ expires_at integer not null,
11
+ consumed_at integer,
12
+ metadata text
13
+ );
14
+
15
+ create index if not exists auth_oauth_authorization_code_client_expires_at_idx on auth_oauth_authorization_code (client_id, expires_at);
16
+ create index if not exists auth_oauth_authorization_code_expires_at_idx on auth_oauth_authorization_code (expires_at);
17
+ create index if not exists auth_oauth_authorization_code_consumed_at_idx on auth_oauth_authorization_code (consumed_at);
@@ -0,0 +1,24 @@
1
+ create table if not exists auth_oauth_provider_mode_token (
2
+ token_hash text primary key,
3
+ token_type text not null,
4
+ client_id text not null,
5
+ subject text not null,
6
+ scopes text not null,
7
+ issued_at integer not null,
8
+ expires_at integer not null,
9
+ issuer text,
10
+ audience text,
11
+ jwt_id text,
12
+ revoked_at integer,
13
+ revocation_reason text,
14
+ rotated_at integer,
15
+ replaced_by_token_hash text,
16
+ metadata text
17
+ );
18
+
19
+ create index if not exists auth_oauth_provider_mode_token_client_expires_at_idx on auth_oauth_provider_mode_token (client_id, expires_at);
20
+ create index if not exists auth_oauth_provider_mode_token_subject_idx on auth_oauth_provider_mode_token (subject);
21
+ create index if not exists auth_oauth_provider_mode_token_expires_at_idx on auth_oauth_provider_mode_token (expires_at);
22
+ create index if not exists auth_oauth_provider_mode_token_revoked_at_idx on auth_oauth_provider_mode_token (revoked_at);
23
+ create index if not exists auth_oauth_provider_mode_token_rotated_at_idx on auth_oauth_provider_mode_token (rotated_at);
24
+ create index if not exists auth_oauth_provider_mode_token_jwt_id_idx on auth_oauth_provider_mode_token (jwt_id);
@@ -0,0 +1,14 @@
1
+ create table if not exists auth_oauth_client_secret (
2
+ prefix text primary key,
3
+ client_id text not null,
4
+ secret_hash text not null,
5
+ authentication_methods text not null,
6
+ created_at integer not null,
7
+ expires_at integer,
8
+ last_used_at integer,
9
+ revoked_at integer,
10
+ metadata text
11
+ );
12
+
13
+ create index if not exists auth_oauth_client_secret_client_prefix_idx on auth_oauth_client_secret (client_id, prefix);
14
+ create index if not exists auth_oauth_client_secret_client_id_idx on auth_oauth_client_secret (client_id);
@@ -0,0 +1,15 @@
1
+ create table if not exists auth_oauth_client (
2
+ id text primary key,
3
+ type text not null,
4
+ status text not null,
5
+ name text,
6
+ redirect_uris text not null,
7
+ allowed_grant_types text not null,
8
+ allowed_response_types text not null,
9
+ allowed_scopes text,
10
+ created_at integer,
11
+ updated_at integer,
12
+ metadata text
13
+ );
14
+
15
+ create index if not exists auth_oauth_client_status_idx on auth_oauth_client (status);
@@ -0,0 +1,15 @@
1
+ create table if not exists auth_oauth_consent (
2
+ id text primary key,
3
+ user_id text not null,
4
+ client_id text not null,
5
+ scopes text not null,
6
+ granted_at integer not null,
7
+ expires_at integer,
8
+ revoked_at integer,
9
+ metadata text
10
+ );
11
+
12
+ create unique index if not exists auth_oauth_consent_user_client_idx on auth_oauth_consent (user_id, client_id);
13
+ create index if not exists auth_oauth_consent_user_id_idx on auth_oauth_consent (user_id);
14
+ create index if not exists auth_oauth_consent_expires_at_idx on auth_oauth_consent (expires_at);
15
+ create index if not exists auth_oauth_consent_revoked_at_idx on auth_oauth_consent (revoked_at);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effect-auth/core",
3
- "version": "0.1.0-alpha.10",
3
+ "version": "0.1.0-alpha.13",
4
4
  "description": "Composable Effect-first authentication primitives.",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -65,6 +65,10 @@
65
65
  "types": "./dist/Crypto.d.ts",
66
66
  "default": "./dist/Crypto.js"
67
67
  },
68
+ "./DomainVerification": {
69
+ "types": "./dist/DomainVerification.d.ts",
70
+ "default": "./dist/DomainVerification.js"
71
+ },
68
72
  "./EffectQbSqliteStorage": {
69
73
  "types": "./dist/EffectQbSqliteStorage.d.ts",
70
74
  "default": "./dist/EffectQbSqliteStorage.js"
@@ -89,6 +93,10 @@
89
93
  "types": "./dist/Identifiers.d.ts",
90
94
  "default": "./dist/Identifiers.js"
91
95
  },
96
+ "./IncidentAction": {
97
+ "types": "./dist/IncidentAction.d.ts",
98
+ "default": "./dist/IncidentAction.js"
99
+ },
92
100
  "./LoginApproval": {
93
101
  "types": "./dist/LoginApproval.d.ts",
94
102
  "default": "./dist/LoginApproval.js"
@@ -101,6 +109,10 @@
101
109
  "types": "./dist/LoginRisk.d.ts",
102
110
  "default": "./dist/LoginRisk.js"
103
111
  },
112
+ "./MachineAuth": {
113
+ "types": "./dist/MachineAuth.d.ts",
114
+ "default": "./dist/MachineAuth.js"
115
+ },
104
116
  "./Jwt": {
105
117
  "types": "./dist/Jwt.d.ts",
106
118
  "default": "./dist/Jwt.js"
@@ -141,6 +153,10 @@
141
153
  "types": "./dist/RefreshToken.d.ts",
142
154
  "default": "./dist/RefreshToken.js"
143
155
  },
156
+ "./Retention": {
157
+ "types": "./dist/Retention.d.ts",
158
+ "default": "./dist/Retention.js"
159
+ },
144
160
  "./Password": {
145
161
  "types": "./dist/Password.d.ts",
146
162
  "default": "./dist/Password.js"