oro-sdk-apis 3.2.4 → 3.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,26 +8,21 @@ import axios from 'axios';
8
8
  * @param value the string to hash
9
9
  * @returns a base64 string representation of a hashed value
10
10
  */
11
-
12
11
  function hashToBase64String(value) {
13
12
  return Buffer.from(sha256().update(value).digest('hex'), 'hex').toString('base64');
14
13
  }
15
14
 
16
15
  function _regeneratorRuntime() {
17
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
18
-
19
16
  _regeneratorRuntime = function () {
20
17
  return exports;
21
18
  };
22
-
23
19
  var exports = {},
24
- Op = Object.prototype,
25
- hasOwn = Op.hasOwnProperty,
26
- $Symbol = "function" == typeof Symbol ? Symbol : {},
27
- iteratorSymbol = $Symbol.iterator || "@@iterator",
28
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
29
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
30
-
20
+ Op = Object.prototype,
21
+ hasOwn = Op.hasOwnProperty,
22
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
23
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
24
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
25
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
31
26
  function define(obj, key, value) {
32
27
  return Object.defineProperty(obj, key, {
33
28
  value: value,
@@ -36,7 +31,6 @@ function _regeneratorRuntime() {
36
31
  writable: !0
37
32
  }), obj[key];
38
33
  }
39
-
40
34
  try {
41
35
  define({}, "");
42
36
  } catch (err) {
@@ -44,40 +38,33 @@ function _regeneratorRuntime() {
44
38
  return obj[key] = value;
45
39
  };
46
40
  }
47
-
48
41
  function wrap(innerFn, outerFn, self, tryLocsList) {
49
42
  var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
50
- generator = Object.create(protoGenerator.prototype),
51
- context = new Context(tryLocsList || []);
43
+ generator = Object.create(protoGenerator.prototype),
44
+ context = new Context(tryLocsList || []);
52
45
  return generator._invoke = function (innerFn, self, context) {
53
46
  var state = "suspendedStart";
54
47
  return function (method, arg) {
55
48
  if ("executing" === state) throw new Error("Generator is already running");
56
-
57
49
  if ("completed" === state) {
58
50
  if ("throw" === method) throw arg;
59
51
  return doneResult();
60
52
  }
61
-
62
53
  for (context.method = method, context.arg = arg;;) {
63
54
  var delegate = context.delegate;
64
-
65
55
  if (delegate) {
66
56
  var delegateResult = maybeInvokeDelegate(delegate, context);
67
-
68
57
  if (delegateResult) {
69
58
  if (delegateResult === ContinueSentinel) continue;
70
59
  return delegateResult;
71
60
  }
72
61
  }
73
-
74
62
  if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
75
63
  if ("suspendedStart" === state) throw state = "completed", context.arg;
76
64
  context.dispatchException(context.arg);
77
65
  } else "return" === context.method && context.abrupt("return", context.arg);
78
66
  state = "executing";
79
67
  var record = tryCatch(innerFn, self, context);
80
-
81
68
  if ("normal" === record.type) {
82
69
  if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
83
70
  return {
@@ -85,13 +72,11 @@ function _regeneratorRuntime() {
85
72
  done: context.done
86
73
  };
87
74
  }
88
-
89
75
  "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
90
76
  }
91
77
  };
92
78
  }(innerFn, self, context), generator;
93
79
  }
94
-
95
80
  function tryCatch(fn, obj, arg) {
96
81
  try {
97
82
  return {
@@ -105,25 +90,19 @@ function _regeneratorRuntime() {
105
90
  };
106
91
  }
107
92
  }
108
-
109
93
  exports.wrap = wrap;
110
94
  var ContinueSentinel = {};
111
-
112
95
  function Generator() {}
113
-
114
96
  function GeneratorFunction() {}
115
-
116
97
  function GeneratorFunctionPrototype() {}
117
-
118
98
  var IteratorPrototype = {};
119
99
  define(IteratorPrototype, iteratorSymbol, function () {
120
100
  return this;
121
101
  });
122
102
  var getProto = Object.getPrototypeOf,
123
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
103
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
124
104
  NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
125
105
  var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
126
-
127
106
  function defineIteratorMethods(prototype) {
128
107
  ["next", "throw", "return"].forEach(function (method) {
129
108
  define(prototype, method, function (arg) {
@@ -131,14 +110,12 @@ function _regeneratorRuntime() {
131
110
  });
132
111
  });
133
112
  }
134
-
135
113
  function AsyncIterator(generator, PromiseImpl) {
136
114
  function invoke(method, arg, resolve, reject) {
137
115
  var record = tryCatch(generator[method], generator, arg);
138
-
139
116
  if ("throw" !== record.type) {
140
117
  var result = record.arg,
141
- value = result.value;
118
+ value = result.value;
142
119
  return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
143
120
  invoke("next", value, resolve, reject);
144
121
  }, function (err) {
@@ -149,89 +126,71 @@ function _regeneratorRuntime() {
149
126
  return invoke("throw", error, resolve, reject);
150
127
  });
151
128
  }
152
-
153
129
  reject(record.arg);
154
130
  }
155
-
156
131
  var previousPromise;
157
-
158
132
  this._invoke = function (method, arg) {
159
133
  function callInvokeWithMethodAndArg() {
160
134
  return new PromiseImpl(function (resolve, reject) {
161
135
  invoke(method, arg, resolve, reject);
162
136
  });
163
137
  }
164
-
165
138
  return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
166
139
  };
167
140
  }
168
-
169
141
  function maybeInvokeDelegate(delegate, context) {
170
142
  var method = delegate.iterator[context.method];
171
-
172
143
  if (undefined === method) {
173
144
  if (context.delegate = null, "throw" === context.method) {
174
145
  if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
175
146
  context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
176
147
  }
177
-
178
148
  return ContinueSentinel;
179
149
  }
180
-
181
150
  var record = tryCatch(method, delegate.iterator, context.arg);
182
151
  if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
183
152
  var info = record.arg;
184
153
  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);
185
154
  }
186
-
187
155
  function pushTryEntry(locs) {
188
156
  var entry = {
189
157
  tryLoc: locs[0]
190
158
  };
191
159
  1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
192
160
  }
193
-
194
161
  function resetTryEntry(entry) {
195
162
  var record = entry.completion || {};
196
163
  record.type = "normal", delete record.arg, entry.completion = record;
197
164
  }
198
-
199
165
  function Context(tryLocsList) {
200
166
  this.tryEntries = [{
201
167
  tryLoc: "root"
202
168
  }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
203
169
  }
204
-
205
170
  function values(iterable) {
206
171
  if (iterable) {
207
172
  var iteratorMethod = iterable[iteratorSymbol];
208
173
  if (iteratorMethod) return iteratorMethod.call(iterable);
209
174
  if ("function" == typeof iterable.next) return iterable;
210
-
211
175
  if (!isNaN(iterable.length)) {
212
176
  var i = -1,
213
- next = function next() {
214
- for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
215
-
216
- return next.value = undefined, next.done = !0, next;
217
- };
218
-
177
+ next = function next() {
178
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
179
+ return next.value = undefined, next.done = !0, next;
180
+ };
219
181
  return next.next = next;
220
182
  }
221
183
  }
222
-
223
184
  return {
224
185
  next: doneResult
225
186
  };
226
187
  }
227
-
228
188
  function doneResult() {
229
189
  return {
230
190
  value: undefined,
231
191
  done: !0
232
192
  };
233
193
  }
234
-
235
194
  return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
236
195
  var ctor = "function" == typeof genFun && genFun.constructor;
237
196
  return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
@@ -255,15 +214,12 @@ function _regeneratorRuntime() {
255
214
  return "[object Generator]";
256
215
  }), exports.keys = function (object) {
257
216
  var keys = [];
258
-
259
217
  for (var key in object) keys.push(key);
260
-
261
218
  return keys.reverse(), function next() {
262
219
  for (; keys.length;) {
263
220
  var key = keys.pop();
264
221
  if (key in object) return next.value = key, next.done = !1, next;
265
222
  }
266
-
267
223
  return next.done = !0, next;
268
224
  };
269
225
  }, exports.values = values, Context.prototype = {
@@ -280,20 +236,16 @@ function _regeneratorRuntime() {
280
236
  dispatchException: function (exception) {
281
237
  if (this.done) throw exception;
282
238
  var context = this;
283
-
284
239
  function handle(loc, caught) {
285
240
  return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
286
241
  }
287
-
288
242
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
289
243
  var entry = this.tryEntries[i],
290
- record = entry.completion;
244
+ record = entry.completion;
291
245
  if ("root" === entry.tryLoc) return handle("end");
292
-
293
246
  if (entry.tryLoc <= this.prev) {
294
247
  var hasCatch = hasOwn.call(entry, "catchLoc"),
295
- hasFinally = hasOwn.call(entry, "finallyLoc");
296
-
248
+ hasFinally = hasOwn.call(entry, "finallyLoc");
297
249
  if (hasCatch && hasFinally) {
298
250
  if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
299
251
  if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
@@ -309,13 +261,11 @@ function _regeneratorRuntime() {
309
261
  abrupt: function (type, arg) {
310
262
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
311
263
  var entry = this.tryEntries[i];
312
-
313
264
  if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
314
265
  var finallyEntry = entry;
315
266
  break;
316
267
  }
317
268
  }
318
-
319
269
  finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
320
270
  var record = finallyEntry ? finallyEntry.completion : {};
321
271
  return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
@@ -333,19 +283,15 @@ function _regeneratorRuntime() {
333
283
  catch: function (tryLoc) {
334
284
  for (var i = this.tryEntries.length - 1; i >= 0; --i) {
335
285
  var entry = this.tryEntries[i];
336
-
337
286
  if (entry.tryLoc === tryLoc) {
338
287
  var record = entry.completion;
339
-
340
288
  if ("throw" === record.type) {
341
289
  var thrown = record.arg;
342
290
  resetTryEntry(entry);
343
291
  }
344
-
345
292
  return thrown;
346
293
  }
347
294
  }
348
-
349
295
  throw new Error("illegal catch attempt");
350
296
  },
351
297
  delegateYield: function (iterable, resultName, nextLoc) {
@@ -357,7 +303,6 @@ function _regeneratorRuntime() {
357
303
  }
358
304
  }, exports;
359
305
  }
360
-
361
306
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
362
307
  try {
363
308
  var info = gen[key](arg);
@@ -366,65 +311,53 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
366
311
  reject(error);
367
312
  return;
368
313
  }
369
-
370
314
  if (info.done) {
371
315
  resolve(value);
372
316
  } else {
373
317
  Promise.resolve(value).then(_next, _throw);
374
318
  }
375
319
  }
376
-
377
320
  function _asyncToGenerator(fn) {
378
321
  return function () {
379
322
  var self = this,
380
- args = arguments;
323
+ args = arguments;
381
324
  return new Promise(function (resolve, reject) {
382
325
  var gen = fn.apply(self, args);
383
-
384
326
  function _next(value) {
385
327
  asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
386
328
  }
387
-
388
329
  function _throw(err) {
389
330
  asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
390
331
  }
391
-
392
332
  _next(undefined);
393
333
  });
394
334
  };
395
335
  }
396
-
397
336
  function _extends() {
398
337
  _extends = Object.assign ? Object.assign.bind() : function (target) {
399
338
  for (var i = 1; i < arguments.length; i++) {
400
339
  var source = arguments[i];
401
-
402
340
  for (var key in source) {
403
341
  if (Object.prototype.hasOwnProperty.call(source, key)) {
404
342
  target[key] = source[key];
405
343
  }
406
344
  }
407
345
  }
408
-
409
346
  return target;
410
347
  };
411
348
  return _extends.apply(this, arguments);
412
349
  }
413
-
414
350
  function _inheritsLoose(subClass, superClass) {
415
351
  subClass.prototype = Object.create(superClass.prototype);
416
352
  subClass.prototype.constructor = subClass;
417
-
418
353
  _setPrototypeOf(subClass, superClass);
419
354
  }
420
-
421
355
  function _getPrototypeOf(o) {
422
356
  _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
423
357
  return o.__proto__ || Object.getPrototypeOf(o);
424
358
  };
425
359
  return _getPrototypeOf(o);
426
360
  }
427
-
428
361
  function _setPrototypeOf(o, p) {
429
362
  _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
430
363
  o.__proto__ = p;
@@ -432,12 +365,10 @@ function _setPrototypeOf(o, p) {
432
365
  };
433
366
  return _setPrototypeOf(o, p);
434
367
  }
435
-
436
368
  function _isNativeReflectConstruct() {
437
369
  if (typeof Reflect === "undefined" || !Reflect.construct) return false;
438
370
  if (Reflect.construct.sham) return false;
439
371
  if (typeof Proxy === "function") return true;
440
-
441
372
  try {
442
373
  Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
443
374
  return true;
@@ -445,7 +376,6 @@ function _isNativeReflectConstruct() {
445
376
  return false;
446
377
  }
447
378
  }
448
-
449
379
  function _construct(Parent, args, Class) {
450
380
  if (_isNativeReflectConstruct()) {
451
381
  _construct = Reflect.construct.bind();
@@ -459,34 +389,25 @@ function _construct(Parent, args, Class) {
459
389
  return instance;
460
390
  };
461
391
  }
462
-
463
392
  return _construct.apply(null, arguments);
464
393
  }
465
-
466
394
  function _isNativeFunction(fn) {
467
395
  return Function.toString.call(fn).indexOf("[native code]") !== -1;
468
396
  }
469
-
470
397
  function _wrapNativeSuper(Class) {
471
398
  var _cache = typeof Map === "function" ? new Map() : undefined;
472
-
473
399
  _wrapNativeSuper = function _wrapNativeSuper(Class) {
474
400
  if (Class === null || !_isNativeFunction(Class)) return Class;
475
-
476
401
  if (typeof Class !== "function") {
477
402
  throw new TypeError("Super expression must either be null or a function");
478
403
  }
479
-
480
404
  if (typeof _cache !== "undefined") {
481
405
  if (_cache.has(Class)) return _cache.get(Class);
482
-
483
406
  _cache.set(Class, Wrapper);
484
407
  }
485
-
486
408
  function Wrapper() {
487
409
  return _construct(Class, arguments, _getPrototypeOf(this).constructor);
488
410
  }
489
-
490
411
  Wrapper.prototype = Object.create(Class.prototype, {
491
412
  constructor: {
492
413
  value: Wrapper,
@@ -497,15 +418,12 @@ function _wrapNativeSuper(Class) {
497
418
  });
498
419
  return _setPrototypeOf(Wrapper, Class);
499
420
  };
500
-
501
421
  return _wrapNativeSuper(Class);
502
422
  }
503
-
504
423
  function _assertThisInitialized(self) {
505
424
  if (self === void 0) {
506
425
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
507
426
  }
508
-
509
427
  return self;
510
428
  }
511
429
 
@@ -514,9 +432,7 @@ var AxiosService = /*#__PURE__*/function () {
514
432
  if (!config) config = {};
515
433
  this.axios = axios.create(config);
516
434
  }
517
-
518
435
  var _proto = AxiosService.prototype;
519
-
520
436
  _proto.apiRequest = /*#__PURE__*/function () {
521
437
  var _apiRequest = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(config, url, data) {
522
438
  return _regeneratorRuntime().wrap(function _callee$(_context) {
@@ -531,7 +447,6 @@ var AxiosService = /*#__PURE__*/function () {
531
447
  })).then(function (res) {
532
448
  return res.data;
533
449
  }));
534
-
535
450
  case 3:
536
451
  case "end":
537
452
  return _context.stop();
@@ -539,14 +454,11 @@ var AxiosService = /*#__PURE__*/function () {
539
454
  }
540
455
  }, _callee, this);
541
456
  }));
542
-
543
457
  function apiRequest(_x, _x2, _x3) {
544
458
  return _apiRequest.apply(this, arguments);
545
459
  }
546
-
547
460
  return apiRequest;
548
461
  }();
549
-
550
462
  _proto.apiRequestHeader = /*#__PURE__*/function () {
551
463
  var _apiRequestHeader = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(config, url, headerToRetrieve, data) {
552
464
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
@@ -561,13 +473,10 @@ var AxiosService = /*#__PURE__*/function () {
561
473
  })).then(function (res) {
562
474
  if (headerToRetrieve) {
563
475
  var _res$headers$headerTo;
564
-
565
476
  return (_res$headers$headerTo = res.headers[headerToRetrieve]) != null ? _res$headers$headerTo : res.headers[headerToRetrieve.toLowerCase()];
566
477
  }
567
-
568
478
  return res.headers;
569
479
  }));
570
-
571
480
  case 3:
572
481
  case "end":
573
482
  return _context2.stop();
@@ -575,56 +484,46 @@ var AxiosService = /*#__PURE__*/function () {
575
484
  }
576
485
  }, _callee2, this);
