SDK update generated by liblab

This commit is contained in:
Luke Hagar
2023-12-08 20:09:12 -08:00
parent 88c6825688
commit 6f6f0a1145
32 changed files with 615 additions and 608 deletions

108
README.md
View File

@@ -398,7 +398,7 @@ const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
110, 110,
165, 165,
100, 100,
4000, 20,
1, 1,
1, 1,
'/library/metadata/49564/thumb/1654258204', '/library/metadata/49564/thumb/1654258204',
@@ -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', 90469787.90055934, 'state'); const result = await sdk.media.updatePlayProgress('key', 27551608.23429507, '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('GenerateChapterThumbs'); const result = await sdk.butler.startTask('CleanOldBundles');
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: 56455806.18512213, onlyTransient: 1 }); const result = await sdk.hubs.getGlobalHubs({ count: 85088414.29395235, 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(14224427.485252097, { const result = await sdk.hubs.getLibraryHubs(1529501.7966160178, {
count: 59167335.01182026, count: -55107649.72469167,
onlyTransient: 1, onlyTransient: 1,
}); });
console.log(result.data); console.log(result.data);
@@ -817,7 +817,7 @@ const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
(async () => { (async () => {
const result = await sdk.search.performSearch('arnold', { const result = await sdk.search.performSearch('arnold', {
sectionId: 23503236.39517291, sectionId: -91245133.11936787,
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: 49725001.21318659, sectionId: -77985966.3231569,
limit: 5, limit: 5,
}); });
console.log(result.data); console.log(result.data);
@@ -914,7 +914,7 @@ Optional parameters are passed as part of the last parameter to the method. Ex.
| Name | Type| Description | | Name | Type| Description |
| :-------- | :----------| :----------| | :-------- | :----------| :----------|
| type | number | Item type | | type_ | number | Item type |
**Return Type** **Return Type**
@@ -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: 57131492.35348597, type: -83086119.43343997,
}); });
console.log(result.data); console.log(result.data);
})(); })();
@@ -1066,7 +1066,7 @@ Optional parameters are passed as part of the last parameter to the method. Ex.
| Name | Type| Description | | Name | Type| Description |
| :-------- | :----------| :----------| | :-------- | :----------| :----------|
| type | number | item type | | type_ | number | item type |
| filter | string | the filter parameter | | filter | string | the filter parameter |
@@ -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(5918142.371238574, { const result = await sdk.library.getLibraryItems(42026951.633123755, {
type: -7809061.492073655, type: 35182739.55189258,
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(96299696.9761284); const result = await sdk.library.refreshLibrary(40666143.29885453);
console.log(result.data); console.log(result.data);
})(); })();
@@ -1130,7 +1130,7 @@ Get Latest Library Items
| Name | Type| Description | | Name | Type| Description |
| :-------- | :----------| :----------| | :-------- | :----------| :----------|
| sectionId | number | the Id of the library to query | | sectionId | number | the Id of the library to query |
| type | number | item type | | type_ | number | item type |
**Optional Parameters** **Optional Parameters**
@@ -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(92402469.6477915, -96400116.97826156, { const result = await sdk.library.getLatestLibraryItems(68855255.94976288, -62521069.88462107, {
filter: 'filter', filter: 'filter',
}); });
console.log(result.data); console.log(result.data);
@@ -1170,7 +1170,7 @@ Get Common Library Items
| Name | Type| Description | | Name | Type| Description |
| :-------- | :----------| :----------| | :-------- | :----------| :----------|
| sectionId | number | the Id of the library to query | | sectionId | number | the Id of the library to query |
| type | number | item type | | type_ | number | item type |
**Optional Parameters** **Optional Parameters**
@@ -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(10111915.895296082, 55224735.92815569, { const result = await sdk.library.getCommonLibraryItems(-8101546.533601046, -75357740.57515395, {
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(62182009.76385683); const result = await sdk.library.getMetadata(-88656892.93622507);
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(11669243.106740937); const result = await sdk.library.getMetadataChildren(-99012349.51775439);
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(2, 'message', 'source'); const result = await sdk.log.logLine(3, 'message', 'source');
console.log(result.data); console.log(result.data);
})(); })();
@@ -1373,7 +1373,7 @@ Create a Playlist
| Name | Type| Description | | Name | Type| Description |
| :-------- | :----------| :----------| | :-------- | :----------| :----------|
| title | string | name of the playlist | | title | string | name of the playlist |
| type | [Type](/src/models/README.md#type) | type of playlist to create | | type_ | [Type](/src/models/README.md#type) | type of playlist to create |
| smart | [Smart](/src/models/README.md#smart) | whether the playlist is smart or not | | smart | [Smart](/src/models/README.md#smart) | whether the playlist is smart or not |
**Optional Parameters** **Optional Parameters**
@@ -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', 'audio', 42, { const result = await sdk.playlists.createPlaylist('title', 'audio', 1, {
uri: 'uri', uri: 'uri',
playQueueID: -22282333.505305633, playQueueID: 87381919.3788966,
}); });
console.log(result.data); console.log(result.data);
})(); })();
@@ -1433,7 +1433,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.getPlaylists({ playlistType: 'photo', smart: 1 }); const result = await sdk.playlists.getPlaylists({ playlistType: 'video', smart: 42 });
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(25521232.224839047); const result = await sdk.playlists.getPlaylist(92983670.90558982);
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(-60675901.030656695); const result = await sdk.playlists.deletePlaylist(99606126.8799004);
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(65200160.70787519); const result = await sdk.playlists.updatePlaylist(59306036.18112618);
console.log(result.data); console.log(result.data);
})(); })();
@@ -1539,7 +1539,7 @@ Retrieve Playlist Contents
| Name | Type| Description | | Name | Type| Description |
| :-------- | :----------| :----------| | :-------- | :----------| :----------|
| playlistId | number | the ID of the playlist | | playlistId | number | the ID of the playlist |
| type | number | the metadata type of the item to return | | type_ | number | the metadata type of the item to return |
@@ -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(62167005.120096, 2249491.135525167); const result = await sdk.playlists.getPlaylistContents(-92245882.98409712, -16545042.744542778);
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(24703702.974021226); const result = await sdk.playlists.clearPlaylistContents(14196089.297935858);
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(-3444881.095142722, 'library://..', 123); const result = await sdk.playlists.addPlaylistContents(72519034.14049211, 'library://..', 123);
console.log(result.data); console.log(result.data);
})(); })();
@@ -1663,7 +1663,7 @@ Get a Transient Token.
| Name | Type| Description | | Name | Type| Description |
| :-------- | :----------| :----------| | :-------- | :----------| :----------|
| type | [SecurityType](/src/models/README.md#securitytype) | `delegation` - This is the only supported `type` parameter. | | type_ | [SecurityType](/src/models/README.md#securitytype) | `delegation` - This is the only supported `type` parameter. |
| scope | [Scope](/src/models/README.md#scope) | `all` - This is the only supported `scope` parameter. | | scope | [Scope](/src/models/README.md#scope) | `all` - This is the only supported `scope` parameter. |
@@ -1867,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: 'foo' }); const result = await sdk.updater.checkForUpdates({ download: 1 });
console.log(result.data); console.log(result.data);
})(); })();
@@ -1900,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: 'foo', skip: 1 }); const result = await sdk.updater.applyUpdates({ tonight: 1, skip: 1 });
console.log(result.data); console.log(result.data);
})(); })();
@@ -1953,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(
-87516165.31957072, 75991865.40406942,
'path', 'path',
-62877687.452249065, 56663842.10067603,
-23076170.49337977, -67967057.15750742,
'protocol', 'protocol',
{ {
fastSeek: -68282427.87913167, fastSeek: -62704400.883238874,
directPlay: -74000014.76895301, directPlay: 52960718.78090119,
directStream: 84943482.78212723, directStream: -94395071.761853,
subtitleSize: -55237723.44813809, subtitleSize: 33802925.01619348,
subtites: 'subtites', subtites: 'subtites',
audioBoost: 29945312.780143052, audioBoost: 10748580.253260702,
location: 'location', location: 'location',
mediaBufferSize: -16516185.759793341, mediaBufferSize: -46116700.53601071,
session: 'session', session: 'session',
addDebugOverlay: -10261279.500832424, addDebugOverlay: -8127838.686531514,
autoAdjustQuality: 32480614.034784466, autoAdjustQuality: -52398513.48495814,
}, },
); );
console.log(result.data); console.log(result.data);
@@ -2011,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(
-32608281.350922346, 46174238.848059,
'key', 'key',
'stopped', 'paused',
-74699884.18136695, 30544127.328339994,
-66756517.26572518, 93380826.84958789,
-24893130.84645444, -91474715.3910691,
'context', 'context',
-75734154.35564606, 15473399.928571522,
-89175857.3275879, 6431628.867009878,
-15877259.38555336, 81455467.98715591,
); );
console.log(result.data); console.log(result.data);
})(); })();

318
package-lock.json generated
View File

