@happyvertical/smrt-cli 0.56.2 → 0.57.1
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 -1
- package/agents/commerce-money-upgrade.md +49 -0
- package/dist/{AuditLogCollection-WDHL-_AF-PMKF1FIA.js → AuditLogCollection-WDHL-_AF-BLRue0-Z.js} +1 -1
- package/dist/{OidcIdentity-BUblgQLs-C2jGl4xb.js → OidcIdentity-BUblgQLs-DQzfrrkW.js} +2 -2
- package/dist/{OidcIdentityCollection-ClOyaHeF-CRqOi6OR.js → OidcIdentityCollection-ClOyaHeF-BA4QgOyy.js} +1 -1
- package/dist/{ProfileAssetCollection-CRMcjLJ--D0B9tdFm.js → ProfileAssetCollection-CRMcjLJ--BxEDTPbM.js} +3 -3
- package/dist/{ProfileCollection-C4INKh7Y-EfdCjHJy.js → ProfileCollection-C4INKh7Y-C28k9KAj.js} +17 -17
- package/dist/{ProfileLinkCollection-DFfZRsgv-Do3CZRe8.js → ProfileLinkCollection-DFfZRsgv-B4oOqnC5.js} +2 -2
- package/dist/{ProfileMetadataCollection-BIYKy4Y3-D_5z9xC7.js → ProfileMetadataCollection-BIYKy4Y3-D07YJojE.js} +1 -1
- package/dist/{ProfileMetafieldCollection-Buz7gzag-BBp96ZxU.js → ProfileMetafieldCollection-Buz7gzag-1uok776P.js} +1 -1
- package/dist/{ProfileRelationshipCollection-C4g_QLI4-DdNSbq9T.js → ProfileRelationshipCollection-C4g_QLI4-CzNBurq5.js} +1 -1
- package/dist/{ProfileTypeCollection-B7kwi1mU-7uzgnnJA.js → ProfileTypeCollection-B7kwi1mU-JJeGJVd9.js} +2 -2
- package/dist/commands/db-status.d.ts.map +1 -1
- package/dist/commands/db-upgrade-commerce-money.d.ts +23 -0
- package/dist/commands/db-upgrade-commerce-money.d.ts.map +1 -0
- package/dist/commands/utilities.d.ts.map +1 -1
- package/dist/{commands-DQMwpnIx.js → commands-DkW9egBl.js} +215 -247
- package/dist/{dist-Clv0HeDN.js → dist-ByE1kAL-.js} +3 -3
- package/dist/{dist-UCD6F1L5.js → dist-C7z_OoIl.js} +4 -4
- package/dist/{dist-D8ESE6vP.js → dist-CvOObIMo.js} +16 -16
- package/dist/dist-TzhaT84W.js +21 -0
- package/dist/{dist-DHxqJOJ1.js → dist-mVN37-aQ.js} +2 -2
- package/dist/index.js +11 -11
- package/dist/loaders/git-loader.d.ts.map +1 -1
- package/dist/{oidcProvisioningPrimitives-DNP9EZlU-B_amql6n.js → oidcProvisioningPrimitives-DNP9EZlU-DrF67XCR.js} +3 -3
- package/dist/{resolveIdentity-CkyqvctR-DvYT2fSs.js → resolveIdentity-CkyqvctR-rQR3kTaK.js} +14 -14
- package/package.json +10 -10
- package/agents/commerce-money-migration.md +0 -48
- package/dist/commands/db-commerce-money.d.ts +0 -5
- package/dist/commands/db-commerce-money.d.ts.map +0 -1
- package/dist/dist-D1ZvOIhb.js +0 -21
package/AGENTS.md
CHANGED
|
@@ -19,7 +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:
|
|
22
|
+
smrt db:upgrade-commerce-money # agents/commerce-money-upgrade.md
|
|
23
23
|
smrt db:migrate-qualified-names [--dry-run] # Opt-in old→current name backfill; doctor --db counts (../core/agents/model-moves.md)
|
|
24
24
|
smrt db:materialize-tenant-hierarchy [--dry-run] # smrt-users tenant hierarchy_path backfill (#3036)
|
|
25
25
|
smrt db:drop-framework-base-tables # One-time drop of the five #2644-orphaned framework-base tables
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Commerce money upgrade command
|
|
2
|
+
|
|
3
|
+
Commerce has one money model. It refuses money data written by an earlier
|
|
4
|
+
version with `COMMERCE_DATA_NEEDS_UPGRADE` instead of reading it. Four shapes
|
|
5
|
+
count as old data:
|
|
6
|
+
|
|
7
|
+
- The schema still has the earlier version's money columns
|
|
8
|
+
(`tax_settings.money_model`, `*_line_items.legacy_amount`) or the
|
|
9
|
+
`commerce_money_migration_documents` table.
|
|
10
|
+
- An invoice or contract row has no tenant. The upgrade lists each one; assign
|
|
11
|
+
it to a tenant or delete it, then rerun.
|
|
12
|
+
- A tenant has invoices or contracts but no tax settings row.
|
|
13
|
+
- A tenant has an issued document without a money snapshot, or a line with
|
|
14
|
+
neither a tax code nor a component snapshot (found even after
|
|
15
|
+
`db:migrate --drop-columns`).
|
|
16
|
+
|
|
17
|
+
`smrt db:status` reports this as the `commerce-money-upgrade` error
|
|
18
|
+
precondition, so `smrt app doctor` reports `migration-required`.
|
|
19
|
+
|
|
20
|
+
Run the normal schema migration first, then upgrade once:
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
smrt db:upgrade-commerce-money --check # report only, no writes
|
|
24
|
+
smrt db:upgrade-commerce-money # every tenant
|
|
25
|
+
smrt db:upgrade-commerce-money --tenant-id <id> # one tenant
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
What happens to each tenant:
|
|
29
|
+
|
|
30
|
+
- It converts in its own transaction.
|
|
31
|
+
- Its tax settings and standard codes are seeded.
|
|
32
|
+
- Each stored line rate becomes a tax code: `exempt` or `out-of-scope` for a
|
|
33
|
+
zero rate, otherwise a `rate-<percent>` code.
|
|
34
|
+
- Issued documents are backfilled from their stored values, and no stored
|
|
35
|
+
total changes.
|
|
36
|
+
- Drafts are recomputed, and the command prints every draft whose total
|
|
37
|
+
changed.
|
|
38
|
+
|
|
39
|
+
The command is strict. An issued document whose stored lines do not add up
|
|
40
|
+
exactly to its stored header fails its whole tenant: nothing in that tenant
|
|
41
|
+
changes, and the command lists each failing document. So do an invalid
|
|
42
|
+
stored rate, an invoice posted under the earlier version (void its journal and
|
|
43
|
+
clear the link, or reset the data), and an existing `rate-<percent>` code that
|
|
44
|
+
means a different rate. Fix or reset that data and rerun; converted tenants are skipped.
|
|
45
|
+
Once no tenant needs the upgrade, the earlier version's columns and table are
|
|
46
|
+
dropped. The command exits nonzero while any tenant still needs it.
|
|
47
|
+
|
|
48
|
+
New rate components have no tax liability account, and the command lists
|
|
49
|
+
them. Posting falls back to `taxAccountId` until you assign one.
|
package/dist/{AuditLogCollection-WDHL-_AF-PMKF1FIA.js → AuditLogCollection-WDHL-_AF-BLRue0-Z.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-mVN37-aQ.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-BA4QgOyy.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-rQR3kTaK.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-DQzfrrkW.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-mVN37-aQ.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-ByE1kAL-.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-C28k9KAj.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-EfdCjHJy.js → ProfileCollection-C4INKh7Y-C28k9KAj.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { a as queryGlobal, f as withSystemContext, i as tenantId, n as resolvePrompt, o as queryWithGlobals, r as TenantScoped, t as definePrompt, u as getTenantId } from "./dist-
|
|
2
|
+
import { a as queryGlobal, f as withSystemContext, i as tenantId, n as resolvePrompt, o as queryWithGlobals, r as TenantScoped, t as definePrompt, u as getTenantId } from "./dist-mVN37-aQ.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-ByE1kAL-.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-JJeGJVd9.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-1uok776P.js").then((n) => n.r).then((n) => n.n);
|
|
462
|
+
const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-BIYKy4Y3-D07YJojE.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-D07YJojE.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-1uok776P.js").then((n) => n.r).then((n) => n.n);
|
|
513
|
+
const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-BIYKy4Y3-D07YJojE.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-B4oOqnC5.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--BxEDTPbM.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-CzNBurq5.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-CzNBurq5.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-CzNBurq5.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-BA4QgOyy.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-BA4QgOyy.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-BLRue0-Z.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-BLRue0-Z.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-mVN37-aQ.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-C28k9KAj.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-mVN37-aQ.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-mVN37-aQ.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-mVN37-aQ.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 { c as withTenantGlobalRead, d as isSystemContext } from "./dist-
|
|
2
|
+
import { c as withTenantGlobalRead, d as isSystemContext } from "./dist-mVN37-aQ.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-C28k9KAj.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({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db-status.d.ts","sourceRoot":"","sources":["../../src/commands/db-status.ts"],"names":[],"mappings":"AAAA;;;;;;;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AO,MAAM,eAAe,EAAE,UA+e7B,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `smrt db:upgrade-commerce-money` and the matching `db:status` precondition
|
|
3
|
+
* (#4021). Commerce refuses money data written by an earlier version with
|
|
4
|
+
* `COMMERCE_DATA_NEEDS_UPGRADE`; this command converts it once. Delete this
|
|
5
|
+
* module with commerce's `upgrade/` directory.
|
|
6
|
+
*/
|
|
7
|
+
import type { DatabaseInterface } from '@happyvertical/sql';
|
|
8
|
+
import type { CLICommand } from '../cli-generator.js';
|
|
9
|
+
/** The upgrade command, as named in commerce's refusal. */
|
|
10
|
+
export declare const COMMERCE_MONEY_UPGRADE_COMMAND = "smrt db:upgrade-commerce-money";
|
|
11
|
+
/**
|
|
12
|
+
* `db:status` precondition: an error when the database holds commerce money
|
|
13
|
+
* data from an earlier version. Empty when commerce is not installed.
|
|
14
|
+
*/
|
|
15
|
+
export declare function checkCommerceMoneyPreconditions(db: DatabaseInterface): Promise<Array<{
|
|
16
|
+
name: string;
|
|
17
|
+
status: 'warning' | 'error';
|
|
18
|
+
message: string;
|
|
19
|
+
recommendation: string;
|
|
20
|
+
details: Record<string, unknown>;
|
|
21
|
+
}>>;
|
|
22
|
+
export declare const dbUpgradeCommerceMoneyCommand: CLICommand;
|
|
23
|
+
//# sourceMappingURL=db-upgrade-commerce-money.d.ts.map
|
|
@@ -0,0 +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;AAkDtD,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,UA8F3C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../src/commands/utilities.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAwBH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../src/commands/utilities.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAwBH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAsJtD,wBAAgB,uBAAuB,CAAC,OAAO,SAAgB,GAAG,MAAM,CAIvE;AA4LD,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,OAAO,CAAC;IACf,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED;;;;GAIG;AACH,OAAO,EAAE,iCAAiC,EAAE,MAAM,mCAAmC,CAAC;AAEtF;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,OAAO,GAAG,SAAS,EAC1B,KAAK,EAAE,OAAO,GACb,uBAAuB,CA2DzB;AAED,wBAAgB,gCAAgC,CAC9C,eAAe,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EAC9C,qBAAqB,EAAE,QAAQ,CAAC,MAAM,CAAC,GACtC,IAAI,CAcN;AAED;;;GAGG;AACH,UAAU,iBAAiB;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAA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