@feathersjs/client 5.0.0-pre.0 → 5.0.0-pre.15

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.
Files changed (86) hide show
  1. package/CHANGELOG.md +229 -0
  2. package/README.md +2 -2
  3. package/dist/core.d.ts +1 -0
  4. package/dist/core.js +1861 -3627
  5. package/dist/core.js.map +1 -1
  6. package/dist/core.min.js +1 -1
  7. package/dist/feathers.d.ts +8 -0
  8. package/dist/feathers.js +5106 -5755
  9. package/dist/feathers.js.map +1 -1
  10. package/dist/feathers.min.js +1 -1
  11. package/package.json +44 -38
  12. package/src/core.ts +1 -0
  13. package/src/feathers.ts +13 -0
  14. package/.babelrc +0 -8
  15. package/.cache/lasso/default/6a3076a5/dependencyFingerprints/cache +0 -0
  16. package/.cache/lasso/default/6a3076a5/key +0 -1
  17. package/.cache/lasso/default/6a3076a5/lasso-require/inspect-/5d47a286cdceb98f64bf9128488dd355fde40e81/cache +0 -0
  18. package/.cache/lasso/default/7be4a25c/dependencyFingerprints/cache +0 -0
  19. package/.cache/lasso/default/7be4a25c/key +0 -1
  20. package/.cache/lasso/default/7be4a25c/lasso-require/inspect/cache +0 -0
  21. package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.0/lib/filter-query.js +0 -1998
  22. package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.0/lib/index.js +0 -694
  23. package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.0/lib/service.js +0 -1636
  24. package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.0/lib/sort.js +0 -2259
  25. package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.1/lib/filter-query.js +0 -98
  26. package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.1/lib/index.js +0 -37
  27. package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.1/lib/service.js +0 -94
  28. package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.1/lib/sort.js +0 -112
  29. package/.mocha-puppeteer/test-page/@feathersjs/client$4.5.0/browser/test-run.js +0 -1
  30. package/.mocha-puppeteer/test-page/@feathersjs/client$4.5.0/browser/test.js +0 -1037
  31. package/.mocha-puppeteer/test-page/@feathersjs/client$4.5.0/dist/feathers.js +0 -78377
  32. package/.mocha-puppeteer/test-page/@feathersjs/client$4.5.1/browser/test-run.js +0 -1
  33. package/.mocha-puppeteer/test-page/@feathersjs/client$4.5.1/browser/test.js +0 -102
  34. package/.mocha-puppeteer/test-page/@feathersjs/client$4.5.1/dist/feathers.js +0 -5231
  35. package/.mocha-puppeteer/test-page/@feathersjs/commons$4.5.0/lib/hooks.js +0 -2626
  36. package/.mocha-puppeteer/test-page/@feathersjs/commons$4.5.0/lib/index.js +0 -540
  37. package/.mocha-puppeteer/test-page/@feathersjs/commons$4.5.0/lib/utils.js +0 -1991
  38. package/.mocha-puppeteer/test-page/@feathersjs/commons$4.5.1/lib/hooks.js +0 -170
  39. package/.mocha-puppeteer/test-page/@feathersjs/commons$4.5.1/lib/index.js +0 -17
  40. package/.mocha-puppeteer/test-page/@feathersjs/commons$4.5.1/lib/utils.js +0 -102
  41. package/.mocha-puppeteer/test-page/@feathersjs/errors$4.5.0/lib/index.js +0 -2262
  42. package/.mocha-puppeteer/test-page/@feathersjs/errors$4.5.1/lib/index.js +0 -251
  43. package/.mocha-puppeteer/test-page/@feathersjs/tests$4.5.0/lib/client.js +0 -1506
  44. package/.mocha-puppeteer/test-page/@feathersjs/tests$4.5.1/lib/client.js +0 -83
  45. package/.mocha-puppeteer/test-page/assert$1.5.0/assert.js +0 -508
  46. package/.mocha-puppeteer/test-page/debug$4.1.1/src/browser.js +0 -266
  47. package/.mocha-puppeteer/test-page/debug$4.1.1/src/common.js +0 -268
  48. package/.mocha-puppeteer/test-page/feathers-memory$4.1.0/lib/index.js +0 -143
  49. package/.mocha-puppeteer/test-page/inherits$2.0.1/inherits_browser.js +0 -25
  50. package/.mocha-puppeteer/test-page/lasso-modules-client$2.0.5/src/index.js +0 -592
  51. package/.mocha-puppeteer/test-page/lasso-modules-meta.js +0 -28
  52. package/.mocha-puppeteer/test-page/marko$4.18.35/src/runtime/components/boot-run.js +0 -1
  53. package/.mocha-puppeteer/test-page/marko$4.18.35/src/runtime/components/boot.js +0 -95
  54. package/.mocha-puppeteer/test-page/marko$4.18.42/src/runtime/components/boot-run.js +0 -1
  55. package/.mocha-puppeteer/test-page/marko$4.18.42/src/runtime/components/boot.js +0 -95
  56. package/.mocha-puppeteer/test-page/marko$4.19.0/src/runtime/components/boot-run.js +0 -1
  57. package/.mocha-puppeteer/test-page/marko$4.19.0/src/runtime/components/boot.js +0 -3
  58. package/.mocha-puppeteer/test-page/mocha$3.5.3/mocha.css +0 -326
  59. package/.mocha-puppeteer/test-page/mocha$3.5.3/mocha.js +0 -16590
  60. package/.mocha-puppeteer/test-page/mocha-puppeteer$0.14.0/lib/pages/test-page/run-tests-run.js +0 -1
  61. package/.mocha-puppeteer/test-page/mocha-puppeteer$0.14.0/lib/pages/test-page/run-tests.js +0 -53
  62. package/.mocha-puppeteer/test-page/mocha-puppeteer$0.14.0/lib/pages/test-page/setup-run.js +0 -1
  63. package/.mocha-puppeteer/test-page/mocha-puppeteer$0.14.0/lib/pages/test-page/setup.js +0 -10
  64. package/.mocha-puppeteer/test-page/ms$2.1.2/index.js +0 -164
  65. package/.mocha-puppeteer/test-page/object-assign$4.1.1/index.js +0 -92
  66. package/.mocha-puppeteer/test-page/process$0.11.10/browser.js +0 -186
  67. package/.mocha-puppeteer/test-page/sift$8.5.1/lib/index.js +0 -738
  68. package/.mocha-puppeteer/test-page/superagent$3.8.3/superagent.js +0 -2035
  69. package/.mocha-puppeteer/test-page/util$0.10.3/support/isBufferBrowser.js +0 -7
  70. package/.mocha-puppeteer/test-page/util$0.10.3/util.js +0 -588
  71. package/.nyc_output/coverage.json +0 -1
  72. package/authentication.js +0 -1
  73. package/dist/authentication.js +0 -2242
  74. package/dist/authentication.js.map +0 -1
  75. package/dist/authentication.min.js +0 -1
  76. package/dist/rest.js +0 -3287
  77. package/dist/rest.js.map +0 -1
  78. package/dist/rest.min.js +0 -1
  79. package/dist/socketio.js +0 -2384
  80. package/dist/socketio.js.map +0 -1
  81. package/dist/socketio.min.js +0 -1
  82. package/index.d.ts +0 -23
  83. package/index.js +0 -1
  84. package/rest.js +0 -1
  85. package/socketio.js +0 -1
  86. package/webpack.config.js +0 -69
