@feathersjs/client 4.5.15 → 4.5.17
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/CHANGELOG.md +16 -0
- package/dist/authentication.js +166 -363
- package/dist/authentication.js.map +1 -1
- package/dist/authentication.min.js +1 -1
- package/dist/core.js +178 -321
- package/dist/core.js.map +1 -1
- package/dist/core.min.js +1 -1
- package/dist/feathers.js +394 -797
- package/dist/feathers.js.map +1 -1
- package/dist/feathers.min.js +1 -1
- package/dist/primus.js +105 -178
- package/dist/primus.js.map +1 -1
- package/dist/primus.min.js +1 -1
- package/dist/rest.js +265 -504
- package/dist/rest.js.map +1 -1
- package/dist/rest.min.js +1 -1
- package/dist/socketio.js +105 -180
- package/dist/socketio.js.map +1 -1
- package/dist/socketio.min.js +1 -1
- package/package.json +12 -12
package/dist/rest.js
CHANGED
|
@@ -22,12 +22,12 @@ return /******/ (function() { // webpackBootstrap
|
|
|
22
22
|
/**
|
|
23
23
|
* This is the web browser implementation of `debug()`.
|
|
24
24
|
*/
|
|
25
|
+
|
|
25
26
|
exports.formatArgs = formatArgs;
|
|
26
27
|
exports.save = save;
|
|
27
28
|
exports.load = load;
|
|
28
29
|
exports.useColors = useColors;
|
|
29
30
|
exports.storage = localstorage();
|
|
30
|
-
|
|
31
31
|
exports.destroy = function () {
|
|
32
32
|
var warned = false;
|
|
33
33
|
return function () {
|
|
@@ -37,12 +37,13 @@ exports.destroy = function () {
|
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
}();
|
|
40
|
+
|
|
40
41
|
/**
|
|
41
42
|
* Colors.
|
|
42
43
|
*/
|
|
43
44
|
|
|
44
|
-
|
|
45
45
|
exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'];
|
|
46
|
+
|
|
46
47
|
/**
|
|
47
48
|
* Currently only WebKit-based Web Inspectors, Firefox >= v31,
|
|
48
49
|
* and the Firebug extension (any Firefox version) are known
|
|
@@ -50,57 +51,57 @@ exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066F
|
|
|
50
51
|
*
|
|
51
52
|
* TODO: add a `localStorage` variable to explicitly enable/disable colors
|
|
52
53
|
*/
|
|
53
|
-
// eslint-disable-next-line complexity
|
|
54
54
|
|
|
55
|
+
// eslint-disable-next-line complexity
|
|
55
56
|
function useColors() {
|
|
56
57
|
// NB: In an Electron preload script, document will be defined but not fully
|
|
57
58
|
// initialized. Since we know we're in Chrome, we'll just detect this case
|
|
58
59
|
// explicitly
|
|
59
60
|
if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
|
|
60
61
|
return true;
|
|
61
|
-
}
|
|
62
|
-
|
|
62
|
+
}
|
|
63
63
|
|
|
64
|
+
// Internet Explorer and Edge do not support colors.
|
|
64
65
|
if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
|
65
66
|
return false;
|
|
66
|
-
}
|
|
67
|
-
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
|
|
68
|
-
|
|
67
|
+
}
|
|
69
68
|
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
// Is webkit? http://stackoverflow.com/a/16459606/376773
|
|
70
|
+
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
|
|
71
|
+
return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance ||
|
|
72
|
+
// Is firebug? http://stackoverflow.com/a/398120/376773
|
|
73
|
+
typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) ||
|
|
74
|
+
// Is firefox >= v31?
|
|
72
75
|
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
73
|
-
typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 ||
|
|
76
|
+
typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 ||
|
|
77
|
+
// Double check webkit in userAgent just in case we are in a worker
|
|
74
78
|
typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|
75
79
|
}
|
|
80
|
+
|
|
76
81
|
/**
|
|
77
82
|
* Colorize log arguments if enabled.
|
|
78
83
|
*
|
|
79
84
|
* @api public
|
|
80
85
|
*/
|
|
81
86
|
|
|
82
|
-
|
|
83
87
|
function formatArgs(args) {
|
|
84
88
|
args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
|
|
85
|
-
|
|
86
89
|
if (!this.useColors) {
|
|
87
90
|
return;
|
|
88
91
|
}
|
|
89
|
-
|
|
90
92
|
var c = 'color: ' + this.color;
|
|
91
|
-
args.splice(1, 0, c, 'color: inherit');
|
|
93
|
+
args.splice(1, 0, c, 'color: inherit');
|
|
94
|
+
|
|
95
|
+
// The final "%c" is somewhat tricky, because there could be other
|
|
92
96
|
// arguments passed either before or after the %c, so we need to
|
|
93
97
|
// figure out the correct index to insert the CSS into
|
|
94
|
-
|
|
95
98
|
var index = 0;
|
|
96
99
|
var lastC = 0;
|
|
97
100
|
args[0].replace(/%[a-zA-Z%]/g, function (match) {
|
|
98
101
|
if (match === '%%') {
|
|
99
102
|
return;
|
|
100
103
|
}
|
|
101
|
-
|
|
102
104
|
index++;
|
|
103
|
-
|
|
104
105
|
if (match === '%c') {
|
|
105
106
|
// We only are interested in the *last* %c
|
|
106
107
|
// (the user may have provided their own)
|
|
@@ -109,6 +110,7 @@ function formatArgs(args) {
|
|
|
109
110
|
});
|
|
110
111
|
args.splice(lastC, 0, c);
|
|
111
112
|
}
|
|
113
|
+
|
|
112
114
|
/**
|
|
113
115
|
* Invokes `console.debug()` when available.
|
|
114
116
|
* No-op when `console.debug` is not a "function".
|
|
@@ -117,17 +119,14 @@ function formatArgs(args) {
|
|
|
117
119
|
*
|
|
118
120
|
* @api public
|
|
119
121
|
*/
|
|
120
|
-
|
|
121
|
-
|
|
122
122
|
exports.log = console.debug || console.log || function () {};
|
|
123
|
+
|
|
123
124
|
/**
|
|
124
125
|
* Save `namespaces`.
|
|
125
126
|
*
|
|
126
127
|
* @param {String} namespaces
|
|
127
128
|
* @api private
|
|
128
129
|
*/
|
|
129
|
-
|
|
130
|
-
|
|
131
130
|
function save(namespaces) {
|
|
132
131
|
try {
|
|
133
132
|
if (namespaces) {
|
|
@@ -135,34 +134,34 @@ function save(namespaces) {
|
|
|
135
134
|
} else {
|
|
136
135
|
exports.storage.removeItem('debug');
|
|
137
136
|
}
|
|
138
|
-
} catch (error) {
|
|
137
|
+
} catch (error) {
|
|
138
|
+
// Swallow
|
|
139
139
|
// XXX (@Qix-) should we be logging these?
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
+
|
|
142
143
|
/**
|
|
143
144
|
* Load `namespaces`.
|
|
144
145
|
*
|
|
145
146
|
* @return {String} returns the previously persisted debug modes
|
|
146
147
|
* @api private
|
|
147
148
|
*/
|
|
148
|
-
|
|
149
|
-
|
|
150
149
|
function load() {
|
|
151
150
|
var r;
|
|
152
|
-
|
|
153
151
|
try {
|
|
154
152
|
r = exports.storage.getItem('debug');
|
|
155
|
-
} catch (error) {
|
|
153
|
+
} catch (error) {
|
|
154
|
+
// Swallow
|
|
156
155
|
// XXX (@Qix-) should we be logging these?
|
|
157
|
-
}
|
|
158
|
-
|
|
156
|
+
}
|
|
159
157
|
|
|
158
|
+
// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
|
|
160
159
|
if (!r && typeof process !== 'undefined' && 'env' in process) {
|
|
161
160
|
r = process.env.DEBUG;
|
|
162
161
|
}
|
|
163
|
-
|
|
164
162
|
return r;
|
|
165
163
|
}
|
|
164
|
+
|
|
166
165
|
/**
|
|
167
166
|
* Localstorage attempts to return the localstorage.
|
|
168
167
|
*
|
|
@@ -174,19 +173,19 @@ function load() {
|
|
|
174
173
|
* @api private
|
|
175
174
|
*/
|
|
176
175
|
|
|
177
|
-
|
|
178
176
|
function localstorage() {
|
|
179
177
|
try {
|
|
180
178
|
// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
|
|
181
179
|
// The Browser also has localStorage in the global context.
|
|
182
180
|
return localStorage;
|
|
183
|
-
} catch (error) {
|
|
181
|
+
} catch (error) {
|
|
182
|
+
// Swallow
|
|
184
183
|
// XXX (@Qix-) should we be logging these?
|
|
185
184
|
}
|
|
186
185
|
}
|
|
187
|
-
|
|
188
186
|
module.exports = __webpack_require__(/*! ./common */ "../../node_modules/debug/src/common.js")(exports);
|
|
189
187
|
var formatters = module.exports.formatters;
|
|
188
|
+
|
|
190
189
|
/**
|
|
191
190
|
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
|
|
192
191
|
*/
|
|
@@ -208,21 +207,16 @@ formatters.j = function (v) {
|
|
|
208
207
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
209
208
|
|
|
210
209
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
211
|
-
|
|
212
210
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
213
|
-
|
|
214
211
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
215
|
-
|
|
216
212
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
217
|
-
|
|
218
213
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
219
|
-
|
|
220
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
221
|
-
|
|
214
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
222
215
|
/**
|
|
223
216
|
* This is the common logic for both the Node.js and web browser
|
|
224
217
|
* implementations of `debug()`.
|
|
225
218
|
*/
|
|
219
|
+
|
|
226
220
|
function setup(env) {
|
|
227
221
|
createDebug.debug = createDebug;
|
|
228
222
|
createDebug.default = createDebug;
|
|
@@ -235,29 +229,29 @@ function setup(env) {
|
|
|
235
229
|
Object.keys(env).forEach(function (key) {
|
|
236
230
|
createDebug[key] = env[key];
|
|
237
231
|
});
|
|
232
|
+
|
|
238
233
|
/**
|
|
239
234
|
* The currently active debug mode names, and names to skip.
|
|
240
235
|
*/
|
|
241
236
|
|
|
242
237
|
createDebug.names = [];
|
|
243
238
|
createDebug.skips = [];
|
|
239
|
+
|
|
244
240
|
/**
|
|
245
241
|
* Map of special "%n" handling functions, for the debug "format" argument.
|
|
246
242
|
*
|
|
247
243
|
* Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
|
|
248
244
|
*/
|
|
249
|
-
|
|
250
245
|
createDebug.formatters = {};
|
|
246
|
+
|
|
251
247
|
/**
|
|
252
248
|
* Selects a color for a debug namespace
|
|
253
249
|
* @param {String} namespace The namespace string for the debug instance to be colored
|
|
254
250
|
* @return {Number|String} An ANSI color code for the given namespace
|
|
255
251
|
* @api private
|
|
256
252
|
*/
|
|
257
|
-
|
|
258
253
|
function selectColor(namespace) {
|
|
259
254
|
var hash = 0;
|
|
260
|
-
|
|
261
255
|
for (var i = 0; i < namespace.length; i++) {
|
|
262
256
|
hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
|
263
257
|
hash |= 0; // Convert to 32bit integer
|
|
@@ -265,8 +259,8 @@ function setup(env) {
|
|
|
265
259
|
|
|
266
260
|
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
|
267
261
|
}
|
|
268
|
-
|
|
269
262
|
createDebug.selectColor = selectColor;
|
|
263
|
+
|
|
270
264
|
/**
|
|
271
265
|
* Create a debugger with the given `namespace`.
|
|
272
266
|
*
|
|
@@ -274,25 +268,22 @@ function setup(env) {
|
|
|
274
268
|
* @return {Function}
|
|
275
269
|
* @api public
|
|
276
270
|
*/
|
|
277
|
-
|
|
278
271
|
function createDebug(namespace) {
|
|
279
272
|
var prevTime;
|
|
280
273
|
var enableOverride = null;
|
|
281
274
|
var namespacesCache;
|
|
282
275
|
var enabledCache;
|
|
283
|
-
|
|
284
276
|
function debug() {
|
|
285
277
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
286
278
|
args[_key] = arguments[_key];
|
|
287
279
|
}
|
|
288
|
-
|
|
289
280
|
// Disabled?
|
|
290
281
|
if (!debug.enabled) {
|
|
291
282
|
return;
|
|
292
283
|
}
|
|
284
|
+
var self = debug;
|
|
293
285
|
|
|
294
|
-
|
|
295
|
-
|
|
286
|
+
// Set `diff` timestamp
|
|
296
287
|
var curr = Number(new Date());
|
|
297
288
|
var ms = curr - (prevTime || curr);
|
|
298
289
|
self.diff = ms;
|
|
@@ -300,39 +291,36 @@ function setup(env) {
|
|
|
300
291
|
self.curr = curr;
|
|
301
292
|
prevTime = curr;
|
|
302
293
|
args[0] = createDebug.coerce(args[0]);
|
|
303
|
-
|
|
304
294
|
if (typeof args[0] !== 'string') {
|
|
305
295
|
// Anything else let's inspect with %O
|
|
306
296
|
args.unshift('%O');
|
|
307
|
-
}
|
|
308
|
-
|
|
297
|
+
}
|
|
309
298
|
|
|
299
|
+
// Apply any `formatters` transformations
|
|
310
300
|
var index = 0;
|
|
311
301
|
args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {
|
|
312
302
|
// If we encounter an escaped % then don't increase the array index
|
|
313
303
|
if (match === '%%') {
|
|
314
304
|
return '%';
|
|
315
305
|
}
|
|
316
|
-
|
|
317
306
|
index++;
|
|
318
307
|
var formatter = createDebug.formatters[format];
|
|
319
|
-
|
|
320
308
|
if (typeof formatter === 'function') {
|
|
321
309
|
var val = args[index];
|
|
322
|
-
match = formatter.call(self, val);
|
|
310
|
+
match = formatter.call(self, val);
|
|
323
311
|
|
|
312
|
+
// Now we need to remove `args[index]` since it's inlined in the `format`
|
|
324
313
|
args.splice(index, 1);
|
|
325
314
|
index--;
|
|
326
315
|
}
|
|
327
|
-
|
|
328
316
|
return match;
|
|
329
|
-
});
|
|
317
|
+
});
|
|
330
318
|
|
|
319
|
+
// Apply env-specific formatting (colors, etc.)
|
|
331
320
|
createDebug.formatArgs.call(self, args);
|
|
332
321
|
var logFn = self.log || createDebug.log;
|
|
333
322
|
logFn.apply(self, args);
|
|
334
323
|
}
|
|
335
|
-
|
|
336
324
|
debug.namespace = namespace;
|
|
337
325
|
debug.useColors = createDebug.useColors();
|
|
338
326
|
debug.color = createDebug.selectColor(namespace);
|
|
@@ -346,31 +334,29 @@ function setup(env) {
|
|
|
346
334
|
if (enableOverride !== null) {
|
|
347
335
|
return enableOverride;
|
|
348
336
|
}
|
|
349
|
-
|
|
350
337
|
if (namespacesCache !== createDebug.namespaces) {
|
|
351
338
|
namespacesCache = createDebug.namespaces;
|
|
352
339
|
enabledCache = createDebug.enabled(namespace);
|
|
353
340
|
}
|
|
354
|
-
|
|
355
341
|
return enabledCache;
|
|
356
342
|
},
|
|
357
343
|
set: function set(v) {
|
|
358
344
|
enableOverride = v;
|
|
359
345
|
}
|
|
360
|
-
});
|
|
346
|
+
});
|
|
361
347
|
|
|
348
|
+
// Env-specific initialization logic for debug instances
|
|
362
349
|
if (typeof createDebug.init === 'function') {
|
|
363
350
|
createDebug.init(debug);
|
|
364
351
|
}
|
|
365
|
-
|
|
366
352
|
return debug;
|
|
367
353
|
}
|
|
368
|
-
|
|
369
354
|
function extend(namespace, delimiter) {
|
|
370
355
|
var newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
|
|
371
356
|
newDebug.log = this.log;
|
|
372
357
|
return newDebug;
|
|
373
358
|
}
|
|
359
|
+
|
|
374
360
|
/**
|
|
375
361
|
* Enables a debug mode by namespaces. This can include modes
|
|
376
362
|
* separated by a colon and wildcards.
|
|
@@ -378,8 +364,6 @@ function setup(env) {
|
|
|
378
364
|
* @param {String} namespaces
|
|
379
365
|
* @api public
|
|
380
366
|
*/
|
|
381
|
-
|
|
382
|
-
|
|
383
367
|
function enable(namespaces) {
|
|
384
368
|
createDebug.save(namespaces);
|
|
385
369
|
createDebug.namespaces = namespaces;
|
|
@@ -388,15 +372,12 @@ function setup(env) {
|
|
|
388
372
|
var i;
|
|
389
373
|
var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
|
|
390
374
|
var len = split.length;
|
|
391
|
-
|
|
392
375
|
for (i = 0; i < len; i++) {
|
|
393
376
|
if (!split[i]) {
|
|
394
377
|
// ignore empty strings
|
|
395
378
|
continue;
|
|
396
379
|
}
|
|
397
|
-
|
|
398
380
|
namespaces = split[i].replace(/\*/g, '.*?');
|
|
399
|
-
|
|
400
381
|
if (namespaces[0] === '-') {
|
|
401
382
|
createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
|
|
402
383
|
} else {
|
|
@@ -404,14 +385,13 @@ function setup(env) {
|
|
|
404
385
|
}
|
|
405
386
|
}
|
|
406
387
|
}
|
|
388
|
+
|
|
407
389
|
/**
|
|
408
390
|
* Disable debug output.
|
|
409
391
|
*
|
|
410
392
|
* @return {String} namespaces
|
|
411
393
|
* @api public
|
|
412
394
|
*/
|
|
413
|
-
|
|
414
|
-
|
|
415
395
|
function disable() {
|
|
416
396
|
var namespaces = [].concat(_toConsumableArray(createDebug.names.map(toNamespace)), _toConsumableArray(createDebug.skips.map(toNamespace).map(function (namespace) {
|
|
417
397
|
return '-' + namespace;
|
|
@@ -419,6 +399,7 @@ function setup(env) {
|
|
|
419
399
|
createDebug.enable('');
|
|
420
400
|
return namespaces;
|
|
421
401
|
}
|
|
402
|
+
|
|
422
403
|
/**
|
|
423
404
|
* Returns true if the given mode name is enabled, false otherwise.
|
|
424
405
|
*
|
|
@@ -426,30 +407,25 @@ function setup(env) {
|
|
|
426
407
|
* @return {Boolean}
|
|
427
408
|
* @api public
|
|
428
409
|
*/
|
|
429
|
-
|
|
430
|
-
|
|
431
410
|
function enabled(name) {
|
|
432
411
|
if (name[name.length - 1] === '*') {
|
|
433
412
|
return true;
|
|
434
413
|
}
|
|
435
|
-
|
|
436
414
|
var i;
|
|
437
415
|
var len;
|
|
438
|
-
|
|
439
416
|
for (i = 0, len = createDebug.skips.length; i < len; i++) {
|
|
440
417
|
if (createDebug.skips[i].test(name)) {
|
|
441
418
|
return false;
|
|
442
419
|
}
|
|
443
420
|
}
|
|
444
|
-
|
|
445
421
|
for (i = 0, len = createDebug.names.length; i < len; i++) {
|
|
446
422
|
if (createDebug.names[i].test(name)) {
|
|
447
423
|
return true;
|
|
448
424
|
}
|
|
449
425
|
}
|
|
450
|
-
|
|
451
426
|
return false;
|
|
452
427
|
}
|
|
428
|
+
|
|
453
429
|
/**
|
|
454
430
|
* Convert regexp to namespace
|
|
455
431
|
*
|
|
@@ -457,11 +433,10 @@ function setup(env) {
|
|
|
457
433
|
* @return {String} namespace
|
|
458
434
|
* @api private
|
|
459
435
|
*/
|
|
460
|
-
|
|
461
|
-
|
|
462
436
|
function toNamespace(regexp) {
|
|
463
437
|
return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, '*');
|
|
464
438
|
}
|
|
439
|
+
|
|
465
440
|
/**
|
|
466
441
|
* Coerce `val`.
|
|
467
442
|
*
|
|
@@ -469,29 +444,23 @@ function setup(env) {
|
|
|
469
444
|
* @return {Mixed}
|
|
470
445
|
* @api private
|
|
471
446
|
*/
|
|
472
|
-
|
|
473
|
-
|
|
474
447
|
function coerce(val) {
|
|
475
448
|
if (val instanceof Error) {
|
|
476
449
|
return val.stack || val.message;
|
|
477
450
|
}
|
|
478
|
-
|
|
479
451
|
return val;
|
|
480
452
|
}
|
|
453
|
+
|
|
481
454
|
/**
|
|
482
455
|
* XXX DO NOT USE. This is a temporary stub function.
|
|
483
456
|
* XXX It WILL be removed in the next major release.
|
|
484
457
|
*/
|
|
485
|
-
|
|
486
|
-
|
|
487
458
|
function destroy() {
|
|
488
459
|
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
|
489
460
|
}
|
|
490
|
-
|
|
491
461
|
createDebug.enable(createDebug.load());
|
|
492
462
|
return createDebug;
|
|
493
463
|
}
|
|
494
|
-
|
|
495
464
|
module.exports = setup;
|
|
496
465
|
|
|
497
466
|
/***/ }),
|
|
@@ -516,19 +485,15 @@ module.exports = __webpack_require__(/*! @feathersjs/rest-client */ "../rest-cli
|
|
|
516
485
|
|
|
517
486
|
|
|
518
487
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
519
|
-
|
|
520
488
|
Object.defineProperty(exports, "__esModule", ({
|
|
521
489
|
value: true
|
|
522
490
|
}));
|
|
523
491
|
exports.enableHooks = exports.processHooks = exports.getHooks = exports.isHookObject = exports.convertHookData = exports.makeArguments = exports.defaultMakeArguments = exports.createHookObject = exports.ACTIVATE_HOOKS = void 0;
|
|
524
|
-
|
|
525
492
|
var utils_1 = __webpack_require__(/*! ./utils */ "../commons/lib/utils.js");
|
|
526
|
-
|
|
527
493
|
var _utils_1$_ = utils_1._,
|
|
528
|
-
|
|
529
|
-
|
|
494
|
+
each = _utils_1$_.each,
|
|
495
|
+
pick = _utils_1$_.pick;
|
|
530
496
|
exports.ACTIVATE_HOOKS = (0, utils_1.createSymbol)('__feathersActivateHooks');
|
|
531
|
-
|
|
532
497
|
function createHookObject(method) {
|
|
533
498
|
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
534
499
|
var hook = {};
|
|
@@ -539,70 +504,55 @@ function createHookObject(method) {
|
|
|
539
504
|
});
|
|
540
505
|
return Object.assign(hook, data, {
|
|
541
506
|
method: method,
|
|
542
|
-
|
|
543
507
|
// A dynamic getter that returns the path of the service
|
|
544
508
|
get path() {
|
|
545
509
|
var app = data.app,
|
|
546
|
-
|
|
547
|
-
|
|
510
|
+
service = data.service;
|
|
548
511
|
if (!service || !app || !app.services) {
|
|
549
512
|
return null;
|
|
550
513
|
}
|
|
551
|
-
|
|
552
514
|
return Object.keys(app.services).find(function (path) {
|
|
553
515
|
return app.services[path] === service;
|
|
554
516
|
});
|
|
555
517
|
}
|
|
556
|
-
|
|
557
518
|
});
|
|
558
519
|
}
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
520
|
+
exports.createHookObject = createHookObject;
|
|
521
|
+
// Fallback used by `makeArguments` which usually won't be used
|
|
562
522
|
function defaultMakeArguments(hook) {
|
|
563
523
|
var result = [];
|
|
564
|
-
|
|
565
524
|
if (typeof hook.id !== 'undefined') {
|
|
566
525
|
result.push(hook.id);
|
|
567
526
|
}
|
|
568
|
-
|
|
569
527
|
if (hook.data) {
|
|
570
528
|
result.push(hook.data);
|
|
571
529
|
}
|
|
572
|
-
|
|
573
530
|
result.push(hook.params || {});
|
|
574
531
|
return result;
|
|
575
532
|
}
|
|
576
|
-
|
|
577
|
-
|
|
533
|
+
exports.defaultMakeArguments = defaultMakeArguments;
|
|
534
|
+
// Turns a hook object back into a list of arguments
|
|
578
535
|
// to call a service method with
|
|
579
|
-
|
|
580
536
|
function makeArguments(hook) {
|
|
581
537
|
switch (hook.method) {
|
|
582
538
|
case 'find':
|
|
583
539
|
return [hook.params];
|
|
584
|
-
|
|
585
540
|
case 'get':
|
|
586
541
|
case 'remove':
|
|
587
542
|
return [hook.id, hook.params];
|
|
588
|
-
|
|
589
543
|
case 'update':
|
|
590
544
|
case 'patch':
|
|
591
545
|
return [hook.id, hook.data, hook.params];
|
|
592
|
-
|
|
593
546
|
case 'create':
|
|
594
547
|
return [hook.data, hook.params];
|
|
595
548
|
}
|
|
596
|
-
|
|
597
549
|
return defaultMakeArguments(hook);
|
|
598
550
|
}
|
|
599
|
-
|
|
600
|
-
|
|
551
|
+
exports.makeArguments = makeArguments;
|
|
552
|
+
// Converts different hook registration formats into the
|
|
601
553
|
// same internal format
|
|
602
|
-
|
|
603
554
|
function convertHookData(obj) {
|
|
604
555
|
var hook = {};
|
|
605
|
-
|
|
606
556
|
if (Array.isArray(obj)) {
|
|
607
557
|
hook = {
|
|
608
558
|
all: obj
|
|
@@ -616,41 +566,32 @@ function convertHookData(obj) {
|
|
|
616
566
|
hook[key] = !Array.isArray(value) ? [value] : value;
|
|
617
567
|
});
|
|
618
568
|
}
|
|
619
|
-
|
|
620
569
|
return hook;
|
|
621
570
|
}
|
|
622
|
-
|
|
623
|
-
|
|
571
|
+
exports.convertHookData = convertHookData;
|
|
572
|
+
// Duck-checks a given object to be a hook object
|
|
624
573
|
// A valid hook object has `type` and `method`
|
|
625
|
-
|
|
626
574
|
function isHookObject(hookObject) {
|
|
627
575
|
return _typeof(hookObject) === 'object' && typeof hookObject.method === 'string' && typeof hookObject.type === 'string';
|
|
628
576
|
}
|
|
629
|
-
|
|
630
|
-
|
|
577
|
+
exports.isHookObject = isHookObject;
|
|
578
|
+
// Returns all service and application hooks combined
|
|
631
579
|
// for a given method and type `appLast` sets if the hooks
|
|
632
580
|
// from `app` should be added last (or first by default)
|
|
633
|
-
|
|
634
581
|
function getHooks(app, service, type, method) {
|
|
635
582
|
var appLast = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
636
583
|
var appHooks = app.__hooks[type][method] || [];
|
|
637
584
|
var serviceHooks = service.__hooks[type][method] || [];
|
|
638
|
-
|
|
639
585
|
if (appLast) {
|
|
640
586
|
// Run hooks in the order of service -> app -> finally
|
|
641
587
|
return serviceHooks.concat(appHooks);
|
|
642
588
|
}
|
|
643
|
-
|
|
644
589
|
return appHooks.concat(serviceHooks);
|
|
645
590
|
}
|
|
646
|
-
|
|
647
591
|
exports.getHooks = getHooks;
|
|
648
|
-
|
|
649
592
|
function processHooks(hooks, initialHookObject) {
|
|
650
593
|
var _this = this;
|
|
651
|
-
|
|
652
594
|
var hookObject = initialHookObject;
|
|
653
|
-
|
|
654
595
|
var updateCurrentHook = function updateCurrentHook(current) {
|
|
655
596
|
// Either use the returned hook object or the current
|
|
656
597
|
// hook object from the chain if the hook returned undefined
|
|
@@ -658,18 +599,15 @@ function processHooks(hooks, initialHookObject) {
|
|
|
658
599
|
if (!isHookObject(current)) {
|
|
659
600
|
throw new Error("".concat(hookObject.type, " hook for '").concat(hookObject.method, "' method returned invalid hook object"));
|
|
660
601
|
}
|
|
661
|
-
|
|
662
602
|
hookObject = current;
|
|
663
603
|
}
|
|
664
|
-
|
|
665
604
|
return hookObject;
|
|
666
|
-
};
|
|
667
|
-
|
|
668
|
-
|
|
605
|
+
};
|
|
606
|
+
// Go through all hooks and chain them into our promise
|
|
669
607
|
var promise = hooks.reduce(function (current, fn) {
|
|
670
608
|
// @ts-ignore
|
|
671
|
-
var hook = fn.bind(_this);
|
|
672
|
-
|
|
609
|
+
var hook = fn.bind(_this);
|
|
610
|
+
// Use the returned hook object or the old one
|
|
673
611
|
return current.then(function (currentHook) {
|
|
674
612
|
return hook(currentHook);
|
|
675
613
|
}).then(updateCurrentHook);
|
|
@@ -682,20 +620,18 @@ function processHooks(hooks, initialHookObject) {
|
|
|
682
620
|
throw error;
|
|
683
621
|
});
|
|
684
622
|
}
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
623
|
+
exports.processHooks = processHooks;
|
|
624
|
+
// Add `.hooks` functionality to an object
|
|
688
625
|
function enableHooks(obj, methods, types) {
|
|
689
626
|
if (typeof obj.hooks === 'function') {
|
|
690
627
|
return obj;
|
|
691
628
|
}
|
|
692
|
-
|
|
693
629
|
var hookData = {};
|
|
694
630
|
types.forEach(function (type) {
|
|
695
631
|
// Initialize properties where hook functions are stored
|
|
696
632
|
hookData[type] = {};
|
|
697
|
-
});
|
|
698
|
-
|
|
633
|
+
});
|
|
634
|
+
// Add non-enumerable `__hooks` property to the object
|
|
699
635
|
Object.defineProperty(obj, '__hooks', {
|
|
700
636
|
configurable: true,
|
|
701
637
|
value: hookData,
|
|
@@ -704,13 +640,11 @@ function enableHooks(obj, methods, types) {
|
|
|
704
640
|
return Object.assign(obj, {
|
|
705
641
|
hooks: function hooks(allHooks) {
|
|
706
642
|
var _this2 = this;
|
|
707
|
-
|
|
708
643
|
each(allHooks, function (current, type) {
|
|
709
644
|
// @ts-ignore
|
|
710
645
|
if (!_this2.__hooks[type]) {
|
|
711
646
|
throw new Error("'".concat(type, "' is not a valid hook type"));
|
|
712
647
|
}
|
|
713
|
-
|
|
714
648
|
var hooks = convertHookData(current);
|
|
715
649
|
each(hooks, function (_value, method) {
|
|
716
650
|
if (method !== 'all' && methods.indexOf(method) === -1) {
|
|
@@ -720,11 +654,9 @@ function enableHooks(obj, methods, types) {
|
|
|
720
654
|
methods.forEach(function (method) {
|
|
721
655
|
// @ts-ignore
|
|
722
656
|
var myHooks = _this2.__hooks[type][method] || (_this2.__hooks[type][method] = []);
|
|
723
|
-
|
|
724
657
|
if (hooks.all) {
|
|
725
658
|
myHooks.push.apply(myHooks, hooks.all);
|
|
726
659
|
}
|
|
727
|
-
|
|
728
660
|
if (hooks[method]) {
|
|
729
661
|
myHooks.push.apply(myHooks, hooks[method]);
|
|
730
662
|
}
|
|
@@ -734,7 +666,6 @@ function enableHooks(obj, methods, types) {
|
|
|
734
666
|
}
|
|
735
667
|
});
|
|
736
668
|
}
|
|
737
|
-
|
|
738
669
|
exports.enableHooks = enableHooks;
|
|
739
670
|
|
|
740
671
|
/***/ }),
|
|
@@ -751,7 +682,6 @@ exports.enableHooks = enableHooks;
|
|
|
751
682
|
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
752
683
|
if (k2 === undefined) k2 = k;
|
|
753
684
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
754
|
-
|
|
755
685
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
756
686
|
desc = {
|
|
757
687
|
enumerable: true,
|
|
@@ -760,13 +690,11 @@ var __createBinding = this && this.__createBinding || (Object.create ? function
|
|
|
760
690
|
}
|
|
761
691
|
};
|
|
762
692
|
}
|
|
763
|
-
|
|
764
693
|
Object.defineProperty(o, k2, desc);
|
|
765
694
|
} : function (o, m, k, k2) {
|
|
766
695
|
if (k2 === undefined) k2 = k;
|
|
767
696
|
o[k2] = m[k];
|
|
768
697
|
});
|
|
769
|
-
|
|
770
698
|
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {
|
|
771
699
|
Object.defineProperty(o, "default", {
|
|
772
700
|
enumerable: true,
|
|
@@ -775,34 +703,22 @@ var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? fun
|
|
|
775
703
|
} : function (o, v) {
|
|
776
704
|
o["default"] = v;
|
|
777
705
|
});
|
|
778
|
-
|
|
779
706
|
var __importStar = this && this.__importStar || function (mod) {
|
|
780
707
|
if (mod && mod.__esModule) return mod;
|
|
781
708
|
var result = {};
|
|
782
|
-
if (mod != null) for (var k in mod)
|
|
783
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
784
|
-
}
|
|
785
|
-
|
|
709
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
786
710
|
__setModuleDefault(result, mod);
|
|
787
|
-
|
|
788
711
|
return result;
|
|
789
712
|
};
|
|
790
|
-
|
|
791
713
|
var __exportStar = this && this.__exportStar || function (m, exports) {
|
|
792
|
-
for (var p in m)
|
|
793
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
794
|
-
}
|
|
714
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
795
715
|
};
|
|
796
|
-
|
|
797
716
|
Object.defineProperty(exports, "__esModule", ({
|
|
798
717
|
value: true
|
|
799
718
|
}));
|
|
800
719
|
exports.hooks = void 0;
|
|
801
|
-
|
|
802
720
|
var hookUtils = __importStar(__webpack_require__(/*! ./hooks */ "../commons/lib/hooks.js"));
|
|
803
|
-
|
|
804
721
|
__exportStar(__webpack_require__(/*! ./utils */ "../commons/lib/utils.js"), exports);
|
|
805
|
-
|
|
806
722
|
exports.hooks = hookUtils;
|
|
807
723
|
|
|
808
724
|
/***/ }),
|
|
@@ -816,33 +732,26 @@ exports.hooks = hookUtils;
|
|
|
816
732
|
"use strict";
|
|
817
733
|
|
|
818
734
|
|
|
819
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
820
|
-
|
|
735
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
736
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
737
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
821
738
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
822
|
-
|
|
823
739
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
824
|
-
|
|
825
740
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
826
|
-
|
|
827
741
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
828
|
-
|
|
829
|
-
function
|
|
830
|
-
|
|
831
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
832
|
-
|
|
742
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
743
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
833
744
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
834
|
-
|
|
835
745
|
Object.defineProperty(exports, "__esModule", ({
|
|
836
746
|
value: true
|
|
837
747
|
}));
|
|
838
|
-
exports.createSymbol = exports.makeUrl = exports.isPromise = exports._ = exports.stripSlashes = void 0;
|
|
839
|
-
|
|
748
|
+
exports.createSymbol = exports.makeUrl = exports.isPromise = exports._ = exports.stripSlashes = void 0;
|
|
749
|
+
// Removes all leading and trailing slashes from a path
|
|
840
750
|
function stripSlashes(name) {
|
|
841
751
|
return name.replace(/^(\/+)|(\/+)$/g, '');
|
|
842
752
|
}
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
753
|
+
exports.stripSlashes = stripSlashes;
|
|
754
|
+
// A set of lodash-y utility functions that use ES6
|
|
846
755
|
exports._ = {
|
|
847
756
|
each: function each(obj, callback) {
|
|
848
757
|
if (obj && typeof obj.forEach === 'function') {
|
|
@@ -858,9 +767,8 @@ exports._ = {
|
|
|
858
767
|
return [value[key], key];
|
|
859
768
|
}).some(function (_ref) {
|
|
860
769
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
770
|
+
val = _ref2[0],
|
|
771
|
+
key = _ref2[1];
|
|
864
772
|
return callback(val, key);
|
|
865
773
|
});
|
|
866
774
|
},
|
|
@@ -869,9 +777,8 @@ exports._ = {
|
|
|
869
777
|
return [value[key], key];
|
|
870
778
|
}).every(function (_ref3) {
|
|
871
779
|
var _ref4 = _slicedToArray(_ref3, 2),
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
780
|
+
val = _ref4[0],
|
|
781
|
+
key = _ref4[1];
|
|
875
782
|
return callback(val, key);
|
|
876
783
|
});
|
|
877
784
|
},
|
|
@@ -901,16 +808,13 @@ exports._ = {
|
|
|
901
808
|
for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
902
809
|
rest[_key - 1] = arguments[_key];
|
|
903
810
|
}
|
|
904
|
-
|
|
905
811
|
return Object.assign.apply(Object, [first].concat(rest));
|
|
906
812
|
},
|
|
907
813
|
omit: function omit(obj) {
|
|
908
814
|
var result = exports._.extend({}, obj);
|
|
909
|
-
|
|
910
815
|
for (var _len2 = arguments.length, keys = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
911
816
|
keys[_key2 - 1] = arguments[_key2];
|
|
912
817
|
}
|
|
913
|
-
|
|
914
818
|
keys.forEach(function (key) {
|
|
915
819
|
return delete result[key];
|
|
916
820
|
});
|
|
@@ -920,12 +824,10 @@ exports._ = {
|
|
|
920
824
|
for (var _len3 = arguments.length, keys = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
|
|
921
825
|
keys[_key3 - 1] = arguments[_key3];
|
|
922
826
|
}
|
|
923
|
-
|
|
924
827
|
return keys.reduce(function (result, key) {
|
|
925
828
|
if (source[key] !== undefined) {
|
|
926
829
|
result[key] = source[key];
|
|
927
830
|
}
|
|
928
|
-
|
|
929
831
|
return result;
|
|
930
832
|
}, {});
|
|
931
833
|
},
|
|
@@ -937,24 +839,20 @@ exports._ = {
|
|
|
937
839
|
if (!target[key]) {
|
|
938
840
|
Object.assign(target, _defineProperty({}, key, {}));
|
|
939
841
|
}
|
|
940
|
-
|
|
941
842
|
exports._.merge(target[key], source[key]);
|
|
942
843
|
} else {
|
|
943
844
|
Object.assign(target, _defineProperty({}, key, source[key]));
|
|
944
845
|
}
|
|
945
846
|
});
|
|
946
847
|
}
|
|
947
|
-
|
|
948
848
|
return target;
|
|
949
849
|
}
|
|
950
|
-
};
|
|
951
|
-
|
|
850
|
+
};
|
|
851
|
+
// Duck-checks if an object looks like a promise
|
|
952
852
|
function isPromise(result) {
|
|
953
853
|
return exports._.isObject(result) && typeof result.then === 'function';
|
|
954
854
|
}
|
|
955
|
-
|
|
956
855
|
exports.isPromise = isPromise;
|
|
957
|
-
|
|
958
856
|
function makeUrl(path) {
|
|
959
857
|
var app = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
960
858
|
var get = typeof app.get === 'function' ? app.get.bind(app) : function () {};
|
|
@@ -966,13 +864,10 @@ function makeUrl(path) {
|
|
|
966
864
|
path = path || '';
|
|
967
865
|
return "".concat(protocol, "://").concat(host).concat(port, "/").concat(exports.stripSlashes(path));
|
|
968
866
|
}
|
|
969
|
-
|
|
970
867
|
exports.makeUrl = makeUrl;
|
|
971
|
-
|
|
972
868
|
function createSymbol(name) {
|
|
973
869
|
return typeof Symbol !== 'undefined' ? Symbol(name) : name;
|
|
974
870
|
}
|
|
975
|
-
|
|
976
871
|
exports.createSymbol = createSymbol;
|
|
977
872
|
|
|
978
873
|
/***/ }),
|
|
@@ -984,18 +879,16 @@ exports.createSymbol = createSymbol;
|
|
|
984
879
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
985
880
|
|
|
986
881
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
987
|
-
|
|
988
882
|
var debug = __webpack_require__(/*! debug */ "../../node_modules/debug/src/browser.js")('@feathersjs/errors');
|
|
989
|
-
|
|
990
883
|
function FeathersError(msg, name, code, className, data) {
|
|
991
884
|
msg = msg || 'Error';
|
|
992
885
|
var errors;
|
|
993
886
|
var message;
|
|
994
887
|
var newData;
|
|
995
|
-
|
|
996
888
|
if (msg instanceof Error) {
|
|
997
|
-
message = msg.message || 'Error';
|
|
889
|
+
message = msg.message || 'Error';
|
|
998
890
|
|
|
891
|
+
// NOTE (EK): This is typically to handle validation errors
|
|
999
892
|
if (msg.errors) {
|
|
1000
893
|
errors = msg.errors;
|
|
1001
894
|
}
|
|
@@ -1007,13 +900,11 @@ function FeathersError(msg, name, code, className, data) {
|
|
|
1007
900
|
// message is just a string
|
|
1008
901
|
message = msg;
|
|
1009
902
|
}
|
|
1010
|
-
|
|
1011
903
|
if (data) {
|
|
1012
904
|
// NOTE(EK): To make sure that we are not messing
|
|
1013
905
|
// with immutable data, just make a copy.
|
|
1014
906
|
// https://github.com/feathersjs/errors/issues/19
|
|
1015
907
|
newData = JSON.parse(JSON.stringify(data));
|
|
1016
|
-
|
|
1017
908
|
if (newData.errors) {
|
|
1018
909
|
errors = newData.errors;
|
|
1019
910
|
delete newData.errors;
|
|
@@ -1023,11 +914,11 @@ function FeathersError(msg, name, code, className, data) {
|
|
|
1023
914
|
// For example: when cloning arrays this property
|
|
1024
915
|
errors = JSON.parse(JSON.stringify(data.errors));
|
|
1025
916
|
}
|
|
1026
|
-
}
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
// NOTE (EK): Babel doesn't support this so
|
|
1027
920
|
// we have to pass in the class name manually.
|
|
1028
921
|
// this.name = this.constructor.name;
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
922
|
this.type = 'FeathersError';
|
|
1032
923
|
this.name = name;
|
|
1033
924
|
this.message = message;
|
|
@@ -1037,22 +928,20 @@ function FeathersError(msg, name, code, className, data) {
|
|
|
1037
928
|
this.errors = errors || {};
|
|
1038
929
|
debug("".concat(this.name, "(").concat(this.code, "): ").concat(this.message));
|
|
1039
930
|
debug(this.errors);
|
|
1040
|
-
|
|
1041
931
|
if (Error.captureStackTrace) {
|
|
1042
932
|
Error.captureStackTrace(this, FeathersError);
|
|
1043
933
|
} else {
|
|
1044
934
|
this.stack = new Error().stack;
|
|
1045
935
|
}
|
|
1046
936
|
}
|
|
1047
|
-
|
|
1048
937
|
function inheritsFrom(Child, Parent) {
|
|
1049
938
|
Child.prototype = Object.create(Parent.prototype);
|
|
1050
939
|
Child.prototype.constructor = Child;
|
|
1051
940
|
}
|
|
941
|
+
inheritsFrom(FeathersError, Error);
|
|
1052
942
|
|
|
1053
|
-
|
|
943
|
+
// NOTE (EK): A little hack to get around `message` not
|
|
1054
944
|
// being included in the default toJSON call.
|
|
1055
|
-
|
|
1056
945
|
Object.defineProperty(FeathersError.prototype, 'toJSON', {
|
|
1057
946
|
value: function value() {
|
|
1058
947
|
return {
|
|
@@ -1064,108 +953,108 @@ Object.defineProperty(FeathersError.prototype, 'toJSON', {
|
|
|
1064
953
|
errors: this.errors
|
|
1065
954
|
};
|
|
1066
955
|
}
|
|
1067
|
-
});
|
|
956
|
+
});
|
|
1068
957
|
|
|
958
|
+
// 400 - Bad Request
|
|
1069
959
|
function BadRequest(message, data) {
|
|
1070
960
|
FeathersError.call(this, message, 'BadRequest', 400, 'bad-request', data);
|
|
1071
961
|
}
|
|
962
|
+
inheritsFrom(BadRequest, FeathersError);
|
|
1072
963
|
|
|
1073
|
-
|
|
1074
|
-
|
|
964
|
+
// 401 - Not Authenticated
|
|
1075
965
|
function NotAuthenticated(message, data) {
|
|
1076
966
|
FeathersError.call(this, message, 'NotAuthenticated', 401, 'not-authenticated', data);
|
|
1077
967
|
}
|
|
968
|
+
inheritsFrom(NotAuthenticated, FeathersError);
|
|
1078
969
|
|
|
1079
|
-
|
|
1080
|
-
|
|
970
|
+
// 402 - Payment Error
|
|
1081
971
|
function PaymentError(message, data) {
|
|
1082
972
|
FeathersError.call(this, message, 'PaymentError', 402, 'payment-error', data);
|
|
1083
973
|
}
|
|
974
|
+
inheritsFrom(PaymentError, FeathersError);
|
|
1084
975
|
|
|
1085
|
-
|
|
1086
|
-
|
|
976
|
+
// 403 - Forbidden
|
|
1087
977
|
function Forbidden(message, data) {
|
|
1088
978
|
FeathersError.call(this, message, 'Forbidden', 403, 'forbidden', data);
|
|
1089
979
|
}
|
|
980
|
+
inheritsFrom(Forbidden, FeathersError);
|
|
1090
981
|
|
|
1091
|
-
|
|
1092
|
-
|
|
982
|
+
// 404 - Not Found
|
|
1093
983
|
function NotFound(message, data) {
|
|
1094
984
|
FeathersError.call(this, message, 'NotFound', 404, 'not-found', data);
|
|
1095
985
|
}
|
|
986
|
+
inheritsFrom(NotFound, FeathersError);
|
|
1096
987
|
|
|
1097
|
-
|
|
1098
|
-
|
|
988
|
+
// 405 - Method Not Allowed
|
|
1099
989
|
function MethodNotAllowed(message, data) {
|
|
1100
990
|
FeathersError.call(this, message, 'MethodNotAllowed', 405, 'method-not-allowed', data);
|
|
1101
991
|
}
|
|
992
|
+
inheritsFrom(MethodNotAllowed, FeathersError);
|
|
1102
993
|
|
|
1103
|
-
|
|
1104
|
-
|
|
994
|
+
// 406 - Not Acceptable
|
|
1105
995
|
function NotAcceptable(message, data) {
|
|
1106
996
|
FeathersError.call(this, message, 'NotAcceptable', 406, 'not-acceptable', data);
|
|
1107
997
|
}
|
|
998
|
+
inheritsFrom(NotAcceptable, FeathersError);
|
|
1108
999
|
|
|
1109
|
-
|
|
1110
|
-
|
|
1000
|
+
// 408 - Timeout
|
|
1111
1001
|
function Timeout(message, data) {
|
|
1112
1002
|
FeathersError.call(this, message, 'Timeout', 408, 'timeout', data);
|
|
1113
1003
|
}
|
|
1004
|
+
inheritsFrom(Timeout, FeathersError);
|
|
1114
1005
|
|
|
1115
|
-
|
|
1116
|
-
|
|
1006
|
+
// 409 - Conflict
|
|
1117
1007
|
function Conflict(message, data) {
|
|
1118
1008
|
FeathersError.call(this, message, 'Conflict', 409, 'conflict', data);
|
|
1119
1009
|
}
|
|
1010
|
+
inheritsFrom(Conflict, FeathersError);
|
|
1120
1011
|
|
|
1121
|
-
|
|
1122
|
-
|
|
1012
|
+
// 410 - Gone
|
|
1123
1013
|
function Gone(message, data) {
|
|
1124
1014
|
FeathersError(this, message, 'Gone', 410, 'gone', data);
|
|
1125
1015
|
}
|
|
1016
|
+
inheritsFrom(Gone, FeathersError);
|
|
1126
1017
|
|
|
1127
|
-
|
|
1128
|
-
|
|
1018
|
+
// 411 - Length Required
|
|
1129
1019
|
function LengthRequired(message, data) {
|
|
1130
1020
|
FeathersError.call(this, message, 'LengthRequired', 411, 'length-required', data);
|
|
1131
1021
|
}
|
|
1022
|
+
inheritsFrom(LengthRequired, FeathersError);
|
|
1132
1023
|
|
|
1133
|
-
|
|
1134
|
-
|
|
1024
|
+
// 422 Unprocessable
|
|
1135
1025
|
function Unprocessable(message, data) {
|
|
1136
1026
|
FeathersError.call(this, message, 'Unprocessable', 422, 'unprocessable', data);
|
|
1137
1027
|
}
|
|
1028
|
+
inheritsFrom(Unprocessable, FeathersError);
|
|
1138
1029
|
|
|
1139
|
-
|
|
1140
|
-
|
|
1030
|
+
// 429 Too Many Requests
|
|
1141
1031
|
function TooManyRequests(message, data) {
|
|
1142
1032
|
FeathersError.call(this, message, 'TooManyRequests', 429, 'too-many-requests', data);
|
|
1143
1033
|
}
|
|
1034
|
+
inheritsFrom(TooManyRequests, FeathersError);
|
|
1144
1035
|
|
|
1145
|
-
|
|
1146
|
-
|
|
1036
|
+
// 500 - General Error
|
|
1147
1037
|
function GeneralError(message, data) {
|
|
1148
1038
|
FeathersError.call(this, message, 'GeneralError', 500, 'general-error', data);
|
|
1149
1039
|
}
|
|
1040
|
+
inheritsFrom(GeneralError, FeathersError);
|
|
1150
1041
|
|
|
1151
|
-
|
|
1152
|
-
|
|
1042
|
+
// 501 - Not Implemented
|
|
1153
1043
|
function NotImplemented(message, data) {
|
|
1154
1044
|
FeathersError.call(this, message, 'NotImplemented', 501, 'not-implemented', data);
|
|
1155
1045
|
}
|
|
1046
|
+
inheritsFrom(NotImplemented, FeathersError);
|
|
1156
1047
|
|
|
1157
|
-
|
|
1158
|
-
|
|
1048
|
+
// 502 - Bad Gateway
|
|
1159
1049
|
function BadGateway(message, data) {
|
|
1160
1050
|
FeathersError.call(this, message, 'BadGateway', 502, 'bad-gateway', data);
|
|
1161
1051
|
}
|
|
1052
|
+
inheritsFrom(BadGateway, FeathersError);
|
|
1162
1053
|
|
|
1163
|
-
|
|
1164
|
-
|
|
1054
|
+
// 503 - Unavailable
|
|
1165
1055
|
function Unavailable(message, data) {
|
|
1166
1056
|
FeathersError.call(this, message, 'Unavailable', 503, 'unavailable', data);
|
|
1167
1057
|
}
|
|
1168
|
-
|
|
1169
1058
|
inheritsFrom(Unavailable, FeathersError);
|
|
1170
1059
|
var errors = {
|
|
1171
1060
|
FeathersError: FeathersError,
|
|
@@ -1204,22 +1093,17 @@ var errors = {
|
|
|
1204
1093
|
502: BadGateway,
|
|
1205
1094
|
503: Unavailable
|
|
1206
1095
|
};
|
|
1207
|
-
|
|
1208
1096
|
function convert(error) {
|
|
1209
1097
|
if (!error) {
|
|
1210
1098
|
return error;
|
|
1211
1099
|
}
|
|
1212
|
-
|
|
1213
1100
|
var FeathersError = errors[error.name];
|
|
1214
1101
|
var result = FeathersError ? new FeathersError(error.message, error.data) : new Error(error.message || error);
|
|
1215
|
-
|
|
1216
1102
|
if (_typeof(error) === 'object') {
|
|
1217
1103
|
Object.assign(result, error);
|
|
1218
1104
|
}
|
|
1219
|
-
|
|
1220
1105
|
return result;
|
|
1221
1106
|
}
|
|
1222
|
-
|
|
1223
1107
|
module.exports = Object.assign({
|
|
1224
1108
|
convert: convert
|
|
1225
1109
|
}, errors);
|
|
@@ -1233,53 +1117,37 @@ module.exports = Object.assign({
|
|
|
1233
1117
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
1234
1118
|
|
|
1235
1119
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1236
|
-
|
|
1237
1120
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
1238
|
-
|
|
1239
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
1240
|
-
|
|
1121
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
1241
1122
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
1242
|
-
|
|
1123
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
1124
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
1243
1125
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
1244
|
-
|
|
1245
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
1246
|
-
|
|
1126
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
1247
1127
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
1248
|
-
|
|
1249
1128
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
1250
|
-
|
|
1251
1129
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
1252
|
-
|
|
1253
1130
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
1254
|
-
|
|
1255
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
1256
|
-
|
|
1131
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
1257
1132
|
var Base = __webpack_require__(/*! ./base */ "../rest-client/lib/base.js");
|
|
1258
|
-
|
|
1259
1133
|
var AngularHttpService = /*#__PURE__*/function (_Base) {
|
|
1260
1134
|
_inherits(AngularHttpService, _Base);
|
|
1261
|
-
|
|
1262
1135
|
var _super = _createSuper(AngularHttpService);
|
|
1263
|
-
|
|
1264
1136
|
function AngularHttpService() {
|
|
1265
1137
|
_classCallCheck(this, AngularHttpService);
|
|
1266
|
-
|
|
1267
1138
|
return _super.apply(this, arguments);
|
|
1268
1139
|
}
|
|
1269
|
-
|
|
1270
1140
|
_createClass(AngularHttpService, [{
|
|
1271
1141
|
key: "request",
|
|
1272
1142
|
value: function request(options, params) {
|
|
1273
1143
|
var httpClient = this.connection;
|
|
1274
1144
|
var HttpHeaders = this.options.HttpHeaders;
|
|
1275
|
-
|
|
1276
1145
|
if (!httpClient || !HttpHeaders) {
|
|
1277
1146
|
throw new Error("Please pass angular's 'httpClient' (instance) and and object with 'HttpHeaders' (class) to feathers-rest");
|
|
1278
1147
|
}
|
|
1279
|
-
|
|
1280
1148
|
var url = options.url;
|
|
1281
1149
|
var _params$connection = params.connection,
|
|
1282
|
-
|
|
1150
|
+
connection = _params$connection === void 0 ? {} : _params$connection;
|
|
1283
1151
|
var headers = new HttpHeaders(Object.assign({
|
|
1284
1152
|
Accept: 'application/json'
|
|
1285
1153
|
}, this.options.headers, options.headers, connection.headers));
|
|
@@ -1293,19 +1161,15 @@ var AngularHttpService = /*#__PURE__*/function (_Base) {
|
|
|
1293
1161
|
httpClient.request(options.method, url, requestOptions).subscribe(resolve, reject);
|
|
1294
1162
|
}).catch(function (error) {
|
|
1295
1163
|
var e = error.error;
|
|
1296
|
-
|
|
1297
1164
|
if (e) {
|
|
1298
1165
|
throw typeof e === 'string' ? JSON.parse(e) : e;
|
|
1299
1166
|
}
|
|
1300
|
-
|
|
1301
1167
|
throw error;
|
|
1302
1168
|
});
|
|
1303
1169
|
}
|
|
1304
1170
|
}]);
|
|
1305
|
-
|
|
1306
1171
|
return AngularHttpService;
|
|
1307
1172
|
}(Base);
|
|
1308
|
-
|
|
1309
1173
|
module.exports = AngularHttpService;
|
|
1310
1174
|
|
|
1311
1175
|
/***/ }),
|
|
@@ -1317,53 +1181,37 @@ module.exports = AngularHttpService;
|
|
|
1317
1181
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
1318
1182
|
|
|
1319
1183
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1320
|
-
|
|
1321
1184
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
1322
|
-
|
|
1323
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
1324
|
-
|
|
1185
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
1325
1186
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
1326
|
-
|
|
1187
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
1188
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
1327
1189
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
1328
|
-
|
|
1329
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
1330
|
-
|
|
1190
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
1331
1191
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
1332
|
-
|
|
1333
1192
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
1334
|
-
|
|
1335
1193
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
1336
|
-
|
|
1337
1194
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
1338
|
-
|
|
1339
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
1340
|
-
|
|
1195
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
1341
1196
|
var Base = __webpack_require__(/*! ./base */ "../rest-client/lib/base.js");
|
|
1342
|
-
|
|
1343
1197
|
var AngularService = /*#__PURE__*/function (_Base) {
|
|
1344
1198
|
_inherits(AngularService, _Base);
|
|
1345
|
-
|
|
1346
1199
|
var _super = _createSuper(AngularService);
|
|
1347
|
-
|
|
1348
1200
|
function AngularService() {
|
|
1349
1201
|
_classCallCheck(this, AngularService);
|
|
1350
|
-
|
|
1351
1202
|
return _super.apply(this, arguments);
|
|
1352
1203
|
}
|
|
1353
|
-
|
|
1354
1204
|
_createClass(AngularService, [{
|
|
1355
1205
|
key: "request",
|
|
1356
1206
|
value: function request(options, params) {
|
|
1357
1207
|
var http = this.connection;
|
|
1358
1208
|
var Headers = this.options.Headers;
|
|
1359
|
-
|
|
1360
1209
|
if (!http || !Headers) {
|
|
1361
1210
|
throw new Error("Please pass angular's 'http' (instance) and and object with 'Headers' (class) to feathers-rest");
|
|
1362
1211
|
}
|
|
1363
|
-
|
|
1364
1212
|
var url = options.url;
|
|
1365
1213
|
var _params$connection = params.connection,
|
|
1366
|
-
|
|
1214
|
+
connection = _params$connection === void 0 ? {} : _params$connection;
|
|
1367
1215
|
var headers = new Headers(Object.assign({
|
|
1368
1216
|
Accept: 'application/json'
|
|
1369
1217
|
}, this.options.headers, options.headers, connection.headers));
|
|
@@ -1383,10 +1231,8 @@ var AngularService = /*#__PURE__*/function (_Base) {
|
|
|
1383
1231
|
});
|
|
1384
1232
|
}
|
|
1385
1233
|
}]);
|
|
1386
|
-
|
|
1387
1234
|
return AngularService;
|
|
1388
1235
|
}(Base);
|
|
1389
|
-
|
|
1390
1236
|
module.exports = AngularService;
|
|
1391
1237
|
|
|
1392
1238
|
/***/ }),
|
|
@@ -1398,40 +1244,26 @@ module.exports = AngularService;
|
|
|
1398
1244
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
1399
1245
|
|
|
1400
1246
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1401
|
-
|
|
1402
1247
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
1403
|
-
|
|
1404
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
1405
|
-
|
|
1248
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
1406
1249
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
1407
|
-
|
|
1250
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
1251
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
1408
1252
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
1409
|
-
|
|
1410
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
1411
|
-
|
|
1253
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
1412
1254
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
1413
|
-
|
|
1414
1255
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
1415
|
-
|
|
1416
1256
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
1417
|
-
|
|
1418
1257
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
1419
|
-
|
|
1420
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
1421
|
-
|
|
1258
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
1422
1259
|
var Base = __webpack_require__(/*! ./base */ "../rest-client/lib/base.js");
|
|
1423
|
-
|
|
1424
1260
|
var AxiosService = /*#__PURE__*/function (_Base) {
|
|
1425
1261
|
_inherits(AxiosService, _Base);
|
|
1426
|
-
|
|
1427
1262
|
var _super = _createSuper(AxiosService);
|
|
1428
|
-
|
|
1429
1263
|
function AxiosService() {
|
|
1430
1264
|
_classCallCheck(this, AxiosService);
|
|
1431
|
-
|
|
1432
1265
|
return _super.apply(this, arguments);
|
|
1433
1266
|
}
|
|
1434
|
-
|
|
1435
1267
|
_createClass(AxiosService, [{
|
|
1436
1268
|
key: "request",
|
|
1437
1269
|
value: function request(options, params) {
|
|
@@ -1451,10 +1283,8 @@ var AxiosService = /*#__PURE__*/function (_Base) {
|
|
|
1451
1283
|
});
|
|
1452
1284
|
}
|
|
1453
1285
|
}]);
|
|
1454
|
-
|
|
1455
1286
|
return AxiosService;
|
|
1456
1287
|
}(Base);
|
|
1457
|
-
|
|
1458
1288
|
module.exports = AxiosService;
|
|
1459
1289
|
|
|
1460
1290
|
/***/ }),
|
|
@@ -1465,54 +1295,43 @@ module.exports = AxiosService;
|
|
|
1465
1295
|
\**********************************/
|
|
1466
1296
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
1467
1297
|
|
|
1298
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1468
1299
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
1469
|
-
|
|
1470
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
1471
|
-
|
|
1300
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
1472
1301
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
1473
|
-
|
|
1302
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
1303
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
1474
1304
|
var qs = __webpack_require__(/*! qs */ "../../node_modules/qs/lib/index.js");
|
|
1475
|
-
|
|
1476
1305
|
var _require = __webpack_require__(/*! @feathersjs/errors */ "../errors/lib/index.js"),
|
|
1477
|
-
|
|
1478
|
-
|
|
1306
|
+
Unavailable = _require.Unavailable;
|
|
1479
1307
|
var _require2 = __webpack_require__(/*! @feathersjs/commons */ "../commons/lib/index.js"),
|
|
1480
|
-
|
|
1481
|
-
|
|
1308
|
+
_ = _require2._;
|
|
1482
1309
|
var _require3 = __webpack_require__(/*! @feathersjs/commons */ "../commons/lib/index.js"),
|
|
1483
|
-
|
|
1484
|
-
|
|
1310
|
+
stripSlashes = _require3.stripSlashes;
|
|
1485
1311
|
var _require4 = __webpack_require__(/*! @feathersjs/errors */ "../errors/lib/index.js"),
|
|
1486
|
-
|
|
1487
|
-
|
|
1312
|
+
convert = _require4.convert;
|
|
1488
1313
|
function toError(error) {
|
|
1489
1314
|
if (error.code === 'ECONNREFUSED') {
|
|
1490
1315
|
throw new Unavailable(error.message, _.pick(error, 'address', 'port', 'config'));
|
|
1491
1316
|
}
|
|
1492
|
-
|
|
1493
1317
|
throw convert(error);
|
|
1494
1318
|
}
|
|
1495
|
-
|
|
1496
1319
|
var Base = /*#__PURE__*/function () {
|
|
1497
1320
|
function Base(settings) {
|
|
1498
1321
|
_classCallCheck(this, Base);
|
|
1499
|
-
|
|
1500
1322
|
this.name = stripSlashes(settings.name);
|
|
1501
1323
|
this.options = settings.options;
|
|
1502
1324
|
this.connection = settings.connection;
|
|
1503
1325
|
this.base = "".concat(settings.base, "/").concat(this.name);
|
|
1504
1326
|
}
|
|
1505
|
-
|
|
1506
1327
|
_createClass(Base, [{
|
|
1507
1328
|
key: "makeUrl",
|
|
1508
1329
|
value: function makeUrl(query, id) {
|
|
1509
1330
|
query = query || {};
|
|
1510
1331
|
var url = this.base;
|
|
1511
|
-
|
|
1512
1332
|
if (typeof id !== 'undefined' && id !== null) {
|
|
1513
1333
|
url += "/".concat(encodeURIComponent(id));
|
|
1514
1334
|
}
|
|
1515
|
-
|
|
1516
1335
|
return url + this.getQuery(query);
|
|
1517
1336
|
}
|
|
1518
1337
|
}, {
|
|
@@ -1522,7 +1341,6 @@ var Base = /*#__PURE__*/function () {
|
|
|
1522
1341
|
var queryString = qs.stringify(query);
|
|
1523
1342
|
return "?".concat(queryString);
|
|
1524
1343
|
}
|
|
1525
|
-
|
|
1526
1344
|
return '';
|
|
1527
1345
|
}
|
|
1528
1346
|
}, {
|
|
@@ -1539,11 +1357,9 @@ var Base = /*#__PURE__*/function () {
|
|
|
1539
1357
|
key: "get",
|
|
1540
1358
|
value: function get(id) {
|
|
1541
1359
|
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1542
|
-
|
|
1543
1360
|
if (typeof id === 'undefined') {
|
|
1544
1361
|
return Promise.reject(new Error("id for 'get' can not be undefined"));
|
|
1545
1362
|
}
|
|
1546
|
-
|
|
1547
1363
|
return this.request({
|
|
1548
1364
|
url: this.makeUrl(params.query, id),
|
|
1549
1365
|
method: 'GET',
|
|
@@ -1567,11 +1383,9 @@ var Base = /*#__PURE__*/function () {
|
|
|
1567
1383
|
key: "update",
|
|
1568
1384
|
value: function update(id, body) {
|
|
1569
1385
|
var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1570
|
-
|
|
1571
1386
|
if (typeof id === 'undefined') {
|
|
1572
1387
|
return Promise.reject(new Error("id for 'update' can not be undefined, only 'null' when updating multiple entries"));
|
|
1573
1388
|
}
|
|
1574
|
-
|
|
1575
1389
|
return this.request({
|
|
1576
1390
|
url: this.makeUrl(params.query, id),
|
|
1577
1391
|
body: body,
|
|
@@ -1585,11 +1399,9 @@ var Base = /*#__PURE__*/function () {
|
|
|
1585
1399
|
key: "patch",
|
|
1586
1400
|
value: function patch(id, body) {
|
|
1587
1401
|
var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1588
|
-
|
|
1589
1402
|
if (typeof id === 'undefined') {
|
|
1590
1403
|
return Promise.reject(new Error("id for 'patch' can not be undefined, only 'null' when updating multiple entries"));
|
|
1591
1404
|
}
|
|
1592
|
-
|
|
1593
1405
|
return this.request({
|
|
1594
1406
|
url: this.makeUrl(params.query, id),
|
|
1595
1407
|
body: body,
|
|
@@ -1603,11 +1415,9 @@ var Base = /*#__PURE__*/function () {
|
|
|
1603
1415
|
key: "remove",
|
|
1604
1416
|
value: function remove(id) {
|
|
1605
1417
|
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1606
|
-
|
|
1607
1418
|
if (typeof id === 'undefined') {
|
|
1608
1419
|
return Promise.reject(new Error("id for 'remove' can not be undefined, only 'null' when removing multiple entries"));
|
|
1609
1420
|
}
|
|
1610
|
-
|
|
1611
1421
|
return this.request({
|
|
1612
1422
|
url: this.makeUrl(params.query, id),
|
|
1613
1423
|
method: 'DELETE',
|
|
@@ -1615,10 +1425,8 @@ var Base = /*#__PURE__*/function () {
|
|
|
1615
1425
|
}, params).catch(toError);
|
|
1616
1426
|
}
|
|
1617
1427
|
}]);
|
|
1618
|
-
|
|
1619
1428
|
return Base;
|
|
1620
1429
|
}();
|
|
1621
|
-
|
|
1622
1430
|
module.exports = Base;
|
|
1623
1431
|
|
|
1624
1432
|
/***/ }),
|
|
@@ -1630,42 +1438,27 @@ module.exports = Base;
|
|
|
1630
1438
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
1631
1439
|
|
|
1632
1440
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1633
|
-
|
|
1634
1441
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
1635
|
-
|
|
1636
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
1637
|
-
|
|
1442
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
1638
1443
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
1639
|
-
|
|
1444
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
1445
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
1640
1446
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
1641
|
-
|
|
1642
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
1643
|
-
|
|
1447
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
1644
1448
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
1645
|
-
|
|
1646
1449
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
1647
|
-
|
|
1648
1450
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
1649
|
-
|
|
1650
1451
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
1651
|
-
|
|
1652
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
1653
|
-
|
|
1452
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
1654
1453
|
var Base = __webpack_require__(/*! ./base */ "../rest-client/lib/base.js");
|
|
1655
|
-
|
|
1656
1454
|
var errors = __webpack_require__(/*! @feathersjs/errors */ "../errors/lib/index.js");
|
|
1657
|
-
|
|
1658
1455
|
var FetchService = /*#__PURE__*/function (_Base) {
|
|
1659
1456
|
_inherits(FetchService, _Base);
|
|
1660
|
-
|
|
1661
1457
|
var _super = _createSuper(FetchService);
|
|
1662
|
-
|
|
1663
1458
|
function FetchService() {
|
|
1664
1459
|
_classCallCheck(this, FetchService);
|
|
1665
|
-
|
|
1666
1460
|
return _super.apply(this, arguments);
|
|
1667
1461
|
}
|
|
1668
|
-
|
|
1669
1462
|
_createClass(FetchService, [{
|
|
1670
1463
|
key: "request",
|
|
1671
1464
|
value: function request(options, params) {
|
|
@@ -1673,17 +1466,14 @@ var FetchService = /*#__PURE__*/function (_Base) {
|
|
|
1673
1466
|
fetchOptions.headers = Object.assign({
|
|
1674
1467
|
Accept: 'application/json'
|
|
1675
1468
|
}, this.options.headers, fetchOptions.headers);
|
|
1676
|
-
|
|
1677
1469
|
if (options.body) {
|
|
1678
1470
|
fetchOptions.body = JSON.stringify(options.body);
|
|
1679
1471
|
}
|
|
1680
|
-
|
|
1681
1472
|
var fetch = this.connection;
|
|
1682
1473
|
return fetch(options.url, fetchOptions).then(this.checkStatus).then(function (response) {
|
|
1683
1474
|
if (response.status === 204) {
|
|
1684
1475
|
return null;
|
|
1685
1476
|
}
|
|
1686
|
-
|
|
1687
1477
|
return response.json();
|
|
1688
1478
|
});
|
|
1689
1479
|
}
|
|
@@ -1693,7 +1483,6 @@ var FetchService = /*#__PURE__*/function (_Base) {
|
|
|
1693
1483
|
if (response.ok) {
|
|
1694
1484
|
return response;
|
|
1695
1485
|
}
|
|
1696
|
-
|
|
1697
1486
|
return response.json().catch(function () {
|
|
1698
1487
|
var ErrorClass = errors[response.status] || Error;
|
|
1699
1488
|
return new ErrorClass('JSON parsing error');
|
|
@@ -1703,10 +1492,8 @@ var FetchService = /*#__PURE__*/function (_Base) {
|
|
|
1703
1492
|
});
|
|
1704
1493
|
}
|
|
1705
1494
|
}]);
|
|
1706
|
-
|
|
1707
1495
|
return FetchService;
|
|
1708
1496
|
}(Base);
|
|
1709
|
-
|
|
1710
1497
|
module.exports = FetchService;
|
|
1711
1498
|
|
|
1712
1499
|
/***/ }),
|
|
@@ -1718,21 +1505,13 @@ module.exports = FetchService;
|
|
|
1718
1505
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
1719
1506
|
|
|
1720
1507
|
var jQueryClient = __webpack_require__(/*! ./jquery */ "../rest-client/lib/jquery.js");
|
|
1721
|
-
|
|
1722
1508
|
var SuperagentClient = __webpack_require__(/*! ./superagent */ "../rest-client/lib/superagent.js");
|
|
1723
|
-
|
|
1724
1509
|
var RequestClient = __webpack_require__(/*! ./request */ "../rest-client/lib/request.js");
|
|
1725
|
-
|
|
1726
1510
|
var FetchClient = __webpack_require__(/*! ./fetch */ "../rest-client/lib/fetch.js");
|
|
1727
|
-
|
|
1728
1511
|
var AxiosClient = __webpack_require__(/*! ./axios */ "../rest-client/lib/axios.js");
|
|
1729
|
-
|
|
1730
1512
|
var AngularClient = __webpack_require__(/*! ./angular */ "../rest-client/lib/angular.js");
|
|
1731
|
-
|
|
1732
1513
|
var Base = __webpack_require__(/*! ./base */ "../rest-client/lib/base.js");
|
|
1733
|
-
|
|
1734
1514
|
var AngularHttpClient = __webpack_require__(/*! ./angular-http-client */ "../rest-client/lib/angular-http-client.js");
|
|
1735
|
-
|
|
1736
1515
|
var transports = {
|
|
1737
1516
|
jquery: jQueryClient,
|
|
1738
1517
|
superagent: SuperagentClient,
|
|
@@ -1742,7 +1521,6 @@ var transports = {
|
|
|
1742
1521
|
angular: AngularClient,
|
|
1743
1522
|
angularHttpClient: AngularHttpClient
|
|
1744
1523
|
};
|
|
1745
|
-
|
|
1746
1524
|
function restClient() {
|
|
1747
1525
|
var base = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
1748
1526
|
var result = {
|
|
@@ -1752,16 +1530,13 @@ function restClient() {
|
|
|
1752
1530
|
result[key] = function (connection) {
|
|
1753
1531
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1754
1532
|
var Service = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : transports[key];
|
|
1755
|
-
|
|
1756
1533
|
if (!connection) {
|
|
1757
1534
|
throw new Error("".concat(key, " has to be provided to feathers-rest"));
|
|
1758
1535
|
}
|
|
1759
|
-
|
|
1760
1536
|
if (typeof options === 'function') {
|
|
1761
1537
|
Service = options;
|
|
1762
1538
|
options = {};
|
|
1763
1539
|
}
|
|
1764
|
-
|
|
1765
1540
|
var defaultService = function defaultService(name) {
|
|
1766
1541
|
return new Service({
|
|
1767
1542
|
base: base,
|
|
@@ -1770,16 +1545,13 @@ function restClient() {
|
|
|
1770
1545
|
options: options
|
|
1771
1546
|
});
|
|
1772
1547
|
};
|
|
1773
|
-
|
|
1774
1548
|
var initialize = function initialize(app) {
|
|
1775
1549
|
if (typeof app.defaultService === 'function') {
|
|
1776
1550
|
throw new Error('Only one default client provider can be configured');
|
|
1777
1551
|
}
|
|
1778
|
-
|
|
1779
1552
|
app.rest = connection;
|
|
1780
1553
|
app.defaultService = defaultService;
|
|
1781
1554
|
};
|
|
1782
|
-
|
|
1783
1555
|
initialize.Service = Service;
|
|
1784
1556
|
initialize.service = defaultService;
|
|
1785
1557
|
return initialize;
|
|
@@ -1787,7 +1559,6 @@ function restClient() {
|
|
|
1787
1559
|
});
|
|
1788
1560
|
return result;
|
|
1789
1561
|
}
|
|
1790
|
-
|
|
1791
1562
|
module.exports = Object.assign(restClient, {
|
|
1792
1563
|
SuperagentClient: SuperagentClient,
|
|
1793
1564
|
FetchClient: FetchClient,
|
|
@@ -1808,81 +1579,60 @@ module.exports["default"] = restClient;
|
|
|
1808
1579
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
1809
1580
|
|
|
1810
1581
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1811
|
-
|
|
1812
1582
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
1813
|
-
|
|
1814
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
1815
|
-
|
|
1583
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
1816
1584
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
1817
|
-
|
|
1585
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
1586
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
1818
1587
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
1819
|
-
|
|
1820
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
1821
|
-
|
|
1588
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
1822
1589
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
1823
|
-
|
|
1824
1590
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
1825
|
-
|
|
1826
1591
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
1827
|
-
|
|
1828
1592
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
1829
|
-
|
|
1830
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
1831
|
-
|
|
1593
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
1832
1594
|
var Base = __webpack_require__(/*! ./base */ "../rest-client/lib/base.js");
|
|
1833
|
-
|
|
1834
1595
|
var JQueryService = /*#__PURE__*/function (_Base) {
|
|
1835
1596
|
_inherits(JQueryService, _Base);
|
|
1836
|
-
|
|
1837
1597
|
var _super = _createSuper(JQueryService);
|
|
1838
|
-
|
|
1839
1598
|
function JQueryService() {
|
|
1840
1599
|
_classCallCheck(this, JQueryService);
|
|
1841
|
-
|
|
1842
1600
|
return _super.apply(this, arguments);
|
|
1843
1601
|
}
|
|
1844
|
-
|
|
1845
1602
|
_createClass(JQueryService, [{
|
|
1846
1603
|
key: "request",
|
|
1847
1604
|
value: function request(options, params) {
|
|
1848
1605
|
var _this = this;
|
|
1849
|
-
|
|
1850
1606
|
var _params$connection = params.connection,
|
|
1851
|
-
|
|
1607
|
+
connection = _params$connection === void 0 ? {} : _params$connection;
|
|
1852
1608
|
var headers = Object.assign({}, options.headers, this.options.headers, connection.headers);
|
|
1853
1609
|
var opts = Object.assign({
|
|
1854
1610
|
dataType: options.type || 'json'
|
|
1855
1611
|
}, connection, options, {
|
|
1856
1612
|
headers: headers
|
|
1857
1613
|
});
|
|
1858
|
-
|
|
1859
1614
|
if (options.body) {
|
|
1860
1615
|
opts.data = JSON.stringify(options.body);
|
|
1861
1616
|
opts.contentType = 'application/json';
|
|
1862
1617
|
}
|
|
1863
|
-
|
|
1864
1618
|
delete opts.type;
|
|
1865
1619
|
delete opts.body;
|
|
1866
1620
|
return new Promise(function (resolve, reject) {
|
|
1867
1621
|
_this.connection.ajax(opts).then(resolve, function (xhr) {
|
|
1868
1622
|
var error = xhr.responseText;
|
|
1869
|
-
|
|
1870
1623
|
try {
|
|
1871
1624
|
error = JSON.parse(error);
|
|
1872
1625
|
} catch (e) {
|
|
1873
1626
|
error = new Error(xhr.responseText);
|
|
1874
1627
|
}
|
|
1875
|
-
|
|
1876
1628
|
error.xhr = error.response = xhr;
|
|
1877
1629
|
reject(error);
|
|
1878
1630
|
});
|
|
1879
1631
|
});
|
|
1880
1632
|
}
|
|
1881
1633
|
}]);
|
|
1882
|
-
|
|
1883
1634
|
return JQueryService;
|
|
1884
1635
|
}(Base);
|
|
1885
|
-
|
|
1886
1636
|
module.exports = JQueryService;
|
|
1887
1637
|
|
|
1888
1638
|
/***/ }),
|
|
@@ -1894,50 +1644,34 @@ module.exports = JQueryService;
|
|
|
1894
1644
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
1895
1645
|
|
|
1896
1646
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1897
|
-
|
|
1898
1647
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
1899
|
-
|
|
1900
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
1901
|
-
|
|
1648
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
1902
1649
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
1903
|
-
|
|
1650
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
1651
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
1904
1652
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
1905
|
-
|
|
1906
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
1907
|
-
|
|
1653
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
1908
1654
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
1909
|
-
|
|
1910
1655
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
1911
|
-
|
|
1912
1656
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
1913
|
-
|
|
1914
1657
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
1915
|
-
|
|
1916
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
1917
|
-
|
|
1658
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
1918
1659
|
var Base = __webpack_require__(/*! ./base */ "../rest-client/lib/base.js");
|
|
1919
|
-
|
|
1920
1660
|
var RequestService = /*#__PURE__*/function (_Base) {
|
|
1921
1661
|
_inherits(RequestService, _Base);
|
|
1922
|
-
|
|
1923
1662
|
var _super = _createSuper(RequestService);
|
|
1924
|
-
|
|
1925
1663
|
function RequestService() {
|
|
1926
1664
|
_classCallCheck(this, RequestService);
|
|
1927
|
-
|
|
1928
1665
|
return _super.apply(this, arguments);
|
|
1929
1666
|
}
|
|
1930
|
-
|
|
1931
1667
|
_createClass(RequestService, [{
|
|
1932
1668
|
key: "request",
|
|
1933
1669
|
value: function request(options, params) {
|
|
1934
1670
|
var _this = this;
|
|
1935
|
-
|
|
1936
1671
|
return new Promise(function (resolve, reject) {
|
|
1937
1672
|
var _params$connection = params.connection,
|
|
1938
|
-
|
|
1673
|
+
connection = _params$connection === void 0 ? {} : _params$connection;
|
|
1939
1674
|
var headers = Object.assign({}, options.headers, connection.headers);
|
|
1940
|
-
|
|
1941
1675
|
_this.connection(Object.assign({
|
|
1942
1676
|
json: true
|
|
1943
1677
|
}, options, params.connection, {
|
|
@@ -1946,25 +1680,20 @@ var RequestService = /*#__PURE__*/function (_Base) {
|
|
|
1946
1680
|
if (error) {
|
|
1947
1681
|
return reject(error);
|
|
1948
1682
|
}
|
|
1949
|
-
|
|
1950
1683
|
if (!error && res.statusCode >= 400) {
|
|
1951
1684
|
if (typeof data === 'string') {
|
|
1952
1685
|
return reject(new Error(data));
|
|
1953
1686
|
}
|
|
1954
|
-
|
|
1955
1687
|
data.response = res;
|
|
1956
1688
|
return reject(Object.assign(new Error(data.message), data));
|
|
1957
1689
|
}
|
|
1958
|
-
|
|
1959
1690
|
resolve(data);
|
|
1960
1691
|
});
|
|
1961
1692
|
});
|
|
1962
1693
|
}
|
|
1963
1694
|
}]);
|
|
1964
|
-
|
|
1965
1695
|
return RequestService;
|
|
1966
1696
|
}(Base);
|
|
1967
|
-
|
|
1968
1697
|
module.exports = RequestService;
|
|
1969
1698
|
|
|
1970
1699
|
/***/ }),
|
|
@@ -1976,51 +1705,35 @@ module.exports = RequestService;
|
|
|
1976
1705
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
1977
1706
|
|
|
1978
1707
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1979
|
-
|
|
1980
1708
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
1981
|
-
|
|
1982
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
1983
|
-
|
|
1709
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
1984
1710
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
1985
|
-
|
|
1711
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
1712
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
1986
1713
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
1987
|
-
|
|
1988
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
1989
|
-
|
|
1714
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
1990
1715
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
1991
|
-
|
|
1992
1716
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
1993
|
-
|
|
1994
1717
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
1995
|
-
|
|
1996
1718
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
1997
|
-
|
|
1998
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
1999
|
-
|
|
1719
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
2000
1720
|
var Base = __webpack_require__(/*! ./base */ "../rest-client/lib/base.js");
|
|
2001
|
-
|
|
2002
1721
|
var SuperagentService = /*#__PURE__*/function (_Base) {
|
|
2003
1722
|
_inherits(SuperagentService, _Base);
|
|
2004
|
-
|
|
2005
1723
|
var _super = _createSuper(SuperagentService);
|
|
2006
|
-
|
|
2007
1724
|
function SuperagentService() {
|
|
2008
1725
|
_classCallCheck(this, SuperagentService);
|
|
2009
|
-
|
|
2010
1726
|
return _super.apply(this, arguments);
|
|
2011
1727
|
}
|
|
2012
|
-
|
|
2013
1728
|
_createClass(SuperagentService, [{
|
|
2014
1729
|
key: "request",
|
|
2015
1730
|
value: function request(options, params) {
|
|
2016
1731
|
var superagent = this.connection(options.method, options.url).set(this.options.headers || {}).set('Accept', 'application/json').set(params.connection || {}).set(options.headers || {}).type(options.type || 'json');
|
|
2017
1732
|
return new Promise(function (resolve, reject) {
|
|
2018
1733
|
superagent.set(options.headers);
|
|
2019
|
-
|
|
2020
1734
|
if (options.body) {
|
|
2021
1735
|
superagent.send(options.body);
|
|
2022
1736
|
}
|
|
2023
|
-
|
|
2024
1737
|
superagent.end(function (error, res) {
|
|
2025
1738
|
if (error) {
|
|
2026
1739
|
try {
|
|
@@ -2028,19 +1741,15 @@ var SuperagentService = /*#__PURE__*/function (_Base) {
|
|
|
2028
1741
|
error = JSON.parse(error.response.text);
|
|
2029
1742
|
error.response = response;
|
|
2030
1743
|
} catch (e) {}
|
|
2031
|
-
|
|
2032
1744
|
return reject(error);
|
|
2033
1745
|
}
|
|
2034
|
-
|
|
2035
1746
|
resolve(res && res.body);
|
|
2036
1747
|
});
|
|
2037
1748
|
});
|
|
2038
1749
|
}
|
|
2039
1750
|
}]);
|
|
2040
|
-
|
|
2041
1751
|
return SuperagentService;
|
|
2042
1752
|
}(Base);
|
|
2043
|
-
|
|
2044
1753
|
module.exports = SuperagentService;
|
|
2045
1754
|
|
|
2046
1755
|
/***/ }),
|
|
@@ -2260,18 +1969,23 @@ var ThrowTypeError = $gOPD
|
|
|
2260
1969
|
: throwTypeError;
|
|
2261
1970
|
|
|
2262
1971
|
var hasSymbols = __webpack_require__(/*! has-symbols */ "../../node_modules/has-symbols/index.js")();
|
|
1972
|
+
var hasProto = __webpack_require__(/*! has-proto */ "../../node_modules/has-proto/index.js")();
|
|
2263
1973
|
|
|
2264
|
-
var getProto = Object.getPrototypeOf ||
|
|
1974
|
+
var getProto = Object.getPrototypeOf || (
|
|
1975
|
+
hasProto
|
|
1976
|
+
? function (x) { return x.__proto__; } // eslint-disable-line no-proto
|
|
1977
|
+
: null
|
|
1978
|
+
);
|
|
2265
1979
|
|
|
2266
1980
|
var needsEval = {};
|
|
2267
1981
|
|
|
2268
|
-
var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);
|
|
1982
|
+
var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);
|
|
2269
1983
|
|
|
2270
1984
|
var INTRINSICS = {
|
|
2271
1985
|
'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
|
|
2272
1986
|
'%Array%': Array,
|
|
2273
1987
|
'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
|
|
2274
|
-
'%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,
|
|
1988
|
+
'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,
|
|
2275
1989
|
'%AsyncFromSyncIteratorPrototype%': undefined,
|
|
2276
1990
|
'%AsyncFunction%': needsEval,
|
|
2277
1991
|
'%AsyncGenerator%': needsEval,
|
|
@@ -2279,6 +1993,8 @@ var INTRINSICS = {
|
|
|
2279
1993
|
'%AsyncIteratorPrototype%': needsEval,
|
|
2280
1994
|
'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
|
|
2281
1995
|
'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,
|
|
1996
|
+
'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,
|
|
1997
|
+
'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,
|
|
2282
1998
|
'%Boolean%': Boolean,
|
|
2283
1999
|
'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
|
|
2284
2000
|
'%Date%': Date,
|
|
@@ -2299,10 +2015,10 @@ var INTRINSICS = {
|
|
|
2299
2015
|
'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
|
|
2300
2016
|
'%isFinite%': isFinite,
|
|
2301
2017
|
'%isNaN%': isNaN,
|
|
2302
|
-
'%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,
|
|
2018
|
+
'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,
|
|
2303
2019
|
'%JSON%': typeof JSON === 'object' ? JSON : undefined,
|
|
2304
2020
|
'%Map%': typeof Map === 'undefined' ? undefined : Map,
|
|
2305
|
-
'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),
|
|
2021
|
+
'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),
|
|
2306
2022
|
'%Math%': Math,
|
|
2307
2023
|
'%Number%': Number,
|
|
2308
2024
|
'%Object%': Object,
|
|
@@ -2315,10 +2031,10 @@ var INTRINSICS = {
|
|
|
2315
2031
|
'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
|
|
2316
2032
|
'%RegExp%': RegExp,
|
|
2317
2033
|
'%Set%': typeof Set === 'undefined' ? undefined : Set,
|
|
2318
|
-
'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),
|
|
2034
|
+
'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),
|
|
2319
2035
|
'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
|
|
2320
2036
|
'%String%': String,
|
|
2321
|
-
'%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,
|
|
2037
|
+
'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,
|
|
2322
2038
|
'%Symbol%': hasSymbols ? Symbol : undefined,
|
|
2323
2039
|
'%SyntaxError%': $SyntaxError,
|
|
2324
2040
|
'%ThrowTypeError%': ThrowTypeError,
|
|
@@ -2334,6 +2050,16 @@ var INTRINSICS = {
|
|
|
2334
2050
|
'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet
|
|
2335
2051
|
};
|
|
2336
2052
|
|
|
2053
|
+
if (getProto) {
|
|
2054
|
+
try {
|
|
2055
|
+
null.error; // eslint-disable-line no-unused-expressions
|
|
2056
|
+
} catch (e) {
|
|
2057
|
+
// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
|
|
2058
|
+
var errorProto = getProto(getProto(e));
|
|
2059
|
+
INTRINSICS['%Error.prototype%'] = errorProto;
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
|
|
2337
2063
|
var doEval = function doEval(name) {
|
|
2338
2064
|
var value;
|
|
2339
2065
|
if (name === '%AsyncFunction%') {
|
|
@@ -2349,7 +2075,7 @@ var doEval = function doEval(name) {
|
|
|
2349
2075
|
}
|
|
2350
2076
|
} else if (name === '%AsyncIteratorPrototype%') {
|
|
2351
2077
|
var gen = doEval('%AsyncGenerator%');
|
|
2352
|
-
if (gen) {
|
|
2078
|
+
if (gen && getProto) {
|
|
2353
2079
|
value = getProto(gen.prototype);
|
|
2354
2080
|
}
|
|
2355
2081
|
}
|
|
@@ -2419,6 +2145,7 @@ var $concat = bind.call(Function.call, Array.prototype.concat);
|
|
|
2419
2145
|
var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
|
|
2420
2146
|
var $replace = bind.call(Function.call, String.prototype.replace);
|
|
2421
2147
|
var $strSlice = bind.call(Function.call, String.prototype.slice);
|
|
2148
|
+
var $exec = bind.call(Function.call, RegExp.prototype.exec);
|
|
2422
2149
|
|
|
2423
2150
|
/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
|
|
2424
2151
|
var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
|
|
@@ -2474,6 +2201,9 @@ module.exports = function GetIntrinsic(name, allowMissing) {
|
|
|
2474
2201
|
throw new $TypeError('"allowMissing" argument must be a boolean');
|
|
2475
2202
|
}
|
|
2476
2203
|
|
|
2204
|
+
if ($exec(/^%?[^%]*%?$/, name) === null) {
|
|
2205
|
+
throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
|
|
2206
|
+
}
|
|
2477
2207
|
var parts = stringToPath(name);
|
|
2478
2208
|
var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
|
|
2479
2209
|
|
|
@@ -2547,6 +2277,28 @@ module.exports = function GetIntrinsic(name, allowMissing) {
|
|
|
2547
2277
|
};
|
|
2548
2278
|
|
|
2549
2279
|
|
|
2280
|
+
/***/ }),
|
|
2281
|
+
|
|
2282
|
+
/***/ "../../node_modules/has-proto/index.js":
|
|
2283
|
+
/*!*********************************************!*\
|
|
2284
|
+
!*** ../../node_modules/has-proto/index.js ***!
|
|
2285
|
+
\*********************************************/
|
|
2286
|
+
/***/ (function(module) {
|
|
2287
|
+
|
|
2288
|
+
"use strict";
|
|
2289
|
+
|
|
2290
|
+
|
|
2291
|
+
var test = {
|
|
2292
|
+
foo: {}
|
|
2293
|
+
};
|
|
2294
|
+
|
|
2295
|
+
var $Object = Object;
|
|
2296
|
+
|
|
2297
|
+
module.exports = function hasProto() {
|
|
2298
|
+
return { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);
|
|
2299
|
+
};
|
|
2300
|
+
|
|
2301
|
+
|
|
2550
2302
|
/***/ }),
|
|
2551
2303
|
|
|
2552
2304
|
/***/ "../../node_modules/has-symbols/index.js":
|
|
@@ -2887,8 +2639,9 @@ function addNumericSeparator(num, str) {
|
|
|
2887
2639
|
return $replace.call(str, sepRegex, '$&_');
|
|
2888
2640
|
}
|
|
2889
2641
|
|
|
2890
|
-
var
|
|
2891
|
-
var
|
|
2642
|
+
var utilInspect = __webpack_require__(/*! ./util.inspect */ "?c95a");
|
|
2643
|
+
var inspectCustom = utilInspect.custom;
|
|
2644
|
+
var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
|
|
2892
2645
|
|
|
2893
2646
|
module.exports = function inspect_(obj, options, depth, seen) {
|
|
2894
2647
|
var opts = options || {};
|
|
@@ -2978,7 +2731,7 @@ module.exports = function inspect_(obj, options, depth, seen) {
|
|
|
2978
2731
|
return inspect_(value, opts, depth + 1, seen);
|
|
2979
2732
|
}
|
|
2980
2733
|
|
|
2981
|
-
if (typeof obj === 'function') {
|
|
2734
|
+
if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable
|
|
2982
2735
|
var name = nameOf(obj);
|
|
2983
2736
|
var keys = arrObjKeys(obj, inspect);
|
|
2984
2737
|
return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
|
|
@@ -3008,31 +2761,35 @@ module.exports = function inspect_(obj, options, depth, seen) {
|
|
|
3008
2761
|
}
|
|
3009
2762
|
if (isError(obj)) {
|
|
3010
2763
|
var parts = arrObjKeys(obj, inspect);
|
|
3011
|
-
if ('cause' in obj && !isEnumerable.call(obj, 'cause')) {
|
|
2764
|
+
if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
|
|
3012
2765
|
return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
|
|
3013
2766
|
}
|
|
3014
2767
|
if (parts.length === 0) { return '[' + String(obj) + ']'; }
|
|
3015
2768
|
return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
|
|
3016
2769
|
}
|
|
3017
2770
|
if (typeof obj === 'object' && customInspect) {
|
|
3018
|
-
if (inspectSymbol && typeof obj[inspectSymbol] === 'function') {
|
|
3019
|
-
return obj
|
|
2771
|
+
if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
|
|
2772
|
+
return utilInspect(obj, { depth: maxDepth - depth });
|
|
3020
2773
|
} else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
|
|
3021
2774
|
return obj.inspect();
|
|
3022
2775
|
}
|
|
3023
2776
|
}
|
|
3024
2777
|
if (isMap(obj)) {
|
|
3025
2778
|
var mapParts = [];
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
2779
|
+
if (mapForEach) {
|
|
2780
|
+
mapForEach.call(obj, function (value, key) {
|
|
2781
|
+
mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
|
|
2782
|
+
});
|
|
2783
|
+
}
|
|
3029
2784
|
return collectionOf('Map', mapSize.call(obj), mapParts, indent);
|
|
3030
2785
|
}
|
|
3031
2786
|
if (isSet(obj)) {
|
|
3032
2787
|
var setParts = [];
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
2788
|
+
if (setForEach) {
|
|
2789
|
+
setForEach.call(obj, function (value) {
|
|
2790
|
+
setParts.push(inspect(value, obj));
|
|
2791
|
+
});
|
|
2792
|
+
}
|
|
3036
2793
|
return collectionOf('Set', setSize.call(obj), setParts, indent);
|
|
3037
2794
|
}
|
|
3038
2795
|
if (isWeakMap(obj)) {
|
|
@@ -3449,7 +3206,8 @@ var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')
|
|
|
3449
3206
|
var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
|
|
3450
3207
|
|
|
3451
3208
|
var parseValues = function parseQueryStringValues(str, options) {
|
|
3452
|
-
var obj = {};
|
|
3209
|
+
var obj = { __proto__: null };
|
|
3210
|
+
|
|
3453
3211
|
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
|
|
3454
3212
|
var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
|
|
3455
3213
|
var parts = cleanStr.split(options.delimiter, limit);
|
|
@@ -3693,7 +3451,6 @@ var arrayPrefixGenerators = {
|
|
|
3693
3451
|
};
|
|
3694
3452
|
|
|
3695
3453
|
var isArray = Array.isArray;
|
|
3696
|
-
var split = String.prototype.split;
|
|
3697
3454
|
var push = Array.prototype.push;
|
|
3698
3455
|
var pushToArray = function (arr, valueOrArray) {
|
|
3699
3456
|
push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
|
|
@@ -3736,6 +3493,7 @@ var stringify = function stringify(
|
|
|
3736
3493
|
object,
|
|
3737
3494
|
prefix,
|
|
3738
3495
|
generateArrayPrefix,
|
|
3496
|
+
commaRoundTrip,
|
|
3739
3497
|
strictNullHandling,
|
|
3740
3498
|
skipNulls,
|
|
3741
3499
|
encoder,
|
|
@@ -3794,14 +3552,6 @@ var stringify = function stringify(
|
|
|
3794
3552
|
if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
|
|
3795
3553
|
if (encoder) {
|
|
3796
3554
|
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);
|
|
3797
|
-
if (generateArrayPrefix === 'comma' && encodeValuesOnly) {
|
|
3798
|
-
var valuesArray = split.call(String(obj), ',');
|
|
3799
|
-
var valuesJoined = '';
|
|
3800
|
-
for (var i = 0; i < valuesArray.length; ++i) {
|
|
3801
|
-
valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults.encoder, charset, 'value', format));
|
|
3802
|
-
}
|
|
3803
|
-
return [formatter(keyValue) + '=' + valuesJoined];
|
|
3804
|
-
}
|
|
3805
3555
|
return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];
|
|
3806
3556
|
}
|
|
3807
3557
|
return [formatter(prefix) + '=' + formatter(String(obj))];
|
|
@@ -3816,6 +3566,9 @@ var stringify = function stringify(
|
|
|
3816
3566
|
var objKeys;
|
|
3817
3567
|
if (generateArrayPrefix === 'comma' && isArray(obj)) {
|
|
3818
3568
|
// we need to join elements in
|
|
3569
|
+
if (encodeValuesOnly && encoder) {
|
|
3570
|
+
obj = utils.maybeMap(obj, encoder);
|
|
3571
|
+
}
|
|
3819
3572
|
objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
|
|
3820
3573
|
} else if (isArray(filter)) {
|
|
3821
3574
|
objKeys = filter;
|
|
@@ -3824,6 +3577,8 @@ var stringify = function stringify(
|
|
|
3824
3577
|
objKeys = sort ? keys.sort(sort) : keys;
|
|
3825
3578
|
}
|
|
3826
3579
|
|
|
3580
|
+
var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? prefix + '[]' : prefix;
|
|
3581
|
+
|
|
3827
3582
|
for (var j = 0; j < objKeys.length; ++j) {
|
|
3828
3583
|
var key = objKeys[j];
|
|
3829
3584
|
var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
|
|
@@ -3833,8 +3588,8 @@ var stringify = function stringify(
|
|
|
3833
3588
|
}
|
|
3834
3589
|
|
|
3835
3590
|
var keyPrefix = isArray(obj)
|
|
3836
|
-
? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(
|
|
3837
|
-
:
|
|
3591
|
+
? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix
|
|
3592
|
+
: adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']');
|
|
3838
3593
|
|
|
3839
3594
|
sideChannel.set(object, step);
|
|
3840
3595
|
var valueSideChannel = getSideChannel();
|
|
@@ -3843,9 +3598,10 @@ var stringify = function stringify(
|
|
|
3843
3598
|
value,
|
|
3844
3599
|
keyPrefix,
|
|
3845
3600
|
generateArrayPrefix,
|
|
3601
|
+
commaRoundTrip,
|
|
3846
3602
|
strictNullHandling,
|
|
3847
3603
|
skipNulls,
|
|
3848
|
-
encoder,
|
|
3604
|
+
generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder,
|
|
3849
3605
|
filter,
|
|
3850
3606
|
sort,
|
|
3851
3607
|
allowDots,
|
|
@@ -3939,6 +3695,10 @@ module.exports = function (object, opts) {
|
|
|
3939
3695
|
}
|
|
3940
3696
|
|
|
3941
3697
|
var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
|
|
3698
|
+
if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
|
|
3699
|
+
throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
|
|
3700
|
+
}
|
|
3701
|
+
var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
|
|
3942
3702
|
|
|
3943
3703
|
if (!objKeys) {
|
|
3944
3704
|
objKeys = Object.keys(obj);
|
|
@@ -3959,6 +3719,7 @@ module.exports = function (object, opts) {
|
|
|
3959
3719
|
obj[key],
|
|
3960
3720
|
key,
|
|
3961
3721
|
generateArrayPrefix,
|
|
3722
|
+
commaRoundTrip,
|
|
3962
3723
|
options.strictNullHandling,
|
|
3963
3724
|
options.skipNulls,
|
|
3964
3725
|
options.encode ? options.encoder : null,
|