Skip to content

Commit 0bff971

Browse files
committed
rewrite-in-typescript
1 parent f3ce1bb commit 0bff971

File tree

175 files changed

+13390
-9330
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

175 files changed

+13390
-9330
lines changed

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Editor configuration, see http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
end_of_line = lf
7+
indent_style = space
8+
indent_size = 2
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
12+
[*.md]
13+
max_line_length = off
14+
trim_trailing_whitespace = false

.gitignore

100644100755
Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
1-
node_modules/
2-
docs/_build/
3-
__pycache__/
4-
*.pyc
1+
2+
# IDE
3+
/.idea
4+
/.awcache
5+
/.vscode
6+
7+
# misc
8+
npm-debug.log
9+
10+
# example
11+
/quick-start
12+
13+
# tests
14+
# /test
15+
16+
# dist
17+
/dist
18+
/node_modules
19+
20+
.DS_Store
21+
# conf
522

.jshintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.jshintrc

Lines changed: 0 additions & 26 deletions
This file was deleted.

.npmignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all",
4+
"endOfLine": "lf"
5+
}

.travis.yml

100644100755
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
language: node_js
22

33
node_js:
4-
- 4
5-
- 4.0
6-
- 6
7-
- 6.0
8-
- 7
9-
- 7.0
4+
105
- 8
116
- 8.0
7+
- 10
8+
- 10.0
129

1310
sudo: false

CHANGELOG.md

100644100755
Lines changed: 3 additions & 0 deletions

LICENSE

100644100755
File mode changed.

README.md

100644100755
Lines changed: 1 addition & 5 deletions

docs/Makefile

100644100755
File mode changed.

docs/_static/custom.css

100644100755
File mode changed.

docs/_static/favicon.ico

100644100755
File mode changed.

docs/api/errors/access-denied-error.rst

100644100755
File mode changed.

docs/api/errors/index.rst

100644100755
File mode changed.

docs/api/errors/insufficient-scope-error.rst

100644100755
File mode changed.

docs/api/errors/invalid-argument-error.rst

100644100755
File mode changed.

docs/api/errors/invalid-client-error.rst

100644100755
File mode changed.

docs/api/errors/invalid-grant-error.rst

100644100755
File mode changed.

docs/api/errors/invalid-request-error.rst

100644100755
File mode changed.

docs/api/errors/invalid-scope-error.rst

100644100755
File mode changed.

docs/api/errors/invalid-token-error.rst

100644100755
File mode changed.

docs/api/errors/oauth-error.rst

100644100755
File mode changed.

docs/api/errors/server-error.rst

100644100755
File mode changed.

docs/api/errors/unauthorized-client-error.rst

100644100755
File mode changed.

docs/api/errors/unauthorized-request-error.rst

100644100755
File mode changed.

docs/api/errors/unsupported-grant-type-error.rst

100644100755
File mode changed.

docs/api/errors/unsupported-response-type-error.rst

100644100755
File mode changed.

docs/api/oauth2-server.rst

100644100755
File mode changed.

docs/api/request.rst

100644100755
File mode changed.

docs/api/response.rst

100644100755
File mode changed.

docs/conf.py

100644100755
File mode changed.

docs/docs/adapters.rst

100644100755
File mode changed.

docs/docs/getting-started.rst

100644100755
File mode changed.

docs/index.rst

100644100755
File mode changed.

docs/make.bat

100644100755
File mode changed.

docs/misc/extension-grants.rst

100644100755
File mode changed.

docs/misc/migrating-v2-to-v3.rst

100644100755
Lines changed: 1 addition & 5 deletions

docs/model/overview.rst

100644100755
File mode changed.

docs/model/spec.rst

100644100755
File mode changed.

docs/npm_conf.py

100644100755
File mode changed.

index.js

Lines changed: 0 additions & 35 deletions
This file was deleted.

index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import { OAuth2Server } from './lib/server';
2+
export default OAuth2Server;

lib/errors/access-denied-error.js

Lines changed: 0 additions & 38 deletions
This file was deleted.

lib/errors/access-denied-error.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { OAuthError } from './oauth-error';
2+
3+
/**
4+
* Constructor.
5+
*
6+
* "The resource owner or authorization server denied the request"
7+
*
8+
* @see https://tools.ietf.org/html/rfc6749#section-4.1.2.1
9+
*/
10+
11+
export class AccessDeniedError extends OAuthError {
12+
constructor(message?: string | Error, properties?: any) {
13+
super(message, { code: 400, name: 'access_denied', ...properties });
14+
}
15+
}

lib/errors/insufficient-scope-error.js

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { OAuthError } from './oauth-error';
2+
3+
/**
4+
* Constructor.
5+
*
6+
* "The request requires higher privileges than provided by the access token.."
7+
*
8+
* @see https://tools.ietf.org/html/rfc6750.html#section-3.1
9+
*/
10+
11+
export class InsufficientScopeError extends OAuthError {
12+
constructor(message?: string | Error, properties?: any) {
13+
super(message, { code: 403, name: 'insufficient_scope', ...properties });
14+
}
15+
}

lib/errors/invalid-argument-error.js

Lines changed: 0 additions & 34 deletions
This file was deleted.

lib/errors/invalid-argument-error.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { OAuthError } from './oauth-error';
2+
3+
export class InvalidArgumentError extends OAuthError {
4+
constructor(message?: string | Error, properties?: any) {
5+
super(message, { code: 500, name: 'invalid_argument', ...properties });
6+
}
7+
}

lib/errors/invalid-client-error.js

Lines changed: 0 additions & 39 deletions
This file was deleted.

lib/errors/invalid-client-error.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { OAuthError } from './oauth-error';
2+
3+
/**
4+
* Constructor.
5+
*
6+
* "Client authentication failed (e.g., unknown client, no client
7+
* authentication included, or unsupported authentication method)"
8+
*
9+
* @see https://tools.ietf.org/html/rfc6749#section-5.2
10+
*/
11+
12+
export class InvalidClientError extends OAuthError {
13+
constructor(message?: string | Error, properties?: any) {
14+
super(message, { code: 400, name: 'invalid_client', ...properties });
15+
}
16+
}

0 commit comments

Comments
 (0)