@@ -51,15 +51,15 @@ declare namespace OAuth2Server {
51
51
*/
52
52
class Request {
53
53
body ?: any ;
54
- headers ?: { [ key : string ] : string ; } | undefined ;
55
- method ?: string | undefined ;
56
- query ?: { [ key : string ] : string ; } | undefined ;
54
+ headers ?: Record < string , string > ;
55
+ method ?: string ;
56
+ query ?: Record < string , string > ;
57
57
58
58
/**
59
59
* Instantiates Request using the supplied options.
60
60
*
61
61
*/
62
- constructor ( options ?: { [ key : string ] : any } | http . IncomingMessage ) ;
62
+ constructor ( options ?: Record < string , any > | http . IncomingMessage ) ;
63
63
64
64
/**
65
65
* Returns the specified HTTP header field. The match is case-insensitive.
@@ -79,14 +79,14 @@ declare namespace OAuth2Server {
79
79
*/
80
80
class Response {
81
81
body ?: any ;
82
- headers ?: { [ key : string ] : string ; } | undefined ;
83
- status ?: number | undefined ;
82
+ headers ?: Record < string , string > ;
83
+ status ?: number ;
84
84
85
85
/**
86
86
* Instantiates Response using the supplied options.
87
87
*
88
88
*/
89
- constructor ( options ?: { [ key : string ] : any ; } | http . ServerResponse ) ;
89
+ constructor ( options ?: Record < string , any > | http . ServerResponse ) ;
90
90
91
91
/**
92
92
* Returns the specified HTTP header field. The match is case-insensitive.
@@ -173,66 +173,66 @@ declare namespace OAuth2Server {
173
173
/**
174
174
* Set the X-Accepted-OAuth-Scopes HTTP header on response objects.
175
175
*/
176
- addAcceptedScopesHeader ?: boolean | undefined ;
176
+ addAcceptedScopesHeader ?: boolean ;
177
177
178
178
/**
179
179
* Set the X-OAuth-Scopes HTTP header on response objects.
180
180
*/
181
- addAuthorizedScopesHeader ?: boolean | undefined ;
181
+ addAuthorizedScopesHeader ?: boolean ;
182
182
183
183
/**
184
184
* Allow clients to pass bearer tokens in the query string of a request.
185
185
*/
186
- allowBearerTokensInQueryString ?: boolean | undefined ;
186
+ allowBearerTokensInQueryString ?: boolean ;
187
187
}
188
188
189
189
interface AuthorizeOptions {
190
190
/**
191
191
* The authenticate handler
192
192
*/
193
- authenticateHandler ?: { } | undefined ;
193
+ authenticateHandler ?: { } ;
194
194
195
195
/**
196
196
* Allow clients to specify an empty state
197
197
*/
198
- allowEmptyState ?: boolean | undefined ;
198
+ allowEmptyState ?: boolean ;
199
199
200
200
/**
201
201
* Lifetime of generated authorization codes in seconds (default = 5 minutes).
202
202
*/
203
- authorizationCodeLifetime ?: number | undefined ;
203
+ authorizationCodeLifetime ?: number ;
204
204
}
205
205
206
206
interface TokenOptions {
207
207
/**
208
208
* Lifetime of generated access tokens in seconds (default = 1 hour)
209
209
*/
210
- accessTokenLifetime ?: number | undefined ;
210
+ accessTokenLifetime ?: number ;
211
211
212
212
/**
213
213
* Lifetime of generated refresh tokens in seconds (default = 2 weeks)
214
214
*/
215
- refreshTokenLifetime ?: number | undefined ;
215
+ refreshTokenLifetime ?: number ;
216
216
217
217
/**
218
218
* Allow extended attributes to be set on the returned token
219
219
*/
220
- allowExtendedTokenAttributes ?: boolean | undefined ;
220
+ allowExtendedTokenAttributes ?: boolean ;
221
221
222
222
/**
223
223
* Require a client secret. Defaults to true for all grant types.
224
224
*/
225
- requireClientAuthentication ?: { } | undefined ;
225
+ requireClientAuthentication ?: { } ;
226
226
227
227
/**
228
228
* Always revoke the used refresh token and issue a new one for the refresh_token grant.
229
229
*/
230
- alwaysIssueNewRefreshToken ?: boolean | undefined ;
230
+ alwaysIssueNewRefreshToken ?: boolean ;
231
231
232
232
/**
233
233
* Additional supported grant types.
234
234
*/
235
- extendedGrantTypes ?: { [ key : string ] : typeof AbstractGrantType } | undefined ;
235
+ extendedGrantTypes ?: Record < string , typeof AbstractGrantType > ;
236
236
}
237
237
238
238
/**
@@ -392,10 +392,10 @@ declare namespace OAuth2Server {
392
392
*/
393
393
interface Client {
394
394
id : string ;
395
- redirectUris ?: string | string [ ] | undefined ;
395
+ redirectUris ?: string | string [ ] ;
396
396
grants : string | string [ ] ;
397
- accessTokenLifetime ?: number | undefined ;
398
- refreshTokenLifetime ?: number | undefined ;
397
+ accessTokenLifetime ?: number ;
398
+ refreshTokenLifetime ?: number ;
399
399
[ key : string ] : any ;
400
400
}
401
401
@@ -406,7 +406,7 @@ declare namespace OAuth2Server {
406
406
authorizationCode : string ;
407
407
expiresAt : Date ;
408
408
redirectUri : string ;
409
- scope ?: string [ ] | undefined ;
409
+ scope ?: string [ ] ;
410
410
client : Client ;
411
411
user : User ;
412
412
codeChallenge ?: string ;
@@ -419,10 +419,10 @@ declare namespace OAuth2Server {
419
419
*/
420
420
interface Token {
421
421
accessToken : string ;
422
- accessTokenExpiresAt ?: Date | undefined ;
423
- refreshToken ?: string | undefined ;
424
- refreshTokenExpiresAt ?: Date | undefined ;
425
- scope ?: string [ ] | undefined ;
422
+ accessTokenExpiresAt ?: Date ;
423
+ refreshToken ?: string ;
424
+ refreshTokenExpiresAt ?: Date ;
425
+ scope ?: string [ ] ;
426
426
client : Client ;
427
427
user : User ;
428
428
[ key : string ] : any ;
@@ -433,8 +433,8 @@ declare namespace OAuth2Server {
433
433
*/
434
434
interface RefreshToken {
435
435
refreshToken : string ;
436
- refreshTokenExpiresAt ?: Date | undefined ;
437
- scope ?: string [ ] | undefined ;
436
+ refreshTokenExpiresAt ?: Date ;
437
+ scope ?: string [ ] ;
438
438
client : Client ;
439
439
user : User ;
440
440
[ key : string ] : any ;
0 commit comments