oro-sdk 3.15.0 → 3.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,6 +9,351 @@ var initApis__default = _interopDefault(initApis);
9
9
  var oroToolbox = require('oro-toolbox');
10
10
  var idbKeyval = require('idb-keyval');
11
11
 
12
+ function _regeneratorRuntime() {
13
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
14
+
15
+ _regeneratorRuntime = function () {
16
+ return exports;
17
+ };
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
+
27
+ function define(obj, key, value) {
28
+ return Object.defineProperty(obj, key, {
29
+ value: value,
30
+ enumerable: !0,
31
+ configurable: !0,
32
+ writable: !0
33
+ }), obj[key];
34
+ }
35
+
36
+ try {
37
+ define({}, "");
38
+ } catch (err) {
39
+ define = function (obj, key, value) {
40
+ return obj[key] = value;
41
+ };
42
+ }
43
+
44
+ function wrap(innerFn, outerFn, self, tryLocsList) {
45
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
46
+ generator = Object.create(protoGenerator.prototype),
47
+ context = new Context(tryLocsList || []);
48
+ return generator._invoke = function (innerFn, self, context) {
49
+ var state = "suspendedStart";
50
+ return function (method, arg) {
51
+ if ("executing" === state) throw new Error("Generator is already running");
52
+
53
+ if ("completed" === state) {
54
+ if ("throw" === method) throw arg;
55
+ return doneResult();
56
+ }
57
+
58
+ for (context.method = method, context.arg = arg;;) {
59
+ var delegate = context.delegate;
60
+
61
+ if (delegate) {
62
+ var delegateResult = maybeInvokeDelegate(delegate, context);
63
+
64
+ if (delegateResult) {
65
+ if (delegateResult === ContinueSentinel) continue;
66
+ return delegateResult;
67
+ }
68
+ }
69
+
70
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
71
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
72
+ context.dispatchException(context.arg);
73
+ } else "return" === context.method && context.abrupt("return", context.arg);
74
+ state = "executing";
75
+ var record = tryCatch(innerFn, self, context);
76
+
77
+ if ("normal" === record.type) {
78
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
79
+ return {
80
+ value: record.arg,
81
+ done: context.done
82
+ };
83
+ }
84
+
85
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
86
+ }
87
+ };
88
+ }(innerFn, self, context), generator;
89
+ }
90
+
91
+ function tryCatch(fn, obj, arg) {
92
+ try {
93
+ return {
94
+ type: "normal",
95
+ arg: fn.call(obj, arg)
96
+ };
97
+ } catch (err) {
98
+ return {
99
+ type: "throw",
100
+ arg: err
101
+ };
102
+ }
103
+ }
104
+
105
+ exports.wrap = wrap;
106
+ var ContinueSentinel = {};
107
+
108
+ function Generator() {}
109
+
110
+ function GeneratorFunction() {}
111
+
112
+ function GeneratorFunctionPrototype() {}
113
+
114
+ var IteratorPrototype = {};
115
+ define(IteratorPrototype, iteratorSymbol, function () {
116
+ return this;
117
+ });
118
+ var getProto = Object.getPrototypeOf,
119
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
120
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
121
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
122
+
123
+ function defineIteratorMethods(prototype) {
124
+ ["next", "throw", "return"].forEach(function (method) {
125
+ define(prototype, method, function (arg) {
126
+ return this._invoke(method, arg);
127
+ });
128
+ });
129
+ }
130
+
131
+ function AsyncIterator(generator, PromiseImpl) {
132
+ function invoke(method, arg, resolve, reject) {
133
+ var record = tryCatch(generator[method], generator, arg);
134
+
135
+ if ("throw" !== record.type) {
136
+ var result = record.arg,
137
+ value = result.value;
138
+ return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
139
+ invoke("next", value, resolve, reject);
140
+ }, function (err) {
141
+ invoke("throw", err, resolve, reject);
142
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
143
+ result.value = unwrapped, resolve(result);
144
+ }, function (error) {
145
+ return invoke("throw", error, resolve, reject);
146
+ });
147
+ }
148
+
149
+ reject(record.arg);
150
+ }
151
+
152
+ var previousPromise;
153
+
154
+ this._invoke = function (method, arg) {
155
+ function callInvokeWithMethodAndArg() {
156
+ return new PromiseImpl(function (resolve, reject) {
157
+ invoke(method, arg, resolve, reject);
158
+ });
159
+ }
160
+
161
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
162
+ };
163
+ }
164
+
165
+ function maybeInvokeDelegate(delegate, context) {
166
+ var method = delegate.iterator[context.method];
167
+
168
+ if (undefined === method) {
169
+ if (context.delegate = null, "throw" === context.method) {
170
+ if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
171
+ context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
172
+ }
173
+
174
+ return ContinueSentinel;
175
+ }
176
+
177
+ var record = tryCatch(method, delegate.iterator, context.arg);
178
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
179
+ var info = record.arg;
180
+ 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);
181
+ }
182
+
183
+ function pushTryEntry(locs) {
184
+ var entry = {
185
+ tryLoc: locs[0]
186
+ };
187
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
188
+ }
189
+
190
+ function resetTryEntry(entry) {
191
+ var record = entry.completion || {};
192
+ record.type = "normal", delete record.arg, entry.completion = record;
193
+ }
194
+
195
+ function Context(tryLocsList) {
196
+ this.tryEntries = [{
197
+ tryLoc: "root"
198
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
199
+ }
200
+
201
+ function values(iterable) {
202
+ if (iterable) {
203
+ var iteratorMethod = iterable[iteratorSymbol];
204
+ if (iteratorMethod) return iteratorMethod.call(iterable);
205
+ if ("function" == typeof iterable.next) return iterable;
206
+
207
+ if (!isNaN(iterable.length)) {
208
+ var i = -1,
209
+ next = function next() {
210
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
211
+
212
+ return next.value = undefined, next.done = !0, next;
213
+ };
214
+
215
+ return next.next = next;
216
+ }
217
+ }
218
+
219
+ return {
220
+ next: doneResult
221
+ };
222
+ }
223
+
224
+ function doneResult() {
225
+ return {
226
+ value: undefined,
227
+ done: !0
228
+ };
229
+ }
230
+
231
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
232
+ var ctor = "function" == typeof genFun && genFun.constructor;
233
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
234
+ }, exports.mark = function (genFun) {
235
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
236
+ }, exports.awrap = function (arg) {
237
+ return {
238
+ __await: arg
239
+ };
240
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
241
+ return this;
242
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
243
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
244
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
245
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
246
+ return result.done ? result.value : iter.next();
247
+ });
248
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
249
+ return this;
250
+ }), define(Gp, "toString", function () {
251
+ return "[object Generator]";
252
+ }), exports.keys = function (object) {
253
+ var keys = [];
254
+
255
+ for (var key in object) keys.push(key);
256
+
257
+ return keys.reverse(), function next() {
258
+ for (; keys.length;) {
259
+ var key = keys.pop();
260
+ if (key in object) return next.value = key, next.done = !1, next;
261
+ }
262
+
263
+ return next.done = !0, next;
264
+ };
265
+ }, exports.values = values, Context.prototype = {
266
+ constructor: Context,
267
+ reset: function (skipTempReset) {
268
+ 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);
269
+ },
270
+ stop: function () {
271
+ this.done = !0;
272
+ var rootRecord = this.tryEntries[0].completion;
273
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
274
+ return this.rval;
275
+ },
276
+ dispatchException: function (exception) {
277
+ if (this.done) throw exception;
278
+ var context = this;
279
+
280
+ function handle(loc, caught) {
281
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
282
+ }
283
+
284
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
285
+ var entry = this.tryEntries[i],
286
+ record = entry.completion;
287
+ if ("root" === entry.tryLoc) return handle("end");
288
+
289
+ if (entry.tryLoc <= this.prev) {
290
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
291
+ hasFinally = hasOwn.call(entry, "finallyLoc");
292
+
293
+ if (hasCatch && hasFinally) {
294
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
295
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
296
+ } else if (hasCatch) {
297
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
298
+ } else {
299
+ if (!hasFinally) throw new Error("try statement without catch or finally");
300
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
301
+ }
302
+ }
303
+ }
304
+ },
305
+ abrupt: function (type, arg) {
306
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
307
+ var entry = this.tryEntries[i];
308
+
309
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
310
+ var finallyEntry = entry;
311
+ break;
312
+ }
313
+ }
314
+
315
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
316
+ var record = finallyEntry ? finallyEntry.completion : {};
317
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
318
+ },
319
+ complete: function (record, afterLoc) {
320
+ if ("throw" === record.type) throw record.arg;
321
+ 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;
322
+ },
323
+ finish: function (finallyLoc) {
324
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
325
+ var entry = this.tryEntries[i];
326
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
327
+ }
328
+ },
329
+ catch: function (tryLoc) {
330
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
331
+ var entry = this.tryEntries[i];
332
+
333
+ if (entry.tryLoc === tryLoc) {
334
+ var record = entry.completion;
335
+
336
+ if ("throw" === record.type) {
337
+ var thrown = record.arg;
338
+ resetTryEntry(entry);
339
+ }
340
+
341
+ return thrown;
342
+ }
343
+ }
344
+
345
+ throw new Error("illegal catch attempt");
346
+ },
347
+ delegateYield: function (iterable, resultName, nextLoc) {
348
+ return this.delegate = {
349
+ iterator: values(iterable),
350
+ resultName: resultName,
351
+ nextLoc: nextLoc
352
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
353
+ }
354
+ }, exports;
355
+ }
356
+
12
357
  function _wrapRegExp() {
13
358
  _wrapRegExp = function (re, groups) {
14
359
  return new BabelRegExp(re, void 0, groups);
@@ -125,913 +470,153 @@ function _inherits(subClass, superClass) {
125
470
  });
126
471
  Object.defineProperty(subClass, "prototype", {
127
472
  writable: false
128
- });
129
- if (superClass) _setPrototypeOf(subClass, superClass);
130
- }
131
-
132
- function _inheritsLoose(subClass, superClass) {
133
- subClass.prototype = Object.create(superClass.prototype);
134
- subClass.prototype.constructor = subClass;
135
-
136
- _setPrototypeOf(subClass, superClass);
137
- }
138
-
139
- function _getPrototypeOf(o) {
140
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
141
- return o.__proto__ || Object.getPrototypeOf(o);
142
- };
143
- return _getPrototypeOf(o);
144
- }
145
-
146
- function _setPrototypeOf(o, p) {
147
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
148
- o.__proto__ = p;
149
- return o;
150
- };
151
-
152
- return _setPrototypeOf(o, p);
153
- }
154
-
155
- function _isNativeReflectConstruct() {
156
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
157
- if (Reflect.construct.sham) return false;
158
- if (typeof Proxy === "function") return true;
159
-
160
- try {
161
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
162
- return true;
163
- } catch (e) {
164
- return false;
165
- }
166
- }
167
-
168
- function _construct(Parent, args, Class) {
169
- if (_isNativeReflectConstruct()) {
170
- _construct = Reflect.construct;
171
- } else {
172
- _construct = function _construct(Parent, args, Class) {
173
- var a = [null];
174
- a.push.apply(a, args);
175
- var Constructor = Function.bind.apply(Parent, a);
176
- var instance = new Constructor();
177
- if (Class) _setPrototypeOf(instance, Class.prototype);
178
- return instance;
179
- };
180
- }
181
-
182
- return _construct.apply(null, arguments);
183
- }
184
-
185
- function _isNativeFunction(fn) {
186
- return Function.toString.call(fn).indexOf("[native code]") !== -1;
187
- }
188
-
189
- function _wrapNativeSuper(Class) {
190
- var _cache = typeof Map === "function" ? new Map() : undefined;
191
-
192
- _wrapNativeSuper = function _wrapNativeSuper(Class) {
193
- if (Class === null || !_isNativeFunction(Class)) return Class;
194
-
195
- if (typeof Class !== "function") {
196
- throw new TypeError("Super expression must either be null or a function");
197
- }
198
-
199
- if (typeof _cache !== "undefined") {
200
- if (_cache.has(Class)) return _cache.get(Class);
201
-
202
- _cache.set(Class, Wrapper);
203
- }
204
-
205
- function Wrapper() {
206
- return _construct(Class, arguments, _getPrototypeOf(this).constructor);
207
- }
208
-
209
- Wrapper.prototype = Object.create(Class.prototype, {
210
- constructor: {
211
- value: Wrapper,
212
- enumerable: false,
213
- writable: true,
214
- configurable: true
215
- }
216
- });
217
- return _setPrototypeOf(Wrapper, Class);
218
- };
219
-
220
- return _wrapNativeSuper(Class);
221
- }
222
-
223
- function _objectWithoutPropertiesLoose(source, excluded) {
224
- if (source == null) return {};
225
- var target = {};
226
- var sourceKeys = Object.keys(source);
227
- var key, i;
228
-
229
- for (i = 0; i < sourceKeys.length; i++) {
230
- key = sourceKeys[i];
231
- if (excluded.indexOf(key) >= 0) continue;
232
- target[key] = source[key];
233
- }
234
-
235
- return target;
236
- }
237
-
238
- function _unsupportedIterableToArray(o, minLen) {
239
- if (!o) return;
240
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
241
- var n = Object.prototype.toString.call(o).slice(8, -1);
242
- if (n === "Object" && o.constructor) n = o.constructor.name;
243
- if (n === "Map" || n === "Set") return Array.from(o);
244
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
245
- }
246
-
247
- function _arrayLikeToArray(arr, len) {
248
- if (len == null || len > arr.length) len = arr.length;
249
-
250
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
251
-
252
- return arr2;
253
- }
254
-
255
- function _createForOfIteratorHelperLoose(o, allowArrayLike) {
256
- var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
257
- if (it) return (it = it.call(o)).next.bind(it);
258
-
259
- if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
260
- if (it) o = it;
261
- var i = 0;
262
- return function () {
263
- if (i >= o.length) return {
264
- done: true
265
- };
266
- return {
267
- done: false,
268
- value: o[i++]
269
- };
270
- };
271
- }
272
-
273
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
274
- }
275
-
276
- function createCommonjsModule(fn, module) {
277
- return module = { exports: {} }, fn(module, module.exports), module.exports;
278
- }
279
-
280
- var runtime_1 = createCommonjsModule(function (module) {
281
- /**
282
- * Copyright (c) 2014-present, Facebook, Inc.
283
- *
284
- * This source code is licensed under the MIT license found in the
285
- * LICENSE file in the root directory of this source tree.
286
- */
287
-
288
- var runtime = (function (exports) {
289
-
290
- var Op = Object.prototype;
291
- var hasOwn = Op.hasOwnProperty;
292
- var undefined$1; // More compressible than void 0.
293
- var $Symbol = typeof Symbol === "function" ? Symbol : {};
294
- var iteratorSymbol = $Symbol.iterator || "@@iterator";
295
- var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
296
- var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
297
-
298
- function define(obj, key, value) {
299
- Object.defineProperty(obj, key, {
300
- value: value,
301
- enumerable: true,
302
- configurable: true,
303
- writable: true
304
- });
305
- return obj[key];
306
- }
307
- try {
308
- // IE 8 has a broken Object.defineProperty that only works on DOM objects.
309
- define({}, "");
310
- } catch (err) {
311
- define = function(obj, key, value) {
312
- return obj[key] = value;
313
- };
314
- }
315
-
316
- function wrap(innerFn, outerFn, self, tryLocsList) {
317
- // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
318
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
319
- var generator = Object.create(protoGenerator.prototype);
320
- var context = new Context(tryLocsList || []);
321
-
322
- // The ._invoke method unifies the implementations of the .next,
323
- // .throw, and .return methods.
324
- generator._invoke = makeInvokeMethod(innerFn, self, context);
325
-
326
- return generator;
327
- }
328
- exports.wrap = wrap;
329
-
330
- // Try/catch helper to minimize deoptimizations. Returns a completion
331
- // record like context.tryEntries[i].completion. This interface could
332
- // have been (and was previously) designed to take a closure to be
333
- // invoked without arguments, but in all the cases we care about we
334
- // already have an existing method we want to call, so there's no need
335
- // to create a new function object. We can even get away with assuming
336
- // the method takes exactly one argument, since that happens to be true
337
- // in every case, so we don't have to touch the arguments object. The
338
- // only additional allocation required is the completion record, which
339
- // has a stable shape and so hopefully should be cheap to allocate.
340
- function tryCatch(fn, obj, arg) {
341
- try {
342
- return { type: "normal", arg: fn.call(obj, arg) };
343
- } catch (err) {
344
- return { type: "throw", arg: err };
345
- }
346
- }
347
-
348
- var GenStateSuspendedStart = "suspendedStart";
349
- var GenStateSuspendedYield = "suspendedYield";
350
- var GenStateExecuting = "executing";
351
- var GenStateCompleted = "completed";
352
-
353
- // Returning this object from the innerFn has the same effect as
354
- // breaking out of the dispatch switch statement.
355
- var ContinueSentinel = {};
356
-
357
- // Dummy constructor functions that we use as the .constructor and
358
- // .constructor.prototype properties for functions that return Generator
359
- // objects. For full spec compliance, you may wish to configure your
360
- // minifier not to mangle the names of these two functions.
361
- function Generator() {}
362
- function GeneratorFunction() {}
363
- function GeneratorFunctionPrototype() {}
364
-
365
- // This is a polyfill for %IteratorPrototype% for environments that
366
- // don't natively support it.
367
- var IteratorPrototype = {};
368
- define(IteratorPrototype, iteratorSymbol, function () {
369
- return this;
370
- });
371
-
372
- var getProto = Object.getPrototypeOf;
373
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
374
- if (NativeIteratorPrototype &&
375
- NativeIteratorPrototype !== Op &&
376
- hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
377
- // This environment has a native %IteratorPrototype%; use it instead
378
- // of the polyfill.
379
- IteratorPrototype = NativeIteratorPrototype;
380
- }
381
-
382
- var Gp = GeneratorFunctionPrototype.prototype =
383
- Generator.prototype = Object.create(IteratorPrototype);
384
- GeneratorFunction.prototype = GeneratorFunctionPrototype;
385
- define(Gp, "constructor", GeneratorFunctionPrototype);
386
- define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
387
- GeneratorFunction.displayName = define(
388
- GeneratorFunctionPrototype,
389
- toStringTagSymbol,
390
- "GeneratorFunction"
391
- );
392
-
393
- // Helper for defining the .next, .throw, and .return methods of the
394
- // Iterator interface in terms of a single ._invoke method.
395
- function defineIteratorMethods(prototype) {
396
- ["next", "throw", "return"].forEach(function(method) {
397
- define(prototype, method, function(arg) {
398
- return this._invoke(method, arg);
399
- });
400
- });
401
- }
402
-
403
- exports.isGeneratorFunction = function(genFun) {
404
- var ctor = typeof genFun === "function" && genFun.constructor;
405
- return ctor
406
- ? ctor === GeneratorFunction ||
407
- // For the native GeneratorFunction constructor, the best we can
408
- // do is to check its .name property.
409
- (ctor.displayName || ctor.name) === "GeneratorFunction"
410
- : false;
411
- };
412
-
413
- exports.mark = function(genFun) {
414
- if (Object.setPrototypeOf) {
415
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
416
- } else {
417
- genFun.__proto__ = GeneratorFunctionPrototype;
418
- define(genFun, toStringTagSymbol, "GeneratorFunction");
419
- }
420
- genFun.prototype = Object.create(Gp);
421
- return genFun;
422
- };
423
-
424
- // Within the body of any async function, `await x` is transformed to
425
- // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
426
- // `hasOwn.call(value, "__await")` to determine if the yielded value is
427
- // meant to be awaited.
428
- exports.awrap = function(arg) {
429
- return { __await: arg };
430
- };
431
-
432
- function AsyncIterator(generator, PromiseImpl) {
433
- function invoke(method, arg, resolve, reject) {
434
- var record = tryCatch(generator[method], generator, arg);
435
- if (record.type === "throw") {
436
- reject(record.arg);
437
- } else {
438
- var result = record.arg;
439
- var value = result.value;
440
- if (value &&
441
- typeof value === "object" &&
442
- hasOwn.call(value, "__await")) {
443
- return PromiseImpl.resolve(value.__await).then(function(value) {
444
- invoke("next", value, resolve, reject);
445
- }, function(err) {
446
- invoke("throw", err, resolve, reject);
447
- });
448
- }
449
-
450
- return PromiseImpl.resolve(value).then(function(unwrapped) {
451
- // When a yielded Promise is resolved, its final value becomes
452
- // the .value of the Promise<{value,done}> result for the
453
- // current iteration.
454
- result.value = unwrapped;
455
- resolve(result);
456
- }, function(error) {
457
- // If a rejected Promise was yielded, throw the rejection back
458
- // into the async generator function so it can be handled there.
459
- return invoke("throw", error, resolve, reject);
460
- });
461
- }
462
- }
463
-
464
- var previousPromise;
465
-
466
- function enqueue(method, arg) {
467
- function callInvokeWithMethodAndArg() {
468
- return new PromiseImpl(function(resolve, reject) {
469
- invoke(method, arg, resolve, reject);
470
- });
471
- }
472
-
473
- return previousPromise =
474
- // If enqueue has been called before, then we want to wait until
475
- // all previous Promises have been resolved before calling invoke,
476
- // so that results are always delivered in the correct order. If
477
- // enqueue has not been called before, then it is important to
478
- // call invoke immediately, without waiting on a callback to fire,
479
- // so that the async generator function has the opportunity to do
480
- // any necessary setup in a predictable way. This predictability
481
- // is why the Promise constructor synchronously invokes its
482
- // executor callback, and why async functions synchronously
483
- // execute code before the first await. Since we implement simple
484
- // async functions in terms of async generators, it is especially
485
- // important to get this right, even though it requires care.
486
- previousPromise ? previousPromise.then(
487
- callInvokeWithMethodAndArg,
488
- // Avoid propagating failures to Promises returned by later
489
- // invocations of the iterator.
490
- callInvokeWithMethodAndArg
491
- ) : callInvokeWithMethodAndArg();
492
- }
493
-
494
- // Define the unified helper method that is used to implement .next,
495
- // .throw, and .return (see defineIteratorMethods).
496
- this._invoke = enqueue;
497
- }
498
-
499
- defineIteratorMethods(AsyncIterator.prototype);
500
- define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
501
- return this;
502
- });
503
- exports.AsyncIterator = AsyncIterator;
504
-
505
- // Note that simple async functions are implemented on top of
506
- // AsyncIterator objects; they just return a Promise for the value of
507
- // the final result produced by the iterator.
508
- exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
509
- if (PromiseImpl === void 0) PromiseImpl = Promise;
510
-
511
- var iter = new AsyncIterator(
512
- wrap(innerFn, outerFn, self, tryLocsList),
513
- PromiseImpl
514
- );
515
-
516
- return exports.isGeneratorFunction(outerFn)
517
- ? iter // If outerFn is a generator, return the full iterator.
518
- : iter.next().then(function(result) {
519
- return result.done ? result.value : iter.next();
520
- });
521
- };
522
-
523
- function makeInvokeMethod(innerFn, self, context) {
524
- var state = GenStateSuspendedStart;
525
-
526
- return function invoke(method, arg) {
527
- if (state === GenStateExecuting) {
528
- throw new Error("Generator is already running");
529
- }
530
-
531
- if (state === GenStateCompleted) {
532
- if (method === "throw") {
533
- throw arg;
534
- }
535
-
536
- // Be forgiving, per 25.3.3.3.3 of the spec:
537
- // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
538
- return doneResult();
539
- }
540
-
541
- context.method = method;
542
- context.arg = arg;
543
-
544
- while (true) {
545
- var delegate = context.delegate;
546
- if (delegate) {
547
- var delegateResult = maybeInvokeDelegate(delegate, context);
548
- if (delegateResult) {
549
- if (delegateResult === ContinueSentinel) continue;
550
- return delegateResult;
551
- }
552
- }
553
-
554
- if (context.method === "next") {
555
- // Setting context._sent for legacy support of Babel's
556
- // function.sent implementation.
557
- context.sent = context._sent = context.arg;
558
-
559
- } else if (context.method === "throw") {
560
- if (state === GenStateSuspendedStart) {
561
- state = GenStateCompleted;
562
- throw context.arg;
563
- }
564
-
565
- context.dispatchException(context.arg);
566
-
567
- } else if (context.method === "return") {
568
- context.abrupt("return", context.arg);
569
- }
570
-
571
- state = GenStateExecuting;
572
-
573
- var record = tryCatch(innerFn, self, context);
574
- if (record.type === "normal") {
575
- // If an exception is thrown from innerFn, we leave state ===
576
- // GenStateExecuting and loop back for another invocation.
577
- state = context.done
578
- ? GenStateCompleted
579
- : GenStateSuspendedYield;
580
-
581
- if (record.arg === ContinueSentinel) {
582
- continue;
583
- }
584
-
585
- return {
586
- value: record.arg,
587
- done: context.done
588
- };
589
-
590
- } else if (record.type === "throw") {
591
- state = GenStateCompleted;
592
- // Dispatch the exception by looping back around to the
593
- // context.dispatchException(context.arg) call above.
594
- context.method = "throw";
595
- context.arg = record.arg;
596
- }
597
- }
598
- };
599
- }
600
-
601
- // Call delegate.iterator[context.method](context.arg) and handle the
602
- // result, either by returning a { value, done } result from the
603
- // delegate iterator, or by modifying context.method and context.arg,
604
- // setting context.delegate to null, and returning the ContinueSentinel.
605
- function maybeInvokeDelegate(delegate, context) {
606
- var method = delegate.iterator[context.method];
607
- if (method === undefined$1) {
608
- // A .throw or .return when the delegate iterator has no .throw
609
- // method always terminates the yield* loop.
610
- context.delegate = null;
611
-
612
- if (context.method === "throw") {
613
- // Note: ["return"] must be used for ES3 parsing compatibility.
614
- if (delegate.iterator["return"]) {
615
- // If the delegate iterator has a return method, give it a
616
- // chance to clean up.
617
- context.method = "return";
618
- context.arg = undefined$1;
619
- maybeInvokeDelegate(delegate, context);
620
-
621
- if (context.method === "throw") {
622
- // If maybeInvokeDelegate(context) changed context.method from
623
- // "return" to "throw", let that override the TypeError below.
624
- return ContinueSentinel;
625
- }
626
- }
627
-
628
- context.method = "throw";
629
- context.arg = new TypeError(
630
- "The iterator does not provide a 'throw' method");
631
- }
632
-
633
- return ContinueSentinel;
634
- }
635
-
636
- var record = tryCatch(method, delegate.iterator, context.arg);
637
-
638
- if (record.type === "throw") {
639
- context.method = "throw";
640
- context.arg = record.arg;
641
- context.delegate = null;
642
- return ContinueSentinel;
643
- }
644
-
645
- var info = record.arg;
646
-
647
- if (! info) {
648
- context.method = "throw";
649
- context.arg = new TypeError("iterator result is not an object");
650
- context.delegate = null;
651
- return ContinueSentinel;
652
- }
653
-
654
- if (info.done) {
655
- // Assign the result of the finished delegate to the temporary
656
- // variable specified by delegate.resultName (see delegateYield).
657
- context[delegate.resultName] = info.value;
658
-
659
- // Resume execution at the desired location (see delegateYield).
660
- context.next = delegate.nextLoc;
661
-
662
- // If context.method was "throw" but the delegate handled the
663
- // exception, let the outer generator proceed normally. If
664
- // context.method was "next", forget context.arg since it has been
665
- // "consumed" by the delegate iterator. If context.method was
666
- // "return", allow the original .return call to continue in the
667
- // outer generator.
668
- if (context.method !== "return") {
669
- context.method = "next";
670
- context.arg = undefined$1;
671
- }
672
-
673
- } else {
674
- // Re-yield the result returned by the delegate method.
675
- return info;
676
- }
677
-
678
- // The delegate iterator is finished, so forget it and continue with
679
- // the outer generator.
680
- context.delegate = null;
681
- return ContinueSentinel;
682
- }
683
-
684
- // Define Generator.prototype.{next,throw,return} in terms of the
685
- // unified ._invoke helper method.
686
- defineIteratorMethods(Gp);
687
-
688
- define(Gp, toStringTagSymbol, "Generator");
689
-
690
- // A Generator should always return itself as the iterator object when the
691
- // @@iterator function is called on it. Some browsers' implementations of the
692
- // iterator prototype chain incorrectly implement this, causing the Generator
693
- // object to not be returned from this call. This ensures that doesn't happen.
694
- // See https://github.com/facebook/regenerator/issues/274 for more details.
695
- define(Gp, iteratorSymbol, function() {
696
- return this;
697
- });
698
-
699
- define(Gp, "toString", function() {
700
- return "[object Generator]";
701
- });
702
-
703
- function pushTryEntry(locs) {
704
- var entry = { tryLoc: locs[0] };
705
-
706
- if (1 in locs) {
707
- entry.catchLoc = locs[1];
708
- }
709
-
710
- if (2 in locs) {
711
- entry.finallyLoc = locs[2];
712
- entry.afterLoc = locs[3];
713
- }
714
-
715
- this.tryEntries.push(entry);
716
- }
717
-
718
- function resetTryEntry(entry) {
719
- var record = entry.completion || {};
720
- record.type = "normal";
721
- delete record.arg;
722
- entry.completion = record;
723
- }
724
-
725
- function Context(tryLocsList) {
726
- // The root entry object (effectively a try statement without a catch
727
- // or a finally block) gives us a place to store values thrown from
728
- // locations where there is no enclosing try statement.
729
- this.tryEntries = [{ tryLoc: "root" }];
730
- tryLocsList.forEach(pushTryEntry, this);
731
- this.reset(true);
732
- }
733
-
734
- exports.keys = function(object) {
735
- var keys = [];
736
- for (var key in object) {
737
- keys.push(key);
738
- }
739
- keys.reverse();
740
-
741
- // Rather than returning an object with a next method, we keep
742
- // things simple and return the next function itself.
743
- return function next() {
744
- while (keys.length) {
745
- var key = keys.pop();
746
- if (key in object) {
747
- next.value = key;
748
- next.done = false;
749
- return next;
750
- }
751
- }
752
-
753
- // To avoid creating an additional object, we just hang the .value
754
- // and .done properties off the next function object itself. This
755
- // also ensures that the minifier will not anonymize the function.
756
- next.done = true;
757
- return next;
758
- };
759
- };
760
-
761
- function values(iterable) {
762
- if (iterable) {
763
- var iteratorMethod = iterable[iteratorSymbol];
764
- if (iteratorMethod) {
765
- return iteratorMethod.call(iterable);
766
- }
767
-
768
- if (typeof iterable.next === "function") {
769
- return iterable;
770
- }
771
-
772
- if (!isNaN(iterable.length)) {
773
- var i = -1, next = function next() {
774
- while (++i < iterable.length) {
775
- if (hasOwn.call(iterable, i)) {
776
- next.value = iterable[i];
777
- next.done = false;
778
- return next;
779
- }
780
- }
781
-
782
- next.value = undefined$1;
783
- next.done = true;
784
-
785
- return next;
786
- };
787
-
788
- return next.next = next;
789
- }
790
- }
791
-
792
- // Return an iterator with no values.
793
- return { next: doneResult };
794
- }
795
- exports.values = values;
796
-
797
- function doneResult() {
798
- return { value: undefined$1, done: true };
799
- }
473
+ });
474
+ if (superClass) _setPrototypeOf(subClass, superClass);
475
+ }
800
476
 