@@ -52,12 +52,12 @@
} }
}, },
"node_modules/@babel/code-frame": { "node_modules/@babel/code-frame": {
"version": "7.22.13", "version": "7.23.5",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz",
"integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/highlight": "^7.22.13", "@babel/highlight": "^7.23.4",
"chalk": "^2.4.2" "chalk": "^2.4.2"
}, },
"engines": { "engines": {
@@ -136,30 +136,30 @@
} }
}, },
"node_modules/@babel/compat-data": { "node_modules/@babel/compat-data": {
"version": "7.23.2", "version": "7.23.5",
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.2.tgz", "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.5.tgz",
"integrity": "sha512-0S9TQMmDHlqAZ2ITT95irXKfxN9bncq8ZCoJhun3nHL/lLUxd2NKBJYoNGWH7S0hz6fRQwWlAWn/ILM0C70KZQ==", "integrity": "sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
} }
}, },
"node_modules/@babel/core": { "node_modules/@babel/core": {
"version": "7.23.2", "version": "7.23.5",
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.2.tgz", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.5.tgz",
"integrity": "sha512-n7s51eWdaWZ3vGT2tD4T7J6eJs3QoBXydv7vkUM06Bf1cbVD2Kc2UrkzhiQwobfV7NwOnQXYL7UBJ5VPU+RGoQ==", "integrity": "sha512-Cwc2XjUrG4ilcfOw4wBAK+enbdgwAcAJCfGUItPBKR7Mjw4aEfAFYrLxeRp4jWgtNIKn3n2AlBOfwwafl+42/g==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@ampproject/remapping": "^2.2.0", "@ampproject/remapping": "^2.2.0",
"@babel/code-frame": "^7.22.13", "@babel/code-frame": "^7.23.5",
"@babel/generator": "^7.23.0", "@babel/generator": "^7.23.5",
"@babel/helper-compilation-targets": "^7.22.15", "@babel/helper-compilation-targets": "^7.22.15",
"@babel/helper-module-transforms": "^7.23.0", "@babel/helper-module-transforms": "^7.23.3",
"@babel/helpers": "^7.23.2", "@babel/helpers": "^7.23.5",
"@babel/parser": "^7.23.0", "@babel/parser": "^7.23.5",
"@babel/template": "^7.22.15", "@babel/template": "^7.22.15",
"@babel/traverse": "^7.23.2", "@babel/traverse": "^7.23.5",
"@babel/types": "^7.23.0", "@babel/types": "^7.23.5",
"convert-source-map": "^2.0.0", "convert-source-map": "^2.0.0",
"debug": "^4.1.0", "debug": "^4.1.0",
"gensync": "^1.0.0-beta.2", "gensync": "^1.0.0-beta.2",
@@ -184,12 +184,12 @@
} }
}, },
"node_modules/@babel/generator": { "node_modules/@babel/generator": {
"version": "7.23.0", "version": "7.23.5",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.5.tgz",
"integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", "integrity": "sha512-BPssCHrBD+0YrxviOa3QzpqwhNIXKEtOa2jQrm4FlmkC2apYgRnQcmPWiGZDlGxiNtltnUFolMe8497Esry+jA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/types": "^7.23.0", "@babel/types": "^7.23.5",
"@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/gen-mapping": "^0.3.2",
"@jridgewell/trace-mapping": "^0.3.17", "@jridgewell/trace-mapping": "^0.3.17",
"jsesc": "^2.5.1" "jsesc": "^2.5.1"
@@ -270,9 +270,9 @@
} }
}, },
"node_modules/@babel/helper-module-transforms": { "node_modules/@babel/helper-module-transforms": {
"version": "7.23.0", "version": "7.23.3",
"resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.0.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz",
"integrity": "sha512-WhDWw1tdrlT0gMgUJSlX0IQvoO1eN279zrAUbVB+KpV2c3Tylz8+GnKOLllCS6Z/iZQEyVYxhZVUdPTqs2YYPw==", "integrity": "sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-environment-visitor": "^7.22.20",
@@ -322,9 +322,9 @@
} }
}, },
"node_modules/@babel/helper-string-parser": { "node_modules/@babel/helper-string-parser": {
"version": "7.22.5", "version": "7.23.4",
"resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz",
"integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
@@ -340,32 +340,32 @@
} }
}, },
"node_modules/@babel/helper-validator-option": { "node_modules/@babel/helper-validator-option": {
"version": "7.22.15", "version": "7.23.5",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz",
"integrity": "sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==", "integrity": "sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
} }
}, },
"node_modules/@babel/helpers": { "node_modules/@babel/helpers": {
"version": "7.23.2", "version": "7.23.5",
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.2.tgz", "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.5.tgz",
"integrity": "sha512-lzchcp8SjTSVe/fPmLwtWVBFC7+Tbn8LGHDVfDp9JGxpAY5opSaEFgt8UQvrnECWOTdji2mOWMz1rOhkHscmGQ==", "integrity": "sha512-oO7us8FzTEsG3U6ag9MfdF1iA/7Z6dz+MtFhifZk8C8o453rGJFFWUP1t+ULM9TUIAzC9uxXEiXjOiVMyd7QPg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/template": "^7.22.15", "@babel/template": "^7.22.15",
"@babel/traverse": "^7.23.2", "@babel/traverse": "^7.23.5",
"@babel/types": "^7.23.0" "@babel/types": "^7.23.5"
}, },
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
} }
}, },
"node_modules/@babel/highlight": { "node_modules/@babel/highlight": {
"version": "7.22.20", "version": "7.23.4",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz",
"integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/helper-validator-identifier": "^7.22.20", "@babel/helper-validator-identifier": "^7.22.20",
@@ -448,9 +448,9 @@
} }
}, },
"node_modules/@babel/parser": { "node_modules/@babel/parser": {
"version": "7.23.0", "version": "7.23.5",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.5.tgz",
"integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", "integrity": "sha512-hOOqoiNXrmGdFbhgCzu6GiURxUgM27Xwd/aPuu8RfHEZPBzL1Z54okAHAQjXfcQNwvrlkAmAp4SlRTZ45vlthQ==",
"dev": true, "dev": true,
"bin": { "bin": {
"parser": "bin/babel-parser.js" "parser": "bin/babel-parser.js"
@@ -520,9 +520,9 @@
} }
}, },
"node_modules/@babel/plugin-syntax-jsx": { "node_modules/@babel/plugin-syntax-jsx": {
"version": "7.22.5", "version": "7.23.3",
"resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.23.3.tgz",
"integrity": "sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==", "integrity": "sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/helper-plugin-utils": "^7.22.5" "@babel/helper-plugin-utils": "^7.22.5"
@@ -622,9 +622,9 @@
} }
}, },
"node_modules/@babel/plugin-syntax-typescript": { "node_modules/@babel/plugin-syntax-typescript": {
"version": "7.22.5", "version": "7.23.3",
"resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.23.3.tgz",
"integrity": "sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==", "integrity": "sha512-9EiNjVJOMwCO+43TqoTrgQ8jMwcAd0sWyXi9RPfIsLTj4R2MADDDQXELhffaUx/uJv2AYcxBgPwH6j4TIA4ytQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/helper-plugin-utils": "^7.22.5" "@babel/helper-plugin-utils": "^7.22.5"
@@ -651,19 +651,19 @@
} }
}, },
"node_modules/@babel/traverse": { "node_modules/@babel/traverse": {
"version": "7.23.2", "version": "7.23.5",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.5.tgz",
"integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", "integrity": "sha512-czx7Xy5a6sapWWRx61m1Ke1Ra4vczu1mCTtJam5zRTBOonfdJ+S/B6HYmGYu3fJtr8GGET3si6IhgWVBhJ/m8w==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/code-frame": "^7.22.13", "@babel/code-frame": "^7.23.5",
"@babel/generator": "^7.23.0", "@babel/generator": "^7.23.5",
"@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-environment-visitor": "^7.22.20",
"@babel/helper-function-name": "^7.23.0", "@babel/helper-function-name": "^7.23.0",
"@babel/helper-hoist-variables": "^7.22.5", "@babel/helper-hoist-variables": "^7.22.5",
"@babel/helper-split-export-declaration": "^7.22.6", "@babel/helper-split-export-declaration": "^7.22.6",
"@babel/parser": "^7.23.0", "@babel/parser": "^7.23.5",
"@babel/types": "^7.23.0", "@babel/types": "^7.23.5",
"debug": "^4.1.0", "debug": "^4.1.0",
"globals": "^11.1.0" "globals": "^11.1.0"
}, },
@@ -681,12 +681,12 @@
} }
}, },
"node_modules/@babel/types": { "node_modules/@babel/types": {
"version": "7.23.0", "version": "7.23.5",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.5.tgz",
"integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", "integrity": "sha512-ON5kSOJwVO6xXVRTvOI0eOnWe7VdUcIpsovGo9U/Br4Ie4UVFQTboO2cYnDhAGU6Fp+UxSiT+pMft0SMHfuq6w==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/helper-string-parser": "^7.22.5", "@babel/helper-string-parser": "^7.23.4",
"@babel/helper-validator-identifier": "^7.22.20", "@babel/helper-validator-identifier": "^7.22.20",
"to-fast-properties": "^2.0.0" "to-fast-properties": "^2.0.0"
}, },
@@ -725,9 +725,9 @@
} }
}, },
"node_modules/@eslint/eslintrc": { "node_modules/@eslint/eslintrc": {
"version": "2.1.2", "version": "2.1.4",
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz",
"integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"ajv": "^6.12.4", "ajv": "^6.12.4",
@@ -748,9 +748,9 @@
} }
}, },
"node_modules/@eslint/js": { "node_modules/@eslint/js": {
"version": "8.52.0", "version": "8.55.0",
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.52.0.tgz", "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.55.0.tgz",
"integrity": "sha512-mjZVbpaeMZludF2fsWLD0Z9gCref1Tk4i9+wddjRvpUNqqcndPkBD09N/Mapey0b3jaXbLm2kICwFv2E64QinA==", "integrity": "sha512-qQfo2mxH5yVom1kacMtZZJFVdW+E70mqHMJvVg6WTLo+VBuQJ4TojZlfWBjK0ve5BdEeNAVxOsl/nvNMpJOaJA==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
@@ -1283,9 +1283,9 @@
} }
}, },
"node_modules/@types/babel__core": { "node_modules/@types/babel__core": {
"version": "7.20.3", "version": "7.20.5",
"resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.3.tgz", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz",
"integrity": "sha512-54fjTSeSHwfan8AyHWrKbfBWiEUrNTZsUwPTDSNaaP1QDQIZbeNUg3a59E9D+375MzUw/x1vx2/0F5LBz+AeYA==", "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/parser": "^7.20.7", "@babel/parser": "^7.20.7",
@@ -1296,18 +1296,18 @@
} }
}, },
"node_modules/@types/babel__generator": { "node_modules/@types/babel__generator": {
"version": "7.6.6", "version": "7.6.7",
"resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.6.tgz", "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.7.tgz",
"integrity": "sha512-66BXMKb/sUWbMdBNdMvajU7i/44RkrA3z/Yt1c7R5xejt8qh84iU54yUWCtm0QwGJlDcf/gg4zd/x4mpLAlb/w==", "integrity": "sha512-6Sfsq+EaaLrw4RmdFWE9Onp63TOUue71AWb4Gpa6JxzgTYtimbM086WnYTy2U67AofR++QKCo08ZP6pwx8YFHQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/types": "^7.0.0" "@babel/types": "^7.0.0"
} }
}, },
"node_modules/@types/babel__template": { "node_modules/@types/babel__template": {
"version": "7.4.3", "version": "7.4.4",
"resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.3.tgz", "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz",
"integrity": "sha512-ciwyCLeuRfxboZ4isgdNZi/tkt06m8Tw6uGbBSBgWrnnZGNXiEyM27xc/PjXGQLqlZ6ylbgHMnm7ccF9tCkOeQ==", "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/parser": "^7.1.0", "@babel/parser": "^7.1.0",
@@ -1315,51 +1315,51 @@
} }
}, },
"node_modules/@types/babel__traverse": { "node_modules/@types/babel__traverse": {
"version": "7.20.3", "version": "7.20.4",
"resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.3.tgz", "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.4.tgz",
"integrity": "sha512-Lsh766rGEFbaxMIDH7Qa+Yha8cMVI3qAK6CHt3OR0YfxOIn5Z54iHiyDRycHrBqeIiqGa20Kpsv1cavfBKkRSw==", "integrity": "sha512-mSM/iKUk5fDDrEV/e83qY+Cr3I1+Q3qqTuEn++HAWYjEa1+NxZr6CNrcJGf2ZTnq4HoFGC3zaTPZTobCzCFukA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/types": "^7.20.7" "@babel/types": "^7.20.7"
} }
}, },
"node_modules/@types/graceful-fs": { "node_modules/@types/graceful-fs": {
"version": "4.1.8", "version": "4.1.9",
"resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.8.tgz", "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz",
"integrity": "sha512-NhRH7YzWq8WiNKVavKPBmtLYZHxNY19Hh+az28O/phfp68CF45pMFud+ZzJ8ewnxnC5smIdF3dqFeiSUQ5I+pw==", "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@types/node": "*" "@types/node": "*"
} }
}, },
"node_modules/@types/istanbul-lib-coverage": { "node_modules/@types/istanbul-lib-coverage": {
"version": "2.0.5", "version": "2.0.6",
"resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz",
"integrity": "sha512-zONci81DZYCZjiLe0r6equvZut0b+dBRPBN5kBDjsONnutYNtJMoWQ9uR2RkL1gLG9NMTzvf+29e5RFfPbeKhQ==", "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==",
"dev": true "dev": true
}, },
"node_modules/@types/istanbul-lib-report": { "node_modules/@types/istanbul-lib-report": {
"version": "3.0.2", "version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.2.tgz", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz",
"integrity": "sha512-8toY6FgdltSdONav1XtUHl4LN1yTmLza+EuDazb/fEmRNCwjyqNVIQWs2IfC74IqjHkREs/nQ2FWq5kZU9IC0w==", "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@types/istanbul-lib-coverage": "*" "@types/istanbul-lib-coverage": "*"
} }
}, },
"node_modules/@types/istanbul-reports": { "node_modules/@types/istanbul-reports": {
"version": "3.0.3", "version": "3.0.4",
"resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.3.tgz", "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz",
"integrity": "sha512-1nESsePMBlf0RPRffLZi5ujYh7IH1BWL4y9pr+Bn3cJBdxz+RTP8bUFljLz9HvzhhOSWKdyBZ4DIivdL6rvgZg==", "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@types/istanbul-lib-report": "*" "@types/istanbul-lib-report": "*"
} }
}, },
"node_modules/@types/jest": { "node_modules/@types/jest": {
"version": "29.5.6", "version": "29.5.11",
"resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.6.tgz", "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.11.tgz",
"integrity": "sha512-/t9NnzkOpXb4Nfvg17ieHE6EeSjDS2SGSpNYfoLbUAeL/EOueU/RSdOWFpfQTXBEM7BguYW1XQ0EbM+6RlIh6w==", "integrity": "sha512-S2mHmYIVe13vrm6q4kN6fLYYAka15ALQki/vgDC3mIukEOx8WJlv0kQPM+d4w8Gp6u0uSdKND04IlTXBv0rwnQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"expect": "^29.0.0", "expect": "^29.0.0",
@@ -1367,9 +1367,9 @@
} }
}, },
"node_modules/@types/json-schema": { "node_modules/@types/json-schema": {
"version": "7.0.14", "version": "7.0.15",
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.14.tgz", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz",
"integrity": "sha512-U3PUjAudAdJBeC2pgN8uTIKgxrb4nlDF3SF0++EldXQvQBGkpFZMSnwQiIoDU77tv45VgNkl/L4ouD+rEomujw==", "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==",
"dev": true "dev": true
}, },
"node_modules/@types/json5": { "node_modules/@types/json5": {
@@ -1385,30 +1385,30 @@
"dev": true "dev": true
}, },
"node_modules/@types/semver": { "node_modules/@types/semver": {
"version": "7.5.4", "version": "7.5.6",
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.4.tgz", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.6.tgz",
"integrity": "sha512-MMzuxN3GdFwskAnb6fz0orFvhfqi752yjaXylr0Rp4oDg5H0Zn1IuyRhDVvYOwAXoJirx2xuS16I3WjxnAIHiQ==", "integrity": "sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==",
"dev": true "dev": true
}, },
"node_modules/@types/stack-utils": { "node_modules/@types/stack-utils": {
"version": "2.0.2", "version": "2.0.3",
"resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.2.tgz", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz",
"integrity": "sha512-g7CK9nHdwjK2n0ymT2CW698FuWJRIx+RP6embAzZ2Qi8/ilIrA1Imt2LVSeHUzKvpoi7BhmmQcXz95eS0f2JXw==", "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==",
"dev": true "dev": true
}, },
"node_modules/@types/yargs": { "node_modules/@types/yargs": {
"version": "17.0.29", "version": "17.0.32",
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.29.tgz", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.32.tgz",
"integrity": "sha512-nacjqA3ee9zRF/++a3FUY1suHTFKZeHba2n8WeDw9cCVdmzmHpIxyzOJBcpHvvEmS8E9KqWlSnWHUkOrkhWcvA==", "integrity": "sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@types/yargs-parser": "*" "@types/yargs-parser": "*"
} }
}, },
"node_modules/@types/yargs-parser": { "node_modules/@types/yargs-parser": {
"version": "21.0.2", "version": "21.0.3",
"resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.2.tgz", "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz",
"integrity": "sha512-5qcvofLPbfjmBfKaLfj/+f+Sbd6pN4zl7w7VSVI5uz7m9QZTuB2aZAa2uo1wHFBNN2x6g/SoTkXmd8mQnQF2Cw==", "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==",
"dev": true "dev": true
}, },
"node_modules/@typescript-eslint/eslint-plugin": { "node_modules/@typescript-eslint/eslint-plugin": {
@@ -1606,9 +1606,9 @@
"dev": true "dev": true
}, },
"node_modules/acorn": { "node_modules/acorn": {
"version": "8.11.1", "version": "8.11.2",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.1.tgz", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz",
"integrity": "sha512-IJTNCJMRHfRfb8un89z1QtS0x890C2QUrUxFMK8zy+RizcId6mfnqOf68Bu9YkDgpLYuvCm6aYbwDatXVZPjMQ==", "integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==",
"dev": true, "dev": true,
"bin": { "bin": {
"acorn": "bin/acorn" "acorn": "bin/acorn"
@@ -1847,9 +1847,9 @@
} }
}, },
"node_modules/axios": { "node_modules/axios": {
"version": "1.6.0", "version": "1.6.2",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.6.0.tgz", "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz",
"integrity": "sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg==", "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==",
"dependencies": { "dependencies": {
"follow-redirects": "^1.15.0", "follow-redirects": "^1.15.0",
"form-data": "^4.0.0", "form-data": "^4.0.0",
@@ -2001,9 +2001,9 @@
} }
}, },
"node_modules/browserslist": { "node_modules/browserslist": {
"version": "4.22.1", "version": "4.22.2",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.1.tgz", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.2.tgz",
"integrity": "sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ==", "integrity": "sha512-0UgcrvQmBDvZHFGdYUehrCNIazki7/lUP3kkoi/r3YB2amZbFM9J43ZRkJTXBUZK4gmx56+Sqk9+Vs9mwZx9+A==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {
@@ -2020,9 +2020,9 @@
} }
], ],
"dependencies": { "dependencies": {
"caniuse-lite": "^1.0.30001541", "caniuse-lite": "^1.0.30001565",
"electron-to-chromium": "^1.4.535", "electron-to-chromium": "^1.4.601",
"node-releases": "^2.0.13", "node-releases": "^2.0.14",
"update-browserslist-db": "^1.0.13" "update-browserslist-db": "^1.0.13"
}, },
"bin": { "bin": {
@@ -2092,9 +2092,9 @@
} }
}, },
"node_modules/caniuse-lite": { "node_modules/caniuse-lite": {
"version": "1.0.30001554", "version": "1.0.30001566",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001554.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001566.tgz",
"integrity": "sha512-A2E3U//MBwbJVzebddm1YfNp7Nud5Ip+IPn4BozBmn4KqVX7AvluoIDFWjsv5OkGnKUXQVmMSoMKLa3ScCblcQ==", "integrity": "sha512-ggIhCsTxmITBAMmK8yZjEhCO5/47jKXPu6Dha/wuCS4JePVL+3uiDEBuhu2aIoT+bqTOR8L76Ip1ARL9xYsEJA==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {
@@ -2397,9 +2397,9 @@
} }
}, },
"node_modules/electron-to-chromium": { "node_modules/electron-to-chromium": {
"version": "1.4.568", "version": "1.4.609",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.568.tgz", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.609.tgz",
"integrity": "sha512-3TCOv8+BY6Ltpt1/CmGBMups2IdKOyfEmz4J8yIS4xLSeMm0Rf+psSaxLuswG9qMKt+XbNbmADybtXGpTFlbDg==", "integrity": "sha512-ihiCP7PJmjoGNuLpl7TjNA8pCQWu09vGyjlPYw1Rqww4gvNuCcmvl+44G+2QyJ6S2K4o+wbTS++Xz0YN8Q9ERw==",
"dev": true "dev": true
}, },
"node_modules/emittery": { "node_modules/emittery": {
@@ -2544,15 +2544,15 @@
} }
}, },
"node_modules/eslint": { "node_modules/eslint": {
"version": "8.52.0", "version": "8.55.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.52.0.tgz", "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.55.0.tgz",
"integrity": "sha512-zh/JHnaixqHZsolRB/w9/02akBk9EPrOs9JwcTP2ek7yL5bVvXuRariiaAjjoJ5DvuwQ1WAE/HsMz+w17YgBCg==", "integrity": "sha512-iyUUAM0PCKj5QpwGfmCAG9XXbZCWsqP/eWAWrG/W0umvjuLRBECwSFdt+rCntju0xEH7teIABPwXpahftIaTdA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/eslint-utils": "^4.2.0",
"@eslint-community/regexpp": "^4.6.1", "@eslint-community/regexpp": "^4.6.1",
"@eslint/eslintrc": "^2.1.2", "@eslint/eslintrc": "^2.1.4",
"@eslint/js": "8.52.0", "@eslint/js": "8.55.0",
"@humanwhocodes/config-array": "^0.11.13", "@humanwhocodes/config-array": "^0.11.13",
"@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/module-importer": "^1.0.1",
"@nodelib/fs.walk": "^1.2.8", "@nodelib/fs.walk": "^1.2.8",
@@ -2982,9 +2982,9 @@
"dev": true "dev": true
}, },
"node_modules/fast-glob": { "node_modules/fast-glob": {
"version": "3.3.1", "version": "3.3.2",
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz",
"integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.stat": "^2.0.2",
@@ -3080,9 +3080,9 @@
} }
}, },
"node_modules/flat-cache": { "node_modules/flat-cache": {
"version": "3.1.1", "version": "3.2.0",
"resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.1.tgz", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz",
"integrity": "sha512-/qM2b3LUIaIgviBQovTLvijfyOQXPtSRnRK26ksj2J7rzPIecePUIpJsZ4T02Qg+xiAEKIs5K8dsHEd+VaKa/Q==", "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"flatted": "^3.2.9", "flatted": "^3.2.9",
@@ -3090,7 +3090,7 @@
"rimraf": "^3.0.2" "rimraf": "^3.0.2"
}, },
"engines": { "engines": {
"node": ">=12.0.0" "node": "^10.12.0 || >=12.0.0"
} }
}, },
"node_modules/flatted": { "node_modules/flatted": {
@@ -3469,9 +3469,9 @@
} }
}, },
"node_modules/ignore": { "node_modules/ignore": {
"version": "5.2.4", "version": "5.3.0",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.0.tgz",
"integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", "integrity": "sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": ">= 4" "node": ">= 4"
@@ -3832,9 +3832,9 @@
"dev": true "dev": true
}, },
"node_modules/istanbul-lib-coverage": { "node_modules/istanbul-lib-coverage": {
"version": "3.2.0", "version": "3.2.2",
"resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz",
"integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": ">=8" "node": ">=8"
@@ -4732,9 +4732,9 @@
"dev": true "dev": true
}, },
"node_modules/nock": { "node_modules/nock": {
"version": "13.3.6", "version": "13.4.0",
"resolved": "https://registry.npmjs.org/nock/-/nock-13.3.6.tgz", "resolved": "https://registry.npmjs.org/nock/-/nock-13.4.0.tgz",
"integrity": "sha512-lT6YuktKroUFM+27mubf2uqQZVy2Jf+pfGzuh9N6VwdHlFoZqvi4zyxFTVR1w/ChPqGY6yxGehHp6C3wqCASCw==", "integrity": "sha512-W8NVHjO/LCTNA64yxAPHV/K47LpGYcVzgKd3Q0n6owhwvD0Dgoterc25R4rnZbckJEb6Loxz1f5QMuJpJnbSyQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"debug": "^4.1.0", "debug": "^4.1.0",
@@ -4752,9 +4752,9 @@
"dev": true "dev": true
}, },
"node_modules/node-releases": { "node_modules/node-releases": {
"version": "2.0.13", "version": "2.0.14",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz",
"integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==", "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==",
"dev": true "dev": true
}, },
"node_modules/normalize-path": { "node_modules/normalize-path": {
@@ -4797,13 +4797,13 @@
} }
}, },
"node_modules/object.assign": { "node_modules/object.assign": {
"version": "4.1.4", "version": "4.1.5",
"resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz",
"integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"call-bind": "^1.0.2", "call-bind": "^1.0.5",
"define-properties": "^1.1.4", "define-properties": "^1.2.1",
"has-symbols": "^1.0.3", "has-symbols": "^1.0.3",
"object-keys": "^1.1.1" "object-keys": "^1.1.1"
}, },
@@ -5207,9 +5207,9 @@
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
}, },
"node_modules/punycode": { "node_modules/punycode": {
"version": "2.3.0", "version": "2.3.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
"integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": ">=6" "node": ">=6"
@@ -6031,9 +6031,9 @@
} }
}, },
"node_modules/v8-to-istanbul": { "node_modules/v8-to-istanbul": {
"version": "9.1.3", "version": "9.2.0",
"resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.3.tgz", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz",
"integrity": "sha512-9lDD+EVI2fjFsMWXc6dy5JJzBsVTcQ2fVkfBvncZ6xJWG9wtBhOldG+mHkSL0+V1K/xgZz0JDO5UT5hFwHUghg==", "integrity": "sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@jridgewell/trace-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.12",

View File

@@ -5,7 +5,7 @@ import throwHttpError from './httpExceptions';
export default class HTTPLibrary implements HTTPClient { export default class HTTPLibrary implements HTTPClient {
readonly userAgentHeader: Headers = { readonly userAgentHeader: Headers = {
'User-Agent': 'liblab/0.1.25 PlexSDK/0.0.1 typescript/5.2.2', 'User-Agent': 'liblab/0.1.28 PlexSDK/0.0.1 typescript/5.3.2',
}; };
readonly retryAttempts: number = 3; readonly retryAttempts: number = 3;

View File

@@ -34,6 +34,9 @@ type Config = {
export * from './http/errors'; export * from './http/errors';
/**
* An Open API Spec for interacting with Plex.tv and Plex Servers
*/
export class PlexSDK { export class PlexSDK {
public activities: ActivitiesService; public activities: ActivitiesService;
public butler: ButlerService; public butler: ButlerService;
@@ -65,6 +68,10 @@ export class PlexSDK {
this.video = new VideoService(apiKey, apiKeyHeader); this.video = new VideoService(apiKey, apiKeyHeader);
} }
/**
* Sets the baseUrl that the SDK will use for its requests.
* @param {string} url
*/
setBaseUrl(url: string): void { setBaseUrl(url: string): void {
this.activities.setBaseUrl(url); this.activities.setBaseUrl(url);
this.butler.setBaseUrl(url); this.butler.setBaseUrl(url);
@@ -81,6 +88,11 @@ export class PlexSDK {
this.video.setBaseUrl(url); this.video.setBaseUrl(url);
} }
/**
* Sets the api key used for authentication.
* @param {string} key
* @param {string} header
*/
setApiKey(key: string, header: string = 'X-Plex-Token') { setApiKey(key: string, header: string = 'X-Plex-Token') {
this.activities.setApiKey(key, header); this.activities.setApiKey(key, header);
this.butler.setApiKey(key, header); this.butler.setApiKey(key, header);

View File

@@ -343,7 +343,7 @@ const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
110, 110,
165, 165,
100, 100,
4000, 20,
1, 1,
1, 1,
'/library/metadata/49564/thumb/1654258204', '/library/metadata/49564/thumb/1654258204',
@@ -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', 90469787.90055934, 'state'); const result = await sdk.media.updatePlayProgress('key', 27551608.23429507, '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('GenerateChapterThumbs'); const result = await sdk.butler.startTask('CleanOldBundles');
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: 56455806.18512213, onlyTransient: 1 }); const result = await sdk.hubs.getGlobalHubs({ count: 85088414.29395235, 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(14224427.485252097, { const result = await sdk.hubs.getLibraryHubs(1529501.7966160178, {
count: 59167335.01182026, count: -55107649.72469167,
onlyTransient: 1, onlyTransient: 1,
}); });
console.log(result.data); console.log(result.data);
@@ -762,7 +762,7 @@ const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN });
(async () => { (async () => {
const result = await sdk.search.performSearch('arnold', { const result = await sdk.search.performSearch('arnold', {
sectionId: 23503236.39517291, sectionId: -91245133.11936787,
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: 49725001.21318659, sectionId: -77985966.3231569,
limit: 5, limit: 5,
}); });
console.log(result.data); console.log(result.data);
@@ -859,7 +859,7 @@ Optional parameters are passed as part of the last parameter to the method. Ex.
| Name | Type| Description | | Name | Type| Description |
| :-------- | :----------| :----------| | :-------- | :----------| :----------|
| type | number | Item type | | type_ | number | Item type |
**Return Type** **Return Type**
@@ -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: 57131492.35348597, type: -83086119.43343997,
}); });
console.log(result.data); console.log(result.data);
})(); })();
@@ -1011,7 +1011,7 @@ Optional parameters are passed as part of the last parameter to the method. Ex.
| Name | Type| Description | | Name | Type| Description |
| :-------- | :----------| :----------| | :-------- | :----------| :----------|
| type | number | item type | | type_ | number | item type |
| filter | string | the filter parameter | | filter | string | the filter parameter |
@@ -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(5918142.371238574, { const result = await sdk.library.getLibraryItems(42026951.633123755, {
type: -7809061.492073655, type: 35182739.55189258,
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(96299696.9761284); const result = await sdk.library.refreshLibrary(40666143.29885453);
console.log(result.data); console.log(result.data);
})(); })();
@@ -1075,7 +1075,7 @@ Get Latest Library Items
| Name | Type| Description | | Name | Type| Description |
| :-------- | :----------| :----------| | :-------- | :----------| :----------|
| sectionId | number | the Id of the library to query | | sectionId | number | the Id of the library to query |
| type | number | item type | | type_ | number | item type |
**Optional Parameters** **Optional Parameters**
@@ -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(92402469.6477915, -96400116.97826156, { const result = await sdk.library.getLatestLibraryItems(68855255.94976288, -62521069.88462107, {
filter: 'filter', filter: 'filter',
}); });
console.log(result.data); console.log(result.data);
@@ -1115,7 +1115,7 @@ Get Common Library Items
| Name | Type| Description | | Name | Type| Description |
| :-------- | :----------| :----------| | :-------- | :----------| :----------|
| sectionId | number | the Id of the library to query | | sectionId | number | the Id of the library to query |
| type | number | item type | | type_ | number | item type |
**Optional Parameters** **Optional Parameters**
@@ -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(10111915.895296082, 55224735.92815569, { const result = await sdk.library.getCommonLibraryItems(-8101546.533601046, -75357740.57515395, {
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(62182009.76385683); const result = await sdk.library.getMetadata(-88656892.93622507);
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(11669243.106740937); const result = await sdk.library.getMetadataChildren(-99012349.51775439);
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(2, 'message', 'source'); const result = await sdk.log.logLine(3, 'message', 'source');
console.log(result.data); console.log(result.data);
})(); })();
@@ -1318,7 +1318,7 @@ Create a Playlist
| Name | Type| Description | | Name | Type| Description |
| :-------- | :----------| :----------| | :-------- | :----------| :----------|
| title | string | name of the playlist | | title | string | name of the playlist |
| type | [Type](/src/models/README.md#type) | type of playlist to create | | type_ | [Type](/src/models/README.md#type) | type of playlist to create |
| smart | [Smart](/src/models/README.md#smart) | whether the playlist is smart or not | | smart | [Smart](/src/models/README.md#smart) | whether the playlist is smart or not |
**Optional Parameters** **Optional Parameters**
@@ -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', 'audio', 42, { const result = await sdk.playlists.createPlaylist('title', 'audio', 1, {
uri: 'uri', uri: 'uri',
playQueueID: -22282333.505305633, playQueueID: 87381919.3788966,
}); });
console.log(result.data); console.log(result.data);
})(); })();
@@ -1378,7 +1378,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.getPlaylists({ playlistType: 'photo', smart: 1 }); const result = await sdk.playlists.getPlaylists({ playlistType: 'video', smart: 42 });
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(25521232.224839047); const result = await sdk.playlists.getPlaylist(92983670.90558982);
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(-60675901.030656695); const result = await sdk.playlists.deletePlaylist(99606126.8799004);
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(65200160.70787519); const result = await sdk.playlists.updatePlaylist(59306036.18112618);
console.log(result.data); console.log(result.data);
})(); })();
@@ -1484,7 +1484,7 @@ Retrieve Playlist Contents
| Name | Type| Description | | Name | Type| Description |
| :-------- | :----------| :----------| | :-------- | :----------| :----------|
| playlistId | number | the ID of the playlist | | playlistId | number | the ID of the playlist |
| type | number | the metadata type of the item to return | | type_ | number | the metadata type of the item to return |
@@ -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(62167005.120096, 2249491.135525167); const result = await sdk.playlists.getPlaylistContents(-92245882.98409712, -16545042.744542778);
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(24703702.974021226); const result = await sdk.playlists.clearPlaylistContents(14196089.297935858);
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(-3444881.095142722, 'library://..', 123); const result = await sdk.playlists.addPlaylistContents(72519034.14049211, 'library://..', 123);
console.log(result.data); console.log(result.data);
})(); })();
@@ -1608,7 +1608,7 @@ Get a Transient Token.
| Name | Type| Description | | Name | Type| Description |
| :-------- | :----------| :----------| | :-------- | :----------| :----------|
| type | [SecurityType](/src/models/README.md#securitytype) | `delegation` - This is the only supported `type` parameter. | | type_ | [SecurityType](/src/models/README.md#securitytype) | `delegation` - This is the only supported `type` parameter. |
| scope | [Scope](/src/models/README.md#scope) | `all` - This is the only supported `scope` parameter. | | scope | [Scope](/src/models/README.md#scope) | `all` - This is the only supported `scope` parameter. |
@@ -1812,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: 'foo' }); const result = await sdk.updater.checkForUpdates({ download: 1 });
console.log(result.data); console.log(result.data);
})(); })();
@@ -1845,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: 'foo', skip: 1 }); const result = await sdk.updater.applyUpdates({ tonight: 1, skip: 1 });
console.log(result.data); console.log(result.data);
})(); })();
@@ -1898,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(
-87516165.31957072, 75991865.40406942,
'path', 'path',
-62877687.452249065, 56663842.10067603,
-23076170.49337977, -67967057.15750742,
'protocol', 'protocol',
{ {
fastSeek: -68282427.87913167, fastSeek: -62704400.883238874,
directPlay: -74000014.76895301, directPlay: 52960718.78090119,
directStream: 84943482.78212723, directStream: -94395071.761853,
subtitleSize: -55237723.44813809, subtitleSize: 33802925.01619348,
subtites: 'subtites', subtites: 'subtites',
audioBoost: 29945312.780143052, audioBoost: 10748580.253260702,
location: 'location', location: 'location',
mediaBufferSize: -16516185.759793341, mediaBufferSize: -46116700.53601071,
session: 'session', session: 'session',
addDebugOverlay: -10261279.500832424, addDebugOverlay: -8127838.686531514,
autoAdjustQuality: 32480614.034784466, autoAdjustQuality: -52398513.48495814,
}, },
); );
console.log(result.data); console.log(result.data);
@@ -1956,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(
-32608281.350922346, 46174238.848059,
'key', 'key',
'stopped', 'paused',
-74699884.18136695, 30544127.328339994,
-66756517.26572518, 93380826.84958789,
-24893130.84645444, -91474715.3910691,
'context', 'context',
-75734154.35564606, 15473399.928571522,
-89175857.3275879, 6431628.867009878,
-15877259.38555336, 81455467.98715591,
); );
console.log(result.data); console.log(result.data);
})(); })();

