@happyvertical/smrt-users 0.37.0 → 0.37.2
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 +2 -1
- package/README.md +63 -0
- package/dist/chunks/{TerminalAuthService-bY1oWeAh.js → TerminalAuthService-DcgimQYo.js} +243 -243
- package/dist/chunks/TerminalAuthService-DcgimQYo.js.map +1 -0
- package/dist/chunks/{index-DBpq-WMK.js → index-C3E55ikp.js} +3 -3
- package/dist/chunks/{index-DBpq-WMK.js.map → index-C3E55ikp.js.map} +1 -1
- package/dist/collections/AccessRequestCollection.d.ts +28 -0
- package/dist/collections/AccessRequestCollection.d.ts.map +1 -0
- package/dist/collections/index.d.ts +1 -0
- package/dist/collections/index.d.ts.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +748 -39
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +421 -2
- package/dist/models/AccessRequest.d.ts +131 -0
- package/dist/models/AccessRequest.d.ts.map +1 -0
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.d.ts.map +1 -1
- package/dist/services/AccessRequestService.d.ts +326 -0
- package/dist/services/AccessRequestService.d.ts.map +1 -0
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/smrt-knowledge.json +122 -8
- package/dist/sveltekit.js +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +9 -9
- package/dist/chunks/TerminalAuthService-bY1oWeAh.js.map +0 -1
package/dist/manifest.json
CHANGED
|
@@ -1,9 +1,125 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "1.0.0",
|
|
3
|
-
"timestamp":
|
|
3
|
+
"timestamp": 1782873366424,
|
|
4
4
|
"packageName": "@happyvertical/smrt-users",
|
|
5
|
-
"packageVersion": "0.37.
|
|
5
|
+
"packageVersion": "0.37.2",
|
|
6
6
|
"objects": {
|
|
7
|
+
"@happyvertical/smrt-users:AccessRequestCollection": {
|
|
8
|
+
"name": "accessrequestcollection",
|
|
9
|
+
"className": "AccessRequestCollection",
|
|
10
|
+
"qualifiedName": "@happyvertical/smrt-users:AccessRequestCollection",
|
|
11
|
+
"collection": "accessrequests",
|
|
12
|
+
"filePath": "/home/runner/_work/smrt/smrt/packages/users/src/collections/AccessRequestCollection.ts",
|
|
13
|
+
"packageName": "@happyvertical/smrt-users",
|
|
14
|
+
"fields": {},
|
|
15
|
+
"methods": {
|
|
16
|
+
"findByEmail": {
|
|
17
|
+
"name": "findByEmail",
|
|
18
|
+
"async": true,
|
|
19
|
+
"parameters": [
|
|
20
|
+
{
|
|
21
|
+
"name": "email",
|
|
22
|
+
"type": "string",
|
|
23
|
+
"optional": false
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"returnType": "Promise<AccessRequest[]>",
|
|
27
|
+
"isStatic": false,
|
|
28
|
+
"isPublic": true
|
|
29
|
+
},
|
|
30
|
+
"findOpenByEmail": {
|
|
31
|
+
"name": "findOpenByEmail",
|
|
32
|
+
"async": true,
|
|
33
|
+
"parameters": [
|
|
34
|
+
{
|
|
35
|
+
"name": "email",
|
|
36
|
+
"type": "string",
|
|
37
|
+
"optional": false
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"returnType": "Promise<AccessRequest | null>",
|
|
41
|
+
"isStatic": false,
|
|
42
|
+
"isPublic": true
|
|
43
|
+
},
|
|
44
|
+
"findByStatus": {
|
|
45
|
+
"name": "findByStatus",
|
|
46
|
+
"async": true,
|
|
47
|
+
"parameters": [
|
|
48
|
+
{
|
|
49
|
+
"name": "status",
|
|
50
|
+
"type": "AccessRequestStatus",
|
|
51
|
+
"optional": false
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"returnType": "Promise<AccessRequest[]>",
|
|
55
|
+
"isStatic": false,
|
|
56
|
+
"isPublic": true
|
|
57
|
+
},
|
|
58
|
+
"findOpen": {
|
|
59
|
+
"name": "findOpen",
|
|
60
|
+
"async": true,
|
|
61
|
+
"parameters": [],
|
|
62
|
+
"returnType": "Promise<AccessRequest[]>",
|
|
63
|
+
"isStatic": false,
|
|
64
|
+
"isPublic": true
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"decoratorConfig": {
|
|
68
|
+
"tableName": "access_requests"
|
|
69
|
+
},
|
|
70
|
+
"extends": "SmrtCollection",
|
|
71
|
+
"extendsTypeArg": "AccessRequest",
|
|
72
|
+
"exportName": "AccessRequestCollection",
|
|
73
|
+
"collectionExportName": "AccessRequestCollectionCollection",
|
|
74
|
+
"schema": {
|
|
75
|
+
"tableName": "access_requests",
|
|
76
|
+
"ddl": "CREATE TABLE IF NOT EXISTS \"access_requests\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
|
|
77
|
+
"columns": {
|
|
78
|
+
"id": {
|
|
79
|
+
"type": "UUID",
|
|
80
|
+
"primaryKey": true,
|
|
81
|
+
"referenceKind": "id",
|
|
82
|
+
"notNull": true
|
|
83
|
+
},
|
|
84
|
+
"slug": {
|
|
85
|
+
"type": "TEXT",
|
|
86
|
+
"notNull": true
|
|
87
|
+
},
|
|
88
|
+
"context": {
|
|
89
|
+
"type": "TEXT",
|
|
90
|
+
"notNull": true,
|
|
91
|
+
"default": ""
|
|
92
|
+
},
|
|
93
|
+
"created_at": {
|
|
94
|
+
"type": "TIMESTAMP",
|
|
95
|
+
"notNull": true,
|
|
96
|
+
"default": "current_timestamp"
|
|
97
|
+
},
|
|
98
|
+
"updated_at": {
|
|
99
|
+
"type": "TIMESTAMP",
|
|
100
|
+
"notNull": true,
|
|
101
|
+
"default": "current_timestamp"
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"indexes": [
|
|
105
|
+
{
|
|
106
|
+
"name": "access_requests_id_idx",
|
|
107
|
+
"columns": [
|
|
108
|
+
"id"
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"name": "access_requests_slug_context_idx",
|
|
113
|
+
"columns": [
|
|
114
|
+
"slug",
|
|
115
|
+
"context"
|
|
116
|
+
],
|
|
117
|
+
"unique": true
|
|
118
|
+
}
|
|
119
|
+
],
|
|
120
|
+
"version": "c7691cc2"
|
|
121
|
+
}
|
|
122
|
+
},
|
|
7
123
|
"@happyvertical/smrt-users:UsersCliAuthRequestCollection": {
|
|
8
124
|
"name": "userscliauthrequestcollection",
|
|
9
125
|
"className": "UsersCliAuthRequestCollection",
|
|
@@ -2547,6 +2663,309 @@
|
|
|
2547
2663
|
"version": "539fdcc8"
|
|
2548
2664
|
}
|
|
2549
2665
|
},
|
|
2666
|
+
"@happyvertical/smrt-users:AccessRequest": {
|
|
2667
|
+
"name": "accessrequest",
|
|
2668
|
+
"className": "AccessRequest",
|
|
2669
|
+
"qualifiedName": "@happyvertical/smrt-users:AccessRequest",
|
|
2670
|
+
"collection": "accessrequests",
|
|
2671
|
+
"filePath": "/home/runner/_work/smrt/smrt/packages/users/src/models/AccessRequest.ts",
|
|
2672
|
+
"packageName": "@happyvertical/smrt-users",
|
|
2673
|
+
"fields": {
|
|
2674
|
+
"email": {
|
|
2675
|
+
"type": "text",
|
|
2676
|
+
"required": true,
|
|
2677
|
+
"default": "",
|
|
2678
|
+
"_meta": {
|
|
2679
|
+
"required": true,
|
|
2680
|
+
"indexed": true
|
|
2681
|
+
}
|
|
2682
|
+
},
|
|
2683
|
+
"name": {
|
|
2684
|
+
"type": "text",
|
|
2685
|
+
"required": false,
|
|
2686
|
+
"_meta": {
|
|
2687
|
+
"nullable": true
|
|
2688
|
+
}
|
|
2689
|
+
},
|
|
2690
|
+
"status": {
|
|
2691
|
+
"type": "text",
|
|
2692
|
+
"required": false,
|
|
2693
|
+
"_meta": {
|
|
2694
|
+
"indexed": true
|
|
2695
|
+
}
|
|
2696
|
+
},
|
|
2697
|
+
"source": {
|
|
2698
|
+
"type": "text",
|
|
2699
|
+
"required": false,
|
|
2700
|
+
"default": "",
|
|
2701
|
+
"_meta": {
|
|
2702
|
+
"indexed": true
|
|
2703
|
+
}
|
|
2704
|
+
},
|
|
2705
|
+
"requestContext": {
|
|
2706
|
+
"type": "text",
|
|
2707
|
+
"required": false,
|
|
2708
|
+
"default": "{}"
|
|
2709
|
+
},
|
|
2710
|
+
"note": {
|
|
2711
|
+
"type": "text",
|
|
2712
|
+
"required": false,
|
|
2713
|
+
"_meta": {
|
|
2714
|
+
"nullable": true
|
|
2715
|
+
}
|
|
2716
|
+
},
|
|
2717
|
+
"requestedAt": {
|
|
2718
|
+
"type": "datetime",
|
|
2719
|
+
"required": false
|
|
2720
|
+
},
|
|
2721
|
+
"decidedAt": {
|
|
2722
|
+
"type": "datetime",
|
|
2723
|
+
"required": false,
|
|
2724
|
+
"_meta": {
|
|
2725
|
+
"nullable": true
|
|
2726
|
+
}
|
|
2727
|
+
},
|
|
2728
|
+
"decidedBy": {
|
|
2729
|
+
"type": "text",
|
|
2730
|
+
"required": false,
|
|
2731
|
+
"_meta": {
|
|
2732
|
+
"nullable": true
|
|
2733
|
+
}
|
|
2734
|
+
},
|
|
2735
|
+
"resultingUserId": {
|
|
2736
|
+
"type": "text",
|
|
2737
|
+
"required": false,
|
|
2738
|
+
"_meta": {
|
|
2739
|
+
"nullable": true
|
|
2740
|
+
}
|
|
2741
|
+
},
|
|
2742
|
+
"tenantHint": {
|
|
2743
|
+
"type": "text",
|
|
2744
|
+
"required": false,
|
|
2745
|
+
"_meta": {
|
|
2746
|
+
"nullable": true
|
|
2747
|
+
}
|
|
2748
|
+
}
|
|
2749
|
+
},
|
|
2750
|
+
"methods": {
|
|
2751
|
+
"getRequestContext": {
|
|
2752
|
+
"name": "getRequestContext",
|
|
2753
|
+
"async": false,
|
|
2754
|
+
"parameters": [],
|
|
2755
|
+
"returnType": "Record<string>",
|
|
2756
|
+
"isStatic": false,
|
|
2757
|
+
"isPublic": true
|
|
2758
|
+
},
|
|
2759
|
+
"setRequestContext": {
|
|
2760
|
+
"name": "setRequestContext",
|
|
2761
|
+
"async": false,
|
|
2762
|
+
"parameters": [
|
|
2763
|
+
{
|
|
2764
|
+
"name": "value",
|
|
2765
|
+
"type": "Record<string>",
|
|
2766
|
+
"optional": false
|
|
2767
|
+
}
|
|
2768
|
+
],
|
|
2769
|
+
"returnType": "void",
|
|
2770
|
+
"isStatic": false,
|
|
2771
|
+
"isPublic": true
|
|
2772
|
+
},
|
|
2773
|
+
"getTenantHint": {
|
|
2774
|
+
"name": "getTenantHint",
|
|
2775
|
+
"async": false,
|
|
2776
|
+
"parameters": [],
|
|
2777
|
+
"returnType": "Record<string> | null",
|
|
2778
|
+
"isStatic": false,
|
|
2779
|
+
"isPublic": true
|
|
2780
|
+
},
|
|
2781
|
+
"setTenantHint": {
|
|
2782
|
+
"name": "setTenantHint",
|
|
2783
|
+
"async": false,
|
|
2784
|
+
"parameters": [
|
|
2785
|
+
{
|
|
2786
|
+
"name": "value",
|
|
2787
|
+
"type": "Record<string> | null",
|
|
2788
|
+
"optional": false
|
|
2789
|
+
}
|
|
2790
|
+
],
|
|
2791
|
+
"returnType": "void",
|
|
2792
|
+
"isStatic": false,
|
|
2793
|
+
"isPublic": true
|
|
2794
|
+
},
|
|
2795
|
+
"isOpen": {
|
|
2796
|
+
"name": "isOpen",
|
|
2797
|
+
"async": false,
|
|
2798
|
+
"parameters": [],
|
|
2799
|
+
"returnType": "boolean",
|
|
2800
|
+
"isStatic": false,
|
|
2801
|
+
"isPublic": true
|
|
2802
|
+
},
|
|
2803
|
+
"isApproved": {
|
|
2804
|
+
"name": "isApproved",
|
|
2805
|
+
"async": false,
|
|
2806
|
+
"parameters": [],
|
|
2807
|
+
"returnType": "boolean",
|
|
2808
|
+
"isStatic": false,
|
|
2809
|
+
"isPublic": true
|
|
2810
|
+
},
|
|
2811
|
+
"isTerminal": {
|
|
2812
|
+
"name": "isTerminal",
|
|
2813
|
+
"async": false,
|
|
2814
|
+
"parameters": [],
|
|
2815
|
+
"returnType": "boolean",
|
|
2816
|
+
"isStatic": false,
|
|
2817
|
+
"isPublic": true
|
|
2818
|
+
}
|
|
2819
|
+
},
|
|
2820
|
+
"decoratorConfig": {
|
|
2821
|
+
"tableName": "access_requests",
|
|
2822
|
+
"conflictColumns": [
|
|
2823
|
+
"id"
|
|
2824
|
+
],
|
|
2825
|
+
"api": {
|
|
2826
|
+
"include": []
|
|
2827
|
+
},
|
|
2828
|
+
"mcp": {
|
|
2829
|
+
"include": []
|
|
2830
|
+
},
|
|
2831
|
+
"cli": {
|
|
2832
|
+
"include": []
|
|
2833
|
+
}
|
|
2834
|
+
},
|
|
2835
|
+
"extends": "SmrtObject",
|
|
2836
|
+
"exportName": "AccessRequest",
|
|
2837
|
+
"collectionExportName": "AccessRequestCollection",
|
|
2838
|
+
"validationRules": [
|
|
2839
|
+
{
|
|
2840
|
+
"field": "email",
|
|
2841
|
+
"rule": "required",
|
|
2842
|
+
"fieldType": "text"
|
|
2843
|
+
}
|
|
2844
|
+
],
|
|
2845
|
+
"schema": {
|
|
2846
|
+
"tableName": "access_requests",
|
|
2847
|
+
"ddl": "CREATE TABLE IF NOT EXISTS \"access_requests\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"email\" TEXT NOT NULL DEFAULT '',\n \"name\" TEXT,\n \"status\" TEXT,\n \"source\" TEXT DEFAULT '',\n \"request_context\" TEXT DEFAULT '{}',\n \"note\" TEXT,\n \"requested_at\" TIMESTAMP,\n \"decided_at\" TIMESTAMP,\n \"decided_by\" TEXT,\n \"resulting_user_id\" TEXT,\n \"tenant_hint\" TEXT\n);",
|
|
2848
|
+
"columns": {
|
|
2849
|
+
"id": {
|
|
2850
|
+
"type": "UUID",
|
|
2851
|
+
"primaryKey": true,
|
|
2852
|
+
"referenceKind": "id",
|
|
2853
|
+
"notNull": true
|
|
2854
|
+
},
|
|
2855
|
+
"slug": {
|
|
2856
|
+
"type": "TEXT",
|
|
2857
|
+
"notNull": true
|
|
2858
|
+
},
|
|
2859
|
+
"context": {
|
|
2860
|
+
"type": "TEXT",
|
|
2861
|
+
"notNull": true,
|
|
2862
|
+
"default": ""
|
|
2863
|
+
},
|
|
2864
|
+
"created_at": {
|
|
2865
|
+
"type": "TIMESTAMP",
|
|
2866
|
+
"notNull": true,
|
|
2867
|
+
"default": "current_timestamp"
|
|
2868
|
+
},
|
|
2869
|
+
"updated_at": {
|
|
2870
|
+
"type": "TIMESTAMP",
|
|
2871
|
+
"notNull": true,
|
|
2872
|
+
"default": "current_timestamp"
|
|
2873
|
+
},
|
|
2874
|
+
"email": {
|
|
2875
|
+
"type": "TEXT",
|
|
2876
|
+
"notNull": true,
|
|
2877
|
+
"unique": false,
|
|
2878
|
+
"default": ""
|
|
2879
|
+
},
|
|
2880
|
+
"name": {
|
|
2881
|
+
"type": "TEXT",
|
|
2882
|
+
"notNull": false,
|
|
2883
|
+
"unique": false
|
|
2884
|
+
},
|
|
2885
|
+
"status": {
|
|
2886
|
+
"type": "TEXT",
|
|
2887
|
+
"notNull": false,
|
|
2888
|
+
"unique": false
|
|
2889
|
+
},
|
|
2890
|
+
"source": {
|
|
2891
|
+
"type": "TEXT",
|
|
2892
|
+
"notNull": false,
|
|
2893
|
+
"unique": false,
|
|
2894
|
+
"default": ""
|
|
2895
|
+
},
|
|
2896
|
+
"request_context": {
|
|
2897
|
+
"type": "TEXT",
|
|
2898
|
+
"notNull": false,
|
|
2899
|
+
"unique": false,
|
|
2900
|
+
"default": "{}"
|
|
2901
|
+
},
|
|
2902
|
+
"note": {
|
|
2903
|
+
"type": "TEXT",
|
|
2904
|
+
"notNull": false,
|
|
2905
|
+
"unique": false
|
|
2906
|
+
},
|
|
2907
|
+
"requested_at": {
|
|
2908
|
+
"type": "TIMESTAMP",
|
|
2909
|
+
"notNull": false,
|
|
2910
|
+
"unique": false
|
|
2911
|
+
},
|
|
2912
|
+
"decided_at": {
|
|
2913
|
+
"type": "TIMESTAMP",
|
|
2914
|
+
"notNull": false,
|
|
2915
|
+
"unique": false
|
|
2916
|
+
},
|
|
2917
|
+
"decided_by": {
|
|
2918
|
+
"type": "TEXT",
|
|
2919
|
+
"notNull": false,
|
|
2920
|
+
"unique": false
|
|
2921
|
+
},
|
|
2922
|
+
"resulting_user_id": {
|
|
2923
|
+
"type": "TEXT",
|
|
2924
|
+
"notNull": false,
|
|
2925
|
+
"unique": false
|
|
2926
|
+
},
|
|
2927
|
+
"tenant_hint": {
|
|
2928
|
+
"type": "TEXT",
|
|
2929
|
+
"notNull": false,
|
|
2930
|
+
"unique": false
|
|
2931
|
+
}
|
|
2932
|
+
},
|
|
2933
|
+
"indexes": [
|
|
2934
|
+
{
|
|
2935
|
+
"name": "access_requests_id_idx",
|
|
2936
|
+
"columns": [
|
|
2937
|
+
"id"
|
|
2938
|
+
]
|
|
2939
|
+
},
|
|
2940
|
+
{
|
|
2941
|
+
"name": "access_requests_id_idx",
|
|
2942
|
+
"columns": [
|
|
2943
|
+
"id"
|
|
2944
|
+
],
|
|
2945
|
+
"unique": true
|
|
2946
|
+
},
|
|
2947
|
+
{
|
|
2948
|
+
"name": "access_requests_email_idx",
|
|
2949
|
+
"columns": [
|
|
2950
|
+
"email"
|
|
2951
|
+
]
|
|
2952
|
+
},
|
|
2953
|
+
{
|
|
2954
|
+
"name": "access_requests_status_idx",
|
|
2955
|
+
"columns": [
|
|
2956
|
+
"status"
|
|
2957
|
+
]
|
|
2958
|
+
},
|
|
2959
|
+
{
|
|
2960
|
+
"name": "access_requests_source_idx",
|
|
2961
|
+
"columns": [
|
|
2962
|
+
"source"
|
|
2963
|
+
]
|
|
2964
|
+
}
|
|
2965
|
+
],
|
|
2966
|
+
"version": "f396996f"
|
|
2967
|
+
}
|
|
2968
|
+
},
|
|
2550
2969
|
"@happyvertical/smrt-users:UsersCliAuthRequest": {
|
|
2551
2970
|
"name": "userscliauthrequest",
|
|
2552
2971
|
"className": "UsersCliAuthRequest",
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { SmrtObject } from '@happyvertical/smrt-core';
|
|
2
|
+
import { AccessRequestStatus } from '../types/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Options accepted by the {@link AccessRequest} constructor / collection
|
|
5
|
+
* `create`. `requestContext` and `tenantHint` are stored as JSON *strings* —
|
|
6
|
+
* use {@link AccessRequest.setRequestContext} / {@link AccessRequest.setTenantHint}
|
|
7
|
+
* (or pass pre-serialized strings) rather than raw objects.
|
|
8
|
+
*/
|
|
9
|
+
export interface AccessRequestOptions {
|
|
10
|
+
email?: string;
|
|
11
|
+
name?: string | null;
|
|
12
|
+
status?: AccessRequestStatus;
|
|
13
|
+
source?: string;
|
|
14
|
+
requestContext?: string;
|
|
15
|
+
note?: string | null;
|
|
16
|
+
requestedAt?: Date;
|
|
17
|
+
decidedAt?: Date | null;
|
|
18
|
+
decidedBy?: string | null;
|
|
19
|
+
resultingUserId?: string | null;
|
|
20
|
+
tenantHint?: string | null;
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A prospective user's request for access, captured before they become a
|
|
25
|
+
* {@link User}.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* // Public, unauthenticated path (app adds rate-limiting):
|
|
30
|
+
* const request = await service.createAccessRequest({
|
|
31
|
+
* email: 'Jane@Example.com',
|
|
32
|
+
* name: 'Jane Doe',
|
|
33
|
+
* source: 'www',
|
|
34
|
+
* context: { company: 'Acme', intendedUse: 'evaluation' },
|
|
35
|
+
* });
|
|
36
|
+
* // request.email === 'jane@example.com', request.status === 'requested'
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare class AccessRequest extends SmrtObject {
|
|
40
|
+
/**
|
|
41
|
+
* Requester's email address. Required, normalized to lowercase, and indexed
|
|
42
|
+
* for lookup + open-request dedup. NOT unique: the same email may accumulate
|
|
43
|
+
* multiple requests over time (e.g. an old GRADUATED record plus a new
|
|
44
|
+
* REQUESTED one); dedup is enforced on *open* requests by the service.
|
|
45
|
+
*/
|
|
46
|
+
email: string;
|
|
47
|
+
/**
|
|
48
|
+
* Requester's display name, if supplied on the form.
|
|
49
|
+
*/
|
|
50
|
+
name: string | null;
|
|
51
|
+
/**
|
|
52
|
+
* Lifecycle status. Indexed so the operator triage queue can filter by status
|
|
53
|
+
* efficiently.
|
|
54
|
+
*/
|
|
55
|
+
status: AccessRequestStatus;
|
|
56
|
+
/**
|
|
57
|
+
* Where the request came from, e.g. `www`, `sdk`. Indexed for per-source
|
|
58
|
+
* filtering in the operator queue.
|
|
59
|
+
*/
|
|
60
|
+
source: string;
|
|
61
|
+
/**
|
|
62
|
+
* Free-form JSON metadata captured with the request (intended use, company,
|
|
63
|
+
* message, referrer, etc.), stored as a JSON string.
|
|
64
|
+
*
|
|
65
|
+
* NOT named `context`: {@link SmrtObject} reserves the `context` field for
|
|
66
|
+
* slug scoping, so this mirrors smrt-chat's `sessionContext` convention. Use
|
|
67
|
+
* {@link getRequestContext} / {@link setRequestContext} for typed access.
|
|
68
|
+
*/
|
|
69
|
+
requestContext: string;
|
|
70
|
+
/**
|
|
71
|
+
* Operator note / decision reason (set on approve / decline / cancel).
|
|
72
|
+
*/
|
|
73
|
+
note: string | null;
|
|
74
|
+
/**
|
|
75
|
+
* When the request was submitted. Defaults to creation time.
|
|
76
|
+
*/
|
|
77
|
+
requestedAt: Date;
|
|
78
|
+
/**
|
|
79
|
+
* When an operator decided the request (approve / decline / cancel /
|
|
80
|
+
* graduate). Null while still `REQUESTED`.
|
|
81
|
+
*/
|
|
82
|
+
decidedAt: Date | null;
|
|
83
|
+
/**
|
|
84
|
+
* User id of the operator who decided the request. Null while still pending.
|
|
85
|
+
*/
|
|
86
|
+
decidedBy: string | null;
|
|
87
|
+
/**
|
|
88
|
+
* Id of the `User` produced (or linked) when the request graduated. Null
|
|
89
|
+
* until graduation.
|
|
90
|
+
*/
|
|
91
|
+
resultingUserId: string | null;
|
|
92
|
+
/**
|
|
93
|
+
* Optional JSON hint about the org/tenant the requester wants, stored as a
|
|
94
|
+
* JSON string (null when absent). Advisory only — the operator decides the
|
|
95
|
+
* actual tenant at graduation time. Use {@link getTenantHint} /
|
|
96
|
+
* {@link setTenantHint} for typed access.
|
|
97
|
+
*/
|
|
98
|
+
tenantHint: string | null;
|
|
99
|
+
constructor(options?: AccessRequestOptions);
|
|
100
|
+
/**
|
|
101
|
+
* Parse {@link requestContext} into an object. Returns `{}` on missing or
|
|
102
|
+
* malformed JSON (graceful — never throws).
|
|
103
|
+
*/
|
|
104
|
+
getRequestContext(): Record<string, unknown>;
|
|
105
|
+
/**
|
|
106
|
+
* Serialize and store {@link requestContext} from an object.
|
|
107
|
+
*/
|
|
108
|
+
setRequestContext(value: Record<string, unknown>): void;
|
|
109
|
+
/**
|
|
110
|
+
* Parse {@link tenantHint} into an object, or `null` when unset / malformed.
|
|
111
|
+
*/
|
|
112
|
+
getTenantHint(): Record<string, unknown> | null;
|
|
113
|
+
/**
|
|
114
|
+
* Serialize and store {@link tenantHint} from an object (or clear with null).
|
|
115
|
+
*/
|
|
116
|
+
setTenantHint(value: Record<string, unknown> | null): void;
|
|
117
|
+
/**
|
|
118
|
+
* Whether the request is still open (awaiting a decision).
|
|
119
|
+
*/
|
|
120
|
+
isOpen(): boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Whether the request has been approved (and not yet graduated).
|
|
123
|
+
*/
|
|
124
|
+
isApproved(): boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Whether the request reached a terminal state (declined, graduated, or
|
|
127
|
+
* canceled) and can no longer transition.
|
|
128
|
+
*/
|
|
129
|
+
isTerminal(): boolean;
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=AccessRequest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccessRequest.d.ts","sourceRoot":"","sources":["../../src/models/AccessRequest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAS,UAAU,EAAQ,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAGxD;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;;;;;;;;;;;;GAeG;AACH,qBAca,aAAc,SAAQ,UAAU;IAC3C;;;;;OAKG;IAEH,KAAK,EAAE,MAAM,CAAM;IAEnB;;OAEG;IAEH,IAAI,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE3B;;;OAGG;IAEH,MAAM,EAAE,mBAAmB,CAAiC;IAE5D;;;OAGG;IAEH,MAAM,EAAE,MAAM,CAAM;IAEpB;;;;;;;OAOG;IAEH,cAAc,EAAE,MAAM,CAAQ;IAE9B;;OAEG;IAEH,IAAI,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE3B;;OAEG;IAEH,WAAW,EAAE,IAAI,CAAc;IAE/B;;;OAGG;IAEH,SAAS,EAAE,IAAI,GAAG,IAAI,CAAQ;IAE9B;;OAEG;IAEH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEhC;;;OAGG;IAEH,eAAe,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEtC;;;;;OAKG;IAEH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAQ;gBAErB,OAAO,GAAE,oBAAyB;IAkB9C;;;OAGG;IACH,iBAAiB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAW5C;;OAEG;IACH,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAIvD;;OAEG;IACH,aAAa,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAY/C;;OAEG;IACH,aAAa,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,IAAI;IAI1D;;OAEG;IACH,MAAM,IAAI,OAAO;IAIjB;;OAEG;IACH,UAAU,IAAI,OAAO;IAIrB;;;OAGG;IACH,UAAU,IAAI,OAAO;CAOtB"}
|
package/dist/models/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Model exports for smrt-users
|
|
3
3
|
* @packageDocumentation
|
|
4
4
|
*/
|
|
5
|
+
export { AccessRequest, type AccessRequestOptions } from './AccessRequest.js';
|
|
5
6
|
export { CliAuthRequest, type CliAuthRequestStatus, UsersCliAuthRequest, } from './CliAuthRequest.js';
|
|
6
7
|
export { Group } from './Group.js';
|
|
7
8
|
export { GroupMember } from './GroupMember.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;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