2018-11-29 15:57:49 +00:00
|
|
|
/** @format */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
2018-12-21 02:44:27 +00:00
|
|
|
import categories from './categories';
|
2018-12-12 12:55:10 +00:00
|
|
|
import customers from './customers';
|
2018-12-06 22:08:40 +00:00
|
|
|
import notes from './notes';
|
2018-11-29 15:57:49 +00:00
|
|
|
import orders from './orders';
|
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';
|
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: {
|
|
|
|
...user.mutations,
|
|
|
|
},
|
2018-11-29 15:57:49 +00:00
|
|
|
selectors: {
|
2018-12-21 02:44:27 +00:00
|
|
|
...categories.selectors,
|
2018-12-12 12:55:10 +00:00
|
|
|
...customers.selectors,
|
2018-12-06 22:08:40 +00:00
|
|
|
...notes.selectors,
|
2018-11-29 15:57:49 +00:00
|
|
|
...orders.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,
|
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 [
|
2018-12-21 02:44:27 +00:00
|
|
|
...categories.operations.read( resourceNames ),
|
2018-12-12 12:55:10 +00:00
|
|
|
...customers.operations.read( resourceNames ),
|
2018-12-06 22:08:40 +00:00
|
|
|
...notes.operations.read( resourceNames ),
|
|
|
|
...orders.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 ),
|
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 ) {
|
|
|
|
return [ ...user.operations.update( resourceNames, data ) ];
|
|
|
|
},
|
2018-11-29 15:57:49 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export default createWcApiSpec();
|