@idp.global/interfaces 25.2.1 → 26.1.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,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 2026-07-23 - 26.1.0
4
+
5
+ ### Features
6
+
7
+ - add optional refresh token to registration completion response (registration)
8
+ - Expose an optional refreshToken on registration completion responses when a session can be issued directly.
9
+ - Document that clients should fall back to normal sign-in when no refresh token is returned.
10
+
11
+ ## 2026-07-22 - 26.0.0
12
+
13
+ ### Breaking Changes
14
+
15
+ - add email code verification contracts (auth)
16
+ - Require codeHash and codeAttemptsRemaining on email action tokens and registration sessions
17
+ - Add typed requests for login and registration email code verification
18
+
3
19
  ## 2026-07-18 - 25.2.1
4
20
 
5
21
  ### Fixes
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@idp.global/interfaces',
6
- version: '25.2.1',
6
+ version: '26.1.0',
7
7
  description: 'Shared TypeScript interfaces and TypedRequest contracts for the idp.global ecosystem.'
8
8
  };
9
9
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx3QkFBd0I7SUFDOUIsT0FBTyxFQUFFLFFBQVE7SUFDakIsV0FBVyxFQUFFLHVGQUF1RjtDQUNyRyxDQUFBIn0=
@@ -5,6 +5,14 @@ export interface IEmailActionToken {
5
5
  email: string;
6
6
  action: TEmailActionTokenAction;
7
7
  tokenHash: string;
8
+ /**
9
+ * Salted hash of the 6-digit code delivered alongside the link.
10
+ */
11
+ codeHash: string;
12
+ /**
13
+ * Remaining code verification attempts before the token is invalidated.
14
+ */
15
+ codeAttemptsRemaining: number;
8
16
  validUntil: number;
9
17
  createdAt: number;
10
18
  };
@@ -4,6 +4,14 @@ export interface IRegistrationSession {
4
4
  data: {
5
5
  emailAddress: string;
6
6
  hashedEmailToken: string;
7
+ /**
8
+ * Salted hash of the 6-digit code delivered alongside the link.
9
+ */
10
+ codeHash: string;
11
+ /**
12
+ * Remaining code verification attempts before the session is invalidated.
13
+ */
14
+ codeAttemptsRemaining: number;
7
15
  status: TRegistrationSessionStatus;
8
16
  validUntil: number;
9
17
  createdAt: number;
@@ -36,6 +36,22 @@ export interface IReq_LoginWithEmailAfterEmailTokenAquired extends plugins.typed
36
36
  availableMfaMethods?: data.TMfaMethod[];
37
37
  };
38
38
  }
39
+ export interface IReq_LoginWithEmailCode extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_LoginWithEmailCode> {
40
+ method: 'loginWithEmailCode';
41
+ request: {
42
+ email: string;
43
+ /**
44
+ * the 6-digit code delivered in the sign-in email alongside the link
45
+ */
46
+ code: string;
47
+ };
48
+ response: {
49
+ refreshToken?: string;
50
+ twoFaNeeded?: boolean;
51
+ mfaChallengeToken?: string;
52
+ availableMfaMethods?: data.TMfaMethod[];
53
+ };
54
+ }
39
55
  export interface ILogoutRequest extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, ILogoutRequest> {
40
56
  method: 'logout';
41
57
  request: {
@@ -31,6 +31,25 @@ export interface IReq_AfterRegistrationEmailClicked extends plugins.typedRequest
31
31
  email: string;
32
32
  };
33
33
  }
