@authorizerdev/authorizer-js 1.1.4 → 1.1.6

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/src/types.ts CHANGED
@@ -1,203 +1,203 @@
1
- export type ConfigType = {
2
- authorizerURL: string;
3
- redirectURL: string;
4
- clientID: string;
5
- extraHeaders?: Record<string, string>;
6
- };
7
-
8
- export type User = {
9
- id: string;
10
- email: string;
11
- preferred_username: string;
12
- email_verified: boolean;
13
- signup_methods: string;
14
- given_name?: string | null;
15
- family_name?: string | null;
16
- middle_name?: string | null;
17
- nickname?: string | null;
18
- picture?: string | null;
19
- gender?: string | null;
20
- birthdate?: string | null;
21
- phone_number?: string | null;
22
- phone_number_verified?: boolean | null;
23
- roles?: string[];
24
- created_at: number;
25
- updated_at: number;
26
- is_multi_factor_auth_enabled?: boolean;
27
- };
28
-
29
- export type AuthToken = {
30
- message?: string;
31
- access_token: string;
32
- expires_in: number;
33
- id_token: string;
34
- refresh_token?: string;
35
- user?: User;
36
- should_show_otp_screen?: boolean;
37
- };
38
-
39
- export type Response = {
40
- message: string;
41
- };
42
-
43
- export type Headers = Record<string, string>;
44
-
45
- export type LoginInput = {
46
- email: string;
47
- password: string;
48
- roles?: string[];
49
- scope?: string[];
50
- state?: string;
51
- };
52
-
53
- export type SignupInput = {
54
- email: string;
55
- password: string;
56
- confirm_password: string;
57
- given_name?: string;
58
- family_name?: string;
59
- middle_name?: string;
60
- nickname?: string;
61
- picture?: string;
62
- gender?: string;
63
- birthdate?: string;
64
- phone_number?: string;
65
- roles?: string[];
66
- scope?: string[];
67
- redirect_uri?: string;
68
- is_multi_factor_auth_enabled?: boolean;
69
- state?: string;
70
- };
71
-
72
- export type MagicLinkLoginInput = {
73
- email: string;
74
- roles?: string[];
75
- scopes?: string[];
76
- state?: string;
77
- redirect_uri?: string;
78
- };
79
-
80
- export type VerifyEmailInput = { token: string; state?: string };
81
-
82
- export type VerifyOtpInput = { email: string; otp: string; state?: string };
83
-
84
- export type ResendOtpInput = { email: string };
85
-
86
- export type GraphqlQueryInput = {
87
- query: string;
88
- variables?: Record<string, any>;
89
- headers?: Headers;
90
- };
91
-
92
- export type MetaData = {
93
- version: string;
94
- client_id: string;
95
- is_google_login_enabled: boolean;
96
- is_facebook_login_enabled: boolean;
97
- is_github_login_enabled: boolean;
98
- is_linkedin_login_enabled: boolean;
99
- is_apple_login_enabled: boolean;
100
- is_twitter_login_enabled: boolean;
101
- is_microsoft_login_enabled: boolean;
102
- is_email_verification_enabled: boolean;
103
- is_basic_authentication_enabled: boolean;
104
- is_magic_link_login_enabled: boolean;
105
- is_sign_up_enabled: boolean;
106
- is_strong_password_enabled: boolean;
107
- };
108
-
109
- export type UpdateProfileInput = {
110
- old_password?: string;
111
- new_password?: string;
112
- confirm_new_password?: string;
113
- email?: string;
114
- given_name?: string;
115
- family_name?: string;
116
- middle_name?: string;
117
- nickname?: string;
118
- gender?: string;
119
- birthdate?: string;
120
- phone_number?: string;
121
- picture?: string;
122
- is_multi_factor_auth_enabled?: boolean;
123
- };
124
-
125
- export type ForgotPasswordInput = {
126
- email: string;
127
- state?: string;
128
- redirect_uri?: string;
129
- };
130
-
131
- export type ResetPasswordInput = {
132
- token: string;
133
- password: string;
134
- confirm_password: string;
135
- };
136
-
137
- export type SessionQueryInput = {
138
- roles?: string[];
139
- };
140
-
141
- export type IsValidJWTQueryInput = {
142
- jwt: string;
143
- roles?: string[];
144
- };
145
-
146
- export type ValidJWTResponse = {
147
- valid: string;
148
- message: string;
149
- };
1
+ export interface ConfigType {
2
+ authorizerURL: string
3
+ redirectURL: string
4
+ clientID: string
5
+ extraHeaders?: Record<string, string>
6
+ }
7
+
8
+ export interface User {
9
+ id: string
10
+ email: string
11
+ preferred_username: string
12
+ email_verified: boolean
13
+ signup_methods: string
14
+ given_name?: string | null
15
+ family_name?: string | null
16
+ middle_name?: string | null
17
+ nickname?: string | null
18
+ picture?: string | null
19
+ gender?: string | null
20
+ birthdate?: string | null
21
+ phone_number?: string | null
22
+ phone_number_verified?: boolean | null
23
+ roles?: string[]
24
+ created_at: number
25
+ updated_at: number
26
+ is_multi_factor_auth_enabled?: boolean
27
+ }
28
+
29
+ export interface AuthToken {
30
+ message?: string
31
+ access_token: string
32
+ expires_in: number
33
+ id_token: string
34
+ refresh_token?: string
35
+ user?: User
36
+ should_show_otp_screen?: boolean
37
+ }
38
+
39
+ export interface Response {
40
+ message: string
41
+ }
42
+
43
+ export type Headers = Record<string, string>
44
+
45
+ export interface LoginInput {
46
+ email: string
47
+ password: string
48
+ roles?: string[]
49
+ scope?: string[]
50
+ state?: string
51
+ }
52
+
53
+ export interface SignupInput {
54
+ email: string
55
+ password: string
56
+ confirm_password: string
57
+ given_name?: string
58
+ family_name?: string
59
+ middle_name?: string
60
+ nickname?: string
61
+ picture?: string
62
+ gender?: string
63
+ birthdate?: string
64
+ phone_number?: string
65
+ roles?: string[]
66
+ scope?: string[]
67
+ redirect_uri?: string
68
+ is_multi_factor_auth_enabled?: boolean
69
+ state?: string
70
+ }
71
+
72
+ export interface MagicLinkLoginInput {
73
+ email: string
74
+ roles?: string[]
75
+ scopes?: string[]
76
+ state?: string
77
+ redirect_uri?: string
78
+ }
79
+
80
+ export interface VerifyEmailInput { token: string; state?: string }
81
+
82
+ export interface VerifyOtpInput { email: string; otp: string; state?: string }
83
+
84
+ export interface ResendOtpInput { email: string }
85
+
86
+ export interface GraphqlQueryInput {
87
+ query: string
88
+ variables?: Record<string, any>
89
+ headers?: Headers
90
+ }
91
+
92
+ export interface MetaData {
93
+ version: string
94
+ client_id: string
95
+ is_google_login_enabled: boolean
96
+ is_facebook_login_enabled: boolean
97
+ is_github_login_enabled: boolean
98
+ is_linkedin_login_enabled: boolean
99
+ is_apple_login_enabled: boolean
100
+ is_twitter_login_enabled: boolean
101
+ is_microsoft_login_enabled: boolean
102
+ is_email_verification_enabled: boolean
103
+ is_basic_authentication_enabled: boolean
104
+ is_magic_link_login_enabled: boolean
105
+ is_sign_up_enabled: boolean
106
+ is_strong_password_enabled: boolean
107
+ }
108
+
109
+ export interface UpdateProfileInput {
110
+ old_password?: string
111
+ new_password?: string
112
+ confirm_new_password?: string
113
+ email?: string
114
+ given_name?: string
115
+ family_name?: string
116
+ middle_name?: string
117
+ nickname?: string
118
+ gender?: string
119
+ birthdate?: string
120
+ phone_number?: string
121
+ picture?: string
122
+ is_multi_factor_auth_enabled?: boolean
123
+ }
124
+
125
+ export interface ForgotPasswordInput {
126
+ email: string
127
+ state?: string
128
+ redirect_uri?: string
129
+ }
130
+
131
+ export interface ResetPasswordInput {
132
+ token: string
133
+ password: string
134
+ confirm_password: string
135
+ }
136
+
137
+ export interface SessionQueryInput {
138
+ roles?: string[]
139
+ }
140
+
141
+ export interface IsValidJWTQueryInput {
142
+ jwt: string
143
+ roles?: string[]
144
+ }
145
+
146
+ export interface ValidJWTResponse {
147
+ valid: string
148
+ message: string
149
+ }
150
150
 
