@happyvertical/smrt-cli 0.51.16 → 0.51.18
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/dist/{ApiKey-BZmbOTnL-Dz-PO2sa.js → ApiKey-BZmbOTnL-DTI3K-Tn.js} +2 -2
- package/dist/ApiKeyCollection-Bfb_nw81-CdlZMFSc.js +2 -0
- package/dist/AuditLogCollection-B1YonCAP-B0Vy3Z6u.js +2 -0
- package/dist/{NostrIdentity-n70E0vck-CZwoR7Rs.js → NostrIdentity-n70E0vck-D9-IziHy.js} +3 -3
- package/dist/NostrIdentityCollection-Ca74dkaL-BRbwnyDi.js +2 -0
- package/dist/{OidcIdentity-CChQnYNH-DV9jiJ5r.js → OidcIdentity-CChQnYNH-WJBbpWM6.js} +2 -2
- package/dist/OidcIdentityCollection-D3L0WYbM-DDtBvtoJ.js +2 -0
- package/dist/ProfileAssetCollection-V8u4wqSL-Cf_IQvNf.js +2 -0
- package/dist/{ProfileCollection-BvhD2cfL-CT6ctQ3l.js → ProfileCollection-BvhD2cfL-RFUmqnp4.js} +26 -26
- package/dist/ProfileMetadataCollection-DxX_BJKV-Bz7i-WYc.js +2 -0
- package/dist/{ProfileMetafieldCollection-CMKhVi2I--ba-T4qA.js → ProfileMetafieldCollection-CMKhVi2I-kLBafM_b.js} +1 -1
- package/dist/{ProfileRelationshipCollection-DUVgaIqf-B4TDc4TQ.js → ProfileRelationshipCollection-DUVgaIqf-DtSkUi1A.js} +1 -1
- package/dist/{ProfileRelationshipTermCollection-DtA9OM23-1ZkGUm00.js → ProfileRelationshipTermCollection-DtA9OM23-B60GxJ_C.js} +1 -1
- package/dist/{ProfileRelationshipType-BRiRka6t-Dw1efEX5.js → ProfileRelationshipType-BRiRka6t-BYrzAnkn.js} +1 -1
- package/dist/{ProfileRelationshipTypeCollection-BdXwd7Kf-GEu0alx6.js → ProfileRelationshipTypeCollection-BdXwd7Kf-DnpByZIo.js} +1 -1
- package/dist/{commands-CL85adn5.js → commands-CTBNyazy.js} +2 -2
- package/dist/{dist-9EA_5mOX.js → dist-BFQchr0-.js} +1 -1
- package/dist/{dist-BIA7A6wF.js → dist-CZWupza5.js} +25 -25
- package/dist/{dist-mLcl4Ttr.js → dist-gOKwtnKm.js} +3 -3
- package/dist/index.js +9 -9
- package/dist/{oidcProvisioningPrimitives-CjOkg3Zd-DhC5lyKE.js → oidcProvisioningPrimitives-CjOkg3Zd-2I44RLHf.js} +4 -4
- package/dist/resolveIdentity-73HQnTlT-SzLUTou1.js +2 -0
- package/package.json +8 -8
- package/dist/ApiKeyCollection-Bfb_nw81-Dks_0546.js +0 -2
- package/dist/AuditLogCollection-B1YonCAP-Db9tLDtf.js +0 -2
- package/dist/NostrIdentityCollection-Ca74dkaL-DESXyrjY.js +0 -2
- package/dist/OidcIdentityCollection-D3L0WYbM-C85jz9CB.js +0 -2
- package/dist/ProfileAssetCollection-V8u4wqSL-BKz6v8py.js +0 -2
- package/dist/ProfileMetadataCollection-DxX_BJKV-StatXt-E.js +0 -2
- package/dist/resolveIdentity-73HQnTlT-DQB4z5h5.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { n as __exportAll$1 } from "./NostrIdentity-n70E0vck-
|
|
2
|
+
import { n as __exportAll$1 } from "./NostrIdentity-n70E0vck-D9-IziHy.js";
|
|
3
3
|
import { SmrtObject, field, foreignKey, smrt } from "@happyvertical/smrt-core";
|
|
4
4
|
import { createHash, randomBytes } from "node:crypto";
|
|
5
5
|
//#region ../profiles/dist/chunks/ApiKey-BZmbOTnL.js
|
|
@@ -127,7 +127,7 @@ var ApiKey = class extends SmrtObject {
|
|
|
127
127
|
*/
|
|
128
128
|
static async verify(key, options = {}) {
|
|
129
129
|
const keyHash = ApiKey.hashKey(key);
|
|
130
|
-
const { ApiKeyCollection } = await import("./ApiKeyCollection-Bfb_nw81-
|
|
130
|
+
const { ApiKeyCollection } = await import("./ApiKeyCollection-Bfb_nw81-CdlZMFSc.js").then((n) => n.n);
|
|
131
131
|
const apiKey = await (await ApiKeyCollection.create(options)).findOne({ where: { keyHash } });
|
|
132
132
|
if (!apiKey) return null;
|
|
133
133
|
if (!apiKey.isValid()) return null;
|
|
@@ -4097,21 +4097,21 @@ var NostrIdentity = class extends SmrtObject {
|
|
|
4097
4097
|
* Find identity by public key
|
|
4098
4098
|
*/
|
|
4099
4099
|
static async findByPubkey(pubkey, options = {}) {
|
|
4100
|
-
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-Ca74dkaL-
|
|
4100
|
+
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-Ca74dkaL-BRbwnyDi.js").then((n) => n.n);
|
|
4101
4101
|
return await (await NostrIdentityCollection.create(options)).findOne({ where: { pubkey } });
|
|
4102
4102
|
}
|
|
4103
4103
|
/**
|
|
4104
4104
|
* Find identity by email
|
|
4105
4105
|
*/
|
|
4106
4106
|
static async findByEmail(email, options = {}) {
|
|
4107
|
-
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-Ca74dkaL-
|
|
4107
|
+
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-Ca74dkaL-BRbwnyDi.js").then((n) => n.n);
|
|
4108
4108
|
return await (await NostrIdentityCollection.create(options)).findOne({ where: { email: email.toLowerCase() } });
|
|
4109
4109
|
}
|
|
4110
4110
|
/**
|
|
4111
4111
|
* Find identity by NIP-05 username
|
|
4112
4112
|
*/
|
|
4113
4113
|
static async findByNip05(username, options = {}) {
|
|
4114
|
-
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-Ca74dkaL-
|
|
4114
|
+
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-Ca74dkaL-BRbwnyDi.js").then((n) => n.n);
|
|
4115
4115
|
return await (await NostrIdentityCollection.create(options)).findOne({ where: { nip05Username: username.toLowerCase() } });
|
|
4116
4116
|
}
|
|
4117
4117
|
/**
|
|
@@ -35,7 +35,7 @@ var OidcIdentity = class extends SmrtObject {
|
|
|
35
35
|
* Find identity by issuer and subject
|
|
36
36
|
*/
|
|
37
37
|
static async findBySubject(issuer, subject, options = {}) {
|
|
38
|
-
const { OidcIdentityCollection } = await import("./OidcIdentityCollection-D3L0WYbM-
|
|
38
|
+
const { OidcIdentityCollection } = await import("./OidcIdentityCollection-D3L0WYbM-DDtBvtoJ.js").then((n) => n.r);
|
|
39
39
|
return await (await OidcIdentityCollection.create(options)).findBySubject(issuer, subject);
|
|
40
40
|
}
|
|
41
41
|
/** Build the collision-free natural key for one OIDC issuer subject. */
|
|
@@ -58,7 +58,7 @@ var OidcIdentity = class extends SmrtObject {
|
|
|
58
58
|
static async findOrCreate(profile, oidcData, options = {}) {
|
|
59
59
|
const profileId = profile.id;
|
|
60
60
|
if (typeof profileId !== "string" || !profileId) throw new Error("OidcIdentity.findOrCreate() requires a saved Profile.");
|
|
61
|
-
const { reuseExistingOidcIdentityForProfile } = await import("./resolveIdentity-73HQnTlT-
|
|
61
|
+
const { reuseExistingOidcIdentityForProfile } = await import("./resolveIdentity-73HQnTlT-SzLUTou1.js").then((n) => n.i);
|
|
62
62
|
const profileOptions = profile.options ?? {};
|
|
63
63
|
return (await reuseExistingOidcIdentityForProfile(profileId, {
|
|
64
64
|
email: oidcData.email,
|
package/dist/{ProfileCollection-BvhD2cfL-CT6ctQ3l.js → ProfileCollection-BvhD2cfL-RFUmqnp4.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll$1 } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { n as __exportAll$2 } from "./NostrIdentity-n70E0vck-
|
|
3
|
-
import { a as getTenantId, i as queryWithGlobals, n as tenantId, r as queryGlobal, s as withSystemContext, t as TenantScoped } from "./dist-
|
|
4
|
-
import { a as removeOwnedAssetFromCollection, i as getOwnedAssetsFromCollection, n as assertValidOwnedAssetRelationship, o as resolveOwnedAssetsById, r as assertValidOwnedAssetSortOrder, t as addOwnedAssetFromCollection } from "./dist-
|
|
2
|
+
import { n as __exportAll$2 } from "./NostrIdentity-n70E0vck-D9-IziHy.js";
|
|
3
|
+
import { a as getTenantId, i as queryWithGlobals, n as tenantId, r as queryGlobal, s as withSystemContext, t as TenantScoped } from "./dist-BFQchr0-.js";
|
|
4
|
+
import { a as removeOwnedAssetFromCollection, i as getOwnedAssetsFromCollection, n as assertValidOwnedAssetRelationship, o as resolveOwnedAssetsById, r as assertValidOwnedAssetSortOrder, t as addOwnedAssetFromCollection } from "./dist-gOKwtnKm.js";
|
|
5
5
|
import { ObjectRegistry, SmrtCollection, SmrtObject, ValidationError, field, foreignKey, isAbortedTransactionError, oneToMany, smrt } from "@happyvertical/smrt-core";
|
|
6
6
|
import { getPackageConfig } from "@happyvertical/smrt-config";
|
|
7
7
|
import { BackfillTableUnavailableError, BackfillTracker } from "@happyvertical/smrt-core/migrations";
|
|
@@ -16,7 +16,7 @@ var __exportAll = (all, no_symbols) => {
|
|
|
16
16
|
if (!no_symbols) __defProp$1$1(target, Symbol.toStringTag, { value: "Module" });
|
|
17
17
|
return target;
|
|
18
18
|
};
|
|
19
|
-
ObjectRegistry.registerPackageManifest(JSON.parse("{\"version\":\"1.0.0\",\"timestamp\":0,\"packageName\":\"@happyvertical/smrt-prompts\",\"packageVersion\":\"0.51.
|
|
19
|
+
ObjectRegistry.registerPackageManifest(JSON.parse("{\"version\":\"1.0.0\",\"timestamp\":0,\"packageName\":\"@happyvertical/smrt-prompts\",\"packageVersion\":\"0.51.18\",\"objects\":{\"@happyvertical/smrt-prompts:PromptOverrideCollection\":{\"name\":\"promptoverridecollection\",\"className\":\"PromptOverrideCollection\",\"qualifiedName\":\"@happyvertical/smrt-prompts:PromptOverrideCollection\",\"collection\":\"promptoverrides\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/prompts/src/collections/PromptOverrideCollection.ts\",\"packageName\":\"@happyvertical/smrt-prompts\",\"fields\":{},\"methods\":{\"getAppOverride\":{\"name\":\"getAppOverride\",\"async\":true,\"parameters\":[{\"name\":\"key\",\"type\":\"string\",\"optional\":false},{\"name\":\"options\",\"type\":\"object\",\"optional\":true,\"memberTypes\":[\"string\"]}],\"returnType\":\"Promise<PromptOverride | null>\",\"isStatic\":false,\"isPublic\":true},\"getTenantOverride\":{\"name\":\"getTenantOverride\",\"async\":true,\"parameters\":[{\"name\":\"key\",\"type\":\"string\",\"optional\":false},{\"name\":\"tenantId\",\"type\":\"string\",\"optional\":false},{\"name\":\"options\",\"type\":\"object\",\"optional\":true,\"memberTypes\":[\"string\"]}],\"returnType\":\"Promise<PromptOverride | null>\",\"isStatic\":false,\"isPublic\":true},\"getResolutionLayers\":{\"name\":\"getResolutionLayers\",\"async\":true,\"parameters\":[{\"name\":\"key\",\"type\":\"string\",\"optional\":false},{\"name\":\"tenantId\",\"type\":\"string | null\",\"optional\":true,\"unionBranches\":[{\"type\":\"string\"},{\"type\":\"null\"}]},{\"name\":\"options\",\"type\":\"object\",\"optional\":true,\"memberTypes\":[\"string\"]}],\"returnType\":\"Promise<object>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"tableName\":\"_smrt_prompt_overrides\"},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"PromptOverride\",\"exportName\":\"PromptOverrideCollection\",\"collectionExportName\":\"PromptOverrideCollectionCollection\",\"schema\":{\"tableName\":\"_smrt_prompt_overrides\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"_smrt_prompt_overrides\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"key\\\" TEXT NOT NULL DEFAULT '',\\n \\\"tenant_id\\\" TEXT,\\n \\\"template\\\" TEXT,\\n \\\"profile\\\" TEXT,\\n \\\"model\\\" TEXT,\\n \\\"params\\\" TEXT\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"key\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false,\"default\":\"\"},\"tenant_id\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false},\"template\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false},\"profile\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false},\"model\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false},\"params\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false}},\"indexes\":[{\"name\":\"_smrt_prompt_overrides_key_context_idx\",\"columns\":[\"key\",\"context\"],\"unique\":true},{\"name\":\"_smrt_prompt_overrides_slug_context_idx\",\"columns\":[\"slug\",\"context\"]},{\"name\":\"_smrt_prompt_overrides_created_at_idx\",\"columns\":[\"created_at\"]}],\"version\":\"6f475427\"},\"importPath\":\"@happyvertical/smrt-prompts\"},\"@happyvertical/smrt-prompts:PromptOverride\":{\"name\":\"promptoverride\",\"className\":\"PromptOverride\",\"qualifiedName\":\"@happyvertical/smrt-prompts:PromptOverride\",\"collection\":\"promptoverrides\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/prompts/src/models/PromptOverride.ts\",\"packageName\":\"@happyvertical/smrt-prompts\",\"fields\":{\"key\":{\"type\":\"text\",\"required\":true,\"default\":\"\",\"_meta\":{\"required\":true}},\"tenantId\":{\"type\":\"text\",\"required\":false,\"_meta\":{\"nullable\":true}},\"template\":{\"type\":\"text\",\"required\":false,\"_meta\":{\"nullable\":true}},\"profile\":{\"type\":\"text\",\"required\":false,\"_meta\":{\"nullable\":true}},\"model\":{\"type\":\"text\",\"required\":false,\"_meta\":{\"nullable\":true}},\"params\":{\"type\":\"text\",\"required\":false,\"_meta\":{\"nullable\":true}}},\"methods\":{\"getParams\":{\"name\":\"getParams\",\"async\":false,\"parameters\":[],\"returnType\":\"PromptParams\",\"isStatic\":false,\"isPublic\":true},\"setParams\":{\"name\":\"setParams\",\"async\":false,\"parameters\":[{\"name\":\"params\",\"type\":\"PromptParams | null\",\"optional\":false,\"unionBranches\":[{\"type\":\"PromptParams\"},{\"type\":\"null\"}]}],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"toPromptLayer\":{\"name\":\"toPromptLayer\",\"async\":false,\"parameters\":[],\"returnType\":\"PromptLayer\",\"isStatic\":false,\"isPublic\":true},\"save\":{\"name\":\"save\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<this>\",\"isStatic\":false,\"isPublic\":true},\"delete\":{\"name\":\"delete\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"tableName\":\"_smrt_prompt_overrides\",\"conflictColumns\":[\"key\",\"context\"],\"api\":{\"include\":[\"list\",\"get\",\"create\",\"update\",\"delete\"]},\"cli\":{\"include\":[\"list\",\"get\",\"create\",\"update\",\"delete\"],\"exclude\":[\"getParams\",\"setParams\",\"toPromptLayer\"]},\"mcp\":{\"include\":[]}},\"extends\":\"SmrtObject\",\"exportName\":\"PromptOverride\",\"collectionExportName\":\"PromptOverrideCollection\",\"validationRules\":[{\"field\":\"key\",\"rule\":\"required\",\"fieldType\":\"text\"}],\"schema\":{\"tableName\":\"_smrt_prompt_overrides\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"_smrt_prompt_overrides\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"key\\\" TEXT NOT NULL DEFAULT '',\\n \\\"tenant_id\\\" TEXT,\\n \\\"template\\\" TEXT,\\n \\\"profile\\\" TEXT,\\n \\\"model\\\" TEXT,\\n \\\"params\\\" TEXT\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"key\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false,\"default\":\"\"},\"tenant_id\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false},\"template\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false},\"profile\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false},\"model\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false},\"params\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false}},\"indexes\":[{\"name\":\"_smrt_prompt_overrides_key_context_idx\",\"columns\":[\"key\",\"context\"],\"unique\":true},{\"name\":\"_smrt_prompt_overrides_slug_context_idx\",\"columns\":[\"slug\",\"context\"]},{\"name\":\"_smrt_prompt_overrides_created_at_idx\",\"columns\":[\"created_at\"]}],\"version\":\"6f475427\"},\"importPath\":\"@happyvertical/smrt-prompts\"}},\"moduleType\":\"smrt\",\"smrtDependencies\":[\"@happyvertical/smrt-core\",\"@happyvertical/smrt-tenancy\"]}"));
|
|
20
20
|
var PROMPT_CACHE_TTL_MS = 3e4;
|
|
21
21
|
var promptCache = /* @__PURE__ */ new Map();
|
|
22
22
|
var cacheGenerations = /* @__PURE__ */ new Map();
|
|
@@ -1051,8 +1051,8 @@ var Profile = class extends SmrtObject {
|
|
|
1051
1051
|
* @param value - The value to set
|
|
1052
1052
|
*/
|
|
1053
1053
|
async addMetadata(metafieldSlug, value) {
|
|
1054
|
-
const { ProfileMetafieldCollection } = await import("./ProfileMetafieldCollection-CMKhVi2I
|
|
1055
|
-
const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-DxX_BJKV-
|
|
1054
|
+
const { ProfileMetafieldCollection } = await import("./ProfileMetafieldCollection-CMKhVi2I-kLBafM_b.js").then((n) => n.n);
|
|
1055
|
+
const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-DxX_BJKV-Bz7i-WYc.js").then((n) => n.n);
|
|
1056
1056
|
const metafield = await (await ProfileMetafieldCollection.create(this.options)).getBySlug(metafieldSlug);
|
|
1057
1057
|
if (!metafield) throw new Error(`Metafield '${metafieldSlug}' not found`);
|
|
1058
1058
|
await metafield.validateValue(value);
|
|
@@ -1083,7 +1083,7 @@ var Profile = class extends SmrtObject {
|
|
|
1083
1083
|
* @returns Object with metafield slugs as keys
|
|
1084
1084
|
*/
|
|
1085
1085
|
async getMetadata() {
|
|
1086
|
-
const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-DxX_BJKV-
|
|
1086
|
+
const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-DxX_BJKV-Bz7i-WYc.js").then((n) => n.n);
|
|
1087
1087
|
return await (await ProfileMetadataCollection.create(this.options)).getMetadataObject(this.id);
|
|
1088
1088
|
}
|
|
1089
1089
|
/**
|
|
@@ -1100,8 +1100,8 @@ var Profile = class extends SmrtObject {
|
|
|
1100
1100
|
* @param metafieldSlug - The slug of the metafield to remove
|
|
1101
1101
|
*/
|
|
1102
1102
|
async removeMetadata(metafieldSlug) {
|
|
1103
|
-
const { ProfileMetafieldCollection } = await import("./ProfileMetafieldCollection-CMKhVi2I
|
|
1104
|
-
const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-DxX_BJKV-
|
|
1103
|
+
const { ProfileMetafieldCollection } = await import("./ProfileMetafieldCollection-CMKhVi2I-kLBafM_b.js").then((n) => n.n);
|
|
1104
|
+
const { ProfileMetadataCollection } = await import("./ProfileMetadataCollection-DxX_BJKV-Bz7i-WYc.js").then((n) => n.n);
|
|
1105
1105
|
const metafield = await (await ProfileMetafieldCollection.create(this.options)).getBySlug(metafieldSlug);
|
|
1106
1106
|
if (!metafield) throw new Error(`Metafield '${metafieldSlug}' not found`);
|
|
1107
1107
|
const existing = await (await ProfileMetadataCollection.create(this.options)).list({
|
|
@@ -1114,7 +1114,7 @@ var Profile = class extends SmrtObject {
|
|
|
1114
1114
|
if (existing.length > 0) await existing[0].delete();
|
|
1115
1115
|
}
|
|
1116
1116
|
async getProfileAssetCollection() {
|
|
1117
|
-
const { ProfileAssetCollection } = await import("./ProfileAssetCollection-V8u4wqSL-
|
|
1117
|
+
const { ProfileAssetCollection } = await import("./ProfileAssetCollection-V8u4wqSL-Cf_IQvNf.js").then((n) => n.n);
|
|
1118
1118
|
return ProfileAssetCollection.create({ db: this.db });
|
|
1119
1119
|
}
|
|
1120
1120
|
async getAssets(relationship) {
|
|
@@ -1144,9 +1144,9 @@ var Profile = class extends SmrtObject {
|
|
|
1144
1144
|
* @param contextProfile - Optional context profile for tertiary relationships
|
|
1145
1145
|
*/
|
|
1146
1146
|
async addRelationship(toProfile, relationshipSlug, contextProfile) {
|
|
1147
|
-
const { ProfileRelationshipTypeCollection } = await import("./ProfileRelationshipTypeCollection-BdXwd7Kf-
|
|
1148
|
-
const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-DUVgaIqf-
|
|
1149
|
-
const { ProfileRelationshipType } = await import("./ProfileRelationshipType-BRiRka6t-
|
|
1147
|
+
const { ProfileRelationshipTypeCollection } = await import("./ProfileRelationshipTypeCollection-BdXwd7Kf-DnpByZIo.js").then((n) => n.n);
|
|
1148
|
+
const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-DUVgaIqf-DtSkUi1A.js").then((n) => n.n);
|
|
1149
|
+
const { ProfileRelationshipType } = await import("./ProfileRelationshipType-BRiRka6t-BYrzAnkn.js").then((n) => n.n).then((n) => n.n);
|
|
1150
1150
|
const relationshipType = await (await ProfileRelationshipTypeCollection.create(this.options)).getBySlug(relationshipSlug);
|
|
1151
1151
|
if (!relationshipType) throw new Error(`Relationship type '${relationshipSlug}' not found`);
|
|
1152
1152
|
const relationshipCollection = await ProfileRelationshipCollection.create(this.options);
|
|
@@ -1170,8 +1170,8 @@ var Profile = class extends SmrtObject {
|
|
|
1170
1170
|
* @returns Array of ProfileRelationship instances
|
|
1171
1171
|
*/
|
|
1172
1172
|
async getRelationships(options) {
|
|
1173
|
-
const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-DUVgaIqf-
|
|
1174
|
-
const { ProfileRelationshipTypeCollection } = await import("./ProfileRelationshipTypeCollection-BdXwd7Kf-
|
|
1173
|
+
const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-DUVgaIqf-DtSkUi1A.js").then((n) => n.n);
|
|
1174
|
+
const { ProfileRelationshipTypeCollection } = await import("./ProfileRelationshipTypeCollection-BdXwd7Kf-DnpByZIo.js").then((n) => n.n);
|
|
1175
1175
|
const relationshipCollection = await ProfileRelationshipCollection.create(this.options);
|
|
1176
1176
|
const direction = options?.direction || "all";
|
|
1177
1177
|
let typeId;
|
|
@@ -1214,8 +1214,8 @@ var Profile = class extends SmrtObject {
|
|
|
1214
1214
|
* @param relationshipSlug - The type of relationship to remove
|
|
1215
1215
|
*/
|
|
1216
1216
|
async removeRelationship(toProfile, relationshipSlug) {
|
|
1217
|
-
const { ProfileRelationshipTypeCollection } = await import("./ProfileRelationshipTypeCollection-BdXwd7Kf-
|
|
1218
|
-
const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-DUVgaIqf-
|
|
1217
|
+
const { ProfileRelationshipTypeCollection } = await import("./ProfileRelationshipTypeCollection-BdXwd7Kf-DnpByZIo.js").then((n) => n.n);
|
|
1218
|
+
const { ProfileRelationshipCollection } = await import("./ProfileRelationshipCollection-DUVgaIqf-DtSkUi1A.js").then((n) => n.n);
|
|
1219
1219
|
const relationshipType = await (await ProfileRelationshipTypeCollection.create(this.options)).getBySlug(relationshipSlug);
|
|
1220
1220
|
if (!relationshipType) throw new Error(`Relationship type '${relationshipSlug}' not found`);
|
|
1221
1221
|
const relationshipCollection = await ProfileRelationshipCollection.create(this.options);
|
|
@@ -1308,7 +1308,7 @@ var Profile = class extends SmrtObject {
|
|
|
1308
1308
|
* @returns Array of API keys
|
|
1309
1309
|
*/
|
|
1310
1310
|
async getApiKeys() {
|
|
1311
|
-
const { ApiKeyCollection } = await import("./ApiKeyCollection-Bfb_nw81-
|
|
1311
|
+
const { ApiKeyCollection } = await import("./ApiKeyCollection-Bfb_nw81-CdlZMFSc.js").then((n) => n.n);
|
|
1312
1312
|
return await (await ApiKeyCollection.create(this.options)).findByProfile(this.id);
|
|
1313
1313
|
}
|
|
1314
1314
|
/**
|
|
@@ -1317,7 +1317,7 @@ var Profile = class extends SmrtObject {
|
|
|
1317
1317
|
* @returns Array of active API keys
|
|
1318
1318
|
*/
|
|
1319
1319
|
async getActiveApiKeys() {
|
|
1320
|
-
const { ApiKeyCollection } = await import("./ApiKeyCollection-Bfb_nw81-
|
|
1320
|
+
const { ApiKeyCollection } = await import("./ApiKeyCollection-Bfb_nw81-CdlZMFSc.js").then((n) => n.n);
|
|
1321
1321
|
return await (await ApiKeyCollection.create(this.options)).findActiveByProfile(this.id);
|
|
1322
1322
|
}
|
|
1323
1323
|
/**
|
|
@@ -1327,7 +1327,7 @@ var Profile = class extends SmrtObject {
|
|
|
1327
1327
|
* @returns The generated key (plaintext) and ApiKey record
|
|
1328
1328
|
*/
|
|
1329
1329
|
async generateApiKey(options) {
|
|
1330
|
-
const { ApiKey } = await import("./ApiKey-BZmbOTnL-
|
|
1330
|
+
const { ApiKey } = await import("./ApiKey-BZmbOTnL-DTI3K-Tn.js").then((n) => n.n).then((n) => n.n);
|
|
1331
1331
|
return await ApiKey.generate(this, {
|
|
1332
1332
|
...options,
|
|
1333
1333
|
db: this.options?.db
|
|
@@ -1339,7 +1339,7 @@ var Profile = class extends SmrtObject {
|
|
|
1339
1339
|
* @returns Array of OIDC identity records
|
|
1340
1340
|
*/
|
|
1341
1341
|
async getOidcIdentities() {
|
|
1342
|
-
const { OidcIdentityCollection } = await import("./OidcIdentityCollection-D3L0WYbM-
|
|
1342
|
+
const { OidcIdentityCollection } = await import("./OidcIdentityCollection-D3L0WYbM-DDtBvtoJ.js").then((n) => n.r);
|
|
1343
1343
|
return await (await OidcIdentityCollection.create(this.options)).findByProfile(this.id);
|
|
1344
1344
|
}
|
|
1345
1345
|
/**
|
|
@@ -1352,7 +1352,7 @@ var Profile = class extends SmrtObject {
|
|
|
1352
1352
|
* type, but refuses to create or rebind authority.
|
|
1353
1353
|
*/
|
|
1354
1354
|
async linkOidcIdentity(oidcData) {
|
|
1355
|
-
const { OidcIdentityCollection } = await import("./OidcIdentityCollection-D3L0WYbM-
|
|
1355
|
+
const { OidcIdentityCollection } = await import("./OidcIdentityCollection-D3L0WYbM-DDtBvtoJ.js").then((n) => n.r);
|
|
1356
1356
|
return await (await OidcIdentityCollection.create(this.options)).linkToProfile(this, oidcData);
|
|
1357
1357
|
}
|
|
1358
1358
|
/**
|
|
@@ -1361,7 +1361,7 @@ var Profile = class extends SmrtObject {
|
|
|
1361
1361
|
* @returns Array of Nostr identity records
|
|
1362
1362
|
*/
|
|
1363
1363
|
async getNostrIdentities() {
|
|
1364
|
-
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-Ca74dkaL-
|
|
1364
|
+
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-Ca74dkaL-BRbwnyDi.js").then((n) => n.n);
|
|
1365
1365
|
return await (await NostrIdentityCollection.create(this.options)).findByProfile(this.id);
|
|
1366
1366
|
}
|
|
1367
1367
|
/**
|
|
@@ -1371,7 +1371,7 @@ var Profile = class extends SmrtObject {
|
|
|
1371
1371
|
* @returns The linked Nostr identity record
|
|
1372
1372
|
*/
|
|
1373
1373
|
async linkNostrIdentity(nostrData) {
|
|
1374
|
-
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-Ca74dkaL-
|
|
1374
|
+
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-Ca74dkaL-BRbwnyDi.js").then((n) => n.n);
|
|
1375
1375
|
return await (await NostrIdentityCollection.create(this.options)).linkToProfile(this, nostrData);
|
|
1376
1376
|
}
|
|
1377
1377
|
/**
|
|
@@ -1381,7 +1381,7 @@ var Profile = class extends SmrtObject {
|
|
|
1381
1381
|
* @returns Array of audit log entries
|
|
1382
1382
|
*/
|
|
1383
1383
|
async getAuditLogs(limit = 50) {
|
|
1384
|
-
const { AuditLogCollection } = await import("./AuditLogCollection-B1YonCAP-
|
|
1384
|
+
const { AuditLogCollection } = await import("./AuditLogCollection-B1YonCAP-B0Vy3Z6u.js").then((n) => n.n);
|
|
1385
1385
|
return await (await AuditLogCollection.create(this.options)).getRecentActivity(this.id, limit);
|
|
1386
1386
|
}
|
|
1387
1387
|
/**
|
|
@@ -1391,7 +1391,7 @@ var Profile = class extends SmrtObject {
|
|
|
1391
1391
|
* @returns The created audit log entry
|
|
1392
1392
|
*/
|
|
1393
1393
|
async recordAction(options) {
|
|
1394
|
-
const { AuditLogCollection } = await import("./AuditLogCollection-B1YonCAP-
|
|
1394
|
+
const { AuditLogCollection } = await import("./AuditLogCollection-B1YonCAP-B0Vy3Z6u.js").then((n) => n.n);
|
|
1395
1395
|
return await (await AuditLogCollection.create(this.options)).record({
|
|
1396
1396
|
profile: this,
|
|
1397
1397
|
...options
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { h as ProfileMetafieldCollection_exports } from "./dist-
|
|
1
|
+
import { h as ProfileMetafieldCollection_exports } from "./dist-CZWupza5.js";
|
|
2
2
|
export { ProfileMetafieldCollection_exports as n };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { f as ProfileRelationshipCollection_exports } from "./dist-
|
|
1
|
+
import { f as ProfileRelationshipCollection_exports } from "./dist-CZWupza5.js";
|
|
2
2
|
export { ProfileRelationshipCollection_exports as n };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { l as ProfileRelationshipTermCollection_exports } from "./dist-
|
|
1
|
+
import { l as ProfileRelationshipTermCollection_exports } from "./dist-CZWupza5.js";
|
|
2
2
|
export { ProfileRelationshipTermCollection_exports as n };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { n as __exportAll$1 } from "./NostrIdentity-n70E0vck-
|
|
2
|
+
import { n as __exportAll$1 } from "./NostrIdentity-n70E0vck-D9-IziHy.js";
|
|
3
3
|
import { SmrtObject, field, smrt } from "@happyvertical/smrt-core";
|
|
4
4
|
//#region ../profiles/dist/chunks/ProfileRelationshipType-BRiRka6t.js
|
|
5
5
|
var ProfileRelationshipType_BRiRka6t_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { o as ProfileRelationshipTypeCollection_exports } from "./dist-
|
|
1
|
+
import { o as ProfileRelationshipTypeCollection_exports } from "./dist-CZWupza5.js";
|
|
2
2
|
export { ProfileRelationshipTypeCollection_exports as n };
|
|
@@ -3042,7 +3042,7 @@ function summarizeSchemaDiff(diff) {
|
|
|
3042
3042
|
drift.push({
|
|
3043
3043
|
name: `${change.table}.${change.name ?? "(unknown)"}`,
|
|
3044
3044
|
type: "type_upgrade",
|
|
3045
|
-
recommendation: "Manual intervention required: this live column needs a type upgrade that the current database engine cannot auto-apply."
|
|
3045
|
+
recommendation: change.advisory?.message ? `Manual intervention required: ${change.advisory.message}` : "Manual intervention required: this live column needs a type upgrade that the current database engine cannot auto-apply."
|
|
3046
3046
|
});
|
|
3047
3047
|
break;
|
|
3048
3048
|
case "noop": break;
|
|
@@ -6943,7 +6943,7 @@ var dbMaterializeTenantHierarchyCommand = {
|
|
|
6943
6943
|
if (!config.database?.url || config.database.url === ":memory:") throw new Error("Database configuration required for db:materialize-tenant-hierarchy. Configure database.url in smrt.config.ts (or DATABASE_URL).");
|
|
6944
6944
|
const dbType = config.database.type || "sqlite";
|
|
6945
6945
|
const { getDatabase } = await import("@happyvertical/sql");
|
|
6946
|
-
const { materializeTenantHierarchy, TenantHierarchyMaterializationError } = await import("./dist-
|
|
6946
|
+
const { materializeTenantHierarchy, TenantHierarchyMaterializationError } = await import("./dist-CZWupza5.js");
|
|
6947
6947
|
db = await getDatabase({
|
|
6948
6948
|
type: dbType,
|
|
6949
6949
|
url: config.database.url
|
|
@@ -91,7 +91,7 @@ async function queryWithGlobals(collection, tenantId, label) {
|
|
|
91
91
|
createLogger({ level: "info" });
|
|
92
92
|
//#endregion
|
|
93
93
|
//#region ../tenancy/dist/index.js
|
|
94
|
-
ObjectRegistry.registerPackageManifest(JSON.parse("{\"version\":\"1.0.0\",\"timestamp\":0,\"packageName\":\"@happyvertical/smrt-tenancy\",\"packageVersion\":\"0.51.
|
|
94
|
+
ObjectRegistry.registerPackageManifest(JSON.parse("{\"version\":\"1.0.0\",\"timestamp\":0,\"packageName\":\"@happyvertical/smrt-tenancy\",\"packageVersion\":\"0.51.18\",\"objects\":{},\"moduleType\":\"smrt\",\"smrtDependencies\":[\"@happyvertical/smrt-core\"]}"));
|
|
95
95
|
function TenantScoped(options = {}) {
|
|
96
96
|
return (target, decoratorContext) => {
|
|
97
97
|
applyPendingDecoratorRegistrations(target, decoratorContext);
|