@secondlayer/shared 2.0.0 → 2.1.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 (34) hide show
  1. package/dist/src/db/index.d.ts +33 -1
  2. package/dist/src/db/queries/accounts.d.ts +27 -0
  3. package/dist/src/db/queries/integrity.d.ts +27 -0
  4. package/dist/src/db/queries/projects.d.ts +27 -0
  5. package/dist/src/db/queries/{marketplace.d.ts → provisioning-audit.d.ts} +48 -54
  6. package/dist/src/db/queries/provisioning-audit.js +40 -0
  7. package/dist/src/db/queries/provisioning-audit.js.map +10 -0
  8. package/dist/src/db/queries/subgraph-gaps.d.ts +27 -0
  9. package/dist/src/db/queries/subgraphs.d.ts +27 -0
  10. package/dist/src/db/queries/tenants.d.ts +35 -1
  11. package/dist/src/db/queries/tenants.js +27 -1
  12. package/dist/src/db/queries/tenants.js.map +3 -3
  13. package/dist/src/db/queries/usage.d.ts +27 -0
  14. package/dist/src/db/queries/workflows.d.ts +27 -0
  15. package/dist/src/db/schema.d.ts +33 -1
  16. package/dist/src/index.d.ts +60 -77
  17. package/dist/src/index.js +59 -69
  18. package/dist/src/index.js.map +4 -4
  19. package/dist/src/mode.d.ts +4 -5
  20. package/dist/src/mode.js.map +2 -2
  21. package/dist/src/node/local-client.d.ts +27 -0
  22. package/dist/src/schemas/accounts.d.ts +14 -0
  23. package/dist/src/schemas/{marketplace.js → accounts.js} +4 -14
  24. package/dist/src/schemas/accounts.js.map +10 -0
  25. package/dist/src/schemas/index.d.ts +28 -77
  26. package/dist/src/schemas/index.js +59 -69
  27. package/dist/src/schemas/index.js.map +4 -4
  28. package/migrations/0043_tenant_usage_monthly.ts +36 -0
  29. package/migrations/0044_provisioning_audit_log.ts +40 -0
  30. package/package.json +8 -8
  31. package/dist/src/db/queries/marketplace.js +0 -139
  32. package/dist/src/db/queries/marketplace.js.map +0 -10
  33. package/dist/src/schemas/marketplace.d.ts +0 -63
  34. package/dist/src/schemas/marketplace.js.map +0 -10
@@ -367,6 +367,8 @@ interface Database {
367
367
  workflow_signer_secrets: WorkflowSignerSecretsTable;
368
368
  workflow_budgets: WorkflowBudgetsTable;
369
369
  tenants: TenantsTable;
370
+ tenant_usage_monthly: TenantUsageMonthlyTable;
371
+ provisioning_audit_log: ProvisioningAuditLogTable;
370
372
  }
371
373
  type TenantStatus = "provisioning" | "active" | "suspended" | "error" | "deleted";
