@happyvertical/smrt-users 0.46.0 → 0.47.1

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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as MembershipOverride, B as RolePermissionCollection, C as decodeOidcTransaction, Ct as OverrideEffect, Dt as UserStatus, E as resolveOidcProviderConfig, Et as TenantStatus, F as TenantCollection, G as registerPermissionDefinitions, H as deriveOperationPermissionCollectionName, I as TenantHierarchyError, J as RoleCollection, K as syncPermissionCatalog, L as MAX_TENANT_HIERARCHY_DEPTH, M as backfillUserEmailKeys, N as TenantPermissionOverrideCollection, O as OidcProvisioningError, Ot as UsersCliAuthRequest, P as TenantPermissionOverride, Q as MembershipOverrideCollection, R as Tenant, S as OidcLoginService, St as MembershipStatus, T as getUsersOidcConfig, Tt as TenantPermissionEffect, U as deriveOperationPermissionSlug, V as PermissionCatalogService, W as normalizeOperationPermissionAction, X as PermissionCollection, Y as Role, Z as Permission, _ as readMobileBearerToken, _t as generateSessionId, a as TerminalAuthRateLimitError, at as GroupMember, b as PermissionResolver, bt as DEFAULT_ROLE_SLUGS, c as assertOperationPermission, ct as UsersCliAuthApproveLimitCollection, d as getCurrentSessionPermissionContext, dt as isValidEmail, et as MembershipCollection, f as getRequestScopedDatabase, ft as normalizeEmail, g as MobileAuthService, gt as Session, h as MobileAuthError, ht as DEFAULT_SESSION_TTL, i as TerminalAuthError, it as GroupMemberCollection, j as UserEmailKeyBackfillError, k as UserCollection, l as checkOperationPermission, lt as UsersCliAuthApproveLimit, m as withSessionPermissionContext, mt as SessionCollection, n as DEFAULT_CLI_AUTH_REQUEST_TTL_SECONDS, nt as GroupRoleCollection, o as TerminalAuthService, ot as GroupCollection, p as withPrincipalPermissionContext, pt as UsersCliAuthRequestCollection, q as RolePermission, r as DEFAULT_CLI_SESSION_TTL_SECONDS, rt as GroupRole, s as OperationPermissionError, st as Group, t as DEFAULT_CLI_AUTH_POLL_INTERVAL_SECONDS, tt as Membership, u as hasOperationPermission, ut as User, v as validateMobileRedirectUri, vt as AccessRequestStatus, w as encodeOidcTransaction, wt as SessionStatus, x as OidcLoginError, xt as DEFAULT_TENANT_POLICY, y as SessionService, yt as DEFAULT_ROLES, z as DEFAULT_ROLE_PERMISSION_PATTERNS } from "./chunks/TerminalAuthService-C7z3uZ4w.js";
1
+ import { $ as MembershipOverride, B as RolePermissionCollection, C as decodeOidcTransaction, Ct as OverrideEffect, Dt as UserStatus, E as resolveOidcProviderConfig, Et as TenantStatus, F as TenantCollection, G as registerPermissionDefinitions, H as deriveOperationPermissionCollectionName, I as TenantHierarchyError, J as RoleCollection, K as syncPermissionCatalog, L as MAX_TENANT_HIERARCHY_DEPTH, M as backfillUserEmailKeys, N as TenantPermissionOverrideCollection, O as OidcProvisioningError, Ot as UsersCliAuthRequest, P as TenantPermissionOverride, Q as MembershipOverrideCollection, R as Tenant, S as OidcLoginService, St as MembershipStatus, T as getUsersOidcConfig, Tt as TenantPermissionEffect, U as deriveOperationPermissionSlug, V as PermissionCatalogService, W as normalizeOperationPermissionAction, X as PermissionCollection, Y as Role, Z as Permission, _ as readMobileBearerToken, _t as generateSessionId, a as TerminalAuthRateLimitError, at as GroupMember, b as PermissionResolver, bt as DEFAULT_ROLE_SLUGS, c as assertOperationPermission, ct as UsersCliAuthApproveLimitCollection, d as getCurrentSessionPermissionContext, dt as isValidEmail, et as MembershipCollection, f as getRequestScopedDatabase, ft as normalizeEmail, g as MobileAuthService, gt as Session, h as MobileAuthError, ht as DEFAULT_SESSION_TTL, i as TerminalAuthError, it as GroupMemberCollection, j as UserEmailKeyBackfillError, k as UserCollection, l as checkOperationPermission, lt as UsersCliAuthApproveLimit, m as withSessionPermissionContext, mt as SessionCollection, n as DEFAULT_CLI_AUTH_REQUEST_TTL_SECONDS, nt as GroupRoleCollection, o as TerminalAuthService, ot as GroupCollection, p as withPrincipalPermissionContext, pt as UsersCliAuthRequestCollection, q as RolePermission, r as DEFAULT_CLI_SESSION_TTL_SECONDS, rt as GroupRole, s as OperationPermissionError, st as Group, t as DEFAULT_CLI_AUTH_POLL_INTERVAL_SECONDS, tt as Membership, u as hasOperationPermission, ut as User, v as validateMobileRedirectUri, vt as AccessRequestStatus, w as encodeOidcTransaction, wt as SessionStatus, x as OidcLoginError, xt as DEFAULT_TENANT_POLICY, y as SessionService, yt as DEFAULT_ROLES, z as DEFAULT_ROLE_PERMISSION_PATTERNS } from "./chunks/TerminalAuthService-CCnWsOuL.js";
2
2
  import { ObjectRegistry, SmrtCollection, SmrtObject, field, findManifestEntryByQualifiedName, isUniqueViolationError, registerRetentionTask, smrt, unregisterRetentionTask } from "@happyvertical/smrt-core";
