@idp.global/interfaces 1.2.0 → 2.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,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 2026-06-20 - 2.0.0
4
+
5
+ ### Breaking Changes
6
+
7
+ - update invitation contracts for hashed tokens and JWT acceptance (userinvitation)
8
+ - Split public invitation data from internal persisted records and expose tokenHash only on IUserInvitationRecord
9
+ - Replace userId with jwt in the acceptInvitation request contract
10
+ - Bump tsdoc and Node type dev dependencies
11
+
3
12
  ## 2026-06-10 - 1.2.0
4
13
 
5
14
  ### Features
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@idp.global/interfaces',
6
- version: '1.2.0',
6
+ version: '2.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=
@@ -7,26 +7,35 @@
7
7
  */
8
8
  export interface IUserInvitation {
9
9
  id: string;
10
- data: {
11
- /** The invited email address - unique key for sharing across orgs */
12
- email: string;
13
- /** Secure token for invitation link validation */
14
- token: string;
15
- /** Current status of the invitation */
16
- status: 'pending' | 'accepted' | 'expired' | 'cancelled';
17
- /** When the invitation was first created */
18
- createdAt: number;
19
- /** When the invitation expires (createdAt + 90 days) */
20
- expiresAt: number;
21
- /**
22
- * Organizations that have invited this email.
23
- * Multiple orgs can link to the same invitation.
24
- */
25
- organizationRefs: IOrganizationInvitationRef[];
26
- /** When the invitation was accepted (user registered/folded) */
27
- acceptedAt?: number;
28
- /** The User ID after conversion (when accepted) */
29
- convertedToUserId?: string;
10
+ data: IUserInvitationData;
11
+ }
12
+ export interface IUserInvitationData {
13
+ /** The invited email address - unique key for sharing across orgs */
14
+ email: string;
15
+ /** Current status of the invitation */
16
+ status: 'pending' | 'accepted' | 'expired' | 'cancelled';
17
+ /** When the invitation was first created */
18
+ createdAt: number;
19
+ /** When the invitation expires (createdAt + 90 days) */
20
+ expiresAt: number;
21
+ /**
22
+ * Organizations that have invited this email.
23
+ * Multiple orgs can link to the same invitation.
24
+ */
25
+ organizationRefs: IOrganizationInvitationRef[];
26
+ /** When the invitation was accepted (user registered/folded) */
27
+ acceptedAt?: number;
28
+ /** The User ID after conversion (when accepted) */
29
+ convertedToUserId?: string;
30
+ }
31
+ /**
32
+ * Internal persisted invitation record. Do not return this shape to clients.
33
+ */
34
+ export interface IUserInvitationRecord {
35
+ id: string;
36
+ data: IUserInvitationData & {
37
+ /** Hashed one-time invitation token for link validation */
38
+ tokenHash: string;
30
39
  };
31
40
  }
32
41
  /**
@@ -127,13 +127,13 @@ export interface IReq_TransferOwnership extends plugins.typedRequestInterfaces.i
127
127
  };
128
128
  }
129
129
  /**
130
- * Accept an invitation (called during registration or email verification)
130
+ * Accept an invitation for the authenticated user.
131
131
  */
132
132
  export interface IReq_AcceptInvitation extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_AcceptInvitation> {
133
133
  method: 'acceptInvitation';
134
134
  request: {
135
135
  token: string;
136
- userId: string;
136
+ jwt: string;
137
137
  };
138
138
  response: {
139
139
  success: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idp.global/interfaces",
3
- "version": "1.2.0",
3
+ "version": "2.0.0",
4
4
  "private": false,
5
5
  "description": "Shared TypeScript interfaces and TypedRequest contracts for the idp.global ecosystem.",
6
6
  "exports": {
@@ -15,10 +15,10 @@
15
15
  },
16
16
  "devDependencies": {
17
17
  "@git.zone/tsbuild": "^4.4.2",
18
- "@git.zone/tsdoc": "^2.0.6",
18
+ "@git.zone/tsdoc": "^2.1.1",
19
19
  "@git.zone/tsrun": "^2.0.4",
20
20
  "@git.zone/tstest": "^3.6.6",
21
- "@types/node": "^25.9.2"
21
+ "@types/node": "^26.0.0"
22
22
  },
23
23
  "files": [
24
24
  "ts/**/*",
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@idp.global/interfaces',
6
- version: '1.2.0',
6
+ version: '2.0.0',
7
7
  description: 'Shared TypeScript interfaces and TypedRequest contracts for the idp.global ecosystem.'
8
8
  }
@@ -9,13 +9,13 @@ import * as plugins from '../plugins.js';
9
9
  */
10
10
  export interface IUserInvitation {
11
11
  id: string;
12
- data: {
12
+ data: IUserInvitationData;
13
+ }
14
+
15
+ export interface IUserInvitationData {
13
16
  /** The invited email address - unique key for sharing across orgs */
14
17
  email: string;
15
18
 
16
- /** Secure token for invitation link validation */
17
- token: string;
18
-
19
19
  /** Current status of the invitation */
20
20
  status: 'pending' | 'accepted' | 'expired' | 'cancelled';
21
21
 
@@ -36,6 +36,16 @@ export interface IUserInvitation {
36
36
 
37
37
  /** The User ID after conversion (when accepted) */
38
38
  convertedToUserId?: string;
39
+ }
40
+
41
+ /**
42
+ * Internal persisted invitation record. Do not return this shape to clients.
43
+ */
44
+ export interface IUserInvitationRecord {
45
+ id: string;
46
+ data: IUserInvitationData & {
47
+ /** Hashed one-time invitation token for link validation */
48
+ tokenHash: string;
39
49
  };
40
50
  }
41
51
 
@@ -168,7 +168,7 @@ export interface IReq_TransferOwnership
168
168
  }
169
169
 
170
170
  /**
171
- * Accept an invitation (called during registration or email verification)
171
+ * Accept an invitation for the authenticated user.
172
172
  */
173
173
  export interface IReq_AcceptInvitation
174
174
  extends plugins.typedRequestInterfaces.implementsTR<
@@ -178,7 +178,7 @@ export interface IReq_AcceptInvitation
178
178
  method: 'acceptInvitation';
179
179
  request: {
180
180
  token: string;
181
- userId: string;
181
+ jwt: string;
182
182
  };
183
183
  response: {
184
184
  success: boolean;