@eway-crm/connector 1.0.249 → 1.0.251

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.
@@ -59,7 +59,7 @@ export declare class ApiConnection {
59
59
  * @param errorCallback Optional. Handler callback for any other failures. If not supplied, the global error handler is used.
60
60
  * @param config Optional. Additional config for the request.
61
61
  */
62
- readonly callCustomUploadMethod: (file: File, data: Record<string, string>, methodName: string, successCallback: (res: IApiResult) => void, unsuccessCallback?: ((e: IApiResult) => void) | undefined, errorCallback?: ((e: TUnionError) => void) | undefined, config?: AxiosRequestConfig) => void;
62
+ readonly callCustomUploadMethod: (file: File, data: Record<string, string>, methodName: string, successCallback: (res: IApiResult) => void, unsuccessCallback?: (e: IApiResult) => void, errorCallback?: (e: TUnionError) => void, config?: AxiosRequestConfig) => void;
63
63
  /**
64
64
  * Asynchronously uploads file using binary stream
65
65
  * @param itemGuid Item identificator. Ex. '9ac561be-9b7d-4938-8e55-4cce97142483'.
@@ -70,7 +70,7 @@ export declare class ApiConnection {
70
70
  * @param errorCallback Optional. Handler callback for any other failures. If not supplied, the global error handler is used.
71
71
  * @param config Optional. Additional config for the request.
72
72
  */
73
- readonly callUploadMethod: (itemGuid: string, fileName: string, file: File, successCallback: (res: IApiResult) => void, unsuccessCallback?: ((e: IApiResult) => void) | undefined, errorCallback?: ((e: TUnionError) => void) | undefined, config?: AxiosRequestConfig) => void;
73
+ readonly callUploadMethod: (itemGuid: string, fileName: string, file: File, successCallback: (res: IApiResult) => void, unsuccessCallback?: (e: IApiResult) => void, errorCallback?: (e: TUnionError) => void, config?: AxiosRequestConfig) => void;
74
74
  /**
75
75
  * Creates a promise for async API method call.
76
76
  * @param methodName API method name. Ex. 'GetUsers'.
@@ -88,8 +88,8 @@ export declare class ApiConnection {
88
88
  * @param httpMethod Optional. The used HTTP method. POST or GET. Default is POST.
89
89
  * @param errorCallback Optional. Handler callback for any other failures. If not supplied, the global error handler is used.
90
90
  */
91
- readonly callMethod: <TResult extends IApiResult>(methodName: string, data: TInputData, successCallback: (result: TResult) => void, unsuccessCallback?: ((result: TResult) => void) | undefined, httpMethod?: HttpMethod, errorCallback?: ((error: TUnionError) => void) | undefined) => void;
92
- readonly callWithoutSession: <TResult extends IApiResult>(methodName: string, data: TInputData | null, successCallback: (result: TResult) => void, unsuccessCallback: (result: TResult) => void, headers?: Record<string, string> | null, httpMethod?: HttpMethod, errorCallback?: ((error: TUnionError) => void) | undefined) => void;
91
+ readonly callMethod: <TResult extends IApiResult>(methodName: string, data: TInputData, successCallback: (result: TResult) => void, unsuccessCallback?: (result: TResult) => void, httpMethod?: HttpMethod, errorCallback?: (error: TUnionError) => void) => void;
92
+ readonly callWithoutSession: <TResult extends IApiResult>(methodName: string, data: TInputData | null, successCallback: (result: TResult) => void, unsuccessCallback: (result: TResult) => void, headers?: Record<string, string> | null, httpMethod?: HttpMethod, errorCallback?: (error: TUnionError) => void) => void;
93
93
  readonly getItemPreviewGetMethodUrl: (folderName: string, itemGuid: string, itemVersion?: number) => string;
94
94
  readonly getEmailAttachmentGetMethodUrl: (itemGuid: string, contentId: string) => string;
95
95
  readonly getAllEmailAttachmentsZipGetMethodUrl: (itemGuid: string) => string;
@@ -29,6 +29,7 @@ declare class GlobalSettingsNames {
29
29
  static readonly enableLlamaAiFeatures = "EnableLlamaAiFeatures";
30
30
  static readonly enableUsersSyncIntoMobileDeviceContacts = "EnableUsersSyncIntoMobileDeviceContacts";
31
31
  static readonly emailsActiveProjectsLeadsFilter = "EmailsActiveProjectsLeadsFilter";
32
+ static readonly trackToAddressesOnly = "TrackToAddressesOnly";
32
33
  static readonly exchangeRatesAdminGroupName = "ExchangeRatesAdminGroupName";
33
34
  static readonly forcedEmailTrackingGroups = "ForcedEmailTrackingGroups";
34
35
  static readonly ignoreEmailsFromDomainsOnEmailsTracking = "IgnoreEmailsFromDomainsOnEmailsTracking";
@@ -47,4 +47,6 @@ export interface IApiCart extends IApiItemBase {
47
47
  Companies_CustomerGuid: string | null;
48
48
  Leads_CartGuid: string | null;
49
49
  Projects_CartGuid: string | null;
50
+ Margin: number | null;
51
+ Markup: number | null;
50
52
  }
@@ -23,4 +23,6 @@ export interface IApiGood extends IApiItemBase {
23
23
  PictureHeight: number | null;
24
24
  TypeEn: string | null;
25
25
  Goods_SuperiorGoodGuid: string | null;
26
+ Margin: number | null;
27
+ Markup: number | null;
26
28
  }
@@ -59,4 +59,6 @@ export interface IApiGoodInCart extends IApiItemBase {
59
59
  Goods_GoodsInfoGuid: string | null;
60
60
  Leads_ProjectGuid: string | null;
61
61
  Projects_ProjectGuid: string | null;
62
+ Margin: number | null;
63
+ Markup: number | null;
62
64
  }
package/lib/cjs/index.js CHANGED
@@ -5,4 +5,4 @@
5
5
  * @license Licensed under MIT license
6
6
  * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
7
7
  * @version v4.2.8+1e68dce6
8
- */class u{}u.rcSuccess="rcSuccess",u.rcBadSession="rcBadSession",u.rcDuplicateContact="rcDuplicateContact",u.rcWebServiceMoved="rcWebServiceMoved",u.rcAccessDenied="rcAccessDenied",u.rcLoginUserNameChanged="rcLoginUserNameChanged",u.rcLicenseExpired="rcLicenseExpired",exports.HttpMethod=void 0,(a=exports.HttpMethod||(exports.HttpMethod={})).get="get",a.post="post";class d{}d.absence="Absence",d.bonusType="BonusType",d.busyStatus="BusyStatus",d.cartType="CartType",d.companyType="CompanyType",d.contactType="ContactType",d.countryCode="CountryCode",d.currency="Currency",d.customFieldCategory="CustomFieldCategory",d.dayType="DayType",d.documentOfflineState="DocumentOfflineState",d.documentType="DocumentType",d.emailCampaignWorkflowStatus="EmailCampaignWorkflowStatus",d.emailOfflineState="EmailOfflineState",d.emailType="EmailType",d.familyStatus="FamilyStatus",d.firstContact="FirstContact",d.globalSettingsCategory="GlobalSettingsCategory",d.goalType="GoalType",d.groupColor="GroupColor",d.importance="Importance",d.journalType="JournalType",d.knowledgeLevel="KnowledgeLevel",d.knowledgeTitle="KnowledgeTitle",d.knowledgeType="KnowledgeType",d.leadType="LeadType",d.marketingType="MarketingType",d.paymentType="PaymentType",d.prefixType="PrefixType",d.productType="ProductType",d.projectOrigin="ProjectOrigin",d.projectType="ProjectType",d.reportCategory="ReportCategory",d.responseForm="ResponseForm",d.responseType="ResponseType",d.salaryDate="SalaryDate",d.salaryType="SalaryType",d.salePriceType="SalePriceType",d.sentimentTone="SentimentTone",d.suffixType="SuffixType",d.taskImportance="TaskImportance",d.tasksSnoozePeriod="TasksSnoozePeriod",d.taskStatus="TaskStatus",d.taskType="TaskType",d.trainingGrade="TrainingGrade",d.trainingTitle="TrainingTitle",d.translations="Translations",d.units="Units",d.userType="UserType",d.usStatesDistrictsTerritories="USStatesDistrictsTerritories",d.vacationType="VacationType",d.vat="VAT",d.workLoad="WorkLoad",d.workReportType="WorkReportType";class m{}m.isValidFolderName=e=>Object.values(m).includes(e),m.actions="Actions",m.additionalFields="AdditionalFields",m.bonuses="Bonuses",m.calendar="Calendar",m.capacityNotes="CapacityNotes",m.capacityNoteTypes="CapacityNoteTypes",m.carts="Carts",m.columnPermissions="ColumnPermissions",m.companies="Companies",m.contacts="Contacts",m.contactsSuggestions="ContactsSuggestions",m.currencyExchangeRates="CurrencyExchangeRates",m.documents="Documents",m.emails="Emails",m.enumTypes="EnumTypes",m.enumValues="EnumValues",m.enumValuesRelations="EnumValuesRelations",m.features="Features",m.flows="Flows",m.globalSettings="GlobalSettings",m.goals="Goals",m.goods="Goods",m.goodsInCart="GoodsInCart",m.goodsInSet="GoodsInSet",m.groups="Groups",m.history="History",m.holidays="Holidays",m.children="Children",m.individualDiscounts="IndividualDiscounts",m.invoiceItems="InvoiceItems",m.invoices="Invoices",m.itemCopyRelations="ItemCopyRelations",m.journal="Journal",m.knowledge="Knowledge",m.layouts="Layouts",m.layoutsModels="LayoutsModels",m.leads="Leads",m.ledger="Ledger",m.mappings="Mappings",m.marketing="Marketing",m.marketingList="MarketingList",m.marketingListSources="MarketingListSources",m.models="Models",m.modulePermissions="ModulePermissions",m.objectTypesOptions="ObjectTypesOptions",m.payments="Payments",m.priceListGroups="PriceListGroups",m.projectAssignments="ProjectAssignments",m.projectAssignmentsPerUserProject="ProjectAssignmentsPerUserProject",m.projectAssignmentsTotal="ProjectAssignmentsTotal",m.projectAssignmentsTotalUserProject="ProjectAssignmentsTotalUserProject",m.projectList="ProjectList",m.projects="Projects",m.projectUsersInCaPlan="ProjectUsersInCaPlan",m.relationData="RelationData",m.relations="Relations",m.reports="Reports",m.revisionsHistory="RevisionsHistory",m.salaries="Salaries",m.salePrices="SalePrices",m.prices="Prices",m.sqlObjects="SqlObjects",m.tasks="Tasks",m.recurrencePatterns="RecurrencePatterns",m.teamRoles="TeamRoles",m.templates="Templates",m.training="Training",m.unifiedRelations="UnifiedRelations",m.users="Users",m.userSettings="UserSettings",m.vacation="Vacation",m.webAccess2Options="WebAccess2Options",m.webAccessOptions="WebAccessOptions",m.workCommitments="WorkCommitments",m.workflowHistory="WorkflowHistory",m.workReports="WorkReports",m.wrongClientVersions="WrongClientVersions",m.xsltTransformations="XsltTransformations",m.xsltTransformationsModels="XsltTransformationsModels",m.getEnumTypeName=e=>e===m.bonuses?d.bonusType:e===m.carts?d.cartType:e===m.companies?d.companyType:e===m.contacts?d.contactType:e===m.documents?d.documentType:e===m.emails?d.emailType:e===m.goals?d.goalType:e===m.goods?d.productType:e===m.journal?d.journalType:e===m.knowledge?d.knowledgeType:e===m.leads?d.leadType:e===m.marketing?d.marketingType:e===m.projects?d.projectType:e===m.salaries?d.salaryType:e===m.salePrices?d.salePriceType:e===m.tasks?d.taskType:e===m.training?d.trainingTitle:e===m.users?d.userType:e===m.vacation?d.vacationType:e===m.workReports?d.workReportType:null,m.getFolderNameByEnumTypeName=e=>e===d.bonusType?m.bonuses:e===d.cartType?m.carts:e===d.companyType?m.companies:e===d.contactType?m.contacts:e===d.documentType?m.documents:e===d.emailType?m.emails:e===d.goalType?m.goals:e===d.journalType?m.journal:e===d.knowledgeType?m.knowledge:e===d.leadType?m.leads:e===d.marketingType?m.marketing:e===d.productType?m.goods:e===d.projectType?m.projects:e===d.salaryType?m.salaries:e===d.salePriceType?m.salePrices:e===d.taskType?m.tasks:e===d.trainingTitle?m.training:e===d.userType?m.users:e===d.vacationType?m.vacation:e===d.workReportType?m.workReports:null;class p{}p.getAllEmailAttachments="GetAllEmailAttachments",p.getCalendarsByItemGuids="GetCalendarsByItemGuids",p.getEmailAttachment="GetEmailAttachment",p.getItemPreview="GetItemPreview",p.getJournalsByItemGuids="GetJournalsByItemGuids",p.getMarketingCampaignsByItemGuids="GetMarketingCampaignsByItemGuids",p.getMarketingListsRecordsByItemGuids="GetMarketingListsRecordsByItemGuids",p.getRevisionHistoryRecordsByItemGuids="GetRevisionHistoryRecordsByItemGuids",p.getVacationsByItemGuids="GetVacationsByItemGuids",p.getWorkflowHistoryRecordsByItemGuids="GetWorkflowHistoryRecordsByItemGuids",p.getCompanyInformationFromTaxRegister="GetCompanyInformationFromTaxRegister",p.logIn="LogIn",p.logOut="LogOut",p.query="Query",p.queryAmount="QueryAmount",p.getServiceAuthSettings="GetServiceAuthSettings",p.getVersion="GetVersion",p.getBinaryAttachment="GetBinaryAttachment",p.getBinaryAttachmentLatestRevision="GetBinaryAttachmentLatestRevision",p.transformItem="TransformItem",p.canUnlinkItems="CanUnlinkItems",p.unlinkItems="UnlinkItems",p.getGoodsFinalPrices="GetGoodsFinalPrices",p.saveItemCopyRelation="SaveItemCopyRelation",p.getXsltTransormationDefinition="GetXsltTransformationDefinition",p.saveBinaryAttachment="SaveBinaryAttachment",p.saveBinaryXsltTransformation="SaveBinaryXsltTransformation",p.getFolderNameForApiMethod=e=>{switch(e){case m.calendar:return"Calendars";case m.journal:return"Journals";case m.marketing:return"MarketingCampaigns";case m.marketingList:return"MarketingListsRecords";case m.revisionsHistory:return"RevisionHistoryRecords";case m.vacation:return"Vacations";case m.workflowHistory:return"WorkflowHistoryRecords";default:return e}},p.getGetFolderNameByItemGuidsMethodName=e=>`Get${p.getFolderNameForApiMethod(e)}ByItemGuids`,p.getGetFolderNameMethodName=e=>`Get${p.getFolderNameForApiMethod(e)}`,p.getSearchFolderNameMethodName=e=>`Search${p.getFolderNameForApiMethod(e)}`;class h{constructor(e,t,r,n,o,s){if(this.invalidateSessionId=(e,t)=>{t&&t()},this.getSessionId=(e,t)=>{e.callWithoutSession(p.logIn,{userName:this.username,passwordHash:this.passwordHash,appVersion:this.appVersion,clientMachineIdentifier:this.clientMachineIdentifier,clientMachineName:this.clientMachineName,createSessionCookie:e.supportsGetItemPreviewMethod},e=>{this.lastSuccessfulLoginResponse=e;const r=e.SessionId;if(!r){const e=new Error("Successful login but no session came.");if(!this.errorCallback)throw e;return void this.errorCallback(e)}t&&t(r,e)},e=>{const t=new Error("Unable to login. Error response follows.\n"+JSON.stringify(e));if(!this.errorCallback)throw t;this.errorCallback(t)})},!e||!t)throw new Error("Non of the arguments 'username', 'passwordHash' can be empty.");this.username=e,this.passwordHash=t,this.appVersion=r,this.clientMachineIdentifier=n,this.clientMachineName=o,this.errorCallback=s}}class y{constructor(){this.getSessionId=(e,t)=>{throw new Error("With anonymous session handler, use only connection methods without session.")},this.invalidateSessionId=(e,t)=>{throw new Error("With anonymous session handler, use only connection methods without session.")}}}class C{static createAuthorizeUrl(e,t,r,n,o,s,i=!1,a){if(o&&!s||!o&&s)throw new Error("If codeChallenge is defined, codeChallengeMethod must also be defined and vice versa");let l=`https://login.eway-crm.${i?"dev":"com"}?scope=${encodeURIComponent(t.join(" "))}&prompt=login&response_type=code&redirect_uri=${encodeURIComponent(r)}&client_id=${e}`;return n&&(l+=`&state=${encodeURIComponent(n)}`),o&&s&&(l+=`&code_challenge=${encodeURIComponent(o)}&code_challenge_method=${encodeURIComponent(s)}`),a&&(l+=`&url=${encodeURIComponent(a)}`),l}}C.finishAuthorization=(e,t,r,n,o,s,i)=>{const a=new URLSearchParams;a.append("code_verifier",n),a.append("client_id",t),a.append("client_secret",r),a.append("code",o),a.append("redirect_uri",s),a.append("grant_type","authorization_code"),C.callTokenEndpoint(e,a,i)},C.refreshToken=(e,t,r,n,o)=>{const s=new URLSearchParams;s.append("client_id",t),s.append("client_secret",r),s.append("refresh_token",n),s.append("grant_type","refresh_token"),C.callTokenEndpoint(e,s,o)},C.getWebServiceUrl=e=>{const t=e.split(".");if(2!==t.length)throw new Error("Invalid token supplied");return s.decode(t[1])},C.getUserName=e=>C.decodeAccessToken(e).username,C.decodeAccessToken=e=>r(e),C.callTokenEndpoint=(t,r,n)=>{e.post(t+"/auth/connect/token",r,{headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then(e=>{n(e.data)}).catch(e=>{e.response&&400==e.response.status?n(e.response.data):n({error:"Token request failed"})})};class f extends Error{constructor(e,t){super(),this.returnCode=e,this.message=t}}class g{constructor(e,t,r,n,o){if(!e)throw new Error("Non of the arguments 'username', 'clientId', 'clientSecret', 'refreshToken' can be empty.");this.username=e,this.accessToken=t,this.appVersion=r,this.getNewAccessTokenCallback=n,this.errorCallback=o}invalidateSessionId(e,t){t&&t()}getSessionId(e,t){const r={userName:this.username,appVersion:this.appVersion,createSessionCookie:e.supportsGetItemPreviewMethod},n={Authorization:"Bearer "+this.accessToken};e.callWithoutSession(p.logIn,r,e=>{this.lastSuccessfulLoginResponse=e;const r=e.SessionId;if(!r){const e=new Error("Successful login but no session came.");if(!this.errorCallback)throw e;return void this.errorCallback(e)}t&&t(r,e)},e=>{const t=new f(e.ReturnCode,"Unable to login. Error response follows.\n"+JSON.stringify(e));if(!this.errorCallback)throw t;this.errorCallback(t)},n,void 0,r=>{if(401!==(null==r?void 0:r.statusCode)){if(!this.errorCallback)throw r;this.errorCallback(r)}else this.getNewAccessTokenCallback(e,r=>{this.accessToken=r.accessToken,r.error||this.getSessionId(e,t)})})}}class P extends g{constructor(e,t,r,n,o,s,i,a){if(!(e&&n&&t&&r))throw new Error("Non of the arguments 'username', 'clientId', 'clientSecret', 'refreshToken' can be empty.");super(e,o,s,(e,t)=>{C.refreshToken(e.wsUrl,this.clientId,this.clientSecret,this.refreshToken,e=>{try{this.refreshTokenCallback&&this.refreshTokenCallback(e)}catch(e){this.errorCallback&&this.errorCallback(new Error("Refresh token callback failed.\n"+JSON.stringify(e)))}void 0!==e.error?t({error:e.error}):t({accessToken:e.access_token})})},i),this.refreshToken=n,this.clientId=t,this.clientSecret=r,this.refreshTokenCallback=a}}class T extends Error{constructor(e,t){super(),this.statusCode=e,this.message=t}}class E{}E.stringifyError=e=>JSON.stringify(e,E.replaceErrors),E.replaceErrors=(e,t)=>{if(t instanceof Error){const e={};return Object.getOwnPropertyNames(t).forEach(r=>{e[r]=t[r]}),e}return t};class S{}S.openItemLinkRegEx=/https:\/\/open\.eway-crm\.(dev|com)\/\?[-a-zA-Z0-9()@:%_\+.~#?&\/=]*/gi,S.itemParamName="l",S.openLinkDomainLength=7,S.getOpenLinkDomain=e=>e?"open.eway-crm.dev":"open.eway-crm.com",S.isOpenItemLinkInText=e=>S.openItemLinkRegEx.test(e),S.getOpenLinksFromString=e=>e.match(S.openItemLinkRegEx),S.getItemLinksFromOpenLinks=e=>{try{return e.map(e=>new URL(e).searchParams.get(S.itemParamName))}catch(e){console.error("Invalid string passed for cretaing url while getting links from open links")}},S.getItemInfoFromLink=e=>{const t=s.decode(e).substring(S.openLinkDomainLength).split("/");if(Object.keys(m).some(e=>m[e]===t[0])&&t[1]){return{folderName:t[0],itemGuid:t[1]}}},S.getAllItemsFromTextWithLinks=e=>{const t={};if(S.isOpenItemLinkInText(e)){const r=S.getOpenLinksFromString(e);if(!r)return;const n=S.getItemLinksFromOpenLinks(r);null==n||n.forEach(e=>{var r;if(!e)return;const n=S.getItemInfoFromLink(e);n&&(t[n.folderName]=t[n.folderName]?[...null!==(r=t[n.folderName])&&void 0!==r?r:[],n.itemGuid]:[n.itemGuid])})}return t};class I{constructor(t,r,n,o){if(this.ensureLogin=()=>new Promise((e,t)=>{if(this.sessionId)e();else{const r=r=>{r&&(this.sessionId=r,e()),t("Session Id cannot be empty")};this.sessionHandler.getSessionId(this,r)}}),this.createOpenLink=(e,t,r,n)=>{const o=s.encode(this.baseUri);let i="eway://"+t;r&&(i+="/"+(null==r?void 0:r.toLowerCase()));const a=S.getOpenLinkDomain(e);i=s.encode(i);let l="https://"+a+"/?ws="+o+`&${S.itemParamName}=`+i;return n&&(l+="&n="+encodeURIComponent(n)),l},this.askCustomUploadMethod=(e,t,r,n,o)=>new Promise((s,i)=>{const a=o?e=>{throw i(e),e}:i;this.callCustomUploadMethod(e,t,r,s,a,a,n)}),this.askUploadMethod=(e,t,r,n,o)=>new Promise((s,i)=>{const a=o?e=>{throw i(e),e}:i;this.callUploadMethod(e,t,r,s,a,a,n)}),this.callCustomUploadMethod=(t,r,n,o,s,i,a)=>{const l=()=>{this.sessionHandler.getSessionId(this,e=>{this.sessionId=e,this.callCustomUploadMethod(t,r,n,o,s,i,a)})},c=this.sessionId;if(!c)return void l();const d=new URLSearchParams(r),m=`${this.svcUri}/${n}?sessionId=${this.sessionId}&${d.toString()}`,p=e.post(m,t,a);I.handleCallPromise(p,o,e=>{if(e.ReturnCode===u.rcBadSession)return this.sessionId=null,void this.sessionHandler.invalidateSessionId(c,l);if(s)s(e);else{const t=new Error("Unhandled connection return code "+e.ReturnCode+": "+e.Description);if(!this.errorCallback)throw t;this.errorCallback(t)}},e=>{let t=new Error("Unhandled connection error when calling "+m+": "+E.stringifyError(e));if("statusCode"in e&&413===e.statusCode&&(t=new Error("The file has exceeded the maximum allowed file size for uploading. You can contact your IT administrator or eWay-CRM support if you would like to increase the limit.")),i)i(t);else{if(!this.errorCallback)throw t;this.errorCallback(t)}})},this.callUploadMethod=(e,t,r,n,o,s,i)=>{this.callCustomUploadMethod(r,{itemGuid:e,fileName:t},p.saveBinaryAttachment,n,o,s,i)},this.askMethod=(e,t,r,n)=>new Promise((o,s)=>{const i=n?e=>{throw s(e),e}:s;this.callMethod(e,t,o,i,r,i)}),this.callMethod=(e,t,r,n,o,s)=>{o||(o=exports.HttpMethod.post);const i=()=>{this.sessionHandler.getSessionId(this,i=>{this.sessionId=i,this.callMethod(e,t,r,n,o,s)})},a=this.sessionId;if(!a)return void i();t.sessionId=a;const l=e!==p.logOut?r:e=>{this.sessionId=null,r(e)};this.callWithoutSession(e,t,l,r=>{if(r.ReturnCode!==u.rcBadSession||(this.sessionId=null,e===p.logOut))if(n)n(r);else{const e=new Error("Unhandled connection return code "+r.ReturnCode+": "+r.Description);if(!this.errorCallback)throw e;this.errorCallback(e,t)}else this.sessionHandler.invalidateSessionId(a,i)},null,o,s)},this.callWithoutSession=(t,r,n,o,s,i,a)=>{var l;i||(i=exports.HttpMethod.post);const c=this.svcUri+"/"+t;let u,d;switch(s&&(u={headers:s,withCredentials:null!==(l=this.supportGetItemPreviewMethod)&&void 0!==l?l:t==p.logIn}),i){case exports.HttpMethod.get:if(r)throw new Error("Calling api get method with data specified does not make any sense.");d=e.get(c,u);break;case exports.HttpMethod.post:d=e.post(c,r,u);break;default:throw new Error(`Unknown http method '${i}'.`)}I.handleCallPromise(d,n,o,e=>{if(a)try{a(e)}catch(e){if(!this.errorCallback)throw e;this.errorCallback(e,r)}else{const t=new Error("Unhandled connection error when calling "+c+": "+E.stringifyError(e));if(!this.errorCallback)throw t;this.errorCallback(t,r)}})},this.getItemPreviewGetMethodUrl=(e,t,r)=>this.svcUri+"/"+p.getItemPreview+"?folderName="+encodeURIComponent(e)+"&itemGuid="+encodeURIComponent(t)+(r||0===r?"&itemVersion="+encodeURIComponent(r.toString()):""),this.getEmailAttachmentGetMethodUrl=(e,t)=>this.svcUri+"/"+p.getEmailAttachment+"?itemGuid="+encodeURIComponent(e)+"&contentId="+encodeURIComponent(t),this.getAllEmailAttachmentsZipGetMethodUrl=e=>this.svcUri+"/"+p.getAllEmailAttachments+"?itemGuid="+encodeURIComponent(e),this.getBinaryAttachmentGetMethodUrl=(e,t)=>"number"==typeof t?this.svcUri+"/"+p.getBinaryAttachment+"?itemGuid="+encodeURIComponent(e)+`&revision=${t}`:this.svcUri+"/"+p.getBinaryAttachmentLatestRevision+"?itemGuid="+encodeURIComponent(e),this.getTransformItemMethodUrl=(e,t,r,n,o)=>`${this.svcUri}/${p.transformItem}?itemGuid=${encodeURIComponent(e)}&itemFolderName=${encodeURIComponent(t)}&transformationGuid=${encodeURIComponent(r)}&outputFormat=${n}${o?`&lang=${encodeURIComponent(o)}`:""}`,this.getXsltTransformationDefinitionMethodUrl=e=>`${this.svcUri}/${p.getXsltTransormationDefinition}?itemGuid=${encodeURIComponent(e)}`,this.getActiveSessionId=()=>this.sessionId,this.setActiveSessionId=e=>{this.sessionId=e},!t)throw new Error("The argument 'apiServiceUri' cannot be empty.");if(t.length<8||"https://"!==t.substr(0,8).toLowerCase()&&"http://"!==t.substr(0,7).toLowerCase())throw new Error("Api service uri must start either with 'https://' or with 'http://'.");if(".svc"===t.substr(t.length-4).toLowerCase()){this.svcUri=t;const e=["/API.svc","/InsecureAPI.svc","/WcfService/Service.svc"].find(e=>e.toLowerCase()===t.substr(t.length-e.length).toLowerCase())||"";this.baseUri=t.substr(0,t.length-e.length)}else this.baseUri=I.normalizeWsUrl(t)||t,"https://"===t.substr(0,8).toLowerCase()?this.svcUri=this.baseUri+"/API.svc":this.svcUri=this.baseUri+"/InsecureAPI.svc";this.sessionHandler=r,this.errorCallback=n,this.sessionId=null,this.supportGetItemPreviewMethod=null!=o&&o}get supportsGetItemPreviewMethod(){return this.supportGetItemPreviewMethod}static create(e,t,r,n,o,s,i,a){return new I(e,new h(t,r,n,o,s,i),i,a)}static createAnonymous(e,t){return new I(e,new y,t)}static createUsingOAuth(e,t,r,n,o,s,i,a,l,c){return new I(e,new P(t,r,n,o,s,i,a,l),a,c)}static normalizeWsUrl(e){return e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),e}static isCloudUrl(e,t){const r=new URL(e),n=new Set;return n.add("hosting.eway-crm.com"),n.add("free.eway-crm.com"),n.add("hosting.eway-crm.us"),n.add("hosting-vh39276.eway-crm.us"),n.add("free.eway-crm.us"),t&&(n.add("free.eway-crm.dev"),n.add("hosting.eway-crm.dev"),n.add("localhost")),n.has(r.host)}get wsUrl(){return this.baseUri}static handleCallPromise(e,t,r,n){e.then(e=>{200===e.status?e.data.ReturnCode===u.rcSuccess?t(e.data):r(e.data):n(new T(e.status,e.statusText))}).catch(e=>{e.response?n(new T(e.response.status,e.response.statusText)):n(e)})}}class A{constructor(e,t,r,n,o,s,i){this.isEnabled=(e,t)=>{const r=()=>{this.url&&this.token?e(this.url,this.token):t()};this.url&&this.token?e(this.url,this.token):this.obtainToken(r)},this.callTokenizedApi=(e,t,r,n)=>{this.isEnabled((o,s)=>{t.token=s,A.call(o,e,t,r,o=>{if(o.ReturnCodeString!==this.invalidTokenReturnCode){if(n)n(o);else if(this.generalErrorCallback){const e=new Error("Unhandled tokenized service connection return code "+o.ReturnCodeString+".\nDescription: "+o.Description);this.generalErrorCallback(e)}}else this.obtainToken(()=>{this.callTokenizedApi(e,t,r,n)})},e=>{if(this.generalErrorCallback){const t=new Error("Unhandled tokenized service connection communication error: "+JSON.stringify(e));this.generalErrorCallback(t)}})},()=>{n&&n(null)})},this.obtainToken=e=>{if(!this.isActive)return this.url=null,this.token=null,void e();const t=t=>{const r=this.urlAndTokenObtainer(t);r.url&&r.token?(this.url=r.url,this.token=r.token,this.isActive=!0,e()):(this.url=null,this.token=null,this.isActive=!1,e())},r=()=>{this.url=null,this.token=null,this.isActive=!1,e()};this.needsSession?this.connection.callMethod(this.obtainTokenMethodName,{},t,r,this.obtainTokenMethodType):this.connection.callWithoutSession(this.obtainTokenMethodName,null,t,r,null,this.obtainTokenMethodType)},this.obtainTokenMethodName=e,this.obtainTokenMethodType=t,this.needsSession=r,this.invalidTokenReturnCode=n,this.urlAndTokenObtainer=o,this.connection=s,this.generalErrorCallback=i||null,this.url=null,this.token=null,this.isActive=!0}static call(t,r,n,o,s,i){const a=t+"/"+r;e.post(a,n).then(e=>{200===e.status?"Success"===e.data.ReturnCodeString?o(e.data):s(e.data):i(new T(e.status,e.statusText))}).catch(e=>{e.response?i(new T(e.response.status,e.response.statusText)):i(e)})}}const v=e=>({url:e.ServiceUrl,token:e.Token});class k{}k.acceptableBackwardWorkReportDays="AcceptableBackwardWorkReportDays",k.adminAppInactiveLogoutTime="AdminAppInactiveLogoutTime",k.allowChangeGoodsInCartListPrice="AllowChangeGoodsInCartListPrice",k.applyGeneralDataProtectionRules="ApplyGeneralDataProtectionRules",k.automaticallyCreateJournalAfterCallDuration="AutomaticallyCreateJournalAfterCallDuration",k.bonusesCompletedState="BonusesCompletedState",k.cartInvoicedState="CartInvoicedState",k.cartOrderCanceledState="CartOrderCanceledState",k.cartOrderInProcessState="CartOrderInProcessState",k.cartOrderProcessedState="CartOrderProcessedState",k.cartPaidState="CartPaidState",k.cartProposalInProcessState="CartProposalInProcessState",k.cartProposalProcessedState="CartProposalProcessedState",k.cartSalesVoucherIssuedState="CartSalesVoucherIssuedState",k.cartToBeInvoicedState="CartToBeInvoicedState",k.cartVoidedState="CartVoidedState",k.clickToCallScheme="ClickToCallScheme",k.companyDuplicityCheckEnabled="CompanyDuplicityCheckEnabled",k.completedStateName="CompletedStateName",k.contactDuplicityCheckEnabled="ContactDuplicityCheckEnabled",k.createCompanyWhileImportingContactFromOutlook="CreateCompanyWhileImportingContactFromOutlook",k.defaultProposalValidityPeriod="DefaultProposalValidityPeriod",k.enableContactsTwoWaySyncWithM365="EnableContactsTwoWaySyncWithM365",k.deadStateName="DeadStateName",k.enableCompaniesSyncIntoMobileDeviceContacts="EnableCompaniesSyncIntoMobileDeviceContacts",k.enableContactsSyncIntoMobileDevice="EnableContactsSyncIntoMobileDevice",k.enableLeadsSyncIntoMobileDeviceContacts="EnableLeadsSyncIntoMobileDeviceContacts",k.enableLlamaAiFeatures="EnableLlamaAiFeatures",k.enableUsersSyncIntoMobileDeviceContacts="EnableUsersSyncIntoMobileDeviceContacts",k.emailsActiveProjectsLeadsFilter="EmailsActiveProjectsLeadsFilter",k.exchangeRatesAdminGroupName="ExchangeRatesAdminGroupName",k.forcedEmailTrackingGroups="ForcedEmailTrackingGroups",k.ignoreEmailsFromDomainsOnEmailsTracking="IgnoreEmailsFromDomainsOnEmailsTracking",k.trackEmailsFromDomains="TrackEmailsFromDomains",k.groupsForAllUnpaidInvoicesNotification="GroupsForAllUnpaidInvoicesNotification",k.itemPreviewMaxHeight="ItemPreviewMaxHeight",k.lastActivityAttributes="LastActivityAttributes",k.leadsCompletedState="LeadsCompletedState",k.leadDeadlineAlertGroups="LeadDeadlineAlertGroups",k.leadsDeadState="LeadsDeadState",k.marketingCompletedState="MarketingCompletedState",k.marketingDeadState="MarketingDeadState",k.minimumPasswordLength="MinimumPasswordLength",k.nextStepAttributes="NextStepAttributes",k.notifyAboutInvoicedInvoiceInPohodaGroup="NotifyAboutInvoicedInvoiceInPohodaGroup",k.notifyAboutLeadsDeadline="NotifyAboutLeadsDeadline",k.notifyAboutPaidInvoiceInPohodaGroup="NotifyAboutPaidInvoiceInPohodaGroup",k.notifyAboutProjectDeadline="NotifyAboutProjectDeadline",k.numberOfDecimalPlaces="NumberOfDecimalPlaces",k.phoneListTaskSolverGroup="PhoneListTaskSolverGroup",k.projectDeadlineAlert="ProjectDeadlineAlert",k.serverUpdateProgressNotificationGroup="ServerUpdateProgressNotificationGroup",k.sumarizeCartsPricesOnLeads="SumarizeCartsPricesOnLeads",k.sumarizeCartsPricesOnProjects="SumarizeCartsPricesOnProjects",k.sumarizePeopleExpensesOnProjects="SumarizePeopleExpensesOnProjects",k.systemHealthNotificationGroup="SystemHealthNotificationGroup",k.tasksCompletedState="TasksCompletedState",k.tasksDeferredState="TasksDeferredState",k.tasksInProgressState="TasksInProgressState",k.tasksNotStartedState="TasksNotStartedState",k.tasksWaitOnSomeoneElseState="TasksWaitOnSomeoneElseState",k.trackDocumentVersions="TrackDocumentVersions",k.vacationCompletedState="VacationCompletedState",k.workReportApprovedState="WorkReportApprovedState",k.defaultLanguage="DefaultLanguage",k.defaultCurrency="DefaultCurrency",k.myCompanyCountry="MyCompanyCountry",k.myCompanyName="MyCompanyName",k.myCompanyStreet="MyCompanyStreet",k.myCompanyCity="MyCompanyCity",k.myCompanyState="MyCompanyState",k.myCompanyZip="MyCompanyZIP",k.myCompanyId="MyCompanyID",k.myCompanyVat="MyCompanyVAT",k.mergeGoodsInCart="MergeGoodsInCart",k.cartRefreshLogic="CartRefreshLogic",k.goodsDefaultQuantity="GoodsDefaultQuantity",k.goodsDefaultVAT="GoodsDefaultVAT",k.goodsDefaultVATIncluded="GoodsDefaultVATIncluded",k.recalculateOnListPriceChange="RecalculateOnListPriceChange",k.recalculateOnPurchasePriceChange="RecalculateOnPurchasePriceChange";class b{}b.ServerCommon={Server_ID:"Server_ID",Server_ItemCreated:"Server_ItemCreated",Server_ItemChanged:"Server_ItemChanged"},b.Common={CreatedByGUID:"CreatedByGUID",CurrencyEn:"CurrencyEn",DefaultCurrencySuffix:"DefaultCurrency",FileAs:"FileAs",ItemCreated:"ItemCreated",ItemChanged:"ItemChanged",ItemGUID:"ItemGUID",ItemVersion:"ItemVersion",ModifiedByGUID:"ModifiedByGUID",OwnerGUID:"OwnerGUID",ParentCurrencySuffix:"ParentCurrency"},b.Calendar={Location:"Location",StartDate:"StartDate",EndDate:"EndDate",AllDayEvent:"AllDayEvent",SuperiorItem:"SuperiorItem",BusyStatus:"BusyStatus",GraphID:"GraphID",GraphCalendarID:"GraphCalendarID",Note:"Note"},b.Carts={SuperiorItem:"SuperiorItem",Customer:"Customer",Contact:"Contact",TypeEn:"TypeEn",StateEn:"StateEn",PriceTotal:"PriceTotal",PriceTotalExcludingVAT:"PriceTotalExcludingVAT",ForPayment:"ForPayment",Paid:"Paid",CurrencyEn:"CurrencyEn",EffectiveFrom:"EffectiveFrom",ValidUntil:"ValidUntil",Active:"Active",Note:"Note",ID:"ID",AccountingCaseDate:"AccountingCaseDate",TaxableSupplyDate:"TaxableSupplyDate",PaymentDate:"PaymentDate",VAT:"VAT",GoodsInCartCount:"GoodsInCartCount",PriceTotalDefaultCurrency:"PriceTotalDefaultCurrency",PriceTotalParentCurrency:"PriceTotalParentCurrency",ForPaymentDefaultCurrency:"ForPaymentDefaultCurrency",ForPaymentParentCurrency:"ForPaymentParentCurrency",PaidDefaultCurrency:"PaidDefaultCurrency",PaidParentCurrency:"PaidParentCurrency",PaidChanged:"PaidChanged",PriceTotalChanged:"PriceTotalChanged",PriceTotalExcludingVATDefaultCurrency:"PriceTotalExcludingVATDefaultCurrency",PriceTotalExcludingVATParentCurrency:"PriceTotalExcludingVATParentCurrency",VATDefaultCurrency:"VATDefaultCurrency",VATParentCurrency:"VATParentCurrency",PrevStateEn:"PrevStateEn",PurchaseExpenses:"PurchaseExpenses",PurchaseExpensesDefaultCurrency:"PurchaseExpensesDefaultCurrency",PurchaseExpensesParentCurrency:"PurchaseExpensesParentCurrency",PurchaseExpensesChanged:"PurchaseExpensesChanged",Profit:"Profit",ProfitDefaultCurrency:"ProfitDefaultCurrency",ProfitParentCurrency:"ProfitParentCurrency",ProfitChanged:"ProfitChanged"},b.Companies={ID:"ID",CompanyName:"CompanyName",Department:"Department",AccountNumber:"AccountNumber",IdentificationNumber:"IdentificationNumber",VatNumber:"VatNumber",Sales:"Reversal",EmployeesCount:"EmployeesCount",Purchaser:"Purchaser",Suppliers:"Suppliers",Competitor:"Competitor",Address1Street:"Address1Street",Address1City:"Address1City",Address1PostalCode:"Address1PostalCode",Address1CountryEn:"Address1CountryEn",Address1State:"Address1State",Address1POBox:"Address1POBox",Address2Street:"Address2Street",Address2City:"Address2City",Address2PostalCode:"Address2PostalCode",Address2CountryEn:"Address2CountryEn",Address2State:"Address2State",Address2POBox:"Address2POBox",Address3Street:"Address3Street",Address3City:"Address3City",Address3PostalCode:"Address3PostalCode",Address3CountryEn:"Address3CountryEn",Address3State:"Address3State",Address3POBox:"Address3POBox",InvoiceAddress:"InvoiceAddress",PostalAddress:"PostalAddress",Phone:"Phone",Mobile:"Mobile",Fax:"Fax",WebPage:"WebPage",TrackedDomains:"TrackedDomains",Email:"Email",ICQ:"ICQ",MSN:"MSN",Skype:"Skype",ImportanceEn:"ImportanceEn",FirstContactEn:"FirstContactEn",LineOfBusiness:"LineOfBusiness",EmailOptOut:"EmailOptOut",MailingListOther:"MailingListOther",MailingListOtherValue:"MailingListOtherValue",Note:"Note",IsPrivate:"IsPrivate",NextStep:"NextStep",LastActivity:"LastActivity",AdditionalDiscount:"AdditionalDiscount"},b.Contacts={ProfilePicture:"ProfilePicture",Title:"Title",Email1Address:"Email1Address",Email2Address:"Email2Address",Email3Address:"Email3Address",DoNotSendNewsletter:"DoNotSendNewsletter",ImportanceEn:"ImportanceEn",PrefixEn:"PrefixEn",FirstName:"FirstName",MiddleName:"MiddleName",LastName:"LastName",SuffixEn:"SuffixEn",BusinessAddressStreet:"BusinessAddressStreet",BusinessAddressCity:"BusinessAddressCity",BusinessAddressPostalCode:"BusinessAddressPostalCode",BusinessAddressCountryEn:"BusinessAddressCountryEn",BusinessAddressState:"BusinessAddressState",BusinessAddressPoBox:"BusinessAddressPOBox",HomeAddressStreet:"HomeAddressStreet",HomeAddressCity:"HomeAddressCity",HomeAddressPostalCode:"HomeAddressPostalCode",HomeAddressCountryEn:"HomeAddressCountryEn",HomeAddressState:"HomeAddressState",HomeAddressPOBox:"HomeAddressPOBox",OtherAddressStreet:"OtherAddressStreet",OtherAddressCity:"OtherAddressCity",OtherAddressPostalCode:"OtherAddressPostalCode",OtherAddressCountryEn:"OtherAddressCountryEn",OtherAddressState:"OtherAddressState",OtherAddressPOBox:"OtherAddressPOBox",BusinessPhoneNumber:"TelephoneNumber1",BusinessPhoneNumber2:"TelephoneNumber5",BusinessFaxNumber:"TelephoneNumber6",MobilePhoneNumber:"TelephoneNumber3",HomePhoneNumber:"TelephoneNumber2",OtherPhoneNumber:"TelephoneNumber4",ICQ:"ICQ",MSN:"MSN",Skype:"Skype",WebPage:"WebPage",Note:"Note",Department:"Department",Company:"Company",IsPrivate:"Private",NextStep:"NextStep",LastActivity:"LastActivity"},b.Leads={ID:"ID",FileAs:"FileAs",HumanID:"HID",Customer:"Customer",ContactPerson:"ContactPerson",Marketing:"Marketing",ReceiveDate:"ReceiveDate",Email:"Email",Phone:"Phone",Street:"Street",State:"State",CountryEn:"CountryEn",City:"City",POBox:"POBox",Zip:"Zip",Price:"Price",PriceChanged:"PriceChanged",CurrencyEn:b.Common.CurrencyEn,EstimatedEnd:"EstimatedEnd",Probability:"Probability",LeadOriginEn:"LeadOriginEn",PriceDefaultCurrency:"PriceDefaultCurrency",EstimatedValue:"EstimatedValue",EstimatedValueDefaultCurrency:"EstimatedValueDefaultCurrency",Note:"Note",TypeEn:"TypeEn",StateEn:"StateEn",PrevStateEn:"PrevStateEn",IsPrivate:"Private",EmailOptOut:"EmailOptOut",NextStep:"NextStep",LastActivity:"LastActivity",ItemVersion:"ItemVersion",EstimatedRevenue:"EstimatedRevenue",EstimatedRevenueDefaultCurrency:"EstimatedRevenueDefaultCurrency",CompletedDate:"CompletedDate",LostDate:"LostDate"},b.Documents={FileAs:"FileAs",DocName:"DocName",Preview:"Preview",PreviewWidth:"PreviewWidth",PreviewHeight:"PreviewHeight",DocTypeEn:"DocTypeEn",StateEn:"StateEn",ImportanceEn:"ImportanceEn",SuperiorItem:"SuperiorItem",SuperiorCompany:"Company",SuperiorContact:"Contact",DocSize:"DocSize",Extension:"Extension",CreationTime:"CreationTime",LastWriteTime:"LastWriteTime",IsPrivate:"Private",Note:"Note",ExternalUrl:"ExternalUrl"},b.Emails={To:"To",From:"SenderEmailAddress",Cc:"Cc",Subject:"Subject",ImportanceEn:"ImportanceEn",SuperiorItem:"SuperiorItem",SentOn:"SentOn",ReceivedTime:"ReceivedTime",FileSize:"FileSize",AttachmentsCount:"AttachmentsCount",Note:"Note",SentimentTone:"SentimentTone",Summary:"Summary"},b.GoodsBase={Code:"Code",Structure:"Structure",Note:"Note",Description:"Description",TypeEn:"TypeEn",SaleCurrencyEn:"SaleCurrencyEn",PurchaseCurrencyEn:"PurchaseCurrencyEn",UnitEn:"UnitEn",PurchasePrice:"PurchasePrice",PurchasePriceDefaultCurrency:"PurchasePriceDefaultCurrency",PurchasePriceChanged:"PurchasePriceChanged",SalePrice:"SalePrice",SalePriceDefaultCurrency:"SalePriceDefaultCurrency",SalePriceChanged:"SalePriceChanged",IsPriceSum:"IsPriceSum",VATRate:"VATRate",VATIncluded:"VATIncluded",Picture:"Picture",PictureHeight:"PictureHeight",PictureWidth:"PictureWidth",Margin:"Margin",Markup:"Markup"},b.Goods=Object.assign(Object.assign({},b.GoodsBase),{PriceListGroupGUID:"PriceListGroupGUID",InventoryQuantity:"InventoryQuantity"}),b.GoodsInCart=Object.assign(Object.assign({},b.GoodsBase),{Cart:"Cart",GoodsInfo:"GoodsInfo",SuperiorItem:"SuperiorItem",Quantity:"Quantity",PriceTotal:"PriceTotal",PriceTotalDefaultCurrency:"PriceTotalDefaultCurrency",PriceTotalParentCurrency:"PriceTotalParentCurrency",PriceTotalChanged:"PriceTotalChanged",PriceTotalExcludingVAT:"PriceTotalExcludingVAT",PriceTotalExcludingVATDefaultCurrency:"PriceTotalExcludingVATDefaultCurrency",PriceTotalExcludingVATParentCurrency:"PriceTotalExcludingVATParentCurrency",VATTotal:"VATTotal",VATTotalDefaultCurrency:"VATTotalDefaultCurrency",VATTotalParentCurrency:"VATTotalParentCurrency",SalePriceExcludingVAT:"SalePriceExcludingVAT",SalePriceExcludingVATDefaultCurrency:"SalePriceExcludingVATDefaultCurrency",SalePriceExcludingVATParentCurrency:"SalePriceExcludingVATParentCurrency",VAT:"VAT",VATDefaultCurrency:"VATDefaultCurrency",VATParentCurrency:"VATParentCurrency",PurchasePriceParentCurrency:"PurchasePriceParentCurrency",SalePriceParentCurrency:"SalePriceParentCurrency",ListPrice:"ListPrice",ListPriceDefaultCurrency:"ListPriceDefaultCurrency",ListPriceParentCurrency:"ListPriceParentCurrency",ListPriceChanged:"ListPriceChanged",Discount:"Discount",HierarchyInSet:"HierarchyInSet",IsFromSet:"IsFromSet",ParentGUID:"ParentGUID",Rank:"Rank",IncludeInCartPrice:"IncludeInCartPrice",ListPriceCustomized:"ListPriceCustomized",ChildItemsCount:"ChildItemsCount",JoinedToGUID:"JoinedToGUID",PurchasePriceTotal:"PurchasePriceTotal",PurchasePriceTotalDefaultCurrency:"PurchasePriceTotalDefaultCurrency",PurchasePriceTotalParentCurrency:"PurchasePriceTotalParentCurrency",PurchasePriceTotalChanged:"PurchasePriceTotalChanged"}),b.Journal={FileAs:"FileAs",Subject:"Subject",TypeEn:"TypeEn",StateEn:"StateEn",ImportanceEn:"ImportanceEn",EventStart:"EventStart",EventEnd:"EventEnd",SuperiorItem:"SuperiorItem",Company:"Company",Contact:"Contact",Marketing:"Marketing",IsSystem:"System",IsPrivate:"Private",Note:"Note",Phone:"Phone"},b.Vacation={StartDate:"StartDate",EndDate:"EndDate",User:"User",Duration:"Duration",Place:"Place",Note:"Note",AllDay:"AllDay",TypeEn:"TypeEn",StateEn:"StateEn",IsPrivate:"Private"},b.Marketing={HumanID:"HumanID",EstimatedStart:"EstimatedStart",EstimatedEnd:"EstimatedEnd",RealStart:"RealStart",RealEnd:"RealEnd",TargetGroup:"TargetGroup",EmailsSent:"EmailsSent",EmailsDelivered:"EmailsDelivered",EmailsViewed:"EmailsViewed",PeopleUnsubscribed:"PeopleUnsubscribed",FinalRevenues:"FinalRevenues",TypeEn:"TypeEn",StateEn:"StateEn"},b.Projects={HumanID:"HID",FileAs:"FileAs",ProjectName:"ProjectName",ProjectOriginEn:"ProjectOriginEn",TypeEn:"TypeEn",StateEn:"StateEn",PaymentTypeEn:"PaymentTypeEn",ProjectStart:"ProjectStart",ProjectRealEnd:"ProjectRealEnd",EstimatedEnd:"ProjectEnd",CurrencyEn:b.Common.CurrencyEn,DefaultCurrencyEn:"DefaultCurrencyEn",EstimatedMargin:"EstimatedMargin",EstimatedPeopleExpenses:"EstimatedPeopleExpenses",EstimatedPeopleExpensesDefaultCurrency:"EstimatedPeopleExpensesDefaultCurrency",EstimatedOtherExpenses:"EstimatedOtherExpenses",EstimatedOtherExpensesDefaultCurrency:"EstimatedOtherExpensesDefaultCurrency",EstimatedPrice:"EstimatedPrice",EstimatedPriceDefaultCurrency:"EstimatedPriceDefaultCurrency",EstimatedProfit:"EstimatedProfit",EstimatedProfitDefaultCurrency:"EstimatedProfitDefaultCurrency",EstimatedPriceChanged:"EstimatedPriceChanged",EstimatedPeopleExpensesChanged:"EstimatedPeopleExpensesChanged",EstimatedOtherExpensesChanged:"EstimatedOtherExpensesChanged",Delay:"Delay",EstimatedWorkHours:"EstimatedWorkHours",TotalWorkHours:"TotalWorkHours",PeopleExpenses:"PeopleExpenses",OtherExpenses:"OtherExpenses",PeopleExpensesDefaultCurrency:"PeopleExpensesDefaultCurrency",OtherExpensesDefaultCurrency:"OtherExpensesDefaultCurrency",PeopleExpensesChanged:"PeopleExpensesChanged",OtherExpensesChanged:"OtherExpensesChanged",Price:"Price",PriceDefaultCurrency:"PriceDefaultCurrency",Profit:"Profit",ProfitDefaultCurrency:"ProfitDefaultCurrency",Margin:"Margin",PriceChanged:"PriceChanged",SuperiorProject:"SuperiorProject",Customer:"Customer",ContactPerson:"ContactPerson",Users:"Users",ProjectManager:"ProjectManager",InvoicePaymentDate:"InvoicePaymentDate",PaymentMaturity:"PaymentMaturity",InvoiceIssueDate:"InvoiceIssueDate",LicensesCount:"LicensesCount",LicensePrice:"LicensePrice",LicensePriceDefaultCurrency:"LicensePriceDefaultCurrency",NextStep:"NextStep",LastActivity:"LastActivity",IsPrivate:"Private",LicensePriceChanged:"LicensePriceChanged",Note:"Note",CompletedDate:"CompletedDate",LostDate:"LostDate"},b.Tasks={FileAs:"FileAs",Subject:"Subject",RootItem:"RootItem",SuperiorItem:"SuperiorItem",Company:"Company",Contact:"Contact",StartDate:"StartDate",DueDate:"DueDate",Reminder:"Reminder",ReminderDate:"ReminderDate",ImportanceEn:"ImportanceEn",IsCompleted:"Complete",PercentComplete:"PercentComplete",PercentCompleteDecimal:"PercentCompleteDecimal",CompletedDate:"CompletedDate",Solver:"Solver",Delegator:"Delegator",Level:"Level",IsPrivate:"Private",ActualWorkHours:"ActualWorkHours",TotalWorkHours:"TotalWorkHours",Body:"Body",TypeEn:"TypeEn",StateEn:"StateEn"},b.Training={TitleEn:"TitleEn"},b.WorkReports={Task:"Task",ProjectName:"ProjectName",UserName:"UserName",Subject:"Subject",Date:"Date",FromTime:"FromTime",ToTime:"ToTime",Overtime:"Overtime",Month:"Month",Year:"Year",IsPrivate:"Private",Note:"Note",Duration:"Duration",WorkReportEn:"WorkReportEn",StateEn:"StateEn"},b.Users={ProfilePicture:"ProfilePicture",UserName:"UserName",JobTitle:"JobTitle",IDCardNumber:"IDCardNumber",Birthdate:"Birthdate",BirthPlace:"BirthPlace",PersonalIdentificationNumber:"PersonalIdentificationNumber",Active:"Active",FamilyStatusEn:"FamilyStatusEn",HomeAddressStreet:"HomeAddressStreet",HomeAddressCity:"HomeAddressCity",HomeAddressPostalCode:"HomeAddressPostalCode",HomeAddressCountryEn:"HomeAddressCountryEn",HomeAddressState:"HomeAddressState",HomeAddressPOBox:"HomeAddressPOBox",BankAccount:"BankAccount",BusinessPhoneNumber:"BusinessPhoneNumber",MobilePhoneNumber:"MobilePhoneNumber",Email1Address:"Email1Address",Email2Address:"Email2Address",ICQ:"ICQ",MSN:"MSN",Skype:"Skype",IdentificationNumber:"IdentificationNumber",HealthInsurance:"HealthInsurance",HolidayLength:"HolidayLength",RemainingDaysOfHoliday:"RemainingDaysOfHoliday",SalaryDateEn:"SalaryDateEn",Supervisor:"Supervisor",TravelDistance:"TravelDistance",TimeAccessibility:"TimeAccessibility",TransportMode:"TransportMode",WorkdayStartTime:"WorkdayStartTime",Note:"Note",IsSystem:"IsSystem"},b.Groups={IsAdmin:"IsAdmin",GroupName:"GroupName",FileAs:"FileAs",Description:"Description",IsPM:"IsPM",System:"System",IsRole:"IsRole",IsCategory:"IsCategory",DisallowControlModulePermissions:"DisallowControlModulePermissions",DisallowControlColumnPermissions:"DisallowControlColumnPermissions",IsOutlookCategory:"IsOutlookCategory",DisallowControlUserAssignment:"DisallowControlUserAssignment",ColorEn:"ColorEn",Picture:"Picture"},b.PriceListGroups={Note:"Note"},b.Prices={SalePriceGUID:"SalePriceGUID",GoodsItemGUID:"GoodsItemGUID",Price:"Price",CurrencyEn:"CurrencyEn"},b.SalePrices={Note:"Note",Discount:"Discount",TypeEn:"TypeEn",StateEn:"StateEn",PrevStateEn:"PrevStateEn"},b.XsltTransformations={LangCode:"LangCode",Definition:"Definition",Namespace:"Namespace",ObjectTypeID:"ObjectTypeID",TransformationVersion:"TransformationVersion"},b.XsltTransformationsModels={ObjectTypeID:"ObjectTypeID",TransformationGUID:"TransformationGUID",ItemTypeGUID:"ItemTypeGUID"},b.allTypeEnNames=["TypeEn",b.Documents.DocTypeEn,b.WorkReports.WorkReportEn,"TitleEn"],b.getFolderFileAs=e=>{switch(e){case m.leads:return b.Leads.FileAs;case m.projects:return b.Projects.ProjectName;case m.documents:return b.Documents.DocName;case m.companies:return b.Companies.CompanyName;case m.contacts:case m.users:return b.Common.FileAs;case m.emails:return b.Emails.Subject;case m.journal:return b.Journal.FileAs;case m.tasks:return b.Tasks.Subject;case m.workReports:return b.WorkReports.Subject;case m.vacation:return b.Vacation.TypeEn;case m.carts:case m.goods:case m.goodsInCart:return b.Common.FileAs;case m.groups:return b.Groups.GroupName;case m.xsltTransformations:return b.Common.FileAs;default:return console.warn(`FileAs col name not defined for folderName ${e}`),b.Common.FileAs}};class D{}D.general="GENERAL",D.group="GROUP",D.contactPerson="CONTACTPERSON",D.contact="CONTACT",D.customer="CUSTOMER",D.company="COMPANY",D.outlookProject="OUTLOOKPROJECT",D.supervisor="SUPERVISOR",D.projectOrigin="PROJECT_ORIGIN",D.cart="CART",D.goodsInCart="GOODSINCART",D.superiorItem="SUPERIORITEM",D.taskParent="TASKPARENT";class w{}w.general=1,w.group=2,w.contactPerson=10,w.contact=11,w.customer=12,w.company=13,w.outlookProject=28,w.supervisor=32,w.projectOrigin=25,w.cart=9,w.goodsInCart=15,w.superiorItem=31,w.taskParent=38;class x{}x.all="All",x.own="Own",x.readonly="Readonly",x.invisible="Invisible",x.none="None";class F{}var O,N,R,L;F.mandatory="Mandatory",F.optional="Optional",F.unique="Unique",F.none="None",exports.Edition=void 0,(O=exports.Edition||(exports.Edition={})).Free="Free",O.Basic="Basic",O.Professional="Professional",O.Enterprise="Enterprise",exports.Feature=void 0,(N=exports.Feature||(exports.Feature={})).ContactsAndCompanies="ContactsAndCompanies",N.Sales="Sales",N.Projects="Projects",N.Marketing="Marketing",exports.SentimentTone=void 0,(R=exports.SentimentTone||(exports.SentimentTone={}))[R.Negative=0]="Negative",R[R.Neutral=1]="Neutral",R[R.Positive=2]="Positive";class M{}M.contactsSynchronizationWithOutlook="ContactsSynchronizationWithOutlook",M.wordAddin="WordAddin",M.excelAddin="ExcelAddin",M.tasksRecurrentTasks="TasksRecurrentTasks",M.tasksSubtasks="TasksSubtasks",M.tasksSynchronizationWithOutlook="TasksSynchronizationWithOutlook",M.calendarSynchronizationWithOutlook="CalendarSynchronizationWithOutlook",M.emailsAutomaticTracking="EmailsAutomaticTracking",M.convertEmailToProject="ConvertEmailToProject",M.duplicityChecker="DuplicityChecker",M.nextStepAndLastActivityCustomization="NextStepAndLastActivityCustomization",M.subProjects="SubProjects",M.resourceAndPlanning="ResourceAndPlanning",M.professionalEmailCampaigns="ProfessionalEmailCampaigns",M.professionalEmailCampaignsAdvancedStatistics="ProfessionalEmailCampaignsAdvancedStatistics",M.wordEmailMerge="WordEmailMerge",M.printLabels="PrintLabels",M.printEnvelopes="PrintEnvelopes",M.userViews="UserViews",M.sharedUserViews="SharedUserViews",M.gridConditionalFormating="GridConditionalFormating",M.multipleCurrencies="MultipleCurrencies",M.historyTracking="HistoryTracking",M.privateItems="PrivateItems",M.itemTypes="ItemTypes",M.formLayoutCustomization="FormLayoutCustomization",M.workflowBasicDefinitions="WorkflowBasicDefinitions",M.workflowAdvancedDefinitions="WorkflowAdvancedDefinitions",M.workflowAdvancedDefinitionsRules="WorkflowAdvancedDefinitionsRules",M.workflowAdvancedDefinitionsActions="WorkflowAdvancedDefinitionsActions",M.workflowGroupLevelActions="WorkflowGroupLevelActions",M.customFields="CustomFields",M.importantFields="ImportantFields",M.mandatoryFields="MandatoryFields",M.uniqueFields="UniqueFields",M.readOnlyFields="ReadOnlyFields",M.transformationCustomTemplates="TransformationCustomTemplates",M.userRoles="UserRoles",M.modulePermissions="ModulePermissions",M.columnPermissions="ColumnPermissions",M.api="API",M.gate="Gate",M.threeCXIntegration="ThreeCXIntegration",M.tapiIntegration="TapiIntegration",M.pohodaIntegration="PohodaIntegration",M.pohodaSynchronizationIntervalCustomization="PohodaSynchronizationIntervalCustomization",M.pohodaSynchronizationFieldMappingCustomization="PohodaSynchronizationFieldMappingCustomization",M.quickBooksIntegration="QuickBooksIntegration",M.saveBinaryDataOnDisk="SaveBinaryDataOnDisk",M.activeDirectoryLogin="ActiveDirectoryLogin",M.callerIdentificationOnApple="CallerIdentificationOnApple",M.legacyAdministration="LegacyAdministration";class V{}V.customAdditionalFieldsCount="CustomAdditionalFieldsCount",V.customEnabledAdvancedWorkflowsCount="CustomEnabledAdvancedWorkflowsCount",V.customEnabledBasicWorkflowsCount="CustomEnabledBasicWorkflowsCount",V.customMandatoryFieldsCount="CustomMandatoryFieldsCount",V.customOptionalFieldsCount="CustomOptionalFieldsCount",V.customReadonlyFieldsCount="CustomReadonlyFieldsCount",V.customUniqueFieldsCount="CustomUniqueFieldsCount",V.customVisibleTypesCount="CustomVisibleTypesCount",V.visibleCurrenciesCount="VisibleCurrenciesCount";class U{}U.contactsAutomaticSynchronizationWithOutlook="ContactsAutomaticSynchronizationWithOutlook",U.contactsSynchronizationWithOutlook="ContactsSynchronizationWithOutlook",U.contactsSynchronizationWithAndroid="ContactsSynchronizationWithAndroid",U.documentsRevisions="DocumentsRevisions",U.wordAddin="WordAddin",U.excelAddin="ExcelAddin",U.tasksReminders="TasksReminders",U.tasksRecurrentTasks="TasksRecurrentTasks",U.tasksSubtasks="TasksSubtasks",U.tasksSynchronizationWithOutlook="TasksSynchronizationWithOutlook",U.calendarSynchronizationWithOutlook="CalendarSynchronizationWithOutlook",U.emailsManualTracking="EmailsManualTracking",U.emailsAutomaticTracking="EmailsAutomaticTracking",U.emailSummaryAndSentimentToneFromAi="EmailSummaryAndSentimentToneFromAi",U.convertEmailToContact="ConvertEmailToContact",U.convertEmailToDeal="ConvertEmailToDeal",U.convertEmailToProject="ConvertEmailToProject",U.convertEmailToTask="ConvertEmailToTask",U.convertFromSuggestedContact="ConvertFromSuggestedContact",U.gravatarIntegration="GravatarIntegration",U.logoboxIntegration="LogoboxIntegration",U.companiesBussinesRegisterApiIntegration="CompaniesBussinesRegisterApiIntegration",U.duplicityChecker="DuplicityChecker",U.nextStepAndLastActivityCustomization="NextStepAndLastActivityCustomization",U.subProjects="SubProjects",U.resourceAndPlanning="ResourceAndPlanning",U.professionalEmailCampaigns="ProfessionalEmailCampaigns",U.professionalEmailCampaignsAdvancedStatistics="ProfessionalEmailCampaignsAdvancedStatistics",U.wordEmailMerge="WordEmailMerge",U.printLabels="PrintLabels",U.printEnvelopes="PrintEnvelopes",U.userViews="UserViews",U.sharedUserViews="SharedUserViews",U.gridRowSummary="GridRowSummary",U.gridConditionalFormating="GridConditionalFormating",U.multipleCurrencies="MultipleCurrencies",U.historyTracking="HistoryTracking",U.privateItems="PrivateItems",U.itemTypes="ItemTypes",U.formLayoutCustomization="FormLayoutCustomization",U.workflowBasicDefinitions="WorkflowBasicDefinitions",U.workflowAdvancedDefinitions="WorkflowAdvancedDefinitions",U.workflowAdvancedDefinitionsRules="WorkflowAdvancedDefinitionsRules",U.workflowAdvancedDefinitionsActions="WorkflowAdvancedDefinitionsActions",U.workflowGroupLevelActions="WorkflowGroupLevelActions",U.customFields="CustomFields",U.importantFields="ImportantFields",U.mandatoryFields="MandatoryFields",U.uniqueFields="UniqueFields",U.readOnlyFields="ReadOnlyFields",U.transformationCustomTemplates="TransformationCustomTemplates",U.userRoles="UserRoles",U.modulePermissions="ModulePermissions",U.columnPermissions="ColumnPermissions",U.commonDataAPI="CommonDataAPI",U.eWayCrmAPI="eWayCrmAPI",U.threeCXIntegration="ThreeCXIntegration",U.tapiIntegration="TapiIntegration",U.pohodaIntegration="PohodaIntegration",U.pohodaSynchronizationIntervalCustomization="PohodaSynchronizationIntervalCustomization",U.pohodaSynchronizationFieldMappingCustomization="PohodaSynchronizationFieldMappingCustomization",U.quickBooksIntegration="QuickBooksIntegration",U.shareByTeams="ShareByTeams",U.convertEmailToContactWithDataFromAi="ConvertEmailToContactWithDataFromAi",U.convertEmailToDealWithDataFromAi="ConvertEmailToDealWithDataFromAi",U.convertEmailToProjectWithDataFromAi="ConvertEmailToProjectWithDataFromAi",U.xsltTransformationsAdministrationForCaCAndRest="XsltTransformationsAdministrationForCaCAndRest",U.xsltTransformationsAdministrationForSales="XsltTransformationsAdministrationForSales",U.xsltTransformationsAdministrationForProjects="XsltTransformationsAdministrationForProjects",U.xsltTransformationsAdministrationForMarketing="XsltTransformationsAdministrationForMarketing",function(e){e.UnpaidImportantInvoices="UnpaidImportantInvoices",e.UncollectableSubscriptionPayment="UncollectableSubscriptionPayment",e.UncollectableSubscriptionPaymentWithExpiredCard="UncollectableSubscriptionPaymentWithExpiredCard",e.StandardSubscriptionPeriod="StandardSubscriptionPeriod"}(L||(L={}));var _,G=L;!function(e){e.License="License",e.CloudLicense="CloudLicense",e.MiscLicense="MiscLicense",e.Support="Support",e.Service="Service"}(_||(_={}));var j=_;class B{}B.getIsDebug=e=>{var t;return!!(null===(t=null==e?void 0:e.sessionHandler.lastSuccessfulLoginResponse)||void 0===t?void 0:t.Debug)},B.supportsFeaturesOf=(e,t)=>{var r;const n=null===(r=e.sessionHandler.lastSuccessfulLoginResponse)||void 0===r?void 0:r.WcfVersion;return!!n&&B.supportsVersionFeaturesOf(n,t)},B.supportsVersionFeaturesOf=(e,t)=>n.compare(e,t,">=")||n.compare(e,"1.0.0.0","=");class W{}W.textBox="TextBox",W.comboBox="ComboBox",W.numericBox="NumericBox",W.relation="Relation",W.checkBox="CheckBox",W.linkTextBox="LinkTextBox",W.dateEdit="DateEdit",W.memoBox="MemoBox",W.multiSelectComboBox="MultiSelectComboBox",W.workflowState="WorkflowState",W.image="Image",W.multiSelectRelation="MultiSelectRelation";const H={[m.relations]:0,[m.unifiedRelations]:1,[m.users]:2,[m.groups]:3,[m.enumTypes]:4,[m.enumValues]:5,[m.additionalFields]:6};var z,Q,$,q;exports.Version=void 0,(z=exports.Version||(exports.Version={})).Version75="7.5",z.Version76="7.6",z.Version77="7.7",z.Version80="8.0",z.Version81="8.1",z.Version82="8.2",z.Version83="8.3",z.Version90="9.0",z.Version91="9.1",z.Version92="9.2",z.Version93="9.3",z.Version94="9.4";class J extends B{}J.is75OrLater=e=>B.supportsFeaturesOf(e,exports.Version.Version75),J.is76OrLater=e=>J.supportsFeaturesOf(e,exports.Version.Version76),J.is77OrLater=e=>J.supportsFeaturesOf(e,exports.Version.Version77),J.is80OrLater=e=>J.supportsFeaturesOf(e,exports.Version.Version80),J.is81OrLater=e=>J.supportsFeaturesOf(e,exports.Version.Version81),J.is82OrLater=e=>J.supportsFeaturesOf(e,exports.Version.Version82),J.is83OrLater=e=>J.supportsFeaturesOf(e,exports.Version.Version83),J.is90OrLater=e=>J.supportsFeaturesOf(e,exports.Version.Version90),J.is91OrLater=e=>J.supportsFeaturesOf(e,exports.Version.Version91),J.is92OrLater=e=>J.supportsFeaturesOf(e,exports.Version.Version92),J.is93OrLater=e=>J.supportsFeaturesOf(e,exports.Version.Version93),J.is94OrLater=e=>J.supportsFeaturesOf(e,exports.Version.Version94),J.isFeatureSupported=(e,t)=>J.supportsFeaturesOf(e,t);class X{static mainTable(){return{__type:"MainTable:#EQ"}}static relation(e,t,r){return{__type:"Relation:#EQ",Direction:r,ItemTypes:e,RelationType:t}}static join(e,t,r){const n={__type:"Join:#EQ",ItemType:e,Key:t};return r&&(n.TargetColumnName=r),n}static hubRelation(e){const{isToParentDirection:t,childrenFolderNames:r}=e,n={__type:"HubRelation:#EQ"};return void 0!==typeof t&&(n.IsToParentDirection=t),r&&(n.ChildrenFolderNames=r),n}}class K{static createHubItemsCountsQuery(e,t,r,n){return{__type:"HubItemsCountsQuery:#EQ",ParentItemGuids:e,ItemTypes:t,ExcludeSystemItems:r,SplitDate:n}}static createRelatedTableQuery(e,t,r){return{__type:r?"RelatedTableQuery:#EQ":"TypelessRelatedTableQuery:#EQ",BaseItemID:e,ItemTypes:Array.isArray(t)?t:[t],RelationType:r}}static createMainTableQuery(e){return{__type:"MainTableQuery:#EQ",ItemTypes:Array.isArray(e)?e:[e]}}}K.column=e=>({__type:"Column:#EQ",Source:X.mainTable(),Name:e}),K.multiSelectComboColumnLegacy=(e,t,r)=>({__type:"Column:#EQ",Source:X.mainTable(),Name:"ItemGUID",Transformation:`[dbo].[GetConcatenatedEnumValuesRelationsValues]({0}, '${e}', '${t}')`,Alias:null!=r?r:e}),K.multiSelectComboColumn=(e,t,r,n,o)=>{if(!J.is77OrLater(e))return K.multiSelectComboColumnLegacy(r,n,o);return{__type:"Column:#EQ",Source:X.mainTable(),Name:"ItemGUID",Transformation:`[dbo].[GetConcatenatedEnumValuesRelationsValues_WithObjectTypeID]({0}, dbo.GetObjectTypeID('${t}'), '${r}', '${n}')`,Alias:null!=o?o:r}},K.joinColumn=(e,t,r,n,o)=>K.joinColumnFromKey(e,K.column(t),r,n,o),K.joinColumnFromKey=(e,t,r,n,o)=>{const s={__type:"Column:#EQ",Source:X.join(e,t,o),Name:r};return n&&(s.Alias=n),s},K.singleVariatedColumn=(e,t,r)=>K.variatedColumn([K.columnVariation(e,t)],r),K.variatedColumn=(e,t)=>{const r={__type:"VariatedColumn:#EQ",Source:X.mainTable(),Variations:e};return t&&(r.Alias=t),r},K.columnVariation=(e,t,r)=>{const n={FolderName:t,Field:{__type:"Column:#EQ",Source:X.mainTable(),Name:e}};return r&&(n.Field.Transformation=r),n},K.joinColumnVariation=(e,t,r,n)=>({FolderName:e,Field:{__type:"Column:#EQ",Source:X.join(t,K.column(r)),Name:n}}),K.relationColumnVariation=(e,t,r,n)=>({FolderName:e,Field:{__type:"Column:#EQ",Source:X.relation(r,t,1),Name:n}}),K.relatedColumn=(e,t,r,n)=>{const o={__type:"Column:#EQ",Source:X.relation(t,e,1),Name:r};return n&&(o.Alias=n),o},K.relatedSubstituableColumn=(e,t,r,n,o)=>{const s={__type:"SubstituableColumn:#EQ",Source:X.relation(t,e,1),Name:r,Substitute:n};return o&&(s.Alias=o),s},K.relatedColumnFolderNameToken=(e,t,r)=>({__type:"Token:#EQ",Source:X.relation(t,e,1),TypeName:"ItemType",Alias:r}),K.hubRelationColumn=(e,t)=>({__type:"Column:#EQ",Source:X.hubRelation(t),Name:e}),K.aggregateColumn=(e,t,r)=>({__type:"AggregateColumn:#EQ",FunctionName:e,Source:t.Source,AggregatedField:t,Alias:r}),K.folderNameToken=e=>({__type:"Token:#EQ",Source:X.mainTable(),TypeName:"ItemType",Alias:null!=e?e:"FolderName"}),K.equalsFilterExpression=(e,t)=>({__type:"EqualsFilterExpressionPredicate:#EQ",Field:e,Value:t}),K.notEqualsExpression=(e,t)=>({__type:"NotFilterExpression:#EQ",Child:K.equalsFilterExpression(e,t)}),K.andFilterExpression=e=>({__type:"AndFilterExpressionOperator:#EQ",Children:e}),K.orFilterExpression=e=>({__type:"OrFilterExpressionOperator:#EQ",Children:e}),K.lessFilterExpression=(e,t)=>({__type:"LessFilterExpressionPredicate:#EQ",Field:e,Value:t}),K.lessOrEqualFilterExpression=(e,t)=>({__type:"LessOrEqualFilterExpressionPredicate:#EQ",Field:e,Value:t}),K.greaterFilterExpression=(e,t)=>({__type:"GreaterFilterExpressionPredicate:#EQ",Field:e,Value:t}),K.greaterOrEqualFilterExpression=(e,t)=>({__type:"GreaterOrEqualFilterExpressionPredicate:#EQ",Field:e,Value:t}),K.likeFilterExpression=(e,t)=>({__type:"LikeFilterExpressionPredicate:#EQ",Field:e,Value:`%${t}%`}),K.inFilterExpression=(e,t)=>({__type:"InFilterExpressionPredicate:#EQ",Field:e,Value:t}),K.relatedToExpression=(e,t)=>({__type:"RelatedToFilterExpressionPredicate:#EQ",Value:e,RelationType:t}),K.isNullOrEmptyFilterExpression=e=>K.orFilterExpression([K.equalsFilterExpression(K.column(e),null),K.equalsFilterExpression(K.column(e),"")]);class Y{static toRfc3339String(e){const t=e=>e<10?`0${e}`:String(e);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}:${t(e.getSeconds())}${(e=>{if(0===e)return"Z";const r=e>0?"-":"+";return e=Math.abs(e),`${r}${t(Math.floor(e/60))}:${t(e%60)}`})(e.getTimezoneOffset())}`}}function Z(e,t,r,n){return new(r||(r=Promise))(function(o,s){function i(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(i,a)}l((n=n.apply(e,t||[])).next())})}Y.isValid=e=>e instanceof Date&&!isNaN(e.getTime()),Y.areDaysEqual=(e,t)=>{const r=Y.clearTime(e),n=Y.clearTime(t);return r.getTime()===n.getTime()},Y.areTimesEqual=(e,t)=>e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes(),Y.areDatesEqual=(e,t)=>!!e&&!!t&&Y.areDaysEqual(e,t)&&Y.areTimesEqual(e,t),Y.clearTime=e=>{const t=new Date(e);return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t},Y.isWithoutTime=e=>0===e.getHours()&&0===e.getMinutes()&&0===e.getSeconds(),Y.getFormattedSqlDateTime=e=>e.toISOString().slice(0,19).replace("T"," "),Y.getRfcWithoutTimezone=e=>e.slice(0,19),exports.TransformItemFormats=void 0,(Q=exports.TransformItemFormats||(exports.TransformItemFormats={})).OpenXmlDocx="OpenXmlDocx",Q.Pdf="Pdf",Q.WordMlXml="WordMlXml","function"==typeof SuppressedError&&SuppressedError;exports.EnumTypeEditMode=void 0,($=exports.EnumTypeEditMode||(exports.EnumTypeEditMode={})).Readonly="Readonly",$.VisibleRankDefaultOnly="VisibleRankDefaultOnly",$.Editable="Editable",exports.ImportResult=void 0,(q=exports.ImportResult||(exports.ImportResult={})).Success="Success",q.Failure="Failed",q.FailureDuplicityFound="Failed_DuplicityFound",q.FailureItemAlreadyRemoved="Failed_ItemAlreadyRemoved",q.FailureColumnsLockedWFAction="Failed_ColumnsLocked",q.FailureItemLockedWFAction="Failed_ItemLocked",q.FailureLicenseLimitReached="Failed_LicenseLimitReached",q.FailureInssuficientModulePermission="Failed_InsufficientModulePermission",q.FailureInssuficientColumnsPermission="Failed_InsufficientColumnsPermission",c.polyfill(),exports.ApiConnectionAsNonDefaultExport=I,exports.ApiFetchClient=class{constructor(e,t,r,n){let o;if(this.sessionId=null,this.isAdmin=null,this.loginResponse=null,!(r||(o=C.decodeAccessToken(t),r=o.ws)))throw new Error("Failed to get web service URL from JWT");if(!(n||(o||(o=C.decodeAccessToken(t)),n=o.username)))throw new Error("Failed to get username from JWT");this.appName=e,this.wsUrl=r,this.userName=n,this.endpoint=r.startsWith("http://")?"InsecureAPI.svc":"API.svc",this.accessToken=t}hasAdminRights(){return this.isAdmin}getWsUrl(){return this.wsUrl}getUserName(){return this.userName}getOutlookClientVersion(){var e;return null===(e=this.loginResponse)||void 0===e?void 0:e.OutlookClientVersion}getWebServiceVersion(){var e;return null===(e=this.loginResponse)||void 0===e?void 0:e.WcfVersion}login(){return Z(this,void 0,void 0,function*(){const e={userName:this.userName,appVersion:this.appName},t=new Request(`${this.wsUrl}/${this.endpoint}/Login`,{method:"POST",headers:{Authorization:`Bearer ${this.accessToken}`,"Content-Type":"application/json"},body:JSON.stringify(e)}),r=yield fetch(t),n=200===r.status?yield r.json():void 0;if(!n||"rcSuccess"!==n.ReturnCode)throw new Error(`Login failed: ${(null==n?void 0:n.Description)||"Unknown error"}`);this.sessionId=null==n?void 0:n.SessionId,this.isAdmin=null==n?void 0:n.IsAdmin,this.loginResponse=n})}logout(){return Z(this,void 0,void 0,function*(){const e=new Request(`${this.wsUrl}/${this.endpoint}/LogOut`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:this.sessionId})}),t=yield fetch(e);if("rcSuccess"!==(yield t.json()).ReturnCode)throw new Error("Failed to logout")})}getObjectTypes(){return Z(this,void 0,void 0,function*(){return(yield this.callMethod("GetObjectTypes",{})).Data})}getLicense(){return Z(this,void 0,void 0,function*(){return(yield this.callMethod("GetLicense",{})).Datum})}getClientVersionId(e){var t;return Z(this,void 0,void 0,function*(){const r={versionName:e};return null===(t=(yield this.callMethod("GetClientVersion",r)).Datum)||void 0===t?void 0:t.Id})}queryAmount(e,t=null){return Z(this,void 0,void 0,function*(){const r={query:{__type:"MainTableQuery:#EQ",ItemTypes:[e],Fields:[{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:"ItemGUID"}]}};return t&&(r.query.Filter=t),this.callMethod("QueryAmount",r)})}query(e,t=null,r=null,n=null){return Z(this,void 0,void 0,function*(){const o={query:{__type:"MainTableQuery:#EQ",ItemTypes:[e],Fields:t,Paging:{Skip:0,Take:500}}};return r&&(o.query.Filter=r),n&&(o.query.Sort=n),this.callMethod("Query",o)})}callMethod(e,t,r="POST"){return Z(this,void 0,void 0,function*(){if(!this.sessionId)throw new Error("Session ID is not set. Please call init() first.");t.sessionId=this.sessionId;const n=new Request(`${this.wsUrl}/${this.endpoint}/${e}`,{method:r,headers:{"Content-Type":"application/json"},body:"POST"===r?JSON.stringify(t):void 0}),o=yield fetch(n);if(!o.ok)throw new Error(`Error calling method ${e}: ${o.statusText}`);const s=200===o.status?yield o.json():void 0;if(!s||"rcSuccess"!==s.ReturnCode)throw new Error(`API call failed (${null==s?void 0:s.ReturnCode}): ${null==s?void 0:s.Description}`);return s})}static getTokenData(e,t,r,n,o){return Z(this,void 0,void 0,function*(){const s=new URLSearchParams;s.append("client_id",n),s.append("client_secret",o),s.append("code",t),s.append("redirect_uri",r),s.append("grant_type","authorization_code");const i=new Request(`${e}/auth/connect/token`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s.toString()}),a=yield fetch(i);if(!a.ok)throw new Error(`Error calling token endpoint: ${a.statusText}`);const l=yield a.json();if(!l||!l.access_token)throw new Error("Failed to get access token");return l})}},exports.ApiMethods=p,exports.ColumnPermissionMandatoryRules=F,exports.ColumnPermissionPermissionRules=x,exports.CommonDataConnection=class{constructor(e,t){this.isCommonDataApiEnabled=(e,t)=>{this.tokenizedConnection.isEnabled(e,t)},this.callCommonDataApi=(e,t,r,n)=>{this.tokenizedConnection.callTokenizedApi(e,t,r,n)},this.tokenizedConnection=new A("ObtainCommonDataApiAccessToken",exports.HttpMethod.get,!1,"InvalidCommonDataToken",v,e,t)}},exports.CustomizationStatsItemKeys=V,exports.DateHelper=Y,exports.EWItem=class{constructor(e,t){if(!e||!t)throw new Error("Both folderName and baseItem has to be defined!");this.folderName=e,this.baseItem=t}getEmailAddress(){switch(this.folderName){case m.contacts:{const e=this.baseItem;return e.Email1Address||e.Email2Address||e.Email3Address}case m.leads:return this.baseItem.Email;case m.companies:return this.baseItem.Email;case m.users:{const e=this.baseItem;return e.Email1Address||e.Email2Address}default:return null}}getInitials(){switch(this.folderName){case m.contacts:{const e=this.baseItem;return this.getInitialsInternal(e.FirstName,e.LastName)}case m.users:{const e=this.baseItem;return this.getInitialsInternal(e.FirstName,e.LastName)}default:return null}}getInitialsInternal(e,t){const r=((null==e?void 0:e.substr(0,1))||"")+((null==t?void 0:t.substr(0,1))||"");return""==r?null:r}getItemPreview(){switch(this.folderName){case m.contacts:{const e=this.baseItem;return e.ProfilePicture?{imageData:e.ProfilePicture,width:e.ProfilePictureWidth||0,height:e.ProfilePictureHeight||0}:null}case m.users:{const e=this.baseItem;return e.ProfilePicture?{imageData:e.ProfilePicture,width:e.ProfilePictureWidth||0,height:e.ProfilePictureHeight||0}:null}default:return null}}},exports.EnumTypes=d,exports.ErrorHelper=E,exports.ExpirationReason=G,exports.FieldNames=b,exports.FieldTypes=W,exports.FolderNames=m,exports.Functionality=M,exports.GlobalSettingsNames=k,exports.HttpRequestError=T,exports.LicenseKeyInvoiceSeverity=j,exports.LicenseRestrictionKeys=U,exports.OAuthHelper=C,exports.OAuthSessionHandler=P,exports.OAuthSessionHandlerBase=g,exports.ObjectTypeIds=H,exports.OpenItemLinkHelper=S,exports.QueryHelper=K,exports.RelationTypeIds=w,exports.RelationTypes=D,exports.ReturnCodes=u,exports.StringHelper=class{static trim(e,t,r=!1){if(null==e)return e;let n=e.trim();return n.length<=t||(n=n.substring(0,t-(r?3:0)),r&&(n+="...")),n}},exports.TokenizedServiceConnection=A,exports.VersionHelper=J,exports.VersionHelperBase=B,exports.default=I;
8
+ */class u{}u.rcSuccess="rcSuccess",u.rcBadSession="rcBadSession",u.rcDuplicateContact="rcDuplicateContact",u.rcWebServiceMoved="rcWebServiceMoved",u.rcAccessDenied="rcAccessDenied",u.rcLoginUserNameChanged="rcLoginUserNameChanged",u.rcLicenseExpired="rcLicenseExpired",exports.HttpMethod=void 0,(a=exports.HttpMethod||(exports.HttpMethod={})).get="get",a.post="post";class d{}d.absence="Absence",d.bonusType="BonusType",d.busyStatus="BusyStatus",d.cartType="CartType",d.companyType="CompanyType",d.contactType="ContactType",d.countryCode="CountryCode",d.currency="Currency",d.customFieldCategory="CustomFieldCategory",d.dayType="DayType",d.documentOfflineState="DocumentOfflineState",d.documentType="DocumentType",d.emailCampaignWorkflowStatus="EmailCampaignWorkflowStatus",d.emailOfflineState="EmailOfflineState",d.emailType="EmailType",d.familyStatus="FamilyStatus",d.firstContact="FirstContact",d.globalSettingsCategory="GlobalSettingsCategory",d.goalType="GoalType",d.groupColor="GroupColor",d.importance="Importance",d.journalType="JournalType",d.knowledgeLevel="KnowledgeLevel",d.knowledgeTitle="KnowledgeTitle",d.knowledgeType="KnowledgeType",d.leadType="LeadType",d.marketingType="MarketingType",d.paymentType="PaymentType",d.prefixType="PrefixType",d.productType="ProductType",d.projectOrigin="ProjectOrigin",d.projectType="ProjectType",d.reportCategory="ReportCategory",d.responseForm="ResponseForm",d.responseType="ResponseType",d.salaryDate="SalaryDate",d.salaryType="SalaryType",d.salePriceType="SalePriceType",d.sentimentTone="SentimentTone",d.suffixType="SuffixType",d.taskImportance="TaskImportance",d.tasksSnoozePeriod="TasksSnoozePeriod",d.taskStatus="TaskStatus",d.taskType="TaskType",d.trainingGrade="TrainingGrade",d.trainingTitle="TrainingTitle",d.translations="Translations",d.units="Units",d.userType="UserType",d.usStatesDistrictsTerritories="USStatesDistrictsTerritories",d.vacationType="VacationType",d.vat="VAT",d.workLoad="WorkLoad",d.workReportType="WorkReportType";class m{}m.isValidFolderName=e=>Object.values(m).includes(e),m.actions="Actions",m.additionalFields="AdditionalFields",m.bonuses="Bonuses",m.calendar="Calendar",m.capacityNotes="CapacityNotes",m.capacityNoteTypes="CapacityNoteTypes",m.carts="Carts",m.columnPermissions="ColumnPermissions",m.companies="Companies",m.contacts="Contacts",m.contactsSuggestions="ContactsSuggestions",m.currencyExchangeRates="CurrencyExchangeRates",m.documents="Documents",m.emails="Emails",m.enumTypes="EnumTypes",m.enumValues="EnumValues",m.enumValuesRelations="EnumValuesRelations",m.features="Features",m.flows="Flows",m.globalSettings="GlobalSettings",m.goals="Goals",m.goods="Goods",m.goodsInCart="GoodsInCart",m.goodsInSet="GoodsInSet",m.groups="Groups",m.history="History",m.holidays="Holidays",m.children="Children",m.individualDiscounts="IndividualDiscounts",m.invoiceItems="InvoiceItems",m.invoices="Invoices",m.itemCopyRelations="ItemCopyRelations",m.journal="Journal",m.knowledge="Knowledge",m.layouts="Layouts",m.layoutsModels="LayoutsModels",m.leads="Leads",m.ledger="Ledger",m.mappings="Mappings",m.marketing="Marketing",m.marketingList="MarketingList",m.marketingListSources="MarketingListSources",m.models="Models",m.modulePermissions="ModulePermissions",m.objectTypesOptions="ObjectTypesOptions",m.payments="Payments",m.priceListGroups="PriceListGroups",m.projectAssignments="ProjectAssignments",m.projectAssignmentsPerUserProject="ProjectAssignmentsPerUserProject",m.projectAssignmentsTotal="ProjectAssignmentsTotal",m.projectAssignmentsTotalUserProject="ProjectAssignmentsTotalUserProject",m.projectList="ProjectList",m.projects="Projects",m.projectUsersInCaPlan="ProjectUsersInCaPlan",m.relationData="RelationData",m.relations="Relations",m.reports="Reports",m.revisionsHistory="RevisionsHistory",m.salaries="Salaries",m.salePrices="SalePrices",m.prices="Prices",m.sqlObjects="SqlObjects",m.tasks="Tasks",m.recurrencePatterns="RecurrencePatterns",m.teamRoles="TeamRoles",m.templates="Templates",m.training="Training",m.unifiedRelations="UnifiedRelations",m.users="Users",m.userSettings="UserSettings",m.vacation="Vacation",m.webAccess2Options="WebAccess2Options",m.webAccessOptions="WebAccessOptions",m.workCommitments="WorkCommitments",m.workflowHistory="WorkflowHistory",m.workReports="WorkReports",m.wrongClientVersions="WrongClientVersions",m.xsltTransformations="XsltTransformations",m.xsltTransformationsModels="XsltTransformationsModels",m.getEnumTypeName=e=>e===m.bonuses?d.bonusType:e===m.carts?d.cartType:e===m.companies?d.companyType:e===m.contacts?d.contactType:e===m.documents?d.documentType:e===m.emails?d.emailType:e===m.goals?d.goalType:e===m.goods?d.productType:e===m.journal?d.journalType:e===m.knowledge?d.knowledgeType:e===m.leads?d.leadType:e===m.marketing?d.marketingType:e===m.projects?d.projectType:e===m.salaries?d.salaryType:e===m.salePrices?d.salePriceType:e===m.tasks?d.taskType:e===m.training?d.trainingTitle:e===m.users?d.userType:e===m.vacation?d.vacationType:e===m.workReports?d.workReportType:null,m.getFolderNameByEnumTypeName=e=>e===d.bonusType?m.bonuses:e===d.cartType?m.carts:e===d.companyType?m.companies:e===d.contactType?m.contacts:e===d.documentType?m.documents:e===d.emailType?m.emails:e===d.goalType?m.goals:e===d.journalType?m.journal:e===d.knowledgeType?m.knowledge:e===d.leadType?m.leads:e===d.marketingType?m.marketing:e===d.productType?m.goods:e===d.projectType?m.projects:e===d.salaryType?m.salaries:e===d.salePriceType?m.salePrices:e===d.taskType?m.tasks:e===d.trainingTitle?m.training:e===d.userType?m.users:e===d.vacationType?m.vacation:e===d.workReportType?m.workReports:null;class p{}p.getAllEmailAttachments="GetAllEmailAttachments",p.getCalendarsByItemGuids="GetCalendarsByItemGuids",p.getEmailAttachment="GetEmailAttachment",p.getItemPreview="GetItemPreview",p.getJournalsByItemGuids="GetJournalsByItemGuids",p.getMarketingCampaignsByItemGuids="GetMarketingCampaignsByItemGuids",p.getMarketingListsRecordsByItemGuids="GetMarketingListsRecordsByItemGuids",p.getRevisionHistoryRecordsByItemGuids="GetRevisionHistoryRecordsByItemGuids",p.getVacationsByItemGuids="GetVacationsByItemGuids",p.getWorkflowHistoryRecordsByItemGuids="GetWorkflowHistoryRecordsByItemGuids",p.getCompanyInformationFromTaxRegister="GetCompanyInformationFromTaxRegister",p.logIn="LogIn",p.logOut="LogOut",p.query="Query",p.queryAmount="QueryAmount",p.getServiceAuthSettings="GetServiceAuthSettings",p.getVersion="GetVersion",p.getBinaryAttachment="GetBinaryAttachment",p.getBinaryAttachmentLatestRevision="GetBinaryAttachmentLatestRevision",p.transformItem="TransformItem",p.canUnlinkItems="CanUnlinkItems",p.unlinkItems="UnlinkItems",p.getGoodsFinalPrices="GetGoodsFinalPrices",p.saveItemCopyRelation="SaveItemCopyRelation",p.getXsltTransormationDefinition="GetXsltTransformationDefinition",p.saveBinaryAttachment="SaveBinaryAttachment",p.saveBinaryXsltTransformation="SaveBinaryXsltTransformation",p.getFolderNameForApiMethod=e=>{switch(e){case m.calendar:return"Calendars";case m.journal:return"Journals";case m.marketing:return"MarketingCampaigns";case m.marketingList:return"MarketingListsRecords";case m.revisionsHistory:return"RevisionHistoryRecords";case m.vacation:return"Vacations";case m.workflowHistory:return"WorkflowHistoryRecords";default:return e}},p.getGetFolderNameByItemGuidsMethodName=e=>`Get${p.getFolderNameForApiMethod(e)}ByItemGuids`,p.getGetFolderNameMethodName=e=>`Get${p.getFolderNameForApiMethod(e)}`,p.getSearchFolderNameMethodName=e=>`Search${p.getFolderNameForApiMethod(e)}`;class h{constructor(e,t,r,n,o,s){if(this.invalidateSessionId=(e,t)=>{t&&t()},this.getSessionId=(e,t)=>{e.callWithoutSession(p.logIn,{userName:this.username,passwordHash:this.passwordHash,appVersion:this.appVersion,clientMachineIdentifier:this.clientMachineIdentifier,clientMachineName:this.clientMachineName,createSessionCookie:e.supportsGetItemPreviewMethod},e=>{this.lastSuccessfulLoginResponse=e;const r=e.SessionId;if(!r){const e=new Error("Successful login but no session came.");if(!this.errorCallback)throw e;return void this.errorCallback(e)}t&&t(r,e)},e=>{const t=new Error("Unable to login. Error response follows.\n"+JSON.stringify(e));if(!this.errorCallback)throw t;this.errorCallback(t)})},!e||!t)throw new Error("Non of the arguments 'username', 'passwordHash' can be empty.");this.username=e,this.passwordHash=t,this.appVersion=r,this.clientMachineIdentifier=n,this.clientMachineName=o,this.errorCallback=s}}class y{constructor(){this.getSessionId=(e,t)=>{throw new Error("With anonymous session handler, use only connection methods without session.")},this.invalidateSessionId=(e,t)=>{throw new Error("With anonymous session handler, use only connection methods without session.")}}}class C{static createAuthorizeUrl(e,t,r,n,o,s,i=!1,a){if(o&&!s||!o&&s)throw new Error("If codeChallenge is defined, codeChallengeMethod must also be defined and vice versa");let l=`https://login.eway-crm.${i?"dev":"com"}?scope=${encodeURIComponent(t.join(" "))}&prompt=login&response_type=code&redirect_uri=${encodeURIComponent(r)}&client_id=${e}`;return n&&(l+=`&state=${encodeURIComponent(n)}`),o&&s&&(l+=`&code_challenge=${encodeURIComponent(o)}&code_challenge_method=${encodeURIComponent(s)}`),a&&(l+=`&url=${encodeURIComponent(a)}`),l}}C.finishAuthorization=(e,t,r,n,o,s,i)=>{const a=new URLSearchParams;a.append("code_verifier",n),a.append("client_id",t),a.append("client_secret",r),a.append("code",o),a.append("redirect_uri",s),a.append("grant_type","authorization_code"),C.callTokenEndpoint(e,a,i)},C.refreshToken=(e,t,r,n,o)=>{const s=new URLSearchParams;s.append("client_id",t),s.append("client_secret",r),s.append("refresh_token",n),s.append("grant_type","refresh_token"),C.callTokenEndpoint(e,s,o)},C.getWebServiceUrl=e=>{const t=e.split(".");if(2!==t.length)throw new Error("Invalid token supplied");return s.decode(t[1])},C.getUserName=e=>C.decodeAccessToken(e).username,C.decodeAccessToken=e=>r(e),C.callTokenEndpoint=(t,r,n)=>{e.post(t+"/auth/connect/token",r,{headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then(e=>{n(e.data)}).catch(e=>{e.response&&400==e.response.status?n(e.response.data):n({error:"Token request failed"})})};class f extends Error{constructor(e,t){super(),this.returnCode=e,this.message=t}}class g{constructor(e,t,r,n,o){if(!e)throw new Error("Non of the arguments 'username', 'clientId', 'clientSecret', 'refreshToken' can be empty.");this.username=e,this.accessToken=t,this.appVersion=r,this.getNewAccessTokenCallback=n,this.errorCallback=o}invalidateSessionId(e,t){t&&t()}getSessionId(e,t){const r={userName:this.username,appVersion:this.appVersion,createSessionCookie:e.supportsGetItemPreviewMethod},n={Authorization:"Bearer "+this.accessToken};e.callWithoutSession(p.logIn,r,e=>{this.lastSuccessfulLoginResponse=e;const r=e.SessionId;if(!r){const e=new Error("Successful login but no session came.");if(!this.errorCallback)throw e;return void this.errorCallback(e)}t&&t(r,e)},e=>{const t=new f(e.ReturnCode,"Unable to login. Error response follows.\n"+JSON.stringify(e));if(!this.errorCallback)throw t;this.errorCallback(t)},n,void 0,r=>{if(401!==(null==r?void 0:r.statusCode)){if(!this.errorCallback)throw r;this.errorCallback(r)}else this.getNewAccessTokenCallback(e,r=>{this.accessToken=r.accessToken,r.error||this.getSessionId(e,t)})})}}class P extends g{constructor(e,t,r,n,o,s,i,a){if(!(e&&n&&t&&r))throw new Error("Non of the arguments 'username', 'clientId', 'clientSecret', 'refreshToken' can be empty.");super(e,o,s,(e,t)=>{C.refreshToken(e.wsUrl,this.clientId,this.clientSecret,this.refreshToken,e=>{try{this.refreshTokenCallback&&this.refreshTokenCallback(e)}catch(e){this.errorCallback&&this.errorCallback(new Error("Refresh token callback failed.\n"+JSON.stringify(e)))}void 0!==e.error?t({error:e.error}):t({accessToken:e.access_token})})},i),this.refreshToken=n,this.clientId=t,this.clientSecret=r,this.refreshTokenCallback=a}}class T extends Error{constructor(e,t){super(),this.statusCode=e,this.message=t}}class E{}E.stringifyError=e=>JSON.stringify(e,E.replaceErrors),E.replaceErrors=(e,t)=>{if(t instanceof Error){const e={};return Object.getOwnPropertyNames(t).forEach(r=>{e[r]=t[r]}),e}return t};class S{}S.openItemLinkRegEx=/https:\/\/open\.eway-crm\.(dev|com)\/\?[-a-zA-Z0-9()@:%_\+.~#?&\/=]*/gi,S.itemParamName="l",S.openLinkDomainLength=7,S.getOpenLinkDomain=e=>e?"open.eway-crm.dev":"open.eway-crm.com",S.isOpenItemLinkInText=e=>S.openItemLinkRegEx.test(e),S.getOpenLinksFromString=e=>e.match(S.openItemLinkRegEx),S.getItemLinksFromOpenLinks=e=>{try{return e.map(e=>new URL(e).searchParams.get(S.itemParamName))}catch(e){console.error("Invalid string passed for cretaing url while getting links from open links")}},S.getItemInfoFromLink=e=>{const t=s.decode(e).substring(S.openLinkDomainLength).split("/");if(Object.keys(m).some(e=>m[e]===t[0])&&t[1]){return{folderName:t[0],itemGuid:t[1]}}},S.getAllItemsFromTextWithLinks=e=>{const t={};if(S.isOpenItemLinkInText(e)){const r=S.getOpenLinksFromString(e);if(!r)return;const n=S.getItemLinksFromOpenLinks(r);null==n||n.forEach(e=>{var r;if(!e)return;const n=S.getItemInfoFromLink(e);n&&(t[n.folderName]=t[n.folderName]?[...null!==(r=t[n.folderName])&&void 0!==r?r:[],n.itemGuid]:[n.itemGuid])})}return t};class I{constructor(t,r,n,o){if(this.ensureLogin=()=>new Promise((e,t)=>{if(this.sessionId)e();else{const r=r=>{r&&(this.sessionId=r,e()),t("Session Id cannot be empty")};this.sessionHandler.getSessionId(this,r)}}),this.createOpenLink=(e,t,r,n)=>{const o=s.encode(this.baseUri);let i="eway://"+t;r&&(i+="/"+(null==r?void 0:r.toLowerCase()));const a=S.getOpenLinkDomain(e);i=s.encode(i);let l="https://"+a+"/?ws="+o+`&${S.itemParamName}=`+i;return n&&(l+="&n="+encodeURIComponent(n)),l},this.askCustomUploadMethod=(e,t,r,n,o)=>new Promise((s,i)=>{const a=o?e=>{throw i(e),e}:i;this.callCustomUploadMethod(e,t,r,s,a,a,n)}),this.askUploadMethod=(e,t,r,n,o)=>new Promise((s,i)=>{const a=o?e=>{throw i(e),e}:i;this.callUploadMethod(e,t,r,s,a,a,n)}),this.callCustomUploadMethod=(t,r,n,o,s,i,a)=>{const l=()=>{this.sessionHandler.getSessionId(this,e=>{this.sessionId=e,this.callCustomUploadMethod(t,r,n,o,s,i,a)})},c=this.sessionId;if(!c)return void l();const d=new URLSearchParams(r),m=`${this.svcUri}/${n}?sessionId=${this.sessionId}&${d.toString()}`,p=e.post(m,t,a);I.handleCallPromise(p,o,e=>{if(e.ReturnCode===u.rcBadSession)return this.sessionId=null,void this.sessionHandler.invalidateSessionId(c,l);if(s)s(e);else{const t=new Error("Unhandled connection return code "+e.ReturnCode+": "+e.Description);if(!this.errorCallback)throw t;this.errorCallback(t)}},e=>{let t=new Error("Unhandled connection error when calling "+m+": "+E.stringifyError(e));if("statusCode"in e&&413===e.statusCode&&(t=new Error("The file has exceeded the maximum allowed file size for uploading. You can contact your IT administrator or eWay-CRM support if you would like to increase the limit.")),i)i(t);else{if(!this.errorCallback)throw t;this.errorCallback(t)}})},this.callUploadMethod=(e,t,r,n,o,s,i)=>{this.callCustomUploadMethod(r,{itemGuid:e,fileName:t},p.saveBinaryAttachment,n,o,s,i)},this.askMethod=(e,t,r,n)=>new Promise((o,s)=>{const i=n?e=>{throw s(e),e}:s;this.callMethod(e,t,o,i,r,i)}),this.callMethod=(e,t,r,n,o,s)=>{o||(o=exports.HttpMethod.post);const i=()=>{this.sessionHandler.getSessionId(this,i=>{this.sessionId=i,this.callMethod(e,t,r,n,o,s)})},a=this.sessionId;if(!a)return void i();t.sessionId=a;const l=e!==p.logOut?r:e=>{this.sessionId=null,r(e)};this.callWithoutSession(e,t,l,r=>{if(r.ReturnCode!==u.rcBadSession||(this.sessionId=null,e===p.logOut))if(n)n(r);else{const e=new Error("Unhandled connection return code "+r.ReturnCode+": "+r.Description);if(!this.errorCallback)throw e;this.errorCallback(e,t)}else this.sessionHandler.invalidateSessionId(a,i)},null,o,s)},this.callWithoutSession=(t,r,n,o,s,i,a)=>{var l;i||(i=exports.HttpMethod.post);const c=this.svcUri+"/"+t;let u,d;switch(s&&(u={headers:s,withCredentials:null!==(l=this.supportGetItemPreviewMethod)&&void 0!==l?l:t==p.logIn}),i){case exports.HttpMethod.get:if(r)throw new Error("Calling api get method with data specified does not make any sense.");d=e.get(c,u);break;case exports.HttpMethod.post:d=e.post(c,r,u);break;default:throw new Error(`Unknown http method '${i}'.`)}I.handleCallPromise(d,n,o,e=>{if(a)try{a(e)}catch(e){if(!this.errorCallback)throw e;this.errorCallback(e,r)}else{const t=new Error("Unhandled connection error when calling "+c+": "+E.stringifyError(e));if(!this.errorCallback)throw t;this.errorCallback(t,r)}})},this.getItemPreviewGetMethodUrl=(e,t,r)=>this.svcUri+"/"+p.getItemPreview+"?folderName="+encodeURIComponent(e)+"&itemGuid="+encodeURIComponent(t)+(r||0===r?"&itemVersion="+encodeURIComponent(r.toString()):""),this.getEmailAttachmentGetMethodUrl=(e,t)=>this.svcUri+"/"+p.getEmailAttachment+"?itemGuid="+encodeURIComponent(e)+"&contentId="+encodeURIComponent(t),this.getAllEmailAttachmentsZipGetMethodUrl=e=>this.svcUri+"/"+p.getAllEmailAttachments+"?itemGuid="+encodeURIComponent(e),this.getBinaryAttachmentGetMethodUrl=(e,t)=>"number"==typeof t?this.svcUri+"/"+p.getBinaryAttachment+"?itemGuid="+encodeURIComponent(e)+`&revision=${t}`:this.svcUri+"/"+p.getBinaryAttachmentLatestRevision+"?itemGuid="+encodeURIComponent(e),this.getTransformItemMethodUrl=(e,t,r,n,o)=>`${this.svcUri}/${p.transformItem}?itemGuid=${encodeURIComponent(e)}&itemFolderName=${encodeURIComponent(t)}&transformationGuid=${encodeURIComponent(r)}&outputFormat=${n}${o?`&lang=${encodeURIComponent(o)}`:""}`,this.getXsltTransformationDefinitionMethodUrl=e=>`${this.svcUri}/${p.getXsltTransormationDefinition}?itemGuid=${encodeURIComponent(e)}`,this.getActiveSessionId=()=>this.sessionId,this.setActiveSessionId=e=>{this.sessionId=e},!t)throw new Error("The argument 'apiServiceUri' cannot be empty.");if(t.length<8||"https://"!==t.substr(0,8).toLowerCase()&&"http://"!==t.substr(0,7).toLowerCase())throw new Error("Api service uri must start either with 'https://' or with 'http://'.");if(".svc"===t.substr(t.length-4).toLowerCase()){this.svcUri=t;const e=["/API.svc","/InsecureAPI.svc","/WcfService/Service.svc"].find(e=>e.toLowerCase()===t.substr(t.length-e.length).toLowerCase())||"";this.baseUri=t.substr(0,t.length-e.length)}else this.baseUri=I.normalizeWsUrl(t)||t,"https://"===t.substr(0,8).toLowerCase()?this.svcUri=this.baseUri+"/API.svc":this.svcUri=this.baseUri+"/InsecureAPI.svc";this.sessionHandler=r,this.errorCallback=n,this.sessionId=null,this.supportGetItemPreviewMethod=null!=o&&o}get supportsGetItemPreviewMethod(){return this.supportGetItemPreviewMethod}static create(e,t,r,n,o,s,i,a){return new I(e,new h(t,r,n,o,s,i),i,a)}static createAnonymous(e,t){return new I(e,new y,t)}static createUsingOAuth(e,t,r,n,o,s,i,a,l,c){return new I(e,new P(t,r,n,o,s,i,a,l),a,c)}static normalizeWsUrl(e){return e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),e}static isCloudUrl(e,t){const r=new URL(e),n=new Set;return n.add("hosting.eway-crm.com"),n.add("free.eway-crm.com"),n.add("hosting.eway-crm.us"),n.add("hosting-vh39276.eway-crm.us"),n.add("free.eway-crm.us"),t&&(n.add("free.eway-crm.dev"),n.add("hosting.eway-crm.dev"),n.add("localhost")),n.has(r.host)}get wsUrl(){return this.baseUri}static handleCallPromise(e,t,r,n){e.then(e=>{200===e.status?e.data.ReturnCode===u.rcSuccess?t(e.data):r(e.data):n(new T(e.status,e.statusText))}).catch(e=>{e.response?n(new T(e.response.status,e.response.statusText)):n(e)})}}class A{constructor(e,t,r,n,o,s,i){this.isEnabled=(e,t)=>{const r=()=>{this.url&&this.token?e(this.url,this.token):t()};this.url&&this.token?e(this.url,this.token):this.obtainToken(r)},this.callTokenizedApi=(e,t,r,n)=>{this.isEnabled((o,s)=>{t.token=s,A.call(o,e,t,r,o=>{if(o.ReturnCodeString!==this.invalidTokenReturnCode){if(n)n(o);else if(this.generalErrorCallback){const e=new Error("Unhandled tokenized service connection return code "+o.ReturnCodeString+".\nDescription: "+o.Description);this.generalErrorCallback(e)}}else this.obtainToken(()=>{this.callTokenizedApi(e,t,r,n)})},e=>{if(this.generalErrorCallback){const t=new Error("Unhandled tokenized service connection communication error: "+JSON.stringify(e));this.generalErrorCallback(t)}})},()=>{n&&n(null)})},this.obtainToken=e=>{if(!this.isActive)return this.url=null,this.token=null,void e();const t=t=>{const r=this.urlAndTokenObtainer(t);r.url&&r.token?(this.url=r.url,this.token=r.token,this.isActive=!0,e()):(this.url=null,this.token=null,this.isActive=!1,e())},r=()=>{this.url=null,this.token=null,this.isActive=!1,e()};this.needsSession?this.connection.callMethod(this.obtainTokenMethodName,{},t,r,this.obtainTokenMethodType):this.connection.callWithoutSession(this.obtainTokenMethodName,null,t,r,null,this.obtainTokenMethodType)},this.obtainTokenMethodName=e,this.obtainTokenMethodType=t,this.needsSession=r,this.invalidTokenReturnCode=n,this.urlAndTokenObtainer=o,this.connection=s,this.generalErrorCallback=i||null,this.url=null,this.token=null,this.isActive=!0}static call(t,r,n,o,s,i){const a=t+"/"+r;e.post(a,n).then(e=>{200===e.status?"Success"===e.data.ReturnCodeString?o(e.data):s(e.data):i(new T(e.status,e.statusText))}).catch(e=>{e.response?i(new T(e.response.status,e.response.statusText)):i(e)})}}const v=e=>({url:e.ServiceUrl,token:e.Token});class k{}k.acceptableBackwardWorkReportDays="AcceptableBackwardWorkReportDays",k.adminAppInactiveLogoutTime="AdminAppInactiveLogoutTime",k.allowChangeGoodsInCartListPrice="AllowChangeGoodsInCartListPrice",k.applyGeneralDataProtectionRules="ApplyGeneralDataProtectionRules",k.automaticallyCreateJournalAfterCallDuration="AutomaticallyCreateJournalAfterCallDuration",k.bonusesCompletedState="BonusesCompletedState",k.cartInvoicedState="CartInvoicedState",k.cartOrderCanceledState="CartOrderCanceledState",k.cartOrderInProcessState="CartOrderInProcessState",k.cartOrderProcessedState="CartOrderProcessedState",k.cartPaidState="CartPaidState",k.cartProposalInProcessState="CartProposalInProcessState",k.cartProposalProcessedState="CartProposalProcessedState",k.cartSalesVoucherIssuedState="CartSalesVoucherIssuedState",k.cartToBeInvoicedState="CartToBeInvoicedState",k.cartVoidedState="CartVoidedState",k.clickToCallScheme="ClickToCallScheme",k.companyDuplicityCheckEnabled="CompanyDuplicityCheckEnabled",k.completedStateName="CompletedStateName",k.contactDuplicityCheckEnabled="ContactDuplicityCheckEnabled",k.createCompanyWhileImportingContactFromOutlook="CreateCompanyWhileImportingContactFromOutlook",k.defaultProposalValidityPeriod="DefaultProposalValidityPeriod",k.enableContactsTwoWaySyncWithM365="EnableContactsTwoWaySyncWithM365",k.deadStateName="DeadStateName",k.enableCompaniesSyncIntoMobileDeviceContacts="EnableCompaniesSyncIntoMobileDeviceContacts",k.enableContactsSyncIntoMobileDevice="EnableContactsSyncIntoMobileDevice",k.enableLeadsSyncIntoMobileDeviceContacts="EnableLeadsSyncIntoMobileDeviceContacts",k.enableLlamaAiFeatures="EnableLlamaAiFeatures",k.enableUsersSyncIntoMobileDeviceContacts="EnableUsersSyncIntoMobileDeviceContacts",k.emailsActiveProjectsLeadsFilter="EmailsActiveProjectsLeadsFilter",k.trackToAddressesOnly="TrackToAddressesOnly",k.exchangeRatesAdminGroupName="ExchangeRatesAdminGroupName",k.forcedEmailTrackingGroups="ForcedEmailTrackingGroups",k.ignoreEmailsFromDomainsOnEmailsTracking="IgnoreEmailsFromDomainsOnEmailsTracking",k.trackEmailsFromDomains="TrackEmailsFromDomains",k.groupsForAllUnpaidInvoicesNotification="GroupsForAllUnpaidInvoicesNotification",k.itemPreviewMaxHeight="ItemPreviewMaxHeight",k.lastActivityAttributes="LastActivityAttributes",k.leadsCompletedState="LeadsCompletedState",k.leadDeadlineAlertGroups="LeadDeadlineAlertGroups",k.leadsDeadState="LeadsDeadState",k.marketingCompletedState="MarketingCompletedState",k.marketingDeadState="MarketingDeadState",k.minimumPasswordLength="MinimumPasswordLength",k.nextStepAttributes="NextStepAttributes",k.notifyAboutInvoicedInvoiceInPohodaGroup="NotifyAboutInvoicedInvoiceInPohodaGroup",k.notifyAboutLeadsDeadline="NotifyAboutLeadsDeadline",k.notifyAboutPaidInvoiceInPohodaGroup="NotifyAboutPaidInvoiceInPohodaGroup",k.notifyAboutProjectDeadline="NotifyAboutProjectDeadline",k.numberOfDecimalPlaces="NumberOfDecimalPlaces",k.phoneListTaskSolverGroup="PhoneListTaskSolverGroup",k.projectDeadlineAlert="ProjectDeadlineAlert",k.serverUpdateProgressNotificationGroup="ServerUpdateProgressNotificationGroup",k.sumarizeCartsPricesOnLeads="SumarizeCartsPricesOnLeads",k.sumarizeCartsPricesOnProjects="SumarizeCartsPricesOnProjects",k.sumarizePeopleExpensesOnProjects="SumarizePeopleExpensesOnProjects",k.systemHealthNotificationGroup="SystemHealthNotificationGroup",k.tasksCompletedState="TasksCompletedState",k.tasksDeferredState="TasksDeferredState",k.tasksInProgressState="TasksInProgressState",k.tasksNotStartedState="TasksNotStartedState",k.tasksWaitOnSomeoneElseState="TasksWaitOnSomeoneElseState",k.trackDocumentVersions="TrackDocumentVersions",k.vacationCompletedState="VacationCompletedState",k.workReportApprovedState="WorkReportApprovedState",k.defaultLanguage="DefaultLanguage",k.defaultCurrency="DefaultCurrency",k.myCompanyCountry="MyCompanyCountry",k.myCompanyName="MyCompanyName",k.myCompanyStreet="MyCompanyStreet",k.myCompanyCity="MyCompanyCity",k.myCompanyState="MyCompanyState",k.myCompanyZip="MyCompanyZIP",k.myCompanyId="MyCompanyID",k.myCompanyVat="MyCompanyVAT",k.mergeGoodsInCart="MergeGoodsInCart",k.cartRefreshLogic="CartRefreshLogic",k.goodsDefaultQuantity="GoodsDefaultQuantity",k.goodsDefaultVAT="GoodsDefaultVAT",k.goodsDefaultVATIncluded="GoodsDefaultVATIncluded",k.recalculateOnListPriceChange="RecalculateOnListPriceChange",k.recalculateOnPurchasePriceChange="RecalculateOnPurchasePriceChange";class b{}b.ServerCommon={Server_ID:"Server_ID",Server_ItemCreated:"Server_ItemCreated",Server_ItemChanged:"Server_ItemChanged"},b.Common={CreatedByGUID:"CreatedByGUID",CurrencyEn:"CurrencyEn",DefaultCurrencySuffix:"DefaultCurrency",FileAs:"FileAs",ItemCreated:"ItemCreated",ItemChanged:"ItemChanged",ItemGUID:"ItemGUID",ItemVersion:"ItemVersion",ModifiedByGUID:"ModifiedByGUID",OwnerGUID:"OwnerGUID",ParentCurrencySuffix:"ParentCurrency"},b.Calendar={Location:"Location",StartDate:"StartDate",EndDate:"EndDate",AllDayEvent:"AllDayEvent",SuperiorItem:"SuperiorItem",BusyStatus:"BusyStatus",GraphID:"GraphID",GraphCalendarID:"GraphCalendarID",Note:"Note"},b.Carts={SuperiorItem:"SuperiorItem",Customer:"Customer",Contact:"Contact",TypeEn:"TypeEn",StateEn:"StateEn",PriceTotal:"PriceTotal",PriceTotalExcludingVAT:"PriceTotalExcludingVAT",ForPayment:"ForPayment",Paid:"Paid",CurrencyEn:"CurrencyEn",EffectiveFrom:"EffectiveFrom",ValidUntil:"ValidUntil",Active:"Active",Note:"Note",ID:"ID",AccountingCaseDate:"AccountingCaseDate",TaxableSupplyDate:"TaxableSupplyDate",PaymentDate:"PaymentDate",VAT:"VAT",GoodsInCartCount:"GoodsInCartCount",PriceTotalDefaultCurrency:"PriceTotalDefaultCurrency",PriceTotalParentCurrency:"PriceTotalParentCurrency",ForPaymentDefaultCurrency:"ForPaymentDefaultCurrency",ForPaymentParentCurrency:"ForPaymentParentCurrency",PaidDefaultCurrency:"PaidDefaultCurrency",PaidParentCurrency:"PaidParentCurrency",PaidChanged:"PaidChanged",PriceTotalChanged:"PriceTotalChanged",PriceTotalExcludingVATDefaultCurrency:"PriceTotalExcludingVATDefaultCurrency",PriceTotalExcludingVATParentCurrency:"PriceTotalExcludingVATParentCurrency",VATDefaultCurrency:"VATDefaultCurrency",VATParentCurrency:"VATParentCurrency",PrevStateEn:"PrevStateEn",PurchaseExpenses:"PurchaseExpenses",PurchaseExpensesDefaultCurrency:"PurchaseExpensesDefaultCurrency",PurchaseExpensesParentCurrency:"PurchaseExpensesParentCurrency",PurchaseExpensesChanged:"PurchaseExpensesChanged",Profit:"Profit",ProfitDefaultCurrency:"ProfitDefaultCurrency",ProfitParentCurrency:"ProfitParentCurrency",ProfitChanged:"ProfitChanged"},b.Companies={ID:"ID",CompanyName:"CompanyName",Department:"Department",AccountNumber:"AccountNumber",IdentificationNumber:"IdentificationNumber",VatNumber:"VatNumber",Sales:"Reversal",EmployeesCount:"EmployeesCount",Purchaser:"Purchaser",Suppliers:"Suppliers",Competitor:"Competitor",Address1Street:"Address1Street",Address1City:"Address1City",Address1PostalCode:"Address1PostalCode",Address1CountryEn:"Address1CountryEn",Address1State:"Address1State",Address1POBox:"Address1POBox",Address2Street:"Address2Street",Address2City:"Address2City",Address2PostalCode:"Address2PostalCode",Address2CountryEn:"Address2CountryEn",Address2State:"Address2State",Address2POBox:"Address2POBox",Address3Street:"Address3Street",Address3City:"Address3City",Address3PostalCode:"Address3PostalCode",Address3CountryEn:"Address3CountryEn",Address3State:"Address3State",Address3POBox:"Address3POBox",InvoiceAddress:"InvoiceAddress",PostalAddress:"PostalAddress",Phone:"Phone",Mobile:"Mobile",Fax:"Fax",WebPage:"WebPage",TrackedDomains:"TrackedDomains",Email:"Email",ICQ:"ICQ",MSN:"MSN",Skype:"Skype",ImportanceEn:"ImportanceEn",FirstContactEn:"FirstContactEn",LineOfBusiness:"LineOfBusiness",EmailOptOut:"EmailOptOut",MailingListOther:"MailingListOther",MailingListOtherValue:"MailingListOtherValue",Note:"Note",IsPrivate:"IsPrivate",NextStep:"NextStep",LastActivity:"LastActivity",AdditionalDiscount:"AdditionalDiscount"},b.Contacts={ProfilePicture:"ProfilePicture",Title:"Title",Email1Address:"Email1Address",Email2Address:"Email2Address",Email3Address:"Email3Address",DoNotSendNewsletter:"DoNotSendNewsletter",ImportanceEn:"ImportanceEn",PrefixEn:"PrefixEn",FirstName:"FirstName",MiddleName:"MiddleName",LastName:"LastName",SuffixEn:"SuffixEn",BusinessAddressStreet:"BusinessAddressStreet",BusinessAddressCity:"BusinessAddressCity",BusinessAddressPostalCode:"BusinessAddressPostalCode",BusinessAddressCountryEn:"BusinessAddressCountryEn",BusinessAddressState:"BusinessAddressState",BusinessAddressPoBox:"BusinessAddressPOBox",HomeAddressStreet:"HomeAddressStreet",HomeAddressCity:"HomeAddressCity",HomeAddressPostalCode:"HomeAddressPostalCode",HomeAddressCountryEn:"HomeAddressCountryEn",HomeAddressState:"HomeAddressState",HomeAddressPOBox:"HomeAddressPOBox",OtherAddressStreet:"OtherAddressStreet",OtherAddressCity:"OtherAddressCity",OtherAddressPostalCode:"OtherAddressPostalCode",OtherAddressCountryEn:"OtherAddressCountryEn",OtherAddressState:"OtherAddressState",OtherAddressPOBox:"OtherAddressPOBox",BusinessPhoneNumber:"TelephoneNumber1",BusinessPhoneNumber2:"TelephoneNumber5",BusinessFaxNumber:"TelephoneNumber6",MobilePhoneNumber:"TelephoneNumber3",HomePhoneNumber:"TelephoneNumber2",OtherPhoneNumber:"TelephoneNumber4",ICQ:"ICQ",MSN:"MSN",Skype:"Skype",WebPage:"WebPage",Note:"Note",Department:"Department",Company:"Company",IsPrivate:"Private",NextStep:"NextStep",LastActivity:"LastActivity"},b.Leads={ID:"ID",FileAs:"FileAs",HumanID:"HID",Customer:"Customer",ContactPerson:"ContactPerson",Marketing:"Marketing",ReceiveDate:"ReceiveDate",Email:"Email",Phone:"Phone",Street:"Street",State:"State",CountryEn:"CountryEn",City:"City",POBox:"POBox",Zip:"Zip",Price:"Price",PriceChanged:"PriceChanged",CurrencyEn:b.Common.CurrencyEn,EstimatedEnd:"EstimatedEnd",Probability:"Probability",LeadOriginEn:"LeadOriginEn",PriceDefaultCurrency:"PriceDefaultCurrency",EstimatedValue:"EstimatedValue",EstimatedValueDefaultCurrency:"EstimatedValueDefaultCurrency",Note:"Note",TypeEn:"TypeEn",StateEn:"StateEn",PrevStateEn:"PrevStateEn",IsPrivate:"Private",EmailOptOut:"EmailOptOut",NextStep:"NextStep",LastActivity:"LastActivity",ItemVersion:"ItemVersion",EstimatedRevenue:"EstimatedRevenue",EstimatedRevenueDefaultCurrency:"EstimatedRevenueDefaultCurrency",CompletedDate:"CompletedDate",LostDate:"LostDate"},b.Documents={FileAs:"FileAs",DocName:"DocName",Preview:"Preview",PreviewWidth:"PreviewWidth",PreviewHeight:"PreviewHeight",DocTypeEn:"DocTypeEn",StateEn:"StateEn",ImportanceEn:"ImportanceEn",SuperiorItem:"SuperiorItem",SuperiorCompany:"Company",SuperiorContact:"Contact",DocSize:"DocSize",Extension:"Extension",CreationTime:"CreationTime",LastWriteTime:"LastWriteTime",IsPrivate:"Private",Note:"Note",ExternalUrl:"ExternalUrl"},b.Emails={To:"To",From:"SenderEmailAddress",Cc:"Cc",Subject:"Subject",ImportanceEn:"ImportanceEn",SuperiorItem:"SuperiorItem",SentOn:"SentOn",ReceivedTime:"ReceivedTime",FileSize:"FileSize",AttachmentsCount:"AttachmentsCount",Note:"Note",SentimentTone:"SentimentTone",Summary:"Summary"},b.GoodsBase={Code:"Code",Structure:"Structure",Note:"Note",Description:"Description",TypeEn:"TypeEn",SaleCurrencyEn:"SaleCurrencyEn",PurchaseCurrencyEn:"PurchaseCurrencyEn",UnitEn:"UnitEn",PurchasePrice:"PurchasePrice",PurchasePriceDefaultCurrency:"PurchasePriceDefaultCurrency",PurchasePriceChanged:"PurchasePriceChanged",SalePrice:"SalePrice",SalePriceDefaultCurrency:"SalePriceDefaultCurrency",SalePriceChanged:"SalePriceChanged",IsPriceSum:"IsPriceSum",VATRate:"VATRate",VATIncluded:"VATIncluded",Picture:"Picture",PictureHeight:"PictureHeight",PictureWidth:"PictureWidth",Margin:"Margin",Markup:"Markup"},b.Goods=Object.assign(Object.assign({},b.GoodsBase),{PriceListGroupGUID:"PriceListGroupGUID",InventoryQuantity:"InventoryQuantity"}),b.GoodsInCart=Object.assign(Object.assign({},b.GoodsBase),{Cart:"Cart",GoodsInfo:"GoodsInfo",SuperiorItem:"SuperiorItem",Quantity:"Quantity",PriceTotal:"PriceTotal",PriceTotalDefaultCurrency:"PriceTotalDefaultCurrency",PriceTotalParentCurrency:"PriceTotalParentCurrency",PriceTotalChanged:"PriceTotalChanged",PriceTotalExcludingVAT:"PriceTotalExcludingVAT",PriceTotalExcludingVATDefaultCurrency:"PriceTotalExcludingVATDefaultCurrency",PriceTotalExcludingVATParentCurrency:"PriceTotalExcludingVATParentCurrency",VATTotal:"VATTotal",VATTotalDefaultCurrency:"VATTotalDefaultCurrency",VATTotalParentCurrency:"VATTotalParentCurrency",SalePriceExcludingVAT:"SalePriceExcludingVAT",SalePriceExcludingVATDefaultCurrency:"SalePriceExcludingVATDefaultCurrency",SalePriceExcludingVATParentCurrency:"SalePriceExcludingVATParentCurrency",VAT:"VAT",VATDefaultCurrency:"VATDefaultCurrency",VATParentCurrency:"VATParentCurrency",PurchasePriceParentCurrency:"PurchasePriceParentCurrency",SalePriceParentCurrency:"SalePriceParentCurrency",ListPrice:"ListPrice",ListPriceDefaultCurrency:"ListPriceDefaultCurrency",ListPriceParentCurrency:"ListPriceParentCurrency",ListPriceChanged:"ListPriceChanged",Discount:"Discount",HierarchyInSet:"HierarchyInSet",IsFromSet:"IsFromSet",ParentGUID:"ParentGUID",Rank:"Rank",IncludeInCartPrice:"IncludeInCartPrice",ListPriceCustomized:"ListPriceCustomized",ChildItemsCount:"ChildItemsCount",JoinedToGUID:"JoinedToGUID",PurchasePriceTotal:"PurchasePriceTotal",PurchasePriceTotalDefaultCurrency:"PurchasePriceTotalDefaultCurrency",PurchasePriceTotalParentCurrency:"PurchasePriceTotalParentCurrency",PurchasePriceTotalChanged:"PurchasePriceTotalChanged"}),b.Journal={FileAs:"FileAs",Subject:"Subject",TypeEn:"TypeEn",StateEn:"StateEn",ImportanceEn:"ImportanceEn",EventStart:"EventStart",EventEnd:"EventEnd",SuperiorItem:"SuperiorItem",Company:"Company",Contact:"Contact",Marketing:"Marketing",IsSystem:"System",IsPrivate:"Private",Note:"Note",Phone:"Phone"},b.Vacation={StartDate:"StartDate",EndDate:"EndDate",User:"User",Duration:"Duration",Place:"Place",Note:"Note",AllDay:"AllDay",TypeEn:"TypeEn",StateEn:"StateEn",IsPrivate:"Private"},b.Marketing={HumanID:"HumanID",EstimatedStart:"EstimatedStart",EstimatedEnd:"EstimatedEnd",RealStart:"RealStart",RealEnd:"RealEnd",TargetGroup:"TargetGroup",EmailsSent:"EmailsSent",EmailsDelivered:"EmailsDelivered",EmailsViewed:"EmailsViewed",PeopleUnsubscribed:"PeopleUnsubscribed",FinalRevenues:"FinalRevenues",TypeEn:"TypeEn",StateEn:"StateEn"},b.Projects={HumanID:"HID",FileAs:"FileAs",ProjectName:"ProjectName",ProjectOriginEn:"ProjectOriginEn",TypeEn:"TypeEn",StateEn:"StateEn",PaymentTypeEn:"PaymentTypeEn",ProjectStart:"ProjectStart",ProjectRealEnd:"ProjectRealEnd",EstimatedEnd:"ProjectEnd",CurrencyEn:b.Common.CurrencyEn,DefaultCurrencyEn:"DefaultCurrencyEn",EstimatedMargin:"EstimatedMargin",EstimatedPeopleExpenses:"EstimatedPeopleExpenses",EstimatedPeopleExpensesDefaultCurrency:"EstimatedPeopleExpensesDefaultCurrency",EstimatedOtherExpenses:"EstimatedOtherExpenses",EstimatedOtherExpensesDefaultCurrency:"EstimatedOtherExpensesDefaultCurrency",EstimatedPrice:"EstimatedPrice",EstimatedPriceDefaultCurrency:"EstimatedPriceDefaultCurrency",EstimatedProfit:"EstimatedProfit",EstimatedProfitDefaultCurrency:"EstimatedProfitDefaultCurrency",EstimatedPriceChanged:"EstimatedPriceChanged",EstimatedPeopleExpensesChanged:"EstimatedPeopleExpensesChanged",EstimatedOtherExpensesChanged:"EstimatedOtherExpensesChanged",Delay:"Delay",EstimatedWorkHours:"EstimatedWorkHours",TotalWorkHours:"TotalWorkHours",PeopleExpenses:"PeopleExpenses",OtherExpenses:"OtherExpenses",PeopleExpensesDefaultCurrency:"PeopleExpensesDefaultCurrency",OtherExpensesDefaultCurrency:"OtherExpensesDefaultCurrency",PeopleExpensesChanged:"PeopleExpensesChanged",OtherExpensesChanged:"OtherExpensesChanged",Price:"Price",PriceDefaultCurrency:"PriceDefaultCurrency",Profit:"Profit",ProfitDefaultCurrency:"ProfitDefaultCurrency",Margin:"Margin",PriceChanged:"PriceChanged",SuperiorProject:"SuperiorProject",Customer:"Customer",ContactPerson:"ContactPerson",Users:"Users",ProjectManager:"ProjectManager",InvoicePaymentDate:"InvoicePaymentDate",PaymentMaturity:"PaymentMaturity",InvoiceIssueDate:"InvoiceIssueDate",LicensesCount:"LicensesCount",LicensePrice:"LicensePrice",LicensePriceDefaultCurrency:"LicensePriceDefaultCurrency",NextStep:"NextStep",LastActivity:"LastActivity",IsPrivate:"Private",LicensePriceChanged:"LicensePriceChanged",Note:"Note",CompletedDate:"CompletedDate",LostDate:"LostDate"},b.Tasks={FileAs:"FileAs",Subject:"Subject",RootItem:"RootItem",SuperiorItem:"SuperiorItem",Company:"Company",Contact:"Contact",StartDate:"StartDate",DueDate:"DueDate",Reminder:"Reminder",ReminderDate:"ReminderDate",ImportanceEn:"ImportanceEn",IsCompleted:"Complete",PercentComplete:"PercentComplete",PercentCompleteDecimal:"PercentCompleteDecimal",CompletedDate:"CompletedDate",Solver:"Solver",Delegator:"Delegator",Level:"Level",IsPrivate:"Private",ActualWorkHours:"ActualWorkHours",TotalWorkHours:"TotalWorkHours",Body:"Body",TypeEn:"TypeEn",StateEn:"StateEn"},b.Training={TitleEn:"TitleEn"},b.WorkReports={Task:"Task",ProjectName:"ProjectName",UserName:"UserName",Subject:"Subject",Date:"Date",FromTime:"FromTime",ToTime:"ToTime",Overtime:"Overtime",Month:"Month",Year:"Year",IsPrivate:"Private",Note:"Note",Duration:"Duration",WorkReportEn:"WorkReportEn",StateEn:"StateEn"},b.Users={ProfilePicture:"ProfilePicture",UserName:"UserName",JobTitle:"JobTitle",IDCardNumber:"IDCardNumber",Birthdate:"Birthdate",BirthPlace:"BirthPlace",PersonalIdentificationNumber:"PersonalIdentificationNumber",Active:"Active",FamilyStatusEn:"FamilyStatusEn",HomeAddressStreet:"HomeAddressStreet",HomeAddressCity:"HomeAddressCity",HomeAddressPostalCode:"HomeAddressPostalCode",HomeAddressCountryEn:"HomeAddressCountryEn",HomeAddressState:"HomeAddressState",HomeAddressPOBox:"HomeAddressPOBox",BankAccount:"BankAccount",BusinessPhoneNumber:"BusinessPhoneNumber",MobilePhoneNumber:"MobilePhoneNumber",Email1Address:"Email1Address",Email2Address:"Email2Address",ICQ:"ICQ",MSN:"MSN",Skype:"Skype",IdentificationNumber:"IdentificationNumber",HealthInsurance:"HealthInsurance",HolidayLength:"HolidayLength",RemainingDaysOfHoliday:"RemainingDaysOfHoliday",SalaryDateEn:"SalaryDateEn",Supervisor:"Supervisor",TravelDistance:"TravelDistance",TimeAccessibility:"TimeAccessibility",TransportMode:"TransportMode",WorkdayStartTime:"WorkdayStartTime",Note:"Note",IsSystem:"IsSystem"},b.Groups={IsAdmin:"IsAdmin",GroupName:"GroupName",FileAs:"FileAs",Description:"Description",IsPM:"IsPM",System:"System",IsRole:"IsRole",IsCategory:"IsCategory",DisallowControlModulePermissions:"DisallowControlModulePermissions",DisallowControlColumnPermissions:"DisallowControlColumnPermissions",IsOutlookCategory:"IsOutlookCategory",DisallowControlUserAssignment:"DisallowControlUserAssignment",ColorEn:"ColorEn",Picture:"Picture"},b.PriceListGroups={Note:"Note"},b.Prices={SalePriceGUID:"SalePriceGUID",GoodsItemGUID:"GoodsItemGUID",Price:"Price",CurrencyEn:"CurrencyEn"},b.SalePrices={Note:"Note",Discount:"Discount",TypeEn:"TypeEn",StateEn:"StateEn",PrevStateEn:"PrevStateEn"},b.XsltTransformations={LangCode:"LangCode",Definition:"Definition",Namespace:"Namespace",ObjectTypeID:"ObjectTypeID",TransformationVersion:"TransformationVersion"},b.XsltTransformationsModels={ObjectTypeID:"ObjectTypeID",TransformationGUID:"TransformationGUID",ItemTypeGUID:"ItemTypeGUID"},b.allTypeEnNames=["TypeEn",b.Documents.DocTypeEn,b.WorkReports.WorkReportEn,"TitleEn"],b.getFolderFileAs=e=>{switch(e){case m.leads:return b.Leads.FileAs;case m.projects:return b.Projects.ProjectName;case m.documents:return b.Documents.DocName;case m.companies:return b.Companies.CompanyName;case m.contacts:case m.users:return b.Common.FileAs;case m.emails:return b.Emails.Subject;case m.journal:return b.Journal.FileAs;case m.tasks:return b.Tasks.Subject;case m.workReports:return b.WorkReports.Subject;case m.vacation:return b.Vacation.TypeEn;case m.carts:case m.goods:case m.goodsInCart:return b.Common.FileAs;case m.groups:return b.Groups.GroupName;case m.xsltTransformations:return b.Common.FileAs;default:return console.warn(`FileAs col name not defined for folderName ${e}`),b.Common.FileAs}};class D{}D.general="GENERAL",D.group="GROUP",D.contactPerson="CONTACTPERSON",D.contact="CONTACT",D.customer="CUSTOMER",D.company="COMPANY",D.outlookProject="OUTLOOKPROJECT",D.supervisor="SUPERVISOR",D.projectOrigin="PROJECT_ORIGIN",D.cart="CART",D.goodsInCart="GOODSINCART",D.superiorItem="SUPERIORITEM",D.taskParent="TASKPARENT";class w{}w.general=1,w.group=2,w.contactPerson=10,w.contact=11,w.customer=12,w.company=13,w.outlookProject=28,w.supervisor=32,w.projectOrigin=25,w.cart=9,w.goodsInCart=15,w.superiorItem=31,w.taskParent=38;class x{}x.all="All",x.own="Own",x.readonly="Readonly",x.invisible="Invisible",x.none="None";class F{}var O,N,R,L;F.mandatory="Mandatory",F.optional="Optional",F.unique="Unique",F.none="None",exports.Edition=void 0,(O=exports.Edition||(exports.Edition={})).Free="Free",O.Basic="Basic",O.Professional="Professional",O.Enterprise="Enterprise",exports.Feature=void 0,(N=exports.Feature||(exports.Feature={})).ContactsAndCompanies="ContactsAndCompanies",N.Sales="Sales",N.Projects="Projects",N.Marketing="Marketing",exports.SentimentTone=void 0,(R=exports.SentimentTone||(exports.SentimentTone={}))[R.Negative=0]="Negative",R[R.Neutral=1]="Neutral",R[R.Positive=2]="Positive";class M{}M.contactsSynchronizationWithOutlook="ContactsSynchronizationWithOutlook",M.wordAddin="WordAddin",M.excelAddin="ExcelAddin",M.tasksRecurrentTasks="TasksRecurrentTasks",M.tasksSubtasks="TasksSubtasks",M.tasksSynchronizationWithOutlook="TasksSynchronizationWithOutlook",M.calendarSynchronizationWithOutlook="CalendarSynchronizationWithOutlook",M.emailsAutomaticTracking="EmailsAutomaticTracking",M.convertEmailToProject="ConvertEmailToProject",M.duplicityChecker="DuplicityChecker",M.nextStepAndLastActivityCustomization="NextStepAndLastActivityCustomization",M.subProjects="SubProjects",M.resourceAndPlanning="ResourceAndPlanning",M.professionalEmailCampaigns="ProfessionalEmailCampaigns",M.professionalEmailCampaignsAdvancedStatistics="ProfessionalEmailCampaignsAdvancedStatistics",M.wordEmailMerge="WordEmailMerge",M.printLabels="PrintLabels",M.printEnvelopes="PrintEnvelopes",M.userViews="UserViews",M.sharedUserViews="SharedUserViews",M.gridConditionalFormating="GridConditionalFormating",M.multipleCurrencies="MultipleCurrencies",M.historyTracking="HistoryTracking",M.privateItems="PrivateItems",M.itemTypes="ItemTypes",M.formLayoutCustomization="FormLayoutCustomization",M.workflowBasicDefinitions="WorkflowBasicDefinitions",M.workflowAdvancedDefinitions="WorkflowAdvancedDefinitions",M.workflowAdvancedDefinitionsRules="WorkflowAdvancedDefinitionsRules",M.workflowAdvancedDefinitionsActions="WorkflowAdvancedDefinitionsActions",M.workflowGroupLevelActions="WorkflowGroupLevelActions",M.customFields="CustomFields",M.importantFields="ImportantFields",M.mandatoryFields="MandatoryFields",M.uniqueFields="UniqueFields",M.readOnlyFields="ReadOnlyFields",M.transformationCustomTemplates="TransformationCustomTemplates",M.userRoles="UserRoles",M.modulePermissions="ModulePermissions",M.columnPermissions="ColumnPermissions",M.api="API",M.gate="Gate",M.threeCXIntegration="ThreeCXIntegration",M.tapiIntegration="TapiIntegration",M.pohodaIntegration="PohodaIntegration",M.pohodaSynchronizationIntervalCustomization="PohodaSynchronizationIntervalCustomization",M.pohodaSynchronizationFieldMappingCustomization="PohodaSynchronizationFieldMappingCustomization",M.quickBooksIntegration="QuickBooksIntegration",M.saveBinaryDataOnDisk="SaveBinaryDataOnDisk",M.activeDirectoryLogin="ActiveDirectoryLogin",M.callerIdentificationOnApple="CallerIdentificationOnApple",M.legacyAdministration="LegacyAdministration";class V{}V.customAdditionalFieldsCount="CustomAdditionalFieldsCount",V.customEnabledAdvancedWorkflowsCount="CustomEnabledAdvancedWorkflowsCount",V.customEnabledBasicWorkflowsCount="CustomEnabledBasicWorkflowsCount",V.customMandatoryFieldsCount="CustomMandatoryFieldsCount",V.customOptionalFieldsCount="CustomOptionalFieldsCount",V.customReadonlyFieldsCount="CustomReadonlyFieldsCount",V.customUniqueFieldsCount="CustomUniqueFieldsCount",V.customVisibleTypesCount="CustomVisibleTypesCount",V.visibleCurrenciesCount="VisibleCurrenciesCount";class U{}U.contactsAutomaticSynchronizationWithOutlook="ContactsAutomaticSynchronizationWithOutlook",U.contactsSynchronizationWithOutlook="ContactsSynchronizationWithOutlook",U.contactsSynchronizationWithAndroid="ContactsSynchronizationWithAndroid",U.documentsRevisions="DocumentsRevisions",U.wordAddin="WordAddin",U.excelAddin="ExcelAddin",U.tasksReminders="TasksReminders",U.tasksRecurrentTasks="TasksRecurrentTasks",U.tasksSubtasks="TasksSubtasks",U.tasksSynchronizationWithOutlook="TasksSynchronizationWithOutlook",U.calendarSynchronizationWithOutlook="CalendarSynchronizationWithOutlook",U.emailsManualTracking="EmailsManualTracking",U.emailsAutomaticTracking="EmailsAutomaticTracking",U.emailSummaryAndSentimentToneFromAi="EmailSummaryAndSentimentToneFromAi",U.convertEmailToContact="ConvertEmailToContact",U.convertEmailToDeal="ConvertEmailToDeal",U.convertEmailToProject="ConvertEmailToProject",U.convertEmailToTask="ConvertEmailToTask",U.convertFromSuggestedContact="ConvertFromSuggestedContact",U.gravatarIntegration="GravatarIntegration",U.logoboxIntegration="LogoboxIntegration",U.companiesBussinesRegisterApiIntegration="CompaniesBussinesRegisterApiIntegration",U.duplicityChecker="DuplicityChecker",U.nextStepAndLastActivityCustomization="NextStepAndLastActivityCustomization",U.subProjects="SubProjects",U.resourceAndPlanning="ResourceAndPlanning",U.professionalEmailCampaigns="ProfessionalEmailCampaigns",U.professionalEmailCampaignsAdvancedStatistics="ProfessionalEmailCampaignsAdvancedStatistics",U.wordEmailMerge="WordEmailMerge",U.printLabels="PrintLabels",U.printEnvelopes="PrintEnvelopes",U.userViews="UserViews",U.sharedUserViews="SharedUserViews",U.gridRowSummary="GridRowSummary",U.gridConditionalFormating="GridConditionalFormating",U.multipleCurrencies="MultipleCurrencies",U.historyTracking="HistoryTracking",U.privateItems="PrivateItems",U.itemTypes="ItemTypes",U.formLayoutCustomization="FormLayoutCustomization",U.workflowBasicDefinitions="WorkflowBasicDefinitions",U.workflowAdvancedDefinitions="WorkflowAdvancedDefinitions",U.workflowAdvancedDefinitionsRules="WorkflowAdvancedDefinitionsRules",U.workflowAdvancedDefinitionsActions="WorkflowAdvancedDefinitionsActions",U.workflowGroupLevelActions="WorkflowGroupLevelActions",U.customFields="CustomFields",U.importantFields="ImportantFields",U.mandatoryFields="MandatoryFields",U.uniqueFields="UniqueFields",U.readOnlyFields="ReadOnlyFields",U.transformationCustomTemplates="TransformationCustomTemplates",U.userRoles="UserRoles",U.modulePermissions="ModulePermissions",U.columnPermissions="ColumnPermissions",U.commonDataAPI="CommonDataAPI",U.eWayCrmAPI="eWayCrmAPI",U.threeCXIntegration="ThreeCXIntegration",U.tapiIntegration="TapiIntegration",U.pohodaIntegration="PohodaIntegration",U.pohodaSynchronizationIntervalCustomization="PohodaSynchronizationIntervalCustomization",U.pohodaSynchronizationFieldMappingCustomization="PohodaSynchronizationFieldMappingCustomization",U.quickBooksIntegration="QuickBooksIntegration",U.shareByTeams="ShareByTeams",U.convertEmailToContactWithDataFromAi="ConvertEmailToContactWithDataFromAi",U.convertEmailToDealWithDataFromAi="ConvertEmailToDealWithDataFromAi",U.convertEmailToProjectWithDataFromAi="ConvertEmailToProjectWithDataFromAi",U.xsltTransformationsAdministrationForCaCAndRest="XsltTransformationsAdministrationForCaCAndRest",U.xsltTransformationsAdministrationForSales="XsltTransformationsAdministrationForSales",U.xsltTransformationsAdministrationForProjects="XsltTransformationsAdministrationForProjects",U.xsltTransformationsAdministrationForMarketing="XsltTransformationsAdministrationForMarketing",function(e){e.UnpaidImportantInvoices="UnpaidImportantInvoices",e.UncollectableSubscriptionPayment="UncollectableSubscriptionPayment",e.UncollectableSubscriptionPaymentWithExpiredCard="UncollectableSubscriptionPaymentWithExpiredCard",e.StandardSubscriptionPeriod="StandardSubscriptionPeriod"}(L||(L={}));var _,G=L;!function(e){e.License="License",e.CloudLicense="CloudLicense",e.MiscLicense="MiscLicense",e.Support="Support",e.Service="Service"}(_||(_={}));var j=_;class B{}B.getIsDebug=e=>{var t;return!!(null===(t=null==e?void 0:e.sessionHandler.lastSuccessfulLoginResponse)||void 0===t?void 0:t.Debug)},B.supportsFeaturesOf=(e,t)=>{var r;const n=null===(r=e.sessionHandler.lastSuccessfulLoginResponse)||void 0===r?void 0:r.WcfVersion;return!!n&&B.supportsVersionFeaturesOf(n,t)},B.supportsVersionFeaturesOf=(e,t)=>n.compare(e,t,">=")||n.compare(e,"1.0.0.0","=");class W{}W.textBox="TextBox",W.comboBox="ComboBox",W.numericBox="NumericBox",W.relation="Relation",W.checkBox="CheckBox",W.linkTextBox="LinkTextBox",W.dateEdit="DateEdit",W.memoBox="MemoBox",W.multiSelectComboBox="MultiSelectComboBox",W.workflowState="WorkflowState",W.image="Image",W.multiSelectRelation="MultiSelectRelation";const H={[m.relations]:0,[m.unifiedRelations]:1,[m.users]:2,[m.groups]:3,[m.enumTypes]:4,[m.enumValues]:5,[m.additionalFields]:6};var z,Q,$,q;exports.Version=void 0,(z=exports.Version||(exports.Version={})).Version75="7.5",z.Version76="7.6",z.Version77="7.7",z.Version80="8.0",z.Version81="8.1",z.Version82="8.2",z.Version83="8.3",z.Version90="9.0",z.Version91="9.1",z.Version92="9.2",z.Version93="9.3",z.Version94="9.4";class J extends B{}J.is75OrLater=e=>B.supportsFeaturesOf(e,exports.Version.Version75),J.is76OrLater=e=>J.supportsFeaturesOf(e,exports.Version.Version76),J.is77OrLater=e=>J.supportsFeaturesOf(e,exports.Version.Version77),J.is80OrLater=e=>J.supportsFeaturesOf(e,exports.Version.Version80),J.is81OrLater=e=>J.supportsFeaturesOf(e,exports.Version.Version81),J.is82OrLater=e=>J.supportsFeaturesOf(e,exports.Version.Version82),J.is83OrLater=e=>J.supportsFeaturesOf(e,exports.Version.Version83),J.is90OrLater=e=>J.supportsFeaturesOf(e,exports.Version.Version90),J.is91OrLater=e=>J.supportsFeaturesOf(e,exports.Version.Version91),J.is92OrLater=e=>J.supportsFeaturesOf(e,exports.Version.Version92),J.is93OrLater=e=>J.supportsFeaturesOf(e,exports.Version.Version93),J.is94OrLater=e=>J.supportsFeaturesOf(e,exports.Version.Version94),J.isFeatureSupported=(e,t)=>J.supportsFeaturesOf(e,t);class X{static mainTable(){return{__type:"MainTable:#EQ"}}static relation(e,t,r){return{__type:"Relation:#EQ",Direction:r,ItemTypes:e,RelationType:t}}static join(e,t,r){const n={__type:"Join:#EQ",ItemType:e,Key:t};return r&&(n.TargetColumnName=r),n}static hubRelation(e){const{isToParentDirection:t,childrenFolderNames:r}=e,n={__type:"HubRelation:#EQ"};return void 0!==typeof t&&(n.IsToParentDirection=t),r&&(n.ChildrenFolderNames=r),n}}class K{static createHubItemsCountsQuery(e,t,r,n){return{__type:"HubItemsCountsQuery:#EQ",ParentItemGuids:e,ItemTypes:t,ExcludeSystemItems:r,SplitDate:n}}static createRelatedTableQuery(e,t,r){return{__type:r?"RelatedTableQuery:#EQ":"TypelessRelatedTableQuery:#EQ",BaseItemID:e,ItemTypes:Array.isArray(t)?t:[t],RelationType:r}}static createMainTableQuery(e){return{__type:"MainTableQuery:#EQ",ItemTypes:Array.isArray(e)?e:[e]}}}K.column=e=>({__type:"Column:#EQ",Source:X.mainTable(),Name:e}),K.multiSelectComboColumnLegacy=(e,t,r)=>({__type:"Column:#EQ",Source:X.mainTable(),Name:"ItemGUID",Transformation:`[dbo].[GetConcatenatedEnumValuesRelationsValues]({0}, '${e}', '${t}')`,Alias:null!=r?r:e}),K.multiSelectComboColumn=(e,t,r,n,o)=>{if(!J.is77OrLater(e))return K.multiSelectComboColumnLegacy(r,n,o);return{__type:"Column:#EQ",Source:X.mainTable(),Name:"ItemGUID",Transformation:`[dbo].[GetConcatenatedEnumValuesRelationsValues_WithObjectTypeID]({0}, dbo.GetObjectTypeID('${t}'), '${r}', '${n}')`,Alias:null!=o?o:r}},K.joinColumn=(e,t,r,n,o)=>K.joinColumnFromKey(e,K.column(t),r,n,o),K.joinColumnFromKey=(e,t,r,n,o)=>{const s={__type:"Column:#EQ",Source:X.join(e,t,o),Name:r};return n&&(s.Alias=n),s},K.singleVariatedColumn=(e,t,r)=>K.variatedColumn([K.columnVariation(e,t)],r),K.variatedColumn=(e,t)=>{const r={__type:"VariatedColumn:#EQ",Source:X.mainTable(),Variations:e};return t&&(r.Alias=t),r},K.columnVariation=(e,t,r)=>{const n={FolderName:t,Field:{__type:"Column:#EQ",Source:X.mainTable(),Name:e}};return r&&(n.Field.Transformation=r),n},K.joinColumnVariation=(e,t,r,n)=>({FolderName:e,Field:{__type:"Column:#EQ",Source:X.join(t,K.column(r)),Name:n}}),K.relationColumnVariation=(e,t,r,n)=>({FolderName:e,Field:{__type:"Column:#EQ",Source:X.relation(r,t,1),Name:n}}),K.relatedColumn=(e,t,r,n)=>{const o={__type:"Column:#EQ",Source:X.relation(t,e,1),Name:r};return n&&(o.Alias=n),o},K.relatedSubstituableColumn=(e,t,r,n,o)=>{const s={__type:"SubstituableColumn:#EQ",Source:X.relation(t,e,1),Name:r,Substitute:n};return o&&(s.Alias=o),s},K.relatedColumnFolderNameToken=(e,t,r)=>({__type:"Token:#EQ",Source:X.relation(t,e,1),TypeName:"ItemType",Alias:r}),K.hubRelationColumn=(e,t)=>({__type:"Column:#EQ",Source:X.hubRelation(t),Name:e}),K.aggregateColumn=(e,t,r)=>({__type:"AggregateColumn:#EQ",FunctionName:e,Source:t.Source,AggregatedField:t,Alias:r}),K.folderNameToken=e=>({__type:"Token:#EQ",Source:X.mainTable(),TypeName:"ItemType",Alias:null!=e?e:"FolderName"}),K.equalsFilterExpression=(e,t)=>({__type:"EqualsFilterExpressionPredicate:#EQ",Field:e,Value:t}),K.notEqualsExpression=(e,t)=>({__type:"NotFilterExpression:#EQ",Child:K.equalsFilterExpression(e,t)}),K.andFilterExpression=e=>({__type:"AndFilterExpressionOperator:#EQ",Children:e}),K.orFilterExpression=e=>({__type:"OrFilterExpressionOperator:#EQ",Children:e}),K.lessFilterExpression=(e,t)=>({__type:"LessFilterExpressionPredicate:#EQ",Field:e,Value:t}),K.lessOrEqualFilterExpression=(e,t)=>({__type:"LessOrEqualFilterExpressionPredicate:#EQ",Field:e,Value:t}),K.greaterFilterExpression=(e,t)=>({__type:"GreaterFilterExpressionPredicate:#EQ",Field:e,Value:t}),K.greaterOrEqualFilterExpression=(e,t)=>({__type:"GreaterOrEqualFilterExpressionPredicate:#EQ",Field:e,Value:t}),K.likeFilterExpression=(e,t)=>({__type:"LikeFilterExpressionPredicate:#EQ",Field:e,Value:`%${t}%`}),K.inFilterExpression=(e,t)=>({__type:"InFilterExpressionPredicate:#EQ",Field:e,Value:t}),K.relatedToExpression=(e,t)=>({__type:"RelatedToFilterExpressionPredicate:#EQ",Value:e,RelationType:t}),K.isNullOrEmptyFilterExpression=e=>K.orFilterExpression([K.equalsFilterExpression(K.column(e),null),K.equalsFilterExpression(K.column(e),"")]);class Y{static toRfc3339String(e){const t=e=>e<10?`0${e}`:String(e);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}:${t(e.getSeconds())}${(e=>{if(0===e)return"Z";const r=e>0?"-":"+";return e=Math.abs(e),`${r}${t(Math.floor(e/60))}:${t(e%60)}`})(e.getTimezoneOffset())}`}}function Z(e,t,r,n){return new(r||(r=Promise))(function(o,s){function i(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(i,a)}l((n=n.apply(e,t||[])).next())})}Y.isValid=e=>e instanceof Date&&!isNaN(e.getTime()),Y.areDaysEqual=(e,t)=>{const r=Y.clearTime(e),n=Y.clearTime(t);return r.getTime()===n.getTime()},Y.areTimesEqual=(e,t)=>e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes(),Y.areDatesEqual=(e,t)=>!!e&&!!t&&Y.areDaysEqual(e,t)&&Y.areTimesEqual(e,t),Y.clearTime=e=>{const t=new Date(e);return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t},Y.isWithoutTime=e=>0===e.getHours()&&0===e.getMinutes()&&0===e.getSeconds(),Y.getFormattedSqlDateTime=e=>e.toISOString().slice(0,19).replace("T"," "),Y.getRfcWithoutTimezone=e=>e.slice(0,19),exports.TransformItemFormats=void 0,(Q=exports.TransformItemFormats||(exports.TransformItemFormats={})).OpenXmlDocx="OpenXmlDocx",Q.Pdf="Pdf",Q.WordMlXml="WordMlXml","function"==typeof SuppressedError&&SuppressedError;exports.EnumTypeEditMode=void 0,($=exports.EnumTypeEditMode||(exports.EnumTypeEditMode={})).Readonly="Readonly",$.VisibleRankDefaultOnly="VisibleRankDefaultOnly",$.Editable="Editable",exports.ImportResult=void 0,(q=exports.ImportResult||(exports.ImportResult={})).Success="Success",q.Failure="Failed",q.FailureDuplicityFound="Failed_DuplicityFound",q.FailureItemAlreadyRemoved="Failed_ItemAlreadyRemoved",q.FailureColumnsLockedWFAction="Failed_ColumnsLocked",q.FailureItemLockedWFAction="Failed_ItemLocked",q.FailureLicenseLimitReached="Failed_LicenseLimitReached",q.FailureInssuficientModulePermission="Failed_InsufficientModulePermission",q.FailureInssuficientColumnsPermission="Failed_InsufficientColumnsPermission",c.polyfill(),exports.ApiConnectionAsNonDefaultExport=I,exports.ApiFetchClient=class{constructor(e,t,r,n){let o;if(this.sessionId=null,this.isAdmin=null,this.loginResponse=null,!(r||(o=C.decodeAccessToken(t),r=o.ws)))throw new Error("Failed to get web service URL from JWT");if(!(n||(o||(o=C.decodeAccessToken(t)),n=o.username)))throw new Error("Failed to get username from JWT");this.appName=e,this.wsUrl=r,this.userName=n,this.endpoint=r.startsWith("http://")?"InsecureAPI.svc":"API.svc",this.accessToken=t}hasAdminRights(){return this.isAdmin}getWsUrl(){return this.wsUrl}getUserName(){return this.userName}getOutlookClientVersion(){var e;return null===(e=this.loginResponse)||void 0===e?void 0:e.OutlookClientVersion}getWebServiceVersion(){var e;return null===(e=this.loginResponse)||void 0===e?void 0:e.WcfVersion}login(){return Z(this,void 0,void 0,function*(){const e={userName:this.userName,appVersion:this.appName},t=new Request(`${this.wsUrl}/${this.endpoint}/Login`,{method:"POST",headers:{Authorization:`Bearer ${this.accessToken}`,"Content-Type":"application/json"},body:JSON.stringify(e)}),r=yield fetch(t),n=200===r.status?yield r.json():void 0;if(!n||"rcSuccess"!==n.ReturnCode)throw new Error(`Login failed: ${(null==n?void 0:n.Description)||"Unknown error"}`);this.sessionId=null==n?void 0:n.SessionId,this.isAdmin=null==n?void 0:n.IsAdmin,this.loginResponse=n})}logout(){return Z(this,void 0,void 0,function*(){const e=new Request(`${this.wsUrl}/${this.endpoint}/LogOut`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:this.sessionId})}),t=yield fetch(e);if("rcSuccess"!==(yield t.json()).ReturnCode)throw new Error("Failed to logout")})}getObjectTypes(){return Z(this,void 0,void 0,function*(){return(yield this.callMethod("GetObjectTypes",{})).Data})}getLicense(){return Z(this,void 0,void 0,function*(){return(yield this.callMethod("GetLicense",{})).Datum})}getClientVersionId(e){return Z(this,void 0,void 0,function*(){var t;const r={versionName:e};return null===(t=(yield this.callMethod("GetClientVersion",r)).Datum)||void 0===t?void 0:t.Id})}queryAmount(e){return Z(this,arguments,void 0,function*(e,t=null){const r={query:{__type:"MainTableQuery:#EQ",ItemTypes:[e],Fields:[{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:"ItemGUID"}]}};return t&&(r.query.Filter=t),this.callMethod("QueryAmount",r)})}query(e){return Z(this,arguments,void 0,function*(e,t=null,r=null,n=null){const o={query:{__type:"MainTableQuery:#EQ",ItemTypes:[e],Fields:t,Paging:{Skip:0,Take:500}}};return r&&(o.query.Filter=r),n&&(o.query.Sort=n),this.callMethod("Query",o)})}callMethod(e,t){return Z(this,arguments,void 0,function*(e,t,r="POST"){if(!this.sessionId)throw new Error("Session ID is not set. Please call init() first.");t.sessionId=this.sessionId;const n=new Request(`${this.wsUrl}/${this.endpoint}/${e}`,{method:r,headers:{"Content-Type":"application/json"},body:"POST"===r?JSON.stringify(t):void 0}),o=yield fetch(n);if(!o.ok)throw new Error(`Error calling method ${e}: ${o.statusText}`);const s=200===o.status?yield o.json():void 0;if(!s||"rcSuccess"!==s.ReturnCode)throw new Error(`API call failed (${null==s?void 0:s.ReturnCode}): ${null==s?void 0:s.Description}`);return s})}static getTokenData(e,t,r,n,o){return Z(this,void 0,void 0,function*(){const s=new URLSearchParams;s.append("client_id",n),s.append("client_secret",o),s.append("code",t),s.append("redirect_uri",r),s.append("grant_type","authorization_code");const i=new Request(`${e}/auth/connect/token`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s.toString()}),a=yield fetch(i);if(!a.ok)throw new Error(`Error calling token endpoint: ${a.statusText}`);const l=yield a.json();if(!l||!l.access_token)throw new Error("Failed to get access token");return l})}},exports.ApiMethods=p,exports.ColumnPermissionMandatoryRules=F,exports.ColumnPermissionPermissionRules=x,exports.CommonDataConnection=class{constructor(e,t){this.isCommonDataApiEnabled=(e,t)=>{this.tokenizedConnection.isEnabled(e,t)},this.callCommonDataApi=(e,t,r,n)=>{this.tokenizedConnection.callTokenizedApi(e,t,r,n)},this.tokenizedConnection=new A("ObtainCommonDataApiAccessToken",exports.HttpMethod.get,!1,"InvalidCommonDataToken",v,e,t)}},exports.CustomizationStatsItemKeys=V,exports.DateHelper=Y,exports.EWItem=class{constructor(e,t){if(!e||!t)throw new Error("Both folderName and baseItem has to be defined!");this.folderName=e,this.baseItem=t}getEmailAddress(){switch(this.folderName){case m.contacts:{const e=this.baseItem;return e.Email1Address||e.Email2Address||e.Email3Address}case m.leads:return this.baseItem.Email;case m.companies:return this.baseItem.Email;case m.users:{const e=this.baseItem;return e.Email1Address||e.Email2Address}default:return null}}getInitials(){switch(this.folderName){case m.contacts:{const e=this.baseItem;return this.getInitialsInternal(e.FirstName,e.LastName)}case m.users:{const e=this.baseItem;return this.getInitialsInternal(e.FirstName,e.LastName)}default:return null}}getInitialsInternal(e,t){const r=((null==e?void 0:e.substr(0,1))||"")+((null==t?void 0:t.substr(0,1))||"");return""==r?null:r}getItemPreview(){switch(this.folderName){case m.contacts:{const e=this.baseItem;return e.ProfilePicture?{imageData:e.ProfilePicture,width:e.ProfilePictureWidth||0,height:e.ProfilePictureHeight||0}:null}case m.users:{const e=this.baseItem;return e.ProfilePicture?{imageData:e.ProfilePicture,width:e.ProfilePictureWidth||0,height:e.ProfilePictureHeight||0}:null}default:return null}}},exports.EnumTypes=d,exports.ErrorHelper=E,exports.ExpirationReason=G,exports.FieldNames=b,exports.FieldTypes=W,exports.FolderNames=m,exports.Functionality=M,exports.GlobalSettingsNames=k,exports.HttpRequestError=T,exports.LicenseKeyInvoiceSeverity=j,exports.LicenseRestrictionKeys=U,exports.OAuthHelper=C,exports.OAuthSessionHandler=P,exports.OAuthSessionHandlerBase=g,exports.ObjectTypeIds=H,exports.OpenItemLinkHelper=S,exports.QueryHelper=K,exports.RelationTypeIds=w,exports.RelationTypes=D,exports.ReturnCodes=u,exports.StringHelper=class{static trim(e,t,r=!1){if(null==e)return e;let n=e.trim();return n.length<=t||(n=n.substring(0,t-(r?3:0)),r&&(n+="...")),n}},exports.TokenizedServiceConnection=A,exports.VersionHelper=J,exports.VersionHelperBase=B,exports.default=I;
@@ -5,5 +5,5 @@ export declare class CommonDataConnection {
5
5
  private readonly tokenizedConnection;
6
6
  constructor(connection: ApiConnection, errorCallback?: (error: Error) => void);
7
7
  readonly isCommonDataApiEnabled: (enabledCallback: (url: string, token: string) => void, disabledCallback: () => void) => void;
8
- readonly callCommonDataApi: <TResult extends ITokenizedApiResult>(methodName: string, data: TInputData, successCallback: (data: TResult) => void, unsuccessCallback?: ((data: TResult | null) => void) | null | undefined) => void;
8
+ readonly callCommonDataApi: <TResult extends ITokenizedApiResult>(methodName: string, data: TInputData, successCallback: (data: TResult) => void, unsuccessCallback?: ((data: TResult | null) => void) | null) => void;
9
9
  }
@@ -19,7 +19,7 @@ export declare class TokenizedServiceConnection<TObtainResponse extends IApiResu
19
19
  token: string | null;
20
20
  }, connection: ApiConnection, errorCallback?: (error: Error) => void);
21
21
  readonly isEnabled: (enabledCallback: (url: string, token: string) => void, disabledCallback: () => void) => void;
22
- readonly callTokenizedApi: <TResult extends ITokenizedApiResult>(methodName: string, data: TInputData, successCallback: (data: TResult) => void, unsuccessCallback?: ((data: TResult | null) => void) | null | undefined) => void;
22
+ readonly callTokenizedApi: <TResult extends ITokenizedApiResult>(methodName: string, data: TInputData, successCallback: (data: TResult) => void, unsuccessCallback?: ((data: TResult | null) => void) | null) => void;
23
23
  private readonly obtainToken;
24
24
  private static call;
25
25
  }
@@ -59,7 +59,7 @@ export declare class ApiConnection {
59
59
  * @param errorCallback Optional. Handler callback for any other failures. If not supplied, the global error handler is used.
60
60
  * @param config Optional. Additional config for the request.
61
61
  */
62
- readonly callCustomUploadMethod: (file: File, data: Record<string, string>, methodName: string, successCallback: (res: IApiResult) => void, unsuccessCallback?: ((e: IApiResult) => void) | undefined, errorCallback?: ((e: TUnionError) => void) | undefined, config?: AxiosRequestConfig) => void;
62
+ readonly callCustomUploadMethod: (file: File, data: Record<string, string>, methodName: string, successCallback: (res: IApiResult) => void, unsuccessCallback?: (e: IApiResult) => void, errorCallback?: (e: TUnionError) => void, config?: AxiosRequestConfig) => void;
63
63
  /**
64
64
  * Asynchronously uploads file using binary stream
65
65
  * @param itemGuid Item identificator. Ex. '9ac561be-9b7d-4938-8e55-4cce97142483'.
@@ -70,7 +70,7 @@ export declare class ApiConnection {
70
70
  * @param errorCallback Optional. Handler callback for any other failures. If not supplied, the global error handler is used.
71
71
  * @param config Optional. Additional config for the request.
72
72
  */
73
- readonly callUploadMethod: (itemGuid: string, fileName: string, file: File, successCallback: (res: IApiResult) => void, unsuccessCallback?: ((e: IApiResult) => void) | undefined, errorCallback?: ((e: TUnionError) => void) | undefined, config?: AxiosRequestConfig) => void;
73
+ readonly callUploadMethod: (itemGuid: string, fileName: string, file: File, successCallback: (res: IApiResult) => void, unsuccessCallback?: (e: IApiResult) => void, errorCallback?: (e: TUnionError) => void, config?: AxiosRequestConfig) => void;
74
74
  /**
75
75
  * Creates a promise for async API method call.
76
76
  * @param methodName API method name. Ex. 'GetUsers'.
@@ -88,8 +88,8 @@ export declare class ApiConnection {
88
88
  * @param httpMethod Optional. The used HTTP method. POST or GET. Default is POST.
89
89
  * @param errorCallback Optional. Handler callback for any other failures. If not supplied, the global error handler is used.
90
90
  */
91
- readonly callMethod: <TResult extends IApiResult>(methodName: string, data: TInputData, successCallback: (result: TResult) => void, unsuccessCallback?: ((result: TResult) => void) | undefined, httpMethod?: HttpMethod, errorCallback?: ((error: TUnionError) => void) | undefined) => void;
92
- readonly callWithoutSession: <TResult extends IApiResult>(methodName: string, data: TInputData | null, successCallback: (result: TResult) => void, unsuccessCallback: (result: TResult) => void, headers?: Record<string, string> | null, httpMethod?: HttpMethod, errorCallback?: ((error: TUnionError) => void) | undefined) => void;
91
+ readonly callMethod: <TResult extends IApiResult>(methodName: string, data: TInputData, successCallback: (result: TResult) => void, unsuccessCallback?: (result: TResult) => void, httpMethod?: HttpMethod, errorCallback?: (error: TUnionError) => void) => void;
92
+ readonly callWithoutSession: <TResult extends IApiResult>(methodName: string, data: TInputData | null, successCallback: (result: TResult) => void, unsuccessCallback: (result: TResult) => void, headers?: Record<string, string> | null, httpMethod?: HttpMethod, errorCallback?: (error: TUnionError) => void) => void;
93
93
  readonly getItemPreviewGetMethodUrl: (folderName: string, itemGuid: string, itemVersion?: number) => string;
94
94
  readonly getEmailAttachmentGetMethodUrl: (itemGuid: string, contentId: string) => string;
95
95
  readonly getAllEmailAttachmentsZipGetMethodUrl: (itemGuid: string) => string;
@@ -29,6 +29,7 @@ declare class GlobalSettingsNames {
29
29
  static readonly enableLlamaAiFeatures = "EnableLlamaAiFeatures";
30
30
  static readonly enableUsersSyncIntoMobileDeviceContacts = "EnableUsersSyncIntoMobileDeviceContacts";
31
31
  static readonly emailsActiveProjectsLeadsFilter = "EmailsActiveProjectsLeadsFilter";
32
+ static readonly trackToAddressesOnly = "TrackToAddressesOnly";
32
33
  static readonly exchangeRatesAdminGroupName = "ExchangeRatesAdminGroupName";
33
34
  static readonly forcedEmailTrackingGroups = "ForcedEmailTrackingGroups";
34
35
  static readonly ignoreEmailsFromDomainsOnEmailsTracking = "IgnoreEmailsFromDomainsOnEmailsTracking";
@@ -47,4 +47,6 @@ export interface IApiCart extends IApiItemBase {
47
47
  Companies_CustomerGuid: string | null;
48
48
  Leads_CartGuid: string | null;
49
49
  Projects_CartGuid: string | null;
50
+ Margin: number | null;
51
+ Markup: number | null;
50
52
  }
@@ -23,4 +23,6 @@ export interface IApiGood extends IApiItemBase {
23
23
  PictureHeight: number | null;
24
24
  TypeEn: string | null;
25
25
  Goods_SuperiorGoodGuid: string | null;
26
+ Margin: number | null;
27
+ Markup: number | null;
26
28
  }
@@ -59,4 +59,6 @@ export interface IApiGoodInCart extends IApiItemBase {
59
59
  Goods_GoodsInfoGuid: string | null;
60
60
  Leads_ProjectGuid: string | null;
61
61
  Projects_ProjectGuid: string | null;
62
+ Margin: number | null;
63
+ Markup: number | null;
62
64
  }