372
374
  interface TenantsTable {
@@ -397,6 +399,31 @@ interface TenantsTable {
397
399
  created_at: Generated<Date>;
398
400
  updated_at: Generated<Date>;
399
401
  }
402
+ interface TenantUsageMonthlyTable {
403
+ id: Generated<string>;
404
+ tenant_id: string;
405
+ period_month: Date;
406
+ storage_peak_mb: Generated<number>;
407
+ storage_avg_mb: Generated<number>;
408
+ storage_last_mb: Generated<number>;
409
+ measurements: Generated<number>;
410
+ first_at: Generated<Date>;
411
+ last_at: Generated<Date>;
412
+ }
413
+ type ProvisioningAuditEvent = "provision.start" | "provision.success" | "provision.failure" | "suspend" | "resume" | "resize" | "keys.rotate" | "bastion.key.upload" | "bastion.key.revoke" | "teardown";
414
+ type ProvisioningAuditStatus = "ok" | "error";
415
+ interface ProvisioningAuditLogTable {
416
+ id: Generated<string>;
417
+ tenant_id: string | null;
418
+ tenant_slug: string | null;
419
+ account_id: string | null;
420
+ actor: string;
421
+ event: ProvisioningAuditEvent;
422
+ status: ProvisioningAuditStatus;
423
+ detail: unknown | null;
424
+ error: string | null;
425
+ created_at: Generated<Date>;
426
+ }
400
427
  interface WorkflowBudgetsTable {
401
428
  id: Generated<string>;
402
429
  workflow_definition_id: string;
@@ -360,6 +360,8 @@ interface Database {
360
360
  workflow_signer_secrets: WorkflowSignerSecretsTable;
361
361
  workflow_budgets: WorkflowBudgetsTable;
362
362
  tenants: TenantsTable;
363
+ tenant_usage_monthly: TenantUsageMonthlyTable;
364
+ provisioning_audit_log: ProvisioningAuditLogTable;
363
365
  }
364
366
  type TenantStatus = "provisioning" | "active" | "suspended" | "error" | "deleted";
365
367
  interface TenantsTable {
@@ -390,6 +392,31 @@ interface TenantsTable {
390
392
  created_at: Generated<Date>;
391
393
  updated_at: Generated<Date>;
392
394
  }
395
+ interface TenantUsageMonthlyTable {
396
+ id: Generated<string>;
397
+ tenant_id: string;
398
+ period_month: Date;
399
+ storage_peak_mb: Generated<number>;
400
+ storage_avg_mb: Generated<number>;
401
+ storage_last_mb: Generated<number>;
402
+ measurements: Generated<number>;
403
+ first_at: Generated<Date>;
404
+ last_at: Generated<Date>;
405
+ }
406
+ type ProvisioningAuditEvent = "provision.start" | "provision.success" | "provision.failure" | "suspend" | "resume" | "resize" | "keys.rotate" | "bastion.key.upload" | "bastion.key.revoke" | "teardown";
407
+ type ProvisioningAuditStatus = "ok" | "error";
408
+ interface ProvisioningAuditLogTable {
409
+ id: Generated<string>;
410
+ tenant_id: string | null;
411
+ tenant_slug: string | null;
412
+ account_id: string | null;
413
+ actor: string;
414
+ event: ProvisioningAuditEvent;
415
+ status: ProvisioningAuditStatus;
416
+ detail: unknown | null;
417
+ error: string | null;
418
+ created_at: Generated<Date>;
419
+ }
393
420
  interface WorkflowBudgetsTable {
394
421
  id: Generated<string>;
395
422
  workflow_definition_id: string;
@@ -359,6 +359,8 @@ interface Database {
359
359
  workflow_signer_secrets: WorkflowSignerSecretsTable;
360
360
  workflow_budgets: WorkflowBudgetsTable;
361
361
  tenants: TenantsTable;
362
+ tenant_usage_monthly: TenantUsageMonthlyTable;
363
+ provisioning_audit_log: ProvisioningAuditLogTable;
362
364
  }
363
365
  type TenantStatus = "provisioning" | "active" | "suspended" | "error" | "deleted";
364
366
  interface TenantsTable {
@@ -392,6 +394,36 @@ interface TenantsTable {
392
394
  type Tenant = Selectable<TenantsTable>;
393
395
  type InsertTenant = Insertable<TenantsTable>;
394
396
  type UpdateTenant = Updateable<TenantsTable>;
397
+ interface TenantUsageMonthlyTable {
398
+ id: Generated<string>;
399
+ tenant_id: string;
400
+ period_month: Date;
401
+ storage_peak_mb: Generated<number>;
402
+ storage_avg_mb: Generated<number>;
403
+ storage_last_mb: Generated<number>;
404
+ measurements: Generated<number>;
405
+ first_at: Generated<Date>;
406
+ last_at: Generated<Date>;
407
+ }
408
+ type TenantUsageMonthly = Selectable<TenantUsageMonthlyTable>;
409
+ type InsertTenantUsageMonthly = Insertable<TenantUsageMonthlyTable>;
410
+ type UpdateTenantUsageMonthly = Updateable<TenantUsageMonthlyTable>;
411
+ type ProvisioningAuditEvent = "provision.start" | "provision.success" | "provision.failure" | "suspend" | "resume" | "resize" | "keys.rotate" | "bastion.key.upload" | "bastion.key.revoke" | "teardown";
412
+ type ProvisioningAuditStatus = "ok" | "error";
413
+ interface ProvisioningAuditLogTable {
414
+ id: Generated<string>;
415
+ tenant_id: string | null;
416
+ tenant_slug: string | null;
417
+ account_id: string | null;
418
+ actor: string;
419
+ event: ProvisioningAuditEvent;
420
+ status: ProvisioningAuditStatus;
421
+ detail: unknown | null;
422
+ error: string | null;
423
+ created_at: Generated<Date>;
424
+ }
425
+ type ProvisioningAuditLog = Selectable<ProvisioningAuditLogTable>;
426
+ type InsertProvisioningAuditLog = Insertable<ProvisioningAuditLogTable>;
395
427
  interface WorkflowBudgetsTable {
396
428
  id: Generated<string>;
397
429
  workflow_definition_id: string;
@@ -485,4 +517,4 @@ type InsertChatSession = Insertable<ChatSessionsTable>;
485
517
  type UpdateChatSession = Updateable<ChatSessionsTable>;
486
518
  type ChatMessage = Selectable<ChatMessagesTable>;
487
519
  type InsertChatMessage = Insertable<ChatMessagesTable>;
488
- export { WorkflowStepsTable, WorkflowStep, WorkflowSignerSecretsTable, WorkflowSignerSecret, WorkflowSchedulesTable, WorkflowSchedule, WorkflowRunsTable, WorkflowRun, WorkflowQueueTable, WorkflowQueueItem, WorkflowDefinitionsTable, WorkflowDefinition, WorkflowCursorsTable, WorkflowCursor, WorkflowBudgetsTable, WorkflowBudget, WaitlistTable, UsageSnapshotsTable, UsageSnapshot, UsageDailyTable, UsageDaily, UpdateWorkflowStep, UpdateWorkflowSignerSecret, UpdateWorkflowSchedule, UpdateWorkflowRun, UpdateWorkflowDefinition, UpdateWorkflowBudget, UpdateTransaction, UpdateTenant, UpdateSubgraph, UpdateProject, UpdateIndexProgress, UpdateEvent, UpdateChatSession, UpdateBlock, UpdateApiKey, TransactionsTable, Transaction, TenantsTable, TenantStatus, Tenant, TeamMembersTable, TeamMember, TeamInvitationsTable, TeamInvitation, SubgraphsTable, SubgraphUsageDailyTable, SubgraphUsageDaily, SubgraphTableSnapshotsTable, SubgraphProcessingStatsTable, SubgraphHealthSnapshotsTable, SubgraphHealthSnapshot, SubgraphGapsTable, SubgraphGap, Subgraph, SessionsTable, Session, ProjectsTable, Project, MagicLinksTable, MagicLink, InsertWorkflowStep, InsertWorkflowSignerSecret, InsertWorkflowSchedule, InsertWorkflowRun, InsertWorkflowQueueItem, InsertWorkflowDefinition, InsertWorkflowBudget, InsertTransaction, InsertTenant, InsertTeamMember, InsertTeamInvitation, InsertSubgraphUsageDaily, InsertSubgraphHealthSnapshot, InsertSubgraphGap, InsertSubgraph, InsertSession, InsertProject, InsertMagicLink, InsertIndexProgress, InsertEvent, InsertChatSession, InsertChatMessage, InsertBlock, InsertApiKey, InsertAccountInsight, InsertAccountAgentRun, InsertAccount, IndexProgressTable, IndexProgress, EventsTable, Event, Database, ChatSessionsTable, ChatSession, ChatMessagesTable, ChatMessage, BlocksTable, Block, ApiKeysTable, ApiKey, AccountsTable, AccountInsightsTable, AccountInsight, AccountAgentRunsTable, AccountAgentRun, Account };
520
+ export { WorkflowStepsTable, WorkflowStep, WorkflowSignerSecretsTable, WorkflowSignerSecret, WorkflowSchedulesTable, WorkflowSchedule, WorkflowRunsTable, WorkflowRun, WorkflowQueueTable, WorkflowQueueItem, WorkflowDefinitionsTable, WorkflowDefinition, WorkflowCursorsTable, WorkflowCursor, WorkflowBudgetsTable, WorkflowBudget, WaitlistTable, UsageSnapshotsTable, UsageSnapshot, UsageDailyTable, UsageDaily, UpdateWorkflowStep, UpdateWorkflowSignerSecret, UpdateWorkflowSchedule, UpdateWorkflowRun, UpdateWorkflowDefinition, UpdateWorkflowBudget, UpdateTransaction, UpdateTenantUsageMonthly, UpdateTenant, UpdateSubgraph, UpdateProject, UpdateIndexProgress, UpdateEvent, UpdateChatSession, UpdateBlock, UpdateApiKey, TransactionsTable, Transaction, TenantsTable, TenantUsageMonthlyTable, TenantUsageMonthly, TenantStatus, Tenant, TeamMembersTable, TeamMember, TeamInvitationsTable, TeamInvitation, SubgraphsTable, SubgraphUsageDailyTable, SubgraphUsageDaily, SubgraphTableSnapshotsTable, SubgraphProcessingStatsTable, SubgraphHealthSnapshotsTable, SubgraphHealthSnapshot, SubgraphGapsTable, SubgraphGap, Subgraph, SessionsTable, Session, ProvisioningAuditStatus, ProvisioningAuditLogTable, ProvisioningAuditLog, ProvisioningAuditEvent, ProjectsTable, Project, MagicLinksTable, MagicLink, InsertWorkflowStep, InsertWorkflowSignerSecret, InsertWorkflowSchedule, InsertWorkflowRun, InsertWorkflowQueueItem, InsertWorkflowDefinition, InsertWorkflowBudget, InsertTransaction, InsertTenantUsageMonthly, InsertTenant, InsertTeamMember, InsertTeamInvitation, InsertSubgraphUsageDaily, InsertSubgraphHealthSnapshot, InsertSubgraphGap, InsertSubgraph, InsertSession, InsertProvisioningAuditLog, InsertProject, InsertMagicLink, InsertIndexProgress, InsertEvent, InsertChatSession, InsertChatMessage, InsertBlock, InsertApiKey, InsertAccountInsight, InsertAccountAgentRun, InsertAccount, IndexProgressTable, IndexProgress, EventsTable, Event, Database, ChatSessionsTable, ChatSession, ChatMessagesTable, ChatMessage, BlocksTable, Block, ApiKeysTable, ApiKey, AccountsTable, AccountInsightsTable, AccountInsight, AccountAgentRunsTable, AccountAgentRun, Account };
@@ -359,6 +359,8 @@ interface Database {
359
359
  workflow_signer_secrets: WorkflowSignerSecretsTable;
360
360
  workflow_budgets: WorkflowBudgetsTable;
361
361
  tenants: TenantsTable;
362
+ tenant_usage_monthly: TenantUsageMonthlyTable;
363
+ provisioning_audit_log: ProvisioningAuditLogTable;
362
364
  }
363
365
  type TenantStatus = "provisioning" | "active" | "suspended" | "error" | "deleted";
364
366
  interface TenantsTable {
@@ -392,6 +394,36 @@ interface TenantsTable {
392
394
  type Tenant = Selectable<TenantsTable>;
393
395
  type InsertTenant = Insertable<TenantsTable>;
394
396
  type UpdateTenant = Updateable<TenantsTable>;
397
+ interface TenantUsageMonthlyTable {
398
+ id: Generated<string>;
399
+ tenant_id: string;
400
+ period_month: Date;
401
+ storage_peak_mb: Generated<number>;
402
+ storage_avg_mb: Generated<number>;
403
+ storage_last_mb: Generated<number>;
404
+ measurements: Generated<number>;
405
+ first_at: Generated<Date>;
406
+ last_at: Generated<Date>;
407
+ }
408
+ type TenantUsageMonthly = Selectable<TenantUsageMonthlyTable>;
409
+ type InsertTenantUsageMonthly = Insertable<TenantUsageMonthlyTable>;
410
+ type UpdateTenantUsageMonthly = Updateable<TenantUsageMonthlyTable>;
411
+ type ProvisioningAuditEvent = "provision.start" | "provision.success" | "provision.failure" | "suspend" | "resume" | "resize" | "keys.rotate" | "bastion.key.upload" | "bastion.key.revoke" | "teardown";
412
+ type ProvisioningAuditStatus = "ok" | "error";
413
+ interface ProvisioningAuditLogTable {
414
+ id: Generated<string>;
415
+ tenant_id: string | null;
416
+ tenant_slug: string | null;
417
+ account_id: string | null;
418
+ actor: string;
419
+ event: ProvisioningAuditEvent;
420
+ status: ProvisioningAuditStatus;
421
+ detail: unknown | null;
422
+ error: string | null;
423
+ created_at: Generated<Date>;
424
+ }
425
+ type ProvisioningAuditLog = Selectable<ProvisioningAuditLogTable>;
426
+ type InsertProvisioningAuditLog = Insertable<ProvisioningAuditLogTable>;
395
427
  interface WorkflowBudgetsTable {
396
428
  id: Generated<string>;
397
429
  workflow_definition_id: string;
@@ -631,6 +663,19 @@ declare class Logger {
631
663
  }
632
664
  declare const logger: Logger;
633
665
  import { z as z2 } from "zod/v4";
666
+ /**
667
+ * Account profile shapes. Unrelated to marketplace — previously lived in
668
+ * schemas/marketplace.ts alongside public-directory types. Kept here now
669
+ * that marketplace is gone so the profile fields (display_name, bio, slug)
670
+ * have a stable home.
671
+ */
672
+ interface UpdateProfileRequest {
673
+ display_name?: string;
674
+ bio?: string;
675
+ slug?: string;
676
+ }
677
+ declare const UpdateProfileRequestSchema: z2.ZodType<UpdateProfileRequest>;
678
+ import { z as z3 } from "zod/v4";
634
679
  interface StxTransferFilter {
635
680
  type: "stx_transfer";
636
681
  sender?: string;
@@ -709,82 +754,20 @@ interface PrintEventFilter {
709
754
  contains?: string;
710
755
  }
711
756
  type EventFilter = StxTransferFilter | StxMintFilter | StxBurnFilter | StxLockFilter | FtTransferFilter | FtMintFilter | FtBurnFilter | NftTransferFilter | NftMintFilter | NftBurnFilter | ContractCallFilter | ContractDeployFilter | PrintEventFilter;
712
- declare const StxTransferFilterSchema: z2.ZodType<StxTransferFilter>;
713
- declare const StxMintFilterSchema: z2.ZodType<StxMintFilter>;
714
- declare const StxBurnFilterSchema: z2.ZodType<StxBurnFilter>;
715
- declare const StxLockFilterSchema: z2.ZodType<StxLockFilter>;
716
- declare const FtTransferFilterSchema: z2.ZodType<FtTransferFilter>;
717
- declare const FtMintFilterSchema: z2.ZodType<FtMintFilter>;
718
- declare const FtBurnFilterSchema: z2.ZodType<FtBurnFilter>;
719
- declare const NftTransferFilterSchema: z2.ZodType<NftTransferFilter>;
720
- declare const NftMintFilterSchema: z2.ZodType<NftMintFilter>;
721
- declare const NftBurnFilterSchema: z2.ZodType<NftBurnFilter>;
722
- declare const ContractCallFilterSchema: z2.ZodType<ContractCallFilter>;
723
- declare const ContractDeployFilterSchema: z2.ZodType<ContractDeployFilter>;
724
- declare const PrintEventFilterSchema: z2.ZodType<PrintEventFilter>;
725
- declare const EventFilterSchema: z2.ZodType<EventFilter>;
726
- import { z as z3 } from "zod/v4";
727
- interface PublishSubgraphRequest {
728
- tags?: string[];
729
- description?: string;
730
- }
731
- interface UpdateProfileRequest {
732
- display_name?: string;
733
- bio?: string;
734
- slug?: string;
735
- }
736
- interface ForkSubgraphRequest {
737
- sourceSubgraphName: string;
738
- newName?: string;
739
- }
740
- declare const PublishSubgraphRequestSchema: z3.ZodType<PublishSubgraphRequest>;
741
- declare const UpdateProfileRequestSchema: z3.ZodType<UpdateProfileRequest>;
742
- declare const ForkSubgraphRequestSchema: z3.ZodType<ForkSubgraphRequest>;
743
- interface MarketplaceCreator {
744
- displayName: string | null;
745
- slug: string | null;
746
- }
747
- interface MarketplaceSubgraphSummary {
748
- name: string;
749
- description: string | null;
750
- tags: string[];
751
- creator: MarketplaceCreator;
752
- status: string;
753
- version: string;
754
- tables: string[];
755
- totalQueries7d: number;
756
- progress: number;
757
- createdAt: string;
758
- }
759
- interface MarketplaceSubgraphDetail extends MarketplaceSubgraphSummary {
760
- tableSchemas: Record<string, {
761
- columns: Record<string, {
762
- type: string
763
- nullable?: boolean
764
- }>
765
- rowCount: number
766
- endpoint: string
767
- }>;
768
- sources: Record<string, unknown>;
769
- startBlock: number;
770
- lastProcessedBlock: number;
771
- forkedFrom: string | null;
772
- usage: {
773
- totalQueries7d: number
774
- totalQueries30d: number
775
- daily: Array<{
776
- date: string
777
- count: number
778
- }>
779
- };
780
- }
781
- interface CreatorProfile {
782
- displayName: string | null;
783
- bio: string | null;
784
- avatarUrl: string | null;
785
- slug: string | null;
786
- subgraphs: MarketplaceSubgraphSummary[];
787
- }
757
+ declare const StxTransferFilterSchema: z3.ZodType<StxTransferFilter>;
758
+ declare const StxMintFilterSchema: z3.ZodType<StxMintFilter>;
759
+ declare const StxBurnFilterSchema: z3.ZodType<StxBurnFilter>;
760
+ declare const StxLockFilterSchema: z3.ZodType<StxLockFilter>;
761
+ declare const FtTransferFilterSchema: z3.ZodType<FtTransferFilter>;
762
+ declare const FtMintFilterSchema: z3.ZodType<FtMintFilter>;
763
+ declare const FtBurnFilterSchema: z3.ZodType<FtBurnFilter>;
764
+ declare const NftTransferFilterSchema: z3.ZodType<NftTransferFilter>;
765
+ declare const NftMintFilterSchema: z3.ZodType<NftMintFilter>;
766
+ declare const NftBurnFilterSchema: z3.ZodType<NftBurnFilter>;
767
+ declare const ContractCallFilterSchema: z3.ZodType<ContractCallFilter>;
768
+ declare const ContractDeployFilterSchema: z3.ZodType<ContractDeployFilter>;
769
+ declare const PrintEventFilterSchema: z3.ZodType<PrintEventFilter>;
770
+ declare const EventFilterSchema: z3.ZodType<EventFilter>;
788
771
  import { z as z4 } from "zod/v4";
789
772
  interface DeploySubgraphRequest {
790
773
  name: string;
@@ -928,4 +911,4 @@ declare function createSignatureHeader(payload: string, secret: string, timestam
928
911
  * Returns true if valid, false otherwise
929
912
  */
930
913
  declare function verifySignatureHeader(payload: string, header: string, secret: string, toleranceSeconds?: number): boolean;
931
- export { sql, parseJsonb, logger, jsonb, getTargetDb, getSourceDb, getRawClient, getErrorMessage, getEnv, getDb, exports_hmac as crypto, closeDb, WorkflowStepsTable, WorkflowStep, WorkflowSignerSecretsTable, WorkflowSignerSecret, WorkflowSchedulesTable, WorkflowSchedule, WorkflowRunsTable, WorkflowRun, WorkflowQueueTable, WorkflowQueueItem, WorkflowDefinitionsTable, WorkflowDefinition, WorkflowCursorsTable, WorkflowCursor, WorkflowBudgetsTable, WorkflowBudget, WaitlistTable, VersionConflictError, ValidationError, UsageSnapshotsTable, UsageSnapshot, UsageDailyTable, UsageDaily, UpdateWorkflowStep, UpdateWorkflowSignerSecret, UpdateWorkflowSchedule, UpdateWorkflowRun, UpdateWorkflowDefinition, UpdateWorkflowBudget, UpdateTransaction, UpdateTenant, UpdateSubgraph, UpdateProject, UpdateProfileRequestSchema, UpdateProfileRequest, UpdateIndexProgress, UpdateEvent, UpdateChatSession, UpdateBlock, UpdateApiKey, TrialExpiredError, TransactionsTable, Transaction, TenantsTable, TenantSuspendedError, TenantStatus, Tenant, TeamMembersTable, TeamMember, TeamInvitationsTable, TeamInvitation, SubgraphsTable, SubgraphUsageDailyTable, SubgraphUsageDaily, SubgraphTableSnapshotsTable, SubgraphSyncInfo, SubgraphSummary, SubgraphQueryParams, SubgraphProcessingStatsTable, SubgraphHealthSnapshotsTable, SubgraphHealthSnapshot, SubgraphGapsTable, SubgraphGapsResponse, SubgraphGapRange, SubgraphGapEntry, SubgraphGap, SubgraphDetail, Subgraph, StxTransferFilterSchema, StxTransferFilter, StxMintFilterSchema, StxMintFilter, StxLockFilterSchema, StxLockFilter, StxBurnFilterSchema, StxBurnFilter, SessionsTable, Session, SecondLayerError, ReindexResponse, RateLimitError, PublishSubgraphRequestSchema, PublishSubgraphRequest, ProjectsTable, Project, PrintEventFilterSchema, PrintEventFilter, NotFoundError, NftTransferFilterSchema, NftTransferFilter, NftMintFilterSchema, NftMintFilter, NftBurnFilterSchema, NftBurnFilter, MarketplaceSubgraphSummary, MarketplaceSubgraphDetail, MarketplaceCreator, MagicLinksTable, MagicLink, KeyRotatedError, InsertWorkflowStep, InsertWorkflowSignerSecret, InsertWorkflowSchedule, InsertWorkflowRun, InsertWorkflowQueueItem, InsertWorkflowDefinition, InsertWorkflowBudget, InsertTransaction, InsertTenant, InsertTeamMember, InsertTeamInvitation, InsertSubgraphUsageDaily, InsertSubgraphHealthSnapshot, InsertSubgraphGap, InsertSubgraph, InsertSession, InsertProject, InsertMagicLink, InsertIndexProgress, InsertEvent, InsertChatSession, InsertChatMessage, InsertBlock, InsertApiKey, InsertAccountInsight, InsertAccountAgentRun, InsertAccount, IndexProgressTable, IndexProgress, FtTransferFilterSchema, FtTransferFilter, FtMintFilterSchema, FtMintFilter, FtBurnFilterSchema, FtBurnFilter, ForkSubgraphRequestSchema, ForkSubgraphRequest, ForbiddenError, EventsTable, EventFilterSchema, EventFilter, Event, ErrorCodes, ErrorCode, Env, DeploySubgraphResponse, DeploySubgraphRequestSchema, DeploySubgraphRequest, DatabaseError, Database, CreatorProfile, ContractDeployFilterSchema, ContractDeployFilter, ContractCallFilterSchema, ContractCallFilter, ChatSessionsTable, ChatSession, ChatMessagesTable, ChatMessage, CODE_TO_STATUS, BlocksTable, Block, AuthorizationError, AuthenticationError, ApiKeysTable, ApiKey, AccountsTable, AccountInsightsTable, AccountInsight, AccountAgentRunsTable, AccountAgentRun, Account };
914
+ export { sql, parseJsonb, logger, jsonb, getTargetDb, getSourceDb, getRawClient, getErrorMessage, getEnv, getDb, exports_hmac as crypto, closeDb, WorkflowStepsTable, WorkflowStep, WorkflowSignerSecretsTable, WorkflowSignerSecret, WorkflowSchedulesTable, WorkflowSchedule, WorkflowRunsTable, WorkflowRun, WorkflowQueueTable, WorkflowQueueItem, WorkflowDefinitionsTable, WorkflowDefinition, WorkflowCursorsTable, WorkflowCursor, WorkflowBudgetsTable, WorkflowBudget, WaitlistTable, VersionConflictError, ValidationError, UsageSnapshotsTable, UsageSnapshot, UsageDailyTable, UsageDaily, UpdateWorkflowStep, UpdateWorkflowSignerSecret, UpdateWorkflowSchedule, UpdateWorkflowRun, UpdateWorkflowDefinition, UpdateWorkflowBudget, UpdateTransaction, UpdateTenantUsageMonthly, UpdateTenant, UpdateSubgraph, UpdateProject, UpdateProfileRequestSchema, UpdateProfileRequest, UpdateIndexProgress, UpdateEvent, UpdateChatSession, UpdateBlock, UpdateApiKey, TrialExpiredError, TransactionsTable, Transaction, TenantsTable, TenantUsageMonthlyTable, TenantUsageMonthly, TenantSuspendedError, TenantStatus, Tenant, TeamMembersTable, TeamMember, TeamInvitationsTable, TeamInvitation, SubgraphsTable, SubgraphUsageDailyTable, SubgraphUsageDaily, SubgraphTableSnapshotsTable, SubgraphSyncInfo, SubgraphSummary, SubgraphQueryParams, SubgraphProcessingStatsTable, SubgraphHealthSnapshotsTable, SubgraphHealthSnapshot, SubgraphGapsTable, SubgraphGapsResponse, SubgraphGapRange, SubgraphGapEntry, SubgraphGap, SubgraphDetail, Subgraph, StxTransferFilterSchema, StxTransferFilter, StxMintFilterSchema, StxMintFilter, StxLockFilterSchema, StxLockFilter, StxBurnFilterSchema, StxBurnFilter, SessionsTable, Session, SecondLayerError, ReindexResponse, RateLimitError, ProvisioningAuditStatus, ProvisioningAuditLogTable, ProvisioningAuditLog, ProvisioningAuditEvent, ProjectsTable, Project, PrintEventFilterSchema, PrintEventFilter, NotFoundError, NftTransferFilterSchema, NftTransferFilter, NftMintFilterSchema, NftMintFilter, NftBurnFilterSchema, NftBurnFilter, MagicLinksTable, MagicLink, KeyRotatedError, InsertWorkflowStep, InsertWorkflowSignerSecret, InsertWorkflowSchedule, InsertWorkflowRun, InsertWorkflowQueueItem, InsertWorkflowDefinition, InsertWorkflowBudget, InsertTransaction, InsertTenantUsageMonthly, InsertTenant, InsertTeamMember, InsertTeamInvitation, InsertSubgraphUsageDaily, InsertSubgraphHealthSnapshot, InsertSubgraphGap, InsertSubgraph, InsertSession, InsertProvisioningAuditLog, InsertProject, InsertMagicLink, InsertIndexProgress, InsertEvent, InsertChatSession, InsertChatMessage, InsertBlock, InsertApiKey, InsertAccountInsight, InsertAccountAgentRun, InsertAccount, IndexProgressTable, IndexProgress, FtTransferFilterSchema, FtTransferFilter, FtMintFilterSchema, FtMintFilter, FtBurnFilterSchema, FtBurnFilter, ForbiddenError, EventsTable, EventFilterSchema, EventFilter, Event, ErrorCodes, ErrorCode, Env, DeploySubgraphResponse, DeploySubgraphRequestSchema, DeploySubgraphRequest, DatabaseError, Database, ContractDeployFilterSchema, ContractDeployFilter, ContractCallFilterSchema, ContractCallFilter, ChatSessionsTable, ChatSession, ChatMessagesTable, ChatMessage, CODE_TO_STATUS, BlocksTable, Block, AuthorizationError, AuthenticationError, ApiKeysTable, ApiKey, AccountsTable, AccountInsightsTable, AccountInsight, AccountAgentRunsTable, AccountAgentRun, Account };
package/dist/src/index.js CHANGED
@@ -330,11 +330,19 @@ class Logger {
330
330
  }
331
331
  var logger = new Logger;
332
332
 
333
+ // src/schemas/accounts.ts
334
+ import { z as z2 } from "zod/v4";
335
+ var UpdateProfileRequestSchema = z2.object({
336
+ display_name: z2.string().max(50).optional(),
337
+ bio: z2.string().max(300).optional(),
338
+ slug: z2.string().regex(/^[a-z0-9-]+$/, "lowercase alphanumeric + hyphens only").min(3).max(30).optional()
339
+ });
340
+
333
341
  // src/schemas/filters.ts
334
342
  import { isValidAddress as _isValidAddress } from "@secondlayer/stacks";
335
- import { z as z2 } from "zod/v4";
343
+ import { z as z3 } from "zod/v4";
336
344
  var isValidAddress = _isValidAddress;
337
- var stacksPrincipal = z2.string().refine((val) => {
345
+ var stacksPrincipal = z3.string().refine((val) => {
338
346
  const parts = val.split(".");
339
347
  if (parts.length > 2)
340
348
  return false;
@@ -344,81 +352,81 @@ var baseFilter = {
344
352
  sender: stacksPrincipal.optional(),
345
353
  recipient: stacksPrincipal.optional()
346
354
  };
347
- var StxTransferFilterSchema = z2.object({
348
- type: z2.literal("stx_transfer"),
355
+ var StxTransferFilterSchema = z3.object({
356
+ type: z3.literal("stx_transfer"),
349
357
  ...baseFilter,
350
- minAmount: z2.coerce.number().int().positive().optional(),
351
- maxAmount: z2.coerce.number().int().positive().optional()
358
+ minAmount: z3.coerce.number().int().positive().optional(),
359
+ maxAmount: z3.coerce.number().int().positive().optional()
352
360
  });
353
- var StxMintFilterSchema = z2.object({
354
- type: z2.literal("stx_mint"),
361
+ var StxMintFilterSchema = z3.object({
362
+ type: z3.literal("stx_mint"),
355
363
  recipient: stacksPrincipal.optional(),
356
- minAmount: z2.coerce.number().int().positive().optional()
364
+ minAmount: z3.coerce.number().int().positive().optional()
357
365
  });
358
- var StxBurnFilterSchema = z2.object({
359
- type: z2.literal("stx_burn"),
366
+ var StxBurnFilterSchema = z3.object({
367
+ type: z3.literal("stx_burn"),
360
368
  sender: stacksPrincipal.optional(),
361
- minAmount: z2.coerce.number().int().positive().optional()
369
+ minAmount: z3.coerce.number().int().positive().optional()
362
370
  });
363
- var StxLockFilterSchema = z2.object({
364
- type: z2.literal("stx_lock"),
371
+ var StxLockFilterSchema = z3.object({
372
+ type: z3.literal("stx_lock"),
365
373
  lockedAddress: stacksPrincipal.optional(),
366
- minAmount: z2.coerce.number().int().positive().optional()
374
+ minAmount: z3.coerce.number().int().positive().optional()
367
375
  });
368
- var FtTransferFilterSchema = z2.object({
369
- type: z2.literal("ft_transfer"),
376
+ var FtTransferFilterSchema = z3.object({
377
+ type: z3.literal("ft_transfer"),
370
378
  ...baseFilter,
371
- assetIdentifier: z2.string().optional(),
372
- minAmount: z2.coerce.number().int().positive().optional()
379
+ assetIdentifier: z3.string().optional(),
380
+ minAmount: z3.coerce.number().int().positive().optional()
373
381
  });
374
- var FtMintFilterSchema = z2.object({
375
- type: z2.literal("ft_mint"),
382
+ var FtMintFilterSchema = z3.object({
383
+ type: z3.literal("ft_mint"),
376
384
  recipient: stacksPrincipal.optional(),
377
- assetIdentifier: z2.string().optional(),
378
- minAmount: z2.coerce.number().int().positive().optional()
385
+ assetIdentifier: z3.string().optional(),
386
+ minAmount: z3.coerce.number().int().positive().optional()
379
387
  });
380
- var FtBurnFilterSchema = z2.object({
381
- type: z2.literal("ft_burn"),
388
+ var FtBurnFilterSchema = z3.object({
389
+ type: z3.literal("ft_burn"),
382
390
  sender: stacksPrincipal.optional(),
383
- assetIdentifier: z2.string().optional(),
384
- minAmount: z2.coerce.number().int().positive().optional()
391
+ assetIdentifier: z3.string().optional(),
392
+ minAmount: z3.coerce.number().int().positive().optional()
385
393
  });
386
- var NftTransferFilterSchema = z2.object({
387
- type: z2.literal("nft_transfer"),
394
+ var NftTransferFilterSchema = z3.object({
395
+ type: z3.literal("nft_transfer"),
388
396
  ...baseFilter,
389
- assetIdentifier: z2.string().optional(),
390
- tokenId: z2.string().optional()
397
+ assetIdentifier: z3.string().optional(),
398
+ tokenId: z3.string().optional()
391
399
  });
392
- var NftMintFilterSchema = z2.object({
393
- type: z2.literal("nft_mint"),
400
+ var NftMintFilterSchema = z3.object({
401
+ type: z3.literal("nft_mint"),
394
402
  recipient: stacksPrincipal.optional(),
395
- assetIdentifier: z2.string().optional(),
396
- tokenId: z2.string().optional()
403
+ assetIdentifier: z3.string().optional(),
404
+ tokenId: z3.string().optional()
397
405
  });
398
- var NftBurnFilterSchema = z2.object({
399
- type: z2.literal("nft_burn"),
406
+ var NftBurnFilterSchema = z3.object({
407
+ type: z3.literal("nft_burn"),
400
408
  sender: stacksPrincipal.optional(),
401
- assetIdentifier: z2.string().optional(),
402
- tokenId: z2.string().optional()
409
+ assetIdentifier: z3.string().optional(),
410
+ tokenId: z3.string().optional()
403
411
  });
404
- var ContractCallFilterSchema = z2.object({
405
- type: z2.literal("contract_call"),
412
+ var ContractCallFilterSchema = z3.object({
413
+ type: z3.literal("contract_call"),
406
414
  contractId: stacksPrincipal.optional(),
407
- functionName: z2.string().optional(),
415
+ functionName: z3.string().optional(),
408
416
  caller: stacksPrincipal.optional()
409
417
  });
410
- var ContractDeployFilterSchema = z2.object({
411
- type: z2.literal("contract_deploy"),
418
+ var ContractDeployFilterSchema = z3.object({
419
+ type: z3.literal("contract_deploy"),
412
420
  deployer: stacksPrincipal.optional(),
413
- contractName: z2.string().optional()
421
+ contractName: z3.string().optional()
414
422
  });
415
- var PrintEventFilterSchema = z2.object({
416
- type: z2.literal("print_event"),
423
+ var PrintEventFilterSchema = z3.object({
424
+ type: z3.literal("print_event"),
417
425
  contractId: stacksPrincipal.optional(),
418
- topic: z2.string().optional(),
419
- contains: z2.string().optional()
426
+ topic: z3.string().optional(),
427
+ contains: z3.string().optional()
420
428
  });
421
- var EventFilterSchema = z2.discriminatedUnion("type", [
429
+ var EventFilterSchema = z3.discriminatedUnion("type", [
422
430
  StxTransferFilterSchema,
423
431
  StxMintFilterSchema,
424
432
  StxBurnFilterSchema,
@@ -434,22 +442,6 @@ var EventFilterSchema = z2.discriminatedUnion("type", [
434
442
  PrintEventFilterSchema
435
443
  ]);
436
444
 
437
- // src/schemas/marketplace.ts
438
- import { z as z3 } from "zod/v4";
439
- var PublishSubgraphRequestSchema = z3.object({
440
- tags: z3.array(z3.string().max(30)).max(5).optional(),
441
- description: z3.string().max(500).optional()
442
- });
443
- var UpdateProfileRequestSchema = z3.object({
444
- display_name: z3.string().max(50).optional(),
445
- bio: z3.string().max(300).optional(),
446
- slug: z3.string().regex(/^[a-z0-9-]+$/, "lowercase alphanumeric + hyphens only").min(3).max(30).optional()
447
- });
448
- var ForkSubgraphRequestSchema = z3.object({
449
- sourceSubgraphName: z3.string(),
450
- newName: z3.string().regex(/^[a-z0-9-]+$/, "lowercase alphanumeric + hyphens only").max(63).optional()
451
- });
452
-
453
445
  // src/schemas/subgraphs.ts
454
446
  import { z as z4 } from "zod/v4";
455
447
  var DeploySubgraphRequestSchema = z4.object({
@@ -539,7 +531,6 @@ export {
539
531
  StxBurnFilterSchema,
540
532
  SecondLayerError,
541
533
  RateLimitError,
542
- PublishSubgraphRequestSchema,
543
534
  PrintEventFilterSchema,
544
535
  NotFoundError,
545
536
  NftTransferFilterSchema,
@@ -549,7 +540,6 @@ export {
549
540
  FtTransferFilterSchema,
550
541
  FtMintFilterSchema,
551
542
  FtBurnFilterSchema,
552
- ForkSubgraphRequestSchema,
553
543
  ForbiddenError,
554
544
  EventFilterSchema,
555
545
  ErrorCodes,
@@ -562,5 +552,5 @@ export {
562
552
  AuthenticationError
563
553
  };
564
554
 
565
- //# debugId=C27B5257F4D1169564756E2164756E21
555
+ //# debugId=60BFE68B9512AB8264756E2164756E21
566
556
  //# sourceMappingURL=index.js.map