@happyvertical/smrt-users 0.44.0 → 0.45.0

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 MembershipCollection, A as UserEmailKeyBackfillError, B as PermissionCatalogService, C as decodeOidcTransaction, Ct as SessionStatus, Dt as UsersCliAuthRequest, E as resolveOidcProviderConfig, Et as UserStatus, F as TenantHierarchyError, G as syncPermissionCatalog, H as deriveOperationPermissionSlug, I as MAX_TENANT_HIERARCHY_DEPTH, J as Role, K as RolePermission, L as Tenant, M as TenantPermissionOverrideCollection, N as TenantPermissionOverride, O as OidcProvisioningError, P as TenantCollection, Q as MembershipOverride, R as DEFAULT_ROLE_PERMISSION_PATTERNS, S as OidcLoginService, St as OverrideEffect, T as getUsersOidcConfig, Tt as TenantStatus, U as normalizeOperationPermissionAction, V as deriveOperationPermissionCollectionName, W as registerPermissionDefinitions, X as Permission, Y as PermissionCollection, Z as MembershipOverrideCollection, _ as readMobileBearerToken, _t as AccessRequestStatus, a as TerminalAuthRateLimitError, at as GroupCollection, b as PermissionResolver, bt as DEFAULT_TENANT_POLICY, c as assertOperationPermission, ct as UsersCliAuthApproveLimit, d as getCurrentSessionPermissionContext, dt as normalizeEmail, et as Membership, f as getRequestScopedDatabase, ft as UsersCliAuthRequestCollection, g as MobileAuthService, gt as generateSessionId, h as MobileAuthError, ht as Session, i as TerminalAuthError, it as GroupMember, j as backfillUserEmailKeys, k as UserCollection, l as checkOperationPermission, lt as User, m as withSessionPermissionContext, mt as DEFAULT_SESSION_TTL, n as DEFAULT_CLI_AUTH_REQUEST_TTL_SECONDS, nt as GroupRole, o as TerminalAuthService, ot as Group, p as withPrincipalPermissionContext, pt as SessionCollection, q as RoleCollection, r as DEFAULT_CLI_SESSION_TTL_SECONDS, rt as GroupMemberCollection, s as OperationPermissionError, st as UsersCliAuthApproveLimitCollection, t as DEFAULT_CLI_AUTH_POLL_INTERVAL_SECONDS, tt as GroupRoleCollection, u as hasOperationPermission, ut as isValidEmail, v as validateMobileRedirectUri, vt as DEFAULT_ROLES, w as encodeOidcTransaction, wt as TenantPermissionEffect, x as OidcLoginError, xt as MembershipStatus, y as SessionService, yt as DEFAULT_ROLE_SLUGS, z as RolePermissionCollection } from "./chunks/TerminalAuthService-BZ2GaC1d.js";
1
+ import { $ as MembershipCollection, A as UserEmailKeyBackfillError, B as PermissionCatalogService, C as decodeOidcTransaction, Ct as SessionStatus, Dt as UsersCliAuthRequest, E as resolveOidcProviderConfig, Et as UserStatus, F as TenantHierarchyError, G as syncPermissionCatalog, H as deriveOperationPermissionSlug, I as MAX_TENANT_HIERARCHY_DEPTH, J as Role, K as RolePermission, L as Tenant, M as TenantPermissionOverrideCollection, N as TenantPermissionOverride, O as OidcProvisioningError, P as TenantCollection, Q as MembershipOverride, R as DEFAULT_ROLE_PERMISSION_PATTERNS, S as OidcLoginService, St as OverrideEffect, T as getUsersOidcConfig, Tt as TenantStatus, U as normalizeOperationPermissionAction, V as deriveOperationPermissionCollectionName, W as registerPermissionDefinitions, X as Permission, Y as PermissionCollection, Z as MembershipOverrideCollection, _ as readMobileBearerToken, _t as AccessRequestStatus, a as TerminalAuthRateLimitError, at as GroupCollection, b as PermissionResolver, bt as DEFAULT_TENANT_POLICY, c as assertOperationPermission, ct as UsersCliAuthApproveLimit, d as getCurrentSessionPermissionContext, dt as normalizeEmail, et as Membership, f as getRequestScopedDatabase, ft as UsersCliAuthRequestCollection, g as MobileAuthService, gt as generateSessionId, h as MobileAuthError, ht as Session, i as TerminalAuthError, it as GroupMember, j as backfillUserEmailKeys, k as UserCollection, l as checkOperationPermission, lt as User, m as withSessionPermissionContext, mt as DEFAULT_SESSION_TTL, n as DEFAULT_CLI_AUTH_REQUEST_TTL_SECONDS, nt as GroupRole, o as TerminalAuthService, ot as Group, p as withPrincipalPermissionContext, pt as SessionCollection, q as RoleCollection, r as DEFAULT_CLI_SESSION_TTL_SECONDS, rt as GroupMemberCollection, s as OperationPermissionError, st as UsersCliAuthApproveLimitCollection, t as DEFAULT_CLI_AUTH_POLL_INTERVAL_SECONDS, tt as GroupRoleCollection, u as hasOperationPermission, ut as isValidEmail, v as validateMobileRedirectUri, vt as DEFAULT_ROLES, w as encodeOidcTransaction, wt as TenantPermissionEffect, x as OidcLoginError, xt as MembershipStatus, y as SessionService, yt as DEFAULT_ROLE_SLUGS, z as RolePermissionCollection } from "./chunks/TerminalAuthService-DEobPLL2.js";
2
2
  import { ObjectRegistry, SmrtCollection, SmrtObject, field, findManifestEntryByQualifiedName, isUniqueViolationError, registerRetentionTask, smrt, unregisterRetentionTask } from "@happyvertical/smrt-core";
