@happyvertical/smrt-cli 0.57.9 → 0.57.11
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/README.md +5 -0
- package/agents/commerce-money-upgrade.md +2 -0
- package/dist/{AuditLogCollection-WDHL-_AF-C4XUiuEx.js → AuditLogCollection-WDHL-_AF-B-Lxv2zK.js} +1 -1
- package/dist/{OidcIdentity-BUblgQLs-e55giMbr.js → OidcIdentity-BUblgQLs-Ckm8QYCF.js} +2 -2
- package/dist/{OidcIdentityCollection-ClOyaHeF-CaHNLNCO.js → OidcIdentityCollection-ClOyaHeF-DgdpVtwP.js} +1 -1
- package/dist/{ProfileAssetCollection-CRMcjLJ--B4UtPQ3_.js → ProfileAssetCollection-CRMcjLJ--C0ZOnhYa.js} +3 -3
- package/dist/{ProfileCollection-C4INKh7Y-B5SWDGlm.js → ProfileCollection-C4INKh7Y-CWCUc0Hb.js} +17 -17
- package/dist/{ProfileLinkCollection-DFfZRsgv-5HUe2id3.js → ProfileLinkCollection-DFfZRsgv-ChNJUwmD.js} +2 -2
- package/dist/{ProfileMetadataCollection-BIYKy4Y3-DYsIbUpk.js → ProfileMetadataCollection-BIYKy4Y3-CtIYgKhg.js} +1 -1
- package/dist/{ProfileMetafieldCollection-Buz7gzag-BxhNKXxI.js → ProfileMetafieldCollection-Buz7gzag-iqEnkSKu.js} +1 -1
- package/dist/{ProfileRelationshipCollection-C4g_QLI4-BXuiyTZa.js → ProfileRelationshipCollection-C4g_QLI4-CZhaklz3.js} +1 -1
- package/dist/{ProfileTypeCollection-B7kwi1mU-pxb25IJ6.js → ProfileTypeCollection-B7kwi1mU-4EyAFp2c.js} +2 -2
- package/dist/cli-generator.d.ts +9 -0
- package/dist/cli-generator.d.ts.map +1 -1
- package/dist/commands/db-upgrade-commerce-money.d.ts.map +1 -1
- package/dist/{commands-DgGHIYMC.js → commands-CogDQhN_.js} +3 -2
- package/dist/{dist-DWUS-MxT.js → dist-BDzUy1ec.js} +5 -5
- package/dist/dist-BM-JGnJr.js +5017 -0
- package/dist/{dist-DH1yeulh.js → dist-BVztM_cy.js} +2 -2
- package/dist/dist-C7aZJWmJ.js +21 -0
- package/dist/dist-qMFMMDSO.js +1908 -0
- package/dist/index.js +50 -11
- package/dist/{oidcProvisioningPrimitives-DNP9EZlU-ClU9HV60.js → oidcProvisioningPrimitives-DNP9EZlU-B9po079I.js} +3 -3
- package/dist/{resolveIdentity-CkyqvctR-DIgL16MM.js → resolveIdentity-CkyqvctR-BWp3cZAz.js} +14 -14
- package/package.json +15 -15
- package/dist/dist-BGg1-1gH.js +0 -1908
- package/dist/dist-C4r0KFBC.js +0 -5017
- package/dist/dist-VrkK51hS.js +0 -21
package/README.md
CHANGED
|
@@ -318,6 +318,11 @@ For each registered s-m-r-t object, the CLI generates:
|
|
|
318
318
|
| `<object>:delete <id>` | Delete object |
|
|
319
319
|
| `<object>:<method> <id>` | Custom methods exposed via `cli: { include: [...] }` |
|
|
320
320
|
|
|
321
|
+
`create` and `update` apply the same write policy as the generated REST routes
|
|
322
|
+
and MCP tools in every input mode (`--from-file`, interactive, flags): fields
|
|
323
|
+
outside `api.writable`, `readonly` fields and server-managed keys (`id`,
|
|
324
|
+
`tenantId`, timestamps) are dropped.
|
|
325
|
+
|
|
321
326
|
Custom methods on s-m-r-t objects are auto-discovered from manifests. Method parameters become CLI options (camelCase to kebab-case).
|
|
322
327
|
|
|
323
328
|
## Usage
|
|
@@ -42,6 +42,8 @@ changes, and the command lists each failing document. So do an invalid
|
|
|
42
42
|
stored rate, an invoice posted under the earlier version (void its journal and
|
|
43
43
|
clear the link, or reset the data), and an existing `rate-<percent>` code that
|
|
44
44
|
means a different rate. Fix or reset that data and rerun; converted tenants are skipped.
|
|
45
|
+
Every run also sets contracts whose billing schedule is NULL (written before
|
|
46
|
+
the column defaulted to empty) to empty, and prints how many (#4155).
|
|
45
47
|
Once no tenant needs the upgrade, the earlier version's columns and table are
|
|
46
48
|
dropped. The command exits nonzero while any tenant still needs it.
|
|
47
49
|
|
package/dist/{AuditLogCollection-WDHL-_AF-C4XUiuEx.js → AuditLogCollection-WDHL-_AF-B-Lxv2zK.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { i as tenantId, r as TenantScoped } from "./dist-
|
|
2
|
+
import { i as tenantId, r as TenantScoped } from "./dist-BVztM_cy.js";
|
|
3
3
|
import { n as __exportAll$1 } from "./NostrIdentity-AC8fAdxe-DKxKyu_a.js";
|
|
4
4
|
import { SmrtCollection, SmrtObject, field, foreignKey, smrt } from "@happyvertical/smrt-core";
|
|
5
5
|
//#region ../profiles/dist/chunks/AuditLogCollection-WDHL-_AF.js
|
|
@@ -42,7 +42,7 @@ var OidcIdentity = class extends SmrtObject {
|
|
|
42
42
|
* Find identity by issuer and subject
|
|
43
43
|
*/
|
|
44
44
|
static async findBySubject(issuer, subject, options = {}) {
|
|
45
|
-
const { OidcIdentityCollection } = await import("./OidcIdentityCollection-ClOyaHeF-
|
|
45
|
+
const { OidcIdentityCollection } = await import("./OidcIdentityCollection-ClOyaHeF-DgdpVtwP.js").then((n) => n.r).then((n) => n.r);
|
|
46
46
|
return await (await OidcIdentityCollection.create(options)).findBySubject(issuer, subject);
|
|
47
47
|
}
|
|
48
48
|
/** Build the collision-free natural key for one OIDC issuer subject. */
|
|
@@ -65,7 +65,7 @@ var OidcIdentity = class extends SmrtObject {
|
|
|
65
65
|
static async findOrCreate(profile, oidcData, options = {}) {
|
|
66
66
|
const profileId = profile.id;
|
|
67
67
|
if (typeof profileId !== "string" || !profileId) throw new Error("OidcIdentity.findOrCreate() requires a saved Profile.");
|
|
68
|
-
const { reuseExistingOidcIdentityForProfile } = await import("./resolveIdentity-CkyqvctR-
|
|
68
|
+
const { reuseExistingOidcIdentityForProfile } = await import("./resolveIdentity-CkyqvctR-BWp3cZAz.js").then((n) => n.i).then((n) => n.i);
|
|
69
69
|
const profileOptions = profile.options ?? {};
|
|
70
70
|
return (await reuseExistingOidcIdentityForProfile(profileId, {
|
|
71
71
|
email: oidcData.email,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
2
|
import { n as __exportAll$1 } from "./NostrIdentity-AC8fAdxe-DKxKyu_a.js";
|
|
3
|
-
import { t as OidcIdentity } from "./OidcIdentity-BUblgQLs-
|
|
3
|
+
import { t as OidcIdentity } from "./OidcIdentity-BUblgQLs-Ckm8QYCF.js";
|
|
4
4
|
import { SmrtCollection } from "@happyvertical/smrt-core";
|
|
5
5
|
//#region ../profiles/dist/chunks/OidcIdentityCollection-ClOyaHeF.js
|
|
6
6
|
var OidcIdentityCollection_ClOyaHeF_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { i as tenantId, r as TenantScoped } from "./dist-
|
|
2
|
+
import { i as tenantId, r as TenantScoped } from "./dist-BVztM_cy.js";
|
|
3
3
|
import { n as __exportAll$1 } from "./NostrIdentity-AC8fAdxe-DKxKyu_a.js";
|
|
4
|
-
import { a as getOwnedAssetsFromCollection, o as removeOwnedAssetFromCollection, t as addOwnedAssetFromCollection } from "./dist-
|
|
4
|
+
import { a as getOwnedAssetsFromCollection, o as removeOwnedAssetFromCollection, t as addOwnedAssetFromCollection } from "./dist-qMFMMDSO.js";
|
|
5
5
|
import { SmrtJunction, SmrtObject, crossPackageRef, field, foreignKey, smrt } from "@happyvertical/smrt-core";
|
|
6
6
|
//#region ../profiles/dist/chunks/ProfileAssetCollection-CRMcjLJ-.js
|
|
7
7
|
var ProfileAssetCollection_CRMcjLJ__exports = /* @__PURE__ */ __exportAll({
|
|
@@ -84,7 +84,7 @@ var ProfileAssetCollection = class extends SmrtJunction {
|
|
|
84
84
|
profileCollectionPromise = null;
|
|
85
85
|
async getProfileCollection() {
|
|
86
86
|
if (!this.profileCollectionPromise) {
|
|
87
|
-
const { ProfileCollection } = await import("./ProfileCollection-C4INKh7Y-
|
|
87
|
+
const { ProfileCollection } = await import("./ProfileCollection-C4INKh7Y-CWCUc0Hb.js").then((n) => n.o).then((n) => n.r);
|
|
88
88
|
this.profileCollectionPromise = ProfileCollection.create({ db: this.db });
|
|
89
89
|
}
|
|
90
90
|
return this.profileCollectionPromise;
|
package/dist/{ProfileCollection-C4INKh7Y-B5SWDGlm.js → ProfileCollection-C4INKh7Y-CWCUc0Hb.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { d as getTenantId, i as tenantId, m as withSystemContext, n as resolvePrompt, o as queryGlobal, r as TenantScoped, s as queryWithGlobals, t as definePrompt } from "./dist-
|
|
2
|
+
import { d as getTenantId, i as tenantId, m as withSystemContext, n as resolvePrompt, o as queryGlobal, r as TenantScoped, s as queryWithGlobals, t as definePrompt } from "./dist-BVztM_cy.js";
|
|
3
3
|
import { n as __exportAll$1 } from "./NostrIdentity-AC8fAdxe-DKxKyu_a.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-
|
|
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-qMFMMDSO.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
7
|
//#region ../profiles/dist/chunks/ProfileCollection-C4INKh7Y.js
|
|
@@ -435,7 +435,7 @@ var Profile = class extends SmrtObject {
|
|
|
435
435
|
async getTypeSlug() {
|
|
436
436
|
const tenantId2 = this.tenantId || getTenantId();
|
|
437
437
|
if (this.typeId && tenantId2) {
|
|
438
|
-
const { ProfileTypeCollection } = await import("./ProfileTypeCollection-B7kwi1mU-
|
|
438
|
+
const { ProfileTypeCollection } = await import("./ProfileTypeCollection-B7kwi1mU-4EyAFp2c.js").then((n) => n.n).then((n) => n.n);
|
|
439
439
|
return (await (await ProfileTypeCollection.create(this.options)).getAvailableById(this.typeId, tenantId2))?.slug ?? "";
|
|
440
440
|
}
|
|
441
441
|
return (await this.loadRelated("typeId"))?.slug || "";
|
|
@@ -458,8 +458,8 @@ var Profile = class extends SmrtObject {
|
|
|
458
458
|
* @param value - The value to set
|
|
459
459
|
*/
|
|
460
460
|
async addMetadata(metafieldSlug, value) {
|
|
461
|
-
const { ProfileMetafieldCollection } = await import("./ProfileMetafieldCollection-Buz7gzag-
|
|
462
|
-
const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-BIYKy4Y3-
|
|
461
|
+
const { ProfileMetafieldCollection } = await import("./ProfileMetafieldCollection-Buz7gzag-iqEnkSKu.js").then((n) => n.r).then((n) => n.n);
|
|
462
|
+
const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-BIYKy4Y3-CtIYgKhg.js").then((n) => n.r).then((n) => n.n);
|
|
463
463
|
const metafield = await this.resolveMetafield(await ProfileMetafieldCollection.create(this.options), metafieldSlug);
|
|
464
464
|
if (!metafield) throw new Error(`Metafield '${metafieldSlug}' not found`);
|
|
465
465
|
await metafield.validateValue(value);
|
|
@@ -492,7 +492,7 @@ var Profile = class extends SmrtObject {
|
|
|
492
492
|
* @returns Object with metafield slugs as keys
|
|
493
493
|
*/
|
|
494
494
|
async getMetadata() {
|
|
495
|
-
const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-BIYKy4Y3-
|
|
495
|
+
const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-BIYKy4Y3-CtIYgKhg.js").then((n) => n.r).then((n) => n.n);
|
|
496
496
|
return await (await ProfileMetadataCollection.create(this.options)).getMetadataObject(this.id);
|
|
497
497
|
}
|
|
498
498
|
/**
|
|
@@ -509,8 +509,8 @@ var Profile = class extends SmrtObject {
|
|
|
509
509
|
* @param metafieldSlug - The slug of the metafield to remove
|
|
510
510
|
*/
|
|
511
511
|
async removeMetadata(metafieldSlug) {
|
|
512
|
-
const { ProfileMetafieldCollection } = await import("./ProfileMetafieldCollection-Buz7gzag-
|
|
513
|
-
const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-BIYKy4Y3-
|
|
512
|
+
const { ProfileMetafieldCollection } = await import("./ProfileMetafieldCollection-Buz7gzag-iqEnkSKu.js").then((n) => n.r).then((n) => n.n);
|
|
513
|
+
const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-BIYKy4Y3-CtIYgKhg.js").then((n) => n.r).then((n) => n.n);
|
|
514
514
|
const metafield = await this.resolveMetafield(await ProfileMetafieldCollection.create(this.options), metafieldSlug);
|
|
515
515
|
if (!metafield) throw new Error(`Metafield '${metafieldSlug}' not found`);
|
|
516
516
|
const existing = await (await ProfileMetadataCollection.create(this.options)).list({
|
|
@@ -535,7 +535,7 @@ var Profile = class extends SmrtObject {
|
|
|
535
535
|
return candidates.find((candidate) => ownerTenantId && candidate.tenantId === ownerTenantId) ?? candidates.find((candidate) => !candidate.tenantId) ?? null;
|
|
536
536
|
}
|
|
537
537
|
async getProfileLinkCollection() {
|
|
538
|
-
const { ProfileLinkCollection } = await import("./ProfileLinkCollection-DFfZRsgv-
|
|
538
|
+
const { ProfileLinkCollection } = await import("./ProfileLinkCollection-DFfZRsgv-ChNJUwmD.js").then((n) => n.i).then((n) => n.r);
|
|
539
539
|
return ProfileLinkCollection.create({ db: this.db });
|
|
540
540
|
}
|
|
541
541
|
/** This profile's web links in display order. */
|
|
@@ -552,7 +552,7 @@ var Profile = class extends SmrtObject {
|
|
|
552
552
|
return (await this.getProfileLinkCollection()).replaceForProfile(this.id, links);
|
|
553
553
|
}
|
|
554
554
|
async getProfileAssetCollection() {
|
|
555
|
-
const { ProfileAssetCollection } = await import("./ProfileAssetCollection-CRMcjLJ--
|
|
555
|
+
const { ProfileAssetCollection } = await import("./ProfileAssetCollection-CRMcjLJ--C0ZOnhYa.js").then((n) => n.r).then((n) => n.n);
|
|
556
556
|
return ProfileAssetCollection.create({ db: this.db });
|
|
557
557
|
}
|
|
558
558
|
async getAssets(relationship) {
|
|
@@ -584,7 +584,7 @@ var Profile = class extends SmrtObject {
|
|
|
584
584
|
*/
|
|
585
585
|
async addRelationship(toProfile, relationshipSlug, contextProfile) {
|
|
586
586
|
const { ProfileRelationshipTypeCollection } = await import("./ProfileRelationshipTypeCollection-_n22WqTb-DiZUWvev.js").then((n) => n.n).then((n) => n.n);
|
|
587
|
-
const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-C4g_QLI4-
|
|
587
|
+
const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-C4g_QLI4-CZhaklz3.js").then((n) => n.r).then((n) => n.n);
|
|
588
588
|
const { ProfileRelationshipType } = await import("./ProfileRelationshipType-U7IwF6Wf-DNavf24e.js").then((n) => n.n).then((n) => n.n);
|
|
589
589
|
const relationshipType = await (await ProfileRelationshipTypeCollection.create(this.options)).getBySlug(relationshipSlug);
|
|
590
590
|
if (!relationshipType) throw new Error(`Relationship type '${relationshipSlug}' not found`);
|
|
@@ -609,7 +609,7 @@ var Profile = class extends SmrtObject {
|
|
|
609
609
|
* @returns Array of ProfileRelationship instances
|
|
610
610
|
*/
|
|
611
611
|
async getRelationships(options) {
|
|
612
|
-
const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-C4g_QLI4-
|
|
612
|
+
const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-C4g_QLI4-CZhaklz3.js").then((n) => n.r).then((n) => n.n);
|
|
613
613
|
const { ProfileRelationshipTypeCollection } = await import("./ProfileRelationshipTypeCollection-_n22WqTb-DiZUWvev.js").then((n) => n.n).then((n) => n.n);
|
|
614
614
|
const relationshipCollection = await ProfileRelationshipCollection.create(this.options);
|
|
615
615
|
const direction = options?.direction || "all";
|
|
@@ -654,7 +654,7 @@ var Profile = class extends SmrtObject {
|
|
|
654
654
|
*/
|
|
655
655
|
async removeRelationship(toProfile, relationshipSlug) {
|
|
656
656
|
const { ProfileRelationshipTypeCollection } = await import("./ProfileRelationshipTypeCollection-_n22WqTb-DiZUWvev.js").then((n) => n.n).then((n) => n.n);
|
|
657
|
-
const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-C4g_QLI4-
|
|
657
|
+
const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-C4g_QLI4-CZhaklz3.js").then((n) => n.r).then((n) => n.n);
|
|
658
658
|
const relationshipType = await (await ProfileRelationshipTypeCollection.create(this.options)).getBySlug(relationshipSlug);
|
|
659
659
|
if (!relationshipType) throw new Error(`Relationship type '${relationshipSlug}' not found`);
|
|
660
660
|
const relationshipCollection = await ProfileRelationshipCollection.create(this.options);
|
|
@@ -778,7 +778,7 @@ var Profile = class extends SmrtObject {
|
|
|
778
778
|
* @returns Array of OIDC identity records
|
|
779
779
|
*/
|
|
780
780
|
async getOidcIdentities() {
|
|
781
|
-
const { OidcIdentityCollection } = await import("./OidcIdentityCollection-ClOyaHeF-
|
|
781
|
+
const { OidcIdentityCollection } = await import("./OidcIdentityCollection-ClOyaHeF-DgdpVtwP.js").then((n) => n.r).then((n) => n.r);
|
|
782
782
|
return await (await OidcIdentityCollection.create(this.options)).findByProfile(this.id);
|
|
783
783
|
}
|
|
784
784
|
/**
|
|
@@ -791,7 +791,7 @@ var Profile = class extends SmrtObject {
|
|
|
791
791
|
* type, but refuses to create or rebind authority.
|
|
792
792
|
*/
|
|
793
793
|
async linkOidcIdentity(oidcData) {
|
|
794
|
-
const { OidcIdentityCollection } = await import("./OidcIdentityCollection-ClOyaHeF-
|
|
794
|
+
const { OidcIdentityCollection } = await import("./OidcIdentityCollection-ClOyaHeF-DgdpVtwP.js").then((n) => n.r).then((n) => n.r);
|
|
795
795
|
return await (await OidcIdentityCollection.create(this.options)).linkToProfile(this, oidcData);
|
|
796
796
|
}
|
|
797
797
|
/**
|
|
@@ -820,7 +820,7 @@ var Profile = class extends SmrtObject {
|
|
|
820
820
|
* @returns Array of audit log entries
|
|
821
821
|
*/
|
|
822
822
|
async getAuditLogs(limit = 50) {
|
|
823
|
-
const { AuditLogCollection } = await import("./AuditLogCollection-WDHL-_AF-
|
|
823
|
+
const { AuditLogCollection } = await import("./AuditLogCollection-WDHL-_AF-B-Lxv2zK.js").then((n) => n.r).then((n) => n.n);
|
|
824
824
|
return await (await AuditLogCollection.create(this.options)).getRecentActivity(this.id, limit);
|
|
825
825
|
}
|
|
826
826
|
/**
|
|
@@ -830,7 +830,7 @@ var Profile = class extends SmrtObject {
|
|
|
830
830
|
* @returns The created audit log entry
|
|
831
831
|
*/
|
|
832
832
|
async recordAction(options) {
|
|
833
|
-
const { AuditLogCollection } = await import("./AuditLogCollection-WDHL-_AF-
|
|
833
|
+
const { AuditLogCollection } = await import("./AuditLogCollection-WDHL-_AF-B-Lxv2zK.js").then((n) => n.r).then((n) => n.n);
|
|
834
834
|
return await (await AuditLogCollection.create(this.options)).record({
|
|
835
835
|
profile: this,
|
|
836
836
|
...options
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { i as tenantId, r as TenantScoped } from "./dist-
|
|
2
|
+
import { i as tenantId, r as TenantScoped } from "./dist-BVztM_cy.js";
|
|
3
3
|
import { n as __exportAll$1 } from "./NostrIdentity-AC8fAdxe-DKxKyu_a.js";
|
|
4
4
|
import { SmrtCollection, SmrtObject, field, foreignKey, isEmbeddedDatabase, smrt, withEmbeddedWriteTransaction } from "@happyvertical/smrt-core";
|
|
5
5
|
//#region ../profiles/dist/chunks/ProfileLinkCollection-DFfZRsgv.js
|
|
@@ -203,7 +203,7 @@ var ProfileLinkCollection = class ProfileLinkCollection extends SmrtCollection {
|
|
|
203
203
|
/** The profile's tenant; throws when the profile is not visible here. */
|
|
204
204
|
async requireProfileTenant(profileId) {
|
|
205
205
|
if (!profileId) throw new Error("A profile link needs a profile");
|
|
206
|
-
const { ProfileCollection } = await import("./ProfileCollection-C4INKh7Y-
|
|
206
|
+
const { ProfileCollection } = await import("./ProfileCollection-C4INKh7Y-CWCUc0Hb.js").then((n) => n.o).then((n) => n.r);
|
|
207
207
|
const profile = await (await ProfileCollection.create({ db: this.db })).get({ id: profileId });
|
|
208
208
|
if (!profile) throw new Error(`Profile '${profileId}' not found`);
|
|
209
209
|
return profile.tenantId ?? null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { i as tenantId, r as TenantScoped } from "./dist-
|
|
2
|
+
import { i as tenantId, r as TenantScoped } from "./dist-BVztM_cy.js";
|
|
3
3
|
import { n as __exportAll$1 } from "./NostrIdentity-AC8fAdxe-DKxKyu_a.js";
|
|
4
4
|
import { SmrtCollection, SmrtObject, field, foreignKey, smrt } from "@happyvertical/smrt-core";
|
|
5
5
|
//#region ../profiles/dist/chunks/ProfileMetadataCollection-BIYKy4Y3.js
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { i as tenantId, r as TenantScoped } from "./dist-
|
|
2
|
+
import { i as tenantId, r as TenantScoped } from "./dist-BVztM_cy.js";
|
|
3
3
|
import { n as __exportAll$1 } from "./NostrIdentity-AC8fAdxe-DKxKyu_a.js";
|
|
4
4
|
import { SmrtCollection, SmrtObject, field, smrt } from "@happyvertical/smrt-core";
|
|
5
5
|
//#region ../profiles/dist/chunks/ProfileMetafieldCollection-Buz7gzag.js
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { i as tenantId, r as TenantScoped } from "./dist-
|
|
2
|
+
import { i as tenantId, r as TenantScoped } from "./dist-BVztM_cy.js";
|
|
3
3
|
import { n as __exportAll$1 } from "./NostrIdentity-AC8fAdxe-DKxKyu_a.js";
|
|
4
4
|
import { SmrtCollection, SmrtObject, foreignKey, oneToMany, smrt } from "@happyvertical/smrt-core";
|
|
5
5
|
//#region ../profiles/dist/chunks/ProfileRelationshipCollection-C4g_QLI4.js
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { l as withTenantGlobalRead, p as isSystemContext } from "./dist-
|
|
2
|
+
import { l as withTenantGlobalRead, p as isSystemContext } from "./dist-BVztM_cy.js";
|
|
3
3
|
import { n as __exportAll$1 } from "./NostrIdentity-AC8fAdxe-DKxKyu_a.js";
|
|
4
|
-
import { s as ProfileType } from "./ProfileCollection-C4INKh7Y-
|
|
4
|
+
import { s as ProfileType } from "./ProfileCollection-C4INKh7Y-CWCUc0Hb.js";
|
|
5
5
|
import { SmrtCollection } from "@happyvertical/smrt-core";
|
|
6
6
|
//#region ../profiles/dist/chunks/ProfileTypeCollection-B7kwi1mU.js
|
|
7
7
|
var ProfileTypeCollection_B7kwi1mU_exports = /* @__PURE__ */ __exportAll({
|
package/dist/cli-generator.d.ts
CHANGED
|
@@ -196,6 +196,15 @@ export declare class CLIGenerator {
|
|
|
196
196
|
* Handle GET command
|
|
197
197
|
*/
|
|
198
198
|
private handleGet;
|
|
199
|
+
/**
|
|
200
|
+
* Keep only the fields a generated create/update may write, exactly as the
|
|
201
|
+
* REST routes and MCP tools do: never framework/server-managed keys,
|
|
202
|
+
* underscored internals or `readonly` fields, and only `api.writable` when
|
|
203
|
+
* the model declares it. Applies to every input mode (`--from-file`,
|
|
204
|
+
* interactive, flags), so the CLI is not a way around a model's write
|
|
205
|
+
* allowlist.
|
|
206
|
+
*/
|
|
207
|
+
private applyWritablePolicy;
|
|
199
208
|
/**
|
|
200
209
|
* Handle CREATE command
|
|
201
210
|
*/
|
|
@@ -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,YAAY,EACjB,KAAK,UAAU,EAEhB,MAAM,sBAAsB,CAAC;AA6H9B,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,CAAC,EAAE,iBAAiB,CAAC;IACvB;;;;OAIG;IACH,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,IAAI,CAAC,EAAE;QACL,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;KAClB,CAAC;IACF,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AA0BD,MAAM,WAAW,eAAgB,SAAQ,YAAY;IACnD,oEAAoE;IACpE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAMD,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC;IAC1D,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;CAC3C;AAiMD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,IA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,gBAAgB;IAmD9B;;;OAGG;YACW,mBAAmB;IA0CjC;;OAEG;YACW,sBAAsB;IA0UpC;;OAEG;IACG,cAAc,CAClB,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,UAAU,EAAE,EACtB,aAAa,GAAE,MAAM,EAA0B,GAC9C,OAAO,CAAC,IAAI,CAAC;IAsLhB;;OAEG;YACW,cAAc;IAoD5B;;OAEG;IACH,uBAAuB,IAAI,UAAU,EAAE;IAqLvC;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAwB3B;;OAEG;IACG,QAAQ,CAAC,QAAQ,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IA8HrD;;OAEG;IACH,OAAO,CAAC,eAAe;IAiBvB;;OAEG;IACH,OAAO,CAAC,aAAa;IAiCrB;;OAEG;YACW,MAAM;IAcpB;;OAEG;YACW,OAAO;IAKrB;;OAEG;YACW,UAAU;IA4CxB;;OAEG;YACW,SAAS;IAiCvB;;;;;;;OAOG;IACH,OAAO,CAAC,mBAAmB;IA0C3B;;OAEG;YACW,YAAY;IAkD1B;;OAEG;YACW,YAAY;IA8D1B;;OAEG;YACW,YAAY;IAyC1B;;OAEG;YACW,kBAAkB;IA8HhC;;;OAGG;YACW,qBAAqB;IAyOnC;;;OAGG;YACW,aAAa;IA+D3B;;OAEG;YACW,eAAe;IAiC7B;;OAEG;IACH,OAAO,CAAC,eAAe;IAUvB;;OAEG;IACH,OAAO,CAAC,YAAY;IAuBpB;;OAEG;IACH,OAAO,CAAC,YAAY;CAqBrB;AAGD,wBAAsB,IAAI,kBAuGzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db-upgrade-commerce-money.d.ts","sourceRoot":"","sources":["../../src/commands/db-upgrade-commerce-money.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"db-upgrade-commerce-money.d.ts","sourceRoot":"","sources":["../../src/commands/db-upgrade-commerce-money.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAmDtD,2DAA2D;AAC3D,eAAO,MAAM,8BAA8B,mCAAmC,CAAC;AAe/E;;;GAGG;AACH,wBAAsB,+BAA+B,CACnD,EAAE,EAAE,iBAAiB,GACpB,OAAO,CACR,KAAK,CAAC;IACJ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,CAAC,CACH,CAqDA;AA8BD,eAAO,MAAM,6BAA6B,EAAE,UAkG3C,CAAC"}
|
|
@@ -2939,6 +2939,7 @@ var dbUpgradeCommerceMoneyCommand = {
|
|
|
2939
2939
|
if (tenant.componentsWithoutLiabilityAccount.length) console.log(` created tax components without a liability account: ${tenant.componentsWithoutLiabilityAccount.join(", ")}`);
|
|
2940
2940
|
}
|
|
2941
2941
|
for (const failure of result.failures) console.error(`✗ ${failure.tenantId || "(no tenant)"}${failure.documentType ? ` ${failure.documentType} ${failure.documentId}` : ""}: ${failure.reason}`);
|
|
2942
|
+
if (result.billingSchedulesBackfilled) console.log(`\n✓ Set ${result.billingSchedulesBackfilled} contract(s) with a NULL billing schedule to empty.`);
|
|
2942
2943
|
if (result.droppedSchema.length) console.log(`\n✓ Removed earlier-version columns: ${result.droppedSchema.join(", ")}`);
|
|
2943
2944
|
if (result.failures.length || result.remaining.length) {
|
|
2944
2945
|
console.error(`\n❌ ${result.remaining.length} tenant(s) and ${(result.tenantlessDocuments ?? []).length} row(s) without a tenant still need attention.\n`);
|
|
@@ -8403,7 +8404,7 @@ var dbMaterializeTenantHierarchyCommand = {
|
|
|
8403
8404
|
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).");
|
|
8404
8405
|
const dbType = config.database.type || "sqlite";
|
|
8405
8406
|
const { getDatabase } = await import("@happyvertical/sql");
|
|
8406
|
-
const { materializeTenantHierarchy, TenantHierarchyMaterializationError } = await import("./dist-
|
|
8407
|
+
const { materializeTenantHierarchy, TenantHierarchyMaterializationError } = await import("./dist-BM-JGnJr.js");
|
|
8407
8408
|
db = await getDatabase({
|
|
8408
8409
|
type: dbType,
|
|
8409
8410
|
url: config.database.url
|
|
@@ -8612,7 +8613,7 @@ var dbMigrateLedgerAccountsCommand = {
|
|
|
8612
8613
|
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.");
|
|
8613
8614
|
await autoDiscoverAndLoad();
|
|
8614
8615
|
const { getDatabase } = await import("@happyvertical/sql");
|
|
8615
|
-
const { migrateLedgerAccountsTable, planLedgerAccountsTableMove } = await import("./dist-
|
|
8616
|
+
const { migrateLedgerAccountsTable, planLedgerAccountsTableMove } = await import("./dist-BDzUy1ec.js");
|
|
8616
8617
|
db = await getDatabase({
|
|
8617
8618
|
type: dbType,
|
|
8618
8619
|
url: config.database.url
|