@happyvertical/smrt-cli 0.51.23 → 0.51.25

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/AGENTS.md +1 -0
  2. package/README.md +1 -0
  3. package/dist/{ApiKey-BZmbOTnL-Bo7tbG1k.js → ApiKey-BZmbOTnL-BHFzurt7.js} +2 -2
  4. package/dist/ApiKeyCollection-Bfb_nw81-D8b3Nrg4.js +2 -0
  5. package/dist/AuditLogCollection-B1YonCAP-CpPE8zro.js +2 -0
  6. package/dist/{NostrIdentity-n70E0vck-G4M4P2GW.js → NostrIdentity-n70E0vck-Cga1lWU1.js} +3 -3
  7. package/dist/NostrIdentityCollection-Ca74dkaL-BKzq1O2N.js +2 -0
  8. package/dist/{OidcIdentity-K8V4u0CR-D3Zc7yju.js → OidcIdentity-K8V4u0CR-buvSdd8D.js} +2 -2
  9. package/dist/OidcIdentityCollection-gnrLoF08-BsEJX0w8.js +2 -0
  10. package/dist/ProfileAssetCollection-CmbeSgDi-CcjX8UeG.js +2 -0
  11. package/dist/{ProfileCollection-DTT4KNpQ-CFn9nEde.js → ProfileCollection-DTT4KNpQ-B2yHjF8e.js} +30 -653
  12. package/dist/ProfileMetadataCollection-DxX_BJKV-CqTZZ7O9.js +2 -0
  13. package/dist/{ProfileMetafieldCollection-CMKhVi2I-NPA4NfPL.js → ProfileMetafieldCollection-CMKhVi2I-BTguykyW.js} +1 -1
  14. package/dist/{ProfileRelationshipCollection-DUVgaIqf-BlH89282.js → ProfileRelationshipCollection-DUVgaIqf-CdOJCU07.js} +1 -1
  15. package/dist/{ProfileRelationshipTermCollection-DtA9OM23-D3KSY2OS.js → ProfileRelationshipTermCollection-DtA9OM23-ug8uUFUp.js} +1 -1
  16. package/dist/{ProfileRelationshipType-BRiRka6t-sguU4oDf.js → ProfileRelationshipType-BRiRka6t-B-lkyTB2.js} +1 -1
  17. package/dist/{ProfileRelationshipTypeCollection-BdXwd7Kf-DGHj5NYL.js → ProfileRelationshipTypeCollection-BdXwd7Kf-BUuZ3P72.js} +1 -1
  18. package/dist/{commands-CdijcyQl.js → commands-BVFlmHkE.js} +61 -1
  19. package/dist/dist-4XD0OZmB.js +1235 -0
  20. package/dist/dist-C-AYkaoT.js +813 -0
  21. package/dist/{dist-DPN8zVvb.js → dist-CaxtTrhT.js} +3 -3
  22. package/dist/{dist-Cm7M-US-.js → dist-VEFJWHIY.js} +25 -25
  23. package/dist/index.js +9 -9
  24. package/dist/{oidcProvisioningPrimitives-0-3n3D6f-2uN0TAcP.js → oidcProvisioningPrimitives-0-3n3D6f-DpuGh5Ac.js} +4 -4
  25. package/dist/resolveIdentity-BrJDCjYi-DrBA1wFo.js +2 -0
  26. package/package.json +9 -8
  27. package/dist/ApiKeyCollection-Bfb_nw81-CNAaLULe.js +0 -2
  28. package/dist/AuditLogCollection-B1YonCAP-yweHrz14.js +0 -2
  29. package/dist/NostrIdentityCollection-Ca74dkaL-aM_-cerc.js +0 -2
  30. package/dist/OidcIdentityCollection-gnrLoF08-B5y4FHI0.js +0 -2
  31. package/dist/ProfileAssetCollection-CmbeSgDi-mMSqxPLS.js +0 -2
  32. package/dist/ProfileMetadataCollection-DxX_BJKV-CXKXBRtU.js +0 -2
  33. package/dist/dist-B5ngi39H.js +0 -190
  34. package/dist/resolveIdentity-BrJDCjYi-CX_TCtNl.js +0 -2
