@secondlayer/shared 1.1.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.
- package/dist/src/db/index.d.ts +89 -6
- package/dist/src/db/index.js +53 -29
- package/dist/src/db/index.js.map +4 -4
- package/dist/src/db/jsonb.js.map +2 -2
- package/dist/src/db/queries/accounts.d.ts +58 -2
- package/dist/src/db/queries/integrity.d.ts +58 -2
- package/dist/src/db/queries/projects.d.ts +58 -2
- package/dist/src/db/queries/projects.js.map +2 -2
- package/dist/src/db/queries/{marketplace.d.ts → provisioning-audit.d.ts} +79 -56
- package/dist/src/db/queries/provisioning-audit.js +40 -0
- package/dist/src/db/queries/provisioning-audit.js.map +10 -0
- package/dist/src/db/queries/subgraph-gaps.d.ts +58 -2
- package/dist/src/db/queries/subgraphs.d.ts +62 -5
- package/dist/src/db/queries/subgraphs.js +3 -9
- package/dist/src/db/queries/subgraphs.js.map +4 -4
- package/dist/src/db/queries/tenants.d.ts +527 -0
- package/dist/src/db/queries/tenants.js +220 -0
- package/dist/src/db/queries/tenants.js.map +11 -0
- package/dist/src/db/queries/usage.d.ts +58 -2
- package/dist/src/db/queries/usage.js +3 -3
- package/dist/src/db/queries/usage.js.map +3 -3
- package/dist/src/db/queries/workflows.d.ts +58 -2
- package/dist/src/db/queries/workflows.js +31 -3
- package/dist/src/db/queries/workflows.js.map +4 -4
- package/dist/src/db/schema.d.ts +67 -3
- package/dist/src/env.d.ts +10 -0
- package/dist/src/env.js +3 -1
- package/dist/src/env.js.map +3 -3
- package/dist/src/errors.d.ts +17 -3
- package/dist/src/errors.js +34 -3
- package/dist/src/errors.js.map +3 -3
- package/dist/src/index.d.ts +142 -84
- package/dist/src/index.js +146 -99
- package/dist/src/index.js.map +8 -8
- package/dist/src/logger.js +3 -1
- package/dist/src/logger.js.map +3 -3
- package/dist/src/mode.d.ts +29 -0
- package/dist/src/mode.js +43 -0
- package/dist/src/mode.js.map +10 -0
- package/dist/src/node/archive-client.js +3 -1
- package/dist/src/node/archive-client.js.map +3 -3
- package/dist/src/node/hiro-client.js +3 -1
- package/dist/src/node/hiro-client.js.map +3 -3
- package/dist/src/node/local-client.d.ts +58 -2
- package/dist/src/queue/listener.d.ts +11 -2
- package/dist/src/queue/listener.js +11 -12
- package/dist/src/queue/listener.js.map +3 -3
- package/dist/src/schemas/accounts.d.ts +14 -0
- package/dist/src/schemas/{marketplace.js → accounts.js} +4 -14
- package/dist/src/schemas/accounts.js.map +10 -0
- package/dist/src/schemas/index.d.ts +28 -77
- package/dist/src/schemas/index.js +59 -69
- package/dist/src/schemas/index.js.map +4 -4
- package/dist/src/types.d.ts +10 -0
- package/migrations/0037_nullable_api_key.ts +35 -0
- package/migrations/0038_drop_workflow_tables.ts +46 -0
- package/migrations/0039_tenants.ts +66 -0
- package/migrations/0040_tenant_key_generations.ts +29 -0
- package/migrations/0041_subgraphs_drop_api_key_id.ts +49 -0
- package/migrations/0042_tenant_project_id.ts +25 -0
- package/migrations/0043_tenant_usage_monthly.ts +36 -0
- package/migrations/0044_provisioning_audit_log.ts +40 -0
- package/package.json +15 -7
- package/dist/src/db/queries/marketplace.js +0 -142
- package/dist/src/db/queries/marketplace.js.map +0 -10
- package/dist/src/schemas/marketplace.d.ts +0 -63
- package/dist/src/schemas/marketplace.js.map +0 -10
package/dist/src/db/schema.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Generated, Insertable, Selectable, Updateable } from "kysely";
|
|
1
|
+
import { ColumnType, Generated, Insertable, Selectable, Updateable } from "kysely";
|
|
2
2
|
interface BlocksTable {
|
|
3
3
|
height: number;
|
|
4
4
|
hash: string;
|
|
@@ -55,7 +55,6 @@ interface SubgraphsTable {
|
|
|
55
55
|
last_error_at: Date | null;
|
|
56
56
|
total_processed: Generated<number>;
|
|
57
57
|
total_errors: Generated<number>;
|
|
58
|
-
api_key_id: string | null;
|
|
59
58
|
account_id: string;
|
|
60
59
|
handler_code: string | null;
|
|
61
60
|
source_code: string | null;
|
|
@@ -359,7 +358,72 @@ interface Database {
|
|
|
359
358
|
workflow_cursors: WorkflowCursorsTable;
|
|
360
359
|
workflow_signer_secrets: WorkflowSignerSecretsTable;
|
|
361
360
|
workflow_budgets: WorkflowBudgetsTable;
|
|
361
|
+
tenants: TenantsTable;
|
|
362
|
+
tenant_usage_monthly: TenantUsageMonthlyTable;
|
|
363
|
+
provisioning_audit_log: ProvisioningAuditLogTable;
|
|
364
|
+
}
|
|
365
|
+
type TenantStatus = "provisioning" | "active" | "suspended" | "error" | "deleted";
|
|
366
|
+
interface TenantsTable {
|
|
367
|
+
id: Generated<string>;
|
|
368
|
+
account_id: string;
|
|
369
|
+
slug: string;
|
|
370
|
+
status: ColumnType<TenantStatus, TenantStatus | undefined, TenantStatus>;
|
|
371
|
+
plan: string;
|
|
372
|
+
cpus: ColumnType<number, number | string, number | string>;
|
|
373
|
+
memory_mb: number;
|
|
374
|
+
storage_limit_mb: number;
|
|
375
|
+
storage_used_mb: number | null;
|
|
376
|
+
pg_container_id: string | null;
|
|
377
|
+
api_container_id: string | null;
|
|
378
|
+
processor_container_id: string | null;
|
|
379
|
+
target_database_url_enc: Buffer;
|
|
380
|
+
tenant_jwt_secret_enc: Buffer;
|
|
381
|
+
anon_key_enc: Buffer;
|
|
382
|
+
service_key_enc: Buffer;
|
|
383
|
+
api_url_internal: string;
|
|
384
|
+
api_url_public: string;
|
|
385
|
+
trial_ends_at: Date;
|
|
386
|
+
suspended_at: Date | null;
|
|
387
|
+
last_health_check_at: Date | null;
|
|
388
|
+
service_gen: Generated<number>;
|
|
389
|
+
anon_gen: Generated<number>;
|
|
390
|
+
project_id: string | null;
|
|
391
|
+
created_at: Generated<Date>;
|
|
392
|
+
updated_at: Generated<Date>;
|
|
393
|
+
}
|
|
394
|
+
type Tenant = Selectable<TenantsTable>;
|
|
395
|
+
type InsertTenant = Insertable<TenantsTable>;
|
|
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>;
|
|
362
424
|
}
|
|
425
|
+
type ProvisioningAuditLog = Selectable<ProvisioningAuditLogTable>;
|
|
426
|
+
type InsertProvisioningAuditLog = Insertable<ProvisioningAuditLogTable>;
|
|
363
427
|
interface WorkflowBudgetsTable {
|
|
364
428
|
id: Generated<string>;
|
|
365
429
|
workflow_definition_id: string;
|
|
@@ -453,4 +517,4 @@ type InsertChatSession = Insertable<ChatSessionsTable>;
|
|
|
453
517
|
type UpdateChatSession = Updateable<ChatSessionsTable>;
|
|
454
518
|
type ChatMessage = Selectable<ChatMessagesTable>;
|
|
455
519
|
type InsertChatMessage = Insertable<ChatMessagesTable>;
|
|
456
|
-
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, UpdateSubgraph, UpdateProject, UpdateIndexProgress, UpdateEvent, UpdateChatSession, UpdateBlock, UpdateApiKey, TransactionsTable, Transaction, 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, 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 };
|
package/dist/src/env.d.ts
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { z } from "zod/v4";
|
|
2
2
|
interface EnvSchemaOutput {
|
|
3
3
|
DATABASE_URL?: string;
|
|
4
|
+
/**
|
|
5
|
+
* Shared indexer DB (blocks/txs/events). Falls back to DATABASE_URL.
|
|
6
|
+
* Set this alongside TARGET_DATABASE_URL to enable dual-DB mode.
|
|
7
|
+
*/
|
|
8
|
+
SOURCE_DATABASE_URL?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Tenant DB (subgraph schemas + subgraphs table). Falls back to DATABASE_URL.
|
|
11
|
+
* Set this alongside SOURCE_DATABASE_URL to enable dual-DB mode.
|
|
12
|
+
*/
|
|
13
|
+
TARGET_DATABASE_URL?: string;
|
|
4
14
|
NETWORK?: "mainnet" | "testnet";
|
|
5
15
|
NETWORKS?: ("mainnet" | "testnet")[];
|
|
6
16
|
LOG_LEVEL: "debug" | "info" | "warn" | "error";
|
package/dist/src/env.js
CHANGED
|
@@ -28,6 +28,8 @@ var networksSchema = z.string().transform((val) => {
|
|
|
28
28
|
});
|
|
29
29
|
var envSchema = z.object({
|
|
30
30
|
DATABASE_URL: z.preprocess((val) => typeof val === "string" && val.length === 0 ? undefined : val, z.string().url().optional()),
|
|
31
|
+
SOURCE_DATABASE_URL: z.preprocess((val) => typeof val === "string" && val.length === 0 ? undefined : val, z.string().url().optional()),
|
|
32
|
+
TARGET_DATABASE_URL: z.preprocess((val) => typeof val === "string" && val.length === 0 ? undefined : val, z.string().url().optional()),
|
|
31
33
|
NETWORK: z.enum(["mainnet", "testnet"]).optional(),
|
|
32
34
|
NETWORKS: networksSchema.optional(),
|
|
33
35
|
LOG_LEVEL: z.enum(["debug", "info", "warn", "error"]).default("info"),
|
|
@@ -60,5 +62,5 @@ export {
|
|
|
60
62
|
envSchema
|
|
61
63
|
};
|
|
62
64
|
|
|
63
|
-
//# debugId=
|
|
65
|
+
//# debugId=79C429909A41128E64756E2164756E21
|
|
64
66
|
//# sourceMappingURL=env.js.map
|
package/dist/src/env.js.map
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/env.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import { z } from \"zod/v4\";\n\n// Parse comma-separated networks\nconst networksSchema = z.string().transform((val) => {\n\tconst networks = val\n\t\t.split(\",\")\n\t\t.map((n) => n.trim())\n\t\t.filter(Boolean);\n\tconst valid = [\"mainnet\", \"testnet\"];\n\tfor (const n of networks) {\n\t\tif (!valid.includes(n)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid network: ${n}. Must be one of: ${valid.join(\", \")}`,\n\t\t\t);\n\t\t}\n\t}\n\treturn networks as (\"mainnet\" | \"testnet\")[];\n});\n\ninterface EnvSchemaOutput {\n\tDATABASE_URL?: string;\n\tNETWORK?: \"mainnet\" | \"testnet\";\n\tNETWORKS?: (\"mainnet\" | \"testnet\")[];\n\tLOG_LEVEL: \"debug\" | \"info\" | \"warn\" | \"error\";\n\tNODE_ENV: \"development\" | \"production\" | \"test\";\n}\n\n// Cast needed: z.preprocess / z.default create different _input vs _output types\n// that z.ZodType<T> can't represent without explicit input type param\nconst envSchema: z.ZodType<EnvSchemaOutput> = z.object({\n\tDATABASE_URL: z.preprocess(\n\t\t(val) => (typeof val === \"string\" && val.length === 0 ? undefined : val),\n\t\tz.string().url().optional(),\n\t),\n\tNETWORK: z.enum([\"mainnet\", \"testnet\"]).optional(),\n\tNETWORKS: networksSchema.optional(),\n\tLOG_LEVEL: z.enum([\"debug\", \"info\", \"warn\", \"error\"]).default(\"info\"),\n\tNODE_ENV: z\n\t\t.enum([\"development\", \"production\", \"test\"])\n\t\t.default(\"development\"),\n}) as unknown as z.ZodType<EnvSchemaOutput>;\n\nexport type Env = EnvSchemaOutput & {\n\tenabledNetworks: (\"mainnet\" | \"testnet\")[];\n};\n\nlet cachedEnv: Env | null = null;\n\nexport function getEnv(): Env {\n\tif (cachedEnv) {\n\t\treturn cachedEnv;\n\t}\n\n\tconst result = envSchema.safeParse(process.env);\n\n\tif (!result.success) {\n\t\tconsole.error(\"❌ Invalid environment configuration:\");\n\t\tconsole.error(z.treeifyError(result.error));\n\t\tthrow new Error(\"Invalid environment configuration\");\n\t}\n\n\t// Compute enabled networks from NETWORKS or NETWORK\n\tlet enabledNetworks: (\"mainnet\" | \"testnet\")[];\n\tif (result.data.NETWORKS && result.data.NETWORKS.length > 0) {\n\t\tenabledNetworks = result.data.NETWORKS;\n\t} else if (result.data.NETWORK) {\n\t\tenabledNetworks = [result.data.NETWORK];\n\t} else {\n\t\tenabledNetworks = [\"mainnet\"]; // Default\n\t}\n\n\tcachedEnv = { ...result.data, enabledNetworks };\n\treturn cachedEnv;\n}\n\n// Export for testing\nexport { envSchema };\n"
|
|
5
|
+
"import { z } from \"zod/v4\";\n\n// Parse comma-separated networks\nconst networksSchema = z.string().transform((val) => {\n\tconst networks = val\n\t\t.split(\",\")\n\t\t.map((n) => n.trim())\n\t\t.filter(Boolean);\n\tconst valid = [\"mainnet\", \"testnet\"];\n\tfor (const n of networks) {\n\t\tif (!valid.includes(n)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid network: ${n}. Must be one of: ${valid.join(\", \")}`,\n\t\t\t);\n\t\t}\n\t}\n\treturn networks as (\"mainnet\" | \"testnet\")[];\n});\n\ninterface EnvSchemaOutput {\n\tDATABASE_URL?: string;\n\t/**\n\t * Shared indexer DB (blocks/txs/events). Falls back to DATABASE_URL.\n\t * Set this alongside TARGET_DATABASE_URL to enable dual-DB mode.\n\t */\n\tSOURCE_DATABASE_URL?: string;\n\t/**\n\t * Tenant DB (subgraph schemas + subgraphs table). Falls back to DATABASE_URL.\n\t * Set this alongside SOURCE_DATABASE_URL to enable dual-DB mode.\n\t */\n\tTARGET_DATABASE_URL?: string;\n\tNETWORK?: \"mainnet\" | \"testnet\";\n\tNETWORKS?: (\"mainnet\" | \"testnet\")[];\n\tLOG_LEVEL: \"debug\" | \"info\" | \"warn\" | \"error\";\n\tNODE_ENV: \"development\" | \"production\" | \"test\";\n}\n\n// Cast needed: z.preprocess / z.default create different _input vs _output types\n// that z.ZodType<T> can't represent without explicit input type param\nconst envSchema: z.ZodType<EnvSchemaOutput> = z.object({\n\tDATABASE_URL: z.preprocess(\n\t\t(val) => (typeof val === \"string\" && val.length === 0 ? undefined : val),\n\t\tz.string().url().optional(),\n\t),\n\tSOURCE_DATABASE_URL: z.preprocess(\n\t\t(val) => (typeof val === \"string\" && val.length === 0 ? undefined : val),\n\t\tz.string().url().optional(),\n\t),\n\tTARGET_DATABASE_URL: z.preprocess(\n\t\t(val) => (typeof val === \"string\" && val.length === 0 ? undefined : val),\n\t\tz.string().url().optional(),\n\t),\n\tNETWORK: z.enum([\"mainnet\", \"testnet\"]).optional(),\n\tNETWORKS: networksSchema.optional(),\n\tLOG_LEVEL: z.enum([\"debug\", \"info\", \"warn\", \"error\"]).default(\"info\"),\n\tNODE_ENV: z\n\t\t.enum([\"development\", \"production\", \"test\"])\n\t\t.default(\"development\"),\n}) as unknown as z.ZodType<EnvSchemaOutput>;\n\nexport type Env = EnvSchemaOutput & {\n\tenabledNetworks: (\"mainnet\" | \"testnet\")[];\n};\n\nlet cachedEnv: Env | null = null;\n\nexport function getEnv(): Env {\n\tif (cachedEnv) {\n\t\treturn cachedEnv;\n\t}\n\n\tconst result = envSchema.safeParse(process.env);\n\n\tif (!result.success) {\n\t\tconsole.error(\"❌ Invalid environment configuration:\");\n\t\tconsole.error(z.treeifyError(result.error));\n\t\tthrow new Error(\"Invalid environment configuration\");\n\t}\n\n\t// Compute enabled networks from NETWORKS or NETWORK\n\tlet enabledNetworks: (\"mainnet\" | \"testnet\")[];\n\tif (result.data.NETWORKS && result.data.NETWORKS.length > 0) {\n\t\tenabledNetworks = result.data.NETWORKS;\n\t} else if (result.data.NETWORK) {\n\t\tenabledNetworks = [result.data.NETWORK];\n\t} else {\n\t\tenabledNetworks = [\"mainnet\"]; // Default\n\t}\n\n\tcachedEnv = { ...result.data, enabledNetworks };\n\treturn cachedEnv;\n}\n\n// Export for testing\nexport { envSchema };\n"
|
|
6
6
|
],
|
|
7
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAGA,IAAM,iBAAiB,EAAE,OAAO,EAAE,UAAU,CAAC,QAAQ;AAAA,EACpD,MAAM,WAAW,IACf,MAAM,GAAG,EACT,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,EACnB,OAAO,OAAO;AAAA,EAChB,MAAM,QAAQ,CAAC,WAAW,SAAS;AAAA,EACnC,WAAW,KAAK,UAAU;AAAA,IACzB,IAAI,CAAC,MAAM,SAAS,CAAC,GAAG;AAAA,MACvB,MAAM,IAAI,MACT,oBAAoB,sBAAsB,MAAM,KAAK,IAAI,GAC1D;AAAA,IACD;AAAA,EACD;AAAA,EACA,OAAO;AAAA,CACP;
|
|
8
|
-
"debugId": "
|
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAGA,IAAM,iBAAiB,EAAE,OAAO,EAAE,UAAU,CAAC,QAAQ;AAAA,EACpD,MAAM,WAAW,IACf,MAAM,GAAG,EACT,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,EACnB,OAAO,OAAO;AAAA,EAChB,MAAM,QAAQ,CAAC,WAAW,SAAS;AAAA,EACnC,WAAW,KAAK,UAAU;AAAA,IACzB,IAAI,CAAC,MAAM,SAAS,CAAC,GAAG;AAAA,MACvB,MAAM,IAAI,MACT,oBAAoB,sBAAsB,MAAM,KAAK,IAAI,GAC1D;AAAA,IACD;AAAA,EACD;AAAA,EACA,OAAO;AAAA,CACP;AAsBD,IAAM,YAAwC,EAAE,OAAO;AAAA,EACtD,cAAc,EAAE,WACf,CAAC,QAAS,OAAO,QAAQ,YAAY,IAAI,WAAW,IAAI,YAAY,KACpE,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,CAC3B;AAAA,EACA,qBAAqB,EAAE,WACtB,CAAC,QAAS,OAAO,QAAQ,YAAY,IAAI,WAAW,IAAI,YAAY,KACpE,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,CAC3B;AAAA,EACA,qBAAqB,EAAE,WACtB,CAAC,QAAS,OAAO,QAAQ,YAAY,IAAI,WAAW,IAAI,YAAY,KACpE,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,CAC3B;AAAA,EACA,SAAS,EAAE,KAAK,CAAC,WAAW,SAAS,CAAC,EAAE,SAAS;AAAA,EACjD,UAAU,eAAe,SAAS;AAAA,EAClC,WAAW,EAAE,KAAK,CAAC,SAAS,QAAQ,QAAQ,OAAO,CAAC,EAAE,QAAQ,MAAM;AAAA,EACpE,UAAU,EACR,KAAK,CAAC,eAAe,cAAc,MAAM,CAAC,EAC1C,QAAQ,aAAa;AACxB,CAAC;AAMD,IAAI,YAAwB;AAErB,SAAS,MAAM,GAAQ;AAAA,EAC7B,IAAI,WAAW;AAAA,IACd,OAAO;AAAA,EACR;AAAA,EAEA,MAAM,SAAS,UAAU,UAAU,QAAQ,GAAG;AAAA,EAE9C,IAAI,CAAC,OAAO,SAAS;AAAA,IACpB,QAAQ,MAAM,sCAAqC;AAAA,IACnD,QAAQ,MAAM,EAAE,aAAa,OAAO,KAAK,CAAC;AAAA,IAC1C,MAAM,IAAI,MAAM,mCAAmC;AAAA,EACpD;AAAA,EAGA,IAAI;AAAA,EACJ,IAAI,OAAO,KAAK,YAAY,OAAO,KAAK,SAAS,SAAS,GAAG;AAAA,IAC5D,kBAAkB,OAAO,KAAK;AAAA,EAC/B,EAAO,SAAI,OAAO,KAAK,SAAS;AAAA,IAC/B,kBAAkB,CAAC,OAAO,KAAK,OAAO;AAAA,EACvC,EAAO;AAAA,IACN,kBAAkB,CAAC,SAAS;AAAA;AAAA,EAG7B,YAAY,KAAK,OAAO,MAAM,gBAAgB;AAAA,EAC9C,OAAO;AAAA;",
|
|
8
|
+
"debugId": "79C429909A41128E64756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
package/dist/src/errors.d.ts
CHANGED
|
@@ -7,6 +7,11 @@ declare const ErrorCodes: {
|
|
|
7
7
|
readonly FORBIDDEN: "FORBIDDEN"
|
|
8
8
|
readonly VERSION_CONFLICT: "VERSION_CONFLICT"
|
|
9
9
|
readonly NOT_FOUND: "NOT_FOUND"
|
|
10
|
+
readonly KEY_ROTATED: "KEY_ROTATED"
|
|
11
|
+
readonly TRIAL_EXPIRED: "TRIAL_EXPIRED"
|
|
12
|
+
readonly TENANT_SUSPENDED: "TENANT_SUSPENDED"
|
|
13
|
+
readonly NO_TENANT_FOR_PROJECT: "NO_TENANT_FOR_PROJECT"
|
|
14
|
+
readonly INSTANCE_EXISTS: "INSTANCE_EXISTS"
|
|
10
15
|
};
|
|
11
16
|
type ErrorCode = (typeof ErrorCodes)[keyof typeof ErrorCodes];
|
|
12
17
|
/** Base error class for all Secondlayer errors. */
|
|
@@ -48,9 +53,18 @@ declare class VersionConflictError extends SecondLayerError {
|
|
|
48
53
|
expectedVersion: string;
|
|
49
54
|
constructor(currentVersion: string, expectedVersion: string);
|
|
50
55
|
}
|
|
56
|
+
declare class KeyRotatedError extends SecondLayerError {
|
|
57
|
+
constructor(message?: string);
|
|
58
|
+
}
|
|
59
|
+
declare class TrialExpiredError extends SecondLayerError {
|
|
60
|
+
constructor(message: string);
|
|
61
|
+
}
|
|
62
|
+
declare class TenantSuspendedError extends SecondLayerError {
|
|
63
|
+
constructor(message?: string);
|
|
64
|
+
}
|
|
51
65
|
/** Error code → HTTP status. Used by API middleware for code-based matching
|
|
52
66
|
* (avoids cross-bundle instanceof failures from bunup class duplication). */
|
|
53
|
-
type MappedCode = Extract<ErrorCode, "AUTHENTICATION_ERROR" | "AUTHORIZATION_ERROR" | "RATE_LIMIT_ERROR" | "FORBIDDEN" | "NOT_FOUND" | "VALIDATION_ERROR">;
|
|
54
|
-
declare const CODE_TO_STATUS: Record<MappedCode, 400 | 401 | 403 | 404 | 429>;
|
|
67
|
+
type MappedCode = Extract<ErrorCode, "AUTHENTICATION_ERROR" | "AUTHORIZATION_ERROR" | "RATE_LIMIT_ERROR" | "FORBIDDEN" | "NOT_FOUND" | "VALIDATION_ERROR" | "KEY_ROTATED" | "TRIAL_EXPIRED" | "TENANT_SUSPENDED" | "NO_TENANT_FOR_PROJECT" | "INSTANCE_EXISTS">;
|
|
68
|
+
declare const CODE_TO_STATUS: Record<MappedCode, 400 | 401 | 402 | 403 | 404 | 409 | 423 | 429>;
|
|
55
69
|
declare function getErrorMessage(err: unknown): string;
|
|
56
|
-
export { getErrorMessage, VersionConflictError, ValidationError, SecondLayerError, RateLimitError, NotFoundError, ForbiddenError, ErrorCodes, ErrorCode, DatabaseError, CODE_TO_STATUS, AuthorizationError, AuthenticationError };
|
|
70
|
+
export { getErrorMessage, VersionConflictError, ValidationError, TrialExpiredError, TenantSuspendedError, SecondLayerError, RateLimitError, NotFoundError, KeyRotatedError, ForbiddenError, ErrorCodes, ErrorCode, DatabaseError, CODE_TO_STATUS, AuthorizationError, AuthenticationError };
|
package/dist/src/errors.js
CHANGED
|
@@ -23,7 +23,12 @@ var ErrorCodes = {
|
|
|
23
23
|
RATE_LIMIT_ERROR: "RATE_LIMIT_ERROR",
|
|
24
24
|
FORBIDDEN: "FORBIDDEN",
|
|
25
25
|
VERSION_CONFLICT: "VERSION_CONFLICT",
|
|
26
|
-
NOT_FOUND: "NOT_FOUND"
|
|
26
|
+
NOT_FOUND: "NOT_FOUND",
|
|
27
|
+
KEY_ROTATED: "KEY_ROTATED",
|
|
28
|
+
TRIAL_EXPIRED: "TRIAL_EXPIRED",
|
|
29
|
+
TENANT_SUSPENDED: "TENANT_SUSPENDED",
|
|
30
|
+
NO_TENANT_FOR_PROJECT: "NO_TENANT_FOR_PROJECT",
|
|
31
|
+
INSTANCE_EXISTS: "INSTANCE_EXISTS"
|
|
27
32
|
};
|
|
28
33
|
|
|
29
34
|
class SecondLayerError extends Error {
|
|
@@ -98,13 +103,36 @@ class VersionConflictError extends SecondLayerError {
|
|
|
98
103
|
this.expectedVersion = expectedVersion;
|
|
99
104
|
}
|
|
100
105
|
}
|
|
106
|
+
|
|
107
|
+
class KeyRotatedError extends SecondLayerError {
|
|
108
|
+
constructor(message = "Token has been rotated") {
|
|
109
|
+
super("KEY_ROTATED", message);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
class TrialExpiredError extends SecondLayerError {
|
|
114
|
+
constructor(message) {
|
|
115
|
+
super("TRIAL_EXPIRED", message);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
class TenantSuspendedError extends SecondLayerError {
|
|
120
|
+
constructor(message = "Instance is suspended") {
|
|
121
|
+
super("TENANT_SUSPENDED", message);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
101
124
|
var CODE_TO_STATUS = {
|
|
102
125
|
AUTHENTICATION_ERROR: 401,
|
|
103
126
|
AUTHORIZATION_ERROR: 403,
|
|
104
127
|
RATE_LIMIT_ERROR: 429,
|
|
105
128
|
FORBIDDEN: 403,
|
|
106
129
|
NOT_FOUND: 404,
|
|
107
|
-
VALIDATION_ERROR: 400
|
|
130
|
+
VALIDATION_ERROR: 400,
|
|
131
|
+
KEY_ROTATED: 401,
|
|
132
|
+
TRIAL_EXPIRED: 402,
|
|
133
|
+
TENANT_SUSPENDED: 423,
|
|
134
|
+
NO_TENANT_FOR_PROJECT: 404,
|
|
135
|
+
INSTANCE_EXISTS: 409
|
|
108
136
|
};
|
|
109
137
|
function getErrorMessage(err) {
|
|
110
138
|
return err instanceof Error ? err.message : String(err);
|
|
@@ -113,9 +141,12 @@ export {
|
|
|
113
141
|
getErrorMessage,
|
|
114
142
|
VersionConflictError,
|
|
115
143
|
ValidationError,
|
|
144
|
+
TrialExpiredError,
|
|
145
|
+
TenantSuspendedError,
|
|
116
146
|
SecondLayerError,
|
|
117
147
|
RateLimitError,
|
|
118
148
|
NotFoundError,
|
|
149
|
+
KeyRotatedError,
|
|
119
150
|
ForbiddenError,
|
|
120
151
|
ErrorCodes,
|
|
121
152
|
DatabaseError,
|
|
@@ -124,5 +155,5 @@ export {
|
|
|
124
155
|
AuthenticationError
|
|
125
156
|
};
|
|
126
157
|
|
|
127
|
-
//# debugId=
|
|
158
|
+
//# debugId=6F538984C15B186D64756E2164756E21
|
|
128
159
|
//# sourceMappingURL=errors.js.map
|
package/dist/src/errors.js.map
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/errors.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"export const ErrorCodes = {\n\tVALIDATION_ERROR: \"VALIDATION_ERROR\",\n\tDATABASE_ERROR: \"DATABASE_ERROR\",\n\tAUTHENTICATION_ERROR: \"AUTHENTICATION_ERROR\",\n\tAUTHORIZATION_ERROR: \"AUTHORIZATION_ERROR\",\n\tRATE_LIMIT_ERROR: \"RATE_LIMIT_ERROR\",\n\tFORBIDDEN: \"FORBIDDEN\",\n\tVERSION_CONFLICT: \"VERSION_CONFLICT\",\n\tNOT_FOUND: \"NOT_FOUND\",\n} as const;\n\nexport type ErrorCode = (typeof ErrorCodes)[keyof typeof ErrorCodes];\n\n/** Base error class for all Secondlayer errors. */\nexport class SecondLayerError extends Error {\n\tpublic code: ErrorCode;\n\tpublic override cause?: unknown;\n\n\tconstructor(code: ErrorCode, message: string, cause?: unknown) {\n\t\tsuper(message);\n\t\tthis.code = code;\n\t\tthis.cause = cause;\n\t\tthis.name = this.constructor.name;\n\t\tError.captureStackTrace?.(this, this.constructor);\n\t}\n\n\ttoJSON(): {\n\t\tname: string;\n\t\tcode: string;\n\t\tmessage: string;\n\t\tstack: string | undefined;\n\t\tcause: unknown;\n\t} {\n\t\treturn {\n\t\t\tname: this.name,\n\t\t\tcode: this.code,\n\t\t\tmessage: this.message,\n\t\t\tstack: this.stack,\n\t\t\tcause: this.cause,\n\t\t};\n\t}\n}\n\nexport class NotFoundError extends SecondLayerError {\n\tconstructor(message: string) {\n\t\tsuper(\"NOT_FOUND\", message);\n\t}\n}\n\nexport class ValidationError extends SecondLayerError {\n\tconstructor(message: string, cause?: unknown) {\n\t\tsuper(\"VALIDATION_ERROR\", message, cause);\n\t}\n}\n\nexport class DatabaseError extends SecondLayerError {\n\tconstructor(message: string, cause?: unknown) {\n\t\tsuper(\"DATABASE_ERROR\", message, cause);\n\t}\n}\n\nexport class AuthenticationError extends SecondLayerError {\n\tconstructor(message: string) {\n\t\tsuper(\"AUTHENTICATION_ERROR\", message);\n\t}\n}\n\nexport class AuthorizationError extends SecondLayerError {\n\tconstructor(message: string) {\n\t\tsuper(\"AUTHORIZATION_ERROR\", message);\n\t}\n}\n\nexport class RateLimitError extends SecondLayerError {\n\tconstructor(message: string) {\n\t\tsuper(\"RATE_LIMIT_ERROR\", message);\n\t}\n}\n\nexport class ForbiddenError extends SecondLayerError {\n\tconstructor(message = \"Forbidden\") {\n\t\tsuper(\"FORBIDDEN\", message);\n\t}\n}\n\nexport class VersionConflictError extends SecondLayerError {\n\tpublic currentVersion: string;\n\tpublic expectedVersion: string;\n\n\tconstructor(currentVersion: string, expectedVersion: string) {\n\t\tsuper(\n\t\t\t\"VERSION_CONFLICT\",\n\t\t\t`Version conflict: expected ${expectedVersion}, current ${currentVersion}`,\n\t\t);\n\t\tthis.currentVersion = currentVersion;\n\t\tthis.expectedVersion = expectedVersion;\n\t}\n}\n\n/** Error code → HTTP status. Used by API middleware for code-based matching\n * (avoids cross-bundle instanceof failures from bunup class duplication). */\ntype MappedCode = Extract<\n\tErrorCode,\n\t| \"AUTHENTICATION_ERROR\"\n\t| \"AUTHORIZATION_ERROR\"\n\t| \"RATE_LIMIT_ERROR\"\n\t| \"FORBIDDEN\"\n\t| \"NOT_FOUND\"\n\t| \"VALIDATION_ERROR\"\n>;\nexport const CODE_TO_STATUS: Record
|
|
5
|
+
"export const ErrorCodes = {\n\tVALIDATION_ERROR: \"VALIDATION_ERROR\",\n\tDATABASE_ERROR: \"DATABASE_ERROR\",\n\tAUTHENTICATION_ERROR: \"AUTHENTICATION_ERROR\",\n\tAUTHORIZATION_ERROR: \"AUTHORIZATION_ERROR\",\n\tRATE_LIMIT_ERROR: \"RATE_LIMIT_ERROR\",\n\tFORBIDDEN: \"FORBIDDEN\",\n\tVERSION_CONFLICT: \"VERSION_CONFLICT\",\n\tNOT_FOUND: \"NOT_FOUND\",\n\t// Tenant lifecycle (CLI surfaces these verbatim)\n\tKEY_ROTATED: \"KEY_ROTATED\",\n\tTRIAL_EXPIRED: \"TRIAL_EXPIRED\",\n\tTENANT_SUSPENDED: \"TENANT_SUSPENDED\",\n\tNO_TENANT_FOR_PROJECT: \"NO_TENANT_FOR_PROJECT\",\n\tINSTANCE_EXISTS: \"INSTANCE_EXISTS\",\n} as const;\n\nexport type ErrorCode = (typeof ErrorCodes)[keyof typeof ErrorCodes];\n\n/** Base error class for all Secondlayer errors. */\nexport class SecondLayerError extends Error {\n\tpublic code: ErrorCode;\n\tpublic override cause?: unknown;\n\n\tconstructor(code: ErrorCode, message: string, cause?: unknown) {\n\t\tsuper(message);\n\t\tthis.code = code;\n\t\tthis.cause = cause;\n\t\tthis.name = this.constructor.name;\n\t\tError.captureStackTrace?.(this, this.constructor);\n\t}\n\n\ttoJSON(): {\n\t\tname: string;\n\t\tcode: string;\n\t\tmessage: string;\n\t\tstack: string | undefined;\n\t\tcause: unknown;\n\t} {\n\t\treturn {\n\t\t\tname: this.name,\n\t\t\tcode: this.code,\n\t\t\tmessage: this.message,\n\t\t\tstack: this.stack,\n\t\t\tcause: this.cause,\n\t\t};\n\t}\n}\n\nexport class NotFoundError extends SecondLayerError {\n\tconstructor(message: string) {\n\t\tsuper(\"NOT_FOUND\", message);\n\t}\n}\n\nexport class ValidationError extends SecondLayerError {\n\tconstructor(message: string, cause?: unknown) {\n\t\tsuper(\"VALIDATION_ERROR\", message, cause);\n\t}\n}\n\nexport class DatabaseError extends SecondLayerError {\n\tconstructor(message: string, cause?: unknown) {\n\t\tsuper(\"DATABASE_ERROR\", message, cause);\n\t}\n}\n\nexport class AuthenticationError extends SecondLayerError {\n\tconstructor(message: string) {\n\t\tsuper(\"AUTHENTICATION_ERROR\", message);\n\t}\n}\n\nexport class AuthorizationError extends SecondLayerError {\n\tconstructor(message: string) {\n\t\tsuper(\"AUTHORIZATION_ERROR\", message);\n\t}\n}\n\nexport class RateLimitError extends SecondLayerError {\n\tconstructor(message: string) {\n\t\tsuper(\"RATE_LIMIT_ERROR\", message);\n\t}\n}\n\nexport class ForbiddenError extends SecondLayerError {\n\tconstructor(message = \"Forbidden\") {\n\t\tsuper(\"FORBIDDEN\", message);\n\t}\n}\n\nexport class VersionConflictError extends SecondLayerError {\n\tpublic currentVersion: string;\n\tpublic expectedVersion: string;\n\n\tconstructor(currentVersion: string, expectedVersion: string) {\n\t\tsuper(\n\t\t\t\"VERSION_CONFLICT\",\n\t\t\t`Version conflict: expected ${expectedVersion}, current ${currentVersion}`,\n\t\t);\n\t\tthis.currentVersion = currentVersion;\n\t\tthis.expectedVersion = expectedVersion;\n\t}\n}\n\nexport class KeyRotatedError extends SecondLayerError {\n\tconstructor(message = \"Token has been rotated\") {\n\t\tsuper(\"KEY_ROTATED\", message);\n\t}\n}\n\nexport class TrialExpiredError extends SecondLayerError {\n\tconstructor(message: string) {\n\t\tsuper(\"TRIAL_EXPIRED\", message);\n\t}\n}\n\nexport class TenantSuspendedError extends SecondLayerError {\n\tconstructor(message = \"Instance is suspended\") {\n\t\tsuper(\"TENANT_SUSPENDED\", message);\n\t}\n}\n\n/** Error code → HTTP status. Used by API middleware for code-based matching\n * (avoids cross-bundle instanceof failures from bunup class duplication). */\ntype MappedCode = Extract<\n\tErrorCode,\n\t| \"AUTHENTICATION_ERROR\"\n\t| \"AUTHORIZATION_ERROR\"\n\t| \"RATE_LIMIT_ERROR\"\n\t| \"FORBIDDEN\"\n\t| \"NOT_FOUND\"\n\t| \"VALIDATION_ERROR\"\n\t| \"KEY_ROTATED\"\n\t| \"TRIAL_EXPIRED\"\n\t| \"TENANT_SUSPENDED\"\n\t| \"NO_TENANT_FOR_PROJECT\"\n\t| \"INSTANCE_EXISTS\"\n>;\nexport const CODE_TO_STATUS: Record<\n\tMappedCode,\n\t400 | 401 | 402 | 403 | 404 | 409 | 423 | 429\n> = {\n\tAUTHENTICATION_ERROR: 401,\n\tAUTHORIZATION_ERROR: 403,\n\tRATE_LIMIT_ERROR: 429,\n\tFORBIDDEN: 403,\n\tNOT_FOUND: 404,\n\tVALIDATION_ERROR: 400,\n\tKEY_ROTATED: 401,\n\tTRIAL_EXPIRED: 402,\n\tTENANT_SUSPENDED: 423,\n\tNO_TENANT_FOR_PROJECT: 404,\n\tINSTANCE_EXISTS: 409,\n} as const;\n\nexport function getErrorMessage(err: unknown): string {\n\treturn err instanceof Error ? err.message : String(err);\n}\n"
|
|
6
6
|
],
|
|
7
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAO,IAAM,aAAa;AAAA,EACzB,kBAAkB;AAAA,EAClB,gBAAgB;AAAA,EAChB,sBAAsB;AAAA,EACtB,qBAAqB;AAAA,EACrB,kBAAkB;AAAA,EAClB,WAAW;AAAA,EACX,kBAAkB;AAAA,EAClB,WAAW;
|
|
8
|
-
"debugId": "
|
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAO,IAAM,aAAa;AAAA,EACzB,kBAAkB;AAAA,EAClB,gBAAgB;AAAA,EAChB,sBAAsB;AAAA,EACtB,qBAAqB;AAAA,EACrB,kBAAkB;AAAA,EAClB,WAAW;AAAA,EACX,kBAAkB;AAAA,EAClB,WAAW;AAAA,EAEX,aAAa;AAAA,EACb,eAAe;AAAA,EACf,kBAAkB;AAAA,EAClB,uBAAuB;AAAA,EACvB,iBAAiB;AAClB;AAAA;AAKO,MAAM,yBAAyB,MAAM;AAAA,EACpC;AAAA,EACS;AAAA,EAEhB,WAAW,CAAC,MAAiB,SAAiB,OAAiB;AAAA,IAC9D,MAAM,OAAO;AAAA,IACb,KAAK,OAAO;AAAA,IACZ,KAAK,QAAQ;AAAA,IACb,KAAK,OAAO,KAAK,YAAY;AAAA,IAC7B,MAAM,oBAAoB,MAAM,KAAK,WAAW;AAAA;AAAA,EAGjD,MAAM,GAMJ;AAAA,IACD,OAAO;AAAA,MACN,MAAM,KAAK;AAAA,MACX,MAAM,KAAK;AAAA,MACX,SAAS,KAAK;AAAA,MACd,OAAO,KAAK;AAAA,MACZ,OAAO,KAAK;AAAA,IACb;AAAA;AAEF;AAAA;AAEO,MAAM,sBAAsB,iBAAiB;AAAA,EACnD,WAAW,CAAC,SAAiB;AAAA,IAC5B,MAAM,aAAa,OAAO;AAAA;AAE5B;AAAA;AAEO,MAAM,wBAAwB,iBAAiB;AAAA,EACrD,WAAW,CAAC,SAAiB,OAAiB;AAAA,IAC7C,MAAM,oBAAoB,SAAS,KAAK;AAAA;AAE1C;AAAA;AAEO,MAAM,sBAAsB,iBAAiB;AAAA,EACnD,WAAW,CAAC,SAAiB,OAAiB;AAAA,IAC7C,MAAM,kBAAkB,SAAS,KAAK;AAAA;AAExC;AAAA;AAEO,MAAM,4BAA4B,iBAAiB;AAAA,EACzD,WAAW,CAAC,SAAiB;AAAA,IAC5B,MAAM,wBAAwB,OAAO;AAAA;AAEvC;AAAA;AAEO,MAAM,2BAA2B,iBAAiB;AAAA,EACxD,WAAW,CAAC,SAAiB;AAAA,IAC5B,MAAM,uBAAuB,OAAO;AAAA;AAEtC;AAAA;AAEO,MAAM,uBAAuB,iBAAiB;AAAA,EACpD,WAAW,CAAC,SAAiB;AAAA,IAC5B,MAAM,oBAAoB,OAAO;AAAA;AAEnC;AAAA;AAEO,MAAM,uBAAuB,iBAAiB;AAAA,EACpD,WAAW,CAAC,UAAU,aAAa;AAAA,IAClC,MAAM,aAAa,OAAO;AAAA;AAE5B;AAAA;AAEO,MAAM,6BAA6B,iBAAiB;AAAA,EACnD;AAAA,EACA;AAAA,EAEP,WAAW,CAAC,gBAAwB,iBAAyB;AAAA,IAC5D,MACC,oBACA,8BAA8B,4BAA4B,gBAC3D;AAAA,IACA,KAAK,iBAAiB;AAAA,IACtB,KAAK,kBAAkB;AAAA;AAEzB;AAAA;AAEO,MAAM,wBAAwB,iBAAiB;AAAA,EACrD,WAAW,CAAC,UAAU,0BAA0B;AAAA,IAC/C,MAAM,eAAe,OAAO;AAAA;AAE9B;AAAA;AAEO,MAAM,0BAA0B,iBAAiB;AAAA,EACvD,WAAW,CAAC,SAAiB;AAAA,IAC5B,MAAM,iBAAiB,OAAO;AAAA;AAEhC;AAAA;AAEO,MAAM,6BAA6B,iBAAiB;AAAA,EAC1D,WAAW,CAAC,UAAU,yBAAyB;AAAA,IAC9C,MAAM,oBAAoB,OAAO;AAAA;AAEnC;AAkBO,IAAM,iBAGT;AAAA,EACH,sBAAsB;AAAA,EACtB,qBAAqB;AAAA,EACrB,kBAAkB;AAAA,EAClB,WAAW;AAAA,EACX,WAAW;AAAA,EACX,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,eAAe;AAAA,EACf,kBAAkB;AAAA,EAClB,uBAAuB;AAAA,EACvB,iBAAiB;AAClB;AAEO,SAAS,eAAe,CAAC,KAAsB;AAAA,EACrD,OAAO,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG;AAAA;",
|
|
8
|
+
"debugId": "6F538984C15B186D64756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Generated, Insertable, Selectable, Updateable } from "kysely";
|
|
1
|
+
import { ColumnType, Generated, Insertable, Selectable, Updateable } from "kysely";
|
|
2
2
|
interface BlocksTable {
|
|
3
3
|
height: number;
|
|
4
4
|
hash: string;
|
|
@@ -55,7 +55,6 @@ interface SubgraphsTable {
|
|
|
55
55
|
last_error_at: Date | null;
|
|
56
56
|
total_processed: Generated<number>;
|
|
57
57
|
total_errors: Generated<number>;
|
|
58
|
-
api_key_id: string | null;
|
|
59
58
|
account_id: string;
|
|
60
59
|
handler_code: string | null;
|
|
61
60
|
source_code: string | null;
|
|
@@ -359,7 +358,72 @@ interface Database {
|
|
|
359
358
|
workflow_cursors: WorkflowCursorsTable;
|
|
360
359
|
workflow_signer_secrets: WorkflowSignerSecretsTable;
|
|
361
360
|
workflow_budgets: WorkflowBudgetsTable;
|
|
361
|
+
tenants: TenantsTable;
|
|
362
|
+
tenant_usage_monthly: TenantUsageMonthlyTable;
|
|
363
|
+
provisioning_audit_log: ProvisioningAuditLogTable;
|
|
364
|
+
}
|
|
365
|
+
type TenantStatus = "provisioning" | "active" | "suspended" | "error" | "deleted";
|
|
366
|
+
interface TenantsTable {
|
|
367
|
+
id: Generated<string>;
|
|
368
|
+
account_id: string;
|
|
369
|
+
slug: string;
|
|
370
|
+
status: ColumnType<TenantStatus, TenantStatus | undefined, TenantStatus>;
|
|
371
|
+
plan: string;
|
|
372
|
+
cpus: ColumnType<number, number | string, number | string>;
|
|
373
|
+
memory_mb: number;
|
|
374
|
+
storage_limit_mb: number;
|
|
375
|
+
storage_used_mb: number | null;
|
|
376
|
+
pg_container_id: string | null;
|
|
377
|
+
api_container_id: string | null;
|
|
378
|
+
processor_container_id: string | null;
|
|
379
|
+
target_database_url_enc: Buffer;
|
|
380
|
+
tenant_jwt_secret_enc: Buffer;
|
|
381
|
+
anon_key_enc: Buffer;
|
|
382
|
+
service_key_enc: Buffer;
|
|
383
|
+
api_url_internal: string;
|
|
384
|
+
api_url_public: string;
|
|
385
|
+
trial_ends_at: Date;
|
|
386
|
+
suspended_at: Date | null;
|
|
387
|
+
last_health_check_at: Date | null;
|
|
388
|
+
service_gen: Generated<number>;
|
|
389
|
+
anon_gen: Generated<number>;
|
|
390
|
+
project_id: string | null;
|
|
391
|
+
created_at: Generated<Date>;
|
|
392
|
+
updated_at: Generated<Date>;
|
|
393
|
+
}
|
|
394
|
+
type Tenant = Selectable<TenantsTable>;
|
|
395
|
+
type InsertTenant = Insertable<TenantsTable>;
|
|
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>;
|
|
362
424
|
}
|
|
425
|
+
type ProvisioningAuditLog = Selectable<ProvisioningAuditLogTable>;
|
|
426
|
+
type InsertProvisioningAuditLog = Insertable<ProvisioningAuditLogTable>;
|
|
363
427
|
interface WorkflowBudgetsTable {
|
|
364
428
|
id: Generated<string>;
|
|
365
429
|
workflow_definition_id: string;
|
|
@@ -455,6 +519,16 @@ type ChatMessage = Selectable<ChatMessagesTable>;
|
|
|
455
519
|
type InsertChatMessage = Insertable<ChatMessagesTable>;
|
|
456
520
|
interface EnvSchemaOutput {
|
|
457
521
|
DATABASE_URL?: string;
|
|
522
|
+
/**
|
|
523
|
+
* Shared indexer DB (blocks/txs/events). Falls back to DATABASE_URL.
|
|
524
|
+
* Set this alongside TARGET_DATABASE_URL to enable dual-DB mode.
|
|
525
|
+
*/
|
|
526
|
+
SOURCE_DATABASE_URL?: string;
|
|
527
|
+
/**
|
|
528
|
+
* Tenant DB (subgraph schemas + subgraphs table). Falls back to DATABASE_URL.
|
|
529
|
+
* Set this alongside SOURCE_DATABASE_URL to enable dual-DB mode.
|
|
530
|
+
*/
|
|
531
|
+
TARGET_DATABASE_URL?: string;
|
|
458
532
|
NETWORK?: "mainnet" | "testnet";
|
|
459
533
|
NETWORKS?: ("mainnet" | "testnet")[];
|
|
460
534
|
LOG_LEVEL: "debug" | "info" | "warn" | "error";
|
|
@@ -480,10 +554,29 @@ declare function parseJsonb<T = unknown>(value: unknown): T;
|
|
|
480
554
|
import { Kysely } from "kysely";
|
|
481
555
|
import postgres from "postgres";
|
|
482
556
|
import { sql } from "kysely";
|
|
557
|
+
/**
|
|
558
|
+
* Kysely instance for the SOURCE DB (block/tx/event reads from the shared
|
|
559
|
+
* indexer). Resolution: `SOURCE_DATABASE_URL || DATABASE_URL`.
|
|
560
|
+
*/
|
|
561
|
+
declare function getSourceDb(): Kysely<Database>;
|
|
562
|
+
/**
|
|
563
|
+
* Kysely instance for the TARGET DB (subgraph schemas, subgraphs table,
|
|
564
|
+
* account-scoped data — tenant-side writes). Resolution:
|
|
565
|
+
* `TARGET_DATABASE_URL || DATABASE_URL`.
|
|
566
|
+
*/
|
|
567
|
+
declare function getTargetDb(): Kysely<Database>;
|
|
568
|
+
/**
|
|
569
|
+
* Backward-compat alias for `getTargetDb()`. Accepts an optional
|
|
570
|
+
* `connectionString` override used by seed/test helpers — when supplied,
|
|
571
|
+
* bypasses env resolution and uses the provided URL directly (still cached).
|
|
572
|
+
*/
|
|
483
573
|
declare function getDb(connectionString?: string): Kysely<Database>;
|
|
484
|
-
/**
|
|
485
|
-
|
|
486
|
-
|
|
574
|
+
/**
|
|
575
|
+
* Raw postgres.js client for dynamic schema DDL (CREATE SCHEMA, DROP, etc.).
|
|
576
|
+
* Defaults to the target role (tenant schemas live in the target DB).
|
|
577
|
+
*/
|
|
578
|
+
declare function getRawClient(role?: "source" | "target"): ReturnType<typeof postgres>;
|
|
579
|
+
/** Close all DB connection pools. Call in CLI commands to allow process exit. */
|
|
487
580
|
declare function closeDb(): Promise<void>;
|
|
488
581
|
declare const ErrorCodes: {
|
|
489
582
|
readonly VALIDATION_ERROR: "VALIDATION_ERROR"
|
|
@@ -494,6 +587,11 @@ declare const ErrorCodes: {
|
|
|
494
587
|
readonly FORBIDDEN: "FORBIDDEN"
|
|
495
588
|
readonly VERSION_CONFLICT: "VERSION_CONFLICT"
|
|
496
589
|
readonly NOT_FOUND: "NOT_FOUND"
|
|
590
|
+
readonly KEY_ROTATED: "KEY_ROTATED"
|
|
591
|
+
readonly TRIAL_EXPIRED: "TRIAL_EXPIRED"
|
|
592
|
+
readonly TENANT_SUSPENDED: "TENANT_SUSPENDED"
|
|
593
|
+
readonly NO_TENANT_FOR_PROJECT: "NO_TENANT_FOR_PROJECT"
|
|
594
|
+
readonly INSTANCE_EXISTS: "INSTANCE_EXISTS"
|
|
497
595
|
};
|
|
498
596
|
type ErrorCode = (typeof ErrorCodes)[keyof typeof ErrorCodes];
|
|
499
597
|
/** Base error class for all Secondlayer errors. */
|
|
@@ -535,10 +633,19 @@ declare class VersionConflictError extends SecondLayerError {
|
|
|
535
633
|
expectedVersion: string;
|
|
536
634
|
constructor(currentVersion: string, expectedVersion: string);
|
|
537
635
|
}
|
|
636
|
+
declare class KeyRotatedError extends SecondLayerError {
|
|
637
|
+
constructor(message?: string);
|
|
638
|
+
}
|
|
639
|
+
declare class TrialExpiredError extends SecondLayerError {
|
|
640
|
+
constructor(message: string);
|
|
641
|
+
}
|
|
642
|
+
declare class TenantSuspendedError extends SecondLayerError {
|
|
643
|
+
constructor(message?: string);
|
|
644
|
+
}
|
|
538
645
|
/** Error code → HTTP status. Used by API middleware for code-based matching
|
|
539
646
|
* (avoids cross-bundle instanceof failures from bunup class duplication). */
|
|
540
|
-
type MappedCode = Extract<ErrorCode, "AUTHENTICATION_ERROR" | "AUTHORIZATION_ERROR" | "RATE_LIMIT_ERROR" | "FORBIDDEN" | "NOT_FOUND" | "VALIDATION_ERROR">;
|
|
541
|
-
declare const CODE_TO_STATUS: Record<MappedCode, 400 | 401 | 403 | 404 | 429>;
|
|
647
|
+
type MappedCode = Extract<ErrorCode, "AUTHENTICATION_ERROR" | "AUTHORIZATION_ERROR" | "RATE_LIMIT_ERROR" | "FORBIDDEN" | "NOT_FOUND" | "VALIDATION_ERROR" | "KEY_ROTATED" | "TRIAL_EXPIRED" | "TENANT_SUSPENDED" | "NO_TENANT_FOR_PROJECT" | "INSTANCE_EXISTS">;
|
|
648
|
+
declare const CODE_TO_STATUS: Record<MappedCode, 400 | 401 | 402 | 403 | 404 | 409 | 423 | 429>;
|
|
542
649
|
declare function getErrorMessage(err: unknown): string;
|
|
543
650
|
declare class Logger {
|
|
544
651
|
private _level?;
|
|
@@ -556,6 +663,19 @@ declare class Logger {
|
|
|
556
663
|
}
|
|
557
664
|
declare const logger: Logger;
|
|
558
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";
|
|
559
679
|
interface StxTransferFilter {
|
|
560
680
|
type: "stx_transfer";
|
|
561
681
|
sender?: string;
|
|
@@ -634,82 +754,20 @@ interface PrintEventFilter {
|
|
|
634
754
|
contains?: string;
|
|
635
755
|
}
|
|
636
756
|
type EventFilter = StxTransferFilter | StxMintFilter | StxBurnFilter | StxLockFilter | FtTransferFilter | FtMintFilter | FtBurnFilter | NftTransferFilter | NftMintFilter | NftBurnFilter | ContractCallFilter | ContractDeployFilter | PrintEventFilter;
|
|
637
|
-
declare const StxTransferFilterSchema:
|
|
638
|
-
declare const StxMintFilterSchema:
|
|
639
|
-
declare const StxBurnFilterSchema:
|
|
640
|
-
declare const StxLockFilterSchema:
|
|
641
|
-
declare const FtTransferFilterSchema:
|
|
642
|
-
declare const FtMintFilterSchema:
|
|
643
|
-
declare const FtBurnFilterSchema:
|
|
644
|
-
declare const NftTransferFilterSchema:
|
|
645
|
-
declare const NftMintFilterSchema:
|
|
646
|
-
declare const NftBurnFilterSchema:
|
|
647
|
-
declare const ContractCallFilterSchema:
|
|
648
|
-
declare const ContractDeployFilterSchema:
|
|
649
|
-
declare const PrintEventFilterSchema:
|
|
650
|
-
declare const EventFilterSchema:
|
|
651
|
-
import { z as z3 } from "zod/v4";
|
|
652
|
-
interface PublishSubgraphRequest {
|
|
653
|
-
tags?: string[];
|
|
654
|
-
description?: string;
|
|
655
|
-
}
|
|
656
|
-
interface UpdateProfileRequest {
|
|
657
|
-
display_name?: string;
|
|
658
|
-
bio?: string;
|
|
659
|
-
slug?: string;
|
|
660
|
-
}
|
|
661
|
-
interface ForkSubgraphRequest {
|
|
662
|
-
sourceSubgraphName: string;
|
|
663
|
-
newName?: string;
|
|
664
|
-
}
|
|
665
|
-
declare const PublishSubgraphRequestSchema: z3.ZodType<PublishSubgraphRequest>;
|
|
666
|
-
declare const UpdateProfileRequestSchema: z3.ZodType<UpdateProfileRequest>;
|
|
667
|
-
declare const ForkSubgraphRequestSchema: z3.ZodType<ForkSubgraphRequest>;
|
|
668
|
-
interface MarketplaceCreator {
|
|
669
|
-
displayName: string | null;
|
|
670
|
-
slug: string | null;
|
|
671
|
-
}
|
|
672
|
-
interface MarketplaceSubgraphSummary {
|
|
673
|
-
name: string;
|
|
674
|
-
description: string | null;
|
|
675
|
-
tags: string[];
|
|
676
|
-
creator: MarketplaceCreator;
|
|
677
|
-
status: string;
|
|
678
|
-
version: string;
|
|
679
|
-
tables: string[];
|
|
680
|
-
totalQueries7d: number;
|
|
681
|
-
progress: number;
|
|
682
|
-
createdAt: string;
|
|
683
|
-
}
|
|
684
|
-
interface MarketplaceSubgraphDetail extends MarketplaceSubgraphSummary {
|
|
685
|
-
tableSchemas: Record<string, {
|
|
686
|
-
columns: Record<string, {
|
|
687
|
-
type: string
|
|
688
|
-
nullable?: boolean
|
|
689
|
-
}>
|
|
690
|
-
rowCount: number
|
|
691
|
-
endpoint: string
|
|
692
|
-
}>;
|
|
693
|
-
sources: Record<string, unknown>;
|
|
694
|
-
startBlock: number;
|
|
695
|
-
lastProcessedBlock: number;
|
|
696
|
-
forkedFrom: string | null;
|
|
697
|
-
usage: {
|
|
698
|
-
totalQueries7d: number
|
|
699
|
-
totalQueries30d: number
|
|
700
|
-
daily: Array<{
|
|
701
|
-
date: string
|
|
702
|
-
count: number
|
|
703
|
-
}>
|
|
704
|
-
};
|
|
705
|
-
}
|
|
706
|
-
interface CreatorProfile {
|
|
707
|
-
displayName: string | null;
|
|
708
|
-
bio: string | null;
|
|
709
|
-
avatarUrl: string | null;
|
|
710
|
-
slug: string | null;
|
|
711
|
-
subgraphs: MarketplaceSubgraphSummary[];
|
|
712
|
-
}
|
|
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>;
|
|
713
771
|
import { z as z4 } from "zod/v4";
|
|
714
772
|
interface DeploySubgraphRequest {
|
|
715
773
|
name: string;
|
|
@@ -853,4 +911,4 @@ declare function createSignatureHeader(payload: string, secret: string, timestam
|
|
|
853
911
|
* Returns true if valid, false otherwise
|
|
854
912
|
*/
|
|
855
913
|
declare function verifySignatureHeader(payload: string, header: string, secret: string, toleranceSeconds?: number): boolean;
|
|
856
|
-
export { sql, parseJsonb, logger, jsonb, 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, UpdateSubgraph, UpdateProject, UpdateProfileRequestSchema, UpdateProfileRequest, UpdateIndexProgress, UpdateEvent, UpdateChatSession, UpdateBlock, UpdateApiKey, TransactionsTable, Transaction, 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,
|
|
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 };
|