@mediaviz/react-native-sdk 1.10.0-rc.7 → 1.10.0-rc.8

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
@@ -2022,7 +2022,7 @@ 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), 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), (((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 });
2026
2026
 
2027
2027
  return upload_result;
2028
2028
  }
@@ -2436,6 +2436,32 @@ class Users {
2436
2436
  }
2437
2437
  }
2438
2438
 
2439
+ class Webhookreceiver {
2440
+ constructor(ctx) { this._ctx = ctx; }
2441
+
2442
+ async listSubscriptionEvents(subscriptionId, { since, limit, wait, includeHeavy } = {}) {
2443
+ this._ctx.requireTokens();
2444
+ const baseUrl = this._ctx.requireHost('webhookReceiver');
2445
+ const headers = {
2446
+ 'Content-Type': 'application/json',
2447
+ 'Authorization': `Bearer ${this._ctx.accessToken}`,
2448
+ };
2449
+ let path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}/events`;
2450
+ const query = new URLSearchParams();
2451
+ if (since !== undefined) (Array.isArray(since) ? since : [since]).forEach(v => query.append('since', v));
2452
+ if (limit !== undefined) (Array.isArray(limit) ? limit : [limit]).forEach(v => query.append('limit', v));
2453
+ if (wait !== undefined) (Array.isArray(wait) ? wait : [wait]).forEach(v => query.append('wait', v));
2454
+ if (includeHeavy !== undefined) (Array.isArray(includeHeavy) ? includeHeavy : [includeHeavy]).forEach(v => query.append('include_heavy', v));
2455
+ const qs = query.toString();
2456
+ if (qs) path += '?' + qs;
2457
+ const resp = await fetch(baseUrl + path, {
2458
+ method: 'GET',
2459
+ headers,
2460
+ });
2461
+ return handleResponse(resp);
2462
+ }
2463
+ }
2464
+
2439
2465
  // Auto-generated — do not edit
2440
2466
 
2441
2467
  function _env(key) {
@@ -2482,6 +2508,7 @@ class MediaViz {
2482
2508
  };
2483
2509
  this._hosts = {
2484
2510
  photoUpload: config.hosts?.photoUpload ?? _env('MEDIAVIZ_PHOTO_UPLOAD_URL'),
2511
+ webhookReceiver: config.hosts?.webhookReceiver ?? _env('MEDIAVIZ_WEBHOOK_RECEIVER_URL'),
2485
2512
  ...(config.hosts || {}),
2486
2513
  };
2487
2514
  this._accessToken = config.accessToken ?? null;
@@ -2515,6 +2542,7 @@ class MediaViz {
2515
2542
  this.search = new Search(_ctx);
2516
2543
  this.subscription = new Subscription(_ctx);
2517
2544
  this.users = new Users(_ctx);
2545
+ this.webhookReceiver = new Webhookreceiver(_ctx);
2518
2546
  this.webhooks = new WebhookConsumer(_ctx, this.subscription);
2519
2547
  }
2520
2548
 
@@ -2959,6 +2987,7 @@ exports.ValidationError = ValidationError;
2959
2987
  exports.WEBHOOK_MODEL_COLUMNS = WEBHOOK_MODEL_COLUMNS;
2960
2988
  exports.WEBHOOK_OUTCOME_MODELS = WEBHOOK_OUTCOME_MODELS;
2961
2989
  exports.WebhookConsumer = WebhookConsumer;
2990
+ exports.Webhookreceiver = Webhookreceiver;
2962
2991
  exports.configureCrypto = configureCrypto;
2963
2992
  exports.createCryptoProvider = createCryptoProvider;
2964
2993
  exports.createKeychainTokenStore = createKeychainTokenStore;
package/dist/sdk.d.cts CHANGED
@@ -504,7 +504,7 @@ export class Keywords {
504
504
  addCompanyToKeywordFilteringList(keywordListId: number, options?: { companyId?: number | number[] }): Promise<Record<string, any>>;
505
505
  requestKeywordListExport(keywordListId: number): Promise<Record<string, any>>;
506
506
  requestKeywordListExportStatus(keywordListId: number): Promise<AnalysisStatusResponse>;
507
- getKeywordsAndIds(): Promise<any>;
507
+ getKeywordsAndIds(): Promise<Record<string, any>>;
508
508
  removeProjectsFromKeywordFilteringList(keywordListId: number, options?: { projectIds?: any }): Promise<Record<string, any>>;
509
509
  removeCompanyFromKeywordFilteringList(keywordListId: number, options?: { companyId?: number | number[] }): Promise<Record<string, any>>;
510
510
  deleteKeywordFilteringListById(keywordListId: number): Promise<Record<string, any>>;
@@ -536,13 +536,13 @@ export class Person {
536
536
  splitPersons(projectTableName: string, id: number, options?: { newName?: string | string[], destinationPersonId?: string | string[] }): Promise<PhotoPersonLight>;
537
537
  getAllPersonsFromProject(projectTableName: string): Promise<PhotoPersonWithS3Link[]>;
538
538
  getAllPersonNamesFromProject(projectTableName: string): Promise<any>;
539
- getPhotoIdsByPersons(projectTableName: string, options?: { personId?: string[] | string[][] }): Promise<any>;
539
+ getPhotoIdsByPersons(projectTableName: string, options?: { personId?: string[] | string[][] }): Promise<any[]>;
540
540
  getAllPersonsFromPhoto(projectTableName: string, photoId: number): Promise<PhotoPersonWithCount[]>;
541
541
  removePerson(projectTableName: string, personId: string): Promise<Record<string, any>>;
542
542
  }
543
543
 
544
544
  export class Photoupload {
545
- 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: string, options?: { clientSideId?: string, format?: string, size?: string, sourceResolutionX?: number | string, sourceResolutionY?: number | string, dateTaken?: string, latitude?: number | string, longitude?: number | string }): Promise<any>;
545
+ 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>;
546
546
  uploadPhoto(companyId: string, userId: string, projectTableName: string, photo: Record<string, any>): Promise<any>;
547
547
  }
548
548
 
@@ -582,9 +582,9 @@ export class Projects {
582
582
  export class Search {
583
583
  searchProjectPhotos(projectTableName: string, options?: { andParams?: any, andStringParams?: any, orParams?: any, orStringParams?: any, notParams?: any, notStringParams?: any, dateMin?: string | string[], dateMax?: string | string[], dateNullAnd?: boolean | boolean[], dateNullOr?: boolean | boolean[], dateOrder?: string | string[], customAlbumId?: number | number[], bestOfSimilarSetsOnly?: boolean | boolean[], curatedAlbumId?: number | number[], splitByTier?: boolean | boolean[] }): Promise<Record<string, any>>;
584
584
  searchProjectPhotosParametrized(projectTableName: string, options?: { andSearchText?: any, orSearchText?: any, notSearchText?: any, city?: any, country?: any, state?: any, albums?: any, dateMin?: string | string[], dateMax?: string | string[], dateNullAnd?: boolean | boolean[], dateNullOr?: boolean | boolean[], ascOrDesc?: string | string[], bestOfSimilarSetsOnly?: boolean | boolean[], splitByTier?: boolean | boolean[], lastId?: number | number[], limit?: number | number[] }): Promise<Record<string, any>>;
585
- recallProjectPhotos(projectTableName: string, options?: { ascOrDesc?: string | string[], bestOfSimilarSetsOnly?: boolean | boolean[], lastId?: number | number[], limit?: number | number[] }): Promise<any>;
585
+ recallProjectPhotos(projectTableName: string, options?: { ascOrDesc?: string | string[], bestOfSimilarSetsOnly?: boolean | boolean[], lastId?: number | number[], limit?: number | number[] }): Promise<Record<string, any>[]>;
586
586
  searchProjectPhotosNaturalLanguage(projectTableName: string, searchText: string, size?: number, options?: { minCosine?: number | number[], labelMinCosine?: number | number[], labelTopK?: number | number[], labelDelta?: number | number[], bestOfSimilarSetsOnly?: boolean | boolean[], splitByTier?: boolean | boolean[] }): Promise<Record<string, any>>;
587
- getProjectSavedSearches(projectTableName: string): Promise<any>;
587
+ getProjectSavedSearches(projectTableName: string): Promise<Record<string, any>>;
588
588
  getSavedSearchById(searchId: number): Promise<SearchDisplay>;
589
589
  saveProjectPhotosSearch(projectTableName: string, options?: { searchName?: string | string[], andParams?: any, andStringParams?: any, orParams?: any, orStringParams?: any, notParams?: any, notStringParams?: any, dateMin?: string | string[], dateMax?: string | string[], dateNullAnd?: boolean | boolean[], dateNullOr?: boolean | boolean[], dateOrder?: string | string[], customAlbumId?: number | number[], bestOfSimilarSetsOnly?: boolean | boolean[], curatedAlbumId?: number | number[], splitByTier?: boolean | boolean[] }): Promise<Record<string, any>>;
590
590
  deleteSavedSearchById(searchId: number): Promise<Record<string, any>>;
@@ -611,6 +611,10 @@ export class Users {
611
611
  deleteUser(userId: number, options?: { newCompanyOwnerId?: number | number[] }): Promise<Record<string, any>>;
612
612
  }
613
613
 
614
+ export class Webhookreceiver {
615
+ listSubscriptionEvents(subscriptionId: string, options?: { since?: string | string[], limit?: number | number[], wait?: number | number[], includeHeavy?: boolean | boolean[] }): Promise<Record<string, any>>;
616
+ }
617
+
614
618
  export class MediaViz {
615
619
  constructor(config?: MediaVizConfig);
616
620
  authenticate(): Promise<TokenResponse>;
@@ -637,6 +641,7 @@ export class MediaViz {
637
641
  readonly search: Search;
638
642
  readonly subscription: Subscription;
639
643
  readonly users: Users;
644
+ readonly webhookReceiver: Webhookreceiver;
640
645
  readonly webhooks: WebhookConsumer;
641
646
  }
642
647
 
package/dist/sdk.d.ts CHANGED
@@ -504,7 +504,7 @@ export class Keywords {
504
504
  addCompanyToKeywordFilteringList(keywordListId: number, options?: { companyId?: number | number[] }): Promise<Record<string, any>>;
505
505
  requestKeywordListExport(keywordListId: number): Promise<Record<string, any>>;
506
506
  requestKeywordListExportStatus(keywordListId: number): Promise<AnalysisStatusResponse>;
507
- getKeywordsAndIds(): Promise<any>;
507
+ getKeywordsAndIds(): Promise<Record<string, any>>;
508
508
  removeProjectsFromKeywordFilteringList(keywordListId: number, options?: { projectIds?: any }): Promise<Record<string, any>>;
509
509
  removeCompanyFromKeywordFilteringList(keywordListId: number, options?: { companyId?: number | number[] }): Promise<Record<string, any>>;
510
510
  deleteKeywordFilteringListById(keywordListId: number): Promise<Record<string, any>>;
@@ -536,13 +536,13 @@ export class Person {
536
536
  splitPersons(projectTableName: string, id: number, options?: { newName?: string | string[], destinationPersonId?: string | string[] }): Promise<PhotoPersonLight>;
537
537
  getAllPersonsFromProject(projectTableName: string): Promise<PhotoPersonWithS3Link[]>;
538
538
  getAllPersonNamesFromProject(projectTableName: string): Promise<any>;
539
- getPhotoIdsByPersons(projectTableName: string, options?: { personId?: string[] | string[][] }): Promise<any>;
539
+ getPhotoIdsByPersons(projectTableName: string, options?: { personId?: string[] | string[][] }): Promise<any[]>;
540
540
  getAllPersonsFromPhoto(projectTableName: string, photoId: number): Promise<PhotoPersonWithCount[]>;
541
541
  removePerson(projectTableName: string, personId: string): Promise<Record<string, any>>;
542
542
  }
543
543
 
544
544
  export class Photoupload {
545
- 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: string, options?: { clientSideId?: string, format?: string, size?: string, sourceResolutionX?: number | string, sourceResolutionY?: number | string, dateTaken?: string, latitude?: number | string, longitude?: number | string }): Promise<any>;
545
+ 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>;
546
546
  uploadPhoto(companyId: string, userId: string, projectTableName: string, photo: Record<string, any>): Promise<any>;
547
547
  }
548
548
 
@@ -582,9 +582,9 @@ export class Projects {
582
582
  export class Search {
583
583
  searchProjectPhotos(projectTableName: string, options?: { andParams?: any, andStringParams?: any, orParams?: any, orStringParams?: any, notParams?: any, notStringParams?: any, dateMin?: string | string[], dateMax?: string | string[], dateNullAnd?: boolean | boolean[], dateNullOr?: boolean | boolean[], dateOrder?: string | string[], customAlbumId?: number | number[], bestOfSimilarSetsOnly?: boolean | boolean[], curatedAlbumId?: number | number[], splitByTier?: boolean | boolean[] }): Promise<Record<string, any>>;
584
584
  searchProjectPhotosParametrized(projectTableName: string, options?: { andSearchText?: any, orSearchText?: any, notSearchText?: any, city?: any, country?: any, state?: any, albums?: any, dateMin?: string | string[], dateMax?: string | string[], dateNullAnd?: boolean | boolean[], dateNullOr?: boolean | boolean[], ascOrDesc?: string | string[], bestOfSimilarSetsOnly?: boolean | boolean[], splitByTier?: boolean | boolean[], lastId?: number | number[], limit?: number | number[] }): Promise<Record<string, any>>;
585
- recallProjectPhotos(projectTableName: string, options?: { ascOrDesc?: string | string[], bestOfSimilarSetsOnly?: boolean | boolean[], lastId?: number | number[], limit?: number | number[] }): Promise<any>;
585
+ recallProjectPhotos(projectTableName: string, options?: { ascOrDesc?: string | string[], bestOfSimilarSetsOnly?: boolean | boolean[], lastId?: number | number[], limit?: number | number[] }): Promise<Record<string, any>[]>;
586
586
  searchProjectPhotosNaturalLanguage(projectTableName: string, searchText: string, size?: number, options?: { minCosine?: number | number[], labelMinCosine?: number | number[], labelTopK?: number | number[], labelDelta?: number | number[], bestOfSimilarSetsOnly?: boolean | boolean[], splitByTier?: boolean | boolean[] }): Promise<Record<string, any>>;
587
- getProjectSavedSearches(projectTableName: string): Promise<any>;
587
+ getProjectSavedSearches(projectTableName: string): Promise<Record<string, any>>;
588
588
  getSavedSearchById(searchId: number): Promise<SearchDisplay>;
589
589
  saveProjectPhotosSearch(projectTableName: string, options?: { searchName?: string | string[], andParams?: any, andStringParams?: any, orParams?: any, orStringParams?: any, notParams?: any, notStringParams?: any, dateMin?: string | string[], dateMax?: string | string[], dateNullAnd?: boolean | boolean[], dateNullOr?: boolean | boolean[], dateOrder?: string | string[], customAlbumId?: number | number[], bestOfSimilarSetsOnly?: boolean | boolean[], curatedAlbumId?: number | number[], splitByTier?: boolean | boolean[] }): Promise<Record<string, any>>;
590
590
  deleteSavedSearchById(searchId: number): Promise<Record<string, any>>;
@@ -611,6 +611,10 @@ export class Users {
611
611
  deleteUser(userId: number, options?: { newCompanyOwnerId?: number | number[] }): Promise<Record<string, any>>;
612
612
  }
613
613
 
614
+ export class Webhookreceiver {
615
+ listSubscriptionEvents(subscriptionId: string, options?: { since?: string | string[], limit?: number | number[], wait?: number | number[], includeHeavy?: boolean | boolean[] }): Promise<Record<string, any>>;
616
+ }
617
+
614
618
  export class MediaViz {
615
619
  constructor(config?: MediaVizConfig);
616
620
  authenticate(): Promise<TokenResponse>;
@@ -637,6 +641,7 @@ export class MediaViz {
637
641
  readonly search: Search;
638
642
  readonly subscription: Subscription;
639
643
  readonly users: Users;
644
+ readonly webhookReceiver: Webhookreceiver;
640
645
  readonly webhooks: WebhookConsumer;
641
646
  }
642
647
 
package/dist/sdk.esm.d.ts CHANGED
@@ -504,7 +504,7 @@ export class Keywords {
504
504
  addCompanyToKeywordFilteringList(keywordListId: number, options?: { companyId?: number | number[] }): Promise<Record<string, any>>;
505
505
  requestKeywordListExport(keywordListId: number): Promise<Record<string, any>>;
506
506
  requestKeywordListExportStatus(keywordListId: number): Promise<AnalysisStatusResponse>;
507
- getKeywordsAndIds(): Promise<any>;
507
+ getKeywordsAndIds(): Promise<Record<string, any>>;
508
508
  removeProjectsFromKeywordFilteringList(keywordListId: number, options?: { projectIds?: any }): Promise<Record<string, any>>;
509
509
  removeCompanyFromKeywordFilteringList(keywordListId: number, options?: { companyId?: number | number[] }): Promise<Record<string, any>>;
510
510
  deleteKeywordFilteringListById(keywordListId: number): Promise<Record<string, any>>;
@@ -536,13 +536,13 @@ export class Person {
536
536
  splitPersons(projectTableName: string, id: number, options?: { newName?: string | string[], destinationPersonId?: string | string[] }): Promise<PhotoPersonLight>;
537
537
  getAllPersonsFromProject(projectTableName: string): Promise<PhotoPersonWithS3Link[]>;
538
538
  getAllPersonNamesFromProject(projectTableName: string): Promise<any>;
539
- getPhotoIdsByPersons(projectTableName: string, options?: { personId?: string[] | string[][] }): Promise<any>;
539
+ getPhotoIdsByPersons(projectTableName: string, options?: { personId?: string[] | string[][] }): Promise<any[]>;
540
540
  getAllPersonsFromPhoto(projectTableName: string, photoId: number): Promise<PhotoPersonWithCount[]>;
541
541
  removePerson(projectTableName: string, personId: string): Promise<Record<string, any>>;
542
542
  }
543
543
 
544
544
  export class Photoupload {
545
- 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: string, options?: { clientSideId?: string, format?: string, size?: string, sourceResolutionX?: number | string, sourceResolutionY?: number | string, dateTaken?: string, latitude?: number | string, longitude?: number | string }): Promise<any>;
545
+ 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>;
546
546
  uploadPhoto(companyId: string, userId: string, projectTableName: string, photo: Record<string, any>): Promise<any>;
547
547
  }
548
548
 
@@ -582,9 +582,9 @@ export class Projects {
582
582
  export class Search {
583
583
  searchProjectPhotos(projectTableName: string, options?: { andParams?: any, andStringParams?: any, orParams?: any, orStringParams?: any, notParams?: any, notStringParams?: any, dateMin?: string | string[], dateMax?: string | string[], dateNullAnd?: boolean | boolean[], dateNullOr?: boolean | boolean[], dateOrder?: string | string[], customAlbumId?: number | number[], bestOfSimilarSetsOnly?: boolean | boolean[], curatedAlbumId?: number | number[], splitByTier?: boolean | boolean[] }): Promise<Record<string, any>>;
584
584
  searchProjectPhotosParametrized(projectTableName: string, options?: { andSearchText?: any, orSearchText?: any, notSearchText?: any, city?: any, country?: any, state?: any, albums?: any, dateMin?: string | string[], dateMax?: string | string[], dateNullAnd?: boolean | boolean[], dateNullOr?: boolean | boolean[], ascOrDesc?: string | string[], bestOfSimilarSetsOnly?: boolean | boolean[], splitByTier?: boolean | boolean[], lastId?: number | number[], limit?: number | number[] }): Promise<Record<string, any>>;
585
- recallProjectPhotos(projectTableName: string, options?: { ascOrDesc?: string | string[], bestOfSimilarSetsOnly?: boolean | boolean[], lastId?: number | number[], limit?: number | number[] }): Promise<any>;
585
+ recallProjectPhotos(projectTableName: string, options?: { ascOrDesc?: string | string[], bestOfSimilarSetsOnly?: boolean | boolean[], lastId?: number | number[], limit?: number | number[] }): Promise<Record<string, any>[]>;
586
586
  searchProjectPhotosNaturalLanguage(projectTableName: string, searchText: string, size?: number, options?: { minCosine?: number | number[], labelMinCosine?: number | number[], labelTopK?: number | number[], labelDelta?: number | number[], bestOfSimilarSetsOnly?: boolean | boolean[], splitByTier?: boolean | boolean[] }): Promise<Record<string, any>>;
587
- getProjectSavedSearches(projectTableName: string): Promise<any>;
587
+ getProjectSavedSearches(projectTableName: string): Promise<Record<string, any>>;
588
588
  getSavedSearchById(searchId: number): Promise<SearchDisplay>;
589
589
  saveProjectPhotosSearch(projectTableName: string, options?: { searchName?: string | string[], andParams?: any, andStringParams?: any, orParams?: any, orStringParams?: any, notParams?: any, notStringParams?: any, dateMin?: string | string[], dateMax?: string | string[], dateNullAnd?: boolean | boolean[], dateNullOr?: boolean | boolean[], dateOrder?: string | string[], customAlbumId?: number | number[], bestOfSimilarSetsOnly?: boolean | boolean[], curatedAlbumId?: number | number[], splitByTier?: boolean | boolean[] }): Promise<Record<string, any>>;
590
590
  deleteSavedSearchById(searchId: number): Promise<Record<string, any>>;
@@ -611,6 +611,10 @@ export class Users {
611
611
  deleteUser(userId: number, options?: { newCompanyOwnerId?: number | number[] }): Promise<Record<string, any>>;
612
612
  }
613
613
 
614
+ export class Webhookreceiver {
615
+ listSubscriptionEvents(subscriptionId: string, options?: { since?: string | string[], limit?: number | number[], wait?: number | number[], includeHeavy?: boolean | boolean[] }): Promise<Record<string, any>>;
616
+ }
617
+
614
618
  export class MediaViz {
615
619
  constructor(config?: MediaVizConfig);
616
620
  authenticate(): Promise<TokenResponse>;
@@ -637,6 +641,7 @@ export class MediaViz {
637
641
  readonly search: Search;
638
642
  readonly subscription: Subscription;
639
643
  readonly users: Users;
644
+ readonly webhookReceiver: Webhookreceiver;
640
645
  readonly webhooks: WebhookConsumer;
641
646
  }
642
647
 
package/dist/sdk.esm.js CHANGED
@@ -2020,7 +2020,7 @@ 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), 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), (((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 });
2024
2024
 
2025
2025
  return upload_result;
2026
2026
  }
@@ -2434,6 +2434,32 @@ class Users {
2434
2434
  }
2435
2435
  }
2436
2436
 
2437
+ class Webhookreceiver {
2438
+ constructor(ctx) { this._ctx = ctx; }
2439
+
2440
+ async listSubscriptionEvents(subscriptionId, { since, limit, wait, includeHeavy } = {}) {
2441
+ this._ctx.requireTokens();
2442
+ const baseUrl = this._ctx.requireHost('webhookReceiver');
2443
+ const headers = {
2444
+ 'Content-Type': 'application/json',
2445
+ 'Authorization': `Bearer ${this._ctx.accessToken}`,
2446
+ };
2447
+ let path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}/events`;
2448
+ const query = new URLSearchParams();
2449
+ if (since !== undefined) (Array.isArray(since) ? since : [since]).forEach(v => query.append('since', v));
2450
+ if (limit !== undefined) (Array.isArray(limit) ? limit : [limit]).forEach(v => query.append('limit', v));
2451
+ if (wait !== undefined) (Array.isArray(wait) ? wait : [wait]).forEach(v => query.append('wait', v));
2452
+ if (includeHeavy !== undefined) (Array.isArray(includeHeavy) ? includeHeavy : [includeHeavy]).forEach(v => query.append('include_heavy', v));
2453
+ const qs = query.toString();
2454
+ if (qs) path += '?' + qs;
2455
+ const resp = await fetch(baseUrl + path, {
2456
+ method: 'GET',
2457
+ headers,
2458
+ });
2459
+ return handleResponse(resp);
2460
+ }
2461
+ }
2462
+
2437
2463
  // Auto-generated — do not edit
