@happyvertical/smrt-cli 0.57.13 → 0.57.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/AGENTS.md +2 -3
  2. package/dist/{ApiKey-CVmlf3V6-BAeHuH48.js → ApiKey-CVmlf3V6-CpkKlftW.js} +2 -2
  3. package/dist/{ApiKeyCollection-CiiDNFdD-CMGF3_ul.js → ApiKeyCollection-CiiDNFdD-DGZkMNy8.js} +3 -3
  4. package/dist/{AuditLogCollection-WDHL-_AF-C8L1gl7q.js → AuditLogCollection-WDHL-_AF-CQXj4gM2.js} +3 -3
  5. package/dist/{NostrIdentity-AC8fAdxe-DKxKyu_a.js → NostrIdentity-AC8fAdxe-Crl0np5c.js} +4 -4
  6. package/dist/{NostrIdentityCollection-CctlECpX-fkAPnK02.js → NostrIdentityCollection-CctlECpX-COd5JbK9.js} +2 -2
  7. package/dist/{OidcIdentity-BUblgQLs-C75_f06o.js → OidcIdentity-BUblgQLs-DGHZ4M7i.js} +2 -2
  8. package/dist/{OidcIdentityCollection-ClOyaHeF-CiymEMsR.js → OidcIdentityCollection-ClOyaHeF-B-hGW2Wl.js} +2 -2
  9. package/dist/PasswordCredentialService-CyB9FmYp-Bsni8t37.js +6263 -0
  10. package/dist/{ProfileAssetCollection-CRMcjLJ--_OAFKSvo.js → ProfileAssetCollection-CRMcjLJ--sqYwjhji.js} +5 -5
  11. package/dist/{ProfileCollection-C4INKh7Y-CU227vYB.js → ProfileCollection-C4INKh7Y-Df7XNoF9.js} +28 -28
  12. package/dist/{ProfileLinkCollection-DFfZRsgv-De18fH8M.js → ProfileLinkCollection-DFfZRsgv-B1kKCoxt.js} +4 -4
  13. package/dist/{ProfileMetadataCollection-BIYKy4Y3-B4hKF9kz.js → ProfileMetadataCollection-BIYKy4Y3-DCzYve4J.js} +3 -3
  14. package/dist/{ProfileMetafieldCollection-Buz7gzag-CXMtAfAB.js → ProfileMetafieldCollection-Buz7gzag-Dz6K_9_W.js} +3 -3
  15. package/dist/{ProfileRelationshipCollection-C4g_QLI4-CLezW4sK.js → ProfileRelationshipCollection-C4g_QLI4-C2a5btTC.js} +6 -6
  16. package/dist/{ProfileRelationshipTermCollection-C9J7mC7P-ChIFqjCg.js → ProfileRelationshipTermCollection-C9J7mC7P-B1qRgesq.js} +2 -2
  17. package/dist/{ProfileRelationshipType-U7IwF6Wf-DNavf24e.js → ProfileRelationshipType-U7IwF6Wf--nNtaEKl.js} +1 -1
  18. package/dist/{ProfileRelationshipTypeCollection-_n22WqTb-DiZUWvev.js → ProfileRelationshipTypeCollection-_n22WqTb-CvN_J6A_.js} +3 -3
  19. package/dist/{ProfileTypeCollection-B7kwi1mU-D0bZODrI.js → ProfileTypeCollection-B7kwi1mU-BqrZPPoy.js} +3 -3
  20. package/dist/commands/users-provision-owner.d.ts +10 -0
  21. package/dist/commands/users-provision-owner.d.ts.map +1 -0
  22. package/dist/commands/utilities.d.ts.map +1 -1
  23. package/dist/{commands-BgDKO9Gk.js → commands-H78hZM8r.js} +114 -4
  24. package/dist/{dist-BjVKGAtb.js → dist-3-6I48mI.js} +213 -3591
  25. package/dist/{dist-B0V2uy4g.js → dist-46vxVpSu.js} +3 -3
  26. package/dist/{dist-UirXccvN.js → dist-BnfYk7la.js} +5 -5
  27. package/dist/{dist-CJsW8uvQ.js → dist-D2z9PH4N.js} +2 -2
  28. package/dist/index.js +11 -11
  29. package/dist/{oidcProvisioningPrimitives-DNP9EZlU-PfUi61zh.js → oidcProvisioningPrimitives-DNP9EZlU-CCunrdnL.js} +5 -5
  30. package/dist/operator-A1enN804.js +111 -0
  31. package/dist/{resolveIdentity-CkyqvctR-CxRDO4Kf.js → resolveIdentity-CkyqvctR-y1y-hnjF.js} +17 -17
  32. package/package.json +10 -10
  33. package/dist/dist-DKSFNs8e.js +0 -21
