@superoffice/webapi 11.7.727 → 11.9.1204
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/AIAgent.d.ts +62 -0
- package/dist/cjs/AIAgent.d.ts.map +1 -1
- package/dist/cjs/AIAgent.js +149 -0
- package/dist/cjs/AIAgent.js.map +1 -1
- package/dist/cjs/Carriers.d.ts +640 -14
- package/dist/cjs/Carriers.d.ts.map +1 -1
- package/dist/cjs/Converters.d.ts +24 -0
- package/dist/cjs/Converters.d.ts.map +1 -1
- package/dist/cjs/Converters.js +388 -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 +77 -1
- package/dist/cjs/Enums.d.ts.map +1 -1
- package/dist/cjs/Enums.js +83 -4
- 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/MarketingAgent.d.ts +68 -0
- package/dist/cjs/MarketingAgent.d.ts.map +1 -1
- package/dist/cjs/MarketingAgent.js +157 -0
- package/dist/cjs/MarketingAgent.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/AIAgent.d.ts +62 -0
- package/dist/esm/AIAgent.d.ts.map +1 -1
- package/dist/esm/AIAgent.js +150 -1
- package/dist/esm/AIAgent.js.map +1 -1
- package/dist/esm/Carriers.d.ts +640 -14
- package/dist/esm/Carriers.d.ts.map +1 -1
- package/dist/esm/Converters.d.ts +24 -0
- package/dist/esm/Converters.d.ts.map +1 -1
- package/dist/esm/Converters.js +346 -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 +77 -1
- package/dist/esm/Enums.d.ts.map +1 -1
- package/dist/esm/Enums.js +79 -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/MarketingAgent.d.ts +68 -0
- package/dist/esm/MarketingAgent.d.ts.map +1 -1
- package/dist/esm/MarketingAgent.js +157 -0
- package/dist/esm/MarketingAgent.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 +2239 -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 +53121 -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 +23496 -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 +6998 -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 +1146 -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
|
@@ -1,296 +1,296 @@
|
|
|
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/NumberAllocationAgent.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
|
-
* This agent can be used to manage number allocation
|
|
28
|
-
*/
|
|
29
|
-
export interface INumberAllocationAgent {
|
|
30
|
-
createDefaultRefCountEntityAsync(): Promise< carriers.RefCountEntity >;
|
|
31
|
-
saveRefCountEntityAsync(entity: carriers.RefCountEntity) : Promise< carriers.RefCountEntity >;
|
|
32
|
-
deleteRefCountEntityAsync(RefCountEntityId: number) : Promise<void>;
|
|
33
|
-
getRefCountEntityAsync(refCountEntityId: number) : Promise< carriers.RefCountEntity >;
|
|
34
|
-
saveDefaultNumberingAsync(request: carriers.NumberAllocation_SaveDefaultNumberingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
35
|
-
saveDefaultNumberingAsync(refCountEntity: carriers.RefCountEntity, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
36
|
-
getNumberEachTemplateAsync(webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
|
|
37
|
-
setNumberEachTemplateAsync(request: carriers.NumberAllocation_SetNumberEachTemplateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
38
|
-
setNumberEachTemplateAsync(setValue: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
39
|
-
} // interface INumberAllocationAgent
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* This agent can be used to manage number allocation
|
|
46
|
-
*/
|
|
47
|
-
export class NumberAllocationAgent extends base.WebApiBase implements INumberAllocationAgent {
|
|
48
|
-
constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
|
|
49
|
-
constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
|
|
50
|
-
constructor(baseUrl: string, resourceManager:any);
|
|
51
|
-
constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
|
|
52
|
-
constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
|
|
53
|
-
constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
|
|
54
|
-
constructor(options: base.WebApiOptions);
|
|
55
|
-
|
|
56
|
-
constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
|
|
57
|
-
langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
|
|
58
|
-
langOrResourceOrRM?:string|base.ResourceParsing|any,
|
|
59
|
-
cultureCode?: string,
|
|
60
|
-
) {
|
|
61
|
-
const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
|
|
62
|
-
options.basePath = "v1/Agents/NumberAllocation/";
|
|
63
|
-
super(options);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Set default values into a new RefCountEntity.
|
|
70
|
-
* NetServer calculates default values on the entity, which is required when creating/storing a new instance
|
|
71
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
72
|
-
* @returns A blank entity.
|
|
73
|
-
*/
|
|
74
|
-
public async createDefaultRefCountEntityAsync(options?:base.WebApiRequestOptions) : Promise< carriers.RefCountEntity > {
|
|
75
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
76
|
-
base.WebApiBase.SetPending(options);
|
|
77
|
-
return new Promise< carriers.RefCountEntity >(async (resolve, reject) => {
|
|
78
|
-
try {
|
|
79
|
-
const response = await this._axios.post("CreateDefaultRefCountEntity", null, config);
|
|
80
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
81
|
-
const res : carriers.RefCountEntity = converters.Create_RefCountEntity_From( response.data );
|
|
82
|
-
resolve(res);
|
|
83
|
-
}
|
|
84
|
-
catch( err ) {
|
|
85
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
86
|
-
reject(err);
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Replace the existing RefCountEntity or creates a new RefCountEntity if the id parameter is empty
|
|
92
|
-
* @param entity - The RefCountEntity to be saved.
|
|
93
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
94
|
-
* @returns New or updated RefCountEntity
|
|
95
|
-
*/
|
|
96
|
-
public async saveRefCountEntityAsync(entity: carriers.RefCountEntity, options?:base.WebApiRequestOptions) : Promise< carriers.RefCountEntity > {
|
|
97
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
98
|
-
base.WebApiBase.SetPending(options);
|
|
99
|
-
return new Promise< carriers.RefCountEntity >(async (resolve, reject) => {
|
|
100
|
-
try {
|
|
101
|
-
const response = await this._axios.post("SaveRefCountEntity", entity, config);
|
|
102
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
103
|
-
const res : carriers.RefCountEntity = converters.Create_RefCountEntity_From( response.data );
|
|
104
|
-
resolve(res);
|
|
105
|
-
}
|
|
106
|
-
catch( err ) {
|
|
107
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
108
|
-
reject(err);
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Deletes the RefCountEntity
|
|
115
|
-
* @param RefCountEntityId - The id of the RefCountEntity to be deleted.
|
|
116
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
117
|
-
*/
|
|
118
|
-
public async deleteRefCountEntityAsync(RefCountEntityId: number, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
119
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
120
|
-
base.WebApiBase.SetPending(options);
|
|
121
|
-
return new Promise< void >(async (resolve, reject) => {
|
|
122
|
-
try {
|
|
123
|
-
const response = await this._axios.post("DeleteRefCountEntity?RefCountEntityId=" + RefCountEntityId, null, config );
|
|
124
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
125
|
-
const res = response.data;
|
|
126
|
-
resolve(res);
|
|
127
|
-
}
|
|
128
|
-
catch( err ) {
|
|
129
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
130
|
-
reject(err);
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Gets a RefCountEntity object.
|
|
136
|
-
* @param refCountEntityId - The primary key.
|
|
137
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
138
|
-
* @returns A single RefCountEntity
|
|
139
|
-
*/
|
|
140
|
-
public async getRefCountEntityAsync(refCountEntityId: number, options?:base.WebApiRequestOptions) : Promise< carriers.RefCountEntity > {
|
|
141
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
142
|
-
base.WebApiBase.SetPending(options);
|
|
143
|
-
return new Promise< carriers.RefCountEntity >(async (resolve, reject) => {
|
|
144
|
-
try {
|
|
145
|
-
const response = await this._axios.post("GetRefCountEntity?refCountEntityId=" + refCountEntityId, null, config);
|
|
146
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
147
|
-
const res = converters.Create_RefCountEntity_From( response.data );
|
|
148
|
-
resolve(res);
|
|
149
|
-
}
|
|
150
|
-
catch( err ) {
|
|
151
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
152
|
-
reject(err);
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
private async _saveDefaultNumberingAsync(request: carriers.NumberAllocation_SaveDefaultNumberingRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
159
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
160
|
-
base.WebApiBase.SetPending(options);
|
|
161
|
-
return new Promise< void >(async (resolve, reject) => {
|
|
162
|
-
try {
|
|
163
|
-
config.baseURL = this._options.baseUrl;
|
|
164
|
-
const response = await this._axios.post("SaveDefaultNumbering", request , config);
|
|
165
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
166
|
-
const res = response.data;
|
|
167
|
-
resolve(res);
|
|
168
|
-
}
|
|
169
|
-
catch( err ) {
|
|
170
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
171
|
-
reject(err);
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* Saves default numbering values in preferences
|
|
180
|
-
* @param request - RefCountEntity
|
|
181
|
-
* @returns void
|
|
182
|
-
*/
|
|
183
|
-
public async saveDefaultNumberingAsync(request: carriers.NumberAllocation_SaveDefaultNumberingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* Saves default numbering values in preferences
|
|
187
|
-
* @param refCountEntity - The refCountEntity that holds the values that will be saved
|
|
188
|
-
* @returns void
|
|
189
|
-
*/
|
|
190
|
-
public async saveDefaultNumberingAsync(refCountEntity: carriers.RefCountEntity, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
191
|
-
|
|
192
|
-
public async saveDefaultNumberingAsync(refCountEntity:carriers.RefCountEntity|carriers.NumberAllocation_SaveDefaultNumberingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
193
|
-
let _request : carriers.NumberAllocation_SaveDefaultNumberingRequest = null;
|
|
194
|
-
let _options : base.WebApiRequestOptions = null;
|
|
195
|
-
const first : any = refCountEntity;
|
|
196
|
-
if( typeof( first ) === "object" && first && ( typeof(first.refCountEntity)!='undefined' ) )
|
|
197
|
-
{
|
|
198
|
-
_request = refCountEntity as carriers.NumberAllocation_SaveDefaultNumberingRequest;
|
|
199
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
200
|
-
}
|
|
201
|
-
else
|
|
202
|
-
{
|
|
203
|
-
_request = {
|
|
204
|
-
refCountEntity: refCountEntity as carriers.RefCountEntity,
|
|
205
|
-
};
|
|
206
|
-
_options = webapi_options;
|
|
207
|
-
}
|
|
208
|
-
return this._saveDefaultNumberingAsync( _request, _options );
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
private async _getNumberEachTemplateAsync( options?:base.WebApiRequestOptions) : Promise< boolean > {
|
|
213
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
214
|
-
base.WebApiBase.SetPending(options);
|
|
215
|
-
return new Promise< boolean >(async (resolve, reject) => {
|
|
216
|
-
try {
|
|
217
|
-
config.baseURL = this._options.baseUrl;
|
|
218
|
-
const response = await this._axios.post("GetNumberEachTemplate", undefined , config);
|
|
219
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
220
|
-
const res : boolean = response.data as boolean;
|
|
221
|
-
resolve(res);
|
|
222
|
-
}
|
|
223
|
-
catch( err ) {
|
|
224
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
225
|
-
reject(err);
|
|
226
|
-
}
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* Returns true or false if Automatically create new counters for new document templates
|
|
233
|
-
* @returns Is NumberEachTemplate?
|
|
234
|
-
*/
|
|
235
|
-
public async getNumberEachTemplateAsync(webapi_options?:base.WebApiRequestOptions) : Promise< boolean >
|
|
236
|
-
{
|
|
237
|
-
return this._getNumberEachTemplateAsync(webapi_options);
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
private async _setNumberEachTemplateAsync(request: carriers.NumberAllocation_SetNumberEachTemplateRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
242
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
243
|
-
base.WebApiBase.SetPending(options);
|
|
244
|
-
return new Promise< void >(async (resolve, reject) => {
|
|
245
|
-
try {
|
|
246
|
-
config.baseURL = this._options.baseUrl;
|
|
247
|
-
const response = await this._axios.post("SetNumberEachTemplate", request , config);
|
|
248
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
249
|
-
const res = response.data;
|
|
250
|
-
resolve(res);
|
|
251
|
-
}
|
|
252
|
-
catch( err ) {
|
|
253
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
254
|
-
reject(err);
|
|
255
|
-
}
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* Saves true or false if Automatically create new counters for new document templates
|
|
263
|
-
* @param request - SetValue
|
|
264
|
-
* @returns void
|
|
265
|
-
*/
|
|
266
|
-
public async setNumberEachTemplateAsync(request: carriers.NumberAllocation_SetNumberEachTemplateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* Saves true or false if Automatically create new counters for new document templates
|
|
270
|
-
* @param setValue - true or false if Automatically create new counters for new document templates
|
|
271
|
-
* @returns void
|
|
272
|
-
*/
|
|
273
|
-
public async setNumberEachTemplateAsync(setValue: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
274
|
-
|
|
275
|
-
public async setNumberEachTemplateAsync(setValue:boolean|carriers.NumberAllocation_SetNumberEachTemplateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
276
|
-
let _request : carriers.NumberAllocation_SetNumberEachTemplateRequest = null;
|
|
277
|
-
let _options : base.WebApiRequestOptions = null;
|
|
278
|
-
const first : any = setValue;
|
|
279
|
-
if( typeof( first ) === "object" && first && ( typeof(first.setValue)!='undefined' ) )
|
|
280
|
-
{
|
|
281
|
-
_request = setValue as carriers.NumberAllocation_SetNumberEachTemplateRequest;
|
|
282
|
-
_options = webapi_options as base.WebApiRequestOptions;
|
|
283
|
-
}
|
|
284
|
-
else
|
|
285
|
-
{
|
|
286
|
-
_request = {
|
|
287
|
-
setValue: setValue as boolean,
|
|
288
|
-
};
|
|
289
|
-
_options = webapi_options;
|
|
290
|
-
}
|
|
291
|
-
return this._setNumberEachTemplateAsync( _request, _options );
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
} // class v1NumberAllocationAgentController
|
|
295
|
-
|
|
296
|
-
|
|
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/NumberAllocationAgent.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
|
+
* This agent can be used to manage number allocation
|
|
28
|
+
*/
|
|
29
|
+
export interface INumberAllocationAgent {
|
|
30
|
+
createDefaultRefCountEntityAsync(): Promise< carriers.RefCountEntity >;
|
|
31
|
+
saveRefCountEntityAsync(entity: carriers.RefCountEntity) : Promise< carriers.RefCountEntity >;
|
|
32
|
+
deleteRefCountEntityAsync(RefCountEntityId: number) : Promise<void>;
|
|
33
|
+
getRefCountEntityAsync(refCountEntityId: number) : Promise< carriers.RefCountEntity >;
|
|
34
|
+
saveDefaultNumberingAsync(request: carriers.NumberAllocation_SaveDefaultNumberingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
35
|
+
saveDefaultNumberingAsync(refCountEntity: carriers.RefCountEntity, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
36
|
+
getNumberEachTemplateAsync(webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
|
|
37
|
+
setNumberEachTemplateAsync(request: carriers.NumberAllocation_SetNumberEachTemplateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
38
|
+
setNumberEachTemplateAsync(setValue: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
39
|
+
} // interface INumberAllocationAgent
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* This agent can be used to manage number allocation
|
|
46
|
+
*/
|
|
47
|
+
export class NumberAllocationAgent extends base.WebApiBase implements INumberAllocationAgent {
|
|
48
|
+
constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
|
|
49
|
+
constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
|
|
50
|
+
constructor(baseUrl: string, resourceManager:any);
|
|
51
|
+
constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
|
|
52
|
+
constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
|
|
53
|
+
constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
|
|
54
|
+
constructor(options: base.WebApiOptions);
|
|
55
|
+
|
|
56
|
+
constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
|
|
57
|
+
langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
|
|
58
|
+
langOrResourceOrRM?:string|base.ResourceParsing|any,
|
|
59
|
+
cultureCode?: string,
|
|
60
|
+
) {
|
|
61
|
+
const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
|
|
62
|
+
options.basePath = "v1/Agents/NumberAllocation/";
|
|
63
|
+
super(options);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Set default values into a new RefCountEntity.
|
|
70
|
+
* NetServer calculates default values on the entity, which is required when creating/storing a new instance
|
|
71
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
72
|
+
* @returns A blank entity.
|
|
73
|
+
*/
|
|
74
|
+
public async createDefaultRefCountEntityAsync(options?:base.WebApiRequestOptions) : Promise< carriers.RefCountEntity > {
|
|
75
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
76
|
+
base.WebApiBase.SetPending(options);
|
|
77
|
+
return new Promise< carriers.RefCountEntity >(async (resolve, reject) => {
|
|
78
|
+
try {
|
|
79
|
+
const response = await this._axios.post("CreateDefaultRefCountEntity", null, config);
|
|
80
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
81
|
+
const res : carriers.RefCountEntity = converters.Create_RefCountEntity_From( response.data );
|
|
82
|
+
resolve(res);
|
|
83
|
+
}
|
|
84
|
+
catch( err ) {
|
|
85
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
86
|
+
reject(err);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Replace the existing RefCountEntity or creates a new RefCountEntity if the id parameter is empty
|
|
92
|
+
* @param entity - The RefCountEntity to be saved.
|
|
93
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
94
|
+
* @returns New or updated RefCountEntity
|
|
95
|
+
*/
|
|
96
|
+
public async saveRefCountEntityAsync(entity: carriers.RefCountEntity, options?:base.WebApiRequestOptions) : Promise< carriers.RefCountEntity > {
|
|
97
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
98
|
+
base.WebApiBase.SetPending(options);
|
|
99
|
+
return new Promise< carriers.RefCountEntity >(async (resolve, reject) => {
|
|
100
|
+
try {
|
|
101
|
+
const response = await this._axios.post("SaveRefCountEntity", entity, config);
|
|
102
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
103
|
+
const res : carriers.RefCountEntity = converters.Create_RefCountEntity_From( response.data );
|
|
104
|
+
resolve(res);
|
|
105
|
+
}
|
|
106
|
+
catch( err ) {
|
|
107
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
108
|
+
reject(err);
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Deletes the RefCountEntity
|
|
115
|
+
* @param RefCountEntityId - The id of the RefCountEntity to be deleted.
|
|
116
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
117
|
+
*/
|
|
118
|
+
public async deleteRefCountEntityAsync(RefCountEntityId: number, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
119
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
120
|
+
base.WebApiBase.SetPending(options);
|
|
121
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
122
|
+
try {
|
|
123
|
+
const response = await this._axios.post("DeleteRefCountEntity?RefCountEntityId=" + RefCountEntityId, null, config );
|
|
124
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
125
|
+
const res = response.data;
|
|
126
|
+
resolve(res);
|
|
127
|
+
}
|
|
128
|
+
catch( err ) {
|
|
129
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
130
|
+
reject(err);
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Gets a RefCountEntity object.
|
|
136
|
+
* @param refCountEntityId - The primary key.
|
|
137
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
138
|
+
* @returns A single RefCountEntity
|
|
139
|
+
*/
|
|
140
|
+
public async getRefCountEntityAsync(refCountEntityId: number, options?:base.WebApiRequestOptions) : Promise< carriers.RefCountEntity > {
|
|
141
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
142
|
+
base.WebApiBase.SetPending(options);
|
|
143
|
+
return new Promise< carriers.RefCountEntity >(async (resolve, reject) => {
|
|
144
|
+
try {
|
|
145
|
+
const response = await this._axios.post("GetRefCountEntity?refCountEntityId=" + refCountEntityId, null, config);
|
|
146
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
147
|
+
const res = converters.Create_RefCountEntity_From( response.data );
|
|
148
|
+
resolve(res);
|
|
149
|
+
}
|
|
150
|
+
catch( err ) {
|
|
151
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
152
|
+
reject(err);
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
private async _saveDefaultNumberingAsync(request: carriers.NumberAllocation_SaveDefaultNumberingRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
159
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
160
|
+
base.WebApiBase.SetPending(options);
|
|
161
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
162
|
+
try {
|
|
163
|
+
config.baseURL = this._options.baseUrl;
|
|
164
|
+
const response = await this._axios.post("SaveDefaultNumbering", request , config);
|
|
165
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
166
|
+
const res = response.data;
|
|
167
|
+
resolve(res);
|
|
168
|
+
}
|
|
169
|
+
catch( err ) {
|
|
170
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
171
|
+
reject(err);
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Saves default numbering values in preferences
|
|
180
|
+
* @param request - RefCountEntity
|
|
181
|
+
* @returns void
|
|
182
|
+
*/
|
|
183
|
+
public async saveDefaultNumberingAsync(request: carriers.NumberAllocation_SaveDefaultNumberingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Saves default numbering values in preferences
|
|
187
|
+
* @param refCountEntity - The refCountEntity that holds the values that will be saved
|
|
188
|
+
* @returns void
|
|
189
|
+
*/
|
|
190
|
+
public async saveDefaultNumberingAsync(refCountEntity: carriers.RefCountEntity, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
191
|
+
|
|
192
|
+
public async saveDefaultNumberingAsync(refCountEntity:carriers.RefCountEntity|carriers.NumberAllocation_SaveDefaultNumberingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
193
|
+
let _request : carriers.NumberAllocation_SaveDefaultNumberingRequest = null;
|
|
194
|
+
let _options : base.WebApiRequestOptions = null;
|
|
195
|
+
const first : any = refCountEntity;
|
|
196
|
+
if( typeof( first ) === "object" && first && ( typeof(first.refCountEntity)!='undefined' ) )
|
|
197
|
+
{
|
|
198
|
+
_request = refCountEntity as carriers.NumberAllocation_SaveDefaultNumberingRequest;
|
|
199
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
200
|
+
}
|
|
201
|
+
else
|
|
202
|
+
{
|
|
203
|
+
_request = {
|
|
204
|
+
refCountEntity: refCountEntity as carriers.RefCountEntity,
|
|
205
|
+
};
|
|
206
|
+
_options = webapi_options;
|
|
207
|
+
}
|
|
208
|
+
return this._saveDefaultNumberingAsync( _request, _options );
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
private async _getNumberEachTemplateAsync( options?:base.WebApiRequestOptions) : Promise< boolean > {
|
|
213
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
214
|
+
base.WebApiBase.SetPending(options);
|
|
215
|
+
return new Promise< boolean >(async (resolve, reject) => {
|
|
216
|
+
try {
|
|
217
|
+
config.baseURL = this._options.baseUrl;
|
|
218
|
+
const response = await this._axios.post("GetNumberEachTemplate", undefined , config);
|
|
219
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
220
|
+
const res : boolean = response.data as boolean;
|
|
221
|
+
resolve(res);
|
|
222
|
+
}
|
|
223
|
+
catch( err ) {
|
|
224
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
225
|
+
reject(err);
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Returns true or false if Automatically create new counters for new document templates
|
|
233
|
+
* @returns Is NumberEachTemplate?
|
|
234
|
+
*/
|
|
235
|
+
public async getNumberEachTemplateAsync(webapi_options?:base.WebApiRequestOptions) : Promise< boolean >
|
|
236
|
+
{
|
|
237
|
+
return this._getNumberEachTemplateAsync(webapi_options);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
private async _setNumberEachTemplateAsync(request: carriers.NumberAllocation_SetNumberEachTemplateRequest, options?:base.WebApiRequestOptions) : Promise< void > {
|
|
242
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
243
|
+
base.WebApiBase.SetPending(options);
|
|
244
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
245
|
+
try {
|
|
246
|
+
config.baseURL = this._options.baseUrl;
|
|
247
|
+
const response = await this._axios.post("SetNumberEachTemplate", request , config);
|
|
248
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
249
|
+
const res = response.data;
|
|
250
|
+
resolve(res);
|
|
251
|
+
}
|
|
252
|
+
catch( err ) {
|
|
253
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
254
|
+
reject(err);
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Saves true or false if Automatically create new counters for new document templates
|
|
263
|
+
* @param request - SetValue
|
|
264
|
+
* @returns void
|
|
265
|
+
*/
|
|
266
|
+
public async setNumberEachTemplateAsync(request: carriers.NumberAllocation_SetNumberEachTemplateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Saves true or false if Automatically create new counters for new document templates
|
|
270
|
+
* @param setValue - true or false if Automatically create new counters for new document templates
|
|
271
|
+
* @returns void
|
|
272
|
+
*/
|
|
273
|
+
public async setNumberEachTemplateAsync(setValue: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
274
|
+
|
|
275
|
+
public async setNumberEachTemplateAsync(setValue:boolean|carriers.NumberAllocation_SetNumberEachTemplateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
|
|
276
|
+
let _request : carriers.NumberAllocation_SetNumberEachTemplateRequest = null;
|
|
277
|
+
let _options : base.WebApiRequestOptions = null;
|
|
278
|
+
const first : any = setValue;
|
|
279
|
+
if( typeof( first ) === "object" && first && ( typeof(first.setValue)!='undefined' ) )
|
|
280
|
+
{
|
|
281
|
+
_request = setValue as carriers.NumberAllocation_SetNumberEachTemplateRequest;
|
|
282
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
283
|
+
}
|
|
284
|
+
else
|
|
285
|
+
{
|
|
286
|
+
_request = {
|
|
287
|
+
setValue: setValue as boolean,
|
|
288
|
+
};
|
|
289
|
+
_options = webapi_options;
|
|
290
|
+
}
|
|
291
|
+
return this._setNumberEachTemplateAsync( _request, _options );
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
} // class v1NumberAllocationAgentController
|
|
295
|
+
|
|
296
|
+
|