@happyvertical/smrt-users 0.55.12 → 0.55.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +5 -2
- package/dist/chunks/{TerminalAuthService-45O05z-G.js → TerminalAuthService-Btz3KcGi.js} +71 -68
- package/dist/chunks/TerminalAuthService-Btz3KcGi.js.map +1 -0
- package/dist/index.js +30 -14
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +200 -60
- package/dist/models/Group.d.ts.map +1 -1
- package/dist/models/GroupMember.d.ts.map +1 -1
- package/dist/models/GroupRole.d.ts.map +1 -1
- package/dist/models/MagicLinkToken.d.ts.map +1 -1
- package/dist/models/Membership.d.ts.map +1 -1
- package/dist/models/MembershipOverride.d.ts.map +1 -1
- package/dist/models/Permission.d.ts.map +1 -1
- package/dist/models/ResourceGrant.d.ts.map +1 -1
- package/dist/models/Role.d.ts.map +1 -1
- package/dist/models/RolePermission.d.ts.map +1 -1
- package/dist/models/Session.d.ts.map +1 -1
- package/dist/models/Tenant.d.ts.map +1 -1
- package/dist/models/TenantIntegration.d.ts.map +1 -1
- package/dist/models/TenantPermissionOverride.d.ts.map +1 -1
- package/dist/models/User.d.ts.map +1 -1
- package/dist/services/PermissionCatalogService.d.ts.map +1 -1
- package/dist/smrt-knowledge.json +146 -1690
- package/dist/sveltekit.js +1 -1
- package/package.json +11 -11
- package/dist/chunks/TerminalAuthService-45O05z-G.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as DEFAULT_LOGIN_LOCKOUT_FACTOR, $t as UsersLoginAttemptCollection, A as readMobileBearerToken, At as deriveOperationPermissionCollectionName, B as DEFAULT_PIN_MANAGE_PERMISSION, Bt as UsersPasswordCredentialCollection, C as hasOperationPermission, Ct as applyTenantHierarchyUpdates, D as withSessionPermissionContext, Dt as DEFAULT_ROLE_PERMISSION_PATTERNS, E as withPrincipalPermissionContext, Et as recordTenantHierarchyChanges, F as encodeOidcTransaction, Ft as RolePermission, G as PIN_LOGIN_KIND, Gt as GroupRoleCollection, H as DeviceCredentialForbiddenError, Ht as MembershipOverrideCollection, I as getUsersOidcConfig, It as RoleCollection, J as ensurePinPermissionsRegistered, Jt as GroupMember, K as PIN_PERMISSION_DEFINITIONS, Kt as GroupRole, L as resolveOidcProviderConfig, Lt as UsersPinCredentialCollection, M as OidcLoginError, Mt as normalizeOperationPermissionAction, N as OidcLoginService, Nt as registerPermissionDefinitions, O as MobileAuthError, Ot as RolePermissionCollection, P as decodeOidcTransaction, Pt as syncPermissionCatalog, Q as DEFAULT_LOGIN_LOCKOUT_BASE_SECONDS, Qt as UsersLoginAuditEvent, Rt as UsersPinCredential, S as checkOperationPermission, St as TenantHierarchyError, T as getRequestScopedDatabase, Tt as planTenantHierarchy, U as DeviceCredentialPolicyError, Ut as MembershipOverride, V as DeviceCredentialError, Vt as UsersPasswordCredential, W as DeviceCredentialService, Wt as MembershipCollection, X as PermissionResolver, Xt as Group, Y as SessionService, Yt as GroupCollection, Z as DEFAULT_LOGIN_ATTEMPT_WINDOW_SECONDS, Zt as UsersLoginAuditEventCollection, _ as PasswordCredentialService, _t as TenantPermissionOverrideCollection, a as TerminalAuthError, an as isValidEmail, at as LoginRateLimitError, b as OperationPermissionError, bt as Tenant, c as DEFAULT_PASSWORD_DENYLIST, cn as SESSION_DATA_KEYS, ct as DEFAULT_ANCESTOR_READ_MAX_DEPTH, d as DEFAULT_PASSWORD_MIN_LENGTH, dn as Role, dt as normalizeAncestorReadPolicy, en as UsersLoginAttempt, et as DEFAULT_LOGIN_LOCKOUT_MAX_SECONDS, f as PASSWORD_LOGIN_KIND, fn as Permission, ft as OidcProvisioningError, g as PasswordCredentialForbiddenError, gt as backfillUserEmailKeys, h as PasswordCredentialError, ht as UserEmailKeyBackfillError, i as TERMINAL_APPROVE_LOGIN_KIND, in as User, it as LoginAttemptLimiter, j as validateMobileRedirectUri, jt as deriveOperationPermissionSlug, k as MobileAuthService, kt as PermissionCatalogService, l as DEFAULT_PASSWORD_MANAGE_PERMISSION, ln as Session, lt as getConfiguredAncestorReadPolicy, m as PASSWORD_PERMISSION_DEFINITIONS, n as DEFAULT_CLI_AUTH_REQUEST_TTL_SECONDS, nn as SessionCollection, nt as DurableLoginAuditSink, o as TerminalAuthRateLimitError, on as normalizeEmail, ot as withoutListBounds, p as PASSWORD_MAX_LENGTH_CEILING, pn as Membership, pt as UserCollection, q as PinVerifier, qt as GroupMemberCollection, r as DEFAULT_CLI_SESSION_TTL_SECONDS, rn as UsersCliAuthRequest, rt as InvalidCredentialsError, s as TerminalAuthService, sn as DEFAULT_SESSION_TTL, st as ANCESTOR_READ_ACTION, t as DEFAULT_CLI_AUTH_POLL_INTERVAL_SECONDS, tn as UsersCliAuthRequestCollection, tt as DEFAULT_LOGIN_MAX_ATTEMPTS, u as DEFAULT_PASSWORD_MAX_LENGTH, un as generateSessionId, ut as isAncestorReadableSlug, v as PasswordPolicyError, vt as TenantPermissionOverride, w as getCurrentSessionPermissionContext, wt as assertTenantTableName, x as assertOperationPermission, xt as MAX_TENANT_HIERARCHY_DEPTH, y as ensurePasswordPermissionsRegistered, yt as TenantCollection, z as DEFAULT_DEVICE_PERSON_IDLE_SECONDS, zt as PermissionCollection } from "./chunks/TerminalAuthService-
|
|
1
|
+
import { $ as DEFAULT_LOGIN_LOCKOUT_FACTOR, $t as UsersLoginAttemptCollection, A as readMobileBearerToken, At as deriveOperationPermissionCollectionName, B as DEFAULT_PIN_MANAGE_PERMISSION, Bt as UsersPasswordCredentialCollection, C as hasOperationPermission, Ct as applyTenantHierarchyUpdates, D as withSessionPermissionContext, Dt as DEFAULT_ROLE_PERMISSION_PATTERNS, E as withPrincipalPermissionContext, Et as recordTenantHierarchyChanges, F as encodeOidcTransaction, Ft as RolePermission, G as PIN_LOGIN_KIND, Gt as GroupRoleCollection, H as DeviceCredentialForbiddenError, Ht as MembershipOverrideCollection, I as getUsersOidcConfig, It as RoleCollection, J as ensurePinPermissionsRegistered, Jt as GroupMember, K as PIN_PERMISSION_DEFINITIONS, Kt as GroupRole, L as resolveOidcProviderConfig, Lt as UsersPinCredentialCollection, M as OidcLoginError, Mt as normalizeOperationPermissionAction, N as OidcLoginService, Nt as registerPermissionDefinitions, O as MobileAuthError, Ot as RolePermissionCollection, P as decodeOidcTransaction, Pt as syncPermissionCatalog, Q as DEFAULT_LOGIN_LOCKOUT_BASE_SECONDS, Qt as UsersLoginAuditEvent, Rt as UsersPinCredential, S as checkOperationPermission, St as TenantHierarchyError, T as getRequestScopedDatabase, Tt as planTenantHierarchy, U as DeviceCredentialPolicyError, Ut as MembershipOverride, V as DeviceCredentialError, Vt as UsersPasswordCredential, W as DeviceCredentialService, Wt as MembershipCollection, X as PermissionResolver, Xt as Group, Y as SessionService, Yt as GroupCollection, Z as DEFAULT_LOGIN_ATTEMPT_WINDOW_SECONDS, Zt as UsersLoginAuditEventCollection, _ as PasswordCredentialService, _t as TenantPermissionOverrideCollection, a as TerminalAuthError, an as isValidEmail, at as LoginRateLimitError, b as OperationPermissionError, bt as Tenant, c as DEFAULT_PASSWORD_DENYLIST, cn as SESSION_DATA_KEYS, ct as DEFAULT_ANCESTOR_READ_MAX_DEPTH, d as DEFAULT_PASSWORD_MIN_LENGTH, dn as Role, dt as normalizeAncestorReadPolicy, en as UsersLoginAttempt, et as DEFAULT_LOGIN_LOCKOUT_MAX_SECONDS, f as PASSWORD_LOGIN_KIND, fn as Permission, ft as OidcProvisioningError, g as PasswordCredentialForbiddenError, gt as backfillUserEmailKeys, h as PasswordCredentialError, ht as UserEmailKeyBackfillError, i as TERMINAL_APPROVE_LOGIN_KIND, in as User, it as LoginAttemptLimiter, j as validateMobileRedirectUri, jt as deriveOperationPermissionSlug, k as MobileAuthService, kt as PermissionCatalogService, l as DEFAULT_PASSWORD_MANAGE_PERMISSION, ln as Session, lt as getConfiguredAncestorReadPolicy, m as PASSWORD_PERMISSION_DEFINITIONS, n as DEFAULT_CLI_AUTH_REQUEST_TTL_SECONDS, nn as SessionCollection, nt as DurableLoginAuditSink, o as TerminalAuthRateLimitError, on as normalizeEmail, ot as withoutListBounds, p as PASSWORD_MAX_LENGTH_CEILING, pn as Membership, pt as UserCollection, q as PinVerifier, qt as GroupMemberCollection, r as DEFAULT_CLI_SESSION_TTL_SECONDS, rn as UsersCliAuthRequest, rt as InvalidCredentialsError, s as TerminalAuthService, sn as DEFAULT_SESSION_TTL, st as ANCESTOR_READ_ACTION, t as DEFAULT_CLI_AUTH_POLL_INTERVAL_SECONDS, tn as UsersCliAuthRequestCollection, tt as DEFAULT_LOGIN_MAX_ATTEMPTS, u as DEFAULT_PASSWORD_MAX_LENGTH, un as generateSessionId, ut as isAncestorReadableSlug, v as PasswordPolicyError, vt as TenantPermissionOverride, w as getCurrentSessionPermissionContext, wt as assertTenantTableName, x as assertOperationPermission, xt as MAX_TENANT_HIERARCHY_DEPTH, y as ensurePasswordPermissionsRegistered, yt as TenantCollection, z as DEFAULT_DEVICE_PERSON_IDLE_SECONDS, zt as PermissionCollection } from "./chunks/TerminalAuthService-Btz3KcGi.js";
|
|
2
2
|
import { a as MembershipStatus, c as TenantPermissionEffect, i as DEFAULT_TENANT_POLICY, l as TenantStatus, n as DEFAULT_ROLES, o as OverrideEffect, r as DEFAULT_ROLE_SLUGS, s as SessionStatus, t as AccessRequestStatus, u as UserStatus } from "./chunks/types-DFqeph0R.js";
|
|
3
3
|
import { ObjectRegistry, SmrtCollection, SmrtObject, SmrtRecipe, bumpChangeFeed, ensureChangeFeedTable, field, findManifestEntryByQualifiedName, foreignKey, isEmbeddedDatabase, isUniqueViolationError, registerRetentionTask, smrt, unregisterRetentionTask, withEmbeddedWriteTransaction } from "@happyvertical/smrt-core";
|
|
4
4
|
import { PROFILE_EMAIL_KEY_BACKFILL_NAME, Person, ProfileCollection, ProfileTypeCollection, normalizeIdentityEmail } from "@happyvertical/smrt-profiles";
|
|
@@ -50,18 +50,34 @@ var ResourceGrant = class extends SmrtObject {
|
|
|
50
50
|
};
|
|
51
51
|
__publicField$4(ResourceGrant, "__smrtPackage__", "@happyvertical/smrt-users");
|
|
52
52
|
__decorateClass$4([foreignKey("Tenant", { required: true })], ResourceGrant.prototype, "tenantId", 2);
|
|
53
|
-
__decorateClass$4([foreignKey("User", { required: true })], ResourceGrant.prototype, "userId", 2);
|
|
54
|
-
__decorateClass$4([field({
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
__decorateClass$4([
|
|
59
|
-
|
|
53
|
+
__decorateClass$4([field({ description: "The person receiving this record-specific access rule." }), foreignKey("User", { required: true })], ResourceGrant.prototype, "userId", 2);
|
|
54
|
+
__decorateClass$4([field({
|
|
55
|
+
description: "The kind of record this access rule applies to.",
|
|
56
|
+
type: "text"
|
|
57
|
+
})], ResourceGrant.prototype, "resourceType", 2);
|
|
58
|
+
__decorateClass$4([field({
|
|
59
|
+
description: "The specific record covered by this access rule.",
|
|
60
|
+
type: "text"
|
|
61
|
+
})], ResourceGrant.prototype, "resourceId", 2);
|
|
62
|
+
__decorateClass$4([field({
|
|
63
|
+
description: "The action this rule allows or denies for the record.",
|
|
64
|
+
type: "text"
|
|
65
|
+
})], ResourceGrant.prototype, "permission", 2);
|
|
66
|
+
__decorateClass$4([field({
|
|
67
|
+
description: "Whether this rule grants access or denies it. Denies take precedence.",
|
|
68
|
+
type: "text"
|
|
69
|
+
})], ResourceGrant.prototype, "effect", 2);
|
|
70
|
+
__decorateClass$4([field({ description: "Whether the recipient may pass this grant on to another person." })], ResourceGrant.prototype, "canDelegate", 2);
|
|
71
|
+
__decorateClass$4([field({ description: "The earlier grant from which this access was delegated." }), foreignKey("ResourceGrant")], ResourceGrant.prototype, "parentGrantId", 2);
|
|
72
|
+
__decorateClass$4([field({
|
|
73
|
+
description: "When this access rule was revoked, if it has ended.",
|
|
74
|
+
type: "text"
|
|
75
|
+
})], ResourceGrant.prototype, "revokedAt", 2);
|
|
60
76
|
ResourceGrant = __decorateClass$4([smrt({
|
|
61
77
|
tenantScoped: true,
|
|
62
78
|
api: { include: [] },
|
|
63
79
|
mcp: { include: [] },
|
|
64
|
-
cli:
|
|
80
|
+
cli: false,
|
|
65
81
|
indexes: [{
|
|
66
82
|
name: "resource_grants_lookup_idx",
|
|
67
83
|
columns: ["tenantId", "userId"]
|
|
@@ -216,7 +232,7 @@ UsersMagicLinkToken = __decorateClass$3([smrt({
|
|
|
216
232
|
sensitive: true,
|
|
217
233
|
api: { include: [] },
|
|
218
234
|
mcp: { include: [] },
|
|
219
|
-
cli:
|
|
235
|
+
cli: false
|
|
220
236
|
})], UsersMagicLinkToken);
|
|
221
237
|
//#endregion
|
|
222
238
|
//#region src/collections/MagicLinkTokenCollection.ts
|
|
@@ -439,7 +455,7 @@ AccessRequest = __decorateClass$2([smrt({
|
|
|
439
455
|
conflictColumns: ["id"],
|
|
440
456
|
api: { include: [] },
|
|
441
457
|
mcp: { include: [] },
|
|
442
|
-
cli:
|
|
458
|
+
cli: false
|
|
443
459
|
})], AccessRequest);
|
|
444
460
|
//#endregion
|
|
445
461
|
//#region src/collections/AccessRequestCollection.ts
|
|
@@ -745,7 +761,7 @@ TenantIntegration = __decorateClass([TenantScoped({ mode: "required" }), smrt({
|
|
|
745
761
|
conflictColumns: ["tenant_id", "provider"],
|
|
746
762
|
api: { include: ["list", "get"] },
|
|
747
763
|
mcp: { include: ["list", "get"] },
|
|
748
|
-
cli: {
|
|
764
|
+
cli: { include: ["list", "get"] }
|
|
749
765
|
})], TenantIntegration);
|
|
750
766
|
//#endregion
|
|
751
767
|
//#region src/collections/TenantIntegrationCollection.ts
|
|
@@ -1476,7 +1492,7 @@ var MagicLinkService = class MagicLinkService {
|
|
|
1476
1492
|
* The caller is responsible for emailing the token to the user.
|
|
1477
1493
|
*/
|
|
1478
1494
|
async generate(email) {
|
|
1479
|
-
const { SignJWT } = await import("./chunks/TerminalAuthService-
|
|
1495
|
+
const { SignJWT } = await import("./chunks/TerminalAuthService-Btz3KcGi.js").then((n) => n.R);
|
|
1480
1496
|
const key = await this.getSigningKey();
|
|
1481
1497
|
const nonce = crypto.randomUUID();
|
|
1482
1498
|
const normalizedEmail = normalizeEmail(email);
|
|
@@ -1505,7 +1521,7 @@ var MagicLinkService = class MagicLinkService {
|
|
|
1505
1521
|
* @throws {MagicLinkError} If the token is invalid, expired, or already used
|
|
1506
1522
|
*/
|
|
1507
1523
|
async verify(token) {
|
|
1508
|
-
const { jwtVerify, errors } = await import("./chunks/TerminalAuthService-
|
|
1524
|
+
const { jwtVerify, errors } = await import("./chunks/TerminalAuthService-Btz3KcGi.js").then((n) => n.R);
|
|
1509
1525
|
const key = await this.getSigningKey();
|
|
1510
1526
|
let payload;
|
|
1511
1527
|
try {
|