3
3
  import { PROFILE_EMAIL_KEY_BACKFILL_NAME, Person, ProfileCollection, ProfileTypeCollection, normalizeIdentityEmail } from "@happyvertical/smrt-profiles";
4
4
  import { createHash } from "node:crypto";
@@ -1075,7 +1075,7 @@ var MagicLinkService = class MagicLinkService {
1075
1075
  * The caller is responsible for emailing the token to the user.
1076
1076
  */
1077
1077
  async generate(email) {
1078
- const { SignJWT } = await import("./chunks/TerminalAuthService-C7z3uZ4w.js").then((n) => n.D);
1078
+ const { SignJWT } = await import("./chunks/TerminalAuthService-CCnWsOuL.js").then((n) => n.D);
1079
1079
  const key = await this.getSigningKey();
1080
1080
  const nonce = crypto.randomUUID();
1081
1081
  const normalizedEmail = normalizeEmail(email);
@@ -1104,7 +1104,7 @@ var MagicLinkService = class MagicLinkService {
1104
1104
  * @throws {MagicLinkError} If the token is invalid, expired, or already used
1105
1105
  */
1106
1106
  async verify(token) {
1107
- const { jwtVerify, errors } = await import("./chunks/TerminalAuthService-C7z3uZ4w.js").then((n) => n.D);
1107
+ const { jwtVerify, errors } = await import("./chunks/TerminalAuthService-CCnWsOuL.js").then((n) => n.D);
1108
1108
  const key = await this.getSigningKey();
1109
1109
  let payload;
1110
1110
  try {
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-users",
5
- "packageVersion": "0.46.0",
5
+ "packageVersion": "0.47.1",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-users:AccessRequestCollection": {
8
8
  "name": "accessrequestcollection",
@@ -136,7 +136,11 @@
136
136
  {
137
137
  "name": "input",
138
138
  "type": "object",
139
- "optional": false
139
+ "optional": false,
140
+ "memberTypes": [
141
+ "number",
142
+ "string"
143
+ ]
140
144
  }
141
145
  ],
142
146
  "returnType": "Promise<CliAuthApproveReservation>",
@@ -291,7 +295,10 @@
291
295
  {
292
296
  "name": "options",
293
297
  "type": "object",
294
- "optional": true
298
+ "optional": true,
299
+ "memberTypes": [
300
+ "boolean"
301
+ ]
295
302
  }
296
303
  ],
297
304
  "returnType": "Promise<number>",
@@ -855,7 +862,10 @@
855
862
  {
856
863
  "name": "options",
857
864
  "type": "object",
858
- "optional": true
865
+ "optional": true,
866
+ "memberTypes": [
867
+ "boolean"
868
+ ]
859
869
  }
860
870
  ],
861
871
  "returnType": "Promise<number>",
@@ -1372,7 +1382,10 @@
1372
1382
  {
1373
1383
  "name": "defaults",
1374
1384
  "type": "Partial<object>",
1375
- "optional": true
1385
+ "optional": true,
1386
+ "memberTypes": [
1387
+ "string"
1388
+ ]
1376
1389
  }
1377
1390
  ],
1378
1391
  "returnType": "Promise<Permission>",
@@ -1901,7 +1914,10 @@
1901
1914
  {
1902
1915
  "name": "options",
1903
1916
  "type": "object",
1904
- "optional": true
1917
+ "optional": true,
1918
+ "memberTypes": [
1919
+ "boolean"
1920
+ ]
1905
1921
  }
1906
1922
  ],
