@superoffice/webapi 11.8.788 → 11.10.721

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 (51) hide show
  1. package/dist/cjs/AIAgent.d.ts +94 -0
  2. package/dist/cjs/AIAgent.d.ts.map +1 -1
  3. package/dist/cjs/AIAgent.js +218 -0
  4. package/dist/cjs/AIAgent.js.map +1 -1
  5. package/dist/cjs/Carriers.d.ts +337 -18
  6. package/dist/cjs/Carriers.d.ts.map +1 -1
  7. package/dist/cjs/Converters.d.ts +15 -0
  8. package/dist/cjs/Converters.d.ts.map +1 -1
  9. package/dist/cjs/Converters.js +250 -24
  10. package/dist/cjs/Converters.js.map +1 -1
  11. package/dist/cjs/Enums.d.ts +113 -17
  12. package/dist/cjs/Enums.d.ts.map +1 -1
  13. package/dist/cjs/Enums.js +120 -21
  14. package/dist/cjs/Enums.js.map +1 -1
  15. package/dist/cjs/MarketingAgent.d.ts +68 -0
  16. package/dist/cjs/MarketingAgent.d.ts.map +1 -1
  17. package/dist/cjs/MarketingAgent.js +157 -0
  18. package/dist/cjs/MarketingAgent.js.map +1 -1
  19. package/dist/cjs/TicketAgent.d.ts +8 -0
  20. package/dist/cjs/TicketAgent.d.ts.map +1 -1
  21. package/dist/cjs/TicketAgent.js +22 -0
  22. package/dist/cjs/TicketAgent.js.map +1 -1
  23. package/dist/esm/AIAgent.d.ts +94 -0
  24. package/dist/esm/AIAgent.d.ts.map +1 -1
  25. package/dist/esm/AIAgent.js +219 -1
  26. package/dist/esm/AIAgent.js.map +1 -1
  27. package/dist/esm/Carriers.d.ts +337 -18
  28. package/dist/esm/Carriers.d.ts.map +1 -1
  29. package/dist/esm/Converters.d.ts +15 -0
  30. package/dist/esm/Converters.d.ts.map +1 -1
  31. package/dist/esm/Converters.js +228 -18
  32. package/dist/esm/Converters.js.map +1 -1
  33. package/dist/esm/Enums.d.ts +113 -17
  34. package/dist/esm/Enums.d.ts.map +1 -1
  35. package/dist/esm/Enums.js +116 -17
  36. package/dist/esm/Enums.js.map +1 -1
  37. package/dist/esm/MarketingAgent.d.ts +68 -0
  38. package/dist/esm/MarketingAgent.d.ts.map +1 -1
  39. package/dist/esm/MarketingAgent.js +157 -0
  40. package/dist/esm/MarketingAgent.js.map +1 -1
  41. package/dist/esm/TicketAgent.d.ts +8 -0
  42. package/dist/esm/TicketAgent.d.ts.map +1 -1
  43. package/dist/esm/TicketAgent.js +22 -0
  44. package/dist/esm/TicketAgent.js.map +1 -1
  45. package/package.json +3 -3
  46. package/src/AIAgent.ts +364 -0
  47. package/src/Carriers.ts +460 -20
  48. package/src/Converters.ts +271 -22
  49. package/src/Enums.ts +120 -18
  50. package/src/MarketingAgent.ts +256 -0
  51. package/src/TicketAgent.ts +24 -0
