oro-sdk-apis 5.14.0 → 5.14.1

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