View File

@@ -15,7 +15,7 @@ export class ActivitiesService extends BaseService {
*/ */
async getServerActivities(): Promise<Response<GetServerActivitiesResponse>> { async getServerActivities(): Promise<Response<GetServerActivitiesResponse>> {
const urlEndpoint = '/activities'; const urlEndpoint = '/activities';
const finalUrl = `${this.baseUrl + urlEndpoint}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -47,9 +47,9 @@ export class ActivitiesService extends BaseService {
let urlEndpoint = '/activities/{activityUUID}'; let urlEndpoint = '/activities/{activityUUID}';
urlEndpoint = urlEndpoint.replace( urlEndpoint = urlEndpoint.replace(
'{activityUUID}', '{activityUUID}',
encodeURIComponent(serializePath('simple', false, activityUuid, undefined)), serializePath('simple', false, activityUuid, undefined),
); );
const finalUrl = `${this.baseUrl + urlEndpoint}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const response: any = await this.httpClient.delete( const response: any = await this.httpClient.delete(
finalUrl, finalUrl,
{}, {},

View File

@@ -16,7 +16,7 @@ export class ButlerService extends BaseService {
*/ */
async getButlerTasks(): Promise<Response<GetButlerTasksResponse>> { async getButlerTasks(): Promise<Response<GetButlerTasksResponse>> {
const urlEndpoint = '/butler'; const urlEndpoint = '/butler';
const finalUrl = `${this.baseUrl + urlEndpoint}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -45,7 +45,7 @@ export class ButlerService extends BaseService {
*/ */
async startAllTasks(): Promise<any> { async startAllTasks(): Promise<any> {
const urlEndpoint = '/butler'; const urlEndpoint = '/butler';
const finalUrl = `${this.baseUrl + urlEndpoint}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const response: any = await this.httpClient.post( const response: any = await this.httpClient.post(
finalUrl, finalUrl,
{}, {},
@@ -70,7 +70,7 @@ export class ButlerService extends BaseService {
*/ */
async stopAllTasks(): Promise<any> { async stopAllTasks(): Promise<any> {
const urlEndpoint = '/butler'; const urlEndpoint = '/butler';
const finalUrl = `${this.baseUrl + urlEndpoint}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const response: any = await this.httpClient.delete( const response: any = await this.httpClient.delete(
finalUrl, finalUrl,
{}, {},
@@ -105,9 +105,9 @@ export class ButlerService extends BaseService {
let urlEndpoint = '/butler/{taskName}'; let urlEndpoint = '/butler/{taskName}';
urlEndpoint = urlEndpoint.replace( urlEndpoint = urlEndpoint.replace(
'{taskName}', '{taskName}',
encodeURIComponent(serializePath('simple', false, taskName, undefined)), serializePath('simple', false, taskName, undefined),
); );
const finalUrl = `${this.baseUrl + urlEndpoint}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const response: any = await this.httpClient.post( const response: any = await this.httpClient.post(
finalUrl, finalUrl,
{}, {},
@@ -138,9 +138,9 @@ export class ButlerService extends BaseService {
let urlEndpoint = '/butler/{taskName}'; let urlEndpoint = '/butler/{taskName}';
urlEndpoint = urlEndpoint.replace( urlEndpoint = urlEndpoint.replace(
'{taskName}', '{taskName}',
encodeURIComponent(serializePath('simple', false, taskName, undefined)), serializePath('simple', false, taskName, undefined),
); );
const finalUrl = `${this.baseUrl + urlEndpoint}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const response: any = await this.httpClient.delete( const response: any = await this.httpClient.delete(
finalUrl, finalUrl,
{}, {},

View File

@@ -29,8 +29,8 @@ export class HubsService extends BaseService {
queryParams.push(serializeQuery('form', true, 'onlyTransient', onlyTransient)); queryParams.push(serializeQuery('form', true, 'onlyTransient', onlyTransient));
} }
const urlEndpoint = '/hubs'; const urlEndpoint = '/hubs';
const urlParams = queryParams.length > 0 ? `?${encodeURI(queryParams.join('&'))}` : ''; const urlParams = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
const finalUrl = `${this.baseUrl + urlEndpoint}${urlParams}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}${urlParams}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -69,7 +69,7 @@ export class HubsService extends BaseService {
let urlEndpoint = '/hubs/sections/{sectionId}'; let urlEndpoint = '/hubs/sections/{sectionId}';
urlEndpoint = urlEndpoint.replace( urlEndpoint = urlEndpoint.replace(
'{sectionId}', '{sectionId}',
encodeURIComponent(serializePath('simple', false, sectionId, undefined)), serializePath('simple', false, sectionId, undefined),
); );
if (count) { if (count) {
queryParams.push(serializeQuery('form', true, 'count', count)); queryParams.push(serializeQuery('form', true, 'count', count));
@@ -77,8 +77,8 @@ export class HubsService extends BaseService {
if (onlyTransient) { if (onlyTransient) {
queryParams.push(serializeQuery('form', true, 'onlyTransient', onlyTransient)); queryParams.push(serializeQuery('form', true, 'onlyTransient', onlyTransient));
} }
const urlParams = queryParams.length > 0 ? `?${encodeURI(queryParams.join('&'))}` : ''; const urlParams = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
const finalUrl = `${this.baseUrl + urlEndpoint}${urlParams}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}${urlParams}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},

View File

@@ -18,8 +18,8 @@ export class LibraryService extends BaseService {
* @param optionalParams.type_ - Item type * @param optionalParams.type_ - Item type
* @returns {Promise<any>} - The promise with the result * @returns {Promise<any>} - The promise with the result
*/ */
async getFileHash(url: string, optionalParams: { type?: number } = {}): Promise<any> { async getFileHash(url: string, optionalParams: { type_?: number } = {}): Promise<any> {
const { type } = optionalParams; const { type_ } = optionalParams;
if (url === undefined) { if (url === undefined) {
throw new Error('The following parameter is required: url, cannot be empty or blank'); throw new Error('The following parameter is required: url, cannot be empty or blank');
} }
@@ -27,12 +27,12 @@ export class LibraryService extends BaseService {
if (url) { if (url) {
queryParams.push(serializeQuery('form', true, 'url', url)); queryParams.push(serializeQuery('form', true, 'url', url));
} }
if (type) { if (type_) {
queryParams.push(serializeQuery('form', true, 'type_', type)); queryParams.push(serializeQuery('form', true, 'type', type_));
} }
const urlEndpoint = '/library/hashes'; const urlEndpoint = '/library/hashes';
const urlParams = queryParams.length > 0 ? `?${encodeURI(queryParams.join('&'))}` : ''; const urlParams = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
const finalUrl = `${this.baseUrl + urlEndpoint}${urlParams}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}${urlParams}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -57,7 +57,7 @@ export class LibraryService extends BaseService {
*/ */
async getRecentlyAdded(): Promise<Response<GetRecentlyAddedResponse>> { async getRecentlyAdded(): Promise<Response<GetRecentlyAddedResponse>> {
const urlEndpoint = '/library/recentlyAdded'; const urlEndpoint = '/library/recentlyAdded';
const finalUrl = `${this.baseUrl + urlEndpoint}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -87,7 +87,7 @@ This allows a client to provide a rich interface around the media (e.g. allow so
*/ */
async getLibraries(): Promise<any> { async getLibraries(): Promise<any> {
const urlEndpoint = '/library/sections'; const urlEndpoint = '/library/sections';
const finalUrl = `${this.baseUrl + urlEndpoint}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -145,13 +145,13 @@ Only exists for backwards compatibility, media providers other than the server l
let urlEndpoint = '/library/sections/{sectionId}'; let urlEndpoint = '/library/sections/{sectionId}';
urlEndpoint = urlEndpoint.replace( urlEndpoint = urlEndpoint.replace(
'{sectionId}', '{sectionId}',
encodeURIComponent(serializePath('simple', false, sectionId, undefined)), serializePath('simple', false, sectionId, undefined),
); );
if (includeDetails) { if (includeDetails) {
queryParams.push(serializeQuery('form', true, 'includeDetails', includeDetails)); queryParams.push(serializeQuery('form', true, 'includeDetails', includeDetails));
} }
const urlParams = queryParams.length > 0 ? `?${encodeURI(queryParams.join('&'))}` : ''; const urlParams = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
const finalUrl = `${this.baseUrl + urlEndpoint}${urlParams}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}${urlParams}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -181,9 +181,9 @@ Only exists for backwards compatibility, media providers other than the server l
let urlEndpoint = '/library/sections/{sectionId}'; let urlEndpoint = '/library/sections/{sectionId}';
urlEndpoint = urlEndpoint.replace( urlEndpoint = urlEndpoint.replace(
'{sectionId}', '{sectionId}',
encodeURIComponent(serializePath('simple', false, sectionId, undefined)), serializePath('simple', false, sectionId, undefined),
); );
const finalUrl = `${this.baseUrl + urlEndpoint}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const response: any = await this.httpClient.delete( const response: any = await this.httpClient.delete(
finalUrl, finalUrl,
{}, {},
@@ -212,9 +212,9 @@ Only exists for backwards compatibility, media providers other than the server l
*/ */
async getLibraryItems( async getLibraryItems(
sectionId: number, sectionId: number,
optionalParams: { type?: number; filter?: string } = {}, optionalParams: { type_?: number; filter?: string } = {},
): Promise<any> { ): Promise<any> {
const { type, filter } = optionalParams; const { type_, filter } = optionalParams;
if (sectionId === undefined) { if (sectionId === undefined) {
throw new Error('The following parameter is required: sectionId, cannot be empty or blank'); throw new Error('The following parameter is required: sectionId, cannot be empty or blank');
} }
@@ -222,16 +222,16 @@ Only exists for backwards compatibility, media providers other than the server l
let urlEndpoint = '/library/sections/{sectionId}/all'; let urlEndpoint = '/library/sections/{sectionId}/all';
urlEndpoint = urlEndpoint.replace( urlEndpoint = urlEndpoint.replace(
'{sectionId}', '{sectionId}',
encodeURIComponent(serializePath('simple', false, sectionId, undefined)), serializePath('simple', false, sectionId, undefined),
); );
if (type) { if (type_) {
queryParams.push(serializeQuery('form', true, 'type_', type)); queryParams.push(serializeQuery('form', true, 'type', type_));
} }
if (filter) { if (filter) {
queryParams.push(serializeQuery('form', true, 'filter', filter)); queryParams.push(serializeQuery('form', true, 'filter', filter));
} }
const urlParams = queryParams.length > 0 ? `?${encodeURI(queryParams.join('&'))}` : ''; const urlParams = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
const finalUrl = `${this.baseUrl + urlEndpoint}${urlParams}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}${urlParams}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -262,9 +262,9 @@ Only exists for backwards compatibility, media providers other than the server l
let urlEndpoint = '/library/sections/{sectionId}/refresh'; let urlEndpoint = '/library/sections/{sectionId}/refresh';
urlEndpoint = urlEndpoint.replace( urlEndpoint = urlEndpoint.replace(
'{sectionId}', '{sectionId}',
encodeURIComponent(serializePath('simple', false, sectionId, undefined)), serializePath('simple', false, sectionId, undefined),
); );
const finalUrl = `${this.baseUrl + urlEndpoint}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -293,29 +293,29 @@ Only exists for backwards compatibility, media providers other than the server l
*/ */
async getLatestLibraryItems( async getLatestLibraryItems(
sectionId: number, sectionId: number,
type: number, type_: number,
optionalParams: { filter?: string } = {}, optionalParams: { filter?: string } = {},
): Promise<any> { ): Promise<any> {
const { filter } = optionalParams; const { filter } = optionalParams;
if (sectionId === undefined || type === undefined) { if (sectionId === undefined || type_ === undefined) {
throw new Error( throw new Error(
'The following are required parameters: sectionId,type, cannot be empty or blank', 'The following are required parameters: sectionId,type_, cannot be empty or blank',
); );
} }
const queryParams: string[] = []; const queryParams: string[] = [];
let urlEndpoint = '/library/sections/{sectionId}/latest'; let urlEndpoint = '/library/sections/{sectionId}/latest';
urlEndpoint = urlEndpoint.replace( urlEndpoint = urlEndpoint.replace(
'{sectionId}', '{sectionId}',
encodeURIComponent(serializePath('simple', false, sectionId, undefined)), serializePath('simple', false, sectionId, undefined),
); );
if (type) { if (type_) {
queryParams.push(serializeQuery('form', true, 'type_', type)); queryParams.push(serializeQuery('form', true, 'type', type_));
} }
if (filter) { if (filter) {
queryParams.push(serializeQuery('form', true, 'filter', filter)); queryParams.push(serializeQuery('form', true, 'filter', filter));
} }
const urlParams = queryParams.length > 0 ? `?${encodeURI(queryParams.join('&'))}` : ''; const urlParams = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
const finalUrl = `${this.baseUrl + urlEndpoint}${urlParams}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}${urlParams}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -344,29 +344,29 @@ Only exists for backwards compatibility, media providers other than the server l
*/ */
async getCommonLibraryItems( async getCommonLibraryItems(
sectionId: number, sectionId: number,
type: number, type_: number,
optionalParams: { filter?: string } = {}, optionalParams: { filter?: string } = {},
): Promise<any> { ): Promise<any> {
const { filter } = optionalParams; const { filter } = optionalParams;
if (sectionId === undefined || type === undefined) { if (sectionId === undefined || type_ === undefined) {
throw new Error( throw new Error(
'The following are required parameters: sectionId,type, cannot be empty or blank', 'The following are required parameters: sectionId,type_, cannot be empty or blank',
); );
} }
const queryParams: string[] = []; const queryParams: string[] = [];
let urlEndpoint = '/library/sections/{sectionId}/common'; let urlEndpoint = '/library/sections/{sectionId}/common';
urlEndpoint = urlEndpoint.replace( urlEndpoint = urlEndpoint.replace(
'{sectionId}', '{sectionId}',
encodeURIComponent(serializePath('simple', false, sectionId, undefined)), serializePath('simple', false, sectionId, undefined),
); );
if (type) { if (type_) {
queryParams.push(serializeQuery('form', true, 'type_', type)); queryParams.push(serializeQuery('form', true, 'type', type_));
} }
if (filter) { if (filter) {
queryParams.push(serializeQuery('form', true, 'filter', filter)); queryParams.push(serializeQuery('form', true, 'filter', filter));
} }
const urlParams = queryParams.length > 0 ? `?${encodeURI(queryParams.join('&'))}` : ''; const urlParams = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
const finalUrl = `${this.baseUrl + urlEndpoint}${urlParams}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}${urlParams}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -397,9 +397,9 @@ Only exists for backwards compatibility, media providers other than the server l
let urlEndpoint = '/library/metadata/{ratingKey}'; let urlEndpoint = '/library/metadata/{ratingKey}';
urlEndpoint = urlEndpoint.replace( urlEndpoint = urlEndpoint.replace(
'{ratingKey}', '{ratingKey}',
encodeURIComponent(serializePath('simple', false, ratingKey, undefined)), serializePath('simple', false, ratingKey, undefined),
); );
const finalUrl = `${this.baseUrl + urlEndpoint}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -430,9 +430,9 @@ Only exists for backwards compatibility, media providers other than the server l
let urlEndpoint = '/library/metadata/{ratingKey}/children'; let urlEndpoint = '/library/metadata/{ratingKey}/children';
urlEndpoint = urlEndpoint.replace( urlEndpoint = urlEndpoint.replace(
'{ratingKey}', '{ratingKey}',
encodeURIComponent(serializePath('simple', false, ratingKey, undefined)), serializePath('simple', false, ratingKey, undefined),
); );
const finalUrl = `${this.baseUrl + urlEndpoint}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -457,7 +457,7 @@ Only exists for backwards compatibility, media providers other than the server l
*/ */
async getOnDeck(): Promise<Response<GetOnDeckResponse>> { async getOnDeck(): Promise<Response<GetOnDeckResponse>> {
const urlEndpoint = '/library/onDeck'; const urlEndpoint = '/library/onDeck';
const finalUrl = `${this.baseUrl + urlEndpoint}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},

View File

@@ -40,7 +40,7 @@ export class LogService extends BaseService {
queryParams.push(serializeQuery('form', true, 'source', source)); queryParams.push(serializeQuery('form', true, 'source', source));
} }
const urlEndpoint = '/log'; const urlEndpoint = '/log';
const finalUrl = `${this.baseUrl + urlEndpoint}?${encodeURI(queryParams.join('&'))}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}?${queryParams.join('&')}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -65,7 +65,7 @@ export class LogService extends BaseService {
*/ */
async logMultiLine(): Promise<any> { async logMultiLine(): Promise<any> {
const urlEndpoint = '/log'; const urlEndpoint = '/log';
const finalUrl = `${this.baseUrl + urlEndpoint}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const response: any = await this.httpClient.post( const response: any = await this.httpClient.post(
finalUrl, finalUrl,
{}, {},
@@ -90,7 +90,7 @@ export class LogService extends BaseService {
*/ */
async enablePaperTrail(): Promise<any> { async enablePaperTrail(): Promise<any> {
const urlEndpoint = '/log/networked'; const urlEndpoint = '/log/networked';
const finalUrl = `${this.baseUrl + urlEndpoint}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},

View File

@@ -21,7 +21,7 @@ export class MediaService extends BaseService {
queryParams.push(serializeQuery('form', true, 'key', key)); queryParams.push(serializeQuery('form', true, 'key', key));
} }
const urlEndpoint = '/:/scrobble'; const urlEndpoint = '/:/scrobble';
const finalUrl = `${this.baseUrl + urlEndpoint}?${encodeURI(queryParams.join('&'))}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}?${queryParams.join('&')}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -53,7 +53,7 @@ export class MediaService extends BaseService {
queryParams.push(serializeQuery('form', true, 'key', key)); queryParams.push(serializeQuery('form', true, 'key', key));
} }
const urlEndpoint = '/:/unscrobble'; const urlEndpoint = '/:/unscrobble';
const finalUrl = `${this.baseUrl + urlEndpoint}?${encodeURI(queryParams.join('&'))}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}?${queryParams.join('&')}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -96,7 +96,7 @@ export class MediaService extends BaseService {
queryParams.push(serializeQuery('form', true, 'state', state)); queryParams.push(serializeQuery('form', true, 'state', state));
} }
const urlEndpoint = '/:/progress'; const urlEndpoint = '/:/progress';
const finalUrl = `${this.baseUrl + urlEndpoint}?${encodeURI(queryParams.join('&'))}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}?${queryParams.join('&')}`);
const response: any = await this.httpClient.post( const response: any = await this.httpClient.post(
finalUrl, finalUrl,
{ key, time, state }, { key, time, state },

View File

@@ -27,22 +27,22 @@ export class PlaylistsService extends BaseService {
*/ */
async createPlaylist( async createPlaylist(
title: string, title: string,
type: Type, type_: Type,
smart: Smart, smart: Smart,
optionalParams: { uri?: string; playQueueId?: number } = {}, optionalParams: { uri?: string; playQueueId?: number } = {},
): Promise<any> { ): Promise<any> {
const { uri, playQueueId } = optionalParams; const { uri, playQueueId } = optionalParams;
if (title === undefined || type === undefined || smart === undefined) { if (title === undefined || type_ === undefined || smart === undefined) {
throw new Error( throw new Error(
'The following are required parameters: title,type,smart, cannot be empty or blank', 'The following are required parameters: title,type_,smart, cannot be empty or blank',
); );
} }
const queryParams: string[] = []; const queryParams: string[] = [];
if (title) { if (title) {
queryParams.push(serializeQuery('form', true, 'title', title)); queryParams.push(serializeQuery('form', true, 'title', title));
} }
if (type) { if (type_) {
queryParams.push(serializeQuery('form', true, 'type_', type)); queryParams.push(serializeQuery('form', true, 'type', type_));
} }
if (smart) { if (smart) {
queryParams.push(serializeQuery('form', true, 'smart', smart)); queryParams.push(serializeQuery('form', true, 'smart', smart));
@@ -54,11 +54,11 @@ export class PlaylistsService extends BaseService {
queryParams.push(serializeQuery('form', true, 'playQueueID', playQueueId)); queryParams.push(serializeQuery('form', true, 'playQueueID', playQueueId));
} }
const urlEndpoint = '/playlists'; const urlEndpoint = '/playlists';
const urlParams = queryParams.length > 0 ? `?${encodeURI(queryParams.join('&'))}` : ''; const urlParams = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
const finalUrl = `${this.baseUrl + urlEndpoint}${urlParams}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}${urlParams}`);
const response: any = await this.httpClient.post( const response: any = await this.httpClient.post(
finalUrl, finalUrl,
{ title, type_: type, smart, uri, playQueueID: playQueueId }, { title, type_, smart, uri, playQueueID: playQueueId },
{ {
...this.getAuthorizationHeader(), ...this.getAuthorizationHeader(),
}, },
@@ -93,8 +93,8 @@ export class PlaylistsService extends BaseService {
queryParams.push(serializeQuery('form', true, 'smart', smart)); queryParams.push(serializeQuery('form', true, 'smart', smart));
} }
const urlEndpoint = '/playlists/all'; const urlEndpoint = '/playlists/all';
const urlParams = queryParams.length > 0 ? `?${encodeURI(queryParams.join('&'))}` : ''; const urlParams = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
const finalUrl = `${this.baseUrl + urlEndpoint}${urlParams}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}${urlParams}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -126,9 +126,9 @@ Smart playlist details contain the `content` attribute. This is the content URI
let urlEndpoint = '/playlists/{playlistID}'; let urlEndpoint = '/playlists/{playlistID}';
urlEndpoint = urlEndpoint.replace( urlEndpoint = urlEndpoint.replace(
'{playlistID}', '{playlistID}',
encodeURIComponent(serializePath('simple', false, playlistId, undefined)), serializePath('simple', false, playlistId, undefined),
); );
const finalUrl = `${this.baseUrl + urlEndpoint}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -159,9 +159,9 @@ Smart playlist details contain the `content` attribute. This is the content URI
let urlEndpoint = '/playlists/{playlistID}'; let urlEndpoint = '/playlists/{playlistID}';
urlEndpoint = urlEndpoint.replace( urlEndpoint = urlEndpoint.replace(
'{playlistID}', '{playlistID}',
encodeURIComponent(serializePath('simple', false, playlistId, undefined)), serializePath('simple', false, playlistId, undefined),
); );
const finalUrl = `${this.baseUrl + urlEndpoint}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const response: any = await this.httpClient.put( const response: any = await this.httpClient.put(
finalUrl, finalUrl,
{}, {},
@@ -192,9 +192,9 @@ Smart playlist details contain the `content` attribute. This is the content URI
let urlEndpoint = '/playlists/{playlistID}'; let urlEndpoint = '/playlists/{playlistID}';
urlEndpoint = urlEndpoint.replace( urlEndpoint = urlEndpoint.replace(
'{playlistID}', '{playlistID}',
encodeURIComponent(serializePath('simple', false, playlistId, undefined)), serializePath('simple', false, playlistId, undefined),
); );
const finalUrl = `${this.baseUrl + urlEndpoint}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const response: any = await this.httpClient.delete( const response: any = await this.httpClient.delete(
finalUrl, finalUrl,
{}, {},
@@ -222,22 +222,22 @@ Note that for dumb playlists, items have a `playlistItemID` attribute which is u
* @param type_ the metadata type of the item to return * @param type_ the metadata type of the item to return
* @returns {Promise<any>} - The promise with the result * @returns {Promise<any>} - The promise with the result
*/ */
async getPlaylistContents(playlistId: number, type: number): Promise<any> { async getPlaylistContents(playlistId: number, type_: number): Promise<any> {
if (playlistId === undefined || type === undefined) { if (playlistId === undefined || type_ === undefined) {
throw new Error( throw new Error(
'The following are required parameters: playlistId,type, cannot be empty or blank', 'The following are required parameters: playlistId,type_, cannot be empty or blank',
); );
} }
const queryParams: string[] = []; const queryParams: string[] = [];
let urlEndpoint = '/playlists/{playlistID}/items'; let urlEndpoint = '/playlists/{playlistID}/items';
urlEndpoint = urlEndpoint.replace( urlEndpoint = urlEndpoint.replace(
'{playlistID}', '{playlistID}',
encodeURIComponent(serializePath('simple', false, playlistId, undefined)), serializePath('simple', false, playlistId, undefined),
); );
if (type) { if (type_) {
queryParams.push(serializeQuery('form', true, 'type_', type)); queryParams.push(serializeQuery('form', true, 'type', type_));
} }
const finalUrl = `${this.baseUrl + urlEndpoint}?${encodeURI(queryParams.join('&'))}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}?${queryParams.join('&')}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -274,7 +274,7 @@ With a smart playlist, passing a new `uri` parameter replaces the rules for the
let urlEndpoint = '/playlists/{playlistID}/items'; let urlEndpoint = '/playlists/{playlistID}/items';
urlEndpoint = urlEndpoint.replace( urlEndpoint = urlEndpoint.replace(
'{playlistID}', '{playlistID}',
encodeURIComponent(serializePath('simple', false, playlistId, undefined)), serializePath('simple', false, playlistId, undefined),
); );
if (uri) { if (uri) {
queryParams.push(serializeQuery('form', true, 'uri', uri)); queryParams.push(serializeQuery('form', true, 'uri', uri));
@@ -282,7 +282,7 @@ With a smart playlist, passing a new `uri` parameter replaces the rules for the
if (playQueueId) { if (playQueueId) {
queryParams.push(serializeQuery('form', true, 'playQueueID', playQueueId)); queryParams.push(serializeQuery('form', true, 'playQueueID', playQueueId));
} }
const finalUrl = `${this.baseUrl + urlEndpoint}?${encodeURI(queryParams.join('&'))}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}?${queryParams.join('&')}`);
const response: any = await this.httpClient.put( const response: any = await this.httpClient.put(
finalUrl, finalUrl,
{ uri, playQueueID: playQueueId }, { uri, playQueueID: playQueueId },
@@ -313,9 +313,9 @@ With a smart playlist, passing a new `uri` parameter replaces the rules for the
let urlEndpoint = '/playlists/{playlistID}/items'; let urlEndpoint = '/playlists/{playlistID}/items';
urlEndpoint = urlEndpoint.replace( urlEndpoint = urlEndpoint.replace(
'{playlistID}', '{playlistID}',
encodeURIComponent(serializePath('simple', false, playlistId, undefined)), serializePath('simple', false, playlistId, undefined),
); );
const finalUrl = `${this.baseUrl + urlEndpoint}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const response: any = await this.httpClient.delete( const response: any = await this.httpClient.delete(
finalUrl, finalUrl,
{}, {},
@@ -362,7 +362,7 @@ The `force` argument is used to disable overwriting. If the `force` argument is
queryParams.push(serializeQuery('form', true, 'force', force)); queryParams.push(serializeQuery('form', true, 'force', force));
} }
const urlEndpoint = '/playlists/upload'; const urlEndpoint = '/playlists/upload';
const finalUrl = `${this.baseUrl + urlEndpoint}?${encodeURI(queryParams.join('&'))}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}?${queryParams.join('&')}`);
const response: any = await this.httpClient.post( const response: any = await this.httpClient.post(
finalUrl, finalUrl,
{ path, force }, { path, force },

View File

@@ -48,8 +48,8 @@ This request is intended to be very fast, and called as the user types.
queryParams.push(serializeQuery('form', true, 'limit', limit)); queryParams.push(serializeQuery('form', true, 'limit', limit));
} }
const urlEndpoint = '/hubs/search'; const urlEndpoint = '/hubs/search';
const urlParams = queryParams.length > 0 ? `?${encodeURI(queryParams.join('&'))}` : ''; const urlParams = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
const finalUrl = `${this.baseUrl + urlEndpoint}${urlParams}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}${urlParams}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -98,8 +98,8 @@ Results, as well as their containing per-type hubs, contain a `distance` attribu
queryParams.push(serializeQuery('form', true, 'limit', limit)); queryParams.push(serializeQuery('form', true, 'limit', limit));
} }
const urlEndpoint = '/hubs/search/voice'; const urlEndpoint = '/hubs/search/voice';
const urlParams = queryParams.length > 0 ? `?${encodeURI(queryParams.join('&'))}` : ''; const urlParams = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
const finalUrl = `${this.baseUrl + urlEndpoint}${urlParams}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}${urlParams}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -131,7 +131,7 @@ Results, as well as their containing per-type hubs, contain a `distance` attribu
queryParams.push(serializeQuery('form', true, 'query', query)); queryParams.push(serializeQuery('form', true, 'query', query));
} }
const urlEndpoint = '/search'; const urlEndpoint = '/search';
const finalUrl = `${this.baseUrl + urlEndpoint}?${encodeURI(queryParams.join('&'))}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}?${queryParams.join('&')}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},

View File

@@ -17,21 +17,21 @@ export class SecurityService extends BaseService {
* @param scope `all` - This is the only supported `scope` parameter. * @param scope `all` - This is the only supported `scope` parameter.
* @returns {Promise<any>} - The promise with the result * @returns {Promise<any>} - The promise with the result
*/ */
async getTransientToken(type: SecurityType, scope: Scope): Promise<any> { async getTransientToken(type_: SecurityType, scope: Scope): Promise<any> {
if (type === undefined || scope === undefined) { if (type_ === undefined || scope === undefined) {
throw new Error( throw new Error(
'The following are required parameters: type,scope, cannot be empty or blank', 'The following are required parameters: type_,scope, cannot be empty or blank',
); );
} }
const queryParams: string[] = []; const queryParams: string[] = [];
if (type) { if (type_) {
queryParams.push(serializeQuery('form', true, 'type_', type)); queryParams.push(serializeQuery('form', true, 'type', type_));
} }
if (scope) { if (scope) {
queryParams.push(serializeQuery('form', true, 'scope', scope)); queryParams.push(serializeQuery('form', true, 'scope', scope));
} }
const urlEndpoint = '/security/token'; const urlEndpoint = '/security/token';
const finalUrl = `${this.baseUrl + urlEndpoint}?${encodeURI(queryParams.join('&'))}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}?${queryParams.join('&')}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -65,7 +65,7 @@ Note: requires Plex Media Server >= 1.15.4.
queryParams.push(serializeQuery('form', true, 'source', source)); queryParams.push(serializeQuery('form', true, 'source', source));
} }
const urlEndpoint = '/security/resources'; const urlEndpoint = '/security/resources';
const finalUrl = `${this.baseUrl + urlEndpoint}?${encodeURI(queryParams.join('&'))}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}?${queryParams.join('&')}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},

View File

@@ -22,7 +22,7 @@ export class ServerService extends BaseService {
*/ */
async getServerCapabilities(): Promise<Response<GetServerCapabilitiesResponse>> { async getServerCapabilities(): Promise<Response<GetServerCapabilitiesResponse>> {
const urlEndpoint = '/'; const urlEndpoint = '/';
const finalUrl = `${this.baseUrl + urlEndpoint}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -46,7 +46,7 @@ export class ServerService extends BaseService {
*/ */
async getServerPreferences(): Promise<any> { async getServerPreferences(): Promise<any> {
const urlEndpoint = '/:/prefs'; const urlEndpoint = '/:/prefs';
const finalUrl = `${this.baseUrl + urlEndpoint}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -70,7 +70,7 @@ export class ServerService extends BaseService {
*/ */
async getAvailableClients(): Promise<Response<GetAvailableClientsResponse>> { async getAvailableClients(): Promise<Response<GetAvailableClientsResponse>> {
const urlEndpoint = '/clients'; const urlEndpoint = '/clients';
const finalUrl = `${this.baseUrl + urlEndpoint}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -94,7 +94,7 @@ export class ServerService extends BaseService {
*/ */
async getDevices(): Promise<Response<GetDevicesResponse>> { async getDevices(): Promise<Response<GetDevicesResponse>> {
const urlEndpoint = '/devices'; const urlEndpoint = '/devices';
const finalUrl = `${this.baseUrl + urlEndpoint}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -118,7 +118,7 @@ export class ServerService extends BaseService {
*/ */
async getServerIdentity(): Promise<Response<GetServerIdentityResponse>> { async getServerIdentity(): Promise<Response<GetServerIdentityResponse>> {
const urlEndpoint = '/identity'; const urlEndpoint = '/identity';
const finalUrl = `${this.baseUrl + urlEndpoint}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -142,7 +142,7 @@ export class ServerService extends BaseService {
*/ */
async getMyPlexAccount(): Promise<Response<GetMyPlexAccountResponse>> { async getMyPlexAccount(): Promise<Response<GetMyPlexAccountResponse>> {
const urlEndpoint = '/myplex/account'; const urlEndpoint = '/myplex/account';
const finalUrl = `${this.baseUrl + urlEndpoint}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -217,7 +217,7 @@ export class ServerService extends BaseService {
queryParams.push(serializeQuery('form', true, 'url', url)); queryParams.push(serializeQuery('form', true, 'url', url));
} }
const urlEndpoint = '/photo/:/transcode'; const urlEndpoint = '/photo/:/transcode';
const finalUrl = `${this.baseUrl + urlEndpoint}?${encodeURI(queryParams.join('&'))}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}?${queryParams.join('&')}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -241,7 +241,7 @@ export class ServerService extends BaseService {
*/ */
async getServerList(): Promise<Response<GetServerListResponse>> { async getServerList(): Promise<Response<GetServerListResponse>> {
const urlEndpoint = '/servers'; const urlEndpoint = '/servers';
const finalUrl = `${this.baseUrl + urlEndpoint}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},

View File

@@ -15,7 +15,7 @@ export class SessionsService extends BaseService {
*/ */
async getSessions(): Promise<any> { async getSessions(): Promise<any> {
const urlEndpoint = '/status/sessions'; const urlEndpoint = '/status/sessions';
const finalUrl = `${this.baseUrl + urlEndpoint}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -39,7 +39,7 @@ export class SessionsService extends BaseService {
*/ */
async getSessionHistory(): Promise<any> { async getSessionHistory(): Promise<any> {
const urlEndpoint = '/status/sessions/history/all'; const urlEndpoint = '/status/sessions/history/all';
const finalUrl = `${this.baseUrl + urlEndpoint}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -63,7 +63,7 @@ export class SessionsService extends BaseService {
*/ */
async getTranscodeSessions(): Promise<Response<GetTranscodeSessionsResponse>> { async getTranscodeSessions(): Promise<Response<GetTranscodeSessionsResponse>> {
const urlEndpoint = '/transcode/sessions'; const urlEndpoint = '/transcode/sessions';
const finalUrl = `${this.baseUrl + urlEndpoint}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -93,9 +93,9 @@ export class SessionsService extends BaseService {
let urlEndpoint = '/transcode/sessions/{sessionKey}'; let urlEndpoint = '/transcode/sessions/{sessionKey}';
urlEndpoint = urlEndpoint.replace( urlEndpoint = urlEndpoint.replace(
'{sessionKey}', '{sessionKey}',
encodeURIComponent(serializePath('simple', false, sessionKey, undefined)), serializePath('simple', false, sessionKey, undefined),
); );
const finalUrl = `${this.baseUrl + urlEndpoint}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const response: any = await this.httpClient.delete( const response: any = await this.httpClient.delete(
finalUrl, finalUrl,
{}, {},

View File

@@ -17,7 +17,7 @@ export class UpdaterService extends BaseService {
*/ */
async getUpdateStatus(): Promise<any> { async getUpdateStatus(): Promise<any> {
const urlEndpoint = '/updater/status'; const urlEndpoint = '/updater/status';
const finalUrl = `${this.baseUrl + urlEndpoint}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -49,8 +49,8 @@ export class UpdaterService extends BaseService {
queryParams.push(serializeQuery('form', true, 'download', download)); queryParams.push(serializeQuery('form', true, 'download', download));
} }
const urlEndpoint = '/updater/check'; const urlEndpoint = '/updater/check';
const urlParams = queryParams.length > 0 ? `?${encodeURI(queryParams.join('&'))}` : ''; const urlParams = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
const finalUrl = `${this.baseUrl + urlEndpoint}${urlParams}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}${urlParams}`);
const response: any = await this.httpClient.put( const response: any = await this.httpClient.put(
finalUrl, finalUrl,
{ download }, { download },
@@ -87,8 +87,8 @@ export class UpdaterService extends BaseService {
queryParams.push(serializeQuery('form', true, 'skip', skip)); queryParams.push(serializeQuery('form', true, 'skip', skip));
} }
const urlEndpoint = '/updater/apply'; const urlEndpoint = '/updater/apply';
const urlParams = queryParams.length > 0 ? `?${encodeURI(queryParams.join('&'))}` : ''; const urlParams = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
const finalUrl = `${this.baseUrl + urlEndpoint}${urlParams}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}${urlParams}`);
const response: any = await this.httpClient.put( const response: any = await this.httpClient.put(
finalUrl, finalUrl,
{ tonight, skip }, { tonight, skip },

View File

@@ -124,8 +124,8 @@ export class VideoService extends BaseService {
queryParams.push(serializeQuery('form', true, 'autoAdjustQuality', autoAdjustQuality)); queryParams.push(serializeQuery('form', true, 'autoAdjustQuality', autoAdjustQuality));
} }
const urlEndpoint = '/video/:/transcode/universal/start.mpd'; const urlEndpoint = '/video/:/transcode/universal/start.mpd';
const urlParams = queryParams.length > 0 ? `?${encodeURI(queryParams.join('&'))}` : ''; const urlParams = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
const finalUrl = `${this.baseUrl + urlEndpoint}${urlParams}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}${urlParams}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},
@@ -217,7 +217,7 @@ export class VideoService extends BaseService {
queryParams.push(serializeQuery('form', true, 'row', row)); queryParams.push(serializeQuery('form', true, 'row', row));
} }
const urlEndpoint = '/:/timeline'; const urlEndpoint = '/:/timeline';
const finalUrl = `${this.baseUrl + urlEndpoint}?${encodeURI(queryParams.join('&'))}`; const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}?${queryParams.join('&')}`);
const response: any = await this.httpClient.get( const response: any = await this.httpClient.get(
finalUrl, finalUrl,
{}, {},

View File

@@ -31,26 +31,26 @@ describe('test Activities', () => {
describe('test cancelServerActivities', () => { describe('test cancelServerActivities', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.delete('/activities/unde') .delete('/activities/eaque')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.activities return sdk.activities
.cancelServerActivities('unde') .cancelServerActivities('eaque')
.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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.delete('/activities/commodi') .delete('/activities/dolorem')
.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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.delete('/activities/alias') .delete('/activities/corrupti')
.reply(404, { data: {} }); .reply(404, { data: {} });
return expect( return expect(
async () => await sdk.activities.cancelServerActivities('alias'), async () => await sdk.activities.cancelServerActivities('corrupti'),
).rejects.toThrow(); ).rejects.toThrow();
}); });
}); });

View File

@@ -43,13 +43,15 @@ describe('test Butler', () => {
describe('test startTask', () => { describe('test startTask', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.post('/butler/fugiat') .post('/butler/itaque')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.butler.startTask('fugiat').then((r: any) => expect(r.data).toEqual({ data: {} })); return sdk.butler.startTask('itaque').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('http://10.10.10.47:32400').post('/butler/sunt').reply(200, { data: {} }); const scope = nock('http://10.10.10.47:32400')
.post('/butler/officia')
.reply(200, { data: {} });
return expect(async () => await sdk.butler.startTask()).rejects.toThrow(); return expect(async () => await sdk.butler.startTask()).rejects.toThrow();
}); });
@@ -64,21 +66,25 @@ describe('test Butler', () => {
describe('test stopTask', () => { describe('test stopTask', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.delete('/butler/ducimus') .delete('/butler/necessitatibus')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.butler.stopTask('ducimus').then((r: any) => expect(r.data).toEqual({ data: {} })); return sdk.butler
.stopTask('necessitatibus')
.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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.delete('/butler/veniam') .delete('/butler/adipisci')
.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('http://10.10.10.47:32400').delete('/butler/in').reply(404, { data: {} }); const scope = nock('http://10.10.10.47:32400')
return expect(async () => await sdk.butler.stopTask('in')).rejects.toThrow(); .delete('/butler/veritatis')
.reply(404, { data: {} });
return expect(async () => await sdk.butler.stopTask('veritatis')).rejects.toThrow();
}); });
}); });
}); });

View File

@@ -22,10 +22,10 @@ describe('test Hubs', () => {
describe('test getGlobalHubs', () => { describe('test getGlobalHubs', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/hubs?count=3&onlyTransient=9') .get('/hubs?count=3&onlyTransient=6')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.hubs return sdk.hubs
.getGlobalHubs({ count: 3, onlyTransient: 9 }) .getGlobalHubs({ count: 3, onlyTransient: 6 })
.then((r: any) => expect(r.data).toEqual({ data: {} })); .then((r: any) => expect(r.data).toEqual({ data: {} }));
}); });
}); });
@@ -33,26 +33,26 @@ describe('test Hubs', () => {
describe('test getLibraryHubs', () => { describe('test getLibraryHubs', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/hubs/sections/6?count=1&onlyTransient=7') .get('/hubs/sections/6?count=5&onlyTransient=2')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.hubs return sdk.hubs
.getLibraryHubs(6, { count: 1, onlyTransient: 7 }) .getLibraryHubs(6, { count: 5, onlyTransient: 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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/hubs/sections/3?count=2&onlyTransient=4') .get('/hubs/sections/2?count=4&onlyTransient=1')
.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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/hubs/sections/4?count=3&onlyTransient=9') .get('/hubs/sections/8?count=9&onlyTransient=7')
.reply(404, { data: {} }); .reply(404, { data: {} });
return expect( return expect(
async () => await sdk.hubs.getLibraryHubs(4, { count: 3, onlyTransient: 9 }), async () => await sdk.hubs.getLibraryHubs(8, { count: 9, onlyTransient: 7 }),
).rejects.toThrow(); ).rejects.toThrow();
}); });
}); });

View File

@@ -22,26 +22,26 @@ describe('test Library', () => {
describe('test getFileHash', () => { describe('test getFileHash', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/library/hashes?url=error&type_=1') .get('/library/hashes?url=sequi&type=2')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.library return sdk.library
.getFileHash('error', { type: 1 }) .getFileHash('sequi', { type_: 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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/library/hashes?url=soluta&type_=8') .get('/library/hashes?url=voluptatum&type=2')
.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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/library/hashes?url=veritatis&type_=9') .get('/library/hashes?url=officiis&type=7')
.reply(404, { data: {} }); .reply(404, { data: {} });
return expect( return expect(
async () => await sdk.library.getFileHash('veritatis', { type: 9 }), async () => await sdk.library.getFileHash('officiis', { type_: 7 }),
).rejects.toThrow(); ).rejects.toThrow();
}); });
}); });
@@ -67,26 +67,26 @@ describe('test Library', () => {
describe('test getLibrary', () => { describe('test getLibrary', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/library/sections/6?includeDetails=7') .get('/library/sections/1?includeDetails=4')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.library return sdk.library
.getLibrary(6, { includeDetails: 7 }) .getLibrary(1, { includeDetails: 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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/library/sections/2?includeDetails=4') .get('/library/sections/3?includeDetails=2')
.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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/library/sections/1?includeDetails=4') .get('/library/sections/7?includeDetails=6')
.reply(404, { data: {} }); .reply(404, { data: {} });
return expect( return expect(
async () => await sdk.library.getLibrary(1, { includeDetails: 4 }), async () => await sdk.library.getLibrary(7, { includeDetails: 6 }),
).rejects.toThrow(); ).rejects.toThrow();
}); });
}); });
@@ -94,9 +94,9 @@ describe('test Library', () => {
describe('test deleteLibrary', () => { describe('test deleteLibrary', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.delete('/library/sections/9') .delete('/library/sections/4')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.library.deleteLibrary(9).then((r: any) => expect(r.data).toEqual({ data: {} })); return sdk.library.deleteLibrary(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', () => {
@@ -108,35 +108,35 @@ describe('test Library', () => {
test('test will throw error on a non-200 response', () => { test('test will throw error on a non-200 response', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.delete('/library/sections/2') .delete('/library/sections/5')
.reply(404, { data: {} }); .reply(404, { data: {} });
return expect(async () => await sdk.library.deleteLibrary(2)).rejects.toThrow(); return expect(async () => await sdk.library.deleteLibrary(5)).rejects.toThrow();
}); });
}); });
describe('test getLibraryItems', () => { describe('test getLibraryItems', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/library/sections/4/all?type_=9&filter=porro') .get('/library/sections/3/all?type=3&filter=accusamus')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.library return sdk.library
.getLibraryItems(4, { type: 9, filter: 'porro' }) .getLibraryItems(3, { type_: 3, filter: 'accusamus' })
.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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/library/sections/1/all?type_=8&filter=pariatur') .get('/library/sections/6/all?type=7&filter=fuga')
.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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/library/sections/3/all?type_=1&filter=nostrum') .get('/library/sections/5/all?type=9&filter=maiores')
.reply(404, { data: {} }); .reply(404, { data: {} });
return expect( return expect(
async () => await sdk.library.getLibraryItems(3, { type: 1, filter: 'nostrum' }), async () => await sdk.library.getLibraryItems(5, { type_: 9, filter: 'maiores' }),
).rejects.toThrow(); ).rejects.toThrow();
}); });
}); });
@@ -144,49 +144,49 @@ describe('test Library', () => {
describe('test refreshLibrary', () => { describe('test refreshLibrary', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/library/sections/6/refresh') .get('/library/sections/5/refresh')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.library.refreshLibrary(6).then((r: any) => expect(r.data).toEqual({ data: {} })); return sdk.library.refreshLibrary(5).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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/library/sections/3/refresh') .get('/library/sections/7/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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/library/sections/3/refresh') .get('/library/sections/5/refresh')
.reply(404, { data: {} }); .reply(404, { data: {} });
return expect(async () => await sdk.library.refreshLibrary(3)).rejects.toThrow(); return expect(async () => await sdk.library.refreshLibrary(5)).rejects.toThrow();
}); });
}); });
describe('test getLatestLibraryItems', () => { describe('test getLatestLibraryItems', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/library/sections/2/latest?type_=7&filter=ipsa') .get('/library/sections/2/latest?type=3&filter=explicabo')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.library return sdk.library
.getLatestLibraryItems(2, 7, { filter: 'ipsa' }) .getLatestLibraryItems(2, 3, { filter: 'explicabo' })
.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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/library/sections/3/latest?type_=4&filter=consectetur') .get('/library/sections/5/latest?type=2&filter=adipisci')
.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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/library/sections/3/latest?type_=9&filter=aliquam') .get('/library/sections/6/latest?type=5&filter=minus')
.reply(404, { data: {} }); .reply(404, { data: {} });
return expect( return expect(
async () => await sdk.library.getLatestLibraryItems(3, 9, { filter: 'aliquam' }), async () => await sdk.library.getLatestLibraryItems(6, 5, { filter: 'minus' }),
).rejects.toThrow(); ).rejects.toThrow();
}); });
}); });
@@ -194,26 +194,26 @@ describe('test Library', () => {
describe('test getCommonLibraryItems', () => { describe('test getCommonLibraryItems', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/library/sections/2/common?type_=7&filter=doloribus') .get('/library/sections/7/common?type=1&filter=eveniet')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.library return sdk.library
.getCommonLibraryItems(2, 7, { filter: 'doloribus' }) .getCommonLibraryItems(7, 1, { filter: 'eveniet' })
.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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/library/sections/9/common?type_=2&filter=illum') .get('/library/sections/1/common?type=7&filter=voluptatibus')
.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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/library/sections/8/common?type_=7&filter=nesciunt') .get('/library/sections/8/common?type=1&filter=soluta')
.reply(404, { data: {} }); .reply(404, { data: {} });
return expect( return expect(
async () => await sdk.library.getCommonLibraryItems(8, 7, { filter: 'nesciunt' }), async () => await sdk.library.getCommonLibraryItems(8, 1, { filter: 'soluta' }),
).rejects.toThrow(); ).rejects.toThrow();
}); });
}); });
@@ -221,48 +221,48 @@ describe('test Library', () => {
describe('test getMetadata', () => { describe('test getMetadata', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/library/metadata/7') .get('/library/metadata/4')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.library.getMetadata(7).then((r: any) => expect(r.data).toEqual({ data: {} })); return sdk.library.getMetadata(4).then((r: any) => expect(r.data).toEqual({ data: {} }));
}); });
test('test will throw error if required fields missing', () => { test('test will throw error if required fields missing', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/library/metadata/8') .get('/library/metadata/6')
.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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/library/metadata/9') .get('/library/metadata/4')
.reply(404, { data: {} }); .reply(404, { data: {} });
return expect(async () => await sdk.library.getMetadata(9)).rejects.toThrow(); return expect(async () => await sdk.library.getMetadata(4)).rejects.toThrow();
}); });
}); });
describe('test getMetadataChildren', () => { describe('test getMetadataChildren', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/library/metadata/4/children') .get('/library/metadata/8/children')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.library return sdk.library
.getMetadataChildren(4) .getMetadataChildren(8)
.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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/library/metadata/3/children') .get('/library/metadata/4/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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/library/metadata/4/children') .get('/library/metadata/2/children')
.reply(404, { data: {} }); .reply(404, { data: {} });
return expect(async () => await sdk.library.getMetadataChildren(4)).rejects.toThrow(); return expect(async () => await sdk.library.getMetadataChildren(2)).rejects.toThrow();
}); });
}); });

View File

@@ -22,27 +22,25 @@ describe('test Log', () => {
describe('test logLine', () => { describe('test logLine', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/log?level=2&message=laudantium&source=assumenda') .get('/log?level=4&message=libero&source=delectus')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.log return sdk.log
.logLine(2, 'laudantium', 'assumenda') .logLine(4, 'libero', 'delectus')
.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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/log?level=9&message=ex&source=doloribus') .get('/log?level=4&message=doloribus&source=alias')
.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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/log?level=6&message=repudiandae&source=perspiciatis') .get('/log?level=8&message=itaque&source=iste')
.reply(404, { data: {} }); .reply(404, { data: {} });
return expect( return expect(async () => await sdk.log.logLine(8, 'itaque', 'iste')).rejects.toThrow();
async () => await sdk.log.logLine(6, 'repudiandae', 'perspiciatis'),
).rejects.toThrow();
}); });
}); });

View File

@@ -22,72 +22,72 @@ describe('test Media', () => {
describe('test markPlayed', () => { describe('test markPlayed', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/:/scrobble?key=1') .get('/:/scrobble?key=9')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.media.markPlayed(1).then((r: any) => expect(r.data).toEqual({ data: {} })); return sdk.media.markPlayed(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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/:/scrobble?key=1') .get('/:/scrobble?key=9')
.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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/:/scrobble?key=1') .get('/:/scrobble?key=2')
.reply(404, { data: {} }); .reply(404, { data: {} });
return expect(async () => await sdk.media.markPlayed(1)).rejects.toThrow(); return expect(async () => await sdk.media.markPlayed(2)).rejects.toThrow();
}); });
}); });
describe('test markUnplayed', () => { describe('test markUnplayed', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/:/unscrobble?key=1') .get('/:/unscrobble?key=6')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.media.markUnplayed(1).then((r: any) => expect(r.data).toEqual({ data: {} })); return sdk.media.markUnplayed(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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/:/unscrobble?key=6') .get('/:/unscrobble?key=5')
.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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/:/unscrobble?key=9') .get('/:/unscrobble?key=2')
.reply(404, { data: {} }); .reply(404, { data: {} });
return expect(async () => await sdk.media.markUnplayed(9)).rejects.toThrow(); return expect(async () => await sdk.media.markUnplayed(2)).rejects.toThrow();
}); });
}); });
describe('test updatePlayProgress', () => { describe('test updatePlayProgress', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.post('/:/progress?key=inventore&time=5&state=dolor') .post('/:/progress?key=minus&time=6&state=consequuntur')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.media return sdk.media
.updatePlayProgress('inventore', 5, 'dolor') .updatePlayProgress('minus', 6, 'consequuntur')
.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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.post('/:/progress?key=officia&time=6&state=laboriosam') .post('/:/progress?key=excepturi&time=1&state=pariatur')
.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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.post('/:/progress?key=illum&time=8&state=nostrum') .post('/:/progress?key=dolores&time=6&state=reiciendis')
.reply(404, { data: {} }); .reply(404, { data: {} });
return expect( return expect(
async () => await sdk.media.updatePlayProgress('illum', 8, 'nostrum'), async () => await sdk.media.updatePlayProgress('dolores', 6, 'reiciendis'),
).rejects.toThrow(); ).rejects.toThrow();
}); });
}); });

