mirror of
https://github.com/LukeHagar/plexjs.git
synced 2025-12-06 04:20:46 +00:00
SDK update generated by liblab
This commit is contained in:
98
README.md
98
README.md
@@ -518,7 +518,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.media.updatePlayProgress('key', -67598765.07465324, 'state');
|
||||
const result = await sdk.media.updatePlayProgress('key', -25032179.723307386, 'state');
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -672,7 +672,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.butler.startTask('RefreshLibraries');
|
||||
const result = await sdk.butler.startTask('RefreshPeriodicMetadata');
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -702,7 +702,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.butler.stopTask('DeepMediaAnalysis');
|
||||
const result = await sdk.butler.stopTask('GenerateChapterThumbs');
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -736,7 +736,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.hubs.getGlobalHubs({ count: 28368865.713739887, onlyTransient: 1 });
|
||||
const result = await sdk.hubs.getGlobalHubs({ count: -41963860.27512902, onlyTransient: 42 });
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -774,8 +774,8 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.hubs.getLibraryHubs(18589771.015234828, {
|
||||
count: -32594130.898548722,
|
||||
const result = await sdk.hubs.getLibraryHubs(-19572217.151876092, {
|
||||
count: 64492424.84453416,
|
||||
onlyTransient: 1,
|
||||
});
|
||||
console.log(result.data);
|
||||
@@ -816,8 +816,8 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.search.performSearch('arnold', {
|
||||
sectionId: 44691501.34992224,
|
||||
const result = await sdk.search.performSearch('dylan', {
|
||||
sectionId: -80780418.69956203,
|
||||
limit: 5,
|
||||
});
|
||||
console.log(result.data);
|
||||
@@ -858,7 +858,7 @@ const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.search.performVoiceSearch('dead+poop', {
|
||||
sectionId: 63927189.69130659,
|
||||
sectionId: 86426181.42960766,
|
||||
limit: 5,
|
||||
});
|
||||
console.log(result.data);
|
||||
@@ -929,7 +929,7 @@ const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.library.getFileHash('file://C:Image.png&type=13', {
|
||||
type: -40347992.189137824,
|
||||
type: 1221820.9318130612,
|
||||
});
|
||||
console.log(result.data);
|
||||
})();
|
||||
@@ -1081,8 +1081,8 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.library.getLibraryItems(72139049.19684184, {
|
||||
type: -38282492.854482666,
|
||||
const result = await sdk.library.getLibraryItems(-52353690.921314076, {
|
||||
type: 57657681.83699939,
|
||||
filter: 'filter',
|
||||
});
|
||||
console.log(result.data);
|
||||
@@ -1114,7 +1114,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.library.refreshLibrary(-48997883.13740698);
|
||||
const result = await sdk.library.refreshLibrary(83063605.3709105);
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -1152,7 +1152,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.library.getLatestLibraryItems(58797973.85610509, -91925704.44457702, {
|
||||
const result = await sdk.library.getLatestLibraryItems(17288749.454815328, -65987149.628176846, {
|
||||
filter: 'filter',
|
||||
});
|
||||
console.log(result.data);
|
||||
@@ -1192,7 +1192,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.library.getCommonLibraryItems(-1929766.2595285624, 10178756.232577473, {
|
||||
const result = await sdk.library.getCommonLibraryItems(77036914.15493327, 88290768.12302619, {
|
||||
filter: 'filter',
|
||||
});
|
||||
console.log(result.data);
|
||||
@@ -1224,7 +1224,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.library.getMetadata(-93116760.96986176);
|
||||
const result = await sdk.library.getMetadata(-81847309.63397841);
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -1254,7 +1254,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.library.getMetadataChildren(74240120.76203653);
|
||||
const result = await sdk.library.getMetadataChildren(27040154.17391461);
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -1333,7 +1333,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.log.logLine(4, 'message', 'source');
|
||||
const result = await sdk.log.logLine(3, 'message', 'source');
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -1397,9 +1397,9 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.playlists.createPlaylist('title', 'video', 1, {
|
||||
const result = await sdk.playlists.createPlaylist('title', 'photo', 1, {
|
||||
uri: 'uri',
|
||||
playQueueID: 8848570.752491549,
|
||||
playQueueID: -19291134.067149103,
|
||||
});
|
||||
console.log(result.data);
|
||||
})();
|
||||
@@ -1463,7 +1463,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.playlists.getPlaylist(-26157175.250883877);
|
||||
const result = await sdk.playlists.getPlaylist(56646356.33382389);
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -1493,7 +1493,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.playlists.deletePlaylist(98575271.53317443);
|
||||
const result = await sdk.playlists.deletePlaylist(-85154371.25049327);
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -1523,7 +1523,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.playlists.updatePlaylist(-63882285.47098422);
|
||||
const result = await sdk.playlists.updatePlaylist(-81706994.06882615);
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -1554,7 +1554,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.playlists.getPlaylistContents(39702400.82414672, 90162914.95216954);
|
||||
const result = await sdk.playlists.getPlaylistContents(76448342.73388726, 15972838.426946774);
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -1584,7 +1584,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.playlists.clearPlaylistContents(12387577.811442614);
|
||||
const result = await sdk.playlists.clearPlaylistContents(13524541.663327798);
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -1616,7 +1616,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.playlists.addPlaylistContents(68171801.32332289, 'library://..', 123);
|
||||
const result = await sdk.playlists.addPlaylistContents(-23895786.25933972, 'library://..', 123);
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -1647,7 +1647,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.playlists.uploadPlaylist('/home/barkley/playlist.m3u', 1);
|
||||
const result = await sdk.playlists.uploadPlaylist('/home/barkley/playlist.m3u', 42);
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -1709,9 +1709,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.security.getSourceConnectionInformation(
|
||||
'provider://provider-identifier',
|
||||
);
|
||||
const result = await sdk.security.getSourceConnectionInformation('server://client-identifier');
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -1900,7 +1898,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.updater.applyUpdates({ tonight: 1, skip: 1 });
|
||||
const result = await sdk.updater.applyUpdates({ tonight: 1, skip: 'foo' });
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -1953,23 +1951,23 @@ const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.video.startUniversalTranscode(
|
||||
-72522752.76989551,
|
||||
99273297.24555674,
|
||||
'path',
|
||||
82041936.41398731,
|
||||
-84753516.90588528,
|
||||
21375268.684818625,
|
||||
-18767699.730034873,
|
||||
'protocol',
|
||||
{
|
||||
fastSeek: -30142578.11776738,
|
||||
directPlay: 9919137.354697362,
|
||||
directStream: -19025857.514729157,
|
||||
subtitleSize: -84468293.84527272,
|
||||
fastSeek: -51749402.15485502,
|
||||
directPlay: -77287047.4341131,
|
||||
directStream: 89594169.19331425,
|
||||
subtitleSize: -88919523.21207976,
|
||||
subtites: 'subtites',
|
||||
audioBoost: -68940176.38612957,
|
||||
audioBoost: -81294276.24446929,
|
||||
location: 'location',
|
||||
mediaBufferSize: 30606631.50083433,
|
||||
mediaBufferSize: -54391953.000071116,
|
||||
session: 'session',
|
||||
addDebugOverlay: -70696815.34237362,
|
||||
autoAdjustQuality: -83810577.71928595,
|
||||
addDebugOverlay: -27611912.67288199,
|
||||
autoAdjustQuality: 60220639.02267191,
|
||||
},
|
||||
);
|
||||
console.log(result.data);
|
||||
@@ -2011,16 +2009,16 @@ const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.video.getTimeline(
|
||||
64550873.97298089,
|
||||
-59099515.72277228,
|
||||
'key',
|
||||
'playing',
|
||||
-30122195.47065121,
|
||||
85753219.1612091,
|
||||
-36475708.52265885,
|
||||
'paused',
|
||||
42923471.63451135,
|
||||
-4768474.493235379,
|
||||
-21041401.28754133,
|
||||
'context',
|
||||
26769044.884643376,
|
||||
36998590.48639223,
|
||||
-3788221.7909231335,
|
||||
-68934911.93506223,
|
||||
15139718.511849582,
|
||||
-69627795.90264106,
|
||||
);
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -463,7 +463,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.media.updatePlayProgress('key', -67598765.07465324, 'state');
|
||||
const result = await sdk.media.updatePlayProgress('key', -25032179.723307386, 'state');
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -617,7 +617,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.butler.startTask('RefreshLibraries');
|
||||
const result = await sdk.butler.startTask('RefreshPeriodicMetadata');
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -647,7 +647,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.butler.stopTask('DeepMediaAnalysis');
|
||||
const result = await sdk.butler.stopTask('GenerateChapterThumbs');
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -681,7 +681,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.hubs.getGlobalHubs({ count: 28368865.713739887, onlyTransient: 1 });
|
||||
const result = await sdk.hubs.getGlobalHubs({ count: -41963860.27512902, onlyTransient: 42 });
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -719,8 +719,8 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.hubs.getLibraryHubs(18589771.015234828, {
|
||||
count: -32594130.898548722,
|
||||
const result = await sdk.hubs.getLibraryHubs(-19572217.151876092, {
|
||||
count: 64492424.84453416,
|
||||
onlyTransient: 1,
|
||||
});
|
||||
console.log(result.data);
|
||||
@@ -761,8 +761,8 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.search.performSearch('arnold', {
|
||||
sectionId: 44691501.34992224,
|
||||
const result = await sdk.search.performSearch('dylan', {
|
||||
sectionId: -80780418.69956203,
|
||||
limit: 5,
|
||||
});
|
||||
console.log(result.data);
|
||||
@@ -803,7 +803,7 @@ const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.search.performVoiceSearch('dead+poop', {
|
||||
sectionId: 63927189.69130659,
|
||||
sectionId: 86426181.42960766,
|
||||
limit: 5,
|
||||
});
|
||||
console.log(result.data);
|
||||
@@ -874,7 +874,7 @@ const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.library.getFileHash('file://C:Image.png&type=13', {
|
||||
type: -40347992.189137824,
|
||||
type: 1221820.9318130612,
|
||||
});
|
||||
console.log(result.data);
|
||||
})();
|
||||
@@ -1026,8 +1026,8 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.library.getLibraryItems(72139049.19684184, {
|
||||
type: -38282492.854482666,
|
||||
const result = await sdk.library.getLibraryItems(-52353690.921314076, {
|
||||
type: 57657681.83699939,
|
||||
filter: 'filter',
|
||||
});
|
||||
console.log(result.data);
|
||||
@@ -1059,7 +1059,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.library.refreshLibrary(-48997883.13740698);
|
||||
const result = await sdk.library.refreshLibrary(83063605.3709105);
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -1097,7 +1097,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.library.getLatestLibraryItems(58797973.85610509, -91925704.44457702, {
|
||||
const result = await sdk.library.getLatestLibraryItems(17288749.454815328, -65987149.628176846, {
|
||||
filter: 'filter',
|
||||
});
|
||||
console.log(result.data);
|
||||
@@ -1137,7 +1137,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.library.getCommonLibraryItems(-1929766.2595285624, 10178756.232577473, {
|
||||
const result = await sdk.library.getCommonLibraryItems(77036914.15493327, 88290768.12302619, {
|
||||
filter: 'filter',
|
||||
});
|
||||
console.log(result.data);
|
||||
@@ -1169,7 +1169,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.library.getMetadata(-93116760.96986176);
|
||||
const result = await sdk.library.getMetadata(-81847309.63397841);
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -1199,7 +1199,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.library.getMetadataChildren(74240120.76203653);
|
||||
const result = await sdk.library.getMetadataChildren(27040154.17391461);
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -1278,7 +1278,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.log.logLine(4, 'message', 'source');
|
||||
const result = await sdk.log.logLine(3, 'message', 'source');
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -1342,9 +1342,9 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.playlists.createPlaylist('title', 'video', 1, {
|
||||
const result = await sdk.playlists.createPlaylist('title', 'photo', 1, {
|
||||
uri: 'uri',
|
||||
playQueueID: 8848570.752491549,
|
||||
playQueueID: -19291134.067149103,
|
||||
});
|
||||
console.log(result.data);
|
||||
})();
|
||||
@@ -1408,7 +1408,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.playlists.getPlaylist(-26157175.250883877);
|
||||
const result = await sdk.playlists.getPlaylist(56646356.33382389);
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -1438,7 +1438,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.playlists.deletePlaylist(98575271.53317443);
|
||||
const result = await sdk.playlists.deletePlaylist(-85154371.25049327);
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -1468,7 +1468,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.playlists.updatePlaylist(-63882285.47098422);
|
||||
const result = await sdk.playlists.updatePlaylist(-81706994.06882615);
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -1499,7 +1499,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.playlists.getPlaylistContents(39702400.82414672, 90162914.95216954);
|
||||
const result = await sdk.playlists.getPlaylistContents(76448342.73388726, 15972838.426946774);
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -1529,7 +1529,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.playlists.clearPlaylistContents(12387577.811442614);
|
||||
const result = await sdk.playlists.clearPlaylistContents(13524541.663327798);
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -1561,7 +1561,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.playlists.addPlaylistContents(68171801.32332289, 'library://..', 123);
|
||||
const result = await sdk.playlists.addPlaylistContents(-23895786.25933972, 'library://..', 123);
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -1592,7 +1592,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.playlists.uploadPlaylist('/home/barkley/playlist.m3u', 1);
|
||||
const result = await sdk.playlists.uploadPlaylist('/home/barkley/playlist.m3u', 42);
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -1654,9 +1654,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.security.getSourceConnectionInformation(
|
||||
'provider://provider-identifier',
|
||||
);
|
||||
const result = await sdk.security.getSourceConnectionInformation('server://client-identifier');
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -1845,7 +1843,7 @@ import { PlexSDK } from './src';
|
||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.updater.applyUpdates({ tonight: 1, skip: 1 });
|
||||
const result = await sdk.updater.applyUpdates({ tonight: 1, skip: 'foo' });
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -1898,23 +1896,23 @@ const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.video.startUniversalTranscode(
|
||||
-72522752.76989551,
|
||||
99273297.24555674,
|
||||
'path',
|
||||
82041936.41398731,
|
||||
-84753516.90588528,
|
||||
21375268.684818625,
|
||||
-18767699.730034873,
|
||||
'protocol',
|
||||
{
|
||||
fastSeek: -30142578.11776738,
|
||||
directPlay: 9919137.354697362,
|
||||
directStream: -19025857.514729157,
|
||||
subtitleSize: -84468293.84527272,
|
||||
fastSeek: -51749402.15485502,
|
||||
directPlay: -77287047.4341131,
|
||||
directStream: 89594169.19331425,
|
||||
subtitleSize: -88919523.21207976,
|
||||
subtites: 'subtites',
|
||||
audioBoost: -68940176.38612957,
|
||||
audioBoost: -81294276.24446929,
|
||||
location: 'location',
|
||||
mediaBufferSize: 30606631.50083433,
|
||||
mediaBufferSize: -54391953.000071116,
|
||||
session: 'session',
|
||||
addDebugOverlay: -70696815.34237362,
|
||||
autoAdjustQuality: -83810577.71928595,
|
||||
addDebugOverlay: -27611912.67288199,
|
||||
autoAdjustQuality: 60220639.02267191,
|
||||
},
|
||||
);
|
||||
console.log(result.data);
|
||||
@@ -1956,16 +1954,16 @@ const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||
|
||||
(async () => {
|
||||
const result = await sdk.video.getTimeline(
|
||||
64550873.97298089,
|
||||
-59099515.72277228,
|
||||
'key',
|
||||
'playing',
|
||||
-30122195.47065121,
|
||||
85753219.1612091,
|
||||
-36475708.52265885,
|
||||
'paused',
|
||||
42923471.63451135,
|
||||
-4768474.493235379,
|
||||
-21041401.28754133,
|
||||
'context',
|
||||
26769044.884643376,
|
||||
36998590.48639223,
|
||||
-3788221.7909231335,
|
||||
-68934911.93506223,
|
||||
15139718.511849582,
|
||||
-69627795.90264106,
|
||||
);
|
||||
console.log(result.data);
|
||||
})();
|
||||
|
||||
@@ -31,26 +31,26 @@ describe('test Activities', () => {
|
||||
describe('test cancelServerActivities', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.delete('/activities/ex')
|
||||
.delete('/activities/fugit')
|
||||
.reply(200, { data: {} });
|
||||
return sdk.activities
|
||||
.cancelServerActivities('ex')
|
||||
.cancelServerActivities('fugit')
|
||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.delete('/activities/porro')
|
||||
.delete('/activities/occaecati')
|
||||
.reply(200, { data: {} });
|
||||
return expect(async () => await sdk.activities.cancelServerActivities()).rejects.toThrow();
|
||||
});
|
||||
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.delete('/activities/dicta')
|
||||
.delete('/activities/tenetur')
|
||||
.reply(404, { data: {} });
|
||||
return expect(
|
||||
async () => await sdk.activities.cancelServerActivities('dicta'),
|
||||
async () => await sdk.activities.cancelServerActivities('tenetur'),
|
||||
).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -42,49 +42,45 @@ describe('test Butler', () => {
|
||||
|
||||
describe('test startTask', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.post('/butler/doloribus')
|
||||
.reply(200, { data: {} });
|
||||
return sdk.butler
|
||||
.startTask('doloribus')
|
||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
const scope = nock('{protocol}://{ip}:{port}').post('/butler/error').reply(200, { data: {} });
|
||||
return sdk.butler.startTask('error').then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.post('/butler/beatae')
|
||||
.post('/butler/magnam')
|
||||
.reply(200, { data: {} });
|
||||
return expect(async () => await sdk.butler.startTask()).rejects.toThrow();
|
||||
});
|
||||
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.post('/butler/aliquam')
|
||||
.post('/butler/cumque')
|
||||
.reply(404, { data: {} });
|
||||
return expect(async () => await sdk.butler.startTask('aliquam')).rejects.toThrow();
|
||||
return expect(async () => await sdk.butler.startTask('cumque')).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
describe('test stopTask', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.delete('/butler/beatae')
|
||||
.delete('/butler/delectus')
|
||||
.reply(200, { data: {} });
|
||||
return sdk.butler.stopTask('beatae').then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
return sdk.butler.stopTask('delectus').then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.delete('/butler/necessitatibus')
|
||||
.delete('/butler/repudiandae')
|
||||
.reply(200, { data: {} });
|
||||
return expect(async () => await sdk.butler.stopTask()).rejects.toThrow();
|
||||
});
|
||||
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.delete('/butler/officia')
|
||||
.delete('/butler/iusto')
|
||||
.reply(404, { data: {} });
|
||||
return expect(async () => await sdk.butler.stopTask('officia')).rejects.toThrow();
|
||||
return expect(async () => await sdk.butler.stopTask('iusto')).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -22,10 +22,10 @@ describe('test Hubs', () => {
|
||||
describe('test getGlobalHubs', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/hubs?count=5&onlyTransient=3')
|
||||
.get('/hubs?count=1&onlyTransient=1')
|
||||
.reply(200, { data: {} });
|
||||
return sdk.hubs
|
||||
.getGlobalHubs({ count: 5, onlyTransient: 3 })
|
||||
.getGlobalHubs({ count: 1, onlyTransient: 1 })
|
||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
});
|
||||
@@ -33,26 +33,26 @@ describe('test Hubs', () => {
|
||||
describe('test getLibraryHubs', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/hubs/sections/2?count=9&onlyTransient=2')
|
||||
.get('/hubs/sections/1?count=4&onlyTransient=5')
|
||||
.reply(200, { data: {} });
|
||||
return sdk.hubs
|
||||
.getLibraryHubs(2, { count: 9, onlyTransient: 2 })
|
||||
.getLibraryHubs(1, { count: 4, onlyTransient: 5 })
|
||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/hubs/sections/6?count=7&onlyTransient=5')
|
||||
.get('/hubs/sections/2?count=6&onlyTransient=4')
|
||||
.reply(200, { data: {} });
|
||||
return expect(async () => await sdk.hubs.getLibraryHubs()).rejects.toThrow();
|
||||
});
|
||||
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/hubs/sections/2?count=6&onlyTransient=8')
|
||||
.get('/hubs/sections/5?count=8&onlyTransient=9')
|
||||
.reply(404, { data: {} });
|
||||
return expect(
|
||||
async () => await sdk.hubs.getLibraryHubs(2, { count: 6, onlyTransient: 8 }),
|
||||
async () => await sdk.hubs.getLibraryHubs(5, { count: 8, onlyTransient: 9 }),
|
||||
).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -22,26 +22,26 @@ describe('test Library', () => {
|
||||
describe('test getFileHash', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/library/hashes?url=officia&type_=7')
|
||||
.get('/library/hashes?url=voluptatem&type_=2')
|
||||
.reply(200, { data: {} });
|
||||
return sdk.library
|
||||
.getFileHash('officia', { type: 7 })
|
||||
.getFileHash('voluptatem', { type: 2 })
|
||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/library/hashes?url=molestiae&type_=3')
|
||||
.get('/library/hashes?url=velit&type_=8')
|
||||
.reply(200, { data: {} });
|
||||
return expect(async () => await sdk.library.getFileHash()).rejects.toThrow();
|
||||
});
|
||||
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/library/hashes?url=perferendis&type_=6')
|
||||
.get('/library/hashes?url=quis&type_=9')
|
||||
.reply(404, { data: {} });
|
||||
return expect(
|
||||
async () => await sdk.library.getFileHash('perferendis', { type: 6 }),
|
||||
async () => await sdk.library.getFileHash('quis', { type: 9 }),
|
||||
).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
@@ -67,26 +67,26 @@ describe('test Library', () => {
|
||||
describe('test getLibrary', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/library/sections/3?includeDetails=2')
|
||||
.get('/library/sections/4?includeDetails=7')
|
||||
.reply(200, { data: {} });
|
||||
return sdk.library
|
||||
.getLibrary(3, { includeDetails: 2 })
|
||||
.getLibrary(4, { includeDetails: 7 })
|
||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/library/sections/4?includeDetails=3')
|
||||
.get('/library/sections/5?includeDetails=6')
|
||||
.reply(200, { data: {} });
|
||||
return expect(async () => await sdk.library.getLibrary()).rejects.toThrow();
|
||||
});
|
||||
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/library/sections/9?includeDetails=2')
|
||||
.get('/library/sections/6?includeDetails=1')
|
||||
.reply(404, { data: {} });
|
||||
return expect(
|
||||
async () => await sdk.library.getLibrary(9, { includeDetails: 2 }),
|
||||
async () => await sdk.library.getLibrary(6, { includeDetails: 1 }),
|
||||
).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
@@ -101,42 +101,42 @@ describe('test Library', () => {
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.delete('/library/sections/7')
|
||||
.delete('/library/sections/8')
|
||||
.reply(200, { data: {} });
|
||||
return expect(async () => await sdk.library.deleteLibrary()).rejects.toThrow();
|
||||
});
|
||||
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.delete('/library/sections/8')
|
||||
.delete('/library/sections/3')
|
||||
.reply(404, { data: {} });
|
||||
return expect(async () => await sdk.library.deleteLibrary(8)).rejects.toThrow();
|
||||
return expect(async () => await sdk.library.deleteLibrary(3)).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
describe('test getLibraryItems', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/library/sections/1/all?type_=6&filter=consequuntur')
|
||||
.get('/library/sections/4/all?type_=9&filter=totam')
|
||||
.reply(200, { data: {} });
|
||||
return sdk.library
|
||||
.getLibraryItems(1, { type: 6, filter: 'consequuntur' })
|
||||
.getLibraryItems(4, { type: 9, filter: 'totam' })
|
||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/library/sections/1/all?type_=5&filter=reiciendis')
|
||||
.get('/library/sections/9/all?type_=5&filter=esse')
|
||||
.reply(200, { data: {} });
|
||||
return expect(async () => await sdk.library.getLibraryItems()).rejects.toThrow();
|
||||
});
|
||||
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/library/sections/4/all?type_=5&filter=similique')
|
||||
.get('/library/sections/3/all?type_=4&filter=porro')
|
||||
.reply(404, { data: {} });
|
||||
return expect(
|
||||
async () => await sdk.library.getLibraryItems(4, { type: 5, filter: 'similique' }),
|
||||
async () => await sdk.library.getLibraryItems(3, { type: 4, filter: 'porro' }),
|
||||
).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
@@ -144,9 +144,9 @@ describe('test Library', () => {
|
||||
describe('test refreshLibrary', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/library/sections/4/refresh')
|
||||
.get('/library/sections/3/refresh')
|
||||
.reply(200, { data: {} });
|
||||
return sdk.library.refreshLibrary(4).then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
return sdk.library.refreshLibrary(3).then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
@@ -167,26 +167,26 @@ describe('test Library', () => {
|
||||
describe('test getLatestLibraryItems', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/library/sections/6/latest?type_=1&filter=repudiandae')
|
||||
.get('/library/sections/3/latest?type_=9&filter=eligendi')
|
||||
.reply(200, { data: {} });
|
||||
return sdk.library
|
||||
.getLatestLibraryItems(6, 1, { filter: 'repudiandae' })
|
||||
.getLatestLibraryItems(3, 9, { filter: 'eligendi' })
|
||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/library/sections/7/latest?type_=1&filter=repellendus')
|
||||
.get('/library/sections/4/latest?type_=4&filter=ea')
|
||||
.reply(200, { data: {} });
|
||||
return expect(async () => await sdk.library.getLatestLibraryItems()).rejects.toThrow();
|
||||
});
|
||||
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/library/sections/1/latest?type_=2&filter=consequuntur')
|
||||
.get('/library/sections/2/latest?type_=7&filter=possimus')
|
||||
.reply(404, { data: {} });
|
||||
return expect(
|
||||
async () => await sdk.library.getLatestLibraryItems(1, 2, { filter: 'consequuntur' }),
|
||||
async () => await sdk.library.getLatestLibraryItems(2, 7, { filter: 'possimus' }),
|
||||
).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
@@ -194,26 +194,26 @@ describe('test Library', () => {
|
||||
describe('test getCommonLibraryItems', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/library/sections/2/common?type_=4&filter=neque')
|
||||
.get('/library/sections/7/common?type_=5&filter=consequatur')
|
||||
.reply(200, { data: {} });
|
||||
return sdk.library
|
||||
.getCommonLibraryItems(2, 4, { filter: 'neque' })
|
||||
.getCommonLibraryItems(7, 5, { filter: 'consequatur' })
|
||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/library/sections/7/common?type_=4&filter=dolorum')
|
||||
.get('/library/sections/9/common?type_=2&filter=quia')
|
||||
.reply(200, { data: {} });
|
||||
return expect(async () => await sdk.library.getCommonLibraryItems()).rejects.toThrow();
|
||||
});
|
||||
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/library/sections/9/common?type_=2&filter=iusto')
|
||||
.get('/library/sections/2/common?type_=3&filter=animi')
|
||||
.reply(404, { data: {} });
|
||||
return expect(
|
||||
async () => await sdk.library.getCommonLibraryItems(9, 2, { filter: 'iusto' }),
|
||||
async () => await sdk.library.getCommonLibraryItems(2, 3, { filter: 'animi' }),
|
||||
).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
@@ -221,48 +221,48 @@ describe('test Library', () => {
|
||||
describe('test getMetadata', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/library/metadata/6')
|
||||
.get('/library/metadata/4')
|
||||
.reply(200, { data: {} });
|
||||
return sdk.library.getMetadata(6).then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
return sdk.library.getMetadata(4).then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/library/metadata/1')
|
||||
.get('/library/metadata/5')
|
||||
.reply(200, { data: {} });
|
||||
return expect(async () => await sdk.library.getMetadata()).rejects.toThrow();
|
||||
});
|
||||
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/library/metadata/6')
|
||||
.get('/library/metadata/9')
|
||||
.reply(404, { data: {} });
|
||||
return expect(async () => await sdk.library.getMetadata(6)).rejects.toThrow();
|
||||
return expect(async () => await sdk.library.getMetadata(9)).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
describe('test getMetadataChildren', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/library/metadata/3/children')
|
||||
.get('/library/metadata/2/children')
|
||||
.reply(200, { data: {} });
|
||||
return sdk.library
|
||||
.getMetadataChildren(3)
|
||||
.getMetadataChildren(2)
|
||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/library/metadata/1/children')
|
||||
.get('/library/metadata/4/children')
|
||||
.reply(200, { data: {} });
|
||||
return expect(async () => await sdk.library.getMetadataChildren()).rejects.toThrow();
|
||||
});
|
||||
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/library/metadata/8/children')
|
||||
.get('/library/metadata/9/children')
|
||||
.reply(404, { data: {} });
|
||||
return expect(async () => await sdk.library.getMetadataChildren(8)).rejects.toThrow();
|
||||
return expect(async () => await sdk.library.getMetadataChildren(9)).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -22,25 +22,25 @@ describe('test Log', () => {
|
||||
describe('test logLine', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/log?level=2&message=esse&source=cum')
|
||||
.get('/log?level=6&message=necessitatibus&source=saepe')
|
||||
.reply(200, { data: {} });
|
||||
return sdk.log
|
||||
.logLine(2, 'esse', 'cum')
|
||||
.logLine(6, 'necessitatibus', 'saepe')
|
||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/log?level=3&message=iste&source=ullam')
|
||||
.get('/log?level=8&message=provident&source=saepe')
|
||||
.reply(200, { data: {} });
|
||||
return expect(async () => await sdk.log.logLine()).rejects.toThrow();
|
||||
});
|
||||
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/log?level=8&message=tenetur&source=eum')
|
||||
.get('/log?level=6&message=laboriosam&source=quas')
|
||||
.reply(404, { data: {} });
|
||||
return expect(async () => await sdk.log.logLine(8, 'tenetur', 'eum')).rejects.toThrow();
|
||||
return expect(async () => await sdk.log.logLine(6, 'laboriosam', 'quas')).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -29,65 +29,65 @@ describe('test Media', () => {
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/:/scrobble?key=4')
|
||||
.get('/:/scrobble?key=2')
|
||||
.reply(200, { data: {} });
|
||||
return expect(async () => await sdk.media.markPlayed()).rejects.toThrow();
|
||||
});
|
||||
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/:/scrobble?key=1')
|
||||
.get('/:/scrobble?key=8')
|
||||
.reply(404, { data: {} });
|
||||
return expect(async () => await sdk.media.markPlayed(1)).rejects.toThrow();
|
||||
return expect(async () => await sdk.media.markPlayed(8)).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
describe('test markUnplayed', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/:/unscrobble?key=8')
|
||||
.get('/:/unscrobble?key=9')
|
||||
.reply(200, { data: {} });
|
||||
return sdk.media.markUnplayed(8).then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
return sdk.media.markUnplayed(9).then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/:/unscrobble?key=9')
|
||||
.get('/:/unscrobble?key=3')
|
||||
.reply(200, { data: {} });
|
||||
return expect(async () => await sdk.media.markUnplayed()).rejects.toThrow();
|
||||
});
|
||||
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/:/unscrobble?key=7')
|
||||
.get('/:/unscrobble?key=6')
|
||||
.reply(404, { data: {} });
|
||||
return expect(async () => await sdk.media.markUnplayed(7)).rejects.toThrow();
|
||||
return expect(async () => await sdk.media.markUnplayed(6)).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
describe('test updatePlayProgress', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.post('/:/progress?key=exercitationem&time=6&state=eum')
|
||||
.post('/:/progress?key=ad&time=1&state=tenetur')
|
||||
.reply(200, { data: {} });
|
||||
return sdk.media
|
||||
.updatePlayProgress('exercitationem', 6, 'eum')
|
||||
.updatePlayProgress('ad', 1, 'tenetur')
|
||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.post('/:/progress?key=consectetur&time=1&state=ratione')
|
||||
.post('/:/progress?key=nostrum&time=2&state=nostrum')
|
||||
.reply(200, { data: {} });
|
||||
return expect(async () => await sdk.media.updatePlayProgress()).rejects.toThrow();
|
||||
});
|
||||
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.post('/:/progress?key=illum&time=1&state=ullam')
|
||||
.post('/:/progress?key=ab&time=3&state=impedit')
|
||||
.reply(404, { data: {} });
|
||||
return expect(
|
||||
async () => await sdk.media.updatePlayProgress('illum', 1, 'ullam'),
|
||||
async () => await sdk.media.updatePlayProgress('ab', 3, 'impedit'),
|
||||
).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -22,29 +22,29 @@ describe('test Playlists', () => {
|
||||
describe('test createPlaylist', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.post('/playlists?title=ipsum&type_=dicta&smart=6&uri=tenetur&playQueueID=8')
|
||||
.post('/playlists?title=harum&type_=excepturi&smart=9&uri=nisi&playQueueID=5')
|
||||
.reply(200, { data: {} });
|
||||
return sdk.playlists
|
||||
.createPlaylist('ipsum', 'dicta', 6, { uri: 'tenetur', playQueueID: 8 })
|
||||
.createPlaylist('harum', 'excepturi', 9, { uri: 'nisi', playQueueID: 5 })
|
||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.post('/playlists?title=ab&type_=voluptas&smart=3&uri=ullam&playQueueID=6')
|
||||
.post('/playlists?title=eligendi&type_=tempora&smart=9&uri=eaque&playQueueID=5')
|
||||
.reply(200, { data: {} });
|
||||
return expect(async () => await sdk.playlists.createPlaylist()).rejects.toThrow();
|
||||
});
|
||||
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.post('/playlists?title=distinctio&type_=nobis&smart=2&uri=aut&playQueueID=7')
|
||||
.post('/playlists?title=placeat&type_=vitae&smart=5&uri=voluptatum&playQueueID=2')
|
||||
.reply(404, { data: {} });
|
||||
return expect(
|
||||
async () =>
|
||||
await sdk.playlists.createPlaylist('distinctio', 'nobis', 2, {
|
||||
uri: 'aut',
|
||||
playQueueID: 7,
|
||||
await sdk.playlists.createPlaylist('placeat', 'vitae', 5, {
|
||||
uri: 'voluptatum',
|
||||
playQueueID: 2,
|
||||
}),
|
||||
).rejects.toThrow();
|
||||
});
|
||||
@@ -53,119 +53,119 @@ describe('test Playlists', () => {
|
||||
describe('test getPlaylists', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/playlists/all?playlistType=deserunt&smart=3')
|
||||
.get('/playlists/all?playlistType=repellendus&smart=8')
|
||||
.reply(200, { data: {} });
|
||||
return sdk.playlists
|
||||
.getPlaylists({ playlistType: 'deserunt', smart: 3 })
|
||||
.getPlaylists({ playlistType: 'repellendus', smart: 8 })
|
||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
});
|
||||
|
||||
describe('test getPlaylist', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}').get('/playlists/4').reply(200, { data: {} });
|
||||
return sdk.playlists.getPlaylist(4).then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
const scope = nock('{protocol}://{ip}:{port}').get('/playlists/7').reply(200, { data: {} });
|
||||
return sdk.playlists.getPlaylist(7).then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}').get('/playlists/1').reply(200, { data: {} });
|
||||
const scope = nock('{protocol}://{ip}:{port}').get('/playlists/8').reply(200, { data: {} });
|
||||
return expect(async () => await sdk.playlists.getPlaylist()).rejects.toThrow();
|
||||
});
|
||||
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}').get('/playlists/5').reply(404, { data: {} });
|
||||
return expect(async () => await sdk.playlists.getPlaylist(5)).rejects.toThrow();
|
||||
const scope = nock('{protocol}://{ip}:{port}').get('/playlists/1').reply(404, { data: {} });
|
||||
return expect(async () => await sdk.playlists.getPlaylist(1)).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
describe('test updatePlaylist', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}').put('/playlists/1').reply(200, { data: {} });
|
||||
return sdk.playlists.updatePlaylist(1).then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
const scope = nock('{protocol}://{ip}:{port}').put('/playlists/7').reply(200, { data: {} });
|
||||
return sdk.playlists.updatePlaylist(7).then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}').put('/playlists/6').reply(200, { data: {} });
|
||||
const scope = nock('{protocol}://{ip}:{port}').put('/playlists/7').reply(200, { data: {} });
|
||||
return expect(async () => await sdk.playlists.updatePlaylist()).rejects.toThrow();
|
||||
});
|
||||
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}').put('/playlists/6').reply(404, { data: {} });
|
||||
return expect(async () => await sdk.playlists.updatePlaylist(6)).rejects.toThrow();
|
||||
const scope = nock('{protocol}://{ip}:{port}').put('/playlists/3').reply(404, { data: {} });
|
||||
return expect(async () => await sdk.playlists.updatePlaylist(3)).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
describe('test deletePlaylist', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.delete('/playlists/1')
|
||||
.delete('/playlists/7')
|
||||
.reply(200, { data: {} });
|
||||
return sdk.playlists.deletePlaylist(1).then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
return sdk.playlists.deletePlaylist(7).then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.delete('/playlists/3')
|
||||
.delete('/playlists/4')
|
||||
.reply(200, { data: {} });
|
||||
return expect(async () => await sdk.playlists.deletePlaylist()).rejects.toThrow();
|
||||
});
|
||||
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.delete('/playlists/7')
|
||||
.delete('/playlists/5')
|
||||
.reply(404, { data: {} });
|
||||
return expect(async () => await sdk.playlists.deletePlaylist(7)).rejects.toThrow();
|
||||
return expect(async () => await sdk.playlists.deletePlaylist(5)).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
describe('test getPlaylistContents', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/playlists/1/items?type_=4')
|
||||
.get('/playlists/1/items?type_=7')
|
||||
.reply(200, { data: {} });
|
||||
return sdk.playlists
|
||||
.getPlaylistContents(1, 4)
|
||||
.getPlaylistContents(1, 7)
|
||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/playlists/2/items?type_=8')
|
||||
.get('/playlists/2/items?type_=5')
|
||||
.reply(200, { data: {} });
|
||||
return expect(async () => await sdk.playlists.getPlaylistContents()).rejects.toThrow();
|
||||
});
|
||||
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/playlists/9/items?type_=9')
|
||||
.get('/playlists/6/items?type_=4')
|
||||
.reply(404, { data: {} });
|
||||
return expect(async () => await sdk.playlists.getPlaylistContents(9, 9)).rejects.toThrow();
|
||||
return expect(async () => await sdk.playlists.getPlaylistContents(6, 4)).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
describe('test addPlaylistContents', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.put('/playlists/5/items?uri=repellendus&playQueueID=7')
|
||||
.put('/playlists/6/items?uri=deleniti&playQueueID=5')
|
||||
.reply(200, { data: {} });
|
||||
return sdk.playlists
|
||||
.addPlaylistContents(5, 'repellendus', 7)
|
||||
.addPlaylistContents(6, 'deleniti', 5)
|
||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.put('/playlists/4/items?uri=ipsum&playQueueID=7')
|
||||
.put('/playlists/3/items?uri=asperiores&playQueueID=1')
|
||||
.reply(200, { data: {} });
|
||||
return expect(async () => await sdk.playlists.addPlaylistContents()).rejects.toThrow();
|
||||
});
|
||||
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.put('/playlists/3/items?uri=iusto&playQueueID=1')
|
||||
.put('/playlists/4/items?uri=itaque&playQueueID=6')
|
||||
.reply(404, { data: {} });
|
||||
return expect(
|
||||
async () => await sdk.playlists.addPlaylistContents(3, 'iusto', 1),
|
||||
async () => await sdk.playlists.addPlaylistContents(4, 'itaque', 6),
|
||||
).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
@@ -173,52 +173,50 @@ describe('test Playlists', () => {
|
||||
describe('test clearPlaylistContents', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.delete('/playlists/8/items')
|
||||
.delete('/playlists/4/items')
|
||||
.reply(200, { data: {} });
|
||||
return sdk.playlists
|
||||
.clearPlaylistContents(8)
|
||||
.clearPlaylistContents(4)
|
||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.delete('/playlists/1/items')
|
||||
.delete('/playlists/7/items')
|
||||
.reply(200, { data: {} });
|
||||
return expect(async () => await sdk.playlists.clearPlaylistContents()).rejects.toThrow();
|
||||
});
|
||||
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.delete('/playlists/8/items')
|
||||
.delete('/playlists/1/items')
|
||||
.reply(404, { data: {} });
|
||||
return expect(async () => await sdk.playlists.clearPlaylistContents(8)).rejects.toThrow();
|
||||
return expect(async () => await sdk.playlists.clearPlaylistContents(1)).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
describe('test uploadPlaylist', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.post('/playlists/upload?path=omnis&force=7')
|
||||
.post('/playlists/upload?path=nesciunt&force=5')
|
||||
.reply(200, { data: {} });
|
||||
return sdk.playlists
|
||||
.uploadPlaylist('omnis', 7)
|
||||
.uploadPlaylist('nesciunt', 5)
|
||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.post('/playlists/upload?path=consequatur&force=7')
|
||||
.post('/playlists/upload?path=ex&force=5')
|
||||
.reply(200, { data: {} });
|
||||
return expect(async () => await sdk.playlists.uploadPlaylist()).rejects.toThrow();
|
||||
});
|
||||
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.post('/playlists/upload?path=explicabo&force=3')
|
||||
.post('/playlists/upload?path=eaque&force=8')
|
||||
.reply(404, { data: {} });
|
||||
return expect(
|
||||
async () => await sdk.playlists.uploadPlaylist('explicabo', 3),
|
||||
).rejects.toThrow();
|
||||
return expect(async () => await sdk.playlists.uploadPlaylist('eaque', 8)).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -22,26 +22,26 @@ describe('test Search', () => {
|
||||
describe('test performSearch', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/hubs/search?query=exercitationem§ionId=2&limit=2')
|
||||
.get('/hubs/search?query=adipisci§ionId=9&limit=8')
|
||||
.reply(200, { data: {} });
|
||||
return sdk.search
|
||||
.performSearch('exercitationem', { sectionId: 2, limit: 2 })
|
||||
.performSearch('adipisci', { sectionId: 9, limit: 8 })
|
||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/hubs/search?query=officiis§ionId=2&limit=2')
|
||||
.get('/hubs/search?query=quas§ionId=9&limit=1')
|
||||
.reply(200, { data: {} });
|
||||
return expect(async () => await sdk.search.performSearch()).rejects.toThrow();
|
||||
});
|
||||
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/hubs/search?query=perferendis§ionId=2&limit=1')
|
||||
.get('/hubs/search?query=dolores§ionId=1&limit=2')
|
||||
.reply(404, { data: {} });
|
||||
return expect(
|
||||
async () => await sdk.search.performSearch('perferendis', { sectionId: 2, limit: 1 }),
|
||||
async () => await sdk.search.performSearch('dolores', { sectionId: 1, limit: 2 }),
|
||||
).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
@@ -49,27 +49,26 @@ describe('test Search', () => {
|
||||
describe('test performVoiceSearch', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/hubs/search/voice?query=minus§ionId=5&limit=1')
|
||||
.get('/hubs/search/voice?query=vitae§ionId=5&limit=6')
|
||||
.reply(200, { data: {} });
|
||||
return sdk.search
|
||||
.performVoiceSearch('minus', { sectionId: 5, limit: 1 })
|
||||
.performVoiceSearch('vitae', { sectionId: 5, limit: 6 })
|
||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/hubs/search/voice?query=sed§ionId=1&limit=7')
|
||||
.get('/hubs/search/voice?query=ab§ionId=2&limit=2')
|
||||
.reply(200, { data: {} });
|
||||
return expect(async () => await sdk.search.performVoiceSearch()).rejects.toThrow();
|
||||
});
|
||||
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/hubs/search/voice?query=exercitationem§ionId=7&limit=9')
|
||||
.get('/hubs/search/voice?query=id§ionId=5&limit=4')
|
||||
.reply(404, { data: {} });
|
||||
return expect(
|
||||
async () =>
|
||||
await sdk.search.performVoiceSearch('exercitationem', { sectionId: 7, limit: 9 }),
|
||||
async () => await sdk.search.performVoiceSearch('id', { sectionId: 5, limit: 4 }),
|
||||
).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
@@ -77,25 +76,25 @@ describe('test Search', () => {
|
||||
describe('test getSearchResults', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/search?query=harum')
|
||||
.get('/search?query=aspernatur')
|
||||
.reply(200, { data: {} });
|
||||
return sdk.search
|
||||
.getSearchResults('harum')
|
||||
.getSearchResults('aspernatur')
|
||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/search?query=atque')
|
||||
.get('/search?query=quasi')
|
||||
.reply(200, { data: {} });
|
||||
return expect(async () => await sdk.search.getSearchResults()).rejects.toThrow();
|
||||
});
|
||||
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/search?query=qui')
|
||||
.get('/search?query=ex')
|
||||
.reply(404, { data: {} });
|
||||
return expect(async () => await sdk.search.getSearchResults('qui')).rejects.toThrow();
|
||||
return expect(async () => await sdk.search.getSearchResults('ex')).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -22,26 +22,26 @@ describe('test Security', () => {
|
||||
describe('test getTransientToken', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/security/token?type_=consectetur&scope=sed')
|
||||
.get('/security/token?type_=rem&scope=porro')
|
||||
.reply(200, { data: {} });
|
||||
return sdk.security
|
||||
.getTransientToken('consectetur', 'sed')
|
||||
.getTransientToken('rem', 'porro')
|
||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/security/token?type_=laborum&scope=est')
|
||||
.get('/security/token?type_=rem&scope=magni')
|
||||
.reply(200, { data: {} });
|
||||
return expect(async () => await sdk.security.getTransientToken()).rejects.toThrow();
|
||||
});
|
||||
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/security/token?type_=debitis&scope=tempora')
|
||||
.get('/security/token?type_=quo&scope=aut')
|
||||
.reply(404, { data: {} });
|
||||
return expect(
|
||||
async () => await sdk.security.getTransientToken('debitis', 'tempora'),
|
||||
async () => await sdk.security.getTransientToken('quo', 'aut'),
|
||||
).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
@@ -49,16 +49,16 @@ describe('test Security', () => {
|
||||
describe('test getSourceConnectionInformation', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/security/resources?source=quod')
|
||||
.get('/security/resources?source=suscipit')
|
||||
.reply(200, { data: {} });
|
||||
return sdk.security
|
||||
.getSourceConnectionInformation('quod')
|
||||
.getSourceConnectionInformation('suscipit')
|
||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/security/resources?source=repudiandae')
|
||||
.get('/security/resources?source=consectetur')
|
||||
.reply(200, { data: {} });
|
||||
return expect(
|
||||
async () => await sdk.security.getSourceConnectionInformation(),
|
||||
@@ -67,10 +67,10 @@ describe('test Security', () => {
|
||||
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get('/security/resources?source=similique')
|
||||
.get('/security/resources?source=consequatur')
|
||||
.reply(404, { data: {} });
|
||||
return expect(
|
||||
async () => await sdk.security.getSourceConnectionInformation('similique'),
|
||||
async () => await sdk.security.getSourceConnectionInformation('consequatur'),
|
||||
).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -73,18 +73,18 @@ describe('test Server', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get(
|
||||
'/photo/:/transcode?width=9234993610&height=6&opacity=1&blur=5&minSize=6&upscale=4&url=ab',
|
||||
'/photo/:/transcode?width=1002254168&height=9&opacity=8&blur=9&minSize=6&upscale=2&url=quibusdam',
|
||||
)
|
||||
.reply(200, { data: {} });
|
||||
return sdk.server
|
||||
.getResizedPhoto(9234993610, 6, 1, 5, 6, 4, 'ab')
|
||||
.getResizedPhoto(1002254168, 9, 8, 9, 6, 2, 'quibusdam')
|
||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get(
|
||||
'/photo/:/transcode?width=8995296218&height=6&opacity=5&blur=4&minSize=4&upscale=3&url=perferendis',
|
||||
'/photo/:/transcode?width=9612381291&height=3&opacity=2&blur=4&minSize=1&upscale=8&url=modi',
|
||||
)
|
||||
.reply(200, { data: {} });
|
||||
return expect(async () => await sdk.server.getResizedPhoto()).rejects.toThrow();
|
||||
@@ -93,11 +93,11 @@ describe('test Server', () => {
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get(
|
||||
'/photo/:/transcode?width=7861841002&height=3&opacity=9&blur=3&minSize=9&upscale=9&url=esse',
|
||||
'/photo/:/transcode?width=2629629187&height=7&opacity=6&blur=9&minSize=9&upscale=7&url=sunt',
|
||||
)
|
||||
.reply(404, { data: {} });
|
||||
return expect(
|
||||
async () => await sdk.server.getResizedPhoto(7861841002, 3, 9, 3, 9, 9, 'esse'),
|
||||
async () => await sdk.server.getResizedPhoto(2629629187, 7, 6, 9, 9, 7, 'sunt'),
|
||||
).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -53,25 +53,25 @@ describe('test Sessions', () => {
|
||||
describe('test stopTranscodeSession', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.delete('/transcode/sessions/tenetur')
|
||||
.delete('/transcode/sessions/sint')
|
||||
.reply(200, { data: {} });
|
||||
return sdk.sessions
|
||||
.stopTranscodeSession('tenetur')
|
||||
.stopTranscodeSession('sint')
|
||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.delete('/transcode/sessions/reprehenderit')
|
||||
.delete('/transcode/sessions/aliquid')
|
||||
.reply(200, { data: {} });
|
||||
return expect(async () => await sdk.sessions.stopTranscodeSession()).rejects.toThrow();
|
||||
});
|
||||
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.delete('/transcode/sessions/omnis')
|
||||
.delete('/transcode/sessions/ex')
|
||||
.reply(404, { data: {} });
|
||||
return expect(async () => await sdk.sessions.stopTranscodeSession('omnis')).rejects.toThrow();
|
||||
return expect(async () => await sdk.sessions.stopTranscodeSession('ex')).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -23,20 +23,20 @@ describe('test Video', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get(
|
||||
'/video/:/transcode/universal/start.mpd?hasMDE=7&path=ut&mediaIndex=4&partIndex=4&protocol=quam&fastSeek=9&directPlay=5&directStream=1&subtitleSize=3&subtites=unde&audioBoost=3&location=amet&mediaBufferSize=4&session=vero&addDebugOverlay=8&autoAdjustQuality=2',
|
||||
'/video/:/transcode/universal/start.mpd?hasMDE=8&path=harum&mediaIndex=9&partIndex=3&protocol=id&fastSeek=4&directPlay=4&directStream=8&subtitleSize=9&subtites=laudantium&audioBoost=5&location=harum&mediaBufferSize=7&session=possimus&addDebugOverlay=8&autoAdjustQuality=2',
|
||||
)
|
||||
.reply(200, { data: {} });
|
||||
return sdk.video
|
||||
.startUniversalTranscode(7, 'ut', 4, 4, 'quam', {
|
||||
fastSeek: 9,
|
||||
directPlay: 5,
|
||||
directStream: 1,
|
||||
subtitleSize: 3,
|
||||
subtites: 'unde',
|
||||
audioBoost: 3,
|
||||
location: 'amet',
|
||||
mediaBufferSize: 4,
|
||||
session: 'vero',
|
||||
.startUniversalTranscode(8, 'harum', 9, 3, 'id', {
|
||||
fastSeek: 4,
|
||||
directPlay: 4,
|
||||
directStream: 8,
|
||||
subtitleSize: 9,
|
||||
subtites: 'laudantium',
|
||||
audioBoost: 5,
|
||||
location: 'harum',
|
||||
mediaBufferSize: 7,
|
||||
session: 'possimus',
|
||||
addDebugOverlay: 8,
|
||||
autoAdjustQuality: 2,
|
||||
})
|
||||
@@ -46,7 +46,7 @@ describe('test Video', () => {
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get(
|
||||
'/video/:/transcode/universal/start.mpd?hasMDE=5&path=id&mediaIndex=5&partIndex=3&protocol=commodi&fastSeek=4&directPlay=1&directStream=9&subtitleSize=4&subtites=amet&audioBoost=1&location=eaque&mediaBufferSize=4&session=veritatis&addDebugOverlay=7&autoAdjustQuality=5',
|
||||
'/video/:/transcode/universal/start.mpd?hasMDE=3&path=voluptatibus&mediaIndex=5&partIndex=1&protocol=harum&fastSeek=2&directPlay=3&directStream=5&subtitleSize=6&subtites=repellendus&audioBoost=6&location=cum&mediaBufferSize=5&session=praesentium&addDebugOverlay=4&autoAdjustQuality=5',
|
||||
)
|
||||
.reply(200, { data: {} });
|
||||
return expect(async () => await sdk.video.startUniversalTranscode()).rejects.toThrow();
|
||||
@@ -55,23 +55,23 @@ describe('test Video', () => {
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get(
|
||||
'/video/:/transcode/universal/start.mpd?hasMDE=2&path=cum&mediaIndex=4&partIndex=9&protocol=odit&fastSeek=6&directPlay=7&directStream=3&subtitleSize=7&subtites=amet&audioBoost=5&location=nam&mediaBufferSize=2&session=libero&addDebugOverlay=8&autoAdjustQuality=5',
|
||||
'/video/:/transcode/universal/start.mpd?hasMDE=4&path=sed&mediaIndex=6&partIndex=3&protocol=tempora&fastSeek=5&directPlay=8&directStream=6&subtitleSize=2&subtites=delectus&audioBoost=7&location=porro&mediaBufferSize=2&session=rem&addDebugOverlay=9&autoAdjustQuality=7',
|
||||
)
|
||||
.reply(404, { data: {} });
|
||||
return expect(
|
||||
async () =>
|
||||
await sdk.video.startUniversalTranscode(2, 'cum', 4, 9, 'odit', {
|
||||
fastSeek: 6,
|
||||
directPlay: 7,
|
||||
directStream: 3,
|
||||
subtitleSize: 7,
|
||||
subtites: 'amet',
|
||||
audioBoost: 5,
|
||||
location: 'nam',
|
||||
await sdk.video.startUniversalTranscode(4, 'sed', 6, 3, 'tempora', {
|
||||
fastSeek: 5,
|
||||
directPlay: 8,
|
||||
directStream: 6,
|
||||
subtitleSize: 2,
|
||||
subtites: 'delectus',
|
||||
audioBoost: 7,
|
||||
location: 'porro',
|
||||
mediaBufferSize: 2,
|
||||
session: 'libero',
|
||||
addDebugOverlay: 8,
|
||||
autoAdjustQuality: 5,
|
||||
session: 'rem',
|
||||
addDebugOverlay: 9,
|
||||
autoAdjustQuality: 7,
|
||||
}),
|
||||
).rejects.toThrow();
|
||||
});
|
||||
@@ -81,18 +81,29 @@ describe('test Video', () => {
|
||||
test('test api call', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get(
|
||||
'/:/timeline?ratingKey=6&key=ullam&state=sunt&hasMDE=6&time=3&duration=8&context=quasiillovoluptatempraesentiumquae&playQueueItemID=8&playBackTime=2&row=7',
|
||||
'/:/timeline?ratingKey=1&key=placeat&state=tempore&hasMDE=7&time=2&duration=8&context=ducimusdoloresnostrumeosimpedit&playQueueItemID=5&playBackTime=1&row=5',
|
||||
)
|
||||
.reply(200, { data: {} });
|
||||
return sdk.video
|
||||
.getTimeline(6, 'ullam', 'sunt', 6, 3, 8, 'quasi illo voluptatem praesentium quae', 8, 2, 7)
|
||||
.getTimeline(
|
||||
1,
|
||||
'placeat',
|
||||
'tempore',
|
||||
7,
|
||||
2,
|
||||
8,
|
||||
'ducimus dolores nostrum eos impedit',
|
||||
5,
|
||||
1,
|
||||
5,
|
||||
)
|
||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||
});
|
||||
|
||||
test('test will throw error if required fields missing', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get(
|
||||
'/:/timeline?ratingKey=3&key=debitis&state=voluptatem&hasMDE=5&time=7&duration=8&context=excepturiquosuscipitundeprovident&playQueueItemID=4&playBackTime=6&row=2',
|
||||
'/:/timeline?ratingKey=1&key=quidem&state=quo&hasMDE=1&time=8&duration=2&context=aspernatureumdignissimosatqueassumenda&playQueueItemID=6&playBackTime=4&row=6',
|
||||
)
|
||||
.reply(200, { data: {} });
|
||||
return expect(async () => await sdk.video.getTimeline()).rejects.toThrow();
|
||||
@@ -101,22 +112,22 @@ describe('test Video', () => {
|
||||
test('test will throw error on a non-200 response', () => {
|
||||
const scope = nock('{protocol}://{ip}:{port}')
|
||||
.get(
|
||||
'/:/timeline?ratingKey=3&key=veniam&state=ad&hasMDE=5&time=6&duration=4&context=laboriosameligendiaspernaturfugitnihil&playQueueItemID=8&playBackTime=1&row=1',
|
||||
'/:/timeline?ratingKey=3&key=facilis&state=ipsum&hasMDE=7&time=5&duration=6&context=earumimpeditnequeisteanimi&playQueueItemID=9&playBackTime=2&row=7',
|
||||
)
|
||||
.reply(404, { data: {} });
|
||||
return expect(
|
||||
async () =>
|
||||
await sdk.video.getTimeline(
|
||||
3,
|
||||
'veniam',
|
||||
'ad',
|
||||
'facilis',
|
||||
'ipsum',
|
||||
7,
|
||||
5,
|
||||
6,
|
||||
4,
|
||||
'laboriosam eligendi aspernatur fugit nihil',
|
||||
8,
|
||||
1,
|
||||
1,
|
||||
'earum impedit neque iste animi',
|
||||
9,
|
||||
2,
|
||||
7,
|
||||
),
|
||||
).rejects.toThrow();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user