oro-sdk-apis 4.3.2 → 5.14.0-dev1.0

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