@superoffice/webapi 12.2.2072 → 12.4.1514
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Carriers.d.ts +405 -23
- package/dist/cjs/Carriers.d.ts.map +1 -1
- package/dist/cjs/ConfigurationAgent.d.ts +17 -0
- package/dist/cjs/ConfigurationAgent.d.ts.map +1 -1
- package/dist/cjs/ConfigurationAgent.js +35 -0
- package/dist/cjs/ConfigurationAgent.js.map +1 -1
- package/dist/cjs/Converters.d.ts +27 -0
- package/dist/cjs/Converters.d.ts.map +1 -1
- package/dist/cjs/Converters.js +350 -33
- package/dist/cjs/Converters.js.map +1 -1
- package/dist/cjs/DiagnosticsAgent.d.ts +7 -0
- package/dist/cjs/DiagnosticsAgent.d.ts.map +1 -1
- package/dist/cjs/DiagnosticsAgent.js +24 -0
- package/dist/cjs/DiagnosticsAgent.js.map +1 -1
- package/dist/cjs/Enums.d.ts +34 -0
- package/dist/cjs/Enums.d.ts.map +1 -1
- package/dist/cjs/Enums.js +37 -1
- package/dist/cjs/Enums.js.map +1 -1
- package/dist/cjs/ListAgent.d.ts +31 -0
- package/dist/cjs/ListAgent.d.ts.map +1 -1
- package/dist/cjs/ListAgent.js +87 -0
- package/dist/cjs/ListAgent.js.map +1 -1
- package/dist/cjs/MarketingAgent.d.ts +109 -16
- package/dist/cjs/MarketingAgent.d.ts.map +1 -1
- package/dist/cjs/MarketingAgent.js +255 -34
- package/dist/cjs/MarketingAgent.js.map +1 -1
- package/dist/cjs/UserDefinedFieldInfoAgent.d.ts +2 -2
- package/dist/cjs/ViewStateAgent.d.ts +34 -0
- package/dist/cjs/ViewStateAgent.d.ts.map +1 -1
- package/dist/cjs/ViewStateAgent.js +70 -0
- package/dist/cjs/ViewStateAgent.js.map +1 -1
- package/dist/esm/Carriers.d.ts +405 -23
- package/dist/esm/Carriers.d.ts.map +1 -1
- package/dist/esm/ConfigurationAgent.d.ts +17 -0
- package/dist/esm/ConfigurationAgent.d.ts.map +1 -1
- package/dist/esm/ConfigurationAgent.js +35 -0
- package/dist/esm/ConfigurationAgent.js.map +1 -1
- package/dist/esm/Converters.d.ts +27 -0
- package/dist/esm/Converters.d.ts.map +1 -1
- package/dist/esm/Converters.js +292 -2
- package/dist/esm/Converters.js.map +1 -1
- package/dist/esm/DiagnosticsAgent.d.ts +7 -0
- package/dist/esm/DiagnosticsAgent.d.ts.map +1 -1
- package/dist/esm/DiagnosticsAgent.js +24 -0
- package/dist/esm/DiagnosticsAgent.js.map +1 -1
- package/dist/esm/Enums.d.ts +34 -0
- package/dist/esm/Enums.d.ts.map +1 -1
- package/dist/esm/Enums.js +35 -0
- package/dist/esm/Enums.js.map +1 -1
- package/dist/esm/ListAgent.d.ts +31 -0
- package/dist/esm/ListAgent.d.ts.map +1 -1
- package/dist/esm/ListAgent.js +87 -0
- package/dist/esm/ListAgent.js.map +1 -1
- package/dist/esm/MarketingAgent.d.ts +109 -16
- package/dist/esm/MarketingAgent.d.ts.map +1 -1
- package/dist/esm/MarketingAgent.js +255 -34
- package/dist/esm/MarketingAgent.js.map +1 -1
- package/dist/esm/UserDefinedFieldInfoAgent.d.ts +2 -2
- package/dist/esm/ViewStateAgent.d.ts +34 -0
- package/dist/esm/ViewStateAgent.d.ts.map +1 -1
- package/dist/esm/ViewStateAgent.js +70 -0
- package/dist/esm/ViewStateAgent.js.map +1 -1
- package/package.json +3 -3
- package/src/Carriers.ts +646 -2854
- package/src/ConfigurationAgent.ts +60 -0
- package/src/Converters.ts +408 -1243
- package/src/DiagnosticsAgent.ts +30 -0
- package/src/Enums.ts +36 -1
- package/src/ListAgent.ts +94 -0
- package/src/MarketingAgent.ts +380 -58
- package/src/UserDefinedFieldInfoAgent.ts +2 -2
- package/src/ViewStateAgent.ts +120 -0
package/src/MarketingAgent.ts
CHANGED
|
@@ -33,6 +33,9 @@ export interface IMarketingAgent {
|
|
|
33
33
|
createDefaultFormSubmissionEntityAsync(): Promise< carriers.FormSubmissionEntity >;
|
|
34
34
|
saveFormSubmissionEntityAsync(entity: carriers.FormSubmissionEntity) : Promise< carriers.FormSubmissionEntity >;
|
|
35
35
|
deleteFormSubmissionEntityAsync(FormSubmissionEntityId: number) : Promise<void>;
|
|
36
|
+
createDefaultMailingEntityAsync(): Promise< carriers.MailingEntity >;
|
|
37
|
+
saveMailingEntityAsync(entity: carriers.MailingEntity) : Promise< carriers.MailingEntity >;
|
|
38
|
+
deleteMailingEntityAsync(MailingEntityId: number) : Promise<void>;
|
|
36
39
|
createDefaultShipmentMessageBlockEntityAsync(): Promise< carriers.ShipmentMessageBlockEntity >;
|
|
37
40
|
saveShipmentMessageBlockEntityAsync(entity: carriers.ShipmentMessageBlockEntity) : Promise< carriers.ShipmentMessageBlockEntity >;
|
|
38
41
|
deleteShipmentMessageBlockEntityAsync(ShipmentMessageBlockEntityId: number) : Promise<void>;
|
|
@@ -49,11 +52,22 @@ export interface IMarketingAgent {
|
|
|
49
52
|
setFontRankAsync(request: carriers.Marketing_SetFontRankRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
|
|
50
53
|
setFontRankAsync(availableFontId: number, rank: number, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
|
|
51
54
|
getFormEntityAsync(formEntityId: number) : Promise< carriers.FormEntity >;
|
|
55
|
+
moveFormsToFolderAsync(request: carriers.Marketing_MoveFormsToFolderRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
56
|
+
moveFormsToFolderAsync(formIds: number[], folderId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
52
57
|
verifyGoogleRecaptchaAsync(request: carriers.Marketing_VerifyGoogleRecaptchaRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
|
|
53
58
|
verifyGoogleRecaptchaAsync(token: string, optionalSecretKey: string, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
|
|
54
59
|
setAllFormFieldRestrictionsAsync(request: carriers.Marketing_SetAllFormFieldRestrictionsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
55
60
|
setAllFormFieldRestrictionsAsync(formFieldRestrictions: carriers.FormFieldRestriction[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
56
61
|
getFormSubmissionEntityAsync(formSubmissionEntityId: number) : Promise< carriers.FormSubmissionEntity >;
|
|
62
|
+
getMailingEntityAsync(mailingEntityId: number) : Promise< carriers.MailingEntity >;
|
|
63
|
+
moveMailingsToFolderAsync(request: carriers.Marketing_MoveMailingsToFolderRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
64
|
+
moveMailingsToFolderAsync(mailingIds: number[], folderId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
65
|
+
renameMailingByMessageIdAsync(request: carriers.Marketing_RenameMailingByMessageIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
66
|
+
renameMailingByMessageIdAsync(messageId: number, name: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
67
|
+
reloadAndSendMailingAsync(request: carriers.Marketing_ReloadAndSendMailingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
|
|
68
|
+
reloadAndSendMailingAsync(mailingId: number, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
|
|
69
|
+
stopMailingAsync(request: carriers.Marketing_StopMailingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
|
|
70
|
+
stopMailingAsync(mailingId: number, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
|
|
57
71
|
calculateMailingStatisticsAsync(request: carriers.Marketing_CalculateMailingStatisticsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
58
72
|
calculateMailingStatisticsAsync(shipmentId: number, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
59
73
|
getFormSubmissionsCountAsync(request: carriers.Marketing_GetFormSubmissionsCountRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
@@ -66,8 +80,6 @@ export interface IMarketingAgent {
|
|
|
66
80
|
getUserBlocksAsync(request: carriers.Marketing_GetUserBlocksRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ShipmentMessageBlockEntity[] >;
|
|
67
81
|
getUserBlocksAsync(associateId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ShipmentMessageBlockEntity[] >;
|
|
68
82
|
getShipmentMessageEntityAsync(shipmentMessageEntityId: number) : Promise< carriers.ShipmentMessageEntity >;
|
|
69
|
-
renameMailingByMessageIdAsync(request: carriers.Marketing_RenameMailingByMessageIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
70
|
-
renameMailingByMessageIdAsync(messageId: number, name: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
71
83
|
deleteMessageAndShipmentAsync(request: carriers.Marketing_DeleteMessageAndShipmentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
72
84
|
deleteMessageAndShipmentAsync(messageId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
73
85
|
} // interface IMarketingAgent
|
|
@@ -233,6 +245,73 @@ export class MarketingAgent extends base.WebApiBase implements IMarketingAgent {
|
|
|
233
245
|
});
|
|
234
246
|
}
|
|
235
247
|
|
|
248
|
+
/**
|
|
249
|
+
* Set default values into a new MailingEntity.
|
|
250
|
+
* NetServer calculates default values on the entity, which is required when creating/storing a new instance
|
|
251
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
252
|
+
* @returns A blank entity.
|
|
253
|
+
*/
|
|
254
|
+
public async createDefaultMailingEntityAsync(options?:base.WebApiRequestOptions) : Promise< carriers.MailingEntity > {
|
|
255
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
256
|
+
base.WebApiBase.SetPending(options);
|
|
257
|
+
return new Promise< carriers.MailingEntity >(async (resolve, reject) => {
|
|
258
|
+
try {
|
|
259
|
+
const response = await this._axios.post("CreateDefaultMailingEntity", null, config);
|
|
260
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
261
|
+
const res : carriers.MailingEntity = converters.Create_MailingEntity_From( response.data );
|
|
262
|
+
resolve(res);
|
|
263
|
+
}
|
|
264
|
+
catch( err ) {
|
|
265
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
266
|
+
reject(err);
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Replace the existing MailingEntity or creates a new MailingEntity if the id parameter is empty
|
|
272
|
+
* @param entity - The MailingEntity to be saved.
|
|
273
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
274
|
+
* @returns New or updated MailingEntity
|
|
275
|
+
*/
|
|
276
|
+
public async saveMailingEntityAsync(entity: carriers.MailingEntity, options?:base.WebApiRequestOptions) : Promise< carriers.MailingEntity > {
|
|
277
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
278
|
+
base.WebApiBase.SetPending(options);
|
|
279
|
+
return new Promise< carriers.MailingEntity >(async (resolve, reject) => {
|
|
280
|
+
try {
|
|
281
|
+
const response = await this._axios.post("SaveMailingEntity", entity, config);
|
|
282
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
283
|
+
const res : carriers.MailingEntity = converters.Create_MailingEntity_From( response.data );
|
|
284
|
+
resolve(res);
|
|
285
|
+
}
|
|
286
|
+
catch( err ) {
|
|
287
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
288
|
+
reject(err);
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Deletes the MailingEntity
|
|
295
|
+
* @param MailingEntityId - The id of the MailingEntity to be deleted.
|
|
296
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
297
|
+
*/
|
|
298
|
+
public async deleteMailingEntityAsync(MailingEntityId: number, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
299
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
300
|
+
base.WebApiBase.SetPending(options);
|
|
301
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
302
|
+
try {
|
|
303
|
+
const response = await this._axios.post("DeleteMailingEntity?MailingEntityId=" + MailingEntityId, null, config );
|
|
304
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
305
|
+
const res = response.data;
|
|
306
|
+
resolve(res);
|
|
307
|
+
}
|
|
308
|
+
catch( err ) {
|
|
309
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
310
|
+
reject(err);
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
|
|
236
315
|
/**
|
|
237
316
|
* Set default values into a new ShipmentMessageBlockEntity.
|
|
238
317
|
* NetServer calculates default values on the entity, which is required when creating/storing a new instance
|
|
@@ -637,6 +716,62 @@ export class MarketingAgent extends base.WebApiBase implements IMarketingAgent {
|
|
|
637
716
|
}
|
|
638
717
|
|
|
639
718
|
|
|
719
|
+
private async _moveFormsToFolderAsync(request: carriers.Marketing_MoveFormsToFolderRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
720
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
721
|
+
base.WebApiBase.SetPending(options);
|
|
722
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
723
|
+
try {
|
|
724
|
+
config.baseURL = this._options.baseUrl;
|
|
725
|
+
const response = await this._axios.post("MoveFormsToFolder", request , config);
|
|
726
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
727
|
+
const res = response.data;
|
|
728
|
+
resolve(res);
|
|
729
|
+
}
|
|
730
|
+
catch( err ) {
|
|
731
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
732
|
+
reject(err);
|
|
733
|
+
}
|
|
734
|
+
});
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
|
|
738
|
+
|
|
739
|
+
/**
|
|
740
|
+
* Move one or more forms into the given folder. FolderId -1 = root. Only the folder reference is written - Save would rewrite the whole form, including a re-sanitized Config, and would bump Updated (the thumbnail cache-buster).
|
|
741
|
+
* @param request - FormIds, FolderId
|
|
742
|
+
* @returns
|
|
743
|
+
*/
|
|
744
|
+
public async moveFormsToFolderAsync(request: carriers.Marketing_MoveFormsToFolderRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
745
|
+
|
|
746
|
+
/**
|
|
747
|
+
* Move one or more forms into the given folder. FolderId -1 = root. Only the folder reference is written - Save would rewrite the whole form, including a re-sanitized Config, and would bump Updated (the thumbnail cache-buster).
|
|
748
|
+
* @param formIds - Ids of the forms to move (form.form_id)
|
|
749
|
+
* @param folderId - Target folder id (s_picture_folder.id, formFolder type); -1 = root
|
|
750
|
+
* @returns
|
|
751
|
+
*/
|
|
752
|
+
public async moveFormsToFolderAsync(formIds: number[], folderId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
753
|
+
|
|
754
|
+
public async moveFormsToFolderAsync(formIds:number[]|carriers.Marketing_MoveFormsToFolderRequest, folderId?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
755
|
+
let _request : carriers.Marketing_MoveFormsToFolderRequest = null;
|
|
756
|
+
let _options : base.WebApiRequestOptions = null;
|
|
757
|
+
const first : any = formIds;
|
|
758
|
+
if( typeof( first ) === "object" && first && ( typeof(first.formIds)!='undefined' || typeof(first.folderId)!='undefined' ) )
|
|
759
|
+
{
|
|
760
|
+
_request = formIds as carriers.Marketing_MoveFormsToFolderRequest;
|
|
761
|
+
_options = folderId as base.WebApiRequestOptions;
|
|
762
|
+
}
|
|
763
|
+
else
|
|
764
|
+
{
|
|
765
|
+
_request = {
|
|
766
|
+
formIds: formIds as number[],
|
|
767
|
+
folderId: folderId as number,
|
|
768
|
+
};
|
|
769
|
+
_options = webapi_options;
|
|
770
|
+
}
|
|
771
|
+
return this._moveFormsToFolderAsync( _request, _options );
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
|
|
640
775
|
private async _verifyGoogleRecaptchaAsync(request: carriers.Marketing_VerifyGoogleRecaptchaRequest, options?:base.WebApiRequestOptions) : Promise< boolean > {
|
|
641
776
|
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
642
777
|
base.WebApiBase.SetPending(options);
|
|
@@ -769,6 +904,249 @@ export class MarketingAgent extends base.WebApiBase implements IMarketingAgent {
|
|
|
769
904
|
});
|
|
770
905
|
}
|
|
771
906
|
|
|
907
|
+
/**
|
|
908
|
+
* Gets a MailingEntity object.
|
|
909
|
+
* @param mailingEntityId - The primary key.
|
|
910
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
911
|
+
* @returns A single MailingEntity
|
|
912
|
+
*/
|
|
913
|
+
public async getMailingEntityAsync(mailingEntityId: number, options?:base.WebApiRequestOptions) : Promise< carriers.MailingEntity > {
|
|
914
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
915
|
+
base.WebApiBase.SetPending(options);
|
|
916
|
+
return new Promise< carriers.MailingEntity >(async (resolve, reject) => {
|
|
917
|
+
try {
|
|
918
|
+
const response = await this._axios.post("GetMailingEntity?mailingEntityId=" + mailingEntityId, null, config);
|
|
919
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
920
|
+
const res = converters.Create_MailingEntity_From( response.data );
|
|
921
|
+
resolve(res);
|
|
922
|
+
}
|
|
923
|
+
catch( err ) {
|
|
924
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
925
|
+
reject(err);
|
|
926
|
+
}
|
|
927
|
+
});
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
|
|
931
|
+
private async _moveMailingsToFolderAsync(request: carriers.Marketing_MoveMailingsToFolderRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
932
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
933
|
+
base.WebApiBase.SetPending(options);
|
|
934
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
935
|
+
try {
|
|
936
|
+
config.baseURL = this._options.baseUrl;
|
|
937
|
+
const response = await this._axios.post("MoveMailingsToFolder", request , config);
|
|
938
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
939
|
+
const res = response.data;
|
|
940
|
+
resolve(res);
|
|
941
|
+
}
|
|
942
|
+
catch( err ) {
|
|
943
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
944
|
+
reject(err);
|
|
945
|
+
}
|
|
946
|
+
});
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
|
|
950
|
+
|
|
951
|
+
/**
|
|
952
|
+
* Move one or more mailings (shipments) into the given folder. FolderId -1 = root.
|
|
953
|
+
* @param request - MailingIds, FolderId
|
|
954
|
+
* @returns
|
|
955
|
+
*/
|
|
956
|
+
public async moveMailingsToFolderAsync(request: carriers.Marketing_MoveMailingsToFolderRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
957
|
+
|
|
958
|
+
/**
|
|
959
|
+
* Move one or more mailings (shipments) into the given folder. FolderId -1 = root.
|
|
960
|
+
* @param mailingIds - Shipment ids of the mailings to move (s_shipment.id)
|
|
961
|
+
* @param folderId - Target folder id (s_picture_folder.id, shipmentFolder type); -1 = root
|
|
962
|
+
* @returns
|
|
963
|
+
*/
|
|
964
|
+
public async moveMailingsToFolderAsync(mailingIds: number[], folderId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
965
|
+
|
|
966
|
+
public async moveMailingsToFolderAsync(mailingIds:number[]|carriers.Marketing_MoveMailingsToFolderRequest, folderId?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
967
|
+
let _request : carriers.Marketing_MoveMailingsToFolderRequest = null;
|
|
968
|
+
let _options : base.WebApiRequestOptions = null;
|
|
969
|
+
const first : any = mailingIds;
|
|
970
|
+
if( typeof( first ) === "object" && first && ( typeof(first.mailingIds)!='undefined' || typeof(first.folderId)!='undefined' ) )
|
|
971
|
+
{
|
|
972
|
+
_request = mailingIds as carriers.Marketing_MoveMailingsToFolderRequest;
|
|
973
|
+
_options = folderId as base.WebApiRequestOptions;
|
|
974
|
+
}
|
|
975
|
+
else
|
|
976
|
+
{
|
|
977
|
+
_request = {
|
|
978
|
+
mailingIds: mailingIds as number[],
|
|
979
|
+
folderId: folderId as number,
|
|
980
|
+
};
|
|
981
|
+
_options = webapi_options;
|
|
982
|
+
}
|
|
983
|
+
return this._moveMailingsToFolderAsync( _request, _options );
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
|
|
987
|
+
private async _renameMailingByMessageIdAsync(request: carriers.Marketing_RenameMailingByMessageIdRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
988
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
989
|
+
base.WebApiBase.SetPending(options);
|
|
990
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
991
|
+
try {
|
|
992
|
+
config.baseURL = this._options.baseUrl;
|
|
993
|
+
const response = await this._axios.post("RenameMailingByMessageId", request , config);
|
|
994
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
995
|
+
const res = response.data;
|
|
996
|
+
resolve(res);
|
|
997
|
+
}
|
|
998
|
+
catch( err ) {
|
|
999
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1000
|
+
reject(err);
|
|
1001
|
+
}
|
|
1002
|
+
});
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
|
|
1006
|
+
|
|
1007
|
+
/**
|
|
1008
|
+
* Change the mailing name (shipment description) that the given message (MessageId) belongs to
|
|
1009
|
+
* @param request - MessageId, Name
|
|
1010
|
+
* @returns
|
|
1011
|
+
*/
|
|
1012
|
+
public async renameMailingByMessageIdAsync(request: carriers.Marketing_RenameMailingByMessageIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1013
|
+
|
|
1014
|
+
/**
|
|
1015
|
+
* Change the mailing name (shipment description) that the given message (MessageId) belongs to
|
|
1016
|
+
* @param messageId - Message id
|
|
1017
|
+
* @param name - The new name
|
|
1018
|
+
* @returns
|
|
1019
|
+
*/
|
|
1020
|
+
public async renameMailingByMessageIdAsync(messageId: number, name: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1021
|
+
|
|
1022
|
+
public async renameMailingByMessageIdAsync(messageId:number|carriers.Marketing_RenameMailingByMessageIdRequest, name?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1023
|
+
let _request : carriers.Marketing_RenameMailingByMessageIdRequest = null;
|
|
1024
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1025
|
+
const first : any = messageId;
|
|
1026
|
+
if( typeof( first ) === "object" && first && ( typeof(first.messageId)!='undefined' || typeof(first.name)!='undefined' ) )
|
|
1027
|
+
{
|
|
1028
|
+
_request = messageId as carriers.Marketing_RenameMailingByMessageIdRequest;
|
|
1029
|
+
_options = name as base.WebApiRequestOptions;
|
|
1030
|
+
}
|
|
1031
|
+
else
|
|
1032
|
+
{
|
|
1033
|
+
_request = {
|
|
1034
|
+
messageId: messageId as number,
|
|
1035
|
+
name: name as string,
|
|
1036
|
+
};
|
|
1037
|
+
_options = webapi_options;
|
|
1038
|
+
}
|
|
1039
|
+
return this._renameMailingByMessageIdAsync( _request, _options );
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
|
|
1043
|
+
private async _reloadAndSendMailingAsync(request: carriers.Marketing_ReloadAndSendMailingRequest, options?:base.WebApiRequestOptions) : Promise< boolean > {
|
|
1044
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1045
|
+
base.WebApiBase.SetPending(options);
|
|
1046
|
+
return new Promise< boolean >(async (resolve, reject) => {
|
|
1047
|
+
try {
|
|
1048
|
+
config.baseURL = this._options.baseUrl;
|
|
1049
|
+
const response = await this._axios.post("ReloadAndSendMailing", request , config);
|
|
1050
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1051
|
+
const res : boolean = response.data as boolean;
|
|
1052
|
+
resolve(res);
|
|
1053
|
+
}
|
|
1054
|
+
catch( err ) {
|
|
1055
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1056
|
+
reject(err);
|
|
1057
|
+
}
|
|
1058
|
+
});
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
|
|
1062
|
+
|
|
1063
|
+
/**
|
|
1064
|
+
* Reload and send a mailing
|
|
1065
|
+
* @param request - MailingId
|
|
1066
|
+
* @returns Did the operation succeed?
|
|
1067
|
+
*/
|
|
1068
|
+
public async reloadAndSendMailingAsync(request: carriers.Marketing_ReloadAndSendMailingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
|
|
1069
|
+
|
|
1070
|
+
/**
|
|
1071
|
+
* Reload and send a mailing
|
|
1072
|
+
* @param mailingId - Mailing id
|
|
1073
|
+
* @returns Did the operation succeed?
|
|
1074
|
+
*/
|
|
1075
|
+
public async reloadAndSendMailingAsync(mailingId: number, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
|
|
1076
|
+
|
|
1077
|
+
public async reloadAndSendMailingAsync(mailingId:number|carriers.Marketing_ReloadAndSendMailingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean > {
|
|
1078
|
+
let _request : carriers.Marketing_ReloadAndSendMailingRequest = null;
|
|
1079
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1080
|
+
const first : any = mailingId;
|
|
1081
|
+
if( typeof( first ) === "object" && first && ( typeof(first.mailingId)!='undefined' ) )
|
|
1082
|
+
{
|
|
1083
|
+
_request = mailingId as carriers.Marketing_ReloadAndSendMailingRequest;
|
|
1084
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
1085
|
+
}
|
|
1086
|
+
else
|
|
1087
|
+
{
|
|
1088
|
+
_request = {
|
|
1089
|
+
mailingId: mailingId as number,
|
|
1090
|
+
};
|
|
1091
|
+
_options = webapi_options;
|
|
1092
|
+
}
|
|
1093
|
+
return this._reloadAndSendMailingAsync( _request, _options );
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
|
|
1097
|
+
private async _stopMailingAsync(request: carriers.Marketing_StopMailingRequest, options?:base.WebApiRequestOptions) : Promise< boolean > {
|
|
1098
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1099
|
+
base.WebApiBase.SetPending(options);
|
|
1100
|
+
return new Promise< boolean >(async (resolve, reject) => {
|
|
1101
|
+
try {
|
|
1102
|
+
config.baseURL = this._options.baseUrl;
|
|
1103
|
+
const response = await this._axios.post("StopMailing", request , config);
|
|
1104
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1105
|
+
const res : boolean = response.data as boolean;
|
|
1106
|
+
resolve(res);
|
|
1107
|
+
}
|
|
1108
|
+
catch( err ) {
|
|
1109
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1110
|
+
reject(err);
|
|
1111
|
+
}
|
|
1112
|
+
});
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
|
|
1116
|
+
|
|
1117
|
+
/**
|
|
1118
|
+
* Stop a mailing that is queued or currently sending, leaving it in status Canceled
|
|
1119
|
+
* @param request - MailingId
|
|
1120
|
+
* @returns Did the operation succeed?
|
|
1121
|
+
*/
|
|
1122
|
+
public async stopMailingAsync(request: carriers.Marketing_StopMailingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
|
|
1123
|
+
|
|
1124
|
+
/**
|
|
1125
|
+
* Stop a mailing that is queued or currently sending, leaving it in status Canceled
|
|
1126
|
+
* @param mailingId - Mailing id
|
|
1127
|
+
* @returns Did the operation succeed?
|
|
1128
|
+
*/
|
|
1129
|
+
public async stopMailingAsync(mailingId: number, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
|
|
1130
|
+
|
|
1131
|
+
public async stopMailingAsync(mailingId:number|carriers.Marketing_StopMailingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean > {
|
|
1132
|
+
let _request : carriers.Marketing_StopMailingRequest = null;
|
|
1133
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1134
|
+
const first : any = mailingId;
|
|
1135
|
+
if( typeof( first ) === "object" && first && ( typeof(first.mailingId)!='undefined' ) )
|
|
1136
|
+
{
|
|
1137
|
+
_request = mailingId as carriers.Marketing_StopMailingRequest;
|
|
1138
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
1139
|
+
}
|
|
1140
|
+
else
|
|
1141
|
+
{
|
|
1142
|
+
_request = {
|
|
1143
|
+
mailingId: mailingId as number,
|
|
1144
|
+
};
|
|
1145
|
+
_options = webapi_options;
|
|
1146
|
+
}
|
|
1147
|
+
return this._stopMailingAsync( _request, _options );
|
|
1148
|
+
}
|
|
1149
|
+
|
|
772
1150
|
|
|
773
1151
|
private async _calculateMailingStatisticsAsync(request: carriers.Marketing_CalculateMailingStatisticsRequest, options?:base.WebApiRequestOptions) : Promise< number > {
|
|
774
1152
|
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
@@ -1088,62 +1466,6 @@ export class MarketingAgent extends base.WebApiBase implements IMarketingAgent {
|
|
|
1088
1466
|
}
|
|
1089
1467
|
|
|
1090
1468
|
|
|
1091
|
-
private async _renameMailingByMessageIdAsync(request: carriers.Marketing_RenameMailingByMessageIdRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1092
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1093
|
-
base.WebApiBase.SetPending(options);
|
|
1094
|
-
return new Promise< void >(async (resolve, reject) => {
|
|
1095
|
-
try {
|
|
1096
|
-
config.baseURL = this._options.baseUrl;
|
|
1097
|
-
const response = await this._axios.post("RenameMailingByMessageId", request , config);
|
|
1098
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
1099
|
-
const res = response.data;
|
|
1100
|
-
resolve(res);
|
|
1101
|
-
}
|
|
1102
|
-
catch( err ) {
|
|
1103
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
1104
|
-
reject(err);
|
|
1105
|
-
}
|
|
1106
|
-
});
|
|
1107
|
-
}
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
/**
|
|
1112
|
-
* Change the mailing name (shipment description) that the given message (MessageId) belongs to
|
|
1113
|
-
* @param request - MessageId, Name
|
|
1114
|
-
* @returns
|
|
1115
|
-
*/
|
|
1116
|
-
public async renameMailingByMessageIdAsync(request: carriers.Marketing_RenameMailingByMessageIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1117
|
-
|
|
1118
|
-
/**
|
|
1119
|
-
* Change the mailing name (shipment description) that the given message (MessageId) belongs to
|
|
1120
|
-
* @param messageId - Message id
|
|
1121
|
-
* @param name - The new name
|
|
1122
|
-
* @returns
|
|
1123
|
-
*/
|
|
1124
|
-
public async renameMailingByMessageIdAsync(messageId: number, name: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1125
|
-
|
|
1126
|
-
public async renameMailingByMessageIdAsync(messageId:number|carriers.Marketing_RenameMailingByMessageIdRequest, name?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1127
|
-
let _request : carriers.Marketing_RenameMailingByMessageIdRequest = null;
|
|
1128
|
-
let _options : base.WebApiRequestOptions = null;
|
|
1129
|
-
const first : any = messageId;
|
|
1130
|
-
if( typeof( first ) === "object" && first && ( typeof(first.messageId)!='undefined' || typeof(first.name)!='undefined' ) )
|
|
1131
|
-
{
|
|
1132
|
-
_request = messageId as carriers.Marketing_RenameMailingByMessageIdRequest;
|
|
1133
|
-
_options = name as base.WebApiRequestOptions;
|
|
1134
|
-
}
|
|
1135
|
-
else
|
|
1136
|
-
{
|
|
1137
|
-
_request = {
|
|
1138
|
-
messageId: messageId as number,
|
|
1139
|
-
name: name as string,
|
|
1140
|
-
};
|
|
1141
|
-
_options = webapi_options;
|
|
1142
|
-
}
|
|
1143
|
-
return this._renameMailingByMessageIdAsync( _request, _options );
|
|
1144
|
-
}
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
1469
|
private async _deleteMessageAndShipmentAsync(request: carriers.Marketing_DeleteMessageAndShipmentRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
1148
1470
|
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1149
1471
|
base.WebApiBase.SetPending(options);
|
|
@@ -1698,14 +1698,14 @@ export class UserDefinedFieldInfoAgent extends base.WebApiBase implements IUserD
|
|
|
1698
1698
|
|
|
1699
1699
|
|
|
1700
1700
|
/**
|
|
1701
|
-
*
|
|
1701
|
+
* No-op, retained for API compatibility. Publish and Revert manage the publish lock themselves; there is nothing to start ahead of time, and calling this is harmless but unnecessary.
|
|
1702
1702
|
* @param request - OwnerType
|
|
1703
1703
|
* @returns
|
|
1704
1704
|
*/
|
|
1705
1705
|
public async setPublishStartSystemEventAsync(request: carriers.UserDefinedFieldInfo_SetPublishStartSystemEventRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
1706
1706
|
|
|
1707
1707
|
/**
|
|
1708
|
-
*
|
|
1708
|
+
* No-op, retained for API compatibility. Publish and Revert manage the publish lock themselves; there is nothing to start ahead of time, and calling this is harmless but unnecessary.
|
|
1709
1709
|
* @param ownerType - The user-defined field owner-entity.
|
|
1710
1710
|
* @returns
|
|
1711
1711
|
*/
|
package/src/ViewStateAgent.ts
CHANGED
|
@@ -53,8 +53,12 @@ export interface IViewStateAgent {
|
|
|
53
53
|
saveCurrentsAsync(currents: carriers.History[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
54
54
|
getHistoriesByNamesAndIdsAsync(request: carriers.ViewState_GetHistoriesByNamesAndIdsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
55
55
|
getHistoriesByNamesAndIdsAsync(requests: carriers.HistoryRequest[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.History[] >;
|
|
56
|
+
upsertRecentNavigationAsync(request: carriers.ViewState_UpsertRecentNavigationRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
57
|
+
upsertRecentNavigationAsync(client: string, elements: carriers.NavigationElement[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
56
58
|
publishAndRetrieveUiEventsAsync(request: carriers.ViewState_PublishAndRetrieveUiEventsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UiEvent[] >;
|
|
57
59
|
publishAndRetrieveUiEventsAsync(latestKnownEventId: number, publishEvents: carriers.UiEvent[], metrics: carriers.MetricPair[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.UiEvent[] >;
|
|
60
|
+
publishAndSyncUiEventsAsync(request: carriers.ViewState_PublishAndSyncUiEventsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LiveUiSyncResult >;
|
|
61
|
+
publishAndSyncUiEventsAsync(latestKnownEventId: number, publishEvents: carriers.UiEvent[], metrics: carriers.MetricPair[], ticketVersions: carriers.TicketVersionInfo[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LiveUiSyncResult >;
|
|
58
62
|
} // interface IViewStateAgent
|
|
59
63
|
|
|
60
64
|
|
|
@@ -796,6 +800,62 @@ export class ViewStateAgent extends base.WebApiBase implements IViewStateAgent {
|
|
|
796
800
|
}
|
|
797
801
|
|
|
798
802
|
|
|
803
|
+
private async _upsertRecentNavigationAsync(request: carriers.ViewState_UpsertRecentNavigationRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
804
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
805
|
+
base.WebApiBase.SetPending(options);
|
|
806
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
807
|
+
try {
|
|
808
|
+
config.baseURL = this._options.baseUrl;
|
|
809
|
+
const response = await this._axios.post("UpsertRecentNavigation", request , config);
|
|
810
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
811
|
+
const res = response.data;
|
|
812
|
+
resolve(res);
|
|
813
|
+
}
|
|
814
|
+
catch( err ) {
|
|
815
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
816
|
+
reject(err);
|
|
817
|
+
}
|
|
818
|
+
});
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
|
|
822
|
+
|
|
823
|
+
/**
|
|
824
|
+
* Upsert Recent navigation entries for the logged-in associate and the given client. The entries are ranked so that the first element in the array becomes the most recent. The list is capped by the RecentNavigationLimit preference; the oldest entries beyond the cap are removed.
|
|
825
|
+
* @param request - Client, Elements
|
|
826
|
+
* @returns This method has no return value
|
|
827
|
+
*/
|
|
828
|
+
public async upsertRecentNavigationAsync(request: carriers.ViewState_UpsertRecentNavigationRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
829
|
+
|
|
830
|
+
/**
|
|
831
|
+
* Upsert Recent navigation entries for the logged-in associate and the given client. The entries are ranked so that the first element in the array becomes the most recent. The list is capped by the RecentNavigationLimit preference; the oldest entries beyond the cap are removed.
|
|
832
|
+
* @param client - The client the entries belong to, e.g. Crm, Admin or Mobile
|
|
833
|
+
* @param elements - The navigation entries to upsert. The first element becomes the most recent; duplicate keys are collapsed keeping the first occurrence.
|
|
834
|
+
* @returns This method has no return value
|
|
835
|
+
*/
|
|
836
|
+
public async upsertRecentNavigationAsync(client: string, elements: carriers.NavigationElement[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
837
|
+
|
|
838
|
+
public async upsertRecentNavigationAsync(client:string|carriers.ViewState_UpsertRecentNavigationRequest, elements?:carriers.NavigationElement[]|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
839
|
+
let _request : carriers.ViewState_UpsertRecentNavigationRequest = null;
|
|
840
|
+
let _options : base.WebApiRequestOptions = null;
|
|
841
|
+
const first : any = client;
|
|
842
|
+
if( typeof( first ) === "object" && first && ( typeof(first.client)!='undefined' || typeof(first.elements)!='undefined' ) )
|
|
843
|
+
{
|
|
844
|
+
_request = client as carriers.ViewState_UpsertRecentNavigationRequest;
|
|
845
|
+
_options = elements as base.WebApiRequestOptions;
|
|
846
|
+
}
|
|
847
|
+
else
|
|
848
|
+
{
|
|
849
|
+
_request = {
|
|
850
|
+
client: client as string,
|
|
851
|
+
elements: elements as carriers.NavigationElement[],
|
|
852
|
+
};
|
|
853
|
+
_options = webapi_options;
|
|
854
|
+
}
|
|
855
|
+
return this._upsertRecentNavigationAsync( _request, _options );
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
|
|
799
859
|
private async _publishAndRetrieveUiEventsAsync(request: carriers.ViewState_PublishAndRetrieveUiEventsRequest, options?:base.WebApiRequestOptions) : Promise< carriers.UiEvent[] > {
|
|
800
860
|
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
801
861
|
base.WebApiBase.SetPending(options);
|
|
@@ -853,6 +913,66 @@ export class ViewStateAgent extends base.WebApiBase implements IViewStateAgent {
|
|
|
853
913
|
return this._publishAndRetrieveUiEventsAsync( _request, _options );
|
|
854
914
|
}
|
|
855
915
|
|
|
916
|
+
|
|
917
|
+
private async _publishAndSyncUiEventsAsync(request: carriers.ViewState_PublishAndSyncUiEventsRequest, options?:base.WebApiRequestOptions) : Promise< carriers.LiveUiSyncResult > {
|
|
918
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
919
|
+
base.WebApiBase.SetPending(options);
|
|
920
|
+
return new Promise< carriers.LiveUiSyncResult >(async (resolve, reject) => {
|
|
921
|
+
try {
|
|
922
|
+
config.baseURL = this._options.baseUrl;
|
|
923
|
+
const response = await this._axios.post("PublishAndSyncUiEvents", request , config);
|
|
924
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
925
|
+
const res : carriers.LiveUiSyncResult = converters.Create_LiveUiSyncResult_From( response.data );
|
|
926
|
+
resolve(res);
|
|
927
|
+
}
|
|
928
|
+
catch( err ) {
|
|
929
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
930
|
+
reject(err);
|
|
931
|
+
}
|
|
932
|
+
});
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
|
|
936
|
+
|
|
937
|
+
/**
|
|
938
|
+
* Publish zero or more events and return any new events since the given event id, exactly like PublishAndRetrieveUiEvents — and additionally answer, for each ticket version the client supplies, whether that ticket has changed since (and by whom). Requested tickets the user cannot see are omitted from the answer
|
|
939
|
+
* @param request - LatestKnownEventId, PublishEvents, Metrics, TicketVersions
|
|
940
|
+
* @returns New events since the given event id, plus the sync state of the requested tickets
|
|
941
|
+
*/
|
|
942
|
+
public async publishAndSyncUiEventsAsync(request: carriers.ViewState_PublishAndSyncUiEventsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LiveUiSyncResult >;
|
|
943
|
+
|
|
944
|
+
/**
|
|
945
|
+
* Publish zero or more events and return any new events since the given event id, exactly like PublishAndRetrieveUiEvents — and additionally answer, for each ticket version the client supplies, whether that ticket has changed since (and by whom). Requested tickets the user cannot see are omitted from the answer
|
|
946
|
+
* @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
|
|
947
|
+
* @param publishEvents - Array of events to publish. This can be empty if the client only wants to retrieve information
|
|
948
|
+
* @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
|
|
949
|
+
* @param ticketVersions - The tickets the client is showing, each with the last-changed value of the client's loaded copy (DateTime.MinValue or omitted = no copy; the current value is then returned without a staleness verdict). At most 500 entries after removing duplicates
|
|
950
|
+
* @returns New events since the given event id, plus the sync state of the requested tickets
|
|
951
|
+
*/
|
|
952
|
+
public async publishAndSyncUiEventsAsync(latestKnownEventId: number, publishEvents: carriers.UiEvent[], metrics: carriers.MetricPair[], ticketVersions: carriers.TicketVersionInfo[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LiveUiSyncResult >;
|
|
953
|
+
|
|
954
|
+
public async publishAndSyncUiEventsAsync(latestKnownEventId:number|carriers.ViewState_PublishAndSyncUiEventsRequest, publishEvents?:carriers.UiEvent[]|base.WebApiRequestOptions, metrics?:carriers.MetricPair[], ticketVersions?:carriers.TicketVersionInfo[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.LiveUiSyncResult > {
|
|
955
|
+
let _request : carriers.ViewState_PublishAndSyncUiEventsRequest = null;
|
|
956
|
+
let _options : base.WebApiRequestOptions = null;
|
|
957
|
+
const first : any = latestKnownEventId;
|
|
958
|
+
if( typeof( first ) === "object" && first && ( typeof(first.latestKnownEventId)!='undefined' || typeof(first.publishEvents)!='undefined' || typeof(first.metrics)!='undefined' || typeof(first.ticketVersions)!='undefined' ) )
|
|
959
|
+
{
|
|
960
|
+
_request = latestKnownEventId as carriers.ViewState_PublishAndSyncUiEventsRequest;
|
|
961
|
+
_options = publishEvents as base.WebApiRequestOptions;
|
|
962
|
+
}
|
|
963
|
+
else
|
|
964
|
+
{
|
|
965
|
+
_request = {
|
|
966
|
+
latestKnownEventId: latestKnownEventId as number,
|
|
967
|
+
publishEvents: publishEvents as carriers.UiEvent[],
|
|
968
|
+
metrics: metrics as carriers.MetricPair[],
|
|
969
|
+
ticketVersions: ticketVersions as carriers.TicketVersionInfo[],
|
|
970
|
+
};
|
|
971
|
+
_options = webapi_options;
|
|
972
|
+
}
|
|
973
|
+
return this._publishAndSyncUiEventsAsync( _request, _options );
|
|
974
|
+
}
|
|
975
|
+
|
|
856
976
|
} // class v1ViewStateAgentController
|
|
857
977
|
|
|
858
978
|
|