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