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