@secondlayer/shared 19.0.0 → 19.0.1

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.
@@ -873,6 +873,7 @@ interface Database {
873
873
  stage_failures: StageFailuresTable;
874
874
  archive_fetches: ArchiveFetchesTable;
875
875
  usage_ledger: UsageLedgerTable;
876
+ usage_monthly_totals: UsageMonthlyTotalsTable;
876
877
  account_balance_alerts: AccountBalanceAlertsTable;
877
878
  hosted_stack_state: HostedStackStateTable;
878
879
  webhook_incident_alerts: WebhookIncidentAlertsTable;
@@ -939,6 +940,15 @@ interface ArchiveFetchesTable {
939
940
  via_allowance: Generated<boolean>;
940
941
  charged_at: Generated<Date>;
941
942
  }
943
+ /** Running `usage_ledger` quantity per account, unit and UTC month of
944
+ * `occurred_at` — kept in step by `claimLedgerEntry`. */
945
+ interface UsageMonthlyTotalsTable {
946
+ account_id: string;
947
+ unit: string;
948
+ /** `YYYY-MM`, UTC. */
949
+ month: string;
950
+ quantity: Generated<string | number | bigint>;
951
+ }
942
952
  /**
943
953
  * One metered ledger for every billable unit (archive partitions, hosted
944
954
  * Index/Streams rows, and future hosted-stack meters). Append-only, written
@@ -873,6 +873,7 @@ interface Database {
873
873
  stage_failures: StageFailuresTable;
874
874
  archive_fetches: ArchiveFetchesTable;
875
875
  usage_ledger: UsageLedgerTable;
876
+ usage_monthly_totals: UsageMonthlyTotalsTable;
876
877
  account_balance_alerts: AccountBalanceAlertsTable;
877
878
  hosted_stack_state: HostedStackStateTable;
878
879
  webhook_incident_alerts: WebhookIncidentAlertsTable;
@@ -939,6 +940,15 @@ interface ArchiveFetchesTable {
939
940
  via_allowance: Generated<boolean>;
940
941
  charged_at: Generated<Date>;
941
942
  }
943
+ /** Running `usage_ledger` quantity per account, unit and UTC month of
944
+ * `occurred_at` — kept in step by `claimLedgerEntry`. */
945
+ interface UsageMonthlyTotalsTable {
946
+ account_id: string;
947
+ unit: string;
948
+ /** `YYYY-MM`, UTC. */
949
+ month: string;
950
+ quantity: Generated<string | number | bigint>;
951
+ }
942
952
  /**
943
953
  * One metered ledger for every billable unit (archive partitions, hosted
944
954
  * Index/Streams rows, and future hosted-stack meters). Append-only, written
@@ -1018,6 +1018,7 @@ interface Database {
1018
1018
  stage_failures: StageFailuresTable;
1019
1019
  archive_fetches: ArchiveFetchesTable;
1020
1020
  usage_ledger: UsageLedgerTable;
1021
+ usage_monthly_totals: UsageMonthlyTotalsTable;
1021
1022
  account_balance_alerts: AccountBalanceAlertsTable;
1022
1023
  hosted_stack_state: HostedStackStateTable;
1023
1024
  webhook_incident_alerts: WebhookIncidentAlertsTable;
@@ -1084,6 +1085,15 @@ interface ArchiveFetchesTable {
1084
1085
  via_allowance: Generated<boolean>;
1085
1086
  charged_at: Generated<Date>;
1086
1087
  }
1088
+ /** Running `usage_ledger` quantity per account, unit and UTC month of
1089
+ * `occurred_at` — kept in step by `claimLedgerEntry`. */
1090
+ interface UsageMonthlyTotalsTable {
1091
+ account_id: string;
1092
+ unit: string;
1093
+ /** `YYYY-MM`, UTC. */
1094
+ month: string;
1095
+ quantity: Generated<string | number | bigint>;
1096
+ }
1087
1097
  /**
1088
1098
  * One metered ledger for every billable unit (archive partitions, hosted
1089
1099
  * Index/Streams rows, and future hosted-stack meters). Append-only, written
@@ -876,6 +876,7 @@ interface Database {
876
876
  stage_failures: StageFailuresTable;
877
877
  archive_fetches: ArchiveFetchesTable;
878
878
  usage_ledger: UsageLedgerTable;
879
+ usage_monthly_totals: UsageMonthlyTotalsTable;
879
880
  account_balance_alerts: AccountBalanceAlertsTable;
880
881
  hosted_stack_state: HostedStackStateTable;
881
882
  webhook_incident_alerts: WebhookIncidentAlertsTable;
@@ -951,6 +952,15 @@ interface ArchiveFetchesTable {
951
952
  type ArchiveFetch = Selectable<ArchiveFetchesTable>;
952
953
  type InsertArchiveFetch = Insertable<ArchiveFetchesTable>;
953
954
  type UpdateArchiveFetch = Updateable<ArchiveFetchesTable>;
955
+ /** Running `usage_ledger` quantity per account, unit and UTC month of
956
+ * `occurred_at` — kept in step by `claimLedgerEntry`. */
957
+ interface UsageMonthlyTotalsTable {
958
+ account_id: string;
959
+ unit: string;
960
+ /** `YYYY-MM`, UTC. */
961
+ month: string;
962
+ quantity: Generated<string | number | bigint>;
963
+ }
954
964
  /**
955
965
  * One metered ledger for every billable unit (archive partitions, hosted
956
966
  * Index/Streams rows, and future hosted-stack meters). Append-only, written
@@ -2296,6 +2306,7 @@ declare const TABLE_TO_DB: {
2296
2306
  account_credits: string
2297
2307
  archive_fetches: string
2298
2308
  usage_ledger: string
2309
+ usage_monthly_totals: string
2299
2310
  account_balance_alerts: string
2300
2311
  hosted_stack_state: string
2301
2312
  webhook_incident_alerts: string
@@ -2412,4 +2423,4 @@ declare function closeDb(): Promise<void>;
2412
2423
  * actual work is done.
2413
2424
  */
2414
2425
  declare function closeDbOrTimeout(timeoutMs?: number, closeFn?: () => Promise<void>): Promise<void>;
2415
- export { ABI_STATUSES, AbiStatus, Account, AccountBalanceAlerts, AccountBalanceAlertsTable, AccountCredits, AccountCreditsTable, AccountSpendCap, AccountSpendCapsTable, AccountsTable, ApiFailedRequest, ApiFailedRequestsTable, ApiKey, ApiKeyStatus, 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, Database, DbPlane, DbReadRow, DbSplitStatus, DeadLetterEventsTable, DeadReason, DecodedEventsTable, DecoderCheckpointsTable, Event, EventsArchiveTable, EventsTable, EventsTotalBaselineTable, FailureClass, FailureUnit, FeedbackTicket, FeedbackTicketsTable, GapReason, HostedStackStateTable, 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, InsertUpdateSubscriber, InsertUsageLedgerRow, InsertVmEvent, InsertWaitlistSignup, InsertWebhook, InsertWebhookDelivery, InsertWebhookOutbox, InsightMutesTable, InsightsTable, InstancesTable, MagicLink, MagicLinksTable, MempoolTransaction, MempoolTransactionsTable, MigrationRole, NativeClock, NumericAsText, OBSERVER_JOURNAL_STATUSES, OauthClient, OauthClientsTable, OauthCodesTable, OauthGrant, OauthGrantsTable, OauthRefreshRetiredTable, OauthRequestStatus, OauthRequestsTable, OauthTokenKind, OauthTokensTable, ObserverJournalStatus, ObserverJournalTable, OutboxStatus, PendingForkBlocksTable, Pox5CycleSignersTable, Pox5CyclesTable, Pox5EventTopic, Pox5EventsTable, ProcessedStripeEventsTable, PushPrefs, PushPrefsTable, PushSentTable, PushSubscription, PushSubscriptionsTable, RepairMode, RetryState, RunStatus, SOURCE_READ_COLUMNS, SOURCE_READ_PKS, SOURCE_READ_TYPES, SbtcEventTopic, SbtcEventsTable, SbtcSettlementsTable, SentinelAccount, SentinelAccountsTable, ServiceHeartbeatsTable, Session, SessionsTable, StageFailuresTable, StageKind, StageRegistryTable, 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, UpdateSendsTable, UpdateSubgraph, UpdateSubgraphOperation, UpdateSubscriber, UpdateSubscribersTable, UpdateTransaction, UpdateUsageLedgerRow, UpdateVmEvent, UpdateWebhook, UpdateWebhookOutbox, UsageLedgerRow, UsageLedgerTable, VmEvent, VmEventsArchiveTable, VmEventsTable, Waitlist, WaitlistSignup, WaitlistSignupsTable, WaitlistsTable, Webhook, WebhookDeliveriesTable, WebhookDelivery, WebhookDeliveryHoursTable, WebhookFormat, WebhookIncidentAlert, WebhookIncidentAlertsTable, WebhookKind, WebhookOutbox, WebhookOutboxTable, WebhookPauseReason, WebhookReplay, WebhookReplayStatus, WebhookReplaysTable, WebhookStatus, WebhooksTable, applicationDatabaseUrl, assertDbSplit, closeDb, closeDbOrTimeout, configuredSourceUrl, configuredTargetUrl, describeDbUrl, getDb, getDbSplitStatus, getMigrationRole, getRawClient, getSourceDb, getTargetDb, jsonb, onChainPlane, onControlPlane, parseJsonb, resolveSourceUrl, resolveTargetUrl, setMigrationRole, sql };
2426
+ export { ABI_STATUSES, AbiStatus, Account, AccountBalanceAlerts, AccountBalanceAlertsTable, AccountCredits, AccountCreditsTable, AccountSpendCap, AccountSpendCapsTable, AccountsTable, ApiFailedRequest, ApiFailedRequestsTable, ApiKey, ApiKeyStatus, 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, Database, DbPlane, DbReadRow, DbSplitStatus, DeadLetterEventsTable, DeadReason, DecodedEventsTable, DecoderCheckpointsTable, Event, EventsArchiveTable, EventsTable, EventsTotalBaselineTable, FailureClass, FailureUnit, FeedbackTicket, FeedbackTicketsTable, GapReason, HostedStackStateTable, 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, InsertUpdateSubscriber, InsertUsageLedgerRow, InsertVmEvent, InsertWaitlistSignup, InsertWebhook, InsertWebhookDelivery, InsertWebhookOutbox, InsightMutesTable, InsightsTable, InstancesTable, MagicLink, MagicLinksTable, MempoolTransaction, MempoolTransactionsTable, MigrationRole, NativeClock, NumericAsText, OBSERVER_JOURNAL_STATUSES, OauthClient, OauthClientsTable, OauthCodesTable, OauthGrant, OauthGrantsTable, OauthRefreshRetiredTable, OauthRequestStatus, OauthRequestsTable, OauthTokenKind, OauthTokensTable, ObserverJournalStatus, ObserverJournalTable, OutboxStatus, PendingForkBlocksTable, Pox5CycleSignersTable, Pox5CyclesTable, Pox5EventTopic, Pox5EventsTable, ProcessedStripeEventsTable, PushPrefs, PushPrefsTable, PushSentTable, PushSubscription, PushSubscriptionsTable, RepairMode, RetryState, RunStatus, SOURCE_READ_COLUMNS, SOURCE_READ_PKS, SOURCE_READ_TYPES, SbtcEventTopic, SbtcEventsTable, SbtcSettlementsTable, SentinelAccount, SentinelAccountsTable, ServiceHeartbeatsTable, Session, SessionsTable, StageFailuresTable, StageKind, StageRegistryTable, 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, UpdateSendsTable, UpdateSubgraph, UpdateSubgraphOperation, UpdateSubscriber, UpdateSubscribersTable, UpdateTransaction, UpdateUsageLedgerRow, UpdateVmEvent, UpdateWebhook, UpdateWebhookOutbox, UsageLedgerRow, UsageLedgerTable, UsageMonthlyTotalsTable, VmEvent, VmEventsArchiveTable, VmEventsTable, Waitlist, WaitlistSignup, WaitlistSignupsTable, WaitlistsTable, Webhook, WebhookDeliveriesTable, WebhookDelivery, WebhookDeliveryHoursTable, WebhookFormat, WebhookIncidentAlert, WebhookIncidentAlertsTable, WebhookKind, WebhookOutbox, WebhookOutboxTable, WebhookPauseReason, WebhookReplay, WebhookReplayStatus, WebhookReplaysTable, WebhookStatus, WebhooksTable, applicationDatabaseUrl, assertDbSplit, closeDb, closeDbOrTimeout, configuredSourceUrl, configuredTargetUrl, describeDbUrl, getDb, getDbSplitStatus, getMigrationRole, getRawClient, getSourceDb, getTargetDb, jsonb, onChainPlane, onControlPlane, parseJsonb, resolveSourceUrl, resolveTargetUrl, setMigrationRole, sql };
@@ -744,6 +744,7 @@ var TABLE_TO_DB = {
744
744
  account_credits: "target",
745
745
  archive_fetches: "target",
746
746
  usage_ledger: "target",
747
+ usage_monthly_totals: "target",
747
748
  account_balance_alerts: "target",
748
749
  hosted_stack_state: "target",
749
750
  webhook_incident_alerts: "target",
@@ -970,5 +971,5 @@ export {
970
971
  sql2 as sql
971
972
  };
972
973
 
973
- //# debugId=376ED2B815C4DEF464756E2164756E21
974
+ //# debugId=ABB26874BAB3F2E664756E2164756E21
974
975
  //# sourceMappingURL=index.js.map