801
- Context.prototype = {
802
- constructor: Context,
477
+ function _inheritsLoose(subClass, superClass) {
478
+ subClass.prototype = Object.create(superClass.prototype);
479
+ subClass.prototype.constructor = subClass;
803
480
 
804
- reset: function(skipTempReset) {
805
- this.prev = 0;
806
- this.next = 0;
807
- // Resetting context._sent for legacy support of Babel's
808
- // function.sent implementation.
809
- this.sent = this._sent = undefined$1;
810
- this.done = false;
811
- this.delegate = null;
812
-
813
- this.method = "next";
814
- this.arg = undefined$1;
815
-
816
- this.tryEntries.forEach(resetTryEntry);
817
-
818
- if (!skipTempReset) {
819
- for (var name in this) {
820
- // Not sure about the optimal order of these conditions:
821
- if (name.charAt(0) === "t" &&
822
- hasOwn.call(this, name) &&
823
- !isNaN(+name.slice(1))) {
824
- this[name] = undefined$1;
825
- }
826
- }
827
- }
828
- },
481
+ _setPrototypeOf(subClass, superClass);
482
+ }
829
483
 
830
- stop: function() {
831
- this.done = true;
484
+ function _getPrototypeOf(o) {
485
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
486
+ return o.__proto__ || Object.getPrototypeOf(o);
487
+ };
488
+ return _getPrototypeOf(o);
489
+ }
832
490
 
833
- var rootEntry = this.tryEntries[0];
834
- var rootRecord = rootEntry.completion;
835
- if (rootRecord.type === "throw") {
836
- throw rootRecord.arg;
837
- }
491
+ function _setPrototypeOf(o, p) {
492
+ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
493
+ o.__proto__ = p;
494
+ return o;
495
+ };
838
496
 
839
- return this.rval;
840
- },
497
+ return _setPrototypeOf(o, p);
498
+ }
841
499
 
842
- dispatchException: function(exception) {
843
- if (this.done) {
844
- throw exception;
845
- }
500
+ function _isNativeReflectConstruct() {
501
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
502
+ if (Reflect.construct.sham) return false;
503
+ if (typeof Proxy === "function") return true;
846
504
 
847
- var context = this;
848
- function handle(loc, caught) {
849
- record.type = "throw";
850
- record.arg = exception;
851
- context.next = loc;
852
-
853
- if (caught) {
854
- // If the dispatched exception was caught by a catch block,
855
- // then let that catch block handle the exception normally.
856
- context.method = "next";
857
- context.arg = undefined$1;
858
- }
505
+ try {
506
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
507
+ return true;
508
+ } catch (e) {
509
+ return false;
510
+ }
511
+ }
859
512
 
860
- return !! caught;
861
- }
513
+ function _construct(Parent, args, Class) {
514
+ if (_isNativeReflectConstruct()) {
515
+ _construct = Reflect.construct;
516
+ } else {
517
+ _construct = function _construct(Parent, args, Class) {
518
+ var a = [null];
519
+ a.push.apply(a, args);
520
+ var Constructor = Function.bind.apply(Parent, a);
521
+ var instance = new Constructor();
522
+ if (Class) _setPrototypeOf(instance, Class.prototype);
523
+ return instance;
524
+ };
525
+ }
862
526
 
863
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
864
- var entry = this.tryEntries[i];
865
- var record = entry.completion;
527
+ return _construct.apply(null, arguments);
528
+ }
866
529
 
867
- if (entry.tryLoc === "root") {
868
- // Exception thrown outside of any try block that could handle
869
- // it, so set the completion value of the entire function to
870
- // throw the exception.
871
- return handle("end");
872
- }
530
+ function _isNativeFunction(fn) {
531
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
532
+ }
873
533
 
874
- if (entry.tryLoc <= this.prev) {
875
- var hasCatch = hasOwn.call(entry, "catchLoc");
876
- var hasFinally = hasOwn.call(entry, "finallyLoc");
534
+ function _wrapNativeSuper(Class) {
535
+ var _cache = typeof Map === "function" ? new Map() : undefined;
877
536
 
878
- if (hasCatch && hasFinally) {
879
- if (this.prev < entry.catchLoc) {
880
- return handle(entry.catchLoc, true);
881
- } else if (this.prev < entry.finallyLoc) {
882
- return handle(entry.finallyLoc);
883
- }
537
+ _wrapNativeSuper = function _wrapNativeSuper(Class) {
538
+ if (Class === null || !_isNativeFunction(Class)) return Class;
884
539
 
885
- } else if (hasCatch) {
886
- if (this.prev < entry.catchLoc) {
887
- return handle(entry.catchLoc, true);
888
- }
540
+ if (typeof Class !== "function") {
541
+ throw new TypeError("Super expression must either be null or a function");
542
+ }
889
543
 
890
- } else if (hasFinally) {
891
- if (this.prev < entry.finallyLoc) {
892
- return handle(entry.finallyLoc);
893
- }
544
+ if (typeof _cache !== "undefined") {
545
+ if (_cache.has(Class)) return _cache.get(Class);
894
546
 
895
- } else {
896
- throw new Error("try statement without catch or finally");
897
- }
898
- }
899
- }
900
- },
547
+ _cache.set(Class, Wrapper);
548
+ }
901
549
 
902
- abrupt: function(type, arg) {
903
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
904
- var entry = this.tryEntries[i];
905
- if (entry.tryLoc <= this.prev &&
906
- hasOwn.call(entry, "finallyLoc") &&
907
- this.prev < entry.finallyLoc) {
908
- var finallyEntry = entry;
909
- break;
910
- }
911
- }
550
+ function Wrapper() {
551
+ return _construct(Class, arguments, _getPrototypeOf(this).constructor);
552
+ }
912
553
 
913
- if (finallyEntry &&
914
- (type === "break" ||
915
- type === "continue") &&
916
- finallyEntry.tryLoc <= arg &&
917
- arg <= finallyEntry.finallyLoc) {
918
- // Ignore the finally entry if control is not jumping to a
919
- // location outside the try/catch block.
920
- finallyEntry = null;
554
+ Wrapper.prototype = Object.create(Class.prototype, {
555
+ constructor: {
556
+ value: Wrapper,
557
+ enumerable: false,
558
+ writable: true,
559
+ configurable: true
921
560
  }
561
+ });
562
+ return _setPrototypeOf(Wrapper, Class);
563
+ };
922
564
 
923
- var record = finallyEntry ? finallyEntry.completion : {};
924
- record.type = type;
925
- record.arg = arg;
565
+ return _wrapNativeSuper(Class);
566
+ }
926
567
 
927
- if (finallyEntry) {
928
- this.method = "next";
929
- this.next = finallyEntry.finallyLoc;
930
- return ContinueSentinel;
931
- }
568
+ function _objectWithoutPropertiesLoose(source, excluded) {
569
+ if (source == null) return {};
570
+ var target = {};
571
+ var sourceKeys = Object.keys(source);
572
+ var key, i;
932
573
 
933
- return this.complete(record);
934
- },
574
+ for (i = 0; i < sourceKeys.length; i++) {
575
+ key = sourceKeys[i];
576
+ if (excluded.indexOf(key) >= 0) continue;
577
+ target[key] = source[key];
578
+ }
935
579
 
936
- complete: function(record, afterLoc) {
937
- if (record.type === "throw") {
938
- throw record.arg;
939
- }
580
+ return target;
581
+ }
940
582
 
941
- if (record.type === "break" ||
942
- record.type === "continue") {
943
- this.next = record.arg;
944
- } else if (record.type === "return") {
945
- this.rval = this.arg = record.arg;
946
- this.method = "return";
947
- this.next = "end";
948
- } else if (record.type === "normal" && afterLoc) {
949
- this.next = afterLoc;
950
- }
583
+ function _unsupportedIterableToArray(o, minLen) {
584
+ if (!o) return;
585
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
586
+ var n = Object.prototype.toString.call(o).slice(8, -1);
587
+ if (n === "Object" && o.constructor) n = o.constructor.name;
588
+ if (n === "Map" || n === "Set") return Array.from(o);
589
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
590
+ }
951
591
 
952
- return ContinueSentinel;
953
- },
592
+ function _arrayLikeToArray(arr, len) {
593
+ if (len == null || len > arr.length) len = arr.length;
954
594
 
955
- finish: function(finallyLoc) {
956
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
957
- var entry = this.tryEntries[i];
958
- if (entry.finallyLoc === finallyLoc) {
959
- this.complete(entry.completion, entry.afterLoc);
960
- resetTryEntry(entry);
961
- return ContinueSentinel;
962
- }
963
- }
964
- },
595
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
965
596
 
966
- "catch": function(tryLoc) {
967
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
968
- var entry = this.tryEntries[i];
969
- if (entry.tryLoc === tryLoc) {
970
- var record = entry.completion;
971
- if (record.type === "throw") {
972
- var thrown = record.arg;
973
- resetTryEntry(entry);
974
- }
975
- return thrown;
976
- }
977
- }
597
+ return arr2;
598
+ }
978
599
 
979
- // The context.catch method must only be called with a location
980
- // argument that corresponds to a known catch block.
981
- throw new Error("illegal catch attempt");
982
- },
600
+ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
601
+ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
602
+ if (it) return (it = it.call(o)).next.bind(it);
983
603
 
984
- delegateYield: function(iterable, resultName, nextLoc) {
985
- this.delegate = {
986
- iterator: values(iterable),
987
- resultName: resultName,
988
- nextLoc: nextLoc
604
+ if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
605
+ if (it) o = it;
606
+ var i = 0;
607
+ return function () {
608
+ if (i >= o.length) return {
609
+ done: true
989
610
  };
990
-
991
- if (this.method === "next") {
992
- // Deliberately forget the last sent value so that we don't
993
- // accidentally pass it on to the delegate.
994
- this.arg = undefined$1;
995
- }
996
-
997
- return ContinueSentinel;
998
- }
999
- };
1000
-
1001
- // Regardless of whether this script is executing as a CommonJS module
1002
- // or not, return the runtime object so that we can declare the variable
1003
- // regeneratorRuntime in the outer scope, which allows this module to be
1004
- // injected easily by `bin/regenerator --include-runtime script.js`.
1005
- return exports;
1006
-
1007
- }(
1008
- // If this script is executing as a CommonJS module, use module.exports
1009
- // as the regeneratorRuntime namespace. Otherwise create a new empty
1010
- // object. Either way, the resulting object will be used to initialize
1011
- // the regeneratorRuntime variable at the top of this file.
1012
- module.exports
1013
- ));
1014
-
1015
- try {
1016
- regeneratorRuntime = runtime;
1017
- } catch (accidentalStrictMode) {
1018
- // This module should not be running in strict mode, so the above
1019
- // assignment should always work unless something is misconfigured. Just
1020
- // in case runtime.js accidentally runs in strict mode, in modern engines
1021
- // we can explicitly access globalThis. In older engines we can escape
1022
- // strict mode using a global Function call. This could conceivably fail
1023
- // if a Content Security Policy forbids using Function, but in that case
1024
- // the proper solution is to fix the accidental strict mode problem. If
1025
- // you've misconfigured your bundler to force strict mode and applied a
1026
- // CSP to forbid Function, and you're not willing to fix either of those
1027
- // problems, please detail your unique predicament in a GitHub issue.
1028
- if (typeof globalThis === "object") {
1029
- globalThis.regeneratorRuntime = runtime;
1030
- } else {
1031
- Function("r", "regeneratorRuntime = r")(runtime);
611
+ return {
612
+ done: false,
613
+ value: o[i++]
614
+ };
615
+ };
1032
616
  }
617
+
618
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1033
619
  }
1034
- });
1035
620
 
1036
621
  var _personalMetaToPrefix;
1037
622
  var personalMetaToPrefix = (_personalMetaToPrefix = {}, _personalMetaToPrefix[initApis.MetadataCategory.Personal] = 'you', _personalMetaToPrefix[initApis.MetadataCategory.ChildPersonal] = 'child', _personalMetaToPrefix[initApis.MetadataCategory.OtherPersonal] = 'other', _personalMetaToPrefix);
@@ -1201,38 +786,47 @@ var MissingGrant = /*#__PURE__*/function (_Error2) {
1201
786
 
1202
787
  return MissingGrant;
1203
788
  }( /*#__PURE__*/_wrapNativeSuper(Error));
