@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
@@ -1,2242 +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/regenerator-runtime/runtime.js":
295
- /*!************************************************************************************************!*\
296
- !*** /Users/daffl/Development/feathersjs/feathers/node_modules/regenerator-runtime/runtime.js ***!
297
- \************************************************************************************************/
298
- /*! no static exports found */
299
- /***/ (function(module, exports, __webpack_require__) {
300
-
301
- /**
302
- * Copyright (c) 2014-present, Facebook, Inc.
303
- *
304
- * This source code is licensed under the MIT license found in the
305
- * LICENSE file in the root directory of this source tree.
306
- */
307
-
308
- var runtime = (function (exports) {
309
- "use strict";
310
-
311
- var Op = Object.prototype;
312
- var hasOwn = Op.hasOwnProperty;
313
- var undefined; // More compressible than void 0.
314
- var $Symbol = typeof Symbol === "function" ? Symbol : {};
315
- var iteratorSymbol = $Symbol.iterator || "@@iterator";
316
- var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
317
- var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
318
-
319
- function wrap(innerFn, outerFn, self, tryLocsList) {
320
- // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
321
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
322
- var generator = Object.create(protoGenerator.prototype);
323
- var context = new Context(tryLocsList || []);
324
-
325
- // The ._invoke method unifies the implementations of the .next,
326
- // .throw, and .return methods.
327
- generator._invoke = makeInvokeMethod(innerFn, self, context);
328
-
329
- return generator;
330
- }
331
- exports.wrap = wrap;
332
-
333
- // Try/catch helper to minimize deoptimizations. Returns a completion
334
- // record like context.tryEntries[i].completion. This interface could
335
- // have been (and was previously) designed to take a closure to be
336
- // invoked without arguments, but in all the cases we care about we
337
- // already have an existing method we want to call, so there's no need
338
- // to create a new function object. We can even get away with assuming
339
- // the method takes exactly one argument, since that happens to be true
340
- // in every case, so we don't have to touch the arguments object. The
341
- // only additional allocation required is the completion record, which
342
- // has a stable shape and so hopefully should be cheap to allocate.
343
- function tryCatch(fn, obj, arg) {
344
- try {
345
- return { type: "normal", arg: fn.call(obj, arg) };
346
- } catch (err) {
347
- return { type: "throw", arg: err };
348
- }
349
- }
350
-
351
- var GenStateSuspendedStart = "suspendedStart";
352
- var GenStateSuspendedYield = "suspendedYield";
353
- var GenStateExecuting = "executing";
354
- var GenStateCompleted = "completed";
355
-
356
- // Returning this object from the innerFn has the same effect as
357
- // breaking out of the dispatch switch statement.
358
- var ContinueSentinel = {};
359
-
360
- // Dummy constructor functions that we use as the .constructor and
361
- // .constructor.prototype properties for functions that return Generator
362
- // objects. For full spec compliance, you may wish to configure your
363
- // minifier not to mangle the names of these two functions.
364
- function Generator() {}
365
- function GeneratorFunction() {}
366
- function GeneratorFunctionPrototype() {}
367
-
368
- // This is a polyfill for %IteratorPrototype% for environments that
369
- // don't natively support it.
370
- var IteratorPrototype = {};
371
- IteratorPrototype[iteratorSymbol] = function () {
372
- return this;
373
- };
374
-
375
- var getProto = Object.getPrototypeOf;
376
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
377
- if (NativeIteratorPrototype &&
378
- NativeIteratorPrototype !== Op &&
379
- hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
380
- // This environment has a native %IteratorPrototype%; use it instead
381
- // of the polyfill.
382
- IteratorPrototype = NativeIteratorPrototype;
383
- }
384
-
385
- var Gp = GeneratorFunctionPrototype.prototype =
386
- Generator.prototype = Object.create(IteratorPrototype);
387
- GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
388
- GeneratorFunctionPrototype.constructor = GeneratorFunction;
389
- GeneratorFunctionPrototype[toStringTagSymbol] =
390
- GeneratorFunction.displayName = "GeneratorFunction";
391
-
392
- // Helper for defining the .next, .throw, and .return methods of the
393
- // Iterator interface in terms of a single ._invoke method.
394
- function defineIteratorMethods(prototype) {
395
- ["next", "throw", "return"].forEach(function(method) {
396
- prototype[method] = function(arg) {
397
- return this._invoke(method, arg);
398
- };
399
- });
400
- }
401
-
402
- exports.isGeneratorFunction = function(genFun) {
403
- var ctor = typeof genFun === "function" && genFun.constructor;
404
- return ctor
405
- ? ctor === GeneratorFunction ||
406
- // For the native GeneratorFunction constructor, the best we can
407
- // do is to check its .name property.
408
- (ctor.displayName || ctor.name) === "GeneratorFunction"
409
- : false;
410
- };
411
-
412
- exports.mark = function(genFun) {
413
- if (Object.setPrototypeOf) {
414
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
415
- } else {
416
- genFun.__proto__ = GeneratorFunctionPrototype;
417
- if (!(toStringTagSymbol in genFun)) {
418
- genFun[toStringTagSymbol] = "GeneratorFunction";
419
- }
420
- }
421
- genFun.prototype = Object.create(Gp);
422
- return genFun;
423
- };
424
-
425
- // Within the body of any async function, `await x` is transformed to
426
- // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
427
- // `hasOwn.call(value, "__await")` to determine if the yielded value is
428
- // meant to be awaited.
429
- exports.awrap = function(arg) {
430
- return { __await: arg };
431
- };
432
-
433
- function AsyncIterator(generator, PromiseImpl) {
434
- function invoke(method, arg, resolve, reject) {
435
- var record = tryCatch(generator[method], generator, arg);
436
- if (record.type === "throw") {
437
- reject(record.arg);
438
- } else {
439
- var result = record.arg;
440
- var value = result.value;
441
- if (value &&
442
- typeof value === "object" &&
443
- hasOwn.call(value, "__await")) {
444
- return PromiseImpl.resolve(value.__await).then(function(value) {
445
- invoke("next", value, resolve, reject);
446
- }, function(err) {
447
- invoke("throw", err, resolve, reject);
448
- });
449
- }
450
-
451
- return PromiseImpl.resolve(value).then(function(unwrapped) {
452
- // When a yielded Promise is resolved, its final value becomes
453
- // the .value of the Promise<{value,done}> result for the
454
- // current iteration.
455
- result.value = unwrapped;
456
- resolve(result);
457
- }, function(error) {
458
- // If a rejected Promise was yielded, throw the rejection back
459
- // into the async generator function so it can be handled there.
460
- return invoke("throw", error, resolve, reject);
461
- });
462
- }
463
- }
464
-
465
- var previousPromise;
466
-
467
- function enqueue(method, arg) {
468
- function callInvokeWithMethodAndArg() {
469
- return new PromiseImpl(function(resolve, reject) {
470
- invoke(method, arg, resolve, reject);
471
- });
472
- }
473
-
474
- return previousPromise =
475
- // If enqueue has been called before, then we want to wait until
476
- // all previous Promises have been resolved before calling invoke,
477
- // so that results are always delivered in the correct order. If
478
- // enqueue has not been called before, then it is important to
479
- // call invoke immediately, without waiting on a callback to fire,
480
- // so that the async generator function has the opportunity to do
481
- // any necessary setup in a predictable way. This predictability
482
- // is why the Promise constructor synchronously invokes its
483
- // executor callback, and why async functions synchronously
484
- // execute code before the first await. Since we implement simple
485
- // async functions in terms of async generators, it is especially
486
- // important to get this right, even though it requires care.
487
- previousPromise ? previousPromise.then(
488
- callInvokeWithMethodAndArg,
489
- // Avoid propagating failures to Promises returned by later
490
- // invocations of the iterator.
491
- callInvokeWithMethodAndArg
492
- ) : callInvokeWithMethodAndArg();
493
- }
494
-
495
- // Define the unified helper method that is used to implement .next,
496
- // .throw, and .return (see defineIteratorMethods).
497
- this._invoke = enqueue;
498
- }
499
-
500
- defineIteratorMethods(AsyncIterator.prototype);
501
- AsyncIterator.prototype[asyncIteratorSymbol] = function () {
502
- return this;
503
- };
504
- exports.AsyncIterator = AsyncIterator;
505
-
506
- // Note that simple async functions are implemented on top of
507
- // AsyncIterator objects; they just return a Promise for the value of
508
- // the final result produced by the iterator.
509
- exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
510
- if (PromiseImpl === void 0) PromiseImpl = Promise;
511
-
512
- var iter = new AsyncIterator(
513
- wrap(innerFn, outerFn, self, tryLocsList),
514
- PromiseImpl
515
- );
516
-
517
- return exports.isGeneratorFunction(outerFn)
518
- ? iter // If outerFn is a generator, return the full iterator.
519
- : iter.next().then(function(result) {
520
- return result.done ? result.value : iter.next();
521
- });
522
- };
523
-
524
- function makeInvokeMethod(innerFn, self, context) {
525
- var state = GenStateSuspendedStart;
526
-
527
- return function invoke(method, arg) {
528
- if (state === GenStateExecuting) {
529
- throw new Error("Generator is already running");
530
- }
531
-
532
- if (state === GenStateCompleted) {
533
- if (method === "throw") {
534
- throw arg;
535
- }
536
-
537
- // Be forgiving, per 25.3.3.3.3 of the spec:
538
- // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
539
- return doneResult();
540
- }
541
-
542
- context.method = method;
543
- context.arg = arg;
544
-
545
- while (true) {
546
- var delegate = context.delegate;
547
- if (delegate) {
548
- var delegateResult = maybeInvokeDelegate(delegate, context);
549
- if (delegateResult) {
550
- if (delegateResult === ContinueSentinel) continue;
551
- return delegateResult;
552
- }
553
- }
554
-
555
- if (context.method === "next") {
556
- // Setting context._sent for legacy support of Babel's
557
- // function.sent implementation.
558
- context.sent = context._sent = context.arg;
559
-
560
- } else if (context.method === "throw") {
561
- if (state === GenStateSuspendedStart) {
562
- state = GenStateCompleted;
563
- throw context.arg;
564
- }
565
-
566
- context.dispatchException(context.arg);
567
-
568
- } else if (context.method === "return") {
569
- context.abrupt("return", context.arg);
570
- }
571
-
572
- state = GenStateExecuting;
573
-
574
- var record = tryCatch(innerFn, self, context);
575
- if (record.type === "normal") {
576
- // If an exception is thrown from innerFn, we leave state ===
577
- // GenStateExecuting and loop back for another invocation.
578
- state = context.done
579
- ? GenStateCompleted
580
- : GenStateSuspendedYield;
581
-
582
- if (record.arg === ContinueSentinel) {
583
- continue;
584
- }
585
-
586
- return {
587
- value: record.arg,
588
- done: context.done
589
- };
590
-
591
- } else if (record.type === "throw") {
592
- state = GenStateCompleted;
593
- // Dispatch the exception by looping back around to the
594
- // context.dispatchException(context.arg) call above.
595
- context.method = "throw";
596
- context.arg = record.arg;
597
- }
598
- }
599
- };
600
- }
601
-
602
- // Call delegate.iterator[context.method](context.arg) and handle the
603
- // result, either by returning a { value, done } result from the
604
- // delegate iterator, or by modifying context.method and context.arg,
605
- // setting context.delegate to null, and returning the ContinueSentinel.
606
- function maybeInvokeDelegate(delegate, context) {
607
- var method = delegate.iterator[context.method];
608
- if (method === undefined) {
609
- // A .throw or .return when the delegate iterator has no .throw
610
- // method always terminates the yield* loop.
611
- context.delegate = null;
612
-
613
- if (context.method === "throw") {
614
- // Note: ["return"] must be used for ES3 parsing compatibility.
615
- if (delegate.iterator["return"]) {
616
- // If the delegate iterator has a return method, give it a
617
- // chance to clean up.
618
- context.method = "return";
619
- context.arg = undefined;
620
- maybeInvokeDelegate(delegate, context);
621
-
622
- if (context.method === "throw") {
623
- // If maybeInvokeDelegate(context) changed context.method from
624
- // "return" to "throw", let that override the TypeError below.
625
- return ContinueSentinel;
626
- }
627
- }
628
-
629
- context.method = "throw";
630
- context.arg = new TypeError(
631
- "The iterator does not provide a 'throw' method");
632
- }
633
-
634
- return ContinueSentinel;
635
- }
636
-
637
- var record = tryCatch(method, delegate.iterator, context.arg);
638
-
639
- if (record.type === "throw") {
640
- context.method = "throw";
641
- context.arg = record.arg;
642
- context.delegate = null;
643
- return ContinueSentinel;
644
- }
645
-
646
- var info = record.arg;
647
-
648
- if (! info) {
649
- context.method = "throw";
650
- context.arg = new TypeError("iterator result is not an object");
651
- context.delegate = null;
652
- return ContinueSentinel;
653
- }
654
-
655
- if (info.done) {
656
- // Assign the result of the finished delegate to the temporary
657
- // variable specified by delegate.resultName (see delegateYield).
658
- context[delegate.resultName] = info.value;
659
-
660
- // Resume execution at the desired location (see delegateYield).
661
- context.next = delegate.nextLoc;
662
-
663
- // If context.method was "throw" but the delegate handled the
664
- // exception, let the outer generator proceed normally. If
665
- // context.method was "next", forget context.arg since it has been
666
- // "consumed" by the delegate iterator. If context.method was
667
- // "return", allow the original .return call to continue in the
668
- // outer generator.
669
- if (context.method !== "return") {
670
- context.method = "next";
671
- context.arg = undefined;
672
- }
673
-
674
- } else {
675
- // Re-yield the result returned by the delegate method.
676
- return info;
677
- }
678
-
679
- // The delegate iterator is finished, so forget it and continue with
680
- // the outer generator.
681
- context.delegate = null;
682
- return ContinueSentinel;
683
- }
684
-
685
- // Define Generator.prototype.{next,throw,return} in terms of the
686
- // unified ._invoke helper method.
687
- defineIteratorMethods(Gp);
688
-
689
- Gp[toStringTagSymbol] = "Generator";
690
-
691
- // A Generator should always return itself as the iterator object when the
692
- // @@iterator function is called on it. Some browsers' implementations of the
693
- // iterator prototype chain incorrectly implement this, causing the Generator
694
- // object to not be returned from this call. This ensures that doesn't happen.
695
- // See https://github.com/facebook/regenerator/issues/274 for more details.
696
- Gp[iteratorSymbol] = function() {
697
- return this;
698
- };
699
-
700
- Gp.toString = function() {
701
- return "[object Generator]";
702
- };
703
-
704
- function pushTryEntry(locs) {
705
- var entry = { tryLoc: locs[0] };
706
-
707
- if (1 in locs) {
708
- entry.catchLoc = locs[1];
709
- }
710
-
711
- if (2 in locs) {
712
- entry.finallyLoc = locs[2];
713
- entry.afterLoc = locs[3];
714
- }
715
-
716
- this.tryEntries.push(entry);
717
- }
718
-
719
- function resetTryEntry(entry) {
720
- var record = entry.completion || {};
721
- record.type = "normal";
722
- delete record.arg;
723
- entry.completion = record;
724
- }
725
-
726
- function Context(tryLocsList) {
727
- // The root entry object (effectively a try statement without a catch
728
- // or a finally block) gives us a place to store values thrown from
729
- // locations where there is no enclosing try statement.
730
- this.tryEntries = [{ tryLoc: "root" }];
731
- tryLocsList.forEach(pushTryEntry, this);
732
- this.reset(true);
733
- }
734
-
735
- exports.keys = function(object) {
736
- var keys = [];
737
- for (var key in object) {
738
- keys.push(key);
739
- }
740
- keys.reverse();
741
-
742
- // Rather than returning an object with a next method, we keep
743
- // things simple and return the next function itself.
744
- return function next() {
745
- while (keys.length) {
746
- var key = keys.pop();
747
- if (key in object) {
748
- next.value = key;
749
- next.done = false;
750
- return next;
751
- }
752
- }
753
-
754
- // To avoid creating an additional object, we just hang the .value
755
- // and .done properties off the next function object itself. This
756
- // also ensures that the minifier will not anonymize the function.
757
- next.done = true;
758
- return next;
759
- };
760
- };
761
-
762
- function values(iterable) {
763
- if (iterable) {
764
- var iteratorMethod = iterable[iteratorSymbol];
765
- if (iteratorMethod) {
766
- return iteratorMethod.call(iterable);
767
- }
768
-
769
- if (typeof iterable.next === "function") {
770
- return iterable;
771
- }
772
-
773
- if (!isNaN(iterable.length)) {
774
- var i = -1, next = function next() {
775
- while (++i < iterable.length) {
776
- if (hasOwn.call(iterable, i)) {
777
- next.value = iterable[i];
778
- next.done = false;
779
- return next;
780
- }
781
- }
782
-
783
- next.value = undefined;
784
- next.done = true;
785
-
786
- return next;
787
- };
788
-
789
- return next.next = next;
790
- }
791
- }
792
-
793
- // Return an iterator with no values.
794
- return { next: doneResult };
795
- }
796
- exports.values = values;
797
-
798
- function doneResult() {
799
- return { value: undefined, done: true };
800
- }
801
-
802
- Context.prototype = {
803
- constructor: Context,
804
-
805
- reset: function(skipTempReset) {
806
- this.prev = 0;
807
- this.next = 0;
808
- // Resetting context._sent for legacy support of Babel's
809
- // function.sent implementation.
810
- this.sent = this._sent = undefined;
811
- this.done = false;
812
- this.delegate = null;
813
-
814
- this.method = "next";
815
- this.arg = undefined;
816
-
817
- this.tryEntries.forEach(resetTryEntry);
818
-
819
- if (!skipTempReset) {
820
- for (var name in this) {
821
- // Not sure about the optimal order of these conditions:
822
- if (name.charAt(0) === "t" &&
823
- hasOwn.call(this, name) &&
824
- !isNaN(+name.slice(1))) {
825
- this[name] = undefined;
826
- }
827
- }
828
- }
829
- },
830
-
831
- stop: function() {
832
- this.done = true;
833
-
834
- var rootEntry = this.tryEntries[0];
835
- var rootRecord = rootEntry.completion;
836
- if (rootRecord.type === "throw") {
837
- throw rootRecord.arg;
838
- }
839
-
840
- return this.rval;
841
- },
842
-
843
- dispatchException: function(exception) {
844
- if (this.done) {
845
- throw exception;
846
- }
847
-
848
- var context = this;
849
- function handle(loc, caught) {
850
- record.type = "throw";
851
- record.arg = exception;
852
- context.next = loc;
853
-
854
- if (caught) {
855
- // If the dispatched exception was caught by a catch block,
856
- // then let that catch block handle the exception normally.
857
- context.method = "next";
858
- context.arg = undefined;
859
- }
860
-
861
- return !! caught;
862
- }
863
-
864
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
865
- var entry = this.tryEntries[i];
866
- var record = entry.completion;
867
-
868
- if (entry.tryLoc === "root") {
869
- // Exception thrown outside of any try block that could handle
870
- // it, so set the completion value of the entire function to
871
- // throw the exception.
872
- return handle("end");
873
- }
874
-
875
- if (entry.tryLoc <= this.prev) {
876
- var hasCatch = hasOwn.call(entry, "catchLoc");
877
- var hasFinally = hasOwn.call(entry, "finallyLoc");
878
-
879
- if (hasCatch && hasFinally) {
880
- if (this.prev < entry.catchLoc) {
881
- return handle(entry.catchLoc, true);
882
- } else if (this.prev < entry.finallyLoc) {
883
- return handle(entry.finallyLoc);
884
- }
885
-
886
- } else if (hasCatch) {
887
- if (this.prev < entry.catchLoc) {
888
- return handle(entry.catchLoc, true);
889
- }
890
-
891
- } else if (hasFinally) {
892
- if (this.prev < entry.finallyLoc) {
893
- return handle(entry.finallyLoc);
894
- }
895
-
896
- } else {
897
- throw new Error("try statement without catch or finally");
898
- }
899
- }
900
- }
901
- },
902
-
903
- abrupt: function(type, arg) {
904
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
905
- var entry = this.tryEntries[i];
906
- if (entry.tryLoc <= this.prev &&
907
- hasOwn.call(entry, "finallyLoc") &&
908
- this.prev < entry.finallyLoc) {
909
- var finallyEntry = entry;
910
- break;
911
- }
912
- }
913
-
914
- if (finallyEntry &&
915
- (type === "break" ||
916
- type === "continue") &&
917
- finallyEntry.tryLoc <= arg &&
918
- arg <= finallyEntry.finallyLoc) {
919
- // Ignore the finally entry if control is not jumping to a
920
- // location outside the try/catch block.
921
- finallyEntry = null;
922
- }
923
-
924
- var record = finallyEntry ? finallyEntry.completion : {};
925
- record.type = type;
926
- record.arg = arg;
927
-
928
- if (finallyEntry) {
929
- this.method = "next";
930
- this.next = finallyEntry.finallyLoc;
931
- return ContinueSentinel;
932
- }
933
-
934
- return this.complete(record);
935
- },
936
-
937
- complete: function(record, afterLoc) {
938
- if (record.type === "throw") {
939
- throw record.arg;
940
- }
941
-
942
- if (record.type === "break" ||
943
- record.type === "continue") {
944
- this.next = record.arg;
945
- } else if (record.type === "return") {
946
- this.rval = this.arg = record.arg;
947
- this.method = "return";
948
- this.next = "end";
949
- } else if (record.type === "normal" && afterLoc) {
950
- this.next = afterLoc;
951
- }
952
-
953
- return ContinueSentinel;
954
- },
955
-
956
- finish: function(finallyLoc) {
957
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
958
- var entry = this.tryEntries[i];
959
- if (entry.finallyLoc === finallyLoc) {
960
- this.complete(entry.completion, entry.afterLoc);
961
- resetTryEntry(entry);
962
- return ContinueSentinel;
963
- }
964
- }
965
- },
966
-
967
- "catch": function(tryLoc) {
968
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
969
- var entry = this.tryEntries[i];
970
- if (entry.tryLoc === tryLoc) {
971
- var record = entry.completion;
972
- if (record.type === "throw") {
973
- var thrown = record.arg;
974
- resetTryEntry(entry);
975
- }
976
- return thrown;
977
- }
978
- }
979
-
980
- // The context.catch method must only be called with a location
981
- // argument that corresponds to a known catch block.
982
- throw new Error("illegal catch attempt");
983
- },
984
-
985
- delegateYield: function(iterable, resultName, nextLoc) {
986
- this.delegate = {
987
- iterator: values(iterable),
988
- resultName: resultName,
989
- nextLoc: nextLoc
990
- };
991
-
992
- if (this.method === "next") {
993
- // Deliberately forget the last sent value so that we don't
994
- // accidentally pass it on to the delegate.
995
- this.arg = undefined;
996
- }
997
-
998
- return ContinueSentinel;
999
- }
1000
- };
1001
-
1002
- // Regardless of whether this script is executing as a CommonJS module
1003
- // or not, return the runtime object so that we can declare the variable
1004
- // regeneratorRuntime in the outer scope, which allows this module to be
1005
- // injected easily by `bin/regenerator --include-runtime script.js`.
1006
- return exports;
1007
-
1008
- }(
1009
- // If this script is executing as a CommonJS module, use module.exports
1010
- // as the regeneratorRuntime namespace. Otherwise create a new empty
1011
- // object. Either way, the resulting object will be used to initialize
1012
- // the regeneratorRuntime variable at the top of this file.
1013
- true ? module.exports : undefined
1014
- ));
1015
-
1016
- try {
1017
- regeneratorRuntime = runtime;
1018
- } catch (accidentalStrictMode) {
1019
- // This module should not be running in strict mode, so the above
1020
- // assignment should always work unless something is misconfigured. Just
1021
- // in case runtime.js accidentally runs in strict mode, we can escape
1022
- // strict mode using a global Function call. This could conceivably fail
1023
- // if a Content Security Policy forbids using Function, but in that case
1024
- // the proper solution is to fix the accidental strict mode problem. If
1025
- // you've misconfigured your bundler to force strict mode and applied a
1026
- // CSP to forbid Function, and you're not willing to fix either of those
1027
- // problems, please detail your unique predicament in a GitHub issue.
1028
- Function("r", "regeneratorRuntime = r")(runtime);
1029
- }
1030
-
1031
-
1032
- /***/ }),
1033
-
1034
- /***/ "../authentication-client/lib/core.js":
1035
- /*!********************************************!*\
1036
- !*** ../authentication-client/lib/core.js ***!
1037
- \********************************************/
1038
- /*! no static exports found */
1039
- /***/ (function(module, exports, __webpack_require__) {
1040
-
1041
- "use strict";
1042
-
1043
-
1044
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1045
-
1046
- 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); } }
1047
-
1048
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
1049
-
1050
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
1051
-
1052
- 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."); }
1053
-
1054
- 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); }
1055
-
1056
- 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; }
1057
-
1058
- 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; }
1059
-
1060
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1061
-
1062
- Object.defineProperty(exports, "__esModule", {
1063
- value: true
1064
- });
1065
- exports.AuthenticationClient = void 0;
1066
-
1067
- var errors_1 = __webpack_require__(/*! @feathersjs/errors */ "../errors/lib/index.js");
1068
-
1069
- var storage_1 = __webpack_require__(/*! ./storage */ "../authentication-client/lib/storage.js");
1070
-
1071
- var getMatch = function getMatch(location, key) {
1072
- var regex = new RegExp("(?:&?)".concat(key, "=([^&]*)"));
1073
- var match = location.hash ? location.hash.match(regex) : null;
1074
-
1075
- if (match !== null) {
1076
- var _match = _slicedToArray(match, 2),
1077
- value = _match[1];
1078
-
1079
- return [value, regex];
1080
- }
1081
-
1082
- return [null, regex];
1083
- };
1084
-
1085
- var AuthenticationClient = /*#__PURE__*/function () {
1086
- function AuthenticationClient(app, options) {
1087
- _classCallCheck(this, AuthenticationClient);
1088
-
1089
- var socket = app.io || app.primus;
1090
- var storage = new storage_1.StorageWrapper(app.get('storage') || options.storage);
1091
- this.app = app;
1092
- this.options = options;
1093
- this.authenticated = false;
1094
- this.app.set('storage', storage);
1095
-
1096
- if (socket) {
1097
- this.handleSocket(socket);
1098
- }
1099
- }
1100
-
1101
- _createClass(AuthenticationClient, [{
1102
- key: "handleSocket",
1103
- value: function handleSocket(socket) {
1104
- var _this = this;
1105
-
1106
- // Connection events happen on every reconnect
1107
- var connected = this.app.io ? 'connect' : 'open';
1108
- var disconnected = this.app.io ? 'disconnect' : 'disconnection';
1109
- socket.on(disconnected, function () {
1110
- var authPromise = new Promise(function (resolve) {
1111
- return socket.once(connected, function () {
1112
- return resolve();
1113
- });
1114
- }) // Only reconnect when `reAuthenticate()` or `authenticate()`
1115
- // has been called explicitly first
1116
- // Force reauthentication with the server
1117
- .then(function () {
1118
- return _this.authenticated ? _this.reAuthenticate(true) : null;
1119
- });
1120
-
1121
- _this.app.set('authentication', authPromise);
1122
- });
1123
- }
1124
- }, {
1125
- key: "getFromLocation",
1126
- value: function getFromLocation(location) {
1127
- var _getMatch = getMatch(location, this.options.locationKey),
1128
- _getMatch2 = _slicedToArray(_getMatch, 2),
1129
- accessToken = _getMatch2[0],
1130
- tokenRegex = _getMatch2[1];
1131
-
1132
- if (accessToken !== null) {
1133
- location.hash = location.hash.replace(tokenRegex, '');
1134
- return Promise.resolve(accessToken);
1135
- }
1136
-
1137
- var _getMatch3 = getMatch(location, this.options.locationErrorKey),
1138
- _getMatch4 = _slicedToArray(_getMatch3, 2),
1139
- message = _getMatch4[0],
1140
- errorRegex = _getMatch4[1];
1141
-
1142
- if (message !== null) {
1143
- location.hash = location.hash.replace(errorRegex, '');
1144
- return Promise.reject(new errors_1.NotAuthenticated(decodeURIComponent(message)));
1145
- }
1146
-
1147
- return Promise.resolve(null);
1148
- }
1149
- }, {
1150
- key: "setAccessToken",
1151
- value: function setAccessToken(accessToken) {
1152
- return this.storage.setItem(this.options.storageKey, accessToken);
1153
- }
1154
- }, {
1155
- key: "getAccessToken",
1156
- value: function getAccessToken() {
1157
- var _this2 = this;
1158
-
1159
- return this.storage.getItem(this.options.storageKey).then(function (accessToken) {
1160
- if (!accessToken && typeof window !== 'undefined' && window.location) {
1161
- return _this2.getFromLocation(window.location);
1162
- }
1163
-
1164
- return accessToken || null;
1165
- });
1166
- }
1167
- }, {
1168
- key: "removeAccessToken",
1169
- value: function removeAccessToken() {
1170
- return this.storage.removeItem(this.options.storageKey);
1171
- }
1172
- }, {
1173
- key: "reset",
1174
- value: function reset() {
1175
- this.app.set('authentication', null);
1176
- this.authenticated = false;
1177
- return Promise.resolve(null);
1178
- }
1179
- }, {
1180
- key: "handleError",
1181
- value: function handleError(error, type) {
1182
- var _this3 = this;
1183
-
1184
- if (error.code === 401 || error.code === 403) {
1185
- var promise = this.removeAccessToken().then(function () {
1186
- return _this3.reset();
1187
- });
1188
- return type === 'logout' ? promise : promise.then(function () {
1189
- return Promise.reject(error);
1190
- });
1191
- }
1192
-
1193
- return Promise.reject(error);
1194
- }
1195
- }, {
1196
- key: "reAuthenticate",
1197
- value: function reAuthenticate() {
1198
- var _this4 = this;
1199
-
1200
- var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
1201
- // Either returns the authentication state or
1202
- // tries to re-authenticate with the stored JWT and strategy
1203
- var authPromise = this.app.get('authentication');
1204
-
1205
- if (!authPromise || force === true) {
1206
- return this.getAccessToken().then(function (accessToken) {
1207
- if (!accessToken) {
1208
- throw new errors_1.NotAuthenticated('No accessToken found in storage');
1209
- }
1210
-
1211
- return _this4.authenticate({
1212
- strategy: _this4.options.jwtStrategy,
1213
- accessToken: accessToken
1214
- });
1215
- });
1216
- }
1217
-
1218
- return authPromise;
1219
- }
1220
- }, {
1221
- key: "authenticate",
1222
- value: function authenticate(authentication, params) {
1223
- var _this5 = this;
1224
-
1225
- if (!authentication) {
1226
- return this.reAuthenticate();
1227
- }
1228
-
1229
- var promise = this.service.create(authentication, params).then(function (authResult) {
1230
- var accessToken = authResult.accessToken;
1231
- _this5.authenticated = true;
1232
-
1233
- _this5.app.emit('login', authResult);
1234
-
1235
- _this5.app.emit('authenticated', authResult);
1236
-
1237
- return _this5.setAccessToken(accessToken).then(function () {
1238
- return authResult;
1239
- });
1240
- }).catch(function (error) {
1241
- return _this5.handleError(error, 'authenticate');
1242
- });
1243
- this.app.set('authentication', promise);
1244
- return promise;
1245
- }
1246
- }, {
1247
- key: "logout",
1248
- value: function logout() {
1249
- var _this6 = this;
1250
-
1251
- return Promise.resolve(this.app.get('authentication')).then(function () {
1252
- return _this6.service.remove(null).then(function (authResult) {
1253
- return _this6.removeAccessToken().then(function () {
1254
- return _this6.reset();
1255
- }).then(function () {
1256
- _this6.app.emit('logout', authResult);
1257
-
1258
- return authResult;
1259
- });
1260
- });
1261
- }).catch(function (error) {
1262
- return _this6.handleError(error, 'logout');
1263
- });
1264
- }
1265
- }, {
1266
- key: "service",
1267
- get: function get() {
1268
- return this.app.service(this.options.path);
1269
- }
1270
- }, {
1271
- key: "storage",
1272
- get: function get() {
1273
- return this.app.get('storage');
1274
- }
1275
- }]);
1276
-
1277
- return AuthenticationClient;
1278
- }();
1279
-
1280
- exports.AuthenticationClient = AuthenticationClient;
1281
-
1282
- /***/ }),
1283
-
1284
- /***/ "../authentication-client/lib/hooks/authentication.js":
1285
- /*!************************************************************!*\
1286
- !*** ../authentication-client/lib/hooks/authentication.js ***!
1287
- \************************************************************/
1288
- /*! no static exports found */
1289
- /***/ (function(module, exports, __webpack_require__) {
1290
-
1291
- "use strict";
1292
-
1293
-
1294
- Object.defineProperty(exports, "__esModule", {
1295
- value: true
1296
- });
1297
- exports.authentication = void 0;
1298
-
1299
- var commons_1 = __webpack_require__(/*! @feathersjs/commons */ "../commons/lib/index.js");
1300
-
1301
- exports.authentication = function () {
1302
- return function (context) {
1303
- var app = context.app,
1304
- params = context.params,
1305
- path = context.path,
1306
- method = context.method,
1307
- service = context.app.authentication;
1308
-
1309
- if (commons_1.stripSlashes(service.options.path) === path && method === 'create') {
1310
- return context;
1311
- }
1312
-
1313
- return Promise.resolve(app.get('authentication')).then(function (authResult) {
1314
- if (authResult) {
1315
- context.params = Object.assign({}, authResult, params);
1316
- }
1317
-
1318
- return context;
1319
- });
1320
- };
1321
- };
1322
-
1323
- /***/ }),
1324
-
1325
- /***/ "../authentication-client/lib/hooks/index.js":
1326
- /*!***************************************************!*\
1327
- !*** ../authentication-client/lib/hooks/index.js ***!
1328
- \***************************************************/
1329
- /*! no static exports found */
1330
- /***/ (function(module, exports, __webpack_require__) {
1331
-
1332
- "use strict";
1333
-
1334
-
1335
- Object.defineProperty(exports, "__esModule", {
1336
- value: true
1337
- });
1338
-
1339
- var authentication_1 = __webpack_require__(/*! ./authentication */ "../authentication-client/lib/hooks/authentication.js");
1340
-
1341
- Object.defineProperty(exports, "authentication", {
1342
- enumerable: true,
1343
- get: function get() {
1344
- return authentication_1.authentication;
1345
- }
1346
- });
1347
-
1348
- var populate_header_1 = __webpack_require__(/*! ./populate-header */ "../authentication-client/lib/hooks/populate-header.js");
1349
-
1350
- Object.defineProperty(exports, "populateHeader", {
1351
- enumerable: true,
1352
- get: function get() {
1353
- return populate_header_1.populateHeader;
1354
- }
1355
- });
1356
-
1357
- /***/ }),
1358
-
1359
- /***/ "../authentication-client/lib/hooks/populate-header.js":
1360
- /*!*************************************************************!*\
1361
- !*** ../authentication-client/lib/hooks/populate-header.js ***!
1362
- \*************************************************************/
1363
- /*! no static exports found */
1364
- /***/ (function(module, exports, __webpack_require__) {
1365
-
1366
- "use strict";
1367
-
1368
-
1369
- 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; }
1370
-
1371
- Object.defineProperty(exports, "__esModule", {
1372
- value: true
1373
- });
1374
- exports.populateHeader = void 0;
1375
-
1376
- exports.populateHeader = function () {
1377
- return function (context) {
1378
- var app = context.app,
1379
- accessToken = context.params.accessToken;
1380
- var authentication = app.authentication; // Set REST header if necessary
1381
-
1382
- if (app.rest && accessToken) {
1383
- var _authentication$optio = authentication.options,
1384
- scheme = _authentication$optio.scheme,
1385
- header = _authentication$optio.header;
1386
- var authHeader = "".concat(scheme, " ").concat(accessToken);
1387
- context.params.headers = Object.assign({}, _defineProperty({}, header, authHeader), context.params.headers);
1388
- }
1389
-
1390
- return context;
1391
- };
1392
- };
1393
-
1394
- /***/ }),
1395
-
1396
- /***/ "../authentication-client/lib/index.js":
1397
- /*!*********************************************!*\
1398
- !*** ../authentication-client/lib/index.js ***!
1399
- \*********************************************/
1400
- /*! no static exports found */
1401
- /***/ (function(module, exports, __webpack_require__) {
1402
-
1403
- "use strict";
1404
-
1405
-
1406
- var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
1407
- if (k2 === undefined) k2 = k;
1408
- Object.defineProperty(o, k2, {
1409
- enumerable: true,
1410
- get: function get() {
1411
- return m[k];
1412
- }
1413
- });
1414
- } : function (o, m, k, k2) {
1415
- if (k2 === undefined) k2 = k;
1416
- o[k2] = m[k];
1417
- });
1418
-
1419
- var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {
1420
- Object.defineProperty(o, "default", {
1421
- enumerable: true,
1422
- value: v
1423
- });
1424
- } : function (o, v) {
1425
- o["default"] = v;
1426
- });
1427
-
1428
- var __importStar = this && this.__importStar || function (mod) {
1429
- if (mod && mod.__esModule) return mod;
1430
- var result = {};
1431
- if (mod != null) for (var k in mod) {
1432
- if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1433
- }
1434
-
1435
- __setModuleDefault(result, mod);
1436
-
1437
- return result;
1438
- };
1439
-
1440
- Object.defineProperty(exports, "__esModule", {
1441
- value: true
1442
- });
1443
- exports.defaults = exports.defaultStorage = exports.hooks = exports.MemoryStorage = exports.AuthenticationClient = exports.getDefaultStorage = void 0;
1444
-
1445
- var core_1 = __webpack_require__(/*! ./core */ "../authentication-client/lib/core.js");
1446
-
1447
- Object.defineProperty(exports, "AuthenticationClient", {
1448
- enumerable: true,
1449
- get: function get() {
1450
- return core_1.AuthenticationClient;
1451
- }
1452
- });
1453
-
1454
- var hooks = __importStar(__webpack_require__(/*! ./hooks */ "../authentication-client/lib/hooks/index.js"));
1455
-
1456
- exports.hooks = hooks;
1457
-
1458
- var storage_1 = __webpack_require__(/*! ./storage */ "../authentication-client/lib/storage.js");
1459
-
1460
- Object.defineProperty(exports, "MemoryStorage", {
1461
- enumerable: true,
1462
- get: function get() {
1463
- return storage_1.MemoryStorage;
1464
- }
1465
- });
1466
-
1467
- exports.getDefaultStorage = function () {
1468
- try {
1469
- return new storage_1.StorageWrapper(window.localStorage);
1470
- } catch (error) {}
1471
-
1472
- return new storage_1.MemoryStorage();
1473
- };
1474
-
1475
- exports.defaultStorage = exports.getDefaultStorage();
1476
- exports.defaults = {
1477
- header: 'Authorization',
1478
- scheme: 'Bearer',
1479
- storageKey: 'feathers-jwt',
1480
- locationKey: 'access_token',
1481
- locationErrorKey: 'error',
1482
- jwtStrategy: 'jwt',
1483
- path: '/authentication',
1484
- Authentication: core_1.AuthenticationClient,
1485
- storage: exports.defaultStorage
1486
- };
1487
-
1488
- var init = function init() {
1489
- var _options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1490
-
1491
- var options = Object.assign({}, exports.defaults, _options);
1492
- var Authentication = options.Authentication;
1493
- return function (app) {
1494
- var authentication = new Authentication(app, options);
1495
- app.authentication = authentication;
1496
- app.authenticate = authentication.authenticate.bind(authentication);
1497
- app.reAuthenticate = authentication.reAuthenticate.bind(authentication);
1498
- app.logout = authentication.logout.bind(authentication);
1499
- app.hooks({
1500
- before: {
1501
- all: [hooks.authentication(), hooks.populateHeader()]
1502
- }
1503
- });
1504
- };
1505
- };
1506
-
1507
- exports.default = init;
1508
-
1509
- if (true) {
1510
- module.exports = Object.assign(init, module.exports);
1511
- }
1512
-
1513
- /***/ }),
1514
-
1515
- /***/ "../authentication-client/lib/storage.js":
1516
- /*!***********************************************!*\
1517
- !*** ../authentication-client/lib/storage.js ***!
1518
- \***********************************************/
1519
- /*! no static exports found */
1520
- /***/ (function(module, exports, __webpack_require__) {
1521
-
1522
- "use strict";
1523
-
1524
-
1525
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1526
-
1527
- 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); } }
1528
-
1529
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
1530
-
1531
- Object.defineProperty(exports, "__esModule", {
1532
- value: true
1533
- });
1534
- exports.StorageWrapper = exports.MemoryStorage = void 0;
1535
-
1536
- var MemoryStorage = /*#__PURE__*/function () {
1537
- function MemoryStorage() {
1538
- _classCallCheck(this, MemoryStorage);
1539
-
1540
- this.store = {};
1541
- }
1542
-
1543
- _createClass(MemoryStorage, [{
1544
- key: "getItem",
1545
- value: function getItem(key) {
1546
- return Promise.resolve(this.store[key]);
1547
- }
1548
- }, {
1549
- key: "setItem",
1550
- value: function setItem(key, value) {
1551
- return Promise.resolve(this.store[key] = value);
1552
- }
1553
- }, {
1554
- key: "removeItem",
1555
- value: function removeItem(key) {
1556
- var value = this.store[key];
1557
- delete this.store[key];
1558
- return Promise.resolve(value);
1559
- }
1560
- }]);
1561
-
1562
- return MemoryStorage;
1563
- }();
1564
-
1565
- exports.MemoryStorage = MemoryStorage;
1566
-
1567
- var StorageWrapper = /*#__PURE__*/function () {
1568
- function StorageWrapper(storage) {
1569
- _classCallCheck(this, StorageWrapper);
1570
-
1571
- this.storage = storage;
1572
- }
1573
-
1574
- _createClass(StorageWrapper, [{
1575
- key: "getItem",
1576
- value: function getItem(key) {
1577
- return Promise.resolve(this.storage.getItem(key));
1578
- }
1579
- }, {
1580
- key: "setItem",
1581
- value: function setItem(key, value) {
1582
- return Promise.resolve(this.storage.setItem(key, value));
1583
- }
1584
- }, {
1585
- key: "removeItem",
1586
- value: function removeItem(key) {
1587
- return Promise.resolve(this.storage.removeItem(key));
1588
- }
1589
- }]);
1590
-
1591
- return StorageWrapper;
1592
- }();
1593
-
1594
- exports.StorageWrapper = StorageWrapper;
1595
-
1596
- /***/ }),
1597
-
1598
- /***/ "../commons/lib/index.js":
1599
- /*!*******************************!*\
1600
- !*** ../commons/lib/index.js ***!
1601
- \*******************************/
1602
- /*! no static exports found */
1603
- /***/ (function(module, exports, __webpack_require__) {
1604
-
1605
- "use strict";
1606
- /* WEBPACK VAR INJECTION */(function(process) {
1607
-
1608
- 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; }
1609
-
1610
- 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); }
1611
-
1612
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
1613
-
1614
- 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."); }
1615
-
1616
- 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); }
1617
-
1618
- 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; }
1619
-
1620
- 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; }
1621
-
1622
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1623
-
1624
- Object.defineProperty(exports, "__esModule", {
1625
- value: true
1626
- });
1627
- exports.createSymbol = exports.makeUrl = exports.isPromise = exports._ = exports.stripSlashes = void 0; // Removes all leading and trailing slashes from a path
1628
-
1629
- function stripSlashes(name) {
1630
- return name.replace(/^(\/+)|(\/+)$/g, '');
1631
- }
1632
-
1633
- exports.stripSlashes = stripSlashes; // A set of lodash-y utility functions that use ES6
1634
-
1635
- exports._ = {
1636
- each: function each(obj, callback) {
1637
- if (obj && typeof obj.forEach === 'function') {
1638
- obj.forEach(callback);
1639
- } else if (exports._.isObject(obj)) {
1640
- Object.keys(obj).forEach(function (key) {
1641
- return callback(obj[key], key);
1642
- });
1643
- }
1644
- },
1645
- some: function some(value, callback) {
1646
- return Object.keys(value).map(function (key) {
1647
- return [value[key], key];
1648
- }).some(function (_ref) {
1649
- var _ref2 = _slicedToArray(_ref, 2),
1650
- val = _ref2[0],
1651
- key = _ref2[1];
1652
-
1653
- return callback(val, key);
1654
- });
1655
- },
1656
- every: function every(value, callback) {
1657
- return Object.keys(value).map(function (key) {
1658
- return [value[key], key];
1659
- }).every(function (_ref3) {
1660
- var _ref4 = _slicedToArray(_ref3, 2),
1661
- val = _ref4[0],
1662
- key = _ref4[1];
1663
-
1664
- return callback(val, key);
1665
- });
1666
- },
1667
- keys: function keys(obj) {
1668
- return Object.keys(obj);
1669
- },
1670
- values: function values(obj) {
1671
- return exports._.keys(obj).map(function (key) {
1672
- return obj[key];
1673
- });
1674
- },
1675
- isMatch: function isMatch(obj, item) {
1676
- return exports._.keys(item).every(function (key) {
1677
- return obj[key] === item[key];
1678
- });
1679
- },
1680
- isEmpty: function isEmpty(obj) {
1681
- return exports._.keys(obj).length === 0;
1682
- },
1683
- isObject: function isObject(item) {
1684
- return _typeof(item) === 'object' && !Array.isArray(item) && item !== null;
1685
- },
1686
- isObjectOrArray: function isObjectOrArray(value) {
1687
- return _typeof(value) === 'object' && value !== null;
1688
- },
1689
- extend: function extend(first) {
1690
- for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1691
- rest[_key - 1] = arguments[_key];
1692
- }
1693
-
1694
- return Object.assign.apply(Object, [first].concat(rest));
1695
- },
1696
- omit: function omit(obj) {
1697
- var result = exports._.extend({}, obj);
1698
-
1699
- for (var _len2 = arguments.length, keys = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
1700
- keys[_key2 - 1] = arguments[_key2];
1701
- }
1702
-
1703
- keys.forEach(function (key) {
1704
- return delete result[key];
1705
- });
1706
- return result;
1707
- },
1708
- pick: function pick(source) {
1709
- for (var _len3 = arguments.length, keys = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
1710
- keys[_key3 - 1] = arguments[_key3];
1711
- }
1712
-
1713
- return keys.reduce(function (result, key) {
1714
- if (source[key] !== undefined) {
1715
- result[key] = source[key];
1716
- }
1717
-
1718
- return result;
1719
- }, {});
1720
- },
1721
- // Recursively merge the source object into the target object
1722
- merge: function merge(target, source) {
1723
- if (exports._.isObject(target) && exports._.isObject(source)) {
1724
- Object.keys(source).forEach(function (key) {
1725
- if (exports._.isObject(source[key])) {
1726
- if (!target[key]) {
1727
- Object.assign(target, _defineProperty({}, key, {}));
1728
- }
1729
-
1730
- exports._.merge(target[key], source[key]);
1731
- } else {
1732
- Object.assign(target, _defineProperty({}, key, source[key]));
1733
- }
1734
- });
1735
- }
1736
-
1737
- return target;
1738
- }
1739
- }; // Duck-checks if an object looks like a promise
1740
-
1741
- function isPromise(result) {
1742
- return exports._.isObject(result) && typeof result.then === 'function';
1743
- }
1744
-
1745
- exports.isPromise = isPromise;
1746
-
1747
- function makeUrl(path) {
1748
- var app = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1749
- var get = typeof app.get === 'function' ? app.get.bind(app) : function () {};
1750
- var env = get('env') || "development";
1751
- var host = get('host') || process.env.HOST_NAME || 'localhost';
1752
- var protocol = env === 'development' || env === 'test' || env === undefined ? 'http' : 'https';
1753
- var PORT = get('port') || process.env.PORT || 3030;
1754
- var port = env === 'development' || env === 'test' || env === undefined ? ":".concat(PORT) : '';
1755
- path = path || '';
1756
- return "".concat(protocol, "://").concat(host).concat(port, "/").concat(exports.stripSlashes(path));
1757
- }
1758
-
1759
- exports.makeUrl = makeUrl;
1760
-
1761
- function createSymbol(name) {
1762
- return typeof Symbol !== 'undefined' ? Symbol(name) : name;
1763
- }
1764
-
1765
- exports.createSymbol = createSymbol;
1766
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node_modules/process/browser.js */ "../../node_modules/process/browser.js")))
1767
-
1768
- /***/ }),
1769
-
1770
- /***/ "../errors/lib/index.js":
1771
- /*!******************************!*\
1772
- !*** ../errors/lib/index.js ***!
1773
- \******************************/
1774
- /*! no static exports found */
1775
- /***/ (function(module, exports, __webpack_require__) {
1776
-
1777
- "use strict";
1778
-
1779
-
1780
- 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); }
1781
-
1782
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1783
-
1784
- 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); } }
1785
-
1786
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
1787
-
1788
- 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); }
1789
-
1790
- 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); }; }
1791
-
1792
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
1793
-
1794
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1795
-
1796
- 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); }
1797
-
1798
- 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); }
1799
-
1800
- 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; } }
1801
-
1802
- function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
1803
-
1804
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
1805
-
1806
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
1807
-
1808
- var __rest = this && this.__rest || function (s, e) {
1809
- var t = {};
1810
-
1811
- for (var p in s) {
1812
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
1813
- }
1814
-
1815
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1816
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
1817
- }
1818
- return t;
1819
- };
1820
-
1821
- Object.defineProperty(exports, "__esModule", {
1822
- value: true
1823
- });
1824
- 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;
1825
-
1826
- var FeathersError = /*#__PURE__*/function (_Error) {
1827
- _inherits(FeathersError, _Error);
1828
-
1829
- var _super = _createSuper(FeathersError);
1830
-
1831
- function FeathersError(err, name, code, className, _data) {
1832
- var _this;
1833
-
1834
- _classCallCheck(this, FeathersError);
1835
-
1836
- var msg = typeof err === 'string' ? err : 'Error';
1837
- var properties = {
1838
- name: name,
1839
- code: code,
1840
- className: className,
1841
- type: 'FeathersError'
1842
- };
1843
-
1844
- if (Array.isArray(_data)) {
1845
- properties.data = _data;
1846
- } else if (_typeof(err) === 'object' || _data !== undefined) {
1847
- var _a = _typeof(err) === 'object' ? err : _data,
1848
- message = _a.message,
1849
- errors = _a.errors,
1850
- rest = __rest(_a, ["message", "errors"]);
1851
-
1852
- msg = message || msg;
1853
- properties.errors = errors;
1854
- properties.data = rest;
1855
- }
1856
-
1857
- _this = _super.call(this, msg);
1858
- Object.assign(_assertThisInitialized(_this), properties);
1859
- return _this;
1860
- }
1861
-
1862
- _createClass(FeathersError, [{
1863
- key: "toJSON",
1864
- value: function toJSON() {
1865
- var result = {
1866
- name: this.name,
1867
- message: this.message,
1868
- code: this.code,
1869
- className: this.className
1870
- };
1871
-
1872
- if (this.data !== undefined) {
1873
- result.data = this.data;
1874
- }
1875
-
1876
- if (this.errors !== undefined) {
1877
- result.errors = this.errors;
1878
- }
1879
-
1880
- return result;
1881
- }
1882
- }]);
1883
-
1884
- return FeathersError;
1885
- }( /*#__PURE__*/_wrapNativeSuper(Error));
1886
-
1887
- exports.FeathersError = FeathersError;
1888
-
1889
- var BadRequest = /*#__PURE__*/function (_FeathersError) {
1890
- _inherits(BadRequest, _FeathersError);
1891
-
1892
- var _super2 = _createSuper(BadRequest);
1893
-
1894
- function BadRequest(message, data) {
1895
- _classCallCheck(this, BadRequest);
1896
-
1897
- return _super2.call(this, message, 'BadRequest', 400, 'bad-request', data);
1898
- }
1899
-
1900
- return BadRequest;
1901
- }(FeathersError);
1902
-
1903
- exports.BadRequest = BadRequest; // 401 - Not Authenticated
1904
-
1905
- var NotAuthenticated = /*#__PURE__*/function (_FeathersError2) {
1906
- _inherits(NotAuthenticated, _FeathersError2);
1907
-
1908
- var _super3 = _createSuper(NotAuthenticated);
1909
-
1910
- function NotAuthenticated(message, data) {
1911
- _classCallCheck(this, NotAuthenticated);
1912
-
1913
- return _super3.call(this, message, 'NotAuthenticated', 401, 'not-authenticated', data);
1914
- }
1915
-
1916
- return NotAuthenticated;
1917
- }(FeathersError);
1918
-
1919
- exports.NotAuthenticated = NotAuthenticated; // 402 - Payment Error
1920
-
1921
- var PaymentError = /*#__PURE__*/function (_FeathersError3) {
1922
- _inherits(PaymentError, _FeathersError3);
1923
-
1924
- var _super4 = _createSuper(PaymentError);
1925
-
1926
- function PaymentError(message, data) {
1927
- _classCallCheck(this, PaymentError);
1928
-
1929
- return _super4.call(this, message, 'PaymentError', 402, 'payment-error', data);
1930
- }
1931
-
1932
- return PaymentError;
1933
- }(FeathersError);
1934
-
1935
- exports.PaymentError = PaymentError; // 403 - Forbidden
1936
-
1937
- var Forbidden = /*#__PURE__*/function (_FeathersError4) {
1938
- _inherits(Forbidden, _FeathersError4);
1939
-
1940
- var _super5 = _createSuper(Forbidden);
1941
-
1942
- function Forbidden(message, data) {
1943
- _classCallCheck(this, Forbidden);
1944
-
1945
- return _super5.call(this, message, 'Forbidden', 403, 'forbidden', data);
1946
- }
1947
-
1948
- return Forbidden;
1949
- }(FeathersError);
1950
-
1951
- exports.Forbidden = Forbidden; // 404 - Not Found
1952
-
1953
- var NotFound = /*#__PURE__*/function (_FeathersError5) {
1954
- _inherits(NotFound, _FeathersError5);
1955
-
1956
- var _super6 = _createSuper(NotFound);
1957
-
1958
- function NotFound(message, data) {
1959
- _classCallCheck(this, NotFound);
1960
-
1961
- return _super6.call(this, message, 'NotFound', 404, 'not-found', data);
1962
- }
1963
-
1964
- return NotFound;
1965
- }(FeathersError);
1966
-
1967
- exports.NotFound = NotFound; // 405 - Method Not Allowed
1968
-
1969
- var MethodNotAllowed = /*#__PURE__*/function (_FeathersError6) {
1970
- _inherits(MethodNotAllowed, _FeathersError6);
1971
-
1972
- var _super7 = _createSuper(MethodNotAllowed);
1973
-
1974
- function MethodNotAllowed(message, data) {
1975
- _classCallCheck(this, MethodNotAllowed);
1976
-
1977
- return _super7.call(this, message, 'MethodNotAllowed', 405, 'method-not-allowed', data);
1978
- }
1979
-
1980
- return MethodNotAllowed;
1981
- }(FeathersError);
1982
-
1983
- exports.MethodNotAllowed = MethodNotAllowed; // 406 - Not Acceptable
1984
-
1985
- var NotAcceptable = /*#__PURE__*/function (_FeathersError7) {
1986
- _inherits(NotAcceptable, _FeathersError7);
1987
-
1988
- var _super8 = _createSuper(NotAcceptable);
1989
-
1990
- function NotAcceptable(message, data) {
1991
- _classCallCheck(this, NotAcceptable);
1992
-
1993
- return _super8.call(this, message, 'NotAcceptable', 406, 'not-acceptable', data);
1994
- }
1995
-
1996
- return NotAcceptable;
1997
- }(FeathersError);
1998
-
1999
- exports.NotAcceptable = NotAcceptable; // 408 - Timeout
2000
-
2001
- var Timeout = /*#__PURE__*/function (_FeathersError8) {
2002
- _inherits(Timeout, _FeathersError8);
2003
-
2004
- var _super9 = _createSuper(Timeout);
2005
-
2006
- function Timeout(message, data) {
2007
- _classCallCheck(this, Timeout);
2008
-
2009
- return _super9.call(this, message, 'Timeout', 408, 'timeout', data);
2010
- }
2011
-
2012
- return Timeout;
2013
- }(FeathersError);
2014
-
2015
- exports.Timeout = Timeout; // 409 - Conflict
2016
-
2017
- var Conflict = /*#__PURE__*/function (_FeathersError9) {
2018
- _inherits(Conflict, _FeathersError9);
2019
-
2020
- var _super10 = _createSuper(Conflict);
2021
-
2022
- function Conflict(message, data) {
2023
- _classCallCheck(this, Conflict);
2024
-
2025
- return _super10.call(this, message, 'Conflict', 409, 'conflict', data);
2026
- }
2027
-
2028
- return Conflict;
2029
- }(FeathersError);
2030
-
2031
- exports.Conflict = Conflict; // 410 - Gone
2032
-
2033
- var Gone = /*#__PURE__*/function (_FeathersError10) {
2034
- _inherits(Gone, _FeathersError10);
2035
-
2036
- var _super11 = _createSuper(Gone);
2037
-
2038
- function Gone(message, data) {
2039
- _classCallCheck(this, Gone);
2040
-
2041
- return _super11.call(this, message, 'Gone', 410, 'gone', data);
2042
- }
2043
-
2044
- return Gone;
2045
- }(FeathersError);
2046
-
2047
- exports.Gone = Gone; // 411 - Length Required
2048
-
2049
- var LengthRequired = /*#__PURE__*/function (_FeathersError11) {
2050
- _inherits(LengthRequired, _FeathersError11);
2051
-
2052
- var _super12 = _createSuper(LengthRequired);
2053
-
2054
- function LengthRequired(message, data) {
2055
- _classCallCheck(this, LengthRequired);
2056
-
2057
- return _super12.call(this, message, 'LengthRequired', 411, 'length-required', data);
2058
- }
2059
-
2060
- return LengthRequired;
2061
- }(FeathersError);
2062
-
2063
- exports.LengthRequired = LengthRequired; // 422 Unprocessable
2064
-
2065
- var Unprocessable = /*#__PURE__*/function (_FeathersError12) {
2066
- _inherits(Unprocessable, _FeathersError12);
2067
-
2068
- var _super13 = _createSuper(Unprocessable);
2069
-
2070
- function Unprocessable(message, data) {
2071
- _classCallCheck(this, Unprocessable);
2072
-
2073
- return _super13.call(this, message, 'Unprocessable', 422, 'unprocessable', data);
2074
- }
2075
-
2076
- return Unprocessable;
2077
- }(FeathersError);
2078
-
2079
- exports.Unprocessable = Unprocessable; // 429 Too Many Requests
2080
-
2081
- var TooManyRequests = /*#__PURE__*/function (_FeathersError13) {
2082
- _inherits(TooManyRequests, _FeathersError13);
2083
-
2084
- var _super14 = _createSuper(TooManyRequests);
2085
-
2086
- function TooManyRequests(message, data) {
2087
- _classCallCheck(this, TooManyRequests);
2088
-
2089
- return _super14.call(this, message, 'TooManyRequests', 429, 'too-many-requests', data);
2090
- }
2091
-
2092
- return TooManyRequests;
2093
- }(FeathersError);
2094
-
2095
- exports.TooManyRequests = TooManyRequests; // 500 - General Error
2096
-
2097
- var GeneralError = /*#__PURE__*/function (_FeathersError14) {
2098
- _inherits(GeneralError, _FeathersError14);
2099
-
2100
- var _super15 = _createSuper(GeneralError);
2101
-
2102
- function GeneralError(message, data) {
2103
- _classCallCheck(this, GeneralError);
2104
-
2105
- return _super15.call(this, message, 'GeneralError', 500, 'general-error', data);
2106
- }
2107
-
2108
- return GeneralError;
2109
- }(FeathersError);
2110
-
2111
- exports.GeneralError = GeneralError; // 501 - Not Implemented
2112
-
2113
- var NotImplemented = /*#__PURE__*/function (_FeathersError15) {
2114
- _inherits(NotImplemented, _FeathersError15);
2115
-
2116
- var _super16 = _createSuper(NotImplemented);
2117
-
2118
- function NotImplemented(message, data) {
2119
- _classCallCheck(this, NotImplemented);
2120
-
2121
- return _super16.call(this, message, 'NotImplemented', 501, 'not-implemented', data);
2122
- }
2123
-
2124
- return NotImplemented;
2125
- }(FeathersError);
2126
-
2127
- exports.NotImplemented = NotImplemented; // 502 - Bad Gateway
2128
-
2129
- var BadGateway = /*#__PURE__*/function (_FeathersError16) {
2130
- _inherits(BadGateway, _FeathersError16);
2131
-
2132
- var _super17 = _createSuper(BadGateway);
2133
-
2134
- function BadGateway(message, data) {
2135
- _classCallCheck(this, BadGateway);
2136
-
2137
- return _super17.call(this, message, 'BadGateway', 502, 'bad-gateway', data);
2138
- }
2139
-
2140
- return BadGateway;
2141
- }(FeathersError);
2142
-
2143
- exports.BadGateway = BadGateway; // 503 - Unavailable
2144
-
2145
- var Unavailable = /*#__PURE__*/function (_FeathersError17) {
2146
- _inherits(Unavailable, _FeathersError17);
2147
-
2148
- var _super18 = _createSuper(Unavailable);
2149
-
2150
- function Unavailable(message, data) {
2151
- _classCallCheck(this, Unavailable);
2152
-
2153
- return _super18.call(this, message, 'Unavailable', 503, 'unavailable', data);
2154
- }
2155
-
2156
- return Unavailable;
2157
- }(FeathersError);
2158
-
2159
- exports.Unavailable = Unavailable;
2160
- exports.errors = {
2161
- FeathersError: FeathersError,
2162
- BadRequest: BadRequest,
2163
- NotAuthenticated: NotAuthenticated,
2164
- PaymentError: PaymentError,
2165
- Forbidden: Forbidden,
2166
- NotFound: NotFound,
2167
- MethodNotAllowed: MethodNotAllowed,
2168
- NotAcceptable: NotAcceptable,
2169
- Timeout: Timeout,
2170
- Conflict: Conflict,
2171
- LengthRequired: LengthRequired,
2172
- Unprocessable: Unprocessable,
2173
- TooManyRequests: TooManyRequests,
2174
- GeneralError: GeneralError,
2175
- NotImplemented: NotImplemented,
2176
- BadGateway: BadGateway,
2177
- Unavailable: Unavailable,
2178
- 400: BadRequest,
2179
- 401: NotAuthenticated,
2180
- 402: PaymentError,
2181
- 403: Forbidden,
2182
- 404: NotFound,
2183
- 405: MethodNotAllowed,
2184
- 406: NotAcceptable,
2185
- 408: Timeout,
2186
- 409: Conflict,
2187
- 410: Gone,
2188
- 411: LengthRequired,
2189
- 422: Unprocessable,
2190
- 429: TooManyRequests,
2191
- 500: GeneralError,
2192
- 501: NotImplemented,
2193
- 502: BadGateway,
2194
- 503: Unavailable
2195
- };
2196
-
2197
- function convert(error) {
2198
- if (!error) {
2199
- return error;
2200
- }
2201
-
2202
- var FeathersError = exports.errors[error.name];
2203
- var result = FeathersError ? new FeathersError(error.message, error.data) : new Error(error.message || error);
2204
-
2205
- if (_typeof(error) === 'object') {
2206
- Object.assign(result, error);
2207
- }
2208
-
2209
- return result;
2210
- }
2211
-
2212
- exports.convert = convert;
2213
-
2214
- /***/ }),
2215
-
2216
- /***/ "./src/authentication.js":
2217
- /*!*******************************!*\
2218
- !*** ./src/authentication.js ***!
2219
- \*******************************/
2220
- /*! no static exports found */
2221
- /***/ (function(module, exports, __webpack_require__) {
2222
-
2223
- module.exports = __webpack_require__(/*! @feathersjs/authentication-client */ "../authentication-client/lib/index.js");
2224
-
2225
- /***/ }),
2226
-
2227
- /***/ 0:
2228
- /*!*****************************************************************!*\
2229
- !*** multi regenerator-runtime/runtime ./src/authentication.js ***!
2230
- \*****************************************************************/
2231
- /*! no static exports found */
2232
- /***/ (function(module, exports, __webpack_require__) {
2233
-
2234
- __webpack_require__(/*! regenerator-runtime/runtime */"../../node_modules/regenerator-runtime/runtime.js");
2235
- module.exports = __webpack_require__(/*! ./src/authentication.js */"./src/authentication.js");
2236
-
2237
-
2238
- /***/ })
2239
-
2240
- /******/ });
2241
- });
2242
- //# sourceMappingURL=authentication.js.map