@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.
- package/LICENSE.md +15 -15
- package/README.md +184 -184
- package/__tests__/Appointment63-notz.json +1925 -1925
- package/__tests__/Appointment63-utctz.json +1925 -1925
- package/__tests__/Appointment63.json +1925 -1925
- package/__tests__/AppointmentTzTest.ts +115 -115
- package/__tests__/AxiosNockTest.ts +28 -28
- package/__tests__/ContactDefault.json +699 -699
- package/__tests__/ContactEntity.json +272 -272
- package/__tests__/ContactRestTest.ts +144 -144
- package/__tests__/ContactTest.ts +395 -395
- package/__tests__/ConvertersTest.ts +97 -97
- package/__tests__/DocumentTest.ts +101 -101
- package/__tests__/Person210-notz.json +1932 -1932
- package/__tests__/Person210-utctz.json +1932 -1932
- package/__tests__/Person210.json +1932 -1932
- package/__tests__/PersonImageData.nock +22 -22
- package/__tests__/PersonTest.ts +41 -41
- package/__tests__/PersonTzTest.ts +113 -113
- package/__tests__/RecurrenceInfo.json +55 -55
- package/__tests__/ResponseCallbackTest.ts +23 -23
- package/__tests__/TableRights.json +441 -441
- package/__tests__/WebapiTest.ts +264 -264
- package/__tests__/Webhook.json +16 -16
- package/__tests__/WebhookTest.ts +209 -209
- package/dist/cjs/Carriers.d.ts +367 -4
- package/dist/cjs/Carriers.d.ts.map +1 -1
- package/dist/cjs/Converters.d.ts +9 -0
- package/dist/cjs/Converters.d.ts.map +1 -1
- package/dist/cjs/Converters.js +185 -17
- package/dist/cjs/Converters.js.map +1 -1
- package/dist/cjs/DiagnosticsAgent.d.ts +38 -0
- package/dist/cjs/DiagnosticsAgent.d.ts.map +1 -1
- package/dist/cjs/DiagnosticsAgent.js +91 -0
- package/dist/cjs/DiagnosticsAgent.js.map +1 -1
- package/dist/cjs/Enums.d.ts +18 -0
- package/dist/cjs/Enums.d.ts.map +1 -1
- package/dist/cjs/Enums.js +20 -1
- package/dist/cjs/Enums.js.map +1 -1
- package/dist/cjs/ListAgent.d.ts +71 -6
- package/dist/cjs/ListAgent.d.ts.map +1 -1
- package/dist/cjs/ListAgent.js +157 -0
- package/dist/cjs/ListAgent.js.map +1 -1
- package/dist/cjs/TicketAgent.d.ts +23 -0
- package/dist/cjs/TicketAgent.d.ts.map +1 -1
- package/dist/cjs/TicketAgent.js +65 -0
- package/dist/cjs/TicketAgent.js.map +1 -1
- package/dist/esm/Carriers.d.ts +367 -4
- package/dist/esm/Carriers.d.ts.map +1 -1
- package/dist/esm/Converters.d.ts +9 -0
- package/dist/esm/Converters.d.ts.map +1 -1
- package/dist/esm/Converters.js +159 -0
- package/dist/esm/Converters.js.map +1 -1
- package/dist/esm/DiagnosticsAgent.d.ts +38 -0
- package/dist/esm/DiagnosticsAgent.d.ts.map +1 -1
- package/dist/esm/DiagnosticsAgent.js +91 -0
- package/dist/esm/DiagnosticsAgent.js.map +1 -1
- package/dist/esm/Enums.d.ts +18 -0
- package/dist/esm/Enums.d.ts.map +1 -1
- package/dist/esm/Enums.js +19 -0
- package/dist/esm/Enums.js.map +1 -1
- package/dist/esm/ListAgent.d.ts +71 -6
- package/dist/esm/ListAgent.d.ts.map +1 -1
- package/dist/esm/ListAgent.js +157 -0
- package/dist/esm/ListAgent.js.map +1 -1
- package/dist/esm/TicketAgent.d.ts +23 -0
- package/dist/esm/TicketAgent.d.ts.map +1 -1
- package/dist/esm/TicketAgent.js +65 -0
- package/dist/esm/TicketAgent.js.map +1 -1
- package/examples-js/hello.js +12 -12
- package/examples-ts/hello.ts +8 -8
- package/package.json +93 -93
- package/scripts/postbuild.js +22 -22
- package/scripts/setVersion.js +44 -44
- package/src/AIAgent.ts +1992 -1992
- package/src/AppointmentAgent.ts +6263 -6263
- package/src/AppointmentRestApi.ts +225 -225
- package/src/ArchiveAgent.ts +1950 -1950
- package/src/AssociateAgent.ts +422 -422
- package/src/AxiosCacheHandler.ts +74 -74
- package/src/BLOBAgent.ts +2100 -2100
- package/src/Base64.ts +285 -285
- package/src/BatchAgent.ts +910 -910
- package/src/BulkUpdateAgent.ts +504 -504
- package/src/CRMScriptAgent.ts +1390 -1390
- package/src/Carriers.ts +52750 -52274
- package/src/ChatAgent.ts +1422 -1422
- package/src/ConfigurationAgent.ts +2228 -2228
- package/src/ContactAgent.ts +1756 -1756
- package/src/ContactRestApi.ts +237 -237
- package/src/Converters.ts +23271 -23090
- package/src/CustomerServiceAgent.ts +1799 -1799
- package/src/DashAgent.ts +1674 -1674
- package/src/DatabaseAgent.ts +120 -120
- package/src/DatabaseTableAgent.ts +534 -534
- package/src/Day_js.ts +41 -41
- package/src/DiagnosticsAgent.ts +1384 -1240
- package/src/DocumentAgent.ts +5079 -5079
- package/src/DocumentMigrationAgent.ts +524 -524
- package/src/DocumentRestApi.ts +259 -259
- package/src/EMailAgent.ts +5328 -5328
- package/src/Enums.ts +6936 -6916
- package/src/ErpSyncAgent.ts +2658 -2658
- package/src/FavouriteAgent.ts +720 -720
- package/src/FindAgent.ts +2330 -2330
- package/src/ForeignSystemAgent.ts +1710 -1710
- package/src/FreeTextAgent.ts +372 -372
- package/src/ImportAgent.ts +304 -304
- package/src/LicenseAgent.ts +1230 -1230
- package/src/ListAgent.ts +11451 -11237
- package/src/MDOAgent.ts +748 -748
- package/src/MarketingAgent.ts +890 -890
- package/src/MessagingAgent.ts +384 -384
- package/src/NavigatorAgent.ts +140 -140
- package/src/NumberAllocationAgent.ts +296 -296
- package/src/PersonAgent.ts +3287 -3287
- package/src/PersonRestApi.ts +241 -241
- package/src/PhoneListAgent.ts +458 -458
- package/src/PocketAgent.ts +780 -780
- package/src/PreferenceAgent.ts +1900 -1900
- package/src/PreviewsAgent.ts +116 -116
- package/src/ProjectAgent.ts +2391 -2391
- package/src/ProjectRestApi.ts +239 -239
- package/src/QuoteAgent.ts +5159 -5159
- package/src/RelationAgent.ts +220 -220
- package/src/ReportAgent.ts +154 -154
- package/src/ResourceAgent.ts +358 -358
- package/src/SaintAgent.ts +601 -601
- package/src/SaleAgent.ts +2034 -2034
- package/src/SaleRestApi.ts +233 -233
- package/src/SelectionAgent.ts +3195 -3195
- package/src/SentryAgent.ts +462 -462
- package/src/SoApiConstants.ts +8 -8
- package/src/TargetsAgent.ts +1104 -1104
- package/src/TicketAgent.ts +3708 -3638
- package/src/TimeZoneAgent.ts +528 -528
- package/src/TooltipsAgent.ts +116 -116
- package/src/UserAgent.ts +4856 -4856
- package/src/UserDefinedFieldInfoAgent.ts +1764 -1764
- package/src/ViewStateAgent.ts +858 -858
- package/src/WebApi.ts +872 -872
- package/src/WebApiBase.ts +565 -565
- package/src/WebhookAgent.ts +388 -388
- package/src/WorkflowAgent.ts +1338 -1338
- package/tsconfig.esm.json +8 -8
- package/tsconfig.jest.json +8 -8
- package/tsconfig.json +34 -34
package/src/WorkflowAgent.ts
CHANGED
|
@@ -1,1338 +1,1338 @@
|
|
|
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/WorkflowAgent.ts
|
|
13
|
-
//
|
|
14
|
-
//----------------------------------------------------------------------------
|
|
15
|
-
// Copyright (C) SuperOffice AS
|
|
16
|
-
//----------------------------------------------------------------------------
|
|
17
|
-
|
|
18
|
-
import { AxiosRequestConfig } from 'axios';
|
|
19
|
-
import { Duration } from 'dayjs/plugin/duration';
|
|
20
|
-
import * as enums from './Enums';
|
|
21
|
-
import * as base from './WebApiBase';
|
|
22
|
-
import * as carriers from './Carriers';
|
|
23
|
-
import * as converters from './Converters';
|
|
24
|
-
import { FromBase64ToString, ToBase64 } from './Base64';
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Agent lets you configure workflow automation
|
|
28
|
-
*/
|
|
29
|
-
export interface IWorkflowAgent {
|
|
30
|
-
createDefaultEmailFlowAsync(): Promise< carriers.EmailFlow >;
|
|
31
|
-
saveEmailFlowAsync(entity: carriers.EmailFlow) : Promise< carriers.EmailFlow >;
|
|
32
|
-
deleteEmailFlowAsync(EmailFlowId: number) : Promise<void>;
|
|
33
|
-
createDefaultWorkflowEventAsync(): Promise< carriers.WorkflowEvent >;
|
|
34
|
-
createDefaultWorkflowEventResultAsync(): Promise< carriers.WorkflowEventResult >;
|
|
35
|
-
createDefaultWorkflowFilterAsync(): Promise< carriers.WorkflowFilter >;
|
|
36
|
-
createDefaultWorkflowGoalAsync(): Promise< carriers.WorkflowGoal >;
|
|
37
|
-
saveWorkflowGoalAsync(entity: carriers.WorkflowGoal) : Promise< carriers.WorkflowGoal >;
|
|
38
|
-
deleteWorkflowGoalAsync(WorkflowGoalId: number) : Promise<void>;
|
|
39
|
-
createDefaultWorkflowTriggerAsync(): Promise< carriers.WorkflowTrigger >;
|
|
40
|
-
saveWorkflowTriggerAsync(entity: carriers.WorkflowTrigger) : Promise< carriers.WorkflowTrigger >;
|
|
41
|
-
deleteWorkflowTriggerAsync(WorkflowTriggerId: number) : Promise<void>;
|
|
42
|
-
createDefaultWorkflowWaitForActionAsync(): Promise< carriers.WorkflowWaitForAction >;
|
|
43
|
-
saveWorkflowWaitForActionAsync(entity: carriers.WorkflowWaitForAction) : Promise< carriers.WorkflowWaitForAction >;
|
|
44
|
-
deleteWorkflowWaitForActionAsync(WorkflowWaitForActionId: number) : Promise<void>;
|
|
45
|
-
getEmailFlowAsync(emailFlowId: number) : Promise< carriers.EmailFlow >;
|
|
46
|
-
tryAddPersonsToEmailFlowAsync(request: carriers.Workflow_TryAddPersonsToEmailFlowRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean[] >;
|
|
47
|
-
tryAddPersonsToEmailFlowAsync(emailFlowId: number, personIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< boolean[] >;
|
|
48
|
-
removeParticipantsFromEmailFlowAsync(request: carriers.Workflow_RemoveParticipantsFromEmailFlowRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
49
|
-
removeParticipantsFromEmailFlowAsync(emailFlowId: number, workflowInstanceIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
50
|
-
createEmailFlowContentAsync(request: carriers.Workflow_CreateEmailFlowContentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
51
|
-
createEmailFlowContentAsync(emailFlowId: number, contentName: string, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
52
|
-
connectEmailFlowContentAsync(request: carriers.Workflow_ConnectEmailFlowContentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
53
|
-
connectEmailFlowContentAsync(emailFlowId: number, messageId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
54
|
-
copyEmailFlowContentAsync(request: carriers.Workflow_CopyEmailFlowContentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
55
|
-
copyEmailFlowContentAsync(emailFlowId: number, shipmentId: number, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
56
|
-
updateFormSubmissionsAsync(request: carriers.Workflow_UpdateFormSubmissionsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
57
|
-
updateFormSubmissionsAsync(maxCount: number, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
58
|
-
setStatusOnWorkflowAsync(request: carriers.Workflow_SetStatusOnWorkflowRequest, webapi_options?:base.WebApiRequestOptions) : Promise< enums.WorkflowDefinitionStatus >;
|
|
59
|
-
setStatusOnWorkflowAsync(emailFlowId: number, status: enums.WorkflowDefinitionStatus, webapi_options?:base.WebApiRequestOptions) : Promise< enums.WorkflowDefinitionStatus >;
|
|
60
|
-
copyEmailFlowAsync(request: carriers.Workflow_CopyEmailFlowRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
61
|
-
copyEmailFlowAsync(emailFlowId: number, newName: string, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
62
|
-
runAsync(webapi_options?:base.WebApiRequestOptions) : Promise< Date >;
|
|
63
|
-
sendEventAsync(request: carriers.Workflow_SendEventRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowEventResult >;
|
|
64
|
-
sendEventAsync(workflowEvent: carriers.WorkflowEvent, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowEventResult >;
|
|
65
|
-
getWorkflowGoalAsync(workflowGoalId: number) : Promise< carriers.WorkflowGoal >;
|
|
66
|
-
getWorkflowStepAsync(request: carriers.Workflow_GetWorkflowStepRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase >;
|
|
67
|
-
getWorkflowStepAsync(workflowStepId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase >;
|
|
68
|
-
addAfterWorkflowStepAsync(request: carriers.Workflow_AddAfterWorkflowStepRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase >;
|
|
69
|
-
addAfterWorkflowStepAsync(workflowStepId: number, subStep: carriers.WorkflowStepBase, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase >;
|
|
70
|
-
createDefaultWorkflowStepFromTypeAsync(request: carriers.Workflow_CreateDefaultWorkflowStepFromTypeRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase >;
|
|
71
|
-
createDefaultWorkflowStepFromTypeAsync(stepType: enums.WorkflowStepType, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase >;
|
|
72
|
-
createDefaultWorkflowStepOptionFromTypeAsync(request: carriers.Workflow_CreateDefaultWorkflowStepOptionFromTypeRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepOptionBase >;
|
|
73
|
-
createDefaultWorkflowStepOptionFromTypeAsync(optionType: enums.WorkflowSplitOptionType, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepOptionBase >;
|
|
74
|
-
getWorkflowStepOptionAsync(request: carriers.Workflow_GetWorkflowStepOptionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepOptionBase >;
|
|
75
|
-
getWorkflowStepOptionAsync(workflowStepOptionId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepOptionBase >;
|
|
76
|
-
getWorkflowTriggerAsync(workflowTriggerId: number) : Promise< carriers.WorkflowTrigger >;
|
|
77
|
-
getWorkflowWaitForActionAsync(workflowWaitForActionId: number) : Promise< carriers.WorkflowWaitForAction >;
|
|
78
|
-
} // interface IWorkflowAgent
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Agent lets you configure workflow automation
|
|
85
|
-
*/
|
|
86
|
-
export class WorkflowAgent extends base.WebApiBase implements IWorkflowAgent {
|
|
87
|
-
constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
|
|
88
|
-
constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
|
|
89
|
-
constructor(baseUrl: string, resourceManager:any);
|
|
90
|
-
constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
|
|
91
|
-
constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
|
|
92
|
-
constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
|
|
93
|
-
constructor(options: base.WebApiOptions);
|
|
94
|
-
|
|
95
|
-
constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
|
|
96
|
-
langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
|
|
97
|
-
langOrResourceOrRM?:string|base.ResourceParsing|any,
|
|
98
|
-
cultureCode?: string,
|
|
99
|
-
) {
|
|
100
|
-
const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
|
|
101
|
-
options.basePath = "v1/Agents/Workflow/";
|
|
102
|
-
super(options);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Set default values into a new EmailFlow.
|
|
109
|
-
* NetServer calculates default values on the entity, which is required when creating/storing a new instance
|
|
110
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
111
|
-
* @returns A blank entity.
|
|
112
|
-
*/
|
|
113
|
-
public async createDefaultEmailFlowAsync(options?:base.WebApiRequestOptions) : Promise< carriers.EmailFlow > {
|
|
114
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
115
|
-
base.WebApiBase.SetPending(options);
|
|
116
|
-
return new Promise< carriers.EmailFlow >(async (resolve, reject) => {
|
|
117
|
-
try {
|
|
118
|
-
const response = await this._axios.post("CreateDefaultEmailFlow", null, config);
|
|
119
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
120
|
-
const res : carriers.EmailFlow = converters.Create_EmailFlow_From( response.data );
|
|
121
|
-
resolve(res);
|
|
122
|
-
}
|
|
123
|
-
catch( err ) {
|
|
124
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
125
|
-
reject(err);
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Replace the existing EmailFlow or creates a new EmailFlow if the id parameter is empty
|
|
131
|
-
* @param entity - The EmailFlow to be saved.
|
|
132
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
133
|
-
* @returns New or updated EmailFlow
|
|
134
|
-
*/
|
|
135
|
-
public async saveEmailFlowAsync(entity: carriers.EmailFlow, options?:base.WebApiRequestOptions) : Promise< carriers.EmailFlow > {
|
|
136
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
137
|
-
base.WebApiBase.SetPending(options);
|
|
138
|
-
return new Promise< carriers.EmailFlow >(async (resolve, reject) => {
|
|
139
|
-
try {
|
|
140
|
-
const response = await this._axios.post("SaveEmailFlow", entity, config);
|
|
141
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
142
|
-
const res : carriers.EmailFlow = converters.Create_EmailFlow_From( response.data );
|
|
143
|
-
resolve(res);
|
|
144
|
-
}
|
|
145
|
-
catch( err ) {
|
|
146
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
147
|
-
reject(err);
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Deletes the EmailFlow
|
|
154
|
-
* @param EmailFlowId - The id of the EmailFlow to be deleted.
|
|
155
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
156
|
-
*/
|
|
157
|
-
public async deleteEmailFlowAsync(EmailFlowId: number, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
158
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
159
|
-
base.WebApiBase.SetPending(options);
|
|
160
|
-
return new Promise< void >(async (resolve, reject) => {
|
|
161
|
-
try {
|
|
162
|
-
const response = await this._axios.post("DeleteEmailFlow?EmailFlowId=" + EmailFlowId, null, config );
|
|
163
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
164
|
-
const res = response.data;
|
|
165
|
-
resolve(res);
|
|
166
|
-
}
|
|
167
|
-
catch( err ) {
|
|
168
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
169
|
-
reject(err);
|
|
170
|
-
}
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* Set default values into a new WorkflowEvent.
|
|
176
|
-
* NetServer calculates default values on the entity, which is required when creating/storing a new instance
|
|
177
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
178
|
-
* @returns A blank entity.
|
|
179
|
-
*/
|
|
180
|
-
public async createDefaultWorkflowEventAsync(options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowEvent > {
|
|
181
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
182
|
-
base.WebApiBase.SetPending(options);
|
|
183
|
-
return new Promise< carriers.WorkflowEvent >(async (resolve, reject) => {
|
|
184
|
-
try {
|
|
185
|
-
const response = await this._axios.post("CreateDefaultWorkflowEvent", null, config);
|
|
186
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
187
|
-
const res : carriers.WorkflowEvent = converters.Create_WorkflowEvent_From( response.data );
|
|
188
|
-
resolve(res);
|
|
189
|
-
}
|
|
190
|
-
catch( err ) {
|
|
191
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
192
|
-
reject(err);
|
|
193
|
-
}
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* Set default values into a new WorkflowEventResult.
|
|
199
|
-
* NetServer calculates default values on the entity, which is required when creating/storing a new instance
|
|
200
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
201
|
-
* @returns A blank entity.
|
|
202
|
-
*/
|
|
203
|
-
public async createDefaultWorkflowEventResultAsync(options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowEventResult > {
|
|
204
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
205
|
-
base.WebApiBase.SetPending(options);
|
|
206
|
-
return new Promise< carriers.WorkflowEventResult >(async (resolve, reject) => {
|
|
207
|
-
try {
|
|
208
|
-
const response = await this._axios.post("CreateDefaultWorkflowEventResult", null, config);
|
|
209
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
210
|
-
const res : carriers.WorkflowEventResult = converters.Create_WorkflowEventResult_From( response.data );
|
|
211
|
-
resolve(res);
|
|
212
|
-
}
|
|
213
|
-
catch( err ) {
|
|
214
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
215
|
-
reject(err);
|
|
216
|
-
}
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* Set default values into a new WorkflowFilter.
|
|
222
|
-
* NetServer calculates default values on the entity, which is required when creating/storing a new instance
|
|
223
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
224
|
-
* @returns A blank entity.
|
|
225
|
-
*/
|
|
226
|
-
public async createDefaultWorkflowFilterAsync(options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowFilter > {
|
|
227
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
228
|
-
base.WebApiBase.SetPending(options);
|
|
229
|
-
return new Promise< carriers.WorkflowFilter >(async (resolve, reject) => {
|
|
230
|
-
try {
|
|
231
|
-
const response = await this._axios.post("CreateDefaultWorkflowFilter", null, config);
|
|
232
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
233
|
-
const res : carriers.WorkflowFilter = converters.Create_WorkflowFilter_From( response.data );
|
|
234
|
-
resolve(res);
|
|
235
|
-
}
|
|
236
|
-
catch( err ) {
|
|
237
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
238
|
-
reject(err);
|
|
239
|
-
}
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
/**
|
|
244
|
-
* Set default values into a new WorkflowGoal.
|
|
245
|
-
* NetServer calculates default values on the entity, which is required when creating/storing a new instance
|
|
246
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
247
|
-
* @returns A blank entity.
|
|
248
|
-
*/
|
|
249
|
-
public async createDefaultWorkflowGoalAsync(options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowGoal > {
|
|
250
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
251
|
-
base.WebApiBase.SetPending(options);
|
|
252
|
-
return new Promise< carriers.WorkflowGoal >(async (resolve, reject) => {
|
|
253
|
-
try {
|
|
254
|
-
const response = await this._axios.post("CreateDefaultWorkflowGoal", null, config);
|
|
255
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
256
|
-
const res : carriers.WorkflowGoal = converters.Create_WorkflowGoal_From( response.data );
|
|
257
|
-
resolve(res);
|
|
258
|
-
}
|
|
259
|
-
catch( err ) {
|
|
260
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
261
|
-
reject(err);
|
|
262
|
-
}
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
/**
|
|
266
|
-
* Replace the existing WorkflowGoal or creates a new WorkflowGoal if the id parameter is empty
|
|
267
|
-
* @param entity - The WorkflowGoal to be saved.
|
|
268
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
269
|
-
* @returns New or updated WorkflowGoal
|
|
270
|
-
*/
|
|
271
|
-
public async saveWorkflowGoalAsync(entity: carriers.WorkflowGoal, options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowGoal > {
|
|
272
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
273
|
-
base.WebApiBase.SetPending(options);
|
|
274
|
-
return new Promise< carriers.WorkflowGoal >(async (resolve, reject) => {
|
|
275
|
-
try {
|
|
276
|
-
const response = await this._axios.post("SaveWorkflowGoal", entity, config);
|
|
277
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
278
|
-
const res : carriers.WorkflowGoal = converters.Create_WorkflowGoal_From( response.data );
|
|
279
|
-
resolve(res);
|
|
280
|
-
}
|
|
281
|
-
catch( err ) {
|
|
282
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
283
|
-
reject(err);
|
|
284
|
-
}
|
|
285
|
-
});
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
/**
|
|
289
|
-
* Deletes the WorkflowGoal
|
|
290
|
-
* @param WorkflowGoalId - The id of the WorkflowGoal to be deleted.
|
|
291
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
292
|
-
*/
|
|
293
|
-
public async deleteWorkflowGoalAsync(WorkflowGoalId: number, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
294
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
295
|
-
base.WebApiBase.SetPending(options);
|
|
296
|
-
return new Promise< void >(async (resolve, reject) => {
|
|
297
|
-
try {
|
|
298
|
-
const response = await this._axios.post("DeleteWorkflowGoal?WorkflowGoalId=" + WorkflowGoalId, null, config );
|
|
299
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
300
|
-
const res = response.data;
|
|
301
|
-
resolve(res);
|
|
302
|
-
}
|
|
303
|
-
catch( err ) {
|
|
304
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
305
|
-
reject(err);
|
|
306
|
-
}
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
/**
|
|
311
|
-
* Set default values into a new WorkflowTrigger.
|
|
312
|
-
* NetServer calculates default values on the entity, which is required when creating/storing a new instance
|
|
313
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
314
|
-
* @returns A blank entity.
|
|
315
|
-
*/
|
|
316
|
-
public async createDefaultWorkflowTriggerAsync(options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowTrigger > {
|
|
317
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
318
|
-
base.WebApiBase.SetPending(options);
|
|
319
|
-
return new Promise< carriers.WorkflowTrigger >(async (resolve, reject) => {
|
|
320
|
-
try {
|
|
321
|
-
const response = await this._axios.post("CreateDefaultWorkflowTrigger", null, config);
|
|
322
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
323
|
-
const res : carriers.WorkflowTrigger = converters.Create_WorkflowTrigger_From( response.data );
|
|
324
|
-
resolve(res);
|
|
325
|
-
}
|
|
326
|
-
catch( err ) {
|
|
327
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
328
|
-
reject(err);
|
|
329
|
-
}
|
|
330
|
-
});
|
|
331
|
-
}
|
|
332
|
-
/**
|
|
333
|
-
* Replace the existing WorkflowTrigger or creates a new WorkflowTrigger if the id parameter is empty
|
|
334
|
-
* @param entity - The WorkflowTrigger to be saved.
|
|
335
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
336
|
-
* @returns New or updated WorkflowTrigger
|
|
337
|
-
*/
|
|
338
|
-
public async saveWorkflowTriggerAsync(entity: carriers.WorkflowTrigger, options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowTrigger > {
|
|
339
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
340
|
-
base.WebApiBase.SetPending(options);
|
|
341
|
-
return new Promise< carriers.WorkflowTrigger >(async (resolve, reject) => {
|
|
342
|
-
try {
|
|
343
|
-
const response = await this._axios.post("SaveWorkflowTrigger", entity, config);
|
|
344
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
345
|
-
const res : carriers.WorkflowTrigger = converters.Create_WorkflowTrigger_From( response.data );
|
|
346
|
-
resolve(res);
|
|
347
|
-
}
|
|
348
|
-
catch( err ) {
|
|
349
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
350
|
-
reject(err);
|
|
351
|
-
}
|
|
352
|
-
});
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
/**
|
|
356
|
-
* Deletes the WorkflowTrigger
|
|
357
|
-
* @param WorkflowTriggerId - The id of the WorkflowTrigger to be deleted.
|
|
358
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
359
|
-
*/
|
|
360
|
-
public async deleteWorkflowTriggerAsync(WorkflowTriggerId: number, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
361
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
362
|
-
base.WebApiBase.SetPending(options);
|
|
363
|
-
return new Promise< void >(async (resolve, reject) => {
|
|
364
|
-
try {
|
|
365
|
-
const response = await this._axios.post("DeleteWorkflowTrigger?WorkflowTriggerId=" + WorkflowTriggerId, null, config );
|
|
366
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
367
|
-
const res = response.data;
|
|
368
|
-
resolve(res);
|
|
369
|
-
}
|
|
370
|
-
catch( err ) {
|
|
371
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
372
|
-
reject(err);
|
|
373
|
-
}
|
|
374
|
-
});
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
/**
|
|
378
|
-
* Set default values into a new WorkflowWaitForAction.
|
|
379
|
-
* NetServer calculates default values on the entity, which is required when creating/storing a new instance
|
|
380
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
381
|
-
* @returns A blank entity.
|
|
382
|
-
*/
|
|
383
|
-
public async createDefaultWorkflowWaitForActionAsync(options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowWaitForAction > {
|
|
384
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
385
|
-
base.WebApiBase.SetPending(options);
|
|
386
|
-
return new Promise< carriers.WorkflowWaitForAction >(async (resolve, reject) => {
|
|
387
|
-
try {
|
|
388
|
-
const response = await this._axios.post("CreateDefaultWorkflowWaitForAction", null, config);
|
|
389
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
390
|
-
const res : carriers.WorkflowWaitForAction = converters.Create_WorkflowWaitForAction_From( response.data );
|
|
391
|
-
resolve(res);
|
|
392
|
-
}
|
|
393
|
-
catch( err ) {
|
|
394
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
395
|
-
reject(err);
|
|
396
|
-
}
|
|
397
|
-
});
|
|
398
|
-
}
|
|
399
|
-
/**
|
|
400
|
-
* Replace the existing WorkflowWaitForAction or creates a new WorkflowWaitForAction if the id parameter is empty
|
|
401
|
-
* @param entity - The WorkflowWaitForAction to be saved.
|
|
402
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
403
|
-
* @returns New or updated WorkflowWaitForAction
|
|
404
|
-
*/
|
|
405
|
-
public async saveWorkflowWaitForActionAsync(entity: carriers.WorkflowWaitForAction, options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowWaitForAction > {
|
|
406
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
407
|
-
base.WebApiBase.SetPending(options);
|
|
408
|
-
return new Promise< carriers.WorkflowWaitForAction >(async (resolve, reject) => {
|
|
409
|
-
try {
|
|
410
|
-
const response = await this._axios.post("SaveWorkflowWaitForAction", entity, config);
|
|
411
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
412
|
-
const res : carriers.WorkflowWaitForAction = converters.Create_WorkflowWaitForAction_From( response.data );
|
|
413
|
-
resolve(res);
|
|
414
|
-
}
|
|
415
|
-
catch( err ) {
|
|
416
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
417
|
-
reject(err);
|
|
418
|
-
}
|
|
419
|
-
});
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
/**
|
|
423
|
-
* Deletes the WorkflowWaitForAction
|
|
424
|
-
* @param WorkflowWaitForActionId - The id of the WorkflowWaitForAction to be deleted.
|
|
425
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
426
|
-
*/
|
|
427
|
-
public async deleteWorkflowWaitForActionAsync(WorkflowWaitForActionId: number, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
428
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
429
|
-
base.WebApiBase.SetPending(options);
|
|
430
|
-
return new Promise< void >(async (resolve, reject) => {
|
|
431
|
-
try {
|
|
432
|
-
const response = await this._axios.post("DeleteWorkflowWaitForAction?WorkflowWaitForActionId=" + WorkflowWaitForActionId, null, config );
|
|
433
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
434
|
-
const res = response.data;
|
|
435
|
-
resolve(res);
|
|
436
|
-
}
|
|
437
|
-
catch( err ) {
|
|
438
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
439
|
-
reject(err);
|
|
440
|
-
}
|
|
441
|
-
});
|
|
442
|
-
}
|
|
443
|
-
/**
|
|
444
|
-
* Gets a EmailFlow object.
|
|
445
|
-
* @param emailFlowId - The primary key.
|
|
446
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
447
|
-
* @returns A single EmailFlow
|
|
448
|
-
*/
|
|
449
|
-
public async getEmailFlowAsync(emailFlowId: number, options?:base.WebApiRequestOptions) : Promise< carriers.EmailFlow > {
|
|
450
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
451
|
-
base.WebApiBase.SetPending(options);
|
|
452
|
-
return new Promise< carriers.EmailFlow >(async (resolve, reject) => {
|
|
453
|
-
try {
|
|
454
|
-
const response = await this._axios.post("GetEmailFlow?emailFlowId=" + emailFlowId, null, config);
|
|
455
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
456
|
-
const res = converters.Create_EmailFlow_From( response.data );
|
|
457
|
-
resolve(res);
|
|
458
|
-
}
|
|
459
|
-
catch( err ) {
|
|
460
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
461
|
-
reject(err);
|
|
462
|
-
}
|
|
463
|
-
});
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
private async _tryAddPersonsToEmailFlowAsync(request: carriers.Workflow_TryAddPersonsToEmailFlowRequest, options?:base.WebApiRequestOptions) : Promise< boolean[] > {
|
|
468
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
469
|
-
base.WebApiBase.SetPending(options);
|
|
470
|
-
return new Promise< boolean[] >(async (resolve, reject) => {
|
|
471
|
-
try {
|
|
472
|
-
config.baseURL = this._options.baseUrl;
|
|
473
|
-
const response = await this._axios.post("TryAddPersonsToEmailFlow", request , config);
|
|
474
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
475
|
-
const res : boolean[] = response.data as boolean[];
|
|
476
|
-
resolve(res);
|
|
477
|
-
}
|
|
478
|
-
catch( err ) {
|
|
479
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
480
|
-
reject(err);
|
|
481
|
-
}
|
|
482
|
-
});
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
/**
|
|
488
|
-
* Try to add a participant to the EmailFlow. Same function available in PersonAgent
|
|
489
|
-
* @param request - EmailFlowId, PersonIds
|
|
490
|
-
* @returns True if the corresponding participant was successfully added, false if it could not be added because of filter criteria or other reason
|
|
491
|
-
*/
|
|
492
|
-
public async tryAddPersonsToEmailFlowAsync(request: carriers.Workflow_TryAddPersonsToEmailFlowRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean[] >;
|
|
493
|
-
|
|
494
|
-
/**
|
|
495
|
-
* Try to add a participant to the EmailFlow. Same function available in PersonAgent
|
|
496
|
-
* @param emailFlowId - Primary key of EmailFlow
|
|
497
|
-
* @param personIds - Array of Person Ids
|
|
498
|
-
* @returns True if the corresponding participant was successfully added, false if it could not be added because of filter criteria or other reason
|
|
499
|
-
*/
|
|
500
|
-
public async tryAddPersonsToEmailFlowAsync(emailFlowId: number, personIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< boolean[] >;
|
|
501
|
-
|
|
502
|
-
public async tryAddPersonsToEmailFlowAsync(emailFlowId:number|carriers.Workflow_TryAddPersonsToEmailFlowRequest, personIds?:number[]|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< boolean[] > {
|
|
503
|
-
let _request : carriers.Workflow_TryAddPersonsToEmailFlowRequest = null;
|
|
504
|
-
let _options : base.WebApiRequestOptions = null;
|
|
505
|
-
const first : any = emailFlowId;
|
|
506
|
-
if( typeof( first ) === "object" && first && ( typeof(first.emailFlowId)!='undefined' || typeof(first.personIds)!='undefined' ) )
|
|
507
|
-
{
|
|
508
|
-
_request = emailFlowId as carriers.Workflow_TryAddPersonsToEmailFlowRequest;
|
|
509
|
-
_options = personIds as base.WebApiRequestOptions;
|
|
510
|
-
}
|
|
511
|
-
else
|
|
512
|
-
{
|
|
513
|
-
_request = {
|
|
514
|
-
emailFlowId: emailFlowId as number,
|
|
515
|
-
personIds: personIds as number[],
|
|
516
|
-
};
|
|
517
|
-
_options = webapi_options;
|
|
518
|
-
}
|
|
519
|
-
return this._tryAddPersonsToEmailFlowAsync( _request, _options );
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
private async _removeParticipantsFromEmailFlowAsync(request: carriers.Workflow_RemoveParticipantsFromEmailFlowRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
524
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
525
|
-
base.WebApiBase.SetPending(options);
|
|
526
|
-
return new Promise< void >(async (resolve, reject) => {
|
|
527
|
-
try {
|
|
528
|
-
config.baseURL = this._options.baseUrl;
|
|
529
|
-
const response = await this._axios.post("RemoveParticipantsFromEmailFlow", request , config);
|
|
530
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
531
|
-
const res = response.data;
|
|
532
|
-
resolve(res);
|
|
533
|
-
}
|
|
534
|
-
catch( err ) {
|
|
535
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
536
|
-
reject(err);
|
|
537
|
-
}
|
|
538
|
-
});
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
/**
|
|
544
|
-
* Remove participants (actually workflow instances) from the workflow
|
|
545
|
-
* @param request - EmailFlowId, WorkflowInstanceIds
|
|
546
|
-
* @returns
|
|
547
|
-
*/
|
|
548
|
-
public async removeParticipantsFromEmailFlowAsync(request: carriers.Workflow_RemoveParticipantsFromEmailFlowRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
549
|
-
|
|
550
|
-
/**
|
|
551
|
-
* Remove participants (actually workflow instances) from the workflow
|
|
552
|
-
* @param emailFlowId - Primary key of EmailFlow
|
|
553
|
-
* @param workflowInstanceIds - Array of Workflow instances (representing participants) to be completely removed from the workflow
|
|
554
|
-
* @returns
|
|
555
|
-
*/
|
|
556
|
-
public async removeParticipantsFromEmailFlowAsync(emailFlowId: number, workflowInstanceIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
557
|
-
|
|
558
|
-
public async removeParticipantsFromEmailFlowAsync(emailFlowId:number|carriers.Workflow_RemoveParticipantsFromEmailFlowRequest, workflowInstanceIds?:number[]|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
559
|
-
let _request : carriers.Workflow_RemoveParticipantsFromEmailFlowRequest = null;
|
|
560
|
-
let _options : base.WebApiRequestOptions = null;
|
|
561
|
-
const first : any = emailFlowId;
|
|
562
|
-
if( typeof( first ) === "object" && first && ( typeof(first.emailFlowId)!='undefined' || typeof(first.workflowInstanceIds)!='undefined' ) )
|
|
563
|
-
{
|
|
564
|
-
_request = emailFlowId as carriers.Workflow_RemoveParticipantsFromEmailFlowRequest;
|
|
565
|
-
_options = workflowInstanceIds as base.WebApiRequestOptions;
|
|
566
|
-
}
|
|
567
|
-
else
|
|
568
|
-
{
|
|
569
|
-
_request = {
|
|
570
|
-
emailFlowId: emailFlowId as number,
|
|
571
|
-
workflowInstanceIds: workflowInstanceIds as number[],
|
|
572
|
-
};
|
|
573
|
-
_options = webapi_options;
|
|
574
|
-
}
|
|
575
|
-
return this._removeParticipantsFromEmailFlowAsync( _request, _options );
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
private async _createEmailFlowContentAsync(request: carriers.Workflow_CreateEmailFlowContentRequest, options?:base.WebApiRequestOptions) : Promise< number > {
|
|
580
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
581
|
-
base.WebApiBase.SetPending(options);
|
|
582
|
-
return new Promise< number >(async (resolve, reject) => {
|
|
583
|
-
try {
|
|
584
|
-
config.baseURL = this._options.baseUrl;
|
|
585
|
-
const response = await this._axios.post("CreateEmailFlowContent", request , config);
|
|
586
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
587
|
-
const res : number = response.data as number;
|
|
588
|
-
resolve(res);
|
|
589
|
-
}
|
|
590
|
-
catch( err ) {
|
|
591
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
592
|
-
reject(err);
|
|
593
|
-
}
|
|
594
|
-
});
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
/**
|
|
600
|
-
* Create content to an email flow
|
|
601
|
-
* @param request - EmailFlowId, ContentName
|
|
602
|
-
* @returns Id of shipment created
|
|
603
|
-
*/
|
|
604
|
-
public async createEmailFlowContentAsync(request: carriers.Workflow_CreateEmailFlowContentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
605
|
-
|
|
606
|
-
/**
|
|
607
|
-
* Create content to an email flow
|
|
608
|
-
* @param emailFlowId - The EmailFlow to connect the created message to.
|
|
609
|
-
* @param contentName - The name of the content created
|
|
610
|
-
* @returns Id of shipment created
|
|
611
|
-
*/
|
|
612
|
-
public async createEmailFlowContentAsync(emailFlowId: number, contentName: string, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
613
|
-
|
|
614
|
-
public async createEmailFlowContentAsync(emailFlowId:number|carriers.Workflow_CreateEmailFlowContentRequest, contentName?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< number > {
|
|
615
|
-
let _request : carriers.Workflow_CreateEmailFlowContentRequest = null;
|
|
616
|
-
let _options : base.WebApiRequestOptions = null;
|
|
617
|
-
const first : any = emailFlowId;
|
|
618
|
-
if( typeof( first ) === "object" && first && ( typeof(first.emailFlowId)!='undefined' || typeof(first.contentName)!='undefined' ) )
|
|
619
|
-
{
|
|
620
|
-
_request = emailFlowId as carriers.Workflow_CreateEmailFlowContentRequest;
|
|
621
|
-
_options = contentName as base.WebApiRequestOptions;
|
|
622
|
-
}
|
|
623
|
-
else
|
|
624
|
-
{
|
|
625
|
-
_request = {
|
|
626
|
-
emailFlowId: emailFlowId as number,
|
|
627
|
-
contentName: contentName as string,
|
|
628
|
-
};
|
|
629
|
-
_options = webapi_options;
|
|
630
|
-
}
|
|
631
|
-
return this._createEmailFlowContentAsync( _request, _options );
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
private async _connectEmailFlowContentAsync(request: carriers.Workflow_ConnectEmailFlowContentRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
636
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
637
|
-
base.WebApiBase.SetPending(options);
|
|
638
|
-
return new Promise< void >(async (resolve, reject) => {
|
|
639
|
-
try {
|
|
640
|
-
config.baseURL = this._options.baseUrl;
|
|
641
|
-
const response = await this._axios.post("ConnectEmailFlowContent", request , config);
|
|
642
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
643
|
-
const res = response.data;
|
|
644
|
-
resolve(res);
|
|
645
|
-
}
|
|
646
|
-
catch( err ) {
|
|
647
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
648
|
-
reject(err);
|
|
649
|
-
}
|
|
650
|
-
});
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
/**
|
|
656
|
-
* Link any SMessage to the email flow. The SMessage (and any related SShipment etc) should probably not be used/visible elsewhere.
|
|
657
|
-
* @param request - EmailFlowId, MessageId
|
|
658
|
-
* @returns
|
|
659
|
-
*/
|
|
660
|
-
public async connectEmailFlowContentAsync(request: carriers.Workflow_ConnectEmailFlowContentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
661
|
-
|
|
662
|
-
/**
|
|
663
|
-
* Link any SMessage to the email flow. The SMessage (and any related SShipment etc) should probably not be used/visible elsewhere.
|
|
664
|
-
* @param emailFlowId - The EmailFlow to connect the message to.
|
|
665
|
-
* @param messageId - The s_message to connect to the flow. A shipment, form or flow may be connected to that s_message.
|
|
666
|
-
* @returns
|
|
667
|
-
*/
|
|
668
|
-
public async connectEmailFlowContentAsync(emailFlowId: number, messageId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
669
|
-
|
|
670
|
-
public async connectEmailFlowContentAsync(emailFlowId:number|carriers.Workflow_ConnectEmailFlowContentRequest, messageId?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
671
|
-
let _request : carriers.Workflow_ConnectEmailFlowContentRequest = null;
|
|
672
|
-
let _options : base.WebApiRequestOptions = null;
|
|
673
|
-
const first : any = emailFlowId;
|
|
674
|
-
if( typeof( first ) === "object" && first && ( typeof(first.emailFlowId)!='undefined' || typeof(first.messageId)!='undefined' ) )
|
|
675
|
-
{
|
|
676
|
-
_request = emailFlowId as carriers.Workflow_ConnectEmailFlowContentRequest;
|
|
677
|
-
_options = messageId as base.WebApiRequestOptions;
|
|
678
|
-
}
|
|
679
|
-
else
|
|
680
|
-
{
|
|
681
|
-
_request = {
|
|
682
|
-
emailFlowId: emailFlowId as number,
|
|
683
|
-
messageId: messageId as number,
|
|
684
|
-
};
|
|
685
|
-
_options = webapi_options;
|
|
686
|
-
}
|
|
687
|
-
return this._connectEmailFlowContentAsync( _request, _options );
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
private async _copyEmailFlowContentAsync(request: carriers.Workflow_CopyEmailFlowContentRequest, options?:base.WebApiRequestOptions) : Promise< number > {
|
|
692
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
693
|
-
base.WebApiBase.SetPending(options);
|
|
694
|
-
return new Promise< number >(async (resolve, reject) => {
|
|
695
|
-
try {
|
|
696
|
-
config.baseURL = this._options.baseUrl;
|
|
697
|
-
const response = await this._axios.post("CopyEmailFlowContent", request , config);
|
|
698
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
699
|
-
const res : number = response.data as number;
|
|
700
|
-
resolve(res);
|
|
701
|
-
}
|
|
702
|
-
catch( err ) {
|
|
703
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
704
|
-
reject(err);
|
|
705
|
-
}
|
|
706
|
-
});
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
/**
|
|
712
|
-
* Copy smessage and connected shipment to the email flow. The SMessage (and any related SShipment etc) should probably not be used/visible elsewhere.
|
|
713
|
-
* @param request - EmailFlowId, ShipmentId
|
|
714
|
-
* @returns Newly created shipment id for this content
|
|
715
|
-
*/
|
|
716
|
-
public async copyEmailFlowContentAsync(request: carriers.Workflow_CopyEmailFlowContentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
717
|
-
|
|
718
|
-
/**
|
|
719
|
-
* Copy smessage and connected shipment to the email flow. The SMessage (and any related SShipment etc) should probably not be used/visible elsewhere.
|
|
720
|
-
* @param emailFlowId - The EmailFlow to connect the copied content to.
|
|
721
|
-
* @param shipmentId - The id of the shipment to copy to the flow. The message of this shipment will also be connected
|
|
722
|
-
* @returns Newly created shipment id for this content
|
|
723
|
-
*/
|
|
724
|
-
public async copyEmailFlowContentAsync(emailFlowId: number, shipmentId: number, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
725
|
-
|
|
726
|
-
public async copyEmailFlowContentAsync(emailFlowId:number|carriers.Workflow_CopyEmailFlowContentRequest, shipmentId?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< number > {
|
|
727
|
-
let _request : carriers.Workflow_CopyEmailFlowContentRequest = null;
|
|
728
|
-
let _options : base.WebApiRequestOptions = null;
|
|
729
|
-
const first : any = emailFlowId;
|
|
730
|
-
if( typeof( first ) === "object" && first && ( typeof(first.emailFlowId)!='undefined' || typeof(first.shipmentId)!='undefined' ) )
|
|
731
|
-
{
|
|
732
|
-
_request = emailFlowId as carriers.Workflow_CopyEmailFlowContentRequest;
|
|
733
|
-
_options = shipmentId as base.WebApiRequestOptions;
|
|
734
|
-
}
|
|
735
|
-
else
|
|
736
|
-
{
|
|
737
|
-
_request = {
|
|
738
|
-
emailFlowId: emailFlowId as number,
|
|
739
|
-
shipmentId: shipmentId as number,
|
|
740
|
-
};
|
|
741
|
-
_options = webapi_options;
|
|
742
|
-
}
|
|
743
|
-
return this._copyEmailFlowContentAsync( _request, _options );
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
private async _updateFormSubmissionsAsync(request: carriers.Workflow_UpdateFormSubmissionsRequest, options?:base.WebApiRequestOptions) : Promise< number > {
|
|
748
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
749
|
-
base.WebApiBase.SetPending(options);
|
|
750
|
-
return new Promise< number >(async (resolve, reject) => {
|
|
751
|
-
try {
|
|
752
|
-
config.baseURL = this._options.baseUrl;
|
|
753
|
-
const response = await this._axios.post("UpdateFormSubmissions", request , config);
|
|
754
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
755
|
-
const res : number = response.data as number;
|
|
756
|
-
resolve(res);
|
|
757
|
-
}
|
|
758
|
-
catch( err ) {
|
|
759
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
760
|
-
reject(err);
|
|
761
|
-
}
|
|
762
|
-
});
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
/**
|
|
768
|
-
* Attempt to update stored field values for up to the given number of form submissions
|
|
769
|
-
* @param request - MaxCount
|
|
770
|
-
* @returns Number of form submissions converted
|
|
771
|
-
*/
|
|
772
|
-
public async updateFormSubmissionsAsync(request: carriers.Workflow_UpdateFormSubmissionsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
773
|
-
|
|
774
|
-
/**
|
|
775
|
-
* Attempt to update stored field values for up to the given number of form submissions
|
|
776
|
-
* @param maxCount - The maximum number of form submissions to attempt to save as form field values.
|
|
777
|
-
* @returns Number of form submissions converted
|
|
778
|
-
*/
|
|
779
|
-
public async updateFormSubmissionsAsync(maxCount: number, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
780
|
-
|
|
781
|
-
public async updateFormSubmissionsAsync(maxCount:number|carriers.Workflow_UpdateFormSubmissionsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number > {
|
|
782
|
-
let _request : carriers.Workflow_UpdateFormSubmissionsRequest = null;
|
|
783
|
-
let _options : base.WebApiRequestOptions = null;
|
|
784
|
-
const first : any = maxCount;
|
|
785
|
-
if( typeof( first ) === "object" && first && ( typeof(first.maxCount)!='undefined' ) )
|
|
786
|
-
{
|
|
787
|
-
_request = maxCount as carriers.Workflow_UpdateFormSubmissionsRequest;
|
|
788
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
789
|
-
}
|
|
790
|
-
else
|
|
791
|
-
{
|
|
792
|
-
_request = {
|
|
793
|
-
maxCount: maxCount as number,
|
|
794
|
-
};
|
|
795
|
-
_options = webapi_options;
|
|
796
|
-
}
|
|
797
|
-
return this._updateFormSubmissionsAsync( _request, _options );
|
|
798
|
-
}
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
private async _setStatusOnWorkflowAsync(request: carriers.Workflow_SetStatusOnWorkflowRequest, options?:base.WebApiRequestOptions) : Promise< enums.WorkflowDefinitionStatus > {
|
|
802
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
803
|
-
base.WebApiBase.SetPending(options);
|
|
804
|
-
return new Promise< enums.WorkflowDefinitionStatus >(async (resolve, reject) => {
|
|
805
|
-
try {
|
|
806
|
-
config.baseURL = this._options.baseUrl;
|
|
807
|
-
const response = await this._axios.post("SetStatusOnWorkflow", request , config);
|
|
808
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
809
|
-
const res : enums.WorkflowDefinitionStatus = response.data as enums.WorkflowDefinitionStatus;
|
|
810
|
-
resolve(res);
|
|
811
|
-
}
|
|
812
|
-
catch( err ) {
|
|
813
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
814
|
-
reject(err);
|
|
815
|
-
}
|
|
816
|
-
});
|
|
817
|
-
}
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
/**
|
|
822
|
-
* Set status on workflow, Run or pause flow
|
|
823
|
-
* @param request - EmailFlowId, Status
|
|
824
|
-
* @returns The new status
|
|
825
|
-
*/
|
|
826
|
-
public async setStatusOnWorkflowAsync(request: carriers.Workflow_SetStatusOnWorkflowRequest, webapi_options?:base.WebApiRequestOptions) : Promise< enums.WorkflowDefinitionStatus >;
|
|
827
|
-
|
|
828
|
-
/**
|
|
829
|
-
* Set status on workflow, Run or pause flow
|
|
830
|
-
* @param emailFlowId - The id of the email flow to run or pause
|
|
831
|
-
* @param status - The new status
|
|
832
|
-
* @returns The new status
|
|
833
|
-
*/
|
|
834
|
-
public async setStatusOnWorkflowAsync(emailFlowId: number, status: enums.WorkflowDefinitionStatus, webapi_options?:base.WebApiRequestOptions) : Promise< enums.WorkflowDefinitionStatus >;
|
|
835
|
-
|
|
836
|
-
public async setStatusOnWorkflowAsync(emailFlowId:number|carriers.Workflow_SetStatusOnWorkflowRequest, status?:enums.WorkflowDefinitionStatus|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< enums.WorkflowDefinitionStatus > {
|
|
837
|
-
let _request : carriers.Workflow_SetStatusOnWorkflowRequest = null;
|
|
838
|
-
let _options : base.WebApiRequestOptions = null;
|
|
839
|
-
const first : any = emailFlowId;
|
|
840
|
-
if( typeof( first ) === "object" && first && ( typeof(first.emailFlowId)!='undefined' || typeof(first.status)!='undefined' ) )
|
|
841
|
-
{
|
|
842
|
-
_request = emailFlowId as carriers.Workflow_SetStatusOnWorkflowRequest;
|
|
843
|
-
_options = status as base.WebApiRequestOptions;
|
|
844
|
-
}
|
|
845
|
-
else
|
|
846
|
-
{
|
|
847
|
-
_request = {
|
|
848
|
-
emailFlowId: emailFlowId as number,
|
|
849
|
-
status: status as enums.WorkflowDefinitionStatus,
|
|
850
|
-
};
|
|
851
|
-
_options = webapi_options;
|
|
852
|
-
}
|
|
853
|
-
return this._setStatusOnWorkflowAsync( _request, _options );
|
|
854
|
-
}
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
private async _copyEmailFlowAsync(request: carriers.Workflow_CopyEmailFlowRequest, options?:base.WebApiRequestOptions) : Promise< number > {
|
|
858
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
859
|
-
base.WebApiBase.SetPending(options);
|
|
860
|
-
return new Promise< number >(async (resolve, reject) => {
|
|
861
|
-
try {
|
|
862
|
-
config.baseURL = this._options.baseUrl;
|
|
863
|
-
const response = await this._axios.post("CopyEmailFlow", request , config);
|
|
864
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
865
|
-
const res : number = response.data as number;
|
|
866
|
-
resolve(res);
|
|
867
|
-
}
|
|
868
|
-
catch( err ) {
|
|
869
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
870
|
-
reject(err);
|
|
871
|
-
}
|
|
872
|
-
});
|
|
873
|
-
}
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
/**
|
|
878
|
-
* Copy an email flow.
|
|
879
|
-
* @param request - EmailFlowId, NewName
|
|
880
|
-
* @returns Newly created email flow id for this content
|
|
881
|
-
*/
|
|
882
|
-
public async copyEmailFlowAsync(request: carriers.Workflow_CopyEmailFlowRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
883
|
-
|
|
884
|
-
/**
|
|
885
|
-
* Copy an email flow.
|
|
886
|
-
* @param emailFlowId - The EmailFlow to copy.
|
|
887
|
-
* @param newName - The name of the new email flow
|
|
888
|
-
* @returns Newly created email flow id for this content
|
|
889
|
-
*/
|
|
890
|
-
public async copyEmailFlowAsync(emailFlowId: number, newName: string, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
891
|
-
|
|
892
|
-
public async copyEmailFlowAsync(emailFlowId:number|carriers.Workflow_CopyEmailFlowRequest, newName?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< number > {
|
|
893
|
-
let _request : carriers.Workflow_CopyEmailFlowRequest = null;
|
|
894
|
-
let _options : base.WebApiRequestOptions = null;
|
|
895
|
-
const first : any = emailFlowId;
|
|
896
|
-
if( typeof( first ) === "object" && first && ( typeof(first.emailFlowId)!='undefined' || typeof(first.newName)!='undefined' ) )
|
|
897
|
-
{
|
|
898
|
-
_request = emailFlowId as carriers.Workflow_CopyEmailFlowRequest;
|
|
899
|
-
_options = newName as base.WebApiRequestOptions;
|
|
900
|
-
}
|
|
901
|
-
else
|
|
902
|
-
{
|
|
903
|
-
_request = {
|
|
904
|
-
emailFlowId: emailFlowId as number,
|
|
905
|
-
newName: newName as string,
|
|
906
|
-
};
|
|
907
|
-
_options = webapi_options;
|
|
908
|
-
}
|
|
909
|
-
return this._copyEmailFlowAsync( _request, _options );
|
|
910
|
-
}
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
private async _runAsync( options?:base.WebApiRequestOptions) : Promise< Date > {
|
|
914
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
915
|
-
base.WebApiBase.SetPending(options);
|
|
916
|
-
return new Promise< Date >(async (resolve, reject) => {
|
|
917
|
-
try {
|
|
918
|
-
config.baseURL = this._options.baseUrl;
|
|
919
|
-
const response = await this._axios.post("Run", undefined , config);
|
|
920
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
921
|
-
const res : Date = response.data as Date;
|
|
922
|
-
resolve(res);
|
|
923
|
-
}
|
|
924
|
-
catch( err ) {
|
|
925
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
926
|
-
reject(err);
|
|
927
|
-
}
|
|
928
|
-
});
|
|
929
|
-
}
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
/**
|
|
933
|
-
* Run the workflow engine right now
|
|
934
|
-
* @returns Suggested time for next run
|
|
935
|
-
*/
|
|
936
|
-
public async runAsync(webapi_options?:base.WebApiRequestOptions) : Promise< Date >
|
|
937
|
-
{
|
|
938
|
-
return this._runAsync(webapi_options);
|
|
939
|
-
}
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
private async _sendEventAsync(request: carriers.Workflow_SendEventRequest, options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowEventResult > {
|
|
943
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
944
|
-
base.WebApiBase.SetPending(options);
|
|
945
|
-
return new Promise< carriers.WorkflowEventResult >(async (resolve, reject) => {
|
|
946
|
-
try {
|
|
947
|
-
config.baseURL = this._options.baseUrl;
|
|
948
|
-
const response = await this._axios.post("SendEvent", request , config);
|
|
949
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
950
|
-
const res : carriers.WorkflowEventResult = converters.Create_WorkflowEventResult_From( response.data );
|
|
951
|
-
resolve(res);
|
|
952
|
-
}
|
|
953
|
-
catch( err ) {
|
|
954
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
955
|
-
reject(err);
|
|
956
|
-
}
|
|
957
|
-
});
|
|
958
|
-
}
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
/**
|
|
963
|
-
* Send a workflow event. Most event signaling will finish very quickly as they normally just change the state of a workflow instance
|
|
964
|
-
* @param request - WorkflowEvent
|
|
965
|
-
* @returns Any relevant info about the event
|
|
966
|
-
*/
|
|
967
|
-
public async sendEventAsync(request: carriers.Workflow_SendEventRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowEventResult >;
|
|
968
|
-
|
|
969
|
-
/**
|
|
970
|
-
* Send a workflow event. Most event signaling will finish very quickly as they normally just change the state of a workflow instance
|
|
971
|
-
* @param workflowEvent - Information about the signaled event
|
|
972
|
-
* @returns Any relevant info about the event
|
|
973
|
-
*/
|
|
974
|
-
public async sendEventAsync(workflowEvent: carriers.WorkflowEvent, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowEventResult >;
|
|
975
|
-
|
|
976
|
-
public async sendEventAsync(workflowEvent:carriers.WorkflowEvent|carriers.Workflow_SendEventRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowEventResult > {
|
|
977
|
-
let _request : carriers.Workflow_SendEventRequest = null;
|
|
978
|
-
let _options : base.WebApiRequestOptions = null;
|
|
979
|
-
const first : any = workflowEvent;
|
|
980
|
-
if( typeof( first ) === "object" && first && ( typeof(first.workflowEvent)!='undefined' ) )
|
|
981
|
-
{
|
|
982
|
-
_request = workflowEvent as carriers.Workflow_SendEventRequest;
|
|
983
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
984
|
-
}
|
|
985
|
-
else
|
|
986
|
-
{
|
|
987
|
-
_request = {
|
|
988
|
-
workflowEvent: workflowEvent as carriers.WorkflowEvent,
|
|
989
|
-
};
|
|
990
|
-
_options = webapi_options;
|
|
991
|
-
}
|
|
992
|
-
return this._sendEventAsync( _request, _options );
|
|
993
|
-
}
|
|
994
|
-
|
|
995
|
-
/**
|
|
996
|
-
* Gets a WorkflowGoal object.
|
|
997
|
-
* @param workflowGoalId - The primary key.
|
|
998
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
999
|
-
* @returns A single WorkflowGoal
|
|
1000
|
-
*/
|
|
1001
|
-
public async getWorkflowGoalAsync(workflowGoalId: number, options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowGoal > {
|
|
1002
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1003
|
-
base.WebApiBase.SetPending(options);
|
|
1004
|
-
return new Promise< carriers.WorkflowGoal >(async (resolve, reject) => {
|
|
1005
|
-
try {
|
|
1006
|
-
const response = await this._axios.post("GetWorkflowGoal?workflowGoalId=" + workflowGoalId, null, config);
|
|
1007
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
1008
|
-
const res = converters.Create_WorkflowGoal_From( response.data );
|
|
1009
|
-
resolve(res);
|
|
1010
|
-
}
|
|
1011
|
-
catch( err ) {
|
|
1012
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
1013
|
-
reject(err);
|
|
1014
|
-
}
|
|
1015
|
-
});
|
|
1016
|
-
}
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
private async _getWorkflowStepAsync(request: carriers.Workflow_GetWorkflowStepRequest, options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase > {
|
|
1020
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1021
|
-
base.WebApiBase.SetPending(options);
|
|
1022
|
-
return new Promise< carriers.WorkflowStepBase >(async (resolve, reject) => {
|
|
1023
|
-
try {
|
|
1024
|
-
config.baseURL = this._options.baseUrl;
|
|
1025
|
-
const response = await this._axios.post("GetWorkflowStep", request , config);
|
|
1026
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
1027
|
-
const res : carriers.WorkflowStepBase = converters.Create_WorkflowStepBase_From( response.data );
|
|
1028
|
-
resolve(res);
|
|
1029
|
-
}
|
|
1030
|
-
catch( err ) {
|
|
1031
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
1032
|
-
reject(err);
|
|
1033
|
-
}
|
|
1034
|
-
});
|
|
1035
|
-
}
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
/**
|
|
1040
|
-
* Get Workflowstep by ID
|
|
1041
|
-
* @param request - WorkflowStepId
|
|
1042
|
-
* @returns The Workflow step
|
|
1043
|
-
*/
|
|
1044
|
-
public async getWorkflowStepAsync(request: carriers.Workflow_GetWorkflowStepRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase >;
|
|
1045
|
-
|
|
1046
|
-
/**
|
|
1047
|
-
* Get Workflowstep by ID
|
|
1048
|
-
* @param workflowStepId - Primary key of WorkflowStep
|
|
1049
|
-
* @returns The Workflow step
|
|
1050
|
-
*/
|
|
1051
|
-
public async getWorkflowStepAsync(workflowStepId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase >;
|
|
1052
|
-
|
|
1053
|
-
public async getWorkflowStepAsync(workflowStepId:number|carriers.Workflow_GetWorkflowStepRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase > {
|
|
1054
|
-
let _request : carriers.Workflow_GetWorkflowStepRequest = null;
|
|
1055
|
-
let _options : base.WebApiRequestOptions = null;
|
|
1056
|
-
const first : any = workflowStepId;
|
|
1057
|
-
if( typeof( first ) === "object" && first && ( typeof(first.workflowStepId)!='undefined' ) )
|
|
1058
|
-
{
|
|
1059
|
-
_request = workflowStepId as carriers.Workflow_GetWorkflowStepRequest;
|
|
1060
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
1061
|
-
}
|
|
1062
|
-
else
|
|
1063
|
-
{
|
|
1064
|
-
_request = {
|
|
1065
|
-
workflowStepId: workflowStepId as number,
|
|
1066
|
-
};
|
|
1067
|
-
_options = webapi_options;
|
|
1068
|
-
}
|
|
1069
|
-
return this._getWorkflowStepAsync( _request, _options );
|
|
1070
|
-
}
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
private async _addAfterWorkflowStepAsync(request: carriers.Workflow_AddAfterWorkflowStepRequest, options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase > {
|
|
1074
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1075
|
-
base.WebApiBase.SetPending(options);
|
|
1076
|
-
return new Promise< carriers.WorkflowStepBase >(async (resolve, reject) => {
|
|
1077
|
-
try {
|
|
1078
|
-
config.baseURL = this._options.baseUrl;
|
|
1079
|
-
const response = await this._axios.post("AddAfterWorkflowStep", request , config);
|
|
1080
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
1081
|
-
const res : carriers.WorkflowStepBase = converters.Create_WorkflowStepBase_From( response.data );
|
|
1082
|
-
resolve(res);
|
|
1083
|
-
}
|
|
1084
|
-
catch( err ) {
|
|
1085
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
1086
|
-
reject(err);
|
|
1087
|
-
}
|
|
1088
|
-
});
|
|
1089
|
-
}
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
/**
|
|
1094
|
-
* Add another step (and any of its substeps) after the given step id (which must exist), and move any following steps in the workflow further down the line.
|
|
1095
|
-
* @param request - WorkflowStepId, SubStep
|
|
1096
|
-
* @returns The added step
|
|
1097
|
-
*/
|
|
1098
|
-
public async addAfterWorkflowStepAsync(request: carriers.Workflow_AddAfterWorkflowStepRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase >;
|
|
1099
|
-
|
|
1100
|
-
/**
|
|
1101
|
-
* Add another step (and any of its substeps) after the given step id (which must exist), and move any following steps in the workflow further down the line.
|
|
1102
|
-
* @param workflowStepId - Primary key of WorkflowStep
|
|
1103
|
-
* @param subStep - The step to be inserted after given step id.
|
|
1104
|
-
* @returns The added step
|
|
1105
|
-
*/
|
|
1106
|
-
public async addAfterWorkflowStepAsync(workflowStepId: number, subStep: carriers.WorkflowStepBase, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase >;
|
|
1107
|
-
|
|
1108
|
-
public async addAfterWorkflowStepAsync(workflowStepId:number|carriers.Workflow_AddAfterWorkflowStepRequest, subStep?:carriers.WorkflowStepBase|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase > {
|
|
1109
|
-
let _request : carriers.Workflow_AddAfterWorkflowStepRequest = null;
|
|
1110
|
-
let _options : base.WebApiRequestOptions = null;
|
|
1111
|
-
const first : any = workflowStepId;
|
|
1112
|
-
if( typeof( first ) === "object" && first && ( typeof(first.workflowStepId)!='undefined' || typeof(first.subStep)!='undefined' ) )
|
|
1113
|
-
{
|
|
1114
|
-
_request = workflowStepId as carriers.Workflow_AddAfterWorkflowStepRequest;
|
|
1115
|
-
_options = subStep as base.WebApiRequestOptions;
|
|
1116
|
-
}
|
|
1117
|
-
else
|
|
1118
|
-
{
|
|
1119
|
-
_request = {
|
|
1120
|
-
workflowStepId: workflowStepId as number,
|
|
1121
|
-
subStep: subStep as carriers.WorkflowStepBase,
|
|
1122
|
-
};
|
|
1123
|
-
_options = webapi_options;
|
|
1124
|
-
}
|
|
1125
|
-
return this._addAfterWorkflowStepAsync( _request, _options );
|
|
1126
|
-
}
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
private async _createDefaultWorkflowStepFromTypeAsync(request: carriers.Workflow_CreateDefaultWorkflowStepFromTypeRequest, options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase > {
|
|
1130
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1131
|
-
base.WebApiBase.SetPending(options);
|
|
1132
|
-
return new Promise< carriers.WorkflowStepBase >(async (resolve, reject) => {
|
|
1133
|
-
try {
|
|
1134
|
-
config.baseURL = this._options.baseUrl;
|
|
1135
|
-
const response = await this._axios.post("CreateDefaultWorkflowStepFromType", request , config);
|
|
1136
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
1137
|
-
const res : carriers.WorkflowStepBase = converters.Create_WorkflowStepBase_From( response.data );
|
|
1138
|
-
resolve(res);
|
|
1139
|
-
}
|
|
1140
|
-
catch( err ) {
|
|
1141
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
1142
|
-
reject(err);
|
|
1143
|
-
}
|
|
1144
|
-
});
|
|
1145
|
-
}
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
/**
|
|
1150
|
-
* Creates a new carrier from the step type given, with the right kind of properties, defaults set.
|
|
1151
|
-
* @param request - StepType
|
|
1152
|
-
* @returns
|
|
1153
|
-
*/
|
|
1154
|
-
public async createDefaultWorkflowStepFromTypeAsync(request: carriers.Workflow_CreateDefaultWorkflowStepFromTypeRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase >;
|
|
1155
|
-
|
|
1156
|
-
/**
|
|
1157
|
-
* Creates a new carrier from the step type given, with the right kind of properties, defaults set.
|
|
1158
|
-
* @param stepType - Step type to create
|
|
1159
|
-
* @returns
|
|
1160
|
-
*/
|
|
1161
|
-
public async createDefaultWorkflowStepFromTypeAsync(stepType: enums.WorkflowStepType, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase >;
|
|
1162
|
-
|
|
1163
|
-
public async createDefaultWorkflowStepFromTypeAsync(stepType:enums.WorkflowStepType|carriers.Workflow_CreateDefaultWorkflowStepFromTypeRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase > {
|
|
1164
|
-
let _request : carriers.Workflow_CreateDefaultWorkflowStepFromTypeRequest = null;
|
|
1165
|
-
let _options : base.WebApiRequestOptions = null;
|
|
1166
|
-
const first : any = stepType;
|
|
1167
|
-
if( typeof( first ) === "object" && first && ( typeof(first.stepType)!='undefined' ) )
|
|
1168
|
-
{
|
|
1169
|
-
_request = stepType as carriers.Workflow_CreateDefaultWorkflowStepFromTypeRequest;
|
|
1170
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
1171
|
-
}
|
|
1172
|
-
else
|
|
1173
|
-
{
|
|
1174
|
-
_request = {
|
|
1175
|
-
stepType: stepType as enums.WorkflowStepType,
|
|
1176
|
-
};
|
|
1177
|
-
_options = webapi_options;
|
|
1178
|
-
}
|
|
1179
|
-
return this._createDefaultWorkflowStepFromTypeAsync( _request, _options );
|
|
1180
|
-
}
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
private async _createDefaultWorkflowStepOptionFromTypeAsync(request: carriers.Workflow_CreateDefaultWorkflowStepOptionFromTypeRequest, options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepOptionBase > {
|
|
1184
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1185
|
-
base.WebApiBase.SetPending(options);
|
|
1186
|
-
return new Promise< carriers.WorkflowStepOptionBase >(async (resolve, reject) => {
|
|
1187
|
-
try {
|
|
1188
|
-
config.baseURL = this._options.baseUrl;
|
|
1189
|
-
const response = await this._axios.post("CreateDefaultWorkflowStepOptionFromType", request , config);
|
|
1190
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
1191
|
-
const res : carriers.WorkflowStepOptionBase = converters.Create_WorkflowStepOptionBase_From( response.data );
|
|
1192
|
-
resolve(res);
|
|
1193
|
-
}
|
|
1194
|
-
catch( err ) {
|
|
1195
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
1196
|
-
reject(err);
|
|
1197
|
-
}
|
|
1198
|
-
});
|
|
1199
|
-
}
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
/**
|
|
1204
|
-
* Creates a new carrier from the option type given, with the right kind of properties, defaults set.
|
|
1205
|
-
* @param request - OptionType
|
|
1206
|
-
* @returns
|
|
1207
|
-
*/
|
|
1208
|
-
public async createDefaultWorkflowStepOptionFromTypeAsync(request: carriers.Workflow_CreateDefaultWorkflowStepOptionFromTypeRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepOptionBase >;
|
|
1209
|
-
|
|
1210
|
-
/**
|
|
1211
|
-
* Creates a new carrier from the option type given, with the right kind of properties, defaults set.
|
|
1212
|
-
* @param optionType - Option type to create
|
|
1213
|
-
* @returns
|
|
1214
|
-
*/
|
|
1215
|
-
public async createDefaultWorkflowStepOptionFromTypeAsync(optionType: enums.WorkflowSplitOptionType, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepOptionBase >;
|
|
1216
|
-
|
|
1217
|
-
public async createDefaultWorkflowStepOptionFromTypeAsync(optionType:enums.WorkflowSplitOptionType|carriers.Workflow_CreateDefaultWorkflowStepOptionFromTypeRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepOptionBase > {
|
|
1218
|
-
let _request : carriers.Workflow_CreateDefaultWorkflowStepOptionFromTypeRequest = null;
|
|
1219
|
-
let _options : base.WebApiRequestOptions = null;
|
|
1220
|
-
const first : any = optionType;
|
|
1221
|
-
if( typeof( first ) === "object" && first && ( typeof(first.optionType)!='undefined' ) )
|
|
1222
|
-
{
|
|
1223
|
-
_request = optionType as carriers.Workflow_CreateDefaultWorkflowStepOptionFromTypeRequest;
|
|
1224
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
1225
|
-
}
|
|
1226
|
-
else
|
|
1227
|
-
{
|
|
1228
|
-
_request = {
|
|
1229
|
-
optionType: optionType as enums.WorkflowSplitOptionType,
|
|
1230
|
-
};
|
|
1231
|
-
_options = webapi_options;
|
|
1232
|
-
}
|
|
1233
|
-
return this._createDefaultWorkflowStepOptionFromTypeAsync( _request, _options );
|
|
1234
|
-
}
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
private async _getWorkflowStepOptionAsync(request: carriers.Workflow_GetWorkflowStepOptionRequest, options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepOptionBase > {
|
|
1238
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1239
|
-
base.WebApiBase.SetPending(options);
|
|
1240
|
-
return new Promise< carriers.WorkflowStepOptionBase >(async (resolve, reject) => {
|
|
1241
|
-
try {
|
|
1242
|
-
config.baseURL = this._options.baseUrl;
|
|
1243
|
-
const response = await this._axios.post("GetWorkflowStepOption", request , config);
|
|
1244
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
1245
|
-
const res : carriers.WorkflowStepOptionBase = converters.Create_WorkflowStepOptionBase_From( response.data );
|
|
1246
|
-
resolve(res);
|
|
1247
|
-
}
|
|
1248
|
-
catch( err ) {
|
|
1249
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
1250
|
-
reject(err);
|
|
1251
|
-
}
|
|
1252
|
-
});
|
|
1253
|
-
}
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
/**
|
|
1258
|
-
* Get WorkflowStepOption by ID
|
|
1259
|
-
* @param request - WorkflowStepOptionId
|
|
1260
|
-
* @returns The Workflow step option
|
|
1261
|
-
*/
|
|
1262
|
-
public async getWorkflowStepOptionAsync(request: carriers.Workflow_GetWorkflowStepOptionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepOptionBase >;
|
|
1263
|
-
|
|
1264
|
-
/**
|
|
1265
|
-
* Get WorkflowStepOption by ID
|
|
1266
|
-
* @param workflowStepOptionId - Primary key of WorkflowStep option
|
|
1267
|
-
* @returns The Workflow step option
|
|
1268
|
-
*/
|
|
1269
|
-
public async getWorkflowStepOptionAsync(workflowStepOptionId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepOptionBase >;
|
|
1270
|
-
|
|
1271
|
-
public async getWorkflowStepOptionAsync(workflowStepOptionId:number|carriers.Workflow_GetWorkflowStepOptionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepOptionBase > {
|
|
1272
|
-
let _request : carriers.Workflow_GetWorkflowStepOptionRequest = null;
|
|
1273
|
-
let _options : base.WebApiRequestOptions = null;
|
|
1274
|
-
const first : any = workflowStepOptionId;
|
|
1275
|
-
if( typeof( first ) === "object" && first && ( typeof(first.workflowStepOptionId)!='undefined' ) )
|
|
1276
|
-
{
|
|
1277
|
-
_request = workflowStepOptionId as carriers.Workflow_GetWorkflowStepOptionRequest;
|
|
1278
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
1279
|
-
}
|
|
1280
|
-
else
|
|
1281
|
-
{
|
|
1282
|
-
_request = {
|
|
1283
|
-
workflowStepOptionId: workflowStepOptionId as number,
|
|
1284
|
-
};
|
|
1285
|
-
_options = webapi_options;
|
|
1286
|
-
}
|
|
1287
|
-
return this._getWorkflowStepOptionAsync( _request, _options );
|
|
1288
|
-
}
|
|
1289
|
-
|
|
1290
|
-
/**
|
|
1291
|
-
* Gets a WorkflowTrigger object.
|
|
1292
|
-
* @param workflowTriggerId - The primary key.
|
|
1293
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
1294
|
-
* @returns A single WorkflowTrigger
|
|
1295
|
-
*/
|
|
1296
|
-
public async getWorkflowTriggerAsync(workflowTriggerId: number, options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowTrigger > {
|
|
1297
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1298
|
-
base.WebApiBase.SetPending(options);
|
|
1299
|
-
return new Promise< carriers.WorkflowTrigger >(async (resolve, reject) => {
|
|
1300
|
-
try {
|
|
1301
|
-
const response = await this._axios.post("GetWorkflowTrigger?workflowTriggerId=" + workflowTriggerId, null, config);
|
|
1302
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
1303
|
-
const res = converters.Create_WorkflowTrigger_From( response.data );
|
|
1304
|
-
resolve(res);
|
|
1305
|
-
}
|
|
1306
|
-
catch( err ) {
|
|
1307
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
1308
|
-
reject(err);
|
|
1309
|
-
}
|
|
1310
|
-
});
|
|
1311
|
-
}
|
|
1312
|
-
|
|
1313
|
-
/**
|
|
1314
|
-
* Gets a WorkflowWaitForAction object.
|
|
1315
|
-
* @param workflowWaitForActionId - The primary key.
|
|
1316
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
1317
|
-
* @returns A single WorkflowWaitForAction
|
|
1318
|
-
*/
|
|
1319
|
-
public async getWorkflowWaitForActionAsync(workflowWaitForActionId: number, options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowWaitForAction > {
|
|
1320
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1321
|
-
base.WebApiBase.SetPending(options);
|
|
1322
|
-
return new Promise< carriers.WorkflowWaitForAction >(async (resolve, reject) => {
|
|
1323
|
-
try {
|
|
1324
|
-
const response = await this._axios.post("GetWorkflowWaitForAction?workflowWaitForActionId=" + workflowWaitForActionId, null, config);
|
|
1325
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
1326
|
-
const res = converters.Create_WorkflowWaitForAction_From( response.data );
|
|
1327
|
-
resolve(res);
|
|
1328
|
-
}
|
|
1329
|
-
catch( err ) {
|
|
1330
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
1331
|
-
reject(err);
|
|
1332
|
-
}
|
|
1333
|
-
});
|
|
1334
|
-
}
|
|
1335
|
-
|
|
1336
|
-
} // class v1WorkflowAgentController
|
|
1337
|
-
|
|
1338
|
-
|
|
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/WorkflowAgent.ts
|
|
13
|
+
//
|
|
14
|
+
//----------------------------------------------------------------------------
|
|
15
|
+
// Copyright (C) SuperOffice AS
|
|
16
|
+
//----------------------------------------------------------------------------
|
|
17
|
+
|
|
18
|
+
import { AxiosRequestConfig } from 'axios';
|
|
19
|
+
import { Duration } from 'dayjs/plugin/duration';
|
|
20
|
+
import * as enums from './Enums';
|
|
21
|
+
import * as base from './WebApiBase';
|
|
22
|
+
import * as carriers from './Carriers';
|
|
23
|
+
import * as converters from './Converters';
|
|
24
|
+
import { FromBase64ToString, ToBase64 } from './Base64';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Agent lets you configure workflow automation
|
|
28
|
+
*/
|
|
29
|
+
export interface IWorkflowAgent {
|
|
30
|
+
createDefaultEmailFlowAsync(): Promise< carriers.EmailFlow >;
|
|
31
|
+
saveEmailFlowAsync(entity: carriers.EmailFlow) : Promise< carriers.EmailFlow >;
|
|
32
|
+
deleteEmailFlowAsync(EmailFlowId: number) : Promise<void>;
|
|
33
|
+
createDefaultWorkflowEventAsync(): Promise< carriers.WorkflowEvent >;
|
|
34
|
+
createDefaultWorkflowEventResultAsync(): Promise< carriers.WorkflowEventResult >;
|
|
35
|
+
createDefaultWorkflowFilterAsync(): Promise< carriers.WorkflowFilter >;
|
|
36
|
+
createDefaultWorkflowGoalAsync(): Promise< carriers.WorkflowGoal >;
|
|
37
|
+
saveWorkflowGoalAsync(entity: carriers.WorkflowGoal) : Promise< carriers.WorkflowGoal >;
|
|
38
|
+
deleteWorkflowGoalAsync(WorkflowGoalId: number) : Promise<void>;
|
|
39
|
+
createDefaultWorkflowTriggerAsync(): Promise< carriers.WorkflowTrigger >;
|
|
40
|
+
saveWorkflowTriggerAsync(entity: carriers.WorkflowTrigger) : Promise< carriers.WorkflowTrigger >;
|
|
41
|
+
deleteWorkflowTriggerAsync(WorkflowTriggerId: number) : Promise<void>;
|
|
42
|
+
createDefaultWorkflowWaitForActionAsync(): Promise< carriers.WorkflowWaitForAction >;
|
|
43
|
+
saveWorkflowWaitForActionAsync(entity: carriers.WorkflowWaitForAction) : Promise< carriers.WorkflowWaitForAction >;
|
|
44
|
+
deleteWorkflowWaitForActionAsync(WorkflowWaitForActionId: number) : Promise<void>;
|
|
45
|
+
getEmailFlowAsync(emailFlowId: number) : Promise< carriers.EmailFlow >;
|
|
46
|
+
tryAddPersonsToEmailFlowAsync(request: carriers.Workflow_TryAddPersonsToEmailFlowRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean[] >;
|
|
47
|
+
tryAddPersonsToEmailFlowAsync(emailFlowId: number, personIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< boolean[] >;
|
|
48
|
+
removeParticipantsFromEmailFlowAsync(request: carriers.Workflow_RemoveParticipantsFromEmailFlowRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
49
|
+
removeParticipantsFromEmailFlowAsync(emailFlowId: number, workflowInstanceIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
50
|
+
createEmailFlowContentAsync(request: carriers.Workflow_CreateEmailFlowContentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
51
|
+
createEmailFlowContentAsync(emailFlowId: number, contentName: string, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
52
|
+
connectEmailFlowContentAsync(request: carriers.Workflow_ConnectEmailFlowContentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
53
|
+
connectEmailFlowContentAsync(emailFlowId: number, messageId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
54
|
+
copyEmailFlowContentAsync(request: carriers.Workflow_CopyEmailFlowContentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
55
|
+
copyEmailFlowContentAsync(emailFlowId: number, shipmentId: number, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
56
|
+
updateFormSubmissionsAsync(request: carriers.Workflow_UpdateFormSubmissionsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
57
|
+
updateFormSubmissionsAsync(maxCount: number, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
58
|
+
setStatusOnWorkflowAsync(request: carriers.Workflow_SetStatusOnWorkflowRequest, webapi_options?:base.WebApiRequestOptions) : Promise< enums.WorkflowDefinitionStatus >;
|
|
59
|
+
setStatusOnWorkflowAsync(emailFlowId: number, status: enums.WorkflowDefinitionStatus, webapi_options?:base.WebApiRequestOptions) : Promise< enums.WorkflowDefinitionStatus >;
|
|
60
|
+
copyEmailFlowAsync(request: carriers.Workflow_CopyEmailFlowRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
61
|
+
copyEmailFlowAsync(emailFlowId: number, newName: string, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
62
|
+
runAsync(webapi_options?:base.WebApiRequestOptions) : Promise< Date >;
|
|
63
|
+
sendEventAsync(request: carriers.Workflow_SendEventRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowEventResult >;
|
|
64
|
+
sendEventAsync(workflowEvent: carriers.WorkflowEvent, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowEventResult >;
|
|
65
|
+
getWorkflowGoalAsync(workflowGoalId: number) : Promise< carriers.WorkflowGoal >;
|
|
66
|
+
getWorkflowStepAsync(request: carriers.Workflow_GetWorkflowStepRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase >;
|
|
67
|
+
getWorkflowStepAsync(workflowStepId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase >;
|
|
68
|
+
addAfterWorkflowStepAsync(request: carriers.Workflow_AddAfterWorkflowStepRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase >;
|
|
69
|
+
addAfterWorkflowStepAsync(workflowStepId: number, subStep: carriers.WorkflowStepBase, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase >;
|
|
70
|
+
createDefaultWorkflowStepFromTypeAsync(request: carriers.Workflow_CreateDefaultWorkflowStepFromTypeRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase >;
|
|
71
|
+
createDefaultWorkflowStepFromTypeAsync(stepType: enums.WorkflowStepType, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase >;
|
|
72
|
+
createDefaultWorkflowStepOptionFromTypeAsync(request: carriers.Workflow_CreateDefaultWorkflowStepOptionFromTypeRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepOptionBase >;
|
|
73
|
+
createDefaultWorkflowStepOptionFromTypeAsync(optionType: enums.WorkflowSplitOptionType, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepOptionBase >;
|
|
74
|
+
getWorkflowStepOptionAsync(request: carriers.Workflow_GetWorkflowStepOptionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepOptionBase >;
|
|
75
|
+
getWorkflowStepOptionAsync(workflowStepOptionId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepOptionBase >;
|
|
76
|
+
getWorkflowTriggerAsync(workflowTriggerId: number) : Promise< carriers.WorkflowTrigger >;
|
|
77
|
+
getWorkflowWaitForActionAsync(workflowWaitForActionId: number) : Promise< carriers.WorkflowWaitForAction >;
|
|
78
|
+
} // interface IWorkflowAgent
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Agent lets you configure workflow automation
|
|
85
|
+
*/
|
|
86
|
+
export class WorkflowAgent extends base.WebApiBase implements IWorkflowAgent {
|
|
87
|
+
constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
|
|
88
|
+
constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
|
|
89
|
+
constructor(baseUrl: string, resourceManager:any);
|
|
90
|
+
constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
|
|
91
|
+
constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
|
|
92
|
+
constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
|
|
93
|
+
constructor(options: base.WebApiOptions);
|
|
94
|
+
|
|
95
|
+
constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
|
|
96
|
+
langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
|
|
97
|
+
langOrResourceOrRM?:string|base.ResourceParsing|any,
|
|
98
|
+
cultureCode?: string,
|
|
99
|
+
) {
|
|
100
|
+
const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
|
|
101
|
+
options.basePath = "v1/Agents/Workflow/";
|
|
102
|
+
super(options);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Set default values into a new EmailFlow.
|
|
109
|
+
* NetServer calculates default values on the entity, which is required when creating/storing a new instance
|
|
110
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
111
|
+
* @returns A blank entity.
|
|
112
|
+
*/
|
|
113
|
+
public async createDefaultEmailFlowAsync(options?:base.WebApiRequestOptions) : Promise< carriers.EmailFlow > {
|
|
114
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
115
|
+
base.WebApiBase.SetPending(options);
|
|
116
|
+
return new Promise< carriers.EmailFlow >(async (resolve, reject) => {
|
|
117
|
+
try {
|
|
118
|
+
const response = await this._axios.post("CreateDefaultEmailFlow", null, config);
|
|
119
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
120
|
+
const res : carriers.EmailFlow = converters.Create_EmailFlow_From( response.data );
|
|
121
|
+
resolve(res);
|
|
122
|
+
}
|
|
123
|
+
catch( err ) {
|
|
124
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
125
|
+
reject(err);
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Replace the existing EmailFlow or creates a new EmailFlow if the id parameter is empty
|
|
131
|
+
* @param entity - The EmailFlow to be saved.
|
|
132
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
133
|
+
* @returns New or updated EmailFlow
|
|
134
|
+
*/
|
|
135
|
+
public async saveEmailFlowAsync(entity: carriers.EmailFlow, options?:base.WebApiRequestOptions) : Promise< carriers.EmailFlow > {
|
|
136
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
137
|
+
base.WebApiBase.SetPending(options);
|
|
138
|
+
return new Promise< carriers.EmailFlow >(async (resolve, reject) => {
|
|
139
|
+
try {
|
|
140
|
+
const response = await this._axios.post("SaveEmailFlow", entity, config);
|
|
141
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
142
|
+
const res : carriers.EmailFlow = converters.Create_EmailFlow_From( response.data );
|
|
143
|
+
resolve(res);
|
|
144
|
+
}
|
|
145
|
+
catch( err ) {
|
|
146
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
147
|
+
reject(err);
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Deletes the EmailFlow
|
|
154
|
+
* @param EmailFlowId - The id of the EmailFlow to be deleted.
|
|
155
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
156
|
+
*/
|
|
157
|
+
public async deleteEmailFlowAsync(EmailFlowId: number, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
158
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
159
|
+
base.WebApiBase.SetPending(options);
|
|
160
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
161
|
+
try {
|
|
162
|
+
const response = await this._axios.post("DeleteEmailFlow?EmailFlowId=" + EmailFlowId, null, config );
|
|
163
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
164
|
+
const res = response.data;
|
|
165
|
+
resolve(res);
|
|
166
|
+
}
|
|
167
|
+
catch( err ) {
|
|
168
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
169
|
+
reject(err);
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Set default values into a new WorkflowEvent.
|
|
176
|
+
* NetServer calculates default values on the entity, which is required when creating/storing a new instance
|
|
177
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
178
|
+
* @returns A blank entity.
|
|
179
|
+
*/
|
|
180
|
+
public async createDefaultWorkflowEventAsync(options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowEvent > {
|
|
181
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
182
|
+
base.WebApiBase.SetPending(options);
|
|
183
|
+
return new Promise< carriers.WorkflowEvent >(async (resolve, reject) => {
|
|
184
|
+
try {
|
|
185
|
+
const response = await this._axios.post("CreateDefaultWorkflowEvent", null, config);
|
|
186
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
187
|
+
const res : carriers.WorkflowEvent = converters.Create_WorkflowEvent_From( response.data );
|
|
188
|
+
resolve(res);
|
|
189
|
+
}
|
|
190
|
+
catch( err ) {
|
|
191
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
192
|
+
reject(err);
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Set default values into a new WorkflowEventResult.
|
|
199
|
+
* NetServer calculates default values on the entity, which is required when creating/storing a new instance
|
|
200
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
201
|
+
* @returns A blank entity.
|
|
202
|
+
*/
|
|
203
|
+
public async createDefaultWorkflowEventResultAsync(options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowEventResult > {
|
|
204
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
205
|
+
base.WebApiBase.SetPending(options);
|
|
206
|
+
return new Promise< carriers.WorkflowEventResult >(async (resolve, reject) => {
|
|
207
|
+
try {
|
|
208
|
+
const response = await this._axios.post("CreateDefaultWorkflowEventResult", null, config);
|
|
209
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
210
|
+
const res : carriers.WorkflowEventResult = converters.Create_WorkflowEventResult_From( response.data );
|
|
211
|
+
resolve(res);
|
|
212
|
+
}
|
|
213
|
+
catch( err ) {
|
|
214
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
215
|
+
reject(err);
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Set default values into a new WorkflowFilter.
|
|
222
|
+
* NetServer calculates default values on the entity, which is required when creating/storing a new instance
|
|
223
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
224
|
+
* @returns A blank entity.
|
|
225
|
+
*/
|
|
226
|
+
public async createDefaultWorkflowFilterAsync(options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowFilter > {
|
|
227
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
228
|
+
base.WebApiBase.SetPending(options);
|
|
229
|
+
return new Promise< carriers.WorkflowFilter >(async (resolve, reject) => {
|
|
230
|
+
try {
|
|
231
|
+
const response = await this._axios.post("CreateDefaultWorkflowFilter", null, config);
|
|
232
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
233
|
+
const res : carriers.WorkflowFilter = converters.Create_WorkflowFilter_From( response.data );
|
|
234
|
+
resolve(res);
|
|
235
|
+
}
|
|
236
|
+
catch( err ) {
|
|
237
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
238
|
+
reject(err);
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Set default values into a new WorkflowGoal.
|
|
245
|
+
* NetServer calculates default values on the entity, which is required when creating/storing a new instance
|
|
246
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
247
|
+
* @returns A blank entity.
|
|
248
|
+
*/
|
|
249
|
+
public async createDefaultWorkflowGoalAsync(options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowGoal > {
|
|
250
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
251
|
+
base.WebApiBase.SetPending(options);
|
|
252
|
+
return new Promise< carriers.WorkflowGoal >(async (resolve, reject) => {
|
|
253
|
+
try {
|
|
254
|
+
const response = await this._axios.post("CreateDefaultWorkflowGoal", null, config);
|
|
255
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
256
|
+
const res : carriers.WorkflowGoal = converters.Create_WorkflowGoal_From( response.data );
|
|
257
|
+
resolve(res);
|
|
258
|
+
}
|
|
259
|
+
catch( err ) {
|
|
260
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
261
|
+
reject(err);
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Replace the existing WorkflowGoal or creates a new WorkflowGoal if the id parameter is empty
|
|
267
|
+
* @param entity - The WorkflowGoal to be saved.
|
|
268
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
269
|
+
* @returns New or updated WorkflowGoal
|
|
270
|
+
*/
|
|
271
|
+
public async saveWorkflowGoalAsync(entity: carriers.WorkflowGoal, options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowGoal > {
|
|
272
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
273
|
+
base.WebApiBase.SetPending(options);
|
|
274
|
+
return new Promise< carriers.WorkflowGoal >(async (resolve, reject) => {
|
|
275
|
+
try {
|
|
276
|
+
const response = await this._axios.post("SaveWorkflowGoal", entity, config);
|
|
277
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
278
|
+
const res : carriers.WorkflowGoal = converters.Create_WorkflowGoal_From( response.data );
|
|
279
|
+
resolve(res);
|
|
280
|
+
}
|
|
281
|
+
catch( err ) {
|
|
282
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
283
|
+
reject(err);
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Deletes the WorkflowGoal
|
|
290
|
+
* @param WorkflowGoalId - The id of the WorkflowGoal to be deleted.
|
|
291
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
292
|
+
*/
|
|
293
|
+
public async deleteWorkflowGoalAsync(WorkflowGoalId: number, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
294
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
295
|
+
base.WebApiBase.SetPending(options);
|
|
296
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
297
|
+
try {
|
|
298
|
+
const response = await this._axios.post("DeleteWorkflowGoal?WorkflowGoalId=" + WorkflowGoalId, null, config );
|
|
299
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
300
|
+
const res = response.data;
|
|
301
|
+
resolve(res);
|
|
302
|
+
}
|
|
303
|
+
catch( err ) {
|
|
304
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
305
|
+
reject(err);
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Set default values into a new WorkflowTrigger.
|
|
312
|
+
* NetServer calculates default values on the entity, which is required when creating/storing a new instance
|
|
313
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
314
|
+
* @returns A blank entity.
|
|
315
|
+
*/
|
|
316
|
+
public async createDefaultWorkflowTriggerAsync(options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowTrigger > {
|
|
317
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
318
|
+
base.WebApiBase.SetPending(options);
|
|
319
|
+
return new Promise< carriers.WorkflowTrigger >(async (resolve, reject) => {
|
|
320
|
+
try {
|
|
321
|
+
const response = await this._axios.post("CreateDefaultWorkflowTrigger", null, config);
|
|
322
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
323
|
+
const res : carriers.WorkflowTrigger = converters.Create_WorkflowTrigger_From( response.data );
|
|
324
|
+
resolve(res);
|
|
325
|
+
}
|
|
326
|
+
catch( err ) {
|
|
327
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
328
|
+
reject(err);
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Replace the existing WorkflowTrigger or creates a new WorkflowTrigger if the id parameter is empty
|
|
334
|
+
* @param entity - The WorkflowTrigger to be saved.
|
|
335
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
336
|
+
* @returns New or updated WorkflowTrigger
|
|
337
|
+
*/
|
|
338
|
+
public async saveWorkflowTriggerAsync(entity: carriers.WorkflowTrigger, options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowTrigger > {
|
|
339
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
340
|
+
base.WebApiBase.SetPending(options);
|
|
341
|
+
return new Promise< carriers.WorkflowTrigger >(async (resolve, reject) => {
|
|
342
|
+
try {
|
|
343
|
+
const response = await this._axios.post("SaveWorkflowTrigger", entity, config);
|
|
344
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
345
|
+
const res : carriers.WorkflowTrigger = converters.Create_WorkflowTrigger_From( response.data );
|
|
346
|
+
resolve(res);
|
|
347
|
+
}
|
|
348
|
+
catch( err ) {
|
|
349
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
350
|
+
reject(err);
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Deletes the WorkflowTrigger
|
|
357
|
+
* @param WorkflowTriggerId - The id of the WorkflowTrigger to be deleted.
|
|
358
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
359
|
+
*/
|
|
360
|
+
public async deleteWorkflowTriggerAsync(WorkflowTriggerId: number, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
361
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
362
|
+
base.WebApiBase.SetPending(options);
|
|
363
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
364
|
+
try {
|
|
365
|
+
const response = await this._axios.post("DeleteWorkflowTrigger?WorkflowTriggerId=" + WorkflowTriggerId, null, config );
|
|
366
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
367
|
+
const res = response.data;
|
|
368
|
+
resolve(res);
|
|
369
|
+
}
|
|
370
|
+
catch( err ) {
|
|
371
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
372
|
+
reject(err);
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Set default values into a new WorkflowWaitForAction.
|
|
379
|
+
* NetServer calculates default values on the entity, which is required when creating/storing a new instance
|
|
380
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
381
|
+
* @returns A blank entity.
|
|
382
|
+
*/
|
|
383
|
+
public async createDefaultWorkflowWaitForActionAsync(options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowWaitForAction > {
|
|
384
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
385
|
+
base.WebApiBase.SetPending(options);
|
|
386
|
+
return new Promise< carriers.WorkflowWaitForAction >(async (resolve, reject) => {
|
|
387
|
+
try {
|
|
388
|
+
const response = await this._axios.post("CreateDefaultWorkflowWaitForAction", null, config);
|
|
389
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
390
|
+
const res : carriers.WorkflowWaitForAction = converters.Create_WorkflowWaitForAction_From( response.data );
|
|
391
|
+
resolve(res);
|
|
392
|
+
}
|
|
393
|
+
catch( err ) {
|
|
394
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
395
|
+
reject(err);
|
|
396
|
+
}
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Replace the existing WorkflowWaitForAction or creates a new WorkflowWaitForAction if the id parameter is empty
|
|
401
|
+
* @param entity - The WorkflowWaitForAction to be saved.
|
|
402
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
403
|
+
* @returns New or updated WorkflowWaitForAction
|
|
404
|
+
*/
|
|
405
|
+
public async saveWorkflowWaitForActionAsync(entity: carriers.WorkflowWaitForAction, options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowWaitForAction > {
|
|
406
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
407
|
+
base.WebApiBase.SetPending(options);
|
|
408
|
+
return new Promise< carriers.WorkflowWaitForAction >(async (resolve, reject) => {
|
|
409
|
+
try {
|
|
410
|
+
const response = await this._axios.post("SaveWorkflowWaitForAction", entity, config);
|
|
411
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
412
|
+
const res : carriers.WorkflowWaitForAction = converters.Create_WorkflowWaitForAction_From( response.data );
|
|
413
|
+
resolve(res);
|
|
414
|
+
}
|
|
415
|
+
catch( err ) {
|
|
416
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
417
|
+
reject(err);
|
|
418
|
+
}
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* Deletes the WorkflowWaitForAction
|
|
424
|
+
* @param WorkflowWaitForActionId - The id of the WorkflowWaitForAction to be deleted.
|
|
425
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
426
|
+
*/
|
|
427
|
+
public async deleteWorkflowWaitForActionAsync(WorkflowWaitForActionId: number, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
428
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
429
|
+
base.WebApiBase.SetPending(options);
|
|
430
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
431
|
+
try {
|
|
432
|
+
const response = await this._axios.post("DeleteWorkflowWaitForAction?WorkflowWaitForActionId=" + WorkflowWaitForActionId, null, config );
|
|
433
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
434
|
+
const res = response.data;
|
|
435
|
+
resolve(res);
|
|
436
|
+
}
|
|
437
|
+
catch( err ) {
|
|
438
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
439
|
+
reject(err);
|
|
440
|
+
}
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* Gets a EmailFlow object.
|
|
445
|
+
* @param emailFlowId - The primary key.
|
|
446
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
447
|
+
* @returns A single EmailFlow
|
|
448
|
+
*/
|
|
449
|
+
public async getEmailFlowAsync(emailFlowId: number, options?:base.WebApiRequestOptions) : Promise< carriers.EmailFlow > {
|
|
450
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
451
|
+
base.WebApiBase.SetPending(options);
|
|
452
|
+
return new Promise< carriers.EmailFlow >(async (resolve, reject) => {
|
|
453
|
+
try {
|
|
454
|
+
const response = await this._axios.post("GetEmailFlow?emailFlowId=" + emailFlowId, null, config);
|
|
455
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
456
|
+
const res = converters.Create_EmailFlow_From( response.data );
|
|
457
|
+
resolve(res);
|
|
458
|
+
}
|
|
459
|
+
catch( err ) {
|
|
460
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
461
|
+
reject(err);
|
|
462
|
+
}
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
private async _tryAddPersonsToEmailFlowAsync(request: carriers.Workflow_TryAddPersonsToEmailFlowRequest, options?:base.WebApiRequestOptions) : Promise< boolean[] > {
|
|
468
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
469
|
+
base.WebApiBase.SetPending(options);
|
|
470
|
+
return new Promise< boolean[] >(async (resolve, reject) => {
|
|
471
|
+
try {
|
|
472
|
+
config.baseURL = this._options.baseUrl;
|
|
473
|
+
const response = await this._axios.post("TryAddPersonsToEmailFlow", request , config);
|
|
474
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
475
|
+
const res : boolean[] = response.data as boolean[];
|
|
476
|
+
resolve(res);
|
|
477
|
+
}
|
|
478
|
+
catch( err ) {
|
|
479
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
480
|
+
reject(err);
|
|
481
|
+
}
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* Try to add a participant to the EmailFlow. Same function available in PersonAgent
|
|
489
|
+
* @param request - EmailFlowId, PersonIds
|
|
490
|
+
* @returns True if the corresponding participant was successfully added, false if it could not be added because of filter criteria or other reason
|
|
491
|
+
*/
|
|
492
|
+
public async tryAddPersonsToEmailFlowAsync(request: carriers.Workflow_TryAddPersonsToEmailFlowRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean[] >;
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* Try to add a participant to the EmailFlow. Same function available in PersonAgent
|
|
496
|
+
* @param emailFlowId - Primary key of EmailFlow
|
|
497
|
+
* @param personIds - Array of Person Ids
|
|
498
|
+
* @returns True if the corresponding participant was successfully added, false if it could not be added because of filter criteria or other reason
|
|
499
|
+
*/
|
|
500
|
+
public async tryAddPersonsToEmailFlowAsync(emailFlowId: number, personIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< boolean[] >;
|
|
501
|
+
|
|
502
|
+
public async tryAddPersonsToEmailFlowAsync(emailFlowId:number|carriers.Workflow_TryAddPersonsToEmailFlowRequest, personIds?:number[]|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< boolean[] > {
|
|
503
|
+
let _request : carriers.Workflow_TryAddPersonsToEmailFlowRequest = null;
|
|
504
|
+
let _options : base.WebApiRequestOptions = null;
|
|
505
|
+
const first : any = emailFlowId;
|
|
506
|
+
if( typeof( first ) === "object" && first && ( typeof(first.emailFlowId)!='undefined' || typeof(first.personIds)!='undefined' ) )
|
|
507
|
+
{
|
|
508
|
+
_request = emailFlowId as carriers.Workflow_TryAddPersonsToEmailFlowRequest;
|
|
509
|
+
_options = personIds as base.WebApiRequestOptions;
|
|
510
|
+
}
|
|
511
|
+
else
|
|
512
|
+
{
|
|
513
|
+
_request = {
|
|
514
|
+
emailFlowId: emailFlowId as number,
|
|
515
|
+
personIds: personIds as number[],
|
|
516
|
+
};
|
|
517
|
+
_options = webapi_options;
|
|
518
|
+
}
|
|
519
|
+
return this._tryAddPersonsToEmailFlowAsync( _request, _options );
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
private async _removeParticipantsFromEmailFlowAsync(request: carriers.Workflow_RemoveParticipantsFromEmailFlowRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
524
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
525
|
+
base.WebApiBase.SetPending(options);
|
|
526
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
527
|
+
try {
|
|
528
|
+
config.baseURL = this._options.baseUrl;
|
|
529
|
+
const response = await this._axios.post("RemoveParticipantsFromEmailFlow", request , config);
|
|
530
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
531
|
+
const res = response.data;
|
|
532
|
+
resolve(res);
|
|
533
|
+
}
|
|
534
|
+
catch( err ) {
|
|
535
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
536
|
+
reject(err);
|
|
537
|
+
}
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* Remove participants (actually workflow instances) from the workflow
|
|
545
|
+
* @param request - EmailFlowId, WorkflowInstanceIds
|
|
546
|
+
* @returns
|
|
547
|
+
*/
|
|
548
|
+
public async removeParticipantsFromEmailFlowAsync(request: carriers.Workflow_RemoveParticipantsFromEmailFlowRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* Remove participants (actually workflow instances) from the workflow
|
|
552
|
+
* @param emailFlowId - Primary key of EmailFlow
|
|
553
|
+
* @param workflowInstanceIds - Array of Workflow instances (representing participants) to be completely removed from the workflow
|
|
554
|
+
* @returns
|
|
555
|
+
*/
|
|
556
|
+
public async removeParticipantsFromEmailFlowAsync(emailFlowId: number, workflowInstanceIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
557
|
+
|
|
558
|
+
public async removeParticipantsFromEmailFlowAsync(emailFlowId:number|carriers.Workflow_RemoveParticipantsFromEmailFlowRequest, workflowInstanceIds?:number[]|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
559
|
+
let _request : carriers.Workflow_RemoveParticipantsFromEmailFlowRequest = null;
|
|
560
|
+
let _options : base.WebApiRequestOptions = null;
|
|
561
|
+
const first : any = emailFlowId;
|
|
562
|
+
if( typeof( first ) === "object" && first && ( typeof(first.emailFlowId)!='undefined' || typeof(first.workflowInstanceIds)!='undefined' ) )
|
|
563
|
+
{
|
|
564
|
+
_request = emailFlowId as carriers.Workflow_RemoveParticipantsFromEmailFlowRequest;
|
|
565
|
+
_options = workflowInstanceIds as base.WebApiRequestOptions;
|
|
566
|
+
}
|
|
567
|
+
else
|
|
568
|
+
{
|
|
569
|
+
_request = {
|
|
570
|
+
emailFlowId: emailFlowId as number,
|
|
571
|
+
workflowInstanceIds: workflowInstanceIds as number[],
|
|
572
|
+
};
|
|
573
|
+
_options = webapi_options;
|
|
574
|
+
}
|
|
575
|
+
return this._removeParticipantsFromEmailFlowAsync( _request, _options );
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
private async _createEmailFlowContentAsync(request: carriers.Workflow_CreateEmailFlowContentRequest, options?:base.WebApiRequestOptions) : Promise< number > {
|
|
580
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
581
|
+
base.WebApiBase.SetPending(options);
|
|
582
|
+
return new Promise< number >(async (resolve, reject) => {
|
|
583
|
+
try {
|
|
584
|
+
config.baseURL = this._options.baseUrl;
|
|
585
|
+
const response = await this._axios.post("CreateEmailFlowContent", request , config);
|
|
586
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
587
|
+
const res : number = response.data as number;
|
|
588
|
+
resolve(res);
|
|
589
|
+
}
|
|
590
|
+
catch( err ) {
|
|
591
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
592
|
+
reject(err);
|
|
593
|
+
}
|
|
594
|
+
});
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* Create content to an email flow
|
|
601
|
+
* @param request - EmailFlowId, ContentName
|
|
602
|
+
* @returns Id of shipment created
|
|
603
|
+
*/
|
|
604
|
+
public async createEmailFlowContentAsync(request: carriers.Workflow_CreateEmailFlowContentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* Create content to an email flow
|
|
608
|
+
* @param emailFlowId - The EmailFlow to connect the created message to.
|
|
609
|
+
* @param contentName - The name of the content created
|
|
610
|
+
* @returns Id of shipment created
|
|
611
|
+
*/
|
|
612
|
+
public async createEmailFlowContentAsync(emailFlowId: number, contentName: string, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
613
|
+
|
|
614
|
+
public async createEmailFlowContentAsync(emailFlowId:number|carriers.Workflow_CreateEmailFlowContentRequest, contentName?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< number > {
|
|
615
|
+
let _request : carriers.Workflow_CreateEmailFlowContentRequest = null;
|
|
616
|
+
let _options : base.WebApiRequestOptions = null;
|
|
617
|
+
const first : any = emailFlowId;
|
|
618
|
+
if( typeof( first ) === "object" && first && ( typeof(first.emailFlowId)!='undefined' || typeof(first.contentName)!='undefined' ) )
|
|
619
|
+
{
|
|
620
|
+
_request = emailFlowId as carriers.Workflow_CreateEmailFlowContentRequest;
|
|
621
|
+
_options = contentName as base.WebApiRequestOptions;
|
|
622
|
+
}
|
|
623
|
+
else
|
|
624
|
+
{
|
|
625
|
+
_request = {
|
|
626
|
+
emailFlowId: emailFlowId as number,
|
|
627
|
+
contentName: contentName as string,
|
|
628
|
+
};
|
|
629
|
+
_options = webapi_options;
|
|
630
|
+
}
|
|
631
|
+
return this._createEmailFlowContentAsync( _request, _options );
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
private async _connectEmailFlowContentAsync(request: carriers.Workflow_ConnectEmailFlowContentRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
636
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
637
|
+
base.WebApiBase.SetPending(options);
|
|
638
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
639
|
+
try {
|
|
640
|
+
config.baseURL = this._options.baseUrl;
|
|
641
|
+
const response = await this._axios.post("ConnectEmailFlowContent", request , config);
|
|
642
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
643
|
+
const res = response.data;
|
|
644
|
+
resolve(res);
|
|
645
|
+
}
|
|
646
|
+
catch( err ) {
|
|
647
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
648
|
+
reject(err);
|
|
649
|
+
}
|
|
650
|
+
});
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
|
|
654
|
+
|
|
655
|
+
/**
|
|
656
|
+
* Link any SMessage to the email flow. The SMessage (and any related SShipment etc) should probably not be used/visible elsewhere.
|
|
657
|
+
* @param request - EmailFlowId, MessageId
|
|
658
|
+
* @returns
|
|
659
|
+
*/
|
|
660
|
+
public async connectEmailFlowContentAsync(request: carriers.Workflow_ConnectEmailFlowContentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
661
|
+
|
|
662
|
+
/**
|
|
663
|
+
* Link any SMessage to the email flow. The SMessage (and any related SShipment etc) should probably not be used/visible elsewhere.
|
|
664
|
+
* @param emailFlowId - The EmailFlow to connect the message to.
|
|
665
|
+
* @param messageId - The s_message to connect to the flow. A shipment, form or flow may be connected to that s_message.
|
|
666
|
+
* @returns
|
|
667
|
+
*/
|
|
668
|
+
public async connectEmailFlowContentAsync(emailFlowId: number, messageId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
669
|
+
|
|
670
|
+
public async connectEmailFlowContentAsync(emailFlowId:number|carriers.Workflow_ConnectEmailFlowContentRequest, messageId?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
671
|
+
let _request : carriers.Workflow_ConnectEmailFlowContentRequest = null;
|
|
672
|
+
let _options : base.WebApiRequestOptions = null;
|
|
673
|
+
const first : any = emailFlowId;
|
|
674
|
+
if( typeof( first ) === "object" && first && ( typeof(first.emailFlowId)!='undefined' || typeof(first.messageId)!='undefined' ) )
|
|
675
|
+
{
|
|
676
|
+
_request = emailFlowId as carriers.Workflow_ConnectEmailFlowContentRequest;
|
|
677
|
+
_options = messageId as base.WebApiRequestOptions;
|
|
678
|
+
}
|
|
679
|
+
else
|
|
680
|
+
{
|
|
681
|
+
_request = {
|
|
682
|
+
emailFlowId: emailFlowId as number,
|
|
683
|
+
messageId: messageId as number,
|
|
684
|
+
};
|
|
685
|
+
_options = webapi_options;
|
|
686
|
+
}
|
|
687
|
+
return this._connectEmailFlowContentAsync( _request, _options );
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
private async _copyEmailFlowContentAsync(request: carriers.Workflow_CopyEmailFlowContentRequest, options?:base.WebApiRequestOptions) : Promise< number > {
|
|
692
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
693
|
+
base.WebApiBase.SetPending(options);
|
|
694
|
+
return new Promise< number >(async (resolve, reject) => {
|
|
695
|
+
try {
|
|
696
|
+
config.baseURL = this._options.baseUrl;
|
|
697
|
+
const response = await this._axios.post("CopyEmailFlowContent", request , config);
|
|
698
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
699
|
+
const res : number = response.data as number;
|
|
700
|
+
resolve(res);
|
|
701
|
+
}
|
|
702
|
+
catch( err ) {
|
|
703
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
704
|
+
reject(err);
|
|
705
|
+
}
|
|
706
|
+
});
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
|
|
710
|
+
|
|
711
|
+
/**
|
|
712
|
+
* Copy smessage and connected shipment to the email flow. The SMessage (and any related SShipment etc) should probably not be used/visible elsewhere.
|
|
713
|
+
* @param request - EmailFlowId, ShipmentId
|
|
714
|
+
* @returns Newly created shipment id for this content
|
|
715
|
+
*/
|
|
716
|
+
public async copyEmailFlowContentAsync(request: carriers.Workflow_CopyEmailFlowContentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
717
|
+
|
|
718
|
+
/**
|
|
719
|
+
* Copy smessage and connected shipment to the email flow. The SMessage (and any related SShipment etc) should probably not be used/visible elsewhere.
|
|
720
|
+
* @param emailFlowId - The EmailFlow to connect the copied content to.
|
|
721
|
+
* @param shipmentId - The id of the shipment to copy to the flow. The message of this shipment will also be connected
|
|
722
|
+
* @returns Newly created shipment id for this content
|
|
723
|
+
*/
|
|
724
|
+
public async copyEmailFlowContentAsync(emailFlowId: number, shipmentId: number, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
725
|
+
|
|
726
|
+
public async copyEmailFlowContentAsync(emailFlowId:number|carriers.Workflow_CopyEmailFlowContentRequest, shipmentId?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< number > {
|
|
727
|
+
let _request : carriers.Workflow_CopyEmailFlowContentRequest = null;
|
|
728
|
+
let _options : base.WebApiRequestOptions = null;
|
|
729
|
+
const first : any = emailFlowId;
|
|
730
|
+
if( typeof( first ) === "object" && first && ( typeof(first.emailFlowId)!='undefined' || typeof(first.shipmentId)!='undefined' ) )
|
|
731
|
+
{
|
|
732
|
+
_request = emailFlowId as carriers.Workflow_CopyEmailFlowContentRequest;
|
|
733
|
+
_options = shipmentId as base.WebApiRequestOptions;
|
|
734
|
+
}
|
|
735
|
+
else
|
|
736
|
+
{
|
|
737
|
+
_request = {
|
|
738
|
+
emailFlowId: emailFlowId as number,
|
|
739
|
+
shipmentId: shipmentId as number,
|
|
740
|
+
};
|
|
741
|
+
_options = webapi_options;
|
|
742
|
+
}
|
|
743
|
+
return this._copyEmailFlowContentAsync( _request, _options );
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
|
|
747
|
+
private async _updateFormSubmissionsAsync(request: carriers.Workflow_UpdateFormSubmissionsRequest, options?:base.WebApiRequestOptions) : Promise< number > {
|
|
748
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
749
|
+
base.WebApiBase.SetPending(options);
|
|
750
|
+
return new Promise< number >(async (resolve, reject) => {
|
|
751
|
+
try {
|
|
752
|
+
config.baseURL = this._options.baseUrl;
|
|
753
|
+
const response = await this._axios.post("UpdateFormSubmissions", request , config);
|
|
754
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
755
|
+
const res : number = response.data as number;
|
|
756
|
+
resolve(res);
|
|
757
|
+
}
|
|
758
|
+
catch( err ) {
|
|
759
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
760
|
+
reject(err);
|
|
761
|
+
}
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* Attempt to update stored field values for up to the given number of form submissions
|
|
769
|
+
* @param request - MaxCount
|
|
770
|
+
* @returns Number of form submissions converted
|
|
771
|
+
*/
|
|
772
|
+
public async updateFormSubmissionsAsync(request: carriers.Workflow_UpdateFormSubmissionsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
773
|
+
|
|
774
|
+
/**
|
|
775
|
+
* Attempt to update stored field values for up to the given number of form submissions
|
|
776
|
+
* @param maxCount - The maximum number of form submissions to attempt to save as form field values.
|
|
777
|
+
* @returns Number of form submissions converted
|
|
778
|
+
*/
|
|
779
|
+
public async updateFormSubmissionsAsync(maxCount: number, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
780
|
+
|
|
781
|
+
public async updateFormSubmissionsAsync(maxCount:number|carriers.Workflow_UpdateFormSubmissionsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number > {
|
|
782
|
+
let _request : carriers.Workflow_UpdateFormSubmissionsRequest = null;
|
|
783
|
+
let _options : base.WebApiRequestOptions = null;
|
|
784
|
+
const first : any = maxCount;
|
|
785
|
+
if( typeof( first ) === "object" && first && ( typeof(first.maxCount)!='undefined' ) )
|
|
786
|
+
{
|
|
787
|
+
_request = maxCount as carriers.Workflow_UpdateFormSubmissionsRequest;
|
|
788
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
789
|
+
}
|
|
790
|
+
else
|
|
791
|
+
{
|
|
792
|
+
_request = {
|
|
793
|
+
maxCount: maxCount as number,
|
|
794
|
+
};
|
|
795
|
+
_options = webapi_options;
|
|
796
|
+
}
|
|
797
|
+
return this._updateFormSubmissionsAsync( _request, _options );
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
|
|
801
|
+
private async _setStatusOnWorkflowAsync(request: carriers.Workflow_SetStatusOnWorkflowRequest, options?:base.WebApiRequestOptions) : Promise< enums.WorkflowDefinitionStatus > {
|
|
802
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
803
|
+
base.WebApiBase.SetPending(options);
|
|
804
|
+
return new Promise< enums.WorkflowDefinitionStatus >(async (resolve, reject) => {
|
|
805
|
+
try {
|
|
806
|
+
config.baseURL = this._options.baseUrl;
|
|
807
|
+
const response = await this._axios.post("SetStatusOnWorkflow", request , config);
|
|
808
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
809
|
+
const res : enums.WorkflowDefinitionStatus = response.data as enums.WorkflowDefinitionStatus;
|
|
810
|
+
resolve(res);
|
|
811
|
+
}
|
|
812
|
+
catch( err ) {
|
|
813
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
814
|
+
reject(err);
|
|
815
|
+
}
|
|
816
|
+
});
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
|
|
820
|
+
|
|
821
|
+
/**
|
|
822
|
+
* Set status on workflow, Run or pause flow
|
|
823
|
+
* @param request - EmailFlowId, Status
|
|
824
|
+
* @returns The new status
|
|
825
|
+
*/
|
|
826
|
+
public async setStatusOnWorkflowAsync(request: carriers.Workflow_SetStatusOnWorkflowRequest, webapi_options?:base.WebApiRequestOptions) : Promise< enums.WorkflowDefinitionStatus >;
|
|
827
|
+
|
|
828
|
+
/**
|
|
829
|
+
* Set status on workflow, Run or pause flow
|
|
830
|
+
* @param emailFlowId - The id of the email flow to run or pause
|
|
831
|
+
* @param status - The new status
|
|
832
|
+
* @returns The new status
|
|
833
|
+
*/
|
|
834
|
+
public async setStatusOnWorkflowAsync(emailFlowId: number, status: enums.WorkflowDefinitionStatus, webapi_options?:base.WebApiRequestOptions) : Promise< enums.WorkflowDefinitionStatus >;
|
|
835
|
+
|
|
836
|
+
public async setStatusOnWorkflowAsync(emailFlowId:number|carriers.Workflow_SetStatusOnWorkflowRequest, status?:enums.WorkflowDefinitionStatus|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< enums.WorkflowDefinitionStatus > {
|
|
837
|
+
let _request : carriers.Workflow_SetStatusOnWorkflowRequest = null;
|
|
838
|
+
let _options : base.WebApiRequestOptions = null;
|
|
839
|
+
const first : any = emailFlowId;
|
|
840
|
+
if( typeof( first ) === "object" && first && ( typeof(first.emailFlowId)!='undefined' || typeof(first.status)!='undefined' ) )
|
|
841
|
+
{
|
|
842
|
+
_request = emailFlowId as carriers.Workflow_SetStatusOnWorkflowRequest;
|
|
843
|
+
_options = status as base.WebApiRequestOptions;
|
|
844
|
+
}
|
|
845
|
+
else
|
|
846
|
+
{
|
|
847
|
+
_request = {
|
|
848
|
+
emailFlowId: emailFlowId as number,
|
|
849
|
+
status: status as enums.WorkflowDefinitionStatus,
|
|
850
|
+
};
|
|
851
|
+
_options = webapi_options;
|
|
852
|
+
}
|
|
853
|
+
return this._setStatusOnWorkflowAsync( _request, _options );
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
|
|
857
|
+
private async _copyEmailFlowAsync(request: carriers.Workflow_CopyEmailFlowRequest, options?:base.WebApiRequestOptions) : Promise< number > {
|
|
858
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
859
|
+
base.WebApiBase.SetPending(options);
|
|
860
|
+
return new Promise< number >(async (resolve, reject) => {
|
|
861
|
+
try {
|
|
862
|
+
config.baseURL = this._options.baseUrl;
|
|
863
|
+
const response = await this._axios.post("CopyEmailFlow", request , config);
|
|
864
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
865
|
+
const res : number = response.data as number;
|
|
866
|
+
resolve(res);
|
|
867
|
+
}
|
|
868
|
+
catch( err ) {
|
|
869
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
870
|
+
reject(err);
|
|
871
|
+
}
|
|
872
|
+
});
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
|
|
876
|
+
|
|
877
|
+
/**
|
|
878
|
+
* Copy an email flow.
|
|
879
|
+
* @param request - EmailFlowId, NewName
|
|
880
|
+
* @returns Newly created email flow id for this content
|
|
881
|
+
*/
|
|
882
|
+
public async copyEmailFlowAsync(request: carriers.Workflow_CopyEmailFlowRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
883
|
+
|
|
884
|
+
/**
|
|
885
|
+
* Copy an email flow.
|
|
886
|
+
* @param emailFlowId - The EmailFlow to copy.
|
|
887
|
+
* @param newName - The name of the new email flow
|
|
888
|
+
* @returns Newly created email flow id for this content
|
|
889
|
+
*/
|
|
890
|
+
public async copyEmailFlowAsync(emailFlowId: number, newName: string, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
891
|
+
|
|
892
|
+
public async copyEmailFlowAsync(emailFlowId:number|carriers.Workflow_CopyEmailFlowRequest, newName?:string|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< number > {
|
|
893
|
+
let _request : carriers.Workflow_CopyEmailFlowRequest = null;
|
|
894
|
+
let _options : base.WebApiRequestOptions = null;
|
|
895
|
+
const first : any = emailFlowId;
|
|
896
|
+
if( typeof( first ) === "object" && first && ( typeof(first.emailFlowId)!='undefined' || typeof(first.newName)!='undefined' ) )
|
|
897
|
+
{
|
|
898
|
+
_request = emailFlowId as carriers.Workflow_CopyEmailFlowRequest;
|
|
899
|
+
_options = newName as base.WebApiRequestOptions;
|
|
900
|
+
}
|
|
901
|
+
else
|
|
902
|
+
{
|
|
903
|
+
_request = {
|
|
904
|
+
emailFlowId: emailFlowId as number,
|
|
905
|
+
newName: newName as string,
|
|
906
|
+
};
|
|
907
|
+
_options = webapi_options;
|
|
908
|
+
}
|
|
909
|
+
return this._copyEmailFlowAsync( _request, _options );
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
|
|
913
|
+
private async _runAsync( options?:base.WebApiRequestOptions) : Promise< Date > {
|
|
914
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
915
|
+
base.WebApiBase.SetPending(options);
|
|
916
|
+
return new Promise< Date >(async (resolve, reject) => {
|
|
917
|
+
try {
|
|
918
|
+
config.baseURL = this._options.baseUrl;
|
|
919
|
+
const response = await this._axios.post("Run", undefined , config);
|
|
920
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
921
|
+
const res : Date = response.data as Date;
|
|
922
|
+
resolve(res);
|
|
923
|
+
}
|
|
924
|
+
catch( err ) {
|
|
925
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
926
|
+
reject(err);
|
|
927
|
+
}
|
|
928
|
+
});
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
|
|
932
|
+
/**
|
|
933
|
+
* Run the workflow engine right now
|
|
934
|
+
* @returns Suggested time for next run
|
|
935
|
+
*/
|
|
936
|
+
public async runAsync(webapi_options?:base.WebApiRequestOptions) : Promise< Date >
|
|
937
|
+
{
|
|
938
|
+
return this._runAsync(webapi_options);
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
|
|
942
|
+
private async _sendEventAsync(request: carriers.Workflow_SendEventRequest, options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowEventResult > {
|
|
943
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
944
|
+
base.WebApiBase.SetPending(options);
|
|
945
|
+
return new Promise< carriers.WorkflowEventResult >(async (resolve, reject) => {
|
|
946
|
+
try {
|
|
947
|
+
config.baseURL = this._options.baseUrl;
|
|
948
|
+
const response = await this._axios.post("SendEvent", request , config);
|
|
949
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
950
|
+
const res : carriers.WorkflowEventResult = converters.Create_WorkflowEventResult_From( response.data );
|
|
951
|
+
resolve(res);
|
|
952
|
+
}
|
|
953
|
+
catch( err ) {
|
|
954
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
955
|
+
reject(err);
|
|
956
|
+
}
|
|
957
|
+
});
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
|
|
961
|
+
|
|
962
|
+
/**
|
|
963
|
+
* Send a workflow event. Most event signaling will finish very quickly as they normally just change the state of a workflow instance
|
|
964
|
+
* @param request - WorkflowEvent
|
|
965
|
+
* @returns Any relevant info about the event
|
|
966
|
+
*/
|
|
967
|
+
public async sendEventAsync(request: carriers.Workflow_SendEventRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowEventResult >;
|
|
968
|
+
|
|
969
|
+
/**
|
|
970
|
+
* Send a workflow event. Most event signaling will finish very quickly as they normally just change the state of a workflow instance
|
|
971
|
+
* @param workflowEvent - Information about the signaled event
|
|
972
|
+
* @returns Any relevant info about the event
|
|
973
|
+
*/
|
|
974
|
+
public async sendEventAsync(workflowEvent: carriers.WorkflowEvent, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowEventResult >;
|
|
975
|
+
|
|
976
|
+
public async sendEventAsync(workflowEvent:carriers.WorkflowEvent|carriers.Workflow_SendEventRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowEventResult > {
|
|
977
|
+
let _request : carriers.Workflow_SendEventRequest = null;
|
|
978
|
+
let _options : base.WebApiRequestOptions = null;
|
|
979
|
+
const first : any = workflowEvent;
|
|
980
|
+
if( typeof( first ) === "object" && first && ( typeof(first.workflowEvent)!='undefined' ) )
|
|
981
|
+
{
|
|
982
|
+
_request = workflowEvent as carriers.Workflow_SendEventRequest;
|
|
983
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
984
|
+
}
|
|
985
|
+
else
|
|
986
|
+
{
|
|
987
|
+
_request = {
|
|
988
|
+
workflowEvent: workflowEvent as carriers.WorkflowEvent,
|
|
989
|
+
};
|
|
990
|
+
_options = webapi_options;
|
|
991
|
+
}
|
|
992
|
+
return this._sendEventAsync( _request, _options );
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
/**
|
|
996
|
+
* Gets a WorkflowGoal object.
|
|
997
|
+
* @param workflowGoalId - The primary key.
|
|
998
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
999
|
+
* @returns A single WorkflowGoal
|
|
1000
|
+
*/
|
|
1001
|
+
public async getWorkflowGoalAsync(workflowGoalId: number, options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowGoal > {
|
|
1002
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1003
|
+
base.WebApiBase.SetPending(options);
|
|
1004
|
+
return new Promise< carriers.WorkflowGoal >(async (resolve, reject) => {
|
|
1005
|
+
try {
|
|
1006
|
+
const response = await this._axios.post("GetWorkflowGoal?workflowGoalId=" + workflowGoalId, null, config);
|
|
1007
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1008
|
+
const res = converters.Create_WorkflowGoal_From( response.data );
|
|
1009
|
+
resolve(res);
|
|
1010
|
+
}
|
|
1011
|
+
catch( err ) {
|
|
1012
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1013
|
+
reject(err);
|
|
1014
|
+
}
|
|
1015
|
+
});
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
|
|
1019
|
+
private async _getWorkflowStepAsync(request: carriers.Workflow_GetWorkflowStepRequest, options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase > {
|
|
1020
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1021
|
+
base.WebApiBase.SetPending(options);
|
|
1022
|
+
return new Promise< carriers.WorkflowStepBase >(async (resolve, reject) => {
|
|
1023
|
+
try {
|
|
1024
|
+
config.baseURL = this._options.baseUrl;
|
|
1025
|
+
const response = await this._axios.post("GetWorkflowStep", request , config);
|
|
1026
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1027
|
+
const res : carriers.WorkflowStepBase = converters.Create_WorkflowStepBase_From( response.data );
|
|
1028
|
+
resolve(res);
|
|
1029
|
+
}
|
|
1030
|
+
catch( err ) {
|
|
1031
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1032
|
+
reject(err);
|
|
1033
|
+
}
|
|
1034
|
+
});
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
|
|
1038
|
+
|
|
1039
|
+
/**
|
|
1040
|
+
* Get Workflowstep by ID
|
|
1041
|
+
* @param request - WorkflowStepId
|
|
1042
|
+
* @returns The Workflow step
|
|
1043
|
+
*/
|
|
1044
|
+
public async getWorkflowStepAsync(request: carriers.Workflow_GetWorkflowStepRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase >;
|
|
1045
|
+
|
|
1046
|
+
/**
|
|
1047
|
+
* Get Workflowstep by ID
|
|
1048
|
+
* @param workflowStepId - Primary key of WorkflowStep
|
|
1049
|
+
* @returns The Workflow step
|
|
1050
|
+
*/
|
|
1051
|
+
public async getWorkflowStepAsync(workflowStepId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase >;
|
|
1052
|
+
|
|
1053
|
+
public async getWorkflowStepAsync(workflowStepId:number|carriers.Workflow_GetWorkflowStepRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase > {
|
|
1054
|
+
let _request : carriers.Workflow_GetWorkflowStepRequest = null;
|
|
1055
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1056
|
+
const first : any = workflowStepId;
|
|
1057
|
+
if( typeof( first ) === "object" && first && ( typeof(first.workflowStepId)!='undefined' ) )
|
|
1058
|
+
{
|
|
1059
|
+
_request = workflowStepId as carriers.Workflow_GetWorkflowStepRequest;
|
|
1060
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
1061
|
+
}
|
|
1062
|
+
else
|
|
1063
|
+
{
|
|
1064
|
+
_request = {
|
|
1065
|
+
workflowStepId: workflowStepId as number,
|
|
1066
|
+
};
|
|
1067
|
+
_options = webapi_options;
|
|
1068
|
+
}
|
|
1069
|
+
return this._getWorkflowStepAsync( _request, _options );
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
|
|
1073
|
+
private async _addAfterWorkflowStepAsync(request: carriers.Workflow_AddAfterWorkflowStepRequest, options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase > {
|
|
1074
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1075
|
+
base.WebApiBase.SetPending(options);
|
|
1076
|
+
return new Promise< carriers.WorkflowStepBase >(async (resolve, reject) => {
|
|
1077
|
+
try {
|
|
1078
|
+
config.baseURL = this._options.baseUrl;
|
|
1079
|
+
const response = await this._axios.post("AddAfterWorkflowStep", request , config);
|
|
1080
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1081
|
+
const res : carriers.WorkflowStepBase = converters.Create_WorkflowStepBase_From( response.data );
|
|
1082
|
+
resolve(res);
|
|
1083
|
+
}
|
|
1084
|
+
catch( err ) {
|
|
1085
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1086
|
+
reject(err);
|
|
1087
|
+
}
|
|
1088
|
+
});
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
|
|
1092
|
+
|
|
1093
|
+
/**
|
|
1094
|
+
* Add another step (and any of its substeps) after the given step id (which must exist), and move any following steps in the workflow further down the line.
|
|
1095
|
+
* @param request - WorkflowStepId, SubStep
|
|
1096
|
+
* @returns The added step
|
|
1097
|
+
*/
|
|
1098
|
+
public async addAfterWorkflowStepAsync(request: carriers.Workflow_AddAfterWorkflowStepRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase >;
|
|
1099
|
+
|
|
1100
|
+
/**
|
|
1101
|
+
* Add another step (and any of its substeps) after the given step id (which must exist), and move any following steps in the workflow further down the line.
|
|
1102
|
+
* @param workflowStepId - Primary key of WorkflowStep
|
|
1103
|
+
* @param subStep - The step to be inserted after given step id.
|
|
1104
|
+
* @returns The added step
|
|
1105
|
+
*/
|
|
1106
|
+
public async addAfterWorkflowStepAsync(workflowStepId: number, subStep: carriers.WorkflowStepBase, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase >;
|
|
1107
|
+
|
|
1108
|
+
public async addAfterWorkflowStepAsync(workflowStepId:number|carriers.Workflow_AddAfterWorkflowStepRequest, subStep?:carriers.WorkflowStepBase|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase > {
|
|
1109
|
+
let _request : carriers.Workflow_AddAfterWorkflowStepRequest = null;
|
|
1110
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1111
|
+
const first : any = workflowStepId;
|
|
1112
|
+
if( typeof( first ) === "object" && first && ( typeof(first.workflowStepId)!='undefined' || typeof(first.subStep)!='undefined' ) )
|
|
1113
|
+
{
|
|
1114
|
+
_request = workflowStepId as carriers.Workflow_AddAfterWorkflowStepRequest;
|
|
1115
|
+
_options = subStep as base.WebApiRequestOptions;
|
|
1116
|
+
}
|
|
1117
|
+
else
|
|
1118
|
+
{
|
|
1119
|
+
_request = {
|
|
1120
|
+
workflowStepId: workflowStepId as number,
|
|
1121
|
+
subStep: subStep as carriers.WorkflowStepBase,
|
|
1122
|
+
};
|
|
1123
|
+
_options = webapi_options;
|
|
1124
|
+
}
|
|
1125
|
+
return this._addAfterWorkflowStepAsync( _request, _options );
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
|
|
1129
|
+
private async _createDefaultWorkflowStepFromTypeAsync(request: carriers.Workflow_CreateDefaultWorkflowStepFromTypeRequest, options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase > {
|
|
1130
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1131
|
+
base.WebApiBase.SetPending(options);
|
|
1132
|
+
return new Promise< carriers.WorkflowStepBase >(async (resolve, reject) => {
|
|
1133
|
+
try {
|
|
1134
|
+
config.baseURL = this._options.baseUrl;
|
|
1135
|
+
const response = await this._axios.post("CreateDefaultWorkflowStepFromType", request , config);
|
|
1136
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1137
|
+
const res : carriers.WorkflowStepBase = converters.Create_WorkflowStepBase_From( response.data );
|
|
1138
|
+
resolve(res);
|
|
1139
|
+
}
|
|
1140
|
+
catch( err ) {
|
|
1141
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1142
|
+
reject(err);
|
|
1143
|
+
}
|
|
1144
|
+
});
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
|
|
1148
|
+
|
|
1149
|
+
/**
|
|
1150
|
+
* Creates a new carrier from the step type given, with the right kind of properties, defaults set.
|
|
1151
|
+
* @param request - StepType
|
|
1152
|
+
* @returns
|
|
1153
|
+
*/
|
|
1154
|
+
public async createDefaultWorkflowStepFromTypeAsync(request: carriers.Workflow_CreateDefaultWorkflowStepFromTypeRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase >;
|
|
1155
|
+
|
|
1156
|
+
/**
|
|
1157
|
+
* Creates a new carrier from the step type given, with the right kind of properties, defaults set.
|
|
1158
|
+
* @param stepType - Step type to create
|
|
1159
|
+
* @returns
|
|
1160
|
+
*/
|
|
1161
|
+
public async createDefaultWorkflowStepFromTypeAsync(stepType: enums.WorkflowStepType, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase >;
|
|
1162
|
+
|
|
1163
|
+
public async createDefaultWorkflowStepFromTypeAsync(stepType:enums.WorkflowStepType|carriers.Workflow_CreateDefaultWorkflowStepFromTypeRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepBase > {
|
|
1164
|
+
let _request : carriers.Workflow_CreateDefaultWorkflowStepFromTypeRequest = null;
|
|
1165
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1166
|
+
const first : any = stepType;
|
|
1167
|
+
if( typeof( first ) === "object" && first && ( typeof(first.stepType)!='undefined' ) )
|
|
1168
|
+
{
|
|
1169
|
+
_request = stepType as carriers.Workflow_CreateDefaultWorkflowStepFromTypeRequest;
|
|
1170
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
1171
|
+
}
|
|
1172
|
+
else
|
|
1173
|
+
{
|
|
1174
|
+
_request = {
|
|
1175
|
+
stepType: stepType as enums.WorkflowStepType,
|
|
1176
|
+
};
|
|
1177
|
+
_options = webapi_options;
|
|
1178
|
+
}
|
|
1179
|
+
return this._createDefaultWorkflowStepFromTypeAsync( _request, _options );
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
|
|
1183
|
+
private async _createDefaultWorkflowStepOptionFromTypeAsync(request: carriers.Workflow_CreateDefaultWorkflowStepOptionFromTypeRequest, options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepOptionBase > {
|
|
1184
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1185
|
+
base.WebApiBase.SetPending(options);
|
|
1186
|
+
return new Promise< carriers.WorkflowStepOptionBase >(async (resolve, reject) => {
|
|
1187
|
+
try {
|
|
1188
|
+
config.baseURL = this._options.baseUrl;
|
|
1189
|
+
const response = await this._axios.post("CreateDefaultWorkflowStepOptionFromType", request , config);
|
|
1190
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1191
|
+
const res : carriers.WorkflowStepOptionBase = converters.Create_WorkflowStepOptionBase_From( response.data );
|
|
1192
|
+
resolve(res);
|
|
1193
|
+
}
|
|
1194
|
+
catch( err ) {
|
|
1195
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1196
|
+
reject(err);
|
|
1197
|
+
}
|
|
1198
|
+
});
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
|
|
1202
|
+
|
|
1203
|
+
/**
|
|
1204
|
+
* Creates a new carrier from the option type given, with the right kind of properties, defaults set.
|
|
1205
|
+
* @param request - OptionType
|
|
1206
|
+
* @returns
|
|
1207
|
+
*/
|
|
1208
|
+
public async createDefaultWorkflowStepOptionFromTypeAsync(request: carriers.Workflow_CreateDefaultWorkflowStepOptionFromTypeRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepOptionBase >;
|
|
1209
|
+
|
|
1210
|
+
/**
|
|
1211
|
+
* Creates a new carrier from the option type given, with the right kind of properties, defaults set.
|
|
1212
|
+
* @param optionType - Option type to create
|
|
1213
|
+
* @returns
|
|
1214
|
+
*/
|
|
1215
|
+
public async createDefaultWorkflowStepOptionFromTypeAsync(optionType: enums.WorkflowSplitOptionType, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepOptionBase >;
|
|
1216
|
+
|
|
1217
|
+
public async createDefaultWorkflowStepOptionFromTypeAsync(optionType:enums.WorkflowSplitOptionType|carriers.Workflow_CreateDefaultWorkflowStepOptionFromTypeRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepOptionBase > {
|
|
1218
|
+
let _request : carriers.Workflow_CreateDefaultWorkflowStepOptionFromTypeRequest = null;
|
|
1219
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1220
|
+
const first : any = optionType;
|
|
1221
|
+
if( typeof( first ) === "object" && first && ( typeof(first.optionType)!='undefined' ) )
|
|
1222
|
+
{
|
|
1223
|
+
_request = optionType as carriers.Workflow_CreateDefaultWorkflowStepOptionFromTypeRequest;
|
|
1224
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
1225
|
+
}
|
|
1226
|
+
else
|
|
1227
|
+
{
|
|
1228
|
+
_request = {
|
|
1229
|
+
optionType: optionType as enums.WorkflowSplitOptionType,
|
|
1230
|
+
};
|
|
1231
|
+
_options = webapi_options;
|
|
1232
|
+
}
|
|
1233
|
+
return this._createDefaultWorkflowStepOptionFromTypeAsync( _request, _options );
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
|
|
1237
|
+
private async _getWorkflowStepOptionAsync(request: carriers.Workflow_GetWorkflowStepOptionRequest, options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepOptionBase > {
|
|
1238
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1239
|
+
base.WebApiBase.SetPending(options);
|
|
1240
|
+
return new Promise< carriers.WorkflowStepOptionBase >(async (resolve, reject) => {
|
|
1241
|
+
try {
|
|
1242
|
+
config.baseURL = this._options.baseUrl;
|
|
1243
|
+
const response = await this._axios.post("GetWorkflowStepOption", request , config);
|
|
1244
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1245
|
+
const res : carriers.WorkflowStepOptionBase = converters.Create_WorkflowStepOptionBase_From( response.data );
|
|
1246
|
+
resolve(res);
|
|
1247
|
+
}
|
|
1248
|
+
catch( err ) {
|
|
1249
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1250
|
+
reject(err);
|
|
1251
|
+
}
|
|
1252
|
+
});
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
|
|
1256
|
+
|
|
1257
|
+
/**
|
|
1258
|
+
* Get WorkflowStepOption by ID
|
|
1259
|
+
* @param request - WorkflowStepOptionId
|
|
1260
|
+
* @returns The Workflow step option
|
|
1261
|
+
*/
|
|
1262
|
+
public async getWorkflowStepOptionAsync(request: carriers.Workflow_GetWorkflowStepOptionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepOptionBase >;
|
|
1263
|
+
|
|
1264
|
+
/**
|
|
1265
|
+
* Get WorkflowStepOption by ID
|
|
1266
|
+
* @param workflowStepOptionId - Primary key of WorkflowStep option
|
|
1267
|
+
* @returns The Workflow step option
|
|
1268
|
+
*/
|
|
1269
|
+
public async getWorkflowStepOptionAsync(workflowStepOptionId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepOptionBase >;
|
|
1270
|
+
|
|
1271
|
+
public async getWorkflowStepOptionAsync(workflowStepOptionId:number|carriers.Workflow_GetWorkflowStepOptionRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowStepOptionBase > {
|
|
1272
|
+
let _request : carriers.Workflow_GetWorkflowStepOptionRequest = null;
|
|
1273
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1274
|
+
const first : any = workflowStepOptionId;
|
|
1275
|
+
if( typeof( first ) === "object" && first && ( typeof(first.workflowStepOptionId)!='undefined' ) )
|
|
1276
|
+
{
|
|
1277
|
+
_request = workflowStepOptionId as carriers.Workflow_GetWorkflowStepOptionRequest;
|
|
1278
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
1279
|
+
}
|
|
1280
|
+
else
|
|
1281
|
+
{
|
|
1282
|
+
_request = {
|
|
1283
|
+
workflowStepOptionId: workflowStepOptionId as number,
|
|
1284
|
+
};
|
|
1285
|
+
_options = webapi_options;
|
|
1286
|
+
}
|
|
1287
|
+
return this._getWorkflowStepOptionAsync( _request, _options );
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
/**
|
|
1291
|
+
* Gets a WorkflowTrigger object.
|
|
1292
|
+
* @param workflowTriggerId - The primary key.
|
|
1293
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
1294
|
+
* @returns A single WorkflowTrigger
|
|
1295
|
+
*/
|
|
1296
|
+
public async getWorkflowTriggerAsync(workflowTriggerId: number, options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowTrigger > {
|
|
1297
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1298
|
+
base.WebApiBase.SetPending(options);
|
|
1299
|
+
return new Promise< carriers.WorkflowTrigger >(async (resolve, reject) => {
|
|
1300
|
+
try {
|
|
1301
|
+
const response = await this._axios.post("GetWorkflowTrigger?workflowTriggerId=" + workflowTriggerId, null, config);
|
|
1302
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1303
|
+
const res = converters.Create_WorkflowTrigger_From( response.data );
|
|
1304
|
+
resolve(res);
|
|
1305
|
+
}
|
|
1306
|
+
catch( err ) {
|
|
1307
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1308
|
+
reject(err);
|
|
1309
|
+
}
|
|
1310
|
+
});
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
/**
|
|
1314
|
+
* Gets a WorkflowWaitForAction object.
|
|
1315
|
+
* @param workflowWaitForActionId - The primary key.
|
|
1316
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
1317
|
+
* @returns A single WorkflowWaitForAction
|
|
1318
|
+
*/
|
|
1319
|
+
public async getWorkflowWaitForActionAsync(workflowWaitForActionId: number, options?:base.WebApiRequestOptions) : Promise< carriers.WorkflowWaitForAction > {
|
|
1320
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1321
|
+
base.WebApiBase.SetPending(options);
|
|
1322
|
+
return new Promise< carriers.WorkflowWaitForAction >(async (resolve, reject) => {
|
|
1323
|
+
try {
|
|
1324
|
+
const response = await this._axios.post("GetWorkflowWaitForAction?workflowWaitForActionId=" + workflowWaitForActionId, null, config);
|
|
1325
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1326
|
+
const res = converters.Create_WorkflowWaitForAction_From( response.data );
|
|
1327
|
+
resolve(res);
|
|
1328
|
+
}
|
|
1329
|
+
catch( err ) {
|
|
1330
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1331
|
+
reject(err);
|
|
1332
|
+
}
|
|
1333
|
+
});
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
} // class v1WorkflowAgentController
|
|
1337
|
+
|
|
1338
|
+
|