Skip to content

Commit 28cb62d

Browse files
committed
Fixed spacing
1 parent b8ed711 commit 28cb62d

16 files changed

Lines changed: 36 additions & 36 deletions

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ Please use our issue-tracker: https://github.com/StatelessStudio/pointyapi/issue
88

99
## Contributing Code
1010

11-
You can contribute code by creating a pull request. Please create/find an issue for the problem first, and discuss with an administrator.
11+
You can contribute code by creating a pull request. Please create/find an issue for the problem first, and discuss with an administrator.

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133

134134
## [1.0.0] Feb-27-2019
135135

136-
First major release. View the migration guide: ([MIGRATION GUIDE](https://github.com/StatelessStudio/pointyapi/blob/master/migration.md))
136+
First major release. View the migration guide: ([MIGRATION GUIDE](https://github.com/StatelessStudio/pointyapi/blob/master/migration.md))
137137

138138
### Breaking Changes
139139
- [Issue #78] Removed response parameter from responder functions

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,9 @@ npm i pointyapi
296296
router.delete(`/:id`, loader, onlySelf, deleteEndpoint);
297297
```
298298

299-
Notice `onlySelf` - that means only the user can access this route. We're not logged in yet, so we're certainly not "self"
299+
Notice `onlySelf` - that means only the user can access this route. We're not logged in yet, so we're certainly not "self"
300300

301-
Create another router file, `src/routes/auth.ts`. This will be our authentication route so that we can log-in.
301+
Create another router file, `src/routes/auth.ts`. This will be our authentication route so that we can log-in.
302302

303303
```typescript
304304
// src/routes/auth.ts

migration.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
## Version 0.x.x -> 1.x.x
1010

1111
1. Remove `response` parameter from responders and handlers
12-
Responders and handlers no longer take a `response` parameter, so you just need to remove the parameter from all calls to the following functions. This is easiest via find and replace (pro tip: use regex!)
12+
Responders and handlers no longer take a `response` parameter, so you just need to remove the parameter from all calls to the following functions. This is easiest via find and replace (pro tip: use regex!)
1313
- `response.error()`
1414
- `response.conflictResponder()`
1515
- `response.deleteResponder()`
@@ -21,7 +21,7 @@
2121
- `response.unauthorizedResponder()`
2222
- `response.validationResponder()`
2323
2. Rename hooks
24-
Hooks have been renamed for clarity. Rename all hooks in your models (pro tip: project-wide find & replace). **Make sure you go in order, and replace all occourences before moving on, because some hook names conflict with old hook names!**
24+
Hooks have been renamed for clarity. Rename all hooks in your models (pro tip: project-wide find & replace). **Make sure you go in order, and replace all occourences before moving on, because some hook names conflict with old hook names!**
2525
- `beforePut()` -> `beforePatch()`
2626
- `beforeGet()` -> REMOVED
2727
- `beforeDelete()` -> `delete()`
@@ -43,15 +43,15 @@
4343
}
4444
});
4545
```
46-
4. Remove `deleteFilter`. This filter does not have any value
46+
4. Remove `deleteFilter`. This filter does not have any value
4747
5. Update import directories
4848
- `/fork-server` -> `/utils`
4949
- `/get-identifier-value` -> `/utils`
5050
- `/listen` -> `/utils`
5151
- `/run-hooks` -> `/utils`
5252
- `/upgrade-user-role` -> `/utils`
5353
6. Update `setModel()` for auth routers
54-
Previously, `setModel()` would run the incorrect hooks for auth routers, and may even lead to deleting the wrong user's token. This has been fixed by passing `true` to the fourth parameter (`isAuth`)
54+
Previously, `setModel()` would run the incorrect hooks for auth routers, and may even lead to deleting the wrong user's token. This has been fixed by passing `true` to the fourth parameter (`isAuth`)
5555

5656
```typescript
5757
// Set model
@@ -64,14 +64,14 @@
6464
});
6565
```
6666
7. Make sure all hooks are `async` functions
67-
Hooks must now be async functions. Search through hooks, and replace with `public async HOOK_NAME()`
67+
Hooks must now be async functions. Search through hooks, and replace with `public async HOOK_NAME()`
6868
8. Make sure hooks utilize this.
6969
Hooks are now bound to the resource, and should utilize `this.` notation
7070
9. Make sure hooks don't loop
7171
Hooks are called once per object, therefore they should only take care of one resource at a time
7272
11. Default resources can now be added via `addResource(User, {...})`
7373
12. Update GET queries.
74-
GET queries have been reworked. The following field names have changed:
74+
GET queries have been reworked. The following field names have changed:
7575
- `__select` => `select`
7676
- `__whereAnyOf` => `whereAnyOf`
7777
- `__search` => `search`
@@ -109,7 +109,7 @@
109109
17. Remove empty searches.
110110
Get queries no longer require a `search` key to access other query keys
111111
18. All mdoel members must be initialized to undefined, including relational arrays
112-
19. Queries may no longer pass special keys with `__` or `___`. You should now put these queries in the `additionalParameters` query object
112+
19. Queries may no longer pass special keys with `__` or `___`. You should now put these queries in the `additionalParameters` query object
113113

114114
## Version 1.x.x -> 2.x.x
115115

@@ -118,7 +118,7 @@
118118
1. Make a POST endpoint in your auth router:
119119
`router.post('/refresh', loader, refreshTokenEndpoint);`
120120
2. Update your front-end auth refreshTokenservice to save the `refreshToken` and `refreshExpiration` from the `loginEndpoint`
121-
3. Set a timeout to call the `refreshTokenEndpoint` route when the access token expires. Setup the body like this: `{ __refreshToken: myRefreshToken }`. This will return an updated user object, including a new access token & expiration time.
121+
3. Set a timeout to call the `refreshTokenEndpoint` route when the access token expires. Setup the body like this: `{ __refreshToken: myRefreshToken }`. This will return an updated user object, including a new access token & expiration time.
122122
3. **(Optional)** PointyAPI now supports `UUID`. Follow the steps in the Readme to enable UUID (strongly recommended for production).
123123

124124
**NOTE** If you are already in production and decide to migrate to UUID, you must make sure to update relations etc

src/bodyguard.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* # Bodyguards
33
*
44
* Bodyguards are guards that operate on the body (*request.query,
5-
* request.body*). Bodyguards come in two forms:
5+
* request.body*). Bodyguards come in two forms:
66
* - Guards
77
* - Guards block incoming requests, e.g. a basic user
88
* who tries to delete an admin
@@ -11,7 +11,7 @@
1111
*
1212
* ## Decorators
1313
*
14-
* Decorators are used to set read/write privelages on your model. There
14+
* Decorators are used to set read/write privelages on your model. There
1515
* are several decorators already available for you:
1616
* - Read
1717
* - CanRead(who?)
@@ -34,16 +34,16 @@
3434
*
3535
* ### BodyguardKey
3636
*
37-
* There is one additional decorator: `BodyguardKey`. This key will be
38-
* presented to the guards/filters to authorize the request. For example, the
37+
* There is one additional decorator: `BodyguardKey`. This key will be
38+
* presented to the guards/filters to authorize the request. For example, the
3939
* `userId` of a User would be the BodyguardKey, or the `fromUserId` and
40-
* `toUserId` would be the BodyguardKeys on a Chat model. When the
40+
* `toUserId` would be the BodyguardKeys on a Chat model. When the
4141
* bodyguard runs, it will compare the authenticated user with the
4242
* BodyguardKey of the resource.
4343
*
4444
* ## How to Use?
4545
*
46-
* Guards, Endpoints, and Responders contain bodyguards underneath. If you
46+
* Guards, Endpoints, and Responders contain bodyguards underneath. If you
4747
* are not writing custom guards or responders, you will only need to set the
4848
* decorators on your model.
4949
*

src/database.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
* ## Setting Entities
1313
*
14-
* You will need to tell the database what entities to use. **You should do
14+
* You will need to tell the database what entities to use. **You should do
1515
* this in your `pointy.before` function.**
1616
* ```typescript
1717
* import { pointy } from 'pointyapi';
@@ -30,7 +30,7 @@
3030
* ## Creating Custom Database Drivers
3131
*
3232
* You can create a custom database driver class by extending the BaseDb class.
33-
* You will also need to set the pointyapi database. You must run
33+
* You will also need to set the pointyapi database. You must run
3434
* TypeORM's `createConnection` function in your `Database::connect()`
3535
*
3636
* ```typescript

src/database/base-db.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export class BaseDb {
1111
// Database entities
1212
public entities: any[] = [ ExampleUser ];
1313

14-
// Connection name. Default is "default"
14+
// Connection name. Default is "default"
1515
public connectionName = 'default';
1616

1717
// Auto-sync (Empties database on restart, not for production!)

src/database/postgres.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export class PointyPostgres extends BaseDb {
1111
/**
1212
* Connect to the database
1313
* @param options Database credentials (pass
14-
* a string to load from file, or pass the object directly). Database
14+
* a string to load from file, or pass the object directly). Database
1515
* will rely on `process.env.DATABASE_URL` if this is not set.
1616
*/
1717
public connect(options?: string | Object): Promise<Connection> {

src/endpoints.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* # Endpoints
33
*
44
* Endpoints are where the action of a route actually takes place,
5-
* for example posting a resource or logging in. The following
5+
* for example posting a resource or logging in. The following
66
* endpoints come premade:
77
* - CRUD
88
* - postEndpoint
@@ -15,7 +15,7 @@
1515
*
1616
* ## Using endpoints
1717
*
18-
* Endpoints go in your route, after any guards. You'll have to
18+
* Endpoints go in your route, after any guards. You'll have to
1919
* set a model so the guards and endpoints know what you're working with.
2020
*
2121
* ```typescript

src/handlers/error-handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { createTimestamp } from '../utils/create-timestamp';
44
* Default error handler
55
* @param error Error message/object to send to the client (or
66
* database error object to check)
7-
* @param code Error response code to send. Default is 500
7+
* @param code Error response code to send. Default is 500
88
*/
99
export function errorHandler(error: any, code: number = 500): void {
1010
// Check for known errors

0 commit comments

Comments
 (0)