@eway-crm/connector 1.0.205 → 1.0.207
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/cjs/OAuthSessionHandlerBase.d.ts +9 -2
- package/lib/cjs/constants/RelationTypes.d.ts +3 -1
- package/lib/cjs/helpers/QueryHelper.d.ts +11 -0
- package/lib/cjs/index.js +2 -2
- package/lib/cjs/interfaces/ITokenData.d.ts +6 -2
- package/lib/esm/OAuthSessionHandlerBase.d.ts +9 -2
- package/lib/esm/constants/RelationTypes.d.ts +3 -1
- package/lib/esm/helpers/QueryHelper.d.ts +11 -0
- package/lib/esm/index.js +2 -2
- package/lib/esm/interfaces/ITokenData.d.ts +6 -2
- package/lib/index.d.ts +28 -5
- package/package.json +1 -1
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import type { ApiConnection, ISessionHandler } from './ApiConnection';
|
|
2
2
|
import type { TUnionError } from './exceptions/HttpRequestError';
|
|
3
3
|
import type { IApiLoginResponse } from './data/IApiLoginResponse';
|
|
4
|
+
export type GetAccessTokenResult = {
|
|
5
|
+
error: string;
|
|
6
|
+
accessToken?: undefined;
|
|
7
|
+
} | {
|
|
8
|
+
error?: undefined;
|
|
9
|
+
accessToken: string;
|
|
10
|
+
};
|
|
4
11
|
export declare abstract class OAuthSessionHandlerBase implements ISessionHandler {
|
|
5
12
|
lastSuccessfulLoginResponse?: IApiLoginResponse;
|
|
6
|
-
private accessToken
|
|
13
|
+
private accessToken?;
|
|
7
14
|
private readonly username;
|
|
8
15
|
private readonly appVersion;
|
|
9
16
|
protected readonly errorCallback: ((error: TUnionError) => void) | undefined;
|
|
10
17
|
private readonly getNewAccessTokenCallback;
|
|
11
|
-
constructor(username: string, accessToken: string, appVersion: string, getNewAccessTokenCallback: ((connection: ApiConnection, callback: (
|
|
18
|
+
constructor(username: string, accessToken: string, appVersion: string, getNewAccessTokenCallback: ((connection: ApiConnection, callback: (result: GetAccessTokenResult) => void) => void), errorCallback?: (error: TUnionError) => void);
|
|
12
19
|
readonly invalidateSessionId: (_: string, callback: () => void) => void;
|
|
13
20
|
readonly getSessionId: (connection: ApiConnection, callback: (sessionId: string) => void) => void;
|
|
14
21
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type TRelationType = 'GENERAL' | 'GROUP' | 'CONTACTPERSON' | 'CONTACT' | 'CUSTOMER' | 'COMPANY' | 'OUTLOOKPROJECT' | 'SUPERVISOR' | 'PROJECT_ORIGIN';
|
|
1
|
+
export type TRelationType = 'GENERAL' | 'GROUP' | 'CONTACTPERSON' | 'CONTACT' | 'CUSTOMER' | 'COMPANY' | 'OUTLOOKPROJECT' | 'SUPERVISOR' | 'PROJECT_ORIGIN' | 'CART' | 'GOODSINCART';
|
|
2
2
|
export default class RelationTypes {
|
|
3
3
|
static readonly general: TRelationType;
|
|
4
4
|
static readonly group: TRelationType;
|
|
@@ -9,4 +9,6 @@ export default class RelationTypes {
|
|
|
9
9
|
static readonly outlookProject: TRelationType;
|
|
10
10
|
static readonly supervisor: TRelationType;
|
|
11
11
|
static readonly projectOrigin: TRelationType;
|
|
12
|
+
static readonly cart: TRelationType;
|
|
13
|
+
static readonly goodsInCart: TRelationType;
|
|
12
14
|
}
|
|
@@ -2,6 +2,7 @@ import { type TFolderName } from "../constants/FolderNames";
|
|
|
2
2
|
import type { ApiConnection } from '../ApiConnection';
|
|
3
3
|
import type { IApiQueryAndFilterExpressionOperator, IApiQueryEqualsFilterExpressionPredicate, IApiQueryGreaterFilterExpressionPredicate, IApiQueryGreaterOrEqualFilterExpressionPredicate, IApiQueryLessFilterExpressionPredicate, IApiQueryLessOrEqualFilterExpressionPredicate, IApiQueryLikeFilterExpressionPredicate, IApiQueryInFilterExpressionPredicate, IApiQueryNotFilterExpression, IApiQueryOrFilterExpressionOperator, TApiQueryFilterExpression } from '../data/query/IApiQueryFilters';
|
|
4
4
|
import type { IApiQueryColumn, IApiQueryColumnVariation, IApiQueryToken, IApiQueryVariatedColumn, TApiQueryField, IApiQuerySubstituableColumn } from "../data/query/IApiQuery";
|
|
5
|
+
import type { TRelationType } from '../constants/RelationTypes';
|
|
5
6
|
type TFilterValue = string | number | boolean | null;
|
|
6
7
|
export default class QueryHelper {
|
|
7
8
|
static createHubItemsCountsQuery(parentItemGuids: string[], itemTypes: TFolderName[], excludeSystemItems?: boolean): {
|
|
@@ -10,6 +11,16 @@ export default class QueryHelper {
|
|
|
10
11
|
ItemTypes: TFolderName[];
|
|
11
12
|
ExcludeSystemItems: boolean | undefined;
|
|
12
13
|
};
|
|
14
|
+
static createRelatedTableQuery(baseItemGuid: string, itemTypes: TFolderName | TFolderName[], relationType?: TRelationType): {
|
|
15
|
+
__type: string;
|
|
16
|
+
BaseItemID: string;
|
|
17
|
+
ItemTypes: TFolderName[];
|
|
18
|
+
RelationType: TRelationType | undefined;
|
|
19
|
+
};
|
|
20
|
+
static createMainTableQuery(itemTypes: TFolderName | TFolderName[]): {
|
|
21
|
+
__type: string;
|
|
22
|
+
ItemTypes: TFolderName[];
|
|
23
|
+
};
|
|
13
24
|
static column: (colName: string) => IApiQueryColumn;
|
|
14
25
|
/**
|
|
15
26
|
* For versions < 7.7
|
package/lib/cjs/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("axios"),t=require("universal-base64url"),r=require("jwt-decode"),s=require("compare-versions");function o(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var n=o(t),i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var a,l={exports:{}},c=l.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)},s=0,o=void 0,n=void 0,a=function(e,t){
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("axios"),t=require("universal-base64url"),r=require("jwt-decode"),s=require("compare-versions");function o(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var n=o(t),i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var a,l={exports:{}},c=l.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)},s=0,o=void 0,n=void 0,a=function(e,t){T[s]=e,T[s+1]=t,2===(s+=2)&&(n?n(E):A())};function l(e){n=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),y="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){return function(){return process.nextTick(E)}}function C(){return void 0!==o?function(){o(E)}:g()}function P(){var e=0,t=new m(E),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}function f(){var e=new MessageChannel;return e.port1.onmessage=E,function(){return e.port2.postMessage(0)}}function g(){var e=setTimeout;return function(){return e(E,1)}}var T=new Array(1e3);function E(){for(var e=0;e<s;e+=2)(0,T[e])(T[e+1]),T[e]=void 0,T[e+1]=void 0;s=0}function S(){try{var e=Function("return this")().require("vertx");return o=e.runOnLoop||e.runOnContext,C()}catch(e){return g()}}var A=void 0;function I(e,t){var r=this,s=new this.constructor(b);void 0===s[k]&&$(s);var o=r._state;if(o){var n=arguments[o-1];a((function(){return W(o,s,n,r._result)}))}else j(r,s,e,t);return s}function v(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var r=new t(b);return L(r,e),r}A=p?h():m?P():y?f():void 0===u?S():g();var k=Math.random().toString(36).substring(2);function b(){}var D=void 0,w=1,x=2;function F(){return new TypeError("You cannot resolve a promise with itself")}function O(){return new TypeError("A promises callback cannot return that same promise.")}function N(e,t,r,s){try{e.call(t,r,s)}catch(e){return e}}function R(e,t,r){a((function(e){var s=!1,o=N(r,t,(function(r){s||(s=!0,t!==r?L(e,r):G(e,r))}),(function(t){s||(s=!0,U(e,t))}),"Settle: "+(e._label||" unknown promise"));!s&&o&&(s=!0,U(e,o))}),e)}function M(e,t){t._state===w?G(e,t._result):t._state===x?U(e,t._result):j(t,void 0,(function(t){return L(e,t)}),(function(t){return U(e,t)}))}function _(e,r,s){r.constructor===e.constructor&&s===I&&r.constructor.resolve===v?M(e,r):void 0===s?G(e,r):t(s)?R(e,r,s):G(e,r)}function L(t,r){if(t===r)U(t,F());else if(e(r)){var s=void 0;try{s=r.then}catch(e){return void U(t,e)}_(t,r,s)}else G(t,r)}function V(e){e._onerror&&e._onerror(e._result),B(e)}function G(e,t){e._state===D&&(e._result=t,e._state=w,0!==e._subscribers.length&&a(B,e))}function U(e,t){e._state===D&&(e._state=x,e._result=t,a(V,e))}function j(e,t,r,s){var o=e._subscribers,n=o.length;e._onerror=null,o[n]=t,o[n+w]=r,o[n+x]=s,0===n&&e._state&&a(B,e)}function B(e){var t=e._subscribers,r=e._state;if(0!==t.length){for(var s=void 0,o=void 0,n=e._result,i=0;i<t.length;i+=3)s=t[i],o=t[i+r],s?W(r,s,o,n):o(n);e._subscribers.length=0}}function W(e,r,s,o){var n=t(s),i=void 0,a=void 0,l=!0;if(n){try{i=s(o)}catch(e){l=!1,a=e}if(r===i)return void U(r,O())}else i=o;r._state!==D||(n&&l?L(r,i):!1===l?U(r,a):e===w?G(r,i):e===x&&U(r,i))}function H(e,t){try{t((function(t){L(e,t)}),(function(t){U(e,t)}))}catch(t){U(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(b),this.promise[k]||$(this.promise),r(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?G(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&G(this.promise,this._result))):U(this.promise,q())}return e.prototype._enumerate=function(e){for(var t=0;this._state===D&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var r=this._instanceConstructor,s=r.resolve;if(s===v){var o=void 0,n=void 0,i=!1;try{o=e.then}catch(e){i=!0,n=e}if(o===I&&e._state!==D)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(b);i?U(a,n):_(a,e,o),this._willSettleAt(a,t)}else this._willSettleAt(new r((function(t){return t(e)})),t)}else this._willSettleAt(s(e),t)},e.prototype._settledAt=function(e,t,r){var s=this.promise;s._state===D&&(this._remaining--,e===x?U(s,r):this._result[t]=r),0===this._remaining&&G(s,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(x,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,s){for(var o=e.length,n=0;n<o;n++)t.resolve(e[n]).then(r,s)})):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 U(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=[],b!==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,s=r.constructor;return t(e)?r.then((function(t){return s.resolve(e()).then((function(){return t}))}),(function(t){return s.resolve(e()).then((function(){throw t}))})):r.then(e,e)},e}();function re(){var e=void 0;if(void 0!==i)e=i;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}();
|
|
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 u{}u.rcSuccess="rcSuccess",u.rcBadSession="rcBadSession",u.rcDuplicateContact="rcDuplicateContact",u.rcWebServiceMoved="rcWebServiceMoved",u.rcAccessDenied="rcAccessDenied",u.rcLoginUserNameChanged="rcLoginUserNameChanged",u.rcLicenseExpired="rcLicenseExpired",exports.HttpMethod=void 0,(a=exports.HttpMethod||(exports.HttpMethod={})).get="get",a.post="post";class d{}d.absence="Absence",d.bonusType="BonusType",d.busyStatus="BusyStatus",d.cartType="CartType",d.companyType="CompanyType",d.contactType="ContactType",d.countryCode="CountryCode",d.currency="Currency",d.customFieldCategory="CustomFieldCategory",d.dayType="DayType",d.documentOfflineState="DocumentOfflineState",d.documentType="DocumentType",d.emailCampaignWorkflowStatus="EmailCampaignWorkflowStatus",d.emailOfflineState="EmailOfflineState",d.emailType="EmailType",d.familyStatus="FamilyStatus",d.firstContact="FirstContact",d.globalSettingsCategory="GlobalSettingsCategory",d.goalType="GoalType",d.groupColor="GroupColor",d.importance="Importance",d.journalType="JournalType",d.knowledgeLevel="KnowledgeLevel",d.knowledgeTitle="KnowledgeTitle",d.knowledgeType="KnowledgeType",d.leadType="LeadType",d.marketingType="MarketingType",d.paymentType="PaymentType",d.prefixType="PrefixType",d.productType="ProductType",d.projectOrigin="ProjectOrigin",d.projectType="ProjectType",d.reportCategory="ReportCategory",d.responseForm="ResponseForm",d.responseType="ResponseType",d.salaryDate="SalaryDate",d.salaryType="SalaryType",d.salePriceType="SalePriceType",d.sentimentTone="SentimentTone",d.suffixType="SuffixType",d.taskImportance="TaskImportance",d.tasksSnoozePeriod="TasksSnoozePeriod",d.taskStatus="TaskStatus",d.taskType="TaskType",d.trainingGrade="TrainingGrade",d.trainingTitle="TrainingTitle",d.translations="Translations",d.units="Units",d.userType="UserType",d.usStatesDistrictsTerritories="USStatesDistrictsTerritories",d.vacationType="VacationType",d.vat="VAT",d.workLoad="WorkLoad",d.workReportType="WorkReportType";class m{}m.isValidFolderName=e=>Object.values(m).includes(e),m.actions="Actions",m.additionalFields="AdditionalFields",m.bonuses="Bonuses",m.calendar="Calendar",m.capacityNotes="CapacityNotes",m.capacityNoteTypes="CapacityNoteTypes",m.carts="Carts",m.columnPermissions="ColumnPermissions",m.companies="Companies",m.contacts="Contacts",m.contactsSuggestions="ContactsSuggestions",m.currencyExchangeRates="CurrencyExchangeRates",m.documents="Documents",m.emails="Emails",m.enumTypes="EnumTypes",m.enumValues="EnumValues",m.enumValuesRelations="EnumValuesRelations",m.features="Features",m.flows="Flows",m.globalSettings="GlobalSettings",m.goals="Goals",m.goods="Goods",m.goodsInCart="GoodsInCart",m.goodsInSet="GoodsInSet",m.groups="Groups",m.history="History",m.holidays="Holidays",m.children="Children",m.individualDiscounts="IndividualDiscounts",m.invoiceItems="InvoiceItems",m.invoices="Invoices",m.itemCopyRelations="ItemCopyRelations",m.journal="Journal",m.knowledge="Knowledge",m.layouts="Layouts",m.layoutsModels="LayoutsModels",m.leads="Leads",m.ledger="Ledger",m.mappings="Mappings",m.marketing="Marketing",m.marketingList="MarketingList",m.marketingListSources="MarketingListSources",m.models="Models",m.modulePermissions="ModulePermissions",m.objectTypesOptions="ObjectTypesOptions",m.payments="Payments",m.priceListGroups="PriceListGroups",m.projectAssignments="ProjectAssignments",m.projectAssignmentsPerUserProject="ProjectAssignmentsPerUserProject",m.projectAssignmentsTotal="ProjectAssignmentsTotal",m.projectAssignmentsTotalUserProject="ProjectAssignmentsTotalUserProject",m.projectList="ProjectList",m.projects="Projects",m.projectUsersInCaPlan="ProjectUsersInCaPlan",m.relationData="RelationData",m.relations="Relations",m.reports="Reports",m.revisionsHistory="RevisionsHistory",m.salaries="Salaries",m.salePrices="SalePrices",m.prices="Prices",m.sqlObjects="SqlObjects",m.tasks="Tasks",m.recurrencePatterns="RecurrencePatterns",m.teamRoles="TeamRoles",m.templates="Templates",m.training="Training",m.unifiedRelations="UnifiedRelations",m.users="Users",m.userSettings="UserSettings",m.vacation="Vacation",m.webAccess2Options="WebAccess2Options",m.webAccessOptions="WebAccessOptions",m.workCommitments="WorkCommitments",m.workflowHistory="WorkflowHistory",m.workReports="WorkReports",m.wrongClientVersions="WrongClientVersions",m.xsltTransformations="XsltTransformations",m.xsltTransformationsModels="XsltTransformationsModels",m.getEnumTypeName=e=>e===m.bonuses?d.bonusType:e===m.carts?d.cartType:e===m.companies?d.companyType:e===m.contacts?d.contactType:e===m.documents?d.documentType:e===m.emails?d.emailType:e===m.goals?d.goalType:e===m.goods?d.productType:e===m.journal?d.journalType:e===m.knowledge?d.knowledgeType:e===m.leads?d.leadType:e===m.marketing?d.marketingType:e===m.projects?d.projectType:e===m.salaries?d.salaryType:e===m.salePrices?d.salePriceType:e===m.tasks?d.taskType:e===m.training?d.trainingTitle:e===m.users?d.userType:e===m.vacation?d.vacationType:e===m.workReports?d.workReportType:null,m.getFolderNameByEnumTypeName=e=>e===d.bonusType?m.bonuses:e===d.cartType?m.carts:e===d.companyType?m.companies:e===d.contactType?m.contacts:e===d.documentType?m.documents:e===d.emailType?m.emails:e===d.goalType?m.goals:e===d.journalType?m.journal:e===d.knowledgeType?m.knowledge:e===d.leadType?m.leads:e===d.marketingType?m.marketing:e===d.productType?m.goods:e===d.projectType?m.projects:e===d.salaryType?m.salaries:e===d.salePriceType?m.salePrices:e===d.taskType?m.tasks:e===d.trainingTitle?m.training:e===d.userType?m.users:e===d.vacationType?m.vacation:e===d.workReportType?m.workReports:null;class p{}p.getAllEmailAttachments="GetAllEmailAttachments",p.getCalendarsByItemGuids="GetCalendarsByItemGuids",p.getEmailAttachment="GetEmailAttachment",p.getItemPreview="GetItemPreview",p.getJournalsByItemGuids="GetJournalsByItemGuids",p.getMarketingCampaignsByItemGuids="GetMarketingCampaignsByItemGuids",p.getMarketingListsRecordsByItemGuids="GetMarketingListsRecordsByItemGuids",p.getRevisionHistoryRecordsByItemGuids="GetRevisionHistoryRecordsByItemGuids",p.getVacationsByItemGuids="GetVacationsByItemGuids",p.getWorkflowHistoryRecordsByItemGuids="GetWorkflowHistoryRecordsByItemGuids",p.getCompanyInformationFromTaxRegister="GetCompanyInformationFromTaxRegister",p.logIn="LogIn",p.logOut="LogOut",p.query="Query",p.queryAmount="QueryAmount",p.getServiceAuthSettings="GetServiceAuthSettings",p.getVersion="GetVersion",p.getBinaryAttachment="GetBinaryAttachment",p.getBinaryAttachmentLatestRevision="GetBinaryAttachmentLatestRevision",p.transformItem="TransformItem",p.canUnlinkItems="CanUnlinkItems",p.unlinkItems="UnlinkItems",p.getGoodsFinalPrices="GetGoodsFinalPrices",p.saveItemCopyRelation="SaveItemCopyRelation",p.getFolderNameForApiMethod=e=>{switch(e){case m.calendar:return"Calendars";case m.journal:return"Journals";case m.marketing:return"MarketingCampaigns";case m.marketingList:return"MarketingListsRecords";case m.revisionsHistory:return"RevisionHistoryRecords";case m.vacation:return"Vacations";case m.workflowHistory:return"WorkflowHistoryRecords";default:return e}},p.getGetFolderNameByItemGuidsMethodName=e=>`Get${p.getFolderNameForApiMethod(e)}ByItemGuids`,p.getGetFolderNameMethodName=e=>`Get${p.getFolderNameForApiMethod(e)}`,p.getSearchFolderNameMethodName=e=>`Search${p.getFolderNameForApiMethod(e)}`;class y{constructor(e,t,r,s,o,n){if(this.invalidateSessionId=(e,t)=>{t&&t()},this.getSessionId=(e,t)=>{e.callWithoutSession(p.logIn,{userName:this.username,passwordHash:this.passwordHash,appVersion:this.appVersion,clientMachineIdentifier:this.clientMachineIdentifier,clientMachineName:this.clientMachineName,createSessionCookie:e.supportsGetItemPreviewMethod},(e=>{this.lastSuccessfulLoginResponse=e;const r=e.SessionId;if(r)t&&t(r);else{const e=new Error("Successful login but no session came.");if(!this.errorCallback)throw e;this.errorCallback(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=s,this.clientMachineName=o,this.errorCallback=n}}class h{constructor(){this.getSessionId=(e,t)=>{throw new Error("With anonymous session handler, use only connection methods without session.")},this.invalidateSessionId=(e,t)=>{throw new Error("With anonymous session handler, use only connection methods without session.")}}}class C{static createAuthorizeUrl(e,t,r,s,o,n,i=!1){if(o&&!n||!o&&n)throw new Error("If codeChallenge is defined, codeChallengeMethod must also be defined and vice versa");let a=`https://login.eway-crm.${i?"dev":"com"}?scope=${encodeURIComponent(t.join(" "))}&prompt=login&response_type=code&redirect_uri=${encodeURIComponent(r)}&client_id=${e}`;return s&&(a+=`&state=${encodeURIComponent(s)}`),o&&n&&(a+=`&code_challenge=${encodeURIComponent(o)}&code_challenge_method=${encodeURIComponent(n)}`),a}}C.finishAuthorization=(e,t,r,s,o,n,i)=>{const a=new URLSearchParams;a.append("code_verifier",s),a.append("client_id",t),a.append("client_secret",r),a.append("code",o),a.append("redirect_uri",n),a.append("grant_type","authorization_code"),C.callTokenEndpoint(e,a,i)},C.refreshToken=(e,t,r,s,o)=>{const n=new URLSearchParams;n.append("client_id",t),n.append("client_secret",r),n.append("refresh_token",s),n.append("grant_type","refresh_token"),C.callTokenEndpoint(e,n,o)},C.getWebServiceUrl=e=>{const t=e.split(".");if(2!==t.length)throw new Error("Invalid token supplied");return n.decode(t[1])},C.getUserName=e=>C.decodeAccessToken(e).username,C.decodeAccessToken=e=>r(e),C.callTokenEndpoint=(t,r,s)=>{e.post(t+"/auth/connect/token",r,{headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((e=>{s(e.data)})).catch((e=>{if(!e.response||400!=e.response.status)throw new Error("Token request failed");s(e.response.data)}))};class P extends Error{constructor(e,t){super(),this.returnCode=e,this.message=t}}class f{constructor(e,t,r,s,o){if(this.invalidateSessionId=(e,t)=>{t&&t()},this.getSessionId=(e,t)=>{const r={userName:this.username,appVersion:this.appVersion,createSessionCookie:e.supportsGetItemPreviewMethod},s={Authorization:"Bearer "+this.accessToken};e.callWithoutSession(p.logIn,r,(e=>{this.lastSuccessfulLoginResponse=e;const r=e.SessionId;if(r)t&&t(r);else{const e=new Error("Successful login but no session came.");if(!this.errorCallback)throw e;this.errorCallback(e)}}),(e=>{const t=new P(e.ReturnCode,"Unable to login. Error response follows.\n"+JSON.stringify(e));if(!this.errorCallback)throw t;this.errorCallback(t)}),s,void 0,(r=>{if(401!==(null==r?void 0:r.statusCode)){if(!this.errorCallback)throw r;this.errorCallback(r)}else this.getNewAccessTokenCallback(e,((r,s)=>{this.accessToken=r,s||this.getSessionId(e,t)}))}))},!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=s,this.errorCallback=o}}class g extends f{constructor(e,t,r,s,o,n,i,a){if(!(e&&s&&t&&r))throw new Error("Non of the arguments 'username', 'clientId', 'clientSecret', 'refreshToken' can be empty.");super(e,o,n,((e,t)=>{C.refreshToken(e.wsUrl,this.clientId,this.clientSecret,this.refreshToken,(e=>{try{this.refreshTokenCallback&&this.refreshTokenCallback(e)}catch(e){this.errorCallback&&this.errorCallback(new Error("Refresh token callback failed.\n"+JSON.stringify(e)))}t(e.access_token,e.error)}))}),i),this.refreshToken=s,this.clientId=t,this.clientSecret=r,this.refreshTokenCallback=a}}class E extends Error{constructor(e,t){super(),this.statusCode=e,this.message=t}}class T{}T.stringifyError=e=>JSON.stringify(e,T.replaceErrors),T.replaceErrors=(e,t)=>{if(t instanceof Error){const e={};return Object.getOwnPropertyNames(t).forEach((r=>{e[r]=t[r]})),e}return t};class S{constructor(t,r,s,o){if(this.ensureLogin=()=>new Promise(((e,t)=>{if(this.sessionId)e();else{const r=r=>{r&&(this.sessionId=r,e()),t("Session Id cannot be empty")};this.sessionHandler.getSessionId(this,r)}})),this.createOpenLink=(e,t,r,s)=>{const o=n.encode(this.baseUri);let i="eway://"+t;r&&(i+="/"+(null==r?void 0:r.toLowerCase()));const a=e?"open.eway-crm.dev":"open.eway-crm.com";i=n.encode(i);let l="https://"+a+"/?ws="+o+"&l="+i;return s&&(l+="&n="+encodeURIComponent(s)),l},this.askUploadMethod=(e,t,r,s,o)=>new Promise(((n,i)=>{const a=o?e=>{throw i(e),e}:i;this.callUploadMethod(e,t,r,n,a,a,s)})),this.callUploadMethod=(t,r,s,o,n,i,a)=>{const l=()=>{this.sessionHandler.getSessionId(this,(e=>{this.sessionId=e,this.callUploadMethod(t,r,s,o,n,i,a)}))},c=this.sessionId;if(!c)return void l();const d=`${this.svcUri}/SaveBinaryAttachment?sessionId=${this.sessionId}&itemGuid=${t}&fileName=${encodeURIComponent(r)}`,m=e.post(d,s,a);S.handleCallPromise(m,o,(e=>{if(e.ReturnCode===u.rcBadSession)return this.sessionId=null,void this.sessionHandler.invalidateSessionId(c,l);if(n)n(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 "+d+": "+T.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.askMethod=(e,t,r,s)=>new Promise(((o,n)=>{const i=s?e=>{throw n(e),e}:n;this.callMethod(e,t,o,i,r,i)})),this.callMethod=(e,t,r,s,o,n)=>{o||(o=exports.HttpMethod.post);const i=()=>{this.sessionHandler.getSessionId(this,(i=>{this.sessionId=i,this.callMethod(e,t,r,s,o,n)}))},a=this.sessionId;if(!a)return void i();t.sessionId=a;const l=e!==p.logOut?r:e=>{this.sessionId=null,r(e)};this.callWithoutSession(e,t,l,(r=>{if(r.ReturnCode!==u.rcBadSession||(this.sessionId=null,e===p.logOut))if(s)s(r);else{const e=new Error("Unhandled connection return code "+r.ReturnCode+": "+r.Description);if(!this.errorCallback)throw e;this.errorCallback(e,t)}else this.sessionHandler.invalidateSessionId(a,i)}),null,o,n)},this.callWithoutSession=(t,r,s,o,n,i,a)=>{var l;i||(i=exports.HttpMethod.post);const c=this.svcUri+"/"+t;let u,d;switch(n&&(u={headers:n,withCredentials:null!==(l=this.supportGetItemPreviewMethod)&&void 0!==l?l:t==p.logIn}),i){case exports.HttpMethod.get:if(r)throw new Error("Calling api get method with data specified does not make any sense.");d=e.get(c,u);break;case exports.HttpMethod.post:d=e.post(c,r,u);break;default:throw new Error(`Unknown http method '${i}'.`)}S.handleCallPromise(d,s,o,(e=>{if(a)try{a(e)}catch(e){if(!this.errorCallback)throw e;this.errorCallback(e,r)}else{const t=new Error("Unhandled connection error when calling "+c+": "+T.stringifyError(e));if(!this.errorCallback)throw t;this.errorCallback(t,r)}}))},this.getItemPreviewGetMethodUrl=(e,t,r)=>this.svcUri+"/"+p.getItemPreview+"?folderName="+encodeURIComponent(e)+"&itemGuid="+encodeURIComponent(t)+(r||0===r?"&itemVersion="+encodeURIComponent(r.toString()):""),this.getEmailAttachmentGetMethodUrl=(e,t)=>this.svcUri+"/"+p.getEmailAttachment+"?itemGuid="+encodeURIComponent(e)+"&contentId="+encodeURIComponent(t),this.getAllEmailAttachmentsZipGetMethodUrl=e=>this.svcUri+"/"+p.getAllEmailAttachments+"?itemGuid="+encodeURIComponent(e),this.getBinaryAttachmentGetMethodUrl=(e,t)=>"number"==typeof t?this.svcUri+"/"+p.getBinaryAttachment+"?itemGuid="+encodeURIComponent(e)+`&revision=${t}`:this.svcUri+"/"+p.getBinaryAttachmentLatestRevision+"?itemGuid="+encodeURIComponent(e),this.getTransformItemMethodUrl=(e,t,r,s)=>`${this.svcUri}/${p.transformItem}?itemGuid=${encodeURIComponent(e)}&itemFolderName=${encodeURIComponent(t)}&transformationGuid=${encodeURIComponent(r)}&outputFormat=${s}`,this.getActiveSessionId=()=>this.sessionId,this.setActiveSessionId=e=>{this.sessionId=e},!t)throw new Error("The argument 'apiServiceUri' cannot be empty.");if(t.length<8||"https://"!==t.substr(0,8).toLowerCase()&&"http://"!==t.substr(0,7).toLowerCase())throw new Error("Api service uri must start either with 'https://' or with 'http://'.");if(".svc"===t.substr(t.length-4).toLowerCase()){this.svcUri=t;const e=["/API.svc","/InsecureAPI.svc","/WcfService/Service.svc"].find((e=>e.toLowerCase()===t.substr(t.length-e.length).toLowerCase()))||"";this.baseUri=t.substr(0,t.length-e.length)}else this.baseUri=S.normalizeWsUrl(t)||t,"https://"===t.substr(0,8).toLowerCase()?this.svcUri=this.baseUri+"/API.svc":this.svcUri=this.baseUri+"/InsecureAPI.svc";this.sessionHandler=r,this.errorCallback=s,this.sessionId=null,this.supportGetItemPreviewMethod=null!=o&&o}get supportsGetItemPreviewMethod(){return this.supportGetItemPreviewMethod}static create(e,t,r,s,o,n,i,a){return new S(e,new y(t,r,s,o,n,i),i,a)}static createAnonymous(e,t){return new S(e,new h,t)}static createUsingOAuth(e,t,r,s,o,n,i,a,l,c){return new S(e,new g(t,r,s,o,n,i,a,l),a,c)}static normalizeWsUrl(e){return e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),e}get wsUrl(){return this.baseUri}static handleCallPromise(e,t,r,s){e.then((e=>{200===e.status?e.data.ReturnCode===u.rcSuccess?t(e.data):r(e.data):s(new E(e.status,e.statusText))})).catch((e=>{e.response?s(new E(e.response.status,e.response.statusText)):s(e)}))}}class A{constructor(e,t,r,s,o,n,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,s)=>{this.isEnabled(((o,n)=>{t.token=n,A.call(o,e,t,r,(o=>{if(o.ReturnCodeString!==this.invalidTokenReturnCode){if(s)s(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,s)}))}),(e=>{if(this.generalErrorCallback){const t=new Error("Unhandled tokenized service connection communication error: "+JSON.stringify(e));this.generalErrorCallback(t)}}))}),(()=>{s&&s(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=s,this.urlAndTokenObtainer=o,this.connection=n,this.generalErrorCallback=i||null,this.url=null,this.token=null,this.isActive=!0}static call(t,r,s,o,n,i){const a=t+"/"+r;e.post(a,s).then((e=>{200===e.status?"Success"===e.data.ReturnCodeString?o(e.data):n(e.data):i(new E(e.status,e.statusText))})).catch((e=>{e.response?i(new E(e.response.status,e.response.statusText)):i(e)}))}}const I=e=>({url:e.ServiceUrl,token:e.Token});class v{}v.acceptableBackwardWorkReportDays="AcceptableBackwardWorkReportDays",v.adminAppInactiveLogoutTime="AdminAppInactiveLogoutTime",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.enableContactsTwoWaySyncWithM365="EnableContactsTwoWaySyncWithM365",v.deadStateName="DeadStateName",v.enableCompaniesSyncIntoMobileDeviceContacts="EnableCompaniesSyncIntoMobileDeviceContacts",v.enableContactsSyncIntoMobileDevice="EnableContactsSyncIntoMobileDevice",v.enableLeadsSyncIntoMobileDeviceContacts="EnableLeadsSyncIntoMobileDeviceContacts",v.enableLlamaAiFeatures="EnableLlamaAiFeatures",v.enableUsersSyncIntoMobileDeviceContacts="EnableUsersSyncIntoMobileDeviceContacts",v.emailsActiveProjectsLeadsFilter="EmailsActiveProjectsLeadsFilter",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.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";class k{}k.ServerCommon={Server_ID:"Server_ID",Server_ItemCreated:"Server_ItemCreated",Server_ItemChanged:"Server_ItemChanged"},k.Common={CreatedByGUID:"CreatedByGUID",CurrencyEn:"CurrencyEn",DefaultCurrencySuffix:"DefaultCurrency",FileAs:"FileAs",ItemCreated:"ItemCreated",ItemChanged:"ItemChanged",ItemGUID:"ItemGUID",ItemVersion:"ItemVersion",ModifiedByGUID:"ModifiedByGUID",OwnerGUID:"OwnerGUID",ParentCurrencySuffix:"ParentCurrency"},k.Calendar={EndDate:"EndDate",Note:"Note"},k.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"},k.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"},k.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"},k.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:k.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"},k.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"},k.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"},k.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"},k.Goods=Object.assign(Object.assign({},k.GoodsBase),{PriceListGroupGUID:"PriceListGroupGUID",InventoryQuantity:"InventoryQuantity"}),k.GoodsInCart=Object.assign(Object.assign({},k.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"}),k.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"},k.Vacation={StartDate:"StartDate",EndDate:"EndDate",User:"User",Duration:"Duration",Place:"Place",Note:"Note",AllDay:"AllDay",TypeEn:"TypeEn",StateEn:"StateEn",IsPrivate:"Private"},k.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"},k.Projects={HumanID:"HID",FileAs:"FileAs",ProjectName:"ProjectName",ProjectOriginEn:"ProjectOriginEn",TypeEn:"TypeEn",StateEn:"StateEn",PaymentTypeEn:"PaymentTypeEn",ProjectStart:"ProjectStart",ProjectRealEnd:"ProjectRealEnd",EstimatedEnd:"ProjectEnd",CurrencyEn:k.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"},k.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"},k.Training={TitleEn:"TitleEn"},k.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"},k.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"},k.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"},k.PriceListGroups={Note:"Note"},k.Prices={SalePriceGUID:"SalePriceGUID",GoodsItemGUID:"GoodsItemGUID",Price:"Price",CurrencyEn:"CurrencyEn"},k.SalePrices={Note:"Note",Discount:"Discount",TypeEn:"TypeEn",StateEn:"StateEn",PrevStateEn:"PrevStateEn"},k.XsltTransformations={LangCode:"LangCode",Definition:"Definition",Namespace:"Namespace",ObjectTypeID:"ObjectTypeID",TransformationVersion:"TransformationVersion"},k.XsltTransformationsModels={ObjectTypeID:"ObjectTypeID",TransformationGUID:"TransformationGUID",ItemTypeGUID:"ItemTypeGUID"},k.allTypeEnNames=["TypeEn",k.Documents.DocTypeEn,k.WorkReports.WorkReportEn,"TitleEn"],k.getFolderFileAs=e=>{switch(e){case m.leads:return k.Leads.FileAs;case m.projects:return k.Projects.ProjectName;case m.documents:return k.Documents.DocName;case m.companies:return k.Companies.CompanyName;case m.contacts:case m.users:return k.Common.FileAs;case m.emails:return k.Emails.Subject;case m.journal:return k.Journal.FileAs;case m.tasks:return k.Tasks.Subject;case m.workReports:return k.WorkReports.Subject;case m.vacation:return k.Vacation.TypeEn;case m.carts:case m.goods:case m.goodsInCart:return k.Common.FileAs;case m.groups:return k.Groups.GroupName;case m.xsltTransformations:return k.Common.FileAs;default:return console.warn(`FileAs col name not defined for folderName ${e}`),k.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";class D{}D.all="All",D.own="Own",D.readonly="Readonly",D.invisible="Invisible",D.none="None";class w{}var x,F,O,N;w.mandatory="Mandatory",w.optional="Optional",w.unique="Unique",w.none="None",exports.Edition=void 0,(x=exports.Edition||(exports.Edition={})).Free="Free",x.Basic="Basic",x.Professional="Professional",x.Enterprise="Enterprise",exports.Feature=void 0,(F=exports.Feature||(exports.Feature={})).ContactsAndCompanies="ContactsAndCompanies",F.Sales="Sales",F.Projects="Projects",F.Marketing="Marketing",exports.SentimentTone=void 0,(O=exports.SentimentTone||(exports.SentimentTone={}))[O.Negative=0]="Negative",O[O.Neutral=1]="Neutral",O[O.Positive=2]="Positive";class R{}R.contactsSynchronizationWithOutlook="ContactsSynchronizationWithOutlook",R.wordAddin="WordAddin",R.excelAddin="ExcelAddin",R.tasksRecurrentTasks="TasksRecurrentTasks",R.tasksSubtasks="TasksSubtasks",R.tasksSynchronizationWithOutlook="TasksSynchronizationWithOutlook",R.calendarSynchronizationWithOutlook="CalendarSynchronizationWithOutlook",R.emailsAutomaticTracking="EmailsAutomaticTracking",R.convertEmailToProject="ConvertEmailToProject",R.duplicityChecker="DuplicityChecker",R.nextStepAndLastActivityCustomization="NextStepAndLastActivityCustomization",R.subProjects="SubProjects",R.resourceAndPlanning="ResourceAndPlanning",R.professionalEmailCampaigns="ProfessionalEmailCampaigns",R.professionalEmailCampaignsAdvancedStatistics="ProfessionalEmailCampaignsAdvancedStatistics",R.wordEmailMerge="WordEmailMerge",R.printLabels="PrintLabels",R.printEnvelopes="PrintEnvelopes",R.userViews="UserViews",R.sharedUserViews="SharedUserViews",R.gridConditionalFormating="GridConditionalFormating",R.multipleCurrencies="MultipleCurrencies",R.historyTracking="HistoryTracking",R.privateItems="PrivateItems",R.itemTypes="ItemTypes",R.formLayoutCustomization="FormLayoutCustomization",R.workflowBasicDefinitions="WorkflowBasicDefinitions",R.workflowAdvancedDefinitions="WorkflowAdvancedDefinitions",R.workflowAdvancedDefinitionsRules="WorkflowAdvancedDefinitionsRules",R.workflowAdvancedDefinitionsActions="WorkflowAdvancedDefinitionsActions",R.workflowGroupLevelActions="WorkflowGroupLevelActions",R.customFields="CustomFields",R.importantFields="ImportantFields",R.mandatoryFields="MandatoryFields",R.uniqueFields="UniqueFields",R.readOnlyFields="ReadOnlyFields",R.transformationCustomTemplates="TransformationCustomTemplates",R.userRoles="UserRoles",R.modulePermissions="ModulePermissions",R.columnPermissions="ColumnPermissions",R.api="API",R.gate="Gate",R.threeCXIntegration="ThreeCXIntegration",R.tapiIntegration="TapiIntegration",R.pohodaIntegration="PohodaIntegration",R.pohodaSynchronizationIntervalCustomization="PohodaSynchronizationIntervalCustomization",R.pohodaSynchronizationFieldMappingCustomization="PohodaSynchronizationFieldMappingCustomization",R.quickBooksIntegration="QuickBooksIntegration",R.saveBinaryDataOnDisk="SaveBinaryDataOnDisk",R.activeDirectoryLogin="ActiveDirectoryLogin",R.callerIdentificationOnApple="CallerIdentificationOnApple",R.legacyAdministration="LegacyAdministration";class M{}M.customAdditionalFieldsCount="CustomAdditionalFieldsCount",M.customEnabledAdvancedWorkflowsCount="CustomEnabledAdvancedWorkflowsCount",M.customEnabledBasicWorkflowsCount="CustomEnabledBasicWorkflowsCount",M.customMandatoryFieldsCount="CustomMandatoryFieldsCount",M.customOptionalFieldsCount="CustomOptionalFieldsCount",M.customReadonlyFieldsCount="CustomReadonlyFieldsCount",M.customUniqueFieldsCount="CustomUniqueFieldsCount",M.customVisibleTypesCount="CustomVisibleTypesCount",M.visibleCurrenciesCount="VisibleCurrenciesCount";class L{}L.contactsAutomaticSynchronizationWithOutlook="ContactsAutomaticSynchronizationWithOutlook",L.contactsSynchronizationWithOutlook="ContactsSynchronizationWithOutlook",L.contactsSynchronizationWithAndroid="ContactsSynchronizationWithAndroid",L.documentsRevisions="DocumentsRevisions",L.wordAddin="WordAddin",L.excelAddin="ExcelAddin",L.tasksReminders="TasksReminders",L.tasksRecurrentTasks="TasksRecurrentTasks",L.tasksSubtasks="TasksSubtasks",L.tasksSynchronizationWithOutlook="TasksSynchronizationWithOutlook",L.calendarSynchronizationWithOutlook="CalendarSynchronizationWithOutlook",L.emailsManualTracking="EmailsManualTracking",L.emailsAutomaticTracking="EmailsAutomaticTracking",L.emailSummaryAndSentimentToneFromAi="EmailSummaryAndSentimentToneFromAi",L.convertEmailToContact="ConvertEmailToContact",L.convertEmailToDeal="ConvertEmailToDeal",L.convertEmailToProject="ConvertEmailToProject",L.convertEmailToTask="ConvertEmailToTask",L.convertFromSuggestedContact="ConvertFromSuggestedContact",L.gravatarIntegration="GravatarIntegration",L.logoboxIntegration="LogoboxIntegration",L.companiesBussinesRegisterApiIntegration="CompaniesBussinesRegisterApiIntegration",L.duplicityChecker="DuplicityChecker",L.nextStepAndLastActivityCustomization="NextStepAndLastActivityCustomization",L.subProjects="SubProjects",L.resourceAndPlanning="ResourceAndPlanning",L.professionalEmailCampaigns="ProfessionalEmailCampaigns",L.professionalEmailCampaignsAdvancedStatistics="ProfessionalEmailCampaignsAdvancedStatistics",L.wordEmailMerge="WordEmailMerge",L.printLabels="PrintLabels",L.printEnvelopes="PrintEnvelopes",L.userViews="UserViews",L.sharedUserViews="SharedUserViews",L.gridRowSummary="GridRowSummary",L.gridConditionalFormating="GridConditionalFormating",L.multipleCurrencies="MultipleCurrencies",L.historyTracking="HistoryTracking",L.privateItems="PrivateItems",L.itemTypes="ItemTypes",L.formLayoutCustomization="FormLayoutCustomization",L.workflowBasicDefinitions="WorkflowBasicDefinitions",L.workflowAdvancedDefinitions="WorkflowAdvancedDefinitions",L.workflowAdvancedDefinitionsRules="WorkflowAdvancedDefinitionsRules",L.workflowAdvancedDefinitionsActions="WorkflowAdvancedDefinitionsActions",L.workflowGroupLevelActions="WorkflowGroupLevelActions",L.customFields="CustomFields",L.importantFields="ImportantFields",L.mandatoryFields="MandatoryFields",L.uniqueFields="UniqueFields",L.readOnlyFields="ReadOnlyFields",L.transformationCustomTemplates="TransformationCustomTemplates",L.userRoles="UserRoles",L.modulePermissions="ModulePermissions",L.columnPermissions="ColumnPermissions",L.commonDataAPI="CommonDataAPI",L.eWayCrmAPI="eWayCrmAPI",L.threeCXIntegration="ThreeCXIntegration",L.tapiIntegration="TapiIntegration",L.pohodaIntegration="PohodaIntegration",L.pohodaSynchronizationIntervalCustomization="PohodaSynchronizationIntervalCustomization",L.pohodaSynchronizationFieldMappingCustomization="PohodaSynchronizationFieldMappingCustomization",L.quickBooksIntegration="QuickBooksIntegration",L.shareByTeams="ShareByTeams",L.convertEmailToContactWithDataFromAi="ConvertEmailToContactWithDataFromAi",L.convertEmailToDealWithDataFromAi="ConvertEmailToDealWithDataFromAi",L.convertEmailToProjectWithDataFromAi="ConvertEmailToProjectWithDataFromAi",function(e){e.UnpaidImportantInvoices="UnpaidImportantInvoices",e.UncollectableSubscriptionPayment="UncollectableSubscriptionPayment",e.UncollectableSubscriptionPaymentWithExpiredCard="UncollectableSubscriptionPaymentWithExpiredCard",e.StandardSubscriptionPeriod="StandardSubscriptionPeriod"}(N||(N={}));var _,V=N;!function(e){e.License="License",e.CloudLicense="CloudLicense",e.MiscLicense="MiscLicense",e.Support="Support",e.Service="Service"}(_||(_={}));var G=_;class U{}U.getIsDebug=e=>{var t;return!!(null===(t=null==e?void 0:e.sessionHandler.lastSuccessfulLoginResponse)||void 0===t?void 0:t.Debug)},U.supportsFeaturesOf=(e,t)=>{var r;const s=null===(r=e.sessionHandler.lastSuccessfulLoginResponse)||void 0===r?void 0:r.WcfVersion;return!!s&&U.supportsVersionFeaturesOf(s,t)},U.supportsVersionFeaturesOf=(e,t)=>s.compare(e,t,">=")||s.compare(e,"1.0.0.0","=");class j{}j.textBox="TextBox",j.comboBox="ComboBox",j.numericBox="NumericBox",j.relation="Relation",j.checkBox="CheckBox",j.linkTextBox="LinkTextBox",j.dateEdit="DateEdit",j.memoBox="MemoBox",j.multiSelectComboBox="MultiSelectComboBox",j.workflowState="WorkflowState",j.image="Image",j.multiSelectRelation="MultiSelectRelation";const B={[m.relations]:0,[m.unifiedRelations]:1,[m.users]:2,[m.groups]:3,[m.enumTypes]:4,[m.enumValues]:5,[m.additionalFields]:6};var W,H,z,Q;exports.Version=void 0,(W=exports.Version||(exports.Version={})).Version75="7.5",W.Version76="7.6",W.Version77="7.7",W.Version81="8.1",W.Version82="8.2",W.Version83="8.3",W.Version90="9.0",W.Version91="9.1",W.Version92="9.2";class $ extends U{}$.is75OrLater=e=>U.supportsFeaturesOf(e,exports.Version.Version75),$.is76OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version76),$.is77OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version77),$.is81OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version81),$.is82OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version82),$.is83OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version83),$.is90OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version90),$.is91OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version91),$.is92OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version92),$.isFeatureSupported=(e,t)=>$.supportsFeaturesOf(e,t);class q{static createHubItemsCountsQuery(e,t,r){return{__type:"HubItemsCountsQuery:#EQ",ParentItemGuids:e,ItemTypes:t,ExcludeSystemItems:r}}}q.column=e=>({__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:e}),q.multiSelectComboColumnLegacy=(e,t,r)=>({__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:"ItemGUID",Transformation:`[dbo].[GetConcatenatedEnumValuesRelationsValues]({0}, '${e}', '${t}'`,Alias:null!=r?r:e}),q.multiSelectComboColumn=(e,t,r,s,o)=>{if(!$.is77OrLater(e))return q.multiSelectComboColumnLegacy(r,s,o);return{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:"ItemGUID",Transformation:`[dbo].[GetConcatenatedEnumValuesRelationsValues_WithObjectTypeID]({0}, dbo.GetObjectTypeID('${t}'), '${r}', '${s}')`,Alias:null!=o?o:r}},q.joinColumn=(e,t,r,s,o)=>{const n={__type:"Column:#EQ",Source:{__type:"Join:#EQ",ItemType:e,Key:{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:t},TargetColumnName:o},Name:r};return s&&(n.Alias=s),n},q.singleVariatedColumn=(e,t,r)=>q.variatedColumn([q.columnVariation(e,t)],r),q.variatedColumn=(e,t)=>{const r={__type:"VariatedColumn:#EQ",Source:{__type:"MainTable:#EQ"},Variations:e};return t&&(r.Alias=t),r},q.columnVariation=(e,t,r)=>{const s={FolderName:t,Field:{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:e}};return r&&(s.Field.Transformation=r),s},q.joinColumnVariation=(e,t,r,s)=>({FolderName:e,Field:{__type:"Column:#EQ",Source:{__type:"Join:#EQ",ItemType:t,Key:{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:r}},Name:s}}),q.relationColumnVariation=(e,t,r,s)=>({FolderName:e,Field:{__type:"Column:#EQ",Source:{__type:"Relation:#EQ",RelationType:t,Direction:1,ItemTypes:r},Name:s}}),q.relatedColumn=(e,t,r,s)=>{const o={__type:"Column:#EQ",Source:{__type:"Relation:#EQ",RelationType:e,Direction:1,ItemTypes:t},Name:r};return s&&(o.Alias=s),o},q.relatedSubstituableColumn=(e,t,r,s,o)=>{const n={__type:"SubstituableColumn:#EQ",Source:{__type:"Relation:#EQ",RelationType:e,Direction:1,ItemTypes:t},Name:r,Substitute:s};return o&&(n.Alias=o),n},q.relatedColumnFolderNameToken=(e,t,r)=>({__type:"Token:#EQ",Source:{__type:"Relation:#EQ",RelationType:e,Direction:1,ItemTypes:t},TypeName:"ItemType",Alias:r}),q.folderNameToken=e=>({__type:"Token:#EQ",Source:{__type:"MainTable:#EQ"},TypeName:"ItemType",Alias:null!=e?e:"FolderName"}),q.equalsFilterExpression=(e,t)=>({__type:"EqualsFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.notEqualsExpression=(e,t)=>({__type:"NotFilterExpression:#EQ",Child:q.equalsFilterExpression(e,t)}),q.andFilterExpression=e=>({__type:"AndFilterExpressionOperator:#EQ",Children:e}),q.orFilterExpression=e=>({__type:"OrFilterExpressionOperator:#EQ",Children:e}),q.lessFilterExpression=(e,t)=>({__type:"LessFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.lessOrEqualFilterExpression=(e,t)=>({__type:"LessOrEqualFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.greaterFilterExpression=(e,t)=>({__type:"GreaterFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.greaterOrEqualFilterExpression=(e,t)=>({__type:"GreaterOrEqualFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.likeFilterExpression=(e,t)=>({__type:"LikeFilterExpressionPredicate:#EQ",Field:e,Value:`%${t}%`}),q.inFilterExpression=(e,t)=>({__type:"InFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.isNullOrEmptyFilterExpression=e=>q.orFilterExpression([q.equalsFilterExpression(q.column(e),null),q.equalsFilterExpression(q.column(e),"")]);class J{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())}`}}J.isValid=e=>e instanceof Date&&!isNaN(e.getTime()),J.areDaysEqual=(e,t)=>{const r=J.clearTime(e),s=J.clearTime(t);return r.getTime()===s.getTime()},J.areTimesEqual=(e,t)=>e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes(),J.areDatesEqual=(e,t)=>!!e&&!!t&&J.areDaysEqual(e,t)&&J.areTimesEqual(e,t),J.clearTime=e=>{const t=new Date(e);return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t},J.isWithoutTime=e=>0===e.getHours()&&0===e.getMinutes()&&0===e.getSeconds(),J.getFormattedSqlDateTime=e=>e.toISOString().slice(0,19).replace("T"," "),J.getRfcWithoutTimezone=e=>e.slice(0,19),exports.TransformItemFormats=void 0,(H=exports.TransformItemFormats||(exports.TransformItemFormats={})).OpenXmlDocx="OpenXmlDocx",H.Pdf="Pdf",H.WordMlXml="WordMlXml";exports.EnumTypeEditMode=void 0,(z=exports.EnumTypeEditMode||(exports.EnumTypeEditMode={})).Readonly="Readonly",z.VisibleRankDefaultOnly="VisibleRankDefaultOnly",z.Editable="Editable",exports.ImportResult=void 0,(Q=exports.ImportResult||(exports.ImportResult={})).Success="Success",Q.Failure="Failed",Q.FailureDuplicityFound="Failed_DuplicityFound",Q.FailureItemAlreadyRemoved="Failed_ItemAlreadyRemoved",Q.FailureColumnsLockedWFAction="Failed_ColumnsLocked",Q.FailureItemLockedWFAction="Failed_ItemLocked",Q.FailureLicenceLimitReached="Failed_LicenseLimitReached",Q.FailureInssuficientModulePermission="Failed_InsufficientModulePermission",Q.FailureInssuficientColumnsPermission="Failed_InsufficientColumnsPermission",c.polyfill(),exports.ApiConnectionAsNonDefaultExport=S,exports.ApiMethods=p,exports.ColumnPermissionMandatoryRules=w,exports.ColumnPermissionPermissionRules=D,exports.CommonDataConnection=class{constructor(e,t){this.isCommonDataApiEnabled=(e,t)=>{this.tokenizedConnection.isEnabled(e,t)},this.callCommonDataApi=(e,t,r,s)=>{this.tokenizedConnection.callTokenizedApi(e,t,r,s)},this.tokenizedConnection=new A("ObtainCommonDataApiAccessToken",exports.HttpMethod.get,!1,"InvalidCommonDataToken",I,e,t)}},exports.CustomizationStatsItemKeys=M,exports.DateHelper=J,exports.EWItem=class{constructor(e,t){if(!e||!t)throw new Error("Both folderName and baseItem has to be defined!");this.folderName=e,this.baseItem=t}getEmailAddress(){switch(this.folderName){case m.contacts:{const e=this.baseItem;return e.Email1Address||e.Email2Address||e.Email3Address}case m.leads:return this.baseItem.Email;case m.companies:return this.baseItem.Email;case m.users:{const e=this.baseItem;return e.Email1Address||e.Email2Address}default:return null}}getInitials(){switch(this.folderName){case m.contacts:{const e=this.baseItem;return this.getInitialsInternal(e.FirstName,e.LastName)}case m.users:{const e=this.baseItem;return this.getInitialsInternal(e.FirstName,e.LastName)}default:return null}}getInitialsInternal(e,t){const r=((null==e?void 0:e.substr(0,1))||"")+((null==t?void 0:t.substr(0,1))||"");return""==r?null:r}getItemPreview(){switch(this.folderName){case m.contacts:{const e=this.baseItem;return e.ProfilePicture?{imageData:e.ProfilePicture,width:e.ProfilePictureWidth||0,height:e.ProfilePictureHeight||0}:null}case m.users:{const e=this.baseItem;return e.ProfilePicture?{imageData:e.ProfilePicture,width:e.ProfilePictureWidth||0,height:e.ProfilePictureHeight||0}:null}default:return null}}},exports.EnumTypes=d,exports.ErrorHelper=T,exports.ExpirationReason=V,exports.FieldNames=k,exports.FieldTypes=j,exports.FolderNames=m,exports.Functionality=R,exports.GlobalSettingsNames=v,exports.HttpRequestError=E,exports.LicenseKeyInvoiceSeverity=G,exports.LicenseRestrictionKeys=L,exports.OAuthHelper=C,exports.OAuthSessionHandlerBase=f,exports.ObjectTypeIds=B,exports.QueryHelper=q,exports.RelationTypes=b,exports.ReturnCodes=u,exports.StringHelper=class{static trim(e,t,r=!1){if(null==e)return e;let s=e.trim();return s.length<=t||(s=s.substring(0,t-(r?3:0)),r&&(s+="...")),s}},exports.TokenizedServiceConnection=A,exports.VersionHelper=$,exports.VersionHelperBase=U,exports.default=S;
|
|
8
|
+
*/class u{}u.rcSuccess="rcSuccess",u.rcBadSession="rcBadSession",u.rcDuplicateContact="rcDuplicateContact",u.rcWebServiceMoved="rcWebServiceMoved",u.rcAccessDenied="rcAccessDenied",u.rcLoginUserNameChanged="rcLoginUserNameChanged",u.rcLicenseExpired="rcLicenseExpired",exports.HttpMethod=void 0,(a=exports.HttpMethod||(exports.HttpMethod={})).get="get",a.post="post";class d{}d.absence="Absence",d.bonusType="BonusType",d.busyStatus="BusyStatus",d.cartType="CartType",d.companyType="CompanyType",d.contactType="ContactType",d.countryCode="CountryCode",d.currency="Currency",d.customFieldCategory="CustomFieldCategory",d.dayType="DayType",d.documentOfflineState="DocumentOfflineState",d.documentType="DocumentType",d.emailCampaignWorkflowStatus="EmailCampaignWorkflowStatus",d.emailOfflineState="EmailOfflineState",d.emailType="EmailType",d.familyStatus="FamilyStatus",d.firstContact="FirstContact",d.globalSettingsCategory="GlobalSettingsCategory",d.goalType="GoalType",d.groupColor="GroupColor",d.importance="Importance",d.journalType="JournalType",d.knowledgeLevel="KnowledgeLevel",d.knowledgeTitle="KnowledgeTitle",d.knowledgeType="KnowledgeType",d.leadType="LeadType",d.marketingType="MarketingType",d.paymentType="PaymentType",d.prefixType="PrefixType",d.productType="ProductType",d.projectOrigin="ProjectOrigin",d.projectType="ProjectType",d.reportCategory="ReportCategory",d.responseForm="ResponseForm",d.responseType="ResponseType",d.salaryDate="SalaryDate",d.salaryType="SalaryType",d.salePriceType="SalePriceType",d.sentimentTone="SentimentTone",d.suffixType="SuffixType",d.taskImportance="TaskImportance",d.tasksSnoozePeriod="TasksSnoozePeriod",d.taskStatus="TaskStatus",d.taskType="TaskType",d.trainingGrade="TrainingGrade",d.trainingTitle="TrainingTitle",d.translations="Translations",d.units="Units",d.userType="UserType",d.usStatesDistrictsTerritories="USStatesDistrictsTerritories",d.vacationType="VacationType",d.vat="VAT",d.workLoad="WorkLoad",d.workReportType="WorkReportType";class m{}m.isValidFolderName=e=>Object.values(m).includes(e),m.actions="Actions",m.additionalFields="AdditionalFields",m.bonuses="Bonuses",m.calendar="Calendar",m.capacityNotes="CapacityNotes",m.capacityNoteTypes="CapacityNoteTypes",m.carts="Carts",m.columnPermissions="ColumnPermissions",m.companies="Companies",m.contacts="Contacts",m.contactsSuggestions="ContactsSuggestions",m.currencyExchangeRates="CurrencyExchangeRates",m.documents="Documents",m.emails="Emails",m.enumTypes="EnumTypes",m.enumValues="EnumValues",m.enumValuesRelations="EnumValuesRelations",m.features="Features",m.flows="Flows",m.globalSettings="GlobalSettings",m.goals="Goals",m.goods="Goods",m.goodsInCart="GoodsInCart",m.goodsInSet="GoodsInSet",m.groups="Groups",m.history="History",m.holidays="Holidays",m.children="Children",m.individualDiscounts="IndividualDiscounts",m.invoiceItems="InvoiceItems",m.invoices="Invoices",m.itemCopyRelations="ItemCopyRelations",m.journal="Journal",m.knowledge="Knowledge",m.layouts="Layouts",m.layoutsModels="LayoutsModels",m.leads="Leads",m.ledger="Ledger",m.mappings="Mappings",m.marketing="Marketing",m.marketingList="MarketingList",m.marketingListSources="MarketingListSources",m.models="Models",m.modulePermissions="ModulePermissions",m.objectTypesOptions="ObjectTypesOptions",m.payments="Payments",m.priceListGroups="PriceListGroups",m.projectAssignments="ProjectAssignments",m.projectAssignmentsPerUserProject="ProjectAssignmentsPerUserProject",m.projectAssignmentsTotal="ProjectAssignmentsTotal",m.projectAssignmentsTotalUserProject="ProjectAssignmentsTotalUserProject",m.projectList="ProjectList",m.projects="Projects",m.projectUsersInCaPlan="ProjectUsersInCaPlan",m.relationData="RelationData",m.relations="Relations",m.reports="Reports",m.revisionsHistory="RevisionsHistory",m.salaries="Salaries",m.salePrices="SalePrices",m.prices="Prices",m.sqlObjects="SqlObjects",m.tasks="Tasks",m.recurrencePatterns="RecurrencePatterns",m.teamRoles="TeamRoles",m.templates="Templates",m.training="Training",m.unifiedRelations="UnifiedRelations",m.users="Users",m.userSettings="UserSettings",m.vacation="Vacation",m.webAccess2Options="WebAccess2Options",m.webAccessOptions="WebAccessOptions",m.workCommitments="WorkCommitments",m.workflowHistory="WorkflowHistory",m.workReports="WorkReports",m.wrongClientVersions="WrongClientVersions",m.xsltTransformations="XsltTransformations",m.xsltTransformationsModels="XsltTransformationsModels",m.getEnumTypeName=e=>e===m.bonuses?d.bonusType:e===m.carts?d.cartType:e===m.companies?d.companyType:e===m.contacts?d.contactType:e===m.documents?d.documentType:e===m.emails?d.emailType:e===m.goals?d.goalType:e===m.goods?d.productType:e===m.journal?d.journalType:e===m.knowledge?d.knowledgeType:e===m.leads?d.leadType:e===m.marketing?d.marketingType:e===m.projects?d.projectType:e===m.salaries?d.salaryType:e===m.salePrices?d.salePriceType:e===m.tasks?d.taskType:e===m.training?d.trainingTitle:e===m.users?d.userType:e===m.vacation?d.vacationType:e===m.workReports?d.workReportType:null,m.getFolderNameByEnumTypeName=e=>e===d.bonusType?m.bonuses:e===d.cartType?m.carts:e===d.companyType?m.companies:e===d.contactType?m.contacts:e===d.documentType?m.documents:e===d.emailType?m.emails:e===d.goalType?m.goals:e===d.journalType?m.journal:e===d.knowledgeType?m.knowledge:e===d.leadType?m.leads:e===d.marketingType?m.marketing:e===d.productType?m.goods:e===d.projectType?m.projects:e===d.salaryType?m.salaries:e===d.salePriceType?m.salePrices:e===d.taskType?m.tasks:e===d.trainingTitle?m.training:e===d.userType?m.users:e===d.vacationType?m.vacation:e===d.workReportType?m.workReports:null;class p{}p.getAllEmailAttachments="GetAllEmailAttachments",p.getCalendarsByItemGuids="GetCalendarsByItemGuids",p.getEmailAttachment="GetEmailAttachment",p.getItemPreview="GetItemPreview",p.getJournalsByItemGuids="GetJournalsByItemGuids",p.getMarketingCampaignsByItemGuids="GetMarketingCampaignsByItemGuids",p.getMarketingListsRecordsByItemGuids="GetMarketingListsRecordsByItemGuids",p.getRevisionHistoryRecordsByItemGuids="GetRevisionHistoryRecordsByItemGuids",p.getVacationsByItemGuids="GetVacationsByItemGuids",p.getWorkflowHistoryRecordsByItemGuids="GetWorkflowHistoryRecordsByItemGuids",p.getCompanyInformationFromTaxRegister="GetCompanyInformationFromTaxRegister",p.logIn="LogIn",p.logOut="LogOut",p.query="Query",p.queryAmount="QueryAmount",p.getServiceAuthSettings="GetServiceAuthSettings",p.getVersion="GetVersion",p.getBinaryAttachment="GetBinaryAttachment",p.getBinaryAttachmentLatestRevision="GetBinaryAttachmentLatestRevision",p.transformItem="TransformItem",p.canUnlinkItems="CanUnlinkItems",p.unlinkItems="UnlinkItems",p.getGoodsFinalPrices="GetGoodsFinalPrices",p.saveItemCopyRelation="SaveItemCopyRelation",p.getFolderNameForApiMethod=e=>{switch(e){case m.calendar:return"Calendars";case m.journal:return"Journals";case m.marketing:return"MarketingCampaigns";case m.marketingList:return"MarketingListsRecords";case m.revisionsHistory:return"RevisionHistoryRecords";case m.vacation:return"Vacations";case m.workflowHistory:return"WorkflowHistoryRecords";default:return e}},p.getGetFolderNameByItemGuidsMethodName=e=>`Get${p.getFolderNameForApiMethod(e)}ByItemGuids`,p.getGetFolderNameMethodName=e=>`Get${p.getFolderNameForApiMethod(e)}`,p.getSearchFolderNameMethodName=e=>`Search${p.getFolderNameForApiMethod(e)}`;class y{constructor(e,t,r,s,o,n){if(this.invalidateSessionId=(e,t)=>{t&&t()},this.getSessionId=(e,t)=>{e.callWithoutSession(p.logIn,{userName:this.username,passwordHash:this.passwordHash,appVersion:this.appVersion,clientMachineIdentifier:this.clientMachineIdentifier,clientMachineName:this.clientMachineName,createSessionCookie:e.supportsGetItemPreviewMethod},(e=>{this.lastSuccessfulLoginResponse=e;const r=e.SessionId;if(r)t&&t(r);else{const e=new Error("Successful login but no session came.");if(!this.errorCallback)throw e;this.errorCallback(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=s,this.clientMachineName=o,this.errorCallback=n}}class h{constructor(){this.getSessionId=(e,t)=>{throw new Error("With anonymous session handler, use only connection methods without session.")},this.invalidateSessionId=(e,t)=>{throw new Error("With anonymous session handler, use only connection methods without session.")}}}class C{static createAuthorizeUrl(e,t,r,s,o,n,i=!1){if(o&&!n||!o&&n)throw new Error("If codeChallenge is defined, codeChallengeMethod must also be defined and vice versa");let a=`https://login.eway-crm.${i?"dev":"com"}?scope=${encodeURIComponent(t.join(" "))}&prompt=login&response_type=code&redirect_uri=${encodeURIComponent(r)}&client_id=${e}`;return s&&(a+=`&state=${encodeURIComponent(s)}`),o&&n&&(a+=`&code_challenge=${encodeURIComponent(o)}&code_challenge_method=${encodeURIComponent(n)}`),a}}C.finishAuthorization=(e,t,r,s,o,n,i)=>{const a=new URLSearchParams;a.append("code_verifier",s),a.append("client_id",t),a.append("client_secret",r),a.append("code",o),a.append("redirect_uri",n),a.append("grant_type","authorization_code"),C.callTokenEndpoint(e,a,i)},C.refreshToken=(e,t,r,s,o)=>{const n=new URLSearchParams;n.append("client_id",t),n.append("client_secret",r),n.append("refresh_token",s),n.append("grant_type","refresh_token"),C.callTokenEndpoint(e,n,o)},C.getWebServiceUrl=e=>{const t=e.split(".");if(2!==t.length)throw new Error("Invalid token supplied");return n.decode(t[1])},C.getUserName=e=>C.decodeAccessToken(e).username,C.decodeAccessToken=e=>r(e),C.callTokenEndpoint=(t,r,s)=>{e.post(t+"/auth/connect/token",r,{headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then((e=>{s(e.data)})).catch((e=>{e.response&&400==e.response.status?s(e.response.data):s({error:"Token request failed"})}))};class P extends Error{constructor(e,t){super(),this.returnCode=e,this.message=t}}class f{constructor(e,t,r,s,o){if(this.invalidateSessionId=(e,t)=>{t&&t()},this.getSessionId=(e,t)=>{const r={userName:this.username,appVersion:this.appVersion,createSessionCookie:e.supportsGetItemPreviewMethod},s={Authorization:"Bearer "+this.accessToken};e.callWithoutSession(p.logIn,r,(e=>{this.lastSuccessfulLoginResponse=e;const r=e.SessionId;if(r)t&&t(r);else{const e=new Error("Successful login but no session came.");if(!this.errorCallback)throw e;this.errorCallback(e)}}),(e=>{const t=new P(e.ReturnCode,"Unable to login. Error response follows.\n"+JSON.stringify(e));if(!this.errorCallback)throw t;this.errorCallback(t)}),s,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)}))}))},!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=s,this.errorCallback=o}}class g extends f{constructor(e,t,r,s,o,n,i,a){if(!(e&&s&&t&&r))throw new Error("Non of the arguments 'username', 'clientId', 'clientSecret', 'refreshToken' can be empty.");super(e,o,n,((e,t)=>{C.refreshToken(e.wsUrl,this.clientId,this.clientSecret,this.refreshToken,(e=>{try{this.refreshTokenCallback&&this.refreshTokenCallback(e)}catch(e){this.errorCallback&&this.errorCallback(new Error("Refresh token callback failed.\n"+JSON.stringify(e)))}void 0!==e.error?t({error:e.error}):t({accessToken:e.access_token})}))}),i),this.refreshToken=s,this.clientId=t,this.clientSecret=r,this.refreshTokenCallback=a}}class T extends Error{constructor(e,t){super(),this.statusCode=e,this.message=t}}class E{}E.stringifyError=e=>JSON.stringify(e,E.replaceErrors),E.replaceErrors=(e,t)=>{if(t instanceof Error){const e={};return Object.getOwnPropertyNames(t).forEach((r=>{e[r]=t[r]})),e}return t};class S{constructor(t,r,s,o){if(this.ensureLogin=()=>new Promise(((e,t)=>{if(this.sessionId)e();else{const r=r=>{r&&(this.sessionId=r,e()),t("Session Id cannot be empty")};this.sessionHandler.getSessionId(this,r)}})),this.createOpenLink=(e,t,r,s)=>{const o=n.encode(this.baseUri);let i="eway://"+t;r&&(i+="/"+(null==r?void 0:r.toLowerCase()));const a=e?"open.eway-crm.dev":"open.eway-crm.com";i=n.encode(i);let l="https://"+a+"/?ws="+o+"&l="+i;return s&&(l+="&n="+encodeURIComponent(s)),l},this.askUploadMethod=(e,t,r,s,o)=>new Promise(((n,i)=>{const a=o?e=>{throw i(e),e}:i;this.callUploadMethod(e,t,r,n,a,a,s)})),this.callUploadMethod=(t,r,s,o,n,i,a)=>{const l=()=>{this.sessionHandler.getSessionId(this,(e=>{this.sessionId=e,this.callUploadMethod(t,r,s,o,n,i,a)}))},c=this.sessionId;if(!c)return void l();const d=`${this.svcUri}/SaveBinaryAttachment?sessionId=${this.sessionId}&itemGuid=${t}&fileName=${encodeURIComponent(r)}`,m=e.post(d,s,a);S.handleCallPromise(m,o,(e=>{if(e.ReturnCode===u.rcBadSession)return this.sessionId=null,void this.sessionHandler.invalidateSessionId(c,l);if(n)n(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 "+d+": "+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.askMethod=(e,t,r,s)=>new Promise(((o,n)=>{const i=s?e=>{throw n(e),e}:n;this.callMethod(e,t,o,i,r,i)})),this.callMethod=(e,t,r,s,o,n)=>{o||(o=exports.HttpMethod.post);const i=()=>{this.sessionHandler.getSessionId(this,(i=>{this.sessionId=i,this.callMethod(e,t,r,s,o,n)}))},a=this.sessionId;if(!a)return void i();t.sessionId=a;const l=e!==p.logOut?r:e=>{this.sessionId=null,r(e)};this.callWithoutSession(e,t,l,(r=>{if(r.ReturnCode!==u.rcBadSession||(this.sessionId=null,e===p.logOut))if(s)s(r);else{const e=new Error("Unhandled connection return code "+r.ReturnCode+": "+r.Description);if(!this.errorCallback)throw e;this.errorCallback(e,t)}else this.sessionHandler.invalidateSessionId(a,i)}),null,o,n)},this.callWithoutSession=(t,r,s,o,n,i,a)=>{var l;i||(i=exports.HttpMethod.post);const c=this.svcUri+"/"+t;let u,d;switch(n&&(u={headers:n,withCredentials:null!==(l=this.supportGetItemPreviewMethod)&&void 0!==l?l:t==p.logIn}),i){case exports.HttpMethod.get:if(r)throw new Error("Calling api get method with data specified does not make any sense.");d=e.get(c,u);break;case exports.HttpMethod.post:d=e.post(c,r,u);break;default:throw new Error(`Unknown http method '${i}'.`)}S.handleCallPromise(d,s,o,(e=>{if(a)try{a(e)}catch(e){if(!this.errorCallback)throw e;this.errorCallback(e,r)}else{const t=new Error("Unhandled connection error when calling "+c+": "+E.stringifyError(e));if(!this.errorCallback)throw t;this.errorCallback(t,r)}}))},this.getItemPreviewGetMethodUrl=(e,t,r)=>this.svcUri+"/"+p.getItemPreview+"?folderName="+encodeURIComponent(e)+"&itemGuid="+encodeURIComponent(t)+(r||0===r?"&itemVersion="+encodeURIComponent(r.toString()):""),this.getEmailAttachmentGetMethodUrl=(e,t)=>this.svcUri+"/"+p.getEmailAttachment+"?itemGuid="+encodeURIComponent(e)+"&contentId="+encodeURIComponent(t),this.getAllEmailAttachmentsZipGetMethodUrl=e=>this.svcUri+"/"+p.getAllEmailAttachments+"?itemGuid="+encodeURIComponent(e),this.getBinaryAttachmentGetMethodUrl=(e,t)=>"number"==typeof t?this.svcUri+"/"+p.getBinaryAttachment+"?itemGuid="+encodeURIComponent(e)+`&revision=${t}`:this.svcUri+"/"+p.getBinaryAttachmentLatestRevision+"?itemGuid="+encodeURIComponent(e),this.getTransformItemMethodUrl=(e,t,r,s)=>`${this.svcUri}/${p.transformItem}?itemGuid=${encodeURIComponent(e)}&itemFolderName=${encodeURIComponent(t)}&transformationGuid=${encodeURIComponent(r)}&outputFormat=${s}`,this.getActiveSessionId=()=>this.sessionId,this.setActiveSessionId=e=>{this.sessionId=e},!t)throw new Error("The argument 'apiServiceUri' cannot be empty.");if(t.length<8||"https://"!==t.substr(0,8).toLowerCase()&&"http://"!==t.substr(0,7).toLowerCase())throw new Error("Api service uri must start either with 'https://' or with 'http://'.");if(".svc"===t.substr(t.length-4).toLowerCase()){this.svcUri=t;const e=["/API.svc","/InsecureAPI.svc","/WcfService/Service.svc"].find((e=>e.toLowerCase()===t.substr(t.length-e.length).toLowerCase()))||"";this.baseUri=t.substr(0,t.length-e.length)}else this.baseUri=S.normalizeWsUrl(t)||t,"https://"===t.substr(0,8).toLowerCase()?this.svcUri=this.baseUri+"/API.svc":this.svcUri=this.baseUri+"/InsecureAPI.svc";this.sessionHandler=r,this.errorCallback=s,this.sessionId=null,this.supportGetItemPreviewMethod=null!=o&&o}get supportsGetItemPreviewMethod(){return this.supportGetItemPreviewMethod}static create(e,t,r,s,o,n,i,a){return new S(e,new y(t,r,s,o,n,i),i,a)}static createAnonymous(e,t){return new S(e,new h,t)}static createUsingOAuth(e,t,r,s,o,n,i,a,l,c){return new S(e,new g(t,r,s,o,n,i,a,l),a,c)}static normalizeWsUrl(e){return e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),e}get wsUrl(){return this.baseUri}static handleCallPromise(e,t,r,s){e.then((e=>{200===e.status?e.data.ReturnCode===u.rcSuccess?t(e.data):r(e.data):s(new T(e.status,e.statusText))})).catch((e=>{e.response?s(new T(e.response.status,e.response.statusText)):s(e)}))}}class A{constructor(e,t,r,s,o,n,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,s)=>{this.isEnabled(((o,n)=>{t.token=n,A.call(o,e,t,r,(o=>{if(o.ReturnCodeString!==this.invalidTokenReturnCode){if(s)s(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,s)}))}),(e=>{if(this.generalErrorCallback){const t=new Error("Unhandled tokenized service connection communication error: "+JSON.stringify(e));this.generalErrorCallback(t)}}))}),(()=>{s&&s(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=s,this.urlAndTokenObtainer=o,this.connection=n,this.generalErrorCallback=i||null,this.url=null,this.token=null,this.isActive=!0}static call(t,r,s,o,n,i){const a=t+"/"+r;e.post(a,s).then((e=>{200===e.status?"Success"===e.data.ReturnCodeString?o(e.data):n(e.data):i(new T(e.status,e.statusText))})).catch((e=>{e.response?i(new T(e.response.status,e.response.statusText)):i(e)}))}}const I=e=>({url:e.ServiceUrl,token:e.Token});class v{}v.acceptableBackwardWorkReportDays="AcceptableBackwardWorkReportDays",v.adminAppInactiveLogoutTime="AdminAppInactiveLogoutTime",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.enableContactsTwoWaySyncWithM365="EnableContactsTwoWaySyncWithM365",v.deadStateName="DeadStateName",v.enableCompaniesSyncIntoMobileDeviceContacts="EnableCompaniesSyncIntoMobileDeviceContacts",v.enableContactsSyncIntoMobileDevice="EnableContactsSyncIntoMobileDevice",v.enableLeadsSyncIntoMobileDeviceContacts="EnableLeadsSyncIntoMobileDeviceContacts",v.enableLlamaAiFeatures="EnableLlamaAiFeatures",v.enableUsersSyncIntoMobileDeviceContacts="EnableUsersSyncIntoMobileDeviceContacts",v.emailsActiveProjectsLeadsFilter="EmailsActiveProjectsLeadsFilter",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.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";class k{}k.ServerCommon={Server_ID:"Server_ID",Server_ItemCreated:"Server_ItemCreated",Server_ItemChanged:"Server_ItemChanged"},k.Common={CreatedByGUID:"CreatedByGUID",CurrencyEn:"CurrencyEn",DefaultCurrencySuffix:"DefaultCurrency",FileAs:"FileAs",ItemCreated:"ItemCreated",ItemChanged:"ItemChanged",ItemGUID:"ItemGUID",ItemVersion:"ItemVersion",ModifiedByGUID:"ModifiedByGUID",OwnerGUID:"OwnerGUID",ParentCurrencySuffix:"ParentCurrency"},k.Calendar={EndDate:"EndDate",Note:"Note"},k.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"},k.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"},k.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"},k.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:k.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"},k.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"},k.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"},k.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"},k.Goods=Object.assign(Object.assign({},k.GoodsBase),{PriceListGroupGUID:"PriceListGroupGUID",InventoryQuantity:"InventoryQuantity"}),k.GoodsInCart=Object.assign(Object.assign({},k.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"}),k.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"},k.Vacation={StartDate:"StartDate",EndDate:"EndDate",User:"User",Duration:"Duration",Place:"Place",Note:"Note",AllDay:"AllDay",TypeEn:"TypeEn",StateEn:"StateEn",IsPrivate:"Private"},k.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"},k.Projects={HumanID:"HID",FileAs:"FileAs",ProjectName:"ProjectName",ProjectOriginEn:"ProjectOriginEn",TypeEn:"TypeEn",StateEn:"StateEn",PaymentTypeEn:"PaymentTypeEn",ProjectStart:"ProjectStart",ProjectRealEnd:"ProjectRealEnd",EstimatedEnd:"ProjectEnd",CurrencyEn:k.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"},k.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"},k.Training={TitleEn:"TitleEn"},k.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"},k.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"},k.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"},k.PriceListGroups={Note:"Note"},k.Prices={SalePriceGUID:"SalePriceGUID",GoodsItemGUID:"GoodsItemGUID",Price:"Price",CurrencyEn:"CurrencyEn"},k.SalePrices={Note:"Note",Discount:"Discount",TypeEn:"TypeEn",StateEn:"StateEn",PrevStateEn:"PrevStateEn"},k.XsltTransformations={LangCode:"LangCode",Definition:"Definition",Namespace:"Namespace",ObjectTypeID:"ObjectTypeID",TransformationVersion:"TransformationVersion"},k.XsltTransformationsModels={ObjectTypeID:"ObjectTypeID",TransformationGUID:"TransformationGUID",ItemTypeGUID:"ItemTypeGUID"},k.allTypeEnNames=["TypeEn",k.Documents.DocTypeEn,k.WorkReports.WorkReportEn,"TitleEn"],k.getFolderFileAs=e=>{switch(e){case m.leads:return k.Leads.FileAs;case m.projects:return k.Projects.ProjectName;case m.documents:return k.Documents.DocName;case m.companies:return k.Companies.CompanyName;case m.contacts:case m.users:return k.Common.FileAs;case m.emails:return k.Emails.Subject;case m.journal:return k.Journal.FileAs;case m.tasks:return k.Tasks.Subject;case m.workReports:return k.WorkReports.Subject;case m.vacation:return k.Vacation.TypeEn;case m.carts:case m.goods:case m.goodsInCart:return k.Common.FileAs;case m.groups:return k.Groups.GroupName;case m.xsltTransformations:return k.Common.FileAs;default:return console.warn(`FileAs col name not defined for folderName ${e}`),k.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";class D{}D.all="All",D.own="Own",D.readonly="Readonly",D.invisible="Invisible",D.none="None";class w{}var x,F,O,N;w.mandatory="Mandatory",w.optional="Optional",w.unique="Unique",w.none="None",exports.Edition=void 0,(x=exports.Edition||(exports.Edition={})).Free="Free",x.Basic="Basic",x.Professional="Professional",x.Enterprise="Enterprise",exports.Feature=void 0,(F=exports.Feature||(exports.Feature={})).ContactsAndCompanies="ContactsAndCompanies",F.Sales="Sales",F.Projects="Projects",F.Marketing="Marketing",exports.SentimentTone=void 0,(O=exports.SentimentTone||(exports.SentimentTone={}))[O.Negative=0]="Negative",O[O.Neutral=1]="Neutral",O[O.Positive=2]="Positive";class R{}R.contactsSynchronizationWithOutlook="ContactsSynchronizationWithOutlook",R.wordAddin="WordAddin",R.excelAddin="ExcelAddin",R.tasksRecurrentTasks="TasksRecurrentTasks",R.tasksSubtasks="TasksSubtasks",R.tasksSynchronizationWithOutlook="TasksSynchronizationWithOutlook",R.calendarSynchronizationWithOutlook="CalendarSynchronizationWithOutlook",R.emailsAutomaticTracking="EmailsAutomaticTracking",R.convertEmailToProject="ConvertEmailToProject",R.duplicityChecker="DuplicityChecker",R.nextStepAndLastActivityCustomization="NextStepAndLastActivityCustomization",R.subProjects="SubProjects",R.resourceAndPlanning="ResourceAndPlanning",R.professionalEmailCampaigns="ProfessionalEmailCampaigns",R.professionalEmailCampaignsAdvancedStatistics="ProfessionalEmailCampaignsAdvancedStatistics",R.wordEmailMerge="WordEmailMerge",R.printLabels="PrintLabels",R.printEnvelopes="PrintEnvelopes",R.userViews="UserViews",R.sharedUserViews="SharedUserViews",R.gridConditionalFormating="GridConditionalFormating",R.multipleCurrencies="MultipleCurrencies",R.historyTracking="HistoryTracking",R.privateItems="PrivateItems",R.itemTypes="ItemTypes",R.formLayoutCustomization="FormLayoutCustomization",R.workflowBasicDefinitions="WorkflowBasicDefinitions",R.workflowAdvancedDefinitions="WorkflowAdvancedDefinitions",R.workflowAdvancedDefinitionsRules="WorkflowAdvancedDefinitionsRules",R.workflowAdvancedDefinitionsActions="WorkflowAdvancedDefinitionsActions",R.workflowGroupLevelActions="WorkflowGroupLevelActions",R.customFields="CustomFields",R.importantFields="ImportantFields",R.mandatoryFields="MandatoryFields",R.uniqueFields="UniqueFields",R.readOnlyFields="ReadOnlyFields",R.transformationCustomTemplates="TransformationCustomTemplates",R.userRoles="UserRoles",R.modulePermissions="ModulePermissions",R.columnPermissions="ColumnPermissions",R.api="API",R.gate="Gate",R.threeCXIntegration="ThreeCXIntegration",R.tapiIntegration="TapiIntegration",R.pohodaIntegration="PohodaIntegration",R.pohodaSynchronizationIntervalCustomization="PohodaSynchronizationIntervalCustomization",R.pohodaSynchronizationFieldMappingCustomization="PohodaSynchronizationFieldMappingCustomization",R.quickBooksIntegration="QuickBooksIntegration",R.saveBinaryDataOnDisk="SaveBinaryDataOnDisk",R.activeDirectoryLogin="ActiveDirectoryLogin",R.callerIdentificationOnApple="CallerIdentificationOnApple",R.legacyAdministration="LegacyAdministration";class M{}M.customAdditionalFieldsCount="CustomAdditionalFieldsCount",M.customEnabledAdvancedWorkflowsCount="CustomEnabledAdvancedWorkflowsCount",M.customEnabledBasicWorkflowsCount="CustomEnabledBasicWorkflowsCount",M.customMandatoryFieldsCount="CustomMandatoryFieldsCount",M.customOptionalFieldsCount="CustomOptionalFieldsCount",M.customReadonlyFieldsCount="CustomReadonlyFieldsCount",M.customUniqueFieldsCount="CustomUniqueFieldsCount",M.customVisibleTypesCount="CustomVisibleTypesCount",M.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",function(e){e.UnpaidImportantInvoices="UnpaidImportantInvoices",e.UncollectableSubscriptionPayment="UncollectableSubscriptionPayment",e.UncollectableSubscriptionPaymentWithExpiredCard="UncollectableSubscriptionPaymentWithExpiredCard",e.StandardSubscriptionPeriod="StandardSubscriptionPeriod"}(N||(N={}));var L,V=N;!function(e){e.License="License",e.CloudLicense="CloudLicense",e.MiscLicense="MiscLicense",e.Support="Support",e.Service="Service"}(L||(L={}));var G=L;class U{}U.getIsDebug=e=>{var t;return!!(null===(t=null==e?void 0:e.sessionHandler.lastSuccessfulLoginResponse)||void 0===t?void 0:t.Debug)},U.supportsFeaturesOf=(e,t)=>{var r;const s=null===(r=e.sessionHandler.lastSuccessfulLoginResponse)||void 0===r?void 0:r.WcfVersion;return!!s&&U.supportsVersionFeaturesOf(s,t)},U.supportsVersionFeaturesOf=(e,t)=>s.compare(e,t,">=")||s.compare(e,"1.0.0.0","=");class j{}j.textBox="TextBox",j.comboBox="ComboBox",j.numericBox="NumericBox",j.relation="Relation",j.checkBox="CheckBox",j.linkTextBox="LinkTextBox",j.dateEdit="DateEdit",j.memoBox="MemoBox",j.multiSelectComboBox="MultiSelectComboBox",j.workflowState="WorkflowState",j.image="Image",j.multiSelectRelation="MultiSelectRelation";const B={[m.relations]:0,[m.unifiedRelations]:1,[m.users]:2,[m.groups]:3,[m.enumTypes]:4,[m.enumValues]:5,[m.additionalFields]:6};var W,H,z,Q;exports.Version=void 0,(W=exports.Version||(exports.Version={})).Version75="7.5",W.Version76="7.6",W.Version77="7.7",W.Version81="8.1",W.Version82="8.2",W.Version83="8.3",W.Version90="9.0",W.Version91="9.1",W.Version92="9.2";class $ extends U{}$.is75OrLater=e=>U.supportsFeaturesOf(e,exports.Version.Version75),$.is76OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version76),$.is77OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version77),$.is81OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version81),$.is82OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version82),$.is83OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version83),$.is90OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version90),$.is91OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version91),$.is92OrLater=e=>$.supportsFeaturesOf(e,exports.Version.Version92),$.isFeatureSupported=(e,t)=>$.supportsFeaturesOf(e,t);class q{static createHubItemsCountsQuery(e,t,r){return{__type:"HubItemsCountsQuery:#EQ",ParentItemGuids:e,ItemTypes:t,ExcludeSystemItems:r}}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]}}}q.column=e=>({__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:e}),q.multiSelectComboColumnLegacy=(e,t,r)=>({__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:"ItemGUID",Transformation:`[dbo].[GetConcatenatedEnumValuesRelationsValues]({0}, '${e}', '${t}'`,Alias:null!=r?r:e}),q.multiSelectComboColumn=(e,t,r,s,o)=>{if(!$.is77OrLater(e))return q.multiSelectComboColumnLegacy(r,s,o);return{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:"ItemGUID",Transformation:`[dbo].[GetConcatenatedEnumValuesRelationsValues_WithObjectTypeID]({0}, dbo.GetObjectTypeID('${t}'), '${r}', '${s}')`,Alias:null!=o?o:r}},q.joinColumn=(e,t,r,s,o)=>{const n={__type:"Column:#EQ",Source:{__type:"Join:#EQ",ItemType:e,Key:{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:t},TargetColumnName:o},Name:r};return s&&(n.Alias=s),n},q.singleVariatedColumn=(e,t,r)=>q.variatedColumn([q.columnVariation(e,t)],r),q.variatedColumn=(e,t)=>{const r={__type:"VariatedColumn:#EQ",Source:{__type:"MainTable:#EQ"},Variations:e};return t&&(r.Alias=t),r},q.columnVariation=(e,t,r)=>{const s={FolderName:t,Field:{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:e}};return r&&(s.Field.Transformation=r),s},q.joinColumnVariation=(e,t,r,s)=>({FolderName:e,Field:{__type:"Column:#EQ",Source:{__type:"Join:#EQ",ItemType:t,Key:{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:r}},Name:s}}),q.relationColumnVariation=(e,t,r,s)=>({FolderName:e,Field:{__type:"Column:#EQ",Source:{__type:"Relation:#EQ",RelationType:t,Direction:1,ItemTypes:r},Name:s}}),q.relatedColumn=(e,t,r,s)=>{const o={__type:"Column:#EQ",Source:{__type:"Relation:#EQ",RelationType:e,Direction:1,ItemTypes:t},Name:r};return s&&(o.Alias=s),o},q.relatedSubstituableColumn=(e,t,r,s,o)=>{const n={__type:"SubstituableColumn:#EQ",Source:{__type:"Relation:#EQ",RelationType:e,Direction:1,ItemTypes:t},Name:r,Substitute:s};return o&&(n.Alias=o),n},q.relatedColumnFolderNameToken=(e,t,r)=>({__type:"Token:#EQ",Source:{__type:"Relation:#EQ",RelationType:e,Direction:1,ItemTypes:t},TypeName:"ItemType",Alias:r}),q.folderNameToken=e=>({__type:"Token:#EQ",Source:{__type:"MainTable:#EQ"},TypeName:"ItemType",Alias:null!=e?e:"FolderName"}),q.equalsFilterExpression=(e,t)=>({__type:"EqualsFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.notEqualsExpression=(e,t)=>({__type:"NotFilterExpression:#EQ",Child:q.equalsFilterExpression(e,t)}),q.andFilterExpression=e=>({__type:"AndFilterExpressionOperator:#EQ",Children:e}),q.orFilterExpression=e=>({__type:"OrFilterExpressionOperator:#EQ",Children:e}),q.lessFilterExpression=(e,t)=>({__type:"LessFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.lessOrEqualFilterExpression=(e,t)=>({__type:"LessOrEqualFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.greaterFilterExpression=(e,t)=>({__type:"GreaterFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.greaterOrEqualFilterExpression=(e,t)=>({__type:"GreaterOrEqualFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.likeFilterExpression=(e,t)=>({__type:"LikeFilterExpressionPredicate:#EQ",Field:e,Value:`%${t}%`}),q.inFilterExpression=(e,t)=>({__type:"InFilterExpressionPredicate:#EQ",Field:e,Value:t}),q.isNullOrEmptyFilterExpression=e=>q.orFilterExpression([q.equalsFilterExpression(q.column(e),null),q.equalsFilterExpression(q.column(e),"")]);class J{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())}`}}J.isValid=e=>e instanceof Date&&!isNaN(e.getTime()),J.areDaysEqual=(e,t)=>{const r=J.clearTime(e),s=J.clearTime(t);return r.getTime()===s.getTime()},J.areTimesEqual=(e,t)=>e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes(),J.areDatesEqual=(e,t)=>!!e&&!!t&&J.areDaysEqual(e,t)&&J.areTimesEqual(e,t),J.clearTime=e=>{const t=new Date(e);return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t},J.isWithoutTime=e=>0===e.getHours()&&0===e.getMinutes()&&0===e.getSeconds(),J.getFormattedSqlDateTime=e=>e.toISOString().slice(0,19).replace("T"," "),J.getRfcWithoutTimezone=e=>e.slice(0,19),exports.TransformItemFormats=void 0,(H=exports.TransformItemFormats||(exports.TransformItemFormats={})).OpenXmlDocx="OpenXmlDocx",H.Pdf="Pdf",H.WordMlXml="WordMlXml";exports.EnumTypeEditMode=void 0,(z=exports.EnumTypeEditMode||(exports.EnumTypeEditMode={})).Readonly="Readonly",z.VisibleRankDefaultOnly="VisibleRankDefaultOnly",z.Editable="Editable",exports.ImportResult=void 0,(Q=exports.ImportResult||(exports.ImportResult={})).Success="Success",Q.Failure="Failed",Q.FailureDuplicityFound="Failed_DuplicityFound",Q.FailureItemAlreadyRemoved="Failed_ItemAlreadyRemoved",Q.FailureColumnsLockedWFAction="Failed_ColumnsLocked",Q.FailureItemLockedWFAction="Failed_ItemLocked",Q.FailureLicenceLimitReached="Failed_LicenseLimitReached",Q.FailureInssuficientModulePermission="Failed_InsufficientModulePermission",Q.FailureInssuficientColumnsPermission="Failed_InsufficientColumnsPermission",c.polyfill(),exports.ApiConnectionAsNonDefaultExport=S,exports.ApiMethods=p,exports.ColumnPermissionMandatoryRules=w,exports.ColumnPermissionPermissionRules=D,exports.CommonDataConnection=class{constructor(e,t){this.isCommonDataApiEnabled=(e,t)=>{this.tokenizedConnection.isEnabled(e,t)},this.callCommonDataApi=(e,t,r,s)=>{this.tokenizedConnection.callTokenizedApi(e,t,r,s)},this.tokenizedConnection=new A("ObtainCommonDataApiAccessToken",exports.HttpMethod.get,!1,"InvalidCommonDataToken",I,e,t)}},exports.CustomizationStatsItemKeys=M,exports.DateHelper=J,exports.EWItem=class{constructor(e,t){if(!e||!t)throw new Error("Both folderName and baseItem has to be defined!");this.folderName=e,this.baseItem=t}getEmailAddress(){switch(this.folderName){case m.contacts:{const e=this.baseItem;return e.Email1Address||e.Email2Address||e.Email3Address}case m.leads:return this.baseItem.Email;case m.companies:return this.baseItem.Email;case m.users:{const e=this.baseItem;return e.Email1Address||e.Email2Address}default:return null}}getInitials(){switch(this.folderName){case m.contacts:{const e=this.baseItem;return this.getInitialsInternal(e.FirstName,e.LastName)}case m.users:{const e=this.baseItem;return this.getInitialsInternal(e.FirstName,e.LastName)}default:return null}}getInitialsInternal(e,t){const r=((null==e?void 0:e.substr(0,1))||"")+((null==t?void 0:t.substr(0,1))||"");return""==r?null:r}getItemPreview(){switch(this.folderName){case m.contacts:{const e=this.baseItem;return e.ProfilePicture?{imageData:e.ProfilePicture,width:e.ProfilePictureWidth||0,height:e.ProfilePictureHeight||0}:null}case m.users:{const e=this.baseItem;return e.ProfilePicture?{imageData:e.ProfilePicture,width:e.ProfilePictureWidth||0,height:e.ProfilePictureHeight||0}:null}default:return null}}},exports.EnumTypes=d,exports.ErrorHelper=E,exports.ExpirationReason=V,exports.FieldNames=k,exports.FieldTypes=j,exports.FolderNames=m,exports.Functionality=R,exports.GlobalSettingsNames=v,exports.HttpRequestError=T,exports.LicenseKeyInvoiceSeverity=G,exports.LicenseRestrictionKeys=_,exports.OAuthHelper=C,exports.OAuthSessionHandlerBase=f,exports.ObjectTypeIds=B,exports.QueryHelper=q,exports.RelationTypes=b,exports.ReturnCodes=u,exports.StringHelper=class{static trim(e,t,r=!1){if(null==e)return e;let s=e.trim();return s.length<=t||(s=s.substring(0,t-(r?3:0)),r&&(s+="...")),s}},exports.TokenizedServiceConnection=A,exports.VersionHelper=$,exports.VersionHelperBase=U,exports.default=S;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface ITokenError {
|
|
2
|
+
error: string;
|
|
3
|
+
}
|
|
4
|
+
export interface ITokenSuccess {
|
|
2
5
|
access_token: string;
|
|
3
6
|
expires_in: number;
|
|
4
7
|
id_token?: string;
|
|
5
8
|
token_type: string;
|
|
6
9
|
refresh_token: string;
|
|
7
|
-
error:
|
|
10
|
+
error: undefined;
|
|
8
11
|
}
|
|
12
|
+
export type ITokenData = ITokenError | ITokenSuccess;
|
|
9
13
|
export type TInputData = Record<string, Object | null>;
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import type { ApiConnection, ISessionHandler } from './ApiConnection';
|
|
2
2
|
import type { TUnionError } from './exceptions/HttpRequestError';
|
|
3
3
|
import type { IApiLoginResponse } from './data/IApiLoginResponse';
|
|
4
|
+
export type GetAccessTokenResult = {
|
|
5
|
+
error: string;
|
|
6
|
+
accessToken?: undefined;
|
|
7
|
+
} | {
|
|
8
|
+
error?: undefined;
|
|
9
|
+
accessToken: string;
|
|
10
|
+
};
|
|
4
11
|
export declare abstract class OAuthSessionHandlerBase implements ISessionHandler {
|
|
5
12
|
lastSuccessfulLoginResponse?: IApiLoginResponse;
|
|
6
|
-
private accessToken
|
|
13
|
+
private accessToken?;
|
|
7
14
|
private readonly username;
|
|
8
15
|
private readonly appVersion;
|
|
9
16
|
protected readonly errorCallback: ((error: TUnionError) => void) | undefined;
|
|
10
17
|
private readonly getNewAccessTokenCallback;
|
|
11
|
-
constructor(username: string, accessToken: string, appVersion: string, getNewAccessTokenCallback: ((connection: ApiConnection, callback: (
|
|
18
|
+
constructor(username: string, accessToken: string, appVersion: string, getNewAccessTokenCallback: ((connection: ApiConnection, callback: (result: GetAccessTokenResult) => void) => void), errorCallback?: (error: TUnionError) => void);
|
|
12
19
|
readonly invalidateSessionId: (_: string, callback: () => void) => void;
|
|
13
20
|
readonly getSessionId: (connection: ApiConnection, callback: (sessionId: string) => void) => void;
|
|
14
21
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type TRelationType = 'GENERAL' | 'GROUP' | 'CONTACTPERSON' | 'CONTACT' | 'CUSTOMER' | 'COMPANY' | 'OUTLOOKPROJECT' | 'SUPERVISOR' | 'PROJECT_ORIGIN';
|
|
1
|
+
export type TRelationType = 'GENERAL' | 'GROUP' | 'CONTACTPERSON' | 'CONTACT' | 'CUSTOMER' | 'COMPANY' | 'OUTLOOKPROJECT' | 'SUPERVISOR' | 'PROJECT_ORIGIN' | 'CART' | 'GOODSINCART';
|
|
2
2
|
export default class RelationTypes {
|
|
3
3
|
static readonly general: TRelationType;
|
|
4
4
|
static readonly group: TRelationType;
|
|
@@ -9,4 +9,6 @@ export default class RelationTypes {
|
|
|
9
9
|
static readonly outlookProject: TRelationType;
|
|
10
10
|
static readonly supervisor: TRelationType;
|
|
11
11
|
static readonly projectOrigin: TRelationType;
|
|
12
|
+
static readonly cart: TRelationType;
|
|
13
|
+
static readonly goodsInCart: TRelationType;
|
|
12
14
|
}
|
|
@@ -2,6 +2,7 @@ import { type TFolderName } from "../constants/FolderNames";
|
|
|
2
2
|
import type { ApiConnection } from '../ApiConnection';
|
|
3
3
|
import type { IApiQueryAndFilterExpressionOperator, IApiQueryEqualsFilterExpressionPredicate, IApiQueryGreaterFilterExpressionPredicate, IApiQueryGreaterOrEqualFilterExpressionPredicate, IApiQueryLessFilterExpressionPredicate, IApiQueryLessOrEqualFilterExpressionPredicate, IApiQueryLikeFilterExpressionPredicate, IApiQueryInFilterExpressionPredicate, IApiQueryNotFilterExpression, IApiQueryOrFilterExpressionOperator, TApiQueryFilterExpression } from '../data/query/IApiQueryFilters';
|
|
4
4
|
import type { IApiQueryColumn, IApiQueryColumnVariation, IApiQueryToken, IApiQueryVariatedColumn, TApiQueryField, IApiQuerySubstituableColumn } from "../data/query/IApiQuery";
|
|
5
|
+
import type { TRelationType } from '../constants/RelationTypes';
|
|
5
6
|
type TFilterValue = string | number | boolean | null;
|
|
6
7
|
export default class QueryHelper {
|
|
7
8
|
static createHubItemsCountsQuery(parentItemGuids: string[], itemTypes: TFolderName[], excludeSystemItems?: boolean): {
|
|
@@ -10,6 +11,16 @@ export default class QueryHelper {
|
|
|
10
11
|
ItemTypes: TFolderName[];
|
|
11
12
|
ExcludeSystemItems: boolean | undefined;
|
|
12
13
|
};
|
|
14
|
+
static createRelatedTableQuery(baseItemGuid: string, itemTypes: TFolderName | TFolderName[], relationType?: TRelationType): {
|
|
15
|
+
__type: string;
|
|
16
|
+
BaseItemID: string;
|
|
17
|
+
ItemTypes: TFolderName[];
|
|
18
|
+
RelationType: TRelationType | undefined;
|
|
19
|
+
};
|
|
20
|
+
static createMainTableQuery(itemTypes: TFolderName | TFolderName[]): {
|
|
21
|
+
__type: string;
|
|
22
|
+
ItemTypes: TFolderName[];
|
|
23
|
+
};
|
|
13
24
|
static column: (colName: string) => IApiQueryColumn;
|
|
14
25
|
/**
|
|
15
26
|
* For versions < 7.7
|
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 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){
|
|
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(E):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),y="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){return function(){return process.nextTick(E)}}function C(){return void 0!==o?function(){o(E)}:g()}function P(){var e=0,t=new m(E),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}function f(){var e=new MessageChannel;return e.port1.onmessage=E,function(){return e.port2.postMessage(0)}}function g(){var e=setTimeout;return function(){return e(E,1)}}var T=new Array(1e3);function E(){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 S(){try{var e=Function("return this")().require("vertx");return o=e.runOnLoop||e.runOnContext,C()}catch(e){return g()}}var A=void 0;function I(e,t){var r=this,n=new this.constructor(b);void 0===n[k]&&$(n);var s=r._state;if(s){var o=arguments[s-1];a((function(){return j(s,n,o,r._result)}))}else B(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(b);return L(r,e),r}A=p?h():m?P():y?f():void 0===u?S():g();var k=Math.random().toString(36).substring(2);function b(){}var D=void 0,w=1,F=2;function N(){return new TypeError("You cannot resolve a promise with itself")}function O(){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 x(e,t,r){a((function(e){var n=!1,s=R(r,t,(function(r){n||(n=!0,t!==r?L(e,r):U(e,r))}),(function(t){n||(n=!0,V(e,t))}),"Settle: "+(e._label||" unknown promise"));!n&&s&&(n=!0,V(e,s))}),e)}function M(e,t){t._state===w?U(e,t._result):t._state===F?V(e,t._result):B(t,void 0,(function(t){return L(e,t)}),(function(t){return V(e,t)}))}function _(e,r,n){r.constructor===e.constructor&&n===I&&r.constructor.resolve===v?M(e,r):void 0===n?U(e,r):t(n)?x(e,r,n):U(e,r)}function L(t,r){if(t===r)V(t,N());else if(e(r)){var n=void 0;try{n=r.then}catch(e){return void V(t,e)}_(t,r,n)}else U(t,r)}function G(e){e._onerror&&e._onerror(e._result),W(e)}function U(e,t){e._state===D&&(e._result=t,e._state=w,0!==e._subscribers.length&&a(W,e))}function V(e,t){e._state===D&&(e._state=F,e._result=t,a(G,e))}function B(e,t,r,n){var s=e._subscribers,o=s.length;e._onerror=null,s[o]=t,s[o+w]=r,s[o+F]=n,0===o&&e._state&&a(W,e)}function W(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?j(r,n,s,o):s(o);e._subscribers.length=0}}function j(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,O())}else i=s;r._state!==D||(o&&l?L(r,i):!1===l?V(r,a):e===w?U(r,i):e===F&&V(r,i))}function H(e,t){try{t((function(t){L(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(b),this.promise[k]||$(this.promise),r(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?U(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&U(this.promise,this._result))):V(this.promise,q())}return e.prototype._enumerate=function(e){for(var t=0;this._state===D&&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 s=void 0,o=void 0,i=!1;try{s=e.then}catch(e){i=!0,o=e}if(s===I&&e._state!==D)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):_(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===D&&(this._remaining--,e===F?V(n,r):this._result[t]=r),0===this._remaining&&U(n,this._result)},e.prototype._willSettleAt=function(e,t){var r=this;B(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 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]=Q(),this._result=this._state=void 0,this._subscribers=[],b!==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!==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=v,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",function(e){e.get="get",e.post="post"}(o||(o={}));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.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,s,o){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)t&&t(r);else{const e=new Error("Successful login but no session came.");if(!this.errorCallback)throw e;this.errorCallback(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 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 y{static createAuthorizeUrl(e,t,r,n,s,o,i=!1){if(s&&!o||!s&&o)throw new Error("If codeChallenge is defined, codeChallengeMethod must also be defined and vice versa");let a=`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&&(a+=`&state=${encodeURIComponent(n)}`),s&&o&&(a+=`&code_challenge=${encodeURIComponent(s)}&code_challenge_method=${encodeURIComponent(o)}`),a}}y.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"),y.callTokenEndpoint(e,a,i)},y.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"),y.callTokenEndpoint(e,o,s)},y.getWebServiceUrl=e=>{const r=e.split(".");if(2!==r.length)throw new Error("Invalid token supplied");return t.decode(r[1])},y.getUserName=e=>y.decodeAccessToken(e).username,y.decodeAccessToken=e=>r(e),y.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=>{if(!e.response||400!=e.response.status)throw new Error("Token request failed");n(e.response.data)}))};class h extends Error{constructor(e,t){super(),this.returnCode=e,this.message=t}}class C{constructor(e,t,r,n,s){if(this.invalidateSessionId=(e,t)=>{t&&t()},this.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)t&&t(r);else{const e=new Error("Successful login but no session came.");if(!this.errorCallback)throw e;this.errorCallback(e)}}),(e=>{const t=new h(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,n)=>{this.accessToken=r,n||this.getSessionId(e,t)}))}))},!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}}class P extends C{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)=>{y.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)))}t(e.access_token,e.error)}))}),i),this.refreshToken=n,this.clientId=t,this.clientSecret=r,this.refreshTokenCallback=a}}class f extends Error{constructor(e,t){super(),this.statusCode=e,this.message=t}}class g{}g.stringifyError=e=>JSON.stringify(e,g.replaceErrors),g.replaceErrors=(e,t)=>{if(t instanceof Error){const e={};return Object.getOwnPropertyNames(t).forEach((r=>{e[r]=t[r]})),e}return t};class E{constructor(r,n,s,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,s)=>{const o=t.encode(this.baseUri);let i="eway://"+r;n&&(i+="/"+(null==n?void 0:n.toLowerCase()));const a=e?"open.eway-crm.dev":"open.eway-crm.com";i=t.encode(i);let l="https://"+a+"/?ws="+o+"&l="+i;return s&&(l+="&n="+encodeURIComponent(s)),l},this.askUploadMethod=(e,t,r,n,s)=>new Promise(((o,i)=>{const a=s?e=>{throw i(e),e}:i;this.callUploadMethod(e,t,r,o,a,a,n)})),this.callUploadMethod=(t,r,n,s,o,i,a)=>{const c=()=>{this.sessionHandler.getSessionId(this,(e=>{this.sessionId=e,this.callUploadMethod(t,r,n,s,o,i,a)}))},u=this.sessionId;if(!u)return void c();const d=`${this.svcUri}/SaveBinaryAttachment?sessionId=${this.sessionId}&itemGuid=${t}&fileName=${encodeURIComponent(r)}`,m=e.post(d,n,a);E.handleCallPromise(m,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 "+d+": "+g.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.askMethod=(e,t,r,n)=>new Promise(((s,o)=>{const i=n?e=>{throw o(e),e}:o;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!==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,s,i)},this.callWithoutSession=(t,r,n,s,i,a,l)=>{var c;a||(a=o.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 o.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 o.post:p=e.post(u,r,m);break;default:throw new Error(`Unknown http method '${a}'.`)}E.handleCallPromise(p,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+": "+g.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)=>`${this.svcUri}/${d.transformItem}?itemGuid=${encodeURIComponent(e)}&itemFolderName=${encodeURIComponent(t)}&transformationGuid=${encodeURIComponent(r)}&outputFormat=${n}`,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=E.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}get supportsGetItemPreviewMethod(){return this.supportGetItemPreviewMethod}static create(e,t,r,n,s,o,i,a){return new E(e,new m(t,r,n,s,o,i),i,a)}static createAnonymous(e,t){return new E(e,new p,t)}static createUsingOAuth(e,t,r,n,s,o,i,a,l,c){return new E(e,new P(t,r,n,s,o,i,a,l),a,c)}static normalizeWsUrl(e){return e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),e}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(new f(e.status,e.statusText))})).catch((e=>{e.response?n(new f(e.response.status,e.response.statusText)):n(e)}))}}class T{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,T.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(new f(e.status,e.statusText))})).catch((e=>{e.response?i(new f(e.response.status,e.response.statusText)):i(e)}))}}const S=e=>({url:e.ServiceUrl,token:e.Token});class A{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 T("ObtainCommonDataApiAccessToken",o.get,!1,"InvalidCommonDataToken",S,e,t)}}class I{}I.acceptableBackwardWorkReportDays="AcceptableBackwardWorkReportDays",I.adminAppInactiveLogoutTime="AdminAppInactiveLogoutTime",I.applyGeneralDataProtectionRules="ApplyGeneralDataProtectionRules",I.automaticallyCreateJournalAfterCallDuration="AutomaticallyCreateJournalAfterCallDuration",I.bonusesCompletedState="BonusesCompletedState",I.cartInvoicedState="CartInvoicedState",I.cartOrderCanceledState="CartOrderCanceledState",I.cartOrderInProcessState="CartOrderInProcessState",I.cartOrderProcessedState="CartOrderProcessedState",I.cartPaidState="CartPaidState",I.cartProposalInProcessState="CartProposalInProcessState",I.cartProposalProcessedState="CartProposalProcessedState",I.cartSalesVoucherIssuedState="CartSalesVoucherIssuedState",I.cartToBeInvoicedState="CartToBeInvoicedState",I.cartVoidedState="CartVoidedState",I.clickToCallScheme="ClickToCallScheme",I.companyDuplicityCheckEnabled="CompanyDuplicityCheckEnabled",I.completedStateName="CompletedStateName",I.contactDuplicityCheckEnabled="ContactDuplicityCheckEnabled",I.createCompanyWhileImportingContactFromOutlook="CreateCompanyWhileImportingContactFromOutlook",I.enableContactsTwoWaySyncWithM365="EnableContactsTwoWaySyncWithM365",I.deadStateName="DeadStateName",I.enableCompaniesSyncIntoMobileDeviceContacts="EnableCompaniesSyncIntoMobileDeviceContacts",I.enableContactsSyncIntoMobileDevice="EnableContactsSyncIntoMobileDevice",I.enableLeadsSyncIntoMobileDeviceContacts="EnableLeadsSyncIntoMobileDeviceContacts",I.enableLlamaAiFeatures="EnableLlamaAiFeatures",I.enableUsersSyncIntoMobileDeviceContacts="EnableUsersSyncIntoMobileDeviceContacts",I.emailsActiveProjectsLeadsFilter="EmailsActiveProjectsLeadsFilter",I.exchangeRatesAdminGroupName="ExchangeRatesAdminGroupName",I.forcedEmailTrackingGroups="ForcedEmailTrackingGroups",I.ignoreEmailsFromDomainsOnEmailsTracking="IgnoreEmailsFromDomainsOnEmailsTracking",I.trackEmailsFromDomains="TrackEmailsFromDomains",I.groupsForAllUnpaidInvoicesNotification="GroupsForAllUnpaidInvoicesNotification",I.itemPreviewMaxHeight="ItemPreviewMaxHeight",I.lastActivityAttributes="LastActivityAttributes",I.leadsCompletedState="LeadsCompletedState",I.leadDeadlineAlertGroups="LeadDeadlineAlertGroups",I.leadsDeadState="LeadsDeadState",I.marketingCompletedState="MarketingCompletedState",I.marketingDeadState="MarketingDeadState",I.minimumPasswordLength="MinimumPasswordLength",I.nextStepAttributes="NextStepAttributes",I.notifyAboutInvoicedInvoiceInPohodaGroup="NotifyAboutInvoicedInvoiceInPohodaGroup",I.notifyAboutLeadsDeadline="NotifyAboutLeadsDeadline",I.notifyAboutPaidInvoiceInPohodaGroup="NotifyAboutPaidInvoiceInPohodaGroup",I.notifyAboutProjectDeadline="NotifyAboutProjectDeadline",I.numberOfDecimalPlaces="NumberOfDecimalPlaces",I.phoneListTaskSolverGroup="PhoneListTaskSolverGroup",I.projectDeadlineAlert="ProjectDeadlineAlert",I.serverUpdateProgressNotificationGroup="ServerUpdateProgressNotificationGroup",I.sumarizeCartsPricesOnLeads="SumarizeCartsPricesOnLeads",I.sumarizeCartsPricesOnProjects="SumarizeCartsPricesOnProjects",I.sumarizePeopleExpensesOnProjects="SumarizePeopleExpensesOnProjects",I.systemHealthNotificationGroup="SystemHealthNotificationGroup",I.tasksCompletedState="TasksCompletedState",I.tasksDeferredState="TasksDeferredState",I.tasksInProgressState="TasksInProgressState",I.tasksNotStartedState="TasksNotStartedState",I.tasksWaitOnSomeoneElseState="TasksWaitOnSomeoneElseState",I.trackDocumentVersions="TrackDocumentVersions",I.vacationCompletedState="VacationCompletedState",I.workReportApprovedState="WorkReportApprovedState",I.defaultLanguage="DefaultLanguage",I.defaultCurrency="DefaultCurrency",I.myCompanyCountry="MyCompanyCountry",I.myCompanyName="MyCompanyName",I.myCompanyStreet="MyCompanyStreet",I.myCompanyCity="MyCompanyCity",I.myCompanyState="MyCompanyState",I.myCompanyZip="MyCompanyZIP",I.myCompanyId="MyCompanyID",I.myCompanyVat="MyCompanyVAT",I.mergeGoodsInCart="MergeGoodsInCart",I.cartRefreshLogic="CartRefreshLogic",I.goodsDefaultQuantity="GoodsDefaultQuantity",I.goodsDefaultVAT="GoodsDefaultVAT",I.goodsDefaultVATIncluded="GoodsDefaultVATIncluded";class v{}v.ServerCommon={Server_ID:"Server_ID",Server_ItemCreated:"Server_ItemCreated",Server_ItemChanged:"Server_ItemChanged"},v.Common={CreatedByGUID:"CreatedByGUID",CurrencyEn:"CurrencyEn",DefaultCurrencySuffix:"DefaultCurrency",FileAs:"FileAs",ItemCreated:"ItemCreated",ItemChanged:"ItemChanged",ItemGUID:"ItemGUID",ItemVersion:"ItemVersion",ModifiedByGUID:"ModifiedByGUID",OwnerGUID:"OwnerGUID",ParentCurrencySuffix:"ParentCurrency"},v.Calendar={EndDate:"EndDate",Note:"Note"},v.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"},v.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"},v.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"},v.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:v.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"},v.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"},v.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"},v.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"},v.Goods=Object.assign(Object.assign({},v.GoodsBase),{PriceListGroupGUID:"PriceListGroupGUID",InventoryQuantity:"InventoryQuantity"}),v.GoodsInCart=Object.assign(Object.assign({},v.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"}),v.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"},v.Vacation={StartDate:"StartDate",EndDate:"EndDate",User:"User",Duration:"Duration",Place:"Place",Note:"Note",AllDay:"AllDay",TypeEn:"TypeEn",StateEn:"StateEn",IsPrivate:"Private"},v.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"},v.Projects={HumanID:"HID",FileAs:"FileAs",ProjectName:"ProjectName",ProjectOriginEn:"ProjectOriginEn",TypeEn:"TypeEn",StateEn:"StateEn",PaymentTypeEn:"PaymentTypeEn",ProjectStart:"ProjectStart",ProjectRealEnd:"ProjectRealEnd",EstimatedEnd:"ProjectEnd",CurrencyEn:v.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"},v.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"},v.Training={TitleEn:"TitleEn"},v.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"},v.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"},v.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"},v.PriceListGroups={Note:"Note"},v.Prices={SalePriceGUID:"SalePriceGUID",GoodsItemGUID:"GoodsItemGUID",Price:"Price",CurrencyEn:"CurrencyEn"},v.SalePrices={Note:"Note",Discount:"Discount",TypeEn:"TypeEn",StateEn:"StateEn",PrevStateEn:"PrevStateEn"},v.XsltTransformations={LangCode:"LangCode",Definition:"Definition",Namespace:"Namespace",ObjectTypeID:"ObjectTypeID",TransformationVersion:"TransformationVersion"},v.XsltTransformationsModels={ObjectTypeID:"ObjectTypeID",TransformationGUID:"TransformationGUID",ItemTypeGUID:"ItemTypeGUID"},v.allTypeEnNames=["TypeEn",v.Documents.DocTypeEn,v.WorkReports.WorkReportEn,"TitleEn"],v.getFolderFileAs=e=>{switch(e){case u.leads:return v.Leads.FileAs;case u.projects:return v.Projects.ProjectName;case u.documents:return v.Documents.DocName;case u.companies:return v.Companies.CompanyName;case u.contacts:case u.users:return v.Common.FileAs;case u.emails:return v.Emails.Subject;case u.journal:return v.Journal.FileAs;case u.tasks:return v.Tasks.Subject;case u.workReports:return v.WorkReports.Subject;case u.vacation:return v.Vacation.TypeEn;case u.carts:case u.goods:case u.goodsInCart:return v.Common.FileAs;case u.groups:return v.Groups.GroupName;case u.xsltTransformations:return v.Common.FileAs;default:return console.warn(`FileAs col name not defined for folderName ${e}`),v.Common.FileAs}};class k{}k.general="GENERAL",k.group="GROUP",k.contactPerson="CONTACTPERSON",k.contact="CONTACT",k.customer="CUSTOMER",k.company="COMPANY",k.outlookProject="OUTLOOKPROJECT",k.supervisor="SUPERVISOR",k.projectOrigin="PROJECT_ORIGIN";class D{}D.all="All",D.own="Own",D.readonly="Readonly",D.invisible="Invisible",D.none="None";class b{}var w,F,N,O;b.mandatory="Mandatory",b.optional="Optional",b.unique="Unique",b.none="None",function(e){e.Free="Free",e.Basic="Basic",e.Professional="Professional",e.Enterprise="Enterprise"}(w||(w={})),function(e){e.ContactsAndCompanies="ContactsAndCompanies",e.Sales="Sales",e.Projects="Projects",e.Marketing="Marketing"}(F||(F={})),function(e){e[e.Negative=0]="Negative",e[e.Neutral=1]="Neutral",e[e.Positive=2]="Positive"}(N||(N={}));class R{}R.contactsSynchronizationWithOutlook="ContactsSynchronizationWithOutlook",R.wordAddin="WordAddin",R.excelAddin="ExcelAddin",R.tasksRecurrentTasks="TasksRecurrentTasks",R.tasksSubtasks="TasksSubtasks",R.tasksSynchronizationWithOutlook="TasksSynchronizationWithOutlook",R.calendarSynchronizationWithOutlook="CalendarSynchronizationWithOutlook",R.emailsAutomaticTracking="EmailsAutomaticTracking",R.convertEmailToProject="ConvertEmailToProject",R.duplicityChecker="DuplicityChecker",R.nextStepAndLastActivityCustomization="NextStepAndLastActivityCustomization",R.subProjects="SubProjects",R.resourceAndPlanning="ResourceAndPlanning",R.professionalEmailCampaigns="ProfessionalEmailCampaigns",R.professionalEmailCampaignsAdvancedStatistics="ProfessionalEmailCampaignsAdvancedStatistics",R.wordEmailMerge="WordEmailMerge",R.printLabels="PrintLabels",R.printEnvelopes="PrintEnvelopes",R.userViews="UserViews",R.sharedUserViews="SharedUserViews",R.gridConditionalFormating="GridConditionalFormating",R.multipleCurrencies="MultipleCurrencies",R.historyTracking="HistoryTracking",R.privateItems="PrivateItems",R.itemTypes="ItemTypes",R.formLayoutCustomization="FormLayoutCustomization",R.workflowBasicDefinitions="WorkflowBasicDefinitions",R.workflowAdvancedDefinitions="WorkflowAdvancedDefinitions",R.workflowAdvancedDefinitionsRules="WorkflowAdvancedDefinitionsRules",R.workflowAdvancedDefinitionsActions="WorkflowAdvancedDefinitionsActions",R.workflowGroupLevelActions="WorkflowGroupLevelActions",R.customFields="CustomFields",R.importantFields="ImportantFields",R.mandatoryFields="MandatoryFields",R.uniqueFields="UniqueFields",R.readOnlyFields="ReadOnlyFields",R.transformationCustomTemplates="TransformationCustomTemplates",R.userRoles="UserRoles",R.modulePermissions="ModulePermissions",R.columnPermissions="ColumnPermissions",R.api="API",R.gate="Gate",R.threeCXIntegration="ThreeCXIntegration",R.tapiIntegration="TapiIntegration",R.pohodaIntegration="PohodaIntegration",R.pohodaSynchronizationIntervalCustomization="PohodaSynchronizationIntervalCustomization",R.pohodaSynchronizationFieldMappingCustomization="PohodaSynchronizationFieldMappingCustomization",R.quickBooksIntegration="QuickBooksIntegration",R.saveBinaryDataOnDisk="SaveBinaryDataOnDisk",R.activeDirectoryLogin="ActiveDirectoryLogin",R.callerIdentificationOnApple="CallerIdentificationOnApple",R.legacyAdministration="LegacyAdministration";class x{}x.customAdditionalFieldsCount="CustomAdditionalFieldsCount",x.customEnabledAdvancedWorkflowsCount="CustomEnabledAdvancedWorkflowsCount",x.customEnabledBasicWorkflowsCount="CustomEnabledBasicWorkflowsCount",x.customMandatoryFieldsCount="CustomMandatoryFieldsCount",x.customOptionalFieldsCount="CustomOptionalFieldsCount",x.customReadonlyFieldsCount="CustomReadonlyFieldsCount",x.customUniqueFieldsCount="CustomUniqueFieldsCount",x.customVisibleTypesCount="CustomVisibleTypesCount",x.visibleCurrenciesCount="VisibleCurrenciesCount";class M{}M.contactsAutomaticSynchronizationWithOutlook="ContactsAutomaticSynchronizationWithOutlook",M.contactsSynchronizationWithOutlook="ContactsSynchronizationWithOutlook",M.contactsSynchronizationWithAndroid="ContactsSynchronizationWithAndroid",M.documentsRevisions="DocumentsRevisions",M.wordAddin="WordAddin",M.excelAddin="ExcelAddin",M.tasksReminders="TasksReminders",M.tasksRecurrentTasks="TasksRecurrentTasks",M.tasksSubtasks="TasksSubtasks",M.tasksSynchronizationWithOutlook="TasksSynchronizationWithOutlook",M.calendarSynchronizationWithOutlook="CalendarSynchronizationWithOutlook",M.emailsManualTracking="EmailsManualTracking",M.emailsAutomaticTracking="EmailsAutomaticTracking",M.emailSummaryAndSentimentToneFromAi="EmailSummaryAndSentimentToneFromAi",M.convertEmailToContact="ConvertEmailToContact",M.convertEmailToDeal="ConvertEmailToDeal",M.convertEmailToProject="ConvertEmailToProject",M.convertEmailToTask="ConvertEmailToTask",M.convertFromSuggestedContact="ConvertFromSuggestedContact",M.gravatarIntegration="GravatarIntegration",M.logoboxIntegration="LogoboxIntegration",M.companiesBussinesRegisterApiIntegration="CompaniesBussinesRegisterApiIntegration",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.gridRowSummary="GridRowSummary",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.commonDataAPI="CommonDataAPI",M.eWayCrmAPI="eWayCrmAPI",M.threeCXIntegration="ThreeCXIntegration",M.tapiIntegration="TapiIntegration",M.pohodaIntegration="PohodaIntegration",M.pohodaSynchronizationIntervalCustomization="PohodaSynchronizationIntervalCustomization",M.pohodaSynchronizationFieldMappingCustomization="PohodaSynchronizationFieldMappingCustomization",M.quickBooksIntegration="QuickBooksIntegration",M.shareByTeams="ShareByTeams",M.convertEmailToContactWithDataFromAi="ConvertEmailToContactWithDataFromAi",M.convertEmailToDealWithDataFromAi="ConvertEmailToDealWithDataFromAi",M.convertEmailToProjectWithDataFromAi="ConvertEmailToProjectWithDataFromAi",function(e){e.UnpaidImportantInvoices="UnpaidImportantInvoices",e.UncollectableSubscriptionPayment="UncollectableSubscriptionPayment",e.UncollectableSubscriptionPaymentWithExpiredCard="UncollectableSubscriptionPaymentWithExpiredCard",e.StandardSubscriptionPeriod="StandardSubscriptionPeriod"}(O||(O={}));var L,_=O;!function(e){e.License="License",e.CloudLicense="CloudLicense",e.MiscLicense="MiscLicense",e.Support="Support",e.Service="Service"}(L||(L={}));var G=L;class U{}U.getIsDebug=e=>{var t;return!!(null===(t=null==e?void 0:e.sessionHandler.lastSuccessfulLoginResponse)||void 0===t?void 0:t.Debug)},U.supportsFeaturesOf=(e,t)=>{var r;const n=null===(r=e.sessionHandler.lastSuccessfulLoginResponse)||void 0===r?void 0:r.WcfVersion;return!!n&&U.supportsVersionFeaturesOf(n,t)},U.supportsVersionFeaturesOf=(e,t)=>n(e,t,">=")||n(e,"1.0.0.0","=");class V{}V.textBox="TextBox",V.comboBox="ComboBox",V.numericBox="NumericBox",V.relation="Relation",V.checkBox="CheckBox",V.linkTextBox="LinkTextBox",V.dateEdit="DateEdit",V.memoBox="MemoBox",V.multiSelectComboBox="MultiSelectComboBox",V.workflowState="WorkflowState",V.image="Image",V.multiSelectRelation="MultiSelectRelation";const B={[u.relations]:0,[u.unifiedRelations]:1,[u.users]:2,[u.groups]:3,[u.enumTypes]:4,[u.enumValues]:5,[u.additionalFields]:6};var W,j,H,z;!function(e){e.Version75="7.5",e.Version76="7.6",e.Version77="7.7",e.Version81="8.1",e.Version82="8.2",e.Version83="8.3",e.Version90="9.0",e.Version91="9.1",e.Version92="9.2"}(W||(W={}));class Q extends U{}Q.is75OrLater=e=>U.supportsFeaturesOf(e,W.Version75),Q.is76OrLater=e=>Q.supportsFeaturesOf(e,W.Version76),Q.is77OrLater=e=>Q.supportsFeaturesOf(e,W.Version77),Q.is81OrLater=e=>Q.supportsFeaturesOf(e,W.Version81),Q.is82OrLater=e=>Q.supportsFeaturesOf(e,W.Version82),Q.is83OrLater=e=>Q.supportsFeaturesOf(e,W.Version83),Q.is90OrLater=e=>Q.supportsFeaturesOf(e,W.Version90),Q.is91OrLater=e=>Q.supportsFeaturesOf(e,W.Version91),Q.is92OrLater=e=>Q.supportsFeaturesOf(e,W.Version92),Q.isFeatureSupported=(e,t)=>Q.supportsFeaturesOf(e,t);class ${static createHubItemsCountsQuery(e,t,r){return{__type:"HubItemsCountsQuery:#EQ",ParentItemGuids:e,ItemTypes:t,ExcludeSystemItems:r}}}$.column=e=>({__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:e}),$.multiSelectComboColumnLegacy=(e,t,r)=>({__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:"ItemGUID",Transformation:`[dbo].[GetConcatenatedEnumValuesRelationsValues]({0}, '${e}', '${t}'`,Alias:null!=r?r:e}),$.multiSelectComboColumn=(e,t,r,n,s)=>{if(!Q.is77OrLater(e))return $.multiSelectComboColumnLegacy(r,n,s);return{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:"ItemGUID",Transformation:`[dbo].[GetConcatenatedEnumValuesRelationsValues_WithObjectTypeID]({0}, dbo.GetObjectTypeID('${t}'), '${r}', '${n}')`,Alias:null!=s?s:r}},$.joinColumn=(e,t,r,n,s)=>{const o={__type:"Column:#EQ",Source:{__type:"Join:#EQ",ItemType:e,Key:{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:t},TargetColumnName:s},Name:r};return n&&(o.Alias=n),o},$.singleVariatedColumn=(e,t,r)=>$.variatedColumn([$.columnVariation(e,t)],r),$.variatedColumn=(e,t)=>{const r={__type:"VariatedColumn:#EQ",Source:{__type:"MainTable:#EQ"},Variations:e};return t&&(r.Alias=t),r},$.columnVariation=(e,t,r)=>{const n={FolderName:t,Field:{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:e}};return r&&(n.Field.Transformation=r),n},$.joinColumnVariation=(e,t,r,n)=>({FolderName:e,Field:{__type:"Column:#EQ",Source:{__type:"Join:#EQ",ItemType:t,Key:{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:r}},Name:n}}),$.relationColumnVariation=(e,t,r,n)=>({FolderName:e,Field:{__type:"Column:#EQ",Source:{__type:"Relation:#EQ",RelationType:t,Direction:1,ItemTypes:r},Name:n}}),$.relatedColumn=(e,t,r,n)=>{const s={__type:"Column:#EQ",Source:{__type:"Relation:#EQ",RelationType:e,Direction:1,ItemTypes:t},Name:r};return n&&(s.Alias=n),s},$.relatedSubstituableColumn=(e,t,r,n,s)=>{const o={__type:"SubstituableColumn:#EQ",Source:{__type:"Relation:#EQ",RelationType:e,Direction:1,ItemTypes:t},Name:r,Substitute:n};return s&&(o.Alias=s),o},$.relatedColumnFolderNameToken=(e,t,r)=>({__type:"Token:#EQ",Source:{__type:"Relation:#EQ",RelationType:e,Direction:1,ItemTypes:t},TypeName:"ItemType",Alias:r}),$.folderNameToken=e=>({__type:"Token:#EQ",Source:{__type:"MainTable:#EQ"},TypeName:"ItemType",Alias:null!=e?e:"FolderName"}),$.equalsFilterExpression=(e,t)=>({__type:"EqualsFilterExpressionPredicate:#EQ",Field:e,Value:t}),$.notEqualsExpression=(e,t)=>({__type:"NotFilterExpression:#EQ",Child:$.equalsFilterExpression(e,t)}),$.andFilterExpression=e=>({__type:"AndFilterExpressionOperator:#EQ",Children:e}),$.orFilterExpression=e=>({__type:"OrFilterExpressionOperator:#EQ",Children:e}),$.lessFilterExpression=(e,t)=>({__type:"LessFilterExpressionPredicate:#EQ",Field:e,Value:t}),$.lessOrEqualFilterExpression=(e,t)=>({__type:"LessOrEqualFilterExpressionPredicate:#EQ",Field:e,Value:t}),$.greaterFilterExpression=(e,t)=>({__type:"GreaterFilterExpressionPredicate:#EQ",Field:e,Value:t}),$.greaterOrEqualFilterExpression=(e,t)=>({__type:"GreaterOrEqualFilterExpressionPredicate:#EQ",Field:e,Value:t}),$.likeFilterExpression=(e,t)=>({__type:"LikeFilterExpressionPredicate:#EQ",Field:e,Value:`%${t}%`}),$.inFilterExpression=(e,t)=>({__type:"InFilterExpressionPredicate:#EQ",Field:e,Value:t}),$.isNullOrEmptyFilterExpression=e=>$.orFilterExpression([$.equalsFilterExpression($.column(e),null),$.equalsFilterExpression($.column(e),"")]);class q{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 J{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())}`}}J.isValid=e=>e instanceof Date&&!isNaN(e.getTime()),J.areDaysEqual=(e,t)=>{const r=J.clearTime(e),n=J.clearTime(t);return r.getTime()===n.getTime()},J.areTimesEqual=(e,t)=>e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes(),J.areDatesEqual=(e,t)=>!!e&&!!t&&J.areDaysEqual(e,t)&&J.areTimesEqual(e,t),J.clearTime=e=>{const t=new Date(e);return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t},J.isWithoutTime=e=>0===e.getHours()&&0===e.getMinutes()&&0===e.getSeconds(),J.getFormattedSqlDateTime=e=>e.toISOString().slice(0,19).replace("T"," "),J.getRfcWithoutTimezone=e=>e.slice(0,19),function(e){e.OpenXmlDocx="OpenXmlDocx",e.Pdf="Pdf",e.WordMlXml="WordMlXml"}(j||(j={}));class X{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"}(H||(H={})),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.FailureLicenceLimitReached="Failed_LicenseLimitReached",e.FailureInssuficientModulePermission="Failed_InsufficientModulePermission",e.FailureInssuficientColumnsPermission="Failed_InsufficientColumnsPermission"}(z||(z={})),a.polyfill();export{E as ApiConnectionAsNonDefaultExport,d as ApiMethods,b as ColumnPermissionMandatoryRules,D as ColumnPermissionPermissionRules,A as CommonDataConnection,x as CustomizationStatsItemKeys,J as DateHelper,X as EWItem,w as Edition,H as EnumTypeEditMode,c as EnumTypes,g as ErrorHelper,_ as ExpirationReason,F as Feature,v as FieldNames,V as FieldTypes,u as FolderNames,R as Functionality,I as GlobalSettingsNames,o as HttpMethod,f as HttpRequestError,z as ImportResult,G as LicenseKeyInvoiceSeverity,M as LicenseRestrictionKeys,y as OAuthHelper,C as OAuthSessionHandlerBase,B as ObjectTypeIds,$ as QueryHelper,k as RelationTypes,l as ReturnCodes,N as SentimentTone,q as StringHelper,T as TokenizedServiceConnection,j as TransformItemFormats,W as Version,Q as VersionHelper,U as VersionHelperBase,E 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",function(e){e.get="get",e.post="post"}(o||(o={}));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.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,s,o){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)t&&t(r);else{const e=new Error("Successful login but no session came.");if(!this.errorCallback)throw e;this.errorCallback(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 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 y{static createAuthorizeUrl(e,t,r,n,s,o,i=!1){if(s&&!o||!s&&o)throw new Error("If codeChallenge is defined, codeChallengeMethod must also be defined and vice versa");let a=`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&&(a+=`&state=${encodeURIComponent(n)}`),s&&o&&(a+=`&code_challenge=${encodeURIComponent(s)}&code_challenge_method=${encodeURIComponent(o)}`),a}}y.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"),y.callTokenEndpoint(e,a,i)},y.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"),y.callTokenEndpoint(e,o,s)},y.getWebServiceUrl=e=>{const r=e.split(".");if(2!==r.length)throw new Error("Invalid token supplied");return t.decode(r[1])},y.getUserName=e=>y.decodeAccessToken(e).username,y.decodeAccessToken=e=>r(e),y.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 h extends Error{constructor(e,t){super(),this.returnCode=e,this.message=t}}class C{constructor(e,t,r,n,s){if(this.invalidateSessionId=(e,t)=>{t&&t()},this.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)t&&t(r);else{const e=new Error("Successful login but no session came.");if(!this.errorCallback)throw e;this.errorCallback(e)}}),(e=>{const t=new h(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)}))}))},!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}}class P extends C{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)=>{y.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 f extends Error{constructor(e,t){super(),this.statusCode=e,this.message=t}}class g{}g.stringifyError=e=>JSON.stringify(e,g.replaceErrors),g.replaceErrors=(e,t)=>{if(t instanceof Error){const e={};return Object.getOwnPropertyNames(t).forEach((r=>{e[r]=t[r]})),e}return t};class T{constructor(r,n,s,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,s)=>{const o=t.encode(this.baseUri);let i="eway://"+r;n&&(i+="/"+(null==n?void 0:n.toLowerCase()));const a=e?"open.eway-crm.dev":"open.eway-crm.com";i=t.encode(i);let l="https://"+a+"/?ws="+o+"&l="+i;return s&&(l+="&n="+encodeURIComponent(s)),l},this.askUploadMethod=(e,t,r,n,s)=>new Promise(((o,i)=>{const a=s?e=>{throw i(e),e}:i;this.callUploadMethod(e,t,r,o,a,a,n)})),this.callUploadMethod=(t,r,n,s,o,i,a)=>{const c=()=>{this.sessionHandler.getSessionId(this,(e=>{this.sessionId=e,this.callUploadMethod(t,r,n,s,o,i,a)}))},u=this.sessionId;if(!u)return void c();const d=`${this.svcUri}/SaveBinaryAttachment?sessionId=${this.sessionId}&itemGuid=${t}&fileName=${encodeURIComponent(r)}`,m=e.post(d,n,a);T.handleCallPromise(m,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 "+d+": "+g.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.askMethod=(e,t,r,n)=>new Promise(((s,o)=>{const i=n?e=>{throw o(e),e}:o;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!==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,s,i)},this.callWithoutSession=(t,r,n,s,i,a,l)=>{var c;a||(a=o.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 o.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 o.post:p=e.post(u,r,m);break;default:throw new Error(`Unknown http method '${a}'.`)}T.handleCallPromise(p,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+": "+g.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)=>`${this.svcUri}/${d.transformItem}?itemGuid=${encodeURIComponent(e)}&itemFolderName=${encodeURIComponent(t)}&transformationGuid=${encodeURIComponent(r)}&outputFormat=${n}`,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=T.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}get supportsGetItemPreviewMethod(){return this.supportGetItemPreviewMethod}static create(e,t,r,n,s,o,i,a){return new T(e,new m(t,r,n,s,o,i),i,a)}static createAnonymous(e,t){return new T(e,new p,t)}static createUsingOAuth(e,t,r,n,s,o,i,a,l,c){return new T(e,new P(t,r,n,s,o,i,a,l),a,c)}static normalizeWsUrl(e){return e&&e.endsWith("/")&&(e=e.substring(0,e.length-1)),e}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(new f(e.status,e.statusText))})).catch((e=>{e.response?n(new f(e.response.status,e.response.statusText)):n(e)}))}}class E{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,E.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(new f(e.status,e.statusText))})).catch((e=>{e.response?i(new f(e.response.status,e.response.statusText)):i(e)}))}}const S=e=>({url:e.ServiceUrl,token:e.Token});class A{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",o.get,!1,"InvalidCommonDataToken",S,e,t)}}class I{}I.acceptableBackwardWorkReportDays="AcceptableBackwardWorkReportDays",I.adminAppInactiveLogoutTime="AdminAppInactiveLogoutTime",I.applyGeneralDataProtectionRules="ApplyGeneralDataProtectionRules",I.automaticallyCreateJournalAfterCallDuration="AutomaticallyCreateJournalAfterCallDuration",I.bonusesCompletedState="BonusesCompletedState",I.cartInvoicedState="CartInvoicedState",I.cartOrderCanceledState="CartOrderCanceledState",I.cartOrderInProcessState="CartOrderInProcessState",I.cartOrderProcessedState="CartOrderProcessedState",I.cartPaidState="CartPaidState",I.cartProposalInProcessState="CartProposalInProcessState",I.cartProposalProcessedState="CartProposalProcessedState",I.cartSalesVoucherIssuedState="CartSalesVoucherIssuedState",I.cartToBeInvoicedState="CartToBeInvoicedState",I.cartVoidedState="CartVoidedState",I.clickToCallScheme="ClickToCallScheme",I.companyDuplicityCheckEnabled="CompanyDuplicityCheckEnabled",I.completedStateName="CompletedStateName",I.contactDuplicityCheckEnabled="ContactDuplicityCheckEnabled",I.createCompanyWhileImportingContactFromOutlook="CreateCompanyWhileImportingContactFromOutlook",I.enableContactsTwoWaySyncWithM365="EnableContactsTwoWaySyncWithM365",I.deadStateName="DeadStateName",I.enableCompaniesSyncIntoMobileDeviceContacts="EnableCompaniesSyncIntoMobileDeviceContacts",I.enableContactsSyncIntoMobileDevice="EnableContactsSyncIntoMobileDevice",I.enableLeadsSyncIntoMobileDeviceContacts="EnableLeadsSyncIntoMobileDeviceContacts",I.enableLlamaAiFeatures="EnableLlamaAiFeatures",I.enableUsersSyncIntoMobileDeviceContacts="EnableUsersSyncIntoMobileDeviceContacts",I.emailsActiveProjectsLeadsFilter="EmailsActiveProjectsLeadsFilter",I.exchangeRatesAdminGroupName="ExchangeRatesAdminGroupName",I.forcedEmailTrackingGroups="ForcedEmailTrackingGroups",I.ignoreEmailsFromDomainsOnEmailsTracking="IgnoreEmailsFromDomainsOnEmailsTracking",I.trackEmailsFromDomains="TrackEmailsFromDomains",I.groupsForAllUnpaidInvoicesNotification="GroupsForAllUnpaidInvoicesNotification",I.itemPreviewMaxHeight="ItemPreviewMaxHeight",I.lastActivityAttributes="LastActivityAttributes",I.leadsCompletedState="LeadsCompletedState",I.leadDeadlineAlertGroups="LeadDeadlineAlertGroups",I.leadsDeadState="LeadsDeadState",I.marketingCompletedState="MarketingCompletedState",I.marketingDeadState="MarketingDeadState",I.minimumPasswordLength="MinimumPasswordLength",I.nextStepAttributes="NextStepAttributes",I.notifyAboutInvoicedInvoiceInPohodaGroup="NotifyAboutInvoicedInvoiceInPohodaGroup",I.notifyAboutLeadsDeadline="NotifyAboutLeadsDeadline",I.notifyAboutPaidInvoiceInPohodaGroup="NotifyAboutPaidInvoiceInPohodaGroup",I.notifyAboutProjectDeadline="NotifyAboutProjectDeadline",I.numberOfDecimalPlaces="NumberOfDecimalPlaces",I.phoneListTaskSolverGroup="PhoneListTaskSolverGroup",I.projectDeadlineAlert="ProjectDeadlineAlert",I.serverUpdateProgressNotificationGroup="ServerUpdateProgressNotificationGroup",I.sumarizeCartsPricesOnLeads="SumarizeCartsPricesOnLeads",I.sumarizeCartsPricesOnProjects="SumarizeCartsPricesOnProjects",I.sumarizePeopleExpensesOnProjects="SumarizePeopleExpensesOnProjects",I.systemHealthNotificationGroup="SystemHealthNotificationGroup",I.tasksCompletedState="TasksCompletedState",I.tasksDeferredState="TasksDeferredState",I.tasksInProgressState="TasksInProgressState",I.tasksNotStartedState="TasksNotStartedState",I.tasksWaitOnSomeoneElseState="TasksWaitOnSomeoneElseState",I.trackDocumentVersions="TrackDocumentVersions",I.vacationCompletedState="VacationCompletedState",I.workReportApprovedState="WorkReportApprovedState",I.defaultLanguage="DefaultLanguage",I.defaultCurrency="DefaultCurrency",I.myCompanyCountry="MyCompanyCountry",I.myCompanyName="MyCompanyName",I.myCompanyStreet="MyCompanyStreet",I.myCompanyCity="MyCompanyCity",I.myCompanyState="MyCompanyState",I.myCompanyZip="MyCompanyZIP",I.myCompanyId="MyCompanyID",I.myCompanyVat="MyCompanyVAT",I.mergeGoodsInCart="MergeGoodsInCart",I.cartRefreshLogic="CartRefreshLogic",I.goodsDefaultQuantity="GoodsDefaultQuantity",I.goodsDefaultVAT="GoodsDefaultVAT",I.goodsDefaultVATIncluded="GoodsDefaultVATIncluded";class v{}v.ServerCommon={Server_ID:"Server_ID",Server_ItemCreated:"Server_ItemCreated",Server_ItemChanged:"Server_ItemChanged"},v.Common={CreatedByGUID:"CreatedByGUID",CurrencyEn:"CurrencyEn",DefaultCurrencySuffix:"DefaultCurrency",FileAs:"FileAs",ItemCreated:"ItemCreated",ItemChanged:"ItemChanged",ItemGUID:"ItemGUID",ItemVersion:"ItemVersion",ModifiedByGUID:"ModifiedByGUID",OwnerGUID:"OwnerGUID",ParentCurrencySuffix:"ParentCurrency"},v.Calendar={EndDate:"EndDate",Note:"Note"},v.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"},v.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"},v.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"},v.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:v.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"},v.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"},v.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"},v.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"},v.Goods=Object.assign(Object.assign({},v.GoodsBase),{PriceListGroupGUID:"PriceListGroupGUID",InventoryQuantity:"InventoryQuantity"}),v.GoodsInCart=Object.assign(Object.assign({},v.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"}),v.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"},v.Vacation={StartDate:"StartDate",EndDate:"EndDate",User:"User",Duration:"Duration",Place:"Place",Note:"Note",AllDay:"AllDay",TypeEn:"TypeEn",StateEn:"StateEn",IsPrivate:"Private"},v.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"},v.Projects={HumanID:"HID",FileAs:"FileAs",ProjectName:"ProjectName",ProjectOriginEn:"ProjectOriginEn",TypeEn:"TypeEn",StateEn:"StateEn",PaymentTypeEn:"PaymentTypeEn",ProjectStart:"ProjectStart",ProjectRealEnd:"ProjectRealEnd",EstimatedEnd:"ProjectEnd",CurrencyEn:v.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"},v.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"},v.Training={TitleEn:"TitleEn"},v.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"},v.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"},v.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"},v.PriceListGroups={Note:"Note"},v.Prices={SalePriceGUID:"SalePriceGUID",GoodsItemGUID:"GoodsItemGUID",Price:"Price",CurrencyEn:"CurrencyEn"},v.SalePrices={Note:"Note",Discount:"Discount",TypeEn:"TypeEn",StateEn:"StateEn",PrevStateEn:"PrevStateEn"},v.XsltTransformations={LangCode:"LangCode",Definition:"Definition",Namespace:"Namespace",ObjectTypeID:"ObjectTypeID",TransformationVersion:"TransformationVersion"},v.XsltTransformationsModels={ObjectTypeID:"ObjectTypeID",TransformationGUID:"TransformationGUID",ItemTypeGUID:"ItemTypeGUID"},v.allTypeEnNames=["TypeEn",v.Documents.DocTypeEn,v.WorkReports.WorkReportEn,"TitleEn"],v.getFolderFileAs=e=>{switch(e){case u.leads:return v.Leads.FileAs;case u.projects:return v.Projects.ProjectName;case u.documents:return v.Documents.DocName;case u.companies:return v.Companies.CompanyName;case u.contacts:case u.users:return v.Common.FileAs;case u.emails:return v.Emails.Subject;case u.journal:return v.Journal.FileAs;case u.tasks:return v.Tasks.Subject;case u.workReports:return v.WorkReports.Subject;case u.vacation:return v.Vacation.TypeEn;case u.carts:case u.goods:case u.goodsInCart:return v.Common.FileAs;case u.groups:return v.Groups.GroupName;case u.xsltTransformations:return v.Common.FileAs;default:return console.warn(`FileAs col name not defined for folderName ${e}`),v.Common.FileAs}};class k{}k.general="GENERAL",k.group="GROUP",k.contactPerson="CONTACTPERSON",k.contact="CONTACT",k.customer="CUSTOMER",k.company="COMPANY",k.outlookProject="OUTLOOKPROJECT",k.supervisor="SUPERVISOR",k.projectOrigin="PROJECT_ORIGIN",k.cart="CART",k.goodsInCart="GOODSINCART";class b{}b.all="All",b.own="Own",b.readonly="Readonly",b.invisible="Invisible",b.none="None";class D{}var w,F,N,O;D.mandatory="Mandatory",D.optional="Optional",D.unique="Unique",D.none="None",function(e){e.Free="Free",e.Basic="Basic",e.Professional="Professional",e.Enterprise="Enterprise"}(w||(w={})),function(e){e.ContactsAndCompanies="ContactsAndCompanies",e.Sales="Sales",e.Projects="Projects",e.Marketing="Marketing"}(F||(F={})),function(e){e[e.Negative=0]="Negative",e[e.Neutral=1]="Neutral",e[e.Positive=2]="Positive"}(N||(N={}));class R{}R.contactsSynchronizationWithOutlook="ContactsSynchronizationWithOutlook",R.wordAddin="WordAddin",R.excelAddin="ExcelAddin",R.tasksRecurrentTasks="TasksRecurrentTasks",R.tasksSubtasks="TasksSubtasks",R.tasksSynchronizationWithOutlook="TasksSynchronizationWithOutlook",R.calendarSynchronizationWithOutlook="CalendarSynchronizationWithOutlook",R.emailsAutomaticTracking="EmailsAutomaticTracking",R.convertEmailToProject="ConvertEmailToProject",R.duplicityChecker="DuplicityChecker",R.nextStepAndLastActivityCustomization="NextStepAndLastActivityCustomization",R.subProjects="SubProjects",R.resourceAndPlanning="ResourceAndPlanning",R.professionalEmailCampaigns="ProfessionalEmailCampaigns",R.professionalEmailCampaignsAdvancedStatistics="ProfessionalEmailCampaignsAdvancedStatistics",R.wordEmailMerge="WordEmailMerge",R.printLabels="PrintLabels",R.printEnvelopes="PrintEnvelopes",R.userViews="UserViews",R.sharedUserViews="SharedUserViews",R.gridConditionalFormating="GridConditionalFormating",R.multipleCurrencies="MultipleCurrencies",R.historyTracking="HistoryTracking",R.privateItems="PrivateItems",R.itemTypes="ItemTypes",R.formLayoutCustomization="FormLayoutCustomization",R.workflowBasicDefinitions="WorkflowBasicDefinitions",R.workflowAdvancedDefinitions="WorkflowAdvancedDefinitions",R.workflowAdvancedDefinitionsRules="WorkflowAdvancedDefinitionsRules",R.workflowAdvancedDefinitionsActions="WorkflowAdvancedDefinitionsActions",R.workflowGroupLevelActions="WorkflowGroupLevelActions",R.customFields="CustomFields",R.importantFields="ImportantFields",R.mandatoryFields="MandatoryFields",R.uniqueFields="UniqueFields",R.readOnlyFields="ReadOnlyFields",R.transformationCustomTemplates="TransformationCustomTemplates",R.userRoles="UserRoles",R.modulePermissions="ModulePermissions",R.columnPermissions="ColumnPermissions",R.api="API",R.gate="Gate",R.threeCXIntegration="ThreeCXIntegration",R.tapiIntegration="TapiIntegration",R.pohodaIntegration="PohodaIntegration",R.pohodaSynchronizationIntervalCustomization="PohodaSynchronizationIntervalCustomization",R.pohodaSynchronizationFieldMappingCustomization="PohodaSynchronizationFieldMappingCustomization",R.quickBooksIntegration="QuickBooksIntegration",R.saveBinaryDataOnDisk="SaveBinaryDataOnDisk",R.activeDirectoryLogin="ActiveDirectoryLogin",R.callerIdentificationOnApple="CallerIdentificationOnApple",R.legacyAdministration="LegacyAdministration";class x{}x.customAdditionalFieldsCount="CustomAdditionalFieldsCount",x.customEnabledAdvancedWorkflowsCount="CustomEnabledAdvancedWorkflowsCount",x.customEnabledBasicWorkflowsCount="CustomEnabledBasicWorkflowsCount",x.customMandatoryFieldsCount="CustomMandatoryFieldsCount",x.customOptionalFieldsCount="CustomOptionalFieldsCount",x.customReadonlyFieldsCount="CustomReadonlyFieldsCount",x.customUniqueFieldsCount="CustomUniqueFieldsCount",x.customVisibleTypesCount="CustomVisibleTypesCount",x.visibleCurrenciesCount="VisibleCurrenciesCount";class M{}M.contactsAutomaticSynchronizationWithOutlook="ContactsAutomaticSynchronizationWithOutlook",M.contactsSynchronizationWithOutlook="ContactsSynchronizationWithOutlook",M.contactsSynchronizationWithAndroid="ContactsSynchronizationWithAndroid",M.documentsRevisions="DocumentsRevisions",M.wordAddin="WordAddin",M.excelAddin="ExcelAddin",M.tasksReminders="TasksReminders",M.tasksRecurrentTasks="TasksRecurrentTasks",M.tasksSubtasks="TasksSubtasks",M.tasksSynchronizationWithOutlook="TasksSynchronizationWithOutlook",M.calendarSynchronizationWithOutlook="CalendarSynchronizationWithOutlook",M.emailsManualTracking="EmailsManualTracking",M.emailsAutomaticTracking="EmailsAutomaticTracking",M.emailSummaryAndSentimentToneFromAi="EmailSummaryAndSentimentToneFromAi",M.convertEmailToContact="ConvertEmailToContact",M.convertEmailToDeal="ConvertEmailToDeal",M.convertEmailToProject="ConvertEmailToProject",M.convertEmailToTask="ConvertEmailToTask",M.convertFromSuggestedContact="ConvertFromSuggestedContact",M.gravatarIntegration="GravatarIntegration",M.logoboxIntegration="LogoboxIntegration",M.companiesBussinesRegisterApiIntegration="CompaniesBussinesRegisterApiIntegration",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.gridRowSummary="GridRowSummary",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.commonDataAPI="CommonDataAPI",M.eWayCrmAPI="eWayCrmAPI",M.threeCXIntegration="ThreeCXIntegration",M.tapiIntegration="TapiIntegration",M.pohodaIntegration="PohodaIntegration",M.pohodaSynchronizationIntervalCustomization="PohodaSynchronizationIntervalCustomization",M.pohodaSynchronizationFieldMappingCustomization="PohodaSynchronizationFieldMappingCustomization",M.quickBooksIntegration="QuickBooksIntegration",M.shareByTeams="ShareByTeams",M.convertEmailToContactWithDataFromAi="ConvertEmailToContactWithDataFromAi",M.convertEmailToDealWithDataFromAi="ConvertEmailToDealWithDataFromAi",M.convertEmailToProjectWithDataFromAi="ConvertEmailToProjectWithDataFromAi",function(e){e.UnpaidImportantInvoices="UnpaidImportantInvoices",e.UncollectableSubscriptionPayment="UncollectableSubscriptionPayment",e.UncollectableSubscriptionPaymentWithExpiredCard="UncollectableSubscriptionPaymentWithExpiredCard",e.StandardSubscriptionPeriod="StandardSubscriptionPeriod"}(O||(O={}));var _,L=O;!function(e){e.License="License",e.CloudLicense="CloudLicense",e.MiscLicense="MiscLicense",e.Support="Support",e.Service="Service"}(_||(_={}));var G=_;class U{}U.getIsDebug=e=>{var t;return!!(null===(t=null==e?void 0:e.sessionHandler.lastSuccessfulLoginResponse)||void 0===t?void 0:t.Debug)},U.supportsFeaturesOf=(e,t)=>{var r;const n=null===(r=e.sessionHandler.lastSuccessfulLoginResponse)||void 0===r?void 0:r.WcfVersion;return!!n&&U.supportsVersionFeaturesOf(n,t)},U.supportsVersionFeaturesOf=(e,t)=>n(e,t,">=")||n(e,"1.0.0.0","=");class V{}V.textBox="TextBox",V.comboBox="ComboBox",V.numericBox="NumericBox",V.relation="Relation",V.checkBox="CheckBox",V.linkTextBox="LinkTextBox",V.dateEdit="DateEdit",V.memoBox="MemoBox",V.multiSelectComboBox="MultiSelectComboBox",V.workflowState="WorkflowState",V.image="Image",V.multiSelectRelation="MultiSelectRelation";const B={[u.relations]:0,[u.unifiedRelations]:1,[u.users]:2,[u.groups]:3,[u.enumTypes]:4,[u.enumValues]:5,[u.additionalFields]:6};var W,j,H,z;!function(e){e.Version75="7.5",e.Version76="7.6",e.Version77="7.7",e.Version81="8.1",e.Version82="8.2",e.Version83="8.3",e.Version90="9.0",e.Version91="9.1",e.Version92="9.2"}(W||(W={}));class Q extends U{}Q.is75OrLater=e=>U.supportsFeaturesOf(e,W.Version75),Q.is76OrLater=e=>Q.supportsFeaturesOf(e,W.Version76),Q.is77OrLater=e=>Q.supportsFeaturesOf(e,W.Version77),Q.is81OrLater=e=>Q.supportsFeaturesOf(e,W.Version81),Q.is82OrLater=e=>Q.supportsFeaturesOf(e,W.Version82),Q.is83OrLater=e=>Q.supportsFeaturesOf(e,W.Version83),Q.is90OrLater=e=>Q.supportsFeaturesOf(e,W.Version90),Q.is91OrLater=e=>Q.supportsFeaturesOf(e,W.Version91),Q.is92OrLater=e=>Q.supportsFeaturesOf(e,W.Version92),Q.isFeatureSupported=(e,t)=>Q.supportsFeaturesOf(e,t);class ${static createHubItemsCountsQuery(e,t,r){return{__type:"HubItemsCountsQuery:#EQ",ParentItemGuids:e,ItemTypes:t,ExcludeSystemItems:r}}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]}}}$.column=e=>({__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:e}),$.multiSelectComboColumnLegacy=(e,t,r)=>({__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:"ItemGUID",Transformation:`[dbo].[GetConcatenatedEnumValuesRelationsValues]({0}, '${e}', '${t}'`,Alias:null!=r?r:e}),$.multiSelectComboColumn=(e,t,r,n,s)=>{if(!Q.is77OrLater(e))return $.multiSelectComboColumnLegacy(r,n,s);return{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:"ItemGUID",Transformation:`[dbo].[GetConcatenatedEnumValuesRelationsValues_WithObjectTypeID]({0}, dbo.GetObjectTypeID('${t}'), '${r}', '${n}')`,Alias:null!=s?s:r}},$.joinColumn=(e,t,r,n,s)=>{const o={__type:"Column:#EQ",Source:{__type:"Join:#EQ",ItemType:e,Key:{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:t},TargetColumnName:s},Name:r};return n&&(o.Alias=n),o},$.singleVariatedColumn=(e,t,r)=>$.variatedColumn([$.columnVariation(e,t)],r),$.variatedColumn=(e,t)=>{const r={__type:"VariatedColumn:#EQ",Source:{__type:"MainTable:#EQ"},Variations:e};return t&&(r.Alias=t),r},$.columnVariation=(e,t,r)=>{const n={FolderName:t,Field:{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:e}};return r&&(n.Field.Transformation=r),n},$.joinColumnVariation=(e,t,r,n)=>({FolderName:e,Field:{__type:"Column:#EQ",Source:{__type:"Join:#EQ",ItemType:t,Key:{__type:"Column:#EQ",Source:{__type:"MainTable:#EQ"},Name:r}},Name:n}}),$.relationColumnVariation=(e,t,r,n)=>({FolderName:e,Field:{__type:"Column:#EQ",Source:{__type:"Relation:#EQ",RelationType:t,Direction:1,ItemTypes:r},Name:n}}),$.relatedColumn=(e,t,r,n)=>{const s={__type:"Column:#EQ",Source:{__type:"Relation:#EQ",RelationType:e,Direction:1,ItemTypes:t},Name:r};return n&&(s.Alias=n),s},$.relatedSubstituableColumn=(e,t,r,n,s)=>{const o={__type:"SubstituableColumn:#EQ",Source:{__type:"Relation:#EQ",RelationType:e,Direction:1,ItemTypes:t},Name:r,Substitute:n};return s&&(o.Alias=s),o},$.relatedColumnFolderNameToken=(e,t,r)=>({__type:"Token:#EQ",Source:{__type:"Relation:#EQ",RelationType:e,Direction:1,ItemTypes:t},TypeName:"ItemType",Alias:r}),$.folderNameToken=e=>({__type:"Token:#EQ",Source:{__type:"MainTable:#EQ"},TypeName:"ItemType",Alias:null!=e?e:"FolderName"}),$.equalsFilterExpression=(e,t)=>({__type:"EqualsFilterExpressionPredicate:#EQ",Field:e,Value:t}),$.notEqualsExpression=(e,t)=>({__type:"NotFilterExpression:#EQ",Child:$.equalsFilterExpression(e,t)}),$.andFilterExpression=e=>({__type:"AndFilterExpressionOperator:#EQ",Children:e}),$.orFilterExpression=e=>({__type:"OrFilterExpressionOperator:#EQ",Children:e}),$.lessFilterExpression=(e,t)=>({__type:"LessFilterExpressionPredicate:#EQ",Field:e,Value:t}),$.lessOrEqualFilterExpression=(e,t)=>({__type:"LessOrEqualFilterExpressionPredicate:#EQ",Field:e,Value:t}),$.greaterFilterExpression=(e,t)=>({__type:"GreaterFilterExpressionPredicate:#EQ",Field:e,Value:t}),$.greaterOrEqualFilterExpression=(e,t)=>({__type:"GreaterOrEqualFilterExpressionPredicate:#EQ",Field:e,Value:t}),$.likeFilterExpression=(e,t)=>({__type:"LikeFilterExpressionPredicate:#EQ",Field:e,Value:`%${t}%`}),$.inFilterExpression=(e,t)=>({__type:"InFilterExpressionPredicate:#EQ",Field:e,Value:t}),$.isNullOrEmptyFilterExpression=e=>$.orFilterExpression([$.equalsFilterExpression($.column(e),null),$.equalsFilterExpression($.column(e),"")]);class q{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 J{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())}`}}J.isValid=e=>e instanceof Date&&!isNaN(e.getTime()),J.areDaysEqual=(e,t)=>{const r=J.clearTime(e),n=J.clearTime(t);return r.getTime()===n.getTime()},J.areTimesEqual=(e,t)=>e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes(),J.areDatesEqual=(e,t)=>!!e&&!!t&&J.areDaysEqual(e,t)&&J.areTimesEqual(e,t),J.clearTime=e=>{const t=new Date(e);return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t},J.isWithoutTime=e=>0===e.getHours()&&0===e.getMinutes()&&0===e.getSeconds(),J.getFormattedSqlDateTime=e=>e.toISOString().slice(0,19).replace("T"," "),J.getRfcWithoutTimezone=e=>e.slice(0,19),function(e){e.OpenXmlDocx="OpenXmlDocx",e.Pdf="Pdf",e.WordMlXml="WordMlXml"}(j||(j={}));class X{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"}(H||(H={})),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.FailureLicenceLimitReached="Failed_LicenseLimitReached",e.FailureInssuficientModulePermission="Failed_InsufficientModulePermission",e.FailureInssuficientColumnsPermission="Failed_InsufficientColumnsPermission"}(z||(z={})),a.polyfill();export{T as ApiConnectionAsNonDefaultExport,d as ApiMethods,D as ColumnPermissionMandatoryRules,b as ColumnPermissionPermissionRules,A as CommonDataConnection,x as CustomizationStatsItemKeys,J as DateHelper,X as EWItem,w as Edition,H as EnumTypeEditMode,c as EnumTypes,g as ErrorHelper,L as ExpirationReason,F as Feature,v as FieldNames,V as FieldTypes,u as FolderNames,R as Functionality,I as GlobalSettingsNames,o as HttpMethod,f as HttpRequestError,z as ImportResult,G as LicenseKeyInvoiceSeverity,M as LicenseRestrictionKeys,y as OAuthHelper,C as OAuthSessionHandlerBase,B as ObjectTypeIds,$ as QueryHelper,k as RelationTypes,l as ReturnCodes,N as SentimentTone,q as StringHelper,E as TokenizedServiceConnection,j as TransformItemFormats,W as Version,Q as VersionHelper,U as VersionHelperBase,T as default};
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface ITokenError {
|
|
2
|
+
error: string;
|
|
3
|
+
}
|
|
4
|
+
export interface ITokenSuccess {
|
|
2
5
|
access_token: string;
|
|
3
6
|
expires_in: number;
|
|
4
7
|
id_token?: string;
|
|
5
8
|
token_type: string;
|
|
6
9
|
refresh_token: string;
|
|
7
|
-
error:
|
|
10
|
+
error: undefined;
|
|
8
11
|
}
|
|
12
|
+
export type ITokenData = ITokenError | ITokenSuccess;
|
|
9
13
|
export type TInputData = Record<string, Object | null>;
|
package/lib/index.d.ts
CHANGED
|
@@ -24,14 +24,18 @@ declare class HttpRequestError extends Error {
|
|
|
24
24
|
constructor(statusCode: number, message: string);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
interface
|
|
27
|
+
interface ITokenError {
|
|
28
|
+
error: string;
|
|
29
|
+
}
|
|
30
|
+
interface ITokenSuccess {
|
|
28
31
|
access_token: string;
|
|
29
32
|
expires_in: number;
|
|
30
33
|
id_token?: string;
|
|
31
34
|
token_type: string;
|
|
32
35
|
refresh_token: string;
|
|
33
|
-
error:
|
|
36
|
+
error: undefined;
|
|
34
37
|
}
|
|
38
|
+
type ITokenData = ITokenError | ITokenSuccess;
|
|
35
39
|
type TInputData = Record<string, Object | null>;
|
|
36
40
|
|
|
37
41
|
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';
|
|
@@ -994,7 +998,7 @@ declare class EnumTypes {
|
|
|
994
998
|
static readonly workReportType = "WorkReportType";
|
|
995
999
|
}
|
|
996
1000
|
|
|
997
|
-
type TRelationType = 'GENERAL' | 'GROUP' | 'CONTACTPERSON' | 'CONTACT' | 'CUSTOMER' | 'COMPANY' | 'OUTLOOKPROJECT' | 'SUPERVISOR' | 'PROJECT_ORIGIN';
|
|
1001
|
+
type TRelationType = 'GENERAL' | 'GROUP' | 'CONTACTPERSON' | 'CONTACT' | 'CUSTOMER' | 'COMPANY' | 'OUTLOOKPROJECT' | 'SUPERVISOR' | 'PROJECT_ORIGIN' | 'CART' | 'GOODSINCART';
|
|
998
1002
|
declare class RelationTypes {
|
|
999
1003
|
static readonly general: TRelationType;
|
|
1000
1004
|
static readonly group: TRelationType;
|
|
@@ -1005,6 +1009,8 @@ declare class RelationTypes {
|
|
|
1005
1009
|
static readonly outlookProject: TRelationType;
|
|
1006
1010
|
static readonly supervisor: TRelationType;
|
|
1007
1011
|
static readonly projectOrigin: TRelationType;
|
|
1012
|
+
static readonly cart: TRelationType;
|
|
1013
|
+
static readonly goodsInCart: TRelationType;
|
|
1008
1014
|
}
|
|
1009
1015
|
|
|
1010
1016
|
interface IApiItemBaseWithoutPrivate {
|
|
@@ -1243,14 +1249,21 @@ declare class VersionHelperBase {
|
|
|
1243
1249
|
static readonly supportsVersionFeaturesOf: (testedVersion: string, version: string) => boolean;
|
|
1244
1250
|
}
|
|
1245
1251
|
|
|
1252
|
+
type GetAccessTokenResult = {
|
|
1253
|
+
error: string;
|
|
1254
|
+
accessToken?: undefined;
|
|
1255
|
+
} | {
|
|
1256
|
+
error?: undefined;
|
|
1257
|
+
accessToken: string;
|
|
1258
|
+
};
|
|
1246
1259
|
declare abstract class OAuthSessionHandlerBase implements ISessionHandler {
|
|
1247
1260
|
lastSuccessfulLoginResponse?: IApiLoginResponse;
|
|
1248
|
-
private accessToken
|
|
1261
|
+
private accessToken?;
|
|
1249
1262
|
private readonly username;
|
|
1250
1263
|
private readonly appVersion;
|
|
1251
1264
|
protected readonly errorCallback: ((error: TUnionError) => void) | undefined;
|
|
1252
1265
|
private readonly getNewAccessTokenCallback;
|
|
1253
|
-
constructor(username: string, accessToken: string, appVersion: string, getNewAccessTokenCallback: ((connection: ApiConnection, callback: (
|
|
1266
|
+
constructor(username: string, accessToken: string, appVersion: string, getNewAccessTokenCallback: ((connection: ApiConnection, callback: (result: GetAccessTokenResult) => void) => void), errorCallback?: (error: TUnionError) => void);
|
|
1254
1267
|
readonly invalidateSessionId: (_: string, callback: () => void) => void;
|
|
1255
1268
|
readonly getSessionId: (connection: ApiConnection, callback: (sessionId: string) => void) => void;
|
|
1256
1269
|
}
|
|
@@ -1483,6 +1496,16 @@ declare class QueryHelper {
|
|
|
1483
1496
|
ItemTypes: TFolderName[];
|
|
1484
1497
|
ExcludeSystemItems: boolean | undefined;
|
|
1485
1498
|
};
|
|
1499
|
+
static createRelatedTableQuery(baseItemGuid: string, itemTypes: TFolderName | TFolderName[], relationType?: TRelationType): {
|
|
1500
|
+
__type: string;
|
|
1501
|
+
BaseItemID: string;
|
|
1502
|
+
ItemTypes: TFolderName[];
|
|
1503
|
+
RelationType: TRelationType | undefined;
|
|
1504
|
+
};
|
|
1505
|
+
static createMainTableQuery(itemTypes: TFolderName | TFolderName[]): {
|
|
1506
|
+
__type: string;
|
|
1507
|
+
ItemTypes: TFolderName[];
|
|
1508
|
+
};
|
|
1486
1509
|
static column: (colName: string) => IApiQueryColumn;
|
|
1487
1510
|
/**
|
|
1488
1511
|
* For versions < 7.7
|