]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Specify if we want to fallback to the server token
authorChocobozzz <me@florianbigard.com>
Thu, 8 Jul 2021 08:55:16 +0000 (10:55 +0200)
committerChocobozzz <me@florianbigard.com>
Tue, 20 Jul 2021 13:27:17 +0000 (15:27 +0200)
21 files changed:
shared/extra-utils/bulk/bulk-command.ts
shared/extra-utils/custom-pages/custom-pages-command.ts
shared/extra-utils/feeds/feeds-command.ts
shared/extra-utils/logs/logs-command.ts
shared/extra-utils/moderation/abuses-command.ts
shared/extra-utils/overviews/overviews-command.ts
shared/extra-utils/search/search-command.ts
shared/extra-utils/server/config-command.ts
shared/extra-utils/server/contact-form-command.ts
shared/extra-utils/server/debug-command.ts
shared/extra-utils/server/follows-command.ts
shared/extra-utils/server/jobs-command.ts
shared/extra-utils/server/plugins-command.ts
shared/extra-utils/server/redundancy-command.ts
shared/extra-utils/server/stats-command.ts
shared/extra-utils/shared/abstract-command.ts
shared/extra-utils/users/accounts-command.ts
shared/extra-utils/users/blocklist-command.ts
shared/extra-utils/users/subscriptions-command.ts
shared/extra-utils/videos/live-command.ts
shared/extra-utils/videos/services-command.ts

index fcbf0416432452701ff66f50ed1ba6fd42c8cd6d..6dac6034f172719cae5cbc207a1b9de7b220d380 100644 (file)
@@ -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
     })
   }
index a062c9774fb14e593d28295c1827d3d81fe6f72c..0dd77503eecbc672fb62af7709652a34d9d1934f 100644 (file)
@@ -9,7 +9,9 @@ export class CustomPagesCommand extends AbstractCommand {
 
     return this.getRequestBody<CustomPage>({
       ...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
     })
   }
index 8031adf921b7753b9bc2a6ca1b68c0e923aa02c7..2da4110a7cd5d3f26f39934d6ddb7fbae99313c4 100644 (file)
@@ -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
     })
   }
index f7594734daa57876f8c8e33cf2b5714b112e0a1b..f34c58c47eb2e0962d928675071f9199f921e924 100644 (file)
@@ -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
     })
   }
index 59126d0a927e08619a8d620cc790daf1e17d4813..03da0c85a5332473ac6122678b73e371f982da7f 100644 (file)
@@ -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<ResultList<AbuseMessage>>({ ...options, path, defaultExpectedStatus: HttpStatusCode.OK_200 })
+    return this.getRequestBody<ResultList<AbuseMessage>>({
+      ...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
     })
   }
index 6f56b0ce481ff586e22246944eef4cddc25dc08f..e15644d9426cb7c5a980f8ef2833fa4067c3a7c3 100644 (file)
@@ -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<VideosOverview>({
       ...options,
 
-      token: token || null,
       path,
       query,
+      implicitToken: false,
       defaultExpectedStatus: HttpStatusCode.OK_200
     })
   }
index d4cfab32b5decf519d1eac20423603b0ce233c87..7539a21ecae8ab133cf362db37032f8374d98a65 100644 (file)
@@ -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<ResultList<VideoChannel>>({
       ...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<ResultList<VideoPlaylist>>({
       ...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<ResultList<Video>>({
       ...options,
 
-      token: token || null,
-
       path,
       query: search,
+      implicitToken: false,
       defaultExpectedStatus: HttpStatusCode.OK_200
     })
   }
index 959848706a01b3ae5b46b933e482f60987453159..f5d7fc5e342e8d257f692ba4fc4823333e86cab6 100644 (file)
@@ -24,8 +24,8 @@ export class ConfigCommand extends AbstractCommand {
     return this.getRequestBody<ServerConfig>({
       ...options,
 
-      token: null,
       path,
+      implicitToken: false,
       defaultExpectedStatus: HttpStatusCode.OK_200
     })
   }
@@ -36,8 +36,8 @@ export class ConfigCommand extends AbstractCommand {
     return this.getRequestBody<About>({
       ...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
     })
   }
index 943e5ccbbe57fbee2279ad3fa2f87772afdec721..8d034552b3f83e76254df5818ff6bbb887ecd6e8 100644 (file)
@@ -23,8 +23,8 @@ export class ContactFormCommand extends AbstractCommand {
       ...options,
 
       path,
-      token: null,
       fields: body,
+      implicitToken: false,
       defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
     })
   }
index eecbb17111e7abf1826a29f5a5bbae84da65bf22..8b24b3067272f4fd67dd51b34e3903c473c6f9ca 100644 (file)
@@ -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
     })
   }
