@happyvertical/smrt-cli 0.54.1 → 0.54.3
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-BbZupUZ3.js → ApiKey-CVmlf3V6-BAeHuH48.js} +13 -5
- package/dist/{ApiKeyCollection-Bfb_nw81-DYAZwx0O.js → ApiKeyCollection-CiiDNFdD-CMGF3_ul.js} +5 -5
- package/dist/{AuditLogCollection-B1YonCAP-BDUrNGcS.js → AuditLogCollection-WDHL-_AF-BH_fVbtQ.js} +33 -15
- package/dist/{NostrIdentity-n70E0vck-Di3_eNCq.js → NostrIdentity-AC8fAdxe-DKxKyu_a.js} +12 -4
- package/dist/{NostrIdentityCollection-Ca74dkaL-DvjOg9Xy.js → NostrIdentityCollection-CctlECpX-fkAPnK02.js} +4 -4
- package/dist/{OidcIdentity-Cb1bxreM-DfO_c0Yh.js → OidcIdentity-BjRu3n1g-DLxby4jH.js} +11 -3
- package/dist/{OidcIdentityCollection-TV8VdK69-DzOkoWHQ.js → OidcIdentityCollection-B4jYh36_-By9emBa2.js} +5 -5
- package/dist/{ProfileAssetCollection-B9hacUJa-CX2PYc46.js → ProfileAssetCollection-HeMtjBc0-oIL6YSUZ.js} +16 -7
- package/dist/{ProfileCollection-DuJT7Mum-BOIdjUTp.js → ProfileCollection-Bt6IJK49-B1_oDwPG.js} +53 -29
- package/dist/{ProfileLinkCollection-4uNURz32-Csdzv-Qv.js → ProfileLinkCollection-u1hhzKTm-Dr0Nz06-.js} +14 -6
- package/dist/{ProfileMetadataCollection-DQhbfEfa-TpoZQSA0.js → ProfileMetadataCollection-BIYKy4Y3-DIyfp9vR.js} +13 -5
- package/dist/{ProfileMetafieldCollection-CoBuM_5G-BIXiLNZ0.js → ProfileMetafieldCollection-Buz7gzag-DTX_ZzEU.js} +13 -5
- package/dist/{ProfileRelationshipCollection-DUVgaIqf-CXEhCV9T.js → ProfileRelationshipCollection-C4g_QLI4-DbDLX7wE.js} +16 -8
- package/dist/{ProfileRelationshipTermCollection-DtA9OM23-BoGhQBSQ.js → ProfileRelationshipTermCollection-C9J7mC7P-ChIFqjCg.js} +12 -4
- package/dist/{ProfileRelationshipType-BRiRka6t-Dezjv5jP.js → ProfileRelationshipType-U7IwF6Wf-DNavf24e.js} +12 -4
- package/dist/{ProfileRelationshipTypeCollection-BdXwd7Kf-HoTmV1q-.js → ProfileRelationshipTypeCollection-_n22WqTb-DiZUWvev.js} +5 -5
- package/dist/cli-generator.d.ts.map +1 -1
- package/dist/{commands-BD5X9cMG.js → commands-D3EYdGNp.js} +2 -2
- package/dist/dist-BJgUA7Bn.js +1778 -0
- package/dist/{dist-MTTwaasL.js → dist-Bzshoi-0.js} +18 -2
- package/dist/dist-D5MGUBs8.js +4112 -0
- package/dist/{dist-WHmitm0L.js → dist-DE7COF_x.js} +29 -5
- package/dist/dist-KGK8QWAS.js +20 -0
- package/dist/index.js +26 -16
- package/dist/{oidcProvisioningPrimitives-D9OYu5-F-BVIJD3mI.js → oidcProvisioningPrimitives-CYood-2M-5BmKJPFx.js} +17 -7
- package/dist/{resolveIdentity-B-PK6RwU-CWEkXCVC.js → resolveIdentity-CvGDegU6--sWLCFfc.js} +19 -19
- package/package.json +15 -15
- package/dist/dist-BtFwpdXy.js +0 -3850
- package/dist/dist-DFLWw0iq.js +0 -1705
- package/dist/dist-mz-yUYw6.js +0 -20
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { n as __exportAll$1 } from "./NostrIdentity-
|
|
2
|
+
import { n as __exportAll$1 } from "./NostrIdentity-AC8fAdxe-DKxKyu_a.js";
|
|
3
3
|
import { SmrtObject, field, foreignKey, smrt } from "@happyvertical/smrt-core";
|
|
4
4
|
import { createHash, randomBytes } from "node:crypto";
|
|
5
|
-
//#region ../profiles/dist/chunks/ApiKey-
|
|
6
|
-
var
|
|
5
|
+
//#region ../profiles/dist/chunks/ApiKey-CVmlf3V6.js
|
|
6
|
+
var ApiKey_CVmlf3V6_exports = /* @__PURE__ */ __exportAll({
|
|
7
7
|
n: () => ApiKey_exports,
|
|
8
8
|
t: () => ApiKey
|
|
9
9
|
});
|
|
10
10
|
var ApiKey_exports = /* @__PURE__ */ __exportAll$1({ ApiKey: () => ApiKey });
|
|
11
11
|
var __defProp = Object.defineProperty;
|
|
12
12
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
configurable: true,
|
|
16
|
+
writable: true,
|
|
17
|
+
value
|
|
18
|
+
}) : obj[key] = value;
|
|
13
19
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
14
20
|
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
15
21
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
16
22
|
if (kind && result) __defProp(target, key, result);
|
|
17
23
|
return result;
|
|
18
24
|
};
|
|
25
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
19
26
|
var ApiKey = class extends SmrtObject {
|
|
20
27
|
profileId;
|
|
21
28
|
keyHash = "";
|
|
@@ -127,7 +134,7 @@ var ApiKey = class extends SmrtObject {
|
|
|
127
134
|
*/
|
|
128
135
|
static async verify(key, options = {}) {
|
|
129
136
|
const keyHash = ApiKey.hashKey(key);
|
|
130
|
-
const { ApiKeyCollection } = await import("./ApiKeyCollection-
|
|
137
|
+
const { ApiKeyCollection } = await import("./ApiKeyCollection-CiiDNFdD-CMGF3_ul.js").then((n) => n.n).then((n) => n.n);
|
|
131
138
|
const apiKey = await (await ApiKeyCollection.create(options)).findOne({ where: { keyHash } });
|
|
132
139
|
if (!apiKey) return null;
|
|
133
140
|
if (!apiKey.isValid()) return null;
|
|
@@ -136,6 +143,7 @@ var ApiKey = class extends SmrtObject {
|
|
|
136
143
|
return apiKey;
|
|
137
144
|
}
|
|
138
145
|
};
|
|
146
|
+
__publicField(ApiKey, "__smrtPackage__", "@happyvertical/smrt-profiles");
|
|
139
147
|
__decorateClass([foreignKey("Profile", { required: true })], ApiKey.prototype, "profileId", 2);
|
|
140
148
|
__decorateClass([field({ indexed: true })], ApiKey.prototype, "keyHash", 2);
|
|
141
149
|
ApiKey = __decorateClass([smrt({
|
|
@@ -154,4 +162,4 @@ ApiKey = __decorateClass([smrt({
|
|
|
154
162
|
}
|
|
155
163
|
})], ApiKey);
|
|
156
164
|
//#endregion
|
|
157
|
-
export {
|
|
165
|
+
export { ApiKey_CVmlf3V6_exports as n, ApiKey as t };
|
package/dist/{ApiKeyCollection-Bfb_nw81-DYAZwx0O.js → ApiKeyCollection-CiiDNFdD-CMGF3_ul.js}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { n as __exportAll$1 } from "./NostrIdentity-
|
|
3
|
-
import { t as ApiKey } from "./ApiKey-
|
|
2
|
+
import { n as __exportAll$1 } from "./NostrIdentity-AC8fAdxe-DKxKyu_a.js";
|
|
3
|
+
import { t as ApiKey } from "./ApiKey-CVmlf3V6-BAeHuH48.js";
|
|
4
4
|
import { SmrtCollection } from "@happyvertical/smrt-core";
|
|
5
|
-
//#region ../profiles/dist/chunks/ApiKeyCollection-
|
|
6
|
-
var
|
|
5
|
+
//#region ../profiles/dist/chunks/ApiKeyCollection-CiiDNFdD.js
|
|
6
|
+
var ApiKeyCollection_CiiDNFdD_exports = /* @__PURE__ */ __exportAll({
|
|
7
7
|
n: () => ApiKeyCollection_exports,
|
|
8
8
|
t: () => ApiKeyCollection
|
|
9
9
|
});
|
|
@@ -84,4 +84,4 @@ var ApiKeyCollection = class extends SmrtCollection {
|
|
|
84
84
|
}
|
|
85
85
|
};
|
|
86
86
|
//#endregion
|
|
87
|
-
export {
|
|
87
|
+
export { ApiKeyCollection_CiiDNFdD_exports as n, ApiKeyCollection as t };
|
package/dist/{AuditLogCollection-B1YonCAP-BDUrNGcS.js → AuditLogCollection-WDHL-_AF-BH_fVbtQ.js}
RENAMED
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { i as tenantId, r as TenantScoped } from "./dist-
|
|
3
|
-
import { n as __exportAll$1 } from "./NostrIdentity-
|
|
4
|
-
import { SmrtCollection, SmrtObject, foreignKey, smrt } from "@happyvertical/smrt-core";
|
|
5
|
-
//#region ../profiles/dist/chunks/AuditLogCollection-
|
|
6
|
-
var
|
|
2
|
+
import { i as tenantId, r as TenantScoped } from "./dist-Bzshoi-0.js";
|
|
3
|
+
import { n as __exportAll$1 } from "./NostrIdentity-AC8fAdxe-DKxKyu_a.js";
|
|
4
|
+
import { SmrtCollection, SmrtObject, field, foreignKey, smrt } from "@happyvertical/smrt-core";
|
|
5
|
+
//#region ../profiles/dist/chunks/AuditLogCollection-WDHL-_AF.js
|
|
6
|
+
var AuditLogCollection_WDHL__AF_exports = /* @__PURE__ */ __exportAll({
|
|
7
7
|
n: () => AuditLogCollection_exports,
|
|
8
8
|
r: () => AuditLog,
|
|
9
9
|
t: () => AuditLogCollection
|
|
10
10
|
});
|
|
11
11
|
var __defProp = Object.defineProperty;
|
|
12
12
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
configurable: true,
|
|
16
|
+
writable: true,
|
|
17
|
+
value
|
|
18
|
+
}) : obj[key] = value;
|
|
13
19
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
14
20
|
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
15
21
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
16
22
|
if (kind && result) __defProp(target, key, result);
|
|
17
23
|
return result;
|
|
18
24
|
};
|
|
25
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
19
26
|
var AuditLog = class extends SmrtObject {
|
|
20
27
|
tenantId = null;
|
|
21
28
|
profileId;
|
|
@@ -23,14 +30,13 @@ var AuditLog = class extends SmrtObject {
|
|
|
23
30
|
* Action performed (e.g., 'issue.update', 'feedback.incorporate')
|
|
24
31
|
*/
|
|
25
32
|
action = "";
|
|
26
|
-
/**
|
|
27
|
-
|
|
28
|
-
*/
|
|
33
|
+
/** Optional explanation supplied by the caller. */
|
|
34
|
+
reason = "";
|
|
35
|
+
/** Public field changes only; sensitive values must never be supplied. */
|
|
36
|
+
changes = {};
|
|
29
37
|
resourceType = "";
|
|
30
|
-
/**
|
|
31
|
-
* ID of the affected resource
|
|
32
|
-
*/
|
|
33
38
|
resourceId = "";
|
|
39
|
+
occurredAt = /* @__PURE__ */ new Date();
|
|
34
40
|
/**
|
|
35
41
|
* Source of the action
|
|
36
42
|
*/
|
|
@@ -44,6 +50,8 @@ var AuditLog = class extends SmrtObject {
|
|
|
44
50
|
super(options);
|
|
45
51
|
if (options.profileId) this.profileId = options.profileId;
|
|
46
52
|
if (options.action) this.action = options.action;
|
|
53
|
+
if (options.reason !== void 0) this.reason = options.reason;
|
|
54
|
+
if (options.changes !== void 0) this.changes = options.changes;
|
|
47
55
|
if (options.resourceType) this.resourceType = options.resourceType;
|
|
48
56
|
if (options.resourceId) this.resourceId = options.resourceId;
|
|
49
57
|
if (options.source) this.source = options.source;
|
|
@@ -85,17 +93,25 @@ var AuditLog = class extends SmrtObject {
|
|
|
85
93
|
return log;
|
|
86
94
|
}
|
|
87
95
|
};
|
|
96
|
+
__publicField(AuditLog, "__smrtPackage__", "@happyvertical/smrt-profiles");
|
|
88
97
|
__decorateClass([tenantId({ nullable: true })], AuditLog.prototype, "tenantId", 2);
|
|
89
98
|
__decorateClass([foreignKey("Profile", { required: true })], AuditLog.prototype, "profileId", 2);
|
|
99
|
+
__decorateClass([field({ indexed: true })], AuditLog.prototype, "resourceType", 2);
|
|
100
|
+
__decorateClass([field({ indexed: true })], AuditLog.prototype, "resourceId", 2);
|
|
101
|
+
__decorateClass([field({
|
|
102
|
+
indexed: true,
|
|
103
|
+
default: "current_timestamp"
|
|
104
|
+
})], AuditLog.prototype, "occurredAt", 2);
|
|
90
105
|
__decorateClass([foreignKey("Profile", { nullable: true })], AuditLog.prototype, "onBehalfOfId", 2);
|
|
91
106
|
AuditLog = __decorateClass([TenantScoped({
|
|
92
107
|
mode: "optional",
|
|
93
108
|
allowSuperAdminBypass: true
|
|
94
109
|
}), smrt({
|
|
95
110
|
tableName: "audit_logs",
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
111
|
+
sensitive: true,
|
|
112
|
+
api: false,
|
|
113
|
+
mcp: false,
|
|
114
|
+
cli: false
|
|
99
115
|
})], AuditLog);
|
|
100
116
|
var AuditLogCollection_exports = /* @__PURE__ */ __exportAll$1({ AuditLogCollection: () => AuditLogCollection });
|
|
101
117
|
var AuditLogCollection = class extends SmrtCollection {
|
|
@@ -156,6 +172,8 @@ var AuditLogCollection = class extends SmrtCollection {
|
|
|
156
172
|
...this.options,
|
|
157
173
|
profileId: options.profile.id,
|
|
158
174
|
action: options.action,
|
|
175
|
+
reason: options.reason,
|
|
176
|
+
changes: options.changes,
|
|
159
177
|
resourceType: options.resourceType,
|
|
160
178
|
resourceId: options.resourceId,
|
|
161
179
|
source: options.source || "web",
|
|
@@ -190,4 +208,4 @@ var AuditLogCollection = class extends SmrtCollection {
|
|
|
190
208
|
}
|
|
191
209
|
};
|
|
192
210
|
//#endregion
|
|
193
|
-
export { AuditLogCollection as n,
|
|
211
|
+
export { AuditLogCollection as n, AuditLogCollection_WDHL__AF_exports as r, AuditLog as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SmrtObject, field, foreignKey, smrt } from "@happyvertical/smrt-core";
|
|
2
2
|
import { createCipheriv, createDecipheriv, createHash, hkdfSync, randomBytes } from "node:crypto";
|
|
3
|
-
//#region ../profiles/dist/chunks/NostrIdentity-
|
|
3
|
+
//#region ../profiles/dist/chunks/NostrIdentity-AC8fAdxe.js
|
|
4
4
|
var __defProp$1 = Object.defineProperty;
|
|
5
5
|
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
6
6
|
var __exportAll = (all, no_symbols) => {
|
|
@@ -4038,12 +4038,19 @@ function privkeyToNsec(privkey) {
|
|
|
4038
4038
|
}
|
|
4039
4039
|
var __defProp = Object.defineProperty;
|
|
4040
4040
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4041
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
|
|
4042
|
+
enumerable: true,
|
|
4043
|
+
configurable: true,
|
|
4044
|
+
writable: true,
|
|
4045
|
+
value
|
|
4046
|
+
}) : obj[key] = value;
|
|
4041
4047
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
4042
4048
|
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
4043
4049
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
4044
4050
|
if (kind && result) __defProp(target, key, result);
|
|
4045
4051
|
return result;
|
|
4046
4052
|
};
|
|
4053
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4047
4054
|
var NostrIdentity = class extends SmrtObject {
|
|
4048
4055
|
profileId;
|
|
4049
4056
|
pubkey = "";
|
|
@@ -4097,21 +4104,21 @@ var NostrIdentity = class extends SmrtObject {
|
|
|
4097
4104
|
* Find identity by public key
|
|
4098
4105
|
*/
|
|
4099
4106
|
static async findByPubkey(pubkey, options = {}) {
|
|
4100
|
-
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-
|
|
4107
|
+
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-CctlECpX-fkAPnK02.js").then((n) => n.n).then((n) => n.n);
|
|
4101
4108
|
return await (await NostrIdentityCollection.create(options)).findOne({ where: { pubkey } });
|
|
4102
4109
|
}
|
|
4103
4110
|
/**
|
|
4104
4111
|
* Find identity by email
|
|
4105
4112
|
*/
|
|
4106
4113
|
static async findByEmail(email, options = {}) {
|
|
4107
|
-
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-
|
|
4114
|
+
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-CctlECpX-fkAPnK02.js").then((n) => n.n).then((n) => n.n);
|
|
4108
4115
|
return await (await NostrIdentityCollection.create(options)).findOne({ where: { email: email.toLowerCase() } });
|
|
4109
4116
|
}
|
|
4110
4117
|
/**
|
|
4111
4118
|
* Find identity by NIP-05 username
|
|
4112
4119
|
*/
|
|
4113
4120
|
static async findByNip05(username, options = {}) {
|
|
4114
|
-
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-
|
|
4121
|
+
const { NostrIdentityCollection } = await import("./NostrIdentityCollection-CctlECpX-fkAPnK02.js").then((n) => n.n).then((n) => n.n);
|
|
4115
4122
|
return await (await NostrIdentityCollection.create(options)).findOne({ where: { nip05Username: username.toLowerCase() } });
|
|
4116
4123
|
}
|
|
4117
4124
|
/**
|
|
@@ -4176,6 +4183,7 @@ var NostrIdentity = class extends SmrtObject {
|
|
|
4176
4183
|
return `${this.nip05Username || this.email.split("@")[0]}@${domain}`;
|
|
4177
4184
|
}
|
|
4178
4185
|
};
|
|
4186
|
+
__publicField(NostrIdentity, "__smrtPackage__", "@happyvertical/smrt-profiles");
|
|
4179
4187
|
__decorateClass([foreignKey("Profile", { required: true })], NostrIdentity.prototype, "profileId", 2);
|
|
4180
4188
|
__decorateClass([field({ indexed: true })], NostrIdentity.prototype, "pubkey", 2);
|
|
4181
4189
|
NostrIdentity = __decorateClass([smrt({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { n as __exportAll$1, o as encryptPrivkey, s as generateNostrKeypair, t as NostrIdentity } from "./NostrIdentity-
|
|
2
|
+
import { n as __exportAll$1, o as encryptPrivkey, s as generateNostrKeypair, t as NostrIdentity } from "./NostrIdentity-AC8fAdxe-DKxKyu_a.js";
|
|
3
3
|
import { SmrtCollection } from "@happyvertical/smrt-core";
|
|
4
|
-
//#region ../profiles/dist/chunks/NostrIdentityCollection-
|
|
5
|
-
var
|
|
4
|
+
//#region ../profiles/dist/chunks/NostrIdentityCollection-CctlECpX.js
|
|
5
|
+
var NostrIdentityCollection_CctlECpX_exports = /* @__PURE__ */ __exportAll({
|
|
6
6
|
n: () => NostrIdentityCollection_exports,
|
|
7
7
|
t: () => NostrIdentityCollection
|
|
8
8
|
});
|
|
@@ -124,4 +124,4 @@ var NostrIdentityCollection = class extends SmrtCollection {
|
|
|
124
124
|
}
|
|
125
125
|
};
|
|
126
126
|
//#endregion
|
|
127
|
-
export {
|
|
127
|
+
export { NostrIdentityCollection_CctlECpX_exports as n, NostrIdentityCollection as t };
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import { SmrtObject, field, foreignKey, smrt } from "@happyvertical/smrt-core";
|
|
2
|
-
//#region ../profiles/dist/chunks/OidcIdentity-
|
|
2
|
+
//#region ../profiles/dist/chunks/OidcIdentity-BjRu3n1g.js
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
configurable: true,
|
|
8
|
+
writable: true,
|
|
9
|
+
value
|
|
10
|
+
}) : obj[key] = value;
|
|
5
11
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
6
12
|
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
7
13
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
14
|
if (kind && result) __defProp(target, key, result);
|
|
9
15
|
return result;
|
|
10
16
|
};
|
|
17
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
11
18
|
var OidcIdentity = class extends SmrtObject {
|
|
12
19
|
profileId;
|
|
13
20
|
provider = "";
|
|
@@ -35,7 +42,7 @@ var OidcIdentity = class extends SmrtObject {
|
|
|
35
42
|
* Find identity by issuer and subject
|
|
36
43
|
*/
|
|
37
44
|
static async findBySubject(issuer, subject, options = {}) {
|
|
38
|
-
const { OidcIdentityCollection } = await import("./OidcIdentityCollection-
|
|
45
|
+
const { OidcIdentityCollection } = await import("./OidcIdentityCollection-B4jYh36_-By9emBa2.js").then((n) => n.r).then((n) => n.r);
|
|
39
46
|
return await (await OidcIdentityCollection.create(options)).findBySubject(issuer, subject);
|
|
40
47
|
}
|
|
41
48
|
/** Build the collision-free natural key for one OIDC issuer subject. */
|
|
@@ -58,7 +65,7 @@ var OidcIdentity = class extends SmrtObject {
|
|
|
58
65
|
static async findOrCreate(profile, oidcData, options = {}) {
|
|
59
66
|
const profileId = profile.id;
|
|
60
67
|
if (typeof profileId !== "string" || !profileId) throw new Error("OidcIdentity.findOrCreate() requires a saved Profile.");
|
|
61
|
-
const { reuseExistingOidcIdentityForProfile } = await import("./resolveIdentity-
|
|
68
|
+
const { reuseExistingOidcIdentityForProfile } = await import("./resolveIdentity-CvGDegU6--sWLCFfc.js").then((n) => n.i).then((n) => n.i);
|
|
62
69
|
const profileOptions = profile.options ?? {};
|
|
63
70
|
return (await reuseExistingOidcIdentityForProfile(profileId, {
|
|
64
71
|
email: oidcData.email,
|
|
@@ -86,6 +93,7 @@ var OidcIdentity = class extends SmrtObject {
|
|
|
86
93
|
}
|
|
87
94
|
}
|
|
88
95
|
};
|
|
96
|
+
__publicField(OidcIdentity, "__smrtPackage__", "@happyvertical/smrt-profiles");
|
|
89
97
|
__decorateClass([foreignKey("Profile", { required: true })], OidcIdentity.prototype, "profileId", 2);
|
|
90
98
|
__decorateClass([field({ type: "text" })], OidcIdentity.prototype, "provider", 2);
|
|
91
99
|
__decorateClass([field({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { n as __exportAll$1 } from "./NostrIdentity-
|
|
3
|
-
import { t as OidcIdentity } from "./OidcIdentity-
|
|
2
|
+
import { n as __exportAll$1 } from "./NostrIdentity-AC8fAdxe-DKxKyu_a.js";
|
|
3
|
+
import { t as OidcIdentity } from "./OidcIdentity-BjRu3n1g-DLxby4jH.js";
|
|
4
4
|
import { SmrtCollection } from "@happyvertical/smrt-core";
|
|
5
|
-
//#region ../profiles/dist/chunks/OidcIdentityCollection-
|
|
6
|
-
var
|
|
5
|
+
//#region ../profiles/dist/chunks/OidcIdentityCollection-B4jYh36_.js
|
|
6
|
+
var OidcIdentityCollection_B4jYh36__exports = /* @__PURE__ */ __exportAll({
|
|
7
7
|
n: () => OidcIdentityCollection,
|
|
8
8
|
r: () => OidcIdentityCollection_exports,
|
|
9
9
|
t: () => AmbiguousOidcIdentityError
|
|
@@ -83,4 +83,4 @@ var OidcIdentityCollection = class extends SmrtCollection {
|
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
85
|
//#endregion
|
|
86
|
-
export { OidcIdentityCollection as n,
|
|
86
|
+
export { OidcIdentityCollection as n, OidcIdentityCollection_B4jYh36__exports as r, AmbiguousOidcIdentityError as t };
|
|
@@ -1,22 +1,29 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { i as tenantId, r as TenantScoped } from "./dist-
|
|
3
|
-
import { n as __exportAll$1 } from "./NostrIdentity-
|
|
4
|
-
import { a as getOwnedAssetsFromCollection, o as removeOwnedAssetFromCollection, t as addOwnedAssetFromCollection } from "./dist-
|
|
2
|
+
import { i as tenantId, r as TenantScoped } from "./dist-Bzshoi-0.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-BJgUA7Bn.js";
|
|
5
5
|
import { SmrtJunction, SmrtObject, crossPackageRef, field, foreignKey, smrt } from "@happyvertical/smrt-core";
|
|
6
|
-
//#region ../profiles/dist/chunks/ProfileAssetCollection-
|
|
7
|
-
var
|
|
6
|
+
//#region ../profiles/dist/chunks/ProfileAssetCollection-HeMtjBc0.js
|
|
7
|
+
var ProfileAssetCollection_HeMtjBc0_exports = /* @__PURE__ */ __exportAll({
|
|
8
8
|
n: () => ProfileAssetCollection_exports,
|
|
9
9
|
r: () => ProfileAsset,
|
|
10
10
|
t: () => ProfileAssetCollection
|
|
11
11
|
});
|
|
12
12
|
var __defProp$1 = Object.defineProperty;
|
|
13
13
|
var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
|
|
14
|
+
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
configurable: true,
|
|
17
|
+
writable: true,
|
|
18
|
+
value
|
|
19
|
+
}) : obj[key] = value;
|
|
14
20
|
var __decorateClass$1 = (decorators, target, key, kind) => {
|
|
15
21
|
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
|
|
16
22
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
17
23
|
if (kind && result) __defProp$1(target, key, result);
|
|
18
24
|
return result;
|
|
19
25
|
};
|
|
26
|
+
var __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
20
27
|
var ProfileAsset = class extends SmrtObject {
|
|
21
28
|
tenantId = null;
|
|
22
29
|
profileId = "";
|
|
@@ -32,6 +39,7 @@ var ProfileAsset = class extends SmrtObject {
|
|
|
32
39
|
if (options.tenantId !== void 0) this.tenantId = options.tenantId;
|
|
33
40
|
}
|
|
34
41
|
};
|
|
42
|
+
__publicField$1(ProfileAsset, "__smrtPackage__", "@happyvertical/smrt-profiles");
|
|
35
43
|
__decorateClass$1([tenantId({ nullable: true })], ProfileAsset.prototype, "tenantId", 2);
|
|
36
44
|
__decorateClass$1([foreignKey("Profile", {
|
|
37
45
|
required: true,
|
|
@@ -76,7 +84,7 @@ var ProfileAssetCollection = class extends SmrtJunction {
|
|
|
76
84
|
profileCollectionPromise = null;
|
|
77
85
|
async getProfileCollection() {
|
|
78
86
|
if (!this.profileCollectionPromise) {
|
|
79
|
-
const { ProfileCollection } = await import("./ProfileCollection-
|
|
87
|
+
const { ProfileCollection } = await import("./ProfileCollection-Bt6IJK49-B1_oDwPG.js").then((n) => n.o).then((n) => n.r);
|
|
80
88
|
this.profileCollectionPromise = ProfileCollection.create({ db: this.db });
|
|
81
89
|
}
|
|
82
90
|
return this.profileCollectionPromise;
|
|
@@ -91,6 +99,7 @@ var ProfileAssetCollection = class extends SmrtJunction {
|
|
|
91
99
|
await removeOwnedAssetFromCollection(await this.getProfileCollection(), "Profile", profileId, assetId, relationship);
|
|
92
100
|
}
|
|
93
101
|
};
|
|
102
|
+
__publicField(ProfileAssetCollection, "__smrtPackage__", "@happyvertical/smrt-profiles");
|
|
94
103
|
__publicField(ProfileAssetCollection, "_itemClass", ProfileAsset);
|
|
95
104
|
ProfileAssetCollection = __decorateClass([smrt({
|
|
96
105
|
api: false,
|
|
@@ -98,4 +107,4 @@ ProfileAssetCollection = __decorateClass([smrt({
|
|
|
98
107
|
cli: false
|
|
99
108
|
})], ProfileAssetCollection);
|
|
100
109
|
//#endregion
|
|
101
|
-
export { ProfileAssetCollection as n,
|
|
110
|
+
export { ProfileAssetCollection as n, ProfileAssetCollection_HeMtjBc0_exports as r, ProfileAsset as t };
|