Socket
Socket
Sign inDemoInstall

@twurple/api

Package Overview
Dependencies
Maintainers
1
Versions
146
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@twurple/api - npm Package Compare versions

Comparing version 6.2.0 to 7.0.0-pre.0

es/endpoints/bits/CheermoteDisplayInfo.mjs

1

lib/client/BaseApiClient.d.ts

@@ -161,3 +161,2 @@ import type { Logger } from '@d-fischer/logger';

get _authProvider(): AuthProvider;
protected _getUserIdFromRequestContext(options: ContextApiCallOptions): string | null | undefined;
private _callApiUsingInitialToken;

@@ -164,0 +163,0 @@ private _callApiInternal;

@@ -55,3 +55,3 @@ "use strict";

async requestScopesForUser(user, scopes) {
await this._config.authProvider.getAccessTokenForUser(user, scopes);
await this._config.authProvider.getAccessTokenForUser(user, ...scopes.map(scope => [scope]));
}

@@ -109,3 +109,3 @@ /**

const contextUserId = options.canOverrideScopedUserContext
? this._getUserIdFromRequestContext(options)
? this._getUserIdFromRequestContext(options.userId)
: options.userId;

@@ -125,3 +125,3 @@ if (!contextUserId) {

}
const requestContextUserId = this._getUserIdFromRequestContext(options);
const requestContextUserId = this._getUserIdFromRequestContext(options.userId);
const accessToken = requestContextUserId === null

@@ -299,4 +299,5 @@ ? await authProvider.getAnyAccessToken()

// null means app access, undefined means none specified
_getUserIdFromRequestContext(options) {
return options.userId;
/** @internal */
_getUserIdFromRequestContext(contextUserId) {
return contextUserId;
}

@@ -303,0 +304,0 @@ async _callApiUsingInitialToken(options, accessToken, wasRefreshed = false) {

import { BaseApiClient } from './BaseApiClient';
/** @private */
export declare class NoContextApiClient extends BaseApiClient {
protected _getUserIdFromRequestContext(): null;
}
//# sourceMappingURL=NoContextApiClient.d.ts.map

@@ -9,2 +9,3 @@ "use strict";

let NoContextApiClient = class NoContextApiClient extends BaseApiClient_1.BaseApiClient {
/** @internal */
_getUserIdFromRequestContext() {

@@ -11,0 +12,0 @@ return null;

@@ -9,4 +9,3 @@ import { type Logger } from '@d-fischer/logger';

constructor(config: ApiConfig, logger: Logger, rateLimiter: RateLimiter<TwitchApiCallOptionsInternal, Response>, _userId: string);
protected _getUserIdFromRequestContext(): string | undefined;
}
//# sourceMappingURL=UserContextApiClient.d.ts.map

@@ -13,2 +13,3 @@ "use strict";

}
/** @internal */
_getUserIdFromRequestContext() {

@@ -15,0 +16,0 @@ return this._userId;

@@ -12,2 +12,7 @@ "use strict";

}
/** @internal */
_getUserContextIdWithDefault(userId) {
var _a;
return (_a = this._client._getUserIdFromRequestContext(userId)) !== null && _a !== void 0 ? _a : userId;
}
}

