@mediaviz/sdk 1.10.0-rc.8 → 1.11.0-dev.125

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.esm.js CHANGED
@@ -1113,6 +1113,8 @@ class AiModelCredits {
1113
1113
  }
1114
1114
  }
1115
1115
 
1116
+ function stripUndef$a(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1117
+
1116
1118
  class Admin {
1117
1119
  constructor(ctx) { this._ctx = ctx; }
1118
1120
 
@@ -1122,6 +1124,16 @@ class Admin {
1122
1124
  const { data } = await this._ctx.client.request(path, 'GET', this._ctx.accessToken, this._ctx.refreshToken);
1123
1125
  return data;
1124
1126
  }
1127
+
1128
+ async adminSetCompanyCanManageApiClients(companyId, canManageApiClients) {
1129
+ this._ctx.requireTokens();
1130
+ const path = `/api/v1/admin/companies/${encodeURIComponent(companyId)}/can_manage_api_clients`;
1131
+ const body = stripUndef$a({
1132
+ can_manage_api_clients: canManageApiClients,
1133
+ });
1134
+ const { data } = await this._ctx.client.request(path, 'PATCH', this._ctx.accessToken, this._ctx.refreshToken, body);
1135
+ return data;
1136
+ }
1125
1137
  }
1126
1138
 
1127
1139
  class Company {
@@ -1147,7 +1159,7 @@ class Company {
1147
1159
  }
1148
1160
  }
1149
1161
 
1150
- function stripUndef$8(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1162
+ function stripUndef$9(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1151
1163
 
1152
1164
  class CuratedAlbums {
1153
1165
  constructor(ctx) { this._ctx = ctx; }
@@ -1155,7 +1167,7 @@ class CuratedAlbums {
1155
1167
  async createCuratedAlbum(projectTableName, name, description = undefined, confidenceValue = undefined) {
1156
1168
  this._ctx.requireTokens();
1157
1169
  const path = `/api/v1/curated_album/project/${encodeURIComponent(projectTableName)}`;
1158
- const body = stripUndef$8({
1170
+ const body = stripUndef$9({
1159
1171
  name: name,
1160
1172
  description: description,
1161
1173
  confidence_value: confidenceValue,
@@ -1209,7 +1221,7 @@ class CuratedAlbums {
1209
1221
  async updateCuratedAlbum(albumId, { name, description, confidenceValue } = {}) {
1210
1222
  this._ctx.requireTokens();
1211
1223
  const path = `/api/v1/curated_album/${encodeURIComponent(albumId)}`;
1212
- const body = stripUndef$8({
1224
+ const body = stripUndef$9({
1213
1225
  name: name,
1214
1226
  description: description,
1215
1227
  confidence_value: confidenceValue,
@@ -1233,7 +1245,7 @@ class CuratedAlbums {
1233
1245
  }
1234
1246
  }
1235
1247
 
1236
- function stripUndef$7(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1248
+ function stripUndef$8(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1237
1249
 
1238
1250
  class CustomAlbums {
1239
1251
  constructor(ctx) { this._ctx = ctx; }
@@ -1281,7 +1293,7 @@ class CustomAlbums {
1281
1293
  async createProjectCustomAlbum(projectTableName, { name, description, photoIdInclusionList, photoIdRemovalList } = {}) {
1282
1294
  this._ctx.requireTokens();
1283
1295
  const path = `/api/v1/custom_album/project/${encodeURIComponent(projectTableName)}`;
1284
- const body = stripUndef$7({
1296
+ const body = stripUndef$8({
1285
1297
  name: name,
1286
1298
  description: description,
1287
1299
  photo_id_inclusion_list: photoIdInclusionList,
@@ -1294,7 +1306,7 @@ class CustomAlbums {
1294
1306
  async updateCustomAlbum(albumId, { name, description, photoIdInclusionList, photoIdRemovalList } = {}) {
1295
1307
  this._ctx.requireTokens();
1296
1308
  const path = `/api/v1/custom_album/${encodeURIComponent(albumId)}`;
1297
- const body = stripUndef$7({
1309
+ const body = stripUndef$8({
1298
1310
  name: name,
1299
1311
  description: description,
1300
1312
  photo_id_inclusion_list: photoIdInclusionList,
@@ -1394,7 +1406,7 @@ async function handleResponse(response) {
1394
1406
  }
1395
1407
  }
1396
1408
 
1397
- function stripUndef$6(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1409
+ function stripUndef$7(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1398
1410
 
1399
1411
  class EmailTokens {
1400
1412
  constructor(ctx) { this._ctx = ctx; }
@@ -1425,7 +1437,7 @@ class EmailTokens {
1425
1437
  }
1426
1438
 
1427
1439
  async validateToken(token) {
1428
- const body = stripUndef$6({
1440
+ const body = stripUndef$7({
1429
1441
  token: token,
1430
1442
  });
1431
1443
  const resp = await fetch(this._ctx.baseUrl + `/api/v1/validate-token`, {
@@ -1437,7 +1449,7 @@ class EmailTokens {
1437
1449
  }
1438
1450
 
1439
1451
  async resetPassword(token, newPassword) {
1440
- const body = stripUndef$6({
1452
+ const body = stripUndef$7({
1441
1453
  token: token,
1442
1454
  new_password: newPassword,
1443
1455
  });
@@ -1476,7 +1488,7 @@ class Health {
1476
1488
  }
1477
1489
  }
1478
1490
 
1479
- function stripUndef$5(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1491
+ function stripUndef$6(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1480
1492
 
1481
1493
  class Keywords {
1482
1494
  constructor(ctx) { this._ctx = ctx; }
@@ -1484,7 +1496,7 @@ class Keywords {
1484
1496
  async createKeywordFilteringList(name, projectList = undefined) {
1485
1497
  this._ctx.requireTokens();
1486
1498
  const path = `/api/v1/keyword/`;
1487
- const body = stripUndef$5({
1499
+ const body = stripUndef$6({
1488
1500
  name: name,
1489
1501
  project_list: projectList,
1490
1502
  });
@@ -1537,7 +1549,7 @@ class Keywords {
1537
1549
  async updateKeywordFilteringListLabels(keywordListId, listKeywordsToInclude, listKeywordsToExclude) {
1538
1550
  this._ctx.requireTokens();
1539
1551
  const path = `/api/v1/keyword/${encodeURIComponent(keywordListId)}`;
1540
- const body = stripUndef$5({
1552
+ const body = stripUndef$6({
1541
1553
  list_keywords_to_include: listKeywordsToInclude,
1542
1554
  list_keywords_to_exclude: listKeywordsToExclude,
1543
1555
  });
@@ -1548,7 +1560,7 @@ class Keywords {
1548
1560
  async updateKeywordFilteringListDetails(keywordListId, { name, projectList } = {}) {
1549
1561
  this._ctx.requireTokens();
1550
1562
  const path = `/api/v1/keyword/details/${encodeURIComponent(keywordListId)}`;
1551
- const body = stripUndef$5({
1563
+ const body = stripUndef$6({
1552
1564
  name: name,
1553
1565
  project_list: projectList,
1554
1566
  });
@@ -1681,6 +1693,36 @@ class OauthAuthorization {
1681
1693
  }
1682
1694
  }
1683
1695
 
1696
+ function stripUndef$5(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1697
+
1698
+ class OauthClients {
1699
+ constructor(ctx) { this._ctx = ctx; }
1700
+
1701
+ async createApiCredential(credentialName) {
1702
+ this._ctx.requireTokens();
1703
+ const path = `/oauth/clients/api-credentials`;
1704
+ const body = stripUndef$5({
1705
+ credential_name: credentialName,
1706
+ });
1707
+ const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken, body);
1708
+ return data;
1709
+ }
1710
+
1711
+ async getCompanyApiCredentials() {
1712
+ this._ctx.requireTokens();
1713
+ const path = `/oauth/clients/api-credentials`;
1714
+ const { data } = await this._ctx.client.request(path, 'GET', this._ctx.accessToken, this._ctx.refreshToken);
1715
+ return data;
1716
+ }
1717
+
1718
+ async revokeApiCredential(clientId) {
1719
+ this._ctx.requireTokens();
1720
+ const path = `/oauth/clients/api-credentials/${encodeURIComponent(clientId)}/revoke`;
1721
+ const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken);
1722
+ return data;
1723
+ }
1724
+ }
1725
+
1684
1726
  class OauthToken {
1685
1727
  constructor(ctx) { this._ctx = ctx; }
1686
1728
 
@@ -2531,6 +2573,7 @@ class MediaViz {
2531
2573
  this.health = new Health(_ctx);
2532
2574
  this.keywords = new Keywords(_ctx);
2533
2575
  this.oAuthAuthorization = new OauthAuthorization(_ctx);
2576
+ this.oAuthClients = new OauthClients(_ctx);
2534
2577
  this.oAuthToken = new OauthToken(_ctx);
2535
2578
  this.oauthLogin = new OauthLogin(_ctx);
2536
2579
  this.person = new Person(_ctx);
@@ -2571,4 +2614,4 @@ class MediaViz {
2571
2614
  get refreshToken() { return this._refreshToken; }
2572
2615
  }
2573
2616
 
2574
- export { Admin, AiModelCredits, ApiError, Company, CuratedAlbums, CustomAlbums, EmailTokens, Health, InMemoryWebhookStore, Keywords, MediaViz, NotFoundError, OAuthClient, OAuthError, OAuthErrorCode, OauthAuthorization, OauthLogin, OauthToken, Person, Photos, Photoupload, Projects, RateLimitError, Search, ServerError, Subscription, Users, ValidationError, WEBHOOK_MODEL_COLUMNS, WEBHOOK_OUTCOME_MODELS, WebhookConsumer, Webhookreceiver, configureCrypto, handleResponse, selectResultColumns, signWebhookPayload, verifyWebhookSignature };
2617
+ export { Admin, AiModelCredits, ApiError, Company, CuratedAlbums, CustomAlbums, EmailTokens, Health, InMemoryWebhookStore, Keywords, MediaViz, NotFoundError, OAuthClient, OAuthError, OAuthErrorCode, OauthAuthorization, OauthClients, OauthLogin, OauthToken, Person, Photos, Photoupload, Projects, RateLimitError, Search, ServerError, Subscription, Users, ValidationError, WEBHOOK_MODEL_COLUMNS, WEBHOOK_OUTCOME_MODELS, WebhookConsumer, Webhookreceiver, configureCrypto, handleResponse, selectResultColumns, signWebhookPayload, verifyWebhookSignature };
package/dist/sdk.umd.js CHANGED
@@ -1119,6 +1119,8 @@
1119
1119
  }
1120
1120
  }
1121
1121
 
1122
+ function stripUndef$a(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1123
+
1122
1124
  class Admin {
1123
1125
  constructor(ctx) { this._ctx = ctx; }
1124
1126
 
@@ -1128,6 +1130,16 @@
1128
1130
  const { data } = await this._ctx.client.request(path, 'GET', this._ctx.accessToken, this._ctx.refreshToken);
1129
1131
  return data;
1130
1132
  }
1133
+
1134
+ async adminSetCompanyCanManageApiClients(companyId, canManageApiClients) {
1135
+ this._ctx.requireTokens();
1136
+ const path = `/api/v1/admin/companies/${encodeURIComponent(companyId)}/can_manage_api_clients`;
1137
+ const body = stripUndef$a({
1138
+ can_manage_api_clients: canManageApiClients,
1139
+ });
1140
+ const { data } = await this._ctx.client.request(path, 'PATCH', this._ctx.accessToken, this._ctx.refreshToken, body);
1141
+ return data;
1142
+ }
1131
1143
  }
1132
1144
 
1133
1145
  class Company {
@@ -1153,7 +1165,7 @@
1153
1165
  }
1154
1166
  }
1155
1167
 
1156
- function stripUndef$8(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1168
+ function stripUndef$9(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1157
1169
 
1158
1170
  class CuratedAlbums {
1159
1171
  constructor(ctx) { this._ctx = ctx; }
@@ -1161,7 +1173,7 @@
1161
1173
  async createCuratedAlbum(projectTableName, name, description = undefined, confidenceValue = undefined) {
1162
1174
  this._ctx.requireTokens();
1163
1175
  const path = `/api/v1/curated_album/project/${encodeURIComponent(projectTableName)}`;
1164
- const body = stripUndef$8({
1176
+ const body = stripUndef$9({
1165
1177
  name: name,
1166
1178
  description: description,
1167
1179
  confidence_value: confidenceValue,
@@ -1215,7 +1227,7 @@
1215
1227
  async updateCuratedAlbum(albumId, { name, description, confidenceValue } = {}) {
1216
1228
  this._ctx.requireTokens();
1217
1229
  const path = `/api/v1/curated_album/${encodeURIComponent(albumId)}`;
1218
- const body = stripUndef$8({
1230
+ const body = stripUndef$9({
1219
1231
  name: name,
1220
1232
  description: description,
1221
1233
  confidence_value: confidenceValue,
@@ -1239,7 +1251,7 @@
1239
1251
  }
1240
1252
  }
1241
1253
 
1242
- function stripUndef$7(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1254
+ function stripUndef$8(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1243
1255
 
1244
1256
  class CustomAlbums {
1245
1257
  constructor(ctx) { this._ctx = ctx; }
@@ -1287,7 +1299,7 @@
1287
1299
  async createProjectCustomAlbum(projectTableName, { name, description, photoIdInclusionList, photoIdRemovalList } = {}) {
1288
1300
  this._ctx.requireTokens();
1289
1301
  const path = `/api/v1/custom_album/project/${encodeURIComponent(projectTableName)}`;
1290
- const body = stripUndef$7({
1302
+ const body = stripUndef$8({
1291
1303
  name: name,
1292
1304
  description: description,
1293
1305
  photo_id_inclusion_list: photoIdInclusionList,
@@ -1300,7 +1312,7 @@
1300
1312
  async updateCustomAlbum(albumId, { name, description, photoIdInclusionList, photoIdRemovalList } = {}) {
1301
1313
  this._ctx.requireTokens();
1302
1314
  const path = `/api/v1/custom_album/${encodeURIComponent(albumId)}`;
1303
- const body = stripUndef$7({
1315
+ const body = stripUndef$8({
1304
1316
  name: name,
1305
1317
  description: description,
1306
1318
  photo_id_inclusion_list: photoIdInclusionList,
@@ -1400,7 +1412,7 @@
1400
1412
  }
1401
1413
  }
1402
1414
 
1403
- function stripUndef$6(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1415
+ function stripUndef$7(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1404
1416
 
1405
1417
  class EmailTokens {
1406
1418
  constructor(ctx) { this._ctx = ctx; }
@@ -1431,7 +1443,7 @@
1431
1443
  }
1432
1444
 
1433
1445
  async validateToken(token) {
1434
- const body = stripUndef$6({
1446
+ const body = stripUndef$7({
1435
1447
  token: token,
1436
1448
  });
1437
1449
  const resp = await fetch(this._ctx.baseUrl + `/api/v1/validate-token`, {
@@ -1443,7 +1455,7 @@
1443
1455
  }
1444
1456
 
1445
1457
  async resetPassword(token, newPassword) {
1446
- const body = stripUndef$6({
1458
+ const body = stripUndef$7({
1447
1459
  token: token,
1448
1460
  new_password: newPassword,
1449
1461
  });
@@ -1482,7 +1494,7 @@
1482
1494
  }
1483
1495
  }
1484
1496
 
1485
- function stripUndef$5(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1497
+ function stripUndef$6(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1486
1498
 
1487
1499
  class Keywords {
1488
1500
  constructor(ctx) { this._ctx = ctx; }
@@ -1490,7 +1502,7 @@
1490
1502
  async createKeywordFilteringList(name, projectList = undefined) {
1491
1503
  this._ctx.requireTokens();
1492
1504
  const path = `/api/v1/keyword/`;
1493
- const body = stripUndef$5({
1505
+ const body = stripUndef$6({
1494
1506
  name: name,
1495
1507
  project_list: projectList,
1496
1508
  });
@@ -1543,7 +1555,7 @@
1543
1555
  async updateKeywordFilteringListLabels(keywordListId, listKeywordsToInclude, listKeywordsToExclude) {
1544
1556
  this._ctx.requireTokens();
1545
1557
  const path = `/api/v1/keyword/${encodeURIComponent(keywordListId)}`;
1546
- const body = stripUndef$5({
1558
+ const body = stripUndef$6({
1547
1559
  list_keywords_to_include: listKeywordsToInclude,
1548
1560
  list_keywords_to_exclude: listKeywordsToExclude,
1549
1561
  });
@@ -1554,7 +1566,7 @@
1554
1566
  async updateKeywordFilteringListDetails(keywordListId, { name, projectList } = {}) {
1555
1567
  this._ctx.requireTokens();
1556
1568
  const path = `/api/v1/keyword/details/${encodeURIComponent(keywordListId)}`;
1557
- const body = stripUndef$5({
1569
+ const body = stripUndef$6({
1558
1570
  name: name,
1559
1571
  project_list: projectList,
1560
1572
  });
@@ -1687,6 +1699,36 @@
1687
1699
  }
1688
1700
  }
1689
1701
 
1702
+ function stripUndef$5(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
1703
+
1704
+ class OauthClients {
1705
+ constructor(ctx) { this._ctx = ctx; }
1706
+
1707
+ async createApiCredential(credentialName) {
1708
+ this._ctx.requireTokens();
1709
+ const path = `/oauth/clients/api-credentials`;
1710
+ const body = stripUndef$5({
1711
+ credential_name: credentialName,
1712
+ });
1713
+ const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken, body);
1714
+ return data;
1715
+ }
1716
+
1717
+ async getCompanyApiCredentials() {
1718
+ this._ctx.requireTokens();
1719
+ const path = `/oauth/clients/api-credentials`;
1720
+ const { data } = await this._ctx.client.request(path, 'GET', this._ctx.accessToken, this._ctx.refreshToken);
1721
+ return data;
1722
+ }
1723
+
1724
+ async revokeApiCredential(clientId) {
1725
+ this._ctx.requireTokens();
1726
+ const path = `/oauth/clients/api-credentials/${encodeURIComponent(clientId)}/revoke`;
1727
+ const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken);
1728
+ return data;
1729
+ }
1730
+ }
1731
+
1690
1732
  class OauthToken {
1691
1733
  constructor(ctx) { this._ctx = ctx; }
1692
1734
 
@@ -2537,6 +2579,7 @@
2537
2579
  this.health = new Health(_ctx);
2538
2580
  this.keywords = new Keywords(_ctx);
2539
2581
  this.oAuthAuthorization = new OauthAuthorization(_ctx);
2582
+ this.oAuthClients = new OauthClients(_ctx);
2540
2583
  this.oAuthToken = new OauthToken(_ctx);
2541
2584
  this.oauthLogin = new OauthLogin(_ctx);
2542
2585
  this.person = new Person(_ctx);
@@ -2593,6 +2636,7 @@
2593
2636
  exports.OAuthError = OAuthError;
2594
2637
  exports.OAuthErrorCode = OAuthErrorCode;
2595
2638
  exports.OauthAuthorization = OauthAuthorization;
2639
+ exports.OauthClients = OauthClients;
2596
2640
  exports.OauthLogin = OauthLogin;
2597
2641
  exports.OauthToken = OauthToken;
2598
2642
  exports.Person = Person;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediaviz/sdk",
3
- "version": "1.10.0-rc.8",
3
+ "version": "1.11.0-dev.125",
4
4
  "description": "MediaViz JavaScript SDK \u2014 auto-generated public endpoint client.",
5
5
  "license": "MIT",
6
6
  "repository": {