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