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