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