@mediaviz/sdk 1.9.0-dev.117 → 1.9.0-rc.3

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 CHANGED
@@ -1149,7 +1149,7 @@ class Company {
1149
1149
  }
1150
1150
  }
1151
1151
 
1152
- function stripUndef$8(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1152
+ function stripUndef$7(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1153
1153
 
1154
1154
  class CuratedAlbums {
1155
1155
  constructor(ctx) { this._ctx = ctx; }
@@ -1157,7 +1157,7 @@ class CuratedAlbums {
1157
1157
  async createCuratedAlbum(projectTableName, name, description = undefined, confidenceValue = undefined) {
1158
1158
  this._ctx.requireTokens();
1159
1159
  const path = `/api/v1/curated_album/project/${encodeURIComponent(projectTableName)}`;
1160
- const body = stripUndef$8({
1160
+ const body = stripUndef$7({
1161
1161
  name: name,
1162
1162
  description: description,
1163
1163
  confidence_value: confidenceValue,
@@ -1211,7 +1211,7 @@ class CuratedAlbums {
1211
1211
  async updateCuratedAlbum(albumId, { name, description, confidenceValue } = {}) {
1212
1212
  this._ctx.requireTokens();
1213
1213
  const path = `/api/v1/curated_album/${encodeURIComponent(albumId)}`;
1214
- const body = stripUndef$8({
1214
+ const body = stripUndef$7({
1215
1215
  name: name,
1216
1216
  description: description,
1217
1217
  confidence_value: confidenceValue,
@@ -1235,7 +1235,7 @@ class CuratedAlbums {
1235
1235
  }
1236
1236
  }
1237
1237
 
1238
- function stripUndef$7(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1238
+ function stripUndef$6(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1239
1239
 
1240
1240
  class CustomAlbums {
1241
1241
  constructor(ctx) { this._ctx = ctx; }
@@ -1283,7 +1283,7 @@ class CustomAlbums {
1283
1283
  async createProjectCustomAlbum(projectTableName, { name, description, photoIdInclusionList, photoIdRemovalList } = {}) {
1284
1284
  this._ctx.requireTokens();
1285
1285
  const path = `/api/v1/custom_album/project/${encodeURIComponent(projectTableName)}`;
1286
- const body = stripUndef$7({
1286
+ const body = stripUndef$6({
1287
1287
  name: name,
1288
1288
  description: description,
1289
1289
  photo_id_inclusion_list: photoIdInclusionList,
@@ -1296,7 +1296,7 @@ class CustomAlbums {
1296
1296
  async updateCustomAlbum(albumId, { name, description, photoIdInclusionList, photoIdRemovalList } = {}) {
1297
1297
  this._ctx.requireTokens();
1298
1298
  const path = `/api/v1/custom_album/${encodeURIComponent(albumId)}`;
1299
- const body = stripUndef$7({
1299
+ const body = stripUndef$6({
1300
1300
  name: name,
1301
1301
  description: description,
1302
1302
  photo_id_inclusion_list: photoIdInclusionList,
@@ -1396,7 +1396,7 @@ async function handleResponse(response) {
1396
1396
  }
1397
1397
  }
1398
1398
 
1399
- function stripUndef$6(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1399
+ function stripUndef$5(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1400
1400
 
1401
1401
  class EmailTokens {
1402
1402
  constructor(ctx) { this._ctx = ctx; }
@@ -1427,7 +1427,7 @@ class EmailTokens {
1427
1427
  }
1428
1428
 
1429
1429
  async validateToken(token) {
1430
- const body = stripUndef$6({
1430
+ const body = stripUndef$5({
1431
1431
  token: token,
1432
1432
  });
1433
1433
  const resp = await fetch(this._ctx.baseUrl + `/api/v1/validate-token`, {
@@ -1439,7 +1439,7 @@ class EmailTokens {
1439
1439
  }
1440
1440
 
1441
1441
  async resetPassword(token, newPassword) {
1442
- const body = stripUndef$6({
1442
+ const body = stripUndef$5({
1443
1443
  token: token,
1444
1444
  new_password: newPassword,
1445
1445
  });
@@ -1478,7 +1478,7 @@ class Health {
1478
1478
  }
1479
1479
  }
1480
1480
 
1481
- function stripUndef$5(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1481
+ function stripUndef$4(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1482
1482
 
1483
1483
  class Keywords {
1484
1484
  constructor(ctx) { this._ctx = ctx; }
@@ -1486,7 +1486,7 @@ class Keywords {
1486
1486
  async createKeywordFilteringList(name, projectList = undefined) {
1487
1487
  this._ctx.requireTokens();
1488
1488
  const path = `/api/v1/keyword/`;
1489
- const body = stripUndef$5({
1489
+ const body = stripUndef$4({
1490
1490
  name: name,
1491
1491
  project_list: projectList,
1492
1492
  });
@@ -1539,7 +1539,7 @@ class Keywords {
1539
1539
  async updateKeywordFilteringListLabels(keywordListId, listKeywordsToInclude, listKeywordsToExclude) {
1540
1540
  this._ctx.requireTokens();
1541
1541
  const path = `/api/v1/keyword/${encodeURIComponent(keywordListId)}`;
1542
- const body = stripUndef$5({
1542
+ const body = stripUndef$4({
1543
1543
  list_keywords_to_include: listKeywordsToInclude,
1544
1544
  list_keywords_to_exclude: listKeywordsToExclude,
1545
1545
  });
@@ -1550,7 +1550,7 @@ class Keywords {
1550
1550
  async updateKeywordFilteringListDetails(keywordListId, { name, projectList } = {}) {
1551
1551
  this._ctx.requireTokens();
1552
1552
  const path = `/api/v1/keyword/details/${encodeURIComponent(keywordListId)}`;
1553
- const body = stripUndef$5({
1553
+ const body = stripUndef$4({
1554
1554
  name: name,
1555
1555
  project_list: projectList,
1556
1556
  });
@@ -1815,7 +1815,7 @@ class Person {
1815
1815
  }
1816
1816
  }
1817
1817
 
1818
- function stripUndef$4(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1818
+ function stripUndef$3(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1819
1819
 
1820
1820
  class Projects {
1821
1821
  constructor(ctx) { this._ctx = ctx; }
@@ -1828,7 +1828,7 @@ class Projects {
1828
1828
  if (models !== undefined) (Array.isArray(models) ? models : [models]).forEach(v => query.append('models', v));
1829
1829
  const qs = query.toString();
1830
1830
  if (qs) path += '?' + qs;
1831
- const body = stripUndef$4({
1831
+ const body = stripUndef$3({
1832
1832
  name: name,
1833
1833
  private: private_,
1834
1834
  type: type,
@@ -1898,7 +1898,7 @@ class Projects {
1898
1898
  async updateProject(projectId, { private: private_, type, description, directory, name, thumbnail } = {}) {
1899
1899
  this._ctx.requireTokens();
1900
1900
  const path = `/api/v1/projects/${encodeURIComponent(projectId)}`;
1901
- const body = stripUndef$4({
1901
+ const body = stripUndef$3({
1902
1902
  private: private_,
1903
1903
  type: type,
1904
1904
  description: description,
@@ -1977,7 +1977,7 @@ class Projects {
1977
1977
  async addProjectEvent(projectTableName, event, detail = undefined) {
1978
1978
  this._ctx.requireTokens();
1979
1979
  const path = `/api/v1/projects/${encodeURIComponent(projectTableName)}/event`;
1980
- const body = stripUndef$4({
1980
+ const body = stripUndef$3({
1981
1981
  event: event,
1982
1982
  detail: detail,
1983
1983
  });
@@ -1996,7 +1996,7 @@ class Projects {
1996
1996
  class Photoupload {
1997
1997
  constructor(ctx) { this._ctx = ctx; this._caches = {}; }
1998
1998
 
1999
- async uploadPhotoToMediaviz(fileContent, filePath, mimetype, companyId, userId, projectTableName, blur, colors, faceRecognition, imageClassification, imageComparison, imageDescribe, ocr, judgment, { clientSideId, format, size, sourceResolutionX, sourceResolutionY, dateTaken, latitude, longitude } = {}) {
1999
+ async uploadPhotoToMediaviz(fileContent, filePath, mimetype, companyId, userId, projectTableName, blur, colors, faceRecognition, imageClassification, imageComparison, imageDescribe, ocr, { clientSideId, format, size, sourceResolutionX, sourceResolutionY, dateTaken, latitude, longitude } = {}) {
2000
2000
  this._ctx.requireTokens();
2001
2001
  const baseUrl = this._ctx.requireHost('photoUpload');
2002
2002
  const headers = {
@@ -2006,7 +2006,7 @@ class Photoupload {
2006
2006
  const resp = await fetch(baseUrl + `/photo_upload`, {
2007
2007
  method: 'POST',
2008
2008
  headers,
2009
- 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 }),
2009
+ 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 }),
2010
2010
  });
2011
2011
  return handleResponse(resp);
2012
2012
  }
@@ -2022,14 +2022,12 @@ class Photoupload {
2022
2022
  this._caches['_get_template'].set(_cacheKey_get_template, template);
2023
2023
  }
2024
2024
 
2025
- 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 });
2025
+ 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 });
2026
2026
 
2027
2027
  return upload_result;
2028
2028
  }
2029
2029
  }
2030
2030
 
2031
- function stripUndef$3(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
2032
-
2033
2031
  class Photos {
2034
2032
  constructor(ctx) { this._ctx = ctx; }
2035
2033
 
@@ -2091,16 +2089,16 @@ class Photos {
2091
2089
  return data;
2092
2090
  }
2093
2091
 
2094
- async updatePhotoInProject(tableName, photoId, { filePath, title, description, tags } = {}) {
2092
+ async updatePhotoInProject({ tableName, photoId, photoData } = {}) {
2095
2093
  this._ctx.requireTokens();
2096
- const path = `/api/v1/photos_update/${encodeURIComponent(tableName)}/id/${encodeURIComponent(photoId)}`;
2097
- const body = stripUndef$3({
2098
- file_path: filePath,
2099
- title: title,
2100
- description: description,
2101
- tags: tags,
2102
- });
2103
- const { data } = await this._ctx.client.request(path, 'PUT', this._ctx.accessToken, this._ctx.refreshToken, body);
2094
+ let path = `/api/v1/photos_update`;
2095
+ const query = new URLSearchParams();
2096
+ if (tableName !== undefined) (Array.isArray(tableName) ? tableName : [tableName]).forEach(v => query.append('table_name', v));
2097
+ if (photoId !== undefined) (Array.isArray(photoId) ? photoId : [photoId]).forEach(v => query.append('photo_id', v));
2098
+ if (photoData !== undefined) (Array.isArray(photoData) ? photoData : [photoData]).forEach(v => query.append('photo_data', v));
2099
+ const qs = query.toString();
2100
+ if (qs) path += '?' + qs;
2101
+ const { data } = await this._ctx.client.request(path, 'PUT', this._ctx.accessToken, this._ctx.refreshToken);
2104
2102
  return data;
2105
2103
  }
2106
2104
 
package/dist/sdk.d.cts CHANGED
@@ -268,15 +268,6 @@ 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;
280
271
  user_id: number;
281
272
  company_id: number;
282
273
  id: number;
@@ -365,7 +356,6 @@ export interface ProjectRunDisplay {
365
356
  image_comparison_model?: boolean;
366
357
  image_describe_model?: boolean;
367
358
  ocr_model?: boolean;
368
- judgment_model?: boolean;
369
359
  similarity_model?: boolean;
370
360
  personhood_model?: boolean;
371
361
  evidence_model?: boolean;
@@ -441,7 +431,7 @@ export class Admin {
441
431
 
442
432
  export class Company {
443
433
  getCompanyById(companyId: number): Promise<CompanyDisplay>;
444
- confirmCompanyCreditBalance(companyId: number, options?: { photoCount?: number | number[], modelsList?: any }): Promise<CreditBalanceOutput>;
434
+ confirmCompanyCreditBalance(companyId: number, options?: { photoCount?: number | number[], modelsList?: string[] | string[][] }): Promise<CreditBalanceOutput>;
445
435
  }
446
436
 
447
437
  export class CuratedAlbums {
@@ -532,7 +522,7 @@ export class Person {
532
522
  }
533
523
 
534
524
  export class Photoupload {
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>;
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>;
536
526
  uploadPhoto(companyId: string, userId: string, projectTableName: string, photo: Record<string, any>): Promise<any>;
537
527
  }
538
528
 
@@ -542,7 +532,7 @@ export class Photos {
542
532
  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>;
543
533
  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>>;
544
534
  getProjectMonthYearsWithPhotos(tableName: string): Promise<any>;
545
- updatePhotoInProject(tableName: string, photoId: number, body?: { filePath?: string, title?: string, description?: string, tags?: string[] }): Promise<PhotoDisplay>;
535
+ updatePhotoInProject(options?: { tableName?: string | string[], photoId?: number | number[], photoData?: Record<string, any> | Record<string, any>[] }): Promise<PhotoDisplay>;
546
536
  updatePhotoRanking(tableName: string, photoId: number, newCategory: string): Promise<Record<string, any>>;
547
537
  deletePhotoFromProject(tableName: string, options?: { photoIds?: any }): Promise<Record<string, any>>;
548
538
  }
@@ -557,7 +547,7 @@ export class Projects {
557
547
  getProjectById(projectId: string): Promise<ProjectRunDisplay>;
558
548
  getProjectByDirectory(directory: string): Promise<ProjectRunDisplay>;
559
549
  updateProject(projectId: string, body?: { private?: boolean, type?: number, description?: string, directory?: string, name?: string, thumbnail?: string }): Promise<ProjectRunDisplay>;
560
- updateProjectPhotoCount(tableName: string, options?: { filesFailedCount?: number | number[] }): Promise<Record<string, any>>;
550
+ updateProjectPhotoCount(tableName: string, options?: { filesFailedCount?: number | number[] }): Promise<any>;
561
551
  updateProjectCreateUploadReport(tableName: string, options?: { filesFailedCount?: number | number[] }): Promise<any>;
562
552
  requestProjectSimilarityQueue(projectTableName: string, level: string): Promise<Record<string, any>>;
563
553
  requestProjectEvidenceQueue(projectTableName: string): Promise<Record<string, any>>;
package/dist/sdk.d.ts CHANGED
@@ -268,15 +268,6 @@ 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;
280
271
  user_id: number;
281
272
  company_id: number;
282
273
  id: number;
@@ -365,7 +356,6 @@ export interface ProjectRunDisplay {
365
356
  image_comparison_model?: boolean;
366
357
  image_describe_model?: boolean;
367
358
  ocr_model?: boolean;
368
- judgment_model?: boolean;
369
359
  similarity_model?: boolean;
370
360
  personhood_model?: boolean;
371
361
  evidence_model?: boolean;
@@ -441,7 +431,7 @@ export class Admin {
441
431
 
442
432
  export class Company {
443
433
  getCompanyById(companyId: number): Promise<CompanyDisplay>;
444
- confirmCompanyCreditBalance(companyId: number, options?: { photoCount?: number | number[], modelsList?: any }): Promise<CreditBalanceOutput>;
434
+ confirmCompanyCreditBalance(companyId: number, options?: { photoCount?: number | number[], modelsList?: string[] | string[][] }): Promise<CreditBalanceOutput>;
445
435
  }
446
436
 
447
437
  export class CuratedAlbums {
@@ -532,7 +522,7 @@ export class Person {
532
522
  }
533
523
 
534
524
  export class Photoupload {
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>;
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>;
536
526
  uploadPhoto(companyId: string, userId: string, projectTableName: string, photo: Record<string, any>): Promise<any>;
537
527
  }
538
528
 
@@ -542,7 +532,7 @@ export class Photos {
542
532
  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>;
543
533
  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>>;
544
534
  getProjectMonthYearsWithPhotos(tableName: string): Promise<any>;
545
- updatePhotoInProject(tableName: string, photoId: number, body?: { filePath?: string, title?: string, description?: string, tags?: string[] }): Promise<PhotoDisplay>;
535
+ updatePhotoInProject(options?: { tableName?: string | string[], photoId?: number | number[], photoData?: Record<string, any> | Record<string, any>[] }): Promise<PhotoDisplay>;
546
536
  updatePhotoRanking(tableName: string, photoId: number, newCategory: string): Promise<Record<string, any>>;
547
537
  deletePhotoFromProject(tableName: string, options?: { photoIds?: any }): Promise<Record<string, any>>;
548
538
  }
@@ -557,7 +547,7 @@ export class Projects {
557
547
  getProjectById(projectId: string): Promise<ProjectRunDisplay>;
558
548
  getProjectByDirectory(directory: string): Promise<ProjectRunDisplay>;
559
549
  updateProject(projectId: string, body?: { private?: boolean, type?: number, description?: string, directory?: string, name?: string, thumbnail?: string }): Promise<ProjectRunDisplay>;
560
- updateProjectPhotoCount(tableName: string, options?: { filesFailedCount?: number | number[] }): Promise<Record<string, any>>;
550
+ updateProjectPhotoCount(tableName: string, options?: { filesFailedCount?: number | number[] }): Promise<any>;
561
551
  updateProjectCreateUploadReport(tableName: string, options?: { filesFailedCount?: number | number[] }): Promise<any>;
562
552
  requestProjectSimilarityQueue(projectTableName: string, level: string): Promise<Record<string, any>>;
563
553
  requestProjectEvidenceQueue(projectTableName: string): Promise<Record<string, any>>;
package/dist/sdk.esm.d.ts CHANGED
@@ -268,15 +268,6 @@ 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;
280
271
  user_id: number;
281
272
  company_id: number;
282
273
  id: number;
@@ -365,7 +356,6 @@ export interface ProjectRunDisplay {
365
356
  image_comparison_model?: boolean;
366
357
  image_describe_model?: boolean;
367
358
  ocr_model?: boolean;
368
- judgment_model?: boolean;
369
359
  similarity_model?: boolean;
370
360
  personhood_model?: boolean;
371
361
  evidence_model?: boolean;
@@ -441,7 +431,7 @@ export class Admin {
441
431
 
442
432
  export class Company {
443
433
  getCompanyById(companyId: number): Promise<CompanyDisplay>;
444
- confirmCompanyCreditBalance(companyId: number, options?: { photoCount?: number | number[], modelsList?: any }): Promise<CreditBalanceOutput>;
434
+ confirmCompanyCreditBalance(companyId: number, options?: { photoCount?: number | number[], modelsList?: string[] | string[][] }): Promise<CreditBalanceOutput>;
445
435
  }
446
436
 
447
437
  export class CuratedAlbums {
@@ -532,7 +522,7 @@ export class Person {
532
522
  }
533
523
 
534
524
  export class Photoupload {
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>;
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>;
536
526
  uploadPhoto(companyId: string, userId: string, projectTableName: string, photo: Record<string, any>): Promise<any>;
537
527
  }
538
528
 
@@ -542,7 +532,7 @@ export class Photos {
542
532
  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>;
543
533
  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>>;
544
534
  getProjectMonthYearsWithPhotos(tableName: string): Promise<any>;
545
- updatePhotoInProject(tableName: string, photoId: number, body?: { filePath?: string, title?: string, description?: string, tags?: string[] }): Promise<PhotoDisplay>;
535
+ updatePhotoInProject(options?: { tableName?: string | string[], photoId?: number | number[], photoData?: Record<string, any> | Record<string, any>[] }): Promise<PhotoDisplay>;
546
536
  updatePhotoRanking(tableName: string, photoId: number, newCategory: string): Promise<Record<string, any>>;
547
537
  deletePhotoFromProject(tableName: string, options?: { photoIds?: any }): Promise<Record<string, any>>;
548
538
  }
@@ -557,7 +547,7 @@ export class Projects {
557
547
  getProjectById(projectId: string): Promise<ProjectRunDisplay>;
558
548
  getProjectByDirectory(directory: string): Promise<ProjectRunDisplay>;
559
549
  updateProject(projectId: string, body?: { private?: boolean, type?: number, description?: string, directory?: string, name?: string, thumbnail?: string }): Promise<ProjectRunDisplay>;
560
- updateProjectPhotoCount(tableName: string, options?: { filesFailedCount?: number | number[] }): Promise<Record<string, any>>;
550
+ updateProjectPhotoCount(tableName: string, options?: { filesFailedCount?: number | number[] }): Promise<any>;
561
551
  updateProjectCreateUploadReport(tableName: string, options?: { filesFailedCount?: number | number[] }): Promise<any>;
562
552
  requestProjectSimilarityQueue(projectTableName: string, level: string): Promise<Record<string, any>>;
563
553
  requestProjectEvidenceQueue(projectTableName: string): Promise<Record<string, any>>;
package/dist/sdk.esm.js CHANGED
@@ -1147,7 +1147,7 @@ class Company {
1147
1147
  }
1148
1148
  }
1149
1149
 
1150
- function stripUndef$8(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1150
+ function stripUndef$7(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1151
1151
 
1152
1152
  class CuratedAlbums {
1153
1153
  constructor(ctx) { this._ctx = ctx; }
@@ -1155,7 +1155,7 @@ class CuratedAlbums {
1155
1155
  async createCuratedAlbum(projectTableName, name, description = undefined, confidenceValue = undefined) {
1156
1156
  this._ctx.requireTokens();
1157
1157
  const path = `/api/v1/curated_album/project/${encodeURIComponent(projectTableName)}`;
1158
- const body = stripUndef$8({
1158
+ const body = stripUndef$7({
1159
1159
  name: name,
1160
1160
  description: description,
1161
1161
  confidence_value: confidenceValue,
@@ -1209,7 +1209,7 @@ class CuratedAlbums {
1209
1209
  async updateCuratedAlbum(albumId, { name, description, confidenceValue } = {}) {
1210
1210
  this._ctx.requireTokens();
1211
1211
  const path = `/api/v1/curated_album/${encodeURIComponent(albumId)}`;
1212
- const body = stripUndef$8({
1212
+ const body = stripUndef$7({
1213
1213
  name: name,
1214
1214
  description: description,
1215
1215
  confidence_value: confidenceValue,
@@ -1233,7 +1233,7 @@ class CuratedAlbums {
1233
1233
  }
1234
1234
  }
1235
1235
 
1236
- function stripUndef$7(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1236
+ function stripUndef$6(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1237
1237
 
1238
1238
  class CustomAlbums {
1239
1239
  constructor(ctx) { this._ctx = ctx; }
@@ -1281,7 +1281,7 @@ class CustomAlbums {
1281
1281
  async createProjectCustomAlbum(projectTableName, { name, description, photoIdInclusionList, photoIdRemovalList } = {}) {
1282
1282
  this._ctx.requireTokens();
1283
1283
  const path = `/api/v1/custom_album/project/${encodeURIComponent(projectTableName)}`;
1284
- const body = stripUndef$7({
1284
+ const body = stripUndef$6({
1285
1285
  name: name,
1286
1286
  description: description,
1287
1287
  photo_id_inclusion_list: photoIdInclusionList,
@@ -1294,7 +1294,7 @@ class CustomAlbums {
1294
1294
  async updateCustomAlbum(albumId, { name, description, photoIdInclusionList, photoIdRemovalList } = {}) {
1295
1295
  this._ctx.requireTokens();
1296
1296
  const path = `/api/v1/custom_album/${encodeURIComponent(albumId)}`;
1297
- const body = stripUndef$7({
1297
+ const body = stripUndef$6({
1298
1298
  name: name,
1299
1299
  description: description,
1300
1300
  photo_id_inclusion_list: photoIdInclusionList,
@@ -1394,7 +1394,7 @@ async function handleResponse(response) {
1394
1394
  }
1395
1395
  }
1396
1396
 
1397
- function stripUndef$6(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1397
+ function stripUndef$5(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1398
1398
 
1399
1399
  class EmailTokens {
1400
1400
  constructor(ctx) { this._ctx = ctx; }
@@ -1425,7 +1425,7 @@ class EmailTokens {
1425
1425
  }
1426
1426
 
1427
1427
  async validateToken(token) {
1428
- const body = stripUndef$6({
1428
+ const body = stripUndef$5({
1429
1429
  token: token,
1430
1430
  });
1431
1431
  const resp = await fetch(this._ctx.baseUrl + `/api/v1/validate-token`, {
@@ -1437,7 +1437,7 @@ class EmailTokens {
1437
1437
  }
1438
1438
 
1439
1439
  async resetPassword(token, newPassword) {
1440
- const body = stripUndef$6({
1440
+ const body = stripUndef$5({
1441
1441
  token: token,
1442
1442
  new_password: newPassword,
1443
1443
  });
@@ -1476,7 +1476,7 @@ class Health {
1476
1476
  }
1477
1477
  }
1478
1478
 
1479
- function stripUndef$5(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1479
+ function stripUndef$4(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1480
1480
 
1481
1481
  class Keywords {
1482
1482
  constructor(ctx) { this._ctx = ctx; }
@@ -1484,7 +1484,7 @@ class Keywords {
1484
1484
  async createKeywordFilteringList(name, projectList = undefined) {
1485
1485
  this._ctx.requireTokens();
1486
1486
  const path = `/api/v1/keyword/`;
1487
- const body = stripUndef$5({
1487
+ const body = stripUndef$4({
1488
1488
  name: name,
1489
1489
  project_list: projectList,
1490
1490
  });
@@ -1537,7 +1537,7 @@ class Keywords {
1537
1537
  async updateKeywordFilteringListLabels(keywordListId, listKeywordsToInclude, listKeywordsToExclude) {
1538
1538
  this._ctx.requireTokens();
1539
1539
  const path = `/api/v1/keyword/${encodeURIComponent(keywordListId)}`;
1540
- const body = stripUndef$5({
1540
+ const body = stripUndef$4({
1541
1541
  list_keywords_to_include: listKeywordsToInclude,
1542
1542
  list_keywords_to_exclude: listKeywordsToExclude,
1543
1543
  });
@@ -1548,7 +1548,7 @@ class Keywords {
1548
1548
  async updateKeywordFilteringListDetails(keywordListId, { name, projectList } = {}) {
1549
1549
  this._ctx.requireTokens();
1550
1550
  const path = `/api/v1/keyword/details/${encodeURIComponent(keywordListId)}`;
1551
- const body = stripUndef$5({
1551
+ const body = stripUndef$4({
1552
1552
  name: name,
1553
1553
  project_list: projectList,
1554
1554
  });
@@ -1813,7 +1813,7 @@ class Person {
1813
1813
  }
1814
1814
  }
1815
1815
 
1816
- function stripUndef$4(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1816
+ function stripUndef$3(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1817
1817
 
1818
1818
  class Projects {
1819
1819
  constructor(ctx) { this._ctx = ctx; }
@@ -1826,7 +1826,7 @@ class Projects {
1826
1826
  if (models !== undefined) (Array.isArray(models) ? models : [models]).forEach(v => query.append('models', v));
1827
1827
  const qs = query.toString();
1828
1828
  if (qs) path += '?' + qs;
1829
- const body = stripUndef$4({
1829
+ const body = stripUndef$3({
1830
1830
  name: name,
1831
1831
  private: private_,
1832
1832
  type: type,
@@ -1896,7 +1896,7 @@ class Projects {
1896
1896
  async updateProject(projectId, { private: private_, type, description, directory, name, thumbnail } = {}) {
1897
1897
  this._ctx.requireTokens();
1898
1898
  const path = `/api/v1/projects/${encodeURIComponent(projectId)}`;
1899
- const body = stripUndef$4({
1899
+ const body = stripUndef$3({
1900
1900
  private: private_,
1901
1901
  type: type,
1902
1902
  description: description,
@@ -1975,7 +1975,7 @@ class Projects {
1975
1975
  async addProjectEvent(projectTableName, event, detail = undefined) {
1976
1976
  this._ctx.requireTokens();
1977
1977
  const path = `/api/v1/projects/${encodeURIComponent(projectTableName)}/event`;
1978
- const body = stripUndef$4({
1978
+ const body = stripUndef$3({
1979
1979
  event: event,
1980
1980
  detail: detail,
1981
1981
  });
@@ -1994,7 +1994,7 @@ class Projects {
1994
1994
  class Photoupload {
1995
1995
  constructor(ctx) { this._ctx = ctx; this._caches = {}; }
1996
1996
 
1997
- async uploadPhotoToMediaviz(fileContent, filePath, mimetype, companyId, userId, projectTableName, blur, colors, faceRecognition, imageClassification, imageComparison, imageDescribe, ocr, judgment, { clientSideId, format, size, sourceResolutionX, sourceResolutionY, dateTaken, latitude, longitude } = {}) {
1997
+ async uploadPhotoToMediaviz(fileContent, filePath, mimetype, companyId, userId, projectTableName, blur, colors, faceRecognition, imageClassification, imageComparison, imageDescribe, ocr, { clientSideId, format, size, sourceResolutionX, sourceResolutionY, dateTaken, latitude, longitude } = {}) {
1998
1998
  this._ctx.requireTokens();
1999
1999
  const baseUrl = this._ctx.requireHost('photoUpload');
2000
2000
  const headers = {
@@ -2004,7 +2004,7 @@ class Photoupload {
2004
2004
  const resp = await fetch(baseUrl + `/photo_upload`, {
2005
2005
  method: 'POST',
2006
2006
  headers,
2007
- 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 }),
2007
+ 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 }),
2008
2008
  });
2009
2009
  return handleResponse(resp);
2010
2010
  }
@@ -2020,14 +2020,12 @@ class Photoupload {
2020
2020
  this._caches['_get_template'].set(_cacheKey_get_template, template);
2021
2021
  }
2022
2022
 
2023
- 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 });
2023
+ 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 });
2024
2024
 
2025
2025
  return upload_result;
2026
2026
  }
2027
2027
  }
2028
2028
 
2029
- function stripUndef$3(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
2030
-
2031
2029
  class Photos {
2032
2030
  constructor(ctx) { this._ctx = ctx; }
2033
2031
 
@@ -2089,16 +2087,16 @@ class Photos {
2089
2087
  return data;
2090
2088
  }
2091
2089
 
2092
- async updatePhotoInProject(tableName, photoId, { filePath, title, description, tags } = {}) {
2090
+ async updatePhotoInProject({ tableName, photoId, photoData } = {}) {
2093
2091
  this._ctx.requireTokens();
2094
- const path = `/api/v1/photos_update/${encodeURIComponent(tableName)}/id/${encodeURIComponent(photoId)}`;
2095
- const body = stripUndef$3({
2096
- file_path: filePath,
2097
- title: title,
2098
- description: description,
2099
- tags: tags,
2100
- });
2101
- const { data } = await this._ctx.client.request(path, 'PUT', this._ctx.accessToken, this._ctx.refreshToken, body);
2092
+ let path = `/api/v1/photos_update`;
2093
+ const query = new URLSearchParams();
2094
+ if (tableName !== undefined) (Array.isArray(tableName) ? tableName : [tableName]).forEach(v => query.append('table_name', v));
2095
+ if (photoId !== undefined) (Array.isArray(photoId) ? photoId : [photoId]).forEach(v => query.append('photo_id', v));
2096
+ if (photoData !== undefined) (Array.isArray(photoData) ? photoData : [photoData]).forEach(v => query.append('photo_data', v));
2097
+ const qs = query.toString();
2098
+ if (qs) path += '?' + qs;
2099
+ const { data } = await this._ctx.client.request(path, 'PUT', this._ctx.accessToken, this._ctx.refreshToken);
2102
2100
  return data;
2103
2101
  }
2104
2102
 
package/dist/sdk.umd.js CHANGED
@@ -1153,7 +1153,7 @@
1153
1153
  }
1154
1154
  }
1155
1155
 
1156
- function stripUndef$8(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1156
+ function stripUndef$7(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1157
1157
 
1158
1158
  class CuratedAlbums {
1159
1159
  constructor(ctx) { this._ctx = ctx; }
@@ -1161,7 +1161,7 @@
1161
1161
  async createCuratedAlbum(projectTableName, name, description = undefined, confidenceValue = undefined) {
1162
1162
  this._ctx.requireTokens();
1163
1163
  const path = `/api/v1/curated_album/project/${encodeURIComponent(projectTableName)}`;
1164
- const body = stripUndef$8({
1164
+ const body = stripUndef$7({
1165
1165
  name: name,
1166
1166
  description: description,
1167
1167
  confidence_value: confidenceValue,
@@ -1215,7 +1215,7 @@
1215
1215
  async updateCuratedAlbum(albumId, { name, description, confidenceValue } = {}) {
1216
1216
  this._ctx.requireTokens();
1217
1217
  const path = `/api/v1/curated_album/${encodeURIComponent(albumId)}`;
1218
- const body = stripUndef$8({
1218
+ const body = stripUndef$7({
1219
1219
  name: name,
1220
1220
  description: description,
1221
1221
  confidence_value: confidenceValue,
@@ -1239,7 +1239,7 @@
1239
1239
  }
1240
1240
  }
1241
1241
 
1242
- function stripUndef$7(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1242
+ function stripUndef$6(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1243
1243
 
1244
1244
  class CustomAlbums {
1245
1245
  constructor(ctx) { this._ctx = ctx; }
@@ -1287,7 +1287,7 @@
1287
1287
  async createProjectCustomAlbum(projectTableName, { name, description, photoIdInclusionList, photoIdRemovalList } = {}) {
1288
1288
  this._ctx.requireTokens();
1289
1289
  const path = `/api/v1/custom_album/project/${encodeURIComponent(projectTableName)}`;
1290
- const body = stripUndef$7({
1290
+ const body = stripUndef$6({
1291
1291
  name: name,
1292
1292
  description: description,
1293
1293
  photo_id_inclusion_list: photoIdInclusionList,
@@ -1300,7 +1300,7 @@
1300
1300
  async updateCustomAlbum(albumId, { name, description, photoIdInclusionList, photoIdRemovalList } = {}) {
1301
1301
  this._ctx.requireTokens();
1302
1302
  const path = `/api/v1/custom_album/${encodeURIComponent(albumId)}`;
1303
- const body = stripUndef$7({
1303
+ const body = stripUndef$6({
1304
1304
  name: name,
1305
1305
  description: description,
1306
1306
  photo_id_inclusion_list: photoIdInclusionList,
@@ -1400,7 +1400,7 @@
1400
1400
  }
1401
1401
  }
1402
1402
 
1403
- function stripUndef$6(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1403
+ function stripUndef$5(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1404
1404
 
1405
1405
  class EmailTokens {
1406
1406
  constructor(ctx) { this._ctx = ctx; }
@@ -1431,7 +1431,7 @@
1431
1431
  }
1432
1432
 
1433
1433
  async validateToken(token) {
1434
- const body = stripUndef$6({
1434
+ const body = stripUndef$5({
1435
1435
  token: token,
1436
1436
  });
1437
1437
  const resp = await fetch(this._ctx.baseUrl + `/api/v1/validate-token`, {
@@ -1443,7 +1443,7 @@
1443
1443
  }
1444
1444
 
1445
1445
  async resetPassword(token, newPassword) {
1446
- const body = stripUndef$6({
1446
+ const body = stripUndef$5({
1447
1447
  token: token,
1448
1448
  new_password: newPassword,
1449
1449
  });
@@ -1482,7 +1482,7 @@
1482
1482
  }
1483
1483
  }
1484
1484
 
1485
- function stripUndef$5(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1485
+ function stripUndef$4(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1486
1486
 
1487
1487
  class Keywords {
1488
1488
  constructor(ctx) { this._ctx = ctx; }
@@ -1490,7 +1490,7 @@
1490
1490
  async createKeywordFilteringList(name, projectList = undefined) {
1491
1491
  this._ctx.requireTokens();
1492
1492
  const path = `/api/v1/keyword/`;
1493
- const body = stripUndef$5({
1493
+ const body = stripUndef$4({
1494
1494
  name: name,
1495
1495
  project_list: projectList,
1496
1496
  });
@@ -1543,7 +1543,7 @@
1543
1543
  async updateKeywordFilteringListLabels(keywordListId, listKeywordsToInclude, listKeywordsToExclude) {
1544
1544
  this._ctx.requireTokens();
1545
1545
  const path = `/api/v1/keyword/${encodeURIComponent(keywordListId)}`;
1546
- const body = stripUndef$5({
1546
+ const body = stripUndef$4({
1547
1547
  list_keywords_to_include: listKeywordsToInclude,
1548
1548
  list_keywords_to_exclude: listKeywordsToExclude,
1549
1549
  });
@@ -1554,7 +1554,7 @@
1554
1554
  async updateKeywordFilteringListDetails(keywordListId, { name, projectList } = {}) {
1555
1555
  this._ctx.requireTokens();
1556
1556
  const path = `/api/v1/keyword/details/${encodeURIComponent(keywordListId)}`;
1557
- const body = stripUndef$5({
1557
+ const body = stripUndef$4({
1558
1558
  name: name,
1559
1559
  project_list: projectList,
1560
1560
  });
@@ -1819,7 +1819,7 @@
1819
1819
  }
1820
1820
  }
1821
1821
 
1822
- function stripUndef$4(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1822
+ function stripUndef$3(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1823
1823
 
1824
1824
  class Projects {
1825
1825
  constructor(ctx) { this._ctx = ctx; }
@@ -1832,7 +1832,7 @@
1832
1832
  if (models !== undefined) (Array.isArray(models) ? models : [models]).forEach(v => query.append('models', v));
1833
1833
  const qs = query.toString();
1834
1834
  if (qs) path += '?' + qs;
1835
- const body = stripUndef$4({
1835
+ const body = stripUndef$3({
1836
1836
  name: name,
1837
1837
  private: private_,
1838
1838
  type: type,
@@ -1902,7 +1902,7 @@
1902
1902
  async updateProject(projectId, { private: private_, type, description, directory, name, thumbnail } = {}) {
1903
1903
  this._ctx.requireTokens();
1904
1904
  const path = `/api/v1/projects/${encodeURIComponent(projectId)}`;
1905
- const body = stripUndef$4({
1905
+ const body = stripUndef$3({
1906
1906
  private: private_,
1907
1907
  type: type,
1908
1908
  description: description,
@@ -1981,7 +1981,7 @@
1981
1981
  async addProjectEvent(projectTableName, event, detail = undefined) {
1982
1982
  this._ctx.requireTokens();
1983
1983
  const path = `/api/v1/projects/${encodeURIComponent(projectTableName)}/event`;
1984
- const body = stripUndef$4({
1984
+ const body = stripUndef$3({
1985
1985
  event: event,
1986
1986
  detail: detail,
1987
1987
  });
@@ -2000,7 +2000,7 @@
2000
2000
  class Photoupload {
2001
2001
  constructor(ctx) { this._ctx = ctx; this._caches = {}; }
2002
2002
 
2003
- async uploadPhotoToMediaviz(fileContent, filePath, mimetype, companyId, userId, projectTableName, blur, colors, faceRecognition, imageClassification, imageComparison, imageDescribe, ocr, judgment, { clientSideId, format, size, sourceResolutionX, sourceResolutionY, dateTaken, latitude, longitude } = {}) {
2003
+ async uploadPhotoToMediaviz(fileContent, filePath, mimetype, companyId, userId, projectTableName, blur, colors, faceRecognition, imageClassification, imageComparison, imageDescribe, ocr, { clientSideId, format, size, sourceResolutionX, sourceResolutionY, dateTaken, latitude, longitude } = {}) {
2004
2004
  this._ctx.requireTokens();
2005
2005
  const baseUrl = this._ctx.requireHost('photoUpload');
2006
2006
  const headers = {
@@ -2010,7 +2010,7 @@
2010
2010
  const resp = await fetch(baseUrl + `/photo_upload`, {
2011
2011
  method: 'POST',
2012
2012
  headers,
2013
- 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 }),
2013
+ 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 }),
2014
2014
  });
2015
2015
  return handleResponse(resp);
2016
2016
  }
@@ -2026,14 +2026,12 @@
2026
2026
  this._caches['_get_template'].set(_cacheKey_get_template, template);
2027
2027
  }
2028
2028
 
2029
- 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 });
2029
+ 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 });
2030
2030
 
2031
2031
  return upload_result;
2032
2032
  }
2033
2033
  }
2034
2034
 
2035
- function stripUndef$3(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
2036
-
2037
2035
  class Photos {
2038
2036
  constructor(ctx) { this._ctx = ctx; }
2039
2037
 
@@ -2095,16 +2093,16 @@
2095
2093
  return data;
2096
2094
  }
2097
2095
 
2098
- async updatePhotoInProject(tableName, photoId, { filePath, title, description, tags } = {}) {
2096
+ async updatePhotoInProject({ tableName, photoId, photoData } = {}) {
2099
2097
  this._ctx.requireTokens();
2100
- const path = `/api/v1/photos_update/${encodeURIComponent(tableName)}/id/${encodeURIComponent(photoId)}`;
2101
- const body = stripUndef$3({
2102
- file_path: filePath,
2103
- title: title,
2104
- description: description,
2105
- tags: tags,
2106
- });
2107
- const { data } = await this._ctx.client.request(path, 'PUT', this._ctx.accessToken, this._ctx.refreshToken, body);
2098
+ let path = `/api/v1/photos_update`;
2099
+ const query = new URLSearchParams();
2100
+ if (tableName !== undefined) (Array.isArray(tableName) ? tableName : [tableName]).forEach(v => query.append('table_name', v));
2101
+ if (photoId !== undefined) (Array.isArray(photoId) ? photoId : [photoId]).forEach(v => query.append('photo_id', v));
2102
+ if (photoData !== undefined) (Array.isArray(photoData) ? photoData : [photoData]).forEach(v => query.append('photo_data', v));
2103
+ const qs = query.toString();
2104
+ if (qs) path += '?' + qs;
2105
+ const { data } = await this._ctx.client.request(path, 'PUT', this._ctx.accessToken, this._ctx.refreshToken);
2108
2106
  return data;
2109
2107
  }
2110
2108
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediaviz/sdk",
3
- "version": "1.9.0-dev.117",
3
+ "version": "1.9.0-rc.3",
4
4
  "description": "MediaViz JavaScript SDK \u2014 auto-generated public endpoint client.",
5
5
  "license": "MIT",
6
6
  "repository": {