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:
100
README.md
100
README.md
@@ -518,7 +518,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.media.updatePlayProgress('key', -25032179.723307386, 'state');
|
const result = await sdk.media.updatePlayProgress('key', 90469787.90055934, 'state');
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -672,7 +672,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.butler.startTask('RefreshPeriodicMetadata');
|
const result = await sdk.butler.startTask('GenerateChapterThumbs');
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -702,7 +702,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.butler.stopTask('GenerateChapterThumbs');
|
const result = await sdk.butler.stopTask('DeepMediaAnalysis');
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -736,7 +736,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.hubs.getGlobalHubs({ count: -41963860.27512902, onlyTransient: 42 });
|
const result = await sdk.hubs.getGlobalHubs({ count: 56455806.18512213, onlyTransient: 1 });
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -774,8 +774,8 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.hubs.getLibraryHubs(-19572217.151876092, {
|
const result = await sdk.hubs.getLibraryHubs(14224427.485252097, {
|
||||||
count: 64492424.84453416,
|
count: 59167335.01182026,
|
||||||
onlyTransient: 1,
|
onlyTransient: 1,
|
||||||
});
|
});
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
@@ -816,8 +816,8 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.search.performSearch('dylan', {
|
const result = await sdk.search.performSearch('arnold', {
|
||||||
sectionId: -80780418.69956203,
|
sectionId: 23503236.39517291,
|
||||||
limit: 5,
|
limit: 5,
|
||||||
});
|
});
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
@@ -858,7 +858,7 @@ const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
|||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.search.performVoiceSearch('dead+poop', {
|
const result = await sdk.search.performVoiceSearch('dead+poop', {
|
||||||
sectionId: 86426181.42960766,
|
sectionId: 49725001.21318659,
|
||||||
limit: 5,
|
limit: 5,
|
||||||
});
|
});
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
@@ -929,7 +929,7 @@ const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
|||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.library.getFileHash('file://C:Image.png&type=13', {
|
const result = await sdk.library.getFileHash('file://C:Image.png&type=13', {
|
||||||
type: 1221820.9318130612,
|
type: 57131492.35348597,
|
||||||
});
|
});
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
@@ -1081,8 +1081,8 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.library.getLibraryItems(-52353690.921314076, {
|
const result = await sdk.library.getLibraryItems(5918142.371238574, {
|
||||||
type: 57657681.83699939,
|
type: -7809061.492073655,
|
||||||
filter: 'filter',
|
filter: 'filter',
|
||||||
});
|
});
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
@@ -1114,7 +1114,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.library.refreshLibrary(83063605.3709105);
|
const result = await sdk.library.refreshLibrary(96299696.9761284);
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -1152,7 +1152,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.library.getLatestLibraryItems(17288749.454815328, -65987149.628176846, {
|
const result = await sdk.library.getLatestLibraryItems(92402469.6477915, -96400116.97826156, {
|
||||||
filter: 'filter',
|
filter: 'filter',
|
||||||
});
|
});
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
@@ -1192,7 +1192,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.library.getCommonLibraryItems(77036914.15493327, 88290768.12302619, {
|
const result = await sdk.library.getCommonLibraryItems(10111915.895296082, 55224735.92815569, {
|
||||||
filter: 'filter',
|
filter: 'filter',
|
||||||
});
|
});
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
@@ -1224,7 +1224,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.library.getMetadata(-81847309.63397841);
|
const result = await sdk.library.getMetadata(62182009.76385683);
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -1254,7 +1254,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.library.getMetadataChildren(27040154.17391461);
|
const result = await sdk.library.getMetadataChildren(11669243.106740937);
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -1333,7 +1333,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.log.logLine(3, 'message', 'source');
|
const result = await sdk.log.logLine(2, 'message', 'source');
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -1397,9 +1397,9 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.playlists.createPlaylist('title', 'photo', 1, {
|
const result = await sdk.playlists.createPlaylist('title', 'audio', 42, {
|
||||||
uri: 'uri',
|
uri: 'uri',
|
||||||
playQueueID: -19291134.067149103,
|
playQueueID: -22282333.505305633,
|
||||||
});
|
});
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
@@ -1463,7 +1463,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.playlists.getPlaylist(56646356.33382389);
|
const result = await sdk.playlists.getPlaylist(25521232.224839047);
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -1493,7 +1493,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.playlists.deletePlaylist(-85154371.25049327);
|
const result = await sdk.playlists.deletePlaylist(-60675901.030656695);
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -1523,7 +1523,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.playlists.updatePlaylist(-81706994.06882615);
|
const result = await sdk.playlists.updatePlaylist(65200160.70787519);
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -1554,7 +1554,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.playlists.getPlaylistContents(76448342.73388726, 15972838.426946774);
|
const result = await sdk.playlists.getPlaylistContents(62167005.120096, 2249491.135525167);
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -1584,7 +1584,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.playlists.clearPlaylistContents(13524541.663327798);
|
const result = await sdk.playlists.clearPlaylistContents(24703702.974021226);
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -1616,7 +1616,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.playlists.addPlaylistContents(-23895786.25933972, 'library://..', 123);
|
const result = await sdk.playlists.addPlaylistContents(-3444881.095142722, 'library://..', 123);
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -1647,7 +1647,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.playlists.uploadPlaylist('/home/barkley/playlist.m3u', 42);
|
const result = await sdk.playlists.uploadPlaylist('/home/barkley/playlist.m3u', 1);
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -1709,7 +1709,9 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.security.getSourceConnectionInformation('server://client-identifier');
|
const result = await sdk.security.getSourceConnectionInformation(
|
||||||
|
'provider://provider-identifier',
|
||||||
|
);
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -1865,7 +1867,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.updater.checkForUpdates({ download: 1 });
|
const result = await sdk.updater.checkForUpdates({ download: 'foo' });
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -1898,7 +1900,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.updater.applyUpdates({ tonight: 1, skip: 'foo' });
|
const result = await sdk.updater.applyUpdates({ tonight: 'foo', skip: 1 });
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -1951,23 +1953,23 @@ const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
|||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.video.startUniversalTranscode(
|
const result = await sdk.video.startUniversalTranscode(
|
||||||
99273297.24555674,
|
-87516165.31957072,
|
||||||
'path',
|
'path',
|
||||||
21375268.684818625,
|
-62877687.452249065,
|
||||||
-18767699.730034873,
|
-23076170.49337977,
|
||||||
'protocol',
|
'protocol',
|
||||||
{
|
{
|
||||||
fastSeek: -51749402.15485502,
|
fastSeek: -68282427.87913167,
|
||||||
directPlay: -77287047.4341131,
|
directPlay: -74000014.76895301,
|
||||||
directStream: 89594169.19331425,
|
directStream: 84943482.78212723,
|
||||||
subtitleSize: -88919523.21207976,
|
subtitleSize: -55237723.44813809,
|
||||||
subtites: 'subtites',
|
subtites: 'subtites',
|
||||||
audioBoost: -81294276.24446929,
|
audioBoost: 29945312.780143052,
|
||||||
location: 'location',
|
location: 'location',
|
||||||
mediaBufferSize: -54391953.000071116,
|
mediaBufferSize: -16516185.759793341,
|
||||||
session: 'session',
|
session: 'session',
|
||||||
addDebugOverlay: -27611912.67288199,
|
addDebugOverlay: -10261279.500832424,
|
||||||
autoAdjustQuality: 60220639.02267191,
|
autoAdjustQuality: 32480614.034784466,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
@@ -2009,16 +2011,16 @@ const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
|||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.video.getTimeline(
|
const result = await sdk.video.getTimeline(
|
||||||
-59099515.72277228,
|
-32608281.350922346,
|
||||||
'key',
|
'key',
|
||||||
'paused',
|
'stopped',
|
||||||
42923471.63451135,
|
-74699884.18136695,
|
||||||
-4768474.493235379,
|
-66756517.26572518,
|
||||||
-21041401.28754133,
|
-24893130.84645444,
|
||||||
'context',
|
'context',
|
||||||
-68934911.93506223,
|
-75734154.35564606,
|
||||||
15139718.511849582,
|
-89175857.3275879,
|
||||||
-69627795.90264106,
|
-15877259.38555336,
|
||||||
);
|
);
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export enum Environment {
|
export enum Environment {
|
||||||
DEFAULT = '{protocol}://{ip}:{port}',
|
DEFAULT = 'http://10.10.10.47:32400',
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -463,7 +463,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.media.updatePlayProgress('key', -25032179.723307386, 'state');
|
const result = await sdk.media.updatePlayProgress('key', 90469787.90055934, 'state');
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -617,7 +617,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.butler.startTask('RefreshPeriodicMetadata');
|
const result = await sdk.butler.startTask('GenerateChapterThumbs');
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -647,7 +647,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.butler.stopTask('GenerateChapterThumbs');
|
const result = await sdk.butler.stopTask('DeepMediaAnalysis');
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -681,7 +681,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.hubs.getGlobalHubs({ count: -41963860.27512902, onlyTransient: 42 });
|
const result = await sdk.hubs.getGlobalHubs({ count: 56455806.18512213, onlyTransient: 1 });
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -719,8 +719,8 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.hubs.getLibraryHubs(-19572217.151876092, {
|
const result = await sdk.hubs.getLibraryHubs(14224427.485252097, {
|
||||||
count: 64492424.84453416,
|
count: 59167335.01182026,
|
||||||
onlyTransient: 1,
|
onlyTransient: 1,
|
||||||
});
|
});
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
@@ -761,8 +761,8 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.search.performSearch('dylan', {
|
const result = await sdk.search.performSearch('arnold', {
|
||||||
sectionId: -80780418.69956203,
|
sectionId: 23503236.39517291,
|
||||||
limit: 5,
|
limit: 5,
|
||||||
});
|
});
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
@@ -803,7 +803,7 @@ const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
|||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.search.performVoiceSearch('dead+poop', {
|
const result = await sdk.search.performVoiceSearch('dead+poop', {
|
||||||
sectionId: 86426181.42960766,
|
sectionId: 49725001.21318659,
|
||||||
limit: 5,
|
limit: 5,
|
||||||
});
|
});
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
@@ -874,7 +874,7 @@ const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
|||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.library.getFileHash('file://C:Image.png&type=13', {
|
const result = await sdk.library.getFileHash('file://C:Image.png&type=13', {
|
||||||
type: 1221820.9318130612,
|
type: 57131492.35348597,
|
||||||
});
|
});
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
@@ -1026,8 +1026,8 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.library.getLibraryItems(-52353690.921314076, {
|
const result = await sdk.library.getLibraryItems(5918142.371238574, {
|
||||||
type: 57657681.83699939,
|
type: -7809061.492073655,
|
||||||
filter: 'filter',
|
filter: 'filter',
|
||||||
});
|
});
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
@@ -1059,7 +1059,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.library.refreshLibrary(83063605.3709105);
|
const result = await sdk.library.refreshLibrary(96299696.9761284);
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -1097,7 +1097,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.library.getLatestLibraryItems(17288749.454815328, -65987149.628176846, {
|
const result = await sdk.library.getLatestLibraryItems(92402469.6477915, -96400116.97826156, {
|
||||||
filter: 'filter',
|
filter: 'filter',
|
||||||
});
|
});
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
@@ -1137,7 +1137,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.library.getCommonLibraryItems(77036914.15493327, 88290768.12302619, {
|
const result = await sdk.library.getCommonLibraryItems(10111915.895296082, 55224735.92815569, {
|
||||||
filter: 'filter',
|
filter: 'filter',
|
||||||
});
|
});
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
@@ -1169,7 +1169,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.library.getMetadata(-81847309.63397841);
|
const result = await sdk.library.getMetadata(62182009.76385683);
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -1199,7 +1199,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.library.getMetadataChildren(27040154.17391461);
|
const result = await sdk.library.getMetadataChildren(11669243.106740937);
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -1278,7 +1278,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.log.logLine(3, 'message', 'source');
|
const result = await sdk.log.logLine(2, 'message', 'source');
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -1342,9 +1342,9 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.playlists.createPlaylist('title', 'photo', 1, {
|
const result = await sdk.playlists.createPlaylist('title', 'audio', 42, {
|
||||||
uri: 'uri',
|
uri: 'uri',
|
||||||
playQueueID: -19291134.067149103,
|
playQueueID: -22282333.505305633,
|
||||||
});
|
});
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
@@ -1408,7 +1408,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.playlists.getPlaylist(56646356.33382389);
|
const result = await sdk.playlists.getPlaylist(25521232.224839047);
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -1438,7 +1438,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.playlists.deletePlaylist(-85154371.25049327);
|
const result = await sdk.playlists.deletePlaylist(-60675901.030656695);
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -1468,7 +1468,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.playlists.updatePlaylist(-81706994.06882615);
|
const result = await sdk.playlists.updatePlaylist(65200160.70787519);
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -1499,7 +1499,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.playlists.getPlaylistContents(76448342.73388726, 15972838.426946774);
|
const result = await sdk.playlists.getPlaylistContents(62167005.120096, 2249491.135525167);
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -1529,7 +1529,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.playlists.clearPlaylistContents(13524541.663327798);
|
const result = await sdk.playlists.clearPlaylistContents(24703702.974021226);
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -1561,7 +1561,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.playlists.addPlaylistContents(-23895786.25933972, 'library://..', 123);
|
const result = await sdk.playlists.addPlaylistContents(-3444881.095142722, 'library://..', 123);
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -1592,7 +1592,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.playlists.uploadPlaylist('/home/barkley/playlist.m3u', 42);
|
const result = await sdk.playlists.uploadPlaylist('/home/barkley/playlist.m3u', 1);
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -1654,7 +1654,9 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.security.getSourceConnectionInformation('server://client-identifier');
|
const result = await sdk.security.getSourceConnectionInformation(
|
||||||
|
'provider://provider-identifier',
|
||||||
|
);
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -1810,7 +1812,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.updater.checkForUpdates({ download: 1 });
|
const result = await sdk.updater.checkForUpdates({ download: 'foo' });
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -1843,7 +1845,7 @@ import { PlexSDK } from './src';
|
|||||||
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.updater.applyUpdates({ tonight: 1, skip: 'foo' });
|
const result = await sdk.updater.applyUpdates({ tonight: 'foo', skip: 1 });
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@@ -1896,23 +1898,23 @@ const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
|||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.video.startUniversalTranscode(
|
const result = await sdk.video.startUniversalTranscode(
|
||||||
99273297.24555674,
|
-87516165.31957072,
|
||||||
'path',
|
'path',
|
||||||
21375268.684818625,
|
-62877687.452249065,
|
||||||
-18767699.730034873,
|
-23076170.49337977,
|
||||||
'protocol',
|
'protocol',
|
||||||
{
|
{
|
||||||
fastSeek: -51749402.15485502,
|
fastSeek: -68282427.87913167,
|
||||||
directPlay: -77287047.4341131,
|
directPlay: -74000014.76895301,
|
||||||
directStream: 89594169.19331425,
|
directStream: 84943482.78212723,
|
||||||
subtitleSize: -88919523.21207976,
|
subtitleSize: -55237723.44813809,
|
||||||
subtites: 'subtites',
|
subtites: 'subtites',
|
||||||
audioBoost: -81294276.24446929,
|
audioBoost: 29945312.780143052,
|
||||||
location: 'location',
|
location: 'location',
|
||||||
mediaBufferSize: -54391953.000071116,
|
mediaBufferSize: -16516185.759793341,
|
||||||
session: 'session',
|
session: 'session',
|
||||||
addDebugOverlay: -27611912.67288199,
|
addDebugOverlay: -10261279.500832424,
|
||||||
autoAdjustQuality: 60220639.02267191,
|
autoAdjustQuality: 32480614.034784466,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
@@ -1954,16 +1956,16 @@ const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
|
|||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const result = await sdk.video.getTimeline(
|
const result = await sdk.video.getTimeline(
|
||||||
-59099515.72277228,
|
-32608281.350922346,
|
||||||
'key',
|
'key',
|
||||||
'paused',
|
'stopped',
|
||||||
42923471.63451135,
|
-74699884.18136695,
|
||||||
-4768474.493235379,
|
-66756517.26572518,
|
||||||
-21041401.28754133,
|
-24893130.84645444,
|
||||||
'context',
|
'context',
|
||||||
-68934911.93506223,
|
-75734154.35564606,
|
||||||
15139718.511849582,
|
-89175857.3275879,
|
||||||
-69627795.90264106,
|
-15877259.38555336,
|
||||||
);
|
);
|
||||||
console.log(result.data);
|
console.log(result.data);
|
||||||
})();
|
})();
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ describe('test Activities', () => {
|
|||||||
|
|
||||||
describe('test getServerActivities', () => {
|
describe('test getServerActivities', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}').get('/activities').reply(200, { data: {} });
|
const scope = nock('http://10.10.10.47:32400').get('/activities').reply(200, { data: {} });
|
||||||
return sdk.activities
|
return sdk.activities
|
||||||
.getServerActivities()
|
.getServerActivities()
|
||||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
@@ -30,27 +30,27 @@ describe('test Activities', () => {
|
|||||||
|
|
||||||
describe('test cancelServerActivities', () => {
|
describe('test cancelServerActivities', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.delete('/activities/fugit')
|
.delete('/activities/unde')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.activities
|
return sdk.activities
|
||||||
.cancelServerActivities('fugit')
|
.cancelServerActivities('unde')
|
||||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.delete('/activities/occaecati')
|
.delete('/activities/commodi')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return expect(async () => await sdk.activities.cancelServerActivities()).rejects.toThrow();
|
return expect(async () => await sdk.activities.cancelServerActivities()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.delete('/activities/tenetur')
|
.delete('/activities/alias')
|
||||||
.reply(404, { data: {} });
|
.reply(404, { data: {} });
|
||||||
return expect(
|
return expect(
|
||||||
async () => await sdk.activities.cancelServerActivities('tenetur'),
|
async () => await sdk.activities.cancelServerActivities('alias'),
|
||||||
).rejects.toThrow();
|
).rejects.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -21,66 +21,64 @@ describe('test Butler', () => {
|
|||||||
|
|
||||||
describe('test getButlerTasks', () => {
|
describe('test getButlerTasks', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}').get('/butler').reply(200, { data: {} });
|
const scope = nock('http://10.10.10.47:32400').get('/butler').reply(200, { data: {} });
|
||||||
return sdk.butler.getButlerTasks().then((r: any) => expect(r.data).toEqual({ data: {} }));
|
return sdk.butler.getButlerTasks().then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test startAllTasks', () => {
|
describe('test startAllTasks', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}').post('/butler').reply(200, { data: {} });
|
const scope = nock('http://10.10.10.47:32400').post('/butler').reply(200, { data: {} });
|
||||||
return sdk.butler.startAllTasks().then((r: any) => expect(r.data).toEqual({ data: {} }));
|
return sdk.butler.startAllTasks().then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test stopAllTasks', () => {
|
describe('test stopAllTasks', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}').delete('/butler').reply(200, { data: {} });
|
const scope = nock('http://10.10.10.47:32400').delete('/butler').reply(200, { data: {} });
|
||||||
return sdk.butler.stopAllTasks().then((r: any) => expect(r.data).toEqual({ data: {} }));
|
return sdk.butler.stopAllTasks().then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test startTask', () => {
|
describe('test startTask', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}').post('/butler/error').reply(200, { data: {} });
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
return sdk.butler.startTask('error').then((r: any) => expect(r.data).toEqual({ data: {} }));
|
.post('/butler/fugiat')
|
||||||
|
.reply(200, { data: {} });
|
||||||
|
return sdk.butler.startTask('fugiat').then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400').post('/butler/sunt').reply(200, { data: {} });
|
||||||
.post('/butler/magnam')
|
|
||||||
.reply(200, { data: {} });
|
|
||||||
return expect(async () => await sdk.butler.startTask()).rejects.toThrow();
|
return expect(async () => await sdk.butler.startTask()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.post('/butler/cumque')
|
.post('/butler/consequatur')
|
||||||
.reply(404, { data: {} });
|
.reply(404, { data: {} });
|
||||||
return expect(async () => await sdk.butler.startTask('cumque')).rejects.toThrow();
|
return expect(async () => await sdk.butler.startTask('consequatur')).rejects.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test stopTask', () => {
|
describe('test stopTask', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.delete('/butler/delectus')
|
.delete('/butler/ducimus')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.butler.stopTask('delectus').then((r: any) => expect(r.data).toEqual({ data: {} }));
|
return sdk.butler.stopTask('ducimus').then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.delete('/butler/repudiandae')
|
.delete('/butler/veniam')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return expect(async () => await sdk.butler.stopTask()).rejects.toThrow();
|
return expect(async () => await sdk.butler.stopTask()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400').delete('/butler/in').reply(404, { data: {} });
|
||||||
.delete('/butler/iusto')
|
return expect(async () => await sdk.butler.stopTask('in')).rejects.toThrow();
|
||||||
.reply(404, { data: {} });
|
|
||||||
return expect(async () => await sdk.butler.stopTask('iusto')).rejects.toThrow();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -21,38 +21,38 @@ describe('test Hubs', () => {
|
|||||||
|
|
||||||
describe('test getGlobalHubs', () => {
|
describe('test getGlobalHubs', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/hubs?count=1&onlyTransient=1')
|
.get('/hubs?count=3&onlyTransient=9')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.hubs
|
return sdk.hubs
|
||||||
.getGlobalHubs({ count: 1, onlyTransient: 1 })
|
.getGlobalHubs({ count: 3, onlyTransient: 9 })
|
||||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test getLibraryHubs', () => {
|
describe('test getLibraryHubs', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/hubs/sections/1?count=4&onlyTransient=5')
|
.get('/hubs/sections/6?count=1&onlyTransient=7')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.hubs
|
return sdk.hubs
|
||||||
.getLibraryHubs(1, { count: 4, onlyTransient: 5 })
|
.getLibraryHubs(6, { count: 1, onlyTransient: 7 })
|
||||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/hubs/sections/2?count=6&onlyTransient=4')
|
.get('/hubs/sections/3?count=2&onlyTransient=4')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return expect(async () => await sdk.hubs.getLibraryHubs()).rejects.toThrow();
|
return expect(async () => await sdk.hubs.getLibraryHubs()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/hubs/sections/5?count=8&onlyTransient=9')
|
.get('/hubs/sections/4?count=3&onlyTransient=9')
|
||||||
.reply(404, { data: {} });
|
.reply(404, { data: {} });
|
||||||
return expect(
|
return expect(
|
||||||
async () => await sdk.hubs.getLibraryHubs(5, { count: 8, onlyTransient: 9 }),
|
async () => await sdk.hubs.getLibraryHubs(4, { count: 3, onlyTransient: 9 }),
|
||||||
).rejects.toThrow();
|
).rejects.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -21,34 +21,34 @@ describe('test Library', () => {
|
|||||||
|
|
||||||
describe('test getFileHash', () => {
|
describe('test getFileHash', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/library/hashes?url=voluptatem&type_=2')
|
.get('/library/hashes?url=error&type_=1')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.library
|
return sdk.library
|
||||||
.getFileHash('voluptatem', { type: 2 })
|
.getFileHash('error', { type: 1 })
|
||||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/library/hashes?url=velit&type_=8')
|
.get('/library/hashes?url=soluta&type_=8')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return expect(async () => await sdk.library.getFileHash()).rejects.toThrow();
|
return expect(async () => await sdk.library.getFileHash()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/library/hashes?url=quis&type_=9')
|
.get('/library/hashes?url=veritatis&type_=9')
|
||||||
.reply(404, { data: {} });
|
.reply(404, { data: {} });
|
||||||
return expect(
|
return expect(
|
||||||
async () => await sdk.library.getFileHash('quis', { type: 9 }),
|
async () => await sdk.library.getFileHash('veritatis', { type: 9 }),
|
||||||
).rejects.toThrow();
|
).rejects.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test getRecentlyAdded', () => {
|
describe('test getRecentlyAdded', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/library/recentlyAdded')
|
.get('/library/recentlyAdded')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.library.getRecentlyAdded().then((r: any) => expect(r.data).toEqual({ data: {} }));
|
return sdk.library.getRecentlyAdded().then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
@@ -57,7 +57,7 @@ describe('test Library', () => {
|
|||||||
|
|
||||||
describe('test getLibraries', () => {
|
describe('test getLibraries', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/library/sections')
|
.get('/library/sections')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.library.getLibraries().then((r: any) => expect(r.data).toEqual({ data: {} }));
|
return sdk.library.getLibraries().then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
@@ -66,175 +66,175 @@ describe('test Library', () => {
|
|||||||
|
|
||||||
describe('test getLibrary', () => {
|
describe('test getLibrary', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/library/sections/4?includeDetails=7')
|
.get('/library/sections/6?includeDetails=7')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.library
|
return sdk.library
|
||||||
.getLibrary(4, { includeDetails: 7 })
|
.getLibrary(6, { includeDetails: 7 })
|
||||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/library/sections/5?includeDetails=6')
|
.get('/library/sections/2?includeDetails=4')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return expect(async () => await sdk.library.getLibrary()).rejects.toThrow();
|
return expect(async () => await sdk.library.getLibrary()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/library/sections/6?includeDetails=1')
|
.get('/library/sections/1?includeDetails=4')
|
||||||
.reply(404, { data: {} });
|
.reply(404, { data: {} });
|
||||||
return expect(
|
return expect(
|
||||||
async () => await sdk.library.getLibrary(6, { includeDetails: 1 }),
|
async () => await sdk.library.getLibrary(1, { includeDetails: 4 }),
|
||||||
).rejects.toThrow();
|
).rejects.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test deleteLibrary', () => {
|
describe('test deleteLibrary', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.delete('/library/sections/2')
|
.delete('/library/sections/9')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.library.deleteLibrary(2).then((r: any) => expect(r.data).toEqual({ data: {} }));
|
return sdk.library.deleteLibrary(9).then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.delete('/library/sections/8')
|
.delete('/library/sections/2')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return expect(async () => await sdk.library.deleteLibrary()).rejects.toThrow();
|
return expect(async () => await sdk.library.deleteLibrary()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.delete('/library/sections/3')
|
.delete('/library/sections/2')
|
||||||
.reply(404, { data: {} });
|
.reply(404, { data: {} });
|
||||||
return expect(async () => await sdk.library.deleteLibrary(3)).rejects.toThrow();
|
return expect(async () => await sdk.library.deleteLibrary(2)).rejects.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test getLibraryItems', () => {
|
describe('test getLibraryItems', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/library/sections/4/all?type_=9&filter=totam')
|
.get('/library/sections/4/all?type_=9&filter=porro')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.library
|
return sdk.library
|
||||||
.getLibraryItems(4, { type: 9, filter: 'totam' })
|
.getLibraryItems(4, { type: 9, filter: 'porro' })
|
||||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/library/sections/9/all?type_=5&filter=esse')
|
.get('/library/sections/1/all?type_=8&filter=pariatur')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return expect(async () => await sdk.library.getLibraryItems()).rejects.toThrow();
|
return expect(async () => await sdk.library.getLibraryItems()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/library/sections/3/all?type_=4&filter=porro')
|
.get('/library/sections/3/all?type_=1&filter=nostrum')
|
||||||
.reply(404, { data: {} });
|
.reply(404, { data: {} });
|
||||||
return expect(
|
return expect(
|
||||||
async () => await sdk.library.getLibraryItems(3, { type: 4, filter: 'porro' }),
|
async () => await sdk.library.getLibraryItems(3, { type: 1, filter: 'nostrum' }),
|
||||||
).rejects.toThrow();
|
).rejects.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test refreshLibrary', () => {
|
describe('test refreshLibrary', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/library/sections/3/refresh')
|
.get('/library/sections/6/refresh')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.library.refreshLibrary(3).then((r: any) => expect(r.data).toEqual({ data: {} }));
|
return sdk.library.refreshLibrary(6).then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/library/sections/6/refresh')
|
.get('/library/sections/3/refresh')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return expect(async () => await sdk.library.refreshLibrary()).rejects.toThrow();
|
return expect(async () => await sdk.library.refreshLibrary()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/library/sections/9/refresh')
|
.get('/library/sections/3/refresh')
|
||||||
.reply(404, { data: {} });
|
.reply(404, { data: {} });
|
||||||
return expect(async () => await sdk.library.refreshLibrary(9)).rejects.toThrow();
|
return expect(async () => await sdk.library.refreshLibrary(3)).rejects.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test getLatestLibraryItems', () => {
|
describe('test getLatestLibraryItems', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/library/sections/3/latest?type_=9&filter=eligendi')
|
.get('/library/sections/2/latest?type_=7&filter=ipsa')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.library
|
return sdk.library
|
||||||
.getLatestLibraryItems(3, 9, { filter: 'eligendi' })
|
.getLatestLibraryItems(2, 7, { filter: 'ipsa' })
|
||||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/library/sections/4/latest?type_=4&filter=ea')
|
.get('/library/sections/3/latest?type_=4&filter=consectetur')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return expect(async () => await sdk.library.getLatestLibraryItems()).rejects.toThrow();
|
return expect(async () => await sdk.library.getLatestLibraryItems()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/library/sections/2/latest?type_=7&filter=possimus')
|
.get('/library/sections/3/latest?type_=9&filter=aliquam')
|
||||||
.reply(404, { data: {} });
|
.reply(404, { data: {} });
|
||||||
return expect(
|
return expect(
|
||||||
async () => await sdk.library.getLatestLibraryItems(2, 7, { filter: 'possimus' }),
|
async () => await sdk.library.getLatestLibraryItems(3, 9, { filter: 'aliquam' }),
|
||||||
).rejects.toThrow();
|
).rejects.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test getCommonLibraryItems', () => {
|
describe('test getCommonLibraryItems', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/library/sections/7/common?type_=5&filter=consequatur')
|
.get('/library/sections/2/common?type_=7&filter=doloribus')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.library
|
return sdk.library
|
||||||
.getCommonLibraryItems(7, 5, { filter: 'consequatur' })
|
.getCommonLibraryItems(2, 7, { filter: 'doloribus' })
|
||||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/library/sections/9/common?type_=2&filter=quia')
|
.get('/library/sections/9/common?type_=2&filter=illum')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return expect(async () => await sdk.library.getCommonLibraryItems()).rejects.toThrow();
|
return expect(async () => await sdk.library.getCommonLibraryItems()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/library/sections/2/common?type_=3&filter=animi')
|
.get('/library/sections/8/common?type_=7&filter=nesciunt')
|
||||||
.reply(404, { data: {} });
|
.reply(404, { data: {} });
|
||||||
return expect(
|
return expect(
|
||||||
async () => await sdk.library.getCommonLibraryItems(2, 3, { filter: 'animi' }),
|
async () => await sdk.library.getCommonLibraryItems(8, 7, { filter: 'nesciunt' }),
|
||||||
).rejects.toThrow();
|
).rejects.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test getMetadata', () => {
|
describe('test getMetadata', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/library/metadata/4')
|
.get('/library/metadata/7')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.library.getMetadata(4).then((r: any) => expect(r.data).toEqual({ data: {} }));
|
return sdk.library.getMetadata(7).then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/library/metadata/5')
|
.get('/library/metadata/8')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return expect(async () => await sdk.library.getMetadata()).rejects.toThrow();
|
return expect(async () => await sdk.library.getMetadata()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/library/metadata/9')
|
.get('/library/metadata/9')
|
||||||
.reply(404, { data: {} });
|
.reply(404, { data: {} });
|
||||||
return expect(async () => await sdk.library.getMetadata(9)).rejects.toThrow();
|
return expect(async () => await sdk.library.getMetadata(9)).rejects.toThrow();
|
||||||
@@ -243,32 +243,32 @@ describe('test Library', () => {
|
|||||||
|
|
||||||
describe('test getMetadataChildren', () => {
|
describe('test getMetadataChildren', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/library/metadata/2/children')
|
.get('/library/metadata/4/children')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.library
|
return sdk.library
|
||||||
.getMetadataChildren(2)
|
.getMetadataChildren(4)
|
||||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/library/metadata/4/children')
|
.get('/library/metadata/3/children')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return expect(async () => await sdk.library.getMetadataChildren()).rejects.toThrow();
|
return expect(async () => await sdk.library.getMetadataChildren()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/library/metadata/9/children')
|
.get('/library/metadata/4/children')
|
||||||
.reply(404, { data: {} });
|
.reply(404, { data: {} });
|
||||||
return expect(async () => await sdk.library.getMetadataChildren(9)).rejects.toThrow();
|
return expect(async () => await sdk.library.getMetadataChildren(4)).rejects.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test getOnDeck', () => {
|
describe('test getOnDeck', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/library/onDeck')
|
.get('/library/onDeck')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.library.getOnDeck().then((r: any) => expect(r.data).toEqual({ data: {} }));
|
return sdk.library.getOnDeck().then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
|
|||||||
@@ -21,39 +21,41 @@ describe('test Log', () => {
|
|||||||
|
|
||||||
describe('test logLine', () => {
|
describe('test logLine', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/log?level=6&message=necessitatibus&source=saepe')
|
.get('/log?level=2&message=laudantium&source=assumenda')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.log
|
return sdk.log
|
||||||
.logLine(6, 'necessitatibus', 'saepe')
|
.logLine(2, 'laudantium', 'assumenda')
|
||||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/log?level=8&message=provident&source=saepe')
|
.get('/log?level=9&message=ex&source=doloribus')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return expect(async () => await sdk.log.logLine()).rejects.toThrow();
|
return expect(async () => await sdk.log.logLine()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/log?level=6&message=laboriosam&source=quas')
|
.get('/log?level=6&message=repudiandae&source=perspiciatis')
|
||||||
.reply(404, { data: {} });
|
.reply(404, { data: {} });
|
||||||
return expect(async () => await sdk.log.logLine(6, 'laboriosam', 'quas')).rejects.toThrow();
|
return expect(
|
||||||
|
async () => await sdk.log.logLine(6, 'repudiandae', 'perspiciatis'),
|
||||||
|
).rejects.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test logMultiLine', () => {
|
describe('test logMultiLine', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}').post('/log').reply(200, { data: {} });
|
const scope = nock('http://10.10.10.47:32400').post('/log').reply(200, { data: {} });
|
||||||
return sdk.log.logMultiLine().then((r: any) => expect(r.data).toEqual({ data: {} }));
|
return sdk.log.logMultiLine().then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test enablePaperTrail', () => {
|
describe('test enablePaperTrail', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}').get('/log/networked').reply(200, { data: {} });
|
const scope = nock('http://10.10.10.47:32400').get('/log/networked').reply(200, { data: {} });
|
||||||
return sdk.log.enablePaperTrail().then((r: any) => expect(r.data).toEqual({ data: {} }));
|
return sdk.log.enablePaperTrail().then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -21,73 +21,73 @@ describe('test Media', () => {
|
|||||||
|
|
||||||
describe('test markPlayed', () => {
|
describe('test markPlayed', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/:/scrobble?key=3')
|
.get('/:/scrobble?key=1')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.media.markPlayed(3).then((r: any) => expect(r.data).toEqual({ data: {} }));
|
return sdk.media.markPlayed(1).then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/:/scrobble?key=2')
|
.get('/:/scrobble?key=1')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return expect(async () => await sdk.media.markPlayed()).rejects.toThrow();
|
return expect(async () => await sdk.media.markPlayed()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/:/scrobble?key=8')
|
.get('/:/scrobble?key=1')
|
||||||
.reply(404, { data: {} });
|
.reply(404, { data: {} });
|
||||||
return expect(async () => await sdk.media.markPlayed(8)).rejects.toThrow();
|
return expect(async () => await sdk.media.markPlayed(1)).rejects.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test markUnplayed', () => {
|
describe('test markUnplayed', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/:/unscrobble?key=9')
|
.get('/:/unscrobble?key=1')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.media.markUnplayed(9).then((r: any) => expect(r.data).toEqual({ data: {} }));
|
return sdk.media.markUnplayed(1).then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/:/unscrobble?key=3')
|
.get('/:/unscrobble?key=6')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return expect(async () => await sdk.media.markUnplayed()).rejects.toThrow();
|
return expect(async () => await sdk.media.markUnplayed()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/:/unscrobble?key=6')
|
.get('/:/unscrobble?key=9')
|
||||||
.reply(404, { data: {} });
|
.reply(404, { data: {} });
|
||||||
return expect(async () => await sdk.media.markUnplayed(6)).rejects.toThrow();
|
return expect(async () => await sdk.media.markUnplayed(9)).rejects.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test updatePlayProgress', () => {
|
describe('test updatePlayProgress', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.post('/:/progress?key=ad&time=1&state=tenetur')
|
.post('/:/progress?key=inventore&time=5&state=dolor')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.media
|
return sdk.media
|
||||||
.updatePlayProgress('ad', 1, 'tenetur')
|
.updatePlayProgress('inventore', 5, 'dolor')
|
||||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.post('/:/progress?key=nostrum&time=2&state=nostrum')
|
.post('/:/progress?key=officia&time=6&state=laboriosam')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return expect(async () => await sdk.media.updatePlayProgress()).rejects.toThrow();
|
return expect(async () => await sdk.media.updatePlayProgress()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.post('/:/progress?key=ab&time=3&state=impedit')
|
.post('/:/progress?key=illum&time=8&state=nostrum')
|
||||||
.reply(404, { data: {} });
|
.reply(404, { data: {} });
|
||||||
return expect(
|
return expect(
|
||||||
async () => await sdk.media.updatePlayProgress('ab', 3, 'impedit'),
|
async () => await sdk.media.updatePlayProgress('illum', 8, 'nostrum'),
|
||||||
).rejects.toThrow();
|
).rejects.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -21,30 +21,30 @@ describe('test Playlists', () => {
|
|||||||
|
|
||||||
describe('test createPlaylist', () => {
|
describe('test createPlaylist', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.post('/playlists?title=harum&type_=excepturi&smart=9&uri=nisi&playQueueID=5')
|
.post('/playlists?title=porro&type_=fugiat&smart=9&uri=nihil&playQueueID=6')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.playlists
|
return sdk.playlists
|
||||||
.createPlaylist('harum', 'excepturi', 9, { uri: 'nisi', playQueueID: 5 })
|
.createPlaylist('porro', 'fugiat', 9, { uri: 'nihil', playQueueID: 6 })
|
||||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.post('/playlists?title=eligendi&type_=tempora&smart=9&uri=eaque&playQueueID=5')
|
.post('/playlists?title=perspiciatis&type_=maxime&smart=7&uri=minima&playQueueID=7')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return expect(async () => await sdk.playlists.createPlaylist()).rejects.toThrow();
|
return expect(async () => await sdk.playlists.createPlaylist()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.post('/playlists?title=placeat&type_=vitae&smart=5&uri=voluptatum&playQueueID=2')
|
.post('/playlists?title=nam&type_=excepturi&smart=9&uri=iusto&playQueueID=5')
|
||||||
.reply(404, { data: {} });
|
.reply(404, { data: {} });
|
||||||
return expect(
|
return expect(
|
||||||
async () =>
|
async () =>
|
||||||
await sdk.playlists.createPlaylist('placeat', 'vitae', 5, {
|
await sdk.playlists.createPlaylist('nam', 'excepturi', 9, {
|
||||||
uri: 'voluptatum',
|
uri: 'iusto',
|
||||||
playQueueID: 2,
|
playQueueID: 5,
|
||||||
}),
|
}),
|
||||||
).rejects.toThrow();
|
).rejects.toThrow();
|
||||||
});
|
});
|
||||||
@@ -52,171 +52,171 @@ describe('test Playlists', () => {
|
|||||||
|
|
||||||
describe('test getPlaylists', () => {
|
describe('test getPlaylists', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/playlists/all?playlistType=repellendus&smart=8')
|
.get('/playlists/all?playlistType=eveniet&smart=9')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.playlists
|
return sdk.playlists
|
||||||
.getPlaylists({ playlistType: 'repellendus', smart: 8 })
|
.getPlaylists({ playlistType: 'eveniet', smart: 9 })
|
||||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test getPlaylist', () => {
|
describe('test getPlaylist', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}').get('/playlists/7').reply(200, { data: {} });
|
const scope = nock('http://10.10.10.47:32400').get('/playlists/4').reply(200, { data: {} });
|
||||||
return sdk.playlists.getPlaylist(7).then((r: any) => expect(r.data).toEqual({ data: {} }));
|
return sdk.playlists.getPlaylist(4).then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}').get('/playlists/8').reply(200, { data: {} });
|
const scope = nock('http://10.10.10.47:32400').get('/playlists/4').reply(200, { data: {} });
|
||||||
return expect(async () => await sdk.playlists.getPlaylist()).rejects.toThrow();
|
return expect(async () => await sdk.playlists.getPlaylist()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}').get('/playlists/1').reply(404, { data: {} });
|
const scope = nock('http://10.10.10.47:32400').get('/playlists/1').reply(404, { data: {} });
|
||||||
return expect(async () => await sdk.playlists.getPlaylist(1)).rejects.toThrow();
|
return expect(async () => await sdk.playlists.getPlaylist(1)).rejects.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test updatePlaylist', () => {
|
describe('test updatePlaylist', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}').put('/playlists/7').reply(200, { data: {} });
|
const scope = nock('http://10.10.10.47:32400').put('/playlists/3').reply(200, { data: {} });
|
||||||
return sdk.playlists.updatePlaylist(7).then((r: any) => expect(r.data).toEqual({ data: {} }));
|
return sdk.playlists.updatePlaylist(3).then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}').put('/playlists/7').reply(200, { data: {} });
|
const scope = nock('http://10.10.10.47:32400').put('/playlists/6').reply(200, { data: {} });
|
||||||
return expect(async () => await sdk.playlists.updatePlaylist()).rejects.toThrow();
|
return expect(async () => await sdk.playlists.updatePlaylist()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}').put('/playlists/3').reply(404, { data: {} });
|
const scope = nock('http://10.10.10.47:32400').put('/playlists/4').reply(404, { data: {} });
|
||||||
return expect(async () => await sdk.playlists.updatePlaylist(3)).rejects.toThrow();
|
return expect(async () => await sdk.playlists.updatePlaylist(4)).rejects.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test deletePlaylist', () => {
|
describe('test deletePlaylist', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.delete('/playlists/7')
|
.delete('/playlists/8')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.playlists.deletePlaylist(7).then((r: any) => expect(r.data).toEqual({ data: {} }));
|
return sdk.playlists.deletePlaylist(8).then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.delete('/playlists/4')
|
.delete('/playlists/9')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return expect(async () => await sdk.playlists.deletePlaylist()).rejects.toThrow();
|
return expect(async () => await sdk.playlists.deletePlaylist()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.delete('/playlists/5')
|
.delete('/playlists/1')
|
||||||
.reply(404, { data: {} });
|
.reply(404, { data: {} });
|
||||||
return expect(async () => await sdk.playlists.deletePlaylist(5)).rejects.toThrow();
|
return expect(async () => await sdk.playlists.deletePlaylist(1)).rejects.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test getPlaylistContents', () => {
|
describe('test getPlaylistContents', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/playlists/1/items?type_=7')
|
.get('/playlists/5/items?type_=1')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.playlists
|
return sdk.playlists
|
||||||
.getPlaylistContents(1, 7)
|
.getPlaylistContents(5, 1)
|
||||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/playlists/2/items?type_=5')
|
.get('/playlists/2/items?type_=7')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return expect(async () => await sdk.playlists.getPlaylistContents()).rejects.toThrow();
|
return expect(async () => await sdk.playlists.getPlaylistContents()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/playlists/6/items?type_=4')
|
.get('/playlists/9/items?type_=2')
|
||||||
.reply(404, { data: {} });
|
.reply(404, { data: {} });
|
||||||
return expect(async () => await sdk.playlists.getPlaylistContents(6, 4)).rejects.toThrow();
|
return expect(async () => await sdk.playlists.getPlaylistContents(9, 2)).rejects.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test addPlaylistContents', () => {
|
describe('test addPlaylistContents', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.put('/playlists/6/items?uri=deleniti&playQueueID=5')
|
.put('/playlists/4/items?uri=veniam&playQueueID=1')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.playlists
|
return sdk.playlists
|
||||||
.addPlaylistContents(6, 'deleniti', 5)
|
.addPlaylistContents(4, 'veniam', 1)
|
||||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.put('/playlists/3/items?uri=asperiores&playQueueID=1')
|
.put('/playlists/1/items?uri=similique&playQueueID=9')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return expect(async () => await sdk.playlists.addPlaylistContents()).rejects.toThrow();
|
return expect(async () => await sdk.playlists.addPlaylistContents()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.put('/playlists/4/items?uri=itaque&playQueueID=6')
|
.put('/playlists/5/items?uri=similique&playQueueID=8')
|
||||||
.reply(404, { data: {} });
|
.reply(404, { data: {} });
|
||||||
return expect(
|
return expect(
|
||||||
async () => await sdk.playlists.addPlaylistContents(4, 'itaque', 6),
|
async () => await sdk.playlists.addPlaylistContents(5, 'similique', 8),
|
||||||
).rejects.toThrow();
|
).rejects.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test clearPlaylistContents', () => {
|
describe('test clearPlaylistContents', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.delete('/playlists/4/items')
|
.delete('/playlists/1/items')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.playlists
|
return sdk.playlists
|
||||||
.clearPlaylistContents(4)
|
.clearPlaylistContents(1)
|
||||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.delete('/playlists/7/items')
|
.delete('/playlists/9/items')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return expect(async () => await sdk.playlists.clearPlaylistContents()).rejects.toThrow();
|
return expect(async () => await sdk.playlists.clearPlaylistContents()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.delete('/playlists/1/items')
|
.delete('/playlists/5/items')
|
||||||
.reply(404, { data: {} });
|
.reply(404, { data: {} });
|
||||||
return expect(async () => await sdk.playlists.clearPlaylistContents(1)).rejects.toThrow();
|
return expect(async () => await sdk.playlists.clearPlaylistContents(5)).rejects.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test uploadPlaylist', () => {
|
describe('test uploadPlaylist', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.post('/playlists/upload?path=nesciunt&force=5')
|
.post('/playlists/upload?path=a&force=5')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.playlists
|
return sdk.playlists
|
||||||
.uploadPlaylist('nesciunt', 5)
|
.uploadPlaylist('a', 5)
|
||||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.post('/playlists/upload?path=ex&force=5')
|
.post('/playlists/upload?path=facere&force=6')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return expect(async () => await sdk.playlists.uploadPlaylist()).rejects.toThrow();
|
return expect(async () => await sdk.playlists.uploadPlaylist()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.post('/playlists/upload?path=eaque&force=8')
|
.post('/playlists/upload?path=animi&force=5')
|
||||||
.reply(404, { data: {} });
|
.reply(404, { data: {} });
|
||||||
return expect(async () => await sdk.playlists.uploadPlaylist('eaque', 8)).rejects.toThrow();
|
return expect(async () => await sdk.playlists.uploadPlaylist('animi', 5)).rejects.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -21,80 +21,80 @@ describe('test Search', () => {
|
|||||||
|
|
||||||
describe('test performSearch', () => {
|
describe('test performSearch', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/hubs/search?query=adipisci§ionId=9&limit=8')
|
.get('/hubs/search?query=fugiat§ionId=1&limit=3')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.search
|
return sdk.search
|
||||||
.performSearch('adipisci', { sectionId: 9, limit: 8 })
|
.performSearch('fugiat', { sectionId: 1, limit: 3 })
|
||||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/hubs/search?query=quas§ionId=9&limit=1')
|
.get('/hubs/search?query=ipsam§ionId=7&limit=2')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return expect(async () => await sdk.search.performSearch()).rejects.toThrow();
|
return expect(async () => await sdk.search.performSearch()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/hubs/search?query=dolores§ionId=1&limit=2')
|
.get('/hubs/search?query=quibusdam§ionId=1&limit=6')
|
||||||
.reply(404, { data: {} });
|
.reply(404, { data: {} });
|
||||||
return expect(
|
return expect(
|
||||||
async () => await sdk.search.performSearch('dolores', { sectionId: 1, limit: 2 }),
|
async () => await sdk.search.performSearch('quibusdam', { sectionId: 1, limit: 6 }),
|
||||||
).rejects.toThrow();
|
).rejects.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test performVoiceSearch', () => {
|
describe('test performVoiceSearch', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/hubs/search/voice?query=vitae§ionId=5&limit=6')
|
.get('/hubs/search/voice?query=animi§ionId=7&limit=1')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.search
|
return sdk.search
|
||||||
.performVoiceSearch('vitae', { sectionId: 5, limit: 6 })
|
.performVoiceSearch('animi', { sectionId: 7, limit: 1 })
|
||||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/hubs/search/voice?query=ab§ionId=2&limit=2')
|
.get('/hubs/search/voice?query=quae§ionId=6&limit=3')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return expect(async () => await sdk.search.performVoiceSearch()).rejects.toThrow();
|
return expect(async () => await sdk.search.performVoiceSearch()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/hubs/search/voice?query=id§ionId=5&limit=4')
|
.get('/hubs/search/voice?query=aspernatur§ionId=5&limit=8')
|
||||||
.reply(404, { data: {} });
|
.reply(404, { data: {} });
|
||||||
return expect(
|
return expect(
|
||||||
async () => await sdk.search.performVoiceSearch('id', { sectionId: 5, limit: 4 }),
|
async () => await sdk.search.performVoiceSearch('aspernatur', { sectionId: 5, limit: 8 }),
|
||||||
).rejects.toThrow();
|
).rejects.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test getSearchResults', () => {
|
describe('test getSearchResults', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/search?query=aspernatur')
|
.get('/search?query=doloremque')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.search
|
return sdk.search
|
||||||
.getSearchResults('aspernatur')
|
.getSearchResults('doloremque')
|
||||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/search?query=quasi')
|
.get('/search?query=facere')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return expect(async () => await sdk.search.getSearchResults()).rejects.toThrow();
|
return expect(async () => await sdk.search.getSearchResults()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/search?query=ex')
|
.get('/search?query=placeat')
|
||||||
.reply(404, { data: {} });
|
.reply(404, { data: {} });
|
||||||
return expect(async () => await sdk.search.getSearchResults('ex')).rejects.toThrow();
|
return expect(async () => await sdk.search.getSearchResults('placeat')).rejects.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -21,44 +21,44 @@ describe('test Security', () => {
|
|||||||
|
|
||||||
describe('test getTransientToken', () => {
|
describe('test getTransientToken', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/security/token?type_=rem&scope=porro')
|
.get('/security/token?type_=odit&scope=inventore')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.security
|
return sdk.security
|
||||||
.getTransientToken('rem', 'porro')
|
.getTransientToken('odit', 'inventore')
|
||||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/security/token?type_=rem&scope=magni')
|
.get('/security/token?type_=consequatur&scope=consectetur')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return expect(async () => await sdk.security.getTransientToken()).rejects.toThrow();
|
return expect(async () => await sdk.security.getTransientToken()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/security/token?type_=quo&scope=aut')
|
.get('/security/token?type_=consequatur&scope=delectus')
|
||||||
.reply(404, { data: {} });
|
.reply(404, { data: {} });
|
||||||
return expect(
|
return expect(
|
||||||
async () => await sdk.security.getTransientToken('quo', 'aut'),
|
async () => await sdk.security.getTransientToken('consequatur', 'delectus'),
|
||||||
).rejects.toThrow();
|
).rejects.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test getSourceConnectionInformation', () => {
|
describe('test getSourceConnectionInformation', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/security/resources?source=suscipit')
|
.get('/security/resources?source=ab')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.security
|
return sdk.security
|
||||||
.getSourceConnectionInformation('suscipit')
|
.getSourceConnectionInformation('ab')
|
||||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/security/resources?source=consectetur')
|
.get('/security/resources?source=pariatur')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return expect(
|
return expect(
|
||||||
async () => await sdk.security.getSourceConnectionInformation(),
|
async () => await sdk.security.getSourceConnectionInformation(),
|
||||||
@@ -66,11 +66,11 @@ describe('test Security', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/security/resources?source=consequatur')
|
.get('/security/resources?source=consectetur')
|
||||||
.reply(404, { data: {} });
|
.reply(404, { data: {} });
|
||||||
return expect(
|
return expect(
|
||||||
async () => await sdk.security.getSourceConnectionInformation('consequatur'),
|
async () => await sdk.security.getSourceConnectionInformation('consectetur'),
|
||||||
).rejects.toThrow();
|
).rejects.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ describe('test Server', () => {
|
|||||||
|
|
||||||
describe('test getServerCapabilities', () => {
|
describe('test getServerCapabilities', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}').get('/').reply(200, { data: {} });
|
const scope = nock('http://10.10.10.47:32400').get('/').reply(200, { data: {} });
|
||||||
return sdk.server
|
return sdk.server
|
||||||
.getServerCapabilities()
|
.getServerCapabilities()
|
||||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
@@ -30,7 +30,7 @@ describe('test Server', () => {
|
|||||||
|
|
||||||
describe('test getServerPreferences', () => {
|
describe('test getServerPreferences', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}').get('/:/prefs').reply(200, { data: {} });
|
const scope = nock('http://10.10.10.47:32400').get('/:/prefs').reply(200, { data: {} });
|
||||||
return sdk.server
|
return sdk.server
|
||||||
.getServerPreferences()
|
.getServerPreferences()
|
||||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
@@ -39,7 +39,7 @@ describe('test Server', () => {
|
|||||||
|
|
||||||
describe('test getAvailableClients', () => {
|
describe('test getAvailableClients', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}').get('/clients').reply(200, { data: {} });
|
const scope = nock('http://10.10.10.47:32400').get('/clients').reply(200, { data: {} });
|
||||||
return sdk.server
|
return sdk.server
|
||||||
.getAvailableClients()
|
.getAvailableClients()
|
||||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
@@ -48,21 +48,21 @@ describe('test Server', () => {
|
|||||||
|
|
||||||
describe('test getDevices', () => {
|
describe('test getDevices', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}').get('/devices').reply(200, { data: {} });
|
const scope = nock('http://10.10.10.47:32400').get('/devices').reply(200, { data: {} });
|
||||||
return sdk.server.getDevices().then((r: any) => expect(r.data).toEqual({ data: {} }));
|
return sdk.server.getDevices().then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test getServerIdentity', () => {
|
describe('test getServerIdentity', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}').get('/identity').reply(200, { data: {} });
|
const scope = nock('http://10.10.10.47:32400').get('/identity').reply(200, { data: {} });
|
||||||
return sdk.server.getServerIdentity().then((r: any) => expect(r.data).toEqual({ data: {} }));
|
return sdk.server.getServerIdentity().then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test getMyPlexAccount', () => {
|
describe('test getMyPlexAccount', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/myplex/account')
|
.get('/myplex/account')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.server.getMyPlexAccount().then((r: any) => expect(r.data).toEqual({ data: {} }));
|
return sdk.server.getMyPlexAccount().then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
@@ -71,40 +71,40 @@ describe('test Server', () => {
|
|||||||
|
|
||||||
describe('test getResizedPhoto', () => {
|
describe('test getResizedPhoto', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get(
|
.get(
|
||||||
'/photo/:/transcode?width=1002254168&height=9&opacity=8&blur=9&minSize=6&upscale=2&url=quibusdam',
|
'/photo/:/transcode?width=4529130729&height=5&opacity=1&blur=5&minSize=5&upscale=4&url=corrupti',
|
||||||
)
|
)
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.server
|
return sdk.server
|
||||||
.getResizedPhoto(1002254168, 9, 8, 9, 6, 2, 'quibusdam')
|
.getResizedPhoto(4529130729, 5, 1, 5, 5, 4, 'corrupti')
|
||||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get(
|
.get(
|
||||||
'/photo/:/transcode?width=9612381291&height=3&opacity=2&blur=4&minSize=1&upscale=8&url=modi',
|
'/photo/:/transcode?width=7748286048&height=7&opacity=2&blur=8&minSize=6&upscale=6&url=accusantium',
|
||||||
)
|
)
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return expect(async () => await sdk.server.getResizedPhoto()).rejects.toThrow();
|
return expect(async () => await sdk.server.getResizedPhoto()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get(
|
.get(
|
||||||
'/photo/:/transcode?width=2629629187&height=7&opacity=6&blur=9&minSize=9&upscale=7&url=sunt',
|
'/photo/:/transcode?width=8905574180&height=3&opacity=3&blur=7&minSize=5&upscale=8&url=optio',
|
||||||
)
|
)
|
||||||
.reply(404, { data: {} });
|
.reply(404, { data: {} });
|
||||||
return expect(
|
return expect(
|
||||||
async () => await sdk.server.getResizedPhoto(2629629187, 7, 6, 9, 9, 7, 'sunt'),
|
async () => await sdk.server.getResizedPhoto(8905574180, 3, 3, 7, 5, 8, 'optio'),
|
||||||
).rejects.toThrow();
|
).rejects.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('test getServerList', () => {
|
describe('test getServerList', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}').get('/servers').reply(200, { data: {} });
|
const scope = nock('http://10.10.10.47:32400').get('/servers').reply(200, { data: {} });
|
||||||
return sdk.server.getServerList().then((r: any) => expect(r.data).toEqual({ data: {} }));
|
return sdk.server.getServerList().then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ describe('test Sessions', () => {
|
|||||||
|
|
||||||
describe('test getSessions', () => {
|
describe('test getSessions', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/status/sessions')
|
.get('/status/sessions')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.sessions.getSessions().then((r: any) => expect(r.data).toEqual({ data: {} }));
|
return sdk.sessions.getSessions().then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
@@ -30,7 +30,7 @@ describe('test Sessions', () => {
|
|||||||
|
|
||||||
describe('test getSessionHistory', () => {
|
describe('test getSessionHistory', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/status/sessions/history/all')
|
.get('/status/sessions/history/all')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.sessions
|
return sdk.sessions
|
||||||
@@ -41,7 +41,7 @@ describe('test Sessions', () => {
|
|||||||
|
|
||||||
describe('test getTranscodeSessions', () => {
|
describe('test getTranscodeSessions', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/transcode/sessions')
|
.get('/transcode/sessions')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.sessions
|
return sdk.sessions
|
||||||
@@ -52,26 +52,28 @@ describe('test Sessions', () => {
|
|||||||
|
|
||||||
describe('test stopTranscodeSession', () => {
|
describe('test stopTranscodeSession', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.delete('/transcode/sessions/sint')
|
.delete('/transcode/sessions/odit')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.sessions
|
return sdk.sessions
|
||||||
.stopTranscodeSession('sint')
|
.stopTranscodeSession('odit')
|
||||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.delete('/transcode/sessions/aliquid')
|
.delete('/transcode/sessions/porro')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return expect(async () => await sdk.sessions.stopTranscodeSession()).rejects.toThrow();
|
return expect(async () => await sdk.sessions.stopTranscodeSession()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.delete('/transcode/sessions/ex')
|
.delete('/transcode/sessions/minima')
|
||||||
.reply(404, { data: {} });
|
.reply(404, { data: {} });
|
||||||
return expect(async () => await sdk.sessions.stopTranscodeSession('ex')).rejects.toThrow();
|
return expect(
|
||||||
|
async () => await sdk.sessions.stopTranscodeSession('minima'),
|
||||||
|
).rejects.toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ describe('test Updater', () => {
|
|||||||
|
|
||||||
describe('test getUpdateStatus', () => {
|
describe('test getUpdateStatus', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get('/updater/status')
|
.get('/updater/status')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.updater.getUpdateStatus().then((r: any) => expect(r.data).toEqual({ data: {} }));
|
return sdk.updater.getUpdateStatus().then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
@@ -30,7 +30,7 @@ describe('test Updater', () => {
|
|||||||
|
|
||||||
describe('test checkForUpdates', () => {
|
describe('test checkForUpdates', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.put('/updater/check?download=foo')
|
.put('/updater/check?download=foo')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.updater
|
return sdk.updater
|
||||||
@@ -41,7 +41,7 @@ describe('test Updater', () => {
|
|||||||
|
|
||||||
describe('test applyUpdates', () => {
|
describe('test applyUpdates', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.put('/updater/apply?tonight=foo&skip=foo')
|
.put('/updater/apply?tonight=foo&skip=foo')
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.updater
|
return sdk.updater
|
||||||
|
|||||||
@@ -21,57 +21,57 @@ describe('test Video', () => {
|
|||||||
|
|
||||||
describe('test startUniversalTranscode', () => {
|
describe('test startUniversalTranscode', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get(
|
.get(
|
||||||
'/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',
|
'/video/:/transcode/universal/start.mpd?hasMDE=2&path=officiis&mediaIndex=8&partIndex=2&protocol=minima&fastSeek=6&directPlay=9&directStream=3&subtitleSize=8&subtites=aut&audioBoost=5&location=porro&mediaBufferSize=4&session=deserunt&addDebugOverlay=4&autoAdjustQuality=2',
|
||||||
)
|
)
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.video
|
return sdk.video
|
||||||
.startUniversalTranscode(8, 'harum', 9, 3, 'id', {
|
.startUniversalTranscode(2, 'officiis', 8, 2, 'minima', {
|
||||||
fastSeek: 4,
|
fastSeek: 6,
|
||||||
directPlay: 4,
|
directPlay: 9,
|
||||||
directStream: 8,
|
directStream: 3,
|
||||||
subtitleSize: 9,
|
subtitleSize: 8,
|
||||||
subtites: 'laudantium',
|
subtites: 'aut',
|
||||||
audioBoost: 5,
|
audioBoost: 5,
|
||||||
location: 'harum',
|
location: 'porro',
|
||||||
mediaBufferSize: 7,
|
mediaBufferSize: 4,
|
||||||
session: 'possimus',
|
session: 'deserunt',
|
||||||
addDebugOverlay: 8,
|
addDebugOverlay: 4,
|
||||||
autoAdjustQuality: 2,
|
autoAdjustQuality: 2,
|
||||||
})
|
})
|
||||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get(
|
.get(
|
||||||
'/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',
|
'/video/:/transcode/universal/start.mpd?hasMDE=9&path=tempora&mediaIndex=6&partIndex=1&protocol=laudantium&fastSeek=4&directPlay=5&directStream=2&subtitleSize=6&subtites=eveniet&audioBoost=7&location=iure&mediaBufferSize=8&session=modi&addDebugOverlay=9&autoAdjustQuality=5',
|
||||||
)
|
)
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return expect(async () => await sdk.video.startUniversalTranscode()).rejects.toThrow();
|
return expect(async () => await sdk.video.startUniversalTranscode()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get(
|
.get(
|
||||||
'/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',
|
'/video/:/transcode/universal/start.mpd?hasMDE=8&path=officia&mediaIndex=6&partIndex=7&protocol=hic&fastSeek=6&directPlay=2&directStream=6&subtitleSize=6&subtites=veniam&audioBoost=5&location=sunt&mediaBufferSize=5&session=inventore&addDebugOverlay=9&autoAdjustQuality=5',
|
||||||
)
|
)
|
||||||
.reply(404, { data: {} });
|
.reply(404, { data: {} });
|
||||||
return expect(
|
return expect(
|
||||||
async () =>
|
async () =>
|
||||||
await sdk.video.startUniversalTranscode(4, 'sed', 6, 3, 'tempora', {
|
await sdk.video.startUniversalTranscode(8, 'officia', 6, 7, 'hic', {
|
||||||
fastSeek: 5,
|
fastSeek: 6,
|
||||||
directPlay: 8,
|
directPlay: 2,
|
||||||
directStream: 6,
|
directStream: 6,
|
||||||
subtitleSize: 2,
|
subtitleSize: 6,
|
||||||
subtites: 'delectus',
|
subtites: 'veniam',
|
||||||
audioBoost: 7,
|
audioBoost: 5,
|
||||||
location: 'porro',
|
location: 'sunt',
|
||||||
mediaBufferSize: 2,
|
mediaBufferSize: 5,
|
||||||
session: 'rem',
|
session: 'inventore',
|
||||||
addDebugOverlay: 9,
|
addDebugOverlay: 9,
|
||||||
autoAdjustQuality: 7,
|
autoAdjustQuality: 5,
|
||||||
}),
|
}),
|
||||||
).rejects.toThrow();
|
).rejects.toThrow();
|
||||||
});
|
});
|
||||||
@@ -79,55 +79,55 @@ describe('test Video', () => {
|
|||||||
|
|
||||||
describe('test getTimeline', () => {
|
describe('test getTimeline', () => {
|
||||||
test('test api call', () => {
|
test('test api call', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get(
|
.get(
|
||||||
'/:/timeline?ratingKey=1&key=placeat&state=tempore&hasMDE=7&time=2&duration=8&context=ducimusdoloresnostrumeosimpedit&playQueueItemID=5&playBackTime=1&row=5',
|
'/:/timeline?ratingKey=3&key=dolor&state=consequatur&hasMDE=8&time=4&duration=7&context=possimusducimusdoloribusnequequibusdam&playQueueItemID=3&playBackTime=5&row=4',
|
||||||
)
|
)
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return sdk.video
|
return sdk.video
|
||||||
.getTimeline(
|
.getTimeline(
|
||||||
1,
|
3,
|
||||||
'placeat',
|
'dolor',
|
||||||
'tempore',
|
'consequatur',
|
||||||
7,
|
|
||||||
2,
|
|
||||||
8,
|
8,
|
||||||
'ducimus dolores nostrum eos impedit',
|
4,
|
||||||
5,
|
7,
|
||||||
1,
|
'possimus ducimus doloribus neque quibusdam',
|
||||||
|
3,
|
||||||
5,
|
5,
|
||||||
|
4,
|
||||||
)
|
)
|
||||||
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
.then((r: any) => expect(r.data).toEqual({ data: {} }));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error if required fields missing', () => {
|
test('test will throw error if required fields missing', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get(
|
.get(
|
||||||
'/:/timeline?ratingKey=1&key=quidem&state=quo&hasMDE=1&time=8&duration=2&context=aspernatureumdignissimosatqueassumenda&playQueueItemID=6&playBackTime=4&row=6',
|
'/:/timeline?ratingKey=8&key=cumque&state=earum&hasMDE=3&time=7&duration=2&context=debitisquisquamquaeeasunt&playQueueItemID=3&playBackTime=2&row=2',
|
||||||
)
|
)
|
||||||
.reply(200, { data: {} });
|
.reply(200, { data: {} });
|
||||||
return expect(async () => await sdk.video.getTimeline()).rejects.toThrow();
|
return expect(async () => await sdk.video.getTimeline()).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('test will throw error on a non-200 response', () => {
|
test('test will throw error on a non-200 response', () => {
|
||||||
const scope = nock('{protocol}://{ip}:{port}')
|
const scope = nock('http://10.10.10.47:32400')
|
||||||
.get(
|
.get(
|
||||||
'/:/timeline?ratingKey=3&key=facilis&state=ipsum&hasMDE=7&time=5&duration=6&context=earumimpeditnequeisteanimi&playQueueItemID=9&playBackTime=2&row=7',
|
'/:/timeline?ratingKey=6&key=voluptate&state=alias&hasMDE=6&time=3&duration=6&context=assumendaconsequaturaliquidnatussaepe&playQueueItemID=2&playBackTime=9&row=3',
|
||||||
)
|
)
|
||||||
.reply(404, { data: {} });
|
.reply(404, { data: {} });
|
||||||
return expect(
|
return expect(
|
||||||
async () =>
|
async () =>
|
||||||
await sdk.video.getTimeline(
|
await sdk.video.getTimeline(
|
||||||
3,
|
|
||||||
'facilis',
|
|
||||||
'ipsum',
|
|
||||||
7,
|
|
||||||
5,
|
|
||||||
6,
|
6,
|
||||||
'earum impedit neque iste animi',
|
'voluptate',
|
||||||
9,
|
'alias',
|
||||||
|
6,
|
||||||
|
3,
|
||||||
|
6,
|
||||||
|
'assumenda consequatur aliquid natus saepe',
|
||||||
2,
|
2,
|
||||||
7,
|
9,
|
||||||
|
3,
|
||||||
),
|
),
|
||||||
).rejects.toThrow();
|
).rejects.toThrow();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user