@happyvertical/smrt-cli 0.51.39 → 0.53.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/AGENTS.md +7 -2
- package/README.md +22 -0
- package/agents/type-drift.md +16 -0
- package/dist/{ApiKey-BZmbOTnL-DEwZtcGA.js → ApiKey-BZmbOTnL-d61__hH4.js} +2 -2
- package/dist/ApiKeyCollection-Bfb_nw81-BVJ-i1Aw.js +2 -0
- package/dist/AuditLogCollection-B1YonCAP-bpq7rM2b.js +2 -0
- package/dist/{NostrIdentity-n70E0vck-DiBJPv76.js → NostrIdentity-n70E0vck-CmFPKTaE.js} +3 -3
- package/dist/NostrIdentityCollection-Ca74dkaL-C0rNgSy-.js +2 -0
- package/dist/{OidcIdentity-K8V4u0CR-B_ek3cPN.js → OidcIdentity-Cb1bxreM-L5LCgsel.js} +3 -3
- package/dist/OidcIdentityCollection-TV8VdK69-CUmZ-j4r.js +2 -0
- package/dist/ProfileAssetCollection-B9hacUJa-C53RAi1e.js +2 -0
- package/dist/{ProfileCollection-DTT4KNpQ-D1RNYfjm.js → ProfileCollection-DuJT7Mum-zuWR2h3v.js} +69 -31
- package/dist/ProfileLinkCollection-4uNURz32-Fmbnrmyr.js +2 -0
- package/dist/ProfileMetadataCollection-DQhbfEfa-D30yWyzB.js +2 -0
- package/dist/{ProfileMetafieldCollection-CMKhVi2I-mh3UgeZA.js → ProfileMetafieldCollection-CoBuM_5G-TNxSMsBJ.js} +1 -1
- package/dist/{ProfileRelationshipCollection-DUVgaIqf-CXHrAni4.js → ProfileRelationshipCollection-DUVgaIqf-CKcxS2xW.js} +1 -1
- package/dist/{ProfileRelationshipTermCollection-DtA9OM23-Cj4bLTpU.js → ProfileRelationshipTermCollection-DtA9OM23-h-4GhOFl.js} +1 -1
- package/dist/{ProfileRelationshipType-BRiRka6t-ICv2cawn.js → ProfileRelationshipType-BRiRka6t-BFgCVe6p.js} +1 -1
- package/dist/{ProfileRelationshipTypeCollection-BdXwd7Kf-CaYLxJmh.js → ProfileRelationshipTypeCollection-BdXwd7Kf-Djb3_k5Z.js} +1 -1
- package/dist/cli-generator.d.ts.map +1 -1
- package/dist/commands/db-diff.d.ts.map +1 -1
- package/dist/commands/db-history.d.ts.map +1 -1
- package/dist/commands/db-migrate-actions.d.ts +7 -0
- package/dist/commands/db-migrate-actions.d.ts.map +1 -1
- package/dist/commands/db-parity.d.ts +7 -0
- package/dist/commands/db-parity.d.ts.map +1 -1
- package/dist/commands/db-qualified-names.d.ts +39 -0
- package/dist/commands/db-qualified-names.d.ts.map +1 -0
- package/dist/commands/db-status.d.ts.map +1 -1
- package/dist/commands/gnode.d.ts.map +1 -1
- package/dist/commands/index.d.ts +1 -0
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/mcp-apps-packaging.d.ts +24 -0
- package/dist/commands/mcp-apps-packaging.d.ts.map +1 -0
- package/dist/commands/tenant-natural-keys.d.ts +58 -0
- package/dist/commands/tenant-natural-keys.d.ts.map +1 -0
- package/dist/commands/utilities.d.ts.map +1 -1
- package/dist/{commands-C2PjCUio.js → commands-e1tsvozP.js} +650 -22
- package/dist/{dist-B3npUhW6.js → dist-8C4XjDhz.js} +151 -6
- package/dist/{dist-C8sNOzr2.js → dist-CLA60jwS.js} +4 -4
- package/dist/dist-CksLvqnZ.js +1705 -0
- package/dist/dist-DtTkpUee.js +3937 -0
- package/dist/index.js +17 -11
- package/dist/{json-validator-oEN7eUI3.js → json-validator-BiAdsE1O.js} +4 -4
- package/dist/{oidcProvisioningPrimitives-0-3n3D6f-yUBRl2DC.js → oidcProvisioningPrimitives-D9OYu5-F-CJ6bTipi.js} +7 -7
- package/dist/resolveIdentity-B-PK6RwU-DxJFF8ad.js +2 -0
- package/package.json +16 -15
- package/dist/ApiKeyCollection-Bfb_nw81-D4pLjDGS.js +0 -2
- package/dist/AuditLogCollection-B1YonCAP-w1iOHW4A.js +0 -2
- package/dist/NostrIdentityCollection-Ca74dkaL-Ce-O_zQz.js +0 -2
- package/dist/OidcIdentityCollection-gnrLoF08-DJI-69Ow.js +0 -2
- package/dist/ProfileAssetCollection-CmbeSgDi-BpJ7XXsP.js +0 -2
- package/dist/ProfileMetadataCollection-DxX_BJKV-orYFlYii.js +0 -2
- package/dist/dist-DsMohSo_.js +0 -1487
- package/dist/dist-iMaSv6C_.js +0 -3712
- package/dist/resolveIdentity-BrJDCjYi-kdAssLr0.js +0 -2
package/AGENTS.md
CHANGED
|
@@ -8,7 +8,7 @@ CLI with lazy-loaded commands, manifest discovery, and class introspection.
|
|
|
8
8
|
smrt introspect # Discover SMRT objects in project
|
|
9
9
|
smrt doctor # Umbrella diagnostics; can verify a generation snapshot
|
|
10
10
|
smrt doctor --db # Add the live-schema parity section (see below)
|
|
11
|
-
smrt db:status # Pending schema changes + failed migration classification
|
|
11
|
+
smrt db:status # Pending schema changes + failed migration classification (+ tenant natural-key findings: a missing tenant-led unique exits 1, a surviving legacy global unique warns until `db:migrate --drop-legacy-natural-key`: src/commands/tenant-natural-keys.ts)
|
|
12
12
|
smrt db:status --parity # Same, plus live-schema parity (see below)
|
|
13
13
|
smrt db:orphans # agents/db-orphans.md
|
|
14
14
|
smrt db:migrate # agents/type-drift.md
|
|
@@ -19,6 +19,7 @@ smrt db:migrate-uuid # Convert schema-declared UUID text columns after d
|
|
|
19
19
|
smrt db:migrate-int8
|
|
20
20
|
smrt db:migrate-null-equal-indexes # ../core/agents/null-equal-indexes.md
|
|
21
21
|
smrt db:migrate-ledger-accounts [--dry-run] # Move pre-#3098 ledger rows out of `accounts` (smrt-ledgers README)
|
|
22
|
+
smrt db:migrate-qualified-names [--dry-run] # Opt-in old→current name backfill; doctor --db counts (../core/agents/model-moves.md)
|
|
22
23
|
smrt db:materialize-tenant-hierarchy [--dry-run] # smrt-users tenant hierarchy_path backfill (#3036)
|
|
23
24
|
smrt db:drop-framework-base-tables # One-time drop of the five #2644-orphaned framework-base tables
|
|
24
25
|
smrt db:drop-framework-base-tables --dry-run # Print the drop plan without executing
|
|
@@ -73,7 +74,11 @@ back instead of holding the locks it already took against every writer.
|
|
|
73
74
|
`--postgres-safe` selects **concurrent-index mode**: non-index DDL still commits
|
|
74
75
|
in one transaction, then each index statement runs
|
|
75
76
|
`CREATE INDEX CONCURRENTLY` / `DROP INDEX CONCURRENTLY` on one pinned session
|
|
76
|
-
after that commit. This is the mode for large index rollouts.
|
|
77
|
+
after that commit. This is the mode for large index rollouts. A same-name
|
|
78
|
+
UNIQUE recreate runs build-then-swap (temporary name, drop, `ALTER INDEX …
|
|
79
|
+
RENAME`; `swapUniqueIndexRecreates()`), so the table never lacks a unique index.
|
|
80
|
+
A `VALIDATE CONSTRAINT` (new or replaced foreign key) and the statements after
|
|
81
|
+
it in the same migration also run outside the transaction, in order.
|
|
77
82
|
|
|
78
83
|
- **Concurrent mode is not atomic.** Committed column/table changes survive a
|
|
79
84
|
later index failure; unfinished index migrations are recorded `failed`, and
|
package/README.md
CHANGED
|
@@ -49,6 +49,7 @@ The four snapshot options are atomic: supplying any one requires all four.
|
|
|
49
49
|
| `smrt db:migrate-uuid` | Convert schema-declared UUID text columns to native PostgreSQL uuid after data has been remapped |
|
|
50
50
|
| `smrt db:migrate-int8` | Widen legacy pre-#2373 int4 columns to BIGINT after reviewing the maintenance-window preflight |
|
|
51
51
|
| `smrt db:migrate-ledger-accounts [--dry-run]` | Move smrt-ledgers accounts out of the pre-#3098 shared `accounts` table into `ledger_accounts` (PostgreSQL; run between two `db:migrate` passes — see the smrt-ledgers README) |
|
|
52
|
+
| `smrt db:migrate-qualified-names [--dry-run] [--tenant <id>] [--force]` | Rewrite stored deprecated qualified names (`@smrt({ previousQualifiedNames })`) to current names. Opt-in, idempotent, tracked in `_smrt_backfills`; `smrt doctor --db` counts what remains (#3338) |
|
|
52
53
|
| `smrt db:drop-framework-base-tables` | One-time removal of the five framework-base tables (`smrt_objects`, `smrt_classes`, `smrt_collections`, `smrt_hierarchicals`, `smrt_polymorphic_associations`) orphaned by #2644; refuses if any target table has rows, an unexpected shape, or an inbound foreign key |
|
|
53
54
|
| `smrt db:drop-framework-base-tables --dry-run` | Print the drop plan (tables and companion indexes) without executing |
|
|
54
55
|
| `smrt db:diff` | Show schema differences without generating migration files |
|
|
@@ -110,6 +111,27 @@ upgrades have no automatic down migration. `smrt db:diff
|
|
|
110
111
|
queries and prints the read-only `_smrt_*` conversion plan without initializing
|
|
111
112
|
the tracker or writing to the database.
|
|
112
113
|
|
|
114
|
+
Empty text blocks those conversions too: `''` (or whitespace) is not a
|
|
115
|
+
timestamp, JSON document, or integer. When the manifest and live columns are
|
|
116
|
+
both nullable, opt in to storing it as NULL:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
smrt db:diff --empty-text-as-null # preview; notes how many values become NULL
|
|
120
|
+
smrt db:migrate --empty-text-as-null
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
It covers `text` -> `timestamptz`, `jsonb` and integer conversions. Any other
|
|
124
|
+
value that does not convert still blocks, and NOT NULL columns are never
|
|
125
|
+
changed. For `timestamptz` and `jsonb` the diff probes the column first: without
|
|
126
|
+
the flag the blocking advisory names the empty-text count. `text` -> integer is
|
|
127
|
+
not probed at diff time: the conversion is listed as executable (with the note
|
|
128
|
+
"empty-text value(s), if any, become NULL" under the flag), and a value that is
|
|
129
|
+
not an integer only fails when `db:migrate` applies it, rolling the batch back.
|
|
130
|
+
`db:status` and `db:history` take the same flag, so they assess the same
|
|
131
|
+
convergence. Separately, `--postgres-timestamp-legacy-timezone=UTC` converts a
|
|
132
|
+
legacy `text` timestamp with `NULLIF(…, '')` / `'null'` → NULL even without
|
|
133
|
+
`--empty-text-as-null` (a NOT NULL column still fails at ALTER time).
|
|
134
|
+
|
|
113
135
|
### Code Generation
|
|
114
136
|
|
|
115
137
|
| Command | Description |
|
package/agents/type-drift.md
CHANGED
|
@@ -25,6 +25,22 @@ stays reserved for ambiguous naive wall-clock strings the probe does not
|
|
|
25
25
|
accept. SQLite has no distinct storage for `text` vs `timestamptz`, so this
|
|
26
26
|
stays advisory-only there.
|
|
27
27
|
|
|
28
|
+
### Empty text (#3226)
|
|
29
|
+
|
|
30
|
+
The probe counts empty or whitespace-only text separately. When it is the
|
|
31
|
+
only obstacle and the manifest and live columns are both nullable,
|
|
32
|
+
`DiffOptions.emptyTextAsNull` (`--empty-text-as-null`) converts with
|
|
33
|
+
`USING (CASE WHEN btrim(col) = '' THEN NULL ELSE col END)::<type>` and the
|
|
34
|
+
change carries a `note`. The same opt-in applies to `jsonb` (after the
|
|
35
|
+
duplicate-key walk over the remaining values) and to `text` -> integer.
|
|
36
|
+
Without it, the timestamptz/jsonb advisory names the empty-text count and
|
|
37
|
+
prints the sample as `(empty)`. `text` -> integer has no diff-time probe: its
|
|
38
|
+
note says "if any", and a non-integer value fails only at apply time (the
|
|
39
|
+
preflight `RAISE`). The `--postgres-timestamp-legacy-timezone=UTC` path still
|
|
40
|
+
maps `''` and `'null'` to NULL without the opt-in (`differ.ts`
|
|
41
|
+
`generateTypeUpgradeSQL`). `db:status` / `db:history` accept
|
|
42
|
+
`--empty-text-as-null` too.
|
|
43
|
+
|
|
28
44
|
## text -> jsonb convergence and uuid visibility (#2772)
|
|
29
45
|
|
|
30
46
|
A `text` column on a table smrt itself creates, backed by a manifest `JSON`
|
|
@@ -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-CmFPKTaE.js";
|
|
3
3
|
import { SmrtObject, field, foreignKey, smrt } from "@happyvertical/smrt-core";
|
|
4
4
|
import { createHash, randomBytes } from "node:crypto";
|
|
5
5
|
//#region ../profiles/dist/chunks/ApiKey-BZmbOTnL.js
|
|
@@ -127,7 +127,7 @@ var ApiKey = class extends SmrtObject {
|
|
|
127
127
|
*/
|
|
128
128
|
static async verify(key, options = {}) {
|
|
129
129
|
const keyHash = ApiKey.hashKey(key);
|
|
130
|
-
const { ApiKeyCollection } = await import("./ApiKeyCollection-Bfb_nw81-
|
|
130
|
+
const { ApiKeyCollection } = await import("./ApiKeyCollection-Bfb_nw81-BVJ-i1Aw.js").then((n) => n.n);
|
|
131
131
|
const apiKey = await (await ApiKeyCollection.create(options)).findOne({ where: { keyHash } });
|
|
132
132
|
if (!apiKey) return null;
|
|
133
133
|
if (!apiKey.isValid()) return null;
|
|
@@ -4097,21 +4097,21 @@ var NostrIdentity = class extends SmrtObject {
|
|
|
4097
4097
|
* Find identity by public key
|
|
4098
4098
|
*/
|
|
4099
4099
|
static async findByPubkey(pubkey, options = {}) {
|
|
4100
|
-
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-Ca74dkaL-
|
|
4100
|
+
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-Ca74dkaL-C0rNgSy-.js").then((n) => n.n);
|
|
4101
4101
|
return await (await NostrIdentityCollection.create(options)).findOne({ where: { pubkey } });
|
|
4102
4102
|
}
|
|
4103
4103
|
/**
|
|
4104
4104
|
* Find identity by email
|
|
4105
4105
|
*/
|
|
4106
4106
|
static async findByEmail(email, options = {}) {
|
|
4107
|
-
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-Ca74dkaL-
|
|
4107
|
+
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-Ca74dkaL-C0rNgSy-.js").then((n) => n.n);
|
|
4108
4108
|
return await (await NostrIdentityCollection.create(options)).findOne({ where: { email: email.toLowerCase() } });
|
|
4109
4109
|
}
|
|
4110
4110
|
/**
|
|
4111
4111
|
* Find identity by NIP-05 username
|
|
4112
4112
|
*/
|
|
4113
4113
|
static async findByNip05(username, options = {}) {
|
|
4114
|
-
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-Ca74dkaL-
|
|
4114
|
+
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-Ca74dkaL-C0rNgSy-.js").then((n) => n.n);
|
|
4115
4115
|
return await (await NostrIdentityCollection.create(options)).findOne({ where: { nip05Username: username.toLowerCase() } });
|
|
4116
4116
|
}
|
|
4117
4117
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SmrtObject, field, foreignKey, smrt } from "@happyvertical/smrt-core";
|
|
2
|
-
//#region ../profiles/dist/chunks/OidcIdentity-
|
|
2
|
+
//#region ../profiles/dist/chunks/OidcIdentity-Cb1bxreM.js
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -35,7 +35,7 @@ var OidcIdentity = class extends SmrtObject {
|
|
|
35
35
|
* Find identity by issuer and subject
|
|
36
36
|
*/
|
|
37
37
|
static async findBySubject(issuer, subject, options = {}) {
|
|
38
|
-
const { OidcIdentityCollection } = await import("./OidcIdentityCollection-
|
|
38
|
+
const { OidcIdentityCollection } = await import("./OidcIdentityCollection-TV8VdK69-CUmZ-j4r.js").then((n) => n.r);
|
|
39
39
|
return await (await OidcIdentityCollection.create(options)).findBySubject(issuer, subject);
|
|
40
40
|
}
|
|
41
41
|
/** Build the collision-free natural key for one OIDC issuer subject. */
|
|
@@ -58,7 +58,7 @@ var OidcIdentity = class extends SmrtObject {
|
|
|
58
58
|
static async findOrCreate(profile, oidcData, options = {}) {
|
|
59
59
|
const profileId = profile.id;
|
|
60
60
|
if (typeof profileId !== "string" || !profileId) throw new Error("OidcIdentity.findOrCreate() requires a saved Profile.");
|
|
61
|
-
const { reuseExistingOidcIdentityForProfile } = await import("./resolveIdentity-
|
|
61
|
+
const { reuseExistingOidcIdentityForProfile } = await import("./resolveIdentity-B-PK6RwU-DxJFF8ad.js").then((n) => n.i);
|
|
62
62
|
const profileOptions = profile.options ?? {};
|
|
63
63
|
return (await reuseExistingOidcIdentityForProfile(profileId, {
|
|
64
64
|
email: oidcData.email,
|
package/dist/{ProfileCollection-DTT4KNpQ-D1RNYfjm.js → ProfileCollection-DuJT7Mum-zuWR2h3v.js}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { a as queryGlobal,
|
|
3
|
-
import { n as __exportAll$1 } from "./NostrIdentity-n70E0vck-
|
|
4
|
-
import { a as
|
|
2
|
+
import { a as queryGlobal, i as tenantId, l as withSystemContext, n as resolvePrompt, o as queryWithGlobals, r as TenantScoped, s as getTenantId, t as definePrompt } from "./dist-8C4XjDhz.js";
|
|
3
|
+
import { n as __exportAll$1 } from "./NostrIdentity-n70E0vck-CmFPKTaE.js";
|
|
4
|
+
import { a as getOwnedAssetsFromCollection, i as assertValidOwnedAssetSortOrder, n as assertAssetLinkable, o as removeOwnedAssetFromCollection, r as assertValidOwnedAssetRelationship, s as resolveOwnedAssetsById, t as addOwnedAssetFromCollection } from "./dist-CksLvqnZ.js";
|
|
5
5
|
import { RuntimeError, SmrtCollection, SmrtObject, ValidationError, field, foreignKey, isAbortedTransactionError, oneToMany, smrt } from "@happyvertical/smrt-core";
|
|
6
6
|
import { BackfillTableUnavailableError, BackfillTracker } from "@happyvertical/smrt-core/migrations";
|
|
7
|
-
//#region ../profiles/dist/chunks/ProfileCollection-
|
|
8
|
-
var
|
|
7
|
+
//#region ../profiles/dist/chunks/ProfileCollection-DuJT7Mum.js
|
|
8
|
+
var ProfileCollection_DuJT7Mum_exports = /* @__PURE__ */ __exportAll({
|
|
9
9
|
_: () => smrtProfilesGenerateBioPrompt,
|
|
10
10
|
a: () => Profile,
|
|
11
11
|
d: () => isOidcProvisioningRaceConflict,
|
|
@@ -387,6 +387,7 @@ var Profile = class extends SmrtObject {
|
|
|
387
387
|
emailKey = null;
|
|
388
388
|
name = "";
|
|
389
389
|
description;
|
|
390
|
+
isPublic = false;
|
|
390
391
|
metadata = [];
|
|
391
392
|
relationshipsFrom = [];
|
|
392
393
|
relationshipsTo = [];
|
|
@@ -396,6 +397,7 @@ var Profile = class extends SmrtObject {
|
|
|
396
397
|
if (options.email !== void 0) this.email = options.email;
|
|
397
398
|
if (options.name) this.name = options.name;
|
|
398
399
|
if (options.description !== void 0) this.description = options.description;
|
|
400
|
+
if (options.isPublic !== void 0) this.isPublic = options.isPublic;
|
|
399
401
|
}
|
|
400
402
|
/** Keep the durable identity key derived from the public email field. */
|
|
401
403
|
async save() {
|
|
@@ -428,9 +430,9 @@ var Profile = class extends SmrtObject {
|
|
|
428
430
|
* @param value - The value to set
|
|
429
431
|
*/
|
|
430
432
|
async addMetadata(metafieldSlug, value) {
|
|
431
|
-
const { ProfileMetafieldCollection } = await import("./ProfileMetafieldCollection-
|
|
432
|
-
const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-
|
|
433
|
-
const metafield = await (await ProfileMetafieldCollection.create(this.options)
|
|
433
|
+
const { ProfileMetafieldCollection } = await import("./ProfileMetafieldCollection-CoBuM_5G-TNxSMsBJ.js").then((n) => n.n);
|
|
434
|
+
const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-DQhbfEfa-D30yWyzB.js").then((n) => n.n);
|
|
435
|
+
const metafield = await this.resolveMetafield(await ProfileMetafieldCollection.create(this.options), metafieldSlug);
|
|
434
436
|
if (!metafield) throw new Error(`Metafield '${metafieldSlug}' not found`);
|
|
435
437
|
await metafield.validateValue(value);
|
|
436
438
|
const metadataCollection = await ProfileMetadataCollection.create(this.options);
|
|
@@ -444,13 +446,15 @@ var Profile = class extends SmrtObject {
|
|
|
444
446
|
if (existing.length > 0) {
|
|
445
447
|
const metadata = existing[0];
|
|
446
448
|
metadata.value = String(value);
|
|
449
|
+
if (!metadata.tenantId && this.tenantId) metadata.tenantId = this.tenantId;
|
|
447
450
|
await metadata.save();
|
|
448
451
|
} else {
|
|
449
452
|
if (!this.id || !metafield.id) throw new Error("Profile.addMetadata requires a persisted profile and metafield (missing id)");
|
|
450
453
|
await (await metadataCollection.create({
|
|
451
454
|
profileId: this.id,
|
|
452
455
|
metafieldId: metafield.id,
|
|
453
|
-
value: String(value)
|
|
456
|
+
value: String(value),
|
|
457
|
+
...this.tenantId ? { tenantId: this.tenantId } : {}
|
|
454
458
|
})).save();
|
|
455
459
|
}
|
|
456
460
|
}
|
|
@@ -460,7 +464,7 @@ var Profile = class extends SmrtObject {
|
|
|
460
464
|
* @returns Object with metafield slugs as keys
|
|
461
465
|
*/
|
|
462
466
|
async getMetadata() {
|
|
463
|
-
const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-
|
|
467
|
+
const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-DQhbfEfa-D30yWyzB.js").then((n) => n.n);
|
|
464
468
|
return await (await ProfileMetadataCollection.create(this.options)).getMetadataObject(this.id);
|
|
465
469
|
}
|
|
466
470
|
/**
|
|
@@ -477,9 +481,9 @@ var Profile = class extends SmrtObject {
|
|
|
477
481
|
* @param metafieldSlug - The slug of the metafield to remove
|
|
478
482
|
*/
|
|
479
483
|
async removeMetadata(metafieldSlug) {
|
|
480
|
-
const { ProfileMetafieldCollection } = await import("./ProfileMetafieldCollection-
|
|
481
|
-
const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-
|
|
482
|
-
const metafield = await (await ProfileMetafieldCollection.create(this.options)
|
|
484
|
+
const { ProfileMetafieldCollection } = await import("./ProfileMetafieldCollection-CoBuM_5G-TNxSMsBJ.js").then((n) => n.n);
|
|
485
|
+
const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-DQhbfEfa-D30yWyzB.js").then((n) => n.n);
|
|
486
|
+
const metafield = await this.resolveMetafield(await ProfileMetafieldCollection.create(this.options), metafieldSlug);
|
|
483
487
|
if (!metafield) throw new Error(`Metafield '${metafieldSlug}' not found`);
|
|
484
488
|
const existing = await (await ProfileMetadataCollection.create(this.options)).list({
|
|
485
489
|
where: {
|
|
@@ -490,8 +494,37 @@ var Profile = class extends SmrtObject {
|
|
|
490
494
|
});
|
|
491
495
|
if (existing.length > 0) await existing[0].delete();
|
|
492
496
|
}
|
|
497
|
+
/**
|
|
498
|
+
* The metafield a slug names for this profile: the profile tenant's own
|
|
499
|
+
* definition first, then a global (NULL-tenant) one. A profile never takes
|
|
500
|
+
* another tenant's definition, which a super-admin or system read would
|
|
501
|
+
* otherwise return. A tenant-less profile falls back to the active tenant
|
|
502
|
+
* context's own definition only (none under system context).
|
|
503
|
+
*/
|
|
504
|
+
async resolveMetafield(metafields, slug) {
|
|
505
|
+
const candidates = await metafields.list({ where: { slug } });
|
|
506
|
+
const ownerTenantId = this.tenantId || getTenantId();
|
|
507
|
+
return candidates.find((candidate) => ownerTenantId && candidate.tenantId === ownerTenantId) ?? candidates.find((candidate) => !candidate.tenantId) ?? null;
|
|
508
|
+
}
|
|
509
|
+
async getProfileLinkCollection() {
|
|
510
|
+
const { ProfileLinkCollection } = await import("./ProfileLinkCollection-4uNURz32-Fmbnrmyr.js").then((n) => n.r);
|
|
511
|
+
return ProfileLinkCollection.create({ db: this.db });
|
|
512
|
+
}
|
|
513
|
+
/** This profile's web links in display order. */
|
|
514
|
+
async getLinks() {
|
|
515
|
+
if (!this.id) return [];
|
|
516
|
+
return (await this.getProfileLinkCollection()).listForProfile(this.id);
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
* Replaces this profile's web links with `links`, in that order, in one
|
|
520
|
+
* transaction (see `ProfileLinkCollection.replaceForProfile`).
|
|
521
|
+
*/
|
|
522
|
+
async setLinks(links) {
|
|
523
|
+
if (!this.id) throw new Error("Cannot set links on an unsaved profile");
|
|
524
|
+
return (await this.getProfileLinkCollection()).replaceForProfile(this.id, links);
|
|
525
|
+
}
|
|
493
526
|
async getProfileAssetCollection() {
|
|
494
|
-
const { ProfileAssetCollection } = await import("./ProfileAssetCollection-
|
|
527
|
+
const { ProfileAssetCollection } = await import("./ProfileAssetCollection-B9hacUJa-C53RAi1e.js").then((n) => n.n);
|
|
495
528
|
return ProfileAssetCollection.create({ db: this.db });
|
|
496
529
|
}
|
|
497
530
|
async getAssets(relationship) {
|
|
@@ -501,6 +534,7 @@ var Profile = class extends SmrtObject {
|
|
|
501
534
|
}
|
|
502
535
|
async addAsset(asset, relationship = "attachment", sortOrder = 0) {
|
|
503
536
|
if (!this.id || !asset.id) throw new Error("Cannot associate unsaved profile or asset");
|
|
537
|
+
await assertAssetLinkable(this.db, asset.id, this.tenantId, "profile");
|
|
504
538
|
assertValidOwnedAssetRelationship(relationship);
|
|
505
539
|
assertValidOwnedAssetSortOrder(sortOrder);
|
|
506
540
|
await (await this.getProfileAssetCollection()).attach(this.id, asset.id, {
|
|
@@ -521,9 +555,9 @@ var Profile = class extends SmrtObject {
|
|
|
521
555
|
* @param contextProfile - Optional context profile for tertiary relationships
|
|
522
556
|
*/
|
|
523
557
|
async addRelationship(toProfile, relationshipSlug, contextProfile) {
|
|
524
|
-
const { ProfileRelationshipTypeCollection } = await import("./ProfileRelationshipTypeCollection-BdXwd7Kf-
|
|
525
|
-
const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-DUVgaIqf-
|
|
526
|
-
const { ProfileRelationshipType } = await import("./ProfileRelationshipType-BRiRka6t-
|
|
558
|
+
const { ProfileRelationshipTypeCollection } = await import("./ProfileRelationshipTypeCollection-BdXwd7Kf-Djb3_k5Z.js").then((n) => n.n);
|
|
559
|
+
const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-DUVgaIqf-CKcxS2xW.js").then((n) => n.n);
|
|
560
|
+
const { ProfileRelationshipType } = await import("./ProfileRelationshipType-BRiRka6t-BFgCVe6p.js").then((n) => n.n).then((n) => n.n);
|
|
527
561
|
const relationshipType = await (await ProfileRelationshipTypeCollection.create(this.options)).getBySlug(relationshipSlug);
|
|
528
562
|
if (!relationshipType) throw new Error(`Relationship type '${relationshipSlug}' not found`);
|
|
529
563
|
const relationshipCollection = await ProfileRelationshipCollection.create(this.options);
|
|
@@ -547,8 +581,8 @@ var Profile = class extends SmrtObject {
|
|
|
547
581
|
* @returns Array of ProfileRelationship instances
|
|
548
582
|
*/
|
|
549
583
|
async getRelationships(options) {
|
|
550
|
-
const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-DUVgaIqf-
|
|
551
|
-
const { ProfileRelationshipTypeCollection } = await import("./ProfileRelationshipTypeCollection-BdXwd7Kf-
|
|
584
|
+
const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-DUVgaIqf-CKcxS2xW.js").then((n) => n.n);
|
|
585
|
+
const { ProfileRelationshipTypeCollection } = await import("./ProfileRelationshipTypeCollection-BdXwd7Kf-Djb3_k5Z.js").then((n) => n.n);
|
|
552
586
|
const relationshipCollection = await ProfileRelationshipCollection.create(this.options);
|
|
553
587
|
const direction = options?.direction || "all";
|
|
554
588
|
let typeId;
|
|
@@ -591,8 +625,8 @@ var Profile = class extends SmrtObject {
|
|
|
591
625
|
* @param relationshipSlug - The type of relationship to remove
|
|
592
626
|
*/
|
|
593
627
|
async removeRelationship(toProfile, relationshipSlug) {
|
|
594
|
-
const { ProfileRelationshipTypeCollection } = await import("./ProfileRelationshipTypeCollection-BdXwd7Kf-
|
|
595
|
-
const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-DUVgaIqf-
|
|
628
|
+
const { ProfileRelationshipTypeCollection } = await import("./ProfileRelationshipTypeCollection-BdXwd7Kf-Djb3_k5Z.js").then((n) => n.n);
|
|
629
|
+
const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-DUVgaIqf-CKcxS2xW.js").then((n) => n.n);
|
|
596
630
|
const relationshipType = await (await ProfileRelationshipTypeCollection.create(this.options)).getBySlug(relationshipSlug);
|
|
597
631
|
if (!relationshipType) throw new Error(`Relationship type '${relationshipSlug}' not found`);
|
|
598
632
|
const relationshipCollection = await ProfileRelationshipCollection.create(this.options);
|
|
@@ -685,7 +719,7 @@ var Profile = class extends SmrtObject {
|
|
|
685
719
|
* @returns Array of API keys
|
|
686
720
|
*/
|
|
687
721
|
async getApiKeys() {
|
|
688
|
-
const { ApiKeyCollection } = await import("./ApiKeyCollection-Bfb_nw81-
|
|
722
|
+
const { ApiKeyCollection } = await import("./ApiKeyCollection-Bfb_nw81-BVJ-i1Aw.js").then((n) => n.n);
|
|
689
723
|
return await (await ApiKeyCollection.create(this.options)).findByProfile(this.id);
|
|
690
724
|
}
|
|
691
725
|
/**
|
|
@@ -694,7 +728,7 @@ var Profile = class extends SmrtObject {
|
|
|
694
728
|
* @returns Array of active API keys
|
|
695
729
|
*/
|
|
696
730
|
async getActiveApiKeys() {
|
|
697
|
-
const { ApiKeyCollection } = await import("./ApiKeyCollection-Bfb_nw81-
|
|
731
|
+
const { ApiKeyCollection } = await import("./ApiKeyCollection-Bfb_nw81-BVJ-i1Aw.js").then((n) => n.n);
|
|
698
732
|
return await (await ApiKeyCollection.create(this.options)).findActiveByProfile(this.id);
|
|
699
733
|
}
|
|
700
734
|
/**
|
|
@@ -704,7 +738,7 @@ var Profile = class extends SmrtObject {
|
|
|
704
738
|
* @returns The generated key (plaintext) and ApiKey record
|
|
705
739
|
*/
|
|
706
740
|
async generateApiKey(options) {
|
|
707
|
-
const { ApiKey } = await import("./ApiKey-BZmbOTnL-
|
|
741
|
+
const { ApiKey } = await import("./ApiKey-BZmbOTnL-d61__hH4.js").then((n) => n.n).then((n) => n.n);
|
|
708
742
|
return await ApiKey.generate(this, {
|
|
709
743
|
...options,
|
|
710
744
|
db: this.options?.db
|
|
@@ -716,7 +750,7 @@ var Profile = class extends SmrtObject {
|
|
|
716
750
|
* @returns Array of OIDC identity records
|
|
717
751
|
*/
|
|
718
752
|
async getOidcIdentities() {
|
|
719
|
-
const { OidcIdentityCollection } = await import("./OidcIdentityCollection-
|
|
753
|
+
const { OidcIdentityCollection } = await import("./OidcIdentityCollection-TV8VdK69-CUmZ-j4r.js").then((n) => n.r);
|
|
720
754
|
return await (await OidcIdentityCollection.create(this.options)).findByProfile(this.id);
|
|
721
755
|
}
|
|
722
756
|
/**
|
|
@@ -729,7 +763,7 @@ var Profile = class extends SmrtObject {
|
|
|
729
763
|
* type, but refuses to create or rebind authority.
|
|
730
764
|
*/
|
|
731
765
|
async linkOidcIdentity(oidcData) {
|
|
732
|
-
const { OidcIdentityCollection } = await import("./OidcIdentityCollection-
|
|
766
|
+
const { OidcIdentityCollection } = await import("./OidcIdentityCollection-TV8VdK69-CUmZ-j4r.js").then((n) => n.r);
|
|
733
767
|
return await (await OidcIdentityCollection.create(this.options)).linkToProfile(this, oidcData);
|
|
734
768
|
}
|
|
735
769
|
/**
|
|
@@ -738,7 +772,7 @@ var Profile = class extends SmrtObject {
|
|
|
738
772
|
* @returns Array of Nostr identity records
|
|
739
773
|
*/
|
|
740
774
|
async getNostrIdentities() {
|
|
741
|
-
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-Ca74dkaL-
|
|
775
|
+
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-Ca74dkaL-C0rNgSy-.js").then((n) => n.n);
|
|
742
776
|
return await (await NostrIdentityCollection.create(this.options)).findByProfile(this.id);
|
|
743
777
|
}
|
|
744
778
|
/**
|
|
@@ -748,7 +782,7 @@ var Profile = class extends SmrtObject {
|
|
|
748
782
|
* @returns The linked Nostr identity record
|
|
749
783
|
*/
|
|
750
784
|
async linkNostrIdentity(nostrData) {
|
|
751
|
-
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-Ca74dkaL-
|
|
785
|
+
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-Ca74dkaL-C0rNgSy-.js").then((n) => n.n);
|
|
752
786
|
return await (await NostrIdentityCollection.create(this.options)).linkToProfile(this, nostrData);
|
|
753
787
|
}
|
|
754
788
|
/**
|
|
@@ -758,7 +792,7 @@ var Profile = class extends SmrtObject {
|
|
|
758
792
|
* @returns Array of audit log entries
|
|
759
793
|
*/
|
|
760
794
|
async getAuditLogs(limit = 50) {
|
|
761
|
-
const { AuditLogCollection } = await import("./AuditLogCollection-B1YonCAP-
|
|
795
|
+
const { AuditLogCollection } = await import("./AuditLogCollection-B1YonCAP-bpq7rM2b.js").then((n) => n.n);
|
|
762
796
|
return await (await AuditLogCollection.create(this.options)).getRecentActivity(this.id, limit);
|
|
763
797
|
}
|
|
764
798
|
/**
|
|
@@ -768,7 +802,7 @@ var Profile = class extends SmrtObject {
|
|
|
768
802
|
* @returns The created audit log entry
|
|
769
803
|
*/
|
|
770
804
|
async recordAction(options) {
|
|
771
|
-
const { AuditLogCollection } = await import("./AuditLogCollection-B1YonCAP-
|
|
805
|
+
const { AuditLogCollection } = await import("./AuditLogCollection-B1YonCAP-bpq7rM2b.js").then((n) => n.n);
|
|
772
806
|
return await (await AuditLogCollection.create(this.options)).record({
|
|
773
807
|
profile: this,
|
|
774
808
|
...options
|
|
@@ -784,6 +818,10 @@ __decorateClass([field({
|
|
|
784
818
|
readonly: true
|
|
785
819
|
})], Profile.prototype, "emailKey", 2);
|
|
786
820
|
__decorateClass([field({ required: true })], Profile.prototype, "name", 2);
|
|
821
|
+
__decorateClass([field({
|
|
822
|
+
type: "boolean",
|
|
823
|
+
default: false
|
|
824
|
+
})], Profile.prototype, "isPublic", 2);
|
|
787
825
|
__decorateClass([oneToMany("ProfileMetadata")], Profile.prototype, "metadata", 2);
|
|
788
826
|
__decorateClass([oneToMany("ProfileRelationship", { foreignKey: "fromProfileId" })], Profile.prototype, "relationshipsFrom", 2);
|
|
789
827
|
__decorateClass([oneToMany("ProfileRelationship", { foreignKey: "toProfileId" })], Profile.prototype, "relationshipsTo", 2);
|
|
@@ -1127,4 +1165,4 @@ function readRequiredString(row, key) {
|
|
|
1127
1165
|
return value;
|
|
1128
1166
|
}
|
|
1129
1167
|
//#endregion
|
|
1130
|
-
export { coordinateOidcProvisioning as a, saveOidcRaceArbiter as c, ProfileType as i, ProfileCollection as n, isOidcProvisioningRaceConflict as o,
|
|
1168
|
+
export { coordinateOidcProvisioning as a, saveOidcRaceArbiter as c, ProfileType as i, ProfileCollection as n, isOidcProvisioningRaceConflict as o, ProfileCollection_DuJT7Mum_exports as r, normalizeIdentityEmail as s, Profile as t };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { h as ProfileMetafieldCollection_exports } from "./dist-
|
|
1
|
+
import { h as ProfileMetafieldCollection_exports } from "./dist-DtTkpUee.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-DtTkpUee.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-DtTkpUee.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-CmFPKTaE.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-DtTkpUee.js";
|
|
2
2
|
export { ProfileRelationshipTypeCollection_exports as n };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-generator.d.ts","sourceRoot":"","sources":["../src/cli-generator.ts"],"names":[],"mappings":";AAEA;;;;GAIG;AAiBH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,YAA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C7B;;OAEG;IACH,OAAO,CAAC,eAAe;IAUvB;;OAEG;IACH,OAAO,CAAC,YAAY;IAuBpB;;OAEG;IACH,OAAO,CAAC,YAAY;CAqBrB;AAGD,wBAAsB,IAAI,kBAoFzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db-diff.d.ts","sourceRoot":"","sources":["../../src/commands/db-diff.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"db-diff.d.ts","sourceRoot":"","sources":["../../src/commands/db-diff.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAoCtD,eAAO,MAAM,aAAa,EAAE,UA2d3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db-history.d.ts","sourceRoot":"","sources":["../../src/commands/db-history.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"db-history.d.ts","sourceRoot":"","sources":["../../src/commands/db-history.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AA4DtD,eAAO,MAAM,gBAAgB,EAAE,UAwV9B,CAAC"}
|
|
@@ -71,6 +71,8 @@ export interface MigrationAction {
|
|
|
71
71
|
sql?: string;
|
|
72
72
|
sqlStatements?: string[];
|
|
73
73
|
advisory?: SchemaChangeAdvisoryLike;
|
|
74
|
+
/** Operator-facing note carried from `SchemaChangeLike.note` (#3226). */
|
|
75
|
+
note?: string;
|
|
74
76
|
/** Set on `add_foreign_key` / `drop_foreign_key` actions (#2748). */
|
|
75
77
|
foreignKey?: ForeignKeyDefinitionLike;
|
|
76
78
|
/** See `SchemaChangeLike.orphanBlocked` (#2748). */
|
|
@@ -117,6 +119,11 @@ export interface SchemaChangeLike {
|
|
|
117
119
|
/** See `MigrationAction.phase` (#2608). */
|
|
118
120
|
phase?: 'pre_foreign_key';
|
|
119
121
|
advisory?: SchemaChangeAdvisoryLike;
|
|
122
|
+
/**
|
|
123
|
+
* Operator-facing note on an executable change (mirrors core's
|
|
124
|
+
* `SchemaChange.note`), e.g. empty text stored as NULL (#3226).
|
|
125
|
+
*/
|
|
126
|
+
note?: string;
|
|
120
127
|
sql?: string;
|
|
121
128
|
sqlStatements?: string[];
|
|
122
129
|
/** Set on `add_foreign_key` / `drop_foreign_key` changes (#2748). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db-migrate-actions.d.ts","sourceRoot":"","sources":["../../src/commands/db-migrate-actions.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAC5B,cAAc,GACd,eAAe,GACf,aAAa,GACb,cAAc,CAAC;AAEnB;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,SAAS,GAAG,MAAM,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,iFAAiF;AACjF,MAAM,MAAM,oBAAoB,GAC5B,SAAS,GACT,UAAU,GACV,UAAU,GACV,WAAW,CAAC;AAEhB;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,QAAQ,CAAC,EAAE,oBAAoB,CAAC;CACjC;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EACA,YAAY,GACZ,aAAa,GACb,cAAc,GACd,iBAAiB,GACjB,kBAAkB,GAClB,WAAW,GACX,YAAY,GACZ,eAAe,GACf,cAAc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GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EACnC,wBAAwB,GAAE,GAAG,CAAC,MAAM,CAAa,GAChD;IAAE,OAAO,EAAE,eAAe,EAAE,CAAC;IAAC,QAAQ,EAAE,iBAAiB,EAAE,CAAA;CAAE,CAiE/D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kCAAkC,CAChD,CAAC,SAAS;IAAE,MAAM,EAAE,eAAe,CAAA;CAAE,EACrC,OAAO,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAAG,CAAC,EAAE,CAUlD;AAMD,iEAAiE;AACjE,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,eAAe,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,WAAW,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CACpC,mBAAmB,EAAE,eAAe,EAAE,GACrC;IACD,QAAQ,EAAE,yBAAyB,EAAE,CAAC;IACtC,WAAW,EAAE,eAAe,EAAE,CAAC;CAChC,CA+BA;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE1D"}
|
|
@@ -45,6 +45,13 @@ export interface LiveSchemaParityOutcome {
|
|
|
45
45
|
* duplicates rows.
|
|
46
46
|
*/
|
|
47
47
|
export declare function collectRegistryConflictTargets(): Record<string, ConflictTargetInput[]>;
|
|
48
|
+
/**
|
|
49
|
+
* Matches core's collection classification, including a registered collection
|
|
50
|
+
* subclass whose immediate parent is another collection class. Unknown
|
|
51
|
+
* registrations stay included so a malformed registry cannot hide a real
|
|
52
|
+
* persistence target from a fail-closed parity check.
|
|
53
|
+
*/
|
|
54
|
+
export declare function isCollectionRegistration(className: string): boolean;
|
|
48
55
|
/**
|
|
49
56
|
* Run the parity check against the configured database.
|
|
50
57
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db-parity.d.ts","sourceRoot":"","sources":["../../src/commands/db-parity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EACL,KAAK,mBAAmB,EAGxB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAE5B,MAAM,0BAA0B,CAAC;AASlC,uDAAuD;AACvD,MAAM,WAAW,0BAA0B;IACzC,sDAAsD;IACtD,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,0CAA0C;AAC1C,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,sBAAsB,GAAG,IAAI,CAAC;IACtC,6EAA6E;IAC7E,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CAChD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,8BAA8B,IAAI,MAAM,CACtD,MAAM,EACN,mBAAmB,EAAE,CACtB,CAkBA;
|
|
1
|
+
{"version":3,"file":"db-parity.d.ts","sourceRoot":"","sources":["../../src/commands/db-parity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EACL,KAAK,mBAAmB,EAGxB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAE5B,MAAM,0BAA0B,CAAC;AASlC,uDAAuD;AACvD,MAAM,WAAW,0BAA0B;IACzC,sDAAsD;IACtD,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,0CAA0C;AAC1C,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,sBAAsB,GAAG,IAAI,CAAC;IACtC,6EAA6E;IAC7E,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CAChD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,8BAA8B,IAAI,MAAM,CACtD,MAAM,EACN,mBAAmB,EAAE,CACtB,CAkBA;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAYnE;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,GAAE,0BAA+B,GACvC,OAAO,CAAC,uBAAuB,CAAC,CAoDlC;AAQD,8DAA8D;AAC9D,wBAAgB,cAAc,CAC5B,MAAM,EAAE,sBAAsB,EAC9B,QAAQ,EAAE,kBAAkB,GAC3B,iBAAiB,EAAE,CAQrB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,sBAAsB,EAC9B,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,GAClC,MAAM,EAAE,CAuEV;AAED,qEAAqE;AACrE,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,sBAAsB,GAAG,MAAM,CAE5E"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stored references to deprecated qualified names (#3338).
|
|
3
|
+
*
|
|
4
|
+
* `smrt doctor --db` reports how many rows still store a name a class
|
|
5
|
+
* declared in `@smrt({ previousQualifiedNames })` — the signal that an alias
|
|
6
|
+
* can (or cannot yet) be removed. `smrt db:migrate-qualified-names` is the
|
|
7
|
+
* opt-in, idempotent cleanup; nothing rewrites stored names automatically.
|
|
8
|
+
*/
|
|
9
|
+
import { type LegacyQualifiedNameReport } from '@happyvertical/smrt-core/migrations';
|
|
10
|
+
import type { CLICommand } from '../cli-generator.js';
|
|
11
|
+
/** Result of one CLI-level legacy-name count. */
|
|
12
|
+
export interface LegacyQualifiedNameOutcome {
|
|
13
|
+
report: LegacyQualifiedNameReport | null;
|
|
14
|
+
/** Human-readable failure reason; non-null exactly when `report` is null. */
|
|
15
|
+
error: string | null;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Count stored deprecated qualified names in the configured database.
|
|
19
|
+
* Never throws for an operational problem.
|
|
20
|
+
*/
|
|
21
|
+
export declare function runLegacyQualifiedNameReport(options?: {
|
|
22
|
+
discover?: boolean;
|
|
23
|
+
}): Promise<LegacyQualifiedNameOutcome>;
|
|
24
|
+
/**
|
|
25
|
+
* Render a legacy-name report as the lines `smrt doctor --db` and
|
|
26
|
+
* `smrt db:migrate-qualified-names` print.
|
|
27
|
+
*
|
|
28
|
+
* A zero count is a removal signal only when it is global and complete: a
|
|
29
|
+
* tenant-scoped count (`tenantId`) or one that skipped untenanted tables
|
|
30
|
+
* never says the aliases are removable. Stored rows are also only half the
|
|
31
|
+
* picture, so every report reminds the operator that source still naming an
|
|
32
|
+
* old name must move first.
|
|
33
|
+
*/
|
|
34
|
+
export declare function formatLegacyQualifiedNameReport(report: LegacyQualifiedNameReport, options?: {
|
|
35
|
+
tenantId?: string;
|
|
36
|
+
}): string[];
|
|
37
|
+
/** `smrt db:migrate-qualified-names` — the opt-in rewrite. */
|
|
38
|
+
export declare const dbMigrateQualifiedNamesCommand: CLICommand;
|
|
39
|
+
//# sourceMappingURL=db-qualified-names.d.ts.map
|