@mediaviz/sdk 1.6.0-dev.86 → 1.6.0-dev.88

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
@@ -1360,7 +1360,7 @@ class Projects {
1360
1360
  class Photoupload {
1361
1361
  constructor(ctx) { this._ctx = ctx; this._caches = {}; }
1362
1362
 
1363
- async uploadPhotoToMediaviz({ fileContent, mimetype, filePath, companyId, userId, projectTableName, clientSideId, format, size, sourceResolutionX, sourceResolutionY, dateTaken, latitude, longitude, blur, colors, faceRecognition, imageDescribe, imageClassification, imageComparison, ocr }) {
1363
+ async uploadPhotoToMediaviz(fileContent, filePath, mimetype, companyId, userId, projectTableName, blur, colors, faceRecognition, imageClassification, imageComparison, imageDescribe, ocr, { clientSideId, format, size, sourceResolutionX, sourceResolutionY, dateTaken, latitude, longitude } = {}) {
1364
1364
  this._ctx.requireTokens();
1365
1365
  const baseUrl = this._ctx.requireHost('photoUpload');
1366
1366
  const headers = {
@@ -1370,7 +1370,7 @@ class Photoupload {
1370
1370
  const resp = await fetch(baseUrl + `/photo_upload`, {
1371
1371
  method: 'POST',
1372
1372
  headers,
1373
- body: JSON.stringify({ file_content: fileContent, mimetype, file_path: filePath, company_id: companyId, user_id: userId, project_table_name: projectTableName, client_side_id: clientSideId, format, size, source_resolution_x: sourceResolutionX, source_resolution_y: sourceResolutionY, date_taken: dateTaken, latitude, longitude, blur, colors, face_recognition: faceRecognition, image_describe: imageDescribe, image_classification: imageClassification, image_comparison: imageComparison, ocr }),
1373
+ 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 }),
1374
1374
  });
1375
1375
  return handleResponse(resp);
1376
1376
  }
@@ -1386,7 +1386,7 @@ class Photoupload {
1386
1386
  this._caches['_get_template'].set(_cacheKey_get_template, template);
1387
1387
  }
1388
1388
 
1389
- const upload_result = await this.uploadPhotoToMediaviz({ fileContent: photo.fileContent, mimetype: photo.mimetype, filePath: photo.filePath, companyId: companyId, userId: userId, projectTableName: projectTableName, clientSideId: photo.clientSideId, format: photo.format, size: photo.size, sourceResolutionX: photo.sourceResolutionX, sourceResolutionY: photo.sourceResolutionY, dateTaken: photo.dateTaken, latitude: photo.latitude, longitude: photo.longitude, blur: ((template?.headers?.['blur'] === true || template?.headers?.['blur'] === 'true') ? 'true' : undefined), colors: ((template?.headers?.['colors'] === true || template?.headers?.['colors'] === 'true') ? 'true' : undefined), faceRecognition: ((template?.headers?.['face_recognition'] === true || template?.headers?.['face_recognition'] === 'true') ? 'true' : undefined), imageDescribe: ((template?.headers?.['image_describe'] === true || template?.headers?.['image_describe'] === 'true') ? 'true' : undefined), imageClassification: ((template?.headers?.['image_classification'] === true || template?.headers?.['image_classification'] === 'true') ? 'true' : undefined), imageComparison: ((template?.headers?.['image_comparison'] === true || template?.headers?.['image_comparison'] === 'true') ? 'true' : undefined), ocr: ((template?.headers?.['ocr'] === true || template?.headers?.['ocr'] === 'true') ? 'true' : undefined) });
1389
+ 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 });
1390
1390
 
1391
1391
  return upload_result;
1392
1392
  }
package/dist/sdk.d.cts CHANGED
@@ -416,7 +416,7 @@ export class Person {
416
416
  }
417
417
 
418
418
  export class Photoupload {
419
- uploadPhotoToMediaviz(body: { fileContent: string, mimetype: string, filePath: string, companyId: string, userId: string, projectTableName: string, clientSideId?: string, format?: string, size?: string, sourceResolutionX?: any, sourceResolutionY?: any, dateTaken?: string, latitude?: any, longitude?: any, blur: any, colors: any, faceRecognition: any, imageDescribe: any, imageClassification: any, imageComparison: any, ocr: any }): Promise<any>;
419
+ 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>;
420
420
  uploadPhoto(companyId: string, userId: string, projectTableName: string, photo: Record<string, any>): Promise<any>;
421
421
  }
422
422
 
