@superoffice/webapi 12.5.2909 → 12.6.1407

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/cjs/Carriers.d.ts +421 -6
  2. package/dist/cjs/Carriers.d.ts.map +1 -1
  3. package/dist/cjs/ConfigurationAgent.d.ts +31 -0
  4. package/dist/cjs/ConfigurationAgent.d.ts.map +1 -1
  5. package/dist/cjs/ConfigurationAgent.js +67 -0
  6. package/dist/cjs/ConfigurationAgent.js.map +1 -1
  7. package/dist/cjs/Converters.d.ts +24 -0
  8. package/dist/cjs/Converters.d.ts.map +1 -1
  9. package/dist/cjs/Converters.js +362 -26
  10. package/dist/cjs/Converters.js.map +1 -1
  11. package/dist/cjs/DiagnosticsAgent.d.ts +5 -5
  12. package/dist/cjs/DiagnosticsAgent.js +5 -5
  13. package/dist/cjs/Enums.d.ts +121 -3
  14. package/dist/cjs/Enums.d.ts.map +1 -1
  15. package/dist/cjs/Enums.js +128 -6
  16. package/dist/cjs/Enums.js.map +1 -1
  17. package/dist/cjs/ListAgent.d.ts +31 -0
  18. package/dist/cjs/ListAgent.d.ts.map +1 -1
  19. package/dist/cjs/ListAgent.js +67 -0
  20. package/dist/cjs/ListAgent.js.map +1 -1
  21. package/dist/cjs/ProjectAgent.d.ts +48 -0
  22. package/dist/cjs/ProjectAgent.d.ts.map +1 -1
  23. package/dist/cjs/ProjectAgent.js +102 -0
  24. package/dist/cjs/ProjectAgent.js.map +1 -1
  25. package/dist/cjs/ProjectRestApi.d.ts.map +1 -1
  26. package/dist/cjs/ProjectRestApi.js.map +1 -1
  27. package/dist/cjs/SaleAgent.d.ts +79 -0
  28. package/dist/cjs/SaleAgent.d.ts.map +1 -1
  29. package/dist/cjs/SaleAgent.js +169 -0
  30. package/dist/cjs/SaleAgent.js.map +1 -1
  31. package/dist/cjs/SaleRestApi.d.ts.map +1 -1
  32. package/dist/cjs/SaleRestApi.js.map +1 -1
  33. package/dist/esm/Carriers.d.ts +421 -6
  34. package/dist/esm/Carriers.d.ts.map +1 -1
  35. package/dist/esm/ConfigurationAgent.d.ts +31 -0
  36. package/dist/esm/ConfigurationAgent.d.ts.map +1 -1
  37. package/dist/esm/ConfigurationAgent.js +67 -0
  38. package/dist/esm/ConfigurationAgent.js.map +1 -1
  39. package/dist/esm/Converters.d.ts +24 -0
  40. package/dist/esm/Converters.d.ts.map +1 -1
  41. package/dist/esm/Converters.js +311 -0
  42. package/dist/esm/Converters.js.map +1 -1
  43. package/dist/esm/DiagnosticsAgent.d.ts +5 -5
  44. package/dist/esm/DiagnosticsAgent.js +5 -5
  45. package/dist/esm/Enums.d.ts +121 -3
  46. package/dist/esm/Enums.d.ts.map +1 -1
  47. package/dist/esm/Enums.js +123 -1
  48. package/dist/esm/Enums.js.map +1 -1
  49. package/dist/esm/ListAgent.d.ts +31 -0
  50. package/dist/esm/ListAgent.d.ts.map +1 -1
  51. package/dist/esm/ListAgent.js +67 -0
  52. package/dist/esm/ListAgent.js.map +1 -1
  53. package/dist/esm/ProjectAgent.d.ts +48 -0
  54. package/dist/esm/ProjectAgent.d.ts.map +1 -1
  55. package/dist/esm/ProjectAgent.js +102 -0
  56. package/dist/esm/ProjectAgent.js.map +1 -1
  57. package/dist/esm/ProjectRestApi.d.ts.map +1 -1
  58. package/dist/esm/ProjectRestApi.js.map +1 -1
  59. package/dist/esm/SaleAgent.d.ts +79 -0
  60. package/dist/esm/SaleAgent.d.ts.map +1 -1
  61. package/dist/esm/SaleAgent.js +169 -0
  62. package/dist/esm/SaleAgent.js.map +1 -1
  63. package/dist/esm/SaleRestApi.d.ts.map +1 -1
  64. package/dist/esm/SaleRestApi.js.map +1 -1
  65. package/package.json +3 -3
  66. package/src/Carriers.ts +564 -6
  67. package/src/ConfigurationAgent.ts +114 -0
  68. package/src/Converters.ts +363 -0
  69. package/src/DiagnosticsAgent.ts +5 -5
  70. package/src/Enums.ts +127 -1
  71. package/src/ListAgent.ts +114 -0
  72. package/src/ProjectAgent.ts +174 -0
  73. package/src/ProjectRestApi.ts +2 -0
  74. package/src/SaleAgent.ts +288 -0
  75. package/src/SaleRestApi.ts +2 -0
