oro-sdk-apis 1.41.0 → 1.44.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,2 +1,2 @@
1
- "use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e=require("hash.js"),r=require("buffer/"),n=t(require("axios-auth-refresh")),i=t(require("axios"));function s(t){return r.Buffer.from(e.sha256().update(t).digest("hex"),"hex").toString("base64")}function a(t,e,r,n,i,s,a){try{var o=t[s](a),c=o.value}catch(t){return void r(t)}o.done?e(c):Promise.resolve(c).then(n,i)}function o(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var s=t.apply(e,r);function o(t){a(s,n,i,o,c,"next",t)}function c(t){a(s,n,i,o,c,"throw",t)}o(void 0)}))}}function c(){return(c=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function u(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,h(t,e)}function p(t){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function h(t,e){return(h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function f(t,e,r){return(f=l()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&h(i,r.prototype),i}).apply(null,arguments)}function d(t){var e="function"==typeof Map?new Map:void 0;return(d=function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return f(t,arguments,p(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),h(r,t)})(t)}var v,m,g,y,x,b,R,w,P,k,L,U,C=(function(t){var e=function(t){var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",s=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function o(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{o({},"")}catch(t){o=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var i=Object.create((e&&e.prototype instanceof h?e:h).prototype),s=new P(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(i,s){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw s;return{value:void 0,done:!0}}for(r.method=i,r.arg=s;;){var a=r.delegate;if(a){var o=b(a,r);if(o){if(o===p)continue;return o}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===p)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(t,r,s),i}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var p={};function h(){}function l(){}function f(){}var d={};o(d,i,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(k([])));m&&m!==e&&r.call(m,i)&&(d=m);var g=f.prototype=h.prototype=Object.create(d);function y(t){["next","throw","return"].forEach((function(e){o(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){var n;this._invoke=function(i,s){function a(){return new e((function(n,a){!function n(i,s,a,o){var c=u(t[i],t,s);if("throw"!==c.type){var p=c.arg,h=p.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,o)}),(function(t){n("throw",t,a,o)})):e.resolve(h).then((function(t){p.value=t,a(p)}),(function(t){return n("throw",t,a,o)}))}o(c.arg)}(i,s,n,a)}))}return n=n?n.then(a,a):a()}}function b(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return p;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,p;var i=n.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function R(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(R,this),this.reset(!0)}function k(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,s=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return s.next=s}}return{next:L}}function L(){return{value:void 0,done:!0}}return l.prototype=f,o(g,"constructor",f),o(f,"constructor",l),l.displayName=o(f,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,o(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},y(x.prototype),o(x.prototype,s,(function(){return this})),t.AsyncIterator=x,t.async=function(e,r,n,i,s){void 0===s&&(s=Promise);var a=new x(c(e,r,n,i),s);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},y(g),o(g,a,"Generator"),o(g,i,(function(){return this})),o(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=k,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var o=r.call(s,"catchLoc"),c=r.call(s,"finallyLoc");if(o&&c){if(this.prev<s.catchLoc)return n(s.catchLoc,!0);if(this.prev<s.finallyLoc)return n(s.finallyLoc)}else if(o){if(this.prev<s.catchLoc)return n(s.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return n(s.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var s=i;break}}s&&("break"===t||"continue"===t)&&s.tryLoc<=e&&e<=s.finallyLoc&&(s=null);var a=s?s.completion:{};return a.type=t,a.arg=e,s?(this.method="next",this.next=s.finallyLoc,p):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;w(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:k(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}}(U={exports:{}}),U.exports),T=function(){function t(t){t||(t={}),this.axios=i.create(t)}var e=t.prototype;return e.apiRequest=function(){var t=o(C.mark((function t(e,r,n){return C.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.headers||(e.headers={}),e.headers["Content-Type"]="application/json",t.abrupt("return",this.axios(c({},e,{url:r,data:n})).then((function(t){return t.data})));case 3:case"end":return t.stop()}}),t,this)})));return function(e,r,n){return t.apply(this,arguments)}}(),e.apiRequestHeader=function(){var t=o(C.mark((function t(e,r,n,i){return C.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.headers||(e.headers={}),e.headers["Content-Type"]="application/json",t.abrupt("return",this.axios(c({},e,{url:r,data:i})).then((function(t){var e;return n?null!=(e=t.headers[n])?e:t.headers[n.toLowerCase()]:t.headers})));case 3:case"end":return t.stop()}}),t,this)})));return function(e,r,n,i){return t.apply(this,arguments)}}(),e.get=function(t,e){return this.apiRequest(c({},e,{method:"get"}),t)},e.deleteRequest=function(t,e){return this.apiRequest(c({},e,{method:"delete"}),t)},e.post=function(t,e,r){return this.apiRequest(c({},r,{method:"post"}),t,e)},e.put=function(t,e,r){return this.apiRequest(c({},r,{method:"put"}),t,e)},e.patch=function(t,e,r){return this.apiRequest(c({},r,{method:"patch"}),t,e)},e.head=function(t,e,r,n){return this.apiRequestHeader(c({},e,{method:"head"}),t,r,n)},t}(),S=function(t){function e(e,r,i){var s;(s=t.call(this,r)||this).useLocalStorage=e,s.tokenRefreshFailureCallback=i,s.tokens={};var a=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(s);return s.axios.interceptors.request.use((function(t){var e=t.useRefreshToken?a.getTokens().refreshToken:a.getTokens().accessToken;return t.headers=c({},t.headers,{Authorization:"Bearer "+e}),t}),(function(t){Promise.reject(t)})),n(s.axios,function(){var t=o(C.mark((function t(e){var r;return C.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!a.authRefreshFn){t.next=15;break}return t.prev=1,t.next=4,a.authRefreshFn(a.getTokens().refreshToken);case 4:return a.setTokens({accessToken:(r=t.sent).accessToken,refreshToken:r.refreshToken}),e.response.config.headers.Authorization="Bearer "+a.getTokens().accessToken,t.abrupt("return",Promise.resolve());case 10:return t.prev=10,t.t0=t.catch(1),console.error("an error occured while refreshing tokens (notifying callback)",t.t0),a.tokenRefreshFailureCallback&&a.tokenRefreshFailureCallback(e),t.abrupt("return",Promise.resolve());case 15:return console.error("The request could not refresh the token (authRefreshFn was not set)",e),t.abrupt("return",Promise.resolve());case 17:case"end":return t.stop()}}),t,null,[[1,10]])})));return function(e){return t.apply(this,arguments)}}(),{statusCodes:[401,403]}),s}u(e,t);var r=e.prototype;return r.setAuthRefreshFn=function(t){this.authRefreshFn=t},r.setTokens=function(t){this.useLocalStorage&&localStorage.setItem("tokens",JSON.stringify(t)),this.tokens=t},r.getTokens=function(){if(this.useLocalStorage){var t={},e=localStorage.getItem("tokens");return e&&(t=JSON.parse(e)),t}return this.tokens},e}(T),F=function(){function t(t,e,r){void 0===r&&(r=!1),this.serviceCollReq=t,this.getAuthTokenCbk=e,this.useLocalStorage=r,this.practiceInstances=new Map}return t.prototype.get=function(){var t=o(C.mark((function t(e){var r,n,i,s=this;return C.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r=this.practiceInstances.get(e))){t.next=3;break}return t.abrupt("return",r);case 3:return n=ht(this.serviceCollReq,void 0,this.useLocalStorage),i=function(){var t=o(C.mark((function t(){return C.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n.guardService){t.next=7;break}return console.log("[Auth] Refresh auth called (practiceUuid: "+e+")"),t.next=4,s.getAuthTokenCbk(n.guardService,e);case 4:return t.abrupt("return",t.sent);case 7:throw Error("[Auth] Unable to refresh token guard service is undefined");case 8:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),t.next=7,i();case 7:return n.apiService.setAuthRefreshFn(i),this.practiceInstances.set(e,n),t.abrupt("return",n);case 10:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),t}();(v=exports.AssistantType||(exports.AssistantType={})).MedicalSecretary="MedicalSecretary",v.Nurse="Nurse",v.Specialist="Specialist",v.Administrative="Administrative",v.Other="Other",(m=exports.TransmissionKind||(exports.TransmissionKind={})).Fax="Fax",m.Email="Email",m.SMS="SMS",m.EncryptedEmail="EncryptedEmail",m.Logs="Logs",m.API="API",m.Other="Other",(g=exports.TransmissionStatus||(exports.TransmissionStatus={})).Preparing="Preparing",g.Sending="Sending",g.Sent="Sent",g.Retrying="Retrying",g.Failed="Failed",g.DriverError="DriverError",g.TimedOut="TimedOut",g.ReceiverNotExist="ReceiverNotExist",g.ReceiverNotAnswering="ReceiverNotAnswering",g.ReceiverIncompatible="ReceiverIncompatible",(y=exports.FeeStatus||(exports.FeeStatus={})).NoFee="NoFee",y.Pending="Pending",y.Paid="Paid",y.Reimbursed="Reimbursed",y.Cancelled="Cancelled",y.Contested="Contested",(x=exports.MedicalStatus||(exports.MedicalStatus={})).Creating="Creating",x.New="New",x.ToAnswer="ToAnswer",x.Answered="Answered",x.Closed="Closed",x.Reopened="Reopened",x.Archived="Archived",(b=exports.TaskStatus||(exports.TaskStatus={})).None="None",b.ToDo="ToDo",b.InProgress="InProgress",b.Blocked="Blocked",b.Done="Done",(R=exports.ClosedReasonType||(exports.ClosedReasonType={})).Completed="Completed",R.NotADisease="NotADisease",R.NotAppropriateForVirtual="NotAppropriateForVirtual",R.Other="Other",R.RequiresInPerson="RequiresInPerson",(w=exports.VisibilityType||(exports.VisibilityType={})).Generic="Generic",w.Private="Private",w.Instance="Instance",(P=exports.DrugType||(exports.DrugType={})).Generic="Generic",P.Instance="Instance",(k=exports.PrescriptionStatus||(exports.PrescriptionStatus={})).Existing="Existing",k.Deleted="Deleted",(L=exports.PlanStatus||(exports.PlanStatus={})).Pending="Pending",L.Accepted="Accepted",L.Rejected="Rejected";var A,E,I,D,O,G,_,N,q,M,B,j,K,V,W,H,Q,Y,z=function(t){function e(){return t.apply(this,arguments)||this}return u(e,t),e}(d(Error)),J=function(t){function e(){return t.apply(this,arguments)||this}return u(e,t),e}(d(Error)),X=function(t){function e(){return t.apply(this,arguments)||this}return u(e,t),e}(d(Error)),Z=function(t){function e(){return t.apply(this,arguments)||this}return u(e,t),e}(d(Error)),$=function(t){function e(){return t.apply(this,arguments)||this}return u(e,t),e}(d(Error)),tt=function(t){function e(){return t.apply(this,arguments)||this}return u(e,t),e}(d(Error)),et=function(t){function e(){return t.apply(this,arguments)||this}return u(e,t),e}(d(Error)),rt=function(t){function e(){return t.apply(this,arguments)||this}return u(e,t),e}(d(Error));(A=exports.WorkflowType||(exports.WorkflowType={})).Onboard="Onboard",A.Followup="Followup",A.Renew="Renew",A.DataRetrieve="DataRetrieve",(E=exports.RateDimension||(exports.RateDimension={})).RatioOnTotal="RatioOnTotal",E.FixedOnTotal="FixedOnTotal",E.RatioPlatformFee="RatioPlatformFee",E.FixedPlatformFee="FixedPlatformFee",E.RatioOnPlatformFeeTotal="RatioOnPlatformFeeTotal",E.FixedOnPlatformFeeTotal="FixedOnPlatformFeeTotal",E.RatioOnItem="RatioOnItem",E.FixedOnItem="FixedOnItem",(I=exports.PlanType||(exports.PlanType={})).Onboard="Onboard",I.Followup="Followup",I.Renew="Renew",I.DataRetrieve="DataRetrieve",(D=exports.PaymentStatus||(exports.PaymentStatus={})).Pending="Pending",D.Success="Success",D.Failure="Failure",D.Canceled="Canceled",(O=exports.PractitionerStatus||(exports.PractitionerStatus={})).Practicing="Practicing",O.Retired="Retired",O.NotInvolvedAnymore="NotInvolvedAnymore",O.Deactivated="Deactivated",O.Flagged="Flagged",O.InConflict="InConflict",O.Delicensed="Delicensed",(G=exports.AssignmentStatus||(exports.AssignmentStatus={})).Assigned="Assigned",G.Reassigned="Reassigned",G.Cancelled="Cancelled",(_=exports.PractitionnerRoleType||(exports.PractitionnerRoleType={})).Doctor="Doctor",_.MedicalAssistant="MedicalAssistant",_.MedicalSecretary="MedicalSecretary",_.Nurse="Nurse",_.Specialist="Specialist",_.LabAssistant="LabAssistant",_.Administrative="Administrative",_.ManualDispatcher="ManualDispatcher",_.Other="Other",(N=exports.OtherRoleType||(exports.OtherRoleType={})).Patient="Patient",N.User="User",N.System="System",(q=exports.LicenseStatus||(exports.LicenseStatus={})).Valid="Valid",q.Invalid="Invalid",q.Expired="Expired",q.NA="NA",q.Removed="Removed",(M=exports.PeriodType||(exports.PeriodType={})).PerYear="PerYear",M.PerQuarter="PerQuarter",M.PerMonth="PerMonth",M.PerWeek="PerWeek",M.PerBusinessDay="PerBusinessDay",M.PerDay="PerDay",M.PerHour="PerHour",(B=exports.SyncStatus||(exports.SyncStatus={})).Requested="Requested",B.Started="Started",B.Succeeded="Succeeded",B.Failed="Failed",B.Cancelled="Cancelled",(j=exports.PracticeEmailKind||(exports.PracticeEmailKind={})).SignedUp="SignedUp",j.Onboarded="Onboarded",j.OnboardedPractitioner="OnboardedPractitioner",j.OnboardedPatient="OnboardedPatient",j.Answered="Answered",j.ToAnswer="ToAnswer",j.FollowedUp="FollowedUp",j.Renewed="Renewed",j.DataRetrieved="DataRetrieved",j.Closed="Closed",j.PasswordRecovery="PasswordRecovery",j.FaxFailed="FaxFailed",j.ExamResult="ExamResult",j.Reassigned="Reassigned",j.OnlinePharmacyFaxSent="OnlinePharmacyFaxSent",j.ResumeConsult="ResumeConsult",(K=exports.PracticeConfigKind||(exports.PracticeConfigKind={})).PracticeCloseConsultationTypes="PracticeCloseConsultationTypes",K.PracticeConfigExample="PracticeConfigExample",K.PracticeCookieBanner="PracticeCookieBanner",K.PracticeCssVariables="PracticeCssVariables",K.PracticeFontsLinks="PracticeFontsLinks",K.PracticeLocaleSwitcher="PracticeLocaleSwitcher",K.PracticePharmacyPicker="PracticePharmacyPicker",K.PracticePrescriptionFields="PracticePrescriptionFields",K.PractitionerChatbox="PractitionerChatbox",K.PractitionerConsultList="PractitionerConsultList",K.PractitionerSearch="PractitionerSearch",(V=exports.StripePriceType||(exports.StripePriceType={})).Default="Default",V.Discount="Discount",(W=exports.IndexKey||(exports.IndexKey={})).Consultation="Consultation",W.IndexSnapshot="IndexSnapshot",W.ConsultationLockbox="ConsultationLockbox",(H=exports.DocumentType||(exports.DocumentType={})).Message="Message",H.Note="Note",H.DoctorsNote="DoctorsNote",H.Prescription="Prescription",H.ExamRequest="ExamRequest",H.Result="Result",H.Attachment="Attachment",H.BigFile="BigFile",H.MeetingRequest="MeetingRequest",H.AudioNote="AudioNote",H.VideoNote="VideoNote",H.PopulatedWorkflowData="PopulatedWorkflowData",H.TreatmentPlan="TreatmentPlan",H.ImageAlias="ImageAlias",(Q=exports.MetadataCategory||(exports.MetadataCategory={})).ChildPersonal="ChildPersonal",Q.Consultation="Consultation",Q.DataRetrieval="DataRetrieval",Q.Followup="Followup",Q.Recovery="Recovery",Q.Medical="Medical",Q.OtherPersonal="OtherPersonal",Q.Personal="Personal",Q.Preference="Preference",Q.Prescription="Prescription",Q.Raw="Raw",(Y=exports.IndexKind||(exports.IndexKind={}))[Y.consultUuid=0]="consultUuid",Y[Y.consultShortid=1]="consultShortid",Y[Y.firstName=2]="firstName",Y[Y.lastName=3]="lastName",Y[Y.healthId=4]="healthId",Y[Y.dob=5]="dob";var nt=function(){function t(t,e){this.api=t,this.baseURL=e}var e=t.prototype;return e.consultCreate=function(t){return this.api.post(this.baseURL+"/v1/consults",t)},e.countConsults=function(t,e,r,n,i,s,a,o,c,u,p,h,l){return this.api.head(this.baseURL+"/v1/consults",{params:{uuidPractice:t,uuidRequester:e,statusesMedical:r,statusesExclude:n,shortId:i,perPage:o,page:c,sortColumns:s,orderColumns:a,filterAssignedDoctor:u,filterCurrentPractitioner:p,filterIsoLocality:h,filterAssignee:l}},"Content-Range").then((function(t){return!t||"string"!=typeof t&&"number"!=typeof t?0:"number"==typeof t?t:parseInt(t)}))},e.getConsults=function(t,e,r,n,i,s,a,o,c,u,p,h,l){return this.api.get(this.baseURL+"/v1/consults",{params:{uuidPractice:t,uuidRequester:e,statusesMedical:r,statusesExclude:n,shortId:i,perPage:o,page:c,sortColumns:s,orderColumns:a,filterAssignedDoctor:u,filterCurrentPractitioner:p,filterIsoLocality:h,filterAssignee:l}})},e.getConsultByUUID=function(t,e){return this.api.get(this.baseURL+"/v1/consults/"+t,{params:{uuidPractice:e}})},e.updateConsultByUUID=function(t,e,r,n){return this.api.put(this.baseURL+"/v1/consults/"+t,e,{params:{uuidPractice:r,uuidRequester:n}})},e.getConsultFaxStatuses=function(t){return this.api.get(this.baseURL+"/v1/consults/"+t+"/transmissions",{params:{kind:exports.TransmissionKind.Fax}})},e.postConsultTransmission=function(t,e,r,n,i,s,a){void 0===e&&(e="Documo");var o=new FormData;return o.append("nameDriverReceiver",e),r&&o.append("addressReceiver",r),n&&o.append("file",n),i&&o.append("nameReceiver",i),s&&o.append("txtTransmissionTitle",s),a&&o.append("txtTransmissionNotes",a),this.api.post(this.baseURL+"/v1/consults/"+t+"/transmissions",o,{headers:{"Content-Type":"multipart/form-data;"}})},e.postConsultFax=function(t,e,r){return this.postConsultTransmission(t,"Documo",e,r)},e.postConsultEmail=function(t,e){return this.postConsultTransmission(t,"Pharmacierge",void 0,e)},e.retryConsultFax=function(t,e){return this.api.put(this.baseURL+"/v1/consults/"+t+"/transmissions/"+e,{status:exports.TransmissionStatus.Retrying})},e.updateConsultTransmissionStatus=function(t,e,r){return this.api.put(this.baseURL+"/v1/consults/"+e+"/transmissions/"+t,{status:r})},t}(),it=function(){function t(t,e){this.api=t,this.baseURL=e}var e=t.prototype;return e.getDiagnoses=function(){return this.api.get(this.baseURL+"/v1/diagnoses")},e.getDiagnosisByUuid=function(t){return this.api.get(this.baseURL+"/v1/diagnoses/"+t)},e.createDiagnosis=function(t){return this.api.post(this.baseURL+"/v1/diagnoses",t)},e.updateDiagnosis=function(t,e){return this.api.put(this.baseURL+"/v1/diagnoses/"+t,e)},e.getTreatmentsFromDiagnosisUuid=function(t){return this.api.get(this.baseURL+"/v1/diagnoses/"+t+"/treatments")},e.getTreatmentPlansFromConsultUuid=function(t){return this.api.get(this.baseURL+"/v1/treatment-plans/",{params:{uuidConsult:t}})},e.createTreatment=function(t,e){return this.api.post(this.baseURL+"/v1/diagnoses/"+t+"/treatments",e)},e.getTreatmentPlansPopulatedFromConsultUuid=function(t){return this.api.get(this.baseURL+"/v1/treatment-plans/",{params:{uuidConsult:t,populated:!0}})},e.postPlans=function(t){return this.api.post(this.baseURL+"/v1/treatment-plans",t)},e.updateTreatmentPlan=function(t,e,r,n){return this.api.put(this.baseURL+"/v1/treatment-plans/"+t,{uuidConsult:e,diagnosis:r,plan:n})},e.acceptTreatmentPlan=function(t,e){return this.api.put(this.baseURL+"/v1/treatment-plans/"+t+"/accept",{uuidConsult:e})},e.getAllDrugs=function(){var t=o(C.mark((function t(e){var r;return C.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.api.get(this.baseURL+"/v1/drugs/practice/"+e);case 2:if(!(r=t.sent)||!r.foundDrugs){t.next=5;break}return t.abrupt("return",r.foundDrugs);case 5:return t.abrupt("return",void 0);case 6:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),t}(),st=function(){function t(t,e){this.api=t,this.baseURL=e,this.api.setAuthRefreshFn(this.authRefresh.bind(this)),this.identityCache={},this.whoAmICache={}}var e=t.prototype;return e.setTokens=function(t){this.api.setTokens(c({},this.api.getTokens(),t))},e.m2mToken=function(){var t=o(C.mark((function t(e){var r,n,i,s;return C.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,n={skipAuthRefresh:!0},t.next=4,this.api.post(this.baseURL+"/v1/m2m/token",e,n);case 4:this.api.setTokens({accessToken:(r=t.sent).accessToken}),t.next=20;break;case 8:if(t.prev=8,t.t0=t.catch(0),console.error("Error while posting m2m token:",t.t0),!t.t0.isAxiosError){t.next=19;break}s=null==(i=t.t0.response)?void 0:i.status,t.t1=s,t.next=400===t.t1?16:500===t.t1?17:18;break;case 16:throw new J;case 17:throw new X;case 18:case 19:throw new z;case 20:return t.abrupt("return",r);case 21:case"end":return t.stop()}}),t,this,[[0,8]])})));return function(e){return t.apply(this,arguments)}}(),e.authToken=function(){var t=o(C.mark((function t(e){var r,n,i,s;return C.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,n={skipAuthRefresh:!0},t.next=4,this.api.post(this.baseURL+"/v1/auth/token",e,n);case 4:this.api.setTokens({accessToken:(r=t.sent).accessToken,refreshToken:r.refreshToken}),t.next=21;break;case 8:if(t.prev=8,t.t0=t.catch(0),console.error("Error while posting auth token:",t.t0),!t.t0.isAxiosError){t.next=20;break}s=null==(i=t.t0.response)?void 0:i.status,t.t1=s,t.next=400===t.t1?16:424===t.t1?17:500===t.t1?18:19;break;case 16:throw new J;case 17:throw new Z;case 18:throw new X;case 19:case 20:throw new z;case 21:return t.abrupt("return",r);case 22:case"end":return t.stop()}}),t,this,[[0,8]])})));return function(e){return t.apply(this,arguments)}}(),e.authRefresh=function(){var t=o(C.mark((function t(e){return C.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.put(this.baseURL+"/v1/auth/token",null,{skipAuthRefresh:!0,useRefreshToken:!0}));case 2:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.authLogout=function(){var t=o(C.mark((function t(){return C.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.get(this.baseURL+"/v1/auth/logout"));case 1:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),e.authRecover=function(){var t=o(C.mark((function t(e){return C.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.post(this.baseURL+"/v1/auth/recover",e));case 1:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.identityCreate=function(){var t=o(C.mark((function t(e){var r,n,i;return C.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.api.post(this.baseURL+"/v1/identities",e);case 3:this.api.setTokens({refreshToken:(r=t.sent).refreshToken}),t.next=18;break;case 7:if(t.prev=7,t.t0=t.catch(0),!t.t0.isAxiosError){t.next=17;break}i=null==(n=t.t0.response)?void 0:n.status,t.t1=i,t.next=400===t.t1?14:409===t.t1?15:16;break;case 14:throw new tt;case 15:throw new et;case 16:case 17:throw new $;case 18:return t.abrupt("return",r);case 19:case"end":return t.stop()}}),t,this,[[0,7]])})));return function(e){return t.apply(this,arguments)}}(),e.identityGet=function(){var t=o(C.mark((function t(e,r){var n,i,s,a,o;return C.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0===r&&(r=!1),s=this.api.getTokens(),a=(null!=(n=s.accessToken)?n:"")+(null!=(i=s.refreshToken)?i:"")+e,!r&&s.accessToken&&this.identityCache[a]){t.next=10;break}return t.next=6,this.api.get(this.baseURL+"/v1/identities/"+e);case 6:if(o=t.sent,!r){t.next=9;break}return t.abrupt("return",o);case 9:this.identityCache[a]=o;case 10:return t.abrupt("return",this.identityCache[a]);case 11:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),e.whoAmI=function(){var t=o(C.mark((function t(e){var r,n;return C.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0===e&&(e=!1),n=null!=(r=this.api.getTokens().accessToken)?r:"",this.whoAmICache[n]&&!e){t.next=6;break}return t.next=5,this.api.get(this.baseURL+"/v1/auth/whoami");case 5:this.whoAmICache[n]=t.sent;case 6:return t.abrupt("return",this.whoAmICache[n]);case 7:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.identityUpdate=function(){var t=o(C.mark((function t(e,r){return C.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.put(this.baseURL+"/v1/identities/"+e,r));case 1:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),e.identityMFAQRCode=function(){var t=o(C.mark((function t(e,r){return C.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.post(this.baseURL+"/v1/identities/"+e+"/mfa",{password:r},{headers:{Accept:"application/json"}}));case 2:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),e.identitySendConfirmEmail=function(){var t=o(C.mark((function t(e){return C.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.post(this.baseURL+"/v1/identity/confirm",e));case 1:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.identityGetByCustomerEmail=function(){var t=o(C.mark((function t(e){return C.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.identityGetByHash(e.substring(e.indexOf("+")+1,e.indexOf("@"))));case 1:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.identityGetByHash=function(){var t=o(C.mark((function t(e){return C.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.identityGet(e.replace("+","-").replace("/","_")));case 1:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),t}(),at=function(){function t(t,e){this.api=t,this.baseURL=e}var e=t.prototype;return e.index=function(t,e){return this.api.post(this.baseURL+"/v1/index",{consultUUID:t,terms:e})},e.search=function(t){return this.api.post(this.baseURL+"/v1/search",{terms:t})},t}(),ot=function(){function t(t,e){this.api=t,this.baseURL=e}var e=t.prototype;return e.practiceGetFromURL=function(t,e){return this.api.get(this.baseURL+"/v1/practices",{params:c({url_practice:t},e)})},e.practiceGetFromUuid=function(t,e,r){return this.api.get(this.baseURL+"/v1/practices/"+t,{params:{locale:e,accounts:r}})},e.practiceConfigGetFromPracticeUuid=function(t){return this.api.get(this.baseURL+"/v1/practices/"+t+"/configs")},e.practiceConfigGetByKindForPracticeUuid=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/configs/"+e)},e.practiceConfigCreateForPracticeUuid=function(t,e){return this.api.post(this.baseURL+"/v1/practices/"+t+"/configs",e)},e.practiceConfigUpdate=function(t){return this.api.put(this.baseURL+"/v1/practices/"+t.uuidPractice+"/configs/"+t.kind,t)},e.practiceGetAccounts=function(t){return this.api.get(this.baseURL+"/v1/practices/"+t+"/accounts")},e.practiceGetAccount=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/accounts/"+e)},e.practiceGetWorkflows=function(t){return this.api.get(this.baseURL+"/v1/practices/"+t+"/workflows")},e.practiceGetWorkflow=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/workflows/"+e)},e.practiceGetPlans=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/plans",{params:{kind:e}})},e.practiceGetPlan=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/plans/"+e)},e.practiceGetPlanPrices=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/plans/"+e+"/prices")},e.practiceGetPayments=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/payments",{params:{kind:e}})},e.practiceGetPayment=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/payments/"+e)},e.practiceGetPaymentForStripePaymentIntentWithID=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/payments/"+e)},e.practiceGetPaymentsIntents=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/payments/intents",{params:{kind:e}})},e.getPaymentIntentHashedEmail=function(t){return s(t.toLowerCase())},e.practiceCreatePaymentsIntent=function(t,e,r,n,i,s){return this.api.post(this.baseURL+"/v1/practices/"+t+"/payments/intents/",{idPlan:e,hashUserEmail:r?this.getPaymentIntentHashedEmail(r):void 0,isoLocality:n,consultRequest:s},{params:{url_subdomain:i}})},e.practiceGetPaymentsIntent=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/payments/intents/"+e)},e.practiceUpdatePaymentsIntent=function(t,e,r,n,i,s){return this.api.put(this.baseURL+"/v1/practices/"+t+"/payments/intents/"+e,c({},r,{hashUserEmail:n?this.getPaymentIntentHashedEmail(n):void 0}),{params:{promotionCode:i,finalize:s}})},e.getInvoice=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/payments/invoices/"+e)},e.practiceGetPractitioners=function(t){return this.api.get(this.baseURL+"/v1/practices/"+t+"/practitioners")},e.practiceUpdatePractitioner=function(t,e,r){return this.api.put(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e,r)},e.practiceGetPractitioner=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e)},e.practiceGetPractitionerLicenses=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e+"/licenses")},e.practiceCreatePractitionerLicense=function(t,e,r){return this.api.post(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e+"/licenses",r)},e.practiceUpdatePractitionerLicense=function(t,e,r,n){return this.api.put(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e+"/licenses/"+r,n)},e.practiceGetPractitionerLicense=function(t,e,r){return this.api.get(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e+"/licenses/"+r)},e.practiceGetPractitionerPreferences=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e+"/preferences")},e.practiceCreatePractitionerPreference=function(t,e,r){return this.api.post(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e+"/preferences",r)},e.practiceUpdatePractitionerPreference=function(t,e,r,n){return this.api.put(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e+"/preferences/"+r,n)},e.practiceGetPractitionerPreference=function(t,e,r){return this.api.get(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e+"/preferences/"+r)},e.practiceGetPractitionerRoles=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e+"/roles")},e.practiceCreatePractitionerRole=function(t,e,r){return this.api.post(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e+"/roles",r)},e.practiceDeletePractitionerRoles=function(t,e){return this.api.deleteRequest(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e+"/roles")},e.practiceUpdatePractitionerRole=function(t,e,r,n){return this.api.put(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e+"/roles/"+r,n)},e.practiceGetPractitionerRole=function(t,e,r){return this.api.get(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e+"/roles/"+r)},e.practiceDeletePractitionerRole=function(t,e,r){return this.api.deleteRequest(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e+"/roles/"+r)},e.practiceGetPractitionerSignature=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e+"/signature",{responseType:"blob"})},e.practiceGetAssignments=function(t){return this.api.get(this.baseURL+"/v1/practices/"+t+"/assignments")},e.practiceCreateAssignment=function(t,e){return this.api.post(this.baseURL+"/v1/practices/"+t+"/assignments",e)},e.practiceUpdateAssignment=function(t,e,r){return this.api.put(this.baseURL+"/v1/practices/"+t+"/assignments/"+e,r)},e.practiceGetAssignment=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/assignments/"+e)},e.practiceGetQuotas=function(t){return this.api.get(this.baseURL+"/v1/practices/"+t+"/quotas")},e.practiceGetQuota=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/quotas/"+e)},t}(),ct=function(){function t(t,e){this.api=t,this.baseURL=e}var e=t.prototype;return e.lockboxDataStore=function(){var t=o(C.mark((function t(e,r,n,i){return C.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.post(this.baseURL+"/v1/lockboxes/"+e+"/data",r,{params:{lockbox_owner_uuid:n,data_uuid:i}}));case 1:case"end":return t.stop()}}),t,this)})));return function(e,r,n,i){return t.apply(this,arguments)}}(),e.updateConsultByUUID=function(t,e,r,n,i,s){return this.api.put(this.baseURL+"/v1/consults/"+e,{patientUuid:t,statusMedical:r,closedReasonType:n,closedReasonDescription:i,neverExpires:s})},e.notifyFaxFailed=function(t,e,r,n){return this.api.post(this.baseURL+"/v1/fax-failed",{consultationUuid:e,consultationShortId:r,fax:n},{params:{practice_uuid:t}})},e.reassignmentEmail=function(t,e){return this.api.post(this.baseURL+"/v1/consult/"+t+"/reassignment-email",{newPractitionerUuid:e})},e.sendOnlineFaxSuccessfulEmail=function(t,e){return this.api.post(this.baseURL+"/v1/online-fax-notify",{consult:t,patientUuid:e})},e.sendResumeConsultEmail=function(t){return this.api.post(this.baseURL+"/v1/resume-consult-email",t)},t}(),ut=function(){function t(t,e){this.api=t,this.baseURL=e}var e=t.prototype;return e.lockboxCreate=function(){var t=o(C.mark((function t(e){return C.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.post(this.baseURL+"/v1/lockbox",e));case 1:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.lockboxMetadataAdd=function(){var t=o(C.mark((function t(e,r,n){return C.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.put(this.baseURL+"/v1/lockbox/"+e,r,{params:{lockbox_owner_uuid:n}}));case 1:case"end":return t.stop()}}),t,this)})));return function(e,r,n){return t.apply(this,arguments)}}(),e.lockboxSecretGet=function(){var t=o(C.mark((function t(e,r){return C.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.get(this.baseURL+"/v1/lockboxes/"+e+"/secret",{params:{lockbox_owner_uuid:r}}));case 1:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),e.lockboxGrant=function(){var t=o(C.mark((function t(e,r,n){return C.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.post(this.baseURL+"/v1/lockboxes/"+e+"/grant",r,{params:{lockbox_owner_uuid:n}}));case 1:case"end":return t.stop()}}),t,this)})));return function(e,r,n){return t.apply(this,arguments)}}(),e.grantsGet=function(){var t=o(C.mark((function t(){return C.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.get(this.baseURL+"/v1/grants"));case 1:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),e.lockboxDataStore=function(){var t=o(C.mark((function t(e,r,n,i){return C.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.post(this.baseURL+"/v1/lockboxes/"+e+"/data",r,{params:{lockbox_owner_uuid:n,data_uuid:i}}));case 1:case"end":return t.stop()}}),t,this)})));return function(e,r,n,i){return t.apply(this,arguments)}}(),e.lockboxDataGet=function(){var t=o(C.mark((function t(e,r,n,i){var s;return C.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return void 0===i&&(i=!0),t.next=3,this.api.get(this.baseURL+"/v1/lockboxes/"+e+"/data/"+r,{params:{lockbox_owner_uuid:n,stream:i}});case 3:if(s=t.sent,!i){t.next=6;break}return t.abrupt("return",{data:s});case 6:return t.abrupt("return",s);case 7:case"end":return t.stop()}}),t,this)})));return function(e,r,n,i){return t.apply(this,arguments)}}(),e.lockboxManifestGet=function(){var t=o(C.mark((function t(e,r,n){return C.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.get(this.baseURL+"/v1/lockboxes/"+e,{params:{lockbox_owner_uuid:n,filter:r}}));case 1:case"end":return t.stop()}}),t,this)})));return function(e,r,n){return t.apply(this,arguments)}}(),e.lockboxMetadataGet=function(){var t=o(C.mark((function t(e,r,n,i,s){return C.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.get(this.baseURL+"/v1/lockboxes/"+e+"/metadata",{params:{lockbox_owner_uuid:s,fields:r,groupby:n,filter:i}}));case 1:case"end":return t.stop()}}),t,this)})));return function(e,r,n,i,s){return t.apply(this,arguments)}}(),e.vaultIndexPut=function(){var t=o(C.mark((function t(e,r){return C.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.put(this.baseURL+"/v1/index",e,{params:{index_owner_uuid:r}}));case 1:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),e.vaultIndexSnapshotPut=function(){var t=o(C.mark((function t(e){return C.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.put(this.baseURL+"/v1/index-snapshot",e));case 1:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.vaultIndexGet=function(){var t=o(C.mark((function t(e,r,n){return C.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.get(this.baseURL+"/v1/index",{params:{index_keys:e,identifiers:r,timestamp:n}}));case 1:case"end":return t.stop()}}),t,this)})));return function(e,r,n){return t.apply(this,arguments)}}(),t}(),pt=function(){function t(t,e){this.api=t,this.v1Url=e+"/v1"}var e=t.prototype;return e.getWorkflows=function(){return this.api.get(this.v1Url+"/workflows")},e.getWorkflow=function(t,e,r){return this.api.get(this.v1Url+"/workflows/"+t,{params:{locale:e,createdAt:r}})},t}(),ht=function(t,e,r){void 0===r&&(r=!0);var n=t.tellerBaseURL,i=t.practiceBaseURL,s=t.consultBaseURL,a=t.vaultBaseURL,o=t.guardBaseURL,c=t.searchBaseURL,u=t.workflowBaseURL,p=t.diagnosisBaseURL,h=new S(r,void 0,e);return{apiService:h,tellerService:n?new ct(h,n):void 0,practiceService:i?new ot(h,i):void 0,consultService:s?new nt(h,s):void 0,vaultService:a?new ut(h,a):void 0,guardService:o?new st(h,o):void 0,searchService:c?new at(h,c):void 0,workflowService:u?new pt(h,u):void 0,diagnosisService:p?new it(h,p):void 0}};exports.APIService=S,exports.ApisPracticeManager=F,exports.AuthenticationBadRequest=J,exports.AuthenticationFailed=z,exports.AuthenticationServerError=X,exports.AuthenticationUnconfirmedEmail=Z,exports.AxiosService=T,exports.ConsultService=nt,exports.DiagnosisService=it,exports.GuardService=st,exports.IdentityCreationBadRequest=tt,exports.IdentityCreationConflict=et,exports.IdentityCreationFailed=$,exports.PracticeService=ot,exports.SearchService=at,exports.TellerService=ct,exports.VaultDataMissing=rt,exports.VaultService=ut,exports.WorkflowService=pt,exports.default=ht,exports.hashToBase64String=s,exports.init=ht;
1
+ "use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e=require("hash.js"),r=require("buffer/"),n=t(require("axios-auth-refresh")),i=t(require("axios"));function s(t){return r.Buffer.from(e.sha256().update(t).digest("hex"),"hex").toString("base64")}function a(){a=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",s=n.asyncIterator||"@@asyncIterator",o=n.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var i=Object.create((e&&e.prototype instanceof l?e:l).prototype),s=new k(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(i,s){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw s;return{value:void 0,done:!0}}for(r.method=i,r.arg=s;;){var a=r.delegate;if(a){var o=R(a,r);if(o){if(o===h)continue;return o}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=p(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(t,r,s),i}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var h={};function l(){}function f(){}function d(){}var v={};c(v,i,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(L([])));g&&g!==e&&r.call(g,i)&&(v=g);var y=d.prototype=l.prototype=Object.create(v);function x(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){var n;this._invoke=function(i,s){function a(){return new e((function(n,a){!function n(i,s,a,o){var c=p(t[i],t,s);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,o)}),(function(t){n("throw",t,a,o)})):e.resolve(h).then((function(t){u.value=t,a(u)}),(function(t){return n("throw",t,a,o)}))}o(c.arg)}(i,s,n,a)}))}return n=n?n.then(a,a):a()}}function R(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,R(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=p(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var i=n.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function w(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function L(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,s=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return s.next=s}}return{next:U}}function U(){return{value:void 0,done:!0}}return f.prototype=d,c(y,"constructor",d),c(d,"constructor",f),f.displayName=c(d,o,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,o,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},x(b.prototype),c(b.prototype,s,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,i,s){void 0===s&&(s=Promise);var a=new b(u(e,r,n,i),s);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(y),c(y,o,"Generator"),c(y,i,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=L,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var o=r.call(s,"catchLoc"),c=r.call(s,"finallyLoc");if(o&&c){if(this.prev<s.catchLoc)return n(s.catchLoc,!0);if(this.prev<s.finallyLoc)return n(s.finallyLoc)}else if(o){if(this.prev<s.catchLoc)return n(s.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return n(s.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var s=i;break}}s&&("break"===t||"continue"===t)&&s.tryLoc<=e&&e<=s.finallyLoc&&(s=null);var a=s?s.completion:{};return a.type=t,a.arg=e,s?(this.method="next",this.next=s.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;P(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:L(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function o(t,e,r,n,i,s,a){try{var o=t[s](a),c=o.value}catch(t){return void r(t)}o.done?e(c):Promise.resolve(c).then(n,i)}function c(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var s=t.apply(e,r);function a(t){o(s,n,i,a,c,"next",t)}function c(t){o(s,n,i,a,c,"throw",t)}a(void 0)}))}}function u(){return(u=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function p(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,l(t,e)}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function l(t,e){return(l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function f(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function d(t,e,r){return(d=f()?Reflect.construct.bind():function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&l(i,r.prototype),i}).apply(null,arguments)}function v(t){var e="function"==typeof Map?new Map:void 0;return(v=function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return d(t,arguments,h(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),l(r,t)})(t)}var m,g,y,x,b,R,w,P,k,L,U,C=function(){function t(t){t||(t={}),this.axios=i.create(t)}var e=t.prototype;return e.apiRequest=function(){var t=c(a().mark((function t(e,r,n){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.headers||(e.headers={}),e.headers["Content-Type"]="application/json",t.abrupt("return",this.axios(u({},e,{url:r,data:n})).then((function(t){return t.data})));case 3:case"end":return t.stop()}}),t,this)})));return function(e,r,n){return t.apply(this,arguments)}}(),e.apiRequestHeader=function(){var t=c(a().mark((function t(e,r,n,i){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.headers||(e.headers={}),e.headers["Content-Type"]="application/json",t.abrupt("return",this.axios(u({},e,{url:r,data:i})).then((function(t){var e;return n?null!=(e=t.headers[n])?e:t.headers[n.toLowerCase()]:t.headers})));case 3:case"end":return t.stop()}}),t,this)})));return function(e,r,n,i){return t.apply(this,arguments)}}(),e.get=function(t,e){return this.apiRequest(u({},e,{method:"get"}),t)},e.deleteRequest=function(t,e){return this.apiRequest(u({},e,{method:"delete"}),t)},e.post=function(t,e,r){return this.apiRequest(u({},r,{method:"post"}),t,e)},e.put=function(t,e,r){return this.apiRequest(u({},r,{method:"put"}),t,e)},e.patch=function(t,e,r){return this.apiRequest(u({},r,{method:"patch"}),t,e)},e.head=function(t,e,r,n){return this.apiRequestHeader(u({},e,{method:"head"}),t,r,n)},t}(),S=function(t){function e(e,r,i){var s;(s=t.call(this,r)||this).useLocalStorage=e,s.tokenRefreshFailureCallback=i,s.tokens={};var o=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(s);return s.axios.interceptors.request.use((function(t){var e=t.useRefreshToken?o.getTokens().refreshToken:o.getTokens().accessToken;return t.headers=u({},t.headers,{Authorization:"Bearer "+e}),t}),(function(t){Promise.reject(t)})),n(s.axios,function(){var t=c(a().mark((function t(e){var r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!o.authRefreshFn){t.next=15;break}return t.prev=1,t.next=4,o.authRefreshFn(o.getTokens().refreshToken);case 4:return o.setTokens({accessToken:(r=t.sent).accessToken,refreshToken:r.refreshToken}),e.response.config.headers.Authorization="Bearer "+o.getTokens().accessToken,t.abrupt("return",Promise.resolve());case 10:return t.prev=10,t.t0=t.catch(1),console.error("an error occured while refreshing tokens (notifying callback)",t.t0),o.tokenRefreshFailureCallback&&o.tokenRefreshFailureCallback(e),t.abrupt("return",Promise.resolve());case 15:return console.error("The request could not refresh the token (authRefreshFn was not set)",e),t.abrupt("return",Promise.resolve());case 17:case"end":return t.stop()}}),t,null,[[1,10]])})));return function(e){return t.apply(this,arguments)}}(),{statusCodes:[401,403]}),s}p(e,t);var r=e.prototype;return r.setAuthRefreshFn=function(t){this.authRefreshFn=t},r.setTokens=function(t){this.useLocalStorage&&localStorage.setItem("tokens",JSON.stringify(t)),this.tokens=t},r.getTokens=function(){if(this.useLocalStorage){var t={},e=localStorage.getItem("tokens");return e&&(t=JSON.parse(e)),t}return this.tokens},e}(C),T=function(){function t(t,e,r){void 0===r&&(r=!1),this.serviceCollReq=t,this.getAuthTokenCbk=e,this.useLocalStorage=r,this.practiceInstances=new Map}return t.prototype.get=function(){var t=c(a().mark((function t(e){var r,n,i,s=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r=this.practiceInstances.get(e))){t.next=3;break}return t.abrupt("return",r);case 3:return n=pt(this.serviceCollReq,void 0,this.useLocalStorage),i=function(){var t=c(a().mark((function t(){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n.guardService){t.next=7;break}return console.log("[Auth] Refresh auth called (practiceUuid: "+e+")"),t.next=4,s.getAuthTokenCbk(n.guardService,e);case 4:return t.abrupt("return",t.sent);case 7:throw Error("[Auth] Unable to refresh token guard service is undefined");case 8:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),t.next=7,i();case 7:return n.apiService.setAuthRefreshFn(i),this.practiceInstances.set(e,n),t.abrupt("return",n);case 10:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),t}();(m=exports.AssistantType||(exports.AssistantType={})).MedicalSecretary="MedicalSecretary",m.Nurse="Nurse",m.Specialist="Specialist",m.Administrative="Administrative",m.Other="Other",(g=exports.TransmissionKind||(exports.TransmissionKind={})).Fax="Fax",g.Email="Email",g.SMS="SMS",g.EncryptedEmail="EncryptedEmail",g.Logs="Logs",g.API="API",g.Other="Other",(y=exports.TransmissionStatus||(exports.TransmissionStatus={})).Preparing="Preparing",y.Sending="Sending",y.Sent="Sent",y.Retrying="Retrying",y.Failed="Failed",y.DriverError="DriverError",y.TimedOut="TimedOut",y.ReceiverNotExist="ReceiverNotExist",y.ReceiverNotAnswering="ReceiverNotAnswering",y.ReceiverIncompatible="ReceiverIncompatible",(x=exports.FeeStatus||(exports.FeeStatus={})).NoFee="NoFee",x.Pending="Pending",x.Paid="Paid",x.Reimbursed="Reimbursed",x.Cancelled="Cancelled",x.Contested="Contested",(b=exports.MedicalStatus||(exports.MedicalStatus={})).Creating="Creating",b.New="New",b.ToAnswer="ToAnswer",b.Answered="Answered",b.Closed="Closed",b.Reopened="Reopened",b.Archived="Archived",(R=exports.TaskStatus||(exports.TaskStatus={})).None="None",R.ToDo="ToDo",R.InProgress="InProgress",R.Blocked="Blocked",R.Done="Done",(w=exports.ClosedReasonType||(exports.ClosedReasonType={})).Completed="Completed",w.NotADisease="NotADisease",w.NotAppropriateForVirtual="NotAppropriateForVirtual",w.Other="Other",w.RequiresInPerson="RequiresInPerson",(P=exports.VisibilityType||(exports.VisibilityType={})).Generic="Generic",P.Private="Private",P.Instance="Instance",(k=exports.DrugType||(exports.DrugType={})).Generic="Generic",k.Instance="Instance",(L=exports.PrescriptionStatus||(exports.PrescriptionStatus={})).Existing="Existing",L.Deleted="Deleted",(U=exports.PlanStatus||(exports.PlanStatus={})).Pending="Pending",U.Accepted="Accepted",U.Rejected="Rejected";var F,A,E,O,I,D,G,_,N,q,M,B,j,W,K,V,H,Q,Y=function(t){function e(){return t.apply(this,arguments)||this}return p(e,t),e}(v(Error)),z=function(t){function e(){return t.apply(this,arguments)||this}return p(e,t),e}(v(Error)),J=function(t){function e(){return t.apply(this,arguments)||this}return p(e,t),e}(v(Error)),X=function(t){function e(){return t.apply(this,arguments)||this}return p(e,t),e}(v(Error)),Z=function(t){function e(){return t.apply(this,arguments)||this}return p(e,t),e}(v(Error)),$=function(t){function e(){return t.apply(this,arguments)||this}return p(e,t),e}(v(Error)),tt=function(t){function e(){return t.apply(this,arguments)||this}return p(e,t),e}(v(Error)),et=function(t){function e(){return t.apply(this,arguments)||this}return p(e,t),e}(v(Error));(F=exports.WorkflowType||(exports.WorkflowType={})).Onboard="Onboard",F.Followup="Followup",F.Renew="Renew",F.DataRetrieve="DataRetrieve",(A=exports.RateDimension||(exports.RateDimension={})).RatioOnTotal="RatioOnTotal",A.FixedOnTotal="FixedOnTotal",A.RatioPlatformFee="RatioPlatformFee",A.FixedPlatformFee="FixedPlatformFee",A.RatioOnPlatformFeeTotal="RatioOnPlatformFeeTotal",A.FixedOnPlatformFeeTotal="FixedOnPlatformFeeTotal",A.RatioOnItem="RatioOnItem",A.FixedOnItem="FixedOnItem",(E=exports.PlanType||(exports.PlanType={})).Onboard="Onboard",E.Followup="Followup",E.Renew="Renew",E.DataRetrieve="DataRetrieve",(O=exports.PaymentStatus||(exports.PaymentStatus={})).Pending="Pending",O.Success="Success",O.Failure="Failure",O.Canceled="Canceled",(I=exports.PractitionerStatus||(exports.PractitionerStatus={})).Practicing="Practicing",I.Retired="Retired",I.NotInvolvedAnymore="NotInvolvedAnymore",I.Deactivated="Deactivated",I.Flagged="Flagged",I.InConflict="InConflict",I.Delicensed="Delicensed",(D=exports.AssignmentStatus||(exports.AssignmentStatus={})).Assigned="Assigned",D.Reassigned="Reassigned",D.Cancelled="Cancelled",(G=exports.PractitionnerRoleType||(exports.PractitionnerRoleType={})).Doctor="Doctor",G.MedicalAssistant="MedicalAssistant",G.MedicalSecretary="MedicalSecretary",G.Nurse="Nurse",G.Specialist="Specialist",G.LabAssistant="LabAssistant",G.Administrative="Administrative",G.ManualDispatcher="ManualDispatcher",G.Other="Other",(_=exports.OtherRoleType||(exports.OtherRoleType={})).Patient="Patient",_.User="User",_.System="System",(N=exports.LicenseStatus||(exports.LicenseStatus={})).Valid="Valid",N.Invalid="Invalid",N.Expired="Expired",N.NA="NA",N.Removed="Removed",(q=exports.PeriodType||(exports.PeriodType={})).PerYear="PerYear",q.PerQuarter="PerQuarter",q.PerMonth="PerMonth",q.PerWeek="PerWeek",q.PerBusinessDay="PerBusinessDay",q.PerDay="PerDay",q.PerHour="PerHour",(M=exports.SyncStatus||(exports.SyncStatus={})).Requested="Requested",M.Started="Started",M.Succeeded="Succeeded",M.Failed="Failed",M.Cancelled="Cancelled",(B=exports.PracticeEmailKind||(exports.PracticeEmailKind={})).SignedUp="SignedUp",B.Onboarded="Onboarded",B.OnboardedPractitioner="OnboardedPractitioner",B.OnboardedPatient="OnboardedPatient",B.Answered="Answered",B.ToAnswer="ToAnswer",B.FollowedUp="FollowedUp",B.Renewed="Renewed",B.DataRetrieved="DataRetrieved",B.Closed="Closed",B.PasswordRecovery="PasswordRecovery",B.FaxFailed="FaxFailed",B.ExamResult="ExamResult",B.Reassigned="Reassigned",B.OnlinePharmacyFaxSent="OnlinePharmacyFaxSent",B.ResumeConsult="ResumeConsult",(j=exports.PracticeConfigKind||(exports.PracticeConfigKind={})).PracticeCloseConsultationTypes="PracticeCloseConsultationTypes",j.PracticeConfigExample="PracticeConfigExample",j.PracticeCookieBanner="PracticeCookieBanner",j.PracticeCssVariables="PracticeCssVariables",j.PracticeFontsLinks="PracticeFontsLinks",j.PracticeLocaleSwitcher="PracticeLocaleSwitcher",j.PracticePharmacyPicker="PracticePharmacyPicker",j.PracticePrescriptionFields="PracticePrescriptionFields",j.PractitionerChatbox="PractitionerChatbox",j.PractitionerConsultList="PractitionerConsultList",j.PractitionerSearch="PractitionerSearch",j.PracticeRegisterWalkthrough="PracticeRegisterWalkthrough",(W=exports.StripePriceType||(exports.StripePriceType={})).Default="Default",W.Discount="Discount",(K=exports.IndexKey||(exports.IndexKey={})).Consultation="Consultation",K.IndexSnapshot="IndexSnapshot",K.ConsultationLockbox="ConsultationLockbox",(V=exports.DocumentType||(exports.DocumentType={})).Message="Message",V.Note="Note",V.DoctorsNote="DoctorsNote",V.Prescription="Prescription",V.ExamRequest="ExamRequest",V.Result="Result",V.Attachment="Attachment",V.BigFile="BigFile",V.MeetingRequest="MeetingRequest",V.AudioNote="AudioNote",V.VideoNote="VideoNote",V.PopulatedWorkflowData="PopulatedWorkflowData",V.TreatmentPlan="TreatmentPlan",V.ImageAlias="ImageAlias",(H=exports.MetadataCategory||(exports.MetadataCategory={})).ChildPersonal="ChildPersonal",H.Consultation="Consultation",H.DataRetrieval="DataRetrieval",H.Followup="Followup",H.Recovery="Recovery",H.Medical="Medical",H.OtherPersonal="OtherPersonal",H.Personal="Personal",H.Preference="Preference",H.Prescription="Prescription",H.Raw="Raw",(Q=exports.IndexKind||(exports.IndexKind={}))[Q.consultUuid=0]="consultUuid",Q[Q.consultShortid=1]="consultShortid",Q[Q.firstName=2]="firstName",Q[Q.lastName=3]="lastName",Q[Q.healthId=4]="healthId",Q[Q.dob=5]="dob";var rt=function(){function t(t,e){this.api=t,this.baseURL=e}var e=t.prototype;return e.consultCreate=function(t){return this.api.post(this.baseURL+"/v1/consults",t)},e.countConsults=function(t,e,r,n,i,s,a,o,c,u,p,h,l){return this.api.head(this.baseURL+"/v1/consults",{params:{uuidPractice:t,uuidRequester:e,statusesMedical:r,statusesExclude:n,shortId:i,perPage:o,page:c,sortColumns:s,orderColumns:a,filterAssignedDoctor:u,filterCurrentPractitioner:p,filterIsoLocality:h,filterAssignee:l}},"Content-Range").then((function(t){return!t||"string"!=typeof t&&"number"!=typeof t?0:"number"==typeof t?t:parseInt(t)}))},e.getConsults=function(t,e,r,n,i,s,a,o,c,u,p,h,l){return this.api.get(this.baseURL+"/v1/consults",{params:{uuidPractice:t,uuidRequester:e,statusesMedical:r,statusesExclude:n,shortId:i,perPage:o,page:c,sortColumns:s,orderColumns:a,filterAssignedDoctor:u,filterCurrentPractitioner:p,filterIsoLocality:h,filterAssignee:l}})},e.getConsultByUUID=function(t,e){return this.api.get(this.baseURL+"/v1/consults/"+t,{params:{uuidPractice:e}})},e.updateConsultByUUID=function(t,e,r,n){return this.api.put(this.baseURL+"/v1/consults/"+t,e,{params:{uuidPractice:r,uuidRequester:n}})},e.getConsultFaxStatuses=function(t){return this.api.get(this.baseURL+"/v1/consults/"+t+"/transmissions",{params:{kind:exports.TransmissionKind.Fax}})},e.postConsultTransmission=function(t,e,r,n,i,s,a){void 0===e&&(e="Documo");var o=new FormData;return o.append("nameDriverReceiver",e),r&&o.append("addressReceiver",r),n&&o.append("file",n),i&&o.append("nameReceiver",i),s&&o.append("txtTransmissionTitle",s),a&&o.append("txtTransmissionNotes",a),this.api.post(this.baseURL+"/v1/consults/"+t+"/transmissions",o,{headers:{"Content-Type":"multipart/form-data;"}})},e.postConsultFax=function(t,e,r){return this.postConsultTransmission(t,"Documo",e,r)},e.postConsultEmail=function(t,e){return this.postConsultTransmission(t,"Pharmacierge",void 0,e)},e.retryConsultFax=function(t,e){return this.api.put(this.baseURL+"/v1/consults/"+t+"/transmissions/"+e,{status:exports.TransmissionStatus.Retrying})},e.updateConsultTransmissionStatus=function(t,e,r){return this.api.put(this.baseURL+"/v1/consults/"+e+"/transmissions/"+t,{status:r})},t}(),nt=function(){function t(t,e){this.api=t,this.baseURL=e}var e=t.prototype;return e.getDiagnoses=function(){return this.api.get(this.baseURL+"/v1/diagnoses")},e.getDiagnosisByUuid=function(t){return this.api.get(this.baseURL+"/v1/diagnoses/"+t)},e.createDiagnosis=function(t){return this.api.post(this.baseURL+"/v1/diagnoses",t)},e.updateDiagnosis=function(t,e){return this.api.put(this.baseURL+"/v1/diagnoses/"+t,e)},e.getTreatmentsFromDiagnosisUuid=function(t){return this.api.get(this.baseURL+"/v1/diagnoses/"+t+"/treatments")},e.getTreatmentPlansFromConsultUuid=function(t){return this.api.get(this.baseURL+"/v1/treatment-plans/",{params:{uuidConsult:t}})},e.createTreatment=function(t,e){return this.api.post(this.baseURL+"/v1/diagnoses/"+t+"/treatments",e)},e.getTreatmentPlansPopulatedFromConsultUuid=function(t){return this.api.get(this.baseURL+"/v1/treatment-plans/",{params:{uuidConsult:t,populated:!0}})},e.postPlans=function(t){return this.api.post(this.baseURL+"/v1/treatment-plans",t)},e.updateTreatmentPlan=function(t,e,r,n){return this.api.put(this.baseURL+"/v1/treatment-plans/"+t,{uuidConsult:e,diagnosis:r,plan:n})},e.acceptTreatmentPlan=function(t,e){return this.api.put(this.baseURL+"/v1/treatment-plans/"+t+"/accept",{uuidConsult:e})},e.getAllDrugs=function(){var t=c(a().mark((function t(e){var r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.api.get(this.baseURL+"/v1/drugs/practice/"+e);case 2:if(!(r=t.sent)||!r.foundDrugs){t.next=5;break}return t.abrupt("return",r.foundDrugs);case 5:return t.abrupt("return",void 0);case 6:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),t}(),it=function(){function t(t,e){this.api=t,this.baseURL=e,this.api.setAuthRefreshFn(this.authRefresh.bind(this)),this.identityCache={},this.whoAmICache={}}var e=t.prototype;return e.setTokens=function(t){this.api.setTokens(u({},this.api.getTokens(),t))},e.m2mToken=function(){var t=c(a().mark((function t(e){var r,n,i,s;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,n={skipAuthRefresh:!0},t.next=4,this.api.post(this.baseURL+"/v1/m2m/token",e,n);case 4:this.api.setTokens({accessToken:(r=t.sent).accessToken}),t.next=20;break;case 8:if(t.prev=8,t.t0=t.catch(0),console.error("Error while posting m2m token:",t.t0),!t.t0.isAxiosError){t.next=19;break}s=null==(i=t.t0.response)?void 0:i.status,t.t1=s,t.next=400===t.t1?16:500===t.t1?17:18;break;case 16:throw new z;case 17:throw new J;case 18:case 19:throw new Y;case 20:return t.abrupt("return",r);case 21:case"end":return t.stop()}}),t,this,[[0,8]])})));return function(e){return t.apply(this,arguments)}}(),e.authToken=function(){var t=c(a().mark((function t(e){var r,n,i,s;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,n={skipAuthRefresh:!0},t.next=4,this.api.post(this.baseURL+"/v1/auth/token",e,n);case 4:this.api.setTokens({accessToken:(r=t.sent).accessToken,refreshToken:r.refreshToken}),t.next=21;break;case 8:if(t.prev=8,t.t0=t.catch(0),console.error("Error while posting auth token:",t.t0),!t.t0.isAxiosError){t.next=20;break}s=null==(i=t.t0.response)?void 0:i.status,t.t1=s,t.next=400===t.t1?16:424===t.t1?17:500===t.t1?18:19;break;case 16:throw new z;case 17:throw new X;case 18:throw new J;case 19:case 20:throw new Y;case 21:return t.abrupt("return",r);case 22:case"end":return t.stop()}}),t,this,[[0,8]])})));return function(e){return t.apply(this,arguments)}}(),e.authRefresh=function(){var t=c(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.put(this.baseURL+"/v1/auth/token",null,{skipAuthRefresh:!0,useRefreshToken:!0}));case 2:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.authLogout=function(){var t=c(a().mark((function t(){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.get(this.baseURL+"/v1/auth/logout"));case 1:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),e.authRecover=function(){var t=c(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.post(this.baseURL+"/v1/auth/recover",e));case 1:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.identityCreate=function(){var t=c(a().mark((function t(e){var r,n,i;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.api.post(this.baseURL+"/v1/identities",e);case 3:this.api.setTokens({refreshToken:(r=t.sent).refreshToken}),t.next=18;break;case 7:if(t.prev=7,t.t0=t.catch(0),!t.t0.isAxiosError){t.next=17;break}i=null==(n=t.t0.response)?void 0:n.status,t.t1=i,t.next=400===t.t1?14:409===t.t1?15:16;break;case 14:throw new $;case 15:throw new tt;case 16:case 17:throw new Z;case 18:return t.abrupt("return",r);case 19:case"end":return t.stop()}}),t,this,[[0,7]])})));return function(e){return t.apply(this,arguments)}}(),e.identityGet=function(){var t=c(a().mark((function t(e,r){var n,i,s,o,c;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0===r&&(r=!1),s=this.api.getTokens(),o=(null!=(n=s.accessToken)?n:"")+(null!=(i=s.refreshToken)?i:"")+e,!r&&s.accessToken&&this.identityCache[o]){t.next=10;break}return t.next=6,this.api.get(this.baseURL+"/v1/identities/"+e);case 6:if(c=t.sent,!r){t.next=9;break}return t.abrupt("return",c);case 9:this.identityCache[o]=c;case 10:return t.abrupt("return",this.identityCache[o]);case 11:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),e.whoAmI=function(){var t=c(a().mark((function t(e){var r,n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0===e&&(e=!1),n=null!=(r=this.api.getTokens().accessToken)?r:"",this.whoAmICache[n]&&!e){t.next=6;break}return t.next=5,this.api.get(this.baseURL+"/v1/auth/whoami");case 5:this.whoAmICache[n]=t.sent;case 6:return t.abrupt("return",this.whoAmICache[n]);case 7:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.identityUpdate=function(){var t=c(a().mark((function t(e,r){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.put(this.baseURL+"/v1/identities/"+e,r));case 1:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),e.identityMFAQRCode=function(){var t=c(a().mark((function t(e,r){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.post(this.baseURL+"/v1/identities/"+e+"/mfa",{password:r},{headers:{Accept:"application/json"}}));case 2:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),e.identitySendConfirmEmail=function(){var t=c(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.post(this.baseURL+"/v1/identity/confirm",e));case 1:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.identityGetByCustomerEmail=function(){var t=c(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.identityGetByHash(e.substring(e.indexOf("+")+1,e.indexOf("@"))));case 1:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.identityGetByHash=function(){var t=c(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.identityGet(e.replace("+","-").replace("/","_")));case 1:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),t}(),st=function(){function t(t,e){this.api=t,this.baseURL=e}var e=t.prototype;return e.index=function(t,e){return this.api.post(this.baseURL+"/v1/index",{consultUUID:t,terms:e})},e.search=function(t){return this.api.post(this.baseURL+"/v1/search",{terms:t})},t}(),at=function(){function t(t,e){this.api=t,this.baseURL=e}var e=t.prototype;return e.practiceGetFromURL=function(t,e){return this.api.get(this.baseURL+"/v1/practices",{params:u({url_practice:t},e)})},e.practiceGetFromUuid=function(t,e,r){return this.api.get(this.baseURL+"/v1/practices/"+t,{params:{locale:e,accounts:r}})},e.practiceConfigGetFromPracticeUuid=function(t){return this.api.get(this.baseURL+"/v1/practices/"+t+"/configs")},e.practiceConfigGetByKindForPracticeUuid=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/configs/"+e)},e.practiceConfigCreateForPracticeUuid=function(t,e){return this.api.post(this.baseURL+"/v1/practices/"+t+"/configs",e)},e.practiceConfigUpdate=function(t){return this.api.put(this.baseURL+"/v1/practices/"+t.uuidPractice+"/configs/"+t.kind,t)},e.practiceGetAccounts=function(t){return this.api.get(this.baseURL+"/v1/practices/"+t+"/accounts")},e.practiceGetAccount=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/accounts/"+e)},e.practiceGetWorkflows=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/workflows",{params:{kind:e}})},e.practiceGetWorkflow=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/workflows/"+e)},e.practiceGetPlans=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/plans",{params:{kind:e}})},e.practiceGetPlan=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/plans/"+e)},e.practiceGetPlanPrices=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/plans/"+e+"/prices")},e.practiceGetPayments=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/payments",{params:{kind:e}})},e.practiceGetPayment=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/payments/"+e)},e.practiceGetPaymentForStripePaymentIntentWithID=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/payments/"+e)},e.practiceGetPaymentsIntents=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/payments/intents",{params:{kind:e}})},e.getPaymentIntentHashedEmail=function(t){return s(t.toLowerCase())},e.practiceCreatePaymentsIntent=function(t,e,r,n,i,s){return this.api.post(this.baseURL+"/v1/practices/"+t+"/payments/intents/",{idPlan:e,hashUserEmail:r?this.getPaymentIntentHashedEmail(r):void 0,isoLocality:n,consultRequest:s},{params:{url_subdomain:i}})},e.practiceGetPaymentsIntent=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/payments/intents/"+e)},e.practiceUpdatePaymentsIntent=function(t,e,r,n,i,s){return this.api.put(this.baseURL+"/v1/practices/"+t+"/payments/intents/"+e,u({},r,{hashUserEmail:n?this.getPaymentIntentHashedEmail(n):void 0}),{params:{promotionCode:i,finalize:s}})},e.getInvoice=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/payments/invoices/"+e)},e.practiceGetPractitioners=function(t){return this.api.get(this.baseURL+"/v1/practices/"+t+"/practitioners")},e.practiceUpdatePractitioner=function(t,e,r){return this.api.put(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e,r)},e.practiceGetPractitioner=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e)},e.practiceGetPractitionerLicenses=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e+"/licenses")},e.practiceCreatePractitionerLicense=function(t,e,r){return this.api.post(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e+"/licenses",r)},e.practiceUpdatePractitionerLicense=function(t,e,r,n){return this.api.put(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e+"/licenses/"+r,n)},e.practiceGetPractitionerLicense=function(t,e,r){return this.api.get(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e+"/licenses/"+r)},e.practiceGetPractitionerPreferences=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e+"/preferences")},e.practiceCreatePractitionerPreference=function(t,e,r){return this.api.post(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e+"/preferences",r)},e.practiceUpdatePractitionerPreference=function(t,e,r,n){return this.api.put(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e+"/preferences/"+r,n)},e.practiceGetPractitionerPreference=function(t,e,r){return this.api.get(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e+"/preferences/"+r)},e.practiceGetPractitionerRoles=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e+"/roles")},e.practiceCreatePractitionerRole=function(t,e,r){return this.api.post(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e+"/roles",r)},e.practiceDeletePractitionerRoles=function(t,e){return this.api.deleteRequest(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e+"/roles")},e.practiceUpdatePractitionerRole=function(t,e,r,n){return this.api.put(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e+"/roles/"+r,n)},e.practiceGetPractitionerRole=function(t,e,r){return this.api.get(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e+"/roles/"+r)},e.practiceDeletePractitionerRole=function(t,e,r){return this.api.deleteRequest(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e+"/roles/"+r)},e.practiceGetPractitionerSignature=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/practitioners/"+e+"/signature",{responseType:"blob"})},e.practiceGetAssignments=function(t){return this.api.get(this.baseURL+"/v1/practices/"+t+"/assignments")},e.practiceCreateAssignment=function(t,e){return this.api.post(this.baseURL+"/v1/practices/"+t+"/assignments",e)},e.practiceUpdateAssignment=function(t,e,r){return this.api.put(this.baseURL+"/v1/practices/"+t+"/assignments/"+e,r)},e.practiceGetAssignment=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/assignments/"+e)},e.practiceGetQuotas=function(t){return this.api.get(this.baseURL+"/v1/practices/"+t+"/quotas")},e.practiceGetQuota=function(t,e){return this.api.get(this.baseURL+"/v1/practices/"+t+"/quotas/"+e)},t}(),ot=function(){function t(t,e){this.api=t,this.baseURL=e}var e=t.prototype;return e.lockboxDataStore=function(){var t=c(a().mark((function t(e,r,n,i){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.post(this.baseURL+"/v1/lockboxes/"+e+"/data",r,{params:{lockbox_owner_uuid:n,data_uuid:i}}));case 1:case"end":return t.stop()}}),t,this)})));return function(e,r,n,i){return t.apply(this,arguments)}}(),e.updateConsultByUUID=function(t,e,r,n,i,s){return this.api.put(this.baseURL+"/v1/consults/"+e,{patientUuid:t,statusMedical:r,closedReasonType:n,closedReasonDescription:i,neverExpires:s})},e.notifyFaxFailed=function(t,e,r,n){return this.api.post(this.baseURL+"/v1/fax-failed",{consultationUuid:e,consultationShortId:r,fax:n},{params:{practice_uuid:t}})},e.reassignmentEmail=function(t,e){return this.api.post(this.baseURL+"/v1/consult/"+t+"/reassignment-email",{newPractitionerUuid:e})},e.sendOnlineFaxSuccessfulEmail=function(t,e){return this.api.post(this.baseURL+"/v1/online-fax-notify",{consult:t,patientUuid:e})},e.sendResumeConsultEmail=function(t){return this.api.post(this.baseURL+"/v1/resume-consult-email",t)},t}(),ct=function(){function t(t,e){this.api=t,this.baseURL=e}var e=t.prototype;return e.lockboxCreate=function(){var t=c(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.post(this.baseURL+"/v1/lockbox",e));case 1:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.lockboxMetadataAdd=function(){var t=c(a().mark((function t(e,r,n){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.put(this.baseURL+"/v1/lockbox/"+e,r,{params:{lockbox_owner_uuid:n}}));case 1:case"end":return t.stop()}}),t,this)})));return function(e,r,n){return t.apply(this,arguments)}}(),e.lockboxSecretGet=function(){var t=c(a().mark((function t(e,r){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.get(this.baseURL+"/v1/lockboxes/"+e+"/secret",{params:{lockbox_owner_uuid:r}}));case 1:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),e.lockboxGrant=function(){var t=c(a().mark((function t(e,r,n){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.post(this.baseURL+"/v1/lockboxes/"+e+"/grant",r,{params:{lockbox_owner_uuid:n}}));case 1:case"end":return t.stop()}}),t,this)})));return function(e,r,n){return t.apply(this,arguments)}}(),e.grantsGet=function(){var t=c(a().mark((function t(){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.get(this.baseURL+"/v1/grants"));case 1:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),e.lockboxDataStore=function(){var t=c(a().mark((function t(e,r,n,i){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.post(this.baseURL+"/v1/lockboxes/"+e+"/data",r,{params:{lockbox_owner_uuid:n,data_uuid:i}}));case 1:case"end":return t.stop()}}),t,this)})));return function(e,r,n,i){return t.apply(this,arguments)}}(),e.lockboxDataGet=function(){var t=c(a().mark((function t(e,r,n,i){var s;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return void 0===i&&(i=!0),t.next=3,this.api.get(this.baseURL+"/v1/lockboxes/"+e+"/data/"+r,{params:{lockbox_owner_uuid:n,stream:i}});case 3:if(s=t.sent,!i){t.next=6;break}return t.abrupt("return",{data:s});case 6:return t.abrupt("return",s);case 7:case"end":return t.stop()}}),t,this)})));return function(e,r,n,i){return t.apply(this,arguments)}}(),e.lockboxManifestGet=function(){var t=c(a().mark((function t(e,r,n){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.get(this.baseURL+"/v1/lockboxes/"+e,{params:{lockbox_owner_uuid:n,filter:r}}));case 1:case"end":return t.stop()}}),t,this)})));return function(e,r,n){return t.apply(this,arguments)}}(),e.lockboxMetadataGet=function(){var t=c(a().mark((function t(e,r,n,i,s){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.get(this.baseURL+"/v1/lockboxes/"+e+"/metadata",{params:{lockbox_owner_uuid:s,fields:r,groupby:n,filter:i}}));case 1:case"end":return t.stop()}}),t,this)})));return function(e,r,n,i,s){return t.apply(this,arguments)}}(),e.vaultIndexPut=function(){var t=c(a().mark((function t(e,r){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.put(this.baseURL+"/v1/index",e,{params:{index_owner_uuid:r}}));case 1:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),e.vaultIndexSnapshotPut=function(){var t=c(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.put(this.baseURL+"/v1/index-snapshot",e));case 1:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.vaultIndexGet=function(){var t=c(a().mark((function t(e,r,n){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.api.get(this.baseURL+"/v1/index",{params:{index_keys:e,identifiers:r,timestamp:n}}));case 1:case"end":return t.stop()}}),t,this)})));return function(e,r,n){return t.apply(this,arguments)}}(),t}(),ut=function(){function t(t,e){this.api=t,this.v1Url=e+"/v1"}var e=t.prototype;return e.getWorkflows=function(){return this.api.get(this.v1Url+"/workflows")},e.getWorkflow=function(t,e,r){return this.api.get(this.v1Url+"/workflows/"+t,{params:{locale:e,createdAt:r}})},t}(),pt=function(t,e,r){void 0===r&&(r=!0);var n=t.tellerBaseURL,i=t.practiceBaseURL,s=t.consultBaseURL,a=t.vaultBaseURL,o=t.guardBaseURL,c=t.searchBaseURL,u=t.workflowBaseURL,p=t.diagnosisBaseURL,h=new S(r,void 0,e);return{apiService:h,tellerService:n?new ot(h,n):void 0,practiceService:i?new at(h,i):void 0,consultService:s?new rt(h,s):void 0,vaultService:a?new ct(h,a):void 0,guardService:o?new it(h,o):void 0,searchService:c?new st(h,c):void 0,workflowService:u?new ut(h,u):void 0,diagnosisService:p?new nt(h,p):void 0}};exports.APIService=S,exports.ApisPracticeManager=T,exports.AuthenticationBadRequest=z,exports.AuthenticationFailed=Y,exports.AuthenticationServerError=J,exports.AuthenticationUnconfirmedEmail=X,exports.AxiosService=C,exports.ConsultService=rt,exports.DiagnosisService=nt,exports.GuardService=it,exports.IdentityCreationBadRequest=$,exports.IdentityCreationConflict=tt,exports.IdentityCreationFailed=Z,exports.PracticeService=at,exports.SearchService=st,exports.TellerService=ot,exports.VaultDataMissing=et,exports.VaultService=ct,exports.WorkflowService=ut,exports.default=pt,exports.hashToBase64String=s,exports.init=pt;
2
2
  //# sourceMappingURL=oro-sdk-apis.cjs.production.min.js.map