@@ -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-CJsW8uvQ.js";
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-B0V2uy4g.js";
2
+ import { i as tenantId, r as TenantScoped } from "./dist-D2z9PH4N.js";
3
+ import { n as __exportAll$1 } from "./NostrIdentity-AC8fAdxe-Crl0np5c.js";
4
+ import { a as getOwnedAssetsFromCollection, o as removeOwnedAssetFromCollection, t as addOwnedAssetFromCollection } from "./dist-46vxVpSu.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-CU227vYB.js").then((n) => n.o).then((n) => n.r);
87
+ const { ProfileCollection } = await import("./ProfileCollection-C4INKh7Y-Df7XNoF9.js").then((n) => n.r).then((n) => n.r);
88
88
  this.profileCollectionPromise = ProfileCollection.create({ db: this.db });
89
89
  }
90
90
  return this.profileCollectionPromise;
@@ -107,4 +107,4 @@ ProfileAssetCollection = __decorateClass([smrt({
107
107
  cli: false
108
108
  })], ProfileAssetCollection);
109
109
  //#endregion
110
- export { ProfileAssetCollection as n, ProfileAssetCollection_CRMcjLJ__exports as r, ProfileAsset as t };
110
+ export { ProfileAssetCollection_CRMcjLJ__exports as t };
@@ -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-CJsW8uvQ.js";
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-B0V2uy4g.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-D2z9PH4N.js";
3
+ import { n as __exportAll$1 } from "./NostrIdentity-AC8fAdxe-Crl0np5c.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-46vxVpSu.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-D0bZODrI.js").then((n) => n.n).then((n) => n.n);
438
+ const { ProfileTypeCollection } = await import("./ProfileTypeCollection-B7kwi1mU-BqrZPPoy.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-CXMtAfAB.js").then((n) => n.r).then((n) => n.n);
462
- const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-BIYKy4Y3-B4hKF9kz.js").then((n) => n.r).then((n) => n.n);
461
+ const { ProfileMetafieldCollection } = await import("./ProfileMetafieldCollection-Buz7gzag-Dz6K_9_W.js").then((n) => n.t).then((n) => n.n);
462
+ const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-BIYKy4Y3-DCzYve4J.js").then((n) => n.t).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-B4hKF9kz.js").then((n) => n.r).then((n) => n.n);
495
+ const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-BIYKy4Y3-DCzYve4J.js").then((n) => n.t).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-CXMtAfAB.js").then((n) => n.r).then((n) => n.n);
513
- const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-BIYKy4Y3-B4hKF9kz.js").then((n) => n.r).then((n) => n.n);
512
+ const { ProfileMetafieldCollection } = await import("./ProfileMetafieldCollection-Buz7gzag-Dz6K_9_W.js").then((n) => n.t).then((n) => n.n);
513
+ const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-BIYKy4Y3-DCzYve4J.js").then((n) => n.t).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-De18fH8M.js").then((n) => n.i).then((n) => n.r);
538
+ const { ProfileLinkCollection } = await import("./ProfileLinkCollection-DFfZRsgv-B1kKCoxt.js").then((n) => n.t).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--_OAFKSvo.js").then((n) => n.r).then((n) => n.n);
555
+ const { ProfileAssetCollection } = await import("./ProfileAssetCollection-CRMcjLJ--sqYwjhji.js").then((n) => n.t).then((n) => n.n);
556
556
  return ProfileAssetCollection.create({ db: this.db });
557
557
  }
