@brigadasos/nadeshiko-sdk 1.4.3-dev.d3424ba → 1.5.0-dev.0c1011b

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/index.js CHANGED
@@ -813,15 +813,11 @@ var createClient = (config = {}) => {
813
813
  };
814
814
  };
815
815
  // generated/dev/client.gen.ts
816
- var client = createClient(createConfig({ baseUrl: "http://localhost:5000" }));
816
+ var client = createClient(createConfig({ baseUrl: "https://api.nadeshiko.co" }));
817
817
 
818
818
  // generated/dev/sdk.gen.ts
819
819
  var search = (options) => (options?.client ?? client).post({
820
- security: [{ scheme: "bearer", type: "http" }, {
821
- in: "cookie",
822
- name: "nadeshiko.session_token",
823
- type: "apiKey"
824
- }],
820
+ security: [{ scheme: "bearer", type: "http" }],
825
821
  url: "/v1/search",
826
822
  ...options,
827
823
  headers: {
@@ -830,11 +826,7 @@ var search = (options) => (options?.client ?? client).post({
830
826
  }
831
827
  });
832
828
  var getSearchStats = (options) => (options?.client ?? client).post({
833
- security: [{ scheme: "bearer", type: "http" }, {
834
- in: "cookie",
835
- name: "nadeshiko.session_token",
836
- type: "apiKey"
837
- }],
829
+ security: [{ scheme: "bearer", type: "http" }],
838
830
  url: "/v1/search/stats",
839
831
  ...options,
840
832
  headers: {
@@ -843,11 +835,7 @@ var getSearchStats = (options) => (options?.client ?? client).post({
843
835
  }
844
836
  });
845
837
  var searchWords = (options) => (options.client ?? client).post({
846
- security: [{ scheme: "bearer", type: "http" }, {
847
- in: "cookie",
848
- name: "nadeshiko.session_token",
849
- type: "apiKey"
850
- }],
838
+ security: [{ scheme: "bearer", type: "http" }],
851
839
  url: "/v1/search/words",
852
840
  ...options,
853
841
  headers: {
@@ -875,7 +863,11 @@ var autocompleteMedia = (options) => (options.client ?? client).get({
875
863
  ...options
876
864
  });
877
865
  var getSegmentByUuid = (options) => (options.client ?? client).get({
878
- security: [{ scheme: "bearer", type: "http" }],
866
+ security: [{ scheme: "bearer", type: "http" }, {
867
+ in: "cookie",
868
+ name: "nadeshiko.session_token",
869
+ type: "apiKey"
870
+ }],
879
871
  url: "/v1/media/segments/{uuid}",
880
872
  ...options
881
873
  });
@@ -893,16 +885,16 @@ var updateSegmentByUuid = (options) => (options.client ?? client).patch({
893
885
  }
894
886
  });
895
887
  var getSegmentContext = (options) => (options.client ?? client).get({
896
- security: [{ scheme: "bearer", type: "http" }],
897
- url: "/v1/media/segments/{uuid}/context",
898
- ...options
899
- });
900
- var listSeries = (options) => (options?.client ?? client).get({
901
888
  security: [{ scheme: "bearer", type: "http" }, {
902
889
  in: "cookie",
903
890
  name: "nadeshiko.session_token",
904
891
  type: "apiKey"
905
892
  }],
893
+ url: "/v1/media/segments/{uuid}/context",
894
+ ...options
895
+ });
896
+ var listSeries = (options) => (options?.client ?? client).get({
897
+ security: [{ scheme: "bearer", type: "http" }],
906
898
  url: "/v1/media/series",
907
899
  ...options
908
900
  });
@@ -921,11 +913,7 @@ var deleteSeries = (options) => (options.client ?? client).delete({
921
913
  ...options
922
914
  });
923
915
  var getSeries = (options) => (options.client ?? client).get({
924
- security: [{ scheme: "bearer", type: "http" }, {
925
- in: "cookie",
926
- name: "nadeshiko.session_token",
927
- type: "apiKey"
928
- }],
916
+ security: [{ scheme: "bearer", type: "http" }],
929
917
  url: "/v1/media/series/{id}",
930
918
  ...options
931
919
  });
@@ -1061,7 +1049,7 @@ var getUserQuota = (options) => (options?.client ?? client).get({
1061
1049
  in: "cookie",
1062
1050
  name: "nadeshiko.session_token",
1063
1051
  type: "apiKey"
1064
- }, { scheme: "bearer", type: "http" }],
1052
+ }],
1065
1053
  url: "/v1/user/quota",
1066
1054
  ...options
1067
1055
  });
@@ -1310,17 +1298,29 @@ var getCollectionStats = (options) => (options.client ?? client).get({
1310
1298
  ...options
1311
1299
  });
1312
1300
  var getAdminDashboard = (options) => (options?.client ?? client).get({
1313
- security: [{ scheme: "bearer", type: "http" }],
1301
+ security: [{
1302
+ in: "cookie",
1303
+ name: "nadeshiko.session_token",
1304
+ type: "apiKey"
1305
+ }],
1314
1306
  url: "/v1/admin/dashboard",
1315
1307
  ...options
1316
1308
  });
1317
1309
  var getAdminHealth = (options) => (options?.client ?? client).get({
1318
- security: [{ scheme: "bearer", type: "http" }],
1310
+ security: [{
1311
+ in: "cookie",
1312
+ name: "nadeshiko.session_token",
1313
+ type: "apiKey"
1314
+ }],
1319
1315
  url: "/v1/admin/health",
1320
1316
  ...options
1321
1317
  });
1322
1318
  var triggerReindex = (options) => (options?.client ?? client).post({
1323
- security: [{ scheme: "bearer", type: "http" }],
1319
+ security: [{
1320
+ in: "cookie",
1321
+ name: "nadeshiko.session_token",
1322
+ type: "apiKey"
1323
+ }],
1324
1324
  url: "/v1/admin/reindex",
1325
1325
  ...options,
1326
1326
  headers: {
@@ -1329,45 +1329,52 @@ var triggerReindex = (options) => (options?.client ?? client).post({
1329
1329
  }
1330
1330
  });
1331
1331
  var listAdminQueueStats = (options) => (options?.client ?? client).get({
1332
- security: [{ scheme: "bearer", type: "http" }],
1332
+ security: [{
1333
+ in: "cookie",
1334
+ name: "nadeshiko.session_token",
1335
+ type: "apiKey"
1336
+ }],
1333
1337
  url: "/v1/admin/queues/stats",
1334
1338
  ...options
1335
1339
  });
1336
1340
  var getAdminQueue = (options) => (options.client ?? client).get({
1337
- security: [{ scheme: "bearer", type: "http" }],
1341
+ security: [{
1342
+ in: "cookie",
1343
+ name: "nadeshiko.session_token",
1344
+ type: "apiKey"
1345
+ }],
1338
1346
  url: "/v1/admin/queues/{queueName}",
1339
1347
  ...options
1340
1348
  });
1341
1349
  var listAdminQueueFailed = (options) => (options.client ?? client).get({
1342
- security: [{ scheme: "bearer", type: "http" }],
1350
+ security: [{
1351
+ in: "cookie",
1352
+ name: "nadeshiko.session_token",
1353
+ type: "apiKey"
1354
+ }],
1343
1355
  url: "/v1/admin/queues/{queueName}/failed",
1344
1356
  ...options
1345
1357
  });
1346
1358
  var retryAdminQueueFailed = (options) => (options.client ?? client).post({
1347
- security: [{ scheme: "bearer", type: "http" }],
1348
- url: "/v1/admin/queues/{queueName}/retry",
1349
- ...options
1350
- });
1351
- var purgeAdminQueueFailed = (options) => (options.client ?? client).delete({
1352
- security: [{ scheme: "bearer", type: "http" }],
1353
- url: "/v1/admin/queues/{queueName}/purge",
1354
- ...options
1355
- });
1356
- var clearAdminImpersonation = (options) => (options?.client ?? client).delete({
1357
1359
  security: [{
1358
1360
  in: "cookie",
1359
1361
  name: "nadeshiko.session_token",
1360
1362
  type: "apiKey"
1361
1363
  }],
1362
- url: "/v1/admin/impersonation",
1364
+ url: "/v1/admin/queues/{queueName}/retry",
1363
1365
  ...options
1364
1366
  });
1365
- var impersonateAdminUser = (options) => (options.client ?? client).post({
1367
+ var purgeAdminQueueFailed = (options) => (options.client ?? client).delete({
1366
1368
  security: [{
1367
1369
  in: "cookie",
1368
1370
  name: "nadeshiko.session_token",
1369
1371
  type: "apiKey"
1370
1372
  }],
1373
+ url: "/v1/admin/queues/{queueName}/purge",
1374
+ ...options
1375
+ });
1376
+ var clearAdminImpersonation = (options) => (options?.client ?? client).delete({ url: "/v1/admin/impersonation", ...options });
1377
+ var impersonateAdminUser = (options) => (options.client ?? client).post({
1371
1378
  url: "/v1/admin/impersonation",
1372
1379
  ...options,
1373
1380
  headers: {
@@ -1376,12 +1383,20 @@ var impersonateAdminUser = (options) => (options.client ?? client).post({
1376
1383
  }
1377
1384
  });
1378
1385
  var listAdminReports = (options) => (options?.client ?? client).get({
1379
- security: [{ scheme: "bearer", type: "http" }],
1386
+ security: [{
1387
+ in: "cookie",
1388
+ name: "nadeshiko.session_token",
1389
+ type: "apiKey"
1390
+ }],
1380
1391
  url: "/v1/admin/reports",
1381
1392
  ...options
1382
1393
  });
1383
1394
  var updateAdminReport = (options) => (options.client ?? client).patch({
1384
- security: [{ scheme: "bearer", type: "http" }],
1395
+ security: [{
1396
+ in: "cookie",
1397
+ name: "nadeshiko.session_token",
1398
+ type: "apiKey"
1399
+ }],
1385
1400
  url: "/v1/admin/reports/{id}",
1386
1401
  ...options,
1387
1402
  headers: {
@@ -1390,12 +1405,20 @@ var updateAdminReport = (options) => (options.client ?? client).patch({
1390
1405
  }
1391
1406
  });
1392
1407
  var listAdminMediaAudits = (options) => (options?.client ?? client).get({
1393
- security: [{ scheme: "bearer", type: "http" }],
1408
+ security: [{
1409
+ in: "cookie",
1410
+ name: "nadeshiko.session_token",
1411
+ type: "apiKey"
1412
+ }],
1394
1413
  url: "/v1/admin/media/audits",
1395
1414
  ...options
1396
1415
  });
1397
1416
  var updateAdminMediaAudit = (options) => (options.client ?? client).patch({
1398
- security: [{ scheme: "bearer", type: "http" }],
1417
+ security: [{
1418
+ in: "cookie",
1419
+ name: "nadeshiko.session_token",
1420
+ type: "apiKey"
1421
+ }],
1399
1422
  url: "/v1/admin/media/audits/{name}",
1400
1423
  ...options,
1401
1424
  headers: {
@@ -1404,17 +1427,29 @@ var updateAdminMediaAudit = (options) => (options.client ?? client).patch({
1404
1427
  }
1405
1428
  });
1406
1429
  var runAdminMediaAudit = (options) => (options.client ?? client).post({
1407
- security: [{ scheme: "bearer", type: "http" }],
1430
+ security: [{
1431
+ in: "cookie",
1432
+ name: "nadeshiko.session_token",
1433
+ type: "apiKey"
1434
+ }],
1408
1435
  url: "/v1/admin/media/audits/{name}/run",
1409
1436
  ...options
1410
1437
  });
1411
1438
  var listAdminMediaAuditRuns = (options) => (options?.client ?? client).get({
1412
- security: [{ scheme: "bearer", type: "http" }],
1439
+ security: [{
1440
+ in: "cookie",
1441
+ name: "nadeshiko.session_token",
1442
+ type: "apiKey"
1443
+ }],
1413
1444
  url: "/v1/admin/media/audits/runs",
1414
1445
  ...options
1415
1446
  });
1416
1447
  var getAdminMediaAuditRun = (options) => (options.client ?? client).get({
1417
- security: [{ scheme: "bearer", type: "http" }],
1448
+ security: [{
1449
+ in: "cookie",
1450
+ name: "nadeshiko.session_token",
1451
+ type: "apiKey"
1452
+ }],
1418
1453
  url: "/v1/admin/media/audits/runs/{id}",
1419
1454
  ...options
1420
1455
  });
@@ -1431,7 +1466,13 @@ var defaultSessionTokenGetter = () => {
1431
1466
  return match ? decodeURIComponent(match[1]) : undefined;
1432
1467
  };
1433
1468
  function createNadeshikoClient(config) {
1434
- const baseUrl = config.baseUrl ? config.baseUrl in environments ? environments[config.baseUrl] : config.baseUrl : environments.PRODUCTION;
1469
+ const baseUrl = config.baseUrl === undefined ? environments.PRODUCTION : (config.baseUrl in environments) ? environments[config.baseUrl] : config.baseUrl;
1470
+ const getApiKey = async () => {
1471
+ if (typeof config.apiKey === "function") {
1472
+ return await config.apiKey();
1473
+ }
1474
+ return config.apiKey;
1475
+ };
1435
1476
  const getSessionToken = config.sessionToken ?? defaultSessionTokenGetter;
1436
1477
  const clientInstance = createClient(createConfig({
1437
1478
  baseUrl,
@@ -1439,7 +1480,7 @@ function createNadeshikoClient(config) {
1439
1480
  if (auth.in === "cookie") {
1440
1481
  return getSessionToken();
1441
1482
  }
1442
- return config.apiKey;
1483
+ return getApiKey();
1443
1484
  }
1444
1485
  }));
1445
1486
  return {
@@ -1458,30 +1499,6 @@ function createNadeshikoClient(config) {
1458
1499
  listEpisodes: (options) => listEpisodes({ ...options, client: clientInstance }),
1459
1500
  getEpisode: (options) => getEpisode({ ...options, client: clientInstance }),
1460
1501
  getSegment: (options) => getSegment({ ...options, client: clientInstance }),
1461
- getUserQuota: (options) => getUserQuota({ ...options, client: clientInstance }),
1462
- listCollections: (options) => listCollections({ ...options, client: clientInstance }),
1463
- createCollection: (options) => createCollection({ ...options, client: clientInstance }),
1464
- getCollection: (options) => getCollection({ ...options, client: clientInstance }),
1465
- updateCollection: (options) => updateCollection({ ...options, client: clientInstance }),
1466
- deleteCollection: (options) => deleteCollection({ ...options, client: clientInstance }),
1467
- addSegmentToCollection: (options) => addSegmentToCollection({ ...options, client: clientInstance }),
1468
- updateCollectionSegment: (options) => updateCollectionSegment({ ...options, client: clientInstance }),
1469
- removeSegmentFromCollection: (options) => removeSegmentFromCollection({ ...options, client: clientInstance }),
1470
- searchCollectionSegments: (options) => searchCollectionSegments({ ...options, client: clientInstance }),
1471
- getCollectionStats: (options) => getCollectionStats({ ...options, client: clientInstance }),
1472
- triggerReindex: (options) => triggerReindex({ ...options, client: clientInstance }),
1473
- listAdminQueueStats: (options) => listAdminQueueStats({ ...options, client: clientInstance }),
1474
- getAdminQueue: (options) => getAdminQueue({ ...options, client: clientInstance }),
1475
- listAdminQueueFailed: (options) => listAdminQueueFailed({ ...options, client: clientInstance }),
1476
- retryAdminQueueFailed: (options) => retryAdminQueueFailed({ ...options, client: clientInstance }),
1477
- purgeAdminQueueFailed: (options) => purgeAdminQueueFailed({ ...options, client: clientInstance }),
1478
- listAdminReports: (options) => listAdminReports({ ...options, client: clientInstance }),
1479
- updateAdminReport: (options) => updateAdminReport({ ...options, client: clientInstance }),
1480
- listAdminMediaAudits: (options) => listAdminMediaAudits({ ...options, client: clientInstance }),
1481
- updateAdminMediaAudit: (options) => updateAdminMediaAudit({ ...options, client: clientInstance }),
1482
- runAdminMediaAudit: (options) => runAdminMediaAudit({ ...options, client: clientInstance }),
1483
- listAdminMediaAuditRuns: (options) => listAdminMediaAuditRuns({ ...options, client: clientInstance }),
1484
- getAdminMediaAuditRun: (options) => getAdminMediaAuditRun({ ...options, client: clientInstance }),
1485
1502
  createMedia: (options) => createMedia({ ...options, client: clientInstance }),
1486
1503
  autocompleteMedia: (options) => autocompleteMedia({ ...options, client: clientInstance }),
1487
1504
  updateSegmentByUuid: (options) => updateSegmentByUuid({ ...options, client: clientInstance }),
@@ -1500,6 +1517,7 @@ function createNadeshikoClient(config) {
1500
1517
  createSegment: (options) => createSegment({ ...options, client: clientInstance }),
1501
1518
  updateSegment: (options) => updateSegment({ ...options, client: clientInstance }),
1502
1519
  deleteSegment: (options) => deleteSegment({ ...options, client: clientInstance }),
1520
+ getUserQuota: (options) => getUserQuota({ ...options, client: clientInstance }),
1503
1521
  createUserReport: (options) => createUserReport({ ...options, client: clientInstance }),
1504
1522
  getUserPreferences: (options) => getUserPreferences({ ...options, client: clientInstance }),
1505
1523
  updateUserPreferences: (options) => updateUserPreferences({ ...options, client: clientInstance }),
@@ -1514,10 +1532,33 @@ function createNadeshikoClient(config) {
1514
1532
  listUserLabs: (options) => listUserLabs({ ...options, client: clientInstance }),
1515
1533
  enrollUserLab: (options) => enrollUserLab({ ...options, client: clientInstance }),
1516
1534
  unenrollUserLab: (options) => unenrollUserLab({ ...options, client: clientInstance }),
1535
+ listCollections: (options) => listCollections({ ...options, client: clientInstance }),
1536
+ createCollection: (options) => createCollection({ ...options, client: clientInstance }),
1537
+ getCollection: (options) => getCollection({ ...options, client: clientInstance }),
1538
+ updateCollection: (options) => updateCollection({ ...options, client: clientInstance }),
1539
+ deleteCollection: (options) => deleteCollection({ ...options, client: clientInstance }),
1540
+ addSegmentToCollection: (options) => addSegmentToCollection({ ...options, client: clientInstance }),
1541
+ updateCollectionSegment: (options) => updateCollectionSegment({ ...options, client: clientInstance }),
1542
+ removeSegmentFromCollection: (options) => removeSegmentFromCollection({ ...options, client: clientInstance }),
1543
+ searchCollectionSegments: (options) => searchCollectionSegments({ ...options, client: clientInstance }),
1544
+ getCollectionStats: (options) => getCollectionStats({ ...options, client: clientInstance }),
1517
1545
  getAdminDashboard: (options) => getAdminDashboard({ ...options, client: clientInstance }),
1518
1546
  getAdminHealth: (options) => getAdminHealth({ ...options, client: clientInstance }),
1547
+ triggerReindex: (options) => triggerReindex({ ...options, client: clientInstance }),
1548
+ listAdminQueueStats: (options) => listAdminQueueStats({ ...options, client: clientInstance }),
1549
+ getAdminQueue: (options) => getAdminQueue({ ...options, client: clientInstance }),
1550
+ listAdminQueueFailed: (options) => listAdminQueueFailed({ ...options, client: clientInstance }),
1551
+ retryAdminQueueFailed: (options) => retryAdminQueueFailed({ ...options, client: clientInstance }),
1552
+ purgeAdminQueueFailed: (options) => purgeAdminQueueFailed({ ...options, client: clientInstance }),
1519
1553
  impersonateAdminUser: (options) => impersonateAdminUser({ ...options, client: clientInstance }),
1520
- clearAdminImpersonation: (options) => clearAdminImpersonation({ ...options, client: clientInstance })
1554
+ clearAdminImpersonation: (options) => clearAdminImpersonation({ ...options, client: clientInstance }),
1555
+ listAdminReports: (options) => listAdminReports({ ...options, client: clientInstance }),
1556
+ updateAdminReport: (options) => updateAdminReport({ ...options, client: clientInstance }),
1557
+ listAdminMediaAudits: (options) => listAdminMediaAudits({ ...options, client: clientInstance }),
1558
+ updateAdminMediaAudit: (options) => updateAdminMediaAudit({ ...options, client: clientInstance }),
1559
+ runAdminMediaAudit: (options) => runAdminMediaAudit({ ...options, client: clientInstance }),
1560
+ listAdminMediaAuditRuns: (options) => listAdminMediaAuditRuns({ ...options, client: clientInstance }),
1561
+ getAdminMediaAuditRun: (options) => getAdminMediaAuditRun({ ...options, client: clientInstance })
1521
1562
  };
1522
1563
  }
1523
1564
  // generated/dev/internal/media.gen.ts
@@ -1550,6 +1591,7 @@ __export(exports_user_gen, {
1550
1591
  trackUserActivity: () => trackUserActivity,
1551
1592
  listUserLabs: () => listUserLabs,
1552
1593
  listUserActivity: () => listUserActivity,
1594
+ getUserQuota: () => getUserQuota,
1553
1595
  getUserPreferences: () => getUserPreferences,
1554
1596
  getUserActivityStats: () => getUserActivityStats,
1555
1597
  getUserActivityHeatmap: () => getUserActivityHeatmap,
@@ -1560,10 +1602,37 @@ __export(exports_user_gen, {
1560
1602
  deleteUserActivity: () => deleteUserActivity,
1561
1603
  createUserReport: () => createUserReport
1562
1604
  });
1605
+ // generated/dev/internal/collections.gen.ts
1606
+ var exports_collections_gen = {};
1607
+ __export(exports_collections_gen, {
1608
+ updateCollectionSegment: () => updateCollectionSegment,
1609
+ updateCollection: () => updateCollection,
1610
+ searchCollectionSegments: () => searchCollectionSegments,
1611
+ removeSegmentFromCollection: () => removeSegmentFromCollection,
1612
+ listCollections: () => listCollections,
1613
+ getCollectionStats: () => getCollectionStats,
1614
+ getCollection: () => getCollection,
1615
+ deleteCollection: () => deleteCollection,
1616
+ createCollection: () => createCollection,
1617
+ addSegmentToCollection: () => addSegmentToCollection
1618
+ });
1563
1619
  // generated/dev/internal/admin.gen.ts
1564
1620
  var exports_admin_gen = {};
1565
1621
  __export(exports_admin_gen, {
1622
+ updateAdminReport: () => updateAdminReport,
1623
+ updateAdminMediaAudit: () => updateAdminMediaAudit,
1624
+ triggerReindex: () => triggerReindex,
1625
+ runAdminMediaAudit: () => runAdminMediaAudit,
1626
+ retryAdminQueueFailed: () => retryAdminQueueFailed,
1627
+ purgeAdminQueueFailed: () => purgeAdminQueueFailed,
1628
+ listAdminReports: () => listAdminReports,
1629
+ listAdminQueueStats: () => listAdminQueueStats,
1630
+ listAdminQueueFailed: () => listAdminQueueFailed,
1631
+ listAdminMediaAudits: () => listAdminMediaAudits,
1632
+ listAdminMediaAuditRuns: () => listAdminMediaAuditRuns,
1566
1633
  impersonateAdminUser: () => impersonateAdminUser,
1634
+ getAdminQueue: () => getAdminQueue,
1635
+ getAdminMediaAuditRun: () => getAdminMediaAuditRun,
1567
1636
  getAdminHealth: () => getAdminHealth,
1568
1637
  getAdminDashboard: () => getAdminDashboard,
1569
1638
  clearAdminImpersonation: () => clearAdminImpersonation
@@ -1642,6 +1711,7 @@ export {
1642
1711
  createMedia,
1643
1712
  createEpisode,
1644
1713
  createCollection,
1714
+ exports_collections_gen as collections,
1645
1715
  client,
1646
1716
  clearAdminImpersonation,
1647
1717
  autocompleteMedia,
@@ -1650,5 +1720,5 @@ export {
1650
1720
  addMediaToSeries
1651
1721
  };
1652
1722
 
1653
- //# debugId=6E2270D68B68807564756E2164756E21
1723
+ //# debugId=0F6D8F5370A3363364756E2164756E21
1654
1724
  //# sourceMappingURL=index.js.map