From a1637fa1e25b60a88f7cfe50aac8953f50d55761 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 8 Jul 2021 10:55:16 +0200 Subject: [PATCH] Specify if we want to fallback to the server token --- shared/extra-utils/bulk/bulk-command.ts | 2 + .../custom-pages/custom-pages-command.ts | 4 ++ shared/extra-utils/feeds/feeds-command.ts | 2 + shared/extra-utils/logs/logs-command.ts | 2 + .../extra-utils/moderation/abuses-command.ts | 29 +++++++++++-- .../overviews/overviews-command.ts | 4 +- shared/extra-utils/search/search-command.ts | 15 +++---- shared/extra-utils/server/config-command.ts | 7 +++- .../server/contact-form-command.ts | 2 +- shared/extra-utils/server/debug-command.ts | 2 + shared/extra-utils/server/follows-command.ts | 11 +++-- shared/extra-utils/server/jobs-command.ts | 1 + shared/extra-utils/server/plugins-command.ts | 12 ++++++ .../extra-utils/server/redundancy-command.ts | 4 ++ shared/extra-utils/server/stats-command.ts | 1 + shared/extra-utils/shared/abstract-command.ts | 41 ++++++++++++------- shared/extra-utils/users/accounts-command.ts | 3 ++ shared/extra-utils/users/blocklist-command.ts | 5 +++ .../users/subscriptions-command.ts | 6 +++ shared/extra-utils/videos/live-command.ts | 3 ++ shared/extra-utils/videos/services-command.ts | 1 + 21 files changed, 122 insertions(+), 35 deletions(-) diff --git a/shared/extra-utils/bulk/bulk-command.ts b/shared/extra-utils/bulk/bulk-command.ts index fcbf04164..6dac6034f 100644 --- a/shared/extra-utils/bulk/bulk-command.ts +++ b/shared/extra-utils/bulk/bulk-command.ts @@ -12,8 +12,10 @@ export class BulkCommand extends AbstractCommand { return this.postBodyRequest({ ...options, + path: '/api/v1/bulk/remove-comments-of', fields: attributes, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 }) } diff --git a/shared/extra-utils/custom-pages/custom-pages-command.ts b/shared/extra-utils/custom-pages/custom-pages-command.ts index a062c9774..0dd77503e 100644 --- a/shared/extra-utils/custom-pages/custom-pages-command.ts +++ b/shared/extra-utils/custom-pages/custom-pages-command.ts @@ -9,7 +9,9 @@ export class CustomPagesCommand extends AbstractCommand { return this.getRequestBody({ ...options, + path, + implicitToken: false, defaultExpectedStatus: HttpStatusCode.OK_200 }) } @@ -22,8 +24,10 @@ export class CustomPagesCommand extends AbstractCommand { return this.putBodyRequest({ ...options, + path, fields: { content }, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 }) } diff --git a/shared/extra-utils/feeds/feeds-command.ts b/shared/extra-utils/feeds/feeds-command.ts index 8031adf92..2da4110a7 100644 --- a/shared/extra-utils/feeds/feeds-command.ts +++ b/shared/extra-utils/feeds/feeds-command.ts @@ -19,6 +19,7 @@ export class FeedCommand extends AbstractCommand { path, query: format ? { format } : undefined, accept: 'application/xml', + implicitToken: false, defaultExpectedStatus: HttpStatusCode.OK_200 }) } @@ -36,6 +37,7 @@ export class FeedCommand extends AbstractCommand { path, query, accept: 'application/json', + implicitToken: false, defaultExpectedStatus: HttpStatusCode.OK_200 }) } diff --git a/shared/extra-utils/logs/logs-command.ts b/shared/extra-utils/logs/logs-command.ts index f7594734d..f34c58c47 100644 --- a/shared/extra-utils/logs/logs-command.ts +++ b/shared/extra-utils/logs/logs-command.ts @@ -17,6 +17,7 @@ export class LogsCommand extends AbstractCommand { path, query: { startDate, endDate, level }, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.OK_200 }) } @@ -34,6 +35,7 @@ export class LogsCommand extends AbstractCommand { path, query: { startDate, endDate }, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.OK_200 }) } diff --git a/shared/extra-utils/moderation/abuses-command.ts b/shared/extra-utils/moderation/abuses-command.ts index 59126d0a9..03da0c85a 100644 --- a/shared/extra-utils/moderation/abuses-command.ts +++ b/shared/extra-utils/moderation/abuses-command.ts @@ -60,6 +60,7 @@ export class AbusesCommand extends AbstractCommand { path, fields: body, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.OK_200 })) } @@ -106,6 +107,7 @@ export class AbusesCommand extends AbstractCommand { path, query, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.OK_200 }) } @@ -138,6 +140,7 @@ export class AbusesCommand extends AbstractCommand { path, query, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.OK_200 }) } @@ -154,6 +157,7 @@ export class AbusesCommand extends AbstractCommand { path, fields: body, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 }) } @@ -164,7 +168,13 @@ export class AbusesCommand extends AbstractCommand { const { abuseId } = options const path = '/api/v1/abuses/' + abuseId - return this.deleteRequest({ ...options, path, defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 }) + return this.deleteRequest({ + ...options, + + path, + implicitToken: true, + defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 + }) } listMessages (options: OverrideCommandOptions & { @@ -173,7 +183,13 @@ export class AbusesCommand extends AbstractCommand { const { abuseId } = options const path = '/api/v1/abuses/' + abuseId + '/messages' - return this.getRequestBody>({ ...options, path, defaultExpectedStatus: HttpStatusCode.OK_200 }) + return this.getRequestBody>({ + ...options, + + path, + implicitToken: true, + defaultExpectedStatus: HttpStatusCode.OK_200 + }) } deleteMessage (options: OverrideCommandOptions & { @@ -183,7 +199,13 @@ export class AbusesCommand extends AbstractCommand { const { abuseId, messageId } = options const path = '/api/v1/abuses/' + abuseId + '/messages/' + messageId - return this.deleteRequest({ ...options, path, defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 }) + return this.deleteRequest({ + ...options, + + path, + implicitToken: true, + defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 + }) } addMessage (options: OverrideCommandOptions & { @@ -198,6 +220,7 @@ export class AbusesCommand extends AbstractCommand { path, fields: { message }, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.OK_200 }) } diff --git a/shared/extra-utils/overviews/overviews-command.ts b/shared/extra-utils/overviews/overviews-command.ts index 6f56b0ce4..e15644d94 100644 --- a/shared/extra-utils/overviews/overviews-command.ts +++ b/shared/extra-utils/overviews/overviews-command.ts @@ -7,7 +7,7 @@ export class OverviewsCommand extends AbstractCommand { getVideos (options: OverrideCommandOptions & { page: number }) { - const { token, page } = options + const { page } = options const path = '/api/v1/overviews/videos' const query = { page } @@ -15,9 +15,9 @@ export class OverviewsCommand extends AbstractCommand { return this.getRequestBody({ ...options, - token: token || null, path, query, + implicitToken: false, defaultExpectedStatus: HttpStatusCode.OK_200 }) } diff --git a/shared/extra-utils/search/search-command.ts b/shared/extra-utils/search/search-command.ts index d4cfab32b..7539a21ec 100644 --- a/shared/extra-utils/search/search-command.ts +++ b/shared/extra-utils/search/search-command.ts @@ -25,16 +25,15 @@ export class SearchCommand extends AbstractCommand { advancedChannelSearch (options: OverrideCommandOptions & { search: VideoChannelsSearchQuery }) { - const { search, token } = options + const { search } = options const path = '/api/v1/search/video-channels' return this.getRequestBody>({ ...options, - token: token || null, - path, query: search, + implicitToken: false, defaultExpectedStatus: HttpStatusCode.OK_200 }) } @@ -52,16 +51,15 @@ export class SearchCommand extends AbstractCommand { advancedPlaylistSearch (options: OverrideCommandOptions & { search: VideoPlaylistsSearchQuery }) { - const { search, token } = options + const { search } = options const path = '/api/v1/search/video-playlists' return this.getRequestBody>({ ...options, - token: token || null, - path, query: search, + implicitToken: false, defaultExpectedStatus: HttpStatusCode.OK_200 }) } @@ -85,16 +83,15 @@ export class SearchCommand extends AbstractCommand { advancedVideoSearch (options: OverrideCommandOptions & { search: VideosSearchQuery }) { - const { search, token } = options + const { search } = options const path = '/api/v1/search/videos' return this.getRequestBody>({ ...options, - token: token || null, - path, query: search, + implicitToken: false, defaultExpectedStatus: HttpStatusCode.OK_200 }) } diff --git a/shared/extra-utils/server/config-command.ts b/shared/extra-utils/server/config-command.ts index 959848706..f5d7fc5e3 100644 --- a/shared/extra-utils/server/config-command.ts +++ b/shared/extra-utils/server/config-command.ts @@ -24,8 +24,8 @@ export class ConfigCommand extends AbstractCommand { return this.getRequestBody({ ...options, - token: null, path, + implicitToken: false, defaultExpectedStatus: HttpStatusCode.OK_200 }) } @@ -36,8 +36,8 @@ export class ConfigCommand extends AbstractCommand { return this.getRequestBody({ ...options, - token: null, path, + implicitToken: false, defaultExpectedStatus: HttpStatusCode.OK_200 }) } @@ -49,6 +49,7 @@ export class ConfigCommand extends AbstractCommand { ...options, path, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.OK_200 }) } @@ -63,6 +64,7 @@ export class ConfigCommand extends AbstractCommand { path, fields: options.newCustomConfig, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.OK_200 }) } @@ -74,6 +76,7 @@ export class ConfigCommand extends AbstractCommand { ...options, path, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.OK_200 }) } diff --git a/shared/extra-utils/server/contact-form-command.ts b/shared/extra-utils/server/contact-form-command.ts index 943e5ccbb..8d034552b 100644 --- a/shared/extra-utils/server/contact-form-command.ts +++ b/shared/extra-utils/server/contact-form-command.ts @@ -23,8 +23,8 @@ export class ContactFormCommand extends AbstractCommand { ...options, path, - token: null, fields: body, + implicitToken: false, defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 }) } diff --git a/shared/extra-utils/server/debug-command.ts b/shared/extra-utils/server/debug-command.ts index eecbb1711..8b24b3067 100644 --- a/shared/extra-utils/server/debug-command.ts +++ b/shared/extra-utils/server/debug-command.ts @@ -11,6 +11,7 @@ export class DebugCommand extends AbstractCommand { ...options, path, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.OK_200 }) } @@ -26,6 +27,7 @@ export class DebugCommand extends AbstractCommand { path, fields: body, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 }) } diff --git a/shared/extra-utils/server/follows-command.ts b/shared/extra-utils/server/follows-command.ts index aba7bce82..4e1e56d7a 100644 --- a/shared/extra-utils/server/follows-command.ts +++ b/shared/extra-utils/server/follows-command.ts @@ -22,10 +22,9 @@ export class FollowsCommand extends AbstractCommand { return this.getRequestBody>({ ...options, - token: null, - path, query, + implicitToken: false, defaultExpectedStatus: HttpStatusCode.OK_200 }) } @@ -46,10 +45,9 @@ export class FollowsCommand extends AbstractCommand { return this.getRequestBody>({ ...options, - token: null, - path, query, + implicitToken: false, defaultExpectedStatus: HttpStatusCode.OK_200 }) } @@ -66,6 +64,7 @@ export class FollowsCommand extends AbstractCommand { path, fields: { hosts }, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 }) } @@ -79,6 +78,7 @@ export class FollowsCommand extends AbstractCommand { ...options, path, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 }) } @@ -92,6 +92,7 @@ export class FollowsCommand extends AbstractCommand { ...options, path, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 }) } @@ -105,6 +106,7 @@ export class FollowsCommand extends AbstractCommand { ...options, path, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 }) } @@ -118,6 +120,7 @@ export class FollowsCommand extends AbstractCommand { ...options, path, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 }) } diff --git a/shared/extra-utils/server/jobs-command.ts b/shared/extra-utils/server/jobs-command.ts index 758b4a4af..392b868c1 100644 --- a/shared/extra-utils/server/jobs-command.ts +++ b/shared/extra-utils/server/jobs-command.ts @@ -21,6 +21,7 @@ export class JobsCommand extends AbstractCommand { path, query, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.OK_200 }) } diff --git a/shared/extra-utils/server/plugins-command.ts b/shared/extra-utils/server/plugins-command.ts index f06e58a22..ff49d58c4 100644 --- a/shared/extra-utils/server/plugins-command.ts +++ b/shared/extra-utils/server/plugins-command.ts @@ -45,6 +45,7 @@ export class PluginsCommand extends AbstractCommand { pluginType, uninstalled }, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.OK_200 }) } @@ -75,6 +76,7 @@ export class PluginsCommand extends AbstractCommand { path, query, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.OK_200 }) } @@ -88,6 +90,7 @@ export class PluginsCommand extends AbstractCommand { ...options, path, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.OK_200 }) } @@ -104,6 +107,7 @@ export class PluginsCommand extends AbstractCommand { path, fields: { settings }, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 }) } @@ -117,6 +121,7 @@ export class PluginsCommand extends AbstractCommand { ...options, path, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.OK_200 }) } @@ -131,6 +136,7 @@ export class PluginsCommand extends AbstractCommand { ...options, path, + implicitToken: false, defaultExpectedStatus: HttpStatusCode.OK_200 }) } @@ -145,6 +151,7 @@ export class PluginsCommand extends AbstractCommand { ...options, path, + implicitToken: false, defaultExpectedStatus: HttpStatusCode.OK_200 }) } @@ -161,6 +168,7 @@ export class PluginsCommand extends AbstractCommand { path: apiPath, fields: { npmName, path }, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.OK_200 }) } @@ -177,6 +185,7 @@ export class PluginsCommand extends AbstractCommand { path: apiPath, fields: { npmName, path }, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.OK_200 }) } @@ -192,6 +201,7 @@ export class PluginsCommand extends AbstractCommand { path: apiPath, fields: { npmName }, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 }) } @@ -203,6 +213,7 @@ export class PluginsCommand extends AbstractCommand { ...options, path, + implicitToken: false, defaultExpectedStatus: HttpStatusCode.OK_200 }) } @@ -222,6 +233,7 @@ export class PluginsCommand extends AbstractCommand { path, query, + implicitToken: false, defaultExpectedStatus: HttpStatusCode.OK_200, redirects: 0 }) diff --git a/shared/extra-utils/server/redundancy-command.ts b/shared/extra-utils/server/redundancy-command.ts index d717d35f8..728332fdd 100644 --- a/shared/extra-utils/server/redundancy-command.ts +++ b/shared/extra-utils/server/redundancy-command.ts @@ -16,6 +16,7 @@ export class RedundancyCommand extends AbstractCommand { path, fields: { redundancyAllowed }, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 }) } @@ -42,6 +43,7 @@ export class RedundancyCommand extends AbstractCommand { target }, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.OK_200 }) } @@ -57,6 +59,7 @@ export class RedundancyCommand extends AbstractCommand { path, fields: { videoId }, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 }) } @@ -71,6 +74,7 @@ export class RedundancyCommand extends AbstractCommand { ...options, path, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 }) } diff --git a/shared/extra-utils/server/stats-command.ts b/shared/extra-utils/server/stats-command.ts index b51d9ceef..f0f02ca08 100644 --- a/shared/extra-utils/server/stats-command.ts +++ b/shared/extra-utils/server/stats-command.ts @@ -19,6 +19,7 @@ export class StatsCommand extends AbstractCommand { path, query, + implicitToken: false, defaultExpectedStatus: HttpStatusCode.OK_200 }) } diff --git a/shared/extra-utils/shared/abstract-command.ts b/shared/extra-utils/shared/abstract-command.ts index 38129d559..1e07e9469 100644 --- a/shared/extra-utils/shared/abstract-command.ts +++ b/shared/extra-utils/shared/abstract-command.ts @@ -1,5 +1,13 @@ import { HttpStatusCode } from '@shared/core-utils' -import { makeDeleteRequest, makeGetRequest, makePostBodyRequest, makePutBodyRequest, makeUploadRequest, unwrapBody, unwrapText } from '../requests/requests' +import { + makeDeleteRequest, + makeGetRequest, + makePostBodyRequest, + makePutBodyRequest, + makeUploadRequest, + unwrapBody, + unwrapText +} from '../requests/requests' import { ServerInfo } from '../server/servers' export interface OverrideCommandOptions { @@ -7,12 +15,14 @@ export interface OverrideCommandOptions { expectedStatus?: number } -interface CommonCommandOptions extends OverrideCommandOptions { +interface InternalCommonCommandOptions extends OverrideCommandOptions { path: string + // If we automatically send the server token if the token is not provided + implicitToken: boolean defaultExpectedStatus: number } -interface GetCommandOptions extends CommonCommandOptions { +interface InternalGetCommandOptions extends InternalCommonCommandOptions { query?: { [ id: string ]: any } contentType?: string accept?: string @@ -37,15 +47,15 @@ abstract class AbstractCommand { this.expectedStatus = status } - protected getRequestBody (options: GetCommandOptions) { + protected getRequestBody (options: InternalGetCommandOptions) { return unwrapBody(this.getRequest(options)) } - protected getRequestText (options: GetCommandOptions) { + protected getRequestText (options: InternalGetCommandOptions) { return unwrapText(this.getRequest(options)) } - protected getRequest (options: GetCommandOptions) { + protected getRequest (options: InternalGetCommandOptions) { const { redirects, query, contentType, accept } = options return makeGetRequest({ @@ -58,11 +68,11 @@ abstract class AbstractCommand { }) } - protected deleteRequest (options: CommonCommandOptions) { + protected deleteRequest (options: InternalCommonCommandOptions) { return makeDeleteRequest(this.buildCommonRequestOptions(options)) } - protected putBodyRequest (options: CommonCommandOptions & { + protected putBodyRequest (options: InternalCommonCommandOptions & { fields?: { [ fieldName: string ]: any } }) { const { fields } = options @@ -74,7 +84,7 @@ abstract class AbstractCommand { }) } - protected postBodyRequest (options: CommonCommandOptions & { + protected postBodyRequest (options: InternalCommonCommandOptions & { fields?: { [ fieldName: string ]: any } }) { const { fields } = options @@ -86,7 +96,7 @@ abstract class AbstractCommand { }) } - protected postUploadRequest (options: CommonCommandOptions & { + protected postUploadRequest (options: InternalCommonCommandOptions & { fields?: { [ fieldName: string ]: any } attaches?: any }) { @@ -101,7 +111,7 @@ abstract class AbstractCommand { }) } - protected putUploadRequest (options: CommonCommandOptions & { + protected putUploadRequest (options: InternalCommonCommandOptions & { fields?: { [ fieldName: string ]: any } attaches?: any }) { @@ -116,15 +126,18 @@ abstract class AbstractCommand { }) } - private buildCommonRequestOptions (options: CommonCommandOptions) { + private buildCommonRequestOptions (options: InternalCommonCommandOptions) { const { token, expectedStatus, defaultExpectedStatus, path } = options + const fallbackToken = options.implicitToken + ? this.server.accessToken + : undefined + return { url: this.server.url, path, - // Token can be null if we don't want to add it - token: token !== undefined ? token : this.server.accessToken, + token: token !== undefined ? token : fallbackToken, statusCodeExpected: expectedStatus ?? this.expectedStatus ?? defaultExpectedStatus } diff --git a/shared/extra-utils/users/accounts-command.ts b/shared/extra-utils/users/accounts-command.ts index 89c080e93..4cd1d2158 100644 --- a/shared/extra-utils/users/accounts-command.ts +++ b/shared/extra-utils/users/accounts-command.ts @@ -17,6 +17,7 @@ export class AccountsCommand extends AbstractCommand { path, query: { sort }, + implicitToken: false, defaultExpectedStatus: HttpStatusCode.OK_200 }) } @@ -30,6 +31,7 @@ export class AccountsCommand extends AbstractCommand { ...options, path, + implicitToken: false, defaultExpectedStatus: HttpStatusCode.OK_200 }) } @@ -48,6 +50,7 @@ export class AccountsCommand extends AbstractCommand { path, query, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.OK_200 }) } diff --git a/shared/extra-utils/users/blocklist-command.ts b/shared/extra-utils/users/blocklist-command.ts index 96afdc3fd..089b5a579 100644 --- a/shared/extra-utils/users/blocklist-command.ts +++ b/shared/extra-utils/users/blocklist-command.ts @@ -56,6 +56,7 @@ export class BlocklistCommand extends AbstractCommand { accountName: account, host: server }, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 }) } @@ -78,6 +79,7 @@ export class BlocklistCommand extends AbstractCommand { accountName: account, host: server }, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 }) } @@ -98,6 +100,7 @@ export class BlocklistCommand extends AbstractCommand { ...options, path, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 }) } @@ -116,6 +119,7 @@ export class BlocklistCommand extends AbstractCommand { ...options, path, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 }) } @@ -128,6 +132,7 @@ export class BlocklistCommand extends AbstractCommand { path, query: { start, count, sort }, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.OK_200 }) } diff --git a/shared/extra-utils/users/subscriptions-command.ts b/shared/extra-utils/users/subscriptions-command.ts index 94d2af67a..e998eb426 100644 --- a/shared/extra-utils/users/subscriptions-command.ts +++ b/shared/extra-utils/users/subscriptions-command.ts @@ -14,6 +14,7 @@ export class SubscriptionsCommand extends AbstractCommand { path, fields: { uri: options.targetUri }, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 }) } @@ -33,6 +34,7 @@ export class SubscriptionsCommand extends AbstractCommand { sort, search }, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.OK_200 }) } @@ -48,6 +50,7 @@ export class SubscriptionsCommand extends AbstractCommand { path, query: { sort }, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.OK_200 }) } @@ -61,6 +64,7 @@ export class SubscriptionsCommand extends AbstractCommand { ...options, path, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.OK_200 }) } @@ -74,6 +78,7 @@ export class SubscriptionsCommand extends AbstractCommand { ...options, path, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 }) } @@ -88,6 +93,7 @@ export class SubscriptionsCommand extends AbstractCommand { path, query: { 'uris[]': options.uris }, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.OK_200 }) } diff --git a/shared/extra-utils/videos/live-command.ts b/shared/extra-utils/videos/live-command.ts index e36c632ee..4f03c9127 100644 --- a/shared/extra-utils/videos/live-command.ts +++ b/shared/extra-utils/videos/live-command.ts @@ -23,6 +23,7 @@ export class LiveCommand extends AbstractCommand { ...options, path: path + '/' + options.videoId, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.OK_200 }) } @@ -39,6 +40,7 @@ export class LiveCommand extends AbstractCommand { path: path + '/' + videoId, fields, + implicitToken: true, defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 }) } @@ -59,6 +61,7 @@ export class LiveCommand extends AbstractCommand { path, attaches, fields: omit(fields, 'thumbnailfile', 'previewfile'), + implicitToken: true, defaultExpectedStatus: HttpStatusCode.OK_200 })) diff --git a/shared/extra-utils/videos/services-command.ts b/shared/extra-utils/videos/services-command.ts index 3b618ef66..313b7878c 100644 --- a/shared/extra-utils/videos/services-command.ts +++ b/shared/extra-utils/videos/services-command.ts @@ -22,6 +22,7 @@ export class ServicesCommand extends AbstractCommand { path, query, + implicitToken: false, defaultExpectedStatus: HttpStatusCode.OK_200 }) } -- 2.41.0