2018-11-29 15:57:49 +00:00
|
|
|
/** @format */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
2019-02-01 09:55:19 +00:00
|
|
|
import items from './items';
|
2018-12-06 22:08:40 +00:00
|
|
|
import notes from './notes';
|
2018-12-05 17:10:54 +00:00
|
|
|
import reportItems from './reports/items';
|
2018-12-04 03:01:49 +00:00
|
|
|
import reportStats from './reports/stats';
|
2018-12-12 13:35:56 +00:00
|
|
|
import reviews from './reviews';
|
2019-01-31 01:04:11 +00:00
|
|
|
import settings from './settings';
|
2018-12-13 19:24:54 +00:00
|
|
|
import user from './user';
|
2018-11-29 15:57:49 +00:00
|
|
|
|
|
|
|
function createWcApiSpec() {
|
|
|
|
return {
|
2018-12-13 19:24:54 +00:00
|
|
|
mutations: {
|
2019-01-31 01:04:11 +00:00
|
|
|
...settings.mutations,
|
2018-12-13 19:24:54 +00:00
|
|
|
...user.mutations,
|
2019-03-12 13:13:20 +00:00
|
|
|
...notes.mutations,
|
2018-12-13 19:24:54 +00:00
|
|
|
},
|
2018-11-29 15:57:49 +00:00
|
|
|
selectors: {
|
2019-02-01 09:55:19 +00:00
|
|
|
...items.selectors,
|
2018-12-06 22:08:40 +00:00
|
|
|
...notes.selectors,
|
2018-12-05 17:10:54 +00:00
|
|
|
...reportItems.selectors,
|
2018-12-04 03:01:49 +00:00
|
|
|
...reportStats.selectors,
|
2018-12-12 13:35:56 +00:00
|
|
|
...reviews.selectors,
|
2019-01-31 01:04:11 +00:00
|
|
|
...settings.selectors,
|
2018-12-13 19:24:54 +00:00
|
|
|
...user.selectors,
|
2018-11-29 15:57:49 +00:00
|
|
|
},
|
|
|
|
operations: {
|
|
|
|
read( resourceNames ) {
|
2018-12-06 22:08:40 +00:00
|
|
|
return [
|
2019-02-01 09:55:19 +00:00
|
|
|
...items.operations.read( resourceNames ),
|
2018-12-06 22:08:40 +00:00
|
|
|
...notes.operations.read( resourceNames ),
|
2018-12-05 17:10:54 +00:00
|
|
|
...reportItems.operations.read( resourceNames ),
|
2018-12-04 03:01:49 +00:00
|
|
|
...reportStats.operations.read( resourceNames ),
|
2018-12-12 13:35:56 +00:00
|
|
|
...reviews.operations.read( resourceNames ),
|
2019-01-31 01:04:11 +00:00
|
|
|
...settings.operations.read( resourceNames ),
|
2018-12-13 19:24:54 +00:00
|
|
|
...user.operations.read( resourceNames ),
|
2018-12-06 22:08:40 +00:00
|
|
|
];
|
2018-11-29 15:57:49 +00:00
|
|
|
},
|
2018-12-13 19:24:54 +00:00
|
|
|
update( resourceNames, data ) {
|
2019-01-31 01:04:11 +00:00
|
|
|
return [
|
|
|
|
...settings.operations.update( resourceNames, data ),
|
|
|
|
...user.operations.update( resourceNames, data ),
|
2019-03-12 13:13:20 +00:00
|
|
|
...notes.operations.update( resourceNames, data ),
|
2019-01-31 01:04:11 +00:00
|
|
|
];
|
2018-12-13 19:24:54 +00:00
|
|
|
},
|
2018-11-29 15:57:49 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export default createWcApiSpec();
|