oro-sdk-apis 5.13.7 → 5.14.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);
811
+
812
+ if (finallyEntry &&
813
+ (type === "break" ||
814
+ type === "continue") &&
815
+ finallyEntry.tryLoc <= arg &&
816
+ arg <= finallyEntry.finallyLoc) {
817
+ // Ignore the finally entry if control is not jumping to a
818
+ // location outside the try/catch block.
819
+ finallyEntry = null;
820
+ }
821
+
286
822
  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);
823
+ record.type = type;
824
+ record.arg = arg;
825
+
826
+ if (finallyEntry) {
827
+ this.method = "next";
828
+ this.next = finallyEntry.finallyLoc;
829
+ return ContinueSentinel;
830
+ }
831
+
832
+ return this.complete(record);
288
833
  },
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;
834
+
835
+ complete: function(record, afterLoc) {
836
+ if (record.type === "throw") {
837
+ throw record.arg;
838
+ }
839
+
840
+ if (record.type === "break" ||
841
+ record.type === "continue") {
842
+ this.next = record.arg;
843
+ } else if (record.type === "return") {
844
+ this.rval = this.arg = record.arg;
845
+ this.method = "return";
846
+ this.next = "end";
847
+ } else if (record.type === "normal" && afterLoc) {
848
+ this.next = afterLoc;
849
+ }
850
+
851
+ return ContinueSentinel;
292
852
  },
293
- finish: function (finallyLoc) {
853
+
854
+ finish: function(finallyLoc) {
294
855
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
295
856
  var entry = this.tryEntries[i];
296
- if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
857
+ if (entry.finallyLoc === finallyLoc) {
858
+ this.complete(entry.completion, entry.afterLoc);
859
+ resetTryEntry(entry);
860
+ return ContinueSentinel;
861
+ }
297
862
  }
298
863
  },
