@mediaviz/sdk 1.8.0-rc.2 → 1.9.0-dev.106
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 +31 -29
- package/dist/sdk.d.cts +14 -4
- package/dist/sdk.d.ts +14 -4
- package/dist/sdk.esm.d.ts +14 -4
- package/dist/sdk.esm.js +31 -29
- package/dist/sdk.umd.js +31 -29
- package/package.json +1 -1
package/dist/sdk.cjs
CHANGED
|
@@ -969,7 +969,7 @@ class Company {
|
|
|
969
969
|
}
|
|
970
970
|
}
|
|
971
971
|
|
|
972
|
-
function stripUndef$
|
|
972
|
+
function stripUndef$8(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
|
|
973
973
|
|
|
974
974
|
class CuratedAlbums {
|
|
975
975
|
constructor(ctx) { this._ctx = ctx; }
|
|
@@ -977,7 +977,7 @@ class CuratedAlbums {
|
|
|
977
977
|
async createCuratedAlbum(projectTableName, name, description = undefined, confidenceValue = undefined) {
|
|
978
978
|
this._ctx.requireTokens();
|
|
979
979
|
const path = `/api/v1/curated_album/project/${encodeURIComponent(projectTableName)}`;
|
|
980
|
-
const body = stripUndef$
|
|
980
|
+
const body = stripUndef$8({
|
|
981
981
|
name: name,
|
|
982
982
|
description: description,
|
|
983
983
|
confidence_value: confidenceValue,
|
|
@@ -1031,7 +1031,7 @@ class CuratedAlbums {
|
|
|
1031
1031
|
async updateCuratedAlbum(albumId, { name, description, confidenceValue } = {}) {
|
|
1032
1032
|
this._ctx.requireTokens();
|
|
1033
1033
|
const path = `/api/v1/curated_album/${encodeURIComponent(albumId)}`;
|
|
1034
|
-
const body = stripUndef$
|
|
1034
|
+
const body = stripUndef$8({
|
|
1035
1035
|
name: name,
|
|
1036
1036
|
description: description,
|
|
1037
1037
|
confidence_value: confidenceValue,
|
|
@@ -1055,7 +1055,7 @@ class CuratedAlbums {
|
|
|
1055
1055
|
}
|
|
1056
1056
|
}
|
|
1057
1057
|
|
|
1058
|
-
function stripUndef$
|
|
1058
|
+
function stripUndef$7(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
|
|
1059
1059
|
|
|
1060
1060
|
class CustomAlbums {
|
|
1061
1061
|
constructor(ctx) { this._ctx = ctx; }
|
|
@@ -1103,7 +1103,7 @@ class CustomAlbums {
|
|
|
1103
1103
|
async createProjectCustomAlbum(projectTableName, { name, description, photoIdInclusionList, photoIdRemovalList } = {}) {
|
|
1104
1104
|
this._ctx.requireTokens();
|
|
1105
1105
|
const path = `/api/v1/custom_album/project/${encodeURIComponent(projectTableName)}`;
|
|
1106
|
-
const body = stripUndef$
|
|
1106
|
+
const body = stripUndef$7({
|
|
1107
1107
|
name: name,
|
|
1108
1108
|
description: description,
|
|
1109
1109
|
photo_id_inclusion_list: photoIdInclusionList,
|
|
@@ -1116,7 +1116,7 @@ class CustomAlbums {
|
|
|
1116
1116
|
async updateCustomAlbum(albumId, { name, description, photoIdInclusionList, photoIdRemovalList } = {}) {
|
|
1117
1117
|
this._ctx.requireTokens();
|
|
1118
1118
|
const path = `/api/v1/custom_album/${encodeURIComponent(albumId)}`;
|
|
1119
|
-
const body = stripUndef$
|
|
1119
|
+
const body = stripUndef$7({
|
|
1120
1120
|
name: name,
|
|
1121
1121
|
description: description,
|
|
1122
1122
|
photo_id_inclusion_list: photoIdInclusionList,
|
|
@@ -1216,7 +1216,7 @@ async function handleResponse(response) {
|
|
|
1216
1216
|
}
|
|
1217
1217
|
}
|
|
1218
1218
|
|
|
1219
|
-
function stripUndef$
|
|
1219
|
+
function stripUndef$6(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
|
|
1220
1220
|
|
|
1221
1221
|
class EmailTokens {
|
|
1222
1222
|
constructor(ctx) { this._ctx = ctx; }
|
|
@@ -1247,7 +1247,7 @@ class EmailTokens {
|
|
|
1247
1247
|
}
|
|
1248
1248
|
|
|
1249
1249
|
async validateToken(token) {
|
|
1250
|
-
const body = stripUndef$
|
|
1250
|
+
const body = stripUndef$6({
|
|
1251
1251
|
token: token,
|
|
1252
1252
|
});
|
|
1253
1253
|
const resp = await fetch(this._ctx.baseUrl + `/api/v1/validate-token`, {
|
|
@@ -1259,7 +1259,7 @@ class EmailTokens {
|
|
|
1259
1259
|
}
|
|
1260
1260
|
|
|
1261
1261
|
async resetPassword(token, newPassword) {
|
|
1262
|
-
const body = stripUndef$
|
|
1262
|
+
const body = stripUndef$6({
|
|
1263
1263
|
token: token,
|
|
1264
1264
|
new_password: newPassword,
|
|
1265
1265
|
});
|
|
@@ -1298,7 +1298,7 @@ class Health {
|
|
|
1298
1298
|
}
|
|
1299
1299
|
}
|
|
1300
1300
|
|
|
1301
|
-
function stripUndef$
|
|
1301
|
+
function stripUndef$5(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
|
|
1302
1302
|
|
|
1303
1303
|
class Keywords {
|
|
1304
1304
|
constructor(ctx) { this._ctx = ctx; }
|
|
@@ -1306,7 +1306,7 @@ class Keywords {
|
|
|
1306
1306
|
async createKeywordFilteringList(name, projectList = undefined) {
|
|
1307
1307
|
this._ctx.requireTokens();
|
|
1308
1308
|
const path = `/api/v1/keyword/`;
|
|
1309
|
-
const body = stripUndef$
|
|
1309
|
+
const body = stripUndef$5({
|
|
1310
1310
|
name: name,
|
|
1311
1311
|
project_list: projectList,
|
|
1312
1312
|
});
|
|
@@ -1359,7 +1359,7 @@ class Keywords {
|
|
|
1359
1359
|
async updateKeywordFilteringListLabels(keywordListId, listKeywordsToInclude, listKeywordsToExclude) {
|
|
1360
1360
|
this._ctx.requireTokens();
|
|
1361
1361
|
const path = `/api/v1/keyword/${encodeURIComponent(keywordListId)}`;
|
|
1362
|
-
const body = stripUndef$
|
|
1362
|
+
const body = stripUndef$5({
|
|
1363
1363
|
list_keywords_to_include: listKeywordsToInclude,
|
|
1364
1364
|
list_keywords_to_exclude: listKeywordsToExclude,
|
|
1365
1365
|
});
|
|
@@ -1370,7 +1370,7 @@ class Keywords {
|
|
|
1370
1370
|
async updateKeywordFilteringListDetails(keywordListId, { name, projectList } = {}) {
|
|
1371
1371
|
this._ctx.requireTokens();
|
|
1372
1372
|
const path = `/api/v1/keyword/details/${encodeURIComponent(keywordListId)}`;
|
|
1373
|
-
const body = stripUndef$
|
|
1373
|
+
const body = stripUndef$5({
|
|
1374
1374
|
name: name,
|
|
1375
1375
|
project_list: projectList,
|
|
1376
1376
|
});
|
|
@@ -1635,7 +1635,7 @@ class Person {
|
|
|
1635
1635
|
}
|
|
1636
1636
|
}
|
|
1637
1637
|
|
|
1638
|
-
function stripUndef$
|
|
1638
|
+
function stripUndef$4(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
|
|
1639
1639
|
|
|
1640
1640
|
class Projects {
|
|
1641
1641
|
constructor(ctx) { this._ctx = ctx; }
|
|
@@ -1648,7 +1648,7 @@ class Projects {
|
|
|
1648
1648
|
if (models !== undefined) (Array.isArray(models) ? models : [models]).forEach(v => query.append('models', v));
|
|
1649
1649
|
const qs = query.toString();
|
|
1650
1650
|
if (qs) path += '?' + qs;
|
|
1651
|
-
const body = stripUndef$
|
|
1651
|
+
const body = stripUndef$4({
|
|
1652
1652
|
name: name,
|
|
1653
1653
|
private: private_,
|
|
1654
1654
|
type: type,
|
|
@@ -1718,7 +1718,7 @@ class Projects {
|
|
|
1718
1718
|
async updateProject(projectId, { private: private_, type, description, directory, name, thumbnail } = {}) {
|
|
1719
1719
|
this._ctx.requireTokens();
|
|
1720
1720
|
const path = `/api/v1/projects/${encodeURIComponent(projectId)}`;
|
|
1721
|
-
const body = stripUndef$
|
|
1721
|
+
const body = stripUndef$4({
|
|
1722
1722
|
private: private_,
|
|
1723
1723
|
type: type,
|
|
1724
1724
|
description: description,
|
|
@@ -1797,7 +1797,7 @@ class Projects {
|
|
|
1797
1797
|
async addProjectEvent(projectTableName, event, detail = undefined) {
|
|
1798
1798
|
this._ctx.requireTokens();
|
|
1799
1799
|
const path = `/api/v1/projects/${encodeURIComponent(projectTableName)}/event`;
|
|
1800
|
-
const body = stripUndef$
|
|
1800
|
+
const body = stripUndef$4({
|
|
1801
1801
|
event: event,
|
|
1802
1802
|
detail: detail,
|
|
1803
1803
|
});
|
|
@@ -1816,7 +1816,7 @@ class Projects {
|
|
|
1816
1816
|
class Photoupload {
|
|
1817
1817
|
constructor(ctx) { this._ctx = ctx; this._caches = {}; }
|
|
1818
1818
|
|
|
1819
|
-
async uploadPhotoToMediaviz(fileContent, filePath, mimetype, companyId, userId, projectTableName, blur, colors, faceRecognition, imageClassification, imageComparison, imageDescribe, ocr, { clientSideId, format, size, sourceResolutionX, sourceResolutionY, dateTaken, latitude, longitude } = {}) {
|
|
1819
|
+
async uploadPhotoToMediaviz(fileContent, filePath, mimetype, companyId, userId, projectTableName, blur, colors, faceRecognition, imageClassification, imageComparison, imageDescribe, ocr, judgment, { clientSideId, format, size, sourceResolutionX, sourceResolutionY, dateTaken, latitude, longitude } = {}) {
|
|
1820
1820
|
this._ctx.requireTokens();
|
|
1821
1821
|
const baseUrl = this._ctx.requireHost('photoUpload');
|
|
1822
1822
|
const headers = {
|
|
@@ -1826,7 +1826,7 @@ class Photoupload {
|
|
|
1826
1826
|
const resp = await fetch(baseUrl + `/photo_upload`, {
|
|
1827
1827
|
method: 'POST',
|
|
1828
1828
|
headers,
|
|
1829
|
-
body: JSON.stringify({ file_content: fileContent, file_path: filePath, mimetype, company_id: companyId, user_id: userId, project_table_name: projectTableName, blur, colors, face_recognition: faceRecognition, image_classification: imageClassification, image_comparison: imageComparison, image_describe: imageDescribe, ocr, client_side_id: clientSideId, format, size, source_resolution_x: sourceResolutionX, source_resolution_y: sourceResolutionY, date_taken: dateTaken, latitude, longitude }),
|
|
1829
|
+
body: JSON.stringify({ file_content: fileContent, file_path: filePath, mimetype, company_id: companyId, user_id: userId, project_table_name: projectTableName, blur, colors, face_recognition: faceRecognition, image_classification: imageClassification, image_comparison: imageComparison, image_describe: imageDescribe, ocr, judgment, client_side_id: clientSideId, format, size, source_resolution_x: sourceResolutionX, source_resolution_y: sourceResolutionY, date_taken: dateTaken, latitude, longitude }),
|
|
1830
1830
|
});
|
|
1831
1831
|
return handleResponse(resp);
|
|
1832
1832
|
}
|
|
@@ -1842,12 +1842,14 @@ class Photoupload {
|
|
|
1842
1842
|
this._caches['_get_template'].set(_cacheKey_get_template, template);
|
|
1843
1843
|
}
|
|
1844
1844
|
|
|
1845
|
-
const upload_result = await this.uploadPhotoToMediaviz(photo.fileContent, photo.filePath, photo.mimetype, companyId, userId, projectTableName, (((template?.body?.['blur'] ?? template?.headers?.['x-blur']) === true || (template?.body?.['blur'] ?? template?.headers?.['x-blur']) === 'true') ? 'true' : undefined), (((template?.body?.['colors'] ?? template?.headers?.['x-colors']) === true || (template?.body?.['colors'] ?? template?.headers?.['x-colors']) === 'true') ? 'true' : undefined), (((template?.body?.['face_recognition'] ?? template?.headers?.['x-face-recognition']) === true || (template?.body?.['face_recognition'] ?? template?.headers?.['x-face-recognition']) === 'true') ? 'true' : undefined), (((template?.body?.['image_classification'] ?? template?.headers?.['x-image-classification']) === true || (template?.body?.['image_classification'] ?? template?.headers?.['x-image-classification']) === 'true') ? 'true' : undefined), (((template?.body?.['image_comparison'] ?? template?.headers?.['x-image-comparison']) === true || (template?.body?.['image_comparison'] ?? template?.headers?.['x-image-comparison']) === 'true') ? 'true' : undefined), (((template?.body?.['image_describe'] ?? template?.headers?.['x-image-describe']) === true || (template?.body?.['image_describe'] ?? template?.headers?.['x-image-describe']) === 'true') ? 'true' : undefined), (((template?.body?.['ocr'] ?? template?.headers?.['x-ocr']) === true || (template?.body?.['ocr'] ?? template?.headers?.['x-ocr']) === 'true') ? 'true' : undefined), { clientSideId: photo.clientSideId, format: photo.format, size: photo.size, sourceResolutionX: photo.sourceResolutionX, sourceResolutionY: photo.sourceResolutionY, dateTaken: photo.dateTaken, latitude: photo.latitude, longitude: photo.longitude });
|
|
1845
|
+
const upload_result = await this.uploadPhotoToMediaviz(photo.fileContent, photo.filePath, photo.mimetype, companyId, userId, projectTableName, (((template?.body?.['blur'] ?? template?.headers?.['x-blur']) === true || (template?.body?.['blur'] ?? template?.headers?.['x-blur']) === 'true') ? 'true' : undefined), (((template?.body?.['colors'] ?? template?.headers?.['x-colors']) === true || (template?.body?.['colors'] ?? template?.headers?.['x-colors']) === 'true') ? 'true' : undefined), (((template?.body?.['face_recognition'] ?? template?.headers?.['x-face-recognition']) === true || (template?.body?.['face_recognition'] ?? template?.headers?.['x-face-recognition']) === 'true') ? 'true' : undefined), (((template?.body?.['image_classification'] ?? template?.headers?.['x-image-classification']) === true || (template?.body?.['image_classification'] ?? template?.headers?.['x-image-classification']) === 'true') ? 'true' : undefined), (((template?.body?.['image_comparison'] ?? template?.headers?.['x-image-comparison']) === true || (template?.body?.['image_comparison'] ?? template?.headers?.['x-image-comparison']) === 'true') ? 'true' : undefined), (((template?.body?.['image_describe'] ?? template?.headers?.['x-image-describe']) === true || (template?.body?.['image_describe'] ?? template?.headers?.['x-image-describe']) === 'true') ? 'true' : undefined), (((template?.body?.['ocr'] ?? template?.headers?.['x-ocr']) === true || (template?.body?.['ocr'] ?? template?.headers?.['x-ocr']) === 'true') ? 'true' : undefined), (((template?.body?.['judgment'] ?? template?.headers?.['x-judgment']) === true || (template?.body?.['judgment'] ?? template?.headers?.['x-judgment']) === 'true') ? 'true' : undefined), { clientSideId: photo.clientSideId, format: photo.format, size: photo.size, sourceResolutionX: photo.sourceResolutionX, sourceResolutionY: photo.sourceResolutionY, dateTaken: photo.dateTaken, latitude: photo.latitude, longitude: photo.longitude });
|
|
1846
1846
|
|
|
1847
1847
|
return upload_result;
|
|
1848
1848
|
}
|
|
1849
1849
|
}
|
|
1850
1850
|
|
|
1851
|
+
function stripUndef$3(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
|
|
1852
|
+
|
|
1851
1853
|
class Photos {
|
|
1852
1854
|
constructor(ctx) { this._ctx = ctx; }
|
|
1853
1855
|
|
|
@@ -1909,16 +1911,16 @@ class Photos {
|
|
|
1909
1911
|
return data;
|
|
1910
1912
|
}
|
|
1911
1913
|
|
|
1912
|
-
async updatePhotoInProject(
|
|
1914
|
+
async updatePhotoInProject(tableName, photoId, { filePath, title, description, tags } = {}) {
|
|
1913
1915
|
this._ctx.requireTokens();
|
|
1914
|
-
|
|
1915
|
-
const
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
const { data } = await this._ctx.client.request(path, 'PUT', this._ctx.accessToken, this._ctx.refreshToken);
|
|
1916
|
+
const path = `/api/v1/photos_update/${encodeURIComponent(tableName)}/id/${encodeURIComponent(photoId)}`;
|
|
1917
|
+
const body = stripUndef$3({
|
|
1918
|
+
file_path: filePath,
|
|
1919
|
+
title: title,
|
|
1920
|
+
description: description,
|
|
1921
|
+
tags: tags,
|
|
1922
|
+
});
|
|
1923
|
+
const { data } = await this._ctx.client.request(path, 'PUT', this._ctx.accessToken, this._ctx.refreshToken, body);
|
|
1922
1924
|
return data;
|
|
1923
1925
|
}
|
|
1924
1926
|
|
package/dist/sdk.d.cts
CHANGED
|
@@ -268,6 +268,15 @@ export interface PhotoDisplay {
|
|
|
268
268
|
hue_values?: number[];
|
|
269
269
|
light_values?: number[];
|
|
270
270
|
saturation_values?: number[];
|
|
271
|
+
aesthetic_appeal?: number;
|
|
272
|
+
lighting?: number;
|
|
273
|
+
subject_significance?: number;
|
|
274
|
+
emotional_intensity?: number;
|
|
275
|
+
positive_emotion?: number;
|
|
276
|
+
universal_relatability?: number;
|
|
277
|
+
memorability?: number;
|
|
278
|
+
composition?: number;
|
|
279
|
+
judgment_overall_score?: number;
|
|
271
280
|
user_id: number;
|
|
272
281
|
company_id: number;
|
|
273
282
|
id: number;
|
|
@@ -356,6 +365,7 @@ export interface ProjectRunDisplay {
|
|
|
356
365
|
image_comparison_model?: boolean;
|
|
357
366
|
image_describe_model?: boolean;
|
|
358
367
|
ocr_model?: boolean;
|
|
368
|
+
judgment_model?: boolean;
|
|
359
369
|
similarity_model?: boolean;
|
|
360
370
|
personhood_model?: boolean;
|
|
361
371
|
evidence_model?: boolean;
|
|
@@ -431,7 +441,7 @@ export class Admin {
|
|
|
431
441
|
|
|
432
442
|
export class Company {
|
|
433
443
|
getCompanyById(companyId: number): Promise<CompanyDisplay>;
|
|
434
|
-
confirmCompanyCreditBalance(companyId: number, options?: { photoCount?: number | number[], modelsList?:
|
|
444
|
+
confirmCompanyCreditBalance(companyId: number, options?: { photoCount?: number | number[], modelsList?: any }): Promise<CreditBalanceOutput>;
|
|
435
445
|
}
|
|
436
446
|
|
|
437
447
|
export class CuratedAlbums {
|
|
@@ -522,7 +532,7 @@ export class Person {
|
|
|
522
532
|
}
|
|
523
533
|
|
|
524
534
|
export class Photoupload {
|
|
525
|
-
uploadPhotoToMediaviz(fileContent: string, filePath: string, mimetype: string, companyId: string, userId: string, projectTableName: string, blur: boolean | string, colors: boolean | string, faceRecognition: boolean | string, imageClassification: boolean | string, imageComparison: boolean | string, imageDescribe: boolean | string, ocr: boolean | string, options?: { clientSideId?: string, format?: string, size?: string, sourceResolutionX?: number | string, sourceResolutionY?: number | string, dateTaken?: string, latitude?: number | string, longitude?: number | string }): Promise<any>;
|
|
535
|
+
uploadPhotoToMediaviz(fileContent: string, filePath: string, mimetype: string, companyId: string, userId: string, projectTableName: string, blur: boolean | string, colors: boolean | string, faceRecognition: boolean | string, imageClassification: boolean | string, imageComparison: boolean | string, imageDescribe: boolean | string, ocr: boolean | string, judgment: boolean | string, options?: { clientSideId?: string, format?: string, size?: string, sourceResolutionX?: number | string, sourceResolutionY?: number | string, dateTaken?: string, latitude?: number | string, longitude?: number | string }): Promise<any>;
|
|
526
536
|
uploadPhoto(companyId: string, userId: string, projectTableName: string, photo: Record<string, any>): Promise<any>;
|
|
527
537
|
}
|
|
528
538
|
|
|
@@ -532,7 +542,7 @@ export class Photos {
|
|
|
532
542
|
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>;
|
|
533
543
|
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>>;
|
|
534
544
|
getProjectMonthYearsWithPhotos(tableName: string): Promise<any>;
|
|
535
|
-
updatePhotoInProject(
|
|
545
|
+
updatePhotoInProject(tableName: string, photoId: number, body?: { filePath?: string, title?: string, description?: string, tags?: string[] }): Promise<PhotoDisplay>;
|
|
536
546
|
updatePhotoRanking(tableName: string, photoId: number, newCategory: string): Promise<Record<string, any>>;
|
|
537
547
|
deletePhotoFromProject(tableName: string, options?: { photoIds?: any }): Promise<Record<string, any>>;
|
|
538
548
|
}
|
|
@@ -547,7 +557,7 @@ export class Projects {
|
|
|
547
557
|
getProjectById(projectId: string): Promise<ProjectRunDisplay>;
|
|
548
558
|
getProjectByDirectory(directory: string): Promise<ProjectRunDisplay>;
|
|
549
559
|
updateProject(projectId: string, body?: { private?: boolean, type?: number, description?: string, directory?: string, name?: string, thumbnail?: string }): Promise<ProjectRunDisplay>;
|
|
550
|
-
updateProjectPhotoCount(tableName: string, options?: { filesFailedCount?: number | number[] }): Promise<any
|
|
560
|
+
updateProjectPhotoCount(tableName: string, options?: { filesFailedCount?: number | number[] }): Promise<Record<string, any>>;
|
|
551
561
|
updateProjectCreateUploadReport(tableName: string, options?: { filesFailedCount?: number | number[] }): Promise<any>;
|
|
552
562
|
requestProjectSimilarityQueue(projectTableName: string, level: string): Promise<Record<string, any>>;
|
|
553
563
|
requestProjectEvidenceQueue(projectTableName: string): Promise<Record<string, any>>;
|
package/dist/sdk.d.ts
CHANGED
|
@@ -268,6 +268,15 @@ export interface PhotoDisplay {
|
|
|
268
268
|
hue_values?: number[];
|
|
269
269
|
light_values?: number[];
|
|
270
270
|
saturation_values?: number[];
|
|
271
|
+
aesthetic_appeal?: number;
|
|
272
|
+
lighting?: number;
|
|
273
|
+
subject_significance?: number;
|
|
274
|
+
emotional_intensity?: number;
|
|
275
|
+
positive_emotion?: number;
|
|
276
|
+
universal_relatability?: number;
|
|
277
|
+
memorability?: number;
|
|
278
|
+
composition?: number;
|
|
279
|
+
judgment_overall_score?: number;
|
|
271
280
|
user_id: number;
|
|
272
281
|
company_id: number;
|
|
273
282
|
id: number;
|
|
@@ -356,6 +365,7 @@ export interface ProjectRunDisplay {
|
|
|
356
365
|
image_comparison_model?: boolean;
|
|
357
366
|
image_describe_model?: boolean;
|
|
358
367
|
ocr_model?: boolean;
|
|
368
|
+
judgment_model?: boolean;
|
|
359
369
|
similarity_model?: boolean;
|
|
360
370
|
personhood_model?: boolean;
|
|
361
371
|
evidence_model?: boolean;
|
|
@@ -431,7 +441,7 @@ export class Admin {
|
|
|
431
441
|
|
|
432
442
|
export class Company {
|
|
433
443
|
getCompanyById(companyId: number): Promise<CompanyDisplay>;
|
|
434
|
-
confirmCompanyCreditBalance(companyId: number, options?: { photoCount?: number | number[], modelsList?:
|
|
444
|
+
confirmCompanyCreditBalance(companyId: number, options?: { photoCount?: number | number[], modelsList?: any }): Promise<CreditBalanceOutput>;
|
|
435
445
|
}
|
|
436
446
|
|
|
437
447
|
export class CuratedAlbums {
|
|
@@ -522,7 +532,7 @@ export class Person {
|
|
|
522
532
|
}
|
|
523
533
|
|
|
524
534
|
export class Photoupload {
|
|
525
|
-
uploadPhotoToMediaviz(fileContent: string, filePath: string, mimetype: string, companyId: string, userId: string, projectTableName: string, blur: boolean | string, colors: boolean | string, faceRecognition: boolean | string, imageClassification: boolean | string, imageComparison: boolean | string, imageDescribe: boolean | string, ocr: boolean | string, options?: { clientSideId?: string, format?: string, size?: string, sourceResolutionX?: number | string, sourceResolutionY?: number | string, dateTaken?: string, latitude?: number | string, longitude?: number | string }): Promise<any>;
|
|
535
|
+
uploadPhotoToMediaviz(fileContent: string, filePath: string, mimetype: string, companyId: string, userId: string, projectTableName: string, blur: boolean | string, colors: boolean | string, faceRecognition: boolean | string, imageClassification: boolean | string, imageComparison: boolean | string, imageDescribe: boolean | string, ocr: boolean | string, judgment: boolean | string, options?: { clientSideId?: string, format?: string, size?: string, sourceResolutionX?: number | string, sourceResolutionY?: number | string, dateTaken?: string, latitude?: number | string, longitude?: number | string }): Promise<any>;
|
|
526
536
|
uploadPhoto(companyId: string, userId: string, projectTableName: string, photo: Record<string, any>): Promise<any>;
|
|
527
537
|
}
|
|
528
538
|
|
|
@@ -532,7 +542,7 @@ export class Photos {
|
|
|
532
542
|
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>;
|
|
533
543
|
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>>;
|
|
534
544
|
getProjectMonthYearsWithPhotos(tableName: string): Promise<any>;
|
|
535
|
-
updatePhotoInProject(
|
|
545
|
+
updatePhotoInProject(tableName: string, photoId: number, body?: { filePath?: string, title?: string, description?: string, tags?: string[] }): Promise<PhotoDisplay>;
|
|
536
546
|
updatePhotoRanking(tableName: string, photoId: number, newCategory: string): Promise<Record<string, any>>;
|
|
537
547
|
deletePhotoFromProject(tableName: string, options?: { photoIds?: any }): Promise<Record<string, any>>;
|
|
538
548
|
}
|
|
@@ -547,7 +557,7 @@ export class Projects {
|
|
|
547
557
|
getProjectById(projectId: string): Promise<ProjectRunDisplay>;
|
|
548
558
|
getProjectByDirectory(directory: string): Promise<ProjectRunDisplay>;
|
|
549
559
|
updateProject(projectId: string, body?: { private?: boolean, type?: number, description?: string, directory?: string, name?: string, thumbnail?: string }): Promise<ProjectRunDisplay>;
|
|
550
|
-
updateProjectPhotoCount(tableName: string, options?: { filesFailedCount?: number | number[] }): Promise<any
|
|
560
|
+
updateProjectPhotoCount(tableName: string, options?: { filesFailedCount?: number | number[] }): Promise<Record<string, any>>;
|
|
551
561
|
updateProjectCreateUploadReport(tableName: string, options?: { filesFailedCount?: number | number[] }): Promise<any>;
|
|
552
562
|
requestProjectSimilarityQueue(projectTableName: string, level: string): Promise<Record<string, any>>;
|
|
553
563
|
requestProjectEvidenceQueue(projectTableName: string): Promise<Record<string, any>>;
|
package/dist/sdk.esm.d.ts
CHANGED
|
@@ -268,6 +268,15 @@ export interface PhotoDisplay {
|
|
|
268
268
|
hue_values?: number[];
|
|
269
269
|
light_values?: number[];
|
|
270
270
|
saturation_values?: number[];
|
|
271
|
+
aesthetic_appeal?: number;
|
|
272
|
+
lighting?: number;
|
|
273
|
+
subject_significance?: number;
|
|
274
|
+
emotional_intensity?: number;
|
|
275
|
+
positive_emotion?: number;
|
|
276
|
+
universal_relatability?: number;
|
|
277
|
+
memorability?: number;
|
|
278
|
+
composition?: number;
|
|
279
|
+
judgment_overall_score?: number;
|
|
271
280
|
user_id: number;
|
|
272
281
|
company_id: number;
|
|
273
282
|
id: number;
|
|
@@ -356,6 +365,7 @@ export interface ProjectRunDisplay {
|
|
|
356
365
|
image_comparison_model?: boolean;
|
|
357
366
|
image_describe_model?: boolean;
|
|
358
367
|
ocr_model?: boolean;
|
|
368
|
+
judgment_model?: boolean;
|
|
359
369
|
similarity_model?: boolean;
|
|
360
370
|
personhood_model?: boolean;
|
|
361
371
|
evidence_model?: boolean;
|
|
@@ -431,7 +441,7 @@ export class Admin {
|
|
|
431
441
|
|
|
432
442
|
export class Company {
|
|
433
443
|
getCompanyById(companyId: number): Promise<CompanyDisplay>;
|
|
434
|
-
confirmCompanyCreditBalance(companyId: number, options?: { photoCount?: number | number[], modelsList?:
|
|
444
|
+
confirmCompanyCreditBalance(companyId: number, options?: { photoCount?: number | number[], modelsList?: any }): Promise<CreditBalanceOutput>;
|
|
435
445
|
}
|
|
436
446
|
|
|
437
447
|
export class CuratedAlbums {
|
|
@@ -522,7 +532,7 @@ export class Person {
|
|
|
522
532
|
}
|
|
523
533
|
|
|
524
534
|
export class Photoupload {
|
|
525
|
-
uploadPhotoToMediaviz(fileContent: string, filePath: string, mimetype: string, companyId: string, userId: string, projectTableName: string, blur: boolean | string, colors: boolean | string, faceRecognition: boolean | string, imageClassification: boolean | string, imageComparison: boolean | string, imageDescribe: boolean | string, ocr: boolean | string, options?: { clientSideId?: string, format?: string, size?: string, sourceResolutionX?: number | string, sourceResolutionY?: number | string, dateTaken?: string, latitude?: number | string, longitude?: number | string }): Promise<any>;
|
|
535
|
+
uploadPhotoToMediaviz(fileContent: string, filePath: string, mimetype: string, companyId: string, userId: string, projectTableName: string, blur: boolean | string, colors: boolean | string, faceRecognition: boolean | string, imageClassification: boolean | string, imageComparison: boolean | string, imageDescribe: boolean | string, ocr: boolean | string, judgment: boolean | string, options?: { clientSideId?: string, format?: string, size?: string, sourceResolutionX?: number | string, sourceResolutionY?: number | string, dateTaken?: string, latitude?: number | string, longitude?: number | string }): Promise<any>;
|
|
526
536
|
uploadPhoto(companyId: string, userId: string, projectTableName: string, photo: Record<string, any>): Promise<any>;
|
|
527
537
|
}
|
|
528
538
|
|
|
@@ -532,7 +542,7 @@ export class Photos {
|
|
|
532
542
|
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>;
|
|
533
543
|
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>>;
|
|
534
544
|
getProjectMonthYearsWithPhotos(tableName: string): Promise<any>;
|
|
535
|
-
updatePhotoInProject(
|
|
545
|
+
updatePhotoInProject(tableName: string, photoId: number, body?: { filePath?: string, title?: string, description?: string, tags?: string[] }): Promise<PhotoDisplay>;
|
|
536
546
|
updatePhotoRanking(tableName: string, photoId: number, newCategory: string): Promise<Record<string, any>>;
|
|
537
547
|
deletePhotoFromProject(tableName: string, options?: { photoIds?: any }): Promise<Record<string, any>>;
|
|
538
548
|
}
|
|
@@ -547,7 +557,7 @@ export class Projects {
|
|
|
547
557
|
getProjectById(projectId: string): Promise<ProjectRunDisplay>;
|
|
548
558
|
getProjectByDirectory(directory: string): Promise<ProjectRunDisplay>;
|
|
549
559
|
updateProject(projectId: string, body?: { private?: boolean, type?: number, description?: string, directory?: string, name?: string, thumbnail?: string }): Promise<ProjectRunDisplay>;
|
|
550
|
-
updateProjectPhotoCount(tableName: string, options?: { filesFailedCount?: number | number[] }): Promise<any
|
|
560
|
+
updateProjectPhotoCount(tableName: string, options?: { filesFailedCount?: number | number[] }): Promise<Record<string, any>>;
|
|
551
561
|
updateProjectCreateUploadReport(tableName: string, options?: { filesFailedCount?: number | number[] }): Promise<any>;
|
|
552
562
|
requestProjectSimilarityQueue(projectTableName: string, level: string): Promise<Record<string, any>>;
|
|
553
563
|
requestProjectEvidenceQueue(projectTableName: string): Promise<Record<string, any>>;
|
package/dist/sdk.esm.js
CHANGED
|
@@ -967,7 +967,7 @@ class Company {
|
|
|
967
967
|
}
|
|
968
968
|
}
|
|
969
969
|
|
|
970
|
-
function stripUndef$
|
|
970
|
+
function stripUndef$8(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
|
|
971
971
|
|
|
972
972
|
class CuratedAlbums {
|
|
973
973
|
constructor(ctx) { this._ctx = ctx; }
|
|
@@ -975,7 +975,7 @@ class CuratedAlbums {
|
|
|
975
975
|
async createCuratedAlbum(projectTableName, name, description = undefined, confidenceValue = undefined) {
|
|
976
976
|
this._ctx.requireTokens();
|
|
977
977
|
const path = `/api/v1/curated_album/project/${encodeURIComponent(projectTableName)}`;
|
|
978
|
-
const body = stripUndef$
|
|
978
|
+
const body = stripUndef$8({
|
|
979
979
|
name: name,
|
|
980
980
|
description: description,
|
|
981
981
|
confidence_value: confidenceValue,
|
|
@@ -1029,7 +1029,7 @@ class CuratedAlbums {
|
|
|
1029
1029
|
async updateCuratedAlbum(albumId, { name, description, confidenceValue } = {}) {
|
|
1030
1030
|
this._ctx.requireTokens();
|
|
1031
1031
|
const path = `/api/v1/curated_album/${encodeURIComponent(albumId)}`;
|
|
1032
|
-
const body = stripUndef$
|
|
1032
|
+
const body = stripUndef$8({
|
|
1033
1033
|
name: name,
|
|
1034
1034
|
description: description,
|
|
1035
1035
|
confidence_value: confidenceValue,
|
|
@@ -1053,7 +1053,7 @@ class CuratedAlbums {
|
|
|
1053
1053
|
}
|
|
1054
1054
|
}
|
|
1055
1055
|
|
|
1056
|
-
function stripUndef$
|
|
1056
|
+
function stripUndef$7(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
|
|
1057
1057
|
|
|
1058
1058
|
class CustomAlbums {
|
|
1059
1059
|
constructor(ctx) { this._ctx = ctx; }
|
|
@@ -1101,7 +1101,7 @@ class CustomAlbums {
|
|
|
1101
1101
|
async createProjectCustomAlbum(projectTableName, { name, description, photoIdInclusionList, photoIdRemovalList } = {}) {
|
|
1102
1102
|
this._ctx.requireTokens();
|
|
1103
1103
|
const path = `/api/v1/custom_album/project/${encodeURIComponent(projectTableName)}`;
|
|
1104
|
-
const body = stripUndef$
|
|
1104
|
+
const body = stripUndef$7({
|
|
1105
1105
|
name: name,
|
|
1106
1106
|
description: description,
|
|
1107
1107
|
photo_id_inclusion_list: photoIdInclusionList,
|
|
@@ -1114,7 +1114,7 @@ class CustomAlbums {
|
|
|
1114
1114
|
async updateCustomAlbum(albumId, { name, description, photoIdInclusionList, photoIdRemovalList } = {}) {
|
|
1115
1115
|
this._ctx.requireTokens();
|
|
1116
1116
|
const path = `/api/v1/custom_album/${encodeURIComponent(albumId)}`;
|
|
1117
|
-
const body = stripUndef$
|
|
1117
|
+
const body = stripUndef$7({
|
|
1118
1118
|
name: name,
|
|
1119
1119
|
description: description,
|
|
1120
1120
|
photo_id_inclusion_list: photoIdInclusionList,
|
|
@@ -1214,7 +1214,7 @@ async function handleResponse(response) {
|
|
|
1214
1214
|
}
|
|
1215
1215
|
}
|
|
1216
1216
|
|
|
1217
|
-
function stripUndef$
|
|
1217
|
+
function stripUndef$6(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
|
|
1218
1218
|
|
|
1219
1219
|
class EmailTokens {
|
|
1220
1220
|
constructor(ctx) { this._ctx = ctx; }
|
|
@@ -1245,7 +1245,7 @@ class EmailTokens {
|
|
|
1245
1245
|
}
|
|
1246
1246
|
|
|
1247
1247
|
async validateToken(token) {
|
|
1248
|
-
const body = stripUndef$
|
|
1248
|
+
const body = stripUndef$6({
|
|
1249
1249
|
token: token,
|
|
1250
1250
|
});
|
|
1251
1251
|
const resp = await fetch(this._ctx.baseUrl + `/api/v1/validate-token`, {
|
|
@@ -1257,7 +1257,7 @@ class EmailTokens {
|
|
|
1257
1257
|
}
|
|
1258
1258
|
|
|
1259
1259
|
async resetPassword(token, newPassword) {
|
|
1260
|
-
const body = stripUndef$
|
|
1260
|
+
const body = stripUndef$6({
|
|
1261
1261
|
token: token,
|
|
1262
1262
|
new_password: newPassword,
|
|
1263
1263
|
});
|
|
@@ -1296,7 +1296,7 @@ class Health {
|
|
|
1296
1296
|
}
|
|
1297
1297
|
}
|
|
1298
1298
|
|
|
1299
|
-
function stripUndef$
|
|
1299
|
+
function stripUndef$5(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
|
|
1300
1300
|
|
|
1301
1301
|
class Keywords {
|
|
1302
1302
|
constructor(ctx) { this._ctx = ctx; }
|
|
@@ -1304,7 +1304,7 @@ class Keywords {
|
|
|
1304
1304
|
async createKeywordFilteringList(name, projectList = undefined) {
|
|
1305
1305
|
this._ctx.requireTokens();
|
|
1306
1306
|
const path = `/api/v1/keyword/`;
|
|
1307
|
-
const body = stripUndef$
|
|
1307
|
+
const body = stripUndef$5({
|
|
1308
1308
|
name: name,
|
|
1309
1309
|
project_list: projectList,
|
|
1310
1310
|
});
|
|
@@ -1357,7 +1357,7 @@ class Keywords {
|
|
|
1357
1357
|
async updateKeywordFilteringListLabels(keywordListId, listKeywordsToInclude, listKeywordsToExclude) {
|
|
1358
1358
|
this._ctx.requireTokens();
|
|
1359
1359
|
const path = `/api/v1/keyword/${encodeURIComponent(keywordListId)}`;
|
|
1360
|
-
const body = stripUndef$
|
|
1360
|
+
const body = stripUndef$5({
|
|
1361
1361
|
list_keywords_to_include: listKeywordsToInclude,
|
|
1362
1362
|
list_keywords_to_exclude: listKeywordsToExclude,
|
|
1363
1363
|
});
|
|
@@ -1368,7 +1368,7 @@ class Keywords {
|
|
|
1368
1368
|
async updateKeywordFilteringListDetails(keywordListId, { name, projectList } = {}) {
|
|
1369
1369
|
this._ctx.requireTokens();
|
|
1370
1370
|
const path = `/api/v1/keyword/details/${encodeURIComponent(keywordListId)}`;
|
|
1371
|
-
const body = stripUndef$
|
|
1371
|
+
const body = stripUndef$5({
|
|
1372
1372
|
name: name,
|
|
1373
1373
|
project_list: projectList,
|
|
1374
1374
|
});
|
|
@@ -1633,7 +1633,7 @@ class Person {
|
|
|
1633
1633
|
}
|
|
1634
1634
|
}
|
|
1635
1635
|
|
|
1636
|
-
function stripUndef$
|
|
1636
|
+
function stripUndef$4(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
|
|
1637
1637
|
|
|
1638
1638
|
class Projects {
|
|
1639
1639
|
constructor(ctx) { this._ctx = ctx; }
|
|
@@ -1646,7 +1646,7 @@ class Projects {
|
|
|
1646
1646
|
if (models !== undefined) (Array.isArray(models) ? models : [models]).forEach(v => query.append('models', v));
|
|
1647
1647
|
const qs = query.toString();
|
|
1648
1648
|
if (qs) path += '?' + qs;
|
|
1649
|
-
const body = stripUndef$
|
|
1649
|
+
const body = stripUndef$4({
|
|
1650
1650
|
name: name,
|
|
1651
1651
|
private: private_,
|
|
1652
1652
|
type: type,
|
|
@@ -1716,7 +1716,7 @@ class Projects {
|
|
|
1716
1716
|
async updateProject(projectId, { private: private_, type, description, directory, name, thumbnail } = {}) {
|
|
1717
1717
|
this._ctx.requireTokens();
|
|
1718
1718
|
const path = `/api/v1/projects/${encodeURIComponent(projectId)}`;
|
|
1719
|
-
const body = stripUndef$
|
|
1719
|
+
const body = stripUndef$4({
|
|
1720
1720
|
private: private_,
|
|
1721
1721
|
type: type,
|
|
1722
1722
|
description: description,
|
|
@@ -1795,7 +1795,7 @@ class Projects {
|
|
|
1795
1795
|
async addProjectEvent(projectTableName, event, detail = undefined) {
|
|
1796
1796
|
this._ctx.requireTokens();
|
|
1797
1797
|
const path = `/api/v1/projects/${encodeURIComponent(projectTableName)}/event`;
|
|
1798
|
-
const body = stripUndef$
|
|
1798
|
+
const body = stripUndef$4({
|
|
1799
1799
|
event: event,
|
|
1800
1800
|
detail: detail,
|
|
1801
1801
|
});
|
|
@@ -1814,7 +1814,7 @@ class Projects {
|
|
|
1814
1814
|
class Photoupload {
|
|
1815
1815
|
constructor(ctx) { this._ctx = ctx; this._caches = {}; }
|
|
1816
1816
|
|
|
1817
|
-
async uploadPhotoToMediaviz(fileContent, filePath, mimetype, companyId, userId, projectTableName, blur, colors, faceRecognition, imageClassification, imageComparison, imageDescribe, ocr, { clientSideId, format, size, sourceResolutionX, sourceResolutionY, dateTaken, latitude, longitude } = {}) {
|
|
1817
|
+
async uploadPhotoToMediaviz(fileContent, filePath, mimetype, companyId, userId, projectTableName, blur, colors, faceRecognition, imageClassification, imageComparison, imageDescribe, ocr, judgment, { clientSideId, format, size, sourceResolutionX, sourceResolutionY, dateTaken, latitude, longitude } = {}) {
|
|
1818
1818
|
this._ctx.requireTokens();
|
|
1819
1819
|
const baseUrl = this._ctx.requireHost('photoUpload');
|
|
1820
1820
|
const headers = {
|
|
@@ -1824,7 +1824,7 @@ class Photoupload {
|
|
|
1824
1824
|
const resp = await fetch(baseUrl + `/photo_upload`, {
|
|
1825
1825
|
method: 'POST',
|
|
1826
1826
|
headers,
|
|
1827
|
-
body: JSON.stringify({ file_content: fileContent, file_path: filePath, mimetype, company_id: companyId, user_id: userId, project_table_name: projectTableName, blur, colors, face_recognition: faceRecognition, image_classification: imageClassification, image_comparison: imageComparison, image_describe: imageDescribe, ocr, client_side_id: clientSideId, format, size, source_resolution_x: sourceResolutionX, source_resolution_y: sourceResolutionY, date_taken: dateTaken, latitude, longitude }),
|
|
1827
|
+
body: JSON.stringify({ file_content: fileContent, file_path: filePath, mimetype, company_id: companyId, user_id: userId, project_table_name: projectTableName, blur, colors, face_recognition: faceRecognition, image_classification: imageClassification, image_comparison: imageComparison, image_describe: imageDescribe, ocr, judgment, client_side_id: clientSideId, format, size, source_resolution_x: sourceResolutionX, source_resolution_y: sourceResolutionY, date_taken: dateTaken, latitude, longitude }),
|
|
1828
1828
|
});
|
|
1829
1829
|
return handleResponse(resp);
|
|
1830
1830
|
}
|
|
@@ -1840,12 +1840,14 @@ class Photoupload {
|
|
|
1840
1840
|
this._caches['_get_template'].set(_cacheKey_get_template, template);
|
|
1841
1841
|
}
|
|
1842
1842
|
|
|
1843
|
-
const upload_result = await this.uploadPhotoToMediaviz(photo.fileContent, photo.filePath, photo.mimetype, companyId, userId, projectTableName, (((template?.body?.['blur'] ?? template?.headers?.['x-blur']) === true || (template?.body?.['blur'] ?? template?.headers?.['x-blur']) === 'true') ? 'true' : undefined), (((template?.body?.['colors'] ?? template?.headers?.['x-colors']) === true || (template?.body?.['colors'] ?? template?.headers?.['x-colors']) === 'true') ? 'true' : undefined), (((template?.body?.['face_recognition'] ?? template?.headers?.['x-face-recognition']) === true || (template?.body?.['face_recognition'] ?? template?.headers?.['x-face-recognition']) === 'true') ? 'true' : undefined), (((template?.body?.['image_classification'] ?? template?.headers?.['x-image-classification']) === true || (template?.body?.['image_classification'] ?? template?.headers?.['x-image-classification']) === 'true') ? 'true' : undefined), (((template?.body?.['image_comparison'] ?? template?.headers?.['x-image-comparison']) === true || (template?.body?.['image_comparison'] ?? template?.headers?.['x-image-comparison']) === 'true') ? 'true' : undefined), (((template?.body?.['image_describe'] ?? template?.headers?.['x-image-describe']) === true || (template?.body?.['image_describe'] ?? template?.headers?.['x-image-describe']) === 'true') ? 'true' : undefined), (((template?.body?.['ocr'] ?? template?.headers?.['x-ocr']) === true || (template?.body?.['ocr'] ?? template?.headers?.['x-ocr']) === 'true') ? 'true' : undefined), { clientSideId: photo.clientSideId, format: photo.format, size: photo.size, sourceResolutionX: photo.sourceResolutionX, sourceResolutionY: photo.sourceResolutionY, dateTaken: photo.dateTaken, latitude: photo.latitude, longitude: photo.longitude });
|
|
1843
|
+
const upload_result = await this.uploadPhotoToMediaviz(photo.fileContent, photo.filePath, photo.mimetype, companyId, userId, projectTableName, (((template?.body?.['blur'] ?? template?.headers?.['x-blur']) === true || (template?.body?.['blur'] ?? template?.headers?.['x-blur']) === 'true') ? 'true' : undefined), (((template?.body?.['colors'] ?? template?.headers?.['x-colors']) === true || (template?.body?.['colors'] ?? template?.headers?.['x-colors']) === 'true') ? 'true' : undefined), (((template?.body?.['face_recognition'] ?? template?.headers?.['x-face-recognition']) === true || (template?.body?.['face_recognition'] ?? template?.headers?.['x-face-recognition']) === 'true') ? 'true' : undefined), (((template?.body?.['image_classification'] ?? template?.headers?.['x-image-classification']) === true || (template?.body?.['image_classification'] ?? template?.headers?.['x-image-classification']) === 'true') ? 'true' : undefined), (((template?.body?.['image_comparison'] ?? template?.headers?.['x-image-comparison']) === true || (template?.body?.['image_comparison'] ?? template?.headers?.['x-image-comparison']) === 'true') ? 'true' : undefined), (((template?.body?.['image_describe'] ?? template?.headers?.['x-image-describe']) === true || (template?.body?.['image_describe'] ?? template?.headers?.['x-image-describe']) === 'true') ? 'true' : undefined), (((template?.body?.['ocr'] ?? template?.headers?.['x-ocr']) === true || (template?.body?.['ocr'] ?? template?.headers?.['x-ocr']) === 'true') ? 'true' : undefined), (((template?.body?.['judgment'] ?? template?.headers?.['x-judgment']) === true || (template?.body?.['judgment'] ?? template?.headers?.['x-judgment']) === 'true') ? 'true' : undefined), { clientSideId: photo.clientSideId, format: photo.format, size: photo.size, sourceResolutionX: photo.sourceResolutionX, sourceResolutionY: photo.sourceResolutionY, dateTaken: photo.dateTaken, latitude: photo.latitude, longitude: photo.longitude });
|
|
1844
1844
|
|
|
1845
1845
|
return upload_result;
|
|
1846
1846
|
}
|
|
1847
1847
|
}
|
|
1848
1848
|
|
|
1849
|
+
function stripUndef$3(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
|
|
1850
|
+
|
|
1849
1851
|
class Photos {
|
|
1850
1852
|
constructor(ctx) { this._ctx = ctx; }
|
|
1851
1853
|
|
|
@@ -1907,16 +1909,16 @@ class Photos {
|
|
|
1907
1909
|
return data;
|
|
1908
1910
|
}
|
|
1909
1911
|
|
|
1910
|
-
async updatePhotoInProject(
|
|
1912
|
+
async updatePhotoInProject(tableName, photoId, { filePath, title, description, tags } = {}) {
|
|
1911
1913
|
this._ctx.requireTokens();
|
|
1912
|
-
|
|
1913
|
-
const
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
const { data } = await this._ctx.client.request(path, 'PUT', this._ctx.accessToken, this._ctx.refreshToken);
|
|
1914
|
+
const path = `/api/v1/photos_update/${encodeURIComponent(tableName)}/id/${encodeURIComponent(photoId)}`;
|
|
1915
|
+
const body = stripUndef$3({
|
|
1916
|
+
file_path: filePath,
|
|
1917
|
+
title: title,
|
|
1918
|
+
description: description,
|
|
1919
|
+
tags: tags,
|
|
1920
|
+
});
|
|
1921
|
+
const { data } = await this._ctx.client.request(path, 'PUT', this._ctx.accessToken, this._ctx.refreshToken, body);
|
|
1920
1922
|
return data;
|
|
1921
1923
|
}
|
|
1922
1924
|
|
package/dist/sdk.umd.js
CHANGED
|
@@ -973,7 +973,7 @@
|
|
|
973
973
|
}
|
|
974
974
|
}
|
|
975
975
|
|
|
976
|
-
function stripUndef$
|
|
976
|
+
function stripUndef$8(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
|
|
977
977
|
|
|
978
978
|
class CuratedAlbums {
|
|
979
979
|
constructor(ctx) { this._ctx = ctx; }
|
|
@@ -981,7 +981,7 @@
|
|
|
981
981
|
async createCuratedAlbum(projectTableName, name, description = undefined, confidenceValue = undefined) {
|
|
982
982
|
this._ctx.requireTokens();
|
|
983
983
|
const path = `/api/v1/curated_album/project/${encodeURIComponent(projectTableName)}`;
|
|
984
|
-
const body = stripUndef$
|
|
984
|
+
const body = stripUndef$8({
|
|
985
985
|
name: name,
|
|
986
986
|
description: description,
|
|
987
987
|
confidence_value: confidenceValue,
|
|
@@ -1035,7 +1035,7 @@
|
|
|
1035
1035
|
async updateCuratedAlbum(albumId, { name, description, confidenceValue } = {}) {
|
|
1036
1036
|
this._ctx.requireTokens();
|
|
1037
1037
|
const path = `/api/v1/curated_album/${encodeURIComponent(albumId)}`;
|
|
1038
|
-
const body = stripUndef$
|
|
1038
|
+
const body = stripUndef$8({
|
|
1039
1039
|
name: name,
|
|
1040
1040
|
description: description,
|
|
1041
1041
|
confidence_value: confidenceValue,
|
|
@@ -1059,7 +1059,7 @@
|
|
|
1059
1059
|
}
|
|
1060
1060
|
}
|
|
1061
1061
|
|
|
1062
|
-
function stripUndef$
|
|
1062
|
+
function stripUndef$7(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
|
|
1063
1063
|
|
|
1064
1064
|
class CustomAlbums {
|
|
1065
1065
|
constructor(ctx) { this._ctx = ctx; }
|
|
@@ -1107,7 +1107,7 @@
|
|
|
1107
1107
|
async createProjectCustomAlbum(projectTableName, { name, description, photoIdInclusionList, photoIdRemovalList } = {}) {
|
|
1108
1108
|
this._ctx.requireTokens();
|
|
1109
1109
|
const path = `/api/v1/custom_album/project/${encodeURIComponent(projectTableName)}`;
|
|
1110
|
-
const body = stripUndef$
|
|
1110
|
+
const body = stripUndef$7({
|
|
1111
1111
|
name: name,
|
|
1112
1112
|
description: description,
|
|
1113
1113
|
photo_id_inclusion_list: photoIdInclusionList,
|
|
@@ -1120,7 +1120,7 @@
|
|
|
1120
1120
|
async updateCustomAlbum(albumId, { name, description, photoIdInclusionList, photoIdRemovalList } = {}) {
|
|
1121
1121
|
this._ctx.requireTokens();
|
|
1122
1122
|
const path = `/api/v1/custom_album/${encodeURIComponent(albumId)}`;
|
|
1123
|
-
const body = stripUndef$
|
|
1123
|
+
const body = stripUndef$7({
|
|
1124
1124
|
name: name,
|
|
1125
1125
|
description: description,
|
|
1126
1126
|
photo_id_inclusion_list: photoIdInclusionList,
|
|
@@ -1220,7 +1220,7 @@
|
|
|
1220
1220
|
}
|
|
1221
1221
|
}
|
|
1222
1222
|
|
|
1223
|
-
function stripUndef$
|
|
1223
|
+
function stripUndef$6(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
|
|
1224
1224
|
|
|
1225
1225
|
class EmailTokens {
|
|
1226
1226
|
constructor(ctx) { this._ctx = ctx; }
|
|
@@ -1251,7 +1251,7 @@
|
|
|
1251
1251
|
}
|
|
1252
1252
|
|
|
1253
1253
|
async validateToken(token) {
|
|
1254
|
-
const body = stripUndef$
|
|
1254
|
+
const body = stripUndef$6({
|
|
1255
1255
|
token: token,
|
|
1256
1256
|
});
|
|
1257
1257
|
const resp = await fetch(this._ctx.baseUrl + `/api/v1/validate-token`, {
|
|
@@ -1263,7 +1263,7 @@
|
|
|
1263
1263
|
}
|
|
1264
1264
|
|
|
1265
1265
|
async resetPassword(token, newPassword) {
|
|
1266
|
-
const body = stripUndef$
|
|
1266
|
+
const body = stripUndef$6({
|
|
1267
1267
|
token: token,
|
|
1268
1268
|
new_password: newPassword,
|
|
1269
1269
|
});
|
|
@@ -1302,7 +1302,7 @@
|
|
|
1302
1302
|
}
|
|
1303
1303
|
}
|
|
1304
1304
|
|
|
1305
|
-
function stripUndef$
|
|
1305
|
+
function stripUndef$5(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
|
|
1306
1306
|
|
|
1307
1307
|
class Keywords {
|
|
1308
1308
|
constructor(ctx) { this._ctx = ctx; }
|
|
@@ -1310,7 +1310,7 @@
|
|
|
1310
1310
|
async createKeywordFilteringList(name, projectList = undefined) {
|
|
1311
1311
|
this._ctx.requireTokens();
|
|
1312
1312
|
const path = `/api/v1/keyword/`;
|
|
1313
|
-
const body = stripUndef$
|
|
1313
|
+
const body = stripUndef$5({
|
|
1314
1314
|
name: name,
|
|
1315
1315
|
project_list: projectList,
|
|
1316
1316
|
});
|
|
@@ -1363,7 +1363,7 @@
|
|
|
1363
1363
|
async updateKeywordFilteringListLabels(keywordListId, listKeywordsToInclude, listKeywordsToExclude) {
|
|
1364
1364
|
this._ctx.requireTokens();
|
|
1365
1365
|
const path = `/api/v1/keyword/${encodeURIComponent(keywordListId)}`;
|
|
1366
|
-
const body = stripUndef$
|
|
1366
|
+
const body = stripUndef$5({
|
|
1367
1367
|
list_keywords_to_include: listKeywordsToInclude,
|
|
1368
1368
|
list_keywords_to_exclude: listKeywordsToExclude,
|
|
1369
1369
|
});
|
|
@@ -1374,7 +1374,7 @@
|
|
|
1374
1374
|
async updateKeywordFilteringListDetails(keywordListId, { name, projectList } = {}) {
|
|
1375
1375
|
this._ctx.requireTokens();
|
|
1376
1376
|
const path = `/api/v1/keyword/details/${encodeURIComponent(keywordListId)}`;
|
|
1377
|
-
const body = stripUndef$
|
|
1377
|
+
const body = stripUndef$5({
|
|
1378
1378
|
name: name,
|
|
1379
1379
|
project_list: projectList,
|
|
1380
1380
|
});
|
|
@@ -1639,7 +1639,7 @@
|
|
|
1639
1639
|
}
|
|
1640
1640
|
}
|
|
1641
1641
|
|
|
1642
|
-
function stripUndef$
|
|
1642
|
+
function stripUndef$4(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
|
|
1643
1643
|
|
|
1644
1644
|
class Projects {
|
|
1645
1645
|
constructor(ctx) { this._ctx = ctx; }
|
|
@@ -1652,7 +1652,7 @@
|
|
|
1652
1652
|
if (models !== undefined) (Array.isArray(models) ? models : [models]).forEach(v => query.append('models', v));
|
|
1653
1653
|
const qs = query.toString();
|
|
1654
1654
|
if (qs) path += '?' + qs;
|
|
1655
|
-
const body = stripUndef$
|
|
1655
|
+
const body = stripUndef$4({
|
|
1656
1656
|
name: name,
|
|
1657
1657
|
private: private_,
|
|
1658
1658
|
type: type,
|
|
@@ -1722,7 +1722,7 @@
|
|
|
1722
1722
|
async updateProject(projectId, { private: private_, type, description, directory, name, thumbnail } = {}) {
|
|
1723
1723
|
this._ctx.requireTokens();
|
|
1724
1724
|
const path = `/api/v1/projects/${encodeURIComponent(projectId)}`;
|
|
1725
|
-
const body = stripUndef$
|
|
1725
|
+
const body = stripUndef$4({
|
|
1726
1726
|
private: private_,
|
|
1727
1727
|
type: type,
|
|
1728
1728
|
description: description,
|
|
@@ -1801,7 +1801,7 @@
|
|
|
1801
1801
|
async addProjectEvent(projectTableName, event, detail = undefined) {
|
|
1802
1802
|
this._ctx.requireTokens();
|
|
1803
1803
|
const path = `/api/v1/projects/${encodeURIComponent(projectTableName)}/event`;
|
|
1804
|
-
const body = stripUndef$
|
|
1804
|
+
const body = stripUndef$4({
|
|
1805
1805
|
event: event,
|
|
1806
1806
|
detail: detail,
|
|
1807
1807
|
});
|
|
@@ -1820,7 +1820,7 @@
|
|
|
1820
1820
|
class Photoupload {
|
|
1821
1821
|
constructor(ctx) { this._ctx = ctx; this._caches = {}; }
|
|
1822
1822
|
|
|
1823
|
-
async uploadPhotoToMediaviz(fileContent, filePath, mimetype, companyId, userId, projectTableName, blur, colors, faceRecognition, imageClassification, imageComparison, imageDescribe, ocr, { clientSideId, format, size, sourceResolutionX, sourceResolutionY, dateTaken, latitude, longitude } = {}) {
|
|
1823
|
+
async uploadPhotoToMediaviz(fileContent, filePath, mimetype, companyId, userId, projectTableName, blur, colors, faceRecognition, imageClassification, imageComparison, imageDescribe, ocr, judgment, { clientSideId, format, size, sourceResolutionX, sourceResolutionY, dateTaken, latitude, longitude } = {}) {
|
|
1824
1824
|
this._ctx.requireTokens();
|
|
1825
1825
|
const baseUrl = this._ctx.requireHost('photoUpload');
|
|
1826
1826
|
const headers = {
|
|
@@ -1830,7 +1830,7 @@
|
|
|
1830
1830
|
const resp = await fetch(baseUrl + `/photo_upload`, {
|
|
1831
1831
|
method: 'POST',
|
|
1832
1832
|
headers,
|
|
1833
|
-
body: JSON.stringify({ file_content: fileContent, file_path: filePath, mimetype, company_id: companyId, user_id: userId, project_table_name: projectTableName, blur, colors, face_recognition: faceRecognition, image_classification: imageClassification, image_comparison: imageComparison, image_describe: imageDescribe, ocr, client_side_id: clientSideId, format, size, source_resolution_x: sourceResolutionX, source_resolution_y: sourceResolutionY, date_taken: dateTaken, latitude, longitude }),
|
|
1833
|
+
body: JSON.stringify({ file_content: fileContent, file_path: filePath, mimetype, company_id: companyId, user_id: userId, project_table_name: projectTableName, blur, colors, face_recognition: faceRecognition, image_classification: imageClassification, image_comparison: imageComparison, image_describe: imageDescribe, ocr, judgment, client_side_id: clientSideId, format, size, source_resolution_x: sourceResolutionX, source_resolution_y: sourceResolutionY, date_taken: dateTaken, latitude, longitude }),
|
|
1834
1834
|
});
|
|
1835
1835
|
return handleResponse(resp);
|
|
1836
1836
|
}
|
|
@@ -1846,12 +1846,14 @@
|
|
|
1846
1846
|
this._caches['_get_template'].set(_cacheKey_get_template, template);
|
|
1847
1847
|
}
|
|
1848
1848
|
|
|
1849
|
-
const upload_result = await this.uploadPhotoToMediaviz(photo.fileContent, photo.filePath, photo.mimetype, companyId, userId, projectTableName, (((template?.body?.['blur'] ?? template?.headers?.['x-blur']) === true || (template?.body?.['blur'] ?? template?.headers?.['x-blur']) === 'true') ? 'true' : undefined), (((template?.body?.['colors'] ?? template?.headers?.['x-colors']) === true || (template?.body?.['colors'] ?? template?.headers?.['x-colors']) === 'true') ? 'true' : undefined), (((template?.body?.['face_recognition'] ?? template?.headers?.['x-face-recognition']) === true || (template?.body?.['face_recognition'] ?? template?.headers?.['x-face-recognition']) === 'true') ? 'true' : undefined), (((template?.body?.['image_classification'] ?? template?.headers?.['x-image-classification']) === true || (template?.body?.['image_classification'] ?? template?.headers?.['x-image-classification']) === 'true') ? 'true' : undefined), (((template?.body?.['image_comparison'] ?? template?.headers?.['x-image-comparison']) === true || (template?.body?.['image_comparison'] ?? template?.headers?.['x-image-comparison']) === 'true') ? 'true' : undefined), (((template?.body?.['image_describe'] ?? template?.headers?.['x-image-describe']) === true || (template?.body?.['image_describe'] ?? template?.headers?.['x-image-describe']) === 'true') ? 'true' : undefined), (((template?.body?.['ocr'] ?? template?.headers?.['x-ocr']) === true || (template?.body?.['ocr'] ?? template?.headers?.['x-ocr']) === 'true') ? 'true' : undefined), { clientSideId: photo.clientSideId, format: photo.format, size: photo.size, sourceResolutionX: photo.sourceResolutionX, sourceResolutionY: photo.sourceResolutionY, dateTaken: photo.dateTaken, latitude: photo.latitude, longitude: photo.longitude });
|
|
1849
|
+
const upload_result = await this.uploadPhotoToMediaviz(photo.fileContent, photo.filePath, photo.mimetype, companyId, userId, projectTableName, (((template?.body?.['blur'] ?? template?.headers?.['x-blur']) === true || (template?.body?.['blur'] ?? template?.headers?.['x-blur']) === 'true') ? 'true' : undefined), (((template?.body?.['colors'] ?? template?.headers?.['x-colors']) === true || (template?.body?.['colors'] ?? template?.headers?.['x-colors']) === 'true') ? 'true' : undefined), (((template?.body?.['face_recognition'] ?? template?.headers?.['x-face-recognition']) === true || (template?.body?.['face_recognition'] ?? template?.headers?.['x-face-recognition']) === 'true') ? 'true' : undefined), (((template?.body?.['image_classification'] ?? template?.headers?.['x-image-classification']) === true || (template?.body?.['image_classification'] ?? template?.headers?.['x-image-classification']) === 'true') ? 'true' : undefined), (((template?.body?.['image_comparison'] ?? template?.headers?.['x-image-comparison']) === true || (template?.body?.['image_comparison'] ?? template?.headers?.['x-image-comparison']) === 'true') ? 'true' : undefined), (((template?.body?.['image_describe'] ?? template?.headers?.['x-image-describe']) === true || (template?.body?.['image_describe'] ?? template?.headers?.['x-image-describe']) === 'true') ? 'true' : undefined), (((template?.body?.['ocr'] ?? template?.headers?.['x-ocr']) === true || (template?.body?.['ocr'] ?? template?.headers?.['x-ocr']) === 'true') ? 'true' : undefined), (((template?.body?.['judgment'] ?? template?.headers?.['x-judgment']) === true || (template?.body?.['judgment'] ?? template?.headers?.['x-judgment']) === 'true') ? 'true' : undefined), { clientSideId: photo.clientSideId, format: photo.format, size: photo.size, sourceResolutionX: photo.sourceResolutionX, sourceResolutionY: photo.sourceResolutionY, dateTaken: photo.dateTaken, latitude: photo.latitude, longitude: photo.longitude });
|
|
1850
1850
|
|
|
1851
1851
|
return upload_result;
|
|
1852
1852
|
}
|
|
1853
1853
|
}
|
|
1854
1854
|
|
|
1855
|
+
function stripUndef$3(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
|
|
1856
|
+
|
|
1855
1857
|
class Photos {
|
|
1856
1858
|
constructor(ctx) { this._ctx = ctx; }
|
|
1857
1859
|
|
|
@@ -1913,16 +1915,16 @@
|
|
|
1913
1915
|
return data;
|
|
1914
1916
|
}
|
|
1915
1917
|
|
|
1916
|
-
async updatePhotoInProject(
|
|
1918
|
+
async updatePhotoInProject(tableName, photoId, { filePath, title, description, tags } = {}) {
|
|
1917
1919
|
this._ctx.requireTokens();
|
|
1918
|
-
|
|
1919
|
-
const
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
const { data } = await this._ctx.client.request(path, 'PUT', this._ctx.accessToken, this._ctx.refreshToken);
|
|
1920
|
+
const path = `/api/v1/photos_update/${encodeURIComponent(tableName)}/id/${encodeURIComponent(photoId)}`;
|
|
1921
|
+
const body = stripUndef$3({
|
|
1922
|
+
file_path: filePath,
|
|
1923
|
+
title: title,
|
|
1924
|
+
description: description,
|
|
1925
|
+
tags: tags,
|
|
1926
|
+
});
|
|
1927
|
+
const { data } = await this._ctx.client.request(path, 'PUT', this._ctx.accessToken, this._ctx.refreshToken, body);
|
|
1926
1928
|
return data;
|
|
1927
1929
|
}
|
|
1928
1930
|
|