oro-sdk-apis 4.2.4 → 4.3.0-dev1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,119 +14,433 @@ var axios = _interopDefault(require('axios'));
14
14
  * @param value the string to hash
15
15
  * @returns a base64 string representation of a hashed value
16
16
  */
17
+
17
18
  function hashToBase64String(value) {
18
19
  return _.Buffer.from(hash_js.sha256().update(value).digest('hex'), 'hex').toString('base64');
19
20
  }
20
21
 
21
- function _regeneratorRuntime() {
22
- _regeneratorRuntime = function () {
23
- return exports;
22
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
23
+ try {
24
+ var info = gen[key](arg);
25
+ var value = info.value;
26
+ } catch (error) {
27
+ reject(error);
28
+ return;
29
+ }
30
+
31
+ if (info.done) {
32
+ resolve(value);
33
+ } else {
34
+ Promise.resolve(value).then(_next, _throw);
35
+ }
36
+ }
37
+
38
+ function _asyncToGenerator(fn) {
39
+ return function () {
40
+ var self = this,
41
+ args = arguments;
42
+ return new Promise(function (resolve, reject) {
43
+ var gen = fn.apply(self, args);
44
+
45
+ function _next(value) {
46
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
47
+ }
48
+
49
+ function _throw(err) {
50
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
51
+ }
52
+
53
+ _next(undefined);
54
+ });
24
55
  };
25
- var exports = {},
26
- Op = Object.prototype,
27
- hasOwn = Op.hasOwnProperty,
28
- defineProperty = Object.defineProperty || function (obj, key, desc) {
29
- obj[key] = desc.value;
30
- },
31
- $Symbol = "function" == typeof Symbol ? Symbol : {},
32
- iteratorSymbol = $Symbol.iterator || "@@iterator",
33
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
34
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
56
+ }
57
+
58
+ function _extends() {
59
+ _extends = Object.assign || function (target) {
60
+ for (var i = 1; i < arguments.length; i++) {
61
+ var source = arguments[i];
62
+
63
+ for (var key in source) {
64
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
65
+ target[key] = source[key];
66
+ }
67
+ }
68
+ }
69
+
70
+ return target;
71
+ };
72
+
73
+ return _extends.apply(this, arguments);
74
+ }
75
+
76
+ function _inheritsLoose(subClass, superClass) {
77
+ subClass.prototype = Object.create(superClass.prototype);
78
+ subClass.prototype.constructor = subClass;
79
+
80
+ _setPrototypeOf(subClass, superClass);
81
+ }
82
+
83
+ function _getPrototypeOf(o) {
84
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
85
+ return o.__proto__ || Object.getPrototypeOf(o);
86
+ };
87
+ return _getPrototypeOf(o);
88
+ }
89
+
90
+ function _setPrototypeOf(o, p) {
91
+ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
92
+ o.__proto__ = p;
93
+ return o;
94
+ };
95
+
96
+ return _setPrototypeOf(o, p);
97
+ }
98
+
99
+ function _isNativeReflectConstruct() {
100
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
101
+ if (Reflect.construct.sham) return false;
102
+ if (typeof Proxy === "function") return true;
103
+
104
+ try {
105
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
106
+ return true;
107
+ } catch (e) {
108
+ return false;
109
+ }
110
+ }
111
+
112
+ function _construct(Parent, args, Class) {
113
+ if (_isNativeReflectConstruct()) {
114
+ _construct = Reflect.construct;
115
+ } else {
116
+ _construct = function _construct(Parent, args, Class) {
117
+ var a = [null];
118
+ a.push.apply(a, args);
119
+ var Constructor = Function.bind.apply(Parent, a);
120
+ var instance = new Constructor();
121
+ if (Class) _setPrototypeOf(instance, Class.prototype);
122
+ return instance;
123
+ };
124
+ }
125
+
126
+ return _construct.apply(null, arguments);
127
+ }
128
+
129
+ function _isNativeFunction(fn) {
130
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
131
+ }
132
+
133
+ function _wrapNativeSuper(Class) {
134
+ var _cache = typeof Map === "function" ? new Map() : undefined;
135
+
136
+ _wrapNativeSuper = function _wrapNativeSuper(Class) {
137
+ if (Class === null || !_isNativeFunction(Class)) return Class;
138
+
139
+ if (typeof Class !== "function") {
140
+ throw new TypeError("Super expression must either be null or a function");
141
+ }
142
+
143
+ if (typeof _cache !== "undefined") {
144
+ if (_cache.has(Class)) return _cache.get(Class);
145
+
146
+ _cache.set(Class, Wrapper);
147
+ }
148
+
149
+ function Wrapper() {
150
+ return _construct(Class, arguments, _getPrototypeOf(this).constructor);
151
+ }
152
+
153
+ Wrapper.prototype = Object.create(Class.prototype, {
154
+ constructor: {
155
+ value: Wrapper,
156
+ enumerable: false,
157
+ writable: true,
158
+ configurable: true
159
+ }
160
+ });
161
+ return _setPrototypeOf(Wrapper, Class);
162
+ };
163
+
164
+ return _wrapNativeSuper(Class);
165
+ }
166
+
167
+ function _assertThisInitialized(self) {
168
+ if (self === void 0) {
169
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
170
+ }
171
+
172
+ return self;
173
+ }
174
+
175
+ function createCommonjsModule(fn, module) {
176
+ return module = { exports: {} }, fn(module, module.exports), module.exports;
177
+ }
178
+
179
+ var runtime_1 = createCommonjsModule(function (module) {
180
+ /**
181
+ * Copyright (c) 2014-present, Facebook, Inc.
182
+ *
183
+ * This source code is licensed under the MIT license found in the
184
+ * LICENSE file in the root directory of this source tree.
185
+ */
186
+
187
+ var runtime = (function (exports) {
188
+
189
+ var Op = Object.prototype;
190
+ var hasOwn = Op.hasOwnProperty;
191
+ var undefined$1; // More compressible than void 0.
192
+ var $Symbol = typeof Symbol === "function" ? Symbol : {};
193
+ var iteratorSymbol = $Symbol.iterator || "@@iterator";
194
+ var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
195
+ var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
196
+
35
197
  function define(obj, key, value) {
36
- return Object.defineProperty(obj, key, {
198
+ Object.defineProperty(obj, key, {
37
199
  value: value,
38
- enumerable: !0,
39
- configurable: !0,
40
- writable: !0
41
- }), obj[key];
200
+ enumerable: true,
201
+ configurable: true,
202
+ writable: true
203
+ });
204
+ return obj[key];
42
205
  }
43
206
  try {
207
+ // IE 8 has a broken Object.defineProperty that only works on DOM objects.
44
208
  define({}, "");
45
209
  } catch (err) {
46
- define = function (obj, key, value) {
210
+ define = function(obj, key, value) {
47
211
  return obj[key] = value;
48
212
  };
49
213
  }
214
+
50
215
  function wrap(innerFn, outerFn, self, tryLocsList) {
51
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
52
- generator = Object.create(protoGenerator.prototype),
53
- context = new Context(tryLocsList || []);
54
- return defineProperty(generator, "_invoke", {
55
- value: makeInvokeMethod(innerFn, self, context)
56
- }), generator;
216
+ // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
217
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
218
+ var generator = Object.create(protoGenerator.prototype);
219
+ var context = new Context(tryLocsList || []);
220
+
221
+ // The ._invoke method unifies the implementations of the .next,
222
+ // .throw, and .return methods.
223
+ generator._invoke = makeInvokeMethod(innerFn, self, context);
224
+
225
+ return generator;
57
226
  }
227
+ exports.wrap = wrap;
228
+
229
+ // Try/catch helper to minimize deoptimizations. Returns a completion
230
+ // record like context.tryEntries[i].completion. This interface could
231
+ // have been (and was previously) designed to take a closure to be
232
+ // invoked without arguments, but in all the cases we care about we
233
+ // already have an existing method we want to call, so there's no need
234
+ // to create a new function object. We can even get away with assuming
235
+ // the method takes exactly one argument, since that happens to be true
236
+ // in every case, so we don't have to touch the arguments object. The
237
+ // only additional allocation required is the completion record, which
238
+ // has a stable shape and so hopefully should be cheap to allocate.
58
239
  function tryCatch(fn, obj, arg) {
59
240
  try {
60
- return {
61
- type: "normal",
62
- arg: fn.call(obj, arg)
63
- };
241
+ return { type: "normal", arg: fn.call(obj, arg) };
64
242
  } catch (err) {
65
- return {
66
- type: "throw",
67
- arg: err
68
- };
243
+ return { type: "throw", arg: err };
69
244
  }
70
245
  }
71
- exports.wrap = wrap;
246
+
247
+ var GenStateSuspendedStart = "suspendedStart";
248
+ var GenStateSuspendedYield = "suspendedYield";
249
+ var GenStateExecuting = "executing";
250
+ var GenStateCompleted = "completed";
251
+
252
+ // Returning this object from the innerFn has the same effect as
253
+ // breaking out of the dispatch switch statement.
72
254
  var ContinueSentinel = {};
255
+
256
+ // Dummy constructor functions that we use as the .constructor and
257
+ // .constructor.prototype properties for functions that return Generator
258
+ // objects. For full spec compliance, you may wish to configure your
259
+ // minifier not to mangle the names of these two functions.
73
260
  function Generator() {}
74
261
  function GeneratorFunction() {}
75
262
  function GeneratorFunctionPrototype() {}
263
+
264
+ // This is a polyfill for %IteratorPrototype% for environments that
265
+ // don't natively support it.
76
266
  var IteratorPrototype = {};
77
267
  define(IteratorPrototype, iteratorSymbol, function () {
78
268
  return this;
79
269
  });
80
- var getProto = Object.getPrototypeOf,
81
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
82
- NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
83
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
270
+
271
+ var getProto = Object.getPrototypeOf;
272
+ var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
273
+ if (NativeIteratorPrototype &&
274
+ NativeIteratorPrototype !== Op &&
275
+ hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
276
+ // This environment has a native %IteratorPrototype%; use it instead
277
+ // of the polyfill.
278
+ IteratorPrototype = NativeIteratorPrototype;
279
+ }
280
+
281
+ var Gp = GeneratorFunctionPrototype.prototype =
282
+ Generator.prototype = Object.create(IteratorPrototype);
283
+ GeneratorFunction.prototype = GeneratorFunctionPrototype;
284
+ define(Gp, "constructor", GeneratorFunctionPrototype);
285
+ define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
286
+ GeneratorFunction.displayName = define(
287
+ GeneratorFunctionPrototype,
288
+ toStringTagSymbol,
289
+ "GeneratorFunction"
290
+ );
291
+
292
+ // Helper for defining the .next, .throw, and .return methods of the
293
+ // Iterator interface in terms of a single ._invoke method.
84
294
  function defineIteratorMethods(prototype) {
85
- ["next", "throw", "return"].forEach(function (method) {
86
- define(prototype, method, function (arg) {
295
+ ["next", "throw", "return"].forEach(function(method) {
296
+ define(prototype, method, function(arg) {
87
297
  return this._invoke(method, arg);
88
298
  });
89
299
  });
90
300
  }
301
+
302
+ exports.isGeneratorFunction = function(genFun) {
303
+ var ctor = typeof genFun === "function" && genFun.constructor;
304
+ return ctor
305
+ ? ctor === GeneratorFunction ||
306
+ // For the native GeneratorFunction constructor, the best we can
307
+ // do is to check its .name property.
308
+ (ctor.displayName || ctor.name) === "GeneratorFunction"
309
+ : false;
310
+ };
311
+
312
+ exports.mark = function(genFun) {
313
+ if (Object.setPrototypeOf) {
314
+ Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
315
+ } else {
316
+ genFun.__proto__ = GeneratorFunctionPrototype;
317
+ define(genFun, toStringTagSymbol, "GeneratorFunction");
318
+ }
319
+ genFun.prototype = Object.create(Gp);
320
+ return genFun;
321
+ };
322
+
323
+ // Within the body of any async function, `await x` is transformed to
324
+ // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
325
+ // `hasOwn.call(value, "__await")` to determine if the yielded value is
326
+ // meant to be awaited.
327
+ exports.awrap = function(arg) {
328
+ return { __await: arg };
329
+ };
330
+
91
331
  function AsyncIterator(generator, PromiseImpl) {
92
332
  function invoke(method, arg, resolve, reject) {
93
333
  var record = tryCatch(generator[method], generator, arg);
94
- if ("throw" !== record.type) {
95
- var result = record.arg,
96
- value = result.value;
97
- return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
98
- invoke("next", value, resolve, reject);
99
- }, function (err) {
100
- invoke("throw", err, resolve, reject);
101
- }) : PromiseImpl.resolve(value).then(function (unwrapped) {
102
- result.value = unwrapped, resolve(result);
103
- }, function (error) {
334
+ if (record.type === "throw") {
335
+ reject(record.arg);
336
+ } else {
337
+ var result = record.arg;
338
+ var value = result.value;
339
+ if (value &&
340
+ typeof value === "object" &&
341
+ hasOwn.call(value, "__await")) {
342
+ return PromiseImpl.resolve(value.__await).then(function(value) {
343
+ invoke("next", value, resolve, reject);
344
+ }, function(err) {
345
+ invoke("throw", err, resolve, reject);
346
+ });
347
+ }
348
+
349
+ return PromiseImpl.resolve(value).then(function(unwrapped) {
350
+ // When a yielded Promise is resolved, its final value becomes
351
+ // the .value of the Promise<{value,done}> result for the
352
+ // current iteration.
353
+ result.value = unwrapped;
354
+ resolve(result);
355
+ }, function(error) {
356
+ // If a rejected Promise was yielded, throw the rejection back
357
+ // into the async generator function so it can be handled there.
104
358
  return invoke("throw", error, resolve, reject);
105
359
  });
106
360
  }
107
- reject(record.arg);
108
361
  }
362
+
109
363
  var previousPromise;
110
- defineProperty(this, "_invoke", {
111
- value: function (method, arg) {
112
- function callInvokeWithMethodAndArg() {
113
- return new PromiseImpl(function (resolve, reject) {
114
- invoke(method, arg, resolve, reject);
115
- });
116
- }
117
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
364
+
365
+ function enqueue(method, arg) {
366
+ function callInvokeWithMethodAndArg() {
367
+ return new PromiseImpl(function(resolve, reject) {
368
+ invoke(method, arg, resolve, reject);
369
+ });
118
370
  }
119
- });
371
+
372
+ return previousPromise =
373
+ // If enqueue has been called before, then we want to wait until
374
+ // all previous Promises have been resolved before calling invoke,
375
+ // so that results are always delivered in the correct order. If
376
+ // enqueue has not been called before, then it is important to
377
+ // call invoke immediately, without waiting on a callback to fire,
378
+ // so that the async generator function has the opportunity to do
379
+ // any necessary setup in a predictable way. This predictability
380
+ // is why the Promise constructor synchronously invokes its
381
+ // executor callback, and why async functions synchronously
382
+ // execute code before the first await. Since we implement simple
383
+ // async functions in terms of async generators, it is especially
384
+ // important to get this right, even though it requires care.
385
+ previousPromise ? previousPromise.then(
386
+ callInvokeWithMethodAndArg,
387
+ // Avoid propagating failures to Promises returned by later
388
+ // invocations of the iterator.
389
+ callInvokeWithMethodAndArg
390
+ ) : callInvokeWithMethodAndArg();
391
+ }
392
+
393
+ // Define the unified helper method that is used to implement .next,
394
+ // .throw, and .return (see defineIteratorMethods).
395
+ this._invoke = enqueue;
120
396
  }
397
+
398
+ defineIteratorMethods(AsyncIterator.prototype);
399
+ define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
400
+ return this;
401
+ });
402
+ exports.AsyncIterator = AsyncIterator;
403
+
404
+ // Note that simple async functions are implemented on top of
405
+ // AsyncIterator objects; they just return a Promise for the value of
406
+ // the final result produced by the iterator.
407
+ exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
408
+ if (PromiseImpl === void 0) PromiseImpl = Promise;
409
+
410
+ var iter = new AsyncIterator(
411
+ wrap(innerFn, outerFn, self, tryLocsList),
412
+ PromiseImpl
413
+ );
414
+
415
+ return exports.isGeneratorFunction(outerFn)
416
+ ? iter // If outerFn is a generator, return the full iterator.
417
+ : iter.next().then(function(result) {
418
+ return result.done ? result.value : iter.next();
419
+ });
420
+ };
421
+
121
422
  function makeInvokeMethod(innerFn, self, context) {
122
- var state = "suspendedStart";
123
- return function (method, arg) {
124
- if ("executing" === state) throw new Error("Generator is already running");
125
- if ("completed" === state) {
126
- if ("throw" === method) throw arg;
423
+ var state = GenStateSuspendedStart;
424
+
425
+ return function invoke(method, arg) {
426
+ if (state === GenStateExecuting) {
427
+ throw new Error("Generator is already running");
428
+ }
429
+
430
+ if (state === GenStateCompleted) {
431
+ if (method === "throw") {
432
+ throw arg;
433
+ }
434
+
435
+ // Be forgiving, per 25.3.3.3.3 of the spec:
436
+ // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
127
437
  return doneResult();
128
438
  }
129
- for (context.method = method, context.arg = arg;;) {
439
+
440
+ context.method = method;
441
+ context.arg = arg;
442
+
443
+ while (true) {
130
444
  var delegate = context.delegate;
131
445
  if (delegate) {
132
446
  var delegateResult = maybeInvokeDelegate(delegate, context);
@@ -135,407 +449,605 @@ function _regeneratorRuntime() {
135
449
  return delegateResult;
136
450
  }
137
451
  }
138
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
139
- if ("suspendedStart" === state) throw state = "completed", context.arg;
452
+
453
+ if (context.method === "next") {
454
+ // Setting context._sent for legacy support of Babel's
455
+ // function.sent implementation.
456
+ context.sent = context._sent = context.arg;
457
+
458
+ } else if (context.method === "throw") {
459
+ if (state === GenStateSuspendedStart) {
460
+ state = GenStateCompleted;
461
+ throw context.arg;
462
+ }
463
+
140
464
  context.dispatchException(context.arg);
141
- } else "return" === context.method && context.abrupt("return", context.arg);
142
- state = "executing";
465
+
466
+ } else if (context.method === "return") {
467
+ context.abrupt("return", context.arg);
468
+ }
469
+
470
+ state = GenStateExecuting;
471
+
143
472
  var record = tryCatch(innerFn, self, context);
144
- if ("normal" === record.type) {
145
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
473
+ if (record.type === "normal") {
474
+ // If an exception is thrown from innerFn, we leave state ===
475
+ // GenStateExecuting and loop back for another invocation.
476
+ state = context.done
477
+ ? GenStateCompleted
478
+ : GenStateSuspendedYield;
479
+
480
+ if (record.arg === ContinueSentinel) {
481
+ continue;
482
+ }
483
+
146
484
  return {
147
485
  value: record.arg,
148
486
  done: context.done
149
487
  };
488
+
489
+ } else if (record.type === "throw") {
490
+ state = GenStateCompleted;
491
+ // Dispatch the exception by looping back around to the
492
+ // context.dispatchException(context.arg) call above.
493
+ context.method = "throw";
494
+ context.arg = record.arg;
150
495
  }
151
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
152
496
  }
153
497
  };
154
498
  }
499
+
500
+ // Call delegate.iterator[context.method](context.arg) and handle the
501
+ // result, either by returning a { value, done } result from the
502
+ // delegate iterator, or by modifying context.method and context.arg,
503
+ // setting context.delegate to null, and returning the ContinueSentinel.
155
504
  function maybeInvokeDelegate(delegate, context) {
156
- var methodName = context.method,
157
- method = delegate.iterator[methodName];
158
- if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
505
+ var method = delegate.iterator[context.method];
506
+ if (method === undefined$1) {
507
+ // A .throw or .return when the delegate iterator has no .throw
508
+ // method always terminates the yield* loop.
509
+ context.delegate = null;
510
+
511
+ if (context.method === "throw") {
512
+ // Note: ["return"] must be used for ES3 parsing compatibility.
513
+ if (delegate.iterator["return"]) {
514
+ // If the delegate iterator has a return method, give it a
515
+ // chance to clean up.
516
+ context.method = "return";
517
+ context.arg = undefined$1;
518
+ maybeInvokeDelegate(delegate, context);
519
+
520
+ if (context.method === "throw") {
521
+ // If maybeInvokeDelegate(context) changed context.method from
522
+ // "return" to "throw", let that override the TypeError below.
523
+ return ContinueSentinel;
524
+ }
525
+ }
526
+
527
+ context.method = "throw";
528
+ context.arg = new TypeError(
529
+ "The iterator does not provide a 'throw' method");
530
+ }
531
+
532
+ return ContinueSentinel;
533
+ }
534
+
159
535
  var record = tryCatch(method, delegate.iterator, context.arg);
160
- if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
536
+
537
+ if (record.type === "throw") {
538
+ context.method = "throw";
539
+ context.arg = record.arg;
540
+ context.delegate = null;
541
+ return ContinueSentinel;
542
+ }
543
+
161
544
  var info = record.arg;
162
- return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
545
+
546
+ if (! info) {
547
+ context.method = "throw";
548
+ context.arg = new TypeError("iterator result is not an object");
549
+ context.delegate = null;
550
+ return ContinueSentinel;
551
+ }
552
+
553
+ if (info.done) {
554
+ // Assign the result of the finished delegate to the temporary
555
+ // variable specified by delegate.resultName (see delegateYield).
556
+ context[delegate.resultName] = info.value;
557
+
558
+ // Resume execution at the desired location (see delegateYield).
559
+ context.next = delegate.nextLoc;
560
+
561
+ // If context.method was "throw" but the delegate handled the
562
+ // exception, let the outer generator proceed normally. If
563
+ // context.method was "next", forget context.arg since it has been
564
+ // "consumed" by the delegate iterator. If context.method was
565
+ // "return", allow the original .return call to continue in the
566
+ // outer generator.
567
+ if (context.method !== "return") {
568
+ context.method = "next";
569
+ context.arg = undefined$1;
570
+ }
571
+
572
+ } else {
573
+ // Re-yield the result returned by the delegate method.
574
+ return info;
575
+ }
576
+
577
+ // The delegate iterator is finished, so forget it and continue with
578
+ // the outer generator.
579
+ context.delegate = null;
580
+ return ContinueSentinel;
163
581
  }
582
+
583
+ // Define Generator.prototype.{next,throw,return} in terms of the
584
+ // unified ._invoke helper method.
585
+ defineIteratorMethods(Gp);
586
+
587
+ define(Gp, toStringTagSymbol, "Generator");
588
+
589
+ // A Generator should always return itself as the iterator object when the
590
+ // @@iterator function is called on it. Some browsers' implementations of the
591
+ // iterator prototype chain incorrectly implement this, causing the Generator
592
+ // object to not be returned from this call. This ensures that doesn't happen.
593
+ // See https://github.com/facebook/regenerator/issues/274 for more details.
594
+ define(Gp, iteratorSymbol, function() {
595
+ return this;
596
+ });
597
+
598
+ define(Gp, "toString", function() {
599
+ return "[object Generator]";
600
+ });
601
+
164
602
  function pushTryEntry(locs) {
165
- var entry = {
166
- tryLoc: locs[0]
167
- };
168
- 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
603
+ var entry = { tryLoc: locs[0] };
604
+
605
+ if (1 in locs) {
606
+ entry.catchLoc = locs[1];
607
+ }
608
+
609
+ if (2 in locs) {
610
+ entry.finallyLoc = locs[2];
611
+ entry.afterLoc = locs[3];
612
+ }
613
+
614
+ this.tryEntries.push(entry);
169
615
  }
616
+
170
617
  function resetTryEntry(entry) {
171
618
  var record = entry.completion || {};
172
- record.type = "normal", delete record.arg, entry.completion = record;
619
+ record.type = "normal";
620
+ delete record.arg;
621
+ entry.completion = record;
173
622
  }
623
+
174
624
  function Context(tryLocsList) {
175
- this.tryEntries = [{
176
- tryLoc: "root"
177
- }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
625
+ // The root entry object (effectively a try statement without a catch
626
+ // or a finally block) gives us a place to store values thrown from
627
+ // locations where there is no enclosing try statement.
628
+ this.tryEntries = [{ tryLoc: "root" }];
629
+ tryLocsList.forEach(pushTryEntry, this);
630
+ this.reset(true);
178
631
  }
632
+
633
+ exports.keys = function(object) {
634
+ var keys = [];
635
+ for (var key in object) {
636
+ keys.push(key);
637
+ }
638
+ keys.reverse();
639
+
640
+ // Rather than returning an object with a next method, we keep
641
+ // things simple and return the next function itself.
642
+ return function next() {
643
+ while (keys.length) {
644
+ var key = keys.pop();
645
+ if (key in object) {
646
+ next.value = key;
647
+ next.done = false;
648
+ return next;
649
+ }
650
+ }
651
+
652
+ // To avoid creating an additional object, we just hang the .value
653
+ // and .done properties off the next function object itself. This
654
+ // also ensures that the minifier will not anonymize the function.
655
+ next.done = true;
656
+ return next;
657
+ };
658
+ };
659
+
179
660
  function values(iterable) {
180
661
  if (iterable) {
181
662
  var iteratorMethod = iterable[iteratorSymbol];
182
- if (iteratorMethod) return iteratorMethod.call(iterable);
183
- if ("function" == typeof iterable.next) return iterable;
663
+ if (iteratorMethod) {
664
+ return iteratorMethod.call(iterable);
665
+ }
666
+
667
+ if (typeof iterable.next === "function") {
668
+ return iterable;
669
+ }
670
+
184
671
  if (!isNaN(iterable.length)) {
185
- var i = -1,
186
- next = function next() {
187
- for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
188
- return next.value = undefined, next.done = !0, next;
189
- };
672
+ var i = -1, next = function next() {
673
+ while (++i < iterable.length) {
674
+ if (hasOwn.call(iterable, i)) {
675
+ next.value = iterable[i];
676
+ next.done = false;
677
+ return next;
678
+ }
679
+ }
680
+
681
+ next.value = undefined$1;
682
+ next.done = true;
683
+
684
+ return next;
685
+ };
686
+
190
687
  return next.next = next;
191
688
  }
192
689
  }
193
- return {
194
- next: doneResult
195
- };
690
+
691
+ // Return an iterator with no values.
692
+ return { next: doneResult };
196
693
  }
694
+ exports.values = values;
695
+
197
696
  function doneResult() {
198
- return {
199
- value: undefined,
200
- done: !0
201
- };
697
+ return { value: undefined$1, done: true };
202
698
  }
203
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
204
- value: GeneratorFunctionPrototype,
205
- configurable: !0
206
- }), defineProperty(GeneratorFunctionPrototype, "constructor", {
207
- value: GeneratorFunction,
208
- configurable: !0
209
- }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
210
- var ctor = "function" == typeof genFun && genFun.constructor;
211
- return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
212
- }, exports.mark = function (genFun) {
213
- return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
214
- }, exports.awrap = function (arg) {
215
- return {
216
- __await: arg
217
- };
218
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
219
- return this;
220
- }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
221
- void 0 === PromiseImpl && (PromiseImpl = Promise);
222
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
223
- return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
224
- return result.done ? result.value : iter.next();
225
- });
226
- }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
227
- return this;
228
- }), define(Gp, "toString", function () {
229
- return "[object Generator]";
230
- }), exports.keys = function (val) {
231
- var object = Object(val),
232
- keys = [];
233
- for (var key in object) keys.push(key);
234
- return keys.reverse(), function next() {
235
- for (; keys.length;) {
236
- var key = keys.pop();
237
- if (key in object) return next.value = key, next.done = !1, next;
238
- }
239
- return next.done = !0, next;
240
- };
241
- }, exports.values = values, Context.prototype = {
699
+
700
+ Context.prototype = {
242
701
  constructor: Context,
243
- reset: function (skipTempReset) {
244
- if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
702
+
703
+ reset: function(skipTempReset) {
704
+ this.prev = 0;
705
+ this.next = 0;
706
+ // Resetting context._sent for legacy support of Babel's
707
+ // function.sent implementation.
708
+ this.sent = this._sent = undefined$1;
709
+ this.done = false;
710
+ this.delegate = null;
711
+
712
+ this.method = "next";
713
+ this.arg = undefined$1;
714
+
715
+ this.tryEntries.forEach(resetTryEntry);
716
+
717
+ if (!skipTempReset) {
718
+ for (var name in this) {
719
+ // Not sure about the optimal order of these conditions:
720
+ if (name.charAt(0) === "t" &&
721
+ hasOwn.call(this, name) &&
722
+ !isNaN(+name.slice(1))) {
723
+ this[name] = undefined$1;
724
+ }
725
+ }
726
+ }
245
727
  },
246
- stop: function () {
247
- this.done = !0;
248
- var rootRecord = this.tryEntries[0].completion;
249
- if ("throw" === rootRecord.type) throw rootRecord.arg;
728
+
729
+ stop: function() {
730
+ this.done = true;
731
+
732
+ var rootEntry = this.tryEntries[0];
733
+ var rootRecord = rootEntry.completion;
734
+ if (rootRecord.type === "throw") {
735
+ throw rootRecord.arg;
736
+ }
737
+
250
738
  return this.rval;
251
739
  },
252
- dispatchException: function (exception) {
253
- if (this.done) throw exception;
740
+
741
+ dispatchException: function(exception) {
742
+ if (this.done) {
743
+ throw exception;
744
+ }
745
+
254
746
  var context = this;
255
747
  function handle(loc, caught) {
256
- return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
748
+ record.type = "throw";
749
+ record.arg = exception;
750
+ context.next = loc;
751
+
752
+ if (caught) {
753
+ // If the dispatched exception was caught by a catch block,
754
+ // then let that catch block handle the exception normally.
755
+ context.method = "next";
756
+ context.arg = undefined$1;
757
+ }
758
+
759
+ return !! caught;
257
760
  }
761
+
258
762
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
259
- var entry = this.tryEntries[i],
260
- record = entry.completion;
261
- if ("root" === entry.tryLoc) return handle("end");
763
+ var entry = this.tryEntries[i];
764
+ var record = entry.completion;
765
+
766
+ if (entry.tryLoc === "root") {
767
+ // Exception thrown outside of any try block that could handle
768
+ // it, so set the completion value of the entire function to
769
+ // throw the exception.
770
+ return handle("end");
771
+ }
772
+
262
773
  if (entry.tryLoc <= this.prev) {
263
- var hasCatch = hasOwn.call(entry, "catchLoc"),
264
- hasFinally = hasOwn.call(entry, "finallyLoc");
774
+ var hasCatch = hasOwn.call(entry, "catchLoc");
775
+ var hasFinally = hasOwn.call(entry, "finallyLoc");
776
+
265
777
  if (hasCatch && hasFinally) {
266
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
267
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
778
+ if (this.prev < entry.catchLoc) {
779
+ return handle(entry.catchLoc, true);
780
+ } else if (this.prev < entry.finallyLoc) {
781
+ return handle(entry.finallyLoc);
782
+ }
783
+
268
784
  } else if (hasCatch) {
269
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
785
+ if (this.prev < entry.catchLoc) {
786
+ return handle(entry.catchLoc, true);
787
+ }
788
+
789
+ } else if (hasFinally) {
790
+ if (this.prev < entry.finallyLoc) {
791
+ return handle(entry.finallyLoc);
792
+ }
793
+
270
794
  } else {
271
- if (!hasFinally) throw new Error("try statement without catch or finally");
272
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
795
+ throw new Error("try statement without catch or finally");
273
796
  }
274
797
  }
275
798
  }
276
799
  },
277
- abrupt: function (type, arg) {
800
+
801
+ abrupt: function(type, arg) {
278
802
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
279
803
  var entry = this.tryEntries[i];
280
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
804
+ if (entry.tryLoc <= this.prev &&
805
+ hasOwn.call(entry, "finallyLoc") &&
806
+ this.prev < entry.finallyLoc) {
281
807
  var finallyEntry = entry;
282
808
  break;
283
809
  }
284
810
  }
285
- finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
286
- var record = finallyEntry ? finallyEntry.completion : {};
287
- return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
288
- },
289
- complete: function (record, afterLoc) {
290
- if ("throw" === record.type) throw record.arg;
291
- return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
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
+
822
+ var record = finallyEntry ? finallyEntry.completion : {};
823
+ record.type = type;
824
+ record.arg = arg;
825
+
826
+ if (finallyEntry) {
827
+ this.method = "next";
828
+ this.next = finallyEntry.finallyLoc;
829
+ return ContinueSentinel;
830
+ }
831
+
832
+ return this.complete(record);
833
+ },
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["New"] = "New";
@@ -768,6 +1331,7 @@ var ApisPracticeManager = /*#__PURE__*/function () {
768
1331
  MedicalStatus["Archived"] = "Archived";
769
1332
  MedicalStatus["Failed"] = "Failed";
770
1333
  })(exports.MedicalStatus || (exports.MedicalStatus = {}));
1334
+
771
1335
  (function (TaskStatus) {
772
1336
  TaskStatus["None"] = "None";
773
1337
  TaskStatus["ToDo"] = "ToDo";
@@ -775,6 +1339,7 @@ var ApisPracticeManager = /*#__PURE__*/function () {
775
1339
  TaskStatus["Blocked"] = "Blocked";
776
1340
  TaskStatus["Done"] = "Done";
777
1341
  })(exports.TaskStatus || (exports.TaskStatus = {}));
1342
+
778
1343
  (function (ClosedReasonType) {
779
1344
  /**
780
1345
  * A completed consultation
@@ -783,18 +1348,22 @@ var ApisPracticeManager = /*#__PURE__*/function () {
783
1348
  /**
784
1349
  * The conclusion was that what the patient submitted was not a disease
785
1350
  */
1351
+
786
1352
  ClosedReasonType["NotADisease"] = "NotADisease";
787
1353
  /**
788
1354
  * The consultation was not appropriate for virtual
789
1355
  */
1356
+
790
1357
  ClosedReasonType["NotAppropriateForVirtual"] = "NotAppropriateForVirtual";
791
1358
  /**
792
1359
  * Any other reason why the consultation was closed
793
1360
  */
1361
+
794
1362
  ClosedReasonType["Other"] = "Other";
795
1363
  /**
796
1364
  * A consultation that is required to be done in person
797
1365
  */
1366
+
798
1367
  ClosedReasonType["RequiresInPerson"] = "RequiresInPerson";
799
1368
  })(exports.ClosedReasonType || (exports.ClosedReasonType = {}));
800
1369
 
@@ -803,14 +1372,17 @@ var ApisPracticeManager = /*#__PURE__*/function () {
803
1372
  VisibilityType["Private"] = "Private";
804
1373
  VisibilityType["Instance"] = "Instance";
805
1374
  })(exports.VisibilityType || (exports.VisibilityType = {}));
1375
+
806
1376
  (function (DrugType) {
807
1377
  DrugType["Generic"] = "Generic";
808
1378
  DrugType["Instance"] = "Instance";
809
1379
  })(exports.DrugType || (exports.DrugType = {}));
1380
+
810
1381
  (function (PrescriptionStatus) {
811
1382
  PrescriptionStatus["Existing"] = "Existing";
812
1383
  PrescriptionStatus["Deleted"] = "Deleted";
813
1384
  })(exports.PrescriptionStatus || (exports.PrescriptionStatus = {}));
1385
+
814
1386
  (function (PlanStatus) {
815
1387
  PlanStatus["Pending"] = "Pending";
816
1388
  PlanStatus["Accepted"] = "Accepted";
@@ -820,58 +1392,74 @@ var ApisPracticeManager = /*#__PURE__*/function () {
820
1392
 
821
1393
  var AuthenticationFailed = /*#__PURE__*/function (_Error) {
822
1394
  _inheritsLoose(AuthenticationFailed, _Error);
1395
+
823
1396
  function AuthenticationFailed() {
824
1397
  return _Error.apply(this, arguments) || this;
825
1398
  }
1399
+
826
1400
  return AuthenticationFailed;
827
1401
  }( /*#__PURE__*/_wrapNativeSuper(Error));
828
1402
  var AuthenticationBadRequest = /*#__PURE__*/function (_Error2) {
829
1403
  _inheritsLoose(AuthenticationBadRequest, _Error2);
1404
+
830
1405
  function AuthenticationBadRequest() {
831
1406
  return _Error2.apply(this, arguments) || this;
832
1407
  }
1408
+
833
1409
  return AuthenticationBadRequest;
834
1410
  }( /*#__PURE__*/_wrapNativeSuper(Error));
835
1411
  var AuthenticationServerError = /*#__PURE__*/function (_Error3) {
836
1412
  _inheritsLoose(AuthenticationServerError, _Error3);
1413
+
837
1414
  function AuthenticationServerError() {
838
1415
  return _Error3.apply(this, arguments) || this;
839
1416
  }
1417
+
840
1418
  return AuthenticationServerError;
841
1419
  }( /*#__PURE__*/_wrapNativeSuper(Error));
842
1420
  var AuthenticationUnconfirmedEmail = /*#__PURE__*/function (_Error4) {
843
1421
  _inheritsLoose(AuthenticationUnconfirmedEmail, _Error4);
1422
+
844
1423
  function AuthenticationUnconfirmedEmail() {
845
1424
  return _Error4.apply(this, arguments) || this;
846
1425
  }
1426
+
847
1427
  return AuthenticationUnconfirmedEmail;
848
1428
  }( /*#__PURE__*/_wrapNativeSuper(Error));
849
1429
  var IdentityCreationFailed = /*#__PURE__*/function (_Error5) {
850
1430
  _inheritsLoose(IdentityCreationFailed, _Error5);
1431
+
851
1432
  function IdentityCreationFailed() {
852
1433
  return _Error5.apply(this, arguments) || this;
853
1434
  }
1435
+
854
1436
  return IdentityCreationFailed;
855
1437
  }( /*#__PURE__*/_wrapNativeSuper(Error));
856
1438
  var IdentityCreationBadRequest = /*#__PURE__*/function (_Error6) {
857
1439
  _inheritsLoose(IdentityCreationBadRequest, _Error6);
1440
+
858
1441
  function IdentityCreationBadRequest() {
859
1442
  return _Error6.apply(this, arguments) || this;
860
1443
  }
1444
+
861
1445
  return IdentityCreationBadRequest;
862
1446
  }( /*#__PURE__*/_wrapNativeSuper(Error));
863
1447
  var IdentityCreationConflict = /*#__PURE__*/function (_Error7) {
864
1448
  _inheritsLoose(IdentityCreationConflict, _Error7);
1449
+
865
1450
  function IdentityCreationConflict() {
866
1451
  return _Error7.apply(this, arguments) || this;
867
1452
  }
1453
+
868
1454
  return IdentityCreationConflict;
869
1455
  }( /*#__PURE__*/_wrapNativeSuper(Error));
870
1456
  var VaultDataMissing = /*#__PURE__*/function (_Error8) {
871
1457
  _inheritsLoose(VaultDataMissing, _Error8);
1458
+
872
1459
  function VaultDataMissing() {
873
1460
  return _Error8.apply(this, arguments) || this;
874
1461
  }
1462
+
875
1463
  return VaultDataMissing;
876
1464
  }( /*#__PURE__*/_wrapNativeSuper(Error));
877
1465
 
@@ -881,6 +1469,7 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
881
1469
  WorkflowType["Renew"] = "Renew";
882
1470
  WorkflowType["DataRetrieve"] = "DataRetrieve";
883
1471
  })(exports.WorkflowType || (exports.WorkflowType = {}));
1472
+
884
1473
  (function (RateDimension) {
885
1474
  RateDimension["RatioOnTotal"] = "RatioOnTotal";
886
1475
  RateDimension["FixedOnTotal"] = "FixedOnTotal";
@@ -891,18 +1480,21 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
891
1480
  RateDimension["RatioOnItem"] = "RatioOnItem";
892
1481
  RateDimension["FixedOnItem"] = "FixedOnItem";
893
1482
  })(exports.RateDimension || (exports.RateDimension = {}));
1483
+
894
1484
  (function (PlanType) {
895
1485
  PlanType["Onboard"] = "Onboard";
896
1486
  PlanType["Followup"] = "Followup";
897
1487
  PlanType["Renew"] = "Renew";
898
1488
  PlanType["DataRetrieve"] = "DataRetrieve";
899
1489
  })(exports.PlanType || (exports.PlanType = {}));
1490
+
900
1491
  (function (PaymentStatus) {
901
1492
  PaymentStatus["Pending"] = "Pending";
902
1493
  PaymentStatus["Success"] = "Success";
903
1494
  PaymentStatus["Failure"] = "Failure";
904
1495
  PaymentStatus["Canceled"] = "Canceled";
905
1496
  })(exports.PaymentStatus || (exports.PaymentStatus = {}));
1497
+
906
1498
  (function (PractitionerStatus) {
907
1499
  PractitionerStatus["Practicing"] = "Practicing";
908
1500
  PractitionerStatus["Retired"] = "Retired";
@@ -912,11 +1504,13 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
912
1504
  PractitionerStatus["InConflict"] = "InConflict";
913
1505
  PractitionerStatus["Delicensed"] = "Delicensed";
914
1506
  })(exports.PractitionerStatus || (exports.PractitionerStatus = {}));
1507
+
915
1508
  (function (AssignmentStatus) {
916
1509
  AssignmentStatus["Assigned"] = "Assigned";
917
1510
  AssignmentStatus["Reassigned"] = "Reassigned";
918
1511
  AssignmentStatus["Cancelled"] = "Cancelled";
919
1512
  })(exports.AssignmentStatus || (exports.AssignmentStatus = {}));
1513
+
920
1514
  (function (PractitionnerRoleType) {
921
1515
  PractitionnerRoleType["Doctor"] = "Doctor";
922
1516
  PractitionnerRoleType["MedicalAssistant"] = "MedicalAssistant";
@@ -928,11 +1522,13 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
928
1522
  PractitionnerRoleType["ManualDispatcher"] = "ManualDispatcher";
929
1523
  PractitionnerRoleType["Other"] = "Other";
930
1524
  })(exports.PractitionnerRoleType || (exports.PractitionnerRoleType = {}));
1525
+
931
1526
  (function (OtherRoleType) {
932
1527
  OtherRoleType["Patient"] = "Patient";
933
1528
  OtherRoleType["User"] = "User";
934
1529
  OtherRoleType["System"] = "System";
935
1530
  })(exports.OtherRoleType || (exports.OtherRoleType = {}));
1531
+
936
1532
  (function (LicenseStatus) {
937
1533
  LicenseStatus["Valid"] = "Valid";
938
1534
  LicenseStatus["Invalid"] = "Invalid";
@@ -940,6 +1536,7 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
940
1536
  LicenseStatus["NA"] = "NA";
941
1537
  LicenseStatus["Removed"] = "Removed";
942
1538
  })(exports.LicenseStatus || (exports.LicenseStatus = {}));
1539
+
943
1540
  (function (PeriodType) {
944
1541
  PeriodType["PerYear"] = "PerYear";
945
1542
  PeriodType["PerQuarter"] = "PerQuarter";
@@ -949,6 +1546,7 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
949
1546
  PeriodType["PerDay"] = "PerDay";
950
1547
  PeriodType["PerHour"] = "PerHour";
951
1548
  })(exports.PeriodType || (exports.PeriodType = {}));
1549
+
952
1550
  (function (SyncStatus) {
953
1551
  SyncStatus["Requested"] = "Requested";
954
1552
  SyncStatus["Started"] = "Started";
@@ -956,6 +1554,7 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
956
1554
  SyncStatus["Failed"] = "Failed";
957
1555
  SyncStatus["Cancelled"] = "Cancelled";
958
1556
  })(exports.SyncStatus || (exports.SyncStatus = {}));
1557
+
959
1558
  (function (PracticeEmailKind) {
960
1559
  PracticeEmailKind["SignedUp"] = "SignedUp";
961
1560
  PracticeEmailKind["Onboarded"] = "Onboarded";
@@ -974,6 +1573,7 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
974
1573
  PracticeEmailKind["OnlinePharmacyFaxSent"] = "OnlinePharmacyFaxSent";
975
1574
  PracticeEmailKind["ResumeConsult"] = "ResumeConsult";
976
1575
  })(exports.PracticeEmailKind || (exports.PracticeEmailKind = {}));
1576
+
977
1577
  (function (PracticeConfigKind) {
978
1578
  PracticeConfigKind["PatientConsultCard"] = "PatientConsultCard";
979
1579
  PracticeConfigKind["PracticeCloseConsultationTypes"] = "PracticeCloseConsultationTypes";
@@ -995,10 +1595,12 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
995
1595
  PracticeConfigKind["PracticeDiagnosisAndTreatment"] = "PracticeDiagnosisAndTreatment";
996
1596
  PracticeConfigKind["PracticeInfoLetterDiscount"] = "PracticeInfoLetterDiscount";
997
1597
  })(exports.PracticeConfigKind || (exports.PracticeConfigKind = {}));
1598
+
998
1599
  (function (StripePriceType) {
999
1600
  StripePriceType["Default"] = "Default";
1000
1601
  StripePriceType["Discount"] = "Discount";
1001
1602
  })(exports.StripePriceType || (exports.StripePriceType = {}));
1603
+
1002
1604
  (function (PaymentIntentRequestMetadataKind) {
1003
1605
  PaymentIntentRequestMetadataKind["ConsultRequestMetadata"] = "ConsultRequestMetadata";
1004
1606
  PaymentIntentRequestMetadataKind["RefillTreatmentRequestMetadata"] = "RefillTreatmentRequestMetadata";
@@ -1009,6 +1611,7 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
1009
1611
  IndexKey["IndexSnapshot"] = "IndexSnapshot";
1010
1612
  IndexKey["ConsultationLockbox"] = "ConsultationLockbox";
1011
1613
  })(exports.IndexKey || (exports.IndexKey = {}));
1614
+
1012
1615
  (function (DocumentType) {
1013
1616
  DocumentType["Message"] = "Message";
1014
1617
  DocumentType["Note"] = "Note";
@@ -1033,6 +1636,7 @@ var VaultDataMissing = /*#__PURE__*/function (_Error8) {
1033
1636
  InputApplyFunctions["AllAlphanumeric"] = "AllAlphanumeric";
1034
1637
  InputApplyFunctions["NoSpaces"] = "NoSpaces";
1035
1638
  })(exports.InputApplyFunctions || (exports.InputApplyFunctions = {}));
1639
+
1036
1640
  (function (MetadataCategory) {
1037
1641
  MetadataCategory["ChildPersonal"] = "ChildPersonal";
1038
1642
  MetadataCategory["Consultation"] = "Consultation";
@@ -1062,7 +1666,9 @@ var ConsultService = /*#__PURE__*/function () {
1062
1666
  this.api = api;
1063
1667
  this.baseURL = baseURL;
1064
1668
  }
1669
+
1065
1670
  var _proto = ConsultService.prototype;
1671
+
1066
1672
  _proto.consultCreate = function consultCreate(c) {
1067
1673
  return this.api.post(this.baseURL + "/v1/consults", c);
1068
1674
  }
@@ -1082,7 +1688,9 @@ var ConsultService = /*#__PURE__*/function () {
1082
1688
  * @param filterIsoLocality the of isoLocality to filter with
1083
1689
  * @param filterAssignee array of practitioner uuids with which you want to filter the consultations
1084
1690
  * @returns a number of consult
1085
- */;
1691
+ */
1692
+ ;
1693
+
1086
1694
  _proto.countConsults = function countConsults(uuidPractice, uuidRequester, statusesMedical, statusesExclude, shortId, columnToSortTo, orderToSortTo, perPage, indexPage, filterAssignedDoctor, filterCurrentPractitioner, filterIsoLocality, filterAssignee, typesConsult, uuidParent) {
1087
1695
  return this.api.head(this.baseURL + "/v1/consults", {
1088
1696
  params: {
@@ -1106,9 +1714,11 @@ var ConsultService = /*#__PURE__*/function () {
1106
1714
  if (!resContentRange || typeof resContentRange !== 'string' && typeof resContentRange !== 'number') {
1107
1715
  return 0;
1108
1716
  }
1717
+
1109
1718
  if (typeof resContentRange === 'number') {
1110
1719
  return resContentRange;
1111
1720
  }
1721
+
1112
1722
  return parseInt(resContentRange);
1113
1723
  });
1114
1724
  }
@@ -1127,7 +1737,9 @@ var ConsultService = /*#__PURE__*/function () {
1127
1737
  * @param filterCurrentPractitioner the uuid of the current assistant assigned to filter with
1128
1738
  * @param filterIsoLocality the of isoLocality to filter with
1129
1739
  * @returns a list of consult
1130
- */;
1740
+ */
1741
+ ;
1742
+
1131
1743
  _proto.getConsults = function getConsults(uuidPractice, uuidRequester, statusesMedical, statusesExclude, shortId, columnToSortTo, orderToSortTo, perPage, indexPage, filterAssignedDoctor, filterCurrentPractitioner, filterIsoLocality, filterAssignee, uuidParent, typesConsult) {
1132
1744
  return this.api.get(this.baseURL + "/v1/consults", {
1133
1745
  params: {
@@ -1149,6 +1761,7 @@ var ConsultService = /*#__PURE__*/function () {
1149
1761
  }
1150
1762
  });
1151
1763
  };
1764
+
1152
1765
  _proto.getConsultByUUID = function getConsultByUUID(uuidConsult, uuidPractice) {
1153
1766
  return this.api.get(this.baseURL + "/v1/consults/" + uuidConsult, {
1154
1767
  params: {
@@ -1156,6 +1769,7 @@ var ConsultService = /*#__PURE__*/function () {
1156
1769
  }
1157
1770
  });
1158
1771
  };
1772
+
1159
1773
  _proto.updateConsultByUUID = function updateConsultByUUID(uuidConsult, consult, uuidPractice, uuidRequester) {
1160
1774
  return this.api.put(this.baseURL + "/v1/consults/" + uuidConsult, consult, {
1161
1775
  params: {
@@ -1164,6 +1778,7 @@ var ConsultService = /*#__PURE__*/function () {
1164
1778
  }
1165
1779
  });
1166
1780
  };
1781
+
1167
1782
  _proto.getConsultFaxStatuses = function getConsultFaxStatuses(uuidConsult) {
1168
1783
  return this.api.get(this.baseURL + "/v1/consults/" + uuidConsult + "/transmissions", {
1169
1784
  params: {
@@ -1171,52 +1786,64 @@ var ConsultService = /*#__PURE__*/function () {
1171
1786
  }
1172
1787
  });
1173
1788
  };
1174
- _proto.postConsultTransmission = function postConsultTransmission(uuidConsult, nameDriver, addressOrPhoneToSendTo, file, nameReceiver, txtTransmissionTitle, txtTransmissionNotes
1175
- // numTry ?: number,
1789
+
1790
+ _proto.postConsultTransmission = function postConsultTransmission(uuidConsult, nameDriver, addressOrPhoneToSendTo, file, nameReceiver, txtTransmissionTitle, txtTransmissionNotes // numTry ?: number,
1176
1791
  // delay ?: number,
1177
1792
  ) {
1178
1793
  if (nameDriver === void 0) {
1179
1794
  nameDriver = 'Documo';
1180
1795
  }
1796
+
1181
1797
  var data = new FormData();
1182
1798
  data.append('nameDriverReceiver', nameDriver);
1799
+
1183
1800
  if (addressOrPhoneToSendTo) {
1184
1801
  data.append('addressReceiver', addressOrPhoneToSendTo);
1185
1802
  }
1803
+
1186
1804
  if (file) {
1187
1805
  data.append('file', file);
1188
1806
  }
1807
+
1189
1808
  if (nameReceiver) {
1190
1809
  data.append('nameReceiver', nameReceiver);
1191
1810
  }
1811
+
1192
1812
  if (txtTransmissionTitle) {
1193
1813
  data.append('txtTransmissionTitle', txtTransmissionTitle);
1194
1814
  }
1815
+
1195
1816
  if (txtTransmissionNotes) {
1196
1817
  data.append('txtTransmissionNotes', txtTransmissionNotes);
1197
1818
  }
1819
+
1198
1820
  return this.api.post(this.baseURL + "/v1/consults/" + uuidConsult + "/transmissions", data, {
1199
1821
  headers: {
1200
1822
  'Content-Type': 'multipart/form-data;'
1201
1823
  }
1202
1824
  });
1203
1825
  };
1826
+
1204
1827
  _proto.postConsultFax = function postConsultFax(uuidConsult, addressReceiver, file) {
1205
1828
  return this.postConsultTransmission(uuidConsult, 'Documo', addressReceiver, file);
1206
1829
  };
1830
+
1207
1831
  _proto.postConsultEmail = function postConsultEmail(uuidConsult, file) {
1208
1832
  return this.postConsultTransmission(uuidConsult, 'Pharmacierge', undefined, file);
1209
1833
  };
1834
+
1210
1835
  _proto.retryConsultFax = function retryConsultFax(uuidConsult, transmissionId) {
1211
1836
  return this.api.put(this.baseURL + "/v1/consults/" + uuidConsult + "/transmissions/" + transmissionId, {
1212
1837
  status: exports.TransmissionStatus.Retrying
1213
1838
  });
1214
1839
  };
1840
+
1215
1841
  _proto.updateConsultTransmissionStatus = function updateConsultTransmissionStatus(transmissionId, uuidConsult, newStatus) {
1216
1842
  return this.api.put(this.baseURL + "/v1/consults/" + uuidConsult + "/transmissions/" + transmissionId, {
1217
1843
  status: newStatus
1218
1844
  });
1219
1845
  };
1846
+
1220
1847
  return ConsultService;
1221
1848
  }();
1222
1849
 
@@ -1225,7 +1852,9 @@ var DiagnosisService = /*#__PURE__*/function () {
1225
1852
  this.api = api;
1226
1853
  this.baseURL = baseURL;
1227
1854
  }
1855
+
1228
1856
  var _proto = DiagnosisService.prototype;
1857
+
1229
1858
  _proto.getDiagnoses = function getDiagnoses() {
1230
1859
  return this.api.get(this.baseURL + "/v1/diagnoses");
1231
1860
  }
@@ -1233,16 +1862,21 @@ var DiagnosisService = /*#__PURE__*/function () {
1233
1862
  * Get a diagnosis by uuid that belongs to your practice
1234
1863
  * @param uuidDiagnosis the uuid of the diagnosis
1235
1864
  * @returns a diagnosis
1236
- */;
1865
+ */
1866
+ ;
1867
+
1237
1868
  _proto.getDiagnosisByUuid = function getDiagnosisByUuid(uuidDiagnosis) {
1238
1869
  return this.api.get(this.baseURL + "/v1/diagnoses/" + uuidDiagnosis);
1239
1870
  };
1871
+
1240
1872
  _proto.createDiagnosis = function createDiagnosis(diagnosis) {
1241
1873
  return this.api.post(this.baseURL + "/v1/diagnoses", diagnosis);
1242
1874
  };
1875
+
1243
1876
  _proto.updateDiagnosis = function updateDiagnosis(uuid, diagnosis) {
1244
1877
  return this.api.put(this.baseURL + "/v1/diagnoses/" + uuid, diagnosis);
1245
1878
  };
1879
+
1246
1880
  _proto.getTreatmentsFromDiagnosisUuid = function getTreatmentsFromDiagnosisUuid(diagnosisUuid) {
1247
1881
  return this.api.get(this.baseURL + "/v1/diagnoses/" + diagnosisUuid + "/treatments");
1248
1882
  }
@@ -1250,7 +1884,9 @@ var DiagnosisService = /*#__PURE__*/function () {
1250
1884
  * This function returns treatment plans associated to a consult
1251
1885
  * @param uuidConsult the consult uuid to fetch
1252
1886
  * @returns an array of TreatmentPlan
1253
- */;
1887
+ */
1888
+ ;
1889
+
1254
1890
  _proto.getTreatmentPlansFromConsultUuid = function getTreatmentPlansFromConsultUuid(uuidConsult) {
1255
1891
  return this.api.get(this.baseURL + "/v1/treatment-plans/", {
1256
1892
  params: {
@@ -1262,7 +1898,9 @@ var DiagnosisService = /*#__PURE__*/function () {
1262
1898
  * creates a new treatment for the specified diagnosis
1263
1899
  * @param diagnosisUuid uuid of the diagnosis that the treatment is linked to
1264
1900
  * @param treatmentRequest the treatment to be inserted
1265
- */;
1901
+ */
1902
+ ;
1903
+
1266
1904
  _proto.createTreatment = function createTreatment(diagnosisUuid, treatmentRequest) {
1267
1905
  return this.api.post(this.baseURL + "/v1/diagnoses/" + diagnosisUuid + "/treatments", treatmentRequest);
1268
1906
  }
@@ -1270,7 +1908,9 @@ var DiagnosisService = /*#__PURE__*/function () {
1270
1908
  * This function returns populated treatment plans associated to a consult
1271
1909
  * @param uuidConsult the consult uuid to fetch
1272
1910
  * @returns a TreatmentPlans object
1273
- */;
1911
+ */
1912
+ ;
1913
+
1274
1914
  _proto.getTreatmentPlansPopulatedFromConsultUuid = function getTreatmentPlansPopulatedFromConsultUuid(uuidConsult) {
1275
1915
  return this.api.get(this.baseURL + "/v1/treatment-plans/", {
1276
1916
  params: {
@@ -1279,9 +1919,11 @@ var DiagnosisService = /*#__PURE__*/function () {
1279
1919
  }
1280
1920
  });
1281
1921
  };
1922
+
1282
1923
  _proto.postPlans = function postPlans(plans) {
1283
1924
  return this.api.post(this.baseURL + "/v1/treatment-plans", plans);
1284
1925
  };
1926
+
1285
1927
  _proto.updateTreatmentPlan = function updateTreatmentPlan(uuidPlan, uuidConsult, diagnosisRequest, plan, refill) {
1286
1928
  return this.api.put(this.baseURL + "/v1/treatment-plans/" + uuidPlan, {
1287
1929
  uuidConsult: uuidConsult,
@@ -1290,6 +1932,7 @@ var DiagnosisService = /*#__PURE__*/function () {
1290
1932
  refill: refill
1291
1933
  });
1292
1934
  };
1935
+
1293
1936
  _proto.acceptTreatmentPlan = function acceptTreatmentPlan(uuidPlan, uuidConsult) {
1294
1937
  return this.api.put(this.baseURL + "/v1/treatment-plans/" + uuidPlan + "/accept", {
1295
1938
  uuidConsult: uuidConsult
@@ -1298,37 +1941,49 @@ var DiagnosisService = /*#__PURE__*/function () {
1298
1941
  /**
1299
1942
  * retrieves all the drugs of the specified practice
1300
1943
  * @param uuidPractice
1301
- */;
1944
+ */
1945
+ ;
1946
+
1302
1947
  _proto.getAllDrugs =
1303
1948
  /*#__PURE__*/
1304
1949
  function () {
1305
- var _getAllDrugs = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(uuidPractice) {
1950
+ var _getAllDrugs = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(uuidPractice) {
1306
1951
  var res;
1307
- return _regeneratorRuntime().wrap(function _callee$(_context) {
1308
- while (1) switch (_context.prev = _context.next) {
1309
- case 0:
1310
- _context.next = 2;
1311
- return this.api.get(this.baseURL + "/v1/drugs/practice/" + uuidPractice);
1312
- case 2:
1313
- res = _context.sent;
1314
- if (!(res && res.foundDrugs)) {
1315
- _context.next = 5;
1316
- break;
1317
- }
1318
- return _context.abrupt("return", res.foundDrugs);
1319
- case 5:
1320
- return _context.abrupt("return", undefined);
1321
- case 6:
1322
- case "end":
1323
- return _context.stop();
1952
+ return runtime_1.wrap(function _callee$(_context) {
1953
+ while (1) {
1954
+ switch (_context.prev = _context.next) {
1955
+ case 0:
1956
+ _context.next = 2;
1957
+ return this.api.get(this.baseURL + "/v1/drugs/practice/" + uuidPractice);
1958
+
1959
+ case 2:
1960
+ res = _context.sent;
1961
+
1962
+ if (!(res && res.foundDrugs)) {
1963
+ _context.next = 5;
1964
+ break;
1965
+ }
1966
+
1967
+ return _context.abrupt("return", res.foundDrugs);
1968
+
1969
+ case 5:
1970
+ return _context.abrupt("return", undefined);
1971
+
1972
+ case 6:
1973
+ case "end":
1974
+ return _context.stop();
1975
+ }
1324
1976
  }
1325
1977
  }, _callee, this);
1326
1978
  }));
1979
+
1327
1980
  function getAllDrugs(_x) {
1328
1981
  return _getAllDrugs.apply(this, arguments);
1329
1982
  }
1983
+
1330
1984
  return getAllDrugs;
1331
1985
  }();
1986
+
1332
1987
  return DiagnosisService;
1333
1988
  }();
1334
1989
 
@@ -1337,6 +1992,7 @@ var GuardService = /*#__PURE__*/function () {
1337
1992
  this.api = api;
1338
1993
  this.baseURL = baseURL;
1339
1994
  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
1995
+
1340
1996
  this.identityCache = {};
1341
1997
  this.whoAmICache = {};
1342
1998
  }
@@ -1351,7 +2007,10 @@ var GuardService = /*#__PURE__*/function () {
1351
2007
  * ```
1352
2008
  * @param tokens
1353
2009
  */
2010
+
2011
+
1354
2012
  var _proto = GuardService.prototype;
2013
+
1355
2014
  _proto.setTokens = function setTokens(tokens) {
1356
2015
  this.api.setTokens(_extends({}, this.api.getTokens(), tokens));
1357
2016
  }
@@ -1360,59 +2019,76 @@ var GuardService = /*#__PURE__*/function () {
1360
2019
  *
1361
2020
  * @param req The credentials required to get an access token
1362
2021
  * @returns AuthTokenResponse
1363
- */;
2022
+ */
2023
+ ;
2024
+
1364
2025
  _proto.m2mToken =
1365
2026
  /*#__PURE__*/
1366
2027
  function () {
1367
- var _m2mToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(req) {
2028
+ var _m2mToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(req) {
1368
2029
  var resp, config, _e$response, code;
1369
- return _regeneratorRuntime().wrap(function _callee$(_context) {
1370
- while (1) switch (_context.prev = _context.next) {
1371
- case 0:
1372
- _context.prev = 0;
1373
- config = {
1374
- skipAuthRefresh: true
1375
- };
1376
- _context.next = 4;
1377
- return this.api.post(this.baseURL + "/v1/m2m/token", req, config);
1378
- case 4:
1379
- resp = _context.sent;
1380
- this.api.setTokens({
1381
- accessToken: resp.accessToken
1382
- });
1383
- _context.next = 20;
1384
- break;
1385
- case 8:
1386
- _context.prev = 8;
1387
- _context.t0 = _context["catch"](0);
1388
- console.error('Error while posting m2m token:', _context.t0);
1389
- if (!_context.t0.isAxiosError) {
1390
- _context.next = 19;
2030
+
2031
+ return runtime_1.wrap(function _callee$(_context) {
2032
+ while (1) {
2033
+ switch (_context.prev = _context.next) {
2034
+ case 0:
2035
+ _context.prev = 0;
2036
+ config = {
2037
+ skipAuthRefresh: true
2038
+ };
2039
+ _context.next = 4;
2040
+ return this.api.post(this.baseURL + "/v1/m2m/token", req, config);
2041
+
2042
+ case 4:
2043
+ resp = _context.sent;
2044
+ this.api.setTokens({
2045
+ accessToken: resp.accessToken
2046
+ });
2047
+ _context.next = 20;
1391
2048
  break;
1392
- }
1393
- code = (_e$response = _context.t0.response) == null ? void 0 : _e$response.status;
1394
- _context.t1 = code;
1395
- _context.next = _context.t1 === 400 ? 16 : _context.t1 === 500 ? 17 : _context.t1 === 401 ? 18 : 18;
1396
- break;
1397
- case 16:
1398
- throw new AuthenticationBadRequest();
1399
- case 17:
1400
- throw new AuthenticationServerError();
1401
- case 18:
1402
- throw new AuthenticationFailed();
1403
- case 19:
1404
- throw new AuthenticationFailed();
1405
- case 20:
1406
- return _context.abrupt("return", resp);
1407
- case 21:
1408
- case "end":
1409
- return _context.stop();
2049
+
2050
+ case 8:
2051
+ _context.prev = 8;
2052
+ _context.t0 = _context["catch"](0);
2053
+ console.error('Error while posting m2m token:', _context.t0);
2054
+
2055
+ if (!_context.t0.isAxiosError) {
2056
+ _context.next = 19;
2057
+ break;
2058
+ }
2059
+
2060
+ code = (_e$response = _context.t0.response) == null ? void 0 : _e$response.status;
2061
+ _context.t1 = code;
2062
+ _context.next = _context.t1 === 400 ? 16 : _context.t1 === 500 ? 17 : _context.t1 === 401 ? 18 : 18;
2063
+ break;
2064
+
2065
+ case 16:
2066
+ throw new AuthenticationBadRequest();
2067
+
2068
+ case 17:
2069
+ throw new AuthenticationServerError();
2070
+
2071
+ case 18:
2072
+ throw new AuthenticationFailed();
2073
+
2074
+ case 19:
2075
+ throw new AuthenticationFailed();
2076
+
2077
+ case 20:
2078
+ return _context.abrupt("return", resp);
2079
+
2080
+ case 21:
2081
+ case "end":
2082
+ return _context.stop();
2083
+ }
1410
2084
  }
1411
2085
  }, _callee, this, [[0, 8]]);
1412
2086
  }));
2087
+
1413
2088
  function m2mToken(_x) {
1414
2089
  return _m2mToken.apply(this, arguments);
1415
2090
  }
2091
+
1416
2092
  return m2mToken;
1417
2093
  }()
1418
2094
  /**
@@ -1423,61 +2099,78 @@ var GuardService = /*#__PURE__*/function () {
1423
2099
  * @returns AuthTokenResponse
1424
2100
  */
1425
2101
  ;
2102
+
1426
2103
  _proto.authToken =
1427
2104
  /*#__PURE__*/
1428
2105
  function () {
1429
- var _authToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(req) {
2106
+ var _authToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(req) {
1430
2107
  var resp, config, _e$response2, code;
1431
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1432
- while (1) switch (_context2.prev = _context2.next) {
1433
- case 0:
1434
- _context2.prev = 0;
1435
- config = {
1436
- skipAuthRefresh: true
1437
- };
1438
- _context2.next = 4;
1439
- return this.api.post(this.baseURL + "/v1/auth/token", req, config);
1440
- case 4:
1441
- resp = _context2.sent;
1442
- this.api.setTokens({
1443
- accessToken: resp.accessToken,
1444
- refreshToken: resp.refreshToken
1445
- });
1446
- _context2.next = 21;
1447
- break;
1448
- case 8:
1449
- _context2.prev = 8;
1450
- _context2.t0 = _context2["catch"](0);
1451
- console.error('Error while posting auth token:', _context2.t0);
1452
- if (!_context2.t0.isAxiosError) {
1453
- _context2.next = 20;
2108
+
2109
+ return runtime_1.wrap(function _callee2$(_context2) {
2110
+ while (1) {
2111
+ switch (_context2.prev = _context2.next) {
2112
+ case 0:
2113
+ _context2.prev = 0;
2114
+ config = {
2115
+ skipAuthRefresh: true
2116
+ };
2117
+ _context2.next = 4;
2118
+ return this.api.post(this.baseURL + "/v1/auth/token", req, config);
2119
+
2120
+ case 4:
2121
+ resp = _context2.sent;
2122
+ this.api.setTokens({
2123
+ accessToken: resp.accessToken,
2124
+ refreshToken: resp.refreshToken
2125
+ });
2126
+ _context2.next = 21;
1454
2127
  break;
1455
- }
1456
- code = (_e$response2 = _context2.t0.response) == null ? void 0 : _e$response2.status;
1457
- _context2.t1 = code;
1458
- _context2.next = _context2.t1 === 400 ? 16 : _context2.t1 === 424 ? 17 : _context2.t1 === 500 ? 18 : _context2.t1 === 401 ? 19 : 19;
1459
- break;
1460
- case 16:
1461
- throw new AuthenticationBadRequest();
1462
- case 17:
1463
- throw new AuthenticationUnconfirmedEmail();
1464
- case 18:
1465
- throw new AuthenticationServerError();
1466
- case 19:
1467
- throw new AuthenticationFailed();
1468
- case 20:
1469
- throw new AuthenticationFailed();
1470
- case 21:
1471
- return _context2.abrupt("return", resp);
1472
- case 22:
1473
- case "end":
1474
- return _context2.stop();
2128
+
2129
+ case 8:
2130
+ _context2.prev = 8;
2131
+ _context2.t0 = _context2["catch"](0);
2132
+ console.error('Error while posting auth token:', _context2.t0);
2133
+
2134
+ if (!_context2.t0.isAxiosError) {
2135
+ _context2.next = 20;
2136
+ break;
2137
+ }
2138
+
2139
+ code = (_e$response2 = _context2.t0.response) == null ? void 0 : _e$response2.status;
2140
+ _context2.t1 = code;
2141
+ _context2.next = _context2.t1 === 400 ? 16 : _context2.t1 === 424 ? 17 : _context2.t1 === 500 ? 18 : _context2.t1 === 401 ? 19 : 19;
2142
+ break;
2143
+
2144
+ case 16:
2145
+ throw new AuthenticationBadRequest();
2146
+
2147
+ case 17:
2148
+ throw new AuthenticationUnconfirmedEmail();
2149
+
2150
+ case 18:
2151
+ throw new AuthenticationServerError();
2152
+
2153
+ case 19:
2154
+ throw new AuthenticationFailed();
2155
+
2156
+ case 20:
2157
+ throw new AuthenticationFailed();
2158
+
2159
+ case 21:
2160
+ return _context2.abrupt("return", resp);
2161
+
2162
+ case 22:
2163
+ case "end":
2164
+ return _context2.stop();
2165
+ }
1475
2166
  }
1476
2167
  }, _callee2, this, [[0, 8]]);
1477
2168
  }));
2169
+
1478
2170
  function authToken(_x2) {
1479
2171
  return _authToken.apply(this, arguments);
1480
2172
  }
2173
+
1481
2174
  return authToken;
1482
2175
  }()
1483
2176
  /**
@@ -1486,28 +2179,34 @@ var GuardService = /*#__PURE__*/function () {
1486
2179
  * @returns AuthTokenResponse
1487
2180
  */
1488
2181
  ;
2182
+
1489
2183
  _proto.authRefresh =
1490
2184
  /*#__PURE__*/
1491
2185
  function () {
1492
- var _authRefresh = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(refreshToken) {
2186
+ var _authRefresh = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(refreshToken) {
1493
2187
  var config;
1494
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
1495
- while (1) switch (_context3.prev = _context3.next) {
1496
- case 0:
1497
- config = {
1498
- skipAuthRefresh: true,
1499
- useRefreshToken: true
1500
- };
1501
- return _context3.abrupt("return", this.api.put(this.baseURL + "/v1/auth/token", null, config));
1502
- case 2:
1503
- case "end":
1504
- return _context3.stop();
2188
+ return runtime_1.wrap(function _callee3$(_context3) {
2189
+ while (1) {
2190
+ switch (_context3.prev = _context3.next) {
2191
+ case 0:
2192
+ config = {
2193
+ skipAuthRefresh: true,
2194
+ useRefreshToken: true
2195
+ };
2196
+ return _context3.abrupt("return", this.api.put(this.baseURL + "/v1/auth/token", null, config));
2197
+
2198
+ case 2:
2199
+ case "end":
2200
+ return _context3.stop();
2201
+ }
1505
2202
  }
1506
2203
  }, _callee3, this);
1507
2204
  }));
2205
+
1508
2206
  function authRefresh(_x3) {
1509
2207
  return _authRefresh.apply(this, arguments);
1510
2208
  }
2209
+
1511
2210
  return authRefresh;
1512
2211
  }()
1513
2212
  /**
@@ -1516,23 +2215,29 @@ var GuardService = /*#__PURE__*/function () {
1516
2215
  * @returns void
1517
2216
  */
1518
2217
  ;
2218
+
1519
2219
  _proto.authLogout =
1520
2220
  /*#__PURE__*/
1521
2221
  function () {
1522
- var _authLogout = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
1523
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
1524
- while (1) switch (_context4.prev = _context4.next) {
1525
- case 0:
1526
- return _context4.abrupt("return", this.api.get(this.baseURL + "/v1/auth/logout"));
1527
- case 1:
1528
- case "end":
1529
- return _context4.stop();
2222
+ var _authLogout = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4() {
2223
+ return runtime_1.wrap(function _callee4$(_context4) {
2224
+ while (1) {
2225
+ switch (_context4.prev = _context4.next) {
2226
+ case 0:
2227
+ return _context4.abrupt("return", this.api.get(this.baseURL + "/v1/auth/logout"));
2228
+
2229
+ case 1:
2230
+ case "end":
2231
+ return _context4.stop();
2232
+ }
1530
2233
  }
1531
2234
  }, _callee4, this);
1532
2235
  }));
2236
+
1533
2237
  function authLogout() {
1534
2238
  return _authLogout.apply(this, arguments);
1535
2239
  }
2240
+
1536
2241
  return authLogout;
1537
2242
  }()
1538
2243
  /**
@@ -1542,23 +2247,29 @@ var GuardService = /*#__PURE__*/function () {
1542
2247
  * @returns void
1543
2248
  */
1544
2249
  ;
2250
+
1545
2251
  _proto.authRecover =
1546
2252
  /*#__PURE__*/
1547
2253
  function () {
1548
- var _authRecover = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(req) {
1549
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
1550
- while (1) switch (_context5.prev = _context5.next) {
1551
- case 0:
1552
- return _context5.abrupt("return", this.api.post(this.baseURL + "/v1/auth/recover", req));
1553
- case 1:
1554
- case "end":
1555
- return _context5.stop();
2254
+ var _authRecover = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(req) {
2255
+ return runtime_1.wrap(function _callee5$(_context5) {
2256
+ while (1) {
2257
+ switch (_context5.prev = _context5.next) {
2258
+ case 0:
2259
+ return _context5.abrupt("return", this.api.post(this.baseURL + "/v1/auth/recover", req));
2260
+
2261
+ case 1:
2262
+ case "end":
2263
+ return _context5.stop();
2264
+ }
1556
2265
  }
1557
2266
  }, _callee5, this);
1558
2267
  }));
2268
+
1559
2269
  function authRecover(_x4) {
1560
2270
  return _authRecover.apply(this, arguments);
1561
2271
  }
2272
+
1562
2273
  return authRecover;
1563
2274
  }()
1564
2275
  /**
@@ -1569,54 +2280,70 @@ var GuardService = /*#__PURE__*/function () {
1569
2280
  * @returns IdentityResponse
1570
2281
  */
1571
2282
  ;
2283
+
1572
2284
  _proto.identityCreate =
1573
2285
  /*#__PURE__*/
1574
2286
  function () {
1575
- var _identityCreate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(req) {
2287
+ var _identityCreate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(req) {
1576
2288
  var resp, _e$response3, code;
1577
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
1578
- while (1) switch (_context6.prev = _context6.next) {
1579
- case 0:
1580
- _context6.prev = 0;
1581
- _context6.next = 3;
1582
- return this.api.post(this.baseURL + "/v1/identities", req);
1583
- case 3:
1584
- resp = _context6.sent;
1585
- this.api.setTokens({
1586
- refreshToken: resp.refreshToken
1587
- });
1588
- _context6.next = 18;
1589
- break;
1590
- case 7:
1591
- _context6.prev = 7;
1592
- _context6.t0 = _context6["catch"](0);
1593
- if (!_context6.t0.isAxiosError) {
1594
- _context6.next = 17;
2289
+
2290
+ return runtime_1.wrap(function _callee6$(_context6) {
2291
+ while (1) {
2292
+ switch (_context6.prev = _context6.next) {
2293
+ case 0:
2294
+ _context6.prev = 0;
2295
+ _context6.next = 3;
2296
+ return this.api.post(this.baseURL + "/v1/identities", req);
2297
+
2298
+ case 3:
2299
+ resp = _context6.sent;
2300
+ this.api.setTokens({
2301
+ refreshToken: resp.refreshToken
2302
+ });
2303
+ _context6.next = 18;
1595
2304
  break;
1596
- }
1597
- code = (_e$response3 = _context6.t0.response) == null ? void 0 : _e$response3.status;
1598
- _context6.t1 = code;
1599
- _context6.next = _context6.t1 === 400 ? 14 : _context6.t1 === 409 ? 15 : _context6.t1 === 500 ? 16 : 16;
1600
- break;
1601
- case 14:
1602
- throw new IdentityCreationBadRequest();
1603
- case 15:
1604
- throw new IdentityCreationConflict();
1605
- case 16:
1606
- throw new IdentityCreationFailed();
1607
- case 17:
1608
- throw new IdentityCreationFailed();
1609
- case 18:
1610
- return _context6.abrupt("return", resp);
1611
- case 19:
1612
- case "end":
1613
- return _context6.stop();
2305
+
2306
+ case 7:
2307
+ _context6.prev = 7;
2308
+ _context6.t0 = _context6["catch"](0);
2309
+
2310
+ if (!_context6.t0.isAxiosError) {
2311
+ _context6.next = 17;
2312
+ break;
2313
+ }
2314
+
2315
+ code = (_e$response3 = _context6.t0.response) == null ? void 0 : _e$response3.status;
2316
+ _context6.t1 = code;
2317
+ _context6.next = _context6.t1 === 400 ? 14 : _context6.t1 === 409 ? 15 : _context6.t1 === 500 ? 16 : 16;
2318
+ break;
2319
+
2320
+ case 14:
2321
+ throw new IdentityCreationBadRequest();
2322
+
2323
+ case 15:
2324
+ throw new IdentityCreationConflict();
2325
+
2326
+ case 16:
2327
+ throw new IdentityCreationFailed();
2328
+
2329
+ case 17:
2330
+ throw new IdentityCreationFailed();
2331
+
2332
+ case 18:
2333
+ return _context6.abrupt("return", resp);
2334
+
2335
+ case 19:
2336
+ case "end":
2337
+ return _context6.stop();
2338
+ }
1614
2339
  }
1615
2340
  }, _callee6, this, [[0, 7]]);
1616
2341
  }));
2342
+
1617
2343
  function identityCreate(_x5) {
1618
2344
  return _identityCreate.apply(this, arguments);
1619
2345
  }
2346
+
1620
2347
  return identityCreate;
1621
2348
  }()
1622
2349
  /**
@@ -1628,46 +2355,61 @@ var GuardService = /*#__PURE__*/function () {
1628
2355
  * @returns IdentityResponse
1629
2356
  */
1630
2357
  ;
2358
+
1631
2359
  _proto.identityGet =
1632
2360
  /*#__PURE__*/
1633
2361
  function () {
1634
- var _identityGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(identityID, skipCache) {
2362
+ var _identityGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(identityID, skipCache) {
1635
2363
  var _tokens$accessToken, _tokens$refreshToken;
2364
+
1636
2365
  var tokens, cacheKey, identity;
1637
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
1638
- while (1) switch (_context7.prev = _context7.next) {
1639
- case 0:
1640
- if (skipCache === void 0) {
1641
- skipCache = false;
1642
- }
1643
- tokens = this.api.getTokens();
1644
- cacheKey = ((_tokens$accessToken = tokens.accessToken) != null ? _tokens$accessToken : '') + ((_tokens$refreshToken = tokens.refreshToken) != null ? _tokens$refreshToken : '') + identityID;
1645
- if (!(skipCache || !tokens.accessToken || !this.identityCache[cacheKey])) {
1646
- _context7.next = 10;
1647
- break;
1648
- }
1649
- _context7.next = 6;
1650
- return this.api.get(this.baseURL + "/v1/identities/" + identityID);
1651
- case 6:
1652
- identity = _context7.sent;
1653
- if (!skipCache) {
1654
- _context7.next = 9;
1655
- break;
1656
- }
1657
- return _context7.abrupt("return", identity);
1658
- case 9:
1659
- this.identityCache[cacheKey] = identity;
1660
- case 10:
1661
- return _context7.abrupt("return", this.identityCache[cacheKey]);
1662
- case 11:
1663
- case "end":
1664
- return _context7.stop();
2366
+ return runtime_1.wrap(function _callee7$(_context7) {
2367
+ while (1) {
2368
+ switch (_context7.prev = _context7.next) {
2369
+ case 0:
2370
+ if (skipCache === void 0) {
2371
+ skipCache = false;
2372
+ }
2373
+
2374
+ tokens = this.api.getTokens();
2375
+ cacheKey = ((_tokens$accessToken = tokens.accessToken) != null ? _tokens$accessToken : '') + ((_tokens$refreshToken = tokens.refreshToken) != null ? _tokens$refreshToken : '') + identityID;
2376
+
2377
+ if (!(skipCache || !tokens.accessToken || !this.identityCache[cacheKey])) {
2378
+ _context7.next = 10;
2379
+ break;
2380
+ }
2381
+
2382
+ _context7.next = 6;
2383
+ return this.api.get(this.baseURL + "/v1/identities/" + identityID);
2384
+
2385
+ case 6:
2386
+ identity = _context7.sent;
2387
+
2388
+ if (!skipCache) {
2389
+ _context7.next = 9;
2390
+ break;
2391
+ }
2392
+
2393
+ return _context7.abrupt("return", identity);
2394
+
2395
+ case 9:
2396
+ this.identityCache[cacheKey] = identity;
2397
+
2398
+ case 10:
2399
+ return _context7.abrupt("return", this.identityCache[cacheKey]);
2400
+
2401
+ case 11:
2402
+ case "end":
2403
+ return _context7.stop();
2404
+ }
1665
2405
  }
1666
2406
  }, _callee7, this);
1667
2407
  }));
2408
+
1668
2409
  function identityGet(_x6, _x7) {
1669
2410
  return _identityGet.apply(this, arguments);
1670
2411
  }
2412
+
1671
2413
  return identityGet;
1672
2414
  }()
1673
2415
  /**
@@ -1677,38 +2419,50 @@ var GuardService = /*#__PURE__*/function () {
1677
2419
  * @returns WhoAmIResponse
1678
2420
  */
1679
2421
  ;
2422
+
1680
2423
  _proto.whoAmI =
1681
2424
  /*#__PURE__*/
1682
2425
  function () {
1683
- var _whoAmI = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(refreshCache) {
2426
+ var _whoAmI = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(refreshCache) {
1684
2427
  var _this$api$getTokens$a;
2428
+
1685
2429
  var cacheKey;
1686
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
1687
- while (1) switch (_context8.prev = _context8.next) {
1688
- case 0:
1689
- if (refreshCache === void 0) {
1690
- refreshCache = false;
1691
- }
1692
- cacheKey = (_this$api$getTokens$a = this.api.getTokens().accessToken) != null ? _this$api$getTokens$a : '';
1693
- if (!(!this.whoAmICache[cacheKey] || refreshCache)) {
1694
- _context8.next = 6;
1695
- break;
1696
- }
1697
- _context8.next = 5;
1698
- return this.api.get(this.baseURL + "/v1/auth/whoami");
1699
- case 5:
1700
- this.whoAmICache[cacheKey] = _context8.sent;
1701
- case 6:
1702
- return _context8.abrupt("return", this.whoAmICache[cacheKey]);
1703
- case 7:
1704
- case "end":
1705
- return _context8.stop();
2430
+ return runtime_1.wrap(function _callee8$(_context8) {
2431
+ while (1) {
2432
+ switch (_context8.prev = _context8.next) {
2433
+ case 0:
2434
+ if (refreshCache === void 0) {
2435
+ refreshCache = false;
2436
+ }
2437
+
2438
+ cacheKey = (_this$api$getTokens$a = this.api.getTokens().accessToken) != null ? _this$api$getTokens$a : '';
2439
+
2440
+ if (!(!this.whoAmICache[cacheKey] || refreshCache)) {
2441
+ _context8.next = 6;
2442
+ break;
2443
+ }
2444
+
2445
+ _context8.next = 5;
2446
+ return this.api.get(this.baseURL + "/v1/auth/whoami");
2447
+
2448
+ case 5:
2449
+ this.whoAmICache[cacheKey] = _context8.sent;
2450
+
2451
+ case 6:
2452
+ return _context8.abrupt("return", this.whoAmICache[cacheKey]);
2453
+
2454
+ case 7:
2455
+ case "end":
2456
+ return _context8.stop();
2457
+ }
1706
2458
  }
1707
2459
  }, _callee8, this);
1708
2460
  }));
2461
+
1709
2462
  function whoAmI(_x8) {
1710
2463
  return _whoAmI.apply(this, arguments);
1711
2464
  }
2465
+
1712
2466
  return whoAmI;
1713
2467
  }()
1714
2468
  /**
@@ -1719,23 +2473,29 @@ var GuardService = /*#__PURE__*/function () {
1719
2473
  * @returns IdentityResponse
1720
2474
  */
1721
2475
  ;
2476
+
1722
2477
  _proto.identityUpdate =
1723
2478
  /*#__PURE__*/
1724
2479
  function () {
1725
- var _identityUpdate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(identityID, req) {
1726
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
1727
- while (1) switch (_context9.prev = _context9.next) {
1728
- case 0:
1729
- return _context9.abrupt("return", this.api.put(this.baseURL + "/v1/identities/" + identityID, req));
1730
- case 1:
1731
- case "end":
1732
- return _context9.stop();
2480
+ var _identityUpdate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9(identityID, req) {
2481
+ return runtime_1.wrap(function _callee9$(_context9) {
2482
+ while (1) {
2483
+ switch (_context9.prev = _context9.next) {
2484
+ case 0:
2485
+ return _context9.abrupt("return", this.api.put(this.baseURL + "/v1/identities/" + identityID, req));
2486
+
2487
+ case 1:
2488
+ case "end":
2489
+ return _context9.stop();
2490
+ }
1733
2491
  }
1734
2492
  }, _callee9, this);
1735
2493
  }));
2494
+
1736
2495
  function identityUpdate(_x9, _x10) {
1737
2496
  return _identityUpdate.apply(this, arguments);
1738
2497
  }
2498
+
1739
2499
  return identityUpdate;
1740
2500
  }()
1741
2501
  /**
@@ -1747,31 +2507,37 @@ var GuardService = /*#__PURE__*/function () {
1747
2507
  * @returns QRCodeResponse
1748
2508
  */
1749
2509
  ;
2510
+
1750
2511
  _proto.identityMFAQRCode =
1751
2512
  /*#__PURE__*/
1752
2513
  function () {
1753
- var _identityMFAQRCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(identityID, password) {
2514
+ var _identityMFAQRCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10(identityID, password) {
1754
2515
  var req;
1755
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
1756
- while (1) switch (_context10.prev = _context10.next) {
1757
- case 0:
1758
- req = {
1759
- password: password
1760
- };
1761
- return _context10.abrupt("return", this.api.post(this.baseURL + "/v1/identities/" + identityID + "/mfa", req, {
1762
- headers: {
1763
- Accept: 'application/json'
1764
- }
1765
- }));
1766
- case 2:
1767
- case "end":
1768
- return _context10.stop();
2516
+ return runtime_1.wrap(function _callee10$(_context10) {
2517
+ while (1) {
2518
+ switch (_context10.prev = _context10.next) {
2519
+ case 0:
2520
+ req = {
2521
+ password: password
2522
+ };
2523
+ return _context10.abrupt("return", this.api.post(this.baseURL + "/v1/identities/" + identityID + "/mfa", req, {
2524
+ headers: {
2525
+ Accept: 'application/json'
2526
+ }
2527
+ }));
2528
+
2529
+ case 2:
2530
+ case "end":
2531
+ return _context10.stop();
2532
+ }
1769
2533
  }
1770
2534
  }, _callee10, this);
1771
2535
  }));
2536
+
1772
2537
  function identityMFAQRCode(_x11, _x12) {
1773
2538
  return _identityMFAQRCode.apply(this, arguments);
1774
2539
  }
2540
+
1775
2541
  return identityMFAQRCode;
1776
2542
  }()
1777
2543
  /**
@@ -1781,23 +2547,29 @@ var GuardService = /*#__PURE__*/function () {
1781
2547
  * @return void
1782
2548
  */
1783
2549
  ;
2550
+
1784
2551
  _proto.identitySendConfirmEmail =
1785
2552
  /*#__PURE__*/
1786
2553
  function () {
1787
- var _identitySendConfirmEmail = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(req) {
1788
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
1789
- while (1) switch (_context11.prev = _context11.next) {
1790
- case 0:
1791
- return _context11.abrupt("return", this.api.post(this.baseURL + "/v1/identity/confirm", req));
1792
- case 1:
1793
- case "end":
1794
- return _context11.stop();
2554
+ var _identitySendConfirmEmail = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11(req) {
2555
+ return runtime_1.wrap(function _callee11$(_context11) {
2556
+ while (1) {
2557
+ switch (_context11.prev = _context11.next) {
2558
+ case 0:
2559
+ return _context11.abrupt("return", this.api.post(this.baseURL + "/v1/identity/confirm", req));
2560
+
2561
+ case 1:
2562
+ case "end":
2563
+ return _context11.stop();
2564
+ }
1795
2565
  }
1796
2566
  }, _callee11, this);
1797
2567
  }));
2568
+
1798
2569
  function identitySendConfirmEmail(_x13) {
1799
2570
  return _identitySendConfirmEmail.apply(this, arguments);
1800
2571
  }
2572
+
1801
2573
  return identitySendConfirmEmail;
1802
2574
  }()
1803
2575
  /**
@@ -1807,23 +2579,29 @@ var GuardService = /*#__PURE__*/function () {
1807
2579
  * @returns IdentityResponse
1808
2580
  */
1809
2581
  ;
2582
+
1810
2583
  _proto.identityGetByCustomerEmail =
1811
2584
  /*#__PURE__*/
1812
2585
  function () {
1813
- var _identityGetByCustomerEmail = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(email) {
1814
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
1815
- while (1) switch (_context12.prev = _context12.next) {
1816
- case 0:
1817
- return _context12.abrupt("return", this.identityGetByHash(email.substring(email.indexOf('+') + 1, email.indexOf('@'))));
1818
- case 1:
1819
- case "end":
1820
- return _context12.stop();
2586
+ var _identityGetByCustomerEmail = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee12(email) {
2587
+ return runtime_1.wrap(function _callee12$(_context12) {
2588
+ while (1) {
2589
+ switch (_context12.prev = _context12.next) {
2590
+ case 0:
2591
+ return _context12.abrupt("return", this.identityGetByHash(email.substring(email.indexOf('+') + 1, email.indexOf('@'))));
2592
+
2593
+ case 1:
2594
+ case "end":
2595
+ return _context12.stop();
2596
+ }
1821
2597
  }
1822
2598
  }, _callee12, this);
1823
2599
  }));
2600
+
1824
2601
  function identityGetByCustomerEmail(_x14) {
1825
2602
  return _identityGetByCustomerEmail.apply(this, arguments);
1826
2603
  }
2604
+
1827
2605
  return identityGetByCustomerEmail;
1828
2606
  }()
1829
2607
  /**
@@ -1833,25 +2611,32 @@ var GuardService = /*#__PURE__*/function () {
1833
2611
  * @returns IdentityResponse
1834
2612
  */
1835
2613
  ;
2614
+
1836
2615
  _proto.identityGetByHash =
1837
2616
  /*#__PURE__*/
1838
2617
  function () {
1839
- var _identityGetByHash = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(b64Hash) {
1840
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
1841
- while (1) switch (_context13.prev = _context13.next) {
1842
- case 0:
1843
- return _context13.abrupt("return", this.identityGet(b64Hash.replace(/\+/g, '-').replace(/\//g, '_')));
1844
- case 1:
1845
- case "end":
1846
- return _context13.stop();
2618
+ var _identityGetByHash = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee13(b64Hash) {
2619
+ return runtime_1.wrap(function _callee13$(_context13) {
2620
+ while (1) {
2621
+ switch (_context13.prev = _context13.next) {
2622
+ case 0:
2623
+ return _context13.abrupt("return", this.identityGet(b64Hash.replace(/\+/g, '-').replace(/\//g, '_')));
2624
+
2625
+ case 1:
2626
+ case "end":
2627
+ return _context13.stop();
2628
+ }
1847
2629
  }
1848
2630
  }, _callee13, this);
1849
2631
  }));
2632
+
1850
2633
  function identityGetByHash(_x15) {
1851
2634
  return _identityGetByHash.apply(this, arguments);
1852
2635
  }
2636
+
1853
2637
  return identityGetByHash;
1854
2638
  }();
2639
+
1855
2640
  return GuardService;
1856
2641
  }();
1857
2642
 
@@ -1865,7 +2650,10 @@ var SearchService = /*#__PURE__*/function () {
1865
2650
  * @param consultUUID
1866
2651
  * @param terms the search terms to be indexed
1867
2652
  */
2653
+
2654
+
1868
2655
  var _proto = SearchService.prototype;
2656
+
1869
2657
  _proto.index = function index(consultUUID, terms) {
1870
2658
  return this.api.post(this.baseURL + "/v1/index", {
1871
2659
  consultUUID: consultUUID,
@@ -1875,12 +2663,15 @@ var SearchService = /*#__PURE__*/function () {
1875
2663
  /**
1876
2664
  * Searches for the consultations corresponding to the search terms entered in the query
1877
2665
  * @param terms array of search terms
1878
- */;
2666
+ */
2667
+ ;
2668
+
1879
2669
  _proto.search = function search(terms) {
1880
2670
  return this.api.post(this.baseURL + "/v1/search", {
1881
2671
  terms: terms
1882
2672
  });
1883
2673
  };
2674
+
1884
2675
  return SearchService;
1885
2676
  }();
1886
2677
 
@@ -1894,7 +2685,10 @@ var PracticeService = /*#__PURE__*/function () {
1894
2685
  * an M2M with the scope `practice.practices.get`
1895
2686
  * @returns an array of practices
1896
2687
  */
2688
+
2689
+
1897
2690
  var _proto = PracticeService.prototype;
2691
+
1898
2692
  _proto.practiceGetAll = function practiceGetAll() {
1899
2693
  return this.api.get(this.baseURL + "/v1/practices");
1900
2694
  }
@@ -1905,7 +2699,9 @@ var PracticeService = /*#__PURE__*/function () {
1905
2699
  * @param hydratePracticeConfigs (optional) if set true it the Practice field configs will be set
1906
2700
  * @param accounts (optional) if set true it the Practice field accounts will be set
1907
2701
  * @returns the found practice or undefined
1908
- */;
2702
+ */
2703
+ ;
2704
+
1909
2705
  _proto.practiceGetFromURL = function practiceGetFromURL(practiceURL, params) {
1910
2706
  return this.api.get(this.baseURL + "/v1/practices", {
1911
2707
  params: _extends({
@@ -1913,6 +2709,7 @@ var PracticeService = /*#__PURE__*/function () {
1913
2709
  }, params)
1914
2710
  });
1915
2711
  };
2712
+
1916
2713
  _proto.practiceGetFromUuid = function practiceGetFromUuid(practiceUuid, locale, withAccounts) {
1917
2714
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid, {
1918
2715
  params: {
@@ -1920,13 +2717,15 @@ var PracticeService = /*#__PURE__*/function () {
1920
2717
  accounts: withAccounts
1921
2718
  }
1922
2719
  });
1923
- }
1924
- /// Practice Configs
2720
+ } /// Practice Configs
2721
+
1925
2722
  /**
1926
2723
  * This function retrieves all configs of a specific practice
1927
2724
  * @param practiceUuid uuid of the practice
1928
2725
  * @returns the practice configs
1929
- */;
2726
+ */
2727
+ ;
2728
+
1930
2729
  _proto.practiceConfigGetFromPracticeUuid = function practiceConfigGetFromPracticeUuid(practiceUuid) {
1931
2730
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/configs");
1932
2731
  }
@@ -1935,7 +2734,9 @@ var PracticeService = /*#__PURE__*/function () {
1935
2734
  * @param practiceUuid uuid of the practice
1936
2735
  * @param kind of the config
1937
2736
  * @returns the practice config
1938
- */;
2737
+ */
2738
+ ;
2739
+
1939
2740
  _proto.practiceConfigGetByKindForPracticeUuid = function practiceConfigGetByKindForPracticeUuid(practiceUuid, kind) {
1940
2741
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/configs/" + kind);
1941
2742
  }
@@ -1944,7 +2745,9 @@ var PracticeService = /*#__PURE__*/function () {
1944
2745
  * @param practiceUuid uuid of the practice
1945
2746
  * @param config the config to add to the practice
1946
2747
  * @returns the created practice config
1947
- */;
2748
+ */
2749
+ ;
2750
+
1948
2751
  _proto.practiceConfigCreateForPracticeUuid = function practiceConfigCreateForPracticeUuid(practiceUuid, config) {
1949
2752
  return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/configs", config);
1950
2753
  }
@@ -1953,15 +2756,18 @@ var PracticeService = /*#__PURE__*/function () {
1953
2756
  * @param practiceUuid uuid of the practice
1954
2757
  * @param config the config to update
1955
2758
  * @returns the practice config
1956
- */;
2759
+ */
2760
+ ;
2761
+
1957
2762
  _proto.practiceConfigUpdate = function practiceConfigUpdate(config) {
1958
2763
  return this.api.put(this.baseURL + "/v1/practices/" + config.uuidPractice + "/configs/" + config.kind, config);
1959
- }
1960
- /// Accounts
2764
+ } /// Accounts
1961
2765
  ;
2766
+
1962
2767
  _proto.practiceGetAccounts = function practiceGetAccounts(practiceUuid) {
1963
2768
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/accounts");
1964
2769
  };
2770
+
1965
2771
  _proto.practiceGetAccount = function practiceGetAccount(practiceUuid, accountUuid) {
1966
2772
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/accounts/" + accountUuid);
1967
2773
  }
@@ -1970,7 +2776,9 @@ var PracticeService = /*#__PURE__*/function () {
1970
2776
  * @param practiceUuid the uuid of the practice
1971
2777
  * @param kind (optional) the kind of WorkflowType to filter in
1972
2778
  * @returns a list of PracticeWorkflow
1973
- */;
2779
+ */
2780
+ ;
2781
+
1974
2782
  _proto.practiceGetWorkflows = function practiceGetWorkflows(practiceUuid, kind) {
1975
2783
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/workflows", {
1976
2784
  params: {
@@ -1978,11 +2786,12 @@ var PracticeService = /*#__PURE__*/function () {
1978
2786
  }
1979
2787
  });
1980
2788
  };
2789
+
1981
2790
  _proto.practiceGetWorkflow = function practiceGetWorkflow(practiceUuid, workflowType) {
1982
2791
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/workflows/" + workflowType);
1983
- }
1984
- /// Plans
2792
+ } /// Plans
1985
2793
  ;
2794
+
1986
2795
  _proto.practiceGetPlans = function practiceGetPlans(practiceUuid, planType) {
1987
2796
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/plans", {
1988
2797
  params: {
@@ -1990,14 +2799,16 @@ var PracticeService = /*#__PURE__*/function () {
1990
2799
  }
1991
2800
  });
1992
2801
  };
2802
+
1993
2803
  _proto.practiceGetPlan = function practiceGetPlan(practiceUuid, planId) {
1994
2804
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/plans/" + planId);
1995
2805
  };
2806
+
1996
2807
  _proto.practiceGetPlanPrices = function practiceGetPlanPrices(practiceUuid, planId) {
1997
2808
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/plans/" + planId + "/prices");
1998
- }
1999
- // Payments
2809
+ } // Payments
2000
2810
  ;
2811
+
2001
2812
  _proto.practiceGetPayments = function practiceGetPayments(practiceUuid, statusPayment, withConsultUUIDNULL, perPage, indexPage) {
2002
2813
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments", {
2003
2814
  params: {
@@ -2008,14 +2819,16 @@ var PracticeService = /*#__PURE__*/function () {
2008
2819
  }
2009
2820
  });
2010
2821
  };
2822
+
2011
2823
  _proto.practiceGetPayment = function practiceGetPayment(practiceUuid, idStripeInvoiceOrPaymentIntent) {
2012
2824
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/" + idStripeInvoiceOrPaymentIntent);
2013
2825
  };
2826
+
2014
2827
  _proto.practiceGetPaymentForStripePaymentIntentWithID = function practiceGetPaymentForStripePaymentIntentWithID(practiceUuid, stripePaymentIntentId) {
2015
2828
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/" + stripePaymentIntentId);
2016
- }
2017
- // Payments Intent
2829
+ } // Payments Intent
2018
2830
  ;
2831
+
2019
2832
  _proto.practiceGetPaymentsIntents = function practiceGetPaymentsIntents(practiceUuid, planType) {
2020
2833
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/intents", {
2021
2834
  params: {
@@ -2027,7 +2840,9 @@ var PracticeService = /*#__PURE__*/function () {
2027
2840
  * This function return the user hased email to be use for creating payment intent
2028
2841
  * @param email the email to hash
2029
2842
  * @returns a hashed email
2030
- */;
2843
+ */
2844
+ ;
2845
+
2031
2846
  _proto.getPaymentIntentHashedEmail = function getPaymentIntentHashedEmail(email) {
2032
2847
  return hashToBase64String(email.toLowerCase());
2033
2848
  }
@@ -2041,7 +2856,9 @@ var PracticeService = /*#__PURE__*/function () {
2041
2856
  * @param promotionCode (optional) promotion code to apply
2042
2857
  * @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.).
2043
2858
  * @returns
2044
- */;
2859
+ */
2860
+ ;
2861
+
2045
2862
  _proto.practiceCreatePaymentsIntent = function practiceCreatePaymentsIntent(practiceUuid, planId, userEmail, isoLocality, url_subdomain, requestMetadata) {
2046
2863
  return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/intents/", {
2047
2864
  idPlan: planId,
@@ -2054,6 +2871,7 @@ var PracticeService = /*#__PURE__*/function () {
2054
2871
  }
2055
2872
  });
2056
2873
  };
2874
+
2057
2875
  _proto.practiceGetPaymentsIntent = function practiceGetPaymentsIntent(practiceUuid, paymentIntentId) {
2058
2876
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/intents/" + paymentIntentId);
2059
2877
  }
@@ -2066,7 +2884,9 @@ var PracticeService = /*#__PURE__*/function () {
2066
2884
  * @param promotionCode (optional) promotional code to apply
2067
2885
  * @param finalize (optional) if true will finalize the PracticePaymentIntent and related Stripe.Invoice. Once, finalized you cannot modify the PracticePaymentIntent anymore.
2068
2886
  * @returns the updated PracticePaymentIntent
2069
- */;
2887
+ */
2888
+ ;
2889
+
2070
2890
  _proto.practiceUpdatePaymentsIntent = function practiceUpdatePaymentsIntent(practiceUuid, idPraticePaymentIntent, practicePaymentIntent, userEmail, promotionCode, finalize) {
2071
2891
  return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/intents/" + idPraticePaymentIntent, _extends({}, practicePaymentIntent, {
2072
2892
  hashUserEmail: userEmail ? this.getPaymentIntentHashedEmail(userEmail) : undefined
@@ -2081,103 +2901,125 @@ var PracticeService = /*#__PURE__*/function () {
2081
2901
  * Invoice
2082
2902
  * @param practiceUuid UUID of the practice to get the invoice from
2083
2903
  * @param invoiceId ID of the invoice in stripe
2084
- */;
2904
+ */
2905
+ ;
2906
+
2085
2907
  _proto.getInvoice = function getInvoice(practiceUuid, invoiceId) {
2086
2908
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/invoices/" + invoiceId);
2087
- }
2088
- // Practitioner
2909
+ } // Practitioner
2089
2910
  ;
2911
+
2090
2912
  _proto.practiceGetPractitioners = function practiceGetPractitioners(practiceUuid) {
2091
2913
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners");
2092
2914
  };
2915
+
2093
2916
  _proto.practiceUpdatePractitioner = function practiceUpdatePractitioner(practiceUuid, practitionerUuid, requestBody) {
2094
2917
  return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid, requestBody);
2095
2918
  };
2919
+
2096
2920
  _proto.practiceGetPractitioner = function practiceGetPractitioner(practiceUuid, practitionerUuid) {
2097
2921
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid);
2098
- }
2099
- // Practitioner Licenses
2922
+ } // Practitioner Licenses
2100
2923
  ;
2924
+
2101
2925
  _proto.practiceGetPractitionerLicenses = function practiceGetPractitionerLicenses(practiceUuid, practitionerUuid) {
2102
2926
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/licenses");
2103
2927
  };
2928
+
2104
2929
  _proto.practiceCreatePractitionerLicense = function practiceCreatePractitionerLicense(practiceUuid, practitionerUuid, requestBody) {
2105
2930
  return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/licenses", requestBody);
2106
2931
  };
2932
+
2107
2933
  _proto.practiceUpdatePractitionerLicense = function practiceUpdatePractitionerLicense(practiceUuid, practitionerUuid, licenseId, requestBody) {
2108
2934
  return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/licenses/" + licenseId, requestBody);
2109
2935
  };
2936
+
2110
2937
  _proto.practiceGetPractitionerLicense = function practiceGetPractitionerLicense(practiceUuid, practitionerUuid, licenseId) {
2111
2938
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/licenses/" + licenseId);
2112
- }
2113
- // Practitioner Preferences
2939
+ } // Practitioner Preferences
2114
2940
  ;
2941
+
2115
2942
  _proto.practiceGetPractitionerPreferences = function practiceGetPractitionerPreferences(practiceUuid, practitionerUuid) {
2116
2943
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/preferences");
2117
2944
  };
2945
+
2118
2946
  _proto.practiceCreatePractitionerPreference = function practiceCreatePractitionerPreference(practiceUuid, practitionerUuid, requestBody) {
2119
2947
  return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/preferences", requestBody);
2120
2948
  };
2949
+
2121
2950
  _proto.practiceUpdatePractitionerPreference = function practiceUpdatePractitionerPreference(practiceUuid, practitionerUuid, preferenceId, requestBody) {
2122
2951
  return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/preferences/" + preferenceId, requestBody);
2123
2952
  };
2953
+
2124
2954
  _proto.practiceGetPractitionerPreference = function practiceGetPractitionerPreference(practiceUuid, practitionerUuid, preferenceId) {
2125
2955
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/preferences/" + preferenceId);
2126
- }
2127
- // Practitioner Roles
2956
+ } // Practitioner Roles
2128
2957
  ;
2958
+
2129
2959
  _proto.practiceGetPractitionerRoles = function practiceGetPractitionerRoles(practiceUuid, practitionerUuid) {
2130
2960
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles");
2131
2961
  };
2962
+
2132
2963
  _proto.practiceCreatePractitionerRole = function practiceCreatePractitionerRole(practiceUuid, practitionerUuid, requestBody) {
2133
2964
  return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles", requestBody);
2134
2965
  };
2966
+
2135
2967
  _proto.practiceDeletePractitionerRoles = function practiceDeletePractitionerRoles(practiceUuid, practitionerUuid) {
2136
2968
  return this.api.deleteRequest(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles");
2137
2969
  };
2970
+
2138
2971
  _proto.practiceUpdatePractitionerRole = function practiceUpdatePractitionerRole(practiceUuid, practitionerUuid, roleId, requestBody) {
2139
2972
  return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles/" + roleId, requestBody);
2140
2973
  };
2974
+
2141
2975
  _proto.practiceGetPractitionerRole = function practiceGetPractitionerRole(practiceUuid, practitionerUuid, roleId) {
2142
2976
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles/" + roleId);
2143
2977
  };
2978
+
2144
2979
  _proto.practiceDeletePractitionerRole = function practiceDeletePractitionerRole(practiceUuid, practitionerUuid, roleId) {
2145
2980
  return this.api.deleteRequest(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles/" + roleId);
2146
- }
2147
- // Practitioner signature
2981
+ } // Practitioner signature
2982
+
2148
2983
  /**
2149
2984
  * This function returns the practitioner's signature as a Blob
2150
2985
  * @param practiceUuid the practice uuid of the practitioner
2151
2986
  * @param practitionerUuid the practitioner uuid
2152
2987
  * @returns a blob representing the signature
2153
- */;
2988
+ */
2989
+ ;
2990
+
2154
2991
  _proto.practiceGetPractitionerSignature = function practiceGetPractitionerSignature(practiceUuid, practitionerUuid) {
2155
2992
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/signature", {
2156
2993
  responseType: 'blob'
2157
2994
  });
2158
- }
2159
- // Assignments
2995
+ } // Assignments
2160
2996
  ;
2997
+
2161
2998
  _proto.practiceGetAssignments = function practiceGetAssignments(practiceUuid) {
2162
2999
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/assignments");
2163
3000
  };
3001
+
2164
3002
  _proto.practiceCreateAssignment = function practiceCreateAssignment(practiceUuid, requestBody) {
2165
3003
  return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/assignments", requestBody);
2166
3004
  };
3005
+
2167
3006
  _proto.practiceUpdateAssignment = function practiceUpdateAssignment(practiceUuid, assignmentId, requestBody) {
2168
3007
  return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/assignments/" + assignmentId, requestBody);
2169
3008
  };
3009
+
2170
3010
  _proto.practiceGetAssignment = function practiceGetAssignment(practiceUuid, assignmentId) {
2171
3011
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/assignments/" + assignmentId);
2172
- }
2173
- // Quotas
3012
+ } // Quotas
2174
3013
  ;
3014
+
2175
3015
  _proto.practiceGetQuotas = function practiceGetQuotas(practiceUuid) {
2176
3016
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/quotas");
2177
3017
  };
3018
+
2178
3019
  _proto.practiceGetQuota = function practiceGetQuota(practiceUuid, quotaId) {
2179
3020
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/quotas/" + quotaId);
2180
3021
  };
3022
+
2181
3023
  return PracticeService;
2182
3024
  }();
2183
3025
 
@@ -2186,35 +3028,44 @@ var TellerService = /*#__PURE__*/function () {
2186
3028
  this.api = api;
2187
3029
  this.baseURL = baseURL;
2188
3030
  }
3031
+
2189
3032
  var _proto = TellerService.prototype;
3033
+
2190
3034
  _proto.lockboxDataStore = /*#__PURE__*/function () {
2191
- var _lockboxDataStore = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(lockboxUuid, req, lockboxOwnerUuid, previousDataUuid, options) {
2192
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2193
- while (1) switch (_context.prev = _context.next) {
2194
- case 0:
2195
- if (options === void 0) {
2196
- options = {
2197
- updateMedicalStatus: true
2198
- };
2199
- }
2200
- return _context.abrupt("return", this.api.post(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/data", req, {
2201
- params: {
2202
- lockbox_owner_uuid: lockboxOwnerUuid,
2203
- data_uuid: previousDataUuid,
2204
- update_medical_status: options.updateMedicalStatus
3035
+ var _lockboxDataStore = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(lockboxUuid, req, lockboxOwnerUuid, previousDataUuid, options) {
3036
+ return runtime_1.wrap(function _callee$(_context) {
3037
+ while (1) {
3038
+ switch (_context.prev = _context.next) {
3039
+ case 0:
3040
+ if (options === void 0) {
3041
+ options = {
3042
+ updateMedicalStatus: true
3043
+ };
2205
3044
  }
2206
- }));
2207
- case 2:
2208
- case "end":
2209
- return _context.stop();
3045
+
3046
+ return _context.abrupt("return", this.api.post(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/data", req, {
3047
+ params: {
3048
+ lockbox_owner_uuid: lockboxOwnerUuid,
3049
+ data_uuid: previousDataUuid,
3050
+ update_medical_status: options.updateMedicalStatus
3051
+ }
3052
+ }));
3053
+
3054
+ case 2:
3055
+ case "end":
3056
+ return _context.stop();
3057
+ }
2210
3058
  }
2211
3059
  }, _callee, this);
2212
3060
  }));
3061
+
2213
3062
  function lockboxDataStore(_x, _x2, _x3, _x4, _x5) {
2214
3063
  return _lockboxDataStore.apply(this, arguments);
2215
3064
  }
3065
+
2216
3066
  return lockboxDataStore;
2217
3067
  }();
3068
+
2218
3069
  _proto.updateConsultByUUID = function updateConsultByUUID(patientUuid, uuidConsult, statusMedical, closedReasonType, closedReasonDescription, neverExpires) {
2219
3070
  return this.api.put(this.baseURL + "/v1/consults/" + uuidConsult, {
2220
3071
  patientUuid: patientUuid,
@@ -2232,7 +3083,9 @@ var TellerService = /*#__PURE__*/function () {
2232
3083
  * @param consultationShortId the consultation short id
2233
3084
  * @param fax the address where to send the fax
2234
3085
  * @returns void
2235
- */;
3086
+ */
3087
+ ;
3088
+
2236
3089
  _proto.notifyFaxFailed = function notifyFaxFailed(practiceUuid, consultationUuid, consultationShortId, fax) {
2237
3090
  return this.api.post(this.baseURL + "/v1/fax-failed", {
2238
3091
  consultationUuid: consultationUuid,
@@ -2249,7 +3102,9 @@ var TellerService = /*#__PURE__*/function () {
2249
3102
  * @todo - Make service only exposed route
2250
3103
  * @param uuidConsult the uuid of the consult to reassign
2251
3104
  * @param newPractitionerUuid the uuid of the practitioner that will get reassigned
2252
- */;
3105
+ */
3106
+ ;
3107
+
2253
3108
  _proto.reassignmentEmail = function reassignmentEmail(uuidConsult, newPractitionerUuid) {
2254
3109
  return this.api.post(this.baseURL + "/v1/consult/" + uuidConsult + "/reassignment-email", {
2255
3110
  newPractitionerUuid: newPractitionerUuid
@@ -2261,7 +3116,9 @@ var TellerService = /*#__PURE__*/function () {
2261
3116
  * @param consult
2262
3117
  * @param patientUuid
2263
3118
  * @returns void
2264
- */;
3119
+ */
3120
+ ;
3121
+
2265
3122
  _proto.sendOnlineFaxSuccessfulEmail = function sendOnlineFaxSuccessfulEmail(consult, patientUuid) {
2266
3123
  return this.api.post(this.baseURL + "/v1/online-fax-notify", {
2267
3124
  consult: consult,
@@ -2272,10 +3129,13 @@ var TellerService = /*#__PURE__*/function () {
2272
3129
  * This function will send an email to patient to allow them to resume the consult.
2273
3130
  * @param req the body of the resume consult request
2274
3131
  * @returns void
2275
- */;
3132
+ */
3133
+ ;
3134
+
2276
3135
  _proto.sendResumeConsultEmail = function sendResumeConsultEmail(req) {
2277
3136
  return this.api.post(this.baseURL + "/v1/resume-consult-email", req);
2278
3137
  };
3138
+
2279
3139
  return TellerService;
2280
3140
  }();
2281
3141
 
@@ -2284,85 +3144,110 @@ var VaultService = /*#__PURE__*/function () {
2284
3144
  this.api = api;
2285
3145
  this.baseURL = baseURL;
2286
3146
  }
3147
+
2287
3148
  var _proto = VaultService.prototype;
3149
+
2288
3150
  _proto.lockboxCreate = /*#__PURE__*/function () {
2289
- var _lockboxCreate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(lockboxMetadata) {
2290
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2291
- while (1) switch (_context.prev = _context.next) {
2292
- case 0:
2293
- return _context.abrupt("return", this.api.post(this.baseURL + "/v1/lockbox", lockboxMetadata));
2294
- case 1:
2295
- case "end":
2296
- return _context.stop();
3151
+ var _lockboxCreate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(lockboxMetadata) {
3152
+ return runtime_1.wrap(function _callee$(_context) {
3153
+ while (1) {
3154
+ switch (_context.prev = _context.next) {
3155
+ case 0:
3156
+ return _context.abrupt("return", this.api.post(this.baseURL + "/v1/lockbox", lockboxMetadata));
3157
+
3158
+ case 1:
3159
+ case "end":
3160
+ return _context.stop();
3161
+ }
2297
3162
  }
2298
3163
  }, _callee, this);
2299
3164
  }));
3165
+
2300
3166
  function lockboxCreate(_x) {
2301
3167
  return _lockboxCreate.apply(this, arguments);
2302
3168
  }
3169
+
2303
3170
  return lockboxCreate;
2304
3171
  }();
3172
+
2305
3173
  _proto.lockboxMetadataAdd = /*#__PURE__*/function () {
2306
- var _lockboxMetadataAdd = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(lockboxUuid, lockboxMetadata, lockboxOwnerUuid) {
2307
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2308
- while (1) switch (_context2.prev = _context2.next) {
2309
- case 0:
2310
- return _context2.abrupt("return", this.api.put(this.baseURL + "/v1/lockbox/" + lockboxUuid, lockboxMetadata, {
2311
- params: {
2312
- lockbox_owner_uuid: lockboxOwnerUuid
2313
- }
2314
- }));
2315
- case 1:
2316
- case "end":
2317
- return _context2.stop();
3174
+ var _lockboxMetadataAdd = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(lockboxUuid, lockboxMetadata, lockboxOwnerUuid) {
3175
+ return runtime_1.wrap(function _callee2$(_context2) {
3176
+ while (1) {
3177
+ switch (_context2.prev = _context2.next) {
3178
+ case 0:
3179
+ return _context2.abrupt("return", this.api.put(this.baseURL + "/v1/lockbox/" + lockboxUuid, lockboxMetadata, {
3180
+ params: {
3181
+ lockbox_owner_uuid: lockboxOwnerUuid
3182
+ }
3183
+ }));
3184
+
3185
+ case 1:
3186
+ case "end":
3187
+ return _context2.stop();
3188
+ }
2318
3189
  }
2319
3190
  }, _callee2, this);
2320
3191
  }));
3192
+
2321
3193
  function lockboxMetadataAdd(_x2, _x3, _x4) {
2322
3194
  return _lockboxMetadataAdd.apply(this, arguments);
2323
3195
  }
3196
+
2324
3197
  return lockboxMetadataAdd;
2325
3198
  }();
3199
+
2326
3200
  _proto.lockboxSecretGet = /*#__PURE__*/function () {
2327
- var _lockboxSecretGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(lockboxUuid, lockboxOwnerUuid) {
2328
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
2329
- while (1) switch (_context3.prev = _context3.next) {
2330
- case 0:
2331
- return _context3.abrupt("return", this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/secret", {
2332
- params: {
2333
- lockbox_owner_uuid: lockboxOwnerUuid
2334
- }
2335
- }));
2336
- case 1:
2337
- case "end":
2338
- return _context3.stop();
3201
+ var _lockboxSecretGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(lockboxUuid, lockboxOwnerUuid) {
3202
+ return runtime_1.wrap(function _callee3$(_context3) {
3203
+ while (1) {
3204
+ switch (_context3.prev = _context3.next) {
3205
+ case 0:
3206
+ return _context3.abrupt("return", this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/secret", {
3207
+ params: {
3208
+ lockbox_owner_uuid: lockboxOwnerUuid
3209
+ }
3210
+ }));
3211
+
3212
+ case 1:
3213
+ case "end":
3214
+ return _context3.stop();
3215
+ }
2339
3216
  }
2340
3217
  }, _callee3, this);
2341
3218
  }));
3219
+
2342
3220
  function lockboxSecretGet(_x5, _x6) {
2343
3221
  return _lockboxSecretGet.apply(this, arguments);
2344
3222
  }
3223
+
2345
3224
  return lockboxSecretGet;
2346
3225
  }();
3226
+
2347
3227
  _proto.lockboxGrant = /*#__PURE__*/function () {
2348
- var _lockboxGrant = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(lockboxUuid, req, lockboxOwnerUuid) {
2349
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
2350
- while (1) switch (_context4.prev = _context4.next) {
2351
- case 0:
2352
- return _context4.abrupt("return", this.api.post(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/grant", req, {
2353
- params: {
2354
- lockbox_owner_uuid: lockboxOwnerUuid
2355
- }
2356
- }));
2357
- case 1:
2358
- case "end":
2359
- return _context4.stop();
3228
+ var _lockboxGrant = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(lockboxUuid, req, lockboxOwnerUuid) {
3229
+ return runtime_1.wrap(function _callee4$(_context4) {
3230
+ while (1) {
3231
+ switch (_context4.prev = _context4.next) {
3232
+ case 0:
3233
+ return _context4.abrupt("return", this.api.post(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/grant", req, {
3234
+ params: {
3235
+ lockbox_owner_uuid: lockboxOwnerUuid
3236
+ }
3237
+ }));
3238
+
3239
+ case 1:
3240
+ case "end":
3241
+ return _context4.stop();
3242
+ }
2360
3243
  }
2361
3244
  }, _callee4, this);
2362
3245
  }));
3246
+
2363
3247
  function lockboxGrant(_x7, _x8, _x9) {
2364
3248
  return _lockboxGrant.apply(this, arguments);
2365
3249
  }
3250
+
2366
3251
  return lockboxGrant;
2367
3252
  }()
2368
3253
  /**
@@ -2371,23 +3256,29 @@ var VaultService = /*#__PURE__*/function () {
2371
3256
  * @returns decrypted lockboxes granted to user
2372
3257
  */
2373
3258
  ;
3259
+
2374
3260
  _proto.grantsGet =
2375
3261
  /*#__PURE__*/
2376
3262
  function () {
2377
- var _grantsGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
2378
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
2379
- while (1) switch (_context5.prev = _context5.next) {
2380
- case 0:
2381
- return _context5.abrupt("return", this.api.get(this.baseURL + "/v1/grants"));
2382
- case 1:
2383
- case "end":
2384
- return _context5.stop();
3263
+ var _grantsGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5() {
3264
+ return runtime_1.wrap(function _callee5$(_context5) {
3265
+ while (1) {
3266
+ switch (_context5.prev = _context5.next) {
3267
+ case 0:
3268
+ return _context5.abrupt("return", this.api.get(this.baseURL + "/v1/grants"));
3269
+
3270
+ case 1:
3271
+ case "end":
3272
+ return _context5.stop();
3273
+ }
2385
3274
  }
2386
3275
  }, _callee5, this);
2387
3276
  }));
3277
+
2388
3278
  function grantsGet() {
2389
3279
  return _grantsGet.apply(this, arguments);
2390
3280
  }
3281
+
2391
3282
  return grantsGet;
2392
3283
  }()
2393
3284
  /**
@@ -2401,112 +3292,141 @@ var VaultService = /*#__PURE__*/function () {
2401
3292
  * @returns
2402
3293
  */
2403
3294
  ;
3295
+
2404
3296
  _proto.lockboxDataStore =
2405
3297
  /*#__PURE__*/
2406
3298
  function () {
2407
- var _lockboxDataStore = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(lockboxUuid, req, lockboxOwnerUuid, previousDataUuid) {
2408
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
2409
- while (1) switch (_context6.prev = _context6.next) {
2410
- case 0:
2411
- return _context6.abrupt("return", this.api.post(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/data", req, {
2412
- params: {
2413
- lockbox_owner_uuid: lockboxOwnerUuid,
2414
- data_uuid: previousDataUuid
2415
- }
2416
- }));
2417
- case 1:
2418
- case "end":
2419
- return _context6.stop();
3299
+ var _lockboxDataStore = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(lockboxUuid, req, lockboxOwnerUuid, previousDataUuid) {
3300
+ return runtime_1.wrap(function _callee6$(_context6) {
3301
+ while (1) {
3302
+ switch (_context6.prev = _context6.next) {
3303
+ case 0:
3304
+ return _context6.abrupt("return", this.api.post(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/data", req, {
3305
+ params: {
3306
+ lockbox_owner_uuid: lockboxOwnerUuid,
3307
+ data_uuid: previousDataUuid
3308
+ }
3309
+ }));
3310
+
3311
+ case 1:
3312
+ case "end":
3313
+ return _context6.stop();
3314
+ }
2420
3315
  }
2421
3316
  }, _callee6, this);
2422
3317
  }));
3318
+
2423
3319
  function lockboxDataStore(_x10, _x11, _x12, _x13) {
2424
3320
  return _lockboxDataStore.apply(this, arguments);
2425
3321
  }
3322
+
2426
3323
  return lockboxDataStore;
2427
3324
  }();
3325
+
2428
3326
  _proto.lockboxDataGet = /*#__PURE__*/function () {
2429
- var _lockboxDataGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(lockboxUuid, dataUuid, lockboxOwnerUuid, stream) {
3327
+ var _lockboxDataGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(lockboxUuid, dataUuid, lockboxOwnerUuid, stream) {
2430
3328
  var data;
2431
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
2432
- while (1) switch (_context7.prev = _context7.next) {
2433
- case 0:
2434
- if (stream === void 0) {
2435
- stream = true;
2436
- }
2437
- _context7.next = 3;
2438
- return this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/data/" + dataUuid, {
2439
- params: {
2440
- lockbox_owner_uuid: lockboxOwnerUuid,
2441
- stream: stream
3329
+ return runtime_1.wrap(function _callee7$(_context7) {
3330
+ while (1) {
3331
+ switch (_context7.prev = _context7.next) {
3332
+ case 0:
3333
+ if (stream === void 0) {
3334
+ stream = true;
2442
3335
  }
2443
- });
2444
- case 3:
2445
- data = _context7.sent;
2446
- if (!stream) {
2447
- _context7.next = 6;
2448
- break;
2449
- }
2450
- return _context7.abrupt("return", {
2451
- data: data
2452
- });
2453
- case 6:
2454
- return _context7.abrupt("return", data);
2455
- case 7:
2456
- case "end":
2457
- return _context7.stop();
3336
+
3337
+ _context7.next = 3;
3338
+ return this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/data/" + dataUuid, {
3339
+ params: {
3340
+ lockbox_owner_uuid: lockboxOwnerUuid,
3341
+ stream: stream
3342
+ }
3343
+ });
3344
+
3345
+ case 3:
3346
+ data = _context7.sent;
3347
+
3348
+ if (!stream) {
3349
+ _context7.next = 6;
3350
+ break;
3351
+ }
3352
+
3353
+ return _context7.abrupt("return", {
3354
+ data: data
3355
+ });
3356
+
3357
+ case 6:
3358
+ return _context7.abrupt("return", data);
3359
+
3360
+ case 7:
3361
+ case "end":
3362
+ return _context7.stop();
3363
+ }
2458
3364
  }
2459
3365
  }, _callee7, this);
2460
3366
  }));
3367
+
2461
3368
  function lockboxDataGet(_x14, _x15, _x16, _x17) {
2462
3369
  return _lockboxDataGet.apply(this, arguments);
2463
3370
  }
3371
+
2464
3372
  return lockboxDataGet;
2465
3373
  }();
3374
+
2466
3375
  _proto.lockboxManifestGet = /*#__PURE__*/function () {
2467
- var _lockboxManifestGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(lockboxUuid, filter, lockboxOwnerUuid) {
2468
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
2469
- while (1) switch (_context8.prev = _context8.next) {
2470
- case 0:
2471
- return _context8.abrupt("return", this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid, {
2472
- params: {
2473
- lockbox_owner_uuid: lockboxOwnerUuid,
2474
- filter: filter
2475
- }
2476
- }));
2477
- case 1:
2478
- case "end":
2479
- return _context8.stop();
3376
+ var _lockboxManifestGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(lockboxUuid, filter, lockboxOwnerUuid) {
3377
+ return runtime_1.wrap(function _callee8$(_context8) {
3378
+ while (1) {
3379
+ switch (_context8.prev = _context8.next) {
3380
+ case 0:
3381
+ return _context8.abrupt("return", this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid, {
3382
+ params: {
3383
+ lockbox_owner_uuid: lockboxOwnerUuid,
3384
+ filter: filter
3385
+ }
3386
+ }));
3387
+
3388
+ case 1:
3389
+ case "end":
3390
+ return _context8.stop();
3391
+ }
2480
3392
  }
2481
3393
  }, _callee8, this);
2482
3394
  }));
3395
+
2483
3396
  function lockboxManifestGet(_x18, _x19, _x20) {
2484
3397
  return _lockboxManifestGet.apply(this, arguments);
2485
3398
  }
3399
+
2486
3400
  return lockboxManifestGet;
2487
3401
  }();
3402
+
2488
3403
  _proto.lockboxMetadataGet = /*#__PURE__*/function () {
2489
- var _lockboxMetadataGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(lockboxUuid, fields, groupby, filter, lockboxOwnerUuid) {
2490
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
2491
- while (1) switch (_context9.prev = _context9.next) {
2492
- case 0:
2493
- return _context9.abrupt("return", this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/metadata", {
2494
- params: {
2495
- lockbox_owner_uuid: lockboxOwnerUuid,
2496
- fields: fields,
2497
- groupby: groupby,
2498
- filter: filter
2499
- }
2500
- }));
2501
- case 1:
2502
- case "end":
2503
- return _context9.stop();
3404
+ var _lockboxMetadataGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9(lockboxUuid, fields, groupby, filter, lockboxOwnerUuid) {
3405
+ return runtime_1.wrap(function _callee9$(_context9) {
3406
+ while (1) {
3407
+ switch (_context9.prev = _context9.next) {
3408
+ case 0:
3409
+ return _context9.abrupt("return", this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/metadata", {
3410
+ params: {
3411
+ lockbox_owner_uuid: lockboxOwnerUuid,
3412
+ fields: fields,
3413
+ groupby: groupby,
3414
+ filter: filter
3415
+ }
3416
+ }));
3417
+
3418
+ case 1:
3419
+ case "end":
3420
+ return _context9.stop();
3421
+ }
2504
3422
  }
2505
3423
  }, _callee9, this);
2506
3424
  }));
3425
+
2507
3426
  function lockboxMetadataGet(_x21, _x22, _x23, _x24, _x25) {
2508
3427
  return _lockboxMetadataGet.apply(this, arguments);
2509
3428
  }
3429
+
2510
3430
  return lockboxMetadataGet;
2511
3431
  }()
2512
3432
  /**
@@ -2517,27 +3437,33 @@ var VaultService = /*#__PURE__*/function () {
2517
3437
  * @param indexOwnerUuid
2518
3438
  */
2519
3439
  ;
3440
+
2520
3441
  _proto.vaultIndexPut =
2521
3442
  /*#__PURE__*/
2522
3443
  function () {
2523
- var _vaultIndexPut = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(entries, indexOwnerUuid) {
2524
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
2525
- while (1) switch (_context10.prev = _context10.next) {
2526
- case 0:
2527
- return _context10.abrupt("return", this.api.put(this.baseURL + "/v1/index", entries, {
2528
- params: {
2529
- index_owner_uuid: indexOwnerUuid
2530
- }
2531
- }));
2532
- case 1:
2533
- case "end":
2534
- return _context10.stop();
3444
+ var _vaultIndexPut = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10(entries, indexOwnerUuid) {
3445
+ return runtime_1.wrap(function _callee10$(_context10) {
3446
+ while (1) {
3447
+ switch (_context10.prev = _context10.next) {
3448
+ case 0:
3449
+ return _context10.abrupt("return", this.api.put(this.baseURL + "/v1/index", entries, {
3450
+ params: {
3451
+ index_owner_uuid: indexOwnerUuid
3452
+ }
3453
+ }));
3454
+
3455
+ case 1:
3456
+ case "end":
3457
+ return _context10.stop();
3458
+ }
2535
3459
  }
2536
3460
  }, _callee10, this);
2537
3461
  }));
3462
+
2538
3463
  function vaultIndexPut(_x26, _x27) {
2539
3464
  return _vaultIndexPut.apply(this, arguments);
2540
3465
  }
3466
+
2541
3467
  return vaultIndexPut;
2542
3468
  }()
2543
3469
  /**
@@ -2546,23 +3472,29 @@ var VaultService = /*#__PURE__*/function () {
2546
3472
  * @param entry the encrypted index snapshot
2547
3473
  */
2548
3474
  ;
3475
+
2549
3476
  _proto.vaultIndexSnapshotPut =
2550
3477
  /*#__PURE__*/
2551
3478
  function () {
2552
- var _vaultIndexSnapshotPut = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(entry) {
2553
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
2554
- while (1) switch (_context11.prev = _context11.next) {
2555
- case 0:
2556
- return _context11.abrupt("return", this.api.put(this.baseURL + "/v1/index-snapshot", entry));
2557
- case 1:
2558
- case "end":
2559
- return _context11.stop();
3479
+ var _vaultIndexSnapshotPut = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11(entry) {
3480
+ return runtime_1.wrap(function _callee11$(_context11) {
3481
+ while (1) {
3482
+ switch (_context11.prev = _context11.next) {
3483
+ case 0:
3484
+ return _context11.abrupt("return", this.api.put(this.baseURL + "/v1/index-snapshot", entry));
3485
+
3486
+ case 1:
3487
+ case "end":
3488
+ return _context11.stop();
3489
+ }
2560
3490
  }
2561
3491
  }, _callee11, this);
2562
3492
  }));
3493
+
2563
3494
  function vaultIndexSnapshotPut(_x28) {
2564
3495
  return _vaultIndexSnapshotPut.apply(this, arguments);
2565
3496
  }
3497
+
2566
3498
  return vaultIndexSnapshotPut;
2567
3499
  }()
2568
3500
  /**
@@ -2574,31 +3506,38 @@ var VaultService = /*#__PURE__*/function () {
2574
3506
  * @returns the encrypted index
2575
3507
  */
2576
3508
  ;
3509
+
2577
3510
  _proto.vaultIndexGet =
2578
3511
  /*#__PURE__*/
2579
3512
  function () {
2580
- var _vaultIndexGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(indexKeys, identifiers, timestamp) {
2581
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
2582
- while (1) switch (_context12.prev = _context12.next) {
2583
- case 0:
2584
- return _context12.abrupt("return", this.api.get(this.baseURL + "/v1/index", {
2585
- params: {
2586
- index_keys: indexKeys,
2587
- identifiers: identifiers,
2588
- timestamp: timestamp
2589
- }
2590
- }));
2591
- case 1:
2592
- case "end":
2593
- return _context12.stop();
3513
+ var _vaultIndexGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee12(indexKeys, identifiers, timestamp) {
3514
+ return runtime_1.wrap(function _callee12$(_context12) {
3515
+ while (1) {
3516
+ switch (_context12.prev = _context12.next) {
3517
+ case 0:
3518
+ return _context12.abrupt("return", this.api.get(this.baseURL + "/v1/index", {
3519
+ params: {
3520
+ index_keys: indexKeys,
3521
+ identifiers: identifiers,
3522
+ timestamp: timestamp
3523
+ }
3524
+ }));
3525
+
3526
+ case 1:
3527
+ case "end":
3528
+ return _context12.stop();
3529
+ }
2594
3530
  }
2595
3531
  }, _callee12, this);
2596
3532
  }));
3533
+
2597
3534
  function vaultIndexGet(_x29, _x30, _x31) {
2598
3535
  return _vaultIndexGet.apply(this, arguments);
2599
3536
  }
3537
+
2600
3538
  return vaultIndexGet;
2601
3539
  }();
3540
+
2602
3541
  return VaultService;
2603
3542
  }();
2604
3543
 
@@ -2611,7 +3550,10 @@ var WorkflowService = /*#__PURE__*/function () {
2611
3550
  * This function returns all workflows
2612
3551
  * @returns desired workflow
2613
3552
  */
3553
+
3554
+
2614
3555
  var _proto = WorkflowService.prototype;
3556
+
2615
3557
  _proto.getWorkflows = function getWorkflows() {
2616
3558
  return this.api.get(this.v1Url + "/workflows");
2617
3559
  }
@@ -2622,7 +3564,9 @@ var WorkflowService = /*#__PURE__*/function () {
2622
3564
  * @param locale (optional) The desired locale of the workflow (default: 'en')
2623
3565
  * @param createdAt (optional) The creation date of the workflow (also used for versionning)
2624
3566
  * @returns desired workflow
2625
- */;
3567
+ */
3568
+ ;
3569
+
2626
3570
  _proto.getWorkflow = function getWorkflow(id, locale, createdAt) {
2627
3571
  return this.api.get(this.v1Url + "/workflows/" + id, {
2628
3572
  params: {
@@ -2631,6 +3575,7 @@ var WorkflowService = /*#__PURE__*/function () {
2631
3575
  }
2632
3576
  });
2633
3577
  };
3578
+
2634
3579
  return WorkflowService;
2635
3580
  }();
2636
3581
 
@@ -2641,18 +3586,20 @@ var WorkflowService = /*#__PURE__*/function () {
2641
3586
  * @param useLocalStorage (default: true) if true store tokens into local storage (only for browsers)
2642
3587
  * @returns an instance of each services with a provided url
2643
3588
  */
3589
+
2644
3590
  var init = function init(services, authenticationCallback, useLocalStorage) {
2645
3591
  if (useLocalStorage === void 0) {
2646
3592
  useLocalStorage = true;
2647
3593
  }
3594
+
2648
3595
  var tellerBaseURL = services.tellerBaseURL,
2649
- practiceBaseURL = services.practiceBaseURL,
2650
- consultBaseURL = services.consultBaseURL,
2651
- vaultBaseURL = services.vaultBaseURL,
2652
- guardBaseURL = services.guardBaseURL,
2653
- searchBaseURL = services.searchBaseURL,
2654
- workflowBaseURL = services.workflowBaseURL,
2655
- diagnosisBaseURL = services.diagnosisBaseURL;
3596
+ practiceBaseURL = services.practiceBaseURL,
3597
+ consultBaseURL = services.consultBaseURL,
3598
+ vaultBaseURL = services.vaultBaseURL,
3599
+ guardBaseURL = services.guardBaseURL,
3600
+ searchBaseURL = services.searchBaseURL,
3601
+ workflowBaseURL = services.workflowBaseURL,
3602
+ diagnosisBaseURL = services.diagnosisBaseURL;
2656
3603
  var apiService = new APIService(useLocalStorage, undefined, authenticationCallback);
2657
3604
  return {
2658
3605
  apiService: apiService,