@secondlayer/shared 13.2.1 → 13.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/src/archive/range-digest.d.ts +45 -0
  2. package/dist/src/archive/semantic-digest-builder.d.ts +45 -0
  3. package/dist/src/coverage/index.d.ts +45 -0
  4. package/dist/src/db/index.d.ts +50 -1
  5. package/dist/src/db/index.js +3 -1
  6. package/dist/src/db/index.js.map +3 -3
  7. package/dist/src/db/queries/chain-reorgs.d.ts +45 -0
  8. package/dist/src/db/queries/chain-reorgs.js +3 -1
  9. package/dist/src/db/queries/chain-reorgs.js.map +3 -3
  10. package/dist/src/db/queries/contracts.d.ts +45 -0
  11. package/dist/src/db/queries/instance.d.ts +45 -0
  12. package/dist/src/db/queries/integrity.d.ts +45 -0
  13. package/dist/src/db/queries/subgraph-gaps.d.ts +45 -0
  14. package/dist/src/db/queries/subgraph-operations.d.ts +45 -0
  15. package/dist/src/db/queries/subgraphs.d.ts +45 -0
  16. package/dist/src/db/queries/sync-scope.d.ts +45 -0
  17. package/dist/src/db/queries/webhooks.d.ts +45 -0
  18. package/dist/src/db/schema.d.ts +48 -1
  19. package/dist/src/index.d.ts +78 -1
  20. package/dist/src/index.js +69 -1
  21. package/dist/src/index.js.map +6 -5
  22. package/dist/src/node/local-client.d.ts +45 -0
  23. package/dist/src/queue/listener.js +3 -1
  24. package/dist/src/queue/listener.js.map +3 -3
  25. package/dist/src/schemas/index.d.ts +7 -0
  26. package/dist/src/schemas/index.js +11 -1
  27. package/dist/src/schemas/index.js.map +3 -3
  28. package/dist/src/schemas/webhooks.d.ts +46 -1
  29. package/dist/src/schemas/webhooks.js +13 -1
  30. package/dist/src/schemas/webhooks.js.map +3 -3
  31. package/migrations/0166_webhook_receiver_cert.ts +31 -0
  32. package/migrations/0167_usage_ledger_api_key_id.ts +29 -0
  33. package/migrations/0168_api_request_log.ts +49 -0
  34. package/migrations/0169_subgraph_health_history.ts +54 -0
  35. package/package.json +1 -1
@@ -359,8 +359,26 @@ interface SubgraphHealthSnapshotsTable {
359
359
  total_processed: number;
360
360
  total_errors: number;
361
361
  last_processed_block: number | null;
362
+ chain_tip: string | number | null;
363
+ rows_written_total: string | number | null;
364
+ storage_bytes: string | number | null;
362
365
  captured_at: Generated<Date>;
363
366
  }
