@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/ProjectRestApi.ts
CHANGED
|
@@ -1,239 +1,239 @@
|
|
|
1
|
-
// <auto-generated>
|
|
2
|
-
// SuperOffice Code Generator
|
|
3
|
-
// modelling\templates\servicestswebapi\tswebapirestentities.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: ProjectRestApi.ts
|
|
13
|
-
//
|
|
14
|
-
//----------------------------------------------------------------------------
|
|
15
|
-
// Copyright (C) SuperOffice AS
|
|
16
|
-
//----------------------------------------------------------------------------
|
|
17
|
-
|
|
18
|
-
import { AxiosRequestConfig, AxiosError } 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
|
-
* The Project Service. The service implements all services working with the Project object
|
|
28
|
-
* Collection of all services that works with Project data.
|
|
29
|
-
*
|
|
30
|
-
* `api/v1/Project`
|
|
31
|
-
*/
|
|
32
|
-
export interface IProjectRestApi {
|
|
33
|
-
|
|
34
|
-
getDefaultAsync(options?:base.WebApiGetRequestOptions): Promise< carriers.ProjectEntity >;
|
|
35
|
-
postAsync(entity: carriers.ProjectEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.ProjectEntity >;
|
|
36
|
-
putByIdAsync(id:number, entity: carriers.ProjectEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.ProjectEntity >;
|
|
37
|
-
patchByIdAsync(id:number, entity: base.WebApiPatchOperation[] | carriers.ProjectEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.ProjectEntity >;
|
|
38
|
-
deleteByIdAsync(ProjectEntityId: number, options?:base.WebApiPutRequestOptions) : Promise<void>;
|
|
39
|
-
getByIdAsync(ProjectEntityId: number, options?:base.WebApiGetRequestOptions) : Promise< carriers.ProjectEntity >;
|
|
40
|
-
// GET Duplicates/{name} Async( name ) = getDuplicates
|
|
41
|
-
|
|
42
|
-
// PUT DuplicateRules Async( rules ) = setDuplicateRulesStatus
|
|
43
|
-
|
|
44
|
-
// GET DuplicateRules Async( ) = getDuplicateRules
|
|
45
|
-
|
|
46
|
-
// POST {sourceProjectId}/MergeTo/{destinationProjectId} Async( sourceProjectId destinationProjectId replaceEmptyFieldsOnDestination ) = merge
|
|
47
|
-
|
|
48
|
-
// GET {contactId:int}/IsNumberValid/{number} Async( contactId number ) = isNumberValid
|
|
49
|
-
|
|
50
|
-
// GET {projectId}/HasGuide Async( projectId ) = hasGuide
|
|
51
|
-
|
|
52
|
-
// GET {projectId}/NextMilestone Async( projectId ) = getNextMilestone
|
|
53
|
-
|
|
54
|
-
// POST Validate Async( projectEntity ) = validateProjectEntity
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
} // interface IProjectRestApi
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* The Project Service. The service implements all services working with the Project object
|
|
64
|
-
* Collection of all services that works with Project data.
|
|
65
|
-
*
|
|
66
|
-
* `api/v1/Project`
|
|
67
|
-
*/
|
|
68
|
-
export class ProjectRestApi extends base.WebApiBase implements IProjectRestApi {
|
|
69
|
-
constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
|
|
70
|
-
constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
|
|
71
|
-
constructor(baseUrl: string, resourceManager:any);
|
|
72
|
-
constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
|
|
73
|
-
constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
|
|
74
|
-
constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
|
|
75
|
-
constructor(options: base.WebApiOptions);
|
|
76
|
-
|
|
77
|
-
constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
|
|
78
|
-
langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
|
|
79
|
-
langOrResourceOrRM?:string|base.ResourceParsing|any,
|
|
80
|
-
cultureCode?: string,
|
|
81
|
-
) {
|
|
82
|
-
const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
|
|
83
|
-
options.basePath = "v1/Project/";
|
|
84
|
-
super(options);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* `GET /api/v1/Project/default`
|
|
90
|
-
* Set default values into a new ProjectEntity.
|
|
91
|
-
* NetServer calculates default values on the entity, which is required when creating/storing a new instance
|
|
92
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
93
|
-
* @returns A blank entity.
|
|
94
|
-
*/
|
|
95
|
-
public async getDefaultAsync(options?:base.WebApiGetRequestOptions): Promise< carriers.ProjectEntity > {
|
|
96
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
97
|
-
base.WebApiBase.SetPending(options);
|
|
98
|
-
return new Promise< carriers.ProjectEntity >(async (resolve, reject) => {
|
|
99
|
-
try {
|
|
100
|
-
const response = await this._axios.get("default", config);
|
|
101
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
102
|
-
const res : carriers.ProjectEntity = converters.Create_ProjectEntity_From( response.data );
|
|
103
|
-
resolve(res);
|
|
104
|
-
}
|
|
105
|
-
catch( err ) {
|
|
106
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
107
|
-
reject(err);
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* `POST /api/v1/Project/`
|
|
115
|
-
* Creates a new ProjectEntity
|
|
116
|
-
* @param newProject - The ProjectEntity to be saved.
|
|
117
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
118
|
-
* @returns New ProjectEntity
|
|
119
|
-
*/
|
|
120
|
-
public async postAsync(newProject: carriers.ProjectEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.ProjectEntity > {
|
|
121
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
122
|
-
base.WebApiBase.SetPending(options);
|
|
123
|
-
return new Promise< carriers.ProjectEntity >(async (resolve, reject) => {
|
|
124
|
-
try {
|
|
125
|
-
const response = await this._axios.post("", newProject, config);
|
|
126
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
127
|
-
const res : carriers.ProjectEntity = converters.Create_ProjectEntity_From( response.data );
|
|
128
|
-
resolve(res);
|
|
129
|
-
}
|
|
130
|
-
catch( err ) {
|
|
131
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
132
|
-
reject(err);
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* `PUT /api/v1/Project/123`
|
|
140
|
-
* Replace the existing ProjectEntity
|
|
141
|
-
* @param project - The ProjectEntity to be saved.
|
|
142
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
143
|
-
* @returns The updated ProjectEntity
|
|
144
|
-
*/
|
|
145
|
-
public async putByIdAsync(id:number, project: carriers.ProjectEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.ProjectEntity > {
|
|
146
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
147
|
-
base.WebApiBase.SetPending(options);
|
|
148
|
-
return new Promise< carriers.ProjectEntity >(async (resolve, reject) => {
|
|
149
|
-
try {
|
|
150
|
-
const response = await this._axios.put(id.toString(), project, config);
|
|
151
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
152
|
-
let res : carriers.ProjectEntity = null;
|
|
153
|
-
if( response.status != 304 )
|
|
154
|
-
res = converters.Create_ProjectEntity_From( response.data );
|
|
155
|
-
resolve(res);
|
|
156
|
-
}
|
|
157
|
-
catch( err ) {
|
|
158
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
159
|
-
reject(err);
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* `PATCH /api/v1/Project/123`
|
|
166
|
-
* Updates an existing ProjectEntity
|
|
167
|
-
* @param project - The partial ProjectEntity containing updated values, or an array of RFC6902 PATCH operations.
|
|
168
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
169
|
-
* @returns The updated ProjectEntity
|
|
170
|
-
*/
|
|
171
|
-
public async patchByIdAsync(id:number, project: base.WebApiPatchOperation[] | carriers.ProjectEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.ProjectEntity > {
|
|
172
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
173
|
-
base.WebApiBase.SetPending(options);
|
|
174
|
-
return new Promise< carriers.ProjectEntity >(async (resolve, reject) => {
|
|
175
|
-
try {
|
|
176
|
-
const response = await this._axios.patch(id.toString(), project, config);
|
|
177
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
178
|
-
let res : carriers.ProjectEntity = null;
|
|
179
|
-
if( response.status != 304 )
|
|
180
|
-
res = converters.Create_ProjectEntity_From( response.data );
|
|
181
|
-
resolve(res);
|
|
182
|
-
}
|
|
183
|
-
catch( err ) {
|
|
184
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
185
|
-
reject(err);
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* `DELETE /api/v1/Project/123`
|
|
191
|
-
* Deletes the ProjectEntity
|
|
192
|
-
* @param projectId - The id of the ProjectEntity to be deleted.
|
|
193
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
194
|
-
*/
|
|
195
|
-
public async deleteByIdAsync(projectId: number, options?:base.WebApiPutRequestOptions) : Promise<void> {
|
|
196
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
197
|
-
base.WebApiBase.SetPending(options);
|
|
198
|
-
return new Promise< void >(async (resolve, reject) => {
|
|
199
|
-
try {
|
|
200
|
-
const response = await this._axios.delete( projectId.toString(), config );
|
|
201
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
202
|
-
const res = response.data;
|
|
203
|
-
resolve(res);
|
|
204
|
-
}
|
|
205
|
-
catch( err ) {
|
|
206
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
207
|
-
reject(err);
|
|
208
|
-
}
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
/**
|
|
212
|
-
* `GET /api/v1/Project/123`
|
|
213
|
-
* Get an existing ProjectEntity
|
|
214
|
-
* @param projectId - The ProjectEntity to be get.
|
|
215
|
-
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
216
|
-
* @returns The ProjectEntity
|
|
217
|
-
*/
|
|
218
|
-
public async getByIdAsync( projectId: number, options?:base.WebApiGetRequestOptions) : Promise< carriers.ProjectEntity > {
|
|
219
|
-
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
220
|
-
base.WebApiBase.SetPending(options);
|
|
221
|
-
return new Promise< carriers.ProjectEntity >(async (resolve, reject) => {
|
|
222
|
-
try {
|
|
223
|
-
const response = await this._axios.get( projectId.toString(), config);
|
|
224
|
-
base.WebApiBase.SetCompleted(options, response);
|
|
225
|
-
let res : carriers.ProjectEntity = null;
|
|
226
|
-
if( response.status != 304 )
|
|
227
|
-
res = converters.Create_ProjectEntity_From( response.data );
|
|
228
|
-
resolve(res);
|
|
229
|
-
}
|
|
230
|
-
catch( err ) {
|
|
231
|
-
base.WebApiBase.HandleError(options, config, err);
|
|
232
|
-
reject(err);
|
|
233
|
-
}
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
} // class ProjectRestApi
|
|
239
|
-
|
|
1
|
+
// <auto-generated>
|
|
2
|
+
// SuperOffice Code Generator
|
|
3
|
+
// modelling\templates\servicestswebapi\tswebapirestentities.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: ProjectRestApi.ts
|
|
13
|
+
//
|
|
14
|
+
//----------------------------------------------------------------------------
|
|
15
|
+
// Copyright (C) SuperOffice AS
|
|
16
|
+
//----------------------------------------------------------------------------
|
|
17
|
+
|
|
18
|
+
import { AxiosRequestConfig, AxiosError } 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
|
+
* The Project Service. The service implements all services working with the Project object
|
|
28
|
+
* Collection of all services that works with Project data.
|
|
29
|
+
*
|
|
30
|
+
* `api/v1/Project`
|
|
31
|
+
*/
|
|
32
|
+
export interface IProjectRestApi {
|
|
33
|
+
|
|
34
|
+
getDefaultAsync(options?:base.WebApiGetRequestOptions): Promise< carriers.ProjectEntity >;
|
|
35
|
+
postAsync(entity: carriers.ProjectEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.ProjectEntity >;
|
|
36
|
+
putByIdAsync(id:number, entity: carriers.ProjectEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.ProjectEntity >;
|
|
37
|
+
patchByIdAsync(id:number, entity: base.WebApiPatchOperation[] | carriers.ProjectEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.ProjectEntity >;
|
|
38
|
+
deleteByIdAsync(ProjectEntityId: number, options?:base.WebApiPutRequestOptions) : Promise<void>;
|
|
39
|
+
getByIdAsync(ProjectEntityId: number, options?:base.WebApiGetRequestOptions) : Promise< carriers.ProjectEntity >;
|
|
40
|
+
// GET Duplicates/{name} Async( name ) = getDuplicates
|
|
41
|
+
|
|
42
|
+
// PUT DuplicateRules Async( rules ) = setDuplicateRulesStatus
|
|
43
|
+
|
|
44
|
+
// GET DuplicateRules Async( ) = getDuplicateRules
|
|
45
|
+
|
|
46
|
+
// POST {sourceProjectId}/MergeTo/{destinationProjectId} Async( sourceProjectId destinationProjectId replaceEmptyFieldsOnDestination ) = merge
|
|
47
|
+
|
|
48
|
+
// GET {contactId:int}/IsNumberValid/{number} Async( contactId number ) = isNumberValid
|
|
49
|
+
|
|
50
|
+
// GET {projectId}/HasGuide Async( projectId ) = hasGuide
|
|
51
|
+
|
|
52
|
+
// GET {projectId}/NextMilestone Async( projectId ) = getNextMilestone
|
|
53
|
+
|
|
54
|
+
// POST Validate Async( projectEntity ) = validateProjectEntity
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
} // interface IProjectRestApi
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The Project Service. The service implements all services working with the Project object
|
|
64
|
+
* Collection of all services that works with Project data.
|
|
65
|
+
*
|
|
66
|
+
* `api/v1/Project`
|
|
67
|
+
*/
|
|
68
|
+
export class ProjectRestApi extends base.WebApiBase implements IProjectRestApi {
|
|
69
|
+
constructor(baseUrl?: string, languageCode?:string, cultureCode?: string);
|
|
70
|
+
constructor(baseUrl?: string, resourceParsing?: base.ResourceParsing);
|
|
71
|
+
constructor(baseUrl: string, resourceManager:any);
|
|
72
|
+
constructor(baseUrl: string, config:AxiosRequestConfig, resourceManager:any);
|
|
73
|
+
constructor(baseUrl: string, config:AxiosRequestConfig, resourceParsing?: base.ResourceParsing);
|
|
74
|
+
constructor(baseUrl: string, config:AxiosRequestConfig, languageCode?:string, cultureCode?: string);
|
|
75
|
+
constructor(options: base.WebApiOptions);
|
|
76
|
+
|
|
77
|
+
constructor(baseUrlOrOptions: string|base.WebApiOptions|undefined,
|
|
78
|
+
langOrconfigOrRM?: string|base.ResourceParsing|AxiosRequestConfig|any,
|
|
79
|
+
langOrResourceOrRM?:string|base.ResourceParsing|any,
|
|
80
|
+
cultureCode?: string,
|
|
81
|
+
) {
|
|
82
|
+
const options = base.WebApiBase.FigureOutOptions(baseUrlOrOptions, langOrconfigOrRM, langOrResourceOrRM, cultureCode);
|
|
83
|
+
options.basePath = "v1/Project/";
|
|
84
|
+
super(options);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* `GET /api/v1/Project/default`
|
|
90
|
+
* Set default values into a new ProjectEntity.
|
|
91
|
+
* NetServer calculates default values on the entity, which is required when creating/storing a new instance
|
|
92
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
93
|
+
* @returns A blank entity.
|
|
94
|
+
*/
|
|
95
|
+
public async getDefaultAsync(options?:base.WebApiGetRequestOptions): Promise< carriers.ProjectEntity > {
|
|
96
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
97
|
+
base.WebApiBase.SetPending(options);
|
|
98
|
+
return new Promise< carriers.ProjectEntity >(async (resolve, reject) => {
|
|
99
|
+
try {
|
|
100
|
+
const response = await this._axios.get("default", config);
|
|
101
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
102
|
+
const res : carriers.ProjectEntity = converters.Create_ProjectEntity_From( response.data );
|
|
103
|
+
resolve(res);
|
|
104
|
+
}
|
|
105
|
+
catch( err ) {
|
|
106
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
107
|
+
reject(err);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* `POST /api/v1/Project/`
|
|
115
|
+
* Creates a new ProjectEntity
|
|
116
|
+
* @param newProject - The ProjectEntity to be saved.
|
|
117
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
118
|
+
* @returns New ProjectEntity
|
|
119
|
+
*/
|
|
120
|
+
public async postAsync(newProject: carriers.ProjectEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.ProjectEntity > {
|
|
121
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
122
|
+
base.WebApiBase.SetPending(options);
|
|
123
|
+
return new Promise< carriers.ProjectEntity >(async (resolve, reject) => {
|
|
124
|
+
try {
|
|
125
|
+
const response = await this._axios.post("", newProject, config);
|
|
126
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
127
|
+
const res : carriers.ProjectEntity = converters.Create_ProjectEntity_From( response.data );
|
|
128
|
+
resolve(res);
|
|
129
|
+
}
|
|
130
|
+
catch( err ) {
|
|
131
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
132
|
+
reject(err);
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* `PUT /api/v1/Project/123`
|
|
140
|
+
* Replace the existing ProjectEntity
|
|
141
|
+
* @param project - The ProjectEntity to be saved.
|
|
142
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
143
|
+
* @returns The updated ProjectEntity
|
|
144
|
+
*/
|
|
145
|
+
public async putByIdAsync(id:number, project: carriers.ProjectEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.ProjectEntity > {
|
|
146
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
147
|
+
base.WebApiBase.SetPending(options);
|
|
148
|
+
return new Promise< carriers.ProjectEntity >(async (resolve, reject) => {
|
|
149
|
+
try {
|
|
150
|
+
const response = await this._axios.put(id.toString(), project, config);
|
|
151
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
152
|
+
let res : carriers.ProjectEntity = null;
|
|
153
|
+
if( response.status != 304 )
|
|
154
|
+
res = converters.Create_ProjectEntity_From( response.data );
|
|
155
|
+
resolve(res);
|
|
156
|
+
}
|
|
157
|
+
catch( err ) {
|
|
158
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
159
|
+
reject(err);
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* `PATCH /api/v1/Project/123`
|
|
166
|
+
* Updates an existing ProjectEntity
|
|
167
|
+
* @param project - The partial ProjectEntity containing updated values, or an array of RFC6902 PATCH operations.
|
|
168
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
169
|
+
* @returns The updated ProjectEntity
|
|
170
|
+
*/
|
|
171
|
+
public async patchByIdAsync(id:number, project: base.WebApiPatchOperation[] | carriers.ProjectEntity, options?:base.WebApiPutRequestOptions) : Promise< carriers.ProjectEntity > {
|
|
172
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
173
|
+
base.WebApiBase.SetPending(options);
|
|
174
|
+
return new Promise< carriers.ProjectEntity >(async (resolve, reject) => {
|
|
175
|
+
try {
|
|
176
|
+
const response = await this._axios.patch(id.toString(), project, config);
|
|
177
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
178
|
+
let res : carriers.ProjectEntity = null;
|
|
179
|
+
if( response.status != 304 )
|
|
180
|
+
res = converters.Create_ProjectEntity_From( response.data );
|
|
181
|
+
resolve(res);
|
|
182
|
+
}
|
|
183
|
+
catch( err ) {
|
|
184
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
185
|
+
reject(err);
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* `DELETE /api/v1/Project/123`
|
|
191
|
+
* Deletes the ProjectEntity
|
|
192
|
+
* @param projectId - The id of the ProjectEntity to be deleted.
|
|
193
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
194
|
+
*/
|
|
195
|
+
public async deleteByIdAsync(projectId: number, options?:base.WebApiPutRequestOptions) : Promise<void> {
|
|
196
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
197
|
+
base.WebApiBase.SetPending(options);
|
|
198
|
+
return new Promise< void >(async (resolve, reject) => {
|
|
199
|
+
try {
|
|
200
|
+
const response = await this._axios.delete( projectId.toString(), config );
|
|
201
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
202
|
+
const res = response.data;
|
|
203
|
+
resolve(res);
|
|
204
|
+
}
|
|
205
|
+
catch( err ) {
|
|
206
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
207
|
+
reject(err);
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* `GET /api/v1/Project/123`
|
|
213
|
+
* Get an existing ProjectEntity
|
|
214
|
+
* @param projectId - The ProjectEntity to be get.
|
|
215
|
+
* @param options - Override language/culture codes on this request. Provide cancellation and request status values.
|
|
216
|
+
* @returns The ProjectEntity
|
|
217
|
+
*/
|
|
218
|
+
public async getByIdAsync( projectId: number, options?:base.WebApiGetRequestOptions) : Promise< carriers.ProjectEntity > {
|
|
219
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
220
|
+
base.WebApiBase.SetPending(options);
|
|
221
|
+
return new Promise< carriers.ProjectEntity >(async (resolve, reject) => {
|
|
222
|
+
try {
|
|
223
|
+
const response = await this._axios.get( projectId.toString(), config);
|
|
224
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
225
|
+
let res : carriers.ProjectEntity = null;
|
|
226
|
+
if( response.status != 304 )
|
|
227
|
+
res = converters.Create_ProjectEntity_From( response.data );
|
|
228
|
+
resolve(res);
|
|
229
|
+
}
|
|
230
|
+
catch( err ) {
|
|
231
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
232
|
+
reject(err);
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
} // class ProjectRestApi
|
|
239
|
+
|