@superoffice/webapi 10.5.4 → 10.5.5

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.
Files changed (198) hide show
  1. package/dist/cjs/AIAgent.d.ts +16 -0
  2. package/dist/cjs/AIAgent.d.ts.map +1 -1
  3. package/dist/cjs/AIAgent.js +34 -0
  4. package/dist/cjs/AIAgent.js.map +1 -1
  5. package/dist/cjs/AppointmentAgent.d.ts +117 -0
  6. package/dist/cjs/AppointmentAgent.d.ts.map +1 -1
  7. package/dist/cjs/AppointmentAgent.js +242 -0
  8. package/dist/cjs/AppointmentAgent.js.map +1 -1
  9. package/dist/cjs/CRMScriptAgent.d.ts +31 -0
  10. package/dist/cjs/CRMScriptAgent.d.ts.map +1 -1
  11. package/dist/cjs/CRMScriptAgent.js +67 -0
  12. package/dist/cjs/CRMScriptAgent.js.map +1 -1
  13. package/dist/cjs/Carriers.d.ts +1289 -31
  14. package/dist/cjs/Carriers.d.ts.map +1 -1
  15. package/dist/cjs/Converters.d.ts +30 -0
  16. package/dist/cjs/Converters.d.ts.map +1 -1
  17. package/dist/cjs/Converters.js +635 -30
  18. package/dist/cjs/Converters.js.map +1 -1
  19. package/dist/cjs/CustomerServiceAgent.d.ts +30 -0
  20. package/dist/cjs/CustomerServiceAgent.d.ts.map +1 -1
  21. package/dist/cjs/CustomerServiceAgent.js +66 -0
  22. package/dist/cjs/CustomerServiceAgent.js.map +1 -1
  23. package/dist/cjs/DiagnosticsAgent.d.ts +105 -0
  24. package/dist/cjs/DiagnosticsAgent.d.ts.map +1 -1
  25. package/dist/cjs/DiagnosticsAgent.js +229 -0
  26. package/dist/cjs/DiagnosticsAgent.js.map +1 -1
  27. package/dist/cjs/DocumentAgent.d.ts +17 -0
  28. package/dist/cjs/DocumentAgent.d.ts.map +1 -1
  29. package/dist/cjs/DocumentAgent.js +36 -0
  30. package/dist/cjs/DocumentAgent.js.map +1 -1
  31. package/dist/cjs/DocumentMigrationAgent.d.ts +7 -0
  32. package/dist/cjs/DocumentMigrationAgent.d.ts.map +1 -1
  33. package/dist/cjs/DocumentMigrationAgent.js +24 -0
  34. package/dist/cjs/DocumentMigrationAgent.js.map +1 -1
  35. package/dist/cjs/EMailAgent.d.ts +33 -0
  36. package/dist/cjs/EMailAgent.d.ts.map +1 -1
  37. package/dist/cjs/EMailAgent.js +69 -0
  38. package/dist/cjs/EMailAgent.js.map +1 -1
  39. package/dist/cjs/Enums.d.ts +299 -5
  40. package/dist/cjs/Enums.d.ts.map +1 -1
  41. package/dist/cjs/Enums.js +309 -4
  42. package/dist/cjs/Enums.js.map +1 -1
  43. package/dist/cjs/LicenseAgent.d.ts +15 -0
  44. package/dist/cjs/LicenseAgent.d.ts.map +1 -1
  45. package/dist/cjs/LicenseAgent.js +33 -0
  46. package/dist/cjs/LicenseAgent.js.map +1 -1
  47. package/dist/cjs/ListAgent.d.ts +23 -22
  48. package/dist/cjs/ListAgent.d.ts.map +1 -1
  49. package/dist/cjs/ListAgent.js +36 -48
  50. package/dist/cjs/ListAgent.js.map +1 -1
  51. package/dist/cjs/MDOAgent.d.ts +1 -1
  52. package/dist/cjs/MarketingAgent.d.ts +31 -0
  53. package/dist/cjs/MarketingAgent.d.ts.map +1 -1
  54. package/dist/cjs/MarketingAgent.js +67 -0
  55. package/dist/cjs/MarketingAgent.js.map +1 -1
  56. package/dist/cjs/PersonAgent.d.ts +35 -0
  57. package/dist/cjs/PersonAgent.d.ts.map +1 -1
  58. package/dist/cjs/PersonAgent.js +71 -0
  59. package/dist/cjs/PersonAgent.js.map +1 -1
  60. package/dist/cjs/ProjectAgent.d.ts +16 -0
  61. package/dist/cjs/ProjectAgent.d.ts.map +1 -1
  62. package/dist/cjs/ProjectAgent.js +34 -0
  63. package/dist/cjs/ProjectAgent.js.map +1 -1
  64. package/dist/cjs/QuoteAgent.d.ts +16 -0
  65. package/dist/cjs/QuoteAgent.d.ts.map +1 -1
  66. package/dist/cjs/QuoteAgent.js +34 -0
  67. package/dist/cjs/QuoteAgent.js.map +1 -1
  68. package/dist/cjs/SaleAgent.d.ts +47 -0
  69. package/dist/cjs/SaleAgent.d.ts.map +1 -1
  70. package/dist/cjs/SaleAgent.js +101 -0
  71. package/dist/cjs/SaleAgent.js.map +1 -1
  72. package/dist/cjs/SelectionAgent.d.ts +15 -7
  73. package/dist/cjs/SelectionAgent.d.ts.map +1 -1
  74. package/dist/cjs/SelectionAgent.js +33 -21
  75. package/dist/cjs/SelectionAgent.js.map +1 -1
  76. package/dist/cjs/SentryAgent.d.ts +15 -0
  77. package/dist/cjs/SentryAgent.d.ts.map +1 -1
  78. package/dist/cjs/SentryAgent.js +33 -0
  79. package/dist/cjs/SentryAgent.js.map +1 -1
  80. package/dist/cjs/TicketAgent.d.ts +117 -2
  81. package/dist/cjs/TicketAgent.d.ts.map +1 -1
  82. package/dist/cjs/TicketAgent.js +255 -0
  83. package/dist/cjs/TicketAgent.js.map +1 -1
  84. package/dist/cjs/WorkflowAgent.d.ts +80 -2
  85. package/dist/cjs/WorkflowAgent.d.ts.map +1 -1
  86. package/dist/cjs/WorkflowAgent.js +188 -0
  87. package/dist/cjs/WorkflowAgent.js.map +1 -1
  88. package/dist/esm/AIAgent.d.ts +16 -0
  89. package/dist/esm/AIAgent.d.ts.map +1 -1
  90. package/dist/esm/AIAgent.js +34 -0
  91. package/dist/esm/AIAgent.js.map +1 -1
  92. package/dist/esm/AppointmentAgent.d.ts +117 -0
  93. package/dist/esm/AppointmentAgent.d.ts.map +1 -1
  94. package/dist/esm/AppointmentAgent.js +242 -0
  95. package/dist/esm/AppointmentAgent.js.map +1 -1
  96. package/dist/esm/CRMScriptAgent.d.ts +31 -0
  97. package/dist/esm/CRMScriptAgent.d.ts.map +1 -1
  98. package/dist/esm/CRMScriptAgent.js +67 -0
  99. package/dist/esm/CRMScriptAgent.js.map +1 -1
  100. package/dist/esm/Carriers.d.ts +1289 -31
  101. package/dist/esm/Carriers.d.ts.map +1 -1
  102. package/dist/esm/Converters.d.ts +30 -0
  103. package/dist/esm/Converters.d.ts.map +1 -1
  104. package/dist/esm/Converters.js +582 -8
  105. package/dist/esm/Converters.js.map +1 -1
  106. package/dist/esm/CustomerServiceAgent.d.ts +30 -0
  107. package/dist/esm/CustomerServiceAgent.d.ts.map +1 -1
  108. package/dist/esm/CustomerServiceAgent.js +66 -0
  109. package/dist/esm/CustomerServiceAgent.js.map +1 -1
  110. package/dist/esm/DiagnosticsAgent.d.ts +105 -0
  111. package/dist/esm/DiagnosticsAgent.d.ts.map +1 -1
  112. package/dist/esm/DiagnosticsAgent.js +229 -0
  113. package/dist/esm/DiagnosticsAgent.js.map +1 -1
  114. package/dist/esm/DocumentAgent.d.ts +17 -0
  115. package/dist/esm/DocumentAgent.d.ts.map +1 -1
  116. package/dist/esm/DocumentAgent.js +36 -0
  117. package/dist/esm/DocumentAgent.js.map +1 -1
  118. package/dist/esm/DocumentMigrationAgent.d.ts +7 -0
  119. package/dist/esm/DocumentMigrationAgent.d.ts.map +1 -1
  120. package/dist/esm/DocumentMigrationAgent.js +24 -0
  121. package/dist/esm/DocumentMigrationAgent.js.map +1 -1
  122. package/dist/esm/EMailAgent.d.ts +33 -0
  123. package/dist/esm/EMailAgent.d.ts.map +1 -1
  124. package/dist/esm/EMailAgent.js +69 -0
  125. package/dist/esm/EMailAgent.js.map +1 -1
  126. package/dist/esm/Enums.d.ts +299 -5
  127. package/dist/esm/Enums.d.ts.map +1 -1
  128. package/dist/esm/Enums.js +305 -0
  129. package/dist/esm/Enums.js.map +1 -1
  130. package/dist/esm/LicenseAgent.d.ts +15 -0
  131. package/dist/esm/LicenseAgent.d.ts.map +1 -1
  132. package/dist/esm/LicenseAgent.js +33 -0
  133. package/dist/esm/LicenseAgent.js.map +1 -1
  134. package/dist/esm/ListAgent.d.ts +23 -22
  135. package/dist/esm/ListAgent.d.ts.map +1 -1
  136. package/dist/esm/ListAgent.js +36 -48
  137. package/dist/esm/ListAgent.js.map +1 -1
  138. package/dist/esm/MDOAgent.d.ts +1 -1
  139. package/dist/esm/MarketingAgent.d.ts +31 -0
  140. package/dist/esm/MarketingAgent.d.ts.map +1 -1
  141. package/dist/esm/MarketingAgent.js +67 -0
  142. package/dist/esm/MarketingAgent.js.map +1 -1
  143. package/dist/esm/PersonAgent.d.ts +35 -0
  144. package/dist/esm/PersonAgent.d.ts.map +1 -1
  145. package/dist/esm/PersonAgent.js +71 -0
  146. package/dist/esm/PersonAgent.js.map +1 -1
  147. package/dist/esm/ProjectAgent.d.ts +16 -0
  148. package/dist/esm/ProjectAgent.d.ts.map +1 -1
  149. package/dist/esm/ProjectAgent.js +34 -0
  150. package/dist/esm/ProjectAgent.js.map +1 -1
  151. package/dist/esm/QuoteAgent.d.ts +16 -0
  152. package/dist/esm/QuoteAgent.d.ts.map +1 -1
  153. package/dist/esm/QuoteAgent.js +34 -0
  154. package/dist/esm/QuoteAgent.js.map +1 -1
  155. package/dist/esm/SaleAgent.d.ts +47 -0
  156. package/dist/esm/SaleAgent.d.ts.map +1 -1
  157. package/dist/esm/SaleAgent.js +101 -0
  158. package/dist/esm/SaleAgent.js.map +1 -1
  159. package/dist/esm/SelectionAgent.d.ts +15 -7
  160. package/dist/esm/SelectionAgent.d.ts.map +1 -1
  161. package/dist/esm/SelectionAgent.js +33 -21
  162. package/dist/esm/SelectionAgent.js.map +1 -1
  163. package/dist/esm/SentryAgent.d.ts +15 -0
  164. package/dist/esm/SentryAgent.d.ts.map +1 -1
  165. package/dist/esm/SentryAgent.js +33 -0
  166. package/dist/esm/SentryAgent.js.map +1 -1
  167. package/dist/esm/TicketAgent.d.ts +117 -2
  168. package/dist/esm/TicketAgent.d.ts.map +1 -1
  169. package/dist/esm/TicketAgent.js +255 -0
  170. package/dist/esm/TicketAgent.js.map +1 -1
  171. package/dist/esm/WorkflowAgent.d.ts +80 -2
  172. package/dist/esm/WorkflowAgent.d.ts.map +1 -1
  173. package/dist/esm/WorkflowAgent.js +188 -0
  174. package/dist/esm/WorkflowAgent.js.map +1 -1
  175. package/package.json +5 -6
  176. package/src/AIAgent.ts +58 -0
  177. package/src/AppointmentAgent.ts +406 -0
  178. package/src/CRMScriptAgent.ts +114 -0
  179. package/src/Carriers.ts +1667 -34
  180. package/src/Converters.ts +677 -9
  181. package/src/CustomerServiceAgent.ts +112 -0
  182. package/src/DiagnosticsAgent.ts +380 -0
  183. package/src/DocumentAgent.ts +61 -0
  184. package/src/DocumentMigrationAgent.ts +30 -0
  185. package/src/EMailAgent.ts +118 -0
  186. package/src/Enums.ts +316 -0
  187. package/src/LicenseAgent.ts +56 -0
  188. package/src/ListAgent.ts +69 -65
  189. package/src/MDOAgent.ts +1 -1
  190. package/src/MarketingAgent.ts +114 -0
  191. package/src/PersonAgent.ts +122 -0
  192. package/src/ProjectAgent.ts +58 -0
  193. package/src/QuoteAgent.ts +58 -0
  194. package/src/SaleAgent.ts +172 -0
  195. package/src/SelectionAgent.ts +56 -23
  196. package/src/SentryAgent.ts +56 -0
  197. package/src/TicketAgent.ts +432 -2
  198. package/src/WorkflowAgent.ts +268 -2
