@inai-dev/types 1.3.0 → 1.5.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.d.cts CHANGED
@@ -6,6 +6,8 @@ interface AuthObject {
6
6
  orgId: string | null;
7
7
  orgRole: string | null;
8
8
  sessionId: string | null;
9
+ roles: string[];
10
+ permissions: string[];
9
11
  getToken: () => Promise<string | null>;
10
12
  has: (params: {
11
13
  role?: string;
@@ -30,6 +32,8 @@ interface ProtectedAuthObject {
30
32
  orgId: string | null;
31
33
  orgRole: string | null;
32
34
  sessionId: string | null;
35
+ roles: string[];
36
+ permissions: string[];
33
37
  isSignedIn: true;
34
38
  getToken: () => Promise<string>;
35
39
  has: (params: {
@@ -57,7 +61,7 @@ interface JWTClaims {
57
61
 
58
62
  interface UserResource {
59
63
  id: string;
60
- tenantId: string;
64
+ tenantId?: string;
61
65
  email: string;
62
66
  firstName: string | null;
63
67
  lastName: string | null;
@@ -65,8 +69,8 @@ interface UserResource {
65
69
  isActive: boolean;
66
70
  emailVerified: boolean;
67
71
  mfaEnabled: boolean;
68
- externalId: string | null;
69
- roles: string[];
72
+ externalId?: string | null;
73
+ roles?: string[];
70
74
  createdAt: string;
71
75
  updatedAt: string;
72
76
  }
@@ -78,6 +82,13 @@ interface PlatformUserResource {
78
82
  lastName: string | null;
79
83
  avatarUrl: string | null;
80
84
  roles: string[];
85
+ permissions: string[];
86
+ tenant: {
87
+ id: string;
88
+ name: string;
89
+ slug: string;
90
+ plan: string;
91
+ } | null;
81
92
  createdAt: string;
82
93
  updatedAt: string;
83
94
  }
@@ -107,6 +118,7 @@ interface ApplicationResource {
107
118
  domain: string | null;
108
119
  logoUrl: string | null;
109
120
  homeUrl: string | null;
121
+ callbackUrls: string[] | null;
110
122
  isActive: boolean;
111
123
  settings: Record<string, unknown> | null;
112
124
  authConfig: Record<string, unknown> | null;
@@ -181,6 +193,7 @@ interface LoginResult {
181
193
  refresh_token?: string;
182
194
  token_type?: string;
183
195
  expires_in?: number;
196
+ user?: UserResource;
184
197
  }
185
198
  interface MFAChallengeParams {
186
199
  mfa_token: string;
@@ -204,9 +217,11 @@ interface SignUpResult {
204
217
  error?: string;
205
218
  }
206
219
  interface InAIAuthErrorBody {
207
- code: string;
220
+ type: string;
221
+ title: string;
222
+ status: number;
208
223
  detail: string;
209
- field?: string;
224
+ instance?: string;
210
225
  }
211
226
 
212
227
  export type { ApiKeyResource, ApplicationResource, ApplicationStats, AuthObject, EnvironmentResource, InAIAuthConfig, InAIAuthErrorBody, InAIAuthSDKConfig, InAIMiddlewareConfig, JWTClaims, LoginParams, LoginResult, MFAChallengeParams, OrganizationResource, PaginatedResult, PlatformUserResource, ProtectedAuthObject, ServerAuthObject, SessionResource, SignInResult, SignUpResult, TokenPair, UserResource };
package/dist/index.d.ts CHANGED
@@ -6,6 +6,8 @@ interface AuthObject {
6
6
  orgId: string | null;
7
7
  orgRole: string | null;
8
8
  sessionId: string | null;
9
+ roles: string[];
10
+ permissions: string[];
9
11
  getToken: () => Promise<string | null>;
10
12
  has: (params: {
11
13
  role?: string;
@@ -30,6 +32,8 @@ interface ProtectedAuthObject {
30
32
  orgId: string | null;
31
33
  orgRole: string | null;
32
34
  sessionId: string | null;
35
+ roles: string[];
36
+ permissions: string[];
33
37
  isSignedIn: true;
34
38
  getToken: () => Promise<string>;
35
39
  has: (params: {
@@ -57,7 +61,7 @@ interface JWTClaims {
57
61
 
58
62
  interface UserResource {
59
63
  id: string;
60
- tenantId: string;
64
+ tenantId?: string;
61
65
  email: string;
62
66
  firstName: string | null;
63
67
  lastName: string | null;
@@ -65,8 +69,8 @@ interface UserResource {
65
69
  isActive: boolean;
66
70
  emailVerified: boolean;
67
71
  mfaEnabled: boolean;
68
- externalId: string | null;
69
- roles: string[];
72
+ externalId?: string | null;
73
+ roles?: string[];
70
74
  createdAt: string;
71
75
  updatedAt: string;
72
76
  }
@@ -78,6 +82,13 @@ interface PlatformUserResource {
78
82
  lastName: string | null;
79
83
  avatarUrl: string | null;
80
84
  roles: string[];
85
+ permissions: string[];
86
+ tenant: {
87
+ id: string;
88
+ name: string;
89
+ slug: string;
90
+ plan: string;
91
+ } | null;
81
92
  createdAt: string;
82
93
  updatedAt: string;
83
94
  }
@@ -107,6 +118,7 @@ interface ApplicationResource {
107
118
  domain: string | null;
108
119
  logoUrl: string | null;
109
120
  homeUrl: string | null;
121
+ callbackUrls: string[] | null;
110
122
  isActive: boolean;
111
123
  settings: Record<string, unknown> | null;
112
124
  authConfig: Record<string, unknown> | null;
@@ -181,6 +193,7 @@ interface LoginResult {
181
193
  refresh_token?: string;
182
194
  token_type?: string;
183
195
  expires_in?: number;
196
+ user?: UserResource;
184
197
  }
185
198
  interface MFAChallengeParams {
186
199
  mfa_token: string;
@@ -204,9 +217,11 @@ interface SignUpResult {
204
217
  error?: string;
205
218
  }
206
219
  interface InAIAuthErrorBody {
207
- code: string;
220
+ type: string;
221
+ title: string;
222
+ status: number;
208
223
  detail: string;
209
- field?: string;
224
+ instance?: string;
210
225
  }
211
226
 
212
227
  export type { ApiKeyResource, ApplicationResource, ApplicationStats, AuthObject, EnvironmentResource, InAIAuthConfig, InAIAuthErrorBody, InAIAuthSDKConfig, InAIMiddlewareConfig, JWTClaims, LoginParams, LoginResult, MFAChallengeParams, OrganizationResource, PaginatedResult, PlatformUserResource, ProtectedAuthObject, ServerAuthObject, SessionResource, SignInResult, SignUpResult, TokenPair, UserResource };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inai-dev/types",
3
- "version": "1.3.0",
3
+ "version": "1.5.0",
4
4
  "description": "TypeScript types for the InAI Auth SDK",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",