1907
1923
  "returnType": "Promise<number>",
@@ -1934,7 +1950,15 @@
1934
1950
  {
1935
1951
  "name": "tenantId",
1936
1952
  "type": "string | null",
1937
- "optional": false
1953
+ "optional": false,
1954
+ "unionBranches": [
1955
+ {
1956
+ "type": "string"
1957
+ },
1958
+ {
1959
+ "type": "null"
1960
+ }
1961
+ ]
1938
1962
  }
1939
1963
  ],
1940
1964
  "returnType": "Promise<boolean>",
@@ -1957,7 +1981,7 @@
1957
1981
  },
1958
1982
  {
1959
1983
  "name": "value",
1960
- "type": "any",
1984
+ "type": "unknown",
1961
1985
  "optional": false
1962
1986
  }
1963
1987
  ],
@@ -2245,7 +2269,15 @@
2245
2269
  {
2246
2270
  "name": "newParentId",
2247
2271
  "type": "string | null",
2248
- "optional": false
2272
+ "optional": false,
2273
+ "unionBranches": [
2274
+ {
2275
+ "type": "string"
2276
+ },
2277
+ {
2278
+ "type": "null"
2279
+ }
2280
+ ]
2249
2281
  }
2250
2282
  ],
2251
2283
  "returnType": "Promise<Tenant>",
@@ -2290,7 +2322,7 @@
2290
2322
  "optional": true
2291
2323
  }
2292
2324
  ],
2293
- "returnType": "Promise<Array>",
2325
+ "returnType": "any",
2294
2326
  "isStatic": false,
2295
2327
  "isPublic": true
2296
2328
  },
@@ -2728,7 +2760,11 @@
2728
2760
  {
2729
2761
  "name": "overrides",
2730
2762
  "type": "Array<object>",
2731
- "optional": false
2763
+ "optional": false,
2764
+ "memberTypes": [
2765
+ "string",
2766
+ "TenantPermissionEffect"
2767
+ ]
2732
2768
  }
2733
2769
  ],
2734
2770
  "returnType": "Promise<TenantPermissionOverride[]>",
@@ -2893,7 +2929,10 @@
2893
2929
  {
2894
2930
  "name": "defaults",
2895
2931
  "type": "Partial<object>",
2896
- "optional": true
2932
+ "optional": true,
2933
+ "memberTypes": [
2934
+ "UserStatus"
2935
+ ]
2897
2936
  }
2898
2937
  ],
2899
2938
  "returnType": "Promise<User>",
@@ -3068,7 +3107,7 @@
3068
3107
  "name": "getRequestContext",
3069
3108
  "async": false,
3070
3109
  "parameters": [],
3071
- "returnType": "Record<string>",
3110
+ "returnType": "Record<string, unknown>",
3072
3111
  "isStatic": false,
3073
3112
  "isPublic": true
3074
3113
  },
@@ -3078,7 +3117,7 @@
3078
3117
  "parameters": [
3079
3118
  {
3080
3119
  "name": "value",
3081
- "type": "Record<string>",
3120
+ "type": "Record<string, unknown>",
3082
3121
  "optional": false
3083
3122
  }
3084
3123
  ],
@@ -3090,7 +3129,7 @@
3090
3129
  "name": "getTenantHint",
3091
3130
  "async": false,
3092
3131
  "parameters": [],