package/src/AIAgent.ts CHANGED
@@ -64,6 +64,10 @@ export interface IAIAgent {
64
64
  getFormDesignFromImageAsync(image: ArrayBuffer|string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary >;
65
65
  getFormDesignFromUrlAsync(request: carriers.AI_GetFormDesignFromUrlRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary >;
66
66
  getFormDesignFromUrlAsync(url: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.StringDictionary >;
67
+ getFormDesignCssFromImageAsync(request: carriers.AI_GetFormDesignCssFromImageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FormDesignCarrier >;
68
+ getFormDesignCssFromImageAsync(image: ArrayBuffer|string, cssClasses: string[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FormDesignCarrier >;
69
+ getFormDesignCssFromUrlAsync(request: carriers.AI_GetFormDesignCssFromUrlRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FormDesignCarrier >;
70
+ getFormDesignCssFromUrlAsync(url: string, cssClasses: string[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FormDesignCarrier >;
67
71
  detectLanguageAsync(request: carriers.AI_DetectLanguageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
68
72
  detectLanguageAsync(text: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
69
73
  detectSentimentAsync(request: carriers.AI_DetectSentimentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.Sentiment >;
@@ -72,6 +76,10 @@ export interface IAIAgent {
72
76
  translateAsync(text: string, targetLanguage: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
73
77
  translateEntityAsync(request: carriers.AI_TranslateEntityRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
74
78
  translateEntityAsync(entityName: string, entityId: number, targetLanguage: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
79
+ parseQueryIntoRestrictionsAsync(request: carriers.AI_ParseQueryIntoRestrictionsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.NaturalLanguageSearch >;
80
+ parseQueryIntoRestrictionsAsync(query: string, currents: string, previousQuery: carriers.NaturalLanguageSearch, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.NaturalLanguageSearch >;
81
+ removePhotoBackgroundAsync(request: carriers.AI_RemovePhotoBackgroundRequest, webapi_options?:base.WebApiRequestOptions) : Promise< ArrayBuffer|string >;
82
+ removePhotoBackgroundAsync(image: ArrayBuffer|string, webapi_options?:base.WebApiRequestOptions) : Promise< ArrayBuffer|string >;
75
83
  answerAsync(request: carriers.AI_AnswerRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagAnswer >;
76
84
  answerAsync(namespaceName: string, query: string, type: enums.RagType, top: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagAnswer >;
77
85
  answerFeedbackAsync(request: carriers.AI_AnswerFeedbackRequest, webapi_options?:base.WebApiRequestOptions) : Promise< void >;
@@ -82,6 +90,10 @@ export interface IAIAgent {
82
90
  searchAsync(namespaceName: string, query: string, type: enums.RagType, top: number, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagResult[] >;
83
91
  startRagIndexingAsync(request: carriers.AI_StartRagIndexingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
84
92
  startRagIndexingAsync(namespaceName: string, sourceId: string, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
93
+ getIndexingStatusAsync(request: carriers.AI_GetIndexingStatusRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagStatus >;
94
+ getIndexingStatusAsync(namespaceName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagStatus >;
95
+ cancelIndexingAsync(request: carriers.AI_CancelIndexingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagStatus >;
96
+ cancelIndexingAsync(namespaceName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagStatus >;
85
97
  summarizeTicketAsync(request: carriers.AI_SummarizeTicketRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
86
98
  summarizeTicketAsync(ticketId: number, numSentences: number, isoLangCode: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
87
99
  getSummarizeTicketPromptAsync(request: carriers.AI_GetSummarizeTicketPromptRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.ChatbotTurn >;
@@ -1126,6 +1138,119 @@ export class AIAgent extends base.WebApiBase implements IAIAgent {
1126
1138
  }
1127
1139
 
1128
1140
 
1141
+ private async _getFormDesignCssFromImageAsync(request: carriers.AI_GetFormDesignCssFromImageRequest, options?:base.WebApiRequestOptions) : Promise< carriers.FormDesignCarrier > {
1142
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1143
+ base.WebApiBase.SetPending(options);
1144
+ return new Promise< carriers.FormDesignCarrier >(async (resolve, reject) => {
1145
+ try {
1146
+ config.baseURL = this._options.baseUrl;
1147
+ const response = await this._axios.post("GetFormDesignCssFromImage", request , config);
1148
+ base.WebApiBase.SetCompleted(options, response);
1149
+ const res : carriers.FormDesignCarrier = converters.Create_FormDesignCarrier_From( response.data );
1150
+ resolve(res);
1151
+ }
1152
+ catch( err ) {
1153
+ base.WebApiBase.HandleError(options, config, err);
1154
+ reject(err);
1155
+ }
1156
+ });
1157
+ }
1158
+
1159
+
1160
+
1161
+ /**
1162
+ * Returns Form Designer CSS based on the look of a picture
1163
+ * @param request - Image, CssClasses
1164
+ * @returns Returns CSS rules and confidence score.
1165
+ */
1166
+ public async getFormDesignCssFromImageAsync(request: carriers.AI_GetFormDesignCssFromImageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FormDesignCarrier >;
1167
+
1168
+ /**
1169
+ * Returns Form Designer CSS based on the look of a picture
1170
+ * @param image - Image data to analyze for design
1171
+ * @param cssClasses - List of CSS classes to generate styles for.
1172
+ * @returns Returns CSS rules and confidence score.
1173
+ */
1174
+ public async getFormDesignCssFromImageAsync(image: ArrayBuffer|string, cssClasses: string[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FormDesignCarrier >;
1175
+
1176
+ public async getFormDesignCssFromImageAsync(image:ArrayBuffer|string|carriers.AI_GetFormDesignCssFromImageRequest, cssClasses?:string[]|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FormDesignCarrier > {
1177
+ let _request : carriers.AI_GetFormDesignCssFromImageRequest = null;
1178
+ let _options : base.WebApiRequestOptions = null;
1179
+ const first : any = image;
1180
+ if( typeof( first ) === "object" && first && ( typeof(first.image)!='undefined' || typeof(first.cssClasses)!='undefined' ) )
1181
+ {
1182
+ _request = image as carriers.AI_GetFormDesignCssFromImageRequest;
1183
+ _options = cssClasses as base.WebApiRequestOptions;
1184
+ }
1185
+ else
1186
+ {
1187
+ _request = {
1188
+ image: image as ArrayBuffer|string,
1189
+ cssClasses: cssClasses as string[],
1190
+ };
1191
+ _options = webapi_options;
1192
+ }
1193
+ _request.image = ToBase64(_request.image);
1194
+ return this._getFormDesignCssFromImageAsync( _request, _options );
1195
+ }
1196
+
1197
+
1198
+ private async _getFormDesignCssFromUrlAsync(request: carriers.AI_GetFormDesignCssFromUrlRequest, options?:base.WebApiRequestOptions) : Promise< carriers.FormDesignCarrier > {
1199
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1200
+ base.WebApiBase.SetPending(options);
1201
+ return new Promise< carriers.FormDesignCarrier >(async (resolve, reject) => {
1202
+ try {
1203
+ config.baseURL = this._options.baseUrl;
1204
+ const response = await this._axios.post("GetFormDesignCssFromUrl", request , config);
1205
+ base.WebApiBase.SetCompleted(options, response);
1206
+ const res : carriers.FormDesignCarrier = converters.Create_FormDesignCarrier_From( response.data );
1207
+ resolve(res);
1208
+ }
1209
+ catch( err ) {
1210
+ base.WebApiBase.HandleError(options, config, err);
1211
+ reject(err);
1212
+ }
1213
+ });
1214
+ }
1215
+
1216
+
1217
+
1218
+ /**
1219
+ * Returns Form Designer properties based on the look of a web page
1220
+ * @param request - Url, CssClasses
1221
+ * @returns Returns CSS rules and confidence score.
1222
+ */
1223
+ public async getFormDesignCssFromUrlAsync(request: carriers.AI_GetFormDesignCssFromUrlRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FormDesignCarrier >;
1224
+
1225
+ /**
1226
+ * Returns Form Designer properties based on the look of a web page
1227
+ * @param url - Url of the web page to extract style from.
1228
+ * @param cssClasses - List of CSS classes to generate styles for.
1229
+ * @returns Returns CSS rules and confidence score.
1230
+ */
1231
+ public async getFormDesignCssFromUrlAsync(url: string, cssClasses: string[], webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FormDesignCarrier >;
1232
+
1233
+ public async getFormDesignCssFromUrlAsync(url:string|carriers.AI_GetFormDesignCssFromUrlRequest, cssClasses?:string[]|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.FormDesignCarrier > {
1234
+ let _request : carriers.AI_GetFormDesignCssFromUrlRequest = null;
1235
+ let _options : base.WebApiRequestOptions = null;
1236
+ const first : any = url;
1237
+ if( typeof( first ) === "object" && first && ( typeof(first.url)!='undefined' || typeof(first.cssClasses)!='undefined' ) )
1238
+ {
1239
+ _request = url as carriers.AI_GetFormDesignCssFromUrlRequest;
1240
+ _options = cssClasses as base.WebApiRequestOptions;
1241
+ }
1242
+ else
1243
+ {
1244
+ _request = {
1245
+ url: url as string,
1246
+ cssClasses: cssClasses as string[],
1247
+ };
1248
+ _options = webapi_options;
1249
+ }
1250
+ return this._getFormDesignCssFromUrlAsync( _request, _options );
1251
+ }
1252
+
1253
+
1129
1254
  private async _detectLanguageAsync(request: carriers.AI_DetectLanguageRequest, options?:base.WebApiRequestOptions) : Promise< string > {
1130
1255
  const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1131
1256
  base.WebApiBase.SetPending(options);
@@ -1348,6 +1473,137 @@ export class AIAgent extends base.WebApiBase implements IAIAgent {
1348
1473
  }
1349
1474
 
1350
1475
 
1476
+ private async _parseQueryIntoRestrictionsAsync(request: carriers.AI_ParseQueryIntoRestrictionsRequest, options?:base.WebApiRequestOptions) : Promise< carriers.NaturalLanguageSearch > {
1477
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1478
+ base.WebApiBase.SetPending(options);
1479
+ return new Promise< carriers.NaturalLanguageSearch >(async (resolve, reject) => {
1480
+ try {
1481
+ config.baseURL = this._options.baseUrl;
1482
+ const response = await this._axios.post("ParseQueryIntoRestrictions", request , config);
1483
+ base.WebApiBase.SetCompleted(options, response);
1484
+ const res : carriers.NaturalLanguageSearch = converters.Create_NaturalLanguageSearch_From( response.data );
1485
+ resolve(res);
1486
+ }
1487
+ catch( err ) {
1488
+ base.WebApiBase.HandleError(options, config, err);
1489
+ reject(err);
1490
+ }
1491
+ });
1492
+ }
1493
+
1494
+
1495
+
1496
+ /**
1497
+ * Return archive restrictions based on a natural language query.
1498
+ * @param request - Query, Currents, PreviousQuery
1499
+ * @returns Returns archive restrictions and columns for the query. Pass this result in as the previous query on the next call to continue the conversation.
1500
+ */
1501
+ public async parseQueryIntoRestrictionsAsync(request: carriers.AI_ParseQueryIntoRestrictionsRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.NaturalLanguageSearch >;
1502
+
1503
+ /**
1504
+ * Return archive restrictions based on a natural language query.
1505
+ * @param query - What the user asked for.
1506
+ * @param currents - Current context prompt. e.g. Current company name and id, what selection are we looking at?
1507
+ * @param previousQuery - Previous query, if applicable. NULL if no previous query.
1508
+ * @returns Returns archive restrictions and columns for the query. Pass this result in as the previous query on the next call to continue the conversation.
1509
+ */
1510
+ public async parseQueryIntoRestrictionsAsync(query: string, currents: string, previousQuery: carriers.NaturalLanguageSearch, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.NaturalLanguageSearch >;
1511
+
1512
+ public async parseQueryIntoRestrictionsAsync(query:string|carriers.AI_ParseQueryIntoRestrictionsRequest, currents?:string|base.WebApiRequestOptions, previousQuery?:carriers.NaturalLanguageSearch, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.NaturalLanguageSearch > {
1513
+ let _request : carriers.AI_ParseQueryIntoRestrictionsRequest = null;
1514
+ let _options : base.WebApiRequestOptions = null;
1515
+ const first : any = query;
1516
+ if( typeof( first ) === "object" && first && ( typeof(first.query)!='undefined' || typeof(first.currents)!='undefined' || typeof(first.previousQuery)!='undefined' ) )
1517
+ {
1518
+ _request = query as carriers.AI_ParseQueryIntoRestrictionsRequest;
1519
+ _options = currents as base.WebApiRequestOptions;
1520
+ }
1521
+ else
1522
+ {
1523
+ _request = {
1524
+ query: query as string,
1525
+ currents: currents as string,
1526
+ previousQuery: previousQuery as carriers.NaturalLanguageSearch,
1527
+ };
1528
+ _options = webapi_options;
1529
+ }
1530
+ return this._parseQueryIntoRestrictionsAsync( _request, _options );
1531
+ }
1532
+
1533
+
1534
+ private async _removePhotoBackgroundAsync(request: carriers.AI_RemovePhotoBackgroundRequest, options?:base.WebApiRequestOptions) : Promise< ArrayBuffer|string > {
1535
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options) || {};
1536
+ base.WebApiBase.SetPending(options);
1537
+ return new Promise< ArrayBuffer|string >(async (resolve, reject) => {
1538
+ try {
1539
+ if( ! options || options.returnBlobAs == base.ReturnBlobType.AsArrayBuffer ) {
1540
+ config.responseType = "arraybuffer";
1541
+ config.headers = config.headers || {};
1542
+ config.headers["Accept"] = "application/octet-stream";
1543
+ }
1544
+ config.baseURL = this._options.baseUrl;
1545
+ const response = await this._axios.post("RemovePhotoBackground", request , config);
1546
+ base.WebApiBase.SetCompleted(options, response);
1547
+ let res : ArrayBuffer | string = null;
1548
+ if( options && options.returnBlobAs != base.ReturnBlobType.AsArrayBuffer )
1549
+ {
1550
+ res = response.data as string;
1551
+ if( options.returnBlobAs == base.ReturnBlobType.AsString )
1552
+ {
1553
+ res = FromBase64ToString(res);
1554
+ }
1555
+ }
1556
+ else
1557
+ {
1558
+ res = response.data as ArrayBuffer;
1559
+ }
1560
+
1561
+ resolve(res);
1562
+ }
1563
+ catch( err ) {
1564
+ base.WebApiBase.HandleError(options, config, err);
1565
+ reject(err);
1566
+ }
1567
+ });
1568
+ }
1569
+
1570
+
1571
+
1572
+ /**
1573
+ * Returns an image with the background removed, leaving only the main subject
1574
+ * @param request - Image
1575
+ * @returns Image with background removed
1576
+ */
1577
+ public async removePhotoBackgroundAsync(request: carriers.AI_RemovePhotoBackgroundRequest, webapi_options?:base.WebApiRequestOptions) : Promise< ArrayBuffer|string >;
1578
+
1579
+ /**
1580
+ * Returns an image with the background removed, leaving only the main subject
1581
+ * @param image - Image to be cleaned. JPG or PNG.
1582
+ * @returns Image with background removed
1583
+ */
1584
+ public async removePhotoBackgroundAsync(image: ArrayBuffer|string, webapi_options?:base.WebApiRequestOptions) : Promise< ArrayBuffer|string >;
1585
+
1586
+ public async removePhotoBackgroundAsync(image:ArrayBuffer|string|carriers.AI_RemovePhotoBackgroundRequest, webapi_options?:base.WebApiRequestOptions) : Promise< ArrayBuffer|string > {
1587
+ let _request : carriers.AI_RemovePhotoBackgroundRequest = null;
1588
+ let _options : base.WebApiRequestOptions = null;
1589
+ const first : any = image;
1590
+ if( typeof( first ) === "object" && first && ( typeof(first.image)!='undefined' ) )
1591
+ {
1592
+ _request = image as carriers.AI_RemovePhotoBackgroundRequest;
1593
+ _options = webapi_options as base.WebApiRequestOptions;
1594
+ }
1595
+ else
1596
+ {
1597
+ _request = {
1598
+ image: image as ArrayBuffer|string,
1599
+ };
1600
+ _options = webapi_options;
1601
+ }
1602
+ _request.image = ToBase64(_request.image);
1603
+ return this._removePhotoBackgroundAsync( _request, _options );
1604
+ }
1605
+
1606
+
1351
1607
  private async _answerAsync(request: carriers.AI_AnswerRequest, options?:base.WebApiRequestOptions) : Promise< carriers.RagAnswer > {
1352
1608
  const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1353
1609
  base.WebApiBase.SetPending(options);
@@ -1634,6 +1890,114 @@ export class AIAgent extends base.WebApiBase implements IAIAgent {
1634
1890
  }
1635
1891
 
1636
1892
 
1893
+ private async _getIndexingStatusAsync(request: carriers.AI_GetIndexingStatusRequest, options?:base.WebApiRequestOptions) : Promise< carriers.RagStatus > {
1894
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1895
+ base.WebApiBase.SetPending(options);
1896
+ return new Promise< carriers.RagStatus >(async (resolve, reject) => {
1897
+ try {
1898
+ config.baseURL = this._options.baseUrl;
1899
+ const response = await this._axios.post("GetIndexingStatus", request , config);
1900
+ base.WebApiBase.SetCompleted(options, response);
1901
+ const res : carriers.RagStatus = converters.Create_RagStatus_From( response.data );
1902
+ resolve(res);
1903
+ }
1904
+ catch( err ) {
1905
+ base.WebApiBase.HandleError(options, config, err);
1906
+ reject(err);
1907
+ }
1908
+ });
1909
+ }
1910
+
1911
+
1912
+
1913
+ /**
1914
+ * Get the current status.
1915
+ * @param request - NamespaceName
1916
+ * @returns Status of the indexing run - may be cancelled if another run is in progress.
1917
+ */
1918
+ public async getIndexingStatusAsync(request: carriers.AI_GetIndexingStatusRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagStatus >;
1919
+
1920
+ /**
1921
+ * Get the current status.
1922
+ * @param namespaceName - Identifies the namespace to store content in.
1923
+ * @returns Status of the indexing run - may be cancelled if another run is in progress.
1924
+ */
1925
+ public async getIndexingStatusAsync(namespaceName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagStatus >;
1926
+
1927
+ public async getIndexingStatusAsync(namespaceName:string|carriers.AI_GetIndexingStatusRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagStatus > {
1928
+ let _request : carriers.AI_GetIndexingStatusRequest = null;
1929
+ let _options : base.WebApiRequestOptions = null;
1930
+ const first : any = namespaceName;
1931
+ if( typeof( first ) === "object" && first && ( typeof(first.namespaceName)!='undefined' ) )
1932
+ {
1933
+ _request = namespaceName as carriers.AI_GetIndexingStatusRequest;
1934
+ _options = webapi_options as base.WebApiRequestOptions;
1935
+ }
1936
+ else
1937
+ {
1938
+ _request = {
1939
+ namespaceName: namespaceName as string,
1940
+ };
1941
+ _options = webapi_options;
1942
+ }
1943
+ return this._getIndexingStatusAsync( _request, _options );
1944
+ }
1945
+
1946
+
1947
+ private async _cancelIndexingAsync(request: carriers.AI_CancelIndexingRequest, options?:base.WebApiRequestOptions) : Promise< carriers.RagStatus > {
1948
+ const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1949
+ base.WebApiBase.SetPending(options);
1950
+ return new Promise< carriers.RagStatus >(async (resolve, reject) => {
1951
+ try {
1952
+ config.baseURL = this._options.baseUrl;
1953
+ const response = await this._axios.post("CancelIndexing", request , config);
1954
+ base.WebApiBase.SetCompleted(options, response);
1955
+ const res : carriers.RagStatus = converters.Create_RagStatus_From( response.data );
1956
+ resolve(res);
1957
+ }
1958
+ catch( err ) {
1959
+ base.WebApiBase.HandleError(options, config, err);
1960
+ reject(err);
1961
+ }
1962
+ });
1963
+ }
1964
+
1965
+
1966
+
1967
+ /**
1968
+ * Cancel the current re-indexing job on a given namespace. Leaves data in inconsistent state, because removal of old data is skipped.
1969
+ * @param request - NamespaceName
1970
+ * @returns Status of the indexing run after cancellation.
1971
+ */
1972
+ public async cancelIndexingAsync(request: carriers.AI_CancelIndexingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagStatus >;
1973
+
1974
+ /**
1975
+ * Cancel the current re-indexing job on a given namespace. Leaves data in inconsistent state, because removal of old data is skipped.
1976
+ * @param namespaceName - Identifies the namespace to stop indexing in.
1977
+ * @returns Status of the indexing run after cancellation.
1978
+ */
1979
+ public async cancelIndexingAsync(namespaceName: string, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagStatus >;
1980
+
1981
+ public async cancelIndexingAsync(namespaceName:string|carriers.AI_CancelIndexingRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.RagStatus > {
1982
+ let _request : carriers.AI_CancelIndexingRequest = null;
1983
+ let _options : base.WebApiRequestOptions = null;
1984
+ const first : any = namespaceName;
1985
+ if( typeof( first ) === "object" && first && ( typeof(first.namespaceName)!='undefined' ) )
1986
+ {
1987
+ _request = namespaceName as carriers.AI_CancelIndexingRequest;
1988
+ _options = webapi_options as base.WebApiRequestOptions;
1989
+ }
1990
+ else
1991
+ {
1992
+ _request = {
1993
+ namespaceName: namespaceName as string,
1994
+ };
1995
+ _options = webapi_options;
1996
+ }
1997
+ return this._cancelIndexingAsync( _request, _options );
1998
+ }
1999
+
2000
+
1637
2001
  private async _summarizeTicketAsync(request: carriers.AI_SummarizeTicketRequest, options?:base.WebApiRequestOptions) : Promise< string > {
1638
2002
  const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
1639
2003
  base.WebApiBase.SetPending(options);