package/src/Enums.ts CHANGED
@@ -929,6 +929,52 @@
929
929
  }
930
930
 
931
931
 
932
+ /**
933
+ * Outcome of one optional part of a copy operation. Not a stored field: this only ever travels in the copy result objects on carriers returned by copy operations.
934
+ */
935
+ export enum CopyPartResult {
936
+ /**
937
+ * 0: The caller did not ask for this part, so nothing was attempted
938
+ */
939
+ NotRequested = "NotRequested",
940
+ /**
941
+ * 1: The part was requested and copied to the new record
942
+ */
943
+ Success = "Success",
944
+ /**
945
+ * 2: The part was requested and attempted, but failed.
946
+ */
947
+ Failure = "Failure",
948
+ /**
949
+ * 3: The part was requested, but the source record had nothing to copy
950
+ */
951
+ NothingToCopy = "NothingToCopy",
952
+ }
953
+
954
+
955
+ /**
956
+ * Whether one optional part of a copy can be copied, as checked before the copy is saved. Not a stored field: this only travels in the copy check carriers returned by the copy check operations.
957
+ */
958
+ export enum CopyPartAvailability {
959
+ /**
960
+ * 0: The part can be copied
961
+ */
962
+ Available = "Available",
963
+ /**
964
+ * 1: The source record has nothing to copy for this part
965
+ */
966
+ NothingToCopy = "NothingToCopy",
967
+ /**
968
+ * 2: The part isn't offered, because the user's licences or the system's settings don't include it
969
+ */
970
+ NotLicensed = "NotLicensed",
971
+ /**
972
+ * 3: The source record has something to copy, but it can't be copied, for instance because of the user's rights. The check's Reason says why.
973
+ */
974
+ NotAvailable = "NotAvailable",
975
+ }
976
+
977
+
932
978
  /**
933
979
  * Value for the showState field in table externalapplication
934
980
  * This Enum is used by: ExtApp.showState
@@ -1104,7 +1150,7 @@
1104
1150
 
1105
1151
  /**
1106
1152
  * Units of duration - from seconds to centuries
1107
- * This Enum is used by: ProjType.durationUnit; SaleType.durationUnit
1153
+ * This Enum is used by: ProjType.durationUnit; SaleType.durationUnit; ticket_status_postpone.unit
1108
1154
  */