577
486
  }));
578
-
579
487
  function apiRequestHeader(_x4, _x5, _x6, _x7) {
580
488
  return _apiRequestHeader.apply(this, arguments);
581
489
  }
582
-
583
490
  return apiRequestHeader;
584
491
  }();
585
-
586
492
  _proto.get = function get(url, config) {
587
493
  return this.apiRequest(_extends({}, config, {
588
494
  method: 'get'
589
495
  }), url);
590
496
  };
591
-
592
497
  _proto.deleteRequest = function deleteRequest(url, config) {
593
498
  return this.apiRequest(_extends({}, config, {
594
499
  method: 'delete'
595
500
  }), url);
596
501
  };
597
-
598
502
  _proto.post = function post(url, data, config) {
599
503
  return this.apiRequest(_extends({}, config, {
600
504
  method: 'post'
601
505
  }), url, data);
602
506
  };
603
-
604
507
  _proto.put = function put(url, data, config) {
605
508
  return this.apiRequest(_extends({}, config, {
606
509
  method: 'put'
607
510
  }), url, data);
608
511
  };
609
-
610
512
  _proto.patch = function patch(url, data, config) {
611
513
  return this.apiRequest(_extends({}, config, {
612
514
  method: 'patch'
613
515
  }), url, data);
614
516
  };
615
-
616
517
  _proto.head = function head(url, config, headerToRetrieve, data) {
617
518
  return this.apiRequestHeader(_extends({}, config, {
618
519
  method: 'head'
619
520
  }), url, headerToRetrieve, data);
620
521
  };
621
-
622
522
  return AxiosService;
623
523
  }();
624
524
 
625
525
  var APIService = /*#__PURE__*/function (_AxiosService) {
626
526
  _inheritsLoose(APIService, _AxiosService);
627
-
628
527
  /**
629
528
  * The API Service lets you use an axios API and handles oro backend services authentification via JWT tokens
630
529
  * @param useLocalStorage if set to true, tokens will be stored in localStorage
@@ -633,14 +532,11 @@ var APIService = /*#__PURE__*/function (_AxiosService) {
633
532
  */
634
533
  function APIService(useLocalStorage, config, tokenRefreshFailureCallback) {
635
534
  var _this;
636
-
637
535
  _this = _AxiosService.call(this, config) || this;
638
536
  _this.useLocalStorage = useLocalStorage;
639
537
  _this.tokenRefreshFailureCallback = tokenRefreshFailureCallback;
640
538
  _this.tokens = {};
641
-
642
539
  var self = _assertThisInitialized(_this);
643
-
644
540
  _this.axios.interceptors.request.use(function (config) {
645
541
  var token = config.useRefreshToken ? self.getTokens().refreshToken : self.getTokens().accessToken;
646
542
  config.headers = _extends({}, config.headers, {
@@ -650,7 +546,6 @@ var APIService = /*#__PURE__*/function (_AxiosService) {
650
546
  }, function (error) {
651
547
  Promise.reject(error);
652
548
  });
653
-
654
549
  createAuthRefreshInterceptor(_this.axios, /*#__PURE__*/function () {
655
550
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(failedRequest) {
656
551
  var tokenResp;
@@ -662,11 +557,9 @@ var APIService = /*#__PURE__*/function (_AxiosService) {
662
557
  _context.next = 15;
663
558
  break;
664
559
  }
665
-
666
560
  _context.prev = 1;
667
561
  _context.next = 4;
668
562
  return self.authRefreshFn(self.getTokens().refreshToken);
669
-
670
563
  case 4:
671
564
  tokenResp = _context.sent;
672
565
  self.setTokens({
@@ -675,18 +568,15 @@ var APIService = /*#__PURE__*/function (_AxiosService) {
675
568
  });
676
569
  failedRequest.response.config.headers['Authorization'] = "Bearer " + self.getTokens().accessToken;
677
570
  return _context.abrupt("return", Promise.resolve());
678
-
679
571
  case 10:
680
572
  _context.prev = 10;
681
573
  _context.t0 = _context["catch"](1);
682
574
  console.error('an error occured while refreshing tokens (notifying callback)', _context.t0);
683
575
  if (self.tokenRefreshFailureCallback) self.tokenRefreshFailureCallback(failedRequest);
684
576
  return _context.abrupt("return", Promise.resolve());
685
-
686
577
  case 15:
687
578
  console.error('The request could not refresh the token (authRefreshFn was not set)', failedRequest);
688
579
  return _context.abrupt("return", Promise.resolve());
689
-
690
580
  case 17:
691
581
  case "end":
692
582
  return _context.stop();
@@ -694,7 +584,6 @@ var APIService = /*#__PURE__*/function (_AxiosService) {
694
584
  }
695
585
  }, _callee, null, [[1, 10]]);
696
586
  }));
697
-
698
587
  return function (_x) {
699
588
  return _ref.apply(this, arguments);
700
589
  };
@@ -703,43 +592,34 @@ var APIService = /*#__PURE__*/function (_AxiosService) {
703
592
  });
704
593
  return _this;
705
594
  }
706
-
707
595
  var _proto = APIService.prototype;
708
-
709
596
  _proto.setAuthRefreshFn = function setAuthRefreshFn(fn) {
710
597
  this.authRefreshFn = fn;
711
598
  };
712
-
713
599
  _proto.setTokens = function setTokens(tokens) {
714
600
  if (this.useLocalStorage) {
715
601
  localStorage.setItem('tokens', JSON.stringify(tokens));
716
602
  }
717
-
718
603
  this.tokens = tokens;
719
604
  };
720
-
721
605
  _proto.getTokens = function getTokens() {
722
606
  if (this.useLocalStorage) {
723
607
  var tokens = {};
724
608
  var item = localStorage.getItem('tokens');
725
-
726
609
  if (item) {
727
610
  tokens = JSON.parse(item);
728
611
  }
729
-
730
612
  return tokens;
731
613
  } else {
732
614
  return this.tokens;
733
615
  }
734
616
  };
735
-
736
617
  return APIService;
737
618
  }(AxiosService);
738
619
 
739
620
  /**
740
621
  * This service enables you to handle one authentication token per practice
741
622
  */
742
-
743
623
  var ApisPracticeManager = /*#__PURE__*/function () {
744
624
  /**
745
625
  * The constructor
@@ -752,7 +632,6 @@ var ApisPracticeManager = /*#__PURE__*/function () {
752
632
  if (useLocalStorage === void 0) {
753
633
  useLocalStorage = false;
754
634
  }
755
-
756
635
  this.serviceCollReq = serviceCollReq;
757
636
  this.getAuthTokenCbk = getAuthTokenCbk;
758
637
  this.useLocalStorage = useLocalStorage;
@@ -763,33 +642,25 @@ var ApisPracticeManager = /*#__PURE__*/function () {
763
642
  * @param practiceUuid the uuid of the practice
764
643
  * @returns a promise holding a `ServiceCollection`
765
644
  */
766
-
767
-
768
645
  var _proto = ApisPracticeManager.prototype;
769
-
770
646
  _proto.get =
771
647
  /*#__PURE__*/
772
648
  function () {
773
649
  var _get = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(practiceUuid) {
774
650
  var _this = this;
775
-
776
651
  var practiceInstance, newPracticeInstance, authTokenFunc;
777
652
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
778
653
  while (1) {
779
654
  switch (_context2.prev = _context2.next) {
780
655
  case 0:
781
656
  practiceInstance = this.practiceInstances.get(practiceUuid);
782
-
783
657
  if (!practiceInstance) {
784
658
  _context2.next = 3;
785
659
  break;
786
660
  }
787
-
788
661
  return _context2.abrupt("return", practiceInstance);
789
-
790
662
  case 3:
791
663
  newPracticeInstance = init(this.serviceCollReq, undefined, this.useLocalStorage); // Create one auth token callback per practice since the practice uuid needs to change
792
-
793
664
  authTokenFunc = /*#__PURE__*/function () {
794
665
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
795
666
  return _regeneratorRuntime().wrap(function _callee$(_context) {
@@ -800,17 +671,13 @@ var ApisPracticeManager = /*#__PURE__*/function () {
800
671
  _context.next = 7;
801
672
  break;
802
673
  }
803
-
804
674
  console.log("\x1B[36m[Auth] Refresh auth called (practiceUuid: " + practiceUuid + ")\x1B[36m");
805
675
  _context.next = 4;
806
676
  return _this.getAuthTokenCbk(newPracticeInstance.guardService, practiceUuid);
807
-
808
677
  case 4:
809
678
  return _context.abrupt("return", _context.sent);
810
-
811
679
  case 7:
812
680
  throw Error('[Auth] Unable to refresh token guard service is undefined');
813
-
814
681
  case 8:
815
682
  case "end":
816
683
  return _context.stop();
@@ -818,22 +685,17 @@ var ApisPracticeManager = /*#__PURE__*/function () {
818
685
  }
819
686
  }, _callee);
820
687
  }));
821
-
822
688
  return function authTokenFunc() {
823
689
  return _ref.apply(this, arguments);
824
690
  };
825
691
  }(); // Initialize the M2M token
826
-
827
-
828
692
  _context2.next = 7;
829
693
  return authTokenFunc();
830
-
831
694
  case 7:
832
695
  // Set the refresh tokens callback
833
696
  newPracticeInstance.apiService.setAuthRefreshFn(authTokenFunc);
834
697
  this.practiceInstances.set(practiceUuid, newPracticeInstance);
835
698
  return _context2.abrupt("return", newPracticeInstance);
836
-
837
699
  case 10:
838
700
  case "end":
839
701
  return _context2.stop();
@@ -841,19 +703,15 @@ var ApisPracticeManager = /*#__PURE__*/function () {
841
703
  }
842
704
  }, _callee2, this);
843
705
  }));
844
-
845
706
  function get(_x) {
846
707
  return _get.apply(this, arguments);
847
708
  }
848
-
849
709
  return get;
850
710
  }();
851
-
852
711
  return ApisPracticeManager;
853
712
  }();
854
713
 
855
714
  var AssistantType;
856
-
857
715
  (function (AssistantType) {
858
716
  AssistantType["MedicalSecretary"] = "MedicalSecretary";
859
717
  AssistantType["Nurse"] = "Nurse";
@@ -861,9 +719,7 @@ var AssistantType;
861
719
  AssistantType["Administrative"] = "Administrative";
862
720
  AssistantType["Other"] = "Other";
863
721
  })(AssistantType || (AssistantType = {}));
864
-
865
722
  var TransmissionKind;
866
-
867
723
  (function (TransmissionKind) {
868
724
  TransmissionKind["Fax"] = "Fax";
869
725
  TransmissionKind["Email"] = "Email";
@@ -873,9 +729,7 @@ var TransmissionKind;
873
729
  TransmissionKind["API"] = "API";
874
730
  TransmissionKind["Other"] = "Other";
875
731
  })(TransmissionKind || (TransmissionKind = {}));
876
-
877
732
  var TransmissionStatus;
878
-
879
733
  (function (TransmissionStatus) {
880
734
  TransmissionStatus["Preparing"] = "Preparing";
881
735
  TransmissionStatus["Sending"] = "Sending";
@@ -888,16 +742,12 @@ var TransmissionStatus;
888
742
  TransmissionStatus["ReceiverNotAnswering"] = "ReceiverNotAnswering";
889
743
  TransmissionStatus["ReceiverIncompatible"] = "ReceiverIncompatible";
890
744
  })(TransmissionStatus || (TransmissionStatus = {}));
891
-
892
745
  var ConsultType;
893
-
894
746
  (function (ConsultType) {
895
747
  ConsultType["Onboard"] = "Onboard";
896
748
  ConsultType["Refill"] = "Refill";
897
749
  })(ConsultType || (ConsultType = {}));
898
-
899
750
  var FeeStatus;
900
-
901
751
  (function (FeeStatus) {
902
752
  FeeStatus["NoFee"] = "NoFee";
903
753
  FeeStatus["Pending"] = "Pending";
@@ -906,9 +756,7 @@ var FeeStatus;
906
756
  FeeStatus["Cancelled"] = "Cancelled";
907
757
  FeeStatus["Contested"] = "Contested";
908
758
  })(FeeStatus || (FeeStatus = {}));
909
-
910
759
  var MedicalStatus;
911
-
912
760
  (function (MedicalStatus) {
913
761
  MedicalStatus["Creating"] = "Creating";
914
762
  MedicalStatus["New"] = "New";
@@ -919,9 +767,7 @@ var MedicalStatus;
919
767
  MedicalStatus["Archived"] = "Archived";
920
768
  MedicalStatus["Failed"] = "Failed";
921
769
  })(MedicalStatus || (MedicalStatus = {}));
922
-
923
770
  var TaskStatus;
924
-
925
771
  (function (TaskStatus) {
926
772
  TaskStatus["None"] = "None";
927
773
  TaskStatus["ToDo"] = "ToDo";
@@ -929,9 +775,7 @@ var TaskStatus;
929
775
  TaskStatus["Blocked"] = "Blocked";
930
776
  TaskStatus["Done"] = "Done";
931
777
  })(TaskStatus || (TaskStatus = {}));
932
-
933
778
  var ClosedReasonType;
934
-
935
779
  (function (ClosedReasonType) {
936
780
  /**
937
781
  * A completed consultation
@@ -940,35 +784,28 @@ var ClosedReasonType;
940
784
  /**
941
785
  * The conclusion was that what the patient submitted was not a disease
942
786
  */
943
-
944
787
  ClosedReasonType["NotADisease"] = "NotADisease";
945
788
  /**
946
789
  * The consultation was not appropriate for virtual
947
790
  */
948
-
949
791
  ClosedReasonType["NotAppropriateForVirtual"] = "NotAppropriateForVirtual";
950
792
  /**
951
793
  * Any other reason why the consultation was closed
952
794
  */
953
-
954
795
  ClosedReasonType["Other"] = "Other";
955
796
  /**
956
797
  * A consultation that is required to be done in person
957
798
  */
958
-
959
799
  ClosedReasonType["RequiresInPerson"] = "RequiresInPerson";
960
800
  })(ClosedReasonType || (ClosedReasonType = {}));
961
801
 
962
802
  var VisibilityType;
963
-
964
803
  (function (VisibilityType) {
965
804
  VisibilityType["Generic"] = "Generic";
966
805
  VisibilityType["Private"] = "Private";
967
806
  VisibilityType["Instance"] = "Instance";
968
807
  })(VisibilityType || (VisibilityType = {}));
969
-
970
808
  var DrugType;