151
151
  export enum OAuthProviders {
152
- Apple = 'apple',
153
- Github = 'github',
154
- Google = 'google',
155
- Facebook = 'facebook',
156
- LinkedIn = 'linkedin',
152
+ Apple = 'apple',
153
+ Github = 'github',
154
+ Google = 'google',
155
+ Facebook = 'facebook',
156
+ LinkedIn = 'linkedin',
157
157
  }
158
158
 
159
159
  export enum ResponseTypes {
160
- Code = 'code',
161
- Token = 'token',
162
- }
163
-
164
- export type AuthorizeInput = {
165
- response_type: ResponseTypes;
166
- use_refresh_token?: boolean;
167
- response_mode?: string;
168
- };
169
-
170
- export type AuthorizeResponse = {
171
- state: string;
172
- code?: string;
173
- error?: string;
174
- error_description?: string;
175
- };
176
-
177
- export type RevokeTokenInput = {
178
- refresh_token: string;
179
- };
180
-
181
- export type GetTokenInput = {
182
- code?: string;
183
- grant_type?: string;
184
- refresh_token?: string;
185
- };
186
-
187
- export type GetTokenResponse = {
188
- access_token: string;
189
- expires_in: number;
190
- id_token: string;
191
- refresh_token?: string;
192
- };
193
-
194
- export type ValidateJWTTokenInput = {
195
- token_type: 'access_token' | 'id_token' | 'refresh_token';
196
- token: string;
197
- roles?: string[];
198
- };
199
-
200
- export type ValidateJWTTokenResponse = {
201
- is_valid: boolean;
202
- claims: Record<string, any>;
203
- };
160
+ Code = 'code',
161
+ Token = 'token',
162
+ }
163
+
164
+ export interface AuthorizeInput {
165
+ response_type: ResponseTypes
166
+ use_refresh_token?: boolean
167
+ response_mode?: string
168
+ }
169
+
170
+ export interface AuthorizeResponse {
171
+ state: string
172
+ code?: string
173
+ error?: string
174
+ error_description?: string
175
+ }
176
+
177
+ export interface RevokeTokenInput {
178
+ refresh_token: string
179
+ }
180
+
181
+ export interface GetTokenInput {
182
+ code?: string
183
+ grant_type?: string
184
+ refresh_token?: string
185
+ }
186
+
187
+ export interface GetTokenResponse {
188
+ access_token: string
189
+ expires_in: number
190
+ id_token: string
191
+ refresh_token?: string
192
+ }
193
+
194
+ export interface ValidateJWTTokenInput {
195
+ token_type: 'access_token' | 'id_token' | 'refresh_token'
196
+ token: string
197
+ roles?: string[]
198
+ }
199
+
200
+ export interface ValidateJWTTokenResponse {
201
+ is_valid: boolean
202
+ claims: Record<string, any>
203
+ }