@happyvertical/smrt-users 0.51.18 → 0.51.19
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/chunks/{TerminalAuthService-C4uNNkwZ.js → TerminalAuthService-DGdJcCWx.js} +13 -8
- package/dist/chunks/TerminalAuthService-DGdJcCWx.js.map +1 -0
- package/dist/index.js +9 -8
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +1 -1
- package/dist/services/PermissionResolver.d.ts.map +1 -1
- package/dist/services/ResourceGrantService.d.ts.map +1 -1
- package/dist/services/TenantService.d.ts.map +1 -1
- package/dist/services/authorization-read-options.d.ts +15 -0
- package/dist/services/authorization-read-options.d.ts.map +1 -0
- package/dist/smrt-knowledge.json +5 -5
- package/dist/sveltekit.js +1 -1
- package/package.json +10 -10
- package/dist/chunks/TerminalAuthService-C4uNNkwZ.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as deriveOperationPermissionSlug, A as DEFAULT_ANCESTOR_READ_MAX_DEPTH, B as TenantPermissionOverride, C as OidcLoginService, Ct as UsersCliAuthRequestCollection, D as resolveOidcProviderConfig, Dt as generateSessionId, E as getUsersOidcConfig, Et as Session, F as UserCollection, G as applyTenantHierarchyUpdates, H as Tenant, J as recordTenantHierarchyChanges, K as assertTenantTableName, L as UserEmailKeyBackfillError, M as isAncestorReadableSlug, N as normalizeAncestorReadPolicy, Ot as UsersCliAuthRequest, P as OidcProvisioningError, Q as deriveOperationPermissionCollectionName, R as backfillUserEmailKeys, S as OidcLoginError, St as normalizeEmail, T as encodeOidcTransaction, Tt as DEFAULT_SESSION_TTL, U as MAX_TENANT_HIERARCHY_DEPTH, V as TenantCollection, W as TenantHierarchyError, X as RolePermissionCollection, Y as DEFAULT_ROLE_PERMISSION_PATTERNS, Z as PermissionCatalogService, _ as readMobileBearerToken, _t as Group, a as TerminalAuthRateLimitError, at as Role, b as PermissionResolver, bt as User, c as assertOperationPermission, ct as MembershipOverrideCollection, d as getCurrentSessionPermissionContext, dt as Membership, et as normalizeOperationPermissionAction, f as getRequestScopedDatabase, ft as GroupRoleCollection, g as MobileAuthService, gt as GroupCollection, h as MobileAuthError, ht as GroupMember, i as TerminalAuthError, it as RoleCollection, j as getConfiguredAncestorReadPolicy, k as ANCESTOR_READ_ACTION, l as checkOperationPermission, lt as MembershipOverride, m as withSessionPermissionContext, mt as GroupMemberCollection, n as DEFAULT_CLI_AUTH_REQUEST_TTL_SECONDS, nt as syncPermissionCatalog, o as TerminalAuthService, ot as PermissionCollection, p as withPrincipalPermissionContext, pt as GroupRole, q as planTenantHierarchy, r as DEFAULT_CLI_SESSION_TTL_SECONDS, rt as RolePermission, s as OperationPermissionError, st as Permission, t as DEFAULT_CLI_AUTH_POLL_INTERVAL_SECONDS, tt as registerPermissionDefinitions, u as hasOperationPermission, ut as MembershipCollection, v as validateMobileRedirectUri, vt as UsersCliAuthApproveLimitCollection, w as decodeOidcTransaction, wt as SessionCollection, x as withoutListBounds, xt as isValidEmail, y as SessionService, yt as UsersCliAuthApproveLimit, z as TenantPermissionOverrideCollection } from "./chunks/TerminalAuthService-DGdJcCWx.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, field, findManifestEntryByQualifiedName, foreignKey, isUniqueViolationError, registerRetentionTask, smrt, unregisterRetentionTask } from "@happyvertical/smrt-core";
|
|
4
4
|
import { PROFILE_EMAIL_KEY_BACKFILL_NAME, Person, ProfileCollection, ProfileTypeCollection, normalizeIdentityEmail } from "@happyvertical/smrt-profiles";
|
|
@@ -1194,7 +1194,7 @@ var MagicLinkService = class MagicLinkService {
|
|
|
1194
1194
|
* The caller is responsible for emailing the token to the user.
|
|
1195
1195
|
*/
|
|
1196
1196
|
async generate(email) {
|
|
1197
|
-
const { SignJWT } = await import("./chunks/TerminalAuthService-
|
|
1197
|
+
const { SignJWT } = await import("./chunks/TerminalAuthService-DGdJcCWx.js").then((n) => n.O);
|
|
1198
1198
|
const key = await this.getSigningKey();
|
|
1199
1199
|
const nonce = crypto.randomUUID();
|
|
1200
1200
|
const normalizedEmail = normalizeEmail(email);
|
|
@@ -1223,7 +1223,7 @@ var MagicLinkService = class MagicLinkService {
|
|
|
1223
1223
|
* @throws {MagicLinkError} If the token is invalid, expired, or already used
|
|
1224
1224
|
*/
|
|
1225
1225
|
async verify(token) {
|
|
1226
|
-
const { jwtVerify, errors } = await import("./chunks/TerminalAuthService-
|
|
1226
|
+
const { jwtVerify, errors } = await import("./chunks/TerminalAuthService-DGdJcCWx.js").then((n) => n.O);
|
|
1227
1227
|
const key = await this.getSigningKey();
|
|
1228
1228
|
let payload;
|
|
1229
1229
|
try {
|
|
@@ -1561,8 +1561,8 @@ async function checkResourceOperationPermission(options) {
|
|
|
1561
1561
|
allowed: false,
|
|
1562
1562
|
reason: "resource_grant_missing"
|
|
1563
1563
|
};
|
|
1564
|
-
const
|
|
1565
|
-
const
|
|
1564
|
+
const collection = await ResourceGrantCollection.create(withoutListBounds(options));
|
|
1565
|
+
const grants = await collection.findExact(options.resource.tenantId, userId, options.resource.resourceType, options.resource.resourceId, tenant.permission);
|
|
1566
1566
|
const active = [];
|
|
1567
1567
|
for (const grant2 of grants) if (await hasActiveAncestors(collection, grant2)) active.push(grant2);
|
|
1568
1568
|
const deny = active.find((grant2) => grant2.effect === "deny");
|
|
@@ -1672,9 +1672,10 @@ var TenantService = class TenantService {
|
|
|
1672
1672
|
* Initialize collections
|
|
1673
1673
|
*/
|
|
1674
1674
|
async initialize() {
|
|
1675
|
-
|
|
1676
|
-
this.
|
|
1677
|
-
this.
|
|
1675
|
+
const options = withoutListBounds(this.options);
|
|
1676
|
+
this.tenantCollection = await TenantCollection.create(options);
|
|
1677
|
+
this.membershipCollection = await MembershipCollection.create(options);
|
|
1678
|
+
this.roleCollection = await RoleCollection.create(options);
|
|
1678
1679
|
await this.roleCollection.seedSystemRoles();
|
|
1679
1680
|
}
|
|
1680
1681
|
/**
|