558
558
  async getAssets(relationship) {
@@ -583,9 +583,9 @@ var Profile = class extends SmrtObject {
583
583
  * @param contextProfile - Optional context profile for tertiary relationships
584
584
  */
585
585
  async addRelationship(toProfile, relationshipSlug, contextProfile) {
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-CLezW4sK.js").then((n) => n.r).then((n) => n.n);
588
- const { ProfileRelationshipType } = await import("./ProfileRelationshipType-U7IwF6Wf-DNavf24e.js").then((n) => n.n).then((n) => n.n);
586
+ const { ProfileRelationshipTypeCollection } = await import("./ProfileRelationshipTypeCollection-_n22WqTb-CvN_J6A_.js").then((n) => n.t).then((n) => n.n);
587
+ const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-C4g_QLI4-C2a5btTC.js").then((n) => n.t).then((n) => n.n);
588
+ const { ProfileRelationshipType } = await import("./ProfileRelationshipType-U7IwF6Wf--nNtaEKl.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`);
591
591
  const relationshipCollection = await ProfileRelationshipCollection.create(this.options);
@@ -609,8 +609,8 @@ 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-CLezW4sK.js").then((n) => n.r).then((n) => n.n);
613
- const { ProfileRelationshipTypeCollection } = await import("./ProfileRelationshipTypeCollection-_n22WqTb-DiZUWvev.js").then((n) => n.n).then((n) => n.n);
612
+ const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-C4g_QLI4-C2a5btTC.js").then((n) => n.t).then((n) => n.n);
613
+ const { ProfileRelationshipTypeCollection } = await import("./ProfileRelationshipTypeCollection-_n22WqTb-CvN_J6A_.js").then((n) => n.t).then((n) => n.n);
614
614
  const relationshipCollection = await ProfileRelationshipCollection.create(this.options);
615
615
  const direction = options?.direction || "all";
616
616
  let typeId;
@@ -653,8 +653,8 @@ var Profile = class extends SmrtObject {
653
653
  * @param relationshipSlug - The type of relationship to remove
654
654
  */
655
655
  async removeRelationship(toProfile, relationshipSlug) {
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-CLezW4sK.js").then((n) => n.r).then((n) => n.n);
656
+ const { ProfileRelationshipTypeCollection } = await import("./ProfileRelationshipTypeCollection-_n22WqTb-CvN_J6A_.js").then((n) => n.t).then((n) => n.n);
657
+ const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-C4g_QLI4-C2a5btTC.js").then((n) => n.t).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);
@@ -747,7 +747,7 @@ var Profile = class extends SmrtObject {
747
747
  * @returns Array of API keys
748
748
  */
749
749
  async getApiKeys() {
750
- const { ApiKeyCollection } = await import("./ApiKeyCollection-CiiDNFdD-CMGF3_ul.js").then((n) => n.n).then((n) => n.n);
750
+ const { ApiKeyCollection } = await import("./ApiKeyCollection-CiiDNFdD-DGZkMNy8.js").then((n) => n.t).then((n) => n.n);
751
751
  return await (await ApiKeyCollection.create(this.options)).findByProfile(this.id);
752
752
  }
753
753
  /**
@@ -756,7 +756,7 @@ var Profile = class extends SmrtObject {
756
756
  * @returns Array of active API keys
757
757
  */
758
758
  async getActiveApiKeys() {
759
- const { ApiKeyCollection } = await import("./ApiKeyCollection-CiiDNFdD-CMGF3_ul.js").then((n) => n.n).then((n) => n.n);
759
+ const { ApiKeyCollection } = await import("./ApiKeyCollection-CiiDNFdD-DGZkMNy8.js").then((n) => n.t).then((n) => n.n);
760
760
  return await (await ApiKeyCollection.create(this.options)).findActiveByProfile(this.id);
761
761
  }
762
762
  /**
@@ -766,7 +766,7 @@ var Profile = class extends SmrtObject {
766
766
  * @returns The generated key (plaintext) and ApiKey record
767
767
  */
768
768
  async generateApiKey(options) {
769
- const { ApiKey } = await import("./ApiKey-CVmlf3V6-BAeHuH48.js").then((n) => n.n).then((n) => n.n);
769
+ const { ApiKey } = await import("./ApiKey-CVmlf3V6-CpkKlftW.js").then((n) => n.n).then((n) => n.n);
770
770
  return await ApiKey.generate(this, {
771
771
  ...options,
772
772
  db: this.options?.db
@@ -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-CiymEMsR.js").then((n) => n.r).then((n) => n.r);
781
+ const { OidcIdentityCollection } = await import("./OidcIdentityCollection-ClOyaHeF-B-hGW2Wl.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-CiymEMsR.js").then((n) => n.r).then((n) => n.r);
794
+ const { OidcIdentityCollection } = await import("./OidcIdentityCollection-ClOyaHeF-B-hGW2Wl.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
  /**
@@ -800,7 +800,7 @@ var Profile = class extends SmrtObject {
800
800
  * @returns Array of Nostr identity records
801
801
  */
802
802
  async getNostrIdentities() {
803
- const { NostrIdentityCollection } = await import("./NostrIdentityCollection-CctlECpX-fkAPnK02.js").then((n) => n.n).then((n) => n.n);
803
+ const { NostrIdentityCollection } = await import("./NostrIdentityCollection-CctlECpX-COd5JbK9.js").then((n) => n.t).then((n) => n.n);
804
804
  return await (await NostrIdentityCollection.create(this.options)).findByProfile(this.id);
805
805
  }
806
806
  /**
@@ -810,7 +810,7 @@ var Profile = class extends SmrtObject {
810
810
  * @returns The linked Nostr identity record
811
811
  */
812
812
  async linkNostrIdentity(nostrData) {
813
- const { NostrIdentityCollection } = await import("./NostrIdentityCollection-CctlECpX-fkAPnK02.js").then((n) => n.n).then((n) => n.n);
813
+ const { NostrIdentityCollection } = await import("./NostrIdentityCollection-CctlECpX-COd5JbK9.js").then((n) => n.t).then((n) => n.n);
814
814
  return await (await NostrIdentityCollection.create(this.options)).linkToProfile(this, nostrData);
815
815
  }
816
816
  /**
@@ -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-C8L1gl7q.js").then((n) => n.r).then((n) => n.n);
823
+ const { AuditLogCollection } = await import("./AuditLogCollection-WDHL-_AF-CQXj4gM2.js").then((n) => n.t).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-C8L1gl7q.js").then((n) => n.r).then((n) => n.n);
833
+ const { AuditLogCollection } = await import("./AuditLogCollection-WDHL-_AF-CQXj4gM2.js").then((n) => n.t).then((n) => n.n);
834
834
  return await (await AuditLogCollection.create(this.options)).record({
835
835
  profile: this,
836
836
  ...options
@@ -1194,4 +1194,4 @@ function readRequiredString(row, key) {
1194
1194
  return value;
1195
1195
  }
1196
1196
  //#endregion
1197
- export { ProfileCollection as a, coordinateOidcProvisioning as c, promptMessageOptions as d, saveOidcRaceArbiter as f, Profile as i, isOidcProvisioningRaceConflict as l, OidcProfileEmailReservation as n, ProfileCollection_C4INKh7Y_exports as o, smrtProfilesGenerateBioPrompt as p, OidcProfileEmailReservationCollection as r, ProfileType as s, CanonicalPersonProfileError as t, normalizeIdentityEmail as u };
1197
+ export { coordinateOidcProvisioning as a, saveOidcRaceArbiter as c, ProfileType as i, ProfileCollection as n, isOidcProvisioningRaceConflict as o, ProfileCollection_C4INKh7Y_exports as r, normalizeIdentityEmail as s, Profile as t };
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
- import { i as tenantId, r as TenantScoped } from "./dist-CJsW8uvQ.js";
3
- import { n as __exportAll$1 } from "./NostrIdentity-AC8fAdxe-DKxKyu_a.js";
2
+ import { i as tenantId, r as TenantScoped } from "./dist-D2z9PH4N.js";
3
+ import { n as __exportAll$1 } from "./NostrIdentity-AC8fAdxe-Crl0np5c.js";
4
4
  import { SmrtCollection, SmrtObject, field, foreignKey, isEmbeddedDatabase, smrt, withEmbeddedWriteTransaction } from "@happyvertical/smrt-core";
5
5
  //#region ../profiles/dist/chunks/ProfileLinkCollection-DFfZRsgv.js
6
6
  var ProfileLinkCollection_DFfZRsgv_exports = /* @__PURE__ */ __exportAll({
@@ -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-CU227vYB.js").then((n) => n.o).then((n) => n.r);
206
+ const { ProfileCollection } = await import("./ProfileCollection-C4INKh7Y-Df7XNoF9.js").then((n) => n.r).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;
@@ -238,4 +238,4 @@ function normalizeInputs(links) {
238
238
  return out;
239
239
  }
240
240
  //#endregion
241
- export { isProfileLinkPlatform as a, ProfileLinkCollection_DFfZRsgv_exports as i, ProfileLink as n, normalizeProfileLinkUrl as o, ProfileLinkCollection as r, PROFILE_LINK_PLATFORMS as t };
241
+ export { ProfileLinkCollection_DFfZRsgv_exports as t };
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
- import { i as tenantId, r as TenantScoped } from "./dist-CJsW8uvQ.js";
3
- import { n as __exportAll$1 } from "./NostrIdentity-AC8fAdxe-DKxKyu_a.js";
2
+ import { i as tenantId, r as TenantScoped } from "./dist-D2z9PH4N.js";
3
+ import { n as __exportAll$1 } from "./NostrIdentity-AC8fAdxe-Crl0np5c.js";
4
4
  import { SmrtCollection, SmrtObject, field, foreignKey, smrt } from "@happyvertical/smrt-core";
5
5
  //#region ../profiles/dist/chunks/ProfileMetadataCollection-BIYKy4Y3.js
6
6
  var ProfileMetadataCollection_BIYKy4Y3_exports = /* @__PURE__ */ __exportAll({
@@ -113,4 +113,4 @@ var ProfileMetadataCollection = class extends SmrtCollection {
113
113
  }
114
114
  };
115
115
  //#endregion
116
- export { ProfileMetadataCollection as n, ProfileMetadataCollection_BIYKy4Y3_exports as r, ProfileMetadata as t };
116
+ export { ProfileMetadataCollection_BIYKy4Y3_exports as t };
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
- import { i as tenantId, r as TenantScoped } from "./dist-CJsW8uvQ.js";
3
- import { n as __exportAll$1 } from "./NostrIdentity-AC8fAdxe-DKxKyu_a.js";
2
+ import { i as tenantId, r as TenantScoped } from "./dist-D2z9PH4N.js";
3
+ import { n as __exportAll$1 } from "./NostrIdentity-AC8fAdxe-Crl0np5c.js";
4
4
  import { SmrtCollection, SmrtObject, field, smrt } from "@happyvertical/smrt-core";
5
5
  //#region ../profiles/dist/chunks/ProfileMetafieldCollection-Buz7gzag.js
6
6
  var ProfileMetafieldCollection_Buz7gzag_exports = /* @__PURE__ */ __exportAll({
@@ -150,4 +150,4 @@ var ProfileMetafieldCollection = class extends SmrtCollection {
150
150
  }
151
151
  };
152
152
  //#endregion
153
- export { ProfileMetafieldCollection as n, ProfileMetafieldCollection_Buz7gzag_exports as r, ProfileMetafield as t };
153
+ export { ProfileMetafieldCollection_Buz7gzag_exports as t };
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
- import { i as tenantId, r as TenantScoped } from "./dist-CJsW8uvQ.js";
3
- import { n as __exportAll$1 } from "./NostrIdentity-AC8fAdxe-DKxKyu_a.js";
2
+ import { i as tenantId, r as TenantScoped } from "./dist-D2z9PH4N.js";
3
+ import { n as __exportAll$1 } from "./NostrIdentity-AC8fAdxe-Crl0np5c.js";
4
4
  import { SmrtCollection, SmrtObject, foreignKey, oneToMany, smrt } from "@happyvertical/smrt-core";
5
5
  //#region ../profiles/dist/chunks/ProfileRelationshipCollection-C4g_QLI4.js
6
6
  var ProfileRelationshipCollection_C4g_QLI4_exports = /* @__PURE__ */ __exportAll({
@@ -54,7 +54,7 @@ var ProfileRelationship = class extends SmrtObject {
54
54
  async addTerm(startedAt, endedAt) {
55
55
  if (!this.id) throw new Error("ProfileRelationship.addTerm requires a persisted relationship (missing id)");
56
56
  const relationshipId = this.id;
57
- const { ProfileRelationshipTermCollection } = await import("./ProfileRelationshipTermCollection-C9J7mC7P-ChIFqjCg.js").then((n) => n.r).then((n) => n.n);
57
+ const { ProfileRelationshipTermCollection } = await import("./ProfileRelationshipTermCollection-C9J7mC7P-B1qRgesq.js").then((n) => n.t).then((n) => n.n);
58
58
  await (await (await ProfileRelationshipTermCollection.create(this.options)).create({
59
59
  relationshipId,
60
60
  startedAt,
@@ -76,7 +76,7 @@ var ProfileRelationship = class extends SmrtObject {
76
76
  * @returns Array of ProfileRelationshipTerm instances
77
77
  */
78
78
  async getTerms() {
79
- const { ProfileRelationshipTermCollection } = await import("./ProfileRelationshipTermCollection-C9J7mC7P-ChIFqjCg.js").then((n) => n.r).then((n) => n.n);
79
+ const { ProfileRelationshipTermCollection } = await import("./ProfileRelationshipTermCollection-C9J7mC7P-B1qRgesq.js").then((n) => n.t).then((n) => n.n);
80
80
  return await (await ProfileRelationshipTermCollection.create(this.options)).getByRelationship(this.id);
81
81
  }
82
82
  /**
@@ -85,7 +85,7 @@ var ProfileRelationship = class extends SmrtObject {
85
85
  * @returns Current term or null if none active
86
86
  */
87
87
  async getActiveTerm() {
88
- const { ProfileRelationshipTermCollection } = await import("./ProfileRelationshipTermCollection-C9J7mC7P-ChIFqjCg.js").then((n) => n.r).then((n) => n.n);
88
+ const { ProfileRelationshipTermCollection } = await import("./ProfileRelationshipTermCollection-C9J7mC7P-B1qRgesq.js").then((n) => n.t).then((n) => n.n);
89
89
  return await (await ProfileRelationshipTermCollection.create(this.options)).getActiveTerm(this.id);
90
90
  }
91
91
  };
@@ -166,4 +166,4 @@ var ProfileRelationshipCollection = class extends SmrtCollection {
166
166
  }
167
167
  };
168
168
  //#endregion
169
- export { ProfileRelationshipCollection as n, ProfileRelationshipCollection_C4g_QLI4_exports as r, ProfileRelationship as t };
169
+ export { ProfileRelationshipCollection_C4g_QLI4_exports as t };
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
- import { n as __exportAll$1 } from "./NostrIdentity-AC8fAdxe-DKxKyu_a.js";
2
+ import { n as __exportAll$1 } from "./NostrIdentity-AC8fAdxe-Crl0np5c.js";
3
3
  import { SmrtCollection, SmrtObject, field, foreignKey, smrt } from "@happyvertical/smrt-core";
4
4
  //#region ../profiles/dist/chunks/ProfileRelationshipTermCollection-C9J7mC7P.js
5
5
  var ProfileRelationshipTermCollection_C9J7mC7P_exports = /* @__PURE__ */ __exportAll({
@@ -112,4 +112,4 @@ var ProfileRelationshipTermCollection = class extends SmrtCollection {
112
112
  }
113
113
  };
114
114
  //#endregion
115
- export { ProfileRelationshipTermCollection as n, ProfileRelationshipTermCollection_C9J7mC7P_exports as r, ProfileRelationshipTerm as t };
115
+ export { ProfileRelationshipTermCollection_C9J7mC7P_exports as t };
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
- import { n as __exportAll$1 } from "./NostrIdentity-AC8fAdxe-DKxKyu_a.js";
2
+ import { n as __exportAll$1 } from "./NostrIdentity-AC8fAdxe-Crl0np5c.js";
3
3
  import { SmrtObject, field, smrt } from "@happyvertical/smrt-core";
4
4
  //#region ../profiles/dist/chunks/ProfileRelationshipType-U7IwF6Wf.js
5
5
  var ProfileRelationshipType_U7IwF6Wf_exports = /* @__PURE__ */ __exportAll({
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
- import { n as __exportAll$1 } from "./NostrIdentity-AC8fAdxe-DKxKyu_a.js";
3
- import { t as ProfileRelationshipType } from "./ProfileRelationshipType-U7IwF6Wf-DNavf24e.js";
2
+ import { n as __exportAll$1 } from "./NostrIdentity-AC8fAdxe-Crl0np5c.js";
3
+ import { t as ProfileRelationshipType } from "./ProfileRelationshipType-U7IwF6Wf--nNtaEKl.js";
4
4
  import { SmrtCollection } from "@happyvertical/smrt-core";
5
5
  //#region ../profiles/dist/chunks/ProfileRelationshipTypeCollection-_n22WqTb.js
6
6
  var ProfileRelationshipTypeCollection__n22WqTb_exports = /* @__PURE__ */ __exportAll({
@@ -54,4 +54,4 @@ var ProfileRelationshipTypeCollection = class extends SmrtCollection {
54
54
  }
55
55
  };
56
56
  //#endregion
57
- export { ProfileRelationshipTypeCollection__n22WqTb_exports as n, ProfileRelationshipTypeCollection as t };
57
+ export { ProfileRelationshipTypeCollection__n22WqTb_exports as t };
@@ -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-CJsW8uvQ.js";
3
- import { n as __exportAll$1 } from "./NostrIdentity-AC8fAdxe-DKxKyu_a.js";
4
- import { s as ProfileType } from "./ProfileCollection-C4INKh7Y-CU227vYB.js";
2
+ import { l as withTenantGlobalRead, p as isSystemContext } from "./dist-D2z9PH4N.js";
3
+ import { n as __exportAll$1 } from "./NostrIdentity-AC8fAdxe-Crl0np5c.js";
4
+ import { i as ProfileType } from "./ProfileCollection-C4INKh7Y-Df7XNoF9.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({
@@ -0,0 +1,10 @@
1
+ import type { Readable } from 'node:stream';
2
+ import type { CLICommand } from '../cli-generator.js';
3
+ /** Read one UTF-8 password, allowing one conventional final newline. */
4
+ export declare function readOperatorPassword(stream: Readable): Promise<string>;
5
+ /**
6
+ * Deliberate operator command, never generated from a decorated model. It has
7
+ * no password argument or environment-variable fallback.
8
+ */
9
+ export declare const usersProvisionOwnerCommand: CLICommand;
10
+ //# sourceMappingURL=users-provision-owner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"users-provision-owner.d.ts","sourceRoot":"","sources":["../../src/commands/users-provision-owner.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAOtD,wEAAwE;AACxE,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAc5E;AAED;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAE,UAsFxC,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;AAsJtD,wBAAgB,uBAAuB,CAAC,OAAO,SAAgB,GAAG,MAAM,CAIvE;AA4LD,MAAM,WAAW,uBAAuB;IACtC,KAAK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B;AA2BD,yDAAyD;AACzD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,YAAY,GAAG,aAAa,GAAG,UAAU,CAAC;IAChD,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,uEAAuE;AACvE,MAAM,WAAW,kBAAkB;IACjC,wEAAwE;IACxE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,iBAAiB,EAAE,CAAC;IAChC,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,SAAS,EAAE,iBAAiB,EAAE,CAAC;IAC/B,8DAA8D;IAC9D,SAAS,EAAE,KAAK,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC1D;;;;;;;;;;;;;;;;;OAiBG;IACH,kBAAkB,EAAE,KAAK,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACpE;AA4CD;;;;;;;;;;;GAWG;AACH,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAsDzC;AAgBD,mEAAmE;AACnE,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,kBAAkB,GAAG,SAAS,GACrC,MAAM,EAAE,CAoCV;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CA+iGtD,CAAC"}
@@ -5,7 +5,7 @@ import { t as DEFAULT_CLI_CONFIG } from "./config-CdJRSMRi.js";
5
5
  import { addMcpAppsRuntime, assertMcpAppsPluginName, configureMcpAppsConsumerRegistry, mcpAppsCommands, scaffoldMcpAppsPackage, validateMcpAppsPackage } from "./mcp-apps-packaging-CixRnxz_.js";
6
6
  import { createRequire } from "node:module";
7
7
  import * as fs from "node:fs";
8
- import { createReadStream, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
8
+ import { constants, createReadStream, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
9
9
  import * as path from "node:path";
10
10
  import { basename, dirname, extname, isAbsolute, join, normalize, relative, resolve, sep } from "node:path";
11
11
  import { fileURLToPath, pathToFileURL } from "node:url";
@@ -15,7 +15,7 @@ import { execFile, execFileSync, execSync, spawn, spawnSync } from "node:child_p
15
15
  import { homedir, tmpdir } from "node:os";
16
16
  import { createHash, randomBytes, timingSafeEqual } from "node:crypto";
17
17
  import { extract } from "tar";
18
- import { access, cp, mkdir, readFile, rm, writeFile } from "node:fs/promises";
18
+ import { access, cp, mkdir, open, readFile, rm, writeFile } from "node:fs/promises";
19
19
  import { createLogger } from "@happyvertical/logger";
20
20
  import glob from "fast-glob";
21
21
  import { getPackageConfig, loadConfig, toAIClientOptions, tryResolveConfiguredAIProvider } from "@happyvertical/smrt-config";
@@ -8404,7 +8404,7 @@ var dbMaterializeTenantHierarchyCommand = {
8404
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).");
8405
8405
  const dbType = config.database.type || "sqlite";
8406
8406
  const { getDatabase } = await import("@happyvertical/sql");
8407
- const { materializeTenantHierarchy, TenantHierarchyMaterializationError } = await import("./dist-BjVKGAtb.js");
8407
+ const { materializeTenantHierarchy, TenantHierarchyMaterializationError } = await import("./dist-3-6I48mI.js");
8408
8408
  db = await getDatabase({
8409
8409
  type: dbType,
8410
8410
  url: config.database.url
@@ -8613,7 +8613,7 @@ var dbMigrateLedgerAccountsCommand = {
8613
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.");
8614
8614
  await autoDiscoverAndLoad();
8615
8615
  const { getDatabase } = await import("@happyvertical/sql");
8616
- const { migrateLedgerAccountsTable, planLedgerAccountsTableMove } = await import("./dist-UirXccvN.js");
8616
+ const { migrateLedgerAccountsTable, planLedgerAccountsTableMove } = await import("./dist-BnfYk7la.js");
8617
8617
  db = await getDatabase({
8618
8618
  type: dbType,
8619
8619
  url: config.database.url
@@ -10680,6 +10680,115 @@ async function repairStiDiscriminatorRows(options) {
10680
10680
  return result;
10681
10681
  }
10682
10682
  //#endregion
10683
+ //#region src/commands/users-provision-owner.ts
10684
+ var FAILURE = "Owner provisioning refused. Check the operator input and private database configuration.";
10685
+ var MAX_SECRET_BYTES = 4096;
10686
+ /** Read one UTF-8 password, allowing one conventional final newline. */
10687
+ async function readOperatorPassword(stream) {
10688
+ const chunks = [];
10689
+ let size = 0;
10690
+ for await (const chunk of stream) {
10691
+ const bytes = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
10692
+ size += bytes.length;
10693
+ if (size > MAX_SECRET_BYTES) throw new Error(FAILURE);
10694
+ chunks.push(bytes);
10695
+ }
10696
+ const password = new TextDecoder("utf-8", { fatal: true }).decode(Buffer.concat(chunks)).replace(/\r?\n$/, "");
10697
+ if (!password || /[\r\n\0]/.test(password)) throw new Error(FAILURE);
10698
+ return password;
10699
+ }
10700
+ /**
10701
+ * Deliberate operator command, never generated from a decorated model. It has
10702
+ * no password argument or environment-variable fallback.
10703
+ */
10704
+ var usersProvisionOwnerCommand = {
10705
+ name: "users:provision-owner",
10706
+ description: "Provision a PostgreSQL deployment owner using a private file or stdin.",
10707
+ args: [],
10708
+ options: {
10709
+ "tenant-id": {
10710
+ type: "string",
10711
+ description: "Stable tenant UUID."
10712
+ },
10713
+ "tenant-name": {
10714
+ type: "string",
10715
+ description: "Exact tenant display name."
10716
+ },
10717
+ "user-id": {
10718
+ type: "string",
10719
+ description: "Stable owner User UUID."
10720
+ },
10721
+ email: {
10722
+ type: "string",
10723
+ description: "Owner email identity."
10724
+ },
10725
+ username: {
10726
+ type: "string",
10727
+ description: "Owner username identity."
10728
+ },
10729
+ "password-file": {
10730
+ type: "string",
10731
+ description: "Private password file (0400/0600)."
10732
+ },
10733
+ "password-stdin": {
10734
+ type: "boolean",
10735
+ description: "Read password from redirected stdin."
10736
+ }
10737
+ },
10738
+ handler: async (args, options) => {
10739
+ let db;
10740
+ try {
10741
+ const allowed = new Set(Object.keys(usersProvisionOwnerCommand.options ?? {}));
10742
+ if (args.length || Object.keys(options).some((key) => !allowed.has(key))) throw new Error(FAILURE);
10743
+ const file = options["password-file"];
10744
+ const stdin = options["password-stdin"] === true;
10745
+ if ((typeof file === "string" && !!file) === stdin || !file && !stdin) throw new Error(FAILURE);
10746
+ let password;
10747
+ if (stdin) {
10748
+ if (process.stdin.isTTY) throw new Error(FAILURE);
10749
+ password = await readOperatorPassword(process.stdin);
10750
+ } else {
10751
+ if (typeof file !== "string") throw new Error(FAILURE);
10752
+ const handle = await open(file, constants.O_RDONLY | constants.O_NOFOLLOW);
10753
+ try {
10754
+ const stat = await handle.stat();
10755
+ if (!stat.isFile() || (stat.mode & 63) !== 0 || stat.size > MAX_SECRET_BYTES) throw new Error(FAILURE);
10756
+ password = await readOperatorPassword(createReadStream("", {
10757
+ fd: handle.fd,
10758
+ autoClose: false
10759
+ }));
10760
+ } finally {
10761
+ await handle.close();
10762
+ }
10763
+ }
10764
+ const { getPackageConfig } = await import("@happyvertical/smrt-config");
10765
+ const { DEFAULT_CLI_CONFIG } = await import("./config-CdJRSMRi.js").then((n) => n.n);
10766
+ const config = getPackageConfig("cli", DEFAULT_CLI_CONFIG);
10767
+ if (config.database?.type !== "postgres" || !config.database.url) throw new Error(FAILURE);
10768
+ const { getDatabase } = await import("@happyvertical/sql");
10769
+ const { provisionPasswordOwner } = await import("./operator-A1enN804.js");
10770
+ db = await getDatabase({
10771
+ type: "postgres",
10772
+ url: config.database.url
10773
+ });
10774
+ const result = await provisionPasswordOwner(db, {
10775
+ tenantId: options["tenant-id"],
10776
+ tenantName: options["tenant-name"],
10777
+ userId: options["user-id"],
10778
+ email: options.email,
10779
+ username: options.username,
10780
+ password
10781
+ });
10782
+ console.log(`Owner provisioning ${result.status}.`);
10783
+ } catch {
10784
+ console.error(FAILURE);
10785
+ process.exitCode = 1;
10786
+ } finally {
10787
+ await closeDatabaseConnection(db);
10788
+ }
10789
+ }
10790
+ };
10791
+ //#endregion
10683
10792
  //#region src/commands/utilities.ts
10684
10793
  /**
10685
10794
  * Utility CLI Commands
@@ -12591,6 +12700,7 @@ export default testManifest;
12591
12700
  "db:upgrade-commerce-money": dbUpgradeCommerceMoneyCommand,
12592
12701
  "db:migrate-qualified-names": dbMigrateQualifiedNamesCommand,
12593
12702
  "db:materialize-tenant-hierarchy": dbMaterializeTenantHierarchyCommand,
12703
+ "users:provision-owner": usersProvisionOwnerCommand,
12594
12704
  "db:drop-framework-base-tables": dbDropFrameworkBaseTablesCommand,
12595
12705
  "db:orphans": dbOrphansCommand,
12596
12706
  "db:prune": dbPruneCommand,