@@ -91,12 +91,20 @@ export interface ITicketAgent {
91
91
  clearNotifyAsync(ids: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
92
92
  getTicketMessageEntitiesAsync(request: carriers.Ticket_GetTicketMessageEntitiesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketMessageEntity[] >;
93
93
  getTicketMessageEntitiesAsync(ticketId: number, messageIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketMessageEntity[] >;
94
+ createDefaultForTicketTypeAsync(request: carriers.Ticket_CreateDefaultForTicketTypeRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketEntity >;
95
+ createDefaultForTicketTypeAsync(ticketTypeId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketEntity >;
96
+ doEscalatingAsync(request: carriers.Ticket_DoEscalatingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
97
+ doEscalatingAsync(ticketId: number, action: enums.TicketPriorityEscalateAction, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
98
+ getHotlistEjUsersAsync(request: carriers.Ticket_GetHotlistEjUsersRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number[] >;
99
+ getHotlistEjUsersAsync(ticketId: number, skipAssociateIds: number[], notifyType: enums.NotifyType, channel: enums.NotifyChannel, webapi_options?:base.WebApiRequestOptions) : Promise< number[] >;
94
100
  getTicketMessageAsync(ticketMessageId: number) : Promise< carriers.TicketMessage >;
95
101
  getTicketMessageEntityAsync(ticketMessageEntityId: number) : Promise< carriers.TicketMessageEntity >;
96
102
  deleteTicketMessageEntityAsync(request: carriers.Ticket_DeleteTicketMessageEntityRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
97
103
  deleteTicketMessageEntityAsync(ticketMessageEntityId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
98
104
  sanitizeMailContentAsync(request: carriers.Ticket_SanitizeMailContentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
99
105
  sanitizeMailContentAsync(content: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
106
+ sanitizeMailContentWithOptionsAsync(request: carriers.Ticket_SanitizeMailContentWithOptionsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
107
+ sanitizeMailContentWithOptionsAsync(content: string, options: enums.HtmlSanitizerOptions, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
100
108
  sanitizeMailContentsAsync(request: carriers.Ticket_SanitizeMailContentsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string[] >;
101
109
  sanitizeMailContentsAsync(contents: string[], webapi_options?:base.WebApiRequestOptions) : Promise< string[] >;
102
110
  html2TextAsync(request: carriers.Ticket_Html2TextRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
@@ -109,8 +117,12 @@ export interface ITicketAgent {
109
117
  addAttachmentsAsync(ticketMessageEntityId: number, attachmentIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
110
118
  removeMessageAttachmentsAsync(request: carriers.Ticket_RemoveMessageAttachmentsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
111
119
  removeMessageAttachmentsAsync(ticketMessageEntityId: number, attachmentIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
120
+ getAttachmentPreviewAsync(request: carriers.Ticket_GetAttachmentPreviewRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.AttachmentPreview >;
121
+ getAttachmentPreviewAsync(attachmentId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.AttachmentPreview >;
112
122
  getPreviewAttachmentStreamAsync(request: carriers.Ticket_GetPreviewAttachmentStreamRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.DocumentPreview >;
113
123
  getPreviewAttachmentStreamAsync(attachmentId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.DocumentPreview >;
124
+ getRfcAttachmentStreamAsync(request: carriers.Ticket_GetRfcAttachmentStreamRequest, webapi_options?:base.WebApiRequestOptions) : Promise< ArrayBuffer|string >;
125
+ getRfcAttachmentStreamAsync(attachmentId: number, position: number, webapi_options?:base.WebApiRequestOptions) : Promise< ArrayBuffer|string >;
114
126
  sendTicketMessageAsync(request: carriers.Ticket_SendTicketMessageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
115
127
  sendTicketMessageAsync(ticketMessageEntityId: number, to: string[], cc: string[], bcc: string[], subject: string, replyTemplateId: number, gdprSource: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
116
128
  sendTicketMessageSmsAsync(request: carriers.Ticket_SendTicketMessageSmsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
@@ -127,6 +139,8 @@ export interface ITicketAgent {
127
139
  getDefaultMessageContentAsync(ticketId: number, messageActionType: enums.MessageActionType, ticketMessageId: number, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
128
140
  getDefaultMessageContentFullAsync(request: carriers.Ticket_GetDefaultMessageContentFullRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketMessageContent >;
129
141
  getDefaultMessageContentFullAsync(ticketId: number, messageActionType: enums.MessageActionType, ticketMessageId: number, ticketTypeId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketMessageContent >;
142
+ getDefaultMessageContentWithOptionsAsync(request: carriers.Ticket_GetDefaultMessageContentWithOptionsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketMessageContent >;
143
+ getDefaultMessageContentWithOptionsAsync(ticketId: number, messageActionType: enums.MessageActionType, ticketMessageId: number, ticketTypeId: number, excludeSignature: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketMessageContent >;
130
144
  getTicketMessageWithEmbeddedDataAsync(request: carriers.Ticket_GetTicketMessageWithEmbeddedDataRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketMessageEntity >;
131
145
  getTicketMessageWithEmbeddedDataAsync(id: number, embedImages: enums.ImageEmbedType, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketMessageEntity >;
132
146
  deleteMessageHeadersAsync(request: carriers.Ticket_DeleteMessageHeadersRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
@@ -1919,6 +1933,176 @@ export class TicketAgent extends base.WebApiBase implements ITicketAgent {
1919
1933
  return this._getTicketMessageEntitiesAsync( _request, _options );
1920
1934
  }
1921
1935
 
1936
+
1937
+ private async _createDefaultForTicketTypeAsync(request: carriers.Ticket_CreateDefaultForTicketTypeRequest, options?:base.WebApiRequestOptions) : Promise< carriers.TicketEntity > {
1938
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1939
+ base.WebApiBase.SetPending(options);
1940
+ return new Promise< carriers.TicketEntity >(async (resolve, reject) => {
1941
+ try {
1942
+ config.baseURL = this._options.baseUrl;
1943
+ const response = await this._axios.post("CreateDefaultForTicketType", request , config);
1944
+ base.WebApiBase.SetCompleted(options);
1945
+ const res : carriers.TicketEntity = converters.Create_TicketEntity_From( response.data );
1946
+ resolve(res);
1947
+ }
1948
+ catch( err ) {
1949
+ base.WebApiBase.HandleError(options, config, err);
1950
+ reject(err);
1951
+ }
1952
+ });
1953
+ }
1954
+
1955
+
1956
+
1957
+ /**
1958
+ * Create default ticket entity for particular TicketType
1959
+ * @param request - TicketTypeId
1960
+ * @returns Default ticket entity
1961
+ */
1962
+ public async createDefaultForTicketTypeAsync(request: carriers.Ticket_CreateDefaultForTicketTypeRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketEntity >;
1963
+
1964
+ /**
1965
+ * Create default ticket entity for particular TicketType
1966
+ * @param ticketTypeId - ID of ticket type
1967
+ * @returns Default ticket entity
1968
+ */
1969
+ public async createDefaultForTicketTypeAsync(ticketTypeId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketEntity >;
1970
+
1971
+ public async createDefaultForTicketTypeAsync(ticketTypeId:number|carriers.Ticket_CreateDefaultForTicketTypeRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketEntity > {
1972
+ let _request : carriers.Ticket_CreateDefaultForTicketTypeRequest = null;
1973
+ let _options : base.WebApiRequestOptions = null;
1974
+ const first : any = ticketTypeId;
1975
+ if( typeof( first ) === "object" && first && ( typeof(first.ticketTypeId)!='undefined' ) )
1976
+ {
1977
+ _request = ticketTypeId as carriers.Ticket_CreateDefaultForTicketTypeRequest;
1978
+ _options = webapi_options as base.WebApiRequestOptions;
1979
+ }
1980
+ else
1981
+ {
1982
+ _request = {
1983
+ ticketTypeId: ticketTypeId as number,
1984
+ };
1985
+ _options = webapi_options;
1986
+ }
1987
+ return this._createDefaultForTicketTypeAsync( _request, _options );
1988
+ }
1989
+
1990
+
1991
+ private async _doEscalatingAsync(request: carriers.Ticket_DoEscalatingRequest, options?:base.WebApiRequestOptions) : Promise< void > {
1992
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1993
+ base.WebApiBase.SetPending(options);
1994
+ return new Promise< void >(async (resolve, reject) => {
1995
+ try {
1996
+ config.baseURL = this._options.baseUrl;
1997
+ const response = await this._axios.post("DoEscalating", request , config);
1998
+ base.WebApiBase.SetCompleted(options);
1999
+ const res = response.data;
2000
+ resolve(res);
2001
+ }
2002
+ catch( err ) {
2003
+ base.WebApiBase.HandleError(options, config, err);
2004
+ reject(err);
2005
+ }
2006
+ });
2007
+ }
2008
+
2009
+
2010
+
2011
+ /**
2012
+ * Checks if the ticket should change its alert level based on the priority and action. If it is to change, the alert level and alert timeout for the ticket will be updated.
2013
+ * @param request - TicketId, Action
2014
+ * @returns This method has no return value
2015
+ */
2016
+ public async doEscalatingAsync(request: carriers.Ticket_DoEscalatingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
2017
+
2018
+ /**
2019
+ * Checks if the ticket should change its alert level based on the priority and action. If it is to change, the alert level and alert timeout for the ticket will be updated.
2020
+ * @param ticketId - The id of ticket
2021
+ * @param action - The action to use when calculating the escalation
2022
+ * @returns This method has no return value
2023
+ */
2024
+ public async doEscalatingAsync(ticketId: number, action: enums.TicketPriorityEscalateAction, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
2025
+
2026
+ public async doEscalatingAsync(ticketId:number|carriers.Ticket_DoEscalatingRequest, action?:enums.TicketPriorityEscalateAction|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
2027
+ let _request : carriers.Ticket_DoEscalatingRequest = null;
2028
+ let _options : base.WebApiRequestOptions = null;
2029
+ const first : any = ticketId;
2030
+ if( typeof( first ) === "object" && first && ( typeof(first.ticketId)!='undefined' || typeof(first.action)!='undefined' ) )
2031
+ {
2032
+ _request = ticketId as carriers.Ticket_DoEscalatingRequest;
2033
+ _options = action as base.WebApiRequestOptions;
2034
+ }
2035
+ else
2036
+ {
2037
+ _request = {
2038
+ ticketId: ticketId as number,
2039
+ action: action as enums.TicketPriorityEscalateAction,
2040
+ };
2041
+ _options = webapi_options;
2042
+ }
2043
+ return this._doEscalatingAsync( _request, _options );
2044
+ }
2045
+
2046
+
2047
+ private async _getHotlistEjUsersAsync(request: carriers.Ticket_GetHotlistEjUsersRequest, options?:base.WebApiRequestOptions) : Promise< number[] > {
2048
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
2049
+ base.WebApiBase.SetPending(options);
2050
+ return new Promise< number[] >(async (resolve, reject) => {
2051
+ try {
2052
+ config.baseURL = this._options.baseUrl;
2053
+ const response = await this._axios.post("GetHotlistEjUsers", request , config);
2054
+ base.WebApiBase.SetCompleted(options);
2055
+ const res : number[] = response.data as number[];
2056
+ resolve(res);
2057
+ }
2058
+ catch( err ) {
2059
+ base.WebApiBase.HandleError(options, config, err);
2060
+ reject(err);
2061
+ }
2062
+ });
2063
+ }
2064
+
2065
+
2066
+
2067
+ /**
2068
+ * Get a list of ej_user ids who should receive hotlist notification based on request and notification type
2069
+ * @param request - TicketId, SkipAssociateIds, NotifyType, Channel
2070
+ * @returns List of matching ej_user ids
2071
+ */
2072
+ public async getHotlistEjUsersAsync(request: carriers.Ticket_GetHotlistEjUsersRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number[] >;
2073
+
2074
+ /**
2075
+ * Get a list of ej_user ids who should receive hotlist notification based on request and notification type
2076
+ * @param ticketId - The id of the ticket
2077
+ * @param skipAssociateIds - A list of associate ids to skip when calculating whom to get the notification
2078
+ * @param notifyType - The notification type we want to check for
2079
+ * @param channel - The channel which we should check for
2080
+ * @returns List of matching ej_user ids
2081
+ */
2082
+ public async getHotlistEjUsersAsync(ticketId: number, skipAssociateIds: number[], notifyType: enums.NotifyType, channel: enums.NotifyChannel, webapi_options?:base.WebApiRequestOptions) : Promise< number[] >;
2083
+
2084
+ public async getHotlistEjUsersAsync(ticketId:number|carriers.Ticket_GetHotlistEjUsersRequest, skipAssociateIds?:number[]|base.WebApiRequestOptions, notifyType?:enums.NotifyType, channel?:enums.NotifyChannel, webapi_options?:base.WebApiRequestOptions) : Promise< number[] > {
2085
+ let _request : carriers.Ticket_GetHotlistEjUsersRequest = null;
2086
+ let _options : base.WebApiRequestOptions = null;
2087
+ const first : any = ticketId;
2088
+ if( typeof( first ) === "object" && first && ( typeof(first.ticketId)!='undefined' || typeof(first.skipAssociateIds)!='undefined' || typeof(first.notifyType)!='undefined' || typeof(first.channel)!='undefined' ) )
2089
+ {
2090
+ _request = ticketId as carriers.Ticket_GetHotlistEjUsersRequest;
2091
+ _options = skipAssociateIds as base.WebApiRequestOptions;
2092
+ }
2093
+ else
2094
+ {
2095
+ _request = {
2096
+ ticketId: ticketId as number,
2097
+ skipAssociateIds: skipAssociateIds as number[],
2098
+ notifyType: notifyType as enums.NotifyType,
2099
+ channel: channel as enums.NotifyChannel,
2100
+ };
2101
+ _options = webapi_options;
2102
+ }
2103
+ return this._getHotlistEjUsersAsync( _request, _options );
2104
+ }
2105
+
1922
2106
  /**
1923
2107
  * Gets a TicketMessage object.
1924
2108
  * @param ticketMessageId - The primary key.
@@ -2074,6 +2258,62 @@ export class TicketAgent extends base.WebApiBase implements ITicketAgent {
2074
2258
  }
2075
2259
 
2076
2260
 
2261
+ private async _sanitizeMailContentWithOptionsAsync(request: carriers.Ticket_SanitizeMailContentWithOptionsRequest, options?:base.WebApiRequestOptions) : Promise< string > {
2262
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
2263
+ base.WebApiBase.SetPending(options);
2264
+ return new Promise< string >(async (resolve, reject) => {
2265
+ try {
2266
+ config.baseURL = this._options.baseUrl;
2267
+ const response = await this._axios.post("SanitizeMailContentWithOptions", request , config);
2268
+ base.WebApiBase.SetCompleted(options);
2269
+ const res : string = response.data as string;
2270
+ resolve(res);
2271
+ }
2272
+ catch( err ) {
2273
+ base.WebApiBase.HandleError(options, config, err);
2274
+ reject(err);
2275
+ }
2276
+ });
2277
+ }
2278
+
2279
+
2280
+
2281
+ /**
2282
+ * Remove harmful HTML tags and attributes from an email, using specified options
2283
+ * @param request - Content, Options
2284
+ * @returns The sanitized email content
2285
+ */
2286
+ public async sanitizeMailContentWithOptionsAsync(request: carriers.Ticket_SanitizeMailContentWithOptionsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
2287
+
2288
+ /**
2289
+ * Remove harmful HTML tags and attributes from an email, using specified options
2290
+ * @param content - The email content to sanitize
2291
+ * @param options - The options for the sanitizer engine
2292
+ * @returns The sanitized email content
2293
+ */
2294
+ public async sanitizeMailContentWithOptionsAsync(content: string, options: enums.HtmlSanitizerOptions, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
2295
+
2296
+ public async sanitizeMailContentWithOptionsAsync(content:string|carriers.Ticket_SanitizeMailContentWithOptionsRequest, options?:enums.HtmlSanitizerOptions|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
2297
+ let _request : carriers.Ticket_SanitizeMailContentWithOptionsRequest = null;
2298
+ let _options : base.WebApiRequestOptions = null;
2299
+ const first : any = content;
2300
+ if( typeof( first ) === "object" && first && ( typeof(first.content)!='undefined' || typeof(first.options)!='undefined' ) )
2301
+ {
2302
+ _request = content as carriers.Ticket_SanitizeMailContentWithOptionsRequest;
2303
+ _options = options as base.WebApiRequestOptions;
2304
+ }
2305
+ else
2306
+ {
2307
+ _request = {
2308
+ content: content as string,
2309
+ options: options as enums.HtmlSanitizerOptions,
2310
+ };
2311
+ _options = webapi_options;
2312
+ }
2313
+ return this._sanitizeMailContentWithOptionsAsync( _request, _options );
2314
+ }
2315
+
2316
+
2077
2317
  private async _sanitizeMailContentsAsync(request: carriers.Ticket_SanitizeMailContentsRequest, options?:base.WebApiRequestOptions) : Promise< string[] > {
2078
2318
  const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
2079
2319
  base.WebApiBase.SetPending(options);
@@ -2402,6 +2642,60 @@ export class TicketAgent extends base.WebApiBase implements ITicketAgent {
2402
2642
  }
2403
2643
 
2404
2644
 
2645
+ private async _getAttachmentPreviewAsync(request: carriers.Ticket_GetAttachmentPreviewRequest, options?:base.WebApiRequestOptions) : Promise< carriers.AttachmentPreview > {
2646
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
2647
+ base.WebApiBase.SetPending(options);
2648
+ return new Promise< carriers.AttachmentPreview >(async (resolve, reject) => {
2649
+ try {
2650
+ config.baseURL = this._options.baseUrl;
2651
+ const response = await this._axios.post("GetAttachmentPreview", request , config);
2652
+ base.WebApiBase.SetCompleted(options);
2653
+ const res : carriers.AttachmentPreview = converters.Create_AttachmentPreview_From( response.data );
2654
+ resolve(res);
2655
+ }
2656
+ catch( err ) {
2657
+ base.WebApiBase.HandleError(options, config, err);
2658
+ reject(err);
2659
+ }
2660
+ });
2661
+ }
2662
+
2663
+
2664
+
2665
+ /**
2666
+ * Retrieve an attachment from ticket message. The returned data is intended to be used for a preview. The returned data is sanitized.
2667
+ * @param request - AttachmentId
2668
+ * @returns Sanitized preview version of the attachment and additional metadata, if available
2669
+ */
2670
+ public async getAttachmentPreviewAsync(request: carriers.Ticket_GetAttachmentPreviewRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.AttachmentPreview >;
2671
+
2672
+ /**
2673
+ * Retrieve an attachment from ticket message. The returned data is intended to be used for a preview. The returned data is sanitized.
2674
+ * @param attachmentId - The id of the attachment to retrieve
2675
+ * @returns Sanitized preview version of the attachment and additional metadata, if available
2676
+ */
2677
+ public async getAttachmentPreviewAsync(attachmentId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.AttachmentPreview >;
2678
+
2679
+ public async getAttachmentPreviewAsync(attachmentId:number|carriers.Ticket_GetAttachmentPreviewRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.AttachmentPreview > {
2680
+ let _request : carriers.Ticket_GetAttachmentPreviewRequest = null;
2681
+ let _options : base.WebApiRequestOptions = null;
2682
+ const first : any = attachmentId;
2683
+ if( typeof( first ) === "object" && first && ( typeof(first.attachmentId)!='undefined' ) )
2684
+ {
2685
+ _request = attachmentId as carriers.Ticket_GetAttachmentPreviewRequest;
2686
+ _options = webapi_options as base.WebApiRequestOptions;
2687
+ }
2688
+ else
2689
+ {
2690
+ _request = {
2691
+ attachmentId: attachmentId as number,
2692
+ };
2693
+ _options = webapi_options;
2694
+ }
2695
+ return this._getAttachmentPreviewAsync( _request, _options );
2696
+ }
2697
+
2698
+
2405
2699
  private async _getPreviewAttachmentStreamAsync(request: carriers.Ticket_GetPreviewAttachmentStreamRequest, options?:base.WebApiRequestOptions) : Promise< carriers.DocumentPreview > {
2406
2700
  const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
2407
2701
  base.WebApiBase.SetPending(options);
@@ -2423,14 +2717,14 @@ export class TicketAgent extends base.WebApiBase implements ITicketAgent {
2423
2717
 
2424
2718
 
2425
2719
  /**
2426
- * Retrieve an attachment from ticket message. The returned data is intended to be used for a preview. The returned data is sanitized.
2720
+ * Deprecated, see GetPreviewAttachment instead. Retrieve an attachment from ticket message. The returned data is intended to be used for a preview. The returned data is sanitized.
2427
2721
  * @param request - AttachmentId
2428
2722
  * @returns Sanitized preview version of the attachment
2429
2723
  */
2430
2724
  public async getPreviewAttachmentStreamAsync(request: carriers.Ticket_GetPreviewAttachmentStreamRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.DocumentPreview >;
2431
2725
 
2432
2726
  /**
2433
- * Retrieve an attachment from ticket message. The returned data is intended to be used for a preview. The returned data is sanitized.
2727
+ * Deprecated, see GetPreviewAttachment instead. Retrieve an attachment from ticket message. The returned data is intended to be used for a preview. The returned data is sanitized.
2434
2728
  * @param attachmentId - The id of the attachment to retrieve
2435
2729
  * @returns Sanitized preview version of the attachment
2436
2730
  */
@@ -2456,6 +2750,80 @@ export class TicketAgent extends base.WebApiBase implements ITicketAgent {
2456
2750
  }
2457
2751
 
2458
2752
 
2753
+ private async _getRfcAttachmentStreamAsync(request: carriers.Ticket_GetRfcAttachmentStreamRequest, options?:base.WebApiRequestOptions) : Promise< ArrayBuffer|string > {
2754
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options) || {};
2755
+ base.WebApiBase.SetPending(options);
2756
+ return new Promise< ArrayBuffer|string >(async (resolve, reject) => {
2757
+ try {
2758
+ if( ! options || options.returnBlobAs == base.ReturnBlobType.AsArrayBuffer ) {
2759
+ config.responseType = "arraybuffer";
2760
+ config.headers = config.headers || {};
2761
+ config.headers["Accept"] = "application/octet-stream";
2762
+ }
2763
+ config.baseURL = this._options.baseUrl;
2764
+ const response = await this._axios.post("GetRfcAttachmentStream", request , config);
2765
+ base.WebApiBase.SetCompleted(options);
2766
+ let res : ArrayBuffer | string = null;
2767
+ if( options && options.returnBlobAs != base.ReturnBlobType.AsArrayBuffer )
2768
+ {
2769
+ res = response.data as string;
2770
+ if( options.returnBlobAs == base.ReturnBlobType.AsString )
2771
+ {
2772
+ res = FromBase64ToString(res);
2773
+ }
2774
+ }
2775
+ else
2776
+ {
2777
+ res = response.data as ArrayBuffer;
2778
+ }
2779
+
2780
+ resolve(res);
2781
+ }
2782
+ catch( err ) {
2783
+ base.WebApiBase.HandleError(options, config, err);
2784
+ reject(err);
2785
+ }
2786
+ });
2787
+ }
2788
+
2789
+
2790
+
2791
+ /**
2792
+ * Get the content of an attachment which is part of RFC822 email attachment
2793
+ * @param request - AttachmentId, Position
2794
+ * @returns RFC822 attachment content as a Stream
2795
+ */
2796
+ public async getRfcAttachmentStreamAsync(request: carriers.Ticket_GetRfcAttachmentStreamRequest, webapi_options?:base.WebApiRequestOptions) : Promise< ArrayBuffer|string >;
2797
+
2798
+ /**
2799
+ * Get the content of an attachment which is part of RFC822 email attachment
2800
+ * @param attachmentId - The id of the root attachment
2801
+ * @param position - The position (index) of the attachment within the root attachment. Numbering starts from 0
2802
+ * @returns RFC822 attachment content as a Stream
2803
+ */
2804
+ public async getRfcAttachmentStreamAsync(attachmentId: number, position: number, webapi_options?:base.WebApiRequestOptions) : Promise< ArrayBuffer|string >;
2805
+
2806
+ public async getRfcAttachmentStreamAsync(attachmentId:number|carriers.Ticket_GetRfcAttachmentStreamRequest, position?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< ArrayBuffer|string > {
2807
+ let _request : carriers.Ticket_GetRfcAttachmentStreamRequest = null;
2808
+ let _options : base.WebApiRequestOptions = null;
2809
+ const first : any = attachmentId;
2810
+ if( typeof( first ) === "object" && first && ( typeof(first.attachmentId)!='undefined' || typeof(first.position)!='undefined' ) )
2811
+ {
2812
+ _request = attachmentId as carriers.Ticket_GetRfcAttachmentStreamRequest;
2813
+ _options = position as base.WebApiRequestOptions;
2814
+ }
2815
+ else
2816
+ {
2817
+ _request = {
2818
+ attachmentId: attachmentId as number,
2819
+ position: position as number,
2820
+ };
2821
+ _options = webapi_options;
2822
+ }
2823
+ return this._getRfcAttachmentStreamAsync( _request, _options );
2824
+ }
2825
+
2826
+
2459
2827
  private async _sendTicketMessageAsync(request: carriers.Ticket_SendTicketMessageRequest, options?:base.WebApiRequestOptions) : Promise< void > {
2460
2828
  const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
2461
2829
  base.WebApiBase.SetPending(options);
@@ -2928,6 +3296,68 @@ export class TicketAgent extends base.WebApiBase implements ITicketAgent {
2928
3296
  }
2929
3297
 
2930
3298
 
3299
+ private async _getDefaultMessageContentWithOptionsAsync(request: carriers.Ticket_GetDefaultMessageContentWithOptionsRequest, options?:base.WebApiRequestOptions) : Promise< carriers.TicketMessageContent > {
3300
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
3301
+ base.WebApiBase.SetPending(options);
3302
+ return new Promise< carriers.TicketMessageContent >(async (resolve, reject) => {
3303
+ try {
3304
+ config.baseURL = this._options.baseUrl;
3305
+ const response = await this._axios.post("GetDefaultMessageContentWithOptions", request , config);
3306
+ base.WebApiBase.SetCompleted(options);
3307
+ const res : carriers.TicketMessageContent = converters.Create_TicketMessageContent_From( response.data );
3308
+ resolve(res);
3309
+ }
3310
+ catch( err ) {
3311
+ base.WebApiBase.HandleError(options, config, err);
3312
+ reject(err);
3313
+ }
3314
+ });
3315
+ }
3316
+
3317
+
3318
+
3319
+ /**
3320
+ * Generate a default message content with option to exclude signature: attachments and body as sanitized HTML
3321
+ * @param request - TicketId, MessageActionType, TicketMessageId, TicketTypeId, ExcludeSignature
3322
+ * @returns Generated default message content
3323
+ */
3324
+ public async getDefaultMessageContentWithOptionsAsync(request: carriers.Ticket_GetDefaultMessageContentWithOptionsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketMessageContent >;
3325
+
3326
+ /**
3327
+ * Generate a default message content with option to exclude signature: attachments and body as sanitized HTML
3328
+ * @param ticketId - The id of the ticket
3329
+ * @param messageActionType - Message action type: None/Reply/ReplyAll/Forward
3330
+ * @param ticketMessageId - The id of the message to quote in the returned content. 0 to skip/ignore
3331
+ * @param ticketTypeId - The id of the ticket type to look for reply template. 0 to use current ticket type
3332
+ * @param excludeSignature - Flag to exclude a signature when generating the return content
3333
+ * @returns Generated default message content
3334
+ */
3335
+ public async getDefaultMessageContentWithOptionsAsync(ticketId: number, messageActionType: enums.MessageActionType, ticketMessageId: number, ticketTypeId: number, excludeSignature: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketMessageContent >;
3336
+
3337
+ public async getDefaultMessageContentWithOptionsAsync(ticketId:number|carriers.Ticket_GetDefaultMessageContentWithOptionsRequest, messageActionType?:enums.MessageActionType|base.WebApiRequestOptions, ticketMessageId?:number, ticketTypeId?:number, excludeSignature?:boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketMessageContent > {
3338
+ let _request : carriers.Ticket_GetDefaultMessageContentWithOptionsRequest = null;
3339
+ let _options : base.WebApiRequestOptions = null;
3340
+ const first : any = ticketId;
3341
+ if( typeof( first ) === "object" && first && ( typeof(first.ticketId)!='undefined' || typeof(first.messageActionType)!='undefined' || typeof(first.ticketMessageId)!='undefined' || typeof(first.ticketTypeId)!='undefined' || typeof(first.excludeSignature)!='undefined' ) )
3342
+ {
3343
+ _request = ticketId as carriers.Ticket_GetDefaultMessageContentWithOptionsRequest;
3344
+ _options = messageActionType as base.WebApiRequestOptions;
3345
+ }
3346
+ else
3347
+ {
3348
+ _request = {
3349
+ ticketId: ticketId as number,
3350
+ messageActionType: messageActionType as enums.MessageActionType,
3351
+ ticketMessageId: ticketMessageId as number,
3352
+ ticketTypeId: ticketTypeId as number,
3353
+ excludeSignature: excludeSignature as boolean,
3354
+ };
3355
+ _options = webapi_options;
3356
+ }
3357
+ return this._getDefaultMessageContentWithOptionsAsync( _request, _options );
3358
+ }
3359
+
3360
+
2931
3361
  private async _getTicketMessageWithEmbeddedDataAsync(request: carriers.Ticket_GetTicketMessageWithEmbeddedDataRequest, options?:base.WebApiRequestOptions) : Promise< carriers.TicketMessageEntity > {
2932
3362
  const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
2933
3363
  base.WebApiBase.SetPending(options);