package/dist/sdk.d.ts CHANGED
@@ -416,7 +416,7 @@ export class Person {
416
416
  }
417
417
 
418
418
  export class Photoupload {
419
- uploadPhotoToMediaviz(body: { fileContent: string, mimetype: string, filePath: string, companyId: string, userId: string, projectTableName: string, clientSideId?: string, format?: string, size?: string, sourceResolutionX?: any, sourceResolutionY?: any, dateTaken?: string, latitude?: any, longitude?: any, blur: any, colors: any, faceRecognition: any, imageDescribe: any, imageClassification: any, imageComparison: any, ocr: any }): Promise<any>;
419
+ 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>;
420
420
  uploadPhoto(companyId: string, userId: string, projectTableName: string, photo: Record<string, any>): Promise<any>;
421
421
  }
422
422
 
package/dist/sdk.esm.d.ts CHANGED
@@ -416,7 +416,7 @@ export class Person {
416
416
  }
417
417
 
418
418
  export class Photoupload {
419
- uploadPhotoToMediaviz(body: { fileContent: string, mimetype: string, filePath: string, companyId: string, userId: string, projectTableName: string, clientSideId?: string, format?: string, size?: string, sourceResolutionX?: any, sourceResolutionY?: any, dateTaken?: string, latitude?: any, longitude?: any, blur: any, colors: any, faceRecognition: any, imageDescribe: any, imageClassification: any, imageComparison: any, ocr: any }): Promise<any>;
419
+ 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>;
420
420
  uploadPhoto(companyId: string, userId: string, projectTableName: string, photo: Record<string, any>): Promise<any>;
421
421
  }
422
422
 
package/dist/sdk.esm.js CHANGED
@@ -1358,7 +1358,7 @@ class Projects {
1358
1358
  class Photoupload {
1359
1359
  constructor(ctx) { this._ctx = ctx; this._caches = {}; }
1360
1360
 
1361
- async uploadPhotoToMediaviz({ fileContent, mimetype, filePath, companyId, userId, projectTableName, clientSideId, format, size, sourceResolutionX, sourceResolutionY, dateTaken, latitude, longitude, blur, colors, faceRecognition, imageDescribe, imageClassification, imageComparison, ocr }) {
1361
+ async uploadPhotoToMediaviz(fileContent, filePath, mimetype, companyId, userId, projectTableName, blur, colors, faceRecognition, imageClassification, imageComparison, imageDescribe, ocr, { clientSideId, format, size, sourceResolutionX, sourceResolutionY, dateTaken, latitude, longitude } = {}) {
1362
1362
  this._ctx.requireTokens();
1363
1363
  const baseUrl = this._ctx.requireHost('photoUpload');
1364
1364
  const headers = {
@@ -1368,7 +1368,7 @@ class Photoupload {
1368
1368
  const resp = await fetch(baseUrl + `/photo_upload`, {
1369
1369
  method: 'POST',
1370
1370
  headers,
1371
- body: JSON.stringify({ file_content: fileContent, mimetype, file_path: filePath, company_id: companyId, user_id: userId, project_table_name: projectTableName, client_side_id: clientSideId, format, size, source_resolution_x: sourceResolutionX, source_resolution_y: sourceResolutionY, date_taken: dateTaken, latitude, longitude, blur, colors, face_recognition: faceRecognition, image_describe: imageDescribe, image_classification: imageClassification, image_comparison: imageComparison, ocr }),
1371
+ 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 }),
1372
1372
  });
1373
1373
  return handleResponse(resp);
1374
1374
  }
@@ -1384,7 +1384,7 @@ class Photoupload {
1384
1384
  this._caches['_get_template'].set(_cacheKey_get_template, template);
1385
1385
  }
1386
1386
 
1387
- const upload_result = await this.uploadPhotoToMediaviz({ fileContent: photo.fileContent, mimetype: photo.mimetype, filePath: photo.filePath, companyId: companyId, userId: userId, projectTableName: projectTableName, clientSideId: photo.clientSideId, format: photo.format, size: photo.size, sourceResolutionX: photo.sourceResolutionX, sourceResolutionY: photo.sourceResolutionY, dateTaken: photo.dateTaken, latitude: photo.latitude, longitude: photo.longitude, blur: ((template?.headers?.['blur'] === true || template?.headers?.['blur'] === 'true') ? 'true' : undefined), colors: ((template?.headers?.['colors'] === true || template?.headers?.['colors'] === 'true') ? 'true' : undefined), faceRecognition: ((template?.headers?.['face_recognition'] === true || template?.headers?.['face_recognition'] === 'true') ? 'true' : undefined), imageDescribe: ((template?.headers?.['image_describe'] === true || template?.headers?.['image_describe'] === 'true') ? 'true' : undefined), imageClassification: ((template?.headers?.['image_classification'] === true || template?.headers?.['image_classification'] === 'true') ? 'true' : undefined), imageComparison: ((template?.headers?.['image_comparison'] === true || template?.headers?.['image_comparison'] === 'true') ? 'true' : undefined), ocr: ((template?.headers?.['ocr'] === true || template?.headers?.['ocr'] === 'true') ? 'true' : undefined) });
1387
+ 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 });
1388
1388
 
1389
1389
  return upload_result;
1390
1390
  }