View File

@@ -22,29 +22,29 @@ describe('test Playlists', () => {
describe('test createPlaylist', () => { describe('test createPlaylist', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.post('/playlists?title=porro&type_=fugiat&smart=9&uri=nihil&playQueueID=6') .post('/playlists?title=non&type=autem&smart=9&uri=ea&playQueueID=5')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.playlists return sdk.playlists
.createPlaylist('porro', 'fugiat', 9, { uri: 'nihil', playQueueID: 6 }) .createPlaylist('non', 'autem', 9, { uri: 'ea', playQueueID: 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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.post('/playlists?title=perspiciatis&type_=maxime&smart=7&uri=minima&playQueueID=7') .post('/playlists?title=ullam&type=similique&smart=1&uri=numquam&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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.post('/playlists?title=nam&type_=excepturi&smart=9&uri=iusto&playQueueID=5') .post('/playlists?title=quis&type=inventore&smart=4&uri=facere&playQueueID=7')
.reply(404, { data: {} }); .reply(404, { data: {} });
return expect( return expect(
async () => async () =>
await sdk.playlists.createPlaylist('nam', 'excepturi', 9, { await sdk.playlists.createPlaylist('quis', 'inventore', 4, {
uri: 'iusto', uri: 'facere',
playQueueID: 5, playQueueID: 7,
}), }),
).rejects.toThrow(); ).rejects.toThrow();
}); });
@@ -53,119 +53,119 @@ describe('test Playlists', () => {
describe('test getPlaylists', () => { describe('test getPlaylists', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/playlists/all?playlistType=eveniet&smart=9') .get('/playlists/all?playlistType=laborum&smart=2')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.playlists return sdk.playlists
.getPlaylists({ playlistType: 'eveniet', smart: 9 }) .getPlaylists({ playlistType: 'laborum', smart: 2 })
.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('http://10.10.10.47:32400').get('/playlists/4').reply(200, { data: {} }); const scope = nock('http://10.10.10.47:32400').get('/playlists/8').reply(200, { data: {} });
return sdk.playlists.getPlaylist(4).then((r: any) => expect(r.data).toEqual({ data: {} })); return sdk.playlists.getPlaylist(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('http://10.10.10.47:32400').get('/playlists/4').reply(200, { data: {} }); const scope = nock('http://10.10.10.47:32400').get('/playlists/6').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('http://10.10.10.47:32400').get('/playlists/1').reply(404, { data: {} }); const scope = nock('http://10.10.10.47:32400').get('/playlists/6').reply(404, { data: {} });
return expect(async () => await sdk.playlists.getPlaylist(1)).rejects.toThrow(); return expect(async () => await sdk.playlists.getPlaylist(6)).rejects.toThrow();
}); });
}); });
describe('test updatePlaylist', () => { describe('test updatePlaylist', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400').put('/playlists/3').reply(200, { data: {} }); const scope = nock('http://10.10.10.47:32400').put('/playlists/6').reply(200, { data: {} });
return sdk.playlists.updatePlaylist(3).then((r: any) => expect(r.data).toEqual({ data: {} })); return sdk.playlists.updatePlaylist(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('http://10.10.10.47:32400').put('/playlists/6').reply(200, { data: {} }); const scope = nock('http://10.10.10.47:32400').put('/playlists/1').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('http://10.10.10.47:32400').put('/playlists/4').reply(404, { data: {} }); const scope = nock('http://10.10.10.47:32400').put('/playlists/8').reply(404, { data: {} });
return expect(async () => await sdk.playlists.updatePlaylist(4)).rejects.toThrow(); return expect(async () => await sdk.playlists.updatePlaylist(8)).rejects.toThrow();
}); });
}); });
describe('test deletePlaylist', () => { describe('test deletePlaylist', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.delete('/playlists/8') .delete('/playlists/2')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.playlists.deletePlaylist(8).then((r: any) => expect(r.data).toEqual({ data: {} })); return sdk.playlists.deletePlaylist(2).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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.delete('/playlists/9') .delete('/playlists/2')
.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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.delete('/playlists/1') .delete('/playlists/4')
.reply(404, { data: {} }); .reply(404, { data: {} });
return expect(async () => await sdk.playlists.deletePlaylist(1)).rejects.toThrow(); return expect(async () => await sdk.playlists.deletePlaylist(4)).rejects.toThrow();
}); });
}); });
describe('test getPlaylistContents', () => { describe('test getPlaylistContents', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/playlists/5/items?type_=1') .get('/playlists/7/items?type=1')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.playlists return sdk.playlists
.getPlaylistContents(5, 1) .getPlaylistContents(7, 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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/playlists/2/items?type_=7') .get('/playlists/9/items?type=3')
.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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/playlists/9/items?type_=2') .get('/playlists/8/items?type=9')
.reply(404, { data: {} }); .reply(404, { data: {} });
return expect(async () => await sdk.playlists.getPlaylistContents(9, 2)).rejects.toThrow(); return expect(async () => await sdk.playlists.getPlaylistContents(8, 9)).rejects.toThrow();
}); });
}); });
describe('test addPlaylistContents', () => { describe('test addPlaylistContents', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.put('/playlists/4/items?uri=veniam&playQueueID=1') .put('/playlists/8/items?uri=amet&playQueueID=2')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.playlists return sdk.playlists
.addPlaylistContents(4, 'veniam', 1) .addPlaylistContents(8, 'amet', 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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.put('/playlists/1/items?uri=similique&playQueueID=9') .put('/playlists/9/items?uri=id&playQueueID=6')
.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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.put('/playlists/5/items?uri=similique&playQueueID=8') .put('/playlists/5/items?uri=ea&playQueueID=1')
.reply(404, { data: {} }); .reply(404, { data: {} });
return expect( return expect(
async () => await sdk.playlists.addPlaylistContents(5, 'similique', 8), async () => await sdk.playlists.addPlaylistContents(5, 'ea', 1),
).rejects.toThrow(); ).rejects.toThrow();
}); });
}); });
@@ -173,50 +173,52 @@ describe('test Playlists', () => {
describe('test clearPlaylistContents', () => { describe('test clearPlaylistContents', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.delete('/playlists/1/items') .delete('/playlists/3/items')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.playlists return sdk.playlists
.clearPlaylistContents(1) .clearPlaylistContents(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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.delete('/playlists/9/items') .delete('/playlists/6/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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.delete('/playlists/5/items') .delete('/playlists/4/items')
.reply(404, { data: {} }); .reply(404, { data: {} });
return expect(async () => await sdk.playlists.clearPlaylistContents(5)).rejects.toThrow(); return expect(async () => await sdk.playlists.clearPlaylistContents(4)).rejects.toThrow();
}); });
}); });
describe('test uploadPlaylist', () => { describe('test uploadPlaylist', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.post('/playlists/upload?path=a&force=5') .post('/playlists/upload?path=minus&force=7')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.playlists return sdk.playlists
.uploadPlaylist('a', 5) .uploadPlaylist('minus', 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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.post('/playlists/upload?path=facere&force=6') .post('/playlists/upload?path=non&force=5')
.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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.post('/playlists/upload?path=animi&force=5') .post('/playlists/upload?path=similique&force=8')
.reply(404, { data: {} }); .reply(404, { data: {} });
return expect(async () => await sdk.playlists.uploadPlaylist('animi', 5)).rejects.toThrow(); return expect(
async () => await sdk.playlists.uploadPlaylist('similique', 8),
).rejects.toThrow();
}); });
}); });
}); });