@@ -14,0 +19,0 @@ tslib_1.__decorate([

@@ -1,4 +0,4 @@

import type { CheermoteDisplayInfo, CheermoteFormat } from '@twurple/common';
import { BaseCheermoteList } from '@twurple/common';
import { DataObject } from '@twurple/common';
import { type HelixCheermoteData } from '../../interfaces/endpoints/bits.external';
import { type CheermoteDisplayInfo, type CheermoteFormat } from './CheermoteDisplayInfo';
/**

@@ -9,3 +9,3 @@ * A list of cheermotes you can use globally or in a specific channel, depending on how you fetched the list.

*/
export declare class HelixCheermoteList extends BaseCheermoteList<Record<string, HelixCheermoteData>> {
export declare class HelixCheermoteList extends DataObject<Record<string, HelixCheermoteData>> {
/** @private */

@@ -12,0 +12,0 @@ constructor(data: HelixCheermoteData[]);

@@ -12,3 +12,3 @@ "use strict";

*/
let HelixCheermoteList = class HelixCheermoteList extends common_1.BaseCheermoteList {
let HelixCheermoteList = class HelixCheermoteList extends common_1.DataObject {
/** @private */

@@ -15,0 +15,0 @@ constructor(data) {

@@ -122,5 +122,7 @@ import type { CommercialLength, UserIdResolvable } from '@twurple/common';

*
* This uses the token of the broadcaster by default.
* If you want to execute this in the context of another user (who has to be moderator of the channel)
* you can do so using [user context overrides](/docs/auth/concepts/context-switching).
*
* @param broadcaster The broadcaster you want to get a list of followers for.
* @param moderator The broadcaster or one of the broadcaster’s moderators.
* The token of this user will be used to fetch the followers.
* @param user An optional user to determine if this user follows the broadcaster.

@@ -133,17 +135,21 @@ * If specified, the response contains this user if they follow the broadcaster.

*/
getChannelFollowers(broadcaster: UserIdResolvable, moderator: UserIdResolvable, user?: UserIdResolvable, pagination?: HelixForwardPagination): Promise<HelixPaginatedResultWithTotal<HelixChannelFollower>>;
getChannelFollowers(broadcaster: UserIdResolvable, user?: UserIdResolvable, pagination?: HelixForwardPagination): Promise<HelixPaginatedResultWithTotal<HelixChannelFollower>>;
/**
* Creates a paginator for users that follow the specified broadcaster.
*
* This uses the token of the broadcaster by default.
* If you want to execute this in the context of another user (who has to be moderator of the channel)
* you can do so using [user context overrides](/docs/auth/concepts/context-switching).
*
* @param broadcaster The broadcaster for whom you are getting a list of followers.
* @param moderator The broadcaster or one of the broadcaster’s moderators.
* The token of this user will be used to fetch the followers.
*
* @expandParams
*/
getChannelFollowersPaginated(broadcaster: UserIdResolvable, moderator: UserIdResolvable): HelixPaginatedRequestWithTotal<HelixChannelFollowerData, HelixChannelFollower>;
getChannelFollowersPaginated(broadcaster: UserIdResolvable): HelixPaginatedRequestWithTotal<HelixChannelFollowerData, HelixChannelFollower>;
/**
* Gets a list of broadcasters that the specified user follows. You can also use this endpoint to see whether the user follows a specific broadcaster.
* Gets a list of broadcasters that the specified user follows.
* You can also use this endpoint to see whether the user follows a specific broadcaster.
*
* @param user The user that's getting a list of followed channels. This ID must match the user ID in the access token.
* @param user The user that's getting a list of followed channels.
* This ID must match the user ID in the access token.
* @param broadcaster An optional broadcaster to determine if the user follows this broadcaster.

@@ -155,3 +161,3 @@ * If specified, the response contains this broadcaster if the user follows them.

*/
getFollowedChannels(user: UserIdResolvable, broadcaster?: UserIdResolvable, pagination?: HelixForwardPagination): Promise<HelixPaginatedResult<HelixFollowedChannel>>;
getFollowedChannels(user: UserIdResolvable, broadcaster?: UserIdResolvable, pagination?: HelixForwardPagination): Promise<HelixPaginatedResultWithTotal<HelixFollowedChannel>>;
/**

@@ -158,0 +164,0 @@ * Creates a paginator for broadcasters that the specified user follows.

@@ -242,5 +242,7 @@ "use strict";

*
* This uses the token of the broadcaster by default.
* If you want to execute this in the context of another user (who has to be moderator of the channel)
* you can do so using [user context overrides](/docs/auth/concepts/context-switching).
*
* @param broadcaster The broadcaster you want to get a list of followers for.
* @param moderator The broadcaster or one of the broadcaster’s moderators.
* The token of this user will be used to fetch the followers.
* @param user An optional user to determine if this user follows the broadcaster.

@@ -253,3 +255,3 @@ * If specified, the response contains this user if they follow the broadcaster.

*/
async getChannelFollowers(broadcaster, moderator, user, pagination) {
async getChannelFollowers(broadcaster, user, pagination) {
const result = await this._client.callApi({

@@ -259,3 +261,4 @@ type: 'helix',

method: 'GET',
userId: (0, common_1.extractUserId)(moderator),
userId: (0, common_1.extractUserId)(broadcaster),
canOverrideScopedUserContext: true,
scopes: ['moderator:read:followers'],

@@ -272,13 +275,16 @@ query: {

*
* This uses the token of the broadcaster by default.
* If you want to execute this in the context of another user (who has to be moderator of the channel)
* you can do so using [user context overrides](/docs/auth/concepts/context-switching).
*
* @param broadcaster The broadcaster for whom you are getting a list of followers.
* @param moderator The broadcaster or one of the broadcaster’s moderators.
* The token of this user will be used to fetch the followers.
*
* @expandParams
*/
getChannelFollowersPaginated(broadcaster, moderator) {
getChannelFollowersPaginated(broadcaster) {
return new HelixPaginatedRequestWithTotal_1.HelixPaginatedRequestWithTotal({
url: 'channels/followers',
method: 'GET',
userId: (0, common_1.extractUserId)(moderator),
userId: (0, common_1.extractUserId)(broadcaster),
canOverrideScopedUserContext: true,
scopes: ['moderator:read:followers'],

@@ -289,5 +295,7 @@ query: (0, channel_external_1.createChannelFollowerQuery)(broadcaster)

/**
* Gets a list of broadcasters that the specified user follows. You can also use this endpoint to see whether the user follows a specific broadcaster.
* Gets a list of broadcasters that the specified user follows.
* You can also use this endpoint to see whether the user follows a specific broadcaster.
*
* @param user The user that's getting a list of followed channels. This ID must match the user ID in the access token.
* @param user The user that's getting a list of followed channels.
* This ID must match the user ID in the access token.
* @param broadcaster An optional broadcaster to determine if the user follows this broadcaster.

@@ -294,0 +302,0 @@ * If specified, the response contains this broadcaster if the user follows them.

@@ -33,5 +33,7 @@ import type { UserIdResolvable } from '@twurple/common';

*
* This uses the token of the broadcaster by default.
* If you want to execute this in the context of another user (who has to be moderator of the channel)
* you can do so using [user context overrides](/docs/auth/concepts/context-switching).
*
* @param broadcaster The broadcaster whose list of chatters you want to get.
* @param moderator The broadcaster or one of the broadcaster’s moderators.
* The token of this user will be used to fetch the chatters.
* @param pagination

@@ -41,13 +43,15 @@ *

*/
getChatters(broadcaster: UserIdResolvable, moderator: UserIdResolvable, pagination?: HelixForwardPagination): Promise<HelixPaginatedResultWithTotal<HelixChatChatter>>;
getChatters(broadcaster: UserIdResolvable, pagination?: HelixForwardPagination): Promise<HelixPaginatedResultWithTotal<HelixChatChatter>>;
/**
* Creates a paginator for users that are connected to the broadcaster’s chat session.
*
* This uses the token of the broadcaster by default.
* If you want to execute this in the context of another user (who has to be moderator of the channel)
* you can do so using [user context overrides](/docs/auth/concepts/context-switching).
*
* @param broadcaster The broadcaster whose list of chatters you want to get.
* @param moderator The broadcaster or one of the broadcaster’s moderators.
* The token of this user will be used to fetch the chatters.
*
* @expandParams
*/
getChattersPaginated(broadcaster: UserIdResolvable, moderator: UserIdResolvable): HelixPaginatedRequestWithTotal<HelixChatChatterData, HelixChatChatter>;
getChattersPaginated(broadcaster: UserIdResolvable): HelixPaginatedRequestWithTotal<HelixChatChatterData, HelixChatChatter>;
/**

@@ -88,33 +92,33 @@ * Gets all global badges.

*
* This uses the token of the broadcaster by default.
* If you want to execute this in the context of another user (who has to be moderator of the channel)
* you can do so using [user context overrides](/docs/auth/concepts/context-switching).
*
* @param broadcaster The broadcaster the chat belongs to.
* @param moderator The moderator the request is on behalf of.
*
* This is the user your user token needs to represent.
* You can get your own settings by setting `broadcaster` and `moderator` to the same user.
*/
getSettingsPrivileged(broadcaster: UserIdResolvable, moderator: UserIdResolvable): Promise<HelixPrivilegedChatSettings>;
getSettingsPrivileged(broadcaster: UserIdResolvable): Promise<HelixPrivilegedChatSettings>;
/**
* Updates the settings of a broadcaster's chat.
*
* This uses the token of the broadcaster by default.
* If you want to execute this in the context of another user (who has to be moderator of the channel)
* you can do so using [user context overrides](/docs/auth/concepts/context-switching).
*
* @expandParams
*
* @param broadcaster The broadcaster the chat belongs to.
* @param moderator The moderator the request is on behalf of.
*
* This is the user your user token needs to represent.
* You can get your own settings by setting `broadcaster` and `moderator` to the same user.
* @param settings The settings to change.
*/
updateSettings(broadcaster: UserIdResolvable, moderator: UserIdResolvable, settings: HelixUpdateChatSettingsParams): Promise<HelixPrivilegedChatSettings>;
updateSettings(broadcaster: UserIdResolvable, settings: HelixUpdateChatSettingsParams): Promise<HelixPrivilegedChatSettings>;
/**
* Sends an announcement to a broadcaster's chat.
*
* This uses the token of the broadcaster by default.
* If you want to execute this in the context of another user (who has to be moderator of the channel)
* you can do so using [user context overrides](/docs/auth/concepts/context-switching).
*
* @param broadcaster The broadcaster the chat belongs to.
* @param moderator The moderator the request is on behalf of.
*
* This is the user your user token needs to represent.
* You can send an announcement to your own chat by setting `broadcaster` and `moderator` to the same user.
* @param announcement The announcement to send.
*/
sendAnnouncement(broadcaster: UserIdResolvable, moderator: UserIdResolvable, announcement: HelixSendChatAnnouncementParams): Promise<void>;
sendAnnouncement(broadcaster: UserIdResolvable, announcement: HelixSendChatAnnouncementParams): Promise<void>;
/**

@@ -151,9 +155,12 @@ * Gets the chat colors for a list of users.

*
* This uses the token of the broadcaster by default.
* If you want to execute this in the context of another user (who has to be moderator of the channel)
* you can do so using [user context overrides](/docs/auth/concepts/context-switching).
*
* @param from The ID of the broadcaster that’s sending the shoutout.
* @param to The ID of the broadcaster that’s receiving the shoutout.
* @param moderator The ID of the broadcaster or a user that is one of the broadcaster’s moderators.
* This ID must match the user ID in the access token.
*/
shoutoutUser(from: UserIdResolvable, to: UserIdResolvable, moderator: UserIdResolvable): Promise<void>;
shoutoutUser(from: UserIdResolvable, to: UserIdResolvable): Promise<void>;
private _createModeratorActionQuery;
}
//# sourceMappingURL=HelixChatApi.d.ts.map

@@ -38,5 +38,7 @@ "use strict";

*
* This uses the token of the broadcaster by default.
* If you want to execute this in the context of another user (who has to be moderator of the channel)
* you can do so using [user context overrides](/docs/auth/concepts/context-switching).
*
* @param broadcaster The broadcaster whose list of chatters you want to get.
* @param moderator The broadcaster or one of the broadcaster’s moderators.
* The token of this user will be used to fetch the chatters.
* @param pagination

@@ -46,10 +48,12 @@ *

*/
async getChatters(broadcaster, moderator, pagination) {
async getChatters(broadcaster, pagination) {
const broadcasterId = (0, common_1.extractUserId)(broadcaster);
const result = await this._client.callApi({
type: 'helix',
url: 'chat/chatters',
userId: (0, common_1.extractUserId)(moderator),
userId: broadcasterId,
canOverrideScopedUserContext: true,
scopes: ['moderator:read:chatters'],
query: {
...(0, generic_external_1.createModeratorActionQuery)(broadcaster, moderator),
...this._createModeratorActionQuery(broadcasterId),
...(0, HelixPagination_1.createPaginationQuery)(pagination)

@@ -63,14 +67,18 @@ }

*
* This uses the token of the broadcaster by default.
* If you want to execute this in the context of another user (who has to be moderator of the channel)
* you can do so using [user context overrides](/docs/auth/concepts/context-switching).
*
* @param broadcaster The broadcaster whose list of chatters you want to get.
* @param moderator The broadcaster or one of the broadcaster’s moderators.
* The token of this user will be used to fetch the chatters.
*
* @expandParams
*/
getChattersPaginated(broadcaster, moderator) {
getChattersPaginated(broadcaster) {
const broadcasterId = (0, common_1.extractUserId)(broadcaster);
return new HelixPaginatedRequestWithTotal_1.HelixPaginatedRequestWithTotal({
url: 'chat/chatters',
userId: (0, common_1.extractUserId)(moderator),
userId: broadcasterId,
canOverrideScopedUserContext: true,
scopes: ['moderator:read:chatters'],
query: (0, generic_external_1.createModeratorActionQuery)(broadcaster, moderator)
query: this._createModeratorActionQuery(broadcasterId)
}, this._client, data => new HelixChatChatter_1.HelixChatChatter(data, this._client));

@@ -156,15 +164,17 @@ }

*
* This uses the token of the broadcaster by default.
* If you want to execute this in the context of another user (who has to be moderator of the channel)
* you can do so using [user context overrides](/docs/auth/concepts/context-switching).
*
* @param broadcaster The broadcaster the chat belongs to.
* @param moderator The moderator the request is on behalf of.
*
* This is the user your user token needs to represent.
* You can get your own settings by setting `broadcaster` and `moderator` to the same user.
*/
async getSettingsPrivileged(broadcaster, moderator) {
async getSettingsPrivileged(broadcaster) {
const broadcasterId = (0, common_1.extractUserId)(broadcaster);
const result = await this._client.callApi({
type: 'helix',
url: 'chat/settings',
userId: (0, common_1.extractUserId)(moderator),
userId: broadcasterId,
canOverrideScopedUserContext: true,
scopes: ['moderator:read:chat_settings'],
query: (0, generic_external_1.createModeratorActionQuery)(broadcaster, moderator)
query: this._createModeratorActionQuery(broadcasterId)
});

@@ -176,12 +186,13 @@ return new HelixPrivilegedChatSettings_1.HelixPrivilegedChatSettings(result.data[0]);

*
* This uses the token of the broadcaster by default.
* If you want to execute this in the context of another user (who has to be moderator of the channel)
* you can do so using [user context overrides](/docs/auth/concepts/context-switching).
*
* @expandParams
*
* @param broadcaster The broadcaster the chat belongs to.
* @param moderator The moderator the request is on behalf of.
*
* This is the user your user token needs to represent.
* You can get your own settings by setting `broadcaster` and `moderator` to the same user.
* @param settings The settings to change.
*/
async updateSettings(broadcaster, moderator, settings) {
async updateSettings(broadcaster, settings) {
const broadcasterId = (0, common_1.extractUserId)(broadcaster);
const result = await this._client.callApi({

@@ -191,5 +202,6 @@ type: 'helix',

method: 'PATCH',
userId: (0, common_1.extractUserId)(moderator),
userId: broadcasterId,
canOverrideScopedUserContext: true,
scopes: ['moderator:manage:chat_settings'],
query: (0, generic_external_1.createModeratorActionQuery)(broadcaster, moderator),
query: this._createModeratorActionQuery(broadcasterId),
jsonBody: (0, chat_external_1.createChatSettingsUpdateBody)(settings)

@@ -202,10 +214,11 @@ });

*
* This uses the token of the broadcaster by default.
* If you want to execute this in the context of another user (who has to be moderator of the channel)
* you can do so using [user context overrides](/docs/auth/concepts/context-switching).
*
* @param broadcaster The broadcaster the chat belongs to.
* @param moderator The moderator the request is on behalf of.
*
* This is the user your user token needs to represent.
* You can send an announcement to your own chat by setting `broadcaster` and `moderator` to the same user.
* @param announcement The announcement to send.
*/
async sendAnnouncement(broadcaster, moderator, announcement) {
async sendAnnouncement(broadcaster, announcement) {
const broadcasterId = (0, common_1.extractUserId)(broadcaster);
await this._client.callApi({

@@ -215,5 +228,6 @@ type: 'helix',

method: 'POST',
userId: (0, common_1.extractUserId)(moderator),
userId: broadcasterId,
canOverrideScopedUserContext: true,
scopes: ['moderator:manage:announcements'],
query: (0, generic_external_1.createModeratorActionQuery)(broadcaster, moderator),
query: this._createModeratorActionQuery(broadcasterId),
jsonBody: {

@@ -283,8 +297,11 @@ message: announcement.message,

*
* This uses the token of the broadcaster by default.
* If you want to execute this in the context of another user (who has to be moderator of the channel)
* you can do so using [user context overrides](/docs/auth/concepts/context-switching).
*
* @param from The ID of the broadcaster that’s sending the shoutout.
* @param to The ID of the broadcaster that’s receiving the shoutout.
* @param moderator The ID of the broadcaster or a user that is one of the broadcaster’s moderators.
* This ID must match the user ID in the access token.
*/
async shoutoutUser(from, to, moderator) {
async shoutoutUser(from, to) {
const fromId = (0, common_1.extractUserId)(from);
await this._client.callApi({

@@ -294,7 +311,11 @@ type: 'helix',

method: 'POST',
userId: (0, common_1.extractUserId)(moderator),
userId: fromId,
canOverrideScopedUserContext: true,
scopes: ['moderator:manage:shoutouts'],
query: (0, chat_external_1.createShoutoutQuery)(from, to, moderator)
query: (0, chat_external_1.createShoutoutQuery)(from, to, this._getUserContextIdWithDefault(fromId))
});
}
_createModeratorActionQuery(broadcasterId) {
return (0, generic_external_1.createModeratorActionQuery)(broadcasterId, this._getUserContextIdWithDefault(broadcasterId));
}
};

@@ -301,0 +322,0 @@ HelixChatApi = tslib_1.__decorate([

@@ -41,3 +41,3 @@ import { DataObject } from '@twurple/common';

/**
* Whether unique chat mode (formerly known as r9k) is enabled.
* Whether unique chat mode is enabled.
*/

@@ -44,0 +44,0 @@ get uniqueChatModeEnabled(): boolean;

@@ -58,3 +58,3 @@ "use strict";

/**
* Whether unique chat mode (formerly known as r9k) is enabled.
* Whether unique chat mode is enabled.
*/

@@ -61,0 +61,0 @@ get uniqueChatModeEnabled() {

@@ -33,4 +33,2 @@ import type { UserIdResolvable } from '@twurple/common';

*
* Requires an app access token to work; does not work with user tokens.
*
* @param pagination

@@ -43,4 +41,2 @@ *

* Creates a paginator for the current EventSub subscriptions for the current client.
*
* Requires an app access token to work; does not work with user tokens.
*/

@@ -51,4 +47,2 @@ getSubscriptionsPaginated(): HelixPaginatedEventSubSubscriptionsRequest;

*
* Requires an app access token to work; does not work with user tokens.
*
* @param status The status of the subscriptions to get.

@@ -63,4 +57,2 @@ * @param pagination

*
* Requires an app access token to work; does not work with user tokens.
*
* @param status The status of the subscriptions to get.

@@ -72,4 +64,2 @@ */

*
* Requires an app access token to work; does not work with user tokens.
*
* @param type The type of the subscriptions to get.

@@ -84,4 +74,2 @@ * @param pagination

*
* Requires an app access token to work; does not work with user tokens.
*
* @param type The type of the subscriptions to get.

@@ -93,4 +81,2 @@ */

*
* Requires an app access token to work; does not work with user tokens.
*
* @param user The user to get subscriptions for.

@@ -105,4 +91,2 @@ * @param pagination

*
* Requires an app access token to work; does not work with user tokens.
*
* @param user The user to get subscriptions for.

@@ -114,3 +98,4 @@ */

*
* Requires an app access token to work; does not work with user tokens.
* You can only create WebHook transport subscriptions using app tokens
* and WebSocket transport subscriptions using user tokens.
*

@@ -123,5 +108,6 @@ * @param type The type of the event.

* @param requiredScopeSet The scope set required by the subscription. Will only be checked for applicable transports.
* @param canOverrideScopedUserContext Whether the auth user context can be overridden.
* @param isBatched Whether to enable batching for the subscription. Is only supported for select topics.
*/
createSubscription(type: string, version: string, condition: Record<string, unknown>, transport: HelixEventSubTransportOptions, user?: UserIdResolvable, requiredScopeSet?: string[], isBatched?: boolean): Promise<HelixEventSubSubscription>;
createSubscription(type: string, version: string, condition: Record<string, unknown>, transport: HelixEventSubTransportOptions, user?: UserIdResolvable, requiredScopeSet?: string[], canOverrideScopedUserContext?: boolean, isBatched?: boolean): Promise<HelixEventSubSubscription>;
/**

@@ -165,5 +151,2 @@ * Deletes a subscription.

*
* @deprecated This can not be used by clients that didn't have an active subscription on Feb 17th, 2023.
* Use {@link HelixEventSubApi#subscribeToChannelFollowEventsV2} instead.
*
* @param broadcaster The broadcaster you want to listen to follow events for.

@@ -174,10 +157,2 @@ * @param transport The transport options.

/**
* Subscribe to events that represent a user following a channel.
*
* @param broadcaster The broadcaster you want to listen to follow events for.
* @param moderator A user that has permission to read followers in the broadcaster's channel.
* @param transport The transport options.
*/
subscribeToChannelFollowEventsV2(broadcaster: UserIdResolvable, moderator: UserIdResolvable, transport: HelixEventSubTransportOptions): Promise<HelixEventSubSubscription>;
/**
* Subscribe to events that represent a user subscribing to a channel.

@@ -263,6 +238,5 @@ *

* @param broadcaster The broadcaster you want to listen to Shield Mode activation events for.
* @param moderator A user that has permission to read Shield Mode status in the broadcaster's channel.
* @param transport The transport options.
*/
subscribeToChannelShieldModeBeginEvents(broadcaster: UserIdResolvable, moderator: UserIdResolvable, transport: HelixEventSubTransportOptions): Promise<HelixEventSubSubscription>;
subscribeToChannelShieldModeBeginEvents(broadcaster: UserIdResolvable, transport: HelixEventSubTransportOptions): Promise<HelixEventSubSubscription>;
/**

@@ -272,6 +246,5 @@ * Subscribe to events that represent Shield Mode being deactivated in a channel.

* @param broadcaster The broadcaster you want to listen to Shield Mode deactivation events for.
* @param moderator A user that has permission to read Shield Mode status in the broadcaster's channel.
* @param transport The transport options.
*/
subscribeToChannelShieldModeEndEvents(broadcaster: UserIdResolvable, moderator: UserIdResolvable, transport: HelixEventSubTransportOptions): Promise<HelixEventSubSubscription>;
subscribeToChannelShieldModeEndEvents(broadcaster: UserIdResolvable, transport: HelixEventSubTransportOptions): Promise<HelixEventSubSubscription>;
/**

@@ -467,6 +440,5 @@ * Subscribe to events that represent a moderator being added to a channel.

* @param broadcaster The broadcaster for which you want to listen to outgoing shoutout events.
* @param moderator A user that has permission to see or manage shoutout events in the broadcaster's channel.
* @param transport The transport options.
*/
subscribeToChannelShoutoutCreateEvents(broadcaster: UserIdResolvable, moderator: UserIdResolvable, transport: HelixEventSubTransportOptions): Promise<HelixEventSubSubscription>;
subscribeToChannelShoutoutCreateEvents(broadcaster: UserIdResolvable, transport: HelixEventSubTransportOptions): Promise<HelixEventSubSubscription>;
/**

@@ -476,6 +448,5 @@ * Subscribe to events that represent a broadcaster being shouting out by another broadcaster.

* @param broadcaster The broadcaster for which you want to listen to incoming shoutout events.
* @param moderator A user that has permission to see or manage shoutout events in the broadcaster's channel.
* @param transport The transport options.
*/
subscribeToChannelShoutoutReceiveEvents(broadcaster: UserIdResolvable, moderator: UserIdResolvable, transport: HelixEventSubTransportOptions): Promise<HelixEventSubSubscription>;
subscribeToChannelShoutoutReceiveEvents(broadcaster: UserIdResolvable, transport: HelixEventSubTransportOptions): Promise<HelixEventSubSubscription>;
/**

@@ -482,0 +453,0 @@ * Subscribe to events that represent an extension Bits transaction.

@@ -39,4 +39,2 @@ "use strict";

*
* Requires an app access token to work; does not work with user tokens.
*
* @param pagination

@@ -60,4 +58,2 @@ *

* Creates a paginator for the current EventSub subscriptions for the current client.
*
* Requires an app access token to work; does not work with user tokens.
*/

@@ -70,4 +66,2 @@ getSubscriptionsPaginated() {

*
* Requires an app access token to work; does not work with user tokens.
*
* @param status The status of the subscriptions to get.

@@ -96,4 +90,2 @@ * @param pagination

*
* Requires an app access token to work; does not work with user tokens.
*
* @param status The status of the subscriptions to get.

@@ -107,4 +99,2 @@ */

*
* Requires an app access token to work; does not work with user tokens.
*
* @param type The type of the subscriptions to get.

@@ -133,4 +123,2 @@ * @param pagination

*
* Requires an app access token to work; does not work with user tokens.
*
* @param type The type of the subscriptions to get.

@@ -144,4 +132,2 @@ */

*
* Requires an app access token to work; does not work with user tokens.
*
* @param user The user to get subscriptions for.

@@ -171,4 +157,2 @@ * @param pagination

*
* Requires an app access token to work; does not work with user tokens.
*
* @param user The user to get subscriptions for.

@@ -183,3 +167,4 @@ */

*
* Requires an app access token to work; does not work with user tokens.
* You can only create WebHook transport subscriptions using app tokens
* and WebSocket transport subscriptions using user tokens.
*

@@ -192,5 +177,6 @@ * @param type The type of the event.

* @param requiredScopeSet The scope set required by the subscription. Will only be checked for applicable transports.
* @param canOverrideScopedUserContext Whether the auth user context can be overridden.
* @param isBatched Whether to enable batching for the subscription. Is only supported for select topics.
*/
async createSubscription(type, version, condition, transport, user, requiredScopeSet, isBatched) {
async createSubscription(type, version, condition, transport, user, requiredScopeSet, canOverrideScopedUserContext, isBatched) {
const usesAppAuth = transport.method === 'webhook';

@@ -278,5 +264,2 @@ const scopes = usesAppAuth ? undefined : requiredScopeSet;

*
* @deprecated This can not be used by clients that didn't have an active subscription on Feb 17th, 2023.
* Use {@link HelixEventSubApi#subscribeToChannelFollowEventsV2} instead.
*
* @param broadcaster The broadcaster you want to listen to follow events for.

@@ -286,15 +269,6 @@ * @param transport The transport options.

async subscribeToChannelFollowEvents(broadcaster, transport) {
return await this.createSubscription('channel.follow', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster);
const broadcasterId = (0, common_1.extractUserId)(broadcaster);
return await this.createSubscription('channel.follow', '2', (0, eventSub_external_1.createEventSubModeratorCondition)(broadcasterId, this._getUserContextIdWithDefault(broadcasterId)), transport, broadcasterId, ['moderator:read:followers'], true);
}
/**
* Subscribe to events that represent a user following a channel.
*
* @param broadcaster The broadcaster you want to listen to follow events for.
* @param moderator A user that has permission to read followers in the broadcaster's channel.
* @param transport The transport options.
*/
async subscribeToChannelFollowEventsV2(broadcaster, moderator, transport) {
return await this.createSubscription('channel.follow', '2', (0, eventSub_external_1.createEventSubModeratorCondition)(broadcaster, moderator), transport, moderator, ['moderator:read:followers']);
}
/**
* Subscribe to events that represent a user subscribing to a channel.

@@ -402,7 +376,7 @@ *

* @param broadcaster The broadcaster you want to listen to Shield Mode activation events for.
* @param moderator A user that has permission to read Shield Mode status in the broadcaster's channel.
* @param transport The transport options.
*/
async subscribeToChannelShieldModeBeginEvents(broadcaster, moderator, transport) {
return await this.createSubscription('channel.shield_mode.begin', '1', (0, eventSub_external_1.createEventSubModeratorCondition)(broadcaster, moderator), transport, broadcaster, ['moderator:read:shield_mode', 'moderator:manage:shield_mode']);
async subscribeToChannelShieldModeBeginEvents(broadcaster, transport) {
const broadcasterId = (0, common_1.extractUserId)(broadcaster);
return await this.createSubscription('channel.shield_mode.begin', '1', (0, eventSub_external_1.createEventSubModeratorCondition)(broadcasterId, this._getUserContextIdWithDefault(broadcasterId)), transport, broadcasterId, ['moderator:read:shield_mode', 'moderator:manage:shield_mode'], true);
}

@@ -413,7 +387,7 @@ /**

* @param broadcaster The broadcaster you want to listen to Shield Mode deactivation events for.
* @param moderator A user that has permission to read Shield Mode status in the broadcaster's channel.
* @param transport The transport options.
*/
async subscribeToChannelShieldModeEndEvents(broadcaster, moderator, transport) {
return await this.createSubscription('channel.shield_mode.end', '1', (0, eventSub_external_1.createEventSubModeratorCondition)(broadcaster, moderator), transport, broadcaster, ['moderator:read:shield_mode', 'moderator:manage:shield_mode']);
async subscribeToChannelShieldModeEndEvents(broadcaster, transport) {
const broadcasterId = (0, common_1.extractUserId)(broadcaster);
return await this.createSubscription('channel.shield_mode.end', '1', (0, eventSub_external_1.createEventSubModeratorCondition)(broadcasterId, this._getUserContextIdWithDefault(broadcasterId)), transport, broadcasterId, ['moderator:read:shield_mode', 'moderator:manage:shield_mode'], true);
}

@@ -662,7 +636,7 @@ /**

* @param broadcaster The broadcaster for which you want to listen to outgoing shoutout events.
* @param moderator A user that has permission to see or manage shoutout events in the broadcaster's channel.
* @param transport The transport options.
*/
async subscribeToChannelShoutoutCreateEvents(broadcaster, moderator, transport) {
return await this.createSubscription('channel.shoutout.create', '1', (0, eventSub_external_1.createEventSubModeratorCondition)(broadcaster, moderator), transport, broadcaster, ['moderator:read:shoutouts', 'moderator:manage:shoutouts']);
async subscribeToChannelShoutoutCreateEvents(broadcaster, transport) {
const broadcasterId = (0, common_1.extractUserId)(broadcaster);
return await this.createSubscription('channel.shoutout.create', '1', (0, eventSub_external_1.createEventSubModeratorCondition)(broadcasterId, this._getUserContextIdWithDefault(broadcasterId)), transport, broadcasterId, ['moderator:read:shoutouts', 'moderator:manage:shoutouts'], true);
}

@@ -673,7 +647,7 @@ /**

* @param broadcaster The broadcaster for which you want to listen to incoming shoutout events.
* @param moderator A user that has permission to see or manage shoutout events in the broadcaster's channel.
* @param transport The transport options.
*/
async subscribeToChannelShoutoutReceiveEvents(broadcaster, moderator, transport) {
return await this.createSubscription('channel.shoutout.receive', '1', (0, eventSub_external_1.createEventSubModeratorCondition)(broadcaster, moderator), transport, broadcaster, ['moderator:read:shoutouts', 'moderator:manage:shoutouts']);
async subscribeToChannelShoutoutReceiveEvents(broadcaster, transport) {
const broadcasterId = (0, common_1.extractUserId)(broadcaster);
return await this.createSubscription('channel.shoutout.receive', '1', (0, eventSub_external_1.createEventSubModeratorCondition)(broadcasterId, this._getUserContextIdWithDefault(broadcasterId)), transport, broadcasterId, ['moderator:read:shoutouts', 'moderator:manage:shoutouts'], true);
}

@@ -729,3 +703,3 @@ /**

async subscribeToDropEntitlementGrantEvents(filter, transport) {
return await this.createSubscription('drop.entitlement.grant', '1', (0, eventSub_external_1.createEventSubDropEntitlementGrantCondition)(filter), transport, undefined, undefined, true);
return await this.createSubscription('drop.entitlement.grant', '1', (0, eventSub_external_1.createEventSubDropEntitlementGrantCondition)(filter), transport, undefined, undefined, false, true);
}

@@ -732,0 +706,0 @@ async _deleteSubscriptionsWithCondition(cond) {

@@ -106,22 +106,28 @@ import type { UserIdResolvable } from '@twurple/common';

*
* This uses the token of the broadcaster by default.
* If you want to execute this in the context of another user (who has to be moderator of the channel)
* you can do so using [user context overrides](/docs/auth/concepts/context-switching).
*
* @param broadcaster The broadcaster to get the AutoMod settings for.
* @param moderator A user that has permission to moderate the broadcaster's chat room.
* The token of this user will be used to get the settings.
*/
getAutoModSettings(broadcaster: UserIdResolvable, moderator: UserIdResolvable): Promise<HelixAutoModSettings[]>;
getAutoModSettings(broadcaster: UserIdResolvable): Promise<HelixAutoModSettings[]>;
/**
* Updates the AutoMod settings for a broadcaster.
*
* This uses the token of the broadcaster by default.
* If you want to execute this in the context of another user (who has to be moderator of the channel)
* you can do so using [user context overrides](/docs/auth/concepts/context-switching).
*
* @param broadcaster The broadcaster for which the AutoMod settings are updated.
* @param moderator A user that has permission to moderate the broadcaster's chat room.
* The token of this user will be used to update the settings.
* @param data The updated AutoMod settings that replace the current AutoMod settings.
*/
updateAutoModSettings(broadcaster: UserIdResolvable, moderator: UserIdResolvable, data: HelixAutoModSettingsUpdate): Promise<HelixAutoModSettings[]>;
updateAutoModSettings(broadcaster: UserIdResolvable, data: HelixAutoModSettingsUpdate): Promise<HelixAutoModSettings[]>;
/**
* Bans or times out a user in a channel
* Bans or times out a user in a channel.
*
* This uses the token of the broadcaster by default.
* If you want to execute this in the context of another user (who has to be moderator of the channel)
* you can do so using [user context overrides](/docs/auth/concepts/context-switching).
*
* @param broadcaster The broadcaster in whose channel the user will be banned/timed out.
* @param moderator A user that has permission to ban/timeout users in the broadcaster's chat room.
* The token of this user will be used to ban the user.
* @param data

@@ -133,18 +139,22 @@ *

*/
banUser(broadcaster: UserIdResolvable, moderator: UserIdResolvable, data: HelixBanUserRequest): Promise<HelixBanUser[]>;
banUser(broadcaster: UserIdResolvable, data: HelixBanUserRequest): Promise<HelixBanUser[]>;
/**
* Unbans/removes the timeout for a user in a channel.
*
* This uses the token of the broadcaster by default.
* If you want to execute this in the context of another user (who has to be moderator of the channel)
* you can do so using [user context overrides](/docs/auth/concepts/context-switching).
*
* @param broadcaster The broadcaster in whose channel the user will be unbanned/removed from timeout.
* @param moderator A user that has permission to unban/remove timeout users in the broadcaster's chat room.
* The token of this user will be used to unban the user.
* @param user The user who will be unbanned/removed from timeout.
*/
unbanUser(broadcaster: UserIdResolvable, moderator: UserIdResolvable, user: UserIdResolvable): Promise<void>;
unbanUser(broadcaster: UserIdResolvable, user: UserIdResolvable): Promise<void>;
/**
* Gets the broadcaster’s list of non-private, blocked words or phrases.
*
* This uses the token of the broadcaster by default.
* If you want to execute this in the context of another user (who has to be moderator of the channel)
* you can do so using [user context overrides](/docs/auth/concepts/context-switching).
*
* @param broadcaster The broadcaster to get their channel's blocked terms for.
* @param moderator A user that has permission to get blocked terms for the broadcaster's channel.
* The token of this user will be used to get the blocked terms.
* @param pagination

@@ -156,9 +166,11 @@ *

*/
getBlockedTerms(broadcaster: UserIdResolvable, moderator: UserIdResolvable, pagination?: HelixForwardPagination): Promise<HelixPaginatedResult<HelixBlockedTerm>>;
getBlockedTerms(broadcaster: UserIdResolvable, pagination?: HelixForwardPagination): Promise<HelixPaginatedResult<HelixBlockedTerm>>;
/**
* Adds a blocked term to the broadcaster's channel.
*
* This uses the token of the broadcaster by default.
* If you want to execute this in the context of another user (who has to be moderator of the channel)
* you can do so using [user context overrides](/docs/auth/concepts/context-switching).
*
* @param broadcaster The broadcaster in whose channel the term will be blocked.
* @param moderator A user that has permission to block terms in the broadcaster's channel.
* The token of this user will be used to add the blocked term.
* @param text The word or phrase to block from being used in the broadcaster's channel.

@@ -168,3 +180,3 @@ *

*/
addBlockedTerm(broadcaster: UserIdResolvable, moderator: UserIdResolvable, text: string): Promise<HelixBlockedTerm[]>;
addBlockedTerm(broadcaster: UserIdResolvable, text: string): Promise<HelixBlockedTerm[]>;
/**

@@ -182,10 +194,10 @@ * Removes a blocked term from the broadcaster's channel.

*
* This uses the token of the broadcaster by default.
* If you want to execute this in the context of another user (who has to be moderator of the channel)
* you can do so using [user context overrides](/docs/auth/concepts/context-switching).
*
* @param broadcaster The broadcaster the chat belongs to.
* @param moderator The moderator the request is on behalf of.
*
* This is the user your user token needs to represent.
* You can delete messages from your own chat room by setting `broadcaster` and `moderator` to the same user.
* @param messageId The ID of the message to remove. If not specified, the request removes all messages in the broadcaster’s chat room.
*/
deleteChatMessages(broadcaster: UserIdResolvable, moderator: UserIdResolvable, messageId?: string): Promise<void>;
deleteChatMessages(broadcaster: UserIdResolvable, messageId?: string): Promise<void>;
/**

@@ -195,16 +207,17 @@ * Gets the broadcaster's Shield Mode activation status.

* @param broadcaster The broadcaster whose Shield Mode activation status you want to get.
* @param moderator A user that has permission to read the Shield Mode status in the broadcaster's channel.
* The token of this user will be used to get the Shield Mode status.
*/
getShieldModeStatus(broadcaster: UserIdResolvable, moderator: UserIdResolvable): Promise<HelixShieldModeStatus>;
getShieldModeStatus(broadcaster: UserIdResolvable): Promise<HelixShieldModeStatus>;
/**
* Activates or deactivates the broadcaster's Shield Mode.
*
* This uses the token of the broadcaster by default.
* If you want to execute this in the context of another user (who has to be moderator of the channel)
* you can do so using [user context overrides](/docs/auth/concepts/context-switching).
*
* @param broadcaster The broadcaster whose Shield Mode you want to activate or deactivate.
* @param moderator A user that has permission to update Shield Mode status in the broadcaster's channel.
* The token of this user will be used to change the Shield Mode status.
* @param activate The desired Shield Mode status on the broadcaster's channel.
*/
updateShieldModeStatus(broadcaster: UserIdResolvable, moderator: UserIdResolvable, activate: boolean): Promise<HelixShieldModeStatus>;
updateShieldModeStatus(broadcaster: UserIdResolvable, activate: boolean): Promise<HelixShieldModeStatus>;
private _createModeratorActionQuery;
}
//# sourceMappingURL=HelixModerationApi.d.ts.map

@@ -198,13 +198,17 @@ "use strict";

*
* This uses the token of the broadcaster by default.
* If you want to execute this in the context of another user (who has to be moderator of the channel)
* you can do so using [user context overrides](/docs/auth/concepts/context-switching).
*
* @param broadcaster The broadcaster to get the AutoMod settings for.
* @param moderator A user that has permission to moderate the broadcaster's chat room.
* The token of this user will be used to get the settings.
*/
async getAutoModSettings(broadcaster, moderator) {
async getAutoModSettings(broadcaster) {
const broadcasterId = (0, common_1.extractUserId)(broadcaster);
const result = await this._client.callApi({
type: 'helix',
url: 'moderation/automod/settings',
userId: (0, common_1.extractUserId)(moderator),
userId: broadcasterId,
scopes: ['moderator:read:automod_settings'],
query: (0, generic_external_1.createModeratorActionQuery)(broadcaster, moderator)
canOverrideScopedUserContext: true,
query: this._createModeratorActionQuery(broadcasterId)
});

@@ -216,8 +220,11 @@ return result.data.map(data => new HelixAutoModSettings_1.HelixAutoModSettings(data));

*
* This uses the token of the broadcaster by default.
* If you want to execute this in the context of another user (who has to be moderator of the channel)
* you can do so using [user context overrides](/docs/auth/concepts/context-switching).
*
* @param broadcaster The broadcaster for which the AutoMod settings are updated.
* @param moderator A user that has permission to moderate the broadcaster's chat room.
* The token of this user will be used to update the settings.
* @param data The updated AutoMod settings that replace the current AutoMod settings.
*/
async updateAutoModSettings(broadcaster, moderator, data) {
async updateAutoModSettings(broadcaster, data) {
const broadcasterId = (0, common_1.extractUserId)(broadcaster);
const result = await this._client.callApi({

@@ -227,5 +234,6 @@ type: 'helix',

method: 'PUT',
userId: (0, common_1.extractUserId)(moderator),
userId: broadcasterId,
scopes: ['moderator:manage:automod_settings'],
query: (0, generic_external_1.createModeratorActionQuery)(broadcaster, moderator),
canOverrideScopedUserContext: true,
query: this._createModeratorActionQuery(broadcasterId),
jsonBody: (0, moderation_external_1.createAutoModSettingsBody)(data)

@@ -236,7 +244,9 @@ });

/**
* Bans or times out a user in a channel
* Bans or times out a user in a channel.
*
* This uses the token of the broadcaster by default.
* If you want to execute this in the context of another user (who has to be moderator of the channel)
* you can do so using [user context overrides](/docs/auth/concepts/context-switching).
*
* @param broadcaster The broadcaster in whose channel the user will be banned/timed out.
* @param moderator A user that has permission to ban/timeout users in the broadcaster's chat room.
* The token of this user will be used to ban the user.
* @param data

@@ -248,3 +258,4 @@ *

*/
async banUser(broadcaster, moderator, data) {
async banUser(broadcaster, data) {
const broadcasterId = (0, common_1.extractUserId)(broadcaster);
const result = await this._client.callApi({

@@ -254,5 +265,6 @@ type: 'helix',

method: 'POST',
userId: (0, common_1.extractUserId)(moderator),
userId: broadcasterId,
scopes: ['moderator:manage:banned_users'],
query: (0, generic_external_1.createModeratorActionQuery)(broadcaster, moderator),
canOverrideScopedUserContext: true,
query: this._createModeratorActionQuery(broadcasterId),
jsonBody: (0, moderation_external_1.createBanUserBody)(data)

@@ -265,8 +277,11 @@ });

*
* This uses the token of the broadcaster by default.
* If you want to execute this in the context of another user (who has to be moderator of the channel)
* you can do so using [user context overrides](/docs/auth/concepts/context-switching).
*
* @param broadcaster The broadcaster in whose channel the user will be unbanned/removed from timeout.
* @param moderator A user that has permission to unban/remove timeout users in the broadcaster's chat room.
* The token of this user will be used to unban the user.
* @param user The user who will be unbanned/removed from timeout.
*/
async unbanUser(broadcaster, moderator, user) {
async unbanUser(broadcaster, user) {
const broadcasterId = (0, common_1.extractUserId)(broadcaster);
await this._client.callApi({

@@ -276,6 +291,7 @@ type: 'helix',

method: 'DELETE',
userId: (0, common_1.extractUserId)(moderator),
userId: broadcasterId,
scopes: ['moderator:manage:banned_users'],
canOverrideScopedUserContext: true,
query: {
...(0, generic_external_1.createModeratorActionQuery)(broadcaster, moderator),
...this._createModeratorActionQuery(broadcasterId),
...(0, generic_external_1.createSingleKeyQuery)('user_id', (0, common_1.extractUserId)(user))

@@ -288,5 +304,7 @@ }

*
* This uses the token of the broadcaster by default.
* If you want to execute this in the context of another user (who has to be moderator of the channel)
* you can do so using [user context overrides](/docs/auth/concepts/context-switching).
*
* @param broadcaster The broadcaster to get their channel's blocked terms for.
* @param moderator A user that has permission to get blocked terms for the broadcaster's channel.
* The token of this user will be used to get the blocked terms.
* @param pagination

@@ -298,10 +316,12 @@ *

*/
async getBlockedTerms(broadcaster, moderator, pagination) {
async getBlockedTerms(broadcaster, pagination) {
const broadcasterId = (0, common_1.extractUserId)(broadcaster);
const result = await this._client.callApi({
type: 'helix',
url: 'moderation/blocked_terms',
userId: (0, common_1.extractUserId)(moderator),
userId: broadcasterId,
scopes: ['moderator:read:blocked_terms'],
canOverrideScopedUserContext: true,
query: {
...(0, generic_external_1.createModeratorActionQuery)(broadcaster, moderator),
...this._createModeratorActionQuery(broadcasterId),
...(0, HelixPagination_1.createPaginationQuery)(pagination)

@@ -315,5 +335,7 @@ }

*
* This uses the token of the broadcaster by default.
* If you want to execute this in the context of another user (who has to be moderator of the channel)
* you can do so using [user context overrides](/docs/auth/concepts/context-switching).
*
* @param broadcaster The broadcaster in whose channel the term will be blocked.
* @param moderator A user that has permission to block terms in the broadcaster's channel.
* The token of this user will be used to add the blocked term.
* @param text The word or phrase to block from being used in the broadcaster's channel.

@@ -323,3 +345,4 @@ *

*/
async addBlockedTerm(broadcaster, moderator, text) {
async addBlockedTerm(broadcaster, text) {
const broadcasterId = (0, common_1.extractUserId)(broadcaster);
const result = await this._client.callApi({

@@ -329,5 +352,6 @@ type: 'helix',

method: 'POST',
userId: (0, common_1.extractUserId)(moderator),
userId: broadcasterId,
scopes: ['moderator:manage:blocked_terms'],
query: (0, generic_external_1.createModeratorActionQuery)(broadcaster, moderator),
canOverrideScopedUserContext: true,
query: this._createModeratorActionQuery(broadcasterId),
jsonBody: {

@@ -348,2 +372,3 @@ text

async removeBlockedTerm(broadcaster, moderator, id) {
const broadcasterId = (0, common_1.extractUserId)(broadcaster);
await this._client.callApi({

@@ -353,6 +378,7 @@ type: 'helix',

method: 'DELETE',
userId: (0, common_1.extractUserId)(moderator),
userId: broadcasterId,
scopes: ['moderator:manage:blocked_terms'],
canOverrideScopedUserContext: true,
query: {
...(0, generic_external_1.createModeratorActionQuery)(broadcaster, moderator),
...this._createModeratorActionQuery(broadcasterId),
id

@@ -365,10 +391,11 @@ }

*
* This uses the token of the broadcaster by default.
* If you want to execute this in the context of another user (who has to be moderator of the channel)
* you can do so using [user context overrides](/docs/auth/concepts/context-switching).
*
* @param broadcaster The broadcaster the chat belongs to.
* @param moderator The moderator the request is on behalf of.
*
* This is the user your user token needs to represent.
* You can delete messages from your own chat room by setting `broadcaster` and `moderator` to the same user.
* @param messageId The ID of the message to remove. If not specified, the request removes all messages in the broadcaster’s chat room.
*/
async deleteChatMessages(broadcaster, moderator, messageId) {
async deleteChatMessages(broadcaster, messageId) {
const broadcasterId = (0, common_1.extractUserId)(broadcaster);
await this._client.callApi({

@@ -378,6 +405,7 @@ type: 'helix',

method: 'DELETE',
userId: (0, common_1.extractUserId)(moderator),
userId: broadcasterId,
scopes: ['moderator:manage:chat_messages'],
canOverrideScopedUserContext: true,
query: {
...(0, generic_external_1.createModeratorActionQuery)(broadcaster, moderator),
...this._createModeratorActionQuery(broadcasterId),
...(0, generic_external_1.createSingleKeyQuery)('message_id', messageId)

@@ -391,6 +419,5 @@ }

* @param broadcaster The broadcaster whose Shield Mode activation status you want to get.
* @param moderator A user that has permission to read the Shield Mode status in the broadcaster's channel.
* The token of this user will be used to get the Shield Mode status.
*/
async getShieldModeStatus(broadcaster, moderator) {
async getShieldModeStatus(broadcaster) {
const broadcasterId = (0, common_1.extractUserId)(broadcaster);
const result = await this._client.callApi({

@@ -400,5 +427,6 @@ type: 'helix',

method: 'GET',
userId: (0, common_1.extractUserId)(moderator),
userId: broadcasterId,
scopes: ['moderator:read:shield_mode', 'moderator:manage:shield_mode'],
query: (0, generic_external_1.createModeratorActionQuery)(broadcaster, moderator)
canOverrideScopedUserContext: true,
query: this._createModeratorActionQuery(broadcasterId)
});

@@ -410,8 +438,11 @@ return new HelixShieldModeStatus_1.HelixShieldModeStatus(result.data[0], this._client);

*
* This uses the token of the broadcaster by default.
* If you want to execute this in the context of another user (who has to be moderator of the channel)
* you can do so using [user context overrides](/docs/auth/concepts/context-switching).
*
* @param broadcaster The broadcaster whose Shield Mode you want to activate or deactivate.
* @param moderator A user that has permission to update Shield Mode status in the broadcaster's channel.
* The token of this user will be used to change the Shield Mode status.
* @param activate The desired Shield Mode status on the broadcaster's channel.
*/
async updateShieldModeStatus(broadcaster, moderator, activate) {
async updateShieldModeStatus(broadcaster, activate) {
const broadcasterId = (0, common_1.extractUserId)(broadcaster);
const result = await this._client.callApi({

@@ -421,5 +452,6 @@ type: 'helix',

method: 'PUT',
userId: (0, common_1.extractUserId)(moderator),
userId: broadcasterId,
scopes: ['moderator:manage:shield_mode'],
query: (0, generic_external_1.createModeratorActionQuery)(broadcaster, moderator),
canOverrideScopedUserContext: true,
query: this._createModeratorActionQuery(broadcasterId),
jsonBody: (0, moderation_external_1.createUpdateShieldModeStatusBody)(activate)

@@ -429,2 +461,5 @@ });

}
_createModeratorActionQuery(broadcasterId) {
return (0, generic_external_1.createModeratorActionQuery)(broadcasterId, this._getUserContextIdWithDefault(broadcasterId));
}
};

@@ -431,0 +466,0 @@ HelixModerationApi = tslib_1.__decorate([

@@ -120,3 +120,3 @@ "use strict";

userId,
query: (0, stream_external_1.createStreamQuery)({ userId: userId })
query: (0, stream_external_1.createStreamQuery)({ userId })
});

@@ -123,0 +123,0 @@ return (0, shared_utils_1.mapNullable)(result.data[0], data => new HelixStream_1.HelixStream(data, this._client));

@@ -6,5 +6,6 @@ import type { HelixUserType, UserIdResolvable, UserIdResolvableType, UserNameResolveableType } from '@twurple/common';

import type { HelixPaginatedResultWithTotal } from '../../utils/pagination/HelixPaginatedResult';
import { type HelixChannelFollower } from '../channel/HelixChannelFollower';
import { type HelixFollowedChannel } from '../channel/HelixFollowedChannel';
import type { HelixStream } from '../stream/HelixStream';
import type { HelixSubscription } from '../subscriptions/HelixSubscription';
import type { HelixFollow } from './HelixFollow';
import { type HelixUserSubscription } from '../subscriptions/HelixUserSubscription';
/**

@@ -61,29 +62,18 @@ * A Twitch user.

* Gets a list of broadcasters the user follows.
*
* @deprecated Use {@link HelixChannelApi#getFollowedChannels} instead.
*/
getFollows(): Promise<HelixPaginatedResultWithTotal<HelixFollow>>;
getFollowedChannels(): Promise<HelixPaginatedResultWithTotal<HelixFollowedChannel>>;
/**
* Gets the follow data of the given user to the broadcaster.
* Gets the follow data of the user to the given broadcaster, or `null` if the user doesn't follow the broadcaster.
*
* @deprecated Use {@link HelixChannelApi#getChannelFollowers}
* or {@link HelixChannelApi#getFollowedChannels} instead.
* This requires user authentication.
* For broadcaster authentication, you can use `getChannelFollower` while switching `this` and the parameter.
*
* @param user The user to check the follow from.
*/
getFollowFrom(user: UserIdResolvable): Promise<HelixFollow | null>;
/**
* Gets the follow data of the user to the given broadcaster.
*
* @deprecated Use {@link HelixChannelApi#getChannelFollowers}
* or {@link HelixChannelApi#getFollowedChannels} instead.
*
* @param broadcaster The broadcaster to check the follow to.
*/
getFollowTo(broadcaster: UserIdResolvable): Promise<HelixFollow | null>;
getFollowedChannel(broadcaster: UserIdResolvable): Promise<HelixFollowedChannel | null>;
/**
* Checks whether the user is following the given broadcaster.
*
* @deprecated Use {@link HelixChannelApi#getChannelFollowers}
* or {@link HelixChannelApi#getFollowedChannels} instead.
* This requires user authentication.
* For broadcaster authentication, you can use `isFollowedBy` while switching `this` and the parameter.
*

@@ -94,6 +84,19 @@ * @param broadcaster The broadcaster to check the user's follow to.

/**
* Gets a list of users that follow the broadcaster.
*/
getChannelFollowers(): Promise<HelixPaginatedResultWithTotal<HelixChannelFollower>>;
/**
* Gets the follow data of the given user to the broadcaster, or `null` if the user doesn't follow the broadcaster.
*
* This requires broadcaster authentication.
* For user authentication, you can use `getFollowedChannel` while switching `this` and the parameter.
*
* @param user The user to check the follow from.
*/
getChannelFollower(user: UserIdResolvable): Promise<HelixChannelFollower | null>;
/**
* Checks whether the given user is following the broadcaster.
*
* @deprecated Use {@link HelixChannelApi#getChannelFollowers}
* or {@link HelixChannelApi#getFollowedChannels} instead.
* This requires broadcaster authentication.
* For user authentication, you can use `follows` while switching `this` and the parameter.
*

@@ -106,12 +109,36 @@ * @param user The user to check the broadcaster's follow from.

*
* This requires user authentication.
* For broadcaster authentication, you can use `getSubscriber` while switching `this` and the parameter.
*
* @param broadcaster The broadcaster you want to get the subscription data for.
*/
getSubscriptionTo(broadcaster: UserIdResolvable): Promise<HelixSubscription | null>;
getSubscriptionTo(broadcaster: UserIdResolvable): Promise<HelixUserSubscription | null>;
/**
* Checks whether the user is subscribed to the given broadcaster.
*
* This requires user authentication.
* For broadcaster authentication, you can use `hasSubscriber` while switching `this` and the parameter.
*
* @param broadcaster The broadcaster you want to check the subscription for.
*/
isSubscribedTo(broadcaster: UserIdResolvable): Promise<boolean>;
/**
* Gets the subscription data for the given user to the broadcaster, or `null` if the user is not subscribed.
*
* This requires broadcaster authentication.
* For user authentication, you can use `getSubscriptionTo` while switching `this` and the parameter.
*
* @param user The user you want to get the subscription data for.
*/
getSubscriber(user: UserIdResolvable): Promise<HelixUserSubscription | null>;
/**
* Checks whether the given user is subscribed to the broadcaster.
*
* This requires broadcaster authentication.
* For user authentication, you can use `isSubscribedTo` while switching `this` and the parameter.
*
* @param user The user you want to check the subscription for.
*/
hasSubscriber(user: UserIdResolvable): Promise<boolean>;
}
//# sourceMappingURL=HelixUser.d.ts.map

@@ -82,40 +82,48 @@ "use strict";

* Gets a list of broadcasters the user follows.
*
* @deprecated Use {@link HelixChannelApi#getFollowedChannels} instead.
*/
async getFollows() {
return await this._client.users.getFollows({ user: this });
async getFollowedChannels() {
return await this._client.channels.getFollowedChannels(this);
}
/**
* Gets the follow data of the given user to the broadcaster.
* Gets the follow data of the user to the given broadcaster, or `null` if the user doesn't follow the broadcaster.
*
* @deprecated Use {@link HelixChannelApi#getChannelFollowers}
* or {@link HelixChannelApi#getFollowedChannels} instead.
* This requires user authentication.
* For broadcaster authentication, you can use `getChannelFollower` while switching `this` and the parameter.
*
* @param user The user to check the follow from.
* @param broadcaster The broadcaster to check the follow to.
*/
async getFollowFrom(user) {
return await this._client.users.getFollowFromUserToBroadcaster(user, this);
async getFollowedChannel(broadcaster) {
var _a;
const result = await this._client.channels.getFollowedChannels(this, broadcaster);
return (_a = result.data[0]) !== null && _a !== void 0 ? _a : null;
}
/**
* Gets the follow data of the user to the given broadcaster.
* Checks whether the user is following the given broadcaster.
*
* @deprecated Use {@link HelixChannelApi#getChannelFollowers}
* or {@link HelixChannelApi#getFollowedChannels} instead.
* This requires user authentication.
* For broadcaster authentication, you can use `isFollowedBy` while switching `this` and the parameter.
*
* @param broadcaster The broadcaster to check the follow to.
* @param broadcaster The broadcaster to check the user's follow to.
*/
async getFollowTo(broadcaster) {
return await this._client.users.getFollowFromUserToBroadcaster(this, broadcaster);
async follows(broadcaster) {
return (await this.getFollowedChannel(broadcaster)) !== null;
}
/**
* Checks whether the user is following the given broadcaster.
* Gets a list of users that follow the broadcaster.
*/
async getChannelFollowers() {
return await this._client.channels.getChannelFollowers(this);
}
/**
* Gets the follow data of the given user to the broadcaster, or `null` if the user doesn't follow the broadcaster.
*
* @deprecated Use {@link HelixChannelApi#getChannelFollowers}
* or {@link HelixChannelApi#getFollowedChannels} instead.
* This requires broadcaster authentication.
* For user authentication, you can use `getFollowedChannel` while switching `this` and the parameter.
*
* @param broadcaster The broadcaster to check the user's follow to.
* @param user The user to check the follow from.
*/
async follows(broadcaster) {
return await this._client.users.userFollowsBroadcaster(this, broadcaster);
async getChannelFollower(user) {
var _a;
const result = await this._client.channels.getChannelFollowers(this, user);
return (_a = result.data[0]) !== null && _a !== void 0 ? _a : null;
}

@@ -125,4 +133,4 @@ /**

*
* @deprecated Use {@link HelixChannelApi#getChannelFollowers}
* or {@link HelixChannelApi#getFollowedChannels} instead.
* This requires broadcaster authentication.
* For user authentication, you can use `follows` while switching `this` and the parameter.
*

@@ -132,3 +140,3 @@ * @param user The user to check the broadcaster's follow from.

async isFollowedBy(user) {
return await this._client.users.userFollowsBroadcaster(user, this);
return (await this.getChannelFollower(user)) !== null;
}

@@ -138,6 +146,9 @@ /**

*
* This requires user authentication.
* For broadcaster authentication, you can use `getSubscriber` while switching `this` and the parameter.
*
* @param broadcaster The broadcaster you want to get the subscription data for.
*/
async getSubscriptionTo(broadcaster) {
return await this._client.subscriptions.getSubscriptionForUser(broadcaster, this);
return await this._client.subscriptions.checkUserSubscription(this, broadcaster);
}

@@ -147,2 +158,5 @@ /**

*
* This requires user authentication.
* For broadcaster authentication, you can use `hasSubscriber` while switching `this` and the parameter.
*
* @param broadcaster The broadcaster you want to check the subscription for.

@@ -153,2 +167,24 @@ */

}
/**
* Gets the subscription data for the given user to the broadcaster, or `null` if the user is not subscribed.
*
* This requires broadcaster authentication.
* For user authentication, you can use `getSubscriptionTo` while switching `this` and the parameter.
*
* @param user The user you want to get the subscription data for.
*/
async getSubscriber(user) {
return await this._client.subscriptions.getSubscriptionForUser(this, user);
}
/**
* Checks whether the given user is subscribed to the broadcaster.
*
* This requires broadcaster authentication.
* For user authentication, you can use `isSubscribedTo` while switching `this` and the parameter.
*
* @param user The user you want to check the subscription for.
*/
async hasSubscriber(user) {
return (await this.getSubscriber(user)) !== null;
}
};

@@ -155,0 +191,0 @@ tslib_1.__decorate([

@@ -12,2 +12,4 @@ export { ApiClient } from './client/ApiClient';

export { HelixChannelEditor } from './endpoints/channel/HelixChannelEditor';
export { HelixChannelFollower } from './endpoints/channel/HelixChannelFollower';
export { HelixFollowedChannel } from './endpoints/channel/HelixFollowedChannel';
export { HelixChannelReference } from './endpoints/channel/HelixChannelReference';

@@ -128,4 +130,4 @@ export type { HelixChannelUpdate } from './interfaces/endpoints/channel.input';

export type { HelixResponse, HelixPaginatedResponse, HelixPaginatedResponseWithTotal } from '@twurple/api-call';
export { ChatEmote, extractUserId, extractUserName, HelixExtension, HellFreezesOverError } from '@twurple/common';
export type { CheermoteBackground, CheermoteDisplayInfo, CommercialLength, CheermoteScale, CheermoteState, HelixExtensionSubscriptionsSupportLevel, HelixExtensionState, HelixExtensionIconSize, HelixExtensionConfigurationLocation, HelixUserType, UserIdResolvable, UserNameResolvable } from '@twurple/common';
export { extractUserId, extractUserName, HelixExtension, HellFreezesOverError } from '@twurple/common';
export type { CommercialLength, HelixExtensionSubscriptionsSupportLevel, HelixExtensionState, HelixExtensionIconSize, HelixExtensionConfigurationLocation, HelixUserType, UserIdResolvable, UserNameResolvable } from '@twurple/common';
//# sourceMappingURL=index.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HelixPoll = exports.HelixPollApi = exports.HelixShieldModeStatus = exports.HelixBlockedTerm = exports.HelixBanUser = exports.HelixModerator = exports.HelixBan = exports.HelixModerationApi = exports.HelixHypeTrainEvent = exports.HelixHypeTrainContribution = exports.HelixHypeTrainApi = exports.HelixGoal = exports.HelixGoalApi = exports.HelixGame = exports.HelixGameApi = exports.HelixExtensionTransaction = exports.HelixExtensionBitsProduct = exports.HelixExtensionsApi = exports.HelixPaginatedEventSubSubscriptionsRequest = exports.HelixEventSubSubscription = exports.HelixEventSubApi = exports.HelixDropsEntitlement = exports.HelixEntitlementApi = exports.HelixClip = exports.HelixClipApi = exports.HelixPrivilegedChatSettings = exports.HelixEmoteFromSet = exports.HelixChannelEmote = exports.HelixEmote = exports.HelixChatChatter = exports.HelixChatSettings = exports.HelixChatBadgeVersion = exports.HelixChatBadgeSet = exports.HelixChatApi = exports.HelixCharityCampaignAmount = exports.HelixCharityCampaignDonation = exports.HelixCharityCampaign = exports.HelixCharityApi = exports.HelixCustomRewardRedemption = exports.HelixCustomReward = exports.HelixChannelPointsApi = exports.HelixChannelReference = exports.HelixChannelEditor = exports.HelixChannel = exports.HelixChannelApi = exports.HelixCheermoteList = exports.HelixBitsLeaderboardEntry = exports.HelixBitsLeaderboard = exports.HelixBitsApi = exports.ApiClient = void 0;
exports.HellFreezesOverError = exports.HelixExtension = exports.extractUserName = exports.extractUserId = exports.ChatEmote = exports.HelixPaginatedRequestWithTotal = exports.HelixPaginatedRequest = exports.ApiReportedRequest = exports.StreamNotLiveError = exports.ConfigError = exports.HelixWhisperApi = exports.HelixVideo = exports.HelixVideoApi = exports.HelixUserExtension = exports.HelixInstalledExtensionList = exports.HelixInstalledExtension = exports.HelixBaseExtension = exports.HelixUser = exports.HelixPrivilegedUser = exports.HelixFollow = exports.HelixUserBlock = exports.HelixUserApi = exports.HelixTeamWithUsers = exports.HelixTeam = exports.HelixTeamApi = exports.HelixUserSubscription = exports.HelixSubscription = exports.HelixSubscriptionApi = exports.HelixStreamMarkerWithVideo = exports.HelixStreamMarker = exports.HelixStream = exports.HelixStreamApi = exports.HelixChannelSearchResult = exports.HelixSearchApi = exports.HelixPaginatedScheduleSegmentRequest = exports.HelixScheduleSegment = exports.HelixSchedule = exports.HelixScheduleApi = exports.HelixUserRelation = exports.HelixRaid = exports.HelixRaidApi = exports.HelixPredictor = exports.HelixPredictionOutcome = exports.HelixPrediction = exports.HelixPredictionApi = exports.HelixPollChoice = void 0;
exports.HelixShieldModeStatus = exports.HelixBlockedTerm = exports.HelixBanUser = exports.HelixModerator = exports.HelixBan = exports.HelixModerationApi = exports.HelixHypeTrainEvent = exports.HelixHypeTrainContribution = exports.HelixHypeTrainApi = exports.HelixGoal = exports.HelixGoalApi = exports.HelixGame = exports.HelixGameApi = exports.HelixExtensionTransaction = exports.HelixExtensionBitsProduct = exports.HelixExtensionsApi = exports.HelixPaginatedEventSubSubscriptionsRequest = exports.HelixEventSubSubscription = exports.HelixEventSubApi = exports.HelixDropsEntitlement = exports.HelixEntitlementApi = exports.HelixClip = exports.HelixClipApi = exports.HelixPrivilegedChatSettings = exports.HelixEmoteFromSet = exports.HelixChannelEmote = exports.HelixEmote = exports.HelixChatChatter = exports.HelixChatSettings = exports.HelixChatBadgeVersion = exports.HelixChatBadgeSet = exports.HelixChatApi = exports.HelixCharityCampaignAmount = exports.HelixCharityCampaignDonation = exports.HelixCharityCampaign = exports.HelixCharityApi = exports.HelixCustomRewardRedemption = exports.HelixCustomReward = exports.HelixChannelPointsApi = exports.HelixChannelReference = exports.HelixFollowedChannel = exports.HelixChannelFollower = exports.HelixChannelEditor = exports.HelixChannel = exports.HelixChannelApi = exports.HelixCheermoteList = exports.HelixBitsLeaderboardEntry = exports.HelixBitsLeaderboard = exports.HelixBitsApi = exports.ApiClient = void 0;
exports.HellFreezesOverError = exports.HelixExtension = exports.extractUserName = exports.extractUserId = exports.HelixPaginatedRequestWithTotal = exports.HelixPaginatedRequest = exports.ApiReportedRequest = exports.StreamNotLiveError = exports.ConfigError = exports.HelixWhisperApi = exports.HelixVideo = exports.HelixVideoApi = exports.HelixUserExtension = exports.HelixInstalledExtensionList = exports.HelixInstalledExtension = exports.HelixBaseExtension = exports.HelixUser = exports.HelixPrivilegedUser = exports.HelixFollow = exports.HelixUserBlock = exports.HelixUserApi = exports.HelixTeamWithUsers = exports.HelixTeam = exports.HelixTeamApi = exports.HelixUserSubscription = exports.HelixSubscription = exports.HelixSubscriptionApi = exports.HelixStreamMarkerWithVideo = exports.HelixStreamMarker = exports.HelixStream = exports.HelixStreamApi = exports.HelixChannelSearchResult = exports.HelixSearchApi = exports.HelixPaginatedScheduleSegmentRequest = exports.HelixScheduleSegment = exports.HelixSchedule = exports.HelixScheduleApi = exports.HelixUserRelation = exports.HelixRaid = exports.HelixRaidApi = exports.HelixPredictor = exports.HelixPredictionOutcome = exports.HelixPrediction = exports.HelixPredictionApi = exports.HelixPollChoice = exports.HelixPoll = exports.HelixPollApi = void 0;
var ApiClient_1 = require("./client/ApiClient");

@@ -21,2 +21,6 @@ Object.defineProperty(exports, "ApiClient", { enumerable: true, get: function () { return ApiClient_1.ApiClient; } });

Object.defineProperty(exports, "HelixChannelEditor", { enumerable: true, get: function () { return HelixChannelEditor_1.HelixChannelEditor; } });
var HelixChannelFollower_1 = require("./endpoints/channel/HelixChannelFollower");
Object.defineProperty(exports, "HelixChannelFollower", { enumerable: true, get: function () { return HelixChannelFollower_1.HelixChannelFollower; } });
var HelixFollowedChannel_1 = require("./endpoints/channel/HelixFollowedChannel");
Object.defineProperty(exports, "HelixFollowedChannel", { enumerable: true, get: function () { return HelixFollowedChannel_1.HelixFollowedChannel; } });
var HelixChannelReference_1 = require("./endpoints/channel/HelixChannelReference");

@@ -189,3 +193,2 @@ Object.defineProperty(exports, "HelixChannelReference", { enumerable: true, get: function () { return HelixChannelReference_1.HelixChannelReference; } });

var common_1 = require("@twurple/common");
Object.defineProperty(exports, "ChatEmote", { enumerable: true, get: function () { return common_1.ChatEmote; } });
Object.defineProperty(exports, "extractUserId", { enumerable: true, get: function () { return common_1.extractUserId; } });

@@ -192,0 +195,0 @@ Object.defineProperty(exports, "extractUserName", { enumerable: true, get: function () { return common_1.extractUserName; } });

import { type HelixResponse } from '@twurple/api-call';
import { type CheermoteBackground, type CheermoteScale, type CheermoteState } from '@twurple/common';
import { type CheermoteBackground, type CheermoteScale, type CheermoteState } from '../../endpoints/bits/CheermoteDisplayInfo';
import { type HelixBitsLeaderboardQuery } from './bits.input';

@@ -4,0 +4,0 @@ import { type HelixDateRangeData } from './generic.external';

@@ -116,3 +116,3 @@ import { type UserIdResolvable } from '@twurple/common';

/** @private */
export declare function createShoutoutQuery(from: UserIdResolvable, to: UserIdResolvable, moderator: UserIdResolvable): {
export declare function createShoutoutQuery(from: UserIdResolvable, to: UserIdResolvable, moderatorId: string): {
from_broadcaster_id: string;

@@ -119,0 +119,0 @@ to_broadcaster_id: string;

@@ -29,9 +29,9 @@ "use strict";

/** @private */
function createShoutoutQuery(from, to, moderator) {
function createShoutoutQuery(from, to, moderatorId) {
return {
from_broadcaster_id: (0, common_1.extractUserId)(from),
to_broadcaster_id: (0, common_1.extractUserId)(to),
moderator_id: (0, common_1.extractUserId)(moderator)
moderator_id: moderatorId
};
}
exports.createShoutoutQuery = createShoutoutQuery;

@@ -31,3 +31,3 @@ import { type HelixChatAnnouncementColor } from './chat.external';

/**
* Whether unique chat mode (formerly known as r9k) should be enabled.
* Whether unique chat mode should be enabled.
*/

@@ -34,0 +34,0 @@ uniqueChatModeEnabled?: boolean;

@@ -59,3 +59,3 @@ import { type HelixPaginatedResponseWithTotal } from '@twurple/api-call';

/** @private */
export declare function createEventSubModeratorCondition(broadcaster: UserIdResolvable, moderator: UserIdResolvable): {
export declare function createEventSubModeratorCondition(broadcasterId: string, moderatorId: string): {
broadcaster_user_id: string;

@@ -62,0 +62,0 @@ moderator_user_id: string;

@@ -18,6 +18,6 @@ "use strict";

/** @private */
function createEventSubModeratorCondition(broadcaster, moderator) {
function createEventSubModeratorCondition(broadcasterId, moderatorId) {
return {
broadcaster_user_id: (0, common_1.extractUserId)(broadcaster),
moderator_user_id: (0, common_1.extractUserId)(moderator)
broadcaster_user_id: broadcasterId,
moderator_user_id: moderatorId
};

@@ -24,0 +24,0 @@ }

@@ -28,3 +28,3 @@ import { type UserIdResolvable } from '@twurple/common';

/** @private */
export declare function createModeratorActionQuery(broadcaster: UserIdResolvable, moderator: UserIdResolvable): {
export declare function createModeratorActionQuery(broadcaster: string, moderatorId: string): {
broadcaster_id: string;

@@ -31,0 +31,0 @@ moderator_id: string;

@@ -18,6 +18,6 @@ "use strict";

/** @private */
function createModeratorActionQuery(broadcaster, moderator) {
function createModeratorActionQuery(broadcaster, moderatorId) {
return {
broadcaster_id: (0, common_1.extractUserId)(broadcaster),
moderator_id: (0, common_1.extractUserId)(moderator)
broadcaster_id: broadcaster,
moderator_id: moderatorId
};

@@ -24,0 +24,0 @@ }

@@ -1,2 +0,2 @@

export declare type HelixGoalType = 'follower' | 'subscription' | 'subscription_count' | 'new_subscription_count';
export declare type HelixGoalType = 'follower' | 'subscription' | 'subscription_count' | 'new_subscription' | 'new_subscription_count';
/** @private */

@@ -3,0 +3,0 @@ export interface HelixGoalData {

{
"name": "@twurple/api",
"version": "6.2.0",
"version": "7.0.0-pre.0",
"publishConfig": {

@@ -42,4 +42,4 @@ "access": "public"

"@d-fischer/typed-event-emitter": "^3.3.1",
"@twurple/api-call": "6.2.0",
"@twurple/common": "6.2.0",
"@twurple/api-call": "7.0.0-pre.0",
"@twurple/common": "7.0.0-pre.0",
"retry": "^0.13.1",

@@ -49,7 +49,7 @@ "tslib": "^2.0.3"

"devDependencies": {
"@twurple/auth": "6.2.0",
"@twurple/auth": "7.0.0-pre.0",
"@types/retry": "^0.12.2"
},
"peerDependencies": {
"@twurple/auth": "6.2.0"
"@twurple/auth": "7.0.0-pre.0"
},

@@ -56,0 +56,0 @@ "files": [

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc