@superoffice/webapi 11.7.727 → 11.9.1204
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/LICENSE.md +15 -15
- package/README.md +184 -184
- package/__tests__/Appointment63-notz.json +1925 -1925
- package/__tests__/Appointment63-utctz.json +1925 -1925
- package/__tests__/Appointment63.json +1925 -1925
- package/__tests__/AppointmentTzTest.ts +115 -115
- package/__tests__/AxiosNockTest.ts +28 -28
- package/__tests__/ContactDefault.json +699 -699
- package/__tests__/ContactEntity.json +272 -272
- package/__tests__/ContactRestTest.ts +144 -144
- package/__tests__/ContactTest.ts +395 -395
- package/__tests__/ConvertersTest.ts +97 -97
- package/__tests__/DocumentTest.ts +101 -101
- package/__tests__/Person210-notz.json +1932 -1932
- package/__tests__/Person210-utctz.json +1932 -1932
- package/__tests__/Person210.json +1932 -1932
- package/__tests__/PersonImageData.nock +22 -22
- package/__tests__/PersonTest.ts +41 -41
- package/__tests__/PersonTzTest.ts +113 -113
- package/__tests__/RecurrenceInfo.json +55 -55
- package/__tests__/ResponseCallbackTest.ts +23 -23
- package/__tests__/TableRights.json +441 -441
- package/__tests__/WebapiTest.ts +264 -264
- package/__tests__/Webhook.json +16 -16
- package/__tests__/WebhookTest.ts +209 -209
- package/dist/cjs/AIAgent.d.ts +62 -0
- package/dist/cjs/AIAgent.d.ts.map +1 -1
- package/dist/cjs/AIAgent.js +149 -0
- package/dist/cjs/AIAgent.js.map +1 -1
- package/dist/cjs/Carriers.d.ts +640 -14
- package/dist/cjs/Carriers.d.ts.map +1 -1
- package/dist/cjs/Converters.d.ts +24 -0
- package/dist/cjs/Converters.d.ts.map +1 -1
- package/dist/cjs/Converters.js +388 -17
- package/dist/cjs/Converters.js.map +1 -1
- package/dist/cjs/DiagnosticsAgent.d.ts +38 -0
- package/dist/cjs/DiagnosticsAgent.d.ts.map +1 -1
- package/dist/cjs/DiagnosticsAgent.js +91 -0
- package/dist/cjs/DiagnosticsAgent.js.map +1 -1
- package/dist/cjs/Enums.d.ts +77 -1
- package/dist/cjs/Enums.d.ts.map +1 -1
- package/dist/cjs/Enums.js +83 -4
- package/dist/cjs/Enums.js.map +1 -1
- package/dist/cjs/ListAgent.d.ts +71 -6
- package/dist/cjs/ListAgent.d.ts.map +1 -1
- package/dist/cjs/ListAgent.js +157 -0
- package/dist/cjs/ListAgent.js.map +1 -1
- package/dist/cjs/MarketingAgent.d.ts +68 -0
- package/dist/cjs/MarketingAgent.d.ts.map +1 -1
- package/dist/cjs/MarketingAgent.js +157 -0
- package/dist/cjs/MarketingAgent.js.map +1 -1
- package/dist/cjs/TicketAgent.d.ts +23 -0
- package/dist/cjs/TicketAgent.d.ts.map +1 -1
- package/dist/cjs/TicketAgent.js +65 -0
- package/dist/cjs/TicketAgent.js.map +1 -1
- package/dist/esm/AIAgent.d.ts +62 -0
- package/dist/esm/AIAgent.d.ts.map +1 -1
- package/dist/esm/AIAgent.js +150 -1
- package/dist/esm/AIAgent.js.map +1 -1
- package/dist/esm/Carriers.d.ts +640 -14
- package/dist/esm/Carriers.d.ts.map +1 -1
- package/dist/esm/Converters.d.ts +24 -0
- package/dist/esm/Converters.d.ts.map +1 -1
- package/dist/esm/Converters.js +346 -0
- package/dist/esm/Converters.js.map +1 -1
- package/dist/esm/DiagnosticsAgent.d.ts +38 -0
- package/dist/esm/DiagnosticsAgent.d.ts.map +1 -1
- package/dist/esm/DiagnosticsAgent.js +91 -0
- package/dist/esm/DiagnosticsAgent.js.map +1 -1
- package/dist/esm/Enums.d.ts +77 -1
- package/dist/esm/Enums.d.ts.map +1 -1
- package/dist/esm/Enums.js +79 -0
- package/dist/esm/Enums.js.map +1 -1
- package/dist/esm/ListAgent.d.ts +71 -6
- package/dist/esm/ListAgent.d.ts.map +1 -1
- package/dist/esm/ListAgent.js +157 -0
- package/dist/esm/ListAgent.js.map +1 -1
- package/dist/esm/MarketingAgent.d.ts +68 -0
- package/dist/esm/MarketingAgent.d.ts.map +1 -1
- package/dist/esm/MarketingAgent.js +157 -0
- package/dist/esm/MarketingAgent.js.map +1 -1
- package/dist/esm/TicketAgent.d.ts +23 -0
- package/dist/esm/TicketAgent.d.ts.map +1 -1
- package/dist/esm/TicketAgent.js +65 -0
- package/dist/esm/TicketAgent.js.map +1 -1
- package/examples-js/hello.js +12 -12
- package/examples-ts/hello.ts +8 -8
- package/package.json +93 -93
- package/scripts/postbuild.js +22 -22
- package/scripts/setVersion.js +44 -44
- package/src/AIAgent.ts +2239 -1992
- package/src/AppointmentAgent.ts +6263 -6263
- package/src/AppointmentRestApi.ts +225 -225
- package/src/ArchiveAgent.ts +1950 -1950
- package/src/AssociateAgent.ts +422 -422
- package/src/AxiosCacheHandler.ts +74 -74
- package/src/BLOBAgent.ts +2100 -2100
- package/src/Base64.ts +285 -285
- package/src/BatchAgent.ts +910 -910
- package/src/BulkUpdateAgent.ts +504 -504
- package/src/CRMScriptAgent.ts +1390 -1390
- package/src/Carriers.ts +53121 -52274
- package/src/ChatAgent.ts +1422 -1422
- package/src/ConfigurationAgent.ts +2228 -2228
- package/src/ContactAgent.ts +1756 -1756
- package/src/ContactRestApi.ts +237 -237
- package/src/Converters.ts +23496 -23090
- package/src/CustomerServiceAgent.ts +1799 -1799
- package/src/DashAgent.ts +1674 -1674
- package/src/DatabaseAgent.ts +120 -120
- package/src/DatabaseTableAgent.ts +534 -534
- package/src/Day_js.ts +41 -41
- package/src/DiagnosticsAgent.ts +1384 -1240
- package/src/DocumentAgent.ts +5079 -5079
- package/src/DocumentMigrationAgent.ts +524 -524
- package/src/DocumentRestApi.ts +259 -259
- package/src/EMailAgent.ts +5328 -5328
- package/src/Enums.ts +6998 -6916
- package/src/ErpSyncAgent.ts +2658 -2658
- package/src/FavouriteAgent.ts +720 -720
- package/src/FindAgent.ts +2330 -2330
- package/src/ForeignSystemAgent.ts +1710 -1710
- package/src/FreeTextAgent.ts +372 -372
- package/src/ImportAgent.ts +304 -304
- package/src/LicenseAgent.ts +1230 -1230
- package/src/ListAgent.ts +11451 -11237
- package/src/MDOAgent.ts +748 -748
- package/src/MarketingAgent.ts +1146 -890
- package/src/MessagingAgent.ts +384 -384
- package/src/NavigatorAgent.ts +140 -140
- package/src/NumberAllocationAgent.ts +296 -296
- package/src/PersonAgent.ts +3287 -3287
- package/src/PersonRestApi.ts +241 -241
- package/src/PhoneListAgent.ts +458 -458
- package/src/PocketAgent.ts +780 -780
- package/src/PreferenceAgent.ts +1900 -1900
- package/src/PreviewsAgent.ts +116 -116
- package/src/ProjectAgent.ts +2391 -2391
- package/src/ProjectRestApi.ts +239 -239
- package/src/QuoteAgent.ts +5159 -5159
- package/src/RelationAgent.ts +220 -220
- package/src/ReportAgent.ts +154 -154
- package/src/ResourceAgent.ts +358 -358
- package/src/SaintAgent.ts +601 -601
- package/src/SaleAgent.ts +2034 -2034
- package/src/SaleRestApi.ts +233 -233
- package/src/SelectionAgent.ts +3195 -3195
- package/src/SentryAgent.ts +462 -462
- package/src/SoApiConstants.ts +8 -8
- package/src/TargetsAgent.ts +1104 -1104
- package/src/TicketAgent.ts +3708 -3638
- package/src/TimeZoneAgent.ts +528 -528
- package/src/TooltipsAgent.ts +116 -116
- package/src/UserAgent.ts +4856 -4856
- package/src/UserDefinedFieldInfoAgent.ts +1764 -1764
- package/src/ViewStateAgent.ts +858 -858
- package/src/WebApi.ts +872 -872
- package/src/WebApiBase.ts +565 -565
- package/src/WebhookAgent.ts +388 -388
- package/src/WorkflowAgent.ts +1338 -1338
- package/tsconfig.esm.json +8 -8
- package/tsconfig.jest.json +8 -8
- package/tsconfig.json +34 -34
package/src/ViewStateAgent.ts
CHANGED
|
@@ -1,858 +1,858 @@
|
|
|
1
|
-
// <auto-generated>
|
|
2
|
-
// SuperOffice Code Generator
|
|
3
|
-
// modelling\templates\servicestswebapi\tswebapiagents.tt
|
|
4
|
-
// </auto-generated>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/* tslint:disable */
|
|
8
|
-
//----------------------------------------------------------------------------
|
|
9
|
-
// G E N E R A T E D F I L E ! D O N O T E D I T !
|
|
10
|
-
//----------------------------------------------------------------------------
|
|
11
|
-
//
|
|
12
|
-
// File: WebApi/ViewStateAgent.ts
|
|
13
|
-
//
|
|
14
|
-
//----------------------------------------------------------------------------
|
|
15
|
-
// Copyright (C) SuperOffice AS
|
|
16
|
-
//----------------------------------------------------------------------------
|
|
17
|
-
|
|
18
|
-
import { AxiosRequestConfig } from 'axios';
|
|
19
|
-
import { Duration } from 'dayjs/plugin/duration';
|
|
20
|
-
import * as enums from './Enums';
|
|
21
|
-
import * as base from './WebApiBase';
|
|
22
|
-
import * as carriers from './Carriers';
|
|
23
|
-
import * as converters from './Converters';
|
|
24
|
-
import { FromBase64ToString, ToBase64 } from './Base64';
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* User interface view state, history, currentXXX values
|
|
28
|
-
*/
|
|
29
|
-
export interface IViewStateAgent {
|
|
30
|
-
getLiveUiConfigAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LiveUiConfig >;
|
|
31
|
-
getHistoryAsync(historyId: number) : Promise< carriers.History >;
|
|
32
|
-
getCurrentAsync(request: carriers.ViewState_GetCurrentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History >;
|
|
33
|
-
getCurrentAsync(historyName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History >;
|
|
34
|
-
saveCurrentAsync(request: carriers.ViewState_SaveCurrentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History >;
|
|
35
|
-
saveCurrentAsync(current: carriers.History, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History >;
|
|
36
|
-
getNextCurrentAsync(request: carriers.ViewState_GetNextCurrentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History >;
|
|
37
|
-
getNextCurrentAsync(historyName: string, id: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History >;
|
|
38
|
-
getPreviousCurrentAsync(request: carriers.ViewState_GetPreviousCurrentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History >;
|
|
39
|
-
getPreviousCurrentAsync(historyName: string, id: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History >;
|
|
40
|
-
deleteHistoryAsync(request: carriers.ViewState_DeleteHistoryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
41
|
-
deleteHistoryAsync(historyName: string, id: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
42
|
-
getHistoryLengthPrefValueAsync(webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
43
|
-
setHistoryLengthPrefValueAsync(request: carriers.ViewState_SetHistoryLengthPrefValueRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
44
|
-
setHistoryLengthPrefValueAsync(length: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
45
|
-
getHistoriesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
46
|
-
getHistoriesByNameAsync(request: carriers.ViewState_GetHistoriesByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
47
|
-
getHistoriesByNameAsync(historyName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
48
|
-
getHistoriesByNamesAsync(request: carriers.ViewState_GetHistoriesByNamesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
49
|
-
getHistoriesByNamesAsync(historyNames: string[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
50
|
-
saveHistoriesAsync(request: carriers.ViewState_SaveHistoriesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
51
|
-
saveHistoriesAsync(historyName: string, history: carriers.History[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
52
|
-
saveCurrentsAsync(request: carriers.ViewState_SaveCurrentsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
53
|
-
saveCurrentsAsync(currents: carriers.History[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
54
|
-
getHistoriesByNamesAndIdsAsync(request: carriers.ViewState_GetHistoriesByNamesAndIdsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
55
|
-
getHistoriesByNamesAndIdsAsync(requests: carriers.HistoryRequest[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
56
|
-
publishAndRetrieveUiEventsAsync(request: carriers.ViewState_PublishAndRetrieveUiEventsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UiEvent[] >;
|
|
57
|
-
publishAndRetrieveUiEventsAsync(latestKnownEventId: number, publishEvents: carriers.UiEvent[], metrics: carriers.MetricPair[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UiEvent[] >;
|
|
58
|
-
} // interface IViewStateAgent
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* User interface view state, history, currentXXX values
|
|
65
|
-
*/
|
|
66
|
-
export class ViewStateAgent extends base.WebApiBase implements IViewStateAgent {
|
|
67
|
-
constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
|
|
68
|
-
constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
|
|
69
|
-
constructor(baseUrl: string, resourceManager:any);
|
|
70
|
-
constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
|
|
71
|
-
constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
|
|
72
|
-
constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
|
|
73
|
-
constructor(options: base.WebApiOptions);
|
|
74
|
-
|
|
75
|
-
constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
|
|
76
|
-
langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
|
|
77
|
-
langOrResourceOrRM?:string|base.ResourceParsing|any,
|
|
78
|
-
cultureCode?: string,
|
|
79
|
-
) {
|
|
80
|
-
const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
|
|
81
|
-
options.basePath = "v1/Agents/ViewState/";
|
|
82
|
-
super(options);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
private async _getLiveUiConfigAsync( options?:base.WebApiRequestOptions) : Promise< carriers.LiveUiConfig > {
|
|
88
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
89
|
-
base.WebApiBase.SetPending(options);
|
|
90
|
-
return new Promise< carriers.LiveUiConfig >(async (resolve, reject) => {
|
|
91
|
-
try {
|
|
92
|
-
config.baseURL = this._options.baseUrl;
|
|
93
|
-
const response = await this._axios.post("GetLiveUiConfig", undefined , config);
|
|
94
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
95
|
-
const res : carriers.LiveUiConfig = converters.Create_LiveUiConfig_From( response.data );
|
|
96
|
-
resolve(res);
|
|
97
|
-
}
|
|
98
|
-
catch( err ) {
|
|
99
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
100
|
-
reject(err);
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Gets live UI configuration
|
|
108
|
-
* @returns Live UI configuration containing the parameters needed for live UI functionality
|
|
109
|
-
*/
|
|
110
|
-
public async getLiveUiConfigAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LiveUiConfig >
|
|
111
|
-
{
|
|
112
|
-
return this._getLiveUiConfigAsync(webapi_options);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Gets a History object.
|
|
117
|
-
* @param historyId - The primary key.
|
|
118
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
119
|
-
* @returns A single History
|
|
120
|
-
*/
|
|
121
|
-
public async getHistoryAsync(historyId: number, options?:base.WebApiRequestOptions) : Promise< carriers.History > {
|
|
122
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
123
|
-
base.WebApiBase.SetPending(options);
|
|
124
|
-
return new Promise< carriers.History >(async (resolve, reject) => {
|
|
125
|
-
try {
|
|
126
|
-
const response = await this._axios.post("GetHistory?historyId=" + historyId, null, config);
|
|
127
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
128
|
-
const res = converters.Create_History_From( response.data );
|
|
129
|
-
resolve(res);
|
|
130
|
-
}
|
|
131
|
-
catch( err ) {
|
|
132
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
133
|
-
reject(err);
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
private async _getCurrentAsync(request: carriers.ViewState_GetCurrentRequest, options?:base.WebApiRequestOptions) : Promise< carriers.History > {
|
|
140
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
141
|
-
base.WebApiBase.SetPending(options);
|
|
142
|
-
return new Promise< carriers.History >(async (resolve, reject) => {
|
|
143
|
-
try {
|
|
144
|
-
config.baseURL = this._options.baseUrl;
|
|
145
|
-
const response = await this._axios.post("GetCurrent", request , config);
|
|
146
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
147
|
-
const res : carriers.History = converters.Create_History_From( response.data );
|
|
148
|
-
resolve(res);
|
|
149
|
-
}
|
|
150
|
-
catch( err ) {
|
|
151
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
152
|
-
reject(err);
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Get the current (most recent) value of the history list. This is the item with rank = 1. If no item exists a default value is returned. This is usually the first item in the table representing the history list.
|
|
161
|
-
* @param request - HistoryName
|
|
162
|
-
* @returns The current (most recent) history item
|
|
163
|
-
*/
|
|
164
|
-
public async getCurrentAsync(request: carriers.ViewState_GetCurrentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History >;
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* Get the current (most recent) value of the history list. This is the item with rank = 1. If no item exists a default value is returned. This is usually the first item in the table representing the history list.
|
|
168
|
-
* @param historyName - Name of the history list, e.g. contact, project
|
|
169
|
-
* @returns The current (most recent) history item
|
|
170
|
-
*/
|
|
171
|
-
public async getCurrentAsync(historyName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History >;
|
|
172
|
-
|
|
173
|
-
public async getCurrentAsync(historyName:string|carriers.ViewState_GetCurrentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History > {
|
|
174
|
-
let _request : carriers.ViewState_GetCurrentRequest = null;
|
|
175
|
-
let _options : base.WebApiRequestOptions = null;
|
|
176
|
-
const first : any = historyName;
|
|
177
|
-
if( typeof( first ) === "object" && first && ( typeof(first.historyName)!='undefined' ) )
|
|
178
|
-
{
|
|
179
|
-
_request = historyName as carriers.ViewState_GetCurrentRequest;
|
|
180
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
181
|
-
}
|
|
182
|
-
else
|
|
183
|
-
{
|
|
184
|
-
_request = {
|
|
185
|
-
historyName: historyName as string,
|
|
186
|
-
};
|
|
187
|
-
_options = webapi_options;
|
|
188
|
-
}
|
|
189
|
-
return this._getCurrentAsync( _request, _options );
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
private async _saveCurrentAsync(request: carriers.ViewState_SaveCurrentRequest, options?:base.WebApiRequestOptions) : Promise< carriers.History > {
|
|
194
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
195
|
-
base.WebApiBase.SetPending(options);
|
|
196
|
-
return new Promise< carriers.History >(async (resolve, reject) => {
|
|
197
|
-
try {
|
|
198
|
-
config.baseURL = this._options.baseUrl;
|
|
199
|
-
const response = await this._axios.post("SaveCurrent", request , config);
|
|
200
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
201
|
-
const res : carriers.History = converters.Create_History_From( response.data );
|
|
202
|
-
resolve(res);
|
|
203
|
-
}
|
|
204
|
-
catch( err ) {
|
|
205
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
206
|
-
reject(err);
|
|
207
|
-
}
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* Saving the current history item. This history item is saved with Rank = 1, and all the remaining elements rank values are shifted one down. The list is maintained with the max lenght of the History list length preference.
|
|
215
|
-
* @param request - Current
|
|
216
|
-
* @returns The current (most recent) history item
|
|
217
|
-
*/
|
|
218
|
-
public async saveCurrentAsync(request: carriers.ViewState_SaveCurrentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History >;
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* Saving the current history item. This history item is saved with Rank = 1, and all the remaining elements rank values are shifted one down. The list is maintained with the max lenght of the History list length preference.
|
|
222
|
-
* @param current - The new current history element.
|
|
223
|
-
* @returns The current (most recent) history item
|
|
224
|
-
*/
|
|
225
|
-
public async saveCurrentAsync(current: carriers.History, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History >;
|
|
226
|
-
|
|
227
|
-
public async saveCurrentAsync(current:carriers.History|carriers.ViewState_SaveCurrentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History > {
|
|
228
|
-
let _request : carriers.ViewState_SaveCurrentRequest = null;
|
|
229
|
-
let _options : base.WebApiRequestOptions = null;
|
|
230
|
-
const first : any = current;
|
|
231
|
-
if( typeof( first ) === "object" && first && ( typeof(first.current)!='undefined' ) )
|
|
232
|
-
{
|
|
233
|
-
_request = current as carriers.ViewState_SaveCurrentRequest;
|
|
234
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
235
|
-
}
|
|
236
|
-
else
|
|
237
|
-
{
|
|
238
|
-
_request = {
|
|
239
|
-
current: current as carriers.History,
|
|
240
|
-
};
|
|
241
|
-
_options = webapi_options;
|
|
242
|
-
}
|
|
243
|
-
return this._saveCurrentAsync( _request, _options );
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
private async _getNextCurrentAsync(request: carriers.ViewState_GetNextCurrentRequest, options?:base.WebApiRequestOptions) : Promise< carriers.History > {
|
|
248
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
249
|
-
base.WebApiBase.SetPending(options);
|
|
250
|
-
return new Promise< carriers.History >(async (resolve, reject) => {
|
|
251
|
-
try {
|
|
252
|
-
config.baseURL = this._options.baseUrl;
|
|
253
|
-
const response = await this._axios.post("GetNextCurrent", request , config);
|
|
254
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
255
|
-
const res : carriers.History = converters.Create_History_From( response.data );
|
|
256
|
-
resolve(res);
|
|
257
|
-
}
|
|
258
|
-
catch( err ) {
|
|
259
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
260
|
-
reject(err);
|
|
261
|
-
}
|
|
262
|
-
});
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
/**
|
|
268
|
-
* Returns the next current item. If no item exists a default value is returned. This is usually the first item in the table representing the history list.
|
|
269
|
-
* @param request - HistoryName, Id
|
|
270
|
-
* @returns The current value.
|
|
271
|
-
*/
|
|
272
|
-
public async getNextCurrentAsync(request: carriers.ViewState_GetNextCurrentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History >;
|
|
273
|
-
|
|
274
|
-
/**
|
|
275
|
-
* Returns the next current item. If no item exists a default value is returned. This is usually the first item in the table representing the history list.
|
|
276
|
-
* @param historyName - Name of the history list, e.g. contact, project
|
|
277
|
-
* @param id - Id of the history element, e.g. Contact id
|
|
278
|
-
* @returns The current value.
|
|
279
|
-
*/
|
|
280
|
-
public async getNextCurrentAsync(historyName: string, id: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History >;
|
|
281
|
-
|
|
282
|
-
public async getNextCurrentAsync(historyName:string|carriers.ViewState_GetNextCurrentRequest, id?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History > {
|
|
283
|
-
let _request : carriers.ViewState_GetNextCurrentRequest = null;
|
|
284
|
-
let _options : base.WebApiRequestOptions = null;
|
|
285
|
-
const first : any = historyName;
|
|
286
|
-
if( typeof( first ) === "object" && first && ( typeof(first.historyName)!='undefined' || typeof(first.id)!='undefined' ) )
|
|
287
|
-
{
|
|
288
|
-
_request = historyName as carriers.ViewState_GetNextCurrentRequest;
|
|
289
|
-
_options = id as base.WebApiRequestOptions;
|
|
290
|
-
}
|
|
291
|
-
else
|
|
292
|
-
{
|
|
293
|
-
_request = {
|
|
294
|
-
historyName: historyName as string,
|
|
295
|
-
id: id as number,
|
|
296
|
-
};
|
|
297
|
-
_options = webapi_options;
|
|
298
|
-
}
|
|
299
|
-
return this._getNextCurrentAsync( _request, _options );
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
private async _getPreviousCurrentAsync(request: carriers.ViewState_GetPreviousCurrentRequest, options?:base.WebApiRequestOptions) : Promise< carriers.History > {
|
|
304
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
305
|
-
base.WebApiBase.SetPending(options);
|
|
306
|
-
return new Promise< carriers.History >(async (resolve, reject) => {
|
|
307
|
-
try {
|
|
308
|
-
config.baseURL = this._options.baseUrl;
|
|
309
|
-
const response = await this._axios.post("GetPreviousCurrent", request , config);
|
|
310
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
311
|
-
const res : carriers.History = converters.Create_History_From( response.data );
|
|
312
|
-
resolve(res);
|
|
313
|
-
}
|
|
314
|
-
catch( err ) {
|
|
315
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
316
|
-
reject(err);
|
|
317
|
-
}
|
|
318
|
-
});
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
/**
|
|
324
|
-
* Returns the previous current item. If no item exists a default value is returned. This is usually the first item in the table representing the history list.
|
|
325
|
-
* @param request - HistoryName, Id
|
|
326
|
-
* @returns The current value.
|
|
327
|
-
*/
|
|
328
|
-
public async getPreviousCurrentAsync(request: carriers.ViewState_GetPreviousCurrentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History >;
|
|
329
|
-
|
|
330
|
-
/**
|
|
331
|
-
* Returns the previous current item. If no item exists a default value is returned. This is usually the first item in the table representing the history list.
|
|
332
|
-
* @param historyName - Name of the history list, e.g. contact, project
|
|
333
|
-
* @param id - Id of the history element, e.g. Contact id
|
|
334
|
-
* @returns The current value.
|
|
335
|
-
*/
|
|
336
|
-
public async getPreviousCurrentAsync(historyName: string, id: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History >;
|
|
337
|
-
|
|
338
|
-
public async getPreviousCurrentAsync(historyName:string|carriers.ViewState_GetPreviousCurrentRequest, id?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History > {
|
|
339
|
-
let _request : carriers.ViewState_GetPreviousCurrentRequest = null;
|
|
340
|
-
let _options : base.WebApiRequestOptions = null;
|
|
341
|
-
const first : any = historyName;
|
|
342
|
-
if( typeof( first ) === "object" && first && ( typeof(first.historyName)!='undefined' || typeof(first.id)!='undefined' ) )
|
|
343
|
-
{
|
|
344
|
-
_request = historyName as carriers.ViewState_GetPreviousCurrentRequest;
|
|
345
|
-
_options = id as base.WebApiRequestOptions;
|
|
346
|
-
}
|
|
347
|
-
else
|
|
348
|
-
{
|
|
349
|
-
_request = {
|
|
350
|
-
historyName: historyName as string,
|
|
351
|
-
id: id as number,
|
|
352
|
-
};
|
|
353
|
-
_options = webapi_options;
|
|
354
|
-
}
|
|
355
|
-
return this._getPreviousCurrentAsync( _request, _options );
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
private async _deleteHistoryAsync(request: carriers.ViewState_DeleteHistoryRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
360
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
361
|
-
base.WebApiBase.SetPending(options);
|
|
362
|
-
return new Promise< void >(async (resolve, reject) => {
|
|
363
|
-
try {
|
|
364
|
-
config.baseURL = this._options.baseUrl;
|
|
365
|
-
const response = await this._axios.post("DeleteHistory", request , config);
|
|
366
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
367
|
-
const res = response.data;
|
|
368
|
-
resolve(res);
|
|
369
|
-
}
|
|
370
|
-
catch( err ) {
|
|
371
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
372
|
-
reject(err);
|
|
373
|
-
}
|
|
374
|
-
});
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
/**
|
|
380
|
-
* Deletes the history element
|
|
381
|
-
* @param request - HistoryName, Id
|
|
382
|
-
* @returns
|
|
383
|
-
*/
|
|
384
|
-
public async deleteHistoryAsync(request: carriers.ViewState_DeleteHistoryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
385
|
-
|
|
386
|
-
/**
|
|
387
|
-
* Deletes the history element
|
|
388
|
-
* @param historyName - Name of the history list, e.g. contact, project
|
|
389
|
-
* @param id - Id of the history element, e.g. Contact id
|
|
390
|
-
* @returns
|
|
391
|
-
*/
|
|
392
|
-
public async deleteHistoryAsync(historyName: string, id: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
393
|
-
|
|
394
|
-
public async deleteHistoryAsync(historyName:string|carriers.ViewState_DeleteHistoryRequest, id?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
395
|
-
let _request : carriers.ViewState_DeleteHistoryRequest = null;
|
|
396
|
-
let _options : base.WebApiRequestOptions = null;
|
|
397
|
-
const first : any = historyName;
|
|
398
|
-
if( typeof( first ) === "object" && first && ( typeof(first.historyName)!='undefined' || typeof(first.id)!='undefined' ) )
|
|
399
|
-
{
|
|
400
|
-
_request = historyName as carriers.ViewState_DeleteHistoryRequest;
|
|
401
|
-
_options = id as base.WebApiRequestOptions;
|
|
402
|
-
}
|
|
403
|
-
else
|
|
404
|
-
{
|
|
405
|
-
_request = {
|
|
406
|
-
historyName: historyName as string,
|
|
407
|
-
id: id as number,
|
|
408
|
-
};
|
|
409
|
-
_options = webapi_options;
|
|
410
|
-
}
|
|
411
|
-
return this._deleteHistoryAsync( _request, _options );
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
private async _getHistoryLengthPrefValueAsync( options?:base.WebApiRequestOptions) : Promise< number > {
|
|
416
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
417
|
-
base.WebApiBase.SetPending(options);
|
|
418
|
-
return new Promise< number >(async (resolve, reject) => {
|
|
419
|
-
try {
|
|
420
|
-
config.baseURL = this._options.baseUrl;
|
|
421
|
-
const response = await this._axios.post("GetHistoryLengthPrefValue", undefined , config);
|
|
422
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
423
|
-
const res : number = response.data as number;
|
|
424
|
-
resolve(res);
|
|
425
|
-
}
|
|
426
|
-
catch( err ) {
|
|
427
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
428
|
-
reject(err);
|
|
429
|
-
}
|
|
430
|
-
});
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
/**
|
|
435
|
-
* Get the logged on user's preferred history list length. Will return the system preference if no user preferences are available.
|
|
436
|
-
* @returns The history list lenght
|
|
437
|
-
*/
|
|
438
|
-
public async getHistoryLengthPrefValueAsync(webapi_options?:base.WebApiRequestOptions) : Promise< number >
|
|
439
|
-
{
|
|
440
|
-
return this._getHistoryLengthPrefValueAsync(webapi_options);
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
private async _setHistoryLengthPrefValueAsync(request: carriers.ViewState_SetHistoryLengthPrefValueRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
445
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
446
|
-
base.WebApiBase.SetPending(options);
|
|
447
|
-
return new Promise< void >(async (resolve, reject) => {
|
|
448
|
-
try {
|
|
449
|
-
config.baseURL = this._options.baseUrl;
|
|
450
|
-
const response = await this._axios.post("SetHistoryLengthPrefValue", request , config);
|
|
451
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
452
|
-
const res = response.data;
|
|
453
|
-
resolve(res);
|
|
454
|
-
}
|
|
455
|
-
catch( err ) {
|
|
456
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
457
|
-
reject(err);
|
|
458
|
-
}
|
|
459
|
-
});
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
/**
|
|
465
|
-
* Set the logged on user's preferred history list length.
|
|
466
|
-
* @param request - Length
|
|
467
|
-
* @returns
|
|
468
|
-
*/
|
|
469
|
-
public async setHistoryLengthPrefValueAsync(request: carriers.ViewState_SetHistoryLengthPrefValueRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
470
|
-
|
|
471
|
-
/**
|
|
472
|
-
* Set the logged on user's preferred history list length.
|
|
473
|
-
* @param length - The new history list lenght
|
|
474
|
-
* @returns
|
|
475
|
-
*/
|
|
476
|
-
public async setHistoryLengthPrefValueAsync(length: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
477
|
-
|
|
478
|
-
public async setHistoryLengthPrefValueAsync(length:number|carriers.ViewState_SetHistoryLengthPrefValueRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
479
|
-
let _request : carriers.ViewState_SetHistoryLengthPrefValueRequest = null;
|
|
480
|
-
let _options : base.WebApiRequestOptions = null;
|
|
481
|
-
const first : any = length;
|
|
482
|
-
if( typeof( first ) === "object" && first && ( typeof(first.length)!='undefined' ) )
|
|
483
|
-
{
|
|
484
|
-
_request = length as carriers.ViewState_SetHistoryLengthPrefValueRequest;
|
|
485
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
486
|
-
}
|
|
487
|
-
else
|
|
488
|
-
{
|
|
489
|
-
_request = {
|
|
490
|
-
length: length as number,
|
|
491
|
-
};
|
|
492
|
-
_options = webapi_options;
|
|
493
|
-
}
|
|
494
|
-
return this._setHistoryLengthPrefValueAsync( _request, _options );
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
private async _getHistoriesAsync( options?:base.WebApiRequestOptions) : Promise< carriers.History[] > {
|
|
499
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
500
|
-
base.WebApiBase.SetPending(options);
|
|
501
|
-
return new Promise< carriers.History[] >(async (resolve, reject) => {
|
|
502
|
-
try {
|
|
503
|
-
config.baseURL = this._options.baseUrl;
|
|
504
|
-
const response = await this._axios.post("GetHistories", undefined , config);
|
|
505
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
506
|
-
const res : carriers.History[] = converters.Create_HistoryArray_From( response.data );
|
|
507
|
-
resolve(res);
|
|
508
|
-
}
|
|
509
|
-
catch( err ) {
|
|
510
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
511
|
-
reject(err);
|
|
512
|
-
}
|
|
513
|
-
});
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
/**
|
|
518
|
-
* Returns all history items that belong to the currently logged in user
|
|
519
|
-
* @returns Array of History items
|
|
520
|
-
*/
|
|
521
|
-
public async getHistoriesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >
|
|
522
|
-
{
|
|
523
|
-
return this._getHistoriesAsync(webapi_options);
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
private async _getHistoriesByNameAsync(request: carriers.ViewState_GetHistoriesByNameRequest, options?:base.WebApiRequestOptions) : Promise< carriers.History[] > {
|
|
528
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
529
|
-
base.WebApiBase.SetPending(options);
|
|
530
|
-
return new Promise< carriers.History[] >(async (resolve, reject) => {
|
|
531
|
-
try {
|
|
532
|
-
config.baseURL = this._options.baseUrl;
|
|
533
|
-
const response = await this._axios.post("GetHistoriesByName", request , config);
|
|
534
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
535
|
-
const res : carriers.History[] = converters.Create_HistoryArray_From( response.data );
|
|
536
|
-
resolve(res);
|
|
537
|
-
}
|
|
538
|
-
catch( err ) {
|
|
539
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
540
|
-
reject(err);
|
|
541
|
-
}
|
|
542
|
-
});
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
/**
|
|
548
|
-
* Returns the named history list that belong to the currently logged in user
|
|
549
|
-
* @param request - HistoryName
|
|
550
|
-
* @returns Array of History items
|
|
551
|
-
*/
|
|
552
|
-
public async getHistoriesByNameAsync(request: carriers.ViewState_GetHistoriesByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
553
|
-
|
|
554
|
-
/**
|
|
555
|
-
* Returns the named history list that belong to the currently logged in user
|
|
556
|
-
* @param historyName - Name of the history list
|
|
557
|
-
* @returns Array of History items
|
|
558
|
-
*/
|
|
559
|
-
public async getHistoriesByNameAsync(historyName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
560
|
-
|
|
561
|
-
public async getHistoriesByNameAsync(historyName:string|carriers.ViewState_GetHistoriesByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] > {
|
|
562
|
-
let _request : carriers.ViewState_GetHistoriesByNameRequest = null;
|
|
563
|
-
let _options : base.WebApiRequestOptions = null;
|
|
564
|
-
const first : any = historyName;
|
|
565
|
-
if( typeof( first ) === "object" && first && ( typeof(first.historyName)!='undefined' ) )
|
|
566
|
-
{
|
|
567
|
-
_request = historyName as carriers.ViewState_GetHistoriesByNameRequest;
|
|
568
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
569
|
-
}
|
|
570
|
-
else
|
|
571
|
-
{
|
|
572
|
-
_request = {
|
|
573
|
-
historyName: historyName as string,
|
|
574
|
-
};
|
|
575
|
-
_options = webapi_options;
|
|
576
|
-
}
|
|
577
|
-
return this._getHistoriesByNameAsync( _request, _options );
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
private async _getHistoriesByNamesAsync(request: carriers.ViewState_GetHistoriesByNamesRequest, options?:base.WebApiRequestOptions) : Promise< carriers.History[] > {
|
|
582
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
583
|
-
base.WebApiBase.SetPending(options);
|
|
584
|
-
return new Promise< carriers.History[] >(async (resolve, reject) => {
|
|
585
|
-
try {
|
|
586
|
-
config.baseURL = this._options.baseUrl;
|
|
587
|
-
const response = await this._axios.post("GetHistoriesByNames", request , config);
|
|
588
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
589
|
-
const res : carriers.History[] = converters.Create_HistoryArray_From( response.data );
|
|
590
|
-
resolve(res);
|
|
591
|
-
}
|
|
592
|
-
catch( err ) {
|
|
593
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
594
|
-
reject(err);
|
|
595
|
-
}
|
|
596
|
-
});
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
/**
|
|
602
|
-
* Returns the named history lists that belong to the currently logged in user
|
|
603
|
-
* @param request - HistoryNames
|
|
604
|
-
* @returns Array of History items
|
|
605
|
-
*/
|
|
606
|
-
public async getHistoriesByNamesAsync(request: carriers.ViewState_GetHistoriesByNamesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
607
|
-
|
|
608
|
-
/**
|
|
609
|
-
* Returns the named history lists that belong to the currently logged in user
|
|
610
|
-
* @param historyNames - String array of list names
|
|
611
|
-
* @returns Array of History items
|
|
612
|
-
*/
|
|
613
|
-
public async getHistoriesByNamesAsync(historyNames: string[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
614
|
-
|
|
615
|
-
public async getHistoriesByNamesAsync(historyNames:string[]|carriers.ViewState_GetHistoriesByNamesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] > {
|
|
616
|
-
let _request : carriers.ViewState_GetHistoriesByNamesRequest = null;
|
|
617
|
-
let _options : base.WebApiRequestOptions = null;
|
|
618
|
-
const first : any = historyNames;
|
|
619
|
-
if( typeof( first ) === "object" && first && ( typeof(first.historyNames)!='undefined' ) )
|
|
620
|
-
{
|
|
621
|
-
_request = historyNames as carriers.ViewState_GetHistoriesByNamesRequest;
|
|
622
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
623
|
-
}
|
|
624
|
-
else
|
|
625
|
-
{
|
|
626
|
-
_request = {
|
|
627
|
-
historyNames: historyNames as string[],
|
|
628
|
-
};
|
|
629
|
-
_options = webapi_options;
|
|
630
|
-
}
|
|
631
|
-
return this._getHistoriesByNamesAsync( _request, _options );
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
private async _saveHistoriesAsync(request: carriers.ViewState_SaveHistoriesRequest, options?:base.WebApiRequestOptions) : Promise< carriers.History[] > {
|
|
636
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
637
|
-
base.WebApiBase.SetPending(options);
|
|
638
|
-
return new Promise< carriers.History[] >(async (resolve, reject) => {
|
|
639
|
-
try {
|
|
640
|
-
config.baseURL = this._options.baseUrl;
|
|
641
|
-
const response = await this._axios.post("SaveHistories", request , config);
|
|
642
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
643
|
-
const res : carriers.History[] = converters.Create_HistoryArray_From( response.data );
|
|
644
|
-
resolve(res);
|
|
645
|
-
}
|
|
646
|
-
catch( err ) {
|
|
647
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
648
|
-
reject(err);
|
|
649
|
-
}
|
|
650
|
-
});
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
/**
|
|
656
|
-
* Replaces the existing history-list for the currently logged in user. All elements must belong to the same history list. If not they are ignored.
|
|
657
|
-
* @param request - HistoryName, History
|
|
658
|
-
* @returns Array of the saved History items
|
|
659
|
-
*/
|
|
660
|
-
public async saveHistoriesAsync(request: carriers.ViewState_SaveHistoriesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
661
|
-
|
|
662
|
-
/**
|
|
663
|
-
* Replaces the existing history-list for the currently logged in user. All elements must belong to the same history list. If not they are ignored.
|
|
664
|
-
* @param historyName -
|
|
665
|
-
* @param history - Array of new history items to save.
|
|
666
|
-
* @returns Array of the saved History items
|
|
667
|
-
*/
|
|
668
|
-
public async saveHistoriesAsync(historyName: string, history: carriers.History[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
669
|
-
|
|
670
|
-
public async saveHistoriesAsync(historyName:string|carriers.ViewState_SaveHistoriesRequest, history?:carriers.History[]|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] > {
|
|
671
|
-
let _request : carriers.ViewState_SaveHistoriesRequest = null;
|
|
672
|
-
let _options : base.WebApiRequestOptions = null;
|
|
673
|
-
const first : any = historyName;
|
|
674
|
-
if( typeof( first ) === "object" && first && ( typeof(first.historyName)!='undefined' || typeof(first.history)!='undefined' ) )
|
|
675
|
-
{
|
|
676
|
-
_request = historyName as carriers.ViewState_SaveHistoriesRequest;
|
|
677
|
-
_options = history as base.WebApiRequestOptions;
|
|
678
|
-
}
|
|
679
|
-
else
|
|
680
|
-
{
|
|
681
|
-
_request = {
|
|
682
|
-
historyName: historyName as string,
|
|
683
|
-
history: history as carriers.History[],
|
|
684
|
-
};
|
|
685
|
-
_options = webapi_options;
|
|
686
|
-
}
|
|
687
|
-
return this._saveHistoriesAsync( _request, _options );
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
private async _saveCurrentsAsync(request: carriers.ViewState_SaveCurrentsRequest, options?:base.WebApiRequestOptions) : Promise< carriers.History[] > {
|
|
692
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
693
|
-
base.WebApiBase.SetPending(options);
|
|
694
|
-
return new Promise< carriers.History[] >(async (resolve, reject) => {
|
|
695
|
-
try {
|
|
696
|
-
config.baseURL = this._options.baseUrl;
|
|
697
|
-
const response = await this._axios.post("SaveCurrents", request , config);
|
|
698
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
699
|
-
const res : carriers.History[] = converters.Create_HistoryArray_From( response.data );
|
|
700
|
-
resolve(res);
|
|
701
|
-
}
|
|
702
|
-
catch( err ) {
|
|
703
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
704
|
-
reject(err);
|
|
705
|
-
}
|
|
706
|
-
});
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
/**
|
|
712
|
-
* Saves the history elements as the current value for their respective lists. If more than one item is submitted for the same list, they are added sequently, meaning that the last one is the most current.
|
|
713
|
-
* @param request - Currents
|
|
714
|
-
* @returns Array of the saved History items
|
|
715
|
-
*/
|
|
716
|
-
public async saveCurrentsAsync(request: carriers.ViewState_SaveCurrentsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
717
|
-
|
|
718
|
-
/**
|
|
719
|
-
* Saves the history elements as the current value for their respective lists. If more than one item is submitted for the same list, they are added sequently, meaning that the last one is the most current.
|
|
720
|
-
* @param currents - Array of new history items to save.
|
|
721
|
-
* @returns Array of the saved History items
|
|
722
|
-
*/
|
|
723
|
-
public async saveCurrentsAsync(currents: carriers.History[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
724
|
-
|
|
725
|
-
public async saveCurrentsAsync(currents:carriers.History[]|carriers.ViewState_SaveCurrentsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] > {
|
|
726
|
-
let _request : carriers.ViewState_SaveCurrentsRequest = null;
|
|
727
|
-
let _options : base.WebApiRequestOptions = null;
|
|
728
|
-
const first : any = currents;
|
|
729
|
-
if( typeof( first ) === "object" && first && ( typeof(first.currents)!='undefined' ) )
|
|
730
|
-
{
|
|
731
|
-
_request = currents as carriers.ViewState_SaveCurrentsRequest;
|
|
732
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
733
|
-
}
|
|
734
|
-
else
|
|
735
|
-
{
|
|
736
|
-
_request = {
|
|
737
|
-
currents: currents as carriers.History[],
|
|
738
|
-
};
|
|
739
|
-
_options = webapi_options;
|
|
740
|
-
}
|
|
741
|
-
return this._saveCurrentsAsync( _request, _options );
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
private async _getHistoriesByNamesAndIdsAsync(request: carriers.ViewState_GetHistoriesByNamesAndIdsRequest, options?:base.WebApiRequestOptions) : Promise< carriers.History[] > {
|
|
746
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
747
|
-
base.WebApiBase.SetPending(options);
|
|
748
|
-
return new Promise< carriers.History[] >(async (resolve, reject) => {
|
|
749
|
-
try {
|
|
750
|
-
config.baseURL = this._options.baseUrl;
|
|
751
|
-
const response = await this._axios.post("GetHistoriesByNamesAndIds", request , config);
|
|
752
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
753
|
-
const res : carriers.History[] = converters.Create_HistoryArray_From( response.data );
|
|
754
|
-
resolve(res);
|
|
755
|
-
}
|
|
756
|
-
catch( err ) {
|
|
757
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
758
|
-
reject(err);
|
|
759
|
-
}
|
|
760
|
-
});
|
|
761
|
-
}
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
/**
|
|
766
|
-
* Returns history data for the named entities and the given ids - which may not directly correspond to the current history records in the database.<para/>Use this method if you know exactly which items you need, regardless of whether they are in the current history or not.<para/>The history in the database is not changed or even looked at by this method.
|
|
767
|
-
* @param request - Requests
|
|
768
|
-
* @returns On history item for each history name/id pair specified, in exactly the same order as specified.<para/>If a specified item cannot be found in the database, its Id will be 0 and its name will be blank in the return array.
|
|
769
|
-
*/
|
|
770
|
-
public async getHistoriesByNamesAndIdsAsync(request: carriers.ViewState_GetHistoriesByNamesAndIdsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
771
|
-
|
|
772
|
-
/**
|
|
773
|
-
* Returns history data for the named entities and the given ids - which may not directly correspond to the current history records in the database.<para/>Use this method if you know exactly which items you need, regardless of whether they are in the current history or not.<para/>The history in the database is not changed or even looked at by this method.
|
|
774
|
-
* @param requests - Array of request objects that define what entities we are requesting history information for
|
|
775
|
-
* @returns On history item for each history name/id pair specified, in exactly the same order as specified.<para/>If a specified item cannot be found in the database, its Id will be 0 and its name will be blank in the return array.
|
|
776
|
-
*/
|
|
777
|
-
public async getHistoriesByNamesAndIdsAsync(requests: carriers.HistoryRequest[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
778
|
-
|
|
779
|
-
public async getHistoriesByNamesAndIdsAsync(requests:carriers.HistoryRequest[]|carriers.ViewState_GetHistoriesByNamesAndIdsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] > {
|
|
780
|
-
let _request : carriers.ViewState_GetHistoriesByNamesAndIdsRequest = null;
|
|
781
|
-
let _options : base.WebApiRequestOptions = null;
|
|
782
|
-
const first : any = requests;
|
|
783
|
-
if( typeof( first ) === "object" && first && ( typeof(first.requests)!='undefined' ) )
|
|
784
|
-
{
|
|
785
|
-
_request = requests as carriers.ViewState_GetHistoriesByNamesAndIdsRequest;
|
|
786
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
787
|
-
}
|
|
788
|
-
else
|
|
789
|
-
{
|
|
790
|
-
_request = {
|
|
791
|
-
requests: requests as carriers.HistoryRequest[],
|
|
792
|
-
};
|
|
793
|
-
_options = webapi_options;
|
|
794
|
-
}
|
|
795
|
-
return this._getHistoriesByNamesAndIdsAsync( _request, _options );
|
|
796
|
-
}
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
private async _publishAndRetrieveUiEventsAsync(request: carriers.ViewState_PublishAndRetrieveUiEventsRequest, options?:base.WebApiRequestOptions) : Promise< carriers.UiEvent[] > {
|
|
800
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
801
|
-
base.WebApiBase.SetPending(options);
|
|
802
|
-
return new Promise< carriers.UiEvent[] >(async (resolve, reject) => {
|
|
803
|
-
try {
|
|
804
|
-
config.baseURL = this._options.baseUrl;
|
|
805
|
-
const response = await this._axios.post("PublishAndRetrieveUiEvents", request , config);
|
|
806
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
807
|
-
const res : carriers.UiEvent[] = converters.Create_UiEventArray_From( response.data );
|
|
808
|
-
resolve(res);
|
|
809
|
-
}
|
|
810
|
-
catch( err ) {
|
|
811
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
812
|
-
reject(err);
|
|
813
|
-
}
|
|
814
|
-
});
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
/**
|
|
820
|
-
* Publish zero or more events, and return any new events since the given event id. The initial implementation is in-memory only; applies solely to the front-end web server; and anything older than 20 minutes is discarded
|
|
821
|
-
* @param request - LatestKnownEventId, PublishEvents, Metrics
|
|
822
|
-
* @returns Array of events since the given event ID; within the time span kept by the event mechanism. Event/primarykey combinations are not guaranteed to be unique, and events in the PublishEvents parameter are echoed back to the client
|
|
823
|
-
*/
|
|
824
|
-
public async publishAndRetrieveUiEventsAsync(request: carriers.ViewState_PublishAndRetrieveUiEventsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UiEvent[] >;
|
|
825
|
-
|
|
826
|
-
/**
|
|
827
|
-
* Publish zero or more events, and return any new events since the given event id. The initial implementation is in-memory only; applies solely to the front-end web server; and anything older than 20 minutes is discarded
|
|
828
|
-
* @param latestKnownEventId - The last event ID that this client knows about. The return value will be any events occurring /after/ that point, numbered by the server. Clients need to keep track themselves of this number between calls
|
|
829
|
-
* @param publishEvents - Array of events to publish. This can be empty if the client only wants to retrieve information
|
|
830
|
-
* @param metrics - Optional statistical and performance metrics collected by the frontend. Can be null or empty. Metrics are sum-accumulated and reported once a minute; please do not report the same logical event twice
|
|
831
|
-
* @returns Array of events since the given event ID; within the time span kept by the event mechanism. Event/primarykey combinations are not guaranteed to be unique, and events in the PublishEvents parameter are echoed back to the client
|
|
832
|
-
*/
|
|
833
|
-
public async publishAndRetrieveUiEventsAsync(latestKnownEventId: number, publishEvents: carriers.UiEvent[], metrics: carriers.MetricPair[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UiEvent[] >;
|
|
834
|
-
|
|
835
|
-
public async publishAndRetrieveUiEventsAsync(latestKnownEventId:number|carriers.ViewState_PublishAndRetrieveUiEventsRequest, publishEvents?:carriers.UiEvent[]|base.WebApiRequestOptions, metrics?:carriers.MetricPair[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UiEvent[] > {
|
|
836
|
-
let _request : carriers.ViewState_PublishAndRetrieveUiEventsRequest = null;
|
|
837
|
-
let _options : base.WebApiRequestOptions = null;
|
|
838
|
-
const first : any = latestKnownEventId;
|
|
839
|
-
if( typeof( first ) === "object" && first && ( typeof(first.latestKnownEventId)!='undefined' || typeof(first.publishEvents)!='undefined' || typeof(first.metrics)!='undefined' ) )
|
|
840
|
-
{
|
|
841
|
-
_request = latestKnownEventId as carriers.ViewState_PublishAndRetrieveUiEventsRequest;
|
|
842
|
-
_options = publishEvents as base.WebApiRequestOptions;
|
|
843
|
-
}
|
|
844
|
-
else
|
|
845
|
-
{
|
|
846
|
-
_request = {
|
|
847
|
-
latestKnownEventId: latestKnownEventId as number,
|
|
848
|
-
publishEvents: publishEvents as carriers.UiEvent[],
|
|
849
|
-
metrics: metrics as carriers.MetricPair[],
|
|
850
|
-
};
|
|
851
|
-
_options = webapi_options;
|
|
852
|
-
}
|
|
853
|
-
return this._publishAndRetrieveUiEventsAsync( _request, _options );
|
|
854
|
-
}
|
|
855
|
-
|
|
856
|
-
} // class v1ViewStateAgentController
|
|
857
|
-
|
|
858
|
-
|
|
1
|
+
// <auto-generated>
|
|
2
|
+
// SuperOffice Code Generator
|
|
3
|
+
// modelling\templates\servicestswebapi\tswebapiagents.tt
|
|
4
|
+
// </auto-generated>
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/* tslint:disable */
|
|
8
|
+
//----------------------------------------------------------------------------
|
|
9
|
+
// G E N E R A T E D F I L E ! D O N O T E D I T !
|
|
10
|
+
//----------------------------------------------------------------------------
|
|
11
|
+
//
|
|
12
|
+
// File: WebApi/ViewStateAgent.ts
|
|
13
|
+
//
|
|
14
|
+
//----------------------------------------------------------------------------
|
|
15
|
+
// Copyright (C) SuperOffice AS
|
|
16
|
+
//----------------------------------------------------------------------------
|
|
17
|
+
|
|
18
|
+
import { AxiosRequestConfig } from 'axios';
|
|
19
|
+
import { Duration } from 'dayjs/plugin/duration';
|
|
20
|
+
import * as enums from './Enums';
|
|
21
|
+
import * as base from './WebApiBase';
|
|
22
|
+
import * as carriers from './Carriers';
|
|
23
|
+
import * as converters from './Converters';
|
|
24
|
+
import { FromBase64ToString, ToBase64 } from './Base64';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* User interface view state, history, currentXXX values
|
|
28
|
+
*/
|
|
29
|
+
export interface IViewStateAgent {
|
|
30
|
+
getLiveUiConfigAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LiveUiConfig >;
|
|
31
|
+
getHistoryAsync(historyId: number) : Promise< carriers.History >;
|
|
32
|
+
getCurrentAsync(request: carriers.ViewState_GetCurrentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History >;
|
|
33
|
+
getCurrentAsync(historyName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History >;
|
|
34
|
+
saveCurrentAsync(request: carriers.ViewState_SaveCurrentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History >;
|
|
35
|
+
saveCurrentAsync(current: carriers.History, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History >;
|
|
36
|
+
getNextCurrentAsync(request: carriers.ViewState_GetNextCurrentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History >;
|
|
37
|
+
getNextCurrentAsync(historyName: string, id: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History >;
|
|
38
|
+
getPreviousCurrentAsync(request: carriers.ViewState_GetPreviousCurrentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History >;
|
|
39
|
+
getPreviousCurrentAsync(historyName: string, id: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History >;
|
|
40
|
+
deleteHistoryAsync(request: carriers.ViewState_DeleteHistoryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
41
|
+
deleteHistoryAsync(historyName: string, id: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
42
|
+
getHistoryLengthPrefValueAsync(webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
43
|
+
setHistoryLengthPrefValueAsync(request: carriers.ViewState_SetHistoryLengthPrefValueRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
44
|
+
setHistoryLengthPrefValueAsync(length: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
45
|
+
getHistoriesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
46
|
+
getHistoriesByNameAsync(request: carriers.ViewState_GetHistoriesByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
47
|
+
getHistoriesByNameAsync(historyName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
48
|
+
getHistoriesByNamesAsync(request: carriers.ViewState_GetHistoriesByNamesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
49
|
+
getHistoriesByNamesAsync(historyNames: string[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
50
|
+
saveHistoriesAsync(request: carriers.ViewState_SaveHistoriesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
51
|
+
saveHistoriesAsync(historyName: string, history: carriers.History[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
52
|
+
saveCurrentsAsync(request: carriers.ViewState_SaveCurrentsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
53
|
+
saveCurrentsAsync(currents: carriers.History[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
54
|
+
getHistoriesByNamesAndIdsAsync(request: carriers.ViewState_GetHistoriesByNamesAndIdsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
55
|
+
getHistoriesByNamesAndIdsAsync(requests: carriers.HistoryRequest[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
56
|
+
publishAndRetrieveUiEventsAsync(request: carriers.ViewState_PublishAndRetrieveUiEventsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UiEvent[] >;
|
|
57
|
+
publishAndRetrieveUiEventsAsync(latestKnownEventId: number, publishEvents: carriers.UiEvent[], metrics: carriers.MetricPair[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UiEvent[] >;
|
|
58
|
+
} // interface IViewStateAgent
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* User interface view state, history, currentXXX values
|
|
65
|
+
*/
|
|
66
|
+
export class ViewStateAgent extends base.WebApiBase implements IViewStateAgent {
|
|
67
|
+
constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
|
|
68
|
+
constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
|
|
69
|
+
constructor(baseUrl: string, resourceManager:any);
|
|
70
|
+
constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
|
|
71
|
+
constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
|
|
72
|
+
constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
|
|
73
|
+
constructor(options: base.WebApiOptions);
|
|
74
|
+
|
|
75
|
+
constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
|
|
76
|
+
langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
|
|
77
|
+
langOrResourceOrRM?:string|base.ResourceParsing|any,
|
|
78
|
+
cultureCode?: string,
|
|
79
|
+
) {
|
|
80
|
+
const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
|
|
81
|
+
options.basePath = "v1/Agents/ViewState/";
|
|
82
|
+
super(options);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
private async _getLiveUiConfigAsync( options?:base.WebApiRequestOptions) : Promise< carriers.LiveUiConfig > {
|
|
88
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
89
|
+
base.WebApiBase.SetPending(options);
|
|
90
|
+
return new Promise< carriers.LiveUiConfig >(async (resolve, reject) => {
|
|
91
|
+
try {
|
|
92
|
+
config.baseURL = this._options.baseUrl;
|
|
93
|
+
const response = await this._axios.post("GetLiveUiConfig", undefined , config);
|
|
94
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
95
|
+
const res : carriers.LiveUiConfig = converters.Create_LiveUiConfig_From( response.data );
|
|
96
|
+
resolve(res);
|
|
97
|
+
}
|
|
98
|
+
catch( err ) {
|
|
99
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
100
|
+
reject(err);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Gets live UI configuration
|
|
108
|
+
* @returns Live UI configuration containing the parameters needed for live UI functionality
|
|
109
|
+
*/
|
|
110
|
+
public async getLiveUiConfigAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LiveUiConfig >
|
|
111
|
+
{
|
|
112
|
+
return this._getLiveUiConfigAsync(webapi_options);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Gets a History object.
|
|
117
|
+
* @param historyId - The primary key.
|
|
118
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
119
|
+
* @returns A single History
|
|
120
|
+
*/
|
|
121
|
+
public async getHistoryAsync(historyId: number, options?:base.WebApiRequestOptions) : Promise< carriers.History > {
|
|
122
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
123
|
+
base.WebApiBase.SetPending(options);
|
|
124
|
+
return new Promise< carriers.History >(async (resolve, reject) => {
|
|
125
|
+
try {
|
|
126
|
+
const response = await this._axios.post("GetHistory?historyId=" + historyId, null, config);
|
|
127
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
128
|
+
const res = converters.Create_History_From( response.data );
|
|
129
|
+
resolve(res);
|
|
130
|
+
}
|
|
131
|
+
catch( err ) {
|
|
132
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
133
|
+
reject(err);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
private async _getCurrentAsync(request: carriers.ViewState_GetCurrentRequest, options?:base.WebApiRequestOptions) : Promise< carriers.History > {
|
|
140
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
141
|
+
base.WebApiBase.SetPending(options);
|
|
142
|
+
return new Promise< carriers.History >(async (resolve, reject) => {
|
|
143
|
+
try {
|
|
144
|
+
config.baseURL = this._options.baseUrl;
|
|
145
|
+
const response = await this._axios.post("GetCurrent", request , config);
|
|
146
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
147
|
+
const res : carriers.History = converters.Create_History_From( response.data );
|
|
148
|
+
resolve(res);
|
|
149
|
+
}
|
|
150
|
+
catch( err ) {
|
|
151
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
152
|
+
reject(err);
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Get the current (most recent) value of the history list. This is the item with rank = 1. If no item exists a default value is returned. This is usually the first item in the table representing the history list.
|
|
161
|
+
* @param request - HistoryName
|
|
162
|
+
* @returns The current (most recent) history item
|
|
163
|
+
*/
|
|
164
|
+
public async getCurrentAsync(request: carriers.ViewState_GetCurrentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History >;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Get the current (most recent) value of the history list. This is the item with rank = 1. If no item exists a default value is returned. This is usually the first item in the table representing the history list.
|
|
168
|
+
* @param historyName - Name of the history list, e.g. contact, project
|
|
169
|
+
* @returns The current (most recent) history item
|
|
170
|
+
*/
|
|
171
|
+
public async getCurrentAsync(historyName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History >;
|
|
172
|
+
|
|
173
|
+
public async getCurrentAsync(historyName:string|carriers.ViewState_GetCurrentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History > {
|
|
174
|
+
let _request : carriers.ViewState_GetCurrentRequest = null;
|
|
175
|
+
let _options : base.WebApiRequestOptions = null;
|
|
176
|
+
const first : any = historyName;
|
|
177
|
+
if( typeof( first ) === "object" && first && ( typeof(first.historyName)!='undefined' ) )
|
|
178
|
+
{
|
|
179
|
+
_request = historyName as carriers.ViewState_GetCurrentRequest;
|
|
180
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
181
|
+
}
|
|
182
|
+
else
|
|
183
|
+
{
|
|
184
|
+
_request = {
|
|
185
|
+
historyName: historyName as string,
|
|
186
|
+
};
|
|
187
|
+
_options = webapi_options;
|
|
188
|
+
}
|
|
189
|
+
return this._getCurrentAsync( _request, _options );
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
private async _saveCurrentAsync(request: carriers.ViewState_SaveCurrentRequest, options?:base.WebApiRequestOptions) : Promise< carriers.History > {
|
|
194
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
195
|
+
base.WebApiBase.SetPending(options);
|
|
196
|
+
return new Promise< carriers.History >(async (resolve, reject) => {
|
|
197
|
+
try {
|
|
198
|
+
config.baseURL = this._options.baseUrl;
|
|
199
|
+
const response = await this._axios.post("SaveCurrent", request , config);
|
|
200
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
201
|
+
const res : carriers.History = converters.Create_History_From( response.data );
|
|
202
|
+
resolve(res);
|
|
203
|
+
}
|
|
204
|
+
catch( err ) {
|
|
205
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
206
|
+
reject(err);
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Saving the current history item. This history item is saved with Rank = 1, and all the remaining elements rank values are shifted one down. The list is maintained with the max lenght of the History list length preference.
|
|
215
|
+
* @param request - Current
|
|
216
|
+
* @returns The current (most recent) history item
|
|
217
|
+
*/
|
|
218
|
+
public async saveCurrentAsync(request: carriers.ViewState_SaveCurrentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History >;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Saving the current history item. This history item is saved with Rank = 1, and all the remaining elements rank values are shifted one down. The list is maintained with the max lenght of the History list length preference.
|
|
222
|
+
* @param current - The new current history element.
|
|
223
|
+
* @returns The current (most recent) history item
|
|
224
|
+
*/
|
|
225
|
+
public async saveCurrentAsync(current: carriers.History, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History >;
|
|
226
|
+
|
|
227
|
+
public async saveCurrentAsync(current:carriers.History|carriers.ViewState_SaveCurrentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History > {
|
|
228
|
+
let _request : carriers.ViewState_SaveCurrentRequest = null;
|
|
229
|
+
let _options : base.WebApiRequestOptions = null;
|
|
230
|
+
const first : any = current;
|
|
231
|
+
if( typeof( first ) === "object" && first && ( typeof(first.current)!='undefined' ) )
|
|
232
|
+
{
|
|
233
|
+
_request = current as carriers.ViewState_SaveCurrentRequest;
|
|
234
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
235
|
+
}
|
|
236
|
+
else
|
|
237
|
+
{
|
|
238
|
+
_request = {
|
|
239
|
+
current: current as carriers.History,
|
|
240
|
+
};
|
|
241
|
+
_options = webapi_options;
|
|
242
|
+
}
|
|
243
|
+
return this._saveCurrentAsync( _request, _options );
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
private async _getNextCurrentAsync(request: carriers.ViewState_GetNextCurrentRequest, options?:base.WebApiRequestOptions) : Promise< carriers.History > {
|
|
248
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
249
|
+
base.WebApiBase.SetPending(options);
|
|
250
|
+
return new Promise< carriers.History >(async (resolve, reject) => {
|
|
251
|
+
try {
|
|
252
|
+
config.baseURL = this._options.baseUrl;
|
|
253
|
+
const response = await this._axios.post("GetNextCurrent", request , config);
|
|
254
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
255
|
+
const res : carriers.History = converters.Create_History_From( response.data );
|
|
256
|
+
resolve(res);
|
|
257
|
+
}
|
|
258
|
+
catch( err ) {
|
|
259
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
260
|
+
reject(err);
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Returns the next current item. If no item exists a default value is returned. This is usually the first item in the table representing the history list.
|
|
269
|
+
* @param request - HistoryName, Id
|
|
270
|
+
* @returns The current value.
|
|
271
|
+
*/
|
|
272
|
+
public async getNextCurrentAsync(request: carriers.ViewState_GetNextCurrentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History >;
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Returns the next current item. If no item exists a default value is returned. This is usually the first item in the table representing the history list.
|
|
276
|
+
* @param historyName - Name of the history list, e.g. contact, project
|
|
277
|
+
* @param id - Id of the history element, e.g. Contact id
|
|
278
|
+
* @returns The current value.
|
|
279
|
+
*/
|
|
280
|
+
public async getNextCurrentAsync(historyName: string, id: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History >;
|
|
281
|
+
|
|
282
|
+
public async getNextCurrentAsync(historyName:string|carriers.ViewState_GetNextCurrentRequest, id?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History > {
|
|
283
|
+
let _request : carriers.ViewState_GetNextCurrentRequest = null;
|
|
284
|
+
let _options : base.WebApiRequestOptions = null;
|
|
285
|
+
const first : any = historyName;
|
|
286
|
+
if( typeof( first ) === "object" && first && ( typeof(first.historyName)!='undefined' || typeof(first.id)!='undefined' ) )
|
|
287
|
+
{
|
|
288
|
+
_request = historyName as carriers.ViewState_GetNextCurrentRequest;
|
|
289
|
+
_options = id as base.WebApiRequestOptions;
|
|
290
|
+
}
|
|
291
|
+
else
|
|
292
|
+
{
|
|
293
|
+
_request = {
|
|
294
|
+
historyName: historyName as string,
|
|
295
|
+
id: id as number,
|
|
296
|
+
};
|
|
297
|
+
_options = webapi_options;
|
|
298
|
+
}
|
|
299
|
+
return this._getNextCurrentAsync( _request, _options );
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
private async _getPreviousCurrentAsync(request: carriers.ViewState_GetPreviousCurrentRequest, options?:base.WebApiRequestOptions) : Promise< carriers.History > {
|
|
304
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
305
|
+
base.WebApiBase.SetPending(options);
|
|
306
|
+
return new Promise< carriers.History >(async (resolve, reject) => {
|
|
307
|
+
try {
|
|
308
|
+
config.baseURL = this._options.baseUrl;
|
|
309
|
+
const response = await this._axios.post("GetPreviousCurrent", request , config);
|
|
310
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
311
|
+
const res : carriers.History = converters.Create_History_From( response.data );
|
|
312
|
+
resolve(res);
|
|
313
|
+
}
|
|
314
|
+
catch( err ) {
|
|
315
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
316
|
+
reject(err);
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Returns the previous current item. If no item exists a default value is returned. This is usually the first item in the table representing the history list.
|
|
325
|
+
* @param request - HistoryName, Id
|
|
326
|
+
* @returns The current value.
|
|
327
|
+
*/
|
|
328
|
+
public async getPreviousCurrentAsync(request: carriers.ViewState_GetPreviousCurrentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History >;
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Returns the previous current item. If no item exists a default value is returned. This is usually the first item in the table representing the history list.
|
|
332
|
+
* @param historyName - Name of the history list, e.g. contact, project
|
|
333
|
+
* @param id - Id of the history element, e.g. Contact id
|
|
334
|
+
* @returns The current value.
|
|
335
|
+
*/
|
|
336
|
+
public async getPreviousCurrentAsync(historyName: string, id: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History >;
|
|
337
|
+
|
|
338
|
+
public async getPreviousCurrentAsync(historyName:string|carriers.ViewState_GetPreviousCurrentRequest, id?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History > {
|
|
339
|
+
let _request : carriers.ViewState_GetPreviousCurrentRequest = null;
|
|
340
|
+
let _options : base.WebApiRequestOptions = null;
|
|
341
|
+
const first : any = historyName;
|
|
342
|
+
if( typeof( first ) === "object" && first && ( typeof(first.historyName)!='undefined' || typeof(first.id)!='undefined' ) )
|
|
343
|
+
{
|
|
344
|
+
_request = historyName as carriers.ViewState_GetPreviousCurrentRequest;
|
|
345
|
+
_options = id as base.WebApiRequestOptions;
|
|
346
|
+
}
|
|
347
|
+
else
|
|
348
|
+
{
|
|
349
|
+
_request = {
|
|
350
|
+
historyName: historyName as string,
|
|
351
|
+
id: id as number,
|
|
352
|
+
};
|
|
353
|
+
_options = webapi_options;
|
|
354
|
+
}
|
|
355
|
+
return this._getPreviousCurrentAsync( _request, _options );
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
private async _deleteHistoryAsync(request: carriers.ViewState_DeleteHistoryRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
360
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
361
|
+
base.WebApiBase.SetPending(options);
|
|
362
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
363
|
+
try {
|
|
364
|
+
config.baseURL = this._options.baseUrl;
|
|
365
|
+
const response = await this._axios.post("DeleteHistory", request , config);
|
|
366
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
367
|
+
const res = response.data;
|
|
368
|
+
resolve(res);
|
|
369
|
+
}
|
|
370
|
+
catch( err ) {
|
|
371
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
372
|
+
reject(err);
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* Deletes the history element
|
|
381
|
+
* @param request - HistoryName, Id
|
|
382
|
+
* @returns
|
|
383
|
+
*/
|
|
384
|
+
public async deleteHistoryAsync(request: carriers.ViewState_DeleteHistoryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* Deletes the history element
|
|
388
|
+
* @param historyName - Name of the history list, e.g. contact, project
|
|
389
|
+
* @param id - Id of the history element, e.g. Contact id
|
|
390
|
+
* @returns
|
|
391
|
+
*/
|
|
392
|
+
public async deleteHistoryAsync(historyName: string, id: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
393
|
+
|
|
394
|
+
public async deleteHistoryAsync(historyName:string|carriers.ViewState_DeleteHistoryRequest, id?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
395
|
+
let _request : carriers.ViewState_DeleteHistoryRequest = null;
|
|
396
|
+
let _options : base.WebApiRequestOptions = null;
|
|
397
|
+
const first : any = historyName;
|
|
398
|
+
if( typeof( first ) === "object" && first && ( typeof(first.historyName)!='undefined' || typeof(first.id)!='undefined' ) )
|
|
399
|
+
{
|
|
400
|
+
_request = historyName as carriers.ViewState_DeleteHistoryRequest;
|
|
401
|
+
_options = id as base.WebApiRequestOptions;
|
|
402
|
+
}
|
|
403
|
+
else
|
|
404
|
+
{
|
|
405
|
+
_request = {
|
|
406
|
+
historyName: historyName as string,
|
|
407
|
+
id: id as number,
|
|
408
|
+
};
|
|
409
|
+
_options = webapi_options;
|
|
410
|
+
}
|
|
411
|
+
return this._deleteHistoryAsync( _request, _options );
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
private async _getHistoryLengthPrefValueAsync( options?:base.WebApiRequestOptions) : Promise< number > {
|
|
416
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
417
|
+
base.WebApiBase.SetPending(options);
|
|
418
|
+
return new Promise< number >(async (resolve, reject) => {
|
|
419
|
+
try {
|
|
420
|
+
config.baseURL = this._options.baseUrl;
|
|
421
|
+
const response = await this._axios.post("GetHistoryLengthPrefValue", undefined , config);
|
|
422
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
423
|
+
const res : number = response.data as number;
|
|
424
|
+
resolve(res);
|
|
425
|
+
}
|
|
426
|
+
catch( err ) {
|
|
427
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
428
|
+
reject(err);
|
|
429
|
+
}
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* Get the logged on user's preferred history list length. Will return the system preference if no user preferences are available.
|
|
436
|
+
* @returns The history list lenght
|
|
437
|
+
*/
|
|
438
|
+
public async getHistoryLengthPrefValueAsync(webapi_options?:base.WebApiRequestOptions) : Promise< number >
|
|
439
|
+
{
|
|
440
|
+
return this._getHistoryLengthPrefValueAsync(webapi_options);
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
private async _setHistoryLengthPrefValueAsync(request: carriers.ViewState_SetHistoryLengthPrefValueRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
445
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
446
|
+
base.WebApiBase.SetPending(options);
|
|
447
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
448
|
+
try {
|
|
449
|
+
config.baseURL = this._options.baseUrl;
|
|
450
|
+
const response = await this._axios.post("SetHistoryLengthPrefValue", request , config);
|
|
451
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
452
|
+
const res = response.data;
|
|
453
|
+
resolve(res);
|
|
454
|
+
}
|
|
455
|
+
catch( err ) {
|
|
456
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
457
|
+
reject(err);
|
|
458
|
+
}
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* Set the logged on user's preferred history list length.
|
|
466
|
+
* @param request - Length
|
|
467
|
+
* @returns
|
|
468
|
+
*/
|
|
469
|
+
public async setHistoryLengthPrefValueAsync(request: carriers.ViewState_SetHistoryLengthPrefValueRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* Set the logged on user's preferred history list length.
|
|
473
|
+
* @param length - The new history list lenght
|
|
474
|
+
* @returns
|
|
475
|
+
*/
|
|
476
|
+
public async setHistoryLengthPrefValueAsync(length: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
477
|
+
|
|
478
|
+
public async setHistoryLengthPrefValueAsync(length:number|carriers.ViewState_SetHistoryLengthPrefValueRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
479
|
+
let _request : carriers.ViewState_SetHistoryLengthPrefValueRequest = null;
|
|
480
|
+
let _options : base.WebApiRequestOptions = null;
|
|
481
|
+
const first : any = length;
|
|
482
|
+
if( typeof( first ) === "object" && first && ( typeof(first.length)!='undefined' ) )
|
|
483
|
+
{
|
|
484
|
+
_request = length as carriers.ViewState_SetHistoryLengthPrefValueRequest;
|
|
485
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
486
|
+
}
|
|
487
|
+
else
|
|
488
|
+
{
|
|
489
|
+
_request = {
|
|
490
|
+
length: length as number,
|
|
491
|
+
};
|
|
492
|
+
_options = webapi_options;
|
|
493
|
+
}
|
|
494
|
+
return this._setHistoryLengthPrefValueAsync( _request, _options );
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
private async _getHistoriesAsync( options?:base.WebApiRequestOptions) : Promise< carriers.History[] > {
|
|
499
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
500
|
+
base.WebApiBase.SetPending(options);
|
|
501
|
+
return new Promise< carriers.History[] >(async (resolve, reject) => {
|
|
502
|
+
try {
|
|
503
|
+
config.baseURL = this._options.baseUrl;
|
|
504
|
+
const response = await this._axios.post("GetHistories", undefined , config);
|
|
505
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
506
|
+
const res : carriers.History[] = converters.Create_HistoryArray_From( response.data );
|
|
507
|
+
resolve(res);
|
|
508
|
+
}
|
|
509
|
+
catch( err ) {
|
|
510
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
511
|
+
reject(err);
|
|
512
|
+
}
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* Returns all history items that belong to the currently logged in user
|
|
519
|
+
* @returns Array of History items
|
|
520
|
+
*/
|
|
521
|
+
public async getHistoriesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >
|
|
522
|
+
{
|
|
523
|
+
return this._getHistoriesAsync(webapi_options);
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
private async _getHistoriesByNameAsync(request: carriers.ViewState_GetHistoriesByNameRequest, options?:base.WebApiRequestOptions) : Promise< carriers.History[] > {
|
|
528
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
529
|
+
base.WebApiBase.SetPending(options);
|
|
530
|
+
return new Promise< carriers.History[] >(async (resolve, reject) => {
|
|
531
|
+
try {
|
|
532
|
+
config.baseURL = this._options.baseUrl;
|
|
533
|
+
const response = await this._axios.post("GetHistoriesByName", request , config);
|
|
534
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
535
|
+
const res : carriers.History[] = converters.Create_HistoryArray_From( response.data );
|
|
536
|
+
resolve(res);
|
|
537
|
+
}
|
|
538
|
+
catch( err ) {
|
|
539
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
540
|
+
reject(err);
|
|
541
|
+
}
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* Returns the named history list that belong to the currently logged in user
|
|
549
|
+
* @param request - HistoryName
|
|
550
|
+
* @returns Array of History items
|
|
551
|
+
*/
|
|
552
|
+
public async getHistoriesByNameAsync(request: carriers.ViewState_GetHistoriesByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* Returns the named history list that belong to the currently logged in user
|
|
556
|
+
* @param historyName - Name of the history list
|
|
557
|
+
* @returns Array of History items
|
|
558
|
+
*/
|
|
559
|
+
public async getHistoriesByNameAsync(historyName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
560
|
+
|
|
561
|
+
public async getHistoriesByNameAsync(historyName:string|carriers.ViewState_GetHistoriesByNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] > {
|
|
562
|
+
let _request : carriers.ViewState_GetHistoriesByNameRequest = null;
|
|
563
|
+
let _options : base.WebApiRequestOptions = null;
|
|
564
|
+
const first : any = historyName;
|
|
565
|
+
if( typeof( first ) === "object" && first && ( typeof(first.historyName)!='undefined' ) )
|
|
566
|
+
{
|
|
567
|
+
_request = historyName as carriers.ViewState_GetHistoriesByNameRequest;
|
|
568
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
569
|
+
}
|
|
570
|
+
else
|
|
571
|
+
{
|
|
572
|
+
_request = {
|
|
573
|
+
historyName: historyName as string,
|
|
574
|
+
};
|
|
575
|
+
_options = webapi_options;
|
|
576
|
+
}
|
|
577
|
+
return this._getHistoriesByNameAsync( _request, _options );
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
private async _getHistoriesByNamesAsync(request: carriers.ViewState_GetHistoriesByNamesRequest, options?:base.WebApiRequestOptions) : Promise< carriers.History[] > {
|
|
582
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
583
|
+
base.WebApiBase.SetPending(options);
|
|
584
|
+
return new Promise< carriers.History[] >(async (resolve, reject) => {
|
|
585
|
+
try {
|
|
586
|
+
config.baseURL = this._options.baseUrl;
|
|
587
|
+
const response = await this._axios.post("GetHistoriesByNames", request , config);
|
|
588
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
589
|
+
const res : carriers.History[] = converters.Create_HistoryArray_From( response.data );
|
|
590
|
+
resolve(res);
|
|
591
|
+
}
|
|
592
|
+
catch( err ) {
|
|
593
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
594
|
+
reject(err);
|
|
595
|
+
}
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* Returns the named history lists that belong to the currently logged in user
|
|
603
|
+
* @param request - HistoryNames
|
|
604
|
+
* @returns Array of History items
|
|
605
|
+
*/
|
|
606
|
+
public async getHistoriesByNamesAsync(request: carriers.ViewState_GetHistoriesByNamesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
607
|
+
|
|
608
|
+
/**
|
|
609
|
+
* Returns the named history lists that belong to the currently logged in user
|
|
610
|
+
* @param historyNames - String array of list names
|
|
611
|
+
* @returns Array of History items
|
|
612
|
+
*/
|
|
613
|
+
public async getHistoriesByNamesAsync(historyNames: string[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
614
|
+
|
|
615
|
+
public async getHistoriesByNamesAsync(historyNames:string[]|carriers.ViewState_GetHistoriesByNamesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] > {
|
|
616
|
+
let _request : carriers.ViewState_GetHistoriesByNamesRequest = null;
|
|
617
|
+
let _options : base.WebApiRequestOptions = null;
|
|
618
|
+
const first : any = historyNames;
|
|
619
|
+
if( typeof( first ) === "object" && first && ( typeof(first.historyNames)!='undefined' ) )
|
|
620
|
+
{
|
|
621
|
+
_request = historyNames as carriers.ViewState_GetHistoriesByNamesRequest;
|
|
622
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
623
|
+
}
|
|
624
|
+
else
|
|
625
|
+
{
|
|
626
|
+
_request = {
|
|
627
|
+
historyNames: historyNames as string[],
|
|
628
|
+
};
|
|
629
|
+
_options = webapi_options;
|
|
630
|
+
}
|
|
631
|
+
return this._getHistoriesByNamesAsync( _request, _options );
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
private async _saveHistoriesAsync(request: carriers.ViewState_SaveHistoriesRequest, options?:base.WebApiRequestOptions) : Promise< carriers.History[] > {
|
|
636
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
637
|
+
base.WebApiBase.SetPending(options);
|
|
638
|
+
return new Promise< carriers.History[] >(async (resolve, reject) => {
|
|
639
|
+
try {
|
|
640
|
+
config.baseURL = this._options.baseUrl;
|
|
641
|
+
const response = await this._axios.post("SaveHistories", request , config);
|
|
642
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
643
|
+
const res : carriers.History[] = converters.Create_HistoryArray_From( response.data );
|
|
644
|
+
resolve(res);
|
|
645
|
+
}
|
|
646
|
+
catch( err ) {
|
|
647
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
648
|
+
reject(err);
|
|
649
|
+
}
|
|
650
|
+
});
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
|
|
654
|
+
|
|
655
|
+
/**
|
|
656
|
+
* Replaces the existing history-list for the currently logged in user. All elements must belong to the same history list. If not they are ignored.
|
|
657
|
+
* @param request - HistoryName, History
|
|
658
|
+
* @returns Array of the saved History items
|
|
659
|
+
*/
|
|
660
|
+
public async saveHistoriesAsync(request: carriers.ViewState_SaveHistoriesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
661
|
+
|
|
662
|
+
/**
|
|
663
|
+
* Replaces the existing history-list for the currently logged in user. All elements must belong to the same history list. If not they are ignored.
|
|
664
|
+
* @param historyName -
|
|
665
|
+
* @param history - Array of new history items to save.
|
|
666
|
+
* @returns Array of the saved History items
|
|
667
|
+
*/
|
|
668
|
+
public async saveHistoriesAsync(historyName: string, history: carriers.History[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
669
|
+
|
|
670
|
+
public async saveHistoriesAsync(historyName:string|carriers.ViewState_SaveHistoriesRequest, history?:carriers.History[]|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] > {
|
|
671
|
+
let _request : carriers.ViewState_SaveHistoriesRequest = null;
|
|
672
|
+
let _options : base.WebApiRequestOptions = null;
|
|
673
|
+
const first : any = historyName;
|
|
674
|
+
if( typeof( first ) === "object" && first && ( typeof(first.historyName)!='undefined' || typeof(first.history)!='undefined' ) )
|
|
675
|
+
{
|
|
676
|
+
_request = historyName as carriers.ViewState_SaveHistoriesRequest;
|
|
677
|
+
_options = history as base.WebApiRequestOptions;
|
|
678
|
+
}
|
|
679
|
+
else
|
|
680
|
+
{
|
|
681
|
+
_request = {
|
|
682
|
+
historyName: historyName as string,
|
|
683
|
+
history: history as carriers.History[],
|
|
684
|
+
};
|
|
685
|
+
_options = webapi_options;
|
|
686
|
+
}
|
|
687
|
+
return this._saveHistoriesAsync( _request, _options );
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
private async _saveCurrentsAsync(request: carriers.ViewState_SaveCurrentsRequest, options?:base.WebApiRequestOptions) : Promise< carriers.History[] > {
|
|
692
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
693
|
+
base.WebApiBase.SetPending(options);
|
|
694
|
+
return new Promise< carriers.History[] >(async (resolve, reject) => {
|
|
695
|
+
try {
|
|
696
|
+
config.baseURL = this._options.baseUrl;
|
|
697
|
+
const response = await this._axios.post("SaveCurrents", request , config);
|
|
698
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
699
|
+
const res : carriers.History[] = converters.Create_HistoryArray_From( response.data );
|
|
700
|
+
resolve(res);
|
|
701
|
+
}
|
|
702
|
+
catch( err ) {
|
|
703
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
704
|
+
reject(err);
|
|
705
|
+
}
|
|
706
|
+
});
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
|
|
710
|
+
|
|
711
|
+
/**
|
|
712
|
+
* Saves the history elements as the current value for their respective lists. If more than one item is submitted for the same list, they are added sequently, meaning that the last one is the most current.
|
|
713
|
+
* @param request - Currents
|
|
714
|
+
* @returns Array of the saved History items
|
|
715
|
+
*/
|
|
716
|
+
public async saveCurrentsAsync(request: carriers.ViewState_SaveCurrentsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
717
|
+
|
|
718
|
+
/**
|
|
719
|
+
* Saves the history elements as the current value for their respective lists. If more than one item is submitted for the same list, they are added sequently, meaning that the last one is the most current.
|
|
720
|
+
* @param currents - Array of new history items to save.
|
|
721
|
+
* @returns Array of the saved History items
|
|
722
|
+
*/
|
|
723
|
+
public async saveCurrentsAsync(currents: carriers.History[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
724
|
+
|
|
725
|
+
public async saveCurrentsAsync(currents:carriers.History[]|carriers.ViewState_SaveCurrentsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] > {
|
|
726
|
+
let _request : carriers.ViewState_SaveCurrentsRequest = null;
|
|
727
|
+
let _options : base.WebApiRequestOptions = null;
|
|
728
|
+
const first : any = currents;
|
|
729
|
+
if( typeof( first ) === "object" && first && ( typeof(first.currents)!='undefined' ) )
|
|
730
|
+
{
|
|
731
|
+
_request = currents as carriers.ViewState_SaveCurrentsRequest;
|
|
732
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
733
|
+
}
|
|
734
|
+
else
|
|
735
|
+
{
|
|
736
|
+
_request = {
|
|
737
|
+
currents: currents as carriers.History[],
|
|
738
|
+
};
|
|
739
|
+
_options = webapi_options;
|
|
740
|
+
}
|
|
741
|
+
return this._saveCurrentsAsync( _request, _options );
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
|
|
745
|
+
private async _getHistoriesByNamesAndIdsAsync(request: carriers.ViewState_GetHistoriesByNamesAndIdsRequest, options?:base.WebApiRequestOptions) : Promise< carriers.History[] > {
|
|
746
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
747
|
+
base.WebApiBase.SetPending(options);
|
|
748
|
+
return new Promise< carriers.History[] >(async (resolve, reject) => {
|
|
749
|
+
try {
|
|
750
|
+
config.baseURL = this._options.baseUrl;
|
|
751
|
+
const response = await this._axios.post("GetHistoriesByNamesAndIds", request , config);
|
|
752
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
753
|
+
const res : carriers.History[] = converters.Create_HistoryArray_From( response.data );
|
|
754
|
+
resolve(res);
|
|
755
|
+
}
|
|
756
|
+
catch( err ) {
|
|
757
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
758
|
+
reject(err);
|
|
759
|
+
}
|
|
760
|
+
});
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
|
|
764
|
+
|
|
765
|
+
/**
|
|
766
|
+
* Returns history data for the named entities and the given ids - which may not directly correspond to the current history records in the database.<para/>Use this method if you know exactly which items you need, regardless of whether they are in the current history or not.<para/>The history in the database is not changed or even looked at by this method.
|
|
767
|
+
* @param request - Requests
|
|
768
|
+
* @returns On history item for each history name/id pair specified, in exactly the same order as specified.<para/>If a specified item cannot be found in the database, its Id will be 0 and its name will be blank in the return array.
|
|
769
|
+
*/
|
|
770
|
+
public async getHistoriesByNamesAndIdsAsync(request: carriers.ViewState_GetHistoriesByNamesAndIdsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
771
|
+
|
|
772
|
+
/**
|
|
773
|
+
* Returns history data for the named entities and the given ids - which may not directly correspond to the current history records in the database.<para/>Use this method if you know exactly which items you need, regardless of whether they are in the current history or not.<para/>The history in the database is not changed or even looked at by this method.
|
|
774
|
+
* @param requests - Array of request objects that define what entities we are requesting history information for
|
|
775
|
+
* @returns On history item for each history name/id pair specified, in exactly the same order as specified.<para/>If a specified item cannot be found in the database, its Id will be 0 and its name will be blank in the return array.
|
|
776
|
+
*/
|
|
777
|
+
public async getHistoriesByNamesAndIdsAsync(requests: carriers.HistoryRequest[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
778
|
+
|
|
779
|
+
public async getHistoriesByNamesAndIdsAsync(requests:carriers.HistoryRequest[]|carriers.ViewState_GetHistoriesByNamesAndIdsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] > {
|
|
780
|
+
let _request : carriers.ViewState_GetHistoriesByNamesAndIdsRequest = null;
|
|
781
|
+
let _options : base.WebApiRequestOptions = null;
|
|
782
|
+
const first : any = requests;
|
|
783
|
+
if( typeof( first ) === "object" && first && ( typeof(first.requests)!='undefined' ) )
|
|
784
|
+
{
|
|
785
|
+
_request = requests as carriers.ViewState_GetHistoriesByNamesAndIdsRequest;
|
|
786
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
787
|
+
}
|
|
788
|
+
else
|
|
789
|
+
{
|
|
790
|
+
_request = {
|
|
791
|
+
requests: requests as carriers.HistoryRequest[],
|
|
792
|
+
};
|
|
793
|
+
_options = webapi_options;
|
|
794
|
+
}
|
|
795
|
+
return this._getHistoriesByNamesAndIdsAsync( _request, _options );
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
|
|
799
|
+
private async _publishAndRetrieveUiEventsAsync(request: carriers.ViewState_PublishAndRetrieveUiEventsRequest, options?:base.WebApiRequestOptions) : Promise< carriers.UiEvent[] > {
|
|
800
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
801
|
+
base.WebApiBase.SetPending(options);
|
|
802
|
+
return new Promise< carriers.UiEvent[] >(async (resolve, reject) => {
|
|
803
|
+
try {
|
|
804
|
+
config.baseURL = this._options.baseUrl;
|
|
805
|
+
const response = await this._axios.post("PublishAndRetrieveUiEvents", request , config);
|
|
806
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
807
|
+
const res : carriers.UiEvent[] = converters.Create_UiEventArray_From( response.data );
|
|
808
|
+
resolve(res);
|
|
809
|
+
}
|
|
810
|
+
catch( err ) {
|
|
811
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
812
|
+
reject(err);
|
|
813
|
+
}
|
|
814
|
+
});
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
|
|
818
|
+
|
|
819
|
+
/**
|
|
820
|
+
* Publish zero or more events, and return any new events since the given event id. The initial implementation is in-memory only; applies solely to the front-end web server; and anything older than 20 minutes is discarded
|
|
821
|
+
* @param request - LatestKnownEventId, PublishEvents, Metrics
|
|
822
|
+
* @returns Array of events since the given event ID; within the time span kept by the event mechanism. Event/primarykey combinations are not guaranteed to be unique, and events in the PublishEvents parameter are echoed back to the client
|
|
823
|
+
*/
|
|
824
|
+
public async publishAndRetrieveUiEventsAsync(request: carriers.ViewState_PublishAndRetrieveUiEventsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UiEvent[] >;
|
|
825
|
+
|
|
826
|
+
/**
|
|
827
|
+
* Publish zero or more events, and return any new events since the given event id. The initial implementation is in-memory only; applies solely to the front-end web server; and anything older than 20 minutes is discarded
|
|
828
|
+
* @param latestKnownEventId - The last event ID that this client knows about. The return value will be any events occurring /after/ that point, numbered by the server. Clients need to keep track themselves of this number between calls
|
|
829
|
+
* @param publishEvents - Array of events to publish. This can be empty if the client only wants to retrieve information
|
|
830
|
+
* @param metrics - Optional statistical and performance metrics collected by the frontend. Can be null or empty. Metrics are sum-accumulated and reported once a minute; please do not report the same logical event twice
|
|
831
|
+
* @returns Array of events since the given event ID; within the time span kept by the event mechanism. Event/primarykey combinations are not guaranteed to be unique, and events in the PublishEvents parameter are echoed back to the client
|
|
832
|
+
*/
|
|
833
|
+
public async publishAndRetrieveUiEventsAsync(latestKnownEventId: number, publishEvents: carriers.UiEvent[], metrics: carriers.MetricPair[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UiEvent[] >;
|
|
834
|
+
|
|
835
|
+
public async publishAndRetrieveUiEventsAsync(latestKnownEventId:number|carriers.ViewState_PublishAndRetrieveUiEventsRequest, publishEvents?:carriers.UiEvent[]|base.WebApiRequestOptions, metrics?:carriers.MetricPair[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UiEvent[] > {
|
|
836
|
+
let _request : carriers.ViewState_PublishAndRetrieveUiEventsRequest = null;
|
|
837
|
+
let _options : base.WebApiRequestOptions = null;
|
|
838
|
+
const first : any = latestKnownEventId;
|
|
839
|
+
if( typeof( first ) === "object" && first && ( typeof(first.latestKnownEventId)!='undefined' || typeof(first.publishEvents)!='undefined' || typeof(first.metrics)!='undefined' ) )
|
|
840
|
+
{
|
|
841
|
+
_request = latestKnownEventId as carriers.ViewState_PublishAndRetrieveUiEventsRequest;
|
|
842
|
+
_options = publishEvents as base.WebApiRequestOptions;
|
|
843
|
+
}
|
|
844
|
+
else
|
|
845
|
+
{
|
|
846
|
+
_request = {
|
|
847
|
+
latestKnownEventId: latestKnownEventId as number,
|
|
848
|
+
publishEvents: publishEvents as carriers.UiEvent[],
|
|
849
|
+
metrics: metrics as carriers.MetricPair[],
|
|
850
|
+
};
|
|
851
|
+
_options = webapi_options;
|
|
852
|
+
}
|
|
853
|
+
return this._publishAndRetrieveUiEventsAsync( _request, _options );
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
} // class v1ViewStateAgentController
|
|
857
|
+
|
|
858
|
+
|