View File

@@ -22,26 +22,26 @@ describe('test Search', () => {
describe('test performSearch', () => { describe('test performSearch', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/hubs/search?query=fugiat&sectionId=1&limit=3') .get('/hubs/search?query=id&sectionId=6&limit=5')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.search return sdk.search
.performSearch('fugiat', { sectionId: 1, limit: 3 }) .performSearch('id', { sectionId: 6, limit: 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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/hubs/search?query=ipsam&sectionId=7&limit=2') .get('/hubs/search?query=officia&sectionId=1&limit=8')
.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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/hubs/search?query=quibusdam&sectionId=1&limit=6') .get('/hubs/search?query=exercitationem&sectionId=4&limit=4')
.reply(404, { data: {} }); .reply(404, { data: {} });
return expect( return expect(
async () => await sdk.search.performSearch('quibusdam', { sectionId: 1, limit: 6 }), async () => await sdk.search.performSearch('exercitationem', { sectionId: 4, limit: 4 }),
).rejects.toThrow(); ).rejects.toThrow();
}); });
}); });
@@ -49,26 +49,26 @@ describe('test Search', () => {
describe('test performVoiceSearch', () => { describe('test performVoiceSearch', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/hubs/search/voice?query=animi&sectionId=7&limit=1') .get('/hubs/search/voice?query=odit&sectionId=8&limit=5')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.search return sdk.search
.performVoiceSearch('animi', { sectionId: 7, limit: 1 }) .performVoiceSearch('odit', { sectionId: 8, limit: 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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/hubs/search/voice?query=quae&sectionId=6&limit=3') .get('/hubs/search/voice?query=vel&sectionId=1&limit=2')
.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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/hubs/search/voice?query=aspernatur&sectionId=5&limit=8') .get('/hubs/search/voice?query=minima&sectionId=7&limit=4')
.reply(404, { data: {} }); .reply(404, { data: {} });
return expect( return expect(
async () => await sdk.search.performVoiceSearch('aspernatur', { sectionId: 5, limit: 8 }), async () => await sdk.search.performVoiceSearch('minima', { sectionId: 7, limit: 4 }),
).rejects.toThrow(); ).rejects.toThrow();
}); });
}); });
@@ -76,10 +76,10 @@ describe('test Search', () => {
describe('test getSearchResults', () => { describe('test getSearchResults', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/search?query=doloremque') .get('/search?query=tenetur')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.search return sdk.search
.getSearchResults('doloremque') .getSearchResults('tenetur')
.then((r: any) => expect(r.data).toEqual({ data: {} })); .then((r: any) => expect(r.data).toEqual({ data: {} }));
}); });
@@ -92,9 +92,9 @@ describe('test Search', () => {
test('test will throw error on a non-200 response', () => { test('test will throw error on a non-200 response', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/search?query=placeat') .get('/search?query=sequi')
.reply(404, { data: {} }); .reply(404, { data: {} });
return expect(async () => await sdk.search.getSearchResults('placeat')).rejects.toThrow(); return expect(async () => await sdk.search.getSearchResults('sequi')).rejects.toThrow();
}); });
}); });
}); });

