1 | (function (global, factory) {
|
2 | typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('core-js/modules/es.object.to-string'), require('core-js/modules/es.promise'), require('core-js/modules/es.symbol'), require('core-js/modules/es.symbol.description'), require('core-js/modules/es.symbol.async-iterator'), require('core-js/modules/es.symbol.iterator'), require('core-js/modules/es.symbol.to-string-tag'), require('core-js/modules/es.array.for-each'), require('core-js/modules/es.array.iterator'), require('core-js/modules/es.array.reverse'), require('core-js/modules/es.array.slice'), require('core-js/modules/es.date.to-string'), require('core-js/modules/es.function.name'), require('core-js/modules/es.json.to-string-tag'), require('core-js/modules/es.math.to-string-tag'), require('core-js/modules/es.object.create'), require('core-js/modules/es.object.define-property'), require('core-js/modules/es.object.get-prototype-of'), require('core-js/modules/es.object.set-prototype-of'), require('core-js/modules/es.regexp.to-string'), require('core-js/modules/es.string.iterator'), require('core-js/modules/web.dom-collections.for-each'), require('core-js/modules/web.dom-collections.iterator'), require('axios'), require('core-js/modules/es.array.is-array'), require('core-js/modules/es.array.map'), require('core-js/modules/es.array.splice'), require('core-js/modules/es.regexp.constructor'), require('core-js/modules/es.regexp.exec'), require('core-js/modules/es.string.replace'), require('core-js/modules/es.object.entries'), require('core-js/modules/es.array.concat'), require('core-js/modules/es.array.join'), require('core-js/modules/es.number.constructor'), require('core-js/modules/es.parse-int'), require('core-js/modules/web.timers')) :
|
3 | typeof define === 'function' && define.amd ? define(['exports', 'core-js/modules/es.object.to-string', 'core-js/modules/es.promise', 'core-js/modules/es.symbol', 'core-js/modules/es.symbol.description', 'core-js/modules/es.symbol.async-iterator', 'core-js/modules/es.symbol.iterator', 'core-js/modules/es.symbol.to-string-tag', 'core-js/modules/es.array.for-each', 'core-js/modules/es.array.iterator', 'core-js/modules/es.array.reverse', 'core-js/modules/es.array.slice', 'core-js/modules/es.date.to-string', 'core-js/modules/es.function.name', 'core-js/modules/es.json.to-string-tag', 'core-js/modules/es.math.to-string-tag', 'core-js/modules/es.object.create', 'core-js/modules/es.object.define-property', 'core-js/modules/es.object.get-prototype-of', 'core-js/modules/es.object.set-prototype-of', 'core-js/modules/es.regexp.to-string', 'core-js/modules/es.string.iterator', 'core-js/modules/web.dom-collections.for-each', 'core-js/modules/web.dom-collections.iterator', 'axios', 'core-js/modules/es.array.is-array', 'core-js/modules/es.array.map', 'core-js/modules/es.array.splice', 'core-js/modules/es.regexp.constructor', 'core-js/modules/es.regexp.exec', 'core-js/modules/es.string.replace', 'core-js/modules/es.object.entries', 'core-js/modules/es.array.concat', 'core-js/modules/es.array.join', 'core-js/modules/es.number.constructor', 'core-js/modules/es.parse-int', 'core-js/modules/web.timers'], 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, null, null, null, null, null, global.axios));
|
5 | }(this, (function (exports, es_object_toString, es_promise, es_symbol, es_symbol_description, es_symbol_asyncIterator, es_symbol_iterator, es_symbol_toStringTag, es_array_forEach, es_array_iterator, es_array_reverse, es_array_slice, es_date_toString, es_function_name, es_json_toStringTag, es_math_toStringTag, es_object_create, es_object_defineProperty, es_object_getPrototypeOf, es_object_setPrototypeOf, es_regexp_toString, es_string_iterator, web_domCollections_forEach, web_domCollections_iterator, axios) { 'use strict';
|
6 |
|
7 | function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
8 |
|
9 | var axios__default = _interopDefaultLegacy(axios);
|
10 |
|
11 | function _typeof(obj) {
|
12 | "@babel/helpers - typeof";
|
13 |
|
14 | if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
15 | _typeof = function (obj) {
|
16 | return typeof obj;
|
17 | };
|
18 | } else {
|
19 | _typeof = function (obj) {
|
20 | return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
21 | };
|
22 | }
|
23 |
|
24 | return _typeof(obj);
|
25 | }
|
26 |
|
27 | function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
28 | try {
|
29 | var info = gen[key](arg);
|
30 | var value = info.value;
|
31 | } catch (error) {
|
32 | reject(error);
|
33 | return;
|
34 | }
|
35 |
|
36 | if (info.done) {
|
37 | resolve(value);
|
38 | } else {
|
39 | Promise.resolve(value).then(_next, _throw);
|
40 | }
|
41 | }
|
42 |
|
43 | function _asyncToGenerator(fn) {
|
44 | return function () {
|
45 | var self = this,
|
46 | args = arguments;
|
47 | return new Promise(function (resolve, reject) {
|
48 | var gen = fn.apply(self, args);
|
49 |
|
50 | function _next(value) {
|
51 | asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
52 | }
|
53 |
|
54 | function _throw(err) {
|
55 | asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
56 | }
|
57 |
|
58 | _next(undefined);
|
59 | });
|
60 | };
|
61 | }
|
62 |
|
63 | function _classCallCheck(instance, Constructor) {
|
64 | if (!(instance instanceof Constructor)) {
|
65 | throw new TypeError("Cannot call a class as a function");
|
66 | }
|
67 | }
|
68 |
|
69 | function _defineProperties(target, props) {
|
70 | for (var i = 0; i < props.length; i++) {
|
71 | var descriptor = props[i];
|
72 | descriptor.enumerable = descriptor.enumerable || false;
|
73 | descriptor.configurable = true;
|
74 | if ("value" in descriptor) descriptor.writable = true;
|
75 | Object.defineProperty(target, descriptor.key, descriptor);
|
76 | }
|
77 | }
|
78 |
|
79 | function _createClass(Constructor, protoProps, staticProps) {
|
80 | if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
81 | if (staticProps) _defineProperties(Constructor, staticProps);
|
82 | return Constructor;
|
83 | }
|
84 |
|
85 | function _defineProperty(obj, key, value) {
|
86 | if (key in obj) {
|
87 | Object.defineProperty(obj, key, {
|
88 | value: value,
|
89 | enumerable: true,
|
90 | configurable: true,
|
91 | writable: true
|
92 | });
|
93 | } else {
|
94 | obj[key] = value;
|
95 | }
|
96 |
|
97 | return obj;
|
98 | }
|
99 |
|
100 | function ownKeys(object, enumerableOnly) {
|
101 | var keys = Object.keys(object);
|
102 |
|
103 | if (Object.getOwnPropertySymbols) {
|
104 | var symbols = Object.getOwnPropertySymbols(object);
|
105 | if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
106 | return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
107 | });
|
108 | keys.push.apply(keys, symbols);
|
109 | }
|
110 |
|
111 | return keys;
|
112 | }
|
113 |
|
114 | function _objectSpread2(target) {
|
115 | for (var i = 1; i < arguments.length; i++) {
|
116 | var source = arguments[i] != null ? arguments[i] : {};
|
117 |
|
118 | if (i % 2) {
|
119 | ownKeys(Object(source), true).forEach(function (key) {
|
120 | _defineProperty(target, key, source[key]);
|
121 | });
|
122 | } else if (Object.getOwnPropertyDescriptors) {
|
123 | Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
124 | } else {
|
125 | ownKeys(Object(source)).forEach(function (key) {
|
126 | Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
127 | });
|
128 | }
|
129 | }
|
130 |
|
131 | return target;
|
132 | }
|
133 |
|
134 | function _slicedToArray(arr, i) {
|
135 | return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
136 | }
|
137 |
|
138 | function _arrayWithHoles(arr) {
|
139 | if (Array.isArray(arr)) return arr;
|
140 | }
|
141 |
|
142 | function _iterableToArrayLimit(arr, i) {
|
143 | if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
|
144 | var _arr = [];
|
145 | var _n = true;
|
146 | var _d = false;
|
147 | var _e = undefined;
|
148 |
|
149 | try {
|
150 | for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
151 | _arr.push(_s.value);
|
152 |
|
153 | if (i && _arr.length === i) break;
|
154 | }
|
155 | } catch (err) {
|
156 | _d = true;
|
157 | _e = err;
|
158 | } finally {
|
159 | try {
|
160 | if (!_n && _i["return"] != null) _i["return"]();
|
161 | } finally {
|
162 | if (_d) throw _e;
|
163 | }
|
164 | }
|
165 |
|
166 | return _arr;
|
167 | }
|
168 |
|
169 | function _unsupportedIterableToArray(o, minLen) {
|
170 | if (!o) return;
|
171 | if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
172 | var n = Object.prototype.toString.call(o).slice(8, -1);
|
173 | if (n === "Object" && o.constructor) n = o.constructor.name;
|
174 | if (n === "Map" || n === "Set") return Array.from(o);
|
175 | if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
176 | }
|
177 |
|
178 | function _arrayLikeToArray(arr, len) {
|
179 | if (len == null || len > arr.length) len = arr.length;
|
180 |
|
181 | for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
182 |
|
183 | return arr2;
|
184 | }
|
185 |
|
186 | function _nonIterableRest() {
|
187 | throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
188 | }
|
189 |
|
190 | var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
191 |
|
192 | function createCommonjsModule(fn, basedir, module) {
|
193 | return module = {
|
194 | path: basedir,
|
195 | exports: {},
|
196 | require: function (path, base) {
|
197 | return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
|
198 | }
|
199 | }, fn(module, module.exports), module.exports;
|
200 | }
|
201 |
|
202 | function getAugmentedNamespace(n) {
|
203 | if (n.__esModule) return n;
|
204 | var a = Object.defineProperty({}, '__esModule', {value: true});
|
205 | Object.keys(n).forEach(function (k) {
|
206 | var d = Object.getOwnPropertyDescriptor(n, k);
|
207 | Object.defineProperty(a, k, d.get ? d : {
|
208 | enumerable: true,
|
209 | get: function () {
|
210 | return n[k];
|
211 | }
|
212 | });
|
213 | });
|
214 | return a;
|
215 | }
|
216 |
|
217 | function commonjsRequire () {
|
218 | throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
219 | }
|
220 |
|
221 | var runtime_1 = createCommonjsModule(function (module) {
|
222 | |
223 |
|
224 |
|
225 |
|
226 |
|
227 |
|
228 | var runtime = function (exports) {
|
229 |
|
230 | var Op = Object.prototype;
|
231 | var hasOwn = Op.hasOwnProperty;
|
232 | var undefined$1;
|
233 |
|
234 | var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
235 | var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
236 | var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
237 | var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
238 |
|
239 | function define(obj, key, value) {
|
240 | Object.defineProperty(obj, key, {
|
241 | value: value,
|
242 | enumerable: true,
|
243 | configurable: true,
|
244 | writable: true
|
245 | });
|
246 | return obj[key];
|
247 | }
|
248 |
|
249 | try {
|
250 |
|
251 | define({}, "");
|
252 | } catch (err) {
|
253 | define = function define(obj, key, value) {
|
254 | return obj[key] = value;
|
255 | };
|
256 | }
|
257 |
|
258 | function wrap(innerFn, outerFn, self, tryLocsList) {
|
259 |
|
260 | var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
261 | var generator = Object.create(protoGenerator.prototype);
|
262 | var context = new Context(tryLocsList || []);
|
263 |
|
264 |
|
265 | generator._invoke = makeInvokeMethod(innerFn, self, context);
|
266 | return generator;
|
267 | }
|
268 |
|
269 | exports.wrap = wrap;
|
270 |
|
271 |
|
272 |
|
273 |
|
274 |
|
275 |
|
276 |
|
277 |
|
278 |
|
279 |
|
280 | function tryCatch(fn, obj, arg) {
|
281 | try {
|
282 | return {
|
283 | type: "normal",
|
284 | arg: fn.call(obj, arg)
|
285 | };
|
286 | } catch (err) {
|
287 | return {
|
288 | type: "throw",
|
289 | arg: err
|
290 | };
|
291 | }
|
292 | }
|
293 |
|
294 | var GenStateSuspendedStart = "suspendedStart";
|
295 | var GenStateSuspendedYield = "suspendedYield";
|
296 | var GenStateExecuting = "executing";
|
297 | var GenStateCompleted = "completed";
|
298 |
|
299 |
|
300 | var ContinueSentinel = {};
|
301 |
|
302 |
|
303 |
|
304 |
|
305 | function Generator() {}
|
306 |
|
307 | function GeneratorFunction() {}
|
308 |
|
309 | function GeneratorFunctionPrototype() {}
|
310 |
|
311 |
|
312 |
|
313 | var IteratorPrototype = {};
|
314 |
|
315 | IteratorPrototype[iteratorSymbol] = function () {
|
316 | return this;
|
317 | };
|
318 |
|
319 | var getProto = Object.getPrototypeOf;
|
320 | var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
321 |
|
322 | if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
323 |
|
324 |
|
325 | IteratorPrototype = NativeIteratorPrototype;
|
326 | }
|
327 |
|
328 | var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
329 | GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
|
330 | GeneratorFunctionPrototype.constructor = GeneratorFunction;
|
331 | GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction");
|
332 |
|
333 |
|
334 | function defineIteratorMethods(prototype) {
|
335 | ["next", "throw", "return"].forEach(function (method) {
|
336 | define(prototype, method, function (arg) {
|
337 | return this._invoke(method, arg);
|
338 | });
|
339 | });
|
340 | }
|
341 |
|
342 | exports.isGeneratorFunction = function (genFun) {
|
343 | var ctor = typeof genFun === "function" && genFun.constructor;
|
344 | return ctor ? ctor === GeneratorFunction ||
|
345 |
|
346 | (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
|
347 | };
|
348 |
|
349 | exports.mark = function (genFun) {
|
350 | if (Object.setPrototypeOf) {
|
351 | Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
352 | } else {
|
353 | genFun.__proto__ = GeneratorFunctionPrototype;
|
354 | define(genFun, toStringTagSymbol, "GeneratorFunction");
|
355 | }
|
356 |
|
357 | genFun.prototype = Object.create(Gp);
|
358 | return genFun;
|
359 | };
|
360 |
|
361 |
|
362 |
|
363 |
|
364 |
|
365 | exports.awrap = function (arg) {
|
366 | return {
|
367 | __await: arg
|
368 | };
|
369 | };
|
370 |
|
371 | function AsyncIterator(generator, PromiseImpl) {
|
372 | function invoke(method, arg, resolve, reject) {
|
373 | var record = tryCatch(generator[method], generator, arg);
|
374 |
|
375 | if (record.type === "throw") {
|
376 | reject(record.arg);
|
377 | } else {
|
378 | var result = record.arg;
|
379 | var value = result.value;
|
380 |
|
381 | if (value && _typeof(value) === "object" && hasOwn.call(value, "__await")) {
|
382 | return PromiseImpl.resolve(value.__await).then(function (value) {
|
383 | invoke("next", value, resolve, reject);
|
384 | }, function (err) {
|
385 | invoke("throw", err, resolve, reject);
|
386 | });
|
387 | }
|
388 |
|
389 | return PromiseImpl.resolve(value).then(function (unwrapped) {
|
390 |
|
391 |
|
392 |
|
393 | result.value = unwrapped;
|
394 | resolve(result);
|
395 | }, function (error) {
|
396 |
|
397 |
|
398 | return invoke("throw", error, resolve, reject);
|
399 | });
|
400 | }
|
401 | }
|
402 |
|
403 | var previousPromise;
|
404 |
|
405 | function enqueue(method, arg) {
|
406 | function callInvokeWithMethodAndArg() {
|
407 | return new PromiseImpl(function (resolve, reject) {
|
408 | invoke(method, arg, resolve, reject);
|
409 | });
|
410 | }
|
411 |
|
412 | return previousPromise =
|
413 |
|
414 |
|
415 |
|
416 |
|
417 |
|
418 |
|
419 |
|
420 |
|
421 |
|
422 |
|
423 |
|
424 | previousPromise ? previousPromise.then(callInvokeWithMethodAndArg,
|
425 |
|
426 | callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
427 | }
|
428 |
|
429 |
|
430 |
|
431 | this._invoke = enqueue;
|
432 | }
|
433 |
|
434 | defineIteratorMethods(AsyncIterator.prototype);
|
435 |
|
436 | AsyncIterator.prototype[asyncIteratorSymbol] = function () {
|
437 | return this;
|
438 | };
|
439 |
|
440 | exports.AsyncIterator = AsyncIterator;
|
441 |
|
442 |
|
443 |
|
444 | exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
445 | if (PromiseImpl === void 0) PromiseImpl = Promise;
|
446 | var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
447 | return exports.isGeneratorFunction(outerFn) ? iter
|
448 | : iter.next().then(function (result) {
|
449 | return result.done ? result.value : iter.next();
|
450 | });
|
451 | };
|
452 |
|
453 | function makeInvokeMethod(innerFn, self, context) {
|
454 | var state = GenStateSuspendedStart;
|
455 | return function invoke(method, arg) {
|
456 | if (state === GenStateExecuting) {
|
457 | throw new Error("Generator is already running");
|
458 | }
|
459 |
|
460 | if (state === GenStateCompleted) {
|
461 | if (method === "throw") {
|
462 | throw arg;
|
463 | }
|
464 |
|
465 |
|
466 |
|
467 | return doneResult();
|
468 | }
|
469 |
|
470 | context.method = method;
|
471 | context.arg = arg;
|
472 |
|
473 | while (true) {
|
474 | var delegate = context.delegate;
|
475 |
|
476 | if (delegate) {
|
477 | var delegateResult = maybeInvokeDelegate(delegate, context);
|
478 |
|
479 | if (delegateResult) {
|
480 | if (delegateResult === ContinueSentinel) continue;
|
481 | return delegateResult;
|
482 | }
|
483 | }
|
484 |
|
485 | if (context.method === "next") {
|
486 |
|
487 |
|
488 | context.sent = context._sent = context.arg;
|
489 | } else if (context.method === "throw") {
|
490 | if (state === GenStateSuspendedStart) {
|
491 | state = GenStateCompleted;
|
492 | throw context.arg;
|
493 | }
|
494 |
|
495 | context.dispatchException(context.arg);
|
496 | } else if (context.method === "return") {
|
497 | context.abrupt("return", context.arg);
|
498 | }
|
499 |
|
500 | state = GenStateExecuting;
|
501 | var record = tryCatch(innerFn, self, context);
|
502 |
|
503 | if (record.type === "normal") {
|
504 |
|
505 |
|
506 | state = context.done ? GenStateCompleted : GenStateSuspendedYield;
|
507 |
|
508 | if (record.arg === ContinueSentinel) {
|
509 | continue;
|
510 | }
|
511 |
|
512 | return {
|
513 | value: record.arg,
|
514 | done: context.done
|
515 | };
|
516 | } else if (record.type === "throw") {
|
517 | state = GenStateCompleted;
|
518 |
|
519 |
|
520 | context.method = "throw";
|
521 | context.arg = record.arg;
|
522 | }
|
523 | }
|
524 | };
|
525 | }
|
526 |
|
527 |
|
528 |
|
529 |
|
530 |
|
531 | function maybeInvokeDelegate(delegate, context) {
|
532 | var method = delegate.iterator[context.method];
|
533 |
|
534 | if (method === undefined$1) {
|
535 |
|
536 |
|
537 | context.delegate = null;
|
538 |
|
539 | if (context.method === "throw") {
|
540 |
|
541 | if (delegate.iterator["return"]) {
|
542 |
|
543 |
|
544 | context.method = "return";
|
545 | context.arg = undefined$1;
|
546 | maybeInvokeDelegate(delegate, context);
|
547 |
|
548 | if (context.method === "throw") {
|
549 |
|
550 |
|
551 | return ContinueSentinel;
|
552 | }
|
553 | }
|
554 |
|
555 | context.method = "throw";
|
556 | context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
557 | }
|
558 |
|
559 | return ContinueSentinel;
|
560 | }
|
561 |
|
562 | var record = tryCatch(method, delegate.iterator, context.arg);
|
563 |
|
564 | if (record.type === "throw") {
|
565 | context.method = "throw";
|
566 | context.arg = record.arg;
|
567 | context.delegate = null;
|
568 | return ContinueSentinel;
|
569 | }
|
570 |
|
571 | var info = record.arg;
|
572 |
|
573 | if (!info) {
|
574 | context.method = "throw";
|
575 | context.arg = new TypeError("iterator result is not an object");
|
576 | context.delegate = null;
|
577 | return ContinueSentinel;
|
578 | }
|
579 |
|
580 | if (info.done) {
|
581 |
|
582 |
|
583 | context[delegate.resultName] = info.value;
|
584 |
|
585 | context.next = delegate.nextLoc;
|
586 |
|
587 |
|
588 |
|
589 |
|
590 |
|
591 |
|
592 | if (context.method !== "return") {
|
593 | context.method = "next";
|
594 | context.arg = undefined$1;
|
595 | }
|
596 | } else {
|
597 |
|
598 | return info;
|
599 | }
|
600 |
|
601 |
|
602 |
|
603 | context.delegate = null;
|
604 | return ContinueSentinel;
|
605 | }
|
606 |
|
607 |
|
608 |
|
609 | defineIteratorMethods(Gp);
|
610 | define(Gp, toStringTagSymbol, "Generator");
|
611 |
|
612 |
|
613 |
|
614 |
|
615 |
|
616 | Gp[iteratorSymbol] = function () {
|
617 | return this;
|
618 | };
|
619 |
|
620 | Gp.toString = function () {
|
621 | return "[object Generator]";
|
622 | };
|
623 |
|
624 | function pushTryEntry(locs) {
|
625 | var entry = {
|
626 | tryLoc: locs[0]
|
627 | };
|
628 |
|
629 | if (1 in locs) {
|
630 | entry.catchLoc = locs[1];
|
631 | }
|
632 |
|
633 | if (2 in locs) {
|
634 | entry.finallyLoc = locs[2];
|
635 | entry.afterLoc = locs[3];
|
636 | }
|
637 |
|
638 | this.tryEntries.push(entry);
|
639 | }
|
640 |
|
641 | function resetTryEntry(entry) {
|
642 | var record = entry.completion || {};
|
643 | record.type = "normal";
|
644 | delete record.arg;
|
645 | entry.completion = record;
|
646 | }
|
647 |
|
648 | function Context(tryLocsList) {
|
649 |
|
650 |
|
651 |
|
652 | this.tryEntries = [{
|
653 | tryLoc: "root"
|
654 | }];
|
655 | tryLocsList.forEach(pushTryEntry, this);
|
656 | this.reset(true);
|
657 | }
|
658 |
|
659 | exports.keys = function (object) {
|
660 | var keys = [];
|
661 |
|
662 | for (var key in object) {
|
663 | keys.push(key);
|
664 | }
|
665 |
|
666 | keys.reverse();
|
667 |
|
668 |
|
669 | return function next() {
|
670 | while (keys.length) {
|
671 | var key = keys.pop();
|
672 |
|
673 | if (key in object) {
|
674 | next.value = key;
|
675 | next.done = false;
|
676 | return next;
|
677 | }
|
678 | }
|
679 |
|
680 |
|
681 |
|
682 |
|
683 | next.done = true;
|
684 | return next;
|
685 | };
|
686 | };
|
687 |
|
688 | function values(iterable) {
|
689 | if (iterable) {
|
690 | var iteratorMethod = iterable[iteratorSymbol];
|
691 |
|
692 | if (iteratorMethod) {
|
693 | return iteratorMethod.call(iterable);
|
694 | }
|
695 |
|
696 | if (typeof iterable.next === "function") {
|
697 | return iterable;
|
698 | }
|
699 |
|
700 | if (!isNaN(iterable.length)) {
|
701 | var i = -1,
|
702 | next = function next() {
|
703 | while (++i < iterable.length) {
|
704 | if (hasOwn.call(iterable, i)) {
|
705 | next.value = iterable[i];
|
706 | next.done = false;
|
707 | return next;
|
708 | }
|
709 | }
|
710 |
|
711 | next.value = undefined$1;
|
712 | next.done = true;
|
713 | return next;
|
714 | };
|
715 |
|
716 | return next.next = next;
|
717 | }
|
718 | }
|
719 |
|
720 |
|
721 | return {
|
722 | next: doneResult
|
723 | };
|
724 | }
|
725 |
|
726 | exports.values = values;
|
727 |
|
728 | function doneResult() {
|
729 | return {
|
730 | value: undefined$1,
|
731 | done: true
|
732 | };
|
733 | }
|
734 |
|
735 | Context.prototype = {
|
736 | constructor: Context,
|
737 | reset: function reset(skipTempReset) {
|
738 | this.prev = 0;
|
739 | this.next = 0;
|
740 |
|
741 |
|
742 | this.sent = this._sent = undefined$1;
|
743 | this.done = false;
|
744 | this.delegate = null;
|
745 | this.method = "next";
|
746 | this.arg = undefined$1;
|
747 | this.tryEntries.forEach(resetTryEntry);
|
748 |
|
749 | if (!skipTempReset) {
|
750 | for (var name in this) {
|
751 |
|
752 | if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
|
753 | this[name] = undefined$1;
|
754 | }
|
755 | }
|
756 | }
|
757 | },
|
758 | stop: function stop() {
|
759 | this.done = true;
|
760 | var rootEntry = this.tryEntries[0];
|
761 | var rootRecord = rootEntry.completion;
|
762 |
|
763 | if (rootRecord.type === "throw") {
|
764 | throw rootRecord.arg;
|
765 | }
|
766 |
|
767 | return this.rval;
|
768 | },
|
769 | dispatchException: function dispatchException(exception) {
|
770 | if (this.done) {
|
771 | throw exception;
|
772 | }
|
773 |
|
774 | var context = this;
|
775 |
|
776 | function handle(loc, caught) {
|
777 | record.type = "throw";
|
778 | record.arg = exception;
|
779 | context.next = loc;
|
780 |
|
781 | if (caught) {
|
782 |
|
783 |
|
784 | context.method = "next";
|
785 | context.arg = undefined$1;
|
786 | }
|
787 |
|
788 | return !!caught;
|
789 | }
|
790 |
|
791 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
792 | var entry = this.tryEntries[i];
|
793 | var record = entry.completion;
|
794 |
|
795 | if (entry.tryLoc === "root") {
|
796 |
|
797 |
|
798 |
|
799 | return handle("end");
|
800 | }
|
801 |
|
802 | if (entry.tryLoc <= this.prev) {
|
803 | var hasCatch = hasOwn.call(entry, "catchLoc");
|
804 | var hasFinally = hasOwn.call(entry, "finallyLoc");
|
805 |
|
806 | if (hasCatch && hasFinally) {
|
807 | if (this.prev < entry.catchLoc) {
|
808 | return handle(entry.catchLoc, true);
|
809 | } else if (this.prev < entry.finallyLoc) {
|
810 | return handle(entry.finallyLoc);
|
811 | }
|
812 | } else if (hasCatch) {
|
813 | if (this.prev < entry.catchLoc) {
|
814 | return handle(entry.catchLoc, true);
|
815 | }
|
816 | } else if (hasFinally) {
|
817 | if (this.prev < entry.finallyLoc) {
|
818 | return handle(entry.finallyLoc);
|
819 | }
|
820 | } else {
|
821 | throw new Error("try statement without catch or finally");
|
822 | }
|
823 | }
|
824 | }
|
825 | },
|
826 | abrupt: function abrupt(type, arg) {
|
827 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
828 | var entry = this.tryEntries[i];
|
829 |
|
830 | if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
831 | var finallyEntry = entry;
|
832 | break;
|
833 | }
|
834 | }
|
835 |
|
836 | if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
|
837 |
|
838 |
|
839 | finallyEntry = null;
|
840 | }
|
841 |
|
842 | var record = finallyEntry ? finallyEntry.completion : {};
|
843 | record.type = type;
|
844 | record.arg = arg;
|
845 |
|
846 | if (finallyEntry) {
|
847 | this.method = "next";
|
848 | this.next = finallyEntry.finallyLoc;
|
849 | return ContinueSentinel;
|
850 | }
|
851 |
|
852 | return this.complete(record);
|
853 | },
|
854 | complete: function complete(record, afterLoc) {
|
855 | if (record.type === "throw") {
|
856 | throw record.arg;
|
857 | }
|
858 |
|
859 | if (record.type === "break" || record.type === "continue") {
|
860 | this.next = record.arg;
|
861 | } else if (record.type === "return") {
|
862 | this.rval = this.arg = record.arg;
|
863 | this.method = "return";
|
864 | this.next = "end";
|
865 | } else if (record.type === "normal" && afterLoc) {
|
866 | this.next = afterLoc;
|
867 | }
|
868 |
|
869 | return ContinueSentinel;
|
870 | },
|
871 | finish: function finish(finallyLoc) {
|
872 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
873 | var entry = this.tryEntries[i];
|
874 |
|
875 | if (entry.finallyLoc === finallyLoc) {
|
876 | this.complete(entry.completion, entry.afterLoc);
|
877 | resetTryEntry(entry);
|
878 | return ContinueSentinel;
|
879 | }
|
880 | }
|
881 | },
|
882 | "catch": function _catch(tryLoc) {
|
883 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
884 | var entry = this.tryEntries[i];
|
885 |
|
886 | if (entry.tryLoc === tryLoc) {
|
887 | var record = entry.completion;
|
888 |
|
889 | if (record.type === "throw") {
|
890 | var thrown = record.arg;
|
891 | resetTryEntry(entry);
|
892 | }
|
893 |
|
894 | return thrown;
|
895 | }
|
896 | }
|
897 |
|
898 |
|
899 |
|
900 | throw new Error("illegal catch attempt");
|
901 | },
|
902 | delegateYield: function delegateYield(iterable, resultName, nextLoc) {
|
903 | this.delegate = {
|
904 | iterator: values(iterable),
|
905 | resultName: resultName,
|
906 | nextLoc: nextLoc
|
907 | };
|
908 |
|
909 | if (this.method === "next") {
|
910 |
|
911 |
|
912 | this.arg = undefined$1;
|
913 | }
|
914 |
|
915 | return ContinueSentinel;
|
916 | }
|
917 | };
|
918 |
|
919 |
|
920 |
|
921 |
|
922 | return exports;
|
923 | }(
|
924 |
|
925 |
|
926 |
|
927 | module.exports );
|
928 |
|
929 | try {
|
930 | regeneratorRuntime = runtime;
|
931 | } catch (accidentalStrictMode) {
|
932 |
|
933 |
|
934 |
|
935 |
|
936 |
|
937 |
|
938 |
|
939 |
|
940 |
|
941 | Function("r", "regeneratorRuntime = r")(runtime);
|
942 | }
|
943 | });
|
944 |
|
945 | |
946 |
|
947 |
|
948 |
|
949 |
|
950 |
|
951 |
|
952 |
|
953 |
|
954 |
|
955 |
|
956 | var FUNC_ERROR_TEXT = 'Expected a function';
|
957 |
|
958 |
|
959 | var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
960 |
|
961 |
|
962 | var INFINITY = 1 / 0;
|
963 |
|
964 |
|
965 | var funcTag = '[object Function]',
|
966 | genTag = '[object GeneratorFunction]',
|
967 | symbolTag = '[object Symbol]';
|
968 |
|
969 |
|
970 | var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
|
971 | reIsPlainProp = /^\w*$/,
|
972 | reLeadingDot = /^\./,
|
973 | rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
974 | |
975 |
|
976 |
|
977 |
|
978 |
|
979 | var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
980 |
|
981 |
|
982 | var reEscapeChar = /\\(\\)?/g;
|
983 |
|
984 |
|
985 | var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
986 |
|
987 |
|
988 | var freeGlobal = _typeof(commonjsGlobal) == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
989 |
|
990 |
|
991 | var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self;
|
992 |
|
993 |
|
994 | var root = freeGlobal || freeSelf || Function('return this')();
|
995 | |
996 |
|
997 |
|
998 |
|
999 |
|
1000 |
|
1001 |
|
1002 |
|
1003 |
|
1004 | function getValue(object, key) {
|
1005 | return object == null ? undefined : object[key];
|
1006 | }
|
1007 | |
1008 |
|
1009 |
|
1010 |
|
1011 |
|
1012 |
|
1013 |
|
1014 |
|
1015 |
|
1016 | function isHostObject(value) {
|
1017 |
|
1018 |
|
1019 | var result = false;
|
1020 |
|
1021 | if (value != null && typeof value.toString != 'function') {
|
1022 | try {
|
1023 | result = !!(value + '');
|
1024 | } catch (e) {}
|
1025 | }
|
1026 |
|
1027 | return result;
|
1028 | }
|
1029 |
|
1030 |
|
1031 |
|
1032 | var arrayProto = Array.prototype,
|
1033 | funcProto = Function.prototype,
|
1034 | objectProto = Object.prototype;
|
1035 |
|
1036 |
|
1037 | var coreJsData = root['__core-js_shared__'];
|
1038 |
|
1039 |
|
1040 | var maskSrcKey = function () {
|
1041 | var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
|
1042 | return uid ? 'Symbol(src)_1.' + uid : '';
|
1043 | }();
|
1044 |
|
1045 |
|
1046 |
|
1047 | var funcToString = funcProto.toString;
|
1048 |
|
1049 |
|
1050 | var hasOwnProperty = objectProto.hasOwnProperty;
|
1051 | |
1052 |
|
1053 |
|
1054 |
|
1055 |
|
1056 |
|
1057 | var objectToString = objectProto.toString;
|
1058 |
|
1059 |
|
1060 | var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
|
1061 |
|
1062 |
|
1063 | var _Symbol = root.Symbol,
|
1064 | splice = arrayProto.splice;
|
1065 |
|
1066 |
|
1067 | var Map = getNative(root, 'Map'),
|
1068 | nativeCreate = getNative(Object, 'create');
|
1069 |
|
1070 |
|
1071 | var symbolProto = _Symbol ? _Symbol.prototype : undefined,
|
1072 | symbolToString = symbolProto ? symbolProto.toString : undefined;
|
1073 | |
1074 |
|
1075 |
|
1076 |
|
1077 |
|
1078 |
|
1079 |
|
1080 |
|
1081 | function Hash(entries) {
|
1082 | var index = -1,
|
1083 | length = entries ? entries.length : 0;
|
1084 | this.clear();
|
1085 |
|
1086 | while (++index < length) {
|
1087 | var entry = entries[index];
|
1088 | this.set(entry[0], entry[1]);
|
1089 | }
|
1090 | }
|
1091 | |
1092 |
|
1093 |
|
1094 |
|
1095 |
|
1096 |
|
1097 |
|
1098 |
|
1099 |
|
1100 | function hashClear() {
|
1101 | this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
1102 | }
|
1103 | |
1104 |
|
1105 |
|
1106 |
|
1107 |
|
1108 |
|
1109 |
|
1110 |
|
1111 |
|
1112 |
|
1113 |
|
1114 |
|
1115 | function hashDelete(key) {
|
1116 | return this.has(key) && delete this.__data__[key];
|
1117 | }
|
1118 | |
1119 |
|
1120 |
|
1121 |
|
1122 |
|
1123 |
|
1124 |
|
1125 |
|
1126 |
|
1127 |
|
1128 |
|
1129 | function hashGet(key) {
|
1130 | var data = this.__data__;
|
1131 |
|
1132 | if (nativeCreate) {
|
1133 | var result = data[key];
|
1134 | return result === HASH_UNDEFINED ? undefined : result;
|
1135 | }
|
1136 |
|
1137 | return hasOwnProperty.call(data, key) ? data[key] : undefined;
|
1138 | }
|
1139 | |
1140 |
|
1141 |
|
1142 |
|
1143 |
|
1144 |
|
1145 |
|
1146 |
|
1147 |
|
1148 |
|
1149 |
|
1150 | function hashHas(key) {
|
1151 | var data = this.__data__;
|
1152 | return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
|
1153 | }
|
1154 | |
1155 |
|
1156 |
|
1157 |
|
1158 |
|
1159 |
|
1160 |
|
1161 |
|
1162 |
|
1163 |
|
1164 |
|
1165 |
|
1166 | function hashSet(key, value) {
|
1167 | var data = this.__data__;
|
1168 | data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
|
1169 | return this;
|
1170 | }
|
1171 |
|
1172 |
|
1173 | Hash.prototype.clear = hashClear;
|
1174 | Hash.prototype['delete'] = hashDelete;
|
1175 | Hash.prototype.get = hashGet;
|
1176 | Hash.prototype.has = hashHas;
|
1177 | Hash.prototype.set = hashSet;
|
1178 | |
1179 |
|
1180 |
|
1181 |
|
1182 |
|
1183 |
|
1184 |
|
1185 |
|
1186 | function ListCache(entries) {
|
1187 | var index = -1,
|
1188 | length = entries ? entries.length : 0;
|
1189 | this.clear();
|
1190 |
|
1191 | while (++index < length) {
|
1192 | var entry = entries[index];
|
1193 | this.set(entry[0], entry[1]);
|
1194 | }
|
1195 | }
|
1196 | |
1197 |
|
1198 |
|
1199 |
|
1200 |
|
1201 |
|
1202 |
|
1203 |
|
1204 |
|
1205 | function listCacheClear() {
|
1206 | this.__data__ = [];
|
1207 | }
|
1208 | |
1209 |
|
1210 |
|
1211 |
|
1212 |
|
1213 |
|
1214 |
|
1215 |
|
1216 |
|
1217 |
|
1218 |
|
1219 | function listCacheDelete(key) {
|
1220 | var data = this.__data__,
|
1221 | index = assocIndexOf(data, key);
|
1222 |
|
1223 | if (index < 0) {
|
1224 | return false;
|
1225 | }
|
1226 |
|
1227 | var lastIndex = data.length - 1;
|
1228 |
|
1229 | if (index == lastIndex) {
|
1230 | data.pop();
|
1231 | } else {
|
1232 | splice.call(data, index, 1);
|
1233 | }
|
1234 |
|
1235 | return true;
|
1236 | }
|
1237 | |
1238 |
|
1239 |
|
1240 |
|
1241 |
|
1242 |
|
1243 |
|
1244 |
|
1245 |
|
1246 |
|
1247 |
|
1248 | function listCacheGet(key) {
|
1249 | var data = this.__data__,
|
1250 | index = assocIndexOf(data, key);
|
1251 | return index < 0 ? undefined : data[index][1];
|
1252 | }
|
1253 | |
1254 |
|
1255 |
|
1256 |
|
1257 |
|
1258 |
|
1259 |
|
1260 |
|
1261 |
|
1262 |
|
1263 |
|
1264 | function listCacheHas(key) {
|
1265 | return assocIndexOf(this.__data__, key) > -1;
|
1266 | }
|
1267 | |
1268 |
|
1269 |
|
1270 |
|
1271 |
|
1272 |
|
1273 |
|
1274 |
|
1275 |
|
1276 |
|
1277 |
|
1278 |
|
1279 | function listCacheSet(key, value) {
|
1280 | var data = this.__data__,
|
1281 | index = assocIndexOf(data, key);
|
1282 |
|
1283 | if (index < 0) {
|
1284 | data.push([key, value]);
|
1285 | } else {
|
1286 | data[index][1] = value;
|
1287 | }
|
1288 |
|
1289 | return this;
|
1290 | }
|
1291 |
|
1292 |
|
1293 | ListCache.prototype.clear = listCacheClear;
|
1294 | ListCache.prototype['delete'] = listCacheDelete;
|
1295 | ListCache.prototype.get = listCacheGet;
|
1296 | ListCache.prototype.has = listCacheHas;
|
1297 | ListCache.prototype.set = listCacheSet;
|
1298 | |
1299 |
|
1300 |
|
1301 |
|
1302 |
|
1303 |
|
1304 |
|
1305 |
|
1306 | function MapCache(entries) {
|
1307 | var index = -1,
|
1308 | length = entries ? entries.length : 0;
|
1309 | this.clear();
|
1310 |
|
1311 | while (++index < length) {
|
1312 | var entry = entries[index];
|
1313 | this.set(entry[0], entry[1]);
|
1314 | }
|
1315 | }
|
1316 | |
1317 |
|
1318 |
|
1319 |
|
1320 |
|
1321 |
|
1322 |
|
1323 |
|
1324 |
|
1325 | function mapCacheClear() {
|
1326 | this.__data__ = {
|
1327 | 'hash': new Hash(),
|
1328 | 'map': new (Map || ListCache)(),
|
1329 | 'string': new Hash()
|
1330 | };
|
1331 | }
|
1332 | |
1333 |
|
1334 |
|
1335 |
|
1336 |
|
1337 |
|
1338 |
|
1339 |
|
1340 |
|
1341 |
|
1342 |
|
1343 | function mapCacheDelete(key) {
|
1344 | return getMapData(this, key)['delete'](key);
|
1345 | }
|
1346 | |
1347 |
|
1348 |
|
1349 |
|
1350 |
|
1351 |
|
1352 |
|
1353 |
|
1354 |
|
1355 |
|
1356 |
|
1357 | function mapCacheGet(key) {
|
1358 | return getMapData(this, key).get(key);
|
1359 | }
|
1360 | |
1361 |
|
1362 |
|
1363 |
|
1364 |
|
1365 |
|
1366 |
|
1367 |
|
1368 |
|
1369 |
|
1370 |
|
1371 | function mapCacheHas(key) {
|
1372 | return getMapData(this, key).has(key);
|
1373 | }
|
1374 | |
1375 |
|
1376 |
|
1377 |
|
1378 |
|
1379 |
|
1380 |
|
1381 |
|
1382 |
|
1383 |
|
1384 |
|
1385 |
|
1386 | function mapCacheSet(key, value) {
|
1387 | getMapData(this, key).set(key, value);
|
1388 | return this;
|
1389 | }
|
1390 |
|
1391 |
|
1392 | MapCache.prototype.clear = mapCacheClear;
|
1393 | MapCache.prototype['delete'] = mapCacheDelete;
|
1394 | MapCache.prototype.get = mapCacheGet;
|
1395 | MapCache.prototype.has = mapCacheHas;
|
1396 | MapCache.prototype.set = mapCacheSet;
|
1397 | |
1398 |
|
1399 |
|
1400 |
|
1401 |
|
1402 |
|
1403 |
|
1404 |
|
1405 |
|
1406 | function assocIndexOf(array, key) {
|
1407 | var length = array.length;
|
1408 |
|
1409 | while (length--) {
|
1410 | if (eq(array[length][0], key)) {
|
1411 | return length;
|
1412 | }
|
1413 | }
|
1414 |
|
1415 | return -1;
|
1416 | }
|
1417 | |
1418 |
|
1419 |
|
1420 |
|
1421 |
|
1422 |
|
1423 |
|
1424 |
|
1425 |
|
1426 |
|
1427 | function baseGet(object, path) {
|
1428 | path = isKey(path, object) ? [path] : castPath(path);
|
1429 | var index = 0,
|
1430 | length = path.length;
|
1431 |
|
1432 | while (object != null && index < length) {
|
1433 | object = object[toKey(path[index++])];
|
1434 | }
|
1435 |
|
1436 | return index && index == length ? object : undefined;
|
1437 | }
|
1438 | |
1439 |
|
1440 |
|
1441 |
|
1442 |
|
1443 |
|
1444 |
|
1445 |
|
1446 |
|
1447 |
|
1448 | function baseIsNative(value) {
|
1449 | if (!isObject(value) || isMasked(value)) {
|
1450 | return false;
|
1451 | }
|
1452 |
|
1453 | var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
|
1454 | return pattern.test(toSource(value));
|
1455 | }
|
1456 | |
1457 |
|
1458 |
|
1459 |
|
1460 |
|
1461 |
|
1462 |
|
1463 |
|
1464 |
|
1465 |
|
1466 | function baseToString(value) {
|
1467 |
|
1468 | if (typeof value == 'string') {
|
1469 | return value;
|
1470 | }
|
1471 |
|
1472 | if (isSymbol(value)) {
|
1473 | return symbolToString ? symbolToString.call(value) : '';
|
1474 | }
|
1475 |
|
1476 | var result = value + '';
|
1477 | return result == '0' && 1 / value == -INFINITY ? '-0' : result;
|
1478 | }
|
1479 | |
1480 |
|
1481 |
|
1482 |
|
1483 |
|
1484 |
|
1485 |
|
1486 |
|
1487 |
|
1488 | function castPath(value) {
|
1489 | return isArray(value) ? value : stringToPath(value);
|
1490 | }
|
1491 | |
1492 |
|
1493 |
|
1494 |
|
1495 |
|
1496 |
|
1497 |
|
1498 |
|
1499 |
|
1500 |
|
1501 | function getMapData(map, key) {
|
1502 | var data = map.__data__;
|
1503 | return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
|
1504 | }
|
1505 | |
1506 |
|
1507 |
|
1508 |
|
1509 |
|
1510 |
|
1511 |
|
1512 |
|
1513 |
|
1514 |
|
1515 | function getNative(object, key) {
|
1516 | var value = getValue(object, key);
|
1517 | return baseIsNative(value) ? value : undefined;
|
1518 | }
|
1519 | |
1520 |
|
1521 |
|
1522 |
|
1523 |
|
1524 |
|
1525 |
|
1526 |
|
1527 |
|
1528 |
|
1529 | function isKey(value, object) {
|
1530 | if (isArray(value)) {
|
1531 | return false;
|
1532 | }
|
1533 |
|
1534 | var type = _typeof(value);
|
1535 |
|
1536 | if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) {
|
1537 | return true;
|
1538 | }
|
1539 |
|
1540 | return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
|
1541 | }
|
1542 | |
1543 |
|
1544 |
|
1545 |
|
1546 |
|
1547 |
|
1548 |
|
1549 |
|
1550 |
|
1551 | function isKeyable(value) {
|
1552 | var type = _typeof(value);
|
1553 |
|
1554 | return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;
|
1555 | }
|
1556 | |
1557 |
|
1558 |
|
1559 |
|
1560 |
|
1561 |
|
1562 |
|
1563 |
|
1564 |
|
1565 | function isMasked(func) {
|
1566 | return !!maskSrcKey && maskSrcKey in func;
|
1567 | }
|
1568 | |
1569 |
|
1570 |
|
1571 |
|
1572 |
|
1573 |
|
1574 |
|
1575 |
|
1576 |
|
1577 | var stringToPath = memoize(function (string) {
|
1578 | string = toString(string);
|
1579 | var result = [];
|
1580 |
|
1581 | if (reLeadingDot.test(string)) {
|
1582 | result.push('');
|
1583 | }
|
1584 |
|
1585 | string.replace(rePropName, function (match, number, quote, string) {
|
1586 | result.push(quote ? string.replace(reEscapeChar, '$1') : number || match);
|
1587 | });
|
1588 | return result;
|
1589 | });
|
1590 | |
1591 |
|
1592 |
|
1593 |
|
1594 |
|
1595 |
|
1596 |
|
1597 |
|
1598 | function toKey(value) {
|
1599 | if (typeof value == 'string' || isSymbol(value)) {
|
1600 | return value;
|
1601 | }
|
1602 |
|
1603 | var result = value + '';
|
1604 | return result == '0' && 1 / value == -INFINITY ? '-0' : result;
|
1605 | }
|
1606 | |
1607 |
|
1608 |
|
1609 |
|
1610 |
|
1611 |
|
1612 |
|
1613 |
|
1614 |
|
1615 | function toSource(func) {
|
1616 | if (func != null) {
|
1617 | try {
|
1618 | return funcToString.call(func);
|
1619 | } catch (e) {}
|
1620 |
|
1621 | try {
|
1622 | return func + '';
|
1623 | } catch (e) {}
|
1624 | }
|
1625 |
|
1626 | return '';
|
1627 | }
|
1628 | |
1629 |
|
1630 |
|
1631 |
|
1632 |
|
1633 |
|
1634 |
|
1635 |
|
1636 |
|
1637 |
|
1638 |
|
1639 |
|
1640 |
|
1641 |
|
1642 |
|
1643 |
|
1644 |
|
1645 |
|
1646 |
|
1647 |
|
1648 |
|
1649 |
|
1650 |
|
1651 |
|
1652 |
|
1653 |
|
1654 |
|
1655 |
|
1656 |
|
1657 |
|
1658 |
|
1659 |
|
1660 |
|
1661 |
|
1662 |
|
1663 |
|
1664 |
|
1665 |
|
1666 |
|
1667 |
|
1668 |
|
1669 |
|
1670 |
|
1671 |
|
1672 |
|
1673 |
|
1674 | function memoize(func, resolver) {
|
1675 | if (typeof func != 'function' || resolver && typeof resolver != 'function') {
|
1676 | throw new TypeError(FUNC_ERROR_TEXT);
|
1677 | }
|
1678 |
|
1679 | var memoized = function memoized() {
|
1680 | var args = arguments,
|
1681 | key = resolver ? resolver.apply(this, args) : args[0],
|
1682 | cache = memoized.cache;
|
1683 |
|
1684 | if (cache.has(key)) {
|
1685 | return cache.get(key);
|
1686 | }
|
1687 |
|
1688 | var result = func.apply(this, args);
|
1689 | memoized.cache = cache.set(key, result);
|
1690 | return result;
|
1691 | };
|
1692 |
|
1693 | memoized.cache = new (memoize.Cache || MapCache)();
|
1694 | return memoized;
|
1695 | }
|
1696 |
|
1697 |
|
1698 | memoize.Cache = MapCache;
|
1699 | |
1700 |
|
1701 |
|
1702 |
|
1703 |
|
1704 |
|
1705 |
|
1706 |
|
1707 |
|
1708 |
|
1709 |
|
1710 |
|
1711 |
|
1712 |
|
1713 |
|
1714 |
|
1715 |
|
1716 |
|
1717 |
|
1718 |
|
1719 |
|
1720 |
|
1721 |
|
1722 |
|
1723 |
|
1724 |
|
1725 |
|
1726 |
|
1727 |
|
1728 |
|
1729 |
|
1730 |
|
1731 |
|
1732 | function eq(value, other) {
|
1733 | return value === other || value !== value && other !== other;
|
1734 | }
|
1735 | |
1736 |
|
1737 |
|
1738 |
|
1739 |
|
1740 |
|
1741 |
|
1742 |
|
1743 |
|
1744 |
|
1745 |
|
1746 |
|
1747 |
|
1748 |
|
1749 |
|
1750 |
|
1751 |
|
1752 |
|
1753 |
|
1754 |
|
1755 |
|
1756 |
|
1757 |
|
1758 |
|
1759 |
|
1760 | var isArray = Array.isArray;
|
1761 | |
1762 |
|
1763 |
|
1764 |
|
1765 |
|
1766 |
|
1767 |
|
1768 |
|
1769 |
|
1770 |
|
1771 |
|
1772 |
|
1773 |
|
1774 |
|
1775 |
|
1776 |
|
1777 |
|
1778 |
|
1779 | function isFunction(value) {
|
1780 |
|
1781 |
|
1782 | var tag = isObject(value) ? objectToString.call(value) : '';
|
1783 | return tag == funcTag || tag == genTag;
|
1784 | }
|
1785 | |
1786 |
|
1787 |
|
1788 |
|
1789 |
|
1790 |
|
1791 |
|
1792 |
|
1793 |
|
1794 |
|
1795 |
|
1796 |
|
1797 |
|
1798 |
|
1799 |
|
1800 |
|
1801 |
|
1802 |
|
1803 |
|
1804 |
|
1805 |
|
1806 |
|
1807 |
|
1808 |
|
1809 |
|
1810 |
|
1811 |
|
1812 | function isObject(value) {
|
1813 | var type = _typeof(value);
|
1814 |
|
1815 | return !!value && (type == 'object' || type == 'function');
|
1816 | }
|
1817 | |
1818 |
|
1819 |
|
1820 |
|
1821 |
|
1822 |
|
1823 |
|
1824 |
|
1825 |
|
1826 |
|
1827 |
|
1828 |
|
1829 |
|
1830 |
|
1831 |
|
1832 |
|
1833 |
|
1834 |
|
1835 |
|
1836 |
|
1837 |
|
1838 |
|
1839 |
|
1840 |
|
1841 |
|
1842 |
|
1843 | function isObjectLike(value) {
|
1844 | return !!value && _typeof(value) == 'object';
|
1845 | }
|
1846 | |
1847 |
|
1848 |
|
1849 |
|
1850 |
|
1851 |
|
1852 |
|
1853 |
|
1854 |
|
1855 |
|
1856 |
|
1857 |
|
1858 |
|
1859 |
|
1860 |
|
1861 |
|
1862 |
|
1863 |
|
1864 |
|
1865 | function isSymbol(value) {
|
1866 | return _typeof(value) == 'symbol' || isObjectLike(value) && objectToString.call(value) == symbolTag;
|
1867 | }
|
1868 | |
1869 |
|
1870 |
|
1871 |
|
1872 |
|
1873 |
|
1874 |
|
1875 |
|
1876 |
|
1877 |
|
1878 |
|
1879 |
|
1880 |
|
1881 |
|
1882 |
|
1883 |
|
1884 |
|
1885 |
|
1886 |
|
1887 |
|
1888 |
|
1889 |
|
1890 |
|
1891 | function toString(value) {
|
1892 | return value == null ? '' : baseToString(value);
|
1893 | }
|
1894 | |
1895 |
|
1896 |
|
1897 |
|
1898 |
|
1899 |
|
1900 |
|
1901 |
|
1902 |
|
1903 |
|
1904 |
|
1905 |
|
1906 |
|
1907 |
|
1908 |
|
1909 |
|
1910 |
|
1911 |
|
1912 |
|
1913 |
|
1914 |
|
1915 |
|
1916 |
|
1917 |
|
1918 |
|
1919 |
|
1920 |
|
1921 | function get(object, path, defaultValue) {
|
1922 | var result = object == null ? undefined : baseGet(object, path);
|
1923 | return result === undefined ? defaultValue : result;
|
1924 | }
|
1925 |
|
1926 | var lodash_get = get;
|
1927 |
|
1928 | var formDataFactory = {
|
1929 | createFormData: function createFormData() {
|
1930 | {
|
1931 | return new FormData();
|
1932 | }
|
1933 | }
|
1934 | };
|
1935 |
|
1936 | function getInstance(baseURL) {
|
1937 | var instance = axios__default['default'].create({
|
1938 | baseURL: baseURL
|
1939 | });
|
1940 | instance.interceptors.response.use(function (response) {
|
1941 | var otcsticket = lodash_get(response, 'headers.otcsticket');
|
1942 |
|
1943 | if (otcsticket) {
|
1944 | instance.defaults.headers.common['OTCSTicket'] = otcsticket;
|
1945 | }
|
1946 |
|
1947 | return response;
|
1948 | }, function (error) {
|
1949 | return Promise.reject(error);
|
1950 | });
|
1951 | return instance;
|
1952 | }
|
1953 |
|
1954 | function axiosFactory(options) {
|
1955 | var instance = getInstance(options.baseURL);
|
1956 | var username = lodash_get(options, 'username');
|
1957 | var password = lodash_get(options, 'password');
|
1958 | var otcsticket = lodash_get(options, 'otcsticket');
|
1959 |
|
1960 | if (otcsticket) {
|
1961 | instance.defaults.headers.common['OTCSTicket'] = otcsticket;
|
1962 | } else if (username && password) {
|
1963 | instance.interceptors.request.use( function () {
|
1964 | var _ref = _asyncToGenerator( regeneratorRuntime.mark(function _callee(request) {
|
1965 | var formData, response;
|
1966 | return regeneratorRuntime.wrap(function _callee$(_context) {
|
1967 | while (1) {
|
1968 | switch (_context.prev = _context.next) {
|
1969 | case 0:
|
1970 | if (!request.headers.common['OTCSTicket']) {
|
1971 | _context.next = 4;
|
1972 | break;
|
1973 | }
|
1974 |
|
1975 | return _context.abrupt("return", request);
|
1976 |
|
1977 | case 4:
|
1978 | formData = formDataFactory.createFormData();
|
1979 | formData.append('username', username);
|
1980 | formData.append('password', password);
|
1981 |
|
1982 | {
|
1983 | _context.next = 13;
|
1984 | break;
|
1985 | }
|
1986 |
|
1987 | case 10:
|
1988 | _context.t0 = _context.sent;
|
1989 | _context.next = 16;
|
1990 | break;
|
1991 |
|
1992 | case 13:
|
1993 | _context.next = 15;
|
1994 | return axios__default['default'].post("".concat(options.baseURL, "/api/v1/auth/"), formData);
|
1995 |
|
1996 | case 15:
|
1997 | _context.t0 = _context.sent;
|
1998 |
|
1999 | case 16:
|
2000 | response = _context.t0;
|
2001 | request.headers.common['OTCSTicket'] = lodash_get(response, 'data.ticket');
|
2002 | return _context.abrupt("return", request);
|
2003 |
|
2004 | case 19:
|
2005 | case "end":
|
2006 | return _context.stop();
|
2007 | }
|
2008 | }
|
2009 | }, _callee);
|
2010 | }));
|
2011 |
|
2012 | return function (_x) {
|
2013 | return _ref.apply(this, arguments);
|
2014 | };
|
2015 | }());
|
2016 | } else {
|
2017 | throw 'You must provide an otcsticket or username and password.';
|
2018 | }
|
2019 |
|
2020 | return instance;
|
2021 | }
|
2022 |
|
2023 | var auth = axiosFactory;
|
2024 |
|
2025 | var SubTypes = {
|
2026 | FOLDER: 0,
|
2027 | DOCUMENT: 144
|
2028 | };
|
2029 |
|
2030 | var nodes = function nodes(session) {
|
2031 | return {
|
2032 | addablenodetypes: function addablenodetypes(dataid) {
|
2033 | return session.get("api/v1/nodes/".concat(dataid, "/addablenodetypes"));
|
2034 | },
|
2035 | addDocument: function addDocument(parent_id, fileHandler) {
|
2036 | var _arguments = arguments;
|
2037 | return _asyncToGenerator( regeneratorRuntime.mark(function _callee() {
|
2038 | var fileName, url, formData, path, f, name, _name;
|
2039 |
|
2040 | return regeneratorRuntime.wrap(function _callee$(_context) {
|
2041 | while (1) {
|
2042 | switch (_context.prev = _context.next) {
|
2043 | case 0:
|
2044 | fileName = _arguments.length > 2 && _arguments[2] !== undefined ? _arguments[2] : null;
|
2045 | url = 'api/v1/nodes';
|
2046 | formData = formDataFactory.createFormData();
|
2047 | formData.append('type', SubTypes.DOCUMENT);
|
2048 | formData.append('parent_id', parent_id);
|
2049 |
|
2050 | {
|
2051 | _context.next = 17;
|
2052 | break;
|
2053 | }
|
2054 |
|
2055 | case 10:
|
2056 | f = _context.sent;
|
2057 | name = fileName || path.basename(fileHandler);
|
2058 | formData.append('file', f, name);
|
2059 | formData.append('name', name);
|
2060 | return _context.abrupt("return", session.post(url, formData.getBuffer(), {
|
2061 | headers: formData.getHeaders()
|
2062 | }));
|
2063 |
|
2064 | case 17:
|
2065 |
|
2066 | _name = fileName || fileHandler.name;
|
2067 | formData.append('file', fileHandler, _name);
|
2068 | formData.append('name', _name);
|
2069 | return _context.abrupt("return", session.post(url, formData));
|
2070 |
|
2071 | case 21:
|
2072 | case "end":
|
2073 | return _context.stop();
|
2074 | }
|
2075 | }
|
2076 | }, _callee);
|
2077 | }))();
|
2078 | },
|
2079 | addItem: function addItem(type, parent_id, name) {
|
2080 | var params = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
2081 | return session.postForm('api/v2/nodes', _objectSpread2({
|
2082 | type: type,
|
2083 | parent_id: parent_id,
|
2084 | name: name
|
2085 | }, params));
|
2086 | },
|
2087 | node: function node(dataid) {
|
2088 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
2089 | return session.getCached("api/v2/nodes/".concat(dataid), {
|
2090 | params: params
|
2091 | });
|
2092 | },
|
2093 | ancestors: function ancestors(dataid) {
|
2094 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
2095 | return session.get("api/v1/nodes/".concat(dataid, "/ancestors"), {
|
2096 | params: params
|
2097 | });
|
2098 | },
|
2099 | volumeInfo: function volumeInfo(objType) {
|
2100 | return session.get("api/v1/volumes/".concat(objType));
|
2101 | },
|
2102 | volumes: function volumes() {
|
2103 | return session.get('api/v2/volumes');
|
2104 | },
|
2105 | addFolder: function addFolder(parent_id, name) {
|
2106 | var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
2107 | return this.addItem(SubTypes.FOLDER, parent_id, name, params);
|
2108 | },
|
2109 | children: function children(dataid) {
|
2110 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
2111 |
|
2112 | return session.get("api/v2/nodes/".concat(dataid, "/nodes"), {
|
2113 | params: params
|
2114 | });
|
2115 | },
|
2116 | "delete": function _delete(dataid) {
|
2117 | return session["delete"]("api/v1/nodes/".concat(dataid));
|
2118 | },
|
2119 | download: function download(dataid) {
|
2120 |
|
2121 |
|
2122 | {
|
2123 | return Promise.reject('Not implemented yet');
|
2124 | }
|
2125 | }
|
2126 | };
|
2127 | };
|
2128 |
|
2129 | var workflow = function workflow(session) {
|
2130 | return {
|
2131 | start: function start(map_id) {
|
2132 | var _this = this;
|
2133 |
|
2134 | return this.draftprocesses(map_id).then(function (response) {
|
2135 | return lodash_get(response, 'data.results.draftprocess_id');
|
2136 | }).then(function (draftprocess_id) {
|
2137 | return _this.draftprocesses_update(draftprocess_id);
|
2138 | });
|
2139 | },
|
2140 | draftprocesses: function draftprocesses(workflow_id) {
|
2141 | return session.postForm('api/v2/draftprocesses', {
|
2142 | workflow_id: workflow_id
|
2143 | });
|
2144 | },
|
2145 | draftprocesses_update: function draftprocesses_update(draftprocess_id) {
|
2146 | return session.get('api/v1/forms/draftprocesses/update', {
|
2147 | params: {
|
2148 | draftprocess_id: draftprocess_id
|
2149 | }
|
2150 | });
|
2151 | },
|
2152 | draftprocesses_put: function draftprocesses_put(draftprocess_id, body) {
|
2153 | return session.putForm("api/v2/draftprocesses/".concat(draftprocess_id), {
|
2154 | body: body
|
2155 | });
|
2156 | }
|
2157 |
|
2158 |
|
2159 |
|
2160 |
|
2161 |
|
2162 |
|
2163 |
|
2164 | };
|
2165 | };
|
2166 |
|
2167 | var rhcore = function rhcore(session) {
|
2168 | return {
|
2169 | scriptNode: function scriptNode(id) {
|
2170 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
2171 | return session.get("api/v1/rhcore/".concat(id), {
|
2172 | params: params
|
2173 | });
|
2174 | }
|
2175 | };
|
2176 | };
|
2177 |
|
2178 | var members = function members(session) {
|
2179 | return {
|
2180 | USER: 0,
|
2181 | GROUP: 1,
|
2182 | userQuery: function userQuery(query) {
|
2183 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
2184 | var version = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'v2';
|
2185 |
|
2186 | var params = _objectSpread2({
|
2187 | limit: 20,
|
2188 | where_type: JSON.stringify([this.USER, this.GROUP]),
|
2189 | query: query
|
2190 | }, options);
|
2191 |
|
2192 | return session.get("api/".concat(version, "/members"), {
|
2193 | params: params
|
2194 | });
|
2195 | },
|
2196 | member: function member(id) {
|
2197 | var version = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'v2';
|
2198 | return session.getCached("api/".concat(version, "/members/").concat(id));
|
2199 | }
|
2200 | };
|
2201 | };
|
2202 |
|
2203 | var versions = function versions(session) {
|
2204 | return {
|
2205 | addVersion: function addVersion(dataid, fileHandler) {
|
2206 | var _arguments = arguments;
|
2207 | return _asyncToGenerator( regeneratorRuntime.mark(function _callee() {
|
2208 | var options, url, path, f, params, _params;
|
2209 |
|
2210 | return regeneratorRuntime.wrap(function _callee$(_context) {
|
2211 | while (1) {
|
2212 | switch (_context.prev = _context.next) {
|
2213 | case 0:
|
2214 | options = _arguments.length > 2 && _arguments[2] !== undefined ? _arguments[2] : {};
|
2215 | url = "api/v1/nodes/".concat(dataid, "/versions");
|
2216 |
|
2217 | {
|
2218 | _context.next = 12;
|
2219 | break;
|
2220 | }
|
2221 |
|
2222 | case 7:
|
2223 | f = _context.sent;
|
2224 |
|
2225 | params = _objectSpread2({
|
2226 | file: {
|
2227 | file: f,
|
2228 | name: path.basename(fileHandler)
|
2229 | }
|
2230 | }, options);
|
2231 |
|
2232 | return _context.abrupt("return", session.postForm(url, params));
|
2233 |
|
2234 | case 12:
|
2235 |
|
2236 |
|
2237 | _params = _objectSpread2({
|
2238 | file: {
|
2239 | file: fileHandler,
|
2240 | name: fileHandler.name
|
2241 | }
|
2242 | }, options);
|
2243 | return _context.abrupt("return", session.postForm(url, _params));
|
2244 |
|
2245 | case 14:
|
2246 | case "end":
|
2247 | return _context.stop();
|
2248 | }
|
2249 | }
|
2250 | }, _callee);
|
2251 | }))();
|
2252 | },
|
2253 | list: function list(dataid) {
|
2254 | return _asyncToGenerator( regeneratorRuntime.mark(function _callee2() {
|
2255 | var url;
|
2256 | return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
2257 | while (1) {
|
2258 | switch (_context2.prev = _context2.next) {
|
2259 | case 0:
|
2260 | url = "api/v1/nodes/".concat(dataid, "/versions");
|
2261 | return _context2.abrupt("return", session.get(url));
|
2262 |
|
2263 | case 2:
|
2264 | case "end":
|
2265 | return _context2.stop();
|
2266 | }
|
2267 | }
|
2268 | }, _callee2);
|
2269 | }))();
|
2270 | },
|
2271 | version: function version(dataid) {
|
2272 | var _arguments2 = arguments;
|
2273 | return _asyncToGenerator( regeneratorRuntime.mark(function _callee3() {
|
2274 | var version_number, url;
|
2275 | return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
2276 | while (1) {
|
2277 | switch (_context3.prev = _context3.next) {
|
2278 | case 0:
|
2279 | version_number = _arguments2.length > 1 && _arguments2[1] !== undefined ? _arguments2[1] : 'latest';
|
2280 |
|
2281 | url = "api/v1/nodes/".concat(dataid, "/versions/").concat(version_number);
|
2282 | return _context3.abrupt("return", session.get(url));
|
2283 |
|
2284 | case 3:
|
2285 | case "end":
|
2286 | return _context3.stop();
|
2287 | }
|
2288 | }
|
2289 | }, _callee3);
|
2290 | }))();
|
2291 | }
|
2292 | };
|
2293 | };
|
2294 |
|
2295 | var webreports = function webreports(session) {
|
2296 | return {
|
2297 | run: function run(dataid) {
|
2298 | var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
2299 | var url = "api/v1/nodes/".concat(dataid, "/output");
|
2300 | return session.get(url, {
|
2301 | params: params
|
2302 | });
|
2303 | }
|
2304 | };
|
2305 | };
|
2306 |
|
2307 | |
2308 |
|
2309 |
|
2310 |
|
2311 |
|
2312 |
|
2313 |
|
2314 |
|
2315 |
|
2316 | |
2317 |
|
2318 |
|
2319 |
|
2320 |
|
2321 |
|
2322 |
|
2323 |
|
2324 |
|
2325 |
|
2326 |
|
2327 |
|
2328 |
|
2329 |
|
2330 |
|
2331 |
|
2332 |
|
2333 |
|
2334 |
|
2335 | function isNil(value) {
|
2336 | return value == null;
|
2337 | }
|
2338 |
|
2339 | var lodash_isnil = isNil;
|
2340 |
|
2341 | var crypt = createCommonjsModule(function (module) {
|
2342 | (function () {
|
2343 | var base64map = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
|
2344 | crypt = {
|
2345 |
|
2346 | rotl: function rotl(n, b) {
|
2347 | return n << b | n >>> 32 - b;
|
2348 | },
|
2349 |
|
2350 | rotr: function rotr(n, b) {
|
2351 | return n << 32 - b | n >>> b;
|
2352 | },
|
2353 |
|
2354 | endian: function endian(n) {
|
2355 |
|
2356 | if (n.constructor == Number) {
|
2357 | return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;
|
2358 | }
|
2359 |
|
2360 |
|
2361 | for (var i = 0; i < n.length; i++) {
|
2362 | n[i] = crypt.endian(n[i]);
|
2363 | }
|
2364 |
|
2365 | return n;
|
2366 | },
|
2367 |
|
2368 | randomBytes: function randomBytes(n) {
|
2369 | for (var bytes = []; n > 0; n--) {
|
2370 | bytes.push(Math.floor(Math.random() * 256));
|
2371 | }
|
2372 |
|
2373 | return bytes;
|
2374 | },
|
2375 |
|
2376 | bytesToWords: function bytesToWords(bytes) {
|
2377 | for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8) {
|
2378 | words[b >>> 5] |= bytes[i] << 24 - b % 32;
|
2379 | }
|
2380 |
|
2381 | return words;
|
2382 | },
|
2383 |
|
2384 | wordsToBytes: function wordsToBytes(words) {
|
2385 | for (var bytes = [], b = 0; b < words.length * 32; b += 8) {
|
2386 | bytes.push(words[b >>> 5] >>> 24 - b % 32 & 0xFF);
|
2387 | }
|
2388 |
|
2389 | return bytes;
|
2390 | },
|
2391 |
|
2392 | bytesToHex: function bytesToHex(bytes) {
|
2393 | for (var hex = [], i = 0; i < bytes.length; i++) {
|
2394 | hex.push((bytes[i] >>> 4).toString(16));
|
2395 | hex.push((bytes[i] & 0xF).toString(16));
|
2396 | }
|
2397 |
|
2398 | return hex.join('');
|
2399 | },
|
2400 |
|
2401 | hexToBytes: function hexToBytes(hex) {
|
2402 | for (var bytes = [], c = 0; c < hex.length; c += 2) {
|
2403 | bytes.push(parseInt(hex.substr(c, 2), 16));
|
2404 | }
|
2405 |
|
2406 | return bytes;
|
2407 | },
|
2408 |
|
2409 | bytesToBase64: function bytesToBase64(bytes) {
|
2410 | for (var base64 = [], i = 0; i < bytes.length; i += 3) {
|
2411 | var triplet = bytes[i] << 16 | bytes[i + 1] << 8 | bytes[i + 2];
|
2412 |
|
2413 | for (var j = 0; j < 4; j++) {
|
2414 | if (i * 8 + j * 6 <= bytes.length * 8) base64.push(base64map.charAt(triplet >>> 6 * (3 - j) & 0x3F));else base64.push('=');
|
2415 | }
|
2416 | }
|
2417 |
|
2418 | return base64.join('');
|
2419 | },
|
2420 |
|
2421 | base64ToBytes: function base64ToBytes(base64) {
|
2422 |
|
2423 | base64 = base64.replace(/[^A-Z0-9+\/]/ig, '');
|
2424 |
|
2425 | for (var bytes = [], i = 0, imod4 = 0; i < base64.length; imod4 = ++i % 4) {
|
2426 | if (imod4 == 0) continue;
|
2427 | bytes.push((base64map.indexOf(base64.charAt(i - 1)) & Math.pow(2, -2 * imod4 + 8) - 1) << imod4 * 2 | base64map.indexOf(base64.charAt(i)) >>> 6 - imod4 * 2);
|
2428 | }
|
2429 |
|
2430 | return bytes;
|
2431 | }
|
2432 | };
|
2433 | module.exports = crypt;
|
2434 | })();
|
2435 | });
|
2436 |
|
2437 | var charenc = {
|
2438 |
|
2439 | utf8: {
|
2440 |
|
2441 | stringToBytes: function stringToBytes(str) {
|
2442 | return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));
|
2443 | },
|
2444 |
|
2445 | bytesToString: function bytesToString(bytes) {
|
2446 | return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));
|
2447 | }
|
2448 | },
|
2449 |
|
2450 | bin: {
|
2451 |
|
2452 | stringToBytes: function stringToBytes(str) {
|
2453 | for (var bytes = [], i = 0; i < str.length; i++) {
|
2454 | bytes.push(str.charCodeAt(i) & 0xFF);
|
2455 | }
|
2456 |
|
2457 | return bytes;
|
2458 | },
|
2459 |
|
2460 | bytesToString: function bytesToString(bytes) {
|
2461 | for (var str = [], i = 0; i < bytes.length; i++) {
|
2462 | str.push(String.fromCharCode(bytes[i]));
|
2463 | }
|
2464 |
|
2465 | return str.join('');
|
2466 | }
|
2467 | }
|
2468 | };
|
2469 | var charenc_1 = charenc;
|
2470 |
|
2471 | var sha1 = createCommonjsModule(function (module) {
|
2472 | (function () {
|
2473 | var crypt$1 = crypt,
|
2474 | utf8 = charenc_1.utf8,
|
2475 | bin = charenc_1.bin,
|
2476 |
|
2477 | sha1 = function sha1(message) {
|
2478 |
|
2479 | if (message.constructor == String) message = utf8.stringToBytes(message);else if (typeof Buffer !== 'undefined' && typeof Buffer.isBuffer == 'function' && Buffer.isBuffer(message)) message = Array.prototype.slice.call(message, 0);else if (!Array.isArray(message)) message = message.toString();
|
2480 |
|
2481 | var m = crypt$1.bytesToWords(message),
|
2482 | l = message.length * 8,
|
2483 | w = [],
|
2484 | H0 = 1732584193,
|
2485 | H1 = -271733879,
|
2486 | H2 = -1732584194,
|
2487 | H3 = 271733878,
|
2488 | H4 = -1009589776;
|
2489 |
|
2490 | m[l >> 5] |= 0x80 << 24 - l % 32;
|
2491 | m[(l + 64 >>> 9 << 4) + 15] = l;
|
2492 |
|
2493 | for (var i = 0; i < m.length; i += 16) {
|
2494 | var a = H0,
|
2495 | b = H1,
|
2496 | c = H2,
|
2497 | d = H3,
|
2498 | e = H4;
|
2499 |
|
2500 | for (var j = 0; j < 80; j++) {
|
2501 | if (j < 16) w[j] = m[i + j];else {
|
2502 | var n = w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16];
|
2503 | w[j] = n << 1 | n >>> 31;
|
2504 | }
|
2505 | var t = (H0 << 5 | H0 >>> 27) + H4 + (w[j] >>> 0) + (j < 20 ? (H1 & H2 | ~H1 & H3) + 1518500249 : j < 40 ? (H1 ^ H2 ^ H3) + 1859775393 : j < 60 ? (H1 & H2 | H1 & H3 | H2 & H3) - 1894007588 : (H1 ^ H2 ^ H3) - 899497514);
|
2506 | H4 = H3;
|
2507 | H3 = H2;
|
2508 | H2 = H1 << 30 | H1 >>> 2;
|
2509 | H1 = H0;
|
2510 | H0 = t;
|
2511 | }
|
2512 |
|
2513 | H0 += a;
|
2514 | H1 += b;
|
2515 | H2 += c;
|
2516 | H3 += d;
|
2517 | H4 += e;
|
2518 | }
|
2519 |
|
2520 | return [H0, H1, H2, H3, H4];
|
2521 | },
|
2522 |
|
2523 | api = function api(message, options) {
|
2524 | var digestbytes = crypt$1.wordsToBytes(sha1(message));
|
2525 | return options && options.asBytes ? digestbytes : options && options.asString ? bin.bytesToString(digestbytes) : crypt$1.bytesToHex(digestbytes);
|
2526 | };
|
2527 |
|
2528 | api._blocksize = 16;
|
2529 | api._digestsize = 20;
|
2530 | module.exports = api;
|
2531 | })();
|
2532 | });
|
2533 |
|
2534 | var SemaphoreItem = function () {
|
2535 | function SemaphoreItem(max) {
|
2536 | _classCallCheck(this, SemaphoreItem);
|
2537 |
|
2538 | this.queue = [];
|
2539 | this.max = max;
|
2540 | this.count = 0;
|
2541 | }
|
2542 |
|
2543 | _createClass(SemaphoreItem, [{
|
2544 | key: "acquire",
|
2545 | value: function acquire() {
|
2546 | var _this = this;
|
2547 |
|
2548 | if (this.count < this.max) {
|
2549 | this.count++;
|
2550 | return Promise.resolve();
|
2551 | } else {
|
2552 | return new Promise(function (resolve) {
|
2553 | _this.queue.push(resolve);
|
2554 | });
|
2555 | }
|
2556 | }
|
2557 | }, {
|
2558 | key: "release",
|
2559 | value: function release() {
|
2560 | var resolveFunc = this.queue.shift();
|
2561 |
|
2562 | if (resolveFunc) {
|
2563 |
|
2564 | setTimeout(resolveFunc, 0);
|
2565 | } else {
|
2566 | this.count--;
|
2567 | }
|
2568 | }
|
2569 | }]);
|
2570 |
|
2571 | return SemaphoreItem;
|
2572 | }();
|
2573 |
|
2574 | var defaultKey = '_default';
|
2575 |
|
2576 | var Semaphore = function () {
|
2577 | function Semaphore() {
|
2578 | var max = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
2579 |
|
2580 | _classCallCheck(this, Semaphore);
|
2581 |
|
2582 | this.semaphoreItems = {};
|
2583 | this.max = max;
|
2584 | }
|
2585 |
|
2586 | _createClass(Semaphore, [{
|
2587 | key: "_getSemaphoreInstance",
|
2588 | value: function _getSemaphoreInstance() {
|
2589 | var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultKey;
|
2590 |
|
2591 | if (!this.semaphoreItems[key]) {
|
2592 | this.semaphoreItems[key] = new SemaphoreItem(this.max);
|
2593 | }
|
2594 |
|
2595 | return this.semaphoreItems[key];
|
2596 | }
|
2597 | }, {
|
2598 | key: "_tidy",
|
2599 | value: function _tidy() {
|
2600 | var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultKey;
|
2601 |
|
2602 | if (this._getSemaphoreInstance(key).count == 0) {
|
2603 | delete this.semaphoreItems[key];
|
2604 | }
|
2605 | }
|
2606 | }, {
|
2607 | key: "acquire",
|
2608 | value: function acquire() {
|
2609 | var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultKey;
|
2610 | return this._getSemaphoreInstance(key).acquire();
|
2611 | }
|
2612 | }, {
|
2613 | key: "release",
|
2614 | value: function release() {
|
2615 | var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultKey;
|
2616 |
|
2617 | this._getSemaphoreInstance(key).release();
|
2618 |
|
2619 | this._tidy(key);
|
2620 | }
|
2621 | }, {
|
2622 | key: "count",
|
2623 | value: function count() {
|
2624 | var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultKey;
|
2625 |
|
2626 | if (this.semaphoreItems[key]) {
|
2627 | return this.semaphoreItems[key].count;
|
2628 | } else {
|
2629 | return 0;
|
2630 | }
|
2631 | }
|
2632 | }, {
|
2633 | key: "hasTasks",
|
2634 | value: function hasTasks() {
|
2635 | var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultKey;
|
2636 | return this.count(key) > 0;
|
2637 | }
|
2638 | }]);
|
2639 |
|
2640 | return Semaphore;
|
2641 | }();
|
2642 |
|
2643 | var src = Semaphore;
|
2644 |
|
2645 | var index_es = Object.freeze({
|
2646 | __proto__: null,
|
2647 | 'default': src
|
2648 | });
|
2649 |
|
2650 | var Semaphore$1 = getAugmentedNamespace(index_es);
|
2651 |
|
2652 | var semaphore = new Semaphore$1();
|
2653 | var getCache = {};
|
2654 |
|
2655 | var Session_1 = function () {
|
2656 | function Session(options) {
|
2657 | _classCallCheck(this, Session);
|
2658 |
|
2659 | this.axios = auth(options);
|
2660 | }
|
2661 |
|
2662 | _createClass(Session, [{
|
2663 | key: "_isObject",
|
2664 | value: function _isObject(value) {
|
2665 | return value && _typeof(value) === 'object' && value.constructor === Object;
|
2666 | }
|
2667 | }, {
|
2668 | key: "_objectToForm",
|
2669 | value: function _objectToForm(obj) {
|
2670 | var formData = formDataFactory.createFormData();
|
2671 |
|
2672 | for (var _i = 0, _Object$entries = Object.entries(obj); _i < _Object$entries.length; _i++) {
|
2673 | var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
2674 | key = _Object$entries$_i[0],
|
2675 | value = _Object$entries$_i[1];
|
2676 |
|
2677 | if (value && value.name && value.file) {
|
2678 | formData.append(key, value.file, value.name);
|
2679 | } else if (Array.isArray(value) || this._isObject(value)) {
|
2680 | formData.append(key, JSON.stringify(value));
|
2681 | } else if (!lodash_isnil(value)) {
|
2682 |
|
2683 | formData.append(key, value);
|
2684 | }
|
2685 | }
|
2686 |
|
2687 | return formData;
|
2688 | }
|
2689 | }, {
|
2690 | key: "get",
|
2691 | value: function get() {
|
2692 | var _this$axios;
|
2693 |
|
2694 | return (_this$axios = this.axios).get.apply(_this$axios, arguments);
|
2695 | }
|
2696 | }, {
|
2697 | key: "getCached",
|
2698 | value: function () {
|
2699 | var _getCached = _asyncToGenerator( regeneratorRuntime.mark(function _callee() {
|
2700 | var _len,
|
2701 | args,
|
2702 | _key,
|
2703 | key,
|
2704 | _args = arguments;
|
2705 |
|
2706 | return regeneratorRuntime.wrap(function _callee$(_context) {
|
2707 | while (1) {
|
2708 | switch (_context.prev = _context.next) {
|
2709 | case 0:
|
2710 | for (_len = _args.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
2711 | args[_key] = _args[_key];
|
2712 | }
|
2713 |
|
2714 | key = sha1(JSON.stringify(args));
|
2715 | _context.prev = 2;
|
2716 | _context.next = 5;
|
2717 | return semaphore.acquire(key);
|
2718 |
|
2719 | case 5:
|
2720 | if (!getCache[key]) {
|
2721 | getCache[key] = this.get.apply(this, args);
|
2722 | }
|
2723 |
|
2724 | case 6:
|
2725 | _context.prev = 6;
|
2726 | semaphore.release(key);
|
2727 | return _context.finish(6);
|
2728 |
|
2729 | case 9:
|
2730 | return _context.abrupt("return", getCache[key]);
|
2731 |
|
2732 | case 10:
|
2733 | case "end":
|
2734 | return _context.stop();
|
2735 | }
|
2736 | }
|
2737 | }, _callee, this, [[2,, 6, 9]]);
|
2738 | }));
|
2739 |
|
2740 | function getCached() {
|
2741 | return _getCached.apply(this, arguments);
|
2742 | }
|
2743 |
|
2744 | return getCached;
|
2745 | }()
|
2746 | }, {
|
2747 | key: "putForm",
|
2748 | value: function putForm(url, params) {
|
2749 | var formData = this._objectToForm(params);
|
2750 |
|
2751 | return this.put(url, formData);
|
2752 | }
|
2753 | }, {
|
2754 | key: "postForm",
|
2755 | value: function postForm(url, params) {
|
2756 | var formData = this._objectToForm(params);
|
2757 |
|
2758 | return this.post(url, formData);
|
2759 | }
|
2760 | }, {
|
2761 | key: "patchForm",
|
2762 | value: function patchForm(url, params) {
|
2763 | var formData = this._objectToForm(params);
|
2764 |
|
2765 | return this.patch(url, formData);
|
2766 | }
|
2767 | }, {
|
2768 | key: "post",
|
2769 | value: function post() {
|
2770 | var _this$axios2;
|
2771 |
|
2772 | return (_this$axios2 = this.axios).post.apply(_this$axios2, arguments);
|
2773 | }
|
2774 | }, {
|
2775 | key: "put",
|
2776 | value: function put() {
|
2777 | var _this$axios3;
|
2778 |
|
2779 | return (_this$axios3 = this.axios).put.apply(_this$axios3, arguments);
|
2780 | }
|
2781 | }, {
|
2782 | key: "delete",
|
2783 | value: function _delete() {
|
2784 | var _this$axios4;
|
2785 |
|
2786 | return (_this$axios4 = this.axios)["delete"].apply(_this$axios4, arguments);
|
2787 | }
|
2788 | }, {
|
2789 | key: "options",
|
2790 | value: function options() {
|
2791 | var _this$axios5;
|
2792 |
|
2793 | return (_this$axios5 = this.axios).options.apply(_this$axios5, arguments);
|
2794 | }
|
2795 | }, {
|
2796 | key: "patch",
|
2797 | value: function patch() {
|
2798 | var _this$axios6;
|
2799 |
|
2800 | return (_this$axios6 = this.axios).patch.apply(_this$axios6, arguments);
|
2801 | }
|
2802 | }, {
|
2803 | key: "nodes",
|
2804 | get: function get() {
|
2805 |
|
2806 | if (this._nodes == null) {
|
2807 | this._nodes = nodes(this);
|
2808 | }
|
2809 |
|
2810 | return this._nodes;
|
2811 | }
|
2812 | }, {
|
2813 | key: "workflow",
|
2814 | get: function get() {
|
2815 |
|
2816 | if (this._workflow == null) {
|
2817 | this._workflow = workflow(this);
|
2818 | }
|
2819 |
|
2820 | return this._workflow;
|
2821 | }
|
2822 | }, {
|
2823 | key: "rhcore",
|
2824 | get: function get() {
|
2825 |
|
2826 | if (this._rhcore == null) {
|
2827 | this._rhcore = rhcore(this);
|
2828 | }
|
2829 |
|
2830 | return this._rhcore;
|
2831 | }
|
2832 | }, {
|
2833 | key: "members",
|
2834 | get: function get() {
|
2835 |
|
2836 | if (this._members == null) {
|
2837 | this._members = members(this);
|
2838 | }
|
2839 |
|
2840 | return this._members;
|
2841 | }
|
2842 | }, {
|
2843 | key: "webreports",
|
2844 | get: function get() {
|
2845 |
|
2846 | if (this._webreports == null) {
|
2847 | this._webreports = webreports(this);
|
2848 | }
|
2849 |
|
2850 | return this._webreports;
|
2851 | }
|
2852 | }, {
|
2853 | key: "versions",
|
2854 | get: function get() {
|
2855 |
|
2856 | if (this._versions == null) {
|
2857 | this._versions = versions(this);
|
2858 | }
|
2859 |
|
2860 | return this._versions;
|
2861 | }
|
2862 | }]);
|
2863 |
|
2864 | return Session;
|
2865 | }();
|
2866 |
|
2867 | var auth_1 = auth;
|
2868 | var Session_1$1 = Session_1;
|
2869 | var src$1 = {
|
2870 | auth: auth_1,
|
2871 | Session: Session_1$1
|
2872 | };
|
2873 |
|
2874 | exports.Session = Session_1$1;
|
2875 | exports.auth = auth_1;
|
2876 | exports.default = src$1;
|
2877 |
|
2878 | Object.defineProperty(exports, '__esModule', { value: true });
|
2879 |
|
2880 | })));
|
2881 |
|