1109
1155
  export enum DurationUnit {
1110
1156
  /**
@@ -1410,6 +1456,66 @@
1410
1456
  }
1411
1457
 
1412
1458
 
1459
+ /**
1460
+ * Built-in postpone option a ticket_status_postpone row represents
1461
+ * This Enum is used by: ticket_status_postpone.standard_kind
1462
+ */
1463
+ export enum TicketPostponeStandard {
1464
+ /**
1465
+ * 0: Option defined by an administrator
1466
+ */
1467
+ Custom = "Custom",
1468
+ /**
1469
+ * 1: 1 hour
1470
+ */
1471
+ OneHour = "OneHour",
1472
+ /**
1473
+ * 2: 24 hours
1474
+ */
1475
+ TwentyFourHours = "TwentyFourHours",
1476
+ /**
1477
+ * 3: Next working day
1478
+ */
1479
+ NextWorkingDay = "NextWorkingDay",
1480
+ /**
1481
+ * 4: Monday next week
1482
+ */
1483
+ NextWeek = "NextWeek",
1484
+ /**
1485
+ * 5: 1 week
1486
+ */
1487
+ OneWeek = "OneWeek",
1488
+ /**
1489
+ * 6: 1 month
1490
+ */
1491
+ OneMonth = "OneMonth",
1492
+ }
1493
+
1494
+
1495
+ /**
1496
+ * How the activation time of a postponed ticket is calculated
1497
+ * This Enum is used by: ticket_status_postpone.rule
1498
+ */
1499
+ export enum TicketPostponeRule {
1500
+ /**
1501
+ * 0: Unknown / uninitialized
1502
+ */
1503
+ Unknown = "Unknown",
1504
+ /**
1505
+ * 1: After an amount of time units
1506
+ */
1507
+ Interval = "Interval",
1508
+ /**
1509
+ * 2: The next working day, at a time of day
1510
+ */
1511
+ NextWorkingDay = "NextWorkingDay",
1512
+ /**
1513
+ * 3: A weekday next week, at a time of day
1514
+ */
1515
+ WeekdayNextWeek = "WeekdayNextWeek",
1516
+ }
1517
+
1518
+
1413
1519
  /**
1414
1520
  * State of a Quote Version
1415
1521
  * This Enum is used by: QuoteVersion.State; QuoteVersion.ArchivedState
@@ -2366,6 +2472,14 @@
2366
2472
  * 1008: Should only be used for UI, when saved to DB it will be converted to Postponed
2367
2473
  */
2368
2474
  PostponedMonth = "PostponedMonth",
2475
+ /**
2476
+ * 1009: Should only be used for UI, when saved to DB it will be converted to Postponed
2477
+ */
2478
+ PostponedNextWorkingDay = "PostponedNextWorkingDay",
2479
+ /**
2480
+ * 1010: Should only be used for UI, when saved to DB it will be converted to Postponed
2481
+ */
2482
+ PostponedNextWeek = "PostponedNextWeek",
2369
2483
  }
2370
2484
 
2371
2485
 
@@ -5289,6 +5403,18 @@
5289
5403
  * 11: Invitation or assignment declined
5290
5404
  */
5291
5405
  AppointmentDeclined = "AppointmentDeclined",
5406
+ /**
5407
+ * 12: Custom message sent to a ticket's followers
5408
+ */
5409
+ TicketCustomMessage = "TicketCustomMessage",
5410
+ /**
5411
+ * 13: A favourited ticket was updated
5412
+ */
5413
+ TicketFavouriteUpdated = "TicketFavouriteUpdated",
5414
+ /**
5415
+ * 14: A ticket was taken over by someone else
5416
+ */
5417
+ TicketTakenOver = "TicketTakenOver",
5292
5418
  }
5293
5419
 
5294
5420
 