@@ -0,0 +1,2 @@
1
+ import { v as ProfileMetadataCollection_exports } from "./dist-VEFJWHIY.js";
2
+ export { ProfileMetadataCollection_exports as n };
@@ -1,2 +1,2 @@
1
- import { h as ProfileMetafieldCollection_exports } from "./dist-Cm7M-US-.js";
1
+ import { h as ProfileMetafieldCollection_exports } from "./dist-VEFJWHIY.js";
2
2
  export { ProfileMetafieldCollection_exports as n };
@@ -1,2 +1,2 @@
1
- import { f as ProfileRelationshipCollection_exports } from "./dist-Cm7M-US-.js";
1
+ import { f as ProfileRelationshipCollection_exports } from "./dist-VEFJWHIY.js";
2
2
  export { ProfileRelationshipCollection_exports as n };
@@ -1,2 +1,2 @@
1
- import { l as ProfileRelationshipTermCollection_exports } from "./dist-Cm7M-US-.js";
1
+ import { l as ProfileRelationshipTermCollection_exports } from "./dist-VEFJWHIY.js";
2
2
  export { ProfileRelationshipTermCollection_exports as n };
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
- import { n as __exportAll$1 } from "./NostrIdentity-n70E0vck-G4M4P2GW.js";
2
+ import { n as __exportAll$1 } from "./NostrIdentity-n70E0vck-Cga1lWU1.js";
3
3
  import { SmrtObject, field, smrt } from "@happyvertical/smrt-core";
4
4
  //#region ../profiles/dist/chunks/ProfileRelationshipType-BRiRka6t.js
