From 6f6f0a1145b0a8e646e176355267544cde9dddc1 Mon Sep 17 00:00:00 2001 From: Luke Hagar Date: Fri, 8 Dec 2023 20:09:12 -0800 Subject: [PATCH] SDK update generated by liblab --- README.md | 108 +++---- package-lock.json | 318 ++++++++++---------- src/http/HTTPLibrary.ts | 2 +- src/index.ts | 12 + src/services/README.md | 108 +++---- src/services/activities/Activities.ts | 6 +- src/services/butler/Butler.ts | 14 +- src/services/hubs/Hubs.ts | 10 +- src/services/library/Library.ts | 86 +++--- src/services/log/Log.ts | 6 +- src/services/media/Media.ts | 6 +- src/services/playlists/Playlists.ts | 56 ++-- src/services/search/Search.ts | 10 +- src/services/security/Security.ts | 14 +- src/services/server/Server.ts | 16 +- src/services/sessions/Sessions.ts | 10 +- src/services/updater/Updater.ts | 10 +- src/services/video/Video.ts | 6 +- test/services/activities/Activities.test.ts | 10 +- test/services/butler/Butler.test.ts | 22 +- test/services/hubs/Hubs.test.ts | 14 +- test/services/library/Library.test.ts | 88 +++--- test/services/log/Log.test.ts | 12 +- test/services/media/Media.test.ts | 30 +- test/services/playlists/Playlists.test.ts | 90 +++--- test/services/search/Search.test.ts | 28 +- test/services/security/Security.test.ts | 20 +- test/services/server/Server.test.ts | 10 +- test/services/sessions/Sessions.test.ts | 10 +- test/services/updater/Updater.test.ts | 8 +- test/services/video/Video.test.ts | 81 +++-- tsconfig.eslint.json | 2 +- 32 files changed, 615 insertions(+), 608 deletions(-) diff --git a/README.md b/README.md index f45aee03..36d2718f 100644 --- a/README.md +++ b/README.md @@ -398,7 +398,7 @@ const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); 110, 165, 100, - 4000, + 20, 1, 1, '/library/metadata/49564/thumb/1654258204', @@ -518,7 +518,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.media.updatePlayProgress('key', 90469787.90055934, 'state'); + const result = await sdk.media.updatePlayProgress('key', 27551608.23429507, 'state'); console.log(result.data); })(); @@ -672,7 +672,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.butler.startTask('GenerateChapterThumbs'); + const result = await sdk.butler.startTask('CleanOldBundles'); console.log(result.data); })(); @@ -736,7 +736,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.hubs.getGlobalHubs({ count: 56455806.18512213, onlyTransient: 1 }); + const result = await sdk.hubs.getGlobalHubs({ count: 85088414.29395235, onlyTransient: 1 }); console.log(result.data); })(); @@ -774,8 +774,8 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.hubs.getLibraryHubs(14224427.485252097, { - count: 59167335.01182026, + const result = await sdk.hubs.getLibraryHubs(1529501.7966160178, { + count: -55107649.72469167, onlyTransient: 1, }); console.log(result.data); @@ -817,7 +817,7 @@ const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { const result = await sdk.search.performSearch('arnold', { - sectionId: 23503236.39517291, + sectionId: -91245133.11936787, limit: 5, }); console.log(result.data); @@ -858,7 +858,7 @@ const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { const result = await sdk.search.performVoiceSearch('dead+poop', { - sectionId: 49725001.21318659, + sectionId: -77985966.3231569, limit: 5, }); 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 | | :-------- | :----------| :----------| -| type | number | Item type | +| type_ | number | Item type | **Return Type** @@ -929,7 +929,7 @@ const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { const result = await sdk.library.getFileHash('file://C:Image.png&type=13', { - type: 57131492.35348597, + type: -83086119.43343997, }); 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 | | :-------- | :----------| :----------| -| type | number | item type | +| type_ | number | item type | | filter | string | the filter parameter | @@ -1081,8 +1081,8 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.library.getLibraryItems(5918142.371238574, { - type: -7809061.492073655, + const result = await sdk.library.getLibraryItems(42026951.633123755, { + type: 35182739.55189258, filter: 'filter', }); console.log(result.data); @@ -1114,7 +1114,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.library.refreshLibrary(96299696.9761284); + const result = await sdk.library.refreshLibrary(40666143.29885453); console.log(result.data); })(); @@ -1130,7 +1130,7 @@ Get Latest Library Items | Name | Type| Description | | :-------- | :----------| :----------| | sectionId | number | the Id of the library to query | -| type | number | item type | +| type_ | number | item type | **Optional Parameters** @@ -1152,7 +1152,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.library.getLatestLibraryItems(92402469.6477915, -96400116.97826156, { + const result = await sdk.library.getLatestLibraryItems(68855255.94976288, -62521069.88462107, { filter: 'filter', }); console.log(result.data); @@ -1170,7 +1170,7 @@ Get Common Library Items | Name | Type| Description | | :-------- | :----------| :----------| | sectionId | number | the Id of the library to query | -| type | number | item type | +| type_ | number | item type | **Optional Parameters** @@ -1192,7 +1192,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.library.getCommonLibraryItems(10111915.895296082, 55224735.92815569, { + const result = await sdk.library.getCommonLibraryItems(-8101546.533601046, -75357740.57515395, { filter: 'filter', }); console.log(result.data); @@ -1224,7 +1224,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.library.getMetadata(62182009.76385683); + const result = await sdk.library.getMetadata(-88656892.93622507); console.log(result.data); })(); @@ -1254,7 +1254,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.library.getMetadataChildren(11669243.106740937); + const result = await sdk.library.getMetadataChildren(-99012349.51775439); console.log(result.data); })(); @@ -1333,7 +1333,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.log.logLine(2, 'message', 'source'); + const result = await sdk.log.logLine(3, 'message', 'source'); console.log(result.data); })(); @@ -1373,7 +1373,7 @@ Create a Playlist | Name | Type| Description | | :-------- | :----------| :----------| | 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 | **Optional Parameters** @@ -1397,9 +1397,9 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.playlists.createPlaylist('title', 'audio', 42, { + const result = await sdk.playlists.createPlaylist('title', 'audio', 1, { uri: 'uri', - playQueueID: -22282333.505305633, + playQueueID: 87381919.3788966, }); console.log(result.data); })(); @@ -1433,7 +1433,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (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); })(); @@ -1463,7 +1463,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.playlists.getPlaylist(25521232.224839047); + const result = await sdk.playlists.getPlaylist(92983670.90558982); console.log(result.data); })(); @@ -1493,7 +1493,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.playlists.deletePlaylist(-60675901.030656695); + const result = await sdk.playlists.deletePlaylist(99606126.8799004); console.log(result.data); })(); @@ -1523,7 +1523,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.playlists.updatePlaylist(65200160.70787519); + const result = await sdk.playlists.updatePlaylist(59306036.18112618); console.log(result.data); })(); @@ -1539,7 +1539,7 @@ Retrieve Playlist Contents | Name | Type| Description | | :-------- | :----------| :----------| | 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 }); (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); })(); @@ -1584,7 +1584,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.playlists.clearPlaylistContents(24703702.974021226); + const result = await sdk.playlists.clearPlaylistContents(14196089.297935858); console.log(result.data); })(); @@ -1616,7 +1616,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.playlists.addPlaylistContents(-3444881.095142722, 'library://..', 123); + const result = await sdk.playlists.addPlaylistContents(72519034.14049211, 'library://..', 123); console.log(result.data); })(); @@ -1663,7 +1663,7 @@ Get a Transient Token. | 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. | @@ -1867,7 +1867,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.updater.checkForUpdates({ download: 'foo' }); + const result = await sdk.updater.checkForUpdates({ download: 1 }); console.log(result.data); })(); @@ -1900,7 +1900,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.updater.applyUpdates({ tonight: 'foo', skip: 1 }); + const result = await sdk.updater.applyUpdates({ tonight: 1, skip: 1 }); console.log(result.data); })(); @@ -1953,23 +1953,23 @@ const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { const result = await sdk.video.startUniversalTranscode( - -87516165.31957072, + 75991865.40406942, 'path', - -62877687.452249065, - -23076170.49337977, + 56663842.10067603, + -67967057.15750742, 'protocol', { - fastSeek: -68282427.87913167, - directPlay: -74000014.76895301, - directStream: 84943482.78212723, - subtitleSize: -55237723.44813809, + fastSeek: -62704400.883238874, + directPlay: 52960718.78090119, + directStream: -94395071.761853, + subtitleSize: 33802925.01619348, subtites: 'subtites', - audioBoost: 29945312.780143052, + audioBoost: 10748580.253260702, location: 'location', - mediaBufferSize: -16516185.759793341, + mediaBufferSize: -46116700.53601071, session: 'session', - addDebugOverlay: -10261279.500832424, - autoAdjustQuality: 32480614.034784466, + addDebugOverlay: -8127838.686531514, + autoAdjustQuality: -52398513.48495814, }, ); console.log(result.data); @@ -2011,16 +2011,16 @@ const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { const result = await sdk.video.getTimeline( - -32608281.350922346, + 46174238.848059, 'key', - 'stopped', - -74699884.18136695, - -66756517.26572518, - -24893130.84645444, + 'paused', + 30544127.328339994, + 93380826.84958789, + -91474715.3910691, 'context', - -75734154.35564606, - -89175857.3275879, - -15877259.38555336, + 15473399.928571522, + 6431628.867009878, + 81455467.98715591, ); console.log(result.data); })(); diff --git a/package-lock.json b/package-lock.json index 1b128c35..8287a0d4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -52,12 +52,12 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", - "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", + "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", "dev": true, "dependencies": { - "@babel/highlight": "^7.22.13", + "@babel/highlight": "^7.23.4", "chalk": "^2.4.2" }, "engines": { @@ -136,30 +136,30 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.23.2", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.2.tgz", - "integrity": "sha512-0S9TQMmDHlqAZ2ITT95irXKfxN9bncq8ZCoJhun3nHL/lLUxd2NKBJYoNGWH7S0hz6fRQwWlAWn/ILM0C70KZQ==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.5.tgz", + "integrity": "sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.23.2", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.2.tgz", - "integrity": "sha512-n7s51eWdaWZ3vGT2tD4T7J6eJs3QoBXydv7vkUM06Bf1cbVD2Kc2UrkzhiQwobfV7NwOnQXYL7UBJ5VPU+RGoQ==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.5.tgz", + "integrity": "sha512-Cwc2XjUrG4ilcfOw4wBAK+enbdgwAcAJCfGUItPBKR7Mjw4aEfAFYrLxeRp4jWgtNIKn3n2AlBOfwwafl+42/g==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.23.0", + "@babel/code-frame": "^7.23.5", + "@babel/generator": "^7.23.5", "@babel/helper-compilation-targets": "^7.22.15", - "@babel/helper-module-transforms": "^7.23.0", - "@babel/helpers": "^7.23.2", - "@babel/parser": "^7.23.0", + "@babel/helper-module-transforms": "^7.23.3", + "@babel/helpers": "^7.23.5", + "@babel/parser": "^7.23.5", "@babel/template": "^7.22.15", - "@babel/traverse": "^7.23.2", - "@babel/types": "^7.23.0", + "@babel/traverse": "^7.23.5", + "@babel/types": "^7.23.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -184,12 +184,12 @@ } }, "node_modules/@babel/generator": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", - "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.5.tgz", + "integrity": "sha512-BPssCHrBD+0YrxviOa3QzpqwhNIXKEtOa2jQrm4FlmkC2apYgRnQcmPWiGZDlGxiNtltnUFolMe8497Esry+jA==", "dev": true, "dependencies": { - "@babel/types": "^7.23.0", + "@babel/types": "^7.23.5", "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" @@ -270,9 +270,9 @@ } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.0.tgz", - "integrity": "sha512-WhDWw1tdrlT0gMgUJSlX0IQvoO1eN279zrAUbVB+KpV2c3Tylz8+GnKOLllCS6Z/iZQEyVYxhZVUdPTqs2YYPw==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz", + "integrity": "sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==", "dev": true, "dependencies": { "@babel/helper-environment-visitor": "^7.22.20", @@ -322,9 +322,9 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", - "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", + "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", "dev": true, "engines": { "node": ">=6.9.0" @@ -340,32 +340,32 @@ } }, "node_modules/@babel/helper-validator-option": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz", - "integrity": "sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz", + "integrity": "sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.23.2", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.2.tgz", - "integrity": "sha512-lzchcp8SjTSVe/fPmLwtWVBFC7+Tbn8LGHDVfDp9JGxpAY5opSaEFgt8UQvrnECWOTdji2mOWMz1rOhkHscmGQ==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.5.tgz", + "integrity": "sha512-oO7us8FzTEsG3U6ag9MfdF1iA/7Z6dz+MtFhifZk8C8o453rGJFFWUP1t+ULM9TUIAzC9uxXEiXjOiVMyd7QPg==", "dev": true, "dependencies": { "@babel/template": "^7.22.15", - "@babel/traverse": "^7.23.2", - "@babel/types": "^7.23.0" + "@babel/traverse": "^7.23.5", + "@babel/types": "^7.23.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", - "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", + "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", "dev": true, "dependencies": { "@babel/helper-validator-identifier": "^7.22.20", @@ -448,9 +448,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", - "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.5.tgz", + "integrity": "sha512-hOOqoiNXrmGdFbhgCzu6GiURxUgM27Xwd/aPuu8RfHEZPBzL1Z54okAHAQjXfcQNwvrlkAmAp4SlRTZ45vlthQ==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -520,9 +520,9 @@ } }, "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz", - "integrity": "sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.23.3.tgz", + "integrity": "sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" @@ -622,9 +622,9 @@ } }, "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz", - "integrity": "sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.23.3.tgz", + "integrity": "sha512-9EiNjVJOMwCO+43TqoTrgQ8jMwcAd0sWyXi9RPfIsLTj4R2MADDDQXELhffaUx/uJv2AYcxBgPwH6j4TIA4ytQ==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" @@ -651,19 +651,19 @@ } }, "node_modules/@babel/traverse": { - "version": "7.23.2", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", - "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.5.tgz", + "integrity": "sha512-czx7Xy5a6sapWWRx61m1Ke1Ra4vczu1mCTtJam5zRTBOonfdJ+S/B6HYmGYu3fJtr8GGET3si6IhgWVBhJ/m8w==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.23.0", + "@babel/code-frame": "^7.23.5", + "@babel/generator": "^7.23.5", "@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-function-name": "^7.23.0", "@babel/helper-hoist-variables": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.23.0", - "@babel/types": "^7.23.0", + "@babel/parser": "^7.23.5", + "@babel/types": "^7.23.5", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -681,12 +681,12 @@ } }, "node_modules/@babel/types": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", - "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.5.tgz", + "integrity": "sha512-ON5kSOJwVO6xXVRTvOI0eOnWe7VdUcIpsovGo9U/Br4Ie4UVFQTboO2cYnDhAGU6Fp+UxSiT+pMft0SMHfuq6w==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-string-parser": "^7.23.4", "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" }, @@ -725,9 +725,9 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.2.tgz", - "integrity": "sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "dev": true, "dependencies": { "ajv": "^6.12.4", @@ -748,9 +748,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.52.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.52.0.tgz", - "integrity": "sha512-mjZVbpaeMZludF2fsWLD0Z9gCref1Tk4i9+wddjRvpUNqqcndPkBD09N/Mapey0b3jaXbLm2kICwFv2E64QinA==", + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.55.0.tgz", + "integrity": "sha512-qQfo2mxH5yVom1kacMtZZJFVdW+E70mqHMJvVg6WTLo+VBuQJ4TojZlfWBjK0ve5BdEeNAVxOsl/nvNMpJOaJA==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1283,9 +1283,9 @@ } }, "node_modules/@types/babel__core": { - "version": "7.20.3", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.3.tgz", - "integrity": "sha512-54fjTSeSHwfan8AyHWrKbfBWiEUrNTZsUwPTDSNaaP1QDQIZbeNUg3a59E9D+375MzUw/x1vx2/0F5LBz+AeYA==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", "dev": true, "dependencies": { "@babel/parser": "^7.20.7", @@ -1296,18 +1296,18 @@ } }, "node_modules/@types/babel__generator": { - "version": "7.6.6", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.6.tgz", - "integrity": "sha512-66BXMKb/sUWbMdBNdMvajU7i/44RkrA3z/Yt1c7R5xejt8qh84iU54yUWCtm0QwGJlDcf/gg4zd/x4mpLAlb/w==", + "version": "7.6.7", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.7.tgz", + "integrity": "sha512-6Sfsq+EaaLrw4RmdFWE9Onp63TOUue71AWb4Gpa6JxzgTYtimbM086WnYTy2U67AofR++QKCo08ZP6pwx8YFHQ==", "dev": true, "dependencies": { "@babel/types": "^7.0.0" } }, "node_modules/@types/babel__template": { - "version": "7.4.3", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.3.tgz", - "integrity": "sha512-ciwyCLeuRfxboZ4isgdNZi/tkt06m8Tw6uGbBSBgWrnnZGNXiEyM27xc/PjXGQLqlZ6ylbgHMnm7ccF9tCkOeQ==", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", "dev": true, "dependencies": { "@babel/parser": "^7.1.0", @@ -1315,51 +1315,51 @@ } }, "node_modules/@types/babel__traverse": { - "version": "7.20.3", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.3.tgz", - "integrity": "sha512-Lsh766rGEFbaxMIDH7Qa+Yha8cMVI3qAK6CHt3OR0YfxOIn5Z54iHiyDRycHrBqeIiqGa20Kpsv1cavfBKkRSw==", + "version": "7.20.4", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.4.tgz", + "integrity": "sha512-mSM/iKUk5fDDrEV/e83qY+Cr3I1+Q3qqTuEn++HAWYjEa1+NxZr6CNrcJGf2ZTnq4HoFGC3zaTPZTobCzCFukA==", "dev": true, "dependencies": { "@babel/types": "^7.20.7" } }, "node_modules/@types/graceful-fs": { - "version": "4.1.8", - "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.8.tgz", - "integrity": "sha512-NhRH7YzWq8WiNKVavKPBmtLYZHxNY19Hh+az28O/phfp68CF45pMFud+ZzJ8ewnxnC5smIdF3dqFeiSUQ5I+pw==", + "version": "4.1.9", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", + "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", "dev": true, "dependencies": { "@types/node": "*" } }, "node_modules/@types/istanbul-lib-coverage": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", - "integrity": "sha512-zONci81DZYCZjiLe0r6equvZut0b+dBRPBN5kBDjsONnutYNtJMoWQ9uR2RkL1gLG9NMTzvf+29e5RFfPbeKhQ==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", "dev": true }, "node_modules/@types/istanbul-lib-report": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.2.tgz", - "integrity": "sha512-8toY6FgdltSdONav1XtUHl4LN1yTmLza+EuDazb/fEmRNCwjyqNVIQWs2IfC74IqjHkREs/nQ2FWq5kZU9IC0w==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", + "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", "dev": true, "dependencies": { "@types/istanbul-lib-coverage": "*" } }, "node_modules/@types/istanbul-reports": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.3.tgz", - "integrity": "sha512-1nESsePMBlf0RPRffLZi5ujYh7IH1BWL4y9pr+Bn3cJBdxz+RTP8bUFljLz9HvzhhOSWKdyBZ4DIivdL6rvgZg==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", + "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", "dev": true, "dependencies": { "@types/istanbul-lib-report": "*" } }, "node_modules/@types/jest": { - "version": "29.5.6", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.6.tgz", - "integrity": "sha512-/t9NnzkOpXb4Nfvg17ieHE6EeSjDS2SGSpNYfoLbUAeL/EOueU/RSdOWFpfQTXBEM7BguYW1XQ0EbM+6RlIh6w==", + "version": "29.5.11", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.11.tgz", + "integrity": "sha512-S2mHmYIVe13vrm6q4kN6fLYYAka15ALQki/vgDC3mIukEOx8WJlv0kQPM+d4w8Gp6u0uSdKND04IlTXBv0rwnQ==", "dev": true, "dependencies": { "expect": "^29.0.0", @@ -1367,9 +1367,9 @@ } }, "node_modules/@types/json-schema": { - "version": "7.0.14", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.14.tgz", - "integrity": "sha512-U3PUjAudAdJBeC2pgN8uTIKgxrb4nlDF3SF0++EldXQvQBGkpFZMSnwQiIoDU77tv45VgNkl/L4ouD+rEomujw==", + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true }, "node_modules/@types/json5": { @@ -1385,30 +1385,30 @@ "dev": true }, "node_modules/@types/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-MMzuxN3GdFwskAnb6fz0orFvhfqi752yjaXylr0Rp4oDg5H0Zn1IuyRhDVvYOwAXoJirx2xuS16I3WjxnAIHiQ==", + "version": "7.5.6", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.6.tgz", + "integrity": "sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==", "dev": true }, "node_modules/@types/stack-utils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.2.tgz", - "integrity": "sha512-g7CK9nHdwjK2n0ymT2CW698FuWJRIx+RP6embAzZ2Qi8/ilIrA1Imt2LVSeHUzKvpoi7BhmmQcXz95eS0f2JXw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", + "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", "dev": true }, "node_modules/@types/yargs": { - "version": "17.0.29", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.29.tgz", - "integrity": "sha512-nacjqA3ee9zRF/++a3FUY1suHTFKZeHba2n8WeDw9cCVdmzmHpIxyzOJBcpHvvEmS8E9KqWlSnWHUkOrkhWcvA==", + "version": "17.0.32", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.32.tgz", + "integrity": "sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==", "dev": true, "dependencies": { "@types/yargs-parser": "*" } }, "node_modules/@types/yargs-parser": { - "version": "21.0.2", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.2.tgz", - "integrity": "sha512-5qcvofLPbfjmBfKaLfj/+f+Sbd6pN4zl7w7VSVI5uz7m9QZTuB2aZAa2uo1wHFBNN2x6g/SoTkXmd8mQnQF2Cw==", + "version": "21.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { @@ -1606,9 +1606,9 @@ "dev": true }, "node_modules/acorn": { - "version": "8.11.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.1.tgz", - "integrity": "sha512-IJTNCJMRHfRfb8un89z1QtS0x890C2QUrUxFMK8zy+RizcId6mfnqOf68Bu9YkDgpLYuvCm6aYbwDatXVZPjMQ==", + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz", + "integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -1847,9 +1847,9 @@ } }, "node_modules/axios": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.0.tgz", - "integrity": "sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg==", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz", + "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==", "dependencies": { "follow-redirects": "^1.15.0", "form-data": "^4.0.0", @@ -2001,9 +2001,9 @@ } }, "node_modules/browserslist": { - "version": "4.22.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.1.tgz", - "integrity": "sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ==", + "version": "4.22.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.2.tgz", + "integrity": "sha512-0UgcrvQmBDvZHFGdYUehrCNIazki7/lUP3kkoi/r3YB2amZbFM9J43ZRkJTXBUZK4gmx56+Sqk9+Vs9mwZx9+A==", "dev": true, "funding": [ { @@ -2020,9 +2020,9 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001541", - "electron-to-chromium": "^1.4.535", - "node-releases": "^2.0.13", + "caniuse-lite": "^1.0.30001565", + "electron-to-chromium": "^1.4.601", + "node-releases": "^2.0.14", "update-browserslist-db": "^1.0.13" }, "bin": { @@ -2092,9 +2092,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001554", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001554.tgz", - "integrity": "sha512-A2E3U//MBwbJVzebddm1YfNp7Nud5Ip+IPn4BozBmn4KqVX7AvluoIDFWjsv5OkGnKUXQVmMSoMKLa3ScCblcQ==", + "version": "1.0.30001566", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001566.tgz", + "integrity": "sha512-ggIhCsTxmITBAMmK8yZjEhCO5/47jKXPu6Dha/wuCS4JePVL+3uiDEBuhu2aIoT+bqTOR8L76Ip1ARL9xYsEJA==", "dev": true, "funding": [ { @@ -2397,9 +2397,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.568", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.568.tgz", - "integrity": "sha512-3TCOv8+BY6Ltpt1/CmGBMups2IdKOyfEmz4J8yIS4xLSeMm0Rf+psSaxLuswG9qMKt+XbNbmADybtXGpTFlbDg==", + "version": "1.4.609", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.609.tgz", + "integrity": "sha512-ihiCP7PJmjoGNuLpl7TjNA8pCQWu09vGyjlPYw1Rqww4gvNuCcmvl+44G+2QyJ6S2K4o+wbTS++Xz0YN8Q9ERw==", "dev": true }, "node_modules/emittery": { @@ -2544,15 +2544,15 @@ } }, "node_modules/eslint": { - "version": "8.52.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.52.0.tgz", - "integrity": "sha512-zh/JHnaixqHZsolRB/w9/02akBk9EPrOs9JwcTP2ek7yL5bVvXuRariiaAjjoJ5DvuwQ1WAE/HsMz+w17YgBCg==", + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.55.0.tgz", + "integrity": "sha512-iyUUAM0PCKj5QpwGfmCAG9XXbZCWsqP/eWAWrG/W0umvjuLRBECwSFdt+rCntju0xEH7teIABPwXpahftIaTdA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.2", - "@eslint/js": "8.52.0", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.55.0", "@humanwhocodes/config-array": "^0.11.13", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -2982,9 +2982,9 @@ "dev": true }, "node_modules/fast-glob": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", - "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", @@ -3080,9 +3080,9 @@ } }, "node_modules/flat-cache": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.1.1.tgz", - "integrity": "sha512-/qM2b3LUIaIgviBQovTLvijfyOQXPtSRnRK26ksj2J7rzPIecePUIpJsZ4T02Qg+xiAEKIs5K8dsHEd+VaKa/Q==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", "dev": true, "dependencies": { "flatted": "^3.2.9", @@ -3090,7 +3090,7 @@ "rimraf": "^3.0.2" }, "engines": { - "node": ">=12.0.0" + "node": "^10.12.0 || >=12.0.0" } }, "node_modules/flatted": { @@ -3469,9 +3469,9 @@ } }, "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.0.tgz", + "integrity": "sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==", "dev": true, "engines": { "node": ">= 4" @@ -3832,9 +3832,9 @@ "dev": true }, "node_modules/istanbul-lib-coverage": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", - "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", "dev": true, "engines": { "node": ">=8" @@ -4732,9 +4732,9 @@ "dev": true }, "node_modules/nock": { - "version": "13.3.6", - "resolved": "https://registry.npmjs.org/nock/-/nock-13.3.6.tgz", - "integrity": "sha512-lT6YuktKroUFM+27mubf2uqQZVy2Jf+pfGzuh9N6VwdHlFoZqvi4zyxFTVR1w/ChPqGY6yxGehHp6C3wqCASCw==", + "version": "13.4.0", + "resolved": "https://registry.npmjs.org/nock/-/nock-13.4.0.tgz", + "integrity": "sha512-W8NVHjO/LCTNA64yxAPHV/K47LpGYcVzgKd3Q0n6owhwvD0Dgoterc25R4rnZbckJEb6Loxz1f5QMuJpJnbSyQ==", "dev": true, "dependencies": { "debug": "^4.1.0", @@ -4752,9 +4752,9 @@ "dev": true }, "node_modules/node-releases": { - "version": "2.0.13", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", - "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==", + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", + "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", "dev": true }, "node_modules/normalize-path": { @@ -4797,13 +4797,13 @@ } }, "node_modules/object.assign": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", - "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", "has-symbols": "^1.0.3", "object-keys": "^1.1.1" }, @@ -5207,9 +5207,9 @@ "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" }, "node_modules/punycode": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", - "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true, "engines": { "node": ">=6" @@ -6031,9 +6031,9 @@ } }, "node_modules/v8-to-istanbul": { - "version": "9.1.3", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.3.tgz", - "integrity": "sha512-9lDD+EVI2fjFsMWXc6dy5JJzBsVTcQ2fVkfBvncZ6xJWG9wtBhOldG+mHkSL0+V1K/xgZz0JDO5UT5hFwHUghg==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz", + "integrity": "sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==", "dev": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.12", diff --git a/src/http/HTTPLibrary.ts b/src/http/HTTPLibrary.ts index 121a7c60..68c41e21 100644 --- a/src/http/HTTPLibrary.ts +++ b/src/http/HTTPLibrary.ts @@ -5,7 +5,7 @@ import throwHttpError from './httpExceptions'; export default class HTTPLibrary implements HTTPClient { 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; diff --git a/src/index.ts b/src/index.ts index 6a37e864..10ccf7fe 100644 --- a/src/index.ts +++ b/src/index.ts @@ -34,6 +34,9 @@ type Config = { export * from './http/errors'; +/** + * An Open API Spec for interacting with Plex.tv and Plex Servers + */ export class PlexSDK { public activities: ActivitiesService; public butler: ButlerService; @@ -65,6 +68,10 @@ export class PlexSDK { this.video = new VideoService(apiKey, apiKeyHeader); } + /** + * Sets the baseUrl that the SDK will use for its requests. + * @param {string} url + */ setBaseUrl(url: string): void { this.activities.setBaseUrl(url); this.butler.setBaseUrl(url); @@ -81,6 +88,11 @@ export class PlexSDK { 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') { this.activities.setApiKey(key, header); this.butler.setApiKey(key, header); diff --git a/src/services/README.md b/src/services/README.md index 17ce2b00..b9189536 100644 --- a/src/services/README.md +++ b/src/services/README.md @@ -343,7 +343,7 @@ const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); 110, 165, 100, - 4000, + 20, 1, 1, '/library/metadata/49564/thumb/1654258204', @@ -463,7 +463,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.media.updatePlayProgress('key', 90469787.90055934, 'state'); + const result = await sdk.media.updatePlayProgress('key', 27551608.23429507, 'state'); console.log(result.data); })(); @@ -617,7 +617,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.butler.startTask('GenerateChapterThumbs'); + const result = await sdk.butler.startTask('CleanOldBundles'); console.log(result.data); })(); @@ -681,7 +681,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.hubs.getGlobalHubs({ count: 56455806.18512213, onlyTransient: 1 }); + const result = await sdk.hubs.getGlobalHubs({ count: 85088414.29395235, onlyTransient: 1 }); console.log(result.data); })(); @@ -719,8 +719,8 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.hubs.getLibraryHubs(14224427.485252097, { - count: 59167335.01182026, + const result = await sdk.hubs.getLibraryHubs(1529501.7966160178, { + count: -55107649.72469167, onlyTransient: 1, }); console.log(result.data); @@ -762,7 +762,7 @@ const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { const result = await sdk.search.performSearch('arnold', { - sectionId: 23503236.39517291, + sectionId: -91245133.11936787, limit: 5, }); console.log(result.data); @@ -803,7 +803,7 @@ const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { const result = await sdk.search.performVoiceSearch('dead+poop', { - sectionId: 49725001.21318659, + sectionId: -77985966.3231569, limit: 5, }); 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 | | :-------- | :----------| :----------| -| type | number | Item type | +| type_ | number | Item type | **Return Type** @@ -874,7 +874,7 @@ const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { const result = await sdk.library.getFileHash('file://C:Image.png&type=13', { - type: 57131492.35348597, + type: -83086119.43343997, }); 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 | | :-------- | :----------| :----------| -| type | number | item type | +| type_ | number | item type | | filter | string | the filter parameter | @@ -1026,8 +1026,8 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.library.getLibraryItems(5918142.371238574, { - type: -7809061.492073655, + const result = await sdk.library.getLibraryItems(42026951.633123755, { + type: 35182739.55189258, filter: 'filter', }); console.log(result.data); @@ -1059,7 +1059,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.library.refreshLibrary(96299696.9761284); + const result = await sdk.library.refreshLibrary(40666143.29885453); console.log(result.data); })(); @@ -1075,7 +1075,7 @@ Get Latest Library Items | Name | Type| Description | | :-------- | :----------| :----------| | sectionId | number | the Id of the library to query | -| type | number | item type | +| type_ | number | item type | **Optional Parameters** @@ -1097,7 +1097,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.library.getLatestLibraryItems(92402469.6477915, -96400116.97826156, { + const result = await sdk.library.getLatestLibraryItems(68855255.94976288, -62521069.88462107, { filter: 'filter', }); console.log(result.data); @@ -1115,7 +1115,7 @@ Get Common Library Items | Name | Type| Description | | :-------- | :----------| :----------| | sectionId | number | the Id of the library to query | -| type | number | item type | +| type_ | number | item type | **Optional Parameters** @@ -1137,7 +1137,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.library.getCommonLibraryItems(10111915.895296082, 55224735.92815569, { + const result = await sdk.library.getCommonLibraryItems(-8101546.533601046, -75357740.57515395, { filter: 'filter', }); console.log(result.data); @@ -1169,7 +1169,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.library.getMetadata(62182009.76385683); + const result = await sdk.library.getMetadata(-88656892.93622507); console.log(result.data); })(); @@ -1199,7 +1199,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.library.getMetadataChildren(11669243.106740937); + const result = await sdk.library.getMetadataChildren(-99012349.51775439); console.log(result.data); })(); @@ -1278,7 +1278,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.log.logLine(2, 'message', 'source'); + const result = await sdk.log.logLine(3, 'message', 'source'); console.log(result.data); })(); @@ -1318,7 +1318,7 @@ Create a Playlist | Name | Type| Description | | :-------- | :----------| :----------| | 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 | **Optional Parameters** @@ -1342,9 +1342,9 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.playlists.createPlaylist('title', 'audio', 42, { + const result = await sdk.playlists.createPlaylist('title', 'audio', 1, { uri: 'uri', - playQueueID: -22282333.505305633, + playQueueID: 87381919.3788966, }); console.log(result.data); })(); @@ -1378,7 +1378,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (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); })(); @@ -1408,7 +1408,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.playlists.getPlaylist(25521232.224839047); + const result = await sdk.playlists.getPlaylist(92983670.90558982); console.log(result.data); })(); @@ -1438,7 +1438,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.playlists.deletePlaylist(-60675901.030656695); + const result = await sdk.playlists.deletePlaylist(99606126.8799004); console.log(result.data); })(); @@ -1468,7 +1468,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.playlists.updatePlaylist(65200160.70787519); + const result = await sdk.playlists.updatePlaylist(59306036.18112618); console.log(result.data); })(); @@ -1484,7 +1484,7 @@ Retrieve Playlist Contents | Name | Type| Description | | :-------- | :----------| :----------| | 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 }); (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); })(); @@ -1529,7 +1529,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.playlists.clearPlaylistContents(24703702.974021226); + const result = await sdk.playlists.clearPlaylistContents(14196089.297935858); console.log(result.data); })(); @@ -1561,7 +1561,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.playlists.addPlaylistContents(-3444881.095142722, 'library://..', 123); + const result = await sdk.playlists.addPlaylistContents(72519034.14049211, 'library://..', 123); console.log(result.data); })(); @@ -1608,7 +1608,7 @@ Get a Transient Token. | 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. | @@ -1812,7 +1812,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.updater.checkForUpdates({ download: 'foo' }); + const result = await sdk.updater.checkForUpdates({ download: 1 }); console.log(result.data); })(); @@ -1845,7 +1845,7 @@ import { PlexSDK } from './src'; const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { - const result = await sdk.updater.applyUpdates({ tonight: 'foo', skip: 1 }); + const result = await sdk.updater.applyUpdates({ tonight: 1, skip: 1 }); console.log(result.data); })(); @@ -1898,23 +1898,23 @@ const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { const result = await sdk.video.startUniversalTranscode( - -87516165.31957072, + 75991865.40406942, 'path', - -62877687.452249065, - -23076170.49337977, + 56663842.10067603, + -67967057.15750742, 'protocol', { - fastSeek: -68282427.87913167, - directPlay: -74000014.76895301, - directStream: 84943482.78212723, - subtitleSize: -55237723.44813809, + fastSeek: -62704400.883238874, + directPlay: 52960718.78090119, + directStream: -94395071.761853, + subtitleSize: 33802925.01619348, subtites: 'subtites', - audioBoost: 29945312.780143052, + audioBoost: 10748580.253260702, location: 'location', - mediaBufferSize: -16516185.759793341, + mediaBufferSize: -46116700.53601071, session: 'session', - addDebugOverlay: -10261279.500832424, - autoAdjustQuality: 32480614.034784466, + addDebugOverlay: -8127838.686531514, + autoAdjustQuality: -52398513.48495814, }, ); console.log(result.data); @@ -1956,16 +1956,16 @@ const sdk = new PlexSDK({ apiKey: process.env.PLEXSDK_API_KEY_TOKEN }); (async () => { const result = await sdk.video.getTimeline( - -32608281.350922346, + 46174238.848059, 'key', - 'stopped', - -74699884.18136695, - -66756517.26572518, - -24893130.84645444, + 'paused', + 30544127.328339994, + 93380826.84958789, + -91474715.3910691, 'context', - -75734154.35564606, - -89175857.3275879, - -15877259.38555336, + 15473399.928571522, + 6431628.867009878, + 81455467.98715591, ); console.log(result.data); })(); diff --git a/src/services/activities/Activities.ts b/src/services/activities/Activities.ts index a41b2d7a..8282472e 100644 --- a/src/services/activities/Activities.ts +++ b/src/services/activities/Activities.ts @@ -15,7 +15,7 @@ export class ActivitiesService extends BaseService { */ async getServerActivities(): Promise> { const urlEndpoint = '/activities'; - const finalUrl = `${this.baseUrl + urlEndpoint}`; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`); const response: any = await this.httpClient.get( finalUrl, {}, @@ -47,9 +47,9 @@ export class ActivitiesService extends BaseService { let urlEndpoint = '/activities/{activityUUID}'; urlEndpoint = urlEndpoint.replace( '{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( finalUrl, {}, diff --git a/src/services/butler/Butler.ts b/src/services/butler/Butler.ts index a7179838..4784ae03 100644 --- a/src/services/butler/Butler.ts +++ b/src/services/butler/Butler.ts @@ -16,7 +16,7 @@ export class ButlerService extends BaseService { */ async getButlerTasks(): Promise> { const urlEndpoint = '/butler'; - const finalUrl = `${this.baseUrl + urlEndpoint}`; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`); const response: any = await this.httpClient.get( finalUrl, {}, @@ -45,7 +45,7 @@ export class ButlerService extends BaseService { */ async startAllTasks(): Promise { const urlEndpoint = '/butler'; - const finalUrl = `${this.baseUrl + urlEndpoint}`; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`); const response: any = await this.httpClient.post( finalUrl, {}, @@ -70,7 +70,7 @@ export class ButlerService extends BaseService { */ async stopAllTasks(): Promise { const urlEndpoint = '/butler'; - const finalUrl = `${this.baseUrl + urlEndpoint}`; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`); const response: any = await this.httpClient.delete( finalUrl, {}, @@ -105,9 +105,9 @@ export class ButlerService extends BaseService { let urlEndpoint = '/butler/{taskName}'; urlEndpoint = urlEndpoint.replace( '{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( finalUrl, {}, @@ -138,9 +138,9 @@ export class ButlerService extends BaseService { let urlEndpoint = '/butler/{taskName}'; urlEndpoint = urlEndpoint.replace( '{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( finalUrl, {}, diff --git a/src/services/hubs/Hubs.ts b/src/services/hubs/Hubs.ts index 8fdd10a3..4c1909dc 100644 --- a/src/services/hubs/Hubs.ts +++ b/src/services/hubs/Hubs.ts @@ -29,8 +29,8 @@ export class HubsService extends BaseService { queryParams.push(serializeQuery('form', true, 'onlyTransient', onlyTransient)); } const urlEndpoint = '/hubs'; - const urlParams = queryParams.length > 0 ? `?${encodeURI(queryParams.join('&'))}` : ''; - const finalUrl = `${this.baseUrl + urlEndpoint}${urlParams}`; + const urlParams = queryParams.length > 0 ? `?${queryParams.join('&')}` : ''; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}${urlParams}`); const response: any = await this.httpClient.get( finalUrl, {}, @@ -69,7 +69,7 @@ export class HubsService extends BaseService { let urlEndpoint = '/hubs/sections/{sectionId}'; urlEndpoint = urlEndpoint.replace( '{sectionId}', - encodeURIComponent(serializePath('simple', false, sectionId, undefined)), + serializePath('simple', false, sectionId, undefined), ); if (count) { queryParams.push(serializeQuery('form', true, 'count', count)); @@ -77,8 +77,8 @@ export class HubsService extends BaseService { if (onlyTransient) { queryParams.push(serializeQuery('form', true, 'onlyTransient', onlyTransient)); } - const urlParams = queryParams.length > 0 ? `?${encodeURI(queryParams.join('&'))}` : ''; - const finalUrl = `${this.baseUrl + urlEndpoint}${urlParams}`; + const urlParams = queryParams.length > 0 ? `?${queryParams.join('&')}` : ''; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}${urlParams}`); const response: any = await this.httpClient.get( finalUrl, {}, diff --git a/src/services/library/Library.ts b/src/services/library/Library.ts index b55e42ec..6a4a93b5 100644 --- a/src/services/library/Library.ts +++ b/src/services/library/Library.ts @@ -18,8 +18,8 @@ export class LibraryService extends BaseService { * @param optionalParams.type_ - Item type * @returns {Promise} - The promise with the result */ - async getFileHash(url: string, optionalParams: { type?: number } = {}): Promise { - const { type } = optionalParams; + async getFileHash(url: string, optionalParams: { type_?: number } = {}): Promise { + const { type_ } = optionalParams; if (url === undefined) { 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) { queryParams.push(serializeQuery('form', true, 'url', url)); } - if (type) { - queryParams.push(serializeQuery('form', true, 'type_', type)); + if (type_) { + queryParams.push(serializeQuery('form', true, 'type', type_)); } const urlEndpoint = '/library/hashes'; - const urlParams = queryParams.length > 0 ? `?${encodeURI(queryParams.join('&'))}` : ''; - const finalUrl = `${this.baseUrl + urlEndpoint}${urlParams}`; + const urlParams = queryParams.length > 0 ? `?${queryParams.join('&')}` : ''; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}${urlParams}`); const response: any = await this.httpClient.get( finalUrl, {}, @@ -57,7 +57,7 @@ export class LibraryService extends BaseService { */ async getRecentlyAdded(): Promise> { const urlEndpoint = '/library/recentlyAdded'; - const finalUrl = `${this.baseUrl + urlEndpoint}`; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`); const response: any = await this.httpClient.get( finalUrl, {}, @@ -87,7 +87,7 @@ This allows a client to provide a rich interface around the media (e.g. allow so */ async getLibraries(): Promise { const urlEndpoint = '/library/sections'; - const finalUrl = `${this.baseUrl + urlEndpoint}`; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`); const response: any = await this.httpClient.get( finalUrl, {}, @@ -145,13 +145,13 @@ Only exists for backwards compatibility, media providers other than the server l let urlEndpoint = '/library/sections/{sectionId}'; urlEndpoint = urlEndpoint.replace( '{sectionId}', - encodeURIComponent(serializePath('simple', false, sectionId, undefined)), + serializePath('simple', false, sectionId, undefined), ); if (includeDetails) { queryParams.push(serializeQuery('form', true, 'includeDetails', includeDetails)); } - const urlParams = queryParams.length > 0 ? `?${encodeURI(queryParams.join('&'))}` : ''; - const finalUrl = `${this.baseUrl + urlEndpoint}${urlParams}`; + const urlParams = queryParams.length > 0 ? `?${queryParams.join('&')}` : ''; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}${urlParams}`); const response: any = await this.httpClient.get( finalUrl, {}, @@ -181,9 +181,9 @@ Only exists for backwards compatibility, media providers other than the server l let urlEndpoint = '/library/sections/{sectionId}'; urlEndpoint = urlEndpoint.replace( '{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( finalUrl, {}, @@ -212,9 +212,9 @@ Only exists for backwards compatibility, media providers other than the server l */ async getLibraryItems( sectionId: number, - optionalParams: { type?: number; filter?: string } = {}, + optionalParams: { type_?: number; filter?: string } = {}, ): Promise { - const { type, filter } = optionalParams; + const { type_, filter } = optionalParams; if (sectionId === undefined) { 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'; urlEndpoint = urlEndpoint.replace( '{sectionId}', - encodeURIComponent(serializePath('simple', false, sectionId, undefined)), + serializePath('simple', false, sectionId, undefined), ); - if (type) { - queryParams.push(serializeQuery('form', true, 'type_', type)); + if (type_) { + queryParams.push(serializeQuery('form', true, 'type', type_)); } if (filter) { queryParams.push(serializeQuery('form', true, 'filter', filter)); } - const urlParams = queryParams.length > 0 ? `?${encodeURI(queryParams.join('&'))}` : ''; - const finalUrl = `${this.baseUrl + urlEndpoint}${urlParams}`; + const urlParams = queryParams.length > 0 ? `?${queryParams.join('&')}` : ''; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}${urlParams}`); const response: any = await this.httpClient.get( finalUrl, {}, @@ -262,9 +262,9 @@ Only exists for backwards compatibility, media providers other than the server l let urlEndpoint = '/library/sections/{sectionId}/refresh'; urlEndpoint = urlEndpoint.replace( '{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( finalUrl, {}, @@ -293,29 +293,29 @@ Only exists for backwards compatibility, media providers other than the server l */ async getLatestLibraryItems( sectionId: number, - type: number, + type_: number, optionalParams: { filter?: string } = {}, ): Promise { const { filter } = optionalParams; - if (sectionId === undefined || type === undefined) { + if (sectionId === undefined || type_ === undefined) { 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[] = []; let urlEndpoint = '/library/sections/{sectionId}/latest'; urlEndpoint = urlEndpoint.replace( '{sectionId}', - encodeURIComponent(serializePath('simple', false, sectionId, undefined)), + serializePath('simple', false, sectionId, undefined), ); - if (type) { - queryParams.push(serializeQuery('form', true, 'type_', type)); + if (type_) { + queryParams.push(serializeQuery('form', true, 'type', type_)); } if (filter) { queryParams.push(serializeQuery('form', true, 'filter', filter)); } - const urlParams = queryParams.length > 0 ? `?${encodeURI(queryParams.join('&'))}` : ''; - const finalUrl = `${this.baseUrl + urlEndpoint}${urlParams}`; + const urlParams = queryParams.length > 0 ? `?${queryParams.join('&')}` : ''; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}${urlParams}`); const response: any = await this.httpClient.get( finalUrl, {}, @@ -344,29 +344,29 @@ Only exists for backwards compatibility, media providers other than the server l */ async getCommonLibraryItems( sectionId: number, - type: number, + type_: number, optionalParams: { filter?: string } = {}, ): Promise { const { filter } = optionalParams; - if (sectionId === undefined || type === undefined) { + if (sectionId === undefined || type_ === undefined) { 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[] = []; let urlEndpoint = '/library/sections/{sectionId}/common'; urlEndpoint = urlEndpoint.replace( '{sectionId}', - encodeURIComponent(serializePath('simple', false, sectionId, undefined)), + serializePath('simple', false, sectionId, undefined), ); - if (type) { - queryParams.push(serializeQuery('form', true, 'type_', type)); + if (type_) { + queryParams.push(serializeQuery('form', true, 'type', type_)); } if (filter) { queryParams.push(serializeQuery('form', true, 'filter', filter)); } - const urlParams = queryParams.length > 0 ? `?${encodeURI(queryParams.join('&'))}` : ''; - const finalUrl = `${this.baseUrl + urlEndpoint}${urlParams}`; + const urlParams = queryParams.length > 0 ? `?${queryParams.join('&')}` : ''; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}${urlParams}`); const response: any = await this.httpClient.get( finalUrl, {}, @@ -397,9 +397,9 @@ Only exists for backwards compatibility, media providers other than the server l let urlEndpoint = '/library/metadata/{ratingKey}'; urlEndpoint = urlEndpoint.replace( '{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( finalUrl, {}, @@ -430,9 +430,9 @@ Only exists for backwards compatibility, media providers other than the server l let urlEndpoint = '/library/metadata/{ratingKey}/children'; urlEndpoint = urlEndpoint.replace( '{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( finalUrl, {}, @@ -457,7 +457,7 @@ Only exists for backwards compatibility, media providers other than the server l */ async getOnDeck(): Promise> { const urlEndpoint = '/library/onDeck'; - const finalUrl = `${this.baseUrl + urlEndpoint}`; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`); const response: any = await this.httpClient.get( finalUrl, {}, diff --git a/src/services/log/Log.ts b/src/services/log/Log.ts index d08c267f..8196606b 100644 --- a/src/services/log/Log.ts +++ b/src/services/log/Log.ts @@ -40,7 +40,7 @@ export class LogService extends BaseService { queryParams.push(serializeQuery('form', true, 'source', source)); } 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( finalUrl, {}, @@ -65,7 +65,7 @@ export class LogService extends BaseService { */ async logMultiLine(): Promise { const urlEndpoint = '/log'; - const finalUrl = `${this.baseUrl + urlEndpoint}`; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`); const response: any = await this.httpClient.post( finalUrl, {}, @@ -90,7 +90,7 @@ export class LogService extends BaseService { */ async enablePaperTrail(): Promise { const urlEndpoint = '/log/networked'; - const finalUrl = `${this.baseUrl + urlEndpoint}`; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`); const response: any = await this.httpClient.get( finalUrl, {}, diff --git a/src/services/media/Media.ts b/src/services/media/Media.ts index 7e9e5dd5..50a35ffe 100644 --- a/src/services/media/Media.ts +++ b/src/services/media/Media.ts @@ -21,7 +21,7 @@ export class MediaService extends BaseService { queryParams.push(serializeQuery('form', true, 'key', key)); } 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( finalUrl, {}, @@ -53,7 +53,7 @@ export class MediaService extends BaseService { queryParams.push(serializeQuery('form', true, 'key', key)); } 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( finalUrl, {}, @@ -96,7 +96,7 @@ export class MediaService extends BaseService { queryParams.push(serializeQuery('form', true, 'state', state)); } 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( finalUrl, { key, time, state }, diff --git a/src/services/playlists/Playlists.ts b/src/services/playlists/Playlists.ts index 6d47689a..b7217321 100644 --- a/src/services/playlists/Playlists.ts +++ b/src/services/playlists/Playlists.ts @@ -27,22 +27,22 @@ export class PlaylistsService extends BaseService { */ async createPlaylist( title: string, - type: Type, + type_: Type, smart: Smart, optionalParams: { uri?: string; playQueueId?: number } = {}, ): Promise { const { uri, playQueueId } = optionalParams; - if (title === undefined || type === undefined || smart === undefined) { + if (title === undefined || type_ === undefined || smart === undefined) { 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[] = []; if (title) { queryParams.push(serializeQuery('form', true, 'title', title)); } - if (type) { - queryParams.push(serializeQuery('form', true, 'type_', type)); + if (type_) { + queryParams.push(serializeQuery('form', true, 'type', type_)); } if (smart) { queryParams.push(serializeQuery('form', true, 'smart', smart)); @@ -54,11 +54,11 @@ export class PlaylistsService extends BaseService { queryParams.push(serializeQuery('form', true, 'playQueueID', playQueueId)); } const urlEndpoint = '/playlists'; - const urlParams = queryParams.length > 0 ? `?${encodeURI(queryParams.join('&'))}` : ''; - const finalUrl = `${this.baseUrl + urlEndpoint}${urlParams}`; + const urlParams = queryParams.length > 0 ? `?${queryParams.join('&')}` : ''; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}${urlParams}`); const response: any = await this.httpClient.post( finalUrl, - { title, type_: type, smart, uri, playQueueID: playQueueId }, + { title, type_, smart, uri, playQueueID: playQueueId }, { ...this.getAuthorizationHeader(), }, @@ -93,8 +93,8 @@ export class PlaylistsService extends BaseService { queryParams.push(serializeQuery('form', true, 'smart', smart)); } const urlEndpoint = '/playlists/all'; - const urlParams = queryParams.length > 0 ? `?${encodeURI(queryParams.join('&'))}` : ''; - const finalUrl = `${this.baseUrl + urlEndpoint}${urlParams}`; + const urlParams = queryParams.length > 0 ? `?${queryParams.join('&')}` : ''; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}${urlParams}`); const response: any = await this.httpClient.get( finalUrl, {}, @@ -126,9 +126,9 @@ Smart playlist details contain the `content` attribute. This is the content URI let urlEndpoint = '/playlists/{playlistID}'; urlEndpoint = urlEndpoint.replace( '{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( finalUrl, {}, @@ -159,9 +159,9 @@ Smart playlist details contain the `content` attribute. This is the content URI let urlEndpoint = '/playlists/{playlistID}'; urlEndpoint = urlEndpoint.replace( '{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( finalUrl, {}, @@ -192,9 +192,9 @@ Smart playlist details contain the `content` attribute. This is the content URI let urlEndpoint = '/playlists/{playlistID}'; urlEndpoint = urlEndpoint.replace( '{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( 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 * @returns {Promise} - The promise with the result */ - async getPlaylistContents(playlistId: number, type: number): Promise { - if (playlistId === undefined || type === undefined) { + async getPlaylistContents(playlistId: number, type_: number): Promise { + if (playlistId === undefined || type_ === undefined) { 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[] = []; let urlEndpoint = '/playlists/{playlistID}/items'; urlEndpoint = urlEndpoint.replace( '{playlistID}', - encodeURIComponent(serializePath('simple', false, playlistId, undefined)), + serializePath('simple', false, playlistId, undefined), ); - if (type) { - queryParams.push(serializeQuery('form', true, 'type_', type)); + if (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( finalUrl, {}, @@ -274,7 +274,7 @@ With a smart playlist, passing a new `uri` parameter replaces the rules for the let urlEndpoint = '/playlists/{playlistID}/items'; urlEndpoint = urlEndpoint.replace( '{playlistID}', - encodeURIComponent(serializePath('simple', false, playlistId, undefined)), + serializePath('simple', false, playlistId, undefined), ); if (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) { 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( finalUrl, { 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'; urlEndpoint = urlEndpoint.replace( '{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( 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)); } 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( finalUrl, { path, force }, diff --git a/src/services/search/Search.ts b/src/services/search/Search.ts index 1872a239..9ac931c7 100644 --- a/src/services/search/Search.ts +++ b/src/services/search/Search.ts @@ -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)); } const urlEndpoint = '/hubs/search'; - const urlParams = queryParams.length > 0 ? `?${encodeURI(queryParams.join('&'))}` : ''; - const finalUrl = `${this.baseUrl + urlEndpoint}${urlParams}`; + const urlParams = queryParams.length > 0 ? `?${queryParams.join('&')}` : ''; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}${urlParams}`); const response: any = await this.httpClient.get( 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)); } const urlEndpoint = '/hubs/search/voice'; - const urlParams = queryParams.length > 0 ? `?${encodeURI(queryParams.join('&'))}` : ''; - const finalUrl = `${this.baseUrl + urlEndpoint}${urlParams}`; + const urlParams = queryParams.length > 0 ? `?${queryParams.join('&')}` : ''; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}${urlParams}`); const response: any = await this.httpClient.get( 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)); } 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( finalUrl, {}, diff --git a/src/services/security/Security.ts b/src/services/security/Security.ts index f49fabe0..c35fcc3e 100644 --- a/src/services/security/Security.ts +++ b/src/services/security/Security.ts @@ -17,21 +17,21 @@ export class SecurityService extends BaseService { * @param scope `all` - This is the only supported `scope` parameter. * @returns {Promise} - The promise with the result */ - async getTransientToken(type: SecurityType, scope: Scope): Promise { - if (type === undefined || scope === undefined) { + async getTransientToken(type_: SecurityType, scope: Scope): Promise { + if (type_ === undefined || scope === undefined) { 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[] = []; - if (type) { - queryParams.push(serializeQuery('form', true, 'type_', type)); + if (type_) { + queryParams.push(serializeQuery('form', true, 'type', type_)); } if (scope) { queryParams.push(serializeQuery('form', true, 'scope', scope)); } 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( finalUrl, {}, @@ -65,7 +65,7 @@ Note: requires Plex Media Server >= 1.15.4. queryParams.push(serializeQuery('form', true, 'source', source)); } 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( finalUrl, {}, diff --git a/src/services/server/Server.ts b/src/services/server/Server.ts index 1c7a5115..2d4cb592 100644 --- a/src/services/server/Server.ts +++ b/src/services/server/Server.ts @@ -22,7 +22,7 @@ export class ServerService extends BaseService { */ async getServerCapabilities(): Promise> { const urlEndpoint = '/'; - const finalUrl = `${this.baseUrl + urlEndpoint}`; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`); const response: any = await this.httpClient.get( finalUrl, {}, @@ -46,7 +46,7 @@ export class ServerService extends BaseService { */ async getServerPreferences(): Promise { const urlEndpoint = '/:/prefs'; - const finalUrl = `${this.baseUrl + urlEndpoint}`; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`); const response: any = await this.httpClient.get( finalUrl, {}, @@ -70,7 +70,7 @@ export class ServerService extends BaseService { */ async getAvailableClients(): Promise> { const urlEndpoint = '/clients'; - const finalUrl = `${this.baseUrl + urlEndpoint}`; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`); const response: any = await this.httpClient.get( finalUrl, {}, @@ -94,7 +94,7 @@ export class ServerService extends BaseService { */ async getDevices(): Promise> { const urlEndpoint = '/devices'; - const finalUrl = `${this.baseUrl + urlEndpoint}`; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`); const response: any = await this.httpClient.get( finalUrl, {}, @@ -118,7 +118,7 @@ export class ServerService extends BaseService { */ async getServerIdentity(): Promise> { const urlEndpoint = '/identity'; - const finalUrl = `${this.baseUrl + urlEndpoint}`; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`); const response: any = await this.httpClient.get( finalUrl, {}, @@ -142,7 +142,7 @@ export class ServerService extends BaseService { */ async getMyPlexAccount(): Promise> { const urlEndpoint = '/myplex/account'; - const finalUrl = `${this.baseUrl + urlEndpoint}`; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`); const response: any = await this.httpClient.get( finalUrl, {}, @@ -217,7 +217,7 @@ export class ServerService extends BaseService { queryParams.push(serializeQuery('form', true, 'url', url)); } 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( finalUrl, {}, @@ -241,7 +241,7 @@ export class ServerService extends BaseService { */ async getServerList(): Promise> { const urlEndpoint = '/servers'; - const finalUrl = `${this.baseUrl + urlEndpoint}`; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`); const response: any = await this.httpClient.get( finalUrl, {}, diff --git a/src/services/sessions/Sessions.ts b/src/services/sessions/Sessions.ts index fd69b8d3..2d9e240e 100644 --- a/src/services/sessions/Sessions.ts +++ b/src/services/sessions/Sessions.ts @@ -15,7 +15,7 @@ export class SessionsService extends BaseService { */ async getSessions(): Promise { const urlEndpoint = '/status/sessions'; - const finalUrl = `${this.baseUrl + urlEndpoint}`; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`); const response: any = await this.httpClient.get( finalUrl, {}, @@ -39,7 +39,7 @@ export class SessionsService extends BaseService { */ async getSessionHistory(): Promise { const urlEndpoint = '/status/sessions/history/all'; - const finalUrl = `${this.baseUrl + urlEndpoint}`; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`); const response: any = await this.httpClient.get( finalUrl, {}, @@ -63,7 +63,7 @@ export class SessionsService extends BaseService { */ async getTranscodeSessions(): Promise> { const urlEndpoint = '/transcode/sessions'; - const finalUrl = `${this.baseUrl + urlEndpoint}`; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`); const response: any = await this.httpClient.get( finalUrl, {}, @@ -93,9 +93,9 @@ export class SessionsService extends BaseService { let urlEndpoint = '/transcode/sessions/{sessionKey}'; urlEndpoint = urlEndpoint.replace( '{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( finalUrl, {}, diff --git a/src/services/updater/Updater.ts b/src/services/updater/Updater.ts index d7cdfd55..64275fc6 100644 --- a/src/services/updater/Updater.ts +++ b/src/services/updater/Updater.ts @@ -17,7 +17,7 @@ export class UpdaterService extends BaseService { */ async getUpdateStatus(): Promise { const urlEndpoint = '/updater/status'; - const finalUrl = `${this.baseUrl + urlEndpoint}`; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}`); const response: any = await this.httpClient.get( finalUrl, {}, @@ -49,8 +49,8 @@ export class UpdaterService extends BaseService { queryParams.push(serializeQuery('form', true, 'download', download)); } const urlEndpoint = '/updater/check'; - const urlParams = queryParams.length > 0 ? `?${encodeURI(queryParams.join('&'))}` : ''; - const finalUrl = `${this.baseUrl + urlEndpoint}${urlParams}`; + const urlParams = queryParams.length > 0 ? `?${queryParams.join('&')}` : ''; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}${urlParams}`); const response: any = await this.httpClient.put( finalUrl, { download }, @@ -87,8 +87,8 @@ export class UpdaterService extends BaseService { queryParams.push(serializeQuery('form', true, 'skip', skip)); } const urlEndpoint = '/updater/apply'; - const urlParams = queryParams.length > 0 ? `?${encodeURI(queryParams.join('&'))}` : ''; - const finalUrl = `${this.baseUrl + urlEndpoint}${urlParams}`; + const urlParams = queryParams.length > 0 ? `?${queryParams.join('&')}` : ''; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}${urlParams}`); const response: any = await this.httpClient.put( finalUrl, { tonight, skip }, diff --git a/src/services/video/Video.ts b/src/services/video/Video.ts index 64134e35..34e496ba 100644 --- a/src/services/video/Video.ts +++ b/src/services/video/Video.ts @@ -124,8 +124,8 @@ export class VideoService extends BaseService { queryParams.push(serializeQuery('form', true, 'autoAdjustQuality', autoAdjustQuality)); } const urlEndpoint = '/video/:/transcode/universal/start.mpd'; - const urlParams = queryParams.length > 0 ? `?${encodeURI(queryParams.join('&'))}` : ''; - const finalUrl = `${this.baseUrl + urlEndpoint}${urlParams}`; + const urlParams = queryParams.length > 0 ? `?${queryParams.join('&')}` : ''; + const finalUrl = encodeURI(`${this.baseUrl + urlEndpoint}${urlParams}`); const response: any = await this.httpClient.get( finalUrl, {}, @@ -217,7 +217,7 @@ export class VideoService extends BaseService { queryParams.push(serializeQuery('form', true, 'row', row)); } 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( finalUrl, {}, diff --git a/test/services/activities/Activities.test.ts b/test/services/activities/Activities.test.ts index d8534623..61ff88be 100644 --- a/test/services/activities/Activities.test.ts +++ b/test/services/activities/Activities.test.ts @@ -31,26 +31,26 @@ describe('test Activities', () => { describe('test cancelServerActivities', () => { test('test api call', () => { const scope = nock('http://10.10.10.47:32400') - .delete('/activities/unde') + .delete('/activities/eaque') .reply(200, { data: {} }); return sdk.activities - .cancelServerActivities('unde') + .cancelServerActivities('eaque') .then((r: any) => expect(r.data).toEqual({ data: {} })); }); test('test will throw error if required fields missing', () => { const scope = nock('http://10.10.10.47:32400') - .delete('/activities/commodi') + .delete('/activities/dolorem') .reply(200, { data: {} }); return expect(async () => await sdk.activities.cancelServerActivities()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { const scope = nock('http://10.10.10.47:32400') - .delete('/activities/alias') + .delete('/activities/corrupti') .reply(404, { data: {} }); return expect( - async () => await sdk.activities.cancelServerActivities('alias'), + async () => await sdk.activities.cancelServerActivities('corrupti'), ).rejects.toThrow(); }); }); diff --git a/test/services/butler/Butler.test.ts b/test/services/butler/Butler.test.ts index 85c6b5f1..67725acd 100644 --- a/test/services/butler/Butler.test.ts +++ b/test/services/butler/Butler.test.ts @@ -43,13 +43,15 @@ describe('test Butler', () => { describe('test startTask', () => { test('test api call', () => { const scope = nock('http://10.10.10.47:32400') - .post('/butler/fugiat') + .post('/butler/itaque') .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', () => { - 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(); }); @@ -64,21 +66,25 @@ describe('test Butler', () => { describe('test stopTask', () => { test('test api call', () => { const scope = nock('http://10.10.10.47:32400') - .delete('/butler/ducimus') + .delete('/butler/necessitatibus') .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', () => { const scope = nock('http://10.10.10.47:32400') - .delete('/butler/veniam') + .delete('/butler/adipisci') .reply(200, { data: {} }); return expect(async () => await sdk.butler.stopTask()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { - const scope = nock('http://10.10.10.47:32400').delete('/butler/in').reply(404, { data: {} }); - return expect(async () => await sdk.butler.stopTask('in')).rejects.toThrow(); + const scope = nock('http://10.10.10.47:32400') + .delete('/butler/veritatis') + .reply(404, { data: {} }); + return expect(async () => await sdk.butler.stopTask('veritatis')).rejects.toThrow(); }); }); }); diff --git a/test/services/hubs/Hubs.test.ts b/test/services/hubs/Hubs.test.ts index f4da587c..0b5e02f4 100644 --- a/test/services/hubs/Hubs.test.ts +++ b/test/services/hubs/Hubs.test.ts @@ -22,10 +22,10 @@ describe('test Hubs', () => { describe('test getGlobalHubs', () => { test('test api call', () => { const scope = nock('http://10.10.10.47:32400') - .get('/hubs?count=3&onlyTransient=9') + .get('/hubs?count=3&onlyTransient=6') .reply(200, { data: {} }); return sdk.hubs - .getGlobalHubs({ count: 3, onlyTransient: 9 }) + .getGlobalHubs({ count: 3, onlyTransient: 6 }) .then((r: any) => expect(r.data).toEqual({ data: {} })); }); }); @@ -33,26 +33,26 @@ describe('test Hubs', () => { describe('test getLibraryHubs', () => { test('test api call', () => { const scope = nock('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: {} }); return sdk.hubs - .getLibraryHubs(6, { count: 1, onlyTransient: 7 }) + .getLibraryHubs(6, { count: 5, onlyTransient: 2 }) .then((r: any) => expect(r.data).toEqual({ data: {} })); }); test('test will throw error if required fields missing', () => { 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: {} }); return expect(async () => await sdk.hubs.getLibraryHubs()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { 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: {} }); return expect( - async () => await sdk.hubs.getLibraryHubs(4, { count: 3, onlyTransient: 9 }), + async () => await sdk.hubs.getLibraryHubs(8, { count: 9, onlyTransient: 7 }), ).rejects.toThrow(); }); }); diff --git a/test/services/library/Library.test.ts b/test/services/library/Library.test.ts index 0eda0236..2d283dd3 100644 --- a/test/services/library/Library.test.ts +++ b/test/services/library/Library.test.ts @@ -22,26 +22,26 @@ describe('test Library', () => { describe('test getFileHash', () => { test('test api call', () => { 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: {} }); return sdk.library - .getFileHash('error', { type: 1 }) + .getFileHash('sequi', { type_: 2 }) .then((r: any) => expect(r.data).toEqual({ data: {} })); }); test('test will throw error if required fields missing', () => { 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: {} }); return expect(async () => await sdk.library.getFileHash()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { 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: {} }); return expect( - async () => await sdk.library.getFileHash('veritatis', { type: 9 }), + async () => await sdk.library.getFileHash('officiis', { type_: 7 }), ).rejects.toThrow(); }); }); @@ -67,26 +67,26 @@ describe('test Library', () => { describe('test getLibrary', () => { test('test api call', () => { const scope = nock('http://10.10.10.47:32400') - .get('/library/sections/6?includeDetails=7') + .get('/library/sections/1?includeDetails=4') .reply(200, { data: {} }); return sdk.library - .getLibrary(6, { includeDetails: 7 }) + .getLibrary(1, { includeDetails: 4 }) .then((r: any) => expect(r.data).toEqual({ data: {} })); }); test('test will throw error if required fields missing', () => { const scope = nock('http://10.10.10.47:32400') - .get('/library/sections/2?includeDetails=4') + .get('/library/sections/3?includeDetails=2') .reply(200, { data: {} }); return expect(async () => await sdk.library.getLibrary()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { const scope = nock('http://10.10.10.47:32400') - .get('/library/sections/1?includeDetails=4') + .get('/library/sections/7?includeDetails=6') .reply(404, { data: {} }); return expect( - async () => await sdk.library.getLibrary(1, { includeDetails: 4 }), + async () => await sdk.library.getLibrary(7, { includeDetails: 6 }), ).rejects.toThrow(); }); }); @@ -94,9 +94,9 @@ describe('test Library', () => { describe('test deleteLibrary', () => { test('test api call', () => { const scope = nock('http://10.10.10.47:32400') - .delete('/library/sections/9') + .delete('/library/sections/4') .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', () => { @@ -108,35 +108,35 @@ describe('test Library', () => { test('test will throw error on a non-200 response', () => { const scope = nock('http://10.10.10.47:32400') - .delete('/library/sections/2') + .delete('/library/sections/5') .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', () => { test('test api call', () => { 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: {} }); return sdk.library - .getLibraryItems(4, { type: 9, filter: 'porro' }) + .getLibraryItems(3, { type_: 3, filter: 'accusamus' }) .then((r: any) => expect(r.data).toEqual({ data: {} })); }); test('test will throw error if required fields missing', () => { 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: {} }); return expect(async () => await sdk.library.getLibraryItems()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { 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: {} }); return expect( - async () => await sdk.library.getLibraryItems(3, { type: 1, filter: 'nostrum' }), + async () => await sdk.library.getLibraryItems(5, { type_: 9, filter: 'maiores' }), ).rejects.toThrow(); }); }); @@ -144,49 +144,49 @@ describe('test Library', () => { describe('test refreshLibrary', () => { test('test api call', () => { const scope = nock('http://10.10.10.47:32400') - .get('/library/sections/6/refresh') + .get('/library/sections/5/refresh') .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', () => { const scope = nock('http://10.10.10.47:32400') - .get('/library/sections/3/refresh') + .get('/library/sections/7/refresh') .reply(200, { data: {} }); return expect(async () => await sdk.library.refreshLibrary()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { const scope = nock('http://10.10.10.47:32400') - .get('/library/sections/3/refresh') + .get('/library/sections/5/refresh') .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', () => { test('test api call', () => { 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: {} }); return sdk.library - .getLatestLibraryItems(2, 7, { filter: 'ipsa' }) + .getLatestLibraryItems(2, 3, { filter: 'explicabo' }) .then((r: any) => expect(r.data).toEqual({ data: {} })); }); test('test will throw error if required fields missing', () => { 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: {} }); return expect(async () => await sdk.library.getLatestLibraryItems()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { 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: {} }); return expect( - async () => await sdk.library.getLatestLibraryItems(3, 9, { filter: 'aliquam' }), + async () => await sdk.library.getLatestLibraryItems(6, 5, { filter: 'minus' }), ).rejects.toThrow(); }); }); @@ -194,26 +194,26 @@ describe('test Library', () => { describe('test getCommonLibraryItems', () => { test('test api call', () => { 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: {} }); return sdk.library - .getCommonLibraryItems(2, 7, { filter: 'doloribus' }) + .getCommonLibraryItems(7, 1, { filter: 'eveniet' }) .then((r: any) => expect(r.data).toEqual({ data: {} })); }); test('test will throw error if required fields missing', () => { 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: {} }); return expect(async () => await sdk.library.getCommonLibraryItems()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { 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: {} }); return expect( - async () => await sdk.library.getCommonLibraryItems(8, 7, { filter: 'nesciunt' }), + async () => await sdk.library.getCommonLibraryItems(8, 1, { filter: 'soluta' }), ).rejects.toThrow(); }); }); @@ -221,48 +221,48 @@ describe('test Library', () => { describe('test getMetadata', () => { test('test api call', () => { const scope = nock('http://10.10.10.47:32400') - .get('/library/metadata/7') + .get('/library/metadata/4') .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', () => { const scope = nock('http://10.10.10.47:32400') - .get('/library/metadata/8') + .get('/library/metadata/6') .reply(200, { data: {} }); return expect(async () => await sdk.library.getMetadata()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { const scope = nock('http://10.10.10.47:32400') - .get('/library/metadata/9') + .get('/library/metadata/4') .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', () => { test('test api call', () => { const scope = nock('http://10.10.10.47:32400') - .get('/library/metadata/4/children') + .get('/library/metadata/8/children') .reply(200, { data: {} }); return sdk.library - .getMetadataChildren(4) + .getMetadataChildren(8) .then((r: any) => expect(r.data).toEqual({ data: {} })); }); test('test will throw error if required fields missing', () => { const scope = nock('http://10.10.10.47:32400') - .get('/library/metadata/3/children') + .get('/library/metadata/4/children') .reply(200, { data: {} }); return expect(async () => await sdk.library.getMetadataChildren()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { const scope = nock('http://10.10.10.47:32400') - .get('/library/metadata/4/children') + .get('/library/metadata/2/children') .reply(404, { data: {} }); - return expect(async () => await sdk.library.getMetadataChildren(4)).rejects.toThrow(); + return expect(async () => await sdk.library.getMetadataChildren(2)).rejects.toThrow(); }); }); diff --git a/test/services/log/Log.test.ts b/test/services/log/Log.test.ts index 53169c79..18507e90 100644 --- a/test/services/log/Log.test.ts +++ b/test/services/log/Log.test.ts @@ -22,27 +22,25 @@ describe('test Log', () => { describe('test logLine', () => { test('test api call', () => { 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: {} }); return sdk.log - .logLine(2, 'laudantium', 'assumenda') + .logLine(4, 'libero', 'delectus') .then((r: any) => expect(r.data).toEqual({ data: {} })); }); test('test will throw error if required fields missing', () => { 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: {} }); return expect(async () => await sdk.log.logLine()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { 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: {} }); - return expect( - async () => await sdk.log.logLine(6, 'repudiandae', 'perspiciatis'), - ).rejects.toThrow(); + return expect(async () => await sdk.log.logLine(8, 'itaque', 'iste')).rejects.toThrow(); }); }); diff --git a/test/services/media/Media.test.ts b/test/services/media/Media.test.ts index a5521475..ebc96598 100644 --- a/test/services/media/Media.test.ts +++ b/test/services/media/Media.test.ts @@ -22,72 +22,72 @@ describe('test Media', () => { describe('test markPlayed', () => { test('test api call', () => { const scope = nock('http://10.10.10.47:32400') - .get('/:/scrobble?key=1') + .get('/:/scrobble?key=9') .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', () => { const scope = nock('http://10.10.10.47:32400') - .get('/:/scrobble?key=1') + .get('/:/scrobble?key=9') .reply(200, { data: {} }); return expect(async () => await sdk.media.markPlayed()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { const scope = nock('http://10.10.10.47:32400') - .get('/:/scrobble?key=1') + .get('/:/scrobble?key=2') .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', () => { test('test api call', () => { const scope = nock('http://10.10.10.47:32400') - .get('/:/unscrobble?key=1') + .get('/:/unscrobble?key=6') .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', () => { const scope = nock('http://10.10.10.47:32400') - .get('/:/unscrobble?key=6') + .get('/:/unscrobble?key=5') .reply(200, { data: {} }); return expect(async () => await sdk.media.markUnplayed()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { const scope = nock('http://10.10.10.47:32400') - .get('/:/unscrobble?key=9') + .get('/:/unscrobble?key=2') .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', () => { test('test api call', () => { 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: {} }); return sdk.media - .updatePlayProgress('inventore', 5, 'dolor') + .updatePlayProgress('minus', 6, 'consequuntur') .then((r: any) => expect(r.data).toEqual({ data: {} })); }); test('test will throw error if required fields missing', () => { 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: {} }); return expect(async () => await sdk.media.updatePlayProgress()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { 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: {} }); return expect( - async () => await sdk.media.updatePlayProgress('illum', 8, 'nostrum'), + async () => await sdk.media.updatePlayProgress('dolores', 6, 'reiciendis'), ).rejects.toThrow(); }); }); diff --git a/test/services/playlists/Playlists.test.ts b/test/services/playlists/Playlists.test.ts index c9876959..5cbbaf0a 100644 --- a/test/services/playlists/Playlists.test.ts +++ b/test/services/playlists/Playlists.test.ts @@ -22,29 +22,29 @@ describe('test Playlists', () => { describe('test createPlaylist', () => { test('test api call', () => { 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: {} }); 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: {} })); }); test('test will throw error if required fields missing', () => { 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: {} }); return expect(async () => await sdk.playlists.createPlaylist()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { 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: {} }); return expect( async () => - await sdk.playlists.createPlaylist('nam', 'excepturi', 9, { - uri: 'iusto', - playQueueID: 5, + await sdk.playlists.createPlaylist('quis', 'inventore', 4, { + uri: 'facere', + playQueueID: 7, }), ).rejects.toThrow(); }); @@ -53,119 +53,119 @@ describe('test Playlists', () => { describe('test getPlaylists', () => { test('test api call', () => { 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: {} }); return sdk.playlists - .getPlaylists({ playlistType: 'eveniet', smart: 9 }) + .getPlaylists({ playlistType: 'laborum', smart: 2 }) .then((r: any) => expect(r.data).toEqual({ data: {} })); }); }); describe('test getPlaylist', () => { test('test api call', () => { - const scope = nock('http://10.10.10.47:32400').get('/playlists/4').reply(200, { data: {} }); - return sdk.playlists.getPlaylist(4).then((r: any) => expect(r.data).toEqual({ data: {} })); + const scope = nock('http://10.10.10.47:32400').get('/playlists/8').reply(200, { data: {} }); + return sdk.playlists.getPlaylist(8).then((r: any) => expect(r.data).toEqual({ data: {} })); }); 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(); }); 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: {} }); - return expect(async () => await sdk.playlists.getPlaylist(1)).rejects.toThrow(); + const scope = nock('http://10.10.10.47:32400').get('/playlists/6').reply(404, { data: {} }); + return expect(async () => await sdk.playlists.getPlaylist(6)).rejects.toThrow(); }); }); describe('test updatePlaylist', () => { test('test api call', () => { - const scope = nock('http://10.10.10.47:32400').put('/playlists/3').reply(200, { data: {} }); - return sdk.playlists.updatePlaylist(3).then((r: any) => expect(r.data).toEqual({ data: {} })); + const scope = nock('http://10.10.10.47:32400').put('/playlists/6').reply(200, { data: {} }); + return sdk.playlists.updatePlaylist(6).then((r: any) => expect(r.data).toEqual({ data: {} })); }); 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(); }); 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: {} }); - return expect(async () => await sdk.playlists.updatePlaylist(4)).rejects.toThrow(); + const scope = nock('http://10.10.10.47:32400').put('/playlists/8').reply(404, { data: {} }); + return expect(async () => await sdk.playlists.updatePlaylist(8)).rejects.toThrow(); }); }); describe('test deletePlaylist', () => { test('test api call', () => { const scope = nock('http://10.10.10.47:32400') - .delete('/playlists/8') + .delete('/playlists/2') .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', () => { const scope = nock('http://10.10.10.47:32400') - .delete('/playlists/9') + .delete('/playlists/2') .reply(200, { data: {} }); return expect(async () => await sdk.playlists.deletePlaylist()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { const scope = nock('http://10.10.10.47:32400') - .delete('/playlists/1') + .delete('/playlists/4') .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', () => { test('test api call', () => { const scope = nock('http://10.10.10.47:32400') - .get('/playlists/5/items?type_=1') + .get('/playlists/7/items?type=1') .reply(200, { data: {} }); return sdk.playlists - .getPlaylistContents(5, 1) + .getPlaylistContents(7, 1) .then((r: any) => expect(r.data).toEqual({ data: {} })); }); test('test will throw error if required fields missing', () => { const scope = nock('http://10.10.10.47:32400') - .get('/playlists/2/items?type_=7') + .get('/playlists/9/items?type=3') .reply(200, { data: {} }); return expect(async () => await sdk.playlists.getPlaylistContents()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { const scope = nock('http://10.10.10.47:32400') - .get('/playlists/9/items?type_=2') + .get('/playlists/8/items?type=9') .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', () => { test('test api call', () => { 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: {} }); return sdk.playlists - .addPlaylistContents(4, 'veniam', 1) + .addPlaylistContents(8, 'amet', 2) .then((r: any) => expect(r.data).toEqual({ data: {} })); }); test('test will throw error if required fields missing', () => { 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: {} }); return expect(async () => await sdk.playlists.addPlaylistContents()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { 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: {} }); return expect( - async () => await sdk.playlists.addPlaylistContents(5, 'similique', 8), + async () => await sdk.playlists.addPlaylistContents(5, 'ea', 1), ).rejects.toThrow(); }); }); @@ -173,50 +173,52 @@ describe('test Playlists', () => { describe('test clearPlaylistContents', () => { test('test api call', () => { const scope = nock('http://10.10.10.47:32400') - .delete('/playlists/1/items') + .delete('/playlists/3/items') .reply(200, { data: {} }); return sdk.playlists - .clearPlaylistContents(1) + .clearPlaylistContents(3) .then((r: any) => expect(r.data).toEqual({ data: {} })); }); test('test will throw error if required fields missing', () => { const scope = nock('http://10.10.10.47:32400') - .delete('/playlists/9/items') + .delete('/playlists/6/items') .reply(200, { data: {} }); return expect(async () => await sdk.playlists.clearPlaylistContents()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { const scope = nock('http://10.10.10.47:32400') - .delete('/playlists/5/items') + .delete('/playlists/4/items') .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', () => { test('test api call', () => { 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: {} }); return sdk.playlists - .uploadPlaylist('a', 5) + .uploadPlaylist('minus', 7) .then((r: any) => expect(r.data).toEqual({ data: {} })); }); test('test will throw error if required fields missing', () => { 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: {} }); return expect(async () => await sdk.playlists.uploadPlaylist()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { 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: {} }); - return expect(async () => await sdk.playlists.uploadPlaylist('animi', 5)).rejects.toThrow(); + return expect( + async () => await sdk.playlists.uploadPlaylist('similique', 8), + ).rejects.toThrow(); }); }); }); diff --git a/test/services/search/Search.test.ts b/test/services/search/Search.test.ts index 9462f40e..7aae3461 100644 --- a/test/services/search/Search.test.ts +++ b/test/services/search/Search.test.ts @@ -22,26 +22,26 @@ describe('test Search', () => { describe('test performSearch', () => { test('test api call', () => { const scope = nock('http://10.10.10.47:32400') - .get('/hubs/search?query=fugiat§ionId=1&limit=3') + .get('/hubs/search?query=id§ionId=6&limit=5') .reply(200, { data: {} }); return sdk.search - .performSearch('fugiat', { sectionId: 1, limit: 3 }) + .performSearch('id', { sectionId: 6, limit: 5 }) .then((r: any) => expect(r.data).toEqual({ data: {} })); }); test('test will throw error if required fields missing', () => { const scope = nock('http://10.10.10.47:32400') - .get('/hubs/search?query=ipsam§ionId=7&limit=2') + .get('/hubs/search?query=officia§ionId=1&limit=8') .reply(200, { data: {} }); return expect(async () => await sdk.search.performSearch()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { const scope = nock('http://10.10.10.47:32400') - .get('/hubs/search?query=quibusdam§ionId=1&limit=6') + .get('/hubs/search?query=exercitationem§ionId=4&limit=4') .reply(404, { data: {} }); return expect( - async () => await sdk.search.performSearch('quibusdam', { sectionId: 1, limit: 6 }), + async () => await sdk.search.performSearch('exercitationem', { sectionId: 4, limit: 4 }), ).rejects.toThrow(); }); }); @@ -49,26 +49,26 @@ describe('test Search', () => { describe('test performVoiceSearch', () => { test('test api call', () => { const scope = nock('http://10.10.10.47:32400') - .get('/hubs/search/voice?query=animi§ionId=7&limit=1') + .get('/hubs/search/voice?query=odit§ionId=8&limit=5') .reply(200, { data: {} }); return sdk.search - .performVoiceSearch('animi', { sectionId: 7, limit: 1 }) + .performVoiceSearch('odit', { sectionId: 8, limit: 5 }) .then((r: any) => expect(r.data).toEqual({ data: {} })); }); test('test will throw error if required fields missing', () => { const scope = nock('http://10.10.10.47:32400') - .get('/hubs/search/voice?query=quae§ionId=6&limit=3') + .get('/hubs/search/voice?query=vel§ionId=1&limit=2') .reply(200, { data: {} }); return expect(async () => await sdk.search.performVoiceSearch()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { const scope = nock('http://10.10.10.47:32400') - .get('/hubs/search/voice?query=aspernatur§ionId=5&limit=8') + .get('/hubs/search/voice?query=minima§ionId=7&limit=4') .reply(404, { data: {} }); return expect( - async () => await sdk.search.performVoiceSearch('aspernatur', { sectionId: 5, limit: 8 }), + async () => await sdk.search.performVoiceSearch('minima', { sectionId: 7, limit: 4 }), ).rejects.toThrow(); }); }); @@ -76,10 +76,10 @@ describe('test Search', () => { describe('test getSearchResults', () => { test('test api call', () => { const scope = nock('http://10.10.10.47:32400') - .get('/search?query=doloremque') + .get('/search?query=tenetur') .reply(200, { data: {} }); return sdk.search - .getSearchResults('doloremque') + .getSearchResults('tenetur') .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', () => { const scope = nock('http://10.10.10.47:32400') - .get('/search?query=placeat') + .get('/search?query=sequi') .reply(404, { data: {} }); - return expect(async () => await sdk.search.getSearchResults('placeat')).rejects.toThrow(); + return expect(async () => await sdk.search.getSearchResults('sequi')).rejects.toThrow(); }); }); }); diff --git a/test/services/security/Security.test.ts b/test/services/security/Security.test.ts index c327545b..89271aea 100644 --- a/test/services/security/Security.test.ts +++ b/test/services/security/Security.test.ts @@ -22,26 +22,26 @@ describe('test Security', () => { describe('test getTransientToken', () => { test('test api call', () => { 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: {} }); return sdk.security - .getTransientToken('odit', 'inventore') + .getTransientToken('eaque', 'commodi') .then((r: any) => expect(r.data).toEqual({ data: {} })); }); test('test will throw error if required fields missing', () => { 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: {} }); return expect(async () => await sdk.security.getTransientToken()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { 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: {} }); return expect( - async () => await sdk.security.getTransientToken('consequatur', 'delectus'), + async () => await sdk.security.getTransientToken('cum', 'qui'), ).rejects.toThrow(); }); }); @@ -49,16 +49,16 @@ describe('test Security', () => { describe('test getSourceConnectionInformation', () => { test('test api call', () => { const scope = nock('http://10.10.10.47:32400') - .get('/security/resources?source=ab') + .get('/security/resources?source=tempora') .reply(200, { data: {} }); return sdk.security - .getSourceConnectionInformation('ab') + .getSourceConnectionInformation('tempora') .then((r: any) => expect(r.data).toEqual({ data: {} })); }); test('test will throw error if required fields missing', () => { const scope = nock('http://10.10.10.47:32400') - .get('/security/resources?source=pariatur') + .get('/security/resources?source=temporibus') .reply(200, { data: {} }); return expect( async () => await sdk.security.getSourceConnectionInformation(), @@ -67,10 +67,10 @@ describe('test Security', () => { test('test will throw error on a non-200 response', () => { const scope = nock('http://10.10.10.47:32400') - .get('/security/resources?source=consectetur') + .get('/security/resources?source=deleniti') .reply(404, { data: {} }); return expect( - async () => await sdk.security.getSourceConnectionInformation('consectetur'), + async () => await sdk.security.getSourceConnectionInformation('deleniti'), ).rejects.toThrow(); }); }); diff --git a/test/services/server/Server.test.ts b/test/services/server/Server.test.ts index 21d8b50d..124211ce 100644 --- a/test/services/server/Server.test.ts +++ b/test/services/server/Server.test.ts @@ -73,18 +73,18 @@ describe('test Server', () => { test('test api call', () => { const scope = nock('http://10.10.10.47:32400') .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: {} }); 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: {} })); }); test('test will throw error if required fields missing', () => { const scope = nock('http://10.10.10.47:32400') .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: {} }); return expect(async () => await sdk.server.getResizedPhoto()).rejects.toThrow(); @@ -93,11 +93,11 @@ describe('test Server', () => { test('test will throw error on a non-200 response', () => { const scope = nock('http://10.10.10.47:32400') .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: {} }); 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(); }); }); diff --git a/test/services/sessions/Sessions.test.ts b/test/services/sessions/Sessions.test.ts index 513bd1f2..25e69dc4 100644 --- a/test/services/sessions/Sessions.test.ts +++ b/test/services/sessions/Sessions.test.ts @@ -53,26 +53,26 @@ describe('test Sessions', () => { describe('test stopTranscodeSession', () => { test('test api call', () => { const scope = nock('http://10.10.10.47:32400') - .delete('/transcode/sessions/odit') + .delete('/transcode/sessions/et') .reply(200, { data: {} }); return sdk.sessions - .stopTranscodeSession('odit') + .stopTranscodeSession('et') .then((r: any) => expect(r.data).toEqual({ data: {} })); }); test('test will throw error if required fields missing', () => { const scope = nock('http://10.10.10.47:32400') - .delete('/transcode/sessions/porro') + .delete('/transcode/sessions/ipsam') .reply(200, { data: {} }); return expect(async () => await sdk.sessions.stopTranscodeSession()).rejects.toThrow(); }); test('test will throw error on a non-200 response', () => { const scope = nock('http://10.10.10.47:32400') - .delete('/transcode/sessions/minima') + .delete('/transcode/sessions/voluptas') .reply(404, { data: {} }); return expect( - async () => await sdk.sessions.stopTranscodeSession('minima'), + async () => await sdk.sessions.stopTranscodeSession('voluptas'), ).rejects.toThrow(); }); }); diff --git a/test/services/updater/Updater.test.ts b/test/services/updater/Updater.test.ts index 3e2f681b..ef37843a 100644 --- a/test/services/updater/Updater.test.ts +++ b/test/services/updater/Updater.test.ts @@ -31,10 +31,10 @@ describe('test Updater', () => { describe('test checkForUpdates', () => { test('test api call', () => { const scope = nock('http://10.10.10.47:32400') - .put('/updater/check?download=foo') + .put('/updater/check?download=3') .reply(200, { data: {} }); return sdk.updater - .checkForUpdates({ download: 'foo' }) + .checkForUpdates({ download: 3 }) .then((r: any) => expect(r.data).toEqual({ data: {} })); }); }); @@ -42,10 +42,10 @@ describe('test Updater', () => { describe('test applyUpdates', () => { test('test api call', () => { 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: {} }); return sdk.updater - .applyUpdates({ tonight: 'foo', skip: 'foo' }) + .applyUpdates({ tonight: 8, skip: 2 }) .then((r: any) => expect(r.data).toEqual({ data: {} })); }); }); diff --git a/test/services/video/Video.test.ts b/test/services/video/Video.test.ts index a718cc64..d7e4feeb 100644 --- a/test/services/video/Video.test.ts +++ b/test/services/video/Video.test.ts @@ -23,22 +23,22 @@ describe('test Video', () => { test('test api call', () => { const scope = nock('http://10.10.10.47:32400') .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: {} }); return sdk.video - .startUniversalTranscode(2, 'officiis', 8, 2, 'minima', { - fastSeek: 6, - directPlay: 9, + .startUniversalTranscode(2, 'eveniet', 3, 9, 'accusamus', { + fastSeek: 8, + directPlay: 6, directStream: 3, - subtitleSize: 8, - subtites: 'aut', - audioBoost: 5, - location: 'porro', - mediaBufferSize: 4, - session: 'deserunt', + subtitleSize: 4, + subtites: 'cupiditate', + audioBoost: 7, + location: 'nam', + mediaBufferSize: 1, + session: 'corrupti', addDebugOverlay: 4, - autoAdjustQuality: 2, + autoAdjustQuality: 5, }) .then((r: any) => expect(r.data).toEqual({ data: {} })); }); @@ -46,7 +46,7 @@ describe('test Video', () => { test('test will throw error if required fields missing', () => { const scope = nock('http://10.10.10.47:32400') .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: {} }); return expect(async () => await sdk.video.startUniversalTranscode()).rejects.toThrow(); @@ -55,23 +55,23 @@ describe('test Video', () => { test('test will throw error on a non-200 response', () => { const scope = nock('http://10.10.10.47:32400') .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: {} }); return expect( async () => - await sdk.video.startUniversalTranscode(8, 'officia', 6, 7, 'hic', { - fastSeek: 6, - directPlay: 2, - directStream: 6, - subtitleSize: 6, - subtites: 'veniam', - audioBoost: 5, - location: 'sunt', - mediaBufferSize: 5, - session: 'inventore', - addDebugOverlay: 9, - autoAdjustQuality: 5, + await sdk.video.startUniversalTranscode(6, 'fugit', 2, 1, 'iste', { + fastSeek: 2, + directPlay: 3, + directStream: 5, + subtitleSize: 5, + subtites: 'officiis', + audioBoost: 3, + location: 'alias', + mediaBufferSize: 9, + session: 'incidunt', + addDebugOverlay: 3, + autoAdjustQuality: 9, }), ).rejects.toThrow(); }); @@ -81,29 +81,18 @@ describe('test Video', () => { test('test api call', () => { const scope = nock('http://10.10.10.47:32400') .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: {} }); return sdk.video - .getTimeline( - 3, - 'dolor', - 'consequatur', - 8, - 4, - 7, - 'possimus ducimus doloribus neque quibusdam', - 3, - 5, - 4, - ) + .getTimeline(5, 'sapiente', 'nihil', 3, 4, 9, 'illo alias rerum modi minus', 3, 6, 7) .then((r: any) => expect(r.data).toEqual({ data: {} })); }); test('test will throw error if required fields missing', () => { const scope = nock('http://10.10.10.47:32400') .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: {} }); 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', () => { const scope = nock('http://10.10.10.47:32400') .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: {} }); return expect( async () => await sdk.video.getTimeline( 6, - 'voluptate', - 'alias', + 'quasi', + 'natus', 6, + 7, + 4, + 'accusamus mollitia aperiam sequi doloremque', + 4, 3, - 6, - 'assumenda consequatur aliquid natus saepe', - 2, - 9, 3, ), ).rejects.toThrow(); diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json index 7b398aa3..af9d6881 100644 --- a/tsconfig.eslint.json +++ b/tsconfig.eslint.json @@ -1,6 +1,6 @@ { "extends": "./tsconfig.json", "include": [ - "./src", "./test" + "./src", "./test", "./examples" ] }