oro-sdk-apis 1.10.0 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/models/practice.d.ts +9 -0
- package/dist/oro-sdk-apis.cjs.development.js +16 -3
- 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 +16 -3
- package/dist/oro-sdk-apis.esm.js.map +1 -1
- package/dist/services/practice.d.ts +13 -2
- package/package.json +1 -1
- package/src/models/practice.ts +11 -1
- package/src/services/practice.ts +17 -7
|
@@ -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=t(require("axios-auth-refresh")),r=t(require("axios")),n=require("buffer/"),i=require("hash.js");function a(t,e,r,n,i,a,s){try{var o=t[a](s),c=o.value}catch(t){return void r(t)}o.done?e(c):Promise.resolve(c).then(n,i)}function s(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 o(){return(o=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 c(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,p(t,e)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function p(t,e){return(p=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(){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 l(t,e,r){return(l=h()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&p(i,r.prototype),i}).apply(null,arguments)}function f(t){var e="function"==typeof Map?new Map:void 0;return(f=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 l(t,arguments,u(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),p(r,t)})(t)}var d,v,m,g,y,b,x,R,w,P,k=(function(t){var e=function(t){var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",s=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),a=new P(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(i,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw a;return{value:void 0,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var o=x(s,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,a),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 b(t,e){var n;this._invoke=function(i,a){function s(){return new e((function(n,s){!function n(i,a,s,o){var c=u(t[i],t,a);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,s,o)}),(function(t){n("throw",t,s,o)})):e.resolve(h).then((function(t){p.value=t,s(p)}),(function(t){return n("throw",t,s,o)}))}o(c.arg)}(i,a,n,s)}))}return n=n?n.then(s,s):s()}}function x(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,x(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,a=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 a.next=a}}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,s,"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,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},y(b.prototype),o(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,i,a){void 0===a&&(a=Promise);var s=new b(c(e,r,n,i),a);return t.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},y(g),o(g,s,"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 s.type="throw",s.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 a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var o=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(o&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(o){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.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 a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var s=a?a.completion:{};return s.type=t,s.arg=e,a?(this.method="next",this.next=a.finallyLoc,p):this.complete(s)},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)}}(P={exports:{}}),P.exports),L=function(){function t(t){t||(t={}),this.axios=r.create(t)}var e=t.prototype;return e.apiRequest=function(){var t=s(k.mark((function t(e,r,n){return k.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(o({},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=s(k.mark((function t(e,r,n,i){return k.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(o({},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(o({},e,{method:"get"}),t)},e.deleteRequest=function(t,e){return this.apiRequest(o({},e,{method:"delete"}),t)},e.post=function(t,e,r){return this.apiRequest(o({},r,{method:"post"}),t,e)},e.put=function(t,e,r){return this.apiRequest(o({},r,{method:"put"}),t,e)},e.patch=function(t,e,r){return this.apiRequest(o({},r,{method:"patch"}),t,e)},e.head=function(t,e,r,n){return this.apiRequestHeader(o({},e,{method:"head"}),t,r,n)},t}(),U=function(t){function r(r,n){var i;(i=t.call(this,r)||this).tokenRefreshFailureCallback=n;var a=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(i);return i.axios.interceptors.request.use((function(t){var e=t.useRefreshToken?a.getTokens().refreshToken:a.getTokens().accessToken;return t.headers=o({},t.headers,{Authorization:"Bearer "+e}),t}),(function(t){Promise.reject(t)})),e(i.axios,function(){var t=s(k.mark((function t(e){var r;return k.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]}),i}c(r,t);var n=r.prototype;return n.setAuthRefreshFn=function(t){this.authRefreshFn=t},n.setTokens=function(t){localStorage.setItem("tokens",JSON.stringify(t))},n.getTokens=function(){var t={},e=localStorage.getItem("tokens");return e&&(t=JSON.parse(e)),t},r}(L);(d=exports.AssistantType||(exports.AssistantType={})).MedicalSecretary="MedicalSecretary",d.Nurse="Nurse",d.Specialist="Specialist",d.Administrative="Administrative",d.Other="Other",(v=exports.TransmissionKind||(exports.TransmissionKind={})).Fax="Fax",v.Email="Email",v.SMS="SMS",v.EncryptedEmail="EncryptedEmail",v.Logs="Logs",v.API="API",v.Other="Other",(m=exports.TransmissionStatus||(exports.TransmissionStatus={})).Preparing="Preparing",m.Sending="Sending",m.Sent="Sent",m.Retrying="Retrying",m.Failed="Failed",m.DriverError="DriverError",m.TimedOut="TimedOut",m.ReceiverNotExist="ReceiverNotExist",m.ReceiverNotAnswering="ReceiverNotAnswering",m.ReceiverIncompatible="ReceiverIncompatible",(g=exports.FeeStatus||(exports.FeeStatus={})).NoFee="NoFee",g.Pending="Pending",g.Paid="Paid",g.Reimbursed="Reimbursed",g.Cancelled="Cancelled",g.Contested="Contested",(y=exports.MedicalStatus||(exports.MedicalStatus={})).Creating="Creating",y.New="New",y.ToAnswer="ToAnswer",y.Answered="Answered",y.Closed="Closed",y.Reopened="Reopened",y.Archived="Archived",(b=exports.TaskStatus||(exports.TaskStatus={})).None="None",b.ToDo="ToDo",b.InProgress="InProgress",b.Blocked="Blocked",b.Done="Done",(x=exports.VisibilityType||(exports.VisibilityType={})).Generic="Generic",x.Private="Private",x.Instance="Instance",(R=exports.DrugType||(exports.DrugType={})).Generic="Generic",R.Instance="Instance",(w=exports.PlanStatus||(exports.PlanStatus={})).Pending="Pending",w.Accepted="Accepted",w.Rejected="Rejected";var T,C,S,A,F,D,O,E,I,G,_,N,M,q,j,B,W,K=function(t){function e(){return t.apply(this,arguments)||this}return c(e,t),e}(f(Error)),H=function(t){function e(){return t.apply(this,arguments)||this}return c(e,t),e}(f(Error)),V=function(t){function e(){return t.apply(this,arguments)||this}return c(e,t),e}(f(Error)),Q=function(t){function e(){return t.apply(this,arguments)||this}return c(e,t),e}(f(Error)),Y=function(t){function e(){return t.apply(this,arguments)||this}return c(e,t),e}(f(Error)),z=function(t){function e(){return t.apply(this,arguments)||this}return c(e,t),e}(f(Error)),J=function(t){function e(){return t.apply(this,arguments)||this}return c(e,t),e}(f(Error));(T=exports.WorkflowType||(exports.WorkflowType={})).Onboard="Onboard",T.Followup="Followup",T.Renew="Renew",T.DataRetrieve="DataRetrieve",(C=exports.RateDimension||(exports.RateDimension={})).RatioOnTotal="RatioOnTotal",C.FixedOnTotal="FixedOnTotal",C.RatioPlatformFee="RatioPlatformFee",C.FixedPlatformFee="FixedPlatformFee",C.RatioOnPlatformFeeTotal="RatioOnPlatformFeeTotal",C.FixedOnPlatformFeeTotal="FixedOnPlatformFeeTotal",C.RatioOnItem="RatioOnItem",C.FixedOnItem="FixedOnItem",(S=exports.PlanType||(exports.PlanType={})).Onboard="Onboard",S.Followup="Followup",S.Renew="Renew",S.DataRetrieve="DataRetrieve",(A=exports.PaymentStatus||(exports.PaymentStatus={})).Pending="Pending",A.Success="Success",A.Failure="Failure",A.Canceled="Canceled",(F=exports.PractitionerStatus||(exports.PractitionerStatus={})).Practicing="Practicing",F.Retired="Retired",F.NotInvolvedAnymore="NotInvolvedAnymore",F.Deactivated="Deactivated",F.Flagged="Flagged",F.InConflict="InConflict",F.Delicensed="Delicensed",(D=exports.AssignmentStatus||(exports.AssignmentStatus={})).Assigned="Assigned",D.Reassigned="Reassigned",D.Cancelled="Cancelled",(O=exports.PractitionnerRoleType||(exports.PractitionnerRoleType={})).Doctor="Doctor",O.MedicalAssistant="MedicalAssistant",O.MedicalSecretary="MedicalSecretary",O.Nurse="Nurse",O.Specialist="Specialist",O.LabAssistant="LabAssistant",O.Administrative="Administrative",O.ManualDispatcher="ManualDispatcher",O.Other="Other",(E=exports.OtherRoleType||(exports.OtherRoleType={})).Patient="Patient",E.User="User",E.System="System",(I=exports.LicenseStatus||(exports.LicenseStatus={})).Valid="Valid",I.Invalid="Invalid",I.Expired="Expired",I.NA="NA",I.Removed="Removed",(G=exports.PeriodType||(exports.PeriodType={})).PerYear="PerYear",G.PerQuarter="PerQuarter",G.PerMonth="PerMonth",G.PerWeek="PerWeek",G.PerBusinessDay="PerBusinessDay",G.PerDay="PerDay",G.PerHour="PerHour",(_=exports.SyncStatus||(exports.SyncStatus={})).Requested="Requested",_.Started="Started",_.Succeeded="Succeeded",_.Failed="Failed",_.Cancelled="Cancelled",(N=exports.PracticeEmailKind||(exports.PracticeEmailKind={})).SignedUp="SignedUp",N.Onboarded="Onboarded",N.OnboardedPractitioner="OnboardedPractitioner",N.OnboardedPatient="OnboardedPatient",N.Answered="Answered",N.ToAnswer="ToAnswer",N.FollowedUp="FollowedUp",N.Renewed="Renewed",N.DataRetrieved="DataRetrieved",(M=exports.PracticeConfigKind||(exports.PracticeConfigKind={})).PractitionerConsultList="PractitionerConsultList",M.PractitionerChatbox="PractitionerChatbox",M.PracticeTheme="PracticeTheme",M.PracticeLocaleSwitcher="PracticeLocaleSwitcher",M.PracticeCookieBanner="PracticeCookieBanner",M.PracticePharmacyPicker="PracticePharmacyPicker",(q=exports.StripePriceType||(exports.StripePriceType={})).Default="Default",q.Discount="Discount",(j=exports.IndexKey||(exports.IndexKey={})).Consultation="Consultation",j.IndexSnapshot="IndexSnapshot",j.ConsultationLockbox="ConsultationLockbox",(B=exports.DocumentType||(exports.DocumentType={})).Message="Message",B.Note="Note",B.DoctorsNote="DoctorsNote",B.Prescription="Prescription",B.ExamRequest="ExamRequest",B.Result="Result",B.Attachment="Attachment",B.BigFile="BigFile",B.MeetingRequest="MeetingRequest",B.AudioNote="AudioNote",B.VideoNote="VideoNote",B.PopulatedWorkflowData="PopulatedWorkflowData",B.TreatmentPlan="TreatmentPlan",B.ImageAlias="ImageAlias",(W=exports.MetadataCategory||(exports.MetadataCategory={})).ChildPersonal="ChildPersonal",W.Consultation="Consultation",W.DataRetrieval="DataRetrieval",W.Followup="Followup",W.Recovery="Recovery",W.Medical="Medical",W.OtherPersonal="OtherPersonal",W.Personal="Personal",W.Preference="Preference",W.Prescription="Prescription",W.Raw="Raw";var X=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,a,s,o,c,u,p,h){return this.api.head(this.baseURL+"/v1/consults",{params:{uuidPractice:t,uuidRequester:e,statusesMedical:r,statusesExclude:n,shortId:i,perPage:o,page:c,sortColumns:a,orderColumns:s,filterAssignedDoctor:u,filterCurrentPractitioner:p,filterIsoLocality:h}},"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,a,s,o,c,u,p,h){return this.api.get(this.baseURL+"/v1/consults",{params:{uuidPractice:t,uuidRequester:e,statusesMedical:r,statusesExclude:n,shortId:i,perPage:o,page:c,sortColumns:a,orderColumns:s,filterAssignedDoctor:u,filterCurrentPractitioner:p,filterIsoLocality:h}})},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,a,s){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),a&&o.append("txtTransmissionTitle",a),s&&o.append("txtTransmissionNotes",s),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}(),Z=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=s(k.mark((function t(e){var r;return k.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}(),$=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(o({},this.api.getTokens(),t))},e.authToken=function(){var t=s(k.mark((function t(e){var r,n,i,a;return k.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=20;break;case 8:if(t.prev=8,t.t0=t.catch(0),!t.t0.isAxiosError){t.next=19;break}a=null==(i=t.t0.response)?void 0:i.status,t.t1=a,t.next=400===t.t1?15:424===t.t1?16:500===t.t1?17:18;break;case 15:throw new H;case 16:throw new Q;case 17:throw new V;case 18:case 19:throw new K;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.authRefresh=function(){var t=s(k.mark((function t(e){return k.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=s(k.mark((function t(){return k.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=s(k.mark((function t(e){return k.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=s(k.mark((function t(e){var r,n,i;return k.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 z;case 15:throw new J;case 16:case 17:throw new Y;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=s(k.mark((function t(e,r){var n,i,a,s,o;return k.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0===r&&(r=!1),a=this.api.getTokens(),s=(null!=(n=a.accessToken)?n:"")+(null!=(i=a.refreshToken)?i:"")+e,!r&&a.accessToken&&this.identityCache[s]){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[s]=o;case 10:return t.abrupt("return",this.identityCache[s]);case 11:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),e.whoAmI=function(){var t=s(k.mark((function t(e){var r,n;return k.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=s(k.mark((function t(e,r){return k.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=s(k.mark((function t(e,r){return k.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=s(k.mark((function t(e){return k.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)}}(),t}(),tt=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:o({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 n.Buffer.from(i.sha256().update(t.toLowerCase()).digest("hex"),"hex").toString("base64")},e.practiceCreatePaymentsIntent=function(t,e,r,n,i,a){return this.api.post(this.baseURL+"/v1/practices/"+t+"/payments/intents/",{idPlan:e,hashUserEmail:r?this.getPaymentIntentHashedEmail(r):void 0,isoLocality:n},{params:{url_subdomain:i,promotionCode:a}})},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){return this.api.put(this.baseURL+"/v1/practices/"+t+"/payments/intents/"+e,o({},r,{hashUserEmail:n?this.getPaymentIntentHashedEmail(n):void 0}),{params:{promotionCode:i}})},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}(),et=function(){function t(t,e){this.api=t,this.baseURL=e}var e=t.prototype;return e.lockboxDataStore=function(){var t=s(k.mark((function t(e,r,n,i){return k.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){return this.api.put(this.baseURL+"/v1/consults/"+e,{patientUuid:t,statusMedical:r,neverExpires:n})},t}(),rt=function(){function t(t,e){this.api=t,this.baseURL=e}var e=t.prototype;return e.lockboxCreate=function(){var t=s(k.mark((function t(e){return k.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=s(k.mark((function t(e,r,n){return k.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=s(k.mark((function t(e,r){return k.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=s(k.mark((function t(e,r,n){return k.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=s(k.mark((function t(){return k.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=s(k.mark((function t(e,r,n,i){return k.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=s(k.mark((function t(e,r,n,i){var a;return k.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(a=t.sent,!i){t.next=6;break}return t.abrupt("return",{data:a});case 6:return t.abrupt("return",a);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=s(k.mark((function t(e,r,n){return k.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=s(k.mark((function t(e,r,n,i,a){return k.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:a,fields:r,groupby:n,filter:i}}));case 1:case"end":return t.stop()}}),t,this)})));return function(e,r,n,i,a){return t.apply(this,arguments)}}(),e.vaultIndexPut=function(){var t=s(k.mark((function t(e,r){return k.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=s(k.mark((function t(e){return k.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=s(k.mark((function t(e,r,n){return k.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}(),nt=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}();exports.APIService=U,exports.AuthenticationBadRequest=H,exports.AuthenticationFailed=K,exports.AuthenticationServerError=V,exports.AuthenticationUnconfirmedEmail=Q,exports.AxiosService=L,exports.ConsultService=X,exports.DiagnosisService=Z,exports.GuardService=$,exports.IdentityCreationBadRequest=z,exports.IdentityCreationConflict=J,exports.IdentityCreationFailed=Y,exports.PracticeService=tt,exports.TellerService=et,exports.VaultService=rt,exports.WorkflowService=nt,exports.default=function(t,e){var r=t.tellerBaseURL,n=t.practiceBaseURL,i=t.consultBaseURL,a=t.vaultBaseURL,s=t.guardBaseURL,o=t.workflowBaseURL,c=t.diagnosisBaseURL,u=new U(void 0,e);return{tellerService:r?new et(u,r):void 0,practiceService:n?new tt(u,n):void 0,consultService:i?new X(u,i):void 0,vaultService:a?new rt(u,a):void 0,guardService:s?new $(u,s):void 0,workflowService:o?new nt(u,o):void 0,diagnosisService:c?new Z(u,c):void 0}};
|
|
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=t(require("axios-auth-refresh")),r=t(require("axios")),n=require("buffer/"),i=require("hash.js");function a(t,e,r,n,i,a,s){try{var o=t[a](s),c=o.value}catch(t){return void r(t)}o.done?e(c):Promise.resolve(c).then(n,i)}function s(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 o(){return(o=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 c(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,p(t,e)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function p(t,e){return(p=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(){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 l(t,e,r){return(l=h()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&p(i,r.prototype),i}).apply(null,arguments)}function f(t){var e="function"==typeof Map?new Map:void 0;return(f=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 l(t,arguments,u(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),p(r,t)})(t)}var d,v,m,g,y,b,x,R,w,P,k=(function(t){var e=function(t){var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",s=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),a=new P(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(i,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw a;return{value:void 0,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var o=x(s,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,a),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 b(t,e){var n;this._invoke=function(i,a){function s(){return new e((function(n,s){!function n(i,a,s,o){var c=u(t[i],t,a);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,s,o)}),(function(t){n("throw",t,s,o)})):e.resolve(h).then((function(t){p.value=t,s(p)}),(function(t){return n("throw",t,s,o)}))}o(c.arg)}(i,a,n,s)}))}return n=n?n.then(s,s):s()}}function x(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,x(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,a=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 a.next=a}}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,s,"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,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},y(b.prototype),o(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,i,a){void 0===a&&(a=Promise);var s=new b(c(e,r,n,i),a);return t.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},y(g),o(g,s,"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 s.type="throw",s.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 a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var o=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(o&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(o){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.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 a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var s=a?a.completion:{};return s.type=t,s.arg=e,a?(this.method="next",this.next=a.finallyLoc,p):this.complete(s)},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)}}(P={exports:{}}),P.exports),L=function(){function t(t){t||(t={}),this.axios=r.create(t)}var e=t.prototype;return e.apiRequest=function(){var t=s(k.mark((function t(e,r,n){return k.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(o({},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=s(k.mark((function t(e,r,n,i){return k.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(o({},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(o({},e,{method:"get"}),t)},e.deleteRequest=function(t,e){return this.apiRequest(o({},e,{method:"delete"}),t)},e.post=function(t,e,r){return this.apiRequest(o({},r,{method:"post"}),t,e)},e.put=function(t,e,r){return this.apiRequest(o({},r,{method:"put"}),t,e)},e.patch=function(t,e,r){return this.apiRequest(o({},r,{method:"patch"}),t,e)},e.head=function(t,e,r,n){return this.apiRequestHeader(o({},e,{method:"head"}),t,r,n)},t}(),U=function(t){function r(r,n){var i;(i=t.call(this,r)||this).tokenRefreshFailureCallback=n;var a=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(i);return i.axios.interceptors.request.use((function(t){var e=t.useRefreshToken?a.getTokens().refreshToken:a.getTokens().accessToken;return t.headers=o({},t.headers,{Authorization:"Bearer "+e}),t}),(function(t){Promise.reject(t)})),e(i.axios,function(){var t=s(k.mark((function t(e){var r;return k.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]}),i}c(r,t);var n=r.prototype;return n.setAuthRefreshFn=function(t){this.authRefreshFn=t},n.setTokens=function(t){localStorage.setItem("tokens",JSON.stringify(t))},n.getTokens=function(){var t={},e=localStorage.getItem("tokens");return e&&(t=JSON.parse(e)),t},r}(L);(d=exports.AssistantType||(exports.AssistantType={})).MedicalSecretary="MedicalSecretary",d.Nurse="Nurse",d.Specialist="Specialist",d.Administrative="Administrative",d.Other="Other",(v=exports.TransmissionKind||(exports.TransmissionKind={})).Fax="Fax",v.Email="Email",v.SMS="SMS",v.EncryptedEmail="EncryptedEmail",v.Logs="Logs",v.API="API",v.Other="Other",(m=exports.TransmissionStatus||(exports.TransmissionStatus={})).Preparing="Preparing",m.Sending="Sending",m.Sent="Sent",m.Retrying="Retrying",m.Failed="Failed",m.DriverError="DriverError",m.TimedOut="TimedOut",m.ReceiverNotExist="ReceiverNotExist",m.ReceiverNotAnswering="ReceiverNotAnswering",m.ReceiverIncompatible="ReceiverIncompatible",(g=exports.FeeStatus||(exports.FeeStatus={})).NoFee="NoFee",g.Pending="Pending",g.Paid="Paid",g.Reimbursed="Reimbursed",g.Cancelled="Cancelled",g.Contested="Contested",(y=exports.MedicalStatus||(exports.MedicalStatus={})).Creating="Creating",y.New="New",y.ToAnswer="ToAnswer",y.Answered="Answered",y.Closed="Closed",y.Reopened="Reopened",y.Archived="Archived",(b=exports.TaskStatus||(exports.TaskStatus={})).None="None",b.ToDo="ToDo",b.InProgress="InProgress",b.Blocked="Blocked",b.Done="Done",(x=exports.VisibilityType||(exports.VisibilityType={})).Generic="Generic",x.Private="Private",x.Instance="Instance",(R=exports.DrugType||(exports.DrugType={})).Generic="Generic",R.Instance="Instance",(w=exports.PlanStatus||(exports.PlanStatus={})).Pending="Pending",w.Accepted="Accepted",w.Rejected="Rejected";var T,C,S,A,F,D,O,E,I,G,_,N,M,q,j,B,W,K=function(t){function e(){return t.apply(this,arguments)||this}return c(e,t),e}(f(Error)),H=function(t){function e(){return t.apply(this,arguments)||this}return c(e,t),e}(f(Error)),V=function(t){function e(){return t.apply(this,arguments)||this}return c(e,t),e}(f(Error)),Q=function(t){function e(){return t.apply(this,arguments)||this}return c(e,t),e}(f(Error)),Y=function(t){function e(){return t.apply(this,arguments)||this}return c(e,t),e}(f(Error)),z=function(t){function e(){return t.apply(this,arguments)||this}return c(e,t),e}(f(Error)),J=function(t){function e(){return t.apply(this,arguments)||this}return c(e,t),e}(f(Error));(T=exports.WorkflowType||(exports.WorkflowType={})).Onboard="Onboard",T.Followup="Followup",T.Renew="Renew",T.DataRetrieve="DataRetrieve",(C=exports.RateDimension||(exports.RateDimension={})).RatioOnTotal="RatioOnTotal",C.FixedOnTotal="FixedOnTotal",C.RatioPlatformFee="RatioPlatformFee",C.FixedPlatformFee="FixedPlatformFee",C.RatioOnPlatformFeeTotal="RatioOnPlatformFeeTotal",C.FixedOnPlatformFeeTotal="FixedOnPlatformFeeTotal",C.RatioOnItem="RatioOnItem",C.FixedOnItem="FixedOnItem",(S=exports.PlanType||(exports.PlanType={})).Onboard="Onboard",S.Followup="Followup",S.Renew="Renew",S.DataRetrieve="DataRetrieve",(A=exports.PaymentStatus||(exports.PaymentStatus={})).Pending="Pending",A.Success="Success",A.Failure="Failure",A.Canceled="Canceled",(F=exports.PractitionerStatus||(exports.PractitionerStatus={})).Practicing="Practicing",F.Retired="Retired",F.NotInvolvedAnymore="NotInvolvedAnymore",F.Deactivated="Deactivated",F.Flagged="Flagged",F.InConflict="InConflict",F.Delicensed="Delicensed",(D=exports.AssignmentStatus||(exports.AssignmentStatus={})).Assigned="Assigned",D.Reassigned="Reassigned",D.Cancelled="Cancelled",(O=exports.PractitionnerRoleType||(exports.PractitionnerRoleType={})).Doctor="Doctor",O.MedicalAssistant="MedicalAssistant",O.MedicalSecretary="MedicalSecretary",O.Nurse="Nurse",O.Specialist="Specialist",O.LabAssistant="LabAssistant",O.Administrative="Administrative",O.ManualDispatcher="ManualDispatcher",O.Other="Other",(E=exports.OtherRoleType||(exports.OtherRoleType={})).Patient="Patient",E.User="User",E.System="System",(I=exports.LicenseStatus||(exports.LicenseStatus={})).Valid="Valid",I.Invalid="Invalid",I.Expired="Expired",I.NA="NA",I.Removed="Removed",(G=exports.PeriodType||(exports.PeriodType={})).PerYear="PerYear",G.PerQuarter="PerQuarter",G.PerMonth="PerMonth",G.PerWeek="PerWeek",G.PerBusinessDay="PerBusinessDay",G.PerDay="PerDay",G.PerHour="PerHour",(_=exports.SyncStatus||(exports.SyncStatus={})).Requested="Requested",_.Started="Started",_.Succeeded="Succeeded",_.Failed="Failed",_.Cancelled="Cancelled",(N=exports.PracticeEmailKind||(exports.PracticeEmailKind={})).SignedUp="SignedUp",N.Onboarded="Onboarded",N.OnboardedPractitioner="OnboardedPractitioner",N.OnboardedPatient="OnboardedPatient",N.Answered="Answered",N.ToAnswer="ToAnswer",N.FollowedUp="FollowedUp",N.Renewed="Renewed",N.DataRetrieved="DataRetrieved",(M=exports.PracticeConfigKind||(exports.PracticeConfigKind={})).PractitionerConsultList="PractitionerConsultList",M.PractitionerChatbox="PractitionerChatbox",M.PracticeTheme="PracticeTheme",M.PracticeLocaleSwitcher="PracticeLocaleSwitcher",M.PracticeCookieBanner="PracticeCookieBanner",M.PracticePharmacyPicker="PracticePharmacyPicker",(q=exports.StripePriceType||(exports.StripePriceType={})).Default="Default",q.Discount="Discount",(j=exports.IndexKey||(exports.IndexKey={})).Consultation="Consultation",j.IndexSnapshot="IndexSnapshot",j.ConsultationLockbox="ConsultationLockbox",(B=exports.DocumentType||(exports.DocumentType={})).Message="Message",B.Note="Note",B.DoctorsNote="DoctorsNote",B.Prescription="Prescription",B.ExamRequest="ExamRequest",B.Result="Result",B.Attachment="Attachment",B.BigFile="BigFile",B.MeetingRequest="MeetingRequest",B.AudioNote="AudioNote",B.VideoNote="VideoNote",B.PopulatedWorkflowData="PopulatedWorkflowData",B.TreatmentPlan="TreatmentPlan",B.ImageAlias="ImageAlias",(W=exports.MetadataCategory||(exports.MetadataCategory={})).ChildPersonal="ChildPersonal",W.Consultation="Consultation",W.DataRetrieval="DataRetrieval",W.Followup="Followup",W.Recovery="Recovery",W.Medical="Medical",W.OtherPersonal="OtherPersonal",W.Personal="Personal",W.Preference="Preference",W.Prescription="Prescription",W.Raw="Raw";var X=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,a,s,o,c,u,p,h){return this.api.head(this.baseURL+"/v1/consults",{params:{uuidPractice:t,uuidRequester:e,statusesMedical:r,statusesExclude:n,shortId:i,perPage:o,page:c,sortColumns:a,orderColumns:s,filterAssignedDoctor:u,filterCurrentPractitioner:p,filterIsoLocality:h}},"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,a,s,o,c,u,p,h){return this.api.get(this.baseURL+"/v1/consults",{params:{uuidPractice:t,uuidRequester:e,statusesMedical:r,statusesExclude:n,shortId:i,perPage:o,page:c,sortColumns:a,orderColumns:s,filterAssignedDoctor:u,filterCurrentPractitioner:p,filterIsoLocality:h}})},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,a,s){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),a&&o.append("txtTransmissionTitle",a),s&&o.append("txtTransmissionNotes",s),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}(),Z=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=s(k.mark((function t(e){var r;return k.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}(),$=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(o({},this.api.getTokens(),t))},e.authToken=function(){var t=s(k.mark((function t(e){var r,n,i,a;return k.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=20;break;case 8:if(t.prev=8,t.t0=t.catch(0),!t.t0.isAxiosError){t.next=19;break}a=null==(i=t.t0.response)?void 0:i.status,t.t1=a,t.next=400===t.t1?15:424===t.t1?16:500===t.t1?17:18;break;case 15:throw new H;case 16:throw new Q;case 17:throw new V;case 18:case 19:throw new K;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.authRefresh=function(){var t=s(k.mark((function t(e){return k.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=s(k.mark((function t(){return k.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=s(k.mark((function t(e){return k.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=s(k.mark((function t(e){var r,n,i;return k.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 z;case 15:throw new J;case 16:case 17:throw new Y;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=s(k.mark((function t(e,r){var n,i,a,s,o;return k.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0===r&&(r=!1),a=this.api.getTokens(),s=(null!=(n=a.accessToken)?n:"")+(null!=(i=a.refreshToken)?i:"")+e,!r&&a.accessToken&&this.identityCache[s]){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[s]=o;case 10:return t.abrupt("return",this.identityCache[s]);case 11:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),e.whoAmI=function(){var t=s(k.mark((function t(e){var r,n;return k.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=s(k.mark((function t(e,r){return k.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=s(k.mark((function t(e,r){return k.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=s(k.mark((function t(e){return k.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)}}(),t}(),tt=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:o({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 n.Buffer.from(i.sha256().update(t.toLowerCase()).digest("hex"),"hex").toString("base64")},e.practiceCreatePaymentsIntent=function(t,e,r,n,i,a,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,promotionCode:a}})},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){return this.api.put(this.baseURL+"/v1/practices/"+t+"/payments/intents/"+e,o({},r,{hashUserEmail:n?this.getPaymentIntentHashedEmail(n):void 0}),{params:{promotionCode:i}})},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}(),et=function(){function t(t,e){this.api=t,this.baseURL=e}var e=t.prototype;return e.lockboxDataStore=function(){var t=s(k.mark((function t(e,r,n,i){return k.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){return this.api.put(this.baseURL+"/v1/consults/"+e,{patientUuid:t,statusMedical:r,neverExpires:n})},t}(),rt=function(){function t(t,e){this.api=t,this.baseURL=e}var e=t.prototype;return e.lockboxCreate=function(){var t=s(k.mark((function t(e){return k.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=s(k.mark((function t(e,r,n){return k.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=s(k.mark((function t(e,r){return k.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=s(k.mark((function t(e,r,n){return k.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=s(k.mark((function t(){return k.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=s(k.mark((function t(e,r,n,i){return k.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=s(k.mark((function t(e,r,n,i){var a;return k.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(a=t.sent,!i){t.next=6;break}return t.abrupt("return",{data:a});case 6:return t.abrupt("return",a);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=s(k.mark((function t(e,r,n){return k.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=s(k.mark((function t(e,r,n,i,a){return k.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:a,fields:r,groupby:n,filter:i}}));case 1:case"end":return t.stop()}}),t,this)})));return function(e,r,n,i,a){return t.apply(this,arguments)}}(),e.vaultIndexPut=function(){var t=s(k.mark((function t(e,r){return k.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=s(k.mark((function t(e){return k.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=s(k.mark((function t(e,r,n){return k.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}(),nt=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}();exports.APIService=U,exports.AuthenticationBadRequest=H,exports.AuthenticationFailed=K,exports.AuthenticationServerError=V,exports.AuthenticationUnconfirmedEmail=Q,exports.AxiosService=L,exports.ConsultService=X,exports.DiagnosisService=Z,exports.GuardService=$,exports.IdentityCreationBadRequest=z,exports.IdentityCreationConflict=J,exports.IdentityCreationFailed=Y,exports.PracticeService=tt,exports.TellerService=et,exports.VaultService=rt,exports.WorkflowService=nt,exports.default=function(t,e){var r=t.tellerBaseURL,n=t.practiceBaseURL,i=t.consultBaseURL,a=t.vaultBaseURL,s=t.guardBaseURL,o=t.workflowBaseURL,c=t.diagnosisBaseURL,u=new U(void 0,e);return{tellerService:r?new et(u,r):void 0,practiceService:n?new tt(u,n):void 0,consultService:i?new X(u,i):void 0,vaultService:a?new rt(u,a):void 0,guardService:s?new $(u,s):void 0,workflowService:o?new nt(u,o):void 0,diagnosisService:c?new Z(u,c):void 0}};
|
|
2
2
|
//# sourceMappingURL=oro-sdk-apis.cjs.production.min.js.map
|