5
5
  var ProfileRelationshipType_BRiRka6t_exports = /* @__PURE__ */ __exportAll({
@@ -1,2 +1,2 @@
1
- import { o as ProfileRelationshipTypeCollection_exports } from "./dist-Cm7M-US-.js";
1
+ import { o as ProfileRelationshipTypeCollection_exports } from "./dist-VEFJWHIY.js";
2
2
  export { ProfileRelationshipTypeCollection_exports as n };
@@ -6943,7 +6943,7 @@ var dbMaterializeTenantHierarchyCommand = {
6943
6943
  if (!config.database?.url || config.database.url === ":memory:") throw new Error("Database configuration required for db:materialize-tenant-hierarchy. Configure database.url in smrt.config.ts (or DATABASE_URL).");
6944
6944
  const dbType = config.database.type || "sqlite";
6945
6945
  const { getDatabase } = await import("@happyvertical/sql");
6946
- const { materializeTenantHierarchy, TenantHierarchyMaterializationError } = await import("./dist-Cm7M-US-.js");
6946
+ const { materializeTenantHierarchy, TenantHierarchyMaterializationError } = await import("./dist-VEFJWHIY.js");
6947
6947
  db = await getDatabase({
6948
6948
  type: dbType,
6949
6949
  url: config.database.url
@@ -7125,6 +7125,65 @@ var dbMigrateInt8Command = {
7125
7125
  }
7126
7126
  };
7127
7127
  //#endregion
7128
+ //#region src/commands/db-migrate-ledger-accounts.ts
7129
+ /**
7130
+ * Move ledger accounts out of the `accounts` table they shared with
7131
+ * smrt-messages before #3098. Run between two `db:migrate` passes; see the
7132
+ * smrt-ledgers README.
7133
+ */
7134
+ var dbMigrateLedgerAccountsCommand = {
7135
+ name: "db:migrate-ledger-accounts",
7136
+ description: "Move smrt-ledgers accounts from the legacy shared `accounts` table into `ledger_accounts` (#3098). Run after db:migrate has created ledger_accounts, in a PostgreSQL maintenance window, then run db:migrate again.",
7137
+ aliases: ["migrate-ledger-accounts"],
7138
+ args: [],
7139
+ options: { "dry-run": {
7140
+ type: "boolean",
7141
+ description: "Report the ledger rows that would move without writing.",
7142
+ default: false
7143
+ } },
7144
+ handler: async (_args, options) => {
7145
+ let db;
7146
+ try {
7147
+ const { getPackageConfig } = await import("@happyvertical/smrt-config");
7148
+ const { DEFAULT_CLI_CONFIG } = await import("./config-hqNo4lzH.js").then((n) => n.n);
7149
+ const config = getPackageConfig("cli", DEFAULT_CLI_CONFIG);
7150
+ if (!config.database?.url || config.database.url === ":memory:") throw new Error("Database configuration required for db:migrate-ledger-accounts. Configure database.url in smrt.config.ts (or DATABASE_URL).");
7151
+ const dbType = config.database.type || "sqlite";
7152
+ if (dbType !== "postgres") throw new Error("db:migrate-ledger-accounts currently supports PostgreSQL only; no changes were made. See the smrt-ledgers README for SQLite.");
7153
+ await autoDiscoverAndLoad();
7154
+ const { getDatabase } = await import("@happyvertical/sql");
7155
+ const { migrateLedgerAccountsTable, planLedgerAccountsTableMove } = await import("./dist-4XD0OZmB.js");
7156
+ db = await getDatabase({
7157
+ type: dbType,
7158
+ url: config.database.url
7159
+ });
7160
+ console.log("\n📒 Ledger accounts table move\n");
7161
+ console.log(`✓ Connected to ${formatDatabaseDisplayUrl(dbType, config.database.url)}\n`);
7162
+ if (options["dry-run"]) {
7163
+ const plan = await planLedgerAccountsTableMove(db);
7164
+ console.log(plan.legacyTable ? `DRY RUN: ${plan.pending} ledger account(s) would move to ledger_accounts; ${plan.messagingRows} messaging account(s) stay in accounts. No changes made.\n` : "DRY RUN: no legacy accounts table holds ledger accounts. No changes made.\n");
7165
+ return;
7166
+ }
7167
+ const postgres = config.migrations?.postgres;
7168
+ const result = await migrateLedgerAccountsTable(db, {
7169
+ lockTimeout: parsePostgresTimeoutMs(postgres?.lockTimeout, 3e4),
7170
+ statementTimeout: parsePostgresTimeoutMs(postgres?.statementTimeout, 6e4)
7171
+ });
7172
+ if (!result.ran) {
7173
+ console.log("No ledger accounts table move was needed.\n");
7174
+ return;
7175
+ }
7176
+ console.log(`✓ Moved ${result.moved} ledger account(s) to ledger_accounts; ${result.remainingLegacyRows} row(s) remain in accounts.`);
7177
+ if (result.detachedForeignKeys.length > 0) console.log(`✓ Detached ${result.detachedForeignKeys.join(", ")} from accounts. Run db:migrate to add them against ledger_accounts.\n`);
7178
+ } catch (error) {
7179
+ console.error(`\n❌ Ledger accounts table move failed: ${redactConnectionStringsInText(error instanceof Error ? error.message : String(error))}\n`);
7180
+ process.exitCode = 1;
7181
+ } finally {
7182
+ await closeDatabaseConnection(db);
7183
+ }
7184
+ }
7185
+ };
7186
+ //#endregion
7128
7187
  //#region src/commands/db-migrate-null-equal-indexes.ts
7129
7188
  var dbMigrateNullEqualIndexesCommand = {
7130
7189
  name: "db:migrate-null-equal-indexes",
@@ -10851,6 +10910,7 @@ export default testManifest;
10851
10910
  "db:migrate-int8": dbMigrateInt8Command,
10852
10911
  "db:migrate-null-equal-indexes": dbMigrateNullEqualIndexesCommand,
10853
10912
  "db:migrate-agent-schedule-slugs": dbMigrateAgentScheduleSlugsCommand,
10913
+ "db:migrate-ledger-accounts": dbMigrateLedgerAccountsCommand,
10854
10914
  "db:materialize-tenant-hierarchy": dbMaterializeTenantHierarchyCommand,
10855
10915
  "db:drop-framework-base-tables": dbDropFrameworkBaseTablesCommand,
10856
10916
  "db:orphans": dbOrphansCommand,