299
- catch: function (tryLoc) {
864
+
865
+ "catch": function(tryLoc) {
300
866
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
301
867
  var entry = this.tryEntries[i];
302
868
  if (entry.tryLoc === tryLoc) {
303
869
  var record = entry.completion;
304
- if ("throw" === record.type) {
870
+ if (record.type === "throw") {
305
871
  var thrown = record.arg;
306
872
  resetTryEntry(entry);
307
873
  }
308
874
  return thrown;
309
875
  }
310
876
  }
877
+
878
+ // The context.catch method must only be called with a location
879
+ // argument that corresponds to a known catch block.
311
880
  throw new Error("illegal catch attempt");
312
881
  },
313
- delegateYield: function (iterable, resultName, nextLoc) {
314
- return this.delegate = {
882
+
883
+ delegateYield: function(iterable, resultName, nextLoc) {
884
+ this.delegate = {
315
885
  iterator: values(iterable),
316
886
  resultName: resultName,
317
887
  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);
344
- }
345
- function _throw(err) {
346
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
347
- }
348
- _next(undefined);
349
- });
350
- };
351
- }
352
- function _extends() {
353
- _extends = Object.assign ? Object.assign.bind() : function (target) {
354
- for (var i = 1; i < arguments.length; i++) {
355
- var source = arguments[i];
356
- for (var key in source) {
357
- if (Object.prototype.hasOwnProperty.call(source, key)) {
358
- target[key] = source[key];
359
- }
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;
360
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["Assigning"] = "Assigning";
@@ -770,6 +1333,7 @@ var ApisPracticeManager = /*#__PURE__*/function () {
770
1333
  MedicalStatus["Archived"] = "Archived";
771
1334
  MedicalStatus["Failed"] = "Failed";
772
1335
  })(exports.MedicalStatus || (exports.MedicalStatus = {}));
1336
+
773
1337
  (function (TaskStatus) {
774
1338
  TaskStatus["None"] = "None";
775
1339
  TaskStatus["ToDo"] = "ToDo";
@@ -777,6 +1341,7 @@ var ApisPracticeManager = /*#__PURE__*/function () {
777
1341
  TaskStatus["Blocked"] = "Blocked";
778
1342
  TaskStatus["Done"] = "Done";
779
1343
  })(exports.TaskStatus || (exports.TaskStatus = {}));
1344
+
780
1345
  (function (ClosedReasonType) {
781
1346
  /**
782
1347
  * A completed consultation
@@ -785,18 +1350,22 @@ var ApisPracticeManager = /*#__PURE__*/function () {
785
1350
  /**
786
1351
  * The conclusion was that what the patient submitted was not a disease
787
1352
  */
1353
+
788
1354
  ClosedReasonType["NotADisease"] = "NotADisease";
789
1355
  /**
790
1356
  * The consultation was not appropriate for virtual
791
1357
  */
1358
+
792
1359
  ClosedReasonType["NotAppropriateForVirtual"] = "NotAppropriateForVirtual";
793
1360
  /**
794
1361
  * Any other reason why the consultation was closed
795
1362
  */
1363
+
796
1364
  ClosedReasonType["Other"] = "Other";
797
1365
  /**
798
1366
  * A consultation that is required to be done in person
799
1367
  */
1368
+
800
1369
  ClosedReasonType["RequiresInPerson"] = "RequiresInPerson";
801
1370
  })(exports.ClosedReasonType || (exports.ClosedReasonType = {}));
802
1371
 
@@ -805,14 +1374,17 @@ var ApisPracticeManager = /*#__PURE__*/function () {
805
1374
  VisibilityType["Private"] = "Private";
806
1375
  VisibilityType["Instance"] = "Instance";
807
1376
  })(exports.VisibilityType || (exports.VisibilityType = {}));
1377
+
808
1378
  (function (DrugType) {
809
1379
  DrugType["Generic"] = "Generic";
810
1380
  DrugType["Instance"] = "Instance";
811
1381
  })(exports.DrugType || (exports.DrugType = {}));
1382
+
812
1383
  (function (PrescriptionStatus) {
813
1384
  PrescriptionStatus["Existing"] = "Existing";
814
1385
  PrescriptionStatus["Deleted"] = "Deleted";
815
1386
  })(exports.PrescriptionStatus || (exports.PrescriptionStatus = {}));
1387
+
816
1388
  (function (PlanStatus) {
817
1389
  PlanStatus["Pending"] = "Pending";
818
1390
  PlanStatus["Accepted"] = "Accepted";
@@ -822,58 +1394,74 @@ var ApisPracticeManager = /*#__PURE__*/function () {
822
1394
 
823
1395
  var AuthenticationFailed = /*#__PURE__*/function (_Error) {
824
1396
  _inheritsLoose(AuthenticationFailed, _Error);
1397
+
825
1398
  function AuthenticationFailed() {
826
1399
  return _Error.apply(this, arguments) || this;
827
1400
  }
1401
+
828
1402
  return AuthenticationFailed;
829
1403
  }( /*#__PURE__*/_wrapNativeSuper(Error));
830
1404
  var AuthenticationBadRequest = /*#__PURE__*/function (_Error2) {
831
1405
  _inheritsLoose(AuthenticationBadRequest, _Error2);
1406
+
832
1407
  function AuthenticationBadRequest() {
833
1408
  return _Error2.apply(this, arguments) || this;
834
1409
  }
1410
+
835
1411
  return AuthenticationBadRequest;
836
1412
  }( /*#__PURE__*/_wrapNativeSuper(Error));
837
1413
  var AuthenticationServerError = /*#__PURE__*/function (_Error3) {
838
1414
  _inheritsLoose(AuthenticationServerError, _Error3);
1415
+
839
1416
  function AuthenticationServerError() {
840
1417
  return _Error3.apply(this, arguments) || this;
841
1418
  }
1419
+
842
1420
  return AuthenticationServerError;
843
1421
  }( /*#__PURE__*/_wrapNativeSuper(Error));
844
1422
  var AuthenticationUnconfirmedEmail = /*#__PURE__*/function (_Error4) {
845
1423
  _inheritsLoose(AuthenticationUnconfirmedEmail, _Error4);
1424
+
846
1425
  function AuthenticationUnconfirmedEmail() {
847
1426
  return _Error4.apply(this, arguments) || this;
848
1427
  }
1428
+
849
1429
  return AuthenticationUnconfirmedEmail;
850
1430
  }( /*#__PURE__*/_wrapNativeSuper(Error));
851
1431
  var IdentityCreationFailed = /*#__PURE__*/function (_Error5) {
852
1432
  _inheritsLoose(IdentityCreationFailed, _Error5);
1433
+
853
1434
  function IdentityCreationFailed() {
854
1435
  return _Error5.apply(this, arguments) || this;
855
1436
  }
1437
+
856
1438
  return IdentityCreationFailed;
857
1439
  }( /*#__PURE__*/_wrapNativeSuper(Error));
858
1440
  var IdentityCreationBadRequest = /*#__PURE__*/function (_Error6) {
859
1441
  _inheritsLoose(IdentityCreationBadRequest, _Error6);
1442
+
860
1443
  function IdentityCreationBadRequest() {
861
1444
  return _Error6.apply(this, arguments) || this;
862
1445
  }
1446
+
863
1447
  return IdentityCreationBadRequest;
864
1448
  }( /*#__PURE__*/_wrapNativeSuper(Error));
865
1449
  var IdentityCreationConflict = /*#__PURE__*/function (_Error7) {
866
1450
  _inheritsLoose(IdentityCreationConflict, _Error7);
1451
+
867
1452
  function IdentityCreationConflict() {
868
1453
  return _Error7.apply(this, arguments) || this;
869
1454
  }
1455
+
870
1456
  return IdentityCreationConflict;
871
1457
  }( /*#__PURE__*/_wrapNativeSuper(Error));
872
1458
  var VaultDataMissing = /*#__PURE__*/function (_Error8) {
873
1459
  _inheritsLoose(VaultDataMissing, _Error8);
1460
+
874
1461
  function VaultDataMissing() {
875
1462
  return _Error8.apply(this, arguments) || this;
876
1463
  }
1464
+
877
1465
  return VaultDataMissing;
878
1466
  }( /*#__PURE__*/_wrapNativeSuper(Error));
879
1467
 
@@ -883,6 +1471,7 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
883
1471
  WorkflowType["Renew"] = "Renew";
884
1472
  WorkflowType["DataRetrieve"] = "DataRetrieve";
885
1473
  })(exports.WorkflowType || (exports.WorkflowType = {}));
1474
+
886
1475
  (function (RateDimension) {
887
1476
  RateDimension["RatioOnTotal"] = "RatioOnTotal";
888
1477
  RateDimension["FixedOnTotal"] = "FixedOnTotal";
@@ -893,12 +1482,14 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
893
1482
  RateDimension["RatioOnItem"] = "RatioOnItem";
894
1483
  RateDimension["FixedOnItem"] = "FixedOnItem";
895
1484
  })(exports.RateDimension || (exports.RateDimension = {}));
1485
+
896
1486
  (function (PlanType) {
897
1487
  PlanType["Onboard"] = "Onboard";
898
1488
  PlanType["Followup"] = "Followup";
899
1489
  PlanType["Renew"] = "Renew";
900
1490
  PlanType["DataRetrieve"] = "DataRetrieve";
901
1491
  })(exports.PlanType || (exports.PlanType = {}));
1492
+
902
1493
  (function (PaymentStatus) {
903
1494
  PaymentStatus["Pending"] = "Pending";
904
1495
  PaymentStatus["Success"] = "Success";
@@ -906,6 +1497,7 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
906
1497
  PaymentStatus["Canceled"] = "Canceled";
907
1498
  PaymentStatus["SuccessAndDelivered"] = "SuccessAndDelivered";
908
1499
  })(exports.PaymentStatus || (exports.PaymentStatus = {}));
1500
+
909
1501
  (function (PractitionerStatus) {
910
1502
  PractitionerStatus["Practicing"] = "Practicing";
911
1503
  PractitionerStatus["Retired"] = "Retired";
@@ -915,11 +1507,13 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
915
1507
  PractitionerStatus["InConflict"] = "InConflict";
916
1508
  PractitionerStatus["Delicensed"] = "Delicensed";
917
1509
  })(exports.PractitionerStatus || (exports.PractitionerStatus = {}));
1510
+
918
1511
  (function (AssignmentStatus) {
919
1512
  AssignmentStatus["Assigned"] = "Assigned";
920
1513
  AssignmentStatus["Reassigned"] = "Reassigned";
921
1514
  AssignmentStatus["Cancelled"] = "Cancelled";
922
1515
  })(exports.AssignmentStatus || (exports.AssignmentStatus = {}));
1516
+
923
1517
  (function (PractitionnerRoleType) {
924
1518
  PractitionnerRoleType["Doctor"] = "Doctor";
925
1519
  PractitionnerRoleType["MedicalAssistant"] = "MedicalAssistant";
@@ -931,11 +1525,13 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
931
1525
  PractitionnerRoleType["ManualDispatcher"] = "ManualDispatcher";
932
1526
  PractitionnerRoleType["Other"] = "Other";
933
1527
  })(exports.PractitionnerRoleType || (exports.PractitionnerRoleType = {}));
1528
+
934
1529
  (function (OtherRoleType) {
935
1530
  OtherRoleType["Patient"] = "Patient";
936
1531
  OtherRoleType["User"] = "User";
937
1532
  OtherRoleType["System"] = "System";
938
1533
  })(exports.OtherRoleType || (exports.OtherRoleType = {}));
1534
+
939
1535
  (function (LicenseStatus) {
940
1536
  LicenseStatus["Valid"] = "Valid";
941
1537
  LicenseStatus["Invalid"] = "Invalid";
@@ -943,6 +1539,7 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
943
1539
  LicenseStatus["NA"] = "NA";
944
1540
  LicenseStatus["Removed"] = "Removed";
945
1541
  })(exports.LicenseStatus || (exports.LicenseStatus = {}));
1542
+
946
1543
  (function (PeriodType) {
947
1544
  PeriodType["PerYear"] = "PerYear";
948
1545
  PeriodType["PerQuarter"] = "PerQuarter";
@@ -952,6 +1549,7 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
952
1549
  PeriodType["PerDay"] = "PerDay";
953
1550
  PeriodType["PerHour"] = "PerHour";
954
1551
  })(exports.PeriodType || (exports.PeriodType = {}));
1552
+
955
1553
  (function (SyncStatus) {
956
1554
  SyncStatus["Requested"] = "Requested";
957
1555
  SyncStatus["Started"] = "Started";
@@ -959,6 +1557,7 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
959
1557
  SyncStatus["Failed"] = "Failed";
960
1558
  SyncStatus["Cancelled"] = "Cancelled";
961
1559
  })(exports.SyncStatus || (exports.SyncStatus = {}));
1560
+
962
1561
  (function (PracticeEmailKind) {
963
1562
  PracticeEmailKind["SignedUp"] = "SignedUp";
964
1563
  PracticeEmailKind["Onboarded"] = "Onboarded";
@@ -977,6 +1576,7 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
977
1576
  PracticeEmailKind["OnlinePharmacyFaxSent"] = "OnlinePharmacyFaxSent";
978
1577
  PracticeEmailKind["ResumeConsult"] = "ResumeConsult";
979
1578
  })(exports.PracticeEmailKind || (exports.PracticeEmailKind = {}));
1579
+
980
1580
  (function (PracticeConfigKind) {
981
1581
  PracticeConfigKind["PatientConsultCard"] = "PatientConsultCard";
982
1582
  PracticeConfigKind["PracticeCloseConsultationTypes"] = "PracticeCloseConsultationTypes";
@@ -998,10 +1598,12 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
998
1598
  PracticeConfigKind["PracticeDiagnosisAndTreatment"] = "PracticeDiagnosisAndTreatment";
999
1599
  PracticeConfigKind["PracticeInfoLetterDiscount"] = "PracticeInfoLetterDiscount";
1000
1600
  })(exports.PracticeConfigKind || (exports.PracticeConfigKind = {}));
1601
+
1001
1602
  (function (StripePriceType) {
1002
1603
  StripePriceType["Default"] = "Default";
1003
1604
  StripePriceType["Discount"] = "Discount";
1004
1605
  })(exports.StripePriceType || (exports.StripePriceType = {}));
1606
+
1005
1607
  (function (PaymentIntentRequestMetadataKind) {
1006
1608
  PaymentIntentRequestMetadataKind["ConsultRequestMetadata"] = "ConsultRequestMetadata";
1007
1609
  PaymentIntentRequestMetadataKind["RefillTreatmentRequestMetadata"] = "RefillTreatmentRequestMetadata";
@@ -1012,6 +1614,7 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
1012
1614
  IndexKey["IndexSnapshot"] = "IndexSnapshot";
1013
1615
  IndexKey["ConsultationLockbox"] = "ConsultationLockbox";
1014
1616
  })(exports.IndexKey || (exports.IndexKey = {}));
1617
+
1015
1618
  (function (DocumentType) {
1016
1619
  DocumentType["Message"] = "Message";
1017
1620
  DocumentType["Note"] = "Note";
@@ -1036,6 +1639,7 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
1036
1639
  InputApplyFunctions["AllAlphanumeric"] = "AllAlphanumeric";
1037
1640
  InputApplyFunctions["NoSpaces"] = "NoSpaces";
1038
1641
  })(exports.InputApplyFunctions || (exports.InputApplyFunctions = {}));
1642
+
1039
1643
  (function (MetadataCategory) {
1040
1644
  MetadataCategory["ChildPersonal"] = "ChildPersonal";
1041
1645
  MetadataCategory["Consultation"] = "Consultation";
@@ -1065,7 +1669,9 @@ var ConsultService = /*#__PURE__*/function () {
1065
1669
  this.api = api;
1066
1670
  this.baseURL = baseURL;
1067
1671
  }
1672
+
1068
1673
  var _proto = ConsultService.prototype;
1674
+
1069
1675
  _proto.consultCreate = function consultCreate(c) {
1070
1676
  return this.api.post(this.baseURL + "/v1/consults", c);
1071
1677
  }
@@ -1085,7 +1691,9 @@ var ConsultService = /*#__PURE__*/function () {
1085
1691
  * @param filterIsoLocality the of isoLocality to filter with
1086
1692
  * @param filterAssignee array of practitioner uuids with which you want to filter the consultations
1087
1693
  * @returns a number of consult
1088
- */;
1694
+ */
1695
+ ;
1696
+
1089
1697
  _proto.countConsults = function countConsults(uuidPractice, uuidRequester, statusesMedical, statusesExclude, shortId, columnToSortTo, orderToSortTo, perPage, indexPage, filterAssignedDoctor, filterCurrentPractitioner, filterIsoLocality, filterAssignee, typesConsult, uuidParent) {
1090
1698
  return this.api.head(this.baseURL + "/v1/consults", {
1091
1699
  params: {
@@ -1109,9 +1717,11 @@ var ConsultService = /*#__PURE__*/function () {
1109
1717
  if (!resContentRange || typeof resContentRange !== 'string' && typeof resContentRange !== 'number') {
1110
1718
  return 0;
1111
1719
  }
1720
+
1112
1721
  if (typeof resContentRange === 'number') {
1113
1722
  return resContentRange;
1114
1723
  }
1724
+
1115
1725
  return parseInt(resContentRange);
1116
1726
  });
1117
1727
  }
@@ -1130,7 +1740,9 @@ var ConsultService = /*#__PURE__*/function () {
1130
1740
  * @param filterCurrentPractitioner the uuid of the current assistant assigned to filter with
1131
1741
  * @param filterIsoLocality the of isoLocality to filter with
1132
1742
  * @returns a list of consult
1133
- */;
1743
+ */
1744
+ ;
1745
+
1134
1746
  _proto.getConsults = function getConsults(uuidPractice, uuidRequester, statusesMedical, statusesExclude, shortId, columnToSortTo, orderToSortTo, perPage, indexPage, filterAssignedDoctor, filterCurrentPractitioner, filterIsoLocality, filterAssignee, uuidParent, typesConsult) {
1135
1747
  return this.api.get(this.baseURL + "/v1/consults", {
1136
1748
  params: {
@@ -1152,6 +1764,7 @@ var ConsultService = /*#__PURE__*/function () {
1152
1764
  }
1153
1765
  });
1154
1766
  };
1767
+
1155
1768
  _proto.getConsultByUUID = function getConsultByUUID(uuidConsult, uuidPractice) {
1156
1769
  return this.api.get(this.baseURL + "/v1/consults/" + uuidConsult, {
1157
1770
  params: {
@@ -1159,6 +1772,7 @@ var ConsultService = /*#__PURE__*/function () {
1159
1772
  }
1160
1773
  });
1161
1774
  };
1775
+
1162
1776
  _proto.getConsultByPracticePaymentID = function getConsultByPracticePaymentID(idPracticePayment, uuidPractice) {
1163
1777
  return this.api.get(this.baseURL + "/v1/consults/payment-" + idPracticePayment, {
1164
1778
  params: {
@@ -1166,6 +1780,7 @@ var ConsultService = /*#__PURE__*/function () {
1166
1780
  }
1167
1781
  });
1168
1782
  };
1783
+
1169
1784
  _proto.updateConsultByUUID = function updateConsultByUUID(uuidConsult, consult, uuidPractice, uuidRequester) {
1170
1785
  return this.api.put(this.baseURL + "/v1/consults/" + uuidConsult, consult, {
1171
1786
  params: {
@@ -1174,6 +1789,7 @@ var ConsultService = /*#__PURE__*/function () {
1174
1789
  }
1175
1790
  });
1176
1791
  };
1792
+
1177
1793
  _proto.getConsultFaxStatuses = function getConsultFaxStatuses(uuidConsult) {
1178
1794
  return this.api.get(this.baseURL + "/v1/consults/" + uuidConsult + "/transmissions", {
1179
1795
  params: {
@@ -1181,52 +1797,64 @@ var ConsultService = /*#__PURE__*/function () {
1181
1797
  }
1182
1798
  });
1183
1799
  };
1184
- _proto.postConsultTransmission = function postConsultTransmission(uuidConsult, nameDriver, addressOrPhoneToSendTo, file, nameReceiver, txtTransmissionTitle, txtTransmissionNotes
1185
- // numTry ?: number,
1800
+
1801
+ _proto.postConsultTransmission = function postConsultTransmission(uuidConsult, nameDriver, addressOrPhoneToSendTo, file, nameReceiver, txtTransmissionTitle, txtTransmissionNotes // numTry ?: number,
1186
1802
  // delay ?: number,
1187
1803
  ) {
1188
1804
  if (nameDriver === void 0) {
1189
1805
  nameDriver = 'Documo';
1190
1806
  }
1807
+
1191
1808
  var data = new FormData();
1192
1809
  data.append('nameDriverReceiver', nameDriver);
1810
+
1193
1811
  if (addressOrPhoneToSendTo) {
1194
1812
  data.append('addressReceiver', addressOrPhoneToSendTo);
1195
1813
  }
1814
+
1196
1815
  if (file) {
1197
1816
  data.append('file', file);
1198
1817
  }
1818
+
1199
1819
  if (nameReceiver) {
1200
1820
  data.append('nameReceiver', nameReceiver);
1201
1821
  }
1822
+
1202
1823
  if (txtTransmissionTitle) {
1203
1824
  data.append('txtTransmissionTitle', txtTransmissionTitle);
1204
1825
  }
1826
+
1205
1827
  if (txtTransmissionNotes) {
1206
1828
  data.append('txtTransmissionNotes', txtTransmissionNotes);
1207
1829
  }
1830
+
1208
1831
  return this.api.post(this.baseURL + "/v1/consults/" + uuidConsult + "/transmissions", data, {
1209
1832
  headers: {
1210
1833
  'Content-Type': 'multipart/form-data;'
1211
1834
  }
1212
1835
  });
1213
1836
  };
1837
+
1214
1838
  _proto.postConsultFax = function postConsultFax(uuidConsult, addressReceiver, file) {
1215
1839
  return this.postConsultTransmission(uuidConsult, 'Documo', addressReceiver, file);
1216
1840
  };
1841
+
1217
1842
  _proto.postConsultEmail = function postConsultEmail(uuidConsult, file) {
1218
1843
  return this.postConsultTransmission(uuidConsult, 'Pharmacierge', undefined, file);
1219
1844
  };
1845
+
1220
1846
  _proto.retryConsultFax = function retryConsultFax(uuidConsult, transmissionId) {
1221
1847
  return this.api.put(this.baseURL + "/v1/consults/" + uuidConsult + "/transmissions/" + transmissionId, {
1222
1848
  status: exports.TransmissionStatus.Retrying
1223
1849
  });
1224
1850
  };
1851
+
1225
1852
  _proto.updateConsultTransmissionStatus = function updateConsultTransmissionStatus(transmissionId, uuidConsult, newStatus) {
1226
1853
  return this.api.put(this.baseURL + "/v1/consults/" + uuidConsult + "/transmissions/" + transmissionId, {
1227
1854
  status: newStatus
1228
1855
  });
1229
1856
  };
1857
+
1230
1858
  return ConsultService;
1231
1859
  }();
1232
1860
 
@@ -1235,7 +1863,9 @@ var DiagnosisService = /*#__PURE__*/function () {
1235
1863
  this.api = api;
1236
1864
  this.baseURL = baseURL;
1237
1865
  }
1866
+
1238
1867
  var _proto = DiagnosisService.prototype;
1868
+
1239
1869
  _proto.getDiagnoses = function getDiagnoses() {
1240
1870
  return this.api.get(this.baseURL + "/v1/diagnoses");
1241
1871
  }
@@ -1243,16 +1873,25 @@ var DiagnosisService = /*#__PURE__*/function () {
1243
1873
  * Get a diagnosis by uuid that belongs to your practice
1244
1874
  * @param uuidDiagnosis the uuid of the diagnosis
1245
1875
  * @returns a diagnosis
1246
- */;
1876
+ */
1877
+ ;
1878
+
1247
1879
  _proto.getDiagnosisByUuid = function getDiagnosisByUuid(uuidDiagnosis) {
1248
1880
  return this.api.get(this.baseURL + "/v1/diagnoses/" + uuidDiagnosis);
1249
1881
  };
1882
+
1250
1883
  _proto.createDiagnosis = function createDiagnosis(diagnosis) {
1251
1884
  return this.api.post(this.baseURL + "/v1/diagnoses", diagnosis);
1252
1885
  };
1886
+
1253
1887
  _proto.updateDiagnosis = function updateDiagnosis(uuid, diagnosis) {
1254
1888
  return this.api.put(this.baseURL + "/v1/diagnoses/" + uuid, diagnosis);
1255
1889
  };
1890
+
1891
+ _proto.getTreatmentByUuid = function getTreatmentByUuid(uuidDiagnosis, uuidTreatment) {
1892
+ return this.api.get(this.baseURL + "/v1/diagnoses/" + uuidDiagnosis + "/treatments/" + uuidTreatment);
1893
+ };
1894
+
1256
1895
  _proto.getTreatmentsFromDiagnosisUuid = function getTreatmentsFromDiagnosisUuid(diagnosisUuid) {
1257
1896
  return this.api.get(this.baseURL + "/v1/diagnoses/" + diagnosisUuid + "/treatments");
1258
1897
  }
@@ -1260,7 +1899,9 @@ var DiagnosisService = /*#__PURE__*/function () {
1260
1899
  * This function returns treatment plans associated to a consult
1261
1900
  * @param uuidConsult the consult uuid to fetch
1262
1901
  * @returns an array of TreatmentPlan
1263
- */;
1902
+ */
1903
+ ;
1904
+
1264
1905
  _proto.getTreatmentPlansFromConsultUuid = function getTreatmentPlansFromConsultUuid(uuidConsult) {
1265
1906
  return this.api.get(this.baseURL + "/v1/treatment-plans/", {
1266
1907
  params: {
@@ -1272,7 +1913,9 @@ var DiagnosisService = /*#__PURE__*/function () {
1272
1913
  * creates a new treatment for the specified diagnosis
1273
1914
  * @param diagnosisUuid uuid of the diagnosis that the treatment is linked to
1274
1915
  * @param treatmentRequest the treatment to be inserted
1275
- */;
1916
+ */
1917
+ ;
1918
+
1276
1919
  _proto.createTreatment = function createTreatment(diagnosisUuid, treatmentRequest) {
1277
1920
  return this.api.post(this.baseURL + "/v1/diagnoses/" + diagnosisUuid + "/treatments", treatmentRequest);
1278
1921
  }
@@ -1280,7 +1923,9 @@ var DiagnosisService = /*#__PURE__*/function () {
1280
1923
  * This function returns populated treatment plans associated to a consult
1281
1924
  * @param uuidConsult the consult uuid to fetch
1282
1925
  * @returns a TreatmentPlans object
1283
- */;
1926
+ */
1927
+ ;
1928
+
1284
1929
  _proto.getTreatmentPlansPopulatedFromConsultUuid = function getTreatmentPlansPopulatedFromConsultUuid(uuidConsult) {
1285
1930
  return this.api.get(this.baseURL + "/v1/treatment-plans/", {
1286
1931
  params: {
@@ -1289,9 +1934,11 @@ var DiagnosisService = /*#__PURE__*/function () {
1289
1934
  }
1290
1935
  });
1291
1936
  };
1937
+
1292
1938
  _proto.postPlans = function postPlans(plans) {
1293
1939
  return this.api.post(this.baseURL + "/v1/treatment-plans", plans);
1294
1940
  };
1941
+
1295
1942
  _proto.updateTreatmentPlan = function updateTreatmentPlan(uuidPlan, uuidConsult, diagnosisRequest, plan, refill) {
1296
1943
  return this.api.put(this.baseURL + "/v1/treatment-plans/" + uuidPlan, {
1297
1944
  uuidConsult: uuidConsult,
@@ -1300,12 +1947,15 @@ var DiagnosisService = /*#__PURE__*/function () {
1300
1947
  refill: refill
1301
1948
  });
1302
1949
  };
1950
+
1303
1951
  _proto.setAssociatedConsultsToTreatment = function setAssociatedConsultsToTreatment(diagnosisUuid, treatmentUuid, arrAssociatedConsults) {
1304
1952
  return this.api.post(this.baseURL + "/v1/diagnoses/" + diagnosisUuid + "/treatments/" + treatmentUuid + "/associated-consults", arrAssociatedConsults);
1305
1953
  };
1954
+
1306
1955
  _proto.updateAssociatedConsultsToTreatment = function updateAssociatedConsultsToTreatment(diagnosisUuid, treatmentUuid, arrAssociatedConsults) {
1307
1956
  return this.api.put(this.baseURL + "/v1/diagnoses/" + diagnosisUuid + "/treatments/" + treatmentUuid + "/associated-consults", arrAssociatedConsults);
1308
1957
  };
1958
+
1309
1959
  _proto.acceptTreatmentPlan = function acceptTreatmentPlan(uuidPlan, uuidConsult) {
1310
1960
  return this.api.put(this.baseURL + "/v1/treatment-plans/" + uuidPlan + "/accept", {
1311
1961
  uuidConsult: uuidConsult
@@ -1314,37 +1964,49 @@ var DiagnosisService = /*#__PURE__*/function () {
1314
1964
  /**
1315
1965
  * retrieves all the drugs of the specified practice
1316
1966
  * @param uuidPractice
1317
- */;
1967
+ */
1968
+ ;
1969
+
1318
1970
  _proto.getAllDrugs =
1319
1971
  /*#__PURE__*/
1320
1972
  function () {
1321
- var _getAllDrugs = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(uuidPractice) {
1973
+ var _getAllDrugs = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(uuidPractice) {
1322
1974
  var res;
1323
- return _regeneratorRuntime().wrap(function _callee$(_context) {
1324
- while (1) switch (_context.prev = _context.next) {
1325
- case 0:
1326
- _context.next = 2;
1327
- return this.api.get(this.baseURL + "/v1/drugs/practice/" + uuidPractice);
1328
- case 2:
1329
- res = _context.sent;
1330
- if (!(res && res.foundDrugs)) {
1331
- _context.next = 5;
1332
- break;
1333
- }
1334
- return _context.abrupt("return", res.foundDrugs);
1335
- case 5:
1336
- return _context.abrupt("return", undefined);
1337
- case 6:
1338
- case "end":
1339
- return _context.stop();
1975
+ return runtime_1.wrap(function _callee$(_context) {
1976
+ while (1) {
1977
+ switch (_context.prev = _context.next) {
1978
+ case 0:
1979
+ _context.next = 2;
1980
+ return this.api.get(this.baseURL + "/v1/drugs/practice/" + uuidPractice);
1981
+
1982
+ case 2:
1983
+ res = _context.sent;
1984
+
1985
+ if (!(res && res.foundDrugs)) {
1986
+ _context.next = 5;
1987
+ break;
1988
+ }
1989
+
1990
+ return _context.abrupt("return", res.foundDrugs);
1991
+
1992
+ case 5:
1993
+ return _context.abrupt("return", undefined);
1994
+
1995
+ case 6:
1996
+ case "end":
1997
+ return _context.stop();
1998
+ }
1340
1999
  }
1341
2000
  }, _callee, this);
1342
2001
  }));
2002
+
1343
2003
  function getAllDrugs(_x) {
1344
2004
  return _getAllDrugs.apply(this, arguments);
1345
2005
  }
2006
+
1346
2007
  return getAllDrugs;
1347
2008
  }();
2009
+
1348
2010
  return DiagnosisService;
1349
2011
  }();
1350
2012
 
@@ -1353,6 +2015,7 @@ var GuardService = /*#__PURE__*/function () {
1353
2015
  this.api = api;
1354
2016
  this.baseURL = baseURL;
1355
2017
  this.api.setAuthRefreshFn(this.authRefresh.bind(this)); // This is the default behavior for User JWT tokens. If you want other kind of refresh you shall overwrite this call
2018
+
1356
2019
  this.identityCache = {};
1357
2020
  this.whoAmICache = {};
1358
2021
  }
@@ -1367,7 +2030,10 @@ var GuardService = /*#__PURE__*/function () {
1367
2030
  * ```
1368
2031
  * @param tokens
1369
2032
  */
2033
+
2034
+
1370
2035
  var _proto = GuardService.prototype;
2036
+
1371
2037
  _proto.setTokens = function setTokens(tokens) {
1372
2038
  this.api.setTokens(_extends({}, this.api.getTokens(), tokens));
1373
2039
  }
@@ -1376,59 +2042,76 @@ var GuardService = /*#__PURE__*/function () {
1376
2042
  *
1377
2043
  * @param req The credentials required to get an access token
1378
2044
  * @returns AuthTokenResponse
1379
- */;
2045
+ */
2046
+ ;
2047
+
1380
2048
  _proto.m2mToken =
1381
2049
  /*#__PURE__*/
1382
2050
  function () {
1383
- var _m2mToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(req) {
2051
+ var _m2mToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(req) {
1384
2052
  var resp, config, _e$response, code;
1385
- return _regeneratorRuntime().wrap(function _callee$(_context) {
1386
- while (1) switch (_context.prev = _context.next) {
1387
- case 0:
1388
- _context.prev = 0;
1389
- config = {
1390
- skipAuthRefresh: true
1391
- };
1392
- _context.next = 4;
1393
- return this.api.post(this.baseURL + "/v1/m2m/token", req, config);
1394
- case 4:
1395
- resp = _context.sent;
1396
- this.api.setTokens({
1397
- accessToken: resp.accessToken
1398
- });
1399
- _context.next = 20;
1400
- break;
1401
- case 8:
1402
- _context.prev = 8;
1403
- _context.t0 = _context["catch"](0);
1404
- console.error('Error while posting m2m token:', _context.t0);
1405
- if (!_context.t0.isAxiosError) {
1406
- _context.next = 19;
2053
+
2054
+ return runtime_1.wrap(function _callee$(_context) {
2055
+ while (1) {
2056
+ switch (_context.prev = _context.next) {
2057
+ case 0:
2058
+ _context.prev = 0;
2059
+ config = {
2060
+ skipAuthRefresh: true
2061
+ };
2062
+ _context.next = 4;
2063
+ return this.api.post(this.baseURL + "/v1/m2m/token", req, config);
2064
+
2065
+ case 4:
2066
+ resp = _context.sent;
2067
+ this.api.setTokens({
2068
+ accessToken: resp.accessToken
2069
+ });
2070
+ _context.next = 20;
1407
2071
  break;
1408
- }
1409
- code = (_e$response = _context.t0.response) == null ? void 0 : _e$response.status;
1410
- _context.t1 = code;
1411
- _context.next = _context.t1 === 400 ? 16 : _context.t1 === 500 ? 17 : _context.t1 === 401 ? 18 : 18;
1412
- break;
1413
- case 16:
1414
- throw new AuthenticationBadRequest();
1415
- case 17:
1416
- throw new AuthenticationServerError();
1417
- case 18:
1418
- throw new AuthenticationFailed();
1419
- case 19:
1420
- throw new AuthenticationFailed();
1421
- case 20:
1422
- return _context.abrupt("return", resp);
1423
- case 21:
1424
- case "end":
1425
- return _context.stop();
2072
+
2073
+ case 8:
2074
+ _context.prev = 8;
2075
+ _context.t0 = _context["catch"](0);
2076
+ console.error('Error while posting m2m token:', _context.t0);
2077
+
2078
+ if (!_context.t0.isAxiosError) {
2079
+ _context.next = 19;
2080
+ break;
2081
+ }
2082
+
2083
+ code = (_e$response = _context.t0.response) == null ? void 0 : _e$response.status;
2084
+ _context.t1 = code;
2085
+ _context.next = _context.t1 === 400 ? 16 : _context.t1 === 500 ? 17 : _context.t1 === 401 ? 18 : 18;
2086
+ break;
2087
+
2088
+ case 16:
2089
+ throw new AuthenticationBadRequest();
2090
+
2091
+ case 17:
2092
+ throw new AuthenticationServerError();
2093
+
2094
+ case 18:
2095
+ throw new AuthenticationFailed();
2096
+
2097
+ case 19:
2098
+ throw new AuthenticationFailed();
2099
+
2100
+ case 20:
2101
+ return _context.abrupt("return", resp);
2102
+
2103
+ case 21:
2104
+ case "end":
2105
+ return _context.stop();
2106
+ }
1426
2107
  }
1427
2108
  }, _callee, this, [[0, 8]]);
1428
2109
  }));
2110
+
1429
2111
  function m2mToken(_x) {
1430
2112
  return _m2mToken.apply(this, arguments);
1431
2113
  }
2114
+
1432
2115
  return m2mToken;
1433
2116
  }()
1434
2117
  /**
@@ -1439,61 +2122,78 @@ var GuardService = /*#__PURE__*/function () {
1439
2122
  * @returns AuthTokenResponse
1440
2123
  */
1441
2124
  ;
2125
+
1442
2126
  _proto.authToken =
1443
2127
  /*#__PURE__*/
1444
2128
  function () {
1445
- var _authToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(req) {
2129
+ var _authToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(req) {
1446
2130
  var resp, config, _e$response2, code;
1447
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1448
- while (1) switch (_context2.prev = _context2.next) {
1449
- case 0:
1450
- _context2.prev = 0;
1451
- config = {
1452
- skipAuthRefresh: true
1453
- };
1454
- _context2.next = 4;
1455
- return this.api.post(this.baseURL + "/v1/auth/token", req, config);
1456
- case 4:
1457
- resp = _context2.sent;
1458
- this.api.setTokens({
1459
- accessToken: resp.accessToken,
1460
- refreshToken: resp.refreshToken
1461
- });
1462
- _context2.next = 21;
1463
- break;
1464
- case 8:
1465
- _context2.prev = 8;
1466
- _context2.t0 = _context2["catch"](0);
1467
- console.error('Error while posting auth token:', _context2.t0);
1468
- if (!_context2.t0.isAxiosError) {
1469
- _context2.next = 20;
2131
+
2132
+ return runtime_1.wrap(function _callee2$(_context2) {
2133
+ while (1) {
2134
+ switch (_context2.prev = _context2.next) {
2135
+ case 0:
2136
+ _context2.prev = 0;
2137
+ config = {
2138
+ skipAuthRefresh: true
2139
+ };
2140
+ _context2.next = 4;
2141
+ return this.api.post(this.baseURL + "/v1/auth/token", req, config);
2142
+
2143
+ case 4:
2144
+ resp = _context2.sent;
2145
+ this.api.setTokens({
2146
+ accessToken: resp.accessToken,
2147
+ refreshToken: resp.refreshToken
2148
+ });
2149
+ _context2.next = 21;
1470
2150
  break;
1471
- }
1472
- code = (_e$response2 = _context2.t0.response) == null ? void 0 : _e$response2.status;
1473
- _context2.t1 = code;
1474
- _context2.next = _context2.t1 === 400 ? 16 : _context2.t1 === 424 ? 17 : _context2.t1 === 500 ? 18 : _context2.t1 === 401 ? 19 : 19;
1475
- break;
1476
- case 16:
1477
- throw new AuthenticationBadRequest();
1478
- case 17:
1479
- throw new AuthenticationUnconfirmedEmail();
1480
- case 18:
1481
- throw new AuthenticationServerError();
1482
- case 19:
1483
- throw new AuthenticationFailed();
1484
- case 20:
1485
- throw new AuthenticationFailed();
1486
- case 21:
1487
- return _context2.abrupt("return", resp);
1488
- case 22:
1489
- case "end":
1490
- return _context2.stop();
2151
+
2152
+ case 8:
2153
+ _context2.prev = 8;
2154
+ _context2.t0 = _context2["catch"](0);
2155
+ console.error('Error while posting auth token:', _context2.t0);
2156
+
2157
+ if (!_context2.t0.isAxiosError) {
2158
+ _context2.next = 20;
2159
+ break;
2160
+ }
2161
+
2162
+ code = (_e$response2 = _context2.t0.response) == null ? void 0 : _e$response2.status;
2163
+ _context2.t1 = code;
2164
+ _context2.next = _context2.t1 === 400 ? 16 : _context2.t1 === 424 ? 17 : _context2.t1 === 500 ? 18 : _context2.t1 === 401 ? 19 : 19;
2165
+ break;
2166
+
2167
+ case 16:
2168
+ throw new AuthenticationBadRequest();
2169
+
2170
+ case 17:
2171
+ throw new AuthenticationUnconfirmedEmail();
2172
+
2173
+ case 18:
2174
+ throw new AuthenticationServerError();
2175
+
2176
+ case 19:
2177
+ throw new AuthenticationFailed();
2178
+
2179
+ case 20:
2180
+ throw new AuthenticationFailed();
2181
+
2182
+ case 21:
2183
+ return _context2.abrupt("return", resp);
2184
+
2185
+ case 22:
2186
+ case "end":
2187
+ return _context2.stop();
2188
+ }
1491
2189
  }
1492
2190
  }, _callee2, this, [[0, 8]]);
1493
2191
  }));
2192
+
1494
2193
  function authToken(_x2) {
1495
2194
  return _authToken.apply(this, arguments);
1496
2195
  }
2196
+
1497
2197
  return authToken;
1498
2198
  }()
1499
2199
  /**
@@ -1502,28 +2202,34 @@ var GuardService = /*#__PURE__*/function () {
1502
2202
  * @returns AuthTokenResponse
1503
2203
  */
1504
2204
  ;
2205
+
1505
2206
  _proto.authRefresh =
1506
2207
  /*#__PURE__*/
1507
2208
  function () {
1508
- var _authRefresh = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(refreshToken) {
2209
+ var _authRefresh = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(refreshToken) {
1509
2210
  var config;
1510
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
1511
- while (1) switch (_context3.prev = _context3.next) {
1512
- case 0:
1513
- config = {
1514
- skipAuthRefresh: true,
1515
- useRefreshToken: true
1516
- };
1517
- return _context3.abrupt("return", this.api.put(this.baseURL + "/v1/auth/token", null, config));
1518
- case 2:
1519
- case "end":
1520
- return _context3.stop();
2211
+ return runtime_1.wrap(function _callee3$(_context3) {
2212
+ while (1) {
2213
+ switch (_context3.prev = _context3.next) {
2214
+ case 0:
2215
+ config = {
2216
+ skipAuthRefresh: true,
2217
+ useRefreshToken: true
2218
+ };
2219
+ return _context3.abrupt("return", this.api.put(this.baseURL + "/v1/auth/token", null, config));
2220
+
2221
+ case 2:
2222
+ case "end":
2223
+ return _context3.stop();
2224
+ }
1521
2225
  }
1522
2226
  }, _callee3, this);
1523
2227
  }));
2228
+
1524
2229
  function authRefresh(_x3) {
1525
2230
  return _authRefresh.apply(this, arguments);
1526
2231
  }
2232
+
1527
2233
  return authRefresh;
1528
2234
  }()
1529
2235
  /**
@@ -1532,23 +2238,29 @@ var GuardService = /*#__PURE__*/function () {
1532
2238
  * @returns void
1533
2239
  */
1534
2240
  ;
2241
+
1535
2242
  _proto.authLogout =
1536
2243
  /*#__PURE__*/
1537
2244
  function () {
1538
- var _authLogout = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
1539
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
1540
- while (1) switch (_context4.prev = _context4.next) {
1541
- case 0:
1542
- return _context4.abrupt("return", this.api.get(this.baseURL + "/v1/auth/logout"));
1543
- case 1:
1544
- case "end":
1545
- return _context4.stop();
2245
+ var _authLogout = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4() {
2246
+ return runtime_1.wrap(function _callee4$(_context4) {
2247
+ while (1) {
2248
+ switch (_context4.prev = _context4.next) {
2249
+ case 0:
2250
+ return _context4.abrupt("return", this.api.get(this.baseURL + "/v1/auth/logout"));
2251
+
2252
+ case 1:
2253
+ case "end":
2254
+ return _context4.stop();
2255
+ }
1546
2256
  }
1547
2257
  }, _callee4, this);
1548
2258
  }));
2259
+
1549
2260
  function authLogout() {
1550
2261
  return _authLogout.apply(this, arguments);
1551
2262
  }
2263
+
1552
2264
  return authLogout;
1553
2265
  }()
1554
2266
  /**
@@ -1558,23 +2270,29 @@ var GuardService = /*#__PURE__*/function () {
1558
2270
  * @returns void
1559
2271
  */
1560
2272
  ;
2273
+
1561
2274
  _proto.authRecover =
1562
2275
  /*#__PURE__*/
1563
2276
  function () {
1564
- var _authRecover = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(req) {
1565
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
1566
- while (1) switch (_context5.prev = _context5.next) {
1567
- case 0:
1568
- return _context5.abrupt("return", this.api.post(this.baseURL + "/v1/auth/recover", req));
1569
- case 1:
1570
- case "end":
1571
- return _context5.stop();
2277
+ var _authRecover = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(req) {
2278
+ return runtime_1.wrap(function _callee5$(_context5) {
2279
+ while (1) {
2280
+ switch (_context5.prev = _context5.next) {
2281
+ case 0:
2282
+ return _context5.abrupt("return", this.api.post(this.baseURL + "/v1/auth/recover", req));
2283
+
2284
+ case 1:
2285
+ case "end":
2286
+ return _context5.stop();
2287
+ }
1572
2288
  }
1573
2289
  }, _callee5, this);
1574
2290
  }));
2291
+
1575
2292
  function authRecover(_x4) {
1576
2293
  return _authRecover.apply(this, arguments);
1577
2294
  }
2295
+
1578
2296
  return authRecover;
1579
2297
  }()
1580
2298
  /**
@@ -1585,54 +2303,70 @@ var GuardService = /*#__PURE__*/function () {
1585
2303
  * @returns IdentityResponse
1586
2304
  */
1587
2305
  ;
2306
+
1588
2307
  _proto.identityCreate =
1589
2308
  /*#__PURE__*/
1590
2309
  function () {
1591
- var _identityCreate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(req) {
2310
+ var _identityCreate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(req) {
1592
2311
  var resp, _e$response3, code;
1593
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
1594
- while (1) switch (_context6.prev = _context6.next) {
1595
- case 0:
1596
- _context6.prev = 0;
1597
- _context6.next = 3;
1598
- return this.api.post(this.baseURL + "/v1/identities", req);
1599
- case 3:
1600
- resp = _context6.sent;
1601
- this.api.setTokens({
1602
- refreshToken: resp.refreshToken
1603
- });
1604
- _context6.next = 18;
1605
- break;
1606
- case 7:
1607
- _context6.prev = 7;
1608
- _context6.t0 = _context6["catch"](0);
1609
- if (!_context6.t0.isAxiosError) {
1610
- _context6.next = 17;
2312
+
2313
+ return runtime_1.wrap(function _callee6$(_context6) {
2314
+ while (1) {
2315
+ switch (_context6.prev = _context6.next) {
2316
+ case 0:
2317
+ _context6.prev = 0;
2318
+ _context6.next = 3;
2319
+ return this.api.post(this.baseURL + "/v1/identities", req);
2320
+
2321
+ case 3:
2322
+ resp = _context6.sent;
2323
+ this.api.setTokens({
2324
+ refreshToken: resp.refreshToken
2325
+ });
2326
+ _context6.next = 18;
1611
2327
  break;
1612
- }
1613
- code = (_e$response3 = _context6.t0.response) == null ? void 0 : _e$response3.status;
1614
- _context6.t1 = code;
1615
- _context6.next = _context6.t1 === 400 ? 14 : _context6.t1 === 409 ? 15 : _context6.t1 === 500 ? 16 : 16;
1616
- break;
1617
- case 14:
1618
- throw new IdentityCreationBadRequest();
1619
- case 15:
1620
- throw new IdentityCreationConflict();
1621
- case 16:
1622
- throw new IdentityCreationFailed();
1623
- case 17:
1624
- throw new IdentityCreationFailed();
1625
- case 18:
1626
- return _context6.abrupt("return", resp);
1627
- case 19:
1628
- case "end":
1629
- return _context6.stop();
2328
+
2329
+ case 7:
2330
+ _context6.prev = 7;
2331
+ _context6.t0 = _context6["catch"](0);
2332
+
2333
+ if (!_context6.t0.isAxiosError) {
2334
+ _context6.next = 17;
2335
+ break;
2336
+ }
2337
+
2338
+ code = (_e$response3 = _context6.t0.response) == null ? void 0 : _e$response3.status;
2339
+ _context6.t1 = code;
2340
+ _context6.next = _context6.t1 === 400 ? 14 : _context6.t1 === 409 ? 15 : _context6.t1 === 500 ? 16 : 16;
2341
+ break;
2342
+
2343
+ case 14:
2344
+ throw new IdentityCreationBadRequest();
2345
+
2346
+ case 15:
2347
+ throw new IdentityCreationConflict();
2348
+
2349
+ case 16:
2350
+ throw new IdentityCreationFailed();
2351
+
2352
+ case 17:
2353
+ throw new IdentityCreationFailed();
2354
+
2355
+ case 18:
2356
+ return _context6.abrupt("return", resp);
2357
+
2358
+ case 19:
2359
+ case "end":
2360
+ return _context6.stop();
2361
+ }
1630
2362
  }
1631
2363
  }, _callee6, this, [[0, 7]]);
1632
2364
  }));
2365
+
1633
2366
  function identityCreate(_x5) {
1634
2367
  return _identityCreate.apply(this, arguments);
1635
2368
  }
2369
+
1636
2370
  return identityCreate;
1637
2371
  }()
1638
2372
  /**
@@ -1644,46 +2378,61 @@ var GuardService = /*#__PURE__*/function () {
1644
2378
  * @returns IdentityResponse
1645
2379
  */
1646
2380
  ;
2381
+
1647
2382
  _proto.identityGet =
1648
2383
  /*#__PURE__*/
1649
2384
  function () {
1650
- var _identityGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(identityID, skipCache) {
2385
+ var _identityGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(identityID, skipCache) {
1651
2386
  var _tokens$accessToken, _tokens$refreshToken;
2387
+
1652
2388
  var tokens, cacheKey, identity;
1653
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
1654
- while (1) switch (_context7.prev = _context7.next) {
1655
- case 0:
1656
- if (skipCache === void 0) {
1657
- skipCache = false;
1658
- }
1659
- tokens = this.api.getTokens();
1660
- cacheKey = ((_tokens$accessToken = tokens.accessToken) != null ? _tokens$accessToken : '') + ((_tokens$refreshToken = tokens.refreshToken) != null ? _tokens$refreshToken : '') + identityID;
1661
- if (!(skipCache || !tokens.accessToken || !this.identityCache[cacheKey])) {
1662
- _context7.next = 10;
1663
- break;
1664
- }
1665
- _context7.next = 6;
1666
- return this.api.get(this.baseURL + "/v1/identities/" + identityID);
1667
- case 6:
1668
- identity = _context7.sent;
1669
- if (!skipCache) {
1670
- _context7.next = 9;
1671
- break;
1672
- }
1673
- return _context7.abrupt("return", identity);
1674
- case 9:
1675
- this.identityCache[cacheKey] = identity;
1676
- case 10:
1677
- return _context7.abrupt("return", this.identityCache[cacheKey]);
1678
- case 11:
1679
- case "end":
1680
- return _context7.stop();
2389
+ return runtime_1.wrap(function _callee7$(_context7) {
2390
+ while (1) {
2391
+ switch (_context7.prev = _context7.next) {
2392
+ case 0:
2393
+ if (skipCache === void 0) {
2394
+ skipCache = false;
2395
+ }
2396
+
2397
+ tokens = this.api.getTokens();
2398
+ cacheKey = ((_tokens$accessToken = tokens.accessToken) != null ? _tokens$accessToken : '') + ((_tokens$refreshToken = tokens.refreshToken) != null ? _tokens$refreshToken : '') + identityID;
2399
+
2400
+ if (!(skipCache || !tokens.accessToken || !this.identityCache[cacheKey])) {
2401
+ _context7.next = 10;
2402
+ break;
2403
+ }
2404
+
2405
+ _context7.next = 6;
2406
+ return this.api.get(this.baseURL + "/v1/identities/" + identityID);
2407
+
2408
+ case 6:
2409
+ identity = _context7.sent;
2410
+
2411
+ if (!skipCache) {
2412
+ _context7.next = 9;
2413
+ break;
2414
+ }
2415
+
2416
+ return _context7.abrupt("return", identity);
2417
+
2418
+ case 9:
2419
+ this.identityCache[cacheKey] = identity;
2420
+
2421
+ case 10:
2422
+ return _context7.abrupt("return", this.identityCache[cacheKey]);
2423
+
2424
+ case 11:
2425
+ case "end":
2426
+ return _context7.stop();
2427
+ }
1681
2428
  }
1682
2429
  }, _callee7, this);
1683
2430
  }));
2431
+
1684
2432
  function identityGet(_x6, _x7) {
1685
2433
  return _identityGet.apply(this, arguments);
1686
2434
  }
2435
+
1687
2436
  return identityGet;
1688
2437
  }()
1689
2438
  /**
@@ -1693,38 +2442,50 @@ var GuardService = /*#__PURE__*/function () {
1693
2442
  * @returns WhoAmIResponse
1694
2443
  */
1695
2444
  ;
2445
+
1696
2446
  _proto.whoAmI =
1697
2447
  /*#__PURE__*/
1698
2448
  function () {
1699
- var _whoAmI = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(refreshCache) {
2449
+ var _whoAmI = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(refreshCache) {
1700
2450
  var _this$api$getTokens$a;
2451
+
1701
2452
  var cacheKey;
1702
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
1703
- while (1) switch (_context8.prev = _context8.next) {
1704
- case 0:
1705
- if (refreshCache === void 0) {
1706
- refreshCache = false;
1707
- }
1708
- cacheKey = (_this$api$getTokens$a = this.api.getTokens().accessToken) != null ? _this$api$getTokens$a : '';
1709
- if (!(!this.whoAmICache[cacheKey] || refreshCache)) {
1710
- _context8.next = 6;
1711
- break;
1712
- }
1713
- _context8.next = 5;
1714
- return this.api.get(this.baseURL + "/v1/auth/whoami");
1715
- case 5:
1716
- this.whoAmICache[cacheKey] = _context8.sent;
1717
- case 6:
1718
- return _context8.abrupt("return", this.whoAmICache[cacheKey]);
1719
- case 7:
1720
- case "end":
1721
- return _context8.stop();
2453
+ return runtime_1.wrap(function _callee8$(_context8) {
2454
+ while (1) {
2455
+ switch (_context8.prev = _context8.next) {
2456
+ case 0:
2457
+ if (refreshCache === void 0) {
2458
+ refreshCache = false;
2459
+ }
2460
+
2461
+ cacheKey = (_this$api$getTokens$a = this.api.getTokens().accessToken) != null ? _this$api$getTokens$a : '';
2462
+
2463
+ if (!(!this.whoAmICache[cacheKey] || refreshCache)) {
2464
+ _context8.next = 6;
2465
+ break;
2466
+ }
2467
+
2468
+ _context8.next = 5;
2469
+ return this.api.get(this.baseURL + "/v1/auth/whoami");
2470
+
2471
+ case 5:
2472
+ this.whoAmICache[cacheKey] = _context8.sent;
2473
+
2474
+ case 6:
2475
+ return _context8.abrupt("return", this.whoAmICache[cacheKey]);
2476
+
2477
+ case 7:
2478
+ case "end":
2479
+ return _context8.stop();
2480
+ }
1722
2481
  }
1723
2482
  }, _callee8, this);
1724
2483
  }));
2484
+
1725
2485
  function whoAmI(_x8) {
1726
2486
  return _whoAmI.apply(this, arguments);
1727
2487
  }
2488
+
1728
2489
  return whoAmI;
1729
2490
  }()
1730
2491
  /**
@@ -1735,23 +2496,29 @@ var GuardService = /*#__PURE__*/function () {
1735
2496
  * @returns IdentityResponse
1736
2497
  */
1737
2498
  ;
2499
+
1738
2500
  _proto.identityUpdate =
1739
2501
  /*#__PURE__*/
1740
2502
  function () {
1741
- var _identityUpdate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(identityID, req) {
1742
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
1743
- while (1) switch (_context9.prev = _context9.next) {
1744
- case 0:
1745
- return _context9.abrupt("return", this.api.put(this.baseURL + "/v1/identities/" + identityID, req));
1746
- case 1:
1747
- case "end":
1748
- return _context9.stop();
2503
+ var _identityUpdate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9(identityID, req) {
2504
+ return runtime_1.wrap(function _callee9$(_context9) {
2505
+ while (1) {
2506
+ switch (_context9.prev = _context9.next) {
2507
+ case 0:
2508
+ return _context9.abrupt("return", this.api.put(this.baseURL + "/v1/identities/" + identityID, req));
2509
+
2510
+ case 1:
2511
+ case "end":
2512
+ return _context9.stop();
2513
+ }
1749
2514
  }
1750
2515
  }, _callee9, this);
1751
2516
  }));
2517
+
1752
2518
  function identityUpdate(_x9, _x10) {
1753
2519
  return _identityUpdate.apply(this, arguments);
1754
2520
  }
2521
+
1755
2522
  return identityUpdate;
1756
2523
  }()
1757
2524
  /**
@@ -1763,31 +2530,37 @@ var GuardService = /*#__PURE__*/function () {
1763
2530
  * @returns QRCodeResponse
1764
2531
  */
1765
2532
  ;
2533
+
1766
2534
  _proto.identityMFAQRCode =
1767
2535
  /*#__PURE__*/
1768
2536
  function () {
1769
- var _identityMFAQRCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(identityID, password) {
2537
+ var _identityMFAQRCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10(identityID, password) {
1770
2538
  var req;
1771
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
1772
- while (1) switch (_context10.prev = _context10.next) {
1773
- case 0:
1774
- req = {
1775
- password: password
1776
- };
1777
- return _context10.abrupt("return", this.api.post(this.baseURL + "/v1/identities/" + identityID + "/mfa", req, {
1778
- headers: {
1779
- Accept: 'application/json'
1780
- }
1781
- }));
1782
- case 2:
1783
- case "end":
1784
- return _context10.stop();
2539
+ return runtime_1.wrap(function _callee10$(_context10) {
2540
+ while (1) {
2541
+ switch (_context10.prev = _context10.next) {
2542
+ case 0:
2543
+ req = {
2544
+ password: password
2545
+ };
2546
+ return _context10.abrupt("return", this.api.post(this.baseURL + "/v1/identities/" + identityID + "/mfa", req, {
2547
+ headers: {
2548
+ Accept: 'application/json'
2549
+ }
2550
+ }));
2551
+
2552
+ case 2:
2553
+ case "end":
2554
+ return _context10.stop();
2555
+ }
1785
2556
  }
1786
2557
  }, _callee10, this);
1787
2558
  }));
2559
+
1788
2560
  function identityMFAQRCode(_x11, _x12) {
1789
2561
  return _identityMFAQRCode.apply(this, arguments);
1790
2562
  }
2563
+
1791
2564
  return identityMFAQRCode;
1792
2565
  }()
1793
2566
  /**
@@ -1797,23 +2570,29 @@ var GuardService = /*#__PURE__*/function () {
1797
2570
  * @return void
1798
2571
  */
1799
2572
  ;
2573
+
1800
2574
  _proto.identitySendConfirmEmail =
1801
2575
  /*#__PURE__*/
1802
2576
  function () {
1803
- var _identitySendConfirmEmail = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(req) {
1804
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
1805
- while (1) switch (_context11.prev = _context11.next) {
1806
- case 0:
1807
- return _context11.abrupt("return", this.api.post(this.baseURL + "/v1/identity/confirm", req));
1808
- case 1:
1809
- case "end":
1810
- return _context11.stop();
2577
+ var _identitySendConfirmEmail = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11(req) {
2578
+ return runtime_1.wrap(function _callee11$(_context11) {
2579
+ while (1) {
2580
+ switch (_context11.prev = _context11.next) {
2581
+ case 0:
2582
+ return _context11.abrupt("return", this.api.post(this.baseURL + "/v1/identity/confirm", req));
2583
+
2584
+ case 1:
2585
+ case "end":
2586
+ return _context11.stop();
2587
+ }
1811
2588
  }
1812
2589
  }, _callee11, this);
1813
2590
  }));
2591
+
1814
2592
  function identitySendConfirmEmail(_x13) {
1815
2593
  return _identitySendConfirmEmail.apply(this, arguments);
1816
2594
  }
2595
+
1817
2596
  return identitySendConfirmEmail;
1818
2597
  }()
1819
2598
  /**
@@ -1823,23 +2602,29 @@ var GuardService = /*#__PURE__*/function () {
1823
2602
  * @returns IdentityResponse
1824
2603
  */
1825
2604
  ;
2605
+
1826
2606
  _proto.identityGetByCustomerEmail =
1827
2607
  /*#__PURE__*/
1828
2608
  function () {
1829
- var _identityGetByCustomerEmail = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(email) {
1830
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
1831
- while (1) switch (_context12.prev = _context12.next) {
1832
- case 0:
1833
- return _context12.abrupt("return", this.identityGetByHash(email.substring(email.indexOf('+') + 1, email.indexOf('@'))));
1834
- case 1:
1835
- case "end":
1836
- return _context12.stop();
2609
+ var _identityGetByCustomerEmail = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee12(email) {
2610
+ return runtime_1.wrap(function _callee12$(_context12) {
2611
+ while (1) {
2612
+ switch (_context12.prev = _context12.next) {
2613
+ case 0:
2614
+ return _context12.abrupt("return", this.identityGetByHash(email.substring(email.indexOf('+') + 1, email.indexOf('@'))));
2615
+
2616
+ case 1:
2617
+ case "end":
2618
+ return _context12.stop();
2619
+ }
1837
2620
  }
1838
2621
  }, _callee12, this);
1839
2622
  }));
2623
+
1840
2624
  function identityGetByCustomerEmail(_x14) {
1841
2625
  return _identityGetByCustomerEmail.apply(this, arguments);
1842
2626
  }
2627
+
1843
2628
  return identityGetByCustomerEmail;
1844
2629
  }()
1845
2630
  /**
@@ -1849,25 +2634,32 @@ var GuardService = /*#__PURE__*/function () {
1849
2634
  * @returns IdentityResponse
1850
2635
  */
1851
2636
  ;
2637
+
1852
2638
  _proto.identityGetByHash =
1853
2639
  /*#__PURE__*/
1854
2640
  function () {
1855
- var _identityGetByHash = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(b64Hash) {
1856
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
1857
- while (1) switch (_context13.prev = _context13.next) {
1858
- case 0:
1859
- return _context13.abrupt("return", this.identityGet(b64Hash.replace(/\+/g, '-').replace(/\//g, '_')));
1860
- case 1:
1861
- case "end":
1862
- return _context13.stop();
2641
+ var _identityGetByHash = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee13(b64Hash) {
2642
+ return runtime_1.wrap(function _callee13$(_context13) {
2643
+ while (1) {
2644
+ switch (_context13.prev = _context13.next) {
2645
+ case 0:
2646
+ return _context13.abrupt("return", this.identityGet(b64Hash.replace(/\+/g, '-').replace(/\//g, '_')));
2647
+
2648
+ case 1:
2649
+ case "end":
2650
+ return _context13.stop();
2651
+ }
1863
2652
  }
1864
2653
  }, _callee13, this);
1865
2654
  }));
2655
+
1866
2656
  function identityGetByHash(_x15) {
1867
2657
  return _identityGetByHash.apply(this, arguments);
1868
2658
  }
2659
+
1869
2660
  return identityGetByHash;
1870
2661
  }();
2662
+
1871
2663
  return GuardService;
1872
2664
  }();
1873
2665
 
@@ -1881,7 +2673,10 @@ var SearchService = /*#__PURE__*/function () {
1881
2673
  * @param consultUUID
1882
2674
  * @param terms the search terms to be indexed
1883
2675
  */
2676
+
2677
+
1884
2678
  var _proto = SearchService.prototype;
2679
+
1885
2680
  _proto.index = function index(consultUUID, terms) {
1886
2681
  return this.api.post(this.baseURL + "/v1/index", {
1887
2682
  consultUUID: consultUUID,
@@ -1891,12 +2686,15 @@ var SearchService = /*#__PURE__*/function () {
1891
2686
  /**
1892
2687
  * Searches for the consultations corresponding to the search terms entered in the query
1893
2688
  * @param terms array of search terms
1894
- */;
2689
+ */
2690
+ ;
2691
+
1895
2692
  _proto.search = function search(terms) {
1896
2693
  return this.api.post(this.baseURL + "/v1/search", {
1897
2694
  terms: terms
1898
2695
  });
1899
2696
  };
2697
+
1900
2698
  return SearchService;
1901
2699
  }();
1902
2700
 
@@ -1910,7 +2708,10 @@ var PracticeService = /*#__PURE__*/function () {
1910
2708
  * an M2M with the scope `practice.practices.get`
1911
2709
  * @returns an array of practices
1912
2710
  */
2711
+
2712
+
1913
2713
  var _proto = PracticeService.prototype;
2714
+
1914
2715
  _proto.practiceGetAll = function practiceGetAll() {
1915
2716
  return this.api.get(this.baseURL + "/v1/practices");
1916
2717
  }
@@ -1921,7 +2722,9 @@ var PracticeService = /*#__PURE__*/function () {
1921
2722
  * @param hydratePracticeConfigs (optional) if set true it the Practice field configs will be set
1922
2723
  * @param accounts (optional) if set true it the Practice field accounts will be set
1923
2724
  * @returns the found practice or undefined
1924
- */;
2725
+ */
2726
+ ;
2727
+
1925
2728
  _proto.practiceGetFromURL = function practiceGetFromURL(practiceURL, params) {
1926
2729
  return this.api.get(this.baseURL + "/v1/practices", {
1927
2730
  params: _extends({
@@ -1929,6 +2732,7 @@ var PracticeService = /*#__PURE__*/function () {
1929
2732
  }, params)
1930
2733
  });
1931
2734
  };
2735
+
1932
2736
  _proto.practiceGetFromUuid = function practiceGetFromUuid(practiceUuid, locale, withAccounts) {
1933
2737
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid, {
1934
2738
  params: {
@@ -1936,13 +2740,15 @@ var PracticeService = /*#__PURE__*/function () {
1936
2740
  accounts: withAccounts
1937
2741
  }
1938
2742
  });
1939
- }
1940
- /// Practice Configs
2743
+ } /// Practice Configs
2744
+
1941
2745
  /**
1942
2746
  * This function retrieves all configs of a specific practice
1943
2747
  * @param practiceUuid uuid of the practice
1944
2748
  * @returns the practice configs
1945
- */;
2749
+ */
2750
+ ;
2751
+
1946
2752
  _proto.practiceConfigGetFromPracticeUuid = function practiceConfigGetFromPracticeUuid(practiceUuid) {
1947
2753
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/configs");
1948
2754
  }
@@ -1951,7 +2757,9 @@ var PracticeService = /*#__PURE__*/function () {
1951
2757
  * @param practiceUuid uuid of the practice
1952
2758
  * @param kind of the config
1953
2759
  * @returns the practice config
1954
- */;
2760
+ */
2761
+ ;
2762
+
1955
2763
  _proto.practiceConfigGetByKindForPracticeUuid = function practiceConfigGetByKindForPracticeUuid(practiceUuid, kind) {
1956
2764
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/configs/" + kind);
1957
2765
  }
@@ -1960,7 +2768,9 @@ var PracticeService = /*#__PURE__*/function () {
1960
2768
  * @param practiceUuid uuid of the practice
1961
2769
  * @param config the config to add to the practice
1962
2770
  * @returns the created practice config
1963
- */;
2771
+ */
2772
+ ;
2773
+
1964
2774
  _proto.practiceConfigCreateForPracticeUuid = function practiceConfigCreateForPracticeUuid(practiceUuid, config) {
1965
2775
  return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/configs", config);
1966
2776
  }
@@ -1969,15 +2779,18 @@ var PracticeService = /*#__PURE__*/function () {
1969
2779
  * @param practiceUuid uuid of the practice
1970
2780
  * @param config the config to update
1971
2781
  * @returns the practice config
1972
- */;
2782
+ */
2783
+ ;
2784
+
1973
2785
  _proto.practiceConfigUpdate = function practiceConfigUpdate(config) {
1974
2786
  return this.api.put(this.baseURL + "/v1/practices/" + config.uuidPractice + "/configs/" + config.kind, config);
1975
- }
1976
- /// Accounts
2787
+ } /// Accounts
1977
2788
  ;
2789
+
1978
2790
  _proto.practiceGetAccounts = function practiceGetAccounts(practiceUuid) {
1979
2791
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/accounts");
1980
2792
  };
2793
+
1981
2794
  _proto.practiceGetAccount = function practiceGetAccount(practiceUuid, accountUuid) {
1982
2795
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/accounts/" + accountUuid);
1983
2796
  }
@@ -1986,7 +2799,9 @@ var PracticeService = /*#__PURE__*/function () {
1986
2799
  * @param practiceUuid the uuid of the practice
1987
2800
  * @param kind (optional) the kind of WorkflowType to filter in
1988
2801
  * @returns a list of PracticeWorkflow
1989
- */;
2802
+ */
2803
+ ;
2804
+
1990
2805
  _proto.practiceGetWorkflows = function practiceGetWorkflows(practiceUuid, kind) {
1991
2806
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/workflows", {
1992
2807
  params: {
@@ -1994,11 +2809,12 @@ var PracticeService = /*#__PURE__*/function () {
1994
2809
  }
1995
2810
  });
1996
2811
  };
2812
+
1997
2813
  _proto.practiceGetWorkflow = function practiceGetWorkflow(practiceUuid, workflowType) {
1998
2814
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/workflows/" + workflowType);
1999
- }
2000
- /// Plans
2815
+ } /// Plans
2001
2816
  ;
2817
+
2002
2818
  _proto.practiceGetPlans = function practiceGetPlans(practiceUuid, planType) {
2003
2819
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/plans", {
2004
2820
  params: {
@@ -2006,14 +2822,16 @@ var PracticeService = /*#__PURE__*/function () {
2006
2822
  }
2007
2823
  });
2008
2824
  };
2825
+
2009
2826
  _proto.practiceGetPlan = function practiceGetPlan(practiceUuid, planId) {
2010
2827
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/plans/" + planId);
2011
2828
  };
2829
+
2012
2830
  _proto.practiceGetPlanPrices = function practiceGetPlanPrices(practiceUuid, planId) {
2013
2831
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/plans/" + planId + "/prices");
2014
- }
2015
- // Payments
2832
+ } // Payments
2016
2833
  ;
2834
+
2017
2835
  _proto.practiceGetPayments = function practiceGetPayments(practiceUuid, statusPayment, withConsultUUIDNULL, perPage, indexPage) {
2018
2836
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments", {
2019
2837
  params: {
@@ -2024,14 +2842,16 @@ var PracticeService = /*#__PURE__*/function () {
2024
2842
  }
2025
2843
  });
2026
2844
  };
2845
+
2027
2846
  _proto.practiceGetPayment = function practiceGetPayment(practiceUuid, idStripeInvoiceOrPaymentIntent) {
2028
2847
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/" + idStripeInvoiceOrPaymentIntent);
2029
2848
  };
2849
+
2030
2850
  _proto.practiceGetPaymentForStripePaymentIntentWithID = function practiceGetPaymentForStripePaymentIntentWithID(practiceUuid, stripePaymentIntentId) {
2031
2851
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/" + stripePaymentIntentId);
2032
- }
2033
- // Payments Intent
2852
+ } // Payments Intent
2034
2853
  ;
2854
+
2035
2855
  _proto.practiceGetPaymentsIntents = function practiceGetPaymentsIntents(practiceUuid, planType) {
2036
2856
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/intents", {
2037
2857
  params: {
@@ -2043,7 +2863,9 @@ var PracticeService = /*#__PURE__*/function () {
2043
2863
  * This function return the user hased email to be use for creating payment intent
2044
2864
  * @param email the email to hash
2045
2865
  * @returns a hashed email
2046
- */;
2866
+ */
2867
+ ;
2868
+
2047
2869
  _proto.getPaymentIntentHashedEmail = function getPaymentIntentHashedEmail(email) {
2048
2870
  return hashToBase64String(email.toLowerCase());
2049
2871
  }
@@ -2057,7 +2879,9 @@ var PracticeService = /*#__PURE__*/function () {
2057
2879
  * @param promotionCode (optional) promotion code to apply
2058
2880
  * @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.).
2059
2881
  * @returns
2060
- */;
2882
+ */
2883
+ ;
2884
+
2061
2885
  _proto.practiceCreatePaymentsIntent = function practiceCreatePaymentsIntent(practiceUuid, planId, userEmail, isoLocality, url_subdomain, requestMetadata) {
2062
2886
  return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/intents/", {
2063
2887
  idPlan: planId,
@@ -2070,6 +2894,7 @@ var PracticeService = /*#__PURE__*/function () {
2070
2894
  }
2071
2895
  });
2072
2896
  };
2897
+
2073
2898
  _proto.practiceGetPaymentsIntent = function practiceGetPaymentsIntent(practiceUuid, paymentIntentId) {
2074
2899
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/intents/" + paymentIntentId);
2075
2900
  }
@@ -2082,7 +2907,9 @@ var PracticeService = /*#__PURE__*/function () {
2082
2907
  * @param promotionCode (optional) promotional code to apply
2083
2908
  * @param finalize (optional) if true will finalize the PracticePaymentIntent and related Stripe.Invoice. Once, finalized you cannot modify the PracticePaymentIntent anymore.
2084
2909
  * @returns the updated PracticePaymentIntent
2085
- */;
2910
+ */
2911
+ ;
2912
+
2086
2913
  _proto.practiceUpdatePaymentsIntent = function practiceUpdatePaymentsIntent(practiceUuid, idPraticePaymentIntent, practicePaymentIntent, userEmail, promotionCode, finalize) {
2087
2914
  return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/intents/" + idPraticePaymentIntent, _extends({}, practicePaymentIntent, {
2088
2915
  hashUserEmail: userEmail ? this.getPaymentIntentHashedEmail(userEmail) : undefined
@@ -2097,103 +2924,125 @@ var PracticeService = /*#__PURE__*/function () {
2097
2924
  * Invoice
2098
2925
  * @param practiceUuid UUID of the practice to get the invoice from
2099
2926
  * @param invoiceId ID of the invoice in stripe
2100
- */;
2927
+ */
2928
+ ;
2929
+
2101
2930
  _proto.getInvoice = function getInvoice(practiceUuid, invoiceId) {
2102
2931
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/invoices/" + invoiceId);
2103
- }
2104
- // Practitioner
2932
+ } // Practitioner
2105
2933
  ;
2934
+
2106
2935
  _proto.practiceGetPractitioners = function practiceGetPractitioners(practiceUuid) {
2107
2936
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners");
2108
2937
  };
2938
+
2109
2939
  _proto.practiceUpdatePractitioner = function practiceUpdatePractitioner(practiceUuid, practitionerUuid, requestBody) {
2110
2940
  return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid, requestBody);
2111
2941
  };
2942
+
2112
2943
  _proto.practiceGetPractitioner = function practiceGetPractitioner(practiceUuid, practitionerUuid) {
2113
2944
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid);
2114
- }
2115
- // Practitioner Licenses
2945
+ } // Practitioner Licenses
2116
2946
  ;
2947
+
2117
2948
  _proto.practiceGetPractitionerLicenses = function practiceGetPractitionerLicenses(practiceUuid, practitionerUuid) {
2118
2949
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/licenses");
2119
2950
  };
2951
+
2120
2952
  _proto.practiceCreatePractitionerLicense = function practiceCreatePractitionerLicense(practiceUuid, practitionerUuid, requestBody) {
2121
2953
  return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/licenses", requestBody);
2122
2954
  };
2955
+
2123
2956
  _proto.practiceUpdatePractitionerLicense = function practiceUpdatePractitionerLicense(practiceUuid, practitionerUuid, licenseId, requestBody) {
2124
2957
  return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/licenses/" + licenseId, requestBody);
2125
2958
  };
2959
+
2126
2960
  _proto.practiceGetPractitionerLicense = function practiceGetPractitionerLicense(practiceUuid, practitionerUuid, licenseId) {
2127
2961
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/licenses/" + licenseId);
2128
- }
2129
- // Practitioner Preferences
2962
+ } // Practitioner Preferences
2130
2963
  ;
2964
+
2131
2965
  _proto.practiceGetPractitionerPreferences = function practiceGetPractitionerPreferences(practiceUuid, practitionerUuid) {
2132
2966
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/preferences");
2133
2967
  };
2968
+
2134
2969
  _proto.practiceCreatePractitionerPreference = function practiceCreatePractitionerPreference(practiceUuid, practitionerUuid, requestBody) {
2135
2970
  return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/preferences", requestBody);
2136
2971
  };
2972
+
2137
2973
  _proto.practiceUpdatePractitionerPreference = function practiceUpdatePractitionerPreference(practiceUuid, practitionerUuid, preferenceId, requestBody) {
2138
2974
  return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/preferences/" + preferenceId, requestBody);
2139
2975
  };
2976
+
2140
2977
  _proto.practiceGetPractitionerPreference = function practiceGetPractitionerPreference(practiceUuid, practitionerUuid, preferenceId) {
2141
2978
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/preferences/" + preferenceId);
2142
- }
2143
- // Practitioner Roles
2979
+ } // Practitioner Roles
2144
2980
  ;
2981
+
2145
2982
  _proto.practiceGetPractitionerRoles = function practiceGetPractitionerRoles(practiceUuid, practitionerUuid) {
2146
2983
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles");
2147
2984
  };
2985
+
2148
2986
  _proto.practiceCreatePractitionerRole = function practiceCreatePractitionerRole(practiceUuid, practitionerUuid, requestBody) {
2149
2987
  return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles", requestBody);
2150
2988
  };
2989
+
2151
2990
  _proto.practiceDeletePractitionerRoles = function practiceDeletePractitionerRoles(practiceUuid, practitionerUuid) {
2152
2991
  return this.api.deleteRequest(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles");
2153
2992
  };
2993
+
2154
2994
  _proto.practiceUpdatePractitionerRole = function practiceUpdatePractitionerRole(practiceUuid, practitionerUuid, roleId, requestBody) {
2155
2995
  return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles/" + roleId, requestBody);
2156
2996
  };
2997
+
2157
2998
  _proto.practiceGetPractitionerRole = function practiceGetPractitionerRole(practiceUuid, practitionerUuid, roleId) {
2158
2999
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles/" + roleId);
2159
3000
  };
3001
+
2160
3002
  _proto.practiceDeletePractitionerRole = function practiceDeletePractitionerRole(practiceUuid, practitionerUuid, roleId) {
2161
3003
  return this.api.deleteRequest(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles/" + roleId);
2162
- }
2163
- // Practitioner signature
3004
+ } // Practitioner signature
3005
+
2164
3006
  /**
2165
3007
  * This function returns the practitioner's signature as a Blob
2166
3008
  * @param practiceUuid the practice uuid of the practitioner
2167
3009
  * @param practitionerUuid the practitioner uuid
2168
3010
  * @returns a blob representing the signature
2169
- */;
3011
+ */
3012
+ ;
3013
+
2170
3014
  _proto.practiceGetPractitionerSignature = function practiceGetPractitionerSignature(practiceUuid, practitionerUuid) {
2171
3015
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/signature", {
2172
3016
  responseType: 'blob'
2173
3017
  });
2174
- }
2175
- // Assignments
3018
+ } // Assignments
2176
3019
  ;
3020
+
2177
3021
  _proto.practiceGetAssignments = function practiceGetAssignments(practiceUuid) {
2178
3022
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/assignments");
2179
3023
  };
3024
+
2180
3025
  _proto.practiceCreateAssignment = function practiceCreateAssignment(practiceUuid, requestBody) {
2181
3026
  return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/assignments", requestBody);
2182
3027
  };
3028
+
2183
3029
  _proto.practiceUpdateAssignment = function practiceUpdateAssignment(practiceUuid, assignmentId, requestBody) {
2184
3030
  return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/assignments/" + assignmentId, requestBody);
2185
3031
  };
3032
+
2186
3033
  _proto.practiceGetAssignment = function practiceGetAssignment(practiceUuid, assignmentId) {
2187
3034
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/assignments/" + assignmentId);
2188
- }
2189
- // Quotas
3035
+ } // Quotas
2190
3036
  ;
3037
+
2191
3038
  _proto.practiceGetQuotas = function practiceGetQuotas(practiceUuid) {
2192
3039
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/quotas");
2193
3040
  };
3041
+
2194
3042
  _proto.practiceGetQuota = function practiceGetQuota(practiceUuid, quotaId) {
2195
3043
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/quotas/" + quotaId);
2196
3044
  };
3045
+
2197
3046
  return PracticeService;
2198
3047
  }();
2199
3048
 
@@ -2202,35 +3051,44 @@ var TellerService = /*#__PURE__*/function () {
2202
3051
  this.api = api;
2203
3052
  this.baseURL = baseURL;
2204
3053
  }
3054
+
2205
3055
  var _proto = TellerService.prototype;
3056
+
2206
3057
  _proto.lockboxDataStore = /*#__PURE__*/function () {
2207
- var _lockboxDataStore = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(lockboxUuid, req, lockboxOwnerUuid, previousDataUuid, options) {
2208
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2209
- while (1) switch (_context.prev = _context.next) {
2210
- case 0:
2211
- if (options === void 0) {
2212
- options = {
2213
- updateMedicalStatus: true
2214
- };
2215
- }
2216
- return _context.abrupt("return", this.api.post(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/data", req, {
2217
- params: {
2218
- lockbox_owner_uuid: lockboxOwnerUuid,
2219
- data_uuid: previousDataUuid,
2220
- update_medical_status: options.updateMedicalStatus
3058
+ var _lockboxDataStore = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(lockboxUuid, req, lockboxOwnerUuid, previousDataUuid, options) {
3059
+ return runtime_1.wrap(function _callee$(_context) {
3060
+ while (1) {
3061
+ switch (_context.prev = _context.next) {
3062
+ case 0:
3063
+ if (options === void 0) {
3064
+ options = {
3065
+ updateMedicalStatus: true
3066
+ };
2221
3067
  }
2222
- }));
2223
- case 2:
2224
- case "end":
2225
- return _context.stop();
3068
+
3069
+ return _context.abrupt("return", this.api.post(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/data", req, {
3070
+ params: {
3071
+ lockbox_owner_uuid: lockboxOwnerUuid,
3072
+ data_uuid: previousDataUuid,
3073
+ update_medical_status: options.updateMedicalStatus
3074
+ }
3075
+ }));
3076
+
3077
+ case 2:
3078
+ case "end":
3079
+ return _context.stop();
3080
+ }
2226
3081
  }
2227
3082
  }, _callee, this);
2228
3083
  }));
3084
+
2229
3085
  function lockboxDataStore(_x, _x2, _x3, _x4, _x5) {
2230
3086
  return _lockboxDataStore.apply(this, arguments);
2231
3087
  }
3088
+
2232
3089
  return lockboxDataStore;
2233
3090
  }();
3091
+
2234
3092
  _proto.updateConsultByUUID = function updateConsultByUUID(patientUuid, uuidConsult, statusMedical, closedReasonType, closedReasonDescription, neverExpires) {
2235
3093
  return this.api.put(this.baseURL + "/v1/consults/" + uuidConsult, {
2236
3094
  patientUuid: patientUuid,
@@ -2248,7 +3106,9 @@ var TellerService = /*#__PURE__*/function () {
2248
3106
  * @param consultationShortId the consultation short id
2249
3107
  * @param fax the address where to send the fax
2250
3108
  * @returns void
2251
- */;
3109
+ */
3110
+ ;
3111
+
2252
3112
  _proto.notifyFaxFailed = function notifyFaxFailed(practiceUuid, consultationUuid, consultationShortId, fax) {
2253
3113
  return this.api.post(this.baseURL + "/v1/fax-failed", {
2254
3114
  consultationUuid: consultationUuid,
@@ -2265,7 +3125,9 @@ var TellerService = /*#__PURE__*/function () {
2265
3125
  * @todo - Make service only exposed route
2266
3126
  * @param uuidConsult the uuid of the consult to reassign
2267
3127
  * @param newPractitionerUuid the uuid of the practitioner that will get reassigned
2268
- */;
3128
+ */
3129
+ ;
3130
+
2269
3131
  _proto.reassignmentEmail = function reassignmentEmail(uuidConsult, newPractitionerUuid) {
2270
3132
  return this.api.post(this.baseURL + "/v1/consult/" + uuidConsult + "/reassignment-email", {
2271
3133
  newPractitionerUuid: newPractitionerUuid
@@ -2277,7 +3139,9 @@ var TellerService = /*#__PURE__*/function () {
2277
3139
  * @param consult
2278
3140
  * @param patientUuid
2279
3141
  * @returns void
2280
- */;
3142
+ */
3143
+ ;
3144
+
2281
3145
  _proto.sendOnlineFaxSuccessfulEmail = function sendOnlineFaxSuccessfulEmail(consult, patientUuid) {
2282
3146
  return this.api.post(this.baseURL + "/v1/online-fax-notify", {
2283
3147
  consult: consult,
@@ -2288,10 +3152,13 @@ var TellerService = /*#__PURE__*/function () {
2288
3152
  * This function will send an email to patient to allow them to resume the consult.
2289
3153
  * @param req the body of the resume consult request
2290
3154
  * @returns void
2291
- */;
3155
+ */
3156
+ ;
3157
+
2292
3158
  _proto.sendResumeConsultEmail = function sendResumeConsultEmail(req) {
2293
3159
  return this.api.post(this.baseURL + "/v1/resume-consult-email", req);
2294
3160
  };
3161
+
2295
3162
  return TellerService;
2296
3163
  }();
2297
3164
 
@@ -2300,85 +3167,110 @@ var VaultService = /*#__PURE__*/function () {
2300
3167
  this.api = api;
2301
3168
  this.baseURL = baseURL;
2302
3169
  }
3170
+
2303
3171
  var _proto = VaultService.prototype;
3172
+
2304
3173
  _proto.lockboxCreate = /*#__PURE__*/function () {
2305
- var _lockboxCreate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(lockboxMetadata) {
2306
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2307
- while (1) switch (_context.prev = _context.next) {
2308
- case 0:
2309
- return _context.abrupt("return", this.api.post(this.baseURL + "/v1/lockbox", lockboxMetadata));
2310
- case 1:
2311
- case "end":
2312
- return _context.stop();
3174
+ var _lockboxCreate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(lockboxMetadata) {
3175
+ return runtime_1.wrap(function _callee$(_context) {
3176
+ while (1) {
3177
+ switch (_context.prev = _context.next) {
3178
+ case 0:
3179
+ return _context.abrupt("return", this.api.post(this.baseURL + "/v1/lockbox", lockboxMetadata));
3180
+
3181
+ case 1:
3182
+ case "end":
3183
+ return _context.stop();
3184
+ }
2313
3185
  }
2314
3186
  }, _callee, this);
2315
3187
  }));
3188
+
2316
3189
  function lockboxCreate(_x) {
2317
3190
  return _lockboxCreate.apply(this, arguments);
2318
3191
  }
3192
+
2319
3193
  return lockboxCreate;
2320
3194
  }();
3195
+
2321
3196
  _proto.lockboxMetadataAdd = /*#__PURE__*/function () {
2322
- var _lockboxMetadataAdd = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(lockboxUuid, lockboxMetadata, lockboxOwnerUuid) {
2323
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2324
- while (1) switch (_context2.prev = _context2.next) {
2325
- case 0:
2326
- return _context2.abrupt("return", this.api.put(this.baseURL + "/v1/lockbox/" + lockboxUuid, lockboxMetadata, {
2327
- params: {
2328
- lockbox_owner_uuid: lockboxOwnerUuid
2329
- }
2330
- }));
2331
- case 1:
2332
- case "end":
2333
- return _context2.stop();
3197
+ var _lockboxMetadataAdd = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(lockboxUuid, lockboxMetadata, lockboxOwnerUuid) {
3198
+ return runtime_1.wrap(function _callee2$(_context2) {
3199
+ while (1) {
3200
+ switch (_context2.prev = _context2.next) {
3201
+ case 0:
3202
+ return _context2.abrupt("return", this.api.put(this.baseURL + "/v1/lockbox/" + lockboxUuid, lockboxMetadata, {
3203
+ params: {
3204
+ lockbox_owner_uuid: lockboxOwnerUuid
3205
+ }
3206
+ }));
3207
+
3208
+ case 1:
3209
+ case "end":
3210
+ return _context2.stop();
3211
+ }
2334
3212
  }
2335
3213
  }, _callee2, this);
2336
3214
  }));
3215
+
2337
3216
  function lockboxMetadataAdd(_x2, _x3, _x4) {
2338
3217
  return _lockboxMetadataAdd.apply(this, arguments);
2339
3218
  }
3219
+
2340
3220
  return lockboxMetadataAdd;
2341
3221
  }();
3222
+
2342
3223
  _proto.lockboxSecretGet = /*#__PURE__*/function () {
2343
- var _lockboxSecretGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(lockboxUuid, lockboxOwnerUuid) {
2344
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
2345
- while (1) switch (_context3.prev = _context3.next) {
2346
- case 0:
2347
- return _context3.abrupt("return", this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/secret", {
2348
- params: {
2349
- lockbox_owner_uuid: lockboxOwnerUuid
2350
- }
2351
- }));
2352
- case 1:
2353
- case "end":
2354
- return _context3.stop();
3224
+ var _lockboxSecretGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(lockboxUuid, lockboxOwnerUuid) {
3225
+ return runtime_1.wrap(function _callee3$(_context3) {
3226
+ while (1) {
3227
+ switch (_context3.prev = _context3.next) {
3228
+ case 0:
3229
+ return _context3.abrupt("return", this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/secret", {
3230
+ params: {
3231
+ lockbox_owner_uuid: lockboxOwnerUuid
3232
+ }
3233
+ }));
3234
+
3235
+ case 1:
3236
+ case "end":
3237
+ return _context3.stop();
3238
+ }
2355
3239
  }
2356
3240
  }, _callee3, this);
2357
3241
  }));
3242
+
2358
3243
  function lockboxSecretGet(_x5, _x6) {
2359
3244
  return _lockboxSecretGet.apply(this, arguments);
2360
3245
  }
3246
+
2361
3247
  return lockboxSecretGet;
2362
3248
  }();
3249
+
2363
3250
  _proto.lockboxGrant = /*#__PURE__*/function () {
2364
- var _lockboxGrant = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(lockboxUuid, req, lockboxOwnerUuid) {
2365
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
2366
- while (1) switch (_context4.prev = _context4.next) {
2367
- case 0:
2368
- return _context4.abrupt("return", this.api.post(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/grant", req, {
2369
- params: {
2370
- lockbox_owner_uuid: lockboxOwnerUuid
2371
- }
2372
- }));
2373
- case 1:
2374
- case "end":
2375
- return _context4.stop();
3251
+ var _lockboxGrant = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(lockboxUuid, req, lockboxOwnerUuid) {
3252
+ return runtime_1.wrap(function _callee4$(_context4) {
3253
+ while (1) {
3254
+ switch (_context4.prev = _context4.next) {
3255
+ case 0:
3256
+ return _context4.abrupt("return", this.api.post(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/grant", req, {
3257
+ params: {
3258
+ lockbox_owner_uuid: lockboxOwnerUuid
3259
+ }
3260
+ }));
3261
+
3262
+ case 1:
3263
+ case "end":
3264
+ return _context4.stop();
3265
+ }
2376
3266
  }
2377
3267
  }, _callee4, this);
2378
3268
  }));
3269
+
2379
3270
  function lockboxGrant(_x7, _x8, _x9) {
2380
3271
  return _lockboxGrant.apply(this, arguments);
2381
3272
  }
3273
+
2382
3274
  return lockboxGrant;
2383
3275
  }()
2384
3276
  /**
@@ -2387,23 +3279,29 @@ var VaultService = /*#__PURE__*/function () {
2387
3279
  * @returns decrypted lockboxes granted to user
2388
3280
  */
2389
3281
  ;
3282
+
2390
3283
  _proto.grantsGet =
2391
3284
  /*#__PURE__*/
2392
3285
  function () {
2393
- var _grantsGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
2394
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
2395
- while (1) switch (_context5.prev = _context5.next) {
2396
- case 0:
2397
- return _context5.abrupt("return", this.api.get(this.baseURL + "/v1/grants"));
2398
- case 1:
2399
- case "end":
2400
- return _context5.stop();
3286
+ var _grantsGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5() {
3287
+ return runtime_1.wrap(function _callee5$(_context5) {
3288
+ while (1) {
3289
+ switch (_context5.prev = _context5.next) {
3290
+ case 0:
3291
+ return _context5.abrupt("return", this.api.get(this.baseURL + "/v1/grants"));
3292
+
3293
+ case 1:
3294
+ case "end":
3295
+ return _context5.stop();
3296
+ }
2401
3297
  }
2402
3298
  }, _callee5, this);
2403
3299
  }));
3300
+
2404
3301
  function grantsGet() {
2405
3302
  return _grantsGet.apply(this, arguments);
2406
3303
  }
3304
+
2407
3305
  return grantsGet;
2408
3306
  }()
2409
3307
  /**
@@ -2417,112 +3315,141 @@ var VaultService = /*#__PURE__*/function () {
2417
3315
  * @returns
2418
3316
  */
2419
3317
  ;
3318
+
2420
3319
  _proto.lockboxDataStore =
2421
3320
  /*#__PURE__*/
2422
3321
  function () {
2423
- var _lockboxDataStore = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(lockboxUuid, req, lockboxOwnerUuid, previousDataUuid) {
2424
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
2425
- while (1) switch (_context6.prev = _context6.next) {
2426
- case 0:
2427
- return _context6.abrupt("return", this.api.post(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/data", req, {
2428
- params: {
2429
- lockbox_owner_uuid: lockboxOwnerUuid,
2430
- data_uuid: previousDataUuid
2431
- }
2432
- }));
2433
- case 1:
2434
- case "end":
2435
- return _context6.stop();
3322
+ var _lockboxDataStore = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(lockboxUuid, req, lockboxOwnerUuid, previousDataUuid) {
3323
+ return runtime_1.wrap(function _callee6$(_context6) {
3324
+ while (1) {
3325
+ switch (_context6.prev = _context6.next) {
3326
+ case 0:
3327
+ return _context6.abrupt("return", this.api.post(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/data", req, {
3328
+ params: {
3329
+ lockbox_owner_uuid: lockboxOwnerUuid,
3330
+ data_uuid: previousDataUuid
3331
+ }
3332
+ }));
3333
+
3334
+ case 1:
3335
+ case "end":
3336
+ return _context6.stop();
3337
+ }
2436
3338
  }
2437
3339
  }, _callee6, this);
2438
3340
  }));
3341
+
2439
3342
  function lockboxDataStore(_x10, _x11, _x12, _x13) {
2440
3343
  return _lockboxDataStore.apply(this, arguments);
2441
3344
  }
3345
+
2442
3346
  return lockboxDataStore;
2443
3347
  }();
3348
+
2444
3349
  _proto.lockboxDataGet = /*#__PURE__*/function () {
2445
- var _lockboxDataGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(lockboxUuid, dataUuid, lockboxOwnerUuid, stream) {
3350
+ var _lockboxDataGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(lockboxUuid, dataUuid, lockboxOwnerUuid, stream) {
2446
3351
  var data;
2447
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
2448
- while (1) switch (_context7.prev = _context7.next) {
2449
- case 0:
2450
- if (stream === void 0) {
2451
- stream = true;
2452
- }
2453
- _context7.next = 3;
2454
- return this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/data/" + dataUuid, {
2455
- params: {
2456
- lockbox_owner_uuid: lockboxOwnerUuid,
2457
- stream: stream
3352
+ return runtime_1.wrap(function _callee7$(_context7) {
3353
+ while (1) {
3354
+ switch (_context7.prev = _context7.next) {
3355
+ case 0:
3356
+ if (stream === void 0) {
3357
+ stream = true;
2458
3358
  }
2459
- });
2460
- case 3:
2461
- data = _context7.sent;
2462
- if (!stream) {
2463
- _context7.next = 6;
2464
- break;
2465
- }
2466
- return _context7.abrupt("return", {
2467
- data: data
2468
- });
2469
- case 6:
2470
- return _context7.abrupt("return", data);
2471
- case 7:
2472
- case "end":
2473
- return _context7.stop();
3359
+
3360
+ _context7.next = 3;
3361
+ return this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/data/" + dataUuid, {
3362
+ params: {
3363
+ lockbox_owner_uuid: lockboxOwnerUuid,
3364
+ stream: stream
3365
+ }
3366
+ });
3367
+
3368
+ case 3:
3369
+ data = _context7.sent;
3370
+
3371
+ if (!stream) {
3372
+ _context7.next = 6;
3373
+ break;
3374
+ }
3375
+
3376
+ return _context7.abrupt("return", {
3377
+ data: data
3378
+ });
3379
+
3380
+ case 6:
3381
+ return _context7.abrupt("return", data);
3382
+
3383
+ case 7:
3384
+ case "end":
3385
+ return _context7.stop();
3386
+ }
2474
3387
  }
2475
3388
  }, _callee7, this);
2476
3389
  }));
3390
+
2477
3391
  function lockboxDataGet(_x14, _x15, _x16, _x17) {
2478
3392
  return _lockboxDataGet.apply(this, arguments);
2479
3393
  }
3394
+
2480
3395
  return lockboxDataGet;
2481
3396
  }();
3397
+
2482
3398
  _proto.lockboxManifestGet = /*#__PURE__*/function () {
2483
- var _lockboxManifestGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(lockboxUuid, filter, lockboxOwnerUuid) {
2484
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
2485
- while (1) switch (_context8.prev = _context8.next) {
2486
- case 0:
2487
- return _context8.abrupt("return", this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid, {
2488
- params: {
2489
- lockbox_owner_uuid: lockboxOwnerUuid,
2490
- filter: filter
2491
- }
2492
- }));
2493
- case 1:
2494
- case "end":
2495
- return _context8.stop();
3399
+ var _lockboxManifestGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(lockboxUuid, filter, lockboxOwnerUuid) {
3400
+ return runtime_1.wrap(function _callee8$(_context8) {
3401
+ while (1) {
3402
+ switch (_context8.prev = _context8.next) {
3403
+ case 0:
3404
+ return _context8.abrupt("return", this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid, {
3405
+ params: {
3406
+ lockbox_owner_uuid: lockboxOwnerUuid,
3407
+ filter: filter
3408
+ }
3409
+ }));
3410
+
3411
+ case 1:
3412
+ case "end":
3413
+ return _context8.stop();
3414
+ }
2496
3415
  }
2497
3416
  }, _callee8, this);
2498
3417
  }));
3418
+
2499
3419
  function lockboxManifestGet(_x18, _x19, _x20) {
2500
3420
  return _lockboxManifestGet.apply(this, arguments);
2501
3421
  }
3422
+
2502
3423
  return lockboxManifestGet;
2503
3424
  }();
3425
+
2504
3426
  _proto.lockboxMetadataGet = /*#__PURE__*/function () {
2505
- var _lockboxMetadataGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(lockboxUuid, fields, groupby, filter, lockboxOwnerUuid) {
2506
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
2507
- while (1) switch (_context9.prev = _context9.next) {
2508
- case 0:
2509
- return _context9.abrupt("return", this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/metadata", {
2510
- params: {
2511
- lockbox_owner_uuid: lockboxOwnerUuid,
2512
- fields: fields,
2513
- groupby: groupby,
2514
- filter: filter
2515
- }
2516
- }));
2517
- case 1:
2518
- case "end":
2519
- return _context9.stop();
3427
+ var _lockboxMetadataGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9(lockboxUuid, fields, groupby, filter, lockboxOwnerUuid) {
3428
+ return runtime_1.wrap(function _callee9$(_context9) {
3429
+ while (1) {
3430
+ switch (_context9.prev = _context9.next) {
3431
+ case 0:
3432
+ return _context9.abrupt("return", this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/metadata", {
3433
+ params: {
3434
+ lockbox_owner_uuid: lockboxOwnerUuid,
3435
+ fields: fields,
3436
+ groupby: groupby,
3437
+ filter: filter
3438
+ }
3439
+ }));
3440
+
3441
+ case 1:
3442
+ case "end":
3443
+ return _context9.stop();
3444
+ }
2520
3445
  }
2521
3446
  }, _callee9, this);
2522
3447
  }));
3448
+
2523
3449
  function lockboxMetadataGet(_x21, _x22, _x23, _x24, _x25) {
2524
3450
  return _lockboxMetadataGet.apply(this, arguments);
2525
3451
  }
3452
+
2526
3453
  return lockboxMetadataGet;
2527
3454
  }()
2528
3455
  /**
@@ -2533,27 +3460,33 @@ var VaultService = /*#__PURE__*/function () {
2533
3460
  * @param indexOwnerUuid
2534
3461
  */
2535
3462
  ;
3463
+
2536
3464
  _proto.vaultIndexPut =
2537
3465
  /*#__PURE__*/
2538
3466
  function () {
2539
- var _vaultIndexPut = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(entries, indexOwnerUuid) {
2540
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
2541
- while (1) switch (_context10.prev = _context10.next) {
2542
- case 0:
2543
- return _context10.abrupt("return", this.api.put(this.baseURL + "/v1/index", entries, {
2544
- params: {
2545
- index_owner_uuid: indexOwnerUuid
2546
- }
2547
- }));
2548
- case 1:
2549
- case "end":
2550
- return _context10.stop();
3467
+ var _vaultIndexPut = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10(entries, indexOwnerUuid) {
3468
+ return runtime_1.wrap(function _callee10$(_context10) {
3469
+ while (1) {
3470
+ switch (_context10.prev = _context10.next) {
3471
+ case 0:
3472
+ return _context10.abrupt("return", this.api.put(this.baseURL + "/v1/index", entries, {
3473
+ params: {
3474
+ index_owner_uuid: indexOwnerUuid
3475
+ }
3476
+ }));
3477
+
3478
+ case 1:
3479
+ case "end":
3480
+ return _context10.stop();
3481
+ }
2551
3482
  }
2552
3483
  }, _callee10, this);
2553
3484
  }));
3485
+
2554
3486
  function vaultIndexPut(_x26, _x27) {
2555
3487
  return _vaultIndexPut.apply(this, arguments);
2556
3488
  }
3489
+
2557
3490
  return vaultIndexPut;
2558
3491
  }()
2559
3492
  /**
@@ -2562,23 +3495,29 @@ var VaultService = /*#__PURE__*/function () {
2562
3495
  * @param entry the encrypted index snapshot
2563
3496
  */
2564
3497
  ;
3498
+
2565
3499
  _proto.vaultIndexSnapshotPut =
2566
3500
  /*#__PURE__*/
2567
3501
  function () {
2568
- var _vaultIndexSnapshotPut = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(entry) {
2569
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
2570
- while (1) switch (_context11.prev = _context11.next) {
2571
- case 0:
2572
- return _context11.abrupt("return", this.api.put(this.baseURL + "/v1/index-snapshot", entry));
2573
- case 1:
2574
- case "end":
2575
- return _context11.stop();
3502
+ var _vaultIndexSnapshotPut = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11(entry) {
3503
+ return runtime_1.wrap(function _callee11$(_context11) {
3504
+ while (1) {
3505
+ switch (_context11.prev = _context11.next) {
3506
+ case 0:
3507
+ return _context11.abrupt("return", this.api.put(this.baseURL + "/v1/index-snapshot", entry));
3508
+
3509
+ case 1:
3510
+ case "end":
3511
+ return _context11.stop();
3512
+ }
2576
3513
  }
2577
3514
  }, _callee11, this);
2578
3515
  }));
3516
+
2579
3517
  function vaultIndexSnapshotPut(_x28) {
2580
3518
  return _vaultIndexSnapshotPut.apply(this, arguments);
2581
3519
  }
3520
+
2582
3521
  return vaultIndexSnapshotPut;
2583
3522
  }()
2584
3523
  /**
@@ -2590,31 +3529,38 @@ var VaultService = /*#__PURE__*/function () {
2590
3529
  * @returns the encrypted index
2591
3530
  */
2592
3531
  ;
3532
+
2593
3533
  _proto.vaultIndexGet =
2594
3534
  /*#__PURE__*/
2595
3535
  function () {
2596
- var _vaultIndexGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(indexKeys, identifiers, timestamp) {
2597
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
2598
- while (1) switch (_context12.prev = _context12.next) {
2599
- case 0:
2600
- return _context12.abrupt("return", this.api.get(this.baseURL + "/v1/index", {
2601
- params: {
2602
- index_keys: indexKeys,
2603
- identifiers: identifiers,
2604
- timestamp: timestamp
2605
- }
2606
- }));
2607
- case 1:
2608
- case "end":
2609
- return _context12.stop();
3536
+ var _vaultIndexGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee12(indexKeys, identifiers, timestamp) {
3537
+ return runtime_1.wrap(function _callee12$(_context12) {
3538
+ while (1) {
3539
+ switch (_context12.prev = _context12.next) {
3540
+ case 0:
3541
+ return _context12.abrupt("return", this.api.get(this.baseURL + "/v1/index", {
3542
+ params: {
3543
+ index_keys: indexKeys,
3544
+ identifiers: identifiers,
3545
+ timestamp: timestamp
3546
+ }
3547
+ }));
3548
+
3549
+ case 1:
3550
+ case "end":
3551
+ return _context12.stop();
3552
+ }
2610
3553
  }
2611
3554
  }, _callee12, this);
2612
3555
  }));
3556
+
2613
3557
  function vaultIndexGet(_x29, _x30, _x31) {
2614
3558
  return _vaultIndexGet.apply(this, arguments);
2615
3559
  }
3560
+
2616
3561
  return vaultIndexGet;
2617
3562
  }();
3563
+
2618
3564
  return VaultService;
2619
3565
  }();
2620
3566
 
@@ -2627,7 +3573,10 @@ var WorkflowService = /*#__PURE__*/function () {
2627
3573
  * This function returns all workflows
2628
3574
  * @returns desired workflow
2629
3575
  */
3576
+
3577
+
2630
3578
  var _proto = WorkflowService.prototype;
3579
+
2631
3580
  _proto.getWorkflows = function getWorkflows() {
2632
3581
  return this.api.get(this.v1Url + "/workflows");
2633
3582
  }
@@ -2638,7 +3587,9 @@ var WorkflowService = /*#__PURE__*/function () {
2638
3587
  * @param locale (optional) The desired locale of the workflow (default: 'en')
2639
3588
  * @param createdAt (optional) The creation date of the workflow (also used for versionning)
2640
3589
  * @returns desired workflow
2641
- */;
3590
+ */
3591
+ ;
3592
+
2642
3593
  _proto.getWorkflow = function getWorkflow(id, locale, createdAt) {
2643
3594
  return this.api.get(this.v1Url + "/workflows/" + id, {
2644
3595
  params: {
@@ -2647,6 +3598,7 @@ var WorkflowService = /*#__PURE__*/function () {
2647
3598
  }
2648
3599
  });
2649
3600
  };
3601
+
2650
3602
  return WorkflowService;
2651
3603
  }();
2652
3604
 
@@ -2657,18 +3609,20 @@ var WorkflowService = /*#__PURE__*/function () {
2657
3609
  * @param useLocalStorage (default: true) if true store tokens into local storage (only for browsers)
2658
3610
  * @returns an instance of each services with a provided url
2659
3611
  */
3612
+
2660
3613
  var init = function init(services, authenticationCallback, useLocalStorage) {
2661
3614
  if (useLocalStorage === void 0) {
2662
3615
  useLocalStorage = true;
2663
3616
  }
3617
+
2664
3618
  var tellerBaseURL = services.tellerBaseURL,
2665
- practiceBaseURL = services.practiceBaseURL,
2666
- consultBaseURL = services.consultBaseURL,
2667
- vaultBaseURL = services.vaultBaseURL,
2668
- guardBaseURL = services.guardBaseURL,
2669
- searchBaseURL = services.searchBaseURL,
2670
- workflowBaseURL = services.workflowBaseURL,
2671
- diagnosisBaseURL = services.diagnosisBaseURL;
3619
+ practiceBaseURL = services.practiceBaseURL,
3620
+ consultBaseURL = services.consultBaseURL,
3621
+ vaultBaseURL = services.vaultBaseURL,
3622
+ guardBaseURL = services.guardBaseURL,
3623
+ searchBaseURL = services.searchBaseURL,
3624
+ workflowBaseURL = services.workflowBaseURL,
3625
+ diagnosisBaseURL = services.diagnosisBaseURL;
2672
3626
  var apiService = new APIService(useLocalStorage, undefined, authenticationCallback);
2673
3627
  return {
2674
3628
  apiService: apiService,