@nomad-media/full 1.1.15 → 1.1.17
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/nomad-media-sdk-debug.js +194 -213
- package/dist/nomad-media-sdk.min.js +3 -3
- package/package.json +1 -1
|
@@ -286,6 +286,11 @@ class NomadMediaSDK {
|
|
|
286
286
|
this.id = null
|
|
287
287
|
this.debugMode = config.debugMode || false;
|
|
288
288
|
|
|
289
|
+
if (this.config.serviceApiUrl[this.config.serviceApiUrl.length - 1] === "/")
|
|
290
|
+
{
|
|
291
|
+
this.config.serviceApiUrl = this.config.serviceApiUrl.slice(0, -1);
|
|
292
|
+
}
|
|
293
|
+
|
|
289
294
|
NomadMediaSDK.instance = this;
|
|
290
295
|
|
|
291
296
|
return this;
|
|
@@ -303,9 +308,6 @@ class NomadMediaSDK {
|
|
|
303
308
|
async _init()
|
|
304
309
|
{
|
|
305
310
|
await this.login();
|
|
306
|
-
|
|
307
|
-
// Schedule token refresh
|
|
308
|
-
this.__scheduleTokenRefresh();
|
|
309
311
|
}
|
|
310
312
|
|
|
311
313
|
// account functions
|
|
@@ -328,7 +330,7 @@ class NomadMediaSDK {
|
|
|
328
330
|
this.config.serviceApiUrl, this.debugMode);
|
|
329
331
|
this.token = LOGIN_INFO["token"];
|
|
330
332
|
this.refreshTokenVal = LOGIN_INFO["refreshToken"];
|
|
331
|
-
this.expirationSeconds =
|
|
333
|
+
this.expirationSeconds = LOGIN_INFO["expirationSeconds"];
|
|
332
334
|
this.userSessionId = LOGIN_INFO["userSessionId"];
|
|
333
335
|
this.id = LOGIN_INFO["id"];
|
|
334
336
|
_printDatetime(`Login successful`);
|
|
@@ -388,10 +390,9 @@ class NomadMediaSDK {
|
|
|
388
390
|
|
|
389
391
|
try
|
|
390
392
|
{
|
|
391
|
-
const
|
|
393
|
+
const REFRESHED = await _refreshToken(this, this.token, this.config.serviceApiUrl,
|
|
392
394
|
this.refreshTokenVal, this.debugMode);
|
|
393
|
-
|
|
394
|
-
_printDatetime(`Token refresh successful`);
|
|
395
|
+
if (REFRESHED) _printDatetime(`Token refresh successful`);
|
|
395
396
|
}
|
|
396
397
|
catch (error)
|
|
397
398
|
{
|
|
@@ -400,31 +401,6 @@ class NomadMediaSDK {
|
|
|
400
401
|
}
|
|
401
402
|
}
|
|
402
403
|
|
|
403
|
-
/**
|
|
404
|
-
* @function scheduleTokenRefresh
|
|
405
|
-
* @private
|
|
406
|
-
* @description Schedules a token refresh for the duration set by the value returned in the login.
|
|
407
|
-
* @returns {Promise<void>} - A promise that resolves when the token is refreshed.
|
|
408
|
-
* Updates the token class variable.
|
|
409
|
-
* @throws {Error} - An error is thrown if the token refresh fails.
|
|
410
|
-
*/
|
|
411
|
-
__scheduleTokenRefresh() {
|
|
412
|
-
if (this.token && this.expirationSeconds) {
|
|
413
|
-
const remainingTime = this.expirationSeconds - Date.now();
|
|
414
|
-
if (remainingTime > 0) {
|
|
415
|
-
// Clear existing timer (if any)
|
|
416
|
-
if (this.refreshTimer) {
|
|
417
|
-
clearTimeout(this.refreshTimer);
|
|
418
|
-
}
|
|
419
|
-
// Schedule a refresh slightly before token expiration
|
|
420
|
-
this.refreshTimer = setTimeout(async () => {
|
|
421
|
-
await this.refreshToken();
|
|
422
|
-
this.__scheduleTokenRefresh();
|
|
423
|
-
}, remainingTime - 5000); // Refresh 5 seconds before expiration
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
|
|
428
404
|
/**
|
|
429
405
|
* @function forgotPassword
|
|
430
406
|
* @async
|
|
@@ -670,7 +646,7 @@ class NomadMediaSDK {
|
|
|
670
646
|
{
|
|
671
647
|
const AUDIT_INFO = await _getAudit(this, this.token, this.config.serviceApiUrl, CONTENT_ID,
|
|
672
648
|
this.debugMode);
|
|
673
|
-
_printDatetime(`Audit retrieved for ${CONTENT_ID}`);
|
|
649
|
+
if (AUDIT_INFO) _printDatetime(`Audit retrieved for ${CONTENT_ID}`);
|
|
674
650
|
return AUDIT_INFO;
|
|
675
651
|
}
|
|
676
652
|
catch (error)
|
|
@@ -745,7 +721,7 @@ class NomadMediaSDK {
|
|
|
745
721
|
{
|
|
746
722
|
const CONFIG_INFO = await _getConfig(this, this.token, this.config.serviceApiUrl, CONFIG_TYPE,
|
|
747
723
|
this.debugMode);
|
|
748
|
-
_printDatetime(`Config retrieved`);
|
|
724
|
+
if (CONFIG_INFO) _printDatetime(`Config retrieved`);
|
|
749
725
|
return CONFIG_INFO;
|
|
750
726
|
}
|
|
751
727
|
catch (error)
|
|
@@ -782,7 +758,7 @@ class NomadMediaSDK {
|
|
|
782
758
|
{
|
|
783
759
|
const SERVER_TIME_INFO = await _getServerTime(this, this.token, this.config.serviceApiUrl,
|
|
784
760
|
this.debugMode);
|
|
785
|
-
_printDatetime(`Server time retrieved`);
|
|
761
|
+
if (SERVER_TIME_INFO) _printDatetime(`Server time retrieved`);
|
|
786
762
|
return SERVER_TIME_INFO;
|
|
787
763
|
}
|
|
788
764
|
catch (error)
|
|
@@ -823,7 +799,7 @@ class NomadMediaSDK {
|
|
|
823
799
|
{
|
|
824
800
|
const CREATE_CONTENT_INFO = await _createContent(this, this.token, this.config.serviceApiUrl,
|
|
825
801
|
CONTENT_DEFINITION_ID, LANGUAGE_ID, this.debugMode);
|
|
826
|
-
_printDatetime(`Content created: ${CREATE_CONTENT_INFO["contentId"]}`);
|
|
802
|
+
if (CREATE_CONTENT_INFO) _printDatetime(`Content created: ${CREATE_CONTENT_INFO["contentId"]}`);
|
|
827
803
|
return CREATE_CONTENT_INFO;
|
|
828
804
|
}
|
|
829
805
|
catch (error)
|
|
@@ -942,7 +918,7 @@ class NomadMediaSDK {
|
|
|
942
918
|
{
|
|
943
919
|
const GET_CONTENT_INFO = await _getContent(this, this.token, this.config.serviceApiUrl,
|
|
944
920
|
CONTENT_ID, CONTENT_DEFINITION_ID, IS_REVISION, this.debugMode);
|
|
945
|
-
_printDatetime(`Content retrieved: ${CONTENT_ID}`);
|
|
921
|
+
if (GET_CONTENT_INFO) _printDatetime(`Content retrieved: ${CONTENT_ID}`);
|
|
946
922
|
return GET_CONTENT_INFO;
|
|
947
923
|
}
|
|
948
924
|
catch (error)
|
|
@@ -991,7 +967,7 @@ class NomadMediaSDK {
|
|
|
991
967
|
const CONTENT_USER_TRACK_INFO = await _getContentUserTrack(this, this.token,
|
|
992
968
|
this.config.serviceApiUrl, CONTENT_ID, CONTENT_DEFINITION_ID, SORT_COLUMN, IS_DESC,
|
|
993
969
|
PAGE_INDEX, PAGE_SIZE, this.debugMode);
|
|
994
|
-
_printDatetime(`Content user track retrieved: ${CONTENT_ID}`);
|
|
970
|
+
if (CONTENT_USER_TRACK_INFO) _printDatetime(`Content user track retrieved: ${CONTENT_ID}`);
|
|
995
971
|
return CONTENT_USER_TRACK_INFO;
|
|
996
972
|
}
|
|
997
973
|
catch (error)
|
|
@@ -1030,7 +1006,7 @@ class NomadMediaSDK {
|
|
|
1030
1006
|
{
|
|
1031
1007
|
const CONTENT_USER_TRACK_TOUCH_INFO = await _getContentUserTrackTouch(this, this.token,
|
|
1032
1008
|
this.config.serviceApiUrl, CONTENT_ID, CONTENT_DEFINITION_ID, this.debugMode);
|
|
1033
|
-
_printDatetime(`Content user track touch retrieved: ${CONTENT_ID}`);
|
|
1009
|
+
if (CONTENT_USER_TRACK_TOUCH_INFO) _printDatetime(`Content user track touch retrieved: ${CONTENT_ID}`);
|
|
1034
1010
|
return CONTENT_USER_TRACK_TOUCH_INFO;
|
|
1035
1011
|
}
|
|
1036
1012
|
catch (error)
|
|
@@ -1115,7 +1091,7 @@ class NomadMediaSDK {
|
|
|
1115
1091
|
const ADD_CUSTOM_PROPERTIES_INFO = await _addCustomProperties(this, this.token,
|
|
1116
1092
|
this.config.serviceApiUrl, CONTENT_ID, NAME, DATE, CUSTOM_PROPERTIES,
|
|
1117
1093
|
this.debugMode);
|
|
1118
|
-
_printDatetime(`Custom properties added to content: ${CONTENT_ID}`);
|
|
1094
|
+
if (ADD_CUSTOM_PROPERTIES_INFO) _printDatetime(`Custom properties added to content: ${CONTENT_ID}`);
|
|
1119
1095
|
return ADD_CUSTOM_PROPERTIES_INFO;
|
|
1120
1096
|
}
|
|
1121
1097
|
catch (error)
|
|
@@ -1150,7 +1126,7 @@ class NomadMediaSDK {
|
|
|
1150
1126
|
const ADD_RELATED_CONTENT_INFO = await _addRelatedContent(this, this.token,
|
|
1151
1127
|
this.config.serviceApiUrl, CONTENT_ID, RELATED_CONTENT_ID, CONTENT_DEFINITION,
|
|
1152
1128
|
this.config.apiType, this.debugMode);
|
|
1153
|
-
_printDatetime(`Related content added to content: ${CONTENT_ID}`);
|
|
1129
|
+
if (ADD_RELATED_CONTENT_INFO) _printDatetime(`Related content added to content: ${CONTENT_ID}`);
|
|
1154
1130
|
return ADD_RELATED_CONTENT_INFO.items[0];
|
|
1155
1131
|
}
|
|
1156
1132
|
catch (error)
|
|
@@ -1189,7 +1165,7 @@ class NomadMediaSDK {
|
|
|
1189
1165
|
const ADD_TAG_OR_COLLECTION_INFO = await _addTagOrCollection(this, this.token,
|
|
1190
1166
|
this.config.serviceApiUrl, TYPE, CONTENT_ID, CONTENT_DEFINITION, TAG_NAME,
|
|
1191
1167
|
TAG_ID, CREATE_NEW, this.config.apiType, this.debugMode);
|
|
1192
|
-
_printDatetime(`${TYPE} added to content: ${CONTENT_ID}`);
|
|
1168
|
+
if (ADD_TAG_OR_COLLECTION_INFO) _printDatetime(`${TYPE} added to content: ${CONTENT_ID}`);
|
|
1193
1169
|
return ADD_TAG_OR_COLLECTION_INFO.items[0];
|
|
1194
1170
|
}
|
|
1195
1171
|
catch (error)
|
|
@@ -1269,7 +1245,7 @@ class NomadMediaSDK {
|
|
|
1269
1245
|
{
|
|
1270
1246
|
const CREATE_TAG_OR_COLLECTION_INFO = await _createTagOrCollection(this, this.token,
|
|
1271
1247
|
this.config.serviceApiUrl, TYPE, TAG_NAME, this.debugMode);
|
|
1272
|
-
_printDatetime(`${TYPE} created: ${TAG_NAME}`);
|
|
1248
|
+
if (CREATE_TAG_OR_COLLECTION_INFO) _printDatetime(`${TYPE} created: ${TAG_NAME}`);
|
|
1273
1249
|
return CREATE_TAG_OR_COLLECTION_INFO;
|
|
1274
1250
|
}
|
|
1275
1251
|
catch (error)
|
|
@@ -1304,7 +1280,7 @@ class NomadMediaSDK {
|
|
|
1304
1280
|
const DELETE_RELATED_CONTENT_INFO = await _deleteRelatedContent(this, this.token,
|
|
1305
1281
|
this.config.serviceApiUrl, CONTENT_ID, RELATED_CONTENT_ID, CONTENT_DEFINITION,
|
|
1306
1282
|
this.config.apiType, this.debugMode);
|
|
1307
|
-
_printDatetime(`Related content deleted from content: ${CONTENT_ID}`);
|
|
1283
|
+
if (DELETE_RELATED_CONTENT_INFO) _printDatetime(`Related content deleted from content: ${CONTENT_ID}`);
|
|
1308
1284
|
return DELETE_RELATED_CONTENT_INFO.items[0];
|
|
1309
1285
|
}
|
|
1310
1286
|
catch (error)
|
|
@@ -1343,7 +1319,7 @@ class NomadMediaSDK {
|
|
|
1343
1319
|
{
|
|
1344
1320
|
const DELETE_TAG_OR_COLLECTION_INFO = await _deleteTagOrCollection(this, this.token,
|
|
1345
1321
|
this.config.serviceApiUrl, TYPE, TAG_ID, this.debugMode);
|
|
1346
|
-
_printDatetime(`Tag or collection deleted: ${TAG_ID}`);
|
|
1322
|
+
if (DELETE_TAG_OR_COLLECTION_INFO) _printDatetime(`Tag or collection deleted: ${TAG_ID}`);
|
|
1347
1323
|
return DELETE_TAG_OR_COLLECTION_INFO;
|
|
1348
1324
|
}
|
|
1349
1325
|
catch (error)
|
|
@@ -1377,7 +1353,7 @@ class NomadMediaSDK {
|
|
|
1377
1353
|
{
|
|
1378
1354
|
const GET_TAG_OR_COLLECTION_INFO = await _getTagOrCollection(this, this.token,
|
|
1379
1355
|
this.config.serviceApiUrl, TYPE, ID, this.debugMode);
|
|
1380
|
-
_printDatetime(`${TYPE} retrieved: ${ID}`);
|
|
1356
|
+
if (GET_TAG_OR_COLLECTION_INFO) _printDatetime(`${TYPE} retrieved: ${ID}`);
|
|
1381
1357
|
return GET_TAG_OR_COLLECTION_INFO;
|
|
1382
1358
|
}
|
|
1383
1359
|
catch (error)
|
|
@@ -1413,7 +1389,7 @@ class NomadMediaSDK {
|
|
|
1413
1389
|
const REMOVE_TAG_OR_COLLECTION_INFO = await _removeTagOrCollection(this, this.token,
|
|
1414
1390
|
this.config.serviceApiUrl, TYPE, CONTENT_ID, CONTENT_DEFINITION, TAG_ID,
|
|
1415
1391
|
this.config.apiType, this.debugMode);
|
|
1416
|
-
_printDatetime(`${TYPE} removed from content: ${CONTENT_ID}`);
|
|
1392
|
+
if (REMOVE_TAG_OR_COLLECTION_INFO) _printDatetime(`${TYPE} removed from content: ${CONTENT_ID}`);
|
|
1417
1393
|
return REMOVE_TAG_OR_COLLECTION_INFO;
|
|
1418
1394
|
}
|
|
1419
1395
|
catch (error)
|
|
@@ -1451,7 +1427,7 @@ class NomadMediaSDK {
|
|
|
1451
1427
|
{
|
|
1452
1428
|
const CREATE_CONTENT_DEFINITION_INFO = await _createContentDefinition(this, this.token,
|
|
1453
1429
|
this.config.serviceApiUrl, this.debugMode);
|
|
1454
|
-
_printDatetime(`Content definition created: ${CREATE_CONTENT_DEFINITION_INFO["id"]}`);
|
|
1430
|
+
if (CREATE_CONTENT_DEFINITION_INFO) _printDatetime(`Content definition created: ${CREATE_CONTENT_DEFINITION_INFO["id"]}`);
|
|
1455
1431
|
return CREATE_CONTENT_DEFINITION_INFO;
|
|
1456
1432
|
}
|
|
1457
1433
|
catch (error)
|
|
@@ -1489,7 +1465,7 @@ class NomadMediaSDK {
|
|
|
1489
1465
|
{
|
|
1490
1466
|
const GET_CONTENT_DEFINITION_INFO = await _getContentDefinition(this, this.token,
|
|
1491
1467
|
this.config.serviceApiUrl, CONTENT_DEFINITION_ID, this.debugMode);
|
|
1492
|
-
_printDatetime(`Content definition retrieved: ${CONTENT_DEFINITION_ID}`);
|
|
1468
|
+
if (GET_CONTENT_DEFINITION_INFO) _printDatetime(`Content definition retrieved: ${CONTENT_DEFINITION_ID}`);
|
|
1493
1469
|
return GET_CONTENT_DEFINITION_INFO;
|
|
1494
1470
|
}
|
|
1495
1471
|
catch (error)
|
|
@@ -1533,7 +1509,7 @@ class NomadMediaSDK {
|
|
|
1533
1509
|
const GET_CONTENT_DEFINITIONS_INFO = await _getContentDefinitions(this, this.token,
|
|
1534
1510
|
this.config.serviceApiUrl, CONTENT_MANAGEMENT_TYPE, SORT_COLUMN, IS_DESC,
|
|
1535
1511
|
PAGE_INDEX, PAGE_SIZE, this.debugMode);
|
|
1536
|
-
_printDatetime(`Content definitions retrieved`);
|
|
1512
|
+
if (GET_CONTENT_DEFINITIONS_INFO) _printDatetime(`Content definitions retrieved`);
|
|
1537
1513
|
return GET_CONTENT_DEFINITIONS_INFO;
|
|
1538
1514
|
}
|
|
1539
1515
|
catch (error)
|
|
@@ -1642,7 +1618,7 @@ class NomadMediaSDK {
|
|
|
1642
1618
|
this.config.serviceApiUrl, CONTENT_ID, CONTENT_DEFINITION_ID,
|
|
1643
1619
|
NAME, START_DATETIME, END_DATETIME, EVENT_TYPE, SERIES, IS_DISABLED,
|
|
1644
1620
|
OVERRIDE_SERIES_PROPERTIES, SERIES_PROPERTIES, this.debugMode);
|
|
1645
|
-
_printDatetime(`Event created/updated`);
|
|
1621
|
+
if (CREATE_EVENT_INFO) _printDatetime(`Event created/updated`);
|
|
1646
1622
|
return CREATE_EVENT_INFO;
|
|
1647
1623
|
}
|
|
1648
1624
|
catch (error)
|
|
@@ -1810,7 +1786,7 @@ class NomadMediaSDK {
|
|
|
1810
1786
|
{
|
|
1811
1787
|
const GET_LIVE_SCHEDULE_INFO = await _getLiveSchedule(this, this.token,
|
|
1812
1788
|
this.config.serviceApiUrl, EVENT_ID, this.debugMode);
|
|
1813
|
-
_printDatetime(`Live Schedule retrieved of Event: ${EVENT_ID}`);
|
|
1789
|
+
if (GET_LIVE_SCHEDULE_INFO) _printDatetime(`Live Schedule retrieved of Event: ${EVENT_ID}`);
|
|
1814
1790
|
return GET_LIVE_SCHEDULE_INFO;
|
|
1815
1791
|
}
|
|
1816
1792
|
catch (error)
|
|
@@ -1927,7 +1903,7 @@ class NomadMediaSDK {
|
|
|
1927
1903
|
this.config.serviceApiUrl, LIVE_CHANNEL_ID, START_TIME_CODE, END_TIME_CODE, TITLE,
|
|
1928
1904
|
OUTPUT_FOLDER_ID, TAGS, COLLECTIONS, RELATED_CONTENTS, VIDEO_BITRATE, AUDIO_TRACKS,
|
|
1929
1905
|
this.debugMode);
|
|
1930
|
-
_printDatetime(`Live Channel clipped: ${LIVE_CHANNEL_ID}`);
|
|
1906
|
+
if (CLIP_LIVE_CHANNEL_INFO) _printDatetime(`Live Channel clipped: ${LIVE_CHANNEL_ID}`);
|
|
1931
1907
|
}
|
|
1932
1908
|
catch (error)
|
|
1933
1909
|
{
|
|
@@ -1983,7 +1959,7 @@ class NomadMediaSDK {
|
|
|
1983
1959
|
ENABLE_HIGH_AVAILABILITY, ENABLE_LIVE_CLIPPING, IS_SECURE_OUTPUT,
|
|
1984
1960
|
IS_OUTPUT_SCREENSHOTS, TYPE, EXTERNAL_SERVICE_API_URL, EXTERNAL_OUTPUT_PROFILES,
|
|
1985
1961
|
SECURITY_GROUPS, this.debugMode);
|
|
1986
|
-
_printDatetime(`Live Channel created: ${CREATE_LIVE_CHANNEL_INFO["id"]}`);
|
|
1962
|
+
if (CREATE_LIVE_CHANNEL_INFO) _printDatetime(`Live Channel created: ${CREATE_LIVE_CHANNEL_INFO["id"]}`);
|
|
1987
1963
|
return CREATE_LIVE_CHANNEL_INFO;
|
|
1988
1964
|
}
|
|
1989
1965
|
catch (error)
|
|
@@ -2058,7 +2034,7 @@ class NomadMediaSDK {
|
|
|
2058
2034
|
{
|
|
2059
2035
|
const GET_LIVE_CHANNEL_INFO = await _getLiveChannel(this, this.token, this.config.serviceApiUrl,
|
|
2060
2036
|
LIVE_CHANNEL_ID, this.debugMode);
|
|
2061
|
-
_printDatetime(`Live Channel gotten: ${LIVE_CHANNEL_ID}`);
|
|
2037
|
+
if (GET_LIVE_CHANNEL_INFO) _printDatetime(`Live Channel gotten: ${LIVE_CHANNEL_ID}`);
|
|
2062
2038
|
return GET_LIVE_CHANNEL_INFO;
|
|
2063
2039
|
}
|
|
2064
2040
|
catch (error)
|
|
@@ -2095,7 +2071,7 @@ class NomadMediaSDK {
|
|
|
2095
2071
|
{
|
|
2096
2072
|
const GET_LIVE_CHANNELS_INFO = await _getLiveChannels(this, this.token,
|
|
2097
2073
|
this.config.serviceApiUrl, this.debugMode);
|
|
2098
|
-
_printDatetime(`Live Channels gotten`);
|
|
2074
|
+
if (GET_LIVE_CHANNELS_INFO) _printDatetime(`Live Channels gotten`);
|
|
2099
2075
|
return GET_LIVE_CHANNELS_INFO;
|
|
2100
2076
|
}
|
|
2101
2077
|
catch (error)
|
|
@@ -2166,7 +2142,7 @@ class NomadMediaSDK {
|
|
|
2166
2142
|
{
|
|
2167
2143
|
const NEXT_EVENT_INFO = await _nextEvent(this, this.token, this.config.serviceApiUrl,
|
|
2168
2144
|
LIVE_CHANNEL_ID, this.debugMode);
|
|
2169
|
-
_printDatetime(`Next Event gotten of Live Channel: ${LIVE_CHANNEL_ID}`);
|
|
2145
|
+
if (NEXT_EVENT_INFO) _printDatetime(`Next Event gotten of Live Channel: ${LIVE_CHANNEL_ID}`);
|
|
2170
2146
|
return NEXT_EVENT_INFO;
|
|
2171
2147
|
}
|
|
2172
2148
|
catch (error)
|
|
@@ -2334,7 +2310,7 @@ class NomadMediaSDK {
|
|
|
2334
2310
|
ARCHIVE_FOLDER_ASSET_ID, ENABLE_HIGH_AVAILABILITY, ENABLE_LIVE_CLIPPING, IS_SECURE_OUTPUT,
|
|
2335
2311
|
IS_OUTPUT_SCREENSHOTS, TYPE, EXTERNAL_SERVICE_API_URL, EXTERNAL_OUTPUT_PROFILES,
|
|
2336
2312
|
SECURITY_GROUPS, this.debugMode);
|
|
2337
|
-
_printDatetime(`Live Channel updated: ${LIVE_CHANNEL_ID}`);
|
|
2313
|
+
if (UPDATE_LIVE_CHANNEL_INFO) _printDatetime(`Live Channel updated: ${LIVE_CHANNEL_ID}`);
|
|
2338
2314
|
return UPDATE_LIVE_CHANNEL_INFO;
|
|
2339
2315
|
}
|
|
2340
2316
|
catch (error)
|
|
@@ -2385,7 +2361,7 @@ class NomadMediaSDK {
|
|
|
2385
2361
|
const CREATE_LIVE_INPUT_INFO = await _createLiveInput(this, this.token,
|
|
2386
2362
|
this.config.serviceApiUrl, NAME, SOURCE, TYPE, IS_STANDARD, VIDEO_ASSET_ID,
|
|
2387
2363
|
DESTINATIONS, SOURCES, this.debugMode);
|
|
2388
|
-
_printDatetime(`Live Input created: ${CREATE_LIVE_INPUT_INFO["id"]}`);
|
|
2364
|
+
if (CREATE_LIVE_INPUT_INFO) _printDatetime(`Live Input created: ${CREATE_LIVE_INPUT_INFO["id"]}`);
|
|
2389
2365
|
return CREATE_LIVE_INPUT_INFO;
|
|
2390
2366
|
}
|
|
2391
2367
|
catch (error)
|
|
@@ -2459,7 +2435,7 @@ class NomadMediaSDK {
|
|
|
2459
2435
|
{
|
|
2460
2436
|
const GET_LIVE_INPUT_INFO = await _getLiveInput(this, this.token, this.config.serviceApiUrl,
|
|
2461
2437
|
LIVE_INPUT_ID, this.debugMode);
|
|
2462
|
-
_printDatetime(`Live Input gotten: ${LIVE_INPUT_ID}`);
|
|
2438
|
+
if (GET_LIVE_INPUT_INFO) _printDatetime(`Live Input gotten: ${LIVE_INPUT_ID}`);
|
|
2463
2439
|
return GET_LIVE_INPUT_INFO;
|
|
2464
2440
|
}
|
|
2465
2441
|
catch (error)
|
|
@@ -2496,7 +2472,7 @@ class NomadMediaSDK {
|
|
|
2496
2472
|
{
|
|
2497
2473
|
const GET_LIVE_INPUTS_INFO = await _getLiveInputs(this, this.token, this.config.serviceApiUrl,
|
|
2498
2474
|
this.debugMode);
|
|
2499
|
-
_printDatetime(`Live Inputs gotten`);
|
|
2475
|
+
if (GET_LIVE_INPUTS_INFO) _printDatetime(`Live Inputs gotten`);
|
|
2500
2476
|
return GET_LIVE_INPUTS_INFO;
|
|
2501
2477
|
}
|
|
2502
2478
|
catch (error)
|
|
@@ -2548,7 +2524,7 @@ class NomadMediaSDK {
|
|
|
2548
2524
|
const UPDATE_LIVE_INPUT_INFO = await _updateLiveInput(this, this.token,
|
|
2549
2525
|
this.config.serviceApiUrl, LIVE_INPUT_ID, NAME, SOURCE, TYPE, IS_STANDARD,
|
|
2550
2526
|
VIDEO_ASSET_ID, DESTINATIONS, SOURCES, this.debugMode);
|
|
2551
|
-
_printDatetime(`Live Input updated: ${LIVE_INPUT_ID}`);
|
|
2527
|
+
if (UPDATE_LIVE_INPUT_INFO) _printDatetime(`Live Input updated: ${LIVE_INPUT_ID}`);
|
|
2552
2528
|
return UPDATE_LIVE_INPUT_INFO;
|
|
2553
2529
|
}
|
|
2554
2530
|
catch (error)
|
|
@@ -2622,7 +2598,7 @@ class NomadMediaSDK {
|
|
|
2622
2598
|
{
|
|
2623
2599
|
const CANCEL_SEGMENT_INFO = await _cancelSegment(this, this.token, this.config.serviceApiUrl,
|
|
2624
2600
|
LIVE_OPERATOR_ID, this.debugMode);
|
|
2625
|
-
_printDatetime(`Segment cancelled: ${LIVE_OPERATOR_ID}`);
|
|
2601
|
+
if (CANCEL_SEGMENT_INFO) _printDatetime(`Segment cancelled: ${LIVE_OPERATOR_ID}`);
|
|
2626
2602
|
return CANCEL_SEGMENT_INFO;
|
|
2627
2603
|
}
|
|
2628
2604
|
catch (error)
|
|
@@ -2698,7 +2674,7 @@ class NomadMediaSDK {
|
|
|
2698
2674
|
{
|
|
2699
2675
|
const GET_COMPLETED_SEGMENTS_INFO = await _getCompletedSegments(this, this.token,
|
|
2700
2676
|
this.config.serviceApiUrl, LIVE_OPERATOR_ID, this.debugMode);
|
|
2701
|
-
_printDatetime(`Completed segments gotten`);
|
|
2677
|
+
if (GET_COMPLETED_SEGMENTS_INFO) _printDatetime(`Completed segments gotten`);
|
|
2702
2678
|
return GET_COMPLETED_SEGMENTS_INFO;
|
|
2703
2679
|
}
|
|
2704
2680
|
catch (error)
|
|
@@ -2736,7 +2712,7 @@ class NomadMediaSDK {
|
|
|
2736
2712
|
{
|
|
2737
2713
|
const GET_LIVE_OPERATOR_INFO = await _getLiveOperator(this, this.token,
|
|
2738
2714
|
this.config.serviceApiUrl, LIVE_OPERATOR_ID, this.debugMode);
|
|
2739
|
-
_printDatetime(`Live operator gotten: ${LIVE_OPERATOR_ID}`);
|
|
2715
|
+
if (GET_LIVE_OPERATOR_INFO) _printDatetime(`Live operator gotten: ${LIVE_OPERATOR_ID}`);
|
|
2740
2716
|
return GET_LIVE_OPERATOR_INFO;
|
|
2741
2717
|
}
|
|
2742
2718
|
catch (error)
|
|
@@ -2773,7 +2749,7 @@ class NomadMediaSDK {
|
|
|
2773
2749
|
{
|
|
2774
2750
|
const GET_LIVE_OPERATORS_INFO = await _getLiveOperators(this, this.token,
|
|
2775
2751
|
this.config.serviceApiUrl, this.debugMode);
|
|
2776
|
-
_printDatetime(`Live operators gotten`);
|
|
2752
|
+
if (GET_LIVE_OPERATORS_INFO) _printDatetime(`Live operators gotten`);
|
|
2777
2753
|
return GET_LIVE_OPERATORS_INFO;
|
|
2778
2754
|
}
|
|
2779
2755
|
catch (error)
|
|
@@ -2818,7 +2794,7 @@ class NomadMediaSDK {
|
|
|
2818
2794
|
const START_BROADCAST_INFO = await _startBroadcast(this, this.token, this.config.serviceApiUrl, LIVE_OPERATOR_ID,
|
|
2819
2795
|
PREROLL_ASSET_ID, POSTROLL_ASSET_ID, LIVE_INPUT_ID, RELATED_CONTENT_IDS, TAG_IDS,
|
|
2820
2796
|
this.debugMode);
|
|
2821
|
-
_printDatetime(`Broadcast started`);
|
|
2797
|
+
if (START_BROADCAST_INFO) _printDatetime(`Broadcast started`);
|
|
2822
2798
|
return START_BROADCAST_INFO;
|
|
2823
2799
|
}
|
|
2824
2800
|
catch (error)
|
|
@@ -2937,7 +2913,7 @@ class NomadMediaSDK {
|
|
|
2937
2913
|
const ADD_ASSET_SCHEDULE_EVENT_INFO = await _addAssetScheduleEvent(this, this.token,
|
|
2938
2914
|
this.config.serviceApiUrl, CHANNEL_ID, ASSET, IS_LOOP,
|
|
2939
2915
|
DURATION_TIME_CODE, PREVIOUS_ID, this.debugMode);
|
|
2940
|
-
_printDatetime(`Asset schedule event added to channel: ${CHANNEL_ID}`);
|
|
2916
|
+
if (ADD_ASSET_SCHEDULE_EVENT_INFO) _printDatetime(`Asset schedule event added to channel: ${CHANNEL_ID}`);
|
|
2941
2917
|
return ADD_ASSET_SCHEDULE_EVENT_INFO;
|
|
2942
2918
|
}
|
|
2943
2919
|
catch (error)
|
|
@@ -2984,7 +2960,7 @@ class NomadMediaSDK {
|
|
|
2984
2960
|
const ADD_INPUT_SCHEDULE_EVENT_INFO = await _addInputScheduleEvent(this, this.token,
|
|
2985
2961
|
this.config.serviceApiUrl, CHANNEL_ID, INPUT, BACKUP_INPUT,
|
|
2986
2962
|
FIXED_ON_AIR_TIME_UTC, PREVIOUS_ID, this.debugMode);
|
|
2987
|
-
_printDatetime(`Input schedule event added to channel ${CHANNEL_ID}`);
|
|
2963
|
+
if (ADD_INPUT_SCHEDULE_EVENT_INFO) _printDatetime(`Input schedule event added to channel ${CHANNEL_ID}`);
|
|
2988
2964
|
return ADD_INPUT_SCHEDULE_EVENT_INFO;
|
|
2989
2965
|
}
|
|
2990
2966
|
catch (error)
|
|
@@ -3023,7 +2999,7 @@ class NomadMediaSDK {
|
|
|
3023
2999
|
{
|
|
3024
3000
|
const GET_ASSET_SCHEDULE_EVENT_INFO = await _getAssetScheduleEvent(this, this.token,
|
|
3025
3001
|
this.config.serviceApiUrl, CHANNEL_ID, SCHEDULE_EVENT_ID, this.debugMode);
|
|
3026
|
-
_printDatetime(`Asset schedule event gotten: ${CHANNEL_ID}`);
|
|
3002
|
+
if (GET_ASSET_SCHEDULE_EVENT_INFO) _printDatetime(`Asset schedule event gotten: ${CHANNEL_ID}`);
|
|
3027
3003
|
return GET_ASSET_SCHEDULE_EVENT_INFO;
|
|
3028
3004
|
}
|
|
3029
3005
|
catch (error)
|
|
@@ -3062,7 +3038,7 @@ class NomadMediaSDK {
|
|
|
3062
3038
|
{
|
|
3063
3039
|
const GET_INPUT_SCHEDULE_EVENT_INFO = await _getInputScheduleEvent(this, this.token,
|
|
3064
3040
|
this.config.serviceApiUrl, CHANNEL_ID, SCHEDULE_EVENT_ID, this.debugMode);
|
|
3065
|
-
_printDatetime(`Asset schedule event gotten: ${CHANNEL_ID}`);
|
|
3041
|
+
if (GET_INPUT_SCHEDULE_EVENT_INFO) _printDatetime(`Asset schedule event gotten: ${CHANNEL_ID}`);
|
|
3066
3042
|
return GET_INPUT_SCHEDULE_EVENT_INFO;
|
|
3067
3043
|
}
|
|
3068
3044
|
catch (error)
|
|
@@ -3103,7 +3079,7 @@ class NomadMediaSDK {
|
|
|
3103
3079
|
const MOVE_SCHEDULE_EVENT_INFO = await _moveScheduleEvent(this, this.token,
|
|
3104
3080
|
this.config.serviceApiUrl, CHANNEL_ID, SCHEDULE_EVENT_ID,
|
|
3105
3081
|
PREVIOUS_SCHEDULE_EVENT_ID, this.debugMode);
|
|
3106
|
-
_printDatetime(`Schedule event moved: ${CHANNEL_ID}`);
|
|
3082
|
+
if (MOVE_SCHEDULE_EVENT_INFO) _printDatetime(`Schedule event moved: ${CHANNEL_ID}`);
|
|
3107
3083
|
return MOVE_SCHEDULE_EVENT_INFO;
|
|
3108
3084
|
}
|
|
3109
3085
|
catch (error)
|
|
@@ -3223,7 +3199,7 @@ class NomadMediaSDK {
|
|
|
3223
3199
|
const ADD_ASSET_SCHEDULE_EVENT_INFO = await _updateAssetScheduleEvent(this, this.token,
|
|
3224
3200
|
this.config.serviceApiUrl, ID, CHANNEL_ID, ASSET, IS_LOOP,
|
|
3225
3201
|
DURATION_TIME_CODE, PREVIOUS_ID, this.debugMode);
|
|
3226
|
-
_printDatetime(`Asset schedule event updated: ${ID}`);
|
|
3202
|
+
if (ADD_ASSET_SCHEDULE_EVENT_INFO) _printDatetime(`Asset schedule event updated: ${ID}`);
|
|
3227
3203
|
return ADD_ASSET_SCHEDULE_EVENT_INFO;
|
|
3228
3204
|
}
|
|
3229
3205
|
catch (error)
|
|
@@ -3269,7 +3245,7 @@ class NomadMediaSDK {
|
|
|
3269
3245
|
const ADD_INPUT_SCHEDULE_EVENT_INFO = await _updateInputScheduleEvent(this, this.token,
|
|
3270
3246
|
this.config.serviceApiUrl, ID, CHANNEL_ID, INPUT, BACKUP_INPUT,
|
|
3271
3247
|
FIXED_ON_AIR_TIME_UTC, this.debugMode);
|
|
3272
|
-
_printDatetime(`Input schedule event updated`);
|
|
3248
|
+
if (ADD_INPUT_SCHEDULE_EVENT_INFO) _printDatetime(`Input schedule event updated`);
|
|
3273
3249
|
return ADD_INPUT_SCHEDULE_EVENT_INFO;
|
|
3274
3250
|
}
|
|
3275
3251
|
catch (error)
|
|
@@ -3336,7 +3312,7 @@ class NomadMediaSDK {
|
|
|
3336
3312
|
OUTPUT_STREAM_KEY, OUTPUT_URL, SECONDARY_OUTPUT_STREAM_KEY,
|
|
3337
3313
|
SECONDARY_OUTPUT_URL, VIDEO_BITRATE, VIDEO_BITRATE_MODE, VIDEO_CODEC,
|
|
3338
3314
|
VIDEO_FRAMES_PER_SECOND, VIDEO_HEIGHT, VIDEO_WIDTH, this.debugMode);
|
|
3339
|
-
_printDatetime(`Live output profile created`);
|
|
3315
|
+
if (CREATE_LIVE_OUTPUT_INFO) _printDatetime(`Live output profile created`);
|
|
3340
3316
|
return CREATE_LIVE_OUTPUT_INFO;
|
|
3341
3317
|
}
|
|
3342
3318
|
catch (error)
|
|
@@ -3410,7 +3386,7 @@ class NomadMediaSDK {
|
|
|
3410
3386
|
{
|
|
3411
3387
|
const GET_LIVE_OUTPUT_INFO = await _getLiveOutputProfile(this, this.token,
|
|
3412
3388
|
this.config.serviceApiUrl, LIVE_OUTPUT_ID, this.debugMode);
|
|
3413
|
-
_printDatetime(`Live output profile gotten`);
|
|
3389
|
+
if (GET_LIVE_OUTPUT_INFO) _printDatetime(`Live output profile gotten`);
|
|
3414
3390
|
return GET_LIVE_OUTPUT_INFO;
|
|
3415
3391
|
}
|
|
3416
3392
|
catch (error)
|
|
@@ -3447,7 +3423,7 @@ class NomadMediaSDK {
|
|
|
3447
3423
|
{
|
|
3448
3424
|
const GET_LIVE_OUTPUTS_INFO = await _getLiveOutputProfiles(this, this.token,
|
|
3449
3425
|
this.config.serviceApiUrl, this.debugMode);
|
|
3450
|
-
_printDatetime(`Live outputs gotten`);
|
|
3426
|
+
if (GET_LIVE_OUTPUTS_INFO) _printDatetime(`Live outputs gotten`);
|
|
3451
3427
|
return GET_LIVE_OUTPUTS_INFO;
|
|
3452
3428
|
}
|
|
3453
3429
|
catch (error)
|
|
@@ -3484,7 +3460,7 @@ class NomadMediaSDK {
|
|
|
3484
3460
|
{
|
|
3485
3461
|
const GET_LIVE_OUTPUT_TYPES_INFO = await _getLiveOutputTypes(this, this.token,
|
|
3486
3462
|
this.config.serviceApiUrl, this.debugMode);
|
|
3487
|
-
_printDatetime(`Live output types gotten`);
|
|
3463
|
+
if (GET_LIVE_OUTPUT_TYPES_INFO) _printDatetime(`Live output types gotten`);
|
|
3488
3464
|
return GET_LIVE_OUTPUT_TYPES_INFO;
|
|
3489
3465
|
}
|
|
3490
3466
|
catch (error)
|
|
@@ -3552,7 +3528,7 @@ class NomadMediaSDK {
|
|
|
3552
3528
|
AUDIO_BITRATE, OUTPUT_STREAM_KEY, OUTPUT_URL, SECONDARY_OUTPUT_STREAM_KEY,
|
|
3553
3529
|
SECONDARY_OUTPUT_URL, VIDEO_BITRATE, VIDEO_BITRATE_MODE, VIDEO_CODEC,
|
|
3554
3530
|
VIDEO_FRAMES_PER_SECOND, VIDEO_HEIGHT, VIDEO_WIDTH, this.debugMode);
|
|
3555
|
-
_printDatetime(`Live output updated`);
|
|
3531
|
+
if (UPDATE_LIVE_OUTPUT_INFO) _printDatetime(`Live output updated`);
|
|
3556
3532
|
return UPDATE_LIVE_OUTPUT_INFO;
|
|
3557
3533
|
}
|
|
3558
3534
|
catch (error)
|
|
@@ -3609,7 +3585,7 @@ class NomadMediaSDK {
|
|
|
3609
3585
|
const CREATE_LIVE_OUTPUT_PROFILE_GROUP_INFO = await _createLiveOutputProfileGroup(this, this.token,
|
|
3610
3586
|
this.config.serviceApiUrl, NAME, IS_ENABLED, MANIFEST_TYPE, IS_DEFAULT_GROUP,
|
|
3611
3587
|
LIVE_OUTPUT_TYPE, ARCHIVE_LIVE_OUTPUT_PROFILE, LIVE_OUTPUT_PROFILES, this.debugMode);
|
|
3612
|
-
_printDatetime(`Live output profile group created`);
|
|
3588
|
+
if (CREATE_LIVE_OUTPUT_PROFILE_GROUP_INFO) _printDatetime(`Live output profile group created`);
|
|
3613
3589
|
return CREATE_LIVE_OUTPUT_PROFILE_GROUP_INFO;
|
|
3614
3590
|
}
|
|
3615
3591
|
catch (error)
|
|
@@ -3683,7 +3659,7 @@ class NomadMediaSDK {
|
|
|
3683
3659
|
{
|
|
3684
3660
|
const GET_LIVE_OUTPUT_PROFILE_GROUP_INFO = await _getLiveOutputProfileGroup(this, this.token,
|
|
3685
3661
|
this.config.serviceApiUrl, LIVE_OUTPUT_PROFILE_GROUP_ID, this.debugMode);
|
|
3686
|
-
_printDatetime(`Live output profile group gotten`);
|
|
3662
|
+
if (GET_LIVE_OUTPUT_PROFILE_GROUP_INFO) _printDatetime(`Live output profile group gotten`);
|
|
3687
3663
|
return GET_LIVE_OUTPUT_PROFILE_GROUP_INFO;
|
|
3688
3664
|
}
|
|
3689
3665
|
catch (error)
|
|
@@ -3720,7 +3696,7 @@ class NomadMediaSDK {
|
|
|
3720
3696
|
{
|
|
3721
3697
|
const GET_LIVE_OUTPUT_PROFILE_GROUPS_INFO = await _getLiveOutputProfileGroups(this, this.token,
|
|
3722
3698
|
this.config.serviceApiUrl, this.debugMode);
|
|
3723
|
-
_printDatetime(`Live output profile groups gotten`);
|
|
3699
|
+
if (GET_LIVE_OUTPUT_PROFILE_GROUPS_INFO) _printDatetime(`Live output profile groups gotten`);
|
|
3724
3700
|
return GET_LIVE_OUTPUT_PROFILE_GROUPS_INFO;
|
|
3725
3701
|
}
|
|
3726
3702
|
catch (error)
|
|
@@ -3777,7 +3753,7 @@ class NomadMediaSDK {
|
|
|
3777
3753
|
this.config.serviceApiUrl, LIVE_OUTPUT_PROFILE_GROUP_ID, NAME, IS_ENABLED, MANIFEST_TYPE,
|
|
3778
3754
|
IS_DEFAULT_GROUP, LIVE_OUTPUT_TYPE, ARCHIVE_LIVE_OUTPUT_PROFILE, LIVE_OUTPUT_PROFILES,
|
|
3779
3755
|
this.debugMode);
|
|
3780
|
-
_printDatetime(`Live output profile group updated`);
|
|
3756
|
+
if (UPDATE_LIVE_OUTPUT_PROFILE_GROUP_INFO) _printDatetime(`Live output profile group updated`);
|
|
3781
3757
|
return UPDATE_LIVE_OUTPUT_PROFILE_GROUP_INFO;
|
|
3782
3758
|
}
|
|
3783
3759
|
catch (error)
|
|
@@ -3844,7 +3820,7 @@ class NomadMediaSDK {
|
|
|
3844
3820
|
this.config.serviceApiUrl, COLLECTIONS, END_SEARCH_DATE, END_SEARCH_DURATION_IN_MINUTES,
|
|
3845
3821
|
NAME, RELATED_CONTENTS, SEARCH_DATE, SEARCH_DURATION_IN_MINUTES, SEARCH_FILTER_TYPE, TAGS,
|
|
3846
3822
|
THUMBNAIL_ASSET, this.debugMode);
|
|
3847
|
-
_printDatetime(`Intelligent playlist created`);
|
|
3823
|
+
if (CREATE_INTELLIGENT_PLAYLIST_INFO) _printDatetime(`Intelligent playlist created`);
|
|
3848
3824
|
return CREATE_INTELLIGENT_PLAYLIST_INFO;
|
|
3849
3825
|
}
|
|
3850
3826
|
catch (error)
|
|
@@ -3888,7 +3864,7 @@ class NomadMediaSDK {
|
|
|
3888
3864
|
const CREATE_INTELLIGENT_SCHEDULE_INFO = await _createIntelligentSchedule(this, this.token,
|
|
3889
3865
|
this.config.serviceApiUrl, DEFAULT_VIDEO_ASSET, NAME, THUMBNAIL_ASSET, TIME_ZONE_ID,
|
|
3890
3866
|
this.debugMode);
|
|
3891
|
-
_printDatetime(`Intelligent schedule created`);
|
|
3867
|
+
if (CREATE_INTELLIGENT_SCHEDULE_INFO) _printDatetime(`Intelligent schedule created`);
|
|
3892
3868
|
return CREATE_INTELLIGENT_SCHEDULE_INFO;
|
|
3893
3869
|
}
|
|
3894
3870
|
catch (error)
|
|
@@ -3933,7 +3909,7 @@ class NomadMediaSDK {
|
|
|
3933
3909
|
const CREATE_PLAYLIST_INFO = await _createPlaylist(this, this.token,
|
|
3934
3910
|
this.config.serviceApiUrl, NAME, THUMBNAIL_ASSET, LOOP_PLAYLIST,
|
|
3935
3911
|
DEFAULT_VIDEO_ASSET, this.debugMode);
|
|
3936
|
-
_printDatetime(`Playlist created`);
|
|
3912
|
+
if (CREATE_PLAYLIST_INFO) _printDatetime(`Playlist created`);
|
|
3937
3913
|
return CREATE_PLAYLIST_INFO;
|
|
3938
3914
|
}
|
|
3939
3915
|
catch (error)
|
|
@@ -3974,7 +3950,7 @@ class NomadMediaSDK {
|
|
|
3974
3950
|
{
|
|
3975
3951
|
const CREATE_PLAYLIST_VIDEO_INFO = await _createPlaylistVideo(this, this.token,
|
|
3976
3952
|
this.config.serviceApiUrl, PLAYLIST_ID, VIDEO_ASSET, PREVIOUS_ITEM, this.debugMode);
|
|
3977
|
-
_printDatetime(`Playlist video created`);
|
|
3953
|
+
if (CREATE_PLAYLIST_VIDEO_INFO) _printDatetime(`Playlist video created`);
|
|
3978
3954
|
return CREATE_PLAYLIST_VIDEO_INFO;
|
|
3979
3955
|
}
|
|
3980
3956
|
catch (error)
|
|
@@ -4026,7 +4002,7 @@ class NomadMediaSDK {
|
|
|
4026
4002
|
const CREATE_SCHEDULE_ITEM_ASSET_INFO = await _createScheduleItemAsset(this, this.token,
|
|
4027
4003
|
this.config.serviceApiUrl, SCHEDULE_ID, ASSET, DAYS, DURATION_TIME_CODE, END_TIME_CODE,
|
|
4028
4004
|
PREVIOUS_ITEM, TIME_CODE, this.debugMode);
|
|
4029
|
-
_printDatetime(`Schedule item asset created`);
|
|
4005
|
+
if (CREATE_SCHEDULE_ITEM_ASSET_INFO) _printDatetime(`Schedule item asset created`);
|
|
4030
4006
|
return CREATE_SCHEDULE_ITEM_ASSET_INFO;
|
|
4031
4007
|
}
|
|
4032
4008
|
catch (error)
|
|
@@ -4080,7 +4056,7 @@ class NomadMediaSDK {
|
|
|
4080
4056
|
const CREATE_SCHEDULE_ITEM_LIVE_CHANNEL_INFO = await _createScheduleItemLiveChannel(this, this.token,
|
|
4081
4057
|
this.config.serviceApiUrl, SCHEDULE_ID, DAYS, DURATION_TIME_CODE, END_TIME_CODE,
|
|
4082
4058
|
LIVE_CHANNEL, PREVIOUS_ITEM, TIME_CODE, this.debugMode);
|
|
4083
|
-
_printDatetime(`Schedule item live channel created`);
|
|
4059
|
+
if (CREATE_SCHEDULE_ITEM_LIVE_CHANNEL_INFO) _printDatetime(`Schedule item live channel created`);
|
|
4084
4060
|
return CREATE_SCHEDULE_ITEM_LIVE_CHANNEL_INFO;
|
|
4085
4061
|
}
|
|
4086
4062
|
catch (error)
|
|
@@ -4134,7 +4110,7 @@ class NomadMediaSDK {
|
|
|
4134
4110
|
const CREATE_SCHEDULE_ITEM_PLAYLIST_SCHEDULE_INFO = await _createScheduleItemPlaylistSchedule(this, this.token,
|
|
4135
4111
|
this.config.serviceApiUrl, SCHEDULE_ID, DAYS, DURATION_TIME_CODE,
|
|
4136
4112
|
END_TIME_CODE, PLAYLIST_SCHEDULE, PREVIOUS_ITEM, TIME_CODE, this.debugMode);
|
|
4137
|
-
_printDatetime(`Schedule item playlist schedule created`);
|
|
4113
|
+
if (CREATE_SCHEDULE_ITEM_PLAYLIST_SCHEDULE_INFO) _printDatetime(`Schedule item playlist schedule created`);
|
|
4138
4114
|
return CREATE_SCHEDULE_ITEM_PLAYLIST_SCHEDULE_INFO;
|
|
4139
4115
|
}
|
|
4140
4116
|
catch (error)
|
|
@@ -4211,7 +4187,7 @@ class NomadMediaSDK {
|
|
|
4211
4187
|
END_SEARCH_DATE, END_SEARCH_DURATION_IN_MINUTES, END_TIME_CODE, PREVIOUS_ITEM,
|
|
4212
4188
|
RELATED_CONTENTS, SEARCH_DATE, SEARCH_DURATION_IN_MINUTES, SEARCH_FILTER_TYPE, TAGS,
|
|
4213
4189
|
TIME_CODE, this.debugMode);
|
|
4214
|
-
_printDatetime(`Schedule item search filter created`);
|
|
4190
|
+
if (CREATE_SCHEDULE_ITEM_SEARCH_FILTER_INFO) _printDatetime(`Schedule item search filter created`);
|
|
4215
4191
|
return CREATE_SCHEDULE_ITEM_SEARCH_FILTER_INFO;
|
|
4216
4192
|
}
|
|
4217
4193
|
catch (error)
|
|
@@ -4390,7 +4366,7 @@ class NomadMediaSDK {
|
|
|
4390
4366
|
{
|
|
4391
4367
|
const GET_INTELLIGENT_PLAYLIST_INFO = await _getIntelligentPlaylist(this, this.token,
|
|
4392
4368
|
this.config.serviceApiUrl, SCHEDULE_ID, this.debugMode);
|
|
4393
|
-
_printDatetime(`Intelligent playlist gotten`);
|
|
4369
|
+
if (GET_INTELLIGENT_PLAYLIST_INFO) _printDatetime(`Intelligent playlist gotten`);
|
|
4394
4370
|
return GET_INTELLIGENT_PLAYLIST_INFO;
|
|
4395
4371
|
}
|
|
4396
4372
|
catch (error)
|
|
@@ -4428,7 +4404,7 @@ class NomadMediaSDK {
|
|
|
4428
4404
|
{
|
|
4429
4405
|
const GET_INTELLIGENT_SCHEDULE_INFO = await _getIntelligentSchedule(this, this.token,
|
|
4430
4406
|
this.config.serviceApiUrl, SCHEDULE_ID, this.debugMode);
|
|
4431
|
-
_printDatetime(`Intelligent schedule gotten`);
|
|
4407
|
+
if (GET_INTELLIGENT_SCHEDULE_INFO) _printDatetime(`Intelligent schedule gotten`);
|
|
4432
4408
|
return GET_INTELLIGENT_SCHEDULE_INFO;
|
|
4433
4409
|
}
|
|
4434
4410
|
catch (error)
|
|
@@ -4466,7 +4442,7 @@ class NomadMediaSDK {
|
|
|
4466
4442
|
{
|
|
4467
4443
|
const GET_PLAYLIST_INFO = await _getPlaylist(this, this.token, this.config.serviceApiUrl,
|
|
4468
4444
|
SCHEDULE_ID, this.debugMode);
|
|
4469
|
-
_printDatetime(`Playlist gotten`);
|
|
4445
|
+
if (GET_PLAYLIST_INFO) _printDatetime(`Playlist gotten`);
|
|
4470
4446
|
return GET_PLAYLIST_INFO;
|
|
4471
4447
|
}
|
|
4472
4448
|
catch (error)
|
|
@@ -4505,7 +4481,7 @@ class NomadMediaSDK {
|
|
|
4505
4481
|
{
|
|
4506
4482
|
const GET_SCHEDULE_ITEM_INFO = await _getScheduleItem(this, this.token,
|
|
4507
4483
|
this.config.serviceApiUrl, SCHEDULE_ID, ITEM_ID, this.debugMode);
|
|
4508
|
-
_printDatetime(`Schedule item gotten`);
|
|
4484
|
+
if (GET_SCHEDULE_ITEM_INFO) _printDatetime(`Schedule item gotten`);
|
|
4509
4485
|
return GET_SCHEDULE_ITEM_INFO;
|
|
4510
4486
|
}
|
|
4511
4487
|
catch (error)
|
|
@@ -4543,7 +4519,7 @@ class NomadMediaSDK {
|
|
|
4543
4519
|
{
|
|
4544
4520
|
const GET_SCHEDULE_ITEMS_INFO = await _getScheduleItems(this, this.token,
|
|
4545
4521
|
this.config.serviceApiUrl, SCHEDULE_ID, this.debugMode);
|
|
4546
|
-
_printDatetime(`Schedule items gotten`);
|
|
4522
|
+
if (GET_SCHEDULE_ITEMS_INFO) _printDatetime(`Schedule items gotten`);
|
|
4547
4523
|
return GET_SCHEDULE_ITEMS_INFO;
|
|
4548
4524
|
}
|
|
4549
4525
|
catch (error)
|
|
@@ -4578,7 +4554,7 @@ class NomadMediaSDK {
|
|
|
4578
4554
|
{
|
|
4579
4555
|
const GET_SCHEDULE_PREVIEW_INFO = await _getSchedulePreview(this, this.token,
|
|
4580
4556
|
this.config.serviceApiUrl, SCHEDULE_ID, this.debugMode);
|
|
4581
|
-
_printDatetime(`Schedule preview gotten`);
|
|
4557
|
+
if (GET_SCHEDULE_PREVIEW_INFO) _printDatetime(`Schedule preview gotten`);
|
|
4582
4558
|
return GET_SCHEDULE_PREVIEW_INFO;
|
|
4583
4559
|
}
|
|
4584
4560
|
catch (error)
|
|
@@ -4618,7 +4594,7 @@ class NomadMediaSDK {
|
|
|
4618
4594
|
{
|
|
4619
4595
|
const MOVE_SCHEDULE_ITEM_INFO = await _moveScheduleItem(this, this.token,
|
|
4620
4596
|
this.config.serviceApiUrl, SCHEDULE_ID, ITEM_ID, PREVIOUS_ITEM, this.debugMode);
|
|
4621
|
-
_printDatetime(`Schedule item moved`);
|
|
4597
|
+
if (MOVE_SCHEDULE_ITEM_INFO) _printDatetime(`Schedule item moved`);
|
|
4622
4598
|
return MOVE_SCHEDULE_ITEM_INFO;
|
|
4623
4599
|
}
|
|
4624
4600
|
catch (error)
|
|
@@ -4658,7 +4634,7 @@ class NomadMediaSDK {
|
|
|
4658
4634
|
{
|
|
4659
4635
|
const PUBLISH_INTELLIGENT_SCHEDULE_INFO = await _publishIntelligentSchedule(this, this.token,
|
|
4660
4636
|
this.config.serviceApiUrl, SCHEDULE_ID, NUMBER_OF_LOCKED_DAYS, this.debugMode);
|
|
4661
|
-
_printDatetime(`Intelligent schedule published`);
|
|
4637
|
+
if (PUBLISH_INTELLIGENT_SCHEDULE_INFO) _printDatetime(`Intelligent schedule published`);
|
|
4662
4638
|
return PUBLISH_INTELLIGENT_SCHEDULE_INFO;
|
|
4663
4639
|
}
|
|
4664
4640
|
catch (error)
|
|
@@ -4697,7 +4673,7 @@ class NomadMediaSDK {
|
|
|
4697
4673
|
{
|
|
4698
4674
|
const START_SCHEDULE_INFO = await _startSchedule(this, this.token,
|
|
4699
4675
|
this.config.serviceApiUrl, SCHEDULE_ID, SKIP_CLEANUP_ON_FAILURE, this.debugMode);
|
|
4700
|
-
_printDatetime(`Schedule started`);
|
|
4676
|
+
if (START_SCHEDULE_INFO) _printDatetime(`Schedule started`);
|
|
4701
4677
|
return START_SCHEDULE_INFO;
|
|
4702
4678
|
}
|
|
4703
4679
|
catch (error)
|
|
@@ -4736,7 +4712,7 @@ class NomadMediaSDK {
|
|
|
4736
4712
|
{
|
|
4737
4713
|
const STOP_SCHEDULE_INFO = await _stopSchedule(this, this.token,
|
|
4738
4714
|
this.config.serviceApiUrl, SCHEDULE_ID, FORCE_STOP, this.debugMode);
|
|
4739
|
-
_printDatetime(`Schedule stopped`);
|
|
4715
|
+
if (STOP_SCHEDULE_INFO) _printDatetime(`Schedule stopped`);
|
|
4740
4716
|
return STOP_SCHEDULE_INFO;
|
|
4741
4717
|
}
|
|
4742
4718
|
catch (error)
|
|
@@ -4802,7 +4778,7 @@ class NomadMediaSDK {
|
|
|
4802
4778
|
this.config.serviceApiUrl, SCHEDULE_ID, COLLECTIONS, END_SEARCH_DATE,
|
|
4803
4779
|
END_SEARCH_DURATION_IN_MINUTES, NAME, RELATED_CONTENTS, SEARCH_DATE,
|
|
4804
4780
|
SEARCH_DURATION_IN_MINUTES, SEARCH_FILTER_TYPE, TAGS, THUMBNAIL_ASSET, this.debugMode);
|
|
4805
|
-
_printDatetime(`Intelligent playlist updated`);
|
|
4781
|
+
if (UPDATE_INTELLIGENT_PLAYLIST_INFO) _printDatetime(`Intelligent playlist updated`);
|
|
4806
4782
|
return UPDATE_INTELLIGENT_PLAYLIST_INFO;
|
|
4807
4783
|
}
|
|
4808
4784
|
catch (error)
|
|
@@ -4849,7 +4825,7 @@ class NomadMediaSDK {
|
|
|
4849
4825
|
const UPDATE_INTELLIGENT_SCHEDULE_INFO = await _updateIntelligentSchedule(this, this.token,
|
|
4850
4826
|
this.config.serviceApiUrl, SCHEDULE_ID, DEFAULT_VIDEO_ASSET, NAME, THUMBNAIL_ASSET,
|
|
4851
4827
|
TIME_ZONE_ID, this.debugMode);
|
|
4852
|
-
_printDatetime(`Intelligent schedule updated`);
|
|
4828
|
+
if (UPDATE_INTELLIGENT_SCHEDULE_INFO) _printDatetime(`Intelligent schedule updated`);
|
|
4853
4829
|
return UPDATE_INTELLIGENT_SCHEDULE_INFO;
|
|
4854
4830
|
}
|
|
4855
4831
|
catch (error)
|
|
@@ -4892,7 +4868,7 @@ class NomadMediaSDK {
|
|
|
4892
4868
|
const UPDATE_PLAYLIST_INFO = await _updatePlaylist(this, this.token,
|
|
4893
4869
|
this.config.serviceApiUrl, SCHEDULE_ID, DEFAULT_VIDEO_ASSET, LOOP_PLAYLIST,
|
|
4894
4870
|
NAME, THUMBNAIL_ASSET, this.debugMode);
|
|
4895
|
-
_printDatetime(`Playlist updated`);
|
|
4871
|
+
if (UPDATE_PLAYLIST_INFO) _printDatetime(`Playlist updated`);
|
|
4896
4872
|
return UPDATE_PLAYLIST_INFO;
|
|
4897
4873
|
}
|
|
4898
4874
|
catch (error)
|
|
@@ -4925,7 +4901,7 @@ class NomadMediaSDK {
|
|
|
4925
4901
|
{
|
|
4926
4902
|
const UPDATE_PLAYLIST_VIDEO_INFO = await _updatePlaylistVideo(this, this.token,
|
|
4927
4903
|
this.config.serviceApiUrl, PLAYLIST_ID, ITEM_ID, ASSET, this.debugMode);
|
|
4928
|
-
_printDatetime(`Playlist video updated`);
|
|
4904
|
+
if (UPDATE_PLAYLIST_VIDEO_INFO) _printDatetime(`Playlist video updated`);
|
|
4929
4905
|
return UPDATE_PLAYLIST_VIDEO_INFO;
|
|
4930
4906
|
}
|
|
4931
4907
|
catch (error)
|
|
@@ -4977,7 +4953,7 @@ class NomadMediaSDK {
|
|
|
4977
4953
|
const UPDATE_SCHEDULE_ITEM_ASSET_INFO = await _updateScheduleItemAsset(this, this.token,
|
|
4978
4954
|
this.config.serviceApiUrl, SCHEDULE_ID, ITEM_ID, ASSET, DAYS, DURATION_TIME_CODE,
|
|
4979
4955
|
END_TIME_CODE, TIME_CODE, this.debugMode);
|
|
4980
|
-
_printDatetime(`Schedule item asset updated`);
|
|
4956
|
+
if (UPDATE_SCHEDULE_ITEM_ASSET_INFO) _printDatetime(`Schedule item asset updated`);
|
|
4981
4957
|
return UPDATE_SCHEDULE_ITEM_ASSET_INFO;
|
|
4982
4958
|
}
|
|
4983
4959
|
catch (error)
|
|
@@ -5030,7 +5006,7 @@ class NomadMediaSDK {
|
|
|
5030
5006
|
const UPDATE_SCHEDULE_ITEM_LIVE_CHANNEL_INFO = await _updateScheduleItemLiveChannel(this, this.token,
|
|
5031
5007
|
this.config.serviceApiUrl, SCHEDULE_ID, ITEM_ID, DAYS, DURATION_TIME_CODE,
|
|
5032
5008
|
END_TIME_CODE, LIVE_CHANNEL, TIME_CODE, this.debugMode);
|
|
5033
|
-
_printDatetime(`Schedule item live channel updated`);
|
|
5009
|
+
if (UPDATE_SCHEDULE_ITEM_LIVE_CHANNEL_INFO) _printDatetime(`Schedule item live channel updated`);
|
|
5034
5010
|
return UPDATE_SCHEDULE_ITEM_LIVE_CHANNEL_INFO;
|
|
5035
5011
|
}
|
|
5036
5012
|
catch (error)
|
|
@@ -5084,7 +5060,7 @@ class NomadMediaSDK {
|
|
|
5084
5060
|
const UPDATE_SCHEDULE_ITEM_PLAYLIST_SCHEDULE_INFO = await _updateScheduleItemPlaylistSchedule(this, this.token,
|
|
5085
5061
|
this.config.serviceApiUrl, SCHEDULE_ID, ITEM_ID, DAYS, DURATION_TIME_CODE,
|
|
5086
5062
|
END_TIME_CODE, PLAYLIST_SCHEDULE, TIME_CODE, this.debugMode);
|
|
5087
|
-
_printDatetime(`Schedule item playlist schedule updated`);
|
|
5063
|
+
if (UPDATE_SCHEDULE_ITEM_PLAYLIST_SCHEDULE_INFO) _printDatetime(`Schedule item playlist schedule updated`);
|
|
5088
5064
|
return UPDATE_SCHEDULE_ITEM_PLAYLIST_SCHEDULE_INFO;
|
|
5089
5065
|
}
|
|
5090
5066
|
catch (error)
|
|
@@ -5160,7 +5136,7 @@ class NomadMediaSDK {
|
|
|
5160
5136
|
DURATION_TIME_CODE, END_SEARCH_DATE, END_SEARCH_DURATION_IN_MINUTES, END_TIME_CODE,
|
|
5161
5137
|
PREVIOUS_ITEM, RELATED_CONTENTS, SEARCH_DATE, SEARCH_DURATION_IN_MINUTES,
|
|
5162
5138
|
SEARCH_FILTER_TYPE, TAGS, TIME_CODE, this.debugMode);
|
|
5163
|
-
_printDatetime(`Schedule item search filter updated`);
|
|
5139
|
+
if (UPDATE_SCHEDULE_ITEM_SEARCH_FILTER_INFO) _printDatetime(`Schedule item search filter updated`);
|
|
5164
5140
|
return UPDATE_SCHEDULE_ITEM_SEARCH_FILTER_INFO;
|
|
5165
5141
|
}
|
|
5166
5142
|
catch (error)
|
|
@@ -5664,7 +5640,7 @@ class NomadMediaSDK {
|
|
|
5664
5640
|
{
|
|
5665
5641
|
const SESSION_STATUS = await _changeSessionStatus(this, this.token, this.config.serviceApiUrl,
|
|
5666
5642
|
ID, USER_SESSION_STATUS, APPLICATION_ID, this.debugMode);
|
|
5667
|
-
_printDatetime(`Session status changed`);
|
|
5643
|
+
if (SESSION_STATUS) _printDatetime(`Session status changed`);
|
|
5668
5644
|
return SESSION_STATUS;
|
|
5669
5645
|
}
|
|
5670
5646
|
catch (error)
|
|
@@ -5699,7 +5675,7 @@ class NomadMediaSDK {
|
|
|
5699
5675
|
const GET_USER_SESSION_INFO = await _getUserSession(this, this.token,
|
|
5700
5676
|
this.config.serviceApiUrl, this.config.apiType,
|
|
5701
5677
|
ID, this.debugMode);
|
|
5702
|
-
_printDatetime(`User session gotten`);
|
|
5678
|
+
if (GET_USER_SESSION_INFO) _printDatetime(`User session gotten`);
|
|
5703
5679
|
return GET_USER_SESSION_INFO;
|
|
5704
5680
|
}
|
|
5705
5681
|
catch (error)
|
|
@@ -5731,7 +5707,7 @@ class NomadMediaSDK {
|
|
|
5731
5707
|
{
|
|
5732
5708
|
const REGISTER_INFO = await _register(this, this.config.serviceApiUrl, EMAIL,
|
|
5733
5709
|
FIRST_NAME, LAST_NAME, PASSWORD, this.debugMode);
|
|
5734
|
-
_printDatetime(`User registered: ${EMAIL}`);
|
|
5710
|
+
if (REGISTER_INFO) _printDatetime(`User registered: ${EMAIL}`);
|
|
5735
5711
|
return REGISTER_INFO;
|
|
5736
5712
|
}
|
|
5737
5713
|
catch (error)
|
|
@@ -5781,7 +5757,7 @@ class NomadMediaSDK {
|
|
|
5781
5757
|
try
|
|
5782
5758
|
{
|
|
5783
5759
|
const VERIFY_INFO = await _verify(this, this.config.serviceApiUrl, EMAIL, CODE, this.debugMode);
|
|
5784
|
-
_printDatetime(`User verified: ${EMAIL}`);
|
|
5760
|
+
if (VERIFY_INFO) _printDatetime(`User verified: ${EMAIL}`);
|
|
5785
5761
|
return VERIFY_INFO;
|
|
5786
5762
|
}
|
|
5787
5763
|
catch (error)
|
|
@@ -5820,7 +5796,7 @@ class NomadMediaSDK {
|
|
|
5820
5796
|
{
|
|
5821
5797
|
const ARCHIVE_INFO = await _archiveAsset(this, this.token, this.config.serviceApiUrl,
|
|
5822
5798
|
ASSET_ID, this.debugMode);
|
|
5823
|
-
_printDatetime(`Asset archived: ${ASSET_ID}`);
|
|
5799
|
+
if (ARCHIVE_INFO) _printDatetime(`Asset archived: ${ASSET_ID}`);
|
|
5824
5800
|
return ARCHIVE_INFO;
|
|
5825
5801
|
}
|
|
5826
5802
|
catch (error)
|
|
@@ -5922,7 +5898,7 @@ class NomadMediaSDK {
|
|
|
5922
5898
|
ASSET_ID, this.config.apiType, START_TIME_CODE, END_TIME_CODE, TITLE,
|
|
5923
5899
|
OUTPUT_FOLDER_ID, TAGS, COLLECTIONS, RELATED_CONTENTS, VIDEO_BITRATE,
|
|
5924
5900
|
AUDIO_TRACKS, this.debugMode);
|
|
5925
|
-
_printDatetime(`Asset clipped: ${ASSET_ID}`);
|
|
5901
|
+
if (CLIP_INFO) _printDatetime(`Asset clipped: ${ASSET_ID}`);
|
|
5926
5902
|
return CLIP_INFO;
|
|
5927
5903
|
}
|
|
5928
5904
|
catch (error)
|
|
@@ -5970,7 +5946,7 @@ class NomadMediaSDK {
|
|
|
5970
5946
|
const COPY_INFO = await _copyAsset(this, this.token, this.config.serviceApiUrl,
|
|
5971
5947
|
ASSET_IDS, DESTINATION_FOLDER_ID, BATCH_ACTION, CONTENT_DEFINITION_ID,
|
|
5972
5948
|
SCHEMA_NAME, this.id, RESOLVER_EXCEMPT, this.debugMode);
|
|
5973
|
-
_printDatetime(`Asset(s) copied: ${ASSET_IDS}`);
|
|
5949
|
+
if (COPY_INFO) _printDatetime(`Asset(s) copied: ${ASSET_IDS}`);
|
|
5974
5950
|
return COPY_INFO;
|
|
5975
5951
|
}
|
|
5976
5952
|
catch (error)
|
|
@@ -6016,7 +5992,7 @@ class NomadMediaSDK {
|
|
|
6016
5992
|
const CREATE_INFO = await _createAnnotation(this, this.token, this.config.serviceApiUrl,
|
|
6017
5993
|
ASSET_ID, START_TIME_CODE, END_TIME_CODE, DESCRIPTION, SUMMARY, TITLE,
|
|
6018
5994
|
this.debugMode);
|
|
6019
|
-
_printDatetime(`Annotation created`);
|
|
5995
|
+
if (CREATE_INFO) _printDatetime(`Annotation created`);
|
|
6020
5996
|
return CREATE_INFO;
|
|
6021
5997
|
}
|
|
6022
5998
|
catch (error)
|
|
@@ -6060,7 +6036,7 @@ class NomadMediaSDK {
|
|
|
6060
6036
|
{
|
|
6061
6037
|
const CREATE_INFO = await _createAssetAdBreak(this, this.token, this.config.serviceApiUrl,
|
|
6062
6038
|
ASSET_ID, TIME_CODE, TAGS, LABELS, this.debugMode);
|
|
6063
|
-
_printDatetime(`Asset ad break created`);
|
|
6039
|
+
if (CREATE_INFO) _printDatetime(`Asset ad break created`);
|
|
6064
6040
|
return CREATE_INFO;
|
|
6065
6041
|
}
|
|
6066
6042
|
catch (error)
|
|
@@ -6100,7 +6076,7 @@ class NomadMediaSDK {
|
|
|
6100
6076
|
{
|
|
6101
6077
|
const CREATE_INFO = await _createFolderAsset(this, this.token, this.config.serviceApiUrl,
|
|
6102
6078
|
PARENT_ID, DISPLAY_NAME, this.debugMode);
|
|
6103
|
-
_printDatetime(`Folder asset created`);
|
|
6079
|
+
if (CREATE_INFO) _printDatetime(`Folder asset created`);
|
|
6104
6080
|
return CREATE_INFO;
|
|
6105
6081
|
}
|
|
6106
6082
|
catch (error)
|
|
@@ -6145,7 +6121,7 @@ class NomadMediaSDK {
|
|
|
6145
6121
|
{
|
|
6146
6122
|
const CREATE_INFO = await _createPlaceholderAsset(this, this.token, this.config.serviceApiUrl,
|
|
6147
6123
|
PARENT_ID, ASSET_NAME, this.debugMode);
|
|
6148
|
-
_printDatetime(`Placeholder asset created`);
|
|
6124
|
+
if (CREATE_INFO) _printDatetime(`Placeholder asset created`);
|
|
6149
6125
|
return CREATE_INFO;
|
|
6150
6126
|
}
|
|
6151
6127
|
catch (error)
|
|
@@ -6185,7 +6161,7 @@ class NomadMediaSDK {
|
|
|
6185
6161
|
{
|
|
6186
6162
|
const CREATE_INFO = await _createScreenshotAtTimecode(this, this.token, this.config.serviceApiUrl,
|
|
6187
6163
|
ASSET_ID, TIME_CODE, this.debugMode);
|
|
6188
|
-
_printDatetime(`Screenshot created at timecode`);
|
|
6164
|
+
if (CREATE_INFO) _printDatetime(`Screenshot created at timecode`);
|
|
6189
6165
|
return CREATE_INFO;
|
|
6190
6166
|
}
|
|
6191
6167
|
catch (error)
|
|
@@ -6335,7 +6311,7 @@ class NomadMediaSDK {
|
|
|
6335
6311
|
const DOWNLOAD_INFO = await _downloadArchiveAsset(this, this.token,
|
|
6336
6312
|
this.config.serviceApiUrl, this.config.apiType, ASSET_IDS, FILE_NAME,
|
|
6337
6313
|
DOWNLOAD_PROXY, this.debugMode);
|
|
6338
|
-
_printDatetime(`Archive asset downloaded`);
|
|
6314
|
+
if (DOWNLOAD_INFO) _printDatetime(`Archive asset downloaded`);
|
|
6339
6315
|
return DOWNLOAD_INFO;
|
|
6340
6316
|
}
|
|
6341
6317
|
catch (error)
|
|
@@ -6373,7 +6349,7 @@ class NomadMediaSDK {
|
|
|
6373
6349
|
{
|
|
6374
6350
|
const DUPLICATE_INFO = await _duplicateAsset(this, this.token, this.config.serviceApiUrl,
|
|
6375
6351
|
ASSET_ID, this.debugMode);
|
|
6376
|
-
_printDatetime(`Asset duplicated: ${ASSET_ID}`);
|
|
6352
|
+
if (DUPLICATE_INFO) _printDatetime(`Asset duplicated: ${ASSET_ID}`);
|
|
6377
6353
|
return DUPLICATE_INFO;
|
|
6378
6354
|
}
|
|
6379
6355
|
catch (error)
|
|
@@ -6411,7 +6387,7 @@ class NomadMediaSDK {
|
|
|
6411
6387
|
{
|
|
6412
6388
|
const ANNOTATIONS = await _getAnnotations(this, this.token, this.config.serviceApiUrl,
|
|
6413
6389
|
ASSET_ID, this.debugMode);
|
|
6414
|
-
_printDatetime(`Annotations retrieved for ${ASSET_ID}`);
|
|
6390
|
+
if (ANNOTATIONS) _printDatetime(`Annotations retrieved for ${ASSET_ID}`);
|
|
6415
6391
|
return ANNOTATIONS;
|
|
6416
6392
|
}
|
|
6417
6393
|
catch (error)
|
|
@@ -6449,7 +6425,7 @@ class NomadMediaSDK {
|
|
|
6449
6425
|
{
|
|
6450
6426
|
const ASSET = await _getAsset(this, this.token, this.config.serviceApiUrl,
|
|
6451
6427
|
ASSET_ID, this.debugMode);
|
|
6452
|
-
_printDatetime(`Asset retrieved for ${ASSET_ID}`);
|
|
6428
|
+
if (ASSET) _printDatetime(`Asset retrieved for ${ASSET_ID}`);
|
|
6453
6429
|
return ASSET;
|
|
6454
6430
|
}
|
|
6455
6431
|
catch (error)
|
|
@@ -6487,7 +6463,7 @@ class NomadMediaSDK {
|
|
|
6487
6463
|
{
|
|
6488
6464
|
const ASSET_AD_BREAKS = await _getAssetAdBreaks(this, this.token, this.config.serviceApiUrl,
|
|
6489
6465
|
ASSET_ID, this.debugMode);
|
|
6490
|
-
_printDatetime(`Asset ad breaks retrieved for ${ASSET_ID}`);
|
|
6466
|
+
if (ASSET_AD_BREAKS) _printDatetime(`Asset ad breaks retrieved for ${ASSET_ID}`);
|
|
6491
6467
|
return ASSET_AD_BREAKS;
|
|
6492
6468
|
}
|
|
6493
6469
|
catch (error)
|
|
@@ -6530,7 +6506,7 @@ class NomadMediaSDK {
|
|
|
6530
6506
|
{
|
|
6531
6507
|
const ASSET_CHILD_NODES = await _getAssetChildNodes(this, this.token, this.config.serviceApiUrl,
|
|
6532
6508
|
ASSET_ID, FOLDER_ID, SORT_COLUMN, IS_DESC, PAGE_INDEX, PAGE_SIZE, this.debugMode);
|
|
6533
|
-
_printDatetime(`Asset child nodes retrieved for ${ASSET_ID}`);
|
|
6509
|
+
if (ASSET_CHILD_NODES) _printDatetime(`Asset child nodes retrieved for ${ASSET_ID}`);
|
|
6534
6510
|
return ASSET_CHILD_NODES;
|
|
6535
6511
|
}
|
|
6536
6512
|
catch (error)
|
|
@@ -6562,7 +6538,7 @@ class NomadMediaSDK {
|
|
|
6562
6538
|
{
|
|
6563
6539
|
const ASSET_DETAILS = await _getAssetDetails(this, this.token, this.config.serviceApiUrl,
|
|
6564
6540
|
ASSET_ID, this.config.apiType, this.debugMode);
|
|
6565
|
-
_printDatetime(`Asset details retrieved for ${ASSET_ID}`);
|
|
6541
|
+
if (ASSET_DETAILS) _printDatetime(`Asset details retrieved for ${ASSET_ID}`);
|
|
6566
6542
|
return ASSET_DETAILS;
|
|
6567
6543
|
}
|
|
6568
6544
|
catch (error)
|
|
@@ -6596,7 +6572,7 @@ class NomadMediaSDK {
|
|
|
6596
6572
|
const ASSET_MANIFEST_WITH_COOKIES = await _getAssetManifestWithCookies(this, this.token,
|
|
6597
6573
|
this.config.serviceApiUrl, ASSET_ID, COOKIE_ID, this.config.apiType,
|
|
6598
6574
|
this.debugMode);
|
|
6599
|
-
_printDatetime(`Asset manifest with cookies retrieved for ${ASSET_ID}`);
|
|
6575
|
+
if (ASSET_MANIFEST_WITH_COOKIES) _printDatetime(`Asset manifest with cookies retrieved for ${ASSET_ID}`);
|
|
6600
6576
|
return ASSET_MANIFEST_WITH_COOKIES;
|
|
6601
6577
|
}
|
|
6602
6578
|
catch (error)
|
|
@@ -6634,7 +6610,7 @@ class NomadMediaSDK {
|
|
|
6634
6610
|
{
|
|
6635
6611
|
const ASSET_METADATA_SUMMARY = await _getAssetMetadataSummary(this, this.token,
|
|
6636
6612
|
this.config.serviceApiUrl, ASSET_ID, this.debugMode);
|
|
6637
|
-
_printDatetime(`Asset metadata summary retrieved for ${ASSET_ID}`);
|
|
6613
|
+
if (ASSET_METADATA_SUMMARY) _printDatetime(`Asset metadata summary retrieved for ${ASSET_ID}`);
|
|
6638
6614
|
return ASSET_METADATA_SUMMARY;
|
|
6639
6615
|
}
|
|
6640
6616
|
catch (error)
|
|
@@ -6679,7 +6655,7 @@ class NomadMediaSDK {
|
|
|
6679
6655
|
{
|
|
6680
6656
|
const ASSET_PARENT_FOLDERS = await _getAssetParentFolders(this, this.token,
|
|
6681
6657
|
this.config.serviceApiUrl, ASSET_ID, PAGE_SIZE, this.debugMode);
|
|
6682
|
-
_printDatetime(`Asset parent folders retrieved for ${ASSET_ID}`);
|
|
6658
|
+
if (ASSET_PARENT_FOLDERS) _printDatetime(`Asset parent folders retrieved for ${ASSET_ID}`);
|
|
6683
6659
|
return ASSET_PARENT_FOLDERS;
|
|
6684
6660
|
}
|
|
6685
6661
|
catch (error)
|
|
@@ -6719,7 +6695,7 @@ class NomadMediaSDK {
|
|
|
6719
6695
|
{
|
|
6720
6696
|
const ASSET_SCREENSHOT_DETAILS = await _getAssetScreenshotDetails(this, this.token,
|
|
6721
6697
|
this.config.serviceApiUrl, ASSET_ID, SEGMENT_ID, SCREENSHOT_ID, this.debugMode);
|
|
6722
|
-
_printDatetime(`Asset screenshot details retrieved for ${ASSET_ID}`);
|
|
6698
|
+
if (ASSET_SCREENSHOT_DETAILS) _printDatetime(`Asset screenshot details retrieved for ${ASSET_ID}`);
|
|
6723
6699
|
return ASSET_SCREENSHOT_DETAILS;
|
|
6724
6700
|
}
|
|
6725
6701
|
catch (error)
|
|
@@ -6758,7 +6734,7 @@ class NomadMediaSDK {
|
|
|
6758
6734
|
{
|
|
6759
6735
|
const ASSET_SEGMENT_DETAILS = await _getAssetSegmentDetails(this, this.token,
|
|
6760
6736
|
this.config.serviceApiUrl, ASSET_ID, SEGMENT_ID, this.debugMode);
|
|
6761
|
-
_printDatetime(`Asset segment details retrieved for ${ASSET_ID}`);
|
|
6737
|
+
if (ASSET_SEGMENT_DETAILS) _printDatetime(`Asset segment details retrieved for ${ASSET_ID}`);
|
|
6762
6738
|
return ASSET_SEGMENT_DETAILS;
|
|
6763
6739
|
}
|
|
6764
6740
|
catch (error)
|
|
@@ -6796,7 +6772,7 @@ class NomadMediaSDK {
|
|
|
6796
6772
|
{
|
|
6797
6773
|
const USER_UPLOAD_PARTS = await _getUserUploadParts(this, this.token,
|
|
6798
6774
|
this.config.serviceApiUrl, UPLOAD_ID, this.debugMode);
|
|
6799
|
-
_printDatetime(`User upload parts retrieved for ${UPLOAD_ID}`);
|
|
6775
|
+
if (USER_UPLOAD_PARTS) _printDatetime(`User upload parts retrieved for ${UPLOAD_ID}`);
|
|
6800
6776
|
return USER_UPLOAD_PARTS;
|
|
6801
6777
|
}
|
|
6802
6778
|
catch (error)
|
|
@@ -6834,7 +6810,7 @@ class NomadMediaSDK {
|
|
|
6834
6810
|
{
|
|
6835
6811
|
const UPLOAD_UPLOADS = await _getUserUploads(this, this.token,
|
|
6836
6812
|
this.config.serviceApiUrl, INCLUDE_COMPLETED_UPLOADS, this.debugMode);
|
|
6837
|
-
_printDatetime(`User uploads retrieved`);
|
|
6813
|
+
if (UPLOAD_UPLOADS) _printDatetime(`User uploads retrieved`);
|
|
6838
6814
|
return UPLOAD_UPLOADS;
|
|
6839
6815
|
}
|
|
6840
6816
|
catch (error)
|
|
@@ -6949,7 +6925,7 @@ class NomadMediaSDK {
|
|
|
6949
6925
|
{
|
|
6950
6926
|
const LOCAL_RESTORE_INFO = await _localRestoreAsset(this, this.token, this.config.serviceApiUrl,
|
|
6951
6927
|
ASSET_ID, PROFILE, this.debugMode);
|
|
6952
|
-
_printDatetime(`Asset local restored: ${ASSET_ID}`);
|
|
6928
|
+
if (LOCAL_RESTORE_INFO) _printDatetime(`Asset local restored: ${ASSET_ID}`);
|
|
6953
6929
|
return LOCAL_RESTORE_INFO;
|
|
6954
6930
|
}
|
|
6955
6931
|
catch (error)
|
|
@@ -6995,7 +6971,7 @@ class NomadMediaSDK {
|
|
|
6995
6971
|
const MOVE_INFO = await _moveAsset(this, this.token, this.config.serviceApiUrl,
|
|
6996
6972
|
ASSET_ID, DESTINATION_FOLDER_ID, NAME, BATCH_ACTION, CONTENT_DEFINITION_ID,
|
|
6997
6973
|
SCHEMA_NAME, this.id, RESOLVER_EXCEMPT, this.debugMode);
|
|
6998
|
-
_printDatetime(`Asset moved: ${ASSET_ID}`);
|
|
6974
|
+
if (MOVE_INFO) _printDatetime(`Asset moved: ${ASSET_ID}`);
|
|
6999
6975
|
return MOVE_INFO;
|
|
7000
6976
|
}
|
|
7001
6977
|
catch (error)
|
|
@@ -7106,7 +7082,7 @@ class NomadMediaSDK {
|
|
|
7106
7082
|
COLLECTIONS, RELATED_CONTENTS, SEQUENCER, ASSET_STATUS, STORAGE_CLASS, ASSET_TYPE,
|
|
7107
7083
|
CONTENT_LENGTH, STORAGE_EVENT_NAME, CREATED_DATE, STORAGE_SOURCE_IP_ADDRESS,
|
|
7108
7084
|
START_MEDIA_PROCESSOR, DELETE_MISSING_ASSET, this.debugMode);
|
|
7109
|
-
_printDatetime(`Asset registered: ${ASSET_ID}`);
|
|
7085
|
+
if (REGISTER_INFO) _printDatetime(`Asset registered: ${ASSET_ID}`);
|
|
7110
7086
|
return REGISTER_INFO;
|
|
7111
7087
|
}
|
|
7112
7088
|
catch (error)
|
|
@@ -7144,7 +7120,7 @@ class NomadMediaSDK {
|
|
|
7144
7120
|
{
|
|
7145
7121
|
const REPROCESS_INFO = await _reprocessAsset(this, this.token, this.config.serviceApiUrl,
|
|
7146
7122
|
TARGET_IDS, this.debugMode);
|
|
7147
|
-
_printDatetime(`Asset reprocessed`);
|
|
7123
|
+
if (REPROCESS_INFO) _printDatetime(`Asset reprocessed`);
|
|
7148
7124
|
return REPROCESS_INFO;
|
|
7149
7125
|
}
|
|
7150
7126
|
catch (error)
|
|
@@ -7218,7 +7194,7 @@ class NomadMediaSDK {
|
|
|
7218
7194
|
{
|
|
7219
7195
|
const SHARE_INFO = await _shareAsset(this, this.token, this.config.serviceApiUrl,
|
|
7220
7196
|
ASSET_ID, NOMAD_USERS, EXTERNAL_USERS, SHARE_DURATION_IN_HOURS, this.debugMode);
|
|
7221
|
-
_printDatetime(`Asset shared: ${ASSET_ID}`);
|
|
7197
|
+
if (SHARE_INFO) _printDatetime(`Asset shared: ${ASSET_ID}`);
|
|
7222
7198
|
return SHARE_INFO;
|
|
7223
7199
|
}
|
|
7224
7200
|
catch (error)
|
|
@@ -7258,7 +7234,7 @@ class NomadMediaSDK {
|
|
|
7258
7234
|
{
|
|
7259
7235
|
const START_INFO = await _startWorkflow(this, this.token, this.config.serviceApiUrl,
|
|
7260
7236
|
ACTION_ARGUMENTS, TARGET_IDS, this.debugMode);
|
|
7261
|
-
_printDatetime(`Workflow started`);
|
|
7237
|
+
if (START_INFO) _printDatetime(`Workflow started`);
|
|
7262
7238
|
return START_INFO;
|
|
7263
7239
|
}
|
|
7264
7240
|
catch (error)
|
|
@@ -7347,7 +7323,7 @@ class NomadMediaSDK {
|
|
|
7347
7323
|
const UPDATE_INFO = await _updateAnnotation(this, this.token, this.config.serviceApiUrl,
|
|
7348
7324
|
ASSET_ID, ANNOTATION_ID, START_TIME_CODE, END_TIME_CODE, TITLE, SUMMARY,
|
|
7349
7325
|
DESCRIPTION, CONTENT_ID, IMAGE_URL, this.debugMode);
|
|
7350
|
-
_printDatetime(`Annotation updated`);
|
|
7326
|
+
if (UPDATE_INFO) _printDatetime(`Annotation updated`);
|
|
7351
7327
|
return UPDATE_INFO;
|
|
7352
7328
|
}
|
|
7353
7329
|
catch (error)
|
|
@@ -7438,7 +7414,7 @@ class NomadMediaSDK {
|
|
|
7438
7414
|
{
|
|
7439
7415
|
const UPDATE_INFO = await _updateAssetAdBreak(this, this.token, this.config.serviceApiUrl,
|
|
7440
7416
|
ASSET_ID, AD_BREAK_ID, TIME_CODE, TAGS, LABELS, this.debugMode);
|
|
7441
|
-
_printDatetime(`Asset ad break updated`);
|
|
7417
|
+
if (UPDATE_INFO) _printDatetime(`Asset ad break updated`);
|
|
7442
7418
|
return UPDATE_INFO;
|
|
7443
7419
|
}
|
|
7444
7420
|
catch (error)
|
|
@@ -7510,7 +7486,7 @@ class NomadMediaSDK {
|
|
|
7510
7486
|
{
|
|
7511
7487
|
const PING = await _ping(this, this.token, this.config.serviceApiUrl,
|
|
7512
7488
|
APPLICATION_ID, USER_SESSION_ID, this.debugMode);
|
|
7513
|
-
_printDatetime(`User pinged`);
|
|
7489
|
+
if (PING) _printDatetime(`User pinged`);
|
|
7514
7490
|
return PING;
|
|
7515
7491
|
}
|
|
7516
7492
|
catch (error)
|
|
@@ -7543,7 +7519,7 @@ class NomadMediaSDK {
|
|
|
7543
7519
|
{
|
|
7544
7520
|
const PING = await _pingAuth(this, this.token, this.config.serviceApiUrl,
|
|
7545
7521
|
APPLICATION_ID, USER_SESSION_ID, this.debugMode);
|
|
7546
|
-
_printDatetime(`User pinged`);
|
|
7522
|
+
if (PING) _printDatetime(`User pinged`);
|
|
7547
7523
|
return PING;
|
|
7548
7524
|
}
|
|
7549
7525
|
catch (error)
|
|
@@ -7627,7 +7603,7 @@ class NomadMediaSDK {
|
|
|
7627
7603
|
MIN_SCORE, EXCLUDE_TOTAL_RECORD_COUNT, FILTER_BINDER, FULL_URL_FIELD_NAMES,
|
|
7628
7604
|
DISTINCT_ON_FIELD_NAME, INCLUDE_VIDEO_CLIPS, USE_LLM_SEARCH,
|
|
7629
7605
|
INCLUDE_INTERNAL_FIELDS_IN_RESULTS, this.config.apiType, this.debugMode);
|
|
7630
|
-
_printDatetime(`Search complete`);
|
|
7606
|
+
if (SEARCH_INFO) _printDatetime(`Search complete`);
|
|
7631
7607
|
return SEARCH_INFO.hasItems ? SEARCH_INFO : false
|
|
7632
7608
|
}
|
|
7633
7609
|
catch (error)
|
|
@@ -7738,7 +7714,7 @@ class NomadMediaSDK {
|
|
|
7738
7714
|
{
|
|
7739
7715
|
const GET_USER_INFO = await _getUser(this, this.token, this.config.serviceApiUrl,
|
|
7740
7716
|
this.debugMode);
|
|
7741
|
-
_printDatetime(`User gotten`);
|
|
7717
|
+
if (GET_USER_INFO) _printDatetime(`User gotten`);
|
|
7742
7718
|
return GET_USER_INFO;
|
|
7743
7719
|
}
|
|
7744
7720
|
catch (error)
|
|
@@ -7789,7 +7765,7 @@ class NomadMediaSDK {
|
|
|
7789
7765
|
const UPDATE_USER_INFO = await _updateUser(this, this.token, this.config.serviceApiUrl,
|
|
7790
7766
|
ADDRESS, ADDRESS2, CITY, COUNTRY, FIRST_NAME, LAST_NAME, ORGANIZATION, PHONE_NUMBER,
|
|
7791
7767
|
PHONE_EXT, POSTAL_CODE, STATE, this.debugMode);
|
|
7792
|
-
_printDatetime(`User updated`);
|
|
7768
|
+
if (UPDATE_USER_INFO) _printDatetime(`User updated`);
|
|
7793
7769
|
return UPDATE_USER_INFO;
|
|
7794
7770
|
}
|
|
7795
7771
|
catch (error)
|
|
@@ -7830,7 +7806,7 @@ class NomadMediaSDK {
|
|
|
7830
7806
|
{
|
|
7831
7807
|
const ADD_CONTENT_TO_CONTENT_GROUP_INFO = await _addContentsToContentGroup(this, this.token,
|
|
7832
7808
|
this.config.serviceApiUrl, CONTENT_GROUP_ID, CONTENT_IDS, this.debugMode);
|
|
7833
|
-
_printDatetime(`Content added to content group: ${CONTENT_GROUP_ID}`);
|
|
7809
|
+
if (ADD_CONTENT_TO_CONTENT_GROUP_INFO) _printDatetime(`Content added to content group: ${CONTENT_GROUP_ID}`);
|
|
7834
7810
|
return ADD_CONTENT_TO_CONTENT_GROUP_INFO;
|
|
7835
7811
|
}
|
|
7836
7812
|
catch (error)
|
|
@@ -7869,7 +7845,7 @@ class NomadMediaSDK {
|
|
|
7869
7845
|
{
|
|
7870
7846
|
const CREATE_CONTENT_GROUP_INFO = await _createContentGroup(this, this.token,
|
|
7871
7847
|
this.config.serviceApiUrl, NAME, this.debugMode);
|
|
7872
|
-
_printDatetime(`Content group created: ${NAME}`);
|
|
7848
|
+
if (CREATE_CONTENT_GROUP_INFO) _printDatetime(`Content group created: ${NAME}`);
|
|
7873
7849
|
return CREATE_CONTENT_GROUP_INFO;
|
|
7874
7850
|
}
|
|
7875
7851
|
catch (error)
|
|
@@ -7906,7 +7882,7 @@ class NomadMediaSDK {
|
|
|
7906
7882
|
{
|
|
7907
7883
|
const DELETE_CONTENT_GROUP_INFO = await _deleteContentGroup(this, this.token,
|
|
7908
7884
|
this.config.serviceApiUrl, CONTENT_GROUP_ID, this.debugMode);
|
|
7909
|
-
_printDatetime(`Content group deleted: ${CONTENT_GROUP_ID}`);
|
|
7885
|
+
if (DELETE_CONTENT_GROUP_INFO) _printDatetime(`Content group deleted: ${CONTENT_GROUP_ID}`);
|
|
7910
7886
|
return DELETE_CONTENT_GROUP_INFO;
|
|
7911
7887
|
}
|
|
7912
7888
|
catch (error)
|
|
@@ -7945,7 +7921,7 @@ class NomadMediaSDK {
|
|
|
7945
7921
|
{
|
|
7946
7922
|
const GET_CONTENT_GROUP_INFO = await _getContentGroup(this, this.token,
|
|
7947
7923
|
this.config.serviceApiUrl, CONTENT_GROUP_ID, this.debugMode);
|
|
7948
|
-
_printDatetime(`Content group gotten: ${CONTENT_GROUP_ID}`);
|
|
7924
|
+
if (GET_CONTENT_GROUP_INFO) _printDatetime(`Content group gotten: ${CONTENT_GROUP_ID}`);
|
|
7949
7925
|
return GET_CONTENT_GROUP_INFO;
|
|
7950
7926
|
}
|
|
7951
7927
|
catch (error)
|
|
@@ -7983,7 +7959,7 @@ class NomadMediaSDK {
|
|
|
7983
7959
|
{
|
|
7984
7960
|
const GET_CONTENT_GROUPS_INFO = await _getContentGroups(this, this.token,
|
|
7985
7961
|
this.config.serviceApiUrl, this.debugMode);
|
|
7986
|
-
_printDatetime(`Content groups gotten`);
|
|
7962
|
+
if (GET_CONTENT_GROUPS_INFO) _printDatetime(`Content groups gotten`);
|
|
7987
7963
|
return GET_CONTENT_GROUPS_INFO;
|
|
7988
7964
|
}
|
|
7989
7965
|
catch (error)
|
|
@@ -8023,7 +7999,7 @@ class NomadMediaSDK {
|
|
|
8023
7999
|
{
|
|
8024
8000
|
const GET_PORTAL_GROUPS_INFO = await _getPortalGroups(this, this.token,
|
|
8025
8001
|
this.config.serviceApiUrl, PORTAL_GROUPS, this.debugMode);
|
|
8026
|
-
_printDatetime(`Portal groups gotten`);
|
|
8002
|
+
if (GET_PORTAL_GROUPS_INFO) _printDatetime(`Portal groups gotten`);
|
|
8027
8003
|
return GET_PORTAL_GROUPS_INFO;
|
|
8028
8004
|
}
|
|
8029
8005
|
catch (error)
|
|
@@ -8063,7 +8039,7 @@ class NomadMediaSDK {
|
|
|
8063
8039
|
{
|
|
8064
8040
|
const REMOVE_CONTENT_FROM_CONTENT_GROUP_INFO = await _removeContentsFromContentGroup(
|
|
8065
8041
|
this, this.token, this.config.serviceApiUrl, CONTENT_GROUP_ID, CONTENTS, this.debugMode);
|
|
8066
|
-
_printDatetime(`Content removed from content group: ${CONTENT_GROUP_ID}`);
|
|
8042
|
+
if (REMOVE_CONTENT_FROM_CONTENT_GROUP_INFO) _printDatetime(`Content removed from content group: ${CONTENT_GROUP_ID}`);
|
|
8067
8043
|
return REMOVE_CONTENT_FROM_CONTENT_GROUP_INFO;
|
|
8068
8044
|
}
|
|
8069
8045
|
catch (error)
|
|
@@ -8101,7 +8077,7 @@ class NomadMediaSDK {
|
|
|
8101
8077
|
{
|
|
8102
8078
|
const RENAME_CONTENT_GROUP_INFO = await _renameContentGroup(this, this.token,
|
|
8103
8079
|
this.config.serviceApiUrl, CONTENT_GROUP_ID, NAME, this.debugMode);
|
|
8104
|
-
_printDatetime(`Content group renamed: ${CONTENT_GROUP_ID}`);
|
|
8080
|
+
if (RENAME_CONTENT_GROUP_INFO) _printDatetime(`Content group renamed: ${CONTENT_GROUP_ID}`);
|
|
8105
8081
|
return RENAME_CONTENT_GROUP_INFO;
|
|
8106
8082
|
}
|
|
8107
8083
|
catch (error)
|
|
@@ -8143,7 +8119,7 @@ class NomadMediaSDK {
|
|
|
8143
8119
|
{
|
|
8144
8120
|
const SHARE_CONTENT_GROUP_WITH_USERS_INFO = await _shareContentGroupWithUsers(this, this.token,
|
|
8145
8121
|
this.config.serviceApiUrl, CONTENT_GROUP_ID, USER_IDS, this.debugMode);
|
|
8146
|
-
_printDatetime(`Content group shared with users: ${CONTENT_GROUP_ID}`);
|
|
8122
|
+
if (SHARE_CONTENT_GROUP_WITH_USERS_INFO) _printDatetime(`Content group shared with users: ${CONTENT_GROUP_ID}`);
|
|
8147
8123
|
return SHARE_CONTENT_GROUP_WITH_USERS_INFO;
|
|
8148
8124
|
}
|
|
8149
8125
|
catch (error)
|
|
@@ -8183,7 +8159,7 @@ class NomadMediaSDK {
|
|
|
8183
8159
|
{
|
|
8184
8160
|
const STOP_SHARING_CONTENT_GROUP_WITH_USERS_INFO = await _stopSharingContentGroupWithUsers(
|
|
8185
8161
|
this, this.token, this.config.serviceApiUrl, CONTENT_GROUP_ID, USER_IDS, this.debugMode);
|
|
8186
|
-
_printDatetime(`Content group stopped sharing with users: ${CONTENT_GROUP_ID}`);
|
|
8162
|
+
if (STOP_SHARING_CONTENT_GROUP_WITH_USERS_INFO) _printDatetime(`Content group stopped sharing with users: ${CONTENT_GROUP_ID}`);
|
|
8187
8163
|
return STOP_SHARING_CONTENT_GROUP_WITH_USERS_INFO;
|
|
8188
8164
|
}
|
|
8189
8165
|
catch (error)
|
|
@@ -8302,7 +8278,7 @@ class NomadMediaSDK {
|
|
|
8302
8278
|
{
|
|
8303
8279
|
const GET_FORMS_INFO = await _createForm(this, this.token, this.config.serviceApiUrl,
|
|
8304
8280
|
CONTENT_DEFINITION_ID, FORM_INFO, this.debugMode);
|
|
8305
|
-
_printDatetime(`Form created`);
|
|
8281
|
+
if (GET_FORMS_INFO) _printDatetime(`Form created`);
|
|
8306
8282
|
return GET_FORMS_INFO;
|
|
8307
8283
|
}
|
|
8308
8284
|
catch (error)
|
|
@@ -8342,7 +8318,7 @@ class NomadMediaSDK {
|
|
|
8342
8318
|
{
|
|
8343
8319
|
const GET_CONTENT_COOKIES_INFO = await _getContentCookies(this, this.token,
|
|
8344
8320
|
this.config.serviceApiUrl, CONTENT_ID, this.debugMode);
|
|
8345
|
-
_printDatetime(`Content cookies gotten`);
|
|
8321
|
+
if (GET_CONTENT_COOKIES_INFO) _printDatetime(`Content cookies gotten`);
|
|
8346
8322
|
return GET_CONTENT_COOKIES_INFO;
|
|
8347
8323
|
}
|
|
8348
8324
|
catch (error)
|
|
@@ -8379,7 +8355,7 @@ class NomadMediaSDK {
|
|
|
8379
8355
|
{
|
|
8380
8356
|
const GET_DYNAMIC_CONTENTS_INFO = await _getDefaultSiteConfig(this, this.token,
|
|
8381
8357
|
this.config.serviceApiUrl, this.debugMode);
|
|
8382
|
-
_printDatetime(`Default site config gotten`);
|
|
8358
|
+
if (GET_DYNAMIC_CONTENTS_INFO) _printDatetime(`Default site config gotten`);
|
|
8383
8359
|
return GET_DYNAMIC_CONTENTS_INFO;
|
|
8384
8360
|
}
|
|
8385
8361
|
catch (error)
|
|
@@ -8412,7 +8388,7 @@ class NomadMediaSDK {
|
|
|
8412
8388
|
{
|
|
8413
8389
|
const GET_DYNAMIC_CONTENT_INFO = await _getDynamicContent(this, this.token,
|
|
8414
8390
|
this.config.serviceApiUrl, DYNAMIC_CONTENT_RECORD_ID, this.debugMode);
|
|
8415
|
-
_printDatetime(`Dynamic content gotten: ${DYNAMIC_CONTENT_RECORD_ID}`);
|
|
8391
|
+
if (GET_DYNAMIC_CONTENT_INFO) _printDatetime(`Dynamic content gotten: ${DYNAMIC_CONTENT_RECORD_ID}`);
|
|
8416
8392
|
return GET_DYNAMIC_CONTENT_INFO;
|
|
8417
8393
|
}
|
|
8418
8394
|
catch (error)
|
|
@@ -8449,7 +8425,7 @@ class NomadMediaSDK {
|
|
|
8449
8425
|
{
|
|
8450
8426
|
const GET_DYNAMIC_CONTENTS_INFO = await _getDynamicContents(this, this.token,
|
|
8451
8427
|
this.config.serviceApiUrl, this.debugMode);
|
|
8452
|
-
_printDatetime(`Dynamic contents gotten`);
|
|
8428
|
+
if (GET_DYNAMIC_CONTENTS_INFO) _printDatetime(`Dynamic contents gotten`);
|
|
8453
8429
|
return GET_DYNAMIC_CONTENTS_INFO;
|
|
8454
8430
|
}
|
|
8455
8431
|
catch (error)
|
|
@@ -8487,7 +8463,7 @@ class NomadMediaSDK {
|
|
|
8487
8463
|
{
|
|
8488
8464
|
const GET_MEDIA_GROUP_INFO = await _getMediaGroup(this, this.token, this.config.serviceApiUrl,
|
|
8489
8465
|
MEDIA_GROUP_ID, this.debugMode);
|
|
8490
|
-
_printDatetime(`Media group gotten: ${MEDIA_GROUP_ID}`);
|
|
8466
|
+
if (GET_MEDIA_GROUP_INFO) _printDatetime(`Media group gotten: ${MEDIA_GROUP_ID}`);
|
|
8491
8467
|
return GET_MEDIA_GROUP_INFO;
|
|
8492
8468
|
}
|
|
8493
8469
|
catch (error)
|
|
@@ -8525,7 +8501,7 @@ class NomadMediaSDK {
|
|
|
8525
8501
|
{
|
|
8526
8502
|
const GET_MEDIA_ITEM_INFO = await _getMediaItem(this, this.token, this.config.serviceApiUrl,
|
|
8527
8503
|
MEDIA_ITEM_ID, this.debugMode);
|
|
8528
|
-
_printDatetime(`Media item gotten: ${MEDIA_ITEM_ID}`);
|
|
8504
|
+
if (GET_MEDIA_ITEM_INFO) _printDatetime(`Media item gotten: ${MEDIA_ITEM_ID}`);
|
|
8529
8505
|
return GET_MEDIA_ITEM_INFO;
|
|
8530
8506
|
}
|
|
8531
8507
|
catch (error)
|
|
@@ -8564,7 +8540,7 @@ class NomadMediaSDK {
|
|
|
8564
8540
|
{
|
|
8565
8541
|
const GET_MY_CONTENT_INFO = await _getMyContent(this, this.token, this.config.serviceApiUrl,
|
|
8566
8542
|
this.debugMode);
|
|
8567
|
-
_printDatetime(`My content gotten`);
|
|
8543
|
+
if (GET_MY_CONTENT_INFO) _printDatetime(`My content gotten`);
|
|
8568
8544
|
return GET_MY_CONTENT_INFO;
|
|
8569
8545
|
}
|
|
8570
8546
|
catch (error)
|
|
@@ -8597,7 +8573,7 @@ class NomadMediaSDK {
|
|
|
8597
8573
|
{
|
|
8598
8574
|
const GET_MY_GROUP_INFO = await _getMyGroup(this, this.token, this.config.serviceApiUrl,
|
|
8599
8575
|
GROUP_ID, this.debugMode);
|
|
8600
|
-
_printDatetime(`My group gotten: ${GROUP_ID}`);
|
|
8576
|
+
if (GET_MY_GROUP_INFO) _printDatetime(`My group gotten: ${GROUP_ID}`);
|
|
8601
8577
|
return GET_MY_GROUP_INFO;
|
|
8602
8578
|
}
|
|
8603
8579
|
catch (error)
|
|
@@ -8630,7 +8606,7 @@ class NomadMediaSDK {
|
|
|
8630
8606
|
{
|
|
8631
8607
|
const GET_DYNAMIC_CONTENT_INFO = await _getSiteConfig(this, this.token,
|
|
8632
8608
|
this.config.serviceApiUrl, SITE_CONFIG_RECORD_ID, this.debugMode);
|
|
8633
|
-
_printDatetime(`Site config gotten: ${SITE_CONFIG_RECORD_ID}`);
|
|
8609
|
+
if (GET_DYNAMIC_CONTENT_INFO) _printDatetime(`Site config gotten: ${SITE_CONFIG_RECORD_ID}`);
|
|
8634
8610
|
return GET_DYNAMIC_CONTENT_INFO;
|
|
8635
8611
|
}
|
|
8636
8612
|
catch (error)
|
|
@@ -8673,7 +8649,7 @@ class NomadMediaSDK {
|
|
|
8673
8649
|
{
|
|
8674
8650
|
const MEDIA_SEARCH_INFO = await _mediaSearch(this, this.token, this.config.serviceApiUrl,
|
|
8675
8651
|
QUERY, IDS, SORT_FIELDS, OFFSET, SIZE, this.debugMode);
|
|
8676
|
-
_printDatetime(`Media search complete`);
|
|
8652
|
+
if (MEDIA_SEARCH_INFO) _printDatetime(`Media search complete`);
|
|
8677
8653
|
return MEDIA_SEARCH_INFO;
|
|
8678
8654
|
}
|
|
8679
8655
|
catch (error)
|
|
@@ -8723,7 +8699,7 @@ class NomadMediaSDK {
|
|
|
8723
8699
|
const CREATE_MEDIA_BUILDER_INFO = await _createMediaBuilder(this, this.token,
|
|
8724
8700
|
this.config.serviceApiUrl, NAME, DESTINATION_FOLDER_ID, COLLECTIONS,
|
|
8725
8701
|
RELATED_CONTENTS, TAGS, PROPERTIES, this.debugMode);
|
|
8726
|
-
_printDatetime(`Media builder created`);
|
|
8702
|
+
if (CREATE_MEDIA_BUILDER_INFO) _printDatetime(`Media builder created`);
|
|
8727
8703
|
return CREATE_MEDIA_BUILDER_INFO;
|
|
8728
8704
|
}
|
|
8729
8705
|
catch (error)
|
|
@@ -8767,7 +8743,7 @@ class NomadMediaSDK {
|
|
|
8767
8743
|
this.config.serviceApiUrl, MEDIA_BUILDER_ID, SOURCE_ASSET_ID, START_TIME_CODE,
|
|
8768
8744
|
END_TIME_CODE, SOURCE_ANNOTATION_ID, RELATED_CONTENTS, this.debugMode);
|
|
8769
8745
|
|
|
8770
|
-
_printDatetime(`Media builder item created`);
|
|
8746
|
+
if (CREATE_MEDIA_BUILDER_ITEM_INFO) _printDatetime(`Media builder item created`);
|
|
8771
8747
|
return CREATE_MEDIA_BUILDER_ITEM_INFO;
|
|
8772
8748
|
}
|
|
8773
8749
|
catch (error)
|
|
@@ -8804,7 +8780,7 @@ class NomadMediaSDK {
|
|
|
8804
8780
|
this.token, this.config.serviceApiUrl, MEDIA_BUILDER_ID, SOURCE_ASSET_ID,
|
|
8805
8781
|
this.debugMode);
|
|
8806
8782
|
|
|
8807
|
-
_printDatetime(`Media builder item created and annotations added`);
|
|
8783
|
+
if (CREATE_MEDIA_BUILDER_ITEM_INFO) _printDatetime(`Media builder item created and annotations added`);
|
|
8808
8784
|
return CREATE_MEDIA_BUILDER_ITEM_INFO;
|
|
8809
8785
|
}
|
|
8810
8786
|
catch (error)
|
|
@@ -8842,7 +8818,7 @@ class NomadMediaSDK {
|
|
|
8842
8818
|
const CREATE_MEDIA_BUILDER_ITEMS_INFO = await _createMediaBuilderItemsBulk(this, this.token,
|
|
8843
8819
|
this.config.serviceApiUrl, MEDIA_BUILDER_ID, MEDIA_BUILDER_ITEMS, this.debugMode);
|
|
8844
8820
|
|
|
8845
|
-
_printDatetime(`Media builder items created`);
|
|
8821
|
+
if (CREATE_MEDIA_BUILDER_ITEMS_INFO) _printDatetime(`Media builder items created`);
|
|
8846
8822
|
return CREATE_MEDIA_BUILDER_ITEMS_INFO;
|
|
8847
8823
|
}
|
|
8848
8824
|
catch (error)
|
|
@@ -8963,7 +8939,7 @@ class NomadMediaSDK {
|
|
|
8963
8939
|
const DUPLICATE_MEDIA_BUILDER_INFO = await _duplicateMediaBuilder(this, this.token,
|
|
8964
8940
|
this.config.serviceApiUrl, MEDIA_BUILDER_ID, NAME, DESTINATION_FOLDER_ID, COLLECTIONS,
|
|
8965
8941
|
RELATED_CONTENTS, PROPERTIES, this.debugMode);
|
|
8966
|
-
_printDatetime(`Media builder duplicated: ${MEDIA_BUILDER_ID}`);
|
|
8942
|
+
if (DUPLICATE_MEDIA_BUILDER_INFO) _printDatetime(`Media builder duplicated: ${MEDIA_BUILDER_ID}`);
|
|
8967
8943
|
return DUPLICATE_MEDIA_BUILDER_INFO;
|
|
8968
8944
|
}
|
|
8969
8945
|
catch (error)
|
|
@@ -9001,7 +8977,7 @@ class NomadMediaSDK {
|
|
|
9001
8977
|
{
|
|
9002
8978
|
const GET_MEDIA_BUILDER_INFO = await _getMediaBuilder(this, this.token,
|
|
9003
8979
|
this.config.serviceApiUrl, MEDIA_BUILDER_ID, this.debugMode);
|
|
9004
|
-
_printDatetime(`Media builder gotten: ${MEDIA_BUILDER_ID}`);
|
|
8980
|
+
if (GET_MEDIA_BUILDER_INFO) _printDatetime(`Media builder gotten: ${MEDIA_BUILDER_ID}`);
|
|
9005
8981
|
return GET_MEDIA_BUILDER_INFO;
|
|
9006
8982
|
}
|
|
9007
8983
|
catch (error)
|
|
@@ -9039,7 +9015,7 @@ class NomadMediaSDK {
|
|
|
9039
9015
|
{
|
|
9040
9016
|
const GET_MEDIA_BUILDER_IDS_FROM_ASSET_INFO = await _getMediaBuilderIdsFromAsset(this, this.token,
|
|
9041
9017
|
this.config.serviceApiUrl, SOURCE_ASSET_ID, this.debugMode);
|
|
9042
|
-
_printDatetime(`Media builder ids from asset gotten: ${SOURCE_ASSET_ID}`);
|
|
9018
|
+
if (GET_MEDIA_BUILDER_IDS_FROM_ASSET_INFO) _printDatetime(`Media builder ids from asset gotten: ${SOURCE_ASSET_ID}`);
|
|
9043
9019
|
return GET_MEDIA_BUILDER_IDS_FROM_ASSET_INFO;
|
|
9044
9020
|
}
|
|
9045
9021
|
catch (error)
|
|
@@ -9076,7 +9052,7 @@ class NomadMediaSDK {
|
|
|
9076
9052
|
{
|
|
9077
9053
|
const GET_MEDIA_BUILDERS_INFO = await _getMediaBuilders(this, this.token,
|
|
9078
9054
|
this.config.serviceApiUrl, this.debugMode);
|
|
9079
|
-
_printDatetime(`Media builders gotten`);
|
|
9055
|
+
if (GET_MEDIA_BUILDERS_INFO) _printDatetime(`Media builders gotten`);
|
|
9080
9056
|
return GET_MEDIA_BUILDERS_INFO;
|
|
9081
9057
|
}
|
|
9082
9058
|
catch (error)
|
|
@@ -9114,7 +9090,7 @@ class NomadMediaSDK {
|
|
|
9114
9090
|
{
|
|
9115
9091
|
const GET_MEDIA_BUILDER_ITEMS_INFO = await _getMediaBuilderItems(this, this.token,
|
|
9116
9092
|
this.config.serviceApiUrl, MEDIA_BUILDER_ID, this.debugMode);
|
|
9117
|
-
_printDatetime(`Media builder items gotten: ${MEDIA_BUILDER_ID}`);
|
|
9093
|
+
if (GET_MEDIA_BUILDER_ITEMS_INFO) _printDatetime(`Media builder items gotten: ${MEDIA_BUILDER_ID}`);
|
|
9118
9094
|
return GET_MEDIA_BUILDER_ITEMS_INFO;
|
|
9119
9095
|
}
|
|
9120
9096
|
catch (error)
|
|
@@ -9190,7 +9166,7 @@ class NomadMediaSDK {
|
|
|
9190
9166
|
{
|
|
9191
9167
|
const RENDER_MEDIA_BUILDER_INFO = await _renderMediaBuilder(this, this.token,
|
|
9192
9168
|
this.config.serviceApiUrl, MEDIA_BUILDER_ID, this.debugMode);
|
|
9193
|
-
_printDatetime(`Media builder rendered: ${MEDIA_BUILDER_ID}`);
|
|
9169
|
+
if (RENDER_MEDIA_BUILDER_INFO) _printDatetime(`Media builder rendered: ${MEDIA_BUILDER_ID}`);
|
|
9194
9170
|
return RENDER_MEDIA_BUILDER_INFO;
|
|
9195
9171
|
}
|
|
9196
9172
|
catch (error)
|
|
@@ -9240,7 +9216,7 @@ class NomadMediaSDK {
|
|
|
9240
9216
|
const UPDATE_MEDIA_BUILDER_INFO = await _updateMediaBuilder(this, this.token,
|
|
9241
9217
|
this.config.serviceApiUrl, MEDIA_BUILDER_ID, NAME, DESTINATION_FOLDER_ID, COLLECTIONS,
|
|
9242
9218
|
RELATED_CONTENTS, TAGS, PROPERTIES, this.debugMode);
|
|
9243
|
-
_printDatetime(`Media builder updated: ${MEDIA_BUILDER_ID}`);
|
|
9219
|
+
if (UPDATE_MEDIA_BUILDER_INFO) _printDatetime(`Media builder updated: ${MEDIA_BUILDER_ID}`);
|
|
9244
9220
|
return UPDATE_MEDIA_BUILDER_INFO;
|
|
9245
9221
|
}
|
|
9246
9222
|
catch (error)
|
|
@@ -9287,7 +9263,7 @@ class NomadMediaSDK {
|
|
|
9287
9263
|
const GUEST_INVITE_INFO = await _guestInvite(this, this.token, this.config.serviceApiUrl,
|
|
9288
9264
|
CONTENT_ID, CONTENT_DEFINITION_ID, USER_ID, EMAILS, CONTENT_SECURITY_ATTRIBUTE,
|
|
9289
9265
|
this.debugMode);
|
|
9290
|
-
_printDatetime(`Guest invited`);
|
|
9266
|
+
if (GUEST_INVITE_INFO) _printDatetime(`Guest invited`);
|
|
9291
9267
|
return GUEST_INVITE_INFO;
|
|
9292
9268
|
}
|
|
9293
9269
|
catch (error)
|
|
@@ -9328,7 +9304,7 @@ class NomadMediaSDK {
|
|
|
9328
9304
|
{
|
|
9329
9305
|
const REGISTER_GUEST_INFO = await _registerGuest(this, this.token, this.config.serviceApiUrl, EMAIL,
|
|
9330
9306
|
FIRST_NAME, LAST_NAME, PASSWORD, this.debugMode);
|
|
9331
|
-
_printDatetime(`Guest registered: ${EMAIL}`);
|
|
9307
|
+
if (REGISTER_GUEST_INFO) _printDatetime(`Guest registered: ${EMAIL}`);
|
|
9332
9308
|
return REGISTER_GUEST_INFO;
|
|
9333
9309
|
}
|
|
9334
9310
|
catch (error)
|
|
@@ -9371,7 +9347,7 @@ class NomadMediaSDK {
|
|
|
9371
9347
|
const REMOVE_GUEST_INFO = await _removeGuest(this, this.token, this.config.serviceApiUrl,
|
|
9372
9348
|
CONTENT_ID, CONTENT_DEFINITION_ID, USER_ID, EMAILS, CONTENT_SECURITY_ATTRIBUTE,
|
|
9373
9349
|
this.debugMode);
|
|
9374
|
-
_printDatetime(`Guest removed`);
|
|
9350
|
+
if (REMOVE_GUEST_INFO) _printDatetime(`Guest removed`);
|
|
9375
9351
|
return REMOVE_GUEST_INFO;
|
|
9376
9352
|
}
|
|
9377
9353
|
catch (error)
|
|
@@ -9439,7 +9415,7 @@ class NomadMediaSDK {
|
|
|
9439
9415
|
TYPE, QUERY, OFFSET, SIZE, FILTERS, SORT_FIELDS, SEARCH_RESULT_FIELDS,
|
|
9440
9416
|
SIMILAR_ASSET_ID, MIN_SCORE, EXCLUDE_TOTAL_RECORD_COUNT, FILTER_BINDER,
|
|
9441
9417
|
this.debugMode);
|
|
9442
|
-
_printDatetime("Saved search added");
|
|
9418
|
+
if (ADD_SAVED_SEARCH_INFO) _printDatetime("Saved search added");
|
|
9443
9419
|
return ADD_SAVED_SEARCH_INFO;
|
|
9444
9420
|
}
|
|
9445
9421
|
catch (error)
|
|
@@ -9512,7 +9488,7 @@ class NomadMediaSDK {
|
|
|
9512
9488
|
{
|
|
9513
9489
|
const GET_SAVED_SEARCH_INFO = await _getSavedSearch(this, this.token, this.config.serviceApiUrl,
|
|
9514
9490
|
ID, this.debugMode);
|
|
9515
|
-
_printDatetime(`Saved search gotten: ${ID}`);
|
|
9491
|
+
if (GET_SAVED_SEARCH_INFO) _printDatetime(`Saved search gotten: ${ID}`);
|
|
9516
9492
|
return GET_SAVED_SEARCH_INFO;
|
|
9517
9493
|
}
|
|
9518
9494
|
catch (error)
|
|
@@ -9549,7 +9525,7 @@ class NomadMediaSDK {
|
|
|
9549
9525
|
{
|
|
9550
9526
|
const GET_SAVED_SEARCHES_INFO = await _getSavedSearches(this, this.token,
|
|
9551
9527
|
this.config.serviceApiUrl, this.debugMode);
|
|
9552
|
-
_printDatetime("Saved searches gotten");
|
|
9528
|
+
if (GET_SAVED_SEARCHES_INFO) _printDatetime("Saved searches gotten");
|
|
9553
9529
|
return GET_SAVED_SEARCHES_INFO;
|
|
9554
9530
|
}
|
|
9555
9531
|
catch (error)
|
|
@@ -9608,7 +9584,7 @@ class NomadMediaSDK {
|
|
|
9608
9584
|
this.config.serviceApiUrl, QUERY, OFFSET, SIZE, FILTERS, SORT_FIELDS,
|
|
9609
9585
|
SEARCH_RESULT_FIELDS, SIMILAR_ASSET_ID, MIN_SCORE, EXCLUDE_TOTAL_RECORD_COUNT,
|
|
9610
9586
|
FILTER_BINDER, this.debugMode);
|
|
9611
|
-
_printDatetime("Search saved gotten");
|
|
9587
|
+
if (GET_SEARCH_SAVED_INFO) _printDatetime("Search saved gotten");
|
|
9612
9588
|
return GET_SEARCH_SAVED_INFO;
|
|
9613
9589
|
}
|
|
9614
9590
|
catch (error)
|
|
@@ -9646,7 +9622,7 @@ class NomadMediaSDK {
|
|
|
9646
9622
|
{
|
|
9647
9623
|
const GET_SEARCH_SAVED_BY_ID_INFO = await _getSearchSavedById(this, this.token,
|
|
9648
9624
|
this.config.serviceApiUrl, ID, this.debugMode);
|
|
9649
|
-
_printDatetime(`Search saved by ID gotten: ${ID}`);
|
|
9625
|
+
if (GET_SEARCH_SAVED_BY_ID_INFO) _printDatetime(`Search saved by ID gotten: ${ID}`);
|
|
9650
9626
|
return GET_SEARCH_SAVED_BY_ID_INFO;
|
|
9651
9627
|
}
|
|
9652
9628
|
catch (error)
|
|
@@ -9690,7 +9666,7 @@ class NomadMediaSDK {
|
|
|
9690
9666
|
const PATCH_SAVED_SEARCH_INFO = await _patchSavedSearch(this, this.token,
|
|
9691
9667
|
this.config.serviceApiUrl, ID, NAME, FEATURED, BOOKMARKED, PUBLIC,
|
|
9692
9668
|
SEQUENCE, this.debugMode);
|
|
9693
|
-
_printDatetime(`Saved search patched: ${ID}`);
|
|
9669
|
+
if (PATCH_SAVED_SEARCH_INFO) _printDatetime(`Saved search patched: ${ID}`);
|
|
9694
9670
|
return PATCH_SAVED_SEARCH_INFO;
|
|
9695
9671
|
}
|
|
9696
9672
|
catch (error)
|
|
@@ -9758,7 +9734,7 @@ class NomadMediaSDK {
|
|
|
9758
9734
|
SEQUENCE, QUERY, OFFSET, SIZE, FILTERS, SORT_FIELDS, SEARCH_RESULT_FIELDS,
|
|
9759
9735
|
SIMILAR_ASSET_ID, MIN_SCORE, EXCLUDE_TOTAL_RECORD_COUNT, FILTER_BINDER,
|
|
9760
9736
|
this.debugMode);
|
|
9761
|
-
_printDatetime(`Saved search updated: ${ID}`);
|
|
9737
|
+
if (UPDATE_SAVED_SEARCH_INFO) _printDatetime(`Saved search updated: ${ID}`);
|
|
9762
9738
|
return UPDATE_SAVED_SEARCH_INFO;
|
|
9763
9739
|
}
|
|
9764
9740
|
catch (error)
|
|
@@ -12674,6 +12650,7 @@ async function _logout(instance, AUTH_TOKEN, URL, DEBUG_MODE)
|
|
|
12674
12650
|
|
|
12675
12651
|
|
|
12676
12652
|
|
|
12653
|
+
|
|
12677
12654
|
async function _refreshToken(instance, AUTH_TOKEN, URL, REFRESH_TOKEN, DEBUG_MODE)
|
|
12678
12655
|
{
|
|
12679
12656
|
const API_URL = `${URL}/api/account/refresh-token`;
|
|
@@ -12683,7 +12660,9 @@ async function _refreshToken(instance, AUTH_TOKEN, URL, REFRESH_TOKEN, DEBUG_MOD
|
|
|
12683
12660
|
};
|
|
12684
12661
|
|
|
12685
12662
|
const TOKEN_INFO = await _sendRequest(instance, AUTH_TOKEN, "Refreshing Token", API_URL, "POST", null, BODY, DEBUG_MODE);
|
|
12686
|
-
|
|
12663
|
+
instance.token = TOKEN_INFO.token;
|
|
12664
|
+
|
|
12665
|
+
return true;
|
|
12687
12666
|
}
|
|
12688
12667
|
|
|
12689
12668
|
|
|
@@ -13581,12 +13560,12 @@ async function _search(instance, AUTH_TOKEN, URL, QUERY, OFFSET, SIZE, FILTERS,
|
|
|
13581
13560
|
function _apiExceptionHandler(error, message) {
|
|
13582
13561
|
// Check if we have a response object and error message
|
|
13583
13562
|
if (!error) {
|
|
13584
|
-
|
|
13563
|
+
console.error(message);
|
|
13585
13564
|
}
|
|
13586
13565
|
|
|
13587
13566
|
// Check if error is a string
|
|
13588
13567
|
if (typeof error === "string") {
|
|
13589
|
-
|
|
13568
|
+
console.error(`${message}: ${error}`);
|
|
13590
13569
|
}
|
|
13591
13570
|
else if (error.errors)
|
|
13592
13571
|
{
|
|
@@ -13596,7 +13575,7 @@ function _apiExceptionHandler(error, message) {
|
|
|
13596
13575
|
{
|
|
13597
13576
|
errorString += `${error.errors[errorIdx].code}: ${error.errors[errorIdx].field}: ${error.errors[errorIdx].message}\n`;
|
|
13598
13577
|
}
|
|
13599
|
-
|
|
13578
|
+
console.error(`${message}: ${errorString}`);
|
|
13600
13579
|
}
|
|
13601
13580
|
else if (typeof error.errors === "object") {
|
|
13602
13581
|
let errorString = "";
|
|
@@ -13605,13 +13584,15 @@ function _apiExceptionHandler(error, message) {
|
|
|
13605
13584
|
errorString += `${key}: ${error.errors[key]}\n`;
|
|
13606
13585
|
}
|
|
13607
13586
|
}
|
|
13608
|
-
|
|
13587
|
+
console.error(`${message}: ${errorString}`);
|
|
13609
13588
|
}
|
|
13610
13589
|
}
|
|
13611
13590
|
else
|
|
13612
13591
|
{
|
|
13613
|
-
|
|
13592
|
+
console.error(`${message}: ${error.message}`);
|
|
13614
13593
|
}
|
|
13594
|
+
|
|
13595
|
+
return null;
|
|
13615
13596
|
}
|
|
13616
13597
|
|
|
13617
13598
|
|
|
@@ -13647,7 +13628,7 @@ import axios from 'axios';
|
|
|
13647
13628
|
|
|
13648
13629
|
const MAX_RETRIES = 5;
|
|
13649
13630
|
const TIMEOUT = 30000;
|
|
13650
|
-
const SLEEP_TIME =
|
|
13631
|
+
const SLEEP_TIME = .5;
|
|
13651
13632
|
|
|
13652
13633
|
async function _sendRequest(instance, AUTH_TOKEN, FUNCTION_NAME, URL, METHOD_TYPE, PARAMS, BODY, DEBUG)
|
|
13653
13634
|
{
|
|
@@ -13657,14 +13638,16 @@ async function _sendRequest(instance, AUTH_TOKEN, FUNCTION_NAME, URL, METHOD_TYP
|
|
|
13657
13638
|
|
|
13658
13639
|
if (AUTH_TOKEN) HEADERS["Authorization"] = `Bearer ${AUTH_TOKEN}`;
|
|
13659
13640
|
|
|
13660
|
-
if (DEBUG) console.log(`URL: ${URL}\nMETHOD: ${METHOD_TYPE}` + (PARAMS && PARAMS.size === 0 ? `\nPARAMS: ${JSON.stringify(PARAMS, null, 4)}` : "") + (BODY ? `\nBODY: ${JSON.stringify(BODY, null, 4)}` : ""));
|
|
13641
|
+
if (DEBUG && FUNCTION_NAME !== "Login") console.log(`URL: ${URL}\nMETHOD: ${METHOD_TYPE}` + (PARAMS && PARAMS.size === 0 ? `\nPARAMS: ${JSON.stringify(PARAMS, null, 4)}` : "") + (BODY ? `\nBODY: ${JSON.stringify(BODY, null, 4)}` : ""));
|
|
13661
13642
|
|
|
13662
13643
|
let retries = 0;
|
|
13663
13644
|
let RESPONSE = null;
|
|
13645
|
+
let refreshedToken = false;
|
|
13664
13646
|
do
|
|
13665
13647
|
{
|
|
13666
13648
|
try
|
|
13667
13649
|
{
|
|
13650
|
+
refreshedToken = true;
|
|
13668
13651
|
RESPONSE = await axios({
|
|
13669
13652
|
method: METHOD_TYPE,
|
|
13670
13653
|
url: URL,
|
|
@@ -13679,29 +13662,27 @@ async function _sendRequest(instance, AUTH_TOKEN, FUNCTION_NAME, URL, METHOD_TYP
|
|
|
13679
13662
|
break;
|
|
13680
13663
|
}
|
|
13681
13664
|
|
|
13682
|
-
|
|
13683
|
-
{
|
|
13684
|
-
await instance.refreshToken();
|
|
13685
|
-
}
|
|
13686
|
-
else
|
|
13687
|
-
{
|
|
13688
|
-
throw new Error();
|
|
13689
|
-
}
|
|
13690
|
-
|
|
13665
|
+
throw new Error();
|
|
13691
13666
|
}
|
|
13692
13667
|
catch (error)
|
|
13693
13668
|
{
|
|
13694
|
-
if (error
|
|
13669
|
+
if (error?.response?.status === 403 && FUNCTION_NAME !== "Refresh Token" && !refreshedToken)
|
|
13695
13670
|
{
|
|
13696
|
-
|
|
13697
|
-
|
|
13698
|
-
|
|
13671
|
+
await instance.refreshToken();
|
|
13672
|
+
HEADERS["Authorization"] = `Bearer ${instance.token}`;
|
|
13673
|
+
refreshedToken = true;
|
|
13674
|
+
}
|
|
13675
|
+
else if (error.code === 'ECONNABORTED')
|
|
13676
|
+
{
|
|
13677
|
+
await _sleep(SLEEP_TIME ** 2);
|
|
13678
|
+
}
|
|
13699
13679
|
else
|
|
13700
13680
|
{
|
|
13701
|
-
_apiExceptionHandler(error.response?.data.message ? error.response.data.message : error.message, `${FUNCTION_NAME} failed`);
|
|
13681
|
+
return _apiExceptionHandler(error.response?.data.message ? error.response.data.message : error.message, `${FUNCTION_NAME} failed`);
|
|
13702
13682
|
}
|
|
13683
|
+
++retries;
|
|
13703
13684
|
}
|
|
13704
|
-
} while (!RESPONSE || RESPONSE.status < 200 || RESPONSE.status >= 300);
|
|
13685
|
+
} while ((!RESPONSE || RESPONSE.status < 200 || RESPONSE.status >= 300) && retries < MAX_RETRIES);
|
|
13705
13686
|
try { return RESPONSE.data; }
|
|
13706
13687
|
catch (error) { return; }
|
|
13707
13688
|
}
|