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