@superoffice/webapi 11.2.694 → 11.3.1349
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 +32 -0
- package/dist/cjs/AIAgent.d.ts.map +1 -1
- package/dist/cjs/AIAgent.js +70 -0
- package/dist/cjs/AIAgent.js.map +1 -1
- package/dist/cjs/Carriers.d.ts +399 -0
- package/dist/cjs/Carriers.d.ts.map +1 -1
- package/dist/cjs/Converters.d.ts +21 -0
- package/dist/cjs/Converters.d.ts.map +1 -1
- package/dist/cjs/Converters.js +337 -24
- package/dist/cjs/Converters.js.map +1 -1
- package/dist/cjs/Enums.d.ts +122 -7
- package/dist/cjs/Enums.d.ts.map +1 -1
- package/dist/cjs/Enums.js +125 -7
- package/dist/cjs/Enums.js.map +1 -1
- package/dist/cjs/ListAgent.d.ts +24 -0
- package/dist/cjs/ListAgent.d.ts.map +1 -1
- package/dist/cjs/ListAgent.js +66 -0
- package/dist/cjs/ListAgent.js.map +1 -1
- package/dist/cjs/PersonAgent.d.ts +15 -0
- package/dist/cjs/PersonAgent.d.ts.map +1 -1
- package/dist/cjs/PersonAgent.js +33 -0
- package/dist/cjs/PersonAgent.js.map +1 -1
- package/dist/cjs/PersonRestApi.d.ts.map +1 -1
- package/dist/cjs/PersonRestApi.js.map +1 -1
- package/dist/cjs/ProjectAgent.d.ts +16 -0
- package/dist/cjs/ProjectAgent.d.ts.map +1 -1
- package/dist/cjs/ProjectAgent.js +34 -0
- package/dist/cjs/ProjectAgent.js.map +1 -1
- package/dist/cjs/SelectionAgent.d.ts +76 -0
- package/dist/cjs/SelectionAgent.d.ts.map +1 -1
- package/dist/cjs/SelectionAgent.js +166 -0
- package/dist/cjs/SelectionAgent.js.map +1 -1
- package/dist/esm/AIAgent.d.ts +32 -0
- package/dist/esm/AIAgent.d.ts.map +1 -1
- package/dist/esm/AIAgent.js +70 -0
- package/dist/esm/AIAgent.js.map +1 -1
- package/dist/esm/Carriers.d.ts +399 -0
- package/dist/esm/Carriers.d.ts.map +1 -1
- package/dist/esm/Converters.d.ts +21 -0
- package/dist/esm/Converters.d.ts.map +1 -1
- package/dist/esm/Converters.js +291 -0
- package/dist/esm/Converters.js.map +1 -1
- package/dist/esm/Enums.d.ts +122 -7
- package/dist/esm/Enums.d.ts.map +1 -1
- package/dist/esm/Enums.js +122 -4
- package/dist/esm/Enums.js.map +1 -1
- package/dist/esm/ListAgent.d.ts +24 -0
- package/dist/esm/ListAgent.d.ts.map +1 -1
- package/dist/esm/ListAgent.js +66 -0
- package/dist/esm/ListAgent.js.map +1 -1
- package/dist/esm/PersonAgent.d.ts +15 -0
- package/dist/esm/PersonAgent.d.ts.map +1 -1
- package/dist/esm/PersonAgent.js +33 -0
- package/dist/esm/PersonAgent.js.map +1 -1
- package/dist/esm/PersonRestApi.d.ts.map +1 -1
- package/dist/esm/PersonRestApi.js.map +1 -1
- package/dist/esm/ProjectAgent.d.ts +16 -0
- package/dist/esm/ProjectAgent.d.ts.map +1 -1
- package/dist/esm/ProjectAgent.js +34 -0
- package/dist/esm/ProjectAgent.js.map +1 -1
- package/dist/esm/SelectionAgent.d.ts +76 -0
- package/dist/esm/SelectionAgent.d.ts.map +1 -1
- package/dist/esm/SelectionAgent.js +166 -0
- package/dist/esm/SelectionAgent.js.map +1 -1
- package/package.json +3 -3
- package/src/AIAgent.ts +117 -0
- package/src/Carriers.ts +553 -0
- package/src/Converters.ts +345 -0
- package/src/Enums.ts +125 -4
- package/src/ListAgent.ts +71 -0
- package/src/PersonAgent.ts +56 -0
- package/src/PersonRestApi.ts +2 -0
- package/src/ProjectAgent.ts +58 -0
- package/src/SelectionAgent.ts +282 -0
package/src/AIAgent.ts
CHANGED
|
@@ -35,6 +35,10 @@ export interface IAIAgent {
|
|
|
35
35
|
rephraseTextAsync(text: string, style: enums.AiTextStyle, isoLangCode: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
36
36
|
createTextForAppointmentAsync(request: carriers.AI_CreateTextForAppointmentRequest, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
37
37
|
createTextForAppointmentAsync(appointment: carriers.AppointmentEntity, isoLangCode: string, webapi_options?:base.WebApiRequestOptions) : Promise< string >;
|
|
38
|
+
analyzeBizCardImageAsync(request: carriers.AI_AnalyzeBizCardImageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BizCard >;
|
|
39
|
+
analyzeBizCardImageAsync(image: ArrayBuffer|string, mergeWithDatabase: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BizCard >;
|
|
40
|
+
analyzeBizCardTextAsync(request: carriers.AI_AnalyzeBizCardTextRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BizCard >;
|
|
41
|
+
analyzeBizCardTextAsync(text: string, mergeWithDatabase: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BizCard >;
|
|
38
42
|
getTrainingStatusAsync(webapi_options?:base.WebApiRequestOptions) : Promise< carriers.CategorizationStatusResponse >;
|
|
39
43
|
guessCategoryAsync(request: carriers.AI_GuessCategoryRequest, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
40
44
|
guessCategoryAsync(ticketId: number, webapi_options?:base.WebApiRequestOptions) : Promise< number >;
|
|
@@ -337,6 +341,119 @@ export class AIAgent extends base.WebApiBase implements IAIAgent {
|
|
|
337
341
|
}
|
|
338
342
|
|
|
339
343
|
|
|
344
|
+
private async _analyzeBizCardImageAsync(request: carriers.AI_AnalyzeBizCardImageRequest, options?:base.WebApiRequestOptions) : Promise< carriers.BizCard > {
|
|
345
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
346
|
+
base.WebApiBase.SetPending(options);
|
|
347
|
+
return new Promise< carriers.BizCard >(async (resolve, reject) => {
|
|
348
|
+
try {
|
|
349
|
+
config.baseURL = this._options.baseUrl;
|
|
350
|
+
const response = await this._axios.post("AnalyzeBizCardImage", request , config);
|
|
351
|
+
base.WebApiBase.SetCompleted(options);
|
|
352
|
+
const res : carriers.BizCard = converters.Create_BizCard_From( response.data );
|
|
353
|
+
resolve(res);
|
|
354
|
+
}
|
|
355
|
+
catch( err ) {
|
|
356
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
357
|
+
reject(err);
|
|
358
|
+
}
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Returns contact and person information from an image. Merges results with matching database records if merge = true
|
|
366
|
+
* @param request - Image, MergeWithDatabase
|
|
367
|
+
* @returns Returns a Contact and a Person entity.
|
|
368
|
+
*/
|
|
369
|
+
public async analyzeBizCardImageAsync(request: carriers.AI_AnalyzeBizCardImageRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BizCard >;
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Returns contact and person information from an image. Merges results with matching database records if merge = true
|
|
373
|
+
* @param image - Image data containg a business card
|
|
374
|
+
* @param mergeWithDatabase - Merge results from analysis with matching database records? True: match company/person names and set ids on returned entities.
|
|
375
|
+
* @returns Returns a Contact and a Person entity.
|
|
376
|
+
*/
|
|
377
|
+
public async analyzeBizCardImageAsync(image: ArrayBuffer|string, mergeWithDatabase: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BizCard >;
|
|
378
|
+
|
|
379
|
+
public async analyzeBizCardImageAsync(image:ArrayBuffer|string|carriers.AI_AnalyzeBizCardImageRequest, mergeWithDatabase?:boolean|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BizCard > {
|
|
380
|
+
let _request : carriers.AI_AnalyzeBizCardImageRequest = null;
|
|
381
|
+
let _options : base.WebApiRequestOptions = null;
|
|
382
|
+
const first : any = image;
|
|
383
|
+
if( typeof( first ) === "object" && first && ( typeof(first.image)!='undefined' || typeof(first.mergeWithDatabase)!='undefined' ) )
|
|
384
|
+
{
|
|
385
|
+
_request = image as carriers.AI_AnalyzeBizCardImageRequest;
|
|
386
|
+
_options = mergeWithDatabase as base.WebApiRequestOptions;
|
|
387
|
+
}
|
|
388
|
+
else
|
|
389
|
+
{
|
|
390
|
+
_request = {
|
|
391
|
+
image: image as ArrayBuffer|string,
|
|
392
|
+
mergeWithDatabase: mergeWithDatabase as boolean,
|
|
393
|
+
};
|
|
394
|
+
_options = webapi_options;
|
|
395
|
+
}
|
|
396
|
+
_request.image = ToBase64(_request.image);
|
|
397
|
+
return this._analyzeBizCardImageAsync( _request, _options );
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
private async _analyzeBizCardTextAsync(request: carriers.AI_AnalyzeBizCardTextRequest, options?:base.WebApiRequestOptions) : Promise< carriers.BizCard > {
|
|
402
|
+
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
403
|
+
base.WebApiBase.SetPending(options);
|
|
404
|
+
return new Promise< carriers.BizCard >(async (resolve, reject) => {
|
|
405
|
+
try {
|
|
406
|
+
config.baseURL = this._options.baseUrl;
|
|
407
|
+
const response = await this._axios.post("AnalyzeBizCardText", request , config);
|
|
408
|
+
base.WebApiBase.SetCompleted(options);
|
|
409
|
+
const res : carriers.BizCard = converters.Create_BizCard_From( response.data );
|
|
410
|
+
resolve(res);
|
|
411
|
+
}
|
|
412
|
+
catch( err ) {
|
|
413
|
+
base.WebApiBase.HandleError(options, config, err);
|
|
414
|
+
reject(err);
|
|
415
|
+
}
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Extract contact and person information from text. Merge results with matching database records if merge = true
|
|
423
|
+
* @param request - Text, MergeWithDatabase
|
|
424
|
+
* @returns Returns a Contact and a Person entity.
|
|
425
|
+
*/
|
|
426
|
+
public async analyzeBizCardTextAsync(request: carriers.AI_AnalyzeBizCardTextRequest, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BizCard >;
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* Extract contact and person information from text. Merge results with matching database records if merge = true
|
|
430
|
+
* @param text - Text that contains useful contact and person information.
|
|
431
|
+
* @param mergeWithDatabase - Merge results from analysis with matching database records? True: match company/person names and set ids on returned entities.
|
|
432
|
+
* @returns Returns a Contact and a Person entity.
|
|
433
|
+
*/
|
|
434
|
+
public async analyzeBizCardTextAsync(text: string, mergeWithDatabase: boolean, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BizCard >;
|
|
435
|
+
|
|
436
|
+
public async analyzeBizCardTextAsync(text:string|carriers.AI_AnalyzeBizCardTextRequest, mergeWithDatabase?:boolean|base.WebApiRequestOptions, webapi_options?:base.WebApiRequestOptions) : Promise< carriers.BizCard > {
|
|
437
|
+
let _request : carriers.AI_AnalyzeBizCardTextRequest = null;
|
|
438
|
+
let _options : base.WebApiRequestOptions = null;
|
|
439
|
+
const first : any = text;
|
|
440
|
+
if( typeof( first ) === "object" && first && ( typeof(first.text)!='undefined' || typeof(first.mergeWithDatabase)!='undefined' ) )
|
|
441
|
+
{
|
|
442
|
+
_request = text as carriers.AI_AnalyzeBizCardTextRequest;
|
|
443
|
+
_options = mergeWithDatabase as base.WebApiRequestOptions;
|
|
444
|
+
}
|
|
445
|
+
else
|
|
446
|
+
{
|
|
447
|
+
_request = {
|
|
448
|
+
text: text as string,
|
|
449
|
+
mergeWithDatabase: mergeWithDatabase as boolean,
|
|
450
|
+
};
|
|
451
|
+
_options = webapi_options;
|
|
452
|
+
}
|
|
453
|
+
return this._analyzeBizCardTextAsync( _request, _options );
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
|
|
340
457
|
private async _getTrainingStatusAsync( options?:base.WebApiRequestOptions) : Promise< carriers.CategorizationStatusResponse > {
|
|
341
458
|
const config : AxiosRequestConfig = base.WebApiBase.GetAxiosRequestConfig(options, this._options);
|
|
342
459
|
base.WebApiBase.SetPending(options);
|