@star-insure/sdk 5.0.9 → 5.0.11

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.
@@ -7,7 +7,10 @@ declare type AuthUser = {
7
7
  umbrella_filter?: string;
8
8
  oracle_user_id?: string;
9
9
  groups: AuthGroup[];
10
+ mobile?: string;
10
11
  phone_extension?: number;
12
+ two_factor_expires_at?: string;
13
+ two_factor_method?: TwoFactorAuthMethod;
11
14
  };
12
15
  declare type AuthGroup = {
13
16
  id: number;
@@ -26,6 +29,7 @@ export interface AuthContext {
26
29
  permissions: string[];
27
30
  is_app?: boolean;
28
31
  can: (permission: string) => boolean;
29
- should_2fa?: boolean;
32
+ should_two_factor_auth: boolean;
30
33
  }
34
+ declare type TwoFactorAuthMethod = 'email' | 'sms';
31
35
  export {};
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@star-insure/sdk",
3
3
  "description": "The SDK for Star Insure client apps with shared helper functions and TypeScript definitions.",
4
4
  "author": "alexclark_nz",
5
- "version": "5.0.9",
5
+ "version": "5.0.11",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
@@ -1,41 +1,46 @@
1
1
  export type UserContext =
2
- | 'administrator'
3
- | 'staff'
4
- | 'broker'
5
- | 'dealer'
6
- | 'agent'
7
- | 'security'
8
- | 'customer';
2
+ | 'administrator'
3
+ | 'staff'
4
+ | 'broker'
5
+ | 'dealer'
6
+ | 'agent'
7
+ | 'security'
8
+ | 'customer';
9
9
 
10
10
  type AuthUser = {
11
- id: number;
12
- name: string;
13
- email: string;
14
- is_group_admin: boolean;
15
- umbrella_filter?: string;
16
- oracle_user_id?: string;
17
- groups: AuthGroup[];
18
- phone_extension?: number;
11
+ id: number;
12
+ name: string;
13
+ email: string;
14
+ is_group_admin: boolean;
15
+ umbrella_filter?: string;
16
+ oracle_user_id?: string;
17
+ groups: AuthGroup[];
18
+ mobile?: string;
19
+ phone_extension?: number;
20
+ two_factor_expires_at?: string;
21
+ two_factor_method?: TwoFactorAuthMethod;
19
22
  };
20
23
 
21
24
  type AuthGroup = {
22
- id: number;
23
- name: string;
24
- code: string;
25
- role: AuthRole;
25
+ id: number;
26
+ name: string;
27
+ code: string;
28
+ role: AuthRole;
26
29
  };
27
30
 
28
31
  type AuthRole = {
29
- name: string;
30
- context: string;
32
+ name: string;
33
+ context: string;
31
34
  };
32
35
 
33
36
  export interface AuthContext {
34
- user?: AuthUser;
35
- context: UserContext;
36
- group?: AuthGroup;
37
- permissions: string[];
38
- is_app?: boolean;
39
- can: (permission: string) => boolean;
40
- should_2fa?: boolean;
37
+ user?: AuthUser;
38
+ context: UserContext;
39
+ group?: AuthGroup;
40
+ permissions: string[];
41
+ is_app?: boolean;
42
+ can: (permission: string) => boolean;
43
+ should_two_factor_auth: boolean;
41
44
  }
45
+
46
+ type TwoFactorAuthMethod = 'email' | 'sms';