package/dist/rest.js DELETED
@@ -1,3287 +0,0 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory();
4
- else if(typeof define === 'function' && define.amd)
5
- define([], factory);
6
- else if(typeof exports === 'object')
7
- exports["feathers"] = factory();
8
- else
9
- root["feathers"] = factory();
10
- })(this, function() {
11
- return /******/ (function(modules) { // webpackBootstrap
12
- /******/ // The module cache
13
- /******/ var installedModules = {};
14
- /******/
15
- /******/ // The require function
16
- /******/ function __webpack_require__(moduleId) {
17
- /******/
18
- /******/ // Check if module is in cache
19
- /******/ if(installedModules[moduleId]) {
20
- /******/ return installedModules[moduleId].exports;
21
- /******/ }
22
- /******/ // Create a new module (and put it into the cache)
23
- /******/ var module = installedModules[moduleId] = {
24
- /******/ i: moduleId,
25
- /******/ l: false,
26
- /******/ exports: {}
27
- /******/ };
28
- /******/
29
- /******/ // Execute the module function
30
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31
- /******/
32
- /******/ // Flag the module as loaded
33
- /******/ module.l = true;
34
- /******/
35
- /******/ // Return the exports of the module
36
- /******/ return module.exports;
37
- /******/ }
38
- /******/
39
- /******/
40
- /******/ // expose the modules object (__webpack_modules__)
41
- /******/ __webpack_require__.m = modules;
42
- /******/
43
- /******/ // expose the module cache
44
- /******/ __webpack_require__.c = installedModules;
45
- /******/
46
- /******/ // define getter function for harmony exports
47
- /******/ __webpack_require__.d = function(exports, name, getter) {
48
- /******/ if(!__webpack_require__.o(exports, name)) {
49
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
50
- /******/ }
51
- /******/ };
52
- /******/
53
- /******/ // define __esModule on exports
54
- /******/ __webpack_require__.r = function(exports) {
55
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
56
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
57
- /******/ }
58
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
59
- /******/ };
60
- /******/
61
- /******/ // create a fake namespace object
62
- /******/ // mode & 1: value is a module id, require it
63
- /******/ // mode & 2: merge all properties of value into the ns
64
- /******/ // mode & 4: return value when already ns object
65
- /******/ // mode & 8|1: behave like require
66
- /******/ __webpack_require__.t = function(value, mode) {
67
- /******/ if(mode & 1) value = __webpack_require__(value);
68
- /******/ if(mode & 8) return value;
69
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
70
- /******/ var ns = Object.create(null);
71
- /******/ __webpack_require__.r(ns);
72
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
73
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
74
- /******/ return ns;
75
- /******/ };
76
- /******/
77
- /******/ // getDefaultExport function for compatibility with non-harmony modules
78
- /******/ __webpack_require__.n = function(module) {
79
- /******/ var getter = module && module.__esModule ?
80
- /******/ function getDefault() { return module['default']; } :
81
- /******/ function getModuleExports() { return module; };
82
- /******/ __webpack_require__.d(getter, 'a', getter);
83
- /******/ return getter;
84
- /******/ };
85
- /******/
86
- /******/ // Object.prototype.hasOwnProperty.call
87
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
88
- /******/
89
- /******/ // __webpack_public_path__
90
- /******/ __webpack_require__.p = "";
91
- /******/
92
- /******/
93
- /******/ // Load entry module and return exports
94
- /******/ return __webpack_require__(__webpack_require__.s = 0);
95
- /******/ })
96
- /************************************************************************/
97
- /******/ ({
98
-
99
- /***/ "../../node_modules/process/browser.js":
100
- /*!************************************************************************************!*\
101
- !*** /Users/daffl/Development/feathersjs/feathers/node_modules/process/browser.js ***!
102
- \************************************************************************************/
103
- /*! no static exports found */
104
- /***/ (function(module, exports) {
105
-
106
- // shim for using process in browser
107
- var process = module.exports = {};
108
-
109
- // cached from whatever global is present so that test runners that stub it
110
- // don't break things. But we need to wrap it in a try catch in case it is
111
- // wrapped in strict mode code which doesn't define any globals. It's inside a
112
- // function because try/catches deoptimize in certain engines.
113
-
114
- var cachedSetTimeout;
115
- var cachedClearTimeout;
116
-
117
- function defaultSetTimout() {
118
- throw new Error('setTimeout has not been defined');
119
- }
120
- function defaultClearTimeout () {
121
- throw new Error('clearTimeout has not been defined');
122
- }
123
- (function () {
124
- try {
125
- if (typeof setTimeout === 'function') {
126
- cachedSetTimeout = setTimeout;
127
- } else {
128
- cachedSetTimeout = defaultSetTimout;
129
- }
130
- } catch (e) {
131
- cachedSetTimeout = defaultSetTimout;
132
- }
133
- try {
134
- if (typeof clearTimeout === 'function') {
135
- cachedClearTimeout = clearTimeout;
136
- } else {
137
- cachedClearTimeout = defaultClearTimeout;
138
- }
139
- } catch (e) {
140
- cachedClearTimeout = defaultClearTimeout;
141
- }
142
- } ())
143
- function runTimeout(fun) {
144
- if (cachedSetTimeout === setTimeout) {
145
- //normal enviroments in sane situations
146
- return setTimeout(fun, 0);
147
- }
148
- // if setTimeout wasn't available but was latter defined
149
- if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
150
- cachedSetTimeout = setTimeout;
151
- return setTimeout(fun, 0);
152
- }
153
- try {
154
- // when when somebody has screwed with setTimeout but no I.E. maddness
155
- return cachedSetTimeout(fun, 0);
156
- } catch(e){
157
- try {
158
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
159
- return cachedSetTimeout.call(null, fun, 0);
160
- } catch(e){
161
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
162
- return cachedSetTimeout.call(this, fun, 0);
163
- }
164
- }
165
-
166
-
167
- }
168
- function runClearTimeout(marker) {
169
- if (cachedClearTimeout === clearTimeout) {
170
- //normal enviroments in sane situations
171
- return clearTimeout(marker);
172
- }
173
- // if clearTimeout wasn't available but was latter defined
174
- if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
175
- cachedClearTimeout = clearTimeout;
176
- return clearTimeout(marker);
177
- }
178
- try {
179
- // when when somebody has screwed with setTimeout but no I.E. maddness
180
- return cachedClearTimeout(marker);
181
- } catch (e){
182
- try {
183
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
184
- return cachedClearTimeout.call(null, marker);
185
- } catch (e){
186
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
187
- // Some versions of I.E. have different rules for clearTimeout vs setTimeout
188
- return cachedClearTimeout.call(this, marker);
189
- }
190
- }
191
-
192
-
193
-
194
- }
195
- var queue = [];
196
- var draining = false;
197
- var currentQueue;
198
- var queueIndex = -1;
199
-
200
- function cleanUpNextTick() {
201
- if (!draining || !currentQueue) {
202
- return;
203
- }
204
- draining = false;
205
- if (currentQueue.length) {
206
- queue = currentQueue.concat(queue);
207
- } else {
208
- queueIndex = -1;
209
- }
210
- if (queue.length) {
211
- drainQueue();
212
- }
213
- }
214
-
215
- function drainQueue() {
216
- if (draining) {
217
- return;
218
- }
219
- var timeout = runTimeout(cleanUpNextTick);
220
- draining = true;
221
-
222
- var len = queue.length;
223
- while(len) {
224
- currentQueue = queue;
225
- queue = [];
226
- while (++queueIndex < len) {
227
- if (currentQueue) {
228
- currentQueue[queueIndex].run();
229
- }
230
- }
231
- queueIndex = -1;
232
- len = queue.length;
233
- }
234
- currentQueue = null;
235
- draining = false;
236
- runClearTimeout(timeout);
237
- }
238
-
239
- process.nextTick = function (fun) {
240
- var args = new Array(arguments.length - 1);
241
- if (arguments.length > 1) {
242
- for (var i = 1; i < arguments.length; i++) {
243
- args[i - 1] = arguments[i];
244
- }
245
- }
246
- queue.push(new Item(fun, args));
247
- if (queue.length === 1 && !draining) {
248
- runTimeout(drainQueue);
249
- }
250
- };
251
-
252
- // v8 likes predictible objects
253
- function Item(fun, array) {
254
- this.fun = fun;
255
- this.array = array;
256
- }
257
- Item.prototype.run = function () {
258
- this.fun.apply(null, this.array);
259
- };
260
- process.title = 'browser';
261
- process.browser = true;
262
- process.env = {};
263
- process.argv = [];
264
- process.version = ''; // empty string to avoid regexp issues
265
- process.versions = {};
266
-
267
- function noop() {}
268
-
269
- process.on = noop;
270
- process.addListener = noop;
271
- process.once = noop;
272
- process.off = noop;
273
- process.removeListener = noop;
274
- process.removeAllListeners = noop;
275
- process.emit = noop;
276
- process.prependListener = noop;
277
- process.prependOnceListener = noop;
278
-
279
- process.listeners = function (name) { return [] }
280
-
281
- process.binding = function (name) {
282
- throw new Error('process.binding is not supported');
283
- };
284
-
285
- process.cwd = function () { return '/' };
286
- process.chdir = function (dir) {
287
- throw new Error('process.chdir is not supported');
288
- };
289
- process.umask = function() { return 0; };
290
-
291
-
292
- /***/ }),
293
-
294
- /***/ "../../node_modules/qs/lib/formats.js":
295
- /*!***********************************************************************************!*\
296
- !*** /Users/daffl/Development/feathersjs/feathers/node_modules/qs/lib/formats.js ***!
297
- \***********************************************************************************/
298
- /*! no static exports found */
299
- /***/ (function(module, exports, __webpack_require__) {
300
-
301
- "use strict";
302
-
303
-
304
- var replace = String.prototype.replace;
305
- var percentTwenties = /%20/g;
306
-
307
- var util = __webpack_require__(/*! ./utils */ "../../node_modules/qs/lib/utils.js");
308
-
309
- var Format = {
310
- RFC1738: 'RFC1738',
311
- RFC3986: 'RFC3986'
312
- };
313
-
314
- module.exports = util.assign(
315
- {
316
- 'default': Format.RFC3986,
317
- formatters: {
318
- RFC1738: function (value) {
319
- return replace.call(value, percentTwenties, '+');
320
- },
321
- RFC3986: function (value) {
322
- return String(value);
323
- }
324
- }
325
- },
326
- Format
327
- );
328
-
329
-
330
- /***/ }),
331
-
332
- /***/ "../../node_modules/qs/lib/index.js":
333
- /*!*********************************************************************************!*\
334
- !*** /Users/daffl/Development/feathersjs/feathers/node_modules/qs/lib/index.js ***!
335
- \*********************************************************************************/
336
- /*! no static exports found */
337
- /***/ (function(module, exports, __webpack_require__) {
338
-
339
- "use strict";
340
-
341
-
342
- var stringify = __webpack_require__(/*! ./stringify */ "../../node_modules/qs/lib/stringify.js");
343
- var parse = __webpack_require__(/*! ./parse */ "../../node_modules/qs/lib/parse.js");
344
- var formats = __webpack_require__(/*! ./formats */ "../../node_modules/qs/lib/formats.js");
345
-
346
- module.exports = {
347
- formats: formats,
348
- parse: parse,
349
- stringify: stringify
350
- };
351
-
352
-
353
- /***/ }),
354
-
355
- /***/ "../../node_modules/qs/lib/parse.js":
356
- /*!*********************************************************************************!*\
357
- !*** /Users/daffl/Development/feathersjs/feathers/node_modules/qs/lib/parse.js ***!
358
- \*********************************************************************************/
359
- /*! no static exports found */
360
- /***/ (function(module, exports, __webpack_require__) {
361
-
362
- "use strict";
363
-
364
-
365
- var utils = __webpack_require__(/*! ./utils */ "../../node_modules/qs/lib/utils.js");
366
-
367
- var has = Object.prototype.hasOwnProperty;
368
- var isArray = Array.isArray;
369
-
370
- var defaults = {
371
- allowDots: false,
372
- allowPrototypes: false,
373
- arrayLimit: 20,
374
- charset: 'utf-8',
375
- charsetSentinel: false,
376
- comma: false,
377
- decoder: utils.decode,
378
- delimiter: '&',
379
- depth: 5,
380
- ignoreQueryPrefix: false,
381
- interpretNumericEntities: false,
382
- parameterLimit: 1000,
383
- parseArrays: true,
384
- plainObjects: false,
385
- strictNullHandling: false
386
- };
387
-
388
- var interpretNumericEntities = function (str) {
389
- return str.replace(/&#(\d+);/g, function ($0, numberStr) {
390
- return String.fromCharCode(parseInt(numberStr, 10));
391
- });
392
- };
393
-
394
- var parseArrayValue = function (val, options) {
395
- if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
396
- return val.split(',');
397
- }
398
-
399
- return val;
400
- };
401
-
402
- // This is what browsers will submit when the ✓ character occurs in an
403
- // application/x-www-form-urlencoded body and the encoding of the page containing
404
- // the form is iso-8859-1, or when the submitted form has an accept-charset
405
- // attribute of iso-8859-1. Presumably also with other charsets that do not contain
406
- // the ✓ character, such as us-ascii.
407
- var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
408
-
409
- // These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
410
- var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
411
-
412
- var parseValues = function parseQueryStringValues(str, options) {
413
- var obj = {};
414
- var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
415
- var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
416
- var parts = cleanStr.split(options.delimiter, limit);
417
- var skipIndex = -1; // Keep track of where the utf8 sentinel was found
418
- var i;
419
-
420
- var charset = options.charset;
421
- if (options.charsetSentinel) {
422
- for (i = 0; i < parts.length; ++i) {
423
- if (parts[i].indexOf('utf8=') === 0) {
424
- if (parts[i] === charsetSentinel) {
425
- charset = 'utf-8';
426
- } else if (parts[i] === isoSentinel) {
427
- charset = 'iso-8859-1';
428
- }
429
- skipIndex = i;
430
- i = parts.length; // The eslint settings do not allow break;
431
- }
432
- }
433
- }
434
-
435
- for (i = 0; i < parts.length; ++i) {
436
- if (i === skipIndex) {
437
- continue;
438
- }
439
- var part = parts[i];
440
-
441
- var bracketEqualsPos = part.indexOf(']=');
442
- var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
443
-
444
- var key, val;
445
- if (pos === -1) {
446
- key = options.decoder(part, defaults.decoder, charset, 'key');
447
- val = options.strictNullHandling ? null : '';
448
- } else {
449
- key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
450
- val = utils.maybeMap(
451
- parseArrayValue(part.slice(pos + 1), options),
452
- function (encodedVal) {
453
- return options.decoder(encodedVal, defaults.decoder, charset, 'value');
454
- }
455
- );
456
- }
457
-
458
- if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
459
- val = interpretNumericEntities(val);
460
- }
461
-
462
- if (part.indexOf('[]=') > -1) {
463
- val = isArray(val) ? [val] : val;
464
- }
465
-
466
- if (has.call(obj, key)) {
467
- obj[key] = utils.combine(obj[key], val);
468
- } else {
469
- obj[key] = val;
470
- }
471
- }
472
-
473
- return obj;
474
- };
475
-
476
- var parseObject = function (chain, val, options, valuesParsed) {
477
- var leaf = valuesParsed ? val : parseArrayValue(val, options);
478
-
479
- for (var i = chain.length - 1; i >= 0; --i) {
480
- var obj;
481
- var root = chain[i];
482
-
483
- if (root === '[]' && options.parseArrays) {
484
- obj = [].concat(leaf);
485
- } else {
486
- obj = options.plainObjects ? Object.create(null) : {};
487
- var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
488
- var index = parseInt(cleanRoot, 10);
489
- if (!options.parseArrays && cleanRoot === '') {
490
- obj = { 0: leaf };
491
- } else if (
492
- !isNaN(index)
493
- && root !== cleanRoot
494
- && String(index) === cleanRoot
495
- && index >= 0
496
- && (options.parseArrays && index <= options.arrayLimit)
497
- ) {
498
- obj = [];
499
- obj[index] = leaf;
500
- } else {
501
- obj[cleanRoot] = leaf;
502
- }
503
- }
504
-
505
- leaf = obj; // eslint-disable-line no-param-reassign
506
- }
507
-
508
- return leaf;
509
- };
510
-
511
- var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
512
- if (!givenKey) {
513
- return;
514
- }
515
-
516
- // Transform dot notation to bracket notation
517
- var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
518
-
519
- // The regex chunks
520
-
521
- var brackets = /(\[[^[\]]*])/;
522
- var child = /(\[[^[\]]*])/g;
523
-
524
- // Get the parent
525
-
526
- var segment = options.depth > 0 && brackets.exec(key);
527
- var parent = segment ? key.slice(0, segment.index) : key;
528
-
529
- // Stash the parent if it exists
530
-
531
- var keys = [];
532
- if (parent) {
533
- // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
534
- if (!options.plainObjects && has.call(Object.prototype, parent)) {
535
- if (!options.allowPrototypes) {
536
- return;
537
- }
538
- }
539
-
540
- keys.push(parent);
541
- }
542
-
543
- // Loop through children appending to the array until we hit depth
544
-
545
- var i = 0;
546
- while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
547
- i += 1;
548
- if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
549
- if (!options.allowPrototypes) {
550
- return;
551
- }
552
- }
553
- keys.push(segment[1]);
554
- }
555
-
556
- // If there's a remainder, just add whatever is left
557
-
558
- if (segment) {
559
- keys.push('[' + key.slice(segment.index) + ']');
560
- }
561
-
562
- return parseObject(keys, val, options, valuesParsed);
563
- };
564
-
565
- var normalizeParseOptions = function normalizeParseOptions(opts) {
566
- if (!opts) {
567
- return defaults;
568
- }
569
-
570
- if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
571
- throw new TypeError('Decoder has to be a function.');
572
- }
573
-
574
- if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
575
- throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
576
- }
577
- var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
578
-
579
- return {
580
- allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
581
- allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
582
- arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
583
- charset: charset,
584
- charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
585
- comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
586
- decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
587
- delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
588
- // eslint-disable-next-line no-implicit-coercion, no-extra-parens
589
- depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
590
- ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
591
- interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
592
- parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
593
- parseArrays: opts.parseArrays !== false,
594
- plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
595
- strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
596
- };
597
- };
598
-
599
- module.exports = function (str, opts) {
600
- var options = normalizeParseOptions(opts);
601
-
602
- if (str === '' || str === null || typeof str === 'undefined') {
603
- return options.plainObjects ? Object.create(null) : {};
604
- }
605
-
606
- var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
607
- var obj = options.plainObjects ? Object.create(null) : {};
608
-
609
- // Iterate over the keys and setup the new object
610
-
611
- var keys = Object.keys(tempObj);
612
- for (var i = 0; i < keys.length; ++i) {
613
- var key = keys[i];
614
- var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
615
- obj = utils.merge(obj, newObj, options);
616
- }
617
-
618
- return utils.compact(obj);
619
- };
620
-
621
-
622
- /***/ }),
623
-
624
- /***/ "../../node_modules/qs/lib/stringify.js":
625
- /*!*************************************************************************************!*\
626
- !*** /Users/daffl/Development/feathersjs/feathers/node_modules/qs/lib/stringify.js ***!
627
- \*************************************************************************************/
628
- /*! no static exports found */
629
- /***/ (function(module, exports, __webpack_require__) {
630
-
631
- "use strict";
632
-
633
-
634
- var utils = __webpack_require__(/*! ./utils */ "../../node_modules/qs/lib/utils.js");
635
- var formats = __webpack_require__(/*! ./formats */ "../../node_modules/qs/lib/formats.js");
636
- var has = Object.prototype.hasOwnProperty;
637
-
638
- var arrayPrefixGenerators = {
639
- brackets: function brackets(prefix) {
640
- return prefix + '[]';
641
- },
642
- comma: 'comma',
643
- indices: function indices(prefix, key) {
644
- return prefix + '[' + key + ']';
645
- },
646
- repeat: function repeat(prefix) {
647
- return prefix;
648
- }
649
- };
650
-
651
- var isArray = Array.isArray;
652
- var push = Array.prototype.push;
653
- var pushToArray = function (arr, valueOrArray) {
654
- push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
655
- };
656
-
657
- var toISO = Date.prototype.toISOString;
658
-
659
- var defaultFormat = formats['default'];
660
- var defaults = {
661
- addQueryPrefix: false,
662
- allowDots: false,
663
- charset: 'utf-8',
664
- charsetSentinel: false,
665
- delimiter: '&',
666
- encode: true,
667
- encoder: utils.encode,
668
- encodeValuesOnly: false,
669
- format: defaultFormat,
670
- formatter: formats.formatters[defaultFormat],
671
- // deprecated
672
- indices: false,
673
- serializeDate: function serializeDate(date) {
674
- return toISO.call(date);
675
- },
676
- skipNulls: false,
677
- strictNullHandling: false
678
- };
679
-
680
- var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
681
- return typeof v === 'string'
682
- || typeof v === 'number'
683
- || typeof v === 'boolean'
684
- || typeof v === 'symbol'
685
- || typeof v === 'bigint';
686
- };
687
-
688
- var stringify = function stringify(
689
- object,
690
- prefix,
691
- generateArrayPrefix,
692
- strictNullHandling,
693
- skipNulls,
694
- encoder,
695
- filter,
696
- sort,
697
- allowDots,
698
- serializeDate,
699
- formatter,
700
- encodeValuesOnly,
701
- charset
702
- ) {
703
- var obj = object;
704
- if (typeof filter === 'function') {
705
- obj = filter(prefix, obj);
706
- } else if (obj instanceof Date) {
707
- obj = serializeDate(obj);
708
- } else if (generateArrayPrefix === 'comma' && isArray(obj)) {
709
- obj = utils.maybeMap(obj, function (value) {
710
- if (value instanceof Date) {
711
- return serializeDate(value);
712
- }
713
- return value;
714
- }).join(',');
715
- }
716
-
717
- if (obj === null) {
718
- if (strictNullHandling) {
719
- return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key') : prefix;
720
- }
721
-
722
- obj = '';
723
- }
724
-
725
- if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
726
- if (encoder) {
727
- var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key');
728
- return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value'))];
729
- }
730
- return [formatter(prefix) + '=' + formatter(String(obj))];
731
- }
732
-
733
- var values = [];
734
-
735
- if (typeof obj === 'undefined') {
736
- return values;
737
- }
738
-
739
- var objKeys;
740
- if (isArray(filter)) {
741
- objKeys = filter;
742
- } else {
743
- var keys = Object.keys(obj);
744
- objKeys = sort ? keys.sort(sort) : keys;
745
- }
746
-
747
- for (var i = 0; i < objKeys.length; ++i) {
748
- var key = objKeys[i];
749
- var value = obj[key];
750
-
751
- if (skipNulls && value === null) {
752
- continue;
753
- }
754
-
755
- var keyPrefix = isArray(obj)
756
- ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix
757
- : prefix + (allowDots ? '.' + key : '[' + key + ']');
758
-
759
- pushToArray(values, stringify(
760
- value,
761
- keyPrefix,
762
- generateArrayPrefix,
763
- strictNullHandling,
764
- skipNulls,
765
- encoder,
766
- filter,
767
- sort,
768
- allowDots,
769
- serializeDate,
770
- formatter,
771
- encodeValuesOnly,
772
- charset
773
- ));
774
- }
775
-
776
- return values;
777
- };
778
-
779
- var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
780
- if (!opts) {
781
- return defaults;
782
- }
783
-
784
- if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') {
785
- throw new TypeError('Encoder has to be a function.');
786
- }
787
-
788
- var charset = opts.charset || defaults.charset;
789
- if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
790
- throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
791
- }
792
-
793
- var format = formats['default'];
794
- if (typeof opts.format !== 'undefined') {
795
- if (!has.call(formats.formatters, opts.format)) {
796
- throw new TypeError('Unknown format option provided.');
797
- }
798
- format = opts.format;
799
- }
800
- var formatter = formats.formatters[format];
801
-
802
- var filter = defaults.filter;
803
- if (typeof opts.filter === 'function' || isArray(opts.filter)) {
804
- filter = opts.filter;
805
- }
806
-
807
- return {
808
- addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,
809
- allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
810
- charset: charset,
811
- charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
812
- delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,
813
- encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,
814
- encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,
815
- encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
816
- filter: filter,
817
- formatter: formatter,
818
- serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,
819
- skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,
820
- sort: typeof opts.sort === 'function' ? opts.sort : null,
821
- strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
822
- };
823
- };
824
-
825
- module.exports = function (object, opts) {
826
- var obj = object;
827
- var options = normalizeStringifyOptions(opts);
828
-
829
- var objKeys;
830
- var filter;
831
-
832
- if (typeof options.filter === 'function') {
833
- filter = options.filter;
834
- obj = filter('', obj);
835
- } else if (isArray(options.filter)) {
836
- filter = options.filter;
837
- objKeys = filter;
838
- }
839
-
840
- var keys = [];
841
-
842
- if (typeof obj !== 'object' || obj === null) {
843
- return '';
844
- }
845
-
846
- var arrayFormat;
847
- if (opts && opts.arrayFormat in arrayPrefixGenerators) {
848
- arrayFormat = opts.arrayFormat;
849
- } else if (opts && 'indices' in opts) {
850
- arrayFormat = opts.indices ? 'indices' : 'repeat';
851
- } else {
852
- arrayFormat = 'indices';
853
- }
854
-
855
- var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
856
-
857
- if (!objKeys) {
858
- objKeys = Object.keys(obj);
859
- }
860
-
861
- if (options.sort) {
862
- objKeys.sort(options.sort);
863
- }
864
-
865
- for (var i = 0; i < objKeys.length; ++i) {
866
- var key = objKeys[i];
867
-
868
- if (options.skipNulls && obj[key] === null) {
869
- continue;
870
- }
871
- pushToArray(keys, stringify(
872
- obj[key],
873
- key,
874
- generateArrayPrefix,
875
- options.strictNullHandling,
876
- options.skipNulls,
877
- options.encode ? options.encoder : null,
878
- options.filter,
879
- options.sort,
880
- options.allowDots,
881
- options.serializeDate,
882
- options.formatter,
883
- options.encodeValuesOnly,
884
- options.charset
885
- ));
886
- }
887
-
888
- var joined = keys.join(options.delimiter);
889
- var prefix = options.addQueryPrefix === true ? '?' : '';
890
-
891
- if (options.charsetSentinel) {
892
- if (options.charset === 'iso-8859-1') {
893
- // encodeURIComponent('&#10003;'), the "numeric entity" representation of a checkmark
894
- prefix += 'utf8=%26%2310003%3B&';
895
- } else {
896
- // encodeURIComponent('✓')
897
- prefix += 'utf8=%E2%9C%93&';
898
- }
899
- }
900
-
901
- return joined.length > 0 ? prefix + joined : '';
902
- };
903
-
904
-
905
- /***/ }),
906
-
907
- /***/ "../../node_modules/qs/lib/utils.js":
908
- /*!*********************************************************************************!*\
909
- !*** /Users/daffl/Development/feathersjs/feathers/node_modules/qs/lib/utils.js ***!
910
- \*********************************************************************************/
911
- /*! no static exports found */
912
- /***/ (function(module, exports, __webpack_require__) {
913
-
914
- "use strict";
915
-
916
-
917
- var has = Object.prototype.hasOwnProperty;
918
- var isArray = Array.isArray;
919
-
920
- var hexTable = (function () {
921
- var array = [];
922
- for (var i = 0; i < 256; ++i) {
923
- array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
924
- }
925
-
926
- return array;
927
- }());
928
-
929
- var compactQueue = function compactQueue(queue) {
930
- while (queue.length > 1) {
931
- var item = queue.pop();
932
- var obj = item.obj[item.prop];
933
-
934
- if (isArray(obj)) {
935
- var compacted = [];
936
-
937
- for (var j = 0; j < obj.length; ++j) {
938
- if (typeof obj[j] !== 'undefined') {
939
- compacted.push(obj[j]);
940
- }
941
- }
942
-
943
- item.obj[item.prop] = compacted;
944
- }
945
- }
946
- };
947
-
948
- var arrayToObject = function arrayToObject(source, options) {
949
- var obj = options && options.plainObjects ? Object.create(null) : {};
950
- for (var i = 0; i < source.length; ++i) {
951
- if (typeof source[i] !== 'undefined') {
952
- obj[i] = source[i];
953
- }
954
- }
955
-
956
- return obj;
957
- };
958
-
959
- var merge = function merge(target, source, options) {
960
- /* eslint no-param-reassign: 0 */
961
- if (!source) {
962
- return target;
963
- }
964
-
965
- if (typeof source !== 'object') {
966
- if (isArray(target)) {
967
- target.push(source);
968
- } else if (target && typeof target === 'object') {
969
- if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {
970
- target[source] = true;
971
- }
972
- } else {
973
- return [target, source];
974
- }
975
-
976
- return target;
977
- }
978
-
979
- if (!target || typeof target !== 'object') {
980
- return [target].concat(source);
981
- }
982
-
983
- var mergeTarget = target;
984
- if (isArray(target) && !isArray(source)) {
985
- mergeTarget = arrayToObject(target, options);
986
- }
987
-
988
- if (isArray(target) && isArray(source)) {
989
- source.forEach(function (item, i) {
990
- if (has.call(target, i)) {
991
- var targetItem = target[i];
992
- if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
993
- target[i] = merge(targetItem, item, options);
994
- } else {
995
- target.push(item);
996
- }
997
- } else {
998
- target[i] = item;
999
- }
1000
- });
1001
- return target;
1002
- }
1003
-
1004
- return Object.keys(source).reduce(function (acc, key) {
1005
- var value = source[key];
1006
-
1007
- if (has.call(acc, key)) {
1008
- acc[key] = merge(acc[key], value, options);
1009
- } else {
1010
- acc[key] = value;
1011
- }
1012
- return acc;
1013
- }, mergeTarget);
1014
- };
1015
-
1016
- var assign = function assignSingleSource(target, source) {
1017
- return Object.keys(source).reduce(function (acc, key) {
1018
- acc[key] = source[key];
1019
- return acc;
1020
- }, target);
1021
- };
1022
-
1023
- var decode = function (str, decoder, charset) {
1024
- var strWithoutPlus = str.replace(/\+/g, ' ');
1025
- if (charset === 'iso-8859-1') {
1026
- // unescape never throws, no try...catch needed:
1027
- return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
1028
- }
1029
- // utf-8
1030
- try {
1031
- return decodeURIComponent(strWithoutPlus);
1032
- } catch (e) {
1033
- return strWithoutPlus;
1034
- }
1035
- };
1036
-
1037
- var encode = function encode(str, defaultEncoder, charset) {
1038
- // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
1039
- // It has been adapted here for stricter adherence to RFC 3986
1040
- if (str.length === 0) {
1041
- return str;
1042
- }
1043
-
1044
- var string = str;
1045
- if (typeof str === 'symbol') {
1046
- string = Symbol.prototype.toString.call(str);
1047
- } else if (typeof str !== 'string') {
1048
- string = String(str);
1049
- }
1050
-
1051
- if (charset === 'iso-8859-1') {
1052
- return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
1053
- return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
1054
- });
1055
- }
1056
-
1057
- var out = '';
1058
- for (var i = 0; i < string.length; ++i) {
1059
- var c = string.charCodeAt(i);
1060
-
1061
- if (
1062
- c === 0x2D // -
1063
- || c === 0x2E // .
1064
- || c === 0x5F // _
1065
- || c === 0x7E // ~
1066
- || (c >= 0x30 && c <= 0x39) // 0-9
1067
- || (c >= 0x41 && c <= 0x5A) // a-z
1068
- || (c >= 0x61 && c <= 0x7A) // A-Z
1069
- ) {
1070
- out += string.charAt(i);
1071
- continue;
1072
- }
1073
-
1074
- if (c < 0x80) {
1075
- out = out + hexTable[c];
1076
- continue;
1077
- }
1078
-
1079
- if (c < 0x800) {
1080
- out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
1081
- continue;
1082
- }
1083
-
1084
- if (c < 0xD800 || c >= 0xE000) {
1085
- out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
1086
- continue;
1087
- }
1088
-
1089
- i += 1;
1090
- c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
1091
- out += hexTable[0xF0 | (c >> 18)]
1092
- + hexTable[0x80 | ((c >> 12) & 0x3F)]
1093
- + hexTable[0x80 | ((c >> 6) & 0x3F)]
1094
- + hexTable[0x80 | (c & 0x3F)];
1095
- }
1096
-
1097
- return out;
1098
- };
1099
-
1100
- var compact = function compact(value) {
1101
- var queue = [{ obj: { o: value }, prop: 'o' }];
1102
- var refs = [];
1103
-
1104
- for (var i = 0; i < queue.length; ++i) {
1105
- var item = queue[i];
1106
- var obj = item.obj[item.prop];
1107
-
1108
- var keys = Object.keys(obj);
1109
- for (var j = 0; j < keys.length; ++j) {
1110
- var key = keys[j];
1111
- var val = obj[key];
1112
- if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
1113
- queue.push({ obj: obj, prop: key });
1114
- refs.push(val);
1115
- }
1116
- }
1117
- }
1118
-
1119
- compactQueue(queue);
1120
-
1121
- return value;
1122
- };
1123
-
1124
- var isRegExp = function isRegExp(obj) {
1125
- return Object.prototype.toString.call(obj) === '[object RegExp]';
1126
- };
1127
-
1128
- var isBuffer = function isBuffer(obj) {
1129
- if (!obj || typeof obj !== 'object') {
1130
- return false;
1131
- }
1132
-
1133
- return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
1134
- };
1135
-
1136
- var combine = function combine(a, b) {
1137
- return [].concat(a, b);
1138
- };
1139
-
1140
- var maybeMap = function maybeMap(val, fn) {
1141
- if (isArray(val)) {
1142
- var mapped = [];
1143
- for (var i = 0; i < val.length; i += 1) {
1144
- mapped.push(fn(val[i]));
1145
- }
1146
- return mapped;
1147
- }
1148
- return fn(val);
1149
- };
1150
-
1151
- module.exports = {
1152
- arrayToObject: arrayToObject,
1153
- assign: assign,
1154
- combine: combine,
1155
- compact: compact,
1156
- decode: decode,
1157
- encode: encode,
1158
- isBuffer: isBuffer,
1159
- isRegExp: isRegExp,
1160
- maybeMap: maybeMap,
1161
- merge: merge
1162
- };
1163
-
1164
-
1165
- /***/ }),
1166
-
1167
- /***/ "../../node_modules/regenerator-runtime/runtime.js":
1168
- /*!************************************************************************************************!*\
1169
- !*** /Users/daffl/Development/feathersjs/feathers/node_modules/regenerator-runtime/runtime.js ***!
1170
- \************************************************************************************************/
1171
- /*! no static exports found */
1172
- /***/ (function(module, exports, __webpack_require__) {
1173
-
1174
- /**
1175
- * Copyright (c) 2014-present, Facebook, Inc.
1176
- *
1177
- * This source code is licensed under the MIT license found in the
1178
- * LICENSE file in the root directory of this source tree.
1179
- */
1180
-
1181
- var runtime = (function (exports) {
1182
- "use strict";
1183
-
1184
- var Op = Object.prototype;
1185
- var hasOwn = Op.hasOwnProperty;
1186
- var undefined; // More compressible than void 0.
1187
- var $Symbol = typeof Symbol === "function" ? Symbol : {};
1188
- var iteratorSymbol = $Symbol.iterator || "@@iterator";
1189
- var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
1190
- var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
1191
-
1192
- function wrap(innerFn, outerFn, self, tryLocsList) {
1193
- // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
1194
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
1195
- var generator = Object.create(protoGenerator.prototype);
1196
- var context = new Context(tryLocsList || []);
1197
-
1198
- // The ._invoke method unifies the implementations of the .next,
1199
- // .throw, and .return methods.
1200
- generator._invoke = makeInvokeMethod(innerFn, self, context);
1201
-
1202
- return generator;
1203
- }
1204
- exports.wrap = wrap;
1205
-
1206
- // Try/catch helper to minimize deoptimizations. Returns a completion
1207
- // record like context.tryEntries[i].completion. This interface could
1208
- // have been (and was previously) designed to take a closure to be
1209
- // invoked without arguments, but in all the cases we care about we
1210
- // already have an existing method we want to call, so there's no need
1211
- // to create a new function object. We can even get away with assuming
1212
- // the method takes exactly one argument, since that happens to be true
1213
- // in every case, so we don't have to touch the arguments object. The
1214
- // only additional allocation required is the completion record, which
1215
- // has a stable shape and so hopefully should be cheap to allocate.
1216
- function tryCatch(fn, obj, arg) {
1217
- try {
1218
- return { type: "normal", arg: fn.call(obj, arg) };
1219
- } catch (err) {
1220
- return { type: "throw", arg: err };
1221
- }
1222
- }
1223
-
1224
- var GenStateSuspendedStart = "suspendedStart";
1225
- var GenStateSuspendedYield = "suspendedYield";
1226
- var GenStateExecuting = "executing";
1227
- var GenStateCompleted = "completed";
1228
-
1229
- // Returning this object from the innerFn has the same effect as
1230
- // breaking out of the dispatch switch statement.
1231
- var ContinueSentinel = {};
1232
-
1233
- // Dummy constructor functions that we use as the .constructor and
1234
- // .constructor.prototype properties for functions that return Generator
1235
- // objects. For full spec compliance, you may wish to configure your
1236
- // minifier not to mangle the names of these two functions.
1237
- function Generator() {}
1238
- function GeneratorFunction() {}
1239
- function GeneratorFunctionPrototype() {}
1240
-
1241
- // This is a polyfill for %IteratorPrototype% for environments that
1242
- // don't natively support it.
1243
- var IteratorPrototype = {};
1244
- IteratorPrototype[iteratorSymbol] = function () {
1245
- return this;
1246
- };
1247
-
1248
- var getProto = Object.getPrototypeOf;
1249
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
1250
- if (NativeIteratorPrototype &&
1251
- NativeIteratorPrototype !== Op &&
1252
- hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
1253
- // This environment has a native %IteratorPrototype%; use it instead
1254
- // of the polyfill.
1255
- IteratorPrototype = NativeIteratorPrototype;
1256
- }
1257
-
1258
- var Gp = GeneratorFunctionPrototype.prototype =
1259
- Generator.prototype = Object.create(IteratorPrototype);
1260
- GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
1261
- GeneratorFunctionPrototype.constructor = GeneratorFunction;
1262
- GeneratorFunctionPrototype[toStringTagSymbol] =
1263
- GeneratorFunction.displayName = "GeneratorFunction";
1264
-
1265
- // Helper for defining the .next, .throw, and .return methods of the
1266
- // Iterator interface in terms of a single ._invoke method.
1267
- function defineIteratorMethods(prototype) {
1268
- ["next", "throw", "return"].forEach(function(method) {
1269
- prototype[method] = function(arg) {
1270
- return this._invoke(method, arg);
1271
- };
1272
- });
1273
- }
1274
-
1275
- exports.isGeneratorFunction = function(genFun) {
1276
- var ctor = typeof genFun === "function" && genFun.constructor;
1277
- return ctor
1278
- ? ctor === GeneratorFunction ||
1279
- // For the native GeneratorFunction constructor, the best we can
1280
- // do is to check its .name property.
1281
- (ctor.displayName || ctor.name) === "GeneratorFunction"
1282
- : false;
1283
- };
1284
-
1285
- exports.mark = function(genFun) {
1286
- if (Object.setPrototypeOf) {
1287
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
1288
- } else {
1289
- genFun.__proto__ = GeneratorFunctionPrototype;
1290
- if (!(toStringTagSymbol in genFun)) {
1291
- genFun[toStringTagSymbol] = "GeneratorFunction";
1292
- }
1293
- }
1294
- genFun.prototype = Object.create(Gp);
1295
- return genFun;
1296
- };
1297
-
1298
- // Within the body of any async function, `await x` is transformed to
1299
- // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
1300
- // `hasOwn.call(value, "__await")` to determine if the yielded value is
1301
- // meant to be awaited.
1302
- exports.awrap = function(arg) {
1303
- return { __await: arg };
1304
- };
1305
-
1306
- function AsyncIterator(generator, PromiseImpl) {
1307
- function invoke(method, arg, resolve, reject) {
1308
- var record = tryCatch(generator[method], generator, arg);
1309
- if (record.type === "throw") {
1310
- reject(record.arg);
1311
- } else {
1312
- var result = record.arg;
1313
- var value = result.value;
1314
- if (value &&
1315
- typeof value === "object" &&
1316
- hasOwn.call(value, "__await")) {
1317
- return PromiseImpl.resolve(value.__await).then(function(value) {
1318
- invoke("next", value, resolve, reject);
1319
- }, function(err) {
1320
- invoke("throw", err, resolve, reject);
1321
- });
1322
- }
1323
-
1324
- return PromiseImpl.resolve(value).then(function(unwrapped) {
1325
- // When a yielded Promise is resolved, its final value becomes
1326
- // the .value of the Promise<{value,done}> result for the
1327
- // current iteration.
1328
- result.value = unwrapped;
1329
- resolve(result);
1330
- }, function(error) {
1331
- // If a rejected Promise was yielded, throw the rejection back
1332
- // into the async generator function so it can be handled there.
1333
- return invoke("throw", error, resolve, reject);
1334
- });
1335
- }
1336
- }
1337
-
1338
- var previousPromise;
1339
-
1340
- function enqueue(method, arg) {
1341
- function callInvokeWithMethodAndArg() {
1342
- return new PromiseImpl(function(resolve, reject) {
1343
- invoke(method, arg, resolve, reject);
1344
- });
1345
- }
1346
-
1347
- return previousPromise =
1348
- // If enqueue has been called before, then we want to wait until
1349
- // all previous Promises have been resolved before calling invoke,
1350
- // so that results are always delivered in the correct order. If
1351
- // enqueue has not been called before, then it is important to
1352
- // call invoke immediately, without waiting on a callback to fire,
1353
- // so that the async generator function has the opportunity to do
1354
- // any necessary setup in a predictable way. This predictability
1355
- // is why the Promise constructor synchronously invokes its
1356
- // executor callback, and why async functions synchronously
1357
- // execute code before the first await. Since we implement simple
1358
- // async functions in terms of async generators, it is especially
1359
- // important to get this right, even though it requires care.
1360
- previousPromise ? previousPromise.then(
1361
- callInvokeWithMethodAndArg,
1362
- // Avoid propagating failures to Promises returned by later
1363
- // invocations of the iterator.
1364
- callInvokeWithMethodAndArg
1365
- ) : callInvokeWithMethodAndArg();
1366
- }
1367
-
1368
- // Define the unified helper method that is used to implement .next,
1369
- // .throw, and .return (see defineIteratorMethods).
1370
- this._invoke = enqueue;
1371
- }
1372
-
1373
- defineIteratorMethods(AsyncIterator.prototype);
1374
- AsyncIterator.prototype[asyncIteratorSymbol] = function () {
1375
- return this;
1376
- };
1377
- exports.AsyncIterator = AsyncIterator;
1378
-
1379
- // Note that simple async functions are implemented on top of
1380
- // AsyncIterator objects; they just return a Promise for the value of
1381
- // the final result produced by the iterator.
1382
- exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
1383
- if (PromiseImpl === void 0) PromiseImpl = Promise;
1384
-
1385
- var iter = new AsyncIterator(
1386
- wrap(innerFn, outerFn, self, tryLocsList),
1387
- PromiseImpl
1388
- );
1389
-
1390
- return exports.isGeneratorFunction(outerFn)
1391
- ? iter // If outerFn is a generator, return the full iterator.
1392
- : iter.next().then(function(result) {
1393
- return result.done ? result.value : iter.next();
1394
- });
1395
- };
1396
-
1397
- function makeInvokeMethod(innerFn, self, context) {
1398
- var state = GenStateSuspendedStart;
1399
-
1400
- return function invoke(method, arg) {
1401
- if (state === GenStateExecuting) {
1402
- throw new Error("Generator is already running");
1403
- }
1404
-
1405
- if (state === GenStateCompleted) {
1406
- if (method === "throw") {
1407
- throw arg;
1408
- }
1409
-
1410
- // Be forgiving, per 25.3.3.3.3 of the spec:
1411
- // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
1412
- return doneResult();
1413
- }
1414
-
1415
- context.method = method;
1416
- context.arg = arg;
1417
-
1418
- while (true) {
1419
- var delegate = context.delegate;
1420
- if (delegate) {
1421
- var delegateResult = maybeInvokeDelegate(delegate, context);
1422
- if (delegateResult) {
1423
- if (delegateResult === ContinueSentinel) continue;
1424
- return delegateResult;
1425
- }
1426
- }
1427
-
1428
- if (context.method === "next") {
1429
- // Setting context._sent for legacy support of Babel's
1430
- // function.sent implementation.
1431
- context.sent = context._sent = context.arg;
1432
-
1433
- } else if (context.method === "throw") {
1434
- if (state === GenStateSuspendedStart) {
1435
- state = GenStateCompleted;
1436
- throw context.arg;
1437
- }
1438
-
1439
- context.dispatchException(context.arg);
1440
-
1441
- } else if (context.method === "return") {
1442
- context.abrupt("return", context.arg);
1443
- }
1444
-
1445
- state = GenStateExecuting;
1446
-
1447
- var record = tryCatch(innerFn, self, context);
1448
- if (record.type === "normal") {
1449
- // If an exception is thrown from innerFn, we leave state ===
1450
- // GenStateExecuting and loop back for another invocation.
1451
- state = context.done
1452
- ? GenStateCompleted
1453
- : GenStateSuspendedYield;
1454
-
1455
- if (record.arg === ContinueSentinel) {
1456
- continue;
1457
- }
1458
-
1459
- return {
1460
- value: record.arg,
1461
- done: context.done
1462
- };
1463
-
1464
- } else if (record.type === "throw") {
1465
- state = GenStateCompleted;
1466
- // Dispatch the exception by looping back around to the
1467
- // context.dispatchException(context.arg) call above.
1468
- context.method = "throw";
1469
- context.arg = record.arg;
1470
- }
1471
- }
1472
- };
1473
- }
1474
-
1475
- // Call delegate.iterator[context.method](context.arg) and handle the
1476
- // result, either by returning a { value, done } result from the
1477
- // delegate iterator, or by modifying context.method and context.arg,
1478
- // setting context.delegate to null, and returning the ContinueSentinel.
1479
- function maybeInvokeDelegate(delegate, context) {
1480
- var method = delegate.iterator[context.method];
1481
- if (method === undefined) {
1482
- // A .throw or .return when the delegate iterator has no .throw
1483
- // method always terminates the yield* loop.
1484
- context.delegate = null;
1485
-
1486
- if (context.method === "throw") {
1487
- // Note: ["return"] must be used for ES3 parsing compatibility.
1488
- if (delegate.iterator["return"]) {
1489
- // If the delegate iterator has a return method, give it a
1490
- // chance to clean up.
1491
- context.method = "return";
1492
- context.arg = undefined;
1493
- maybeInvokeDelegate(delegate, context);
1494
-
1495
- if (context.method === "throw") {
1496
- // If maybeInvokeDelegate(context) changed context.method from
1497
- // "return" to "throw", let that override the TypeError below.
1498
- return ContinueSentinel;
1499
- }
1500
- }
1501
-
1502
- context.method = "throw";
1503
- context.arg = new TypeError(
1504
- "The iterator does not provide a 'throw' method");
1505
- }
1506
-
1507
- return ContinueSentinel;
1508
- }
1509
-
1510
- var record = tryCatch(method, delegate.iterator, context.arg);
1511
-
1512
- if (record.type === "throw") {
1513
- context.method = "throw";
1514
- context.arg = record.arg;
1515
- context.delegate = null;
1516
- return ContinueSentinel;
1517
- }
1518
-
1519
- var info = record.arg;
1520
-
1521
- if (! info) {
1522
- context.method = "throw";
1523
- context.arg = new TypeError("iterator result is not an object");
1524
- context.delegate = null;
1525
- return ContinueSentinel;
1526
- }
1527
-
1528
- if (info.done) {
1529
- // Assign the result of the finished delegate to the temporary
1530
- // variable specified by delegate.resultName (see delegateYield).
1531
- context[delegate.resultName] = info.value;
1532
-
1533
- // Resume execution at the desired location (see delegateYield).
1534
- context.next = delegate.nextLoc;
1535
-
1536
- // If context.method was "throw" but the delegate handled the
1537
- // exception, let the outer generator proceed normally. If
1538
- // context.method was "next", forget context.arg since it has been
1539
- // "consumed" by the delegate iterator. If context.method was
1540
- // "return", allow the original .return call to continue in the
1541
- // outer generator.
1542
- if (context.method !== "return") {
1543
- context.method = "next";
1544
- context.arg = undefined;
1545
- }
1546
-
1547
- } else {
1548
- // Re-yield the result returned by the delegate method.
1549
- return info;
1550
- }
1551
-
1552
- // The delegate iterator is finished, so forget it and continue with
1553
- // the outer generator.
1554
- context.delegate = null;
1555
- return ContinueSentinel;
1556
- }
1557
-
1558
- // Define Generator.prototype.{next,throw,return} in terms of the
1559
- // unified ._invoke helper method.
1560
- defineIteratorMethods(Gp);
1561
-
1562
- Gp[toStringTagSymbol] = "Generator";
1563
-
1564
- // A Generator should always return itself as the iterator object when the
1565
- // @@iterator function is called on it. Some browsers' implementations of the
1566
- // iterator prototype chain incorrectly implement this, causing the Generator
1567
- // object to not be returned from this call. This ensures that doesn't happen.
1568
- // See https://github.com/facebook/regenerator/issues/274 for more details.
1569
- Gp[iteratorSymbol] = function() {
1570
- return this;
1571
- };
1572
-
1573
- Gp.toString = function() {
1574
- return "[object Generator]";
1575
- };
1576
-
1577
- function pushTryEntry(locs) {
1578
- var entry = { tryLoc: locs[0] };
1579
-
1580
- if (1 in locs) {
1581
- entry.catchLoc = locs[1];
1582
- }
1583
-
1584
- if (2 in locs) {
1585
- entry.finallyLoc = locs[2];
1586
- entry.afterLoc = locs[3];
1587
- }
1588
-
1589
- this.tryEntries.push(entry);
1590
- }
1591
-
1592
- function resetTryEntry(entry) {
1593
- var record = entry.completion || {};
1594
- record.type = "normal";
1595
- delete record.arg;
1596
- entry.completion = record;
1597
- }
1598
-
1599
- function Context(tryLocsList) {
1600
- // The root entry object (effectively a try statement without a catch
1601
- // or a finally block) gives us a place to store values thrown from
1602
- // locations where there is no enclosing try statement.
1603
- this.tryEntries = [{ tryLoc: "root" }];
1604
- tryLocsList.forEach(pushTryEntry, this);
1605
- this.reset(true);
1606
- }
1607
-
1608
- exports.keys = function(object) {
1609
- var keys = [];
1610
- for (var key in object) {
1611
- keys.push(key);
1612
- }
1613
- keys.reverse();
1614
-
1615
- // Rather than returning an object with a next method, we keep
1616
- // things simple and return the next function itself.
1617
- return function next() {
1618
- while (keys.length) {
1619
- var key = keys.pop();
1620
- if (key in object) {
1621
- next.value = key;
1622
- next.done = false;
1623
- return next;
1624
- }
1625
- }
1626
-
1627
- // To avoid creating an additional object, we just hang the .value
1628
- // and .done properties off the next function object itself. This
1629
- // also ensures that the minifier will not anonymize the function.
1630
- next.done = true;
1631
- return next;
1632
- };
1633
- };
1634
-
1635
- function values(iterable) {
1636
- if (iterable) {
1637
- var iteratorMethod = iterable[iteratorSymbol];
1638
- if (iteratorMethod) {
1639
- return iteratorMethod.call(iterable);
1640
- }
1641
-
1642
- if (typeof iterable.next === "function") {
1643
- return iterable;
1644
- }
1645
-
1646
- if (!isNaN(iterable.length)) {
1647
- var i = -1, next = function next() {
1648
- while (++i < iterable.length) {
1649
- if (hasOwn.call(iterable, i)) {
1650
- next.value = iterable[i];
1651
- next.done = false;
1652
- return next;
1653
- }
1654
- }
1655
-
1656
- next.value = undefined;
1657
- next.done = true;
1658
-
1659
- return next;
1660
- };
1661
-
1662
- return next.next = next;
1663
- }
1664
- }
1665
-
1666
- // Return an iterator with no values.
1667
- return { next: doneResult };
1668
- }
1669
- exports.values = values;
1670
-
1671
- function doneResult() {
1672
- return { value: undefined, done: true };
1673
- }
1674
-
1675
- Context.prototype = {
1676
- constructor: Context,
1677
-
1678
- reset: function(skipTempReset) {
1679
- this.prev = 0;
1680
- this.next = 0;
1681
- // Resetting context._sent for legacy support of Babel's
1682
- // function.sent implementation.
1683
- this.sent = this._sent = undefined;
1684
- this.done = false;
1685
- this.delegate = null;
1686
-
1687
- this.method = "next";
1688
- this.arg = undefined;
1689
-
1690
- this.tryEntries.forEach(resetTryEntry);
1691
-
1692
- if (!skipTempReset) {
1693
- for (var name in this) {
1694
- // Not sure about the optimal order of these conditions:
1695
- if (name.charAt(0) === "t" &&
1696
- hasOwn.call(this, name) &&
1697
- !isNaN(+name.slice(1))) {
1698
- this[name] = undefined;
1699
- }
1700
- }
1701
- }
1702
- },
1703
-
1704
- stop: function() {
1705
- this.done = true;
1706
-
1707
- var rootEntry = this.tryEntries[0];
1708
- var rootRecord = rootEntry.completion;
1709
- if (rootRecord.type === "throw") {
1710
- throw rootRecord.arg;
1711
- }
1712
-
1713
- return this.rval;
1714
- },
1715
-
1716
- dispatchException: function(exception) {
1717
- if (this.done) {
1718
- throw exception;
1719
- }
1720
-
1721
- var context = this;
1722
- function handle(loc, caught) {
1723
- record.type = "throw";
1724
- record.arg = exception;
1725
- context.next = loc;
1726
-
1727
- if (caught) {
1728
- // If the dispatched exception was caught by a catch block,
1729
- // then let that catch block handle the exception normally.
1730
- context.method = "next";
1731
- context.arg = undefined;
1732
- }
1733
-
1734
- return !! caught;
1735
- }
1736
-
1737
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1738
- var entry = this.tryEntries[i];
1739
- var record = entry.completion;
1740
-
1741
- if (entry.tryLoc === "root") {
1742
- // Exception thrown outside of any try block that could handle
1743
- // it, so set the completion value of the entire function to
1744
- // throw the exception.
1745
- return handle("end");
1746
- }
1747
-
1748
- if (entry.tryLoc <= this.prev) {
1749
- var hasCatch = hasOwn.call(entry, "catchLoc");
1750
- var hasFinally = hasOwn.call(entry, "finallyLoc");
1751
-
1752
- if (hasCatch && hasFinally) {
1753
- if (this.prev < entry.catchLoc) {
1754
- return handle(entry.catchLoc, true);
1755
- } else if (this.prev < entry.finallyLoc) {
1756
- return handle(entry.finallyLoc);
1757
- }
1758
-
1759
- } else if (hasCatch) {
1760
- if (this.prev < entry.catchLoc) {
1761
- return handle(entry.catchLoc, true);
1762
- }
1763
-
1764
- } else if (hasFinally) {
1765
- if (this.prev < entry.finallyLoc) {
1766
- return handle(entry.finallyLoc);
1767
- }
1768
-
1769
- } else {
1770
- throw new Error("try statement without catch or finally");
1771
- }
1772
- }
1773
- }
1774
- },
1775
-
1776
- abrupt: function(type, arg) {
1777
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1778
- var entry = this.tryEntries[i];
1779
- if (entry.tryLoc <= this.prev &&
1780
- hasOwn.call(entry, "finallyLoc") &&
1781
- this.prev < entry.finallyLoc) {
1782
- var finallyEntry = entry;
1783
- break;
1784
- }
1785
- }
1786
-
1787
- if (finallyEntry &&
1788
- (type === "break" ||
1789
- type === "continue") &&
1790
- finallyEntry.tryLoc <= arg &&
1791
- arg <= finallyEntry.finallyLoc) {
1792
- // Ignore the finally entry if control is not jumping to a
1793
- // location outside the try/catch block.
1794
- finallyEntry = null;
1795
- }
1796
-
1797
- var record = finallyEntry ? finallyEntry.completion : {};
1798
- record.type = type;
1799
- record.arg = arg;
1800
-
1801
- if (finallyEntry) {
1802
- this.method = "next";
1803
- this.next = finallyEntry.finallyLoc;
1804
- return ContinueSentinel;
1805
- }
1806
-
1807
- return this.complete(record);
1808
- },
1809
-
1810
- complete: function(record, afterLoc) {
1811
- if (record.type === "throw") {
1812
- throw record.arg;
1813
- }
1814
-
1815
- if (record.type === "break" ||
1816
- record.type === "continue") {
1817
- this.next = record.arg;
1818
- } else if (record.type === "return") {
1819
- this.rval = this.arg = record.arg;
1820
- this.method = "return";
1821
- this.next = "end";
1822
- } else if (record.type === "normal" && afterLoc) {
1823
- this.next = afterLoc;
1824
- }
1825
-
1826
- return ContinueSentinel;
1827
- },
1828
-
1829
- finish: function(finallyLoc) {
1830
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1831
- var entry = this.tryEntries[i];
1832
- if (entry.finallyLoc === finallyLoc) {
1833
- this.complete(entry.completion, entry.afterLoc);
1834
- resetTryEntry(entry);
1835
- return ContinueSentinel;
1836
- }
1837
- }
1838
- },
1839
-
1840
- "catch": function(tryLoc) {
1841
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1842
- var entry = this.tryEntries[i];
1843
- if (entry.tryLoc === tryLoc) {
1844
- var record = entry.completion;
1845
- if (record.type === "throw") {
1846
- var thrown = record.arg;
1847
- resetTryEntry(entry);
1848
- }
1849
- return thrown;
1850
- }
1851
- }
1852
-
1853
- // The context.catch method must only be called with a location
1854
- // argument that corresponds to a known catch block.
1855
- throw new Error("illegal catch attempt");
1856
- },
1857
-
1858
- delegateYield: function(iterable, resultName, nextLoc) {
1859
- this.delegate = {
1860
- iterator: values(iterable),
1861
- resultName: resultName,
1862
- nextLoc: nextLoc
1863
- };
1864
-
1865
- if (this.method === "next") {
1866
- // Deliberately forget the last sent value so that we don't
1867
- // accidentally pass it on to the delegate.
1868
- this.arg = undefined;
1869
- }
1870
-
1871
- return ContinueSentinel;
1872
- }
1873
- };
1874
-
1875
- // Regardless of whether this script is executing as a CommonJS module
1876
- // or not, return the runtime object so that we can declare the variable
1877
- // regeneratorRuntime in the outer scope, which allows this module to be
1878
- // injected easily by `bin/regenerator --include-runtime script.js`.
1879
- return exports;
1880
-
1881
- }(
1882
- // If this script is executing as a CommonJS module, use module.exports
1883
- // as the regeneratorRuntime namespace. Otherwise create a new empty
1884
- // object. Either way, the resulting object will be used to initialize
1885
- // the regeneratorRuntime variable at the top of this file.
1886
- true ? module.exports : undefined
1887
- ));
1888
-
1889
- try {
1890
- regeneratorRuntime = runtime;
1891
- } catch (accidentalStrictMode) {
1892
- // This module should not be running in strict mode, so the above
1893
- // assignment should always work unless something is misconfigured. Just
1894
- // in case runtime.js accidentally runs in strict mode, we can escape
1895
- // strict mode using a global Function call. This could conceivably fail
1896
- // if a Content Security Policy forbids using Function, but in that case
1897
- // the proper solution is to fix the accidental strict mode problem. If
1898
- // you've misconfigured your bundler to force strict mode and applied a
1899
- // CSP to forbid Function, and you're not willing to fix either of those
1900
- // problems, please detail your unique predicament in a GitHub issue.
1901
- Function("r", "regeneratorRuntime = r")(runtime);
1902
- }
1903
-
1904
-
1905
- /***/ }),
1906
-
1907
- /***/ "../commons/lib/index.js":
1908
- /*!*******************************!*\
1909
- !*** ../commons/lib/index.js ***!
1910
- \*******************************/
1911
- /*! no static exports found */
1912
- /***/ (function(module, exports, __webpack_require__) {
1913
-
1914
- "use strict";
1915
- /* WEBPACK VAR INJECTION */(function(process) {
1916
-
1917
- 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; }
1918
-
1919
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
1920
-
1921
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
1922
-
1923
- 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."); }
1924
-
1925
- 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); }
1926
-
1927
- 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; }
1928
-
1929
- function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_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; }
1930
-
1931
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1932
-
1933
- Object.defineProperty(exports, "__esModule", {
1934
- value: true
1935
- });
1936
- exports.createSymbol = exports.makeUrl = exports.isPromise = exports._ = exports.stripSlashes = void 0; // Removes all leading and trailing slashes from a path
1937
-
1938
- function stripSlashes(name) {
1939
- return name.replace(/^(\/+)|(\/+)$/g, '');
1940
- }
1941
-
1942
- exports.stripSlashes = stripSlashes; // A set of lodash-y utility functions that use ES6
1943
-
1944
- exports._ = {
1945
- each: function each(obj, callback) {
1946
- if (obj && typeof obj.forEach === 'function') {
1947
- obj.forEach(callback);
1948
- } else if (exports._.isObject(obj)) {
1949
- Object.keys(obj).forEach(function (key) {
1950
- return callback(obj[key], key);
1951
- });
1952
- }
1953
- },
1954
- some: function some(value, callback) {
1955
- return Object.keys(value).map(function (key) {
1956
- return [value[key], key];
1957
- }).some(function (_ref) {
1958
- var _ref2 = _slicedToArray(_ref, 2),
1959
- val = _ref2[0],
1960
- key = _ref2[1];
1961
-
1962
- return callback(val, key);
1963
- });
1964
- },
1965
- every: function every(value, callback) {
1966
- return Object.keys(value).map(function (key) {
1967
- return [value[key], key];
1968
- }).every(function (_ref3) {
1969
- var _ref4 = _slicedToArray(_ref3, 2),
1970
- val = _ref4[0],
1971
- key = _ref4[1];
1972
-
1973
- return callback(val, key);
1974
- });
1975
- },
1976
- keys: function keys(obj) {
1977
- return Object.keys(obj);
1978
- },
1979
- values: function values(obj) {
1980
- return exports._.keys(obj).map(function (key) {
1981
- return obj[key];
1982
- });
1983
- },
1984
- isMatch: function isMatch(obj, item) {
1985
- return exports._.keys(item).every(function (key) {
1986
- return obj[key] === item[key];
1987
- });
1988
- },
1989
- isEmpty: function isEmpty(obj) {
1990
- return exports._.keys(obj).length === 0;
1991
- },
1992
- isObject: function isObject(item) {
1993
- return _typeof(item) === 'object' && !Array.isArray(item) && item !== null;
1994
- },
1995
- isObjectOrArray: function isObjectOrArray(value) {
1996
- return _typeof(value) === 'object' && value !== null;
1997
- },
1998
- extend: function extend(first) {
1999
- for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
2000
- rest[_key - 1] = arguments[_key];
2001
- }
2002
-
2003
- return Object.assign.apply(Object, [first].concat(rest));
2004
- },
2005
- omit: function omit(obj) {
2006
- var result = exports._.extend({}, obj);
2007
-
2008
- for (var _len2 = arguments.length, keys = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
2009
- keys[_key2 - 1] = arguments[_key2];
2010
- }
2011
-
2012
- keys.forEach(function (key) {
2013
- return delete result[key];
2014
- });
2015
- return result;
2016
- },
2017
- pick: function pick(source) {
2018
- for (var _len3 = arguments.length, keys = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
2019
- keys[_key3 - 1] = arguments[_key3];
2020
- }
2021
-
2022
- return keys.reduce(function (result, key) {
2023
- if (source[key] !== undefined) {
2024
- result[key] = source[key];
2025
- }
2026
-
2027
- return result;
2028
- }, {});
2029
- },
2030
- // Recursively merge the source object into the target object
2031
- merge: function merge(target, source) {
2032
- if (exports._.isObject(target) && exports._.isObject(source)) {
2033
- Object.keys(source).forEach(function (key) {
2034
- if (exports._.isObject(source[key])) {
2035
- if (!target[key]) {
2036
- Object.assign(target, _defineProperty({}, key, {}));
2037
- }
2038
-
2039
- exports._.merge(target[key], source[key]);
2040
- } else {
2041
- Object.assign(target, _defineProperty({}, key, source[key]));
2042
- }
2043
- });
2044
- }
2045
-
2046
- return target;
2047
- }
2048
- }; // Duck-checks if an object looks like a promise
2049
-
2050
- function isPromise(result) {
2051
- return exports._.isObject(result) && typeof result.then === 'function';
2052
- }
2053
-
2054
- exports.isPromise = isPromise;
2055
-
2056
- function makeUrl(path) {
2057
- var app = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2058
- var get = typeof app.get === 'function' ? app.get.bind(app) : function () {};
2059
- var env = get('env') || "development";
2060
- var host = get('host') || process.env.HOST_NAME || 'localhost';
2061
- var protocol = env === 'development' || env === 'test' || env === undefined ? 'http' : 'https';
2062
- var PORT = get('port') || process.env.PORT || 3030;
2063
- var port = env === 'development' || env === 'test' || env === undefined ? ":".concat(PORT) : '';
2064
- path = path || '';
2065
- return "".concat(protocol, "://").concat(host).concat(port, "/").concat(exports.stripSlashes(path));
2066
- }
2067
-
2068
- exports.makeUrl = makeUrl;
2069
-
2070
- function createSymbol(name) {
2071
- return typeof Symbol !== 'undefined' ? Symbol(name) : name;
2072
- }
2073
-
2074
- exports.createSymbol = createSymbol;
2075
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node_modules/process/browser.js */ "../../node_modules/process/browser.js")))
2076
-
2077
- /***/ }),
2078
-
2079
- /***/ "../errors/lib/index.js":
2080
- /*!******************************!*\
2081
- !*** ../errors/lib/index.js ***!
2082
- \******************************/
2083
- /*! no static exports found */
2084
- /***/ (function(module, exports, __webpack_require__) {
2085
-
2086
- "use strict";
2087
-
2088
-
2089
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
2090
-
2091
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2092
-
2093
- 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); } }
2094
-
2095
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
2096
-
2097
- 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
2098
-
2099
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function () { 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); }; }
2100
-
2101
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
2102
-
2103
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2104
-
2105
- function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
2106
-
2107
- function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
2108
-
2109
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
2110
-
2111
- function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
2112
-
2113
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
2114
-
2115
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
2116
-
2117
- var __rest = this && this.__rest || function (s, e) {
2118
- var t = {};
2119
-
2120
- for (var p in s) {
2121
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
2122
- }
2123
-
2124
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
2125
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
2126
- }
2127
- return t;
2128
- };
2129
-
2130
- Object.defineProperty(exports, "__esModule", {
2131
- value: true
2132
- });
2133
- exports.convert = exports.errors = exports.Unavailable = exports.BadGateway = exports.NotImplemented = exports.GeneralError = exports.TooManyRequests = exports.Unprocessable = exports.LengthRequired = exports.Gone = exports.Conflict = exports.Timeout = exports.NotAcceptable = exports.MethodNotAllowed = exports.NotFound = exports.Forbidden = exports.PaymentError = exports.NotAuthenticated = exports.BadRequest = exports.FeathersError = void 0;
2134
-
2135
- var FeathersError = /*#__PURE__*/function (_Error) {
2136
- _inherits(FeathersError, _Error);
2137
-
2138
- var _super = _createSuper(FeathersError);
2139
-
2140
- function FeathersError(err, name, code, className, _data) {
2141
- var _this;
2142
-
2143
- _classCallCheck(this, FeathersError);
2144
-
2145
- var msg = typeof err === 'string' ? err : 'Error';
2146
- var properties = {
2147
- name: name,
2148
- code: code,
2149
- className: className,
2150
- type: 'FeathersError'
2151
- };
2152
-
2153
- if (Array.isArray(_data)) {
2154
- properties.data = _data;
2155
- } else if (_typeof(err) === 'object' || _data !== undefined) {
2156
- var _a = _typeof(err) === 'object' ? err : _data,
2157
- message = _a.message,
2158
- errors = _a.errors,
2159
- rest = __rest(_a, ["message", "errors"]);
2160
-
2161
- msg = message || msg;
2162
- properties.errors = errors;
2163
- properties.data = rest;
2164
- }
2165
-
2166
- _this = _super.call(this, msg);
2167
- Object.assign(_assertThisInitialized(_this), properties);
2168
- return _this;
2169
- }
2170
-
2171
- _createClass(FeathersError, [{
2172
- key: "toJSON",
2173
- value: function toJSON() {
2174
- var result = {
2175
- name: this.name,
2176
- message: this.message,
2177
- code: this.code,
2178
- className: this.className
2179
- };
2180
-
2181
- if (this.data !== undefined) {
2182
- result.data = this.data;
2183
- }
2184
-
2185
- if (this.errors !== undefined) {
2186
- result.errors = this.errors;
2187
- }
2188
-
2189
- return result;
2190
- }
2191
- }]);
2192
-
2193
- return FeathersError;
2194
- }( /*#__PURE__*/_wrapNativeSuper(Error));
2195
-
2196
- exports.FeathersError = FeathersError;
2197
-
2198
- var BadRequest = /*#__PURE__*/function (_FeathersError) {
2199
- _inherits(BadRequest, _FeathersError);
2200
-
2201
- var _super2 = _createSuper(BadRequest);
2202
-
2203
- function BadRequest(message, data) {
2204
- _classCallCheck(this, BadRequest);
2205
-
2206
- return _super2.call(this, message, 'BadRequest', 400, 'bad-request', data);
2207
- }
2208
-
2209
- return BadRequest;
2210
- }(FeathersError);
2211
-
2212
- exports.BadRequest = BadRequest; // 401 - Not Authenticated
2213
-
2214
- var NotAuthenticated = /*#__PURE__*/function (_FeathersError2) {
2215
- _inherits(NotAuthenticated, _FeathersError2);
2216
-
2217
- var _super3 = _createSuper(NotAuthenticated);
2218
-
2219
- function NotAuthenticated(message, data) {
2220
- _classCallCheck(this, NotAuthenticated);
2221
-
2222
- return _super3.call(this, message, 'NotAuthenticated', 401, 'not-authenticated', data);
2223
- }
2224
-
2225
- return NotAuthenticated;
2226
- }(FeathersError);
2227
-
2228
- exports.NotAuthenticated = NotAuthenticated; // 402 - Payment Error
2229
-
2230
- var PaymentError = /*#__PURE__*/function (_FeathersError3) {
2231
- _inherits(PaymentError, _FeathersError3);
2232
-
2233
- var _super4 = _createSuper(PaymentError);
2234
-
2235
- function PaymentError(message, data) {
2236
- _classCallCheck(this, PaymentError);
2237
-
2238
- return _super4.call(this, message, 'PaymentError', 402, 'payment-error', data);
2239
- }
2240
-
2241
- return PaymentError;
2242
- }(FeathersError);
2243
-
2244
- exports.PaymentError = PaymentError; // 403 - Forbidden
2245
-
2246
- var Forbidden = /*#__PURE__*/function (_FeathersError4) {
2247
- _inherits(Forbidden, _FeathersError4);
2248
-
2249
- var _super5 = _createSuper(Forbidden);
2250
-
2251
- function Forbidden(message, data) {
2252
- _classCallCheck(this, Forbidden);
2253
-
2254
- return _super5.call(this, message, 'Forbidden', 403, 'forbidden', data);
2255
- }
2256
-
2257
- return Forbidden;
2258
- }(FeathersError);
2259
-
2260
- exports.Forbidden = Forbidden; // 404 - Not Found
2261
-
2262
- var NotFound = /*#__PURE__*/function (_FeathersError5) {
2263
- _inherits(NotFound, _FeathersError5);
2264
-
2265
- var _super6 = _createSuper(NotFound);
2266
-
2267
- function NotFound(message, data) {
2268
- _classCallCheck(this, NotFound);
2269
-
2270
- return _super6.call(this, message, 'NotFound', 404, 'not-found', data);
2271
- }
2272
-
2273
- return NotFound;
2274
- }(FeathersError);
2275
-
2276
- exports.NotFound = NotFound; // 405 - Method Not Allowed
2277
-
2278
- var MethodNotAllowed = /*#__PURE__*/function (_FeathersError6) {
2279
- _inherits(MethodNotAllowed, _FeathersError6);
2280
-
2281
- var _super7 = _createSuper(MethodNotAllowed);
2282
-
2283
- function MethodNotAllowed(message, data) {
2284
- _classCallCheck(this, MethodNotAllowed);
2285
-
2286
- return _super7.call(this, message, 'MethodNotAllowed', 405, 'method-not-allowed', data);
2287
- }
2288
-
2289
- return MethodNotAllowed;
2290
- }(FeathersError);
2291
-
2292
- exports.MethodNotAllowed = MethodNotAllowed; // 406 - Not Acceptable
2293
-
2294
- var NotAcceptable = /*#__PURE__*/function (_FeathersError7) {
2295
- _inherits(NotAcceptable, _FeathersError7);
2296
-
2297
- var _super8 = _createSuper(NotAcceptable);
2298
-
2299
- function NotAcceptable(message, data) {
2300
- _classCallCheck(this, NotAcceptable);
2301
-
2302
- return _super8.call(this, message, 'NotAcceptable', 406, 'not-acceptable', data);
2303
- }
2304
-
2305
- return NotAcceptable;
2306
- }(FeathersError);
2307
-
2308
- exports.NotAcceptable = NotAcceptable; // 408 - Timeout
2309
-
2310
- var Timeout = /*#__PURE__*/function (_FeathersError8) {
2311
- _inherits(Timeout, _FeathersError8);
2312
-
2313
- var _super9 = _createSuper(Timeout);
2314
-
2315
- function Timeout(message, data) {
2316
- _classCallCheck(this, Timeout);
2317
-
2318
- return _super9.call(this, message, 'Timeout', 408, 'timeout', data);
2319
- }
2320
-
2321
- return Timeout;
2322
- }(FeathersError);
2323
-
2324
- exports.Timeout = Timeout; // 409 - Conflict
2325
-
2326
- var Conflict = /*#__PURE__*/function (_FeathersError9) {
2327
- _inherits(Conflict, _FeathersError9);
2328
-
2329
- var _super10 = _createSuper(Conflict);
2330
-
2331
- function Conflict(message, data) {
2332
- _classCallCheck(this, Conflict);
2333
-
2334
- return _super10.call(this, message, 'Conflict', 409, 'conflict', data);
2335
- }
2336
-
2337
- return Conflict;
2338
- }(FeathersError);
2339
-
2340
- exports.Conflict = Conflict; // 410 - Gone
2341
-
2342
- var Gone = /*#__PURE__*/function (_FeathersError10) {
2343
- _inherits(Gone, _FeathersError10);
2344
-
2345
- var _super11 = _createSuper(Gone);
2346
-
2347
- function Gone(message, data) {
2348
- _classCallCheck(this, Gone);
2349
-
2350
- return _super11.call(this, message, 'Gone', 410, 'gone', data);
2351
- }
2352
-
2353
- return Gone;
2354
- }(FeathersError);
2355
-
2356
- exports.Gone = Gone; // 411 - Length Required
2357
-
2358
- var LengthRequired = /*#__PURE__*/function (_FeathersError11) {
2359
- _inherits(LengthRequired, _FeathersError11);
2360
-
2361
- var _super12 = _createSuper(LengthRequired);
2362
-
2363
- function LengthRequired(message, data) {
2364
- _classCallCheck(this, LengthRequired);
2365
-
2366
- return _super12.call(this, message, 'LengthRequired', 411, 'length-required', data);
2367
- }
2368
-
2369
- return LengthRequired;
2370
- }(FeathersError);
2371
-
2372
- exports.LengthRequired = LengthRequired; // 422 Unprocessable
2373
-
2374
- var Unprocessable = /*#__PURE__*/function (_FeathersError12) {
2375
- _inherits(Unprocessable, _FeathersError12);
2376
-
2377
- var _super13 = _createSuper(Unprocessable);
2378
-
2379
- function Unprocessable(message, data) {
2380
- _classCallCheck(this, Unprocessable);
2381
-
2382
- return _super13.call(this, message, 'Unprocessable', 422, 'unprocessable', data);
2383
- }
2384
-
2385
- return Unprocessable;
2386
- }(FeathersError);
2387
-
2388
- exports.Unprocessable = Unprocessable; // 429 Too Many Requests
2389
-
2390
- var TooManyRequests = /*#__PURE__*/function (_FeathersError13) {
2391
- _inherits(TooManyRequests, _FeathersError13);
2392
-
2393
- var _super14 = _createSuper(TooManyRequests);
2394
-
2395
- function TooManyRequests(message, data) {
2396
- _classCallCheck(this, TooManyRequests);
2397
-
2398
- return _super14.call(this, message, 'TooManyRequests', 429, 'too-many-requests', data);
2399
- }
2400
-
2401
- return TooManyRequests;
2402
- }(FeathersError);
2403
-
2404
- exports.TooManyRequests = TooManyRequests; // 500 - General Error
2405
-
2406
- var GeneralError = /*#__PURE__*/function (_FeathersError14) {
2407
- _inherits(GeneralError, _FeathersError14);
2408
-
2409
- var _super15 = _createSuper(GeneralError);
2410
-
2411
- function GeneralError(message, data) {
2412
- _classCallCheck(this, GeneralError);
2413
-
2414
- return _super15.call(this, message, 'GeneralError', 500, 'general-error', data);
2415
- }
2416
-
2417
- return GeneralError;
2418
- }(FeathersError);
2419
-
2420
- exports.GeneralError = GeneralError; // 501 - Not Implemented
2421
-
2422
- var NotImplemented = /*#__PURE__*/function (_FeathersError15) {
2423
- _inherits(NotImplemented, _FeathersError15);
2424
-
2425
- var _super16 = _createSuper(NotImplemented);
2426
-
2427
- function NotImplemented(message, data) {
2428
- _classCallCheck(this, NotImplemented);
2429
-
2430
- return _super16.call(this, message, 'NotImplemented', 501, 'not-implemented', data);
2431
- }
2432
-
2433
- return NotImplemented;
2434
- }(FeathersError);
2435
-
2436
- exports.NotImplemented = NotImplemented; // 502 - Bad Gateway
2437
-
2438
- var BadGateway = /*#__PURE__*/function (_FeathersError16) {
2439
- _inherits(BadGateway, _FeathersError16);
2440
-
2441
- var _super17 = _createSuper(BadGateway);
2442
-
2443
- function BadGateway(message, data) {
2444
- _classCallCheck(this, BadGateway);
2445
-
2446
- return _super17.call(this, message, 'BadGateway', 502, 'bad-gateway', data);
2447
- }
2448
-
2449
- return BadGateway;
2450
- }(FeathersError);
2451
-
2452
- exports.BadGateway = BadGateway; // 503 - Unavailable
2453
-
2454
- var Unavailable = /*#__PURE__*/function (_FeathersError17) {
2455
- _inherits(Unavailable, _FeathersError17);
2456
-
2457
- var _super18 = _createSuper(Unavailable);
2458
-
2459
- function Unavailable(message, data) {
2460
- _classCallCheck(this, Unavailable);
2461
-
2462
- return _super18.call(this, message, 'Unavailable', 503, 'unavailable', data);
2463
- }
2464
-
2465
- return Unavailable;
2466
- }(FeathersError);
2467
-
2468
- exports.Unavailable = Unavailable;
2469
- exports.errors = {
2470
- FeathersError: FeathersError,
2471
- BadRequest: BadRequest,
2472
- NotAuthenticated: NotAuthenticated,
2473
- PaymentError: PaymentError,
2474
- Forbidden: Forbidden,
2475
- NotFound: NotFound,
2476
- MethodNotAllowed: MethodNotAllowed,
2477
- NotAcceptable: NotAcceptable,
2478
- Timeout: Timeout,
2479
- Conflict: Conflict,
2480
- LengthRequired: LengthRequired,
2481
- Unprocessable: Unprocessable,
2482
- TooManyRequests: TooManyRequests,
2483
- GeneralError: GeneralError,
2484
- NotImplemented: NotImplemented,
2485
- BadGateway: BadGateway,
2486
- Unavailable: Unavailable,
2487
- 400: BadRequest,
2488
- 401: NotAuthenticated,
2489
- 402: PaymentError,
2490
- 403: Forbidden,
2491
- 404: NotFound,
2492
- 405: MethodNotAllowed,
2493
- 406: NotAcceptable,
2494
- 408: Timeout,
2495
- 409: Conflict,
2496
- 410: Gone,
2497
- 411: LengthRequired,
2498
- 422: Unprocessable,
2499
- 429: TooManyRequests,
2500
- 500: GeneralError,
2501
- 501: NotImplemented,
2502
- 502: BadGateway,
2503
- 503: Unavailable
2504
- };
2505
-
2506
- function convert(error) {
2507
- if (!error) {
2508
- return error;
2509
- }
2510
-
2511
- var FeathersError = exports.errors[error.name];
2512
- var result = FeathersError ? new FeathersError(error.message, error.data) : new Error(error.message || error);
2513
-
2514
- if (_typeof(error) === 'object') {
2515
- Object.assign(result, error);
2516
- }
2517
-
2518
- return result;
2519
- }
2520
-
2521
- exports.convert = convert;
2522
-
2523
- /***/ }),
2524
-
2525
- /***/ "../rest-client/lib/angular-http-client.js":
2526
- /*!*************************************************!*\
2527
- !*** ../rest-client/lib/angular-http-client.js ***!
2528
- \*************************************************/
2529
- /*! no static exports found */
2530
- /***/ (function(module, exports, __webpack_require__) {
2531
-
2532
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
2533
-
2534
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2535
-
2536
- 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); } }
2537
-
2538
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
2539
-
2540
- 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
2541
-
2542
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
2543
-
2544
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function () { 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); }; }
2545
-
2546
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
2547
-
2548
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2549
-
2550
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
2551
-
2552
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
2553
-
2554
- var Base = __webpack_require__(/*! ./base */ "../rest-client/lib/base.js");
2555
-
2556
- var AngularHttpService = /*#__PURE__*/function (_Base) {
2557
- _inherits(AngularHttpService, _Base);
2558
-
2559
- var _super = _createSuper(AngularHttpService);
2560
-
2561
- function AngularHttpService() {
2562
- _classCallCheck(this, AngularHttpService);
2563
-
2564
- return _super.apply(this, arguments);
2565
- }
2566
-
2567
- _createClass(AngularHttpService, [{
2568
- key: "request",
2569
- value: function request(options, params) {
2570
- var httpClient = this.connection;
2571
- var HttpHeaders = this.options.HttpHeaders;
2572
-
2573
- if (!httpClient || !HttpHeaders) {
2574
- throw new Error("Please pass angular's 'httpClient' (instance) and and object with 'HttpHeaders' (class) to feathers-rest");
2575
- }
2576
-
2577
- var url = options.url;
2578
- var _params$connection = params.connection,
2579
- connection = _params$connection === void 0 ? {} : _params$connection;
2580
- var headers = new HttpHeaders(Object.assign({
2581
- Accept: 'application/json'
2582
- }, this.options.headers, options.headers, connection.headers));
2583
- var requestOptions = Object.assign({
2584
- // method: options.method,
2585
- body: options.body
2586
- }, params.connection, {
2587
- headers: headers
2588
- });
2589
- return new Promise(function (resolve, reject) {
2590
- httpClient.request(options.method, url, requestOptions).subscribe(resolve, reject);
2591
- }).catch(function (error) {
2592
- var e = error.error;
2593
-
2594
- if (e) {
2595
- throw typeof e === 'string' ? JSON.parse(e) : e;
2596
- }
2597
-
2598
- throw error;
2599
- });
2600
- }
2601
- }]);
2602
-
2603
- return AngularHttpService;
2604
- }(Base);
2605
-
2606
- module.exports = AngularHttpService;
2607
-
2608
- /***/ }),
2609
-
2610
- /***/ "../rest-client/lib/angular.js":
2611
- /*!*************************************!*\
2612
- !*** ../rest-client/lib/angular.js ***!
2613
- \*************************************/
2614
- /*! no static exports found */
2615
- /***/ (function(module, exports, __webpack_require__) {
2616
-
2617
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
2618
-
2619
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2620
-
2621
- 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); } }
2622
-
2623
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
2624
-
2625
- 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
2626
-
2627
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
2628
-
2629
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function () { 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); }; }
2630
-
2631
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
2632
-
2633
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2634
-
2635
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
2636
-
2637
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
2638
-
2639
- var Base = __webpack_require__(/*! ./base */ "../rest-client/lib/base.js");
2640
-
2641
- var AngularService = /*#__PURE__*/function (_Base) {
2642
- _inherits(AngularService, _Base);
2643
-
2644
- var _super = _createSuper(AngularService);
2645
-
2646
- function AngularService() {
2647
- _classCallCheck(this, AngularService);
2648
-
2649
- return _super.apply(this, arguments);
2650
- }
2651
-
2652
- _createClass(AngularService, [{
2653
- key: "request",
2654
- value: function request(options, params) {
2655
- var http = this.connection;
2656
- var Headers = this.options.Headers;
2657
-
2658
- if (!http || !Headers) {
2659
- throw new Error("Please pass angular's 'http' (instance) and and object with 'Headers' (class) to feathers-rest");
2660
- }
2661
-
2662
- var url = options.url;
2663
- var _params$connection = params.connection,
2664
- connection = _params$connection === void 0 ? {} : _params$connection;
2665
- var headers = new Headers(Object.assign({
2666
- Accept: 'application/json'
2667
- }, this.options.headers, options.headers, connection.headers));
2668
- var requestOptions = Object.assign({
2669
- method: options.method,
2670
- body: options.body
2671
- }, connection, {
2672
- headers: headers
2673
- });
2674
- return new Promise(function (resolve, reject) {
2675
- http.request(url, requestOptions).subscribe(resolve, reject);
2676
- }).then(function (res) {
2677
- return res.json();
2678
- }).catch(function (error) {
2679
- var response = error.response || error;
2680
- throw response instanceof Error ? response : response.json() || response;
2681
- });
2682
- }
2683
- }]);
2684
-
2685
- return AngularService;
2686
- }(Base);
2687
-
2688
- module.exports = AngularService;
2689
-
2690
- /***/ }),
2691
-
2692
- /***/ "../rest-client/lib/axios.js":
2693
- /*!***********************************!*\
2694
- !*** ../rest-client/lib/axios.js ***!
2695
- \***********************************/
2696
- /*! no static exports found */
2697
- /***/ (function(module, exports, __webpack_require__) {
2698
-
2699
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
2700
-
2701
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2702
-
2703
- 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); } }
2704
-
2705
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
2706
-
2707
- 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
2708
-
2709
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
2710
-
2711
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function () { 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); }; }
2712
-
2713
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
2714
-
2715
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2716
-
2717
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
2718
-
2719
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
2720
-
2721
- var Base = __webpack_require__(/*! ./base */ "../rest-client/lib/base.js");
2722
-
2723
- var AxiosService = /*#__PURE__*/function (_Base) {
2724
- _inherits(AxiosService, _Base);
2725
-
2726
- var _super = _createSuper(AxiosService);
2727
-
2728
- function AxiosService() {
2729
- _classCallCheck(this, AxiosService);
2730
-
2731
- return _super.apply(this, arguments);
2732
- }
2733
-
2734
- _createClass(AxiosService, [{
2735
- key: "request",
2736
- value: function request(options, params) {
2737
- var config = Object.assign({
2738
- url: options.url,
2739
- method: options.method,
2740
- data: options.body,
2741
- headers: Object.assign({
2742
- Accept: 'application/json'
2743
- }, this.options.headers, options.headers)
2744
- }, params.connection);
2745
- return this.connection.request(config).then(function (res) {
2746
- return res.data;
2747
- }).catch(function (error) {
2748
- var response = error.response || error;
2749
- throw response instanceof Error ? response : response.data || response;
2750
- });
2751
- }
2752
- }]);
2753
-
2754
- return AxiosService;
2755
- }(Base);
2756
-
2757
- module.exports = AxiosService;
2758
-
2759
- /***/ }),
2760
-
2761
- /***/ "../rest-client/lib/base.js":
2762
- /*!**********************************!*\
2763
- !*** ../rest-client/lib/base.js ***!
2764
- \**********************************/
2765
- /*! no static exports found */
2766
- /***/ (function(module, exports, __webpack_require__) {
2767
-
2768
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2769
-
2770
- 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); } }
2771
-
2772
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
2773
-
2774
- var qs = __webpack_require__(/*! qs */ "../../node_modules/qs/lib/index.js");
2775
-
2776
- var _require = __webpack_require__(/*! @feathersjs/errors */ "../errors/lib/index.js"),
2777
- Unavailable = _require.Unavailable;
2778
-
2779
- var _require2 = __webpack_require__(/*! @feathersjs/commons */ "../commons/lib/index.js"),
2780
- _ = _require2._;
2781
-
2782
- var _require3 = __webpack_require__(/*! @feathersjs/commons */ "../commons/lib/index.js"),
2783
- stripSlashes = _require3.stripSlashes;
2784
-
2785
- var _require4 = __webpack_require__(/*! @feathersjs/errors */ "../errors/lib/index.js"),
2786
- convert = _require4.convert;
2787
-
2788
- function toError(error) {
2789
- if (error.code === 'ECONNREFUSED') {
2790
- throw new Unavailable(error.message, _.pick(error, 'address', 'port', 'config'));
2791
- }
2792
-
2793
- throw convert(error);
2794
- }
2795
-
2796
- var Base = /*#__PURE__*/function () {
2797
- function Base(settings) {
2798
- _classCallCheck(this, Base);
2799
-
2800
- this.name = stripSlashes(settings.name);
2801
- this.options = settings.options;
2802
- this.connection = settings.connection;
2803
- this.base = "".concat(settings.base, "/").concat(this.name);
2804
- }
2805
-
2806
- _createClass(Base, [{
2807
- key: "makeUrl",
2808
- value: function makeUrl(query, id) {
2809
- query = query || {};
2810
- var url = this.base;
2811
-
2812
- if (typeof id !== 'undefined' && id !== null) {
2813
- url += "/".concat(encodeURIComponent(id));
2814
- }
2815
-
2816
- return url + this.getQuery(query);
2817
- }
2818
- }, {
2819
- key: "getQuery",
2820
- value: function getQuery(query) {
2821
- if (Object.keys(query).length !== 0) {
2822
- var queryString = qs.stringify(query);
2823
- return "?".concat(queryString);
2824
- }
2825
-
2826
- return '';
2827
- }
2828
- }, {
2829
- key: "find",
2830
- value: function find() {
2831
- var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2832
- return this.request({
2833
- url: this.makeUrl(params.query),
2834
- method: 'GET',
2835
- headers: Object.assign({}, params.headers)
2836
- }, params).catch(toError);
2837
- }
2838
- }, {
2839
- key: "get",
2840
- value: function get(id) {
2841
- var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2842
-
2843
- if (typeof id === 'undefined') {
2844
- return Promise.reject(new Error("id for 'get' can not be undefined"));
2845
- }
2846
-
2847
- return this.request({
2848
- url: this.makeUrl(params.query, id),
2849
- method: 'GET',
2850
- headers: Object.assign({}, params.headers)
2851
- }, params).catch(toError);
2852
- }
2853
- }, {
2854
- key: "create",
2855
- value: function create(body) {
2856
- var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2857
- return this.request({
2858
- url: this.makeUrl(params.query),
2859
- body: body,
2860
- method: 'POST',
2861
- headers: Object.assign({
2862
- 'Content-Type': 'application/json'
2863
- }, params.headers)
2864
- }, params).catch(toError);
2865
- }
2866
- }, {
2867
- key: "update",
2868
- value: function update(id, body) {
2869
- var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
2870
-
2871
- if (typeof id === 'undefined') {
2872
- return Promise.reject(new Error("id for 'update' can not be undefined, only 'null' when updating multiple entries"));
2873
- }
2874
-
2875
- return this.request({
2876
- url: this.makeUrl(params.query, id),
2877
- body: body,
2878
- method: 'PUT',
2879
- headers: Object.assign({
2880
- 'Content-Type': 'application/json'
2881
- }, params.headers)
2882
- }, params).catch(toError);
2883
- }
2884
- }, {
2885
- key: "patch",
2886
- value: function patch(id, body) {
2887
- var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
2888
-
2889
- if (typeof id === 'undefined') {
2890
- return Promise.reject(new Error("id for 'patch' can not be undefined, only 'null' when updating multiple entries"));
2891
- }
2892
-
2893
- return this.request({
2894
- url: this.makeUrl(params.query, id),
2895
- body: body,
2896
- method: 'PATCH',
2897
- headers: Object.assign({
2898
- 'Content-Type': 'application/json'
2899
- }, params.headers)
2900
- }, params).catch(toError);
2901
- }
2902
- }, {
2903
- key: "remove",
2904
- value: function remove(id) {
2905
- var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2906
-
2907
- if (typeof id === 'undefined') {
2908
- return Promise.reject(new Error("id for 'remove' can not be undefined, only 'null' when removing multiple entries"));
2909
- }
2910
-
2911
- return this.request({
2912
- url: this.makeUrl(params.query, id),
2913
- method: 'DELETE',
2914
- headers: Object.assign({}, params.headers)
2915
- }, params).catch(toError);
2916
- }
2917
- }]);
2918
-
2919
- return Base;
2920
- }();
2921
-
2922
- module.exports = Base;
2923
-
2924
- /***/ }),
2925
-
2926
- /***/ "../rest-client/lib/fetch.js":
2927
- /*!***********************************!*\
2928
- !*** ../rest-client/lib/fetch.js ***!
2929
- \***********************************/
2930
- /*! no static exports found */
2931
- /***/ (function(module, exports, __webpack_require__) {
2932
-
2933
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
2934
-
2935
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2936
-
2937
- 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); } }
2938
-
2939
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
2940
-
2941
- 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
2942
-
2943
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
2944
-
2945
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function () { 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); }; }
2946
-
2947
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
2948
-
2949
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2950
-
2951
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
2952
-
2953
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
2954
-
2955
- var Base = __webpack_require__(/*! ./base */ "../rest-client/lib/base.js");
2956
-
2957
- var FetchService = /*#__PURE__*/function (_Base) {
2958
- _inherits(FetchService, _Base);
2959
-
2960
- var _super = _createSuper(FetchService);
2961
-
2962
- function FetchService() {
2963
- _classCallCheck(this, FetchService);
2964
-
2965
- return _super.apply(this, arguments);
2966
- }
2967
-
2968
- _createClass(FetchService, [{
2969
- key: "request",
2970
- value: function request(options, params) {
2971
- var fetchOptions = Object.assign({}, options, params.connection);
2972
- fetchOptions.headers = Object.assign({
2973
- Accept: 'application/json'
2974
- }, this.options.headers, fetchOptions.headers);
2975
-
2976
- if (options.body) {
2977
- fetchOptions.body = JSON.stringify(options.body);
2978
- }
2979
-
2980
- var fetch = this.connection;
2981
- return fetch(options.url, fetchOptions).then(this.checkStatus).then(function (response) {
2982
- if (response.status === 204) {
2983
- return null;
2984
- }
2985
-
2986
- return response.json();
2987
- });
2988
- }
2989
- }, {
2990
- key: "checkStatus",
2991
- value: function checkStatus(response) {
2992
- if (response.ok) {
2993
- return response;
2994
- }
2995
-
2996
- return response.json().then(function (error) {
2997
- error.response = response;
2998
- throw error;
2999
- });
3000
- }
3001
- }]);
3002
-
3003
- return FetchService;
3004
- }(Base);
3005
-
3006
- module.exports = FetchService;
3007
-
3008
- /***/ }),
3009
-
3010
- /***/ "../rest-client/lib/index.js":
3011
- /*!***********************************!*\
3012
- !*** ../rest-client/lib/index.js ***!
3013
- \***********************************/
3014
- /*! no static exports found */
3015
- /***/ (function(module, exports, __webpack_require__) {
3016
-
3017
- var jQueryClient = __webpack_require__(/*! ./jquery */ "../rest-client/lib/jquery.js");
3018
-
3019
- var SuperagentClient = __webpack_require__(/*! ./superagent */ "../rest-client/lib/superagent.js");
3020
-
3021
- var FetchClient = __webpack_require__(/*! ./fetch */ "../rest-client/lib/fetch.js");
3022
-
3023
- var AxiosClient = __webpack_require__(/*! ./axios */ "../rest-client/lib/axios.js");
3024
-
3025
- var AngularClient = __webpack_require__(/*! ./angular */ "../rest-client/lib/angular.js");
3026
-
3027
- var Base = __webpack_require__(/*! ./base */ "../rest-client/lib/base.js");
3028
-
3029
- var AngularHttpClient = __webpack_require__(/*! ./angular-http-client */ "../rest-client/lib/angular-http-client.js");
3030
-
3031
- var transports = {
3032
- jquery: jQueryClient,
3033
- superagent: SuperagentClient,
3034
- fetch: FetchClient,
3035
- axios: AxiosClient,
3036
- angular: AngularClient,
3037
- angularHttpClient: AngularHttpClient
3038
- };
3039
-
3040
- function restClient() {
3041
- var base = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
3042
- var result = {
3043
- Base: Base
3044
- };
3045
- Object.keys(transports).forEach(function (key) {
3046
- result[key] = function (connection) {
3047
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3048
- var Service = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : transports[key];
3049
-
3050
- if (!connection) {
3051
- throw new Error("".concat(key, " has to be provided to feathers-rest"));
3052
- }
3053
-
3054
- if (typeof options === 'function') {
3055
- Service = options;
3056
- options = {};
3057
- }
3058
-
3059
- var defaultService = function defaultService(name) {
3060
- return new Service({
3061
- base: base,
3062
- name: name,
3063
- connection: connection,
3064
- options: options
3065
- });
3066
- };
3067
-
3068
- var initialize = function initialize(app) {
3069
- if (typeof app.defaultService === 'function') {
3070
- throw new Error('Only one default client provider can be configured');
3071
- }
3072
-
3073
- app.rest = connection;
3074
- app.defaultService = defaultService;
3075
- };
3076
-
3077
- initialize.Service = Service;
3078
- initialize.service = defaultService;
3079
- return initialize;
3080
- };
3081
- });
3082
- return result;
3083
- }
3084
-
3085
- module.exports = Object.assign(restClient, {
3086
- SuperagentClient: SuperagentClient,
3087
- FetchClient: FetchClient,
3088
- jQueryClient: jQueryClient,
3089
- AxiosClient: AxiosClient,
3090
- AngularClient: AngularClient,
3091
- AngularHttpClient: AngularHttpClient
3092
- });
3093
- module.exports.default = restClient;
3094
-
3095
- /***/ }),
3096
-
3097
- /***/ "../rest-client/lib/jquery.js":
3098
- /*!************************************!*\
3099
- !*** ../rest-client/lib/jquery.js ***!
3100
- \************************************/
3101
- /*! no static exports found */
3102
- /***/ (function(module, exports, __webpack_require__) {
3103
-
3104
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
3105
-
3106
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3107
-
3108
- 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); } }
3109
-
3110
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
3111
-
3112
- 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
3113
-
3114
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
3115
-
3116
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function () { 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); }; }
3117
-
3118
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
3119
-
3120
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
3121
-
3122
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
3123
-
3124
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
3125
-
3126
- var Base = __webpack_require__(/*! ./base */ "../rest-client/lib/base.js");
3127
-
3128
- var JQueryService = /*#__PURE__*/function (_Base) {
3129
- _inherits(JQueryService, _Base);
3130
-
3131
- var _super = _createSuper(JQueryService);
3132
-
3133
- function JQueryService() {
3134
- _classCallCheck(this, JQueryService);
3135
-
3136
- return _super.apply(this, arguments);
3137
- }
3138
-
3139
- _createClass(JQueryService, [{
3140
- key: "request",
3141
- value: function request(options, params) {
3142
- var _this = this;
3143
-
3144
- var _params$connection = params.connection,
3145
- connection = _params$connection === void 0 ? {} : _params$connection;
3146
- var headers = Object.assign({}, options.headers, this.options.headers, connection.headers);
3147
- var opts = Object.assign({
3148
- dataType: options.type || 'json'
3149
- }, connection, options, {
3150
- headers: headers
3151
- });
3152
-
3153
- if (options.body) {
3154
- opts.data = JSON.stringify(options.body);
3155
- opts.contentType = 'application/json';
3156
- }
3157
-
3158
- delete opts.type;
3159
- delete opts.body;
3160
- return new Promise(function (resolve, reject) {
3161
- _this.connection.ajax(opts).then(resolve, function (xhr) {
3162
- var error = xhr.responseText;
3163
-
3164
- try {
3165
- error = JSON.parse(error);
3166
- } catch (e) {
3167
- error = new Error(xhr.responseText);
3168
- }
3169
-
3170
- error.xhr = error.response = xhr;
3171
- reject(error);
3172
- });
3173
- });
3174
- }
3175
- }]);
3176
-
3177
- return JQueryService;
3178
- }(Base);
3179
-
3180
- module.exports = JQueryService;
3181
-
3182
- /***/ }),
3183
-
3184
- /***/ "../rest-client/lib/superagent.js":
3185
- /*!****************************************!*\
3186
- !*** ../rest-client/lib/superagent.js ***!
3187
- \****************************************/
3188
- /*! no static exports found */
3189
- /***/ (function(module, exports, __webpack_require__) {
3190
-
3191
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
3192
-
3193
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3194
-
3195
- 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); } }
3196
-
3197
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
3198
-
3199
- 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
3200
-
3201
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
3202
-
3203
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function () { 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); }; }
3204
-
3205
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
3206
-
3207
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
3208
-
3209
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
3210
-
3211
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
3212
-
3213
- var Base = __webpack_require__(/*! ./base */ "../rest-client/lib/base.js");
3214
-
3215
- var SuperagentService = /*#__PURE__*/function (_Base) {
3216
- _inherits(SuperagentService, _Base);
3217
-
3218
- var _super = _createSuper(SuperagentService);
3219
-
3220
- function SuperagentService() {
3221
- _classCallCheck(this, SuperagentService);
3222
-
3223
- return _super.apply(this, arguments);
3224
- }
3225
-
3226
- _createClass(SuperagentService, [{
3227
- key: "request",
3228
- value: function request(options, params) {
3229
- 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');
3230
- return new Promise(function (resolve, reject) {
3231
- superagent.set(options.headers);
3232
-
3233
- if (options.body) {
3234
- superagent.send(options.body);
3235
- }
3236
-
3237
- superagent.end(function (error, res) {
3238
- if (error) {
3239
- try {
3240
- var response = error.response;
3241
- error = JSON.parse(error.response.text);
3242
- error.response = response;
3243
- } catch (e) {}
3244
-
3245
- return reject(error);
3246
- }
3247
-
3248
- resolve(res && res.body);
3249
- });
3250
- });
3251
- }
3252
- }]);
3253
-
3254
- return SuperagentService;
3255
- }(Base);
3256
-
3257
- module.exports = SuperagentService;
3258
-
3259
- /***/ }),
3260
-
3261
- /***/ "./src/rest.js":
3262
- /*!*********************!*\
3263
- !*** ./src/rest.js ***!
3264
- \*********************/
3265
- /*! no static exports found */
3266
- /***/ (function(module, exports, __webpack_require__) {
3267
-
3268
- module.exports = __webpack_require__(/*! @feathersjs/rest-client */ "../rest-client/lib/index.js");
3269
-
3270
- /***/ }),
3271
-
3272
- /***/ 0:
3273
- /*!*******************************************************!*\
3274
- !*** multi regenerator-runtime/runtime ./src/rest.js ***!
3275
- \*******************************************************/
3276
- /*! no static exports found */
3277
- /***/ (function(module, exports, __webpack_require__) {
3278
-
3279
- __webpack_require__(/*! regenerator-runtime/runtime */"../../node_modules/regenerator-runtime/runtime.js");
3280
- module.exports = __webpack_require__(/*! ./src/rest.js */"./src/rest.js");
3281
-
3282
-
3283
- /***/ })
3284
-
3285
- /******/ });
3286
- });
3287
- //# sourceMappingURL=rest.js.map