@superoffice/webapi 12.4.1514 → 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.
- package/dist/cjs/AIAgent.d.ts +4 -4
- package/dist/cjs/Carriers.d.ts +625 -19
- package/dist/cjs/Carriers.d.ts.map +1 -1
- package/dist/cjs/ConfigurationAgent.d.ts +38 -0
- package/dist/cjs/ConfigurationAgent.d.ts.map +1 -1
- package/dist/cjs/ConfigurationAgent.js +91 -0
- package/dist/cjs/ConfigurationAgent.js.map +1 -1
- package/dist/cjs/Converters.d.ts +27 -0
- package/dist/cjs/Converters.d.ts.map +1 -1
- package/dist/cjs/Converters.js +414 -26
- package/dist/cjs/Converters.js.map +1 -1
- package/dist/cjs/DiagnosticsAgent.d.ts +5 -5
- package/dist/cjs/DiagnosticsAgent.js +5 -5
- package/dist/cjs/Enums.d.ts +121 -3
- package/dist/cjs/Enums.d.ts.map +1 -1
- package/dist/cjs/Enums.js +128 -6
- package/dist/cjs/Enums.js.map +1 -1
- package/dist/cjs/FreeTextAgent.d.ts +2 -2
- package/dist/cjs/ImportAgent.d.ts +5 -5
- package/dist/cjs/ListAgent.d.ts +31 -0
- package/dist/cjs/ListAgent.d.ts.map +1 -1
- package/dist/cjs/ListAgent.js +67 -0
- package/dist/cjs/ListAgent.js.map +1 -1
- package/dist/cjs/MentionAgent.d.ts +96 -0
- package/dist/cjs/MentionAgent.d.ts.map +1 -0
- package/dist/cjs/MentionAgent.js +203 -0
- package/dist/cjs/MentionAgent.js.map +1 -0
- package/dist/cjs/NewsFeedAgent.d.ts +45 -0
- package/dist/cjs/NewsFeedAgent.d.ts.map +1 -1
- package/dist/cjs/NewsFeedAgent.js +99 -0
- package/dist/cjs/NewsFeedAgent.js.map +1 -1
- package/dist/cjs/ProjectAgent.d.ts +48 -0
- package/dist/cjs/ProjectAgent.d.ts.map +1 -1
- package/dist/cjs/ProjectAgent.js +102 -0
- package/dist/cjs/ProjectAgent.js.map +1 -1
- package/dist/cjs/ProjectRestApi.d.ts.map +1 -1
- package/dist/cjs/ProjectRestApi.js.map +1 -1
- package/dist/cjs/SaleAgent.d.ts +79 -0
- package/dist/cjs/SaleAgent.d.ts.map +1 -1
- package/dist/cjs/SaleAgent.js +169 -0
- package/dist/cjs/SaleAgent.js.map +1 -1
- package/dist/cjs/SaleRestApi.d.ts.map +1 -1
- package/dist/cjs/SaleRestApi.js.map +1 -1
- package/dist/cjs/WebApi.d.ts +6 -0
- package/dist/cjs/WebApi.d.ts.map +1 -1
- package/dist/cjs/WebApi.js +11 -2
- package/dist/cjs/WebApi.js.map +1 -1
- package/dist/esm/AIAgent.d.ts +4 -4
- package/dist/esm/Carriers.d.ts +625 -19
- package/dist/esm/Carriers.d.ts.map +1 -1
- package/dist/esm/ConfigurationAgent.d.ts +38 -0
- package/dist/esm/ConfigurationAgent.d.ts.map +1 -1
- package/dist/esm/ConfigurationAgent.js +91 -0
- package/dist/esm/ConfigurationAgent.js.map +1 -1
- package/dist/esm/Converters.d.ts +27 -0
- package/dist/esm/Converters.d.ts.map +1 -1
- package/dist/esm/Converters.js +360 -0
- package/dist/esm/Converters.js.map +1 -1
- package/dist/esm/DiagnosticsAgent.d.ts +5 -5
- package/dist/esm/DiagnosticsAgent.js +5 -5
- package/dist/esm/Enums.d.ts +121 -3
- package/dist/esm/Enums.d.ts.map +1 -1
- package/dist/esm/Enums.js +123 -1
- package/dist/esm/Enums.js.map +1 -1
- package/dist/esm/FreeTextAgent.d.ts +2 -2
- package/dist/esm/ImportAgent.d.ts +5 -5
- package/dist/esm/ListAgent.d.ts +31 -0
- package/dist/esm/ListAgent.d.ts.map +1 -1
- package/dist/esm/ListAgent.js +67 -0
- package/dist/esm/ListAgent.js.map +1 -1
- package/dist/esm/MentionAgent.d.ts +96 -0
- package/dist/esm/MentionAgent.d.ts.map +1 -0
- package/dist/esm/MentionAgent.js +198 -0
- package/dist/esm/MentionAgent.js.map +1 -0
- package/dist/esm/NewsFeedAgent.d.ts +45 -0
- package/dist/esm/NewsFeedAgent.d.ts.map +1 -1
- package/dist/esm/NewsFeedAgent.js +99 -0
- package/dist/esm/NewsFeedAgent.js.map +1 -1
- package/dist/esm/ProjectAgent.d.ts +48 -0
- package/dist/esm/ProjectAgent.d.ts.map +1 -1
- package/dist/esm/ProjectAgent.js +102 -0
- package/dist/esm/ProjectAgent.js.map +1 -1
- package/dist/esm/ProjectRestApi.d.ts.map +1 -1
- package/dist/esm/ProjectRestApi.js.map +1 -1
- package/dist/esm/SaleAgent.d.ts +79 -0
- package/dist/esm/SaleAgent.d.ts.map +1 -1
- package/dist/esm/SaleAgent.js +169 -0
- package/dist/esm/SaleAgent.js.map +1 -1
- package/dist/esm/SaleRestApi.d.ts.map +1 -1
- package/dist/esm/SaleRestApi.js.map +1 -1
- package/dist/esm/WebApi.d.ts +6 -0
- package/dist/esm/WebApi.d.ts.map +1 -1
- package/dist/esm/WebApi.js +9 -0
- package/dist/esm/WebApi.js.map +1 -1
- package/package.json +4 -4
- package/src/AIAgent.ts +4 -4
- package/src/Carriers.ts +821 -19
- package/src/ConfigurationAgent.ts +144 -0
- package/src/Converters.ts +418 -0
- package/src/DiagnosticsAgent.ts +5 -5
- package/src/Enums.ts +127 -1
- package/src/FreeTextAgent.ts +2 -2
- package/src/ImportAgent.ts +5 -5
- package/src/ListAgent.ts +114 -0
- package/src/MentionAgent.ts +346 -0
- package/src/NewsFeedAgent.ts +168 -0
- package/src/ProjectAgent.ts +174 -0
- package/src/ProjectRestApi.ts +2 -0
- package/src/SaleAgent.ts +288 -0
- package/src/SaleRestApi.ts +2 -0
- package/src/WebApi.ts +12 -0
package/src/ProjectAgent.ts
CHANGED
|
@@ -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.
|
package/src/ProjectRestApi.ts
CHANGED
package/src/SaleAgent.ts
CHANGED
|
@@ -49,6 +49,10 @@ export interface ISaleAgent {
|
|
|
49
49
|
offerAutoNextStageOnApppointmentCompletedAsync(appointmentId: number, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
|
|
50
50
|
getProbabilityFromStageAsync(request: carriers.Sale_GetProbabilityFromStageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
51
51
|
getProbabilityFromStageAsync(stageId: number, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
52
|
+
getExpectedSaleDateAsync(request: carriers.Sale_GetExpectedSaleDateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< Date >;
|
|
53
|
+
getExpectedSaleDateAsync(baseDate: Date, saleTypeId: number, webapi_options?:base.WebApiRequestOptions) : Promise< Date >;
|
|
54
|
+
createDefaultSaleEntityBySaleTypeIdAsync(request: carriers.Sale_CreateDefaultSaleEntityBySaleTypeIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SaleEntity >;
|
|
55
|
+
createDefaultSaleEntityBySaleTypeIdAsync(saleTypeId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SaleEntity >;
|
|
52
56
|
isNumberValidAsync(request: carriers.Sale_IsNumberValidRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
|
|
53
57
|
isNumberValidAsync(contactId: number, number: string, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
|
|
54
58
|
addSaleStakeholdersAsync(request: carriers.Sale_AddSaleStakeholdersRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
|
|
@@ -61,6 +65,12 @@ export interface ISaleAgent {
|
|
|
61
65
|
validateSaleEntityAsync(saleEntity: carriers.SaleEntity, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary >;
|
|
62
66
|
saleHasQuoteAsync(request: carriers.Sale_SaleHasQuoteRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
|
|
63
67
|
saleHasQuoteAsync(saleId: number, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
|
|
68
|
+
createSaleEntityFromExistingAsync(request: carriers.Sale_CreateSaleEntityFromExistingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SaleEntity >;
|
|
69
|
+
createSaleEntityFromExistingAsync(saleId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SaleEntity >;
|
|
70
|
+
saveSaleEntityCopyAsync(request: carriers.Sale_SaveSaleEntityCopyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SaleCopyResult >;
|
|
71
|
+
saveSaleEntityCopyAsync(saleEntity: carriers.SaleEntity, sourceSaleId: number, options: carriers.SaleCopyOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SaleCopyResult >;
|
|
72
|
+
checkSaleEntityCopyAsync(request: carriers.Sale_CheckSaleEntityCopyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SaleCopyCheck >;
|
|
73
|
+
checkSaleEntityCopyAsync(saleEntity: carriers.SaleEntity, sourceSaleId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SaleCopyCheck >;
|
|
64
74
|
getSaleListAsync(saleIds: number[]) : Promise< carriers.Sale[] >;
|
|
65
75
|
getMyOpportunitiesAsync(request: carriers.Sale_GetMyOpportunitiesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Sale[] >;
|
|
66
76
|
getMyOpportunitiesAsync(count: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Sale[] >;
|
|
@@ -685,6 +695,116 @@ export class SaleAgent extends base.WebApiBase implements ISaleAgent {
|
|
|
685
695
|
}
|
|
686
696
|
|
|
687
697
|
|
|
698
|
+
private async _getExpectedSaleDateAsync(request: carriers.Sale_GetExpectedSaleDateRequest, options?:base.WebApiRequestOptions) : Promise< Date > {
|
|
699
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
700
|
+
base.WebApiBase.SetPending(options);
|
|
701
|
+
return new Promise< Date >(async (resolve, reject) => {
|
|
702
|
+
try {
|
|
703
|
+
config.baseURL = this._options.baseUrl;
|
|
704
|
+
const response = await this._axios.post("GetExpectedSaleDate", request , config);
|
|
705
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
706
|
+
const res : Date = response.data as Date;
|
|
707
|
+
resolve(res);
|
|
708
|
+
}
|
|
709
|
+
catch( err ) {
|
|
710
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
711
|
+
reject(err);
|
|
712
|
+
}
|
|
713
|
+
});
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
|
|
717
|
+
|
|
718
|
+
/**
|
|
719
|
+
* Calculate the default expected sale date for a sale type, by applying the sale type's configured duration to a base date. This is the server-side equivalent of what the sale card does with the duration published in the SaleType list's extra info, so callers creating sales outside the GUI get the same date.
|
|
720
|
+
* @param request - BaseDate, SaleTypeId
|
|
721
|
+
* @returns The base date advanced by the sale type's expected duration
|
|
722
|
+
*/
|
|
723
|
+
public async getExpectedSaleDateAsync(request: carriers.Sale_GetExpectedSaleDateRequest, webapi_options?:base.WebApiRequestOptions) : Promise< Date >;
|
|
724
|
+
|
|
725
|
+
/**
|
|
726
|
+
* Calculate the default expected sale date for a sale type, by applying the sale type's configured duration to a base date. This is the server-side equivalent of what the sale card does with the duration published in the SaleType list's extra info, so callers creating sales outside the GUI get the same date.
|
|
727
|
+
* @param baseDate - Date to count the duration from, normally today
|
|
728
|
+
* @param saleTypeId - The sale type whose duration to apply
|
|
729
|
+
* @returns The base date advanced by the sale type's expected duration
|
|
730
|
+
*/
|
|
731
|
+
public async getExpectedSaleDateAsync(baseDate: Date, saleTypeId: number, webapi_options?:base.WebApiRequestOptions) : Promise< Date >;
|
|
732
|
+
|
|
733
|
+
public async getExpectedSaleDateAsync(baseDate:Date|carriers.Sale_GetExpectedSaleDateRequest, saleTypeId?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< Date > {
|
|
734
|
+
let _request : carriers.Sale_GetExpectedSaleDateRequest = null;
|
|
735
|
+
let _options : base.WebApiRequestOptions = null;
|
|
736
|
+
const first : any = baseDate;
|
|
737
|
+
if( typeof( first ) === "object" && first && ( typeof(first.baseDate)!='undefined' || typeof(first.saleTypeId)!='undefined' ) )
|
|
738
|
+
{
|
|
739
|
+
_request = baseDate as carriers.Sale_GetExpectedSaleDateRequest;
|
|
740
|
+
_options = saleTypeId as base.WebApiRequestOptions;
|
|
741
|
+
}
|
|
742
|
+
else
|
|
743
|
+
{
|
|
744
|
+
_request = {
|
|
745
|
+
baseDate: baseDate as Date,
|
|
746
|
+
saleTypeId: saleTypeId as number,
|
|
747
|
+
};
|
|
748
|
+
_options = webapi_options;
|
|
749
|
+
}
|
|
750
|
+
return this._getExpectedSaleDateAsync( _request, _options );
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
|
|
754
|
+
private async _createDefaultSaleEntityBySaleTypeIdAsync(request: carriers.Sale_CreateDefaultSaleEntityBySaleTypeIdRequest, options?:base.WebApiRequestOptions) : Promise< carriers.SaleEntity > {
|
|
755
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
756
|
+
base.WebApiBase.SetPending(options);
|
|
757
|
+
return new Promise< carriers.SaleEntity >(async (resolve, reject) => {
|
|
758
|
+
try {
|
|
759
|
+
config.baseURL = this._options.baseUrl;
|
|
760
|
+
const response = await this._axios.post("CreateDefaultSaleEntityBySaleTypeId", request , config);
|
|
761
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
762
|
+
const res : carriers.SaleEntity = converters.Create_SaleEntity_From( response.data );
|
|
763
|
+
resolve(res);
|
|
764
|
+
}
|
|
765
|
+
catch( err ) {
|
|
766
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
767
|
+
reject(err);
|
|
768
|
+
}
|
|
769
|
+
});
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
|
|
773
|
+
|
|
774
|
+
/**
|
|
775
|
+
* Create a new SaleEntity with default values for a given sale type, with the expected sale date already derived from that sale type's configured duration. Use this rather than CreateDefaultSaleEntity when the sale type is known up front, so the defaults are consistent with it instead of with whichever sale type happens to be the system default.
|
|
776
|
+
* @param request - SaleTypeId
|
|
777
|
+
* @returns New SaleEntity carrying defaults for the given sale type
|
|
778
|
+
*/
|
|
779
|
+
public async createDefaultSaleEntityBySaleTypeIdAsync(request: carriers.Sale_CreateDefaultSaleEntityBySaleTypeIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SaleEntity >;
|
|
780
|
+
|
|
781
|
+
/**
|
|
782
|
+
* Create a new SaleEntity with default values for a given sale type, with the expected sale date already derived from that sale type's configured duration. Use this rather than CreateDefaultSaleEntity when the sale type is known up front, so the defaults are consistent with it instead of with whichever sale type happens to be the system default.
|
|
783
|
+
* @param saleTypeId - The sale type to take defaults from
|
|
784
|
+
* @returns New SaleEntity carrying defaults for the given sale type
|
|
785
|
+
*/
|
|
786
|
+
public async createDefaultSaleEntityBySaleTypeIdAsync(saleTypeId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SaleEntity >;
|
|
787
|
+
|
|
788
|
+
public async createDefaultSaleEntityBySaleTypeIdAsync(saleTypeId:number|carriers.Sale_CreateDefaultSaleEntityBySaleTypeIdRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SaleEntity > {
|
|
789
|
+
let _request : carriers.Sale_CreateDefaultSaleEntityBySaleTypeIdRequest = null;
|
|
790
|
+
let _options : base.WebApiRequestOptions = null;
|
|
791
|
+
const first : any = saleTypeId;
|
|
792
|
+
if( typeof( first ) === "object" && first && ( typeof(first.saleTypeId)!='undefined' ) )
|
|
793
|
+
{
|
|
794
|
+
_request = saleTypeId as carriers.Sale_CreateDefaultSaleEntityBySaleTypeIdRequest;
|
|
795
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
796
|
+
}
|
|
797
|
+
else
|
|
798
|
+
{
|
|
799
|
+
_request = {
|
|
800
|
+
saleTypeId: saleTypeId as number,
|
|
801
|
+
};
|
|
802
|
+
_options = webapi_options;
|
|
803
|
+
}
|
|
804
|
+
return this._createDefaultSaleEntityBySaleTypeIdAsync( _request, _options );
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
|
|
688
808
|
private async _isNumberValidAsync(request: carriers.Sale_IsNumberValidRequest, options?:base.WebApiRequestOptions) : Promise< boolean > {
|
|
689
809
|
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
690
810
|
base.WebApiBase.SetPending(options);
|
|
@@ -1012,6 +1132,174 @@ export class SaleAgent extends base.WebApiBase implements ISaleAgent {
|
|
|
1012
1132
|
return this._saleHasQuoteAsync( _request, _options );
|
|
1013
1133
|
}
|
|
1014
1134
|
|
|
1135
|
+
|
|
1136
|
+
private async _createSaleEntityFromExistingAsync(request: carriers.Sale_CreateSaleEntityFromExistingRequest, options?:base.WebApiRequestOptions) : Promise< carriers.SaleEntity > {
|
|
1137
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1138
|
+
base.WebApiBase.SetPending(options);
|
|
1139
|
+
return new Promise< carriers.SaleEntity >(async (resolve, reject) => {
|
|
1140
|
+
try {
|
|
1141
|
+
config.baseURL = this._options.baseUrl;
|
|
1142
|
+
const response = await this._axios.post("CreateSaleEntityFromExisting", request , config);
|
|
1143
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1144
|
+
const res : carriers.SaleEntity = converters.Create_SaleEntity_From( response.data );
|
|
1145
|
+
resolve(res);
|
|
1146
|
+
}
|
|
1147
|
+
catch( err ) {
|
|
1148
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1149
|
+
reject(err);
|
|
1150
|
+
}
|
|
1151
|
+
});
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
|
|
1155
|
+
|
|
1156
|
+
/**
|
|
1157
|
+
* Create an unsaved SaleEntity copy of an existing sale, with the values that must not be carried over already stripped. The returned entity is not persisted - edit the fields the user is allowed to change, then pass it to SaveSaleEntityCopy.
|
|
1158
|
+
* @param request - SaleId
|
|
1159
|
+
* @returns Unsaved copy of the source sale, with SaleId = 0
|
|
1160
|
+
*/
|
|
1161
|
+
public async createSaleEntityFromExistingAsync(request: carriers.Sale_CreateSaleEntityFromExistingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SaleEntity >;
|
|
1162
|
+
|
|
1163
|
+
/**
|
|
1164
|
+
* Create an unsaved SaleEntity copy of an existing sale, with the values that must not be carried over already stripped. The returned entity is not persisted - edit the fields the user is allowed to change, then pass it to SaveSaleEntityCopy.
|
|
1165
|
+
* @param saleId - The id of the source sale
|
|
1166
|
+
* @returns Unsaved copy of the source sale, with SaleId = 0
|
|
1167
|
+
*/
|
|
1168
|
+
public async createSaleEntityFromExistingAsync(saleId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SaleEntity >;
|
|
1169
|
+
|
|
1170
|
+
public async createSaleEntityFromExistingAsync(saleId:number|carriers.Sale_CreateSaleEntityFromExistingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SaleEntity > {
|
|
1171
|
+
let _request : carriers.Sale_CreateSaleEntityFromExistingRequest = null;
|
|
1172
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1173
|
+
const first : any = saleId;
|
|
1174
|
+
if( typeof( first ) === "object" && first && ( typeof(first.saleId)!='undefined' ) )
|
|
1175
|
+
{
|
|
1176
|
+
_request = saleId as carriers.Sale_CreateSaleEntityFromExistingRequest;
|
|
1177
|
+
_options = webapi_options as base.WebApiRequestOptions;
|
|
1178
|
+
}
|
|
1179
|
+
else
|
|
1180
|
+
{
|
|
1181
|
+
_request = {
|
|
1182
|
+
saleId: saleId as number,
|
|
1183
|
+
};
|
|
1184
|
+
_options = webapi_options;
|
|
1185
|
+
}
|
|
1186
|
+
return this._createSaleEntityFromExistingAsync( _request, _options );
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
|
|
1190
|
+
private async _saveSaleEntityCopyAsync(request: carriers.Sale_SaveSaleEntityCopyRequest, options?:base.WebApiRequestOptions) : Promise< carriers.SaleCopyResult > {
|
|
1191
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1192
|
+
base.WebApiBase.SetPending(options);
|
|
1193
|
+
return new Promise< carriers.SaleCopyResult >(async (resolve, reject) => {
|
|
1194
|
+
try {
|
|
1195
|
+
config.baseURL = this._options.baseUrl;
|
|
1196
|
+
const response = await this._axios.post("SaveSaleEntityCopy", request , config);
|
|
1197
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1198
|
+
const res : carriers.SaleCopyResult = converters.Create_SaleCopyResult_From( response.data );
|
|
1199
|
+
resolve(res);
|
|
1200
|
+
}
|
|
1201
|
+
catch( err ) {
|
|
1202
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1203
|
+
reject(err);
|
|
1204
|
+
}
|
|
1205
|
+
});
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
|
|
1209
|
+
|
|
1210
|
+
/**
|
|
1211
|
+
* Save a sale copy prepared by CreateSaleEntityFromExisting, optionally copying parts of the source sale along with it. Those parts are read from the source sale by the server; they are not carried on the passed entity. Pass null options, or options with nothing set, to copy the sale alone.
|
|
1212
|
+
* @param request - SaleEntity, SourceSaleId, Options
|
|
1213
|
+
* @returns The new sale id, and what became of each optional part
|
|
1214
|
+
*/
|
|
1215
|
+
public async saveSaleEntityCopyAsync(request: carriers.Sale_SaveSaleEntityCopyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SaleCopyResult >;
|
|
1216
|
+
|
|
1217
|
+
/**
|
|
1218
|
+
* Save a sale copy prepared by CreateSaleEntityFromExisting, optionally copying parts of the source sale along with it. Those parts are read from the source sale by the server; they are not carried on the passed entity. Pass null options, or options with nothing set, to copy the sale alone.
|
|
1219
|
+
* @param saleEntity - The prepared copy, with SaleId = 0
|
|
1220
|
+
* @param sourceSaleId - The sale that the copy was prepared from
|
|
1221
|
+
* @param options - Which optional parts to copy alongside the sale. Null copies the sale alone.
|
|
1222
|
+
* @returns The new sale id, and what became of each optional part
|
|
1223
|
+
*/
|
|
1224
|
+
public async saveSaleEntityCopyAsync(saleEntity: carriers.SaleEntity, sourceSaleId: number, options: carriers.SaleCopyOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SaleCopyResult >;
|
|
1225
|
+
|
|
1226
|
+
public async saveSaleEntityCopyAsync(saleEntity:carriers.SaleEntity|carriers.Sale_SaveSaleEntityCopyRequest, sourceSaleId?:number|base.WebApiRequestOptions, options?:carriers.SaleCopyOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SaleCopyResult > {
|
|
1227
|
+
let _request : carriers.Sale_SaveSaleEntityCopyRequest = null;
|
|
1228
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1229
|
+
const first : any = saleEntity;
|
|
1230
|
+
if( typeof( first ) === "object" && first && ( typeof(first.saleEntity)!='undefined' || typeof(first.sourceSaleId)!='undefined' || typeof(first.options)!='undefined' ) )
|
|
1231
|
+
{
|
|
1232
|
+
_request = saleEntity as carriers.Sale_SaveSaleEntityCopyRequest;
|
|
1233
|
+
_options = sourceSaleId as base.WebApiRequestOptions;
|
|
1234
|
+
}
|
|
1235
|
+
else
|
|
1236
|
+
{
|
|
1237
|
+
_request = {
|
|
1238
|
+
saleEntity: saleEntity as carriers.SaleEntity,
|
|
1239
|
+
sourceSaleId: sourceSaleId as number,
|
|
1240
|
+
options: options as carriers.SaleCopyOptions,
|
|
1241
|
+
};
|
|
1242
|
+
_options = webapi_options;
|
|
1243
|
+
}
|
|
1244
|
+
return this._saveSaleEntityCopyAsync( _request, _options );
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
|
|
1248
|
+
private async _checkSaleEntityCopyAsync(request: carriers.Sale_CheckSaleEntityCopyRequest, options?:base.WebApiRequestOptions) : Promise< carriers.SaleCopyCheck > {
|
|
1249
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
1250
|
+
base.WebApiBase.SetPending(options);
|
|
1251
|
+
return new Promise< carriers.SaleCopyCheck >(async (resolve, reject) => {
|
|
1252
|
+
try {
|
|
1253
|
+
config.baseURL = this._options.baseUrl;
|
|
1254
|
+
const response = await this._axios.post("CheckSaleEntityCopy", request , config);
|
|
1255
|
+
base.WebApiBase.SetCompleted(options, response);
|
|
1256
|
+
const res : carriers.SaleCopyCheck = converters.Create_SaleCopyCheck_From( response.data );
|
|
1257
|
+
resolve(res);
|
|
1258
|
+
}
|
|
1259
|
+
catch( err ) {
|
|
1260
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
1261
|
+
reject(err);
|
|
1262
|
+
}
|
|
1263
|
+
});
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
|
|
1267
|
+
|
|
1268
|
+
/**
|
|
1269
|
+
* Check a sale copy before saving it: which of the optional parts of SaveSaleEntityCopy can be copied, and errors in the fields the user can edit. Nothing is saved. SaveSaleEntityCopy refuses an optional part that is reported as not licensed, or as not available for any reason other than the sale type not using stakeholders.
|
|
1270
|
+
* @param request - SaleEntity, SourceSaleId
|
|
1271
|
+
* @returns Whether each optional part can be copied, and errors in the fields the user can edit
|
|
1272
|
+
*/
|
|
1273
|
+
public async checkSaleEntityCopyAsync(request: carriers.Sale_CheckSaleEntityCopyRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SaleCopyCheck >;
|
|
1274
|
+
|
|
1275
|
+
/**
|
|
1276
|
+
* Check a sale copy before saving it: which of the optional parts of SaveSaleEntityCopy can be copied, and errors in the fields the user can edit. Nothing is saved. SaveSaleEntityCopy refuses an optional part that is reported as not licensed, or as not available for any reason other than the sale type not using stakeholders.
|
|
1277
|
+
* @param saleEntity - The prepared copy as the user has edited it. Null checks the copy as CreateSaleEntityFromExisting prepares it.
|
|
1278
|
+
* @param sourceSaleId - The sale that the copy is prepared from
|
|
1279
|
+
* @returns Whether each optional part can be copied, and errors in the fields the user can edit
|
|
1280
|
+
*/
|
|
1281
|
+
public async checkSaleEntityCopyAsync(saleEntity: carriers.SaleEntity, sourceSaleId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SaleCopyCheck >;
|
|
1282
|
+
|
|
1283
|
+
public async checkSaleEntityCopyAsync(saleEntity:carriers.SaleEntity|carriers.Sale_CheckSaleEntityCopyRequest, sourceSaleId?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SaleCopyCheck > {
|
|
1284
|
+
let _request : carriers.Sale_CheckSaleEntityCopyRequest = null;
|
|
1285
|
+
let _options : base.WebApiRequestOptions = null;
|
|
1286
|
+
const first : any = saleEntity;
|
|
1287
|
+
if( typeof( first ) === "object" && first && ( typeof(first.saleEntity)!='undefined' || typeof(first.sourceSaleId)!='undefined' ) )
|
|
1288
|
+
{
|
|
1289
|
+
_request = saleEntity as carriers.Sale_CheckSaleEntityCopyRequest;
|
|
1290
|
+
_options = sourceSaleId as base.WebApiRequestOptions;
|
|
1291
|
+
}
|
|
1292
|
+
else
|
|
1293
|
+
{
|
|
1294
|
+
_request = {
|
|
1295
|
+
saleEntity: saleEntity as carriers.SaleEntity,
|
|
1296
|
+
sourceSaleId: sourceSaleId as number,
|
|
1297
|
+
};
|
|
1298
|
+
_options = webapi_options;
|
|
1299
|
+
}
|
|
1300
|
+
return this._checkSaleEntityCopyAsync( _request, _options );
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1015
1303
|
/**
|
|
1016
1304
|
* Gets an array of Sale objects.
|
|
1017
1305
|
* @param saleIds - The primary keys.
|
package/src/SaleRestApi.ts
CHANGED
package/src/WebApi.ts
CHANGED
|
@@ -113,6 +113,8 @@ import { ITargetsAgent, TargetsAgent } from './TargetsAgent';
|
|
|
113
113
|
export { TargetsAgent };
|
|
114
114
|
import { IFavouriteAgent, FavouriteAgent } from './FavouriteAgent';
|
|
115
115
|
export { FavouriteAgent };
|
|
116
|
+
import { IMentionAgent, MentionAgent } from './MentionAgent';
|
|
117
|
+
export { MentionAgent };
|
|
116
118
|
import { IDatabaseAgent, DatabaseAgent } from './DatabaseAgent';
|
|
117
119
|
export { DatabaseAgent };
|
|
118
120
|
import { IBulkUpdateAgent, BulkUpdateAgent } from './BulkUpdateAgent';
|
|
@@ -281,6 +283,8 @@ export interface IAgentsApi extends base.WebApiBase {
|
|
|
281
283
|
getTargetsAgent(resourceParsing?: base.ResourceParsing) : ITargetsAgent;
|
|
282
284
|
/** Agent used for retrieveing and setting favourites */
|
|
283
285
|
getFavouriteAgent(resourceParsing?: base.ResourceParsing) : IFavouriteAgent;
|
|
286
|
+
/** Agent used for getting, marking read, and deleting @-mentions */
|
|
287
|
+
getMentionAgent(resourceParsing?: base.ResourceParsing) : IMentionAgent;
|
|
284
288
|
/** Database schema queries and changes */
|
|
285
289
|
getDatabaseAgent(resourceParsing?: base.ResourceParsing) : IDatabaseAgent;
|
|
286
290
|
/** Agent used for bulk update methods */
|
|
@@ -795,6 +799,14 @@ export class WebApi extends base.WebApiBase implements IAgentsApi, IRestApi {
|
|
|
795
799
|
return new FavouriteAgent( options );
|
|
796
800
|
}
|
|
797
801
|
|
|
802
|
+
/** Agent used for getting, marking read, and deleting @-mentions */
|
|
803
|
+
public getMentionAgent(resourceParsing?: base.ResourceParsing) : IMentionAgent {
|
|
804
|
+
const options = base.WebApiBase.FigureOutOptions(this._options);
|
|
805
|
+
if( typeof(resourceParsing) == "number" )
|
|
806
|
+
options.resourceParsing = resourceParsing;
|
|
807
|
+
return new MentionAgent( options );
|
|
808
|
+
}
|
|
809
|
+
|
|
798
810
|
/** Database schema queries and changes */
|
|
799
811
|
public getDatabaseAgent(resourceParsing?: base.ResourceParsing) : IDatabaseAgent {
|
|
800
812
|
const options = base.WebApiBase.FigureOutOptions(this._options);
|