@mediaviz/sdk 1.0.79 → 1.3.0
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/sdk.cjs +41 -58
- package/dist/sdk.d.cts +6 -7
- package/dist/sdk.d.ts +6 -7
- package/dist/sdk.esm.d.ts +6 -7
- package/dist/sdk.esm.js +41 -58
- package/dist/sdk.umd.js +41 -58
- package/package.json +1 -1
package/dist/sdk.cjs
CHANGED
|
@@ -912,17 +912,6 @@ class Keywords {
|
|
|
912
912
|
return data;
|
|
913
913
|
}
|
|
914
914
|
|
|
915
|
-
async addCompanyToKeywordFilteringList(keywordListId, { companyId } = {}) {
|
|
916
|
-
this._ctx.requireTokens();
|
|
917
|
-
let path = `/api/v1/keyword/${encodeURIComponent(keywordListId)}/company`;
|
|
918
|
-
const query = new URLSearchParams();
|
|
919
|
-
if (companyId !== undefined) (Array.isArray(companyId) ? companyId : [companyId]).forEach(v => query.append('company_id', v));
|
|
920
|
-
const qs = query.toString();
|
|
921
|
-
if (qs) path += '?' + qs;
|
|
922
|
-
const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken);
|
|
923
|
-
return data;
|
|
924
|
-
}
|
|
925
|
-
|
|
926
915
|
async requestKeywordListExport(keywordListId) {
|
|
927
916
|
this._ctx.requireTokens();
|
|
928
917
|
const path = `/api/v1/keyword/export/${encodeURIComponent(keywordListId)}`;
|
|
@@ -955,17 +944,6 @@ class Keywords {
|
|
|
955
944
|
return data;
|
|
956
945
|
}
|
|
957
946
|
|
|
958
|
-
async removeCompanyFromKeywordFilteringList(keywordListId, { companyId } = {}) {
|
|
959
|
-
this._ctx.requireTokens();
|
|
960
|
-
let path = `/api/v1/keyword/${encodeURIComponent(keywordListId)}/company`;
|
|
961
|
-
const query = new URLSearchParams();
|
|
962
|
-
if (companyId !== undefined) (Array.isArray(companyId) ? companyId : [companyId]).forEach(v => query.append('company_id', v));
|
|
963
|
-
const qs = query.toString();
|
|
964
|
-
if (qs) path += '?' + qs;
|
|
965
|
-
const { data } = await this._ctx.client.request(path, 'DELETE', this._ctx.accessToken, this._ctx.refreshToken);
|
|
966
|
-
return data;
|
|
967
|
-
}
|
|
968
|
-
|
|
969
947
|
async deleteKeywordFilteringListById(keywordListId) {
|
|
970
948
|
this._ctx.requireTokens();
|
|
971
949
|
const path = `/api/v1/keyword/${encodeURIComponent(keywordListId)}`;
|
|
@@ -1125,17 +1103,6 @@ class Person {
|
|
|
1125
1103
|
return data;
|
|
1126
1104
|
}
|
|
1127
1105
|
|
|
1128
|
-
async getPhotoIdsByPersons(projectTableName, { personId } = {}) {
|
|
1129
|
-
this._ctx.requireTokens();
|
|
1130
|
-
let path = `/api/v1/person/${encodeURIComponent(projectTableName)}/photos`;
|
|
1131
|
-
const query = new URLSearchParams();
|
|
1132
|
-
if (personId !== undefined) (Array.isArray(personId) ? personId : [personId]).forEach(v => query.append('person_id', v));
|
|
1133
|
-
const qs = query.toString();
|
|
1134
|
-
if (qs) path += '?' + qs;
|
|
1135
|
-
const { data } = await this._ctx.client.request(path, 'GET', this._ctx.accessToken, this._ctx.refreshToken);
|
|
1136
|
-
return data;
|
|
1137
|
-
}
|
|
1138
|
-
|
|
1139
1106
|
async getAllPersonsFromPhoto(projectTableName, photoId) {
|
|
1140
1107
|
this._ctx.requireTokens();
|
|
1141
1108
|
const path = `/api/v1/person/${encodeURIComponent(projectTableName)}/photo/${encodeURIComponent(photoId)}`;
|
|
@@ -1436,6 +1403,13 @@ class Photos {
|
|
|
1436
1403
|
return data;
|
|
1437
1404
|
}
|
|
1438
1405
|
|
|
1406
|
+
async getProjectThumbnail(tableName) {
|
|
1407
|
+
this._ctx.requireTokens();
|
|
1408
|
+
const path = `/api/v1/photos_project/${encodeURIComponent(tableName)}`;
|
|
1409
|
+
const { data } = await this._ctx.client.request(path, 'GET', this._ctx.accessToken, this._ctx.refreshToken);
|
|
1410
|
+
return data;
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1439
1413
|
async updatePhotoInProject({ tableName, photoId, photoData } = {}) {
|
|
1440
1414
|
this._ctx.requireTokens();
|
|
1441
1415
|
let path = `/api/v1/photos_update`;
|
|
@@ -1498,41 +1472,50 @@ class Search {
|
|
|
1498
1472
|
return data;
|
|
1499
1473
|
}
|
|
1500
1474
|
|
|
1501
|
-
async
|
|
1475
|
+
async searchProjectPhotosText(projectTableName, searchText, size = undefined) {
|
|
1476
|
+
this._ctx.requireTokens();
|
|
1477
|
+
const path = `/api/v1/search/text/${encodeURIComponent(projectTableName)}/`;
|
|
1478
|
+
const body = stripUndef$1({
|
|
1479
|
+
search_text: searchText,
|
|
1480
|
+
size: size,
|
|
1481
|
+
});
|
|
1482
|
+
const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken, body);
|
|
1483
|
+
return data;
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
async searchProjectPhotosNaturalLanguage(projectTableName, searchText, size = undefined) {
|
|
1487
|
+
this._ctx.requireTokens();
|
|
1488
|
+
const path = `/api/v1/search/nl/${encodeURIComponent(projectTableName)}/`;
|
|
1489
|
+
const body = stripUndef$1({
|
|
1490
|
+
search_text: searchText,
|
|
1491
|
+
size: size,
|
|
1492
|
+
});
|
|
1493
|
+
const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken, body);
|
|
1494
|
+
return data;
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1497
|
+
async searchProjectPhotosNaturalLanguageHybrid(projectTableName, searchText, size = undefined, { blend, minCosine } = {}) {
|
|
1502
1498
|
this._ctx.requireTokens();
|
|
1503
|
-
let path = `/api/v1/search/
|
|
1499
|
+
let path = `/api/v1/search/nl_hybrid/${encodeURIComponent(projectTableName)}/`;
|
|
1504
1500
|
const query = new URLSearchParams();
|
|
1505
|
-
if (
|
|
1506
|
-
if (
|
|
1507
|
-
if (notSearchText !== undefined) (Array.isArray(notSearchText) ? notSearchText : [notSearchText]).forEach(v => query.append('not_search_text', v));
|
|
1508
|
-
if (city !== undefined) (Array.isArray(city) ? city : [city]).forEach(v => query.append('city', v));
|
|
1509
|
-
if (country !== undefined) (Array.isArray(country) ? country : [country]).forEach(v => query.append('country', v));
|
|
1510
|
-
if (state !== undefined) (Array.isArray(state) ? state : [state]).forEach(v => query.append('state', v));
|
|
1511
|
-
if (albums !== undefined) (Array.isArray(albums) ? albums : [albums]).forEach(v => query.append('albums', v));
|
|
1512
|
-
if (dateMin !== undefined) (Array.isArray(dateMin) ? dateMin : [dateMin]).forEach(v => query.append('date_min', v));
|
|
1513
|
-
if (dateMax !== undefined) (Array.isArray(dateMax) ? dateMax : [dateMax]).forEach(v => query.append('date_max', v));
|
|
1514
|
-
if (dateNullAnd !== undefined) (Array.isArray(dateNullAnd) ? dateNullAnd : [dateNullAnd]).forEach(v => query.append('date_null_and', v));
|
|
1515
|
-
if (dateNullOr !== undefined) (Array.isArray(dateNullOr) ? dateNullOr : [dateNullOr]).forEach(v => query.append('date_null_or', v));
|
|
1516
|
-
if (dateOrder !== undefined) (Array.isArray(dateOrder) ? dateOrder : [dateOrder]).forEach(v => query.append('date_order', v));
|
|
1517
|
-
if (bestOfSimilarSetsOnly !== undefined) (Array.isArray(bestOfSimilarSetsOnly) ? bestOfSimilarSetsOnly : [bestOfSimilarSetsOnly]).forEach(v => query.append('best_of_similar_sets_only', v));
|
|
1518
|
-
if (splitByTier !== undefined) (Array.isArray(splitByTier) ? splitByTier : [splitByTier]).forEach(v => query.append('split_by_tier', v));
|
|
1519
|
-
if (size !== undefined) (Array.isArray(size) ? size : [size]).forEach(v => query.append('size', v));
|
|
1501
|
+
if (blend !== undefined) (Array.isArray(blend) ? blend : [blend]).forEach(v => query.append('blend', v));
|
|
1502
|
+
if (minCosine !== undefined) (Array.isArray(minCosine) ? minCosine : [minCosine]).forEach(v => query.append('min_cosine', v));
|
|
1520
1503
|
const qs = query.toString();
|
|
1521
1504
|
if (qs) path += '?' + qs;
|
|
1522
|
-
const
|
|
1505
|
+
const body = stripUndef$1({
|
|
1506
|
+
search_text: searchText,
|
|
1507
|
+
size: size,
|
|
1508
|
+
});
|
|
1509
|
+
const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken, body);
|
|
1523
1510
|
return data;
|
|
1524
1511
|
}
|
|
1525
1512
|
|
|
1526
|
-
async
|
|
1513
|
+
async searchProjectPhotosNaturalLanguageAuto(projectTableName, searchText, size = undefined, { blend, minCosine } = {}) {
|
|
1527
1514
|
this._ctx.requireTokens();
|
|
1528
|
-
let path = `/api/v1/search/
|
|
1515
|
+
let path = `/api/v1/search/auto/${encodeURIComponent(projectTableName)}/`;
|
|
1529
1516
|
const query = new URLSearchParams();
|
|
1517
|
+
if (blend !== undefined) (Array.isArray(blend) ? blend : [blend]).forEach(v => query.append('blend', v));
|
|
1530
1518
|
if (minCosine !== undefined) (Array.isArray(minCosine) ? minCosine : [minCosine]).forEach(v => query.append('min_cosine', v));
|
|
1531
|
-
if (labelMinCosine !== undefined) (Array.isArray(labelMinCosine) ? labelMinCosine : [labelMinCosine]).forEach(v => query.append('label_min_cosine', v));
|
|
1532
|
-
if (labelTopK !== undefined) (Array.isArray(labelTopK) ? labelTopK : [labelTopK]).forEach(v => query.append('label_top_k', v));
|
|
1533
|
-
if (labelDelta !== undefined) (Array.isArray(labelDelta) ? labelDelta : [labelDelta]).forEach(v => query.append('label_delta', v));
|
|
1534
|
-
if (bestOfSimilarSetsOnly !== undefined) (Array.isArray(bestOfSimilarSetsOnly) ? bestOfSimilarSetsOnly : [bestOfSimilarSetsOnly]).forEach(v => query.append('best_of_similar_sets_only', v));
|
|
1535
|
-
if (splitByTier !== undefined) (Array.isArray(splitByTier) ? splitByTier : [splitByTier]).forEach(v => query.append('split_by_tier', v));
|
|
1536
1519
|
const qs = query.toString();
|
|
1537
1520
|
if (qs) path += '?' + qs;
|
|
1538
1521
|
const body = stripUndef$1({
|
package/dist/sdk.d.cts
CHANGED
|
@@ -85,11 +85,10 @@ export interface CompanyDisplay {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
export interface CompanyKeywordListOverview {
|
|
88
|
-
id: number;
|
|
89
88
|
name: string;
|
|
90
89
|
active_keywords: number;
|
|
91
90
|
excluded_keywords: number;
|
|
92
|
-
|
|
91
|
+
is_active: boolean;
|
|
93
92
|
}
|
|
94
93
|
|
|
95
94
|
export interface CreditBalanceOutput {
|
|
@@ -377,12 +376,10 @@ export class Keywords {
|
|
|
377
376
|
updateKeywordFilteringListLabels(keywordListId: number, listKeywordsToInclude: number[], listKeywordsToExclude: number[]): Promise<KeywordListDisplayWithList>;
|
|
378
377
|
updateKeywordFilteringListDetails(keywordListId: number, body?: { name?: string, projectList?: string[] }): Promise<KeywordListDisplayWithProjects>;
|
|
379
378
|
addProjectsToKeywordFilteringList(keywordListId: number, options?: { projectIds?: any }): Promise<Record<string, any>>;
|
|
380
|
-
addCompanyToKeywordFilteringList(keywordListId: number, options?: { companyId?: number | number[] }): Promise<Record<string, any>>;
|
|
381
379
|
requestKeywordListExport(keywordListId: number): Promise<Record<string, any>>;
|
|
382
380
|
requestKeywordListExportStatus(keywordListId: number): Promise<AnalysisStatusResponse>;
|
|
383
381
|
getKeywordsAndIds(): Promise<any>;
|
|
384
382
|
removeProjectsFromKeywordFilteringList(keywordListId: number, options?: { projectIds?: any }): Promise<Record<string, any>>;
|
|
385
|
-
removeCompanyFromKeywordFilteringList(keywordListId: number, options?: { companyId?: number | number[] }): Promise<Record<string, any>>;
|
|
386
383
|
deleteKeywordFilteringListById(keywordListId: number): Promise<Record<string, any>>;
|
|
387
384
|
}
|
|
388
385
|
|
|
@@ -411,7 +408,6 @@ export class Person {
|
|
|
411
408
|
splitPersons(projectTableName: string, id: number, options?: { newName?: string | string[], destinationPersonId?: string | string[] }): Promise<PhotoPersonLight>;
|
|
412
409
|
getAllPersonsFromProject(projectTableName: string): Promise<PhotoPersonWithS3Link[]>;
|
|
413
410
|
getAllPersonNamesFromProject(projectTableName: string): Promise<any>;
|
|
414
|
-
getPhotoIdsByPersons(projectTableName: string, options?: { personId?: string[] | string[][] }): Promise<any>;
|
|
415
411
|
getAllPersonsFromPhoto(projectTableName: string, photoId: number): Promise<PhotoPersonLight[]>;
|
|
416
412
|
}
|
|
417
413
|
|
|
@@ -426,6 +422,7 @@ export class Photos {
|
|
|
426
422
|
getProjectPhotoIdsByTableName(tableName: string, options?: { ascOrDesc?: string | string[], lastId?: number | number[], limit?: number | number[], includeAll?: boolean | boolean[], startDate?: string | string[], endDate?: string | string[], noDateTaken?: boolean | boolean[] }): Promise<any>;
|
|
427
423
|
getRankedProjectPhotoIdsByTableName(tableName: string, options?: { ascOrDesc?: string | string[], lastId?: number | number[], limit?: number | number[], startDate?: string | string[], endDate?: string | string[], noDateTaken?: boolean | boolean[] }): Promise<Record<string, any>>;
|
|
428
424
|
getProjectMonthYearsWithPhotos(tableName: string): Promise<any>;
|
|
425
|
+
getProjectThumbnail(tableName: string): Promise<any>;
|
|
429
426
|
updatePhotoInProject(options?: { tableName?: string | string[], photoId?: number | number[], photoData?: Record<string, any> | Record<string, any>[] }): Promise<PhotoDisplay>;
|
|
430
427
|
updatePhotoRanking(tableName: string, photoId: number, newCategory: string): Promise<Record<string, any>>;
|
|
431
428
|
deletePhotoFromProject(tableName: string, options?: { photoIds?: any }): Promise<Record<string, any>>;
|
|
@@ -455,8 +452,10 @@ export class Projects {
|
|
|
455
452
|
|
|
456
453
|
export class Search {
|
|
457
454
|
searchProjectPhotos(projectTableName: string, options?: { andParams?: any, andStringParams?: any, orParams?: any, orStringParams?: any, notParams?: any, notStringParams?: any, dateMin?: string | string[], dateMax?: string | string[], dateNullAnd?: boolean | boolean[], dateNullOr?: boolean | boolean[], dateOrder?: string | string[], customAlbumId?: number | number[], bestOfSimilarSetsOnly?: boolean | boolean[], curatedAlbumId?: number | number[], splitByTier?: boolean | boolean[] }): Promise<Record<string, any>>;
|
|
458
|
-
|
|
459
|
-
searchProjectPhotosNaturalLanguage(projectTableName: string, searchText: string, size?: number
|
|
455
|
+
searchProjectPhotosText(projectTableName: string, searchText: string, size?: number): Promise<any>;
|
|
456
|
+
searchProjectPhotosNaturalLanguage(projectTableName: string, searchText: string, size?: number): Promise<any>;
|
|
457
|
+
searchProjectPhotosNaturalLanguageHybrid(projectTableName: string, searchText: string, size?: number, options?: { blend?: string | string[], minCosine?: number | number[] }): Promise<any>;
|
|
458
|
+
searchProjectPhotosNaturalLanguageAuto(projectTableName: string, searchText: string, size?: number, options?: { blend?: string | string[], minCosine?: number | number[] }): Promise<any>;
|
|
460
459
|
getProjectSavedSearches(projectTableName: string): Promise<any>;
|
|
461
460
|
getSavedSearchById(searchId: number): Promise<SearchDisplay>;
|
|
462
461
|
saveProjectPhotosSearch(projectTableName: string, options?: { searchName?: string | string[], andParams?: any, andStringParams?: any, orParams?: any, orStringParams?: any, notParams?: any, notStringParams?: any, dateMin?: string | string[], dateMax?: string | string[], dateNullAnd?: boolean | boolean[], dateNullOr?: boolean | boolean[], dateOrder?: string | string[], customAlbumId?: number | number[], bestOfSimilarSetsOnly?: boolean | boolean[], curatedAlbumId?: number | number[], splitByTier?: boolean | boolean[] }): Promise<Record<string, any>>;
|
package/dist/sdk.d.ts
CHANGED
|
@@ -85,11 +85,10 @@ export interface CompanyDisplay {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
export interface CompanyKeywordListOverview {
|
|
88
|
-
id: number;
|
|
89
88
|
name: string;
|
|
90
89
|
active_keywords: number;
|
|
91
90
|
excluded_keywords: number;
|
|
92
|
-
|
|
91
|
+
is_active: boolean;
|
|
93
92
|
}
|
|
94
93
|
|
|
95
94
|
export interface CreditBalanceOutput {
|
|
@@ -377,12 +376,10 @@ export class Keywords {
|
|
|
377
376
|
updateKeywordFilteringListLabels(keywordListId: number, listKeywordsToInclude: number[], listKeywordsToExclude: number[]): Promise<KeywordListDisplayWithList>;
|
|
378
377
|
updateKeywordFilteringListDetails(keywordListId: number, body?: { name?: string, projectList?: string[] }): Promise<KeywordListDisplayWithProjects>;
|
|
379
378
|
addProjectsToKeywordFilteringList(keywordListId: number, options?: { projectIds?: any }): Promise<Record<string, any>>;
|
|
380
|
-
addCompanyToKeywordFilteringList(keywordListId: number, options?: { companyId?: number | number[] }): Promise<Record<string, any>>;
|
|
381
379
|
requestKeywordListExport(keywordListId: number): Promise<Record<string, any>>;
|
|
382
380
|
requestKeywordListExportStatus(keywordListId: number): Promise<AnalysisStatusResponse>;
|
|
383
381
|
getKeywordsAndIds(): Promise<any>;
|
|
384
382
|
removeProjectsFromKeywordFilteringList(keywordListId: number, options?: { projectIds?: any }): Promise<Record<string, any>>;
|
|
385
|
-
removeCompanyFromKeywordFilteringList(keywordListId: number, options?: { companyId?: number | number[] }): Promise<Record<string, any>>;
|
|
386
383
|
deleteKeywordFilteringListById(keywordListId: number): Promise<Record<string, any>>;
|
|
387
384
|
}
|
|
388
385
|
|
|
@@ -411,7 +408,6 @@ export class Person {
|
|
|
411
408
|
splitPersons(projectTableName: string, id: number, options?: { newName?: string | string[], destinationPersonId?: string | string[] }): Promise<PhotoPersonLight>;
|
|
412
409
|
getAllPersonsFromProject(projectTableName: string): Promise<PhotoPersonWithS3Link[]>;
|
|
413
410
|
getAllPersonNamesFromProject(projectTableName: string): Promise<any>;
|
|
414
|
-
getPhotoIdsByPersons(projectTableName: string, options?: { personId?: string[] | string[][] }): Promise<any>;
|
|
415
411
|
getAllPersonsFromPhoto(projectTableName: string, photoId: number): Promise<PhotoPersonLight[]>;
|
|
416
412
|
}
|
|
417
413
|
|
|
@@ -426,6 +422,7 @@ export class Photos {
|
|
|
426
422
|
getProjectPhotoIdsByTableName(tableName: string, options?: { ascOrDesc?: string | string[], lastId?: number | number[], limit?: number | number[], includeAll?: boolean | boolean[], startDate?: string | string[], endDate?: string | string[], noDateTaken?: boolean | boolean[] }): Promise<any>;
|
|
427
423
|
getRankedProjectPhotoIdsByTableName(tableName: string, options?: { ascOrDesc?: string | string[], lastId?: number | number[], limit?: number | number[], startDate?: string | string[], endDate?: string | string[], noDateTaken?: boolean | boolean[] }): Promise<Record<string, any>>;
|
|
428
424
|
getProjectMonthYearsWithPhotos(tableName: string): Promise<any>;
|
|
425
|
+
getProjectThumbnail(tableName: string): Promise<any>;
|
|
429
426
|
updatePhotoInProject(options?: { tableName?: string | string[], photoId?: number | number[], photoData?: Record<string, any> | Record<string, any>[] }): Promise<PhotoDisplay>;
|
|
430
427
|
updatePhotoRanking(tableName: string, photoId: number, newCategory: string): Promise<Record<string, any>>;
|
|
431
428
|
deletePhotoFromProject(tableName: string, options?: { photoIds?: any }): Promise<Record<string, any>>;
|
|
@@ -455,8 +452,10 @@ export class Projects {
|
|
|
455
452
|
|
|
456
453
|
export class Search {
|
|
457
454
|
searchProjectPhotos(projectTableName: string, options?: { andParams?: any, andStringParams?: any, orParams?: any, orStringParams?: any, notParams?: any, notStringParams?: any, dateMin?: string | string[], dateMax?: string | string[], dateNullAnd?: boolean | boolean[], dateNullOr?: boolean | boolean[], dateOrder?: string | string[], customAlbumId?: number | number[], bestOfSimilarSetsOnly?: boolean | boolean[], curatedAlbumId?: number | number[], splitByTier?: boolean | boolean[] }): Promise<Record<string, any>>;
|
|
458
|
-
|
|
459
|
-
searchProjectPhotosNaturalLanguage(projectTableName: string, searchText: string, size?: number
|
|
455
|
+
searchProjectPhotosText(projectTableName: string, searchText: string, size?: number): Promise<any>;
|
|
456
|
+
searchProjectPhotosNaturalLanguage(projectTableName: string, searchText: string, size?: number): Promise<any>;
|
|
457
|
+
searchProjectPhotosNaturalLanguageHybrid(projectTableName: string, searchText: string, size?: number, options?: { blend?: string | string[], minCosine?: number | number[] }): Promise<any>;
|
|
458
|
+
searchProjectPhotosNaturalLanguageAuto(projectTableName: string, searchText: string, size?: number, options?: { blend?: string | string[], minCosine?: number | number[] }): Promise<any>;
|
|
460
459
|
getProjectSavedSearches(projectTableName: string): Promise<any>;
|
|
461
460
|
getSavedSearchById(searchId: number): Promise<SearchDisplay>;
|
|
462
461
|
saveProjectPhotosSearch(projectTableName: string, options?: { searchName?: string | string[], andParams?: any, andStringParams?: any, orParams?: any, orStringParams?: any, notParams?: any, notStringParams?: any, dateMin?: string | string[], dateMax?: string | string[], dateNullAnd?: boolean | boolean[], dateNullOr?: boolean | boolean[], dateOrder?: string | string[], customAlbumId?: number | number[], bestOfSimilarSetsOnly?: boolean | boolean[], curatedAlbumId?: number | number[], splitByTier?: boolean | boolean[] }): Promise<Record<string, any>>;
|
package/dist/sdk.esm.d.ts
CHANGED
|
@@ -85,11 +85,10 @@ export interface CompanyDisplay {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
export interface CompanyKeywordListOverview {
|
|
88
|
-
id: number;
|
|
89
88
|
name: string;
|
|
90
89
|
active_keywords: number;
|
|
91
90
|
excluded_keywords: number;
|
|
92
|
-
|
|
91
|
+
is_active: boolean;
|
|
93
92
|
}
|
|
94
93
|
|
|
95
94
|
export interface CreditBalanceOutput {
|
|
@@ -377,12 +376,10 @@ export class Keywords {
|
|
|
377
376
|
updateKeywordFilteringListLabels(keywordListId: number, listKeywordsToInclude: number[], listKeywordsToExclude: number[]): Promise<KeywordListDisplayWithList>;
|
|
378
377
|
updateKeywordFilteringListDetails(keywordListId: number, body?: { name?: string, projectList?: string[] }): Promise<KeywordListDisplayWithProjects>;
|
|
379
378
|
addProjectsToKeywordFilteringList(keywordListId: number, options?: { projectIds?: any }): Promise<Record<string, any>>;
|
|
380
|
-
addCompanyToKeywordFilteringList(keywordListId: number, options?: { companyId?: number | number[] }): Promise<Record<string, any>>;
|
|
381
379
|
requestKeywordListExport(keywordListId: number): Promise<Record<string, any>>;
|
|
382
380
|
requestKeywordListExportStatus(keywordListId: number): Promise<AnalysisStatusResponse>;
|
|
383
381
|
getKeywordsAndIds(): Promise<any>;
|
|
384
382
|
removeProjectsFromKeywordFilteringList(keywordListId: number, options?: { projectIds?: any }): Promise<Record<string, any>>;
|
|
385
|
-
removeCompanyFromKeywordFilteringList(keywordListId: number, options?: { companyId?: number | number[] }): Promise<Record<string, any>>;
|
|
386
383
|
deleteKeywordFilteringListById(keywordListId: number): Promise<Record<string, any>>;
|
|
387
384
|
}
|
|
388
385
|
|
|
@@ -411,7 +408,6 @@ export class Person {
|
|
|
411
408
|
splitPersons(projectTableName: string, id: number, options?: { newName?: string | string[], destinationPersonId?: string | string[] }): Promise<PhotoPersonLight>;
|
|
412
409
|
getAllPersonsFromProject(projectTableName: string): Promise<PhotoPersonWithS3Link[]>;
|
|
413
410
|
getAllPersonNamesFromProject(projectTableName: string): Promise<any>;
|
|
414
|
-
getPhotoIdsByPersons(projectTableName: string, options?: { personId?: string[] | string[][] }): Promise<any>;
|
|
415
411
|
getAllPersonsFromPhoto(projectTableName: string, photoId: number): Promise<PhotoPersonLight[]>;
|
|
416
412
|
}
|
|
417
413
|
|
|
@@ -426,6 +422,7 @@ export class Photos {
|
|
|
426
422
|
getProjectPhotoIdsByTableName(tableName: string, options?: { ascOrDesc?: string | string[], lastId?: number | number[], limit?: number | number[], includeAll?: boolean | boolean[], startDate?: string | string[], endDate?: string | string[], noDateTaken?: boolean | boolean[] }): Promise<any>;
|
|
427
423
|
getRankedProjectPhotoIdsByTableName(tableName: string, options?: { ascOrDesc?: string | string[], lastId?: number | number[], limit?: number | number[], startDate?: string | string[], endDate?: string | string[], noDateTaken?: boolean | boolean[] }): Promise<Record<string, any>>;
|
|
428
424
|
getProjectMonthYearsWithPhotos(tableName: string): Promise<any>;
|
|
425
|
+
getProjectThumbnail(tableName: string): Promise<any>;
|
|
429
426
|
updatePhotoInProject(options?: { tableName?: string | string[], photoId?: number | number[], photoData?: Record<string, any> | Record<string, any>[] }): Promise<PhotoDisplay>;
|
|
430
427
|
updatePhotoRanking(tableName: string, photoId: number, newCategory: string): Promise<Record<string, any>>;
|
|
431
428
|
deletePhotoFromProject(tableName: string, options?: { photoIds?: any }): Promise<Record<string, any>>;
|
|
@@ -455,8 +452,10 @@ export class Projects {
|
|
|
455
452
|
|
|
456
453
|
export class Search {
|
|
457
454
|
searchProjectPhotos(projectTableName: string, options?: { andParams?: any, andStringParams?: any, orParams?: any, orStringParams?: any, notParams?: any, notStringParams?: any, dateMin?: string | string[], dateMax?: string | string[], dateNullAnd?: boolean | boolean[], dateNullOr?: boolean | boolean[], dateOrder?: string | string[], customAlbumId?: number | number[], bestOfSimilarSetsOnly?: boolean | boolean[], curatedAlbumId?: number | number[], splitByTier?: boolean | boolean[] }): Promise<Record<string, any>>;
|
|
458
|
-
|
|
459
|
-
searchProjectPhotosNaturalLanguage(projectTableName: string, searchText: string, size?: number
|
|
455
|
+
searchProjectPhotosText(projectTableName: string, searchText: string, size?: number): Promise<any>;
|
|
456
|
+
searchProjectPhotosNaturalLanguage(projectTableName: string, searchText: string, size?: number): Promise<any>;
|
|
457
|
+
searchProjectPhotosNaturalLanguageHybrid(projectTableName: string, searchText: string, size?: number, options?: { blend?: string | string[], minCosine?: number | number[] }): Promise<any>;
|
|
458
|
+
searchProjectPhotosNaturalLanguageAuto(projectTableName: string, searchText: string, size?: number, options?: { blend?: string | string[], minCosine?: number | number[] }): Promise<any>;
|
|
460
459
|
getProjectSavedSearches(projectTableName: string): Promise<any>;
|
|
461
460
|
getSavedSearchById(searchId: number): Promise<SearchDisplay>;
|
|
462
461
|
saveProjectPhotosSearch(projectTableName: string, options?: { searchName?: string | string[], andParams?: any, andStringParams?: any, orParams?: any, orStringParams?: any, notParams?: any, notStringParams?: any, dateMin?: string | string[], dateMax?: string | string[], dateNullAnd?: boolean | boolean[], dateNullOr?: boolean | boolean[], dateOrder?: string | string[], customAlbumId?: number | number[], bestOfSimilarSetsOnly?: boolean | boolean[], curatedAlbumId?: number | number[], splitByTier?: boolean | boolean[] }): Promise<Record<string, any>>;
|
package/dist/sdk.esm.js
CHANGED
|
@@ -910,17 +910,6 @@ class Keywords {
|
|
|
910
910
|
return data;
|
|
911
911
|
}
|
|
912
912
|
|
|
913
|
-
async addCompanyToKeywordFilteringList(keywordListId, { companyId } = {}) {
|
|
914
|
-
this._ctx.requireTokens();
|
|
915
|
-
let path = `/api/v1/keyword/${encodeURIComponent(keywordListId)}/company`;
|
|
916
|
-
const query = new URLSearchParams();
|
|
917
|
-
if (companyId !== undefined) (Array.isArray(companyId) ? companyId : [companyId]).forEach(v => query.append('company_id', v));
|
|
918
|
-
const qs = query.toString();
|
|
919
|
-
if (qs) path += '?' + qs;
|
|
920
|
-
const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken);
|
|
921
|
-
return data;
|
|
922
|
-
}
|
|
923
|
-
|
|
924
913
|
async requestKeywordListExport(keywordListId) {
|
|
925
914
|
this._ctx.requireTokens();
|
|
926
915
|
const path = `/api/v1/keyword/export/${encodeURIComponent(keywordListId)}`;
|
|
@@ -953,17 +942,6 @@ class Keywords {
|
|
|
953
942
|
return data;
|
|
954
943
|
}
|
|
955
944
|
|
|
956
|
-
async removeCompanyFromKeywordFilteringList(keywordListId, { companyId } = {}) {
|
|
957
|
-
this._ctx.requireTokens();
|
|
958
|
-
let path = `/api/v1/keyword/${encodeURIComponent(keywordListId)}/company`;
|
|
959
|
-
const query = new URLSearchParams();
|
|
960
|
-
if (companyId !== undefined) (Array.isArray(companyId) ? companyId : [companyId]).forEach(v => query.append('company_id', v));
|
|
961
|
-
const qs = query.toString();
|
|
962
|
-
if (qs) path += '?' + qs;
|
|
963
|
-
const { data } = await this._ctx.client.request(path, 'DELETE', this._ctx.accessToken, this._ctx.refreshToken);
|
|
964
|
-
return data;
|
|
965
|
-
}
|
|
966
|
-
|
|
967
945
|
async deleteKeywordFilteringListById(keywordListId) {
|
|
968
946
|
this._ctx.requireTokens();
|
|
969
947
|
const path = `/api/v1/keyword/${encodeURIComponent(keywordListId)}`;
|
|
@@ -1123,17 +1101,6 @@ class Person {
|
|
|
1123
1101
|
return data;
|
|
1124
1102
|
}
|
|
1125
1103
|
|
|
1126
|
-
async getPhotoIdsByPersons(projectTableName, { personId } = {}) {
|
|
1127
|
-
this._ctx.requireTokens();
|
|
1128
|
-
let path = `/api/v1/person/${encodeURIComponent(projectTableName)}/photos`;
|
|
1129
|
-
const query = new URLSearchParams();
|
|
1130
|
-
if (personId !== undefined) (Array.isArray(personId) ? personId : [personId]).forEach(v => query.append('person_id', v));
|
|
1131
|
-
const qs = query.toString();
|
|
1132
|
-
if (qs) path += '?' + qs;
|
|
1133
|
-
const { data } = await this._ctx.client.request(path, 'GET', this._ctx.accessToken, this._ctx.refreshToken);
|
|
1134
|
-
return data;
|
|
1135
|
-
}
|
|
1136
|
-
|
|
1137
1104
|
async getAllPersonsFromPhoto(projectTableName, photoId) {
|
|
1138
1105
|
this._ctx.requireTokens();
|
|
1139
1106
|
const path = `/api/v1/person/${encodeURIComponent(projectTableName)}/photo/${encodeURIComponent(photoId)}`;
|
|
@@ -1434,6 +1401,13 @@ class Photos {
|
|
|
1434
1401
|
return data;
|
|
1435
1402
|
}
|
|
1436
1403
|
|
|
1404
|
+
async getProjectThumbnail(tableName) {
|
|
1405
|
+
this._ctx.requireTokens();
|
|
1406
|
+
const path = `/api/v1/photos_project/${encodeURIComponent(tableName)}`;
|
|
1407
|
+
const { data } = await this._ctx.client.request(path, 'GET', this._ctx.accessToken, this._ctx.refreshToken);
|
|
1408
|
+
return data;
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1437
1411
|
async updatePhotoInProject({ tableName, photoId, photoData } = {}) {
|
|
1438
1412
|
this._ctx.requireTokens();
|
|
1439
1413
|
let path = `/api/v1/photos_update`;
|
|
@@ -1496,41 +1470,50 @@ class Search {
|
|
|
1496
1470
|
return data;
|
|
1497
1471
|
}
|
|
1498
1472
|
|
|
1499
|
-
async
|
|
1473
|
+
async searchProjectPhotosText(projectTableName, searchText, size = undefined) {
|
|
1474
|
+
this._ctx.requireTokens();
|
|
1475
|
+
const path = `/api/v1/search/text/${encodeURIComponent(projectTableName)}/`;
|
|
1476
|
+
const body = stripUndef$1({
|
|
1477
|
+
search_text: searchText,
|
|
1478
|
+
size: size,
|
|
1479
|
+
});
|
|
1480
|
+
const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken, body);
|
|
1481
|
+
return data;
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
async searchProjectPhotosNaturalLanguage(projectTableName, searchText, size = undefined) {
|
|
1485
|
+
this._ctx.requireTokens();
|
|
1486
|
+
const path = `/api/v1/search/nl/${encodeURIComponent(projectTableName)}/`;
|
|
1487
|
+
const body = stripUndef$1({
|
|
1488
|
+
search_text: searchText,
|
|
1489
|
+
size: size,
|
|
1490
|
+
});
|
|
1491
|
+
const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken, body);
|
|
1492
|
+
return data;
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
async searchProjectPhotosNaturalLanguageHybrid(projectTableName, searchText, size = undefined, { blend, minCosine } = {}) {
|
|
1500
1496
|
this._ctx.requireTokens();
|
|
1501
|
-
let path = `/api/v1/search/
|
|
1497
|
+
let path = `/api/v1/search/nl_hybrid/${encodeURIComponent(projectTableName)}/`;
|
|
1502
1498
|
const query = new URLSearchParams();
|
|
1503
|
-
if (
|
|
1504
|
-
if (
|
|
1505
|
-
if (notSearchText !== undefined) (Array.isArray(notSearchText) ? notSearchText : [notSearchText]).forEach(v => query.append('not_search_text', v));
|
|
1506
|
-
if (city !== undefined) (Array.isArray(city) ? city : [city]).forEach(v => query.append('city', v));
|
|
1507
|
-
if (country !== undefined) (Array.isArray(country) ? country : [country]).forEach(v => query.append('country', v));
|
|
1508
|
-
if (state !== undefined) (Array.isArray(state) ? state : [state]).forEach(v => query.append('state', v));
|
|
1509
|
-
if (albums !== undefined) (Array.isArray(albums) ? albums : [albums]).forEach(v => query.append('albums', v));
|
|
1510
|
-
if (dateMin !== undefined) (Array.isArray(dateMin) ? dateMin : [dateMin]).forEach(v => query.append('date_min', v));
|
|
1511
|
-
if (dateMax !== undefined) (Array.isArray(dateMax) ? dateMax : [dateMax]).forEach(v => query.append('date_max', v));
|
|
1512
|
-
if (dateNullAnd !== undefined) (Array.isArray(dateNullAnd) ? dateNullAnd : [dateNullAnd]).forEach(v => query.append('date_null_and', v));
|
|
1513
|
-
if (dateNullOr !== undefined) (Array.isArray(dateNullOr) ? dateNullOr : [dateNullOr]).forEach(v => query.append('date_null_or', v));
|
|
1514
|
-
if (dateOrder !== undefined) (Array.isArray(dateOrder) ? dateOrder : [dateOrder]).forEach(v => query.append('date_order', v));
|
|
1515
|
-
if (bestOfSimilarSetsOnly !== undefined) (Array.isArray(bestOfSimilarSetsOnly) ? bestOfSimilarSetsOnly : [bestOfSimilarSetsOnly]).forEach(v => query.append('best_of_similar_sets_only', v));
|
|
1516
|
-
if (splitByTier !== undefined) (Array.isArray(splitByTier) ? splitByTier : [splitByTier]).forEach(v => query.append('split_by_tier', v));
|
|
1517
|
-
if (size !== undefined) (Array.isArray(size) ? size : [size]).forEach(v => query.append('size', v));
|
|
1499
|
+
if (blend !== undefined) (Array.isArray(blend) ? blend : [blend]).forEach(v => query.append('blend', v));
|
|
1500
|
+
if (minCosine !== undefined) (Array.isArray(minCosine) ? minCosine : [minCosine]).forEach(v => query.append('min_cosine', v));
|
|
1518
1501
|
const qs = query.toString();
|
|
1519
1502
|
if (qs) path += '?' + qs;
|
|
1520
|
-
const
|
|
1503
|
+
const body = stripUndef$1({
|
|
1504
|
+
search_text: searchText,
|
|
1505
|
+
size: size,
|
|
1506
|
+
});
|
|
1507
|
+
const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken, body);
|
|
1521
1508
|
return data;
|
|
1522
1509
|
}
|
|
1523
1510
|
|
|
1524
|
-
async
|
|
1511
|
+
async searchProjectPhotosNaturalLanguageAuto(projectTableName, searchText, size = undefined, { blend, minCosine } = {}) {
|
|
1525
1512
|
this._ctx.requireTokens();
|
|
1526
|
-
let path = `/api/v1/search/
|
|
1513
|
+
let path = `/api/v1/search/auto/${encodeURIComponent(projectTableName)}/`;
|
|
1527
1514
|
const query = new URLSearchParams();
|
|
1515
|
+
if (blend !== undefined) (Array.isArray(blend) ? blend : [blend]).forEach(v => query.append('blend', v));
|
|
1528
1516
|
if (minCosine !== undefined) (Array.isArray(minCosine) ? minCosine : [minCosine]).forEach(v => query.append('min_cosine', v));
|
|
1529
|
-
if (labelMinCosine !== undefined) (Array.isArray(labelMinCosine) ? labelMinCosine : [labelMinCosine]).forEach(v => query.append('label_min_cosine', v));
|
|
1530
|
-
if (labelTopK !== undefined) (Array.isArray(labelTopK) ? labelTopK : [labelTopK]).forEach(v => query.append('label_top_k', v));
|
|
1531
|
-
if (labelDelta !== undefined) (Array.isArray(labelDelta) ? labelDelta : [labelDelta]).forEach(v => query.append('label_delta', v));
|
|
1532
|
-
if (bestOfSimilarSetsOnly !== undefined) (Array.isArray(bestOfSimilarSetsOnly) ? bestOfSimilarSetsOnly : [bestOfSimilarSetsOnly]).forEach(v => query.append('best_of_similar_sets_only', v));
|
|
1533
|
-
if (splitByTier !== undefined) (Array.isArray(splitByTier) ? splitByTier : [splitByTier]).forEach(v => query.append('split_by_tier', v));
|
|
1534
1517
|
const qs = query.toString();
|
|
1535
1518
|
if (qs) path += '?' + qs;
|
|
1536
1519
|
const body = stripUndef$1({
|
package/dist/sdk.umd.js
CHANGED
|
@@ -916,17 +916,6 @@
|
|
|
916
916
|
return data;
|
|
917
917
|
}
|
|
918
918
|
|
|
919
|
-
async addCompanyToKeywordFilteringList(keywordListId, { companyId } = {}) {
|
|
920
|
-
this._ctx.requireTokens();
|
|
921
|
-
let path = `/api/v1/keyword/${encodeURIComponent(keywordListId)}/company`;
|
|
922
|
-
const query = new URLSearchParams();
|
|
923
|
-
if (companyId !== undefined) (Array.isArray(companyId) ? companyId : [companyId]).forEach(v => query.append('company_id', v));
|
|
924
|
-
const qs = query.toString();
|
|
925
|
-
if (qs) path += '?' + qs;
|
|
926
|
-
const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken);
|
|
927
|
-
return data;
|
|
928
|
-
}
|
|
929
|
-
|
|
930
919
|
async requestKeywordListExport(keywordListId) {
|
|
931
920
|
this._ctx.requireTokens();
|
|
932
921
|
const path = `/api/v1/keyword/export/${encodeURIComponent(keywordListId)}`;
|
|
@@ -959,17 +948,6 @@
|
|
|
959
948
|
return data;
|
|
960
949
|
}
|
|
961
950
|
|
|
962
|
-
async removeCompanyFromKeywordFilteringList(keywordListId, { companyId } = {}) {
|
|
963
|
-
this._ctx.requireTokens();
|
|
964
|
-
let path = `/api/v1/keyword/${encodeURIComponent(keywordListId)}/company`;
|
|
965
|
-
const query = new URLSearchParams();
|
|
966
|
-
if (companyId !== undefined) (Array.isArray(companyId) ? companyId : [companyId]).forEach(v => query.append('company_id', v));
|
|
967
|
-
const qs = query.toString();
|
|
968
|
-
if (qs) path += '?' + qs;
|
|
969
|
-
const { data } = await this._ctx.client.request(path, 'DELETE', this._ctx.accessToken, this._ctx.refreshToken);
|
|
970
|
-
return data;
|
|
971
|
-
}
|
|
972
|
-
|
|
973
951
|
async deleteKeywordFilteringListById(keywordListId) {
|
|
974
952
|
this._ctx.requireTokens();
|
|
975
953
|
const path = `/api/v1/keyword/${encodeURIComponent(keywordListId)}`;
|
|
@@ -1129,17 +1107,6 @@
|
|
|
1129
1107
|
return data;
|
|
1130
1108
|
}
|
|
1131
1109
|
|
|
1132
|
-
async getPhotoIdsByPersons(projectTableName, { personId } = {}) {
|
|
1133
|
-
this._ctx.requireTokens();
|
|
1134
|
-
let path = `/api/v1/person/${encodeURIComponent(projectTableName)}/photos`;
|
|
1135
|
-
const query = new URLSearchParams();
|
|
1136
|
-
if (personId !== undefined) (Array.isArray(personId) ? personId : [personId]).forEach(v => query.append('person_id', v));
|
|
1137
|
-
const qs = query.toString();
|
|
1138
|
-
if (qs) path += '?' + qs;
|
|
1139
|
-
const { data } = await this._ctx.client.request(path, 'GET', this._ctx.accessToken, this._ctx.refreshToken);
|
|
1140
|
-
return data;
|
|
1141
|
-
}
|
|
1142
|
-
|
|
1143
1110
|
async getAllPersonsFromPhoto(projectTableName, photoId) {
|
|
1144
1111
|
this._ctx.requireTokens();
|
|
1145
1112
|
const path = `/api/v1/person/${encodeURIComponent(projectTableName)}/photo/${encodeURIComponent(photoId)}`;
|
|
@@ -1440,6 +1407,13 @@
|
|
|
1440
1407
|
return data;
|
|
1441
1408
|
}
|
|
1442
1409
|
|
|
1410
|
+
async getProjectThumbnail(tableName) {
|
|
1411
|
+
this._ctx.requireTokens();
|
|
1412
|
+
const path = `/api/v1/photos_project/${encodeURIComponent(tableName)}`;
|
|
1413
|
+
const { data } = await this._ctx.client.request(path, 'GET', this._ctx.accessToken, this._ctx.refreshToken);
|
|
1414
|
+
return data;
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1443
1417
|
async updatePhotoInProject({ tableName, photoId, photoData } = {}) {
|
|
1444
1418
|
this._ctx.requireTokens();
|
|
1445
1419
|
let path = `/api/v1/photos_update`;
|
|
@@ -1502,41 +1476,50 @@
|
|
|
1502
1476
|
return data;
|
|
1503
1477
|
}
|
|
1504
1478
|
|
|
1505
|
-
async
|
|
1479
|
+
async searchProjectPhotosText(projectTableName, searchText, size = undefined) {
|
|
1480
|
+
this._ctx.requireTokens();
|
|
1481
|
+
const path = `/api/v1/search/text/${encodeURIComponent(projectTableName)}/`;
|
|
1482
|
+
const body = stripUndef$1({
|
|
1483
|
+
search_text: searchText,
|
|
1484
|
+
size: size,
|
|
1485
|
+
});
|
|
1486
|
+
const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken, body);
|
|
1487
|
+
return data;
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
async searchProjectPhotosNaturalLanguage(projectTableName, searchText, size = undefined) {
|
|
1491
|
+
this._ctx.requireTokens();
|
|
1492
|
+
const path = `/api/v1/search/nl/${encodeURIComponent(projectTableName)}/`;
|
|
1493
|
+
const body = stripUndef$1({
|
|
1494
|
+
search_text: searchText,
|
|
1495
|
+
size: size,
|
|
1496
|
+
});
|
|
1497
|
+
const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken, body);
|
|
1498
|
+
return data;
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
async searchProjectPhotosNaturalLanguageHybrid(projectTableName, searchText, size = undefined, { blend, minCosine } = {}) {
|
|
1506
1502
|
this._ctx.requireTokens();
|
|
1507
|
-
let path = `/api/v1/search/
|
|
1503
|
+
let path = `/api/v1/search/nl_hybrid/${encodeURIComponent(projectTableName)}/`;
|
|
1508
1504
|
const query = new URLSearchParams();
|
|
1509
|
-
if (
|
|
1510
|
-
if (
|
|
1511
|
-
if (notSearchText !== undefined) (Array.isArray(notSearchText) ? notSearchText : [notSearchText]).forEach(v => query.append('not_search_text', v));
|
|
1512
|
-
if (city !== undefined) (Array.isArray(city) ? city : [city]).forEach(v => query.append('city', v));
|
|
1513
|
-
if (country !== undefined) (Array.isArray(country) ? country : [country]).forEach(v => query.append('country', v));
|
|
1514
|
-
if (state !== undefined) (Array.isArray(state) ? state : [state]).forEach(v => query.append('state', v));
|
|
1515
|
-
if (albums !== undefined) (Array.isArray(albums) ? albums : [albums]).forEach(v => query.append('albums', v));
|
|
1516
|
-
if (dateMin !== undefined) (Array.isArray(dateMin) ? dateMin : [dateMin]).forEach(v => query.append('date_min', v));
|
|
1517
|
-
if (dateMax !== undefined) (Array.isArray(dateMax) ? dateMax : [dateMax]).forEach(v => query.append('date_max', v));
|
|
1518
|
-
if (dateNullAnd !== undefined) (Array.isArray(dateNullAnd) ? dateNullAnd : [dateNullAnd]).forEach(v => query.append('date_null_and', v));
|
|
1519
|
-
if (dateNullOr !== undefined) (Array.isArray(dateNullOr) ? dateNullOr : [dateNullOr]).forEach(v => query.append('date_null_or', v));
|
|
1520
|
-
if (dateOrder !== undefined) (Array.isArray(dateOrder) ? dateOrder : [dateOrder]).forEach(v => query.append('date_order', v));
|
|
1521
|
-
if (bestOfSimilarSetsOnly !== undefined) (Array.isArray(bestOfSimilarSetsOnly) ? bestOfSimilarSetsOnly : [bestOfSimilarSetsOnly]).forEach(v => query.append('best_of_similar_sets_only', v));
|
|
1522
|
-
if (splitByTier !== undefined) (Array.isArray(splitByTier) ? splitByTier : [splitByTier]).forEach(v => query.append('split_by_tier', v));
|
|
1523
|
-
if (size !== undefined) (Array.isArray(size) ? size : [size]).forEach(v => query.append('size', v));
|
|
1505
|
+
if (blend !== undefined) (Array.isArray(blend) ? blend : [blend]).forEach(v => query.append('blend', v));
|
|
1506
|
+
if (minCosine !== undefined) (Array.isArray(minCosine) ? minCosine : [minCosine]).forEach(v => query.append('min_cosine', v));
|
|
1524
1507
|
const qs = query.toString();
|
|
1525
1508
|
if (qs) path += '?' + qs;
|
|
1526
|
-
const
|
|
1509
|
+
const body = stripUndef$1({
|
|
1510
|
+
search_text: searchText,
|
|
1511
|
+
size: size,
|
|
1512
|
+
});
|
|
1513
|
+
const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken, body);
|
|
1527
1514
|
return data;
|
|
1528
1515
|
}
|
|
1529
1516
|
|
|
1530
|
-
async
|
|
1517
|
+
async searchProjectPhotosNaturalLanguageAuto(projectTableName, searchText, size = undefined, { blend, minCosine } = {}) {
|
|
1531
1518
|
this._ctx.requireTokens();
|
|
1532
|
-
let path = `/api/v1/search/
|
|
1519
|
+
let path = `/api/v1/search/auto/${encodeURIComponent(projectTableName)}/`;
|
|
1533
1520
|
const query = new URLSearchParams();
|
|
1521
|
+
if (blend !== undefined) (Array.isArray(blend) ? blend : [blend]).forEach(v => query.append('blend', v));
|
|
1534
1522
|
if (minCosine !== undefined) (Array.isArray(minCosine) ? minCosine : [minCosine]).forEach(v => query.append('min_cosine', v));
|
|
1535
|
-
if (labelMinCosine !== undefined) (Array.isArray(labelMinCosine) ? labelMinCosine : [labelMinCosine]).forEach(v => query.append('label_min_cosine', v));
|
|
1536
|
-
if (labelTopK !== undefined) (Array.isArray(labelTopK) ? labelTopK : [labelTopK]).forEach(v => query.append('label_top_k', v));
|
|
1537
|
-
if (labelDelta !== undefined) (Array.isArray(labelDelta) ? labelDelta : [labelDelta]).forEach(v => query.append('label_delta', v));
|
|
1538
|
-
if (bestOfSimilarSetsOnly !== undefined) (Array.isArray(bestOfSimilarSetsOnly) ? bestOfSimilarSetsOnly : [bestOfSimilarSetsOnly]).forEach(v => query.append('best_of_similar_sets_only', v));
|
|
1539
|
-
if (splitByTier !== undefined) (Array.isArray(splitByTier) ? splitByTier : [splitByTier]).forEach(v => query.append('split_by_tier', v));
|
|
1540
1523
|
const qs = query.toString();
|
|
1541
1524
|
if (qs) path += '?' + qs;
|
|
1542
1525
|
const body = stripUndef$1({
|