index aba7bce829bd8321ff3f8ed7231d5490e126f316..4e1e56d7ad8c9c714b2c44324d7122a44fb6d4c3 100644 (file)
@@ -22,10 +22,9 @@ export class FollowsCommand extends AbstractCommand {
     return this.getRequestBody<ResultList<ActorFollow>>({
       ...options,
 
-      token: null,
-
       path,
       query,
+      implicitToken: false,
       defaultExpectedStatus: HttpStatusCode.OK_200
     })
   }
@@ -46,10 +45,9 @@ export class FollowsCommand extends AbstractCommand {
     return this.getRequestBody<ResultList<ActorFollow>>({
       ...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
     })
   }
index 758b4a4af5b8ee174daff43bbc64ac123bf7a6ba..392b868c168013c7cb25638505041894a6ec377c 100644 (file)
@@ -21,6 +21,7 @@ export class JobsCommand extends AbstractCommand {
 
       path,
       query,
+      implicitToken: true,
       defaultExpectedStatus: HttpStatusCode.OK_200
     })
   }
index f06e58a22fda15835acf0be9aa0d7e3d1f94af19..ff49d58c49557568fbdf2ba988fbb31fa6ba0e60 100644 (file)
@@ -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
     })
index d717d35f8f3a065f14225043d6ce96d487566046..728332fdd1a8c29a630e94698dc0e77a36cd5a19 100644 (file)
@@ -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
     })
   }
index b51d9ceefbb0f4e382dbe8479b013b292c975ea1..f0f02ca084b44a25f64b6814c33805866c492939 100644 (file)
@@ -19,6 +19,7 @@ export class StatsCommand extends AbstractCommand {
 
       path,
       query,
+      implicitToken: false,
       defaultExpectedStatus: HttpStatusCode.OK_200
     })
   }
index 38129d55903f414e8cae538624c495a3e9ea1ce5..1e07e946920ba34b1ac3c9a26b860c155fcdca9f 100644 (file)
@@ -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 <T> (options: GetCommandOptions) {
+  protected getRequestBody <T> (options: InternalGetCommandOptions) {
     return unwrapBody<T>(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
     }
index 89c080e93316f6e2a361fab7029ae8b8d61a7153..4cd1d2158a793803c9ac23c46ea9cfeccda9bfcf 100644 (file)
@@ -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
     })
   }
index 96afdc3fd5fa7f3254cc9d8111efaf06c7d31fe3..089b5a5791d10b1231c7c72c2a5293045a54bd29 100644 (file)
@@ -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
     })
   }
index 94d2af67ae30c3de64cbca348833377a4f5e161e..e998eb42646d2a1542d60ef151f835ea8fc9ec66 100644 (file)
@@ -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
     })
   }
index e36c632ee0abdb3e3bec66a657df005c57aec3c1..4f03c912783933a16ade8fa61693b6eb2db8ac33 100644 (file)
@@ -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
     }))
 
index 3b618ef66c623db1ab5486738738f5d8a7788fae..313b7878c59004037b57cc4c2653ab42a54f4af9 100644 (file)
@@ -22,6 +22,7 @@ export class ServicesCommand extends AbstractCommand {
 
       path,
       query,
+      implicitToken: false,
       defaultExpectedStatus: HttpStatusCode.OK_200
     })
   }