@eway-crm/connector 1.0.265 → 1.0.267

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/esm/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import e from"axios";import*as t from"universal-base64url";import r from"jwt-decode";import{compare as n}from"compare-versions";var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var s,i={exports:{}},a=i.exports=function(){function e(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}function t(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},n=0,s=void 0,i=void 0,a=function(e,t){T[n]=e,T[n+1]=t,2===(n+=2)&&(i?i(S):A())};function l(e){i=e}function c(e){a=e}var u="undefined"!=typeof window?window:void 0,d=u||{},m=d.MutationObserver||d.WebKitMutationObserver,p="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function y(){return function(){return process.nextTick(S)}}function C(){return void 0!==s?function(){s(S)}:P()}function f(){var e=0,t=new m(S),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}function g(){var e=new MessageChannel;return e.port1.onmessage=S,function(){return e.port2.postMessage(0)}}function P(){var e=setTimeout;return function(){return e(S,1)}}var T=new Array(1e3);function S(){for(var e=0;e<n;e+=2)(0,T[e])(T[e+1]),T[e]=void 0,T[e+1]=void 0;n=0}function E(){try{var e=Function("return this")().require("vertx");return s=e.runOnLoop||e.runOnContext,C()}catch(e){return P()}}var A=void 0;function I(e,t){var r=this,n=new this.constructor(D);void 0===n[k]&&$(n);var o=r._state;if(o){var s=arguments[o-1];a(function(){return W(o,n,s,r._result)})}else j(r,n,e,t);return n}function v(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var r=new t(D);return U(r,e),r}A=p?y():m?f():h?g():void 0===u?E():P();var k=Math.random().toString(36).substring(2);function D(){}var b=void 0,w=1,F=2;function O(){return new TypeError("You cannot resolve a promise with itself")}function N(){return new TypeError("A promises callback cannot return that same promise.")}function R(e,t,r,n){try{e.call(t,r,n)}catch(e){return e}}function L(e,t,r){a(function(e){var n=!1,o=R(r,t,function(r){n||(n=!0,t!==r?U(e,r):_(e,r))},function(t){n||(n=!0,V(e,t))},"Settle: "+(e._label||" unknown promise"));!n&&o&&(n=!0,V(e,o))},e)}function x(e,t){t._state===w?_(e,t._result):t._state===F?V(e,t._result):j(t,void 0,function(t){return U(e,t)},function(t){return V(e,t)})}function M(e,r,n){r.constructor===e.constructor&&n===I&&r.constructor.resolve===v?x(e,r):void 0===n?_(e,r):t(n)?L(e,r,n):_(e,r)}function U(t,r){if(t===r)V(t,O());else if(e(r)){var n=void 0;try{n=r.then}catch(e){return void V(t,e)}M(t,r,n)}else _(t,r)}function G(e){e._onerror&&e._onerror(e._result),B(e)}function _(e,t){e._state===b&&(e._result=t,e._state=w,0!==e._subscribers.length&&a(B,e))}function V(e,t){e._state===b&&(e._state=F,e._result=t,a(G,e))}function j(e,t,r,n){var o=e._subscribers,s=o.length;e._onerror=null,o[s]=t,o[s+w]=r,o[s+F]=n,0===s&&e._state&&a(B,e)}function B(e){var t=e._subscribers,r=e._state;if(0!==t.length){for(var n=void 0,o=void 0,s=e._result,i=0;i<t.length;i+=3)n=t[i],o=t[i+r],n?W(r,n,o,s):o(s);e._subscribers.length=0}}function W(e,r,n,o){var s=t(n),i=void 0,a=void 0,l=!0;if(s){try{i=n(o)}catch(e){l=!1,a=e}if(r===i)return void V(r,N())}else i=o;r._state!==b||(s&&l?U(r,i):!1===l?V(r,a):e===w?_(r,i):e===F&&V(r,i))}function H(e,t){try{t(function(t){U(e,t)},function(t){V(e,t)})}catch(t){V(e,t)}}var z=0;function Q(){return z++}function $(e){e[k]=z++,e._state=void 0,e._result=void 0,e._subscribers=[]}function q(){return new Error("Array Methods must be provided an Array")}var J=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(D),this.promise[k]||$(this.promise),r(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?_(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&_(this.promise,this._result))):V(this.promise,q())}return e.prototype._enumerate=function(e){for(var t=0;this._state===b&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var r=this._instanceConstructor,n=r.resolve;if(n===v){var o=void 0,s=void 0,i=!1;try{o=e.then}catch(e){i=!0,s=e}if(o===I&&e._state!==b)this._settledAt(e._state,t,e._result);else if("function"!=typeof o)this._remaining--,this._result[t]=e;else if(r===te){var a=new r(D);i?V(a,s):M(a,e,o),this._willSettleAt(a,t)}else this._willSettleAt(new r(function(t){return t(e)}),t)}else this._willSettleAt(n(e),t)},e.prototype._settledAt=function(e,t,r){var n=this.promise;n._state===b&&(this._remaining--,e===F?V(n,r):this._result[t]=r),0===this._remaining&&_(n,this._result)},e.prototype._willSettleAt=function(e,t){var r=this;j(e,void 0,function(e){return r._settledAt(w,t,e)},function(e){return r._settledAt(F,t,e)})},e}();function X(e){return new J(this,e).promise}function K(e){var t=this;return r(e)?new t(function(r,n){for(var o=e.length,s=0;s<o;s++)t.resolve(e[s]).then(r,n)}):new t(function(e,t){return t(new TypeError("You must pass an array to race."))})}function Y(e){var t=new this(D);return V(t,e),t}function Z(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function ee(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var te=function(){function e(t){this[k]=Q(),this._result=this._state=void 0,this._subscribers=[],D!==t&&("function"!=typeof t&&Z(),this instanceof e?H(this,t):ee())}return e.prototype.catch=function(e){return this.then(null,e)},e.prototype.finally=function(e){var r=this,n=r.constructor;return t(e)?r.then(function(t){return n.resolve(e()).then(function(){return t})},function(t){return n.resolve(e()).then(function(){throw t})}):r.then(e,e)},e}();function re(){var e=void 0;if(void 0!==o)e=o;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var r=null;try{r=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===r&&!t.cast)return}e.Promise=te}return te.prototype.then=I,te.all=X,te.race=K,te.resolve=v,te.reject=Y,te._setScheduler=l,te._setAsap=c,te._asap=a,te.polyfill=re,te.Promise=te,te}();
1
+ import e from"axios";import*as t from"universal-base64url";import r from"jwt-decode";import{compare as n}from"compare-versions";var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var o,i={exports:{}},a=i.exports=function(){function e(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}function t(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},n=0,o=void 0,i=void 0,a=function(e,t){T[n]=e,T[n+1]=t,2===(n+=2)&&(i?i(S):v())};function l(e){i=e}function c(e){a=e}var u="undefined"!=typeof window?window:void 0,d=u||{},m=d.MutationObserver||d.WebKitMutationObserver,p="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function y(){return function(){return process.nextTick(S)}}function C(){return void 0!==o?function(){o(S)}:P()}function f(){var e=0,t=new m(S),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}function g(){var e=new MessageChannel;return e.port1.onmessage=S,function(){return e.port2.postMessage(0)}}function P(){var e=setTimeout;return function(){return e(S,1)}}var T=new Array(1e3);function S(){for(var e=0;e<n;e+=2)(0,T[e])(T[e+1]),T[e]=void 0,T[e+1]=void 0;n=0}function E(){try{var e=Function("return this")().require("vertx");return o=e.runOnLoop||e.runOnContext,C()}catch(e){return P()}}var v=void 0;function I(e,t){var r=this,n=new this.constructor(b);void 0===n[k]&&Q(n);var s=r._state;if(s){var o=arguments[s-1];a(function(){return B(s,n,o,r._result)})}else $(r,n,e,t);return n}function A(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var r=new t(b);return U(r,e),r}v=p?y():m?f():h?g():void 0===u?E():P();var k=Math.random().toString(36).substring(2);function b(){}var w=void 0,D=1,F=2;function O(){return new TypeError("You cannot resolve a promise with itself")}function R(){return new TypeError("A promises callback cannot return that same promise.")}function N(e,t,r,n){try{e.call(t,r,n)}catch(e){return e}}function L(e,t,r){a(function(e){var n=!1,s=N(r,t,function(r){n||(n=!0,t!==r?U(e,r):_(e,r))},function(t){n||(n=!0,V(e,t))},"Settle: "+(e._label||" unknown promise"));!n&&s&&(n=!0,V(e,s))},e)}function x(e,t){t._state===D?_(e,t._result):t._state===F?V(e,t._result):$(t,void 0,function(t){return U(e,t)},function(t){return V(e,t)})}function M(e,r,n){r.constructor===e.constructor&&n===I&&r.constructor.resolve===A?x(e,r):void 0===n?_(e,r):t(n)?L(e,r,n):_(e,r)}function U(t,r){if(t===r)V(t,O());else if(e(r)){var n=void 0;try{n=r.then}catch(e){return void V(t,e)}M(t,r,n)}else _(t,r)}function G(e){e._onerror&&e._onerror(e._result),j(e)}function _(e,t){e._state===w&&(e._result=t,e._state=D,0!==e._subscribers.length&&a(j,e))}function V(e,t){e._state===w&&(e._state=F,e._result=t,a(G,e))}function $(e,t,r,n){var s=e._subscribers,o=s.length;e._onerror=null,s[o]=t,s[o+D]=r,s[o+F]=n,0===o&&e._state&&a(j,e)}function j(e){var t=e._subscribers,r=e._state;if(0!==t.length){for(var n=void 0,s=void 0,o=e._result,i=0;i<t.length;i+=3)n=t[i],s=t[i+r],n?B(r,n,s,o):s(o);e._subscribers.length=0}}function B(e,r,n,s){var o=t(n),i=void 0,a=void 0,l=!0;if(o){try{i=n(s)}catch(e){l=!1,a=e}if(r===i)return void V(r,R())}else i=s;r._state!==w||(o&&l?U(r,i):!1===l?V(r,a):e===D?_(r,i):e===F&&V(r,i))}function W(e,t){try{t(function(t){U(e,t)},function(t){V(e,t)})}catch(t){V(e,t)}}var H=0;function z(){return H++}function Q(e){e[k]=H++,e._state=void 0,e._result=void 0,e._subscribers=[]}function q(){return new Error("Array Methods must be provided an Array")}var J=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(b),this.promise[k]||Q(this.promise),r(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?_(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&_(this.promise,this._result))):V(this.promise,q())}return e.prototype._enumerate=function(e){for(var t=0;this._state===w&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var r=this._instanceConstructor,n=r.resolve;if(n===A){var s=void 0,o=void 0,i=!1;try{s=e.then}catch(e){i=!0,o=e}if(s===I&&e._state!==w)this._settledAt(e._state,t,e._result);else if("function"!=typeof s)this._remaining--,this._result[t]=e;else if(r===te){var a=new r(b);i?V(a,o):M(a,e,s),this._willSettleAt(a,t)}else this._willSettleAt(new r(function(t){return t(e)}),t)}else this._willSettleAt(n(e),t)},e.prototype._settledAt=function(e,t,r){var n=this.promise;n._state===w&&(this._remaining--,e===F?V(n,r):this._result[t]=r),0===this._remaining&&_(n,this._result)},e.prototype._willSettleAt=function(e,t){var r=this;$(e,void 0,function(e){return r._settledAt(D,t,e)},function(e){return r._settledAt(F,t,e)})},e}();function X(e){return new J(this,e).promise}function K(e){var t=this;return r(e)?new t(function(r,n){for(var s=e.length,o=0;o<s;o++)t.resolve(e[o]).then(r,n)}):new t(function(e,t){return t(new TypeError("You must pass an array to race."))})}function Y(e){var t=new this(b);return V(t,e),t}function Z(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function ee(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var te=function(){function e(t){this[k]=z(),this._result=this._state=void 0,this._subscribers=[],b!==t&&("function"!=typeof t&&Z(),this instanceof e?W(this,t):ee())}return e.prototype.catch=function(e){return this.then(null,e)},e.prototype.finally=function(e){var r=this,n=r.constructor;return t(e)?r.then(function(t){return n.resolve(e()).then(function(){return t})},function(t){return n.resolve(e()).then(function(){throw t})}):r.then(e,e)},e}();function re(){var e=void 0;if(void 0!==s)e=s;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var r=null;try{r=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===r&&!t.cast)return}e.Promise=te}return te.prototype.then=I,te.all=X,te.race=K,te.resolve=A,te.reject=Y,te._setScheduler=l,te._setAsap=c,te._asap=a,te.polyfill=re,te.Promise=te,te}();
2
2
  /*!
3
3
  * @overview es6-promise - a tiny implementation of Promises/A+.
4
4
  * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
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 l{}l.rcSuccess="rcSuccess",l.rcBadSession="rcBadSession",l.rcDuplicateContact="rcDuplicateContact",l.rcWebServiceMoved="rcWebServiceMoved",l.rcAccessDenied="rcAccessDenied",l.rcLoginUserNameChanged="rcLoginUserNameChanged",l.rcLicenseExpired="rcLicenseExpired",l.rcBadAccessToken="rcBadAccessToken",l.rcExchangeWebServicesAccountAuthorizationRequired="rcExchangeWebServicesAccountAuthorizationRequired",l.rcGraphAuthorizationRequired="rcGraphAuthorizationRequired",l.rcConsentRequired="rcConsentRequired",function(e){e.get="get",e.post="post"}(s||(s={}));class c{}c.absence="Absence",c.bonusType="BonusType",c.busyStatus="BusyStatus",c.cartType="CartType",c.companyType="CompanyType",c.contactType="ContactType",c.countryCode="CountryCode",c.currency="Currency",c.customFieldCategory="CustomFieldCategory",c.dayType="DayType",c.documentOfflineState="DocumentOfflineState",c.documentType="DocumentType",c.emailCampaignWorkflowStatus="EmailCampaignWorkflowStatus",c.emailOfflineState="EmailOfflineState",c.emailType="EmailType",c.familyStatus="FamilyStatus",c.firstContact="FirstContact",c.globalSettingsCategory="GlobalSettingsCategory",c.goalType="GoalType",c.groupColor="GroupColor",c.importance="Importance",c.journalType="JournalType",c.knowledgeLevel="KnowledgeLevel",c.knowledgeTitle="KnowledgeTitle",c.knowledgeType="KnowledgeType",c.leadType="LeadType",c.marketingType="MarketingType",c.paymentType="PaymentType",c.prefixType="PrefixType",c.productType="ProductType",c.projectOrigin="ProjectOrigin",c.projectType="ProjectType",c.reportCategory="ReportCategory",c.responseForm="ResponseForm",c.responseType="ResponseType",c.salaryDate="SalaryDate",c.salaryType="SalaryType",c.salePriceType="SalePriceType",c.sentimentTone="SentimentTone",c.suffixType="SuffixType",c.taskImportance="TaskImportance",c.tasksSnoozePeriod="TasksSnoozePeriod",c.taskStatus="TaskStatus",c.taskType="TaskType",c.trainingGrade="TrainingGrade",c.trainingTitle="TrainingTitle",c.translations="Translations",c.units="Units",c.userType="UserType",c.usStatesDistrictsTerritories="USStatesDistrictsTerritories",c.vacationType="VacationType",c.vat="VAT",c.workLoad="WorkLoad",c.workReportType="WorkReportType";class u{}u.isValidFolderName=e=>Object.values(u).includes(e),u.actions="Actions",u.additionalFields="AdditionalFields",u.bonuses="Bonuses",u.calendar="Calendar",u.capacityNotes="CapacityNotes",u.capacityNoteTypes="CapacityNoteTypes",u.carts="Carts",u.columnPermissions="ColumnPermissions",u.companies="Companies",u.contacts="Contacts",u.contactsSuggestions="ContactsSuggestions",u.currencyExchangeRates="CurrencyExchangeRates",u.documents="Documents",u.emails="Emails",u.enumTypes="EnumTypes",u.enumValues="EnumValues",u.enumValuesRelations="EnumValuesRelations",u.features="Features",u.flows="Flows",u.globalSettings="GlobalSettings",u.goals="Goals",u.goods="Goods",u.goodsInCart="GoodsInCart",u.goodsInSet="GoodsInSet",u.groups="Groups",u.history="History",u.holidays="Holidays",u.children="Children",u.individualDiscounts="IndividualDiscounts",u.invoiceItems="InvoiceItems",u.invoices="Invoices",u.itemCopyRelations="ItemCopyRelations",u.journal="Journal",u.knowledge="Knowledge",u.layouts="Layouts",u.layoutsModels="LayoutsModels",u.leads="Leads",u.ledger="Ledger",u.mappings="Mappings",u.marketing="Marketing",u.marketingList="MarketingList",u.marketingListSources="MarketingListSources",u.models="Models",u.modulePermissions="ModulePermissions",u.objectTypesOptions="ObjectTypesOptions",u.payments="Payments",u.priceListGroups="PriceListGroups",u.projectAssignments="ProjectAssignments",u.projectAssignmentsPerUserProject="ProjectAssignmentsPerUserProject",u.projectAssignmentsTotal="ProjectAssignmentsTotal",u.projectAssignmentsTotalUserProject="ProjectAssignmentsTotalUserProject",u.projectList="ProjectList",u.projects="Projects",u.projectUsersInCaPlan="ProjectUsersInCaPlan",u.relationData="RelationData",u.relations="Relations",u.reports="Reports",u.revisionsHistory="RevisionsHistory",u.salaries="Salaries",u.salePrices="SalePrices",u.prices="Prices",u.sqlObjects="SqlObjects",u.tasks="Tasks",u.recurrencePatterns="RecurrencePatterns",u.teamRoles="TeamRoles",u.templates="Templates",u.training="Training",u.unifiedRelations="UnifiedRelations",u.users="Users",u.userSettings="UserSettings",u.vacation="Vacation",u.webAccess2Options="WebAccess2Options",u.webAccessOptions="WebAccessOptions",u.workCommitments="WorkCommitments",u.workflowHistory="WorkflowHistory",u.workReports="WorkReports",u.wrongClientVersions="WrongClientVersions",u.xsltTransformations="XsltTransformations",u.xsltTransformationsModels="XsltTransformationsModels",u.getEnumTypeName=e=>e===u.bonuses?c.bonusType:e===u.carts?c.cartType:e===u.companies?c.companyType:e===u.contacts?c.contactType:e===u.documents?c.documentType:e===u.emails?c.emailType:e===u.goals?c.goalType:e===u.goods?c.productType:e===u.journal?c.journalType:e===u.knowledge?c.knowledgeType:e===u.leads?c.leadType:e===u.marketing?c.marketingType:e===u.projects?c.projectType:e===u.salaries?c.salaryType:e===u.salePrices?c.salePriceType:e===u.tasks?c.taskType:e===u.training?c.trainingTitle:e===u.users?c.userType:e===u.vacation?c.vacationType:e===u.workReports?c.workReportType:null,u.getFolderNameByEnumTypeName=e=>e===c.bonusType?u.bonuses:e===c.cartType?u.carts:e===c.companyType?u.companies:e===c.contactType?u.contacts:e===c.documentType?u.documents:e===c.emailType?u.emails:e===c.goalType?u.goals:e===c.journalType?u.journal:e===c.knowledgeType?u.knowledge:e===c.leadType?u.leads:e===c.marketingType?u.marketing:e===c.productType?u.goods:e===c.projectType?u.projects:e===c.salaryType?u.salaries:e===c.salePriceType?u.salePrices:e===c.taskType?u.tasks:e===c.trainingTitle?u.training:e===c.userType?u.users:e===c.vacationType?u.vacation:e===c.workReportType?u.workReports:null;class d{}d.getAllEmailAttachments="GetAllEmailAttachments",d.getCalendarsByItemGuids="GetCalendarsByItemGuids",d.getEmailAttachment="GetEmailAttachment",d.getItemPreview="GetItemPreview",d.getJournalsByItemGuids="GetJournalsByItemGuids",d.getMarketingCampaignsByItemGuids="GetMarketingCampaignsByItemGuids",d.getMarketingListsRecordsByItemGuids="GetMarketingListsRecordsByItemGuids",d.getRevisionHistoryRecordsByItemGuids="GetRevisionHistoryRecordsByItemGuids",d.getVacationsByItemGuids="GetVacationsByItemGuids",d.getWorkflowHistoryRecordsByItemGuids="GetWorkflowHistoryRecordsByItemGuids",d.getCompanyInformationFromTaxRegister="GetCompanyInformationFromTaxRegister",d.logIn="LogIn",d.logOut="LogOut",d.query="Query",d.queryAmount="QueryAmount",d.getServiceAuthSettings="GetServiceAuthSettings",d.getVersion="GetVersion",d.getBinaryAttachment="GetBinaryAttachment",d.getBinaryAttachmentLatestRevision="GetBinaryAttachmentLatestRevision",d.transformItem="TransformItem",d.canUnlinkItems="CanUnlinkItems",d.unlinkItems="UnlinkItems",d.getGoodsFinalPrices="GetGoodsFinalPrices",d.saveItemCopyRelation="SaveItemCopyRelation",d.getXsltTransormationDefinition="GetXsltTransformationDefinition",d.saveBinaryAttachment="SaveBinaryAttachment",d.saveBinaryXsltTransformation="SaveBinaryXsltTransformation",d.GetLoginHistory="GetLoginHistory",d.GetMyLoginHistory="GetMyLoginHistory",d.getFolderNameForApiMethod=e=>{switch(e){case u.calendar:return"Calendars";case u.journal:return"Journals";case u.marketing:return"MarketingCampaigns";case u.marketingList:return"MarketingListsRecords";case u.revisionsHistory:return"RevisionHistoryRecords";case u.vacation:return"Vacations";case u.workflowHistory:return"WorkflowHistoryRecords";default:return e}},d.getGetFolderNameByItemGuidsMethodName=e=>`Get${d.getFolderNameForApiMethod(e)}ByItemGuids`,d.getGetFolderNameMethodName=e=>`Get${d.getFolderNameForApiMethod(e)}`,d.getSearchFolderNameMethodName=e=>`Search${d.getFolderNameForApiMethod(e)}`;class m{constructor(e,t,r,n,o,s){if(this.invalidateSessionId=(e,t)=>{t&&t()},this.getSessionId=(e,t)=>{e.callWithoutSession(d.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 p{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 h{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}}h.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"),h.callTokenEndpoint(e,a,i)},h.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"),h.callTokenEndpoint(e,s,o)},h.getWebServiceUrl=e=>{const r=e.split(".");if(2!==r.length)throw new Error("Invalid token supplied");return t.decode(r[1])},h.getUserName=e=>h.decodeAccessToken(e).username,h.decodeAccessToken=e=>r(e),h.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 y extends Error{constructor(e,t){super(),this.returnCode=e,this.message=t}}class C{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(d.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 y(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 f extends C{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)=>{h.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 g extends Error{constructor(e,t,r){super(t),this.statusCode=e,this.message=t,this.responseData=r}}g.from=e=>{var t;const r=null===(t=e.data)||void 0===t?void 0:t.Description,n="string"==typeof r&&r?r:e.statusText;return new g(e.status,n,e.data)};class P{}P.stringifyError=e=>JSON.stringify(e,P.replaceErrors),P.replaceErrors=(e,t)=>{if(t instanceof Error){const e={};return Object.getOwnPropertyNames(t).forEach(r=>{e[r]=t[r]}),e}return t};class T{}T.openItemLinkRegEx=/https:\/\/open\.eway-crm\.(dev|com)\/\?[-a-zA-Z0-9()@:%_+.~#?&/=]*/gi,T.itemParamName="l",T.openLinkDomainLength=7,T.getOpenLinkDomain=e=>e?"open.eway-crm.dev":"open.eway-crm.com",T.isOpenItemLinkInText=e=>T.openItemLinkRegEx.test(e),T.getOpenLinksFromString=e=>e.match(T.openItemLinkRegEx),T.getItemLinksFromOpenLinks=e=>{try{return e.map(e=>new URL(e).searchParams.get(T.itemParamName))}catch(e){console.error("Invalid string passed for cretaing url while getting links from open links",e)}},T.getItemInfoFromLink=e=>{const r=t.decode(e).substring(T.openLinkDomainLength).split("/");if(Object.keys(u).some(e=>u[e]===r[0])&&r[1]){return{folderName:r[0],itemGuid:r[1]}}},T.getAllItemsFromTextWithLinks=e=>{const t={};if(T.isOpenItemLinkInText(e)){const r=T.getOpenLinksFromString(e);if(!r)return;const n=T.getItemLinksFromOpenLinks(r);null==n||n.forEach(e=>{var r;if(!e)return;const n=T.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 S{constructor(r,n,o,i){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,r,n,o)=>{const s=t.encode(this.baseUri);let i="eway://"+r;n&&(i+="/"+(null==n?void 0:n.toLowerCase()));const a=T.getOpenLinkDomain(e);i=t.encode(i);let l="https://"+a+"/?ws="+s+`&${T.itemParamName}=`+i;return o&&(l+="&n="+encodeURIComponent(o)),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 c=()=>{this.sessionHandler.getSessionId(this,e=>{this.sessionId=e,this.callCustomUploadMethod(t,r,n,o,s,i,a)})},u=this.sessionId;if(!u)return void c();const d=new URLSearchParams(r),m=`${this.svcUri}/${n}?sessionId=${this.sessionId}&${d.toString()}`,p=e.post(m,t,a);S.handleCallPromise(p,o,e=>{if(e.ReturnCode===l.rcBadSession)return this.sessionId=null,void this.sessionHandler.invalidateSessionId(u,c);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+": "+P.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},d.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,i)=>{o||(o=s.post);const a=()=>{this.sessionHandler.getSessionId(this,s=>{this.sessionId=s,this.callMethod(e,t,r,n,o,i)})},c=this.sessionId;if(!c)return void a();t.sessionId=c;const u=e!==d.logOut?r:e=>{this.sessionId=null,r(e)};this.callWithoutSession(e,t,u,r=>{if(r.ReturnCode!==l.rcBadSession||(this.sessionId=null,e===d.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(c,a)},null,o,i)},this.callWithoutSession=(t,r,n,o,i,a,l)=>{var c;a||(a=s.post);const u=this.svcUri+"/"+t;let m,p;switch(i&&(m={headers:i,withCredentials:null!==(c=this.supportGetItemPreviewMethod)&&void 0!==c?c:t===d.logIn}),a){case s.get:if(r)throw new Error("Calling api get method with data specified does not make any sense.");p=e.get(u,m);break;case s.post:p=e.post(u,r,m);break;default:throw new Error(`Unknown http method '${a}'.`)}S.handleCallPromise(p,n,o,e=>{if(l)try{l(e)}catch(e){if(!this.errorCallback)throw e;this.errorCallback(e,r)}else{const t=new Error("Unhandled connection error when calling "+u+": "+P.stringifyError(e));if(!this.errorCallback)throw t;this.errorCallback(t,r)}})},this.getItemPreviewGetMethodUrl=(e,t,r)=>this.svcUri+"/"+d.getItemPreview+"?folderName="+encodeURIComponent(e)+"&itemGuid="+encodeURIComponent(t)+(r||0===r?"&itemVersion="+encodeURIComponent(r.toString()):""),this.getEmailAttachmentGetMethodUrl=(e,t)=>this.svcUri+"/"+d.getEmailAttachment+"?itemGuid="+encodeURIComponent(e)+"&contentId="+encodeURIComponent(t),this.getAllEmailAttachmentsZipGetMethodUrl=e=>this.svcUri+"/"+d.getAllEmailAttachments+"?itemGuid="+encodeURIComponent(e),this.getBinaryAttachmentGetMethodUrl=(e,t)=>"number"==typeof t?this.svcUri+"/"+d.getBinaryAttachment+"?itemGuid="+encodeURIComponent(e)+`&revision=${t}`:this.svcUri+"/"+d.getBinaryAttachmentLatestRevision+"?itemGuid="+encodeURIComponent(e),this.getTransformItemMethodUrl=(e,t,r,n,o)=>`${this.svcUri}/${d.transformItem}?itemGuid=${encodeURIComponent(e)}&itemFolderName=${encodeURIComponent(t)}&transformationGuid=${encodeURIComponent(r)}&outputFormat=${n}${o?`&lang=${encodeURIComponent(o)}`:""}`,this.getXsltTransformationDefinitionMethodUrl=e=>`${this.svcUri}/${d.getXsltTransormationDefinition}?itemGuid=${encodeURIComponent(e)}`,this.getActiveSessionId=()=>this.sessionId,this.setActiveSessionId=e=>{this.sessionId=e},!r)throw new Error("The argument 'apiServiceUri' cannot be empty.");if(r.length<8||"https://"!==r.substr(0,8).toLowerCase()&&"http://"!==r.substr(0,7).toLowerCase())throw new Error("Api service uri must start either with 'https://' or with 'http://'.");if(".svc"===r.substr(r.length-4).toLowerCase()){this.svcUri=r;const e=["/API.svc","/InsecureAPI.svc","/WcfService/Service.svc"].find(e=>e.toLowerCase()===r.substr(r.length-e.length).toLowerCase())||"";this.baseUri=r.substr(0,r.length-e.length)}else this.baseUri=S.normalizeWsUrl(r)||r,"https://"===r.substr(0,8).toLowerCase()?this.svcUri=this.baseUri+"/API.svc":this.svcUri=this.baseUri+"/InsecureAPI.svc";this.sessionHandler=n,this.errorCallback=o,this.sessionId=null,this.supportGetItemPreviewMethod=null!=i&&i}get supportsGetItemPreviewMethod(){return this.supportGetItemPreviewMethod}static create(e,t,r,n,o,s,i,a){return new S(e,new m(t,r,n,o,s,i),i,a)}static createAnonymous(e,t){return new S(e,new p,t)}static createUsingOAuth(e,t,r,n,o,s,i,a,l,c){return new S(e,new f(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("eway-crm.com"),n.add("eway-crm.us"),t&&(n.add("eway-crm.dev"),n.add("localhost")),n.has(S.getRootDomain(r.hostname))}static getRootDomain(e){const t=e.split(".");return!t||t.length<=2?e:t.slice(-2).join(".")}get wsUrl(){return this.baseUri}static handleCallPromise(e,t,r,n){e.then(e=>{200===e.status?e.data.ReturnCode===l.rcSuccess?t(e.data):r(e.data):n(g.from(e))}).catch(e=>{e.response?n(g.from(e.response)):n(e)})}}class E{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,E.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(g.from(e))}).catch(e=>{e.response?i(g.from(e.response)):i(e)})}}const A=e=>({url:e.ServiceUrl,token:e.Token});class I{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 E("ObtainCommonDataApiAccessToken",s.get,!1,"InvalidCommonDataToken",A,e,t)}}class v{}v.acceptableBackwardWorkReportDays="AcceptableBackwardWorkReportDays",v.adminAppInactiveLogoutTime="AdminAppInactiveLogoutTime",v.allowChangeGoodsInCartListPrice="AllowChangeGoodsInCartListPrice",v.applyGeneralDataProtectionRules="ApplyGeneralDataProtectionRules",v.automaticallyCreateJournalAfterCallDuration="AutomaticallyCreateJournalAfterCallDuration",v.bonusesCompletedState="BonusesCompletedState",v.cartInvoicedState="CartInvoicedState",v.cartOrderCanceledState="CartOrderCanceledState",v.cartOrderInProcessState="CartOrderInProcessState",v.cartOrderProcessedState="CartOrderProcessedState",v.cartPaidState="CartPaidState",v.cartProposalInProcessState="CartProposalInProcessState",v.cartProposalProcessedState="CartProposalProcessedState",v.cartSalesVoucherIssuedState="CartSalesVoucherIssuedState",v.cartToBeInvoicedState="CartToBeInvoicedState",v.cartVoidedState="CartVoidedState",v.clickToCallScheme="ClickToCallScheme",v.companyDuplicityCheckEnabled="CompanyDuplicityCheckEnabled",v.completedStateName="CompletedStateName",v.contactDuplicityCheckEnabled="ContactDuplicityCheckEnabled",v.createCompanyWhileImportingContactFromOutlook="CreateCompanyWhileImportingContactFromOutlook",v.defaultProposalValidityPeriod="DefaultProposalValidityPeriod",v.enableContactsTwoWaySyncWithM365="EnableContactsTwoWaySyncWithM365",v.deadStateName="DeadStateName",v.enableCompaniesSyncIntoMobileDeviceContacts="EnableCompaniesSyncIntoMobileDeviceContacts",v.enableContactsSyncIntoMobileDevice="EnableContactsSyncIntoMobileDevice",v.enableLeadsSyncIntoMobileDeviceContacts="EnableLeadsSyncIntoMobileDeviceContacts",v.enableLlamaAiFeatures="EnableLlamaAiFeatures",v.enableUsersSyncIntoMobileDeviceContacts="EnableUsersSyncIntoMobileDeviceContacts",v.emailsActiveProjectsLeadsFilter="EmailsActiveProjectsLeadsFilter",v.trackToAddressesOnly="TrackToAddressesOnly",v.exchangeRatesAdminGroupName="ExchangeRatesAdminGroupName",v.forcedEmailTrackingGroups="ForcedEmailTrackingGroups",v.ignoreEmailsFromDomainsOnEmailsTracking="IgnoreEmailsFromDomainsOnEmailsTracking",v.trackEmailsFromDomains="TrackEmailsFromDomains",v.groupsForAllUnpaidInvoicesNotification="GroupsForAllUnpaidInvoicesNotification",v.itemPreviewMaxHeight="ItemPreviewMaxHeight",v.lastActivityAttributes="LastActivityAttributes",v.leadsCompletedState="LeadsCompletedState",v.leadDeadlineAlertGroups="LeadDeadlineAlertGroups",v.leadsDeadState="LeadsDeadState",v.marketingCompletedState="MarketingCompletedState",v.marketingDeadState="MarketingDeadState",v.minimumPasswordLength="MinimumPasswordLength",v.nextStepAttributes="NextStepAttributes",v.notifyAboutInvoicedInvoiceInPohodaGroup="NotifyAboutInvoicedInvoiceInPohodaGroup",v.notifyAboutLeadsDeadline="NotifyAboutLeadsDeadline",v.notifyAboutPaidInvoiceInPohodaGroup="NotifyAboutPaidInvoiceInPohodaGroup",v.notifyAboutProjectDeadline="NotifyAboutProjectDeadline",v.numberOfDecimalPlaces="NumberOfDecimalPlaces",v.openFileByDefault="OpenFileByDefault",v.phoneListTaskSolverGroup="PhoneListTaskSolverGroup",v.projectDeadlineAlert="ProjectDeadlineAlert",v.serverUpdateProgressNotificationGroup="ServerUpdateProgressNotificationGroup",v.sumarizeCartsPricesOnLeads="SumarizeCartsPricesOnLeads",v.sumarizeCartsPricesOnProjects="SumarizeCartsPricesOnProjects",v.sumarizePeopleExpensesOnProjects="SumarizePeopleExpensesOnProjects",v.systemHealthNotificationGroup="SystemHealthNotificationGroup",v.tasksCompletedState="TasksCompletedState",v.tasksDeferredState="TasksDeferredState",v.tasksInProgressState="TasksInProgressState",v.tasksNotStartedState="TasksNotStartedState",v.tasksWaitOnSomeoneElseState="TasksWaitOnSomeoneElseState",v.trackDocumentVersions="TrackDocumentVersions",v.vacationCompletedState="VacationCompletedState",v.workReportApprovedState="WorkReportApprovedState",v.defaultLanguage="DefaultLanguage",v.defaultCurrency="DefaultCurrency",v.myCompanyCountry="MyCompanyCountry",v.myCompanyName="MyCompanyName",v.myCompanyStreet="MyCompanyStreet",v.myCompanyCity="MyCompanyCity",v.myCompanyState="MyCompanyState",v.myCompanyZip="MyCompanyZIP",v.myCompanyId="MyCompanyID",v.myCompanyVat="MyCompanyVAT",v.mergeGoodsInCart="MergeGoodsInCart",v.cartRefreshLogic="CartRefreshLogic",v.goodsDefaultQuantity="GoodsDefaultQuantity",v.goodsDefaultVAT="GoodsDefaultVAT",v.goodsDefaultVATIncluded="GoodsDefaultVATIncluded",v.recalculateOnListPriceChange="RecalculateOnListPriceChange",v.recalculateOnPurchasePriceChange="RecalculateOnPurchasePriceChange";class k{}k.administrator="Administrator",k.everyone="Everyone",k.system="System",k.systemHealthNotification="SystemHealthNotification";class D{}D.ServerCommon={Server_ID:"Server_ID",Server_ItemCreated:"Server_ItemCreated",Server_ItemChanged:"Server_ItemChanged"},D.Common={CreatedByGUID:"CreatedByGUID",CurrencyEn:"CurrencyEn",DefaultCurrencySuffix:"DefaultCurrency",FileAs:"FileAs",ItemCreated:"ItemCreated",ItemChanged:"ItemChanged",ItemGUID:"ItemGUID",ItemVersion:"ItemVersion",ModifiedByGUID:"ModifiedByGUID",OwnerGUID:"OwnerGUID",ParentCurrencySuffix:"ParentCurrency",Picture:"Picture"},D.Calendar={Location:"Location",StartDate:"StartDate",EndDate:"EndDate",AllDayEvent:"AllDayEvent",SuperiorItem:"SuperiorItem",BusyStatus:"BusyStatus",GraphID:"GraphID",GraphCalendarID:"GraphCalendarID",Note:"Note"},D.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"},D.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"},D.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"},D.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:D.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"},D.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"},D.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"},D.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"},D.Goods=Object.assign(Object.assign({},D.GoodsBase),{PriceListGroupGUID:"PriceListGroupGUID",InventoryQuantity:"InventoryQuantity"}),D.GoodsInCart=Object.assign(Object.assign({},D.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"}),D.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"},D.Vacation={StartDate:"StartDate",EndDate:"EndDate",User:"User",Duration:"Duration",Place:"Place",Note:"Note",AllDay:"AllDay",TypeEn:"TypeEn",StateEn:"StateEn",IsPrivate:"Private"},D.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"},D.Projects={HumanID:"HID",FileAs:"FileAs",ProjectName:"ProjectName",ProjectOriginEn:"ProjectOriginEn",TypeEn:"TypeEn",StateEn:"StateEn",PaymentTypeEn:"PaymentTypeEn",ProjectStart:"ProjectStart",ProjectRealEnd:"ProjectRealEnd",EstimatedEnd:"ProjectEnd",CurrencyEn:D.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"},D.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"},D.Training={TitleEn:"TitleEn"},D.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"},D.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"},D.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"},D.PriceListGroups={Note:"Note"},D.Prices={SalePriceGUID:"SalePriceGUID",GoodsItemGUID:"GoodsItemGUID",Price:"Price",CurrencyEn:"CurrencyEn"},D.SalePrices={Note:"Note",Discount:"Discount",TypeEn:"TypeEn",StateEn:"StateEn",PrevStateEn:"PrevStateEn"},D.XsltTransformations={LangCode:"LangCode",Definition:"Definition",Namespace:"Namespace",ObjectTypeID:"ObjectTypeID",TransformationVersion:"TransformationVersion"},D.XsltTransformationsModels={ObjectTypeID:"ObjectTypeID",TransformationGUID:"TransformationGUID",ItemTypeGUID:"ItemTypeGUID"},D.allTypeEnNames=["TypeEn",D.Documents.DocTypeEn,D.WorkReports.WorkReportEn,"TitleEn"],D.getFolderFileAs=e=>{switch(e){case u.leads:return D.Leads.FileAs;case u.projects:return D.Projects.ProjectName;case u.documents:return D.Documents.DocName;case u.companies:return D.Companies.CompanyName;case u.contacts:case u.users:return D.Common.FileAs;case u.emails:return D.Emails.Subject;case u.journal:return D.Journal.FileAs;case u.tasks:return D.Tasks.Subject;case u.workReports:return D.WorkReports.Subject;case u.vacation:return D.Vacation.TypeEn;case u.carts:case u.goods:case u.goodsInCart:return D.Common.FileAs;case u.groups:return D.Groups.GroupName;case u.xsltTransformations:return D.Common.FileAs;default:return console.warn(`FileAs col name not defined for folderName ${e}`),D.Common.FileAs}};class b{}b.general="GENERAL",b.group="GROUP",b.contactPerson="CONTACTPERSON",b.contact="CONTACT",b.customer="CUSTOMER",b.company="COMPANY",b.outlookProject="OUTLOOKPROJECT",b.supervisor="SUPERVISOR",b.projectOrigin="PROJECT_ORIGIN",b.cart="CART",b.goodsInCart="GOODSINCART",b.superiorItem="SUPERIORITEM",b.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 F{}F.all="All",F.own="Own",F.readonly="Readonly",F.invisible="Invisible",F.none="None";class O{}var N,R,L,x;O.mandatory="Mandatory",O.optional="Optional",O.unique="Unique",O.none="None",function(e){e.Free="Free",e.Basic="Basic",e.Professional="Professional",e.Enterprise="Enterprise"}(N||(N={})),function(e){e.ContactsAndCompanies="ContactsAndCompanies",e.Sales="Sales",e.Projects="Projects",e.Marketing="Marketing"}(R||(R={})),function(e){e[e.Negative=0]="Negative",e[e.Neutral=1]="Neutral",e[e.Positive=2]="Positive"}(L||(L={}));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 U{}U.customAdditionalFieldsCount="CustomAdditionalFieldsCount",U.customEnabledAdvancedWorkflowsCount="CustomEnabledAdvancedWorkflowsCount",U.customEnabledBasicWorkflowsCount="CustomEnabledBasicWorkflowsCount",U.customMandatoryFieldsCount="CustomMandatoryFieldsCount",U.customOptionalFieldsCount="CustomOptionalFieldsCount",U.customReadonlyFieldsCount="CustomReadonlyFieldsCount",U.customUniqueFieldsCount="CustomUniqueFieldsCount",U.customVisibleTypesCount="CustomVisibleTypesCount",U.visibleCurrenciesCount="VisibleCurrenciesCount";class G{}G.contactsAutomaticSynchronizationWithOutlook="ContactsAutomaticSynchronizationWithOutlook",G.contactsSynchronizationWithOutlook="ContactsSynchronizationWithOutlook",G.contactsSynchronizationWithAndroid="ContactsSynchronizationWithAndroid",G.documentsRevisions="DocumentsRevisions",G.wordAddin="WordAddin",G.excelAddin="ExcelAddin",G.tasksReminders="TasksReminders",G.tasksRecurrentTasks="TasksRecurrentTasks",G.tasksSubtasks="TasksSubtasks",G.tasksSynchronizationWithOutlook="TasksSynchronizationWithOutlook",G.calendarSynchronizationWithOutlook="CalendarSynchronizationWithOutlook",G.emailsManualTracking="EmailsManualTracking",G.emailsAutomaticTracking="EmailsAutomaticTracking",G.emailSummaryAndSentimentToneFromAi="EmailSummaryAndSentimentToneFromAi",G.convertEmailToContact="ConvertEmailToContact",G.convertEmailToDeal="ConvertEmailToDeal",G.convertEmailToProject="ConvertEmailToProject",G.convertEmailToTask="ConvertEmailToTask",G.convertFromSuggestedContact="ConvertFromSuggestedContact",G.gravatarIntegration="GravatarIntegration",G.logoboxIntegration="LogoboxIntegration",G.companiesBussinesRegisterApiIntegration="CompaniesBussinesRegisterApiIntegration",G.duplicityChecker="DuplicityChecker",G.nextStepAndLastActivityCustomization="NextStepAndLastActivityCustomization",G.subProjects="SubProjects",G.resourceAndPlanning="ResourceAndPlanning",G.professionalEmailCampaigns="ProfessionalEmailCampaigns",G.professionalEmailCampaignsAdvancedStatistics="ProfessionalEmailCampaignsAdvancedStatistics",G.wordEmailMerge="WordEmailMerge",G.printLabels="PrintLabels",G.printEnvelopes="PrintEnvelopes",G.userViews="UserViews",G.sharedUserViews="SharedUserViews",G.gridRowSummary="GridRowSummary",G.gridConditionalFormating="GridConditionalFormating",G.multipleCurrencies="MultipleCurrencies",G.historyTracking="HistoryTracking",G.privateItems="PrivateItems",G.itemTypes="ItemTypes",G.formLayoutCustomization="FormLayoutCustomization",G.workflowBasicDefinitions="WorkflowBasicDefinitions",G.workflowAdvancedDefinitions="WorkflowAdvancedDefinitions",G.workflowAdvancedDefinitionsRules="WorkflowAdvancedDefinitionsRules",G.workflowAdvancedDefinitionsActions="WorkflowAdvancedDefinitionsActions",G.workflowGroupLevelActions="WorkflowGroupLevelActions",G.customFields="CustomFields",G.importantFields="ImportantFields",G.mandatoryFields="MandatoryFields",G.uniqueFields="UniqueFields",G.readOnlyFields="ReadOnlyFields",G.transformationCustomTemplates="TransformationCustomTemplates",G.userRoles="UserRoles",G.modulePermissions="ModulePermissions",G.columnPermissions="ColumnPermissions",G.commonDataAPI="CommonDataAPI",G.eWayCrmAPI="eWayCrmAPI",G.threeCXIntegration="ThreeCXIntegration",G.tapiIntegration="TapiIntegration",G.pohodaIntegration="PohodaIntegration",G.pohodaSynchronizationIntervalCustomization="PohodaSynchronizationIntervalCustomization",G.pohodaSynchronizationFieldMappingCustomization="PohodaSynchronizationFieldMappingCustomization",G.quickBooksIntegration="QuickBooksIntegration",G.shareByTeams="ShareByTeams",G.convertEmailToContactWithDataFromAi="ConvertEmailToContactWithDataFromAi",G.convertEmailToDealWithDataFromAi="ConvertEmailToDealWithDataFromAi",G.convertEmailToProjectWithDataFromAi="ConvertEmailToProjectWithDataFromAi",G.xsltTransformationsAdministrationForCaCAndRest="XsltTransformationsAdministrationForCaCAndRest",G.xsltTransformationsAdministrationForSales="XsltTransformationsAdministrationForSales",G.xsltTransformationsAdministrationForProjects="XsltTransformationsAdministrationForProjects",G.xsltTransformationsAdministrationForMarketing="XsltTransformationsAdministrationForMarketing",function(e){e.UnpaidImportantInvoices="UnpaidImportantInvoices",e.UncollectableSubscriptionPayment="UncollectableSubscriptionPayment",e.UncollectableSubscriptionPaymentWithExpiredCard="UncollectableSubscriptionPaymentWithExpiredCard",e.StandardSubscriptionPeriod="StandardSubscriptionPeriod"}(x||(x={}));var _,V=x;!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(e,t,">=")||n(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={[u.relations]:0,[u.unifiedRelations]:1,[u.users]:2,[u.groups]:3,[u.enumTypes]:4,[u.enumValues]:5,[u.additionalFields]:6};var z,Q,$,q,J;!function(e){e.Version75="7.5",e.Version76="7.6",e.Version77="7.7",e.Version80="8.0",e.Version81="8.1",e.Version82="8.2",e.Version83="8.3",e.Version90="9.0",e.Version91="9.1",e.Version92="9.2",e.Version93="9.3",e.Version94="9.4",e.Version100="10.0",e.Version101="10.1"}(z||(z={}));class X extends B{}X.is75OrLater=e=>B.supportsFeaturesOf(e,z.Version75),X.is76OrLater=e=>X.supportsFeaturesOf(e,z.Version76),X.is77OrLater=e=>X.supportsFeaturesOf(e,z.Version77),X.is80OrLater=e=>X.supportsFeaturesOf(e,z.Version80),X.is81OrLater=e=>X.supportsFeaturesOf(e,z.Version81),X.is82OrLater=e=>X.supportsFeaturesOf(e,z.Version82),X.is83OrLater=e=>X.supportsFeaturesOf(e,z.Version83),X.is90OrLater=e=>X.supportsFeaturesOf(e,z.Version90),X.is91OrLater=e=>X.supportsFeaturesOf(e,z.Version91),X.is92OrLater=e=>X.supportsFeaturesOf(e,z.Version92),X.is93OrLater=e=>X.supportsFeaturesOf(e,z.Version93),X.is94OrLater=e=>X.supportsFeaturesOf(e,z.Version94),X.is100OrLater=e=>X.supportsFeaturesOf(e,z.Version100),X.is101OrLater=e=>X.supportsFeaturesOf(e,z.Version101),X.isFeatureSupported=(e,t)=>X.supportsFeaturesOf(e,t);class K{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!==t&&(n.IsToParentDirection=t),r&&(n.ChildrenFolderNames=r),n}}class Y{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]}}}Y.column=e=>({__type:"Column:#EQ",Source:K.mainTable(),Name:e}),Y.multiSelectComboColumnLegacy=(e,t,r)=>({__type:"Column:#EQ",Source:K.mainTable(),Name:"ItemGUID",Transformation:`[dbo].[GetConcatenatedEnumValuesRelationsValues]({0}, '${e}', '${t}')`,Alias:null!=r?r:e}),Y.multiSelectComboColumn=(e,t,r,n,o)=>{if(!X.is77OrLater(e))return Y.multiSelectComboColumnLegacy(r,n,o);return{__type:"Column:#EQ",Source:K.mainTable(),Name:"ItemGUID",Transformation:`[dbo].[GetConcatenatedEnumValuesRelationsValues_WithObjectTypeID]({0}, dbo.GetObjectTypeID('${t}'), '${r}', '${n}')`,Alias:null!=o?o:r}},Y.joinColumn=(e,t,r,n,o)=>Y.joinColumnFromKey(e,Y.column(t),r,n,o),Y.joinColumnFromKey=(e,t,r,n,o)=>{const s={__type:"Column:#EQ",Source:K.join(e,t,o),Name:r};return n&&(s.Alias=n),s},Y.singleVariatedColumn=(e,t,r)=>Y.variatedColumn([Y.columnVariation(e,t)],r),Y.variatedColumn=(e,t)=>{const r={__type:"VariatedColumn:#EQ",Source:K.mainTable(),Variations:e};return t&&(r.Alias=t),r},Y.columnVariation=(e,t,r)=>{const n={FolderName:t,Field:{__type:"Column:#EQ",Source:K.mainTable(),Name:e}};return r&&(n.Field.Transformation=r),n},Y.joinColumnVariation=(e,t,r,n)=>({FolderName:e,Field:{__type:"Column:#EQ",Source:K.join(t,Y.column(r)),Name:n}}),Y.relationColumnVariation=(e,t,r,n)=>({FolderName:e,Field:{__type:"Column:#EQ",Source:K.relation(r,t,1),Name:n}}),Y.relatedColumn=(e,t,r,n)=>{const o={__type:"Column:#EQ",Source:K.relation(t,e,1),Name:r};return n&&(o.Alias=n),o},Y.relatedSubstituableColumn=(e,t,r,n,o)=>{const s={__type:"SubstituableColumn:#EQ",Source:K.relation(t,e,1),Name:r,Substitute:n};return o&&(s.Alias=o),s},Y.relatedColumnFolderNameToken=(e,t,r)=>({__type:"Token:#EQ",Source:K.relation(t,e,1),TypeName:"ItemType",Alias:r}),Y.hubRelationColumn=(e,t)=>({__type:"Column:#EQ",Source:K.hubRelation(t),Name:e}),Y.aggregateColumn=(e,t,r)=>({__type:"AggregateColumn:#EQ",FunctionName:e,Source:t.Source,AggregatedField:t,Alias:r}),Y.folderNameToken=e=>({__type:"Token:#EQ",Source:K.mainTable(),TypeName:"ItemType",Alias:null!=e?e:"FolderName"}),Y.equalsFilterExpression=(e,t)=>({__type:"EqualsFilterExpressionPredicate:#EQ",Field:e,Value:t}),Y.notEqualsExpression=(e,t)=>({__type:"NotFilterExpression:#EQ",Child:Y.equalsFilterExpression(e,t)}),Y.andFilterExpression=e=>({__type:"AndFilterExpressionOperator:#EQ",Children:e}),Y.orFilterExpression=e=>({__type:"OrFilterExpressionOperator:#EQ",Children:e}),Y.lessFilterExpression=(e,t)=>({__type:"LessFilterExpressionPredicate:#EQ",Field:e,Value:t}),Y.lessOrEqualFilterExpression=(e,t)=>({__type:"LessOrEqualFilterExpressionPredicate:#EQ",Field:e,Value:t}),Y.greaterFilterExpression=(e,t)=>({__type:"GreaterFilterExpressionPredicate:#EQ",Field:e,Value:t}),Y.greaterOrEqualFilterExpression=(e,t)=>({__type:"GreaterOrEqualFilterExpressionPredicate:#EQ",Field:e,Value:t}),Y.likeFilterExpression=(e,t)=>({__type:"LikeFilterExpressionPredicate:#EQ",Field:e,Value:`%${t}%`}),Y.inFilterExpression=(e,t)=>({__type:"InFilterExpressionPredicate:#EQ",Field:e,Value:t}),Y.relatedToExpression=(e,t)=>({__type:"RelatedToFilterExpressionPredicate:#EQ",Value:e,RelationType:t}),Y.isNullOrEmptyFilterExpression=e=>Y.orFilterExpression([Y.equalsFilterExpression(Y.column(e),null),Y.equalsFilterExpression(Y.column(e),"")]);class Z{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}}class ee{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 te(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())})}ee.isValid=e=>e instanceof Date&&!isNaN(e.getTime()),ee.areDaysEqual=(e,t)=>{const r=ee.clearTime(e),n=ee.clearTime(t);return r.getTime()===n.getTime()},ee.areTimesEqual=(e,t)=>e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes(),ee.areDatesEqual=(e,t)=>!!e&&!!t&&ee.areDaysEqual(e,t)&&ee.areTimesEqual(e,t),ee.clearTime=e=>{const t=new Date(e);return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t},ee.isWithoutTime=e=>0===e.getHours()&&0===e.getMinutes()&&0===e.getSeconds(),ee.getFormattedSqlDateTime=e=>e.toISOString().slice(0,19).replace("T"," "),ee.getRfcWithoutTimezone=e=>e.slice(0,19),function(e){e.OpenXmlDocx="OpenXmlDocx",e.Pdf="Pdf",e.WordMlXml="WordMlXml"}(Q||(Q={})),function(e){e.Manual="Manual",e.SuggestedContact="SuggestedContact"}($||($={})),"function"==typeof SuppressedError&&SuppressedError;class re{constructor(e,t,r,n,o){let s;if(this.sessionId=null,this.isAdmin=null,this.loginResponse=null,!(r||(s=h.decodeAccessToken(t),r=s.ws)))throw new Error("Failed to get web service URL from JWT");if(!(n||(s||(s=h.decodeAccessToken(t)),n=s.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,this.sessionId=o||null}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}getSessionId(){return this.sessionId}login(){return te(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)||r.statusText}`);this.sessionId=null==n?void 0:n.SessionId,this.isAdmin=null==n?void 0:n.IsAdmin,this.loginResponse=n})}logout(){return te(this,void 0,void 0,function*(){if(!this.sessionId)throw new Error("Session ID is not set. Please call login() first.");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")})}validateSession(){return te(this,void 0,void 0,function*(){if(!this.sessionId)throw new Error("Session ID is not set. Please call login() first.");const e=new Request(`${this.wsUrl}/${this.endpoint}/IsSessionValid`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:this.sessionId})}),t=yield fetch(e),r=yield t.json();if("rcSuccess"!==r.ReturnCode)throw new Error("Failed to validate session");return r.Result||!1})}getObjectTypes(){return te(this,void 0,void 0,function*(){return(yield this.callMethod("GetObjectTypes",{})).Data})}getLicense(){return te(this,void 0,void 0,function*(){return(yield this.callMethod("GetLicense",{})).Datum})}getClientVersionId(e){return te(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 te(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 te(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 te(this,arguments,void 0,function*(e,t,r="POST"){if(!this.sessionId)throw new Error("Session ID is not set. Please call login() 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 te(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})}}class ne{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 u.contacts:{const e=this.baseItem;return e.Email1Address||e.Email2Address||e.Email3Address}case u.leads:return this.baseItem.Email;case u.companies:return this.baseItem.Email;case u.users:{const e=this.baseItem;return e.Email1Address||e.Email2Address}default:return null}}getInitials(){switch(this.folderName){case u.contacts:{const e=this.baseItem;return this.getInitialsInternal(e.FirstName,e.LastName)}case u.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 u.contacts:{const e=this.baseItem;return e.ProfilePicture?{imageData:e.ProfilePicture,width:e.ProfilePictureWidth||0,height:e.ProfilePictureHeight||0}:null}case u.users:{const e=this.baseItem;return e.ProfilePicture?{imageData:e.ProfilePicture,width:e.ProfilePictureWidth||0,height:e.ProfilePictureHeight||0}:null}default:return null}}}!function(e){e.Readonly="Readonly",e.VisibleRankDefaultOnly="VisibleRankDefaultOnly",e.Editable="Editable"}(q||(q={})),function(e){e.Success="Success",e.Failure="Failed",e.FailureDuplicityFound="Failed_DuplicityFound",e.FailureItemAlreadyRemoved="Failed_ItemAlreadyRemoved",e.FailureColumnsLockedWFAction="Failed_ColumnsLocked",e.FailureItemLockedWFAction="Failed_ItemLocked",e.FailureLicenseLimitReached="Failed_LicenseLimitReached",e.FailureInssuficientModulePermission="Failed_InsufficientModulePermission",e.FailureInssuficientColumnsPermission="Failed_InsufficientColumnsPermission"}(J||(J={})),a.polyfill();export{S as ApiConnectionAsNonDefaultExport,re as ApiFetchClient,d as ApiMethods,O as ColumnPermissionMandatoryRules,F as ColumnPermissionPermissionRules,I as CommonDataConnection,U as CustomizationStatsItemKeys,ee as DateHelper,ne as EWItem,N as Edition,$ as EmailConversionSource,q as EnumTypeEditMode,c as EnumTypes,P as ErrorHelper,V as ExpirationReason,R as Feature,D as FieldNames,W as FieldTypes,u as FolderNames,M as Functionality,v as GlobalSettingsNames,k as GroupNames,s as HttpMethod,g as HttpRequestError,J as ImportResult,j as LicenseKeyInvoiceSeverity,G as LicenseRestrictionKeys,h as OAuthHelper,f as OAuthSessionHandler,C as OAuthSessionHandlerBase,H as ObjectTypeIds,T as OpenItemLinkHelper,Y as QueryHelper,w as RelationTypeIds,b as RelationTypes,l as ReturnCodes,L as SentimentTone,Z as StringHelper,E as TokenizedServiceConnection,Q as TransformItemFormats,z as Version,X as VersionHelper,B as VersionHelperBase,S as default};
8
+ */class l{}l.rcSuccess="rcSuccess",l.rcBadSession="rcBadSession",l.rcDuplicateContact="rcDuplicateContact",l.rcWebServiceMoved="rcWebServiceMoved",l.rcAccessDenied="rcAccessDenied",l.rcLoginUserNameChanged="rcLoginUserNameChanged",l.rcLicenseExpired="rcLicenseExpired",l.rcBadAccessToken="rcBadAccessToken",l.rcExchangeWebServicesAccountAuthorizationRequired="rcExchangeWebServicesAccountAuthorizationRequired",l.rcGraphAuthorizationRequired="rcGraphAuthorizationRequired",l.rcConsentRequired="rcConsentRequired",function(e){e.get="get",e.post="post"}(o||(o={}));var c,u={exports:{}};c=u,function(e,t){c.exports=t()}(0,function(){var e=[],t=[],r={},n={},s={};function o(e){return"string"==typeof e?new RegExp("^"+e+"$","i"):e}function i(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function a(e,t){return e.replace(t[0],function(r,n){var s,o,a=(s=t[1],o=arguments,s.replace(/\$(\d{1,2})/g,function(e,t){return o[t]||""}));return i(""===r?e[n-1]:r,a)})}function l(e,t,n){if(!e.length||r.hasOwnProperty(e))return t;for(var s=n.length;s--;){var o=n[s];if(o[0].test(t))return a(t,o)}return t}function c(e,t,r){return function(n){var s=n.toLowerCase();return t.hasOwnProperty(s)?i(n,s):e.hasOwnProperty(s)?i(n,e[s]):l(s,n,r)}}function u(e,t,r,n){return function(n){var s=n.toLowerCase();return!!t.hasOwnProperty(s)||!e.hasOwnProperty(s)&&l(s,s,r)===s}}function d(e,t,r){return(r?t+" ":"")+(1===t?d.singular(e):d.plural(e))}return d.plural=c(s,n,e),d.isPlural=u(s,n,e),d.singular=c(n,s,t),d.isSingular=u(n,s,t),d.addPluralRule=function(t,r){e.push([o(t),r])},d.addSingularRule=function(e,r){t.push([o(e),r])},d.addUncountableRule=function(e){"string"!=typeof e?(d.addPluralRule(e,"$0"),d.addSingularRule(e,"$0")):r[e.toLowerCase()]=!0},d.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),s[e]=t,n[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(e){return d.addIrregularRule(e[0],e[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(e){return d.addPluralRule(e[0],e[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(e){return d.addSingularRule(e[0],e[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(d.addUncountableRule),d});var d=u.exports;class m{}m.absence="Absence",m.bonusType="BonusType",m.busyStatus="BusyStatus",m.cartType="CartType",m.companyType="CompanyType",m.contactType="ContactType",m.countryCode="CountryCode",m.currency="Currency",m.customFieldCategory="CustomFieldCategory",m.dayType="DayType",m.documentOfflineState="DocumentOfflineState",m.documentType="DocumentType",m.emailCampaignWorkflowStatus="EmailCampaignWorkflowStatus",m.emailOfflineState="EmailOfflineState",m.emailType="EmailType",m.familyStatus="FamilyStatus",m.firstContact="FirstContact",m.globalSettingsCategory="GlobalSettingsCategory",m.goalType="GoalType",m.groupColor="GroupColor",m.importance="Importance",m.journalType="JournalType",m.knowledgeLevel="KnowledgeLevel",m.knowledgeTitle="KnowledgeTitle",m.knowledgeType="KnowledgeType",m.leadType="LeadType",m.marketingType="MarketingType",m.paymentType="PaymentType",m.prefixType="PrefixType",m.productType="ProductType",m.projectOrigin="ProjectOrigin",m.projectType="ProjectType",m.reportCategory="ReportCategory",m.responseForm="ResponseForm",m.responseType="ResponseType",m.salaryDate="SalaryDate",m.salaryType="SalaryType",m.salePriceType="SalePriceType",m.sentimentTone="SentimentTone",m.suffixType="SuffixType",m.taskImportance="TaskImportance",m.tasksSnoozePeriod="TasksSnoozePeriod",m.taskStatus="TaskStatus",m.taskType="TaskType",m.trainingGrade="TrainingGrade",m.trainingTitle="TrainingTitle",m.translations="Translations",m.units="Units",m.userType="UserType",m.usStatesDistrictsTerritories="USStatesDistrictsTerritories",m.vacationType="VacationType",m.vat="VAT",m.workLoad="WorkLoad",m.workReportType="WorkReportType";class p{}p.isValidFolderName=e=>Object.values(p).includes(e),p.actions="Actions",p.additionalFields="AdditionalFields",p.bonuses="Bonuses",p.calendar="Calendar",p.capacityNotes="CapacityNotes",p.capacityNoteTypes="CapacityNoteTypes",p.carts="Carts",p.columnPermissions="ColumnPermissions",p.companies="Companies",p.contacts="Contacts",p.contactsSuggestions="ContactsSuggestions",p.currencyExchangeRates="CurrencyExchangeRates",p.documents="Documents",p.emails="Emails",p.enumTypes="EnumTypes",p.enumValues="EnumValues",p.enumValuesRelations="EnumValuesRelations",p.features="Features",p.flows="Flows",p.globalSettings="GlobalSettings",p.goals="Goals",p.goods="Goods",p.goodsInCart="GoodsInCart",p.goodsInSet="GoodsInSet",p.groups="Groups",p.history="History",p.holidays="Holidays",p.children="Children",p.individualDiscounts="IndividualDiscounts",p.invoiceItems="InvoiceItems",p.invoices="Invoices",p.itemCopyRelations="ItemCopyRelations",p.journal="Journal",p.knowledge="Knowledge",p.layouts="Layouts",p.layoutsModels="LayoutsModels",p.leads="Leads",p.ledger="Ledger",p.mappings="Mappings",p.marketing="Marketing",p.marketingList="MarketingList",p.marketingListSources="MarketingListSources",p.models="Models",p.modulePermissions="ModulePermissions",p.objectTypesOptions="ObjectTypesOptions",p.payments="Payments",p.priceListGroups="PriceListGroups",p.projectAssignments="ProjectAssignments",p.projectAssignmentsPerUserProject="ProjectAssignmentsPerUserProject",p.projectAssignmentsTotal="ProjectAssignmentsTotal",p.projectAssignmentsTotalUserProject="ProjectAssignmentsTotalUserProject",p.projectList="ProjectList",p.projects="Projects",p.projectUsersInCaPlan="ProjectUsersInCaPlan",p.relationData="RelationData",p.relations="Relations",p.reports="Reports",p.revisionsHistory="RevisionsHistory",p.salaries="Salaries",p.salePrices="SalePrices",p.prices="Prices",p.sqlObjects="SqlObjects",p.tasks="Tasks",p.recurrencePatterns="RecurrencePatterns",p.teamRoles="TeamRoles",p.templates="Templates",p.training="Training",p.unifiedRelations="UnifiedRelations",p.users="Users",p.userSettings="UserSettings",p.vacation="Vacation",p.webAccess2Options="WebAccess2Options",p.webAccessOptions="WebAccessOptions",p.workCommitments="WorkCommitments",p.workflowHistory="WorkflowHistory",p.workReports="WorkReports",p.wrongClientVersions="WrongClientVersions",p.xsltTransformations="XsltTransformations",p.xsltTransformationsModels="XsltTransformationsModels",p.getEnumTypeName=e=>e===p.bonuses?m.bonusType:e===p.carts?m.cartType:e===p.companies?m.companyType:e===p.contacts?m.contactType:e===p.documents?m.documentType:e===p.emails?m.emailType:e===p.goals?m.goalType:e===p.goods?m.productType:e===p.journal?m.journalType:e===p.knowledge?m.knowledgeType:e===p.leads?m.leadType:e===p.marketing?m.marketingType:e===p.projects?m.projectType:e===p.salaries?m.salaryType:e===p.salePrices?m.salePriceType:e===p.tasks?m.taskType:e===p.training?m.trainingTitle:e===p.users?m.userType:e===p.vacation?m.vacationType:e===p.workReports?m.workReportType:null,p.getFolderNameByEnumTypeName=e=>e===m.bonusType?p.bonuses:e===m.cartType?p.carts:e===m.companyType?p.companies:e===m.contactType?p.contacts:e===m.documentType?p.documents:e===m.emailType?p.emails:e===m.goalType?p.goals:e===m.journalType?p.journal:e===m.knowledgeType?p.knowledge:e===m.leadType?p.leads:e===m.marketingType?p.marketing:e===m.productType?p.goods:e===m.projectType?p.projects:e===m.salaryType?p.salaries:e===m.salePriceType?p.salePrices:e===m.taskType?p.tasks:e===m.trainingTitle?p.training:e===m.userType?p.users:e===m.vacationType?p.vacation:e===m.workReportType?p.workReports:null;class h{}h.getAllEmailAttachments="GetAllEmailAttachments",h.getCalendarsByItemGuids="GetCalendarsByItemGuids",h.getEmailAttachment="GetEmailAttachment",h.getItemPreview="GetItemPreview",h.getJournalsByItemGuids="GetJournalsByItemGuids",h.getMarketingCampaignsByItemGuids="GetMarketingCampaignsByItemGuids",h.getMarketingListsRecordsByItemGuids="GetMarketingListsRecordsByItemGuids",h.getRevisionHistoryRecordsByItemGuids="GetRevisionHistoryRecordsByItemGuids",h.getVacationsByItemGuids="GetVacationsByItemGuids",h.getWorkflowHistoryRecordsByItemGuids="GetWorkflowHistoryRecordsByItemGuids",h.getCompanyInformationFromTaxRegister="GetCompanyInformationFromTaxRegister",h.logIn="LogIn",h.logOut="LogOut",h.query="Query",h.queryAmount="QueryAmount",h.getServiceAuthSettings="GetServiceAuthSettings",h.getVersion="GetVersion",h.getBinaryAttachment="GetBinaryAttachment",h.getBinaryAttachmentLatestRevision="GetBinaryAttachmentLatestRevision",h.transformItem="TransformItem",h.canUnlinkItems="CanUnlinkItems",h.unlinkItems="UnlinkItems",h.getGoodsFinalPrices="GetGoodsFinalPrices",h.saveItemCopyRelation="SaveItemCopyRelation",h.getXsltTransormationDefinition="GetXsltTransformationDefinition",h.saveBinaryAttachment="SaveBinaryAttachment",h.saveBinaryXsltTransformation="SaveBinaryXsltTransformation",h.GetLoginHistory="GetLoginHistory",h.GetMyLoginHistory="GetMyLoginHistory",h.getFolderNameForApiMethod=e=>{switch(e){case p.calendar:return"Calendars";case p.goodsInCart:return"GoodsInCart";case p.goodsInSet:return"GoodsInSet";case p.journal:return"Journals";case p.marketing:return"MarketingCampaigns";case p.marketingList:return"MarketingListsRecords";case p.revisionsHistory:return"RevisionHistoryRecords";case p.vacation:return"Vacations";case p.workflowHistory:return"WorkflowHistoryRecords";default:return e}},h.getFolderNameByApiItemTypeName=e=>{switch(e){case"Calendar":return p.calendar;case"GoodInCart":return p.goodsInCart;case"GoodInSet":return p.goodsInSet;case"Journal":return p.journal;case"MarketingCampaign":return p.marketing;case"MarketingListsRecord":return p.marketingList;case"RevisionHistoryRecord":return p.revisionsHistory;case"Vacation":return p.vacation;case"WorkflowHistoryRecord":return p.workflowHistory}const t=d.plural(e);return p.isValidFolderName(t)?t:p.isValidFolderName(e)?e:null},h.getGetFolderNameByItemGuidsMethodName=e=>`Get${h.getFolderNameForApiMethod(e)}ByItemGuids`,h.getGetFolderNameMethodName=e=>`Get${h.getFolderNameForApiMethod(e)}`,h.getSearchFolderNameMethodName=e=>`Search${h.getFolderNameForApiMethod(e)}`;class y{constructor(e,t,r,n,s,o){if(this.invalidateSessionId=(e,t)=>{t&&t()},this.getSessionId=(e,t)=>{e.callWithoutSession(h.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=s,this.errorCallback=o}}class C{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 f{static createAuthorizeUrl(e,t,r,n,s,o,i=!1,a){if(s&&!o||!s&&o)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)}`),s&&o&&(l+=`&code_challenge=${encodeURIComponent(s)}&code_challenge_method=${encodeURIComponent(o)}`),a&&(l+=`&url=${encodeURIComponent(a)}`),l}}f.finishAuthorization=(e,t,r,n,s,o,i)=>{const a=new URLSearchParams;a.append("code_verifier",n),a.append("client_id",t),a.append("client_secret",r),a.append("code",s),a.append("redirect_uri",o),a.append("grant_type","authorization_code"),f.callTokenEndpoint(e,a,i)},f.refreshToken=(e,t,r,n,s)=>{const o=new URLSearchParams;o.append("client_id",t),o.append("client_secret",r),o.append("refresh_token",n),o.append("grant_type","refresh_token"),f.callTokenEndpoint(e,o,s)},f.getWebServiceUrl=e=>{const r=e.split(".");if(2!==r.length)throw new Error("Invalid token supplied");return t.decode(r[1])},f.getUserName=e=>f.decodeAccessToken(e).username,f.decodeAccessToken=e=>r(e),f.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 g extends Error{constructor(e,t){super(),this.returnCode=e,this.message=t}}class P{constructor(e,t,r,n,s){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=s}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(h.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 g(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 T extends P{constructor(e,t,r,n,s,o,i,a){if(!(e&&n&&t&&r))throw new Error("Non of the arguments 'username', 'clientId', 'clientSecret', 'refreshToken' can be empty.");super(e,s,o,(e,t)=>{f.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 S extends Error{constructor(e,t,r){super(t),this.statusCode=e,this.message=t,this.responseData=r}}S.from=e=>{var t;const r=null===(t=e.data)||void 0===t?void 0:t.Description,n="string"==typeof r&&r?r:e.statusText;return new S(e.status,n,e.data)};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 v{}v.openItemLinkRegEx=/https:\/\/open\.eway-crm\.(dev|com)\/\?[-a-zA-Z0-9()@:%_+.~#?&/=]*/gi,v.itemParamName="l",v.openLinkDomainLength=7,v.getOpenLinkDomain=e=>e?"open.eway-crm.dev":"open.eway-crm.com",v.isOpenItemLinkInText=e=>v.openItemLinkRegEx.test(e),v.getOpenLinksFromString=e=>e.match(v.openItemLinkRegEx),v.getItemLinksFromOpenLinks=e=>{try{return e.map(e=>new URL(e).searchParams.get(v.itemParamName))}catch(e){console.error("Invalid string passed for cretaing url while getting links from open links",e)}},v.getItemInfoFromLink=e=>{const r=t.decode(e).substring(v.openLinkDomainLength).split("/");if(Object.keys(p).some(e=>p[e]===r[0])&&r[1]){return{folderName:r[0],itemGuid:r[1]}}},v.getAllItemsFromTextWithLinks=e=>{const t={};if(v.isOpenItemLinkInText(e)){const r=v.getOpenLinksFromString(e);if(!r)return;const n=v.getItemLinksFromOpenLinks(r);null==n||n.forEach(e=>{var r;if(!e)return;const n=v.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(r,n,s,i,a){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,r,n,s)=>{const o=t.encode(this.baseUri);let i="eway://"+r;n&&(i+="/"+(null==n?void 0:n.toLowerCase()));const a=v.getOpenLinkDomain(e);i=t.encode(i);let l="https://"+a+"/?ws="+o+`&${v.itemParamName}=`+i;return s&&(l+="&n="+encodeURIComponent(s)),l},this.createAskRejectionHandler=(e,t)=>r=>{if(e(r),t)throw r},this.notifyCallFailed=(e,t)=>{if(this.callFailedCallback)try{this.callFailedCallback(e,t)}catch(e){const t=new Error("Call failed callback failed.\n"+E.stringifyError(e));this.errorCallback?this.errorCallback(t):console.error(t)}},this.askCustomUploadMethod=(e,t,r,n,s)=>new Promise((o,i)=>{const a=this.createAskRejectionHandler(i,s);this.callCustomUploadMethod(e,t,r,o,a,a,n)}),this.askUploadMethod=(e,t,r,n,s)=>new Promise((o,i)=>{const a=this.createAskRejectionHandler(i,s);this.callUploadMethod(e,t,r,o,a,a,n)}),this.callCustomUploadMethod=(t,r,n,s,o,i,a)=>{const c=()=>{this.sessionHandler.getSessionId(this,e=>{this.sessionId=e,this.callCustomUploadMethod(t,r,n,s,o,i,a)})},u=this.sessionId;if(!u)return void c();const d=new URLSearchParams(r),m=`${this.svcUri}/${n}?sessionId=${this.sessionId}&${d.toString()}`,p=e.post(m,t,a);this.handleCallPromise(n,p,s,e=>{if(e.ReturnCode===l.rcBadSession)return this.sessionId=null,void this.sessionHandler.invalidateSessionId(u,c);if(o)o(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,s,o,i)=>{this.callCustomUploadMethod(r,{itemGuid:e,fileName:t},h.saveBinaryAttachment,n,s,o,i)},this.askMethod=(e,t,r,n)=>new Promise((s,o)=>{const i=this.createAskRejectionHandler(o,n);this.callMethod(e,t,s,i,r,i)}),this.callMethod=(e,t,r,n,s,i)=>{s||(s=o.post);const a=()=>{this.sessionHandler.getSessionId(this,o=>{this.sessionId=o,this.callMethod(e,t,r,n,s,i)})},c=this.sessionId;if(!c)return void a();t.sessionId=c;const u=e!==h.logOut?r:e=>{this.sessionId=null,r(e)};this.callWithoutSession(e,t,u,r=>{if(r.ReturnCode!==l.rcBadSession||(this.sessionId=null,e===h.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(c,a)},null,s,i)},this.callWithoutSession=(t,r,n,s,i,a,l)=>{var c;a||(a=o.post);const u=this.svcUri+"/"+t;let d,m;switch(i&&(d={headers:i,withCredentials:null!==(c=this.supportGetItemPreviewMethod)&&void 0!==c?c:t===h.logIn}),a){case o.get:if(r)throw new Error("Calling api get method with data specified does not make any sense.");m=e.get(u,d);break;case o.post:m=e.post(u,r,d);break;default:throw new Error(`Unknown http method '${a}'.`)}this.handleCallPromise(t,m,n,s,e=>{if(l)try{l(e)}catch(e){if(!this.errorCallback)throw e;this.errorCallback(e,r)}else{const t=new Error("Unhandled connection error when calling "+u+": "+E.stringifyError(e));if(!this.errorCallback)throw t;this.errorCallback(t,r)}})},this.getItemPreviewGetMethodUrl=(e,t,r)=>this.svcUri+"/"+h.getItemPreview+"?folderName="+encodeURIComponent(e)+"&itemGuid="+encodeURIComponent(t)+(r||0===r?"&itemVersion="+encodeURIComponent(r.toString()):""),this.getEmailAttachmentGetMethodUrl=(e,t)=>this.svcUri+"/"+h.getEmailAttachment+"?itemGuid="+encodeURIComponent(e)+"&contentId="+encodeURIComponent(t),this.getAllEmailAttachmentsZipGetMethodUrl=e=>this.svcUri+"/"+h.getAllEmailAttachments+"?itemGuid="+encodeURIComponent(e),this.getBinaryAttachmentGetMethodUrl=(e,t)=>"number"==typeof t?this.svcUri+"/"+h.getBinaryAttachment+"?itemGuid="+encodeURIComponent(e)+`&revision=${t}`:this.svcUri+"/"+h.getBinaryAttachmentLatestRevision+"?itemGuid="+encodeURIComponent(e),this.getTransformItemMethodUrl=(e,t,r,n,s)=>`${this.svcUri}/${h.transformItem}?itemGuid=${encodeURIComponent(e)}&itemFolderName=${encodeURIComponent(t)}&transformationGuid=${encodeURIComponent(r)}&outputFormat=${n}${s?`&lang=${encodeURIComponent(s)}`:""}`,this.getXsltTransformationDefinitionMethodUrl=e=>`${this.svcUri}/${h.getXsltTransormationDefinition}?itemGuid=${encodeURIComponent(e)}`,this.getActiveSessionId=()=>this.sessionId,this.setActiveSessionId=e=>{this.sessionId=e},this.handleCallPromise=(e,t,r,n,s)=>{let o=!1;const i=t=>{o||(o=!0,this.notifyCallFailed(t,e))};t.then(e=>{if(200===e.status)e.data.ReturnCode===l.rcSuccess?r(e.data):(e.data.ReturnCode!==l.rcBadSession&&i(e.data),n(e.data));else{const t=S.from(e);i(t),s(t)}}).catch(e=>{const t=e.response?S.from(e.response):e;i(t),s(t)})},!r)throw new Error("The argument 'apiServiceUri' cannot be empty.");if(r.length<8||"https://"!==r.substr(0,8).toLowerCase()&&"http://"!==r.substr(0,7).toLowerCase())throw new Error("Api service uri must start either with 'https://' or with 'http://'.");if(".svc"===r.substr(r.length-4).toLowerCase()){this.svcUri=r;const e=["/API.svc","/InsecureAPI.svc","/WcfService/Service.svc"].find(e=>e.toLowerCase()===r.substr(r.length-e.length).toLowerCase())||"";this.baseUri=r.substr(0,r.length-e.length)}else this.baseUri=I.normalizeWsUrl(r)||r,"https://"===r.substr(0,8).toLowerCase()?this.svcUri=this.baseUri+"/API.svc":this.svcUri=this.baseUri+"/InsecureAPI.svc";this.sessionHandler=n,this.errorCallback=s,this.sessionId=null,this.supportGetItemPreviewMethod=null!=i&&i,this.callFailedCallback=a}get supportsGetItemPreviewMethod(){return this.supportGetItemPreviewMethod}static create(e,t,r,n,s,o,i,a){return new I(e,new y(t,r,n,s,o,i),i,a)}static createAnonymous(e,t){return new I(e,new C,t)}static createUsingOAuth(e,t,r,n,s,o,i,a,l,c,u){return new I(e,new T(t,r,n,s,o,i,a,l),a,c,u)}static isWebServiceMovedFailure(e){if(!e||"object"!=typeof e)return!1;const{returnCode:t,ReturnCode:r}=e;return t===l.rcWebServiceMoved||r===l.rcWebServiceMoved}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("eway-crm.com"),n.add("eway-crm.us"),t&&(n.add("eway-crm.dev"),n.add("localhost")),n.has(I.getRootDomain(r.hostname))}static getRootDomain(e){const t=e.split(".");return!t||t.length<=2?e:t.slice(-2).join(".")}get wsUrl(){return this.baseUri}}class A{constructor(e,t,r,n,s,o,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((s,o)=>{t.token=o,A.call(s,e,t,r,s=>{if(s.ReturnCodeString!==this.invalidTokenReturnCode){if(n)n(s);else if(this.generalErrorCallback){const e=new Error("Unhandled tokenized service connection return code "+s.ReturnCodeString+".\nDescription: "+s.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=s,this.connection=o,this.generalErrorCallback=i||null,this.url=null,this.token=null,this.isActive=!0}static call(t,r,n,s,o,i){const a=t+"/"+r;e.post(a,n).then(e=>{200===e.status?"Success"===e.data.ReturnCodeString?s(e.data):o(e.data):i(S.from(e))}).catch(e=>{e.response?i(S.from(e.response)):i(e)})}}const k=e=>({url:e.ServiceUrl,token:e.Token});class b{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",o.get,!1,"InvalidCommonDataToken",k,e,t)}}class w{}w.acceptableBackwardWorkReportDays="AcceptableBackwardWorkReportDays",w.adminAppInactiveLogoutTime="AdminAppInactiveLogoutTime",w.allowChangeGoodsInCartListPrice="AllowChangeGoodsInCartListPrice",w.applyGeneralDataProtectionRules="ApplyGeneralDataProtectionRules",w.automaticallyCreateJournalAfterCallDuration="AutomaticallyCreateJournalAfterCallDuration",w.bonusesCompletedState="BonusesCompletedState",w.cartInvoicedState="CartInvoicedState",w.cartOrderCanceledState="CartOrderCanceledState",w.cartOrderInProcessState="CartOrderInProcessState",w.cartOrderProcessedState="CartOrderProcessedState",w.cartPaidState="CartPaidState",w.cartProposalInProcessState="CartProposalInProcessState",w.cartProposalProcessedState="CartProposalProcessedState",w.cartSalesVoucherIssuedState="CartSalesVoucherIssuedState",w.cartToBeInvoicedState="CartToBeInvoicedState",w.cartVoidedState="CartVoidedState",w.clickToCallScheme="ClickToCallScheme",w.companyDuplicityCheckEnabled="CompanyDuplicityCheckEnabled",w.completedStateName="CompletedStateName",w.contactDuplicityCheckEnabled="ContactDuplicityCheckEnabled",w.createCompanyWhileImportingContactFromOutlook="CreateCompanyWhileImportingContactFromOutlook",w.defaultProposalValidityPeriod="DefaultProposalValidityPeriod",w.enableContactsTwoWaySyncWithM365="EnableContactsTwoWaySyncWithM365",w.deadStateName="DeadStateName",w.enableCompaniesSyncIntoMobileDeviceContacts="EnableCompaniesSyncIntoMobileDeviceContacts",w.enableContactsSyncIntoMobileDevice="EnableContactsSyncIntoMobileDevice",w.enableLeadsSyncIntoMobileDeviceContacts="EnableLeadsSyncIntoMobileDeviceContacts",w.enableLlamaAiFeatures="EnableLlamaAiFeatures",w.enableUsersSyncIntoMobileDeviceContacts="EnableUsersSyncIntoMobileDeviceContacts",w.emailsActiveProjectsLeadsFilter="EmailsActiveProjectsLeadsFilter",w.trackToAddressesOnly="TrackToAddressesOnly",w.exchangeRatesAdminGroupName="ExchangeRatesAdminGroupName",w.forcedEmailTrackingGroups="ForcedEmailTrackingGroups",w.ignoreEmailsFromDomainsOnEmailsTracking="IgnoreEmailsFromDomainsOnEmailsTracking",w.trackEmailsFromDomains="TrackEmailsFromDomains",w.groupsForAllUnpaidInvoicesNotification="GroupsForAllUnpaidInvoicesNotification",w.itemPreviewMaxHeight="ItemPreviewMaxHeight",w.lastActivityAttributes="LastActivityAttributes",w.leadsCompletedState="LeadsCompletedState",w.leadDeadlineAlertGroups="LeadDeadlineAlertGroups",w.leadsDeadState="LeadsDeadState",w.marketingCompletedState="MarketingCompletedState",w.marketingDeadState="MarketingDeadState",w.minimumPasswordLength="MinimumPasswordLength",w.nextStepAttributes="NextStepAttributes",w.notifyAboutInvoicedInvoiceInPohodaGroup="NotifyAboutInvoicedInvoiceInPohodaGroup",w.notifyAboutLeadsDeadline="NotifyAboutLeadsDeadline",w.notifyAboutPaidInvoiceInPohodaGroup="NotifyAboutPaidInvoiceInPohodaGroup",w.notifyAboutProjectDeadline="NotifyAboutProjectDeadline",w.numberOfDecimalPlaces="NumberOfDecimalPlaces",w.openFileByDefault="OpenFileByDefault",w.phoneListTaskSolverGroup="PhoneListTaskSolverGroup",w.projectDeadlineAlert="ProjectDeadlineAlert",w.serverUpdateProgressNotificationGroup="ServerUpdateProgressNotificationGroup",w.sumarizeCartsPricesOnLeads="SumarizeCartsPricesOnLeads",w.sumarizeCartsPricesOnProjects="SumarizeCartsPricesOnProjects",w.sumarizePeopleExpensesOnProjects="SumarizePeopleExpensesOnProjects",w.systemHealthNotificationGroup="SystemHealthNotificationGroup",w.tasksCompletedState="TasksCompletedState",w.tasksDeferredState="TasksDeferredState",w.tasksInProgressState="TasksInProgressState",w.tasksNotStartedState="TasksNotStartedState",w.tasksWaitOnSomeoneElseState="TasksWaitOnSomeoneElseState",w.trackDocumentVersions="TrackDocumentVersions",w.vacationCompletedState="VacationCompletedState",w.workReportApprovedState="WorkReportApprovedState",w.defaultLanguage="DefaultLanguage",w.defaultCurrency="DefaultCurrency",w.myCompanyCountry="MyCompanyCountry",w.myCompanyName="MyCompanyName",w.myCompanyStreet="MyCompanyStreet",w.myCompanyCity="MyCompanyCity",w.myCompanyState="MyCompanyState",w.myCompanyZip="MyCompanyZIP",w.myCompanyId="MyCompanyID",w.myCompanyVat="MyCompanyVAT",w.mergeGoodsInCart="MergeGoodsInCart",w.cartRefreshLogic="CartRefreshLogic",w.goodsDefaultQuantity="GoodsDefaultQuantity",w.goodsDefaultVAT="GoodsDefaultVAT",w.goodsDefaultVATIncluded="GoodsDefaultVATIncluded",w.recalculateOnListPriceChange="RecalculateOnListPriceChange",w.recalculateOnPurchasePriceChange="RecalculateOnPurchasePriceChange";class D{}D.administrator="Administrator",D.everyone="Everyone",D.system="System",D.systemHealthNotification="SystemHealthNotification";class F{}F.ServerCommon={Server_ID:"Server_ID",Server_ItemCreated:"Server_ItemCreated",Server_ItemChanged:"Server_ItemChanged"},F.Common={CreatedByGUID:"CreatedByGUID",CurrencyEn:"CurrencyEn",DefaultCurrencySuffix:"DefaultCurrency",FileAs:"FileAs",ItemCreated:"ItemCreated",ItemChanged:"ItemChanged",ItemGUID:"ItemGUID",ItemVersion:"ItemVersion",ModifiedByGUID:"ModifiedByGUID",OwnerGUID:"OwnerGUID",ParentCurrencySuffix:"ParentCurrency",Picture:"Picture"},F.Calendar={Location:"Location",StartDate:"StartDate",EndDate:"EndDate",AllDayEvent:"AllDayEvent",SuperiorItem:"SuperiorItem",BusyStatus:"BusyStatus",GraphID:"GraphID",GraphCalendarID:"GraphCalendarID",Note:"Note"},F.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"},F.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"},F.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"},F.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:F.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"},F.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"},F.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"},F.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"},F.Goods=Object.assign(Object.assign({},F.GoodsBase),{PriceListGroupGUID:"PriceListGroupGUID",InventoryQuantity:"InventoryQuantity"}),F.GoodsInCart=Object.assign(Object.assign({},F.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"}),F.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"},F.Vacation={StartDate:"StartDate",EndDate:"EndDate",User:"User",Duration:"Duration",Place:"Place",Note:"Note",AllDay:"AllDay",TypeEn:"TypeEn",StateEn:"StateEn",IsPrivate:"Private"},F.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"},F.Projects={HumanID:"HID",FileAs:"FileAs",ProjectName:"ProjectName",ProjectOriginEn:"ProjectOriginEn",TypeEn:"TypeEn",StateEn:"StateEn",PaymentTypeEn:"PaymentTypeEn",ProjectStart:"ProjectStart",ProjectRealEnd:"ProjectRealEnd",EstimatedEnd:"ProjectEnd",CurrencyEn:F.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"},F.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"},F.Training={TitleEn:"TitleEn"},F.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"},F.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"},F.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"},F.PriceListGroups={Note:"Note"},F.Prices={SalePriceGUID:"SalePriceGUID",GoodsItemGUID:"GoodsItemGUID",Price:"Price",CurrencyEn:"CurrencyEn"},F.SalePrices={Note:"Note",Discount:"Discount",TypeEn:"TypeEn",StateEn:"StateEn",PrevStateEn:"PrevStateEn"},F.XsltTransformations={LangCode:"LangCode",Definition:"Definition",Namespace:"Namespace",ObjectTypeID:"ObjectTypeID",TransformationVersion:"TransformationVersion"},F.XsltTransformationsModels={ObjectTypeID:"ObjectTypeID",TransformationGUID:"TransformationGUID",ItemTypeGUID:"ItemTypeGUID"},F.allTypeEnNames=["TypeEn",F.Documents.DocTypeEn,F.WorkReports.WorkReportEn,"TitleEn"],F.getFolderFileAs=e=>{switch(e){case p.leads:return F.Leads.FileAs;case p.projects:return F.Projects.ProjectName;case p.documents:return F.Documents.DocName;case p.companies:return F.Companies.CompanyName;case p.contacts:case p.users:return F.Common.FileAs;case p.emails:return F.Emails.Subject;case p.journal:return F.Journal.FileAs;case p.tasks:return F.Tasks.Subject;case p.workReports:return F.WorkReports.Subject;case p.vacation:return F.Vacation.TypeEn;case p.carts:case p.goods:case p.goodsInCart:return F.Common.FileAs;case p.groups:return F.Groups.GroupName;case p.xsltTransformations:return F.Common.FileAs;default:return console.warn(`FileAs col name not defined for folderName ${e}`),F.Common.FileAs}};class O{}O.general="GENERAL",O.group="GROUP",O.contactPerson="CONTACTPERSON",O.contact="CONTACT",O.customer="CUSTOMER",O.company="COMPANY",O.outlookProject="OUTLOOKPROJECT",O.supervisor="SUPERVISOR",O.projectOrigin="PROJECT_ORIGIN",O.cart="CART",O.goodsInCart="GOODSINCART",O.superiorItem="SUPERIORITEM",O.taskParent="TASKPARENT";class R{}R.general=1,R.group=2,R.contactPerson=10,R.contact=11,R.customer=12,R.company=13,R.outlookProject=28,R.supervisor=32,R.projectOrigin=25,R.cart=9,R.goodsInCart=15,R.superiorItem=31,R.taskParent=38;class N{}N.all="All",N.own="Own",N.readonly="Readonly",N.invisible="Invisible",N.none="None";class L{}var x,M,U,G;L.mandatory="Mandatory",L.optional="Optional",L.unique="Unique",L.none="None",function(e){e.Free="Free",e.Basic="Basic",e.Professional="Professional",e.Enterprise="Enterprise"}(x||(x={})),function(e){e.ContactsAndCompanies="ContactsAndCompanies",e.Sales="Sales",e.Projects="Projects",e.Marketing="Marketing"}(M||(M={})),function(e){e[e.Negative=0]="Negative",e[e.Neutral=1]="Neutral",e[e.Positive=2]="Positive"}(U||(U={}));class _{}_.contactsSynchronizationWithOutlook="ContactsSynchronizationWithOutlook",_.wordAddin="WordAddin",_.excelAddin="ExcelAddin",_.tasksRecurrentTasks="TasksRecurrentTasks",_.tasksSubtasks="TasksSubtasks",_.tasksSynchronizationWithOutlook="TasksSynchronizationWithOutlook",_.calendarSynchronizationWithOutlook="CalendarSynchronizationWithOutlook",_.emailsAutomaticTracking="EmailsAutomaticTracking",_.convertEmailToProject="ConvertEmailToProject",_.duplicityChecker="DuplicityChecker",_.nextStepAndLastActivityCustomization="NextStepAndLastActivityCustomization",_.subProjects="SubProjects",_.resourceAndPlanning="ResourceAndPlanning",_.professionalEmailCampaigns="ProfessionalEmailCampaigns",_.professionalEmailCampaignsAdvancedStatistics="ProfessionalEmailCampaignsAdvancedStatistics",_.wordEmailMerge="WordEmailMerge",_.printLabels="PrintLabels",_.printEnvelopes="PrintEnvelopes",_.userViews="UserViews",_.sharedUserViews="SharedUserViews",_.gridConditionalFormating="GridConditionalFormating",_.multipleCurrencies="MultipleCurrencies",_.historyTracking="HistoryTracking",_.privateItems="PrivateItems",_.itemTypes="ItemTypes",_.formLayoutCustomization="FormLayoutCustomization",_.workflowBasicDefinitions="WorkflowBasicDefinitions",_.workflowAdvancedDefinitions="WorkflowAdvancedDefinitions",_.workflowAdvancedDefinitionsRules="WorkflowAdvancedDefinitionsRules",_.workflowAdvancedDefinitionsActions="WorkflowAdvancedDefinitionsActions",_.workflowGroupLevelActions="WorkflowGroupLevelActions",_.customFields="CustomFields",_.importantFields="ImportantFields",_.mandatoryFields="MandatoryFields",_.uniqueFields="UniqueFields",_.readOnlyFields="ReadOnlyFields",_.transformationCustomTemplates="TransformationCustomTemplates",_.userRoles="UserRoles",_.modulePermissions="ModulePermissions",_.columnPermissions="ColumnPermissions",_.api="API",_.gate="Gate",_.threeCXIntegration="ThreeCXIntegration",_.tapiIntegration="TapiIntegration",_.pohodaIntegration="PohodaIntegration",_.pohodaSynchronizationIntervalCustomization="PohodaSynchronizationIntervalCustomization",_.pohodaSynchronizationFieldMappingCustomization="PohodaSynchronizationFieldMappingCustomization",_.quickBooksIntegration="QuickBooksIntegration",_.saveBinaryDataOnDisk="SaveBinaryDataOnDisk",_.activeDirectoryLogin="ActiveDirectoryLogin",_.callerIdentificationOnApple="CallerIdentificationOnApple",_.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 ${}$.contactsAutomaticSynchronizationWithOutlook="ContactsAutomaticSynchronizationWithOutlook",$.contactsSynchronizationWithOutlook="ContactsSynchronizationWithOutlook",$.contactsSynchronizationWithAndroid="ContactsSynchronizationWithAndroid",$.documentsRevisions="DocumentsRevisions",$.wordAddin="WordAddin",$.excelAddin="ExcelAddin",$.tasksReminders="TasksReminders",$.tasksRecurrentTasks="TasksRecurrentTasks",$.tasksSubtasks="TasksSubtasks",$.tasksSynchronizationWithOutlook="TasksSynchronizationWithOutlook",$.calendarSynchronizationWithOutlook="CalendarSynchronizationWithOutlook",$.emailsManualTracking="EmailsManualTracking",$.emailsAutomaticTracking="EmailsAutomaticTracking",$.emailSummaryAndSentimentToneFromAi="EmailSummaryAndSentimentToneFromAi",$.convertEmailToContact="ConvertEmailToContact",$.convertEmailToDeal="ConvertEmailToDeal",$.convertEmailToProject="ConvertEmailToProject",$.convertEmailToTask="ConvertEmailToTask",$.convertFromSuggestedContact="ConvertFromSuggestedContact",$.gravatarIntegration="GravatarIntegration",$.logoboxIntegration="LogoboxIntegration",$.companiesBussinesRegisterApiIntegration="CompaniesBussinesRegisterApiIntegration",$.duplicityChecker="DuplicityChecker",$.nextStepAndLastActivityCustomization="NextStepAndLastActivityCustomization",$.subProjects="SubProjects",$.resourceAndPlanning="ResourceAndPlanning",$.professionalEmailCampaigns="ProfessionalEmailCampaigns",$.professionalEmailCampaignsAdvancedStatistics="ProfessionalEmailCampaignsAdvancedStatistics",$.wordEmailMerge="WordEmailMerge",$.printLabels="PrintLabels",$.printEnvelopes="PrintEnvelopes",$.userViews="UserViews",$.sharedUserViews="SharedUserViews",$.gridRowSummary="GridRowSummary",$.gridConditionalFormating="GridConditionalFormating",$.multipleCurrencies="MultipleCurrencies",$.historyTracking="HistoryTracking",$.privateItems="PrivateItems",$.itemTypes="ItemTypes",$.formLayoutCustomization="FormLayoutCustomization",$.workflowBasicDefinitions="WorkflowBasicDefinitions",$.workflowAdvancedDefinitions="WorkflowAdvancedDefinitions",$.workflowAdvancedDefinitionsRules="WorkflowAdvancedDefinitionsRules",$.workflowAdvancedDefinitionsActions="WorkflowAdvancedDefinitionsActions",$.workflowGroupLevelActions="WorkflowGroupLevelActions",$.customFields="CustomFields",$.importantFields="ImportantFields",$.mandatoryFields="MandatoryFields",$.uniqueFields="UniqueFields",$.readOnlyFields="ReadOnlyFields",$.transformationCustomTemplates="TransformationCustomTemplates",$.userRoles="UserRoles",$.modulePermissions="ModulePermissions",$.columnPermissions="ColumnPermissions",$.commonDataAPI="CommonDataAPI",$.eWayCrmAPI="eWayCrmAPI",$.threeCXIntegration="ThreeCXIntegration",$.tapiIntegration="TapiIntegration",$.pohodaIntegration="PohodaIntegration",$.pohodaSynchronizationIntervalCustomization="PohodaSynchronizationIntervalCustomization",$.pohodaSynchronizationFieldMappingCustomization="PohodaSynchronizationFieldMappingCustomization",$.quickBooksIntegration="QuickBooksIntegration",$.shareByTeams="ShareByTeams",$.convertEmailToContactWithDataFromAi="ConvertEmailToContactWithDataFromAi",$.convertEmailToDealWithDataFromAi="ConvertEmailToDealWithDataFromAi",$.convertEmailToProjectWithDataFromAi="ConvertEmailToProjectWithDataFromAi",$.xsltTransformationsAdministrationForCaCAndRest="XsltTransformationsAdministrationForCaCAndRest",$.xsltTransformationsAdministrationForSales="XsltTransformationsAdministrationForSales",$.xsltTransformationsAdministrationForProjects="XsltTransformationsAdministrationForProjects",$.xsltTransformationsAdministrationForMarketing="XsltTransformationsAdministrationForMarketing",function(e){e.UnpaidImportantInvoices="UnpaidImportantInvoices",e.UncollectableSubscriptionPayment="UncollectableSubscriptionPayment",e.UncollectableSubscriptionPaymentWithExpiredCard="UncollectableSubscriptionPaymentWithExpiredCard",e.StandardSubscriptionPeriod="StandardSubscriptionPeriod"}(G||(G={}));var j,B=G;!function(e){e.License="License",e.CloudLicense="CloudLicense",e.MiscLicense="MiscLicense",e.Support="Support",e.Service="Service"}(j||(j={}));var W=j;class H{}H.getIsDebug=e=>{var t;return!!(null===(t=null==e?void 0:e.sessionHandler.lastSuccessfulLoginResponse)||void 0===t?void 0:t.Debug)},H.supportsFeaturesOf=(e,t)=>{var r;const n=null===(r=e.sessionHandler.lastSuccessfulLoginResponse)||void 0===r?void 0:r.WcfVersion;return!!n&&H.supportsVersionFeaturesOf(n,t)},H.supportsVersionFeaturesOf=(e,t)=>n(e,t,">=")||n(e,"1.0.0.0","=");class z{}z.textBox="TextBox",z.comboBox="ComboBox",z.numericBox="NumericBox",z.relation="Relation",z.checkBox="CheckBox",z.linkTextBox="LinkTextBox",z.dateEdit="DateEdit",z.memoBox="MemoBox",z.multiSelectComboBox="MultiSelectComboBox",z.workflowState="WorkflowState",z.image="Image",z.multiSelectRelation="MultiSelectRelation";const Q={[p.relations]:0,[p.unifiedRelations]:1,[p.users]:2,[p.groups]:3,[p.enumTypes]:4,[p.enumValues]:5,[p.additionalFields]:6};var q,J,X,K,Y;!function(e){e.Version75="7.5",e.Version76="7.6",e.Version77="7.7",e.Version80="8.0",e.Version81="8.1",e.Version82="8.2",e.Version83="8.3",e.Version90="9.0",e.Version91="9.1",e.Version92="9.2",e.Version93="9.3",e.Version94="9.4",e.Version100="10.0",e.Version101="10.1"}(q||(q={}));class Z extends H{}Z.is75OrLater=e=>H.supportsFeaturesOf(e,q.Version75),Z.is76OrLater=e=>Z.supportsFeaturesOf(e,q.Version76),Z.is77OrLater=e=>Z.supportsFeaturesOf(e,q.Version77),Z.is80OrLater=e=>Z.supportsFeaturesOf(e,q.Version80),Z.is81OrLater=e=>Z.supportsFeaturesOf(e,q.Version81),Z.is82OrLater=e=>Z.supportsFeaturesOf(e,q.Version82),Z.is83OrLater=e=>Z.supportsFeaturesOf(e,q.Version83),Z.is90OrLater=e=>Z.supportsFeaturesOf(e,q.Version90),Z.is91OrLater=e=>Z.supportsFeaturesOf(e,q.Version91),Z.is92OrLater=e=>Z.supportsFeaturesOf(e,q.Version92),Z.is93OrLater=e=>Z.supportsFeaturesOf(e,q.Version93),Z.is94OrLater=e=>Z.supportsFeaturesOf(e,q.Version94),Z.is100OrLater=e=>Z.supportsFeaturesOf(e,q.Version100),Z.is101OrLater=e=>Z.supportsFeaturesOf(e,q.Version101),Z.isFeatureSupported=(e,t)=>Z.supportsFeaturesOf(e,t);class ee{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!==t&&(n.IsToParentDirection=t),r&&(n.ChildrenFolderNames=r),n}}class te{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]}}}te.column=e=>({__type:"Column:#EQ",Source:ee.mainTable(),Name:e}),te.multiSelectComboColumnLegacy=(e,t,r)=>({__type:"Column:#EQ",Source:ee.mainTable(),Name:"ItemGUID",Transformation:`[dbo].[GetConcatenatedEnumValuesRelationsValues]({0}, '${e}', '${t}')`,Alias:null!=r?r:e}),te.multiSelectComboColumn=(e,t,r,n,s)=>{if(!Z.is77OrLater(e))return te.multiSelectComboColumnLegacy(r,n,s);return{__type:"Column:#EQ",Source:ee.mainTable(),Name:"ItemGUID",Transformation:`[dbo].[GetConcatenatedEnumValuesRelationsValues_WithObjectTypeID]({0}, dbo.GetObjectTypeID('${t}'), '${r}', '${n}')`,Alias:null!=s?s:r}},te.joinColumn=(e,t,r,n,s)=>te.joinColumnFromKey(e,te.column(t),r,n,s),te.joinColumnFromKey=(e,t,r,n,s)=>{const o={__type:"Column:#EQ",Source:ee.join(e,t,s),Name:r};return n&&(o.Alias=n),o},te.singleVariatedColumn=(e,t,r)=>te.variatedColumn([te.columnVariation(e,t)],r),te.variatedColumn=(e,t)=>{const r={__type:"VariatedColumn:#EQ",Source:ee.mainTable(),Variations:e};return t&&(r.Alias=t),r},te.columnVariation=(e,t,r)=>{const n={FolderName:t,Field:{__type:"Column:#EQ",Source:ee.mainTable(),Name:e}};return r&&(n.Field.Transformation=r),n},te.joinColumnVariation=(e,t,r,n)=>({FolderName:e,Field:{__type:"Column:#EQ",Source:ee.join(t,te.column(r)),Name:n}}),te.relationColumnVariation=(e,t,r,n)=>({FolderName:e,Field:{__type:"Column:#EQ",Source:ee.relation(r,t,1),Name:n}}),te.relatedColumn=(e,t,r,n)=>{const s={__type:"Column:#EQ",Source:ee.relation(t,e,1),Name:r};return n&&(s.Alias=n),s},te.relatedSubstituableColumn=(e,t,r,n,s)=>{const o={__type:"SubstituableColumn:#EQ",Source:ee.relation(t,e,1),Name:r,Substitute:n};return s&&(o.Alias=s),o},te.relatedColumnFolderNameToken=(e,t,r)=>({__type:"Token:#EQ",Source:ee.relation(t,e,1),TypeName:"ItemType",Alias:r}),te.hubRelationColumn=(e,t)=>({__type:"Column:#EQ",Source:ee.hubRelation(t),Name:e}),te.aggregateColumn=(e,t,r)=>({__type:"AggregateColumn:#EQ",FunctionName:e,Source:t.Source,AggregatedField:t,Alias:r}),te.folderNameToken=e=>({__type:"Token:#EQ",Source:ee.mainTable(),TypeName:"ItemType",Alias:null!=e?e:"FolderName"}),te.equalsFilterExpression=(e,t)=>({__type:"EqualsFilterExpressionPredicate:#EQ",Field:e,Value:t}),te.notEqualsExpression=(e,t)=>({__type:"NotFilterExpression:#EQ",Child:te.equalsFilterExpression(e,t)}),te.andFilterExpression=e=>({__type:"AndFilterExpressionOperator:#EQ",Children:e}),te.orFilterExpression=e=>({__type:"OrFilterExpressionOperator:#EQ",Children:e}),te.lessFilterExpression=(e,t)=>({__type:"LessFilterExpressionPredicate:#EQ",Field:e,Value:t}),te.lessOrEqualFilterExpression=(e,t)=>({__type:"LessOrEqualFilterExpressionPredicate:#EQ",Field:e,Value:t}),te.greaterFilterExpression=(e,t)=>({__type:"GreaterFilterExpressionPredicate:#EQ",Field:e,Value:t}),te.greaterOrEqualFilterExpression=(e,t)=>({__type:"GreaterOrEqualFilterExpressionPredicate:#EQ",Field:e,Value:t}),te.likeFilterExpression=(e,t)=>({__type:"LikeFilterExpressionPredicate:#EQ",Field:e,Value:`%${t}%`}),te.inFilterExpression=(e,t)=>({__type:"InFilterExpressionPredicate:#EQ",Field:e,Value:t}),te.relatedToExpression=(e,t)=>({__type:"RelatedToFilterExpressionPredicate:#EQ",Value:e,RelationType:t}),te.isNullOrEmptyFilterExpression=e=>te.orFilterExpression([te.equalsFilterExpression(te.column(e),null),te.equalsFilterExpression(te.column(e),"")]);class re{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}}class ne{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 se(e,t,r,n){return new(r||(r=Promise))(function(s,o){function i(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?s(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())})}ne.isValid=e=>e instanceof Date&&!isNaN(e.getTime()),ne.areDaysEqual=(e,t)=>{const r=ne.clearTime(e),n=ne.clearTime(t);return r.getTime()===n.getTime()},ne.areTimesEqual=(e,t)=>e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes(),ne.areDatesEqual=(e,t)=>!!e&&!!t&&ne.areDaysEqual(e,t)&&ne.areTimesEqual(e,t),ne.clearTime=e=>{const t=new Date(e);return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t},ne.isWithoutTime=e=>0===e.getHours()&&0===e.getMinutes()&&0===e.getSeconds(),ne.getFormattedSqlDateTime=e=>e.toISOString().slice(0,19).replace("T"," "),ne.getRfcWithoutTimezone=e=>e.slice(0,19),function(e){e.OpenXmlDocx="OpenXmlDocx",e.Pdf="Pdf",e.WordMlXml="WordMlXml"}(J||(J={})),function(e){e.Manual="Manual",e.SuggestedContact="SuggestedContact"}(X||(X={})),"function"==typeof SuppressedError&&SuppressedError;class oe{constructor(e,t,r,n,s){let o;if(this.sessionId=null,this.isAdmin=null,this.loginResponse=null,!(r||(o=f.decodeAccessToken(t),r=o.ws)))throw new Error("Failed to get web service URL from JWT");if(!(n||(o||(o=f.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,this.sessionId=s||null}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}getSessionId(){return this.sessionId}login(){return se(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)||r.statusText}`);this.sessionId=null==n?void 0:n.SessionId,this.isAdmin=null==n?void 0:n.IsAdmin,this.loginResponse=n})}logout(){return se(this,void 0,void 0,function*(){if(!this.sessionId)throw new Error("Session ID is not set. Please call login() first.");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")})}validateSession(){return se(this,void 0,void 0,function*(){if(!this.sessionId)throw new Error("Session ID is not set. Please call login() first.");const e=new Request(`${this.wsUrl}/${this.endpoint}/IsSessionValid`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:this.sessionId})}),t=yield fetch(e),r=yield t.json();if("rcSuccess"!==r.ReturnCode)throw new Error("Failed to validate session");return r.Result||!1})}getObjectTypes(){return se(this,void 0,void 0,function*(){return(yield this.callMethod("GetObjectTypes",{})).Data})}getLicense(){return se(this,void 0,void 0,function*(){return(yield this.callMethod("GetLicense",{})).Datum})}getClientVersionId(e){return se(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 se(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 se(this,arguments,void 0,function*(e,t=null,r=null,n=null){const s={query:{__type:"MainTableQuery:#EQ",ItemTypes:[e],Fields:t,Paging:{Skip:0,Take:500}}};return r&&(s.query.Filter=r),n&&(s.query.Sort=n),this.callMethod("Query",s)})}callMethod(e,t){return se(this,arguments,void 0,function*(e,t,r="POST"){if(!this.sessionId)throw new Error("Session ID is not set. Please call login() 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}),s=yield fetch(n);if(!s.ok)throw new Error(`Error calling method ${e}: ${s.statusText}`);const o=200===s.status?yield s.json():void 0;if(!o||"rcSuccess"!==o.ReturnCode)throw new Error(`API call failed (${null==o?void 0:o.ReturnCode}): ${null==o?void 0:o.Description}`);return o})}static getTokenData(e,t,r,n,s){return se(this,void 0,void 0,function*(){const o=new URLSearchParams;o.append("client_id",n),o.append("client_secret",s),o.append("code",t),o.append("redirect_uri",r),o.append("grant_type","authorization_code");const i=new Request(`${e}/auth/connect/token`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:o.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})}}class ie{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 p.contacts:{const e=this.baseItem;return e.Email1Address||e.Email2Address||e.Email3Address}case p.leads:return this.baseItem.Email;case p.companies:return this.baseItem.Email;case p.users:{const e=this.baseItem;return e.Email1Address||e.Email2Address}default:return null}}getInitials(){switch(this.folderName){case p.contacts:{const e=this.baseItem;return this.getInitialsInternal(e.FirstName,e.LastName)}case p.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 p.contacts:{const e=this.baseItem;return e.ProfilePicture?{imageData:e.ProfilePicture,width:e.ProfilePictureWidth||0,height:e.ProfilePictureHeight||0}:null}case p.users:{const e=this.baseItem;return e.ProfilePicture?{imageData:e.ProfilePicture,width:e.ProfilePictureWidth||0,height:e.ProfilePictureHeight||0}:null}default:return null}}}!function(e){e.Readonly="Readonly",e.VisibleRankDefaultOnly="VisibleRankDefaultOnly",e.Editable="Editable"}(K||(K={})),function(e){e.Success="Success",e.Failure="Failed",e.FailureDuplicityFound="Failed_DuplicityFound",e.FailureItemAlreadyRemoved="Failed_ItemAlreadyRemoved",e.FailureColumnsLockedWFAction="Failed_ColumnsLocked",e.FailureItemLockedWFAction="Failed_ItemLocked",e.FailureLicenseLimitReached="Failed_LicenseLimitReached",e.FailureInssuficientModulePermission="Failed_InsufficientModulePermission",e.FailureInssuficientColumnsPermission="Failed_InsufficientColumnsPermission"}(Y||(Y={})),a.polyfill();export{I as ApiConnectionAsNonDefaultExport,oe as ApiFetchClient,h as ApiMethods,L as ColumnPermissionMandatoryRules,N as ColumnPermissionPermissionRules,b as CommonDataConnection,V as CustomizationStatsItemKeys,ne as DateHelper,ie as EWItem,x as Edition,X as EmailConversionSource,K as EnumTypeEditMode,m as EnumTypes,E as ErrorHelper,B as ExpirationReason,M as Feature,F as FieldNames,z as FieldTypes,p as FolderNames,_ as Functionality,w as GlobalSettingsNames,D as GroupNames,o as HttpMethod,S as HttpRequestError,Y as ImportResult,W as LicenseKeyInvoiceSeverity,$ as LicenseRestrictionKeys,f as OAuthHelper,T as OAuthSessionHandler,P as OAuthSessionHandlerBase,Q as ObjectTypeIds,v as OpenItemLinkHelper,te as QueryHelper,R as RelationTypeIds,O as RelationTypes,l as ReturnCodes,U as SentimentTone,re as StringHelper,A as TokenizedServiceConnection,J as TransformItemFormats,q as Version,Z as VersionHelper,H as VersionHelperBase,I as default};
package/lib/index.d.ts CHANGED
@@ -52,7 +52,7 @@ type TInputData = Record<string, Object | null>;
52
52
 
53
53
  type TFolderName = 'Actions' | 'AdditionalFields' | 'Bonuses' | 'Calendar' | 'CapacityNotes' | 'CapacityNoteTypes' | 'Carts' | 'ColumnPermissions' | 'Companies' | 'Contacts' | 'ContactsSuggestions' | 'CurrencyExchangeRates' | 'Documents' | 'Emails' | 'EnumTypes' | 'EnumValues' | 'EnumValuesRelations' | 'Features' | 'Flows' | 'GlobalSettings' | 'Goals' | 'Goods' | 'GoodsInCart' | 'GoodsInSet' | 'Groups' | 'History' | 'Holidays' | 'Children' | 'IndividualDiscounts' | 'InvoiceItems' | 'Invoices' | 'ItemCopyRelations' | 'Journal' | 'Knowledge' | 'Layouts' | 'LayoutsModels' | 'Leads' | 'Ledger' | 'Mappings' | 'Marketing' | 'MarketingList' | 'MarketingListSources' | 'Models' | 'ModulePermissions' | 'ObjectTypesOptions' | 'Payments' | 'PriceListGroups' | 'ProjectAssignments' | 'ProjectAssignmentsPerUserProject' | 'ProjectAssignmentsTotal' | 'ProjectAssignmentsTotalUserProject' | 'ProjectList' | 'Projects' | 'ProjectUsersInCaPlan' | 'RelationData' | 'Relations' | 'Reports' | 'RevisionsHistory' | 'Salaries' | 'SalePrices' | 'Prices' | 'SqlObjects' | 'Tasks' | 'RecurrencePatterns' | 'TeamRoles' | 'Templates' | 'Training' | 'UnifiedRelations' | 'Users' | 'UserSettings' | 'Vacation' | 'WebAccess2Options' | 'WebAccessOptions' | 'WorkCommitments' | 'WorkflowHistory' | 'WorkReports' | 'WrongClientVersions' | 'XsltTransformations' | 'XsltTransformationsModels';
54
54
  declare class FolderNames {
55
- static isValidFolderName: (folderName: string) => boolean;
55
+ static isValidFolderName: (folderName: string) => folderName is TFolderName;
56
56
  static readonly actions: TFolderName;
57
57
  static readonly additionalFields: TFolderName;
58
58
  static readonly bonuses: TFolderName;
@@ -156,18 +156,31 @@ interface ISessionHandler {
156
156
  getSessionId(connection: ApiConnection, callback: (sessionId: string, loginResponse?: IApiLoginResponse) => void): void;
157
157
  lastSuccessfulLoginResponse?: IApiLoginResponse;
158
158
  }
159
+ /** Why a call failed - a result the eWay-API refused on the app level, or any other error. */
160
+ type TCallFailure = TUnionError | IApiResult;
161
+ /**
162
+ * Notified of every failed ask or call method, so a consumer can react to failures of the connection as a whole.
163
+ * Left out: rcBadSession (recovered and repeated) and the token endpoint, which OAuthHelper posts on its own.
164
+ */
165
+ type TCallFailedCallback = (failure: TCallFailure, methodName: string) => void;
159
166
  declare class ApiConnection {
160
167
  private readonly svcUri;
161
168
  private readonly baseUri;
162
169
  readonly sessionHandler: ISessionHandler;
163
170
  private readonly errorCallback;
164
171
  private readonly supportGetItemPreviewMethod;
172
+ private readonly callFailedCallback;
165
173
  private sessionId;
166
- constructor(apiServiceUri: string, sessionHandler: ISessionHandler, errorCallback?: (error: TUnionError, data?: TInputData | null) => void, supportGetItemPreviewMethod?: boolean);
174
+ constructor(apiServiceUri: string, sessionHandler: ISessionHandler, errorCallback?: (error: TUnionError, data?: TInputData | null) => void, supportGetItemPreviewMethod?: boolean, callFailedCallback?: TCallFailedCallback);
167
175
  get supportsGetItemPreviewMethod(): boolean;
168
176
  static create(apiServiceUri: string, username: string, passwordHash: string, appVersion: string, clientMachineIdentifier: string, clientMachineName: string, errorCallback?: (error: TUnionError) => void, supportGetItemPreviewMethod?: boolean): ApiConnection;
169
177
  static createAnonymous(apiServiceUri: string, errorCallback?: (error: TUnionError) => void): ApiConnection;
170
- static createUsingOAuth(apiServiceUri: string, username: string, clientId: string, clientSecret: string, refreshToken: string, accessToken: string, appVersion: string, errorCallback?: (error: TUnionError) => void, refreshTokenCallback?: (tokenData: ITokenData) => void, supportGetItemPreviewMethod?: boolean): ApiConnection;
178
+ static createUsingOAuth(apiServiceUri: string, username: string, clientId: string, clientSecret: string, refreshToken: string, accessToken: string, appVersion: string, errorCallback?: (error: TUnionError) => void, refreshTokenCallback?: (tokenData: ITokenData) => void, supportGetItemPreviewMethod?: boolean, callFailedCallback?: TCallFailedCallback): ApiConnection;
179
+ /**
180
+ * True when the failure means the web service has moved to another url. App level failures spell the code
181
+ * `ReturnCode`, errors spell it `returnCode`, so both are checked here instead of in every consumer.
182
+ */
183
+ static isWebServiceMovedFailure(failure: unknown): boolean;
171
184
  static normalizeWsUrl(wsUrl: string | null): string | null;
172
185
  static isCloudUrl(wsUrl: string, allowDev: boolean): boolean;
173
186
  static getRootDomain(hostname: string): string;
@@ -177,6 +190,10 @@ declare class ApiConnection {
177
190
  */
178
191
  readonly ensureLogin: () => Promise<void>;
179
192
  readonly createOpenLink: (isDevEnvironment: boolean, folderName: TFolderName, guid?: string, fileAs?: string) => string;
193
+ /** Builds the rejection handler shared by the ask* methods. */
194
+ private readonly createAskRejectionHandler;
195
+ /** Announces a failed call. The callback only observes, so what it throws must not replace the failure itself. */
196
+ private readonly notifyCallFailed;
180
197
  /**
181
198
  * Creates a promise for async file upload using binary stream
182
199
  * @param file Single file to be uploaded.
@@ -244,7 +261,11 @@ declare class ApiConnection {
244
261
  readonly getXsltTransformationDefinitionMethodUrl: (transformationGuid: string) => string;
245
262
  readonly getActiveSessionId: () => string | null;
246
263
  readonly setActiveSessionId: (sessionId: string | null) => void;
247
- private static handleCallPromise;
264
+ /**
265
+ * The single place every call of this connection ends in, ask* and call* alike, so callFailedCallback is
266
+ * announced from here to cover them all.
267
+ */
268
+ private readonly handleCallPromise;
248
269
  }
249
270
 
250
271
  declare class ReturnCodes {
@@ -329,6 +350,11 @@ declare class ApiMethods {
329
350
  * For example module Calendar has method GetCalendarsByItemGuids, but the folder name is Calendar.
330
351
  */
331
352
  private static readonly getFolderNameForApiMethod;
353
+ /**
354
+ * Returns the folder an item type belongs to. Item type names are singular, so the folder name is their plural form.
355
+ * Returns null when the item type name does not belong to any known folder.
356
+ */
357
+ static readonly getFolderNameByApiItemTypeName: (itemTypeName: string) => TFolderName | null;
332
358
  static readonly getGetFolderNameByItemGuidsMethodName: (folderName: TFolderName) => string;
333
359
  static readonly getGetFolderNameMethodName: (folderName: TFolderName) => string;
334
360
  static readonly getSearchFolderNameMethodName: (folderName: TFolderName) => string;
@@ -3026,4 +3052,4 @@ interface IApiGoodFinalPrice {
3026
3052
  AdditionalDiscount: number | null;
3027
3053
  }
3028
3054
 
3029
- export { ApiConnection as ApiConnectionAsNonDefaultExport, ApiFetchClient, ApiMethods, ColumnPermissionMandatoryRules, ColumnPermissionPermissionRules, CommonDataConnection, CustomizationStatsItemKeys, DateHelper, EWItem, Edition, EmailConversionSource, EnumTypeEditMode, EnumTypes, ErrorHelper, ExpirationReason, Feature, FieldNames, FieldTypes, FolderNames, Functionality, GlobalSettingsNames, GroupNames, HttpMethod, HttpRequestError, IApiAdditionalField, IApiAvailableBundle, IApiAvailableVersionResponse, IApiBooleanResponse, IApiBoundRelation, IApiCalendar, IApiCapacityAvailableBundle, IApiCart, IApiClientVersion, IApiColumn, IApiColumnPermission, IApiCompany, IApiContact, IApiContactsSuggestion, IApiCurrencyExchangeRate, IApiCurrentUserLicenseInfo, IApiCustomizationStatsItem, IApiDataImportResponse, IApiDataResponse, IApiDatumResponse, IApiDocument, IApiEmail, IApiEnumType, IApiEnumValue, IApiEnumValuesRelation, IApiEvent, IApiFeature, IApiFeaturesLicenseBundle, IApiFlow, IApiGlobalSetting, IApiGoal, IApiGood, IApiGoodFinalPrice, IApiGoodInCart, IApiGoodInSet, IApiGroup, IApiHubItemsCountsQueryResponseItem, IApiItemBase, IApiItemBaseWithoutPrivate, IApiItemIdentifier, IApiItemUsageStatus, IApiJournal, IApiLayout, IApiLayoutsModel, IApiLead, IApiLicense, IApiLicenseBundleBase, IApiLicenseDbSizeModel, IApiLicenseExpiration, IApiLicenseKeyInvoice, IApiLicenseProductsModel, IApiLicenseSyncLicenseModel, IApiLocalizedLicenseBundle, IApiLoginResponse, IApiMarketingList, IApiModulePermission, IApiObjectType, IApiPasswordStrength, IApiPayment, IApiProject, IApiQueryAggregateColumn, IApiQueryAndFilterExpressionOperator, IApiQueryColumn, IApiQueryColumnVariation, IApiQueryEqualsFilterExpressionPredicate, IApiQueryGreaterFilterExpressionPredicate, IApiQueryGreaterOrEqualFilterExpressionPredicate, IApiQueryHubRelationSource, IApiQueryInFilterExpressionPredicate, IApiQueryJoinTableSource, IApiQueryLessFilterExpressionPredicate, IApiQueryLessOrEqualFilterExpressionPredicate, IApiQueryLikeFilterExpressionPredicate, IApiQueryMainTableSource, IApiQueryNotFilterExpression, IApiQueryOrFilterExpressionOperator, IApiQueryRelatedToFilterExpressionPredicate, IApiQueryRelationSource, IApiQuerySubstituableColumn, IApiQueryToken, IApiQueryVariatedColumn, IApiRecurrencePattern, IApiResult, IApiSaveResponse, IApiServiceAuthSettingsResponse, IApiSetFieldValueAction, IApiTask, IApiUnlinkInquiryResult, IApiUser, IApiUserSetting, IApiWebServiceTaskStatus, IApiWorkReport, IApiWorkflowActionDerivedItem, IApiWorkflowModel, IApiXsltTransformation, IApiXsltTransformationsModel, ISessionHandler, ITokenData, ITokenError, ITokenSuccess, ITokenizedApiResult, ITranslatableString, ImportResult, LicenseKeyInvoiceSeverity, LicenseRestrictionKeys, OAuthHelper, OAuthSessionHandler, OAuthSessionHandlerBase, ObjectTypeIds, OpenItemLinkHelper, QueryHelper, QuerySources, RelationTypeIds, RelationTypes, ReturnCodes, SentimentTone, StringHelper, TApiColumnPermissionMandatoryRuleOptions, TApiColumnPermissionPermissionRuleOptions, TApiItemWithReleations, TApiModulePermissionOptions, TApiQueryAggregateFunction, TApiQueryField, TApiQueryFilterExpression, TApiUnlinkInquiryResultType, TFeatureWithEdition, TFieldType, TFolderName, TInputData, TNumericValidatorType, TRelationType, TUnionError, TokenizedServiceConnection, TransformItemFormats, Version, VersionHelper, VersionHelperBase, ApiConnection as default };
3055
+ export { ApiConnection as ApiConnectionAsNonDefaultExport, ApiFetchClient, ApiMethods, ColumnPermissionMandatoryRules, ColumnPermissionPermissionRules, CommonDataConnection, CustomizationStatsItemKeys, DateHelper, EWItem, Edition, EmailConversionSource, EnumTypeEditMode, EnumTypes, ErrorHelper, ExpirationReason, Feature, FieldNames, FieldTypes, FolderNames, Functionality, GlobalSettingsNames, GroupNames, HttpMethod, HttpRequestError, IApiAdditionalField, IApiAvailableBundle, IApiAvailableVersionResponse, IApiBooleanResponse, IApiBoundRelation, IApiCalendar, IApiCapacityAvailableBundle, IApiCart, IApiClientVersion, IApiColumn, IApiColumnPermission, IApiCompany, IApiContact, IApiContactsSuggestion, IApiCurrencyExchangeRate, IApiCurrentUserLicenseInfo, IApiCustomizationStatsItem, IApiDataImportResponse, IApiDataResponse, IApiDatumResponse, IApiDocument, IApiEmail, IApiEnumType, IApiEnumValue, IApiEnumValuesRelation, IApiEvent, IApiFeature, IApiFeaturesLicenseBundle, IApiFlow, IApiGlobalSetting, IApiGoal, IApiGood, IApiGoodFinalPrice, IApiGoodInCart, IApiGoodInSet, IApiGroup, IApiHubItemsCountsQueryResponseItem, IApiItemBase, IApiItemBaseWithoutPrivate, IApiItemIdentifier, IApiItemUsageStatus, IApiJournal, IApiLayout, IApiLayoutsModel, IApiLead, IApiLicense, IApiLicenseBundleBase, IApiLicenseDbSizeModel, IApiLicenseExpiration, IApiLicenseKeyInvoice, IApiLicenseProductsModel, IApiLicenseSyncLicenseModel, IApiLocalizedLicenseBundle, IApiLoginResponse, IApiMarketingList, IApiModulePermission, IApiObjectType, IApiPasswordStrength, IApiPayment, IApiProject, IApiQueryAggregateColumn, IApiQueryAndFilterExpressionOperator, IApiQueryColumn, IApiQueryColumnVariation, IApiQueryEqualsFilterExpressionPredicate, IApiQueryGreaterFilterExpressionPredicate, IApiQueryGreaterOrEqualFilterExpressionPredicate, IApiQueryHubRelationSource, IApiQueryInFilterExpressionPredicate, IApiQueryJoinTableSource, IApiQueryLessFilterExpressionPredicate, IApiQueryLessOrEqualFilterExpressionPredicate, IApiQueryLikeFilterExpressionPredicate, IApiQueryMainTableSource, IApiQueryNotFilterExpression, IApiQueryOrFilterExpressionOperator, IApiQueryRelatedToFilterExpressionPredicate, IApiQueryRelationSource, IApiQuerySubstituableColumn, IApiQueryToken, IApiQueryVariatedColumn, IApiRecurrencePattern, IApiResult, IApiSaveResponse, IApiServiceAuthSettingsResponse, IApiSetFieldValueAction, IApiTask, IApiUnlinkInquiryResult, IApiUser, IApiUserSetting, IApiWebServiceTaskStatus, IApiWorkReport, IApiWorkflowActionDerivedItem, IApiWorkflowModel, IApiXsltTransformation, IApiXsltTransformationsModel, ISessionHandler, ITokenData, ITokenError, ITokenSuccess, ITokenizedApiResult, ITranslatableString, ImportResult, LicenseKeyInvoiceSeverity, LicenseRestrictionKeys, OAuthHelper, OAuthSessionHandler, OAuthSessionHandlerBase, ObjectTypeIds, OpenItemLinkHelper, QueryHelper, QuerySources, RelationTypeIds, RelationTypes, ReturnCodes, SentimentTone, StringHelper, TApiColumnPermissionMandatoryRuleOptions, TApiColumnPermissionPermissionRuleOptions, TApiItemWithReleations, TApiModulePermissionOptions, TApiQueryAggregateFunction, TApiQueryField, TApiQueryFilterExpression, TApiUnlinkInquiryResultType, TCallFailedCallback, TCallFailure, TFeatureWithEdition, TFieldType, TFolderName, TInputData, TNumericValidatorType, TRelationType, TUnionError, TokenizedServiceConnection, TransformItemFormats, Version, VersionHelper, VersionHelperBase, ApiConnection as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eway-crm/connector",
3
- "version": "1.0.265",
3
+ "version": "1.0.267",
4
4
  "description": "eWay-CRM API JavaScript connector library.",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/esm/index.js",
@@ -41,6 +41,7 @@
41
41
  "@rollup/plugin-terser": "^1.0.0",
42
42
  "@rollup/plugin-typescript": "^11.0.0",
43
43
  "@types/node": "^20.19.42",
44
+ "@types/pluralize": "^0.0.33",
44
45
  "@typescript-eslint/eslint-plugin": "^8.65.0",
45
46
  "@typescript-eslint/parser": "^8.65.0",
46
47
  "eslint": "^9.39.5",
@@ -60,6 +61,7 @@
60
61
  "compare-versions": "^5.0.3",
61
62
  "es6-promise": "^4.2.8",
62
63
  "jwt-decode": "^3.1.2",
64
+ "pluralize": "^8.0.0",
63
65
  "universal-base64url": "^1.1.0"
64
66
  }
65
67
  }