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