View File

@@ -22,26 +22,26 @@ describe('test Security', () => {
describe('test getTransientToken', () => { describe('test getTransientToken', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/security/token?type_=odit&scope=inventore') .get('/security/token?type=eaque&scope=commodi')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.security return sdk.security
.getTransientToken('odit', 'inventore') .getTransientToken('eaque', 'commodi')
.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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/security/token?type_=consequatur&scope=consectetur') .get('/security/token?type=ipsa&scope=laboriosam')
.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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/security/token?type_=consequatur&scope=delectus') .get('/security/token?type=cum&scope=qui')
.reply(404, { data: {} }); .reply(404, { data: {} });
return expect( return expect(
async () => await sdk.security.getTransientToken('consequatur', 'delectus'), async () => await sdk.security.getTransientToken('cum', 'qui'),
).rejects.toThrow(); ).rejects.toThrow();
}); });
}); });
@@ -49,16 +49,16 @@ describe('test Security', () => {
describe('test getSourceConnectionInformation', () => { describe('test getSourceConnectionInformation', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/security/resources?source=ab') .get('/security/resources?source=tempora')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.security return sdk.security
.getSourceConnectionInformation('ab') .getSourceConnectionInformation('tempora')
.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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/security/resources?source=pariatur') .get('/security/resources?source=temporibus')
.reply(200, { data: {} }); .reply(200, { data: {} });
return expect( return expect(
async () => await sdk.security.getSourceConnectionInformation(), async () => await sdk.security.getSourceConnectionInformation(),
@@ -67,10 +67,10 @@ 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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get('/security/resources?source=consectetur') .get('/security/resources?source=deleniti')
.reply(404, { data: {} }); .reply(404, { data: {} });
return expect( return expect(
async () => await sdk.security.getSourceConnectionInformation('consectetur'), async () => await sdk.security.getSourceConnectionInformation('deleniti'),
).rejects.toThrow(); ).rejects.toThrow();
}); });
}); });

