@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/README.md +17 -0
- package/lib/authorizer.min.js +1 -15
- package/lib/authorizer.min.js.map +1 -1
- package/lib/cjs/index.d.ts +6 -6
- package/lib/cjs/index.js +67 -91
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/types.d.ts +51 -51
- package/lib/constants.d.ts +3 -0
- package/lib/esm/index.d.ts +6 -6
- package/lib/esm/index.js +66 -90
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/types.d.ts +51 -51
- package/lib/index.d.ts +29 -0
- package/lib/types.d.ts +185 -0
- package/lib/utils.d.ts +13 -0
- package/package.json +50 -46
- package/src/constants.ts +3 -3
- package/src/index.ts +464 -458
- package/src/types.ts +198 -198
- package/src/utils.ts +125 -127
package/src/types.ts
CHANGED
|
@@ -1,203 +1,203 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export type Headers = Record<string, string
|
|
44
|
-
|
|
45
|
-
export
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export
|
|
81
|
-
|
|
82
|
-
export
|
|
83
|
-
|
|
84
|
-
export
|
|
85
|
-
|
|
86
|
-
export
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
export
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
export
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
export
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
export
|
|
147
|
-
|
|
148
|
-
|
|
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
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
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
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
export
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
export
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
export
|
|
178
|
-
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
export
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
export
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
export
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
export
|
|
201
|
-
|
|
202
|
-
|
|
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
|
+
}
|