@micromag/data 0.2.391 → 0.2.393
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.js +53 -53
- package/lib/index.js +54 -54
- package/package.json +2 -2
package/es/index.js
CHANGED
|
@@ -2,10 +2,10 @@ import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
|
2
2
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
3
3
|
import React, { useContext, useMemo, useState, useCallback, useEffect, useRef } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
|
-
import _createClass from '@babel/runtime/helpers/createClass';
|
|
6
5
|
import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
|
|
7
6
|
import _inherits from '@babel/runtime/helpers/inherits';
|
|
8
7
|
import _createSuper from '@babel/runtime/helpers/createSuper';
|
|
8
|
+
import _createClass from '@babel/runtime/helpers/createClass';
|
|
9
9
|
import { getJSON, getCSRFHeaders, postJSON } from '@folklore/fetch';
|
|
10
10
|
import { generatePath } from 'react-router';
|
|
11
11
|
import { stringify } from 'query-string';
|
|
@@ -79,6 +79,57 @@ var Base = /*#__PURE__*/function () {
|
|
|
79
79
|
return Base;
|
|
80
80
|
}();
|
|
81
81
|
|
|
82
|
+
var ContributionsApi = /*#__PURE__*/function (_Base) {
|
|
83
|
+
_inherits(ContributionsApi, _Base);
|
|
84
|
+
|
|
85
|
+
var _super = _createSuper(ContributionsApi);
|
|
86
|
+
|
|
87
|
+
function ContributionsApi() {
|
|
88
|
+
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
89
|
+
|
|
90
|
+
_classCallCheck(this, ContributionsApi);
|
|
91
|
+
|
|
92
|
+
return _super.call(this, _objectSpread(_objectSpread({}, opts), {}, {
|
|
93
|
+
routes: _objectSpread({
|
|
94
|
+
index: '/contributions/:screen',
|
|
95
|
+
store: '/contributions',
|
|
96
|
+
update: '/contributions/:contribution',
|
|
97
|
+
"delete": '/contributions/:contribution'
|
|
98
|
+
}, opts.routes || null)
|
|
99
|
+
}));
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
_createClass(ContributionsApi, [{
|
|
103
|
+
key: "get",
|
|
104
|
+
value: function get(id) {
|
|
105
|
+
var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
106
|
+
var page = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
107
|
+
var count = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 10;
|
|
108
|
+
|
|
109
|
+
var finalQuery = _objectSpread({}, query);
|
|
110
|
+
|
|
111
|
+
if (page !== null) {
|
|
112
|
+
finalQuery.page = page;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (count !== null) {
|
|
116
|
+
finalQuery.count = count;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return this.requestGet(this.route('index', {
|
|
120
|
+
screen: id
|
|
121
|
+
}), finalQuery);
|
|
122
|
+
}
|
|
123
|
+
}, {
|
|
124
|
+
key: "create",
|
|
125
|
+
value: function create(data) {
|
|
126
|
+
return this.requestPost(this.route('store'), data);
|
|
127
|
+
}
|
|
128
|
+
}]);
|
|
129
|
+
|
|
130
|
+
return ContributionsApi;
|
|
131
|
+
}(Base);
|
|
132
|
+
|
|
82
133
|
var MediasApi = /*#__PURE__*/function (_Base) {
|
|
83
134
|
_inherits(MediasApi, _Base);
|
|
84
135
|
|
|
@@ -180,57 +231,6 @@ var MediasApi = /*#__PURE__*/function (_Base) {
|
|
|
180
231
|
return MediasApi;
|
|
181
232
|
}(Base);
|
|
182
233
|
|
|
183
|
-
var ContributionsApi = /*#__PURE__*/function (_Base) {
|
|
184
|
-
_inherits(ContributionsApi, _Base);
|
|
185
|
-
|
|
186
|
-
var _super = _createSuper(ContributionsApi);
|
|
187
|
-
|
|
188
|
-
function ContributionsApi() {
|
|
189
|
-
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
190
|
-
|
|
191
|
-
_classCallCheck(this, ContributionsApi);
|
|
192
|
-
|
|
193
|
-
return _super.call(this, _objectSpread(_objectSpread({}, opts), {}, {
|
|
194
|
-
routes: _objectSpread({
|
|
195
|
-
index: '/contributions/:screen',
|
|
196
|
-
store: '/contributions',
|
|
197
|
-
update: '/contributions/:contribution',
|
|
198
|
-
"delete": '/contributions/:contribution'
|
|
199
|
-
}, opts.routes || null)
|
|
200
|
-
}));
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
_createClass(ContributionsApi, [{
|
|
204
|
-
key: "get",
|
|
205
|
-
value: function get(id) {
|
|
206
|
-
var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
207
|
-
var page = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
208
|
-
var count = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 10;
|
|
209
|
-
|
|
210
|
-
var finalQuery = _objectSpread({}, query);
|
|
211
|
-
|
|
212
|
-
if (page !== null) {
|
|
213
|
-
finalQuery.page = page;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
if (count !== null) {
|
|
217
|
-
finalQuery.count = count;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
return this.requestGet(this.route('index', {
|
|
221
|
-
screen: id
|
|
222
|
-
}), finalQuery);
|
|
223
|
-
}
|
|
224
|
-
}, {
|
|
225
|
-
key: "create",
|
|
226
|
-
value: function create(data) {
|
|
227
|
-
return this.requestPost(this.route('store'), data);
|
|
228
|
-
}
|
|
229
|
-
}]);
|
|
230
|
-
|
|
231
|
-
return ContributionsApi;
|
|
232
|
-
}(Base);
|
|
233
|
-
|
|
234
234
|
var QuizApi = /*#__PURE__*/function (_Base) {
|
|
235
235
|
_inherits(QuizApi, _Base);
|
|
236
236
|
|
|
@@ -287,7 +287,7 @@ var Api = /*#__PURE__*/function (_Base) {
|
|
|
287
287
|
return _this;
|
|
288
288
|
}
|
|
289
289
|
|
|
290
|
-
return
|
|
290
|
+
return Api;
|
|
291
291
|
}(Base);
|
|
292
292
|
|
|
293
293
|
/* eslint-disable react/jsx-props-no-spreading */
|
package/lib/index.js
CHANGED
|
@@ -6,10 +6,10 @@ var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
|
|
|
6
6
|
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var PropTypes = require('prop-types');
|
|
9
|
-
var _createClass = require('@babel/runtime/helpers/createClass');
|
|
10
9
|
var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
|
|
11
10
|
var _inherits = require('@babel/runtime/helpers/inherits');
|
|
12
11
|
var _createSuper = require('@babel/runtime/helpers/createSuper');
|
|
12
|
+
var _createClass = require('@babel/runtime/helpers/createClass');
|
|
13
13
|
var fetch = require('@folklore/fetch');
|
|
14
14
|
var reactRouter = require('react-router');
|
|
15
15
|
var queryString = require('query-string');
|
|
@@ -22,10 +22,10 @@ var _objectSpread__default = /*#__PURE__*/_interopDefaultLegacy(_objectSpread);
|
|
|
22
22
|
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
23
23
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
24
24
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
25
|
-
var _createClass__default = /*#__PURE__*/_interopDefaultLegacy(_createClass);
|
|
26
25
|
var _classCallCheck__default = /*#__PURE__*/_interopDefaultLegacy(_classCallCheck);
|
|
27
26
|
var _inherits__default = /*#__PURE__*/_interopDefaultLegacy(_inherits);
|
|
28
27
|
var _createSuper__default = /*#__PURE__*/_interopDefaultLegacy(_createSuper);
|
|
28
|
+
var _createClass__default = /*#__PURE__*/_interopDefaultLegacy(_createClass);
|
|
29
29
|
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
30
30
|
var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray);
|
|
31
31
|
|
|
@@ -96,6 +96,57 @@ var Base = /*#__PURE__*/function () {
|
|
|
96
96
|
return Base;
|
|
97
97
|
}();
|
|
98
98
|
|
|
99
|
+
var ContributionsApi = /*#__PURE__*/function (_Base) {
|
|
100
|
+
_inherits__default["default"](ContributionsApi, _Base);
|
|
101
|
+
|
|
102
|
+
var _super = _createSuper__default["default"](ContributionsApi);
|
|
103
|
+
|
|
104
|
+
function ContributionsApi() {
|
|
105
|
+
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
106
|
+
|
|
107
|
+
_classCallCheck__default["default"](this, ContributionsApi);
|
|
108
|
+
|
|
109
|
+
return _super.call(this, _objectSpread__default["default"](_objectSpread__default["default"]({}, opts), {}, {
|
|
110
|
+
routes: _objectSpread__default["default"]({
|
|
111
|
+
index: '/contributions/:screen',
|
|
112
|
+
store: '/contributions',
|
|
113
|
+
update: '/contributions/:contribution',
|
|
114
|
+
"delete": '/contributions/:contribution'
|
|
115
|
+
}, opts.routes || null)
|
|
116
|
+
}));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
_createClass__default["default"](ContributionsApi, [{
|
|
120
|
+
key: "get",
|
|
121
|
+
value: function get(id) {
|
|
122
|
+
var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
123
|
+
var page = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
124
|
+
var count = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 10;
|
|
125
|
+
|
|
126
|
+
var finalQuery = _objectSpread__default["default"]({}, query);
|
|
127
|
+
|
|
128
|
+
if (page !== null) {
|
|
129
|
+
finalQuery.page = page;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (count !== null) {
|
|
133
|
+
finalQuery.count = count;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return this.requestGet(this.route('index', {
|
|
137
|
+
screen: id
|
|
138
|
+
}), finalQuery);
|
|
139
|
+
}
|
|
140
|
+
}, {
|
|
141
|
+
key: "create",
|
|
142
|
+
value: function create(data) {
|
|
143
|
+
return this.requestPost(this.route('store'), data);
|
|
144
|
+
}
|
|
145
|
+
}]);
|
|
146
|
+
|
|
147
|
+
return ContributionsApi;
|
|
148
|
+
}(Base);
|
|
149
|
+
|
|
99
150
|
var MediasApi = /*#__PURE__*/function (_Base) {
|
|
100
151
|
_inherits__default["default"](MediasApi, _Base);
|
|
101
152
|
|
|
@@ -197,57 +248,6 @@ var MediasApi = /*#__PURE__*/function (_Base) {
|
|
|
197
248
|
return MediasApi;
|
|
198
249
|
}(Base);
|
|
199
250
|
|
|
200
|
-
var ContributionsApi = /*#__PURE__*/function (_Base) {
|
|
201
|
-
_inherits__default["default"](ContributionsApi, _Base);
|
|
202
|
-
|
|
203
|
-
var _super = _createSuper__default["default"](ContributionsApi);
|
|
204
|
-
|
|
205
|
-
function ContributionsApi() {
|
|
206
|
-
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
207
|
-
|
|
208
|
-
_classCallCheck__default["default"](this, ContributionsApi);
|
|
209
|
-
|
|
210
|
-
return _super.call(this, _objectSpread__default["default"](_objectSpread__default["default"]({}, opts), {}, {
|
|
211
|
-
routes: _objectSpread__default["default"]({
|
|
212
|
-
index: '/contributions/:screen',
|
|
213
|
-
store: '/contributions',
|
|
214
|
-
update: '/contributions/:contribution',
|
|
215
|
-
"delete": '/contributions/:contribution'
|
|
216
|
-
}, opts.routes || null)
|
|
217
|
-
}));
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
_createClass__default["default"](ContributionsApi, [{
|
|
221
|
-
key: "get",
|
|
222
|
-
value: function get(id) {
|
|
223
|
-
var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
224
|
-
var page = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
225
|
-
var count = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 10;
|
|
226
|
-
|
|
227
|
-
var finalQuery = _objectSpread__default["default"]({}, query);
|
|
228
|
-
|
|
229
|
-
if (page !== null) {
|
|
230
|
-
finalQuery.page = page;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
if (count !== null) {
|
|
234
|
-
finalQuery.count = count;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
return this.requestGet(this.route('index', {
|
|
238
|
-
screen: id
|
|
239
|
-
}), finalQuery);
|
|
240
|
-
}
|
|
241
|
-
}, {
|
|
242
|
-
key: "create",
|
|
243
|
-
value: function create(data) {
|
|
244
|
-
return this.requestPost(this.route('store'), data);
|
|
245
|
-
}
|
|
246
|
-
}]);
|
|
247
|
-
|
|
248
|
-
return ContributionsApi;
|
|
249
|
-
}(Base);
|
|
250
|
-
|
|
251
251
|
var QuizApi = /*#__PURE__*/function (_Base) {
|
|
252
252
|
_inherits__default["default"](QuizApi, _Base);
|
|
253
253
|
|
|
@@ -304,7 +304,7 @@ var Api = /*#__PURE__*/function (_Base) {
|
|
|
304
304
|
return _this;
|
|
305
305
|
}
|
|
306
306
|
|
|
307
|
-
return
|
|
307
|
+
return Api;
|
|
308
308
|
}(Base);
|
|
309
309
|
|
|
310
310
|
/* eslint-disable react/jsx-props-no-spreading */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/data",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.393",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"access": "public"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "e6dadb5ed071e993803ba1f0837eca8385ea6cd4"
|
|
62
62
|
}
|