@secondlayer/shared 13.10.0 → 13.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/archive/range-digest.d.ts +78 -2
- package/dist/src/archive/semantic-digest-builder.d.ts +78 -2
- package/dist/src/coverage/index.d.ts +78 -2
- package/dist/src/db/index.d.ts +87 -3
- package/dist/src/db/index.js +7 -1
- package/dist/src/db/index.js.map +3 -3
- package/dist/src/db/queries/chain-reorgs.d.ts +78 -2
- package/dist/src/db/queries/chain-reorgs.js +7 -1
- package/dist/src/db/queries/chain-reorgs.js.map +3 -3
- package/dist/src/db/queries/contracts.d.ts +78 -2
- package/dist/src/db/queries/instance.d.ts +78 -2
- package/dist/src/db/queries/integrity.d.ts +78 -2
- package/dist/src/db/queries/subgraph-gaps.d.ts +78 -2
- package/dist/src/db/queries/subgraph-operations.d.ts +78 -2
- package/dist/src/db/queries/subgraphs.d.ts +78 -2
- package/dist/src/db/queries/sync-scope.d.ts +78 -2
- package/dist/src/db/queries/webhooks.d.ts +78 -2
- package/dist/src/db/schema.d.ts +81 -3
- package/dist/src/index.d.ts +87 -3
- package/dist/src/index.js +7 -1
- package/dist/src/index.js.map +3 -3
- package/dist/src/insights/index.d.ts +78 -2
- package/dist/src/node/local-client.d.ts +78 -2
- package/dist/src/queue/listener.js +7 -1
- package/dist/src/queue/listener.js.map +3 -3
- package/migrations/0176_cli_device_logins_product.ts +25 -0
- package/migrations/0177_oauth_mcp.ts +122 -0
- package/package.json +1 -1
|
@@ -928,6 +928,12 @@ interface Database {
|
|
|
928
928
|
account_balance_alerts: AccountBalanceAlertsTable;
|
|
929
929
|
webhook_incident_alerts: WebhookIncidentAlertsTable;
|
|
930
930
|
cli_device_logins: CliDeviceLoginsTable;
|
|
931
|
+
oauth_clients: OauthClientsTable;
|
|
932
|
+
oauth_requests: OauthRequestsTable;
|
|
933
|
+
oauth_codes: OauthCodesTable;
|
|
934
|
+
oauth_grants: OauthGrantsTable;
|
|
935
|
+
oauth_tokens: OauthTokensTable;
|
|
936
|
+
oauth_refresh_retired: OauthRefreshRetiredTable;
|
|
931
937
|
sentinel_accounts: SentinelAccountsTable;
|
|
932
938
|
waitlists: WaitlistsTable;
|
|
933
939
|
waitlist_signups: WaitlistSignupsTable;
|
|
@@ -1030,13 +1036,17 @@ interface WebhookIncidentAlertsTable {
|
|
|
1030
1036
|
resolved_at: Date | null;
|
|
1031
1037
|
}
|
|
1032
1038
|
type CliDeviceLoginStatus = "pending" | "approved" | "denied" | "consumed";
|
|
1033
|
-
/**
|
|
1034
|
-
|
|
1039
|
+
/** The product that started a CLI sign-in; null is `sl login`. */
|
|
1040
|
+
type CliDeviceProduct = "sentinel";
|
|
1041
|
+
/** One browser sign-in attempt from `sl login` (or `sentinel login`). Only the
|
|
1042
|
+
* hash of the CLI's device code is stored; the session is opened when the CLI
|
|
1043
|
+
* polls after approval. */
|
|
1035
1044
|
interface CliDeviceLoginsTable {
|
|
1036
1045
|
id: Generated<string>;
|
|
1037
1046
|
device_code_hash: string;
|
|
1038
1047
|
user_code: string;
|
|
1039
1048
|
client_name: string;
|
|
1049
|
+
product: CliDeviceProduct | null;
|
|
1040
1050
|
status: Generated<CliDeviceLoginStatus>;
|
|
1041
1051
|
account_id: string | null;
|
|
1042
1052
|
key_name: string | null;
|
|
@@ -1045,6 +1055,72 @@ interface CliDeviceLoginsTable {
|
|
|
1045
1055
|
approved_at: Date | null;
|
|
1046
1056
|
consumed_at: Date | null;
|
|
1047
1057
|
}
|
|
1058
|
+
/** An app that registered itself (RFC 7591). Public clients only: no secret. */
|
|
1059
|
+
interface OauthClientsTable {
|
|
1060
|
+
id: string;
|
|
1061
|
+
/** The app's own claim, validated at registration; shown quoted. */
|
|
1062
|
+
name: string;
|
|
1063
|
+
redirect_uris: string[];
|
|
1064
|
+
created_ip: string | null;
|
|
1065
|
+
created_at: Generated<Date>;
|
|
1066
|
+
/** Set when it first gets tokens; never-used clients are purged. */
|
|
1067
|
+
last_used_at: Date | null;
|
|
1068
|
+
}
|
|
1069
|
+
type OauthRequestStatus = "pending" | "approved" | "denied";
|
|
1070
|
+
/** One authorize request waiting for (or answered on) the consent page. */
|
|
1071
|
+
interface OauthRequestsTable {
|
|
1072
|
+
id: string;
|
|
1073
|
+
client_id: string;
|
|
1074
|
+
redirect_uri: string;
|
|
1075
|
+
state: string | null;
|
|
1076
|
+
code_challenge: string;
|
|
1077
|
+
resource: string;
|
|
1078
|
+
status: Generated<OauthRequestStatus>;
|
|
1079
|
+
account_id: string | null;
|
|
1080
|
+
created_at: Generated<Date>;
|
|
1081
|
+
expires_at: Date;
|
|
1082
|
+
answered_at: Date | null;
|
|
1083
|
+
}
|
|
1084
|
+
/** A one-time authorization code, bound to its client, redirect, PKCE
|
|
1085
|
+
* challenge, resource and account. */
|
|
1086
|
+
interface OauthCodesTable {
|
|
1087
|
+
code_hash: string;
|
|
1088
|
+
client_id: string;
|
|
1089
|
+
account_id: string;
|
|
1090
|
+
redirect_uri: string;
|
|
1091
|
+
code_challenge: string;
|
|
1092
|
+
resource: string;
|
|
1093
|
+
/** The grant its one use made, so a replay can revoke it. */
|
|
1094
|
+
grant_id: string | null;
|
|
1095
|
+
created_at: Generated<Date>;
|
|
1096
|
+
expires_at: Date;
|
|
1097
|
+
used_at: Date | null;
|
|
1098
|
+
}
|
|
1099
|
+
/** What a person allowed one app to do: use the hosted MCP as them. */
|
|
1100
|
+
interface OauthGrantsTable {
|
|
1101
|
+
id: Generated<string>;
|
|
1102
|
+
account_id: string;
|
|
1103
|
+
client_id: string;
|
|
1104
|
+
scope: Generated<string>;
|
|
1105
|
+
resource: string;
|
|
1106
|
+
created_at: Generated<Date>;
|
|
1107
|
+
last_used_at: Date | null;
|
|
1108
|
+
revoked_at: Date | null;
|
|
1109
|
+
}
|
|
1110
|
+
type OauthTokenKind = "access" | "refresh";
|
|
1111
|
+
interface OauthTokensTable {
|
|
1112
|
+
token_hash: string;
|
|
1113
|
+
grant_id: string;
|
|
1114
|
+
kind: OauthTokenKind;
|
|
1115
|
+
created_at: Generated<Date>;
|
|
1116
|
+
expires_at: Date;
|
|
1117
|
+
}
|
|
1118
|
+
/** A refresh token a rotation replaced: presented again, it revokes the grant. */
|
|
1119
|
+
interface OauthRefreshRetiredTable {
|
|
1120
|
+
token_hash: string;
|
|
1121
|
+
grant_id: string;
|
|
1122
|
+
retired_at: Generated<Date>;
|
|
1123
|
+
}
|
|
1048
1124
|
/** Accounts Sentinel's service key may touch: created by Sentinel, or the
|
|
1049
1125
|
* owner opted in. */
|
|
1050
1126
|
interface SentinelAccountsTable {
|
|
@@ -928,6 +928,12 @@ interface Database {
|
|
|
928
928
|
account_balance_alerts: AccountBalanceAlertsTable;
|
|
929
929
|
webhook_incident_alerts: WebhookIncidentAlertsTable;
|
|
930
930
|
cli_device_logins: CliDeviceLoginsTable;
|
|
931
|
+
oauth_clients: OauthClientsTable;
|
|
932
|
+
oauth_requests: OauthRequestsTable;
|
|
933
|
+
oauth_codes: OauthCodesTable;
|
|
934
|
+
oauth_grants: OauthGrantsTable;
|
|
935
|
+
oauth_tokens: OauthTokensTable;
|
|
936
|
+
oauth_refresh_retired: OauthRefreshRetiredTable;
|
|
931
937
|
sentinel_accounts: SentinelAccountsTable;
|
|
932
938
|
waitlists: WaitlistsTable;
|
|
933
939
|
waitlist_signups: WaitlistSignupsTable;
|
|
@@ -1030,13 +1036,17 @@ interface WebhookIncidentAlertsTable {
|
|
|
1030
1036
|
resolved_at: Date | null;
|
|
1031
1037
|
}
|
|
1032
1038
|
type CliDeviceLoginStatus = "pending" | "approved" | "denied" | "consumed";
|
|
1033
|
-
/**
|
|
1034
|
-
|
|
1039
|
+
/** The product that started a CLI sign-in; null is `sl login`. */
|
|
1040
|
+
type CliDeviceProduct = "sentinel";
|
|
1041
|
+
/** One browser sign-in attempt from `sl login` (or `sentinel login`). Only the
|
|
1042
|
+
* hash of the CLI's device code is stored; the session is opened when the CLI
|
|
1043
|
+
* polls after approval. */
|
|
1035
1044
|
interface CliDeviceLoginsTable {
|
|
1036
1045
|
id: Generated<string>;
|
|
1037
1046
|
device_code_hash: string;
|
|
1038
1047
|
user_code: string;
|
|
1039
1048
|
client_name: string;
|
|
1049
|
+
product: CliDeviceProduct | null;
|
|
1040
1050
|
status: Generated<CliDeviceLoginStatus>;
|
|
1041
1051
|
account_id: string | null;
|
|
1042
1052
|
key_name: string | null;
|
|
@@ -1045,6 +1055,72 @@ interface CliDeviceLoginsTable {
|
|
|
1045
1055
|
approved_at: Date | null;
|
|
1046
1056
|
consumed_at: Date | null;
|
|
1047
1057
|
}
|
|
1058
|
+
/** An app that registered itself (RFC 7591). Public clients only: no secret. */
|
|
1059
|
+
interface OauthClientsTable {
|
|
1060
|
+
id: string;
|
|
1061
|
+
/** The app's own claim, validated at registration; shown quoted. */
|
|
1062
|
+
name: string;
|
|
1063
|
+
redirect_uris: string[];
|
|
1064
|
+
created_ip: string | null;
|
|
1065
|
+
created_at: Generated<Date>;
|
|
1066
|
+
/** Set when it first gets tokens; never-used clients are purged. */
|
|
1067
|
+
last_used_at: Date | null;
|
|
1068
|
+
}
|
|
1069
|
+
type OauthRequestStatus = "pending" | "approved" | "denied";
|
|
1070
|
+
/** One authorize request waiting for (or answered on) the consent page. */
|
|
1071
|
+
interface OauthRequestsTable {
|
|
1072
|
+
id: string;
|
|
1073
|
+
client_id: string;
|
|
1074
|
+
redirect_uri: string;
|
|
1075
|
+
state: string | null;
|
|
1076
|
+
code_challenge: string;
|
|
1077
|
+
resource: string;
|
|
1078
|
+
status: Generated<OauthRequestStatus>;
|
|
1079
|
+
account_id: string | null;
|
|
1080
|
+
created_at: Generated<Date>;
|
|
1081
|
+
expires_at: Date;
|
|
1082
|
+
answered_at: Date | null;
|
|
1083
|
+
}
|
|
1084
|
+
/** A one-time authorization code, bound to its client, redirect, PKCE
|
|
1085
|
+
* challenge, resource and account. */
|
|
1086
|
+
interface OauthCodesTable {
|
|
1087
|
+
code_hash: string;
|
|
1088
|
+
client_id: string;
|
|
1089
|
+
account_id: string;
|
|
1090
|
+
redirect_uri: string;
|
|
1091
|
+
code_challenge: string;
|
|
1092
|
+
resource: string;
|
|
1093
|
+
/** The grant its one use made, so a replay can revoke it. */
|
|
1094
|
+
grant_id: string | null;
|
|
1095
|
+
created_at: Generated<Date>;
|
|
1096
|
+
expires_at: Date;
|
|
1097
|
+
used_at: Date | null;
|
|
1098
|
+
}
|
|
1099
|
+
/** What a person allowed one app to do: use the hosted MCP as them. */
|
|
1100
|
+
interface OauthGrantsTable {
|
|
1101
|
+
id: Generated<string>;
|
|
1102
|
+
account_id: string;
|
|
1103
|
+
client_id: string;
|
|
1104
|
+
scope: Generated<string>;
|
|
1105
|
+
resource: string;
|
|
1106
|
+
created_at: Generated<Date>;
|
|
1107
|
+
last_used_at: Date | null;
|
|
1108
|
+
revoked_at: Date | null;
|
|
1109
|
+
}
|
|
1110
|
+
type OauthTokenKind = "access" | "refresh";
|
|
1111
|
+
interface OauthTokensTable {
|
|
1112
|
+
token_hash: string;
|
|
1113
|
+
grant_id: string;
|
|
1114
|
+
kind: OauthTokenKind;
|
|
1115
|
+
created_at: Generated<Date>;
|
|
1116
|
+
expires_at: Date;
|
|
1117
|
+
}
|
|
1118
|
+
/** A refresh token a rotation replaced: presented again, it revokes the grant. */
|
|
1119
|
+
interface OauthRefreshRetiredTable {
|
|
1120
|
+
token_hash: string;
|
|
1121
|
+
grant_id: string;
|
|
1122
|
+
retired_at: Generated<Date>;
|
|
1123
|
+
}
|
|
1048
1124
|
/** Accounts Sentinel's service key may touch: created by Sentinel, or the
|
|
1049
1125
|
* owner opted in. */
|
|
1050
1126
|
interface SentinelAccountsTable {
|
|
@@ -1245,6 +1245,12 @@ interface Database {
|
|
|
1245
1245
|
account_balance_alerts: AccountBalanceAlertsTable;
|
|
1246
1246
|
webhook_incident_alerts: WebhookIncidentAlertsTable;
|
|
1247
1247
|
cli_device_logins: CliDeviceLoginsTable;
|
|
1248
|
+
oauth_clients: OauthClientsTable;
|
|
1249
|
+
oauth_requests: OauthRequestsTable;
|
|
1250
|
+
oauth_codes: OauthCodesTable;
|
|
1251
|
+
oauth_grants: OauthGrantsTable;
|
|
1252
|
+
oauth_tokens: OauthTokensTable;
|
|
1253
|
+
oauth_refresh_retired: OauthRefreshRetiredTable;
|
|
1248
1254
|
sentinel_accounts: SentinelAccountsTable;
|
|
1249
1255
|
waitlists: WaitlistsTable;
|
|
1250
1256
|
waitlist_signups: WaitlistSignupsTable;
|
|
@@ -1347,13 +1353,17 @@ interface WebhookIncidentAlertsTable {
|
|
|
1347
1353
|
resolved_at: Date | null;
|
|
1348
1354
|
}
|
|
1349
1355
|
type CliDeviceLoginStatus = "pending" | "approved" | "denied" | "consumed";
|
|
1350
|
-
/**
|
|
1351
|
-
|
|
1356
|
+
/** The product that started a CLI sign-in; null is `sl login`. */
|
|
1357
|
+
type CliDeviceProduct = "sentinel";
|
|
1358
|
+
/** One browser sign-in attempt from `sl login` (or `sentinel login`). Only the
|
|
1359
|
+
* hash of the CLI's device code is stored; the session is opened when the CLI
|
|
1360
|
+
* polls after approval. */
|
|
1352
1361
|
interface CliDeviceLoginsTable {
|
|
1353
1362
|
id: Generated<string>;
|
|
1354
1363
|
device_code_hash: string;
|
|
1355
1364
|
user_code: string;
|
|
1356
1365
|
client_name: string;
|
|
1366
|
+
product: CliDeviceProduct | null;
|
|
1357
1367
|
status: Generated<CliDeviceLoginStatus>;
|
|
1358
1368
|
account_id: string | null;
|
|
1359
1369
|
key_name: string | null;
|
|
@@ -1362,6 +1372,72 @@ interface CliDeviceLoginsTable {
|
|
|
1362
1372
|
approved_at: Date | null;
|
|
1363
1373
|
consumed_at: Date | null;
|
|
1364
1374
|
}
|
|
1375
|
+
/** An app that registered itself (RFC 7591). Public clients only: no secret. */
|
|
1376
|
+
interface OauthClientsTable {
|
|
1377
|
+
id: string;
|
|
1378
|
+
/** The app's own claim, validated at registration; shown quoted. */
|
|
1379
|
+
name: string;
|
|
1380
|
+
redirect_uris: string[];
|
|
1381
|
+
created_ip: string | null;
|
|
1382
|
+
created_at: Generated<Date>;
|
|
1383
|
+
/** Set when it first gets tokens; never-used clients are purged. */
|
|
1384
|
+
last_used_at: Date | null;
|
|
1385
|
+
}
|
|
1386
|
+
type OauthRequestStatus = "pending" | "approved" | "denied";
|
|
1387
|
+
/** One authorize request waiting for (or answered on) the consent page. */
|
|
1388
|
+
interface OauthRequestsTable {
|
|
1389
|
+
id: string;
|
|
1390
|
+
client_id: string;
|
|
1391
|
+
redirect_uri: string;
|
|
1392
|
+
state: string | null;
|
|
1393
|
+
code_challenge: string;
|
|
1394
|
+
resource: string;
|
|
1395
|
+
status: Generated<OauthRequestStatus>;
|
|
1396
|
+
account_id: string | null;
|
|
1397
|
+
created_at: Generated<Date>;
|
|
1398
|
+
expires_at: Date;
|
|
1399
|
+
answered_at: Date | null;
|
|
1400
|
+
}
|
|
1401
|
+
/** A one-time authorization code, bound to its client, redirect, PKCE
|
|
1402
|
+
* challenge, resource and account. */
|
|
1403
|
+
interface OauthCodesTable {
|
|
1404
|
+
code_hash: string;
|
|
1405
|
+
client_id: string;
|
|
1406
|
+
account_id: string;
|
|
1407
|
+
redirect_uri: string;
|
|
1408
|
+
code_challenge: string;
|
|
1409
|
+
resource: string;
|
|
1410
|
+
/** The grant its one use made, so a replay can revoke it. */
|
|
1411
|
+
grant_id: string | null;
|
|
1412
|
+
created_at: Generated<Date>;
|
|
1413
|
+
expires_at: Date;
|
|
1414
|
+
used_at: Date | null;
|
|
1415
|
+
}
|
|
1416
|
+
/** What a person allowed one app to do: use the hosted MCP as them. */
|
|
1417
|
+
interface OauthGrantsTable {
|
|
1418
|
+
id: Generated<string>;
|
|
1419
|
+
account_id: string;
|
|
1420
|
+
client_id: string;
|
|
1421
|
+
scope: Generated<string>;
|
|
1422
|
+
resource: string;
|
|
1423
|
+
created_at: Generated<Date>;
|
|
1424
|
+
last_used_at: Date | null;
|
|
1425
|
+
revoked_at: Date | null;
|
|
1426
|
+
}
|
|
1427
|
+
type OauthTokenKind = "access" | "refresh";
|
|
1428
|
+
interface OauthTokensTable {
|
|
1429
|
+
token_hash: string;
|
|
1430
|
+
grant_id: string;
|
|
1431
|
+
kind: OauthTokenKind;
|
|
1432
|
+
created_at: Generated<Date>;
|
|
1433
|
+
expires_at: Date;
|
|
1434
|
+
}
|
|
1435
|
+
/** A refresh token a rotation replaced: presented again, it revokes the grant. */
|
|
1436
|
+
interface OauthRefreshRetiredTable {
|
|
1437
|
+
token_hash: string;
|
|
1438
|
+
grant_id: string;
|
|
1439
|
+
retired_at: Generated<Date>;
|
|
1440
|
+
}
|
|
1365
1441
|
/** Accounts Sentinel's service key may touch: created by Sentinel, or the
|
|
1366
1442
|
* owner opted in. */
|
|
1367
1443
|
interface SentinelAccountsTable {
|
package/dist/src/db/index.d.ts
CHANGED
|
@@ -929,6 +929,12 @@ interface Database {
|
|
|
929
929
|
account_balance_alerts: AccountBalanceAlertsTable;
|
|
930
930
|
webhook_incident_alerts: WebhookIncidentAlertsTable;
|
|
931
931
|
cli_device_logins: CliDeviceLoginsTable;
|
|
932
|
+
oauth_clients: OauthClientsTable;
|
|
933
|
+
oauth_requests: OauthRequestsTable;
|
|
934
|
+
oauth_codes: OauthCodesTable;
|
|
935
|
+
oauth_grants: OauthGrantsTable;
|
|
936
|
+
oauth_tokens: OauthTokensTable;
|
|
937
|
+
oauth_refresh_retired: OauthRefreshRetiredTable;
|
|
932
938
|
sentinel_accounts: SentinelAccountsTable;
|
|
933
939
|
waitlists: WaitlistsTable;
|
|
934
940
|
waitlist_signups: WaitlistSignupsTable;
|
|
@@ -1044,13 +1050,17 @@ interface WebhookIncidentAlertsTable {
|
|
|
1044
1050
|
}
|
|
1045
1051
|
type WebhookIncidentAlert = Selectable<WebhookIncidentAlertsTable>;
|
|
1046
1052
|
type CliDeviceLoginStatus = "pending" | "approved" | "denied" | "consumed";
|
|
1047
|
-
/**
|
|
1048
|
-
|
|
1053
|
+
/** The product that started a CLI sign-in; null is `sl login`. */
|
|
1054
|
+
type CliDeviceProduct = "sentinel";
|
|
1055
|
+
/** One browser sign-in attempt from `sl login` (or `sentinel login`). Only the
|
|
1056
|
+
* hash of the CLI's device code is stored; the session is opened when the CLI
|
|
1057
|
+
* polls after approval. */
|
|
1049
1058
|
interface CliDeviceLoginsTable {
|
|
1050
1059
|
id: Generated<string>;
|
|
1051
1060
|
device_code_hash: string;
|
|
1052
1061
|
user_code: string;
|
|
1053
1062
|
client_name: string;
|
|
1063
|
+
product: CliDeviceProduct | null;
|
|
1054
1064
|
status: Generated<CliDeviceLoginStatus>;
|
|
1055
1065
|
account_id: string | null;
|
|
1056
1066
|
key_name: string | null;
|
|
@@ -1060,6 +1070,74 @@ interface CliDeviceLoginsTable {
|
|
|
1060
1070
|
consumed_at: Date | null;
|
|
1061
1071
|
}
|
|
1062
1072
|
type CliDeviceLogin = Selectable<CliDeviceLoginsTable>;
|
|
1073
|
+
/** An app that registered itself (RFC 7591). Public clients only: no secret. */
|
|
1074
|
+
interface OauthClientsTable {
|
|
1075
|
+
id: string;
|
|
1076
|
+
/** The app's own claim, validated at registration; shown quoted. */
|
|
1077
|
+
name: string;
|
|
1078
|
+
redirect_uris: string[];
|
|
1079
|
+
created_ip: string | null;
|
|
1080
|
+
created_at: Generated<Date>;
|
|
1081
|
+
/** Set when it first gets tokens; never-used clients are purged. */
|
|
1082
|
+
last_used_at: Date | null;
|
|
1083
|
+
}
|
|
1084
|
+
type OauthRequestStatus = "pending" | "approved" | "denied";
|
|
1085
|
+
/** One authorize request waiting for (or answered on) the consent page. */
|
|
1086
|
+
interface OauthRequestsTable {
|
|
1087
|
+
id: string;
|
|
1088
|
+
client_id: string;
|
|
1089
|
+
redirect_uri: string;
|
|
1090
|
+
state: string | null;
|
|
1091
|
+
code_challenge: string;
|
|
1092
|
+
resource: string;
|
|
1093
|
+
status: Generated<OauthRequestStatus>;
|
|
1094
|
+
account_id: string | null;
|
|
1095
|
+
created_at: Generated<Date>;
|
|
1096
|
+
expires_at: Date;
|
|
1097
|
+
answered_at: Date | null;
|
|
1098
|
+
}
|
|
1099
|
+
/** A one-time authorization code, bound to its client, redirect, PKCE
|
|
1100
|
+
* challenge, resource and account. */
|
|
1101
|
+
interface OauthCodesTable {
|
|
1102
|
+
code_hash: string;
|
|
1103
|
+
client_id: string;
|
|
1104
|
+
account_id: string;
|
|
1105
|
+
redirect_uri: string;
|
|
1106
|
+
code_challenge: string;
|
|
1107
|
+
resource: string;
|
|
1108
|
+
/** The grant its one use made, so a replay can revoke it. */
|
|
1109
|
+
grant_id: string | null;
|
|
1110
|
+
created_at: Generated<Date>;
|
|
1111
|
+
expires_at: Date;
|
|
1112
|
+
used_at: Date | null;
|
|
1113
|
+
}
|
|
1114
|
+
/** What a person allowed one app to do: use the hosted MCP as them. */
|
|
1115
|
+
interface OauthGrantsTable {
|
|
1116
|
+
id: Generated<string>;
|
|
1117
|
+
account_id: string;
|
|
1118
|
+
client_id: string;
|
|
1119
|
+
scope: Generated<string>;
|
|
1120
|
+
resource: string;
|
|
1121
|
+
created_at: Generated<Date>;
|
|
1122
|
+
last_used_at: Date | null;
|
|
1123
|
+
revoked_at: Date | null;
|
|
1124
|
+
}
|
|
1125
|
+
type OauthTokenKind = "access" | "refresh";
|
|
1126
|
+
interface OauthTokensTable {
|
|
1127
|
+
token_hash: string;
|
|
1128
|
+
grant_id: string;
|
|
1129
|
+
kind: OauthTokenKind;
|
|
1130
|
+
created_at: Generated<Date>;
|
|
1131
|
+
expires_at: Date;
|
|
1132
|
+
}
|
|
1133
|
+
/** A refresh token a rotation replaced: presented again, it revokes the grant. */
|
|
1134
|
+
interface OauthRefreshRetiredTable {
|
|
1135
|
+
token_hash: string;
|
|
1136
|
+
grant_id: string;
|
|
1137
|
+
retired_at: Generated<Date>;
|
|
1138
|
+
}
|
|
1139
|
+
type OauthClient = Selectable<OauthClientsTable>;
|
|
1140
|
+
type OauthGrant = Selectable<OauthGrantsTable>;
|
|
1063
1141
|
/** Accounts Sentinel's service key may touch: created by Sentinel, or the
|
|
1064
1142
|
* owner opted in. */
|
|
1065
1143
|
interface SentinelAccountsTable {
|
|
@@ -2269,6 +2347,12 @@ declare const TABLE_TO_DB: {
|
|
|
2269
2347
|
sessions: string
|
|
2270
2348
|
magic_links: string
|
|
2271
2349
|
cli_device_logins: string
|
|
2350
|
+
oauth_clients: string
|
|
2351
|
+
oauth_requests: string
|
|
2352
|
+
oauth_codes: string
|
|
2353
|
+
oauth_grants: string
|
|
2354
|
+
oauth_tokens: string
|
|
2355
|
+
oauth_refresh_retired: string
|
|
2272
2356
|
account_spend_caps: string
|
|
2273
2357
|
processed_stripe_events: string
|
|
2274
2358
|
webhooks: string
|
|
@@ -2388,4 +2472,4 @@ declare function closeDb(): Promise<void>;
|
|
|
2388
2472
|
* actual work is done.
|
|
2389
2473
|
*/
|
|
2390
2474
|
declare function closeDbOrTimeout(timeoutMs?: number, closeFn?: () => Promise<void>): Promise<void>;
|
|
2391
|
-
export { Account, AccountBalanceAlerts, AccountBalanceAlertsTable, AccountCredits, AccountCreditsTable, AccountSpendCap, AccountSpendCapsTable, AccountsTable, ApiFailedRequest, ApiFailedRequestsTable, ApiKey, ApiKeysTable, ApiRequestLogRow, ApiRequestLogTable, ArchiveFetch, ArchiveFetchesTable, Block, BlocksTable, BnsMarketplaceAction, BnsMarketplaceEventsTable, BnsNameEventTopic, BnsNameEventsTable, BnsNamesTable, BnsNamespaceEventStatus, BnsNamespaceEventsTable, BnsNamespacesTable, BurnBlockRewardSlotsTable, BurnBlockRewardsTable, ChainReadCacheTable, ChainReorgsTable, CliDeviceLogin, CliDeviceLoginStatus, CliDeviceLoginsTable, ContactRequest, ContactRequestsTable, Contract, ContractsTable, CoverageSegmentsTable, Database, DbPlane, DbReadRow, DbSplitStatus, DeadLetterEventsTable, DecodedEventsTable, DecoderCheckpointsTable, Event, EventsArchiveTable, EventsTable, FailureClass, FailureUnit, FeedbackTicket, FeedbackTicketsTable, IndexColumn, IndexColumnType, IndexPrimaryKey, IndexProgress, IndexProgressTable, InsertAccount, InsertAccountBalanceAlerts, InsertAccountCredits, InsertAccountSpendCap, InsertApiFailedRequest, InsertApiKey, InsertApiRequestLogRow, InsertArchiveFetch, InsertBlock, InsertContactRequest, InsertContract, InsertEvent, InsertFeedbackTicket, InsertIndexProgress, InsertMagicLink, InsertMempoolTransaction, InsertSession, InsertStateWrite, InsertSubgraph, InsertSubgraphGap, InsertSubgraphHealthSnapshot, InsertSubgraphOperation, InsertTransaction, InsertUsageLedgerRow, InsertVmEvent, InsertWaitlistSignup, InsertWebhook, InsertWebhookDelivery, InsertWebhookOutbox, InsightMutesTable, InsightsTable, InstancesTable, MagicLink, MagicLinksTable, MempoolTransaction, MempoolTransactionsTable, MigrationRole, NativeClock, NumericAsText, ObserverJournalStatus, ObserverJournalTable, OutboxStatus, PendingForkBlocksTable, Pox4CallsTable, Pox4FunctionName, Pox5CycleSignersTable, Pox5CyclesTable, Pox5EventTopic, Pox5EventsTable, ProcessedStripeEventsTable, RepairMode, RetryState, RunStatus, SOURCE_READ_COLUMNS, SOURCE_READ_PKS, SOURCE_READ_TYPES, SbtcEventTopic, SbtcEventsTable, SbtcSettlementsTable, SbtcTokenEventType, SbtcTokenEventsTable, SentinelAccount, SentinelAccountsTable, ServiceHeartbeatsTable, Session, SessionsTable, StageBlockReceiptsTable, StageFailuresTable, StageKind, StageRegistryTable, StageRunsTable, StateWrite, StateWritesArchiveTable, StateWritesTable, Subgraph, SubgraphErrorGroupsTable, SubgraphGap, SubgraphGapsTable, SubgraphHealthSnapshot, SubgraphHealthSnapshotsTable, SubgraphOperation, SubgraphOperationKind, SubgraphOperationStatus, SubgraphOperationsTable, SubgraphProcessingStatsTable, SubgraphViolationsTable, SubgraphsTable, SyncScopesTable, TABLE_TO_DB, Transaction, TransactionsArchiveTable, TransactionsTable, TriggerEvaluatorState, TriggerEvaluatorStateTable, UpdateAccountBalanceAlerts, UpdateAccountCredits, UpdateAccountSpendCap, UpdateApiKey, UpdateArchiveFetch, UpdateBlock, UpdateContract, UpdateEvent, UpdateIndexProgress, UpdateSubgraph, UpdateSubgraphOperation, UpdateTransaction, UpdateUsageLedgerRow, UpdateVmEvent, UpdateWebhook, UpdateWebhookOutbox, UsageLedgerRow, UsageLedgerTable, VmEvent, VmEventsArchiveTable, VmEventsTable, Waitlist, WaitlistSignup, WaitlistSignupsTable, WaitlistsTable, Webhook, WebhookDeliveriesTable, WebhookDelivery, WebhookFormat, WebhookIncidentAlert, WebhookIncidentAlertsTable, WebhookKind, WebhookOutbox, WebhookOutboxTable, WebhookStatus, WebhooksTable, applicationDatabaseUrl, assertDbSplit, closeDb, closeDbOrTimeout, describeDbUrl, getDb, getDbSplitStatus, getMigrationRole, getRawClient, getSourceDb, getTargetDb, jsonb, onChainPlane, onControlPlane, parseJsonb, resolveSourceUrl, resolveTargetUrl, setMigrationRole, sql };
|
|
2475
|
+
export { Account, AccountBalanceAlerts, AccountBalanceAlertsTable, AccountCredits, AccountCreditsTable, AccountSpendCap, AccountSpendCapsTable, AccountsTable, ApiFailedRequest, ApiFailedRequestsTable, ApiKey, ApiKeysTable, ApiRequestLogRow, ApiRequestLogTable, ArchiveFetch, ArchiveFetchesTable, Block, BlocksTable, BnsMarketplaceAction, BnsMarketplaceEventsTable, BnsNameEventTopic, BnsNameEventsTable, BnsNamesTable, BnsNamespaceEventStatus, BnsNamespaceEventsTable, BnsNamespacesTable, BurnBlockRewardSlotsTable, BurnBlockRewardsTable, ChainReadCacheTable, ChainReorgsTable, CliDeviceLogin, CliDeviceLoginStatus, CliDeviceLoginsTable, CliDeviceProduct, ContactRequest, ContactRequestsTable, Contract, ContractsTable, CoverageSegmentsTable, Database, DbPlane, DbReadRow, DbSplitStatus, DeadLetterEventsTable, DecodedEventsTable, DecoderCheckpointsTable, Event, EventsArchiveTable, EventsTable, FailureClass, FailureUnit, FeedbackTicket, FeedbackTicketsTable, IndexColumn, IndexColumnType, IndexPrimaryKey, IndexProgress, IndexProgressTable, InsertAccount, InsertAccountBalanceAlerts, InsertAccountCredits, InsertAccountSpendCap, InsertApiFailedRequest, InsertApiKey, InsertApiRequestLogRow, InsertArchiveFetch, InsertBlock, InsertContactRequest, InsertContract, InsertEvent, InsertFeedbackTicket, InsertIndexProgress, InsertMagicLink, InsertMempoolTransaction, InsertSession, InsertStateWrite, InsertSubgraph, InsertSubgraphGap, InsertSubgraphHealthSnapshot, InsertSubgraphOperation, InsertTransaction, InsertUsageLedgerRow, InsertVmEvent, InsertWaitlistSignup, InsertWebhook, InsertWebhookDelivery, InsertWebhookOutbox, InsightMutesTable, InsightsTable, InstancesTable, MagicLink, MagicLinksTable, MempoolTransaction, MempoolTransactionsTable, MigrationRole, NativeClock, NumericAsText, OauthClient, OauthClientsTable, OauthCodesTable, OauthGrant, OauthGrantsTable, OauthRefreshRetiredTable, OauthRequestStatus, OauthRequestsTable, OauthTokenKind, OauthTokensTable, ObserverJournalStatus, ObserverJournalTable, OutboxStatus, PendingForkBlocksTable, Pox4CallsTable, Pox4FunctionName, Pox5CycleSignersTable, Pox5CyclesTable, Pox5EventTopic, Pox5EventsTable, ProcessedStripeEventsTable, RepairMode, RetryState, RunStatus, SOURCE_READ_COLUMNS, SOURCE_READ_PKS, SOURCE_READ_TYPES, SbtcEventTopic, SbtcEventsTable, SbtcSettlementsTable, SbtcTokenEventType, SbtcTokenEventsTable, SentinelAccount, SentinelAccountsTable, ServiceHeartbeatsTable, Session, SessionsTable, StageBlockReceiptsTable, StageFailuresTable, StageKind, StageRegistryTable, StageRunsTable, StateWrite, StateWritesArchiveTable, StateWritesTable, Subgraph, SubgraphErrorGroupsTable, SubgraphGap, SubgraphGapsTable, SubgraphHealthSnapshot, SubgraphHealthSnapshotsTable, SubgraphOperation, SubgraphOperationKind, SubgraphOperationStatus, SubgraphOperationsTable, SubgraphProcessingStatsTable, SubgraphViolationsTable, SubgraphsTable, SyncScopesTable, TABLE_TO_DB, Transaction, TransactionsArchiveTable, TransactionsTable, TriggerEvaluatorState, TriggerEvaluatorStateTable, UpdateAccountBalanceAlerts, UpdateAccountCredits, UpdateAccountSpendCap, UpdateApiKey, UpdateArchiveFetch, UpdateBlock, UpdateContract, UpdateEvent, UpdateIndexProgress, UpdateSubgraph, UpdateSubgraphOperation, UpdateTransaction, UpdateUsageLedgerRow, UpdateVmEvent, UpdateWebhook, UpdateWebhookOutbox, UsageLedgerRow, UsageLedgerTable, VmEvent, VmEventsArchiveTable, VmEventsTable, Waitlist, WaitlistSignup, WaitlistSignupsTable, WaitlistsTable, Webhook, WebhookDeliveriesTable, WebhookDelivery, WebhookFormat, WebhookIncidentAlert, WebhookIncidentAlertsTable, WebhookKind, WebhookOutbox, WebhookOutboxTable, WebhookStatus, WebhooksTable, applicationDatabaseUrl, assertDbSplit, closeDb, closeDbOrTimeout, describeDbUrl, getDb, getDbSplitStatus, getMigrationRole, getRawClient, getSourceDb, getTargetDb, jsonb, onChainPlane, onControlPlane, parseJsonb, resolveSourceUrl, resolveTargetUrl, setMigrationRole, sql };
|
package/dist/src/db/index.js
CHANGED
|
@@ -764,6 +764,12 @@ var TABLE_TO_DB = {
|
|
|
764
764
|
sessions: "target",
|
|
765
765
|
magic_links: "target",
|
|
766
766
|
cli_device_logins: "target",
|
|
767
|
+
oauth_clients: "target",
|
|
768
|
+
oauth_requests: "target",
|
|
769
|
+
oauth_codes: "target",
|
|
770
|
+
oauth_grants: "target",
|
|
771
|
+
oauth_tokens: "target",
|
|
772
|
+
oauth_refresh_retired: "target",
|
|
767
773
|
account_spend_caps: "target",
|
|
768
774
|
processed_stripe_events: "target",
|
|
769
775
|
webhooks: "target",
|
|
@@ -1000,5 +1006,5 @@ export {
|
|
|
1000
1006
|
sql2 as sql
|
|
1001
1007
|
};
|
|
1002
1008
|
|
|
1003
|
-
//# debugId=
|
|
1009
|
+
//# debugId=851EA3F170EE10F464756E2164756E21
|
|
1004
1010
|
//# sourceMappingURL=index.js.map
|