2438
2464
 
2439
2465
  function _env(key) {
@@ -2480,6 +2506,7 @@ class MediaViz {
2480
2506
  };
2481
2507
  this._hosts = {
2482
2508
  photoUpload: config.hosts?.photoUpload ?? _env('MEDIAVIZ_PHOTO_UPLOAD_URL'),
2509
+ webhookReceiver: config.hosts?.webhookReceiver ?? _env('MEDIAVIZ_WEBHOOK_RECEIVER_URL'),
2483
2510
  ...(config.hosts || {}),
2484
2511
  };
2485
2512
  this._accessToken = config.accessToken ?? null;
@@ -2513,6 +2540,7 @@ class MediaViz {
2513
2540
  this.search = new Search(_ctx);
2514
2541
  this.subscription = new Subscription(_ctx);
2515
2542
  this.users = new Users(_ctx);
2543
+ this.webhookReceiver = new Webhookreceiver(_ctx);
2516
2544
  this.webhooks = new WebhookConsumer(_ctx, this.subscription);
2517
2545
  }
2518
2546
 
@@ -2924,4 +2952,4 @@ var _react_native = /*@__PURE__*/getDefaultExportFromCjs(srcExports);
2924
2952
  // Auto-generated — do not edit
2925
2953
  const { createCryptoProvider, MemoryTokenStore, createSecureTokenStore, createKeychainTokenStore, startAuthSession, parseRedirectUrl, AuthSessionError, createSession } = _react_native;
2926
2954
 
2927
- export { Admin, AiModelCredits, ApiError, AuthSessionError, Company, CuratedAlbums, CustomAlbums, EmailTokens, Health, InMemoryWebhookStore, Keywords, MediaViz, MemoryTokenStore, NotFoundError, OAuthClient, OAuthError, OAuthErrorCode, OauthAuthorization, OauthLogin, OauthToken, Person, Photos, Photoupload, Projects, RateLimitError, Search, ServerError, Subscription, Users, ValidationError, WEBHOOK_MODEL_COLUMNS, WEBHOOK_OUTCOME_MODELS, WebhookConsumer, configureCrypto, createCryptoProvider, createKeychainTokenStore, createSecureTokenStore, createSession, handleResponse, parseRedirectUrl, selectResultColumns, signWebhookPayload, startAuthSession, verifyWebhookSignature };
2955
+ export { Admin, AiModelCredits, ApiError, AuthSessionError, Company, CuratedAlbums, CustomAlbums, EmailTokens, Health, InMemoryWebhookStore, Keywords, MediaViz, MemoryTokenStore, NotFoundError, OAuthClient, OAuthError, OAuthErrorCode, OauthAuthorization, OauthLogin, OauthToken, Person, Photos, Photoupload, Projects, RateLimitError, Search, ServerError, Subscription, Users, ValidationError, WEBHOOK_MODEL_COLUMNS, WEBHOOK_OUTCOME_MODELS, WebhookConsumer, Webhookreceiver, configureCrypto, createCryptoProvider, createKeychainTokenStore, createSecureTokenStore, createSession, handleResponse, parseRedirectUrl, selectResultColumns, signWebhookPayload, startAuthSession, verifyWebhookSignature };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediaviz/react-native-sdk",
3
- "version": "1.10.0-rc.7",
3
+ "version": "1.10.0-rc.8",
4
4
  "description": "MediaViz React Native SDK \u2014 auto-generated endpoint client for React Native and Expo.",
5
5
  "license": "MIT",
6
6
  "repository": {