@happyvertical/smrt-cli 0.51.24 → 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.
- package/AGENTS.md +1 -0
- package/README.md +1 -0
- package/dist/{ApiKey-BZmbOTnL-niFNV-7x.js → ApiKey-BZmbOTnL-BHFzurt7.js} +2 -2
- package/dist/ApiKeyCollection-Bfb_nw81-D8b3Nrg4.js +2 -0
- package/dist/AuditLogCollection-B1YonCAP-CpPE8zro.js +2 -0
- package/dist/{NostrIdentity-n70E0vck-C3qsu8zD.js → NostrIdentity-n70E0vck-Cga1lWU1.js} +3 -3
- package/dist/NostrIdentityCollection-Ca74dkaL-BKzq1O2N.js +2 -0
- package/dist/{OidcIdentity-K8V4u0CR-CwvImYYY.js → OidcIdentity-K8V4u0CR-buvSdd8D.js} +2 -2
- package/dist/OidcIdentityCollection-gnrLoF08-BsEJX0w8.js +2 -0
- package/dist/ProfileAssetCollection-CmbeSgDi-CcjX8UeG.js +2 -0
- package/dist/{ProfileCollection-DTT4KNpQ-BSl_c1i_.js → ProfileCollection-DTT4KNpQ-B2yHjF8e.js} +30 -653
- package/dist/ProfileMetadataCollection-DxX_BJKV-CqTZZ7O9.js +2 -0
- package/dist/{ProfileMetafieldCollection-CMKhVi2I-HKsCJDn7.js → ProfileMetafieldCollection-CMKhVi2I-BTguykyW.js} +1 -1
- package/dist/{ProfileRelationshipCollection-DUVgaIqf-DVwIEN1I.js → ProfileRelationshipCollection-DUVgaIqf-CdOJCU07.js} +1 -1
- package/dist/{ProfileRelationshipTermCollection-DtA9OM23-DhMqV5y2.js → ProfileRelationshipTermCollection-DtA9OM23-ug8uUFUp.js} +1 -1
- package/dist/{ProfileRelationshipType-BRiRka6t-CZxd9f0l.js → ProfileRelationshipType-BRiRka6t-B-lkyTB2.js} +1 -1
- package/dist/{ProfileRelationshipTypeCollection-BdXwd7Kf-DWDh61w6.js → ProfileRelationshipTypeCollection-BdXwd7Kf-BUuZ3P72.js} +1 -1
- package/dist/{commands-CclKGZRp.js → commands-BVFlmHkE.js} +61 -1
- package/dist/dist-4XD0OZmB.js +1235 -0
- package/dist/dist-C-AYkaoT.js +813 -0
- package/dist/{dist-BHR0tsIO.js → dist-CaxtTrhT.js} +3 -3
- package/dist/{dist-C-yxvpyT.js → dist-VEFJWHIY.js} +25 -25
- package/dist/index.js +9 -9
- package/dist/{oidcProvisioningPrimitives-0-3n3D6f-iCSXDIAZ.js → oidcProvisioningPrimitives-0-3n3D6f-DpuGh5Ac.js} +4 -4
- package/dist/resolveIdentity-BrJDCjYi-DrBA1wFo.js +2 -0
- package/package.json +9 -8
- package/dist/ApiKeyCollection-Bfb_nw81-CNPNkzCL.js +0 -2
- package/dist/AuditLogCollection-B1YonCAP-IB02mJPz.js +0 -2
- package/dist/NostrIdentityCollection-Ca74dkaL-CUV-1Hzs.js +0 -2
- package/dist/OidcIdentityCollection-gnrLoF08-WIx_hLet.js +0 -2
- package/dist/ProfileAssetCollection-CmbeSgDi-BQd2qiDK.js +0 -2
- package/dist/ProfileMetadataCollection-DxX_BJKV-kpa3rgiI.js +0 -2
- package/dist/dist-0QjiSFH4.js +0 -190
- package/dist/resolveIdentity-BrJDCjYi-BtP8skcX.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { h as ProfileMetafieldCollection_exports } from "./dist-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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,
|