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