@idp.global/interfaces 8.0.0 → 9.0.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/changelog.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 2026-07-08 - 9.0.0
4
+
5
+ ### Breaking Changes
6
+
7
+ - remove legacy contracts (cleanup)
8
+ - Removed IReq_SuspendUser — superseded by IReq_SetUserSuspension (suspend/unsuspend, returns the updated user)
9
+ - Removed IReq_MobileVerificationForRegistration and the SMS fields/status on IRegistrationSession — the platform no longer provides an SMS sending service; registration completes after email validation
10
+
11
+ ## 2026-07-08 - 8.0.1
12
+
13
+ - feat(admin): add global admin directory, user suspension, and profile update contracts
14
+ - IReq_GetGlobalUsers: paged, searchable platform user directory (admin only)
15
+ - IReq_SetUserSuspension: suspend/unsuspend a user; suspension revokes sessions and JWTs
16
+ - IReq_GetGlobalOrgStats: platform org directory with member counts (admin only)
17
+ - IReq_UpdateProfile: self-service name/username/mobile update (email deliberately excluded)
18
+ - new IGlobalUserAdminDto; IUser gains optional createdAt; TActivityAction gains user_unsuspended
19
+ - deprecated: IReq_SuspendUser (use IReq_SetUserSuspension), IReq_MobileVerificationForRegistration (platform SMS service removed)
20
+
3
21
  ## 2026-07-08 - 8.0.0
4
22
 
5
23
  ### Breaking Changes
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@idp.global/interfaces',
6
- version: '8.0.0',
6
+ version: '9.0.0',
7
7
  description: 'Shared TypeScript interfaces and TypedRequest contracts for the idp.global ecosystem.'
8
8
  };