3
3
  import { createHash } from "node:crypto";
4
4
  import { TenantScoped, tenantId } from "@happyvertical/smrt-tenancy";
@@ -953,7 +953,7 @@ var MagicLinkService = class MagicLinkService {
953
953
  * The caller is responsible for emailing the token to the user.
954
954
  */
955
955
  async generate(email) {
956
- const { SignJWT } = await import("./chunks/TerminalAuthService-BZ2GaC1d.js").then((n) => n.D);
956
+ const { SignJWT } = await import("./chunks/TerminalAuthService-DEobPLL2.js").then((n) => n.D);
957
957
  const key = await this.getSigningKey();
958
958
  const nonce = crypto.randomUUID();
959
959
  const normalizedEmail = normalizeEmail(email);
@@ -982,7 +982,7 @@ var MagicLinkService = class MagicLinkService {
982
982
  * @throws {MagicLinkError} If the token is invalid, expired, or already used
983
983
  */
984
984
  async verify(token) {
985
- const { jwtVerify, errors } = await import("./chunks/TerminalAuthService-BZ2GaC1d.js").then((n) => n.D);
985
+ const { jwtVerify, errors } = await import("./chunks/TerminalAuthService-DEobPLL2.js").then((n) => n.D);
986
986
  const key = await this.getSigningKey();
987
987
  let payload;
988
988
  try {
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-users",
5
- "packageVersion": "0.44.0",
5
+ "packageVersion": "0.45.0",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-users:AccessRequestCollection": {
8
8
  "name": "accessrequestcollection",
@@ -5430,548 +5430,6 @@
5430
5430
  }
5431
5431
  },
5432
5432
  "methods": {
5433
- "withDatabase": {
5434
- "name": "withDatabase",
5435
- "async": true,
5436
- "parameters": [
5437
- {
5438
- "name": "db",
5439
- "type": "DatabaseInterface",
5440
- "optional": false
5441
- },
5442
- {
5443
- "name": "operation",
5444
- "type": "Function",
5445
- "optional": false
5446
- }
5447
- ],
5448
- "returnType": "Promise<T>",
5449
- "isStatic": false,
5450
- "isPublic": true
5451
- },
5452
- "getAiUsageSnapshot": {
5453
- "name": "getAiUsageSnapshot",
5454
- "async": false,
5455
- "parameters": [],
5456
- "returnType": "AiUsageSnapshot | undefined",
5457
- "isStatic": false,
5458
- "isPublic": true
5459
- },
5460
- "resetAiUsage": {
5461
- "name": "resetAiUsage",
5462
- "async": false,
5463
- "parameters": [],
5464
- "returnType": "void",
5465
- "isStatic": false,
5466
- "isPublic": true
5467
- },
5468
- "listAiUsage": {
5469
- "name": "listAiUsage",
5470
- "async": true,
5471
- "parameters": [
5472
- {
5473
- "name": "options",
5474
- "type": "AiUsageListOptions",
5475
- "optional": true
5476
- }
5477
- ],
5478
- "returnType": "Promise<SmrtAiUsageRecord[]>",
5479
- "isStatic": false,
5480
- "isPublic": true
5481
- },
5482
- "summarizeAiUsage": {
5483
- "name": "summarizeAiUsage",
5484
- "async": true,
5485
- "parameters": [
5486
- {
5487
- "name": "options",
5488
- "type": "AiUsageSummaryOptions",
5489
- "optional": true
5490
- }
5491
- ],
5492
- "returnType": "Promise<Record<string, AiUsageStats>>",
5493
- "isStatic": false,
5494
- "isPublic": true
5495
- },
5496
- "destroy": {
5497
- "name": "destroy",
5498
- "async": false,
5499
- "parameters": [],
5500
- "returnType": "void",
5501
- "isStatic": false,
5502
- "isPublic": true
5503
- },
5504
- "markAsPersisted": {
5505
- "name": "markAsPersisted",
5506
- "async": false,
5507
- "parameters": [],
5508
- "returnType": "void",
5509
- "isStatic": false,
5510
- "isPublic": true
5511
- },
5512
- "requireInsertOnSave": {
5513
- "name": "requireInsertOnSave",
5514
- "async": false,
5515
- "parameters": [],
5516
- "returnType": "void",
5517
- "isStatic": false,
5518
- "isPublic": true
5519
- },
5520
- "withTransaction": {
5521
- "name": "withTransaction",
5522
- "async": true,
5523
- "parameters": [
5524
- {
5525
- "name": "operation",
5526
- "type": "Function",
5527
- "optional": false
5528
- }
5529
- ],
5530
- "returnType": "Promise<T>",
5531
- "isStatic": false,
5532
- "isPublic": true
5533
- },
5534
- "initialize": {
5535
- "name": "initialize",
5536
- "async": true,
5537
- "parameters": [],
5538
- "returnType": "Promise",
5539
- "isStatic": false,
5540
- "isPublic": true
5541
- },
5542
- "loadDataFromDb": {
5543
- "name": "loadDataFromDb",
5544
- "async": true,
5545
- "parameters": [
5546
- {
5547
- "name": "data",
5548
- "type": "Record<string>",
5549
- "optional": false
5550
- }
5551
- ],
5552
- "returnType": "any",
5553
- "isStatic": false,
5554
- "isPublic": true
5555
- },
5556
- "getFields": {
5557
- "name": "getFields",
5558
- "async": true,
5559
- "parameters": [],
5560
- "returnType": "Promise<any>",
5561
- "isStatic": false,
5562
- "isPublic": true
5563
- },
5564
- "toJSON": {
5565
- "name": "toJSON",
5566
- "async": false,
5567
- "parameters": [],
5568
- "returnType": "any",
5569
- "isStatic": false,
5570
- "isPublic": true
5571
- },
5572
- "toPlainObject": {
5573
- "name": "toPlainObject",
5574
- "async": false,
5575
- "parameters": [],
5576
- "returnType": "Record<string>",
5577
- "isStatic": false,
5578
- "isPublic": true
5579
- },
5580
- "toPublicJSON": {
5581
- "name": "toPublicJSON",
5582
- "async": false,
5583
- "parameters": [
5584
- {
5585
- "name": "options",
5586
- "type": "PublicJsonOptions",
5587
- "optional": true
5588
- }
5589
- ],
5590
- "returnType": "Record<string>",
5591
- "isStatic": false,
5592
- "isPublic": true
5593
- },
5594
- "getId": {
5595
- "name": "getId",
5596
- "async": true,
5597
- "parameters": [],
5598
- "returnType": "any",
5599
- "isStatic": false,
5600
- "isPublic": true
5601
- },
5602
- "getSlug": {
5603
- "name": "getSlug",
5604
- "async": true,
5605
- "parameters": [],
5606
- "returnType": "any",
5607
- "isStatic": false,
5608
- "isPublic": true
5609
- },
5610
- "getSavedId": {
5611
- "name": "getSavedId",
5612
- "async": true,
5613
- "parameters": [],
5614
- "returnType": "any",
5615
- "isStatic": false,
5616
- "isPublic": true
5617
- },
5618
- "isSaved": {
5619
- "name": "isSaved",
5620
- "async": true,
5621
- "parameters": [],
5622
- "returnType": "any",
5623
- "isStatic": false,
5624
- "isPublic": true
5625
- },
5626
- "save": {
5627
- "name": "save",
5628
- "async": true,
5629
- "parameters": [
5630
- {
5631
- "name": "options",
5632
- "type": "SmrtSaveOptions",
5633
- "optional": true
5634
- }
5635
- ],
5636
- "returnType": "any",
5637
- "isStatic": false,
5638
- "isPublic": true
5639
- },
5640
- "claimRevision": {
5641
- "name": "claimRevision",
5642
- "async": true,
5643
- "parameters": [
5644
- {
5645
- "name": "expectedUpdatedAt",
5646
- "type": "Date | string",
5647
- "optional": false
5648
- }
5649
- ],
5650
- "returnType": "Promise",
5651
- "isStatic": false,
5652
- "isPublic": true
5653
- },
5654
- "classifyConstraintError": {
5655
- "name": "classifyConstraintError",
5656
- "async": false,
5657
- "parameters": [
5658
- {
5659
- "name": "message",
5660
- "type": "string",
5661
- "optional": false
5662
- }
5663
- ],
5664
- "returnType": "'unique' | 'not_null' | null",
5665
- "isStatic": true,
5666
- "isPublic": true
5667
- },
5668
- "loadFromId": {
5669
- "name": "loadFromId",
5670
- "async": true,
5671
- "parameters": [],
5672
- "returnType": "any",
5673
- "isStatic": false,
5674
- "isPublic": true
5675
- },
5676
- "loadFromSlug": {
5677
- "name": "loadFromSlug",
5678
- "async": true,
5679
- "parameters": [],
5680
- "returnType": "any",
5681
- "isStatic": false,
5682
- "isPublic": true
5683
- },
5684
- "is": {
5685
- "name": "is",
5686
- "async": true,
5687
- "parameters": [
5688
- {
5689
- "name": "criteria",
5690
- "type": "string",
5691
- "optional": false
5692
- },
5693
- {
5694
- "name": "options",
5695
- "type": "AiOperationOptions",
5696
- "optional": true
5697
- }
5698
- ],
5699
- "returnType": "any",
5700
- "isStatic": false,
5701
- "isPublic": true
5702
- },
5703
- "do": {
5704
- "name": "do",
5705
- "async": true,
5706
- "parameters": [
5707
- {
5708
- "name": "instructions",
5709
- "type": "string",
5710
- "optional": false
5711
- },
5712
- {
5713
- "name": "options",
5714
- "type": "AiOperationOptions",
5715
- "optional": true
5716
- }
5717
- ],
5718
- "returnType": "any",
5719
- "isStatic": false,
5720
- "isPublic": true
5721
- },
5722
- "describe": {
5723
- "name": "describe",
5724
- "async": true,
5725
- "parameters": [
5726
- {
5727
- "name": "options",
5728
- "type": "AiOperationOptions",
5729
- "optional": true
5730
- }
5731
- ],
5732
- "returnType": "any",
5733
- "isStatic": false,
5734
- "isPublic": true
5735
- },
5736
- "delete": {
5737
- "name": "delete",
5738
- "async": true,
5739
- "parameters": [],
5740
- "returnType": "Promise<void>",
5741
- "isStatic": false,
5742
- "isPublic": true
5743
- },
5744
- "isRelatedLoaded": {
5745
- "name": "isRelatedLoaded",
5746
- "async": false,
5747
- "parameters": [
5748
- {
5749
- "name": "fieldName",
5750
- "type": "string",
5751
- "optional": false
5752
- }
5753
- ],
5754
- "returnType": "boolean",
5755
- "isStatic": false,
5756
- "isPublic": true
5757
- },
5758
- "_setLoadedRelationship": {
5759
- "name": "_setLoadedRelationship",
5760
- "async": false,
5761
- "parameters": [
5762
- {
5763
- "name": "fieldName",
5764
- "type": "string",
5765
- "optional": false
5766
- },
5767
- {
5768
- "name": "value",
5769
- "type": "any",
5770
- "optional": false
5771
- }
5772
- ],
5773
- "returnType": "void",
5774
- "isStatic": false,
5775
- "isPublic": true
5776
- },
5777
- "loadRelated": {
5778
- "name": "loadRelated",
5779
- "async": true,
5780
- "parameters": [
5781
- {
5782
- "name": "fieldName",
5783
- "type": "string",
5784
- "optional": false
5785
- },
5786
- {
5787
- "name": "opts",
5788
- "type": "LoadRelatedOptions",
5789
- "optional": true
5790
- }
5791
- ],
5792
- "returnType": "Promise<any>",
5793
- "isStatic": false,
5794
- "isPublic": true
5795
- },
5796
- "loadRelatedMany": {
5797
- "name": "loadRelatedMany",
5798
- "async": true,
5799
- "parameters": [
5800
- {
5801
- "name": "fieldName",
5802
- "type": "string",
5803
- "optional": false
5804
- },
5805
- {
5806
- "name": "opts",
5807
- "type": "LoadRelatedOptions",
5808
- "optional": true
5809
- }
5810
- ],
5811
- "returnType": "Promise<any[]>",
5812
- "isStatic": false,
5813
- "isPublic": true
5814
- },
5815
- "getRelated": {
5816
- "name": "getRelated",
5817
- "async": true,
5818
- "parameters": [
5819
- {
5820
- "name": "fieldName",
5821
- "type": "string",
5822
- "optional": false
5823
- },
5824
- {
5825
- "name": "opts",
5826
- "type": "LoadRelatedOptions",
5827
- "optional": true
5828
- }
5829
- ],
5830
- "returnType": "Promise<any>",
5831
- "isStatic": false,
5832
- "isPublic": true
5833
- },
5834
- "getAvailableTools": {
5835
- "name": "getAvailableTools",
5836
- "async": false,
5837
- "parameters": [],
5838
- "returnType": "AITool[]",
5839
- "isStatic": false,
5840
- "isPublic": true
5841
- },
5842
- "executeToolCall": {
5843
- "name": "executeToolCall",
5844
- "async": true,
5845
- "parameters": [
5846
- {
5847
- "name": "toolCall",
5848
- "type": "ToolCall",
5849
- "optional": false
5850
- }
5851
- ],
5852
- "returnType": "Promise<ToolCallResult>",
5853
- "isStatic": false,
5854
- "isPublic": true
5855
- },
5856
- "remember": {
5857
- "name": "remember",
5858
- "async": true,
5859
- "parameters": [
5860
- {
5861
- "name": "options",
5862
- "type": "object",
5863
- "optional": false
5864
- }
5865
- ],
5866
- "returnType": "Promise<void>",
5867
- "isStatic": false,
5868
- "isPublic": true
5869
- },
5870
- "recall": {
5871
- "name": "recall",
5872
- "async": true,
5873
- "parameters": [
5874
- {
5875
- "name": "options",
5876
- "type": "object",
5877
- "optional": false
5878
- }
5879
- ],
5880
- "returnType": "Promise",
5881
- "isStatic": false,
5882
- "isPublic": true
5883
- },
5884
- "recallAll": {
5885
- "name": "recallAll",
5886
- "async": true,
5887
- "parameters": [
5888
- {
5889
- "name": "options",
5890
- "type": "object",
5891
- "optional": true
5892
- }
5893
- ],
5894
- "returnType": "Promise<Map<string>>",
5895
- "isStatic": false,
5896
- "isPublic": true
5897
- },
5898
- "forget": {
5899
- "name": "forget",
5900
- "async": true,
5901
- "parameters": [
5902
- {
5903
- "name": "options",
5904
- "type": "object",
5905
- "optional": false
5906
- }
5907
- ],
5908
- "returnType": "Promise<void>",
5909
- "isStatic": false,
5910
- "isPublic": true
5911
- },
5912
- "forgetScope": {
5913
- "name": "forgetScope",
5914
- "async": true,
5915
- "parameters": [
5916
- {
5917
- "name": "options",
5918
- "type": "object",
5919
- "optional": false
5920
- }
5921
- ],
5922
- "returnType": "Promise<number>",
5923
- "isStatic": false,
5924
- "isPublic": true
5925
- },
5926
- "generateEmbeddings": {
5927
- "name": "generateEmbeddings",
5928
- "async": true,
5929
- "parameters": [
5930
- {
5931
- "name": "options",
5932
- "type": "GenerateEmbeddingsOptions",
5933
- "optional": true
5934
- }
5935
- ],
5936
- "returnType": "Promise<void>",
5937
- "isStatic": false,
5938
- "isPublic": true
5939
- },
5940
- "getEmbedding": {
5941
- "name": "getEmbedding",
5942
- "async": true,
5943
- "parameters": [
5944
- {
5945
- "name": "fieldName",
5946
- "type": "string",
5947
- "optional": false
5948
- },
5949
- {
5950
- "name": "model",
5951
- "type": "string",
5952
- "optional": true
5953
- }
5954
- ],
5955
- "returnType": "Promise<number[] | null>",
5956
- "isStatic": false,
5957
- "isPublic": true
5958
- },
5959
- "hasStaleEmbeddings": {
5960
- "name": "hasStaleEmbeddings",
5961
- "async": true,
5962
- "parameters": [],
5963
- "returnType": "Promise<boolean>",
5964
- "isStatic": false,
5965
- "isPublic": true
5966
- },
5967
- "clearEmbeddings": {
5968
- "name": "clearEmbeddings",
5969
- "async": true,
5970
- "parameters": [],
5971
- "returnType": "Promise<void>",
5972
- "isStatic": false,
5973
- "isPublic": true
5974
- },
5975
5433
  "isActive": {
5976
5434
  "name": "isActive",
5977
5435
  "async": false,