1204
- var MissingLockbox = /*#__PURE__*/function (_Error3) {
1205
- _inheritsLoose(MissingLockbox, _Error3);
789
+ var MissingGrantFilter = /*#__PURE__*/function (_Error3) {
790
+ _inheritsLoose(MissingGrantFilter, _Error3);
1206
791
 
1207
- function MissingLockbox() {
792
+ function MissingGrantFilter() {
1208
793
  return _Error3.apply(this, arguments) || this;
1209
794
  }
1210
795
 
796
+ return MissingGrantFilter;
797
+ }( /*#__PURE__*/_wrapNativeSuper(Error));
798
+ var MissingLockbox = /*#__PURE__*/function (_Error4) {
799
+ _inheritsLoose(MissingLockbox, _Error4);
800
+
801
+ function MissingLockbox() {
802
+ return _Error4.apply(this, arguments) || this;
803
+ }
804
+
1211
805
  return MissingLockbox;
1212
806
  }( /*#__PURE__*/_wrapNativeSuper(Error));
1213
- var MissingLockboxOwner = /*#__PURE__*/function (_Error4) {
1214
- _inheritsLoose(MissingLockboxOwner, _Error4);
807
+ var MissingLockboxOwner = /*#__PURE__*/function (_Error5) {
808
+ _inheritsLoose(MissingLockboxOwner, _Error5);
1215
809
 
1216
810
  function MissingLockboxOwner() {
1217
- return _Error4.apply(this, arguments) || this;
811
+ return _Error5.apply(this, arguments) || this;
1218
812
  }
1219
813
 
1220
814
  return MissingLockboxOwner;
1221
815
  }( /*#__PURE__*/_wrapNativeSuper(Error));
1222
- var AssociatedLockboxNotFound = /*#__PURE__*/function (_Error5) {
1223
- _inheritsLoose(AssociatedLockboxNotFound, _Error5);
816
+ var AssociatedLockboxNotFound = /*#__PURE__*/function (_Error6) {
817
+ _inheritsLoose(AssociatedLockboxNotFound, _Error6);
1224
818
 
1225
819
  function AssociatedLockboxNotFound() {
1226
- return _Error5.apply(this, arguments) || this;
820
+ return _Error6.apply(this, arguments) || this;
1227
821
  }
1228
822
 
1229
823
  return AssociatedLockboxNotFound;
1230
824
  }( /*#__PURE__*/_wrapNativeSuper(Error));
1231
- var WorkflowAnswersMissingError = /*#__PURE__*/function (_Error6) {
1232
- _inheritsLoose(WorkflowAnswersMissingError, _Error6);
825
+ var WorkflowAnswersMissingError = /*#__PURE__*/function (_Error7) {
826
+ _inheritsLoose(WorkflowAnswersMissingError, _Error7);
1233
827
 
1234
828
  function WorkflowAnswersMissingError() {
1235
- return _Error6.apply(this, arguments) || this;
829
+ return _Error7.apply(this, arguments) || this;
1236
830
  }
1237
831
 
1238
832
  return WorkflowAnswersMissingError;
@@ -1252,9 +846,9 @@ function filterTriggeredAnsweredWithKind(_x, _x2) {
1252
846
  */
1253
847
 
1254
848
  function _filterTriggeredAnsweredWithKind() {
1255
- _filterTriggeredAnsweredWithKind = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(workflowData, kind) {
849
+ _filterTriggeredAnsweredWithKind = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(workflowData, kind) {
1256
850
  var flattenedAnswers, triggeredQuestionsWithKind, samePageAnswers, res;
1257
- return runtime_1.wrap(function _callee$(_context) {
851
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1258
852
  while (1) {
1259
853
  switch (_context.prev = _context.next) {
1260
854
  case 0:
@@ -1298,9 +892,9 @@ function getWorkflowDataByCategory(_x3, _x4) {
1298
892
  }
1299
893
 
1300
894
  function _getWorkflowDataByCategory() {
1301
- _getWorkflowDataByCategory = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(workflowData, category) {
895
+ _getWorkflowDataByCategory = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(workflowData, category) {
1302
896
  var flattenedAnswers, triggeredQuestions, fields;
1303
- return runtime_1.wrap(function _callee2$(_context2) {
897
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1304
898
  while (1) {
1305
899
  switch (_context2.prev = _context2.next) {
1306
900
  case 0:
@@ -1371,8 +965,8 @@ function getImagesFromIndexDb(_x5) {
1371
965
  */
1372
966
 
1373
967
  function _getImagesFromIndexDb() {
1374
- _getImagesFromIndexDb = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(answer) {
1375
- return runtime_1.wrap(function _callee3$(_context3) {
968
+ _getImagesFromIndexDb = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(answer) {
969
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
1376
970
  while (1) {
1377
971
  switch (_context3.prev = _context3.next) {
1378
972
  case 0:
@@ -1448,9 +1042,9 @@ function populateWorkflowField(_x6, _x7) {
1448
1042
 
1449
1043
 
1450
1044
  function _populateWorkflowField() {
1451
- _populateWorkflowField = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(question, answerValue) {
1045
+ _populateWorkflowField = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(question, answerValue) {
1452
1046
  var answer, displayedAnswer;
1453
- return runtime_1.wrap(function _callee4$(_context4) {
1047
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
1454
1048
  while (1) {
1455
1049
  switch (_context4.prev = _context4.next) {
1456
1050
  case 0:
@@ -1642,10 +1236,10 @@ function registerPatient(_x, _x2, _x3, _x4, _x5, _x6, _x7) {
1642
1236
  */
1643
1237
 
1644
1238
  function _registerPatient() {
1645
- _registerPatient = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(patientUuid, consultRequest, workflow, oroClient, masterKey, recoveryQA, indexSearch) {
1239
+ _registerPatient = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(patientUuid, consultRequest, workflow, oroClient, masterKey, recoveryQA, indexSearch) {
1646
1240
  var consult, lockboxUuid, practitionerAdmin, retry, identity, errorsThrown, _ret;
1647
1241
 
1648
- return runtime_1.wrap(function _callee4$(_context4) {
1242
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
1649
1243
  while (1) {
1650
1244
  switch (_context4.prev = _context4.next) {
1651
1245
  case 0:
@@ -1667,11 +1261,11 @@ function _registerPatient() {
1667
1261
  }
1668
1262
 
1669
1263
  _context4.prev = 8;
1670
- return _context4.delegateYield( /*#__PURE__*/runtime_1.mark(function _callee3() {
1264
+ return _context4.delegateYield( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
1671
1265
  var _consultIndex, _identity, _identity2;
1672
1266
 
1673
1267
  var practitioners, grantPromises, consultIndex, consultIndexPromises;
1674
- return runtime_1.wrap(function _callee3$(_context3) {
1268
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
1675
1269
  while (1) {
1676
1270
  switch (_context3.prev = _context3.next) {
1677
1271
  case 0:
@@ -1742,7 +1336,6 @@ function _registerPatient() {
1742
1336
  return oroClient.grantLockbox(practitionerAdmin, lockboxUuid)["catch"](function (err) {
1743
1337
  console.error("Error while granting lockbox to practitioner admin " + practitionerAdmin, err); // if we cannot grant to the admin, then the registration will fail
1744
1338
 
1745
- // if we cannot grant to the admin, then the registration will fail
1746
1339
  errorsThrown.push(err);
1747
1340
  });
1748
1341
 
@@ -1751,15 +1344,14 @@ function _registerPatient() {
1751
1344
  grantPromises = practitioners.filter(function (practitioner) {
1752
1345
  return practitioner.uuid !== practitionerAdmin;
1753
1346
  }).map( /*#__PURE__*/function () {
1754
- var _ref = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(practitioner) {
1755
- return runtime_1.wrap(function _callee$(_context) {
1347
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(practitioner) {
1348
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1756
1349
  while (1) {
1757
1350
  switch (_context.prev = _context.next) {
1758
1351
  case 0:
1759
1352
  return _context.abrupt("return", oroClient.grantLockbox(practitioner.uuid, lockboxUuid)["catch"](function (err) {
1760
1353
  console.error("Error while granting lockbox to practitioner", err); // Acceptable to continue as admin has already been granted, but we should still retry until the last retry remains
1761
1354
 
1762
- // Acceptable to continue as admin has already been granted, but we should still retry until the last retry remains
1763
1355
  if (retry <= 1) return;
1764
1356
  errorsThrown.push(err);
1765
1357
  }));
@@ -1785,15 +1377,14 @@ function _registerPatient() {
1785
1377
  }], _consultIndex); // the index will identify in which lockbox a consultation resides
1786
1378
 
1787
1379
  consultIndexPromises = practitioners.map( /*#__PURE__*/function () {
1788
- var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(practitioner) {
1789
- return runtime_1.wrap(function _callee2$(_context2) {
1380
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(practitioner) {
1381
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1790
1382
  while (1) {
1791
1383
  switch (_context2.prev = _context2.next) {
1792
1384
  case 0:
1793
1385
  return _context2.abrupt("return", oroClient.vaultIndexAdd(consultIndex, practitioner.uuid)["catch"](function (err) {
1794
1386
  console.error("[SDK: registration] Error while adding to the practitioner's index " + practitioner.uuid, err); // Acceptable to continue as the index can be rebuilt, but we should still retry until the last retry remains
1795
1387
 
1796
- // Acceptable to continue as the index can be rebuilt, but we should still retry until the last retry remains
1797
1388
  if (retry <= 1) return;else errorsThrown.push(err);
1798
1389
  }));
1799
1390
 
@@ -1813,7 +1404,6 @@ function _registerPatient() {
1813
1404
  return storeImageAliases(consult.uuid, lockboxUuid, workflow, oroClient)["catch"](function (err) {
1814
1405
  console.error('[SDK: registration] Some errors happened during image upload', err); // Acceptable to continue as images can be requested during the consultation, but we should still retry until the last retry remains
1815
1406
 
1816
- // Acceptable to continue as images can be requested during the consultation, but we should still retry until the last retry remains
1817
1407
  if (retry <= 1) return;else errorsThrown.push(err);
1818
1408
  });
1819
1409
 
@@ -1834,7 +1424,6 @@ function _registerPatient() {
1834
1424
  return oroClient.updateMasterKey(patientUuid, masterKey, lockboxUuid)["catch"](function (err) {
1835
1425
  console.error("[SDK: registration] Error while updating master key", err); /// it's acceptable to continue registration (return old identity)
1836
1426
 
1837
- /// it's acceptable to continue registration (return old identity)
1838
1427
  if (retry <= 1) return;
1839
1428
  errorsThrown.push(err);
1840
1429
  return identity;
@@ -1859,7 +1448,6 @@ function _registerPatient() {
1859
1448
  return oroClient.updateSecurityQuestions(patientUuid, recoveryQA.recoverySecurityQuestions, recoveryQA.recoverySecurityAnswers, 2)["catch"](function (err) {
1860
1449
  console.error("[SDK: registration] Error while updating security questions", err); /// it's acceptable to continue registration (return old identity)
1861
1450
 
1862
- /// it's acceptable to continue registration (return old identity)
1863
1451
  if (retry <= 1) return;
1864
1452
  errorsThrown.push(err);
1865
1453
  return identity;
@@ -1883,7 +1471,6 @@ function _registerPatient() {
1883
1471
  console.error('[SDK: registration] personal information not found or another error occured during search indexing', err);
1884
1472
  if (retry <= 1) return; // this statement is to avoid failing the registration due to the failure in search indexing the consult, this practically implements a soft retry
1885
1473
 
1886
- // this statement is to avoid failing the registration due to the failure in search indexing the consult, this practically implements a soft retry
1887
1474
  errorsThrown.push(err);
1888
1475
  });
1889
1476
 
@@ -1980,9 +1567,9 @@ function getOrCreatePatientConsultationUuid(_x8, _x9) {
1980
1567
 
1981
1568
 
1982
1569
  function _getOrCreatePatientConsultationUuid() {
1983
- _getOrCreatePatientConsultationUuid = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(consult, oroClient) {
1570
+ _getOrCreatePatientConsultationUuid = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(consult, oroClient) {
1984
1571
  var payment;
1985
- return runtime_1.wrap(function _callee5$(_context5) {
1572
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
1986
1573
  while (1) {
1987
1574
  switch (_context5.prev = _context5.next) {
1988
1575
  case 0:
@@ -2037,14 +1624,14 @@ function getOrCreatePatientLockbox(_x10) {
2037
1624
 
2038
1625
 
2039
1626
  function _getOrCreatePatientLockbox() {
2040
- _getOrCreatePatientLockbox = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(oroClient) {
2041
- var grants;
2042
- return runtime_1.wrap(function _callee6$(_context6) {
1627
+ _getOrCreatePatientLockbox = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(oroClient) {
1628
+ var grants, lockboxResponse, tokens;
1629
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
2043
1630
  while (1) {
2044
1631
  switch (_context6.prev = _context6.next) {
2045
1632
  case 0:
2046
1633
  _context6.next = 2;
2047
- return oroClient.getGrants(undefined, true);
1634
+ return oroClient.getGrants();
2048
1635
 
2049
1636
  case 2:
2050
1637
  grants = _context6.sent;
@@ -2065,9 +1652,26 @@ function _getOrCreatePatientLockbox() {
2065
1652
  });
2066
1653
 
2067
1654
  case 10:
2068
- return _context6.abrupt("return", _context6.sent.lockboxUuid);
1655
+ lockboxResponse = _context6.sent;
1656
+ _context6.next = 13;
1657
+ return oroClient.guardClient.authRefresh();
2069
1658
 
2070
- case 11:
1659
+ case 13:
1660
+ tokens = _context6.sent;
1661
+ _context6.next = 16;
1662
+ return oroClient.guardClient.setTokens({
1663
+ accessToken: tokens.accessToken,
1664
+ refreshToken: tokens.refreshToken
1665
+ });
1666
+
1667
+ case 16:
1668
+ _context6.next = 18;
1669
+ return oroClient.guardClient.whoAmI(true);
1670
+
1671
+ case 18:
1672
+ return _context6.abrupt("return", lockboxResponse.lockboxUuid);
1673
+
1674
+ case 19:
2071
1675
  case "end":
2072
1676
  return _context6.stop();
2073
1677
  }
@@ -2082,8 +1686,8 @@ function storePatientData(_x11, _x12, _x13, _x14, _x15) {
2082
1686
  }
2083
1687
 
2084
1688
  function _storePatientData() {
2085
- _storePatientData = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(consultationId, isoLanguage, lockboxUuid, workflow, oroClient) {
2086
- return runtime_1.wrap(function _callee7$(_context7) {
1689
+ _storePatientData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(consultationId, isoLanguage, lockboxUuid, workflow, oroClient) {
1690
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
2087
1691
  while (1) {
2088
1692
  switch (_context7.prev = _context7.next) {
2089
1693
  case 0:
@@ -2140,9 +1744,9 @@ function storeImageAliases(_x16, _x17, _x18, _x19) {
2140
1744
 
2141
1745
 
2142
1746
  function _storeImageAliases() {
2143
- _storeImageAliases = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(consultationId, lockboxUuid, workflow, oroClient) {
1747
+ _storeImageAliases = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(consultationId, lockboxUuid, workflow, oroClient) {
2144
1748
  var images, nonNullImages, promises;
2145
- return runtime_1.wrap(function _callee8$(_context8) {
1749
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
2146
1750
  while (1) {
2147
1751
  switch (_context8.prev = _context8.next) {
2148
1752
  case 0:
@@ -2194,8 +1798,8 @@ function extractAndStorePersonalWorkflowData(_x20, _x21, _x22, _x23, _x24) {
2194
1798
  */
2195
1799
 
2196
1800
  function _extractAndStorePersonalWorkflowData() {
2197
- _extractAndStorePersonalWorkflowData = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9(workflow, lockboxUuid, consultationId, category, oroClient) {
2198
- return runtime_1.wrap(function _callee9$(_context9) {
1801
+ _extractAndStorePersonalWorkflowData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(workflow, lockboxUuid, consultationId, category, oroClient) {
1802
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
2199
1803
  while (1) {
2200
1804
  switch (_context9.prev = _context9.next) {
2201
1805
  case 0:
@@ -2229,8 +1833,8 @@ function extractPersonalInfoFromWorkflowData(_x25) {
2229
1833
  */
2230
1834
 
2231
1835
  function _extractPersonalInfoFromWorkflowData() {
2232
- _extractPersonalInfoFromWorkflowData = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10(workflow) {
2233
- return runtime_1.wrap(function _callee10$(_context10) {
1836
+ _extractPersonalInfoFromWorkflowData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(workflow) {
1837
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
2234
1838
  while (1) {
2235
1839
  switch (_context10.prev = _context10.next) {
2236
1840
  case 0:
@@ -2260,10 +1864,10 @@ function buildConsultSearchIndex(_x26, _x27, _x28) {
2260
1864
  }
2261
1865
 
2262
1866
  function _buildConsultSearchIndex() {
2263
- _buildConsultSearchIndex = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11(consult, workflow, oroClient) {
1867
+ _buildConsultSearchIndex = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(consult, workflow, oroClient) {
2264
1868
  var terms, _yield$extractPersona, personalInfoPopulatedWfData, childPersonalInfoPopulatedWfData, otherPersonalInfoPopulatedWfData, personalInfo, childPersonalInfo, otherPersonalInfo;
2265
1869
 
2266
- return runtime_1.wrap(function _callee11$(_context11) {
1870
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
2267
1871
  while (1) {
2268
1872
  switch (_context11.prev = _context11.next) {
2269
1873
  case 0:
@@ -2373,151 +1977,65 @@ function decryptConsultLockboxGrants(encryptedConsultLockboxes, rsaKey) {
2373
1977
 
2374
1978
  /**
2375
1979
  * @name filterGrantsWithLockboxMetadata
2376
- * @description searches for the applied filters in the vault index
1980
+ * @description searches for the existance of a consult uuid in each granted lockbox
2377
1981
  * @param oroClient
2378
- * @param filter: the metadata filter applied to each the lockboxes
2379
- * @param vaultIndex: the index to which the filter will be applied
2380
- * @param forceRefresh
2381
- * @returns the filtered grants
1982
+ * @param filter: the consult uuid
1983
+ * @returns the grants containing the consult uuid
2382
1984
  */
2383
1985
 
2384
- function filterGrantsWithLockboxMetadata(_x, _x2, _x3, _x4) {
1986
+ function filterGrantsWithLockboxMetadata(_x, _x2) {
2385
1987
  return _filterGrantsWithLockboxMetadata.apply(this, arguments);
2386
1988
  }
2387
- /** Finds all grants for the logged user
2388
- * requests a list of unique consultation ids for each lockbox the user has access to
2389
- * builds and sets the index of consultations
2390
- * @param oroClient
2391
- * @returns the constructed vaultIndex
2392
- */
2393
1989
 
2394
1990
  function _filterGrantsWithLockboxMetadata() {
2395
- _filterGrantsWithLockboxMetadata = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(oroClient, filter, vaultIndex, forceRefresh) {
2396
- var _vaultIndex$IndexKey$, indexConsults;
1991
+ _filterGrantsWithLockboxMetadata = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(oroClient, filter) {
1992
+ var grants, filteredGrants, _iterator, _step, grant, consultationIdExistsInMetadata;
2397
1993
 
2398
- return runtime_1.wrap(function _callee$(_context) {
1994
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
2399
1995
  while (1) {
2400
1996
  switch (_context.prev = _context.next) {
2401
1997
  case 0:
2402
- if (forceRefresh === void 0) {
2403
- forceRefresh = false;
2404
- }
2405
-
2406
- if (!(!vaultIndex || forceRefresh)) {
2407
- _context.next = 5;
2408
- break;
2409
- }
2410
-
2411
- _context.next = 4;
2412
- return buildLegacyVaultIndex(oroClient);
2413
-
2414
- case 4:
2415
- vaultIndex = _context.sent;
2416
-
2417
- case 5:
2418
- if (!(vaultIndex[initApis.IndexKey.Consultation] && filter)) {
2419
- _context.next = 10;
2420
- break;
2421
- }
2422
-
2423
- indexConsults = ((_vaultIndex$IndexKey$ = vaultIndex[initApis.IndexKey.Consultation]) != null ? _vaultIndex$IndexKey$ : []).filter(function (consultGrant) {
2424
- return consultGrant.consultationId === filter.consultationId;
2425
- }).map(function (consultGrant) {
2426
- return consultGrant.grant;
2427
- });
2428
- return _context.abrupt("return", indexConsults);
2429
-
2430
- case 10:
2431
- return _context.abrupt("return", []);
2432
-
2433
- case 11:
2434
- case "end":
2435
- return _context.stop();
2436
- }
2437
- }
2438
- }, _callee);
2439
- }));
2440
- return _filterGrantsWithLockboxMetadata.apply(this, arguments);
2441
- }
2442
-
2443
- function buildLegacyVaultIndex(_x5) {
2444
- return _buildLegacyVaultIndex.apply(this, arguments);
2445
- }
2446
-
2447
- function _buildLegacyVaultIndex() {
2448
- _buildLegacyVaultIndex = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(oroClient) {
2449
- var _vaultIndex;
2450
-
2451
- var grants, consultGrants, _loop, _iterator, _step, vaultIndex;
2452
-
2453
- return runtime_1.wrap(function _callee2$(_context3) {
2454
- while (1) {
2455
- switch (_context3.prev = _context3.next) {
2456
- case 0:
2457
- _context3.next = 2;
1998
+ _context.next = 2;
2458
1999
  return oroClient.getGrants();
2459
2000
 
2460
2001
  case 2:
2461
- grants = _context3.sent;
2462
- consultGrants = [];
2463
- _loop = /*#__PURE__*/runtime_1.mark(function _loop() {
2464
- var grant, consults;
2465
- return runtime_1.wrap(function _loop$(_context2) {
2466
- while (1) {
2467
- switch (_context2.prev = _context2.next) {
2468
- case 0:
2469
- grant = _step.value;
2470
- _context2.next = 3;
2471
- return oroClient.vaultClient.lockboxMetadataGet(grant.lockboxUuid, ['consultationId'], [], {
2472
- category: initApis.MetadataCategory.Consultation
2473
- });
2474
-
2475
- case 3:
2476
- consults = _context2.sent[0];
2477
- consultGrants = [].concat(consultGrants, consults.map(function (consult) {
2478
- return _extends({}, consult, {
2479
- grant: {
2480
- lockboxOwnerUuid: grant.lockboxOwnerUuid,
2481
- lockboxUuid: grant.lockboxUuid
2482
- }
2483
- });
2484
- }));
2485
-
2486
- case 5:
2487
- case "end":
2488
- return _context2.stop();
2489
- }
2490
- }
2491
- }, _loop);
2492
- });
2002
+ grants = _context.sent;
2003
+ filteredGrants = [];
2493
2004
  _iterator = _createForOfIteratorHelperLoose(grants);
2494
2005
 
2495
- case 6:
2006
+ case 5:
2496
2007
  if ((_step = _iterator()).done) {
2497
- _context3.next = 10;
2008
+ _context.next = 13;
2498
2009
  break;
2499
2010
  }
2500
2011
 
2501
- return _context3.delegateYield(_loop(), "t0", 8);
2012
+ grant = _step.value;
2013
+ _context.next = 9;
2014
+ return oroClient.vaultClient.lockboxMetadataGet(grant.lockboxUuid, ['consultationId'], [], {
2015
+ category: initApis.MetadataCategory.Consultation,
2016
+ consultationId: filter.consultationId
2017
+ });
2502
2018
 
2503
- case 8:
2504
- _context3.next = 6;
2019
+ case 9:
2020
+ consultationIdExistsInMetadata = _context.sent;
2021
+ // If there are entries in the metadata, it means that the consult exists in the lockbox
2022
+ if (consultationIdExistsInMetadata[0].length >= 0) filteredGrants.push(grant);
2023
+
2024
+ case 11:
2025
+ _context.next = 5;
2505
2026
  break;
2506
2027
 
2507
- case 10:
2508
- vaultIndex = (_vaultIndex = {}, _vaultIndex[initApis.IndexKey.Consultation] = consultGrants, _vaultIndex);
2509
- oroClient.setVaultIndex(vaultIndex);
2510
- console.info('[sdk:index] Successfully Built Vault Index');
2511
- return _context3.abrupt("return", vaultIndex);
2028
+ case 13:
2029
+ return _context.abrupt("return", filteredGrants);
2512
2030
 
2513
2031
  case 14:
2514
2032
  case "end":
2515
- return _context3.stop();
2033
+ return _context.stop();
2516
2034
  }
2517
2035
  }
2518
- }, _callee2);
2036
+ }, _callee);
2519
2037
  }));
2520
- return _buildLegacyVaultIndex.apply(this, arguments);
2038
+ return _filterGrantsWithLockboxMetadata.apply(this, arguments);
2521
2039
  }
2522
2040
 
2523
2041
  var OroClient = /*#__PURE__*/function () {
@@ -2546,16 +2064,15 @@ var OroClient = /*#__PURE__*/function () {
2546
2064
  _proto.cleanIndex =
2547
2065
  /*#__PURE__*/
2548
2066
  function () {
2549
- var _cleanIndex = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
2550
- return runtime_1.wrap(function _callee$(_context) {
2067
+ var _cleanIndex = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
2068
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
2551
2069
  while (1) {
2552
2070
  switch (_context.prev = _context.next) {
2553
2071
  case 0:
2554
- this.vaultIndex = undefined;
2555
2072
  this.cachedMetadataGrants = {};
2556
2073
  this.cachedManifest = {};
2557
2074
 
2558
- case 3:
2075
+ case 2:
2559
2076
  case "end":
2560
2077
  return _context.stop();
2561
2078
  }
@@ -2585,9 +2102,9 @@ var OroClient = /*#__PURE__*/function () {
2585
2102
  _proto.signUp =
2586
2103
  /*#__PURE__*/
2587
2104
  function () {
2588
- var _signUp = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(email, password, practice, tosAndCpAcceptance, tokenData, subscription, skipEmailValidation) {
2105
+ var _signUp = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(email, password, practice, tosAndCpAcceptance, tokenData, subscription, skipEmailValidation) {
2589
2106
  var privateKey, symmetricEncryptor, recoveryPassword, hashedPassword, emailConfirmed, signupRequest, identity, symetricEncryptor;
2590
- return runtime_1.wrap(function _callee2$(_context2) {
2107
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2591
2108
  while (1) {
2592
2109
  switch (_context2.prev = _context2.next) {
2593
2110
  case 0:
@@ -2646,9 +2163,9 @@ var OroClient = /*#__PURE__*/function () {
2646
2163
  _proto.confirmEmail =
2647
2164
  /*#__PURE__*/
2648
2165
  function () {
2649
- var _confirmEmail = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(accessToken) {
2166
+ var _confirmEmail = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(accessToken) {
2650
2167
  var claims;
2651
- return runtime_1.wrap(function _callee3$(_context3) {
2168
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
2652
2169
  while (1) {
2653
2170
  switch (_context3.prev = _context3.next) {
2654
2171
  case 0:
@@ -2693,9 +2210,9 @@ var OroClient = /*#__PURE__*/function () {
2693
2210
  _proto.signIn =
2694
2211
  /*#__PURE__*/
2695
2212
  function () {
2696
- var _signIn = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(practiceUuid, email, password, otp) {
2213
+ var _signIn = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(practiceUuid, email, password, otp) {
2697
2214
  var hashedPassword, tokenRequest, userUuid;
2698
- return runtime_1.wrap(function _callee4$(_context4) {
2215
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
2699
2216
  while (1) {
2700
2217
  switch (_context4.prev = _context4.next) {
2701
2218
  case 0:
@@ -2748,9 +2265,9 @@ var OroClient = /*#__PURE__*/function () {
2748
2265
  _proto.resumeSession =
2749
2266
  /*#__PURE__*/
2750
2267
  function () {
2751
- var _resumeSession = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5() {
2268
+ var _resumeSession = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
2752
2269
  var id, recoveryPayload, recoveryKey, symmetricDecryptor, privateKey;
2753
- return runtime_1.wrap(function _callee5$(_context5) {
2270
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
2754
2271
  while (1) {
2755
2272
  switch (_context5.prev = _context5.next) {
2756
2273
  case 0:
@@ -2851,8 +2368,8 @@ var OroClient = /*#__PURE__*/function () {
2851
2368
  _proto.signOut =
2852
2369
  /*#__PURE__*/
2853
2370
  function () {
2854
- var _signOut = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6() {
2855
- return runtime_1.wrap(function _callee6$(_context6) {
2371
+ var _signOut = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
2372
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
2856
2373
  while (1) {
2857
2374
  switch (_context6.prev = _context6.next) {
2858
2375
  case 0:
@@ -2902,8 +2419,8 @@ var OroClient = /*#__PURE__*/function () {
2902
2419
  _proto.registerPatient =
2903
2420
  /*#__PURE__*/
2904
2421
  function () {
2905
- var _registerPatient2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(patientUuid, consult, workflow, recoveryQA, indexSearch) {
2906
- return runtime_1.wrap(function _callee7$(_context7) {
2422
+ var _registerPatient2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(patientUuid, consult, workflow, recoveryQA, indexSearch) {
2423
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
2907
2424
  while (1) {
2908
2425
  switch (_context7.prev = _context7.next) {
2909
2426
  case 0:
@@ -2935,61 +2452,6 @@ var OroClient = /*#__PURE__*/function () {
2935
2452
 
2936
2453
  return registerPatient$1;
2937
2454
  }()
2938
- /**
2939
- * Builds the vault index for the logged user
2940
- *
2941
- * Steps:
2942
- * 1. Retrieves, decrypts and sets the lockbox IndexSnapshot
2943
- * 2. Retrieves, decrypts and adds all other index entries starting at the snapshot timestamp
2944
- * 3. Updates the IndexSnapshot if changed
2945
- * @deprecated
2946
- * @returns the latest vault index
2947
- */
2948
- ;
2949
-
2950
- _proto.buildVaultIndex =
2951
- /*#__PURE__*/
2952
- function () {
2953
- var _buildVaultIndex = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(forceRefresh) {
2954
- return runtime_1.wrap(function _callee8$(_context8) {
2955
- while (1) {
2956
- switch (_context8.prev = _context8.next) {
2957
- case 0:
2958
- if (forceRefresh === void 0) {
2959
- forceRefresh = false;
2960
- }
2961
-
2962
- if (!(!this.vaultIndex || forceRefresh)) {
2963
- _context8.next = 4;
2964
- break;
2965
- }
2966
-
2967
- _context8.next = 4;
2968
- return buildLegacyVaultIndex(this);
2969
-
2970
- case 4:
2971
- case "end":
2972
- return _context8.stop();
2973
- }
2974
- }
2975
- }, _callee8, this);
2976
- }));
2977
-
2978
- function buildVaultIndex(_x18) {
2979
- return _buildVaultIndex.apply(this, arguments);
2980
- }
2981
-
2982
- return buildVaultIndex;
2983
- }()
2984
- /**
2985
- * Setter for the vault index
2986
- * @param index
2987
- */
2988
- ;
2989
-
2990
- _proto.setVaultIndex = function setVaultIndex(index) {
2991
- this.vaultIndex = index;
2992
- }
2993
2455
  /**
2994
2456
  * Fetches all grants, and consultations that exist in each lockbox
2995
2457
  * Then updates the index for the current user with the lockbox consult relationship
@@ -2999,28 +2461,28 @@ var OroClient = /*#__PURE__*/function () {
2999
2461
  _proto.forceUpdateIndexEntries =
3000
2462
  /*#__PURE__*/
3001
2463
  function () {
3002
- var _forceUpdateIndexEntries = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10() {
2464
+ var _forceUpdateIndexEntries = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
3003
2465
  var _this = this,
3004
2466
  _this$vaultIndexAdd;
3005
2467
 
3006
2468
  var grants, indexConsultLockbox;
3007
- return runtime_1.wrap(function _callee10$(_context10) {
2469
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
3008
2470
  while (1) {
3009
- switch (_context10.prev = _context10.next) {
2471
+ switch (_context9.prev = _context9.next) {
3010
2472
  case 0:
3011
- _context10.next = 2;
2473
+ _context9.next = 2;
3012
2474
  return this.getGrants();
3013
2475
 
3014
2476
  case 2:
3015
- grants = _context10.sent;
3016
- _context10.next = 5;
2477
+ grants = _context9.sent;
2478
+ _context9.next = 5;
3017
2479
  return Promise.all(grants.map( /*#__PURE__*/function () {
3018
- var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9(grant) {
3019
- return runtime_1.wrap(function _callee9$(_context9) {
2480
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(grant) {
2481
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
3020
2482
  while (1) {
3021
- switch (_context9.prev = _context9.next) {
2483
+ switch (_context8.prev = _context8.next) {
3022
2484
  case 0:
3023
- _context9.next = 2;
2485
+ _context8.next = 2;
3024
2486
  return _this.vaultClient.lockboxMetadataGet(grant.lockboxUuid, ['consultationId'], [], {
3025
2487
  category: initApis.MetadataCategory.Consultation
3026
2488
  }, grant.lockboxOwnerUuid).then(function (consults) {
@@ -3042,17 +2504,17 @@ var OroClient = /*#__PURE__*/function () {
3042
2504
  });
3043
2505
 
3044
2506
  case 2:
3045
- return _context9.abrupt("return", _context9.sent);
2507
+ return _context8.abrupt("return", _context8.sent);
3046
2508
 
3047
2509
  case 3:
3048
2510
  case "end":
3049
- return _context9.stop();
2511
+ return _context8.stop();
3050
2512
  }
3051
2513
  }
3052
- }, _callee9);
2514
+ }, _callee8);
3053
2515
  }));
3054
2516
 
3055
- return function (_x19) {
2517
+ return function (_x18) {
3056
2518
  return _ref2.apply(this, arguments);
3057
2519
  };
3058
2520
  }())).then(function (consults) {
@@ -3060,7 +2522,7 @@ var OroClient = /*#__PURE__*/function () {
3060
2522
  });
3061
2523
 
3062
2524
  case 5:
3063
- indexConsultLockbox = _context10.sent;
2525
+ indexConsultLockbox = _context9.sent;
3064
2526
  this.vaultIndexAdd((_this$vaultIndexAdd = {}, _this$vaultIndexAdd[initApis.IndexKey.Consultation] = indexConsultLockbox, _this$vaultIndexAdd)).then(function () {
3065
2527
  return alert('The Index was successfully updated!');
3066
2528
  })["catch"](function () {
@@ -3069,10 +2531,10 @@ var OroClient = /*#__PURE__*/function () {
3069
2531
 
3070
2532
  case 7:
3071
2533
  case "end":
3072
- return _context10.stop();
2534
+ return _context9.stop();
3073
2535
  }
3074
2536
  }
3075
- }, _callee10, this);
2537
+ }, _callee9, this);
3076
2538
  }));
3077
2539
 
3078
2540
  function forceUpdateIndexEntries() {
@@ -3092,17 +2554,15 @@ var OroClient = /*#__PURE__*/function () {
3092
2554
  _proto.vaultIndexAdd =
3093
2555
  /*#__PURE__*/
3094
2556
  function () {
3095
- var _vaultIndexAdd = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11(entries, indexOwnerUuid) {
3096
- var _this2 = this;
3097
-
2557
+ var _vaultIndexAdd = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(entries, indexOwnerUuid) {
3098
2558
  var rsaPub, base64IndexOwnerPubKey, encryptedIndex, _i, _Object$keys, keyString, key;
3099
2559
 
3100
- return runtime_1.wrap(function _callee11$(_context11) {
2560
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
3101
2561
  while (1) {
3102
- switch (_context11.prev = _context11.next) {
2562
+ switch (_context10.prev = _context10.next) {
3103
2563
  case 0:
3104
2564
  if (this.rsa) {
3105
- _context11.next = 2;
2565
+ _context10.next = 2;
3106
2566
  break;
3107
2567
  }
3108
2568
 
@@ -3110,17 +2570,17 @@ var OroClient = /*#__PURE__*/function () {
3110
2570
 
3111
2571
  case 2:
3112
2572
  if (!indexOwnerUuid) {
3113
- _context11.next = 9;
2573
+ _context10.next = 9;
3114
2574
  break;
3115
2575
  }
3116
2576
 
3117
- _context11.next = 5;
2577
+ _context10.next = 5;
3118
2578
  return this.guardClient.identityGet(indexOwnerUuid);
3119
2579
 
3120
2580
  case 5:
3121
- base64IndexOwnerPubKey = _context11.sent.publicKey;
2581
+ base64IndexOwnerPubKey = _context10.sent.publicKey;
3122
2582
  rsaPub = this.toolbox.decodeFromBase64(base64IndexOwnerPubKey);
3123
- _context11.next = 10;
2583
+ _context10.next = 10;
3124
2584
  break;
3125
2585
 
3126
2586
  case 9:
@@ -3132,14 +2592,14 @@ var OroClient = /*#__PURE__*/function () {
3132
2592
 
3133
2593
  case 12:
3134
2594
  if (!(_i < _Object$keys.length)) {
3135
- _context11.next = 25;
2595
+ _context10.next = 23;
3136
2596
  break;
3137
2597
  }
3138
2598
 
3139
2599
  keyString = _Object$keys[_i];
3140
2600
  key = keyString;
3141
- _context11.t0 = key;
3142
- _context11.next = _context11.t0 === initApis.IndexKey.ConsultationLockbox ? 18 : _context11.t0 === initApis.IndexKey.Consultation ? 20 : 22;
2601
+ _context10.t0 = key;
2602
+ _context10.next = _context10.t0 === initApis.IndexKey.ConsultationLockbox ? 18 : 20;
3143
2603
  break;
3144
2604
 
3145
2605
  case 18:
@@ -3158,117 +2618,31 @@ var OroClient = /*#__PURE__*/function () {
3158
2618
  }, rsaPub)
3159
2619
  };
3160
2620
  });
3161
- return _context11.abrupt("break", 22);
2621
+ return _context10.abrupt("break", 20);
3162
2622
 
3163
2623
  case 20:
3164
- encryptedIndex[key] = entries[key].map(function (e) {
3165
- return _extends({}, e, {
3166
- uniqueHash: _this2.toolbox.hashStringToBase64(JSON.stringify({
3167
- consultationId: e.consultationId,
3168
- grant: e.grant
3169
- }))
3170
- });
3171
- }).filter(function (e) {
3172
- var _this2$vaultIndex$Ind;
3173
-
3174
- return !_this2.vaultIndex || !((_this2$vaultIndex$Ind = _this2.vaultIndex[initApis.IndexKey.Consultation]) != null && _this2$vaultIndex$Ind.find(function (v) {
3175
- return v.uniqueHash === e.uniqueHash;
3176
- }));
3177
- }).map(function (e) {
3178
- return {
3179
- uuid: e.uuid,
3180
- timestamp: e.timestamp,
3181
- uniqueHash: e.uniqueHash,
3182
- encryptedIndexEntry: oroToolbox.CryptoRSA.jsonWithPubEncryptToBase64({
3183
- consultationId: e.consultationId,
3184
- grant: e.grant
3185
- }, rsaPub)
3186
- };
3187
- });
3188
- return _context11.abrupt("break", 22);
3189
-
3190
- case 22:
3191
2624
  _i++;
3192
- _context11.next = 12;
2625
+ _context10.next = 12;
3193
2626
  break;
3194
2627
 
3195
- case 25:
3196
- _context11.next = 27;
2628
+ case 23:
2629
+ _context10.next = 25;
3197
2630
  return this.vaultClient.vaultIndexPut(encryptedIndex, indexOwnerUuid);
3198
2631
 
3199
- case 27:
2632
+ case 25:
3200
2633
  case "end":
3201
- return _context11.stop();
2634
+ return _context10.stop();
3202
2635
  }
3203
2636
  }
3204
- }, _callee11, this);
2637
+ }, _callee10, this);
3205
2638
  }));
3206
2639
 
3207
- function vaultIndexAdd(_x20, _x21) {
2640
+ function vaultIndexAdd(_x19, _x20) {
3208
2641
  return _vaultIndexAdd.apply(this, arguments);
3209
2642
  }
3210
2643
 
3211
2644
  return vaultIndexAdd;
3212
2645
  }()
3213
- /**
3214
- * adds or updates the index snapshot for the logged user
3215
- * @param index
3216
- */
3217
- ;
3218
-
3219
- _proto.indexSnapshotAdd =
3220
- /*#__PURE__*/
3221
- function () {
3222
- var _indexSnapshotAdd = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee12(index) {
3223
- var _index$IndexKey$Consu, _cleanedIndex;
3224
-
3225
- var rsaPub, cleanedIndex, encryptedIndexEntry, encryptedIndex;
3226
- return runtime_1.wrap(function _callee12$(_context12) {
3227
- while (1) {
3228
- switch (_context12.prev = _context12.next) {
3229
- case 0:
3230
- if (this.rsa) {
3231
- _context12.next = 2;
3232
- break;
3233
- }
3234
-
3235
- throw IncompleteAuthentication;
3236
-
3237
- case 2:
3238
- rsaPub = this.rsa["public"]();
3239
- cleanedIndex = (_cleanedIndex = {}, _cleanedIndex[initApis.IndexKey.Consultation] = (_index$IndexKey$Consu = index[initApis.IndexKey.Consultation]) == null ? void 0 : _index$IndexKey$Consu.filter(function (c) {
3240
- return c;
3241
- }).map(function (c) {
3242
- return {
3243
- grant: c.grant,
3244
- consultationId: c.consultationId
3245
- };
3246
- }), _cleanedIndex); // the data of the snapshot should not contain the `IndexEntry` data
3247
- // (will create conflicts while updating)
3248
-
3249
- encryptedIndexEntry = oroToolbox.CryptoRSA.jsonWithPubEncryptToBase64(cleanedIndex, rsaPub); // The encryptedIndexEntry can have the uuid and timstamp (for updating)
3250
-
3251
- encryptedIndex = {
3252
- uuid: index.uuid,
3253
- timestamp: index.timestamp,
3254
- encryptedIndexEntry: encryptedIndexEntry
3255
- };
3256
- this.vaultClient.vaultIndexSnapshotPut(encryptedIndex);
3257
-
3258
- case 7:
3259
- case "end":
3260
- return _context12.stop();
3261
- }
3262
- }
3263
- }, _callee12, this);
3264
- }));
3265
-
3266
- function indexSnapshotAdd(_x22) {
3267
- return _indexSnapshotAdd.apply(this, arguments);
3268
- }
3269
-
3270
- return indexSnapshotAdd;
3271
- }()
3272
2646
  /**
3273
2647
  * @name grantLockbox
3274
2648
  * @description Grants a lockbox by retrieving the shared secret of the lockbox and encrypting it with the grantees public key
@@ -3281,48 +2655,48 @@ var OroClient = /*#__PURE__*/function () {
3281
2655
  _proto.grantLockbox =
3282
2656
  /*#__PURE__*/
3283
2657
  function () {
3284
- var _grantLockbox = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee13(granteeUuid, lockboxUuid, lockboxOwnerUuid) {
2658
+ var _grantLockbox = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(granteeUuid, lockboxUuid, lockboxOwnerUuid) {
3285
2659
  var secret, base64GranteePublicKey, granteePublicKey, granteeEncryptedSecret, request;
3286
- return runtime_1.wrap(function _callee13$(_context13) {
2660
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
3287
2661
  while (1) {
3288
- switch (_context13.prev = _context13.next) {
2662
+ switch (_context11.prev = _context11.next) {
3289
2663
  case 0:
3290
2664
  if (this.rsa) {
3291
- _context13.next = 2;
2665
+ _context11.next = 2;
3292
2666
  break;
3293
2667
  }
3294
2668
 
3295
2669
  throw IncompleteAuthentication;
3296
2670
 
3297
2671
  case 2:
3298
- _context13.next = 4;
2672
+ _context11.next = 4;
3299
2673
  return this.getCachedSecretCryptor(lockboxUuid, lockboxOwnerUuid);
3300
2674
 
3301
2675
  case 4:
3302
- secret = _context13.sent.key();
3303
- _context13.next = 7;
2676
+ secret = _context11.sent.key();
2677
+ _context11.next = 7;
3304
2678
  return this.guardClient.identityGet(granteeUuid);
3305
2679
 
3306
2680
  case 7:
3307
- base64GranteePublicKey = _context13.sent.publicKey;
2681
+ base64GranteePublicKey = _context11.sent.publicKey;
3308
2682
  granteePublicKey = this.toolbox.decodeFromBase64(base64GranteePublicKey);
3309
2683
  granteeEncryptedSecret = oroToolbox.CryptoRSA.bytesWithPubEncryptToBase64(secret, granteePublicKey);
3310
2684
  request = {
3311
2685
  encryptedSecret: granteeEncryptedSecret,
3312
2686
  granteeUuid: granteeUuid
3313
2687
  };
3314
- _context13.next = 13;
2688
+ _context11.next = 13;
3315
2689
  return this.vaultClient.lockboxGrant(lockboxUuid, request, lockboxOwnerUuid);
3316
2690
 
3317
2691
  case 13:
3318
2692
  case "end":
3319
- return _context13.stop();
2693
+ return _context11.stop();
3320
2694
  }
3321
2695
  }
3322
- }, _callee13, this);
2696
+ }, _callee11, this);
3323
2697
  }));
3324
2698
 
3325
- function grantLockbox(_x23, _x24, _x25) {
2699
+ function grantLockbox(_x21, _x22, _x23) {
3326
2700
  return _grantLockbox.apply(this, arguments);
3327
2701
  }
3328
2702
 
@@ -3343,36 +2717,36 @@ var OroClient = /*#__PURE__*/function () {
3343
2717
  _proto.createMessageData =
3344
2718
  /*#__PURE__*/
3345
2719
  function () {
3346
- var _createMessageData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee14(lockboxUuid, message, consultationId, lockboxOwnerUuid, previousDataUuid) {
2720
+ var _createMessageData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(lockboxUuid, message, consultationId, lockboxOwnerUuid, previousDataUuid) {
3347
2721
  var symmetricEncryptor, encryptedData, encryptedPrivateMeta, meta, request;
3348
- return runtime_1.wrap(function _callee14$(_context14) {
2722
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
3349
2723
  while (1) {
3350
- switch (_context14.prev = _context14.next) {
2724
+ switch (_context12.prev = _context12.next) {
3351
2725
  case 0:
3352
2726
  if (this.rsa) {
3353
- _context14.next = 2;
2727
+ _context12.next = 2;
3354
2728
  break;
3355
2729
  }
3356
2730
 
3357
2731
  throw IncompleteAuthentication;
3358
2732
 
3359
2733
  case 2:
3360
- _context14.next = 4;
2734
+ _context12.next = 4;
3361
2735
  return this.getCachedSecretCryptor(lockboxUuid, lockboxOwnerUuid);
3362
2736
 
3363
2737
  case 4:
3364
- symmetricEncryptor = _context14.sent;
2738
+ symmetricEncryptor = _context12.sent;
3365
2739
  encryptedData = symmetricEncryptor.jsonEncryptToBase64Payload(message);
3366
- _context14.t0 = symmetricEncryptor;
3367
- _context14.next = 9;
2740
+ _context12.t0 = symmetricEncryptor;
2741
+ _context12.next = 9;
3368
2742
  return this.guardClient.whoAmI();
3369
2743
 
3370
2744
  case 9:
3371
- _context14.t1 = _context14.sent.sub;
3372
- _context14.t2 = {
3373
- author: _context14.t1
2745
+ _context12.t1 = _context12.sent.sub;
2746
+ _context12.t2 = {
2747
+ author: _context12.t1
3374
2748
  };
3375
- encryptedPrivateMeta = _context14.t0.jsonEncryptToBase64Payload.call(_context14.t0, _context14.t2);
2749
+ encryptedPrivateMeta = _context12.t0.jsonEncryptToBase64Payload.call(_context12.t0, _context12.t2);
3376
2750
  meta = {
3377
2751
  consultationId: consultationId,
3378
2752
  category: initApis.MetadataCategory.Consultation,
@@ -3384,17 +2758,17 @@ var OroClient = /*#__PURE__*/function () {
3384
2758
  publicMetadata: meta,
3385
2759
  privateMetadata: encryptedPrivateMeta
3386
2760
  };
3387
- return _context14.abrupt("return", this.tellerClient.lockboxDataStore(lockboxUuid, request, lockboxOwnerUuid, previousDataUuid));
2761
+ return _context12.abrupt("return", this.tellerClient.lockboxDataStore(lockboxUuid, request, lockboxOwnerUuid, previousDataUuid));
3388
2762
 
3389
2763
  case 15:
3390
2764
  case "end":
3391
- return _context14.stop();
2765
+ return _context12.stop();
3392
2766
  }
3393
2767
  }
3394
- }, _callee14, this);
2768
+ }, _callee12, this);
3395
2769
  }));
3396
2770
 
3397
- function createMessageData(_x26, _x27, _x28, _x29, _x30) {
2771
+ function createMessageData(_x24, _x25, _x26, _x27, _x28) {
3398
2772
  return _createMessageData.apply(this, arguments);
3399
2773
  }
3400
2774
 
@@ -3415,50 +2789,50 @@ var OroClient = /*#__PURE__*/function () {
3415
2789
  _proto.createMessageAttachmentData =
3416
2790
  /*#__PURE__*/
3417
2791
  function () {
3418
- var _createMessageAttachmentData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee15(lockboxUuid, data, consultationId, lockboxOwnerUuid, previousDataUuid) {
2792
+ var _createMessageAttachmentData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(lockboxUuid, data, consultationId, lockboxOwnerUuid, previousDataUuid) {
3419
2793
  var symmetricEncryptor, encryptedData, encryptedPrivateMeta, meta, request;
3420
- return runtime_1.wrap(function _callee15$(_context15) {
2794
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
3421
2795
  while (1) {
3422
- switch (_context15.prev = _context15.next) {
2796
+ switch (_context13.prev = _context13.next) {
3423
2797
  case 0:
3424
2798
  if (this.rsa) {
3425
- _context15.next = 2;
2799
+ _context13.next = 2;
3426
2800
  break;
3427
2801
  }
3428
2802
 
3429
2803
  throw IncompleteAuthentication;
3430
2804
 
3431
2805
  case 2:
3432
- _context15.next = 4;
2806
+ _context13.next = 4;
3433
2807
  return this.getCachedSecretCryptor(lockboxUuid, lockboxOwnerUuid);
3434
2808
 
3435
2809
  case 4:
3436
- symmetricEncryptor = _context15.sent;
3437
- _context15.t0 = symmetricEncryptor;
3438
- _context15.t1 = Uint8Array;
3439
- _context15.next = 9;
2810
+ symmetricEncryptor = _context13.sent;
2811
+ _context13.t0 = symmetricEncryptor;
2812
+ _context13.t1 = Uint8Array;
2813
+ _context13.next = 9;
3440
2814
  return data.arrayBuffer();
3441
2815
 
3442
2816
  case 9:
3443
- _context15.t2 = _context15.sent;
3444
- _context15.t3 = new _context15.t1(_context15.t2);
3445
- encryptedData = _context15.t0.bytesEncryptToBase64Payload.call(_context15.t0, _context15.t3);
3446
- _context15.t4 = symmetricEncryptor;
3447
- _context15.next = 15;
2817
+ _context13.t2 = _context13.sent;
2818
+ _context13.t3 = new _context13.t1(_context13.t2);
2819
+ encryptedData = _context13.t0.bytesEncryptToBase64Payload.call(_context13.t0, _context13.t3);
2820
+ _context13.t4 = symmetricEncryptor;
2821
+ _context13.next = 15;
3448
2822
  return this.guardClient.whoAmI();
3449
2823
 
3450
2824
  case 15:
3451
- _context15.t5 = _context15.sent.sub;
3452
- _context15.t6 = data.name;
3453
- _context15.t7 = data.lastModified;
3454
- _context15.t8 = data.size;
3455
- _context15.t9 = {
3456
- author: _context15.t5,
3457
- fileName: _context15.t6,
3458
- lastModified: _context15.t7,
3459
- size: _context15.t8
2825
+ _context13.t5 = _context13.sent.sub;
2826
+ _context13.t6 = data.name;
2827
+ _context13.t7 = data.lastModified;
2828
+ _context13.t8 = data.size;
2829
+ _context13.t9 = {
2830
+ author: _context13.t5,
2831
+ fileName: _context13.t6,
2832
+ lastModified: _context13.t7,
2833
+ size: _context13.t8
3460
2834
  };
3461
- encryptedPrivateMeta = _context15.t4.jsonEncryptToBase64Payload.call(_context15.t4, _context15.t9);
2835
+ encryptedPrivateMeta = _context13.t4.jsonEncryptToBase64Payload.call(_context13.t4, _context13.t9);
3462
2836
  meta = {
3463
2837
  consultationId: consultationId,
3464
2838
  category: initApis.MetadataCategory.Consultation,
@@ -3470,17 +2844,17 @@ var OroClient = /*#__PURE__*/function () {
3470
2844
  publicMetadata: meta,
3471
2845
  privateMetadata: encryptedPrivateMeta
3472
2846
  };
3473
- return _context15.abrupt("return", this.tellerClient.lockboxDataStore(lockboxUuid, request, lockboxOwnerUuid, previousDataUuid));
2847
+ return _context13.abrupt("return", this.tellerClient.lockboxDataStore(lockboxUuid, request, lockboxOwnerUuid, previousDataUuid));
3474
2848
 
3475
2849
  case 24:
3476
2850
  case "end":
3477
- return _context15.stop();
2851
+ return _context13.stop();
3478
2852
  }
3479
2853
  }
3480
- }, _callee15, this);
2854
+ }, _callee13, this);
3481
2855
  }));
3482
2856
 
3483
- function createMessageAttachmentData(_x31, _x32, _x33, _x34, _x35) {
2857
+ function createMessageAttachmentData(_x29, _x30, _x31, _x32, _x33) {
3484
2858
  return _createMessageAttachmentData.apply(this, arguments);
3485
2859
  }
3486
2860
 
@@ -3502,57 +2876,57 @@ var OroClient = /*#__PURE__*/function () {
3502
2876
  _proto.createConsultationAttachmentData =
3503
2877
  /*#__PURE__*/
3504
2878
  function () {
3505
- var _createConsultationAttachmentData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee16(lockboxUuid, data, consultationId, documentType, lockboxOwnerUuid, previousDataUuid) {
3506
- return runtime_1.wrap(function _callee16$(_context16) {
2879
+ var _createConsultationAttachmentData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(lockboxUuid, data, consultationId, documentType, lockboxOwnerUuid, previousDataUuid) {
2880
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
3507
2881
  while (1) {
3508
- switch (_context16.prev = _context16.next) {
2882
+ switch (_context14.prev = _context14.next) {
3509
2883
  case 0:
3510
2884
  if (this.rsa) {
3511
- _context16.next = 2;
2885
+ _context14.next = 2;
3512
2886
  break;
3513
2887
  }
3514
2888
 
3515
2889
  throw IncompleteAuthentication;
3516
2890
 
3517
2891
  case 2:
3518
- _context16.t0 = this;
3519
- _context16.t1 = lockboxUuid;
3520
- _context16.t2 = Uint8Array;
3521
- _context16.next = 7;
2892
+ _context14.t0 = this;
2893
+ _context14.t1 = lockboxUuid;
2894
+ _context14.t2 = Uint8Array;
2895
+ _context14.next = 7;
3522
2896
  return data.arrayBuffer();
3523
2897
 
3524
2898
  case 7:
3525
- _context16.t3 = _context16.sent;
3526
- _context16.t4 = new _context16.t2(_context16.t3);
3527
- _context16.t5 = {
2899
+ _context14.t3 = _context14.sent;
2900
+ _context14.t4 = new _context14.t2(_context14.t3);
2901
+ _context14.t5 = {
3528
2902
  consultationId: consultationId,
3529
2903
  category: initApis.MetadataCategory.Consultation,
3530
2904
  documentType: documentType,
3531
2905
  contentType: data.type
3532
2906
  };
3533
- _context16.next = 12;
2907
+ _context14.next = 12;
3534
2908
  return this.guardClient.whoAmI();
3535
2909
 
3536
2910
  case 12:
3537
- _context16.t6 = _context16.sent.sub;
3538
- _context16.t7 = data.name;
3539
- _context16.t8 = {
3540
- author: _context16.t6,
3541
- fileName: _context16.t7
2911
+ _context14.t6 = _context14.sent.sub;
2912
+ _context14.t7 = data.name;
2913
+ _context14.t8 = {
2914
+ author: _context14.t6,
2915
+ fileName: _context14.t7
3542
2916
  };
3543
- _context16.t9 = lockboxOwnerUuid;
3544
- _context16.t10 = previousDataUuid;
3545
- return _context16.abrupt("return", _context16.t0.createBytesData.call(_context16.t0, _context16.t1, _context16.t4, _context16.t5, _context16.t8, _context16.t9, _context16.t10));
2917
+ _context14.t9 = lockboxOwnerUuid;
2918
+ _context14.t10 = previousDataUuid;
2919
+ return _context14.abrupt("return", _context14.t0.createBytesData.call(_context14.t0, _context14.t1, _context14.t4, _context14.t5, _context14.t8, _context14.t9, _context14.t10));
3546
2920
 
3547
2921
  case 18:
3548
2922
  case "end":
3549
- return _context16.stop();
2923
+ return _context14.stop();
3550
2924
  }
3551
2925
  }
3552
- }, _callee16, this);
2926
+ }, _callee14, this);
3553
2927
  }));
3554
2928
 
3555
- function createConsultationAttachmentData(_x36, _x37, _x38, _x39, _x40, _x41) {
2929
+ function createConsultationAttachmentData(_x34, _x35, _x36, _x37, _x38, _x39) {
3556
2930
  return _createConsultationAttachmentData.apply(this, arguments);
3557
2931
  }
3558
2932
 
@@ -3574,25 +2948,25 @@ var OroClient = /*#__PURE__*/function () {
3574
2948
  _proto.createJsonData =
3575
2949
  /*#__PURE__*/
3576
2950
  function () {
3577
- var _createJsonData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee17(lockboxUuid, data, meta, privateMeta, lockboxOwnerUuid, previousDataUuid) {
2951
+ var _createJsonData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(lockboxUuid, data, meta, privateMeta, lockboxOwnerUuid, previousDataUuid) {
3578
2952
  var symmetricEncryptor, encryptedData, encryptedPrivateMeta, request;
3579
- return runtime_1.wrap(function _callee17$(_context17) {
2953
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
3580
2954
  while (1) {
3581
- switch (_context17.prev = _context17.next) {
2955
+ switch (_context15.prev = _context15.next) {
3582
2956
  case 0:
3583
2957
  if (this.rsa) {
3584
- _context17.next = 2;
2958
+ _context15.next = 2;
3585
2959
  break;
3586
2960
  }
3587
2961
 
3588
2962
  throw IncompleteAuthentication;
3589
2963
 
3590
2964
  case 2:
3591
- _context17.next = 4;
2965
+ _context15.next = 4;
3592
2966
  return this.getCachedSecretCryptor(lockboxUuid, lockboxOwnerUuid);
3593
2967
 
3594
2968
  case 4:
3595
- symmetricEncryptor = _context17.sent;
2969
+ symmetricEncryptor = _context15.sent;
3596
2970
  encryptedData = symmetricEncryptor.jsonEncryptToBase64Payload(data);
3597
2971
  encryptedPrivateMeta = symmetricEncryptor.jsonEncryptToBase64Payload(privateMeta);
3598
2972
  request = {
@@ -3600,17 +2974,17 @@ var OroClient = /*#__PURE__*/function () {
3600
2974
  publicMetadata: meta,
3601
2975
  privateMetadata: encryptedPrivateMeta
3602
2976
  };
3603
- return _context17.abrupt("return", this.tellerClient.lockboxDataStore(lockboxUuid, request, lockboxOwnerUuid, previousDataUuid));
2977
+ return _context15.abrupt("return", this.tellerClient.lockboxDataStore(lockboxUuid, request, lockboxOwnerUuid, previousDataUuid));
3604
2978
 
3605
2979
  case 9:
3606
2980
  case "end":
3607
- return _context17.stop();
2981
+ return _context15.stop();
3608
2982
  }
3609
2983
  }
3610
- }, _callee17, this);
2984
+ }, _callee15, this);
3611
2985
  }));
3612
2986
 
3613
- function createJsonData(_x42, _x43, _x44, _x45, _x46, _x47) {
2987
+ function createJsonData(_x40, _x41, _x42, _x43, _x44, _x45) {
3614
2988
  return _createJsonData.apply(this, arguments);
3615
2989
  }
3616
2990
 
@@ -3630,32 +3004,32 @@ var OroClient = /*#__PURE__*/function () {
3630
3004
  _proto.getOrInsertJsonData =
3631
3005
  /*#__PURE__*/
3632
3006
  function () {
3633
- var _getOrInsertJsonData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee18(lockboxUuid, data, publicMetadata, privateMetadata, forceReplace) {
3007
+ var _getOrInsertJsonData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(lockboxUuid, data, publicMetadata, privateMetadata, forceReplace) {
3634
3008
  var manifest;
3635
- return runtime_1.wrap(function _callee18$(_context18) {
3009
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
3636
3010
  while (1) {
3637
- switch (_context18.prev = _context18.next) {
3011
+ switch (_context16.prev = _context16.next) {
3638
3012
  case 0:
3639
3013
  if (forceReplace === void 0) {
3640
3014
  forceReplace = false;
3641
3015
  }
3642
3016
 
3643
- _context18.next = 3;
3017
+ _context16.next = 3;
3644
3018
  return this.vaultClient.lockboxManifestGet(lockboxUuid, publicMetadata);
3645
3019
 
3646
3020
  case 3:
3647
- manifest = _context18.sent;
3021
+ manifest = _context16.sent;
3648
3022
 
3649
3023
  if (!(!forceReplace && manifest.length > 0)) {
3650
- _context18.next = 9;
3024
+ _context16.next = 9;
3651
3025
  break;
3652
3026
  }
3653
3027
 
3654
3028
  console.log("The data for " + JSON.stringify(publicMetadata) + " already exist");
3655
- return _context18.abrupt("return", manifest[0].dataUuid);
3029
+ return _context16.abrupt("return", manifest[0].dataUuid);
3656
3030
 
3657
3031
  case 9:
3658
- _context18.next = 11;
3032
+ _context16.next = 11;
3659
3033
  return this.createJsonData(lockboxUuid, data, publicMetadata, privateMetadata, undefined, forceReplace && manifest.length > 0 ? manifest[0].dataUuid : undefined // if forceReplace and data already exist, then replace data. Otherwise insert it
3660
3034
  )["catch"](function (err) {
3661
3035
  console.error("Error while upserting data " + JSON.stringify(publicMetadata) + " data", err);
@@ -3663,17 +3037,17 @@ var OroClient = /*#__PURE__*/function () {
3663
3037
  });
3664
3038
 
3665
3039
  case 11:
3666
- return _context18.abrupt("return", _context18.sent.dataUuid);
3040
+ return _context16.abrupt("return", _context16.sent.dataUuid);
3667
3041
 
3668
3042
  case 12:
3669
3043
  case "end":
3670
- return _context18.stop();
3044
+ return _context16.stop();
3671
3045
  }
3672
3046
  }
3673
- }, _callee18, this);
3047
+ }, _callee16, this);
3674
3048
  }));
3675
3049
 
3676
- function getOrInsertJsonData(_x48, _x49, _x50, _x51, _x52) {
3050
+ function getOrInsertJsonData(_x46, _x47, _x48, _x49, _x50) {
3677
3051
  return _getOrInsertJsonData.apply(this, arguments);
3678
3052
  }
3679
3053
 
@@ -3695,25 +3069,25 @@ var OroClient = /*#__PURE__*/function () {
3695
3069
  _proto.createBytesData =
3696
3070
  /*#__PURE__*/
3697
3071
  function () {
3698
- var _createBytesData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee19(lockboxUuid, data, meta, privateMeta, lockboxOwnerUuid, previousDataUuid) {
3072
+ var _createBytesData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(lockboxUuid, data, meta, privateMeta, lockboxOwnerUuid, previousDataUuid) {
3699
3073
  var symmetricEncryptor, encryptedData, encryptedPrivateMeta, request;
3700
- return runtime_1.wrap(function _callee19$(_context19) {
3074
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
3701
3075
  while (1) {
3702
- switch (_context19.prev = _context19.next) {
3076
+ switch (_context17.prev = _context17.next) {
3703
3077
  case 0:
3704
3078
  if (this.rsa) {
3705
- _context19.next = 2;
3079
+ _context17.next = 2;
3706
3080
  break;
3707
3081
  }
3708
3082
 
3709
3083
  throw IncompleteAuthentication;
3710
3084
 
3711
3085
  case 2:
3712
- _context19.next = 4;
3086
+ _context17.next = 4;
3713
3087
  return this.getCachedSecretCryptor(lockboxUuid, lockboxOwnerUuid);
3714
3088
 
3715
3089
  case 4:
3716
- symmetricEncryptor = _context19.sent;
3090
+ symmetricEncryptor = _context17.sent;
3717
3091
  encryptedData = symmetricEncryptor.bytesEncryptToBase64Payload(data);
3718
3092
  encryptedPrivateMeta = symmetricEncryptor.jsonEncryptToBase64Payload(privateMeta);
3719
3093
  request = {
@@ -3721,17 +3095,17 @@ var OroClient = /*#__PURE__*/function () {
3721
3095
  publicMetadata: meta,
3722
3096
  privateMetadata: encryptedPrivateMeta
3723
3097
  };
3724
- return _context19.abrupt("return", this.tellerClient.lockboxDataStore(lockboxUuid, request, lockboxOwnerUuid, previousDataUuid));
3098
+ return _context17.abrupt("return", this.tellerClient.lockboxDataStore(lockboxUuid, request, lockboxOwnerUuid, previousDataUuid));
3725
3099
 
3726
3100
  case 9:
3727
3101
  case "end":
3728
- return _context19.stop();
3102
+ return _context17.stop();
3729
3103
  }
3730
3104
  }
3731
- }, _callee19, this);
3105
+ }, _callee17, this);
3732
3106
  }));
3733
3107
 
3734
- function createBytesData(_x53, _x54, _x55, _x56, _x57, _x58) {
3108
+ function createBytesData(_x51, _x52, _x53, _x54, _x55, _x56) {
3735
3109
  return _createBytesData.apply(this, arguments);
3736
3110
  }
3737
3111
 
@@ -3753,39 +3127,39 @@ var OroClient = /*#__PURE__*/function () {
3753
3127
  _proto.getJsonData =
3754
3128
  /*#__PURE__*/
3755
3129
  function () {
3756
- var _getJsonData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee20(lockboxUuid, dataUuid, lockboxOwnerUuid) {
3130
+ var _getJsonData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(lockboxUuid, dataUuid, lockboxOwnerUuid) {
3757
3131
  var _yield$Promise$all, encryptedPayload, symmetricDecryptor;
3758
3132
 
3759
- return runtime_1.wrap(function _callee20$(_context20) {
3133
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
3760
3134
  while (1) {
3761
- switch (_context20.prev = _context20.next) {
3135
+ switch (_context18.prev = _context18.next) {
3762
3136
  case 0:
3763
3137
  if (this.rsa) {
3764
- _context20.next = 2;
3138
+ _context18.next = 2;
3765
3139
  break;
3766
3140
  }
3767
3141
 
3768
3142
  throw IncompleteAuthentication;
3769
3143
 
3770
3144
  case 2:
3771
- _context20.next = 4;
3145
+ _context18.next = 4;
3772
3146
  return Promise.all([this.vaultClient.lockboxDataGet(lockboxUuid, dataUuid, lockboxOwnerUuid), this.getCachedSecretCryptor(lockboxUuid, lockboxOwnerUuid)]);
3773
3147
 
3774
3148
  case 4:
3775
- _yield$Promise$all = _context20.sent;
3149
+ _yield$Promise$all = _context18.sent;
3776
3150
  encryptedPayload = _yield$Promise$all[0];
3777
3151
  symmetricDecryptor = _yield$Promise$all[1];
3778
- return _context20.abrupt("return", symmetricDecryptor.base64PayloadDecryptToJson(encryptedPayload.data));
3152
+ return _context18.abrupt("return", symmetricDecryptor.base64PayloadDecryptToJson(encryptedPayload.data));
3779
3153
 
3780
3154
  case 8:
3781
3155
  case "end":
3782
- return _context20.stop();
3156
+ return _context18.stop();
3783
3157
  }
3784
3158
  }
3785
- }, _callee20, this);
3159
+ }, _callee18, this);
3786
3160
  }));
3787
3161
 
3788
- function getJsonData(_x59, _x60, _x61) {
3162
+ function getJsonData(_x57, _x58, _x59) {
3789
3163
  return _getJsonData.apply(this, arguments);
3790
3164
  }
3791
3165
 
@@ -3803,39 +3177,39 @@ var OroClient = /*#__PURE__*/function () {
3803
3177
  _proto.getBytesData =
3804
3178
  /*#__PURE__*/
3805
3179
  function () {
3806
- var _getBytesData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee21(lockboxUuid, dataUuid, lockboxOwnerUuid) {
3180
+ var _getBytesData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(lockboxUuid, dataUuid, lockboxOwnerUuid) {
3807
3181
  var _yield$Promise$all2, encryptedPayload, symmetricDecryptor;
3808
3182
 
3809
- return runtime_1.wrap(function _callee21$(_context21) {
3183
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
3810
3184
  while (1) {
3811
- switch (_context21.prev = _context21.next) {
3185
+ switch (_context19.prev = _context19.next) {
3812
3186
  case 0:
3813
3187
  if (this.rsa) {
3814
- _context21.next = 2;
3188
+ _context19.next = 2;
3815
3189
  break;
3816
3190
  }
3817
3191
 
3818
3192
  throw IncompleteAuthentication;
3819
3193
 
3820
3194
  case 2:
3821
- _context21.next = 4;
3195
+ _context19.next = 4;
3822
3196
  return Promise.all([this.vaultClient.lockboxDataGet(lockboxUuid, dataUuid, lockboxOwnerUuid), this.getCachedSecretCryptor(lockboxUuid, lockboxOwnerUuid)]);
3823
3197
 
3824
3198
  case 4:
3825
- _yield$Promise$all2 = _context21.sent;
3199
+ _yield$Promise$all2 = _context19.sent;
3826
3200
  encryptedPayload = _yield$Promise$all2[0];
3827
3201
  symmetricDecryptor = _yield$Promise$all2[1];
3828
- return _context21.abrupt("return", symmetricDecryptor.base64PayloadDecryptToBytes(encryptedPayload.data));
3202
+ return _context19.abrupt("return", symmetricDecryptor.base64PayloadDecryptToBytes(encryptedPayload.data));
3829
3203
 
3830
3204
  case 8:
3831
3205
  case "end":
3832
- return _context21.stop();
3206
+ return _context19.stop();
3833
3207
  }
3834
3208
  }
3835
- }, _callee21, this);
3209
+ }, _callee19, this);
3836
3210
  }));
3837
3211
 
3838
- function getBytesData(_x62, _x63, _x64) {
3212
+ function getBytesData(_x60, _x61, _x62) {
3839
3213
  return _getBytesData.apply(this, arguments);
3840
3214
  }
3841
3215
 
@@ -3856,41 +3230,92 @@ var OroClient = /*#__PURE__*/function () {
3856
3230
  _proto.getGrants =
3857
3231
  /*#__PURE__*/
3858
3232
  function () {
3859
- var _getGrants = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee22(filter, forceRefresh) {
3860
- var filterString, grantsByConsultLockbox, decryptedConsults, encryptedGrants, decryptedGrants;
3861
- return runtime_1.wrap(function _callee22$(_context22) {
3233
+ var _getGrants = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(filter) {
3234
+ var filterString, currentAccountRole, encryptedGrants, decryptedGrants, grantsByConsultLockbox, decryptedConsults;
3235
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
3862
3236
  while (1) {
3863
- switch (_context22.prev = _context22.next) {
3237
+ switch (_context20.prev = _context20.next) {
3864
3238
  case 0:
3865
- if (forceRefresh === void 0) {
3866
- forceRefresh = false;
3867
- }
3868
-
3869
3239
  if (this.rsa) {
3870
- _context22.next = 3;
3240
+ _context20.next = 2;
3871
3241
  break;
3872
3242
  }
3873
3243
 
3874
3244
  throw IncompleteAuthentication;
3875
3245
 
3876
- case 3:
3246
+ case 2:
3877
3247
  filterString = JSON.stringify(filter); // retrieves cached grants
3878
- // Note: if filters is set to empty, it will be stored in the `undefined` key
3879
3248
 
3880
- if (!(!forceRefresh && this.cachedMetadataGrants[filterString])) {
3881
- _context22.next = 6;
3249
+ if (!this.cachedMetadataGrants[filterString]) {
3250
+ _context20.next = 5;
3882
3251
  break;
3883
3252
  }
3884
3253
 
3885
- return _context22.abrupt("return", this.cachedMetadataGrants[filterString]);
3254
+ return _context20.abrupt("return", this.cachedMetadataGrants[filterString]);
3255
+
3256
+ case 5:
3257
+ _context20.next = 7;
3258
+ return this.getAccountRole();
3259
+
3260
+ case 7:
3261
+ currentAccountRole = _context20.sent;
3262
+
3263
+ if (!(currentAccountRole.length === 1 && currentAccountRole[0] === initApis.OtherRoleType.User)) {
3264
+ _context20.next = 10;
3265
+ break;
3266
+ }
3267
+
3268
+ return _context20.abrupt("return", []);
3269
+
3270
+ case 10:
3271
+ if (![initApis.OtherRoleType.Patient, initApis.OtherRoleType.User].every(function (requiredRole) {
3272
+ return currentAccountRole.includes(requiredRole);
3273
+ })) {
3274
+ _context20.next = 26;
3275
+ break;
3276
+ }
3886
3277
 
3887
- case 6:
3888
3278
  if (!filter) {
3889
- _context22.next = 12;
3279
+ _context20.next = 17;
3280
+ break;
3281
+ }
3282
+
3283
+ _context20.next = 14;
3284
+ return filterGrantsWithLockboxMetadata(this, filter);
3285
+
3286
+ case 14:
3287
+ encryptedGrants = _context20.sent;
3288
+ _context20.next = 20;
3289
+ break;
3290
+
3291
+ case 17:
3292
+ _context20.next = 19;
3293
+ return this.vaultClient.grantsGet();
3294
+
3295
+ case 19:
3296
+ encryptedGrants = _context20.sent.grants;
3297
+
3298
+ case 20:
3299
+ _context20.next = 22;
3300
+ return decryptGrants(encryptedGrants, this.rsa);
3301
+
3302
+ case 22:
3303
+ decryptedGrants = _context20.sent;
3304
+ // sets the cached grant
3305
+ this.cachedMetadataGrants[filterString] = decryptedGrants;
3306
+ console.info('[sdk:grant] Found grant for patient');
3307
+ return _context20.abrupt("return", decryptedGrants);
3308
+
3309
+ case 26:
3310
+ if (filter) {
3311
+ _context20.next = 28;
3890
3312
  break;
3891
3313
  }
3892
3314
 
3893
- _context22.next = 9;
3315
+ throw MissingGrantFilter;
3316
+
3317
+ case 28:
3318
+ _context20.next = 30;
3894
3319
  return this.vaultClient.vaultIndexGet([initApis.IndexKey.ConsultationLockbox], [filter.consultationId]).then(function (res) {
3895
3320
  return res[initApis.IndexKey.ConsultationLockbox];
3896
3321
  })["catch"](function (e) {
@@ -3898,71 +3323,70 @@ var OroClient = /*#__PURE__*/function () {
3898
3323
  return [];
3899
3324
  });
3900
3325
 
3901
- case 9:
3902
- _context22.t0 = _context22.sent;
3903
- _context22.next = 13;
3904
- break;
3905
-
3906
- case 12:
3907
- _context22.t0 = undefined;
3908
-
3909
- case 13:
3910
- grantsByConsultLockbox = _context22.t0;
3326
+ case 30:
3327
+ grantsByConsultLockbox = _context20.sent;
3911
3328
  decryptedConsults = decryptConsultLockboxGrants(grantsByConsultLockbox != null ? grantsByConsultLockbox : [], this.rsa);
3912
3329
 
3913
3330
  if (!(decryptedConsults.length > 0)) {
3914
- _context22.next = 19;
3331
+ _context20.next = 36;
3915
3332
  break;
3916
3333
  }
3917
3334
 
3918
- console.info('[sdk:index] Grants found in user`s constant time secure index');
3919
- this.cachedMetadataGrants[JSON.stringify(filter)] = decryptedConsults;
3920
- return _context22.abrupt("return", this.cachedMetadataGrants[filterString]);
3921
-
3922
- case 19:
3923
- if (!filter) {
3924
- _context22.next = 25;
3925
- break;
3926
- }
3335
+ console.info('[sdk:index] Grants found in user`s constant time secure index');
3336
+ this.cachedMetadataGrants[filterString] = decryptedConsults;
3337
+ return _context20.abrupt("return", this.cachedMetadataGrants[filterString]);
3927
3338
 
3928
- _context22.next = 22;
3929
- return filterGrantsWithLockboxMetadata(this, filter, this.vaultIndex, forceRefresh);
3339
+ case 36:
3340
+ return _context20.abrupt("return", []);
3930
3341
 
3931
- case 22:
3932
- encryptedGrants = _context22.sent;
3933
- _context22.next = 28;
3934
- break;
3342
+ case 37:
3343
+ case "end":
3344
+ return _context20.stop();
3345
+ }
3346
+ }
3347
+ }, _callee20, this);
3348
+ }));
3935
3349
 
3936
- case 25:
3937
- _context22.next = 27;
3938
- return this.vaultClient.grantsGet();
3350
+ function getGrants(_x63) {
3351
+ return _getGrants.apply(this, arguments);
3352
+ }
3939
3353
 
3940
- case 27:
3941
- encryptedGrants = _context22.sent.grants;
3354
+ return getGrants;
3355
+ }()
3356
+ /**
3357
+ * Fetches the role of the account that is logged in
3358
+ *
3359
+ * @returns the role based scopes defined by the whoami
3360
+ */
3361
+ ;
3942
3362
 
3943
- case 28:
3944
- _context22.next = 30;
3945
- return decryptGrants(encryptedGrants, this.rsa);
3363
+ _proto.getAccountRole =
3364
+ /*#__PURE__*/
3365
+ function () {
3366
+ var _getAccountRole = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
3367
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
3368
+ while (1) {
3369
+ switch (_context21.prev = _context21.next) {
3370
+ case 0:
3371
+ _context21.next = 2;
3372
+ return this.guardClient.whoAmI();
3946
3373
 
3947
- case 30:
3948
- decryptedGrants = _context22.sent;
3949
- // sets the cached grant
3950
- this.cachedMetadataGrants[filterString] = decryptedGrants;
3951
- return _context22.abrupt("return", decryptedGrants);
3374
+ case 2:
3375
+ return _context21.abrupt("return", _context21.sent.scope.split(' '));
3952
3376
 
3953
- case 33:
3377
+ case 3:
3954
3378
  case "end":
3955
- return _context22.stop();
3379
+ return _context21.stop();
3956
3380
  }
3957
3381
  }
3958
- }, _callee22, this);
3382
+ }, _callee21, this);
3959
3383
  }));
3960
3384
 
3961
- function getGrants(_x65, _x66) {
3962
- return _getGrants.apply(this, arguments);
3385
+ function getAccountRole() {
3386
+ return _getAccountRole.apply(this, arguments);
3963
3387
  }
3964
3388
 
3965
- return getGrants;
3389
+ return getAccountRole;
3966
3390
  }()
3967
3391
  /**
3968
3392
  * @name getCachedSecretCryptor
@@ -3976,14 +3400,14 @@ var OroClient = /*#__PURE__*/function () {
3976
3400
  _proto.getCachedSecretCryptor =
3977
3401
  /*#__PURE__*/
3978
3402
  function () {
3979
- var _getCachedSecretCryptor = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee23(lockboxUuid, lockboxOwnerUuid) {
3403
+ var _getCachedSecretCryptor = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(lockboxUuid, lockboxOwnerUuid) {
3980
3404
  var index, encryptedSecret, secret, cryptor;
3981
- return runtime_1.wrap(function _callee23$(_context23) {
3405
+ return _regeneratorRuntime().wrap(function _callee22$(_context22) {
3982
3406
  while (1) {
3983
- switch (_context23.prev = _context23.next) {
3407
+ switch (_context22.prev = _context22.next) {
3984
3408
  case 0:
3985
3409
  if (this.rsa) {
3986
- _context23.next = 2;
3410
+ _context22.next = 2;
3987
3411
  break;
3988
3412
  }
3989
3413
 
@@ -3995,35 +3419,35 @@ var OroClient = /*#__PURE__*/function () {
3995
3419
  });
3996
3420
 
3997
3421
  if (!(index === -1)) {
3998
- _context23.next = 13;
3422
+ _context22.next = 13;
3999
3423
  break;
4000
3424
  }
4001
3425
 
4002
- _context23.next = 6;
3426
+ _context22.next = 6;
4003
3427
  return this.vaultClient.lockboxSecretGet(lockboxUuid, lockboxOwnerUuid);
4004
3428
 
4005
3429
  case 6:
4006
- encryptedSecret = _context23.sent.sharedSecret;
3430
+ encryptedSecret = _context22.sent.sharedSecret;
4007
3431
  secret = this.rsa.base64DecryptToBytes(encryptedSecret);
4008
3432
  cryptor = this.toolbox.CryptoChaCha.fromKey(secret);
4009
3433
  this.secrets.push({
4010
3434
  lockboxUuid: lockboxUuid,
4011
3435
  cryptor: cryptor
4012
3436
  });
4013
- return _context23.abrupt("return", cryptor);
3437
+ return _context22.abrupt("return", cryptor);
4014
3438
 
4015
3439
  case 13:
4016
- return _context23.abrupt("return", this.secrets[index].cryptor);
3440
+ return _context22.abrupt("return", this.secrets[index].cryptor);
4017
3441
 
4018
3442
  case 14:
4019
3443
  case "end":
4020
- return _context23.stop();
3444
+ return _context22.stop();
4021
3445
  }
4022
3446
  }
4023
- }, _callee23, this);
3447
+ }, _callee22, this);
4024
3448
  }));
4025
3449
 
4026
- function getCachedSecretCryptor(_x67, _x68) {
3450
+ function getCachedSecretCryptor(_x64, _x65) {
4027
3451
  return _getCachedSecretCryptor.apply(this, arguments);
4028
3452
  }
4029
3453
 
@@ -4043,26 +3467,26 @@ var OroClient = /*#__PURE__*/function () {
4043
3467
  _proto.getPersonalInformationsFromConsultId =
4044
3468
  /*#__PURE__*/
4045
3469
  function () {
4046
- var _getPersonalInformationsFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee24(consultationId, category, forceRefresh) {
4047
- return runtime_1.wrap(function _callee24$(_context24) {
3470
+ var _getPersonalInformationsFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(consultationId, category, forceRefresh) {
3471
+ return _regeneratorRuntime().wrap(function _callee23$(_context23) {
4048
3472
  while (1) {
4049
- switch (_context24.prev = _context24.next) {
3473
+ switch (_context23.prev = _context23.next) {
4050
3474
  case 0:
4051
3475
  if (forceRefresh === void 0) {
4052
3476
  forceRefresh = false;
4053
3477
  }
4054
3478
 
4055
- return _context24.abrupt("return", this.getMetaCategoryFromConsultId(consultationId, category, forceRefresh));
3479
+ return _context23.abrupt("return", this.getMetaCategoryFromConsultId(consultationId, category, forceRefresh));
4056
3480
 
4057
3481
  case 2:
4058
3482
  case "end":
4059
- return _context24.stop();
3483
+ return _context23.stop();
4060
3484
  }
4061
3485
  }
4062
- }, _callee24, this);
3486
+ }, _callee23, this);
4063
3487
  }));
4064
3488
 
4065
- function getPersonalInformationsFromConsultId(_x69, _x70, _x71) {
3489
+ function getPersonalInformationsFromConsultId(_x66, _x67, _x68) {
4066
3490
  return _getPersonalInformationsFromConsultId.apply(this, arguments);
4067
3491
  }
4068
3492
 
@@ -4081,26 +3505,26 @@ var OroClient = /*#__PURE__*/function () {
4081
3505
  _proto.getMedicalDataFromConsultId =
4082
3506
  /*#__PURE__*/
4083
3507
  function () {
4084
- var _getMedicalDataFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee25(consultationId, forceRefresh) {
4085
- return runtime_1.wrap(function _callee25$(_context25) {
3508
+ var _getMedicalDataFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24(consultationId, forceRefresh) {
3509
+ return _regeneratorRuntime().wrap(function _callee24$(_context24) {
4086
3510
  while (1) {
4087
- switch (_context25.prev = _context25.next) {
3511
+ switch (_context24.prev = _context24.next) {
4088
3512
  case 0:
4089
3513
  if (forceRefresh === void 0) {
4090
3514
  forceRefresh = false;
4091
3515
  }
4092
3516
 
4093
- return _context25.abrupt("return", this.getMetaCategoryFromConsultId(consultationId, initApis.MetadataCategory.Medical, forceRefresh));
3517
+ return _context24.abrupt("return", this.getMetaCategoryFromConsultId(consultationId, initApis.MetadataCategory.Medical, forceRefresh));
4094
3518
 
4095
3519
  case 2:
4096
3520
  case "end":
4097
- return _context25.stop();
3521
+ return _context24.stop();
4098
3522
  }
4099
3523
  }
4100
- }, _callee25, this);
3524
+ }, _callee24, this);
4101
3525
  }));
4102
3526
 
4103
- function getMedicalDataFromConsultId(_x72, _x73) {
3527
+ function getMedicalDataFromConsultId(_x69, _x70) {
4104
3528
  return _getMedicalDataFromConsultId.apply(this, arguments);
4105
3529
  }
4106
3530
 
@@ -4108,103 +3532,103 @@ var OroClient = /*#__PURE__*/function () {
4108
3532
  }();
4109
3533
 
4110
3534
  _proto.getMetaCategoryFromConsultId = /*#__PURE__*/function () {
4111
- var _getMetaCategoryFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee27(consultationId, category, forceRefresh) {
4112
- var _this3 = this;
3535
+ var _getMetaCategoryFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(consultationId, category, forceRefresh) {
3536
+ var _this2 = this;
4113
3537
 
4114
3538
  var grants, workflowData, _loop, _iterator, _step;
4115
3539
 
4116
- return runtime_1.wrap(function _callee27$(_context28) {
3540
+ return _regeneratorRuntime().wrap(function _callee26$(_context27) {
4117
3541
  while (1) {
4118
- switch (_context28.prev = _context28.next) {
3542
+ switch (_context27.prev = _context27.next) {
4119
3543
  case 0:
4120
3544
  if (forceRefresh === void 0) {
4121
3545
  forceRefresh = false;
4122
3546
  }
4123
3547
 
4124
- _context28.next = 3;
3548
+ _context27.next = 3;
4125
3549
  return this.getGrants({
4126
3550
  consultationId: consultationId
4127
3551
  });
4128
3552
 
4129
3553
  case 3:
4130
- grants = _context28.sent;
3554
+ grants = _context27.sent;
4131
3555
  workflowData = [];
4132
- _loop = /*#__PURE__*/runtime_1.mark(function _loop() {
3556
+ _loop = /*#__PURE__*/_regeneratorRuntime().mark(function _loop() {
4133
3557
  var grant, manifest, data;
4134
- return runtime_1.wrap(function _loop$(_context27) {
3558
+ return _regeneratorRuntime().wrap(function _loop$(_context26) {
4135
3559
  while (1) {
4136
- switch (_context27.prev = _context27.next) {
3560
+ switch (_context26.prev = _context26.next) {
4137
3561
  case 0:
4138
3562
  grant = _step.value;
4139
- _context27.next = 3;
4140
- return _this3.getLockboxManifest(grant.lockboxUuid, {
3563
+ _context26.next = 3;
3564
+ return _this2.getLockboxManifest(grant.lockboxUuid, {
4141
3565
  category: category,
4142
3566
  documentType: initApis.DocumentType.PopulatedWorkflowData,
4143
3567
  consultationIds: [consultationId]
4144
3568
  }, true, grant.lockboxOwnerUuid, forceRefresh);
4145
3569
 
4146
3570
  case 3:
4147
- manifest = _context27.sent;
3571
+ manifest = _context26.sent;
4148
3572
 
4149
3573
  if (!(manifest.length === 0)) {
4150
- _context27.next = 8;
3574
+ _context26.next = 8;
4151
3575
  break;
4152
3576
  }
4153
3577
 
4154
- _context27.next = 7;
4155
- return _this3.getLockboxManifest(grant.lockboxUuid, {
3578
+ _context26.next = 7;
3579
+ return _this2.getLockboxManifest(grant.lockboxUuid, {
4156
3580
  category: category,
4157
3581
  documentType: initApis.DocumentType.PopulatedWorkflowData
4158
3582
  }, true, grant.lockboxOwnerUuid, forceRefresh);
4159
3583
 
4160
3584
  case 7:
4161
- manifest = _context27.sent.filter(function (entry) {
3585
+ manifest = _context26.sent.filter(function (entry) {
4162
3586
  return !entry.metadata.consultationIds;
4163
3587
  });
4164
3588
 
4165
3589
  case 8:
4166
- _context27.next = 10;
3590
+ _context26.next = 10;
4167
3591
  return Promise.all(manifest.map( /*#__PURE__*/function () {
4168
- var _ref3 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee26(entry) {
4169
- return runtime_1.wrap(function _callee26$(_context26) {
3592
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(entry) {
3593
+ return _regeneratorRuntime().wrap(function _callee25$(_context25) {
4170
3594
  while (1) {
4171
- switch (_context26.prev = _context26.next) {
3595
+ switch (_context25.prev = _context25.next) {
4172
3596
  case 0:
4173
- _context26.t0 = grant.lockboxOwnerUuid;
4174
- _context26.t1 = grant.lockboxUuid;
4175
- _context26.t2 = entry.dataUuid;
4176
- _context26.next = 5;
4177
- return _this3.getJsonData(grant.lockboxUuid, entry.dataUuid);
3597
+ _context25.t0 = grant.lockboxOwnerUuid;
3598
+ _context25.t1 = grant.lockboxUuid;
3599
+ _context25.t2 = entry.dataUuid;
3600
+ _context25.next = 5;
3601
+ return _this2.getJsonData(grant.lockboxUuid, entry.dataUuid);
4178
3602
 
4179
3603
  case 5:
4180
- _context26.t3 = _context26.sent;
4181
- return _context26.abrupt("return", {
4182
- lockboxOwnerUuid: _context26.t0,
4183
- lockboxUuid: _context26.t1,
4184
- dataUuid: _context26.t2,
4185
- data: _context26.t3
3604
+ _context25.t3 = _context25.sent;
3605
+ return _context25.abrupt("return", {
3606
+ lockboxOwnerUuid: _context25.t0,
3607
+ lockboxUuid: _context25.t1,
3608
+ dataUuid: _context25.t2,
3609
+ data: _context25.t3
4186
3610
  });
4187
3611
 
4188
3612
  case 7:
4189
3613
  case "end":
4190
- return _context26.stop();
3614
+ return _context25.stop();
4191
3615
  }
4192
3616
  }
4193
- }, _callee26);
3617
+ }, _callee25);
4194
3618
  }));
4195
3619
 
4196
- return function (_x77) {
3620
+ return function (_x74) {
4197
3621
  return _ref3.apply(this, arguments);
4198
3622
  };
4199
3623
  }()));
4200
3624
 
4201
3625
  case 10:
4202
- data = _context27.sent;
3626
+ data = _context26.sent;
4203
3627
  workflowData = _extends({}, workflowData, data);
4204
3628
 
4205
3629
  case 12:
4206
3630
  case "end":
4207
- return _context27.stop();
3631
+ return _context26.stop();
4208
3632
  }
4209
3633
  }
4210
3634
  }, _loop);
@@ -4213,28 +3637,28 @@ var OroClient = /*#__PURE__*/function () {
4213
3637
 
4214
3638
  case 7:
4215
3639
  if ((_step = _iterator()).done) {
4216
- _context28.next = 11;
3640
+ _context27.next = 11;
4217
3641
  break;
4218
3642
  }
4219
3643
 
4220
- return _context28.delegateYield(_loop(), "t0", 9);
3644
+ return _context27.delegateYield(_loop(), "t0", 9);
4221
3645
 
4222
3646
  case 9:
4223
- _context28.next = 7;
3647
+ _context27.next = 7;
4224
3648
  break;
4225
3649
 
4226
3650
  case 11:
4227
- return _context28.abrupt("return", workflowData);
3651
+ return _context27.abrupt("return", workflowData);
4228
3652
 
4229
3653
  case 12:
4230
3654
  case "end":
4231
- return _context28.stop();
3655
+ return _context27.stop();
4232
3656
  }
4233
3657
  }
4234
- }, _callee27, this);
3658
+ }, _callee26, this);
4235
3659
  }));
4236
3660
 
4237
- function getMetaCategoryFromConsultId(_x74, _x75, _x76) {
3661
+ function getMetaCategoryFromConsultId(_x71, _x72, _x73) {
4238
3662
  return _getMetaCategoryFromConsultId.apply(this, arguments);
4239
3663
  }
4240
3664
 
@@ -4250,22 +3674,22 @@ var OroClient = /*#__PURE__*/function () {
4250
3674
  _proto.getPersonalInformations =
4251
3675
  /*#__PURE__*/
4252
3676
  function () {
4253
- var _getPersonalInformations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee28(userId) {
3677
+ var _getPersonalInformations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(userId) {
4254
3678
  var grant, lockboxUuid, lockboxOwnerUuid, identificationDataUuid;
4255
- return runtime_1.wrap(function _callee28$(_context29) {
3679
+ return _regeneratorRuntime().wrap(function _callee27$(_context28) {
4256
3680
  while (1) {
4257
- switch (_context29.prev = _context29.next) {
3681
+ switch (_context28.prev = _context28.next) {
4258
3682
  case 0:
4259
- _context29.next = 2;
3683
+ _context28.next = 2;
4260
3684
  return this.getGrants();
4261
3685
 
4262
3686
  case 2:
4263
- grant = _context29.sent.find(function (lockbox) {
3687
+ grant = _context28.sent.find(function (lockbox) {
4264
3688
  return lockbox.lockboxOwnerUuid === userId;
4265
3689
  });
4266
3690
 
4267
3691
  if (grant) {
4268
- _context29.next = 5;
3692
+ _context28.next = 5;
4269
3693
  break;
4270
3694
  }
4271
3695
 
@@ -4275,7 +3699,7 @@ var OroClient = /*#__PURE__*/function () {
4275
3699
  lockboxUuid = grant.lockboxUuid, lockboxOwnerUuid = grant.lockboxOwnerUuid;
4276
3700
 
4277
3701
  if (lockboxUuid) {
4278
- _context29.next = 8;
3702
+ _context28.next = 8;
4279
3703
  break;
4280
3704
  }
4281
3705
 
@@ -4283,45 +3707,45 @@ var OroClient = /*#__PURE__*/function () {
4283
3707
 
4284
3708
  case 8:
4285
3709
  if (lockboxOwnerUuid) {
4286
- _context29.next = 10;
3710
+ _context28.next = 10;
4287
3711
  break;
4288
3712
  }
4289
3713
 
4290
3714
  throw MissingLockboxOwner;
4291
3715
 
4292
3716
  case 10:
4293
- _context29.next = 12;
3717
+ _context28.next = 12;
4294
3718
  return this.getLockboxManifest(lockboxUuid, {
4295
3719
  category: initApis.MetadataCategory.Personal,
4296
3720
  documentType: initApis.DocumentType.PopulatedWorkflowData
4297
3721
  }, false, userId);
4298
3722
 
4299
3723
  case 12:
4300
- identificationDataUuid = _context29.sent[0].dataUuid;
4301
- _context29.t0 = lockboxOwnerUuid;
4302
- _context29.t1 = lockboxUuid;
4303
- _context29.t2 = identificationDataUuid;
4304
- _context29.next = 18;
3724
+ identificationDataUuid = _context28.sent[0].dataUuid;
3725
+ _context28.t0 = lockboxOwnerUuid;
3726
+ _context28.t1 = lockboxUuid;
3727
+ _context28.t2 = identificationDataUuid;
3728
+ _context28.next = 18;
4305
3729
  return this.getJsonData(lockboxUuid, identificationDataUuid);
4306
3730
 
4307
3731
  case 18:
4308
- _context29.t3 = _context29.sent;
4309
- return _context29.abrupt("return", {
4310
- lockboxOwnerUuid: _context29.t0,
4311
- lockboxUuid: _context29.t1,
4312
- dataUuid: _context29.t2,
4313
- data: _context29.t3
3732
+ _context28.t3 = _context28.sent;
3733
+ return _context28.abrupt("return", {
3734
+ lockboxOwnerUuid: _context28.t0,
3735
+ lockboxUuid: _context28.t1,
3736
+ dataUuid: _context28.t2,
3737
+ data: _context28.t3
4314
3738
  });
4315
3739
 
4316
3740
  case 20:
4317
3741
  case "end":
4318
- return _context29.stop();
3742
+ return _context28.stop();
4319
3743
  }
4320
3744
  }
4321
- }, _callee28, this);
3745
+ }, _callee27, this);
4322
3746
  }));
4323
3747
 
4324
- function getPersonalInformations(_x78) {
3748
+ function getPersonalInformations(_x75) {
4325
3749
  return _getPersonalInformations.apply(this, arguments);
4326
3750
  }
4327
3751
 
@@ -4338,39 +3762,39 @@ var OroClient = /*#__PURE__*/function () {
4338
3762
  _proto.getGrantFromConsultId =
4339
3763
  /*#__PURE__*/
4340
3764
  function () {
4341
- var _getGrantFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee29(consultationId) {
3765
+ var _getGrantFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(consultationId) {
4342
3766
  var grants;
4343
- return runtime_1.wrap(function _callee29$(_context30) {
3767
+ return _regeneratorRuntime().wrap(function _callee28$(_context29) {
4344
3768
  while (1) {
4345
- switch (_context30.prev = _context30.next) {
3769
+ switch (_context29.prev = _context29.next) {
4346
3770
  case 0:
4347
- _context30.next = 2;
3771
+ _context29.next = 2;
4348
3772
  return this.getGrants({
4349
3773
  consultationId: consultationId
4350
3774
  });
4351
3775
 
4352
3776
  case 2:
4353
- grants = _context30.sent;
3777
+ grants = _context29.sent;
4354
3778
 
4355
3779
  if (!(grants.length === 0)) {
4356
- _context30.next = 5;
3780
+ _context29.next = 5;
4357
3781
  break;
4358
3782
  }
4359
3783
 
4360
3784
  throw AssociatedLockboxNotFound;
4361
3785
 
4362
3786
  case 5:
4363
- return _context30.abrupt("return", grants[0]);
3787
+ return _context29.abrupt("return", grants[0]);
4364
3788
 
4365
3789
  case 6:
4366
3790
  case "end":
4367
- return _context30.stop();
3791
+ return _context29.stop();
4368
3792
  }
4369
3793
  }
4370
- }, _callee29, this);
3794
+ }, _callee28, this);
4371
3795
  }));
4372
3796
 
4373
- function getGrantFromConsultId(_x79) {
3797
+ function getGrantFromConsultId(_x76) {
4374
3798
  return _getGrantFromConsultId.apply(this, arguments);
4375
3799
  }
4376
3800
 
@@ -4386,41 +3810,41 @@ var OroClient = /*#__PURE__*/function () {
4386
3810
  _proto.getIdentityFromConsultId =
4387
3811
  /*#__PURE__*/
4388
3812
  function () {
4389
- var _getIdentityFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee30(consultationId) {
3813
+ var _getIdentityFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(consultationId) {
4390
3814
  var grant;
4391
- return runtime_1.wrap(function _callee30$(_context31) {
3815
+ return _regeneratorRuntime().wrap(function _callee29$(_context30) {
4392
3816
  while (1) {
4393
- switch (_context31.prev = _context31.next) {
3817
+ switch (_context30.prev = _context30.next) {
4394
3818
  case 0:
4395
- _context31.next = 2;
3819
+ _context30.next = 2;
4396
3820
  return this.getGrantFromConsultId(consultationId);
4397
3821
 
4398
3822
  case 2:
4399
- grant = _context31.sent;
3823
+ grant = _context30.sent;
4400
3824
 
4401
3825
  if (!(grant && grant.lockboxOwnerUuid)) {
4402
- _context31.next = 9;
3826
+ _context30.next = 9;
4403
3827
  break;
4404
3828
  }
4405
3829
 
4406
- _context31.next = 6;
3830
+ _context30.next = 6;
4407
3831
  return this.guardClient.identityGet(grant.lockboxOwnerUuid);
4408
3832
 
4409
3833
  case 6:
4410
- return _context31.abrupt("return", _context31.sent);
3834
+ return _context30.abrupt("return", _context30.sent);
4411
3835
 
4412
3836
  case 9:
4413
- return _context31.abrupt("return", undefined);
3837
+ return _context30.abrupt("return", undefined);
4414
3838
 
4415
3839
  case 10:
4416
3840
  case "end":
4417
- return _context31.stop();
3841
+ return _context30.stop();
4418
3842
  }
4419
3843
  }
4420
- }, _callee30, this);
3844
+ }, _callee29, this);
4421
3845
  }));
4422
3846
 
4423
- function getIdentityFromConsultId(_x80) {
3847
+ function getIdentityFromConsultId(_x77) {
4424
3848
  return _getIdentityFromConsultId.apply(this, arguments);
4425
3849
  }
4426
3850
 
@@ -4441,13 +3865,13 @@ var OroClient = /*#__PURE__*/function () {
4441
3865
  _proto.getLockboxManifest =
4442
3866
  /*#__PURE__*/
4443
3867
  function () {
4444
- var _getLockboxManifest = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee32(lockboxUuid, filter, expandPrivateMetadata, lockboxOwnerUuid, forceRefresh) {
4445
- var _this4 = this;
3868
+ var _getLockboxManifest = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(lockboxUuid, filter, expandPrivateMetadata, lockboxOwnerUuid, forceRefresh) {
3869
+ var _this3 = this;
4446
3870
 
4447
3871
  var manifestKey;
4448
- return runtime_1.wrap(function _callee32$(_context33) {
3872
+ return _regeneratorRuntime().wrap(function _callee31$(_context32) {
4449
3873
  while (1) {
4450
- switch (_context33.prev = _context33.next) {
3874
+ switch (_context32.prev = _context32.next) {
4451
3875
  case 0:
4452
3876
  if (forceRefresh === void 0) {
4453
3877
  forceRefresh = false;
@@ -4461,61 +3885,61 @@ var OroClient = /*#__PURE__*/function () {
4461
3885
  });
4462
3886
 
4463
3887
  if (!(!forceRefresh && this.cachedManifest[manifestKey])) {
4464
- _context33.next = 4;
3888
+ _context32.next = 4;
4465
3889
  break;
4466
3890
  }
4467
3891
 
4468
- return _context33.abrupt("return", this.cachedManifest[manifestKey]);
3892
+ return _context32.abrupt("return", this.cachedManifest[manifestKey]);
4469
3893
 
4470
3894
  case 4:
4471
- return _context33.abrupt("return", this.vaultClient.lockboxManifestGet(lockboxUuid, filter, lockboxOwnerUuid).then(function (manifest) {
3895
+ return _context32.abrupt("return", this.vaultClient.lockboxManifestGet(lockboxUuid, filter, lockboxOwnerUuid).then(function (manifest) {
4472
3896
  return Promise.all(manifest.map( /*#__PURE__*/function () {
4473
- var _ref4 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee31(entry) {
3897
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(entry) {
4474
3898
  var privateMeta;
4475
- return runtime_1.wrap(function _callee31$(_context32) {
3899
+ return _regeneratorRuntime().wrap(function _callee30$(_context31) {
4476
3900
  while (1) {
4477
- switch (_context32.prev = _context32.next) {
3901
+ switch (_context31.prev = _context31.next) {
4478
3902
  case 0:
4479
3903
  if (!(expandPrivateMetadata && entry.metadata.privateMetadata)) {
4480
- _context32.next = 5;
3904
+ _context31.next = 5;
4481
3905
  break;
4482
3906
  }
4483
3907
 
4484
- _context32.next = 3;
4485
- return _this4.getJsonData(lockboxUuid, entry.metadata.privateMetadata, lockboxOwnerUuid);
3908
+ _context31.next = 3;
3909
+ return _this3.getJsonData(lockboxUuid, entry.metadata.privateMetadata, lockboxOwnerUuid);
4486
3910
 
4487
3911
  case 3:
4488
- privateMeta = _context32.sent;
3912
+ privateMeta = _context31.sent;
4489
3913
  entry.metadata = _extends({}, entry.metadata, privateMeta);
4490
3914
 
4491
3915
  case 5:
4492
- return _context32.abrupt("return", entry);
3916
+ return _context31.abrupt("return", entry);
4493
3917
 
4494
3918
  case 6:
4495
3919
  case "end":
4496
- return _context32.stop();
3920
+ return _context31.stop();
4497
3921
  }
4498
3922
  }
4499
- }, _callee31);
3923
+ }, _callee30);
4500
3924
  }));
4501
3925
 
4502
- return function (_x86) {
3926
+ return function (_x83) {
4503
3927
  return _ref4.apply(this, arguments);
4504
3928
  };
4505
3929
  }())).then(function (manifest) {
4506
- return _this4.cachedManifest[manifestKey] = manifest;
3930
+ return _this3.cachedManifest[manifestKey] = manifest;
4507
3931
  });
4508
3932
  }));
4509
3933
 
4510
3934
  case 5:
4511
3935
  case "end":
4512
- return _context33.stop();
3936
+ return _context32.stop();
4513
3937
  }
4514
3938
  }
4515
- }, _callee32, this);
3939
+ }, _callee31, this);
4516
3940
  }));
4517
3941
 
4518
- function getLockboxManifest(_x81, _x82, _x83, _x84, _x85) {
3942
+ function getLockboxManifest(_x78, _x79, _x80, _x81, _x82) {
4519
3943
  return _getLockboxManifest.apply(this, arguments);
4520
3944
  }
4521
3945
 
@@ -4533,43 +3957,43 @@ var OroClient = /*#__PURE__*/function () {
4533
3957
  _proto.createPersonalInformations =
4534
3958
  /*#__PURE__*/
4535
3959
  function () {
4536
- var _createPersonalInformations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee33(identity, data, dataUuid) {
3960
+ var _createPersonalInformations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(identity, data, dataUuid) {
4537
3961
  var _yield$this$getGrants;
4538
3962
 
4539
3963
  var lockboxUuid;
4540
- return runtime_1.wrap(function _callee33$(_context34) {
3964
+ return _regeneratorRuntime().wrap(function _callee32$(_context33) {
4541
3965
  while (1) {
4542
- switch (_context34.prev = _context34.next) {
3966
+ switch (_context33.prev = _context33.next) {
4543
3967
  case 0:
4544
- _context34.next = 2;
3968
+ _context33.next = 2;
4545
3969
  return this.getGrants();
4546
3970
 
4547
3971
  case 2:
4548
- _context34.t0 = _yield$this$getGrants = _context34.sent.find(function (lockbox) {
3972
+ _context33.t0 = _yield$this$getGrants = _context33.sent.find(function (lockbox) {
4549
3973
  return lockbox.lockboxOwnerUuid === identity.id;
4550
3974
  });
4551
3975
 
4552
- if (!(_context34.t0 == null)) {
4553
- _context34.next = 7;
3976
+ if (!(_context33.t0 == null)) {
3977
+ _context33.next = 7;
4554
3978
  break;
4555
3979
  }
4556
3980
 
4557
- _context34.t1 = void 0;
4558
- _context34.next = 8;
3981
+ _context33.t1 = void 0;
3982
+ _context33.next = 8;
4559
3983
  break;
4560
3984
 
4561
3985
  case 7:
4562
- _context34.t1 = _yield$this$getGrants.lockboxUuid;
3986
+ _context33.t1 = _yield$this$getGrants.lockboxUuid;
4563
3987
 
4564
3988
  case 8:
4565
- lockboxUuid = _context34.t1;
3989
+ lockboxUuid = _context33.t1;
4566
3990
 
4567
3991
  if (!lockboxUuid) {
4568
- _context34.next = 13;
3992
+ _context33.next = 13;
4569
3993
  break;
4570
3994
  }
4571
3995
 
4572
- return _context34.abrupt("return", this.createJsonData(lockboxUuid, data, {
3996
+ return _context33.abrupt("return", this.createJsonData(lockboxUuid, data, {
4573
3997
  category: initApis.MetadataCategory.Personal,
4574
3998
  documentType: initApis.DocumentType.PopulatedWorkflowData
4575
3999
  }, {}, undefined, dataUuid));
@@ -4579,13 +4003,13 @@ var OroClient = /*#__PURE__*/function () {
4579
4003
 
4580
4004
  case 14:
4581
4005
  case "end":
4582
- return _context34.stop();
4006
+ return _context33.stop();
4583
4007
  }
4584
4008
  }
4585
- }, _callee33, this);
4009
+ }, _callee32, this);
4586
4010
  }));
4587
4011
 
4588
- function createPersonalInformations(_x87, _x88, _x89) {
4012
+ function createPersonalInformations(_x84, _x85, _x86) {
4589
4013
  return _createPersonalInformations.apply(this, arguments);
4590
4014
  }
4591
4015
 
@@ -4603,43 +4027,43 @@ var OroClient = /*#__PURE__*/function () {
4603
4027
  _proto.createUserPreference =
4604
4028
  /*#__PURE__*/
4605
4029
  function () {
4606
- var _createUserPreference = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee34(identity, preference, dataUuid) {
4030
+ var _createUserPreference = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(identity, preference, dataUuid) {
4607
4031
  var _yield$this$getGrants2;
4608
4032
 
4609
4033
  var lockboxUuid;
4610
- return runtime_1.wrap(function _callee34$(_context35) {
4034
+ return _regeneratorRuntime().wrap(function _callee33$(_context34) {
4611
4035
  while (1) {
4612
- switch (_context35.prev = _context35.next) {
4036
+ switch (_context34.prev = _context34.next) {
4613
4037
  case 0:
4614
- _context35.next = 2;
4038
+ _context34.next = 2;
4615
4039
  return this.getGrants();
4616
4040
 
4617
4041
  case 2:
4618
- _context35.t0 = _yield$this$getGrants2 = _context35.sent.find(function (lockbox) {
4042
+ _context34.t0 = _yield$this$getGrants2 = _context34.sent.find(function (lockbox) {
4619
4043
  return lockbox.lockboxOwnerUuid === identity.id;
4620
4044
  });
4621
4045
 
4622
- if (!(_context35.t0 == null)) {
4623
- _context35.next = 7;
4046
+ if (!(_context34.t0 == null)) {
4047
+ _context34.next = 7;
4624
4048
  break;
4625
4049
  }
4626
4050
 
4627
- _context35.t1 = void 0;
4628
- _context35.next = 8;
4051
+ _context34.t1 = void 0;
4052
+ _context34.next = 8;
4629
4053
  break;
4630
4054
 
4631
4055
  case 7:
4632
- _context35.t1 = _yield$this$getGrants2.lockboxUuid;
4056
+ _context34.t1 = _yield$this$getGrants2.lockboxUuid;
4633
4057
 
4634
4058
  case 8:
4635
- lockboxUuid = _context35.t1;
4059
+ lockboxUuid = _context34.t1;
4636
4060
 
4637
4061
  if (!lockboxUuid) {
4638
- _context35.next = 13;
4062
+ _context34.next = 13;
4639
4063
  break;
4640
4064
  }
4641
4065
 
4642
- return _context35.abrupt("return", this.createJsonData(lockboxUuid, preference, {
4066
+ return _context34.abrupt("return", this.createJsonData(lockboxUuid, preference, {
4643
4067
  category: initApis.MetadataCategory.Preference,
4644
4068
  contentType: 'application/json'
4645
4069
  }, {}, undefined, dataUuid));
@@ -4649,13 +4073,13 @@ var OroClient = /*#__PURE__*/function () {
4649
4073
 
4650
4074
  case 14:
4651
4075
  case "end":
4652
- return _context35.stop();
4076
+ return _context34.stop();
4653
4077
  }
4654
4078
  }
4655
- }, _callee34, this);
4079
+ }, _callee33, this);
4656
4080
  }));
4657
4081
 
4658
- function createUserPreference(_x90, _x91, _x92) {
4082
+ function createUserPreference(_x87, _x88, _x89) {
4659
4083
  return _createUserPreference.apply(this, arguments);
4660
4084
  }
4661
4085
 
@@ -4671,16 +4095,16 @@ var OroClient = /*#__PURE__*/function () {
4671
4095
  _proto.getDataFromGrant =
4672
4096
  /*#__PURE__*/
4673
4097
  function () {
4674
- var _getDataFromGrant = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee35(grant, filter) {
4098
+ var _getDataFromGrant = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34(grant, filter) {
4675
4099
  var lockboxUuid, lockboxOwnerUuid, identificationDataUuid;
4676
- return runtime_1.wrap(function _callee35$(_context36) {
4100
+ return _regeneratorRuntime().wrap(function _callee34$(_context35) {
4677
4101
  while (1) {
4678
- switch (_context36.prev = _context36.next) {
4102
+ switch (_context35.prev = _context35.next) {
4679
4103
  case 0:
4680
4104
  lockboxUuid = grant.lockboxUuid, lockboxOwnerUuid = grant.lockboxOwnerUuid;
4681
4105
 
4682
4106
  if (lockboxUuid) {
4683
- _context36.next = 3;
4107
+ _context35.next = 3;
4684
4108
  break;
4685
4109
  }
4686
4110
 
@@ -4688,42 +4112,42 @@ var OroClient = /*#__PURE__*/function () {
4688
4112
 
4689
4113
  case 3:
4690
4114
  if (lockboxOwnerUuid) {
4691
- _context36.next = 5;
4115
+ _context35.next = 5;
4692
4116
  break;
4693
4117
  }
4694
4118
 
4695
4119
  throw MissingLockboxOwner;
4696
4120
 
4697
4121
  case 5:
4698
- _context36.next = 7;
4122
+ _context35.next = 7;
4699
4123
  return this.getLockboxManifest(lockboxUuid, filter, false, grant.lockboxOwnerUuid, true);
4700
4124
 
4701
4125
  case 7:
4702
- identificationDataUuid = _context36.sent[0].dataUuid;
4703
- _context36.t0 = lockboxOwnerUuid;
4704
- _context36.t1 = lockboxUuid;
4705
- _context36.t2 = identificationDataUuid;
4706
- _context36.next = 13;
4126
+ identificationDataUuid = _context35.sent[0].dataUuid;
4127
+ _context35.t0 = lockboxOwnerUuid;
4128
+ _context35.t1 = lockboxUuid;
4129
+ _context35.t2 = identificationDataUuid;
4130
+ _context35.next = 13;
4707
4131
  return this.getJsonData(lockboxUuid, identificationDataUuid);
4708
4132
 
4709
4133
  case 13:
4710
- _context36.t3 = _context36.sent;
4711
- return _context36.abrupt("return", {
4712
- lockboxOwnerUuid: _context36.t0,
4713
- lockboxUuid: _context36.t1,
4714
- dataUuid: _context36.t2,
4715
- data: _context36.t3
4134
+ _context35.t3 = _context35.sent;
4135
+ return _context35.abrupt("return", {
4136
+ lockboxOwnerUuid: _context35.t0,
4137
+ lockboxUuid: _context35.t1,
4138
+ dataUuid: _context35.t2,
4139
+ data: _context35.t3
4716
4140
  });
4717
4141
 
4718
4142
  case 15:
4719
4143
  case "end":
4720
- return _context36.stop();
4144
+ return _context35.stop();
4721
4145
  }
4722
4146
  }
4723
- }, _callee35, this);
4147
+ }, _callee34, this);
4724
4148
  }));
4725
4149
 
4726
- function getDataFromGrant(_x93, _x94) {
4150
+ function getDataFromGrant(_x90, _x91) {
4727
4151
  return _getDataFromGrant.apply(this, arguments);
4728
4152
  }
4729
4153
 
@@ -4739,40 +4163,40 @@ var OroClient = /*#__PURE__*/function () {
4739
4163
  _proto.getUserPreferenceFromConsultId =
4740
4164
  /*#__PURE__*/
4741
4165
  function () {
4742
- var _getUserPreferenceFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee36(consultationId) {
4166
+ var _getUserPreferenceFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35(consultationId) {
4743
4167
  var grant;
4744
- return runtime_1.wrap(function _callee36$(_context37) {
4168
+ return _regeneratorRuntime().wrap(function _callee35$(_context36) {
4745
4169
  while (1) {
4746
- switch (_context37.prev = _context37.next) {
4170
+ switch (_context36.prev = _context36.next) {
4747
4171
  case 0:
4748
- _context37.next = 2;
4172
+ _context36.next = 2;
4749
4173
  return this.getGrantFromConsultId(consultationId);
4750
4174
 
4751
4175
  case 2:
4752
- grant = _context37.sent;
4176
+ grant = _context36.sent;
4753
4177
 
4754
4178
  if (grant) {
4755
- _context37.next = 5;
4179
+ _context36.next = 5;
4756
4180
  break;
4757
4181
  }
4758
4182
 
4759
4183
  throw MissingGrant;
4760
4184
 
4761
4185
  case 5:
4762
- return _context37.abrupt("return", this.getDataFromGrant(grant, {
4186
+ return _context36.abrupt("return", this.getDataFromGrant(grant, {
4763
4187
  category: initApis.MetadataCategory.Preference,
4764
4188
  contentType: 'application/json'
4765
4189
  }));
4766
4190
 
4767
4191
  case 6:
4768
4192
  case "end":
4769
- return _context37.stop();
4193
+ return _context36.stop();
4770
4194
  }
4771
4195
  }
4772
- }, _callee36, this);
4196
+ }, _callee35, this);
4773
4197
  }));
4774
4198
 
4775
- function getUserPreferenceFromConsultId(_x95) {
4199
+ function getUserPreferenceFromConsultId(_x92) {
4776
4200
  return _getUserPreferenceFromConsultId.apply(this, arguments);
4777
4201
  }
4778
4202
 
@@ -4788,42 +4212,42 @@ var OroClient = /*#__PURE__*/function () {
4788
4212
  _proto.getUserPreference =
4789
4213
  /*#__PURE__*/
4790
4214
  function () {
4791
- var _getUserPreference = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee37(identity) {
4215
+ var _getUserPreference = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(identity) {
4792
4216
  var grant;
4793
- return runtime_1.wrap(function _callee37$(_context38) {
4217
+ return _regeneratorRuntime().wrap(function _callee36$(_context37) {
4794
4218
  while (1) {
4795
- switch (_context38.prev = _context38.next) {
4219
+ switch (_context37.prev = _context37.next) {
4796
4220
  case 0:
4797
- _context38.next = 2;
4221
+ _context37.next = 2;
4798
4222
  return this.getGrants();
4799
4223
 
4800
4224
  case 2:
4801
- grant = _context38.sent.find(function (lockbox) {
4225
+ grant = _context37.sent.find(function (lockbox) {
4802
4226
  return lockbox.lockboxOwnerUuid === identity.id;
4803
4227
  });
4804
4228
 
4805
4229
  if (grant) {
4806
- _context38.next = 5;
4230
+ _context37.next = 5;
4807
4231
  break;
4808
4232
  }
4809
4233
 
4810
4234
  throw MissingGrant;
4811
4235
 
4812
4236
  case 5:
4813
- return _context38.abrupt("return", this.getDataFromGrant(grant, {
4237
+ return _context37.abrupt("return", this.getDataFromGrant(grant, {
4814
4238
  category: initApis.MetadataCategory.Preference,
4815
4239
  contentType: 'application/json'
4816
4240
  }));
4817
4241
 
4818
4242
  case 6:
4819
4243
  case "end":
4820
- return _context38.stop();
4244
+ return _context37.stop();
4821
4245
  }
4822
4246
  }
4823
- }, _callee37, this);
4247
+ }, _callee36, this);
4824
4248
  }));
4825
4249
 
4826
- function getUserPreference(_x96) {
4250
+ function getUserPreference(_x93) {
4827
4251
  return _getUserPreference.apply(this, arguments);
4828
4252
  }
4829
4253
 
@@ -4839,40 +4263,40 @@ var OroClient = /*#__PURE__*/function () {
4839
4263
  _proto.getRecoveryDataFromConsultId =
4840
4264
  /*#__PURE__*/
4841
4265
  function () {
4842
- var _getRecoveryDataFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee38(consultationId) {
4266
+ var _getRecoveryDataFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37(consultationId) {
4843
4267
  var grant;
4844
- return runtime_1.wrap(function _callee38$(_context39) {
4268
+ return _regeneratorRuntime().wrap(function _callee37$(_context38) {
4845
4269
  while (1) {
4846
- switch (_context39.prev = _context39.next) {
4270
+ switch (_context38.prev = _context38.next) {
4847
4271
  case 0:
4848
- _context39.next = 2;
4272
+ _context38.next = 2;
4849
4273
  return this.getGrantFromConsultId(consultationId);
4850
4274
 
4851
4275
  case 2:
4852
- grant = _context39.sent;
4276
+ grant = _context38.sent;
4853
4277
 
4854
4278
  if (grant) {
4855
- _context39.next = 5;
4279
+ _context38.next = 5;
4856
4280
  break;
4857
4281
  }
4858
4282
 
4859
4283
  throw MissingGrant;
4860
4284
 
4861
4285
  case 5:
4862
- return _context39.abrupt("return", this.getDataFromGrant(grant, {
4286
+ return _context38.abrupt("return", this.getDataFromGrant(grant, {
4863
4287
  category: initApis.MetadataCategory.Recovery,
4864
4288
  contentType: 'application/json'
4865
4289
  }));
4866
4290
 
4867
4291
  case 6:
4868
4292
  case "end":
4869
- return _context39.stop();
4293
+ return _context38.stop();
4870
4294
  }
4871
4295
  }
4872
- }, _callee38, this);
4296
+ }, _callee37, this);
4873
4297
  }));
4874
4298
 
4875
- function getRecoveryDataFromConsultId(_x97) {
4299
+ function getRecoveryDataFromConsultId(_x94) {
4876
4300
  return _getRecoveryDataFromConsultId.apply(this, arguments);
4877
4301
  }
4878
4302
 
@@ -4888,42 +4312,42 @@ var OroClient = /*#__PURE__*/function () {
4888
4312
  _proto.getRecoveryData =
4889
4313
  /*#__PURE__*/
4890
4314
  function () {
4891
- var _getRecoveryData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee39(identity) {
4315
+ var _getRecoveryData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38(identity) {
4892
4316
  var grant;
4893
- return runtime_1.wrap(function _callee39$(_context40) {
4317
+ return _regeneratorRuntime().wrap(function _callee38$(_context39) {
4894
4318
  while (1) {
4895
- switch (_context40.prev = _context40.next) {
4319
+ switch (_context39.prev = _context39.next) {
4896
4320
  case 0:
4897
- _context40.next = 2;
4321
+ _context39.next = 2;
4898
4322
  return this.getGrants();
4899
4323
 
4900
4324
  case 2:
4901
- grant = _context40.sent.find(function (lockbox) {
4325
+ grant = _context39.sent.find(function (lockbox) {
4902
4326
  return lockbox.lockboxOwnerUuid === identity.id;
4903
4327
  });
4904
4328
 
4905
4329
  if (grant) {
4906
- _context40.next = 5;
4330
+ _context39.next = 5;
4907
4331
  break;
4908
4332
  }
4909
4333
 
4910
4334
  throw MissingGrant;
4911
4335
 
4912
4336
  case 5:
4913
- return _context40.abrupt("return", this.getDataFromGrant(grant, {
4337
+ return _context39.abrupt("return", this.getDataFromGrant(grant, {
4914
4338
  category: initApis.MetadataCategory.Recovery,
4915
4339
  contentType: 'application/json'
4916
4340
  }));
4917
4341
 
4918
4342
  case 6:
4919
4343
  case "end":
4920
- return _context40.stop();
4344
+ return _context39.stop();
4921
4345
  }
4922
4346
  }
4923
- }, _callee39, this);
4347
+ }, _callee38, this);
4924
4348
  }));
4925
4349
 
4926
- function getRecoveryData(_x98) {
4350
+ function getRecoveryData(_x95) {
4927
4351
  return _getRecoveryData.apply(this, arguments);
4928
4352
  }
4929
4353
 
@@ -4944,48 +4368,44 @@ var OroClient = /*#__PURE__*/function () {
4944
4368
  _proto.getAssignedConsultations =
4945
4369
  /*#__PURE__*/
4946
4370
  function () {
4947
- var _getAssignedConsultations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee41(practiceUuid, forceRefresh) {
4948
- var _this5 = this;
4371
+ var _getAssignedConsultations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40(practiceUuid) {
4372
+ var _this4 = this;
4949
4373
 
4950
- return runtime_1.wrap(function _callee41$(_context42) {
4374
+ return _regeneratorRuntime().wrap(function _callee40$(_context41) {
4951
4375
  while (1) {
4952
- switch (_context42.prev = _context42.next) {
4376
+ switch (_context41.prev = _context41.next) {
4953
4377
  case 0:
4954
- if (forceRefresh === void 0) {
4955
- forceRefresh = false;
4956
- }
4957
-
4958
- _context42.t0 = Promise;
4959
- _context42.next = 4;
4960
- return this.getGrants(undefined, forceRefresh);
4378
+ _context41.t0 = Promise;
4379
+ _context41.next = 3;
4380
+ return this.getGrants();
4961
4381
 
4962
- case 4:
4963
- _context42.t1 = _context42.sent.map(function (grant) {
4964
- return _this5.getLockboxManifest(grant.lockboxUuid, {
4382
+ case 3:
4383
+ _context41.t1 = _context41.sent.map(function (grant) {
4384
+ return _this4.getLockboxManifest(grant.lockboxUuid, {
4965
4385
  category: initApis.MetadataCategory.Consultation,
4966
4386
  documentType: initApis.DocumentType.PopulatedWorkflowData
4967
- }, true, undefined, forceRefresh).then(function (manifest) {
4387
+ }, true, undefined).then(function (manifest) {
4968
4388
  return Promise.all(manifest.map( /*#__PURE__*/function () {
4969
- var _ref5 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee40(entry) {
4970
- return runtime_1.wrap(function _callee40$(_context41) {
4389
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39(entry) {
4390
+ return _regeneratorRuntime().wrap(function _callee39$(_context40) {
4971
4391
  while (1) {
4972
- switch (_context41.prev = _context41.next) {
4392
+ switch (_context40.prev = _context40.next) {
4973
4393
  case 0:
4974
- _context41.next = 2;
4975
- return _this5.consultClient.getConsultByUUID(entry.metadata.consultationId, practiceUuid);
4394
+ _context40.next = 2;
4395
+ return _this4.consultClient.getConsultByUUID(entry.metadata.consultationId, practiceUuid);
4976
4396
 
4977
4397
  case 2:
4978
- return _context41.abrupt("return", _context41.sent);
4398
+ return _context40.abrupt("return", _context40.sent);
4979
4399
 
4980
4400
  case 3:
4981
4401
  case "end":
4982
- return _context41.stop();
4402
+ return _context40.stop();
4983
4403
  }
4984
4404
  }
4985
- }, _callee40);
4405
+ }, _callee39);
4986
4406
  }));
4987
4407
 
4988
- return function (_x101) {
4408
+ return function (_x97) {
4989
4409
  return _ref5.apply(this, arguments);
4990
4410
  };
4991
4411
  }())).then(function (promise) {
@@ -4993,19 +4413,19 @@ var OroClient = /*#__PURE__*/function () {
4993
4413
  });
4994
4414
  });
4995
4415
  });
4996
- return _context42.abrupt("return", _context42.t0.all.call(_context42.t0, _context42.t1).then(function (consults) {
4416
+ return _context41.abrupt("return", _context41.t0.all.call(_context41.t0, _context41.t1).then(function (consults) {
4997
4417
  return consults.flat();
4998
4418
  }));
4999
4419
 
5000
- case 6:
4420
+ case 5:
5001
4421
  case "end":
5002
- return _context42.stop();
4422
+ return _context41.stop();
5003
4423
  }
5004
4424
  }
5005
- }, _callee41, this);
4425
+ }, _callee40, this);
5006
4426
  }));
5007
4427
 
5008
- function getAssignedConsultations(_x99, _x100) {
4428
+ function getAssignedConsultations(_x96) {
5009
4429
  return _getAssignedConsultations.apply(this, arguments);
5010
4430
  }
5011
4431
 
@@ -5021,85 +4441,85 @@ var OroClient = /*#__PURE__*/function () {
5021
4441
  _proto.getPastConsultationsFromConsultId =
5022
4442
  /*#__PURE__*/
5023
4443
  function () {
5024
- var _getPastConsultationsFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee43(consultationId, practiceUuid) {
5025
- var _this6 = this;
4444
+ var _getPastConsultationsFromConsultId = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42(consultationId, practiceUuid) {
4445
+ var _this5 = this;
5026
4446
 
5027
4447
  var grant, consultationsInLockbox;
5028
- return runtime_1.wrap(function _callee43$(_context44) {
4448
+ return _regeneratorRuntime().wrap(function _callee42$(_context43) {
5029
4449
  while (1) {
5030
- switch (_context44.prev = _context44.next) {
4450
+ switch (_context43.prev = _context43.next) {
5031
4451
  case 0:
5032
- _context44.next = 2;
4452
+ _context43.next = 2;
5033
4453
  return this.getGrantFromConsultId(consultationId);
5034
4454
 
5035
4455
  case 2:
5036
- grant = _context44.sent;
4456
+ grant = _context43.sent;
5037
4457
 
5038
4458
  if (grant) {
5039
- _context44.next = 5;
4459
+ _context43.next = 5;
5040
4460
  break;
5041
4461
  }
5042
4462
 
5043
- return _context44.abrupt("return", undefined);
4463
+ return _context43.abrupt("return", undefined);
5044
4464
 
5045
4465
  case 5:
5046
- _context44.next = 7;
4466
+ _context43.next = 7;
5047
4467
  return this.vaultClient.lockboxMetadataGet(grant.lockboxUuid, ['consultationId'], ['consultationId'], {
5048
4468
  category: initApis.MetadataCategory.Consultation,
5049
4469
  documentType: initApis.DocumentType.PopulatedWorkflowData
5050
4470
  }, grant.lockboxOwnerUuid);
5051
4471
 
5052
4472
  case 7:
5053
- consultationsInLockbox = _context44.sent.flat().map(function (metadata) {
4473
+ consultationsInLockbox = _context43.sent.flat().map(function (metadata) {
5054
4474
  return metadata.consultationId;
5055
4475
  });
5056
4476
 
5057
4477
  if (!(consultationsInLockbox.length == 0)) {
5058
- _context44.next = 10;
4478
+ _context43.next = 10;
5059
4479
  break;
5060
4480
  }
5061
4481
 
5062
- return _context44.abrupt("return", []);
4482
+ return _context43.abrupt("return", []);
5063
4483
 
5064
4484
  case 10:
5065
- _context44.next = 12;
4485
+ _context43.next = 12;
5066
4486
  return Promise.all(consultationsInLockbox.map( /*#__PURE__*/function () {
5067
- var _ref6 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee42(consultId) {
5068
- return runtime_1.wrap(function _callee42$(_context43) {
4487
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41(consultId) {
4488
+ return _regeneratorRuntime().wrap(function _callee41$(_context42) {
5069
4489
  while (1) {
5070
- switch (_context43.prev = _context43.next) {
4490
+ switch (_context42.prev = _context42.next) {
5071
4491
  case 0:
5072
- _context43.next = 2;
5073
- return _this6.consultClient.getConsultByUUID(consultId, practiceUuid);
4492
+ _context42.next = 2;
4493
+ return _this5.consultClient.getConsultByUUID(consultId, practiceUuid);
5074
4494
 
5075
4495
  case 2:
5076
- return _context43.abrupt("return", _context43.sent);
4496
+ return _context42.abrupt("return", _context42.sent);
5077
4497
 
5078
4498
  case 3:
5079
4499
  case "end":
5080
- return _context43.stop();
4500
+ return _context42.stop();
5081
4501
  }
5082
4502
  }
5083
- }, _callee42);
4503
+ }, _callee41);
5084
4504
  }));
5085
4505
 
5086
- return function (_x104) {
4506
+ return function (_x100) {
5087
4507
  return _ref6.apply(this, arguments);
5088
4508
  };
5089
4509
  }()));
5090
4510
 
5091
4511
  case 12:
5092
- return _context44.abrupt("return", _context44.sent);
4512
+ return _context43.abrupt("return", _context43.sent);
5093
4513
 
5094
4514
  case 13:
5095
4515
  case "end":
5096
- return _context44.stop();
4516
+ return _context43.stop();
5097
4517
  }
5098
4518
  }
5099
- }, _callee43, this);
4519
+ }, _callee42, this);
5100
4520
  }));
5101
4521
 
5102
- function getPastConsultationsFromConsultId(_x102, _x103) {
4522
+ function getPastConsultationsFromConsultId(_x98, _x99) {
5103
4523
  return _getPastConsultationsFromConsultId.apply(this, arguments);
5104
4524
  }
5105
4525
 
@@ -5116,48 +4536,48 @@ var OroClient = /*#__PURE__*/function () {
5116
4536
  _proto.getPatientConsultationData =
5117
4537
  /*#__PURE__*/
5118
4538
  function () {
5119
- var _getPatientConsultationData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee44(consultationId, forceRefresh) {
5120
- var _this7 = this;
4539
+ var _getPatientConsultationData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(consultationId, forceRefresh) {
4540
+ var _this6 = this;
5121
4541
 
5122
- return runtime_1.wrap(function _callee44$(_context45) {
4542
+ return _regeneratorRuntime().wrap(function _callee43$(_context44) {
5123
4543
  while (1) {
5124
- switch (_context45.prev = _context45.next) {
4544
+ switch (_context44.prev = _context44.next) {
5125
4545
  case 0:
5126
4546
  if (forceRefresh === void 0) {
5127
4547
  forceRefresh = false;
5128
4548
  }
5129
4549
 
5130
- _context45.t0 = Promise;
5131
- _context45.next = 4;
4550
+ _context44.t0 = Promise;
4551
+ _context44.next = 4;
5132
4552
  return this.getGrants({
5133
4553
  consultationId: consultationId
5134
- }, forceRefresh);
4554
+ });
5135
4555
 
5136
4556
  case 4:
5137
- _context45.t1 = _context45.sent.map(function (grant) {
5138
- return _this7.getLockboxManifest(grant.lockboxUuid, {
4557
+ _context44.t1 = _context44.sent.map(function (grant) {
4558
+ return _this6.getLockboxManifest(grant.lockboxUuid, {
5139
4559
  category: initApis.MetadataCategory.Consultation,
5140
4560
  documentType: initApis.DocumentType.PopulatedWorkflowData,
5141
4561
  consultationId: consultationId
5142
4562
  }, true, grant.lockboxOwnerUuid, forceRefresh).then(function (manifest) {
5143
4563
  return Promise.all(manifest.map(function (e) {
5144
- return _this7.getJsonData(grant.lockboxUuid, e.dataUuid, grant.lockboxOwnerUuid);
4564
+ return _this6.getJsonData(grant.lockboxUuid, e.dataUuid, grant.lockboxOwnerUuid);
5145
4565
  }));
5146
4566
  });
5147
4567
  }).flat();
5148
- return _context45.abrupt("return", _context45.t0.all.call(_context45.t0, _context45.t1).then(function (data) {
4568
+ return _context44.abrupt("return", _context44.t0.all.call(_context44.t0, _context44.t1).then(function (data) {
5149
4569
  return data.flat();
5150
4570
  }));
5151
4571
 
5152
4572
  case 6:
5153
4573
  case "end":
5154
- return _context45.stop();
4574
+ return _context44.stop();
5155
4575
  }
5156
4576
  }
5157
- }, _callee44, this);
4577
+ }, _callee43, this);
5158
4578
  }));
5159
4579
 
5160
- function getPatientConsultationData(_x105, _x106) {
4580
+ function getPatientConsultationData(_x101, _x102) {
5161
4581
  return _getPatientConsultationData.apply(this, arguments);
5162
4582
  }
5163
4583
 
@@ -5173,25 +4593,25 @@ var OroClient = /*#__PURE__*/function () {
5173
4593
  _proto.getPatientPrescriptionsList =
5174
4594
  /*#__PURE__*/
5175
4595
  function () {
5176
- var _getPatientPrescriptionsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee45(consultationId) {
5177
- return runtime_1.wrap(function _callee45$(_context46) {
4596
+ var _getPatientPrescriptionsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44(consultationId) {
4597
+ return _regeneratorRuntime().wrap(function _callee44$(_context45) {
5178
4598
  while (1) {
5179
- switch (_context46.prev = _context46.next) {
4599
+ switch (_context45.prev = _context45.next) {
5180
4600
  case 0:
5181
- return _context46.abrupt("return", this.getPatientDocumentsList({
4601
+ return _context45.abrupt("return", this.getPatientDocumentsList({
5182
4602
  category: initApis.MetadataCategory.Consultation,
5183
4603
  documentType: initApis.DocumentType.Prescription
5184
4604
  }, true, consultationId));
5185
4605
 
5186
4606
  case 1:
5187
4607
  case "end":
5188
- return _context46.stop();
4608
+ return _context45.stop();
5189
4609
  }
5190
4610
  }
5191
- }, _callee45, this);
4611
+ }, _callee44, this);
5192
4612
  }));
5193
4613
 
5194
- function getPatientPrescriptionsList(_x107) {
4614
+ function getPatientPrescriptionsList(_x103) {
5195
4615
  return _getPatientPrescriptionsList.apply(this, arguments);
5196
4616
  }
5197
4617
 
@@ -5207,25 +4627,25 @@ var OroClient = /*#__PURE__*/function () {
5207
4627
  _proto.getPatientResultsList =
5208
4628
  /*#__PURE__*/
5209
4629
  function () {
5210
- var _getPatientResultsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee46(consultationId) {
5211
- return runtime_1.wrap(function _callee46$(_context47) {
4630
+ var _getPatientResultsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45(consultationId) {
4631
+ return _regeneratorRuntime().wrap(function _callee45$(_context46) {
5212
4632
  while (1) {
5213
- switch (_context47.prev = _context47.next) {
4633
+ switch (_context46.prev = _context46.next) {
5214
4634
  case 0:
5215
- return _context47.abrupt("return", this.getPatientDocumentsList({
4635
+ return _context46.abrupt("return", this.getPatientDocumentsList({
5216
4636
  category: initApis.MetadataCategory.Consultation,
5217
4637
  documentType: initApis.DocumentType.Result
5218
4638
  }, true, consultationId));
5219
4639
 
5220
4640
  case 1:
5221
4641
  case "end":
5222
- return _context47.stop();
4642
+ return _context46.stop();
5223
4643
  }
5224
4644
  }
5225
- }, _callee46, this);
4645
+ }, _callee45, this);
5226
4646
  }));
5227
4647
 
5228
- function getPatientResultsList(_x108) {
4648
+ function getPatientResultsList(_x104) {
5229
4649
  return _getPatientResultsList.apply(this, arguments);
5230
4650
  }
5231
4651
 
@@ -5241,25 +4661,25 @@ var OroClient = /*#__PURE__*/function () {
5241
4661
  _proto.getPatientTreatmentPlans =
5242
4662
  /*#__PURE__*/
5243
4663
  function () {
5244
- var _getPatientTreatmentPlans = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee47(consultationId) {
5245
- return runtime_1.wrap(function _callee47$(_context48) {
4664
+ var _getPatientTreatmentPlans = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee46(consultationId) {
4665
+ return _regeneratorRuntime().wrap(function _callee46$(_context47) {
5246
4666
  while (1) {
5247
- switch (_context48.prev = _context48.next) {
4667
+ switch (_context47.prev = _context47.next) {
5248
4668
  case 0:
5249
- return _context48.abrupt("return", this.getPatientDocumentsList({
4669
+ return _context47.abrupt("return", this.getPatientDocumentsList({
5250
4670
  category: initApis.MetadataCategory.Consultation,
5251
4671
  documentType: initApis.DocumentType.TreatmentPlan
5252
4672
  }, true, consultationId));
5253
4673
 
5254
4674
  case 1:
5255
4675
  case "end":
5256
- return _context48.stop();
4676
+ return _context47.stop();
5257
4677
  }
5258
4678
  }
5259
- }, _callee47, this);
4679
+ }, _callee46, this);
5260
4680
  }));
5261
4681
 
5262
- function getPatientTreatmentPlans(_x109) {
4682
+ function getPatientTreatmentPlans(_x105) {
5263
4683
  return _getPatientTreatmentPlans.apply(this, arguments);
5264
4684
  }
5265
4685
 
@@ -5276,12 +4696,12 @@ var OroClient = /*#__PURE__*/function () {
5276
4696
  _proto.getPatientTreatmentPlanByUuid =
5277
4697
  /*#__PURE__*/
5278
4698
  function () {
5279
- var _getPatientTreatmentPlanByUuid = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee48(consultationId, treatmentPlanId) {
5280
- return runtime_1.wrap(function _callee48$(_context49) {
4699
+ var _getPatientTreatmentPlanByUuid = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47(consultationId, treatmentPlanId) {
4700
+ return _regeneratorRuntime().wrap(function _callee47$(_context48) {
5281
4701
  while (1) {
5282
- switch (_context49.prev = _context49.next) {
4702
+ switch (_context48.prev = _context48.next) {
5283
4703
  case 0:
5284
- return _context49.abrupt("return", this.getPatientDocumentsList({
4704
+ return _context48.abrupt("return", this.getPatientDocumentsList({
5285
4705
  category: initApis.MetadataCategory.Consultation,
5286
4706
  documentType: initApis.DocumentType.TreatmentPlan,
5287
4707
  treatmentPlanId: treatmentPlanId
@@ -5289,13 +4709,13 @@ var OroClient = /*#__PURE__*/function () {
5289
4709
 
5290
4710
  case 1:
5291
4711
  case "end":
5292
- return _context49.stop();
4712
+ return _context48.stop();
5293
4713
  }
5294
4714
  }
5295
- }, _callee48, this);
4715
+ }, _callee47, this);
5296
4716
  }));
5297
4717
 
5298
- function getPatientTreatmentPlanByUuid(_x110, _x111) {
4718
+ function getPatientTreatmentPlanByUuid(_x106, _x107) {
5299
4719
  return _getPatientTreatmentPlanByUuid.apply(this, arguments);
5300
4720
  }
5301
4721
 
@@ -5315,62 +4735,62 @@ var OroClient = /*#__PURE__*/function () {
5315
4735
  _proto.getPatientDocumentsList =
5316
4736
  /*#__PURE__*/
5317
4737
  function () {
5318
- var _getPatientDocumentsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee50(filters, expandPrivateMetadata, consultationId) {
5319
- var _this8 = this;
4738
+ var _getPatientDocumentsList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee49(filters, expandPrivateMetadata, consultationId) {
4739
+ var _this7 = this;
5320
4740
 
5321
- return runtime_1.wrap(function _callee50$(_context51) {
4741
+ return _regeneratorRuntime().wrap(function _callee49$(_context50) {
5322
4742
  while (1) {
5323
- switch (_context51.prev = _context51.next) {
4743
+ switch (_context50.prev = _context50.next) {
5324
4744
  case 0:
5325
- _context51.t0 = Promise;
5326
- _context51.next = 3;
4745
+ _context50.t0 = Promise;
4746
+ _context50.next = 3;
5327
4747
  return this.getGrants({
5328
4748
  consultationId: consultationId
5329
4749
  });
5330
4750
 
5331
4751
  case 3:
5332
- _context51.t1 = _context51.sent.map(function (grant) {
5333
- return _this8.getLockboxManifest(grant.lockboxUuid, _extends({}, filters, {
4752
+ _context50.t1 = _context50.sent.map(function (grant) {
4753
+ return _this7.getLockboxManifest(grant.lockboxUuid, _extends({}, filters, {
5334
4754
  consultationId: consultationId
5335
4755
  }), expandPrivateMetadata, grant.lockboxOwnerUuid, true).then(function (manifest) {
5336
4756
  return Promise.all(manifest.map( /*#__PURE__*/function () {
5337
- var _ref7 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee49(entry) {
5338
- return runtime_1.wrap(function _callee49$(_context50) {
4757
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee48(entry) {
4758
+ return _regeneratorRuntime().wrap(function _callee48$(_context49) {
5339
4759
  while (1) {
5340
- switch (_context50.prev = _context50.next) {
4760
+ switch (_context49.prev = _context49.next) {
5341
4761
  case 0:
5342
- return _context50.abrupt("return", _extends({
4762
+ return _context49.abrupt("return", _extends({
5343
4763
  lockboxOwnerUuid: grant.lockboxOwnerUuid,
5344
4764
  lockboxUuid: grant.lockboxUuid
5345
4765
  }, entry));
5346
4766
 
5347
4767
  case 1:
5348
4768
  case "end":
5349
- return _context50.stop();
4769
+ return _context49.stop();
5350
4770
  }
5351
4771
  }
5352
- }, _callee49);
4772
+ }, _callee48);
5353
4773
  }));
5354
4774
 
5355
- return function (_x115) {
4775
+ return function (_x111) {
5356
4776
  return _ref7.apply(this, arguments);
5357
4777
  };
5358
4778
  }()));
5359
4779
  });
5360
4780
  }).flat();
5361
- return _context51.abrupt("return", _context51.t0.all.call(_context51.t0, _context51.t1).then(function (data) {
4781
+ return _context50.abrupt("return", _context50.t0.all.call(_context50.t0, _context50.t1).then(function (data) {
5362
4782
  return data.flat();
5363
4783
  }));
5364
4784
 
5365
4785
  case 5:
5366
4786
  case "end":
5367
- return _context51.stop();
4787
+ return _context50.stop();
5368
4788
  }
5369
4789
  }
5370
- }, _callee50, this);
4790
+ }, _callee49, this);
5371
4791
  }));
5372
4792
 
5373
- function getPatientDocumentsList(_x112, _x113, _x114) {
4793
+ function getPatientDocumentsList(_x108, _x109, _x110) {
5374
4794
  return _getPatientDocumentsList.apply(this, arguments);
5375
4795
  }
5376
4796
 
@@ -5393,17 +4813,17 @@ var OroClient = /*#__PURE__*/function () {
5393
4813
  _proto.recoverPrivateKeyFromSecurityQuestions =
5394
4814
  /*#__PURE__*/
5395
4815
  function () {
5396
- var _recoverPrivateKeyFromSecurityQuestions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee51(id, recoverySecurityQuestions, recoverySecurityAnswers, threshold) {
4816
+ var _recoverPrivateKeyFromSecurityQuestions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee50(id, recoverySecurityQuestions, recoverySecurityAnswers, threshold) {
5397
4817
  var shards, answeredShards, privateKey;
5398
- return runtime_1.wrap(function _callee51$(_context52) {
4818
+ return _regeneratorRuntime().wrap(function _callee50$(_context51) {
5399
4819
  while (1) {
5400
- switch (_context52.prev = _context52.next) {
4820
+ switch (_context51.prev = _context51.next) {
5401
4821
  case 0:
5402
- _context52.next = 2;
4822
+ _context51.next = 2;
5403
4823
  return this.guardClient.identityGet(id);
5404
4824
 
5405
4825
  case 2:
5406
- shards = _context52.sent.recoverySecurityQuestions;
4826
+ shards = _context51.sent.recoverySecurityQuestions;
5407
4827
  answeredShards = shards.filter(function (shard) {
5408
4828
  // filters all answered security questions
5409
4829
  var indexOfQuestion = recoverySecurityQuestions.indexOf(shard.securityQuestion);
@@ -5426,13 +4846,13 @@ var OroClient = /*#__PURE__*/function () {
5426
4846
 
5427
4847
  case 5:
5428
4848
  case "end":
5429
- return _context52.stop();
4849
+ return _context51.stop();
5430
4850
  }
5431
4851
  }
5432
- }, _callee51, this);
4852
+ }, _callee50, this);
5433
4853
  }));
5434
4854
 
5435
- function recoverPrivateKeyFromSecurityQuestions(_x116, _x117, _x118, _x119) {
4855
+ function recoverPrivateKeyFromSecurityQuestions(_x112, _x113, _x114, _x115) {
5436
4856
  return _recoverPrivateKeyFromSecurityQuestions.apply(this, arguments);
5437
4857
  }
5438
4858
 
@@ -5449,17 +4869,17 @@ var OroClient = /*#__PURE__*/function () {
5449
4869
  _proto.recoverPrivateKeyFromPassword =
5450
4870
  /*#__PURE__*/
5451
4871
  function () {
5452
- var _recoverPrivateKeyFromPassword = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee52(id, password) {
4872
+ var _recoverPrivateKeyFromPassword = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee51(id, password) {
5453
4873
  var identity, recoveryPayload, symmetricDecryptor, privateKey, symetricEncryptor;
5454
- return runtime_1.wrap(function _callee52$(_context53) {
4874
+ return _regeneratorRuntime().wrap(function _callee51$(_context52) {
5455
4875
  while (1) {
5456
- switch (_context53.prev = _context53.next) {
4876
+ switch (_context52.prev = _context52.next) {
5457
4877
  case 0:
5458
- _context53.next = 2;
4878
+ _context52.next = 2;
5459
4879
  return this.guardClient.identityGet(id);
5460
4880
 
5461
4881
  case 2:
5462
- identity = _context53.sent;
4882
+ identity = _context52.sent;
5463
4883
  recoveryPayload = identity.recoveryPassword;
5464
4884
  symmetricDecryptor = this.toolbox.CryptoChaCha.fromPassphrase(password);
5465
4885
  privateKey = symmetricDecryptor.base64PayloadDecryptToBytes(recoveryPayload);
@@ -5474,13 +4894,13 @@ var OroClient = /*#__PURE__*/function () {
5474
4894
 
5475
4895
  case 8:
5476
4896
  case "end":
5477
- return _context53.stop();
4897
+ return _context52.stop();
5478
4898
  }
5479
4899
  }
5480
- }, _callee52, this);
4900
+ }, _callee51, this);
5481
4901
  }));
5482
4902
 
5483
- function recoverPrivateKeyFromPassword(_x120, _x121) {
4903
+ function recoverPrivateKeyFromPassword(_x116, _x117) {
5484
4904
  return _recoverPrivateKeyFromPassword.apply(this, arguments);
5485
4905
  }
5486
4906
 
@@ -5497,30 +4917,30 @@ var OroClient = /*#__PURE__*/function () {
5497
4917
  _proto.recoverPrivateKeyFromMasterKey =
5498
4918
  /*#__PURE__*/
5499
4919
  function () {
5500
- var _recoverPrivateKeyFromMasterKey = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee53(id, masterKey) {
4920
+ var _recoverPrivateKeyFromMasterKey = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee52(id, masterKey) {
5501
4921
  var recoveryPayload, symmetricDecryptor, privateKey;
5502
- return runtime_1.wrap(function _callee53$(_context54) {
4922
+ return _regeneratorRuntime().wrap(function _callee52$(_context53) {
5503
4923
  while (1) {
5504
- switch (_context54.prev = _context54.next) {
4924
+ switch (_context53.prev = _context53.next) {
5505
4925
  case 0:
5506
- _context54.next = 2;
4926
+ _context53.next = 2;
5507
4927
  return this.guardClient.identityGet(id);
5508
4928
 
5509
4929
  case 2:
5510
- recoveryPayload = _context54.sent.recoveryMasterKey;
4930
+ recoveryPayload = _context53.sent.recoveryMasterKey;
5511
4931
  symmetricDecryptor = this.toolbox.CryptoChaCha.fromPassphrase(masterKey);
5512
4932
  privateKey = symmetricDecryptor.base64PayloadDecryptToBytes(recoveryPayload);
5513
4933
  this.rsa = this.toolbox.CryptoRSA.fromKey(privateKey);
5514
4934
 
5515
4935
  case 6:
5516
4936
  case "end":
5517
- return _context54.stop();
4937
+ return _context53.stop();
5518
4938
  }
5519
4939
  }
5520
- }, _callee53, this);
4940
+ }, _callee52, this);
5521
4941
  }));
5522
4942
 
5523
- function recoverPrivateKeyFromMasterKey(_x122, _x123) {
4943
+ function recoverPrivateKeyFromMasterKey(_x118, _x119) {
5524
4944
  return _recoverPrivateKeyFromMasterKey.apply(this, arguments);
5525
4945
  }
5526
4946
 
@@ -5539,14 +4959,14 @@ var OroClient = /*#__PURE__*/function () {
5539
4959
  _proto.updateSecurityQuestions =
5540
4960
  /*#__PURE__*/
5541
4961
  function () {
5542
- var _updateSecurityQuestions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee54(id, recoverySecurityQuestions, recoverySecurityAnswers, threshold) {
4962
+ var _updateSecurityQuestions = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee53(id, recoverySecurityQuestions, recoverySecurityAnswers, threshold) {
5543
4963
  var securityQuestionPayload, updateRequest;
5544
- return runtime_1.wrap(function _callee54$(_context55) {
4964
+ return _regeneratorRuntime().wrap(function _callee53$(_context54) {
5545
4965
  while (1) {
5546
- switch (_context55.prev = _context55.next) {
4966
+ switch (_context54.prev = _context54.next) {
5547
4967
  case 0:
5548
4968
  if (this.rsa) {
5549
- _context55.next = 2;
4969
+ _context54.next = 2;
5550
4970
  break;
5551
4971
  }
5552
4972
 
@@ -5557,21 +4977,21 @@ var OroClient = /*#__PURE__*/function () {
5557
4977
  updateRequest = {
5558
4978
  recoverySecurityQuestions: securityQuestionPayload
5559
4979
  };
5560
- _context55.next = 6;
4980
+ _context54.next = 6;
5561
4981
  return this.guardClient.identityUpdate(id, updateRequest);
5562
4982
 
5563
4983
  case 6:
5564
- return _context55.abrupt("return", _context55.sent);
4984
+ return _context54.abrupt("return", _context54.sent);
5565
4985
 
5566
4986
  case 7:
5567
4987
  case "end":
5568
- return _context55.stop();
4988
+ return _context54.stop();
5569
4989
  }
5570
4990
  }
5571
- }, _callee54, this);
4991
+ }, _callee53, this);
5572
4992
  }));
5573
4993
 
5574
- function updateSecurityQuestions(_x124, _x125, _x126, _x127) {
4994
+ function updateSecurityQuestions(_x120, _x121, _x122, _x123) {
5575
4995
  return _updateSecurityQuestions.apply(this, arguments);
5576
4996
  }
5577
4997
 
@@ -5593,14 +5013,14 @@ var OroClient = /*#__PURE__*/function () {
5593
5013
  _proto.updatePassword =
5594
5014
  /*#__PURE__*/
5595
5015
  function () {
5596
- var _updatePassword = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee55(id, newPassword, oldPassword) {
5016
+ var _updatePassword = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee54(id, newPassword, oldPassword) {
5597
5017
  var symmetricEncryptor, passwordPayload, updateRequest;
5598
- return runtime_1.wrap(function _callee55$(_context56) {
5018
+ return _regeneratorRuntime().wrap(function _callee54$(_context55) {
5599
5019
  while (1) {
5600
- switch (_context56.prev = _context56.next) {
5020
+ switch (_context55.prev = _context55.next) {
5601
5021
  case 0:
5602
5022
  if (this.rsa) {
5603
- _context56.next = 2;
5023
+ _context55.next = 2;
5604
5024
  break;
5605
5025
  }
5606
5026
 
@@ -5622,21 +5042,21 @@ var OroClient = /*#__PURE__*/function () {
5622
5042
  },
5623
5043
  recoveryPassword: passwordPayload
5624
5044
  };
5625
- _context56.next = 9;
5045
+ _context55.next = 9;
5626
5046
  return this.guardClient.identityUpdate(id, updateRequest);
5627
5047
 
5628
5048
  case 9:
5629
- return _context56.abrupt("return", _context56.sent);
5049
+ return _context55.abrupt("return", _context55.sent);
5630
5050
 
5631
5051
  case 10:
5632
5052
  case "end":
5633
- return _context56.stop();
5053
+ return _context55.stop();
5634
5054
  }
5635
5055
  }
5636
- }, _callee55, this);
5056
+ }, _callee54, this);
5637
5057
  }));
5638
5058
 
5639
- function updatePassword(_x128, _x129, _x130) {
5059
+ function updatePassword(_x124, _x125, _x126) {
5640
5060
  return _updatePassword.apply(this, arguments);
5641
5061
  }
5642
5062
 
@@ -5655,14 +5075,14 @@ var OroClient = /*#__PURE__*/function () {
5655
5075
  _proto.updateMasterKey =
5656
5076
  /*#__PURE__*/
5657
5077
  function () {
5658
- var _updateMasterKey = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee56(id, masterKey, lockboxUuid) {
5078
+ var _updateMasterKey = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee55(id, masterKey, lockboxUuid) {
5659
5079
  var symmetricEncryptor, masterKeyPayload, updateRequest, updatedIdentity;
5660
- return runtime_1.wrap(function _callee56$(_context57) {
5080
+ return _regeneratorRuntime().wrap(function _callee55$(_context56) {
5661
5081
  while (1) {
5662
- switch (_context57.prev = _context57.next) {
5082
+ switch (_context56.prev = _context56.next) {
5663
5083
  case 0:
5664
5084
  if (this.rsa) {
5665
- _context57.next = 2;
5085
+ _context56.next = 2;
5666
5086
  break;
5667
5087
  }
5668
5088
 
@@ -5674,12 +5094,12 @@ var OroClient = /*#__PURE__*/function () {
5674
5094
  updateRequest = {
5675
5095
  recoveryMasterKey: masterKeyPayload
5676
5096
  };
5677
- _context57.next = 7;
5097
+ _context56.next = 7;
5678
5098
  return this.guardClient.identityUpdate(id, updateRequest);
5679
5099
 
5680
5100
  case 7:
5681
- updatedIdentity = _context57.sent;
5682
- _context57.next = 10;
5101
+ updatedIdentity = _context56.sent;
5102
+ _context56.next = 10;
5683
5103
  return this.getOrInsertJsonData(lockboxUuid, {
5684
5104
  masterKey: masterKey
5685
5105
  }, {
@@ -5688,17 +5108,17 @@ var OroClient = /*#__PURE__*/function () {
5688
5108
  }, {}, true);
5689
5109
 
5690
5110
  case 10:
5691
- return _context57.abrupt("return", updatedIdentity);
5111
+ return _context56.abrupt("return", updatedIdentity);
5692
5112
 
5693
5113
  case 11:
5694
5114
  case "end":
5695
- return _context57.stop();
5115
+ return _context56.stop();
5696
5116
  }
5697
5117
  }
5698
- }, _callee56, this);
5118
+ }, _callee55, this);
5699
5119
  }));
5700
5120
 
5701
- function updateMasterKey(_x131, _x132, _x133) {
5121
+ function updateMasterKey(_x127, _x128, _x129) {
5702
5122
  return _updateMasterKey.apply(this, arguments);
5703
5123
  }
5704
5124
 
@@ -5811,6 +5231,7 @@ exports.AssociatedLockboxNotFound = AssociatedLockboxNotFound;
5811
5231
  exports.CliniaService = CliniaService;
5812
5232
  exports.IncompleteAuthentication = IncompleteAuthentication;
5813
5233
  exports.MissingGrant = MissingGrant;
5234
+ exports.MissingGrantFilter = MissingGrantFilter;
5814
5235
  exports.MissingLockbox = MissingLockbox;
5815
5236
  exports.MissingLockboxOwner = MissingLockboxOwner;
5816
5237
  exports.OroClient = OroClient;