@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.
Files changed (163) hide show
  1. package/LICENSE.md +15 -15
  2. package/README.md +184 -184
  3. package/__tests__/Appointment63-notz.json +1925 -1925
  4. package/__tests__/Appointment63-utctz.json +1925 -1925
  5. package/__tests__/Appointment63.json +1925 -1925
  6. package/__tests__/AppointmentTzTest.ts +115 -115
  7. package/__tests__/AxiosNockTest.ts +28 -28
  8. package/__tests__/ContactDefault.json +699 -699
  9. package/__tests__/ContactEntity.json +272 -272
  10. package/__tests__/ContactRestTest.ts +144 -144
  11. package/__tests__/ContactTest.ts +395 -395
  12. package/__tests__/ConvertersTest.ts +97 -97
  13. package/__tests__/DocumentTest.ts +101 -101
  14. package/__tests__/Person210-notz.json +1932 -1932
  15. package/__tests__/Person210-utctz.json +1932 -1932
  16. package/__tests__/Person210.json +1932 -1932
  17. package/__tests__/PersonImageData.nock +22 -22
  18. package/__tests__/PersonTest.ts +41 -41
  19. package/__tests__/PersonTzTest.ts +113 -113
  20. package/__tests__/RecurrenceInfo.json +55 -55
  21. package/__tests__/ResponseCallbackTest.ts +23 -23
  22. package/__tests__/TableRights.json +441 -441
  23. package/__tests__/WebapiTest.ts +264 -264
  24. package/__tests__/Webhook.json +16 -16
  25. package/__tests__/WebhookTest.ts +209 -209
  26. package/dist/cjs/AIAgent.d.ts +62 -0
  27. package/dist/cjs/AIAgent.d.ts.map +1 -1
  28. package/dist/cjs/AIAgent.js +149 -0
  29. package/dist/cjs/AIAgent.js.map +1 -1
  30. package/dist/cjs/Carriers.d.ts +640 -14
  31. package/dist/cjs/Carriers.d.ts.map +1 -1
  32. package/dist/cjs/Converters.d.ts +24 -0
  33. package/dist/cjs/Converters.d.ts.map +1 -1
  34. package/dist/cjs/Converters.js +388 -17
  35. package/dist/cjs/Converters.js.map +1 -1
  36. package/dist/cjs/DiagnosticsAgent.d.ts +38 -0
  37. package/dist/cjs/DiagnosticsAgent.d.ts.map +1 -1
  38. package/dist/cjs/DiagnosticsAgent.js +91 -0
  39. package/dist/cjs/DiagnosticsAgent.js.map +1 -1
  40. package/dist/cjs/Enums.d.ts +77 -1
  41. package/dist/cjs/Enums.d.ts.map +1 -1
  42. package/dist/cjs/Enums.js +83 -4
  43. package/dist/cjs/Enums.js.map +1 -1
  44. package/dist/cjs/ListAgent.d.ts +71 -6
  45. package/dist/cjs/ListAgent.d.ts.map +1 -1
  46. package/dist/cjs/ListAgent.js +157 -0
  47. package/dist/cjs/ListAgent.js.map +1 -1
  48. package/dist/cjs/MarketingAgent.d.ts +68 -0
  49. package/dist/cjs/MarketingAgent.d.ts.map +1 -1
  50. package/dist/cjs/MarketingAgent.js +157 -0
  51. package/dist/cjs/MarketingAgent.js.map +1 -1
  52. package/dist/cjs/TicketAgent.d.ts +23 -0
  53. package/dist/cjs/TicketAgent.d.ts.map +1 -1
  54. package/dist/cjs/TicketAgent.js +65 -0
  55. package/dist/cjs/TicketAgent.js.map +1 -1
  56. package/dist/esm/AIAgent.d.ts +62 -0
  57. package/dist/esm/AIAgent.d.ts.map +1 -1
  58. package/dist/esm/AIAgent.js +150 -1
  59. package/dist/esm/AIAgent.js.map +1 -1
  60. package/dist/esm/Carriers.d.ts +640 -14
  61. package/dist/esm/Carriers.d.ts.map +1 -1
  62. package/dist/esm/Converters.d.ts +24 -0
  63. package/dist/esm/Converters.d.ts.map +1 -1
  64. package/dist/esm/Converters.js +346 -0
  65. package/dist/esm/Converters.js.map +1 -1
  66. package/dist/esm/DiagnosticsAgent.d.ts +38 -0
  67. package/dist/esm/DiagnosticsAgent.d.ts.map +1 -1
  68. package/dist/esm/DiagnosticsAgent.js +91 -0
  69. package/dist/esm/DiagnosticsAgent.js.map +1 -1
  70. package/dist/esm/Enums.d.ts +77 -1
  71. package/dist/esm/Enums.d.ts.map +1 -1
  72. package/dist/esm/Enums.js +79 -0
  73. package/dist/esm/Enums.js.map +1 -1
  74. package/dist/esm/ListAgent.d.ts +71 -6
  75. package/dist/esm/ListAgent.d.ts.map +1 -1
  76. package/dist/esm/ListAgent.js +157 -0
  77. package/dist/esm/ListAgent.js.map +1 -1
  78. package/dist/esm/MarketingAgent.d.ts +68 -0
  79. package/dist/esm/MarketingAgent.d.ts.map +1 -1
  80. package/dist/esm/MarketingAgent.js +157 -0
  81. package/dist/esm/MarketingAgent.js.map +1 -1
  82. package/dist/esm/TicketAgent.d.ts +23 -0
  83. package/dist/esm/TicketAgent.d.ts.map +1 -1
  84. package/dist/esm/TicketAgent.js +65 -0
  85. package/dist/esm/TicketAgent.js.map +1 -1
  86. package/examples-js/hello.js +12 -12
  87. package/examples-ts/hello.ts +8 -8
  88. package/package.json +93 -93
  89. package/scripts/postbuild.js +22 -22
  90. package/scripts/setVersion.js +44 -44
  91. package/src/AIAgent.ts +2239 -1992
  92. package/src/AppointmentAgent.ts +6263 -6263
  93. package/src/AppointmentRestApi.ts +225 -225
  94. package/src/ArchiveAgent.ts +1950 -1950
  95. package/src/AssociateAgent.ts +422 -422
  96. package/src/AxiosCacheHandler.ts +74 -74
  97. package/src/BLOBAgent.ts +2100 -2100
  98. package/src/Base64.ts +285 -285
  99. package/src/BatchAgent.ts +910 -910
  100. package/src/BulkUpdateAgent.ts +504 -504
  101. package/src/CRMScriptAgent.ts +1390 -1390
  102. package/src/Carriers.ts +53121 -52274
  103. package/src/ChatAgent.ts +1422 -1422
  104. package/src/ConfigurationAgent.ts +2228 -2228
  105. package/src/ContactAgent.ts +1756 -1756
  106. package/src/ContactRestApi.ts +237 -237
  107. package/src/Converters.ts +23496 -23090
  108. package/src/CustomerServiceAgent.ts +1799 -1799
  109. package/src/DashAgent.ts +1674 -1674
  110. package/src/DatabaseAgent.ts +120 -120
  111. package/src/DatabaseTableAgent.ts +534 -534
  112. package/src/Day_js.ts +41 -41
  113. package/src/DiagnosticsAgent.ts +1384 -1240
  114. package/src/DocumentAgent.ts +5079 -5079
  115. package/src/DocumentMigrationAgent.ts +524 -524
  116. package/src/DocumentRestApi.ts +259 -259
  117. package/src/EMailAgent.ts +5328 -5328
  118. package/src/Enums.ts +6998 -6916
  119. package/src/ErpSyncAgent.ts +2658 -2658
  120. package/src/FavouriteAgent.ts +720 -720
  121. package/src/FindAgent.ts +2330 -2330
  122. package/src/ForeignSystemAgent.ts +1710 -1710
  123. package/src/FreeTextAgent.ts +372 -372
  124. package/src/ImportAgent.ts +304 -304
  125. package/src/LicenseAgent.ts +1230 -1230
  126. package/src/ListAgent.ts +11451 -11237
  127. package/src/MDOAgent.ts +748 -748
  128. package/src/MarketingAgent.ts +1146 -890
  129. package/src/MessagingAgent.ts +384 -384
  130. package/src/NavigatorAgent.ts +140 -140
  131. package/src/NumberAllocationAgent.ts +296 -296
  132. package/src/PersonAgent.ts +3287 -3287
  133. package/src/PersonRestApi.ts +241 -241
  134. package/src/PhoneListAgent.ts +458 -458
  135. package/src/PocketAgent.ts +780 -780
  136. package/src/PreferenceAgent.ts +1900 -1900
  137. package/src/PreviewsAgent.ts +116 -116
  138. package/src/ProjectAgent.ts +2391 -2391
  139. package/src/ProjectRestApi.ts +239 -239
  140. package/src/QuoteAgent.ts +5159 -5159
  141. package/src/RelationAgent.ts +220 -220
  142. package/src/ReportAgent.ts +154 -154
  143. package/src/ResourceAgent.ts +358 -358
  144. package/src/SaintAgent.ts +601 -601
  145. package/src/SaleAgent.ts +2034 -2034
  146. package/src/SaleRestApi.ts +233 -233
  147. package/src/SelectionAgent.ts +3195 -3195
  148. package/src/SentryAgent.ts +462 -462
  149. package/src/SoApiConstants.ts +8 -8
  150. package/src/TargetsAgent.ts +1104 -1104
  151. package/src/TicketAgent.ts +3708 -3638
  152. package/src/TimeZoneAgent.ts +528 -528
  153. package/src/TooltipsAgent.ts +116 -116
  154. package/src/UserAgent.ts +4856 -4856
  155. package/src/UserDefinedFieldInfoAgent.ts +1764 -1764
  156. package/src/ViewStateAgent.ts +858 -858
  157. package/src/WebApi.ts +872 -872
  158. package/src/WebApiBase.ts +565 -565
  159. package/src/WebhookAgent.ts +388 -388
  160. package/src/WorkflowAgent.ts +1338 -1338
  161. package/tsconfig.esm.json +8 -8
  162. package/tsconfig.jest.json +8 -8
  163. package/tsconfig.json +34 -34
