Skip to content

Commit 43de5d6

Browse files
committed
docs: add paramsForServer&whitelist to global
1 parent e178b8d commit 43de5d6

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

docs/getting-started.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -269,23 +269,26 @@ The following default options are available for configuration:
269269

270270
```js
271271
const defaultOptions = {
272-
// configured globally
272+
// only configured globally
273273
serverAlias: 'api',
274274
keepCopiesInStore: false,
275-
paramsForServer: [],
276-
whitelist: []
277275

278276
// also configurable per service
279277
idField: 'id',
280278
tempIdField: '__id',
279+
nameStyle: 'short',
280+
281281
debug: false,
282282
addOnUpsert: false,
283283
autoRemove: false,
284284
enableEvents: true,
285285
preferUpdate: false,
286286
replaceItems: false,
287287
skipRequestIfExists: false,
288-
nameStyle: 'short',
288+
289+
paramsForServer: [],
290+
whitelist: [],
291+
289292
handleEvents: {
290293
created: (item, { model, models }) => options.enableEvents,
291294
patched: (item, { model, models }) => options.enableEvents,
@@ -296,18 +299,18 @@ const defaultOptions = {
296299
```
297300
- `serverAlias` - **Default:** `api` - Models are keyed by `serverAlias`. Access the `$FeathersVuex` Plugin and its models in your components by `this.$FeathersVuex.api.${Model}`
298301
- `keepCopiesInStore` - **Default:** `false` - Set to true to store cloned copies in the store instead of on the Model. <Badge text="deprecated" type="warning" />
299-
- `paramsForServer {Array}` - **Default:** `[]` - Custom query operators that are ignored in the find getter, but will pass through to the server.
300-
- `whitelist {Array}` - **Default:** `[]` - Custom query operators that will be allowed in the find getter.
301302

302303
- `idField {String}` - **Default:** `'id'` - The field in each record that will contain the id
303304
- `tempIdField {Boolean}` - **Default:** `'__id'` - The field in each temporary record that contains the id
305+
- `nameStyle {'short'|'path'}` - **Default:** `'short'` - Use the full service path as the Vuex module name, instead of just the last section.
304306
- `debug {Boolean}` - **Default:** `false` - Enable some logging for debugging
305307
- `addOnUpsert {Boolean}` - **Default:** `false` - If `true` add new records pushed by 'updated/patched' socketio events into store, instead of discarding them.
306308
- `autoRemove {Boolean}` - **Default:** `false` - If `true` automatically remove records missing from responses (only use with feathers-rest)
307309
- `preferUpdate {Boolean}` - **Default:** `false` - If `true`, calling `model.save()` will do an `update` instead of a `patch`.
308310
- `replaceItems {Boolean}` - **Default:** `false` - If `true`, updates & patches replace the record in the store. Default is false, which merges in changes.
309311
- `skipRequestIfExists {Boolean}` - **Default:** `false` - For get action, if `true` the record already exists in store, skip the remote request.
310-
- `nameStyle {'short'|'path'}` - **Default:** `'short'` - Use the full service path as the Vuex module name, instead of just the last section.
312+
- `paramsForServer {Array}` - **Default:** `[]` - Custom query operators that are ignored in the find getter, but will pass through to the server.
313+
- `whitelist {Array}` - **Default:** `[]` - Custom query operators that will be allowed in the find getter.
311314
- `enableEvents {Boolean}` - **Default:** `true` - If `false` socket event listeners will be turned off. See the services
312315
- `handleEvents {Object}`: For this to work `enableEvents` must be `true`
313316
- `created {Function}` - **Default:** `(item, { model, models }) => options.enableEvents` - handle `created` events, return true to add to the store

docs/service-plugin.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,20 @@ const servicePlugin = makeServicePlugin({
2626
Model,
2727
service: feathersClient.service(servicePath),
2828

29-
// optional and configurable by global config
29+
// optional and configurable also by global config
3030
idField: 'id',
3131
tempIdField: '__id',
32+
nameStyle: 'short',
3233
debug: false,
3334
addOnUpsert: false,
3435
autoRemove: false,
3536
preferUpdate: false,
3637
replaceItems: false,
3738
skipRequestIfExists: false,
38-
nameStyle: 'short',
39+
40+
paramsForServer: [],
41+
whitelist: [],
42+
3943
enableEvents: true,
4044
handleEvents: {
4145
created: (item, { model, models }) => options.enableEvents,
@@ -64,19 +68,22 @@ The following options can also be configured in [Global Configuration](getting-s
6468

6569
- `idField {String}` - **Default:** `globalConfig: 'id'` - The field in each record that will contain the id
6670
- `tempIdField {Boolean}` - **Default:** `globalConfig: '__id'` - The field in each temporary record that contains the id
71+
- `nameStyle {'short'|'path'}` - **Default:** `globalConfig: 'short'` - Use the full service path as the Vuex module name, instead of just the last section.
6772
- `debug {Boolean}` - **Default:** `globalConfig: false` - Enable some logging for debugging
6873
- `addOnUpsert {Boolean}` - **Default:** `globalConfig: false` - If `true` add new records pushed by 'updated/patched' socketio events into store, instead of discarding them.
6974
- `autoRemove {Boolean}` - **Default:** `globalConfig: false` - If `true` automatically remove records missing from responses (only use with feathers-rest)
7075
- `preferUpdate {Boolean}` - **Default:** `globalConfig: false` - If `true`, calling `model.save()` will do an `update` instead of a `patch`.
7176
- `replaceItems {Boolean}` - **Default:** `globalConfig: false` - If `true`, updates & patches replace the record in the store. Default is false, which merges in changes.
7277
- `skipRequestIfExists {Boolean}` - **Default:** `globalConfig: false` - For get action, if `true` the record already exists in store, skip the remote request.
73-
- `nameStyle {'short'|'path'}` - **Default:** `globalConfig: 'short'` - Use the full service path as the Vuex module name, instead of just the last section.
78+
- `paramsForServer {Array}` - Custom query operators that are ignored in the find getter, but will pass through to the server.
79+
- `whitelist {Array}` - Custom query operators that will be allowed in the find getter.
7480
- `enableEvents {Boolean}` - **Default:** `globalConfig: true` - If `false` socket event listeners will be turned off
7581
- `handleEvents {Object}`: For this to work `enableEvents` must be `true`
7682
- `created {Function}` - **Default:** `(item, { model, models }) => options.enableEvents` - handle `created` events, return true to add to the store
7783
- `patched {Function}` - **Default:** `(item, { model, models }) => options.enableEvents` - handle `created` events, return true to update in the store
7884
- `updated {Function}` - **Default:** `(item, { model, models }) => options.enableEvents` - handle `created` events, return true to update in the store
7985
- `removed {Function}` - **Default:** `(item, { model, models }) => options.enableEvents` - handle `removed` events, return true to remove from the store
86+
-
8087

8188
The following options can only configured individually per service plugin
8289

0 commit comments

Comments
 (0)