@mediaviz/sdk 1.7.0 → 1.8.0-dev.91

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
@@ -504,6 +504,8 @@ class Admin {
504
504
  }
505
505
  }
506
506
 
507
+ function stripUndef$8(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
508
+
507
509
  class Company {
508
510
  constructor(ctx) { this._ctx = ctx; }
509
511
 
@@ -525,9 +527,19 @@ class Company {
525
527
  const { data } = await this._ctx.client.request(path, 'GET', this._ctx.accessToken, this._ctx.refreshToken);
526
528
  return data;
527
529
  }
530
+
531
+ async updateCompanyPhotoUrlAllowlist(companyId, photoUrlAllowlist) {
532
+ this._ctx.requireTokens();
533
+ const path = `/api/v1/company/${encodeURIComponent(companyId)}/photo_url_allowlist/`;
534
+ const body = stripUndef$8({
535
+ photo_url_allowlist: photoUrlAllowlist,
536
+ });
537
+ const { data } = await this._ctx.client.request(path, 'PUT', this._ctx.accessToken, this._ctx.refreshToken, body);
538
+ return data;
539
+ }
528
540
  }
529
541
 
530
- function stripUndef$6(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
542
+ function stripUndef$7(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
531
543
 
532
544
  class CuratedAlbums {
533
545
  constructor(ctx) { this._ctx = ctx; }
@@ -535,7 +547,7 @@ class CuratedAlbums {
535
547
  async createCuratedAlbum(projectTableName, name, description = undefined, confidenceValue = undefined) {
536
548
  this._ctx.requireTokens();
537
549
  const path = `/api/v1/curated_album/project/${encodeURIComponent(projectTableName)}`;
538
- const body = stripUndef$6({
550
+ const body = stripUndef$7({
539
551
  name: name,
540
552
  description: description,
541
553
  confidence_value: confidenceValue,
@@ -589,7 +601,7 @@ class CuratedAlbums {
589
601
  async updateCuratedAlbum(albumId, { name, description, confidenceValue } = {}) {
590
602
  this._ctx.requireTokens();
591
603
  const path = `/api/v1/curated_album/${encodeURIComponent(albumId)}`;
592
- const body = stripUndef$6({
604
+ const body = stripUndef$7({
593
605
  name: name,
594
606
  description: description,
595
607
  confidence_value: confidenceValue,
@@ -613,7 +625,7 @@ class CuratedAlbums {
613
625
  }
614
626
  }
615
627
 
616
- function stripUndef$5(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
628
+ function stripUndef$6(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
617
629
 
618
630
  class CustomAlbums {
619
631
  constructor(ctx) { this._ctx = ctx; }
@@ -661,7 +673,7 @@ class CustomAlbums {
661
673
  async createProjectCustomAlbum(projectTableName, { name, description, photoIdInclusionList, photoIdRemovalList } = {}) {
662
674
  this._ctx.requireTokens();
663
675
  const path = `/api/v1/custom_album/project/${encodeURIComponent(projectTableName)}`;
664
- const body = stripUndef$5({
676
+ const body = stripUndef$6({
665
677
  name: name,
666
678
  description: description,
667
679
  photo_id_inclusion_list: photoIdInclusionList,
@@ -674,7 +686,7 @@ class CustomAlbums {
674
686
  async updateCustomAlbum(albumId, { name, description, photoIdInclusionList, photoIdRemovalList } = {}) {
675
687
  this._ctx.requireTokens();
676
688
  const path = `/api/v1/custom_album/${encodeURIComponent(albumId)}`;
677
- const body = stripUndef$5({
689
+ const body = stripUndef$6({
678
690
  name: name,
679
691
  description: description,
680
692
  photo_id_inclusion_list: photoIdInclusionList,
@@ -774,7 +786,7 @@ async function handleResponse(response) {
774
786
  }
775
787
  }
776
788
 
777
- function stripUndef$4(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
789
+ function stripUndef$5(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
778
790
 
779
791
  class EmailTokens {
780
792
  constructor(ctx) { this._ctx = ctx; }
@@ -805,7 +817,7 @@ class EmailTokens {
805
817
  }
806
818
 
807
819
  async validateToken(token) {
808
- const body = stripUndef$4({
820
+ const body = stripUndef$5({
809
821
  token: token,
810
822
  });
811
823
  const resp = await fetch(this._ctx.baseUrl + `/api/v1/validate-token`, {
@@ -817,7 +829,7 @@ class EmailTokens {
817
829
  }
818
830
 
819
831
  async resetPassword(token, newPassword) {
820
- const body = stripUndef$4({
832
+ const body = stripUndef$5({
821
833
  token: token,
822
834
  new_password: newPassword,
823
835
  });
@@ -856,7 +868,7 @@ class Health {
856
868
  }
857
869
  }
858
870
 
859
- function stripUndef$3(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
871
+ function stripUndef$4(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
860
872
 
861
873
  class Keywords {
862
874
  constructor(ctx) { this._ctx = ctx; }
@@ -864,7 +876,7 @@ class Keywords {
864
876
  async createKeywordFilteringList(name, projectList = undefined) {
865
877
  this._ctx.requireTokens();
866
878
  const path = `/api/v1/keyword/`;
867
- const body = stripUndef$3({
879
+ const body = stripUndef$4({
868
880
  name: name,
869
881
  project_list: projectList,
870
882
  });
@@ -917,7 +929,7 @@ class Keywords {
917
929
  async updateKeywordFilteringListLabels(keywordListId, listKeywordsToInclude, listKeywordsToExclude) {
918
930
  this._ctx.requireTokens();
919
931
  const path = `/api/v1/keyword/${encodeURIComponent(keywordListId)}`;
920
- const body = stripUndef$3({
932
+ const body = stripUndef$4({
921
933
  list_keywords_to_include: listKeywordsToInclude,
922
934
  list_keywords_to_exclude: listKeywordsToExclude,
923
935
  });
@@ -928,7 +940,7 @@ class Keywords {
928
940
  async updateKeywordFilteringListDetails(keywordListId, { name, projectList } = {}) {
929
941
  this._ctx.requireTokens();
930
942
  const path = `/api/v1/keyword/details/${encodeURIComponent(keywordListId)}`;
931
- const body = stripUndef$3({
943
+ const body = stripUndef$4({
932
944
  name: name,
933
945
  project_list: projectList,
934
946
  });
@@ -1127,6 +1139,13 @@ class Person {
1127
1139
  return data;
1128
1140
  }
1129
1141
 
1142
+ async removePersonName(projectTableName, personId) {
1143
+ this._ctx.requireTokens();
1144
+ const path = `/api/v1/person/${encodeURIComponent(projectTableName)}/remove_name/${encodeURIComponent(personId)}`;
1145
+ const { data } = await this._ctx.client.request(path, 'PUT', this._ctx.accessToken, this._ctx.refreshToken);
1146
+ return data;
1147
+ }
1148
+
1130
1149
  async combinePersons(projectTableName, destinationPersonId, oldPersonId) {
1131
1150
  this._ctx.requireTokens();
1132
1151
  const path = `/api/v1/person/${encodeURIComponent(projectTableName)}/combine/${encodeURIComponent(destinationPersonId)}/${encodeURIComponent(oldPersonId)}`;
@@ -1179,7 +1198,7 @@ class Person {
1179
1198
  }
1180
1199
  }
1181
1200
 
1182
- function stripUndef$2(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1201
+ function stripUndef$3(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1183
1202
 
1184
1203
  class Projects {
1185
1204
  constructor(ctx) { this._ctx = ctx; }
@@ -1192,7 +1211,7 @@ class Projects {
1192
1211
  if (models !== undefined) (Array.isArray(models) ? models : [models]).forEach(v => query.append('models', v));
1193
1212
  const qs = query.toString();
1194
1213
  if (qs) path += '?' + qs;
1195
- const body = stripUndef$2({
1214
+ const body = stripUndef$3({
1196
1215
  name: name,
1197
1216
  private: private_,
1198
1217
  type: type,
@@ -1262,7 +1281,7 @@ class Projects {
1262
1281
  async updateProject(projectId, { private: private_, type, description, directory, name, thumbnail } = {}) {
1263
1282
  this._ctx.requireTokens();
1264
1283
  const path = `/api/v1/projects/${encodeURIComponent(projectId)}`;
1265
- const body = stripUndef$2({
1284
+ const body = stripUndef$3({
1266
1285
  private: private_,
1267
1286
  type: type,
1268
1287
  description: description,
@@ -1341,7 +1360,7 @@ class Projects {
1341
1360
  async addProjectEvent(projectTableName, event, detail = undefined) {
1342
1361
  this._ctx.requireTokens();
1343
1362
  const path = `/api/v1/projects/${encodeURIComponent(projectTableName)}/event`;
1344
- const body = stripUndef$2({
1363
+ const body = stripUndef$3({
1345
1364
  event: event,
1346
1365
  detail: detail,
1347
1366
  });
@@ -1485,7 +1504,7 @@ class Photos {
1485
1504
  }
1486
1505
  }
1487
1506
 
1488
- function stripUndef$1(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1507
+ function stripUndef$2(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1489
1508
 
1490
1509
  class Search {
1491
1510
  constructor(ctx) { this._ctx = ctx; }
@@ -1555,7 +1574,7 @@ class Search {
1555
1574
  return data;
1556
1575
  }
1557
1576
 
1558
- async searchProjectPhotosNaturalLanguage(projectTableName, searchText, size = undefined, { minCosine, labelMinCosine, labelTopK, labelDelta, bestOfSimilarSetsOnly, splitByTier } = {}) {
1577
+ async searchProjectPhotosNaturalLanguage(projectTableName, searchText, { minCosine, labelMinCosine, labelTopK, labelDelta, bestOfSimilarSetsOnly, splitByTier } = {}) {
1559
1578
  this._ctx.requireTokens();
1560
1579
  let path = `/api/v1/search/natural_language/${encodeURIComponent(projectTableName)}/`;
1561
1580
  const query = new URLSearchParams();
@@ -1567,9 +1586,8 @@ class Search {
1567
1586
  if (splitByTier !== undefined) (Array.isArray(splitByTier) ? splitByTier : [splitByTier]).forEach(v => query.append('split_by_tier', v));
1568
1587
  const qs = query.toString();
1569
1588
  if (qs) path += '?' + qs;
1570
- const body = stripUndef$1({
1589
+ const body = stripUndef$2({
1571
1590
  search_text: searchText,
1572
- size: size,
1573
1591
  });
1574
1592
  const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken, body);
1575
1593
  return data;
@@ -1623,6 +1641,75 @@ class Search {
1623
1641
  }
1624
1642
  }
1625
1643
 
1644
+ function stripUndef$1(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1645
+
1646
+ class Subscription {
1647
+ constructor(ctx) { this._ctx = ctx; }
1648
+
1649
+ async createSubscription(projectTableName, callbackUrl, targets) {
1650
+ this._ctx.requireTokens();
1651
+ const path = `/api/v1/subscriptions`;
1652
+ const body = stripUndef$1({
1653
+ project_table_name: projectTableName,
1654
+ callback_url: callbackUrl,
1655
+ targets: targets,
1656
+ });
1657
+ const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken, body);
1658
+ return data;
1659
+ }
1660
+
1661
+ async verifySubscription(subscriptionId) {
1662
+ this._ctx.requireTokens();
1663
+ const path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}/verify`;
1664
+ const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken);
1665
+ return data;
1666
+ }
1667
+
1668
+ async listSubscriptions() {
1669
+ this._ctx.requireTokens();
1670
+ const path = `/api/v1/subscriptions`;
1671
+ const { data } = await this._ctx.client.request(path, 'GET', this._ctx.accessToken, this._ctx.refreshToken);
1672
+ return data;
1673
+ }
1674
+
1675
+ async listSubscriptionEvents(subscriptionId, { since, limit } = {}) {
1676
+ this._ctx.requireTokens();
1677
+ let path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}/events`;
1678
+ const query = new URLSearchParams();
1679
+ if (since !== undefined) (Array.isArray(since) ? since : [since]).forEach(v => query.append('since', v));
1680
+ if (limit !== undefined) (Array.isArray(limit) ? limit : [limit]).forEach(v => query.append('limit', v));
1681
+ const qs = query.toString();
1682
+ if (qs) path += '?' + qs;
1683
+ const { data } = await this._ctx.client.request(path, 'GET', this._ctx.accessToken, this._ctx.refreshToken);
1684
+ return data;
1685
+ }
1686
+
1687
+ async updateSubscription(subscriptionId, { callbackUrl, targets } = {}) {
1688
+ this._ctx.requireTokens();
1689
+ const path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}`;
1690
+ const body = stripUndef$1({
1691
+ callback_url: callbackUrl,
1692
+ targets: targets,
1693
+ });
1694
+ const { data } = await this._ctx.client.request(path, 'PATCH', this._ctx.accessToken, this._ctx.refreshToken, body);
1695
+ return data;
1696
+ }
1697
+
1698
+ async deleteSubscription(subscriptionId) {
1699
+ this._ctx.requireTokens();
1700
+ const path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}`;
1701
+ const { data } = await this._ctx.client.request(path, 'DELETE', this._ctx.accessToken, this._ctx.refreshToken);
1702
+ return data;
1703
+ }
1704
+
1705
+ async rotateSubscriptionSecret(subscriptionId) {
1706
+ this._ctx.requireTokens();
1707
+ const path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}/rotate_secret`;
1708
+ const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken);
1709
+ return data;
1710
+ }
1711
+ }
1712
+
1626
1713
  function stripUndef(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1627
1714
 
1628
1715
  class Users {
@@ -1643,7 +1730,7 @@ class Users {
1643
1730
  return data;
1644
1731
  }
1645
1732
 
1646
- async createUserAndCompany(name, email, password, companyId = undefined, profilePicture = undefined, paymentPlanType = undefined, companyName = undefined, credits = undefined, { inviteToken } = {}) {
1733
+ async createUserAndCompany(name, email, password, companyId = undefined, profilePicture = undefined, paymentPlanType = undefined, companyName = undefined, credits = undefined, photoUrlAllowlist = undefined, { inviteToken } = {}) {
1647
1734
  let path = `/api/v1/users/new_company/`;
1648
1735
  const query = new URLSearchParams();
1649
1736
  if (inviteToken !== undefined) (Array.isArray(inviteToken) ? inviteToken : [inviteToken]).forEach(v => query.append('invite_token', v));
@@ -1658,6 +1745,7 @@ class Users {
1658
1745
  password: password,
1659
1746
  company_name: companyName,
1660
1747
  credits: credits,
1748
+ photo_url_allowlist: photoUrlAllowlist,
1661
1749
  });
1662
1750
  const resp = await fetch(this._ctx.baseUrl + path, {
1663
1751
  method: 'POST',
@@ -1806,6 +1894,7 @@ class MediaViz {
1806
1894
  this.photos = new Photos(_ctx);
1807
1895
  this.projects = new Projects(_ctx);
1808
1896
  this.search = new Search(_ctx);
1897
+ this.subscription = new Subscription(_ctx);
1809
1898
  this.users = new Users(_ctx);
1810
1899
  }
1811
1900
 
@@ -1860,6 +1949,7 @@ exports.Projects = Projects;
1860
1949
  exports.RateLimitError = RateLimitError;
1861
1950
  exports.Search = Search;
1862
1951
  exports.ServerError = ServerError;
1952
+ exports.Subscription = Subscription;
1863
1953
  exports.Users = Users;
1864
1954
  exports.ValidationError = ValidationError;
1865
1955
  exports.handleResponse = handleResponse;
package/dist/sdk.d.cts CHANGED
@@ -82,6 +82,7 @@ export interface CompanyDisplay {
82
82
  users?: number[];
83
83
  active: boolean;
84
84
  payment_plan_type: string;
85
+ photo_url_allowlist?: string[];
85
86
  }
86
87
 
87
88
  export interface CompanyKeywordListOverview {
@@ -107,6 +108,12 @@ export interface CuratedAlbumDisplay {
107
108
  confidence_value?: number;
108
109
  }
109
110
 
111
+ export interface EventPage {
112
+ events: PullEvent[];
113
+ next_cursor?: string;
114
+ size?: number;
115
+ }
116
+
110
117
  export interface HealthCheck {
111
118
  status?: string;
112
119
  timestamp?: string;
@@ -285,6 +292,13 @@ export interface ProjectRunDisplay {
285
292
  normalize?: boolean;
286
293
  }
287
294
 
295
+ export interface PullEvent {
296
+ event_id: string;
297
+ photo_id: number;
298
+ target: string;
299
+ completed_at: string;
300
+ }
301
+
288
302
  export interface SearchDisplay {
289
303
  id: number;
290
304
  project_table_name: string;
@@ -305,6 +319,24 @@ export interface SearchDisplay {
305
319
  curated_album_id?: number;
306
320
  }
307
321
 
322
+ export interface SubscriptionActivated {
323
+ subscription_id: string;
324
+ status: string;
325
+ signing_secret: string;
326
+ }
327
+
328
+ export interface SubscriptionDisplay {
329
+ id: string;
330
+ project_table_name: string;
331
+ callback_url: string;
332
+ targets: string[];
333
+ status: string;
334
+ consecutive_failures: number;
335
+ last_delivery_at?: string;
336
+ last_status_code?: number;
337
+ created_at: string;
338
+ }
339
+
308
340
  export interface UserDisplay {
309
341
  id: number;
310
342
  company_id: number;
@@ -328,6 +360,7 @@ export class Admin {
328
360
  export class Company {
329
361
  getCompanyById(companyId: number): Promise<CompanyDisplay>;
330
362
  confirmCompanyCreditBalance(companyId: number, options?: { photoCount?: number | number[], modelsList?: string[] | string[][] }): Promise<CreditBalanceOutput>;
363
+ updateCompanyPhotoUrlAllowlist(companyId: number, photoUrlAllowlist: string[]): Promise<Record<string, any>>;
331
364
  }
332
365
 
333
366
  export class CuratedAlbums {
@@ -407,6 +440,7 @@ export class OauthLogin {
407
440
 
408
441
  export class Person {
409
442
  updatePerson(projectTableName: string, personId: string, options?: { personName?: string | string[] }): Promise<any>;
443
+ removePersonName(projectTableName: string, personId: string): Promise<PhotoPersonLight>;
410
444
  combinePersons(projectTableName: string, destinationPersonId: string, oldPersonId: string): Promise<PhotoPersonLight>;
411
445
  splitPersons(projectTableName: string, id: number, options?: { newName?: string | string[], destinationPersonId?: string | string[] }): Promise<PhotoPersonLight>;
412
446
  getAllPersonsFromProject(projectTableName: string): Promise<PhotoPersonWithS3Link[]>;
@@ -457,16 +491,26 @@ export class Search {
457
491
  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
492
  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
493
  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>>;
494
+ 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
495
  getProjectSavedSearches(projectTableName: string): Promise<any>;
462
496
  getSavedSearchById(searchId: number): Promise<SearchDisplay>;
463
497
  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
498
  deleteSavedSearchById(searchId: number): Promise<Record<string, any>>;
465
499
  }
466
500
 
501
+ export class Subscription {
502
+ createSubscription(projectTableName: string, callbackUrl: string, targets: string[]): Promise<any>;
503
+ verifySubscription(subscriptionId: string): Promise<any>;
504
+ listSubscriptions(): Promise<SubscriptionDisplay[]>;
505
+ listSubscriptionEvents(subscriptionId: string, options?: { since?: string | string[], limit?: number | number[] }): Promise<EventPage>;
506
+ updateSubscription(subscriptionId: string, body?: { callbackUrl?: string, targets?: string[] }): Promise<SubscriptionDisplay>;
507
+ deleteSubscription(subscriptionId: string): Promise<Record<string, any>>;
508
+ rotateSubscriptionSecret(subscriptionId: string): Promise<SubscriptionActivated>;
509
+ }
510
+
467
511
  export class Users {
468
512
  createUser(name: string, email: string, accountType: number, companyId?: number, profilePicture?: string, paymentPlanType?: string): Promise<UserDisplay>;
469
- createUserAndCompany(name: string, email: string, password: string, companyId?: number, profilePicture?: string, paymentPlanType?: string, companyName?: string, credits?: number, options?: { inviteToken?: string | string[] }): Promise<UserDisplay>;
513
+ createUserAndCompany(name: string, email: string, password: string, companyId?: number, profilePicture?: string, paymentPlanType?: string, companyName?: string, credits?: number, photoUrlAllowlist?: string[], options?: { inviteToken?: string | string[] }): Promise<UserDisplay>;
470
514
  changePassword(oldPassword: string, newPassword: string): Promise<Record<string, any>>;
471
515
  getUserId(): Promise<Record<string, any>>;
472
516
  getUser(userId: number): Promise<UserDisplay>;
@@ -499,6 +543,7 @@ export class MediaViz {
499
543
  readonly photos: Photos;
500
544
  readonly projects: Projects;
501
545
  readonly search: Search;
546
+ readonly subscription: Subscription;
502
547
  readonly users: Users;
503
548
  }
504
549
 
package/dist/sdk.d.ts CHANGED
@@ -82,6 +82,7 @@ export interface CompanyDisplay {
82
82
  users?: number[];
83
83
  active: boolean;
84
84
  payment_plan_type: string;
85
+ photo_url_allowlist?: string[];
85
86
  }
86
87
 
87
88
  export interface CompanyKeywordListOverview {
@@ -107,6 +108,12 @@ export interface CuratedAlbumDisplay {
107
108
  confidence_value?: number;
108
109
  }
109
110
 
111
+ export interface EventPage {
112
+ events: PullEvent[];
113
+ next_cursor?: string;
114
+ size?: number;
115
+ }
116
+
110
117
  export interface HealthCheck {
111
118
  status?: string;
112
119
  timestamp?: string;
@@ -285,6 +292,13 @@ export interface ProjectRunDisplay {
285
292
  normalize?: boolean;
286
293
  }
287
294
 
295
+ export interface PullEvent {
296
+ event_id: string;
297
+ photo_id: number;
298
+ target: string;
299
+ completed_at: string;
300
+ }
301
+
288
302
  export interface SearchDisplay {
289
303
  id: number;
290
304
  project_table_name: string;
@@ -305,6 +319,24 @@ export interface SearchDisplay {
305
319
  curated_album_id?: number;
306
320
  }
307
321
 
322
+ export interface SubscriptionActivated {
323
+ subscription_id: string;
324
+ status: string;
325
+ signing_secret: string;
326
+ }
327
+
328
+ export interface SubscriptionDisplay {
329
+ id: string;
330
+ project_table_name: string;
331
+ callback_url: string;
332
+ targets: string[];
333
+ status: string;
334
+ consecutive_failures: number;
335
+ last_delivery_at?: string;
336
+ last_status_code?: number;
337
+ created_at: string;
338
+ }
339
+
308
340
  export interface UserDisplay {
309
341
  id: number;
310
342
  company_id: number;
@@ -328,6 +360,7 @@ export class Admin {
328
360
  export class Company {
329
361
  getCompanyById(companyId: number): Promise<CompanyDisplay>;
330
362
  confirmCompanyCreditBalance(companyId: number, options?: { photoCount?: number | number[], modelsList?: string[] | string[][] }): Promise<CreditBalanceOutput>;
363
+ updateCompanyPhotoUrlAllowlist(companyId: number, photoUrlAllowlist: string[]): Promise<Record<string, any>>;
331
364
  }
332
365
 
333
366
  export class CuratedAlbums {
@@ -407,6 +440,7 @@ export class OauthLogin {
407
440
 
408
441
  export class Person {
409
442
  updatePerson(projectTableName: string, personId: string, options?: { personName?: string | string[] }): Promise<any>;
443
+ removePersonName(projectTableName: string, personId: string): Promise<PhotoPersonLight>;
410
444
  combinePersons(projectTableName: string, destinationPersonId: string, oldPersonId: string): Promise<PhotoPersonLight>;
411
445
  splitPersons(projectTableName: string, id: number, options?: { newName?: string | string[], destinationPersonId?: string | string[] }): Promise<PhotoPersonLight>;
412
446
  getAllPersonsFromProject(projectTableName: string): Promise<PhotoPersonWithS3Link[]>;
@@ -457,16 +491,26 @@ export class Search {
457
491
  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
492
  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
493
  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>>;
494
+ 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
495
  getProjectSavedSearches(projectTableName: string): Promise<any>;
462
496
  getSavedSearchById(searchId: number): Promise<SearchDisplay>;
463
497
  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
498
  deleteSavedSearchById(searchId: number): Promise<Record<string, any>>;
465
499
  }
466
500
 
501
+ export class Subscription {
502
+ createSubscription(projectTableName: string, callbackUrl: string, targets: string[]): Promise<any>;
503
+ verifySubscription(subscriptionId: string): Promise<any>;
504
+ listSubscriptions(): Promise<SubscriptionDisplay[]>;
505
+ listSubscriptionEvents(subscriptionId: string, options?: { since?: string | string[], limit?: number | number[] }): Promise<EventPage>;
506
+ updateSubscription(subscriptionId: string, body?: { callbackUrl?: string, targets?: string[] }): Promise<SubscriptionDisplay>;
507
+ deleteSubscription(subscriptionId: string): Promise<Record<string, any>>;
508
+ rotateSubscriptionSecret(subscriptionId: string): Promise<SubscriptionActivated>;
509
+ }
510
+
467
511
  export class Users {
468
512
  createUser(name: string, email: string, accountType: number, companyId?: number, profilePicture?: string, paymentPlanType?: string): Promise<UserDisplay>;
469
- createUserAndCompany(name: string, email: string, password: string, companyId?: number, profilePicture?: string, paymentPlanType?: string, companyName?: string, credits?: number, options?: { inviteToken?: string | string[] }): Promise<UserDisplay>;
513
+ createUserAndCompany(name: string, email: string, password: string, companyId?: number, profilePicture?: string, paymentPlanType?: string, companyName?: string, credits?: number, photoUrlAllowlist?: string[], options?: { inviteToken?: string | string[] }): Promise<UserDisplay>;
470
514
  changePassword(oldPassword: string, newPassword: string): Promise<Record<string, any>>;
471
515
  getUserId(): Promise<Record<string, any>>;
472
516
  getUser(userId: number): Promise<UserDisplay>;
@@ -499,6 +543,7 @@ export class MediaViz {
499
543
  readonly photos: Photos;
500
544
  readonly projects: Projects;
501
545
  readonly search: Search;
546
+ readonly subscription: Subscription;
502
547
  readonly users: Users;
503
548
  }
504
549
 
package/dist/sdk.esm.d.ts CHANGED
@@ -82,6 +82,7 @@ export interface CompanyDisplay {
82
82
  users?: number[];
83
83
  active: boolean;
84
84
  payment_plan_type: string;
85
+ photo_url_allowlist?: string[];
85
86
  }
86
87
 
87
88
  export interface CompanyKeywordListOverview {
@@ -107,6 +108,12 @@ export interface CuratedAlbumDisplay {
107
108
  confidence_value?: number;
108
109
  }
109
110
 
111
+ export interface EventPage {
112
+ events: PullEvent[];
113
+ next_cursor?: string;
114
+ size?: number;
115
+ }
116
+
110
117
  export interface HealthCheck {
111
118
  status?: string;
112
119
  timestamp?: string;
@@ -285,6 +292,13 @@ export interface ProjectRunDisplay {
285
292
  normalize?: boolean;
286
293
  }
287
294
 
295
+ export interface PullEvent {
296
+ event_id: string;
297
+ photo_id: number;
298
+ target: string;
299
+ completed_at: string;
300
+ }
301
+
288
302
  export interface SearchDisplay {
289
303
  id: number;
290
304
  project_table_name: string;
@@ -305,6 +319,24 @@ export interface SearchDisplay {
305
319
  curated_album_id?: number;
306
320
  }
307
321
 
322
+ export interface SubscriptionActivated {
323
+ subscription_id: string;
324
+ status: string;
325
+ signing_secret: string;
326
+ }
327
+
328
+ export interface SubscriptionDisplay {
329
+ id: string;
330
+ project_table_name: string;
331
+ callback_url: string;
332
+ targets: string[];
333
+ status: string;
334
+ consecutive_failures: number;
335
+ last_delivery_at?: string;
336
+ last_status_code?: number;
337
+ created_at: string;
338
+ }
339
+
308
340
  export interface UserDisplay {
309
341
  id: number;
310
342
  company_id: number;
@@ -328,6 +360,7 @@ export class Admin {
328
360
  export class Company {
329
361
  getCompanyById(companyId: number): Promise<CompanyDisplay>;
330
362
  confirmCompanyCreditBalance(companyId: number, options?: { photoCount?: number | number[], modelsList?: string[] | string[][] }): Promise<CreditBalanceOutput>;
363
+ updateCompanyPhotoUrlAllowlist(companyId: number, photoUrlAllowlist: string[]): Promise<Record<string, any>>;
331
364
  }
332
365
 
333
366
  export class CuratedAlbums {
@@ -407,6 +440,7 @@ export class OauthLogin {
407
440
 
408
441
  export class Person {
409
442
  updatePerson(projectTableName: string, personId: string, options?: { personName?: string | string[] }): Promise<any>;
443
+ removePersonName(projectTableName: string, personId: string): Promise<PhotoPersonLight>;
410
444
  combinePersons(projectTableName: string, destinationPersonId: string, oldPersonId: string): Promise<PhotoPersonLight>;
411
445
  splitPersons(projectTableName: string, id: number, options?: { newName?: string | string[], destinationPersonId?: string | string[] }): Promise<PhotoPersonLight>;
412
446
  getAllPersonsFromProject(projectTableName: string): Promise<PhotoPersonWithS3Link[]>;
@@ -457,16 +491,26 @@ export class Search {
457
491
  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
492
  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
493
  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>>;
494
+ 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
495
  getProjectSavedSearches(projectTableName: string): Promise<any>;
462
496
  getSavedSearchById(searchId: number): Promise<SearchDisplay>;
463
497
  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
498
  deleteSavedSearchById(searchId: number): Promise<Record<string, any>>;
465
499
  }
466
500
 
501
+ export class Subscription {
502
+ createSubscription(projectTableName: string, callbackUrl: string, targets: string[]): Promise<any>;
503
+ verifySubscription(subscriptionId: string): Promise<any>;
504
+ listSubscriptions(): Promise<SubscriptionDisplay[]>;
505
+ listSubscriptionEvents(subscriptionId: string, options?: { since?: string | string[], limit?: number | number[] }): Promise<EventPage>;
506
+ updateSubscription(subscriptionId: string, body?: { callbackUrl?: string, targets?: string[] }): Promise<SubscriptionDisplay>;
507
+ deleteSubscription(subscriptionId: string): Promise<Record<string, any>>;
508
+ rotateSubscriptionSecret(subscriptionId: string): Promise<SubscriptionActivated>;
509
+ }
510
+
467
511
  export class Users {
468
512
  createUser(name: string, email: string, accountType: number, companyId?: number, profilePicture?: string, paymentPlanType?: string): Promise<UserDisplay>;
469
- createUserAndCompany(name: string, email: string, password: string, companyId?: number, profilePicture?: string, paymentPlanType?: string, companyName?: string, credits?: number, options?: { inviteToken?: string | string[] }): Promise<UserDisplay>;
513
+ createUserAndCompany(name: string, email: string, password: string, companyId?: number, profilePicture?: string, paymentPlanType?: string, companyName?: string, credits?: number, photoUrlAllowlist?: string[], options?: { inviteToken?: string | string[] }): Promise<UserDisplay>;
470
514
  changePassword(oldPassword: string, newPassword: string): Promise<Record<string, any>>;
471
515
  getUserId(): Promise<Record<string, any>>;
472
516
  getUser(userId: number): Promise<UserDisplay>;
@@ -499,6 +543,7 @@ export class MediaViz {
499
543
  readonly photos: Photos;
500
544
  readonly projects: Projects;
501
545
  readonly search: Search;
546
+ readonly subscription: Subscription;
502
547
  readonly users: Users;
503
548
  }
504
549
 
package/dist/sdk.esm.js CHANGED
@@ -502,6 +502,8 @@ class Admin {
502
502
  }
503
503
  }
504
504
 
505
+ function stripUndef$8(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
506
+
505
507
  class Company {
506
508
  constructor(ctx) { this._ctx = ctx; }
507
509
 
@@ -523,9 +525,19 @@ class Company {
523
525
  const { data } = await this._ctx.client.request(path, 'GET', this._ctx.accessToken, this._ctx.refreshToken);
524
526
  return data;
525
527
  }
528
+
529
+ async updateCompanyPhotoUrlAllowlist(companyId, photoUrlAllowlist) {
530
+ this._ctx.requireTokens();
531
+ const path = `/api/v1/company/${encodeURIComponent(companyId)}/photo_url_allowlist/`;
532
+ const body = stripUndef$8({
533
+ photo_url_allowlist: photoUrlAllowlist,
534
+ });
535
+ const { data } = await this._ctx.client.request(path, 'PUT', this._ctx.accessToken, this._ctx.refreshToken, body);
536
+ return data;
537
+ }
526
538
  }
527
539
 
528
- function stripUndef$6(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
540
+ function stripUndef$7(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
529
541
 
530
542
  class CuratedAlbums {
531
543
  constructor(ctx) { this._ctx = ctx; }
@@ -533,7 +545,7 @@ class CuratedAlbums {
533
545
  async createCuratedAlbum(projectTableName, name, description = undefined, confidenceValue = undefined) {
534
546
  this._ctx.requireTokens();
535
547
  const path = `/api/v1/curated_album/project/${encodeURIComponent(projectTableName)}`;
536
- const body = stripUndef$6({
548
+ const body = stripUndef$7({
537
549
  name: name,
538
550
  description: description,
539
551
  confidence_value: confidenceValue,
@@ -587,7 +599,7 @@ class CuratedAlbums {
587
599
  async updateCuratedAlbum(albumId, { name, description, confidenceValue } = {}) {
588
600
  this._ctx.requireTokens();
589
601
  const path = `/api/v1/curated_album/${encodeURIComponent(albumId)}`;
590
- const body = stripUndef$6({
602
+ const body = stripUndef$7({
591
603
  name: name,
592
604
  description: description,
593
605
  confidence_value: confidenceValue,
@@ -611,7 +623,7 @@ class CuratedAlbums {
611
623
  }
612
624
  }
613
625
 
614
- function stripUndef$5(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
626
+ function stripUndef$6(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
615
627
 
616
628
  class CustomAlbums {
617
629
  constructor(ctx) { this._ctx = ctx; }
@@ -659,7 +671,7 @@ class CustomAlbums {
659
671
  async createProjectCustomAlbum(projectTableName, { name, description, photoIdInclusionList, photoIdRemovalList } = {}) {
660
672
  this._ctx.requireTokens();
661
673
  const path = `/api/v1/custom_album/project/${encodeURIComponent(projectTableName)}`;
662
- const body = stripUndef$5({
674
+ const body = stripUndef$6({
663
675
  name: name,
664
676
  description: description,
665
677
  photo_id_inclusion_list: photoIdInclusionList,
@@ -672,7 +684,7 @@ class CustomAlbums {
672
684
  async updateCustomAlbum(albumId, { name, description, photoIdInclusionList, photoIdRemovalList } = {}) {
673
685
  this._ctx.requireTokens();
674
686
  const path = `/api/v1/custom_album/${encodeURIComponent(albumId)}`;
675
- const body = stripUndef$5({
687
+ const body = stripUndef$6({
676
688
  name: name,
677
689
  description: description,
678
690
  photo_id_inclusion_list: photoIdInclusionList,
@@ -772,7 +784,7 @@ async function handleResponse(response) {
772
784
  }
773
785
  }
774
786
 
775
- function stripUndef$4(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
787
+ function stripUndef$5(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
776
788
 
777
789
  class EmailTokens {
778
790
  constructor(ctx) { this._ctx = ctx; }
@@ -803,7 +815,7 @@ class EmailTokens {
803
815
  }
804
816
 
805
817
  async validateToken(token) {
806
- const body = stripUndef$4({
818
+ const body = stripUndef$5({
807
819
  token: token,
808
820
  });
809
821
  const resp = await fetch(this._ctx.baseUrl + `/api/v1/validate-token`, {
@@ -815,7 +827,7 @@ class EmailTokens {
815
827
  }
816
828
 
817
829
  async resetPassword(token, newPassword) {
818
- const body = stripUndef$4({
830
+ const body = stripUndef$5({
819
831
  token: token,
820
832
  new_password: newPassword,
821
833
  });
@@ -854,7 +866,7 @@ class Health {
854
866
  }
855
867
  }
856
868
 
857
- function stripUndef$3(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
869
+ function stripUndef$4(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
858
870
 
859
871
  class Keywords {
860
872
  constructor(ctx) { this._ctx = ctx; }
@@ -862,7 +874,7 @@ class Keywords {
862
874
  async createKeywordFilteringList(name, projectList = undefined) {
863
875
  this._ctx.requireTokens();
864
876
  const path = `/api/v1/keyword/`;
865
- const body = stripUndef$3({
877
+ const body = stripUndef$4({
866
878
  name: name,
867
879
  project_list: projectList,
868
880
  });
@@ -915,7 +927,7 @@ class Keywords {
915
927
  async updateKeywordFilteringListLabels(keywordListId, listKeywordsToInclude, listKeywordsToExclude) {
916
928
  this._ctx.requireTokens();
917
929
  const path = `/api/v1/keyword/${encodeURIComponent(keywordListId)}`;
918
- const body = stripUndef$3({
930
+ const body = stripUndef$4({
919
931
  list_keywords_to_include: listKeywordsToInclude,
920
932
  list_keywords_to_exclude: listKeywordsToExclude,
921
933
  });
@@ -926,7 +938,7 @@ class Keywords {
926
938
  async updateKeywordFilteringListDetails(keywordListId, { name, projectList } = {}) {
927
939
  this._ctx.requireTokens();
928
940
  const path = `/api/v1/keyword/details/${encodeURIComponent(keywordListId)}`;
929
- const body = stripUndef$3({
941
+ const body = stripUndef$4({
930
942
  name: name,
931
943
  project_list: projectList,
932
944
  });
@@ -1125,6 +1137,13 @@ class Person {
1125
1137
  return data;
1126
1138
  }
1127
1139
 
1140
+ async removePersonName(projectTableName, personId) {
1141
+ this._ctx.requireTokens();
1142
+ const path = `/api/v1/person/${encodeURIComponent(projectTableName)}/remove_name/${encodeURIComponent(personId)}`;
1143
+ const { data } = await this._ctx.client.request(path, 'PUT', this._ctx.accessToken, this._ctx.refreshToken);
1144
+ return data;
1145
+ }
1146
+
1128
1147
  async combinePersons(projectTableName, destinationPersonId, oldPersonId) {
1129
1148
  this._ctx.requireTokens();
1130
1149
  const path = `/api/v1/person/${encodeURIComponent(projectTableName)}/combine/${encodeURIComponent(destinationPersonId)}/${encodeURIComponent(oldPersonId)}`;
@@ -1177,7 +1196,7 @@ class Person {
1177
1196
  }
1178
1197
  }
1179
1198
 
1180
- function stripUndef$2(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1199
+ function stripUndef$3(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1181
1200
 
1182
1201
  class Projects {
1183
1202
  constructor(ctx) { this._ctx = ctx; }
@@ -1190,7 +1209,7 @@ class Projects {
1190
1209
  if (models !== undefined) (Array.isArray(models) ? models : [models]).forEach(v => query.append('models', v));
1191
1210
  const qs = query.toString();
1192
1211
  if (qs) path += '?' + qs;
1193
- const body = stripUndef$2({
1212
+ const body = stripUndef$3({
1194
1213
  name: name,
1195
1214
  private: private_,
1196
1215
  type: type,
@@ -1260,7 +1279,7 @@ class Projects {
1260
1279
  async updateProject(projectId, { private: private_, type, description, directory, name, thumbnail } = {}) {
1261
1280
  this._ctx.requireTokens();
1262
1281
  const path = `/api/v1/projects/${encodeURIComponent(projectId)}`;
1263
- const body = stripUndef$2({
1282
+ const body = stripUndef$3({
1264
1283
  private: private_,
1265
1284
  type: type,
1266
1285
  description: description,
@@ -1339,7 +1358,7 @@ class Projects {
1339
1358
  async addProjectEvent(projectTableName, event, detail = undefined) {
1340
1359
  this._ctx.requireTokens();
1341
1360
  const path = `/api/v1/projects/${encodeURIComponent(projectTableName)}/event`;
1342
- const body = stripUndef$2({
1361
+ const body = stripUndef$3({
1343
1362
  event: event,
1344
1363
  detail: detail,
1345
1364
  });
@@ -1483,7 +1502,7 @@ class Photos {
1483
1502
  }
1484
1503
  }
1485
1504
 
1486
- function stripUndef$1(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1505
+ function stripUndef$2(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1487
1506
 
1488
1507
  class Search {
1489
1508
  constructor(ctx) { this._ctx = ctx; }
@@ -1553,7 +1572,7 @@ class Search {
1553
1572
  return data;
1554
1573
  }
1555
1574
 
1556
- async searchProjectPhotosNaturalLanguage(projectTableName, searchText, size = undefined, { minCosine, labelMinCosine, labelTopK, labelDelta, bestOfSimilarSetsOnly, splitByTier } = {}) {
1575
+ async searchProjectPhotosNaturalLanguage(projectTableName, searchText, { minCosine, labelMinCosine, labelTopK, labelDelta, bestOfSimilarSetsOnly, splitByTier } = {}) {
1557
1576
  this._ctx.requireTokens();
1558
1577
  let path = `/api/v1/search/natural_language/${encodeURIComponent(projectTableName)}/`;
1559
1578
  const query = new URLSearchParams();
@@ -1565,9 +1584,8 @@ class Search {
1565
1584
  if (splitByTier !== undefined) (Array.isArray(splitByTier) ? splitByTier : [splitByTier]).forEach(v => query.append('split_by_tier', v));
1566
1585
  const qs = query.toString();
1567
1586
  if (qs) path += '?' + qs;
1568
- const body = stripUndef$1({
1587
+ const body = stripUndef$2({
1569
1588
  search_text: searchText,
1570
- size: size,
1571
1589
  });
1572
1590
  const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken, body);
1573
1591
  return data;
@@ -1621,6 +1639,75 @@ class Search {
1621
1639
  }
1622
1640
  }
1623
1641
 
1642
+ function stripUndef$1(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1643
+
1644
+ class Subscription {
1645
+ constructor(ctx) { this._ctx = ctx; }
1646
+
1647
+ async createSubscription(projectTableName, callbackUrl, targets) {
1648
+ this._ctx.requireTokens();
1649
+ const path = `/api/v1/subscriptions`;
1650
+ const body = stripUndef$1({
1651
+ project_table_name: projectTableName,
1652
+ callback_url: callbackUrl,
1653
+ targets: targets,
1654
+ });
1655
+ const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken, body);
1656
+ return data;
1657
+ }
1658
+
1659
+ async verifySubscription(subscriptionId) {
1660
+ this._ctx.requireTokens();
1661
+ const path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}/verify`;
1662
+ const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken);
1663
+ return data;
1664
+ }
1665
+
1666
+ async listSubscriptions() {
1667
+ this._ctx.requireTokens();
1668
+ const path = `/api/v1/subscriptions`;
1669
+ const { data } = await this._ctx.client.request(path, 'GET', this._ctx.accessToken, this._ctx.refreshToken);
1670
+ return data;
1671
+ }
1672
+
1673
+ async listSubscriptionEvents(subscriptionId, { since, limit } = {}) {
1674
+ this._ctx.requireTokens();
1675
+ let path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}/events`;
1676
+ const query = new URLSearchParams();
1677
+ if (since !== undefined) (Array.isArray(since) ? since : [since]).forEach(v => query.append('since', v));
1678
+ if (limit !== undefined) (Array.isArray(limit) ? limit : [limit]).forEach(v => query.append('limit', v));
1679
+ const qs = query.toString();
1680
+ if (qs) path += '?' + qs;
1681
+ const { data } = await this._ctx.client.request(path, 'GET', this._ctx.accessToken, this._ctx.refreshToken);
1682
+ return data;
1683
+ }
1684
+
1685
+ async updateSubscription(subscriptionId, { callbackUrl, targets } = {}) {
1686
+ this._ctx.requireTokens();
1687
+ const path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}`;
1688
+ const body = stripUndef$1({
1689
+ callback_url: callbackUrl,
1690
+ targets: targets,
1691
+ });
1692
+ const { data } = await this._ctx.client.request(path, 'PATCH', this._ctx.accessToken, this._ctx.refreshToken, body);
1693
+ return data;
1694
+ }
1695
+
1696
+ async deleteSubscription(subscriptionId) {
1697
+ this._ctx.requireTokens();
1698
+ const path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}`;
1699
+ const { data } = await this._ctx.client.request(path, 'DELETE', this._ctx.accessToken, this._ctx.refreshToken);
1700
+ return data;
1701
+ }
1702
+
1703
+ async rotateSubscriptionSecret(subscriptionId) {
1704
+ this._ctx.requireTokens();
1705
+ const path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}/rotate_secret`;
1706
+ const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken);
1707
+ return data;
1708
+ }
1709
+ }
1710
+
1624
1711
  function stripUndef(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1625
1712
 
1626
1713
  class Users {
@@ -1641,7 +1728,7 @@ class Users {
1641
1728
  return data;
1642
1729
  }
1643
1730
 
1644
- async createUserAndCompany(name, email, password, companyId = undefined, profilePicture = undefined, paymentPlanType = undefined, companyName = undefined, credits = undefined, { inviteToken } = {}) {
1731
+ async createUserAndCompany(name, email, password, companyId = undefined, profilePicture = undefined, paymentPlanType = undefined, companyName = undefined, credits = undefined, photoUrlAllowlist = undefined, { inviteToken } = {}) {
1645
1732
  let path = `/api/v1/users/new_company/`;
1646
1733
  const query = new URLSearchParams();
1647
1734
  if (inviteToken !== undefined) (Array.isArray(inviteToken) ? inviteToken : [inviteToken]).forEach(v => query.append('invite_token', v));
@@ -1656,6 +1743,7 @@ class Users {
1656
1743
  password: password,
1657
1744
  company_name: companyName,
1658
1745
  credits: credits,
1746
+ photo_url_allowlist: photoUrlAllowlist,
1659
1747
  });
1660
1748
  const resp = await fetch(this._ctx.baseUrl + path, {
1661
1749
  method: 'POST',
@@ -1804,6 +1892,7 @@ class MediaViz {
1804
1892
  this.photos = new Photos(_ctx);
1805
1893
  this.projects = new Projects(_ctx);
1806
1894
  this.search = new Search(_ctx);
1895
+ this.subscription = new Subscription(_ctx);
1807
1896
  this.users = new Users(_ctx);
1808
1897
  }
1809
1898
 
@@ -1834,4 +1923,4 @@ class MediaViz {
1834
1923
  get refreshToken() { return this._refreshToken; }
1835
1924
  }
1836
1925
 
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 };
1926
+ 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
@@ -508,6 +508,8 @@
508
508
  }
509
509
  }
510
510
 
511
+ function stripUndef$8(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
512
+
511
513
  class Company {
512
514
  constructor(ctx) { this._ctx = ctx; }
513
515
 
@@ -529,9 +531,19 @@
529
531
  const { data } = await this._ctx.client.request(path, 'GET', this._ctx.accessToken, this._ctx.refreshToken);
530
532
  return data;
531
533
  }
534
+
535
+ async updateCompanyPhotoUrlAllowlist(companyId, photoUrlAllowlist) {
536
+ this._ctx.requireTokens();
537
+ const path = `/api/v1/company/${encodeURIComponent(companyId)}/photo_url_allowlist/`;
538
+ const body = stripUndef$8({
539
+ photo_url_allowlist: photoUrlAllowlist,
540
+ });
541
+ const { data } = await this._ctx.client.request(path, 'PUT', this._ctx.accessToken, this._ctx.refreshToken, body);
542
+ return data;
543
+ }
532
544
  }
533
545
 
534
- function stripUndef$6(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
546
+ function stripUndef$7(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
535
547
 
536
548
  class CuratedAlbums {
537
549
  constructor(ctx) { this._ctx = ctx; }
@@ -539,7 +551,7 @@
539
551
  async createCuratedAlbum(projectTableName, name, description = undefined, confidenceValue = undefined) {
540
552
  this._ctx.requireTokens();
541
553
  const path = `/api/v1/curated_album/project/${encodeURIComponent(projectTableName)}`;
542
- const body = stripUndef$6({
554
+ const body = stripUndef$7({
543
555
  name: name,
544
556
  description: description,
545
557
  confidence_value: confidenceValue,
@@ -593,7 +605,7 @@
593
605
  async updateCuratedAlbum(albumId, { name, description, confidenceValue } = {}) {
594
606
  this._ctx.requireTokens();
595
607
  const path = `/api/v1/curated_album/${encodeURIComponent(albumId)}`;
596
- const body = stripUndef$6({
608
+ const body = stripUndef$7({
597
609
  name: name,
598
610
  description: description,
599
611
  confidence_value: confidenceValue,
@@ -617,7 +629,7 @@
617
629
  }
618
630
  }
619
631
 
620
- function stripUndef$5(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
632
+ function stripUndef$6(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
621
633
 
622
634
  class CustomAlbums {
623
635
  constructor(ctx) { this._ctx = ctx; }
@@ -665,7 +677,7 @@
665
677
  async createProjectCustomAlbum(projectTableName, { name, description, photoIdInclusionList, photoIdRemovalList } = {}) {
666
678
  this._ctx.requireTokens();
667
679
  const path = `/api/v1/custom_album/project/${encodeURIComponent(projectTableName)}`;
668
- const body = stripUndef$5({
680
+ const body = stripUndef$6({
669
681
  name: name,
670
682
  description: description,
671
683
  photo_id_inclusion_list: photoIdInclusionList,
@@ -678,7 +690,7 @@
678
690
  async updateCustomAlbum(albumId, { name, description, photoIdInclusionList, photoIdRemovalList } = {}) {
679
691
  this._ctx.requireTokens();
680
692
  const path = `/api/v1/custom_album/${encodeURIComponent(albumId)}`;
681
- const body = stripUndef$5({
693
+ const body = stripUndef$6({
682
694
  name: name,
683
695
  description: description,
684
696
  photo_id_inclusion_list: photoIdInclusionList,
@@ -778,7 +790,7 @@
778
790
  }
779
791
  }
780
792
 
781
- function stripUndef$4(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
793
+ function stripUndef$5(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
782
794
 
783
795
  class EmailTokens {
784
796
  constructor(ctx) { this._ctx = ctx; }
@@ -809,7 +821,7 @@
809
821
  }
810
822
 
811
823
  async validateToken(token) {
812
- const body = stripUndef$4({
824
+ const body = stripUndef$5({
813
825
  token: token,
814
826
  });
815
827
  const resp = await fetch(this._ctx.baseUrl + `/api/v1/validate-token`, {
@@ -821,7 +833,7 @@
821
833
  }
822
834
 
823
835
  async resetPassword(token, newPassword) {
824
- const body = stripUndef$4({
836
+ const body = stripUndef$5({
825
837
  token: token,
826
838
  new_password: newPassword,
827
839
  });
@@ -860,7 +872,7 @@
860
872
  }
861
873
  }
862
874
 
863
- function stripUndef$3(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
875
+ function stripUndef$4(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
864
876
 
865
877
  class Keywords {
866
878
  constructor(ctx) { this._ctx = ctx; }
@@ -868,7 +880,7 @@
868
880
  async createKeywordFilteringList(name, projectList = undefined) {
869
881
  this._ctx.requireTokens();
870
882
  const path = `/api/v1/keyword/`;
871
- const body = stripUndef$3({
883
+ const body = stripUndef$4({
872
884
  name: name,
873
885
  project_list: projectList,
874
886
  });
@@ -921,7 +933,7 @@
921
933
  async updateKeywordFilteringListLabels(keywordListId, listKeywordsToInclude, listKeywordsToExclude) {
922
934
  this._ctx.requireTokens();
923
935
  const path = `/api/v1/keyword/${encodeURIComponent(keywordListId)}`;
924
- const body = stripUndef$3({
936
+ const body = stripUndef$4({
925
937
  list_keywords_to_include: listKeywordsToInclude,
926
938
  list_keywords_to_exclude: listKeywordsToExclude,
927
939
  });
@@ -932,7 +944,7 @@
932
944
  async updateKeywordFilteringListDetails(keywordListId, { name, projectList } = {}) {
933
945
  this._ctx.requireTokens();
934
946
  const path = `/api/v1/keyword/details/${encodeURIComponent(keywordListId)}`;
935
- const body = stripUndef$3({
947
+ const body = stripUndef$4({
936
948
  name: name,
937
949
  project_list: projectList,
938
950
  });
@@ -1131,6 +1143,13 @@
1131
1143
  return data;
1132
1144
  }
1133
1145
 
1146
+ async removePersonName(projectTableName, personId) {
1147
+ this._ctx.requireTokens();
1148
+ const path = `/api/v1/person/${encodeURIComponent(projectTableName)}/remove_name/${encodeURIComponent(personId)}`;
1149
+ const { data } = await this._ctx.client.request(path, 'PUT', this._ctx.accessToken, this._ctx.refreshToken);
1150
+ return data;
1151
+ }
1152
+
1134
1153
  async combinePersons(projectTableName, destinationPersonId, oldPersonId) {
1135
1154
  this._ctx.requireTokens();
1136
1155
  const path = `/api/v1/person/${encodeURIComponent(projectTableName)}/combine/${encodeURIComponent(destinationPersonId)}/${encodeURIComponent(oldPersonId)}`;
@@ -1183,7 +1202,7 @@
1183
1202
  }
1184
1203
  }
1185
1204
 
1186
- function stripUndef$2(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1205
+ function stripUndef$3(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1187
1206
 
1188
1207
  class Projects {
1189
1208
  constructor(ctx) { this._ctx = ctx; }
@@ -1196,7 +1215,7 @@
1196
1215
  if (models !== undefined) (Array.isArray(models) ? models : [models]).forEach(v => query.append('models', v));
1197
1216
  const qs = query.toString();
1198
1217
  if (qs) path += '?' + qs;
1199
- const body = stripUndef$2({
1218
+ const body = stripUndef$3({
1200
1219
  name: name,
1201
1220
  private: private_,
1202
1221
  type: type,
@@ -1266,7 +1285,7 @@
1266
1285
  async updateProject(projectId, { private: private_, type, description, directory, name, thumbnail } = {}) {
1267
1286
  this._ctx.requireTokens();
1268
1287
  const path = `/api/v1/projects/${encodeURIComponent(projectId)}`;
1269
- const body = stripUndef$2({
1288
+ const body = stripUndef$3({
1270
1289
  private: private_,
1271
1290
  type: type,
1272
1291
  description: description,
@@ -1345,7 +1364,7 @@
1345
1364
  async addProjectEvent(projectTableName, event, detail = undefined) {
1346
1365
  this._ctx.requireTokens();
1347
1366
  const path = `/api/v1/projects/${encodeURIComponent(projectTableName)}/event`;
1348
- const body = stripUndef$2({
1367
+ const body = stripUndef$3({
1349
1368
  event: event,
1350
1369
  detail: detail,
1351
1370
  });
@@ -1489,7 +1508,7 @@
1489
1508
  }
1490
1509
  }
1491
1510
 
1492
- function stripUndef$1(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1511
+ function stripUndef$2(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1493
1512
 
1494
1513
  class Search {
1495
1514
  constructor(ctx) { this._ctx = ctx; }
@@ -1559,7 +1578,7 @@
1559
1578
  return data;
1560
1579
  }
1561
1580
 
1562
- async searchProjectPhotosNaturalLanguage(projectTableName, searchText, size = undefined, { minCosine, labelMinCosine, labelTopK, labelDelta, bestOfSimilarSetsOnly, splitByTier } = {}) {
1581
+ async searchProjectPhotosNaturalLanguage(projectTableName, searchText, { minCosine, labelMinCosine, labelTopK, labelDelta, bestOfSimilarSetsOnly, splitByTier } = {}) {
1563
1582
  this._ctx.requireTokens();
1564
1583
  let path = `/api/v1/search/natural_language/${encodeURIComponent(projectTableName)}/`;
1565
1584
  const query = new URLSearchParams();
@@ -1571,9 +1590,8 @@
1571
1590
  if (splitByTier !== undefined) (Array.isArray(splitByTier) ? splitByTier : [splitByTier]).forEach(v => query.append('split_by_tier', v));
1572
1591
  const qs = query.toString();
1573
1592
  if (qs) path += '?' + qs;
1574
- const body = stripUndef$1({
1593
+ const body = stripUndef$2({
1575
1594
  search_text: searchText,
1576
- size: size,
1577
1595
  });
1578
1596
  const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken, body);
1579
1597
  return data;
@@ -1627,6 +1645,75 @@
1627
1645
  }
1628
1646
  }
1629
1647
 
1648
+ function stripUndef$1(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1649
+
1650
+ class Subscription {
1651
+ constructor(ctx) { this._ctx = ctx; }
1652
+
1653
+ async createSubscription(projectTableName, callbackUrl, targets) {
1654
+ this._ctx.requireTokens();
1655
+ const path = `/api/v1/subscriptions`;
1656
+ const body = stripUndef$1({
1657
+ project_table_name: projectTableName,
1658
+ callback_url: callbackUrl,
1659
+ targets: targets,
1660
+ });
1661
+ const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken, body);
1662
+ return data;
1663
+ }
1664
+
1665
+ async verifySubscription(subscriptionId) {
1666
+ this._ctx.requireTokens();
1667
+ const path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}/verify`;
1668
+ const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken);
1669
+ return data;
1670
+ }
1671
+
1672
+ async listSubscriptions() {
1673
+ this._ctx.requireTokens();
1674
+ const path = `/api/v1/subscriptions`;
1675
+ const { data } = await this._ctx.client.request(path, 'GET', this._ctx.accessToken, this._ctx.refreshToken);
1676
+ return data;
1677
+ }
1678
+
1679
+ async listSubscriptionEvents(subscriptionId, { since, limit } = {}) {
1680
+ this._ctx.requireTokens();
1681
+ let path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}/events`;
1682
+ const query = new URLSearchParams();
1683
+ if (since !== undefined) (Array.isArray(since) ? since : [since]).forEach(v => query.append('since', v));
1684
+ if (limit !== undefined) (Array.isArray(limit) ? limit : [limit]).forEach(v => query.append('limit', v));
1685
+ const qs = query.toString();
1686
+ if (qs) path += '?' + qs;
1687
+ const { data } = await this._ctx.client.request(path, 'GET', this._ctx.accessToken, this._ctx.refreshToken);
1688
+ return data;
1689
+ }
1690
+
1691
+ async updateSubscription(subscriptionId, { callbackUrl, targets } = {}) {
1692
+ this._ctx.requireTokens();
1693
+ const path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}`;
1694
+ const body = stripUndef$1({
1695
+ callback_url: callbackUrl,
1696
+ targets: targets,
1697
+ });
1698
+ const { data } = await this._ctx.client.request(path, 'PATCH', this._ctx.accessToken, this._ctx.refreshToken, body);
1699
+ return data;
1700
+ }
1701
+
1702
+ async deleteSubscription(subscriptionId) {
1703
+ this._ctx.requireTokens();
1704
+ const path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}`;
1705
+ const { data } = await this._ctx.client.request(path, 'DELETE', this._ctx.accessToken, this._ctx.refreshToken);
1706
+ return data;
1707
+ }
1708
+
1709
+ async rotateSubscriptionSecret(subscriptionId) {
1710
+ this._ctx.requireTokens();
1711
+ const path = `/api/v1/subscriptions/${encodeURIComponent(subscriptionId)}/rotate_secret`;
1712
+ const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken);
1713
+ return data;
1714
+ }
1715
+ }
1716
+
1630
1717
  function stripUndef(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1631
1718
 
1632
1719
  class Users {
@@ -1647,7 +1734,7 @@
1647
1734
  return data;
1648
1735
  }
1649
1736
 
1650
- async createUserAndCompany(name, email, password, companyId = undefined, profilePicture = undefined, paymentPlanType = undefined, companyName = undefined, credits = undefined, { inviteToken } = {}) {
1737
+ async createUserAndCompany(name, email, password, companyId = undefined, profilePicture = undefined, paymentPlanType = undefined, companyName = undefined, credits = undefined, photoUrlAllowlist = undefined, { inviteToken } = {}) {
1651
1738
  let path = `/api/v1/users/new_company/`;
1652
1739
  const query = new URLSearchParams();
1653
1740
  if (inviteToken !== undefined) (Array.isArray(inviteToken) ? inviteToken : [inviteToken]).forEach(v => query.append('invite_token', v));
@@ -1662,6 +1749,7 @@
1662
1749
  password: password,
1663
1750
  company_name: companyName,
1664
1751
  credits: credits,
1752
+ photo_url_allowlist: photoUrlAllowlist,
1665
1753
  });
1666
1754
  const resp = await fetch(this._ctx.baseUrl + path, {
1667
1755
  method: 'POST',
@@ -1810,6 +1898,7 @@
1810
1898
  this.photos = new Photos(_ctx);
1811
1899
  this.projects = new Projects(_ctx);
1812
1900
  this.search = new Search(_ctx);
1901
+ this.subscription = new Subscription(_ctx);
1813
1902
  this.users = new Users(_ctx);
1814
1903
  }
1815
1904
 
@@ -1864,6 +1953,7 @@
1864
1953
  exports.RateLimitError = RateLimitError;
1865
1954
  exports.Search = Search;
1866
1955
  exports.ServerError = ServerError;
1956
+ exports.Subscription = Subscription;
1867
1957
  exports.Users = Users;
1868
1958
  exports.ValidationError = ValidationError;
1869
1959
  exports.handleResponse = handleResponse;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediaviz/sdk",
3
- "version": "1.7.0",
3
+ "version": "1.8.0-dev.91",
4
4
  "description": "MediaViz JavaScript SDK \u2014 auto-generated public endpoint client.",
5
5
  "license": "MIT",
6
6
  "repository": {