3093
- "returnType": "Record<string> | null",
3132
+ "returnType": "Record<string, unknown> | null",
3094
3133
  "isStatic": false,
3095
3134
  "isPublic": true
3096
3135
  },
@@ -3100,8 +3139,16 @@
3100
3139
  "parameters": [
3101
3140
  {
3102
3141
  "name": "value",
3103
- "type": "Record<string> | null",
3104
- "optional": false
3142
+ "type": "Record<string, unknown> | null",
3143
+ "optional": false,
3144
+ "unionBranches": [
3145
+ {
3146
+ "type": "Record<string, unknown>"
3147
+ },
3148
+ {
3149
+ "type": "null"
3150
+ }
3151
+ ]
3105
3152
  }
3106
3153
  ],
3107
3154
  "returnType": "void",
@@ -5185,7 +5232,15 @@
5185
5232
  {
5186
5233
  "name": "tenantId",
5187
5234
  "type": "string | null",
5188
- "optional": false
5235
+ "optional": false,
5236
+ "unionBranches": [
5237
+ {
5238
+ "type": "string"
5239
+ },
5240
+ {
5241
+ "type": "null"
5242
+ }
5243
+ ]
5189
5244
  }
5190
5245
  ],
5191
5246
  "returnType": "void",
@@ -5217,7 +5272,7 @@
5217
5272
  },
5218
5273
  {
5219
5274
  "name": "value",
5220
- "type": "any",
5275
+ "type": "unknown",
5221
5276
  "optional": false
5222
5277
  }
5223
5278
  ],
@@ -5684,7 +5739,7 @@
5684
5739
  "name": "initialize",
5685
5740
  "async": true,
5686
5741
  "parameters": [],
5687
- "returnType": "Promise",
5742
+ "returnType": "Promise<this>",
5688
5743
  "isStatic": false,
5689
5744
  "isPublic": true
5690
5745
  },
@@ -5703,7 +5758,15 @@
5703
5758
  {
5704
5759
  "name": "externalIds",
5705
5760
  "type": "Record<string, string> | string",
5706
- "optional": false
5761
+ "optional": false,
5762
+ "unionBranches": [
5763
+ {
5764
+ "type": "Record<string, string>"
5765
+ },
5766
+ {
5767
+ "type": "string"
5768
+ }
5769
+ ]
5707
5770
  }
5708
5771
  ],
5709
5772
  "returnType": "void",
@@ -5736,7 +5799,15 @@
5736
5799
  {
5737
5800
  "name": "value",
5738
5801
  "type": "string | undefined",
5739
- "optional": false
5802
+ "optional": false,
5803
+ "unionBranches": [
5804
+ {
5805
+ "type": "string"
5806
+ },
5807
+ {
5808
+ "type": "undefined"
5809
+ }
5810
+ ]
5740
5811
  }
5741
5812
  ],
5742
5813
  "returnType": "void",
@@ -5758,7 +5829,15 @@
5758
5829
  {
5759
5830
  "name": "summary",
5760
5831
  "type": "TenantIntegrationCheckSummary[] | string",
5761
- "optional": false
5832
+ "optional": false,
5833
+ "unionBranches": [
5834
+ {
5835
+ "type": "TenantIntegrationCheckSummary[]"
5836
+ },
5837
+ {
5838
+ "type": "string"
5839
+ }
5840
+ ]
5762
5841
  }
5763
5842
  ],
5764
5843
  "returnType": "void",
@@ -5772,7 +5851,12 @@
5772
5851
  {
5773
5852
  "name": "outcome",
5774
5853
  "type": "object",
5775
- "optional": false
5854
+ "optional": false,
5855
+ "memberTypes": [
5856
+ "TenantIntegrationStatus",
5857
+ "TenantIntegrationCheckSummary[]",
5858
+ "string | null"
5859
+ ]
5776
5860
  }
5777
5861
  ],
5778
5862
  "returnType": "void",
@@ -6179,7 +6263,7 @@
6179
6263
  "name": "save",
6180
6264
  "async": true,
6181
6265
  "parameters": [],
6182
- "returnType": "Promise",
6266
+ "returnType": "Promise<this>",
6183
6267
  "isStatic": false,
6184
6268
  "isPublic": true
6185
6269
  }