@superoffice/webapi 11.7.727 → 11.8.788

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 (147) 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/Carriers.d.ts +367 -4
  27. package/dist/cjs/Carriers.d.ts.map +1 -1
  28. package/dist/cjs/Converters.d.ts +9 -0
  29. package/dist/cjs/Converters.d.ts.map +1 -1
  30. package/dist/cjs/Converters.js +185 -17
  31. package/dist/cjs/Converters.js.map +1 -1
  32. package/dist/cjs/DiagnosticsAgent.d.ts +38 -0
  33. package/dist/cjs/DiagnosticsAgent.d.ts.map +1 -1
  34. package/dist/cjs/DiagnosticsAgent.js +91 -0
  35. package/dist/cjs/DiagnosticsAgent.js.map +1 -1
  36. package/dist/cjs/Enums.d.ts +18 -0
  37. package/dist/cjs/Enums.d.ts.map +1 -1
  38. package/dist/cjs/Enums.js +20 -1
  39. package/dist/cjs/Enums.js.map +1 -1
  40. package/dist/cjs/ListAgent.d.ts +71 -6
  41. package/dist/cjs/ListAgent.d.ts.map +1 -1
  42. package/dist/cjs/ListAgent.js +157 -0
  43. package/dist/cjs/ListAgent.js.map +1 -1
  44. package/dist/cjs/TicketAgent.d.ts +23 -0
  45. package/dist/cjs/TicketAgent.d.ts.map +1 -1
  46. package/dist/cjs/TicketAgent.js +65 -0
  47. package/dist/cjs/TicketAgent.js.map +1 -1
  48. package/dist/esm/Carriers.d.ts +367 -4
  49. package/dist/esm/Carriers.d.ts.map +1 -1
  50. package/dist/esm/Converters.d.ts +9 -0
  51. package/dist/esm/Converters.d.ts.map +1 -1
  52. package/dist/esm/Converters.js +159 -0
  53. package/dist/esm/Converters.js.map +1 -1
  54. package/dist/esm/DiagnosticsAgent.d.ts +38 -0
  55. package/dist/esm/DiagnosticsAgent.d.ts.map +1 -1
  56. package/dist/esm/DiagnosticsAgent.js +91 -0
  57. package/dist/esm/DiagnosticsAgent.js.map +1 -1
  58. package/dist/esm/Enums.d.ts +18 -0
  59. package/dist/esm/Enums.d.ts.map +1 -1
  60. package/dist/esm/Enums.js +19 -0
  61. package/dist/esm/Enums.js.map +1 -1
  62. package/dist/esm/ListAgent.d.ts +71 -6
  63. package/dist/esm/ListAgent.d.ts.map +1 -1
  64. package/dist/esm/ListAgent.js +157 -0
  65. package/dist/esm/ListAgent.js.map +1 -1
  66. package/dist/esm/TicketAgent.d.ts +23 -0
  67. package/dist/esm/TicketAgent.d.ts.map +1 -1
  68. package/dist/esm/TicketAgent.js +65 -0
  69. package/dist/esm/TicketAgent.js.map +1 -1
  70. package/examples-js/hello.js +12 -12
  71. package/examples-ts/hello.ts +8 -8
  72. package/package.json +93 -93
  73. package/scripts/postbuild.js +22 -22
  74. package/scripts/setVersion.js +44 -44
  75. package/src/AIAgent.ts +1992 -1992
  76. package/src/AppointmentAgent.ts +6263 -6263
  77. package/src/AppointmentRestApi.ts +225 -225
  78. package/src/ArchiveAgent.ts +1950 -1950
  79. package/src/AssociateAgent.ts +422 -422
  80. package/src/AxiosCacheHandler.ts +74 -74
  81. package/src/BLOBAgent.ts +2100 -2100
  82. package/src/Base64.ts +285 -285
  83. package/src/BatchAgent.ts +910 -910
  84. package/src/BulkUpdateAgent.ts +504 -504
  85. package/src/CRMScriptAgent.ts +1390 -1390
  86. package/src/Carriers.ts +52750 -52274
  87. package/src/ChatAgent.ts +1422 -1422
  88. package/src/ConfigurationAgent.ts +2228 -2228
  89. package/src/ContactAgent.ts +1756 -1756
  90. package/src/ContactRestApi.ts +237 -237
  91. package/src/Converters.ts +23271 -23090
  92. package/src/CustomerServiceAgent.ts +1799 -1799
  93. package/src/DashAgent.ts +1674 -1674
  94. package/src/DatabaseAgent.ts +120 -120
  95. package/src/DatabaseTableAgent.ts +534 -534
  96. package/src/Day_js.ts +41 -41
  97. package/src/DiagnosticsAgent.ts +1384 -1240
  98. package/src/DocumentAgent.ts +5079 -5079
  99. package/src/DocumentMigrationAgent.ts +524 -524
  100. package/src/DocumentRestApi.ts +259 -259
  101. package/src/EMailAgent.ts +5328 -5328
  102. package/src/Enums.ts +6936 -6916
  103. package/src/ErpSyncAgent.ts +2658 -2658
  104. package/src/FavouriteAgent.ts +720 -720
  105. package/src/FindAgent.ts +2330 -2330
  106. package/src/ForeignSystemAgent.ts +1710 -1710
  107. package/src/FreeTextAgent.ts +372 -372
  108. package/src/ImportAgent.ts +304 -304
  109. package/src/LicenseAgent.ts +1230 -1230
  110. package/src/ListAgent.ts +11451 -11237
  111. package/src/MDOAgent.ts +748 -748
  112. package/src/MarketingAgent.ts +890 -890
  113. package/src/MessagingAgent.ts +384 -384
  114. package/src/NavigatorAgent.ts +140 -140
  115. package/src/NumberAllocationAgent.ts +296 -296
  116. package/src/PersonAgent.ts +3287 -3287
  117. package/src/PersonRestApi.ts +241 -241
  118. package/src/PhoneListAgent.ts +458 -458
  119. package/src/PocketAgent.ts +780 -780
  120. package/src/PreferenceAgent.ts +1900 -1900
  121. package/src/PreviewsAgent.ts +116 -116
  122. package/src/ProjectAgent.ts +2391 -2391
  123. package/src/ProjectRestApi.ts +239 -239
  124. package/src/QuoteAgent.ts +5159 -5159
  125. package/src/RelationAgent.ts +220 -220
  126. package/src/ReportAgent.ts +154 -154
  127. package/src/ResourceAgent.ts +358 -358
  128. package/src/SaintAgent.ts +601 -601
  129. package/src/SaleAgent.ts +2034 -2034
  130. package/src/SaleRestApi.ts +233 -233
  131. package/src/SelectionAgent.ts +3195 -3195
  132. package/src/SentryAgent.ts +462 -462
  133. package/src/SoApiConstants.ts +8 -8
  134. package/src/TargetsAgent.ts +1104 -1104
  135. package/src/TicketAgent.ts +3708 -3638
  136. package/src/TimeZoneAgent.ts +528 -528
  137. package/src/TooltipsAgent.ts +116 -116
  138. package/src/UserAgent.ts +4856 -4856
  139. package/src/UserDefinedFieldInfoAgent.ts +1764 -1764
  140. package/src/ViewStateAgent.ts +858 -858
  141. package/src/WebApi.ts +872 -872
  142. package/src/WebApiBase.ts +565 -565
  143. package/src/WebhookAgent.ts +388 -388
  144. package/src/WorkflowAgent.ts +1338 -1338
  145. package/tsconfig.esm.json +8 -8
  146. package/tsconfig.jest.json +8 -8
  147. package/tsconfig.json +34 -34