View File

@@ -73,18 +73,18 @@ describe('test Server', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get( .get(
'/photo/:/transcode?width=4529130729&height=5&opacity=1&blur=5&minSize=5&upscale=4&url=corrupti', '/photo/:/transcode?width=4812092983&height=7&opacity=4&blur=3&minSize=7&upscale=5&url=eius',
) )
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.server return sdk.server
.getResizedPhoto(4529130729, 5, 1, 5, 5, 4, 'corrupti') .getResizedPhoto(4812092983, 7, 4, 3, 7, 5, 'eius')
.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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get( .get(
'/photo/:/transcode?width=7748286048&height=7&opacity=2&blur=8&minSize=6&upscale=6&url=accusantium', '/photo/:/transcode?width=4674351221&height=8&opacity=1&blur=3&minSize=2&upscale=3&url=hic',
) )
.reply(200, { data: {} }); .reply(200, { data: {} });
return expect(async () => await sdk.server.getResizedPhoto()).rejects.toThrow(); return expect(async () => await sdk.server.getResizedPhoto()).rejects.toThrow();
@@ -93,11 +93,11 @@ describe('test Server', () => {
test('test will throw error on a non-200 response', () => { test('test will throw error on a non-200 response', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get( .get(
'/photo/:/transcode?width=8905574180&height=3&opacity=3&blur=7&minSize=5&upscale=8&url=optio', '/photo/:/transcode?width=2192802438&height=6&opacity=7&blur=1&minSize=9&upscale=5&url=commodi',
) )
.reply(404, { data: {} }); .reply(404, { data: {} });
return expect( return expect(
async () => await sdk.server.getResizedPhoto(8905574180, 3, 3, 7, 5, 8, 'optio'), async () => await sdk.server.getResizedPhoto(2192802438, 6, 7, 1, 9, 5, 'commodi'),
).rejects.toThrow(); ).rejects.toThrow();
}); });
}); });

