oro-sdk-apis 3.8.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,433 +14,119 @@ var axios = _interopDefault(require('axios'));
14
14
  * @param value the string to hash
15
15
  * @returns a base64 string representation of a hashed value
16
16
  */
17
-
18
17
  function hashToBase64String(value) {
19
18
  return _.Buffer.from(hash_js.sha256().update(value).digest('hex'), 'hex').toString('base64');
20
19
  }
21
20
 
22
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
23
- try {
24
- var info = gen[key](arg);
25
- var value = info.value;
26
- } catch (error) {
27
- reject(error);
28
- return;
29
- }
30
-
31
- if (info.done) {
32
- resolve(value);
33
- } else {
34
- Promise.resolve(value).then(_next, _throw);
35
- }
36
- }
37
-
38
- function _asyncToGenerator(fn) {
39
- return function () {
40
- var self = this,
41
- args = arguments;
42
- return new Promise(function (resolve, reject) {
43
- var gen = fn.apply(self, args);
44
-
45
- function _next(value) {
46
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
47
- }
48
-
49
- function _throw(err) {
50
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
51
- }
52
-
53
- _next(undefined);
54
- });
55
- };
56
- }
57
-
58
- function _extends() {
59
- _extends = Object.assign || function (target) {
60
- for (var i = 1; i < arguments.length; i++) {
61
- var source = arguments[i];
62
-
63
- for (var key in source) {
64
- if (Object.prototype.hasOwnProperty.call(source, key)) {
65
- target[key] = source[key];
66
- }
67
- }
68
- }
69
-
70
- return target;
21
+ function _regeneratorRuntime() {
22
+ _regeneratorRuntime = function () {
23
+ return exports;
71
24
  };
72
-
73
- return _extends.apply(this, arguments);
74
- }
75
-
76
- function _inheritsLoose(subClass, superClass) {
77
- subClass.prototype = Object.create(superClass.prototype);
78
- subClass.prototype.constructor = subClass;
79
-
80
- _setPrototypeOf(subClass, superClass);
81
- }
82
-
83
- function _getPrototypeOf(o) {
84
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
85
- return o.__proto__ || Object.getPrototypeOf(o);
86
- };
87
- return _getPrototypeOf(o);
88
- }
89
-
90
- function _setPrototypeOf(o, p) {
91
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
92
- o.__proto__ = p;
93
- return o;
94
- };
95
-
96
- return _setPrototypeOf(o, p);
97
- }
98
-
99
- function _isNativeReflectConstruct() {
100
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
101
- if (Reflect.construct.sham) return false;
102
- if (typeof Proxy === "function") return true;
103
-
104
- try {
105
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
106
- return true;
107
- } catch (e) {
108
- return false;
109
- }
110
- }
111
-
112
- function _construct(Parent, args, Class) {
113
- if (_isNativeReflectConstruct()) {
114
- _construct = Reflect.construct;
115
- } else {
116
- _construct = function _construct(Parent, args, Class) {
117
- var a = [null];
118
- a.push.apply(a, args);
119
- var Constructor = Function.bind.apply(Parent, a);
120
- var instance = new Constructor();
121
- if (Class) _setPrototypeOf(instance, Class.prototype);
122
- return instance;
123
- };
124
- }
125
-
126
- return _construct.apply(null, arguments);
127
- }
128
-
129
- function _isNativeFunction(fn) {
130
- return Function.toString.call(fn).indexOf("[native code]") !== -1;
131
- }
132
-
133
- function _wrapNativeSuper(Class) {
134
- var _cache = typeof Map === "function" ? new Map() : undefined;
135
-
136
- _wrapNativeSuper = function _wrapNativeSuper(Class) {
137
- if (Class === null || !_isNativeFunction(Class)) return Class;
138
-
139
- if (typeof Class !== "function") {
140
- throw new TypeError("Super expression must either be null or a function");
141
- }
142
-
143
- if (typeof _cache !== "undefined") {
144
- if (_cache.has(Class)) return _cache.get(Class);
145
-
146
- _cache.set(Class, Wrapper);
147
- }
148
-
149
- function Wrapper() {
150
- return _construct(Class, arguments, _getPrototypeOf(this).constructor);
151
- }
152
-
153
- Wrapper.prototype = Object.create(Class.prototype, {
154
- constructor: {
155
- value: Wrapper,
156
- enumerable: false,
157
- writable: true,
158
- configurable: true
159
- }
160
- });
161
- return _setPrototypeOf(Wrapper, Class);
162
- };
163
-
164
- return _wrapNativeSuper(Class);
165
- }
166
-
167
- function _assertThisInitialized(self) {
168
- if (self === void 0) {
169
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
170
- }
171
-
172
- return self;
173
- }
174
-
175
- function createCommonjsModule(fn, module) {
176
- return module = { exports: {} }, fn(module, module.exports), module.exports;
177
- }
178
-
179
- var runtime_1 = createCommonjsModule(function (module) {
180
- /**
181
- * Copyright (c) 2014-present, Facebook, Inc.
182
- *
183
- * This source code is licensed under the MIT license found in the
184
- * LICENSE file in the root directory of this source tree.
185
- */
186
-
187
- var runtime = (function (exports) {
188
-
189
- var Op = Object.prototype;
190
- var hasOwn = Op.hasOwnProperty;
191
- var undefined$1; // More compressible than void 0.
192
- var $Symbol = typeof Symbol === "function" ? Symbol : {};
193
- var iteratorSymbol = $Symbol.iterator || "@@iterator";
194
- var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
195
- var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
196
-
25
+ var exports = {},
26
+ Op = Object.prototype,
27
+ hasOwn = Op.hasOwnProperty,
28
+ defineProperty = Object.defineProperty || function (obj, key, desc) {
29
+ obj[key] = desc.value;
30
+ },
31
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
32
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
33
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
34
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
197
35
  function define(obj, key, value) {
198
- Object.defineProperty(obj, key, {
36
+ return Object.defineProperty(obj, key, {
199
37
  value: value,
200
- enumerable: true,
201
- configurable: true,
202
- writable: true
203
- });
204
- return obj[key];
38
+ enumerable: !0,
39
+ configurable: !0,
40
+ writable: !0
41
+ }), obj[key];
205
42
  }
206
43
  try {
207
- // IE 8 has a broken Object.defineProperty that only works on DOM objects.
208
44
  define({}, "");
209
45
  } catch (err) {
210
- define = function(obj, key, value) {
46
+ define = function (obj, key, value) {
211
47
  return obj[key] = value;
212
48
  };
213
49
  }
214
-
215
50
  function wrap(innerFn, outerFn, self, tryLocsList) {
216
- // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
217
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
218
- var generator = Object.create(protoGenerator.prototype);
219
- var context = new Context(tryLocsList || []);
220
-
221
- // The ._invoke method unifies the implementations of the .next,
222
- // .throw, and .return methods.
223
- generator._invoke = makeInvokeMethod(innerFn, self, context);
224
-
225
- return generator;
51
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
52
+ generator = Object.create(protoGenerator.prototype),
53
+ context = new Context(tryLocsList || []);
54
+ return defineProperty(generator, "_invoke", {
55
+ value: makeInvokeMethod(innerFn, self, context)
56
+ }), generator;
226
57
  }
227
- exports.wrap = wrap;
228
-
229
- // Try/catch helper to minimize deoptimizations. Returns a completion
230
- // record like context.tryEntries[i].completion. This interface could
231
- // have been (and was previously) designed to take a closure to be
232
- // invoked without arguments, but in all the cases we care about we
233
- // already have an existing method we want to call, so there's no need
234
- // to create a new function object. We can even get away with assuming
235
- // the method takes exactly one argument, since that happens to be true
236
- // in every case, so we don't have to touch the arguments object. The
237
- // only additional allocation required is the completion record, which
238
- // has a stable shape and so hopefully should be cheap to allocate.
239
58
  function tryCatch(fn, obj, arg) {
240
59
  try {
241
- return { type: "normal", arg: fn.call(obj, arg) };
60
+ return {
61
+ type: "normal",
62
+ arg: fn.call(obj, arg)
63
+ };
242
64
  } catch (err) {
243
- return { type: "throw", arg: err };
65
+ return {
66
+ type: "throw",
67
+ arg: err
68
+ };
244
69
  }
245
70
  }
246
-
247
- var GenStateSuspendedStart = "suspendedStart";
248
- var GenStateSuspendedYield = "suspendedYield";
249
- var GenStateExecuting = "executing";
250
- var GenStateCompleted = "completed";
251
-
252
- // Returning this object from the innerFn has the same effect as
253
- // breaking out of the dispatch switch statement.
71
+ exports.wrap = wrap;
254
72
  var ContinueSentinel = {};
255
-
256
- // Dummy constructor functions that we use as the .constructor and
257
- // .constructor.prototype properties for functions that return Generator
258
- // objects. For full spec compliance, you may wish to configure your
259
- // minifier not to mangle the names of these two functions.
260
73
  function Generator() {}
261
74
  function GeneratorFunction() {}
262
75
  function GeneratorFunctionPrototype() {}
263
-
264
- // This is a polyfill for %IteratorPrototype% for environments that
265
- // don't natively support it.
266
76
  var IteratorPrototype = {};
267
77
  define(IteratorPrototype, iteratorSymbol, function () {
268
78
  return this;
269
79
  });
270
-
271
- var getProto = Object.getPrototypeOf;
272
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
273
- if (NativeIteratorPrototype &&
274
- NativeIteratorPrototype !== Op &&
275
- hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
276
- // This environment has a native %IteratorPrototype%; use it instead
277
- // of the polyfill.
278
- IteratorPrototype = NativeIteratorPrototype;
279
- }
280
-
281
- var Gp = GeneratorFunctionPrototype.prototype =
282
- Generator.prototype = Object.create(IteratorPrototype);
283
- GeneratorFunction.prototype = GeneratorFunctionPrototype;
284
- define(Gp, "constructor", GeneratorFunctionPrototype);
285
- define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
286
- GeneratorFunction.displayName = define(
287
- GeneratorFunctionPrototype,
288
- toStringTagSymbol,
289
- "GeneratorFunction"
290
- );
291
-
292
- // Helper for defining the .next, .throw, and .return methods of the
293
- // Iterator interface in terms of a single ._invoke method.
80
+ var getProto = Object.getPrototypeOf,
81
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
82
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
83
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
294
84
  function defineIteratorMethods(prototype) {
295
- ["next", "throw", "return"].forEach(function(method) {
296
- define(prototype, method, function(arg) {
85
+ ["next", "throw", "return"].forEach(function (method) {
86
+ define(prototype, method, function (arg) {
297
87
  return this._invoke(method, arg);
298
88
  });
299
89
  });
300
90
  }
301
-
302
- exports.isGeneratorFunction = function(genFun) {
303
- var ctor = typeof genFun === "function" && genFun.constructor;
304
- return ctor
305
- ? ctor === GeneratorFunction ||
306
- // For the native GeneratorFunction constructor, the best we can
307
- // do is to check its .name property.
308
- (ctor.displayName || ctor.name) === "GeneratorFunction"
309
- : false;
310
- };
311
-
312
- exports.mark = function(genFun) {
313
- if (Object.setPrototypeOf) {
314
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
315
- } else {
316
- genFun.__proto__ = GeneratorFunctionPrototype;
317
- define(genFun, toStringTagSymbol, "GeneratorFunction");
318
- }
319
- genFun.prototype = Object.create(Gp);
320
- return genFun;
321
- };
322
-
323
- // Within the body of any async function, `await x` is transformed to
324
- // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
325
- // `hasOwn.call(value, "__await")` to determine if the yielded value is
326
- // meant to be awaited.
327
- exports.awrap = function(arg) {
328
- return { __await: arg };
329
- };
330
-
331
91
  function AsyncIterator(generator, PromiseImpl) {
332
92
  function invoke(method, arg, resolve, reject) {
333
93
  var record = tryCatch(generator[method], generator, arg);
334
- if (record.type === "throw") {
335
- reject(record.arg);
336
- } else {
337
- var result = record.arg;
338
- var value = result.value;
339
- if (value &&
340
- typeof value === "object" &&
341
- hasOwn.call(value, "__await")) {
342
- return PromiseImpl.resolve(value.__await).then(function(value) {
343
- invoke("next", value, resolve, reject);
344
- }, function(err) {
345
- invoke("throw", err, resolve, reject);
346
- });
347
- }
348
-
349
- return PromiseImpl.resolve(value).then(function(unwrapped) {
350
- // When a yielded Promise is resolved, its final value becomes
351
- // the .value of the Promise<{value,done}> result for the
352
- // current iteration.
353
- result.value = unwrapped;
354
- resolve(result);
355
- }, function(error) {
356
- // If a rejected Promise was yielded, throw the rejection back
357
- // into the async generator function so it can be handled there.
94
+ if ("throw" !== record.type) {
95
+ var result = record.arg,
96
+ value = result.value;
97
+ return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
98
+ invoke("next", value, resolve, reject);
99
+ }, function (err) {
100
+ invoke("throw", err, resolve, reject);
101
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
102
+ result.value = unwrapped, resolve(result);
103
+ }, function (error) {
358
104
  return invoke("throw", error, resolve, reject);
359
105
  });
360
106
  }
107
+ reject(record.arg);
361
108
  }
362
-
363
109
  var previousPromise;
364
-
365
- function enqueue(method, arg) {
366
- function callInvokeWithMethodAndArg() {
367
- return new PromiseImpl(function(resolve, reject) {
368
- invoke(method, arg, resolve, reject);
369
- });
110
+ defineProperty(this, "_invoke", {
111
+ value: function (method, arg) {
112
+ function callInvokeWithMethodAndArg() {
113
+ return new PromiseImpl(function (resolve, reject) {
114
+ invoke(method, arg, resolve, reject);
115
+ });
116
+ }
117
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
370
118
  }
371
-
372
- return previousPromise =
373
- // If enqueue has been called before, then we want to wait until
374
- // all previous Promises have been resolved before calling invoke,
375
- // so that results are always delivered in the correct order. If
376
- // enqueue has not been called before, then it is important to
377
- // call invoke immediately, without waiting on a callback to fire,
378
- // so that the async generator function has the opportunity to do
379
- // any necessary setup in a predictable way. This predictability
380
- // is why the Promise constructor synchronously invokes its
381
- // executor callback, and why async functions synchronously
382
- // execute code before the first await. Since we implement simple
383
- // async functions in terms of async generators, it is especially
384
- // important to get this right, even though it requires care.
385
- previousPromise ? previousPromise.then(
386
- callInvokeWithMethodAndArg,
387
- // Avoid propagating failures to Promises returned by later
388
- // invocations of the iterator.
389
- callInvokeWithMethodAndArg
390
- ) : callInvokeWithMethodAndArg();
391
- }
392
-
393
- // Define the unified helper method that is used to implement .next,
394
- // .throw, and .return (see defineIteratorMethods).
395
- this._invoke = enqueue;
119
+ });
396
120
  }
397
-
398
- defineIteratorMethods(AsyncIterator.prototype);
399
- define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
400
- return this;
401
- });
402
- exports.AsyncIterator = AsyncIterator;
403
-
404
- // Note that simple async functions are implemented on top of
405
- // AsyncIterator objects; they just return a Promise for the value of
406
- // the final result produced by the iterator.
407
- exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
408
- if (PromiseImpl === void 0) PromiseImpl = Promise;
409
-
410
- var iter = new AsyncIterator(
411
- wrap(innerFn, outerFn, self, tryLocsList),
412
- PromiseImpl
413
- );
414
-
415
- return exports.isGeneratorFunction(outerFn)
416
- ? iter // If outerFn is a generator, return the full iterator.
417
- : iter.next().then(function(result) {
418
- return result.done ? result.value : iter.next();
419
- });
420
- };
421
-
422
121
  function makeInvokeMethod(innerFn, self, context) {
423
- var state = GenStateSuspendedStart;
424
-
425
- return function invoke(method, arg) {
426
- if (state === GenStateExecuting) {
427
- throw new Error("Generator is already running");
428
- }
429
-
430
- if (state === GenStateCompleted) {
431
- if (method === "throw") {
432
- throw arg;
433
- }
434
-
435
- // Be forgiving, per 25.3.3.3.3 of the spec:
436
- // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
122
+ var state = "suspendedStart";
123
+ return function (method, arg) {
124
+ if ("executing" === state) throw new Error("Generator is already running");
125
+ if ("completed" === state) {
126
+ if ("throw" === method) throw arg;
437
127
  return doneResult();
438
128
  }
439
-
440
- context.method = method;
441
- context.arg = arg;
442
-
443
- while (true) {
129
+ for (context.method = method, context.arg = arg;;) {
444
130
  var delegate = context.delegate;
445
131
  if (delegate) {
446
132
  var delegateResult = maybeInvokeDelegate(delegate, context);
@@ -449,500 +135,328 @@ var runtime = (function (exports) {
449
135
  return delegateResult;
450
136
  }
451
137
  }
452
-
453
- if (context.method === "next") {
454
- // Setting context._sent for legacy support of Babel's
455
- // function.sent implementation.
456
- context.sent = context._sent = context.arg;
457
-
458
- } else if (context.method === "throw") {
459
- if (state === GenStateSuspendedStart) {
460
- state = GenStateCompleted;
461
- throw context.arg;
462
- }
463
-
138
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
139
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
464
140
  context.dispatchException(context.arg);
465
-
466
- } else if (context.method === "return") {
467
- context.abrupt("return", context.arg);
468
- }
469
-
470
- state = GenStateExecuting;
471
-
141
+ } else "return" === context.method && context.abrupt("return", context.arg);
142
+ state = "executing";
472
143
  var record = tryCatch(innerFn, self, context);
473
- if (record.type === "normal") {
474
- // If an exception is thrown from innerFn, we leave state ===
475
- // GenStateExecuting and loop back for another invocation.
476
- state = context.done
477
- ? GenStateCompleted
478
- : GenStateSuspendedYield;
479
-
480
- if (record.arg === ContinueSentinel) {
481
- continue;
482
- }
483
-
144
+ if ("normal" === record.type) {
145
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
484
146
  return {
485
147
  value: record.arg,
486
148
  done: context.done
487
149
  };
488
-
489
- } else if (record.type === "throw") {
490
- state = GenStateCompleted;
491
- // Dispatch the exception by looping back around to the
492
- // context.dispatchException(context.arg) call above.
493
- context.method = "throw";
494
- context.arg = record.arg;
495
150
  }
151
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
496
152
  }
497
153
  };
498
154
  }
499
-
500
- // Call delegate.iterator[context.method](context.arg) and handle the
501
- // result, either by returning a { value, done } result from the
502
- // delegate iterator, or by modifying context.method and context.arg,
503
- // setting context.delegate to null, and returning the ContinueSentinel.
504
155
  function maybeInvokeDelegate(delegate, context) {
505
156
  var method = delegate.iterator[context.method];
506
- if (method === undefined$1) {
507
- // A .throw or .return when the delegate iterator has no .throw
508
- // method always terminates the yield* loop.
509
- context.delegate = null;
510
-
511
- if (context.method === "throw") {
512
- // Note: ["return"] must be used for ES3 parsing compatibility.
513
- if (delegate.iterator["return"]) {
514
- // If the delegate iterator has a return method, give it a
515
- // chance to clean up.
516
- context.method = "return";
517
- context.arg = undefined$1;
518
- maybeInvokeDelegate(delegate, context);
519
-
520
- if (context.method === "throw") {
521
- // If maybeInvokeDelegate(context) changed context.method from
522
- // "return" to "throw", let that override the TypeError below.
523
- return ContinueSentinel;
524
- }
525
- }
526
-
527
- context.method = "throw";
528
- context.arg = new TypeError(
529
- "The iterator does not provide a 'throw' method");
157
+ if (undefined === method) {
158
+ if (context.delegate = null, "throw" === context.method) {
159
+ if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
160
+ context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
530
161
  }
531
-
532
162
  return ContinueSentinel;
533
163
  }
534
-
535
164
  var record = tryCatch(method, delegate.iterator, context.arg);
536
-
537
- if (record.type === "throw") {
538
- context.method = "throw";
539
- context.arg = record.arg;
540
- context.delegate = null;
541
- return ContinueSentinel;
542
- }
543
-
165
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
544
166
  var info = record.arg;
545
-
546
- if (! info) {
547
- context.method = "throw";
548
- context.arg = new TypeError("iterator result is not an object");
549
- context.delegate = null;
550
- return ContinueSentinel;
551
- }
552
-
553
- if (info.done) {
554
- // Assign the result of the finished delegate to the temporary
555
- // variable specified by delegate.resultName (see delegateYield).
556
- context[delegate.resultName] = info.value;
557
-
558
- // Resume execution at the desired location (see delegateYield).
559
- context.next = delegate.nextLoc;
560
-
561
- // If context.method was "throw" but the delegate handled the
562
- // exception, let the outer generator proceed normally. If
563
- // context.method was "next", forget context.arg since it has been
564
- // "consumed" by the delegate iterator. If context.method was
565
- // "return", allow the original .return call to continue in the
566
- // outer generator.
567
- if (context.method !== "return") {
568
- context.method = "next";
569
- context.arg = undefined$1;
570
- }
571
-
572
- } else {
573
- // Re-yield the result returned by the delegate method.
574
- return info;
575
- }
576
-
577
- // The delegate iterator is finished, so forget it and continue with
578
- // the outer generator.
579
- context.delegate = null;
580
- return ContinueSentinel;
167
+ return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
581
168
  }
582
-
583
- // Define Generator.prototype.{next,throw,return} in terms of the
584
- // unified ._invoke helper method.
585
- defineIteratorMethods(Gp);
586
-
587
- define(Gp, toStringTagSymbol, "Generator");
588
-
589
- // A Generator should always return itself as the iterator object when the
590
- // @@iterator function is called on it. Some browsers' implementations of the
591
- // iterator prototype chain incorrectly implement this, causing the Generator
592
- // object to not be returned from this call. This ensures that doesn't happen.
593
- // See https://github.com/facebook/regenerator/issues/274 for more details.
594
- define(Gp, iteratorSymbol, function() {
595
- return this;
596
- });
597
-
598
- define(Gp, "toString", function() {
599
- return "[object Generator]";
600
- });
601
-
602
169
  function pushTryEntry(locs) {
603
- var entry = { tryLoc: locs[0] };
604
-
605
- if (1 in locs) {
606
- entry.catchLoc = locs[1];
607
- }
608
-
609
- if (2 in locs) {
610
- entry.finallyLoc = locs[2];
611
- entry.afterLoc = locs[3];
612
- }
613
-
614
- this.tryEntries.push(entry);
170
+ var entry = {
171
+ tryLoc: locs[0]
172
+ };
173
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
615
174
  }
616
-
617
175
  function resetTryEntry(entry) {
618
176
  var record = entry.completion || {};
619
- record.type = "normal";
620
- delete record.arg;
621
- entry.completion = record;
177
+ record.type = "normal", delete record.arg, entry.completion = record;
622
178
  }
623
-
624
179
  function Context(tryLocsList) {
625
- // The root entry object (effectively a try statement without a catch
626
- // or a finally block) gives us a place to store values thrown from
627
- // locations where there is no enclosing try statement.
628
- this.tryEntries = [{ tryLoc: "root" }];
629
- tryLocsList.forEach(pushTryEntry, this);
630
- this.reset(true);
180
+ this.tryEntries = [{
181
+ tryLoc: "root"
182
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
631
183
  }
632
-
633
- exports.keys = function(object) {
634
- var keys = [];
635
- for (var key in object) {
636
- keys.push(key);
637
- }
638
- keys.reverse();
639
-
640
- // Rather than returning an object with a next method, we keep
641
- // things simple and return the next function itself.
642
- return function next() {
643
- while (keys.length) {
644
- var key = keys.pop();
645
- if (key in object) {
646
- next.value = key;
647
- next.done = false;
648
- return next;
649
- }
650
- }
651
-
652
- // To avoid creating an additional object, we just hang the .value
653
- // and .done properties off the next function object itself. This
654
- // also ensures that the minifier will not anonymize the function.
655
- next.done = true;
656
- return next;
657
- };
658
- };
659
-
660
184
  function values(iterable) {
661
185
  if (iterable) {
662
186
  var iteratorMethod = iterable[iteratorSymbol];
663
- if (iteratorMethod) {
664
- return iteratorMethod.call(iterable);
665
- }
666
-
667
- if (typeof iterable.next === "function") {
668
- return iterable;
669
- }
670
-
187
+ if (iteratorMethod) return iteratorMethod.call(iterable);
188
+ if ("function" == typeof iterable.next) return iterable;
671
189
  if (!isNaN(iterable.length)) {
672
- var i = -1, next = function next() {
673
- while (++i < iterable.length) {
674
- if (hasOwn.call(iterable, i)) {
675
- next.value = iterable[i];
676
- next.done = false;
677
- return next;
678
- }
679
- }
680
-
681
- next.value = undefined$1;
682
- next.done = true;
683
-
684
- return next;
685
- };
686
-
190
+ var i = -1,
191
+ next = function next() {
192
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
193
+ return next.value = undefined, next.done = !0, next;
194
+ };
687
195
  return next.next = next;
688
196
  }
689
197
  }
690
-
691
- // Return an iterator with no values.
692
- return { next: doneResult };
198
+ return {
199
+ next: doneResult
200
+ };
693
201
  }
694
- exports.values = values;
695
-
696
202
  function doneResult() {
697
- return { value: undefined$1, done: true };
203
+ return {
204
+ value: undefined,
205
+ done: !0
206
+ };
698
207
  }
699
-
700
- Context.prototype = {
701
- constructor: Context,
702
-
703
- reset: function(skipTempReset) {
704
- this.prev = 0;
705
- this.next = 0;
706
- // Resetting context._sent for legacy support of Babel's
707
- // function.sent implementation.
708
- this.sent = this._sent = undefined$1;
709
- this.done = false;
710
- this.delegate = null;
711
-
712
- this.method = "next";
713
- this.arg = undefined$1;
714
-
715
- this.tryEntries.forEach(resetTryEntry);
716
-
717
- if (!skipTempReset) {
718
- for (var name in this) {
719
- // Not sure about the optimal order of these conditions:
720
- if (name.charAt(0) === "t" &&
721
- hasOwn.call(this, name) &&
722
- !isNaN(+name.slice(1))) {
723
- this[name] = undefined$1;
724
- }
725
- }
208
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
209
+ value: GeneratorFunctionPrototype,
210
+ configurable: !0
211
+ }), defineProperty(GeneratorFunctionPrototype, "constructor", {
212
+ value: GeneratorFunction,
213
+ configurable: !0
214
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
215
+ var ctor = "function" == typeof genFun && genFun.constructor;
216
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
217
+ }, exports.mark = function (genFun) {
218
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
219
+ }, exports.awrap = function (arg) {
220
+ return {
221
+ __await: arg
222
+ };
223
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
224
+ return this;
225
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
226
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
227
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
228
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
229
+ return result.done ? result.value : iter.next();
230
+ });
231
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
232
+ return this;
233
+ }), define(Gp, "toString", function () {
234
+ return "[object Generator]";
235
+ }), exports.keys = function (val) {
236
+ var object = Object(val),
237
+ keys = [];
238
+ for (var key in object) keys.push(key);
239
+ return keys.reverse(), function next() {
240
+ for (; keys.length;) {
241
+ var key = keys.pop();
242
+ if (key in object) return next.value = key, next.done = !1, next;
726
243
  }
244
+ return next.done = !0, next;
245
+ };
246
+ }, exports.values = values, Context.prototype = {
247
+ constructor: Context,
248
+ reset: function (skipTempReset) {
249
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
727
250
  },
728
-
729
- stop: function() {
730
- this.done = true;
731
-
732
- var rootEntry = this.tryEntries[0];
733
- var rootRecord = rootEntry.completion;
734
- if (rootRecord.type === "throw") {
735
- throw rootRecord.arg;
736
- }
737
-
251
+ stop: function () {
252
+ this.done = !0;
253
+ var rootRecord = this.tryEntries[0].completion;
254
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
738
255
  return this.rval;
739
256
  },
740
-
741
- dispatchException: function(exception) {
742
- if (this.done) {
743
- throw exception;
744
- }
745
-
257
+ dispatchException: function (exception) {
258
+ if (this.done) throw exception;
746
259
  var context = this;
747
260
  function handle(loc, caught) {
748
- record.type = "throw";
749
- record.arg = exception;
750
- context.next = loc;
751
-
752
- if (caught) {
753
- // If the dispatched exception was caught by a catch block,
754
- // then let that catch block handle the exception normally.
755
- context.method = "next";
756
- context.arg = undefined$1;
757
- }
758
-
759
- return !! caught;
261
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
760
262
  }
761
-
762
263
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
763
- var entry = this.tryEntries[i];
764
- var record = entry.completion;
765
-
766
- if (entry.tryLoc === "root") {
767
- // Exception thrown outside of any try block that could handle
768
- // it, so set the completion value of the entire function to
769
- // throw the exception.
770
- return handle("end");
771
- }
772
-
264
+ var entry = this.tryEntries[i],
265
+ record = entry.completion;
266
+ if ("root" === entry.tryLoc) return handle("end");
773
267
  if (entry.tryLoc <= this.prev) {
774
- var hasCatch = hasOwn.call(entry, "catchLoc");
775
- var hasFinally = hasOwn.call(entry, "finallyLoc");
776
-
268
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
269
+ hasFinally = hasOwn.call(entry, "finallyLoc");
777
270
  if (hasCatch && hasFinally) {
778
- if (this.prev < entry.catchLoc) {
779
- return handle(entry.catchLoc, true);
780
- } else if (this.prev < entry.finallyLoc) {
781
- return handle(entry.finallyLoc);
782
- }
783
-
271
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
272
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
784
273
  } else if (hasCatch) {
785
- if (this.prev < entry.catchLoc) {
786
- return handle(entry.catchLoc, true);
787
- }
788
-
789
- } else if (hasFinally) {
790
- if (this.prev < entry.finallyLoc) {
791
- return handle(entry.finallyLoc);
792
- }
793
-
274
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
794
275
  } else {
795
- throw new Error("try statement without catch or finally");
276
+ if (!hasFinally) throw new Error("try statement without catch or finally");
277
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
796
278
  }
797
279
  }
798
280
  }
799
281
  },
800
-
801
- abrupt: function(type, arg) {
282
+ abrupt: function (type, arg) {
802
283
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
803
284
  var entry = this.tryEntries[i];
804
- if (entry.tryLoc <= this.prev &&
805
- hasOwn.call(entry, "finallyLoc") &&
806
- this.prev < entry.finallyLoc) {
285
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
807
286
  var finallyEntry = entry;
808
287
  break;
809
288
  }
810
289
  }
811
-
812
- if (finallyEntry &&
813
- (type === "break" ||
814
- type === "continue") &&
815
- finallyEntry.tryLoc <= arg &&
816
- arg <= finallyEntry.finallyLoc) {
817
- // Ignore the finally entry if control is not jumping to a
818
- // location outside the try/catch block.
819
- finallyEntry = null;
820
- }
821
-
290
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
822
291
  var record = finallyEntry ? finallyEntry.completion : {};
823
- record.type = type;
824
- record.arg = arg;
825
-
826
- if (finallyEntry) {
827
- this.method = "next";
828
- this.next = finallyEntry.finallyLoc;
829
- return ContinueSentinel;
830
- }
831
-
832
- return this.complete(record);
292
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
833
293
  },
834
-
835
- complete: function(record, afterLoc) {
836
- if (record.type === "throw") {
837
- throw record.arg;
838
- }
839
-
840
- if (record.type === "break" ||
841
- record.type === "continue") {
842
- this.next = record.arg;
843
- } else if (record.type === "return") {
844
- this.rval = this.arg = record.arg;
845
- this.method = "return";
846
- this.next = "end";
847
- } else if (record.type === "normal" && afterLoc) {
848
- this.next = afterLoc;
849
- }
850
-
851
- return ContinueSentinel;
294
+ complete: function (record, afterLoc) {
295
+ if ("throw" === record.type) throw record.arg;
296
+ return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
852
297
  },
853
-
854
- finish: function(finallyLoc) {
298
+ finish: function (finallyLoc) {
855
299
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
856
300
  var entry = this.tryEntries[i];
857
- if (entry.finallyLoc === finallyLoc) {
858
- this.complete(entry.completion, entry.afterLoc);
859
- resetTryEntry(entry);
860
- return ContinueSentinel;
861
- }
301
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
862
302
  }
863
303
  },
864
-
865
- "catch": function(tryLoc) {
304
+ catch: function (tryLoc) {
866
305
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
867
306
  var entry = this.tryEntries[i];
868
307
  if (entry.tryLoc === tryLoc) {
869
308
  var record = entry.completion;
870
- if (record.type === "throw") {
309
+ if ("throw" === record.type) {
871
310
  var thrown = record.arg;
872
311
  resetTryEntry(entry);
873
312
  }
874
313
  return thrown;
875
314
  }
876
315
  }
877
-
878
- // The context.catch method must only be called with a location
879
- // argument that corresponds to a known catch block.
880
316
  throw new Error("illegal catch attempt");
881
317
  },
882
-
883
- delegateYield: function(iterable, resultName, nextLoc) {
884
- this.delegate = {
318
+ delegateYield: function (iterable, resultName, nextLoc) {
319
+ return this.delegate = {
885
320
  iterator: values(iterable),
886
321
  resultName: resultName,
887
322
  nextLoc: nextLoc
888
- };
889
-
890
- if (this.method === "next") {
891
- // Deliberately forget the last sent value so that we don't
892
- // accidentally pass it on to the delegate.
893
- this.arg = undefined$1;
323
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
324
+ }
325
+ }, exports;
326
+ }
327
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
328
+ try {
329
+ var info = gen[key](arg);
330
+ var value = info.value;
331
+ } catch (error) {
332
+ reject(error);
333
+ return;
334
+ }
335
+ if (info.done) {
336
+ resolve(value);
337
+ } else {
338
+ Promise.resolve(value).then(_next, _throw);
339
+ }
340
+ }
341
+ function _asyncToGenerator(fn) {
342
+ return function () {
343
+ var self = this,
344
+ args = arguments;
345
+ return new Promise(function (resolve, reject) {
346
+ var gen = fn.apply(self, args);
347
+ function _next(value) {
348
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
349
+ }
350
+ function _throw(err) {
351
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
352
+ }
353
+ _next(undefined);
354
+ });
355
+ };
356
+ }
357
+ function _extends() {
358
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
359
+ for (var i = 1; i < arguments.length; i++) {
360
+ var source = arguments[i];
361
+ for (var key in source) {
362
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
363
+ target[key] = source[key];
364
+ }
894
365
  }
895
-
896
- return ContinueSentinel;
897
366
  }
367
+ return target;
368
+ };
369
+ return _extends.apply(this, arguments);
370
+ }
371
+ function _inheritsLoose(subClass, superClass) {
372
+ subClass.prototype = Object.create(superClass.prototype);
373
+ subClass.prototype.constructor = subClass;
374
+ _setPrototypeOf(subClass, superClass);
375
+ }
376
+ function _getPrototypeOf(o) {
377
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
378
+ return o.__proto__ || Object.getPrototypeOf(o);
898
379
  };
899
-
900
- // Regardless of whether this script is executing as a CommonJS module
901
- // or not, return the runtime object so that we can declare the variable
902
- // regeneratorRuntime in the outer scope, which allows this module to be
903
- // injected easily by `bin/regenerator --include-runtime script.js`.
904
- return exports;
905
-
906
- }(
907
- // If this script is executing as a CommonJS module, use module.exports
908
- // as the regeneratorRuntime namespace. Otherwise create a new empty
909
- // object. Either way, the resulting object will be used to initialize
910
- // the regeneratorRuntime variable at the top of this file.
911
- module.exports
912
- ));
913
-
914
- try {
915
- regeneratorRuntime = runtime;
916
- } catch (accidentalStrictMode) {
917
- // This module should not be running in strict mode, so the above
918
- // assignment should always work unless something is misconfigured. Just
919
- // in case runtime.js accidentally runs in strict mode, in modern engines
920
- // we can explicitly access globalThis. In older engines we can escape
921
- // strict mode using a global Function call. This could conceivably fail
922
- // if a Content Security Policy forbids using Function, but in that case
923
- // the proper solution is to fix the accidental strict mode problem. If
924
- // you've misconfigured your bundler to force strict mode and applied a
925
- // CSP to forbid Function, and you're not willing to fix either of those
926
- // problems, please detail your unique predicament in a GitHub issue.
927
- if (typeof globalThis === "object") {
928
- globalThis.regeneratorRuntime = runtime;
380
+ return _getPrototypeOf(o);
381
+ }
382
+ function _setPrototypeOf(o, p) {
383
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
384
+ o.__proto__ = p;
385
+ return o;
386
+ };
387
+ return _setPrototypeOf(o, p);
388
+ }
389
+ function _isNativeReflectConstruct() {
390
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
391
+ if (Reflect.construct.sham) return false;
392
+ if (typeof Proxy === "function") return true;
393
+ try {
394
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
395
+ return true;
396
+ } catch (e) {
397
+ return false;
398
+ }
399
+ }
400
+ function _construct(Parent, args, Class) {
401
+ if (_isNativeReflectConstruct()) {
402
+ _construct = Reflect.construct.bind();
929
403
  } else {
930
- Function("r", "regeneratorRuntime = r")(runtime);
404
+ _construct = function _construct(Parent, args, Class) {
405
+ var a = [null];
406
+ a.push.apply(a, args);
407
+ var Constructor = Function.bind.apply(Parent, a);
408
+ var instance = new Constructor();
409
+ if (Class) _setPrototypeOf(instance, Class.prototype);
410
+ return instance;
411
+ };
412
+ }
413
+ return _construct.apply(null, arguments);
414
+ }
415
+ function _isNativeFunction(fn) {
416
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
417
+ }
418
+ function _wrapNativeSuper(Class) {
419
+ var _cache = typeof Map === "function" ? new Map() : undefined;
420
+ _wrapNativeSuper = function _wrapNativeSuper(Class) {
421
+ if (Class === null || !_isNativeFunction(Class)) return Class;
422
+ if (typeof Class !== "function") {
423
+ throw new TypeError("Super expression must either be null or a function");
424
+ }
425
+ if (typeof _cache !== "undefined") {
426
+ if (_cache.has(Class)) return _cache.get(Class);
427
+ _cache.set(Class, Wrapper);
428
+ }
429
+ function Wrapper() {
430
+ return _construct(Class, arguments, _getPrototypeOf(this).constructor);
431
+ }
432
+ Wrapper.prototype = Object.create(Class.prototype, {
433
+ constructor: {
434
+ value: Wrapper,
435
+ enumerable: false,
436
+ writable: true,
437
+ configurable: true
438
+ }
439
+ });
440
+ return _setPrototypeOf(Wrapper, Class);
441
+ };
442
+ return _wrapNativeSuper(Class);
443
+ }
444
+ function _assertThisInitialized(self) {
445
+ if (self === void 0) {
446
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
931
447
  }
448
+ return self;
932
449
  }
933
- });
934
450
 
935
451
  var AxiosService = /*#__PURE__*/function () {
936
452
  function AxiosService(config) {
937
453
  if (!config) config = {};
938
454
  this.axios = axios.create(config);
939
455
  }
940
-
941
456
  var _proto = AxiosService.prototype;
942
-
943
457
  _proto.apiRequest = /*#__PURE__*/function () {
944
- var _apiRequest = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(config, url, data) {
945
- return runtime_1.wrap(function _callee$(_context) {
458
+ var _apiRequest = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(config, url, data) {
459
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
946
460
  while (1) {
947
461
  switch (_context.prev = _context.next) {
948
462
  case 0:
@@ -954,7 +468,6 @@ var AxiosService = /*#__PURE__*/function () {
954
468
  })).then(function (res) {
955
469
  return res.data;
956
470
  }));
957
-
958
471
  case 3:
959
472
  case "end":
960
473
  return _context.stop();
@@ -962,17 +475,14 @@ var AxiosService = /*#__PURE__*/function () {
962
475
  }
963
476
  }, _callee, this);
964
477
  }));
965
-
966
478
  function apiRequest(_x, _x2, _x3) {
967
479
  return _apiRequest.apply(this, arguments);
968
480
  }
969
-
970
481
  return apiRequest;
971
482
  }();
972
-
973
483
  _proto.apiRequestHeader = /*#__PURE__*/function () {
974
- var _apiRequestHeader = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(config, url, headerToRetrieve, data) {
975
- return runtime_1.wrap(function _callee2$(_context2) {
484
+ var _apiRequestHeader = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(config, url, headerToRetrieve, data) {
485
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
976
486
  while (1) {
977
487
  switch (_context2.prev = _context2.next) {
978
488
  case 0:
@@ -984,13 +494,10 @@ var AxiosService = /*#__PURE__*/function () {
984
494
  })).then(function (res) {
985
495
  if (headerToRetrieve) {
986
496
  var _res$headers$headerTo;
987
-
988
497
  return (_res$headers$headerTo = res.headers[headerToRetrieve]) != null ? _res$headers$headerTo : res.headers[headerToRetrieve.toLowerCase()];
989
498
  }
990
-
991
499
  return res.headers;
992
500
  }));
993
-
994
501
  case 3:
995
502
  case "end":
996
503
  return _context2.stop();
@@ -998,56 +505,46 @@ var AxiosService = /*#__PURE__*/function () {
998
505
  }
999
506
  }, _callee2, this);
1000
507
  }));
1001
-
1002
508
  function apiRequestHeader(_x4, _x5, _x6, _x7) {
1003
509
  return _apiRequestHeader.apply(this, arguments);
1004
510
  }
1005
-
1006
511
  return apiRequestHeader;
1007
512
  }();
1008
-
1009
513
  _proto.get = function get(url, config) {
1010
514
  return this.apiRequest(_extends({}, config, {
1011
515
  method: 'get'
1012
516
  }), url);
1013
517
  };
1014
-
1015
518
  _proto.deleteRequest = function deleteRequest(url, config) {
1016
519
  return this.apiRequest(_extends({}, config, {
1017
520
  method: 'delete'
1018
521
  }), url);
1019
522
  };
1020
-
1021
523
  _proto.post = function post(url, data, config) {
1022
524
  return this.apiRequest(_extends({}, config, {
1023
525
  method: 'post'
1024
526
  }), url, data);
1025
527
  };
1026
-
1027
528
  _proto.put = function put(url, data, config) {
1028
529
  return this.apiRequest(_extends({}, config, {
1029
530
  method: 'put'
1030
531
  }), url, data);
1031
532
  };
1032
-
1033
533
  _proto.patch = function patch(url, data, config) {
1034
534
  return this.apiRequest(_extends({}, config, {
1035
535
  method: 'patch'
1036
536
  }), url, data);
1037
537
  };
1038
-
1039
538
  _proto.head = function head(url, config, headerToRetrieve, data) {
1040
539
  return this.apiRequestHeader(_extends({}, config, {
1041
540
  method: 'head'
1042
541
  }), url, headerToRetrieve, data);
1043
542
  };
1044
-
1045
543
  return AxiosService;
1046
544
  }();
1047
545
 
1048
546
  var APIService = /*#__PURE__*/function (_AxiosService) {
1049
547
  _inheritsLoose(APIService, _AxiosService);
1050
-
1051
548
  /**
1052
549
  * The API Service lets you use an axios API and handles oro backend services authentification via JWT tokens
1053
550
  * @param useLocalStorage if set to true, tokens will be stored in localStorage
@@ -1056,14 +553,11 @@ var APIService = /*#__PURE__*/function (_AxiosService) {
1056
553
  */
1057
554
  function APIService(useLocalStorage, config, tokenRefreshFailureCallback) {
1058
555
  var _this;
1059
-
1060
556
  _this = _AxiosService.call(this, config) || this;
1061
557
  _this.useLocalStorage = useLocalStorage;
1062
558
  _this.tokenRefreshFailureCallback = tokenRefreshFailureCallback;
1063
559
  _this.tokens = {};
1064
-
1065
560
  var self = _assertThisInitialized(_this);
1066
-
1067
561
  _this.axios.interceptors.request.use(function (config) {
1068
562
  var token = config.useRefreshToken ? self.getTokens().refreshToken : self.getTokens().accessToken;
1069
563
  config.headers = _extends({}, config.headers, {
@@ -1073,11 +567,10 @@ var APIService = /*#__PURE__*/function (_AxiosService) {
1073
567
  }, function (error) {
1074
568
  Promise.reject(error);
1075
569
  });
1076
-
1077
570
  createAuthRefreshInterceptor(_this.axios, /*#__PURE__*/function () {
1078
- var _ref = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(failedRequest) {
571
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(failedRequest) {
1079
572
  var tokenResp;
1080
- return runtime_1.wrap(function _callee$(_context) {
573
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1081
574
  while (1) {
1082
575
  switch (_context.prev = _context.next) {
1083
576
  case 0:
@@ -1085,11 +578,9 @@ var APIService = /*#__PURE__*/function (_AxiosService) {
1085
578
  _context.next = 15;
1086
579
  break;
1087
580
  }
1088
-
1089
581
  _context.prev = 1;
1090
582
  _context.next = 4;
1091
583
  return self.authRefreshFn(self.getTokens().refreshToken);
1092
-
1093
584
  case 4:
1094
585
  tokenResp = _context.sent;
1095
586
  self.setTokens({
@@ -1098,18 +589,15 @@ var APIService = /*#__PURE__*/function (_AxiosService) {
1098
589
  });
1099
590
  failedRequest.response.config.headers['Authorization'] = "Bearer " + self.getTokens().accessToken;
1100
591
  return _context.abrupt("return", Promise.resolve());
1101
-
1102
592
  case 10:
1103
593
  _context.prev = 10;
1104
594
  _context.t0 = _context["catch"](1);
1105
595
  console.error('an error occured while refreshing tokens (notifying callback)', _context.t0);
1106
596
  if (self.tokenRefreshFailureCallback) self.tokenRefreshFailureCallback(failedRequest);
1107
597
  return _context.abrupt("return", Promise.resolve());
1108
-
1109
598
  case 15:
1110
599
  console.error('The request could not refresh the token (authRefreshFn was not set)', failedRequest);
1111
600
  return _context.abrupt("return", Promise.resolve());
1112
-
1113
601
  case 17:
1114
602
  case "end":
1115
603
  return _context.stop();
@@ -1117,7 +605,6 @@ var APIService = /*#__PURE__*/function (_AxiosService) {
1117
605
  }
1118
606
  }, _callee, null, [[1, 10]]);
1119
607
  }));
1120
-
1121
608
  return function (_x) {
1122
609
  return _ref.apply(this, arguments);
1123
610
  };
@@ -1126,43 +613,34 @@ var APIService = /*#__PURE__*/function (_AxiosService) {
1126
613
  });
1127
614
  return _this;
1128
615
  }
1129
-
1130
616
  var _proto = APIService.prototype;
1131
-
1132
617
  _proto.setAuthRefreshFn = function setAuthRefreshFn(fn) {
1133
618
  this.authRefreshFn = fn;
1134
619
  };
1135
-
1136
620
  _proto.setTokens = function setTokens(tokens) {
1137
621
  if (this.useLocalStorage) {
1138
622
  localStorage.setItem('tokens', JSON.stringify(tokens));
1139
623
  }
1140
-
1141
624
  this.tokens = tokens;
1142
625
  };
1143
-
1144
626
  _proto.getTokens = function getTokens() {
1145
627
  if (this.useLocalStorage) {
1146
628
  var tokens = {};
1147
629
  var item = localStorage.getItem('tokens');
1148
-
1149
630
  if (item) {
1150
631
  tokens = JSON.parse(item);
1151
632
  }
1152
-
1153
633
  return tokens;
1154
634
  } else {
1155
635
  return this.tokens;
1156
636
  }
1157
637
  };
1158
-
1159
638
  return APIService;
1160
639
  }(AxiosService);
1161
640
 
1162
641
  /**
1163
642
  * This service enables you to handle one authentication token per practice
1164
643
  */
1165
-
1166
644
  var ApisPracticeManager = /*#__PURE__*/function () {
1167
645
  /**
1168
646
  * The constructor
@@ -1175,7 +653,6 @@ var ApisPracticeManager = /*#__PURE__*/function () {
1175
653
  if (useLocalStorage === void 0) {
1176
654
  useLocalStorage = false;
1177
655
  }
1178
-
1179
656
  this.serviceCollReq = serviceCollReq;
1180
657
  this.getAuthTokenCbk = getAuthTokenCbk;
1181
658
  this.useLocalStorage = useLocalStorage;
@@ -1186,37 +663,29 @@ var ApisPracticeManager = /*#__PURE__*/function () {
1186
663
  * @param practiceUuid the uuid of the practice
1187
664
  * @returns a promise holding a `ServiceCollection`
1188
665
  */
1189
-
1190
-
1191
666
  var _proto = ApisPracticeManager.prototype;
1192
-
1193
667
  _proto.get =
1194
668
  /*#__PURE__*/
1195
669
  function () {
1196
- var _get = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(practiceUuid) {
670
+ var _get = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(practiceUuid) {
1197
671
  var _this = this;
1198
-
1199
672
  var cacheKey, practiceInstance, newPracticeInstance, authTokenFunc;
1200
- return runtime_1.wrap(function _callee2$(_context2) {
673
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1201
674
  while (1) {
1202
675
  switch (_context2.prev = _context2.next) {
1203
676
  case 0:
1204
677
  cacheKey = practiceUuid != null ? practiceUuid : 'none';
1205
678
  practiceInstance = this.practiceInstances.get(cacheKey);
1206
-
1207
679
  if (!practiceInstance) {
1208
680
  _context2.next = 4;
1209
681
  break;
1210
682
  }
1211
-
1212
683
  return _context2.abrupt("return", practiceInstance);
1213
-
1214
684
  case 4:
1215
685
  newPracticeInstance = init(this.serviceCollReq, undefined, this.useLocalStorage); // Create one auth token callback per practice since the practice uuid needs to change
1216
-
1217
686
  authTokenFunc = /*#__PURE__*/function () {
1218
- var _ref = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
1219
- return runtime_1.wrap(function _callee$(_context) {
687
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
688
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1220
689
  while (1) {
1221
690
  switch (_context.prev = _context.next) {
1222
691
  case 0:
@@ -1224,17 +693,13 @@ var ApisPracticeManager = /*#__PURE__*/function () {
1224
693
  _context.next = 7;
1225
694
  break;
1226
695
  }
1227
-
1228
696
  console.log("\x1B[36m[Auth] Refresh auth called (practiceUuid: " + practiceUuid + ")\x1B[36m");
1229
697
  _context.next = 4;
1230
698
  return _this.getAuthTokenCbk(newPracticeInstance.guardService, practiceUuid);
1231
-
1232
699
  case 4:
1233
700
  return _context.abrupt("return", _context.sent);
1234
-
1235
701
  case 7:
1236
702
  throw Error('[Auth] Unable to refresh token guard service is undefined');
1237
-
1238
703
  case 8:
1239
704
  case "end":
1240
705
  return _context.stop();
@@ -1242,22 +707,17 @@ var ApisPracticeManager = /*#__PURE__*/function () {
1242
707
  }
1243
708
  }, _callee);
1244
709
  }));
1245
-
1246
710
  return function authTokenFunc() {
1247
711
  return _ref.apply(this, arguments);
1248
712
  };
1249
713
  }(); // Initialize the M2M token
1250
-
1251
-
1252
714
  _context2.next = 8;
1253
715
  return authTokenFunc();
1254
-
1255
716
  case 8:
1256
717
  // Set the refresh tokens callback
1257
718
  newPracticeInstance.apiService.setAuthRefreshFn(authTokenFunc);
1258
719
  this.practiceInstances.set(cacheKey, newPracticeInstance);
1259
720
  return _context2.abrupt("return", newPracticeInstance);
1260
-
1261
721
  case 11:
1262
722
  case "end":
1263
723
  return _context2.stop();
@@ -1265,14 +725,11 @@ var ApisPracticeManager = /*#__PURE__*/function () {
1265
725
  }
1266
726
  }, _callee2, this);
1267
727
  }));
1268
-
1269
728
  function get(_x) {
1270
729
  return _get.apply(this, arguments);
1271
730
  }
1272
-
1273
731
  return get;
1274
732
  }();
1275
-
1276
733
  return ApisPracticeManager;
1277
734
  }();
1278
735
 
@@ -1283,7 +740,6 @@ var ApisPracticeManager = /*#__PURE__*/function () {
1283
740
  AssistantType["Administrative"] = "Administrative";
1284
741
  AssistantType["Other"] = "Other";
1285
742
  })(exports.AssistantType || (exports.AssistantType = {}));
1286
-
1287
743
  (function (TransmissionKind) {
1288
744
  TransmissionKind["Fax"] = "Fax";
1289
745
  TransmissionKind["Email"] = "Email";
@@ -1293,7 +749,6 @@ var ApisPracticeManager = /*#__PURE__*/function () {
1293
749
  TransmissionKind["API"] = "API";
1294
750
  TransmissionKind["Other"] = "Other";
1295
751
  })(exports.TransmissionKind || (exports.TransmissionKind = {}));
1296
-
1297
752
  (function (TransmissionStatus) {
1298
753
  TransmissionStatus["Preparing"] = "Preparing";
1299
754
  TransmissionStatus["Sending"] = "Sending";
@@ -1306,12 +761,10 @@ var ApisPracticeManager = /*#__PURE__*/function () {
1306
761
  TransmissionStatus["ReceiverNotAnswering"] = "ReceiverNotAnswering";
1307
762
  TransmissionStatus["ReceiverIncompatible"] = "ReceiverIncompatible";
1308
763
  })(exports.TransmissionStatus || (exports.TransmissionStatus = {}));
1309
-
1310
764
  (function (ConsultType) {
1311
765
  ConsultType["Onboard"] = "Onboard";
1312
766
  ConsultType["Refill"] = "Refill";
1313
767
  })(exports.ConsultType || (exports.ConsultType = {}));
1314
-
1315
768
  (function (FeeStatus) {
1316
769
  FeeStatus["NoFee"] = "NoFee";
1317
770
  FeeStatus["Pending"] = "Pending";
@@ -1320,7 +773,6 @@ var ApisPracticeManager = /*#__PURE__*/function () {
1320
773
  FeeStatus["Cancelled"] = "Cancelled";
1321
774
  FeeStatus["Contested"] = "Contested";
1322
775
  })(exports.FeeStatus || (exports.FeeStatus = {}));
1323
-
1324
776
  (function (MedicalStatus) {
1325
777
  MedicalStatus["Creating"] = "Creating";
1326
778
  MedicalStatus["New"] = "New";
@@ -1331,7 +783,6 @@ var ApisPracticeManager = /*#__PURE__*/function () {
1331
783
  MedicalStatus["Archived"] = "Archived";
1332
784
  MedicalStatus["Failed"] = "Failed";
1333
785
  })(exports.MedicalStatus || (exports.MedicalStatus = {}));
1334
-
1335
786
  (function (TaskStatus) {
1336
787
  TaskStatus["None"] = "None";
1337
788
  TaskStatus["ToDo"] = "ToDo";
@@ -1339,7 +790,6 @@ var ApisPracticeManager = /*#__PURE__*/function () {
1339
790
  TaskStatus["Blocked"] = "Blocked";
1340
791
  TaskStatus["Done"] = "Done";
1341
792
  })(exports.TaskStatus || (exports.TaskStatus = {}));
1342
-
1343
793
  (function (ClosedReasonType) {
1344
794
  /**
1345
795
  * A completed consultation
@@ -1348,22 +798,18 @@ var ApisPracticeManager = /*#__PURE__*/function () {
1348
798
  /**
1349
799
  * The conclusion was that what the patient submitted was not a disease
1350
800
  */
1351
-
1352
801
  ClosedReasonType["NotADisease"] = "NotADisease";
1353
802
  /**
1354
803
  * The consultation was not appropriate for virtual
1355
804
  */
1356
-
1357
805
  ClosedReasonType["NotAppropriateForVirtual"] = "NotAppropriateForVirtual";
1358
806
  /**
1359
807
  * Any other reason why the consultation was closed
1360
808
  */
1361
-
1362
809
  ClosedReasonType["Other"] = "Other";
1363
810
  /**
1364
811
  * A consultation that is required to be done in person
1365
812
  */
1366
-
1367
813
  ClosedReasonType["RequiresInPerson"] = "RequiresInPerson";
1368
814
  })(exports.ClosedReasonType || (exports.ClosedReasonType = {}));
1369
815
 
@@ -1372,17 +818,14 @@ var ApisPracticeManager = /*#__PURE__*/function () {
1372
818
  VisibilityType["Private"] = "Private";
1373
819
  VisibilityType["Instance"] = "Instance";
1374
820
  })(exports.VisibilityType || (exports.VisibilityType = {}));
1375
-
1376
821
  (function (DrugType) {
1377
822
  DrugType["Generic"] = "Generic";
1378
823
  DrugType["Instance"] = "Instance";
1379
824
  })(exports.DrugType || (exports.DrugType = {}));
1380
-
1381
825
  (function (PrescriptionStatus) {
1382
826
  PrescriptionStatus["Existing"] = "Existing";
1383
827
  PrescriptionStatus["Deleted"] = "Deleted";
1384
828
  })(exports.PrescriptionStatus || (exports.PrescriptionStatus = {}));
1385
-
1386
829
  (function (PlanStatus) {
1387
830
  PlanStatus["Pending"] = "Pending";
1388
831
  PlanStatus["Accepted"] = "Accepted";
@@ -1392,74 +835,58 @@ var ApisPracticeManager = /*#__PURE__*/function () {
1392
835
 
1393
836
  var AuthenticationFailed = /*#__PURE__*/function (_Error) {
1394
837
  _inheritsLoose(AuthenticationFailed, _Error);
1395
-
1396
838
  function AuthenticationFailed() {
1397
839
  return _Error.apply(this, arguments) || this;
1398
840
  }
1399
-
1400
841
  return AuthenticationFailed;
1401
842
  }( /*#__PURE__*/_wrapNativeSuper(Error));
1402
843
  var AuthenticationBadRequest = /*#__PURE__*/function (_Error2) {
1403
844
  _inheritsLoose(AuthenticationBadRequest, _Error2);
1404
-
1405
845
  function AuthenticationBadRequest() {
1406
846
  return _Error2.apply(this, arguments) || this;
1407
847
  }
1408
-
1409
848
  return AuthenticationBadRequest;
1410
849
  }( /*#__PURE__*/_wrapNativeSuper(Error));
1411
850
  var AuthenticationServerError = /*#__PURE__*/function (_Error3) {
1412
851
  _inheritsLoose(AuthenticationServerError, _Error3);
1413
-
1414
852
  function AuthenticationServerError() {
1415
853
  return _Error3.apply(this, arguments) || this;
1416
854
  }
1417
-
1418
855
  return AuthenticationServerError;
1419
856
  }( /*#__PURE__*/_wrapNativeSuper(Error));
1420
857
  var AuthenticationUnconfirmedEmail = /*#__PURE__*/function (_Error4) {
1421
858
  _inheritsLoose(AuthenticationUnconfirmedEmail, _Error4);
1422
-
1423
859
  function AuthenticationUnconfirmedEmail() {
1424
860
  return _Error4.apply(this, arguments) || this;
1425
861
  }
1426
-
1427
862
  return AuthenticationUnconfirmedEmail;
1428
863
  }( /*#__PURE__*/_wrapNativeSuper(Error));
1429
864
  var IdentityCreationFailed = /*#__PURE__*/function (_Error5) {
1430
865
  _inheritsLoose(IdentityCreationFailed, _Error5);
1431
-
1432
866
  function IdentityCreationFailed() {
1433
867
  return _Error5.apply(this, arguments) || this;
1434
868
  }
1435
-
1436
869
  return IdentityCreationFailed;
1437
870
  }( /*#__PURE__*/_wrapNativeSuper(Error));
1438
871
  var IdentityCreationBadRequest = /*#__PURE__*/function (_Error6) {
1439
872
  _inheritsLoose(IdentityCreationBadRequest, _Error6);
1440
-
1441
873
  function IdentityCreationBadRequest() {
1442
874
  return _Error6.apply(this, arguments) || this;
1443
875
  }
1444
-
1445
876
  return IdentityCreationBadRequest;
1446
877
  }( /*#__PURE__*/_wrapNativeSuper(Error));
1447
878
  var IdentityCreationConflict = /*#__PURE__*/function (_Error7) {
1448
879
  _inheritsLoose(IdentityCreationConflict, _Error7);
1449
-
1450
880
  function IdentityCreationConflict() {
1451
881
  return _Error7.apply(this, arguments) || this;
1452
882
  }
1453
-
1454
883
  return IdentityCreationConflict;
1455
884
  }( /*#__PURE__*/_wrapNativeSuper(Error));
1456
885
  var VaultDataMissing = /*#__PURE__*/function (_Error8) {
1457
886
  _inheritsLoose(VaultDataMissing, _Error8);
1458
-
1459
887
  function VaultDataMissing() {
1460
888
  return _Error8.apply(this, arguments) || this;
1461
889
  }
1462
-
1463
890
  return VaultDataMissing;
1464
891
  }( /*#__PURE__*/_wrapNativeSuper(Error));
1465
892
 
@@ -1469,7 +896,6 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
1469
896
  WorkflowType["Renew"] = "Renew";
1470
897
  WorkflowType["DataRetrieve"] = "DataRetrieve";
1471
898
  })(exports.WorkflowType || (exports.WorkflowType = {}));
1472
-
1473
899
  (function (RateDimension) {
1474
900
  RateDimension["RatioOnTotal"] = "RatioOnTotal";
1475
901
  RateDimension["FixedOnTotal"] = "FixedOnTotal";
@@ -1480,21 +906,18 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
1480
906
  RateDimension["RatioOnItem"] = "RatioOnItem";
1481
907
  RateDimension["FixedOnItem"] = "FixedOnItem";
1482
908
  })(exports.RateDimension || (exports.RateDimension = {}));
1483
-
1484
909
  (function (PlanType) {
1485
910
  PlanType["Onboard"] = "Onboard";
1486
911
  PlanType["Followup"] = "Followup";
1487
912
  PlanType["Renew"] = "Renew";
1488
913
  PlanType["DataRetrieve"] = "DataRetrieve";
1489
914
  })(exports.PlanType || (exports.PlanType = {}));
1490
-
1491
915
  (function (PaymentStatus) {
1492
916
  PaymentStatus["Pending"] = "Pending";
1493
917
  PaymentStatus["Success"] = "Success";
1494
918
  PaymentStatus["Failure"] = "Failure";
1495
919
  PaymentStatus["Canceled"] = "Canceled";
1496
920
  })(exports.PaymentStatus || (exports.PaymentStatus = {}));
1497
-
1498
921
  (function (PractitionerStatus) {
1499
922
  PractitionerStatus["Practicing"] = "Practicing";
1500
923
  PractitionerStatus["Retired"] = "Retired";
@@ -1504,13 +927,11 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
1504
927
  PractitionerStatus["InConflict"] = "InConflict";
1505
928
  PractitionerStatus["Delicensed"] = "Delicensed";
1506
929
  })(exports.PractitionerStatus || (exports.PractitionerStatus = {}));
1507
-
1508
930
  (function (AssignmentStatus) {
1509
931
  AssignmentStatus["Assigned"] = "Assigned";
1510
932
  AssignmentStatus["Reassigned"] = "Reassigned";
1511
933
  AssignmentStatus["Cancelled"] = "Cancelled";
1512
934
  })(exports.AssignmentStatus || (exports.AssignmentStatus = {}));
1513
-
1514
935
  (function (PractitionnerRoleType) {
1515
936
  PractitionnerRoleType["Doctor"] = "Doctor";
1516
937
  PractitionnerRoleType["MedicalAssistant"] = "MedicalAssistant";
@@ -1522,13 +943,11 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
1522
943
  PractitionnerRoleType["ManualDispatcher"] = "ManualDispatcher";
1523
944
  PractitionnerRoleType["Other"] = "Other";
1524
945
  })(exports.PractitionnerRoleType || (exports.PractitionnerRoleType = {}));
1525
-
1526
946
  (function (OtherRoleType) {
1527
947
  OtherRoleType["Patient"] = "Patient";
1528
948
  OtherRoleType["User"] = "User";
1529
949
  OtherRoleType["System"] = "System";
1530
950
  })(exports.OtherRoleType || (exports.OtherRoleType = {}));
1531
-
1532
951
  (function (LicenseStatus) {
1533
952
  LicenseStatus["Valid"] = "Valid";
1534
953
  LicenseStatus["Invalid"] = "Invalid";
@@ -1536,7 +955,6 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
1536
955
  LicenseStatus["NA"] = "NA";
1537
956
  LicenseStatus["Removed"] = "Removed";
1538
957
  })(exports.LicenseStatus || (exports.LicenseStatus = {}));
1539
-
1540
958
  (function (PeriodType) {
1541
959
  PeriodType["PerYear"] = "PerYear";
1542
960
  PeriodType["PerQuarter"] = "PerQuarter";
@@ -1546,7 +964,6 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
1546
964
  PeriodType["PerDay"] = "PerDay";
1547
965
  PeriodType["PerHour"] = "PerHour";
1548
966
  })(exports.PeriodType || (exports.PeriodType = {}));
1549
-
1550
967
  (function (SyncStatus) {
1551
968
  SyncStatus["Requested"] = "Requested";
1552
969
  SyncStatus["Started"] = "Started";
@@ -1554,7 +971,6 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
1554
971
  SyncStatus["Failed"] = "Failed";
1555
972
  SyncStatus["Cancelled"] = "Cancelled";
1556
973
  })(exports.SyncStatus || (exports.SyncStatus = {}));
1557
-
1558
974
  (function (PracticeEmailKind) {
1559
975
  PracticeEmailKind["SignedUp"] = "SignedUp";
1560
976
  PracticeEmailKind["Onboarded"] = "Onboarded";
@@ -1573,7 +989,6 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
1573
989
  PracticeEmailKind["OnlinePharmacyFaxSent"] = "OnlinePharmacyFaxSent";
1574
990
  PracticeEmailKind["ResumeConsult"] = "ResumeConsult";
1575
991
  })(exports.PracticeEmailKind || (exports.PracticeEmailKind = {}));
1576
-
1577
992
  (function (PracticeConfigKind) {
1578
993
  PracticeConfigKind["PatientConsultCard"] = "PatientConsultCard";
1579
994
  PracticeConfigKind["PracticeCloseConsultationTypes"] = "PracticeCloseConsultationTypes";
@@ -1594,12 +1009,10 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
1594
1009
  PracticeConfigKind["PracticeAddressField"] = "PracticeAddressField";
1595
1010
  PracticeConfigKind["PracticeDiagnosisAndTreatment"] = "PracticeDiagnosisAndTreatment";
1596
1011
  })(exports.PracticeConfigKind || (exports.PracticeConfigKind = {}));
1597
-
1598
1012
  (function (StripePriceType) {
1599
1013
  StripePriceType["Default"] = "Default";
1600
1014
  StripePriceType["Discount"] = "Discount";
1601
1015
  })(exports.StripePriceType || (exports.StripePriceType = {}));
1602
-
1603
1016
  (function (PaymentIntentRequestMetadataKind) {
1604
1017
  PaymentIntentRequestMetadataKind["ConsultRequestMetadata"] = "ConsultRequestMetadata";
1605
1018
  PaymentIntentRequestMetadataKind["RefillTreatmentRequestMetadata"] = "RefillTreatmentRequestMetadata";
@@ -1610,7 +1023,6 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
1610
1023
  IndexKey["IndexSnapshot"] = "IndexSnapshot";
1611
1024
  IndexKey["ConsultationLockbox"] = "ConsultationLockbox";
1612
1025
  })(exports.IndexKey || (exports.IndexKey = {}));
1613
-
1614
1026
  (function (DocumentType) {
1615
1027
  DocumentType["Message"] = "Message";
1616
1028
  DocumentType["Note"] = "Note";
@@ -1635,7 +1047,6 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
1635
1047
  InputApplyFunctions["AllAlphanumeric"] = "AllAlphanumeric";
1636
1048
  InputApplyFunctions["NoSpaces"] = "NoSpaces";
1637
1049
  })(exports.InputApplyFunctions || (exports.InputApplyFunctions = {}));
1638
-
1639
1050
  (function (MetadataCategory) {
1640
1051
  MetadataCategory["ChildPersonal"] = "ChildPersonal";
1641
1052
  MetadataCategory["Consultation"] = "Consultation";
@@ -1665,9 +1076,7 @@ var ConsultService = /*#__PURE__*/function () {
1665
1076
  this.api = api;
1666
1077
  this.baseURL = baseURL;
1667
1078
  }
1668
-
1669
1079
  var _proto = ConsultService.prototype;
1670
-
1671
1080
  _proto.consultCreate = function consultCreate(c) {
1672
1081
  return this.api.post(this.baseURL + "/v1/consults", c);
1673
1082
  }
@@ -1687,9 +1096,7 @@ var ConsultService = /*#__PURE__*/function () {
1687
1096
  * @param filterIsoLocality the of isoLocality to filter with
1688
1097
  * @param filterAssignee array of practitioner uuids with which you want to filter the consultations
1689
1098
  * @returns a number of consult
1690
- */
1691
- ;
1692
-
1099
+ */;
1693
1100
  _proto.countConsults = function countConsults(uuidPractice, uuidRequester, statusesMedical, statusesExclude, shortId, columnToSortTo, orderToSortTo, perPage, indexPage, filterAssignedDoctor, filterCurrentPractitioner, filterIsoLocality, filterAssignee, typesConsult, uuidParent) {
1694
1101
  return this.api.head(this.baseURL + "/v1/consults", {
1695
1102
  params: {
@@ -1713,11 +1120,9 @@ var ConsultService = /*#__PURE__*/function () {
1713
1120
  if (!resContentRange || typeof resContentRange !== 'string' && typeof resContentRange !== 'number') {
1714
1121
  return 0;
1715
1122
  }
1716
-
1717
1123
  if (typeof resContentRange === 'number') {
1718
1124
  return resContentRange;
1719
1125
  }
1720
-
1721
1126
  return parseInt(resContentRange);
1722
1127
  });
1723
1128
  }
@@ -1736,9 +1141,7 @@ var ConsultService = /*#__PURE__*/function () {
1736
1141
  * @param filterCurrentPractitioner the uuid of the current assistant assigned to filter with
1737
1142
  * @param filterIsoLocality the of isoLocality to filter with
1738
1143
  * @returns a list of consult
1739
- */
1740
- ;
1741
-
1144
+ */;
1742
1145
  _proto.getConsults = function getConsults(uuidPractice, uuidRequester, statusesMedical, statusesExclude, shortId, columnToSortTo, orderToSortTo, perPage, indexPage, filterAssignedDoctor, filterCurrentPractitioner, filterIsoLocality, filterAssignee, uuidParent, typesConsult) {
1743
1146
  return this.api.get(this.baseURL + "/v1/consults", {
1744
1147
  params: {
@@ -1760,7 +1163,6 @@ var ConsultService = /*#__PURE__*/function () {
1760
1163
  }
1761
1164
  });
1762
1165
  };
1763
-
1764
1166
  _proto.getConsultByUUID = function getConsultByUUID(uuidConsult, uuidPractice) {
1765
1167
  return this.api.get(this.baseURL + "/v1/consults/" + uuidConsult, {
1766
1168
  params: {
@@ -1768,7 +1170,6 @@ var ConsultService = /*#__PURE__*/function () {
1768
1170
  }
1769
1171
  });
1770
1172
  };
1771
-
1772
1173
  _proto.updateConsultByUUID = function updateConsultByUUID(uuidConsult, consult, uuidPractice, uuidRequester) {
1773
1174
  return this.api.put(this.baseURL + "/v1/consults/" + uuidConsult, consult, {
1774
1175
  params: {
@@ -1777,7 +1178,6 @@ var ConsultService = /*#__PURE__*/function () {
1777
1178
  }
1778
1179
  });
1779
1180
  };
1780
-
1781
1181
  _proto.getConsultFaxStatuses = function getConsultFaxStatuses(uuidConsult) {
1782
1182
  return this.api.get(this.baseURL + "/v1/consults/" + uuidConsult + "/transmissions", {
1783
1183
  params: {
@@ -1785,64 +1185,52 @@ var ConsultService = /*#__PURE__*/function () {
1785
1185
  }
1786
1186
  });
1787
1187
  };
1788
-
1789
- _proto.postConsultTransmission = function postConsultTransmission(uuidConsult, nameDriver, addressOrPhoneToSendTo, file, nameReceiver, txtTransmissionTitle, txtTransmissionNotes // numTry ?: number,
1188
+ _proto.postConsultTransmission = function postConsultTransmission(uuidConsult, nameDriver, addressOrPhoneToSendTo, file, nameReceiver, txtTransmissionTitle, txtTransmissionNotes
1189
+ // numTry ?: number,
1790
1190
  // delay ?: number,
1791
1191
  ) {
1792
1192
  if (nameDriver === void 0) {
1793
1193
  nameDriver = 'Documo';
1794
1194
  }
1795
-
1796
1195
  var data = new FormData();
1797
1196
  data.append('nameDriverReceiver', nameDriver);
1798
-
1799
1197
  if (addressOrPhoneToSendTo) {
1800
1198
  data.append('addressReceiver', addressOrPhoneToSendTo);
1801
1199
  }
1802
-
1803
1200
  if (file) {
1804
1201
  data.append('file', file);
1805
1202
  }
1806
-
1807
1203
  if (nameReceiver) {
1808
1204
  data.append('nameReceiver', nameReceiver);
1809
1205
  }
1810
-
1811
1206
  if (txtTransmissionTitle) {
1812
1207
  data.append('txtTransmissionTitle', txtTransmissionTitle);
1813
1208
  }
1814
-
1815
1209
  if (txtTransmissionNotes) {
1816
1210
  data.append('txtTransmissionNotes', txtTransmissionNotes);
1817
1211
  }
1818
-
1819
1212
  return this.api.post(this.baseURL + "/v1/consults/" + uuidConsult + "/transmissions", data, {
1820
1213
  headers: {
1821
1214
  'Content-Type': 'multipart/form-data;'
1822
1215
  }
1823
1216
  });
1824
1217
  };
1825
-
1826
1218
  _proto.postConsultFax = function postConsultFax(uuidConsult, addressReceiver, file) {
1827
1219
  return this.postConsultTransmission(uuidConsult, 'Documo', addressReceiver, file);
1828
1220
  };
1829
-
1830
1221
  _proto.postConsultEmail = function postConsultEmail(uuidConsult, file) {
1831
1222
  return this.postConsultTransmission(uuidConsult, 'Pharmacierge', undefined, file);
1832
1223
  };
1833
-
1834
1224
  _proto.retryConsultFax = function retryConsultFax(uuidConsult, transmissionId) {
1835
1225
  return this.api.put(this.baseURL + "/v1/consults/" + uuidConsult + "/transmissions/" + transmissionId, {
1836
1226
  status: exports.TransmissionStatus.Retrying
1837
1227
  });
1838
1228
  };
1839
-
1840
1229
  _proto.updateConsultTransmissionStatus = function updateConsultTransmissionStatus(transmissionId, uuidConsult, newStatus) {
1841
1230
  return this.api.put(this.baseURL + "/v1/consults/" + uuidConsult + "/transmissions/" + transmissionId, {
1842
1231
  status: newStatus
1843
1232
  });
1844
1233
  };
1845
-
1846
1234
  return ConsultService;
1847
1235
  }();
1848
1236
 
@@ -1851,9 +1239,7 @@ var DiagnosisService = /*#__PURE__*/function () {
1851
1239
  this.api = api;
1852
1240
  this.baseURL = baseURL;
1853
1241
  }
1854
-
1855
1242
  var _proto = DiagnosisService.prototype;
1856
-
1857
1243
  _proto.getDiagnoses = function getDiagnoses() {
1858
1244
  return this.api.get(this.baseURL + "/v1/diagnoses");
1859
1245
  }
@@ -1861,21 +1247,16 @@ var DiagnosisService = /*#__PURE__*/function () {
1861
1247
  * Get a diagnosis by uuid that belongs to your practice
1862
1248
  * @param uuidDiagnosis the uuid of the diagnosis
1863
1249
  * @returns a diagnosis
1864
- */
1865
- ;
1866
-
1250
+ */;
1867
1251
  _proto.getDiagnosisByUuid = function getDiagnosisByUuid(uuidDiagnosis) {
1868
1252
  return this.api.get(this.baseURL + "/v1/diagnoses/" + uuidDiagnosis);
1869
1253
  };
1870
-
1871
1254
  _proto.createDiagnosis = function createDiagnosis(diagnosis) {
1872
1255
  return this.api.post(this.baseURL + "/v1/diagnoses", diagnosis);
1873
1256
  };
1874
-
1875
1257
  _proto.updateDiagnosis = function updateDiagnosis(uuid, diagnosis) {
1876
1258
  return this.api.put(this.baseURL + "/v1/diagnoses/" + uuid, diagnosis);
1877
1259
  };
1878
-
1879
1260
  _proto.getTreatmentsFromDiagnosisUuid = function getTreatmentsFromDiagnosisUuid(diagnosisUuid) {
1880
1261
  return this.api.get(this.baseURL + "/v1/diagnoses/" + diagnosisUuid + "/treatments");
1881
1262
  }
@@ -1883,9 +1264,7 @@ var DiagnosisService = /*#__PURE__*/function () {
1883
1264
  * This function returns treatment plans associated to a consult
1884
1265
  * @param uuidConsult the consult uuid to fetch
1885
1266
  * @returns an array of TreatmentPlan
1886
- */
1887
- ;
1888
-
1267
+ */;
1889
1268
  _proto.getTreatmentPlansFromConsultUuid = function getTreatmentPlansFromConsultUuid(uuidConsult) {
1890
1269
  return this.api.get(this.baseURL + "/v1/treatment-plans/", {
1891
1270
  params: {
@@ -1897,9 +1276,7 @@ var DiagnosisService = /*#__PURE__*/function () {
1897
1276
  * creates a new treatment for the specified diagnosis
1898
1277
  * @param diagnosisUuid uuid of the diagnosis that the treatment is linked to
1899
1278
  * @param treatmentRequest the treatment to be inserted
1900
- */
1901
- ;
1902
-
1279
+ */;
1903
1280
  _proto.createTreatment = function createTreatment(diagnosisUuid, treatmentRequest) {
1904
1281
  return this.api.post(this.baseURL + "/v1/diagnoses/" + diagnosisUuid + "/treatments", treatmentRequest);
1905
1282
  }
@@ -1907,9 +1284,7 @@ var DiagnosisService = /*#__PURE__*/function () {
1907
1284
  * This function returns populated treatment plans associated to a consult
1908
1285
  * @param uuidConsult the consult uuid to fetch
1909
1286
  * @returns a TreatmentPlans object
1910
- */
1911
- ;
1912
-
1287
+ */;
1913
1288
  _proto.getTreatmentPlansPopulatedFromConsultUuid = function getTreatmentPlansPopulatedFromConsultUuid(uuidConsult) {
1914
1289
  return this.api.get(this.baseURL + "/v1/treatment-plans/", {
1915
1290
  params: {
@@ -1918,11 +1293,9 @@ var DiagnosisService = /*#__PURE__*/function () {
1918
1293
  }
1919
1294
  });
1920
1295
  };
1921
-
1922
1296
  _proto.postPlans = function postPlans(plans) {
1923
1297
  return this.api.post(this.baseURL + "/v1/treatment-plans", plans);
1924
1298
  };
1925
-
1926
1299
  _proto.updateTreatmentPlan = function updateTreatmentPlan(uuidPlan, uuidConsult, diagnosisRequest, plan, refill) {
1927
1300
  return this.api.put(this.baseURL + "/v1/treatment-plans/" + uuidPlan, {
1928
1301
  uuidConsult: uuidConsult,
@@ -1931,7 +1304,6 @@ var DiagnosisService = /*#__PURE__*/function () {
1931
1304
  refill: refill
1932
1305
  });
1933
1306
  };
1934
-
1935
1307
  _proto.acceptTreatmentPlan = function acceptTreatmentPlan(uuidPlan, uuidConsult) {
1936
1308
  return this.api.put(this.baseURL + "/v1/treatment-plans/" + uuidPlan + "/accept", {
1937
1309
  uuidConsult: uuidConsult
@@ -1940,34 +1312,27 @@ var DiagnosisService = /*#__PURE__*/function () {
1940
1312
  /**
1941
1313
  * retrieves all the drugs of the specified practice
1942
1314
  * @param uuidPractice
1943
- */
1944
- ;
1945
-
1315
+ */;
1946
1316
  _proto.getAllDrugs =
1947
1317
  /*#__PURE__*/
1948
1318
  function () {
1949
- var _getAllDrugs = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(uuidPractice) {
1319
+ var _getAllDrugs = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(uuidPractice) {
1950
1320
  var res;
1951
- return runtime_1.wrap(function _callee$(_context) {
1321
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1952
1322
  while (1) {
1953
1323
  switch (_context.prev = _context.next) {
1954
1324
  case 0:
1955
1325
  _context.next = 2;
1956
1326
  return this.api.get(this.baseURL + "/v1/drugs/practice/" + uuidPractice);
1957
-
1958
1327
  case 2:
1959
1328
  res = _context.sent;
1960
-
1961
1329
  if (!(res && res.foundDrugs)) {
1962
1330
  _context.next = 5;
1963
1331
  break;
1964
1332
  }
1965
-
1966
1333
  return _context.abrupt("return", res.foundDrugs);
1967
-
1968
1334
  case 5:
1969
1335
  return _context.abrupt("return", undefined);
1970
-
1971
1336
  case 6:
1972
1337
  case "end":
1973
1338
  return _context.stop();
@@ -1975,14 +1340,11 @@ var DiagnosisService = /*#__PURE__*/function () {
1975
1340
  }
1976
1341
  }, _callee, this);
1977
1342
  }));
1978
-
1979
1343
  function getAllDrugs(_x) {
1980
1344
  return _getAllDrugs.apply(this, arguments);
1981
1345
  }
1982
-
1983
1346
  return getAllDrugs;
1984
1347
  }();
1985
-
1986
1348
  return DiagnosisService;
1987
1349
  }();
1988
1350
 
@@ -1991,7 +1353,6 @@ var GuardService = /*#__PURE__*/function () {
1991
1353
  this.api = api;
1992
1354
  this.baseURL = baseURL;
1993
1355
  this.api.setAuthRefreshFn(this.authRefresh.bind(this)); // This is the default behavior for User JWT tokens. If you want other kind of refresh you shall overwrite this call
1994
-
1995
1356
  this.identityCache = {};
1996
1357
  this.whoAmICache = {};
1997
1358
  }
@@ -2006,10 +1367,7 @@ var GuardService = /*#__PURE__*/function () {
2006
1367
  * ```
2007
1368
  * @param tokens
2008
1369
  */
2009
-
2010
-
2011
1370
  var _proto = GuardService.prototype;
2012
-
2013
1371
  _proto.setTokens = function setTokens(tokens) {
2014
1372
  this.api.setTokens(_extends({}, this.api.getTokens(), tokens));
2015
1373
  }
@@ -2018,16 +1376,13 @@ var GuardService = /*#__PURE__*/function () {
2018
1376
  *
2019
1377
  * @param req The credentials required to get an access token
2020
1378
  * @returns AuthTokenResponse
2021
- */
2022
- ;
2023
-
1379
+ */;
2024
1380
  _proto.m2mToken =
2025
1381
  /*#__PURE__*/
2026
1382
  function () {
2027
- var _m2mToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(req) {
1383
+ var _m2mToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(req) {
2028
1384
  var resp, config, _e$response, code;
2029
-
2030
- return runtime_1.wrap(function _callee$(_context) {
1385
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
2031
1386
  while (1) {
2032
1387
  switch (_context.prev = _context.next) {
2033
1388
  case 0:
@@ -2037,7 +1392,6 @@ var GuardService = /*#__PURE__*/function () {
2037
1392
  };
2038
1393
  _context.next = 4;
2039
1394
  return this.api.post(this.baseURL + "/v1/m2m/token", req, config);
2040
-
2041
1395
  case 4:
2042
1396
  resp = _context.sent;
2043
1397
  this.api.setTokens({
@@ -2045,37 +1399,28 @@ var GuardService = /*#__PURE__*/function () {
2045
1399
  });
2046
1400
  _context.next = 20;
2047
1401
  break;
2048
-
2049
1402
  case 8:
2050
1403
  _context.prev = 8;
2051
1404
  _context.t0 = _context["catch"](0);
2052
1405
  console.error('Error while posting m2m token:', _context.t0);
2053
-
2054
1406
  if (!_context.t0.isAxiosError) {
2055
1407
  _context.next = 19;
2056
1408
  break;
2057
1409
  }
2058
-
2059
1410
  code = (_e$response = _context.t0.response) == null ? void 0 : _e$response.status;
2060
1411
  _context.t1 = code;
2061
1412
  _context.next = _context.t1 === 400 ? 16 : _context.t1 === 500 ? 17 : _context.t1 === 401 ? 18 : 18;
2062
1413
  break;
2063
-
2064
1414
  case 16:
2065
1415
  throw new AuthenticationBadRequest();
2066
-
2067
1416
  case 17:
2068
1417
  throw new AuthenticationServerError();
2069
-
2070
1418
  case 18:
2071
1419
  throw new AuthenticationFailed();
2072
-
2073
1420
  case 19:
2074
1421
  throw new AuthenticationFailed();
2075
-
2076
1422
  case 20:
2077
1423
  return _context.abrupt("return", resp);
2078
-
2079
1424
  case 21:
2080
1425
  case "end":
2081
1426
  return _context.stop();
@@ -2083,11 +1428,9 @@ var GuardService = /*#__PURE__*/function () {
2083
1428
  }
2084
1429
  }, _callee, this, [[0, 8]]);
2085
1430
  }));
2086
-
2087
1431
  function m2mToken(_x) {
2088
1432
  return _m2mToken.apply(this, arguments);
2089
1433
  }
2090
-
2091
1434
  return m2mToken;
2092
1435
  }()
2093
1436
  /**
@@ -2098,14 +1441,12 @@ var GuardService = /*#__PURE__*/function () {
2098
1441
  * @returns AuthTokenResponse
2099
1442
  */
2100
1443
  ;
2101
-
2102
1444
  _proto.authToken =
2103
1445
  /*#__PURE__*/
2104
1446
  function () {
2105
- var _authToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(req) {
1447
+ var _authToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(req) {
2106
1448
  var resp, config, _e$response2, code;
2107
-
2108
- return runtime_1.wrap(function _callee2$(_context2) {
1449
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2109
1450
  while (1) {
2110
1451
  switch (_context2.prev = _context2.next) {
2111
1452
  case 0:
@@ -2115,7 +1456,6 @@ var GuardService = /*#__PURE__*/function () {
2115
1456
  };
2116
1457
  _context2.next = 4;
2117
1458
  return this.api.post(this.baseURL + "/v1/auth/token", req, config);
2118
-
2119
1459
  case 4:
2120
1460
  resp = _context2.sent;
2121
1461
  this.api.setTokens({
@@ -2124,40 +1464,30 @@ var GuardService = /*#__PURE__*/function () {
2124
1464
  });
2125
1465
  _context2.next = 21;
2126
1466
  break;
2127
-
2128
1467
  case 8:
2129
1468
  _context2.prev = 8;
2130
1469
  _context2.t0 = _context2["catch"](0);
2131
1470
  console.error('Error while posting auth token:', _context2.t0);
2132
-
2133
1471
  if (!_context2.t0.isAxiosError) {
2134
1472
  _context2.next = 20;
2135
1473
  break;
2136
1474
  }
2137
-
2138
1475
  code = (_e$response2 = _context2.t0.response) == null ? void 0 : _e$response2.status;
2139
1476
  _context2.t1 = code;
2140
1477
  _context2.next = _context2.t1 === 400 ? 16 : _context2.t1 === 424 ? 17 : _context2.t1 === 500 ? 18 : _context2.t1 === 401 ? 19 : 19;
2141
1478
  break;
2142
-
2143
1479
  case 16:
2144
1480
  throw new AuthenticationBadRequest();
2145
-
2146
1481
  case 17:
2147
1482
  throw new AuthenticationUnconfirmedEmail();
2148
-
2149
1483
  case 18:
2150
1484
  throw new AuthenticationServerError();
2151
-
2152
1485
  case 19:
2153
1486
  throw new AuthenticationFailed();
2154
-
2155
1487
  case 20:
2156
1488
  throw new AuthenticationFailed();
2157
-
2158
1489
  case 21:
2159
1490
  return _context2.abrupt("return", resp);
2160
-
2161
1491
  case 22:
2162
1492
  case "end":
2163
1493
  return _context2.stop();
@@ -2165,11 +1495,9 @@ var GuardService = /*#__PURE__*/function () {
2165
1495
  }
2166
1496
  }, _callee2, this, [[0, 8]]);
2167
1497
  }));
2168
-
2169
1498
  function authToken(_x2) {
2170
1499
  return _authToken.apply(this, arguments);
2171
1500
  }
2172
-
2173
1501
  return authToken;
2174
1502
  }()
2175
1503
  /**
@@ -2178,13 +1506,12 @@ var GuardService = /*#__PURE__*/function () {
2178
1506
  * @returns AuthTokenResponse
2179
1507
  */
2180
1508
  ;
2181
-
2182
1509
  _proto.authRefresh =
2183
1510
  /*#__PURE__*/
2184
1511
  function () {
2185
- var _authRefresh = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(refreshToken) {
1512
+ var _authRefresh = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(refreshToken) {
2186
1513
  var config;
2187
- return runtime_1.wrap(function _callee3$(_context3) {
1514
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
2188
1515
  while (1) {
2189
1516
  switch (_context3.prev = _context3.next) {
2190
1517
  case 0:
@@ -2193,7 +1520,6 @@ var GuardService = /*#__PURE__*/function () {
2193
1520
  useRefreshToken: true
2194
1521
  };
2195
1522
  return _context3.abrupt("return", this.api.put(this.baseURL + "/v1/auth/token", null, config));
2196
-
2197
1523
  case 2:
2198
1524
  case "end":
2199
1525
  return _context3.stop();
@@ -2201,11 +1527,9 @@ var GuardService = /*#__PURE__*/function () {
2201
1527
  }
2202
1528
  }, _callee3, this);
2203
1529
  }));
2204
-
2205
1530
  function authRefresh(_x3) {
2206
1531
  return _authRefresh.apply(this, arguments);
2207
1532
  }
2208
-
2209
1533
  return authRefresh;
2210
1534
  }()
2211
1535
  /**
@@ -2214,17 +1538,15 @@ var GuardService = /*#__PURE__*/function () {
2214
1538
  * @returns void
2215
1539
  */
2216
1540
  ;
2217
-
2218
1541
  _proto.authLogout =
2219
1542
  /*#__PURE__*/
2220
1543
  function () {
2221
- var _authLogout = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4() {
2222
- return runtime_1.wrap(function _callee4$(_context4) {
1544
+ var _authLogout = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
1545
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
2223
1546
  while (1) {
2224
1547
  switch (_context4.prev = _context4.next) {
2225
1548
  case 0:
2226
1549
  return _context4.abrupt("return", this.api.get(this.baseURL + "/v1/auth/logout"));
2227
-
2228
1550
  case 1:
2229
1551
  case "end":
2230
1552
  return _context4.stop();
@@ -2232,11 +1554,9 @@ var GuardService = /*#__PURE__*/function () {
2232
1554
  }
2233
1555
  }, _callee4, this);
2234
1556
  }));
2235
-
2236
1557
  function authLogout() {
2237
1558
  return _authLogout.apply(this, arguments);
2238
1559
  }
2239
-
2240
1560
  return authLogout;
2241
1561
  }()
2242
1562
  /**
@@ -2246,17 +1566,15 @@ var GuardService = /*#__PURE__*/function () {
2246
1566
  * @returns void
2247
1567
  */
2248
1568
  ;
2249
-
2250
1569
  _proto.authRecover =
2251
1570
  /*#__PURE__*/
2252
1571
  function () {
2253
- var _authRecover = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(req) {
2254
- return runtime_1.wrap(function _callee5$(_context5) {
1572
+ var _authRecover = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(req) {
1573
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
2255
1574
  while (1) {
2256
1575
  switch (_context5.prev = _context5.next) {
2257
1576
  case 0:
2258
1577
  return _context5.abrupt("return", this.api.post(this.baseURL + "/v1/auth/recover", req));
2259
-
2260
1578
  case 1:
2261
1579
  case "end":
2262
1580
  return _context5.stop();
@@ -2264,11 +1582,9 @@ var GuardService = /*#__PURE__*/function () {
2264
1582
  }
2265
1583
  }, _callee5, this);
2266
1584
  }));
2267
-
2268
1585
  function authRecover(_x4) {
2269
1586
  return _authRecover.apply(this, arguments);
2270
1587
  }
2271
-
2272
1588
  return authRecover;
2273
1589
  }()
2274
1590
  /**
@@ -2279,21 +1595,18 @@ var GuardService = /*#__PURE__*/function () {
2279
1595
  * @returns IdentityResponse
2280
1596
  */
2281
1597
  ;
2282
-
2283
1598
  _proto.identityCreate =
2284
1599
  /*#__PURE__*/
2285
1600
  function () {
2286
- var _identityCreate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(req) {
1601
+ var _identityCreate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(req) {
2287
1602
  var resp, _e$response3, code;
2288
-
2289
- return runtime_1.wrap(function _callee6$(_context6) {
1603
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
2290
1604
  while (1) {
2291
1605
  switch (_context6.prev = _context6.next) {
2292
1606
  case 0:
2293
1607
  _context6.prev = 0;
2294
1608
  _context6.next = 3;
2295
1609
  return this.api.post(this.baseURL + "/v1/identities", req);
2296
-
2297
1610
  case 3:
2298
1611
  resp = _context6.sent;
2299
1612
  this.api.setTokens({
@@ -2301,36 +1614,27 @@ var GuardService = /*#__PURE__*/function () {
2301
1614
  });
2302
1615
  _context6.next = 18;
2303
1616
  break;
2304
-
2305
1617
  case 7:
2306
1618
  _context6.prev = 7;
2307
1619
  _context6.t0 = _context6["catch"](0);
2308
-
2309
1620
  if (!_context6.t0.isAxiosError) {
2310
1621
  _context6.next = 17;
2311
1622
  break;
2312
1623
  }
2313
-
2314
1624
  code = (_e$response3 = _context6.t0.response) == null ? void 0 : _e$response3.status;
2315
1625
  _context6.t1 = code;
2316
1626
  _context6.next = _context6.t1 === 400 ? 14 : _context6.t1 === 409 ? 15 : _context6.t1 === 500 ? 16 : 16;
2317
1627
  break;
2318
-
2319
1628
  case 14:
2320
1629
  throw new IdentityCreationBadRequest();
2321
-
2322
1630
  case 15:
2323
1631
  throw new IdentityCreationConflict();
2324
-
2325
1632
  case 16:
2326
1633
  throw new IdentityCreationFailed();
2327
-
2328
1634
  case 17:
2329
1635
  throw new IdentityCreationFailed();
2330
-
2331
1636
  case 18:
2332
1637
  return _context6.abrupt("return", resp);
2333
-
2334
1638
  case 19:
2335
1639
  case "end":
2336
1640
  return _context6.stop();
@@ -2338,11 +1642,9 @@ var GuardService = /*#__PURE__*/function () {
2338
1642
  }
2339
1643
  }, _callee6, this, [[0, 7]]);
2340
1644
  }));
2341
-
2342
1645
  function identityCreate(_x5) {
2343
1646
  return _identityCreate.apply(this, arguments);
2344
1647
  }
2345
-
2346
1648
  return identityCreate;
2347
1649
  }()
2348
1650
  /**
@@ -2354,49 +1656,38 @@ var GuardService = /*#__PURE__*/function () {
2354
1656
  * @returns IdentityResponse
2355
1657
  */
2356
1658
  ;
2357
-
2358
1659
  _proto.identityGet =
2359
1660
  /*#__PURE__*/
2360
1661
  function () {
2361
- var _identityGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(identityID, skipCache) {
1662
+ var _identityGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(identityID, skipCache) {
2362
1663
  var _tokens$accessToken, _tokens$refreshToken;
2363
-
2364
1664
  var tokens, cacheKey, identity;
2365
- return runtime_1.wrap(function _callee7$(_context7) {
1665
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
2366
1666
  while (1) {
2367
1667
  switch (_context7.prev = _context7.next) {
2368
1668
  case 0:
2369
1669
  if (skipCache === void 0) {
2370
1670
  skipCache = false;
2371
1671
  }
2372
-
2373
1672
  tokens = this.api.getTokens();
2374
1673
  cacheKey = ((_tokens$accessToken = tokens.accessToken) != null ? _tokens$accessToken : '') + ((_tokens$refreshToken = tokens.refreshToken) != null ? _tokens$refreshToken : '') + identityID;
2375
-
2376
1674
  if (!(skipCache || !tokens.accessToken || !this.identityCache[cacheKey])) {
2377
1675
  _context7.next = 10;
2378
1676
  break;
2379
1677
  }
2380
-
2381
1678
  _context7.next = 6;
2382
1679
  return this.api.get(this.baseURL + "/v1/identities/" + identityID);
2383
-
2384
1680
  case 6:
2385
1681
  identity = _context7.sent;
2386
-
2387
1682
  if (!skipCache) {
2388
1683
  _context7.next = 9;
2389
1684
  break;
2390
1685
  }
2391
-
2392
1686
  return _context7.abrupt("return", identity);
2393
-
2394
1687
  case 9:
2395
1688
  this.identityCache[cacheKey] = identity;
2396
-
2397
1689
  case 10:
2398
1690
  return _context7.abrupt("return", this.identityCache[cacheKey]);
2399
-
2400
1691
  case 11:
2401
1692
  case "end":
2402
1693
  return _context7.stop();
@@ -2404,11 +1695,9 @@ var GuardService = /*#__PURE__*/function () {
2404
1695
  }
2405
1696
  }, _callee7, this);
2406
1697
  }));
2407
-
2408
1698
  function identityGet(_x6, _x7) {
2409
1699
  return _identityGet.apply(this, arguments);
2410
1700
  }
2411
-
2412
1701
  return identityGet;
2413
1702
  }()
2414
1703
  /**
@@ -2418,38 +1707,30 @@ var GuardService = /*#__PURE__*/function () {
2418
1707
  * @returns WhoAmIResponse
2419
1708
  */
2420
1709
  ;
2421
-
2422
1710
  _proto.whoAmI =
2423
1711
  /*#__PURE__*/
2424
1712
  function () {
2425
- var _whoAmI = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(refreshCache) {
1713
+ var _whoAmI = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(refreshCache) {
2426
1714
  var _this$api$getTokens$a;
2427
-
2428
1715
  var cacheKey;
2429
- return runtime_1.wrap(function _callee8$(_context8) {
1716
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
2430
1717
  while (1) {
2431
1718
  switch (_context8.prev = _context8.next) {
2432
1719
  case 0:
2433
1720
  if (refreshCache === void 0) {
2434
1721
  refreshCache = false;
2435
1722
  }
2436
-
2437
1723
  cacheKey = (_this$api$getTokens$a = this.api.getTokens().accessToken) != null ? _this$api$getTokens$a : '';
2438
-
2439
1724
  if (!(!this.whoAmICache[cacheKey] || refreshCache)) {
2440
1725
  _context8.next = 6;
2441
1726
  break;
2442
1727
  }
2443
-
2444
1728
  _context8.next = 5;
2445
1729
  return this.api.get(this.baseURL + "/v1/auth/whoami");
2446
-
2447
1730
  case 5:
2448
1731
  this.whoAmICache[cacheKey] = _context8.sent;
2449
-
2450
1732
  case 6:
2451
1733
  return _context8.abrupt("return", this.whoAmICache[cacheKey]);
2452
-
2453
1734
  case 7:
2454
1735
  case "end":
2455
1736
  return _context8.stop();
@@ -2457,11 +1738,9 @@ var GuardService = /*#__PURE__*/function () {
2457
1738
  }
2458
1739
  }, _callee8, this);
2459
1740
  }));
2460
-
2461
1741
  function whoAmI(_x8) {
2462
1742
  return _whoAmI.apply(this, arguments);
2463
1743
  }
2464
-
2465
1744
  return whoAmI;
2466
1745
  }()
2467
1746
  /**
@@ -2472,17 +1751,15 @@ var GuardService = /*#__PURE__*/function () {
2472
1751
  * @returns IdentityResponse
2473
1752
  */
2474
1753
  ;
2475
-
2476
1754
  _proto.identityUpdate =
2477
1755
  /*#__PURE__*/
2478
1756
  function () {
2479
- var _identityUpdate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9(identityID, req) {
2480
- return runtime_1.wrap(function _callee9$(_context9) {
1757
+ var _identityUpdate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(identityID, req) {
1758
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
2481
1759
  while (1) {
2482
1760
  switch (_context9.prev = _context9.next) {
2483
1761
  case 0:
2484
1762
  return _context9.abrupt("return", this.api.put(this.baseURL + "/v1/identities/" + identityID, req));
2485
-
2486
1763
  case 1:
2487
1764
  case "end":
2488
1765
  return _context9.stop();
@@ -2490,11 +1767,9 @@ var GuardService = /*#__PURE__*/function () {
2490
1767
  }
2491
1768
  }, _callee9, this);
2492
1769
  }));
2493
-
2494
1770
  function identityUpdate(_x9, _x10) {
2495
1771
  return _identityUpdate.apply(this, arguments);
2496
1772
  }
2497
-
2498
1773
  return identityUpdate;
2499
1774
  }()
2500
1775
  /**
@@ -2506,13 +1781,12 @@ var GuardService = /*#__PURE__*/function () {
2506
1781
  * @returns QRCodeResponse
2507
1782
  */
2508
1783
  ;
2509
-
2510
1784
  _proto.identityMFAQRCode =
2511
1785
  /*#__PURE__*/
2512
1786
  function () {
2513
- var _identityMFAQRCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10(identityID, password) {
1787
+ var _identityMFAQRCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(identityID, password) {
2514
1788
  var req;
2515
- return runtime_1.wrap(function _callee10$(_context10) {
1789
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
2516
1790
  while (1) {
2517
1791
  switch (_context10.prev = _context10.next) {
2518
1792
  case 0:
@@ -2524,7 +1798,6 @@ var GuardService = /*#__PURE__*/function () {
2524
1798
  Accept: 'application/json'
2525
1799
  }
2526
1800
  }));
2527
-
2528
1801
  case 2:
2529
1802
  case "end":
2530
1803
  return _context10.stop();
@@ -2532,11 +1805,9 @@ var GuardService = /*#__PURE__*/function () {
2532
1805
  }
2533
1806
  }, _callee10, this);
2534
1807
  }));
2535
-
2536
1808
  function identityMFAQRCode(_x11, _x12) {
2537
1809
  return _identityMFAQRCode.apply(this, arguments);
2538
1810
  }
2539
-
2540
1811
  return identityMFAQRCode;
2541
1812
  }()
2542
1813
  /**
@@ -2546,17 +1817,15 @@ var GuardService = /*#__PURE__*/function () {
2546
1817
  * @return void
2547
1818
  */
2548
1819
  ;
2549
-
2550
1820
  _proto.identitySendConfirmEmail =
2551
1821
  /*#__PURE__*/
2552
1822
  function () {
2553
- var _identitySendConfirmEmail = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11(req) {
2554
- return runtime_1.wrap(function _callee11$(_context11) {
1823
+ var _identitySendConfirmEmail = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(req) {
1824
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
2555
1825
  while (1) {
2556
1826
  switch (_context11.prev = _context11.next) {
2557
1827
  case 0:
2558
1828
  return _context11.abrupt("return", this.api.post(this.baseURL + "/v1/identity/confirm", req));
2559
-
2560
1829
  case 1:
2561
1830
  case "end":
2562
1831
  return _context11.stop();
@@ -2564,11 +1833,9 @@ var GuardService = /*#__PURE__*/function () {
2564
1833
  }
2565
1834
  }, _callee11, this);
2566
1835
  }));
2567
-
2568
1836
  function identitySendConfirmEmail(_x13) {
2569
1837
  return _identitySendConfirmEmail.apply(this, arguments);
2570
1838
  }
2571
-
2572
1839
  return identitySendConfirmEmail;
2573
1840
  }()
2574
1841
  /**
@@ -2578,17 +1845,15 @@ var GuardService = /*#__PURE__*/function () {
2578
1845
  * @returns IdentityResponse
2579
1846
  */
2580
1847
  ;
2581
-
2582
1848
  _proto.identityGetByCustomerEmail =
2583
1849
  /*#__PURE__*/
2584
1850
  function () {
2585
- var _identityGetByCustomerEmail = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee12(email) {
2586
- return runtime_1.wrap(function _callee12$(_context12) {
1851
+ var _identityGetByCustomerEmail = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(email) {
1852
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
2587
1853
  while (1) {
2588
1854
  switch (_context12.prev = _context12.next) {
2589
1855
  case 0:
2590
1856
  return _context12.abrupt("return", this.identityGetByHash(email.substring(email.indexOf('+') + 1, email.indexOf('@'))));
2591
-
2592
1857
  case 1:
2593
1858
  case "end":
2594
1859
  return _context12.stop();
@@ -2596,11 +1861,9 @@ var GuardService = /*#__PURE__*/function () {
2596
1861
  }
2597
1862
  }, _callee12, this);
2598
1863
  }));
2599
-
2600
1864
  function identityGetByCustomerEmail(_x14) {
2601
1865
  return _identityGetByCustomerEmail.apply(this, arguments);
2602
1866
  }
2603
-
2604
1867
  return identityGetByCustomerEmail;
2605
1868
  }()
2606
1869
  /**
@@ -2610,17 +1873,15 @@ var GuardService = /*#__PURE__*/function () {
2610
1873
  * @returns IdentityResponse
2611
1874
  */
2612
1875
  ;
2613
-
2614
1876
  _proto.identityGetByHash =
2615
1877
  /*#__PURE__*/
2616
1878
  function () {
2617
- var _identityGetByHash = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee13(b64Hash) {
2618
- return runtime_1.wrap(function _callee13$(_context13) {
1879
+ var _identityGetByHash = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(b64Hash) {
1880
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
2619
1881
  while (1) {
2620
1882
  switch (_context13.prev = _context13.next) {
2621
1883
  case 0:
2622
1884
  return _context13.abrupt("return", this.identityGet(b64Hash.replace(/\+/g, '-').replace(/\//g, '_')));
2623
-
2624
1885
  case 1:
2625
1886
  case "end":
2626
1887
  return _context13.stop();
@@ -2628,14 +1889,11 @@ var GuardService = /*#__PURE__*/function () {
2628
1889
  }
2629
1890
  }, _callee13, this);
2630
1891
  }));
2631
-
2632
1892
  function identityGetByHash(_x15) {
2633
1893
  return _identityGetByHash.apply(this, arguments);
2634
1894
  }
2635
-
2636
1895
  return identityGetByHash;
2637
1896
  }();
2638
-
2639
1897
  return GuardService;
2640
1898
  }();
2641
1899
 
@@ -2649,10 +1907,7 @@ var SearchService = /*#__PURE__*/function () {
2649
1907
  * @param consultUUID
2650
1908
  * @param terms the search terms to be indexed
2651
1909
  */
2652
-
2653
-
2654
1910
  var _proto = SearchService.prototype;
2655
-
2656
1911
  _proto.index = function index(consultUUID, terms) {
2657
1912
  return this.api.post(this.baseURL + "/v1/index", {
2658
1913
  consultUUID: consultUUID,
@@ -2662,15 +1917,12 @@ var SearchService = /*#__PURE__*/function () {
2662
1917
  /**
2663
1918
  * Searches for the consultations corresponding to the search terms entered in the query
2664
1919
  * @param terms array of search terms
2665
- */
2666
- ;
2667
-
1920
+ */;
2668
1921
  _proto.search = function search(terms) {
2669
1922
  return this.api.post(this.baseURL + "/v1/search", {
2670
1923
  terms: terms
2671
1924
  });
2672
1925
  };
2673
-
2674
1926
  return SearchService;
2675
1927
  }();
2676
1928
 
@@ -2684,10 +1936,7 @@ var PracticeService = /*#__PURE__*/function () {
2684
1936
  * an M2M with the scope `practice.practices.get`
2685
1937
  * @returns an array of practices
2686
1938
  */
2687
-
2688
-
2689
1939
  var _proto = PracticeService.prototype;
2690
-
2691
1940
  _proto.practiceGetAll = function practiceGetAll() {
2692
1941
  return this.api.get(this.baseURL + "/v1/practices");
2693
1942
  }
@@ -2698,9 +1947,7 @@ var PracticeService = /*#__PURE__*/function () {
2698
1947
  * @param hydratePracticeConfigs (optional) if set true it the Practice field configs will be set
2699
1948
  * @param accounts (optional) if set true it the Practice field accounts will be set
2700
1949
  * @returns the found practice or undefined
2701
- */
2702
- ;
2703
-
1950
+ */;
2704
1951
  _proto.practiceGetFromURL = function practiceGetFromURL(practiceURL, params) {
2705
1952
  return this.api.get(this.baseURL + "/v1/practices", {
2706
1953
  params: _extends({
@@ -2708,7 +1955,6 @@ var PracticeService = /*#__PURE__*/function () {
2708
1955
  }, params)
2709
1956
  });
2710
1957
  };
2711
-
2712
1958
  _proto.practiceGetFromUuid = function practiceGetFromUuid(practiceUuid, locale, withAccounts) {
2713
1959
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid, {
2714
1960
  params: {
@@ -2716,15 +1962,13 @@ var PracticeService = /*#__PURE__*/function () {
2716
1962
  accounts: withAccounts
2717
1963
  }
2718
1964
  });
2719
- } /// Practice Configs
2720
-
1965
+ }
1966
+ /// Practice Configs
2721
1967
  /**
2722
1968
  * This function retrieves all configs of a specific practice
2723
1969
  * @param practiceUuid uuid of the practice
2724
1970
  * @returns the practice configs
2725
- */
2726
- ;
2727
-
1971
+ */;
2728
1972
  _proto.practiceConfigGetFromPracticeUuid = function practiceConfigGetFromPracticeUuid(practiceUuid) {
2729
1973
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/configs");
2730
1974
  }
@@ -2733,9 +1977,7 @@ var PracticeService = /*#__PURE__*/function () {
2733
1977
  * @param practiceUuid uuid of the practice
2734
1978
  * @param kind of the config
2735
1979
  * @returns the practice config
2736
- */
2737
- ;
2738
-
1980
+ */;
2739
1981
  _proto.practiceConfigGetByKindForPracticeUuid = function practiceConfigGetByKindForPracticeUuid(practiceUuid, kind) {
2740
1982
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/configs/" + kind);
2741
1983
  }
@@ -2744,9 +1986,7 @@ var PracticeService = /*#__PURE__*/function () {
2744
1986
  * @param practiceUuid uuid of the practice
2745
1987
  * @param config the config to add to the practice
2746
1988
  * @returns the created practice config
2747
- */
2748
- ;
2749
-
1989
+ */;
2750
1990
  _proto.practiceConfigCreateForPracticeUuid = function practiceConfigCreateForPracticeUuid(practiceUuid, config) {
2751
1991
  return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/configs", config);
2752
1992
  }
@@ -2755,18 +1995,15 @@ var PracticeService = /*#__PURE__*/function () {
2755
1995
  * @param practiceUuid uuid of the practice
2756
1996
  * @param config the config to update
2757
1997
  * @returns the practice config
2758
- */
2759
- ;
2760
-
1998
+ */;
2761
1999
  _proto.practiceConfigUpdate = function practiceConfigUpdate(config) {
2762
2000
  return this.api.put(this.baseURL + "/v1/practices/" + config.uuidPractice + "/configs/" + config.kind, config);
2763
- } /// Accounts
2001
+ }
2002
+ /// Accounts
2764
2003
  ;
2765
-
2766
2004
  _proto.practiceGetAccounts = function practiceGetAccounts(practiceUuid) {
2767
2005
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/accounts");
2768
2006
  };
2769
-
2770
2007
  _proto.practiceGetAccount = function practiceGetAccount(practiceUuid, accountUuid) {
2771
2008
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/accounts/" + accountUuid);
2772
2009
  }
@@ -2775,9 +2012,7 @@ var PracticeService = /*#__PURE__*/function () {
2775
2012
  * @param practiceUuid the uuid of the practice
2776
2013
  * @param kind (optional) the kind of WorkflowType to filter in
2777
2014
  * @returns a list of PracticeWorkflow
2778
- */
2779
- ;
2780
-
2015
+ */;
2781
2016
  _proto.practiceGetWorkflows = function practiceGetWorkflows(practiceUuid, kind) {
2782
2017
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/workflows", {
2783
2018
  params: {
@@ -2785,12 +2020,11 @@ var PracticeService = /*#__PURE__*/function () {
2785
2020
  }
2786
2021
  });
2787
2022
  };
2788
-
2789
2023
  _proto.practiceGetWorkflow = function practiceGetWorkflow(practiceUuid, workflowType) {
2790
2024
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/workflows/" + workflowType);
2791
- } /// Plans
2025
+ }
2026
+ /// Plans
2792
2027
  ;
2793
-
2794
2028
  _proto.practiceGetPlans = function practiceGetPlans(practiceUuid, planType) {
2795
2029
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/plans", {
2796
2030
  params: {
@@ -2798,16 +2032,14 @@ var PracticeService = /*#__PURE__*/function () {
2798
2032
  }
2799
2033
  });
2800
2034
  };
2801
-
2802
2035
  _proto.practiceGetPlan = function practiceGetPlan(practiceUuid, planId) {
2803
2036
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/plans/" + planId);
2804
2037
  };
2805
-
2806
2038
  _proto.practiceGetPlanPrices = function practiceGetPlanPrices(practiceUuid, planId) {
2807
2039
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/plans/" + planId + "/prices");
2808
- } // Payments
2040
+ }
2041
+ // Payments
2809
2042
  ;
2810
-
2811
2043
  _proto.practiceGetPayments = function practiceGetPayments(practiceUuid, statusPayment, withConsultUUIDNULL, perPage, indexPage) {
2812
2044
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments", {
2813
2045
  params: {
@@ -2818,16 +2050,14 @@ var PracticeService = /*#__PURE__*/function () {
2818
2050
  }
2819
2051
  });
2820
2052
  };
2821
-
2822
2053
  _proto.practiceGetPayment = function practiceGetPayment(practiceUuid, idStripeInvoiceOrPaymentIntent) {
2823
2054
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/" + idStripeInvoiceOrPaymentIntent);
2824
2055
  };
2825
-
2826
2056
  _proto.practiceGetPaymentForStripePaymentIntentWithID = function practiceGetPaymentForStripePaymentIntentWithID(practiceUuid, stripePaymentIntentId) {
2827
2057
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/" + stripePaymentIntentId);
2828
- } // Payments Intent
2058
+ }
2059
+ // Payments Intent
2829
2060
  ;
2830
-
2831
2061
  _proto.practiceGetPaymentsIntents = function practiceGetPaymentsIntents(practiceUuid, planType) {
2832
2062
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/intents", {
2833
2063
  params: {
@@ -2839,9 +2069,7 @@ var PracticeService = /*#__PURE__*/function () {
2839
2069
  * This function return the user hased email to be use for creating payment intent
2840
2070
  * @param email the email to hash
2841
2071
  * @returns a hashed email
2842
- */
2843
- ;
2844
-
2072
+ */;
2845
2073
  _proto.getPaymentIntentHashedEmail = function getPaymentIntentHashedEmail(email) {
2846
2074
  return hashToBase64String(email.toLowerCase());
2847
2075
  }
@@ -2855,9 +2083,7 @@ var PracticeService = /*#__PURE__*/function () {
2855
2083
  * @param promotionCode (optional) promotion code to apply
2856
2084
  * @param requestMetadata (optional) the request metadata to use. If defined, when payment service call our hooks in practice, it will use it to do required action (create a consult, refill a consult, etc.).
2857
2085
  * @returns
2858
- */
2859
- ;
2860
-
2086
+ */;
2861
2087
  _proto.practiceCreatePaymentsIntent = function practiceCreatePaymentsIntent(practiceUuid, planId, userEmail, isoLocality, url_subdomain, requestMetadata) {
2862
2088
  return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/intents/", {
2863
2089
  idPlan: planId,
@@ -2870,7 +2096,6 @@ var PracticeService = /*#__PURE__*/function () {
2870
2096
  }
2871
2097
  });
2872
2098
  };
2873
-
2874
2099
  _proto.practiceGetPaymentsIntent = function practiceGetPaymentsIntent(practiceUuid, paymentIntentId) {
2875
2100
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/intents/" + paymentIntentId);
2876
2101
  }
@@ -2883,9 +2108,7 @@ var PracticeService = /*#__PURE__*/function () {
2883
2108
  * @param promotionCode (optional) promotional code to apply
2884
2109
  * @param finalize (optional) if true will finalize the PracticePaymentIntent and related Stripe.Invoice. Once, finalized you cannot modify the PracticePaymentIntent anymore.
2885
2110
  * @returns the updated PracticePaymentIntent
2886
- */
2887
- ;
2888
-
2111
+ */;
2889
2112
  _proto.practiceUpdatePaymentsIntent = function practiceUpdatePaymentsIntent(practiceUuid, idPraticePaymentIntent, practicePaymentIntent, userEmail, promotionCode, finalize) {
2890
2113
  return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/intents/" + idPraticePaymentIntent, _extends({}, practicePaymentIntent, {
2891
2114
  hashUserEmail: userEmail ? this.getPaymentIntentHashedEmail(userEmail) : undefined
@@ -2900,125 +2123,103 @@ var PracticeService = /*#__PURE__*/function () {
2900
2123
  * Invoice
2901
2124
  * @param practiceUuid UUID of the practice to get the invoice from
2902
2125
  * @param invoiceId ID of the invoice in stripe
2903
- */
2904
- ;
2905
-
2126
+ */;
2906
2127
  _proto.getInvoice = function getInvoice(practiceUuid, invoiceId) {
2907
2128
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/invoices/" + invoiceId);
2908
- } // Practitioner
2129
+ }
2130
+ // Practitioner
2909
2131
  ;
2910
-
2911
2132
  _proto.practiceGetPractitioners = function practiceGetPractitioners(practiceUuid) {
2912
2133
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners");
2913
2134
  };
2914
-
2915
2135
  _proto.practiceUpdatePractitioner = function practiceUpdatePractitioner(practiceUuid, practitionerUuid, requestBody) {
2916
2136
  return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid, requestBody);
2917
2137
  };
2918
-
2919
2138
  _proto.practiceGetPractitioner = function practiceGetPractitioner(practiceUuid, practitionerUuid) {
2920
2139
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid);
2921
- } // Practitioner Licenses
2140
+ }
2141
+ // Practitioner Licenses
2922
2142
  ;
2923
-
2924
2143
  _proto.practiceGetPractitionerLicenses = function practiceGetPractitionerLicenses(practiceUuid, practitionerUuid) {
2925
2144
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/licenses");
2926
2145
  };
2927
-
2928
2146
  _proto.practiceCreatePractitionerLicense = function practiceCreatePractitionerLicense(practiceUuid, practitionerUuid, requestBody) {
2929
2147
  return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/licenses", requestBody);
2930
2148
  };
2931
-
2932
2149
  _proto.practiceUpdatePractitionerLicense = function practiceUpdatePractitionerLicense(practiceUuid, practitionerUuid, licenseId, requestBody) {
2933
2150
  return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/licenses/" + licenseId, requestBody);
2934
2151
  };
2935
-
2936
2152
  _proto.practiceGetPractitionerLicense = function practiceGetPractitionerLicense(practiceUuid, practitionerUuid, licenseId) {
2937
2153
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/licenses/" + licenseId);
2938
- } // Practitioner Preferences
2154
+ }
2155
+ // Practitioner Preferences
2939
2156
  ;
2940
-
2941
2157
  _proto.practiceGetPractitionerPreferences = function practiceGetPractitionerPreferences(practiceUuid, practitionerUuid) {
2942
2158
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/preferences");
2943
2159
  };
2944
-
2945
2160
  _proto.practiceCreatePractitionerPreference = function practiceCreatePractitionerPreference(practiceUuid, practitionerUuid, requestBody) {
2946
2161
  return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/preferences", requestBody);
2947
2162
  };
2948
-
2949
2163
  _proto.practiceUpdatePractitionerPreference = function practiceUpdatePractitionerPreference(practiceUuid, practitionerUuid, preferenceId, requestBody) {
2950
2164
  return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/preferences/" + preferenceId, requestBody);
2951
2165
  };
2952
-
2953
2166
  _proto.practiceGetPractitionerPreference = function practiceGetPractitionerPreference(practiceUuid, practitionerUuid, preferenceId) {
2954
2167
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/preferences/" + preferenceId);
2955
- } // Practitioner Roles
2168
+ }
2169
+ // Practitioner Roles
2956
2170
  ;
2957
-
2958
2171
  _proto.practiceGetPractitionerRoles = function practiceGetPractitionerRoles(practiceUuid, practitionerUuid) {
2959
2172
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles");
2960
2173
  };
2961
-
2962
2174
  _proto.practiceCreatePractitionerRole = function practiceCreatePractitionerRole(practiceUuid, practitionerUuid, requestBody) {
2963
2175
  return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles", requestBody);
2964
2176
  };
2965
-
2966
2177
  _proto.practiceDeletePractitionerRoles = function practiceDeletePractitionerRoles(practiceUuid, practitionerUuid) {
2967
2178
  return this.api.deleteRequest(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles");
2968
2179
  };
2969
-
2970
2180
  _proto.practiceUpdatePractitionerRole = function practiceUpdatePractitionerRole(practiceUuid, practitionerUuid, roleId, requestBody) {
2971
2181
  return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles/" + roleId, requestBody);
2972
2182
  };
2973
-
2974
2183
  _proto.practiceGetPractitionerRole = function practiceGetPractitionerRole(practiceUuid, practitionerUuid, roleId) {
2975
2184
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles/" + roleId);
2976
2185
  };
2977
-
2978
2186
  _proto.practiceDeletePractitionerRole = function practiceDeletePractitionerRole(practiceUuid, practitionerUuid, roleId) {
2979
2187
  return this.api.deleteRequest(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles/" + roleId);
2980
- } // Practitioner signature
2981
-
2188
+ }
2189
+ // Practitioner signature
2982
2190
  /**
2983
2191
  * This function returns the practitioner's signature as a Blob
2984
2192
  * @param practiceUuid the practice uuid of the practitioner
2985
2193
  * @param practitionerUuid the practitioner uuid
2986
2194
  * @returns a blob representing the signature
2987
- */
2988
- ;
2989
-
2195
+ */;
2990
2196
  _proto.practiceGetPractitionerSignature = function practiceGetPractitionerSignature(practiceUuid, practitionerUuid) {
2991
2197
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/signature", {
2992
2198
  responseType: 'blob'
2993
2199
  });
2994
- } // Assignments
2200
+ }
2201
+ // Assignments
2995
2202
  ;
2996
-
2997
2203
  _proto.practiceGetAssignments = function practiceGetAssignments(practiceUuid) {
2998
2204
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/assignments");
2999
2205
  };
3000
-
3001
2206
  _proto.practiceCreateAssignment = function practiceCreateAssignment(practiceUuid, requestBody) {
3002
2207
  return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/assignments", requestBody);
3003
2208
  };
3004
-
3005
2209
  _proto.practiceUpdateAssignment = function practiceUpdateAssignment(practiceUuid, assignmentId, requestBody) {
3006
2210
  return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/assignments/" + assignmentId, requestBody);
3007
2211
  };
3008
-
3009
2212
  _proto.practiceGetAssignment = function practiceGetAssignment(practiceUuid, assignmentId) {
3010
2213
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/assignments/" + assignmentId);
3011
- } // Quotas
2214
+ }
2215
+ // Quotas
3012
2216
  ;
3013
-
3014
2217
  _proto.practiceGetQuotas = function practiceGetQuotas(practiceUuid) {
3015
2218
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/quotas");
3016
2219
  };
3017
-
3018
2220
  _proto.practiceGetQuota = function practiceGetQuota(practiceUuid, quotaId) {
3019
2221
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/quotas/" + quotaId);
3020
2222
  };
3021
-
3022
2223
  return PracticeService;
3023
2224
  }();
3024
2225
 
@@ -3027,12 +2228,10 @@ var TellerService = /*#__PURE__*/function () {
3027
2228
  this.api = api;
3028
2229
  this.baseURL = baseURL;
3029
2230
  }
3030
-
3031
2231
  var _proto = TellerService.prototype;
3032
-
3033
2232
  _proto.lockboxDataStore = /*#__PURE__*/function () {
3034
- var _lockboxDataStore = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(lockboxUuid, req, lockboxOwnerUuid, previousDataUuid, options) {
3035
- return runtime_1.wrap(function _callee$(_context) {
2233
+ var _lockboxDataStore = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(lockboxUuid, req, lockboxOwnerUuid, previousDataUuid, options) {
2234
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
3036
2235
  while (1) {
3037
2236
  switch (_context.prev = _context.next) {
3038
2237
  case 0:
@@ -3041,7 +2240,6 @@ var TellerService = /*#__PURE__*/function () {
3041
2240
  updateMedicalStatus: true
3042
2241
  };
3043
2242
  }
3044
-
3045
2243
  return _context.abrupt("return", this.api.post(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/data", req, {
3046
2244
  params: {
3047
2245
  lockbox_owner_uuid: lockboxOwnerUuid,
@@ -3049,7 +2247,6 @@ var TellerService = /*#__PURE__*/function () {
3049
2247
  update_medical_status: options.updateMedicalStatus
3050
2248
  }
3051
2249
  }));
3052
-
3053
2250
  case 2:
3054
2251
  case "end":
3055
2252
  return _context.stop();
@@ -3057,14 +2254,11 @@ var TellerService = /*#__PURE__*/function () {
3057
2254
  }
3058
2255
  }, _callee, this);
3059
2256
  }));
3060
-
3061
2257
  function lockboxDataStore(_x, _x2, _x3, _x4, _x5) {
3062
2258
  return _lockboxDataStore.apply(this, arguments);
3063
2259
  }
3064
-
3065
2260
  return lockboxDataStore;
3066
2261
  }();
3067
-
3068
2262
  _proto.updateConsultByUUID = function updateConsultByUUID(patientUuid, uuidConsult, statusMedical, closedReasonType, closedReasonDescription, neverExpires) {
3069
2263
  return this.api.put(this.baseURL + "/v1/consults/" + uuidConsult, {
3070
2264
  patientUuid: patientUuid,
@@ -3082,9 +2276,7 @@ var TellerService = /*#__PURE__*/function () {
3082
2276
  * @param consultationShortId the consultation short id
3083
2277
  * @param fax the address where to send the fax
3084
2278
  * @returns void
3085
- */
3086
- ;
3087
-
2279
+ */;
3088
2280
  _proto.notifyFaxFailed = function notifyFaxFailed(practiceUuid, consultationUuid, consultationShortId, fax) {
3089
2281
  return this.api.post(this.baseURL + "/v1/fax-failed", {
3090
2282
  consultationUuid: consultationUuid,
@@ -3101,9 +2293,7 @@ var TellerService = /*#__PURE__*/function () {
3101
2293
  * @todo - Make service only exposed route
3102
2294
  * @param uuidConsult the uuid of the consult to reassign
3103
2295
  * @param newPractitionerUuid the uuid of the practitioner that will get reassigned
3104
- */
3105
- ;
3106
-
2296
+ */;
3107
2297
  _proto.reassignmentEmail = function reassignmentEmail(uuidConsult, newPractitionerUuid) {
3108
2298
  return this.api.post(this.baseURL + "/v1/consult/" + uuidConsult + "/reassignment-email", {
3109
2299
  newPractitionerUuid: newPractitionerUuid
@@ -3115,9 +2305,7 @@ var TellerService = /*#__PURE__*/function () {
3115
2305
  * @param consult
3116
2306
  * @param patientUuid
3117
2307
  * @returns void
3118
- */
3119
- ;
3120
-
2308
+ */;
3121
2309
  _proto.sendOnlineFaxSuccessfulEmail = function sendOnlineFaxSuccessfulEmail(consult, patientUuid) {
3122
2310
  return this.api.post(this.baseURL + "/v1/online-fax-notify", {
3123
2311
  consult: consult,
@@ -3128,13 +2316,10 @@ var TellerService = /*#__PURE__*/function () {
3128
2316
  * This function will send an email to patient to allow them to resume the consult.
3129
2317
  * @param req the body of the resume consult request
3130
2318
  * @returns void
3131
- */
3132
- ;
3133
-
2319
+ */;
3134
2320
  _proto.sendResumeConsultEmail = function sendResumeConsultEmail(req) {
3135
2321
  return this.api.post(this.baseURL + "/v1/resume-consult-email", req);
3136
2322
  };
3137
-
3138
2323
  return TellerService;
3139
2324
  }();
3140
2325
 
@@ -3143,17 +2328,14 @@ var VaultService = /*#__PURE__*/function () {
3143
2328
  this.api = api;
3144
2329
  this.baseURL = baseURL;
3145
2330
  }
3146
-
3147
2331
  var _proto = VaultService.prototype;
3148
-
3149
2332
  _proto.lockboxCreate = /*#__PURE__*/function () {
3150
- var _lockboxCreate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(lockboxMetadata) {
3151
- return runtime_1.wrap(function _callee$(_context) {
2333
+ var _lockboxCreate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(lockboxMetadata) {
2334
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
3152
2335
  while (1) {
3153
2336
  switch (_context.prev = _context.next) {
3154
2337
  case 0:
3155
2338
  return _context.abrupt("return", this.api.post(this.baseURL + "/v1/lockbox", lockboxMetadata));
3156
-
3157
2339
  case 1:
3158
2340
  case "end":
3159
2341
  return _context.stop();
@@ -3161,17 +2343,14 @@ var VaultService = /*#__PURE__*/function () {
3161
2343
  }
3162
2344
  }, _callee, this);
3163
2345
  }));
3164
-
3165
2346
  function lockboxCreate(_x) {
3166
2347
  return _lockboxCreate.apply(this, arguments);
3167
2348
  }
3168
-
3169
2349
  return lockboxCreate;
3170
2350
  }();
3171
-
3172
2351
  _proto.lockboxMetadataAdd = /*#__PURE__*/function () {
3173
- var _lockboxMetadataAdd = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(lockboxUuid, lockboxMetadata, lockboxOwnerUuid) {
3174
- return runtime_1.wrap(function _callee2$(_context2) {
2352
+ var _lockboxMetadataAdd = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(lockboxUuid, lockboxMetadata, lockboxOwnerUuid) {
2353
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
3175
2354
  while (1) {
3176
2355
  switch (_context2.prev = _context2.next) {
3177
2356
  case 0:
@@ -3180,7 +2359,6 @@ var VaultService = /*#__PURE__*/function () {
3180
2359
  lockbox_owner_uuid: lockboxOwnerUuid
3181
2360
  }
3182
2361
  }));
3183
-
3184
2362
  case 1:
3185
2363
  case "end":
3186
2364
  return _context2.stop();
@@ -3188,17 +2366,14 @@ var VaultService = /*#__PURE__*/function () {
3188
2366
  }
3189
2367
  }, _callee2, this);
3190
2368
  }));
3191
-
3192
2369
  function lockboxMetadataAdd(_x2, _x3, _x4) {
3193
2370
  return _lockboxMetadataAdd.apply(this, arguments);
3194
2371
  }
3195
-
3196
2372
  return lockboxMetadataAdd;
3197
2373
  }();
3198
-
3199
2374
  _proto.lockboxSecretGet = /*#__PURE__*/function () {
3200
- var _lockboxSecretGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(lockboxUuid, lockboxOwnerUuid) {
3201
- return runtime_1.wrap(function _callee3$(_context3) {
2375
+ var _lockboxSecretGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(lockboxUuid, lockboxOwnerUuid) {
2376
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
3202
2377
  while (1) {
3203
2378
  switch (_context3.prev = _context3.next) {
3204
2379
  case 0:
@@ -3207,7 +2382,6 @@ var VaultService = /*#__PURE__*/function () {
3207
2382
  lockbox_owner_uuid: lockboxOwnerUuid
3208
2383
  }
3209
2384
  }));
3210
-
3211
2385
  case 1:
3212
2386
  case "end":
3213
2387
  return _context3.stop();
@@ -3215,17 +2389,14 @@ var VaultService = /*#__PURE__*/function () {
3215
2389
  }
3216
2390
  }, _callee3, this);
3217
2391
  }));
3218
-
3219
2392
  function lockboxSecretGet(_x5, _x6) {
3220
2393
  return _lockboxSecretGet.apply(this, arguments);
3221
2394
  }
3222
-
3223
2395
  return lockboxSecretGet;
3224
2396
  }();
3225
-
3226
2397
  _proto.lockboxGrant = /*#__PURE__*/function () {
3227
- var _lockboxGrant = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(lockboxUuid, req, lockboxOwnerUuid) {
3228
- return runtime_1.wrap(function _callee4$(_context4) {
2398
+ var _lockboxGrant = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(lockboxUuid, req, lockboxOwnerUuid) {
2399
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
3229
2400
  while (1) {
3230
2401
  switch (_context4.prev = _context4.next) {
3231
2402
  case 0:
@@ -3234,7 +2405,6 @@ var VaultService = /*#__PURE__*/function () {
3234
2405
  lockbox_owner_uuid: lockboxOwnerUuid
3235
2406
  }
3236
2407
  }));
3237
-
3238
2408
  case 1:
3239
2409
  case "end":
3240
2410
  return _context4.stop();
@@ -3242,11 +2412,9 @@ var VaultService = /*#__PURE__*/function () {
3242
2412
  }
3243
2413
  }, _callee4, this);
3244
2414
  }));
3245
-
3246
2415
  function lockboxGrant(_x7, _x8, _x9) {
3247
2416
  return _lockboxGrant.apply(this, arguments);
3248
2417
  }
3249
-
3250
2418
  return lockboxGrant;
3251
2419
  }()
3252
2420
  /**
@@ -3255,17 +2423,15 @@ var VaultService = /*#__PURE__*/function () {
3255
2423
  * @returns decrypted lockboxes granted to user
3256
2424
  */
3257
2425
  ;
3258
-
3259
2426
  _proto.grantsGet =
3260
2427
  /*#__PURE__*/
3261
2428
  function () {
3262
- var _grantsGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5() {
3263
- return runtime_1.wrap(function _callee5$(_context5) {
2429
+ var _grantsGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
2430
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
3264
2431
  while (1) {
3265
2432
  switch (_context5.prev = _context5.next) {
3266
2433
  case 0:
3267
2434
  return _context5.abrupt("return", this.api.get(this.baseURL + "/v1/grants"));
3268
-
3269
2435
  case 1:
3270
2436
  case "end":
3271
2437
  return _context5.stop();
@@ -3273,11 +2439,9 @@ var VaultService = /*#__PURE__*/function () {
3273
2439
  }
3274
2440
  }, _callee5, this);
3275
2441
  }));
3276
-
3277
2442
  function grantsGet() {
3278
2443
  return _grantsGet.apply(this, arguments);
3279
2444
  }
3280
-
3281
2445
  return grantsGet;
3282
2446
  }()
3283
2447
  /**
@@ -3291,12 +2455,11 @@ var VaultService = /*#__PURE__*/function () {
3291
2455
  * @returns
3292
2456
  */
3293
2457
  ;
3294
-
3295
2458
  _proto.lockboxDataStore =
3296
2459
  /*#__PURE__*/
3297
2460
  function () {
3298
- var _lockboxDataStore = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(lockboxUuid, req, lockboxOwnerUuid, previousDataUuid) {
3299
- return runtime_1.wrap(function _callee6$(_context6) {
2461
+ var _lockboxDataStore = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(lockboxUuid, req, lockboxOwnerUuid, previousDataUuid) {
2462
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
3300
2463
  while (1) {
3301
2464
  switch (_context6.prev = _context6.next) {
3302
2465
  case 0:
@@ -3306,7 +2469,6 @@ var VaultService = /*#__PURE__*/function () {
3306
2469
  data_uuid: previousDataUuid
3307
2470
  }
3308
2471
  }));
3309
-
3310
2472
  case 1:
3311
2473
  case "end":
3312
2474
  return _context6.stop();
@@ -3314,25 +2476,21 @@ var VaultService = /*#__PURE__*/function () {
3314
2476
  }
3315
2477
  }, _callee6, this);
3316
2478
  }));
3317
-
3318
2479
  function lockboxDataStore(_x10, _x11, _x12, _x13) {
3319
2480
  return _lockboxDataStore.apply(this, arguments);
3320
2481
  }
3321
-
3322
2482
  return lockboxDataStore;
3323
2483
  }();
3324
-
3325
2484
  _proto.lockboxDataGet = /*#__PURE__*/function () {
3326
- var _lockboxDataGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(lockboxUuid, dataUuid, lockboxOwnerUuid, stream) {
2485
+ var _lockboxDataGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(lockboxUuid, dataUuid, lockboxOwnerUuid, stream) {
3327
2486
  var data;
3328
- return runtime_1.wrap(function _callee7$(_context7) {
2487
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
3329
2488
  while (1) {
3330
2489
  switch (_context7.prev = _context7.next) {
3331
2490
  case 0:
3332
2491
  if (stream === void 0) {
3333
2492
  stream = true;
3334
2493
  }
3335
-
3336
2494
  _context7.next = 3;
3337
2495
  return this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/data/" + dataUuid, {
3338
2496
  params: {
@@ -3340,22 +2498,17 @@ var VaultService = /*#__PURE__*/function () {
3340
2498
  stream: stream
3341
2499
  }
3342
2500
  });
3343
-
3344
2501
  case 3:
3345
2502
  data = _context7.sent;
3346
-
3347
2503
  if (!stream) {
3348
2504
  _context7.next = 6;
3349
2505
  break;
3350
2506
  }
3351
-
3352
2507
  return _context7.abrupt("return", {
3353
2508
  data: data
3354
2509
  });
3355
-
3356
2510
  case 6:
3357
2511
  return _context7.abrupt("return", data);
3358
-
3359
2512
  case 7:
3360
2513
  case "end":
3361
2514
  return _context7.stop();
@@ -3363,17 +2516,14 @@ var VaultService = /*#__PURE__*/function () {
3363
2516
  }
3364
2517
  }, _callee7, this);
3365
2518
  }));
3366
-
3367
2519
  function lockboxDataGet(_x14, _x15, _x16, _x17) {
3368
2520
  return _lockboxDataGet.apply(this, arguments);
3369
2521
  }
3370
-
3371
2522
  return lockboxDataGet;
3372
2523
  }();
3373
-
3374
2524
  _proto.lockboxManifestGet = /*#__PURE__*/function () {
3375
- var _lockboxManifestGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(lockboxUuid, filter, lockboxOwnerUuid) {
3376
- return runtime_1.wrap(function _callee8$(_context8) {
2525
+ var _lockboxManifestGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(lockboxUuid, filter, lockboxOwnerUuid) {
2526
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
3377
2527
  while (1) {
3378
2528
  switch (_context8.prev = _context8.next) {
3379
2529
  case 0:
@@ -3383,7 +2533,6 @@ var VaultService = /*#__PURE__*/function () {
3383
2533
  filter: filter
3384
2534
  }
3385
2535
  }));
3386
-
3387
2536
  case 1:
3388
2537
  case "end":
3389
2538
  return _context8.stop();
@@ -3391,17 +2540,14 @@ var VaultService = /*#__PURE__*/function () {
3391
2540
  }
3392
2541
  }, _callee8, this);
3393
2542
  }));
3394
-
3395
2543
  function lockboxManifestGet(_x18, _x19, _x20) {
3396
2544
  return _lockboxManifestGet.apply(this, arguments);
3397
2545
  }
3398
-
3399
2546
  return lockboxManifestGet;
3400
2547
  }();
3401
-
3402
2548
  _proto.lockboxMetadataGet = /*#__PURE__*/function () {
3403
- var _lockboxMetadataGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9(lockboxUuid, fields, groupby, filter, lockboxOwnerUuid) {
3404
- return runtime_1.wrap(function _callee9$(_context9) {
2549
+ var _lockboxMetadataGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(lockboxUuid, fields, groupby, filter, lockboxOwnerUuid) {
2550
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
3405
2551
  while (1) {
3406
2552
  switch (_context9.prev = _context9.next) {
3407
2553
  case 0:
@@ -3413,7 +2559,6 @@ var VaultService = /*#__PURE__*/function () {
3413
2559
  filter: filter
3414
2560
  }
3415
2561
  }));
3416
-
3417
2562
  case 1:
3418
2563
  case "end":
3419
2564
  return _context9.stop();
@@ -3421,11 +2566,9 @@ var VaultService = /*#__PURE__*/function () {
3421
2566
  }
3422
2567
  }, _callee9, this);
3423
2568
  }));
3424
-
3425
2569
  function lockboxMetadataGet(_x21, _x22, _x23, _x24, _x25) {
3426
2570
  return _lockboxMetadataGet.apply(this, arguments);
3427
2571
  }
3428
-
3429
2572
  return lockboxMetadataGet;
3430
2573
  }()
3431
2574
  /**
@@ -3436,12 +2579,11 @@ var VaultService = /*#__PURE__*/function () {
3436
2579
  * @param indexOwnerUuid
3437
2580
  */
3438
2581
  ;
3439
-
3440
2582
  _proto.vaultIndexPut =
3441
2583
  /*#__PURE__*/
3442
2584
  function () {
3443
- var _vaultIndexPut = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10(entries, indexOwnerUuid) {
3444
- return runtime_1.wrap(function _callee10$(_context10) {
2585
+ var _vaultIndexPut = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(entries, indexOwnerUuid) {
2586
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
3445
2587
  while (1) {
3446
2588
  switch (_context10.prev = _context10.next) {
3447
2589
  case 0:
@@ -3450,7 +2592,6 @@ var VaultService = /*#__PURE__*/function () {
3450
2592
  index_owner_uuid: indexOwnerUuid
3451
2593
  }
3452
2594
  }));
3453
-
3454
2595
  case 1:
3455
2596
  case "end":
3456
2597
  return _context10.stop();
@@ -3458,11 +2599,9 @@ var VaultService = /*#__PURE__*/function () {
3458
2599
  }
3459
2600
  }, _callee10, this);
3460
2601
  }));
3461
-
3462
2602
  function vaultIndexPut(_x26, _x27) {
3463
2603
  return _vaultIndexPut.apply(this, arguments);
3464
2604
  }
3465
-
3466
2605
  return vaultIndexPut;
3467
2606
  }()
3468
2607
  /**
@@ -3471,17 +2610,15 @@ var VaultService = /*#__PURE__*/function () {
3471
2610
  * @param entry the encrypted index snapshot
3472
2611
  */
3473
2612
  ;
3474
-
3475
2613
  _proto.vaultIndexSnapshotPut =
3476
2614
  /*#__PURE__*/
3477
2615
  function () {
3478
- var _vaultIndexSnapshotPut = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11(entry) {
3479
- return runtime_1.wrap(function _callee11$(_context11) {
2616
+ var _vaultIndexSnapshotPut = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(entry) {
2617
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
3480
2618
  while (1) {
3481
2619
  switch (_context11.prev = _context11.next) {
3482
2620
  case 0:
3483
2621
  return _context11.abrupt("return", this.api.put(this.baseURL + "/v1/index-snapshot", entry));
3484
-
3485
2622
  case 1:
3486
2623
  case "end":
3487
2624
  return _context11.stop();
@@ -3489,11 +2626,9 @@ var VaultService = /*#__PURE__*/function () {
3489
2626
  }
3490
2627
  }, _callee11, this);
3491
2628
  }));
3492
-
3493
2629
  function vaultIndexSnapshotPut(_x28) {
3494
2630
  return _vaultIndexSnapshotPut.apply(this, arguments);
3495
2631
  }
3496
-
3497
2632
  return vaultIndexSnapshotPut;
3498
2633
  }()
3499
2634
  /**
@@ -3505,12 +2640,11 @@ var VaultService = /*#__PURE__*/function () {
3505
2640
  * @returns the encrypted index
3506
2641
  */
3507
2642
  ;
3508
-
3509
2643
  _proto.vaultIndexGet =
3510
2644
  /*#__PURE__*/
3511
2645
  function () {
3512
- var _vaultIndexGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee12(indexKeys, identifiers, timestamp) {
3513
- return runtime_1.wrap(function _callee12$(_context12) {
2646
+ var _vaultIndexGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(indexKeys, identifiers, timestamp) {
2647
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
3514
2648
  while (1) {
3515
2649
  switch (_context12.prev = _context12.next) {
3516
2650
  case 0:
@@ -3521,7 +2655,6 @@ var VaultService = /*#__PURE__*/function () {
3521
2655
  timestamp: timestamp
3522
2656
  }
3523
2657
  }));
3524
-
3525
2658
  case 1:
3526
2659
  case "end":
3527
2660
  return _context12.stop();
@@ -3529,14 +2662,11 @@ var VaultService = /*#__PURE__*/function () {
3529
2662
  }
3530
2663
  }, _callee12, this);
3531
2664
  }));
3532
-
3533
2665
  function vaultIndexGet(_x29, _x30, _x31) {
3534
2666
  return _vaultIndexGet.apply(this, arguments);
3535
2667
  }
3536
-
3537
2668
  return vaultIndexGet;
3538
2669
  }();
3539
-
3540
2670
  return VaultService;
3541
2671
  }();
3542
2672
 
@@ -3549,10 +2679,7 @@ var WorkflowService = /*#__PURE__*/function () {
3549
2679
  * This function returns all workflows
3550
2680
  * @returns desired workflow
3551
2681
  */
3552
-
3553
-
3554
2682
  var _proto = WorkflowService.prototype;
3555
-
3556
2683
  _proto.getWorkflows = function getWorkflows() {
3557
2684
  return this.api.get(this.v1Url + "/workflows");
3558
2685
  }
@@ -3563,9 +2690,7 @@ var WorkflowService = /*#__PURE__*/function () {
3563
2690
  * @param locale (optional) The desired locale of the workflow (default: 'en')
3564
2691
  * @param createdAt (optional) The creation date of the workflow (also used for versionning)
3565
2692
  * @returns desired workflow
3566
- */
3567
- ;
3568
-
2693
+ */;
3569
2694
  _proto.getWorkflow = function getWorkflow(id, locale, createdAt) {
3570
2695
  return this.api.get(this.v1Url + "/workflows/" + id, {
3571
2696
  params: {
@@ -3574,7 +2699,6 @@ var WorkflowService = /*#__PURE__*/function () {
3574
2699
  }
3575
2700
  });
3576
2701
  };
3577
-
3578
2702
  return WorkflowService;
3579
2703
  }();
3580
2704
 
@@ -3585,20 +2709,18 @@ var WorkflowService = /*#__PURE__*/function () {
3585
2709
  * @param useLocalStorage (default: true) if true store tokens into local storage (only for browsers)
3586
2710
  * @returns an instance of each services with a provided url
3587
2711
  */
3588
-
3589
2712
  var init = function init(services, authenticationCallback, useLocalStorage) {
3590
2713
  if (useLocalStorage === void 0) {
3591
2714
  useLocalStorage = true;
3592
2715
  }
3593
-
3594
2716
  var tellerBaseURL = services.tellerBaseURL,
3595
- practiceBaseURL = services.practiceBaseURL,
3596
- consultBaseURL = services.consultBaseURL,
3597
- vaultBaseURL = services.vaultBaseURL,
3598
- guardBaseURL = services.guardBaseURL,
3599
- searchBaseURL = services.searchBaseURL,
3600
- workflowBaseURL = services.workflowBaseURL,
3601
- diagnosisBaseURL = services.diagnosisBaseURL;
2717
+ practiceBaseURL = services.practiceBaseURL,
2718
+ consultBaseURL = services.consultBaseURL,
2719
+ vaultBaseURL = services.vaultBaseURL,
2720
+ guardBaseURL = services.guardBaseURL,
2721
+ searchBaseURL = services.searchBaseURL,
2722
+ workflowBaseURL = services.workflowBaseURL,
2723
+ diagnosisBaseURL = services.diagnosisBaseURL;
3602
2724
  var apiService = new APIService(useLocalStorage, undefined, authenticationCallback);
3603
2725
  return {
3604
2726
  apiService: apiService,