@@ -1,1390 +1,1390 @@
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/CRMScriptAgent.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
- * Manage and execute CRMScript functions.
28
- *
29
- * **Online Restricted:** This agent is not available in Online by default. Access must be requested specifically when app is registered.
30
- */
31
- export interface ICRMScriptAgent {
32
- createDefaultCRMScriptEntityAsync(): Promise< carriers.CRMScriptEntity >;
33
- saveCRMScriptEntityAsync(entity: carriers.CRMScriptEntity) : Promise< carriers.CRMScriptEntity >;
34
- deleteCRMScriptEntityAsync(CRMScriptEntityId: number) : Promise<void>;
35
- createDefaultTriggerScriptEntityAsync(): Promise< carriers.TriggerScriptEntity >;
36
- saveTriggerScriptEntityAsync(entity: carriers.TriggerScriptEntity) : Promise< carriers.TriggerScriptEntity >;
37
- deleteTriggerScriptEntityAsync(TriggerScriptEntityId: number) : Promise<void>;
38
- getCRMScriptByUniqueIdentifierAsync(request: carriers.CRMScript_GetCRMScriptByUniqueIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Script >;
39
- getCRMScriptByUniqueIdentifierAsync(uniqueIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Script >;
40
- saveCRMScriptByUniqueIdentifierAsync(request: carriers.CRMScript_SaveCRMScriptByUniqueIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Script >;
41
- saveCRMScriptByUniqueIdentifierAsync(uniqueIdentifier: string, crmscript: carriers.Script, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Script >;
42
- deleteCRMScriptByUniqueIdentifierAsync(request: carriers.CRMScript_DeleteCRMScriptByUniqueIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
43
- deleteCRMScriptByUniqueIdentifierAsync(uniqueIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
44
- getCRMScriptEntityAsync(cRMScriptEntityId: number) : Promise< carriers.CRMScriptEntity >;
45
- saveCRMScriptEntityWithoutCompileAsync(request: carriers.CRMScript_SaveCRMScriptEntityWithoutCompileRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptEntity >;
46
- saveCRMScriptEntityWithoutCompileAsync(crmScriptEntity: carriers.CRMScriptEntity, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptEntity >;
47
- executeScriptAsync(request: carriers.CRMScript_ExecuteScriptRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
48
- executeScriptAsync(crmScriptId: number, parameters: carriers.StringDictionary, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
49
- executeScriptByIncludeIdAsync(request: carriers.CRMScript_ExecuteScriptByIncludeIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
50
- executeScriptByIncludeIdAsync(crmScriptIncludeId: string, parameters: carriers.StringDictionary, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
51
- executeScriptByUniqueIdAsync(request: carriers.CRMScript_ExecuteScriptByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
52
- executeScriptByUniqueIdAsync(crmScriptUniqueId: string, parameters: carriers.StringDictionary, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
53
- executeScriptAsEventAsync(request: carriers.CRMScript_ExecuteScriptAsEventRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EventData >;
54
- executeScriptAsEventAsync(crmScriptId: number, eventData: carriers.EventData, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EventData >;
55
- executeScriptAsEventByUniqueIdAsync(request: carriers.CRMScript_ExecuteScriptAsEventByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EventData >;
56
- executeScriptAsEventByUniqueIdAsync(crmScriptUniqueId: string, eventData: carriers.EventData, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EventData >;
57
- validateScriptAsync(request: carriers.CRMScript_ValidateScriptRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
58
- validateScriptAsync(crmScriptId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
59
- validateScriptByIncludeIdAsync(request: carriers.CRMScript_ValidateScriptByIncludeIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
60
- validateScriptByIncludeIdAsync(crmScriptIncludeId: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
61
- validateScriptByUniqueIdAsync(request: carriers.CRMScript_ValidateScriptByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
62
- validateScriptByUniqueIdAsync(crmScriptUniqueId: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
63
- executeScriptByStringAsync(request: carriers.CRMScript_ExecuteScriptByStringRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptRunResult >;
64
- executeScriptByStringAsync(script: string, parameters: carriers.StringDictionary, eventData: carriers.EventData, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptRunResult >;
65
- validateScriptByStringAsync(request: carriers.CRMScript_ValidateScriptByStringRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
66
- validateScriptByStringAsync(script: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
67
- resolveIncludesAsync(request: carriers.CRMScript_ResolveIncludesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number[] >;
68
- resolveIncludesAsync(script: string, ignoreErrors: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< number[] >;
69
- getTriggerScriptEntityAsync(triggerScriptEntityId: number) : Promise< carriers.TriggerScriptEntity >;
70
- getTriggerScriptByUniqueIdAsync(request: carriers.CRMScript_GetTriggerScriptByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TriggerScriptEntity >;
71
- getTriggerScriptByUniqueIdAsync(triggerScriptUniqueId: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TriggerScriptEntity >;
72
- saveTriggerScriptByUniqueIdAsync(request: carriers.CRMScript_SaveTriggerScriptByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TriggerScriptEntity >;
73
- saveTriggerScriptByUniqueIdAsync(triggerScriptUniqueId: string, entity: carriers.TriggerScriptEntity, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TriggerScriptEntity >;
74
- deleteTriggerScriptByUniqueIdAsync(request: carriers.CRMScript_DeleteTriggerScriptByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
75
- deleteTriggerScriptByUniqueIdAsync(triggerScriptUniqueId: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
76
- validateTriggerScriptAsync(request: carriers.CRMScript_ValidateTriggerScriptRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
77
- validateTriggerScriptAsync(triggerScriptId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
78
- validateTriggerScriptByUniqueIdAsync(request: carriers.CRMScript_ValidateTriggerScriptByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
79
- validateTriggerScriptByUniqueIdAsync(triggerScriptUniqueId: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
80
- } // interface ICRMScriptAgent
81
-
82
-
83
-
84
-
85
- /**
86
- * Manage and execute CRMScript functions.
87
- */
88
- export class CRMScriptAgent extends base.WebApiBase implements ICRMScriptAgent {
89
- constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
90
- constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
91
- constructor(baseUrl: string, resourceManager:any);
92
- constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
93
- constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
94
- constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
95
- constructor(options: base.WebApiOptions);
96
-
97
- constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
98
- langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
99
- langOrResourceOrRM?:string|base.ResourceParsing|any,
100
- cultureCode?: string,
101
- ) {
102
- const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
103
- options.basePath = "v1/Agents/CRMScript/";
104
- super(options);
105
- }
106
-
107
-
108
-
109
- /**
110
- * Set default values into a new CRMScriptEntity.
111
- * NetServer calculates default values on the entity, which is required when creating/storing a new instance
112
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
113
- * @returns A blank entity.
114
- */
115
- public async createDefaultCRMScriptEntityAsync(options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptEntity > {
116
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
117
- base.WebApiBase.SetPending(options);
118
- return new Promise< carriers.CRMScriptEntity >(async (resolve, reject) => {
119
- try {
120
- const response = await this._axios.post("CreateDefaultCRMScriptEntity", null, config);
121
- base.WebApiBase.SetCompleted(options, response);
122
- const res : carriers.CRMScriptEntity = converters.Create_CRMScriptEntity_From( response.data );
123
- resolve(res);
124
- }
125
- catch( err ) {
126
- base.WebApiBase.HandleError(options, config, err);
127
- reject(err);
128
- }
129
- });
130
- }
131
- /**
132
- * Replace the existing CRMScriptEntity or creates a new CRMScriptEntity if the id parameter is empty
133
- * @param entity - The CRMScriptEntity to be saved.
134
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
135
- * @returns New or updated CRMScriptEntity
136
- */
137
- public async saveCRMScriptEntityAsync(entity: carriers.CRMScriptEntity, options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptEntity > {
138
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
139
- base.WebApiBase.SetPending(options);
140
- return new Promise< carriers.CRMScriptEntity >(async (resolve, reject) => {
141
- try {
142
- const response = await this._axios.post("SaveCRMScriptEntity", entity, config);
143
- base.WebApiBase.SetCompleted(options, response);
144
- const res : carriers.CRMScriptEntity = converters.Create_CRMScriptEntity_From( response.data );
145
- resolve(res);
146
- }
147
- catch( err ) {
148
- base.WebApiBase.HandleError(options, config, err);
149
- reject(err);
150
- }
151
- });
152
- }
153
-
154
- /**
155
- * Deletes the CRMScriptEntity
156
- * @param CRMScriptEntityId - The id of the CRMScriptEntity to be deleted.
157
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
158
- */
159
- public async deleteCRMScriptEntityAsync(CRMScriptEntityId: number, options?:base.WebApiRequestOptions) : Promise< void > {
160
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
161
- base.WebApiBase.SetPending(options);
162
- return new Promise< void >(async (resolve, reject) => {
163
- try {
164
- const response = await this._axios.post("DeleteCRMScriptEntity?CRMScriptEntityId=" + CRMScriptEntityId, null, config );
165
- base.WebApiBase.SetCompleted(options, response);
166
- const res = response.data;
167
- resolve(res);
168
- }
169
- catch( err ) {
170
- base.WebApiBase.HandleError(options, config, err);
171
- reject(err);
172
- }
173
- });
174
- }
175
-
176
- /**
177
- * Set default values into a new TriggerScriptEntity.
178
- * NetServer calculates default values on the entity, which is required when creating/storing a new instance
179
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
180
- * @returns A blank entity.
181
- */
182
- public async createDefaultTriggerScriptEntityAsync(options?:base.WebApiRequestOptions) : Promise< carriers.TriggerScriptEntity > {
183
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
184
- base.WebApiBase.SetPending(options);
185
- return new Promise< carriers.TriggerScriptEntity >(async (resolve, reject) => {
186
- try {
187
- const response = await this._axios.post("CreateDefaultTriggerScriptEntity", null, config);
188
- base.WebApiBase.SetCompleted(options, response);
189
- const res : carriers.TriggerScriptEntity = converters.Create_TriggerScriptEntity_From( response.data );
190
- resolve(res);
191
- }
192
- catch( err ) {
193
- base.WebApiBase.HandleError(options, config, err);
194
- reject(err);
195
- }
196
- });
197
- }
198
- /**
199
- * Replace the existing TriggerScriptEntity or creates a new TriggerScriptEntity if the id parameter is empty
200
- * @param entity - The TriggerScriptEntity to be saved.
201
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
202
- * @returns New or updated TriggerScriptEntity
203
- */
204
- public async saveTriggerScriptEntityAsync(entity: carriers.TriggerScriptEntity, options?:base.WebApiRequestOptions) : Promise< carriers.TriggerScriptEntity > {
205
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
206
- base.WebApiBase.SetPending(options);
207
- return new Promise< carriers.TriggerScriptEntity >(async (resolve, reject) => {
208
- try {
209
- const response = await this._axios.post("SaveTriggerScriptEntity", entity, config);
210
- base.WebApiBase.SetCompleted(options, response);
211
- const res : carriers.TriggerScriptEntity = converters.Create_TriggerScriptEntity_From( response.data );
212
- resolve(res);
213
- }
214
- catch( err ) {
215
- base.WebApiBase.HandleError(options, config, err);
216
- reject(err);
217
- }
218
- });
219
- }
220
-
221
- /**
222
- * Deletes the TriggerScriptEntity
223
- * @param TriggerScriptEntityId - The id of the TriggerScriptEntity to be deleted.
224
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
225
- */
226
- public async deleteTriggerScriptEntityAsync(TriggerScriptEntityId: number, options?:base.WebApiRequestOptions) : Promise< void > {
227
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
228
- base.WebApiBase.SetPending(options);
229
- return new Promise< void >(async (resolve, reject) => {
230
- try {
231
- const response = await this._axios.post("DeleteTriggerScriptEntity?TriggerScriptEntityId=" + TriggerScriptEntityId, null, config );
232
- base.WebApiBase.SetCompleted(options, response);
233
- const res = response.data;
234
- resolve(res);
235
- }
236
- catch( err ) {
237
- base.WebApiBase.HandleError(options, config, err);
238
- reject(err);
239
- }
240
- });
241
- }
242
-
243
- private async _getCRMScriptByUniqueIdentifierAsync(request: carriers.CRMScript_GetCRMScriptByUniqueIdentifierRequest, options?:base.WebApiRequestOptions) : Promise< carriers.Script > {
244
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
245
- base.WebApiBase.SetPending(options);
246
- return new Promise< carriers.Script >(async (resolve, reject) => {
247
- try {
248
- config.baseURL = this._options.baseUrl;
249
- const response = await this._axios.post("GetCRMScriptByUniqueIdentifier", request , config);
250
- base.WebApiBase.SetCompleted(options, response);
251
- const res : carriers.Script = converters.Create_Script_From( response.data );
252
- resolve(res);
253
- }
254
- catch( err ) {
255
- base.WebApiBase.HandleError(options, config, err);
256
- reject(err);
257
- }
258
- });
259
- }
260
-
261
-
262
-
263
- /**
264
- * Get information about a script from a unique identifier
265
- * @param request - UniqueIdentifier
266
- * @returns Information about CRMScript
267
- */
268
- public async getCRMScriptByUniqueIdentifierAsync(request: carriers.CRMScript_GetCRMScriptByUniqueIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Script >;
269
-
270
- /**
271
- * Get information about a script from a unique identifier
272
- * @param uniqueIdentifier - Global unique reference to script (independent of installation)
273
- * @returns Information about CRMScript
274
- */
275
- public async getCRMScriptByUniqueIdentifierAsync(uniqueIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Script >;
276
-
277
- public async getCRMScriptByUniqueIdentifierAsync(uniqueIdentifier:string|carriers.CRMScript_GetCRMScriptByUniqueIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Script > {
278
- let _request : carriers.CRMScript_GetCRMScriptByUniqueIdentifierRequest = null;
279
- let _options : base.WebApiRequestOptions = null;
280
- const first : any = uniqueIdentifier;
281
- if( typeof( first ) === "object" && first && ( typeof(first.uniqueIdentifier)!='undefined' ) )
282
- {
283
- _request = uniqueIdentifier as carriers.CRMScript_GetCRMScriptByUniqueIdentifierRequest;
284
- _options = webapi_options as base.WebApiRequestOptions;
285
- }
286
- else
287
- {
288
- _request = {
289
- uniqueIdentifier: uniqueIdentifier as string,
290
- };
291
- _options = webapi_options;
292
- }
293
- return this._getCRMScriptByUniqueIdentifierAsync( _request, _options );
294
- }
295
-
296
-
297
- private async _saveCRMScriptByUniqueIdentifierAsync(request: carriers.CRMScript_SaveCRMScriptByUniqueIdentifierRequest, options?:base.WebApiRequestOptions) : Promise< carriers.Script > {
298
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
299
- base.WebApiBase.SetPending(options);
300
- return new Promise< carriers.Script >(async (resolve, reject) => {
301
- try {
302
- config.baseURL = this._options.baseUrl;
303
- const response = await this._axios.post("SaveCRMScriptByUniqueIdentifier", request , config);
304
- base.WebApiBase.SetCompleted(options, response);
305
- const res : carriers.Script = converters.Create_Script_From( response.data );
306
- resolve(res);
307
- }
308
- catch( err ) {
309
- base.WebApiBase.HandleError(options, config, err);
310
- reject(err);
311
- }
312
- });
313
- }
314
-
315
-
316
-
317
- /**
318
- * Create or Update the CRMScript information
319
- * @param request - UniqueIdentifier, Crmscript
320
- * @returns Information about the CRMScript as saved in the database
321
- */
322
- public async saveCRMScriptByUniqueIdentifierAsync(request: carriers.CRMScript_SaveCRMScriptByUniqueIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Script >;
323
-
324
- /**
325
- * Create or Update the CRMScript information
326
- * @param uniqueIdentifier - Global unique reference to script (independent of installation)
327
- * @param crmscript - Information about the CRMScript
328
- * @returns Information about the CRMScript as saved in the database
329
- */
330
- public async saveCRMScriptByUniqueIdentifierAsync(uniqueIdentifier: string, crmscript: carriers.Script, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Script >;
331
-
332
- public async saveCRMScriptByUniqueIdentifierAsync(uniqueIdentifier:string|carriers.CRMScript_SaveCRMScriptByUniqueIdentifierRequest, crmscript?:carriers.Script|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Script > {
333
- let _request : carriers.CRMScript_SaveCRMScriptByUniqueIdentifierRequest = null;
334
- let _options : base.WebApiRequestOptions = null;
335
- const first : any = uniqueIdentifier;
336
- if( typeof( first ) === "object" && first && ( typeof(first.uniqueIdentifier)!='undefined' || typeof(first.crmscript)!='undefined' ) )
337
- {
338
- _request = uniqueIdentifier as carriers.CRMScript_SaveCRMScriptByUniqueIdentifierRequest;
339
- _options = crmscript as base.WebApiRequestOptions;
340
- }
341
- else
342
- {
343
- _request = {
344
- uniqueIdentifier: uniqueIdentifier as string,
345
- crmscript: crmscript as carriers.Script,
346
- };
347
- _options = webapi_options;
348
- }
349
- return this._saveCRMScriptByUniqueIdentifierAsync( _request, _options );
350
- }
351
-
352
-
353
- private async _deleteCRMScriptByUniqueIdentifierAsync(request: carriers.CRMScript_DeleteCRMScriptByUniqueIdentifierRequest, options?:base.WebApiRequestOptions) : Promise< void > {
354
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
355
- base.WebApiBase.SetPending(options);
356
- return new Promise< void >(async (resolve, reject) => {
357
- try {
358
- config.baseURL = this._options.baseUrl;
359
- const response = await this._axios.post("DeleteCRMScriptByUniqueIdentifier", request , config);
360
- base.WebApiBase.SetCompleted(options, response);
361
- const res = response.data;
362
- resolve(res);
363
- }
364
- catch( err ) {
365
- base.WebApiBase.HandleError(options, config, err);
366
- reject(err);
367
- }
368
- });
369
- }
370
-
371
-
372
-
373
- /**
374
- * Delete the CRMScript
375
- * @param request - UniqueIdentifier
376
- * @returns This method has no return value
377
- */
378
- public async deleteCRMScriptByUniqueIdentifierAsync(request: carriers.CRMScript_DeleteCRMScriptByUniqueIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
379
-
380
- /**
381
- * Delete the CRMScript
382
- * @param uniqueIdentifier - Global unique reference to script (independent of installation)
383
- * @returns This method has no return value
384
- */
385
- public async deleteCRMScriptByUniqueIdentifierAsync(uniqueIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
386
-
387
- public async deleteCRMScriptByUniqueIdentifierAsync(uniqueIdentifier:string|carriers.CRMScript_DeleteCRMScriptByUniqueIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
388
- let _request : carriers.CRMScript_DeleteCRMScriptByUniqueIdentifierRequest = null;
389
- let _options : base.WebApiRequestOptions = null;
390
- const first : any = uniqueIdentifier;
391
- if( typeof( first ) === "object" && first && ( typeof(first.uniqueIdentifier)!='undefined' ) )
392
- {
393
- _request = uniqueIdentifier as carriers.CRMScript_DeleteCRMScriptByUniqueIdentifierRequest;
394
- _options = webapi_options as base.WebApiRequestOptions;
395
- }
396
- else
397
- {
398
- _request = {
399
- uniqueIdentifier: uniqueIdentifier as string,
400
- };
401
- _options = webapi_options;
402
- }
403
- return this._deleteCRMScriptByUniqueIdentifierAsync( _request, _options );
404
- }
405
-
406
- /**
407
- * Gets a CRMScriptEntity object.
408
- * @param cRMScriptEntityId - The primary key.
409
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
410
- * @returns A single CRMScriptEntity
411
- */
412
- public async getCRMScriptEntityAsync(cRMScriptEntityId: number, options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptEntity > {
413
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
414
- base.WebApiBase.SetPending(options);
415
- return new Promise< carriers.CRMScriptEntity >(async (resolve, reject) => {
416
- try {
417
- const response = await this._axios.post("GetCRMScriptEntity?cRMScriptEntityId=" + cRMScriptEntityId, null, config);
418
- base.WebApiBase.SetCompleted(options, response);
419
- const res = converters.Create_CRMScriptEntity_From( response.data );
420
- resolve(res);
421
- }
422
- catch( err ) {
423
- base.WebApiBase.HandleError(options, config, err);
424
- reject(err);
425
- }
426
- });
427
- }
428
-
429
-
430
- private async _saveCRMScriptEntityWithoutCompileAsync(request: carriers.CRMScript_SaveCRMScriptEntityWithoutCompileRequest, options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptEntity > {
431
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
432
- base.WebApiBase.SetPending(options);
433
- return new Promise< carriers.CRMScriptEntity >(async (resolve, reject) => {
434
- try {
435
- config.baseURL = this._options.baseUrl;
436
- const response = await this._axios.post("SaveCRMScriptEntityWithoutCompile", request , config);
437
- base.WebApiBase.SetCompleted(options, response);
438
- const res : carriers.CRMScriptEntity = converters.Create_CRMScriptEntity_From( response.data );
439
- resolve(res);
440
- }
441
- catch( err ) {
442
- base.WebApiBase.HandleError(options, config, err);
443
- reject(err);
444
- }
445
- });
446
- }
447
-
448
-
449
-
450
- /**
451
- * Save the script directly without compiling TypeScript
452
- * @param request - CrmScriptEntity
453
- * @returns The saved entity
454
- */
455
- public async saveCRMScriptEntityWithoutCompileAsync(request: carriers.CRMScript_SaveCRMScriptEntityWithoutCompileRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptEntity >;
456
-
457
- /**
458
- * Save the script directly without compiling TypeScript
459
- * @param crmScriptEntity - The entity to save. Source and SourceCode should both be specified
460
- * @returns The saved entity
461
- */
462
- public async saveCRMScriptEntityWithoutCompileAsync(crmScriptEntity: carriers.CRMScriptEntity, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptEntity >;
463
-
464
- public async saveCRMScriptEntityWithoutCompileAsync(crmScriptEntity:carriers.CRMScriptEntity|carriers.CRMScript_SaveCRMScriptEntityWithoutCompileRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptEntity > {
465
- let _request : carriers.CRMScript_SaveCRMScriptEntityWithoutCompileRequest = null;
466
- let _options : base.WebApiRequestOptions = null;
467
- const first : any = crmScriptEntity;
468
- if( typeof( first ) === "object" && first && ( typeof(first.crmScriptEntity)!='undefined' ) )
469
- {
470
- _request = crmScriptEntity as carriers.CRMScript_SaveCRMScriptEntityWithoutCompileRequest;
471
- _options = webapi_options as base.WebApiRequestOptions;
472
- }
473
- else
474
- {
475
- _request = {
476
- crmScriptEntity: crmScriptEntity as carriers.CRMScriptEntity,
477
- };
478
- _options = webapi_options;
479
- }
480
- return this._saveCRMScriptEntityWithoutCompileAsync( _request, _options );
481
- }
482
-
483
-
484
- private async _executeScriptAsync(request: carriers.CRMScript_ExecuteScriptRequest, options?:base.WebApiRequestOptions) : Promise< string > {
485
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
486
- base.WebApiBase.SetPending(options);
487
- return new Promise< string >(async (resolve, reject) => {
488
- try {
489
- config.baseURL = this._options.baseUrl;
490
- const response = await this._axios.post("ExecuteScript", request , config);
491
- base.WebApiBase.SetCompleted(options, response);
492
- const res : string = response.data as string;
493
- resolve(res);
494
- }
495
- catch( err ) {
496
- base.WebApiBase.HandleError(options, config, err);
497
- reject(err);
498
- }
499
- });
500
- }
501
-
502
-
503
-
504
- /**
505
- * Execute a CRMScript with parameters, returning printed output value.
506
- * @param request - CRMScriptId, Parameters
507
- * @returns The output produced by the CRMScript
508
- */
509
- public async executeScriptAsync(request: carriers.CRMScript_ExecuteScriptRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
510
-
511
- /**
512
- * Execute a CRMScript with parameters, returning printed output value.
513
- * @param crmScriptId - The id of the CRMScript to execute
514
- * @param parameters - Parameters passed as variables to the CRMScript
515
- * @returns The output produced by the CRMScript
516
- */
517
- public async executeScriptAsync(crmScriptId: number, parameters: carriers.StringDictionary, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
518
-
519
- public async executeScriptAsync(crmScriptId:number|carriers.CRMScript_ExecuteScriptRequest, parameters?:carriers.StringDictionary|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
520
- let _request : carriers.CRMScript_ExecuteScriptRequest = null;
521
- let _options : base.WebApiRequestOptions = null;
522
- const first : any = crmScriptId;
523
- if( typeof( first ) === "object" && first && ( typeof(first.crmScriptId)!='undefined' || typeof(first.parameters)!='undefined' ) )
524
- {
525
- _request = crmScriptId as carriers.CRMScript_ExecuteScriptRequest;
526
- _options = parameters as base.WebApiRequestOptions;
527
- }
528
- else
529
- {
530
- _request = {
531
- crmScriptId: crmScriptId as number,
532
- parameters: parameters as carriers.StringDictionary,
533
- };
534
- _options = webapi_options;
535
- }
536
- return this._executeScriptAsync( _request, _options );
537
- }
538
-
539
-
540
- private async _executeScriptByIncludeIdAsync(request: carriers.CRMScript_ExecuteScriptByIncludeIdRequest, options?:base.WebApiRequestOptions) : Promise< string > {
541
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
542
- base.WebApiBase.SetPending(options);
543
- return new Promise< string >(async (resolve, reject) => {
544
- try {
545
- config.baseURL = this._options.baseUrl;
546
- const response = await this._axios.post("ExecuteScriptByIncludeId", request , config);
547
- base.WebApiBase.SetCompleted(options, response);
548
- const res : string = response.data as string;
549
- resolve(res);
550
- }
551
- catch( err ) {
552
- base.WebApiBase.HandleError(options, config, err);
553
- reject(err);
554
- }
555
- });
556
- }
557
-
558
-
559
-
560
- /**
561
- * Execute a CRMScript with parameters, returning printed output value.
562
- * @param request - CRMScriptIncludeId, Parameters
563
- * @returns The output produced by the CRMScript
564
- */
565
- public async executeScriptByIncludeIdAsync(request: carriers.CRMScript_ExecuteScriptByIncludeIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
566
-
567
- /**
568
- * Execute a CRMScript with parameters, returning printed output value.
569
- * @param crmScriptIncludeId - The include id of the CRMScript to validate
570
- * @param parameters - Parameters passed as variables to the CRMScript
571
- * @returns The output produced by the CRMScript
572
- */
573
- public async executeScriptByIncludeIdAsync(crmScriptIncludeId: string, parameters: carriers.StringDictionary, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
574
-
575
- public async executeScriptByIncludeIdAsync(crmScriptIncludeId:string|carriers.CRMScript_ExecuteScriptByIncludeIdRequest, parameters?:carriers.StringDictionary|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
576
- let _request : carriers.CRMScript_ExecuteScriptByIncludeIdRequest = null;
577
- let _options : base.WebApiRequestOptions = null;
578
- const first : any = crmScriptIncludeId;
579
- if( typeof( first ) === "object" && first && ( typeof(first.crmScriptIncludeId)!='undefined' || typeof(first.parameters)!='undefined' ) )
580
- {
581
- _request = crmScriptIncludeId as carriers.CRMScript_ExecuteScriptByIncludeIdRequest;
582
- _options = parameters as base.WebApiRequestOptions;
583
- }
584
- else
585
- {
586
- _request = {
587
- crmScriptIncludeId: crmScriptIncludeId as string,
588
- parameters: parameters as carriers.StringDictionary,
589
- };
590
- _options = webapi_options;
591
- }
592
- return this._executeScriptByIncludeIdAsync( _request, _options );
593
- }
594
-
595
-
596
- private async _executeScriptByUniqueIdAsync(request: carriers.CRMScript_ExecuteScriptByUniqueIdRequest, options?:base.WebApiRequestOptions) : Promise< string > {
597
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
598
- base.WebApiBase.SetPending(options);
599
- return new Promise< string >(async (resolve, reject) => {
600
- try {
601
- config.baseURL = this._options.baseUrl;
602
- const response = await this._axios.post("ExecuteScriptByUniqueId", request , config);
603
- base.WebApiBase.SetCompleted(options, response);
604
- const res : string = response.data as string;
605
- resolve(res);
606
- }
607
- catch( err ) {
608
- base.WebApiBase.HandleError(options, config, err);
609
- reject(err);
610
- }
611
- });
612
- }
613
-
614
-
615
-
616
- /**
617
- * Execute a CRMScript with parameters, returning printed output value.
618
- * @param request - CRMScriptUniqueId, Parameters
619
- * @returns The output produced by the CRMScript
620
- */
621
- public async executeScriptByUniqueIdAsync(request: carriers.CRMScript_ExecuteScriptByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
622
-
623
- /**
624
- * Execute a CRMScript with parameters, returning printed output value.
625
- * @param crmScriptUniqueId - The unique id of the CRMScript to validate
626
- * @param parameters - Parameters passed as variables to the CRMScript
627
- * @returns The output produced by the CRMScript
628
- */
629
- public async executeScriptByUniqueIdAsync(crmScriptUniqueId: string, parameters: carriers.StringDictionary, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
630
-
631
- public async executeScriptByUniqueIdAsync(crmScriptUniqueId:string|carriers.CRMScript_ExecuteScriptByUniqueIdRequest, parameters?:carriers.StringDictionary|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
632
- let _request : carriers.CRMScript_ExecuteScriptByUniqueIdRequest = null;
633
- let _options : base.WebApiRequestOptions = null;
634
- const first : any = crmScriptUniqueId;
635
- if( typeof( first ) === "object" && first && ( typeof(first.crmScriptUniqueId)!='undefined' || typeof(first.parameters)!='undefined' ) )
636
- {
637
- _request = crmScriptUniqueId as carriers.CRMScript_ExecuteScriptByUniqueIdRequest;
638
- _options = parameters as base.WebApiRequestOptions;
639
- }
640
- else
641
- {
642
- _request = {
643
- crmScriptUniqueId: crmScriptUniqueId as string,
644
- parameters: parameters as carriers.StringDictionary,
645
- };
646
- _options = webapi_options;
647
- }
648
- return this._executeScriptByUniqueIdAsync( _request, _options );
649
- }
650
-
651
-
652
- private async _executeScriptAsEventAsync(request: carriers.CRMScript_ExecuteScriptAsEventRequest, options?:base.WebApiRequestOptions) : Promise< carriers.EventData > {
653
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
654
- base.WebApiBase.SetPending(options);
655
- return new Promise< carriers.EventData >(async (resolve, reject) => {
656
- try {
657
- config.baseURL = this._options.baseUrl;
658
- const response = await this._axios.post("ExecuteScriptAsEvent", request , config);
659
- base.WebApiBase.SetCompleted(options, response);
660
- const res : carriers.EventData = converters.Create_EventData_From( response.data );
661
- resolve(res);
662
- }
663
- catch( err ) {
664
- base.WebApiBase.HandleError(options, config, err);
665
- reject(err);
666
- }
667
- });
668
- }
669
-
670
-
671
-
672
- /**
673
- * Execute a CRMScript with event data as input. Returns event data with output variable values.
674
- * @param request - CRMScriptId, EventData
675
- * @returns The EventData instance after script execution with output values
676
- */
677
- public async executeScriptAsEventAsync(request: carriers.CRMScript_ExecuteScriptAsEventRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EventData >;
678
-
679
- /**
680
- * Execute a CRMScript with event data as input. Returns event data with output variable values.
681
- * @param crmScriptId - The id of the CRMScript to execute
682
- * @param eventData - The EventData instance sent to the crmscript with input values
683
- * @returns The EventData instance after script execution with output values
684
- */
685
- public async executeScriptAsEventAsync(crmScriptId: number, eventData: carriers.EventData, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EventData >;
686
-
687
- public async executeScriptAsEventAsync(crmScriptId:number|carriers.CRMScript_ExecuteScriptAsEventRequest, eventData?:carriers.EventData|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EventData > {
688
- let _request : carriers.CRMScript_ExecuteScriptAsEventRequest = null;
689
- let _options : base.WebApiRequestOptions = null;
690
- const first : any = crmScriptId;
691
- if( typeof( first ) === "object" && first && ( typeof(first.crmScriptId)!='undefined' || typeof(first.eventData)!='undefined' ) )
692
- {
693
- _request = crmScriptId as carriers.CRMScript_ExecuteScriptAsEventRequest;
694
- _options = eventData as base.WebApiRequestOptions;
695
- }
696
- else
697
- {
698
- _request = {
699
- crmScriptId: crmScriptId as number,
700
- eventData: eventData as carriers.EventData,
701
- };
702
- _options = webapi_options;
703
- }
704
- return this._executeScriptAsEventAsync( _request, _options );
705
- }
706
-
707
-
708
- private async _executeScriptAsEventByUniqueIdAsync(request: carriers.CRMScript_ExecuteScriptAsEventByUniqueIdRequest, options?:base.WebApiRequestOptions) : Promise< carriers.EventData > {
709
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
710
- base.WebApiBase.SetPending(options);
711
- return new Promise< carriers.EventData >(async (resolve, reject) => {
712
- try {
713
- config.baseURL = this._options.baseUrl;
714
- const response = await this._axios.post("ExecuteScriptAsEventByUniqueId", request , config);
715
- base.WebApiBase.SetCompleted(options, response);
716
- const res : carriers.EventData = converters.Create_EventData_From( response.data );
717
- resolve(res);
718
- }
719
- catch( err ) {
720
- base.WebApiBase.HandleError(options, config, err);
721
- reject(err);
722
- }
723
- });
724
- }
725
-
726
-
727
-
728
- /**
729
- * Execute a CRMScript with event data as input. Returns event data with output variable values.
730
- * @param request - CRMScriptUniqueId, EventData
731
- * @returns The EventData instance after script execution with output values
732
- */
733
- public async executeScriptAsEventByUniqueIdAsync(request: carriers.CRMScript_ExecuteScriptAsEventByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EventData >;
734
-
735
- /**
736
- * Execute a CRMScript with event data as input. Returns event data with output variable values.
737
- * @param crmScriptUniqueId - The unique id of the CRMScript to execute
738
- * @param eventData - The EventData instance sent to the crmscript with input values
739
- * @returns The EventData instance after script execution with output values
740
- */
741
- public async executeScriptAsEventByUniqueIdAsync(crmScriptUniqueId: string, eventData: carriers.EventData, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EventData >;
742
-
743
- public async executeScriptAsEventByUniqueIdAsync(crmScriptUniqueId:string|carriers.CRMScript_ExecuteScriptAsEventByUniqueIdRequest, eventData?:carriers.EventData|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EventData > {
744
- let _request : carriers.CRMScript_ExecuteScriptAsEventByUniqueIdRequest = null;
745
- let _options : base.WebApiRequestOptions = null;
746
- const first : any = crmScriptUniqueId;
747
- if( typeof( first ) === "object" && first && ( typeof(first.crmScriptUniqueId)!='undefined' || typeof(first.eventData)!='undefined' ) )
748
- {
749
- _request = crmScriptUniqueId as carriers.CRMScript_ExecuteScriptAsEventByUniqueIdRequest;
750
- _options = eventData as base.WebApiRequestOptions;
751
- }
752
- else
753
- {
754
- _request = {
755
- crmScriptUniqueId: crmScriptUniqueId as string,
756
- eventData: eventData as carriers.EventData,
757
- };
758
- _options = webapi_options;
759
- }
760
- return this._executeScriptAsEventByUniqueIdAsync( _request, _options );
761
- }
762
-
763
-
764
- private async _validateScriptAsync(request: carriers.CRMScript_ValidateScriptRequest, options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult > {
765
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
766
- base.WebApiBase.SetPending(options);
767
- return new Promise< carriers.CRMScriptResult >(async (resolve, reject) => {
768
- try {
769
- config.baseURL = this._options.baseUrl;
770
- const response = await this._axios.post("ValidateScript", request , config);
771
- base.WebApiBase.SetCompleted(options, response);
772
- const res : carriers.CRMScriptResult = converters.Create_CRMScriptResult_From( response.data );
773
- resolve(res);
774
- }
775
- catch( err ) {
776
- base.WebApiBase.HandleError(options, config, err);
777
- reject(err);
778
- }
779
- });
780
- }
781
-
782
-
783
-
784
- /**
785
- * Validate a CRMScript. This will check that the syntax is correct
786
- * @param request - CRMScriptId
787
- * @returns True if the syntax is correct
788
- */
789
- public async validateScriptAsync(request: carriers.CRMScript_ValidateScriptRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
790
-
791
- /**
792
- * Validate a CRMScript. This will check that the syntax is correct
793
- * @param crmScriptId - The id of the CRMScript to execute
794
- * @returns True if the syntax is correct
795
- */
796
- public async validateScriptAsync(crmScriptId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
797
-
798
- public async validateScriptAsync(crmScriptId:number|carriers.CRMScript_ValidateScriptRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult > {
799
- let _request : carriers.CRMScript_ValidateScriptRequest = null;
800
- let _options : base.WebApiRequestOptions = null;
801
- const first : any = crmScriptId;
802
- if( typeof( first ) === "object" && first && ( typeof(first.crmScriptId)!='undefined' ) )
803
- {
804
- _request = crmScriptId as carriers.CRMScript_ValidateScriptRequest;
805
- _options = webapi_options as base.WebApiRequestOptions;
806
- }
807
- else
808
- {
809
- _request = {
810
- crmScriptId: crmScriptId as number,
811
- };
812
- _options = webapi_options;
813
- }
814
- return this._validateScriptAsync( _request, _options );
815
- }
816
-
817
-
818
- private async _validateScriptByIncludeIdAsync(request: carriers.CRMScript_ValidateScriptByIncludeIdRequest, options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult > {
819
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
820
- base.WebApiBase.SetPending(options);
821
- return new Promise< carriers.CRMScriptResult >(async (resolve, reject) => {
822
- try {
823
- config.baseURL = this._options.baseUrl;
824
- const response = await this._axios.post("ValidateScriptByIncludeId", request , config);
825
- base.WebApiBase.SetCompleted(options, response);
826
- const res : carriers.CRMScriptResult = converters.Create_CRMScriptResult_From( response.data );
827
- resolve(res);
828
- }
829
- catch( err ) {
830
- base.WebApiBase.HandleError(options, config, err);
831
- reject(err);
832
- }
833
- });
834
- }
835
-
836
-
837
-
838
- /**
839
- * Validate a CRMScript. This will check that the syntax is correct
840
- * @param request - CRMScriptIncludeId
841
- * @returns True if the syntax is correct
842
- */
843
- public async validateScriptByIncludeIdAsync(request: carriers.CRMScript_ValidateScriptByIncludeIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
844
-
845
- /**
846
- * Validate a CRMScript. This will check that the syntax is correct
847
- * @param crmScriptIncludeId - The include id of the CRMScript to validate
848
- * @returns True if the syntax is correct
849
- */
850
- public async validateScriptByIncludeIdAsync(crmScriptIncludeId: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
851
-
852
- public async validateScriptByIncludeIdAsync(crmScriptIncludeId:string|carriers.CRMScript_ValidateScriptByIncludeIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult > {
853
- let _request : carriers.CRMScript_ValidateScriptByIncludeIdRequest = null;
854
- let _options : base.WebApiRequestOptions = null;
855
- const first : any = crmScriptIncludeId;
856
- if( typeof( first ) === "object" && first && ( typeof(first.crmScriptIncludeId)!='undefined' ) )
857
- {
858
- _request = crmScriptIncludeId as carriers.CRMScript_ValidateScriptByIncludeIdRequest;
859
- _options = webapi_options as base.WebApiRequestOptions;
860
- }
861
- else
862
- {
863
- _request = {
864
- crmScriptIncludeId: crmScriptIncludeId as string,
865
- };
866
- _options = webapi_options;
867
- }
868
- return this._validateScriptByIncludeIdAsync( _request, _options );
869
- }
870
-
871
-
872
- private async _validateScriptByUniqueIdAsync(request: carriers.CRMScript_ValidateScriptByUniqueIdRequest, options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult > {
873
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
874
- base.WebApiBase.SetPending(options);
875
- return new Promise< carriers.CRMScriptResult >(async (resolve, reject) => {
876
- try {
877
- config.baseURL = this._options.baseUrl;
878
- const response = await this._axios.post("ValidateScriptByUniqueId", request , config);
879
- base.WebApiBase.SetCompleted(options, response);
880
- const res : carriers.CRMScriptResult = converters.Create_CRMScriptResult_From( response.data );
881
- resolve(res);
882
- }
883
- catch( err ) {
884
- base.WebApiBase.HandleError(options, config, err);
885
- reject(err);
886
- }
887
- });
888
- }
889
-
890
-
891
-
892
- /**
893
- * Validate a CRMScript. This will check that the syntax is correct
894
- * @param request - CRMScriptUniqueId
895
- * @returns True if the syntax is correct
896
- */
897
- public async validateScriptByUniqueIdAsync(request: carriers.CRMScript_ValidateScriptByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
898
-
899
- /**
900
- * Validate a CRMScript. This will check that the syntax is correct
901
- * @param crmScriptUniqueId - The unique id of the CRMScript to validate
902
- * @returns True if the syntax is correct
903
- */
904
- public async validateScriptByUniqueIdAsync(crmScriptUniqueId: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
905
-
906
- public async validateScriptByUniqueIdAsync(crmScriptUniqueId:string|carriers.CRMScript_ValidateScriptByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult > {
907
- let _request : carriers.CRMScript_ValidateScriptByUniqueIdRequest = null;
908
- let _options : base.WebApiRequestOptions = null;
909
- const first : any = crmScriptUniqueId;
910
- if( typeof( first ) === "object" && first && ( typeof(first.crmScriptUniqueId)!='undefined' ) )
911
- {
912
- _request = crmScriptUniqueId as carriers.CRMScript_ValidateScriptByUniqueIdRequest;
913
- _options = webapi_options as base.WebApiRequestOptions;
914
- }
915
- else
916
- {
917
- _request = {
918
- crmScriptUniqueId: crmScriptUniqueId as string,
919
- };
920
- _options = webapi_options;
921
- }
922
- return this._validateScriptByUniqueIdAsync( _request, _options );
923
- }
924
-
925
-
926
- private async _executeScriptByStringAsync(request: carriers.CRMScript_ExecuteScriptByStringRequest, options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptRunResult > {
927
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
928
- base.WebApiBase.SetPending(options);
929
- return new Promise< carriers.CRMScriptRunResult >(async (resolve, reject) => {
930
- try {
931
- config.baseURL = this._options.baseUrl;
932
- const response = await this._axios.post("ExecuteScriptByString", request , config);
933
- base.WebApiBase.SetCompleted(options, response);
934
- const res : carriers.CRMScriptRunResult = converters.Create_CRMScriptRunResult_From( response.data );
935
- resolve(res);
936
- }
937
- catch( err ) {
938
- base.WebApiBase.HandleError(options, config, err);
939
- reject(err);
940
- }
941
- });
942
- }
943
-
944
-
945
-
946
- /**
947
- * Execute a CRMScript 2 (JavaScript), returning the printed output value.
948
- * @param request - Script, Parameters, EventData
949
- * @returns The output produced by the CRMScript
950
- */
951
- public async executeScriptByStringAsync(request: carriers.CRMScript_ExecuteScriptByStringRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptRunResult >;
952
-
953
- /**
954
- * Execute a CRMScript 2 (JavaScript), returning the printed output value.
955
- * @param script - The script to execute
956
- * @param parameters - Parameters passed as variables to the CRMScript
957
- * @param eventData - The EventData instance sent to the crmscript with input values
958
- * @returns The output produced by the CRMScript
959
- */
960
- public async executeScriptByStringAsync(script: string, parameters: carriers.StringDictionary, eventData: carriers.EventData, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptRunResult >;
961
-
962
- public async executeScriptByStringAsync(script:string|carriers.CRMScript_ExecuteScriptByStringRequest, parameters?:carriers.StringDictionary|base.WebApiRequestOptions, eventData?:carriers.EventData, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptRunResult > {
963
- let _request : carriers.CRMScript_ExecuteScriptByStringRequest = null;
964
- let _options : base.WebApiRequestOptions = null;
965
- const first : any = script;
966
- if( typeof( first ) === "object" && first && ( typeof(first.script)!='undefined' || typeof(first.parameters)!='undefined' || typeof(first.eventData)!='undefined' ) )
967
- {
968
- _request = script as carriers.CRMScript_ExecuteScriptByStringRequest;
969
- _options = parameters as base.WebApiRequestOptions;
970
- }
971
- else
972
- {
973
- _request = {
974
- script: script as string,
975
- parameters: parameters as carriers.StringDictionary,
976
- eventData: eventData as carriers.EventData,
977
- };
978
- _options = webapi_options;
979
- }
980
- return this._executeScriptByStringAsync( _request, _options );
981
- }
982
-
983
-
984
- private async _validateScriptByStringAsync(request: carriers.CRMScript_ValidateScriptByStringRequest, options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult > {
985
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
986
- base.WebApiBase.SetPending(options);
987
- return new Promise< carriers.CRMScriptResult >(async (resolve, reject) => {
988
- try {
989
- config.baseURL = this._options.baseUrl;
990
- const response = await this._axios.post("ValidateScriptByString", request , config);
991
- base.WebApiBase.SetCompleted(options, response);
992
- const res : carriers.CRMScriptResult = converters.Create_CRMScriptResult_From( response.data );
993
- resolve(res);
994
- }
995
- catch( err ) {
996
- base.WebApiBase.HandleError(options, config, err);
997
- reject(err);
998
- }
999
- });
1000
- }
1001
-
1002
-
1003
-
1004
- /**
1005
- * Validate a CRMScript 2 (JavaScript). This will check that the syntax is correct
1006
- * @param request - Script
1007
- * @returns The result of the syntax check
1008
- */
1009
- public async validateScriptByStringAsync(request: carriers.CRMScript_ValidateScriptByStringRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
1010
-
1011
- /**
1012
- * Validate a CRMScript 2 (JavaScript). This will check that the syntax is correct
1013
- * @param script - The script to validate
1014
- * @returns The result of the syntax check
1015
- */
1016
- public async validateScriptByStringAsync(script: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
1017
-
1018
- public async validateScriptByStringAsync(script:string|carriers.CRMScript_ValidateScriptByStringRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult > {
1019
- let _request : carriers.CRMScript_ValidateScriptByStringRequest = null;
1020
- let _options : base.WebApiRequestOptions = null;
1021
- const first : any = script;
1022
- if( typeof( first ) === "object" && first && ( typeof(first.script)!='undefined' ) )
1023
- {
1024
- _request = script as carriers.CRMScript_ValidateScriptByStringRequest;
1025
- _options = webapi_options as base.WebApiRequestOptions;
1026
- }
1027
- else
1028
- {
1029
- _request = {
1030
- script: script as string,
1031
- };
1032
- _options = webapi_options;
1033
- }
1034
- return this._validateScriptByStringAsync( _request, _options );
1035
- }
1036
-
1037
-
1038
- private async _resolveIncludesAsync(request: carriers.CRMScript_ResolveIncludesRequest, options?:base.WebApiRequestOptions) : Promise< number[] > {
1039
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1040
- base.WebApiBase.SetPending(options);
1041
- return new Promise< number[] >(async (resolve, reject) => {
1042
- try {
1043
- config.baseURL = this._options.baseUrl;
1044
- const response = await this._axios.post("ResolveIncludes", request , config);
1045
- base.WebApiBase.SetCompleted(options, response);
1046
- const res : number[] = response.data as number[];
1047
- resolve(res);
1048
- }
1049
- catch( err ) {
1050
- base.WebApiBase.HandleError(options, config, err);
1051
- reject(err);
1052
- }
1053
- });
1054
- }
1055
-
1056
-
1057
-
1058
- /**
1059
- * Will resolve all includes for a TypeScript and return an array of the IDs
1060
- * @param request - Script, IgnoreErrors
1061
- * @returns The ids of all the included scripts
1062
- */
1063
- public async resolveIncludesAsync(request: carriers.CRMScript_ResolveIncludesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number[] >;
1064
-
1065
- /**
1066
- * Will resolve all includes for a TypeScript and return an array of the IDs
1067
- * @param script - The script to resolve includes for
1068
- * @param ignoreErrors - If true, then missing includes will be ignored
1069
- * @returns The ids of all the included scripts
1070
- */
1071
- public async resolveIncludesAsync(script: string, ignoreErrors: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< number[] >;
1072
-
1073
- public async resolveIncludesAsync(script:string|carriers.CRMScript_ResolveIncludesRequest, ignoreErrors?:boolean|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< number[] > {
1074
- let _request : carriers.CRMScript_ResolveIncludesRequest = null;
1075
- let _options : base.WebApiRequestOptions = null;
1076
- const first : any = script;
1077
- if( typeof( first ) === "object" && first && ( typeof(first.script)!='undefined' || typeof(first.ignoreErrors)!='undefined' ) )
1078
- {
1079
- _request = script as carriers.CRMScript_ResolveIncludesRequest;
1080
- _options = ignoreErrors as base.WebApiRequestOptions;
1081
- }
1082
- else
1083
- {
1084
- _request = {
1085
- script: script as string,
1086
- ignoreErrors: ignoreErrors as boolean,
1087
- };
1088
- _options = webapi_options;
1089
- }
1090
- return this._resolveIncludesAsync( _request, _options );
1091
- }
1092
-
1093
- /**
1094
- * Gets a TriggerScriptEntity object.
1095
- * @param triggerScriptEntityId - The primary key.
1096
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
1097
- * @returns A single TriggerScriptEntity
1098
- */
1099
- public async getTriggerScriptEntityAsync(triggerScriptEntityId: number, options?:base.WebApiRequestOptions) : Promise< carriers.TriggerScriptEntity > {
1100
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1101
- base.WebApiBase.SetPending(options);
1102
- return new Promise< carriers.TriggerScriptEntity >(async (resolve, reject) => {
1103
- try {
1104
- const response = await this._axios.post("GetTriggerScriptEntity?triggerScriptEntityId=" + triggerScriptEntityId, null, config);
1105
- base.WebApiBase.SetCompleted(options, response);
1106
- const res = converters.Create_TriggerScriptEntity_From( response.data );
1107
- resolve(res);
1108
- }
1109
- catch( err ) {
1110
- base.WebApiBase.HandleError(options, config, err);
1111
- reject(err);
1112
- }
1113
- });
1114
- }
1115
-
1116
-
1117
- private async _getTriggerScriptByUniqueIdAsync(request: carriers.CRMScript_GetTriggerScriptByUniqueIdRequest, options?:base.WebApiRequestOptions) : Promise< carriers.TriggerScriptEntity > {
1118
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1119
- base.WebApiBase.SetPending(options);
1120
- return new Promise< carriers.TriggerScriptEntity >(async (resolve, reject) => {
1121
- try {
1122
- config.baseURL = this._options.baseUrl;
1123
- const response = await this._axios.post("GetTriggerScriptByUniqueId", request , config);
1124
- base.WebApiBase.SetCompleted(options, response);
1125
- const res : carriers.TriggerScriptEntity = converters.Create_TriggerScriptEntity_From( response.data );
1126
- resolve(res);
1127
- }
1128
- catch( err ) {
1129
- base.WebApiBase.HandleError(options, config, err);
1130
- reject(err);
1131
- }
1132
- });
1133
- }
1134
-
1135
-
1136
-
1137
- /**
1138
- * Get a trigger CRMScript.
1139
- * @param request - TriggerScriptUniqueId
1140
- * @returns Trigger script details and source code.
1141
- */
1142
- public async getTriggerScriptByUniqueIdAsync(request: carriers.CRMScript_GetTriggerScriptByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TriggerScriptEntity >;
1143
-
1144
- /**
1145
- * Get a trigger CRMScript.
1146
- * @param triggerScriptUniqueId - The unique id of the CRMScript to validate
1147
- * @returns Trigger script details and source code.
1148
- */
1149
- public async getTriggerScriptByUniqueIdAsync(triggerScriptUniqueId: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TriggerScriptEntity >;
1150
-
1151
- public async getTriggerScriptByUniqueIdAsync(triggerScriptUniqueId:string|carriers.CRMScript_GetTriggerScriptByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TriggerScriptEntity > {
1152
- let _request : carriers.CRMScript_GetTriggerScriptByUniqueIdRequest = null;
1153
- let _options : base.WebApiRequestOptions = null;
1154
- const first : any = triggerScriptUniqueId;
1155
- if( typeof( first ) === "object" && first && ( typeof(first.triggerScriptUniqueId)!='undefined' ) )
1156
- {
1157
- _request = triggerScriptUniqueId as carriers.CRMScript_GetTriggerScriptByUniqueIdRequest;
1158
- _options = webapi_options as base.WebApiRequestOptions;
1159
- }
1160
- else
1161
- {
1162
- _request = {
1163
- triggerScriptUniqueId: triggerScriptUniqueId as string,
1164
- };
1165
- _options = webapi_options;
1166
- }
1167
- return this._getTriggerScriptByUniqueIdAsync( _request, _options );
1168
- }
1169
-
1170
-
1171
- private async _saveTriggerScriptByUniqueIdAsync(request: carriers.CRMScript_SaveTriggerScriptByUniqueIdRequest, options?:base.WebApiRequestOptions) : Promise< carriers.TriggerScriptEntity > {
1172
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1173
- base.WebApiBase.SetPending(options);
1174
- return new Promise< carriers.TriggerScriptEntity >(async (resolve, reject) => {
1175
- try {
1176
- config.baseURL = this._options.baseUrl;
1177
- const response = await this._axios.post("SaveTriggerScriptByUniqueId", request , config);
1178
- base.WebApiBase.SetCompleted(options, response);
1179
- const res : carriers.TriggerScriptEntity = converters.Create_TriggerScriptEntity_From( response.data );
1180
- resolve(res);
1181
- }
1182
- catch( err ) {
1183
- base.WebApiBase.HandleError(options, config, err);
1184
- reject(err);
1185
- }
1186
- });
1187
- }
1188
-
1189
-
1190
-
1191
- /**
1192
- * Validate a CRMScript. This will check that the syntax is correct
1193
- * @param request - TriggerScriptUniqueId, Entity
1194
- * @returns Trigger script details and source code.
1195
- */
1196
- public async saveTriggerScriptByUniqueIdAsync(request: carriers.CRMScript_SaveTriggerScriptByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TriggerScriptEntity >;
1197
-
1198
- /**
1199
- * Validate a CRMScript. This will check that the syntax is correct
1200
- * @param triggerScriptUniqueId - The unique id of the CRMScript to validate
1201
- * @param entity - Trigger script details and source code
1202
- * @returns Trigger script details and source code.
1203
- */
1204
- public async saveTriggerScriptByUniqueIdAsync(triggerScriptUniqueId: string, entity: carriers.TriggerScriptEntity, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TriggerScriptEntity >;
1205
-
1206
- public async saveTriggerScriptByUniqueIdAsync(triggerScriptUniqueId:string|carriers.CRMScript_SaveTriggerScriptByUniqueIdRequest, entity?:carriers.TriggerScriptEntity|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TriggerScriptEntity > {
1207
- let _request : carriers.CRMScript_SaveTriggerScriptByUniqueIdRequest = null;
1208
- let _options : base.WebApiRequestOptions = null;
1209
- const first : any = triggerScriptUniqueId;
1210
- if( typeof( first ) === "object" && first && ( typeof(first.triggerScriptUniqueId)!='undefined' || typeof(first.entity)!='undefined' ) )
1211
- {
1212
- _request = triggerScriptUniqueId as carriers.CRMScript_SaveTriggerScriptByUniqueIdRequest;
1213
- _options = entity as base.WebApiRequestOptions;
1214
- }
1215
- else
1216
- {
1217
- _request = {
1218
- triggerScriptUniqueId: triggerScriptUniqueId as string,
1219
- entity: entity as carriers.TriggerScriptEntity,
1220
- };
1221
- _options = webapi_options;
1222
- }
1223
- return this._saveTriggerScriptByUniqueIdAsync( _request, _options );
1224
- }
1225
-
1226
-
1227
- private async _deleteTriggerScriptByUniqueIdAsync(request: carriers.CRMScript_DeleteTriggerScriptByUniqueIdRequest, options?:base.WebApiRequestOptions) : Promise< void > {
1228
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1229
- base.WebApiBase.SetPending(options);
1230
- return new Promise< void >(async (resolve, reject) => {
1231
- try {
1232
- config.baseURL = this._options.baseUrl;
1233
- const response = await this._axios.post("DeleteTriggerScriptByUniqueId", request , config);
1234
- base.WebApiBase.SetCompleted(options, response);
1235
- const res = response.data;
1236
- resolve(res);
1237
- }
1238
- catch( err ) {
1239
- base.WebApiBase.HandleError(options, config, err);
1240
- reject(err);
1241
- }
1242
- });
1243
- }
1244
-
1245
-
1246
-
1247
- /**
1248
- * Delete a trigger CRMScript.
1249
- * @param request - TriggerScriptUniqueId
1250
- * @returns This method has no return value
1251
- */
1252
- public async deleteTriggerScriptByUniqueIdAsync(request: carriers.CRMScript_DeleteTriggerScriptByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1253
-
1254
- /**
1255
- * Delete a trigger CRMScript.
1256
- * @param triggerScriptUniqueId - The unique id of the CRMScript to validate
1257
- * @returns This method has no return value
1258
- */
1259
- public async deleteTriggerScriptByUniqueIdAsync(triggerScriptUniqueId: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1260
-
1261
- public async deleteTriggerScriptByUniqueIdAsync(triggerScriptUniqueId:string|carriers.CRMScript_DeleteTriggerScriptByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
1262
- let _request : carriers.CRMScript_DeleteTriggerScriptByUniqueIdRequest = null;
1263
- let _options : base.WebApiRequestOptions = null;
1264
- const first : any = triggerScriptUniqueId;
1265
- if( typeof( first ) === "object" && first && ( typeof(first.triggerScriptUniqueId)!='undefined' ) )
1266
- {
1267
- _request = triggerScriptUniqueId as carriers.CRMScript_DeleteTriggerScriptByUniqueIdRequest;
1268
- _options = webapi_options as base.WebApiRequestOptions;
1269
- }
1270
- else
1271
- {
1272
- _request = {
1273
- triggerScriptUniqueId: triggerScriptUniqueId as string,
1274
- };
1275
- _options = webapi_options;
1276
- }
1277
- return this._deleteTriggerScriptByUniqueIdAsync( _request, _options );
1278
- }
1279
-
1280
-
1281
- private async _validateTriggerScriptAsync(request: carriers.CRMScript_ValidateTriggerScriptRequest, options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult > {
1282
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1283
- base.WebApiBase.SetPending(options);
1284
- return new Promise< carriers.CRMScriptResult >(async (resolve, reject) => {
1285
- try {
1286
- config.baseURL = this._options.baseUrl;
1287
- const response = await this._axios.post("ValidateTriggerScript", request , config);
1288
- base.WebApiBase.SetCompleted(options, response);
1289
- const res : carriers.CRMScriptResult = converters.Create_CRMScriptResult_From( response.data );
1290
- resolve(res);
1291
- }
1292
- catch( err ) {
1293
- base.WebApiBase.HandleError(options, config, err);
1294
- reject(err);
1295
- }
1296
- });
1297
- }
1298
-
1299
-
1300
-
1301
- /**
1302
- * Validate a Trigger CRMScript. This will check that the syntax is correct, but not execute the script.
1303
- * @param request - TriggerScriptId
1304
- * @returns True if the syntax is correct
1305
- */
1306
- public async validateTriggerScriptAsync(request: carriers.CRMScript_ValidateTriggerScriptRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
1307
-
1308
- /**
1309
- * Validate a Trigger CRMScript. This will check that the syntax is correct, but not execute the script.
1310
- * @param triggerScriptId - The id of the CRMScript Trigger to validate
1311
- * @returns True if the syntax is correct
1312
- */
1313
- public async validateTriggerScriptAsync(triggerScriptId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
1314
-
1315
- public async validateTriggerScriptAsync(triggerScriptId:number|carriers.CRMScript_ValidateTriggerScriptRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult > {
1316
- let _request : carriers.CRMScript_ValidateTriggerScriptRequest = null;
1317
- let _options : base.WebApiRequestOptions = null;
1318
- const first : any = triggerScriptId;
1319
- if( typeof( first ) === "object" && first && ( typeof(first.triggerScriptId)!='undefined' ) )
1320
- {
1321
- _request = triggerScriptId as carriers.CRMScript_ValidateTriggerScriptRequest;
1322
- _options = webapi_options as base.WebApiRequestOptions;
1323
- }
1324
- else
1325
- {
1326
- _request = {
1327
- triggerScriptId: triggerScriptId as number,
1328
- };
1329
- _options = webapi_options;
1330
- }
1331
- return this._validateTriggerScriptAsync( _request, _options );
1332
- }
1333
-
1334
-
1335
- private async _validateTriggerScriptByUniqueIdAsync(request: carriers.CRMScript_ValidateTriggerScriptByUniqueIdRequest, options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult > {
1336
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1337
- base.WebApiBase.SetPending(options);
1338
- return new Promise< carriers.CRMScriptResult >(async (resolve, reject) => {
1339
- try {
1340
- config.baseURL = this._options.baseUrl;
1341
- const response = await this._axios.post("ValidateTriggerScriptByUniqueId", request , config);
1342
- base.WebApiBase.SetCompleted(options, response);
1343
- const res : carriers.CRMScriptResult = converters.Create_CRMScriptResult_From( response.data );
1344
- resolve(res);
1345
- }
1346
- catch( err ) {
1347
- base.WebApiBase.HandleError(options, config, err);
1348
- reject(err);
1349
- }
1350
- });
1351
- }
1352
-
1353
-
1354
-
1355
- /**
1356
- * Validate a Trigger CRMScript. This will check that the syntax is correct, but not execute the script.
1357
- * @param request - TriggerScriptUniqueId
1358
- * @returns True if the syntax is correct
1359
- */
1360
- public async validateTriggerScriptByUniqueIdAsync(request: carriers.CRMScript_ValidateTriggerScriptByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
1361
-
1362
- /**
1363
- * Validate a Trigger CRMScript. This will check that the syntax is correct, but not execute the script.
1364
- * @param triggerScriptUniqueId - The unique id of the CRMScript to validate
1365
- * @returns True if the syntax is correct
1366
- */
1367
- public async validateTriggerScriptByUniqueIdAsync(triggerScriptUniqueId: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
1368
-
1369
- public async validateTriggerScriptByUniqueIdAsync(triggerScriptUniqueId:string|carriers.CRMScript_ValidateTriggerScriptByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult > {
1370
- let _request : carriers.CRMScript_ValidateTriggerScriptByUniqueIdRequest = null;
1371
- let _options : base.WebApiRequestOptions = null;
1372
- const first : any = triggerScriptUniqueId;
1373
- if( typeof( first ) === "object" && first && ( typeof(first.triggerScriptUniqueId)!='undefined' ) )
1374
- {
1375
- _request = triggerScriptUniqueId as carriers.CRMScript_ValidateTriggerScriptByUniqueIdRequest;
1376
- _options = webapi_options as base.WebApiRequestOptions;
1377
- }
1378
- else
1379
- {
1380
- _request = {
1381
- triggerScriptUniqueId: triggerScriptUniqueId as string,
1382
- };
1383
- _options = webapi_options;
1384
- }
1385
- return this._validateTriggerScriptByUniqueIdAsync( _request, _options );
1386
- }
1387
-
1388
- } // class v1CRMScriptAgentController
1389
-
1390
-
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/CRMScriptAgent.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
+ * Manage and execute CRMScript functions.
28
+ *
29
+ * **Online Restricted:** This agent is not available in Online by default. Access must be requested specifically when app is registered.
30
+ */
31
+ export interface ICRMScriptAgent {
32
+ createDefaultCRMScriptEntityAsync(): Promise< carriers.CRMScriptEntity >;
33
+ saveCRMScriptEntityAsync(entity: carriers.CRMScriptEntity) : Promise< carriers.CRMScriptEntity >;
34
+ deleteCRMScriptEntityAsync(CRMScriptEntityId: number) : Promise<void>;
35
+ createDefaultTriggerScriptEntityAsync(): Promise< carriers.TriggerScriptEntity >;
36
+ saveTriggerScriptEntityAsync(entity: carriers.TriggerScriptEntity) : Promise< carriers.TriggerScriptEntity >;
37
+ deleteTriggerScriptEntityAsync(TriggerScriptEntityId: number) : Promise<void>;
38
+ getCRMScriptByUniqueIdentifierAsync(request: carriers.CRMScript_GetCRMScriptByUniqueIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Script >;
39
+ getCRMScriptByUniqueIdentifierAsync(uniqueIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Script >;
40
+ saveCRMScriptByUniqueIdentifierAsync(request: carriers.CRMScript_SaveCRMScriptByUniqueIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Script >;
41
+ saveCRMScriptByUniqueIdentifierAsync(uniqueIdentifier: string, crmscript: carriers.Script, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Script >;
42
+ deleteCRMScriptByUniqueIdentifierAsync(request: carriers.CRMScript_DeleteCRMScriptByUniqueIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
43
+ deleteCRMScriptByUniqueIdentifierAsync(uniqueIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
44
+ getCRMScriptEntityAsync(cRMScriptEntityId: number) : Promise< carriers.CRMScriptEntity >;
45
+ saveCRMScriptEntityWithoutCompileAsync(request: carriers.CRMScript_SaveCRMScriptEntityWithoutCompileRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptEntity >;
46
+ saveCRMScriptEntityWithoutCompileAsync(crmScriptEntity: carriers.CRMScriptEntity, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptEntity >;
47
+ executeScriptAsync(request: carriers.CRMScript_ExecuteScriptRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
48
+ executeScriptAsync(crmScriptId: number, parameters: carriers.StringDictionary, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
49
+ executeScriptByIncludeIdAsync(request: carriers.CRMScript_ExecuteScriptByIncludeIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
50
+ executeScriptByIncludeIdAsync(crmScriptIncludeId: string, parameters: carriers.StringDictionary, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
51
+ executeScriptByUniqueIdAsync(request: carriers.CRMScript_ExecuteScriptByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
52
+ executeScriptByUniqueIdAsync(crmScriptUniqueId: string, parameters: carriers.StringDictionary, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
53
+ executeScriptAsEventAsync(request: carriers.CRMScript_ExecuteScriptAsEventRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EventData >;
54
+ executeScriptAsEventAsync(crmScriptId: number, eventData: carriers.EventData, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EventData >;
55
+ executeScriptAsEventByUniqueIdAsync(request: carriers.CRMScript_ExecuteScriptAsEventByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EventData >;
56
+ executeScriptAsEventByUniqueIdAsync(crmScriptUniqueId: string, eventData: carriers.EventData, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EventData >;
57
+ validateScriptAsync(request: carriers.CRMScript_ValidateScriptRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
58
+ validateScriptAsync(crmScriptId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
59
+ validateScriptByIncludeIdAsync(request: carriers.CRMScript_ValidateScriptByIncludeIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
60
+ validateScriptByIncludeIdAsync(crmScriptIncludeId: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
61
+ validateScriptByUniqueIdAsync(request: carriers.CRMScript_ValidateScriptByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
62
+ validateScriptByUniqueIdAsync(crmScriptUniqueId: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
63
+ executeScriptByStringAsync(request: carriers.CRMScript_ExecuteScriptByStringRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptRunResult >;
64
+ executeScriptByStringAsync(script: string, parameters: carriers.StringDictionary, eventData: carriers.EventData, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptRunResult >;
65
+ validateScriptByStringAsync(request: carriers.CRMScript_ValidateScriptByStringRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
66
+ validateScriptByStringAsync(script: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
67
+ resolveIncludesAsync(request: carriers.CRMScript_ResolveIncludesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number[] >;
68
+ resolveIncludesAsync(script: string, ignoreErrors: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< number[] >;
69
+ getTriggerScriptEntityAsync(triggerScriptEntityId: number) : Promise< carriers.TriggerScriptEntity >;
70
+ getTriggerScriptByUniqueIdAsync(request: carriers.CRMScript_GetTriggerScriptByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TriggerScriptEntity >;
71
+ getTriggerScriptByUniqueIdAsync(triggerScriptUniqueId: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TriggerScriptEntity >;
72
+ saveTriggerScriptByUniqueIdAsync(request: carriers.CRMScript_SaveTriggerScriptByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TriggerScriptEntity >;
73
+ saveTriggerScriptByUniqueIdAsync(triggerScriptUniqueId: string, entity: carriers.TriggerScriptEntity, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TriggerScriptEntity >;
74
+ deleteTriggerScriptByUniqueIdAsync(request: carriers.CRMScript_DeleteTriggerScriptByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
75
+ deleteTriggerScriptByUniqueIdAsync(triggerScriptUniqueId: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
76
+ validateTriggerScriptAsync(request: carriers.CRMScript_ValidateTriggerScriptRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
77
+ validateTriggerScriptAsync(triggerScriptId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
78
+ validateTriggerScriptByUniqueIdAsync(request: carriers.CRMScript_ValidateTriggerScriptByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
79
+ validateTriggerScriptByUniqueIdAsync(triggerScriptUniqueId: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
80
+ } // interface ICRMScriptAgent
81
+
82
+
83
+
84
+
85
+ /**
86
+ * Manage and execute CRMScript functions.
87
+ */
88
+ export class CRMScriptAgent extends base.WebApiBase implements ICRMScriptAgent {
89
+ constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
90
+ constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
91
+ constructor(baseUrl: string, resourceManager:any);
92
+ constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
93
+ constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
94
+ constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
95
+ constructor(options: base.WebApiOptions);
96
+
97
+ constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
98
+ langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
99
+ langOrResourceOrRM?:string|base.ResourceParsing|any,
100
+ cultureCode?: string,
101
+ ) {
102
+ const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
103
+ options.basePath = "v1/Agents/CRMScript/";
104
+ super(options);
105
+ }
106
+
107
+
108
+
109
+ /**
110
+ * Set default values into a new CRMScriptEntity.
111
+ * NetServer calculates default values on the entity, which is required when creating/storing a new instance
112
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
113
+ * @returns A blank entity.
114
+ */
115
+ public async createDefaultCRMScriptEntityAsync(options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptEntity > {
116
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
117
+ base.WebApiBase.SetPending(options);
118
+ return new Promise< carriers.CRMScriptEntity >(async (resolve, reject) => {
119
+ try {
120
+ const response = await this._axios.post("CreateDefaultCRMScriptEntity", null, config);
121
+ base.WebApiBase.SetCompleted(options, response);
122
+ const res : carriers.CRMScriptEntity = converters.Create_CRMScriptEntity_From( response.data );
123
+ resolve(res);
124
+ }
125
+ catch( err ) {
126
+ base.WebApiBase.HandleError(options, config, err);
127
+ reject(err);
128
+ }
129
+ });
130
+ }
131
+ /**
132
+ * Replace the existing CRMScriptEntity or creates a new CRMScriptEntity if the id parameter is empty
133
+ * @param entity - The CRMScriptEntity to be saved.
134
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
135
+ * @returns New or updated CRMScriptEntity
136
+ */
137
+ public async saveCRMScriptEntityAsync(entity: carriers.CRMScriptEntity, options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptEntity > {
138
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
139
+ base.WebApiBase.SetPending(options);
140
+ return new Promise< carriers.CRMScriptEntity >(async (resolve, reject) => {
141
+ try {
142
+ const response = await this._axios.post("SaveCRMScriptEntity", entity, config);
143
+ base.WebApiBase.SetCompleted(options, response);
144
+ const res : carriers.CRMScriptEntity = converters.Create_CRMScriptEntity_From( response.data );
145
+ resolve(res);
146
+ }
147
+ catch( err ) {
148
+ base.WebApiBase.HandleError(options, config, err);
149
+ reject(err);
150
+ }
151
+ });
152
+ }
153
+
154
+ /**
155
+ * Deletes the CRMScriptEntity
156
+ * @param CRMScriptEntityId - The id of the CRMScriptEntity to be deleted.
157
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
158
+ */
159
+ public async deleteCRMScriptEntityAsync(CRMScriptEntityId: number, options?:base.WebApiRequestOptions) : Promise< void > {
160
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
161
+ base.WebApiBase.SetPending(options);
162
+ return new Promise< void >(async (resolve, reject) => {
163
+ try {
164
+ const response = await this._axios.post("DeleteCRMScriptEntity?CRMScriptEntityId=" + CRMScriptEntityId, null, config );
165
+ base.WebApiBase.SetCompleted(options, response);
166
+ const res = response.data;
167
+ resolve(res);
168
+ }
169
+ catch( err ) {
170
+ base.WebApiBase.HandleError(options, config, err);
171
+ reject(err);
172
+ }
173
+ });
174
+ }
175
+
176
+ /**
177
+ * Set default values into a new TriggerScriptEntity.
178
+ * NetServer calculates default values on the entity, which is required when creating/storing a new instance
179
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
180
+ * @returns A blank entity.
181
+ */
182
+ public async createDefaultTriggerScriptEntityAsync(options?:base.WebApiRequestOptions) : Promise< carriers.TriggerScriptEntity > {
183
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
184
+ base.WebApiBase.SetPending(options);
185
+ return new Promise< carriers.TriggerScriptEntity >(async (resolve, reject) => {
186
+ try {
187
+ const response = await this._axios.post("CreateDefaultTriggerScriptEntity", null, config);
188
+ base.WebApiBase.SetCompleted(options, response);
189
+ const res : carriers.TriggerScriptEntity = converters.Create_TriggerScriptEntity_From( response.data );
190
+ resolve(res);
191
+ }
192
+ catch( err ) {
193
+ base.WebApiBase.HandleError(options, config, err);
194
+ reject(err);
195
+ }
196
+ });
197
+ }
198
+ /**
199
+ * Replace the existing TriggerScriptEntity or creates a new TriggerScriptEntity if the id parameter is empty
200
+ * @param entity - The TriggerScriptEntity to be saved.
201
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
202
+ * @returns New or updated TriggerScriptEntity
203
+ */
204
+ public async saveTriggerScriptEntityAsync(entity: carriers.TriggerScriptEntity, options?:base.WebApiRequestOptions) : Promise< carriers.TriggerScriptEntity > {
205
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
206
+ base.WebApiBase.SetPending(options);
207
+ return new Promise< carriers.TriggerScriptEntity >(async (resolve, reject) => {
208
+ try {
209
+ const response = await this._axios.post("SaveTriggerScriptEntity", entity, config);
210
+ base.WebApiBase.SetCompleted(options, response);
211
+ const res : carriers.TriggerScriptEntity = converters.Create_TriggerScriptEntity_From( response.data );
212
+ resolve(res);
213
+ }
214
+ catch( err ) {
215
+ base.WebApiBase.HandleError(options, config, err);
216
+ reject(err);
217
+ }
218
+ });
219
+ }
220
+
221
+ /**
222
+ * Deletes the TriggerScriptEntity
223
+ * @param TriggerScriptEntityId - The id of the TriggerScriptEntity to be deleted.
224
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
225
+ */
226
+ public async deleteTriggerScriptEntityAsync(TriggerScriptEntityId: number, options?:base.WebApiRequestOptions) : Promise< void > {
227
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
228
+ base.WebApiBase.SetPending(options);
229
+ return new Promise< void >(async (resolve, reject) => {
230
+ try {
231
+ const response = await this._axios.post("DeleteTriggerScriptEntity?TriggerScriptEntityId=" + TriggerScriptEntityId, null, config );
232
+ base.WebApiBase.SetCompleted(options, response);
233
+ const res = response.data;
234
+ resolve(res);
235
+ }
236
+ catch( err ) {
237
+ base.WebApiBase.HandleError(options, config, err);
238
+ reject(err);
239
+ }
240
+ });
241
+ }
242
+
243
+ private async _getCRMScriptByUniqueIdentifierAsync(request: carriers.CRMScript_GetCRMScriptByUniqueIdentifierRequest, options?:base.WebApiRequestOptions) : Promise< carriers.Script > {
244
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
245
+ base.WebApiBase.SetPending(options);
246
+ return new Promise< carriers.Script >(async (resolve, reject) => {
247
+ try {
248
+ config.baseURL = this._options.baseUrl;
249
+ const response = await this._axios.post("GetCRMScriptByUniqueIdentifier", request , config);
250
+ base.WebApiBase.SetCompleted(options, response);
251
+ const res : carriers.Script = converters.Create_Script_From( response.data );
252
+ resolve(res);
253
+ }
254
+ catch( err ) {
255
+ base.WebApiBase.HandleError(options, config, err);
256
+ reject(err);
257
+ }
258
+ });
259
+ }
260
+
261
+
262
+
263
+ /**
264
+ * Get information about a script from a unique identifier
265
+ * @param request - UniqueIdentifier
266
+ * @returns Information about CRMScript
267
+ */
268
+ public async getCRMScriptByUniqueIdentifierAsync(request: carriers.CRMScript_GetCRMScriptByUniqueIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Script >;
269
+
270
+ /**
271
+ * Get information about a script from a unique identifier
272
+ * @param uniqueIdentifier - Global unique reference to script (independent of installation)
273
+ * @returns Information about CRMScript
274
+ */
275
+ public async getCRMScriptByUniqueIdentifierAsync(uniqueIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Script >;
276
+
277
+ public async getCRMScriptByUniqueIdentifierAsync(uniqueIdentifier:string|carriers.CRMScript_GetCRMScriptByUniqueIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Script > {
278
+ let _request : carriers.CRMScript_GetCRMScriptByUniqueIdentifierRequest = null;
279
+ let _options : base.WebApiRequestOptions = null;
280
+ const first : any = uniqueIdentifier;
281
+ if( typeof( first ) === "object" && first && ( typeof(first.uniqueIdentifier)!='undefined' ) )
282
+ {
283
+ _request = uniqueIdentifier as carriers.CRMScript_GetCRMScriptByUniqueIdentifierRequest;
284
+ _options = webapi_options as base.WebApiRequestOptions;
285
+ }
286
+ else
287
+ {
288
+ _request = {
289
+ uniqueIdentifier: uniqueIdentifier as string,
290
+ };
291
+ _options = webapi_options;
292
+ }
293
+ return this._getCRMScriptByUniqueIdentifierAsync( _request, _options );
294
+ }
295
+
296
+
297
+ private async _saveCRMScriptByUniqueIdentifierAsync(request: carriers.CRMScript_SaveCRMScriptByUniqueIdentifierRequest, options?:base.WebApiRequestOptions) : Promise< carriers.Script > {
298
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
299
+ base.WebApiBase.SetPending(options);
300
+ return new Promise< carriers.Script >(async (resolve, reject) => {
301
+ try {
302
+ config.baseURL = this._options.baseUrl;
303
+ const response = await this._axios.post("SaveCRMScriptByUniqueIdentifier", request , config);
304
+ base.WebApiBase.SetCompleted(options, response);
305
+ const res : carriers.Script = converters.Create_Script_From( response.data );
306
+ resolve(res);
307
+ }
308
+ catch( err ) {
309
+ base.WebApiBase.HandleError(options, config, err);
310
+ reject(err);
311
+ }
312
+ });
313
+ }
314
+
315
+
316
+
317
+ /**
318
+ * Create or Update the CRMScript information
319
+ * @param request - UniqueIdentifier, Crmscript
320
+ * @returns Information about the CRMScript as saved in the database
321
+ */
322
+ public async saveCRMScriptByUniqueIdentifierAsync(request: carriers.CRMScript_SaveCRMScriptByUniqueIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Script >;
323
+
324
+ /**
325
+ * Create or Update the CRMScript information
326
+ * @param uniqueIdentifier - Global unique reference to script (independent of installation)
327
+ * @param crmscript - Information about the CRMScript
328
+ * @returns Information about the CRMScript as saved in the database
329
+ */
330
+ public async saveCRMScriptByUniqueIdentifierAsync(uniqueIdentifier: string, crmscript: carriers.Script, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Script >;
331
+
332
+ public async saveCRMScriptByUniqueIdentifierAsync(uniqueIdentifier:string|carriers.CRMScript_SaveCRMScriptByUniqueIdentifierRequest, crmscript?:carriers.Script|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Script > {
333
+ let _request : carriers.CRMScript_SaveCRMScriptByUniqueIdentifierRequest = null;
334
+ let _options : base.WebApiRequestOptions = null;
335
+ const first : any = uniqueIdentifier;
336
+ if( typeof( first ) === "object" && first && ( typeof(first.uniqueIdentifier)!='undefined' || typeof(first.crmscript)!='undefined' ) )
337
+ {
338
+ _request = uniqueIdentifier as carriers.CRMScript_SaveCRMScriptByUniqueIdentifierRequest;
339
+ _options = crmscript as base.WebApiRequestOptions;
340
+ }
341
+ else
342
+ {
343
+ _request = {
344
+ uniqueIdentifier: uniqueIdentifier as string,
345
+ crmscript: crmscript as carriers.Script,
346
+ };
347
+ _options = webapi_options;
348
+ }
349
+ return this._saveCRMScriptByUniqueIdentifierAsync( _request, _options );
350
+ }
351
+
352
+
353
+ private async _deleteCRMScriptByUniqueIdentifierAsync(request: carriers.CRMScript_DeleteCRMScriptByUniqueIdentifierRequest, options?:base.WebApiRequestOptions) : Promise< void > {
354
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
355
+ base.WebApiBase.SetPending(options);
356
+ return new Promise< void >(async (resolve, reject) => {
357
+ try {
358
+ config.baseURL = this._options.baseUrl;
359
+ const response = await this._axios.post("DeleteCRMScriptByUniqueIdentifier", request , config);
360
+ base.WebApiBase.SetCompleted(options, response);
361
+ const res = response.data;
362
+ resolve(res);
363
+ }
364
+ catch( err ) {
365
+ base.WebApiBase.HandleError(options, config, err);
366
+ reject(err);
367
+ }
368
+ });
369
+ }
370
+
371
+
372
+
373
+ /**
374
+ * Delete the CRMScript
375
+ * @param request - UniqueIdentifier
376
+ * @returns This method has no return value
377
+ */
378
+ public async deleteCRMScriptByUniqueIdentifierAsync(request: carriers.CRMScript_DeleteCRMScriptByUniqueIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
379
+
380
+ /**
381
+ * Delete the CRMScript
382
+ * @param uniqueIdentifier - Global unique reference to script (independent of installation)
383
+ * @returns This method has no return value
384
+ */
385
+ public async deleteCRMScriptByUniqueIdentifierAsync(uniqueIdentifier: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
386
+
387
+ public async deleteCRMScriptByUniqueIdentifierAsync(uniqueIdentifier:string|carriers.CRMScript_DeleteCRMScriptByUniqueIdentifierRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
388
+ let _request : carriers.CRMScript_DeleteCRMScriptByUniqueIdentifierRequest = null;
389
+ let _options : base.WebApiRequestOptions = null;
390
+ const first : any = uniqueIdentifier;
391
+ if( typeof( first ) === "object" && first && ( typeof(first.uniqueIdentifier)!='undefined' ) )
392
+ {
393
+ _request = uniqueIdentifier as carriers.CRMScript_DeleteCRMScriptByUniqueIdentifierRequest;
394
+ _options = webapi_options as base.WebApiRequestOptions;
395
+ }
396
+ else
397
+ {
398
+ _request = {
399
+ uniqueIdentifier: uniqueIdentifier as string,
400
+ };
401
+ _options = webapi_options;
402
+ }
403
+ return this._deleteCRMScriptByUniqueIdentifierAsync( _request, _options );
404
+ }
405
+
406
+ /**
407
+ * Gets a CRMScriptEntity object.
408
+ * @param cRMScriptEntityId - The primary key.
409
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
410
+ * @returns A single CRMScriptEntity
411
+ */
412
+ public async getCRMScriptEntityAsync(cRMScriptEntityId: number, options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptEntity > {
413
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
414
+ base.WebApiBase.SetPending(options);
415
+ return new Promise< carriers.CRMScriptEntity >(async (resolve, reject) => {
416
+ try {
417
+ const response = await this._axios.post("GetCRMScriptEntity?cRMScriptEntityId=" + cRMScriptEntityId, null, config);
418
+ base.WebApiBase.SetCompleted(options, response);
419
+ const res = converters.Create_CRMScriptEntity_From( response.data );
420
+ resolve(res);
421
+ }
422
+ catch( err ) {
423
+ base.WebApiBase.HandleError(options, config, err);
424
+ reject(err);
425
+ }
426
+ });
427
+ }
428
+
429
+
430
+ private async _saveCRMScriptEntityWithoutCompileAsync(request: carriers.CRMScript_SaveCRMScriptEntityWithoutCompileRequest, options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptEntity > {
431
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
432
+ base.WebApiBase.SetPending(options);
433
+ return new Promise< carriers.CRMScriptEntity >(async (resolve, reject) => {
434
+ try {
435
+ config.baseURL = this._options.baseUrl;
436
+ const response = await this._axios.post("SaveCRMScriptEntityWithoutCompile", request , config);
437
+ base.WebApiBase.SetCompleted(options, response);
438
+ const res : carriers.CRMScriptEntity = converters.Create_CRMScriptEntity_From( response.data );
439
+ resolve(res);
440
+ }
441
+ catch( err ) {
442
+ base.WebApiBase.HandleError(options, config, err);
443
+ reject(err);
444
+ }
445
+ });
446
+ }
447
+
448
+
449
+
450
+ /**
451
+ * Save the script directly without compiling TypeScript
452
+ * @param request - CrmScriptEntity
453
+ * @returns The saved entity
454
+ */
455
+ public async saveCRMScriptEntityWithoutCompileAsync(request: carriers.CRMScript_SaveCRMScriptEntityWithoutCompileRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptEntity >;
456
+
457
+ /**
458
+ * Save the script directly without compiling TypeScript
459
+ * @param crmScriptEntity - The entity to save. Source and SourceCode should both be specified
460
+ * @returns The saved entity
461
+ */
462
+ public async saveCRMScriptEntityWithoutCompileAsync(crmScriptEntity: carriers.CRMScriptEntity, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptEntity >;
463
+
464
+ public async saveCRMScriptEntityWithoutCompileAsync(crmScriptEntity:carriers.CRMScriptEntity|carriers.CRMScript_SaveCRMScriptEntityWithoutCompileRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptEntity > {
465
+ let _request : carriers.CRMScript_SaveCRMScriptEntityWithoutCompileRequest = null;
466
+ let _options : base.WebApiRequestOptions = null;
467
+ const first : any = crmScriptEntity;
468
+ if( typeof( first ) === "object" && first && ( typeof(first.crmScriptEntity)!='undefined' ) )
469
+ {
470
+ _request = crmScriptEntity as carriers.CRMScript_SaveCRMScriptEntityWithoutCompileRequest;
471
+ _options = webapi_options as base.WebApiRequestOptions;
472
+ }
473
+ else
474
+ {
475
+ _request = {
476
+ crmScriptEntity: crmScriptEntity as carriers.CRMScriptEntity,
477
+ };
478
+ _options = webapi_options;
479
+ }
480
+ return this._saveCRMScriptEntityWithoutCompileAsync( _request, _options );
481
+ }
482
+
483
+
484
+ private async _executeScriptAsync(request: carriers.CRMScript_ExecuteScriptRequest, options?:base.WebApiRequestOptions) : Promise< string > {
485
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
486
+ base.WebApiBase.SetPending(options);
487
+ return new Promise< string >(async (resolve, reject) => {
488
+ try {
489
+ config.baseURL = this._options.baseUrl;
490
+ const response = await this._axios.post("ExecuteScript", request , config);
491
+ base.WebApiBase.SetCompleted(options, response);
492
+ const res : string = response.data as string;
493
+ resolve(res);
494
+ }
495
+ catch( err ) {
496
+ base.WebApiBase.HandleError(options, config, err);
497
+ reject(err);
498
+ }
499
+ });
500
+ }
501
+
502
+
503
+
504
+ /**
505
+ * Execute a CRMScript with parameters, returning printed output value.
506
+ * @param request - CRMScriptId, Parameters
507
+ * @returns The output produced by the CRMScript
508
+ */
509
+ public async executeScriptAsync(request: carriers.CRMScript_ExecuteScriptRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
510
+
511
+ /**
512
+ * Execute a CRMScript with parameters, returning printed output value.
513
+ * @param crmScriptId - The id of the CRMScript to execute
514
+ * @param parameters - Parameters passed as variables to the CRMScript
515
+ * @returns The output produced by the CRMScript
516
+ */
517
+ public async executeScriptAsync(crmScriptId: number, parameters: carriers.StringDictionary, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
518
+
519
+ public async executeScriptAsync(crmScriptId:number|carriers.CRMScript_ExecuteScriptRequest, parameters?:carriers.StringDictionary|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
520
+ let _request : carriers.CRMScript_ExecuteScriptRequest = null;
521
+ let _options : base.WebApiRequestOptions = null;
522
+ const first : any = crmScriptId;
523
+ if( typeof( first ) === "object" && first && ( typeof(first.crmScriptId)!='undefined' || typeof(first.parameters)!='undefined' ) )
524
+ {
525
+ _request = crmScriptId as carriers.CRMScript_ExecuteScriptRequest;
526
+ _options = parameters as base.WebApiRequestOptions;
527
+ }
528
+ else
529
+ {
530
+ _request = {
531
+ crmScriptId: crmScriptId as number,
532
+ parameters: parameters as carriers.StringDictionary,
533
+ };
534
+ _options = webapi_options;
535
+ }
536
+ return this._executeScriptAsync( _request, _options );
537
+ }
538
+
539
+
540
+ private async _executeScriptByIncludeIdAsync(request: carriers.CRMScript_ExecuteScriptByIncludeIdRequest, options?:base.WebApiRequestOptions) : Promise< string > {
541
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
542
+ base.WebApiBase.SetPending(options);
543
+ return new Promise< string >(async (resolve, reject) => {
544
+ try {
545
+ config.baseURL = this._options.baseUrl;
546
+ const response = await this._axios.post("ExecuteScriptByIncludeId", request , config);
547
+ base.WebApiBase.SetCompleted(options, response);
548
+ const res : string = response.data as string;
549
+ resolve(res);
550
+ }
551
+ catch( err ) {
552
+ base.WebApiBase.HandleError(options, config, err);
553
+ reject(err);
554
+ }
555
+ });
556
+ }
557
+
558
+
559
+
560
+ /**
561
+ * Execute a CRMScript with parameters, returning printed output value.
562
+ * @param request - CRMScriptIncludeId, Parameters
563
+ * @returns The output produced by the CRMScript
564
+ */
565
+ public async executeScriptByIncludeIdAsync(request: carriers.CRMScript_ExecuteScriptByIncludeIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
566
+
567
+ /**
568
+ * Execute a CRMScript with parameters, returning printed output value.
569
+ * @param crmScriptIncludeId - The include id of the CRMScript to validate
570
+ * @param parameters - Parameters passed as variables to the CRMScript
571
+ * @returns The output produced by the CRMScript
572
+ */
573
+ public async executeScriptByIncludeIdAsync(crmScriptIncludeId: string, parameters: carriers.StringDictionary, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
574
+
575
+ public async executeScriptByIncludeIdAsync(crmScriptIncludeId:string|carriers.CRMScript_ExecuteScriptByIncludeIdRequest, parameters?:carriers.StringDictionary|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
576
+ let _request : carriers.CRMScript_ExecuteScriptByIncludeIdRequest = null;
577
+ let _options : base.WebApiRequestOptions = null;
578
+ const first : any = crmScriptIncludeId;
579
+ if( typeof( first ) === "object" && first && ( typeof(first.crmScriptIncludeId)!='undefined' || typeof(first.parameters)!='undefined' ) )
580
+ {
581
+ _request = crmScriptIncludeId as carriers.CRMScript_ExecuteScriptByIncludeIdRequest;
582
+ _options = parameters as base.WebApiRequestOptions;
583
+ }
584
+ else
585
+ {
586
+ _request = {
587
+ crmScriptIncludeId: crmScriptIncludeId as string,
588
+ parameters: parameters as carriers.StringDictionary,
589
+ };
590
+ _options = webapi_options;
591
+ }
592
+ return this._executeScriptByIncludeIdAsync( _request, _options );
593
+ }
594
+
595
+
596
+ private async _executeScriptByUniqueIdAsync(request: carriers.CRMScript_ExecuteScriptByUniqueIdRequest, options?:base.WebApiRequestOptions) : Promise< string > {
597
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
598
+ base.WebApiBase.SetPending(options);
599
+ return new Promise< string >(async (resolve, reject) => {
600
+ try {
601
+ config.baseURL = this._options.baseUrl;
602
+ const response = await this._axios.post("ExecuteScriptByUniqueId", request , config);
603
+ base.WebApiBase.SetCompleted(options, response);
604
+ const res : string = response.data as string;
605
+ resolve(res);
606
+ }
607
+ catch( err ) {
608
+ base.WebApiBase.HandleError(options, config, err);
609
+ reject(err);
610
+ }
611
+ });
612
+ }
613
+
614
+
615
+
616
+ /**
617
+ * Execute a CRMScript with parameters, returning printed output value.
618
+ * @param request - CRMScriptUniqueId, Parameters
619
+ * @returns The output produced by the CRMScript
620
+ */
621
+ public async executeScriptByUniqueIdAsync(request: carriers.CRMScript_ExecuteScriptByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
622
+
623
+ /**
624
+ * Execute a CRMScript with parameters, returning printed output value.
625
+ * @param crmScriptUniqueId - The unique id of the CRMScript to validate
626
+ * @param parameters - Parameters passed as variables to the CRMScript
627
+ * @returns The output produced by the CRMScript
628
+ */
629
+ public async executeScriptByUniqueIdAsync(crmScriptUniqueId: string, parameters: carriers.StringDictionary, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
630
+
631
+ public async executeScriptByUniqueIdAsync(crmScriptUniqueId:string|carriers.CRMScript_ExecuteScriptByUniqueIdRequest, parameters?:carriers.StringDictionary|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< string > {
632
+ let _request : carriers.CRMScript_ExecuteScriptByUniqueIdRequest = null;
633
+ let _options : base.WebApiRequestOptions = null;
634
+ const first : any = crmScriptUniqueId;
635
+ if( typeof( first ) === "object" && first && ( typeof(first.crmScriptUniqueId)!='undefined' || typeof(first.parameters)!='undefined' ) )
636
+ {
637
+ _request = crmScriptUniqueId as carriers.CRMScript_ExecuteScriptByUniqueIdRequest;
638
+ _options = parameters as base.WebApiRequestOptions;
639
+ }
640
+ else
641
+ {
642
+ _request = {
643
+ crmScriptUniqueId: crmScriptUniqueId as string,
644
+ parameters: parameters as carriers.StringDictionary,
645
+ };
646
+ _options = webapi_options;
647
+ }
648
+ return this._executeScriptByUniqueIdAsync( _request, _options );
649
+ }
650
+
651
+
652
+ private async _executeScriptAsEventAsync(request: carriers.CRMScript_ExecuteScriptAsEventRequest, options?:base.WebApiRequestOptions) : Promise< carriers.EventData > {
653
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
654
+ base.WebApiBase.SetPending(options);
655
+ return new Promise< carriers.EventData >(async (resolve, reject) => {
656
+ try {
657
+ config.baseURL = this._options.baseUrl;
658
+ const response = await this._axios.post("ExecuteScriptAsEvent", request , config);
659
+ base.WebApiBase.SetCompleted(options, response);
660
+ const res : carriers.EventData = converters.Create_EventData_From( response.data );
661
+ resolve(res);
662
+ }
663
+ catch( err ) {
664
+ base.WebApiBase.HandleError(options, config, err);
665
+ reject(err);
666
+ }
667
+ });
668
+ }
669
+
670
+
671
+
672
+ /**
673
+ * Execute a CRMScript with event data as input. Returns event data with output variable values.
674
+ * @param request - CRMScriptId, EventData
675
+ * @returns The EventData instance after script execution with output values
676
+ */
677
+ public async executeScriptAsEventAsync(request: carriers.CRMScript_ExecuteScriptAsEventRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EventData >;
678
+
679
+ /**
680
+ * Execute a CRMScript with event data as input. Returns event data with output variable values.
681
+ * @param crmScriptId - The id of the CRMScript to execute
682
+ * @param eventData - The EventData instance sent to the crmscript with input values
683
+ * @returns The EventData instance after script execution with output values
684
+ */
685
+ public async executeScriptAsEventAsync(crmScriptId: number, eventData: carriers.EventData, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EventData >;
686
+
687
+ public async executeScriptAsEventAsync(crmScriptId:number|carriers.CRMScript_ExecuteScriptAsEventRequest, eventData?:carriers.EventData|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EventData > {
688
+ let _request : carriers.CRMScript_ExecuteScriptAsEventRequest = null;
689
+ let _options : base.WebApiRequestOptions = null;
690
+ const first : any = crmScriptId;
691
+ if( typeof( first ) === "object" && first && ( typeof(first.crmScriptId)!='undefined' || typeof(first.eventData)!='undefined' ) )
692
+ {
693
+ _request = crmScriptId as carriers.CRMScript_ExecuteScriptAsEventRequest;
694
+ _options = eventData as base.WebApiRequestOptions;
695
+ }
696
+ else
697
+ {
698
+ _request = {
699
+ crmScriptId: crmScriptId as number,
700
+ eventData: eventData as carriers.EventData,
701
+ };
702
+ _options = webapi_options;
703
+ }
704
+ return this._executeScriptAsEventAsync( _request, _options );
705
+ }
706
+
707
+
708
+ private async _executeScriptAsEventByUniqueIdAsync(request: carriers.CRMScript_ExecuteScriptAsEventByUniqueIdRequest, options?:base.WebApiRequestOptions) : Promise< carriers.EventData > {
709
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
710
+ base.WebApiBase.SetPending(options);
711
+ return new Promise< carriers.EventData >(async (resolve, reject) => {
712
+ try {
713
+ config.baseURL = this._options.baseUrl;
714
+ const response = await this._axios.post("ExecuteScriptAsEventByUniqueId", request , config);
715
+ base.WebApiBase.SetCompleted(options, response);
716
+ const res : carriers.EventData = converters.Create_EventData_From( response.data );
717
+ resolve(res);
718
+ }
719
+ catch( err ) {
720
+ base.WebApiBase.HandleError(options, config, err);
721
+ reject(err);
722
+ }
723
+ });
724
+ }
725
+
726
+
727
+
728
+ /**
729
+ * Execute a CRMScript with event data as input. Returns event data with output variable values.
730
+ * @param request - CRMScriptUniqueId, EventData
731
+ * @returns The EventData instance after script execution with output values
732
+ */
733
+ public async executeScriptAsEventByUniqueIdAsync(request: carriers.CRMScript_ExecuteScriptAsEventByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EventData >;
734
+
735
+ /**
736
+ * Execute a CRMScript with event data as input. Returns event data with output variable values.
737
+ * @param crmScriptUniqueId - The unique id of the CRMScript to execute
738
+ * @param eventData - The EventData instance sent to the crmscript with input values
739
+ * @returns The EventData instance after script execution with output values
740
+ */
741
+ public async executeScriptAsEventByUniqueIdAsync(crmScriptUniqueId: string, eventData: carriers.EventData, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EventData >;
742
+
743
+ public async executeScriptAsEventByUniqueIdAsync(crmScriptUniqueId:string|carriers.CRMScript_ExecuteScriptAsEventByUniqueIdRequest, eventData?:carriers.EventData|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.EventData > {
744
+ let _request : carriers.CRMScript_ExecuteScriptAsEventByUniqueIdRequest = null;
745
+ let _options : base.WebApiRequestOptions = null;
746
+ const first : any = crmScriptUniqueId;
747
+ if( typeof( first ) === "object" && first && ( typeof(first.crmScriptUniqueId)!='undefined' || typeof(first.eventData)!='undefined' ) )
748
+ {
749
+ _request = crmScriptUniqueId as carriers.CRMScript_ExecuteScriptAsEventByUniqueIdRequest;
750
+ _options = eventData as base.WebApiRequestOptions;
751
+ }
752
+ else
753
+ {
754
+ _request = {
755
+ crmScriptUniqueId: crmScriptUniqueId as string,
756
+ eventData: eventData as carriers.EventData,
757
+ };
758
+ _options = webapi_options;
759
+ }
760
+ return this._executeScriptAsEventByUniqueIdAsync( _request, _options );
761
+ }
762
+
763
+
764
+ private async _validateScriptAsync(request: carriers.CRMScript_ValidateScriptRequest, options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult > {
765
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
766
+ base.WebApiBase.SetPending(options);
767
+ return new Promise< carriers.CRMScriptResult >(async (resolve, reject) => {
768
+ try {
769
+ config.baseURL = this._options.baseUrl;
770
+ const response = await this._axios.post("ValidateScript", request , config);
771
+ base.WebApiBase.SetCompleted(options, response);
772
+ const res : carriers.CRMScriptResult = converters.Create_CRMScriptResult_From( response.data );
773
+ resolve(res);
774
+ }
775
+ catch( err ) {
776
+ base.WebApiBase.HandleError(options, config, err);
777
+ reject(err);
778
+ }
779
+ });
780
+ }
781
+
782
+
783
+
784
+ /**
785
+ * Validate a CRMScript. This will check that the syntax is correct
786
+ * @param request - CRMScriptId
787
+ * @returns True if the syntax is correct
788
+ */
789
+ public async validateScriptAsync(request: carriers.CRMScript_ValidateScriptRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
790
+
791
+ /**
792
+ * Validate a CRMScript. This will check that the syntax is correct
793
+ * @param crmScriptId - The id of the CRMScript to execute
794
+ * @returns True if the syntax is correct
795
+ */
796
+ public async validateScriptAsync(crmScriptId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
797
+
798
+ public async validateScriptAsync(crmScriptId:number|carriers.CRMScript_ValidateScriptRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult > {
799
+ let _request : carriers.CRMScript_ValidateScriptRequest = null;
800
+ let _options : base.WebApiRequestOptions = null;
801
+ const first : any = crmScriptId;
802
+ if( typeof( first ) === "object" && first && ( typeof(first.crmScriptId)!='undefined' ) )
803
+ {
804
+ _request = crmScriptId as carriers.CRMScript_ValidateScriptRequest;
805
+ _options = webapi_options as base.WebApiRequestOptions;
806
+ }
807
+ else
808
+ {
809
+ _request = {
810
+ crmScriptId: crmScriptId as number,
811
+ };
812
+ _options = webapi_options;
813
+ }
814
+ return this._validateScriptAsync( _request, _options );
815
+ }
816
+
817
+
818
+ private async _validateScriptByIncludeIdAsync(request: carriers.CRMScript_ValidateScriptByIncludeIdRequest, options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult > {
819
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
820
+ base.WebApiBase.SetPending(options);
821
+ return new Promise< carriers.CRMScriptResult >(async (resolve, reject) => {
822
+ try {
823
+ config.baseURL = this._options.baseUrl;
824
+ const response = await this._axios.post("ValidateScriptByIncludeId", request , config);
825
+ base.WebApiBase.SetCompleted(options, response);
826
+ const res : carriers.CRMScriptResult = converters.Create_CRMScriptResult_From( response.data );
827
+ resolve(res);
828
+ }
829
+ catch( err ) {
830
+ base.WebApiBase.HandleError(options, config, err);
831
+ reject(err);
832
+ }
833
+ });
834
+ }
835
+
836
+
837
+
838
+ /**
839
+ * Validate a CRMScript. This will check that the syntax is correct
840
+ * @param request - CRMScriptIncludeId
841
+ * @returns True if the syntax is correct
842
+ */
843
+ public async validateScriptByIncludeIdAsync(request: carriers.CRMScript_ValidateScriptByIncludeIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
844
+
845
+ /**
846
+ * Validate a CRMScript. This will check that the syntax is correct
847
+ * @param crmScriptIncludeId - The include id of the CRMScript to validate
848
+ * @returns True if the syntax is correct
849
+ */
850
+ public async validateScriptByIncludeIdAsync(crmScriptIncludeId: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
851
+
852
+ public async validateScriptByIncludeIdAsync(crmScriptIncludeId:string|carriers.CRMScript_ValidateScriptByIncludeIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult > {
853
+ let _request : carriers.CRMScript_ValidateScriptByIncludeIdRequest = null;
854
+ let _options : base.WebApiRequestOptions = null;
855
+ const first : any = crmScriptIncludeId;
856
+ if( typeof( first ) === "object" && first && ( typeof(first.crmScriptIncludeId)!='undefined' ) )
857
+ {
858
+ _request = crmScriptIncludeId as carriers.CRMScript_ValidateScriptByIncludeIdRequest;
859
+ _options = webapi_options as base.WebApiRequestOptions;
860
+ }
861
+ else
862
+ {
863
+ _request = {
864
+ crmScriptIncludeId: crmScriptIncludeId as string,
865
+ };
866
+ _options = webapi_options;
867
+ }
868
+ return this._validateScriptByIncludeIdAsync( _request, _options );
869
+ }
870
+
871
+
872
+ private async _validateScriptByUniqueIdAsync(request: carriers.CRMScript_ValidateScriptByUniqueIdRequest, options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult > {
873
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
874
+ base.WebApiBase.SetPending(options);
875
+ return new Promise< carriers.CRMScriptResult >(async (resolve, reject) => {
876
+ try {
877
+ config.baseURL = this._options.baseUrl;
878
+ const response = await this._axios.post("ValidateScriptByUniqueId", request , config);
879
+ base.WebApiBase.SetCompleted(options, response);
880
+ const res : carriers.CRMScriptResult = converters.Create_CRMScriptResult_From( response.data );
881
+ resolve(res);
882
+ }
883
+ catch( err ) {
884
+ base.WebApiBase.HandleError(options, config, err);
885
+ reject(err);
886
+ }
887
+ });
888
+ }
889
+
890
+
891
+
892
+ /**
893
+ * Validate a CRMScript. This will check that the syntax is correct
894
+ * @param request - CRMScriptUniqueId
895
+ * @returns True if the syntax is correct
896
+ */
897
+ public async validateScriptByUniqueIdAsync(request: carriers.CRMScript_ValidateScriptByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
898
+
899
+ /**
900
+ * Validate a CRMScript. This will check that the syntax is correct
901
+ * @param crmScriptUniqueId - The unique id of the CRMScript to validate
902
+ * @returns True if the syntax is correct
903
+ */
904
+ public async validateScriptByUniqueIdAsync(crmScriptUniqueId: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
905
+
906
+ public async validateScriptByUniqueIdAsync(crmScriptUniqueId:string|carriers.CRMScript_ValidateScriptByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult > {
907
+ let _request : carriers.CRMScript_ValidateScriptByUniqueIdRequest = null;
908
+ let _options : base.WebApiRequestOptions = null;
909
+ const first : any = crmScriptUniqueId;
910
+ if( typeof( first ) === "object" && first && ( typeof(first.crmScriptUniqueId)!='undefined' ) )
911
+ {
912
+ _request = crmScriptUniqueId as carriers.CRMScript_ValidateScriptByUniqueIdRequest;
913
+ _options = webapi_options as base.WebApiRequestOptions;
914
+ }
915
+ else
916
+ {
917
+ _request = {
918
+ crmScriptUniqueId: crmScriptUniqueId as string,
919
+ };
920
+ _options = webapi_options;
921
+ }
922
+ return this._validateScriptByUniqueIdAsync( _request, _options );
923
+ }
924
+
925
+
926
+ private async _executeScriptByStringAsync(request: carriers.CRMScript_ExecuteScriptByStringRequest, options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptRunResult > {
927
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
928
+ base.WebApiBase.SetPending(options);
929
+ return new Promise< carriers.CRMScriptRunResult >(async (resolve, reject) => {
930
+ try {
931
+ config.baseURL = this._options.baseUrl;
932
+ const response = await this._axios.post("ExecuteScriptByString", request , config);
933
+ base.WebApiBase.SetCompleted(options, response);
934
+ const res : carriers.CRMScriptRunResult = converters.Create_CRMScriptRunResult_From( response.data );
935
+ resolve(res);
936
+ }
937
+ catch( err ) {
938
+ base.WebApiBase.HandleError(options, config, err);
939
+ reject(err);
940
+ }
941
+ });
942
+ }
943
+
944
+
945
+
946
+ /**
947
+ * Execute a CRMScript 2 (JavaScript), returning the printed output value.
948
+ * @param request - Script, Parameters, EventData
949
+ * @returns The output produced by the CRMScript
950
+ */
951
+ public async executeScriptByStringAsync(request: carriers.CRMScript_ExecuteScriptByStringRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptRunResult >;
952
+
953
+ /**
954
+ * Execute a CRMScript 2 (JavaScript), returning the printed output value.
955
+ * @param script - The script to execute
956
+ * @param parameters - Parameters passed as variables to the CRMScript
957
+ * @param eventData - The EventData instance sent to the crmscript with input values
958
+ * @returns The output produced by the CRMScript
959
+ */
960
+ public async executeScriptByStringAsync(script: string, parameters: carriers.StringDictionary, eventData: carriers.EventData, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptRunResult >;
961
+
962
+ public async executeScriptByStringAsync(script:string|carriers.CRMScript_ExecuteScriptByStringRequest, parameters?:carriers.StringDictionary|base.WebApiRequestOptions, eventData?:carriers.EventData, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptRunResult > {
963
+ let _request : carriers.CRMScript_ExecuteScriptByStringRequest = null;
964
+ let _options : base.WebApiRequestOptions = null;
965
+ const first : any = script;
966
+ if( typeof( first ) === "object" && first && ( typeof(first.script)!='undefined' || typeof(first.parameters)!='undefined' || typeof(first.eventData)!='undefined' ) )
967
+ {
968
+ _request = script as carriers.CRMScript_ExecuteScriptByStringRequest;
969
+ _options = parameters as base.WebApiRequestOptions;
970
+ }
971
+ else
972
+ {
973
+ _request = {
974
+ script: script as string,
975
+ parameters: parameters as carriers.StringDictionary,
976
+ eventData: eventData as carriers.EventData,
977
+ };
978
+ _options = webapi_options;
979
+ }
980
+ return this._executeScriptByStringAsync( _request, _options );
981
+ }
982
+
983
+
984
+ private async _validateScriptByStringAsync(request: carriers.CRMScript_ValidateScriptByStringRequest, options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult > {
985
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
986
+ base.WebApiBase.SetPending(options);
987
+ return new Promise< carriers.CRMScriptResult >(async (resolve, reject) => {
988
+ try {
989
+ config.baseURL = this._options.baseUrl;
990
+ const response = await this._axios.post("ValidateScriptByString", request , config);
991
+ base.WebApiBase.SetCompleted(options, response);
992
+ const res : carriers.CRMScriptResult = converters.Create_CRMScriptResult_From( response.data );
993
+ resolve(res);
994
+ }
995
+ catch( err ) {
996
+ base.WebApiBase.HandleError(options, config, err);
997
+ reject(err);
998
+ }
999
+ });
1000
+ }
1001
+
1002
+
1003
+
1004
+ /**
1005
+ * Validate a CRMScript 2 (JavaScript). This will check that the syntax is correct
1006
+ * @param request - Script
1007
+ * @returns The result of the syntax check
1008
+ */
1009
+ public async validateScriptByStringAsync(request: carriers.CRMScript_ValidateScriptByStringRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
1010
+
1011
+ /**
1012
+ * Validate a CRMScript 2 (JavaScript). This will check that the syntax is correct
1013
+ * @param script - The script to validate
1014
+ * @returns The result of the syntax check
1015
+ */
1016
+ public async validateScriptByStringAsync(script: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
1017
+
1018
+ public async validateScriptByStringAsync(script:string|carriers.CRMScript_ValidateScriptByStringRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult > {
1019
+ let _request : carriers.CRMScript_ValidateScriptByStringRequest = null;
1020
+ let _options : base.WebApiRequestOptions = null;
1021
+ const first : any = script;
1022
+ if( typeof( first ) === "object" && first && ( typeof(first.script)!='undefined' ) )
1023
+ {
1024
+ _request = script as carriers.CRMScript_ValidateScriptByStringRequest;
1025
+ _options = webapi_options as base.WebApiRequestOptions;
1026
+ }
1027
+ else
1028
+ {
1029
+ _request = {
1030
+ script: script as string,
1031
+ };
1032
+ _options = webapi_options;
1033
+ }
1034
+ return this._validateScriptByStringAsync( _request, _options );
1035
+ }
1036
+
1037
+
1038
+ private async _resolveIncludesAsync(request: carriers.CRMScript_ResolveIncludesRequest, options?:base.WebApiRequestOptions) : Promise< number[] > {
1039
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1040
+ base.WebApiBase.SetPending(options);
1041
+ return new Promise< number[] >(async (resolve, reject) => {
1042
+ try {
1043
+ config.baseURL = this._options.baseUrl;
1044
+ const response = await this._axios.post("ResolveIncludes", request , config);
1045
+ base.WebApiBase.SetCompleted(options, response);
1046
+ const res : number[] = response.data as number[];
1047
+ resolve(res);
1048
+ }
1049
+ catch( err ) {
1050
+ base.WebApiBase.HandleError(options, config, err);
1051
+ reject(err);
1052
+ }
1053
+ });
1054
+ }
1055
+
1056
+
1057
+
1058
+ /**
1059
+ * Will resolve all includes for a TypeScript and return an array of the IDs
1060
+ * @param request - Script, IgnoreErrors
1061
+ * @returns The ids of all the included scripts
1062
+ */
1063
+ public async resolveIncludesAsync(request: carriers.CRMScript_ResolveIncludesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number[] >;
1064
+
1065
+ /**
1066
+ * Will resolve all includes for a TypeScript and return an array of the IDs
1067
+ * @param script - The script to resolve includes for
1068
+ * @param ignoreErrors - If true, then missing includes will be ignored
1069
+ * @returns The ids of all the included scripts
1070
+ */
1071
+ public async resolveIncludesAsync(script: string, ignoreErrors: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< number[] >;
1072
+
1073
+ public async resolveIncludesAsync(script:string|carriers.CRMScript_ResolveIncludesRequest, ignoreErrors?:boolean|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< number[] > {
1074
+ let _request : carriers.CRMScript_ResolveIncludesRequest = null;
1075
+ let _options : base.WebApiRequestOptions = null;
1076
+ const first : any = script;
1077
+ if( typeof( first ) === "object" && first && ( typeof(first.script)!='undefined' || typeof(first.ignoreErrors)!='undefined' ) )
1078
+ {
1079
+ _request = script as carriers.CRMScript_ResolveIncludesRequest;
1080
+ _options = ignoreErrors as base.WebApiRequestOptions;
1081
+ }
1082
+ else
1083
+ {
1084
+ _request = {
1085
+ script: script as string,
1086
+ ignoreErrors: ignoreErrors as boolean,
1087
+ };
1088
+ _options = webapi_options;
1089
+ }
1090
+ return this._resolveIncludesAsync( _request, _options );
1091
+ }
1092
+
1093
+ /**
1094
+ * Gets a TriggerScriptEntity object.
1095
+ * @param triggerScriptEntityId - The primary key.
1096
+ * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
1097
+ * @returns A single TriggerScriptEntity
1098
+ */
1099
+ public async getTriggerScriptEntityAsync(triggerScriptEntityId: number, options?:base.WebApiRequestOptions) : Promise< carriers.TriggerScriptEntity > {
1100
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1101
+ base.WebApiBase.SetPending(options);
1102
+ return new Promise< carriers.TriggerScriptEntity >(async (resolve, reject) => {
1103
+ try {
1104
+ const response = await this._axios.post("GetTriggerScriptEntity?triggerScriptEntityId=" + triggerScriptEntityId, null, config);
1105
+ base.WebApiBase.SetCompleted(options, response);
1106
+ const res = converters.Create_TriggerScriptEntity_From( response.data );
1107
+ resolve(res);
1108
+ }
1109
+ catch( err ) {
1110
+ base.WebApiBase.HandleError(options, config, err);
1111
+ reject(err);
1112
+ }
1113
+ });
1114
+ }
1115
+
1116
+
1117
+ private async _getTriggerScriptByUniqueIdAsync(request: carriers.CRMScript_GetTriggerScriptByUniqueIdRequest, options?:base.WebApiRequestOptions) : Promise< carriers.TriggerScriptEntity > {
1118
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1119
+ base.WebApiBase.SetPending(options);
1120
+ return new Promise< carriers.TriggerScriptEntity >(async (resolve, reject) => {
1121
+ try {
1122
+ config.baseURL = this._options.baseUrl;
1123
+ const response = await this._axios.post("GetTriggerScriptByUniqueId", request , config);
1124
+ base.WebApiBase.SetCompleted(options, response);
1125
+ const res : carriers.TriggerScriptEntity = converters.Create_TriggerScriptEntity_From( response.data );
1126
+ resolve(res);
1127
+ }
1128
+ catch( err ) {
1129
+ base.WebApiBase.HandleError(options, config, err);
1130
+ reject(err);
1131
+ }
1132
+ });
1133
+ }
1134
+
1135
+
1136
+
1137
+ /**
1138
+ * Get a trigger CRMScript.
1139
+ * @param request - TriggerScriptUniqueId
1140
+ * @returns Trigger script details and source code.
1141
+ */
1142
+ public async getTriggerScriptByUniqueIdAsync(request: carriers.CRMScript_GetTriggerScriptByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TriggerScriptEntity >;
1143
+
1144
+ /**
1145
+ * Get a trigger CRMScript.
1146
+ * @param triggerScriptUniqueId - The unique id of the CRMScript to validate
1147
+ * @returns Trigger script details and source code.
1148
+ */
1149
+ public async getTriggerScriptByUniqueIdAsync(triggerScriptUniqueId: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TriggerScriptEntity >;
1150
+
1151
+ public async getTriggerScriptByUniqueIdAsync(triggerScriptUniqueId:string|carriers.CRMScript_GetTriggerScriptByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TriggerScriptEntity > {
1152
+ let _request : carriers.CRMScript_GetTriggerScriptByUniqueIdRequest = null;
1153
+ let _options : base.WebApiRequestOptions = null;
1154
+ const first : any = triggerScriptUniqueId;
1155
+ if( typeof( first ) === "object" && first && ( typeof(first.triggerScriptUniqueId)!='undefined' ) )
1156
+ {
1157
+ _request = triggerScriptUniqueId as carriers.CRMScript_GetTriggerScriptByUniqueIdRequest;
1158
+ _options = webapi_options as base.WebApiRequestOptions;
1159
+ }
1160
+ else
1161
+ {
1162
+ _request = {
1163
+ triggerScriptUniqueId: triggerScriptUniqueId as string,
1164
+ };
1165
+ _options = webapi_options;
1166
+ }
1167
+ return this._getTriggerScriptByUniqueIdAsync( _request, _options );
1168
+ }
1169
+
1170
+
1171
+ private async _saveTriggerScriptByUniqueIdAsync(request: carriers.CRMScript_SaveTriggerScriptByUniqueIdRequest, options?:base.WebApiRequestOptions) : Promise< carriers.TriggerScriptEntity > {
1172
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1173
+ base.WebApiBase.SetPending(options);
1174
+ return new Promise< carriers.TriggerScriptEntity >(async (resolve, reject) => {
1175
+ try {
1176
+ config.baseURL = this._options.baseUrl;
1177
+ const response = await this._axios.post("SaveTriggerScriptByUniqueId", request , config);
1178
+ base.WebApiBase.SetCompleted(options, response);
1179
+ const res : carriers.TriggerScriptEntity = converters.Create_TriggerScriptEntity_From( response.data );
1180
+ resolve(res);
1181
+ }
1182
+ catch( err ) {
1183
+ base.WebApiBase.HandleError(options, config, err);
1184
+ reject(err);
1185
+ }
1186
+ });
1187
+ }
1188
+
1189
+
1190
+
1191
+ /**
1192
+ * Validate a CRMScript. This will check that the syntax is correct
1193
+ * @param request - TriggerScriptUniqueId, Entity
1194
+ * @returns Trigger script details and source code.
1195
+ */
1196
+ public async saveTriggerScriptByUniqueIdAsync(request: carriers.CRMScript_SaveTriggerScriptByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TriggerScriptEntity >;
1197
+
1198
+ /**
1199
+ * Validate a CRMScript. This will check that the syntax is correct
1200
+ * @param triggerScriptUniqueId - The unique id of the CRMScript to validate
1201
+ * @param entity - Trigger script details and source code
1202
+ * @returns Trigger script details and source code.
1203
+ */
1204
+ public async saveTriggerScriptByUniqueIdAsync(triggerScriptUniqueId: string, entity: carriers.TriggerScriptEntity, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TriggerScriptEntity >;
1205
+
1206
+ public async saveTriggerScriptByUniqueIdAsync(triggerScriptUniqueId:string|carriers.CRMScript_SaveTriggerScriptByUniqueIdRequest, entity?:carriers.TriggerScriptEntity|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TriggerScriptEntity > {
1207
+ let _request : carriers.CRMScript_SaveTriggerScriptByUniqueIdRequest = null;
1208
+ let _options : base.WebApiRequestOptions = null;
1209
+ const first : any = triggerScriptUniqueId;
1210
+ if( typeof( first ) === "object" && first && ( typeof(first.triggerScriptUniqueId)!='undefined' || typeof(first.entity)!='undefined' ) )
1211
+ {
1212
+ _request = triggerScriptUniqueId as carriers.CRMScript_SaveTriggerScriptByUniqueIdRequest;
1213
+ _options = entity as base.WebApiRequestOptions;
1214
+ }
1215
+ else
1216
+ {
1217
+ _request = {
1218
+ triggerScriptUniqueId: triggerScriptUniqueId as string,
1219
+ entity: entity as carriers.TriggerScriptEntity,
1220
+ };
1221
+ _options = webapi_options;
1222
+ }
1223
+ return this._saveTriggerScriptByUniqueIdAsync( _request, _options );
1224
+ }
1225
+
1226
+
1227
+ private async _deleteTriggerScriptByUniqueIdAsync(request: carriers.CRMScript_DeleteTriggerScriptByUniqueIdRequest, options?:base.WebApiRequestOptions) : Promise< void > {
1228
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1229
+ base.WebApiBase.SetPending(options);
1230
+ return new Promise< void >(async (resolve, reject) => {
1231
+ try {
1232
+ config.baseURL = this._options.baseUrl;
1233
+ const response = await this._axios.post("DeleteTriggerScriptByUniqueId", request , config);
1234
+ base.WebApiBase.SetCompleted(options, response);
1235
+ const res = response.data;
1236
+ resolve(res);
1237
+ }
1238
+ catch( err ) {
1239
+ base.WebApiBase.HandleError(options, config, err);
1240
+ reject(err);
1241
+ }
1242
+ });
1243
+ }
1244
+
1245
+
1246
+
1247
+ /**
1248
+ * Delete a trigger CRMScript.
1249
+ * @param request - TriggerScriptUniqueId
1250
+ * @returns This method has no return value
1251
+ */
1252
+ public async deleteTriggerScriptByUniqueIdAsync(request: carriers.CRMScript_DeleteTriggerScriptByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1253
+
1254
+ /**
1255
+ * Delete a trigger CRMScript.
1256
+ * @param triggerScriptUniqueId - The unique id of the CRMScript to validate
1257
+ * @returns This method has no return value
1258
+ */
1259
+ public async deleteTriggerScriptByUniqueIdAsync(triggerScriptUniqueId: string, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1260
+
1261
+ public async deleteTriggerScriptByUniqueIdAsync(triggerScriptUniqueId:string|carriers.CRMScript_DeleteTriggerScriptByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
1262
+ let _request : carriers.CRMScript_DeleteTriggerScriptByUniqueIdRequest = null;
1263
+ let _options : base.WebApiRequestOptions = null;
1264
+ const first : any = triggerScriptUniqueId;
1265
+ if( typeof( first ) === "object" && first && ( typeof(first.triggerScriptUniqueId)!='undefined' ) )
1266
+ {
1267
+ _request = triggerScriptUniqueId as carriers.CRMScript_DeleteTriggerScriptByUniqueIdRequest;
1268
+ _options = webapi_options as base.WebApiRequestOptions;
1269
+ }
1270
+ else
1271
+ {
1272
+ _request = {
1273
+ triggerScriptUniqueId: triggerScriptUniqueId as string,
1274
+ };
1275
+ _options = webapi_options;
1276
+ }
1277
+ return this._deleteTriggerScriptByUniqueIdAsync( _request, _options );
1278
+ }
1279
+
1280
+
1281
+ private async _validateTriggerScriptAsync(request: carriers.CRMScript_ValidateTriggerScriptRequest, options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult > {
1282
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1283
+ base.WebApiBase.SetPending(options);
1284
+ return new Promise< carriers.CRMScriptResult >(async (resolve, reject) => {
1285
+ try {
1286
+ config.baseURL = this._options.baseUrl;
1287
+ const response = await this._axios.post("ValidateTriggerScript", request , config);
1288
+ base.WebApiBase.SetCompleted(options, response);
1289
+ const res : carriers.CRMScriptResult = converters.Create_CRMScriptResult_From( response.data );
1290
+ resolve(res);
1291
+ }
1292
+ catch( err ) {
1293
+ base.WebApiBase.HandleError(options, config, err);
1294
+ reject(err);
1295
+ }
1296
+ });
1297
+ }
1298
+
1299
+
1300
+
1301
+ /**
1302
+ * Validate a Trigger CRMScript. This will check that the syntax is correct, but not execute the script.
1303
+ * @param request - TriggerScriptId
1304
+ * @returns True if the syntax is correct
1305
+ */
1306
+ public async validateTriggerScriptAsync(request: carriers.CRMScript_ValidateTriggerScriptRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
1307
+
1308
+ /**
1309
+ * Validate a Trigger CRMScript. This will check that the syntax is correct, but not execute the script.
1310
+ * @param triggerScriptId - The id of the CRMScript Trigger to validate
1311
+ * @returns True if the syntax is correct
1312
+ */
1313
+ public async validateTriggerScriptAsync(triggerScriptId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
1314
+
1315
+ public async validateTriggerScriptAsync(triggerScriptId:number|carriers.CRMScript_ValidateTriggerScriptRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult > {
1316
+ let _request : carriers.CRMScript_ValidateTriggerScriptRequest = null;
1317
+ let _options : base.WebApiRequestOptions = null;
1318
+ const first : any = triggerScriptId;
1319
+ if( typeof( first ) === "object" && first && ( typeof(first.triggerScriptId)!='undefined' ) )
1320
+ {
1321
+ _request = triggerScriptId as carriers.CRMScript_ValidateTriggerScriptRequest;
1322
+ _options = webapi_options as base.WebApiRequestOptions;
1323
+ }
1324
+ else
1325
+ {
1326
+ _request = {
1327
+ triggerScriptId: triggerScriptId as number,
1328
+ };
1329
+ _options = webapi_options;
1330
+ }
1331
+ return this._validateTriggerScriptAsync( _request, _options );
1332
+ }
1333
+
1334
+
1335
+ private async _validateTriggerScriptByUniqueIdAsync(request: carriers.CRMScript_ValidateTriggerScriptByUniqueIdRequest, options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult > {
1336
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1337
+ base.WebApiBase.SetPending(options);
1338
+ return new Promise< carriers.CRMScriptResult >(async (resolve, reject) => {
1339
+ try {
1340
+ config.baseURL = this._options.baseUrl;
1341
+ const response = await this._axios.post("ValidateTriggerScriptByUniqueId", request , config);
1342
+ base.WebApiBase.SetCompleted(options, response);
1343
+ const res : carriers.CRMScriptResult = converters.Create_CRMScriptResult_From( response.data );
1344
+ resolve(res);
1345
+ }
1346
+ catch( err ) {
1347
+ base.WebApiBase.HandleError(options, config, err);
1348
+ reject(err);
1349
+ }
1350
+ });
1351
+ }
1352
+
1353
+
1354
+
1355
+ /**
1356
+ * Validate a Trigger CRMScript. This will check that the syntax is correct, but not execute the script.
1357
+ * @param request - TriggerScriptUniqueId
1358
+ * @returns True if the syntax is correct
1359
+ */
1360
+ public async validateTriggerScriptByUniqueIdAsync(request: carriers.CRMScript_ValidateTriggerScriptByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
1361
+
1362
+ /**
1363
+ * Validate a Trigger CRMScript. This will check that the syntax is correct, but not execute the script.
1364
+ * @param triggerScriptUniqueId - The unique id of the CRMScript to validate
1365
+ * @returns True if the syntax is correct
1366
+ */
1367
+ public async validateTriggerScriptByUniqueIdAsync(triggerScriptUniqueId: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult >;
1368
+
1369
+ public async validateTriggerScriptByUniqueIdAsync(triggerScriptUniqueId:string|carriers.CRMScript_ValidateTriggerScriptByUniqueIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CRMScriptResult > {
1370
+ let _request : carriers.CRMScript_ValidateTriggerScriptByUniqueIdRequest = null;
1371
+ let _options : base.WebApiRequestOptions = null;
1372
+ const first : any = triggerScriptUniqueId;
1373
+ if( typeof( first ) === "object" && first && ( typeof(first.triggerScriptUniqueId)!='undefined' ) )
1374
+ {
1375
+ _request = triggerScriptUniqueId as carriers.CRMScript_ValidateTriggerScriptByUniqueIdRequest;
1376
+ _options = webapi_options as base.WebApiRequestOptions;
1377
+ }
1378
+ else
1379
+ {
1380
+ _request = {
1381
+ triggerScriptUniqueId: triggerScriptUniqueId as string,
1382
+ };
1383
+ _options = webapi_options;
1384
+ }
1385
+ return this._validateTriggerScriptByUniqueIdAsync( _request, _options );
1386
+ }
1387
+
1388
+ } // class v1CRMScriptAgentController
1389
+
1390
+