View File

@@ -53,26 +53,26 @@ describe('test Sessions', () => {
describe('test stopTranscodeSession', () => { describe('test stopTranscodeSession', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.delete('/transcode/sessions/odit') .delete('/transcode/sessions/et')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.sessions return sdk.sessions
.stopTranscodeSession('odit') .stopTranscodeSession('et')
.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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.delete('/transcode/sessions/porro') .delete('/transcode/sessions/ipsam')
.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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.delete('/transcode/sessions/minima') .delete('/transcode/sessions/voluptas')
.reply(404, { data: {} }); .reply(404, { data: {} });
return expect( return expect(
async () => await sdk.sessions.stopTranscodeSession('minima'), async () => await sdk.sessions.stopTranscodeSession('voluptas'),
).rejects.toThrow(); ).rejects.toThrow();
}); });
}); });

View File

@@ -31,10 +31,10 @@ describe('test Updater', () => {
describe('test checkForUpdates', () => { describe('test checkForUpdates', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.put('/updater/check?download=foo') .put('/updater/check?download=3')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.updater return sdk.updater
.checkForUpdates({ download: 'foo' }) .checkForUpdates({ download: 3 })
.then((r: any) => expect(r.data).toEqual({ data: {} })); .then((r: any) => expect(r.data).toEqual({ data: {} }));
}); });
}); });
@@ -42,10 +42,10 @@ describe('test Updater', () => {
describe('test applyUpdates', () => { describe('test applyUpdates', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.put('/updater/apply?tonight=foo&skip=foo') .put('/updater/apply?tonight=8&skip=2')
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.updater return sdk.updater
.applyUpdates({ tonight: 'foo', skip: 'foo' }) .applyUpdates({ tonight: 8, skip: 2 })
.then((r: any) => expect(r.data).toEqual({ data: {} })); .then((r: any) => expect(r.data).toEqual({ data: {} }));
}); });
}); });

View File

@@ -23,22 +23,22 @@ describe('test Video', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get( .get(
'/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', '/video/:/transcode/universal/start.mpd?hasMDE=2&path=eveniet&mediaIndex=3&partIndex=9&protocol=accusamus&fastSeek=8&directPlay=6&directStream=3&subtitleSize=4&subtites=cupiditate&audioBoost=7&location=nam&mediaBufferSize=1&session=corrupti&addDebugOverlay=4&autoAdjustQuality=5',
) )
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.video return sdk.video
.startUniversalTranscode(2, 'officiis', 8, 2, 'minima', { .startUniversalTranscode(2, 'eveniet', 3, 9, 'accusamus', {
fastSeek: 6, fastSeek: 8,
directPlay: 9, directPlay: 6,
directStream: 3, directStream: 3,
subtitleSize: 8, subtitleSize: 4,
subtites: 'aut', subtites: 'cupiditate',
audioBoost: 5, audioBoost: 7,
location: 'porro', location: 'nam',
mediaBufferSize: 4, mediaBufferSize: 1,
session: 'deserunt', session: 'corrupti',
addDebugOverlay: 4, addDebugOverlay: 4,
autoAdjustQuality: 2, autoAdjustQuality: 5,
}) })
.then((r: any) => expect(r.data).toEqual({ data: {} })); .then((r: any) => expect(r.data).toEqual({ data: {} }));
}); });
@@ -46,7 +46,7 @@ describe('test Video', () => {
test('test will throw error if required fields missing', () => { test('test will throw error if required fields missing', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get( .get(
'/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', '/video/:/transcode/universal/start.mpd?hasMDE=6&path=inventore&mediaIndex=6&partIndex=3&protocol=aliquid&fastSeek=5&directPlay=4&directStream=8&subtitleSize=5&subtites=sed&audioBoost=5&location=optio&mediaBufferSize=6&session=repellat&addDebugOverlay=2&autoAdjustQuality=7',
) )
.reply(200, { data: {} }); .reply(200, { data: {} });
return expect(async () => await sdk.video.startUniversalTranscode()).rejects.toThrow(); return expect(async () => await sdk.video.startUniversalTranscode()).rejects.toThrow();
@@ -55,23 +55,23 @@ describe('test Video', () => {
test('test will throw error on a non-200 response', () => { test('test will throw error on a non-200 response', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get( .get(
'/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', '/video/:/transcode/universal/start.mpd?hasMDE=6&path=fugit&mediaIndex=2&partIndex=1&protocol=iste&fastSeek=2&directPlay=3&directStream=5&subtitleSize=5&subtites=officiis&audioBoost=3&location=alias&mediaBufferSize=9&session=incidunt&addDebugOverlay=3&autoAdjustQuality=9',
) )
.reply(404, { data: {} }); .reply(404, { data: {} });
return expect( return expect(
async () => async () =>
await sdk.video.startUniversalTranscode(8, 'officia', 6, 7, 'hic', { await sdk.video.startUniversalTranscode(6, 'fugit', 2, 1, 'iste', {
fastSeek: 6, fastSeek: 2,
directPlay: 2, directPlay: 3,
directStream: 6, directStream: 5,
subtitleSize: 6, subtitleSize: 5,
subtites: 'veniam', subtites: 'officiis',
audioBoost: 5, audioBoost: 3,
location: 'sunt', location: 'alias',
mediaBufferSize: 5, mediaBufferSize: 9,
session: 'inventore', session: 'incidunt',
addDebugOverlay: 9, addDebugOverlay: 3,
autoAdjustQuality: 5, autoAdjustQuality: 9,
}), }),
).rejects.toThrow(); ).rejects.toThrow();
}); });
@@ -81,29 +81,18 @@ describe('test Video', () => {
test('test api call', () => { test('test api call', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get( .get(
'/:/timeline?ratingKey=3&key=dolor&state=consequatur&hasMDE=8&time=4&duration=7&context=possimusducimusdoloribusnequequibusdam&playQueueItemID=3&playBackTime=5&row=4', '/:/timeline?ratingKey=5&key=sapiente&state=nihil&hasMDE=3&time=4&duration=9&context=illoaliasrerummodiminus&playQueueItemID=3&playBackTime=6&row=7',
) )
.reply(200, { data: {} }); .reply(200, { data: {} });
return sdk.video return sdk.video
.getTimeline( .getTimeline(5, 'sapiente', 'nihil', 3, 4, 9, 'illo alias rerum modi minus', 3, 6, 7)
3,
'dolor',
'consequatur',
8,
4,
7,
'possimus ducimus doloribus neque quibusdam',
3,
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('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get( .get(
'/:/timeline?ratingKey=8&key=cumque&state=earum&hasMDE=3&time=7&duration=2&context=debitisquisquamquaeeasunt&playQueueItemID=3&playBackTime=2&row=2', '/:/timeline?ratingKey=7&key=reiciendis&state=veniam&hasMDE=9&time=5&duration=6&context=quamremeiusremmaiores&playQueueItemID=1&playBackTime=2&row=1',
) )
.reply(200, { data: {} }); .reply(200, { data: {} });
return expect(async () => await sdk.video.getTimeline()).rejects.toThrow(); return expect(async () => await sdk.video.getTimeline()).rejects.toThrow();
@@ -112,21 +101,21 @@ describe('test Video', () => {
test('test will throw error on a non-200 response', () => { test('test will throw error on a non-200 response', () => {
const scope = nock('http://10.10.10.47:32400') const scope = nock('http://10.10.10.47:32400')
.get( .get(
'/:/timeline?ratingKey=6&key=voluptate&state=alias&hasMDE=6&time=3&duration=6&context=assumendaconsequaturaliquidnatussaepe&playQueueItemID=2&playBackTime=9&row=3', '/:/timeline?ratingKey=6&key=quasi&state=natus&hasMDE=6&time=7&duration=4&context=accusamusmollitiaaperiamsequidoloremque&playQueueItemID=4&playBackTime=3&row=3',
) )
.reply(404, { data: {} }); .reply(404, { data: {} });
return expect( return expect(
async () => async () =>
await sdk.video.getTimeline( await sdk.video.getTimeline(
6, 6,
'voluptate', 'quasi',
'alias', 'natus',
6, 6,
7,
4,
'accusamus mollitia aperiam sequi doloremque',
4,
3, 3,
6,
'assumenda consequatur aliquid natus saepe',
2,
9,
3, 3,
), ),
).rejects.toThrow(); ).rejects.toThrow();

View File

@@ -1,6 +1,6 @@
{ {
"extends": "./tsconfig.json", "extends": "./tsconfig.json",
"include": [ "include": [
"./src", "./test" "./src", "./test", "./examples"
] ]
} }