9
9
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx3QkFBd0I7SUFDOUIsT0FBTyxFQUFFLE9BQU87SUFDaEIsV0FBVyxFQUFFLHVGQUF1RjtDQUNyRyxDQUFBIn0=
@@ -1,4 +1,4 @@
1
- export type TActivityAction = 'login' | 'logout' | 'session_created' | 'session_revoked' | 'passport_device_enrolled' | 'passport_device_revoked' | 'passport_challenge_approved' | 'passport_challenge_rejected' | 'org_created' | 'org_updated' | 'org_deleted' | 'org_ownership_transferred' | 'org_joined' | 'org_left' | 'role_changed' | 'org_app_role_mappings_updated' | 'profile_updated' | 'totp_enabled' | 'totp_disabled' | 'backup_codes_regenerated' | 'mfa_completed' | 'passkey_registered' | 'passkey_revoked' | 'passkey_login' | 'app_connected' | 'app_disconnected' | 'user_suspended' | 'sso_connection_created' | 'sso_connection_updated' | 'sso_connection_deleted' | 'sso_login' | 'scim_token_created' | 'scim_token_revoked' | 'scim_user_provisioned' | 'scim_user_updated' | 'scim_user_deactivated' | 'scim_group_membership_changed';
1
+ export type TActivityAction = 'login' | 'logout' | 'session_created' | 'session_revoked' | 'passport_device_enrolled' | 'passport_device_revoked' | 'passport_challenge_approved' | 'passport_challenge_rejected' | 'org_created' | 'org_updated' | 'org_deleted' | 'org_ownership_transferred' | 'org_joined' | 'org_left' | 'role_changed' | 'org_app_role_mappings_updated' | 'profile_updated' | 'totp_enabled' | 'totp_disabled' | 'backup_codes_regenerated' | 'mfa_completed' | 'passkey_registered' | 'passkey_revoked' | 'passkey_login' | 'app_connected' | 'app_disconnected' | 'user_suspended' | 'user_unsuspended' | 'sso_connection_created' | 'sso_connection_updated' | 'sso_connection_deleted' | 'sso_login' | 'scim_token_created' | 'scim_token_revoked' | 'scim_user_provisioned' | 'scim_user_updated' | 'scim_user_deactivated' | 'scim_group_membership_changed';
2
2
  export interface IActivityLog {
3
3
  id: string;
4
4
  data: {
@@ -1,11 +1,9 @@
1
- export type TRegistrationSessionStatus = 'announced' | 'emailValidated' | 'mobileVerified' | 'registered' | 'failed';
1
+ export type TRegistrationSessionStatus = 'announced' | 'emailValidated' | 'registered' | 'failed';
2
2
  export interface IRegistrationSession {
3
3
  id: string;
4
4
  data: {
5
5
  emailAddress: string;
6
6
  hashedEmailToken: string;
7
- smsCodeHash?: string | null;
8
- smsvalidationCounter: number;
9
7
  status: TRegistrationSessionStatus;
10
8
  validUntil: number;
11
9
  createdAt: number;
@@ -17,6 +17,11 @@ export interface IUser {
17
17
  */
18
18
  passwordHash?: string;
19
19
  status: 'new' | 'active' | 'deleted' | 'suspended';
20
+ /**
21
+ * epoch ms of account creation; absent on accounts created before this
22
+ * field existed (derive from the Mongo ObjectId timestamp when missing)
23
+ */
24
+ createdAt?: number;
20
25
  /**
21
26
  * a quick ref for which organizations might have roles for this user
22
27
  * speeds up lookup
@@ -23,3 +23,19 @@ export interface IUserProfileDto {
23
23
  status?: IUserDataDto['status'];
24
24
  };
25
25
  }
26
+ /**
27
+ * Platform-wide user summary for the global admin directory.
28
+ * Never contains credentials, external identities, or SCIM internals.
29
+ */
30
+ export interface IGlobalUserAdminDto {
31
+ id: string;
32
+ name: string;
33
+ username: string;
34
+ email: string;
35
+ status: IUserDataDto['status'];
36
+ isGlobalAdmin: boolean;
37
+ /** number of organizations the user belongs to */
38
+ orgCount: number;
39
+ /** epoch ms; derived for accounts created before this field existed */
40
+ createdAt: number;
41
+ }
@@ -98,3 +98,57 @@ export interface IReq_RegenerateAppCredentials extends plugins.typedRequestInter
98
98
  clientSecret: string;
99
99
  };
100
100
  }
101
+ /**
102
+ * Paged, searchable platform user directory (admin only)
103
+ */
104
+ export interface IReq_GetGlobalUsers extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_GetGlobalUsers> {
105
+ method: 'getGlobalUsers';
106
+ request: {
107
+ jwt: string;
108
+ /** case-insensitive substring match against name, username and email */
109
+ search?: string;
110
+ limit?: number;
111
+ offset?: number;
112
+ };
113
+ response: {
114
+ users: dto.IGlobalUserAdminDto[];
115
+ total: number;
116
+ };
117
+ }
118
+ /**
119
+ * Suspend or unsuspend a user account (admin only).
120
+ * Suspension revokes all active sessions and JWTs of the target user.
121
+ */
122
+ export interface IReq_SetUserSuspension extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_SetUserSuspension> {
123
+ method: 'setUserSuspension';
124
+ request: {
125
+ jwt: string;
126
+ userId: string;
127
+ suspended: boolean;
128
+ };
129
+ response: {
130
+ user: dto.IGlobalUserAdminDto;
131
+ };
132
+ }
133
+ /**
134
+ * Platform-wide organization directory with member counts (admin only)
135
+ */
136
+ export interface IReq_GetGlobalOrgStats extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_GetGlobalOrgStats> {
137
+ method: 'getGlobalOrgStats';
138
+ request: {
139
+ jwt: string;
140
+ /** case-insensitive substring match against name and slug */
141
+ search?: string;
142
+ limit?: number;
143
+ offset?: number;
144
+ };
145
+ response: {
146
+ orgs: Array<{
147
+ id: string;
148
+ name: string;
149
+ slug: string;
150
+ memberCount: number;
151
+ }>;
152
+ total: number;
153
+ };
154
+ }
@@ -38,22 +38,6 @@ export interface IReq_SetDataForRegistration extends plugins.typedRequestInterfa
38
38
  status: 'ok' | 'not ok';
39
39
  };
40
40
  }
41
- /**
42
- * Should be used to verify a mobile number for an verifcation
43
- */
44
- export interface IReq_MobileVerificationForRegistration extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_MobileVerificationForRegistration> {
45
- method: 'mobileVerificationForRegistration';
46
- request: {
47
- token: string;
48
- mobileNumber?: string;
49
- verificationCode?: string;
50
- };
51
- response: {
52
- messageSent?: boolean;
53
- verficationCodeOk?: boolean;
54
- testOnlySmsCode?: string;
55
- };
56
- }
57
41
  export interface IReq_FinishRegistration extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_FinishRegistration> {
58
42
  method: 'finishRegistration';
59
43
  request: {
@@ -1,15 +1,5 @@
1
1
  import * as dto from '../dto/index.js';
2
2
  import * as plugins from '../plugins.js';
3
- export interface IReq_SuspendUser extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_SuspendUser> {
4
- method: 'suspendUser';
5
- request: {
6
- jwt: string;
7
- userId: string;
8
- };
9
- response: {
10
- publicKeyPem: string;
11
- };
12
- }
13
3
  export interface IReq_GetRolesAndOrganizationsForUserId extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_GetRolesAndOrganizationsForUserId> {
14
4
  method: 'getRolesAndOrganizationsForUserId';
15
5
  request: {
@@ -59,6 +49,22 @@ export interface IReq_RevokeSession extends plugins.typedRequestInterfaces.imple
59
49
  success: boolean;
60
50
  };
61
51
  }
52
+ /**
53
+ * Self-service profile update. Email is deliberately NOT updatable here —
54
+ * it is the account's login identifier and needs a verified-change flow.
55
+ */
56
+ export interface IReq_UpdateProfile extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_UpdateProfile> {
57
+ method: 'updateProfile';
58
+ request: {
59
+ jwt: string;
60
+ name?: string;
61
+ username?: string;
62
+ mobileNumber?: string;
63
+ };
64
+ response: {
65
+ user: dto.ICurrentUserDto;
66
+ };
67
+ }
62
68
  export interface IReq_GetUserActivity extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_GetUserActivity> {
63
69
  method: 'getUserActivity';
64
70
  request: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idp.global/interfaces",
3
- "version": "8.0.0",
3
+ "version": "9.0.0",
4
4
  "private": false,
5
5
  "description": "Shared TypeScript interfaces and TypedRequest contracts for the idp.global ecosystem.",
6
6
  "exports": {
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@idp.global/interfaces',
6
- version: '8.0.0',
6
+ version: '9.0.0',
7
7
  description: 'Shared TypeScript interfaces and TypedRequest contracts for the idp.global ecosystem.'
8
8
  }
@@ -26,6 +26,7 @@ export type TActivityAction =
26
26
  | 'app_connected'
27
27
  | 'app_disconnected'
28
28
  | 'user_suspended'
29
+ | 'user_unsuspended'
29
30
  | 'sso_connection_created'
30
31
  | 'sso_connection_updated'
31
32
  | 'sso_connection_deleted'
@@ -1,7 +1,6 @@
1
1
  export type TRegistrationSessionStatus =
2
2
  | 'announced'
3
3
  | 'emailValidated'
4
- | 'mobileVerified'
5
4
  | 'registered'
6
5
  | 'failed';
7
6
 
@@ -10,8 +9,6 @@ export interface IRegistrationSession {
10
9
  data: {
11
10
  emailAddress: string;
12
11
  hashedEmailToken: string;
13
- smsCodeHash?: string | null;
14
- smsvalidationCounter: number;
15
12
  status: TRegistrationSessionStatus;
16
13
  validUntil: number;
17
14
  createdAt: number;
package/ts/data/user.ts CHANGED
@@ -21,6 +21,11 @@ export interface IUser {
21
21
  */
22
22
  passwordHash?: string;
23
23
  status: 'new' | 'active' | 'deleted' | 'suspended';
24
+ /**
25
+ * epoch ms of account creation; absent on accounts created before this
26
+ * field existed (derive from the Mongo ObjectId timestamp when missing)
27
+ */
28
+ createdAt?: number;
24
29
  /**
25
30
  * a quick ref for which organizations might have roles for this user
26
31
  * speeds up lookup
package/ts/dto/user.ts CHANGED
@@ -25,3 +25,20 @@ export interface IUserProfileDto {
25
25
  status?: IUserDataDto['status'];
26
26
  };
27
27
  }
28
+
29
+ /**
30
+ * Platform-wide user summary for the global admin directory.
31
+ * Never contains credentials, external identities, or SCIM internals.
32
+ */
33
+ export interface IGlobalUserAdminDto {
34
+ id: string;
35
+ name: string;
36
+ username: string;
37
+ email: string;
38
+ status: IUserDataDto['status'];
39
+ isGlobalAdmin: boolean;
40
+ /** number of organizations the user belongs to */
41
+ orgCount: number;
42
+ /** epoch ms; derived for accounts created before this field existed */
43
+ createdAt: number;
44
+ }
@@ -128,3 +128,72 @@ export interface IReq_RegenerateAppCredentials
128
128
  clientSecret: string; // Only shown once
129
129
  };
130
130
  }
131
+
132
+ /**
133
+ * Paged, searchable platform user directory (admin only)
134
+ */
135
+ export interface IReq_GetGlobalUsers
136
+ extends plugins.typedRequestInterfaces.implementsTR<
137
+ plugins.typedRequestInterfaces.ITypedRequest,
138
+ IReq_GetGlobalUsers
139
+ > {
140
+ method: 'getGlobalUsers';
141
+ request: {
142
+ jwt: string;
143
+ /** case-insensitive substring match against name, username and email */
144
+ search?: string;
145
+ limit?: number;
146
+ offset?: number;
147
+ };
148
+ response: {
149
+ users: dto.IGlobalUserAdminDto[];
150
+ total: number;
151
+ };
152
+ }
153
+
154
+ /**
155
+ * Suspend or unsuspend a user account (admin only).
156
+ * Suspension revokes all active sessions and JWTs of the target user.
157
+ */
158
+ export interface IReq_SetUserSuspension
159
+ extends plugins.typedRequestInterfaces.implementsTR<
160
+ plugins.typedRequestInterfaces.ITypedRequest,
161
+ IReq_SetUserSuspension
162
+ > {
163
+ method: 'setUserSuspension';
164
+ request: {
165
+ jwt: string;
166
+ userId: string;
167
+ suspended: boolean;
168
+ };
169
+ response: {
170
+ user: dto.IGlobalUserAdminDto;
171
+ };
172
+ }
173
+
174
+ /**
175
+ * Platform-wide organization directory with member counts (admin only)
176
+ */
177
+ export interface IReq_GetGlobalOrgStats
178
+ extends plugins.typedRequestInterfaces.implementsTR<
179
+ plugins.typedRequestInterfaces.ITypedRequest,
180
+ IReq_GetGlobalOrgStats
181
+ > {
182
+ method: 'getGlobalOrgStats';
183
+ request: {
184
+ jwt: string;
185
+ /** case-insensitive substring match against name and slug */
186
+ search?: string;
187
+ limit?: number;
188
+ offset?: number;
189
+ };
190
+ response: {
191
+ orgs: Array<{
192
+ id: string;
193
+ name: string;
194
+ slug: string;
195
+ memberCount: number;
196
+ }>;
197
+ total: number;
198
+ };
199
+ }
@@ -54,27 +54,6 @@ export interface IReq_SetDataForRegistration
54
54
  };
55
55
  }
56
56
 
57
- /**
58
- * Should be used to verify a mobile number for an verifcation
59
- */
60
- export interface IReq_MobileVerificationForRegistration
61
- extends plugins.typedRequestInterfaces.implementsTR<
62
- plugins.typedRequestInterfaces.ITypedRequest,
63
- IReq_MobileVerificationForRegistration
64
- > {
65
- method: 'mobileVerificationForRegistration';
66
- request: {
67
- token: string;
68
- mobileNumber?: string;
69
- verificationCode?: string;
70
- };
71
- response: {
72
- messageSent?: boolean;
73
- verficationCodeOk?: boolean;
74
- testOnlySmsCode?: string;
75
- };
76
- }
77
-
78
57
  export interface IReq_FinishRegistration
79
58
  extends plugins.typedRequestInterfaces.implementsTR<
80
59
  plugins.typedRequestInterfaces.ITypedRequest,
@@ -2,21 +2,6 @@ import * as data from '../data/index.js';
2
2
  import * as dto from '../dto/index.js';
3
3
  import * as plugins from '../plugins.js';
4
4
 
5
- export interface IReq_SuspendUser
6
- extends plugins.typedRequestInterfaces.implementsTR<
7
- plugins.typedRequestInterfaces.ITypedRequest,
8
- IReq_SuspendUser
9
- > {
10
- method: 'suspendUser';
11
- request: {
12
- jwt: string;
13
- userId: string;
14
- };
15
- response: {
16
- publicKeyPem: string;
17
- };
18
- }
19
-
20
5
  export interface IReq_GetRolesAndOrganizationsForUserId
21
6
  extends plugins.typedRequestInterfaces.implementsTR<
22
7
  plugins.typedRequestInterfaces.ITypedRequest,
@@ -86,6 +71,27 @@ export interface IReq_RevokeSession
86
71
  };
87
72
  }
88
73
 
74
+ /**
75
+ * Self-service profile update. Email is deliberately NOT updatable here —
76
+ * it is the account's login identifier and needs a verified-change flow.
77
+ */
78
+ export interface IReq_UpdateProfile
79
+ extends plugins.typedRequestInterfaces.implementsTR<
80
+ plugins.typedRequestInterfaces.ITypedRequest,
81
+ IReq_UpdateProfile
82
+ > {
83
+ method: 'updateProfile';
84
+ request: {
85
+ jwt: string;
86
+ name?: string;
87
+ username?: string;
88
+ mobileNumber?: string;
89
+ };
90
+ response: {
91
+ user: dto.ICurrentUserDto;
92
+ };
93
+ }
94
+
89
95
  export interface IReq_GetUserActivity
90
96
  extends plugins.typedRequestInterfaces.implementsTR<
91
97
  plugins.typedRequestInterfaces.ITypedRequest,