@superoffice/webapi 10.5.4 → 10.5.5

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 (198) hide show
  1. package/dist/cjs/AIAgent.d.ts +16 -0
  2. package/dist/cjs/AIAgent.d.ts.map +1 -1
  3. package/dist/cjs/AIAgent.js +34 -0
  4. package/dist/cjs/AIAgent.js.map +1 -1
  5. package/dist/cjs/AppointmentAgent.d.ts +117 -0
  6. package/dist/cjs/AppointmentAgent.d.ts.map +1 -1
  7. package/dist/cjs/AppointmentAgent.js +242 -0
  8. package/dist/cjs/AppointmentAgent.js.map +1 -1
  9. package/dist/cjs/CRMScriptAgent.d.ts +31 -0
  10. package/dist/cjs/CRMScriptAgent.d.ts.map +1 -1
  11. package/dist/cjs/CRMScriptAgent.js +67 -0
  12. package/dist/cjs/CRMScriptAgent.js.map +1 -1
  13. package/dist/cjs/Carriers.d.ts +1289 -31
  14. package/dist/cjs/Carriers.d.ts.map +1 -1
  15. package/dist/cjs/Converters.d.ts +30 -0
  16. package/dist/cjs/Converters.d.ts.map +1 -1
  17. package/dist/cjs/Converters.js +635 -30
  18. package/dist/cjs/Converters.js.map +1 -1
  19. package/dist/cjs/CustomerServiceAgent.d.ts +30 -0
  20. package/dist/cjs/CustomerServiceAgent.d.ts.map +1 -1
  21. package/dist/cjs/CustomerServiceAgent.js +66 -0
  22. package/dist/cjs/CustomerServiceAgent.js.map +1 -1
  23. package/dist/cjs/DiagnosticsAgent.d.ts +105 -0
  24. package/dist/cjs/DiagnosticsAgent.d.ts.map +1 -1
  25. package/dist/cjs/DiagnosticsAgent.js +229 -0
  26. package/dist/cjs/DiagnosticsAgent.js.map +1 -1
  27. package/dist/cjs/DocumentAgent.d.ts +17 -0
  28. package/dist/cjs/DocumentAgent.d.ts.map +1 -1
  29. package/dist/cjs/DocumentAgent.js +36 -0
  30. package/dist/cjs/DocumentAgent.js.map +1 -1
  31. package/dist/cjs/DocumentMigrationAgent.d.ts +7 -0
  32. package/dist/cjs/DocumentMigrationAgent.d.ts.map +1 -1
  33. package/dist/cjs/DocumentMigrationAgent.js +24 -0
  34. package/dist/cjs/DocumentMigrationAgent.js.map +1 -1
  35. package/dist/cjs/EMailAgent.d.ts +33 -0
  36. package/dist/cjs/EMailAgent.d.ts.map +1 -1
  37. package/dist/cjs/EMailAgent.js +69 -0
  38. package/dist/cjs/EMailAgent.js.map +1 -1
  39. package/dist/cjs/Enums.d.ts +299 -5
  40. package/dist/cjs/Enums.d.ts.map +1 -1
  41. package/dist/cjs/Enums.js +309 -4
  42. package/dist/cjs/Enums.js.map +1 -1
  43. package/dist/cjs/LicenseAgent.d.ts +15 -0
  44. package/dist/cjs/LicenseAgent.d.ts.map +1 -1
  45. package/dist/cjs/LicenseAgent.js +33 -0
  46. package/dist/cjs/LicenseAgent.js.map +1 -1
  47. package/dist/cjs/ListAgent.d.ts +23 -22
  48. package/dist/cjs/ListAgent.d.ts.map +1 -1
  49. package/dist/cjs/ListAgent.js +36 -48
  50. package/dist/cjs/ListAgent.js.map +1 -1
  51. package/dist/cjs/MDOAgent.d.ts +1 -1
  52. package/dist/cjs/MarketingAgent.d.ts +31 -0
  53. package/dist/cjs/MarketingAgent.d.ts.map +1 -1
  54. package/dist/cjs/MarketingAgent.js +67 -0
  55. package/dist/cjs/MarketingAgent.js.map +1 -1
  56. package/dist/cjs/PersonAgent.d.ts +35 -0
  57. package/dist/cjs/PersonAgent.d.ts.map +1 -1
  58. package/dist/cjs/PersonAgent.js +71 -0
  59. package/dist/cjs/PersonAgent.js.map +1 -1
  60. package/dist/cjs/ProjectAgent.d.ts +16 -0
  61. package/dist/cjs/ProjectAgent.d.ts.map +1 -1
  62. package/dist/cjs/ProjectAgent.js +34 -0
  63. package/dist/cjs/ProjectAgent.js.map +1 -1
  64. package/dist/cjs/QuoteAgent.d.ts +16 -0
  65. package/dist/cjs/QuoteAgent.d.ts.map +1 -1
  66. package/dist/cjs/QuoteAgent.js +34 -0
  67. package/dist/cjs/QuoteAgent.js.map +1 -1
  68. package/dist/cjs/SaleAgent.d.ts +47 -0
  69. package/dist/cjs/SaleAgent.d.ts.map +1 -1
  70. package/dist/cjs/SaleAgent.js +101 -0
  71. package/dist/cjs/SaleAgent.js.map +1 -1
  72. package/dist/cjs/SelectionAgent.d.ts +15 -7
  73. package/dist/cjs/SelectionAgent.d.ts.map +1 -1
  74. package/dist/cjs/SelectionAgent.js +33 -21
  75. package/dist/cjs/SelectionAgent.js.map +1 -1
  76. package/dist/cjs/SentryAgent.d.ts +15 -0
  77. package/dist/cjs/SentryAgent.d.ts.map +1 -1
  78. package/dist/cjs/SentryAgent.js +33 -0
  79. package/dist/cjs/SentryAgent.js.map +1 -1
  80. package/dist/cjs/TicketAgent.d.ts +117 -2
  81. package/dist/cjs/TicketAgent.d.ts.map +1 -1
  82. package/dist/cjs/TicketAgent.js +255 -0
  83. package/dist/cjs/TicketAgent.js.map +1 -1
  84. package/dist/cjs/WorkflowAgent.d.ts +80 -2
  85. package/dist/cjs/WorkflowAgent.d.ts.map +1 -1
  86. package/dist/cjs/WorkflowAgent.js +188 -0
  87. package/dist/cjs/WorkflowAgent.js.map +1 -1
  88. package/dist/esm/AIAgent.d.ts +16 -0
  89. package/dist/esm/AIAgent.d.ts.map +1 -1
  90. package/dist/esm/AIAgent.js +34 -0
  91. package/dist/esm/AIAgent.js.map +1 -1
  92. package/dist/esm/AppointmentAgent.d.ts +117 -0
  93. package/dist/esm/AppointmentAgent.d.ts.map +1 -1
  94. package/dist/esm/AppointmentAgent.js +242 -0
  95. package/dist/esm/AppointmentAgent.js.map +1 -1
  96. package/dist/esm/CRMScriptAgent.d.ts +31 -0
  97. package/dist/esm/CRMScriptAgent.d.ts.map +1 -1
  98. package/dist/esm/CRMScriptAgent.js +67 -0
  99. package/dist/esm/CRMScriptAgent.js.map +1 -1
  100. package/dist/esm/Carriers.d.ts +1289 -31
  101. package/dist/esm/Carriers.d.ts.map +1 -1
  102. package/dist/esm/Converters.d.ts +30 -0
  103. package/dist/esm/Converters.d.ts.map +1 -1
  104. package/dist/esm/Converters.js +582 -8
  105. package/dist/esm/Converters.js.map +1 -1
  106. package/dist/esm/CustomerServiceAgent.d.ts +30 -0
  107. package/dist/esm/CustomerServiceAgent.d.ts.map +1 -1
  108. package/dist/esm/CustomerServiceAgent.js +66 -0
  109. package/dist/esm/CustomerServiceAgent.js.map +1 -1
  110. package/dist/esm/DiagnosticsAgent.d.ts +105 -0
  111. package/dist/esm/DiagnosticsAgent.d.ts.map +1 -1
  112. package/dist/esm/DiagnosticsAgent.js +229 -0
  113. package/dist/esm/DiagnosticsAgent.js.map +1 -1
  114. package/dist/esm/DocumentAgent.d.ts +17 -0
  115. package/dist/esm/DocumentAgent.d.ts.map +1 -1
  116. package/dist/esm/DocumentAgent.js +36 -0
  117. package/dist/esm/DocumentAgent.js.map +1 -1
  118. package/dist/esm/DocumentMigrationAgent.d.ts +7 -0
  119. package/dist/esm/DocumentMigrationAgent.d.ts.map +1 -1
  120. package/dist/esm/DocumentMigrationAgent.js +24 -0
  121. package/dist/esm/DocumentMigrationAgent.js.map +1 -1
  122. package/dist/esm/EMailAgent.d.ts +33 -0
  123. package/dist/esm/EMailAgent.d.ts.map +1 -1
  124. package/dist/esm/EMailAgent.js +69 -0
  125. package/dist/esm/EMailAgent.js.map +1 -1
  126. package/dist/esm/Enums.d.ts +299 -5
  127. package/dist/esm/Enums.d.ts.map +1 -1
  128. package/dist/esm/Enums.js +305 -0
  129. package/dist/esm/Enums.js.map +1 -1
  130. package/dist/esm/LicenseAgent.d.ts +15 -0
  131. package/dist/esm/LicenseAgent.d.ts.map +1 -1
  132. package/dist/esm/LicenseAgent.js +33 -0
  133. package/dist/esm/LicenseAgent.js.map +1 -1
  134. package/dist/esm/ListAgent.d.ts +23 -22
  135. package/dist/esm/ListAgent.d.ts.map +1 -1
  136. package/dist/esm/ListAgent.js +36 -48
  137. package/dist/esm/ListAgent.js.map +1 -1
  138. package/dist/esm/MDOAgent.d.ts +1 -1
  139. package/dist/esm/MarketingAgent.d.ts +31 -0
  140. package/dist/esm/MarketingAgent.d.ts.map +1 -1
  141. package/dist/esm/MarketingAgent.js +67 -0
  142. package/dist/esm/MarketingAgent.js.map +1 -1
  143. package/dist/esm/PersonAgent.d.ts +35 -0
  144. package/dist/esm/PersonAgent.d.ts.map +1 -1
  145. package/dist/esm/PersonAgent.js +71 -0
  146. package/dist/esm/PersonAgent.js.map +1 -1
  147. package/dist/esm/ProjectAgent.d.ts +16 -0
  148. package/dist/esm/ProjectAgent.d.ts.map +1 -1
  149. package/dist/esm/ProjectAgent.js +34 -0
  150. package/dist/esm/ProjectAgent.js.map +1 -1
  151. package/dist/esm/QuoteAgent.d.ts +16 -0
  152. package/dist/esm/QuoteAgent.d.ts.map +1 -1
  153. package/dist/esm/QuoteAgent.js +34 -0
  154. package/dist/esm/QuoteAgent.js.map +1 -1
  155. package/dist/esm/SaleAgent.d.ts +47 -0
  156. package/dist/esm/SaleAgent.d.ts.map +1 -1
  157. package/dist/esm/SaleAgent.js +101 -0
  158. package/dist/esm/SaleAgent.js.map +1 -1
  159. package/dist/esm/SelectionAgent.d.ts +15 -7
  160. package/dist/esm/SelectionAgent.d.ts.map +1 -1
  161. package/dist/esm/SelectionAgent.js +33 -21
  162. package/dist/esm/SelectionAgent.js.map +1 -1
  163. package/dist/esm/SentryAgent.d.ts +15 -0
  164. package/dist/esm/SentryAgent.d.ts.map +1 -1
  165. package/dist/esm/SentryAgent.js +33 -0
  166. package/dist/esm/SentryAgent.js.map +1 -1
  167. package/dist/esm/TicketAgent.d.ts +117 -2
  168. package/dist/esm/TicketAgent.d.ts.map +1 -1
  169. package/dist/esm/TicketAgent.js +255 -0
  170. package/dist/esm/TicketAgent.js.map +1 -1
  171. package/dist/esm/WorkflowAgent.d.ts +80 -2
  172. package/dist/esm/WorkflowAgent.d.ts.map +1 -1
  173. package/dist/esm/WorkflowAgent.js +188 -0
  174. package/dist/esm/WorkflowAgent.js.map +1 -1
  175. package/package.json +5 -6
  176. package/src/AIAgent.ts +58 -0
  177. package/src/AppointmentAgent.ts +406 -0
  178. package/src/CRMScriptAgent.ts +114 -0
  179. package/src/Carriers.ts +1667 -34
  180. package/src/Converters.ts +677 -9
  181. package/src/CustomerServiceAgent.ts +112 -0
  182. package/src/DiagnosticsAgent.ts +380 -0
  183. package/src/DocumentAgent.ts +61 -0
  184. package/src/DocumentMigrationAgent.ts +30 -0
  185. package/src/EMailAgent.ts +118 -0
  186. package/src/Enums.ts +316 -0
  187. package/src/LicenseAgent.ts +56 -0
  188. package/src/ListAgent.ts +69 -65
  189. package/src/MDOAgent.ts +1 -1
  190. package/src/MarketingAgent.ts +114 -0
  191. package/src/PersonAgent.ts +122 -0
  192. package/src/ProjectAgent.ts +58 -0
  193. package/src/QuoteAgent.ts +58 -0
  194. package/src/SaleAgent.ts +172 -0
  195. package/src/SelectionAgent.ts +56 -23
  196. package/src/SentryAgent.ts +56 -0
  197. package/src/TicketAgent.ts +432 -2
  198. package/src/WorkflowAgent.ts +268 -2