367
+ /** Handler errors grouped by fingerprint. Cap 50/subgraph. */
368
+ interface SubgraphErrorGroupsTable {
369
+ id: Generated<string>;
370
+ subgraph_name: string;
371
+ fingerprint: string;
372
+ source_name: string;
373
+ event_type: string | null;
374
+ message: string;
375
+ frame: string | null;
376
+ count: Generated<string | number>;
377
+ sample_tx_id: string | null;
378
+ sample_block_height: string | number | null;
379
+ first_seen: Generated<Date>;
380
+ last_seen: Generated<Date>;
381
+ }
364
382
  interface ProcessedStripeEventsTable {
365
383
  event_id: string;
366
384
  event_type: string;
@@ -837,6 +855,7 @@ interface Database {
837
855
  subgraph_processing_stats: SubgraphProcessingStatsTable;
838
856
  subgraph_gaps: SubgraphGapsTable;
839
857
  subgraph_violations: SubgraphViolationsTable;
858
+ subgraph_error_groups: SubgraphErrorGroupsTable;
840
859
  subgraph_operations: SubgraphOperationsTable;
841
860
  processed_stripe_events: ProcessedStripeEventsTable;
842
861
  account_spend_caps: AccountSpendCapsTable;
@@ -880,6 +899,7 @@ interface Database {
880
899
  waitlist_signups: WaitlistSignupsTable;
881
900
  contact_requests: ContactRequestsTable;
882
901
  api_failed_requests: ApiFailedRequestsTable;
902
+ api_request_log: ApiRequestLogTable;
883
903
  feedback_tickets: FeedbackTicketsTable;
884
904
  }
885
905
  interface ServiceHeartbeatsTable {
@@ -944,6 +964,8 @@ interface UsageLedgerTable {
944
964
  usd_micros: string | number | bigint;
945
965
  debited: Generated<boolean>;
946
966
  source: string;
967
+ /** API key behind a metered read; null for non-read units and older rows. */
968
+ api_key_id: string | null;
947
969
  idempotency_key: string;
948
970
  occurred_at: Generated<Date>;
949
971
  recorded_at: Generated<Date>;
@@ -994,6 +1016,9 @@ interface WebhooksTable {
994
1016
  last_delivery_at: Date | null;
995
1017
  last_success_at: Date | null;
996
1018
  last_error: string | null;
1019
+ /** Receiver TLS leaf certificate expiry, from the emitter's periodic probe. */
1020
+ receiver_cert_expires_at: Date | null;
1021
+ receiver_cert_checked_at: Date | null;
997
1022
  created_at: Generated<Date>;
998
1023
  updated_at: Generated<Date>;
999
1024
  }
@@ -1112,6 +1137,26 @@ interface ApiFailedRequestsTable {
1112
1137
  created_at: Generated<Date>;
1113
1138
  }
1114
1139
  /**
1140
+ * 7-day hosted log of account-attributed Index/Streams reads. Query values
1141
+ * are stored only as hashes; never bodies, headers or tokens.
1142
+ */
1143
+ interface ApiRequestLogTable {
1144
+ id: Generated<string>;
1145
+ request_id: string | null;
1146
+ account_id: string;
1147
+ api_key_id: string | null;
1148
+ method: string;
1149
+ path: string;
1150
+ path_template: string;
1151
+ params_hash: string | null;
1152
+ cursor_hash: string | null;
1153
+ page_size: number | null;
1154
+ rows: number | null;
1155
+ status: number;
1156
+ duration_ms: number;
1157
+ created_at: Generated<Date>;
1158
+ }
1159
+ /**
1115
1160
  * Hosted problem report. `attempted` is the server's own copy of the failed
1116
1161
  * request (never caller-supplied); `status` starts `new` until classified.
1117
1162
  */
@@ -359,8 +359,26 @@ interface SubgraphHealthSnapshotsTable {
359
359
  total_processed: number;
360
360
  total_errors: number;
361
361
  last_processed_block: number | null;
362
+ chain_tip: string | number | null;
363
+ rows_written_total: string | number | null;
364
+ storage_bytes: string | number | null;
362
365
  captured_at: Generated<Date>;
363
366
  }
367
+ /** Handler errors grouped by fingerprint. Cap 50/subgraph. */
368
+ interface SubgraphErrorGroupsTable {
369
+ id: Generated<string>;
370
+ subgraph_name: string;
371
+ fingerprint: string;
372
+ source_name: string;
373
+ event_type: string | null;
374
+ message: string;
375
+ frame: string | null;
376
+ count: Generated<string | number>;
377
+ sample_tx_id: string | null;
378
+ sample_block_height: string | number | null;
379
+ first_seen: Generated<Date>;
380
+ last_seen: Generated<Date>;
381
+ }
364
382
  interface ProcessedStripeEventsTable {
365
383
  event_id: string;
366
384
  event_type: string;
@@ -837,6 +855,7 @@ interface Database {
837
855
  subgraph_processing_stats: SubgraphProcessingStatsTable;
838
856
  subgraph_gaps: SubgraphGapsTable;
839
857
  subgraph_violations: SubgraphViolationsTable;
858
+ subgraph_error_groups: SubgraphErrorGroupsTable;
840
859
  subgraph_operations: SubgraphOperationsTable;
841
860
  processed_stripe_events: ProcessedStripeEventsTable;
842
861
  account_spend_caps: AccountSpendCapsTable;
@@ -880,6 +899,7 @@ interface Database {
880
899
  waitlist_signups: WaitlistSignupsTable;
881
900
  contact_requests: ContactRequestsTable;
882
901
  api_failed_requests: ApiFailedRequestsTable;
902
+ api_request_log: ApiRequestLogTable;
883
903
  feedback_tickets: FeedbackTicketsTable;
884
904
  }
885
905
  interface ServiceHeartbeatsTable {
@@ -944,6 +964,8 @@ interface UsageLedgerTable {
944
964
  usd_micros: string | number | bigint;
945
965
  debited: Generated<boolean>;
946
966
  source: string;
967
+ /** API key behind a metered read; null for non-read units and older rows. */
968
+ api_key_id: string | null;
947
969
  idempotency_key: string;
948
970
  occurred_at: Generated<Date>;
949
971
  recorded_at: Generated<Date>;
@@ -995,6 +1017,9 @@ interface WebhooksTable {
995
1017
  last_delivery_at: Date | null;
996
1018
  last_success_at: Date | null;
997
1019
  last_error: string | null;
1020
+ /** Receiver TLS leaf certificate expiry, from the emitter's periodic probe. */
1021
+ receiver_cert_expires_at: Date | null;
1022
+ receiver_cert_checked_at: Date | null;
998
1023
  created_at: Generated<Date>;
999
1024
  updated_at: Generated<Date>;
1000
1025
  }
@@ -1113,6 +1138,26 @@ interface ApiFailedRequestsTable {
1113
1138
  created_at: Generated<Date>;
1114
1139
  }
1115
1140
  /**
1141
+ * 7-day hosted log of account-attributed Index/Streams reads. Query values
1142
+ * are stored only as hashes; never bodies, headers or tokens.
1143
+ */
1144
+ interface ApiRequestLogTable {
1145
+ id: Generated<string>;
1146
+ request_id: string | null;
1147
+ account_id: string;
1148
+ api_key_id: string | null;
1149
+ method: string;
1150
+ path: string;
1151
+ path_template: string;
1152
+ params_hash: string | null;
1153
+ cursor_hash: string | null;
1154
+ page_size: number | null;
1155
+ rows: number | null;
1156
+ status: number;
1157
+ duration_ms: number;
1158
+ created_at: Generated<Date>;
1159
+ }
1160
+ /**
1116
1161
  * Hosted problem report. `attempted` is the server's own copy of the failed
1117
1162
  * request (never caller-supplied); `status` starts `new` until classified.
1118
1163
  */
@@ -359,8 +359,26 @@ interface SubgraphHealthSnapshotsTable {
359
359
  total_processed: number;
360
360
  total_errors: number;
361
361
  last_processed_block: number | null;
362
+ chain_tip: string | number | null;
363
+ rows_written_total: string | number | null;
364
+ storage_bytes: string | number | null;
362
365
  captured_at: Generated<Date>;
363
366
  }
367
+ /** Handler errors grouped by fingerprint. Cap 50/subgraph. */
368
+ interface SubgraphErrorGroupsTable {
369
+ id: Generated<string>;
370
+ subgraph_name: string;
371
+ fingerprint: string;
372
+ source_name: string;
373
+ event_type: string | null;
374
+ message: string;
375
+ frame: string | null;
376
+ count: Generated<string | number>;
377
+ sample_tx_id: string | null;
378
+ sample_block_height: string | number | null;
379
+ first_seen: Generated<Date>;
380
+ last_seen: Generated<Date>;
381
+ }
364
382
  interface ProcessedStripeEventsTable {
365
383
  event_id: string;
366
384
  event_type: string;
@@ -837,6 +855,7 @@ interface Database {
837
855
  subgraph_processing_stats: SubgraphProcessingStatsTable;
838
856
  subgraph_gaps: SubgraphGapsTable;
839
857
  subgraph_violations: SubgraphViolationsTable;
858
+ subgraph_error_groups: SubgraphErrorGroupsTable;
840
859
  subgraph_operations: SubgraphOperationsTable;
841
860
  processed_stripe_events: ProcessedStripeEventsTable;
842
861
  account_spend_caps: AccountSpendCapsTable;
@@ -880,6 +899,7 @@ interface Database {
880
899
  waitlist_signups: WaitlistSignupsTable;
881
900
  contact_requests: ContactRequestsTable;
882
901
  api_failed_requests: ApiFailedRequestsTable;
902
+ api_request_log: ApiRequestLogTable;
883
903
  feedback_tickets: FeedbackTicketsTable;
884
904
  }
885
905
  interface ServiceHeartbeatsTable {
@@ -944,6 +964,8 @@ interface UsageLedgerTable {
944
964
  usd_micros: string | number | bigint;
945
965
  debited: Generated<boolean>;
946
966
  source: string;
967
+ /** API key behind a metered read; null for non-read units and older rows. */
968
+ api_key_id: string | null;
947
969
  idempotency_key: string;
948
970
  occurred_at: Generated<Date>;
949
971
  recorded_at: Generated<Date>;
@@ -995,6 +1017,9 @@ interface WebhooksTable {
995
1017
  last_delivery_at: Date | null;
996
1018
  last_success_at: Date | null;
997
1019
  last_error: string | null;
1020
+ /** Receiver TLS leaf certificate expiry, from the emitter's periodic probe. */
1021
+ receiver_cert_expires_at: Date | null;
1022
+ receiver_cert_checked_at: Date | null;
998
1023
  created_at: Generated<Date>;
999
1024
  updated_at: Generated<Date>;
1000
1025
  }
@@ -1113,6 +1138,26 @@ interface ApiFailedRequestsTable {
1113
1138
  created_at: Generated<Date>;
1114
1139
  }
1115
1140
  /**
1141
+ * 7-day hosted log of account-attributed Index/Streams reads. Query values
1142
+ * are stored only as hashes; never bodies, headers or tokens.
1143
+ */
1144
+ interface ApiRequestLogTable {
1145
+ id: Generated<string>;
1146
+ request_id: string | null;
1147
+ account_id: string;
1148
+ api_key_id: string | null;
1149
+ method: string;
1150
+ path: string;
1151
+ path_template: string;
1152
+ params_hash: string | null;
1153
+ cursor_hash: string | null;
1154
+ page_size: number | null;
1155
+ rows: number | null;
1156
+ status: number;
1157
+ duration_ms: number;
1158
+ created_at: Generated<Date>;
1159
+ }
1160
+ /**
1116
1161
  * Hosted problem report. `attempted` is the server's own copy of the failed
1117
1162
  * request (never caller-supplied); `status` starts `new` until classified.
1118
1163
  */
@@ -369,8 +369,26 @@ interface SubgraphHealthSnapshotsTable {
369
369
  total_processed: number;
370
370
  total_errors: number;
371
371
  last_processed_block: number | null;
372
+ chain_tip: string | number | null;
373
+ rows_written_total: string | number | null;
374
+ storage_bytes: string | number | null;
372
375
  captured_at: Generated<Date>;
373
376
  }
377
+ /** Handler errors grouped by fingerprint. Cap 50/subgraph. */
378
+ interface SubgraphErrorGroupsTable {
379
+ id: Generated<string>;
380
+ subgraph_name: string;
381
+ fingerprint: string;
382
+ source_name: string;
383
+ event_type: string | null;
384
+ message: string;
385
+ frame: string | null;
386
+ count: Generated<string | number>;
387
+ sample_tx_id: string | null;
388
+ sample_block_height: string | number | null;
389
+ first_seen: Generated<Date>;
390
+ last_seen: Generated<Date>;
391
+ }
374
392
  interface ProcessedStripeEventsTable {
375
393
  event_id: string;
376
394
  event_type: string;
@@ -847,6 +865,7 @@ interface Database {
847
865
  subgraph_processing_stats: SubgraphProcessingStatsTable;
848
866
  subgraph_gaps: SubgraphGapsTable;
849
867
  subgraph_violations: SubgraphViolationsTable;
868
+ subgraph_error_groups: SubgraphErrorGroupsTable;
850
869
  subgraph_operations: SubgraphOperationsTable;
851
870
  processed_stripe_events: ProcessedStripeEventsTable;
852
871
  account_spend_caps: AccountSpendCapsTable;
@@ -890,6 +909,7 @@ interface Database {
890
909
  waitlist_signups: WaitlistSignupsTable;
891
910
  contact_requests: ContactRequestsTable;
892
911
  api_failed_requests: ApiFailedRequestsTable;
912
+ api_request_log: ApiRequestLogTable;
893
913
  feedback_tickets: FeedbackTicketsTable;
894
914
  }
895
915
  interface ServiceHeartbeatsTable {
@@ -954,6 +974,8 @@ interface UsageLedgerTable {
954
974
  usd_micros: string | number | bigint;
955
975
  debited: Generated<boolean>;
956
976
  source: string;
977
+ /** API key behind a metered read; null for non-read units and older rows. */
978
+ api_key_id: string | null;
957
979
  idempotency_key: string;
958
980
  occurred_at: Generated<Date>;
959
981
  recorded_at: Generated<Date>;
@@ -1004,6 +1026,9 @@ interface WebhooksTable {
1004
1026
  last_delivery_at: Date | null;
1005
1027
  last_success_at: Date | null;
1006
1028
  last_error: string | null;
1029
+ /** Receiver TLS leaf certificate expiry, from the emitter's periodic probe. */
1030
+ receiver_cert_expires_at: Date | null;
1031
+ receiver_cert_checked_at: Date | null;
1007
1032
  created_at: Generated<Date>;
1008
1033
  updated_at: Generated<Date>;
1009
1034
  }
@@ -1122,6 +1147,26 @@ interface ApiFailedRequestsTable {
1122
1147
  created_at: Generated<Date>;
1123
1148
  }
1124
1149
  /**
1150
+ * 7-day hosted log of account-attributed Index/Streams reads. Query values
1151
+ * are stored only as hashes; never bodies, headers or tokens.
1152
+ */
1153
+ interface ApiRequestLogTable {
1154
+ id: Generated<string>;
1155
+ request_id: string | null;
1156
+ account_id: string;
1157
+ api_key_id: string | null;
1158
+ method: string;
1159
+ path: string;
1160
+ path_template: string;
1161
+ params_hash: string | null;
1162
+ cursor_hash: string | null;
1163
+ page_size: number | null;
1164
+ rows: number | null;
1165
+ status: number;
1166
+ duration_ms: number;
1167
+ created_at: Generated<Date>;
1168
+ }
1169
+ /**
1125
1170
  * Hosted problem report. `attempted` is the server's own copy of the failed
1126
1171
  * request (never caller-supplied); `status` starts `new` until classified.
1127
1172
  */
@@ -359,8 +359,26 @@ interface SubgraphHealthSnapshotsTable {
359
359
  total_processed: number;
360
360
  total_errors: number;
361
361
  last_processed_block: number | null;
362
+ chain_tip: string | number | null;
363
+ rows_written_total: string | number | null;
364
+ storage_bytes: string | number | null;
362
365
  captured_at: Generated<Date>;
363
366
  }
367
+ /** Handler errors grouped by fingerprint. Cap 50/subgraph. */
368
+ interface SubgraphErrorGroupsTable {
369
+ id: Generated<string>;
370
+ subgraph_name: string;
371
+ fingerprint: string;
372
+ source_name: string;
373
+ event_type: string | null;
374
+ message: string;
375
+ frame: string | null;
376
+ count: Generated<string | number>;
377
+ sample_tx_id: string | null;
378
+ sample_block_height: string | number | null;
379
+ first_seen: Generated<Date>;
380
+ last_seen: Generated<Date>;
381
+ }
364
382
  interface ProcessedStripeEventsTable {
365
383
  event_id: string;
366
384
  event_type: string;
@@ -837,6 +855,7 @@ interface Database {
837
855
  subgraph_processing_stats: SubgraphProcessingStatsTable;
838
856
  subgraph_gaps: SubgraphGapsTable;
839
857
  subgraph_violations: SubgraphViolationsTable;
858
+ subgraph_error_groups: SubgraphErrorGroupsTable;
840
859
  subgraph_operations: SubgraphOperationsTable;
841
860
  processed_stripe_events: ProcessedStripeEventsTable;
842
861
  account_spend_caps: AccountSpendCapsTable;
@@ -880,6 +899,7 @@ interface Database {
880
899
  waitlist_signups: WaitlistSignupsTable;
881
900
  contact_requests: ContactRequestsTable;
882
901
  api_failed_requests: ApiFailedRequestsTable;
902
+ api_request_log: ApiRequestLogTable;
883
903
  feedback_tickets: FeedbackTicketsTable;
884
904
  }
885
905
  interface ServiceHeartbeatsTable {
@@ -944,6 +964,8 @@ interface UsageLedgerTable {
944
964
  usd_micros: string | number | bigint;
945
965
  debited: Generated<boolean>;
946
966
  source: string;
967
+ /** API key behind a metered read; null for non-read units and older rows. */
968
+ api_key_id: string | null;
947
969
  idempotency_key: string;
948
970
  occurred_at: Generated<Date>;
949
971
  recorded_at: Generated<Date>;
@@ -994,6 +1016,9 @@ interface WebhooksTable {
994
1016
  last_delivery_at: Date | null;
995
1017
  last_success_at: Date | null;
996
1018
  last_error: string | null;
1019
+ /** Receiver TLS leaf certificate expiry, from the emitter's periodic probe. */
1020
+ receiver_cert_expires_at: Date | null;
1021
+ receiver_cert_checked_at: Date | null;
997
1022
  created_at: Generated<Date>;
998
1023
  updated_at: Generated<Date>;
999
1024
  }
@@ -1113,6 +1138,26 @@ interface ApiFailedRequestsTable {
1113
1138
  created_at: Generated<Date>;
1114
1139
  }
1115
1140
  /**
1141
+ * 7-day hosted log of account-attributed Index/Streams reads. Query values
1142
+ * are stored only as hashes; never bodies, headers or tokens.
1143
+ */
1144
+ interface ApiRequestLogTable {
1145
+ id: Generated<string>;
1146
+ request_id: string | null;
1147
+ account_id: string;
1148
+ api_key_id: string | null;
1149
+ method: string;
1150
+ path: string;
1151
+ path_template: string;
1152
+ params_hash: string | null;
1153
+ cursor_hash: string | null;
1154
+ page_size: number | null;
1155
+ rows: number | null;
1156
+ status: number;
1157
+ duration_ms: number;
1158
+ created_at: Generated<Date>;
1159
+ }
1160
+ /**
1116
1161
  * Hosted problem report. `attempted` is the server's own copy of the failed
1117
1162
  * request (never caller-supplied); `status` starts `new` until classified.
1118
1163
  */
@@ -358,8 +358,26 @@ interface SubgraphHealthSnapshotsTable {
358
358
  total_processed: number;
359
359
  total_errors: number;
360
360
  last_processed_block: number | null;
361
+ chain_tip: string | number | null;
362
+ rows_written_total: string | number | null;
363
+ storage_bytes: string | number | null;
361
364
  captured_at: Generated<Date>;
362
365
  }
366
+ /** Handler errors grouped by fingerprint. Cap 50/subgraph. */
367
+ interface SubgraphErrorGroupsTable {
368
+ id: Generated<string>;
369
+ subgraph_name: string;
370
+ fingerprint: string;
371
+ source_name: string;
372
+ event_type: string | null;
373
+ message: string;
374
+ frame: string | null;
375
+ count: Generated<string | number>;
376
+ sample_tx_id: string | null;
377
+ sample_block_height: string | number | null;
378
+ first_seen: Generated<Date>;
379
+ last_seen: Generated<Date>;
380
+ }
363
381
  interface ProcessedStripeEventsTable {
364
382
  event_id: string;
365
383
  event_type: string;
@@ -836,6 +854,7 @@ interface Database {
836
854
  subgraph_processing_stats: SubgraphProcessingStatsTable;
837
855
  subgraph_gaps: SubgraphGapsTable;
838
856
  subgraph_violations: SubgraphViolationsTable;
857
+ subgraph_error_groups: SubgraphErrorGroupsTable;
839
858
  subgraph_operations: SubgraphOperationsTable;
840
859
  processed_stripe_events: ProcessedStripeEventsTable;
841
860
  account_spend_caps: AccountSpendCapsTable;
@@ -879,6 +898,7 @@ interface Database {
879
898
  waitlist_signups: WaitlistSignupsTable;
880
899
  contact_requests: ContactRequestsTable;
881
900
  api_failed_requests: ApiFailedRequestsTable;
901
+ api_request_log: ApiRequestLogTable;
882
902
  feedback_tickets: FeedbackTicketsTable;
883
903
  }
884
904
  interface ServiceHeartbeatsTable {
@@ -952,6 +972,8 @@ interface UsageLedgerTable {
952
972
  usd_micros: string | number | bigint;
953
973
  debited: Generated<boolean>;
954
974
  source: string;
975
+ /** API key behind a metered read; null for non-read units and older rows. */
976
+ api_key_id: string | null;
955
977
  idempotency_key: string;
956
978
  occurred_at: Generated<Date>;
957
979
  recorded_at: Generated<Date>;
@@ -1050,6 +1072,9 @@ interface WebhooksTable {
1050
1072
  last_delivery_at: Date | null;
1051
1073
  last_success_at: Date | null;
1052
1074
  last_error: string | null;
1075
+ /** Receiver TLS leaf certificate expiry, from the emitter's periodic probe. */
1076
+ receiver_cert_expires_at: Date | null;
1077
+ receiver_cert_checked_at: Date | null;
1053
1078
  created_at: Generated<Date>;
1054
1079
  updated_at: Generated<Date>;
1055
1080
  }
@@ -1179,6 +1204,28 @@ interface ApiFailedRequestsTable {
1179
1204
  type ApiFailedRequest = Selectable<ApiFailedRequestsTable>;
1180
1205
  type InsertApiFailedRequest = Insertable<ApiFailedRequestsTable>;
1181
1206
  /**
1207
+ * 7-day hosted log of account-attributed Index/Streams reads. Query values
1208
+ * are stored only as hashes; never bodies, headers or tokens.
1209
+ */
1210
+ interface ApiRequestLogTable {
1211
+ id: Generated<string>;
1212
+ request_id: string | null;
1213
+ account_id: string;
1214
+ api_key_id: string | null;
1215
+ method: string;
1216
+ path: string;
1217
+ path_template: string;
1218
+ params_hash: string | null;
1219
+ cursor_hash: string | null;
1220
+ page_size: number | null;
1221
+ rows: number | null;
1222
+ status: number;
1223
+ duration_ms: number;
1224
+ created_at: Generated<Date>;
1225
+ }
1226
+ type ApiRequestLogRow = Selectable<ApiRequestLogTable>;
1227
+ type InsertApiRequestLogRow = Insertable<ApiRequestLogTable>;
1228
+ /**
1182
1229
  * Hosted problem report. `attempted` is the server's own copy of the failed
1183
1230
  * request (never caller-supplied); `status` starts `new` until classified.
1184
1231
  */
@@ -1206,4 +1253,4 @@ type WaitlistSignup = Selectable<WaitlistSignupsTable>;
1206
1253
  type InsertWaitlistSignup = Insertable<WaitlistSignupsTable>;
1207
1254
  type ContactRequest = Selectable<ContactRequestsTable>;
1208
1255
  type InsertContactRequest = Insertable<ContactRequestsTable>;
1209
- export { Account, AccountBalanceAlerts, AccountBalanceAlertsTable, AccountCredits, AccountCreditsTable, AccountSpendCap, AccountSpendCapsTable, AccountsTable, ApiFailedRequest, ApiFailedRequestsTable, ApiKey, ApiKeysTable, ArchiveFetch, ArchiveFetchesTable, Block, BlocksTable, BnsMarketplaceAction, BnsMarketplaceEventsTable, BnsNameEventTopic, BnsNameEventsTable, BnsNamesTable, BnsNamespaceEventStatus, BnsNamespaceEventsTable, BnsNamespacesTable, BurnBlockRewardSlotsTable, BurnBlockRewardsTable, ChainReadCacheTable, ChainReorgsTable, ContactRequest, ContactRequestsTable, Contract, ContractsTable, CoverageSegmentsTable, Database, DeadLetterEventsTable, DecodedEventsTable, DecoderCheckpointsTable, Event, EventsArchiveTable, EventsTable, FailureClass, FailureUnit, FeedbackTicket, FeedbackTicketsTable, IndexProgress, IndexProgressTable, InsertAccount, InsertAccountBalanceAlerts, InsertAccountCredits, InsertAccountSpendCap, InsertApiFailedRequest, InsertApiKey, InsertArchiveFetch, InsertBlock, InsertContactRequest, InsertContract, InsertEvent, InsertFeedbackTicket, InsertIndexProgress, InsertMagicLink, InsertMempoolTransaction, InsertSession, InsertStateWrite, InsertSubgraph, InsertSubgraphGap, InsertSubgraphHealthSnapshot, InsertSubgraphOperation, InsertTransaction, InsertUsageLedgerRow, InsertVmEvent, InsertWaitlistSignup, InsertWebhook, InsertWebhookDelivery, InsertWebhookOutbox, InstancesTable, MagicLink, MagicLinksTable, MempoolTransaction, MempoolTransactionsTable, NativeClock, ObserverJournalStatus, ObserverJournalTable, OutboxStatus, PendingForkBlocksTable, Pox4CallsTable, Pox4FunctionName, Pox5CycleSignersTable, Pox5CyclesTable, Pox5EventTopic, Pox5EventsTable, ProcessedStripeEventsTable, RepairMode, RetryState, RunStatus, SbtcEventTopic, SbtcEventsTable, SbtcSettlementsTable, SbtcTokenEventType, SbtcTokenEventsTable, SentinelAccount, SentinelAccountsTable, ServiceHeartbeatsTable, Session, SessionsTable, StageBlockReceiptsTable, StageFailuresTable, StageKind, StageRegistryTable, StageRunsTable, StateWrite, StateWritesArchiveTable, StateWritesTable, Subgraph, SubgraphGap, SubgraphGapsTable, SubgraphHealthSnapshot, SubgraphHealthSnapshotsTable, SubgraphOperation, SubgraphOperationKind, SubgraphOperationStatus, SubgraphOperationsTable, SubgraphProcessingStatsTable, SubgraphViolationsTable, SubgraphsTable, SyncScopesTable, 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, WebhookKind, WebhookOutbox, WebhookOutboxTable, WebhookStatus, WebhooksTable };
1256
+ 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, ContactRequest, ContactRequestsTable, Contract, ContractsTable, CoverageSegmentsTable, Database, DeadLetterEventsTable, DecodedEventsTable, DecoderCheckpointsTable, Event, EventsArchiveTable, EventsTable, FailureClass, FailureUnit, FeedbackTicket, FeedbackTicketsTable, 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, InstancesTable, MagicLink, MagicLinksTable, MempoolTransaction, MempoolTransactionsTable, NativeClock, ObserverJournalStatus, ObserverJournalTable, OutboxStatus, PendingForkBlocksTable, Pox4CallsTable, Pox4FunctionName, Pox5CycleSignersTable, Pox5CyclesTable, Pox5EventTopic, Pox5EventsTable, ProcessedStripeEventsTable, RepairMode, RetryState, RunStatus, 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, 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, WebhookKind, WebhookOutbox, WebhookOutboxTable, WebhookStatus, WebhooksTable };