971
-
972
809
  (function (DrugType) {
973
810
  DrugType["Generic"] = "Generic";
974
811
  DrugType["Instance"] = "Instance";
@@ -977,17 +814,12 @@ var DrugType;
977
814
  * Status of the prescription
978
815
  * Right now, it only serves a soft delete flag
979
816
  */
980
-
981
-
982
817
  var PrescriptionStatus;
983
-
984
818
  (function (PrescriptionStatus) {
985
819
  PrescriptionStatus["Existing"] = "Existing";
986
820
  PrescriptionStatus["Deleted"] = "Deleted";
987
821
  })(PrescriptionStatus || (PrescriptionStatus = {}));
988
-
989
822
  var PlanStatus;
990
-
991
823
  (function (PlanStatus) {
992
824
  PlanStatus["Pending"] = "Pending";
993
825
  PlanStatus["Accepted"] = "Accepted";
@@ -996,88 +828,69 @@ var PlanStatus;
996
828
 
997
829
  var AuthenticationFailed = /*#__PURE__*/function (_Error) {
998
830
  _inheritsLoose(AuthenticationFailed, _Error);
999
-
1000
831
  function AuthenticationFailed() {
1001
832
  return _Error.apply(this, arguments) || this;
1002
833
  }
1003
-
1004
834
  return AuthenticationFailed;
1005
835
  }( /*#__PURE__*/_wrapNativeSuper(Error));
1006
836
  var AuthenticationBadRequest = /*#__PURE__*/function (_Error2) {
1007
837
  _inheritsLoose(AuthenticationBadRequest, _Error2);
1008
-
1009
838
  function AuthenticationBadRequest() {
1010
839
  return _Error2.apply(this, arguments) || this;
1011
840
  }
1012
-
1013
841
  return AuthenticationBadRequest;
1014
842
  }( /*#__PURE__*/_wrapNativeSuper(Error));
1015
843
  var AuthenticationServerError = /*#__PURE__*/function (_Error3) {
1016
844
  _inheritsLoose(AuthenticationServerError, _Error3);
1017
-
1018
845
  function AuthenticationServerError() {
1019
846
  return _Error3.apply(this, arguments) || this;
1020
847
  }
1021
-
1022
848
  return AuthenticationServerError;
1023
849
  }( /*#__PURE__*/_wrapNativeSuper(Error));
1024
850
  var AuthenticationUnconfirmedEmail = /*#__PURE__*/function (_Error4) {
1025
851
  _inheritsLoose(AuthenticationUnconfirmedEmail, _Error4);
1026
-
1027
852
  function AuthenticationUnconfirmedEmail() {
1028
853
  return _Error4.apply(this, arguments) || this;
1029
854
  }
1030
-
1031
855
  return AuthenticationUnconfirmedEmail;
1032
856
  }( /*#__PURE__*/_wrapNativeSuper(Error));
1033
857
  var IdentityCreationFailed = /*#__PURE__*/function (_Error5) {
1034
858
  _inheritsLoose(IdentityCreationFailed, _Error5);
1035
-
1036
859
  function IdentityCreationFailed() {
1037
860
  return _Error5.apply(this, arguments) || this;
1038
861
  }
1039
-
1040
862
  return IdentityCreationFailed;
1041
863
  }( /*#__PURE__*/_wrapNativeSuper(Error));
1042
864
  var IdentityCreationBadRequest = /*#__PURE__*/function (_Error6) {
1043
865
  _inheritsLoose(IdentityCreationBadRequest, _Error6);
1044
-
1045
866
  function IdentityCreationBadRequest() {
1046
867
  return _Error6.apply(this, arguments) || this;
1047
868
  }
1048
-
1049
869
  return IdentityCreationBadRequest;
1050
870
  }( /*#__PURE__*/_wrapNativeSuper(Error));
1051
871
  var IdentityCreationConflict = /*#__PURE__*/function (_Error7) {
1052
872
  _inheritsLoose(IdentityCreationConflict, _Error7);
1053
-
1054
873
  function IdentityCreationConflict() {
1055
874
  return _Error7.apply(this, arguments) || this;
1056
875
  }
1057
-
1058
876
  return IdentityCreationConflict;
1059
877
  }( /*#__PURE__*/_wrapNativeSuper(Error));
1060
878
  var VaultDataMissing = /*#__PURE__*/function (_Error8) {
1061
879
  _inheritsLoose(VaultDataMissing, _Error8);
1062
-
1063
880
  function VaultDataMissing() {
1064
881
  return _Error8.apply(this, arguments) || this;
1065
882
  }
1066
-
1067
883
  return VaultDataMissing;
1068
884
  }( /*#__PURE__*/_wrapNativeSuper(Error));
1069
885
 
1070
886
  var WorkflowType;
1071
-
1072
887
  (function (WorkflowType) {
1073
888
  WorkflowType["Onboard"] = "Onboard";
1074
889
  WorkflowType["Followup"] = "Followup";
1075
890
  WorkflowType["Renew"] = "Renew";
1076
891
  WorkflowType["DataRetrieve"] = "DataRetrieve";
1077
892
  })(WorkflowType || (WorkflowType = {}));
1078
-
1079
893
  var RateDimension;
1080
-
1081
894
  (function (RateDimension) {
1082
895
  RateDimension["RatioOnTotal"] = "RatioOnTotal";
1083
896
  RateDimension["FixedOnTotal"] = "FixedOnTotal";
@@ -1088,27 +901,21 @@ var RateDimension;
1088
901
  RateDimension["RatioOnItem"] = "RatioOnItem";
1089
902
  RateDimension["FixedOnItem"] = "FixedOnItem";
1090
903
  })(RateDimension || (RateDimension = {}));
1091
-
1092
904
  var PlanType;
1093
-
1094
905
  (function (PlanType) {
1095
906
  PlanType["Onboard"] = "Onboard";
1096
907
  PlanType["Followup"] = "Followup";
1097
908
  PlanType["Renew"] = "Renew";
1098
909
  PlanType["DataRetrieve"] = "DataRetrieve";
1099
910
  })(PlanType || (PlanType = {}));
1100
-
1101
911
  var PaymentStatus;
1102
-
1103
912
  (function (PaymentStatus) {
1104
913
  PaymentStatus["Pending"] = "Pending";
1105
914
  PaymentStatus["Success"] = "Success";
1106
915
  PaymentStatus["Failure"] = "Failure";
1107
916
  PaymentStatus["Canceled"] = "Canceled";
1108
917
  })(PaymentStatus || (PaymentStatus = {}));
1109
-
1110
918
  var PractitionerStatus;
1111
-
1112
919
  (function (PractitionerStatus) {
1113
920
  PractitionerStatus["Practicing"] = "Practicing";
1114
921
  PractitionerStatus["Retired"] = "Retired";
@@ -1118,17 +925,13 @@ var PractitionerStatus;
1118
925
  PractitionerStatus["InConflict"] = "InConflict";
1119
926
  PractitionerStatus["Delicensed"] = "Delicensed";
1120
927
  })(PractitionerStatus || (PractitionerStatus = {}));
1121
-
1122
928
  var AssignmentStatus;
1123
-
1124
929
  (function (AssignmentStatus) {
1125
930
  AssignmentStatus["Assigned"] = "Assigned";
1126
931
  AssignmentStatus["Reassigned"] = "Reassigned";
1127
932
  AssignmentStatus["Cancelled"] = "Cancelled";
1128
933
  })(AssignmentStatus || (AssignmentStatus = {}));
1129
-
1130
934
  var PractitionnerRoleType;
1131
-
1132
935
  (function (PractitionnerRoleType) {
1133
936
  PractitionnerRoleType["Doctor"] = "Doctor";
1134
937
  PractitionnerRoleType["MedicalAssistant"] = "MedicalAssistant";
@@ -1140,17 +943,13 @@ var PractitionnerRoleType;
1140
943
  PractitionnerRoleType["ManualDispatcher"] = "ManualDispatcher";
1141
944
  PractitionnerRoleType["Other"] = "Other";
1142
945
  })(PractitionnerRoleType || (PractitionnerRoleType = {}));
1143
-
1144
946
  var OtherRoleType;
1145
-
1146
947
  (function (OtherRoleType) {
1147
948
  OtherRoleType["Patient"] = "Patient";
1148
949
  OtherRoleType["User"] = "User";
1149
950
  OtherRoleType["System"] = "System";
1150
951
  })(OtherRoleType || (OtherRoleType = {}));
1151
-
1152
952
  var LicenseStatus;
1153
-
1154
953
  (function (LicenseStatus) {
1155
954
  LicenseStatus["Valid"] = "Valid";
1156
955
  LicenseStatus["Invalid"] = "Invalid";
@@ -1158,9 +957,7 @@ var LicenseStatus;
1158
957
  LicenseStatus["NA"] = "NA";
1159
958
  LicenseStatus["Removed"] = "Removed";
1160
959
  })(LicenseStatus || (LicenseStatus = {}));
1161
-
1162
960
  var PeriodType;
1163
-
1164
961
  (function (PeriodType) {
1165
962
  PeriodType["PerYear"] = "PerYear";
1166
963
  PeriodType["PerQuarter"] = "PerQuarter";
@@ -1170,9 +967,7 @@ var PeriodType;
1170
967
  PeriodType["PerDay"] = "PerDay";
1171
968
  PeriodType["PerHour"] = "PerHour";
1172
969
  })(PeriodType || (PeriodType = {}));
1173
-
1174
970
  var SyncStatus;
1175
-
1176
971
  (function (SyncStatus) {
1177
972
  SyncStatus["Requested"] = "Requested";
1178
973
  SyncStatus["Started"] = "Started";
@@ -1180,9 +975,7 @@ var SyncStatus;
1180
975
  SyncStatus["Failed"] = "Failed";
1181
976
  SyncStatus["Cancelled"] = "Cancelled";
1182
977
  })(SyncStatus || (SyncStatus = {}));
1183
-
1184
978
  var PracticeEmailKind;
1185
-
1186
979
  (function (PracticeEmailKind) {
1187
980
  PracticeEmailKind["SignedUp"] = "SignedUp";
1188
981
  PracticeEmailKind["Onboarded"] = "Onboarded";
@@ -1212,10 +1005,7 @@ var PracticeEmailKind;
1212
1005
  * To be extra explicit, if you want to show a functionnality only in one practice, you will have to add a practice configs in all other practice to hide it (yes it is cumbersome).
1213
1006
  *
1214
1007
  */
1215
-
1216
-
1217
1008
  var PracticeConfigKind;
1218
-
1219
1009
  (function (PracticeConfigKind) {
1220
1010
  PracticeConfigKind["PatientConsultCard"] = "PatientConsultCard";
1221
1011
  PracticeConfigKind["PracticeCloseConsultationTypes"] = "PracticeCloseConsultationTypes";
@@ -1236,9 +1026,7 @@ var PracticeConfigKind;
1236
1026
  PracticeConfigKind["PracticeAddressField"] = "PracticeAddressField";
1237
1027
  PracticeConfigKind["PracticeDiagnosisAndTreatment"] = "PracticeDiagnosisAndTreatment";
1238
1028
  })(PracticeConfigKind || (PracticeConfigKind = {}));
1239
-
1240
1029
  var StripePriceType;
1241
-
1242
1030
  (function (StripePriceType) {
1243
1031
  StripePriceType["Default"] = "Default";
1244
1032
  StripePriceType["Discount"] = "Discount";
@@ -1246,25 +1034,19 @@ var StripePriceType;
1246
1034
  /**
1247
1035
  * All the PaymentIntentRequestMetadata Kind available
1248
1036
  */
1249
-
1250
-
1251
1037
  var PaymentIntentRequestMetadataKind;
1252
-
1253
1038
  (function (PaymentIntentRequestMetadataKind) {
1254
1039
  PaymentIntentRequestMetadataKind["ConsultRequestMetadata"] = "ConsultRequestMetadata";
1255
1040
  PaymentIntentRequestMetadataKind["RefillTreatmentRequestMetadata"] = "RefillTreatmentRequestMetadata";
1256
1041
  })(PaymentIntentRequestMetadataKind || (PaymentIntentRequestMetadataKind = {}));
1257
1042
 
1258
1043
  var IndexKey;
1259
-
1260
1044
  (function (IndexKey) {
1261
1045
  IndexKey["Consultation"] = "Consultation";
1262
1046
  IndexKey["IndexSnapshot"] = "IndexSnapshot";
1263
1047
  IndexKey["ConsultationLockbox"] = "ConsultationLockbox";
1264
1048
  })(IndexKey || (IndexKey = {}));
1265
-
1266
1049
  var DocumentType;
1267
-
1268
1050
  (function (DocumentType) {
1269
1051
  DocumentType["Message"] = "Message";
1270
1052
  DocumentType["Note"] = "Note";
@@ -1283,7 +1065,6 @@ var DocumentType;
1283
1065
  })(DocumentType || (DocumentType = {}));
1284
1066
 
1285
1067
  var MetadataCategory;
1286
-
1287
1068
  (function (MetadataCategory) {
1288
1069
  MetadataCategory["ChildPersonal"] = "ChildPersonal";
1289
1070
  MetadataCategory["Consultation"] = "Consultation";
@@ -1300,7 +1081,6 @@ var MetadataCategory;
1300
1081
  })(MetadataCategory || (MetadataCategory = {}));
1301
1082
 
1302
1083
  var IndexKind;
1303
-
1304
1084
  (function (IndexKind) {
1305
1085
  IndexKind[IndexKind["consultUuid"] = 0] = "consultUuid";
1306
1086
  IndexKind[IndexKind["consultShortid"] = 1] = "consultShortid";
@@ -1315,9 +1095,7 @@ var ConsultService = /*#__PURE__*/function () {
1315
1095
  this.api = api;
1316
1096
  this.baseURL = baseURL;
1317
1097
  }
1318
-
1319
1098
  var _proto = ConsultService.prototype;
1320
-
1321
1099
  _proto.consultCreate = function consultCreate(c) {
1322
1100
  return this.api.post(this.baseURL + "/v1/consults", c);
1323
1101
  }
@@ -1337,9 +1115,7 @@ var ConsultService = /*#__PURE__*/function () {
1337
1115
  * @param filterIsoLocality the of isoLocality to filter with
1338
1116
  * @param filterAssignee array of practitioner uuids with which you want to filter the consultations
1339
1117
  * @returns a number of consult
1340
- */
1341
- ;
1342
-
1118
+ */;
1343
1119
  _proto.countConsults = function countConsults(uuidPractice, uuidRequester, statusesMedical, statusesExclude, shortId, columnToSortTo, orderToSortTo, perPage, indexPage, filterAssignedDoctor, filterCurrentPractitioner, filterIsoLocality, filterAssignee) {
1344
1120
  return this.api.head(this.baseURL + "/v1/consults", {
1345
1121
  params: {
@@ -1361,11 +1137,9 @@ var ConsultService = /*#__PURE__*/function () {
1361
1137
  if (!resContentRange || typeof resContentRange !== 'string' && typeof resContentRange !== 'number') {
1362
1138
  return 0;
1363
1139
  }
1364
-
1365
1140
  if (typeof resContentRange === 'number') {
1366
1141
  return resContentRange;
1367
1142
  }
1368
-
1369
1143
  return parseInt(resContentRange);
1370
1144
  });
1371
1145
  }
@@ -1384,9 +1158,7 @@ var ConsultService = /*#__PURE__*/function () {
1384
1158
  * @param filterCurrentPractitioner the uuid of the current assistant assigned to filter with
1385
1159
  * @param filterIsoLocality the of isoLocality to filter with
1386
1160
  * @returns a list of consult
1387
- */
1388
- ;
1389
-
1161
+ */;
1390
1162
  _proto.getConsults = function getConsults(uuidPractice, uuidRequester, statusesMedical, statusesExclude, shortId, columnToSortTo, orderToSortTo, perPage, indexPage, filterAssignedDoctor, filterCurrentPractitioner, filterIsoLocality, filterAssignee) {
1391
1163
  return this.api.get(this.baseURL + "/v1/consults", {
1392
1164
  params: {
@@ -1406,7 +1178,6 @@ var ConsultService = /*#__PURE__*/function () {
1406
1178
  }
1407
1179
  });
1408
1180
  };
1409
-
1410
1181
  _proto.getConsultByUUID = function getConsultByUUID(uuidConsult, uuidPractice) {
1411
1182
  return this.api.get(this.baseURL + "/v1/consults/" + uuidConsult, {
1412
1183
  params: {
@@ -1414,7 +1185,6 @@ var ConsultService = /*#__PURE__*/function () {
1414
1185
  }
1415
1186
  });
1416
1187
  };
1417
-
1418
1188
  _proto.updateConsultByUUID = function updateConsultByUUID(uuidConsult, consult, uuidPractice, uuidRequester) {
1419
1189
  return this.api.put(this.baseURL + "/v1/consults/" + uuidConsult, consult, {
1420
1190
  params: {
@@ -1423,7 +1193,6 @@ var ConsultService = /*#__PURE__*/function () {
1423
1193
  }
1424
1194
  });
1425
1195
  };
1426
-
1427
1196
  _proto.getConsultFaxStatuses = function getConsultFaxStatuses(uuidConsult) {
1428
1197
  return this.api.get(this.baseURL + "/v1/consults/" + uuidConsult + "/transmissions", {
1429
1198
  params: {
@@ -1431,64 +1200,52 @@ var ConsultService = /*#__PURE__*/function () {
1431
1200
  }
1432
1201
  });
1433
1202
  };
1434
-
1435
- _proto.postConsultTransmission = function postConsultTransmission(uuidConsult, nameDriver, addressOrPhoneToSendTo, file, nameReceiver, txtTransmissionTitle, txtTransmissionNotes // numTry ?: number,
1203
+ _proto.postConsultTransmission = function postConsultTransmission(uuidConsult, nameDriver, addressOrPhoneToSendTo, file, nameReceiver, txtTransmissionTitle, txtTransmissionNotes
1204
+ // numTry ?: number,
1436
1205
  // delay ?: number,
1437
1206
  ) {
1438
1207
  if (nameDriver === void 0) {
1439
1208
  nameDriver = 'Documo';
1440
1209
  }
1441
-
1442
1210
  var data = new FormData();
1443
1211
  data.append('nameDriverReceiver', nameDriver);
1444
-
1445
1212
  if (addressOrPhoneToSendTo) {
1446
1213
  data.append('addressReceiver', addressOrPhoneToSendTo);
1447
1214
  }
1448
-
1449
1215
  if (file) {
1450
1216
  data.append('file', file);
1451
1217
  }
1452
-
1453
1218
  if (nameReceiver) {
1454
1219
  data.append('nameReceiver', nameReceiver);
1455
1220
  }
1456
-
1457
1221
  if (txtTransmissionTitle) {
1458
1222
  data.append('txtTransmissionTitle', txtTransmissionTitle);
1459
1223
  }
1460
-
1461
1224
  if (txtTransmissionNotes) {
1462
1225
  data.append('txtTransmissionNotes', txtTransmissionNotes);
1463
1226
  }
1464
-
1465
1227
  return this.api.post(this.baseURL + "/v1/consults/" + uuidConsult + "/transmissions", data, {
1466
1228
  headers: {
1467
1229
  'Content-Type': 'multipart/form-data;'
1468
1230
  }
1469
1231
  });
1470
1232
  };
1471
-
1472
1233
  _proto.postConsultFax = function postConsultFax(uuidConsult, addressReceiver, file) {
1473
1234
  return this.postConsultTransmission(uuidConsult, 'Documo', addressReceiver, file);
1474
1235
  };
1475
-
1476
1236
  _proto.postConsultEmail = function postConsultEmail(uuidConsult, file) {
1477
1237
  return this.postConsultTransmission(uuidConsult, 'Pharmacierge', undefined, file);
1478
1238
  };
1479
-
1480
1239
  _proto.retryConsultFax = function retryConsultFax(uuidConsult, transmissionId) {
1481
1240
  return this.api.put(this.baseURL + "/v1/consults/" + uuidConsult + "/transmissions/" + transmissionId, {
1482
1241
  status: TransmissionStatus.Retrying
1483
1242
  });
1484
1243
  };
1485
-
1486
1244
  _proto.updateConsultTransmissionStatus = function updateConsultTransmissionStatus(transmissionId, uuidConsult, newStatus) {
1487
1245
  return this.api.put(this.baseURL + "/v1/consults/" + uuidConsult + "/transmissions/" + transmissionId, {
1488
1246
  status: newStatus
1489
1247
  });
1490
1248
  };
1491
-
1492
1249
  return ConsultService;
1493
1250
  }();
1494
1251
 
@@ -1497,9 +1254,7 @@ var DiagnosisService = /*#__PURE__*/function () {
1497
1254
  this.api = api;
1498
1255
  this.baseURL = baseURL;
1499
1256
  }
1500
-
1501
1257
  var _proto = DiagnosisService.prototype;
1502
-
1503
1258
  _proto.getDiagnoses = function getDiagnoses() {
1504
1259
  return this.api.get(this.baseURL + "/v1/diagnoses");
1505
1260
  }
@@ -1507,21 +1262,16 @@ var DiagnosisService = /*#__PURE__*/function () {
1507
1262
  * Get a diagnosis by uuid that belongs to your practice
1508
1263
  * @param uuidDiagnosis the uuid of the diagnosis
1509
1264
  * @returns a diagnosis
1510
- */
1511
- ;
1512
-
1265
+ */;
1513
1266
  _proto.getDiagnosisByUuid = function getDiagnosisByUuid(uuidDiagnosis) {
1514
1267
  return this.api.get(this.baseURL + "/v1/diagnoses/" + uuidDiagnosis);
1515
1268
  };
1516
-
1517
1269
  _proto.createDiagnosis = function createDiagnosis(diagnosis) {
1518
1270
  return this.api.post(this.baseURL + "/v1/diagnoses", diagnosis);
1519
1271
  };
1520
-
1521
1272
  _proto.updateDiagnosis = function updateDiagnosis(uuid, diagnosis) {
1522
1273
  return this.api.put(this.baseURL + "/v1/diagnoses/" + uuid, diagnosis);
1523
1274
  };
1524
-
1525
1275
  _proto.getTreatmentsFromDiagnosisUuid = function getTreatmentsFromDiagnosisUuid(diagnosisUuid) {
1526
1276
  return this.api.get(this.baseURL + "/v1/diagnoses/" + diagnosisUuid + "/treatments");
1527
1277
  }
@@ -1529,9 +1279,7 @@ var DiagnosisService = /*#__PURE__*/function () {
1529
1279
  * This function returns treatment plans associated to a consult
1530
1280
  * @param uuidConsult the consult uuid to fetch
1531
1281
  * @returns an array of TreatmentPlan
1532
- */
1533
- ;
1534
-
1282
+ */;
1535
1283
  _proto.getTreatmentPlansFromConsultUuid = function getTreatmentPlansFromConsultUuid(uuidConsult) {
1536
1284
  return this.api.get(this.baseURL + "/v1/treatment-plans/", {
1537
1285
  params: {
@@ -1543,9 +1291,7 @@ var DiagnosisService = /*#__PURE__*/function () {
1543
1291
  * creates a new treatment for the specified diagnosis
1544
1292
  * @param diagnosisUuid uuid of the diagnosis that the treatment is linked to
1545
1293
  * @param treatmentRequest the treatment to be inserted
1546
- */
1547
- ;
1548
-
1294
+ */;
1549
1295
  _proto.createTreatment = function createTreatment(diagnosisUuid, treatmentRequest) {
1550
1296
  return this.api.post(this.baseURL + "/v1/diagnoses/" + diagnosisUuid + "/treatments", treatmentRequest);
1551
1297
  }
@@ -1553,9 +1299,7 @@ var DiagnosisService = /*#__PURE__*/function () {
1553
1299
  * This function returns populated treatment plans associated to a consult
1554
1300
  * @param uuidConsult the consult uuid to fetch
1555
1301
  * @returns a TreatmentPlans object
1556
- */
1557
- ;
1558
-
1302
+ */;
1559
1303
  _proto.getTreatmentPlansPopulatedFromConsultUuid = function getTreatmentPlansPopulatedFromConsultUuid(uuidConsult) {
1560
1304
  return this.api.get(this.baseURL + "/v1/treatment-plans/", {
1561
1305
  params: {
@@ -1564,11 +1308,9 @@ var DiagnosisService = /*#__PURE__*/function () {
1564
1308
  }
1565
1309
  });
1566
1310
  };
1567
-
1568
1311
  _proto.postPlans = function postPlans(plans) {
1569
1312
  return this.api.post(this.baseURL + "/v1/treatment-plans", plans);
1570
1313
  };
1571
-
1572
1314
  _proto.updateTreatmentPlan = function updateTreatmentPlan(uuidPlan, uuidConsult, diagnosisRequest, plan, refill) {
1573
1315
  return this.api.put(this.baseURL + "/v1/treatment-plans/" + uuidPlan, {
1574
1316
  uuidConsult: uuidConsult,
@@ -1577,7 +1319,6 @@ var DiagnosisService = /*#__PURE__*/function () {
1577
1319
  refill: refill
1578
1320
  });
1579
1321
  };
1580
-
1581
1322
  _proto.acceptTreatmentPlan = function acceptTreatmentPlan(uuidPlan, uuidConsult) {
1582
1323
  return this.api.put(this.baseURL + "/v1/treatment-plans/" + uuidPlan + "/accept", {
1583
1324
  uuidConsult: uuidConsult
@@ -1586,9 +1327,7 @@ var DiagnosisService = /*#__PURE__*/function () {
1586
1327
  /**
1587
1328
  * retrieves all the drugs of the specified practice
1588
1329
  * @param uuidPractice
1589
- */
1590
- ;
1591
-
1330
+ */;
1592
1331
  _proto.getAllDrugs =
1593
1332
  /*#__PURE__*/
1594
1333
  function () {
@@ -1600,20 +1339,15 @@ var DiagnosisService = /*#__PURE__*/function () {
1600
1339
  case 0:
1601
1340
  _context.next = 2;
1602
1341
  return this.api.get(this.baseURL + "/v1/drugs/practice/" + uuidPractice);
1603
-
1604
1342
  case 2:
1605
1343
  res = _context.sent;
1606
-
1607
1344
  if (!(res && res.foundDrugs)) {
1608
1345
  _context.next = 5;
1609
1346
  break;
1610
1347
  }
1611
-
1612
1348
  return _context.abrupt("return", res.foundDrugs);
1613
-
1614
1349
  case 5:
1615
1350
  return _context.abrupt("return", undefined);
1616
-
1617
1351
  case 6:
1618
1352
  case "end":
1619
1353
  return _context.stop();
@@ -1621,14 +1355,11 @@ var DiagnosisService = /*#__PURE__*/function () {
1621
1355
  }
1622
1356
  }, _callee, this);
1623
1357
  }));
1624
-
1625
1358
  function getAllDrugs(_x) {
1626
1359
  return _getAllDrugs.apply(this, arguments);
1627
1360
  }
1628
-
1629
1361
  return getAllDrugs;
1630
1362
  }();
1631
-
1632
1363
  return DiagnosisService;
1633
1364
  }();
1634
1365
 
@@ -1637,7 +1368,6 @@ var GuardService = /*#__PURE__*/function () {
1637
1368
  this.api = api;
1638
1369
  this.baseURL = baseURL;
1639
1370
  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
1640
-
1641
1371
  this.identityCache = {};
1642
1372
  this.whoAmICache = {};
1643
1373
  }
@@ -1652,10 +1382,7 @@ var GuardService = /*#__PURE__*/function () {
1652
1382
  * ```
1653
1383
  * @param tokens
1654
1384
  */
1655
-
1656
-
1657
1385
  var _proto = GuardService.prototype;
1658
-
1659
1386
  _proto.setTokens = function setTokens(tokens) {
1660
1387
  this.api.setTokens(_extends({}, this.api.getTokens(), tokens));
1661
1388
  }
@@ -1664,15 +1391,12 @@ var GuardService = /*#__PURE__*/function () {
1664
1391
  *
1665
1392
  * @param req The credentials required to get an access token
1666
1393
  * @returns AuthTokenResponse
1667
- */
1668
- ;
1669
-
1394
+ */;
1670
1395
  _proto.m2mToken =
1671
1396
  /*#__PURE__*/
1672
1397
  function () {
1673
1398
  var _m2mToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(req) {
1674
1399
  var resp, config, _e$response, code;
1675
-
1676
1400
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1677
1401
  while (1) {
1678
1402
  switch (_context.prev = _context.next) {
@@ -1683,7 +1407,6 @@ var GuardService = /*#__PURE__*/function () {
1683
1407
  };
1684
1408
  _context.next = 4;
1685
1409
  return this.api.post(this.baseURL + "/v1/m2m/token", req, config);
1686
-
1687
1410
  case 4:
1688
1411
  resp = _context.sent;
1689
1412
  this.api.setTokens({
@@ -1691,37 +1414,28 @@ var GuardService = /*#__PURE__*/function () {
1691
1414
  });
1692
1415
  _context.next = 20;
1693
1416
  break;
1694
-
1695
1417
  case 8:
1696
1418
  _context.prev = 8;
1697
1419
  _context.t0 = _context["catch"](0);
1698
1420
  console.error('Error while posting m2m token:', _context.t0);
1699
-
1700
1421
  if (!_context.t0.isAxiosError) {
1701
1422
  _context.next = 19;
1702
1423
  break;
1703
1424
  }
1704
-
1705
1425
  code = (_e$response = _context.t0.response) == null ? void 0 : _e$response.status;
1706
1426
  _context.t1 = code;
1707
1427
  _context.next = _context.t1 === 400 ? 16 : _context.t1 === 500 ? 17 : _context.t1 === 401 ? 18 : 18;
1708
1428
  break;
1709
-
1710
1429
  case 16:
1711
1430
  throw new AuthenticationBadRequest();
1712
-
1713
1431
  case 17:
1714
1432
  throw new AuthenticationServerError();
1715
-
1716
1433
  case 18:
1717
1434
  throw new AuthenticationFailed();
1718
-
1719
1435
  case 19:
1720
1436
  throw new AuthenticationFailed();
1721
-
1722
1437
  case 20:
1723
1438
  return _context.abrupt("return", resp);
1724
-
1725
1439
  case 21:
1726
1440
  case "end":
1727
1441
  return _context.stop();
@@ -1729,28 +1443,22 @@ var GuardService = /*#__PURE__*/function () {
1729
1443
  }
1730
1444
  }, _callee, this, [[0, 8]]);
1731
1445
  }));
1732
-
1733
1446
  function m2mToken(_x) {
1734
1447
  return _m2mToken.apply(this, arguments);
1735
1448
  }
1736
-
1737
1449
  return m2mToken;
1738
- }()
1739
- /**
1740
- * Allow to retrieve an access token and a refresh token in order
1741
- * to do authenticated request afterward
1742
- *
1743
- * @param req The credentials required to get an access token
1744
- * @returns AuthTokenResponse
1745
- */
1746
- ;
1747
-
1450
+ }() /**
1451
+ * Allow to retrieve an access token and a refresh token in order
1452
+ * to do authenticated request afterward
1453
+ *
1454
+ * @param req The credentials required to get an access token
1455
+ * @returns AuthTokenResponse
1456
+ */;
1748
1457
  _proto.authToken =
1749
1458
  /*#__PURE__*/
1750
1459
  function () {
1751
1460
  var _authToken = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(req) {
1752
1461
  var resp, config, _e$response2, code;
1753
-
1754
1462
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1755
1463
  while (1) {
1756
1464
  switch (_context2.prev = _context2.next) {
@@ -1761,7 +1469,6 @@ var GuardService = /*#__PURE__*/function () {
1761
1469
  };
1762
1470
  _context2.next = 4;
1763
1471
  return this.api.post(this.baseURL + "/v1/auth/token", req, config);
1764
-
1765
1472
  case 4:
1766
1473
  resp = _context2.sent;
1767
1474
  this.api.setTokens({
@@ -1770,40 +1477,30 @@ var GuardService = /*#__PURE__*/function () {
1770
1477
  });
1771
1478
  _context2.next = 21;
1772
1479
  break;
1773
-
1774
1480
  case 8:
1775
1481
  _context2.prev = 8;
1776
1482
  _context2.t0 = _context2["catch"](0);
1777
1483
  console.error('Error while posting auth token:', _context2.t0);
1778
-
1779
1484
  if (!_context2.t0.isAxiosError) {
1780
1485
  _context2.next = 20;
1781
1486
  break;
1782
1487
  }
1783
-
1784
1488
  code = (_e$response2 = _context2.t0.response) == null ? void 0 : _e$response2.status;
1785
1489
  _context2.t1 = code;
1786
1490
  _context2.next = _context2.t1 === 400 ? 16 : _context2.t1 === 424 ? 17 : _context2.t1 === 500 ? 18 : _context2.t1 === 401 ? 19 : 19;
1787
1491
  break;
1788
-
1789
1492
  case 16:
1790
1493
  throw new AuthenticationBadRequest();
1791
-
1792
1494
  case 17:
1793
1495
  throw new AuthenticationUnconfirmedEmail();
1794
-
1795
1496
  case 18:
1796
1497
  throw new AuthenticationServerError();
1797
-
1798
1498
  case 19:
1799
1499
  throw new AuthenticationFailed();
1800
-
1801
1500
  case 20:
1802
1501
  throw new AuthenticationFailed();
1803
-
1804
1502
  case 21:
1805
1503
  return _context2.abrupt("return", resp);
1806
-
1807
1504
  case 22:
1808
1505
  case "end":
1809
1506
  return _context2.stop();
@@ -1811,20 +1508,15 @@ var GuardService = /*#__PURE__*/function () {
1811
1508
  }
1812
1509
  }, _callee2, this, [[0, 8]]);
1813
1510
  }));
1814
-
1815
1511
  function authToken(_x2) {
1816
1512
  return _authToken.apply(this, arguments);
1817
1513
  }
1818
-
1819
1514
  return authToken;
1820
- }()
1821
- /**
1822
- * Get new access and refresh token
1823
- *
1824
- * @returns AuthTokenResponse
1825
- */
1826
- ;
1827
-
1515
+ }() /**
1516
+ * Get new access and refresh token
1517
+ *
1518
+ * @returns AuthTokenResponse
1519
+ */;
1828
1520
  _proto.authRefresh =
1829
1521
  /*#__PURE__*/
1830
1522
  function () {
@@ -1839,7 +1531,6 @@ var GuardService = /*#__PURE__*/function () {
1839
1531
  useRefreshToken: true
1840
1532
  };
1841
1533
  return _context3.abrupt("return", this.api.put(this.baseURL + "/v1/auth/token", null, config));
1842
-
1843
1534
  case 2:
1844
1535
  case "end":
1845
1536
  return _context3.stop();
@@ -1847,20 +1538,15 @@ var GuardService = /*#__PURE__*/function () {
1847
1538
  }
1848
1539
  }, _callee3, this);
1849
1540
  }));
1850
-
1851
1541
  function authRefresh(_x3) {
1852
1542
  return _authRefresh.apply(this, arguments);
1853
1543
  }
1854
-
1855
1544
  return authRefresh;
1856
- }()
1857
- /**
1858
- * Call guard to overwrite existing refresh token cookie
1859
- *
1860
- * @returns void
1861
- */
1862
- ;
1863
-
1545
+ }() /**
1546
+ * Call guard to overwrite existing refresh token cookie
1547
+ *
1548
+ * @returns void
1549
+ */;
1864
1550
  _proto.authLogout =
1865
1551
  /*#__PURE__*/
1866
1552
  function () {
@@ -1870,7 +1556,6 @@ var GuardService = /*#__PURE__*/function () {
1870
1556
  switch (_context4.prev = _context4.next) {
1871
1557
  case 0:
1872
1558
  return _context4.abrupt("return", this.api.get(this.baseURL + "/v1/auth/logout"));
1873
-
1874
1559
  case 1:
1875
1560
  case "end":
1876
1561
  return _context4.stop();
@@ -1878,21 +1563,16 @@ var GuardService = /*#__PURE__*/function () {
1878
1563
  }
1879
1564
  }, _callee4, this);
1880
1565
  }));
1881
-
1882
1566
  function authLogout() {
1883
1567
  return _authLogout.apply(this, arguments);
1884
1568
  }
1885
-
1886
1569
  return authLogout;
1887
- }()
1888
- /**
1889
- * Call guard to attempt account recovery
1890
- *
1891
- * @param req The email address / practice of the account to recover
1892
- * @returns void
1893
- */
1894
- ;
1895
-
1570
+ }() /**
1571
+ * Call guard to attempt account recovery
1572
+ *
1573
+ * @param req The email address / practice of the account to recover
1574
+ * @returns void
1575
+ */;
1896
1576
  _proto.authRecover =
1897
1577
  /*#__PURE__*/
1898
1578
  function () {
@@ -1902,7 +1582,6 @@ var GuardService = /*#__PURE__*/function () {
1902
1582
  switch (_context5.prev = _context5.next) {
1903
1583
  case 0:
1904
1584
  return _context5.abrupt("return", this.api.post(this.baseURL + "/v1/auth/recover", req));
1905
-
1906
1585
  case 1:
1907
1586
  case "end":
1908
1587
  return _context5.stop();
@@ -1910,28 +1589,22 @@ var GuardService = /*#__PURE__*/function () {
1910
1589
  }
1911
1590
  }, _callee5, this);
1912
1591
  }));
1913
-
1914
1592
  function authRecover(_x4) {
1915
1593
  return _authRecover.apply(this, arguments);
1916
1594
  }
1917
-
1918
1595
  return authRecover;
1919
- }()
1920
- /**
1921
- * Allow to create a new identity. The identity will then need to be confirmed
1922
- * via an email link
1923
- *
1924
- * @param req the information about the new identity to create
1925
- * @returns IdentityResponse
1926
- */
1927
- ;
1928
-
1596
+ }() /**
1597
+ * Allow to create a new identity. The identity will then need to be confirmed
1598
+ * via an email link
1599
+ *
1600
+ * @param req the information about the new identity to create
1601
+ * @returns IdentityResponse
1602
+ */;
1929
1603
  _proto.identityCreate =
1930
1604
  /*#__PURE__*/
1931
1605
  function () {
1932
1606
  var _identityCreate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(req) {
1933
1607
  var resp, _e$response3, code;
1934
-
1935
1608
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
1936
1609
  while (1) {
1937
1610
  switch (_context6.prev = _context6.next) {
@@ -1939,7 +1612,6 @@ var GuardService = /*#__PURE__*/function () {
1939
1612
  _context6.prev = 0;
1940
1613
  _context6.next = 3;
1941
1614
  return this.api.post(this.baseURL + "/v1/identities", req);
1942
-
1943
1615
  case 3:
1944
1616
  resp = _context6.sent;
1945
1617
  this.api.setTokens({
@@ -1947,36 +1619,27 @@ var GuardService = /*#__PURE__*/function () {
1947
1619
  });
1948
1620
  _context6.next = 18;
1949
1621
  break;
1950
-
1951
1622
  case 7:
1952
1623
  _context6.prev = 7;
1953
1624
  _context6.t0 = _context6["catch"](0);
1954
-
1955
1625
  if (!_context6.t0.isAxiosError) {
1956
1626
  _context6.next = 17;
1957
1627
  break;
1958
1628
  }
1959
-
1960
1629
  code = (_e$response3 = _context6.t0.response) == null ? void 0 : _e$response3.status;
1961
1630
  _context6.t1 = code;
1962
1631
  _context6.next = _context6.t1 === 400 ? 14 : _context6.t1 === 409 ? 15 : _context6.t1 === 500 ? 16 : 16;
1963
1632
  break;
1964
-
1965
1633
  case 14:
1966
1634
  throw new IdentityCreationBadRequest();
1967
-
1968
1635
  case 15:
1969
1636
  throw new IdentityCreationConflict();
1970
-
1971
1637
  case 16:
1972
1638
  throw new IdentityCreationFailed();
1973
-
1974
1639
  case 17:
1975
1640
  throw new IdentityCreationFailed();
1976
-
1977
1641
  case 18:
1978
1642
  return _context6.abrupt("return", resp);
1979
-
1980
1643
  case 19:
1981
1644
  case "end":
1982
1645
  return _context6.stop();
@@ -1984,29 +1647,23 @@ var GuardService = /*#__PURE__*/function () {
1984
1647
  }
1985
1648
  }, _callee6, this, [[0, 7]]);
1986
1649
  }));
1987
-
1988
1650
  function identityCreate(_x5) {
1989
1651
  return _identityCreate.apply(this, arguments);
1990
1652
  }
1991
-
1992
1653
  return identityCreate;
1993
- }()
1994
- /**
1995
- * Retrieve an identity. Will return public fields only when requested
1996
- * without authentication
1997
- *
1998
- * @param identityID Unique id of the identity to retrieve
1999
- * @param skipCache (default: false) will skip identity cache (not even update it)
2000
- * @returns IdentityResponse
2001
- */
2002
- ;
2003
-
1654
+ }() /**
1655
+ * Retrieve an identity. Will return public fields only when requested
1656
+ * without authentication
1657
+ *
1658
+ * @param identityID Unique id of the identity to retrieve
1659
+ * @param skipCache (default: false) will skip identity cache (not even update it)
1660
+ * @returns IdentityResponse
1661
+ */;
2004
1662
  _proto.identityGet =
2005
1663
  /*#__PURE__*/
2006
1664
  function () {
2007
1665
  var _identityGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(identityID, skipCache) {
2008
1666
  var _tokens$accessToken, _tokens$refreshToken;
2009
-
2010
1667
  var tokens, cacheKey, identity;
2011
1668
  return _regeneratorRuntime().wrap(function _callee7$(_context7) {
2012
1669
  while (1) {
@@ -2015,34 +1672,25 @@ var GuardService = /*#__PURE__*/function () {
2015
1672
  if (skipCache === void 0) {
2016
1673
  skipCache = false;
2017
1674
  }
2018
-
2019
1675
  tokens = this.api.getTokens();
2020
1676
  cacheKey = ((_tokens$accessToken = tokens.accessToken) != null ? _tokens$accessToken : '') + ((_tokens$refreshToken = tokens.refreshToken) != null ? _tokens$refreshToken : '') + identityID;
2021
-
2022
1677
  if (!(skipCache || !tokens.accessToken || !this.identityCache[cacheKey])) {
2023
1678
  _context7.next = 10;
2024
1679
  break;
2025
1680
  }
2026
-
2027
1681
  _context7.next = 6;
2028
1682
  return this.api.get(this.baseURL + "/v1/identities/" + identityID);
2029
-
2030
1683
  case 6:
2031
1684
  identity = _context7.sent;
2032
-
2033
1685
  if (!skipCache) {
2034
1686
  _context7.next = 9;
2035
1687
  break;
2036
1688
  }
2037
-
2038
1689
  return _context7.abrupt("return", identity);
2039
-
2040
1690
  case 9:
2041
1691
  this.identityCache[cacheKey] = identity;
2042
-
2043
1692
  case 10:
2044
1693
  return _context7.abrupt("return", this.identityCache[cacheKey]);
2045
-
2046
1694
  case 11:
2047
1695
  case "end":
2048
1696
  return _context7.stop();
@@ -2050,27 +1698,21 @@ var GuardService = /*#__PURE__*/function () {
2050
1698
  }
2051
1699
  }, _callee7, this);
2052
1700
  }));
2053
-
2054
1701
  function identityGet(_x6, _x7) {
2055
1702
  return _identityGet.apply(this, arguments);
2056
1703
  }
2057
-
2058
1704
  return identityGet;
2059
- }()
2060
- /**
2061
- * Get information about the current authenticated user
2062
- *
2063
- * @param refreshCache if true it will refresh the whoAmI cache (default: false)
2064
- * @returns WhoAmIResponse
2065
- */
2066
- ;
2067
-
1705
+ }() /**
1706
+ * Get information about the current authenticated user
1707
+ *
1708
+ * @param refreshCache if true it will refresh the whoAmI cache (default: false)
1709
+ * @returns WhoAmIResponse
1710
+ */;
2068
1711
  _proto.whoAmI =
2069
1712
  /*#__PURE__*/
2070
1713
  function () {
2071
1714
  var _whoAmI = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(refreshCache) {
2072
1715
  var _this$api$getTokens$a;
2073
-
2074
1716
  var cacheKey;
2075
1717
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
2076
1718
  while (1) {
@@ -2079,23 +1721,17 @@ var GuardService = /*#__PURE__*/function () {
2079
1721
  if (refreshCache === void 0) {
2080
1722
  refreshCache = false;
2081
1723
  }
2082
-
2083
1724
  cacheKey = (_this$api$getTokens$a = this.api.getTokens().accessToken) != null ? _this$api$getTokens$a : '';
2084
-
2085
1725
  if (!(!this.whoAmICache[cacheKey] || refreshCache)) {
2086
1726
  _context8.next = 6;
2087
1727
  break;
2088
1728
  }
2089
-
2090
1729
  _context8.next = 5;
2091
1730
  return this.api.get(this.baseURL + "/v1/auth/whoami");
2092
-
2093
1731
  case 5:
2094
1732
  this.whoAmICache[cacheKey] = _context8.sent;
2095
-
2096
1733
  case 6:
2097
1734
  return _context8.abrupt("return", this.whoAmICache[cacheKey]);
2098
-
2099
1735
  case 7:
2100
1736
  case "end":
2101
1737
  return _context8.stop();
@@ -2103,22 +1739,17 @@ var GuardService = /*#__PURE__*/function () {
2103
1739
  }
2104
1740
  }, _callee8, this);
2105
1741
  }));
2106
-
2107
1742
  function whoAmI(_x8) {
2108
1743
  return _whoAmI.apply(this, arguments);
2109
1744
  }
2110
-
2111
1745
  return whoAmI;
2112
- }()
2113
- /**
2114
- * Update an existing identity
2115
- *
2116
- * @param identityID unique id of identity to update
2117
- * @param req update request
2118
- * @returns IdentityResponse
2119
- */
2120
- ;
2121
-
1746
+ }() /**
1747
+ * Update an existing identity
1748
+ *
1749
+ * @param identityID unique id of identity to update
1750
+ * @param req update request
1751
+ * @returns IdentityResponse
1752
+ */;
2122
1753
  _proto.identityUpdate =
2123
1754
  /*#__PURE__*/
2124
1755
  function () {
@@ -2128,7 +1759,6 @@ var GuardService = /*#__PURE__*/function () {
2128
1759
  switch (_context9.prev = _context9.next) {
2129
1760
  case 0:
2130
1761
  return _context9.abrupt("return", this.api.put(this.baseURL + "/v1/identities/" + identityID, req));
2131
-
2132
1762
  case 1:
2133
1763
  case "end":
2134
1764
  return _context9.stop();
@@ -2136,23 +1766,18 @@ var GuardService = /*#__PURE__*/function () {
2136
1766
  }
2137
1767
  }, _callee9, this);
2138
1768
  }));
2139
-
2140
1769
  function identityUpdate(_x9, _x10) {
2141
1770
  return _identityUpdate.apply(this, arguments);
2142
1771
  }
2143
-
2144
1772
  return identityUpdate;
2145
- }()
2146
- /**
2147
- * Return base64 data representing a QR code that the
2148
- * current identity need in order to use MFA
2149
- *
2150
- * @param identityID unique id of the identity
2151
- * @param password the identity password (already hashed and in base64)
2152
- * @returns QRCodeResponse
2153
- */
2154
- ;
2155
-
1773
+ }() /**
1774
+ * Return base64 data representing a QR code that the
1775
+ * current identity need in order to use MFA
1776
+ *
1777
+ * @param identityID unique id of the identity
1778
+ * @param password the identity password (already hashed and in base64)
1779
+ * @returns QRCodeResponse
1780
+ */;
2156
1781
  _proto.identityMFAQRCode =
2157
1782
  /*#__PURE__*/
2158
1783
  function () {
@@ -2170,7 +1795,6 @@ var GuardService = /*#__PURE__*/function () {
2170
1795
  Accept: 'application/json'
2171
1796
  }
2172
1797
  }));
2173
-
2174
1798
  case 2:
2175
1799
  case "end":
2176
1800
  return _context10.stop();
@@ -2178,21 +1802,16 @@ var GuardService = /*#__PURE__*/function () {
2178
1802
  }
2179
1803
  }, _callee10, this);
2180
1804
  }));
2181
-
2182
1805
  function identityMFAQRCode(_x11, _x12) {
2183
1806
  return _identityMFAQRCode.apply(this, arguments);
2184
1807
  }
2185
-
2186
1808
  return identityMFAQRCode;
2187
- }()
2188
- /**
2189
- * Attempt to resend the email confirmation email
2190
- *
2191
- * @param req IdentityResendConfirmEmailRequest
2192
- * @return void
2193
- */
2194
- ;
2195
-
1809
+ }() /**
1810
+ * Attempt to resend the email confirmation email
1811
+ *
1812
+ * @param req IdentityResendConfirmEmailRequest
1813
+ * @return void
1814
+ */;
2196
1815
  _proto.identitySendConfirmEmail =
2197
1816
  /*#__PURE__*/
2198
1817
  function () {
@@ -2202,7 +1821,6 @@ var GuardService = /*#__PURE__*/function () {
2202
1821
  switch (_context11.prev = _context11.next) {
2203
1822
  case 0:
2204
1823
  return _context11.abrupt("return", this.api.post(this.baseURL + "/v1/identity/confirm", req));
2205
-
2206
1824
  case 1:
2207
1825
  case "end":
2208
1826
  return _context11.stop();
@@ -2210,21 +1828,16 @@ var GuardService = /*#__PURE__*/function () {
2210
1828
  }
2211
1829
  }, _callee11, this);
2212
1830
  }));
2213
-
2214
1831
  function identitySendConfirmEmail(_x13) {
2215
1832
  return _identitySendConfirmEmail.apply(this, arguments);
2216
1833
  }
2217
-
2218
1834
  return identitySendConfirmEmail;
2219
- }()
2220
- /**
2221
- * Get an identity using a customer email (format: customer+[b64Hash]@orohealth.me)
2222
- *
2223
- * @param email the customer email
2224
- * @returns IdentityResponse
2225
- */
2226
- ;
2227
-
1835
+ }() /**
1836
+ * Get an identity using a customer email (format: customer+[b64Hash]@orohealth.me)
1837
+ *
1838
+ * @param email the customer email
1839
+ * @returns IdentityResponse
1840
+ */;
2228
1841
  _proto.identityGetByCustomerEmail =
2229
1842
  /*#__PURE__*/
2230
1843
  function () {
@@ -2234,7 +1847,6 @@ var GuardService = /*#__PURE__*/function () {
2234
1847
  switch (_context12.prev = _context12.next) {
2235
1848
  case 0:
2236
1849
  return _context12.abrupt("return", this.identityGetByHash(email.substring(email.indexOf('+') + 1, email.indexOf('@'))));
2237
-
2238
1850
  case 1:
2239
1851
  case "end":
2240
1852
  return _context12.stop();
@@ -2242,21 +1854,16 @@ var GuardService = /*#__PURE__*/function () {
2242
1854
  }
2243
1855
  }, _callee12, this);
2244
1856
  }));
2245
-
2246
1857
  function identityGetByCustomerEmail(_x14) {
2247
1858
  return _identityGetByCustomerEmail.apply(this, arguments);
2248
1859
  }
2249
-
2250
1860
  return identityGetByCustomerEmail;
2251
- }()
2252
- /**
2253
- * Get an identity using a base64 hash
2254
- *
2255
- * @param b64Hash base64 hash of the identity
2256
- * @returns IdentityResponse
2257
- */
2258
- ;
2259
-
1861
+ }() /**
1862
+ * Get an identity using a base64 hash
1863
+ *
1864
+ * @param b64Hash base64 hash of the identity
1865
+ * @returns IdentityResponse
1866
+ */;
2260
1867
  _proto.identityGetByHash =
2261
1868
  /*#__PURE__*/
2262
1869
  function () {
@@ -2266,7 +1873,6 @@ var GuardService = /*#__PURE__*/function () {
2266
1873
  switch (_context13.prev = _context13.next) {
2267
1874
  case 0:
2268
1875
  return _context13.abrupt("return", this.identityGet(b64Hash.replace(/\+/g, '-').replace(/\//g, '_')));
2269
-
2270
1876
  case 1:
2271
1877
  case "end":
2272
1878
  return _context13.stop();
@@ -2274,14 +1880,11 @@ var GuardService = /*#__PURE__*/function () {
2274
1880
  }
2275
1881
  }, _callee13, this);
2276
1882
  }));
2277
-
2278
1883
  function identityGetByHash(_x15) {
2279
1884
  return _identityGetByHash.apply(this, arguments);
2280
1885
  }
2281
-
2282
1886
  return identityGetByHash;
2283
1887
  }();
2284
-
2285
1888
  return GuardService;
2286
1889
  }();
2287
1890
 
@@ -2295,10 +1898,7 @@ var SearchService = /*#__PURE__*/function () {
2295
1898
  * @param consultUUID
2296
1899
  * @param terms the search terms to be indexed
2297
1900
  */
2298
-
2299
-
2300
1901
  var _proto = SearchService.prototype;
2301
-
2302
1902
  _proto.index = function index(consultUUID, terms) {
2303
1903
  return this.api.post(this.baseURL + "/v1/index", {
2304
1904
  consultUUID: consultUUID,
@@ -2308,15 +1908,12 @@ var SearchService = /*#__PURE__*/function () {
2308
1908
  /**
2309
1909
  * Searches for the consultations corresponding to the search terms entered in the query
2310
1910
  * @param terms array of search terms
2311
- */
2312
- ;
2313
-
1911
+ */;
2314
1912
  _proto.search = function search(terms) {
2315
1913
  return this.api.post(this.baseURL + "/v1/search", {
2316
1914
  terms: terms
2317
1915
  });
2318
1916
  };
2319
-
2320
1917
  return SearchService;
2321
1918
  }();
2322
1919
 
@@ -2333,10 +1930,7 @@ var PracticeService = /*#__PURE__*/function () {
2333
1930
  * @param accounts (optional) if set true it the Practice field accounts will be set
2334
1931
  * @returns the found practice or undefined
2335
1932
  */
2336
-
2337
-
2338
1933
  var _proto = PracticeService.prototype;
2339
-
2340
1934
  _proto.practiceGetFromURL = function practiceGetFromURL(practiceURL, params) {
2341
1935
  return this.api.get(this.baseURL + "/v1/practices", {
2342
1936
  params: _extends({
@@ -2344,7 +1938,6 @@ var PracticeService = /*#__PURE__*/function () {
2344
1938
  }, params)
2345
1939
  });
2346
1940
  };
2347
-
2348
1941
  _proto.practiceGetFromUuid = function practiceGetFromUuid(practiceUuid, locale, withAccounts) {
2349
1942
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid, {
2350
1943
  params: {
@@ -2352,15 +1945,13 @@ var PracticeService = /*#__PURE__*/function () {
2352
1945
  accounts: withAccounts
2353
1946
  }
2354
1947
  });
2355
- } /// Practice Configs
2356
-
1948
+ }
1949
+ /// Practice Configs
2357
1950
  /**
2358
1951
  * This function retrieves all configs of a specific practice
2359
1952
  * @param practiceUuid uuid of the practice
2360
1953
  * @returns the practice configs
2361
- */
2362
- ;
2363
-
1954
+ */;
2364
1955
  _proto.practiceConfigGetFromPracticeUuid = function practiceConfigGetFromPracticeUuid(practiceUuid) {
2365
1956
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/configs");
2366
1957
  }
@@ -2369,9 +1960,7 @@ var PracticeService = /*#__PURE__*/function () {
2369
1960
  * @param practiceUuid uuid of the practice
2370
1961
  * @param kind of the config
2371
1962
  * @returns the practice config
2372
- */
2373
- ;
2374
-
1963
+ */;
2375
1964
  _proto.practiceConfigGetByKindForPracticeUuid = function practiceConfigGetByKindForPracticeUuid(practiceUuid, kind) {
2376
1965
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/configs/" + kind);
2377
1966
  }
@@ -2380,9 +1969,7 @@ var PracticeService = /*#__PURE__*/function () {
2380
1969
  * @param practiceUuid uuid of the practice
2381
1970
  * @param config the config to add to the practice
2382
1971
  * @returns the created practice config
2383
- */
2384
- ;
2385
-
1972
+ */;
2386
1973
  _proto.practiceConfigCreateForPracticeUuid = function practiceConfigCreateForPracticeUuid(practiceUuid, config) {
2387
1974
  return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/configs", config);
2388
1975
  }
@@ -2391,18 +1978,15 @@ var PracticeService = /*#__PURE__*/function () {
2391
1978
  * @param practiceUuid uuid of the practice
2392
1979
  * @param config the config to update
2393
1980
  * @returns the practice config
2394
- */
2395
- ;
2396
-
1981
+ */;
2397
1982
  _proto.practiceConfigUpdate = function practiceConfigUpdate(config) {
2398
1983
  return this.api.put(this.baseURL + "/v1/practices/" + config.uuidPractice + "/configs/" + config.kind, config);
2399
- } /// Accounts
1984
+ }
1985
+ /// Accounts
2400
1986
  ;
2401
-
2402
1987
  _proto.practiceGetAccounts = function practiceGetAccounts(practiceUuid) {
2403
1988
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/accounts");
2404
1989
  };
2405
-
2406
1990
  _proto.practiceGetAccount = function practiceGetAccount(practiceUuid, accountUuid) {
2407
1991
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/accounts/" + accountUuid);
2408
1992
  }
@@ -2411,9 +1995,7 @@ var PracticeService = /*#__PURE__*/function () {
2411
1995
  * @param practiceUuid the uuid of the practice
2412
1996
  * @param kind (optional) the kind of WorkflowType to filter in
2413
1997
  * @returns a list of PracticeWorkflow
2414
- */
2415
- ;
2416
-
1998
+ */;
2417
1999
  _proto.practiceGetWorkflows = function practiceGetWorkflows(practiceUuid, kind) {
2418
2000
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/workflows", {
2419
2001
  params: {
@@ -2421,12 +2003,11 @@ var PracticeService = /*#__PURE__*/function () {
2421
2003
  }
2422
2004
  });
2423
2005
  };
2424
-
2425
2006
  _proto.practiceGetWorkflow = function practiceGetWorkflow(practiceUuid, workflowType) {
2426
2007
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/workflows/" + workflowType);
2427
- } /// Plans
2008
+ }
2009
+ /// Plans
2428
2010
  ;
2429
-
2430
2011
  _proto.practiceGetPlans = function practiceGetPlans(practiceUuid, planType) {
2431
2012
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/plans", {
2432
2013
  params: {
@@ -2434,33 +2015,32 @@ var PracticeService = /*#__PURE__*/function () {
2434
2015
  }
2435
2016
  });
2436
2017
  };
2437
-
2438
2018
  _proto.practiceGetPlan = function practiceGetPlan(practiceUuid, planId) {
2439
2019
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/plans/" + planId);
2440
2020
  };
2441
-
2442
2021
  _proto.practiceGetPlanPrices = function practiceGetPlanPrices(practiceUuid, planId) {
2443
2022
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/plans/" + planId + "/prices");
2444
- } // Payments
2023
+ }
2024
+ // Payments
2445
2025
  ;
2446
-
2447
- _proto.practiceGetPayments = function practiceGetPayments(practiceUuid, planType) {
2026
+ _proto.practiceGetPayments = function practiceGetPayments(practiceUuid, statusPayment, withConsultUUIDNULL, perPage, indexPage) {
2448
2027
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments", {
2449
2028
  params: {
2450
- kind: planType
2029
+ status: statusPayment,
2030
+ withConsultUUIDNULL: withConsultUUIDNULL,
2031
+ perPage: perPage,
2032
+ indexPage: indexPage
2451
2033
  }
2452
2034
  });
2453
2035
  };
2454
-
2455
2036
  _proto.practiceGetPayment = function practiceGetPayment(practiceUuid, idStripeInvoiceOrPaymentIntent) {
2456
2037
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/" + idStripeInvoiceOrPaymentIntent);
2457
2038
  };
2458
-
2459
2039
  _proto.practiceGetPaymentForStripePaymentIntentWithID = function practiceGetPaymentForStripePaymentIntentWithID(practiceUuid, stripePaymentIntentId) {
2460
2040
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/" + stripePaymentIntentId);
2461
- } // Payments Intent
2041
+ }
2042
+ // Payments Intent
2462
2043
  ;
2463
-
2464
2044
  _proto.practiceGetPaymentsIntents = function practiceGetPaymentsIntents(practiceUuid, planType) {
2465
2045
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/intents", {
2466
2046
  params: {
@@ -2472,9 +2052,7 @@ var PracticeService = /*#__PURE__*/function () {
2472
2052
  * This function return the user hased email to be use for creating payment intent
2473
2053
  * @param email the email to hash
2474
2054
  * @returns a hashed email
2475
- */
2476
- ;
2477
-
2055
+ */;
2478
2056
  _proto.getPaymentIntentHashedEmail = function getPaymentIntentHashedEmail(email) {
2479
2057
  return hashToBase64String(email.toLowerCase());
2480
2058
  }
@@ -2488,9 +2066,7 @@ var PracticeService = /*#__PURE__*/function () {
2488
2066
  * @param promotionCode (optional) promotion code to apply
2489
2067
  * @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.).
2490
2068
  * @returns
2491
- */
2492
- ;
2493
-
2069
+ */;
2494
2070
  _proto.practiceCreatePaymentsIntent = function practiceCreatePaymentsIntent(practiceUuid, planId, userEmail, isoLocality, url_subdomain, requestMetadata) {
2495
2071
  return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/intents/", {
2496
2072
  idPlan: planId,
@@ -2503,7 +2079,6 @@ var PracticeService = /*#__PURE__*/function () {
2503
2079
  }
2504
2080
  });
2505
2081
  };
2506
-
2507
2082
  _proto.practiceGetPaymentsIntent = function practiceGetPaymentsIntent(practiceUuid, paymentIntentId) {
2508
2083
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/intents/" + paymentIntentId);
2509
2084
  }
@@ -2516,9 +2091,7 @@ var PracticeService = /*#__PURE__*/function () {
2516
2091
  * @param promotionCode (optional) promotional code to apply
2517
2092
  * @param finalize (optional) if true will finalize the PracticePaymentIntent and related Stripe.Invoice. Once, finalized you cannot modify the PracticePaymentIntent anymore.
2518
2093
  * @returns the updated PracticePaymentIntent
2519
- */
2520
- ;
2521
-
2094
+ */;
2522
2095
  _proto.practiceUpdatePaymentsIntent = function practiceUpdatePaymentsIntent(practiceUuid, idPraticePaymentIntent, practicePaymentIntent, userEmail, promotionCode, finalize) {
2523
2096
  return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/intents/" + idPraticePaymentIntent, _extends({}, practicePaymentIntent, {
2524
2097
  hashUserEmail: userEmail ? this.getPaymentIntentHashedEmail(userEmail) : undefined
@@ -2533,125 +2106,103 @@ var PracticeService = /*#__PURE__*/function () {
2533
2106
  * Invoice
2534
2107
  * @param practiceUuid UUID of the practice to get the invoice from
2535
2108
  * @param invoiceId ID of the invoice in stripe
2536
- */
2537
- ;
2538
-
2109
+ */;
2539
2110
  _proto.getInvoice = function getInvoice(practiceUuid, invoiceId) {
2540
2111
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/payments/invoices/" + invoiceId);
2541
- } // Practitioner
2112
+ }
2113
+ // Practitioner
2542
2114
  ;
2543
-
2544
2115
  _proto.practiceGetPractitioners = function practiceGetPractitioners(practiceUuid) {
2545
2116
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners");
2546
2117
  };
2547
-
2548
2118
  _proto.practiceUpdatePractitioner = function practiceUpdatePractitioner(practiceUuid, practitionerUuid, requestBody) {
2549
2119
  return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid, requestBody);
2550
2120
  };
2551
-
2552
2121
  _proto.practiceGetPractitioner = function practiceGetPractitioner(practiceUuid, practitionerUuid) {
2553
2122
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid);
2554
- } // Practitioner Licenses
2123
+ }
2124
+ // Practitioner Licenses
2555
2125
  ;
2556
-
2557
2126
  _proto.practiceGetPractitionerLicenses = function practiceGetPractitionerLicenses(practiceUuid, practitionerUuid) {
2558
2127
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/licenses");
2559
2128
  };
2560
-
2561
2129
  _proto.practiceCreatePractitionerLicense = function practiceCreatePractitionerLicense(practiceUuid, practitionerUuid, requestBody) {
2562
2130
  return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/licenses", requestBody);
2563
2131
  };
2564
-
2565
2132
  _proto.practiceUpdatePractitionerLicense = function practiceUpdatePractitionerLicense(practiceUuid, practitionerUuid, licenseId, requestBody) {
2566
2133
  return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/licenses/" + licenseId, requestBody);
2567
2134
  };
2568
-
2569
2135
  _proto.practiceGetPractitionerLicense = function practiceGetPractitionerLicense(practiceUuid, practitionerUuid, licenseId) {
2570
2136
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/licenses/" + licenseId);
2571
- } // Practitioner Preferences
2137
+ }
2138
+ // Practitioner Preferences
2572
2139
  ;
2573
-
2574
2140
  _proto.practiceGetPractitionerPreferences = function practiceGetPractitionerPreferences(practiceUuid, practitionerUuid) {
2575
2141
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/preferences");
2576
2142
  };
2577
-
2578
2143
  _proto.practiceCreatePractitionerPreference = function practiceCreatePractitionerPreference(practiceUuid, practitionerUuid, requestBody) {
2579
2144
  return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/preferences", requestBody);
2580
2145
  };
2581
-
2582
2146
  _proto.practiceUpdatePractitionerPreference = function practiceUpdatePractitionerPreference(practiceUuid, practitionerUuid, preferenceId, requestBody) {
2583
2147
  return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/preferences/" + preferenceId, requestBody);
2584
2148
  };
2585
-
2586
2149
  _proto.practiceGetPractitionerPreference = function practiceGetPractitionerPreference(practiceUuid, practitionerUuid, preferenceId) {
2587
2150
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/preferences/" + preferenceId);
2588
- } // Practitioner Roles
2151
+ }
2152
+ // Practitioner Roles
2589
2153
  ;
2590
-
2591
2154
  _proto.practiceGetPractitionerRoles = function practiceGetPractitionerRoles(practiceUuid, practitionerUuid) {
2592
2155
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles");
2593
2156
  };
2594
-
2595
2157
  _proto.practiceCreatePractitionerRole = function practiceCreatePractitionerRole(practiceUuid, practitionerUuid, requestBody) {
2596
2158
  return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles", requestBody);
2597
2159
  };
2598
-
2599
2160
  _proto.practiceDeletePractitionerRoles = function practiceDeletePractitionerRoles(practiceUuid, practitionerUuid) {
2600
2161
  return this.api.deleteRequest(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles");
2601
2162
  };
2602
-
2603
2163
  _proto.practiceUpdatePractitionerRole = function practiceUpdatePractitionerRole(practiceUuid, practitionerUuid, roleId, requestBody) {
2604
2164
  return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles/" + roleId, requestBody);
2605
2165
  };
2606
-
2607
2166
  _proto.practiceGetPractitionerRole = function practiceGetPractitionerRole(practiceUuid, practitionerUuid, roleId) {
2608
2167
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles/" + roleId);
2609
2168
  };
2610
-
2611
2169
  _proto.practiceDeletePractitionerRole = function practiceDeletePractitionerRole(practiceUuid, practitionerUuid, roleId) {
2612
2170
  return this.api.deleteRequest(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/roles/" + roleId);
2613
- } // Practitioner signature
2614
-
2171
+ }
2172
+ // Practitioner signature
2615
2173
  /**
2616
2174
  * This function returns the practitioner's signature as a Blob
2617
2175
  * @param practiceUuid the practice uuid of the practitioner
2618
2176
  * @param practitionerUuid the practitioner uuid
2619
2177
  * @returns a blob representing the signature
2620
- */
2621
- ;
2622
-
2178
+ */;
2623
2179
  _proto.practiceGetPractitionerSignature = function practiceGetPractitionerSignature(practiceUuid, practitionerUuid) {
2624
2180
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/practitioners/" + practitionerUuid + "/signature", {
2625
2181
  responseType: 'blob'
2626
2182
  });
2627
- } // Assignments
2183
+ }
2184
+ // Assignments
2628
2185
  ;
2629
-
2630
2186
  _proto.practiceGetAssignments = function practiceGetAssignments(practiceUuid) {
2631
2187
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/assignments");
2632
2188
  };
2633
-
2634
2189
  _proto.practiceCreateAssignment = function practiceCreateAssignment(practiceUuid, requestBody) {
2635
2190
  return this.api.post(this.baseURL + "/v1/practices/" + practiceUuid + "/assignments", requestBody);
2636
2191
  };
2637
-
2638
2192
  _proto.practiceUpdateAssignment = function practiceUpdateAssignment(practiceUuid, assignmentId, requestBody) {
2639
2193
  return this.api.put(this.baseURL + "/v1/practices/" + practiceUuid + "/assignments/" + assignmentId, requestBody);
2640
2194
  };
2641
-
2642
2195
  _proto.practiceGetAssignment = function practiceGetAssignment(practiceUuid, assignmentId) {
2643
2196
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/assignments/" + assignmentId);
2644
- } // Quotas
2197
+ }
2198
+ // Quotas
2645
2199
  ;
2646
-
2647
2200
  _proto.practiceGetQuotas = function practiceGetQuotas(practiceUuid) {
2648
2201
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/quotas");
2649
2202
  };
2650
-
2651
2203
  _proto.practiceGetQuota = function practiceGetQuota(practiceUuid, quotaId) {
2652
2204
  return this.api.get(this.baseURL + "/v1/practices/" + practiceUuid + "/quotas/" + quotaId);
2653
2205
  };
2654
-
2655
2206
  return PracticeService;
2656
2207
  }();
2657
2208
 
@@ -2660,9 +2211,7 @@ var TellerService = /*#__PURE__*/function () {
2660
2211
  this.api = api;
2661
2212
  this.baseURL = baseURL;
2662
2213
  }
2663
-
2664
2214
  var _proto = TellerService.prototype;
2665
-
2666
2215
  _proto.lockboxDataStore = /*#__PURE__*/function () {
2667
2216
  var _lockboxDataStore = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(lockboxUuid, req, lockboxOwnerUuid, previousDataUuid) {
2668
2217
  return _regeneratorRuntime().wrap(function _callee$(_context) {
@@ -2675,7 +2224,6 @@ var TellerService = /*#__PURE__*/function () {
2675
2224
  data_uuid: previousDataUuid
2676
2225
  }
2677
2226
  }));
2678
-
2679
2227
  case 1:
2680
2228
  case "end":
2681
2229
  return _context.stop();
@@ -2683,14 +2231,11 @@ var TellerService = /*#__PURE__*/function () {
2683
2231
  }
2684
2232
  }, _callee, this);
2685
2233
  }));
2686
-
2687
2234
  function lockboxDataStore(_x, _x2, _x3, _x4) {
2688
2235
  return _lockboxDataStore.apply(this, arguments);
2689
2236
  }
2690
-
2691
2237
  return lockboxDataStore;
2692
2238
  }();
2693
-
2694
2239
  _proto.updateConsultByUUID = function updateConsultByUUID(patientUuid, uuidConsult, statusMedical, closedReasonType, closedReasonDescription, neverExpires) {
2695
2240
  return this.api.put(this.baseURL + "/v1/consults/" + uuidConsult, {
2696
2241
  patientUuid: patientUuid,
@@ -2708,9 +2253,7 @@ var TellerService = /*#__PURE__*/function () {
2708
2253
  * @param consultationShortId the consultation short id
2709
2254
  * @param fax the address where to send the fax
2710
2255
  * @returns void
2711
- */
2712
- ;
2713
-
2256
+ */;
2714
2257
  _proto.notifyFaxFailed = function notifyFaxFailed(practiceUuid, consultationUuid, consultationShortId, fax) {
2715
2258
  return this.api.post(this.baseURL + "/v1/fax-failed", {
2716
2259
  consultationUuid: consultationUuid,
@@ -2727,9 +2270,7 @@ var TellerService = /*#__PURE__*/function () {
2727
2270
  * @todo - Make service only exposed route
2728
2271
  * @param uuidConsult the uuid of the consult to reassign
2729
2272
  * @param newPractitionerUuid the uuid of the practitioner that will get reassigned
2730
- */
2731
- ;
2732
-
2273
+ */;
2733
2274
  _proto.reassignmentEmail = function reassignmentEmail(uuidConsult, newPractitionerUuid) {
2734
2275
  return this.api.post(this.baseURL + "/v1/consult/" + uuidConsult + "/reassignment-email", {
2735
2276
  newPractitionerUuid: newPractitionerUuid
@@ -2741,9 +2282,7 @@ var TellerService = /*#__PURE__*/function () {
2741
2282
  * @param consult
2742
2283
  * @param patientUuid
2743
2284
  * @returns void
2744
- */
2745
- ;
2746
-
2285
+ */;
2747
2286
  _proto.sendOnlineFaxSuccessfulEmail = function sendOnlineFaxSuccessfulEmail(consult, patientUuid) {
2748
2287
  return this.api.post(this.baseURL + "/v1/online-fax-notify", {
2749
2288
  consult: consult,
@@ -2754,13 +2293,10 @@ var TellerService = /*#__PURE__*/function () {
2754
2293
  * This function will send an email to patient to allow them to resume the consult.
2755
2294
  * @param req the body of the resume consult request
2756
2295
  * @returns void
2757
- */
2758
- ;
2759
-
2296
+ */;
2760
2297
  _proto.sendResumeConsultEmail = function sendResumeConsultEmail(req) {
2761
2298
  return this.api.post(this.baseURL + "/v1/resume-consult-email", req);
2762
2299
  };
2763
-
2764
2300
  return TellerService;
2765
2301
  }();
2766
2302
 
@@ -2769,9 +2305,7 @@ var VaultService = /*#__PURE__*/function () {
2769
2305
  this.api = api;
2770
2306
  this.baseURL = baseURL;
2771
2307
  }
2772
-
2773
2308
  var _proto = VaultService.prototype;
2774
-
2775
2309
  _proto.lockboxCreate = /*#__PURE__*/function () {
2776
2310
  var _lockboxCreate = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(lockboxMetadata) {
2777
2311
  return _regeneratorRuntime().wrap(function _callee$(_context) {
@@ -2779,7 +2313,6 @@ var VaultService = /*#__PURE__*/function () {
2779
2313
  switch (_context.prev = _context.next) {
2780
2314
  case 0:
2781
2315
  return _context.abrupt("return", this.api.post(this.baseURL + "/v1/lockbox", lockboxMetadata));
2782
-
2783
2316
  case 1:
2784
2317
  case "end":
2785
2318
  return _context.stop();
@@ -2787,14 +2320,11 @@ var VaultService = /*#__PURE__*/function () {
2787
2320
  }
2788
2321
  }, _callee, this);
2789
2322
  }));
2790
-
2791
2323
  function lockboxCreate(_x) {
2792
2324
  return _lockboxCreate.apply(this, arguments);
2793
2325
  }
2794
-
2795
2326
  return lockboxCreate;
2796
2327
  }();
2797
-
2798
2328
  _proto.lockboxMetadataAdd = /*#__PURE__*/function () {
2799
2329
  var _lockboxMetadataAdd = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(lockboxUuid, lockboxMetadata, lockboxOwnerUuid) {
2800
2330
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
@@ -2806,7 +2336,6 @@ var VaultService = /*#__PURE__*/function () {
2806
2336
  lockbox_owner_uuid: lockboxOwnerUuid
2807
2337
  }
2808
2338
  }));
2809
-
2810
2339
  case 1:
2811
2340
  case "end":
2812
2341
  return _context2.stop();
@@ -2814,14 +2343,11 @@ var VaultService = /*#__PURE__*/function () {
2814
2343
  }
2815
2344
  }, _callee2, this);
2816
2345
  }));
2817
-
2818
2346
  function lockboxMetadataAdd(_x2, _x3, _x4) {
2819
2347
  return _lockboxMetadataAdd.apply(this, arguments);
2820
2348
  }
2821
-
2822
2349
  return lockboxMetadataAdd;
2823
2350
  }();
2824
-
2825
2351
  _proto.lockboxSecretGet = /*#__PURE__*/function () {
2826
2352
  var _lockboxSecretGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(lockboxUuid, lockboxOwnerUuid) {
2827
2353
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
@@ -2833,7 +2359,6 @@ var VaultService = /*#__PURE__*/function () {
2833
2359
  lockbox_owner_uuid: lockboxOwnerUuid
2834
2360
  }
2835
2361
  }));
2836
-
2837
2362
  case 1:
2838
2363
  case "end":
2839
2364
  return _context3.stop();
@@ -2841,14 +2366,11 @@ var VaultService = /*#__PURE__*/function () {
2841
2366
  }
2842
2367
  }, _callee3, this);
2843
2368
  }));
2844
-
2845
2369
  function lockboxSecretGet(_x5, _x6) {
2846
2370
  return _lockboxSecretGet.apply(this, arguments);
2847
2371
  }
2848
-
2849
2372
  return lockboxSecretGet;
2850
2373
  }();
2851
-
2852
2374
  _proto.lockboxGrant = /*#__PURE__*/function () {
2853
2375
  var _lockboxGrant = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(lockboxUuid, req, lockboxOwnerUuid) {
2854
2376
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
@@ -2860,7 +2382,6 @@ var VaultService = /*#__PURE__*/function () {
2860
2382
  lockbox_owner_uuid: lockboxOwnerUuid
2861
2383
  }
2862
2384
  }));
2863
-
2864
2385
  case 1:
2865
2386
  case "end":
2866
2387
  return _context4.stop();
@@ -2868,20 +2389,15 @@ var VaultService = /*#__PURE__*/function () {
2868
2389
  }
2869
2390
  }, _callee4, this);
2870
2391
  }));
2871
-
2872
2392
  function lockboxGrant(_x7, _x8, _x9) {
2873
2393
  return _lockboxGrant.apply(this, arguments);
2874
2394
  }
2875
-
2876
2395
  return lockboxGrant;
2877
- }()
2878
- /**
2879
- * Get all lockboxes granted to user
2880
- * @param filter filter of lockbox metadata
2881
- * @returns decrypted lockboxes granted to user
2882
- */
2883
- ;
2884
-
2396
+ }() /**
2397
+ * Get all lockboxes granted to user
2398
+ * @param filter filter of lockbox metadata
2399
+ * @returns decrypted lockboxes granted to user
2400
+ */;
2885
2401
  _proto.grantsGet =
2886
2402
  /*#__PURE__*/
2887
2403
  function () {
@@ -2891,7 +2407,6 @@ var VaultService = /*#__PURE__*/function () {
2891
2407
  switch (_context5.prev = _context5.next) {
2892
2408
  case 0:
2893
2409
  return _context5.abrupt("return", this.api.get(this.baseURL + "/v1/grants"));
2894
-
2895
2410
  case 1:
2896
2411
  case "end":
2897
2412
  return _context5.stop();
@@ -2899,25 +2414,20 @@ var VaultService = /*#__PURE__*/function () {
2899
2414
  }
2900
2415
  }, _callee5, this);
2901
2416
  }));
2902
-
2903
2417
  function grantsGet() {
2904
2418
  return _grantsGet.apply(this, arguments);
2905
2419
  }
2906
-
2907
2420
  return grantsGet;
2908
- }()
2909
- /**
2910
- * This function create or update a data into the vault.
2911
- * @note At creation it is necessary to have all `req` filled
2912
- * @note When setting `previousDataUuid` you are updating the data. `req` metadata fields are optional.
2913
- * @param lockboxUuid The lockbox uuid the data will be stored in
2914
- * @param req The request (please see notes)
2915
- * @param lockboxOwnerUuid The uuid of the owner of the lockbox (@deprecated)
2916
- * @param previousDataUuid The data uuid of the data you want to update
2917
- * @returns
2918
- */
2919
- ;
2920
-
2421
+ }() /**
2422
+ * This function create or update a data into the vault.
2423
+ * @note At creation it is necessary to have all `req` filled
2424
+ * @note When setting `previousDataUuid` you are updating the data. `req` metadata fields are optional.
2425
+ * @param lockboxUuid The lockbox uuid the data will be stored in
2426
+ * @param req The request (please see notes)
2427
+ * @param lockboxOwnerUuid The uuid of the owner of the lockbox (@deprecated)
2428
+ * @param previousDataUuid The data uuid of the data you want to update
2429
+ * @returns
2430
+ */;
2921
2431
  _proto.lockboxDataStore =
2922
2432
  /*#__PURE__*/
2923
2433
  function () {
@@ -2932,7 +2442,6 @@ var VaultService = /*#__PURE__*/function () {
2932
2442
  data_uuid: previousDataUuid
2933
2443
  }
2934
2444
  }));
2935
-
2936
2445
  case 1:
2937
2446
  case "end":
2938
2447
  return _context6.stop();
@@ -2940,14 +2449,11 @@ var VaultService = /*#__PURE__*/function () {
2940
2449
  }
2941
2450
  }, _callee6, this);
2942
2451
  }));
2943
-
2944
2452
  function lockboxDataStore(_x10, _x11, _x12, _x13) {
2945
2453
  return _lockboxDataStore.apply(this, arguments);
2946
2454
  }
2947
-
2948
2455
  return lockboxDataStore;
2949
2456
  }();
2950
-
2951
2457
  _proto.lockboxDataGet = /*#__PURE__*/function () {
2952
2458
  var _lockboxDataGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(lockboxUuid, dataUuid, lockboxOwnerUuid, stream) {
2953
2459
  var data;
@@ -2958,7 +2464,6 @@ var VaultService = /*#__PURE__*/function () {
2958
2464
  if (stream === void 0) {
2959
2465
  stream = true;
2960
2466
  }
2961
-
2962
2467
  _context7.next = 3;
2963
2468
  return this.api.get(this.baseURL + "/v1/lockboxes/" + lockboxUuid + "/data/" + dataUuid, {
2964
2469
  params: {
@@ -2966,22 +2471,17 @@ var VaultService = /*#__PURE__*/function () {
2966
2471
  stream: stream
2967
2472
  }
2968
2473
  });
2969
-
2970
2474
  case 3:
2971
2475
  data = _context7.sent;
2972
-
2973
2476
  if (!stream) {
2974
2477
  _context7.next = 6;
2975
2478
  break;
2976
2479
  }
2977
-
2978
2480
  return _context7.abrupt("return", {
2979
2481
  data: data
2980
2482
  });
2981
-
2982
2483
  case 6:
2983
2484
  return _context7.abrupt("return", data);
2984
-
2985
2485
  case 7:
2986
2486
  case "end":
2987
2487
  return _context7.stop();
@@ -2989,14 +2489,11 @@ var VaultService = /*#__PURE__*/function () {
2989
2489
  }
2990
2490
  }, _callee7, this);
2991
2491
  }));
2992
-
2993
2492
  function lockboxDataGet(_x14, _x15, _x16, _x17) {
2994
2493
  return _lockboxDataGet.apply(this, arguments);
2995
2494
  }
2996
-
2997
2495
  return lockboxDataGet;
2998
2496
  }();
2999
-
3000
2497
  _proto.lockboxManifestGet = /*#__PURE__*/function () {
3001
2498
  var _lockboxManifestGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(lockboxUuid, filter, lockboxOwnerUuid) {
3002
2499
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
@@ -3009,7 +2506,6 @@ var VaultService = /*#__PURE__*/function () {
3009
2506
  filter: filter
3010
2507
  }
3011
2508
  }));
3012
-
3013
2509
  case 1:
3014
2510
  case "end":
3015
2511
  return _context8.stop();
@@ -3017,14 +2513,11 @@ var VaultService = /*#__PURE__*/function () {
3017
2513
  }
3018
2514
  }, _callee8, this);
3019
2515
  }));
3020
-
3021
2516
  function lockboxManifestGet(_x18, _x19, _x20) {
3022
2517
  return _lockboxManifestGet.apply(this, arguments);
3023
2518
  }
3024
-
3025
2519
  return lockboxManifestGet;
3026
2520
  }();
3027
-
3028
2521
  _proto.lockboxMetadataGet = /*#__PURE__*/function () {
3029
2522
  var _lockboxMetadataGet = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(lockboxUuid, fields, groupby, filter, lockboxOwnerUuid) {
3030
2523
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
@@ -3039,7 +2532,6 @@ var VaultService = /*#__PURE__*/function () {
3039
2532
  filter: filter
3040
2533
  }
3041
2534
  }));
3042
-
3043
2535
  case 1:
3044
2536
  case "end":
3045
2537
  return _context9.stop();
@@ -3047,22 +2539,17 @@ var VaultService = /*#__PURE__*/function () {
3047
2539
  }
3048
2540
  }, _callee9, this);
3049
2541
  }));
3050
-
3051
2542
  function lockboxMetadataGet(_x21, _x22, _x23, _x24, _x25) {
3052
2543
  return _lockboxMetadataGet.apply(this, arguments);
3053
2544
  }
3054
-
3055
2545
  return lockboxMetadataGet;
3056
- }()
3057
- /**
3058
- * inserts or updates encrypted index entries
3059
- * @note if the index data is being inserted for a user other than the requester, use `indexOwnerUuid`
3060
- * @note if a uuid for an entry is provided, the service will perform an update
3061
- * @param entries the encrypted index data
3062
- * @param indexOwnerUuid
3063
- */
3064
- ;
3065
-
2546
+ }() /**
2547
+ * inserts or updates encrypted index entries
2548
+ * @note if the index data is being inserted for a user other than the requester, use `indexOwnerUuid`
2549
+ * @note if a uuid for an entry is provided, the service will perform an update
2550
+ * @param entries the encrypted index data
2551
+ * @param indexOwnerUuid
2552
+ */;
3066
2553
  _proto.vaultIndexPut =
3067
2554
  /*#__PURE__*/
3068
2555
  function () {
@@ -3076,7 +2563,6 @@ var VaultService = /*#__PURE__*/function () {
3076
2563
  index_owner_uuid: indexOwnerUuid
3077
2564
  }
3078
2565
  }));
3079
-
3080
2566
  case 1:
3081
2567
  case "end":
3082
2568
  return _context10.stop();
@@ -3084,20 +2570,15 @@ var VaultService = /*#__PURE__*/function () {
3084
2570
  }
3085
2571
  }, _callee10, this);
3086
2572
  }));
3087
-
3088
2573
  function vaultIndexPut(_x26, _x27) {
3089
2574
  return _vaultIndexPut.apply(this, arguments);
3090
2575
  }
3091
-
3092
2576
  return vaultIndexPut;
3093
- }()
3094
- /**
3095
- * inserts or updates index snapshot for the provided index owner
3096
- * @note if the index data is being inserted for a user other than the requester, use `indexOwnerUuid`
3097
- * @param entry the encrypted index snapshot
3098
- */
3099
- ;
3100
-
2577
+ }() /**
2578
+ * inserts or updates index snapshot for the provided index owner
2579
+ * @note if the index data is being inserted for a user other than the requester, use `indexOwnerUuid`
2580
+ * @param entry the encrypted index snapshot
2581
+ */;
3101
2582
  _proto.vaultIndexSnapshotPut =
3102
2583
  /*#__PURE__*/
3103
2584
  function () {
@@ -3107,7 +2588,6 @@ var VaultService = /*#__PURE__*/function () {
3107
2588
  switch (_context11.prev = _context11.next) {
3108
2589
  case 0:
3109
2590
  return _context11.abrupt("return", this.api.put(this.baseURL + "/v1/index-snapshot", entry));
3110
-
3111
2591
  case 1:
3112
2592
  case "end":
3113
2593
  return _context11.stop();
@@ -3115,23 +2595,18 @@ var VaultService = /*#__PURE__*/function () {
3115
2595
  }
3116
2596
  }, _callee11, this);
3117
2597
  }));
3118
-
3119
2598
  function vaultIndexSnapshotPut(_x28) {
3120
2599
  return _vaultIndexSnapshotPut.apply(this, arguments);
3121
2600
  }
3122
-
3123
2601
  return vaultIndexSnapshotPut;
3124
- }()
3125
- /**
3126
- * Retrieves the encrypted index from the vault for the requesting user
3127
- * @note index keys can be specified to narrow the scope of index being requested
3128
- * @param indexKeys accepted index fields determined by vault
3129
- * @param identifiers: an array of unique_hashes or consultation uuids used to identify an index entry
3130
- * @param timestamp the minimum timestamp that index entries were created
3131
- * @returns the encrypted index
3132
- */
3133
- ;
3134
-
2602
+ }() /**
2603
+ * Retrieves the encrypted index from the vault for the requesting user
2604
+ * @note index keys can be specified to narrow the scope of index being requested
2605
+ * @param indexKeys accepted index fields determined by vault
2606
+ * @param identifiers: an array of unique_hashes or consultation uuids used to identify an index entry
2607
+ * @param timestamp the minimum timestamp that index entries were created
2608
+ * @returns the encrypted index
2609
+ */;
3135
2610
  _proto.vaultIndexGet =
3136
2611
  /*#__PURE__*/
3137
2612
  function () {
@@ -3147,7 +2622,6 @@ var VaultService = /*#__PURE__*/function () {
3147
2622
  timestamp: timestamp
3148
2623
  }
3149
2624
  }));
3150
-
3151
2625
  case 1:
3152
2626
  case "end":
3153
2627
  return _context12.stop();
@@ -3155,14 +2629,11 @@ var VaultService = /*#__PURE__*/function () {
3155
2629
  }
3156
2630
  }, _callee12, this);
3157
2631
  }));
3158
-
3159
2632
  function vaultIndexGet(_x29, _x30, _x31) {
3160
2633
  return _vaultIndexGet.apply(this, arguments);
3161
2634
  }
3162
-
3163
2635
  return vaultIndexGet;
3164
2636
  }();
3165
-
3166
2637
  return VaultService;
3167
2638
  }();
3168
2639
 
@@ -3175,10 +2646,7 @@ var WorkflowService = /*#__PURE__*/function () {
3175
2646
  * This function returns all workflows
3176
2647
  * @returns desired workflow
3177
2648
  */
3178
-
3179
-
3180
2649
  var _proto = WorkflowService.prototype;
3181
-
3182
2650
  _proto.getWorkflows = function getWorkflows() {
3183
2651
  return this.api.get(this.v1Url + "/workflows");
3184
2652
  }
@@ -3189,9 +2657,7 @@ var WorkflowService = /*#__PURE__*/function () {
3189
2657
  * @param locale (optional) The desired locale of the workflow (default: 'en')
3190
2658
  * @param createdAt (optional) The creation date of the workflow (also used for versionning)
3191
2659
  * @returns desired workflow
3192
- */
3193
- ;
3194
-
2660
+ */;
3195
2661
  _proto.getWorkflow = function getWorkflow(id, locale, createdAt) {
3196
2662
  return this.api.get(this.v1Url + "/workflows/" + id, {
3197
2663
  params: {
@@ -3200,7 +2666,6 @@ var WorkflowService = /*#__PURE__*/function () {
3200
2666
  }
3201
2667
  });
3202
2668
  };
3203
-
3204
2669
  return WorkflowService;
3205
2670
  }();
3206
2671
 
@@ -3211,20 +2676,18 @@ var WorkflowService = /*#__PURE__*/function () {
3211
2676
  * @param useLocalStorage (default: true) if true store tokens into local storage (only for browsers)
3212
2677
  * @returns an instance of each services with a provided url
3213
2678
  */
3214
-
3215
2679
  var init = function init(services, authenticationCallback, useLocalStorage) {
3216
2680
  if (useLocalStorage === void 0) {
3217
2681
  useLocalStorage = true;
3218
2682
  }
3219
-
3220
2683
  var tellerBaseURL = services.tellerBaseURL,
3221
- practiceBaseURL = services.practiceBaseURL,
3222
- consultBaseURL = services.consultBaseURL,
3223
- vaultBaseURL = services.vaultBaseURL,
3224
- guardBaseURL = services.guardBaseURL,
3225
- searchBaseURL = services.searchBaseURL,
3226
- workflowBaseURL = services.workflowBaseURL,
3227
- diagnosisBaseURL = services.diagnosisBaseURL;
2684
+ practiceBaseURL = services.practiceBaseURL,
2685
+ consultBaseURL = services.consultBaseURL,
2686
+ vaultBaseURL = services.vaultBaseURL,
2687
+ guardBaseURL = services.guardBaseURL,
2688
+ searchBaseURL = services.searchBaseURL,
2689
+ workflowBaseURL = services.workflowBaseURL,
2690
+ diagnosisBaseURL = services.diagnosisBaseURL;
3228
2691
  var apiService = new APIService(useLocalStorage, undefined, authenticationCallback);
3229
2692
  return {
3230
2693
  apiService: apiService,