package/dist/sdk.umd.js CHANGED
@@ -1364,7 +1364,7 @@
1364
1364
  class Photoupload {
1365
1365
  constructor(ctx) { this._ctx = ctx; this._caches = {}; }
1366
1366
 
1367
- async uploadPhotoToMediaviz({ fileContent, mimetype, filePath, companyId, userId, projectTableName, clientSideId, format, size, sourceResolutionX, sourceResolutionY, dateTaken, latitude, longitude, blur, colors, faceRecognition, imageDescribe, imageClassification, imageComparison, ocr }) {
1367
+ async uploadPhotoToMediaviz(fileContent, filePath, mimetype, companyId, userId, projectTableName, blur, colors, faceRecognition, imageClassification, imageComparison, imageDescribe, ocr, { clientSideId, format, size, sourceResolutionX, sourceResolutionY, dateTaken, latitude, longitude } = {}) {
1368
1368
  this._ctx.requireTokens();
1369
1369
  const baseUrl = this._ctx.requireHost('photoUpload');
1370
1370
  const headers = {
@@ -1374,7 +1374,7 @@
1374
1374
  const resp = await fetch(baseUrl + `/photo_upload`, {
1375
1375
  method: 'POST',
1376
1376
  headers,
1377
- body: JSON.stringify({ file_content: fileContent, mimetype, file_path: filePath, company_id: companyId, user_id: userId, project_table_name: projectTableName, client_side_id: clientSideId, format, size, source_resolution_x: sourceResolutionX, source_resolution_y: sourceResolutionY, date_taken: dateTaken, latitude, longitude, blur, colors, face_recognition: faceRecognition, image_describe: imageDescribe, image_classification: imageClassification, image_comparison: imageComparison, ocr }),
1377
+ 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 }),
1378
1378
  });
1379
1379
  return handleResponse(resp);
1380
1380
  }
@@ -1390,7 +1390,7 @@
1390
1390
  this._caches['_get_template'].set(_cacheKey_get_template, template);
1391
1391
  }
1392
1392
 
1393
- const upload_result = await this.uploadPhotoToMediaviz({ fileContent: photo.fileContent, mimetype: photo.mimetype, filePath: photo.filePath, companyId: companyId, userId: userId, projectTableName: projectTableName, clientSideId: photo.clientSideId, format: photo.format, size: photo.size, sourceResolutionX: photo.sourceResolutionX, sourceResolutionY: photo.sourceResolutionY, dateTaken: photo.dateTaken, latitude: photo.latitude, longitude: photo.longitude, blur: ((template?.headers?.['blur'] === true || template?.headers?.['blur'] === 'true') ? 'true' : undefined), colors: ((template?.headers?.['colors'] === true || template?.headers?.['colors'] === 'true') ? 'true' : undefined), faceRecognition: ((template?.headers?.['face_recognition'] === true || template?.headers?.['face_recognition'] === 'true') ? 'true' : undefined), imageDescribe: ((template?.headers?.['image_describe'] === true || template?.headers?.['image_describe'] === 'true') ? 'true' : undefined), imageClassification: ((template?.headers?.['image_classification'] === true || template?.headers?.['image_classification'] === 'true') ? 'true' : undefined), imageComparison: ((template?.headers?.['image_comparison'] === true || template?.headers?.['image_comparison'] === 'true') ? 'true' : undefined), ocr: ((template?.headers?.['ocr'] === true || template?.headers?.['ocr'] === 'true') ? 'true' : undefined) });
1393
+ 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 });
1394
1394
 
1395
1395
  return upload_result;
1396
1396
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediaviz/sdk",
3
- "version": "1.6.0-dev.86",
3
+ "version": "1.6.0-dev.88",
4
4
  "description": "MediaViz JavaScript SDK \u2014 auto-generated public endpoint client.",
5
5
  "license": "MIT",
6
6
  "repository": {