package/src/QuoteAgent.ts CHANGED
@@ -150,6 +150,8 @@ export interface IQuoteAgent {
150
150
  saveQuoteLineImageAsync(quoteLineId: number, image: ArrayBuffer|string, rank: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
151
151
  getExtraInfoAsync(request: carriers.Quote_GetExtraInfoRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ProductExtraDataField[] >;
152
152
  getExtraInfoAsync(quoteLineExtraData: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ProductExtraDataField[] >;
153
+ createAndSaveQuoteLinesAsync(request: carriers.Quote_CreateAndSaveQuoteLinesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
154
+ createAndSaveQuoteLinesAsync(quoteAlternativeId: number, erpProductKeys: string[], webapi_options?:base.WebApiRequestOptions) : Promise< number >;
153
155
  getQuoteLineConfigurationAsync(request: carriers.Quote_GetQuoteLineConfigurationRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.QuoteLineConfiguration >;
154
156
  getQuoteLineConfigurationAsync(quoteLineConfigurationId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.QuoteLineConfiguration >;
155
157
  getQuoteLineConfigurationFromFieldNameAsync(request: carriers.Quote_GetQuoteLineConfigurationFromFieldNameRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.QuoteLineConfiguration >;
@@ -3616,6 +3618,62 @@ export class QuoteAgent extends base.WebApiBase implements IQuoteAgent {
3616
3618
  }
3617
3619
 
3618
3620
 
3621
+ private async _createAndSaveQuoteLinesAsync(request: carriers.Quote_CreateAndSaveQuoteLinesRequest, options?:base.WebApiRequestOptions) : Promise< number > {
3622
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
3623
+ base.WebApiBase.SetPending(options);
3624
+ return new Promise< number >(async (resolve, reject) => {
3625
+ try {
3626
+ config.baseURL = this._options.baseUrl;
3627
+ const response = await this._axios.post("CreateAndSaveQuoteLines", request , config);
3628
+ base.WebApiBase.SetCompleted(options);
3629
+ const res : number = response.data as number;
3630
+ resolve(res);
3631
+ }
3632
+ catch( err ) {
3633
+ base.WebApiBase.HandleError(options, config, err);
3634
+ reject(err);
3635
+ }
3636
+ });
3637
+ }
3638
+
3639
+
3640
+
3641
+ /**
3642
+ * Create and save quotelines based on the product keys added
3643
+ * @param request - QuoteAlternativeId, ErpProductKeys
3644
+ * @returns Count of added quoteLines
3645
+ */
3646
+ public async createAndSaveQuoteLinesAsync(request: carriers.Quote_CreateAndSaveQuoteLinesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
3647
+
3648
+ /**
3649
+ * Create and save quotelines based on the product keys added
3650
+ * @param quoteAlternativeId - Primary key of the alternative
3651
+ * @param erpProductKeys - Array of the product keys to add
3652
+ * @returns Count of added quoteLines
3653
+ */
3654
+ public async createAndSaveQuoteLinesAsync(quoteAlternativeId: number, erpProductKeys: string[], webapi_options?:base.WebApiRequestOptions) : Promise< number >;
3655
+
3656
+ public async createAndSaveQuoteLinesAsync(quoteAlternativeId:number|carriers.Quote_CreateAndSaveQuoteLinesRequest, erpProductKeys?:string[]|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< number > {
3657
+ let _request : carriers.Quote_CreateAndSaveQuoteLinesRequest = null;
3658
+ let _options : base.WebApiRequestOptions = null;
3659
+ const first : any = quoteAlternativeId;
3660
+ if( typeof( first ) === "object" && first && ( typeof(first.quoteAlternativeId)!='undefined' || typeof(first.erpProductKeys)!='undefined' ) )
3661
+ {
3662
+ _request = quoteAlternativeId as carriers.Quote_CreateAndSaveQuoteLinesRequest;
3663
+ _options = erpProductKeys as base.WebApiRequestOptions;
3664
+ }
3665
+ else
3666
+ {
3667
+ _request = {
3668
+ quoteAlternativeId: quoteAlternativeId as number,
3669
+ erpProductKeys: erpProductKeys as string[],
3670
+ };
3671
+ _options = webapi_options;
3672
+ }
3673
+ return this._createAndSaveQuoteLinesAsync( _request, _options );
3674
+ }
3675
+
3676
+
3619
3677
  private async _getQuoteLineConfigurationAsync(request: carriers.Quote_GetQuoteLineConfigurationRequest, options?:base.WebApiRequestOptions) : Promise< carriers.QuoteLineConfiguration > {
3620
3678
  const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
3621
3679
  base.WebApiBase.SetPending(options);
package/src/SaleAgent.ts CHANGED
@@ -59,6 +59,8 @@ export interface ISaleAgent {
59
59
  hasStakeholderSettingAsync(saleId: number, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
60
60
  validateSaleEntityAsync(request: carriers.Sale_ValidateSaleEntityRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary >;
61
61
  validateSaleEntityAsync(saleEntity: carriers.SaleEntity, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary >;
62
+ saleHasQuoteAsync(request: carriers.Sale_SaleHasQuoteRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
63
+ saleHasQuoteAsync(saleId: number, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
62
64
  getSaleListAsync(saleIds: number[]) : Promise< carriers.Sale[] >;
63
65
  getMyOpportunitiesAsync(request: carriers.Sale_GetMyOpportunitiesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Sale[] >;
64
66
  getMyOpportunitiesAsync(count: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Sale[] >;
@@ -72,8 +74,12 @@ export interface ISaleAgent {
72
74
  getOpenSalesForContactAsync(contactId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Sale[] >;
73
75
  setAsSoldAsync(request: carriers.Sale_SetAsSoldRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
74
76
  setAsSoldAsync(saleIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
77
+ setAsSoldWithReasonAsync(request: carriers.Sale_SetAsSoldWithReasonRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
78
+ setAsSoldWithReasonAsync(saleIds: number[], reasonId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
75
79
  setAsLostAsync(request: carriers.Sale_SetAsLostRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
76
80
  setAsLostAsync(saleIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< void >;
81
+ setAsLostWithReasonAsync(request: carriers.Sale_SetAsLostWithReasonRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
82
+ setAsLostWithReasonAsync(saleIds: number[], reasonId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
77
83
  getSalesFromContactAsync(request: carriers.Sale_GetSalesFromContactRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Sale[] >;
78
84
  getSalesFromContactAsync(contactId: number, onlyOpenSales: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Sale[] >;
79
85
  getSalesFromPersonAsync(request: carriers.Sale_GetSalesFromPersonRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Sale[] >;
@@ -952,6 +958,60 @@ export class SaleAgent extends base.WebApiBase implements ISaleAgent {
952
958
  return this._validateSaleEntityAsync( _request, _options );
953
959
  }
954
960
 
961
+
962
+ private async _saleHasQuoteAsync(request: carriers.Sale_SaleHasQuoteRequest, options?:base.WebApiRequestOptions) : Promise< boolean > {
963
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
964
+ base.WebApiBase.SetPending(options);
965
+ return new Promise< boolean >(async (resolve, reject) => {
966
+ try {
967
+ config.baseURL = this._options.baseUrl;
968
+ const response = await this._axios.post("SaleHasQuote", request , config);
969
+ base.WebApiBase.SetCompleted(options);
970
+ const res : boolean = response.data as boolean;
971
+ resolve(res);
972
+ }
973
+ catch( err ) {
974
+ base.WebApiBase.HandleError(options, config, err);
975
+ reject(err);
976
+ }
977
+ });
978
+ }
979
+
980
+
981
+
982
+ /**
983
+ * Returns true is the sale has a quote
984
+ * @param request - SaleId
985
+ * @returns True if the sale has a quote
986
+ */
987
+ public async saleHasQuoteAsync(request: carriers.Sale_SaleHasQuoteRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
988
+
989
+ /**
990
+ * Returns true is the sale has a quote
991
+ * @param saleId - The id of the sale
992
+ * @returns True if the sale has a quote
993
+ */
994
+ public async saleHasQuoteAsync(saleId: number, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
995
+
996
+ public async saleHasQuoteAsync(saleId:number|carriers.Sale_SaleHasQuoteRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean > {
997
+ let _request : carriers.Sale_SaleHasQuoteRequest = null;
998
+ let _options : base.WebApiRequestOptions = null;
999
+ const first : any = saleId;
1000
+ if( typeof( first ) === "object" && first && ( typeof(first.saleId)!='undefined' ) )
1001
+ {
1002
+ _request = saleId as carriers.Sale_SaleHasQuoteRequest;
1003
+ _options = webapi_options as base.WebApiRequestOptions;
1004
+ }
1005
+ else
1006
+ {
1007
+ _request = {
1008
+ saleId: saleId as number,
1009
+ };
1010
+ _options = webapi_options;
1011
+ }
1012
+ return this._saleHasQuoteAsync( _request, _options );
1013
+ }
1014
+
955
1015
  /**
956
1016
  * Gets an array of Sale objects.
957
1017
  * @param saleIds - The primary keys.
@@ -1310,6 +1370,62 @@ export class SaleAgent extends base.WebApiBase implements ISaleAgent {
1310
1370
  }
1311
1371
 
1312
1372
 
1373
+ private async _setAsSoldWithReasonAsync(request: carriers.Sale_SetAsSoldWithReasonRequest, options?:base.WebApiRequestOptions) : Promise< void > {
1374
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1375
+ base.WebApiBase.SetPending(options);
1376
+ return new Promise< void >(async (resolve, reject) => {
1377
+ try {
1378
+ config.baseURL = this._options.baseUrl;
1379
+ const response = await this._axios.post("SetAsSoldWithReason", request , config);
1380
+ base.WebApiBase.SetCompleted(options);
1381
+ const res = response.data;
1382
+ resolve(res);
1383
+ }
1384
+ catch( err ) {
1385
+ base.WebApiBase.HandleError(options, config, err);
1386
+ reject(err);
1387
+ }
1388
+ });
1389
+ }
1390
+
1391
+
1392
+
1393
+ /**
1394
+ * Change the status of one or more Sales to Sold. Note that this does not mark them as Completed.
1395
+ * @param request - SaleIds, ReasonId
1396
+ * @returns
1397
+ */
1398
+ public async setAsSoldWithReasonAsync(request: carriers.Sale_SetAsSoldWithReasonRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1399
+
1400
+ /**
1401
+ * Change the status of one or more Sales to Sold. Note that this does not mark them as Completed.
1402
+ * @param saleIds - Array of sale ids to be marked as lost. All the normal write access rules apply.
1403
+ * @param reasonId - The ID of the sold reason.
1404
+ * @returns
1405
+ */
1406
+ public async setAsSoldWithReasonAsync(saleIds: number[], reasonId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1407
+
1408
+ public async setAsSoldWithReasonAsync(saleIds:number[]|carriers.Sale_SetAsSoldWithReasonRequest, reasonId?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
1409
+ let _request : carriers.Sale_SetAsSoldWithReasonRequest = null;
1410
+ let _options : base.WebApiRequestOptions = null;
1411
+ const first : any = saleIds;
1412
+ if( typeof( first ) === "object" && first && ( typeof(first.saleIds)!='undefined' || typeof(first.reasonId)!='undefined' ) )
1413
+ {
1414
+ _request = saleIds as carriers.Sale_SetAsSoldWithReasonRequest;
1415
+ _options = reasonId as base.WebApiRequestOptions;
1416
+ }
1417
+ else
1418
+ {
1419
+ _request = {
1420
+ saleIds: saleIds as number[],
1421
+ reasonId: reasonId as number,
1422
+ };
1423
+ _options = webapi_options;
1424
+ }
1425
+ return this._setAsSoldWithReasonAsync( _request, _options );
1426
+ }
1427
+
1428
+
1313
1429
  private async _setAsLostAsync(request: carriers.Sale_SetAsLostRequest, options?:base.WebApiRequestOptions) : Promise< void > {
1314
1430
  const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1315
1431
  base.WebApiBase.SetPending(options);
@@ -1364,6 +1480,62 @@ export class SaleAgent extends base.WebApiBase implements ISaleAgent {
1364
1480
  }
1365
1481
 
1366
1482
 
1483
+ private async _setAsLostWithReasonAsync(request: carriers.Sale_SetAsLostWithReasonRequest, options?:base.WebApiRequestOptions) : Promise< void > {
1484
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1485
+ base.WebApiBase.SetPending(options);
1486
+ return new Promise< void >(async (resolve, reject) => {
1487
+ try {
1488
+ config.baseURL = this._options.baseUrl;
1489
+ const response = await this._axios.post("SetAsLostWithReason", request , config);
1490
+ base.WebApiBase.SetCompleted(options);
1491
+ const res = response.data;
1492
+ resolve(res);
1493
+ }
1494
+ catch( err ) {
1495
+ base.WebApiBase.HandleError(options, config, err);
1496
+ reject(err);
1497
+ }
1498
+ });
1499
+ }
1500
+
1501
+
1502
+
1503
+ /**
1504
+ * Change the status of one or more sales to Lost. Note that this does not affect the Completed state of the sale.
1505
+ * @param request - SaleIds, ReasonId
1506
+ * @returns
1507
+ */
1508
+ public async setAsLostWithReasonAsync(request: carriers.Sale_SetAsLostWithReasonRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1509
+
1510
+ /**
1511
+ * Change the status of one or more sales to Lost. Note that this does not affect the Completed state of the sale.
1512
+ * @param saleIds - Array of sale ids to be marked as lost. All normal write access rules apply.
1513
+ * @param reasonId - The ID of the lost reason.
1514
+ * @returns
1515
+ */
1516
+ public async setAsLostWithReasonAsync(saleIds: number[], reasonId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
1517
+
1518
+ public async setAsLostWithReasonAsync(saleIds:number[]|carriers.Sale_SetAsLostWithReasonRequest, reasonId?:number|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
1519
+ let _request : carriers.Sale_SetAsLostWithReasonRequest = null;
1520
+ let _options : base.WebApiRequestOptions = null;
1521
+ const first : any = saleIds;
1522
+ if( typeof( first ) === "object" && first && ( typeof(first.saleIds)!='undefined' || typeof(first.reasonId)!='undefined' ) )
1523
+ {
1524
+ _request = saleIds as carriers.Sale_SetAsLostWithReasonRequest;
1525
+ _options = reasonId as base.WebApiRequestOptions;
1526
+ }
1527
+ else
1528
+ {
1529
+ _request = {
1530
+ saleIds: saleIds as number[],
1531
+ reasonId: reasonId as number,
1532
+ };
1533
+ _options = webapi_options;
1534
+ }
1535
+ return this._setAsLostWithReasonAsync( _request, _options );
1536
+ }
1537
+
1538
+
1367
1539
  private async _getSalesFromContactAsync(request: carriers.Sale_GetSalesFromContactRequest, options?:base.WebApiRequestOptions) : Promise< carriers.Sale[] > {
1368
1540
  const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1369
1541
  base.WebApiBase.SetPending(options);
@@ -31,7 +31,6 @@ export interface ISelectionAgent {
31
31
  createDefaultMailMergeTaskAsync(): Promise< carriers.MailMergeTask >;
32
32
  createDefaultSelectionEntityAsync(): Promise< carriers.SelectionEntity >;
33
33
  saveSelectionEntityAsync(entity: carriers.SelectionEntity) : Promise< carriers.SelectionEntity >;
34
- deleteSelectionEntityAsync(SelectionEntityId: number) : Promise<void>;
35
34
  getSelectionEntityAsync(selectionEntityId: number) : Promise< carriers.SelectionEntity >;
36
35
  createSelectionEntityAsync(request: carriers.Selection_CreateSelectionEntityRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectionEntity >;
37
36
  createSelectionEntityAsync(targetTableName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectionEntity >;
@@ -123,6 +122,8 @@ export interface ISelectionAgent {
123
122
  getDynamicSelectionCriteriaGroupsAsync(selectionId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ArchiveRestrictionGroup[] >;
124
123
  setDynamicSelectionCriteriaGroupsAsync(request: carriers.Selection_SetDynamicSelectionCriteriaGroupsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ArchiveRestrictionGroup[] >;
125
124
  setDynamicSelectionCriteriaGroupsAsync(selectionId: number, criteria: carriers.ArchiveRestrictionGroup[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ArchiveRestrictionGroup[] >;
125
+ deleteSelectionEntityAsync(request: carriers.Selection_DeleteSelectionEntityRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
126
+ deleteSelectionEntityAsync(selectionEntityId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
126
127
  getSelectionForFindAsync(request: carriers.Selection_GetSelectionForFindRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectionForFind >;
127
128
  getSelectionForFindAsync(entityName: string, typicalSearchId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectionForFind >;
128
129
  getSelectionSummariesAsync(request: carriers.Selection_GetSelectionSummariesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.SelectionSummaryItem[] >;
@@ -248,28 +249,6 @@ export class SelectionAgent extends base.WebApiBase implements ISelectionAgent {
248
249
  }
249
250
  });
250
251
  }
251
-
252
- /**
253
- * Deletes the SelectionEntity
254
- * @param SelectionEntityId - The id of the SelectionEntity to be deleted.
255
- * @param options - Override language/culture codes on this request. Provide cancellation and request status values.
256
- */
257
- public async deleteSelectionEntityAsync(SelectionEntityId: number, options?:base.WebApiRequestOptions) : Promise< void > {
258
- const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
259
- base.WebApiBase.SetPending(options);
260
- return new Promise< void >(async (resolve, reject) => {
261
- try {
262
- const response = await this._axios.post("DeleteSelectionEntity?SelectionEntityId=" + SelectionEntityId, null, config );
263
- base.WebApiBase.SetCompleted(options);
264
- const res = response.data;
265
- resolve(res);
266
- }
267
- catch( err ) {
268
- base.WebApiBase.HandleError(options, config, err);
269
- reject(err);
270
- }
271
- });
272
- }
273
252
  /**
274
253
  * Gets a SelectionEntity object.
275
254
  * @param selectionEntityId - The primary key.
@@ -2812,6 +2791,60 @@ export class SelectionAgent extends base.WebApiBase implements ISelectionAgent {
2812
2791
  }
2813
2792
 
2814
2793
 
2794
+ private async _deleteSelectionEntityAsync(request: carriers.Selection_DeleteSelectionEntityRequest, options?:base.WebApiRequestOptions) : Promise< void > {
2795
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
2796
+ base.WebApiBase.SetPending(options);
2797
+ return new Promise< void >(async (resolve, reject) => {
2798
+ try {
2799
+ config.baseURL = this._options.baseUrl;
2800
+ const response = await this._axios.post("DeleteSelectionEntity", request , config);
2801
+ base.WebApiBase.SetCompleted(options);
2802
+ const res = response.data;
2803
+ resolve(res);
2804
+ }
2805
+ catch( err ) {
2806
+ base.WebApiBase.HandleError(options, config, err);
2807
+ reject(err);
2808
+ }
2809
+ });
2810
+ }
2811
+
2812
+
2813
+
2814
+ /**
2815
+ * Deletes the SelectionEntity
2816
+ * @param request - SelectionEntityId
2817
+ * @returns This method has no return value
2818
+ */
2819
+ public async deleteSelectionEntityAsync(request: carriers.Selection_DeleteSelectionEntityRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
2820
+
2821
+ /**
2822
+ * Deletes the SelectionEntity
2823
+ * @param selectionEntityId - The identity of the SelectionEntity
2824
+ * @returns This method has no return value
2825
+ */
2826
+ public async deleteSelectionEntityAsync(selectionEntityId: number, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
2827
+
2828
+ public async deleteSelectionEntityAsync(selectionEntityId:number|carriers.Selection_DeleteSelectionEntityRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void > {
2829
+ let _request : carriers.Selection_DeleteSelectionEntityRequest = null;
2830
+ let _options : base.WebApiRequestOptions = null;
2831
+ const first : any = selectionEntityId;
2832
+ if( typeof( first ) === "object" && first && ( typeof(first.selectionEntityId)!='undefined' ) )
2833
+ {
2834
+ _request = selectionEntityId as carriers.Selection_DeleteSelectionEntityRequest;
2835
+ _options = webapi_options as base.WebApiRequestOptions;
2836
+ }
2837
+ else
2838
+ {
2839
+ _request = {
2840
+ selectionEntityId: selectionEntityId as number,
2841
+ };
2842
+ _options = webapi_options;
2843
+ }
2844
+ return this._deleteSelectionEntityAsync( _request, _options );
2845
+ }
2846
+
2847
+
2815
2848
  private async _getSelectionForFindAsync(request: carriers.Selection_GetSelectionForFindRequest, options?:base.WebApiRequestOptions) : Promise< carriers.SelectionForFind > {
2816
2849
  const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
2817
2850
  base.WebApiBase.SetPending(options);
@@ -36,6 +36,8 @@ export interface ISentryAgent {
36
36
  hasFunctionRightAsync(functionRight: string, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
37
37
  canCreateAppointmentInAssociateDiariesAsync(request: carriers.Sentry_CanCreateAppointmentInAssociateDiariesRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
38
38
  canCreateAppointmentInAssociateDiariesAsync(associateIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
39
+ canCreateAppointmentInEachAssociatesDiaryAsync(request: carriers.Sentry_CanCreateAppointmentInEachAssociatesDiaryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean[] >;
40
+ canCreateAppointmentInEachAssociatesDiaryAsync(associateIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< boolean[] >;
39
41
  canCreateAppointmentInAllDiariesAsync(webapi_options?:base.WebApiRequestOptions) : Promise< boolean >;
40
42
  getTableRightByContactOwnershipAsync(request: carriers.Sentry_GetTableRightByContactOwnershipRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TableRight >;
41
43
  getTableRightByContactOwnershipAsync(tableName: string, contactId: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.TableRight >;
@@ -317,6 +319,60 @@ export class SentryAgent extends base.WebApiBase implements ISentryAgent {
317
319
  }
318
320
 
319
321
 
322
+ private async _canCreateAppointmentInEachAssociatesDiaryAsync(request: carriers.Sentry_CanCreateAppointmentInEachAssociatesDiaryRequest, options?:base.WebApiRequestOptions) : Promise< boolean[] > {
323
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
324
+ base.WebApiBase.SetPending(options);
325
+ return new Promise< boolean[] >(async (resolve, reject) => {
326
+ try {
327
+ config.baseURL = this._options.baseUrl;
328
+ const response = await this._axios.post("CanCreateAppointmentInEachAssociatesDiary", request , config);
329
+ base.WebApiBase.SetCompleted(options);
330
+ const res : boolean[] = response.data as boolean[];
331
+ resolve(res);
332
+ }
333
+ catch( err ) {
334
+ base.WebApiBase.HandleError(options, config, err);
335
+ reject(err);
336
+ }
337
+ });
338
+ }
339
+
340
+
341
+
342
+ /**
343
+ * CanCreateAppointmentInEachAssociateDiary will check if the current associate can create appointments in diaries belonging to the associates listed in associateIds. CanCreateAppointmentInEachAssociateDiary will only check against associates that are diary owners. If none of the associates listed in the associateIds parameter is a diary owner, the method will return true.
344
+ * @param request - AssociateIds
345
+ * @returns Returns true if for each given associate if the current associate can create appointments in that diary, otherwise false.
346
+ */
347
+ public async canCreateAppointmentInEachAssociatesDiaryAsync(request: carriers.Sentry_CanCreateAppointmentInEachAssociatesDiaryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean[] >;
348
+
349
+ /**
350
+ * CanCreateAppointmentInEachAssociateDiary will check if the current associate can create appointments in diaries belonging to the associates listed in associateIds. CanCreateAppointmentInEachAssociateDiary will only check against associates that are diary owners. If none of the associates listed in the associateIds parameter is a diary owner, the method will return true.
351
+ * @param associateIds - Array of associate ids to check.
352
+ * @returns Returns true if for each given associate if the current associate can create appointments in that diary, otherwise false.
353
+ */
354
+ public async canCreateAppointmentInEachAssociatesDiaryAsync(associateIds: number[], webapi_options?:base.WebApiRequestOptions) : Promise< boolean[] >;
355
+
356
+ public async canCreateAppointmentInEachAssociatesDiaryAsync(associateIds:number[]|carriers.Sentry_CanCreateAppointmentInEachAssociatesDiaryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< boolean[] > {
357
+ let _request : carriers.Sentry_CanCreateAppointmentInEachAssociatesDiaryRequest = null;
358
+ let _options : base.WebApiRequestOptions = null;
359
+ const first : any = associateIds;
360
+ if( typeof( first ) === "object" && first && ( typeof(first.associateIds)!='undefined' ) )
361
+ {
362
+ _request = associateIds as carriers.Sentry_CanCreateAppointmentInEachAssociatesDiaryRequest;
363
+ _options = webapi_options as base.WebApiRequestOptions;
364
+ }
365
+ else
366
+ {
367
+ _request = {
368
+ associateIds: associateIds as number[],
369
+ };
370
+ _options = webapi_options;
371
+ }
372
+ return this._canCreateAppointmentInEachAssociatesDiaryAsync( _request, _options );
373
+ }
374
+
375
+
320
376
  private async _canCreateAppointmentInAllDiariesAsync( options?:base.WebApiRequestOptions) : Promise< boolean > {
321
377
  const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
322
378
  base.WebApiBase.SetPending(options);