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