@mediaviz/sdk 1.6.0-rc.3 → 1.8.0-dev.90

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
@@ -527,7 +527,7 @@ class Company {
527
527
  }
528
528
  }
529
529
 
530
- function stripUndef$6(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
530
+ function stripUndef$7(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
531
531
 
532
532
  class CuratedAlbums {
533
533
  constructor(ctx) { this._ctx = ctx; }
@@ -535,7 +535,7 @@ class CuratedAlbums {
535
535
  async createCuratedAlbum(projectTableName, name, description = undefined, confidenceValue = undefined) {
536
536
  this._ctx.requireTokens();
537
537
  const path = `/api/v1/curated_album/project/${encodeURIComponent(projectTableName)}`;
538
- const body = stripUndef$6({
538
+ const body = stripUndef$7({
539
539
  name: name,
540
540
  description: description,
541
541
  confidence_value: confidenceValue,
@@ -589,7 +589,7 @@ class CuratedAlbums {
589
589
  async updateCuratedAlbum(albumId, { name, description, confidenceValue } = {}) {
590
590
  this._ctx.requireTokens();
591
591
  const path = `/api/v1/curated_album/${encodeURIComponent(albumId)}`;
592
- const body = stripUndef$6({
592
+ const body = stripUndef$7({
593
593
  name: name,
594
594
  description: description,
595
595
  confidence_value: confidenceValue,
@@ -613,7 +613,7 @@ class CuratedAlbums {
613
613
  }
614
614
  }
615
615
 
616
- function stripUndef$5(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
616
+ function stripUndef$6(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
617
617
 
618
618
  class CustomAlbums {
619
619
  constructor(ctx) { this._ctx = ctx; }
@@ -661,7 +661,7 @@ class CustomAlbums {
661
661
  async createProjectCustomAlbum(projectTableName, { name, description, photoIdInclusionList, photoIdRemovalList } = {}) {
662
662
  this._ctx.requireTokens();
663
663
  const path = `/api/v1/custom_album/project/${encodeURIComponent(projectTableName)}`;
664
- const body = stripUndef$5({
664
+ const body = stripUndef$6({
665
665
  name: name,
666
666
  description: description,
667
667
  photo_id_inclusion_list: photoIdInclusionList,
@@ -674,7 +674,7 @@ class CustomAlbums {
674
674
  async updateCustomAlbum(albumId, { name, description, photoIdInclusionList, photoIdRemovalList } = {}) {
675
675
  this._ctx.requireTokens();
676
676
  const path = `/api/v1/custom_album/${encodeURIComponent(albumId)}`;
677
- const body = stripUndef$5({
677
+ const body = stripUndef$6({
678
678
  name: name,
679
679
  description: description,
680
680
  photo_id_inclusion_list: photoIdInclusionList,
@@ -774,7 +774,7 @@ async function handleResponse(response) {
774
774
  }
775
775
  }
776
776
 
777
- function stripUndef$4(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
777
+ function stripUndef$5(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
778
778
 
779
779
  class EmailTokens {
780
780
  constructor(ctx) { this._ctx = ctx; }
@@ -805,7 +805,7 @@ class EmailTokens {
805
805
  }
806
806
 
807
807
  async validateToken(token) {
808
- const body = stripUndef$4({
808
+ const body = stripUndef$5({
809
809
  token: token,
810
810
  });
811
811
  const resp = await fetch(this._ctx.baseUrl + `/api/v1/validate-token`, {
@@ -817,7 +817,7 @@ class EmailTokens {
817
817
  }
818
818
 
819
819
  async resetPassword(token, newPassword) {
820
- const body = stripUndef$4({
820
+ const body = stripUndef$5({
821
821
  token: token,
822
822
  new_password: newPassword,
823
823
  });
@@ -856,7 +856,7 @@ class Health {
856
856
  }
857
857
  }
858
858
 
859
- function stripUndef$3(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
859
+ function stripUndef$4(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
860
860
 
861
861
  class Keywords {
862
862
  constructor(ctx) { this._ctx = ctx; }
@@ -864,7 +864,7 @@ class Keywords {
864
864
  async createKeywordFilteringList(name, projectList = undefined) {
865
865
  this._ctx.requireTokens();
866
866
  const path = `/api/v1/keyword/`;
867
- const body = stripUndef$3({
867
+ const body = stripUndef$4({
868
868
  name: name,
869
869
  project_list: projectList,
870
870
  });
@@ -917,7 +917,7 @@ class Keywords {
917
917
  async updateKeywordFilteringListLabels(keywordListId, listKeywordsToInclude, listKeywordsToExclude) {
918
918
  this._ctx.requireTokens();
919
919
  const path = `/api/v1/keyword/${encodeURIComponent(keywordListId)}`;
920
- const body = stripUndef$3({
920
+ const body = stripUndef$4({
921
921
  list_keywords_to_include: listKeywordsToInclude,
922
922
  list_keywords_to_exclude: listKeywordsToExclude,
923
923
  });
@@ -928,7 +928,7 @@ class Keywords {
928
928
  async updateKeywordFilteringListDetails(keywordListId, { name, projectList } = {}) {
929
929
  this._ctx.requireTokens();
930
930
  const path = `/api/v1/keyword/details/${encodeURIComponent(keywordListId)}`;
931
- const body = stripUndef$3({
931
+ const body = stripUndef$4({
932
932
  name: name,
933
933
  project_list: projectList,
934
934
  });
@@ -1127,6 +1127,13 @@ class Person {
1127
1127
  return data;
1128
1128
  }
1129
1129
 
1130
+ async removePersonName(projectTableName, personId) {
1131
+ this._ctx.requireTokens();
1132
+ const path = `/api/v1/person/${encodeURIComponent(projectTableName)}/remove_name/${encodeURIComponent(personId)}`;
1133
+ const { data } = await this._ctx.client.request(path, 'PUT', this._ctx.accessToken, this._ctx.refreshToken);
1134
+ return data;
1135
+ }
1136
+
1130
1137
  async combinePersons(projectTableName, destinationPersonId, oldPersonId) {
1131
1138
  this._ctx.requireTokens();
1132
1139
  const path = `/api/v1/person/${encodeURIComponent(projectTableName)}/combine/${encodeURIComponent(destinationPersonId)}/${encodeURIComponent(oldPersonId)}`;
@@ -1179,7 +1186,7 @@ class Person {
1179
1186
  }
1180
1187
  }
1181
1188
 
1182
- function stripUndef$2(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1189
+ function stripUndef$3(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1183
1190
 
1184
1191
  class Projects {
1185
1192
  constructor(ctx) { this._ctx = ctx; }
@@ -1192,7 +1199,7 @@ class Projects {
1192
1199
  if (models !== undefined) (Array.isArray(models) ? models : [models]).forEach(v => query.append('models', v));
1193
1200
  const qs = query.toString();
1194
1201
  if (qs) path += '?' + qs;
1195
- const body = stripUndef$2({
1202
+ const body = stripUndef$3({
1196
1203
  name: name,
1197
1204
  private: private_,
1198
1205
  type: type,
@@ -1262,7 +1269,7 @@ class Projects {
1262
1269
  async updateProject(projectId, { private: private_, type, description, directory, name, thumbnail } = {}) {
1263
1270
  this._ctx.requireTokens();
1264
1271
  const path = `/api/v1/projects/${encodeURIComponent(projectId)}`;
1265
- const body = stripUndef$2({
1272
+ const body = stripUndef$3({
1266
1273
  private: private_,
1267
1274
  type: type,
1268
1275
  description: description,
@@ -1341,7 +1348,7 @@ class Projects {
1341
1348
  async addProjectEvent(projectTableName, event, detail = undefined) {
1342
1349
  this._ctx.requireTokens();
1343
1350
  const path = `/api/v1/projects/${encodeURIComponent(projectTableName)}/event`;
1344
- const body = stripUndef$2({
1351
+ const body = stripUndef$3({
1345
1352
  event: event,
1346
1353
  detail: detail,
1347
1354
  });
@@ -1485,7 +1492,7 @@ class Photos {
1485
1492
  }
1486
1493
  }
1487
1494
 
1488
- function stripUndef$1(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1495
+ function stripUndef$2(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1489
1496
 
1490
1497
  class Search {
1491
1498
  constructor(ctx) { this._ctx = ctx; }
@@ -1555,7 +1562,7 @@ class Search {
1555
1562
  return data;
1556
1563
  }
1557
1564
 
1558
- async searchProjectPhotosNaturalLanguage(projectTableName, searchText, size = undefined, { minCosine, labelMinCosine, labelTopK, labelDelta, bestOfSimilarSetsOnly, splitByTier } = {}) {
1565
+ async searchProjectPhotosNaturalLanguage(projectTableName, searchText, { minCosine, labelMinCosine, labelTopK, labelDelta, bestOfSimilarSetsOnly, splitByTier } = {}) {
1559
1566
  this._ctx.requireTokens();
1560
1567
  let path = `/api/v1/search/natural_language/${encodeURIComponent(projectTableName)}/`;
1561
1568
  const query = new URLSearchParams();
@@ -1567,9 +1574,8 @@ class Search {
1567
1574
  if (splitByTier !== undefined) (Array.isArray(splitByTier) ? splitByTier : [splitByTier]).forEach(v => query.append('split_by_tier', v));
1568
1575
  const qs = query.toString();
1569
1576
  if (qs) path += '?' + qs;
1570
- const body = stripUndef$1({
1577
+ const body = stripUndef$2({
1571
1578
  search_text: searchText,
1572
- size: size,
1573
1579
  });
1574
1580
  const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken, body);
1575
1581
  return data;
@@ -1623,6 +1629,75 @@ class Search {
1623
1629
  }
1624
1630
  }
1625
1631
 
1632
+ function stripUndef$1(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1633
+
1634
+ class Subscription {
1635
+ constructor(ctx) { this._ctx = ctx; }
1636
+
1637
+ async createSubscription(projectTableName, callbackUrl, targets) {
1638
+ this._ctx.requireTokens();
1639
+ const path = `/api/v1/subscriptions`;
1640
+ const body = stripUndef$1({
1641
+ project_table_name: projectTableName,
1642
+ callback_url: callbackUrl,
1643
+ targets: targets,
1644
+ });
1645
+ const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken, body);
1646
+ return data;
1647
+ }
1648
+
1649
+ async verifySubscription(subscriptionId) {
1650
+ this._ctx.requireTokens();
1651
+ const path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}/verify`;
1652
+ const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken);
1653
+ return data;
1654
+ }
1655
+
1656
+ async listSubscriptions() {
1657
+ this._ctx.requireTokens();
1658
+ const path = `/api/v1/subscriptions`;
1659
+ const { data } = await this._ctx.client.request(path, 'GET', this._ctx.accessToken, this._ctx.refreshToken);
1660
+ return data;
1661
+ }
1662
+
1663
+ async listSubscriptionEvents(subscriptionId, { since, limit } = {}) {
1664
+ this._ctx.requireTokens();
1665
+ let path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}/events`;
1666
+ const query = new URLSearchParams();
1667
+ if (since !== undefined) (Array.isArray(since) ? since : [since]).forEach(v => query.append('since', v));
1668
+ if (limit !== undefined) (Array.isArray(limit) ? limit : [limit]).forEach(v => query.append('limit', v));
1669
+ const qs = query.toString();
1670
+ if (qs) path += '?' + qs;
1671
+ const { data } = await this._ctx.client.request(path, 'GET', this._ctx.accessToken, this._ctx.refreshToken);
1672
+ return data;
1673
+ }
1674
+
1675
+ async updateSubscription(subscriptionId, { callbackUrl, targets } = {}) {
1676
+ this._ctx.requireTokens();
1677
+ const path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}`;
1678
+ const body = stripUndef$1({
1679
+ callback_url: callbackUrl,
1680
+ targets: targets,
1681
+ });
1682
+ const { data } = await this._ctx.client.request(path, 'PATCH', this._ctx.accessToken, this._ctx.refreshToken, body);
1683
+ return data;
1684
+ }
1685
+
1686
+ async deleteSubscription(subscriptionId) {
1687
+ this._ctx.requireTokens();
1688
+ const path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}`;
1689
+ const { data } = await this._ctx.client.request(path, 'DELETE', this._ctx.accessToken, this._ctx.refreshToken);
1690
+ return data;
1691
+ }
1692
+
1693
+ async rotateSubscriptionSecret(subscriptionId) {
1694
+ this._ctx.requireTokens();
1695
+ const path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}/rotate_secret`;
1696
+ const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken);
1697
+ return data;
1698
+ }
1699
+ }
1700
+
1626
1701
  function stripUndef(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1627
1702
 
1628
1703
  class Users {
@@ -1806,6 +1881,7 @@ class MediaViz {
1806
1881
  this.photos = new Photos(_ctx);
1807
1882
  this.projects = new Projects(_ctx);
1808
1883
  this.search = new Search(_ctx);
1884
+ this.subscription = new Subscription(_ctx);
1809
1885
  this.users = new Users(_ctx);
1810
1886
  }
1811
1887
 
@@ -1860,6 +1936,7 @@ exports.Projects = Projects;
1860
1936
  exports.RateLimitError = RateLimitError;
1861
1937
  exports.Search = Search;
1862
1938
  exports.ServerError = ServerError;
1939
+ exports.Subscription = Subscription;
1863
1940
  exports.Users = Users;
1864
1941
  exports.ValidationError = ValidationError;
1865
1942
  exports.handleResponse = handleResponse;
package/dist/sdk.d.cts CHANGED
@@ -107,6 +107,12 @@ export interface CuratedAlbumDisplay {
107
107
  confidence_value?: number;
108
108
  }
109
109
 
110
+ export interface EventPage {
111
+ events: PullEvent[];
112
+ next_cursor?: string;
113
+ size?: number;
114
+ }
115
+
110
116
  export interface HealthCheck {
111
117
  status?: string;
112
118
  timestamp?: string;
@@ -285,6 +291,13 @@ export interface ProjectRunDisplay {
285
291
  normalize?: boolean;
286
292
  }
287
293
 
294
+ export interface PullEvent {
295
+ event_id: string;
296
+ photo_id: number;
297
+ target: string;
298
+ completed_at: string;
299
+ }
300
+
288
301
  export interface SearchDisplay {
289
302
  id: number;
290
303
  project_table_name: string;
@@ -305,6 +318,24 @@ export interface SearchDisplay {
305
318
  curated_album_id?: number;
306
319
  }
307
320
 
321
+ export interface SubscriptionActivated {
322
+ subscription_id: string;
323
+ status: string;
324
+ signing_secret: string;
325
+ }
326
+
327
+ export interface SubscriptionDisplay {
328
+ id: string;
329
+ project_table_name: string;
330
+ callback_url: string;
331
+ targets: string[];
332
+ status: string;
333
+ consecutive_failures: number;
334
+ last_delivery_at?: string;
335
+ last_status_code?: number;
336
+ created_at: string;
337
+ }
338
+
308
339
  export interface UserDisplay {
309
340
  id: number;
310
341
  company_id: number;
@@ -407,6 +438,7 @@ export class OauthLogin {
407
438
 
408
439
  export class Person {
409
440
  updatePerson(projectTableName: string, personId: string, options?: { personName?: string | string[] }): Promise<any>;
441
+ removePersonName(projectTableName: string, personId: string): Promise<PhotoPersonLight>;
410
442
  combinePersons(projectTableName: string, destinationPersonId: string, oldPersonId: string): Promise<PhotoPersonLight>;
411
443
  splitPersons(projectTableName: string, id: number, options?: { newName?: string | string[], destinationPersonId?: string | string[] }): Promise<PhotoPersonLight>;
412
444
  getAllPersonsFromProject(projectTableName: string): Promise<PhotoPersonWithS3Link[]>;
@@ -457,13 +489,23 @@ export class Search {
457
489
  searchProjectPhotos(projectTableName: string, options?: { andParams?: any, andStringParams?: any, orParams?: any, orStringParams?: any, notParams?: any, notStringParams?: any, dateMin?: string | string[], dateMax?: string | string[], dateNullAnd?: boolean | boolean[], dateNullOr?: boolean | boolean[], dateOrder?: string | string[], customAlbumId?: number | number[], bestOfSimilarSetsOnly?: boolean | boolean[], curatedAlbumId?: number | number[], splitByTier?: boolean | boolean[] }): Promise<Record<string, any>>;
458
490
  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>>;
459
491
  recallProjectPhotos(projectTableName: string, options?: { ascOrDesc?: string | string[], bestOfSimilarSetsOnly?: boolean | boolean[], lastId?: number | number[], limit?: number | number[] }): Promise<any>;
460
- 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>>;
492
+ searchProjectPhotosNaturalLanguage(projectTableName: string, searchText: string, options?: { minCosine?: number | number[], labelMinCosine?: number | number[], labelTopK?: number | number[], labelDelta?: number | number[], bestOfSimilarSetsOnly?: boolean | boolean[], splitByTier?: boolean | boolean[] }): Promise<Record<string, any>>;
461
493
  getProjectSavedSearches(projectTableName: string): Promise<any>;
462
494
  getSavedSearchById(searchId: number): Promise<SearchDisplay>;
463
495
  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>>;
464
496
  deleteSavedSearchById(searchId: number): Promise<Record<string, any>>;
465
497
  }
466
498
 
499
+ export class Subscription {
500
+ createSubscription(projectTableName: string, callbackUrl: string, targets: string[]): Promise<any>;
501
+ verifySubscription(subscriptionId: string): Promise<any>;
502
+ listSubscriptions(): Promise<SubscriptionDisplay[]>;
503
+ listSubscriptionEvents(subscriptionId: string, options?: { since?: string | string[], limit?: number | number[] }): Promise<EventPage>;
504
+ updateSubscription(subscriptionId: string, body?: { callbackUrl?: string, targets?: string[] }): Promise<SubscriptionDisplay>;
505
+ deleteSubscription(subscriptionId: string): Promise<Record<string, any>>;
506
+ rotateSubscriptionSecret(subscriptionId: string): Promise<SubscriptionActivated>;
507
+ }
508
+
467
509
  export class Users {
468
510
  createUser(name: string, email: string, accountType: number, companyId?: number, profilePicture?: string, paymentPlanType?: string): Promise<UserDisplay>;
469
511
  createUserAndCompany(name: string, email: string, password: string, companyId?: number, profilePicture?: string, paymentPlanType?: string, companyName?: string, credits?: number, options?: { inviteToken?: string | string[] }): Promise<UserDisplay>;
@@ -499,6 +541,7 @@ export class MediaViz {
499
541
  readonly photos: Photos;
500
542
  readonly projects: Projects;
501
543
  readonly search: Search;
544
+ readonly subscription: Subscription;
502
545
  readonly users: Users;
503
546
  }
504
547
 
package/dist/sdk.d.ts CHANGED
@@ -107,6 +107,12 @@ export interface CuratedAlbumDisplay {
107
107
  confidence_value?: number;
108
108
  }
109
109
 
110
+ export interface EventPage {
111
+ events: PullEvent[];
112
+ next_cursor?: string;
113
+ size?: number;
114
+ }
115
+
110
116
  export interface HealthCheck {
111
117
  status?: string;
112
118
  timestamp?: string;
@@ -285,6 +291,13 @@ export interface ProjectRunDisplay {
285
291
  normalize?: boolean;
286
292
  }
287
293
 
294
+ export interface PullEvent {
295
+ event_id: string;
296
+ photo_id: number;
297
+ target: string;
298
+ completed_at: string;
299
+ }
300
+
288
301
  export interface SearchDisplay {
289
302
  id: number;
290
303
  project_table_name: string;
@@ -305,6 +318,24 @@ export interface SearchDisplay {
305
318
  curated_album_id?: number;
306
319
  }
307
320
 
321
+ export interface SubscriptionActivated {
322
+ subscription_id: string;
323
+ status: string;
324
+ signing_secret: string;
325
+ }
326
+
327
+ export interface SubscriptionDisplay {
328
+ id: string;
329
+ project_table_name: string;
330
+ callback_url: string;
331
+ targets: string[];
332
+ status: string;
333
+ consecutive_failures: number;
334
+ last_delivery_at?: string;
335
+ last_status_code?: number;
336
+ created_at: string;
337
+ }
338
+
308
339
  export interface UserDisplay {
309
340
  id: number;
310
341
  company_id: number;
@@ -407,6 +438,7 @@ export class OauthLogin {
407
438
 
408
439
  export class Person {
409
440
  updatePerson(projectTableName: string, personId: string, options?: { personName?: string | string[] }): Promise<any>;
441
+ removePersonName(projectTableName: string, personId: string): Promise<PhotoPersonLight>;
410
442
  combinePersons(projectTableName: string, destinationPersonId: string, oldPersonId: string): Promise<PhotoPersonLight>;
411
443
  splitPersons(projectTableName: string, id: number, options?: { newName?: string | string[], destinationPersonId?: string | string[] }): Promise<PhotoPersonLight>;
412
444
  getAllPersonsFromProject(projectTableName: string): Promise<PhotoPersonWithS3Link[]>;
@@ -457,13 +489,23 @@ export class Search {
457
489
  searchProjectPhotos(projectTableName: string, options?: { andParams?: any, andStringParams?: any, orParams?: any, orStringParams?: any, notParams?: any, notStringParams?: any, dateMin?: string | string[], dateMax?: string | string[], dateNullAnd?: boolean | boolean[], dateNullOr?: boolean | boolean[], dateOrder?: string | string[], customAlbumId?: number | number[], bestOfSimilarSetsOnly?: boolean | boolean[], curatedAlbumId?: number | number[], splitByTier?: boolean | boolean[] }): Promise<Record<string, any>>;
458
490
  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>>;
459
491
  recallProjectPhotos(projectTableName: string, options?: { ascOrDesc?: string | string[], bestOfSimilarSetsOnly?: boolean | boolean[], lastId?: number | number[], limit?: number | number[] }): Promise<any>;
460
- 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>>;
492
+ searchProjectPhotosNaturalLanguage(projectTableName: string, searchText: string, options?: { minCosine?: number | number[], labelMinCosine?: number | number[], labelTopK?: number | number[], labelDelta?: number | number[], bestOfSimilarSetsOnly?: boolean | boolean[], splitByTier?: boolean | boolean[] }): Promise<Record<string, any>>;
461
493
  getProjectSavedSearches(projectTableName: string): Promise<any>;
462
494
  getSavedSearchById(searchId: number): Promise<SearchDisplay>;
463
495
  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>>;
464
496
  deleteSavedSearchById(searchId: number): Promise<Record<string, any>>;
465
497
  }
466
498
 
499
+ export class Subscription {
500
+ createSubscription(projectTableName: string, callbackUrl: string, targets: string[]): Promise<any>;
501
+ verifySubscription(subscriptionId: string): Promise<any>;
502
+ listSubscriptions(): Promise<SubscriptionDisplay[]>;
503
+ listSubscriptionEvents(subscriptionId: string, options?: { since?: string | string[], limit?: number | number[] }): Promise<EventPage>;
504
+ updateSubscription(subscriptionId: string, body?: { callbackUrl?: string, targets?: string[] }): Promise<SubscriptionDisplay>;
505
+ deleteSubscription(subscriptionId: string): Promise<Record<string, any>>;
506
+ rotateSubscriptionSecret(subscriptionId: string): Promise<SubscriptionActivated>;
507
+ }
508
+
467
509
  export class Users {
468
510
  createUser(name: string, email: string, accountType: number, companyId?: number, profilePicture?: string, paymentPlanType?: string): Promise<UserDisplay>;
469
511
  createUserAndCompany(name: string, email: string, password: string, companyId?: number, profilePicture?: string, paymentPlanType?: string, companyName?: string, credits?: number, options?: { inviteToken?: string | string[] }): Promise<UserDisplay>;
@@ -499,6 +541,7 @@ export class MediaViz {
499
541
  readonly photos: Photos;
500
542
  readonly projects: Projects;
501
543
  readonly search: Search;
544
+ readonly subscription: Subscription;
502
545
  readonly users: Users;
503
546
  }
504
547
 
package/dist/sdk.esm.d.ts CHANGED
@@ -107,6 +107,12 @@ export interface CuratedAlbumDisplay {
107
107
  confidence_value?: number;
108
108
  }
109
109
 
110
+ export interface EventPage {
111
+ events: PullEvent[];
112
+ next_cursor?: string;
113
+ size?: number;
114
+ }
115
+
110
116
  export interface HealthCheck {
111
117
  status?: string;
112
118
  timestamp?: string;
@@ -285,6 +291,13 @@ export interface ProjectRunDisplay {
285
291
  normalize?: boolean;
286
292
  }
287
293
 
294
+ export interface PullEvent {
295
+ event_id: string;
296
+ photo_id: number;
297
+ target: string;
298
+ completed_at: string;
299
+ }
300
+
288
301
  export interface SearchDisplay {
289
302
  id: number;
290
303
  project_table_name: string;
@@ -305,6 +318,24 @@ export interface SearchDisplay {
305
318
  curated_album_id?: number;
306
319
  }
307
320
 
321
+ export interface SubscriptionActivated {
322
+ subscription_id: string;
323
+ status: string;
324
+ signing_secret: string;
325
+ }
326
+
327
+ export interface SubscriptionDisplay {
328
+ id: string;
329
+ project_table_name: string;
330
+ callback_url: string;
331
+ targets: string[];
332
+ status: string;
333
+ consecutive_failures: number;
334
+ last_delivery_at?: string;
335
+ last_status_code?: number;
336
+ created_at: string;
337
+ }
338
+
308
339
  export interface UserDisplay {
309
340
  id: number;
310
341
  company_id: number;
@@ -407,6 +438,7 @@ export class OauthLogin {
407
438
 
408
439
  export class Person {
409
440
  updatePerson(projectTableName: string, personId: string, options?: { personName?: string | string[] }): Promise<any>;
441
+ removePersonName(projectTableName: string, personId: string): Promise<PhotoPersonLight>;
410
442
  combinePersons(projectTableName: string, destinationPersonId: string, oldPersonId: string): Promise<PhotoPersonLight>;
411
443
  splitPersons(projectTableName: string, id: number, options?: { newName?: string | string[], destinationPersonId?: string | string[] }): Promise<PhotoPersonLight>;
412
444
  getAllPersonsFromProject(projectTableName: string): Promise<PhotoPersonWithS3Link[]>;
@@ -457,13 +489,23 @@ export class Search {
457
489
  searchProjectPhotos(projectTableName: string, options?: { andParams?: any, andStringParams?: any, orParams?: any, orStringParams?: any, notParams?: any, notStringParams?: any, dateMin?: string | string[], dateMax?: string | string[], dateNullAnd?: boolean | boolean[], dateNullOr?: boolean | boolean[], dateOrder?: string | string[], customAlbumId?: number | number[], bestOfSimilarSetsOnly?: boolean | boolean[], curatedAlbumId?: number | number[], splitByTier?: boolean | boolean[] }): Promise<Record<string, any>>;
458
490
  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>>;
459
491
  recallProjectPhotos(projectTableName: string, options?: { ascOrDesc?: string | string[], bestOfSimilarSetsOnly?: boolean | boolean[], lastId?: number | number[], limit?: number | number[] }): Promise<any>;
460
- 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>>;
492
+ searchProjectPhotosNaturalLanguage(projectTableName: string, searchText: string, options?: { minCosine?: number | number[], labelMinCosine?: number | number[], labelTopK?: number | number[], labelDelta?: number | number[], bestOfSimilarSetsOnly?: boolean | boolean[], splitByTier?: boolean | boolean[] }): Promise<Record<string, any>>;
461
493
  getProjectSavedSearches(projectTableName: string): Promise<any>;
462
494
  getSavedSearchById(searchId: number): Promise<SearchDisplay>;
463
495
  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>>;
464
496
  deleteSavedSearchById(searchId: number): Promise<Record<string, any>>;
465
497
  }
466
498
 
499
+ export class Subscription {
500
+ createSubscription(projectTableName: string, callbackUrl: string, targets: string[]): Promise<any>;
501
+ verifySubscription(subscriptionId: string): Promise<any>;
502
+ listSubscriptions(): Promise<SubscriptionDisplay[]>;
503
+ listSubscriptionEvents(subscriptionId: string, options?: { since?: string | string[], limit?: number | number[] }): Promise<EventPage>;
504
+ updateSubscription(subscriptionId: string, body?: { callbackUrl?: string, targets?: string[] }): Promise<SubscriptionDisplay>;
505
+ deleteSubscription(subscriptionId: string): Promise<Record<string, any>>;
506
+ rotateSubscriptionSecret(subscriptionId: string): Promise<SubscriptionActivated>;
507
+ }
508
+
467
509
  export class Users {
468
510
  createUser(name: string, email: string, accountType: number, companyId?: number, profilePicture?: string, paymentPlanType?: string): Promise<UserDisplay>;
469
511
  createUserAndCompany(name: string, email: string, password: string, companyId?: number, profilePicture?: string, paymentPlanType?: string, companyName?: string, credits?: number, options?: { inviteToken?: string | string[] }): Promise<UserDisplay>;
@@ -499,6 +541,7 @@ export class MediaViz {
499
541
  readonly photos: Photos;
500
542
  readonly projects: Projects;
501
543
  readonly search: Search;
544
+ readonly subscription: Subscription;
502
545
  readonly users: Users;
503
546
  }
504
547
 
package/dist/sdk.esm.js CHANGED
@@ -525,7 +525,7 @@ class Company {
525
525
  }
526
526
  }
527
527
 
528
- function stripUndef$6(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
528
+ function stripUndef$7(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
529
529
 
530
530
  class CuratedAlbums {
531
531
  constructor(ctx) { this._ctx = ctx; }
@@ -533,7 +533,7 @@ class CuratedAlbums {
533
533
  async createCuratedAlbum(projectTableName, name, description = undefined, confidenceValue = undefined) {
534
534
  this._ctx.requireTokens();
535
535
  const path = `/api/v1/curated_album/project/${encodeURIComponent(projectTableName)}`;
536
- const body = stripUndef$6({
536
+ const body = stripUndef$7({
537
537
  name: name,
538
538
  description: description,
539
539
  confidence_value: confidenceValue,
@@ -587,7 +587,7 @@ class CuratedAlbums {
587
587
  async updateCuratedAlbum(albumId, { name, description, confidenceValue } = {}) {
588
588
  this._ctx.requireTokens();
589
589
  const path = `/api/v1/curated_album/${encodeURIComponent(albumId)}`;
590
- const body = stripUndef$6({
590
+ const body = stripUndef$7({
591
591
  name: name,
592
592
  description: description,
593
593
  confidence_value: confidenceValue,
@@ -611,7 +611,7 @@ class CuratedAlbums {
611
611
  }
612
612
  }
613
613
 
614
- function stripUndef$5(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
614
+ function stripUndef$6(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
615
615
 
616
616
  class CustomAlbums {
617
617
  constructor(ctx) { this._ctx = ctx; }
@@ -659,7 +659,7 @@ class CustomAlbums {
659
659
  async createProjectCustomAlbum(projectTableName, { name, description, photoIdInclusionList, photoIdRemovalList } = {}) {
660
660
  this._ctx.requireTokens();
661
661
  const path = `/api/v1/custom_album/project/${encodeURIComponent(projectTableName)}`;
662
- const body = stripUndef$5({
662
+ const body = stripUndef$6({
663
663
  name: name,
664
664
  description: description,
665
665
  photo_id_inclusion_list: photoIdInclusionList,
@@ -672,7 +672,7 @@ class CustomAlbums {
672
672
  async updateCustomAlbum(albumId, { name, description, photoIdInclusionList, photoIdRemovalList } = {}) {
673
673
  this._ctx.requireTokens();
674
674
  const path = `/api/v1/custom_album/${encodeURIComponent(albumId)}`;
675
- const body = stripUndef$5({
675
+ const body = stripUndef$6({
676
676
  name: name,
677
677
  description: description,
678
678
  photo_id_inclusion_list: photoIdInclusionList,
@@ -772,7 +772,7 @@ async function handleResponse(response) {
772
772
  }
773
773
  }
774
774
 
775
- function stripUndef$4(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
775
+ function stripUndef$5(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
776
776
 
777
777
  class EmailTokens {
778
778
  constructor(ctx) { this._ctx = ctx; }
@@ -803,7 +803,7 @@ class EmailTokens {
803
803
  }
804
804
 
805
805
  async validateToken(token) {
806
- const body = stripUndef$4({
806
+ const body = stripUndef$5({
807
807
  token: token,
808
808
  });
809
809
  const resp = await fetch(this._ctx.baseUrl + `/api/v1/validate-token`, {
@@ -815,7 +815,7 @@ class EmailTokens {
815
815
  }
816
816
 
817
817
  async resetPassword(token, newPassword) {
818
- const body = stripUndef$4({
818
+ const body = stripUndef$5({
819
819
  token: token,
820
820
  new_password: newPassword,
821
821
  });
@@ -854,7 +854,7 @@ class Health {
854
854
  }
855
855
  }
856
856
 
857
- function stripUndef$3(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
857
+ function stripUndef$4(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
858
858
 
859
859
  class Keywords {
860
860
  constructor(ctx) { this._ctx = ctx; }
@@ -862,7 +862,7 @@ class Keywords {
862
862
  async createKeywordFilteringList(name, projectList = undefined) {
863
863
  this._ctx.requireTokens();
864
864
  const path = `/api/v1/keyword/`;
865
- const body = stripUndef$3({
865
+ const body = stripUndef$4({
866
866
  name: name,
867
867
  project_list: projectList,
868
868
  });
@@ -915,7 +915,7 @@ class Keywords {
915
915
  async updateKeywordFilteringListLabels(keywordListId, listKeywordsToInclude, listKeywordsToExclude) {
916
916
  this._ctx.requireTokens();
917
917
  const path = `/api/v1/keyword/${encodeURIComponent(keywordListId)}`;
918
- const body = stripUndef$3({
918
+ const body = stripUndef$4({
919
919
  list_keywords_to_include: listKeywordsToInclude,
920
920
  list_keywords_to_exclude: listKeywordsToExclude,
921
921
  });
@@ -926,7 +926,7 @@ class Keywords {
926
926
  async updateKeywordFilteringListDetails(keywordListId, { name, projectList } = {}) {
927
927
  this._ctx.requireTokens();
928
928
  const path = `/api/v1/keyword/details/${encodeURIComponent(keywordListId)}`;
929
- const body = stripUndef$3({
929
+ const body = stripUndef$4({
930
930
  name: name,
931
931
  project_list: projectList,
932
932
  });
@@ -1125,6 +1125,13 @@ class Person {
1125
1125
  return data;
1126
1126
  }
1127
1127
 
1128
+ async removePersonName(projectTableName, personId) {
1129
+ this._ctx.requireTokens();
1130
+ const path = `/api/v1/person/${encodeURIComponent(projectTableName)}/remove_name/${encodeURIComponent(personId)}`;
1131
+ const { data } = await this._ctx.client.request(path, 'PUT', this._ctx.accessToken, this._ctx.refreshToken);
1132
+ return data;
1133
+ }
1134
+
1128
1135
  async combinePersons(projectTableName, destinationPersonId, oldPersonId) {
1129
1136
  this._ctx.requireTokens();
1130
1137
  const path = `/api/v1/person/${encodeURIComponent(projectTableName)}/combine/${encodeURIComponent(destinationPersonId)}/${encodeURIComponent(oldPersonId)}`;
@@ -1177,7 +1184,7 @@ class Person {
1177
1184
  }
1178
1185
  }
1179
1186
 
1180
- function stripUndef$2(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1187
+ function stripUndef$3(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1181
1188
 
1182
1189
  class Projects {
1183
1190
  constructor(ctx) { this._ctx = ctx; }
@@ -1190,7 +1197,7 @@ class Projects {
1190
1197
  if (models !== undefined) (Array.isArray(models) ? models : [models]).forEach(v => query.append('models', v));
1191
1198
  const qs = query.toString();
1192
1199
  if (qs) path += '?' + qs;
1193
- const body = stripUndef$2({
1200
+ const body = stripUndef$3({
1194
1201
  name: name,
1195
1202
  private: private_,
1196
1203
  type: type,
@@ -1260,7 +1267,7 @@ class Projects {
1260
1267
  async updateProject(projectId, { private: private_, type, description, directory, name, thumbnail } = {}) {
1261
1268
  this._ctx.requireTokens();
1262
1269
  const path = `/api/v1/projects/${encodeURIComponent(projectId)}`;
1263
- const body = stripUndef$2({
1270
+ const body = stripUndef$3({
1264
1271
  private: private_,
1265
1272
  type: type,
1266
1273
  description: description,
@@ -1339,7 +1346,7 @@ class Projects {
1339
1346
  async addProjectEvent(projectTableName, event, detail = undefined) {
1340
1347
  this._ctx.requireTokens();
1341
1348
  const path = `/api/v1/projects/${encodeURIComponent(projectTableName)}/event`;
1342
- const body = stripUndef$2({
1349
+ const body = stripUndef$3({
1343
1350
  event: event,
1344
1351
  detail: detail,
1345
1352
  });
@@ -1483,7 +1490,7 @@ class Photos {
1483
1490
  }
1484
1491
  }
1485
1492
 
1486
- function stripUndef$1(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1493
+ function stripUndef$2(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1487
1494
 
1488
1495
  class Search {
1489
1496
  constructor(ctx) { this._ctx = ctx; }
@@ -1553,7 +1560,7 @@ class Search {
1553
1560
  return data;
1554
1561
  }
1555
1562
 
1556
- async searchProjectPhotosNaturalLanguage(projectTableName, searchText, size = undefined, { minCosine, labelMinCosine, labelTopK, labelDelta, bestOfSimilarSetsOnly, splitByTier } = {}) {
1563
+ async searchProjectPhotosNaturalLanguage(projectTableName, searchText, { minCosine, labelMinCosine, labelTopK, labelDelta, bestOfSimilarSetsOnly, splitByTier } = {}) {
1557
1564
  this._ctx.requireTokens();
1558
1565
  let path = `/api/v1/search/natural_language/${encodeURIComponent(projectTableName)}/`;
1559
1566
  const query = new URLSearchParams();
@@ -1565,9 +1572,8 @@ class Search {
1565
1572
  if (splitByTier !== undefined) (Array.isArray(splitByTier) ? splitByTier : [splitByTier]).forEach(v => query.append('split_by_tier', v));
1566
1573
  const qs = query.toString();
1567
1574
  if (qs) path += '?' + qs;
1568
- const body = stripUndef$1({
1575
+ const body = stripUndef$2({
1569
1576
  search_text: searchText,
1570
- size: size,
1571
1577
  });
1572
1578
  const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken, body);
1573
1579
  return data;
@@ -1621,6 +1627,75 @@ class Search {
1621
1627
  }
1622
1628
  }
1623
1629
 
1630
+ function stripUndef$1(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1631
+
1632
+ class Subscription {
1633
+ constructor(ctx) { this._ctx = ctx; }
1634
+
1635
+ async createSubscription(projectTableName, callbackUrl, targets) {
1636
+ this._ctx.requireTokens();
1637
+ const path = `/api/v1/subscriptions`;
1638
+ const body = stripUndef$1({
1639
+ project_table_name: projectTableName,
1640
+ callback_url: callbackUrl,
1641
+ targets: targets,
1642
+ });
1643
+ const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken, body);
1644
+ return data;
1645
+ }
1646
+
1647
+ async verifySubscription(subscriptionId) {
1648
+ this._ctx.requireTokens();
1649
+ const path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}/verify`;
1650
+ const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken);
1651
+ return data;
1652
+ }
1653
+
1654
+ async listSubscriptions() {
1655
+ this._ctx.requireTokens();
1656
+ const path = `/api/v1/subscriptions`;
1657
+ const { data } = await this._ctx.client.request(path, 'GET', this._ctx.accessToken, this._ctx.refreshToken);
1658
+ return data;
1659
+ }
1660
+
1661
+ async listSubscriptionEvents(subscriptionId, { since, limit } = {}) {
1662
+ this._ctx.requireTokens();
1663
+ let path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}/events`;
1664
+ const query = new URLSearchParams();
1665
+ if (since !== undefined) (Array.isArray(since) ? since : [since]).forEach(v => query.append('since', v));
1666
+ if (limit !== undefined) (Array.isArray(limit) ? limit : [limit]).forEach(v => query.append('limit', v));
1667
+ const qs = query.toString();
1668
+ if (qs) path += '?' + qs;
1669
+ const { data } = await this._ctx.client.request(path, 'GET', this._ctx.accessToken, this._ctx.refreshToken);
1670
+ return data;
1671
+ }
1672
+
1673
+ async updateSubscription(subscriptionId, { callbackUrl, targets } = {}) {
1674
+ this._ctx.requireTokens();
1675
+ const path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}`;
1676
+ const body = stripUndef$1({
1677
+ callback_url: callbackUrl,
1678
+ targets: targets,
1679
+ });
1680
+ const { data } = await this._ctx.client.request(path, 'PATCH', this._ctx.accessToken, this._ctx.refreshToken, body);
1681
+ return data;
1682
+ }
1683
+
1684
+ async deleteSubscription(subscriptionId) {
1685
+ this._ctx.requireTokens();
1686
+ const path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}`;
1687
+ const { data } = await this._ctx.client.request(path, 'DELETE', this._ctx.accessToken, this._ctx.refreshToken);
1688
+ return data;
1689
+ }
1690
+
1691
+ async rotateSubscriptionSecret(subscriptionId) {
1692
+ this._ctx.requireTokens();
1693
+ const path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}/rotate_secret`;
1694
+ const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken);
1695
+ return data;
1696
+ }
1697
+ }
1698
+
1624
1699
  function stripUndef(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1625
1700
 
1626
1701
  class Users {
@@ -1804,6 +1879,7 @@ class MediaViz {
1804
1879
  this.photos = new Photos(_ctx);
1805
1880
  this.projects = new Projects(_ctx);
1806
1881
  this.search = new Search(_ctx);
1882
+ this.subscription = new Subscription(_ctx);
1807
1883
  this.users = new Users(_ctx);
1808
1884
  }
1809
1885
 
@@ -1834,4 +1910,4 @@ class MediaViz {
1834
1910
  get refreshToken() { return this._refreshToken; }
1835
1911
  }
1836
1912
 
1837
- export { Admin, AiModelCredits, ApiError, Company, CuratedAlbums, CustomAlbums, EmailTokens, Health, Keywords, MediaViz, NotFoundError, OAuthClient, OAuthError, OAuthErrorCode, OauthAuthorization, OauthLogin, OauthToken, Person, Photos, Photoupload, Projects, RateLimitError, Search, ServerError, Users, ValidationError, handleResponse };
1913
+ export { Admin, AiModelCredits, ApiError, Company, CuratedAlbums, CustomAlbums, EmailTokens, Health, Keywords, MediaViz, NotFoundError, OAuthClient, OAuthError, OAuthErrorCode, OauthAuthorization, OauthLogin, OauthToken, Person, Photos, Photoupload, Projects, RateLimitError, Search, ServerError, Subscription, Users, ValidationError, handleResponse };
package/dist/sdk.umd.js CHANGED
@@ -531,7 +531,7 @@
531
531
  }
532
532
  }
533
533
 
534
- function stripUndef$6(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
534
+ function stripUndef$7(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
535
535
 
536
536
  class CuratedAlbums {
537
537
  constructor(ctx) { this._ctx = ctx; }
@@ -539,7 +539,7 @@
539
539
  async createCuratedAlbum(projectTableName, name, description = undefined, confidenceValue = undefined) {
540
540
  this._ctx.requireTokens();
541
541
  const path = `/api/v1/curated_album/project/${encodeURIComponent(projectTableName)}`;
542
- const body = stripUndef$6({
542
+ const body = stripUndef$7({
543
543
  name: name,
544
544
  description: description,
545
545
  confidence_value: confidenceValue,
@@ -593,7 +593,7 @@
593
593
  async updateCuratedAlbum(albumId, { name, description, confidenceValue } = {}) {
594
594
  this._ctx.requireTokens();
595
595
  const path = `/api/v1/curated_album/${encodeURIComponent(albumId)}`;
596
- const body = stripUndef$6({
596
+ const body = stripUndef$7({
597
597
  name: name,
598
598
  description: description,
599
599
  confidence_value: confidenceValue,
@@ -617,7 +617,7 @@
617
617
  }
618
618
  }
619
619
 
620
- function stripUndef$5(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
620
+ function stripUndef$6(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
621
621
 
622
622
  class CustomAlbums {
623
623
  constructor(ctx) { this._ctx = ctx; }
@@ -665,7 +665,7 @@
665
665
  async createProjectCustomAlbum(projectTableName, { name, description, photoIdInclusionList, photoIdRemovalList } = {}) {
666
666
  this._ctx.requireTokens();
667
667
  const path = `/api/v1/custom_album/project/${encodeURIComponent(projectTableName)}`;
668
- const body = stripUndef$5({
668
+ const body = stripUndef$6({
669
669
  name: name,
670
670
  description: description,
671
671
  photo_id_inclusion_list: photoIdInclusionList,
@@ -678,7 +678,7 @@
678
678
  async updateCustomAlbum(albumId, { name, description, photoIdInclusionList, photoIdRemovalList } = {}) {
679
679
  this._ctx.requireTokens();
680
680
  const path = `/api/v1/custom_album/${encodeURIComponent(albumId)}`;
681
- const body = stripUndef$5({
681
+ const body = stripUndef$6({
682
682
  name: name,
683
683
  description: description,
684
684
  photo_id_inclusion_list: photoIdInclusionList,
@@ -778,7 +778,7 @@
778
778
  }
779
779
  }
780
780
 
781
- function stripUndef$4(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
781
+ function stripUndef$5(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
782
782
 
783
783
  class EmailTokens {
784
784
  constructor(ctx) { this._ctx = ctx; }
@@ -809,7 +809,7 @@
809
809
  }
810
810
 
811
811
  async validateToken(token) {
812
- const body = stripUndef$4({
812
+ const body = stripUndef$5({
813
813
  token: token,
814
814
  });
815
815
  const resp = await fetch(this._ctx.baseUrl + `/api/v1/validate-token`, {
@@ -821,7 +821,7 @@
821
821
  }
822
822
 
823
823
  async resetPassword(token, newPassword) {
824
- const body = stripUndef$4({
824
+ const body = stripUndef$5({
825
825
  token: token,
826
826
  new_password: newPassword,
827
827
  });
@@ -860,7 +860,7 @@
860
860
  }
861
861
  }
862
862
 
863
- function stripUndef$3(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
863
+ function stripUndef$4(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
864
864
 
865
865
  class Keywords {
866
866
  constructor(ctx) { this._ctx = ctx; }
@@ -868,7 +868,7 @@
868
868
  async createKeywordFilteringList(name, projectList = undefined) {
869
869
  this._ctx.requireTokens();
870
870
  const path = `/api/v1/keyword/`;
871
- const body = stripUndef$3({
871
+ const body = stripUndef$4({
872
872
  name: name,
873
873
  project_list: projectList,
874
874
  });
@@ -921,7 +921,7 @@
921
921
  async updateKeywordFilteringListLabels(keywordListId, listKeywordsToInclude, listKeywordsToExclude) {
922
922
  this._ctx.requireTokens();
923
923
  const path = `/api/v1/keyword/${encodeURIComponent(keywordListId)}`;
924
- const body = stripUndef$3({
924
+ const body = stripUndef$4({
925
925
  list_keywords_to_include: listKeywordsToInclude,
926
926
  list_keywords_to_exclude: listKeywordsToExclude,
927
927
  });
@@ -932,7 +932,7 @@
932
932
  async updateKeywordFilteringListDetails(keywordListId, { name, projectList } = {}) {
933
933
  this._ctx.requireTokens();
934
934
  const path = `/api/v1/keyword/details/${encodeURIComponent(keywordListId)}`;
935
- const body = stripUndef$3({
935
+ const body = stripUndef$4({
936
936
  name: name,
937
937
  project_list: projectList,
938
938
  });
@@ -1131,6 +1131,13 @@
1131
1131
  return data;
1132
1132
  }
1133
1133
 
1134
+ async removePersonName(projectTableName, personId) {
1135
+ this._ctx.requireTokens();
1136
+ const path = `/api/v1/person/${encodeURIComponent(projectTableName)}/remove_name/${encodeURIComponent(personId)}`;
1137
+ const { data } = await this._ctx.client.request(path, 'PUT', this._ctx.accessToken, this._ctx.refreshToken);
1138
+ return data;
1139
+ }
1140
+
1134
1141
  async combinePersons(projectTableName, destinationPersonId, oldPersonId) {
1135
1142
  this._ctx.requireTokens();
1136
1143
  const path = `/api/v1/person/${encodeURIComponent(projectTableName)}/combine/${encodeURIComponent(destinationPersonId)}/${encodeURIComponent(oldPersonId)}`;
@@ -1183,7 +1190,7 @@
1183
1190
  }
1184
1191
  }
1185
1192
 
1186
- function stripUndef$2(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1193
+ function stripUndef$3(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1187
1194
 
1188
1195
  class Projects {
1189
1196
  constructor(ctx) { this._ctx = ctx; }
@@ -1196,7 +1203,7 @@
1196
1203
  if (models !== undefined) (Array.isArray(models) ? models : [models]).forEach(v => query.append('models', v));
1197
1204
  const qs = query.toString();
1198
1205
  if (qs) path += '?' + qs;
1199
- const body = stripUndef$2({
1206
+ const body = stripUndef$3({
1200
1207
  name: name,
1201
1208
  private: private_,
1202
1209
  type: type,
@@ -1266,7 +1273,7 @@
1266
1273
  async updateProject(projectId, { private: private_, type, description, directory, name, thumbnail } = {}) {
1267
1274
  this._ctx.requireTokens();
1268
1275
  const path = `/api/v1/projects/${encodeURIComponent(projectId)}`;
1269
- const body = stripUndef$2({
1276
+ const body = stripUndef$3({
1270
1277
  private: private_,
1271
1278
  type: type,
1272
1279
  description: description,
@@ -1345,7 +1352,7 @@
1345
1352
  async addProjectEvent(projectTableName, event, detail = undefined) {
1346
1353
  this._ctx.requireTokens();
1347
1354
  const path = `/api/v1/projects/${encodeURIComponent(projectTableName)}/event`;
1348
- const body = stripUndef$2({
1355
+ const body = stripUndef$3({
1349
1356
  event: event,
1350
1357
  detail: detail,
1351
1358
  });
@@ -1489,7 +1496,7 @@
1489
1496
  }
1490
1497
  }
1491
1498
 
1492
- function stripUndef$1(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1499
+ function stripUndef$2(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1493
1500
 
1494
1501
  class Search {
1495
1502
  constructor(ctx) { this._ctx = ctx; }
@@ -1559,7 +1566,7 @@
1559
1566
  return data;
1560
1567
  }
1561
1568
 
1562
- async searchProjectPhotosNaturalLanguage(projectTableName, searchText, size = undefined, { minCosine, labelMinCosine, labelTopK, labelDelta, bestOfSimilarSetsOnly, splitByTier } = {}) {
1569
+ async searchProjectPhotosNaturalLanguage(projectTableName, searchText, { minCosine, labelMinCosine, labelTopK, labelDelta, bestOfSimilarSetsOnly, splitByTier } = {}) {
1563
1570
  this._ctx.requireTokens();
1564
1571
  let path = `/api/v1/search/natural_language/${encodeURIComponent(projectTableName)}/`;
1565
1572
  const query = new URLSearchParams();
@@ -1571,9 +1578,8 @@
1571
1578
  if (splitByTier !== undefined) (Array.isArray(splitByTier) ? splitByTier : [splitByTier]).forEach(v => query.append('split_by_tier', v));
1572
1579
  const qs = query.toString();
1573
1580
  if (qs) path += '?' + qs;
1574
- const body = stripUndef$1({
1581
+ const body = stripUndef$2({
1575
1582
  search_text: searchText,
1576
- size: size,
1577
1583
  });
1578
1584
  const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken, body);
1579
1585
  return data;
@@ -1627,6 +1633,75 @@
1627
1633
  }
1628
1634
  }
1629
1635
 
1636
+ function stripUndef$1(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1637
+
1638
+ class Subscription {
1639
+ constructor(ctx) { this._ctx = ctx; }
1640
+
1641
+ async createSubscription(projectTableName, callbackUrl, targets) {
1642
+ this._ctx.requireTokens();
1643
+ const path = `/api/v1/subscriptions`;
1644
+ const body = stripUndef$1({
1645
+ project_table_name: projectTableName,
1646
+ callback_url: callbackUrl,
1647
+ targets: targets,
1648
+ });
1649
+ const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken, body);
1650
+ return data;
1651
+ }
1652
+
1653
+ async verifySubscription(subscriptionId) {
1654
+ this._ctx.requireTokens();
1655
+ const path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}/verify`;
1656
+ const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken);
1657
+ return data;
1658
+ }
1659
+
1660
+ async listSubscriptions() {
1661
+ this._ctx.requireTokens();
1662
+ const path = `/api/v1/subscriptions`;
1663
+ const { data } = await this._ctx.client.request(path, 'GET', this._ctx.accessToken, this._ctx.refreshToken);
1664
+ return data;
1665
+ }
1666
+
1667
+ async listSubscriptionEvents(subscriptionId, { since, limit } = {}) {
1668
+ this._ctx.requireTokens();
1669
+ let path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}/events`;
1670
+ const query = new URLSearchParams();
1671
+ if (since !== undefined) (Array.isArray(since) ? since : [since]).forEach(v => query.append('since', v));
1672
+ if (limit !== undefined) (Array.isArray(limit) ? limit : [limit]).forEach(v => query.append('limit', v));
1673
+ const qs = query.toString();
1674
+ if (qs) path += '?' + qs;
1675
+ const { data } = await this._ctx.client.request(path, 'GET', this._ctx.accessToken, this._ctx.refreshToken);
1676
+ return data;
1677
+ }
1678
+
1679
+ async updateSubscription(subscriptionId, { callbackUrl, targets } = {}) {
1680
+ this._ctx.requireTokens();
1681
+ const path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}`;
1682
+ const body = stripUndef$1({
1683
+ callback_url: callbackUrl,
1684
+ targets: targets,
1685
+ });
1686
+ const { data } = await this._ctx.client.request(path, 'PATCH', this._ctx.accessToken, this._ctx.refreshToken, body);
1687
+ return data;
1688
+ }
1689
+
1690
+ async deleteSubscription(subscriptionId) {
1691
+ this._ctx.requireTokens();
1692
+ const path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}`;
1693
+ const { data } = await this._ctx.client.request(path, 'DELETE', this._ctx.accessToken, this._ctx.refreshToken);
1694
+ return data;
1695
+ }
1696
+
1697
+ async rotateSubscriptionSecret(subscriptionId) {
1698
+ this._ctx.requireTokens();
1699
+ const path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}/rotate_secret`;
1700
+ const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken);
1701
+ return data;
1702
+ }
1703
+ }
1704
+
1630
1705
  function stripUndef(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1631
1706
 
1632
1707
  class Users {
@@ -1810,6 +1885,7 @@
1810
1885
  this.photos = new Photos(_ctx);
1811
1886
  this.projects = new Projects(_ctx);
1812
1887
  this.search = new Search(_ctx);
1888
+ this.subscription = new Subscription(_ctx);
1813
1889
  this.users = new Users(_ctx);
1814
1890
  }
1815
1891
 
@@ -1864,6 +1940,7 @@
1864
1940
  exports.RateLimitError = RateLimitError;
1865
1941
  exports.Search = Search;
1866
1942
  exports.ServerError = ServerError;
1943
+ exports.Subscription = Subscription;
1867
1944
  exports.Users = Users;
1868
1945
  exports.ValidationError = ValidationError;
1869
1946
  exports.handleResponse = handleResponse;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediaviz/sdk",
3
- "version": "1.6.0-rc.3",
3
+ "version": "1.8.0-dev.90",
4
4
  "description": "MediaViz JavaScript SDK \u2014 auto-generated public endpoint client.",
5
5
  "license": "MIT",
6
6
  "repository": {