UNPKG

116 kBJavaScriptView Raw
1(function (global, factory) {
2 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('core-js/modules/es.object.entries.js'), require('core-js/modules/es.function.name.js'), require('core-js/modules/es.symbol.js'), require('core-js/modules/es.symbol.description.js'), require('core-js/modules/es.object.to-string.js'), require('core-js/modules/es.symbol.iterator.js'), require('core-js/modules/es.string.iterator.js'), require('core-js/modules/es.array.iterator.js'), require('core-js/modules/web.dom-collections.iterator.js'), require('core-js/modules/es.symbol.async-iterator.js'), require('core-js/modules/es.symbol.to-string-tag.js'), require('core-js/modules/es.math.to-string-tag.js'), require('core-js/modules/es.json.to-string-tag.js'), require('core-js/modules/es.object.get-prototype-of.js'), require('core-js/modules/es.promise.js'), require('core-js/modules/es.regexp.to-string.js'), require('core-js/modules/web.dom-collections.for-each.js'), require('core-js/modules/es.array.slice.js'), require('axios'), require('core-js/modules/es.regexp.exec.js'), require('core-js/modules/es.regexp.constructor.js'), require('core-js/modules/es.string.replace.js'), require('core-js/modules/es.array.splice.js'), require('core-js/modules/es.array.map.js'), require('core-js/modules/es.array.includes.js'), require('core-js/modules/es.array.concat.js'), require('assert')) :
3 typeof define === 'function' && define.amd ? define(['exports', 'core-js/modules/es.object.entries.js', 'core-js/modules/es.function.name.js', 'core-js/modules/es.symbol.js', 'core-js/modules/es.symbol.description.js', 'core-js/modules/es.object.to-string.js', 'core-js/modules/es.symbol.iterator.js', 'core-js/modules/es.string.iterator.js', 'core-js/modules/es.array.iterator.js', 'core-js/modules/web.dom-collections.iterator.js', 'core-js/modules/es.symbol.async-iterator.js', 'core-js/modules/es.symbol.to-string-tag.js', 'core-js/modules/es.math.to-string-tag.js', 'core-js/modules/es.json.to-string-tag.js', 'core-js/modules/es.object.get-prototype-of.js', 'core-js/modules/es.promise.js', 'core-js/modules/es.regexp.to-string.js', 'core-js/modules/web.dom-collections.for-each.js', 'core-js/modules/es.array.slice.js', 'axios', 'core-js/modules/es.regexp.exec.js', 'core-js/modules/es.regexp.constructor.js', 'core-js/modules/es.string.replace.js', 'core-js/modules/es.array.splice.js', 'core-js/modules/es.array.map.js', 'core-js/modules/es.array.includes.js', 'core-js/modules/es.array.concat.js', 'assert'], factory) :
4 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.CSREST = {}, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, global.axios, null, null, null, null, null, null, null, global.assert));
5}(this, (function (exports, es_object_entries_js, es_function_name_js, es_symbol_js, es_symbol_description_js, es_object_toString_js, es_symbol_iterator_js, es_string_iterator_js, es_array_iterator_js, web_domCollections_iterator_js, es_symbol_asyncIterator_js, es_symbol_toStringTag_js, es_math_toStringTag_js, es_json_toStringTag_js, es_object_getPrototypeOf_js, es_promise_js, es_regexp_toString_js, web_domCollections_forEach_js, es_array_slice_js, axios, es_regexp_exec_js, es_regexp_constructor_js, es_string_replace_js, es_array_splice_js, es_array_map_js, es_array_includes_js, es_array_concat_js, assert) { 'use strict';
6
7 function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
9 var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
10 var assert__default = /*#__PURE__*/_interopDefaultLegacy(assert);
11
12 function _typeof(obj) {
13 "@babel/helpers - typeof";
14
15 if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
16 _typeof = function (obj) {
17 return typeof obj;
18 };
19 } else {
20 _typeof = function (obj) {
21 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
22 };
23 }
24
25 return _typeof(obj);
26 }
27
28 function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
29 try {
30 var info = gen[key](arg);
31 var value = info.value;
32 } catch (error) {
33 reject(error);
34 return;
35 }
36
37 if (info.done) {
38 resolve(value);
39 } else {
40 Promise.resolve(value).then(_next, _throw);
41 }
42 }
43
44 function _asyncToGenerator(fn) {
45 return function () {
46 var self = this,
47 args = arguments;
48 return new Promise(function (resolve, reject) {
49 var gen = fn.apply(self, args);
50
51 function _next(value) {
52 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
53 }
54
55 function _throw(err) {
56 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
57 }
58
59 _next(undefined);
60 });
61 };
62 }
63
64 function _classCallCheck(instance, Constructor) {
65 if (!(instance instanceof Constructor)) {
66 throw new TypeError("Cannot call a class as a function");
67 }
68 }
69
70 function _defineProperties(target, props) {
71 for (var i = 0; i < props.length; i++) {
72 var descriptor = props[i];
73 descriptor.enumerable = descriptor.enumerable || false;
74 descriptor.configurable = true;
75 if ("value" in descriptor) descriptor.writable = true;
76 Object.defineProperty(target, descriptor.key, descriptor);
77 }
78 }
79
80 function _createClass(Constructor, protoProps, staticProps) {
81 if (protoProps) _defineProperties(Constructor.prototype, protoProps);
82 if (staticProps) _defineProperties(Constructor, staticProps);
83 return Constructor;
84 }
85
86 function _defineProperty(obj, key, value) {
87 if (key in obj) {
88 Object.defineProperty(obj, key, {
89 value: value,
90 enumerable: true,
91 configurable: true,
92 writable: true
93 });
94 } else {
95 obj[key] = value;
96 }
97
98 return obj;
99 }
100
101 function ownKeys(object, enumerableOnly) {
102 var keys = Object.keys(object);
103
104 if (Object.getOwnPropertySymbols) {
105 var symbols = Object.getOwnPropertySymbols(object);
106 if (enumerableOnly) symbols = symbols.filter(function (sym) {
107 return Object.getOwnPropertyDescriptor(object, sym).enumerable;
108 });
109 keys.push.apply(keys, symbols);
110 }
111
112 return keys;
113 }
114
115 function _objectSpread2(target) {
116 for (var i = 1; i < arguments.length; i++) {
117 var source = arguments[i] != null ? arguments[i] : {};
118
119 if (i % 2) {
120 ownKeys(Object(source), true).forEach(function (key) {
121 _defineProperty(target, key, source[key]);
122 });
123 } else if (Object.getOwnPropertyDescriptors) {
124 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
125 } else {
126 ownKeys(Object(source)).forEach(function (key) {
127 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
128 });
129 }
130 }
131
132 return target;
133 }
134
135 function _inherits(subClass, superClass) {
136 if (typeof superClass !== "function" && superClass !== null) {
137 throw new TypeError("Super expression must either be null or a function");
138 }
139
140 subClass.prototype = Object.create(superClass && superClass.prototype, {
141 constructor: {
142 value: subClass,
143 writable: true,
144 configurable: true
145 }
146 });
147 if (superClass) _setPrototypeOf(subClass, superClass);
148 }
149
150 function _getPrototypeOf(o) {
151 _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
152 return o.__proto__ || Object.getPrototypeOf(o);
153 };
154 return _getPrototypeOf(o);
155 }
156
157 function _setPrototypeOf(o, p) {
158 _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
159 o.__proto__ = p;
160 return o;
161 };
162
163 return _setPrototypeOf(o, p);
164 }
165
166 function _isNativeReflectConstruct() {
167 if (typeof Reflect === "undefined" || !Reflect.construct) return false;
168 if (Reflect.construct.sham) return false;
169 if (typeof Proxy === "function") return true;
170
171 try {
172 Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
173 return true;
174 } catch (e) {
175 return false;
176 }
177 }
178
179 function _construct(Parent, args, Class) {
180 if (_isNativeReflectConstruct()) {
181 _construct = Reflect.construct;
182 } else {
183 _construct = function _construct(Parent, args, Class) {
184 var a = [null];
185 a.push.apply(a, args);
186 var Constructor = Function.bind.apply(Parent, a);
187 var instance = new Constructor();
188 if (Class) _setPrototypeOf(instance, Class.prototype);
189 return instance;
190 };
191 }
192
193 return _construct.apply(null, arguments);
194 }
195
196 function _isNativeFunction(fn) {
197 return Function.toString.call(fn).indexOf("[native code]") !== -1;
198 }
199
200 function _wrapNativeSuper(Class) {
201 var _cache = typeof Map === "function" ? new Map() : undefined;
202
203 _wrapNativeSuper = function _wrapNativeSuper(Class) {
204 if (Class === null || !_isNativeFunction(Class)) return Class;
205
206 if (typeof Class !== "function") {
207 throw new TypeError("Super expression must either be null or a function");
208 }
209
210 if (typeof _cache !== "undefined") {
211 if (_cache.has(Class)) return _cache.get(Class);
212
213 _cache.set(Class, Wrapper);
214 }
215
216 function Wrapper() {
217 return _construct(Class, arguments, _getPrototypeOf(this).constructor);
218 }
219
220 Wrapper.prototype = Object.create(Class.prototype, {
221 constructor: {
222 value: Wrapper,
223 enumerable: false,
224 writable: true,
225 configurable: true
226 }
227 });
228 return _setPrototypeOf(Wrapper, Class);
229 };
230
231 return _wrapNativeSuper(Class);
232 }
233
234 function _assertThisInitialized(self) {
235 if (self === void 0) {
236 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
237 }
238
239 return self;
240 }
241
242 function _possibleConstructorReturn(self, call) {
243 if (call && (typeof call === "object" || typeof call === "function")) {
244 return call;
245 }
246
247 return _assertThisInitialized(self);
248 }
249
250 function _createSuper(Derived) {
251 var hasNativeReflectConstruct = _isNativeReflectConstruct();
252
253 return function _createSuperInternal() {
254 var Super = _getPrototypeOf(Derived),
255 result;
256
257 if (hasNativeReflectConstruct) {
258 var NewTarget = _getPrototypeOf(this).constructor;
259
260 result = Reflect.construct(Super, arguments, NewTarget);
261 } else {
262 result = Super.apply(this, arguments);
263 }
264
265 return _possibleConstructorReturn(this, result);
266 };
267 }
268
269 function _slicedToArray(arr, i) {
270 return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
271 }
272
273 function _arrayWithHoles(arr) {
274 if (Array.isArray(arr)) return arr;
275 }
276
277 function _iterableToArrayLimit(arr, i) {
278 if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
279 var _arr = [];
280 var _n = true;
281 var _d = false;
282 var _e = undefined;
283
284 try {
285 for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
286 _arr.push(_s.value);
287
288 if (i && _arr.length === i) break;
289 }
290 } catch (err) {
291 _d = true;
292 _e = err;
293 } finally {
294 try {
295 if (!_n && _i["return"] != null) _i["return"]();
296 } finally {
297 if (_d) throw _e;
298 }
299 }
300
301 return _arr;
302 }
303
304 function _unsupportedIterableToArray(o, minLen) {
305 if (!o) return;
306 if (typeof o === "string") return _arrayLikeToArray(o, minLen);
307 var n = Object.prototype.toString.call(o).slice(8, -1);
308 if (n === "Object" && o.constructor) n = o.constructor.name;
309 if (n === "Map" || n === "Set") return Array.from(o);
310 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
311 }
312
313 function _arrayLikeToArray(arr, len) {
314 if (len == null || len > arr.length) len = arr.length;
315
316 for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
317
318 return arr2;
319 }
320
321 function _nonIterableRest() {
322 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
323 }
324
325 var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
326
327 function createCommonjsModule(fn) {
328 var module = { exports: {} };
329 return fn(module, module.exports), module.exports;
330 }
331
332 createCommonjsModule(function (module) {
333 var runtime = function (exports) {
334
335 var Op = Object.prototype;
336 var hasOwn = Op.hasOwnProperty;
337 var undefined$1; // More compressible than void 0.
338
339 var $Symbol = typeof Symbol === "function" ? Symbol : {};
340 var iteratorSymbol = $Symbol.iterator || "@@iterator";
341 var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
342 var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
343
344 function define(obj, key, value) {
345 Object.defineProperty(obj, key, {
346 value: value,
347 enumerable: true,
348 configurable: true,
349 writable: true
350 });
351 return obj[key];
352 }
353
354 try {
355 // IE 8 has a broken Object.defineProperty that only works on DOM objects.
356 define({}, "");
357 } catch (err) {
358 define = function define(obj, key, value) {
359 return obj[key] = value;
360 };
361 }
362
363 function wrap(innerFn, outerFn, self, tryLocsList) {
364 // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
365 var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
366 var generator = Object.create(protoGenerator.prototype);
367 var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next,
368 // .throw, and .return methods.
369
370 generator._invoke = makeInvokeMethod(innerFn, self, context);
371 return generator;
372 }
373
374 exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion
375 // record like context.tryEntries[i].completion. This interface could
376 // have been (and was previously) designed to take a closure to be
377 // invoked without arguments, but in all the cases we care about we
378 // already have an existing method we want to call, so there's no need
379 // to create a new function object. We can even get away with assuming
380 // the method takes exactly one argument, since that happens to be true
381 // in every case, so we don't have to touch the arguments object. The
382 // only additional allocation required is the completion record, which
383 // has a stable shape and so hopefully should be cheap to allocate.
384
385 function tryCatch(fn, obj, arg) {
386 try {
387 return {
388 type: "normal",
389 arg: fn.call(obj, arg)
390 };
391 } catch (err) {
392 return {
393 type: "throw",
394 arg: err
395 };
396 }
397 }
398
399 var GenStateSuspendedStart = "suspendedStart";
400 var GenStateSuspendedYield = "suspendedYield";
401 var GenStateExecuting = "executing";
402 var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as
403 // breaking out of the dispatch switch statement.
404
405 var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and
406 // .constructor.prototype properties for functions that return Generator
407 // objects. For full spec compliance, you may wish to configure your
408 // minifier not to mangle the names of these two functions.
409
410 function Generator() {}
411
412 function GeneratorFunction() {}
413
414 function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that
415 // don't natively support it.
416
417
418 var IteratorPrototype = {};
419
420 IteratorPrototype[iteratorSymbol] = function () {
421 return this;
422 };
423
424 var getProto = Object.getPrototypeOf;
425 var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
426
427 if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
428 // This environment has a native %IteratorPrototype%; use it instead
429 // of the polyfill.
430 IteratorPrototype = NativeIteratorPrototype;
431 }
432
433 var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
434 GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
435 GeneratorFunctionPrototype.constructor = GeneratorFunction;
436 GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); // Helper for defining the .next, .throw, and .return methods of the
437 // Iterator interface in terms of a single ._invoke method.
438
439 function defineIteratorMethods(prototype) {
440 ["next", "throw", "return"].forEach(function (method) {
441 define(prototype, method, function (arg) {
442 return this._invoke(method, arg);
443 });
444 });
445 }
446
447 exports.isGeneratorFunction = function (genFun) {
448 var ctor = typeof genFun === "function" && genFun.constructor;
449 return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can
450 // do is to check its .name property.
451 (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
452 };
453
454 exports.mark = function (genFun) {
455 if (Object.setPrototypeOf) {
456 Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
457 } else {
458 genFun.__proto__ = GeneratorFunctionPrototype;
459 define(genFun, toStringTagSymbol, "GeneratorFunction");
460 }
461
462 genFun.prototype = Object.create(Gp);
463 return genFun;
464 }; // Within the body of any async function, `await x` is transformed to
465 // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
466 // `hasOwn.call(value, "__await")` to determine if the yielded value is
467 // meant to be awaited.
468
469
470 exports.awrap = function (arg) {
471 return {
472 __await: arg
473 };
474 };
475
476 function AsyncIterator(generator, PromiseImpl) {
477 function invoke(method, arg, resolve, reject) {
478 var record = tryCatch(generator[method], generator, arg);
479
480 if (record.type === "throw") {
481 reject(record.arg);
482 } else {
483 var result = record.arg;
484 var value = result.value;
485
486 if (value && _typeof(value) === "object" && hasOwn.call(value, "__await")) {
487 return PromiseImpl.resolve(value.__await).then(function (value) {
488 invoke("next", value, resolve, reject);
489 }, function (err) {
490 invoke("throw", err, resolve, reject);
491 });
492 }
493
494 return PromiseImpl.resolve(value).then(function (unwrapped) {
495 // When a yielded Promise is resolved, its final value becomes
496 // the .value of the Promise<{value,done}> result for the
497 // current iteration.
498 result.value = unwrapped;
499 resolve(result);
500 }, function (error) {
501 // If a rejected Promise was yielded, throw the rejection back
502 // into the async generator function so it can be handled there.
503 return invoke("throw", error, resolve, reject);
504 });
505 }
506 }
507
508 var previousPromise;
509
510 function enqueue(method, arg) {
511 function callInvokeWithMethodAndArg() {
512 return new PromiseImpl(function (resolve, reject) {
513 invoke(method, arg, resolve, reject);
514 });
515 }
516
517 return previousPromise = // If enqueue has been called before, then we want to wait until
518 // all previous Promises have been resolved before calling invoke,
519 // so that results are always delivered in the correct order. If
520 // enqueue has not been called before, then it is important to
521 // call invoke immediately, without waiting on a callback to fire,
522 // so that the async generator function has the opportunity to do
523 // any necessary setup in a predictable way. This predictability
524 // is why the Promise constructor synchronously invokes its
525 // executor callback, and why async functions synchronously
526 // execute code before the first await. Since we implement simple
527 // async functions in terms of async generators, it is especially
528 // important to get this right, even though it requires care.
529 previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later
530 // invocations of the iterator.
531 callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
532 } // Define the unified helper method that is used to implement .next,
533 // .throw, and .return (see defineIteratorMethods).
534
535
536 this._invoke = enqueue;
537 }
538
539 defineIteratorMethods(AsyncIterator.prototype);
540
541 AsyncIterator.prototype[asyncIteratorSymbol] = function () {
542 return this;
543 };
544
545 exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of
546 // AsyncIterator objects; they just return a Promise for the value of
547 // the final result produced by the iterator.
548
549 exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
550 if (PromiseImpl === void 0) PromiseImpl = Promise;
551 var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
552 return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator.
553 : iter.next().then(function (result) {
554 return result.done ? result.value : iter.next();
555 });
556 };
557
558 function makeInvokeMethod(innerFn, self, context) {
559 var state = GenStateSuspendedStart;
560 return function invoke(method, arg) {
561 if (state === GenStateExecuting) {
562 throw new Error("Generator is already running");
563 }
564
565 if (state === GenStateCompleted) {
566 if (method === "throw") {
567 throw arg;
568 } // Be forgiving, per 25.3.3.3.3 of the spec:
569 // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
570
571
572 return doneResult();
573 }
574
575 context.method = method;
576 context.arg = arg;
577
578 while (true) {
579 var delegate = context.delegate;
580
581 if (delegate) {
582 var delegateResult = maybeInvokeDelegate(delegate, context);
583
584 if (delegateResult) {
585 if (delegateResult === ContinueSentinel) continue;
586 return delegateResult;
587 }
588 }
589
590 if (context.method === "next") {
591 // Setting context._sent for legacy support of Babel's
592 // function.sent implementation.
593 context.sent = context._sent = context.arg;
594 } else if (context.method === "throw") {
595 if (state === GenStateSuspendedStart) {
596 state = GenStateCompleted;
597 throw context.arg;
598 }
599
600 context.dispatchException(context.arg);
601 } else if (context.method === "return") {
602 context.abrupt("return", context.arg);
603 }
604
605 state = GenStateExecuting;
606 var record = tryCatch(innerFn, self, context);
607
608 if (record.type === "normal") {
609 // If an exception is thrown from innerFn, we leave state ===
610 // GenStateExecuting and loop back for another invocation.
611 state = context.done ? GenStateCompleted : GenStateSuspendedYield;
612
613 if (record.arg === ContinueSentinel) {
614 continue;
615 }
616
617 return {
618 value: record.arg,
619 done: context.done
620 };
621 } else if (record.type === "throw") {
622 state = GenStateCompleted; // Dispatch the exception by looping back around to the
623 // context.dispatchException(context.arg) call above.
624
625 context.method = "throw";
626 context.arg = record.arg;
627 }
628 }
629 };
630 } // Call delegate.iterator[context.method](context.arg) and handle the
631 // result, either by returning a { value, done } result from the
632 // delegate iterator, or by modifying context.method and context.arg,
633 // setting context.delegate to null, and returning the ContinueSentinel.
634
635
636 function maybeInvokeDelegate(delegate, context) {
637 var method = delegate.iterator[context.method];
638
639 if (method === undefined$1) {
640 // A .throw or .return when the delegate iterator has no .throw
641 // method always terminates the yield* loop.
642 context.delegate = null;
643
644 if (context.method === "throw") {
645 // Note: ["return"] must be used for ES3 parsing compatibility.
646 if (delegate.iterator["return"]) {
647 // If the delegate iterator has a return method, give it a
648 // chance to clean up.
649 context.method = "return";
650 context.arg = undefined$1;
651 maybeInvokeDelegate(delegate, context);
652
653 if (context.method === "throw") {
654 // If maybeInvokeDelegate(context) changed context.method from
655 // "return" to "throw", let that override the TypeError below.
656 return ContinueSentinel;
657 }
658 }
659
660 context.method = "throw";
661 context.arg = new TypeError("The iterator does not provide a 'throw' method");
662 }
663
664 return ContinueSentinel;
665 }
666
667 var record = tryCatch(method, delegate.iterator, context.arg);
668
669 if (record.type === "throw") {
670 context.method = "throw";
671 context.arg = record.arg;
672 context.delegate = null;
673 return ContinueSentinel;
674 }
675
676 var info = record.arg;
677
678 if (!info) {
679 context.method = "throw";
680 context.arg = new TypeError("iterator result is not an object");
681 context.delegate = null;
682 return ContinueSentinel;
683 }
684
685 if (info.done) {
686 // Assign the result of the finished delegate to the temporary
687 // variable specified by delegate.resultName (see delegateYield).
688 context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield).
689
690 context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the
691 // exception, let the outer generator proceed normally. If
692 // context.method was "next", forget context.arg since it has been
693 // "consumed" by the delegate iterator. If context.method was
694 // "return", allow the original .return call to continue in the
695 // outer generator.
696
697 if (context.method !== "return") {
698 context.method = "next";
699 context.arg = undefined$1;
700 }
701 } else {
702 // Re-yield the result returned by the delegate method.
703 return info;
704 } // The delegate iterator is finished, so forget it and continue with
705 // the outer generator.
706
707
708 context.delegate = null;
709 return ContinueSentinel;
710 } // Define Generator.prototype.{next,throw,return} in terms of the
711 // unified ._invoke helper method.
712
713
714 defineIteratorMethods(Gp);
715 define(Gp, toStringTagSymbol, "Generator"); // A Generator should always return itself as the iterator object when the
716 // @@iterator function is called on it. Some browsers' implementations of the
717 // iterator prototype chain incorrectly implement this, causing the Generator
718 // object to not be returned from this call. This ensures that doesn't happen.
719 // See https://github.com/facebook/regenerator/issues/274 for more details.
720
721 Gp[iteratorSymbol] = function () {
722 return this;
723 };
724
725 Gp.toString = function () {
726 return "[object Generator]";
727 };
728
729 function pushTryEntry(locs) {
730 var entry = {
731 tryLoc: locs[0]
732 };
733
734 if (1 in locs) {
735 entry.catchLoc = locs[1];
736 }
737
738 if (2 in locs) {
739 entry.finallyLoc = locs[2];
740 entry.afterLoc = locs[3];
741 }
742
743 this.tryEntries.push(entry);
744 }
745
746 function resetTryEntry(entry) {
747 var record = entry.completion || {};
748 record.type = "normal";
749 delete record.arg;
750 entry.completion = record;
751 }
752
753 function Context(tryLocsList) {
754 // The root entry object (effectively a try statement without a catch
755 // or a finally block) gives us a place to store values thrown from
756 // locations where there is no enclosing try statement.
757 this.tryEntries = [{
758 tryLoc: "root"
759 }];
760 tryLocsList.forEach(pushTryEntry, this);
761 this.reset(true);
762 }
763
764 exports.keys = function (object) {
765 var keys = [];
766
767 for (var key in object) {
768 keys.push(key);
769 }
770
771 keys.reverse(); // Rather than returning an object with a next method, we keep
772 // things simple and return the next function itself.
773
774 return function next() {
775 while (keys.length) {
776 var key = keys.pop();
777
778 if (key in object) {
779 next.value = key;
780 next.done = false;
781 return next;
782 }
783 } // To avoid creating an additional object, we just hang the .value
784 // and .done properties off the next function object itself. This
785 // also ensures that the minifier will not anonymize the function.
786
787
788 next.done = true;
789 return next;
790 };
791 };
792
793 function values(iterable) {
794 if (iterable) {
795 var iteratorMethod = iterable[iteratorSymbol];
796
797 if (iteratorMethod) {
798 return iteratorMethod.call(iterable);
799 }
800
801 if (typeof iterable.next === "function") {
802 return iterable;
803 }
804
805 if (!isNaN(iterable.length)) {
806 var i = -1,
807 next = function next() {
808 while (++i < iterable.length) {
809 if (hasOwn.call(iterable, i)) {
810 next.value = iterable[i];
811 next.done = false;
812 return next;
813 }
814 }
815
816 next.value = undefined$1;
817 next.done = true;
818 return next;
819 };
820
821 return next.next = next;
822 }
823 } // Return an iterator with no values.
824
825
826 return {
827 next: doneResult
828 };
829 }
830
831 exports.values = values;
832
833 function doneResult() {
834 return {
835 value: undefined$1,
836 done: true
837 };
838 }
839
840 Context.prototype = {
841 constructor: Context,
842 reset: function reset(skipTempReset) {
843 this.prev = 0;
844 this.next = 0; // Resetting context._sent for legacy support of Babel's
845 // function.sent implementation.
846
847 this.sent = this._sent = undefined$1;
848 this.done = false;
849 this.delegate = null;
850 this.method = "next";
851 this.arg = undefined$1;
852 this.tryEntries.forEach(resetTryEntry);
853
854 if (!skipTempReset) {
855 for (var name in this) {
856 // Not sure about the optimal order of these conditions:
857 if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
858 this[name] = undefined$1;
859 }
860 }
861 }
862 },
863 stop: function stop() {
864 this.done = true;
865 var rootEntry = this.tryEntries[0];
866 var rootRecord = rootEntry.completion;
867
868 if (rootRecord.type === "throw") {
869 throw rootRecord.arg;
870 }
871
872 return this.rval;
873 },
874 dispatchException: function dispatchException(exception) {
875 if (this.done) {
876 throw exception;
877 }
878
879 var context = this;
880
881 function handle(loc, caught) {
882 record.type = "throw";
883 record.arg = exception;
884 context.next = loc;
885
886 if (caught) {
887 // If the dispatched exception was caught by a catch block,
888 // then let that catch block handle the exception normally.
889 context.method = "next";
890 context.arg = undefined$1;
891 }
892
893 return !!caught;
894 }
895
896 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
897 var entry = this.tryEntries[i];
898 var record = entry.completion;
899
900 if (entry.tryLoc === "root") {
901 // Exception thrown outside of any try block that could handle
902 // it, so set the completion value of the entire function to
903 // throw the exception.
904 return handle("end");
905 }
906
907 if (entry.tryLoc <= this.prev) {
908 var hasCatch = hasOwn.call(entry, "catchLoc");
909 var hasFinally = hasOwn.call(entry, "finallyLoc");
910
911 if (hasCatch && hasFinally) {
912 if (this.prev < entry.catchLoc) {
913 return handle(entry.catchLoc, true);
914 } else if (this.prev < entry.finallyLoc) {
915 return handle(entry.finallyLoc);
916 }
917 } else if (hasCatch) {
918 if (this.prev < entry.catchLoc) {
919 return handle(entry.catchLoc, true);
920 }
921 } else if (hasFinally) {
922 if (this.prev < entry.finallyLoc) {
923 return handle(entry.finallyLoc);
924 }
925 } else {
926 throw new Error("try statement without catch or finally");
927 }
928 }
929 }
930 },
931 abrupt: function abrupt(type, arg) {
932 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
933 var entry = this.tryEntries[i];
934
935 if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
936 var finallyEntry = entry;
937 break;
938 }
939 }
940
941 if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
942 // Ignore the finally entry if control is not jumping to a
943 // location outside the try/catch block.
944 finallyEntry = null;
945 }
946
947 var record = finallyEntry ? finallyEntry.completion : {};
948 record.type = type;
949 record.arg = arg;
950
951 if (finallyEntry) {
952 this.method = "next";
953 this.next = finallyEntry.finallyLoc;
954 return ContinueSentinel;
955 }
956
957 return this.complete(record);
958 },
959 complete: function complete(record, afterLoc) {
960 if (record.type === "throw") {
961 throw record.arg;
962 }
963
964 if (record.type === "break" || record.type === "continue") {
965 this.next = record.arg;
966 } else if (record.type === "return") {
967 this.rval = this.arg = record.arg;
968 this.method = "return";
969 this.next = "end";
970 } else if (record.type === "normal" && afterLoc) {
971 this.next = afterLoc;
972 }
973
974 return ContinueSentinel;
975 },
976 finish: function finish(finallyLoc) {
977 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
978 var entry = this.tryEntries[i];
979
980 if (entry.finallyLoc === finallyLoc) {
981 this.complete(entry.completion, entry.afterLoc);
982 resetTryEntry(entry);
983 return ContinueSentinel;
984 }
985 }
986 },
987 "catch": function _catch(tryLoc) {
988 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
989 var entry = this.tryEntries[i];
990
991 if (entry.tryLoc === tryLoc) {
992 var record = entry.completion;
993
994 if (record.type === "throw") {
995 var thrown = record.arg;
996 resetTryEntry(entry);
997 }
998
999 return thrown;
1000 }
1001 } // The context.catch method must only be called with a location
1002 // argument that corresponds to a known catch block.
1003
1004
1005 throw new Error("illegal catch attempt");
1006 },
1007 delegateYield: function delegateYield(iterable, resultName, nextLoc) {
1008 this.delegate = {
1009 iterator: values(iterable),
1010 resultName: resultName,
1011 nextLoc: nextLoc
1012 };
1013
1014 if (this.method === "next") {
1015 // Deliberately forget the last sent value so that we don't
1016 // accidentally pass it on to the delegate.
1017 this.arg = undefined$1;
1018 }
1019
1020 return ContinueSentinel;
1021 }
1022 }; // Regardless of whether this script is executing as a CommonJS module
1023 // or not, return the runtime object so that we can declare the variable
1024 // regeneratorRuntime in the outer scope, which allows this module to be
1025 // injected easily by `bin/regenerator --include-runtime script.js`.
1026
1027 return exports;
1028 }( // If this script is executing as a CommonJS module, use module.exports
1029 // as the regeneratorRuntime namespace. Otherwise create a new empty
1030 // object. Either way, the resulting object will be used to initialize
1031 // the regeneratorRuntime variable at the top of this file.
1032 module.exports );
1033
1034 try {
1035 regeneratorRuntime = runtime;
1036 } catch (accidentalStrictMode) {
1037 // This module should not be running in strict mode, so the above
1038 // assignment should always work unless something is misconfigured. Just
1039 // in case runtime.js accidentally runs in strict mode, we can escape
1040 // strict mode using a global Function call. This could conceivably fail
1041 // if a Content Security Policy forbids using Function, but in that case
1042 // the proper solution is to fix the accidental strict mode problem. If
1043 // you've misconfigured your bundler to force strict mode and applied a
1044 // CSP to forbid Function, and you're not willing to fix either of those
1045 // problems, please detail your unique predicament in a GitHub issue.
1046 Function("r", "regeneratorRuntime = r")(runtime);
1047 }
1048 });
1049
1050 /** Used as the `TypeError` message for "Functions" methods. */
1051
1052 var FUNC_ERROR_TEXT = 'Expected a function';
1053 /** Used to stand-in for `undefined` hash values. */
1054
1055 var HASH_UNDEFINED = '__lodash_hash_undefined__';
1056 /** Used as references for various `Number` constants. */
1057
1058 var INFINITY = 1 / 0;
1059 /** `Object#toString` result references. */
1060
1061 var funcTag = '[object Function]',
1062 genTag = '[object GeneratorFunction]',
1063 symbolTag = '[object Symbol]';
1064 /** Used to match property names within property paths. */
1065
1066 var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
1067 reIsPlainProp = /^\w*$/,
1068 reLeadingDot = /^\./,
1069 rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
1070 /**
1071 * Used to match `RegExp`
1072 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
1073 */
1074
1075 var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
1076 /** Used to match backslashes in property paths. */
1077
1078 var reEscapeChar = /\\(\\)?/g;
1079 /** Used to detect host constructors (Safari). */
1080
1081 var reIsHostCtor = /^\[object .+?Constructor\]$/;
1082 /** Detect free variable `global` from Node.js. */
1083
1084 var freeGlobal = _typeof(commonjsGlobal) == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
1085 /** Detect free variable `self`. */
1086
1087 var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self;
1088 /** Used as a reference to the global object. */
1089
1090 var root = freeGlobal || freeSelf || Function('return this')();
1091 /**
1092 * Gets the value at `key` of `object`.
1093 *
1094 * @private
1095 * @param {Object} [object] The object to query.
1096 * @param {string} key The key of the property to get.
1097 * @returns {*} Returns the property value.
1098 */
1099
1100 function getValue(object, key) {
1101 return object == null ? undefined : object[key];
1102 }
1103 /**
1104 * Checks if `value` is a host object in IE < 9.
1105 *
1106 * @private
1107 * @param {*} value The value to check.
1108 * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
1109 */
1110
1111
1112 function isHostObject(value) {
1113 // Many host objects are `Object` objects that can coerce to strings
1114 // despite having improperly defined `toString` methods.
1115 var result = false;
1116
1117 if (value != null && typeof value.toString != 'function') {
1118 try {
1119 result = !!(value + '');
1120 } catch (e) {}
1121 }
1122
1123 return result;
1124 }
1125 /** Used for built-in method references. */
1126
1127
1128 var arrayProto = Array.prototype,
1129 funcProto = Function.prototype,
1130 objectProto = Object.prototype;
1131 /** Used to detect overreaching core-js shims. */
1132
1133 var coreJsData = root['__core-js_shared__'];
1134 /** Used to detect methods masquerading as native. */
1135
1136 var maskSrcKey = function () {
1137 var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
1138 return uid ? 'Symbol(src)_1.' + uid : '';
1139 }();
1140 /** Used to resolve the decompiled source of functions. */
1141
1142
1143 var funcToString = funcProto.toString;
1144 /** Used to check objects for own properties. */
1145
1146 var hasOwnProperty = objectProto.hasOwnProperty;
1147 /**
1148 * Used to resolve the
1149 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
1150 * of values.
1151 */
1152
1153 var objectToString = objectProto.toString;
1154 /** Used to detect if a method is native. */
1155
1156 var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
1157 /** Built-in value references. */
1158
1159 var _Symbol = root.Symbol,
1160 splice = arrayProto.splice;
1161 /* Built-in method references that are verified to be native. */
1162
1163 var Map$1 = getNative(root, 'Map'),
1164 nativeCreate = getNative(Object, 'create');
1165 /** Used to convert symbols to primitives and strings. */
1166
1167 var symbolProto = _Symbol ? _Symbol.prototype : undefined,
1168 symbolToString = symbolProto ? symbolProto.toString : undefined;
1169 /**
1170 * Creates a hash object.
1171 *
1172 * @private
1173 * @constructor
1174 * @param {Array} [entries] The key-value pairs to cache.
1175 */
1176
1177 function Hash(entries) {
1178 var index = -1,
1179 length = entries ? entries.length : 0;
1180 this.clear();
1181
1182 while (++index < length) {
1183 var entry = entries[index];
1184 this.set(entry[0], entry[1]);
1185 }
1186 }
1187 /**
1188 * Removes all key-value entries from the hash.
1189 *
1190 * @private
1191 * @name clear
1192 * @memberOf Hash
1193 */
1194
1195
1196 function hashClear() {
1197 this.__data__ = nativeCreate ? nativeCreate(null) : {};
1198 }
1199 /**
1200 * Removes `key` and its value from the hash.
1201 *
1202 * @private
1203 * @name delete
1204 * @memberOf Hash
1205 * @param {Object} hash The hash to modify.
1206 * @param {string} key The key of the value to remove.
1207 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1208 */
1209
1210
1211 function hashDelete(key) {
1212 return this.has(key) && delete this.__data__[key];
1213 }
1214 /**
1215 * Gets the hash value for `key`.
1216 *
1217 * @private
1218 * @name get
1219 * @memberOf Hash
1220 * @param {string} key The key of the value to get.
1221 * @returns {*} Returns the entry value.
1222 */
1223
1224
1225 function hashGet(key) {
1226 var data = this.__data__;
1227
1228 if (nativeCreate) {
1229 var result = data[key];
1230 return result === HASH_UNDEFINED ? undefined : result;
1231 }
1232
1233 return hasOwnProperty.call(data, key) ? data[key] : undefined;
1234 }
1235 /**
1236 * Checks if a hash value for `key` exists.
1237 *
1238 * @private
1239 * @name has
1240 * @memberOf Hash
1241 * @param {string} key The key of the entry to check.
1242 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1243 */
1244
1245
1246 function hashHas(key) {
1247 var data = this.__data__;
1248 return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
1249 }
1250 /**
1251 * Sets the hash `key` to `value`.
1252 *
1253 * @private
1254 * @name set
1255 * @memberOf Hash
1256 * @param {string} key The key of the value to set.
1257 * @param {*} value The value to set.
1258 * @returns {Object} Returns the hash instance.
1259 */
1260
1261
1262 function hashSet(key, value) {
1263 var data = this.__data__;
1264 data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
1265 return this;
1266 } // Add methods to `Hash`.
1267
1268
1269 Hash.prototype.clear = hashClear;
1270 Hash.prototype['delete'] = hashDelete;
1271 Hash.prototype.get = hashGet;
1272 Hash.prototype.has = hashHas;
1273 Hash.prototype.set = hashSet;
1274 /**
1275 * Creates an list cache object.
1276 *
1277 * @private
1278 * @constructor
1279 * @param {Array} [entries] The key-value pairs to cache.
1280 */
1281
1282 function ListCache(entries) {
1283 var index = -1,
1284 length = entries ? entries.length : 0;
1285 this.clear();
1286
1287 while (++index < length) {
1288 var entry = entries[index];
1289 this.set(entry[0], entry[1]);
1290 }
1291 }
1292 /**
1293 * Removes all key-value entries from the list cache.
1294 *
1295 * @private
1296 * @name clear
1297 * @memberOf ListCache
1298 */
1299
1300
1301 function listCacheClear() {
1302 this.__data__ = [];
1303 }
1304 /**
1305 * Removes `key` and its value from the list cache.
1306 *
1307 * @private
1308 * @name delete
1309 * @memberOf ListCache
1310 * @param {string} key The key of the value to remove.
1311 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1312 */
1313
1314
1315 function listCacheDelete(key) {
1316 var data = this.__data__,
1317 index = assocIndexOf(data, key);
1318
1319 if (index < 0) {
1320 return false;
1321 }
1322
1323 var lastIndex = data.length - 1;
1324
1325 if (index == lastIndex) {
1326 data.pop();
1327 } else {
1328 splice.call(data, index, 1);
1329 }
1330
1331 return true;
1332 }
1333 /**
1334 * Gets the list cache value for `key`.
1335 *
1336 * @private
1337 * @name get
1338 * @memberOf ListCache
1339 * @param {string} key The key of the value to get.
1340 * @returns {*} Returns the entry value.
1341 */
1342
1343
1344 function listCacheGet(key) {
1345 var data = this.__data__,
1346 index = assocIndexOf(data, key);
1347 return index < 0 ? undefined : data[index][1];
1348 }
1349 /**
1350 * Checks if a list cache value for `key` exists.
1351 *
1352 * @private
1353 * @name has
1354 * @memberOf ListCache
1355 * @param {string} key The key of the entry to check.
1356 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1357 */
1358
1359
1360 function listCacheHas(key) {
1361 return assocIndexOf(this.__data__, key) > -1;
1362 }
1363 /**
1364 * Sets the list cache `key` to `value`.
1365 *
1366 * @private
1367 * @name set
1368 * @memberOf ListCache
1369 * @param {string} key The key of the value to set.
1370 * @param {*} value The value to set.
1371 * @returns {Object} Returns the list cache instance.
1372 */
1373
1374
1375 function listCacheSet(key, value) {
1376 var data = this.__data__,
1377 index = assocIndexOf(data, key);
1378
1379 if (index < 0) {
1380 data.push([key, value]);
1381 } else {
1382 data[index][1] = value;
1383 }
1384
1385 return this;
1386 } // Add methods to `ListCache`.
1387
1388
1389 ListCache.prototype.clear = listCacheClear;
1390 ListCache.prototype['delete'] = listCacheDelete;
1391 ListCache.prototype.get = listCacheGet;
1392 ListCache.prototype.has = listCacheHas;
1393 ListCache.prototype.set = listCacheSet;
1394 /**
1395 * Creates a map cache object to store key-value pairs.
1396 *
1397 * @private
1398 * @constructor
1399 * @param {Array} [entries] The key-value pairs to cache.
1400 */
1401
1402 function MapCache(entries) {
1403 var index = -1,
1404 length = entries ? entries.length : 0;
1405 this.clear();
1406
1407 while (++index < length) {
1408 var entry = entries[index];
1409 this.set(entry[0], entry[1]);
1410 }
1411 }
1412 /**
1413 * Removes all key-value entries from the map.
1414 *
1415 * @private
1416 * @name clear
1417 * @memberOf MapCache
1418 */
1419
1420
1421 function mapCacheClear() {
1422 this.__data__ = {
1423 'hash': new Hash(),
1424 'map': new (Map$1 || ListCache)(),
1425 'string': new Hash()
1426 };
1427 }
1428 /**
1429 * Removes `key` and its value from the map.
1430 *
1431 * @private
1432 * @name delete
1433 * @memberOf MapCache
1434 * @param {string} key The key of the value to remove.
1435 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
1436 */
1437
1438
1439 function mapCacheDelete(key) {
1440 return getMapData(this, key)['delete'](key);
1441 }
1442 /**
1443 * Gets the map value for `key`.
1444 *
1445 * @private
1446 * @name get
1447 * @memberOf MapCache
1448 * @param {string} key The key of the value to get.
1449 * @returns {*} Returns the entry value.
1450 */
1451
1452
1453 function mapCacheGet(key) {
1454 return getMapData(this, key).get(key);
1455 }
1456 /**
1457 * Checks if a map value for `key` exists.
1458 *
1459 * @private
1460 * @name has
1461 * @memberOf MapCache
1462 * @param {string} key The key of the entry to check.
1463 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1464 */
1465
1466
1467 function mapCacheHas(key) {
1468 return getMapData(this, key).has(key);
1469 }
1470 /**
1471 * Sets the map `key` to `value`.
1472 *
1473 * @private
1474 * @name set
1475 * @memberOf MapCache
1476 * @param {string} key The key of the value to set.
1477 * @param {*} value The value to set.
1478 * @returns {Object} Returns the map cache instance.
1479 */
1480
1481
1482 function mapCacheSet(key, value) {
1483 getMapData(this, key).set(key, value);
1484 return this;
1485 } // Add methods to `MapCache`.
1486
1487
1488 MapCache.prototype.clear = mapCacheClear;
1489 MapCache.prototype['delete'] = mapCacheDelete;
1490 MapCache.prototype.get = mapCacheGet;
1491 MapCache.prototype.has = mapCacheHas;
1492 MapCache.prototype.set = mapCacheSet;
1493 /**
1494 * Gets the index at which the `key` is found in `array` of key-value pairs.
1495 *
1496 * @private
1497 * @param {Array} array The array to inspect.
1498 * @param {*} key The key to search for.
1499 * @returns {number} Returns the index of the matched value, else `-1`.
1500 */
1501
1502 function assocIndexOf(array, key) {
1503 var length = array.length;
1504
1505 while (length--) {
1506 if (eq(array[length][0], key)) {
1507 return length;
1508 }
1509 }
1510
1511 return -1;
1512 }
1513 /**
1514 * The base implementation of `_.get` without support for default values.
1515 *
1516 * @private
1517 * @param {Object} object The object to query.
1518 * @param {Array|string} path The path of the property to get.
1519 * @returns {*} Returns the resolved value.
1520 */
1521
1522
1523 function baseGet(object, path) {
1524 path = isKey(path, object) ? [path] : castPath(path);
1525 var index = 0,
1526 length = path.length;
1527
1528 while (object != null && index < length) {
1529 object = object[toKey(path[index++])];
1530 }
1531
1532 return index && index == length ? object : undefined;
1533 }
1534 /**
1535 * The base implementation of `_.isNative` without bad shim checks.
1536 *
1537 * @private
1538 * @param {*} value The value to check.
1539 * @returns {boolean} Returns `true` if `value` is a native function,
1540 * else `false`.
1541 */
1542
1543
1544 function baseIsNative(value) {
1545 if (!isObject(value) || isMasked(value)) {
1546 return false;
1547 }
1548
1549 var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
1550 return pattern.test(toSource(value));
1551 }
1552 /**
1553 * The base implementation of `_.toString` which doesn't convert nullish
1554 * values to empty strings.
1555 *
1556 * @private
1557 * @param {*} value The value to process.
1558 * @returns {string} Returns the string.
1559 */
1560
1561
1562 function baseToString(value) {
1563 // Exit early for strings to avoid a performance hit in some environments.
1564 if (typeof value == 'string') {
1565 return value;
1566 }
1567
1568 if (isSymbol(value)) {
1569 return symbolToString ? symbolToString.call(value) : '';
1570 }
1571
1572 var result = value + '';
1573 return result == '0' && 1 / value == -INFINITY ? '-0' : result;
1574 }
1575 /**
1576 * Casts `value` to a path array if it's not one.
1577 *
1578 * @private
1579 * @param {*} value The value to inspect.
1580 * @returns {Array} Returns the cast property path array.
1581 */
1582
1583
1584 function castPath(value) {
1585 return isArray(value) ? value : stringToPath(value);
1586 }
1587 /**
1588 * Gets the data for `map`.
1589 *
1590 * @private
1591 * @param {Object} map The map to query.
1592 * @param {string} key The reference key.
1593 * @returns {*} Returns the map data.
1594 */
1595
1596
1597 function getMapData(map, key) {
1598 var data = map.__data__;
1599 return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
1600 }
1601 /**
1602 * Gets the native function at `key` of `object`.
1603 *
1604 * @private
1605 * @param {Object} object The object to query.
1606 * @param {string} key The key of the method to get.
1607 * @returns {*} Returns the function if it's native, else `undefined`.
1608 */
1609
1610
1611 function getNative(object, key) {
1612 var value = getValue(object, key);
1613 return baseIsNative(value) ? value : undefined;
1614 }
1615 /**
1616 * Checks if `value` is a property name and not a property path.
1617 *
1618 * @private
1619 * @param {*} value The value to check.
1620 * @param {Object} [object] The object to query keys on.
1621 * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
1622 */
1623
1624
1625 function isKey(value, object) {
1626 if (isArray(value)) {
1627 return false;
1628 }
1629
1630 var type = _typeof(value);
1631
1632 if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) {
1633 return true;
1634 }
1635
1636 return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
1637 }
1638 /**
1639 * Checks if `value` is suitable for use as unique object key.
1640 *
1641 * @private
1642 * @param {*} value The value to check.
1643 * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1644 */
1645
1646
1647 function isKeyable(value) {
1648 var type = _typeof(value);
1649
1650 return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;
1651 }
1652 /**
1653 * Checks if `func` has its source masked.
1654 *
1655 * @private
1656 * @param {Function} func The function to check.
1657 * @returns {boolean} Returns `true` if `func` is masked, else `false`.
1658 */
1659
1660
1661 function isMasked(func) {
1662 return !!maskSrcKey && maskSrcKey in func;
1663 }
1664 /**
1665 * Converts `string` to a property path array.
1666 *
1667 * @private
1668 * @param {string} string The string to convert.
1669 * @returns {Array} Returns the property path array.
1670 */
1671
1672
1673 var stringToPath = memoize(function (string) {
1674 string = toString(string);
1675 var result = [];
1676
1677 if (reLeadingDot.test(string)) {
1678 result.push('');
1679 }
1680
1681 string.replace(rePropName, function (match, number, quote, string) {
1682 result.push(quote ? string.replace(reEscapeChar, '$1') : number || match);
1683 });
1684 return result;
1685 });
1686 /**
1687 * Converts `value` to a string key if it's not a string or symbol.
1688 *
1689 * @private
1690 * @param {*} value The value to inspect.
1691 * @returns {string|symbol} Returns the key.
1692 */
1693
1694 function toKey(value) {
1695 if (typeof value == 'string' || isSymbol(value)) {
1696 return value;
1697 }
1698
1699 var result = value + '';
1700 return result == '0' && 1 / value == -INFINITY ? '-0' : result;
1701 }
1702 /**
1703 * Converts `func` to its source code.
1704 *
1705 * @private
1706 * @param {Function} func The function to process.
1707 * @returns {string} Returns the source code.
1708 */
1709
1710
1711 function toSource(func) {
1712 if (func != null) {
1713 try {
1714 return funcToString.call(func);
1715 } catch (e) {}
1716
1717 try {
1718 return func + '';
1719 } catch (e) {}
1720 }
1721
1722 return '';
1723 }
1724 /**
1725 * Creates a function that memoizes the result of `func`. If `resolver` is
1726 * provided, it determines the cache key for storing the result based on the
1727 * arguments provided to the memoized function. By default, the first argument
1728 * provided to the memoized function is used as the map cache key. The `func`
1729 * is invoked with the `this` binding of the memoized function.
1730 *
1731 * **Note:** The cache is exposed as the `cache` property on the memoized
1732 * function. Its creation may be customized by replacing the `_.memoize.Cache`
1733 * constructor with one whose instances implement the
1734 * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
1735 * method interface of `delete`, `get`, `has`, and `set`.
1736 *
1737 * @static
1738 * @memberOf _
1739 * @since 0.1.0
1740 * @category Function
1741 * @param {Function} func The function to have its output memoized.
1742 * @param {Function} [resolver] The function to resolve the cache key.
1743 * @returns {Function} Returns the new memoized function.
1744 * @example
1745 *
1746 * var object = { 'a': 1, 'b': 2 };
1747 * var other = { 'c': 3, 'd': 4 };
1748 *
1749 * var values = _.memoize(_.values);
1750 * values(object);
1751 * // => [1, 2]
1752 *
1753 * values(other);
1754 * // => [3, 4]
1755 *
1756 * object.a = 2;
1757 * values(object);
1758 * // => [1, 2]
1759 *
1760 * // Modify the result cache.
1761 * values.cache.set(object, ['a', 'b']);
1762 * values(object);
1763 * // => ['a', 'b']
1764 *
1765 * // Replace `_.memoize.Cache`.
1766 * _.memoize.Cache = WeakMap;
1767 */
1768
1769
1770 function memoize(func, resolver) {
1771 if (typeof func != 'function' || resolver && typeof resolver != 'function') {
1772 throw new TypeError(FUNC_ERROR_TEXT);
1773 }
1774
1775 var memoized = function memoized() {
1776 var args = arguments,
1777 key = resolver ? resolver.apply(this, args) : args[0],
1778 cache = memoized.cache;
1779
1780 if (cache.has(key)) {
1781 return cache.get(key);
1782 }
1783
1784 var result = func.apply(this, args);
1785 memoized.cache = cache.set(key, result);
1786 return result;
1787 };
1788
1789 memoized.cache = new (memoize.Cache || MapCache)();
1790 return memoized;
1791 } // Assign cache to `_.memoize`.
1792
1793
1794 memoize.Cache = MapCache;
1795 /**
1796 * Performs a
1797 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
1798 * comparison between two values to determine if they are equivalent.
1799 *
1800 * @static
1801 * @memberOf _
1802 * @since 4.0.0
1803 * @category Lang
1804 * @param {*} value The value to compare.
1805 * @param {*} other The other value to compare.
1806 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1807 * @example
1808 *
1809 * var object = { 'a': 1 };
1810 * var other = { 'a': 1 };
1811 *
1812 * _.eq(object, object);
1813 * // => true
1814 *
1815 * _.eq(object, other);
1816 * // => false
1817 *
1818 * _.eq('a', 'a');
1819 * // => true
1820 *
1821 * _.eq('a', Object('a'));
1822 * // => false
1823 *
1824 * _.eq(NaN, NaN);
1825 * // => true
1826 */
1827
1828 function eq(value, other) {
1829 return value === other || value !== value && other !== other;
1830 }
1831 /**
1832 * Checks if `value` is classified as an `Array` object.
1833 *
1834 * @static
1835 * @memberOf _
1836 * @since 0.1.0
1837 * @category Lang
1838 * @param {*} value The value to check.
1839 * @returns {boolean} Returns `true` if `value` is an array, else `false`.
1840 * @example
1841 *
1842 * _.isArray([1, 2, 3]);
1843 * // => true
1844 *
1845 * _.isArray(document.body.children);
1846 * // => false
1847 *
1848 * _.isArray('abc');
1849 * // => false
1850 *
1851 * _.isArray(_.noop);
1852 * // => false
1853 */
1854
1855
1856 var isArray = Array.isArray;
1857 /**
1858 * Checks if `value` is classified as a `Function` object.
1859 *
1860 * @static
1861 * @memberOf _
1862 * @since 0.1.0
1863 * @category Lang
1864 * @param {*} value The value to check.
1865 * @returns {boolean} Returns `true` if `value` is a function, else `false`.
1866 * @example
1867 *
1868 * _.isFunction(_);
1869 * // => true
1870 *
1871 * _.isFunction(/abc/);
1872 * // => false
1873 */
1874
1875 function isFunction(value) {
1876 // The use of `Object#toString` avoids issues with the `typeof` operator
1877 // in Safari 8-9 which returns 'object' for typed array and other constructors.
1878 var tag = isObject(value) ? objectToString.call(value) : '';
1879 return tag == funcTag || tag == genTag;
1880 }
1881 /**
1882 * Checks if `value` is the
1883 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
1884 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
1885 *
1886 * @static
1887 * @memberOf _
1888 * @since 0.1.0
1889 * @category Lang
1890 * @param {*} value The value to check.
1891 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
1892 * @example
1893 *
1894 * _.isObject({});
1895 * // => true
1896 *
1897 * _.isObject([1, 2, 3]);
1898 * // => true
1899 *
1900 * _.isObject(_.noop);
1901 * // => true
1902 *
1903 * _.isObject(null);
1904 * // => false
1905 */
1906
1907
1908 function isObject(value) {
1909 var type = _typeof(value);
1910
1911 return !!value && (type == 'object' || type == 'function');
1912 }
1913 /**
1914 * Checks if `value` is object-like. A value is object-like if it's not `null`
1915 * and has a `typeof` result of "object".
1916 *
1917 * @static
1918 * @memberOf _
1919 * @since 4.0.0
1920 * @category Lang
1921 * @param {*} value The value to check.
1922 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
1923 * @example
1924 *
1925 * _.isObjectLike({});
1926 * // => true
1927 *
1928 * _.isObjectLike([1, 2, 3]);
1929 * // => true
1930 *
1931 * _.isObjectLike(_.noop);
1932 * // => false
1933 *
1934 * _.isObjectLike(null);
1935 * // => false
1936 */
1937
1938
1939 function isObjectLike(value) {
1940 return !!value && _typeof(value) == 'object';
1941 }
1942 /**
1943 * Checks if `value` is classified as a `Symbol` primitive or object.
1944 *
1945 * @static
1946 * @memberOf _
1947 * @since 4.0.0
1948 * @category Lang
1949 * @param {*} value The value to check.
1950 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
1951 * @example
1952 *
1953 * _.isSymbol(Symbol.iterator);
1954 * // => true
1955 *
1956 * _.isSymbol('abc');
1957 * // => false
1958 */
1959
1960
1961 function isSymbol(value) {
1962 return _typeof(value) == 'symbol' || isObjectLike(value) && objectToString.call(value) == symbolTag;
1963 }
1964 /**
1965 * Converts `value` to a string. An empty string is returned for `null`
1966 * and `undefined` values. The sign of `-0` is preserved.
1967 *
1968 * @static
1969 * @memberOf _
1970 * @since 4.0.0
1971 * @category Lang
1972 * @param {*} value The value to process.
1973 * @returns {string} Returns the string.
1974 * @example
1975 *
1976 * _.toString(null);
1977 * // => ''
1978 *
1979 * _.toString(-0);
1980 * // => '-0'
1981 *
1982 * _.toString([1, 2, 3]);
1983 * // => '1,2,3'
1984 */
1985
1986
1987 function toString(value) {
1988 return value == null ? '' : baseToString(value);
1989 }
1990 /**
1991 * Gets the value at `path` of `object`. If the resolved value is
1992 * `undefined`, the `defaultValue` is returned in its place.
1993 *
1994 * @static
1995 * @memberOf _
1996 * @since 3.7.0
1997 * @category Object
1998 * @param {Object} object The object to query.
1999 * @param {Array|string} path The path of the property to get.
2000 * @param {*} [defaultValue] The value returned for `undefined` resolved values.
2001 * @returns {*} Returns the resolved value.
2002 * @example
2003 *
2004 * var object = { 'a': [{ 'b': { 'c': 3 } }] };
2005 *
2006 * _.get(object, 'a[0].b.c');
2007 * // => 3
2008 *
2009 * _.get(object, ['a', '0', 'b', 'c']);
2010 * // => 3
2011 *
2012 * _.get(object, 'a.b.c', 'default');
2013 * // => 'default'
2014 */
2015
2016
2017 function get$1(object, path, defaultValue) {
2018 var result = object == null ? undefined : baseGet(object, path);
2019 return result === undefined ? defaultValue : result;
2020 }
2021
2022 var lodash_get = get$1;
2023
2024 var formDataFactory = {
2025 createFormData: function createFormData() {
2026 {
2027 return new FormData();
2028 }
2029 }
2030 };
2031
2032 function getInstance(baseURL) {
2033 var instance = axios__default['default'].create({
2034 baseURL: baseURL
2035 });
2036 instance.interceptors.response.use(function (response) {
2037 var otcsticket = lodash_get(response, 'headers.otcsticket');
2038
2039 if (otcsticket) {
2040 instance.defaults.headers.common['OTCSTicket'] = otcsticket;
2041 }
2042
2043 return response;
2044 }, function (error) {
2045 return Promise.reject(error);
2046 });
2047 return instance;
2048 }
2049
2050 function axiosFactory(options) {
2051 var instance = getInstance(options.baseURL);
2052 var username = lodash_get(options, 'username');
2053 var password = lodash_get(options, 'password');
2054 var otcsticket = lodash_get(options, 'otcsticket');
2055
2056 if (otcsticket) {
2057 instance.defaults.headers.common['OTCSTicket'] = otcsticket;
2058 } else if (username && password) {
2059 instance.interceptors.request.use( /*#__PURE__*/function () {
2060 var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(request) {
2061 var formData, response;
2062 return regeneratorRuntime.wrap(function _callee$(_context) {
2063 while (1) {
2064 switch (_context.prev = _context.next) {
2065 case 0:
2066 if (!request.headers.common['OTCSTicket']) {
2067 _context.next = 4;
2068 break;
2069 }
2070
2071 return _context.abrupt("return", request);
2072
2073 case 4:
2074 formData = formDataFactory.createFormData();
2075 formData.append('username', username);
2076 formData.append('password', password);
2077
2078 {
2079 _context.next = 13;
2080 break;
2081 }
2082
2083 case 10:
2084 _context.t0 = _context.sent;
2085 _context.next = 16;
2086 break;
2087
2088 case 13:
2089 _context.next = 15;
2090 return axios__default['default'].post("".concat(options.baseURL, "/api/v1/auth/"), formData);
2091
2092 case 15:
2093 _context.t0 = _context.sent;
2094
2095 case 16:
2096 response = _context.t0;
2097 request.headers.common['OTCSTicket'] = lodash_get(response, 'data.ticket');
2098 return _context.abrupt("return", request);
2099
2100 case 19:
2101 case "end":
2102 return _context.stop();
2103 }
2104 }
2105 }, _callee);
2106 }));
2107
2108 return function (_x) {
2109 return _ref.apply(this, arguments);
2110 };
2111 }());
2112 } else {
2113 throw 'You must provide an otcsticket or username and password.';
2114 }
2115
2116 return instance;
2117 }
2118
2119 var axiosFactory_1 = axiosFactory;
2120
2121 // const FormDataFactory = require('./form-data-factory')
2122 var auth = function auth(session) {
2123 return {
2124 auth: function auth() {
2125 return session.get('/api/v1/auth/');
2126 }
2127 };
2128 };
2129
2130 var Accession = 834;
2131 var ActiveFolder = 1298;
2132 var Activeview = 30309;
2133 var ActivityManager = 907;
2134 var Alias = 1;
2135 var Appearance = 480;
2136 var AppearanceFolder = 483;
2137 var AppearancesVolume = 481;
2138 var ArchiveFolder = 31711;
2139 var BackupManager = 290;
2140 var BackupProcess = 291;
2141 var BestBets = 274;
2142 var Blog = 356;
2143 var BlogEntry = 357;
2144 var BoxFolder = 530;
2145 var Category = 131;
2146 var CategoryFolder = 132;
2147 var Channel = 207;
2148 var ChannelVol = 209;
2149 var Classification = 199;
2150 var ClassificationTree = 196;
2151 var ClassifiedItems = 194;
2152 var Collection = 298;
2153 var Column = 902;
2154 var Comments = 345;
2155 var CommentsReply = 348;
2156 var CommentsVol = 346;
2157 var CommExpertContainer = 3030338;
2158 var CommExpertGroup = 3030339;
2159 var CommStore = 3030329;
2160 var CommTemplate = 3030002;
2161 var CommTemplateFolder = 3030333;
2162 var CommTemplateVol = 3030004;
2163 var CommURLStore = 3030335;
2164 var CommWorkspace = 3030334;
2165 var CommXSLVolume = 3030205;
2166 var CompoundDoc = 136;
2167 var CompoundEMail = 557;
2168 var ContentModuleFolder = 3030372;
2169 var CustomView = 146;
2170 var CustomViewTemplate = 844;
2171 var DataFlowManager = 270;
2172 var DataSourceFolder = 276;
2173 var DirWalker = 277;
2174 var Discussion = 215;
2175 var DispositionGroup = 602;
2176 var Document = 144;
2177 var DocumentLLNode = 1297;
2178 var DocumentServer = 283;
2179 var Dossier = 32912;
2180 var DossierCabinet = 32916;
2181 var DossierCabinetArchive = 31707;
2182 var DossierTemplate = 32914;
2183 var DossierTemplateFolder = 31709;
2184 var DossierTemplatesVolume = 32917;
2185 var DossierTemplateVolume = 32915;
2186 var DossierVolume = 32913;
2187 var DPSBinding = 31602;
2188 var DPSFolder = 31601;
2189 var DPSVolume = 31603;
2190 var DTDLLNode = 335;
2191 var DynamicView = 900;
2192 var EMail = 749;
2193 var EmailConversationItems = 2504;
2194 var Facet = 904;
2195 var FacetFolder = 905;
2196 var FacetTree = 903;
2197 var FailedFolder = 1299;
2198 var FixedSystemColumn = 906;
2199 var Folder = 0;
2200 var Form = 223;
2201 var Generation = 2;
2202 var GENERICCONTENTMODULE = 3030371;
2203 var GlobalAppearance = 482;
2204 var HoldContainer = 833;
2205 var HTMLConversion = 282;
2206 var HTMLFormView = 226;
2207 var Importer = 293;
2208 var Inbox = 731;
2209 var IndexEngine = 368;
2210 var IndexTracer = 147;
2211 var IndexUpdate = 281;
2212 var InternalOTDS = 924;
2213 var ItemTemplateVol = 541;
2214 var ItemTemplateVolFolder = 542;
2215 var JournalVolume = 361;
2216 var LibraryExtractor = 259;
2217 var LibraryObj = 272;
2218 var LLNodeFAQ = 123475;
2219 var LLNodeFAQEntry = 123476;
2220 var LLNodeForum = 123469;
2221 var LLNodeForumEntry = 123470;
2222 var LLNodeURQuestion = 430;
2223 var LLNodeURReply = 432;
2224 var Locators = 422;
2225 var Mailbox = 732;
2226 var MailStore = 3030331;
2227 var ManagedSpace = 31710;
2228 var MediaType = 410;
2229 var MediaTypesContainer = 414;
2230 var MemcachedFolder = 919;
2231 var MemcachedProcess = 920;
2232 var Merge = 273;
2233 var MicroPost = 1281;
2234 var MicroPostVolume = 1282;
2235 var MultiVolClassification = 372;
2236 var MultiVolClassificationProxy = 374;
2237 var MultiVolClassificationTree = 373;
2238 var MyReservedItems = 870;
2239 var MyWorkbenches = 532;
2240 var NAVMENUVOL = 3030756;
2241 var News = 208;
2242 var OTCIndexObj = 257;
2243 var Partition = 371;
2244 var PartitionMap = 370;
2245 var PersonalComm = 3030203;
2246 var PersonalCommSystemVolume = 3030003;
2247 var PersonalCommVol = 3030204;
2248 var PersonalStagingFolder = 398;
2249 var PersonalWebpage = 3030343;
2250 var PhysicalItemBox = 424;
2251 var PhysicalItemContainer = 412;
2252 var PhysicalItemCopy = 419;
2253 var PhysicalItem_non_Container = 411;
2254 var PhysObjAdmin = 415;
2255 var PhysObjBatchLabels = 418;
2256 var PhysObjCirculation = 416;
2257 var PhysObjReports = 417;
2258 var Poll = 218;
2259 var Process = 271;
2260 var Profile = 195;
2261 var Project = 202;
2262 var ProjectTemplate = 543;
2263 var ProjectVol = 201;
2264 var Prospector = 384;
2265 var ProspectorQueries = 380;
2266 var ProspectorSnapshot = 387;
2267 var Provenance = 829;
2268 var PublishingFolder = 31712;
2269 var PublishingFolderVolume = 31713;
2270 var QAFolder = 441;
2271 var QueryFile = 296;
2272 var QuestionVolume = 431;
2273 var RecentItems = 327;
2274 var RecordType = 425;
2275 var RecordTypesContainer = 428;
2276 var RedForm = 32918;
2277 var RedFormVolume = 32919;
2278 var Release = 138;
2279 var RemoteLLDataSource = 381;
2280 var Reply = 134;
2281 var Report = 299;
2282 var Revision = 139;
2283 var RIMSDisposition = 555;
2284 var RIMSDispositionsContainer = 554;
2285 var RIMSHoldMaintenance = 552;
2286 var RIMSRsiContainer = 553;
2287 var RMAdministration = 556;
2288 var RMClassification = 551;
2289 var RMFolder = 426;
2290 var RMPart = 427;
2291 var RMReportsContainer = 558;
2292 var RMThesaurus = 559;
2293 var ScanConfigurationVolume = 2505;
2294 var ScheduledHoldCriteria = 835;
2295 var ScriptNode = 32901;
2296 var SearchBroker = 258;
2297 var SearchEngine = 369;
2298 var SearchManager = 269;
2299 var SearchReport = 278;
2300 var SearchResultsTemplate = 383;
2301 var SearchTemplate = 292;
2302 var Simplate = 31678;
2303 var SkyPodLLVolume = 49547;
2304 var SliceFolder = 275;
2305 var SocialObject = 1280;
2306 var SocialObjectVolume = 1283;
2307 var SPCJOBDESCR = 797;
2308 var SPCJOBDESCRFOLDER = 796;
2309 var SPCVOLUME = 795;
2310 var spdcommittee = 3030202;
2311 var spdcommitteevol = 3030201;
2312 var spdcommitteevolume = 3030001;
2313 var spdemail = 3030130;
2314 var Spider = 280;
2315 var StorageManagement = 421;
2316 var SubmitVersionNode = 231;
2317 var Task = 206;
2318 var TaskGroup = 205;
2319 var TaskList = 204;
2320 var TaskListVol = 210;
2321 var TaskMilestone = 212;
2322 var Template = 230;
2323 var TemplateFolder = 268;
2324 var TextDocument = 145;
2325 var Topic = 130;
2326 var Transfers = 423;
2327 var TransportBox = 531;
2328 var TransportItem = 526;
2329 var TransportItemPart = 527;
2330 var UrgentRequests = 3030330;
2331 var URL = 140;
2332 var VirtualFolder = 899;
2333 var VolBlog = 123461;
2334 var VolCategories = 133;
2335 var VolClassification = 198;
2336 var VolComments = 347;
2337 var VolDAP = 987352;
2338 var VolDeletedItems = 405;
2339 var VolDirectory = 375;
2340 var VolDiscussion = 143;
2341 var VolDomainWorkspace = 180;
2342 var VolDTD = 336;
2343 var VolEditWorkflow = 162;
2344 var VolFacets = 901;
2345 var VolLibrary = 141;
2346 var VolOrphan = 403;
2347 var VolPersonalStaging = 397;
2348 var VolPerspectives = 908;
2349 var VolPhysObj = 413;
2350 var VolRecMan = 550;
2351 var VolRelease = 137;
2352 var VolReports = 211;
2353 var VolSystem = 148;
2354 var VolTracer = 149;
2355 var VolumeFolder = 484;
2356 var VolumeLLVolume = 1296;
2357 var VolWarehouse = 525;
2358 var VolWorkbin = 142;
2359 var VolWorkflow = 161;
2360 var WarehouseFolder = 529;
2361 var WebFormConnectionVolume = 236;
2362 var WebFormDatabaseConnection = 235;
2363 var WebFormLookup = 234;
2364 var WebFormLookupVolume = 233;
2365 var WebReports = 30303;
2366 var WFMapLLNode = 128;
2367 var WFStatusNode = 190;
2368 var WIKI = 5573;
2369 var WIKIPAGE = 5574;
2370 var Workbench = 528;
2371 var WorkflowAttachments = 154;
2372 var XMLActivatorCon = 286;
2373 var XMLActivatorProd = 285;
2374 var SubTypes = {
2375 "2WayTee": 294,
2376 Accession: Accession,
2377 ActiveFolder: ActiveFolder,
2378 Activeview: Activeview,
2379 ActivityManager: ActivityManager,
2380 Alias: Alias,
2381 Appearance: Appearance,
2382 AppearanceFolder: AppearanceFolder,
2383 AppearancesVolume: AppearancesVolume,
2384 ArchiveFolder: ArchiveFolder,
2385 BackupManager: BackupManager,
2386 BackupProcess: BackupProcess,
2387 BestBets: BestBets,
2388 Blog: Blog,
2389 BlogEntry: BlogEntry,
2390 BoxFolder: BoxFolder,
2391 Category: Category,
2392 CategoryFolder: CategoryFolder,
2393 Channel: Channel,
2394 ChannelVol: ChannelVol,
2395 Classification: Classification,
2396 "Classification Shortcut": 197,
2397 ClassificationTree: ClassificationTree,
2398 ClassifiedItems: ClassifiedItems,
2399 Collection: Collection,
2400 Column: Column,
2401 Comments: Comments,
2402 CommentsReply: CommentsReply,
2403 CommentsVol: CommentsVol,
2404 CommExpertContainer: CommExpertContainer,
2405 CommExpertGroup: CommExpertGroup,
2406 CommStore: CommStore,
2407 CommTemplate: CommTemplate,
2408 CommTemplateFolder: CommTemplateFolder,
2409 CommTemplateVol: CommTemplateVol,
2410 CommURLStore: CommURLStore,
2411 CommWorkspace: CommWorkspace,
2412 CommXSLVolume: CommXSLVolume,
2413 CompoundDoc: CompoundDoc,
2414 CompoundEMail: CompoundEMail,
2415 ContentModuleFolder: ContentModuleFolder,
2416 "csapps CSApplicationManifest": 32658,
2417 "csapps CSApplicationsVolume": 32657,
2418 CustomView: CustomView,
2419 CustomViewTemplate: CustomViewTemplate,
2420 DataFlowManager: DataFlowManager,
2421 DataSourceFolder: DataSourceFolder,
2422 DirWalker: DirWalker,
2423 Discussion: Discussion,
2424 DispositionGroup: DispositionGroup,
2425 Document: Document,
2426 DocumentLLNode: DocumentLLNode,
2427 DocumentServer: DocumentServer,
2428 Dossier: Dossier,
2429 DossierCabinet: DossierCabinet,
2430 DossierCabinetArchive: DossierCabinetArchive,
2431 DossierTemplate: DossierTemplate,
2432 DossierTemplateFolder: DossierTemplateFolder,
2433 DossierTemplatesVolume: DossierTemplatesVolume,
2434 DossierTemplateVolume: DossierTemplateVolume,
2435 DossierVolume: DossierVolume,
2436 DPSBinding: DPSBinding,
2437 DPSFolder: DPSFolder,
2438 DPSVolume: DPSVolume,
2439 DTDLLNode: DTDLLNode,
2440 DynamicView: DynamicView,
2441 EMail: EMail,
2442 EmailConversationItems: EmailConversationItems,
2443 "Enterprise Archive Document": 753,
2444 Facet: Facet,
2445 FacetFolder: FacetFolder,
2446 FacetTree: FacetTree,
2447 FailedFolder: FailedFolder,
2448 FixedSystemColumn: FixedSystemColumn,
2449 Folder: Folder,
2450 Form: Form,
2451 Generation: Generation,
2452 GENERICCONTENTMODULE: GENERICCONTENTMODULE,
2453 GlobalAppearance: GlobalAppearance,
2454 HoldContainer: HoldContainer,
2455 HTMLConversion: HTMLConversion,
2456 HTMLFormView: HTMLFormView,
2457 Importer: Importer,
2458 Inbox: Inbox,
2459 IndexEngine: IndexEngine,
2460 IndexTracer: IndexTracer,
2461 IndexUpdate: IndexUpdate,
2462 InternalOTDS: InternalOTDS,
2463 ItemTemplateVol: ItemTemplateVol,
2464 ItemTemplateVolFolder: ItemTemplateVolFolder,
2465 JournalVolume: JournalVolume,
2466 LibraryExtractor: LibraryExtractor,
2467 LibraryObj: LibraryObj,
2468 "LLNode Email Folder": 751,
2469 LLNodeFAQ: LLNodeFAQ,
2470 LLNodeFAQEntry: LLNodeFAQEntry,
2471 LLNodeForum: LLNodeForum,
2472 LLNodeForumEntry: LLNodeForumEntry,
2473 LLNodeURQuestion: LLNodeURQuestion,
2474 LLNodeURReply: LLNodeURReply,
2475 Locators: Locators,
2476 Mailbox: Mailbox,
2477 MailStore: MailStore,
2478 ManagedSpace: ManagedSpace,
2479 MediaType: MediaType,
2480 MediaTypesContainer: MediaTypesContainer,
2481 MemcachedFolder: MemcachedFolder,
2482 MemcachedProcess: MemcachedProcess,
2483 Merge: Merge,
2484 MicroPost: MicroPost,
2485 MicroPostVolume: MicroPostVolume,
2486 MultiVolClassification: MultiVolClassification,
2487 MultiVolClassificationProxy: MultiVolClassificationProxy,
2488 MultiVolClassificationTree: MultiVolClassificationTree,
2489 MyReservedItems: MyReservedItems,
2490 MyWorkbenches: MyWorkbenches,
2491 NAVMENUVOL: NAVMENUVOL,
2492 News: News,
2493 OTCIndexObj: OTCIndexObj,
2494 Partition: Partition,
2495 PartitionMap: PartitionMap,
2496 PersonalComm: PersonalComm,
2497 PersonalCommSystemVolume: PersonalCommSystemVolume,
2498 PersonalCommVol: PersonalCommVol,
2499 PersonalStagingFolder: PersonalStagingFolder,
2500 PersonalWebpage: PersonalWebpage,
2501 PhysicalItemBox: PhysicalItemBox,
2502 PhysicalItemContainer: PhysicalItemContainer,
2503 PhysicalItemCopy: PhysicalItemCopy,
2504 PhysicalItem_non_Container: PhysicalItem_non_Container,
2505 PhysObjAdmin: PhysObjAdmin,
2506 PhysObjBatchLabels: PhysObjBatchLabels,
2507 PhysObjCirculation: PhysObjCirculation,
2508 PhysObjReports: PhysObjReports,
2509 Poll: Poll,
2510 Process: Process,
2511 Profile: Profile,
2512 Project: Project,
2513 ProjectTemplate: ProjectTemplate,
2514 ProjectVol: ProjectVol,
2515 Prospector: Prospector,
2516 ProspectorQueries: ProspectorQueries,
2517 ProspectorSnapshot: ProspectorSnapshot,
2518 Provenance: Provenance,
2519 "Proxy": 260,
2520 PublishingFolder: PublishingFolder,
2521 PublishingFolderVolume: PublishingFolderVolume,
2522 QAFolder: QAFolder,
2523 QueryFile: QueryFile,
2524 QuestionVolume: QuestionVolume,
2525 RecentItems: RecentItems,
2526 RecordType: RecordType,
2527 RecordTypesContainer: RecordTypesContainer,
2528 RedForm: RedForm,
2529 RedFormVolume: RedFormVolume,
2530 Release: Release,
2531 RemoteLLDataSource: RemoteLLDataSource,
2532 Reply: Reply,
2533 Report: Report,
2534 Revision: Revision,
2535 RIMSDisposition: RIMSDisposition,
2536 RIMSDispositionsContainer: RIMSDispositionsContainer,
2537 RIMSHoldMaintenance: RIMSHoldMaintenance,
2538 RIMSRsiContainer: RIMSRsiContainer,
2539 RMAdministration: RMAdministration,
2540 RMClassification: RMClassification,
2541 RMFolder: RMFolder,
2542 RMPart: RMPart,
2543 RMReportsContainer: RMReportsContainer,
2544 RMThesaurus: RMThesaurus,
2545 ScanConfigurationVolume: ScanConfigurationVolume,
2546 ScheduledHoldCriteria: ScheduledHoldCriteria,
2547 ScriptNode: ScriptNode,
2548 SearchBroker: SearchBroker,
2549 SearchEngine: SearchEngine,
2550 SearchManager: SearchManager,
2551 SearchReport: SearchReport,
2552 SearchResultsTemplate: SearchResultsTemplate,
2553 SearchTemplate: SearchTemplate,
2554 Simplate: Simplate,
2555 SkyPodLLVolume: SkyPodLLVolume,
2556 SliceFolder: SliceFolder,
2557 SocialObject: SocialObject,
2558 SocialObjectVolume: SocialObjectVolume,
2559 SPCJOBDESCR: SPCJOBDESCR,
2560 SPCJOBDESCRFOLDER: SPCJOBDESCRFOLDER,
2561 SPCVOLUME: SPCVOLUME,
2562 spdcommittee: spdcommittee,
2563 spdcommitteevol: spdcommitteevol,
2564 spdcommitteevolume: spdcommitteevolume,
2565 spdemail: spdemail,
2566 Spider: Spider,
2567 StorageManagement: StorageManagement,
2568 SubmitVersionNode: SubmitVersionNode,
2569 Task: Task,
2570 TaskGroup: TaskGroup,
2571 TaskList: TaskList,
2572 TaskListVol: TaskListVol,
2573 TaskMilestone: TaskMilestone,
2574 Template: Template,
2575 TemplateFolder: TemplateFolder,
2576 TextDocument: TextDocument,
2577 Topic: Topic,
2578 Transfers: Transfers,
2579 TransportBox: TransportBox,
2580 TransportItem: TransportItem,
2581 TransportItemPart: TransportItemPart,
2582 UrgentRequests: UrgentRequests,
2583 URL: URL,
2584 VirtualFolder: VirtualFolder,
2585 VolBlog: VolBlog,
2586 VolCategories: VolCategories,
2587 VolClassification: VolClassification,
2588 VolComments: VolComments,
2589 VolDAP: VolDAP,
2590 VolDeletedItems: VolDeletedItems,
2591 VolDirectory: VolDirectory,
2592 VolDiscussion: VolDiscussion,
2593 VolDomainWorkspace: VolDomainWorkspace,
2594 VolDTD: VolDTD,
2595 VolEditWorkflow: VolEditWorkflow,
2596 VolFacets: VolFacets,
2597 VolLibrary: VolLibrary,
2598 VolOrphan: VolOrphan,
2599 VolPersonalStaging: VolPersonalStaging,
2600 VolPerspectives: VolPerspectives,
2601 VolPhysObj: VolPhysObj,
2602 VolRecMan: VolRecMan,
2603 VolRelease: VolRelease,
2604 VolReports: VolReports,
2605 VolSystem: VolSystem,
2606 VolTracer: VolTracer,
2607 VolumeFolder: VolumeFolder,
2608 VolumeLLVolume: VolumeLLVolume,
2609 VolWarehouse: VolWarehouse,
2610 VolWorkbin: VolWorkbin,
2611 VolWorkflow: VolWorkflow,
2612 WarehouseFolder: WarehouseFolder,
2613 WebFormConnectionVolume: WebFormConnectionVolume,
2614 WebFormDatabaseConnection: WebFormDatabaseConnection,
2615 WebFormLookup: WebFormLookup,
2616 WebFormLookupVolume: WebFormLookupVolume,
2617 WebReports: WebReports,
2618 WFMapLLNode: WFMapLLNode,
2619 WFStatusNode: WFStatusNode,
2620 WIKI: WIKI,
2621 WIKIPAGE: WIKIPAGE,
2622 Workbench: Workbench,
2623 WorkflowAttachments: WorkflowAttachments,
2624 XMLActivatorCon: XMLActivatorCon,
2625 XMLActivatorProd: XMLActivatorProd
2626 };
2627
2628 var nodes = function nodes(session) {
2629 return {
2630 addablenodetypes: function addablenodetypes(dataid) {
2631 return session.get("api/v1/nodes/".concat(dataid, "/addablenodetypes"));
2632 },
2633 addDocument: function addDocument(_ref) {
2634 return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
2635 var parent_id, fileHandler, _ref$apiVersion, apiVersion, _ref$name, name, _ref$options, options, url, path, f, csName, params, _csName, _params;
2636
2637 return regeneratorRuntime.wrap(function _callee$(_context) {
2638 while (1) {
2639 switch (_context.prev = _context.next) {
2640 case 0:
2641 parent_id = _ref.parent_id, fileHandler = _ref.fileHandler, _ref$apiVersion = _ref.apiVersion, apiVersion = _ref$apiVersion === void 0 ? 'v1' : _ref$apiVersion, _ref$name = _ref.name, name = _ref$name === void 0 ? null : _ref$name, _ref$options = _ref.options, options = _ref$options === void 0 ? {} : _ref$options;
2642 assert__default['default'](parent_id != null, 'parent_id cannot be null');
2643 assert__default['default'](fileHandler != null, 'fileHandler cannot be null');
2644 assert__default['default'](['v1', 'v2'].includes(apiVersion), "apiVersion must be in ['v1','v2']");
2645 url = "api/".concat(apiVersion, "/nodes");
2646
2647 {
2648 _context.next = 16;
2649 break;
2650 }
2651
2652 case 10:
2653 f = _context.sent;
2654 csName = name || path.basename(fileHandler);
2655 params = _objectSpread2(_objectSpread2({}, options), {}, {
2656 type: SubTypes.Document,
2657 name: csName,
2658 parent_id: parent_id,
2659 file: {
2660 file: f,
2661 name: csName
2662 }
2663 });
2664 return _context.abrupt("return", session.postForm(url, params));
2665
2666 case 16:
2667 // browser
2668 _csName = name || fileHandler.name;
2669 _params = _objectSpread2(_objectSpread2({}, options), {}, {
2670 type: SubTypes.Document,
2671 name: _csName,
2672 parent_id: parent_id,
2673 file: {
2674 file: fileHandler,
2675 name: _csName
2676 }
2677 });
2678 return _context.abrupt("return", session.postForm(url, _params));
2679
2680 case 19:
2681 case "end":
2682 return _context.stop();
2683 }
2684 }
2685 }, _callee);
2686 }))();
2687 },
2688 addDocumentMajor: function addDocumentMajor(_ref2) {
2689 var _this = this;
2690
2691 return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
2692 var parent_id, fileHandler, _ref2$name, name, _ref2$description, description, _ref2$options, options, response, dataid;
2693
2694 return regeneratorRuntime.wrap(function _callee2$(_context2) {
2695 while (1) {
2696 switch (_context2.prev = _context2.next) {
2697 case 0:
2698 parent_id = _ref2.parent_id, fileHandler = _ref2.fileHandler, _ref2$name = _ref2.name, name = _ref2$name === void 0 ? null : _ref2$name, _ref2$description = _ref2.description, description = _ref2$description === void 0 ? null : _ref2$description, _ref2$options = _ref2.options, options = _ref2$options === void 0 ? {} : _ref2$options;
2699 _context2.next = 3;
2700 return _this.addDocument({
2701 parent_id: parent_id,
2702 fileHandler: fileHandler,
2703 name: name,
2704 options: _objectSpread2(_objectSpread2({}, options), {}, {
2705 advanced_versioning: true
2706 })
2707 });
2708
2709 case 3:
2710 response = _context2.sent;
2711 dataid = response.data.id;
2712 _context2.next = 7;
2713 return session.versions.promote({
2714 dataid: dataid,
2715 versionNumber: 1,
2716 description: description
2717 });
2718
2719 case 7:
2720 _context2.next = 9;
2721 return session.versions.deleteVersion({
2722 dataid: dataid,
2723 versionNumber: 1
2724 });
2725
2726 case 9:
2727 return _context2.abrupt("return", response);
2728
2729 case 10:
2730 case "end":
2731 return _context2.stop();
2732 }
2733 }
2734 }, _callee2);
2735 }))();
2736 },
2737 addItem: function addItem(type, parent_id, name) {
2738 var params = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
2739 return session.postBody('api/v2/nodes', _objectSpread2({
2740 type: type,
2741 parent_id: parent_id,
2742 name: name
2743 }, params));
2744 },
2745 node: function node(dataid) {
2746 var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2747 return session.get("api/v2/nodes/".concat(dataid), {
2748 params: params
2749 });
2750 },
2751 ancestors: function ancestors(dataid) {
2752 var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2753 return session.get("api/v1/nodes/".concat(dataid, "/ancestors"), {
2754 params: params
2755 });
2756 },
2757 volumeInfo: function volumeInfo(objType) {
2758 return session.get("api/v1/volumes/".concat(objType));
2759 },
2760 volumes: function volumes() {
2761 return session.get('api/v2/volumes');
2762 },
2763 addFolder: function addFolder(parent_id, name) {
2764 var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
2765 return this.addItem(SubTypes.Folder, parent_id, name, params);
2766 },
2767 addGeneration: function addGeneration(parent_id, name, original_id, version_number) {
2768 var params = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
2769 return this.addItem(SubTypes.Generation, parent_id, name, _objectSpread2({
2770 original_id: original_id,
2771 version_number: version_number
2772 }, params));
2773 },
2774 nodes: function nodes(dataid) {
2775 var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2776 // https://developer.opentext.com/webaccess/#url=%2Fawd%2Fresources%2Fapis%2Fcs-rest-api-for-cs-16-s%23!%2Fnodes%2FgetSubnodes_get_15&tab=501
2777 return session.get("api/v2/nodes/".concat(dataid, "/nodes"), {
2778 params: params
2779 });
2780 },
2781 children: function children(dataid) {
2782 var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2783 return this.nodes(dataid, params);
2784 },
2785 delete: function _delete(dataid) {
2786 return session.delete("api/v1/nodes/".concat(dataid));
2787 },
2788 download: function download(dataid) {
2789
2790 // session.nodes.download(1267501, 'v2', '/Users/chris/Downloads/test.pdf')
2791 {
2792 return Promise.reject('Not implemented yet');
2793 }
2794 }
2795 };
2796 };
2797
2798 // const get = require('lodash.get')
2799 var workflow = function workflow(session) {
2800 return {
2801 start: function start(map_id) {
2802 var _this = this;
2803
2804 return this.draftprocesses(map_id).then(function (response) {
2805 return get(response, 'data.results.draftprocess_id');
2806 }).then(function (draftprocess_id) {
2807 return _this.draftprocesses_update(draftprocess_id);
2808 });
2809 },
2810 draftprocesses: function draftprocesses(workflow_id) {
2811 return session.postForm('api/v2/draftprocesses', {
2812 workflow_id: workflow_id
2813 });
2814 },
2815 draftprocesses_update: function draftprocesses_update(draftprocess_id) {
2816 return session.get('api/v1/forms/draftprocesses/update', {
2817 params: {
2818 draftprocess_id: draftprocess_id
2819 }
2820 });
2821 },
2822 draftprocesses_put: function draftprocesses_put(draftprocess_id, body) {
2823 return session.putForm("api/v2/draftprocesses/".concat(draftprocess_id), {
2824 body: body
2825 });
2826 } // draftprocesses_formUpdate(draftprocess_id, values) {
2827 // const body = {
2828 // action: "formUpdate",
2829 // values
2830 // }
2831 // return this.draftprocesses_put(draftprocess_id, body)
2832 // }
2833
2834 };
2835 };
2836
2837 var rhcore = function rhcore(session) {
2838 return {
2839 scriptNode: function scriptNode(id) {
2840 var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2841 return session.get("api/v1/rhcore/".concat(id), {
2842 params: params
2843 });
2844 }
2845 };
2846 };
2847
2848 var search = function search(session) {
2849 return {
2850 // https://knowledge.opentext.com/knowledge/cs.dll/Open/67789539
2851 search: function search(where) {
2852 var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2853 return session.postBody("api/v2/search", _objectSpread2({
2854 where: where
2855 }, params));
2856 },
2857 regions: function regions() {
2858 var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2859 return session.get("api/v1/regions", params);
2860 }
2861 };
2862 };
2863
2864 var members = function members(session) {
2865 return {
2866 USER: 0,
2867 GROUP: 1,
2868 userQuery: function userQuery(query) {
2869 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2870 var version = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'v2';
2871
2872 var params = _objectSpread2({
2873 limit: 20,
2874 where_type: JSON.stringify([this.USER, this.GROUP]),
2875 query: query
2876 }, options);
2877
2878 return session.get("api/".concat(version, "/members"), {
2879 params: params
2880 });
2881 },
2882 member: function member(id) {
2883 var version = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'v2';
2884 return session.getCached("api/".concat(version, "/members/").concat(id));
2885 }
2886 };
2887 };
2888
2889 var versions = function versions(session) {
2890 return {
2891 addVersion: function addVersion(_ref) {
2892 return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
2893 var dataid, fileHandler, _ref$apiVersion, apiVersion, _ref$fileName, fileName, _ref$options, options, url, path, f, name, params, _name, _params;
2894
2895 return regeneratorRuntime.wrap(function _callee$(_context) {
2896 while (1) {
2897 switch (_context.prev = _context.next) {
2898 case 0:
2899 dataid = _ref.dataid, fileHandler = _ref.fileHandler, _ref$apiVersion = _ref.apiVersion, apiVersion = _ref$apiVersion === void 0 ? 'v1' : _ref$apiVersion, _ref$fileName = _ref.fileName, fileName = _ref$fileName === void 0 ? null : _ref$fileName, _ref$options = _ref.options, options = _ref$options === void 0 ? {} : _ref$options;
2900 assert__default['default'](dataid != null, 'dataid cannot be null');
2901 assert__default['default'](fileHandler != null, 'fileHandler cannot be null');
2902 url = "api/".concat(apiVersion, "/nodes/").concat(dataid, "/versions");
2903
2904 {
2905 _context.next = 15;
2906 break;
2907 }
2908
2909 case 9:
2910 f = _context.sent;
2911 name = fileName || path.basename(fileHandler);
2912 params = _objectSpread2({
2913 file: {
2914 file: f,
2915 name: name
2916 }
2917 }, options); // console.log(params)
2918
2919 return _context.abrupt("return", session.postForm(url, params));
2920
2921 case 15:
2922 // browser
2923 _name = fileName || fileHandler.name;
2924 _params = _objectSpread2({
2925 file: {
2926 file: fileHandler,
2927 name: _name
2928 }
2929 }, options);
2930 return _context.abrupt("return", session.postForm(url, _params));
2931
2932 case 18:
2933 case "end":
2934 return _context.stop();
2935 }
2936 }
2937 }, _callee);
2938 }))();
2939 },
2940 list: function list(dataid) {
2941 return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
2942 var url;
2943 return regeneratorRuntime.wrap(function _callee2$(_context2) {
2944 while (1) {
2945 switch (_context2.prev = _context2.next) {
2946 case 0:
2947 url = "api/v1/nodes/".concat(dataid, "/versions");
2948 return _context2.abrupt("return", session.get(url));
2949
2950 case 2:
2951 case "end":
2952 return _context2.stop();
2953 }
2954 }
2955 }, _callee2);
2956 }))();
2957 },
2958 version: function version(dataid) {
2959 var _arguments = arguments;
2960 return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
2961 var version_number, url;
2962 return regeneratorRuntime.wrap(function _callee3$(_context3) {
2963 while (1) {
2964 switch (_context3.prev = _context3.next) {
2965 case 0:
2966 version_number = _arguments.length > 1 && _arguments[1] !== undefined ? _arguments[1] : 'latest';
2967 // latest not supported in v2
2968 url = "api/v1/nodes/".concat(dataid, "/versions/").concat(version_number);
2969 return _context3.abrupt("return", session.get(url));
2970
2971 case 3:
2972 case "end":
2973 return _context3.stop();
2974 }
2975 }
2976 }, _callee3);
2977 }))();
2978 },
2979 promote: function promote(_ref2) {
2980 return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
2981 var dataid, versionNumber, _ref2$description, description, url;
2982
2983 return regeneratorRuntime.wrap(function _callee4$(_context4) {
2984 while (1) {
2985 switch (_context4.prev = _context4.next) {
2986 case 0:
2987 dataid = _ref2.dataid, versionNumber = _ref2.versionNumber, _ref2$description = _ref2.description, description = _ref2$description === void 0 ? null : _ref2$description;
2988 assert__default['default'](dataid != null, 'dataid cannot be null');
2989 assert__default['default'](versionNumber != null, 'number_to_keep must be an integer');
2990 url = "api/v2/nodes/".concat(dataid, "/versions/").concat(versionNumber, "/promote");
2991 return _context4.abrupt("return", session.postBody(url, _objectSpread2({}, !!description && {
2992 description: description
2993 })));
2994
2995 case 5:
2996 case "end":
2997 return _context4.stop();
2998 }
2999 }
3000 }, _callee4);
3001 }))();
3002 },
3003 deleteVersion: function deleteVersion(_ref3) {
3004 return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
3005 var dataid, versionNumber, _ref3$apiVersion, apiVersion, url;
3006
3007 return regeneratorRuntime.wrap(function _callee5$(_context5) {
3008 while (1) {
3009 switch (_context5.prev = _context5.next) {
3010 case 0:
3011 dataid = _ref3.dataid, versionNumber = _ref3.versionNumber, _ref3$apiVersion = _ref3.apiVersion, apiVersion = _ref3$apiVersion === void 0 ? 'v1' : _ref3$apiVersion;
3012 assert__default['default'](dataid != null, 'dataid cannot be null');
3013 assert__default['default'](versionNumber != null, 'number_to_keep must be an integer');
3014 url = "api/".concat(apiVersion, "/nodes/").concat(dataid, "/versions/").concat(versionNumber); // careful with deleteForm or deleteBody
3015
3016 return _context5.abrupt("return", session.delete(url));
3017
3018 case 5:
3019 case "end":
3020 return _context5.stop();
3021 }
3022 }
3023 }, _callee5);
3024 }))();
3025 },
3026 purge: function purge(_ref4) {
3027 return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {
3028 var dataid, _ref4$number_to_keep, number_to_keep, url;
3029
3030 return regeneratorRuntime.wrap(function _callee6$(_context6) {
3031 while (1) {
3032 switch (_context6.prev = _context6.next) {
3033 case 0:
3034 dataid = _ref4.dataid, _ref4$number_to_keep = _ref4.number_to_keep, number_to_keep = _ref4$number_to_keep === void 0 ? 1 : _ref4$number_to_keep;
3035 assert__default['default'](dataid != null, 'dataid cannot be null');
3036 assert__default['default'](!isNaN(number_to_keep), 'number_to_keep must be an integer'); // delete parameters not supported
3037 // https://stackoverflow.com/questions/51069552/axios-delete-request-with-body-and-headers
3038 // number_to_keep is ignored
3039
3040 url = "api/v2/nodes/".concat(dataid, "/versions");
3041 return _context6.abrupt("return", session.deleteForm(url, {
3042 number_to_keep: number_to_keep
3043 }));
3044
3045 case 5:
3046 case "end":
3047 return _context6.stop();
3048 }
3049 }
3050 }, _callee6);
3051 }))();
3052 }
3053 };
3054 };
3055
3056 var webreports = function webreports(session) {
3057 return {
3058 run: function run(dataid) {
3059 var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3060 var url = "api/v1/nodes/".concat(dataid, "/output");
3061 return session.get(url, {
3062 params: params
3063 });
3064 }
3065 };
3066 };
3067
3068 /**
3069 * lodash 4.0.0 (Custom Build) <https://lodash.com/>
3070 * Build: `lodash modularize exports="npm" -o ./`
3071 * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
3072 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
3073 * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
3074 * Available under MIT license <https://lodash.com/license>
3075 */
3076
3077 /**
3078 * Checks if `value` is `null` or `undefined`.
3079 *
3080 * @static
3081 * @memberOf _
3082 * @category Lang
3083 * @param {*} value The value to check.
3084 * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
3085 * @example
3086 *
3087 * _.isNil(null);
3088 * // => true
3089 *
3090 * _.isNil(void 0);
3091 * // => true
3092 *
3093 * _.isNil(NaN);
3094 * // => false
3095 */
3096 function isNil(value) {
3097 return value == null;
3098 }
3099
3100 var lodash_isnil = isNil;
3101
3102 var isObject$1 = function isObject(x) {
3103 return _typeof(x) === 'object' && x !== null;
3104 };
3105
3106 var ErrorCodes = {
3107 PARSEERROR: {
3108 code: -32700,
3109 message: "Parse error"
3110 },
3111 INVALIDREQUEST: {
3112 code: -32600,
3113 message: "Invalid Request"
3114 },
3115 METHODNOTFOUND: {
3116 code: -32601,
3117 message: "Method not found"
3118 },
3119 INVALIDPARAMS: {
3120 code: -32602,
3121 message: "Invalid params"
3122 },
3123 INTERNALERROR: {
3124 code: -32603,
3125 message: "Internal error"
3126 }
3127 }; // -32000 to -32099 is reserved!
3128
3129 var CustomError = /*#__PURE__*/function (_Error) {
3130 _inherits(CustomError, _Error);
3131
3132 var _super = _createSuper(CustomError);
3133
3134 function CustomError() {
3135 var _this;
3136
3137 var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ErrorCodes.INTERNALERROR.message;
3138 var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
3139 var code = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ErrorCodes.INTERNALERROR.code;
3140
3141 _classCallCheck(this, CustomError);
3142
3143 if (isObject$1(message)) {
3144 _this = _super.call(this, message.message);
3145 _this.code = message.code;
3146 _this.data = message.data;
3147 } else {
3148 _this = _super.call(this, message);
3149 _this.code = code;
3150 _this.data = data;
3151 }
3152
3153 return _possibleConstructorReturn(_this);
3154 }
3155
3156 return CustomError;
3157 }( /*#__PURE__*/_wrapNativeSuper(Error));
3158
3159 var errorCodes = {
3160 CustomError: CustomError,
3161 ErrorCodes: ErrorCodes
3162 };
3163
3164 var CustomError$1 = errorCodes.CustomError;
3165 // to be tested...
3166
3167 var sequence = {
3168 index: 0,
3169
3170 get next() {
3171 this.index = this.index + 1;
3172 return this.index;
3173 }
3174
3175 };
3176
3177 var rpcClient = /*#__PURE__*/function () {
3178 function RPCClient(session, baseURL) {
3179 _classCallCheck(this, RPCClient);
3180
3181 this.session = session;
3182 this.baseURL = baseURL;
3183 this.resetQueue();
3184 }
3185
3186 _createClass(RPCClient, [{
3187 key: "requestObject",
3188 value: function requestObject(method, params, id) {
3189 return {
3190 jsonrpc: '2.0',
3191 method: method,
3192 id: id,
3193 params: params
3194 };
3195 }
3196 }, {
3197 key: "handleResponse",
3198 value: function handleResponse(data) {
3199 if (data.hasOwnProperty('result')) {
3200 return data.result;
3201 } else if (data.hasOwnProperty('error')) {
3202 var err = data.error;
3203 throw new CustomError$1(err.message, err.data, err.code);
3204 } else {
3205 throw new Error('The server did not respond correctly.');
3206 }
3207 }
3208 }, {
3209 key: "request",
3210 value: function () {
3211 var _request = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(method) {
3212 var params,
3213 id,
3214 response,
3215 _args = arguments;
3216 return regeneratorRuntime.wrap(function _callee$(_context) {
3217 while (1) {
3218 switch (_context.prev = _context.next) {
3219 case 0:
3220 params = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
3221 id = _args.length > 2 && _args[2] !== undefined ? _args[2] : sequence.next;
3222 _context.next = 4;
3223 return this.session.postBody(this.baseURL, {
3224 rpc: this.requestObject(method, params, id)
3225 });
3226
3227 case 4:
3228 response = _context.sent;
3229 return _context.abrupt("return", this.handleResponse(response.data));
3230
3231 case 6:
3232 case "end":
3233 return _context.stop();
3234 }
3235 }
3236 }, _callee, this);
3237 }));
3238
3239 function request(_x) {
3240 return _request.apply(this, arguments);
3241 }
3242
3243 return request;
3244 }()
3245 }, {
3246 key: "resetQueue",
3247 value: function resetQueue() {
3248 this._batchQueue = [];
3249 }
3250 }, {
3251 key: "queue",
3252 value: function queue(method) {
3253 var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3254 var id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : sequence.next;
3255
3256 this._batchQueue.push(this.requestObject(method, params, id));
3257
3258 return this;
3259 }
3260 }, {
3261 key: "batch",
3262 value: function () {
3263 var _batch = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
3264 var _this = this;
3265
3266 var queue, response;
3267 return regeneratorRuntime.wrap(function _callee2$(_context2) {
3268 while (1) {
3269 switch (_context2.prev = _context2.next) {
3270 case 0:
3271 queue = this._batchQueue;
3272 this.resetQueue();
3273 _context2.next = 4;
3274 return this.session.postBody(this.baseURL, {
3275 rpc: queue
3276 });
3277
3278 case 4:
3279 response = _context2.sent;
3280 return _context2.abrupt("return", lodash_get(response, 'data.data', []).map(function (item) {
3281 return _this.handleResponse(item);
3282 }));
3283
3284 case 6:
3285 case "end":
3286 return _context2.stop();
3287 }
3288 }
3289 }, _callee2, this);
3290 }));
3291
3292 function batch() {
3293 return _batch.apply(this, arguments);
3294 }
3295
3296 return batch;
3297 }()
3298 }, {
3299 key: "rhnode",
3300 value: function rhnode(dataid, method) {
3301 var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
3302 var id = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : sequence.next;
3303 var params = {
3304 dataid: dataid,
3305 args: args
3306 };
3307 return this.request(method, params, id);
3308 }
3309 }, {
3310 key: "rhnodeQueue",
3311 value: function rhnodeQueue(dataid, method) {
3312 var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
3313 var id = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : sequence.next;
3314 var params = {
3315 dataid: dataid,
3316 args: args
3317 };
3318 return this.queue(method, params, id);
3319 }
3320 }]);
3321
3322 return RPCClient;
3323 }();
3324
3325 var AssocType = -18;
3326 var BooleanType = 5;
3327 var ClassType = 9;
3328 var DapiNodeType = -72;
3329 var DapiSessionType = -74;
3330 var DapiStreamType = -68;
3331 var DapiVersionType = -69;
3332 var DateType = -7;
3333 var DynamicType = -127;
3334 var ErrorType = 1;
3335 var FileType = -107;
3336 var FrameType = 10;
3337 var IntegerType = 2;
3338 var JavaObjectType = -42;
3339 var ListType = -2;
3340 var LongType = -8;
3341 var ObjectType = -128;
3342 var ObjRefType = 3;
3343 var RealType = -4;
3344 var RecArrayType = -110;
3345 var RecordType$1 = -109;
3346 var ScriptType = -3;
3347 var SocketType = -102;
3348 var StringType = -1;
3349 var UAPIType = -196;
3350 var UndefinedType = 0;
3351 var VoidType = 8;
3352 var WAPIWorkType = -75;
3353 var dataTypesEnum = {
3354 AssocType: AssocType,
3355 BooleanType: BooleanType,
3356 ClassType: ClassType,
3357 DapiNodeType: DapiNodeType,
3358 DapiSessionType: DapiSessionType,
3359 DapiStreamType: DapiStreamType,
3360 DapiVersionType: DapiVersionType,
3361 DateType: DateType,
3362 DynamicType: DynamicType,
3363 ErrorType: ErrorType,
3364 FileType: FileType,
3365 FrameType: FrameType,
3366 IntegerType: IntegerType,
3367 JavaObjectType: JavaObjectType,
3368 ListType: ListType,
3369 LongType: LongType,
3370 ObjectType: ObjectType,
3371 ObjRefType: ObjRefType,
3372 RealType: RealType,
3373 RecArrayType: RecArrayType,
3374 RecordType: RecordType$1,
3375 ScriptType: ScriptType,
3376 SocketType: SocketType,
3377 StringType: StringType,
3378 UAPIType: UAPIType,
3379 UndefinedType: UndefinedType,
3380 VoidType: VoidType,
3381 WAPIWorkType: WAPIWorkType
3382 };
3383
3384 var Session_1 = /*#__PURE__*/function () {
3385 function Session(options) {
3386 _classCallCheck(this, Session);
3387
3388 this.axios = axiosFactory_1(options);
3389 }
3390
3391 _createClass(Session, [{
3392 key: "nodes",
3393 get: function get() {
3394 // this creates a circular reference.. bad?
3395 if (this._nodes == null) {
3396 this._nodes = nodes(this);
3397 }
3398
3399 return this._nodes;
3400 }
3401 }, {
3402 key: "auth",
3403 get: function get() {
3404 if (this._auth == null) {
3405 this._auth = auth(this);
3406 }
3407
3408 return this._auth;
3409 }
3410 }, {
3411 key: "workflow",
3412 get: function get() {
3413 // this creates a circular reference.. bad?
3414 if (this._workflow == null) {
3415 this._workflow = workflow(this);
3416 }
3417
3418 return this._workflow;
3419 }
3420 }, {
3421 key: "rhcore",
3422 get: function get() {
3423 // this creates a circular reference.. bad?
3424 if (this._rhcore == null) {
3425 this._rhcore = rhcore(this);
3426 }
3427
3428 return this._rhcore;
3429 }
3430 }, {
3431 key: "members",
3432 get: function get() {
3433 // this creates a circular reference.. bad?
3434 if (this._members == null) {
3435 this._members = members(this);
3436 }
3437
3438 return this._members;
3439 }
3440 }, {
3441 key: "search",
3442 get: function get() {
3443 // this creates a circular reference.. bad?
3444 if (this._search == null) {
3445 this._search = search(this);
3446 }
3447
3448 return this._search;
3449 }
3450 }, {
3451 key: "webreports",
3452 get: function get() {
3453 // this creates a circular reference.. bad?
3454 if (this._webreports == null) {
3455 this._webreports = webreports(this);
3456 }
3457
3458 return this._webreports;
3459 }
3460 }, {
3461 key: "versions",
3462 get: function get() {
3463 // this creates a circular reference.. bad?
3464 if (this._versions == null) {
3465 this._versions = versions(this);
3466 }
3467
3468 return this._versions;
3469 }
3470 }, {
3471 key: "dataTypesEnum",
3472 get: function get() {
3473 return dataTypesEnum;
3474 }
3475 }, {
3476 key: "rpcClient",
3477 value: function rpcClient$1() {
3478 var baseURL = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '/api/v1/rh/rpc/rhnode/';
3479 return new rpcClient(this, baseURL);
3480 }
3481 }, {
3482 key: "_isObject",
3483 value: function _isObject(value) {
3484 return value && _typeof(value) === 'object' && value.constructor === Object;
3485 }
3486 }, {
3487 key: "_isString",
3488 value: function _isString(value) {
3489 return typeof value === 'string' || value instanceof String;
3490 }
3491 }, {
3492 key: "_isBoolean",
3493 value: function _isBoolean(value) {
3494 return typeof value === "boolean";
3495 }
3496 }, {
3497 key: "objectToForm",
3498 value: function objectToForm(obj) {
3499 var formData = formDataFactory.createFormData();
3500
3501 for (var _i = 0, _Object$entries = Object.entries(obj); _i < _Object$entries.length; _i++) {
3502 var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
3503 key = _Object$entries$_i[0],
3504 value = _Object$entries$_i[1];
3505
3506 if (value && value.name && value.file) {
3507 formData.append(key, value.file, value.name);
3508 } else if (Array.isArray(value) || this._isObject(value) || this._isBoolean(value)) {
3509 formData.append(key, JSON.stringify(value));
3510 } else if (!lodash_isnil(value)) {
3511 // should empty strings be sent?
3512 formData.append(key, value);
3513 }
3514 }
3515
3516 return formData;
3517 }
3518 }, {
3519 key: "get",
3520 value: function get() {
3521 var _this$axios;
3522
3523 return (_this$axios = this.axios).get.apply(_this$axios, arguments);
3524 } // async getCached(...args) {
3525 // const key = sha1(JSON.stringify(args))
3526 // try {
3527 // await semaphore.acquire(key)
3528 // if (!getCache[key]) {
3529 // getCache[key] = this.get(...args)
3530 // }
3531 // } finally {
3532 // semaphore.release(key)
3533 // }
3534 // return getCache[key]
3535 // }
3536
3537 }, {
3538 key: "putForm",
3539 value: function putForm(url, params) {
3540 var formData = this.objectToForm(params);
3541 return this.put(url, formData);
3542 }
3543 }, {
3544 key: "postForm",
3545 value: function postForm(url, params) {
3546 var formData = this.objectToForm(params);
3547 return this.post(url, formData, {
3548 maxBodyLength: Infinity
3549 });
3550 }
3551 }, {
3552 key: "patchForm",
3553 value: function patchForm(url, params) {
3554 var formData = this.objectToForm(params);
3555 return this.patch(url, formData);
3556 }
3557 }, {
3558 key: "deleteForm",
3559 value: function deleteForm(url, params) {
3560 // FormData does not working on Delete!!
3561 // See here: https://stackoverflow.com/questions/51069552/axios-delete-request-with-body-and-headers
3562 var formData = this.objectToForm(params);
3563 return this.delete(url, formData);
3564 }
3565 }, {
3566 key: "putBody",
3567 value: function putBody(url, body) {
3568 return this.putForm(url, {
3569 body: body
3570 });
3571 }
3572 }, {
3573 key: "postBody",
3574 value: function postBody(url, body) {
3575 return this.postForm(url, {
3576 body: body
3577 });
3578 }
3579 }, {
3580 key: "patchBody",
3581 value: function patchBody(url, body) {
3582 return this.patchForm(url, {
3583 body: body
3584 });
3585 }
3586 }, {
3587 key: "deleteBody",
3588 value: function deleteBody(url, body) {
3589 return this.deleteForm(url, {
3590 body: body
3591 });
3592 }
3593 }, {
3594 key: "post",
3595 value: function post() {
3596 var _this$axios2;
3597
3598 return (_this$axios2 = this.axios).post.apply(_this$axios2, arguments);
3599 }
3600 }, {
3601 key: "put",
3602 value: function put() {
3603 var _this$axios3;
3604
3605 return (_this$axios3 = this.axios).put.apply(_this$axios3, arguments);
3606 }
3607 }, {
3608 key: "delete",
3609 value: function _delete() {
3610 var _this$axios4;
3611
3612 return (_this$axios4 = this.axios).delete.apply(_this$axios4, arguments); // console.log(args)
3613 // console.log(url)
3614 // return this.axios.delete(URL, {
3615 // headers: {
3616 // Authorization: authorizationToken
3617 // },
3618 // data: {
3619 // source: source
3620 // }
3621 // });
3622 }
3623 }, {
3624 key: "options",
3625 value: function options() {
3626 var _this$axios5;
3627
3628 return (_this$axios5 = this.axios).options.apply(_this$axios5, arguments);
3629 }
3630 }, {
3631 key: "patch",
3632 value: function patch() {
3633 var _this$axios6;
3634
3635 return (_this$axios6 = this.axios).patch.apply(_this$axios6, arguments);
3636 }
3637 }]);
3638
3639 return Session;
3640 }();
3641
3642 var Session_1$1 = Session_1;
3643 var src = {
3644 Session: Session_1$1
3645 };
3646
3647 exports.Session = Session_1$1;
3648 exports.default = src;
3649
3650 Object.defineProperty(exports, '__esModule', { value: true });
3651
3652})));
3653//# sourceMappingURL=index.umd.js.map