package/src/ListAgent.ts CHANGED
@@ -431,6 +431,10 @@ export interface IListAgent {
431
431
  globalChangeTicketStatusAsync(fromTicketStatusId: number, toTicketStatusId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
432
432
  setTicketStatusSortOrderAsync(request: carriers.List_SetTicketStatusSortOrderRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
433
433
  setTicketStatusSortOrderAsync(ticketStatusId: number, sortOrder: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
434
+ getTicketStatusPostponeOptionsAsync(request: carriers.List_GetTicketStatusPostponeOptionsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketPostponeOption[] >;
435
+ getTicketStatusPostponeOptionsAsync(ticketStatusId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketPostponeOption[] >;
436
+ saveTicketStatusPostponeOptionsAsync(request: carriers.List_SaveTicketStatusPostponeOptionsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketPostponeOption[] >;
437
+ saveTicketStatusPostponeOptionsAsync(ticketStatusId: number, postponeOptions: carriers.TicketPostponeOption[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketPostponeOption[] >;
434
438
  getTicketStatusListAsync(ticketStatusEntityIds: number[]) : Promise< carriers.TicketStatusEntity[] >;
435
439
  getTicketStatusesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketStatusEntity[] >;
436
440
  getTicketTypeEntityAsync(ticketTypeEntityId: number) : Promise< carriers.TicketTypeEntity >;
@@ -11119,6 +11123,116 @@ export class ListAgent extends base.WebApiBase implements IListAgent {
11119
11123
  return this._setTicketStatusSortOrderAsync( _request, _options );
11120
11124
  }
11121
11125
 
11126
+
11127
+ private async _getTicketStatusPostponeOptionsAsync(request: carriers.List_GetTicketStatusPostponeOptionsRequest, options?:base.WebApiRequestOptions) : Promise< carriers.TicketPostponeOption[] > {
11128
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
11129
+ base.WebApiBase.SetPending(options);
11130
+ return new Promise< carriers.TicketPostponeOption[] >(async (resolve, reject) => {
11131
+ try {
11132
+ config.baseURL = this._options.baseUrl;
11133
+ const response = await this._axios.post("GetTicketStatusPostponeOptions", request , config);
11134
+ base.WebApiBase.SetCompleted(options, response);
11135
+ const res : carriers.TicketPostponeOption[] = converters.Create_TicketPostponeOptionArray_From( response.data );
11136
+ resolve(res);
11137
+ }
11138
+ catch( err ) {
11139
+ base.WebApiBase.HandleError(options, config, err);
11140
+ reject(err);
11141
+ }
11142
+ });
11143
+ }
11144
+
11145
+
11146
+
11147
+ /**
11148
+ * Returns the postpone options of a Postponed ticket status, in menu order. A status without saved options returns the standard options. Returns an empty array for a status that is not Postponed.
11149
+ * @param request - TicketStatusId
11150
+ * @returns The postpone options, including inactive ones
11151
+ */
11152
+ public async getTicketStatusPostponeOptionsAsync(request: carriers.List_GetTicketStatusPostponeOptionsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketPostponeOption[] >;
11153
+
11154
+ /**
11155
+ * Returns the postpone options of a Postponed ticket status, in menu order. A status without saved options returns the standard options. Returns an empty array for a status that is not Postponed.
11156
+ * @param ticketStatusId - Id of the ticket status
11157
+ * @returns The postpone options, including inactive ones
11158
+ */
11159
+ public async getTicketStatusPostponeOptionsAsync(ticketStatusId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketPostponeOption[] >;
11160
+
11161
+ public async getTicketStatusPostponeOptionsAsync(ticketStatusId:number|carriers.List_GetTicketStatusPostponeOptionsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketPostponeOption[] > {
11162
+ let _request : carriers.List_GetTicketStatusPostponeOptionsRequest = null;
11163
+ let _options : base.WebApiRequestOptions = null;
11164
+ const first : any = ticketStatusId;
11165
+ if( typeof( first ) === "object" && first && ( typeof(first.ticketStatusId)!='undefined' ) )
11166
+ {
11167
+ _request = ticketStatusId as carriers.List_GetTicketStatusPostponeOptionsRequest;
11168
+ _options = webapi_options as base.WebApiRequestOptions;
11169
+ }
11170
+ else
11171
+ {
11172
+ _request = {
11173
+ ticketStatusId: ticketStatusId as number,
11174
+ };
11175
+ _options = webapi_options;
11176
+ }
11177
+ return this._getTicketStatusPostponeOptionsAsync( _request, _options );
11178
+ }
11179
+
11180
+
11181
+ private async _saveTicketStatusPostponeOptionsAsync(request: carriers.List_SaveTicketStatusPostponeOptionsRequest, options?:base.WebApiRequestOptions) : Promise< carriers.TicketPostponeOption[] > {
11182
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
11183
+ base.WebApiBase.SetPending(options);
11184
+ return new Promise< carriers.TicketPostponeOption[] >(async (resolve, reject) => {
11185
+ try {
11186
+ config.baseURL = this._options.baseUrl;
11187
+ const response = await this._axios.post("SaveTicketStatusPostponeOptions", request , config);
11188
+ base.WebApiBase.SetCompleted(options, response);
11189
+ const res : carriers.TicketPostponeOption[] = converters.Create_TicketPostponeOptionArray_From( response.data );
11190
+ resolve(res);
11191
+ }
11192
+ catch( err ) {
11193
+ base.WebApiBase.HandleError(options, config, err);
11194
+ reject(err);
11195
+ }
11196
+ });
11197
+ }
11198
+
11199
+
11200
+
11201
+ /**
11202
+ * Replaces the postpone options of a Postponed ticket status. Standard options can only change rank and active state.
11203
+ * @param request - TicketStatusId, PostponeOptions
11204
+ * @returns The saved postpone options, in menu order
11205
+ */
11206
+ public async saveTicketStatusPostponeOptionsAsync(request: carriers.List_SaveTicketStatusPostponeOptionsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketPostponeOption[] >;
11207
+
11208
+ /**
11209
+ * Replaces the postpone options of a Postponed ticket status. Standard options can only change rank and active state.
11210
+ * @param ticketStatusId - Id of the ticket status
11211
+ * @param postponeOptions - All postpone options of the status, in menu order
11212
+ * @returns The saved postpone options, in menu order
11213
+ */
11214
+ public async saveTicketStatusPostponeOptionsAsync(ticketStatusId: number, postponeOptions: carriers.TicketPostponeOption[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketPostponeOption[] >;
11215
+
11216
+ public async saveTicketStatusPostponeOptionsAsync(ticketStatusId:number|carriers.List_SaveTicketStatusPostponeOptionsRequest, postponeOptions?:carriers.TicketPostponeOption[]|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TicketPostponeOption[] > {
11217
+ let _request : carriers.List_SaveTicketStatusPostponeOptionsRequest = null;
11218
+ let _options : base.WebApiRequestOptions = null;
11219
+ const first : any = ticketStatusId;
11220
+ if( typeof( first ) === "object" && first && ( typeof(first.ticketStatusId)!='undefined' || typeof(first.postponeOptions)!='undefined' ) )
11221
+ {
11222
+ _request = ticketStatusId as carriers.List_SaveTicketStatusPostponeOptionsRequest;
11223
+ _options = postponeOptions as base.WebApiRequestOptions;
11224
+ }
11225
+ else
11226
+ {
11227
+ _request = {
11228
+ ticketStatusId: ticketStatusId as number,
11229
+ postponeOptions: postponeOptions as carriers.TicketPostponeOption[],
11230
+ };
11231
+ _options = webapi_options;
11232
+ }
11233
+ return this._saveTicketStatusPostponeOptionsAsync( _request, _options );
11234
+ }
11235
+
11122
11236
  /**
11123
11237
  * Gets an array of TicketStatusEntity objects.
11124
11238
  * @param ticketStatusEntityIds - The primary keys.
@@ -78,6 +78,12 @@ export interface IProjectAgent {
78
78
  saveProjectEntityWithoutMembersAsync(request: carriers.Project_SaveProjectEntityWithoutMembersRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ProjectEntity >;
79
79
  saveProjectEntityWithoutMembersAsync(projectEntity: carriers.ProjectEntity, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ProjectEntity >;
80
80
  getProjectFencingInfoAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FencingInfo >;
81
+ createProjectEntityFromExistingAsync(request: carriers.Project_CreateProjectEntityFromExistingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ProjectEntity >;
82
+ createProjectEntityFromExistingAsync(projectId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ProjectEntity >;
83
+ saveProjectEntityCopyAsync(request: carriers.Project_SaveProjectEntityCopyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ProjectCopyResult >;
84
+ saveProjectEntityCopyAsync(projectEntity: carriers.ProjectEntity, sourceProjectId: number, options: carriers.ProjectCopyOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ProjectCopyResult >;
85
+ checkProjectEntityCopyAsync(request: carriers.Project_CheckProjectEntityCopyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ProjectCopyCheck >;
86
+ checkProjectEntityCopyAsync(projectEntity: carriers.ProjectEntity, sourceProjectId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ProjectCopyCheck >;
81
87
  getProjectEventAsync(projectEventId: number) : Promise< carriers.ProjectEvent >;
82
88
  getProjectEventOnPersonAsync(request: carriers.Project_GetProjectEventOnPersonRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ProjectEvent >;
83
89
  getProjectEventOnPersonAsync(projectId: number, personId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ProjectEvent >;
@@ -1508,6 +1514,174 @@ export class ProjectAgent extends base.WebApiBase implements IProjectAgent {
1508
1514
  return this._getProjectFencingInfoAsync(webapi_options);
1509
1515
  }
1510
1516
 
1517
+
1518
+ private async _createProjectEntityFromExistingAsync(request: carriers.Project_CreateProjectEntityFromExistingRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ProjectEntity > {
1519
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1520
+ base.WebApiBase.SetPending(options);
1521
+ return new Promise< carriers.ProjectEntity >(async (resolve, reject) => {
1522
+ try {
1523
+ config.baseURL = this._options.baseUrl;
1524
+ const response = await this._axios.post("CreateProjectEntityFromExisting", request , config);
1525
+ base.WebApiBase.SetCompleted(options, response);
1526
+ const res : carriers.ProjectEntity = converters.Create_ProjectEntity_From( response.data );
1527
+ resolve(res);
1528
+ }
1529
+ catch( err ) {
1530
+ base.WebApiBase.HandleError(options, config, err);
1531
+ reject(err);
1532
+ }
1533
+ });
1534
+ }
1535
+
1536
+
1537
+
1538
+ /**
1539
+ * Create an unsaved ProjectEntity copy of an existing project, with the copy rules already applied: the name gets a copy marker, the current user is the owner (Associate), status, dates and completion start over, and members, note, links, image, number, publishing and history are left out. The returned entity is not persisted - let the user change Name and Associate, then pass it to SaveProjectEntityCopy.
1540
+ * @param request - ProjectId
1541
+ * @returns Unsaved copy of the source project, with ProjectId = 0
1542
+ */
1543
+ public async createProjectEntityFromExistingAsync(request: carriers.Project_CreateProjectEntityFromExistingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ProjectEntity >;
1544
+
1545
+ /**
1546
+ * Create an unsaved ProjectEntity copy of an existing project, with the copy rules already applied: the name gets a copy marker, the current user is the owner (Associate), status, dates and completion start over, and members, note, links, image, number, publishing and history are left out. The returned entity is not persisted - let the user change Name and Associate, then pass it to SaveProjectEntityCopy.
1547
+ * @param projectId - The id of the source project
1548
+ * @returns Unsaved copy of the source project, with ProjectId = 0
1549
+ */
1550
+ public async createProjectEntityFromExistingAsync(projectId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ProjectEntity >;
1551
+
1552
+ public async createProjectEntityFromExistingAsync(projectId:number|carriers.Project_CreateProjectEntityFromExistingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ProjectEntity > {
1553
+ let _request : carriers.Project_CreateProjectEntityFromExistingRequest = null;
1554
+ let _options : base.WebApiRequestOptions = null;
1555
+ const first : any = projectId;
1556
+ if( typeof( first ) === "object" && first && ( typeof(first.projectId)!='undefined' ) )
1557
+ {
1558
+ _request = projectId as carriers.Project_CreateProjectEntityFromExistingRequest;
1559
+ _options = webapi_options as base.WebApiRequestOptions;
1560
+ }
1561
+ else
1562
+ {
1563
+ _request = {
1564
+ projectId: projectId as number,
1565
+ };
1566
+ _options = webapi_options;
1567
+ }
1568
+ return this._createProjectEntityFromExistingAsync( _request, _options );
1569
+ }
1570
+
1571
+
1572
+ private async _saveProjectEntityCopyAsync(request: carriers.Project_SaveProjectEntityCopyRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ProjectCopyResult > {
1573
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1574
+ base.WebApiBase.SetPending(options);
1575
+ return new Promise< carriers.ProjectCopyResult >(async (resolve, reject) => {
1576
+ try {
1577
+ config.baseURL = this._options.baseUrl;
1578
+ const response = await this._axios.post("SaveProjectEntityCopy", request , config);
1579
+ base.WebApiBase.SetCompleted(options, response);
1580
+ const res : carriers.ProjectCopyResult = converters.Create_ProjectCopyResult_From( response.data );
1581
+ resolve(res);
1582
+ }
1583
+ catch( err ) {
1584
+ base.WebApiBase.HandleError(options, config, err);
1585
+ reject(err);
1586
+ }
1587
+ });
1588
+ }
1589
+
1590
+
1591
+
1592
+ /**
1593
+ * Save a project copy prepared by CreateProjectEntityFromExisting, optionally copying members, note, links and image of the source project along with it. The server rebuilds the copy from the source project and takes only Name and Associate (the project owner) from the passed entity; every other value on it is ignored. Members, note, links and image are read from the source project, not from the passed entity. Pass null options, or options with nothing set, to copy the project alone.
1594
+ * @param request - ProjectEntity, SourceProjectId, Options
1595
+ * @returns The new project id, and what became of each optional part
1596
+ */
1597
+ public async saveProjectEntityCopyAsync(request: carriers.Project_SaveProjectEntityCopyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ProjectCopyResult >;
1598
+
1599
+ /**
1600
+ * Save a project copy prepared by CreateProjectEntityFromExisting, optionally copying members, note, links and image of the source project along with it. The server rebuilds the copy from the source project and takes only Name and Associate (the project owner) from the passed entity; every other value on it is ignored. Members, note, links and image are read from the source project, not from the passed entity. Pass null options, or options with nothing set, to copy the project alone.
1601
+ * @param projectEntity - The prepared copy. Only Name and Associate (the project owner) are used; every other value, including ProjectId, is ignored.
1602
+ * @param sourceProjectId - The project that the copy was prepared from
1603
+ * @param options - Which optional parts to copy alongside the project. Null copies the project alone.
1604
+ * @returns The new project id, and what became of each optional part
1605
+ */
1606
+ public async saveProjectEntityCopyAsync(projectEntity: carriers.ProjectEntity, sourceProjectId: number, options: carriers.ProjectCopyOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ProjectCopyResult >;
1607
+
1608
+ public async saveProjectEntityCopyAsync(projectEntity:carriers.ProjectEntity|carriers.Project_SaveProjectEntityCopyRequest, sourceProjectId?:number|base.WebApiRequestOptions, options?:carriers.ProjectCopyOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ProjectCopyResult > {
1609
+ let _request : carriers.Project_SaveProjectEntityCopyRequest = null;
1610
+ let _options : base.WebApiRequestOptions = null;
1611
+ const first : any = projectEntity;
1612
+ if( typeof( first ) === "object" && first && ( typeof(first.projectEntity)!='undefined' || typeof(first.sourceProjectId)!='undefined' || typeof(first.options)!='undefined' ) )
1613
+ {
1614
+ _request = projectEntity as carriers.Project_SaveProjectEntityCopyRequest;
1615
+ _options = sourceProjectId as base.WebApiRequestOptions;
1616
+ }
1617
+ else
1618
+ {
1619
+ _request = {
1620
+ projectEntity: projectEntity as carriers.ProjectEntity,
1621
+ sourceProjectId: sourceProjectId as number,
1622
+ options: options as carriers.ProjectCopyOptions,
1623
+ };
1624
+ _options = webapi_options;
1625
+ }
1626
+ return this._saveProjectEntityCopyAsync( _request, _options );
1627
+ }
1628
+
1629
+
1630
+ private async _checkProjectEntityCopyAsync(request: carriers.Project_CheckProjectEntityCopyRequest, options?:base.WebApiRequestOptions) : Promise< carriers.ProjectCopyCheck > {
1631
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1632
+ base.WebApiBase.SetPending(options);
1633
+ return new Promise< carriers.ProjectCopyCheck >(async (resolve, reject) => {
1634
+ try {
1635
+ config.baseURL = this._options.baseUrl;
1636
+ const response = await this._axios.post("CheckProjectEntityCopy", request , config);
1637
+ base.WebApiBase.SetCompleted(options, response);
1638
+ const res : carriers.ProjectCopyCheck = converters.Create_ProjectCopyCheck_From( response.data );
1639
+ resolve(res);
1640
+ }
1641
+ catch( err ) {
1642
+ base.WebApiBase.HandleError(options, config, err);
1643
+ reject(err);
1644
+ }
1645
+ });
1646
+ }
1647
+
1648
+
1649
+
1650
+ /**
1651
+ * Check a project copy before saving it: which of the optional parts of SaveProjectEntityCopy can be copied, and errors in the fields the user can edit. Nothing is saved. Call it again when the owner (Associate) changes, as the right to add members follows the project owner. SaveProjectEntityCopy refuses an optional part that is reported as not available or not licensed.
1652
+ * @param request - ProjectEntity, SourceProjectId
1653
+ * @returns Whether each optional part can be copied, and errors in the fields the user can edit
1654
+ */
1655
+ public async checkProjectEntityCopyAsync(request: carriers.Project_CheckProjectEntityCopyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ProjectCopyCheck >;
1656
+
1657
+ /**
1658
+ * Check a project copy before saving it: which of the optional parts of SaveProjectEntityCopy can be copied, and errors in the fields the user can edit. Nothing is saved. Call it again when the owner (Associate) changes, as the right to add members follows the project owner. SaveProjectEntityCopy refuses an optional part that is reported as not available or not licensed.
1659
+ * @param projectEntity - The prepared copy as the user has edited it. Only Name and Associate (the project owner) are used. Null checks the copy as CreateProjectEntityFromExisting prepares it.
1660
+ * @param sourceProjectId - The project that the copy is prepared from
1661
+ * @returns Whether each optional part can be copied, and errors in the fields the user can edit
1662
+ */
1663
+ public async checkProjectEntityCopyAsync(projectEntity: carriers.ProjectEntity, sourceProjectId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ProjectCopyCheck >;
1664
+
1665
+ public async checkProjectEntityCopyAsync(projectEntity:carriers.ProjectEntity|carriers.Project_CheckProjectEntityCopyRequest, sourceProjectId?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ProjectCopyCheck > {
1666
+ let _request : carriers.Project_CheckProjectEntityCopyRequest = null;
1667
+ let _options : base.WebApiRequestOptions = null;
1668
+ const first : any = projectEntity;
1669
+ if( typeof( first ) === "object" && first && ( typeof(first.projectEntity)!='undefined' || typeof(first.sourceProjectId)!='undefined' ) )
1670
+ {
1671
+ _request = projectEntity as carriers.Project_CheckProjectEntityCopyRequest;
1672
+ _options = sourceProjectId as base.WebApiRequestOptions;
1673
+ }
1674
+ else
1675
+ {
1676
+ _request = {
1677
+ projectEntity: projectEntity as carriers.ProjectEntity,
1678
+ sourceProjectId: sourceProjectId as number,
1679
+ };
1680
+ _options = webapi_options;
1681
+ }
1682
+ return this._checkProjectEntityCopyAsync( _request, _options );
1683
+ }
1684
+
1511
1685
  /**
1512
1686
  * Gets a ProjectEvent object.
1513
1687
  * @param projectEventId - The primary key.
@@ -53,6 +53,8 @@ export interface IProjectRestApi {
53
53
 
54
54
  // POST Validate Async( projectEntity ) = validateProjectEntity
55
55
 
56
+ // GET {projectId}/CreateFromExisting Async( projectId ) = createProjectEntityFromExisting
57
+
56
58
 
57
59
  } // interface IProjectRestApi
58
60