@@ -1,1799 +1,1799 @@
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/CustomerServiceAgent.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
- * Agent used for Customer Service methods
28
- */
29
- export interface ICustomerServiceAgent {
30
- createDefaultCustomerCenterConfigAsync(): Promise< carriers.CustomerCenterConfig >;
31
- saveCustomerCenterConfigAsync(entity: carriers.CustomerCenterConfig) : Promise< carriers.CustomerCenterConfig >;
32
- deleteCustomerCenterConfigAsync(CustomerCenterConfigId: number) : Promise<void>;
33
- createDefaultMailboxEntityAsync(): Promise< carriers.MailboxEntity >;
34
- saveMailboxEntityAsync(entity: carriers.MailboxEntity) : Promise< carriers.MailboxEntity >;
35
- updateFeatureTogglesAsync(request: carriers.CustomerService_UpdateFeatureTogglesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
36
- updateFeatureTogglesAsync(featureToggles: carriers.CsFeatureToggle[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
37
- eventHandlerExistsAsync(request: carriers.CustomerService_EventHandlerExistsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
38
- eventHandlerExistsAsync(eventHandlerType: enums.EventHandlerType, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
39
- eventHandlersExistsAsync(request: carriers.CustomerService_EventHandlersExistsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< enums.EventHandlerType[] >;
40
- eventHandlersExistsAsync(eventHandlerTypes: enums.EventHandlerType[], webapi_options?:base.WebApiRequestOptions) : Promise< enums.EventHandlerType[] >;
41
- createSessionAsync(request: carriers.CustomerService_CreateSessionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CsSessionKey >;
42
- createSessionAsync(remoteIp: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CsSessionKey >;
43
- removeSessionAsync(request: carriers.CustomerService_RemoveSessionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
44
- removeSessionAsync(loginId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
45
- sessionIsValidAsync(request: carriers.CustomerService_SessionIsValidRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
46
- sessionIsValidAsync(csSessionKey: string, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
47
- hasChatNotifyAsync(webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
48
- checkSymmetricEncryptionAsync(request: carriers.CustomerService_CheckSymmetricEncryptionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
49
- checkSymmetricEncryptionAsync(encryptedString: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
50
- reportSessionActiveAsync(request: carriers.CustomerService_ReportSessionActiveRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
51
- reportSessionActiveAsync(sessionKey: string, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
52
- getCustomerCenterConfigAsync(customerCenterConfigId: number) : Promise< carriers.CustomerCenterConfig >;
53
- getAllCustomerCenterConfigsAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CustomerCenterConfig[] >;
54
- saveAllCustomerCenterConfigsAsync(request: carriers.CustomerService_SaveAllCustomerCenterConfigsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
55
- saveAllCustomerCenterConfigsAsync(custConfigs: carriers.CustomerCenterConfig[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
56
- checkIfCustomizedTemplatesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
57
- getProgramUrlAsync(request: carriers.CustomerService_GetProgramUrlRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
58
- getProgramUrlAsync(programName: string, external: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
59
- getFaqForCustomerAsync(request: carriers.CustomerService_GetFaqForCustomerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
60
- getFaqForCustomerAsync(faqEntryId: number, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
61
- getCustomerServiceStartupAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CustomerServiceStartup >;
62
- getCustomerServiceStartupByOwnerAsync(request: carriers.CustomerService_GetCustomerServiceStartupByOwnerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CustomerServiceStartup >;
63
- getCustomerServiceStartupByOwnerAsync(userId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CustomerServiceStartup >;
64
- executeEventHandlersAsync(request: carriers.CustomerService_ExecuteEventHandlersRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EventData >;
65
- executeEventHandlersAsync(eventData: carriers.EventData, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EventData >;
66
- getMailboxesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Mailbox[] >;
67
- getMailboxEntityAsync(mailboxEntityId: number) : Promise< carriers.MailboxEntity >;
68
- getPreviewFaqEntryAsync(request: carriers.CustomerService_GetPreviewFaqEntryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreviewFaqEntry >;
69
- getPreviewFaqEntryAsync(kbEntryId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreviewFaqEntry >;
70
- getPreviewQuickReplyAsync(request: carriers.CustomerService_GetPreviewQuickReplyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreviewQuickReply >;
71
- getPreviewQuickReplyAsync(quickReplyId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreviewQuickReply >;
72
- getPreviewReplyTemplateAsync(request: carriers.CustomerService_GetPreviewReplyTemplateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreviewReplyTemplate >;
73
- getPreviewReplyTemplateAsync(replyTemplateId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreviewReplyTemplate >;
74
- getParsedTemplateAsync(request: carriers.CustomerService_GetParsedTemplateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ReplyTemplateParsed >;
75
- getParsedTemplateAsync(replyTemplateId: number, languageId: number, personId: number, ticketId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ReplyTemplateParsed >;
76
- getUnparsedTemplateAsync(request: carriers.CustomerService_GetUnparsedTemplateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ReplyTemplateParsed >;
77
- getUnparsedTemplateAsync(replyTemplateId: number, languageId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ReplyTemplateParsed >;
78
- getSmsConfigAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SmsConfig >;
79
- testSmtpServerAsync(request: carriers.CustomerService_TestSmtpServerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SmtpTestResult >;
80
- testSmtpServerAsync(smtpUri: string, from: string, useStoredPassword: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SmtpTestResult >;
81
- getStatisticsAsync(request: carriers.CustomerService_GetStatisticsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StatisticsDataSet[] >;
82
- getStatisticsAsync(functions: enums.StatusScreenPanelType[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StatisticsDataSet[] >;
83
- getSystemTemplateSettingsAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SystemTemplateSettings >;
84
- saveSystemTemplateSettingsAsync(request: carriers.CustomerService_SaveSystemTemplateSettingsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SystemTemplateSettings >;
85
- saveSystemTemplateSettingsAsync(systemTemplateSettings: carriers.SystemTemplateSettings, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SystemTemplateSettings >;
86
- createTicketFromMailDataAsync(request: carriers.CustomerService_CreateTicketFromMailDataRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo >;
87
- createTicketFromMailDataAsync(mailboxId: number, data: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo >;
88
- addMessageFromMailDataAsync(request: carriers.CustomerService_AddMessageFromMailDataRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo >;
89
- addMessageFromMailDataAsync(ticketId: number, data: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo >;
90
- findTicketsByTitleOrIdAsync(request: carriers.CustomerService_FindTicketsByTitleOrIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo[] >;
91
- findTicketsByTitleOrIdAsync(titleOrId: string, maxRows: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo[] >;
92
- } // interface ICustomerServiceAgent
93
-
94
-
95
-
96
-
97
- /**
98
- * Agent used for Customer Service methods
99
- */
100
- export class CustomerServiceAgent extends base.WebApiBase implements ICustomerServiceAgent {
101
- constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
102
- constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
103
- constructor(baseUrl: string, resourceManager:any);
104
- constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
105
- constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
106
- constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
107
- constructor(options: base.WebApiOptions);
108
-
109
- constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
110
- langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
111
- langOrResourceOrRM?:string|base.ResourceParsing|any,
112
- cultureCode?: string,
113
- ) {
114
- const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
115
- options.basePath = "v1/Agents/CustomerService/";
116
- super(options);
117
- }
118
-
119
-
120
-
121
- /**
122
- * Set default values into a new CustomerCenterConfig.
123
- * NetServer calculates default values on the entity, which is required when creating/storing a new instance
124
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
125
- * @returns A blank entity.
126
- */
127
- public async createDefaultCustomerCenterConfigAsync(options?:base.WebApiRequestOptions) : Promise< carriers.CustomerCenterConfig > {
128
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
129
- base.WebApiBase.SetPending(options);
130
- return new Promise< carriers.CustomerCenterConfig >(async (resolve, reject) => {
131
- try {
132
- const response = await this._axios.post("CreateDefaultCustomerCenterConfig", null, config);
133
- base.WebApiBase.SetCompleted(options, response);
134
- const res : carriers.CustomerCenterConfig = converters.Create_CustomerCenterConfig_From( response.data );
135
- resolve(res);
136
- }
137
- catch( err ) {
138
- base.WebApiBase.HandleError(options, config, err);
139
- reject(err);
140
- }
141
- });
142
- }
143
- /**
144
- * Replace the existing CustomerCenterConfig or creates a new CustomerCenterConfig if the id parameter is empty
145
- * @param entity - The CustomerCenterConfig to be saved.
146
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
147
- * @returns New or updated CustomerCenterConfig
148
- */
149
- public async saveCustomerCenterConfigAsync(entity: carriers.CustomerCenterConfig, options?:base.WebApiRequestOptions) : Promise< carriers.CustomerCenterConfig > {
150
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
151
- base.WebApiBase.SetPending(options);
152
- return new Promise< carriers.CustomerCenterConfig >(async (resolve, reject) => {
153
- try {
154
- const response = await this._axios.post("SaveCustomerCenterConfig", entity, config);
155
- base.WebApiBase.SetCompleted(options, response);
156
- const res : carriers.CustomerCenterConfig = converters.Create_CustomerCenterConfig_From( response.data );
157
- resolve(res);
158
- }
159
- catch( err ) {
160
- base.WebApiBase.HandleError(options, config, err);
161
- reject(err);
162
- }
163
- });
164
- }
165
-
166
- /**
167
- * Deletes the CustomerCenterConfig
168
- * @param CustomerCenterConfigId - The id of the CustomerCenterConfig to be deleted.
169
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
170
- */
171
- public async deleteCustomerCenterConfigAsync(CustomerCenterConfigId: number, options?:base.WebApiRequestOptions) : Promise< void > {
172
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
173
- base.WebApiBase.SetPending(options);
174
- return new Promise< void >(async (resolve, reject) => {
175
- try {
176
- const response = await this._axios.post("DeleteCustomerCenterConfig?CustomerCenterConfigId=" + CustomerCenterConfigId, null, config );
177
- base.WebApiBase.SetCompleted(options, response);
178
- const res = response.data;
179
- resolve(res);
180
- }
181
- catch( err ) {
182
- base.WebApiBase.HandleError(options, config, err);
183
- reject(err);
184
- }
185
- });
186
- }
187
-
188
- /**
189
- * Set default values into a new MailboxEntity.
190
- * NetServer calculates default values on the entity, which is required when creating/storing a new instance
191
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
192
- * @returns A blank entity.
193
- */
194
- public async createDefaultMailboxEntityAsync(options?:base.WebApiRequestOptions) : Promise< carriers.MailboxEntity > {
195
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
196
- base.WebApiBase.SetPending(options);
197
- return new Promise< carriers.MailboxEntity >(async (resolve, reject) => {
198
- try {
199
- const response = await this._axios.post("CreateDefaultMailboxEntity", null, config);
200
- base.WebApiBase.SetCompleted(options, response);
201
- const res : carriers.MailboxEntity = converters.Create_MailboxEntity_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
- * Replace the existing MailboxEntity or creates a new MailboxEntity if the id parameter is empty
212
- * @param entity - The MailboxEntity to be saved.
213
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
214
- * @returns New or updated MailboxEntity
215
- */
216
- public async saveMailboxEntityAsync(entity: carriers.MailboxEntity, options?:base.WebApiRequestOptions) : Promise< carriers.MailboxEntity > {
217
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
218
- base.WebApiBase.SetPending(options);
219
- return new Promise< carriers.MailboxEntity >(async (resolve, reject) => {
220
- try {
221
- const response = await this._axios.post("SaveMailboxEntity", entity, config);
222
- base.WebApiBase.SetCompleted(options, response);
223
- const res : carriers.MailboxEntity = converters.Create_MailboxEntity_From( response.data );
224
- resolve(res);
225
- }
226
- catch( err ) {
227
- base.WebApiBase.HandleError(options, config, err);
228
- reject(err);
229
- }
230
- });
231
- }
232
-
233
- private async _updateFeatureTogglesAsync(request: carriers.CustomerService_UpdateFeatureTogglesRequest, options?:base.WebApiRequestOptions) : Promise< void > {
234
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
235
- base.WebApiBase.SetPending(options);
236
- return new Promise< void >(async (resolve, reject) => {
237
- try {
238
- config.baseURL = this._options.baseUrl;
239
- const response = await this._axios.post("UpdateFeatureToggles", request , config);
240
- base.WebApiBase.SetCompleted(options, response);
241
- const res = response.data;
242
- resolve(res);
243
- }
244
- catch( err ) {
245
- base.WebApiBase.HandleError(options, config, err);
246
- reject(err);
247
- }
248
- });
249
- }
250
-
251
-
252
-
253
- /**
254
- * Update the cached FeatureToggles for CS
255
- * @param request - FeatureToggles
256
- * @returns
257
- */
258
- public async updateFeatureTogglesAsync(request: carriers.CustomerService_UpdateFeatureTogglesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
259
-
260
- /**
261
- * Update the cached FeatureToggles for CS
262
- * @param featureToggles - Feature toggle name / state
263
- * @returns
264
- */
265
- public async updateFeatureTogglesAsync(featureToggles: carriers.CsFeatureToggle[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
266
-
267
- public async updateFeatureTogglesAsync(featureToggles:carriers.CsFeatureToggle[]|carriers.CustomerService_UpdateFeatureTogglesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
268
- let _request : carriers.CustomerService_UpdateFeatureTogglesRequest = null;
269
- let _options : base.WebApiRequestOptions = null;
270
- const first : any = featureToggles;
271
- if( typeof( first ) === "object" && first && ( typeof(first.featureToggles)!='undefined' ) )
272
- {
273
- _request = featureToggles as carriers.CustomerService_UpdateFeatureTogglesRequest;
274
- _options = webapi_options as base.WebApiRequestOptions;
275
- }
276
- else
277
- {
278
- _request = {
279
- featureToggles: featureToggles as carriers.CsFeatureToggle[],
280
- };
281
- _options = webapi_options;
282
- }
283
- return this._updateFeatureTogglesAsync( _request, _options );
284
- }
285
-
286
-
287
- private async _eventHandlerExistsAsync(request: carriers.CustomerService_EventHandlerExistsRequest, options?:base.WebApiRequestOptions) : Promise< boolean > {
288
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
289
- base.WebApiBase.SetPending(options);
290
- return new Promise< boolean >(async (resolve, reject) => {
291
- try {
292
- config.baseURL = this._options.baseUrl;
293
- const response = await this._axios.post("EventHandlerExists", request , config);
294
- base.WebApiBase.SetCompleted(options, response);
295
- const res : boolean = response.data as boolean;
296
- resolve(res);
297
- }
298
- catch( err ) {
299
- base.WebApiBase.HandleError(options, config, err);
300
- reject(err);
301
- }
302
- });
303
- }
304
-
305
-
306
-
307
- /**
308
- * Check if an eventhandler exists for a given enum
309
- * @param request - EventHandlerType
310
- * @returns True if it exists
311
- */
312
- public async eventHandlerExistsAsync(request: carriers.CustomerService_EventHandlerExistsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
313
-
314
- /**
315
- * Check if an eventhandler exists for a given enum
316
- * @param eventHandlerType - The EventHandlerType we are checking
317
- * @returns True if it exists
318
- */
319
- public async eventHandlerExistsAsync(eventHandlerType: enums.EventHandlerType, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
320
-
321
- public async eventHandlerExistsAsync(eventHandlerType:enums.EventHandlerType|carriers.CustomerService_EventHandlerExistsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean > {
322
- let _request : carriers.CustomerService_EventHandlerExistsRequest = null;
323
- let _options : base.WebApiRequestOptions = null;
324
- const first : any = eventHandlerType;
325
- if( typeof( first ) === "object" && first && ( typeof(first.eventHandlerType)!='undefined' ) )
326
- {
327
- _request = eventHandlerType as carriers.CustomerService_EventHandlerExistsRequest;
328
- _options = webapi_options as base.WebApiRequestOptions;
329
- }
330
- else
331
- {
332
- _request = {
333
- eventHandlerType: eventHandlerType as enums.EventHandlerType,
334
- };
335
- _options = webapi_options;
336
- }
337
- return this._eventHandlerExistsAsync( _request, _options );
338
- }
339
-
340
-
341
- private async _eventHandlersExistsAsync(request: carriers.CustomerService_EventHandlersExistsRequest, options?:base.WebApiRequestOptions) : Promise< enums.EventHandlerType[] > {
342
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
343
- base.WebApiBase.SetPending(options);
344
- return new Promise< enums.EventHandlerType[] >(async (resolve, reject) => {
345
- try {
346
- config.baseURL = this._options.baseUrl;
347
- const response = await this._axios.post("EventHandlersExists", request , config);
348
- base.WebApiBase.SetCompleted(options, response);
349
- const res : enums.EventHandlerType[] = response.data as enums.EventHandlerType[];
350
- resolve(res);
351
- }
352
- catch( err ) {
353
- base.WebApiBase.HandleError(options, config, err);
354
- reject(err);
355
- }
356
- });
357
- }
358
-
359
-
360
-
361
- /**
362
- * Check if any given eventhandler exists
363
- * @param request - EventHandlerTypes
364
- * @returns The existing event handlers
365
- */
366
- public async eventHandlersExistsAsync(request: carriers.CustomerService_EventHandlersExistsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< enums.EventHandlerType[] >;
367
-
368
- /**
369
- * Check if any given eventhandler exists
370
- * @param eventHandlerTypes - The EventHandlerTypes we are checking
371
- * @returns The existing event handlers
372
- */
373
- public async eventHandlersExistsAsync(eventHandlerTypes: enums.EventHandlerType[], webapi_options?:base.WebApiRequestOptions) : Promise< enums.EventHandlerType[] >;
374
-
375
- public async eventHandlersExistsAsync(eventHandlerTypes:enums.EventHandlerType[]|carriers.CustomerService_EventHandlersExistsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< enums.EventHandlerType[] > {
376
- let _request : carriers.CustomerService_EventHandlersExistsRequest = null;
377
- let _options : base.WebApiRequestOptions = null;
378
- const first : any = eventHandlerTypes;
379
- if( typeof( first ) === "object" && first && ( typeof(first.eventHandlerTypes)!='undefined' ) )
380
- {
381
- _request = eventHandlerTypes as carriers.CustomerService_EventHandlersExistsRequest;
382
- _options = webapi_options as base.WebApiRequestOptions;
383
- }
384
- else
385
- {
386
- _request = {
387
- eventHandlerTypes: eventHandlerTypes as enums.EventHandlerType[],
388
- };
389
- _options = webapi_options;
390
- }
391
- return this._eventHandlersExistsAsync( _request, _options );
392
- }
393
-
394
-
395
- private async _createSessionAsync(request: carriers.CustomerService_CreateSessionRequest, options?:base.WebApiRequestOptions) : Promise< carriers.CsSessionKey > {
396
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
397
- base.WebApiBase.SetPending(options);
398
- return new Promise< carriers.CsSessionKey >(async (resolve, reject) => {
399
- try {
400
- config.baseURL = this._options.baseUrl;
401
- const response = await this._axios.post("CreateSession", request , config);
402
- base.WebApiBase.SetCompleted(options, response);
403
- const res : carriers.CsSessionKey = converters.Create_CsSessionKey_From( response.data );
404
- resolve(res);
405
- }
406
- catch( err ) {
407
- base.WebApiBase.HandleError(options, config, err);
408
- reject(err);
409
- }
410
- });
411
- }
412
-
413
-
414
-
415
- /**
416
- * Creates a login session for a CS user
417
- * @param request - RemoteIp
418
- * @returns The session key information
419
- */
420
- public async createSessionAsync(request: carriers.CustomerService_CreateSessionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CsSessionKey >;
421
-
422
- /**
423
- * Creates a login session for a CS user
424
- * @param remoteIp - The ip of the client creating the session
425
- * @returns The session key information
426
- */
427
- public async createSessionAsync(remoteIp: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CsSessionKey >;
428
-
429
- public async createSessionAsync(remoteIp:string|carriers.CustomerService_CreateSessionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CsSessionKey > {
430
- let _request : carriers.CustomerService_CreateSessionRequest = null;
431
- let _options : base.WebApiRequestOptions = null;
432
- const first : any = remoteIp;
433
- if( typeof( first ) === "object" && first && ( typeof(first.remoteIp)!='undefined' ) )
434
- {
435
- _request = remoteIp as carriers.CustomerService_CreateSessionRequest;
436
- _options = webapi_options as base.WebApiRequestOptions;
437
- }
438
- else
439
- {
440
- _request = {
441
- remoteIp: remoteIp as string,
442
- };
443
- _options = webapi_options;
444
- }
445
- return this._createSessionAsync( _request, _options );
446
- }
447
-
448
-
449
- private async _removeSessionAsync(request: carriers.CustomerService_RemoveSessionRequest, options?:base.WebApiRequestOptions) : Promise< void > {
450
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
451
- base.WebApiBase.SetPending(options);
452
- return new Promise< void >(async (resolve, reject) => {
453
- try {
454
- config.baseURL = this._options.baseUrl;
455
- const response = await this._axios.post("RemoveSession", request , config);
456
- base.WebApiBase.SetCompleted(options, response);
457
- const res = response.data;
458
- resolve(res);
459
- }
460
- catch( err ) {
461
- base.WebApiBase.HandleError(options, config, err);
462
- reject(err);
463
- }
464
- });
465
- }
466
-
467
-
468
-
469
- /**
470
- * Remove a login session for a CS user
471
- * @param request - LoginId
472
- * @returns
473
- */
474
- public async removeSessionAsync(request: carriers.CustomerService_RemoveSessionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
475
-
476
- /**
477
- * Remove a login session for a CS user
478
- * @param loginId - The login id to remove
479
- * @returns
480
- */
481
- public async removeSessionAsync(loginId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
482
-
483
- public async removeSessionAsync(loginId:number|carriers.CustomerService_RemoveSessionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
484
- let _request : carriers.CustomerService_RemoveSessionRequest = null;
485
- let _options : base.WebApiRequestOptions = null;
486
- const first : any = loginId;
487
- if( typeof( first ) === "object" && first && ( typeof(first.loginId)!='undefined' ) )
488
- {
489
- _request = loginId as carriers.CustomerService_RemoveSessionRequest;
490
- _options = webapi_options as base.WebApiRequestOptions;
491
- }
492
- else
493
- {
494
- _request = {
495
- loginId: loginId as number,
496
- };
497
- _options = webapi_options;
498
- }
499
- return this._removeSessionAsync( _request, _options );
500
- }
501
-
502
-
503
- private async _sessionIsValidAsync(request: carriers.CustomerService_SessionIsValidRequest, options?:base.WebApiRequestOptions) : Promise< boolean > {
504
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
505
- base.WebApiBase.SetPending(options);
506
- return new Promise< boolean >(async (resolve, reject) => {
507
- try {
508
- config.baseURL = this._options.baseUrl;
509
- const response = await this._axios.post("SessionIsValid", request , config);
510
- base.WebApiBase.SetCompleted(options, response);
511
- const res : boolean = response.data as boolean;
512
- resolve(res);
513
- }
514
- catch( err ) {
515
- base.WebApiBase.HandleError(options, config, err);
516
- reject(err);
517
- }
518
- });
519
- }
520
-
521
-
522
-
523
- /**
524
- * Check if a CS session is valid
525
- * @param request - CsSessionKey
526
- * @returns True if there is a valid CS session based on the session key
527
- */
528
- public async sessionIsValidAsync(request: carriers.CustomerService_SessionIsValidRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
529
-
530
- /**
531
- * Check if a CS session is valid
532
- * @param csSessionKey - The CS session key to check
533
- * @returns True if there is a valid CS session based on the session key
534
- */
535
- public async sessionIsValidAsync(csSessionKey: string, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
536
-
537
- public async sessionIsValidAsync(csSessionKey:string|carriers.CustomerService_SessionIsValidRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean > {
538
- let _request : carriers.CustomerService_SessionIsValidRequest = null;
539
- let _options : base.WebApiRequestOptions = null;
540
- const first : any = csSessionKey;
541
- if( typeof( first ) === "object" && first && ( typeof(first.csSessionKey)!='undefined' ) )
542
- {
543
- _request = csSessionKey as carriers.CustomerService_SessionIsValidRequest;
544
- _options = webapi_options as base.WebApiRequestOptions;
545
- }
546
- else
547
- {
548
- _request = {
549
- csSessionKey: csSessionKey as string,
550
- };
551
- _options = webapi_options;
552
- }
553
- return this._sessionIsValidAsync( _request, _options );
554
- }
555
-
556
-
557
- private async _hasChatNotifyAsync( options?:base.WebApiRequestOptions) : Promise< boolean > {
558
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
559
- base.WebApiBase.SetPending(options);
560
- return new Promise< boolean >(async (resolve, reject) => {
561
- try {
562
- config.baseURL = this._options.baseUrl;
563
- const response = await this._axios.post("HasChatNotify", undefined , config);
564
- base.WebApiBase.SetCompleted(options, response);
565
- const res : boolean = response.data as boolean;
566
- resolve(res);
567
- }
568
- catch( err ) {
569
- base.WebApiBase.HandleError(options, config, err);
570
- reject(err);
571
- }
572
- });
573
- }
574
-
575
-
576
- /**
577
- * Check if user has any chat notification
578
- * @returns True if the user has at least one notification setting on
579
- */
580
- public async hasChatNotifyAsync(webapi_options?:base.WebApiRequestOptions) : Promise< boolean >
581
- {
582
- return this._hasChatNotifyAsync(webapi_options);
583
- }
584
-
585
-
586
- private async _checkSymmetricEncryptionAsync(request: carriers.CustomerService_CheckSymmetricEncryptionRequest, options?:base.WebApiRequestOptions) : Promise< string > {
587
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
588
- base.WebApiBase.SetPending(options);
589
- return new Promise< string >(async (resolve, reject) => {
590
- try {
591
- config.baseURL = this._options.baseUrl;
592
- const response = await this._axios.post("CheckSymmetricEncryption", request , config);
593
- base.WebApiBase.SetCompleted(options, response);
594
- const res : string = response.data as string;
595
- resolve(res);
596
- }
597
- catch( err ) {
598
- base.WebApiBase.HandleError(options, config, err);
599
- reject(err);
600
- }
601
- });
602
- }
603
-
604
-
605
-
606
- /**
607
- * Do a test to check that we are using the same encryption keys
608
- * @param request - EncryptedString
609
- * @returns Encrypted version of the string done by NetServer
610
- */
611
- public async checkSymmetricEncryptionAsync(request: carriers.CustomerService_CheckSymmetricEncryptionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
612
-
613
- /**
614
- * Do a test to check that we are using the same encryption keys
615
- * @param encryptedString - An encrypted version of the string
616
- * @returns Encrypted version of the string done by NetServer
617
- */
618
- public async checkSymmetricEncryptionAsync(encryptedString: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
619
-
620
- public async checkSymmetricEncryptionAsync(encryptedString:string|carriers.CustomerService_CheckSymmetricEncryptionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
621
- let _request : carriers.CustomerService_CheckSymmetricEncryptionRequest = null;
622
- let _options : base.WebApiRequestOptions = null;
623
- const first : any = encryptedString;
624
- if( typeof( first ) === "object" && first && ( typeof(first.encryptedString)!='undefined' ) )
625
- {
626
- _request = encryptedString as carriers.CustomerService_CheckSymmetricEncryptionRequest;
627
- _options = webapi_options as base.WebApiRequestOptions;
628
- }
629
- else
630
- {
631
- _request = {
632
- encryptedString: encryptedString as string,
633
- };
634
- _options = webapi_options;
635
- }
636
- return this._checkSymmetricEncryptionAsync( _request, _options );
637
- }
638
-
639
-
640
- private async _reportSessionActiveAsync(request: carriers.CustomerService_ReportSessionActiveRequest, options?:base.WebApiRequestOptions) : Promise< number > {
641
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
642
- base.WebApiBase.SetPending(options);
643
- return new Promise< number >(async (resolve, reject) => {
644
- try {
645
- config.baseURL = this._options.baseUrl;
646
- const response = await this._axios.post("ReportSessionActive", request , config);
647
- base.WebApiBase.SetCompleted(options, response);
648
- const res : number = response.data as number;
649
- resolve(res);
650
- }
651
- catch( err ) {
652
- base.WebApiBase.HandleError(options, config, err);
653
- reject(err);
654
- }
655
- });
656
- }
657
-
658
-
659
-
660
- /**
661
- * Report a session as being &apos;active&apos;; will update the corresponding row in login table, but not more than once per minute/session
662
- * @param request - SessionKey
663
- * @returns The ID of the login table row, or 0 if not found
664
- */
665
- public async reportSessionActiveAsync(request: carriers.CustomerService_ReportSessionActiveRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
666
-
667
- /**
668
- * Report a session as being &apos;active&apos;; will update the corresponding row in login table, but not more than once per minute/session
669
- * @param sessionKey - CS session key, matching the 'login' table
670
- * @returns The ID of the login table row, or 0 if not found
671
- */
672
- public async reportSessionActiveAsync(sessionKey: string, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
673
-
674
- public async reportSessionActiveAsync(sessionKey:string|carriers.CustomerService_ReportSessionActiveRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number > {
675
- let _request : carriers.CustomerService_ReportSessionActiveRequest = null;
676
- let _options : base.WebApiRequestOptions = null;
677
- const first : any = sessionKey;
678
- if( typeof( first ) === "object" && first && ( typeof(first.sessionKey)!='undefined' ) )
679
- {
680
- _request = sessionKey as carriers.CustomerService_ReportSessionActiveRequest;
681
- _options = webapi_options as base.WebApiRequestOptions;
682
- }
683
- else
684
- {
685
- _request = {
686
- sessionKey: sessionKey as string,
687
- };
688
- _options = webapi_options;
689
- }
690
- return this._reportSessionActiveAsync( _request, _options );
691
- }
692
-
693
- /**
694
- * Gets a CustomerCenterConfig object.
695
- * @param customerCenterConfigId - The primary key.
696
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
697
- * @returns A single CustomerCenterConfig
698
- */
699
- public async getCustomerCenterConfigAsync(customerCenterConfigId: number, options?:base.WebApiRequestOptions) : Promise< carriers.CustomerCenterConfig > {
700
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
701
- base.WebApiBase.SetPending(options);
702
- return new Promise< carriers.CustomerCenterConfig >(async (resolve, reject) => {
703
- try {
704
- const response = await this._axios.post("GetCustomerCenterConfig?customerCenterConfigId=" + customerCenterConfigId, null, config);
705
- base.WebApiBase.SetCompleted(options, response);
706
- const res = converters.Create_CustomerCenterConfig_From( response.data );
707
- resolve(res);
708
- }
709
- catch( err ) {
710
- base.WebApiBase.HandleError(options, config, err);
711
- reject(err);
712
- }
713
- });
714
- }
715
-
716
-
717
- private async _getAllCustomerCenterConfigsAsync( options?:base.WebApiRequestOptions) : Promise< carriers.CustomerCenterConfig[] > {
718
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
719
- base.WebApiBase.SetPending(options);
720
- return new Promise< carriers.CustomerCenterConfig[] >(async (resolve, reject) => {
721
- try {
722
- config.baseURL = this._options.baseUrl;
723
- const response = await this._axios.post("GetAllCustomerCenterConfigs", undefined , config);
724
- base.WebApiBase.SetCompleted(options, response);
725
- const res : carriers.CustomerCenterConfig[] = converters.Create_CustomerCenterConfigArray_From( response.data );
726
- resolve(res);
727
- }
728
- catch( err ) {
729
- base.WebApiBase.HandleError(options, config, err);
730
- reject(err);
731
- }
732
- });
733
- }
734
-
735
-
736
- /**
737
- * Get all rows from cust_config as an array of CustomerCenterConfig entities
738
- * @returns An array of CustomerCenterConfig entities
739
- */
740
- public async getAllCustomerCenterConfigsAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CustomerCenterConfig[] >
741
- {
742
- return this._getAllCustomerCenterConfigsAsync(webapi_options);
743
- }
744
-
745
-
746
- private async _saveAllCustomerCenterConfigsAsync(request: carriers.CustomerService_SaveAllCustomerCenterConfigsRequest, options?:base.WebApiRequestOptions) : Promise< void > {
747
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
748
- base.WebApiBase.SetPending(options);
749
- return new Promise< void >(async (resolve, reject) => {
750
- try {
751
- config.baseURL = this._options.baseUrl;
752
- const response = await this._axios.post("SaveAllCustomerCenterConfigs", request , config);
753
- base.WebApiBase.SetCompleted(options, response);
754
- const res = response.data;
755
- resolve(res);
756
- }
757
- catch( err ) {
758
- base.WebApiBase.HandleError(options, config, err);
759
- reject(err);
760
- }
761
- });
762
- }
763
-
764
-
765
-
766
- /**
767
- * Save an array of CustomerCenterConfig entities to the database
768
- * @param request - CustConfigs
769
- * @returns void
770
- */
771
- public async saveAllCustomerCenterConfigsAsync(request: carriers.CustomerService_SaveAllCustomerCenterConfigsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
772
-
773
- /**
774
- * Save an array of CustomerCenterConfig entities to the database
775
- * @param custConfigs - The CustomerCenterConfig entities to be saved. If the id does not exists, a new one will be created. Unknown ids will be skipped
776
- * @returns void
777
- */
778
- public async saveAllCustomerCenterConfigsAsync(custConfigs: carriers.CustomerCenterConfig[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
779
-
780
- public async saveAllCustomerCenterConfigsAsync(custConfigs:carriers.CustomerCenterConfig[]|carriers.CustomerService_SaveAllCustomerCenterConfigsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
781
- let _request : carriers.CustomerService_SaveAllCustomerCenterConfigsRequest = null;
782
- let _options : base.WebApiRequestOptions = null;
783
- const first : any = custConfigs;
784
- if( typeof( first ) === "object" && first && ( typeof(first.custConfigs)!='undefined' ) )
785
- {
786
- _request = custConfigs as carriers.CustomerService_SaveAllCustomerCenterConfigsRequest;
787
- _options = webapi_options as base.WebApiRequestOptions;
788
- }
789
- else
790
- {
791
- _request = {
792
- custConfigs: custConfigs as carriers.CustomerCenterConfig[],
793
- };
794
- _options = webapi_options;
795
- }
796
- return this._saveAllCustomerCenterConfigsAsync( _request, _options );
797
- }
798
-
799
-
800
- private async _checkIfCustomizedTemplatesAsync( options?:base.WebApiRequestOptions) : Promise< boolean > {
801
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
802
- base.WebApiBase.SetPending(options);
803
- return new Promise< boolean >(async (resolve, reject) => {
804
- try {
805
- config.baseURL = this._options.baseUrl;
806
- const response = await this._axios.post("CheckIfCustomizedTemplates", undefined , config);
807
- base.WebApiBase.SetCompleted(options, response);
808
- const res : boolean = response.data as boolean;
809
- resolve(res);
810
- }
811
- catch( err ) {
812
- base.WebApiBase.HandleError(options, config, err);
813
- reject(err);
814
- }
815
- });
816
- }
817
-
818
-
819
- /**
820
- * Checks whether the core html templates are customized
821
- * @returns True if the templates are customized
822
- */
823
- public async checkIfCustomizedTemplatesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< boolean >
824
- {
825
- return this._checkIfCustomizedTemplatesAsync(webapi_options);
826
- }
827
-
828
-
829
- private async _getProgramUrlAsync(request: carriers.CustomerService_GetProgramUrlRequest, options?:base.WebApiRequestOptions) : Promise< string > {
830
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
831
- base.WebApiBase.SetPending(options);
832
- return new Promise< string >(async (resolve, reject) => {
833
- try {
834
- config.baseURL = this._options.baseUrl;
835
- const response = await this._axios.post("GetProgramUrl", request , config);
836
- base.WebApiBase.SetCompleted(options, response);
837
- const res : string = response.data as string;
838
- resolve(res);
839
- }
840
- catch( err ) {
841
- base.WebApiBase.HandleError(options, config, err);
842
- reject(err);
843
- }
844
- });
845
- }
846
-
847
-
848
-
849
- /**
850
- * This method will convert a module name into a Service URL.
851
- * @param request - ProgramName, External
852
- * @returns Returns a valid Service URL composed of the give parameters.
853
- */
854
- public async getProgramUrlAsync(request: carriers.CustomerService_GetProgramUrlRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
855
-
856
- /**
857
- * This method will convert a module name into a Service URL.
858
- * @param programName - In this parameter you must specify which CS program you want to create an URL for. Valid examples are "ticket", "rms", "spm" etc.
859
- * @param external - If set to true, this will generate URLs that are accesible from the outside (for example Internet)
860
- * @returns Returns a valid Service URL composed of the give parameters.
861
- */
862
- public async getProgramUrlAsync(programName: string, external: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
863
-
864
- public async getProgramUrlAsync(programName:string|carriers.CustomerService_GetProgramUrlRequest, external?:boolean|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
865
- let _request : carriers.CustomerService_GetProgramUrlRequest = null;
866
- let _options : base.WebApiRequestOptions = null;
867
- const first : any = programName;
868
- if( typeof( first ) === "object" && first && ( typeof(first.programName)!='undefined' || typeof(first.external)!='undefined' ) )
869
- {
870
- _request = programName as carriers.CustomerService_GetProgramUrlRequest;
871
- _options = external as base.WebApiRequestOptions;
872
- }
873
- else
874
- {
875
- _request = {
876
- programName: programName as string,
877
- external: external as boolean,
878
- };
879
- _options = webapi_options;
880
- }
881
- return this._getProgramUrlAsync( _request, _options );
882
- }
883
-
884
-
885
- private async _getFaqForCustomerAsync(request: carriers.CustomerService_GetFaqForCustomerRequest, options?:base.WebApiRequestOptions) : Promise< string > {
886
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
887
- base.WebApiBase.SetPending(options);
888
- return new Promise< string >(async (resolve, reject) => {
889
- try {
890
- config.baseURL = this._options.baseUrl;
891
- const response = await this._axios.post("GetFaqForCustomer", request , config);
892
- base.WebApiBase.SetCompleted(options, response);
893
- const res : string = response.data as string;
894
- resolve(res);
895
- }
896
- catch( err ) {
897
- base.WebApiBase.HandleError(options, config, err);
898
- reject(err);
899
- }
900
- });
901
- }
902
-
903
-
904
-
905
- /**
906
- * Get a FAQ entry, ment to be displayed for a customer. This can either be a link to the FAQ entry on Custom Center, or it can be the answer and question. This is dependent on Registry setting with reg_id=157
907
- * @param request - FaqEntryId
908
- * @returns The FAQ to show to the customer. Either a clickable link or the question/answer itself.
909
- */
910
- public async getFaqForCustomerAsync(request: carriers.CustomerService_GetFaqForCustomerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
911
-
912
- /**
913
- * Get a FAQ entry, ment to be displayed for a customer. This can either be a link to the FAQ entry on Custom Center, or it can be the answer and question. This is dependent on Registry setting with reg_id=157
914
- * @param faqEntryId - The id of the FAQ entry to get. Only FAQ entries with access level public (both for unauthenticated and autenticated customer) will be returned
915
- * @returns The FAQ to show to the customer. Either a clickable link or the question/answer itself.
916
- */
917
- public async getFaqForCustomerAsync(faqEntryId: number, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
918
-
919
- public async getFaqForCustomerAsync(faqEntryId:number|carriers.CustomerService_GetFaqForCustomerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
920
- let _request : carriers.CustomerService_GetFaqForCustomerRequest = null;
921
- let _options : base.WebApiRequestOptions = null;
922
- const first : any = faqEntryId;
923
- if( typeof( first ) === "object" && first && ( typeof(first.faqEntryId)!='undefined' ) )
924
- {
925
- _request = faqEntryId as carriers.CustomerService_GetFaqForCustomerRequest;
926
- _options = webapi_options as base.WebApiRequestOptions;
927
- }
928
- else
929
- {
930
- _request = {
931
- faqEntryId: faqEntryId as number,
932
- };
933
- _options = webapi_options;
934
- }
935
- return this._getFaqForCustomerAsync( _request, _options );
936
- }
937
-
938
-
939
- private async _getCustomerServiceStartupAsync( options?:base.WebApiRequestOptions) : Promise< carriers.CustomerServiceStartup > {
940
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
941
- base.WebApiBase.SetPending(options);
942
- return new Promise< carriers.CustomerServiceStartup >(async (resolve, reject) => {
943
- try {
944
- config.baseURL = this._options.baseUrl;
945
- const response = await this._axios.post("GetCustomerServiceStartup", undefined , config);
946
- base.WebApiBase.SetCompleted(options, response);
947
- const res : carriers.CustomerServiceStartup = converters.Create_CustomerServiceStartup_From( response.data );
948
- resolve(res);
949
- }
950
- catch( err ) {
951
- base.WebApiBase.HandleError(options, config, err);
952
- reject(err);
953
- }
954
- });
955
- }
956
-
957
-
958
- /**
959
- * Get the carrier with data that Service needs when starting up
960
- * @returns The carrier containing the startup data
961
- */
962
- public async getCustomerServiceStartupAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CustomerServiceStartup >
963
- {
964
- return this._getCustomerServiceStartupAsync(webapi_options);
965
- }
966
-
967
-
968
- private async _getCustomerServiceStartupByOwnerAsync(request: carriers.CustomerService_GetCustomerServiceStartupByOwnerRequest, options?:base.WebApiRequestOptions) : Promise< carriers.CustomerServiceStartup > {
969
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
970
- base.WebApiBase.SetPending(options);
971
- return new Promise< carriers.CustomerServiceStartup >(async (resolve, reject) => {
972
- try {
973
- config.baseURL = this._options.baseUrl;
974
- const response = await this._axios.post("GetCustomerServiceStartupByOwner", request , config);
975
- base.WebApiBase.SetCompleted(options, response);
976
- const res : carriers.CustomerServiceStartup = converters.Create_CustomerServiceStartup_From( response.data );
977
- resolve(res);
978
- }
979
- catch( err ) {
980
- base.WebApiBase.HandleError(options, config, err);
981
- reject(err);
982
- }
983
- });
984
- }
985
-
986
-
987
-
988
- /**
989
- * Get the carrier with data that Service needs when starting up for a specific user
990
- * @param request - UserId
991
- * @returns The carrier containing the startup data
992
- */
993
- public async getCustomerServiceStartupByOwnerAsync(request: carriers.CustomerService_GetCustomerServiceStartupByOwnerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CustomerServiceStartup >;
994
-
995
- /**
996
- * Get the carrier with data that Service needs when starting up for a specific user
997
- * @param userId - The user for which we want to fetch the startup values for
998
- * @returns The carrier containing the startup data
999
- */
1000
- public async getCustomerServiceStartupByOwnerAsync(userId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CustomerServiceStartup >;
1001
-
1002
- public async getCustomerServiceStartupByOwnerAsync(userId:number|carriers.CustomerService_GetCustomerServiceStartupByOwnerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CustomerServiceStartup > {
1003
- let _request : carriers.CustomerService_GetCustomerServiceStartupByOwnerRequest = null;
1004
- let _options : base.WebApiRequestOptions = null;
1005
- const first : any = userId;
1006
- if( typeof( first ) === "object" && first && ( typeof(first.userId)!='undefined' ) )
1007
- {
1008
- _request = userId as carriers.CustomerService_GetCustomerServiceStartupByOwnerRequest;
1009
- _options = webapi_options as base.WebApiRequestOptions;
1010
- }
1011
- else
1012
- {
1013
- _request = {
1014
- userId: userId as number,
1015
- };
1016
- _options = webapi_options;
1017
- }
1018
- return this._getCustomerServiceStartupByOwnerAsync( _request, _options );
1019
- }
1020
-
1021
-
1022
- private async _executeEventHandlersAsync(request: carriers.CustomerService_ExecuteEventHandlersRequest, options?:base.WebApiRequestOptions) : Promise< carriers.EventData > {
1023
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1024
- base.WebApiBase.SetPending(options);
1025
- return new Promise< carriers.EventData >(async (resolve, reject) => {
1026
- try {
1027
- config.baseURL = this._options.baseUrl;
1028
- const response = await this._axios.post("ExecuteEventHandlers", request , config);
1029
- base.WebApiBase.SetCompleted(options, response);
1030
- const res : carriers.EventData = converters.Create_EventData_From( response.data );
1031
- resolve(res);
1032
- }
1033
- catch( err ) {
1034
- base.WebApiBase.HandleError(options, config, err);
1035
- reject(err);
1036
- }
1037
- });
1038
- }
1039
-
1040
-
1041
-
1042
- /**
1043
- * This method will execute event handlers in CRMScript for a given event.
1044
- * @param request - EventData
1045
- * @returns The EventData instance after event handler execution
1046
- */
1047
- public async executeEventHandlersAsync(request: carriers.CustomerService_ExecuteEventHandlersRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EventData >;
1048
-
1049
- /**
1050
- * This method will execute event handlers in CRMScript for a given event.
1051
- * @param eventData - The EventData instance sent to the event handler
1052
- * @returns The EventData instance after event handler execution
1053
- */
1054
- public async executeEventHandlersAsync(eventData: carriers.EventData, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EventData >;
1055
-
1056
- public async executeEventHandlersAsync(eventData:carriers.EventData|carriers.CustomerService_ExecuteEventHandlersRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EventData > {
1057
- let _request : carriers.CustomerService_ExecuteEventHandlersRequest = null;
1058
- let _options : base.WebApiRequestOptions = null;
1059
- const first : any = eventData;
1060
- if( typeof( first ) === "object" && first && ( typeof(first.eventData)!='undefined' ) )
1061
- {
1062
- _request = eventData as carriers.CustomerService_ExecuteEventHandlersRequest;
1063
- _options = webapi_options as base.WebApiRequestOptions;
1064
- }
1065
- else
1066
- {
1067
- _request = {
1068
- eventData: eventData as carriers.EventData,
1069
- };
1070
- _options = webapi_options;
1071
- }
1072
- return this._executeEventHandlersAsync( _request, _options );
1073
- }
1074
-
1075
-
1076
- private async _getMailboxesAsync( options?:base.WebApiRequestOptions) : Promise< carriers.Mailbox[] > {
1077
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1078
- base.WebApiBase.SetPending(options);
1079
- return new Promise< carriers.Mailbox[] >(async (resolve, reject) => {
1080
- try {
1081
- config.baseURL = this._options.baseUrl;
1082
- const response = await this._axios.post("GetMailboxes", undefined , config);
1083
- base.WebApiBase.SetCompleted(options, response);
1084
- const res : carriers.Mailbox[] = converters.Create_MailboxArray_From( response.data );
1085
- resolve(res);
1086
- }
1087
- catch( err ) {
1088
- base.WebApiBase.HandleError(options, config, err);
1089
- reject(err);
1090
- }
1091
- });
1092
- }
1093
-
1094
-
1095
- /**
1096
- * This method will get all registered mailboxes in Service
1097
- * @returns An array of Mailbox objects
1098
- */
1099
- public async getMailboxesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Mailbox[] >
1100
- {
1101
- return this._getMailboxesAsync(webapi_options);
1102
- }
1103
-
1104
- /**
1105
- * Gets a MailboxEntity object.
1106
- * @param mailboxEntityId - The primary key.
1107
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
1108
- * @returns A single MailboxEntity
1109
- */
1110
- public async getMailboxEntityAsync(mailboxEntityId: number, options?:base.WebApiRequestOptions) : Promise< carriers.MailboxEntity > {
1111
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1112
- base.WebApiBase.SetPending(options);
1113
- return new Promise< carriers.MailboxEntity >(async (resolve, reject) => {
1114
- try {
1115
- const response = await this._axios.post("GetMailboxEntity?mailboxEntityId=" + mailboxEntityId, null, config);
1116
- base.WebApiBase.SetCompleted(options, response);
1117
- const res = converters.Create_MailboxEntity_From( response.data );
1118
- resolve(res);
1119
- }
1120
- catch( err ) {
1121
- base.WebApiBase.HandleError(options, config, err);
1122
- reject(err);
1123
- }
1124
- });
1125
- }
1126
-
1127
-
1128
- private async _getPreviewFaqEntryAsync(request: carriers.CustomerService_GetPreviewFaqEntryRequest, options?:base.WebApiRequestOptions) : Promise< carriers.PreviewFaqEntry > {
1129
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1130
- base.WebApiBase.SetPending(options);
1131
- return new Promise< carriers.PreviewFaqEntry >(async (resolve, reject) => {
1132
- try {
1133
- config.baseURL = this._options.baseUrl;
1134
- const response = await this._axios.post("GetPreviewFaqEntry", request , config);
1135
- base.WebApiBase.SetCompleted(options, response);
1136
- const res : carriers.PreviewFaqEntry = converters.Create_PreviewFaqEntry_From( response.data );
1137
- resolve(res);
1138
- }
1139
- catch( err ) {
1140
- base.WebApiBase.HandleError(options, config, err);
1141
- reject(err);
1142
- }
1143
- });
1144
- }
1145
-
1146
-
1147
-
1148
- /**
1149
- * Get a faq entry from its faq entry id
1150
- * @param request - KbEntryId
1151
- * @returns FAQ entry suitable for preview
1152
- */
1153
- public async getPreviewFaqEntryAsync(request: carriers.CustomerService_GetPreviewFaqEntryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreviewFaqEntry >;
1154
-
1155
- /**
1156
- * Get a faq entry from its faq entry id
1157
- * @param kbEntryId - FAQ entry ID
1158
- * @returns FAQ entry suitable for preview
1159
- */
1160
- public async getPreviewFaqEntryAsync(kbEntryId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreviewFaqEntry >;
1161
-
1162
- public async getPreviewFaqEntryAsync(kbEntryId:number|carriers.CustomerService_GetPreviewFaqEntryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreviewFaqEntry > {
1163
- let _request : carriers.CustomerService_GetPreviewFaqEntryRequest = null;
1164
- let _options : base.WebApiRequestOptions = null;
1165
- const first : any = kbEntryId;
1166
- if( typeof( first ) === "object" && first && ( typeof(first.kbEntryId)!='undefined' ) )
1167
- {
1168
- _request = kbEntryId as carriers.CustomerService_GetPreviewFaqEntryRequest;
1169
- _options = webapi_options as base.WebApiRequestOptions;
1170
- }
1171
- else
1172
- {
1173
- _request = {
1174
- kbEntryId: kbEntryId as number,
1175
- };
1176
- _options = webapi_options;
1177
- }
1178
- return this._getPreviewFaqEntryAsync( _request, _options );
1179
- }
1180
-
1181
-
1182
- private async _getPreviewQuickReplyAsync(request: carriers.CustomerService_GetPreviewQuickReplyRequest, options?:base.WebApiRequestOptions) : Promise< carriers.PreviewQuickReply > {
1183
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1184
- base.WebApiBase.SetPending(options);
1185
- return new Promise< carriers.PreviewQuickReply >(async (resolve, reject) => {
1186
- try {
1187
- config.baseURL = this._options.baseUrl;
1188
- const response = await this._axios.post("GetPreviewQuickReply", request , config);
1189
- base.WebApiBase.SetCompleted(options, response);
1190
- const res : carriers.PreviewQuickReply = converters.Create_PreviewQuickReply_From( response.data );
1191
- resolve(res);
1192
- }
1193
- catch( err ) {
1194
- base.WebApiBase.HandleError(options, config, err);
1195
- reject(err);
1196
- }
1197
- });
1198
- }
1199
-
1200
-
1201
-
1202
- /**
1203
- * Get a quick reply from its quick reply id
1204
- * @param request - QuickReplyId
1205
- * @returns Quick reply suitable for preview
1206
- */
1207
- public async getPreviewQuickReplyAsync(request: carriers.CustomerService_GetPreviewQuickReplyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreviewQuickReply >;
1208
-
1209
- /**
1210
- * Get a quick reply from its quick reply id
1211
- * @param quickReplyId - Quick reply ID
1212
- * @returns Quick reply suitable for preview
1213
- */
1214
- public async getPreviewQuickReplyAsync(quickReplyId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreviewQuickReply >;
1215
-
1216
- public async getPreviewQuickReplyAsync(quickReplyId:number|carriers.CustomerService_GetPreviewQuickReplyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreviewQuickReply > {
1217
- let _request : carriers.CustomerService_GetPreviewQuickReplyRequest = null;
1218
- let _options : base.WebApiRequestOptions = null;
1219
- const first : any = quickReplyId;
1220
- if( typeof( first ) === "object" && first && ( typeof(first.quickReplyId)!='undefined' ) )
1221
- {
1222
- _request = quickReplyId as carriers.CustomerService_GetPreviewQuickReplyRequest;
1223
- _options = webapi_options as base.WebApiRequestOptions;
1224
- }
1225
- else
1226
- {
1227
- _request = {
1228
- quickReplyId: quickReplyId as number,
1229
- };
1230
- _options = webapi_options;
1231
- }
1232
- return this._getPreviewQuickReplyAsync( _request, _options );
1233
- }
1234
-
1235
-
1236
- private async _getPreviewReplyTemplateAsync(request: carriers.CustomerService_GetPreviewReplyTemplateRequest, options?:base.WebApiRequestOptions) : Promise< carriers.PreviewReplyTemplate > {
1237
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1238
- base.WebApiBase.SetPending(options);
1239
- return new Promise< carriers.PreviewReplyTemplate >(async (resolve, reject) => {
1240
- try {
1241
- config.baseURL = this._options.baseUrl;
1242
- const response = await this._axios.post("GetPreviewReplyTemplate", request , config);
1243
- base.WebApiBase.SetCompleted(options, response);
1244
- const res : carriers.PreviewReplyTemplate = converters.Create_PreviewReplyTemplate_From( response.data );
1245
- resolve(res);
1246
- }
1247
- catch( err ) {
1248
- base.WebApiBase.HandleError(options, config, err);
1249
- reject(err);
1250
- }
1251
- });
1252
- }
1253
-
1254
-
1255
-
1256
- /**
1257
- * Get a reply template from its reply template id
1258
- * @param request - ReplyTemplateId
1259
- * @returns Reply template suitable for preview
1260
- */
1261
- public async getPreviewReplyTemplateAsync(request: carriers.CustomerService_GetPreviewReplyTemplateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreviewReplyTemplate >;
1262
-
1263
- /**
1264
- * Get a reply template from its reply template id
1265
- * @param replyTemplateId - Reply template ID
1266
- * @returns Reply template suitable for preview
1267
- */
1268
- public async getPreviewReplyTemplateAsync(replyTemplateId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreviewReplyTemplate >;
1269
-
1270
- public async getPreviewReplyTemplateAsync(replyTemplateId:number|carriers.CustomerService_GetPreviewReplyTemplateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreviewReplyTemplate > {
1271
- let _request : carriers.CustomerService_GetPreviewReplyTemplateRequest = null;
1272
- let _options : base.WebApiRequestOptions = null;
1273
- const first : any = replyTemplateId;
1274
- if( typeof( first ) === "object" && first && ( typeof(first.replyTemplateId)!='undefined' ) )
1275
- {
1276
- _request = replyTemplateId as carriers.CustomerService_GetPreviewReplyTemplateRequest;
1277
- _options = webapi_options as base.WebApiRequestOptions;
1278
- }
1279
- else
1280
- {
1281
- _request = {
1282
- replyTemplateId: replyTemplateId as number,
1283
- };
1284
- _options = webapi_options;
1285
- }
1286
- return this._getPreviewReplyTemplateAsync( _request, _options );
1287
- }
1288
-
1289
-
1290
- private async _getParsedTemplateAsync(request: carriers.CustomerService_GetParsedTemplateRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ReplyTemplateParsed > {
1291
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1292
- base.WebApiBase.SetPending(options);
1293
- return new Promise< carriers.ReplyTemplateParsed >(async (resolve, reject) => {
1294
- try {
1295
- config.baseURL = this._options.baseUrl;
1296
- const response = await this._axios.post("GetParsedTemplate", request , config);
1297
- base.WebApiBase.SetCompleted(options, response);
1298
- const res : carriers.ReplyTemplateParsed = converters.Create_ReplyTemplateParsed_From( response.data );
1299
- resolve(res);
1300
- }
1301
- catch( err ) {
1302
- base.WebApiBase.HandleError(options, config, err);
1303
- reject(err);
1304
- }
1305
- });
1306
- }
1307
-
1308
-
1309
-
1310
- /**
1311
- * Get a specific langauge version of the reply template, and run this trough the parser
1312
- * @param request - ReplyTemplateId, LanguageId, PersonId, TicketId
1313
- * @returns The parsed reply template
1314
- */
1315
- public async getParsedTemplateAsync(request: carriers.CustomerService_GetParsedTemplateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ReplyTemplateParsed >;
1316
-
1317
- /**
1318
- * Get a specific langauge version of the reply template, and run this trough the parser
1319
- * @param replyTemplateId - The id of the reply template
1320
- * @param languageId - The language id (prefered language). If 0 is given, the language of the person will be used
1321
- * @param personId - The id of the person that will be populated into the parser
1322
- * @param ticketId - The id of the ticket that will be populated into the parser
1323
- * @returns The parsed reply template
1324
- */
1325
- public async getParsedTemplateAsync(replyTemplateId: number, languageId: number, personId: number, ticketId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ReplyTemplateParsed >;
1326
-
1327
- public async getParsedTemplateAsync(replyTemplateId:number|carriers.CustomerService_GetParsedTemplateRequest, languageId?:number|base.WebApiRequestOptions, personId?:number, ticketId?:number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ReplyTemplateParsed > {
1328
- let _request : carriers.CustomerService_GetParsedTemplateRequest = null;
1329
- let _options : base.WebApiRequestOptions = null;
1330
- const first : any = replyTemplateId;
1331
- if( typeof( first ) === "object" && first && ( typeof(first.replyTemplateId)!='undefined' || typeof(first.languageId)!='undefined' || typeof(first.personId)!='undefined' || typeof(first.ticketId)!='undefined' ) )
1332
- {
1333
- _request = replyTemplateId as carriers.CustomerService_GetParsedTemplateRequest;
1334
- _options = languageId as base.WebApiRequestOptions;
1335
- }
1336
- else
1337
- {
1338
- _request = {
1339
- replyTemplateId: replyTemplateId as number,
1340
- languageId: languageId as number,
1341
- personId: personId as number,
1342
- ticketId: ticketId as number,
1343
- };
1344
- _options = webapi_options;
1345
- }
1346
- return this._getParsedTemplateAsync( _request, _options );
1347
- }
1348
-
1349
-
1350
- private async _getUnparsedTemplateAsync(request: carriers.CustomerService_GetUnparsedTemplateRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ReplyTemplateParsed > {
1351
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1352
- base.WebApiBase.SetPending(options);
1353
- return new Promise< carriers.ReplyTemplateParsed >(async (resolve, reject) => {
1354
- try {
1355
- config.baseURL = this._options.baseUrl;
1356
- const response = await this._axios.post("GetUnparsedTemplate", request , config);
1357
- base.WebApiBase.SetCompleted(options, response);
1358
- const res : carriers.ReplyTemplateParsed = converters.Create_ReplyTemplateParsed_From( response.data );
1359
- resolve(res);
1360
- }
1361
- catch( err ) {
1362
- base.WebApiBase.HandleError(options, config, err);
1363
- reject(err);
1364
- }
1365
- });
1366
- }
1367
-
1368
-
1369
-
1370
- /**
1371
- * Get a specific langauge version of the reply template. No parsing is performed.
1372
- * @param request - ReplyTemplateId, LanguageId
1373
- * @returns The unparsed reply template, but using the same return data structure
1374
- */
1375
- public async getUnparsedTemplateAsync(request: carriers.CustomerService_GetUnparsedTemplateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ReplyTemplateParsed >;
1376
-
1377
- /**
1378
- * Get a specific langauge version of the reply template. No parsing is performed.
1379
- * @param replyTemplateId - The id of the reply template
1380
- * @param languageId - The language id (prefered language). If 0 is given, the language of the person will be used
1381
- * @returns The unparsed reply template, but using the same return data structure
1382
- */
1383
- public async getUnparsedTemplateAsync(replyTemplateId: number, languageId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ReplyTemplateParsed >;
1384
-
1385
- public async getUnparsedTemplateAsync(replyTemplateId:number|carriers.CustomerService_GetUnparsedTemplateRequest, languageId?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ReplyTemplateParsed > {
1386
- let _request : carriers.CustomerService_GetUnparsedTemplateRequest = null;
1387
- let _options : base.WebApiRequestOptions = null;
1388
- const first : any = replyTemplateId;
1389
- if( typeof( first ) === "object" && first && ( typeof(first.replyTemplateId)!='undefined' || typeof(first.languageId)!='undefined' ) )
1390
- {
1391
- _request = replyTemplateId as carriers.CustomerService_GetUnparsedTemplateRequest;
1392
- _options = languageId as base.WebApiRequestOptions;
1393
- }
1394
- else
1395
- {
1396
- _request = {
1397
- replyTemplateId: replyTemplateId as number,
1398
- languageId: languageId as number,
1399
- };
1400
- _options = webapi_options;
1401
- }
1402
- return this._getUnparsedTemplateAsync( _request, _options );
1403
- }
1404
-
1405
-
1406
- private async _getSmsConfigAsync( options?:base.WebApiRequestOptions) : Promise< carriers.SmsConfig > {
1407
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1408
- base.WebApiBase.SetPending(options);
1409
- return new Promise< carriers.SmsConfig >(async (resolve, reject) => {
1410
- try {
1411
- config.baseURL = this._options.baseUrl;
1412
- const response = await this._axios.post("GetSmsConfig", undefined , config);
1413
- base.WebApiBase.SetCompleted(options, response);
1414
- const res : carriers.SmsConfig = converters.Create_SmsConfig_From( response.data );
1415
- resolve(res);
1416
- }
1417
- catch( err ) {
1418
- base.WebApiBase.HandleError(options, config, err);
1419
- reject(err);
1420
- }
1421
- });
1422
- }
1423
-
1424
-
1425
- /**
1426
- * Get the SmsConfig settings for Customer Service sms providers.
1427
- * @returns Current SMS configuration.
1428
- */
1429
- public async getSmsConfigAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SmsConfig >
1430
- {
1431
- return this._getSmsConfigAsync(webapi_options);
1432
- }
1433
-
1434
-
1435
- private async _testSmtpServerAsync(request: carriers.CustomerService_TestSmtpServerRequest, options?:base.WebApiRequestOptions) : Promise< carriers.SmtpTestResult > {
1436
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1437
- base.WebApiBase.SetPending(options);
1438
- return new Promise< carriers.SmtpTestResult >(async (resolve, reject) => {
1439
- try {
1440
- config.baseURL = this._options.baseUrl;
1441
- const response = await this._axios.post("TestSmtpServer", request , config);
1442
- base.WebApiBase.SetCompleted(options, response);
1443
- const res : carriers.SmtpTestResult = converters.Create_SmtpTestResult_From( response.data );
1444
- resolve(res);
1445
- }
1446
- catch( err ) {
1447
- base.WebApiBase.HandleError(options, config, err);
1448
- reject(err);
1449
- }
1450
- });
1451
- }
1452
-
1453
-
1454
-
1455
- /**
1456
- * This method will do a test of a SMTP account, by sending an email to a special @superoffice.com account
1457
- * @param request - SmtpUri, From, UseStoredPassword
1458
- * @returns Contains the result of the test
1459
- */
1460
- public async testSmtpServerAsync(request: carriers.CustomerService_TestSmtpServerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SmtpTestResult >;
1461
-
1462
- /**
1463
- * This method will do a test of a SMTP account, by sending an email to a special @superoffice.com account
1464
- * @param smtpUri - An URI containing information to connect to the SMTP server, eg. smtps://myuser:mypassword@smtp.myserver.com:465. Note that username and password must be url encoded
1465
- * @param from - The from-address used in the test
1466
- * @param useStoredPassword - Use database persisted password
1467
- * @returns Contains the result of the test
1468
- */
1469
- public async testSmtpServerAsync(smtpUri: string, from: string, useStoredPassword: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SmtpTestResult >;
1470
-
1471
- public async testSmtpServerAsync(smtpUri:string|carriers.CustomerService_TestSmtpServerRequest, from?:string|base.WebApiRequestOptions, useStoredPassword?:boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SmtpTestResult > {
1472
- let _request : carriers.CustomerService_TestSmtpServerRequest = null;
1473
- let _options : base.WebApiRequestOptions = null;
1474
- const first : any = smtpUri;
1475
- if( typeof( first ) === "object" && first && ( typeof(first.smtpUri)!='undefined' || typeof(first.from)!='undefined' || typeof(first.useStoredPassword)!='undefined' ) )
1476
- {
1477
- _request = smtpUri as carriers.CustomerService_TestSmtpServerRequest;
1478
- _options = from as base.WebApiRequestOptions;
1479
- }
1480
- else
1481
- {
1482
- _request = {
1483
- smtpUri: smtpUri as string,
1484
- from: from as string,
1485
- useStoredPassword: useStoredPassword as boolean,
1486
- };
1487
- _options = webapi_options;
1488
- }
1489
- return this._testSmtpServerAsync( _request, _options );
1490
- }
1491
-
1492
-
1493
- private async _getStatisticsAsync(request: carriers.CustomerService_GetStatisticsRequest, options?:base.WebApiRequestOptions) : Promise< carriers.StatisticsDataSet[] > {
1494
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1495
- base.WebApiBase.SetPending(options);
1496
- return new Promise< carriers.StatisticsDataSet[] >(async (resolve, reject) => {
1497
- try {
1498
- config.baseURL = this._options.baseUrl;
1499
- const response = await this._axios.post("GetStatistics", request , config);
1500
- base.WebApiBase.SetCompleted(options, response);
1501
- const res : carriers.StatisticsDataSet[] = converters.Create_StatisticsDataSetArray_From( response.data );
1502
- resolve(res);
1503
- }
1504
- catch( err ) {
1505
- base.WebApiBase.HandleError(options, config, err);
1506
- reject(err);
1507
- }
1508
- });
1509
- }
1510
-
1511
-
1512
-
1513
- /**
1514
- * Returns the calculated results for the required statistics for the Customer Service Status Page
1515
- * @param request - Functions
1516
- * @returns Array of StatisticsDataSet
1517
- */
1518
- public async getStatisticsAsync(request: carriers.CustomerService_GetStatisticsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StatisticsDataSet[] >;
1519
-
1520
- /**
1521
- * Returns the calculated results for the required statistics for the Customer Service Status Page
1522
- * @param functions - List of functions to calculate and return
1523
- * @returns Array of StatisticsDataSet
1524
- */
1525
- public async getStatisticsAsync(functions: enums.StatusScreenPanelType[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StatisticsDataSet[] >;
1526
-
1527
- public async getStatisticsAsync(functions:enums.StatusScreenPanelType[]|carriers.CustomerService_GetStatisticsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StatisticsDataSet[] > {
1528
- let _request : carriers.CustomerService_GetStatisticsRequest = null;
1529
- let _options : base.WebApiRequestOptions = null;
1530
- const first : any = functions;
1531
- if( typeof( first ) === "object" && first && ( typeof(first.functions)!='undefined' ) )
1532
- {
1533
- _request = functions as carriers.CustomerService_GetStatisticsRequest;
1534
- _options = webapi_options as base.WebApiRequestOptions;
1535
- }
1536
- else
1537
- {
1538
- _request = {
1539
- functions: functions as enums.StatusScreenPanelType[],
1540
- };
1541
- _options = webapi_options;
1542
- }
1543
- return this._getStatisticsAsync( _request, _options );
1544
- }
1545
-
1546
-
1547
- private async _getSystemTemplateSettingsAsync( options?:base.WebApiRequestOptions) : Promise< carriers.SystemTemplateSettings > {
1548
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1549
- base.WebApiBase.SetPending(options);
1550
- return new Promise< carriers.SystemTemplateSettings >(async (resolve, reject) => {
1551
- try {
1552
- config.baseURL = this._options.baseUrl;
1553
- const response = await this._axios.post("GetSystemTemplateSettings", undefined , config);
1554
- base.WebApiBase.SetCompleted(options, response);
1555
- const res : carriers.SystemTemplateSettings = converters.Create_SystemTemplateSettings_From( response.data );
1556
- resolve(res);
1557
- }
1558
- catch( err ) {
1559
- base.WebApiBase.HandleError(options, config, err);
1560
- reject(err);
1561
- }
1562
- });
1563
- }
1564
-
1565
-
1566
- /**
1567
- * Returns system template settings
1568
- * @returns System template settings item
1569
- */
1570
- public async getSystemTemplateSettingsAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SystemTemplateSettings >
1571
- {
1572
- return this._getSystemTemplateSettingsAsync(webapi_options);
1573
- }
1574
-
1575
-
1576
- private async _saveSystemTemplateSettingsAsync(request: carriers.CustomerService_SaveSystemTemplateSettingsRequest, options?:base.WebApiRequestOptions) : Promise< carriers.SystemTemplateSettings > {
1577
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1578
- base.WebApiBase.SetPending(options);
1579
- return new Promise< carriers.SystemTemplateSettings >(async (resolve, reject) => {
1580
- try {
1581
- config.baseURL = this._options.baseUrl;
1582
- const response = await this._axios.post("SaveSystemTemplateSettings", request , config);
1583
- base.WebApiBase.SetCompleted(options, response);
1584
- const res : carriers.SystemTemplateSettings = converters.Create_SystemTemplateSettings_From( response.data );
1585
- resolve(res);
1586
- }
1587
- catch( err ) {
1588
- base.WebApiBase.HandleError(options, config, err);
1589
- reject(err);
1590
- }
1591
- });
1592
- }
1593
-
1594
-
1595
-
1596
- /**
1597
- * Saves and validates updated system templates. Throws exception if validation fails
1598
- * @param request - SystemTemplateSettings
1599
- * @returns Updated system template settings
1600
- */
1601
- public async saveSystemTemplateSettingsAsync(request: carriers.CustomerService_SaveSystemTemplateSettingsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SystemTemplateSettings >;
1602
-
1603
- /**
1604
- * Saves and validates updated system templates. Throws exception if validation fails
1605
- * @param systemTemplateSettings - System template settings item with updated values
1606
- * @returns Updated system template settings
1607
- */
1608
- public async saveSystemTemplateSettingsAsync(systemTemplateSettings: carriers.SystemTemplateSettings, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SystemTemplateSettings >;
1609
-
1610
- public async saveSystemTemplateSettingsAsync(systemTemplateSettings:carriers.SystemTemplateSettings|carriers.CustomerService_SaveSystemTemplateSettingsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SystemTemplateSettings > {
1611
- let _request : carriers.CustomerService_SaveSystemTemplateSettingsRequest = null;
1612
- let _options : base.WebApiRequestOptions = null;
1613
- const first : any = systemTemplateSettings;
1614
- if( typeof( first ) === "object" && first && ( typeof(first.systemTemplateSettings)!='undefined' ) )
1615
- {
1616
- _request = systemTemplateSettings as carriers.CustomerService_SaveSystemTemplateSettingsRequest;
1617
- _options = webapi_options as base.WebApiRequestOptions;
1618
- }
1619
- else
1620
- {
1621
- _request = {
1622
- systemTemplateSettings: systemTemplateSettings as carriers.SystemTemplateSettings,
1623
- };
1624
- _options = webapi_options;
1625
- }
1626
- return this._saveSystemTemplateSettingsAsync( _request, _options );
1627
- }
1628
-
1629
-
1630
- private async _createTicketFromMailDataAsync(request: carriers.CustomerService_CreateTicketFromMailDataRequest, options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo > {
1631
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1632
- base.WebApiBase.SetPending(options);
1633
- return new Promise< carriers.TicketInfo >(async (resolve, reject) => {
1634
- try {
1635
- config.baseURL = this._options.baseUrl;
1636
- const response = await this._axios.post("CreateTicketFromMailData", request , config);
1637
- base.WebApiBase.SetCompleted(options, response);
1638
- const res : carriers.TicketInfo = converters.Create_TicketInfo_From( response.data );
1639
- resolve(res);
1640
- }
1641
- catch( err ) {
1642
- base.WebApiBase.HandleError(options, config, err);
1643
- reject(err);
1644
- }
1645
- });
1646
- }
1647
-
1648
-
1649
-
1650
- /**
1651
- * This method create a new ticket in the same way as importMail would import an email. It accepts RFC822 formatted data
1652
- * @param request - MailboxId, Data
1653
- * @returns An object containing some meta data for the created ticket
1654
- */
1655
- public async createTicketFromMailDataAsync(request: carriers.CustomerService_CreateTicketFromMailDataRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo >;
1656
-
1657
- /**
1658
- * This method create a new ticket in the same way as importMail would import an email. It accepts RFC822 formatted data
1659
- * @param mailboxId - The id of the Service mailbox
1660
- * @param data - RFC822 formatted data to import as a ticket
1661
- * @returns An object containing some meta data for the created ticket
1662
- */
1663
- public async createTicketFromMailDataAsync(mailboxId: number, data: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo >;
1664
-
1665
- public async createTicketFromMailDataAsync(mailboxId:number|carriers.CustomerService_CreateTicketFromMailDataRequest, data?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo > {
1666
- let _request : carriers.CustomerService_CreateTicketFromMailDataRequest = null;
1667
- let _options : base.WebApiRequestOptions = null;
1668
- const first : any = mailboxId;
1669
- if( typeof( first ) === "object" && first && ( typeof(first.mailboxId)!='undefined' || typeof(first.data)!='undefined' ) )
1670
- {
1671
- _request = mailboxId as carriers.CustomerService_CreateTicketFromMailDataRequest;
1672
- _options = data as base.WebApiRequestOptions;
1673
- }
1674
- else
1675
- {
1676
- _request = {
1677
- mailboxId: mailboxId as number,
1678
- data: data as string,
1679
- };
1680
- _options = webapi_options;
1681
- }
1682
- return this._createTicketFromMailDataAsync( _request, _options );
1683
- }
1684
-
1685
-
1686
- private async _addMessageFromMailDataAsync(request: carriers.CustomerService_AddMessageFromMailDataRequest, options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo > {
1687
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1688
- base.WebApiBase.SetPending(options);
1689
- return new Promise< carriers.TicketInfo >(async (resolve, reject) => {
1690
- try {
1691
- config.baseURL = this._options.baseUrl;
1692
- const response = await this._axios.post("AddMessageFromMailData", request , config);
1693
- base.WebApiBase.SetCompleted(options, response);
1694
- const res : carriers.TicketInfo = converters.Create_TicketInfo_From( response.data );
1695
- resolve(res);
1696
- }
1697
- catch( err ) {
1698
- base.WebApiBase.HandleError(options, config, err);
1699
- reject(err);
1700
- }
1701
- });
1702
- }
1703
-
1704
-
1705
-
1706
- /**
1707
- * This method will add a message to an existing request in the sam way as importMail would do it from an email. It accepts RFC822 formatted data
1708
- * @param request - TicketId, Data
1709
- * @returns An object containing some meta data for the ticket
1710
- */
1711
- public async addMessageFromMailDataAsync(request: carriers.CustomerService_AddMessageFromMailDataRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo >;
1712
-
1713
- /**
1714
- * This method will add a message to an existing request in the sam way as importMail would do it from an email. It accepts RFC822 formatted data
1715
- * @param ticketId - The id of the ticket to add a message
1716
- * @param data - RFC822 formatted data to import as a message
1717
- * @returns An object containing some meta data for the ticket
1718
- */
1719
- public async addMessageFromMailDataAsync(ticketId: number, data: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo >;
1720
-
1721
- public async addMessageFromMailDataAsync(ticketId:number|carriers.CustomerService_AddMessageFromMailDataRequest, data?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo > {
1722
- let _request : carriers.CustomerService_AddMessageFromMailDataRequest = null;
1723
- let _options : base.WebApiRequestOptions = null;
1724
- const first : any = ticketId;
1725
- if( typeof( first ) === "object" && first && ( typeof(first.ticketId)!='undefined' || typeof(first.data)!='undefined' ) )
1726
- {
1727
- _request = ticketId as carriers.CustomerService_AddMessageFromMailDataRequest;
1728
- _options = data as base.WebApiRequestOptions;
1729
- }
1730
- else
1731
- {
1732
- _request = {
1733
- ticketId: ticketId as number,
1734
- data: data as string,
1735
- };
1736
- _options = webapi_options;
1737
- }
1738
- return this._addMessageFromMailDataAsync( _request, _options );
1739
- }
1740
-
1741
-
1742
- private async _findTicketsByTitleOrIdAsync(request: carriers.CustomerService_FindTicketsByTitleOrIdRequest, options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo[] > {
1743
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1744
- base.WebApiBase.SetPending(options);
1745
- return new Promise< carriers.TicketInfo[] >(async (resolve, reject) => {
1746
- try {
1747
- config.baseURL = this._options.baseUrl;
1748
- const response = await this._axios.post("FindTicketsByTitleOrId", request , config);
1749
- base.WebApiBase.SetCompleted(options, response);
1750
- const res : carriers.TicketInfo[] = converters.Create_TicketInfoArray_From( response.data );
1751
- resolve(res);
1752
- }
1753
- catch( err ) {
1754
- base.WebApiBase.HandleError(options, config, err);
1755
- reject(err);
1756
- }
1757
- });
1758
- }
1759
-
1760
-
1761
-
1762
- /**
1763
- * This method wil search for tickets matching title or id
1764
- * @param request - TitleOrId, MaxRows
1765
- * @returns An array of objects containing some meta data for matching tickets
1766
- */
1767
- public async findTicketsByTitleOrIdAsync(request: carriers.CustomerService_FindTicketsByTitleOrIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo[] >;
1768
-
1769
- /**
1770
- * This method wil search for tickets matching title or id
1771
- * @param titleOrId - The search string. If this is a number, it will also search for a matching ticket id
1772
- * @param maxRows - The maximum number of rows to be returned
1773
- * @returns An array of objects containing some meta data for matching tickets
1774
- */
1775
- public async findTicketsByTitleOrIdAsync(titleOrId: string, maxRows: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo[] >;
1776
-
1777
- public async findTicketsByTitleOrIdAsync(titleOrId:string|carriers.CustomerService_FindTicketsByTitleOrIdRequest, maxRows?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo[] > {
1778
- let _request : carriers.CustomerService_FindTicketsByTitleOrIdRequest = null;
1779
- let _options : base.WebApiRequestOptions = null;
1780
- const first : any = titleOrId;
1781
- if( typeof( first ) === "object" && first && ( typeof(first.titleOrId)!='undefined' || typeof(first.maxRows)!='undefined' ) )
1782
- {
1783
- _request = titleOrId as carriers.CustomerService_FindTicketsByTitleOrIdRequest;
1784
- _options = maxRows as base.WebApiRequestOptions;
1785
- }
1786
- else
1787
- {
1788
- _request = {
1789
- titleOrId: titleOrId as string,
1790
- maxRows: maxRows as number,
1791
- };
1792
- _options = webapi_options;
1793
- }
1794
- return this._findTicketsByTitleOrIdAsync( _request, _options );
1795
- }
1796
-
1797
- } // class v1CustomerServiceAgentController
1798
-
1799
-
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/CustomerServiceAgent.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
+ * Agent used for Customer Service methods
28
+ */
29
+ export interface ICustomerServiceAgent {
30
+ createDefaultCustomerCenterConfigAsync(): Promise< carriers.CustomerCenterConfig >;
31
+ saveCustomerCenterConfigAsync(entity: carriers.CustomerCenterConfig) : Promise< carriers.CustomerCenterConfig >;
32
+ deleteCustomerCenterConfigAsync(CustomerCenterConfigId: number) : Promise<void>;
33
+ createDefaultMailboxEntityAsync(): Promise< carriers.MailboxEntity >;
34
+ saveMailboxEntityAsync(entity: carriers.MailboxEntity) : Promise< carriers.MailboxEntity >;
35
+ updateFeatureTogglesAsync(request: carriers.CustomerService_UpdateFeatureTogglesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
36
+ updateFeatureTogglesAsync(featureToggles: carriers.CsFeatureToggle[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
37
+ eventHandlerExistsAsync(request: carriers.CustomerService_EventHandlerExistsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
38
+ eventHandlerExistsAsync(eventHandlerType: enums.EventHandlerType, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
39
+ eventHandlersExistsAsync(request: carriers.CustomerService_EventHandlersExistsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< enums.EventHandlerType[] >;
40
+ eventHandlersExistsAsync(eventHandlerTypes: enums.EventHandlerType[], webapi_options?:base.WebApiRequestOptions) : Promise< enums.EventHandlerType[] >;
41
+ createSessionAsync(request: carriers.CustomerService_CreateSessionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CsSessionKey >;
42
+ createSessionAsync(remoteIp: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CsSessionKey >;
43
+ removeSessionAsync(request: carriers.CustomerService_RemoveSessionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
44
+ removeSessionAsync(loginId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
45
+ sessionIsValidAsync(request: carriers.CustomerService_SessionIsValidRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
46
+ sessionIsValidAsync(csSessionKey: string, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
47
+ hasChatNotifyAsync(webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
48
+ checkSymmetricEncryptionAsync(request: carriers.CustomerService_CheckSymmetricEncryptionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
49
+ checkSymmetricEncryptionAsync(encryptedString: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
50
+ reportSessionActiveAsync(request: carriers.CustomerService_ReportSessionActiveRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
51
+ reportSessionActiveAsync(sessionKey: string, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
52
+ getCustomerCenterConfigAsync(customerCenterConfigId: number) : Promise< carriers.CustomerCenterConfig >;
53
+ getAllCustomerCenterConfigsAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CustomerCenterConfig[] >;
54
+ saveAllCustomerCenterConfigsAsync(request: carriers.CustomerService_SaveAllCustomerCenterConfigsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
55
+ saveAllCustomerCenterConfigsAsync(custConfigs: carriers.CustomerCenterConfig[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
56
+ checkIfCustomizedTemplatesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
57
+ getProgramUrlAsync(request: carriers.CustomerService_GetProgramUrlRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
58
+ getProgramUrlAsync(programName: string, external: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
59
+ getFaqForCustomerAsync(request: carriers.CustomerService_GetFaqForCustomerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
60
+ getFaqForCustomerAsync(faqEntryId: number, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
61
+ getCustomerServiceStartupAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CustomerServiceStartup >;
62
+ getCustomerServiceStartupByOwnerAsync(request: carriers.CustomerService_GetCustomerServiceStartupByOwnerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CustomerServiceStartup >;
63
+ getCustomerServiceStartupByOwnerAsync(userId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CustomerServiceStartup >;
64
+ executeEventHandlersAsync(request: carriers.CustomerService_ExecuteEventHandlersRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EventData >;
65
+ executeEventHandlersAsync(eventData: carriers.EventData, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EventData >;
66
+ getMailboxesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Mailbox[] >;
67
+ getMailboxEntityAsync(mailboxEntityId: number) : Promise< carriers.MailboxEntity >;
68
+ getPreviewFaqEntryAsync(request: carriers.CustomerService_GetPreviewFaqEntryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreviewFaqEntry >;
69
+ getPreviewFaqEntryAsync(kbEntryId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreviewFaqEntry >;
70
+ getPreviewQuickReplyAsync(request: carriers.CustomerService_GetPreviewQuickReplyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreviewQuickReply >;
71
+ getPreviewQuickReplyAsync(quickReplyId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreviewQuickReply >;
72
+ getPreviewReplyTemplateAsync(request: carriers.CustomerService_GetPreviewReplyTemplateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreviewReplyTemplate >;
73
+ getPreviewReplyTemplateAsync(replyTemplateId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreviewReplyTemplate >;
74
+ getParsedTemplateAsync(request: carriers.CustomerService_GetParsedTemplateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ReplyTemplateParsed >;
75
+ getParsedTemplateAsync(replyTemplateId: number, languageId: number, personId: number, ticketId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ReplyTemplateParsed >;
76
+ getUnparsedTemplateAsync(request: carriers.CustomerService_GetUnparsedTemplateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ReplyTemplateParsed >;
77
+ getUnparsedTemplateAsync(replyTemplateId: number, languageId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ReplyTemplateParsed >;
78
+ getSmsConfigAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SmsConfig >;
79
+ testSmtpServerAsync(request: carriers.CustomerService_TestSmtpServerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SmtpTestResult >;
80
+ testSmtpServerAsync(smtpUri: string, from: string, useStoredPassword: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SmtpTestResult >;
81
+ getStatisticsAsync(request: carriers.CustomerService_GetStatisticsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StatisticsDataSet[] >;
82
+ getStatisticsAsync(functions: enums.StatusScreenPanelType[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StatisticsDataSet[] >;
83
+ getSystemTemplateSettingsAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SystemTemplateSettings >;
84
+ saveSystemTemplateSettingsAsync(request: carriers.CustomerService_SaveSystemTemplateSettingsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SystemTemplateSettings >;
85
+ saveSystemTemplateSettingsAsync(systemTemplateSettings: carriers.SystemTemplateSettings, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SystemTemplateSettings >;
86
+ createTicketFromMailDataAsync(request: carriers.CustomerService_CreateTicketFromMailDataRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo >;
87
+ createTicketFromMailDataAsync(mailboxId: number, data: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo >;
88
+ addMessageFromMailDataAsync(request: carriers.CustomerService_AddMessageFromMailDataRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo >;
89
+ addMessageFromMailDataAsync(ticketId: number, data: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo >;
90
+ findTicketsByTitleOrIdAsync(request: carriers.CustomerService_FindTicketsByTitleOrIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo[] >;
91
+ findTicketsByTitleOrIdAsync(titleOrId: string, maxRows: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo[] >;
92
+ } // interface ICustomerServiceAgent
93
+
94
+
95
+
96
+
97
+ /**
98
+ * Agent used for Customer Service methods
99
+ */
100
+ export class CustomerServiceAgent extends base.WebApiBase implements ICustomerServiceAgent {
101
+ constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
102
+ constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
103
+ constructor(baseUrl: string, resourceManager:any);
104
+ constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
105
+ constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
106
+ constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
107
+ constructor(options: base.WebApiOptions);
108
+
109
+ constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
110
+ langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
111
+ langOrResourceOrRM?:string|base.ResourceParsing|any,
112
+ cultureCode?: string,
113
+ ) {
114
+ const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
115
+ options.basePath = "v1/Agents/CustomerService/";
116
+ super(options);
117
+ }
118
+
119
+
120
+
121
+ /**
122
+ * Set default values into a new CustomerCenterConfig.
123
+ * NetServer calculates default values on the entity, which is required when creating/storing a new instance
124
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
125
+ * @returns A blank entity.
126
+ */
127
+ public async createDefaultCustomerCenterConfigAsync(options?:base.WebApiRequestOptions) : Promise< carriers.CustomerCenterConfig > {
128
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
129
+ base.WebApiBase.SetPending(options);
130
+ return new Promise< carriers.CustomerCenterConfig >(async (resolve, reject) => {
131
+ try {
132
+ const response = await this._axios.post("CreateDefaultCustomerCenterConfig", null, config);
133
+ base.WebApiBase.SetCompleted(options, response);
134
+ const res : carriers.CustomerCenterConfig = converters.Create_CustomerCenterConfig_From( response.data );
135
+ resolve(res);
136
+ }
137
+ catch( err ) {
138
+ base.WebApiBase.HandleError(options, config, err);
139
+ reject(err);
140
+ }
141
+ });
142
+ }
143
+ /**
144
+ * Replace the existing CustomerCenterConfig or creates a new CustomerCenterConfig if the id parameter is empty
145
+ * @param entity - The CustomerCenterConfig to be saved.
146
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
147
+ * @returns New or updated CustomerCenterConfig
148
+ */
149
+ public async saveCustomerCenterConfigAsync(entity: carriers.CustomerCenterConfig, options?:base.WebApiRequestOptions) : Promise< carriers.CustomerCenterConfig > {
150
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
151
+ base.WebApiBase.SetPending(options);
152
+ return new Promise< carriers.CustomerCenterConfig >(async (resolve, reject) => {
153
+ try {
154
+ const response = await this._axios.post("SaveCustomerCenterConfig", entity, config);
155
+ base.WebApiBase.SetCompleted(options, response);
156
+ const res : carriers.CustomerCenterConfig = converters.Create_CustomerCenterConfig_From( response.data );
157
+ resolve(res);
158
+ }
159
+ catch( err ) {
160
+ base.WebApiBase.HandleError(options, config, err);
161
+ reject(err);
162
+ }
163
+ });
164
+ }
165
+
166
+ /**
167
+ * Deletes the CustomerCenterConfig
168
+ * @param CustomerCenterConfigId - The id of the CustomerCenterConfig to be deleted.
169
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
170
+ */
171
+ public async deleteCustomerCenterConfigAsync(CustomerCenterConfigId: number, options?:base.WebApiRequestOptions) : Promise< void > {
172
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
173
+ base.WebApiBase.SetPending(options);
174
+ return new Promise< void >(async (resolve, reject) => {
175
+ try {
176
+ const response = await this._axios.post("DeleteCustomerCenterConfig?CustomerCenterConfigId=" + CustomerCenterConfigId, null, config );
177
+ base.WebApiBase.SetCompleted(options, response);
178
+ const res = response.data;
179
+ resolve(res);
180
+ }
181
+ catch( err ) {
182
+ base.WebApiBase.HandleError(options, config, err);
183
+ reject(err);
184
+ }
185
+ });
186
+ }
187
+
188
+ /**
189
+ * Set default values into a new MailboxEntity.
190
+ * NetServer calculates default values on the entity, which is required when creating/storing a new instance
191
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
192
+ * @returns A blank entity.
193
+ */
194
+ public async createDefaultMailboxEntityAsync(options?:base.WebApiRequestOptions) : Promise< carriers.MailboxEntity > {
195
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
196
+ base.WebApiBase.SetPending(options);
197
+ return new Promise< carriers.MailboxEntity >(async (resolve, reject) => {
198
+ try {
199
+ const response = await this._axios.post("CreateDefaultMailboxEntity", null, config);
200
+ base.WebApiBase.SetCompleted(options, response);
201
+ const res : carriers.MailboxEntity = converters.Create_MailboxEntity_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
+ * Replace the existing MailboxEntity or creates a new MailboxEntity if the id parameter is empty
212
+ * @param entity - The MailboxEntity to be saved.
213
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
214
+ * @returns New or updated MailboxEntity
215
+ */
216
+ public async saveMailboxEntityAsync(entity: carriers.MailboxEntity, options?:base.WebApiRequestOptions) : Promise< carriers.MailboxEntity > {
217
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
218
+ base.WebApiBase.SetPending(options);
219
+ return new Promise< carriers.MailboxEntity >(async (resolve, reject) => {
220
+ try {
221
+ const response = await this._axios.post("SaveMailboxEntity", entity, config);
222
+ base.WebApiBase.SetCompleted(options, response);
223
+ const res : carriers.MailboxEntity = converters.Create_MailboxEntity_From( response.data );
224
+ resolve(res);
225
+ }
226
+ catch( err ) {
227
+ base.WebApiBase.HandleError(options, config, err);
228
+ reject(err);
229
+ }
230
+ });
231
+ }
232
+
233
+ private async _updateFeatureTogglesAsync(request: carriers.CustomerService_UpdateFeatureTogglesRequest, options?:base.WebApiRequestOptions) : Promise< void > {
234
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
235
+ base.WebApiBase.SetPending(options);
236
+ return new Promise< void >(async (resolve, reject) => {
237
+ try {
238
+ config.baseURL = this._options.baseUrl;
239
+ const response = await this._axios.post("UpdateFeatureToggles", request , config);
240
+ base.WebApiBase.SetCompleted(options, response);
241
+ const res = response.data;
242
+ resolve(res);
243
+ }
244
+ catch( err ) {
245
+ base.WebApiBase.HandleError(options, config, err);
246
+ reject(err);
247
+ }
248
+ });
249
+ }
250
+
251
+
252
+
253
+ /**
254
+ * Update the cached FeatureToggles for CS
255
+ * @param request - FeatureToggles
256
+ * @returns
257
+ */
258
+ public async updateFeatureTogglesAsync(request: carriers.CustomerService_UpdateFeatureTogglesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
259
+
260
+ /**
261
+ * Update the cached FeatureToggles for CS
262
+ * @param featureToggles - Feature toggle name / state
263
+ * @returns
264
+ */
265
+ public async updateFeatureTogglesAsync(featureToggles: carriers.CsFeatureToggle[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
266
+
267
+ public async updateFeatureTogglesAsync(featureToggles:carriers.CsFeatureToggle[]|carriers.CustomerService_UpdateFeatureTogglesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
268
+ let _request : carriers.CustomerService_UpdateFeatureTogglesRequest = null;
269
+ let _options : base.WebApiRequestOptions = null;
270
+ const first : any = featureToggles;
271
+ if( typeof( first ) === "object" && first && ( typeof(first.featureToggles)!='undefined' ) )
272
+ {
273
+ _request = featureToggles as carriers.CustomerService_UpdateFeatureTogglesRequest;
274
+ _options = webapi_options as base.WebApiRequestOptions;
275
+ }
276
+ else
277
+ {
278
+ _request = {
279
+ featureToggles: featureToggles as carriers.CsFeatureToggle[],
280
+ };
281
+ _options = webapi_options;
282
+ }
283
+ return this._updateFeatureTogglesAsync( _request, _options );
284
+ }
285
+
286
+
287
+ private async _eventHandlerExistsAsync(request: carriers.CustomerService_EventHandlerExistsRequest, options?:base.WebApiRequestOptions) : Promise< boolean > {
288
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
289
+ base.WebApiBase.SetPending(options);
290
+ return new Promise< boolean >(async (resolve, reject) => {
291
+ try {
292
+ config.baseURL = this._options.baseUrl;
293
+ const response = await this._axios.post("EventHandlerExists", request , config);
294
+ base.WebApiBase.SetCompleted(options, response);
295
+ const res : boolean = response.data as boolean;
296
+ resolve(res);
297
+ }
298
+ catch( err ) {
299
+ base.WebApiBase.HandleError(options, config, err);
300
+ reject(err);
301
+ }
302
+ });
303
+ }
304
+
305
+
306
+
307
+ /**
308
+ * Check if an eventhandler exists for a given enum
309
+ * @param request - EventHandlerType
310
+ * @returns True if it exists
311
+ */
312
+ public async eventHandlerExistsAsync(request: carriers.CustomerService_EventHandlerExistsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
313
+
314
+ /**
315
+ * Check if an eventhandler exists for a given enum
316
+ * @param eventHandlerType - The EventHandlerType we are checking
317
+ * @returns True if it exists
318
+ */
319
+ public async eventHandlerExistsAsync(eventHandlerType: enums.EventHandlerType, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
320
+
321
+ public async eventHandlerExistsAsync(eventHandlerType:enums.EventHandlerType|carriers.CustomerService_EventHandlerExistsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean > {
322
+ let _request : carriers.CustomerService_EventHandlerExistsRequest = null;
323
+ let _options : base.WebApiRequestOptions = null;
324
+ const first : any = eventHandlerType;
325
+ if( typeof( first ) === "object" && first && ( typeof(first.eventHandlerType)!='undefined' ) )
326
+ {
327
+ _request = eventHandlerType as carriers.CustomerService_EventHandlerExistsRequest;
328
+ _options = webapi_options as base.WebApiRequestOptions;
329
+ }
330
+ else
331
+ {
332
+ _request = {
333
+ eventHandlerType: eventHandlerType as enums.EventHandlerType,
334
+ };
335
+ _options = webapi_options;
336
+ }
337
+ return this._eventHandlerExistsAsync( _request, _options );
338
+ }
339
+
340
+
341
+ private async _eventHandlersExistsAsync(request: carriers.CustomerService_EventHandlersExistsRequest, options?:base.WebApiRequestOptions) : Promise< enums.EventHandlerType[] > {
342
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
343
+ base.WebApiBase.SetPending(options);
344
+ return new Promise< enums.EventHandlerType[] >(async (resolve, reject) => {
345
+ try {
346
+ config.baseURL = this._options.baseUrl;
347
+ const response = await this._axios.post("EventHandlersExists", request , config);
348
+ base.WebApiBase.SetCompleted(options, response);
349
+ const res : enums.EventHandlerType[] = response.data as enums.EventHandlerType[];
350
+ resolve(res);
351
+ }
352
+ catch( err ) {
353
+ base.WebApiBase.HandleError(options, config, err);
354
+ reject(err);
355
+ }
356
+ });
357
+ }
358
+
359
+
360
+
361
+ /**
362
+ * Check if any given eventhandler exists
363
+ * @param request - EventHandlerTypes
364
+ * @returns The existing event handlers
365
+ */
366
+ public async eventHandlersExistsAsync(request: carriers.CustomerService_EventHandlersExistsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< enums.EventHandlerType[] >;
367
+
368
+ /**
369
+ * Check if any given eventhandler exists
370
+ * @param eventHandlerTypes - The EventHandlerTypes we are checking
371
+ * @returns The existing event handlers
372
+ */
373
+ public async eventHandlersExistsAsync(eventHandlerTypes: enums.EventHandlerType[], webapi_options?:base.WebApiRequestOptions) : Promise< enums.EventHandlerType[] >;
374
+
375
+ public async eventHandlersExistsAsync(eventHandlerTypes:enums.EventHandlerType[]|carriers.CustomerService_EventHandlersExistsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< enums.EventHandlerType[] > {
376
+ let _request : carriers.CustomerService_EventHandlersExistsRequest = null;
377
+ let _options : base.WebApiRequestOptions = null;
378
+ const first : any = eventHandlerTypes;
379
+ if( typeof( first ) === "object" && first && ( typeof(first.eventHandlerTypes)!='undefined' ) )
380
+ {
381
+ _request = eventHandlerTypes as carriers.CustomerService_EventHandlersExistsRequest;
382
+ _options = webapi_options as base.WebApiRequestOptions;
383
+ }
384
+ else
385
+ {
386
+ _request = {
387
+ eventHandlerTypes: eventHandlerTypes as enums.EventHandlerType[],
388
+ };
389
+ _options = webapi_options;
390
+ }
391
+ return this._eventHandlersExistsAsync( _request, _options );
392
+ }
393
+
394
+
395
+ private async _createSessionAsync(request: carriers.CustomerService_CreateSessionRequest, options?:base.WebApiRequestOptions) : Promise< carriers.CsSessionKey > {
396
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
397
+ base.WebApiBase.SetPending(options);
398
+ return new Promise< carriers.CsSessionKey >(async (resolve, reject) => {
399
+ try {
400
+ config.baseURL = this._options.baseUrl;
401
+ const response = await this._axios.post("CreateSession", request , config);
402
+ base.WebApiBase.SetCompleted(options, response);
403
+ const res : carriers.CsSessionKey = converters.Create_CsSessionKey_From( response.data );
404
+ resolve(res);
405
+ }
406
+ catch( err ) {
407
+ base.WebApiBase.HandleError(options, config, err);
408
+ reject(err);
409
+ }
410
+ });
411
+ }
412
+
413
+
414
+
415
+ /**
416
+ * Creates a login session for a CS user
417
+ * @param request - RemoteIp
418
+ * @returns The session key information
419
+ */
420
+ public async createSessionAsync(request: carriers.CustomerService_CreateSessionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CsSessionKey >;
421
+
422
+ /**
423
+ * Creates a login session for a CS user
424
+ * @param remoteIp - The ip of the client creating the session
425
+ * @returns The session key information
426
+ */
427
+ public async createSessionAsync(remoteIp: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CsSessionKey >;
428
+
429
+ public async createSessionAsync(remoteIp:string|carriers.CustomerService_CreateSessionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CsSessionKey > {
430
+ let _request : carriers.CustomerService_CreateSessionRequest = null;
431
+ let _options : base.WebApiRequestOptions = null;
432
+ const first : any = remoteIp;
433
+ if( typeof( first ) === "object" && first && ( typeof(first.remoteIp)!='undefined' ) )
434
+ {
435
+ _request = remoteIp as carriers.CustomerService_CreateSessionRequest;
436
+ _options = webapi_options as base.WebApiRequestOptions;
437
+ }
438
+ else
439
+ {
440
+ _request = {
441
+ remoteIp: remoteIp as string,
442
+ };
443
+ _options = webapi_options;
444
+ }
445
+ return this._createSessionAsync( _request, _options );
446
+ }
447
+
448
+
449
+ private async _removeSessionAsync(request: carriers.CustomerService_RemoveSessionRequest, options?:base.WebApiRequestOptions) : Promise< void > {
450
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
451
+ base.WebApiBase.SetPending(options);
452
+ return new Promise< void >(async (resolve, reject) => {
453
+ try {
454
+ config.baseURL = this._options.baseUrl;
455
+ const response = await this._axios.post("RemoveSession", request , config);
456
+ base.WebApiBase.SetCompleted(options, response);
457
+ const res = response.data;
458
+ resolve(res);
459
+ }
460
+ catch( err ) {
461
+ base.WebApiBase.HandleError(options, config, err);
462
+ reject(err);
463
+ }
464
+ });
465
+ }
466
+
467
+
468
+
469
+ /**
470
+ * Remove a login session for a CS user
471
+ * @param request - LoginId
472
+ * @returns
473
+ */
474
+ public async removeSessionAsync(request: carriers.CustomerService_RemoveSessionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
475
+
476
+ /**
477
+ * Remove a login session for a CS user
478
+ * @param loginId - The login id to remove
479
+ * @returns
480
+ */
481
+ public async removeSessionAsync(loginId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
482
+
483
+ public async removeSessionAsync(loginId:number|carriers.CustomerService_RemoveSessionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
484
+ let _request : carriers.CustomerService_RemoveSessionRequest = null;
485
+ let _options : base.WebApiRequestOptions = null;
486
+ const first : any = loginId;
487
+ if( typeof( first ) === "object" && first && ( typeof(first.loginId)!='undefined' ) )
488
+ {
489
+ _request = loginId as carriers.CustomerService_RemoveSessionRequest;
490
+ _options = webapi_options as base.WebApiRequestOptions;
491
+ }
492
+ else
493
+ {
494
+ _request = {
495
+ loginId: loginId as number,
496
+ };
497
+ _options = webapi_options;
498
+ }
499
+ return this._removeSessionAsync( _request, _options );
500
+ }
501
+
502
+
503
+ private async _sessionIsValidAsync(request: carriers.CustomerService_SessionIsValidRequest, options?:base.WebApiRequestOptions) : Promise< boolean > {
504
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
505
+ base.WebApiBase.SetPending(options);
506
+ return new Promise< boolean >(async (resolve, reject) => {
507
+ try {
508
+ config.baseURL = this._options.baseUrl;
509
+ const response = await this._axios.post("SessionIsValid", request , config);
510
+ base.WebApiBase.SetCompleted(options, response);
511
+ const res : boolean = response.data as boolean;
512
+ resolve(res);
513
+ }
514
+ catch( err ) {
515
+ base.WebApiBase.HandleError(options, config, err);
516
+ reject(err);
517
+ }
518
+ });
519
+ }
520
+
521
+
522
+
523
+ /**
524
+ * Check if a CS session is valid
525
+ * @param request - CsSessionKey
526
+ * @returns True if there is a valid CS session based on the session key
527
+ */
528
+ public async sessionIsValidAsync(request: carriers.CustomerService_SessionIsValidRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
529
+
530
+ /**
531
+ * Check if a CS session is valid
532
+ * @param csSessionKey - The CS session key to check
533
+ * @returns True if there is a valid CS session based on the session key
534
+ */
535
+ public async sessionIsValidAsync(csSessionKey: string, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
536
+
537
+ public async sessionIsValidAsync(csSessionKey:string|carriers.CustomerService_SessionIsValidRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean > {
538
+ let _request : carriers.CustomerService_SessionIsValidRequest = null;
539
+ let _options : base.WebApiRequestOptions = null;
540
+ const first : any = csSessionKey;
541
+ if( typeof( first ) === "object" && first && ( typeof(first.csSessionKey)!='undefined' ) )
542
+ {
543
+ _request = csSessionKey as carriers.CustomerService_SessionIsValidRequest;
544
+ _options = webapi_options as base.WebApiRequestOptions;
545
+ }
546
+ else
547
+ {
548
+ _request = {
549
+ csSessionKey: csSessionKey as string,
550
+ };
551
+ _options = webapi_options;
552
+ }
553
+ return this._sessionIsValidAsync( _request, _options );
554
+ }
555
+
556
+
557
+ private async _hasChatNotifyAsync( options?:base.WebApiRequestOptions) : Promise< boolean > {
558
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
559
+ base.WebApiBase.SetPending(options);
560
+ return new Promise< boolean >(async (resolve, reject) => {
561
+ try {
562
+ config.baseURL = this._options.baseUrl;
563
+ const response = await this._axios.post("HasChatNotify", undefined , config);
564
+ base.WebApiBase.SetCompleted(options, response);
565
+ const res : boolean = response.data as boolean;
566
+ resolve(res);
567
+ }
568
+ catch( err ) {
569
+ base.WebApiBase.HandleError(options, config, err);
570
+ reject(err);
571
+ }
572
+ });
573
+ }
574
+
575
+
576
+ /**
577
+ * Check if user has any chat notification
578
+ * @returns True if the user has at least one notification setting on
579
+ */
580
+ public async hasChatNotifyAsync(webapi_options?:base.WebApiRequestOptions) : Promise< boolean >
581
+ {
582
+ return this._hasChatNotifyAsync(webapi_options);
583
+ }
584
+
585
+
586
+ private async _checkSymmetricEncryptionAsync(request: carriers.CustomerService_CheckSymmetricEncryptionRequest, options?:base.WebApiRequestOptions) : Promise< string > {
587
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
588
+ base.WebApiBase.SetPending(options);
589
+ return new Promise< string >(async (resolve, reject) => {
590
+ try {
591
+ config.baseURL = this._options.baseUrl;
592
+ const response = await this._axios.post("CheckSymmetricEncryption", request , config);
593
+ base.WebApiBase.SetCompleted(options, response);
594
+ const res : string = response.data as string;
595
+ resolve(res);
596
+ }
597
+ catch( err ) {
598
+ base.WebApiBase.HandleError(options, config, err);
599
+ reject(err);
600
+ }
601
+ });
602
+ }
603
+
604
+
605
+
606
+ /**
607
+ * Do a test to check that we are using the same encryption keys
608
+ * @param request - EncryptedString
609
+ * @returns Encrypted version of the string done by NetServer
610
+ */
611
+ public async checkSymmetricEncryptionAsync(request: carriers.CustomerService_CheckSymmetricEncryptionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
612
+
613
+ /**
614
+ * Do a test to check that we are using the same encryption keys
615
+ * @param encryptedString - An encrypted version of the string
616
+ * @returns Encrypted version of the string done by NetServer
617
+ */
618
+ public async checkSymmetricEncryptionAsync(encryptedString: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
619
+
620
+ public async checkSymmetricEncryptionAsync(encryptedString:string|carriers.CustomerService_CheckSymmetricEncryptionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
621
+ let _request : carriers.CustomerService_CheckSymmetricEncryptionRequest = null;
622
+ let _options : base.WebApiRequestOptions = null;
623
+ const first : any = encryptedString;
624
+ if( typeof( first ) === "object" && first && ( typeof(first.encryptedString)!='undefined' ) )
625
+ {
626
+ _request = encryptedString as carriers.CustomerService_CheckSymmetricEncryptionRequest;
627
+ _options = webapi_options as base.WebApiRequestOptions;
628
+ }
629
+ else
630
+ {
631
+ _request = {
632
+ encryptedString: encryptedString as string,
633
+ };
634
+ _options = webapi_options;
635
+ }
636
+ return this._checkSymmetricEncryptionAsync( _request, _options );
637
+ }
638
+
639
+
640
+ private async _reportSessionActiveAsync(request: carriers.CustomerService_ReportSessionActiveRequest, options?:base.WebApiRequestOptions) : Promise< number > {
641
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
642
+ base.WebApiBase.SetPending(options);
643
+ return new Promise< number >(async (resolve, reject) => {
644
+ try {
645
+ config.baseURL = this._options.baseUrl;
646
+ const response = await this._axios.post("ReportSessionActive", request , config);
647
+ base.WebApiBase.SetCompleted(options, response);
648
+ const res : number = response.data as number;
649
+ resolve(res);
650
+ }
651
+ catch( err ) {
652
+ base.WebApiBase.HandleError(options, config, err);
653
+ reject(err);
654
+ }
655
+ });
656
+ }
657
+
658
+
659
+
660
+ /**
661
+ * Report a session as being &apos;active&apos;; will update the corresponding row in login table, but not more than once per minute/session
662
+ * @param request - SessionKey
663
+ * @returns The ID of the login table row, or 0 if not found
664
+ */
665
+ public async reportSessionActiveAsync(request: carriers.CustomerService_ReportSessionActiveRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
666
+
667
+ /**
668
+ * Report a session as being &apos;active&apos;; will update the corresponding row in login table, but not more than once per minute/session
669
+ * @param sessionKey - CS session key, matching the 'login' table
670
+ * @returns The ID of the login table row, or 0 if not found
671
+ */
672
+ public async reportSessionActiveAsync(sessionKey: string, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
673
+
674
+ public async reportSessionActiveAsync(sessionKey:string|carriers.CustomerService_ReportSessionActiveRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number > {
675
+ let _request : carriers.CustomerService_ReportSessionActiveRequest = null;
676
+ let _options : base.WebApiRequestOptions = null;
677
+ const first : any = sessionKey;
678
+ if( typeof( first ) === "object" && first && ( typeof(first.sessionKey)!='undefined' ) )
679
+ {
680
+ _request = sessionKey as carriers.CustomerService_ReportSessionActiveRequest;
681
+ _options = webapi_options as base.WebApiRequestOptions;
682
+ }
683
+ else
684
+ {
685
+ _request = {
686
+ sessionKey: sessionKey as string,
687
+ };
688
+ _options = webapi_options;
689
+ }
690
+ return this._reportSessionActiveAsync( _request, _options );
691
+ }
692
+
693
+ /**
694
+ * Gets a CustomerCenterConfig object.
695
+ * @param customerCenterConfigId - The primary key.
696
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
697
+ * @returns A single CustomerCenterConfig
698
+ */
699
+ public async getCustomerCenterConfigAsync(customerCenterConfigId: number, options?:base.WebApiRequestOptions) : Promise< carriers.CustomerCenterConfig > {
700
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
701
+ base.WebApiBase.SetPending(options);
702
+ return new Promise< carriers.CustomerCenterConfig >(async (resolve, reject) => {
703
+ try {
704
+ const response = await this._axios.post("GetCustomerCenterConfig?customerCenterConfigId=" + customerCenterConfigId, null, config);
705
+ base.WebApiBase.SetCompleted(options, response);
706
+ const res = converters.Create_CustomerCenterConfig_From( response.data );
707
+ resolve(res);
708
+ }
709
+ catch( err ) {
710
+ base.WebApiBase.HandleError(options, config, err);
711
+ reject(err);
712
+ }
713
+ });
714
+ }
715
+
716
+
717
+ private async _getAllCustomerCenterConfigsAsync( options?:base.WebApiRequestOptions) : Promise< carriers.CustomerCenterConfig[] > {
718
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
719
+ base.WebApiBase.SetPending(options);
720
+ return new Promise< carriers.CustomerCenterConfig[] >(async (resolve, reject) => {
721
+ try {
722
+ config.baseURL = this._options.baseUrl;
723
+ const response = await this._axios.post("GetAllCustomerCenterConfigs", undefined , config);
724
+ base.WebApiBase.SetCompleted(options, response);
725
+ const res : carriers.CustomerCenterConfig[] = converters.Create_CustomerCenterConfigArray_From( response.data );
726
+ resolve(res);
727
+ }
728
+ catch( err ) {
729
+ base.WebApiBase.HandleError(options, config, err);
730
+ reject(err);
731
+ }
732
+ });
733
+ }
734
+
735
+
736
+ /**
737
+ * Get all rows from cust_config as an array of CustomerCenterConfig entities
738
+ * @returns An array of CustomerCenterConfig entities
739
+ */
740
+ public async getAllCustomerCenterConfigsAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CustomerCenterConfig[] >
741
+ {
742
+ return this._getAllCustomerCenterConfigsAsync(webapi_options);
743
+ }
744
+
745
+
746
+ private async _saveAllCustomerCenterConfigsAsync(request: carriers.CustomerService_SaveAllCustomerCenterConfigsRequest, options?:base.WebApiRequestOptions) : Promise< void > {
747
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
748
+ base.WebApiBase.SetPending(options);
749
+ return new Promise< void >(async (resolve, reject) => {
750
+ try {
751
+ config.baseURL = this._options.baseUrl;
752
+ const response = await this._axios.post("SaveAllCustomerCenterConfigs", request , config);
753
+ base.WebApiBase.SetCompleted(options, response);
754
+ const res = response.data;
755
+ resolve(res);
756
+ }
757
+ catch( err ) {
758
+ base.WebApiBase.HandleError(options, config, err);
759
+ reject(err);
760
+ }
761
+ });
762
+ }
763
+
764
+
765
+
766
+ /**
767
+ * Save an array of CustomerCenterConfig entities to the database
768
+ * @param request - CustConfigs
769
+ * @returns void
770
+ */
771
+ public async saveAllCustomerCenterConfigsAsync(request: carriers.CustomerService_SaveAllCustomerCenterConfigsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
772
+
773
+ /**
774
+ * Save an array of CustomerCenterConfig entities to the database
775
+ * @param custConfigs - The CustomerCenterConfig entities to be saved. If the id does not exists, a new one will be created. Unknown ids will be skipped
776
+ * @returns void
777
+ */
778
+ public async saveAllCustomerCenterConfigsAsync(custConfigs: carriers.CustomerCenterConfig[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
779
+
780
+ public async saveAllCustomerCenterConfigsAsync(custConfigs:carriers.CustomerCenterConfig[]|carriers.CustomerService_SaveAllCustomerCenterConfigsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
781
+ let _request : carriers.CustomerService_SaveAllCustomerCenterConfigsRequest = null;
782
+ let _options : base.WebApiRequestOptions = null;
783
+ const first : any = custConfigs;
784
+ if( typeof( first ) === "object" && first && ( typeof(first.custConfigs)!='undefined' ) )
785
+ {
786
+ _request = custConfigs as carriers.CustomerService_SaveAllCustomerCenterConfigsRequest;
787
+ _options = webapi_options as base.WebApiRequestOptions;
788
+ }
789
+ else
790
+ {
791
+ _request = {
792
+ custConfigs: custConfigs as carriers.CustomerCenterConfig[],
793
+ };
794
+ _options = webapi_options;
795
+ }
796
+ return this._saveAllCustomerCenterConfigsAsync( _request, _options );
797
+ }
798
+
799
+
800
+ private async _checkIfCustomizedTemplatesAsync( options?:base.WebApiRequestOptions) : Promise< boolean > {
801
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
802
+ base.WebApiBase.SetPending(options);
803
+ return new Promise< boolean >(async (resolve, reject) => {
804
+ try {
805
+ config.baseURL = this._options.baseUrl;
806
+ const response = await this._axios.post("CheckIfCustomizedTemplates", undefined , config);
807
+ base.WebApiBase.SetCompleted(options, response);
808
+ const res : boolean = response.data as boolean;
809
+ resolve(res);
810
+ }
811
+ catch( err ) {
812
+ base.WebApiBase.HandleError(options, config, err);
813
+ reject(err);
814
+ }
815
+ });
816
+ }
817
+
818
+
819
+ /**
820
+ * Checks whether the core html templates are customized
821
+ * @returns True if the templates are customized
822
+ */
823
+ public async checkIfCustomizedTemplatesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< boolean >
824
+ {
825
+ return this._checkIfCustomizedTemplatesAsync(webapi_options);
826
+ }
827
+
828
+
829
+ private async _getProgramUrlAsync(request: carriers.CustomerService_GetProgramUrlRequest, options?:base.WebApiRequestOptions) : Promise< string > {
830
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
831
+ base.WebApiBase.SetPending(options);
832
+ return new Promise< string >(async (resolve, reject) => {
833
+ try {
834
+ config.baseURL = this._options.baseUrl;
835
+ const response = await this._axios.post("GetProgramUrl", request , config);
836
+ base.WebApiBase.SetCompleted(options, response);
837
+ const res : string = response.data as string;
838
+ resolve(res);
839
+ }
840
+ catch( err ) {
841
+ base.WebApiBase.HandleError(options, config, err);
842
+ reject(err);
843
+ }
844
+ });
845
+ }
846
+
847
+
848
+
849
+ /**
850
+ * This method will convert a module name into a Service URL.
851
+ * @param request - ProgramName, External
852
+ * @returns Returns a valid Service URL composed of the give parameters.
853
+ */
854
+ public async getProgramUrlAsync(request: carriers.CustomerService_GetProgramUrlRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
855
+
856
+ /**
857
+ * This method will convert a module name into a Service URL.
858
+ * @param programName - In this parameter you must specify which CS program you want to create an URL for. Valid examples are "ticket", "rms", "spm" etc.
859
+ * @param external - If set to true, this will generate URLs that are accesible from the outside (for example Internet)
860
+ * @returns Returns a valid Service URL composed of the give parameters.
861
+ */
862
+ public async getProgramUrlAsync(programName: string, external: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
863
+
864
+ public async getProgramUrlAsync(programName:string|carriers.CustomerService_GetProgramUrlRequest, external?:boolean|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
865
+ let _request : carriers.CustomerService_GetProgramUrlRequest = null;
866
+ let _options : base.WebApiRequestOptions = null;
867
+ const first : any = programName;
868
+ if( typeof( first ) === "object" && first && ( typeof(first.programName)!='undefined' || typeof(first.external)!='undefined' ) )
869
+ {
870
+ _request = programName as carriers.CustomerService_GetProgramUrlRequest;
871
+ _options = external as base.WebApiRequestOptions;
872
+ }
873
+ else
874
+ {
875
+ _request = {
876
+ programName: programName as string,
877
+ external: external as boolean,
878
+ };
879
+ _options = webapi_options;
880
+ }
881
+ return this._getProgramUrlAsync( _request, _options );
882
+ }
883
+
884
+
885
+ private async _getFaqForCustomerAsync(request: carriers.CustomerService_GetFaqForCustomerRequest, options?:base.WebApiRequestOptions) : Promise< string > {
886
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
887
+ base.WebApiBase.SetPending(options);
888
+ return new Promise< string >(async (resolve, reject) => {
889
+ try {
890
+ config.baseURL = this._options.baseUrl;
891
+ const response = await this._axios.post("GetFaqForCustomer", request , config);
892
+ base.WebApiBase.SetCompleted(options, response);
893
+ const res : string = response.data as string;
894
+ resolve(res);
895
+ }
896
+ catch( err ) {
897
+ base.WebApiBase.HandleError(options, config, err);
898
+ reject(err);
899
+ }
900
+ });
901
+ }
902
+
903
+
904
+
905
+ /**
906
+ * Get a FAQ entry, ment to be displayed for a customer. This can either be a link to the FAQ entry on Custom Center, or it can be the answer and question. This is dependent on Registry setting with reg_id=157
907
+ * @param request - FaqEntryId
908
+ * @returns The FAQ to show to the customer. Either a clickable link or the question/answer itself.
909
+ */
910
+ public async getFaqForCustomerAsync(request: carriers.CustomerService_GetFaqForCustomerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
911
+
912
+ /**
913
+ * Get a FAQ entry, ment to be displayed for a customer. This can either be a link to the FAQ entry on Custom Center, or it can be the answer and question. This is dependent on Registry setting with reg_id=157
914
+ * @param faqEntryId - The id of the FAQ entry to get. Only FAQ entries with access level public (both for unauthenticated and autenticated customer) will be returned
915
+ * @returns The FAQ to show to the customer. Either a clickable link or the question/answer itself.
916
+ */
917
+ public async getFaqForCustomerAsync(faqEntryId: number, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
918
+
919
+ public async getFaqForCustomerAsync(faqEntryId:number|carriers.CustomerService_GetFaqForCustomerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
920
+ let _request : carriers.CustomerService_GetFaqForCustomerRequest = null;
921
+ let _options : base.WebApiRequestOptions = null;
922
+ const first : any = faqEntryId;
923
+ if( typeof( first ) === "object" && first && ( typeof(first.faqEntryId)!='undefined' ) )
924
+ {
925
+ _request = faqEntryId as carriers.CustomerService_GetFaqForCustomerRequest;
926
+ _options = webapi_options as base.WebApiRequestOptions;
927
+ }
928
+ else
929
+ {
930
+ _request = {
931
+ faqEntryId: faqEntryId as number,
932
+ };
933
+ _options = webapi_options;
934
+ }
935
+ return this._getFaqForCustomerAsync( _request, _options );
936
+ }
937
+
938
+
939
+ private async _getCustomerServiceStartupAsync( options?:base.WebApiRequestOptions) : Promise< carriers.CustomerServiceStartup > {
940
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
941
+ base.WebApiBase.SetPending(options);
942
+ return new Promise< carriers.CustomerServiceStartup >(async (resolve, reject) => {
943
+ try {
944
+ config.baseURL = this._options.baseUrl;
945
+ const response = await this._axios.post("GetCustomerServiceStartup", undefined , config);
946
+ base.WebApiBase.SetCompleted(options, response);
947
+ const res : carriers.CustomerServiceStartup = converters.Create_CustomerServiceStartup_From( response.data );
948
+ resolve(res);
949
+ }
950
+ catch( err ) {
951
+ base.WebApiBase.HandleError(options, config, err);
952
+ reject(err);
953
+ }
954
+ });
955
+ }
956
+
957
+
958
+ /**
959
+ * Get the carrier with data that Service needs when starting up
960
+ * @returns The carrier containing the startup data
961
+ */
962
+ public async getCustomerServiceStartupAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CustomerServiceStartup >
963
+ {
964
+ return this._getCustomerServiceStartupAsync(webapi_options);
965
+ }
966
+
967
+
968
+ private async _getCustomerServiceStartupByOwnerAsync(request: carriers.CustomerService_GetCustomerServiceStartupByOwnerRequest, options?:base.WebApiRequestOptions) : Promise< carriers.CustomerServiceStartup > {
969
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
970
+ base.WebApiBase.SetPending(options);
971
+ return new Promise< carriers.CustomerServiceStartup >(async (resolve, reject) => {
972
+ try {
973
+ config.baseURL = this._options.baseUrl;
974
+ const response = await this._axios.post("GetCustomerServiceStartupByOwner", request , config);
975
+ base.WebApiBase.SetCompleted(options, response);
976
+ const res : carriers.CustomerServiceStartup = converters.Create_CustomerServiceStartup_From( response.data );
977
+ resolve(res);
978
+ }
979
+ catch( err ) {
980
+ base.WebApiBase.HandleError(options, config, err);
981
+ reject(err);
982
+ }
983
+ });
984
+ }
985
+
986
+
987
+
988
+ /**
989
+ * Get the carrier with data that Service needs when starting up for a specific user
990
+ * @param request - UserId
991
+ * @returns The carrier containing the startup data
992
+ */
993
+ public async getCustomerServiceStartupByOwnerAsync(request: carriers.CustomerService_GetCustomerServiceStartupByOwnerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CustomerServiceStartup >;
994
+
995
+ /**
996
+ * Get the carrier with data that Service needs when starting up for a specific user
997
+ * @param userId - The user for which we want to fetch the startup values for
998
+ * @returns The carrier containing the startup data
999
+ */
1000
+ public async getCustomerServiceStartupByOwnerAsync(userId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CustomerServiceStartup >;
1001
+
1002
+ public async getCustomerServiceStartupByOwnerAsync(userId:number|carriers.CustomerService_GetCustomerServiceStartupByOwnerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CustomerServiceStartup > {
1003
+ let _request : carriers.CustomerService_GetCustomerServiceStartupByOwnerRequest = null;
1004
+ let _options : base.WebApiRequestOptions = null;
1005
+ const first : any = userId;
1006
+ if( typeof( first ) === "object" && first && ( typeof(first.userId)!='undefined' ) )
1007
+ {
1008
+ _request = userId as carriers.CustomerService_GetCustomerServiceStartupByOwnerRequest;
1009
+ _options = webapi_options as base.WebApiRequestOptions;
1010
+ }
1011
+ else
1012
+ {
1013
+ _request = {
1014
+ userId: userId as number,
1015
+ };
1016
+ _options = webapi_options;
1017
+ }
1018
+ return this._getCustomerServiceStartupByOwnerAsync( _request, _options );
1019
+ }
1020
+
1021
+
1022
+ private async _executeEventHandlersAsync(request: carriers.CustomerService_ExecuteEventHandlersRequest, options?:base.WebApiRequestOptions) : Promise< carriers.EventData > {
1023
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1024
+ base.WebApiBase.SetPending(options);
1025
+ return new Promise< carriers.EventData >(async (resolve, reject) => {
1026
+ try {
1027
+ config.baseURL = this._options.baseUrl;
1028
+ const response = await this._axios.post("ExecuteEventHandlers", request , config);
1029
+ base.WebApiBase.SetCompleted(options, response);
1030
+ const res : carriers.EventData = converters.Create_EventData_From( response.data );
1031
+ resolve(res);
1032
+ }
1033
+ catch( err ) {
1034
+ base.WebApiBase.HandleError(options, config, err);
1035
+ reject(err);
1036
+ }
1037
+ });
1038
+ }
1039
+
1040
+
1041
+
1042
+ /**
1043
+ * This method will execute event handlers in CRMScript for a given event.
1044
+ * @param request - EventData
1045
+ * @returns The EventData instance after event handler execution
1046
+ */
1047
+ public async executeEventHandlersAsync(request: carriers.CustomerService_ExecuteEventHandlersRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EventData >;
1048
+
1049
+ /**
1050
+ * This method will execute event handlers in CRMScript for a given event.
1051
+ * @param eventData - The EventData instance sent to the event handler
1052
+ * @returns The EventData instance after event handler execution
1053
+ */
1054
+ public async executeEventHandlersAsync(eventData: carriers.EventData, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EventData >;
1055
+
1056
+ public async executeEventHandlersAsync(eventData:carriers.EventData|carriers.CustomerService_ExecuteEventHandlersRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EventData > {
1057
+ let _request : carriers.CustomerService_ExecuteEventHandlersRequest = null;
1058
+ let _options : base.WebApiRequestOptions = null;
1059
+ const first : any = eventData;
1060
+ if( typeof( first ) === "object" && first && ( typeof(first.eventData)!='undefined' ) )
1061
+ {
1062
+ _request = eventData as carriers.CustomerService_ExecuteEventHandlersRequest;
1063
+ _options = webapi_options as base.WebApiRequestOptions;
1064
+ }
1065
+ else
1066
+ {
1067
+ _request = {
1068
+ eventData: eventData as carriers.EventData,
1069
+ };
1070
+ _options = webapi_options;
1071
+ }
1072
+ return this._executeEventHandlersAsync( _request, _options );
1073
+ }
1074
+
1075
+
1076
+ private async _getMailboxesAsync( options?:base.WebApiRequestOptions) : Promise< carriers.Mailbox[] > {
1077
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1078
+ base.WebApiBase.SetPending(options);
1079
+ return new Promise< carriers.Mailbox[] >(async (resolve, reject) => {
1080
+ try {
1081
+ config.baseURL = this._options.baseUrl;
1082
+ const response = await this._axios.post("GetMailboxes", undefined , config);
1083
+ base.WebApiBase.SetCompleted(options, response);
1084
+ const res : carriers.Mailbox[] = converters.Create_MailboxArray_From( response.data );
1085
+ resolve(res);
1086
+ }
1087
+ catch( err ) {
1088
+ base.WebApiBase.HandleError(options, config, err);
1089
+ reject(err);
1090
+ }
1091
+ });
1092
+ }
1093
+
1094
+
1095
+ /**
1096
+ * This method will get all registered mailboxes in Service
1097
+ * @returns An array of Mailbox objects
1098
+ */
1099
+ public async getMailboxesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Mailbox[] >
1100
+ {
1101
+ return this._getMailboxesAsync(webapi_options);
1102
+ }
1103
+
1104
+ /**
1105
+ * Gets a MailboxEntity object.
1106
+ * @param mailboxEntityId - The primary key.
1107
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
1108
+ * @returns A single MailboxEntity
1109
+ */
1110
+ public async getMailboxEntityAsync(mailboxEntityId: number, options?:base.WebApiRequestOptions) : Promise< carriers.MailboxEntity > {
1111
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1112
+ base.WebApiBase.SetPending(options);
1113
+ return new Promise< carriers.MailboxEntity >(async (resolve, reject) => {
1114
+ try {
1115
+ const response = await this._axios.post("GetMailboxEntity?mailboxEntityId=" + mailboxEntityId, null, config);
1116
+ base.WebApiBase.SetCompleted(options, response);
1117
+ const res = converters.Create_MailboxEntity_From( response.data );
1118
+ resolve(res);
1119
+ }
1120
+ catch( err ) {
1121
+ base.WebApiBase.HandleError(options, config, err);
1122
+ reject(err);
1123
+ }
1124
+ });
1125
+ }
1126
+
1127
+
1128
+ private async _getPreviewFaqEntryAsync(request: carriers.CustomerService_GetPreviewFaqEntryRequest, options?:base.WebApiRequestOptions) : Promise< carriers.PreviewFaqEntry > {
1129
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1130
+ base.WebApiBase.SetPending(options);
1131
+ return new Promise< carriers.PreviewFaqEntry >(async (resolve, reject) => {
1132
+ try {
1133
+ config.baseURL = this._options.baseUrl;
1134
+ const response = await this._axios.post("GetPreviewFaqEntry", request , config);
1135
+ base.WebApiBase.SetCompleted(options, response);
1136
+ const res : carriers.PreviewFaqEntry = converters.Create_PreviewFaqEntry_From( response.data );
1137
+ resolve(res);
1138
+ }
1139
+ catch( err ) {
1140
+ base.WebApiBase.HandleError(options, config, err);
1141
+ reject(err);
1142
+ }
1143
+ });
1144
+ }
1145
+
1146
+
1147
+
1148
+ /**
1149
+ * Get a faq entry from its faq entry id
1150
+ * @param request - KbEntryId
1151
+ * @returns FAQ entry suitable for preview
1152
+ */
1153
+ public async getPreviewFaqEntryAsync(request: carriers.CustomerService_GetPreviewFaqEntryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreviewFaqEntry >;
1154
+
1155
+ /**
1156
+ * Get a faq entry from its faq entry id
1157
+ * @param kbEntryId - FAQ entry ID
1158
+ * @returns FAQ entry suitable for preview
1159
+ */
1160
+ public async getPreviewFaqEntryAsync(kbEntryId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreviewFaqEntry >;
1161
+
1162
+ public async getPreviewFaqEntryAsync(kbEntryId:number|carriers.CustomerService_GetPreviewFaqEntryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreviewFaqEntry > {
1163
+ let _request : carriers.CustomerService_GetPreviewFaqEntryRequest = null;
1164
+ let _options : base.WebApiRequestOptions = null;
1165
+ const first : any = kbEntryId;
1166
+ if( typeof( first ) === "object" && first && ( typeof(first.kbEntryId)!='undefined' ) )
1167
+ {
1168
+ _request = kbEntryId as carriers.CustomerService_GetPreviewFaqEntryRequest;
1169
+ _options = webapi_options as base.WebApiRequestOptions;
1170
+ }
1171
+ else
1172
+ {
1173
+ _request = {
1174
+ kbEntryId: kbEntryId as number,
1175
+ };
1176
+ _options = webapi_options;
1177
+ }
1178
+ return this._getPreviewFaqEntryAsync( _request, _options );
1179
+ }
1180
+
1181
+
1182
+ private async _getPreviewQuickReplyAsync(request: carriers.CustomerService_GetPreviewQuickReplyRequest, options?:base.WebApiRequestOptions) : Promise< carriers.PreviewQuickReply > {
1183
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1184
+ base.WebApiBase.SetPending(options);
1185
+ return new Promise< carriers.PreviewQuickReply >(async (resolve, reject) => {
1186
+ try {
1187
+ config.baseURL = this._options.baseUrl;
1188
+ const response = await this._axios.post("GetPreviewQuickReply", request , config);
1189
+ base.WebApiBase.SetCompleted(options, response);
1190
+ const res : carriers.PreviewQuickReply = converters.Create_PreviewQuickReply_From( response.data );
1191
+ resolve(res);
1192
+ }
1193
+ catch( err ) {
1194
+ base.WebApiBase.HandleError(options, config, err);
1195
+ reject(err);
1196
+ }
1197
+ });
1198
+ }
1199
+
1200
+
1201
+
1202
+ /**
1203
+ * Get a quick reply from its quick reply id
1204
+ * @param request - QuickReplyId
1205
+ * @returns Quick reply suitable for preview
1206
+ */
1207
+ public async getPreviewQuickReplyAsync(request: carriers.CustomerService_GetPreviewQuickReplyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreviewQuickReply >;
1208
+
1209
+ /**
1210
+ * Get a quick reply from its quick reply id
1211
+ * @param quickReplyId - Quick reply ID
1212
+ * @returns Quick reply suitable for preview
1213
+ */
1214
+ public async getPreviewQuickReplyAsync(quickReplyId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreviewQuickReply >;
1215
+
1216
+ public async getPreviewQuickReplyAsync(quickReplyId:number|carriers.CustomerService_GetPreviewQuickReplyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreviewQuickReply > {
1217
+ let _request : carriers.CustomerService_GetPreviewQuickReplyRequest = null;
1218
+ let _options : base.WebApiRequestOptions = null;
1219
+ const first : any = quickReplyId;
1220
+ if( typeof( first ) === "object" && first && ( typeof(first.quickReplyId)!='undefined' ) )
1221
+ {
1222
+ _request = quickReplyId as carriers.CustomerService_GetPreviewQuickReplyRequest;
1223
+ _options = webapi_options as base.WebApiRequestOptions;
1224
+ }
1225
+ else
1226
+ {
1227
+ _request = {
1228
+ quickReplyId: quickReplyId as number,
1229
+ };
1230
+ _options = webapi_options;
1231
+ }
1232
+ return this._getPreviewQuickReplyAsync( _request, _options );
1233
+ }
1234
+
1235
+
1236
+ private async _getPreviewReplyTemplateAsync(request: carriers.CustomerService_GetPreviewReplyTemplateRequest, options?:base.WebApiRequestOptions) : Promise< carriers.PreviewReplyTemplate > {
1237
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1238
+ base.WebApiBase.SetPending(options);
1239
+ return new Promise< carriers.PreviewReplyTemplate >(async (resolve, reject) => {
1240
+ try {
1241
+ config.baseURL = this._options.baseUrl;
1242
+ const response = await this._axios.post("GetPreviewReplyTemplate", request , config);
1243
+ base.WebApiBase.SetCompleted(options, response);
1244
+ const res : carriers.PreviewReplyTemplate = converters.Create_PreviewReplyTemplate_From( response.data );
1245
+ resolve(res);
1246
+ }
1247
+ catch( err ) {
1248
+ base.WebApiBase.HandleError(options, config, err);
1249
+ reject(err);
1250
+ }
1251
+ });
1252
+ }
1253
+
1254
+
1255
+
1256
+ /**
1257
+ * Get a reply template from its reply template id
1258
+ * @param request - ReplyTemplateId
1259
+ * @returns Reply template suitable for preview
1260
+ */
1261
+ public async getPreviewReplyTemplateAsync(request: carriers.CustomerService_GetPreviewReplyTemplateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreviewReplyTemplate >;
1262
+
1263
+ /**
1264
+ * Get a reply template from its reply template id
1265
+ * @param replyTemplateId - Reply template ID
1266
+ * @returns Reply template suitable for preview
1267
+ */
1268
+ public async getPreviewReplyTemplateAsync(replyTemplateId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreviewReplyTemplate >;
1269
+
1270
+ public async getPreviewReplyTemplateAsync(replyTemplateId:number|carriers.CustomerService_GetPreviewReplyTemplateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.PreviewReplyTemplate > {
1271
+ let _request : carriers.CustomerService_GetPreviewReplyTemplateRequest = null;
1272
+ let _options : base.WebApiRequestOptions = null;
1273
+ const first : any = replyTemplateId;
1274
+ if( typeof( first ) === "object" && first && ( typeof(first.replyTemplateId)!='undefined' ) )
1275
+ {
1276
+ _request = replyTemplateId as carriers.CustomerService_GetPreviewReplyTemplateRequest;
1277
+ _options = webapi_options as base.WebApiRequestOptions;
1278
+ }
1279
+ else
1280
+ {
1281
+ _request = {
1282
+ replyTemplateId: replyTemplateId as number,
1283
+ };
1284
+ _options = webapi_options;
1285
+ }
1286
+ return this._getPreviewReplyTemplateAsync( _request, _options );
1287
+ }
1288
+
1289
+
1290
+ private async _getParsedTemplateAsync(request: carriers.CustomerService_GetParsedTemplateRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ReplyTemplateParsed > {
1291
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1292
+ base.WebApiBase.SetPending(options);
1293
+ return new Promise< carriers.ReplyTemplateParsed >(async (resolve, reject) => {
1294
+ try {
1295
+ config.baseURL = this._options.baseUrl;
1296
+ const response = await this._axios.post("GetParsedTemplate", request , config);
1297
+ base.WebApiBase.SetCompleted(options, response);
1298
+ const res : carriers.ReplyTemplateParsed = converters.Create_ReplyTemplateParsed_From( response.data );
1299
+ resolve(res);
1300
+ }
1301
+ catch( err ) {
1302
+ base.WebApiBase.HandleError(options, config, err);
1303
+ reject(err);
1304
+ }
1305
+ });
1306
+ }
1307
+
1308
+
1309
+
1310
+ /**
1311
+ * Get a specific langauge version of the reply template, and run this trough the parser
1312
+ * @param request - ReplyTemplateId, LanguageId, PersonId, TicketId
1313
+ * @returns The parsed reply template
1314
+ */
1315
+ public async getParsedTemplateAsync(request: carriers.CustomerService_GetParsedTemplateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ReplyTemplateParsed >;
1316
+
1317
+ /**
1318
+ * Get a specific langauge version of the reply template, and run this trough the parser
1319
+ * @param replyTemplateId - The id of the reply template
1320
+ * @param languageId - The language id (prefered language). If 0 is given, the language of the person will be used
1321
+ * @param personId - The id of the person that will be populated into the parser
1322
+ * @param ticketId - The id of the ticket that will be populated into the parser
1323
+ * @returns The parsed reply template
1324
+ */
1325
+ public async getParsedTemplateAsync(replyTemplateId: number, languageId: number, personId: number, ticketId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ReplyTemplateParsed >;
1326
+
1327
+ public async getParsedTemplateAsync(replyTemplateId:number|carriers.CustomerService_GetParsedTemplateRequest, languageId?:number|base.WebApiRequestOptions, personId?:number, ticketId?:number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ReplyTemplateParsed > {
1328
+ let _request : carriers.CustomerService_GetParsedTemplateRequest = null;
1329
+ let _options : base.WebApiRequestOptions = null;
1330
+ const first : any = replyTemplateId;
1331
+ if( typeof( first ) === "object" && first && ( typeof(first.replyTemplateId)!='undefined' || typeof(first.languageId)!='undefined' || typeof(first.personId)!='undefined' || typeof(first.ticketId)!='undefined' ) )
1332
+ {
1333
+ _request = replyTemplateId as carriers.CustomerService_GetParsedTemplateRequest;
1334
+ _options = languageId as base.WebApiRequestOptions;
1335
+ }
1336
+ else
1337
+ {
1338
+ _request = {
1339
+ replyTemplateId: replyTemplateId as number,
1340
+ languageId: languageId as number,
1341
+ personId: personId as number,
1342
+ ticketId: ticketId as number,
1343
+ };
1344
+ _options = webapi_options;
1345
+ }
1346
+ return this._getParsedTemplateAsync( _request, _options );
1347
+ }
1348
+
1349
+
1350
+ private async _getUnparsedTemplateAsync(request: carriers.CustomerService_GetUnparsedTemplateRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ReplyTemplateParsed > {
1351
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1352
+ base.WebApiBase.SetPending(options);
1353
+ return new Promise< carriers.ReplyTemplateParsed >(async (resolve, reject) => {
1354
+ try {
1355
+ config.baseURL = this._options.baseUrl;
1356
+ const response = await this._axios.post("GetUnparsedTemplate", request , config);
1357
+ base.WebApiBase.SetCompleted(options, response);
1358
+ const res : carriers.ReplyTemplateParsed = converters.Create_ReplyTemplateParsed_From( response.data );
1359
+ resolve(res);
1360
+ }
1361
+ catch( err ) {
1362
+ base.WebApiBase.HandleError(options, config, err);
1363
+ reject(err);
1364
+ }
1365
+ });
1366
+ }
1367
+
1368
+
1369
+
1370
+ /**
1371
+ * Get a specific langauge version of the reply template. No parsing is performed.
1372
+ * @param request - ReplyTemplateId, LanguageId
1373
+ * @returns The unparsed reply template, but using the same return data structure
1374
+ */
1375
+ public async getUnparsedTemplateAsync(request: carriers.CustomerService_GetUnparsedTemplateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ReplyTemplateParsed >;
1376
+
1377
+ /**
1378
+ * Get a specific langauge version of the reply template. No parsing is performed.
1379
+ * @param replyTemplateId - The id of the reply template
1380
+ * @param languageId - The language id (prefered language). If 0 is given, the language of the person will be used
1381
+ * @returns The unparsed reply template, but using the same return data structure
1382
+ */
1383
+ public async getUnparsedTemplateAsync(replyTemplateId: number, languageId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ReplyTemplateParsed >;
1384
+
1385
+ public async getUnparsedTemplateAsync(replyTemplateId:number|carriers.CustomerService_GetUnparsedTemplateRequest, languageId?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ReplyTemplateParsed > {
1386
+ let _request : carriers.CustomerService_GetUnparsedTemplateRequest = null;
1387
+ let _options : base.WebApiRequestOptions = null;
1388
+ const first : any = replyTemplateId;
1389
+ if( typeof( first ) === "object" && first && ( typeof(first.replyTemplateId)!='undefined' || typeof(first.languageId)!='undefined' ) )
1390
+ {
1391
+ _request = replyTemplateId as carriers.CustomerService_GetUnparsedTemplateRequest;
1392
+ _options = languageId as base.WebApiRequestOptions;
1393
+ }
1394
+ else
1395
+ {
1396
+ _request = {
1397
+ replyTemplateId: replyTemplateId as number,
1398
+ languageId: languageId as number,
1399
+ };
1400
+ _options = webapi_options;
1401
+ }
1402
+ return this._getUnparsedTemplateAsync( _request, _options );
1403
+ }
1404
+
1405
+
1406
+ private async _getSmsConfigAsync( options?:base.WebApiRequestOptions) : Promise< carriers.SmsConfig > {
1407
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1408
+ base.WebApiBase.SetPending(options);
1409
+ return new Promise< carriers.SmsConfig >(async (resolve, reject) => {
1410
+ try {
1411
+ config.baseURL = this._options.baseUrl;
1412
+ const response = await this._axios.post("GetSmsConfig", undefined , config);
1413
+ base.WebApiBase.SetCompleted(options, response);
1414
+ const res : carriers.SmsConfig = converters.Create_SmsConfig_From( response.data );
1415
+ resolve(res);
1416
+ }
1417
+ catch( err ) {
1418
+ base.WebApiBase.HandleError(options, config, err);
1419
+ reject(err);
1420
+ }
1421
+ });
1422
+ }
1423
+
1424
+
1425
+ /**
1426
+ * Get the SmsConfig settings for Customer Service sms providers.
1427
+ * @returns Current SMS configuration.
1428
+ */
1429
+ public async getSmsConfigAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SmsConfig >
1430
+ {
1431
+ return this._getSmsConfigAsync(webapi_options);
1432
+ }
1433
+
1434
+
1435
+ private async _testSmtpServerAsync(request: carriers.CustomerService_TestSmtpServerRequest, options?:base.WebApiRequestOptions) : Promise< carriers.SmtpTestResult > {
1436
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1437
+ base.WebApiBase.SetPending(options);
1438
+ return new Promise< carriers.SmtpTestResult >(async (resolve, reject) => {
1439
+ try {
1440
+ config.baseURL = this._options.baseUrl;
1441
+ const response = await this._axios.post("TestSmtpServer", request , config);
1442
+ base.WebApiBase.SetCompleted(options, response);
1443
+ const res : carriers.SmtpTestResult = converters.Create_SmtpTestResult_From( response.data );
1444
+ resolve(res);
1445
+ }
1446
+ catch( err ) {
1447
+ base.WebApiBase.HandleError(options, config, err);
1448
+ reject(err);
1449
+ }
1450
+ });
1451
+ }
1452
+
1453
+
1454
+
1455
+ /**
1456
+ * This method will do a test of a SMTP account, by sending an email to a special @superoffice.com account
1457
+ * @param request - SmtpUri, From, UseStoredPassword
1458
+ * @returns Contains the result of the test
1459
+ */
1460
+ public async testSmtpServerAsync(request: carriers.CustomerService_TestSmtpServerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SmtpTestResult >;
1461
+
1462
+ /**
1463
+ * This method will do a test of a SMTP account, by sending an email to a special @superoffice.com account
1464
+ * @param smtpUri - An URI containing information to connect to the SMTP server, eg. smtps://myuser:mypassword@smtp.myserver.com:465. Note that username and password must be url encoded
1465
+ * @param from - The from-address used in the test
1466
+ * @param useStoredPassword - Use database persisted password
1467
+ * @returns Contains the result of the test
1468
+ */
1469
+ public async testSmtpServerAsync(smtpUri: string, from: string, useStoredPassword: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SmtpTestResult >;
1470
+
1471
+ public async testSmtpServerAsync(smtpUri:string|carriers.CustomerService_TestSmtpServerRequest, from?:string|base.WebApiRequestOptions, useStoredPassword?:boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SmtpTestResult > {
1472
+ let _request : carriers.CustomerService_TestSmtpServerRequest = null;
1473
+ let _options : base.WebApiRequestOptions = null;
1474
+ const first : any = smtpUri;
1475
+ if( typeof( first ) === "object" && first && ( typeof(first.smtpUri)!='undefined' || typeof(first.from)!='undefined' || typeof(first.useStoredPassword)!='undefined' ) )
1476
+ {
1477
+ _request = smtpUri as carriers.CustomerService_TestSmtpServerRequest;
1478
+ _options = from as base.WebApiRequestOptions;
1479
+ }
1480
+ else
1481
+ {
1482
+ _request = {
1483
+ smtpUri: smtpUri as string,
1484
+ from: from as string,
1485
+ useStoredPassword: useStoredPassword as boolean,
1486
+ };
1487
+ _options = webapi_options;
1488
+ }
1489
+ return this._testSmtpServerAsync( _request, _options );
1490
+ }
1491
+
1492
+
1493
+ private async _getStatisticsAsync(request: carriers.CustomerService_GetStatisticsRequest, options?:base.WebApiRequestOptions) : Promise< carriers.StatisticsDataSet[] > {
1494
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1495
+ base.WebApiBase.SetPending(options);
1496
+ return new Promise< carriers.StatisticsDataSet[] >(async (resolve, reject) => {
1497
+ try {
1498
+ config.baseURL = this._options.baseUrl;
1499
+ const response = await this._axios.post("GetStatistics", request , config);
1500
+ base.WebApiBase.SetCompleted(options, response);
1501
+ const res : carriers.StatisticsDataSet[] = converters.Create_StatisticsDataSetArray_From( response.data );
1502
+ resolve(res);
1503
+ }
1504
+ catch( err ) {
1505
+ base.WebApiBase.HandleError(options, config, err);
1506
+ reject(err);
1507
+ }
1508
+ });
1509
+ }
1510
+
1511
+
1512
+
1513
+ /**
1514
+ * Returns the calculated results for the required statistics for the Customer Service Status Page
1515
+ * @param request - Functions
1516
+ * @returns Array of StatisticsDataSet
1517
+ */
1518
+ public async getStatisticsAsync(request: carriers.CustomerService_GetStatisticsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StatisticsDataSet[] >;
1519
+
1520
+ /**
1521
+ * Returns the calculated results for the required statistics for the Customer Service Status Page
1522
+ * @param functions - List of functions to calculate and return
1523
+ * @returns Array of StatisticsDataSet
1524
+ */
1525
+ public async getStatisticsAsync(functions: enums.StatusScreenPanelType[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StatisticsDataSet[] >;
1526
+
1527
+ public async getStatisticsAsync(functions:enums.StatusScreenPanelType[]|carriers.CustomerService_GetStatisticsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StatisticsDataSet[] > {
1528
+ let _request : carriers.CustomerService_GetStatisticsRequest = null;
1529
+ let _options : base.WebApiRequestOptions = null;
1530
+ const first : any = functions;
1531
+ if( typeof( first ) === "object" && first && ( typeof(first.functions)!='undefined' ) )
1532
+ {
1533
+ _request = functions as carriers.CustomerService_GetStatisticsRequest;
1534
+ _options = webapi_options as base.WebApiRequestOptions;
1535
+ }
1536
+ else
1537
+ {
1538
+ _request = {
1539
+ functions: functions as enums.StatusScreenPanelType[],
1540
+ };
1541
+ _options = webapi_options;
1542
+ }
1543
+ return this._getStatisticsAsync( _request, _options );
1544
+ }
1545
+
1546
+
1547
+ private async _getSystemTemplateSettingsAsync( options?:base.WebApiRequestOptions) : Promise< carriers.SystemTemplateSettings > {
1548
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1549
+ base.WebApiBase.SetPending(options);
1550
+ return new Promise< carriers.SystemTemplateSettings >(async (resolve, reject) => {
1551
+ try {
1552
+ config.baseURL = this._options.baseUrl;
1553
+ const response = await this._axios.post("GetSystemTemplateSettings", undefined , config);
1554
+ base.WebApiBase.SetCompleted(options, response);
1555
+ const res : carriers.SystemTemplateSettings = converters.Create_SystemTemplateSettings_From( response.data );
1556
+ resolve(res);
1557
+ }
1558
+ catch( err ) {
1559
+ base.WebApiBase.HandleError(options, config, err);
1560
+ reject(err);
1561
+ }
1562
+ });
1563
+ }
1564
+
1565
+
1566
+ /**
1567
+ * Returns system template settings
1568
+ * @returns System template settings item
1569
+ */
1570
+ public async getSystemTemplateSettingsAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SystemTemplateSettings >
1571
+ {
1572
+ return this._getSystemTemplateSettingsAsync(webapi_options);
1573
+ }
1574
+
1575
+
1576
+ private async _saveSystemTemplateSettingsAsync(request: carriers.CustomerService_SaveSystemTemplateSettingsRequest, options?:base.WebApiRequestOptions) : Promise< carriers.SystemTemplateSettings > {
1577
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1578
+ base.WebApiBase.SetPending(options);
1579
+ return new Promise< carriers.SystemTemplateSettings >(async (resolve, reject) => {
1580
+ try {
1581
+ config.baseURL = this._options.baseUrl;
1582
+ const response = await this._axios.post("SaveSystemTemplateSettings", request , config);
1583
+ base.WebApiBase.SetCompleted(options, response);
1584
+ const res : carriers.SystemTemplateSettings = converters.Create_SystemTemplateSettings_From( response.data );
1585
+ resolve(res);
1586
+ }
1587
+ catch( err ) {
1588
+ base.WebApiBase.HandleError(options, config, err);
1589
+ reject(err);
1590
+ }
1591
+ });
1592
+ }
1593
+
1594
+
1595
+
1596
+ /**
1597
+ * Saves and validates updated system templates. Throws exception if validation fails
1598
+ * @param request - SystemTemplateSettings
1599
+ * @returns Updated system template settings
1600
+ */
1601
+ public async saveSystemTemplateSettingsAsync(request: carriers.CustomerService_SaveSystemTemplateSettingsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SystemTemplateSettings >;
1602
+
1603
+ /**
1604
+ * Saves and validates updated system templates. Throws exception if validation fails
1605
+ * @param systemTemplateSettings - System template settings item with updated values
1606
+ * @returns Updated system template settings
1607
+ */
1608
+ public async saveSystemTemplateSettingsAsync(systemTemplateSettings: carriers.SystemTemplateSettings, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SystemTemplateSettings >;
1609
+
1610
+ public async saveSystemTemplateSettingsAsync(systemTemplateSettings:carriers.SystemTemplateSettings|carriers.CustomerService_SaveSystemTemplateSettingsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SystemTemplateSettings > {
1611
+ let _request : carriers.CustomerService_SaveSystemTemplateSettingsRequest = null;
1612
+ let _options : base.WebApiRequestOptions = null;
1613
+ const first : any = systemTemplateSettings;
1614
+ if( typeof( first ) === "object" && first && ( typeof(first.systemTemplateSettings)!='undefined' ) )
1615
+ {
1616
+ _request = systemTemplateSettings as carriers.CustomerService_SaveSystemTemplateSettingsRequest;
1617
+ _options = webapi_options as base.WebApiRequestOptions;
1618
+ }
1619
+ else
1620
+ {
1621
+ _request = {
1622
+ systemTemplateSettings: systemTemplateSettings as carriers.SystemTemplateSettings,
1623
+ };
1624
+ _options = webapi_options;
1625
+ }
1626
+ return this._saveSystemTemplateSettingsAsync( _request, _options );
1627
+ }
1628
+
1629
+
1630
+ private async _createTicketFromMailDataAsync(request: carriers.CustomerService_CreateTicketFromMailDataRequest, options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo > {
1631
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1632
+ base.WebApiBase.SetPending(options);
1633
+ return new Promise< carriers.TicketInfo >(async (resolve, reject) => {
1634
+ try {
1635
+ config.baseURL = this._options.baseUrl;
1636
+ const response = await this._axios.post("CreateTicketFromMailData", request , config);
1637
+ base.WebApiBase.SetCompleted(options, response);
1638
+ const res : carriers.TicketInfo = converters.Create_TicketInfo_From( response.data );
1639
+ resolve(res);
1640
+ }
1641
+ catch( err ) {
1642
+ base.WebApiBase.HandleError(options, config, err);
1643
+ reject(err);
1644
+ }
1645
+ });
1646
+ }
1647
+
1648
+
1649
+
1650
+ /**
1651
+ * This method create a new ticket in the same way as importMail would import an email. It accepts RFC822 formatted data
1652
+ * @param request - MailboxId, Data
1653
+ * @returns An object containing some meta data for the created ticket
1654
+ */
1655
+ public async createTicketFromMailDataAsync(request: carriers.CustomerService_CreateTicketFromMailDataRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo >;
1656
+
1657
+ /**
1658
+ * This method create a new ticket in the same way as importMail would import an email. It accepts RFC822 formatted data
1659
+ * @param mailboxId - The id of the Service mailbox
1660
+ * @param data - RFC822 formatted data to import as a ticket
1661
+ * @returns An object containing some meta data for the created ticket
1662
+ */
1663
+ public async createTicketFromMailDataAsync(mailboxId: number, data: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo >;
1664
+
1665
+ public async createTicketFromMailDataAsync(mailboxId:number|carriers.CustomerService_CreateTicketFromMailDataRequest, data?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo > {
1666
+ let _request : carriers.CustomerService_CreateTicketFromMailDataRequest = null;
1667
+ let _options : base.WebApiRequestOptions = null;
1668
+ const first : any = mailboxId;
1669
+ if( typeof( first ) === "object" && first && ( typeof(first.mailboxId)!='undefined' || typeof(first.data)!='undefined' ) )
1670
+ {
1671
+ _request = mailboxId as carriers.CustomerService_CreateTicketFromMailDataRequest;
1672
+ _options = data as base.WebApiRequestOptions;
1673
+ }
1674
+ else
1675
+ {
1676
+ _request = {
1677
+ mailboxId: mailboxId as number,
1678
+ data: data as string,
1679
+ };
1680
+ _options = webapi_options;
1681
+ }
1682
+ return this._createTicketFromMailDataAsync( _request, _options );
1683
+ }
1684
+
1685
+
1686
+ private async _addMessageFromMailDataAsync(request: carriers.CustomerService_AddMessageFromMailDataRequest, options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo > {
1687
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1688
+ base.WebApiBase.SetPending(options);
1689
+ return new Promise< carriers.TicketInfo >(async (resolve, reject) => {
1690
+ try {
1691
+ config.baseURL = this._options.baseUrl;
1692
+ const response = await this._axios.post("AddMessageFromMailData", request , config);
1693
+ base.WebApiBase.SetCompleted(options, response);
1694
+ const res : carriers.TicketInfo = converters.Create_TicketInfo_From( response.data );
1695
+ resolve(res);
1696
+ }
1697
+ catch( err ) {
1698
+ base.WebApiBase.HandleError(options, config, err);
1699
+ reject(err);
1700
+ }
1701
+ });
1702
+ }
1703
+
1704
+
1705
+
1706
+ /**
1707
+ * This method will add a message to an existing request in the sam way as importMail would do it from an email. It accepts RFC822 formatted data
1708
+ * @param request - TicketId, Data
1709
+ * @returns An object containing some meta data for the ticket
1710
+ */
1711
+ public async addMessageFromMailDataAsync(request: carriers.CustomerService_AddMessageFromMailDataRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo >;
1712
+
1713
+ /**
1714
+ * This method will add a message to an existing request in the sam way as importMail would do it from an email. It accepts RFC822 formatted data
1715
+ * @param ticketId - The id of the ticket to add a message
1716
+ * @param data - RFC822 formatted data to import as a message
1717
+ * @returns An object containing some meta data for the ticket
1718
+ */
1719
+ public async addMessageFromMailDataAsync(ticketId: number, data: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo >;
1720
+
1721
+ public async addMessageFromMailDataAsync(ticketId:number|carriers.CustomerService_AddMessageFromMailDataRequest, data?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo > {
1722
+ let _request : carriers.CustomerService_AddMessageFromMailDataRequest = null;
1723
+ let _options : base.WebApiRequestOptions = null;
1724
+ const first : any = ticketId;
1725
+ if( typeof( first ) === "object" && first && ( typeof(first.ticketId)!='undefined' || typeof(first.data)!='undefined' ) )
1726
+ {
1727
+ _request = ticketId as carriers.CustomerService_AddMessageFromMailDataRequest;
1728
+ _options = data as base.WebApiRequestOptions;
1729
+ }
1730
+ else
1731
+ {
1732
+ _request = {
1733
+ ticketId: ticketId as number,
1734
+ data: data as string,
1735
+ };
1736
+ _options = webapi_options;
1737
+ }
1738
+ return this._addMessageFromMailDataAsync( _request, _options );
1739
+ }
1740
+
1741
+
1742
+ private async _findTicketsByTitleOrIdAsync(request: carriers.CustomerService_FindTicketsByTitleOrIdRequest, options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo[] > {
1743
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1744
+ base.WebApiBase.SetPending(options);
1745
+ return new Promise< carriers.TicketInfo[] >(async (resolve, reject) => {
1746
+ try {
1747
+ config.baseURL = this._options.baseUrl;
1748
+ const response = await this._axios.post("FindTicketsByTitleOrId", request , config);
1749
+ base.WebApiBase.SetCompleted(options, response);
1750
+ const res : carriers.TicketInfo[] = converters.Create_TicketInfoArray_From( response.data );
1751
+ resolve(res);
1752
+ }
1753
+ catch( err ) {
1754
+ base.WebApiBase.HandleError(options, config, err);
1755
+ reject(err);
1756
+ }
1757
+ });
1758
+ }
1759
+
1760
+
1761
+
1762
+ /**
1763
+ * This method wil search for tickets matching title or id
1764
+ * @param request - TitleOrId, MaxRows
1765
+ * @returns An array of objects containing some meta data for matching tickets
1766
+ */
1767
+ public async findTicketsByTitleOrIdAsync(request: carriers.CustomerService_FindTicketsByTitleOrIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo[] >;
1768
+
1769
+ /**
1770
+ * This method wil search for tickets matching title or id
1771
+ * @param titleOrId - The search string. If this is a number, it will also search for a matching ticket id
1772
+ * @param maxRows - The maximum number of rows to be returned
1773
+ * @returns An array of objects containing some meta data for matching tickets
1774
+ */
1775
+ public async findTicketsByTitleOrIdAsync(titleOrId: string, maxRows: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo[] >;
1776
+
1777
+ public async findTicketsByTitleOrIdAsync(titleOrId:string|carriers.CustomerService_FindTicketsByTitleOrIdRequest, maxRows?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketInfo[] > {
1778
+ let _request : carriers.CustomerService_FindTicketsByTitleOrIdRequest = null;
1779
+ let _options : base.WebApiRequestOptions = null;
1780
+ const first : any = titleOrId;
1781
+ if( typeof( first ) === "object" && first && ( typeof(first.titleOrId)!='undefined' || typeof(first.maxRows)!='undefined' ) )
1782
+ {
1783
+ _request = titleOrId as carriers.CustomerService_FindTicketsByTitleOrIdRequest;
1784
+ _options = maxRows as base.WebApiRequestOptions;
1785
+ }
1786
+ else
1787
+ {
1788
+ _request = {
1789
+ titleOrId: titleOrId as string,
1790
+ maxRows: maxRows as number,
1791
+ };
1792
+ _options = webapi_options;
1793
+ }
1794
+ return this._findTicketsByTitleOrIdAsync( _request, _options );
1795
+ }
1796
+
1797
+ } // class v1CustomerServiceAgentController
1798
+
1799
+