@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.cjs +57 -13
- package/dist/sdk.d.cts +207 -181
- package/dist/sdk.d.ts +207 -181
- package/dist/sdk.esm.d.ts +207 -181
- package/dist/sdk.esm.js +57 -14
- package/dist/sdk.umd.js +57 -13
- package/package.json +1 -1
package/dist/sdk.cjs
CHANGED
|
@@ -1115,6 +1115,8 @@ class AiModelCredits {
|
|
|
1115
1115
|
}
|
|
1116
1116
|
}
|
|
1117
1117
|
|
|
1118
|
+
function stripUndef$a(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
|
|
1119
|
+
|
|
1118
1120
|
class Admin {
|
|
1119
1121
|
constructor(ctx) { this._ctx = ctx; }
|
|
1120
1122
|
|
|
@@ -1124,6 +1126,16 @@ class Admin {
|
|
|
1124
1126
|
const { data } = await this._ctx.client.request(path, 'GET', this._ctx.accessToken, this._ctx.refreshToken);
|
|
1125
1127
|
return data;
|
|
1126
1128
|
}
|
|
1129
|
+
|
|
1130
|
+
async adminSetCompanyCanManageApiClients(companyId, canManageApiClients) {
|
|
1131
|
+
this._ctx.requireTokens();
|
|
1132
|
+
const path = `/api/v1/admin/companies/${encodeURIComponent(companyId)}/can_manage_api_clients`;
|
|
1133
|
+
const body = stripUndef$a({
|
|
1134
|
+
can_manage_api_clients: canManageApiClients,
|
|
1135
|
+
});
|
|
1136
|
+
const { data } = await this._ctx.client.request(path, 'PATCH', this._ctx.accessToken, this._ctx.refreshToken, body);
|
|
1137
|
+
return data;
|
|
1138
|
+
}
|
|
1127
1139
|
}
|
|
1128
1140
|
|
|
1129
1141
|
class Company {
|
|
@@ -1149,7 +1161,7 @@ class Company {
|
|
|
1149
1161
|
}
|
|
1150
1162
|
}
|
|
1151
1163
|
|
|
1152
|
-
function stripUndef$
|
|
1164
|
+
function stripUndef$9(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
|
|
1153
1165
|
|
|
1154
1166
|
class CuratedAlbums {
|
|
1155
1167
|
constructor(ctx) { this._ctx = ctx; }
|
|
@@ -1157,7 +1169,7 @@ class CuratedAlbums {
|
|
|
1157
1169
|
async createCuratedAlbum(projectTableName, name, description = undefined, confidenceValue = undefined) {
|
|
1158
1170
|
this._ctx.requireTokens();
|
|
1159
1171
|
const path = `/api/v1/curated_album/project/${encodeURIComponent(projectTableName)}`;
|
|
1160
|
-
const body = stripUndef$
|
|
1172
|
+
const body = stripUndef$9({
|
|
1161
1173
|
name: name,
|
|
1162
1174
|
description: description,
|
|
1163
1175
|
confidence_value: confidenceValue,
|
|
@@ -1211,7 +1223,7 @@ class CuratedAlbums {
|
|
|
1211
1223
|
async updateCuratedAlbum(albumId, { name, description, confidenceValue } = {}) {
|
|
1212
1224
|
this._ctx.requireTokens();
|
|
1213
1225
|
const path = `/api/v1/curated_album/${encodeURIComponent(albumId)}`;
|
|
1214
|
-
const body = stripUndef$
|
|
1226
|
+
const body = stripUndef$9({
|
|
1215
1227
|
name: name,
|
|
1216
1228
|
description: description,
|
|
1217
1229
|
confidence_value: confidenceValue,
|
|
@@ -1235,7 +1247,7 @@ class CuratedAlbums {
|
|
|
1235
1247
|
}
|
|
1236
1248
|
}
|
|
1237
1249
|
|
|
1238
|
-
function stripUndef$
|
|
1250
|
+
function stripUndef$8(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
|
|
1239
1251
|
|
|
1240
1252
|
class CustomAlbums {
|
|
1241
1253
|
constructor(ctx) { this._ctx = ctx; }
|
|
@@ -1283,7 +1295,7 @@ class CustomAlbums {
|
|
|
1283
1295
|
async createProjectCustomAlbum(projectTableName, { name, description, photoIdInclusionList, photoIdRemovalList } = {}) {
|
|
1284
1296
|
this._ctx.requireTokens();
|
|
1285
1297
|
const path = `/api/v1/custom_album/project/${encodeURIComponent(projectTableName)}`;
|
|
1286
|
-
const body = stripUndef$
|
|
1298
|
+
const body = stripUndef$8({
|
|
1287
1299
|
name: name,
|
|
1288
1300
|
description: description,
|
|
1289
1301
|
photo_id_inclusion_list: photoIdInclusionList,
|
|
@@ -1296,7 +1308,7 @@ class CustomAlbums {
|
|
|
1296
1308
|
async updateCustomAlbum(albumId, { name, description, photoIdInclusionList, photoIdRemovalList } = {}) {
|
|
1297
1309
|
this._ctx.requireTokens();
|
|
1298
1310
|
const path = `/api/v1/custom_album/${encodeURIComponent(albumId)}`;
|
|
1299
|
-
const body = stripUndef$
|
|
1311
|
+
const body = stripUndef$8({
|
|
1300
1312
|
name: name,
|
|
1301
1313
|
description: description,
|
|
1302
1314
|
photo_id_inclusion_list: photoIdInclusionList,
|
|
@@ -1396,7 +1408,7 @@ async function handleResponse(response) {
|
|
|
1396
1408
|
}
|
|
1397
1409
|
}
|
|
1398
1410
|
|
|
1399
|
-
function stripUndef$
|
|
1411
|
+
function stripUndef$7(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
|
|
1400
1412
|
|
|
1401
1413
|
class EmailTokens {
|
|
1402
1414
|
constructor(ctx) { this._ctx = ctx; }
|
|
@@ -1427,7 +1439,7 @@ class EmailTokens {
|
|
|
1427
1439
|
}
|
|
1428
1440
|
|
|
1429
1441
|
async validateToken(token) {
|
|
1430
|
-
const body = stripUndef$
|
|
1442
|
+
const body = stripUndef$7({
|
|
1431
1443
|
token: token,
|
|
1432
1444
|
});
|
|
1433
1445
|
const resp = await fetch(this._ctx.baseUrl + `/api/v1/validate-token`, {
|
|
@@ -1439,7 +1451,7 @@ class EmailTokens {
|
|
|
1439
1451
|
}
|
|
1440
1452
|
|
|
1441
1453
|
async resetPassword(token, newPassword) {
|
|
1442
|
-
const body = stripUndef$
|
|
1454
|
+
const body = stripUndef$7({
|
|
1443
1455
|
token: token,
|
|
1444
1456
|
new_password: newPassword,
|
|
1445
1457
|
});
|
|
@@ -1478,7 +1490,7 @@ class Health {
|
|
|
1478
1490
|
}
|
|
1479
1491
|
}
|
|
1480
1492
|
|
|
1481
|
-
function stripUndef$
|
|
1493
|
+
function stripUndef$6(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
|
|
1482
1494
|
|
|
1483
1495
|
class Keywords {
|
|
1484
1496
|
constructor(ctx) { this._ctx = ctx; }
|
|
@@ -1486,7 +1498,7 @@ class Keywords {
|
|
|
1486
1498
|
async createKeywordFilteringList(name, projectList = undefined) {
|
|
1487
1499
|
this._ctx.requireTokens();
|
|
1488
1500
|
const path = `/api/v1/keyword/`;
|
|
1489
|
-
const body = stripUndef$
|
|
1501
|
+
const body = stripUndef$6({
|
|
1490
1502
|
name: name,
|
|
1491
1503
|
project_list: projectList,
|
|
1492
1504
|
});
|
|
@@ -1539,7 +1551,7 @@ class Keywords {
|
|
|
1539
1551
|
async updateKeywordFilteringListLabels(keywordListId, listKeywordsToInclude, listKeywordsToExclude) {
|
|
1540
1552
|
this._ctx.requireTokens();
|
|
1541
1553
|
const path = `/api/v1/keyword/${encodeURIComponent(keywordListId)}`;
|
|
1542
|
-
const body = stripUndef$
|
|
1554
|
+
const body = stripUndef$6({
|
|
1543
1555
|
list_keywords_to_include: listKeywordsToInclude,
|
|
1544
1556
|
list_keywords_to_exclude: listKeywordsToExclude,
|
|
1545
1557
|
});
|
|
@@ -1550,7 +1562,7 @@ class Keywords {
|
|
|
1550
1562
|
async updateKeywordFilteringListDetails(keywordListId, { name, projectList } = {}) {
|
|
1551
1563
|
this._ctx.requireTokens();
|
|
1552
1564
|
const path = `/api/v1/keyword/details/${encodeURIComponent(keywordListId)}`;
|
|
1553
|
-
const body = stripUndef$
|
|
1565
|
+
const body = stripUndef$6({
|
|
1554
1566
|
name: name,
|
|
1555
1567
|
project_list: projectList,
|
|
1556
1568
|
});
|
|
@@ -1683,6 +1695,36 @@ class OauthAuthorization {
|
|
|
1683
1695
|
}
|
|
1684
1696
|
}
|
|
1685
1697
|
|
|
1698
|
+
function stripUndef$5(o) { const r = {}; for (const k in o) if (o[k] !== undefined) r[k] = o[k]; return r; }
|
|
1699
|
+
|
|
1700
|
+
class OauthClients {
|
|
1701
|
+
constructor(ctx) { this._ctx = ctx; }
|
|
1702
|
+
|
|
1703
|
+
async createApiCredential(credentialName) {
|
|
1704
|
+
this._ctx.requireTokens();
|
|
1705
|
+
const path = `/oauth/clients/api-credentials`;
|
|
1706
|
+
const body = stripUndef$5({
|
|
1707
|
+
credential_name: credentialName,
|
|
1708
|
+
});
|
|
1709
|
+
const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken, body);
|
|
1710
|
+
return data;
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
async getCompanyApiCredentials() {
|
|
1714
|
+
this._ctx.requireTokens();
|
|
1715
|
+
const path = `/oauth/clients/api-credentials`;
|
|
1716
|
+
const { data } = await this._ctx.client.request(path, 'GET', this._ctx.accessToken, this._ctx.refreshToken);
|
|
1717
|
+
return data;
|
|
1718
|
+
}
|
|
1719
|
+
|
|
1720
|
+
async revokeApiCredential(clientId) {
|
|
1721
|
+
this._ctx.requireTokens();
|
|
1722
|
+
const path = `/oauth/clients/api-credentials/${encodeURIComponent(clientId)}/revoke`;
|
|
1723
|
+
const { data } = await this._ctx.client.request(path, 'POST', this._ctx.accessToken, this._ctx.refreshToken);
|
|
1724
|
+
return data;
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1686
1728
|
class OauthToken {
|
|
1687
1729
|
constructor(ctx) { this._ctx = ctx; }
|
|
1688
1730
|
|
|
@@ -2533,6 +2575,7 @@ class MediaViz {
|
|
|
2533
2575
|
this.health = new Health(_ctx);
|
|
2534
2576
|
this.keywords = new Keywords(_ctx);
|
|
2535
2577
|
this.oAuthAuthorization = new OauthAuthorization(_ctx);
|
|
2578
|
+
this.oAuthClients = new OauthClients(_ctx);
|
|
2536
2579
|
this.oAuthToken = new OauthToken(_ctx);
|
|
2537
2580
|
this.oauthLogin = new OauthLogin(_ctx);
|
|
2538
2581
|
this.person = new Person(_ctx);
|
|
@@ -2589,6 +2632,7 @@ exports.OAuthClient = OAuthClient;
|
|
|
2589
2632
|
exports.OAuthError = OAuthError;
|
|
2590
2633
|
exports.OAuthErrorCode = OAuthErrorCode;
|
|
2591
2634
|
exports.OauthAuthorization = OauthAuthorization;
|
|
2635
|
+
exports.OauthClients = OauthClients;
|
|
2592
2636
|
exports.OauthLogin = OauthLogin;
|
|
2593
2637
|
exports.OauthToken = OauthToken;
|
|
2594
2638
|
exports.Person = Person;
|