34
+ export interface IReq_VerifyRegistrationEmailCode extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_VerifyRegistrationEmailCode> {
35
+ method: 'verifyRegistrationEmailCode';
36
+ request: {
37
+ email: string;
38
+ /**
39
+ * the 6-digit code delivered in the verification email alongside the link
40
+ */
41
+ code: string;
42
+ };
43
+ response: {
44
+ status: 'ok' | 'not ok';
45
+ /**
46
+ * continuation token equivalent to the emailed link token; feeds the
47
+ * registration stepper exactly like a clicked link
48
+ */
49
+ token: string;
50
+ email: string;
51
+ };
52
+ }
34
53
  export interface IReq_SetDataForRegistration extends plugins.typedRequestInterfaces.implementsTR<plugins.typedRequestInterfaces.ITypedRequest, IReq_SetDataForRegistration> {
35
54
  method: 'setDataForRegistration';
36
55
  request: {
@@ -49,5 +68,13 @@ export interface IReq_FinishRegistration extends plugins.typedRequestInterfaces.
49
68
  response: {
50
69
  status: 'ok' | 'not ok';
51
70
  accountData?: dto.IUserProfileDto;
71
+ /**
72
+ * Refresh token for the session minted on completion. The registration
73
+ * token proves email ownership, so no separate credential round trip is
74
+ * needed. Absent when a session cannot be issued directly (for example a
75
+ * crash-retried completion for an account that has since enrolled MFA) —
76
+ * the client then routes to the normal sign-in.
77
+ */
78
+ refreshToken?: string;
52
79
  };
53
80
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idp.global/interfaces",
3
- "version": "25.2.1",
3
+ "version": "26.1.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: '25.2.1',
6
+ version: '26.1.0',
7
7
  description: 'Shared TypeScript interfaces and TypedRequest contracts for the idp.global ecosystem.'
8
8
  }
@@ -6,6 +6,14 @@ export interface IEmailActionToken {
6
6
  email: string;
7
7
  action: TEmailActionTokenAction;
8
8
  tokenHash: string;
9
+ /**
10
+ * Salted hash of the 6-digit code delivered alongside the link.
11
+ */
12
+ codeHash: string;
13
+ /**
14
+ * Remaining code verification attempts before the token is invalidated.
15
+ */
16
+ codeAttemptsRemaining: number;
9
17
  validUntil: number;
10
18
  createdAt: number;
11
19
  };
@@ -9,6 +9,14 @@ export interface IRegistrationSession {
9
9
  data: {
10
10
  emailAddress: string;
11
11
  hashedEmailToken: string;
12
+ /**
13
+ * Salted hash of the 6-digit code delivered alongside the link.
14
+ */
15
+ codeHash: string;
16
+ /**
17
+ * Remaining code verification attempts before the session is invalidated.
18
+ */
19
+ codeAttemptsRemaining: number;
12
20
  status: TRegistrationSessionStatus;
13
21
  validUntil: number;
14
22
  createdAt: number;
@@ -52,6 +52,27 @@ export interface IReq_LoginWithEmailAfterEmailTokenAquired
52
52
  };
53
53
  }
54
54
 
55
+ export interface IReq_LoginWithEmailCode
56
+ extends plugins.typedRequestInterfaces.implementsTR<
57
+ plugins.typedRequestInterfaces.ITypedRequest,
58
+ IReq_LoginWithEmailCode
59
+ > {
60
+ method: 'loginWithEmailCode';
61
+ request: {
62
+ email: string;
63
+ /**
64
+ * the 6-digit code delivered in the sign-in email alongside the link
65
+ */
66
+ code: string;
67
+ };
68
+ response: {
69
+ refreshToken?: string;
70
+ twoFaNeeded?: boolean;
71
+ mfaChallengeToken?: string;
72
+ availableMfaMethods?: data.TMfaMethod[];
73
+ };
74
+ }
75
+
55
76
  export interface ILogoutRequest
56
77
  extends plugins.typedRequestInterfaces.implementsTR<
57
78
  plugins.typedRequestInterfaces.ITypedRequest,
@@ -43,6 +43,30 @@ export interface IReq_AfterRegistrationEmailClicked
43
43
  };
44
44
  }
45
45
 
46
+ export interface IReq_VerifyRegistrationEmailCode
47
+ extends plugins.typedRequestInterfaces.implementsTR<
48
+ plugins.typedRequestInterfaces.ITypedRequest,
49
+ IReq_VerifyRegistrationEmailCode
50
+ > {
51
+ method: 'verifyRegistrationEmailCode';
52
+ request: {
53
+ email: string;
54
+ /**
55
+ * the 6-digit code delivered in the verification email alongside the link
56
+ */
57
+ code: string;
58
+ };
59
+ response: {
60
+ status: 'ok' | 'not ok';
61
+ /**
62
+ * continuation token equivalent to the emailed link token; feeds the
63
+ * registration stepper exactly like a clicked link
64
+ */
65
+ token: string;
66
+ email: string;
67
+ };
68
+ }
69
+
46
70
  export interface IReq_SetDataForRegistration
47
71
  extends plugins.typedRequestInterfaces.implementsTR<
48
72
  plugins.typedRequestInterfaces.ITypedRequest,
@@ -70,5 +94,13 @@ export interface IReq_FinishRegistration
70
94
  response: {
71
95
  status: 'ok' | 'not ok';
72
96
  accountData?: dto.IUserProfileDto;
97
+ /**
98
+ * Refresh token for the session minted on completion. The registration
99
+ * token proves email ownership, so no separate credential round trip is
100
+ * needed. Absent when a session cannot be issued directly (for example a
101
+ * crash-retried completion for an account that has since enrolled MFA) —
102
+ * the client then routes to the normal sign-in.
103
+ */
104
+ refreshToken?: string;
73
105
  };
74
106
  }