@effect-auth/core 0.1.0-alpha.18 → 0.1.0-alpha.19
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.
- package/README.md +4 -5
- package/dist/DevEmail.d.ts +44 -0
- package/dist/DevEmail.d.ts.map +1 -0
- package/dist/DevEmail.js +115 -0
- package/dist/DevEmail.js.map +1 -0
- package/dist/DevelopmentSeed.d.ts +47 -0
- package/dist/DevelopmentSeed.d.ts.map +1 -0
- package/dist/DevelopmentSeed.js +337 -0
- package/dist/DevelopmentSeed.js.map +1 -0
- package/dist/DrizzleBunSqliteStorage.d.ts +1 -1
- package/dist/DrizzleBunSqliteStorage.d.ts.map +1 -1
- package/dist/DrizzleD1SqliteStorage.d.ts +1 -1
- package/dist/DrizzleD1SqliteStorage.d.ts.map +1 -1
- package/dist/DrizzleEffectSqliteStorage.d.ts +1 -1
- package/dist/DrizzleEffectSqliteStorage.d.ts.map +1 -1
- package/dist/DrizzleNodeSqliteStorage.d.ts +1 -1
- package/dist/DrizzleNodeSqliteStorage.d.ts.map +1 -1
- package/dist/DrizzlePostgresStorage.d.ts +26 -0
- package/dist/DrizzlePostgresStorage.d.ts.map +1 -0
- package/dist/DrizzlePostgresStorage.js +14 -0
- package/dist/DrizzlePostgresStorage.js.map +1 -0
- package/dist/EffectQbPostgresStorage.d.ts +8 -1
- package/dist/EffectQbPostgresStorage.d.ts.map +1 -1
- package/dist/EffectQbPostgresStorage.js +359 -2
- package/dist/EffectQbPostgresStorage.js.map +1 -1
- package/dist/EffectQbSqliteStorage.d.ts +42 -2
- package/dist/EffectQbSqliteStorage.d.ts.map +1 -1
- package/dist/EffectQbSqliteStorage.js +337 -1
- package/dist/EffectQbSqliteStorage.js.map +1 -1
- package/dist/HttpApi/Api.d.ts +151 -98
- package/dist/HttpApi/Api.d.ts.map +1 -1
- package/dist/HttpApi/Api.js +122 -72
- package/dist/HttpApi/Api.js.map +1 -1
- package/dist/HttpApi/ClientApi.d.ts +136 -136
- package/dist/HttpApi/Endpoints.d.ts +33 -1
- package/dist/HttpApi/Endpoints.d.ts.map +1 -1
- package/dist/HttpApi/Endpoints.js +31 -2
- package/dist/HttpApi/Endpoints.js.map +1 -1
- package/dist/HttpApi/Errors.d.ts +11 -3
- package/dist/HttpApi/Errors.d.ts.map +1 -1
- package/dist/HttpApi/Errors.js +16 -0
- package/dist/HttpApi/Errors.js.map +1 -1
- package/dist/HttpApi/Middleware.d.ts +12 -0
- package/dist/HttpApi/Middleware.d.ts.map +1 -1
- package/dist/HttpApi/Middleware.js +8 -0
- package/dist/HttpApi/Middleware.js.map +1 -1
- package/dist/HttpApi/OAuthDeviceAuthorization.d.ts +106 -0
- package/dist/HttpApi/OAuthDeviceAuthorization.d.ts.map +1 -0
- package/dist/HttpApi/OAuthDeviceAuthorization.js +415 -0
- package/dist/HttpApi/OAuthDeviceAuthorization.js.map +1 -0
- package/dist/HttpApi/OAuthToken.d.ts +1 -1
- package/dist/HttpApi/OAuthToken.d.ts.map +1 -1
- package/dist/HttpApi/OAuthToken.js +1 -1
- package/dist/HttpApi/OAuthToken.js.map +1 -1
- package/dist/HttpApi/Operations/OAuthDeviceAuthorization.d.ts +23 -0
- package/dist/HttpApi/Operations/OAuthDeviceAuthorization.d.ts.map +1 -0
- package/dist/HttpApi/Operations/OAuthDeviceAuthorization.js +7 -0
- package/dist/HttpApi/Operations/OAuthDeviceAuthorization.js.map +1 -0
- package/dist/HttpApi/Operations/OAuthToken.d.ts +10 -0
- package/dist/HttpApi/Operations/OAuthToken.d.ts.map +1 -1
- package/dist/HttpApi/Operations/OAuthToken.js +4 -0
- package/dist/HttpApi/Operations/OAuthToken.js.map +1 -1
- package/dist/HttpApi/Operations/index.d.ts +1 -0
- package/dist/HttpApi/Operations/index.d.ts.map +1 -1
- package/dist/HttpApi/Operations/index.js +1 -0
- package/dist/HttpApi/Operations/index.js.map +1 -1
- package/dist/HttpApi/PasswordContract.d.ts +9 -9
- package/dist/HttpApi/Schemas.d.ts +38 -0
- package/dist/HttpApi/Schemas.d.ts.map +1 -1
- package/dist/HttpApi/Schemas.js +36 -1
- package/dist/HttpApi/Schemas.js.map +1 -1
- package/dist/HttpApi/index.d.ts +3 -1
- package/dist/HttpApi/index.d.ts.map +1 -1
- package/dist/HttpApi/index.js +3 -1
- package/dist/HttpApi/index.js.map +1 -1
- package/dist/OAuth.d.ts +46 -1
- package/dist/OAuth.d.ts.map +1 -1
- package/dist/OAuth.js +118 -4
- package/dist/OAuth.js.map +1 -1
- package/dist/OAuthDeviceAuthorization.d.ts +378 -0
- package/dist/OAuthDeviceAuthorization.d.ts.map +1 -0
- package/dist/OAuthDeviceAuthorization.js +860 -0
- package/dist/OAuthDeviceAuthorization.js.map +1 -0
- package/dist/OAuthDeviceClient.d.ts +76 -0
- package/dist/OAuthDeviceClient.d.ts.map +1 -0
- package/dist/OAuthDeviceClient.js +362 -0
- package/dist/OAuthDeviceClient.js.map +1 -0
- package/dist/PostgresStorageMigrations.d.ts +2 -1
- package/dist/PostgresStorageMigrations.d.ts.map +1 -1
- package/dist/PostgresStorageMigrations.js +54 -0
- package/dist/PostgresStorageMigrations.js.map +1 -1
- package/dist/Retention.d.ts +6 -1
- package/dist/Retention.d.ts.map +1 -1
- package/dist/Retention.js +49 -12
- package/dist/Retention.js.map +1 -1
- package/dist/SqliteStorageSchemaData.d.ts +2 -0
- package/dist/SqliteStorageSchemaData.d.ts.map +1 -0
- package/dist/SqliteStorageSchemaData.js +508 -0
- package/dist/SqliteStorageSchemaData.js.map +1 -0
- package/dist/StorageMigrations.d.ts +2 -1
- package/dist/StorageMigrations.d.ts.map +1 -1
- package/dist/StorageMigrations.js +32 -0
- package/dist/StorageMigrations.js.map +1 -1
- package/dist/StorageSchemaGenerator.d.ts +70 -12
- package/dist/StorageSchemaGenerator.d.ts.map +1 -1
- package/dist/StorageSchemaGenerator.js +478 -82
- package/dist/StorageSchemaGenerator.js.map +1 -1
- package/migrations/0029_auth_oauth_device_authorization.sql +28 -0
- package/migrations/postgres/0010_auth_oauth_device_authorization.sql +50 -0
- package/package.json +24 -16
- package/dist/DrizzleDurableObjectSqliteStorage.d.ts +0 -19
- package/dist/DrizzleDurableObjectSqliteStorage.d.ts.map +0 -1
- package/dist/DrizzleDurableObjectSqliteStorage.js +0 -14
- package/dist/DrizzleDurableObjectSqliteStorage.js.map +0 -1
- package/dist/DrizzleWasmSqliteStorage.d.ts +0 -23
- package/dist/DrizzleWasmSqliteStorage.d.ts.map +0 -1
- package/dist/DrizzleWasmSqliteStorage.js +0 -15
- package/dist/DrizzleWasmSqliteStorage.js.map +0 -1
|
@@ -606,6 +606,59 @@ create table auth_role_permission (
|
|
|
606
606
|
create index auth_role_permission_check_idx
|
|
607
607
|
on auth_role_permission (permission_id, role_id, scope_type_present, scope_type);`,
|
|
608
608
|
};
|
|
609
|
+
export const postgresAuthStorageMigration010 = {
|
|
610
|
+
id: "0010_auth_oauth_device_authorization",
|
|
611
|
+
sql: `alter table auth_oauth_client
|
|
612
|
+
drop constraint auth_oauth_client_allowed_grant_types_check;
|
|
613
|
+
|
|
614
|
+
alter table auth_oauth_client
|
|
615
|
+
add constraint auth_oauth_client_allowed_grant_types_check
|
|
616
|
+
check (jsonb_typeof(allowed_grant_types) = 'array' and not jsonb_path_exists(allowed_grant_types, '$[*] ? (@.type() != "string" || (@ != "authorization_code" && @ != "refresh_token" && @ != "client_credentials" && @ != "urn:ietf:params:oauth:grant-type:device_code"))'));
|
|
617
|
+
|
|
618
|
+
create table auth_oauth_device_authorization (
|
|
619
|
+
id text constraint auth_oauth_device_authorization_pkey primary key,
|
|
620
|
+
device_code_hash text not null,
|
|
621
|
+
user_code_hash text not null,
|
|
622
|
+
client_id text not null,
|
|
623
|
+
requested_scopes jsonb not null,
|
|
624
|
+
granted_scopes jsonb,
|
|
625
|
+
subject text,
|
|
626
|
+
status text not null,
|
|
627
|
+
issued_at bigint not null,
|
|
628
|
+
expires_at bigint not null,
|
|
629
|
+
poll_interval_seconds integer not null,
|
|
630
|
+
next_poll_at bigint not null,
|
|
631
|
+
last_polled_at bigint,
|
|
632
|
+
approved_at bigint,
|
|
633
|
+
denied_at bigint,
|
|
634
|
+
consumed_at bigint,
|
|
635
|
+
metadata jsonb,
|
|
636
|
+
constraint auth_oauth_device_authorization_device_code_hash_key unique (device_code_hash),
|
|
637
|
+
constraint auth_oauth_device_authorization_user_code_hash_key unique (user_code_hash),
|
|
638
|
+
constraint auth_oauth_device_authorization_status_check
|
|
639
|
+
check (status in ('pending', 'approved', 'denied')),
|
|
640
|
+
constraint auth_oauth_device_authorization_requested_scopes_check
|
|
641
|
+
check (jsonb_typeof(requested_scopes) = 'array' and not jsonb_path_exists(requested_scopes, '$[*] ? (@.type() != "string")')),
|
|
642
|
+
constraint auth_oauth_device_authorization_granted_scopes_check
|
|
643
|
+
check (granted_scopes is null or (jsonb_typeof(granted_scopes) = 'array' and not jsonb_path_exists(granted_scopes, '$[*] ? (@.type() != "string")'))),
|
|
644
|
+
constraint auth_oauth_device_authorization_metadata_check
|
|
645
|
+
check (metadata is null or jsonb_typeof(metadata) = 'object'),
|
|
646
|
+
constraint auth_oauth_device_authorization_poll_interval_check
|
|
647
|
+
check (poll_interval_seconds > 0),
|
|
648
|
+
constraint auth_oauth_device_authorization_state_check
|
|
649
|
+
check (
|
|
650
|
+
(status = 'pending' and granted_scopes is null and subject is null and approved_at is null and denied_at is null and consumed_at is null)
|
|
651
|
+
or (status = 'approved' and granted_scopes is not null and subject is not null and approved_at is not null and denied_at is null)
|
|
652
|
+
or (status = 'denied' and granted_scopes is null and subject is null and approved_at is null and denied_at is not null and consumed_at is null)
|
|
653
|
+
)
|
|
654
|
+
);
|
|
655
|
+
create index auth_oauth_device_authorization_expires_at_idx
|
|
656
|
+
on auth_oauth_device_authorization (expires_at);
|
|
657
|
+
create index auth_oauth_device_authorization_client_status_expires_at_idx
|
|
658
|
+
on auth_oauth_device_authorization (client_id, status, expires_at);
|
|
659
|
+
create index auth_oauth_device_authorization_status_expires_at_idx
|
|
660
|
+
on auth_oauth_device_authorization (status, expires_at);`,
|
|
661
|
+
};
|
|
609
662
|
export const postgresAuthStorageMigrations = [
|
|
610
663
|
postgresAuthStorageMigration001,
|
|
611
664
|
postgresAuthStorageMigration002,
|
|
@@ -616,5 +669,6 @@ export const postgresAuthStorageMigrations = [
|
|
|
616
669
|
postgresAuthStorageMigration007,
|
|
617
670
|
postgresAuthStorageMigration008,
|
|
618
671
|
postgresAuthStorageMigration009,
|
|
672
|
+
postgresAuthStorageMigration010,
|
|
619
673
|
];
|
|
620
674
|
//# sourceMappingURL=PostgresStorageMigrations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostgresStorageMigrations.js","sourceRoot":"","sources":["../src/PostgresStorageMigrations.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,+BAA+B,GAAiC;IAC3E,EAAE,EAAE,gBAAgB;IACpB,GAAG,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iFA4E0E;CAChF,CAAC;AAEF,MAAM,CAAC,MAAM,+BAA+B,GAAiC;IAC3E,EAAE,EAAE,0BAA0B;IAC9B,GAAG,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qFAgE8E;CACpF,CAAC;AAEF,MAAM,CAAC,MAAM,+BAA+B,GAAiC;IAC3E,EAAE,EAAE,8BAA8B;IAClC,GAAG,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qFA0C8E;CACpF,CAAC;AAEF,MAAM,CAAC,MAAM,+BAA+B,GAAiC;IAC3E,EAAE,EAAE,4BAA4B;IAChC,GAAG,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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J;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,+BAA+B,GAAiC;IAC3E,EAAE,EAAE,wBAAwB;IAC5B,GAAG,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mDA8D4C;CAClD,CAAC;AAEF,MAAM,CAAC,MAAM,+BAA+B,GAAiC;IAC3E,EAAE,EAAE,uBAAuB;IAC3B,GAAG,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oFAiE6E;CACnF,CAAC;AAEF,MAAM,CAAC,MAAM,+BAA+B,GAAiC;IAC3E,EAAE,EAAE,sCAAsC;IAC1C,GAAG,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2DAiDoD;CAC1D,CAAC;AAEF,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,+BAA+B;IAC/B,+BAA+B;IAC/B,+BAA+B;IAC/B,+BAA+B;IAC/B,+BAA+B;IAC/B,+BAA+B;IAC/B,+BAA+B;IAC/B,+BAA+B;IAC/B,+BAA+B;IAC/B,+BAA+B;CACvB,CAAC"}
|
package/dist/Retention.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Effect } from "effect";
|
|
|
2
2
|
import { UnixMillis } from "./Identifiers.js";
|
|
3
3
|
import type { UserId } from "./Identifiers.js";
|
|
4
4
|
import type { WebhookOutboxStatus } from "./Webhook.js";
|
|
5
|
-
export type AuthRetentionCleanupOperation = "auditLog" | "securityTimeline" | "loginRiskHistory" | "oauthConsent" | "oauthProviderModeToken" | "webhookOutbox" | "webhookReplay";
|
|
5
|
+
export type AuthRetentionCleanupOperation = "auditLog" | "securityTimeline" | "loginRiskHistory" | "oauthConsent" | "oauthDeviceAuthorization" | "oauthProviderModeToken" | "webhookOutbox" | "webhookReplay";
|
|
6
6
|
declare const AuthRetentionCleanupError_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 & {
|
|
7
7
|
readonly _tag: "AuthRetentionCleanupError";
|
|
8
8
|
} & Readonly<A>;
|
|
@@ -72,12 +72,16 @@ export type OAuthConsentRetentionCleanupInput = (OAuthConsentRetentionCutoffs &
|
|
|
72
72
|
}) | (OAuthConsentRetentionCutoffs & {
|
|
73
73
|
readonly revokedRetentionMillis: number;
|
|
74
74
|
});
|
|
75
|
+
export type OAuthDeviceAuthorizationRetentionCleanupInput = RetentionMillisCutoff | {
|
|
76
|
+
readonly beforeExpiresAt: UnixMillis;
|
|
77
|
+
};
|
|
75
78
|
export interface AuthRetentionCleanupInput {
|
|
76
79
|
readonly now?: UnixMillis;
|
|
77
80
|
readonly auditLog?: AuditLogRetentionCleanupInput;
|
|
78
81
|
readonly securityTimeline?: SecurityTimelineRetentionCleanupInput;
|
|
79
82
|
readonly loginRiskHistory?: LoginRiskHistoryRetentionCleanupInput;
|
|
80
83
|
readonly oauthConsent?: OAuthConsentRetentionCleanupInput;
|
|
84
|
+
readonly oauthDeviceAuthorization?: OAuthDeviceAuthorizationRetentionCleanupInput;
|
|
81
85
|
readonly oauthProviderModeToken?: OAuthProviderModeTokenRetentionCleanupInput;
|
|
82
86
|
readonly webhookOutbox?: WebhookOutboxRetentionCleanupInput;
|
|
83
87
|
readonly webhookReplay?: boolean;
|
|
@@ -87,6 +91,7 @@ export interface AuthRetentionCleanupResult {
|
|
|
87
91
|
readonly securityTimelineDeleted: number;
|
|
88
92
|
readonly loginRiskHistoryDeleted: number;
|
|
89
93
|
readonly oauthConsentsDeleted: number;
|
|
94
|
+
readonly oauthDeviceAuthorizationsDeleted: number;
|
|
90
95
|
readonly oauthProviderModeTokensDeleted: number;
|
|
91
96
|
readonly webhookOutboxDeleted: number;
|
|
92
97
|
readonly webhookReplayDeleted: number;
|
package/dist/Retention.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Retention.d.ts","sourceRoot":"","sources":["../src/Retention.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,MAAM,EAAU,MAAM,QAAQ,CAAC;AAI9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"Retention.d.ts","sourceRoot":"","sources":["../src/Retention.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,MAAM,EAAU,MAAM,QAAQ,CAAC;AAI9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAgB/C,OAAO,KAAK,EACV,mBAAmB,EAGpB,MAAM,cAAc,CAAC;AAEtB,MAAM,MAAM,6BAA6B,GACrC,UAAU,GACV,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,0BAA0B,GAC1B,wBAAwB,GACxB,eAAe,GACf,eAAe,CAAC;;;;AAEpB,qBAAa,yBAA0B,SAAQ,+BAE7C;IACA,QAAQ,CAAC,SAAS,EAAE,6BAA6B,CAAC;IAClD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;CAAG;AAEL,UAAU,qBAAqB;IAC7B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CAClC;AAED,UAAU,gBAAgB;IACxB,QAAQ,CAAC,gBAAgB,EAAE,UAAU,CAAC;CACvC;AAED,UAAU,eAAe;IACvB,QAAQ,CAAC,eAAe,EAAE,UAAU,CAAC;CACtC;AAED,KAAK,yBAAyB,GAAG,qBAAqB,GAAG,gBAAgB,CAAC;AAC1E,KAAK,wBAAwB,GAAG,qBAAqB,GAAG,eAAe,CAAC;AAExE,MAAM,MAAM,6BAA6B,GAAG,yBAA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9E,QAAQ,CAAC,aAAa,CAAC,EAAE,kCAAkC,CAAC;IAC5D,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;IACzC,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;IACzC,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,gCAAgC,EAAE,MAAM,CAAC;IAClD,QAAQ,CAAC,8BAA8B,EAAE,MAAM,CAAC;IAChD,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED,eAAO,MAAM,qCAAqC,mDAI2B,CAAC;AA6U9E,eAAO,MAAM,uBAAuB,WAC3B,yBAAyB,KAC/B,MAAM,CAAC,MAAM,CAAC,0BAA0B,EAAE,yBAAyB,CA4ClE,CAAC"}
|
package/dist/Retention.js
CHANGED
|
@@ -4,6 +4,7 @@ import { UnixMillis } from "./Identifiers.js";
|
|
|
4
4
|
import { currentUnixMillis } from "./Internal.js";
|
|
5
5
|
import { LoginRiskHistory } from "./LoginRisk.js";
|
|
6
6
|
import { OAuthConsentStore, OAuthProviderModeTokenStore } from "./OAuth.js";
|
|
7
|
+
import { OAuthDeviceAuthorizationStore } from "./OAuthDeviceAuthorization.js";
|
|
7
8
|
import { SecurityTimelineStore } from "./SecurityTimeline.js";
|
|
8
9
|
import { WebhookOutboxStore, WebhookReplayStore } from "./Webhook.js";
|
|
9
10
|
export class AuthRetentionCleanupError extends Data.TaggedError("AuthRetentionCleanupError") {
|
|
@@ -35,6 +36,7 @@ const summary = (input) => ({
|
|
|
35
36
|
input.securityTimelineDeleted +
|
|
36
37
|
input.loginRiskHistoryDeleted +
|
|
37
38
|
input.oauthConsentsDeleted +
|
|
39
|
+
input.oauthDeviceAuthorizationsDeleted +
|
|
38
40
|
input.oauthProviderModeTokensDeleted +
|
|
39
41
|
input.webhookOutboxDeleted +
|
|
40
42
|
input.webhookReplayDeleted,
|
|
@@ -48,10 +50,12 @@ const cleanupAuditLog = (input, now) => {
|
|
|
48
50
|
if (Option.isNone(store)) {
|
|
49
51
|
return yield* Effect.fail(missingServiceError("auditLog"));
|
|
50
52
|
}
|
|
51
|
-
return yield* store.value
|
|
53
|
+
return yield* store.value
|
|
54
|
+
.deleteBefore({
|
|
52
55
|
beforeOccurredAt: occurredAtCutoff(input, now),
|
|
53
56
|
...(input.userId === undefined ? {} : { userId: input.userId }),
|
|
54
|
-
})
|
|
57
|
+
})
|
|
58
|
+
.pipe(Effect.mapError((cause) => cleanupError("auditLog", cause)));
|
|
55
59
|
});
|
|
56
60
|
};
|
|
57
61
|
const cleanupSecurityTimeline = (input, now) => {
|
|
@@ -63,10 +67,12 @@ const cleanupSecurityTimeline = (input, now) => {
|
|
|
63
67
|
if (Option.isNone(store)) {
|
|
64
68
|
return yield* Effect.fail(missingServiceError("securityTimeline"));
|
|
65
69
|
}
|
|
66
|
-
return yield* store.value
|
|
70
|
+
return yield* store.value
|
|
71
|
+
.deleteBefore({
|
|
67
72
|
beforeOccurredAt: occurredAtCutoff(input, now),
|
|
68
73
|
...(input.userId === undefined ? {} : { userId: input.userId }),
|
|
69
|
-
})
|
|
74
|
+
})
|
|
75
|
+
.pipe(Effect.mapError((cause) => cleanupError("securityTimeline", cause)));
|
|
70
76
|
});
|
|
71
77
|
};
|
|
72
78
|
const cleanupLoginRiskHistory = (input, now) => {
|
|
@@ -78,10 +84,12 @@ const cleanupLoginRiskHistory = (input, now) => {
|
|
|
78
84
|
if (Option.isNone(store)) {
|
|
79
85
|
return yield* Effect.fail(missingServiceError("loginRiskHistory"));
|
|
80
86
|
}
|
|
81
|
-
return yield* store.value
|
|
87
|
+
return yield* store.value
|
|
88
|
+
.deleteBefore({
|
|
82
89
|
beforeOccurredAt: occurredAtCutoff(input, now),
|
|
83
90
|
...(input.userId === undefined ? {} : { userId: input.userId }),
|
|
84
|
-
})
|
|
91
|
+
})
|
|
92
|
+
.pipe(Effect.mapError((cause) => cleanupError("loginRiskHistory", cause)));
|
|
85
93
|
});
|
|
86
94
|
};
|
|
87
95
|
const cleanupWebhookOutbox = (input, now) => {
|
|
@@ -93,11 +101,15 @@ const cleanupWebhookOutbox = (input, now) => {
|
|
|
93
101
|
if (Option.isNone(store)) {
|
|
94
102
|
return yield* Effect.fail(missingServiceError("webhookOutbox"));
|
|
95
103
|
}
|
|
96
|
-
return yield* store.value
|
|
104
|
+
return yield* store.value
|
|
105
|
+
.deleteBefore({
|
|
97
106
|
beforeUpdatedAt: updatedAtCutoff(input, now),
|
|
98
107
|
statuses: input.statuses ?? defaultWebhookOutboxRetentionStatuses,
|
|
99
|
-
...(input.endpointKey === undefined
|
|
100
|
-
|
|
108
|
+
...(input.endpointKey === undefined
|
|
109
|
+
? {}
|
|
110
|
+
: { endpointKey: input.endpointKey }),
|
|
111
|
+
})
|
|
112
|
+
.pipe(Effect.mapError((cause) => cleanupError("webhookOutbox", cause)));
|
|
101
113
|
});
|
|
102
114
|
};
|
|
103
115
|
const oauthProviderModeTokenCutoffs = (input, now) => {
|
|
@@ -137,7 +149,9 @@ const cleanupOAuthProviderModeToken = (input, now) => {
|
|
|
137
149
|
if (cutoffs === undefined) {
|
|
138
150
|
return 0;
|
|
139
151
|
}
|
|
140
|
-
return yield* store.value
|
|
152
|
+
return yield* store.value
|
|
153
|
+
.deleteRetired(cutoffs)
|
|
154
|
+
.pipe(Effect.mapError((cause) => cleanupError("oauthProviderModeToken", cause)));
|
|
141
155
|
});
|
|
142
156
|
};
|
|
143
157
|
const oauthConsentCutoffs = (input, now) => {
|
|
@@ -170,7 +184,26 @@ const cleanupOAuthConsent = (input, now) => {
|
|
|
170
184
|
if (cutoffs === undefined) {
|
|
171
185
|
return 0;
|
|
172
186
|
}
|
|
173
|
-
return yield* store.value
|
|
187
|
+
return yield* store.value
|
|
188
|
+
.deleteInactive(cutoffs)
|
|
189
|
+
.pipe(Effect.mapError((cause) => cleanupError("oauthConsent", cause)));
|
|
190
|
+
});
|
|
191
|
+
};
|
|
192
|
+
const cleanupOAuthDeviceAuthorization = (input, now) => {
|
|
193
|
+
if (input === undefined) {
|
|
194
|
+
return Effect.succeed(0);
|
|
195
|
+
}
|
|
196
|
+
return Effect.gen(function* () {
|
|
197
|
+
const store = yield* Effect.serviceOption(OAuthDeviceAuthorizationStore);
|
|
198
|
+
if (Option.isNone(store) || store.value.deleteExpired === undefined) {
|
|
199
|
+
return yield* Effect.fail(missingServiceError("oauthDeviceAuthorization"));
|
|
200
|
+
}
|
|
201
|
+
const beforeExpiresAt = "beforeExpiresAt" in input
|
|
202
|
+
? input.beforeExpiresAt
|
|
203
|
+
: cutoffFromRetentionMillis(now, input.retentionMillis);
|
|
204
|
+
return yield* store.value
|
|
205
|
+
.deleteExpired({ beforeExpiresAt })
|
|
206
|
+
.pipe(Effect.mapError((cause) => cleanupError("oauthDeviceAuthorization", cause)));
|
|
174
207
|
});
|
|
175
208
|
};
|
|
176
209
|
const cleanupWebhookReplay = (enabled, now) => enabled === true
|
|
@@ -179,7 +212,9 @@ const cleanupWebhookReplay = (enabled, now) => enabled === true
|
|
|
179
212
|
if (Option.isNone(store)) {
|
|
180
213
|
return yield* Effect.fail(missingServiceError("webhookReplay"));
|
|
181
214
|
}
|
|
182
|
-
return yield* store.value
|
|
215
|
+
return yield* store.value
|
|
216
|
+
.deleteExpired({ now })
|
|
217
|
+
.pipe(Effect.mapError((cause) => cleanupError("webhookReplay", cause)));
|
|
183
218
|
})
|
|
184
219
|
: Effect.succeed(0);
|
|
185
220
|
export const runAuthRetentionCleanup = (input = {}) => Effect.gen(function* () {
|
|
@@ -188,6 +223,7 @@ export const runAuthRetentionCleanup = (input = {}) => Effect.gen(function* () {
|
|
|
188
223
|
const securityTimelineDeleted = yield* cleanupSecurityTimeline(input.securityTimeline, now);
|
|
189
224
|
const loginRiskHistoryDeleted = yield* cleanupLoginRiskHistory(input.loginRiskHistory, now);
|
|
190
225
|
const oauthConsentsDeleted = yield* cleanupOAuthConsent(input.oauthConsent, now);
|
|
226
|
+
const oauthDeviceAuthorizationsDeleted = yield* cleanupOAuthDeviceAuthorization(input.oauthDeviceAuthorization, now);
|
|
191
227
|
const oauthProviderModeTokensDeleted = yield* cleanupOAuthProviderModeToken(input.oauthProviderModeToken, now);
|
|
192
228
|
const webhookOutboxDeleted = yield* cleanupWebhookOutbox(input.webhookOutbox, now);
|
|
193
229
|
const webhookReplayDeleted = yield* cleanupWebhookReplay(input.webhookReplay, now);
|
|
@@ -196,6 +232,7 @@ export const runAuthRetentionCleanup = (input = {}) => Effect.gen(function* () {
|
|
|
196
232
|
securityTimelineDeleted,
|
|
197
233
|
loginRiskHistoryDeleted,
|
|
198
234
|
oauthConsentsDeleted,
|
|
235
|
+
oauthDeviceAuthorizationsDeleted,
|
|
199
236
|
oauthProviderModeTokensDeleted,
|
|
200
237
|
webhookOutboxDeleted,
|
|
201
238
|
webhookReplayDeleted,
|
package/dist/Retention.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Retention.js","sourceRoot":"","sources":["../src/Retention.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AAO5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAu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,MAAM,gCAAgC,GACpC,KAAK,CAAC,CAAC,+BAA+B,CACpC,KAAK,CAAC,wBAAwB,EAC9B,GAAG,CACJ,CAAC;IACJ,MAAM,8BAA8B,GAAG,KAAK,CAAC,CAAC,6BAA6B,CACzE,KAAK,CAAC,sBAAsB,EAC5B,GAAG,CACJ,CAAC;IACF,MAAM,oBAAoB,GAAG,KAAK,CAAC,CAAC,oBAAoB,CACtD,KAAK,CAAC,aAAa,EACnB,GAAG,CACJ,CAAC;IACF,MAAM,oBAAoB,GAAG,KAAK,CAAC,CAAC,oBAAoB,CACtD,KAAK,CAAC,aAAa,EACnB,GAAG,CACJ,CAAC;IAEF,OAAO,OAAO,CAAC;QACb,eAAe;QACf,uBAAuB;QACvB,uBAAuB;QACvB,oBAAoB;QACpB,gCAAgC;QAChC,8BAA8B;QAC9B,oBAAoB;QACpB,oBAAoB;KACrB,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const sqliteAuthStorageSchema = "create table auth_user (\n id text primary key,\n created_at integer not null,\n updated_at integer not null,\n disabled_at integer,\n metadata text\n);\n\ncreate table auth_user_identity (\n id text primary key,\n user_id text not null,\n scope_type text not null,\n scope_id text not null,\n kind text not null,\n value text not null,\n normalized_value text not null,\n verified_at integer,\n is_primary_login integer not null,\n created_at integer not null,\n updated_at integer not null,\n revoked_at integer,\n replaced_by_id text,\n metadata text\n);\ncreate unique index auth_user_identity_active_value_idx on auth_user_identity (scope_type, scope_id, kind, normalized_value) where revoked_at is null;\ncreate index auth_user_identity_user_id_idx on auth_user_identity (user_id);\ncreate index auth_user_identity_replaced_by_id_idx on auth_user_identity (replaced_by_id);\ncreate unique index auth_user_identity_active_primary_idx on auth_user_identity (user_id) where revoked_at is null and is_primary_login = 1;\n\ncreate table auth_credential (\n id text primary key,\n user_id text not null,\n type text not null,\n password_hash text,\n created_at integer not null,\n updated_at integer not null,\n revoked_at integer,\n metadata text\n);\ncreate index auth_credential_user_id_idx on auth_credential (user_id);\ncreate unique index auth_credential_user_type_idx on auth_credential (user_id, type);\n\ncreate table auth_session (\n id text primary key,\n user_id text not null,\n secret_hash text not null,\n created_at integer not null,\n expires_at integer not null,\n auth_time integer not null,\n authentication_events text not null,\n aal text not null,\n amr text not null,\n mfa_verified_at integer,\n metadata text,\n revoked_at integer,\n last_seen_at integer,\n rotated_at integer\n);\ncreate index auth_session_user_id_idx on auth_session (user_id);\ncreate index auth_session_expires_at_idx on auth_session (expires_at);\n\ncreate table auth_verification (\n id text primary key,\n type text not null,\n subject text not null,\n secret_hash text,\n created_at integer not null,\n expires_at integer not null,\n metadata text,\n consumed_at integer\n);\ncreate index auth_verification_type_subject_idx on auth_verification (type, subject);\ncreate index auth_verification_expires_at_idx on auth_verification (expires_at);\n\ncreate table auth_totp_factor (\n id text primary key,\n user_id text not null,\n secret text not null,\n algorithm text not null,\n digits integer not null,\n period integer not null,\n created_at integer not null,\n confirmed_at integer,\n last_used_at integer,\n last_accepted_counter integer,\n revoked_at integer,\n metadata text\n);\ncreate index auth_totp_factor_user_id_idx on auth_totp_factor (user_id);\ncreate index auth_totp_factor_confirmed_at_idx on auth_totp_factor (confirmed_at);\ncreate index auth_totp_factor_revoked_at_idx on auth_totp_factor (revoked_at);\n\ncreate table auth_recovery_code (\n id text primary key,\n user_id text not null,\n code_hash text not null,\n created_at integer not null,\n used_at integer,\n revoked_at integer,\n metadata text\n);\ncreate index auth_recovery_code_user_id_idx on auth_recovery_code (user_id);\ncreate index auth_recovery_code_used_at_idx on auth_recovery_code (used_at);\ncreate index auth_recovery_code_revoked_at_idx on auth_recovery_code (revoked_at);\n\ncreate table auth_refresh_token (\n id text primary key,\n family_id text not null,\n user_id text not null,\n secret_hash text not null,\n created_at integer not null,\n expires_at integer not null,\n last_used_at integer,\n rotated_at integer,\n replaced_by_id text,\n revoked_at integer,\n reuse_detected_at integer,\n metadata text\n);\ncreate unique index auth_refresh_token_secret_hash_idx on auth_refresh_token (secret_hash);\ncreate index auth_refresh_token_family_id_idx on auth_refresh_token (family_id);\ncreate index auth_refresh_token_user_id_idx on auth_refresh_token (user_id);\ncreate index auth_refresh_token_expires_at_idx on auth_refresh_token (expires_at);\ncreate index auth_refresh_token_rotated_at_idx on auth_refresh_token (rotated_at);\ncreate index auth_refresh_token_revoked_at_idx on auth_refresh_token (revoked_at);\n\ncreate table auth_oauth_account (\n id text primary key,\n provider_id text not null,\n provider_account_id text not null,\n user_id text not null,\n email text,\n email_verified integer,\n created_at integer not null,\n updated_at integer not null,\n unlinked_at integer,\n metadata text\n);\ncreate unique index auth_oauth_account_provider_account_idx on auth_oauth_account (provider_id, provider_account_id);\ncreate index auth_oauth_account_user_id_idx on auth_oauth_account (user_id);\ncreate index auth_oauth_account_unlinked_at_idx on auth_oauth_account (unlinked_at);\n\ncreate table auth_passkey_credential (\n id text primary key,\n user_id text not null,\n credential_id text not null,\n public_key text not null,\n sign_count integer not null,\n transports text,\n backed_up integer,\n created_at integer not null,\n last_used_at integer,\n revoked_at integer,\n metadata text\n);\ncreate unique index auth_passkey_credential_credential_id_idx on auth_passkey_credential (credential_id);\ncreate index auth_passkey_credential_user_id_idx on auth_passkey_credential (user_id);\ncreate index auth_passkey_credential_revoked_at_idx on auth_passkey_credential (revoked_at);\n\ncreate table auth_api_key (\n id text primary key,\n user_id text not null,\n prefix text not null,\n secret_hash text not null,\n scopes text not null,\n created_at integer not null,\n expires_at integer,\n last_used_at integer,\n revoked_at integer,\n metadata text\n);\ncreate unique index auth_api_key_prefix_idx on auth_api_key (prefix);\ncreate index auth_api_key_user_id_idx on auth_api_key (user_id);\ncreate index auth_api_key_expires_at_idx on auth_api_key (expires_at);\ncreate index auth_api_key_revoked_at_idx on auth_api_key (revoked_at);\n\ncreate table auth_jwt_revocation (\n jwt_id text primary key,\n revoked_at integer not null,\n expires_at integer,\n reason text\n);\ncreate index auth_jwt_revocation_expires_at_idx on auth_jwt_revocation (expires_at);\n\ncreate table auth_audit_log (\n storage_id integer primary key autoincrement,\n id text,\n type text not null,\n user_id text,\n actor_user_id text,\n occurred_at integer not null,\n request_ip_hash text,\n request_user_agent_hash text,\n event text not null,\n created_at integer not null\n);\ncreate index auth_audit_log_id_idx on auth_audit_log (id);\ncreate index auth_audit_log_user_occurred_at_idx on auth_audit_log (user_id, occurred_at);\ncreate index auth_audit_log_actor_user_occurred_at_idx on auth_audit_log (actor_user_id, occurred_at);\ncreate index auth_audit_log_type_occurred_at_idx on auth_audit_log (type, occurred_at);\ncreate index auth_audit_log_occurred_at_idx on auth_audit_log (occurred_at);\n\ncreate table auth_login_approval_review (\n approval_challenge_id text primary key,\n flow_id text not null,\n user_id text not null,\n channel text not null,\n reason text not null,\n session_binding text not null,\n same_device_required integer not null,\n status text not null,\n created_at integer not null,\n expires_at integer not null,\n reviewed_at integer,\n reviewed_by text,\n denied_reason text,\n risk text,\n metadata text,\n review_metadata text\n);\ncreate index auth_login_approval_review_flow_id_idx on auth_login_approval_review (flow_id);\ncreate index auth_login_approval_review_user_id_idx on auth_login_approval_review (user_id);\ncreate index auth_login_approval_review_status_expires_at_idx on auth_login_approval_review (status, expires_at);\n\ncreate table auth_login_risk_history (\n id text primary key,\n user_id text not null,\n occurred_at integer not null,\n outcome text not null,\n method text not null,\n amr text not null,\n aal text not null,\n device_status text not null,\n device_key text,\n location_key text,\n country text,\n region text,\n latitude_micro integer,\n longitude_micro integer,\n risk_level text,\n created_at integer not null\n);\ncreate index auth_login_risk_history_user_occurred_at_idx on auth_login_risk_history (user_id, occurred_at);\ncreate index auth_login_risk_history_user_device_key_idx on auth_login_risk_history (user_id, device_key);\ncreate index auth_login_risk_history_user_location_key_idx on auth_login_risk_history (user_id, location_key);\ncreate index auth_login_risk_history_occurred_at_idx on auth_login_risk_history (occurred_at);\n\ncreate table auth_trusted_device (\n user_id text not null,\n token_hash text not null,\n created_at integer not null,\n last_seen_at integer not null,\n expires_at integer not null,\n metadata text,\n primary key (user_id, token_hash)\n);\ncreate index auth_trusted_device_user_id_idx on auth_trusted_device (user_id);\ncreate index auth_trusted_device_expires_at_idx on auth_trusted_device (expires_at);\n\ncreate table auth_webhook_outbox (\n id text primary key,\n endpoint_key text not null,\n event text not null,\n status text not null,\n attempts integer not null,\n next_attempt_at integer not null,\n created_at integer not null,\n updated_at integer not null,\n delivered_at integer,\n last_error text\n);\ncreate index auth_webhook_outbox_due_idx on auth_webhook_outbox (next_attempt_at, status);\ncreate index auth_webhook_outbox_endpoint_due_idx on auth_webhook_outbox (endpoint_key, next_attempt_at);\ncreate index auth_webhook_outbox_status_idx on auth_webhook_outbox (status);\n\ncreate table auth_webhook_replay (\n id text primary key,\n expires_at integer not null,\n created_at integer not null\n);\ncreate index auth_webhook_replay_expires_at_idx on auth_webhook_replay (expires_at);\n\ncreate table auth_domain_verification (\n id text primary key,\n owner_id text not null,\n domain text not null,\n proof_method text not null,\n proof_token text not null,\n status text not null,\n created_at integer not null,\n expires_at integer not null,\n verified_at integer,\n revoked_at integer,\n last_checked_at integer,\n metadata text\n);\ncreate unique index auth_domain_verification_owner_domain_idx on auth_domain_verification (owner_id, domain);\ncreate index auth_domain_verification_domain_idx on auth_domain_verification (domain);\ncreate index auth_domain_verification_status_expires_at_idx on auth_domain_verification (status, expires_at);\n\ncreate table auth_security_timeline (\n id text primary key,\n user_id text not null,\n type text not null,\n category text not null,\n severity text not null,\n occurred_at integer not null,\n summary text not null,\n actor text,\n request text,\n metadata text\n);\ncreate index auth_security_timeline_user_occurred_at_idx on auth_security_timeline (user_id, occurred_at);\ncreate index auth_security_timeline_type_idx on auth_security_timeline (type);\ncreate index auth_security_timeline_category_idx on auth_security_timeline (category);\n\ncreate table auth_oauth_client (\n id text primary key,\n type text not null,\n status text not null,\n name text,\n redirect_uris text not null,\n allowed_grant_types text not null,\n allowed_response_types text not null,\n allowed_scopes text,\n created_at integer,\n updated_at integer,\n metadata text\n);\ncreate index auth_oauth_client_status_idx on auth_oauth_client (status);\n\ncreate table auth_oauth_consent (\n id text primary key,\n user_id text not null,\n client_id text not null,\n scopes text not null,\n granted_at integer not null,\n expires_at integer,\n revoked_at integer,\n metadata text\n);\ncreate unique index auth_oauth_consent_user_client_idx on auth_oauth_consent (user_id, client_id);\ncreate index auth_oauth_consent_user_id_idx on auth_oauth_consent (user_id);\ncreate index auth_oauth_consent_expires_at_idx on auth_oauth_consent (expires_at);\ncreate index auth_oauth_consent_revoked_at_idx on auth_oauth_consent (revoked_at);\n\ncreate table auth_oauth_authorization_code (\n code_hash text primary key,\n client_id text not null,\n subject text not null,\n redirect_uri text not null,\n scopes text not null,\n code_challenge text,\n code_challenge_method text,\n issued_at integer not null,\n expires_at integer not null,\n consumed_at integer,\n metadata text\n);\ncreate index auth_oauth_authorization_code_client_expires_at_idx on auth_oauth_authorization_code (client_id, expires_at);\ncreate index auth_oauth_authorization_code_expires_at_idx on auth_oauth_authorization_code (expires_at);\ncreate index auth_oauth_authorization_code_consumed_at_idx on auth_oauth_authorization_code (consumed_at);\n\ncreate table auth_oauth_client_secret (\n prefix text not null,\n client_id text not null,\n secret_hash text not null,\n authentication_methods text not null,\n created_at integer not null,\n expires_at integer,\n last_used_at integer,\n revoked_at integer,\n metadata text,\n primary key (client_id, prefix)\n);\n\ncreate table auth_oauth_provider_mode_token (\n token_hash text primary key,\n token_type text not null,\n client_id text not null,\n subject text not null,\n scopes text not null,\n issued_at integer not null,\n expires_at integer not null,\n issuer text,\n audience text,\n jwt_id text,\n revoked_at integer,\n revocation_reason text,\n rotated_at integer,\n replaced_by_token_hash text,\n metadata text\n);\ncreate index auth_oauth_provider_mode_token_client_expires_at_idx on auth_oauth_provider_mode_token (client_id, expires_at);\ncreate index auth_oauth_provider_mode_token_subject_idx on auth_oauth_provider_mode_token (subject);\ncreate index auth_oauth_provider_mode_token_expires_at_idx on auth_oauth_provider_mode_token (expires_at);\ncreate index auth_oauth_provider_mode_token_revoked_at_idx on auth_oauth_provider_mode_token (revoked_at);\ncreate index auth_oauth_provider_mode_token_rotated_at_idx on auth_oauth_provider_mode_token (rotated_at);\ncreate index auth_oauth_provider_mode_token_jwt_id_idx on auth_oauth_provider_mode_token (jwt_id);\n\ncreate table auth_oauth_provider_token_vault (\n account_id text primary key,\n user_id text not null,\n provider_id text not null,\n provider_account_id text not null,\n access_token_ciphertext text not null,\n refresh_token_ciphertext text,\n id_token_ciphertext text,\n token_type text not null,\n scopes text,\n expires_at integer,\n updated_at integer not null,\n revoked_at integer,\n revocation_reason text\n);\ncreate index auth_oauth_provider_token_vault_user_id_idx on auth_oauth_provider_token_vault (user_id);\ncreate index auth_oauth_provider_token_vault_provider_account_idx on auth_oauth_provider_token_vault (provider_id, provider_account_id);\ncreate index auth_oauth_provider_token_vault_expires_at_idx on auth_oauth_provider_token_vault (expires_at);\ncreate index auth_oauth_provider_token_vault_revoked_at_idx on auth_oauth_provider_token_vault (revoked_at);\n\ncreate table auth_permission_definition (\n id text primary key,\n description text,\n scope_type_present integer not null,\n scope_type text not null,\n created_at integer not null,\n updated_at integer not null,\n disabled_at integer,\n deleted_at integer\n);\n\ncreate table auth_role_definition (\n id text primary key,\n description text,\n created_at integer not null,\n updated_at integer not null,\n disabled_at integer,\n deleted_at integer\n);\n\ncreate table auth_permission_grant (\n subject_type text not null,\n subject_id text not null,\n permission_id text not null,\n scope_type text not null,\n scope_id_present integer not null,\n scope_id text not null,\n expires_at integer,\n metadata text,\n revoked_at integer,\n primary key (subject_type, subject_id, permission_id, scope_type, scope_id_present, scope_id)\n);\ncreate index auth_permission_grant_check_idx on auth_permission_grant (subject_type, subject_id, permission_id, revoked_at, expires_at);\n\ncreate table auth_role_grant (\n subject_type text not null,\n subject_id text not null,\n role_id text not null,\n scope_type text not null,\n scope_id_present integer not null,\n scope_id text not null,\n expires_at integer,\n metadata text,\n revoked_at integer,\n primary key (subject_type, subject_id, role_id, scope_type, scope_id_present, scope_id)\n);\ncreate index auth_role_grant_check_idx on auth_role_grant (subject_type, subject_id, role_id, revoked_at, expires_at);\n\ncreate table auth_role_permission (\n role_id text not null,\n permission_id text not null,\n scope_type_present integer not null,\n scope_type text not null,\n primary key (role_id, permission_id, scope_type_present, scope_type)\n);\ncreate index auth_role_permission_check_idx on auth_role_permission (permission_id, role_id, scope_type_present, scope_type);\n\ncreate table auth_oauth_device_authorization (\n id text primary key,\n device_code_hash text not null unique,\n user_code_hash text not null unique,\n client_id text not null,\n requested_scopes text not null check (json_valid(requested_scopes) and json_type(requested_scopes) = 'array'),\n granted_scopes text check (granted_scopes is null or (json_valid(granted_scopes) and json_type(granted_scopes) = 'array')),\n subject text,\n status text not null check (status in ('pending', 'approved', 'denied')),\n issued_at integer not null,\n expires_at integer not null,\n poll_interval_seconds integer not null check (poll_interval_seconds > 0),\n next_poll_at integer not null,\n last_polled_at integer,\n approved_at integer,\n denied_at integer,\n consumed_at integer,\n metadata text check (metadata is null or (json_valid(metadata) and json_type(metadata) = 'object')),\n check (\n (status = 'pending' and granted_scopes is null and subject is null and approved_at is null and denied_at is null and consumed_at is null)\n or (status = 'approved' and granted_scopes is not null and subject is not null and approved_at is not null and denied_at is null)\n or (status = 'denied' and granted_scopes is null and subject is null and approved_at is null and denied_at is not null and consumed_at is null)\n )\n);\ncreate index auth_oauth_device_authorization_expires_at_idx on auth_oauth_device_authorization (expires_at);\ncreate index auth_oauth_device_authorization_client_status_expires_at_idx on auth_oauth_device_authorization (client_id, status, expires_at);\ncreate index auth_oauth_device_authorization_status_expires_at_idx on auth_oauth_device_authorization (status, expires_at);\n";
|
|
2
|
+
//# sourceMappingURL=SqliteStorageSchemaData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SqliteStorageSchemaData.d.ts","sourceRoot":"","sources":["../src/SqliteStorageSchemaData.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB,0wkBAwfnC,CAAC"}
|