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