oro-sdk-apis 3.8.0-dev1.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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";
@@ -1629,11 +1041,12 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
1629
1041
  })(exports.DocumentType || (exports.DocumentType = {}));
1630
1042
 
1631
1043
  (function (InputApplyFunctions) {
1632
- InputApplyFunctions["MakeUpperCase"] = "MakeUpperCase";
1633
- InputApplyFunctions["MakeLowerCase"] = "MakeLowerCase";
1634
- InputApplyFunctions["RemoveAllSpaces"] = "RemoveAllSpaces";
1044
+ InputApplyFunctions["AllUpperCase"] = "AllUpperCase";
1045
+ InputApplyFunctions["AllLowerCase"] = "AllLowerCase";
1046
+ InputApplyFunctions["AllAlphabetical"] = "AllAlphabetical";
1047
+ InputApplyFunctions["AllAlphanumeric"] = "AllAlphanumeric";
1048
+ InputApplyFunctions["NoSpaces"] = "NoSpaces";
1635
1049
  })(exports.InputApplyFunctions || (exports.InputApplyFunctions = {}));
1636
-
1637
1050
  (function (MetadataCategory) {
1638
1051
  MetadataCategory["ChildPersonal"] = "ChildPersonal";
1639
1052
  MetadataCategory["Consultation"] = "Consultation";
@@ -1663,9 +1076,7 @@ var ConsultService = /*#__PURE__*/function () {
1663
1076
  this.api = api;
1664
1077
  this.baseURL = baseURL;
1665
1078
  }
1666
-
1667
1079
  var _proto = ConsultService.prototype;
1668
-
1669
1080
  _proto.consultCreate = function consultCreate(c) {
1670
1081
  return this.api.post(this.baseURL + "/v1/consults", c);
1671
1082
  }
@@ -1685,9 +1096,7 @@ var ConsultService = /*#__PURE__*/function () {
1685
1096
  * @param filterIsoLocality the of isoLocality to filter with
1686
1097
  * @param filterAssignee array of practitioner uuids with which you want to filter the consultations
1687
1098
  * @returns a number of consult
1688
- */
1689
- ;
1690
-
1099
+ */;
1691
1100
  _proto.countConsults = function countConsults(uuidPractice, uuidRequester, statusesMedical, statusesExclude, shortId, columnToSortTo, orderToSortTo, perPage, indexPage, filterAssignedDoctor, filterCurrentPractitioner, filterIsoLocality, filterAssignee, typesConsult, uuidParent) {
1692
1101
  return this.api.head(this.baseURL + "/v1/consults", {
1693
1102
  params: {
@@ -1711,11 +1120,9 @@ var ConsultService = /*#__PURE__*/function () {
1711
1120
  if (!resContentRange || typeof resContentRange !== 'string' && typeof resContentRange !== 'number') {
1712
1121
  return 0;
1713
1122
  }
1714
-
1715
1123
  if (typeof resContentRange === 'number') {
1716
1124
  return resContentRange;
1717
1125
  }
1718
-
1719
1126
  return parseInt(resContentRange);
1720
1127
  });
1721
1128
  }
@@ -1734,9 +1141,7 @@ var ConsultService = /*#__PURE__*/function () {
1734
1141
  * @param filterCurrentPractitioner the uuid of the current assistant assigned to filter with
1735
1142
  * @param filterIsoLocality the of isoLocality to filter with
1736
1143
  * @returns a list of consult
1737
- */
1738
- ;
1739
-
1144
+ */;
1740
1145
  _proto.getConsults = function getConsults(uuidPractice, uuidRequester, statusesMedical, statusesExclude, shortId, columnToSortTo, orderToSortTo, perPage, indexPage, filterAssignedDoctor, filterCurrentPractitioner, filterIsoLocality, filterAssignee, uuidParent, typesConsult) {
1741
1146
  return this.api.get(this.baseURL + "/v1/consults", {
1742
1147
  params: {
@@ -1758,7 +1163,6 @@ var ConsultService = /*#__PURE__*/function () {
1758
1163
  }
1759
1164
  });
1760
1165
  };
1761
-
1762
1166
  _proto.getConsultByUUID = function getConsultByUUID(uuidConsult, uuidPractice) {
1763
1167
  return this.api.get(this.baseURL + "/v1/consults/" + uuidConsult, {
1764
1168
  params: {
@@ -1766,7 +1170,6 @@ var ConsultService = /*#__PURE__*/function () {
1766
1170
  }
1767
1171
  });
1768
1172
  };
1769
-
1770
1173
  _proto.updateConsultByUUID = function updateConsultByUUID(uuidConsult, consult, uuidPractice, uuidRequester) {
1771
1174
  return this.api.put(this.baseURL + "/v1/consults/" + uuidConsult, consult, {
1772
1175
  params: {
@@ -1775,7 +1178,6 @@ var ConsultService = /*#__PURE__*/function () {
1775
1178
  }
1776
1179
  });
1777
1180
  };
1778
-
1779
1181
  _proto.getConsultFaxStatuses = function getConsultFaxStatuses(uuidConsult) {
1780
1182
  return this.api.get(this.baseURL + "/v1/consults/" + uuidConsult + "/transmissions", {
1781
1183
  params: {
@@ -1783,64 +1185,52 @@ var ConsultService = /*#__PURE__*/function () {
1783
1185
  }
1784
1186
  });
1785
1187
  };
1786
-
1787
- _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,
1788
1190
  // delay ?: number,
1789
1191
  ) {
1790
1192
  if (nameDriver === void 0) {
1791
1193
  nameDriver = 'Documo';
1792
1194
  }
1793
-
1794
1195
  var data = new FormData();
1795
1196
  data.append('nameDriverReceiver', nameDriver);
1796
-
1797
1197
  if (addressOrPhoneToSendTo) {
1798
1198
  data.append('addressReceiver', addressOrPhoneToSendTo);
1799
1199
  }
1800
-
1801
1200
  if (file) {
1802
1201
  data.append('file', file);
1803
1202
  }
1804
-
1805
1203
  if (nameReceiver) {
1806
1204
  data.append('nameReceiver', nameReceiver);
1807
1205
  }
1808
-
1809
1206
  if (txtTransmissionTitle) {
1810
1207
  data.append('txtTransmissionTitle', txtTransmissionTitle);
1811
1208
  }
1812
-
1813
1209
  if (txtTransmissionNotes) {
1814
1210
  data.append('txtTransmissionNotes', txtTransmissionNotes);
1815
1211
  }
1816
-
1817
1212
  return this.api.post(this.baseURL + "/v1/consults/" + uuidConsult + "/transmissions", data, {
1818
1213
  headers: {
1819
1214
  'Content-Type': 'multipart/form-data;'
1820
1215
  }
1821
1216
  });
1822
1217
  };
1823
-
1824
1218
  _proto.postConsultFax = function postConsultFax(uuidConsult, addressReceiver, file) {
1825
1219
  return this.postConsultTransmission(uuidConsult, 'Documo', addressReceiver, file);
1826
1220
  };
1827
-
1828
1221
  _proto.postConsultEmail = function postConsultEmail(uuidConsult, file) {
1829
1222
  return this.postConsultTransmission(uuidConsult, 'Pharmacierge', undefined, file);
1830
1223
  };
1831
-
1832
1224
  _proto.retryConsultFax = function retryConsultFax(uuidConsult, transmissionId) {
1833
1225
  return this.api.put(this.baseURL + "/v1/consults/" + uuidConsult + "/transmissions/" + transmissionId, {
1834
1226
  status: exports.TransmissionStatus.Retrying
1835
1227
  });
1836
1228
  };
1837
-
1838
1229
  _proto.updateConsultTransmissionStatus = function updateConsultTransmissionStatus(transmissionId, uuidConsult, newStatus) {
1839
1230
  return this.api.put(this.baseURL + "/v1/consults/" + uuidConsult + "/transmissions/" + transmissionId, {
1840
1231
  status: newStatus
1841
1232
  });
1842
1233
  };
1843
-
1844
1234
  return ConsultService;
1845
1235
  }();
1846
1236
 
@@ -1849,9 +1239,7 @@ var DiagnosisService = /*#__PURE__*/function () {
1849
1239
  this.api = api;
1850
1240
  this.baseURL = baseURL;
1851
1241
  }
1852
-
1853
1242
  var _proto = DiagnosisService.prototype;
1854
-
1855
1243
  _proto.getDiagnoses = function getDiagnoses() {
1856
1244
  return this.api.get(this.baseURL + "/v1/diagnoses");
1857
1245
  }
@@ -1859,21 +1247,16 @@ var DiagnosisService = /*#__PURE__*/function () {
1859
1247
  * Get a diagnosis by uuid that belongs to your practice
1860
1248
  * @param uuidDiagnosis the uuid of the diagnosis
1861
1249
  * @returns a diagnosis
1862
- */
1863
- ;
1864
-
1250
+ */;
1865
1251
  _proto.getDiagnosisByUuid = function getDiagnosisByUuid(uuidDiagnosis) {
1866
1252
  return this.api.get(this.baseURL + "/v1/diagnoses/" + uuidDiagnosis);
1867
1253
  };
1868
-
1869
1254
  _proto.createDiagnosis = function createDiagnosis(diagnosis) {
1870
1255
  return this.api.post(this.baseURL + "/v1/diagnoses", diagnosis);
1871
1256
  };
1872
-
1873
1257
  _proto.updateDiagnosis = function updateDiagnosis(uuid, diagnosis) {
1874
1258
  return this.api.put(this.baseURL + "/v1/diagnoses/" + uuid, diagnosis);
1875
1259
  };
1876
-
1877
1260
  _proto.getTreatmentsFromDiagnosisUuid = function getTreatmentsFromDiagnosisUuid(diagnosisUuid) {
1878
1261
  return this.api.get(this.baseURL + "/v1/diagnoses/" + diagnosisUuid + "/treatments");
1879
1262
  }
@@ -1881,9 +1264,7 @@ var DiagnosisService = /*#__PURE__*/function () {
1881
1264
  * This function returns treatment plans associated to a consult
1882
1265
  * @param uuidConsult the consult uuid to fetch
1883
1266
  * @returns an array of TreatmentPlan
1884
- */
1885
- ;
1886
-
1267
+ */;
1887
1268
  _proto.getTreatmentPlansFromConsultUuid = function getTreatmentPlansFromConsultUuid(uuidConsult) {
1888
1269
  return this.api.get(this.baseURL + "/v1/treatment-plans/", {
1889
1270
  params: {
@@ -1895,9 +1276,7 @@ var DiagnosisService = /*#__PURE__*/function () {
1895
1276
  * creates a new treatment for the specified diagnosis
1896
1277
  * @param diagnosisUuid uuid of the diagnosis that the treatment is linked to
1897
1278
  * @param treatmentRequest the treatment to be inserted
1898
- */
1899
- ;
1900
-
1279
+ */;
1901
1280
  _proto.createTreatment = function createTreatment(diagnosisUuid, treatmentRequest) {
1902
1281
  return this.api.post(this.baseURL + "/v1/diagnoses/" + diagnosisUuid + "/treatments", treatmentRequest);
1903
1282
  }
@@ -1905,9 +1284,7 @@ var DiagnosisService = /*#__PURE__*/function () {
1905
1284
  * This function returns populated treatment plans associated to a consult
1906
1285
  * @param uuidConsult the consult uuid to fetch
1907
1286
  * @returns a TreatmentPlans object
1908
- */
1909
- ;
1910
-
1287
+ */;
1911
1288
  _proto.getTreatmentPlansPopulatedFromConsultUuid = function getTreatmentPlansPopulatedFromConsultUuid(uuidConsult) {
1912
1289
  return this.api.get(this.baseURL + "/v1/treatment-plans/", {
1913
1290
  params: {
@@ -1916,11 +1293,9 @@ var DiagnosisService = /*#__PURE__*/function () {
1916
1293
  }
1917
1294
  });
1918
1295
  };
1919
-
1920
1296
  _proto.postPlans = function postPlans(plans) {
1921
1297
  return this.api.post(this.baseURL + "/v1/treatment-plans", plans);
1922
1298
  };
1923
-
1924
1299
  _proto.updateTreatmentPlan = function updateTreatmentPlan(uuidPlan, uuidConsult, diagnosisRequest, plan, refill) {
1925
1300
  return this.api.put(this.baseURL + "/v1/treatment-plans/" + uuidPlan, {
1926
1301
  uuidConsult: uuidConsult,
@@ -1929,7 +1304,6 @@ var DiagnosisService = /*#__PURE__*/function () {
1929
1304
  refill: refill
1930
1305
  });
1931
1306
  };
1932
-
1933
1307
  _proto.acceptTreatmentPlan = function acceptTreatmentPlan(uuidPlan, uuidConsult) {
1934
1308
  return this.api.put(this.baseURL + "/v1/treatment-plans/" + uuidPlan + "/accept", {
1935
1309
  uuidConsult: uuidConsult
@@ -1938,34 +1312,27 @@ var DiagnosisService = /*#__PURE__*/function () {
1938
1312
  /**
1939
1313
  * retrieves all the drugs of the specified practice
1940
1314
  * @param uuidPractice
1941
- */
1942
- ;
1943
-
1315
+ */;
1944
1316
  _proto.getAllDrugs =
1945
1317
  /*#__PURE__*/
1946
1318
  function () {
1947
- var _getAllDrugs = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(uuidPractice) {
1319
+ var _getAllDrugs = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(uuidPractice) {
1948
1320
  var res;
1949
- return runtime_1.wrap(function _callee$(_context) {
1321
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1950
1322
  while (1) {
1951
1323
  switch (_context.prev = _context.next) {
1952
1324
  case 0:
1953
1325
  _context.next = 2;
1954
1326
  return this.api.get(this.baseURL + "/v1/drugs/practice/" + uuidPractice);
1955
-
1956
1327
  case 2:
1957
1328
  res = _context.sent;
1958
-
1959
1329
  if (!(res && res.foundDrugs)) {
1960
1330
  _context.next = 5;
1961
1331
  break;
1962
1332
  }
1963
-
1964
1333
  return _context.abrupt("return", res.foundDrugs);
1965
-
1966
1334
  case 5:
1967
1335
  return _context.abrupt("return", undefined);
1968
-
1969
1336
  case 6:
1970
1337
  case "end":
1971
1338
  return _context.stop();
@@ -1973,14 +1340,11 @@ var DiagnosisService = /*#__PURE__*/function () {
1973
1340
  }
1974
1341
  }, _callee, this);
1975
1342
  }));
1976
-
1977
1343
  function getAllDrugs(_x) {
1978
1344
  return _getAllDrugs.apply(this, arguments);
1979
1345
  }
1980
-
1981
1346
  return getAllDrugs;
1982
1347
  }();
1983
-
1984
1348
  return DiagnosisService;
1985
1349
  }();
1986
1350
 
@@ -1989,7 +1353,6 @@ var GuardService = /*#__PURE__*/function () {
1989
1353
  this.api = api;
1990
1354
  this.baseURL = baseURL;
1991
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
1992
-
1993
1356
  this.identityCache = {};
1994
1357
  this.whoAmICache = {};
1995
1358
  }
@@ -2004,10 +1367,7 @@ var GuardService = /*#__PURE__*/function () {
2004
1367
  * ```
2005
1368
  * @param tokens
2006
1369
  */
2007
-
2008
-
2009
1370
  var _proto = GuardService.prototype;
2010
-
2011
1371
  _proto.setTokens = function setTokens(tokens) {
2012
1372
  this.api.setTokens(_extends({}, this.api.getTokens(), tokens));
2013
1373
  }
@@ -2016,16 +1376,13 @@ var GuardService = /*#__PURE__*/function () {
2016
1376
  *
2017
1377
  * @param req The credentials required to get an access token
2018
1378
  * @returns AuthTokenResponse
2019
- */
2020
- ;
2021
-
1379
+ */;
2022
1380
  _proto.m2mToken =
2023
1381
  /*#__PURE__*/
2024
1382
  function () {
2025
- var _m2mToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(req) {
1383
+ var _m2mToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(req) {
2026
1384
  var resp, config, _e$response, code;
2027
-
2028
- return runtime_1.wrap(function _callee$(_context) {
1385
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
2029
1386
  while (1) {
2030
1387
  switch (_context.prev = _context.next) {
2031
1388
  case 0:
@@ -2035,7 +1392,6 @@ var GuardService = /*#__PURE__*/function () {
2035
1392
  };
2036
1393
  _context.next = 4;
2037
1394
  return this.api.post(this.baseURL + "/v1/m2m/token", req, config);
2038
-
2039
1395
  case 4:
2040
1396
  resp = _context.sent;
2041
1397
  this.api.setTokens({
@@ -2043,37 +1399,28 @@ var GuardService = /*#__PURE__*/function () {
2043
1399
  });
2044
1400
  _context.next = 20;
2045
1401
  break;
2046
-
2047
1402
  case 8:
2048
1403
  _context.prev = 8;
2049
1404
  _context.t0 = _context["catch"](0);
2050
1405
  console.error('Error while posting m2m token:', _context.t0);
2051
-
2052
1406
  if (!_context.t0.isAxiosError) {
2053
1407
  _context.next = 19;
2054
1408
  break;
2055
1409
  }
2056
-
2057
1410
  code = (_e$response = _context.t0.response) == null ? void 0 : _e$response.status;
2058
1411
  _context.t1 = code;
2059
1412
  _context.next = _context.t1 === 400 ? 16 : _context.t1 === 500 ? 17 : _context.t1 === 401 ? 18 : 18;
2060
1413
  break;
2061
-
2062
1414
  case 16:
2063
1415
  throw new AuthenticationBadRequest();
2064
-
2065
1416
  case 17:
2066
1417
  throw new AuthenticationServerError();
2067
-
2068
1418
  case 18:
2069
1419
  throw new AuthenticationFailed();
2070
-
2071
1420
  case 19:
2072
1421
  throw new AuthenticationFailed();
2073
-
2074
1422
  case 20:
2075
1423
  return _context.abrupt("return", resp);
2076
-
2077
1424
  case 21:
2078
1425
  case "end":
2079
1426
  return _context.stop();
@@ -2081,11 +1428,9 @@ var GuardService = /*#__PURE__*/function () {
2081
1428
  }
2082
1429
  }, _callee, this, [[0, 8]]);
2083
1430
  }));
2084
-
2085
1431
  function m2mToken(_x) {
2086
1432
  return _m2mToken.apply(this, arguments);
2087
1433
  }
2088
-
2089
1434
  return m2mToken;
2090
1435
  }()
2091
1436
  /**
@@ -2096,14 +1441,12 @@ var GuardService = /*#__PURE__*/function () {
2096
1441
  * @returns AuthTokenResponse
2097
1442
  */
2098
1443
  ;
2099
-
2100
1444
  _proto.authToken =
2101
1445
  /*#__PURE__*/
2102
1446
  function () {
2103
- var _authToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(req) {
1447
+ var _authToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(req) {
2104
1448
  var resp, config, _e$response2, code;
2105
-
2106
- return runtime_1.wrap(function _callee2$(_context2) {
1449
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2107
1450
  while (1) {
2108
1451
  switch (_context2.prev = _context2.next) {
2109
1452
  case 0:
@@ -2113,7 +1456,6 @@ var GuardService = /*#__PURE__*/function () {
2113
1456
  };
2114
1457
  _context2.next = 4;
2115
1458
  return this.api.post(this.baseURL + "/v1/auth/token", req, config);
2116
-
2117
1459
  case 4:
2118
1460
  resp = _context2.sent;
2119
1461
  this.api.setTokens({
@@ -2122,40 +1464,30 @@ var GuardService = /*#__PURE__*/function () {
2122
1464
  });
2123
1465
  _context2.next = 21;
2124
1466
  break;
2125
-
2126
1467
  case 8:
2127
1468
  _context2.prev = 8;
2128
1469
  _context2.t0 = _context2["catch"](0);
2129
1470
  console.error('Error while posting auth token:', _context2.t0);
2130
-
2131
1471
  if (!_context2.t0.isAxiosError) {
2132
1472
  _context2.next = 20;
2133
1473
  break;
2134
1474
  }
2135
-
2136
1475
  code = (_e$response2 = _context2.t0.response) == null ? void 0 : _e$response2.status;
2137
1476
  _context2.t1 = code;
2138
1477
  _context2.next = _context2.t1 === 400 ? 16 : _context2.t1 === 424 ? 17 : _context2.t1 === 500 ? 18 : _context2.t1 === 401 ? 19 : 19;
2139
1478
  break;
2140
-
2141
1479
  case 16:
2142
1480
  throw new AuthenticationBadRequest();
2143
-
2144
1481
  case 17:
2145
1482
  throw new AuthenticationUnconfirmedEmail();
2146
-
2147
1483
  case 18:
2148
1484
  throw new AuthenticationServerError();
2149
-
2150
1485
  case 19:
2151
1486
  throw new AuthenticationFailed();
2152
-
2153
1487
  case 20:
2154
1488
  throw new AuthenticationFailed();
2155
-
2156
1489
  case 21:
2157
1490
  return _context2.abrupt("return", resp);
2158
-
2159
1491
  case 22:
2160
1492
  case "end":
2161
1493
  return _context2.stop();
@@ -2163,11 +1495,9 @@ var GuardService = /*#__PURE__*/function () {
2163
1495
  }
2164
1496
  }, _callee2, this, [[0, 8]]);
2165
1497
  }));
2166
-
2167
1498
  function authToken(_x2) {
2168
1499
  return _authToken.apply(this, arguments);
2169
1500
  }
2170
-
2171
1501
  return authToken;
2172
1502
  }()
2173
1503
  /**
@@ -2176,13 +1506,12 @@ var GuardService = /*#__PURE__*/function () {
2176
1506
  * @returns AuthTokenResponse
2177
1507
  */
2178
1508
  ;
2179
-
2180
1509
  _proto.authRefresh =
2181
1510
  /*#__PURE__*/
2182
1511
  function () {
2183
- var _authRefresh = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(refreshToken) {
1512
+ var _authRefresh = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(refreshToken) {
2184
1513
  var config;
2185
- return runtime_1.wrap(function _callee3$(_context3) {
1514
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
2186
1515
  while (1) {
2187
1516
  switch (_context3.prev = _context3.next) {
2188
1517
  case 0:
@@ -2191,7 +1520,6 @@ var GuardService = /*#__PURE__*/function () {
2191
1520
  useRefreshToken: true
2192
1521
  };
2193
1522
  return _context3.abrupt("return", this.api.put(this.baseURL + "/v1/auth/token", null, config));
2194
-
2195
1523
  case 2:
2196
1524
  case "end":
2197
1525
  return _context3.stop();
@@ -2199,11 +1527,9 @@ var GuardService = /*#__PURE__*/function () {
2199
1527
  }
2200
1528
  }, _callee3, this);
2201
1529
  }));
2202
-
2203
1530
  function authRefresh(_x3) {
2204
1531
  return _authRefresh.apply(this, arguments);
2205
1532
  }
2206
-
2207
1533
  return authRefresh;
2208
1534
  }()
2209
1535
  /**
@@ -2212,17 +1538,15 @@ var GuardService = /*#__PURE__*/function () {
2212
1538
  * @returns void
2213
1539
  */
2214
1540
  ;
2215
-
2216
1541
  _proto.authLogout =
2217
1542
  /*#__PURE__*/
2218
1543
  function () {
2219
- var _authLogout = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4() {
2220
- return runtime_1.wrap(function _callee4$(_context4) {
1544
+ var _authLogout = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
1545
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
2221
1546
  while (1) {
2222
1547
  switch (_context4.prev = _context4.next) {
2223
1548
  case 0:
2224
1549
  return _context4.abrupt("return", this.api.get(this.baseURL + "/v1/auth/logout"));
2225
-
2226
1550
  case 1:
2227
1551
  case "end":
2228
1552
  return _context4.stop();
@@ -2230,11 +1554,9 @@ var GuardService = /*#__PURE__*/function () {
2230
1554
  }
2231
1555
  }, _callee4, this);
2232
1556
  }));
2233
-
2234
1557
  function authLogout() {
2235
1558
  return _authLogout.apply(this, arguments);
2236
1559
  }
2237
-
2238
1560
  return authLogout;
2239
1561
  }()
2240
1562
  /**
@@ -2244,17 +1566,15 @@ var GuardService = /*#__PURE__*/function () {
2244
1566
  * @returns void
2245
1567
  */
2246
1568
  ;
2247
-
2248
1569
  _proto.authRecover =
2249
1570
  /*#__PURE__*/
2250
1571
  function () {
2251
- var _authRecover = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(req) {
2252
- 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) {
2253
1574
  while (1) {
2254
1575
  switch (_context5.prev = _context5.next) {
2255
1576
  case 0:
2256
1577
  return _context5.abrupt("return", this.api.post(this.baseURL + "/v1/auth/recover", req));
2257
-
2258
1578
  case 1:
2259
1579
  case "end":
2260
1580
  return _context5.stop();
@@ -2262,11 +1582,9 @@ var GuardService = /*#__PURE__*/function () {
2262
1582
  }
2263
1583
  }, _callee5, this);
2264
1584
  }));
2265
-
2266
1585
  function authRecover(_x4) {
2267
1586
  return _authRecover.apply(this, arguments);
2268
1587
  }
2269
-
2270
1588
  return authRecover;
2271
1589
  }()
2272
1590
  /**
@@ -2277,21 +1595,18 @@ var GuardService = /*#__PURE__*/function () {
2277
1595
  * @returns IdentityResponse
2278
1596
  */
2279
1597
  ;
2280
-
2281
1598
  _proto.identityCreate =
2282
1599
  /*#__PURE__*/
2283
1600
  function () {
2284
- var _identityCreate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(req) {
1601
+ var _identityCreate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(req) {
2285
1602
  var resp, _e$response3, code;
2286
-
2287
- return runtime_1.wrap(function _callee6$(_context6) {
1603
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
2288
1604
  while (1) {
2289
1605
  switch (_context6.prev = _context6.next) {
2290
1606
  case 0:
2291
1607
  _context6.prev = 0;
2292
1608
  _context6.next = 3;
2293
1609
  return this.api.post(this.baseURL + "/v1/identities", req);
2294
-
2295
1610
  case 3:
2296
1611
  resp = _context6.sent;
2297
1612
  this.api.setTokens({
@@ -2299,36 +1614,27 @@ var GuardService = /*#__PURE__*/function () {
2299
1614
  });
2300
1615
  _context6.next = 18;
2301
1616
  break;
2302
-
2303
1617
  case 7:
2304
1618
  _context6.prev = 7;
2305
1619
  _context6.t0 = _context6["catch"](0);
2306
-
2307
1620
  if (!_context6.t0.isAxiosError) {
2308
1621
  _context6.next = 17;
2309
1622
  break;
2310
1623
  }
2311
-
2312
1624
  code = (_e$response3 = _context6.t0.response) == null ? void 0 : _e$response3.status;
2313
1625
  _context6.t1 = code;
2314
1626
  _context6.next = _context6.t1 === 400 ? 14 : _context6.t1 === 409 ? 15 : _context6.t1 === 500 ? 16 : 16;
2315
1627
  break;
2316
-
2317
1628
  case 14:
2318
1629
  throw new IdentityCreationBadRequest();
2319
-
2320
1630
  case 15:
2321
1631
  throw new IdentityCreationConflict();
2322
-
2323
1632
  case 16:
2324
1633
  throw new IdentityCreationFailed();
2325
-
2326
1634
  case 17:
2327
1635
  throw new IdentityCreationFailed();
2328
-
2329
1636
  case 18:
2330
1637
  return _context6.abrupt("return", resp);
2331
-
2332
1638
  case 19:
2333
1639
  case "end":
2334
1640
  return _context6.stop();
@@ -2336,11 +1642,9 @@ var GuardService = /*#__PURE__*/function () {
2336
1642
  }
2337
1643
  }, _callee6, this, [[0, 7]]);
2338
1644
  }));
2339
-
2340
1645
  function identityCreate(_x5) {
2341
1646
  return _identityCreate.apply(this, arguments);
2342
1647
  }
2343
-
2344
1648
  return identityCreate;
2345
1649
  }()
2346
1650
  /**
@@ -2352,49 +1656,38 @@ var GuardService = /*#__PURE__*/function () {
2352
1656
  * @returns IdentityResponse
2353
1657
  */
2354
1658
  ;
2355
-
2356
1659
  _proto.identityGet =
2357
1660
  /*#__PURE__*/
2358
1661
  function () {
2359
- var _identityGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(identityID, skipCache) {
1662
+ var _identityGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(identityID, skipCache) {
2360
1663
  var _tokens$accessToken, _tokens$refreshToken;
2361
-
2362
1664
  var tokens, cacheKey, identity;
2363
- return runtime_1.wrap(function _callee7$(_context7) {
1665
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
2364
1666
  while (1) {
2365
1667
  switch (_context7.prev = _context7.next) {
2366
1668
  case 0:
2367
1669
  if (skipCache === void 0) {
2368
1670
  skipCache = false;
2369
1671
  }
2370
-
2371
1672
  tokens = this.api.getTokens();
2372
1673
  cacheKey = ((_tokens$accessToken = tokens.accessToken) != null ? _tokens$accessToken : '') + ((_tokens$refreshToken = tokens.refreshToken) != null ? _tokens$refreshToken : '') + identityID;
2373
-
2374
1674
  if (!(skipCache || !tokens.accessToken || !this.identityCache[cacheKey])) {
2375
1675
  _context7.next = 10;
2376
1676
  break;
2377
1677
  }
2378
-
2379
1678
  _context7.next = 6;
2380
1679
  return this.api.get(this.baseURL + "/v1/identities/" + identityID);
2381
-
2382
1680
  case 6:
2383
1681
  identity = _context7.sent;
2384
-
2385
1682
  if (!skipCache) {
2386
1683
  _context7.next = 9;
2387
1684
  break;
2388
1685
  }
2389
-
2390
1686
  return _context7.abrupt("return", identity);
2391
-
2392
1687
  case 9:
2393
1688
  this.identityCache[cacheKey] = identity;
2394
-
2395
1689
  case 10:
2396
1690
  return _context7.abrupt("return", this.identityCache[cacheKey]);
2397
-
2398
1691
  case 11:
2399
1692
  case "end":
2400
1693
  return _context7.stop();
@@ -2402,11 +1695,9 @@ var GuardService = /*#__PURE__*/function () {
2402
1695
  }
2403
1696
  }, _callee7, this);
2404
1697
  }));
2405
-
2406
1698
  function identityGet(_x6, _x7) {
2407
1699
  return _identityGet.apply(this, arguments);
2408
1700
  }
2409
-
2410
1701
  return identityGet;
2411
1702
  }()
2412
1703
  /**
@@ -2416,38 +1707,30 @@ var GuardService = /*#__PURE__*/function () {
2416
1707
  * @returns WhoAmIResponse
2417
1708
  */
2418
1709
  ;
2419
-
2420
1710
  _proto.whoAmI =
2421
1711
  /*#__PURE__*/
2422
1712
  function () {
2423
- var _whoAmI = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(refreshCache) {
1713
+ var _whoAmI = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(refreshCache) {
2424
1714
  var _this$api$getTokens$a;
2425
-
2426
1715
  var cacheKey;
2427
- return runtime_1.wrap(function _callee8$(_context8) {
1716
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
2428
1717
  while (1) {
2429
1718
  switch (_context8.prev = _context8.next) {
2430
1719
  case 0:
2431
1720
  if (refreshCache === void 0) {
2432
1721
  refreshCache = false;
2433
1722
  }
2434
-
2435
1723
  cacheKey = (_this$api$getTokens$a = this.api.getTokens().accessToken) != null ? _this$api$getTokens$a : '';
2436
-
2437
1724
  if (!(!this.whoAmICache[cacheKey] || refreshCache)) {
2438
1725
  _context8.next = 6;
2439
1726
  break;
2440
1727
  }
2441
-
2442
1728
  _context8.next = 5;
2443
1729
  return this.api.get(this.baseURL + "/v1/auth/whoami");
2444
-
2445
1730
  case 5:
2446
1731
  this.whoAmICache[cacheKey] = _context8.sent;
2447
-
2448
1732
  case 6:
2449
1733
  return _context8.abrupt("return", this.whoAmICache[cacheKey]);
2450
-
2451
1734
  case 7:
2452
1735
  case "end":
2453
1736
  return _context8.stop();
@@ -2455,11 +1738,9 @@ var GuardService = /*#__PURE__*/function () {
2455
1738
  }
2456
1739
  }, _callee8, this);
2457
1740
  }));
2458
-
2459
1741
  function whoAmI(_x8) {
2460
1742
  return _whoAmI.apply(this, arguments);
2461
1743
  }
2462
-
2463
1744
  return whoAmI;
2464
1745
  }()
2465
1746
  /**
@@ -2470,17 +1751,15 @@ var GuardService = /*#__PURE__*/function () {
2470
1751
  * @returns IdentityResponse
2471
1752
  */
2472
1753
  ;
2473
-
2474
1754
  _proto.identityUpdate =
2475
1755
  /*#__PURE__*/
2476
1756
  function () {
2477
- var _identityUpdate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9(identityID, req) {
2478
- 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) {
2479
1759
  while (1) {
2480
1760
  switch (_context9.prev = _context9.next) {
2481
1761
  case 0:
2482
1762
  return _context9.abrupt("return", this.api.put(this.baseURL + "/v1/identities/" + identityID, req));
2483
-
2484
1763
  case 1:
2485
1764
  case "end":
2486
1765
  return _context9.stop();
@@ -2488,11 +1767,9 @@ var GuardService = /*#__PURE__*/function () {
2488
1767
  }
2489
1768
  }, _callee9, this);
2490
1769
  }));
2491
-
2492
1770
  function identityUpdate(_x9, _x10) {
2493
1771
  return _identityUpdate.apply(this, arguments);
2494
1772
  }
2495
-
2496
1773
  return identityUpdate;
2497
1774
  }()
2498
1775
  /**
@@ -2504,13 +1781,12 @@ var GuardService = /*#__PURE__*/function () {
2504
1781
  * @returns QRCodeResponse
2505
1782
  */
2506
1783
  ;
2507
-
2508
1784
  _proto.identityMFAQRCode =
2509
1785
  /*#__PURE__*/
2510
1786
  function () {
2511
- var _identityMFAQRCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10(identityID, password) {
1787
+ var _identityMFAQRCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(identityID, password) {
2512
1788
  var req;
2513
- return runtime_1.wrap(function _callee10$(_context10) {
1789
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
2514
1790
  while (1) {
2515
1791
  switch (_context10.prev = _context10.next) {
2516
1792
  case 0:
@@ -2522,7 +1798,6 @@ var GuardService = /*#__PURE__*/function () {
2522
1798
  Accept: 'application/json'
2523
1799
  }
2524
1800
  }));
2525
-
2526
1801
  case 2:
2527
1802
  case "end":
2528
1803
  return _context10.stop();
@@ -2530,11 +1805,9 @@ var GuardService = /*#__PURE__*/function () {
2530
1805
  }
2531
1806
  }, _callee10, this);
2532
1807
  }));
2533
-
2534
1808
  function identityMFAQRCode(_x11, _x12) {
2535
1809
  return _identityMFAQRCode.apply(this, arguments);
2536
1810
  }
2537
-
2538
1811
  return identityMFAQRCode;
2539
1812
  }()
2540
1813
  /**
@@ -2544,17 +1817,15 @@ var GuardService = /*#__PURE__*/function () {
2544
1817
  * @return void
2545
1818
  */
2546
1819
  ;
2547
-
2548
1820
  _proto.identitySendConfirmEmail =
2549
1821
  /*#__PURE__*/
2550
1822
  function () {
2551
- var _identitySendConfirmEmail = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11(req) {
2552
- 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) {
2553
1825
  while (1) {
2554
1826
  switch (_context11.prev = _context11.next) {
2555
1827
  case 0:
2556
1828
  return _context11.abrupt("return", this.api.post(this.baseURL + "/v1/identity/confirm", req));
2557
-
2558
1829
  case 1:
2559
1830
  case "end":
2560
1831
  return _context11.stop();
@@ -2562,11 +1833,9 @@ var GuardService = /*#__PURE__*/function () {
2562
1833
  }
2563
1834
  }, _callee11, this);
2564
1835
  }));
2565
-
2566
1836
  function identitySendConfirmEmail(_x13) {
2567
1837
  return _identitySendConfirmEmail.apply(this, arguments);
2568
1838
  }
2569
-
2570
1839
  return identitySendConfirmEmail;
2571
1840
  }()
2572
1841
  /**
@@ -2576,17 +1845,15 @@ var GuardService = /*#__PURE__*/function () {
2576
1845
  * @returns IdentityResponse
2577
1846
  */
2578
1847
  ;
2579
-
2580
1848
  _proto.identityGetByCustomerEmail =
2581
1849
  /*#__PURE__*/
2582
1850
  function () {
2583
- var _identityGetByCustomerEmail = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee12(email) {
2584
- 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) {
2585
1853
  while (1) {
2586
1854
  switch (_context12.prev = _context12.next) {
2587
1855
  case 0:
2588
1856
  return _context12.abrupt("return", this.identityGetByHash(email.substring(email.indexOf('+') + 1, email.indexOf('@'))));
2589
-
2590
1857
  case 1:
2591
1858
  case "end":
2592
1859
  return _context12.stop();
@@ -2594,11 +1861,9 @@ var GuardService = /*#__PURE__*/function () {
2594
1861
  }
2595
1862
  }, _callee12, this);
2596
1863
  }));
2597
-
2598
1864
  function identityGetByCustomerEmail(_x14) {
2599
1865
  return _identityGetByCustomerEmail.apply(this, arguments);
2600
1866
  }
2601
-
2602
1867
  return identityGetByCustomerEmail;
2603
1868
  }()
2604
1869
  /**
@@ -2608,17 +1873,15 @@ var GuardService = /*#__PURE__*/function () {
2608
1873
  * @returns IdentityResponse
2609
1874
  */
2610
1875
  ;
2611
-
2612
1876
  _proto.identityGetByHash =
2613
1877
  /*#__PURE__*/
2614
1878
  function () {
2615
- var _identityGetByHash = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee13(b64Hash) {
2616
- 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) {
2617
1881
  while (1) {
2618
1882
  switch (_context13.prev = _context13.next) {
2619
1883
  case 0:
2620
1884
  return _context13.abrupt("return", this.identityGet(b64Hash.replace(/\+/g, '-').replace(/\//g, '_')));
2621
-
2622
1885
  case 1:
2623
1886
  case "end":
2624
1887
  return _context13.stop();
@@ -2626,14 +1889,11 @@ var GuardService = /*#__PURE__*/function () {
2626
1889
  }
2627
1890
  }, _callee13, this);
2628
1891
  }));
2629
-
2630
1892
  function identityGetByHash(_x15) {
2631
1893
  return _identityGetByHash.apply(this, arguments);
2632
1894
  }
2633
-
2634
1895
  return identityGetByHash;
2635
1896
  }();
2636
-
2637
1897
  return GuardService;
2638
1898
  }();
2639
1899
 
@@ -2647,10 +1907,7 @@ var SearchService = /*#__PURE__*/function () {
2647
1907
  * @param consultUUID
2648
1908
  * @param terms the search terms to be indexed
2649
1909
  */
2650
-
2651
-
2652
1910
  var _proto = SearchService.prototype;
2653
-
2654
1911
  _proto.index = function index(consultUUID, terms) {
2655
1912
  return this.api.post(this.baseURL + "/v1/index", {
2656
1913
  consultUUID: consultUUID,
@@ -2660,15 +1917,12 @@ var SearchService = /*#__PURE__*/function () {
2660
1917
  /**
2661
1918
  * Searches for the consultations corresponding to the search terms entered in the query
2662
1919
  * @param terms array of search terms
2663
- */
2664
- ;
2665
-
1920
+ */;
2666
1921
  _proto.search = function search(terms) {
2667
1922
  return this.api.post(this.baseURL + "/v1/search", {
2668
1923
  terms: terms
2669
1924
  });
2670
1925
  };
2671
-
2672
1926
  return SearchService;
2673
1927
  }();
2674
1928
 
@@ -2682,10 +1936,7 @@ var PracticeService = /*#__PURE__*/function () {
2682
1936
  * an M2M with the scope `practice.practices.get`
2683
1937
  * @returns an array of practices
2684
1938
  */
2685
-
2686
-
2687
1939
  var _proto = PracticeService.prototype;
2688
-
2689
1940
  _proto.practiceGetAll = function practiceGetAll() {
2690
1941
  return this.api.get(this.baseURL + "/v1/practices");
2691
1942
  }
@@ -2696,9 +1947,7 @@ var PracticeService = /*#__PURE__*/function () {
2696
1947
  * @param hydratePracticeConfigs (optional) if set true it the Practice field configs will be set
2697
1948
  * @param accounts (optional) if set true it the Practice field accounts will be set
2698
1949
  * @returns the found practice or undefined
2699
- */
2700
- ;
2701
-
1950
+ */;
2702
1951
  _proto.practiceGetFromURL = function practiceGetFromURL(practiceURL, params) {
2703
1952
  return this.api.get(this.baseURL + "/v1/practices", {
2704
1953
  params: _extends({
@@ -2706,7 +1955,6 @@ var PracticeService = /*#__PURE__*/function () {
2706
1955
  }, params)
2707
1956
  });
2708
1957
  };
2709
-
2710
1958
  _proto.practiceGetFromUuid = function practiceGetFromUuid(practiceUuid, locale, withAccounts) {
2711
1959
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid, {
2712
1960
  params: {
@@ -2714,15 +1962,13 @@ var PracticeService = /*#__PURE__*/function () {
2714
1962
  accounts: withAccounts
2715
1963
  }
2716
1964
  });
2717
- } /// Practice Configs
2718
-
1965
+ }
1966
+ /// Practice Configs
2719
1967
  /**
2720
1968
  * This function retrieves all configs of a specific practice
2721
1969
  * @param practiceUuid uuid of the practice
2722
1970
  * @returns the practice configs
2723
- */
2724
- ;
2725
-
1971
+ */;
2726
1972
  _proto.practiceConfigGetFromPracticeUuid = function practiceConfigGetFromPracticeUuid(practiceUuid) {
2727
1973
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/configs");
2728
1974
  }
@@ -2731,9 +1977,7 @@ var PracticeService = /*#__PURE__*/function () {
2731
1977
  * @param practiceUuid uuid of the practice
2732
1978
  * @param kind of the config
2733
1979
  * @returns the practice config
2734
- */
2735
- ;
2736
-
1980
+ */;
2737
1981
  _proto.practiceConfigGetByKindForPracticeUuid = function practiceConfigGetByKindForPracticeUuid(practiceUuid, kind) {
2738
1982
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/configs/" + kind);
2739
1983
  }
@@ -2742,9 +1986,7 @@ var PracticeService = /*#__PURE__*/function () {
2742
1986
  * @param practiceUuid uuid of the practice
2743
1987
  * @param config the config to add to the practice
2744
1988
  * @returns the created practice config
2745
- */
2746
- ;
2747
-
1989
+ */;
2748
1990
  _proto.practiceConfigCreateForPracticeUuid = function practiceConfigCreateForPracticeUuid(practiceUuid, config) {
2749
1991
  return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/configs", config);
2750
1992
  }
@@ -2753,18 +1995,15 @@ var PracticeService = /*#__PURE__*/function () {
2753
1995
  * @param practiceUuid uuid of the practice
2754
1996
  * @param config the config to update
2755
1997
  * @returns the practice config
2756
- */
2757
- ;
2758
-
1998
+ */;
2759
1999
  _proto.practiceConfigUpdate = function practiceConfigUpdate(config) {
2760
2000
  return this.api.put(this.baseURL + "/v1/practices/" + config.uuidPractice + "/configs/" + config.kind, config);
2761
- } /// Accounts
2001
+ }
2002
+ /// Accounts
2762
2003
  ;
2763
-
2764
2004
  _proto.practiceGetAccounts = function practiceGetAccounts(practiceUuid) {
2765
2005
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/accounts");
2766
2006
  };
2767
-
2768
2007
  _proto.practiceGetAccount = function practiceGetAccount(practiceUuid, accountUuid) {
2769
2008
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/accounts/" + accountUuid);
2770
2009
  }
@@ -2773,9 +2012,7 @@ var PracticeService = /*#__PURE__*/function () {
2773
2012
  * @param practiceUuid the uuid of the practice
2774
2013
  * @param kind (optional) the kind of WorkflowType to filter in
2775
2014
  * @returns a list of PracticeWorkflow
2776
- */
2777
- ;
2778
-
2015
+ */;
2779
2016
  _proto.practiceGetWorkflows = function practiceGetWorkflows(practiceUuid, kind) {
2780
2017
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/workflows", {
2781
2018
  params: {
@@ -2783,12 +2020,11 @@ var PracticeService = /*#__PURE__*/function () {
2783
2020
  }
2784
2021
  });
2785
2022
  };
2786
-
2787
2023
  _proto.practiceGetWorkflow = function practiceGetWorkflow(practiceUuid, workflowType) {
2788
2024
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/workflows/" + workflowType);
2789
- } /// Plans
2025
+ }
2026
+ /// Plans
2790
2027
  ;
2791
-
2792
2028
  _proto.practiceGetPlans = function practiceGetPlans(practiceUuid, planType) {
2793
2029
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/plans", {
2794
2030
  params: {
@@ -2796,16 +2032,14 @@ var PracticeService = /*#__PURE__*/function () {
2796
2032
  }
2797
2033
  });
2798
2034
  };
2799
-
2800
2035
  _proto.practiceGetPlan = function practiceGetPlan(practiceUuid, planId) {
2801
2036
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/plans/" + planId);
2802
2037
  };
2803
-
2804
2038
  _proto.practiceGetPlanPrices = function practiceGetPlanPrices(practiceUuid, planId) {
2805
2039
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/plans/" + planId + "/prices");
2806
- } // Payments
2040
+ }
2041
+ // Payments
2807
2042
  ;
2808
-
2809
2043
  _proto.practiceGetPayments = function practiceGetPayments(practiceUuid, statusPayment, withConsultUUIDNULL, perPage, indexPage) {
2810
2044
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments", {
2811
2045
  params: {
@@ -2816,16 +2050,14 @@ var PracticeService = /*#__PURE__*/function () {
2816
2050
  }
2817
2051
  });
2818
2052
  };
2819
-
2820
2053
  _proto.practiceGetPayment = function practiceGetPayment(practiceUuid, idStripeInvoiceOrPaymentIntent) {
2821
2054
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/" + idStripeInvoiceOrPaymentIntent);
2822
2055
  };
2823
-
2824
2056
  _proto.practiceGetPaymentForStripePaymentIntentWithID = function practiceGetPaymentForStripePaymentIntentWithID(practiceUuid, stripePaymentIntentId) {
2825
2057
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/" + stripePaymentIntentId);
2826
- } // Payments Intent
2058
+ }
2059
+ // Payments Intent
2827
2060
  ;
2828
-
2829
2061
  _proto.practiceGetPaymentsIntents = function practiceGetPaymentsIntents(practiceUuid, planType) {
2830
2062
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/intents", {
2831
2063
  params: {
@@ -2837,9 +2069,7 @@ var PracticeService = /*#__PURE__*/function () {
2837
2069
  * This function return the user hased email to be use for creating payment intent
2838
2070
  * @param email the email to hash
2839
2071
  * @returns a hashed email
2840
- */
2841
- ;
2842
-
2072
+ */;
2843
2073
  _proto.getPaymentIntentHashedEmail = function getPaymentIntentHashedEmail(email) {
2844
2074
  return hashToBase64String(email.toLowerCase());
2845
2075
  }
@@ -2853,9 +2083,7 @@ var PracticeService = /*#__PURE__*/function () {
2853
2083
  * @param promotionCode (optional) promotion code to apply
2854
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.).
2855
2085
  * @returns
2856
- */
2857
- ;
2858
-
2086
+ */;
2859
2087
  _proto.practiceCreatePaymentsIntent = function practiceCreatePaymentsIntent(practiceUuid, planId, userEmail, isoLocality, url_subdomain, requestMetadata) {
2860
2088
  return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/intents/", {
2861
2089
  idPlan: planId,
@@ -2868,7 +2096,6 @@ var PracticeService = /*#__PURE__*/function () {
2868
2096
  }
2869
2097
  });
2870
2098
  };
2871
-
2872
2099
  _proto.practiceGetPaymentsIntent = function practiceGetPaymentsIntent(practiceUuid, paymentIntentId) {
2873
2100
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/intents/" + paymentIntentId);
2874
2101
  }
@@ -2881,9 +2108,7 @@ var PracticeService = /*#__PURE__*/function () {
2881
2108
  * @param promotionCode (optional) promotional code to apply
2882
2109
  * @param finalize (optional) if true will finalize the PracticePaymentIntent and related Stripe.Invoice. Once, finalized you cannot modify the PracticePaymentIntent anymore.
2883
2110
  * @returns the updated PracticePaymentIntent
2884
- */
2885
- ;
2886
-
2111
+ */;
2887
2112
  _proto.practiceUpdatePaymentsIntent = function practiceUpdatePaymentsIntent(practiceUuid, idPraticePaymentIntent, practicePaymentIntent, userEmail, promotionCode, finalize) {
2888
2113
  return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/intents/" + idPraticePaymentIntent, _extends({}, practicePaymentIntent, {
2889
2114
  hashUserEmail: userEmail ? this.getPaymentIntentHashedEmail(userEmail) : undefined
@@ -2898,125 +2123,103 @@ var PracticeService = /*#__PURE__*/function () {
2898
2123
  * Invoice
2899
2124
  * @param practiceUuid UUID of the practice to get the invoice from
2900
2125
  * @param invoiceId ID of the invoice in stripe
2901
- */
2902
- ;
2903
-
2126
+ */;
2904
2127
  _proto.getInvoice = function getInvoice(practiceUuid, invoiceId) {
2905
2128
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/invoices/" + invoiceId);
2906
- } // Practitioner
2129
+ }
2130
+ // Practitioner
2907
2131
  ;
2908
-
2909
2132
  _proto.practiceGetPractitioners = function practiceGetPractitioners(practiceUuid) {
2910
2133
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners");
2911
2134
  };
2912
-
2913
2135
  _proto.practiceUpdatePractitioner = function practiceUpdatePractitioner(practiceUuid, practitionerUuid, requestBody) {
2914
2136
  return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid, requestBody);
2915
2137
  };
2916
-
2917
2138
  _proto.practiceGetPractitioner = function practiceGetPractitioner(practiceUuid, practitionerUuid) {
2918
2139
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid);
2919
- } // Practitioner Licenses
2140
+ }
2141
+ // Practitioner Licenses
2920
2142
  ;
2921
-
2922
2143
  _proto.practiceGetPractitionerLicenses = function practiceGetPractitionerLicenses(practiceUuid, practitionerUuid) {
2923
2144
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/licenses");
2924
2145
  };
2925
-
2926
2146
  _proto.practiceCreatePractitionerLicense = function practiceCreatePractitionerLicense(practiceUuid, practitionerUuid, requestBody) {
2927
2147
  return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/licenses", requestBody);
2928
2148
  };
2929
-
2930
2149
  _proto.practiceUpdatePractitionerLicense = function practiceUpdatePractitionerLicense(practiceUuid, practitionerUuid, licenseId, requestBody) {
2931
2150
  return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/licenses/" + licenseId, requestBody);
2932
2151
  };
2933
-
2934
2152
  _proto.practiceGetPractitionerLicense = function practiceGetPractitionerLicense(practiceUuid, practitionerUuid, licenseId) {
2935
2153
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/licenses/" + licenseId);
2936
- } // Practitioner Preferences
2154
+ }
2155
+ // Practitioner Preferences
2937
2156
  ;
2938
-
2939
2157
  _proto.practiceGetPractitionerPreferences = function practiceGetPractitionerPreferences(practiceUuid, practitionerUuid) {
2940
2158
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/preferences");
2941
2159
  };
2942
-
2943
2160
  _proto.practiceCreatePractitionerPreference = function practiceCreatePractitionerPreference(practiceUuid, practitionerUuid, requestBody) {
2944
2161
  return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/preferences", requestBody);
2945
2162
  };
2946
-
2947
2163
  _proto.practiceUpdatePractitionerPreference = function practiceUpdatePractitionerPreference(practiceUuid, practitionerUuid, preferenceId, requestBody) {
2948
2164
  return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/preferences/" + preferenceId, requestBody);
2949
2165
  };
2950
-
2951
2166
  _proto.practiceGetPractitionerPreference = function practiceGetPractitionerPreference(practiceUuid, practitionerUuid, preferenceId) {
2952
2167
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/preferences/" + preferenceId);
2953
- } // Practitioner Roles
2168
+ }
2169
+ // Practitioner Roles
2954
2170
  ;
2955
-
2956
2171
  _proto.practiceGetPractitionerRoles = function practiceGetPractitionerRoles(practiceUuid, practitionerUuid) {
2957
2172
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles");
2958
2173
  };
2959
-
2960
2174
  _proto.practiceCreatePractitionerRole = function practiceCreatePractitionerRole(practiceUuid, practitionerUuid, requestBody) {
2961
2175
  return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles", requestBody);
2962
2176
  };
2963
-
2964
2177
  _proto.practiceDeletePractitionerRoles = function practiceDeletePractitionerRoles(practiceUuid, practitionerUuid) {
2965
2178
  return this.api.deleteRequest(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles");
2966
2179
  };
2967
-
2968
2180
  _proto.practiceUpdatePractitionerRole = function practiceUpdatePractitionerRole(practiceUuid, practitionerUuid, roleId, requestBody) {
2969
2181
  return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles/" + roleId, requestBody);
2970
2182
  };
2971
-
2972
2183
  _proto.practiceGetPractitionerRole = function practiceGetPractitionerRole(practiceUuid, practitionerUuid, roleId) {
2973
2184
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles/" + roleId);
2974
2185
  };
2975
-
2976
2186
  _proto.practiceDeletePractitionerRole = function practiceDeletePractitionerRole(practiceUuid, practitionerUuid, roleId) {
2977
2187
  return this.api.deleteRequest(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles/" + roleId);
2978
- } // Practitioner signature
2979
-
2188
+ }
2189
+ // Practitioner signature
2980
2190
  /**
2981
2191
  * This function returns the practitioner's signature as a Blob
2982
2192
  * @param practiceUuid the practice uuid of the practitioner
2983
2193
  * @param practitionerUuid the practitioner uuid
2984
2194
  * @returns a blob representing the signature
2985
- */
2986
- ;
2987
-
2195
+ */;
2988
2196
  _proto.practiceGetPractitionerSignature = function practiceGetPractitionerSignature(practiceUuid, practitionerUuid) {
2989
2197
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/signature", {
2990
2198
  responseType: 'blob'
2991
2199
  });
2992
- } // Assignments
2200
+ }
2201
+ // Assignments
2993
2202
  ;
2994
-
2995
2203
  _proto.practiceGetAssignments = function practiceGetAssignments(practiceUuid) {
2996
2204
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/assignments");
2997
2205
  };
2998
-
2999
2206
  _proto.practiceCreateAssignment = function practiceCreateAssignment(practiceUuid, requestBody) {
3000
2207
  return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/assignments", requestBody);
3001
2208
  };
3002
-
3003
2209
  _proto.practiceUpdateAssignment = function practiceUpdateAssignment(practiceUuid, assignmentId, requestBody) {
3004
2210
  return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/assignments/" + assignmentId, requestBody);
3005
2211
  };
3006
-
3007
2212
  _proto.practiceGetAssignment = function practiceGetAssignment(practiceUuid, assignmentId) {
3008
2213
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/assignments/" + assignmentId);
3009
- } // Quotas
2214
+ }
2215
+ // Quotas
3010
2216
  ;
3011
-
3012
2217
  _proto.practiceGetQuotas = function practiceGetQuotas(practiceUuid) {
3013
2218
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/quotas");
3014
2219
  };
3015
-
3016
2220
  _proto.practiceGetQuota = function practiceGetQuota(practiceUuid, quotaId) {
3017
2221
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/quotas/" + quotaId);
3018
2222
  };
3019
-
3020
2223
  return PracticeService;
3021
2224
  }();
3022
2225
 
@@ -3025,12 +2228,10 @@ var TellerService = /*#__PURE__*/function () {
3025
2228
  this.api = api;
3026
2229
  this.baseURL = baseURL;
3027
2230
  }
3028
-
3029
2231
  var _proto = TellerService.prototype;
3030
-
3031
2232
  _proto.lockboxDataStore = /*#__PURE__*/function () {
3032
- var _lockboxDataStore = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(lockboxUuid, req, lockboxOwnerUuid, previousDataUuid, options) {
3033
- 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) {
3034
2235
  while (1) {
3035
2236
  switch (_context.prev = _context.next) {
3036
2237
  case 0:
@@ -3039,7 +2240,6 @@ var TellerService = /*#__PURE__*/function () {
3039
2240
  updateMedicalStatus: true
3040
2241
  };
3041
2242
  }
3042
-
3043
2243
  return _context.abrupt("return", this.api.post(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/data", req, {
3044
2244
  params: {
3045
2245
  lockbox_owner_uuid: lockboxOwnerUuid,
@@ -3047,7 +2247,6 @@ var TellerService = /*#__PURE__*/function () {
3047
2247
  update_medical_status: options.updateMedicalStatus
3048
2248
  }
3049
2249
  }));
3050
-
3051
2250
  case 2:
3052
2251
  case "end":
3053
2252
  return _context.stop();
@@ -3055,14 +2254,11 @@ var TellerService = /*#__PURE__*/function () {
3055
2254
  }
3056
2255
  }, _callee, this);
3057
2256
  }));
3058
-
3059
2257
  function lockboxDataStore(_x, _x2, _x3, _x4, _x5) {
3060
2258
  return _lockboxDataStore.apply(this, arguments);
3061
2259
  }
3062
-
3063
2260
  return lockboxDataStore;
3064
2261
  }();
3065
-
3066
2262
  _proto.updateConsultByUUID = function updateConsultByUUID(patientUuid, uuidConsult, statusMedical, closedReasonType, closedReasonDescription, neverExpires) {
3067
2263
  return this.api.put(this.baseURL + "/v1/consults/" + uuidConsult, {
3068
2264
  patientUuid: patientUuid,
@@ -3080,9 +2276,7 @@ var TellerService = /*#__PURE__*/function () {
3080
2276
  * @param consultationShortId the consultation short id
3081
2277
  * @param fax the address where to send the fax
3082
2278
  * @returns void
3083
- */
3084
- ;
3085
-
2279
+ */;
3086
2280
  _proto.notifyFaxFailed = function notifyFaxFailed(practiceUuid, consultationUuid, consultationShortId, fax) {
3087
2281
  return this.api.post(this.baseURL + "/v1/fax-failed", {
3088
2282
  consultationUuid: consultationUuid,
@@ -3099,9 +2293,7 @@ var TellerService = /*#__PURE__*/function () {
3099
2293
  * @todo - Make service only exposed route
3100
2294
  * @param uuidConsult the uuid of the consult to reassign
3101
2295
  * @param newPractitionerUuid the uuid of the practitioner that will get reassigned
3102
- */
3103
- ;
3104
-
2296
+ */;
3105
2297
  _proto.reassignmentEmail = function reassignmentEmail(uuidConsult, newPractitionerUuid) {
3106
2298
  return this.api.post(this.baseURL + "/v1/consult/" + uuidConsult + "/reassignment-email", {
3107
2299
  newPractitionerUuid: newPractitionerUuid
@@ -3113,9 +2305,7 @@ var TellerService = /*#__PURE__*/function () {
3113
2305
  * @param consult
3114
2306
  * @param patientUuid
3115
2307
  * @returns void
3116
- */
3117
- ;
3118
-
2308
+ */;
3119
2309
  _proto.sendOnlineFaxSuccessfulEmail = function sendOnlineFaxSuccessfulEmail(consult, patientUuid) {
3120
2310
  return this.api.post(this.baseURL + "/v1/online-fax-notify", {
3121
2311
  consult: consult,
@@ -3126,13 +2316,10 @@ var TellerService = /*#__PURE__*/function () {
3126
2316
  * This function will send an email to patient to allow them to resume the consult.
3127
2317
  * @param req the body of the resume consult request
3128
2318
  * @returns void
3129
- */
3130
- ;
3131
-
2319
+ */;
3132
2320
  _proto.sendResumeConsultEmail = function sendResumeConsultEmail(req) {
3133
2321
  return this.api.post(this.baseURL + "/v1/resume-consult-email", req);
3134
2322
  };
3135
-
3136
2323
  return TellerService;
3137
2324
  }();
3138
2325
 
@@ -3141,17 +2328,14 @@ var VaultService = /*#__PURE__*/function () {
3141
2328
  this.api = api;
3142
2329
  this.baseURL = baseURL;
3143
2330
  }
3144
-
3145
2331
  var _proto = VaultService.prototype;
3146
-
3147
2332
  _proto.lockboxCreate = /*#__PURE__*/function () {
3148
- var _lockboxCreate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(lockboxMetadata) {
3149
- 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) {
3150
2335
  while (1) {
3151
2336
  switch (_context.prev = _context.next) {
3152
2337
  case 0:
3153
2338
  return _context.abrupt("return", this.api.post(this.baseURL + "/v1/lockbox", lockboxMetadata));
3154
-
3155
2339
  case 1:
3156
2340
  case "end":
3157
2341
  return _context.stop();
@@ -3159,17 +2343,14 @@ var VaultService = /*#__PURE__*/function () {
3159
2343
  }
3160
2344
  }, _callee, this);
3161
2345
  }));
3162
-
3163
2346
  function lockboxCreate(_x) {
3164
2347
  return _lockboxCreate.apply(this, arguments);
3165
2348
  }
3166
-
3167
2349
  return lockboxCreate;
3168
2350
  }();
3169
-
3170
2351
  _proto.lockboxMetadataAdd = /*#__PURE__*/function () {
3171
- var _lockboxMetadataAdd = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(lockboxUuid, lockboxMetadata, lockboxOwnerUuid) {
3172
- 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) {
3173
2354
  while (1) {
3174
2355
  switch (_context2.prev = _context2.next) {
3175
2356
  case 0:
@@ -3178,7 +2359,6 @@ var VaultService = /*#__PURE__*/function () {
3178
2359
  lockbox_owner_uuid: lockboxOwnerUuid
3179
2360
  }
3180
2361
  }));
3181
-
3182
2362
  case 1:
3183
2363
  case "end":
3184
2364
  return _context2.stop();
@@ -3186,17 +2366,14 @@ var VaultService = /*#__PURE__*/function () {
3186
2366
  }
3187
2367
  }, _callee2, this);
3188
2368
  }));
3189
-
3190
2369
  function lockboxMetadataAdd(_x2, _x3, _x4) {
3191
2370
  return _lockboxMetadataAdd.apply(this, arguments);
3192
2371
  }
3193
-
3194
2372
  return lockboxMetadataAdd;
3195
2373
  }();
3196
-
3197
2374
  _proto.lockboxSecretGet = /*#__PURE__*/function () {
3198
- var _lockboxSecretGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(lockboxUuid, lockboxOwnerUuid) {
3199
- 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) {
3200
2377
  while (1) {
3201
2378
  switch (_context3.prev = _context3.next) {
3202
2379
  case 0:
@@ -3205,7 +2382,6 @@ var VaultService = /*#__PURE__*/function () {
3205
2382
  lockbox_owner_uuid: lockboxOwnerUuid
3206
2383
  }
3207
2384
  }));
3208
-
3209
2385
  case 1:
3210
2386
  case "end":
3211
2387
  return _context3.stop();
@@ -3213,17 +2389,14 @@ var VaultService = /*#__PURE__*/function () {
3213
2389
  }
3214
2390
  }, _callee3, this);
3215
2391
  }));
3216
-
3217
2392
  function lockboxSecretGet(_x5, _x6) {
3218
2393
  return _lockboxSecretGet.apply(this, arguments);
3219
2394
  }
3220
-
3221
2395
  return lockboxSecretGet;
3222
2396
  }();
3223
-
3224
2397
  _proto.lockboxGrant = /*#__PURE__*/function () {
3225
- var _lockboxGrant = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(lockboxUuid, req, lockboxOwnerUuid) {
3226
- 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) {
3227
2400
  while (1) {
3228
2401
  switch (_context4.prev = _context4.next) {
3229
2402
  case 0:
@@ -3232,7 +2405,6 @@ var VaultService = /*#__PURE__*/function () {
3232
2405
  lockbox_owner_uuid: lockboxOwnerUuid
3233
2406
  }
3234
2407
  }));
3235
-
3236
2408
  case 1:
3237
2409
  case "end":
3238
2410
  return _context4.stop();
@@ -3240,11 +2412,9 @@ var VaultService = /*#__PURE__*/function () {
3240
2412
  }
3241
2413
  }, _callee4, this);
3242
2414
  }));
3243
-
3244
2415
  function lockboxGrant(_x7, _x8, _x9) {
3245
2416
  return _lockboxGrant.apply(this, arguments);
3246
2417
  }
3247
-
3248
2418
  return lockboxGrant;
3249
2419
  }()
3250
2420
  /**
@@ -3253,17 +2423,15 @@ var VaultService = /*#__PURE__*/function () {
3253
2423
  * @returns decrypted lockboxes granted to user
3254
2424
  */
3255
2425
  ;
3256
-
3257
2426
  _proto.grantsGet =
3258
2427
  /*#__PURE__*/
3259
2428
  function () {
3260
- var _grantsGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5() {
3261
- return runtime_1.wrap(function _callee5$(_context5) {
2429
+ var _grantsGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
2430
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
3262
2431
  while (1) {
3263
2432
  switch (_context5.prev = _context5.next) {
3264
2433
  case 0:
3265
2434
  return _context5.abrupt("return", this.api.get(this.baseURL + "/v1/grants"));
3266
-
3267
2435
  case 1:
3268
2436
  case "end":
3269
2437
  return _context5.stop();
@@ -3271,11 +2439,9 @@ var VaultService = /*#__PURE__*/function () {
3271
2439
  }
3272
2440
  }, _callee5, this);
3273
2441
  }));
3274
-
3275
2442
  function grantsGet() {
3276
2443
  return _grantsGet.apply(this, arguments);
3277
2444
  }
3278
-
3279
2445
  return grantsGet;
3280
2446
  }()
3281
2447
  /**
@@ -3289,12 +2455,11 @@ var VaultService = /*#__PURE__*/function () {
3289
2455
  * @returns
3290
2456
  */
3291
2457
  ;
3292
-
3293
2458
  _proto.lockboxDataStore =
3294
2459
  /*#__PURE__*/
3295
2460
  function () {
3296
- var _lockboxDataStore = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(lockboxUuid, req, lockboxOwnerUuid, previousDataUuid) {
3297
- 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) {
3298
2463
  while (1) {
3299
2464
  switch (_context6.prev = _context6.next) {
3300
2465
  case 0:
@@ -3304,7 +2469,6 @@ var VaultService = /*#__PURE__*/function () {
3304
2469
  data_uuid: previousDataUuid
3305
2470
  }
3306
2471
  }));
3307
-
3308
2472
  case 1:
3309
2473
  case "end":
3310
2474
  return _context6.stop();
@@ -3312,25 +2476,21 @@ var VaultService = /*#__PURE__*/function () {
3312
2476
  }
3313
2477
  }, _callee6, this);
3314
2478
  }));
3315
-
3316
2479
  function lockboxDataStore(_x10, _x11, _x12, _x13) {
3317
2480
  return _lockboxDataStore.apply(this, arguments);
3318
2481
  }
3319
-
3320
2482
  return lockboxDataStore;
3321
2483
  }();
3322
-
3323
2484
  _proto.lockboxDataGet = /*#__PURE__*/function () {
3324
- 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) {
3325
2486
  var data;
3326
- return runtime_1.wrap(function _callee7$(_context7) {
2487
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
3327
2488
  while (1) {
3328
2489
  switch (_context7.prev = _context7.next) {
3329
2490
  case 0:
3330
2491
  if (stream === void 0) {
3331
2492
  stream = true;
3332
2493
  }
3333
-
3334
2494
  _context7.next = 3;
3335
2495
  return this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/data/" + dataUuid, {
3336
2496
  params: {
@@ -3338,22 +2498,17 @@ var VaultService = /*#__PURE__*/function () {
3338
2498
  stream: stream
3339
2499
  }
3340
2500
  });
3341
-
3342
2501
  case 3:
3343
2502
  data = _context7.sent;
3344
-
3345
2503
  if (!stream) {
3346
2504
  _context7.next = 6;
3347
2505
  break;
3348
2506
  }
3349
-
3350
2507
  return _context7.abrupt("return", {
3351
2508
  data: data
3352
2509
  });
3353
-
3354
2510
  case 6:
3355
2511
  return _context7.abrupt("return", data);
3356
-
3357
2512
  case 7:
3358
2513
  case "end":
3359
2514
  return _context7.stop();
@@ -3361,17 +2516,14 @@ var VaultService = /*#__PURE__*/function () {
3361
2516
  }
3362
2517
  }, _callee7, this);
3363
2518
  }));
3364
-
3365
2519
  function lockboxDataGet(_x14, _x15, _x16, _x17) {
3366
2520
  return _lockboxDataGet.apply(this, arguments);
3367
2521
  }
3368
-
3369
2522
  return lockboxDataGet;
3370
2523
  }();
3371
-
3372
2524
  _proto.lockboxManifestGet = /*#__PURE__*/function () {
3373
- var _lockboxManifestGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(lockboxUuid, filter, lockboxOwnerUuid) {
3374
- 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) {
3375
2527
  while (1) {
3376
2528
  switch (_context8.prev = _context8.next) {
3377
2529
  case 0:
@@ -3381,7 +2533,6 @@ var VaultService = /*#__PURE__*/function () {
3381
2533
  filter: filter
3382
2534
  }
3383
2535
  }));
3384
-
3385
2536
  case 1:
3386
2537
  case "end":
3387
2538
  return _context8.stop();
@@ -3389,17 +2540,14 @@ var VaultService = /*#__PURE__*/function () {
3389
2540
  }
3390
2541
  }, _callee8, this);
3391
2542
  }));
3392
-
3393
2543
  function lockboxManifestGet(_x18, _x19, _x20) {
3394
2544
  return _lockboxManifestGet.apply(this, arguments);
3395
2545
  }
3396
-
3397
2546
  return lockboxManifestGet;
3398
2547
  }();
3399
-
3400
2548
  _proto.lockboxMetadataGet = /*#__PURE__*/function () {
3401
- var _lockboxMetadataGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9(lockboxUuid, fields, groupby, filter, lockboxOwnerUuid) {
3402
- 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) {
3403
2551
  while (1) {
3404
2552
  switch (_context9.prev = _context9.next) {
3405
2553
  case 0:
@@ -3411,7 +2559,6 @@ var VaultService = /*#__PURE__*/function () {
3411
2559
  filter: filter
3412
2560
  }
3413
2561
  }));
3414
-
3415
2562
  case 1:
3416
2563
  case "end":
3417
2564
  return _context9.stop();
@@ -3419,11 +2566,9 @@ var VaultService = /*#__PURE__*/function () {
3419
2566
  }
3420
2567
  }, _callee9, this);
3421
2568
  }));
3422
-
3423
2569
  function lockboxMetadataGet(_x21, _x22, _x23, _x24, _x25) {
3424
2570
  return _lockboxMetadataGet.apply(this, arguments);
3425
2571
  }
3426
-
3427
2572
  return lockboxMetadataGet;
3428
2573
  }()
3429
2574
  /**
@@ -3434,12 +2579,11 @@ var VaultService = /*#__PURE__*/function () {
3434
2579
  * @param indexOwnerUuid
3435
2580
  */
3436
2581
  ;
3437
-
3438
2582
  _proto.vaultIndexPut =
3439
2583
  /*#__PURE__*/
3440
2584
  function () {
3441
- var _vaultIndexPut = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10(entries, indexOwnerUuid) {
3442
- 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) {
3443
2587
  while (1) {
3444
2588
  switch (_context10.prev = _context10.next) {
3445
2589
  case 0:
@@ -3448,7 +2592,6 @@ var VaultService = /*#__PURE__*/function () {
3448
2592
  index_owner_uuid: indexOwnerUuid
3449
2593
  }
3450
2594
  }));
3451
-
3452
2595
  case 1:
3453
2596
  case "end":
3454
2597
  return _context10.stop();
@@ -3456,11 +2599,9 @@ var VaultService = /*#__PURE__*/function () {
3456
2599
  }
3457
2600
  }, _callee10, this);
3458
2601
  }));
3459
-
3460
2602
  function vaultIndexPut(_x26, _x27) {
3461
2603
  return _vaultIndexPut.apply(this, arguments);
3462
2604
  }
3463
-
3464
2605
  return vaultIndexPut;
3465
2606
  }()
3466
2607
  /**
@@ -3469,17 +2610,15 @@ var VaultService = /*#__PURE__*/function () {
3469
2610
  * @param entry the encrypted index snapshot
3470
2611
  */
3471
2612
  ;
3472
-
3473
2613
  _proto.vaultIndexSnapshotPut =
3474
2614
  /*#__PURE__*/
3475
2615
  function () {
3476
- var _vaultIndexSnapshotPut = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11(entry) {
3477
- 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) {
3478
2618
  while (1) {
3479
2619
  switch (_context11.prev = _context11.next) {
3480
2620
  case 0:
3481
2621
  return _context11.abrupt("return", this.api.put(this.baseURL + "/v1/index-snapshot", entry));
3482
-
3483
2622
  case 1:
3484
2623
  case "end":
3485
2624
  return _context11.stop();
@@ -3487,11 +2626,9 @@ var VaultService = /*#__PURE__*/function () {
3487
2626
  }
3488
2627
  }, _callee11, this);
3489
2628
  }));
3490
-
3491
2629
  function vaultIndexSnapshotPut(_x28) {
3492
2630
  return _vaultIndexSnapshotPut.apply(this, arguments);
3493
2631
  }
3494
-
3495
2632
  return vaultIndexSnapshotPut;
3496
2633
  }()
3497
2634
  /**
@@ -3503,12 +2640,11 @@ var VaultService = /*#__PURE__*/function () {
3503
2640
  * @returns the encrypted index
3504
2641
  */
3505
2642
  ;
3506
-
3507
2643
  _proto.vaultIndexGet =
3508
2644
  /*#__PURE__*/
3509
2645
  function () {
3510
- var _vaultIndexGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee12(indexKeys, identifiers, timestamp) {
3511
- 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) {
3512
2648
  while (1) {
3513
2649
  switch (_context12.prev = _context12.next) {
3514
2650
  case 0:
@@ -3519,7 +2655,6 @@ var VaultService = /*#__PURE__*/function () {
3519
2655
  timestamp: timestamp
3520
2656
  }
3521
2657
  }));
3522
-
3523
2658
  case 1:
3524
2659
  case "end":
3525
2660
  return _context12.stop();
@@ -3527,14 +2662,11 @@ var VaultService = /*#__PURE__*/function () {
3527
2662
  }
3528
2663
  }, _callee12, this);
3529
2664
  }));
3530
-
3531
2665
  function vaultIndexGet(_x29, _x30, _x31) {
3532
2666
  return _vaultIndexGet.apply(this, arguments);
3533
2667
  }
3534
-
3535
2668
  return vaultIndexGet;
3536
2669
  }();
3537
-
3538
2670
  return VaultService;
3539
2671
  }();
3540
2672
 
@@ -3547,10 +2679,7 @@ var WorkflowService = /*#__PURE__*/function () {
3547
2679
  * This function returns all workflows
3548
2680
  * @returns desired workflow
3549
2681
  */
3550
-
3551
-
3552
2682
  var _proto = WorkflowService.prototype;
3553
-
3554
2683
  _proto.getWorkflows = function getWorkflows() {
3555
2684
  return this.api.get(this.v1Url + "/workflows");
3556
2685
  }
@@ -3561,9 +2690,7 @@ var WorkflowService = /*#__PURE__*/function () {
3561
2690
  * @param locale (optional) The desired locale of the workflow (default: 'en')
3562
2691
  * @param createdAt (optional) The creation date of the workflow (also used for versionning)
3563
2692
  * @returns desired workflow
3564
- */
3565
- ;
3566
-
2693
+ */;
3567
2694
  _proto.getWorkflow = function getWorkflow(id, locale, createdAt) {
3568
2695
  return this.api.get(this.v1Url + "/workflows/" + id, {
3569
2696
  params: {
@@ -3572,7 +2699,6 @@ var WorkflowService = /*#__PURE__*/function () {
3572
2699
  }
3573
2700
  });
3574
2701
  };
3575
-
3576
2702
  return WorkflowService;
3577
2703
  }();
3578
2704
 
@@ -3583,20 +2709,18 @@ var WorkflowService = /*#__PURE__*/function () {
3583
2709
  * @param useLocalStorage (default: true) if true store tokens into local storage (only for browsers)
3584
2710
  * @returns an instance of each services with a provided url
3585
2711
  */
3586
-
3587
2712
  var init = function init(services, authenticationCallback, useLocalStorage) {
3588
2713
  if (useLocalStorage === void 0) {
3589
2714
  useLocalStorage = true;
3590
2715
  }
3591
-
3592
2716
  var tellerBaseURL = services.tellerBaseURL,
3593
- practiceBaseURL = services.practiceBaseURL,
3594
- consultBaseURL = services.consultBaseURL,
3595
- vaultBaseURL = services.vaultBaseURL,
3596
- guardBaseURL = services.guardBaseURL,
3597
- searchBaseURL = services.searchBaseURL,
3598
- workflowBaseURL = services.workflowBaseURL,
3599
- 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;
3600
2724
  var apiService = new APIService(useLocalStorage, undefined, authenticationCallback);
3601
2725
  return {
3602
2726
  apiService: apiService,