Skip to content

Commit

Permalink
Merge branch 'dove' of github.com:feathersjs/feathers into dove-typeb…
Browse files Browse the repository at this point in the history
…ox-enum
  • Loading branch information
daffl committed Nov 3, 2022
2 parents f5a6e9a + ec94421 commit 09aa642
Show file tree
Hide file tree
Showing 93 changed files with 13,499 additions and 28,012 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [5.0.0-pre.32](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.31...v5.0.0-pre.32) (2022-10-26)

### Bug Fixes

- **authentication:** Improve logout and disconnect connection handling ([#2813](https://github.com/feathersjs/feathers/issues/2813)) ([dd77379](https://github.com/feathersjs/feathers/commit/dd77379d8bdcd32d529bef912e672639e4899823))
- **cli:** Ensure code injection points are not code style dependent ([#2832](https://github.com/feathersjs/feathers/issues/2832)) ([0776e26](https://github.com/feathersjs/feathers/commit/0776e26bfe4c1df9d2786499941bd3faba1715c0))
- **cli:** Only generate authentication setup when selected ([#2823](https://github.com/feathersjs/feathers/issues/2823)) ([7d219d9](https://github.com/feathersjs/feathers/commit/7d219d9c5269267b50f3ce99a5653d645f9927c1))
- **docs:** Review transport API docs and update Express middleware setup ([#2811](https://github.com/feathersjs/feathers/issues/2811)) ([1b97f14](https://github.com/feathersjs/feathers/commit/1b97f14d474f5613482f259eeaa585c24fcfab43))
- **schema:** Improve resolver performance ([#2822](https://github.com/feathersjs/feathers/issues/2822)) ([5fa900f](https://github.com/feathersjs/feathers/commit/5fa900f90d55859332c90283dddddab26ae3759c))
- **schema:** Use the same options for resolveData hook ([#2833](https://github.com/feathersjs/feathers/issues/2833)) ([ed3b050](https://github.com/feathersjs/feathers/commit/ed3b05051db6886729d4824825ca8f00c2459af7))
- **transports:** Add remaining middleware for generated apps to Koa and Express ([#2796](https://github.com/feathersjs/feathers/issues/2796)) ([0d5781a](https://github.com/feathersjs/feathers/commit/0d5781a5c72a0cbb2ec8211bfa099f0aefe115a2))

### Features

- **cli:** Add authentication client to generated client ([#2801](https://github.com/feathersjs/feathers/issues/2801)) ([bd59f91](https://github.com/feathersjs/feathers/commit/bd59f91b45a01c2eea0c4386e567f4de5aa6ad99))
- **docs:** New website and documentation pages ([#2802](https://github.com/feathersjs/feathers/issues/2802)) ([ae85fa2](https://github.com/feathersjs/feathers/commit/ae85fa216f12f7ff5d15e7039640e27a09989ea4))

# [5.0.0-pre.31](https://github.com/feathersjs/feathers/compare/v5.0.0-pre.30...v5.0.0-pre.31) (2022-10-12)

### Bug Fixes
Expand Down
6 changes: 6 additions & 0 deletions docs/.vitepress/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ declare module '@vue/runtime-core' {
Badges: typeof import('./components/Badges.vue')['default']
BlockQuote: typeof import('./components/BlockQuote.vue')['default']
Contributors: typeof import('./components/Contributors.vue')['default']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElInput: typeof import('element-plus/es')['ElInput']
ElOption: typeof import('element-plus/es')['ElOption']
ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElSelect: typeof import('element-plus/es')['ElSelect']
FeaturesList: typeof import('./components/FeaturesList.vue')['default']
LanguageBlock: typeof import('./components/LanguageBlock.vue')['default']
LanguageSelect: typeof import('./components/LanguageSelect.vue')['default']
Expand Down
11 changes: 9 additions & 2 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ export default defineConfig({
}
]
},
{
text: 'Awesome',
link: '/awesome/'
},
{
text: 'Ecosystem',
items: [
Expand Down Expand Up @@ -211,9 +215,12 @@ export default defineConfig({
},
{
text: 'Frontend',
// collapsible: true,
// collapsed: true,
collapsible: true,
items: [
{
text: 'JavaScript',
link: '/guides/frontend/javascript.md'
}
// {
// text: 'Frontend Frameworks',
// link: '/guides/frameworks.md'
Expand Down
9 changes: 9 additions & 0 deletions docs/.vitepress/style/element-plus.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@forward 'element-plus/theme-chalk/src/common/var.scss' with (
$colors: (
'primary': (
'base': #745847
)
)
);

@use 'element-plus/theme-chalk/src/index.scss';
4 changes: 4 additions & 0 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import Logo from '../components/Logo.vue'
import BlockQuote from '../components/BlockQuote.vue'
import LanguageBlock from '../components/LanguageBlock.vue'

import '../style/element-plus.scss'
import 'element-plus/theme-chalk/dark/css-vars.css'
// import 'element-plus/dist/index.css'

if (inBrowser) import('./pwa')

export default {
Expand Down
38 changes: 20 additions & 18 deletions docs/api/client/rest.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ Retrieves a list of all matching resources from the service
GET /messages?status=read&user=10
```

Will call `messages.find({ query: { status: 'read', user: '10' } })` on the server.
Will call `messages.find({ query: { status: 'read', userId: '10' } })` on the server.

If you want to use any of the built-in find operands ($le, $lt, $ne, $eq, $in, etc.) the general format is as follows:

Expand All @@ -356,9 +356,9 @@ The find API allows the use of $limit, $skip, $sort, and $select in the query. T

```
// Find all messages that are read, limit to 10, only include text field.
{"read":"1", "$limit":10, "$select": ["name"] } } // JSON
{"status": "read", "$limit":10, "$select": ["name"] } } // JSON
GET /messages?read=1&$limit=10&$select[]=text // HTTP
GET /messages?status=read&$limit=10&$select[]=text // HTTP
```

More information about the possible parameters for official database adapters can be found [in the database querying section](../databases/querying.md).
Expand All @@ -374,10 +374,10 @@ GET /messages/1
Will call `messages.get(1, {})` on the server.

```
GET /messages/1?fetch=all
GET /messages/1?status=read
```

Will call `messages.get(1, { query: { fetch: 'all' } })` on the server.
Will call `messages.get(1, { query: { status: 'read' } })` on the server.

### create

Expand Down Expand Up @@ -413,32 +413,32 @@ PUT /messages/2
{ "text": "I really have to do laundry" }
```

Will call `messages.update(2, { "text": "I really have to do laundry" }, {})` on the server. When no `id` is given by sending the request directly to the endpoint something like:
Will call `messages.update(2, { text: 'I really have to do laundry' }, {})` on the server. When no `id` is given by sending the request directly to the endpoint something like:

```
PUT /messages?complete=false
{ "complete": true }
PUT /messages?status=unread
{ "status": "read" }
```

Will call `messages.update(null, { "complete": true }, { query: { complete: 'false' } })` on the server.
Will call `messages.update(null, { status: 'read' }, { query: { status: 'unread' } })` on the server.

### patch

Merge the existing data of a single or multiple resources with the new `data`.

```
PATCH /messages/2
{ "read": true }
{ "status": "read" }
```

Will call `messages.patch(2, { "read": true }, {})` on the server. When no `id` is given by sending the request directly to the endpoint something like:
Will call `messages.patch(2, { status: 'read' }, {})` on the server. When no `id` is given by sending the request directly to the endpoint something like:

```
PATCH /messages?complete=false
{ "complete": true }
PATCH /messages?status=unread
{ "status": "read" }
```

Will call `messages.patch(null, { complete: true }, { query: { complete: 'false' } })` on the server to change the status for all read messages.
Will call `messages.patch(null, { status: 'read' }, { query: { status: 'unread' } })` on the server to change the status for all read messages.

<BlockQuote type="info" label="note">

Expand All @@ -453,18 +453,18 @@ This is supported out of the box by the Feathers [database adapters](../database
Remove a single or multiple resources:

```
DELETE /messages/2?cascade=true
DELETE /messages/2
```

Will call `messages.remove(2, { query: { cascade: 'true' } })`.
Will call `messages.remove(2, {} })`.

When no `id` is given by sending the request directly to the endpoint something like:

```
DELETE /messages?read=true
DELETE /messages?status=archived
```

Will call `messages.remove(null, { query: { read: 'true' } })` to delete all read messages.
Will call `messages.remove(null, { query: { status: 'archived' } })` to delete all read messages.

<BlockQuote type="info" label="note">

Expand All @@ -491,3 +491,5 @@ Via CURL:
```bash
curl -H "Content-Type: application/json" -H "X-Service-Method: myCustomMethod" -X POST -d '{"message": "Hello world"}' http://localhost:3030/myservice
```

This will call `messages.myCustomMethod({ message: 'Hello world' }, {})`.
24 changes: 12 additions & 12 deletions docs/api/client/socketio.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,12 @@ socket.emit('get', 'messages', 1, (error, message) => {
Will call `app.service('messages').get(1, {})` on the server.

```js
socket.emit('get', 'messages', 1, { fetch: 'all' }, (error, message) => {
socket.emit('get', 'messages', 1, { status: 'read' }, (error, message) => {
console.log('Found message', message)
})
```

Will call `app.service('messages').get(1, { query: { fetch: 'all' } })` on the server.
Will call `app.service('messages').get(1, { query: { status: 'read' } })` on the server.

### create

Expand Down Expand Up @@ -287,13 +287,13 @@ socket.emit(
'messages',
null,
{
complete: true
status: 'unread'
},
{ complete: false }
{ status: 'read' }
)
```

Will call `app.service('messages').update(null, { complete: true }, { query: { complete: 'false' } })` on the server.
Will call `app.service('messages').update(null, { status: 'read' }, { query: { satus: 'unread' } })` on the server.

### patch

Expand Down Expand Up @@ -321,36 +321,36 @@ socket.emit(
'messages',
null,
{
complete: true
status: 'read'
},
{
complete: false
status: 'unread'
},
(error, message) => {
console.log('Patched message', message)
}
)
```

Will call `app.service('messages').patch(null, { complete: true }, { query: { complete: false } })` on the server, to change the status for all read app.service('messages').
Will call `app.service('messages').patch(null, { status: 'read' }, { query: { status: 'unread' } })` on the server, to change the status for all read app.service('messages').

### remove

Remove a single or multiple resources:

```js
socket.emit('remove', 'messages', 2, { cascade: true }, (error, message) => {
socket.emit('remove', 'messages', 2, {}, (error, message) => {
console.log('Removed a message', message)
})
```

Will call `app.service('messages').remove(2, { query: { cascade: true } })` on the server. The `id` can also be `null` to remove multiple resources:
Will call `app.service('messages').remove(2, {})` on the server. The `id` can also be `null` to remove multiple resources:

```js
socket.emit('remove', 'messages', null, { read: true })
socket.emit('remove', 'messages', null, { status: 'archived' })
```

Will call `app.service('messages').remove(null, { query: { read: 'true' } })` on the server to delete all read app.service('messages').
Will call `app.service('messages').remove(null, { query: { status: 'archived' } })` on the server to delete all messages with status `archived`.

### Custom methods

Expand Down
8 changes: 4 additions & 4 deletions docs/api/schema/resolvers.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ In a Feathers application, resolvers are used through [hooks](../hooks.md) to co

### resolveData

Data resolvers use the `schemaHooks.resolveData` hook and convert the `data` from a `create`, `update` or `patch` [service method](../services.md) or a [custom method](../services.md#custom-methods). This can be used to validate against the schema and e.g. hash a password before storing it in the database or to remove properties the user is not allowed to write. `schemaHooks.resolveData` can be used as an `around` and `before` hook.
Data resolvers use the `schemaHooks.resolveData(...resolvers)` hook and convert the `data` from a `create`, `update` or `patch` [service method](../services.md) or a [custom method](../services.md#custom-methods). This can be used to validate against the schema and e.g. hash a password before storing it in the database or to remove properties the user is not allowed to write. It is possible to pass multiple resolvers which will run in the order they are passed, using the previous data. `schemaHooks.resolveData` can be used as an `around` and `before` hook.

```ts
import type { HookContext } from '../declarations'
Expand Down Expand Up @@ -173,7 +173,7 @@ app.service('users').hooks({

### resolveResult

Result resolvers use the `schemaHooks.resolveResult` hook and resolve the data that is returned by a service call ([context.result](../hooks.md#context-result) in a hook). This can be used to populate associations or add other computed properties etc. `schemaHooks.resolveResult` can be used as an `around` and `after` hook.
Result resolvers use the `schemaHooks.resolveResult(...resolvers)` hook and resolve the data that is returned by a service call ([context.result](../hooks.md#context-result) in a hook). This can be used to populate associations or add other computed properties etc. It is possible to pass multiple resolvers which will run in the order they are passed, using the previous data. `schemaHooks.resolveResult` can be used as an `around` and `after` hook.

```ts
import { schemaHooks, resolve } from '@feathersjs/schema'
Expand Down Expand Up @@ -223,7 +223,7 @@ app.service('messages').hooks({

### resolveExternal

External (or dispatch) resolver use the `schemaHooks.resolveDispatch` hook to return a safe version of the data that will be sent to external clients. Returning `undefined` for a property resolver will exclude the property which can be used to hide sensitive data like the user password. This includes nested associations and real-time events. `schemaHooks.resolveExternal` can be used as an `around` or `after` hook.
External (or dispatch) resolver use the `schemaHooks.resolveDispatch(...resolvers)` hook to return a safe version of the data that will be sent to external clients. It is possible to pass multiple resolvers which will run in the order they are passed, using the previous data. Returning `undefined` for a property resolver will exclude the property which can be used to hide sensitive data like the user password. This includes nested associations and real-time events. `schemaHooks.resolveExternal` can be used as an `around` or `after` hook.

```ts
import { schemaHooks, resolve } from '@feathersjs/schema'
Expand Down Expand Up @@ -267,7 +267,7 @@ In order to get the safe data from resolved associations **all services** involv

### resolveQuery

Query resolvers use the `schemaHooks.resolveQuery` hook to modify `params.query`. This is often used to set default values or limit the query so a user can only request data they are allowed to see. `schemaHooks.resolveQuery` can be used as an `around` or `before` hook.
Query resolvers use the `schemaHooks.resolveQuery(...resolvers)` hook to modify `params.query`. This is often used to set default values or limit the query so a user can only request data they are allowed to see. It is possible to pass multiple resolvers which will run in the order they are passed, using the previous data. `schemaHooks.resolveQuery` can be used as an `around` or `before` hook.

```ts
import { schemaHooks, resolve } from '@feathersjs/schema'
Expand Down
5 changes: 5 additions & 0 deletions docs/auto-imports.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Generated by 'unplugin-auto-import'
export {}
declare global {

}
Loading

0 comments on commit 09aa642

Please # to comment.