oro-sdk-apis 3.2.7 → 3.3.0

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