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-pre.1 to 6.2.0

6

lib/api/BaseApi.d.ts

@@ -1,9 +0,9 @@

import { type BaseApiClient } from '../client/BaseApiClient';
import type { ApiClient } from '../ApiClient';
/** @private */
export declare class BaseApi {
/** @private */
protected readonly _client: BaseApiClient;
protected readonly _client: ApiClient;
/** @private */
constructor(client: BaseApiClient);
constructor(client: ApiClient);
}
//# sourceMappingURL=BaseApi.d.ts.map

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

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const leaderboard = await api.bits.getLeaderboard({ period: 'day' });

@@ -23,15 +23,14 @@ * ```

/**
* Gets a bits leaderboard of your channel.
* Retrieves a bits leaderboard of your channel.
*
* @param broadcaster The user to get the leaderboard of.
* @param params
* @expandParams
*/
getLeaderboard(broadcaster: UserIdResolvable, params?: HelixBitsLeaderboardQuery): Promise<HelixBitsLeaderboard>;
getLeaderboard(params?: HelixBitsLeaderboardQuery): Promise<HelixBitsLeaderboard>;
/**
* Gets all available cheermotes.
* Retrieves all available cheermotes.
*
* @param broadcaster The broadcaster to include custom cheermotes of.
*
* If not given, only get global cheermotes.
* If not given, only retrieves global cheermotes.
*/

@@ -38,0 +37,0 @@ getCheermotes(broadcaster?: UserIdResolvable): Promise<HelixCheermoteList>;

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

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const leaderboard = await api.bits.getLeaderboard({ period: 'day' });

@@ -29,14 +29,12 @@ * ```

/**
* Gets a bits leaderboard of your channel.
* Retrieves a bits leaderboard of your channel.
*
* @param broadcaster The user to get the leaderboard of.
* @param params
* @expandParams
*/
async getLeaderboard(broadcaster, params = {}) {
async getLeaderboard(params = {}) {
const result = await this._client.callApi({
type: 'helix',
url: 'bits/leaderboard',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['bits:read'],
scope: 'bits:read',
query: (0, bits_external_1.createBitsLeaderboardQuery)(params)

@@ -47,7 +45,7 @@ });

/**
* Gets all available cheermotes.
* Retrieves all available cheermotes.
*
* @param broadcaster The broadcaster to include custom cheermotes of.
*
* If not given, only get global cheermotes.
* If not given, only retrieves global cheermotes.
*/

@@ -58,3 +56,2 @@ async getCheermotes(broadcaster) {

url: 'bits/cheermotes',
userId: (0, shared_utils_1.mapOptional)(broadcaster, common_1.extractUserId),
query: (0, shared_utils_1.mapOptional)(broadcaster, api_call_1.createBroadcasterQuery)

@@ -61,0 +58,0 @@ });

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixBitsLeaderboardResponse } from '../../../interfaces/helix/bits.external';

@@ -11,3 +11,3 @@ import { HelixBitsLeaderboardEntry } from './HelixBitsLeaderboardEntry';

/** @private */
constructor(data: HelixBitsLeaderboardResponse, client: BaseApiClient);
constructor(data: HelixBitsLeaderboardResponse, client: ApiClient);
/**

@@ -14,0 +14,0 @@ * The entries of the leaderboard.

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import { type ApiClient } from '../../../ApiClient';
import { type HelixBitsLeaderboardEntryData } from '../../../interfaces/helix/bits.external';

@@ -11,3 +11,3 @@ import { type HelixUser } from '../user/HelixUser';

/** @private */
constructor(data: HelixBitsLeaderboardEntryData, client: BaseApiClient);
constructor(data: HelixBitsLeaderboardEntryData, client: ApiClient);
/**

@@ -34,3 +34,3 @@ * The ID of the user on the leaderboard.

/**
* Gets the user of entry on the leaderboard.
* Retrieves the user of entry on the leaderboard.
*/

@@ -37,0 +37,0 @@ getUser(): Promise<HelixUser>;

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

/**
* Gets the user of entry on the leaderboard.
* Retrieves the user of entry on the leaderboard.
*/
async getUser() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].user_id));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].user_id));
}

@@ -53,0 +53,0 @@ };

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixChannelData } from '../../../interfaces/helix/channel.external';

@@ -12,3 +12,3 @@ import type { HelixGame } from '../game/HelixGame';

/** @private */
constructor(data: HelixChannelData, client: BaseApiClient);
constructor(data: HelixChannelData, client: ApiClient);
/**

@@ -27,3 +27,3 @@ * The ID of the channel.

/**
* Gets more information about the broadcaster of the channel.
* Retrieves more information about the broadcaster of the channel.
*/

@@ -44,5 +44,5 @@ getBroadcaster(): Promise<HelixUser>;

/**
* Gets information about the game that is being played on the stream.
* Retrieves information about the game that is being played on the stream.
*/
getGame(): Promise<HelixGame | null>;
getGame(): Promise<HelixGame>;
/**

@@ -49,0 +49,0 @@ * The title of the channel.

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

/**
* Gets more information about the broadcaster of the channel.
* Retrieves more information about the broadcaster of the channel.
*/
async getBroadcaster() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].broadcaster_id));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].broadcaster_id));
}

@@ -60,8 +60,6 @@ /**

/**
* Gets information about the game that is being played on the stream.
* Retrieves information about the game that is being played on the stream.
*/
async getGame() {
return this[common_1.rawDataSymbol].game_id
? (0, common_1.checkRelationAssertion)(await this._client.games.getGameById(this[common_1.rawDataSymbol].game_id))
: null;
return (await this._client.games.getGameById(this[common_1.rawDataSymbol].game_id));
}

@@ -68,0 +66,0 @@ /**

import type { CommercialLength, UserIdResolvable } from '@twurple/common';
import { type HelixChannelFollowerData, type HelixFollowedChannelData } from '../../../interfaces/helix/channel.external';
import { type HelixChannelUpdate } from '../../../interfaces/helix/channel.input';

@@ -7,4 +6,3 @@ import { type HelixUserRelationData } from '../../../interfaces/helix/generic.external';

import { HelixPaginatedRequest } from '../HelixPaginatedRequest';
import { HelixPaginatedRequestWithTotal } from '../HelixPaginatedRequestWithTotal';
import { type HelixPaginatedResult, type HelixPaginatedResultWithTotal } from '../HelixPaginatedResult';
import type { HelixPaginatedResult } from '../HelixPaginatedResult';
import type { HelixForwardPagination } from '../HelixPagination';

@@ -14,4 +12,2 @@ import { HelixUserRelation } from '../relations/HelixUserRelation';

import { HelixChannelEditor } from './HelixChannelEditor';
import { HelixChannelFollower } from './HelixChannelFollower';
import { HelixFollowedChannel } from './HelixFollowedChannel';
/**

@@ -24,3 +20,3 @@ * The Helix API methods that deal with channels.

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const channel = await api.channels.getChannelInfoById('125328655');

@@ -34,3 +30,3 @@ * ```

/**
* Gets the channel data for the given user.
* Retrieves the channel data for the given user.
*

@@ -41,3 +37,3 @@ * @param user The user you want to get channel info for.

/**
* Gets the channel data for the given users.
* Retrieves the channel data for the given users.
*

@@ -48,2 +44,10 @@ * @param users The users you want to get channel info for.

/**
* Retrieves the channel data for the given user.
*
* @param user The user you want to get channel info for.
*
* @deprecated Use `getChannelInfoById` instead.
*/
getChannelInfo(user: UserIdResolvable): Promise<HelixChannel | null>;
/**
* Updates the given user's channel data.

@@ -63,3 +67,3 @@ *

/**
* Gets a list of users who have editor permissions on your channel.
* Retrieves a list of users who have editor permissions on your channel.
*

@@ -70,3 +74,3 @@ * @param broadcaster The broadcaster to retreive the editors for.

/**
* Gets a list of VIPs in a channel.
* Retrieves a list of VIPs in a channel.
*

@@ -113,56 +117,3 @@ * @param broadcaster The owner of the channel to get VIPs for.

removeVip(broadcaster: UserIdResolvable, user: UserIdResolvable): Promise<void>;
/**
* Gets the total number of users that follow the specified broadcaster.
*
* @param broadcaster The broadcaster you want to get the number of followers of.
*/
getChannelFollowerCount(broadcaster: UserIdResolvable): Promise<number>;
/**
* Gets a list of users that follow the specified broadcaster.
* You can also use this endpoint to see whether a specific user follows the broadcaster.
*
* @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.
* If specified, the response contains this user if they follow the broadcaster.
* If not specified, the response contains all users that follow the broadcaster.
* @param pagination
*
* @expandParams
*/
getChannelFollowers(broadcaster: UserIdResolvable, moderator: UserIdResolvable, user?: UserIdResolvable, pagination?: HelixForwardPagination): Promise<HelixPaginatedResultWithTotal<HelixChannelFollower>>;
/**
* Creates a paginator for users that follow the specified broadcaster.
*
* @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>;
/**
* 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 broadcaster An optional broadcaster to determine if the user follows this broadcaster.
* If specified, the response contains this broadcaster if the user follows them.
* If not specified, the response contains all broadcasters that the user follows.
* @param pagination
* @returns
*/
getFollowedChannels(user: UserIdResolvable, broadcaster?: UserIdResolvable, pagination?: HelixForwardPagination): Promise<HelixPaginatedResult<HelixFollowedChannel>>;
/**
* Creates a paginator for broadcasters that the specified user follows.
*
* @param user The user that's getting a list of followed channels.
* The token of this user will be used to get the list of followed channels.
* @param broadcaster An optional broadcaster to determine if the user follows this broadcaster.
* If specified, the response contains this broadcaster if the user follows them.
* If not specified, the response contains all broadcasters that the user follows.
* @returns
*/
getFollowedChannelsPaginated(user: UserIdResolvable, broadcaster?: UserIdResolvable): HelixPaginatedRequestWithTotal<HelixFollowedChannelData, HelixFollowedChannel>;
}
//# sourceMappingURL=HelixChannelApi.d.ts.map

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

const tslib_1 = require("tslib");
const shared_utils_1 = require("@d-fischer/shared-utils");
const api_call_1 = require("@twurple/api-call");

@@ -13,3 +12,2 @@ const common_1 = require("@twurple/common");

const HelixPaginatedRequest_1 = require("../HelixPaginatedRequest");
const HelixPaginatedRequestWithTotal_1 = require("../HelixPaginatedRequestWithTotal");
const HelixPaginatedResult_1 = require("../HelixPaginatedResult");

@@ -20,4 +18,2 @@ const HelixPagination_1 = require("../HelixPagination");

const HelixChannelEditor_1 = require("./HelixChannelEditor");
const HelixChannelFollower_1 = require("./HelixChannelFollower");
const HelixFollowedChannel_1 = require("./HelixFollowedChannel");
/**

@@ -30,3 +26,3 @@ * The Helix API methods that deal with channels.

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const channel = await api.channels.getChannelInfoById('125328655');

@@ -40,3 +36,3 @@ * ```

/**
* Gets the channel data for the given user.
* Retrieves the channel data for the given user.
*

@@ -46,13 +42,8 @@ * @param user The user you want to get channel info for.

async getChannelInfoById(user) {
const userId = (0, common_1.extractUserId)(user);
const result = await this._client.callApi({
type: 'helix',
url: 'channels',
userId,
query: (0, api_call_1.createBroadcasterQuery)(userId)
});
return (0, shared_utils_1.mapNullable)(result.data[0], data => new HelixChannel_1.HelixChannel(data, this._client));
var _a;
const channels = await this.getChannelInfoByIds([user]);
return (_a = channels[0]) !== null && _a !== void 0 ? _a : null;
}
/**
* Gets the channel data for the given users.
* Retrieves the channel data for the given users.
*

@@ -71,2 +62,12 @@ * @param users The users you want to get channel info for.

/**
* Retrieves the channel data for the given user.
*
* @param user The user you want to get channel info for.
*
* @deprecated Use `getChannelInfoById` instead.
*/
async getChannelInfo(user) {
return await this.getChannelInfoById(user);
}
/**
* Updates the given user's channel data.

@@ -82,4 +83,3 @@ *

method: 'PATCH',
userId: (0, common_1.extractUserId)(user),
scopes: ['channel:manage:broadcast'],
scope: 'channel:manage:broadcast',
query: (0, api_call_1.createBroadcasterQuery)(user),

@@ -100,4 +100,3 @@ jsonBody: (0, channel_external_1.createChannelUpdateBody)(data)

method: 'POST',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:edit:commercial'],
scope: 'channel:edit:commercial',
jsonBody: (0, channel_external_1.createChannelCommercialBody)(broadcaster, length)

@@ -107,3 +106,3 @@ });

/**
* Gets a list of users who have editor permissions on your channel.
* Retrieves a list of users who have editor permissions on your channel.
*

@@ -116,4 +115,3 @@ * @param broadcaster The broadcaster to retreive the editors for.

url: 'channels/editors',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:read:editors'],
scope: 'channel:read:editors',
query: (0, api_call_1.createBroadcasterQuery)(broadcaster)

@@ -124,3 +122,3 @@ });

/**
* Gets a list of VIPs in a channel.
* Retrieves a list of VIPs in a channel.
*

@@ -136,4 +134,3 @@ * @param broadcaster The owner of the channel to get VIPs for.

url: 'channels/vips',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:read:vips', 'channel:manage:vips'],
scope: 'channel:read:vips',
query: {

@@ -154,4 +151,3 @@ ...(0, api_call_1.createBroadcasterQuery)(broadcaster),

url: 'channels/vips',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:read:vips', 'channel:manage:vips'],
scope: 'channel:read:vips',
query: (0, api_call_1.createBroadcasterQuery)(broadcaster)

@@ -170,4 +166,3 @@ }, this._client, data => new HelixUserRelation_1.HelixUserRelation(data, this._client));

url: 'channels/vips',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:read:vips', 'channel:manage:vips'],
scope: 'channel:read:vips',
query: (0, generic_external_1.createChannelUsersCheckQuery)(broadcaster, users)

@@ -199,4 +194,3 @@ });

method: 'POST',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:manage:vips'],
scope: 'channel:manage:vips',
query: (0, channel_external_1.createChannelVipUpdateQuery)(broadcaster, user)

@@ -216,114 +210,6 @@ });

method: 'DELETE',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:manage:vips'],
scope: 'channel:manage:vips',
query: (0, channel_external_1.createChannelVipUpdateQuery)(broadcaster, user)
});
}
/**
* Gets the total number of users that follow the specified broadcaster.
*
* @param broadcaster The broadcaster you want to get the number of followers of.
*/
async getChannelFollowerCount(broadcaster) {
const result = await this._client.callApi({
type: 'helix',
url: 'channels/followers',
method: 'GET',
userId: (0, common_1.extractUserId)(broadcaster),
query: {
...(0, channel_external_1.createChannelFollowerQuery)(broadcaster),
...(0, HelixPagination_1.createPaginationQuery)({ limit: 1 })
}
});
return result.total;
}
/**
* Gets a list of users that follow the specified broadcaster.
* You can also use this endpoint to see whether a specific user follows the broadcaster.
*
* @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.
* If specified, the response contains this user if they follow the broadcaster.
* If not specified, the response contains all users that follow the broadcaster.
* @param pagination
*
* @expandParams
*/
async getChannelFollowers(broadcaster, moderator, user, pagination) {
const result = await this._client.callApi({
type: 'helix',
url: 'channels/followers',
method: 'GET',
userId: (0, common_1.extractUserId)(moderator),
scopes: ['moderator:read:followers'],
query: {
...(0, channel_external_1.createChannelFollowerQuery)(broadcaster, user),
...(0, HelixPagination_1.createPaginationQuery)(pagination)
}
});
return (0, HelixPaginatedResult_1.createPaginatedResultWithTotal)(result, HelixChannelFollower_1.HelixChannelFollower, this._client);
}
/**
* Creates a paginator for users that follow the specified broadcaster.
*
* @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) {
return new HelixPaginatedRequestWithTotal_1.HelixPaginatedRequestWithTotal({
url: 'channels/followers',
method: 'GET',
userId: (0, common_1.extractUserId)(moderator),
scopes: ['moderator:read:followers'],
query: (0, channel_external_1.createChannelFollowerQuery)(broadcaster)
}, this._client, data => new HelixChannelFollower_1.HelixChannelFollower(data, this._client));
}
/**
* 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 broadcaster An optional broadcaster to determine if the user follows this broadcaster.
* If specified, the response contains this broadcaster if the user follows them.
* If not specified, the response contains all broadcasters that the user follows.
* @param pagination
* @returns
*/
async getFollowedChannels(user, broadcaster, pagination) {
const result = await this._client.callApi({
type: 'helix',
url: 'channels/followed',
method: 'GET',
userId: (0, common_1.extractUserId)(user),
scopes: ['user:read:follows'],
query: {
...(0, channel_external_1.createFollowedChannelQuery)(user, broadcaster),
...(0, HelixPagination_1.createPaginationQuery)(pagination)
}
});
return (0, HelixPaginatedResult_1.createPaginatedResultWithTotal)(result, HelixFollowedChannel_1.HelixFollowedChannel, this._client);
}
/**
* Creates a paginator for broadcasters that the specified user follows.
*
* @param user The user that's getting a list of followed channels.
* The token of this user will be used to get the list of followed channels.
* @param broadcaster An optional broadcaster to determine if the user follows this broadcaster.
* If specified, the response contains this broadcaster if the user follows them.
* If not specified, the response contains all broadcasters that the user follows.
* @returns
*/
getFollowedChannelsPaginated(user, broadcaster) {
return new HelixPaginatedRequestWithTotal_1.HelixPaginatedRequestWithTotal({
url: 'channels/followed',
method: 'GET',
userId: (0, common_1.extractUserId)(user),
scopes: ['user:read:follows'],
query: (0, channel_external_1.createFollowedChannelQuery)(user, broadcaster)
}, this._client, data => new HelixFollowedChannel_1.HelixFollowedChannel(data, this._client));
}
};

@@ -330,0 +216,0 @@ HelixChannelApi = tslib_1.__decorate([

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixChannelEditorData } from '../../../interfaces/helix/channel.external';

@@ -11,3 +11,3 @@ import type { HelixUser } from '../user/HelixUser';

/** @private */
constructor(data: HelixChannelEditorData, client: BaseApiClient);
constructor(data: HelixChannelEditorData, client: ApiClient);
/**

@@ -22,3 +22,3 @@ * The ID of the user.

/**
* Gets additional information about the user.
* Retrieves additional information about the user.
*/

@@ -25,0 +25,0 @@ getUser(): Promise<HelixUser>;

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

/**
* Gets additional information about the user.
* Retrieves additional information about the user.
*/
async getUser() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].user_id));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].user_id));
}

@@ -35,0 +35,0 @@ /**

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixChannelReferenceData } from '../../../interfaces/helix/channel.external';

@@ -13,3 +13,3 @@ import type { HelixGame } from '../game/HelixGame';

/** @private */
constructor(data: HelixChannelReferenceData, client: BaseApiClient);
constructor(data: HelixChannelReferenceData, client: ApiClient);
/**

@@ -24,7 +24,7 @@ * The ID of the channel.

/**
* Gets more information about the channel.
* Retrieves more information about the channel.
*/
getChannel(): Promise<HelixChannel>;
/**
* Gets more information about the broadcaster of the channel.
* Retrieves more information about the broadcaster of the channel.
*/

@@ -41,5 +41,5 @@ getBroadcaster(): Promise<HelixUser>;

/**
* Gets information about the game that is being played on the stream.
* Retrieves information about the game that is being played on the stream.
*/
getGame(): Promise<HelixGame | null>;
getGame(): Promise<HelixGame>;
/**

@@ -46,0 +46,0 @@ * The title of the channel.

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

/**
* Gets more information about the channel.
* Retrieves more information about the channel.
*/
async getChannel() {
return (0, common_1.checkRelationAssertion)(await this._client.channels.getChannelInfoById(this[common_1.rawDataSymbol].broadcaster_id));
return (await this._client.channels.getChannelInfoById(this[common_1.rawDataSymbol].broadcaster_id));
}
/**
* Gets more information about the broadcaster of the channel.
* Retrieves more information about the broadcaster of the channel.
*/
async getBroadcaster() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].broadcaster_id));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].broadcaster_id));
}

@@ -54,8 +54,6 @@ /**

/**
* Gets information about the game that is being played on the stream.
* Retrieves information about the game that is being played on the stream.
*/
async getGame() {
return this[common_1.rawDataSymbol].game_id
? (0, common_1.checkRelationAssertion)(await this._client.games.getGameById(this[common_1.rawDataSymbol].game_id))
: null;
return (await this._client.games.getGameById(this[common_1.rawDataSymbol].game_id));
}

@@ -62,0 +60,0 @@ /**

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

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const rewards = await api.channelPoints.getCustomRewards('125328655');

@@ -26,12 +26,12 @@ * ```

/**
* Gets all custom rewards for the given broadcaster.
* Retrieves all custom rewards for the given broadcaster.
*
* @param broadcaster The broadcaster to get the rewards for.
* @param onlyManageable Whether to only get rewards that can be managed by the API.
* @param broadcaster The broadcaster to retrieve the rewards for.
* @param onlyManageable Whether to only retrieve rewards that can be managed by the API.
*/
getCustomRewards(broadcaster: UserIdResolvable, onlyManageable?: boolean): Promise<HelixCustomReward[]>;
/**
* Gets custom rewards by IDs.
* Retrieves custom rewards by IDs.
*
* @param broadcaster The broadcaster to get the rewards for.
* @param broadcaster The broadcaster to retrieve the rewards for.
* @param rewardIds The IDs of the rewards.

@@ -41,5 +41,5 @@ */

/**
* Gets a custom reward by ID.
* Retrieves a custom reward by ID.
*
* @param broadcaster The broadcaster to get the reward for.
* @param broadcaster The broadcaster to retrieve the reward for.
* @param rewardId The ID of the reward.

@@ -73,5 +73,5 @@ */

/**
* Gets custom reward redemptions by IDs.
* Retrieves custom reward redemptions by IDs.
*
* @param broadcaster The broadcaster to get the redemptions for.
* @param broadcaster The broadcaster to retrieve the redemptions for.
* @param rewardId The ID of the reward.

@@ -82,5 +82,5 @@ * @param redemptionIds The IDs of the redemptions.

/**
* Gets a custom reward redemption by ID.
* Retrieves a custom reward redemption by ID.
*
* @param broadcaster The broadcaster to get the redemption for.
* @param broadcaster The broadcaster to retrieve the redemption for.
* @param rewardId The ID of the reward.

@@ -91,7 +91,7 @@ * @param redemptionId The ID of the redemption.

/**
* Gets custom reward redemptions for the given broadcaster.
* Retrieves custom reward redemptions for the given broadcaster.
*
* @param broadcaster The broadcaster to get the redemptions for.
* @param broadcaster The broadcaster to retrieve the redemptions for.
* @param rewardId The ID of the reward.
* @param status The status of the redemptions to get.
* @param status The status of the redemptions to retrieve.
* @param filter

@@ -105,5 +105,5 @@ *

*
* @param broadcaster The broadcaster to get the redemptions for.
* @param broadcaster The broadcaster to retrieve the redemptions for.
* @param rewardId The ID of the reward.
* @param status The status of the redemptions to get.
* @param status The status of the redemptions to retrieve.
* @param filter

@@ -117,3 +117,3 @@ *

*
* @param broadcaster The broadcaster to update the redemptions for.
* @param broadcaster The broadcaster to retrieve the redemptions for.
* @param rewardId The ID of the reward.

@@ -120,0 +120,0 @@ * @param redemptionIds The IDs of the redemptions to update.

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

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const rewards = await api.channelPoints.getCustomRewards('125328655');

@@ -32,6 +32,6 @@ * ```

/**
* Gets all custom rewards for the given broadcaster.
* Retrieves all custom rewards for the given broadcaster.
*
* @param broadcaster The broadcaster to get the rewards for.
* @param onlyManageable Whether to only get rewards that can be managed by the API.
* @param broadcaster The broadcaster to retrieve the rewards for.
* @param onlyManageable Whether to only retrieve rewards that can be managed by the API.
*/

@@ -42,4 +42,3 @@ async getCustomRewards(broadcaster, onlyManageable) {

url: 'channel_points/custom_rewards',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:read:redemptions'],
scope: 'channel:read:redemptions',
query: (0, channelPoints_external_1.createCustomRewardsQuery)(broadcaster, onlyManageable)

@@ -50,5 +49,5 @@ });

/**
* Gets custom rewards by IDs.
* Retrieves custom rewards by IDs.
*
* @param broadcaster The broadcaster to get the rewards for.
* @param broadcaster The broadcaster to retrieve the rewards for.
* @param rewardIds The IDs of the rewards.

@@ -63,4 +62,3 @@ */

url: 'channel_points/custom_rewards',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:read:redemptions'],
scope: 'channel:read:redemptions',
query: (0, generic_external_1.createGetByIdsQuery)(broadcaster, rewardIds)

@@ -71,5 +69,5 @@ });

/**
* Gets a custom reward by ID.
* Retrieves a custom reward by ID.
*
* @param broadcaster The broadcaster to get the reward for.
* @param broadcaster The broadcaster to retrieve the reward for.
* @param rewardId The ID of the reward.

@@ -94,4 +92,3 @@ */

method: 'POST',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:manage:redemptions'],
scope: 'channel:manage:redemptions',
query: (0, api_call_1.createBroadcasterQuery)(broadcaster),

@@ -114,4 +111,3 @@ jsonBody: (0, channelPoints_external_1.createCustomRewardBody)(data)

method: 'PATCH',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:manage:redemptions'],
scope: 'channel:manage:redemptions',
query: (0, channelPoints_external_1.createCustomRewardChangeQuery)(broadcaster, rewardId),

@@ -133,4 +129,3 @@ jsonBody: (0, channelPoints_external_1.createCustomRewardBody)(data)

method: 'DELETE',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:manage:redemptions'],
scope: 'channel:manage:redemptions',
query: (0, channelPoints_external_1.createCustomRewardChangeQuery)(broadcaster, rewardId)

@@ -140,5 +135,5 @@ });

/**
* Gets custom reward redemptions by IDs.
* Retrieves custom reward redemptions by IDs.
*
* @param broadcaster The broadcaster to get the redemptions for.
* @param broadcaster The broadcaster to retrieve the redemptions for.
* @param rewardId The ID of the reward.

@@ -154,4 +149,3 @@ * @param redemptionIds The IDs of the redemptions.

url: 'channel_points/custom_rewards/redemptions',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:read:redemptions'],
scope: 'channel:read:redemptions',
query: (0, channelPoints_external_1.createRewardRedemptionsByIdsQuery)(broadcaster, rewardId, redemptionIds)

@@ -162,5 +156,5 @@ });

/**
* Gets a custom reward redemption by ID.
* Retrieves a custom reward redemption by ID.
*
* @param broadcaster The broadcaster to get the redemption for.
* @param broadcaster The broadcaster to retrieve the redemption for.
* @param rewardId The ID of the reward.

@@ -174,7 +168,7 @@ * @param redemptionId The ID of the redemption.

/**
* Gets custom reward redemptions for the given broadcaster.
* Retrieves custom reward redemptions for the given broadcaster.
*
* @param broadcaster The broadcaster to get the redemptions for.
* @param broadcaster The broadcaster to retrieve the redemptions for.
* @param rewardId The ID of the reward.
* @param status The status of the redemptions to get.
* @param status The status of the redemptions to retrieve.
* @param filter

@@ -188,4 +182,3 @@ *

url: 'channel_points/custom_rewards/redemptions',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:read:redemptions'],
scope: 'channel:read:redemptions',
query: {

@@ -201,5 +194,5 @@ ...(0, channelPoints_external_1.createRedemptionsForBroadcasterQuery)(broadcaster, rewardId, status, filter),

*
* @param broadcaster The broadcaster to get the redemptions for.
* @param broadcaster The broadcaster to retrieve the redemptions for.
* @param rewardId The ID of the reward.
* @param status The status of the redemptions to get.
* @param status The status of the redemptions to retrieve.
* @param filter

@@ -212,4 +205,3 @@ *

url: 'channel_points/custom_rewards/redemptions',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:read:redemptions'],
scope: 'channel:read:redemptions',
query: (0, channelPoints_external_1.createRedemptionsForBroadcasterQuery)(broadcaster, rewardId, status, filter)

@@ -221,3 +213,3 @@ }, this._client, data => new HelixCustomRewardRedemption_1.HelixCustomRewardRedemption(data, this._client), 50);

*
* @param broadcaster The broadcaster to update the redemptions for.
* @param broadcaster The broadcaster to retrieve the redemptions for.
* @param rewardId The ID of the reward.

@@ -235,4 +227,3 @@ * @param redemptionIds The IDs of the redemptions to update.

method: 'PATCH',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:manage:redemptions'],
scope: 'channel:manage:redemptions',
query: (0, channelPoints_external_1.createRewardRedemptionsByIdsQuery)(broadcaster, rewardId, redemptionIds),

@@ -239,0 +230,0 @@ jsonBody: {

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixCustomRewardData } from '../../../interfaces/helix/channelPoints.external';

@@ -12,3 +12,3 @@ import { type HelixCustomRewardImageScale } from '../../../interfaces/helix/channelPoints.input';

/** @private */
constructor(data: HelixCustomRewardData, client: BaseApiClient);
constructor(data: HelixCustomRewardData, client: ApiClient);
/**

@@ -31,3 +31,3 @@ * The ID of the reward.

/**
* Gets more information about the reward's broadcaster.
* Retrieves more information about the reward's broadcaster.
*/

@@ -96,2 +96,8 @@ getBroadcaster(): Promise<HelixUser>;

/**
* Whether redemptions should automatically be marked as fulfilled.
*
* @deprecated Use `autoFulfill` instead.
*/
get autoApproved(): boolean;
/**
* The time when the cooldown ends. `null` means there is currently no cooldown.

@@ -98,0 +104,0 @@ */

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

/**
* Gets more information about the reward's broadcaster.
* Retrieves more information about the reward's broadcaster.
*/
async getBroadcaster() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].broadcaster_id));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].broadcaster_id));
}

@@ -144,2 +144,10 @@ /**

/**
* Whether redemptions should automatically be marked as fulfilled.
*
* @deprecated Use `autoFulfill` instead.
*/
get autoApproved() {
return this[common_1.rawDataSymbol].should_redemptions_skip_request_queue;
}
/**
* The time when the cooldown ends. `null` means there is currently no cooldown.

@@ -146,0 +154,0 @@ */

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixCustomRewardRedemptionData, type HelixCustomRewardRedemptionTargetStatus } from '../../../interfaces/helix/channelPoints.external';

@@ -12,3 +12,3 @@ import type { HelixUser } from '../user/HelixUser';

/** @private */
constructor(data: HelixCustomRewardRedemptionData, client: BaseApiClient);
constructor(data: HelixCustomRewardRedemptionData, client: ApiClient);
/**

@@ -31,3 +31,3 @@ * The ID of the redemption.

/**
* Gets more information about the broadcaster where the reward was redeemed.
* Retrieves more information about the broadcaster where the reward was redeemed.
*/

@@ -48,3 +48,3 @@ getBroadcaster(): Promise<HelixUser>;

/**
* Gets more information about the user that redeemed the reward.
* Retrieves more information about the user that redeemed the reward.
*/

@@ -85,3 +85,3 @@ getUser(): Promise<HelixUser>;

/**
* Gets more information about the reward that was redeemed.
* Retrieves more info about the reward that was redeemed.
*/

@@ -88,0 +88,0 @@ getReward(): Promise<HelixCustomReward>;

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

/**
* Gets more information about the broadcaster where the reward was redeemed.
* Retrieves more information about the broadcaster where the reward was redeemed.
*/
async getBroadcaster() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].broadcaster_id));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].broadcaster_id));
}

@@ -66,6 +66,6 @@ /**

/**
* Gets more information about the user that redeemed the reward.
* Retrieves more information about the user that redeemed the reward.
*/
async getUser() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].user_id));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].user_id));
}

@@ -121,6 +121,6 @@ /**

/**
* Gets more information about the reward that was redeemed.
* Retrieves more info about the reward that was redeemed.
*/
async getReward() {
return (0, common_1.checkRelationAssertion)(await this._client.channelPoints.getCustomRewardById(this[common_1.rawDataSymbol].broadcaster_id, this[common_1.rawDataSymbol].reward.id));
return (await this._client.channelPoints.getCustomRewardById(this[common_1.rawDataSymbol].broadcaster_id, this[common_1.rawDataSymbol].reward.id));
}

@@ -127,0 +127,0 @@ /**

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

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const charityCampaign = await api.charity.getCharityCampaign('125328655');

@@ -17,0 +17,0 @@ * ```

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

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const charityCampaign = await api.charity.getCharityCampaign('125328655');

@@ -39,4 +39,3 @@ * ```

method: 'GET',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:read:charity'],
scope: 'channel:read:charity',
query: (0, api_call_1.createBroadcasterQuery)(broadcaster)

@@ -58,4 +57,3 @@ });

url: 'charity/donations',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:read:charity'],
scope: 'channel:read:charity',
query: {

@@ -62,0 +60,0 @@ ...(0, api_call_1.createBroadcasterQuery)(broadcaster),

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixCharityCampaignData } from '../../../interfaces/helix/charity.external';

@@ -12,3 +12,3 @@ import type { HelixUser } from '../user/HelixUser';

/** @private */
constructor(data: HelixCharityCampaignData, client: BaseApiClient);
constructor(data: HelixCharityCampaignData, client: ApiClient);
/**

@@ -31,3 +31,3 @@ * An ID that identifies the charity campaign.

/**
* Gets more information about the broadcaster.
* Retrieves more information about the broadcaster.
*/

@@ -34,0 +34,0 @@ getBroadcaster(): Promise<HelixUser>;

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

/**
* Gets more information about the broadcaster.
* Retrieves more information about the broadcaster.
*/
async getBroadcaster() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].broadcaster_id));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].broadcaster_id));
}

@@ -48,0 +48,0 @@ /**

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixCharityCampaignDonationData } from '../../../interfaces/helix/charity.external';

@@ -12,3 +12,3 @@ import type { HelixUser } from '../user/HelixUser';

/** @private */
constructor(data: HelixCharityCampaignDonationData, client: BaseApiClient);
constructor(data: HelixCharityCampaignDonationData, client: ApiClient);
/**

@@ -31,3 +31,3 @@ * An ID that identifies the charity campaign.

/**
* Gets more information about the donating user.
* Retrieves more information about the donating user.
*/

@@ -34,0 +34,0 @@ getDonor(): Promise<HelixUser>;

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

/**
* Gets more information about the donating user.
* Retrieves more information about the donating user.
*/
async getDonor() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].user_id));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].user_id));
}

@@ -48,0 +48,0 @@ /**

import { rawDataSymbol } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixChannelEmoteData, type HelixChannelEmoteSubscriptionTier } from '../../../interfaces/helix/chat.external';

@@ -14,3 +14,3 @@ import { HelixEmote } from './HelixEmote';

private readonly _client;
constructor(data: HelixChannelEmoteData, client: BaseApiClient);
constructor(data: HelixChannelEmoteData, client: ApiClient);
/**

@@ -31,3 +31,3 @@ * The subscription tier necessary to unlock the emote, or null if the emote is not a subscription emote.

/**
* Gets all emotes from the emote's set.
* Retrieves all emotes from the emote's set.
*/

@@ -34,0 +34,0 @@ getAllEmotesFromSet(): Promise<HelixEmoteFromSet[]>;

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

/**
* Gets all emotes from the emote's set.
* Retrieves all emotes from the emote's set.
*/

@@ -42,0 +42,0 @@ async getAllEmotesFromSet() {

import type { UserIdResolvable } from '@twurple/common';
import { type HelixChatChatterData, type HelixChatUserColor } from '../../../interfaces/helix/chat.external';
import { type HelixChatUserColor } from '../../../interfaces/helix/chat.external';
import { type HelixSendChatAnnouncementParams, type HelixUpdateChatSettingsParams } from '../../../interfaces/helix/chat.input';
import { BaseApi } from '../../BaseApi';
import { HelixPaginatedRequestWithTotal } from '../HelixPaginatedRequestWithTotal';
import { type HelixPaginatedResultWithTotal } from '../HelixPaginatedResult';

@@ -22,3 +21,3 @@ import { type HelixForwardPagination } from '../HelixPagination';

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const rewards = await api.chat.getChannelBadges('125328655');

@@ -36,3 +35,3 @@ * ```

* @param moderator The broadcaster or one of the broadcaster’s moderators.
* The token of this user will be used to fetch the chatters.
* This user must match the user associated with the user OAuth token.
* @param pagination

@@ -44,39 +43,29 @@ *

/**
* Creates a paginator for users that are connected to the broadcaster’s chat session.
*
* @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
* Retrieves all global badges.
*/
getChattersPaginated(broadcaster: UserIdResolvable, moderator: UserIdResolvable): HelixPaginatedRequestWithTotal<HelixChatChatterData, HelixChatChatter>;
/**
* Gets all global badges.
*/
getGlobalBadges(): Promise<HelixChatBadgeSet[]>;
/**
* Gets all badges specific to the given broadcaster.
* Retrieves all badges specific to the given broadcaster.
*
* @param broadcaster The broadcaster to get badges for.
* @param broadcaster The broadcaster to retrieve badges for.
*/
getChannelBadges(broadcaster: UserIdResolvable): Promise<HelixChatBadgeSet[]>;
/**
* Gets all global emotes.
* Retrieves all global emotes.
*/
getGlobalEmotes(): Promise<HelixEmote[]>;
/**
* Gets all emotes specific to the given broadcaster.
* Retrieves all emotes from a channel.
*
* @param broadcaster The broadcaster to get emotes for.
* @param channel The channel to retrieve emotes from.
*/
getChannelEmotes(broadcaster: UserIdResolvable): Promise<HelixChannelEmote[]>;
getChannelEmotes(channel: UserIdResolvable): Promise<HelixChannelEmote[]>;
/**
* Gets all emotes from a list of emote sets.
* Retrieves all emotes from a list of emote sets.
*
* @param setIds The IDs of the emote sets to get emotes from.
* @param setIds The IDs of the emote sets to retrieve emotes from.
*/
getEmotesFromSets(setIds: string[]): Promise<HelixEmoteFromSet[]>;
/**
* Gets the settings of a broadcaster's chat.
* Retrieves the settings of a broadcaster's chat.
*

@@ -87,3 +76,3 @@ * @param broadcaster The broadcaster the chat belongs to.

/**
* Gets the settings of a broadcaster's chat, including the delay settings.
* Retrieves the settings of a broadcaster's chat, including the delay settings.
*

@@ -122,3 +111,3 @@ * @param broadcaster The broadcaster the chat belongs to.

/**
* Gets the chat colors for a list of users.
* Retrieves the chat colors for a list of users.
*

@@ -133,3 +122,3 @@ * Returns a Map with user IDs as keys and their colors as values.

/**
* Gets the chat color for a user.
* Retrieves the chat color for a user.
*

@@ -150,13 +139,3 @@ * Returns the color as hex code, `null` if the user did not set a color, or `undefined` if the user is unknown.

setColorForUser(user: UserIdResolvable, color: HelixChatUserColor): Promise<void>;
/**
* Sends a shoutout to the specified broadcaster.
* The broadcaster may send a shoutout once every 2 minutes. They may send the same broadcaster a shoutout once every 60 minutes.
*
* @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>;
}
//# sourceMappingURL=HelixChatApi.d.ts.map

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

const BaseApi_1 = require("../../BaseApi");
const HelixPaginatedRequestWithTotal_1 = require("../HelixPaginatedRequestWithTotal");
const HelixPaginatedResult_1 = require("../HelixPaginatedResult");

@@ -28,3 +27,3 @@ const HelixPagination_1 = require("../HelixPagination");

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const rewards = await api.chat.getChannelBadges('125328655');

@@ -42,3 +41,3 @@ * ```

* @param moderator The broadcaster or one of the broadcaster’s moderators.
* The token of this user will be used to fetch the chatters.
* This user must match the user associated with the user OAuth token.
* @param pagination

@@ -52,4 +51,3 @@ *

url: 'chat/chatters',
userId: (0, common_1.extractUserId)(moderator),
scopes: ['moderator:read:chatters'],
scope: 'moderator:read:chatters',
query: {

@@ -63,21 +61,4 @@ ...(0, generic_external_1.createModeratorActionQuery)(broadcaster, moderator),

/**
* Creates a paginator for users that are connected to the broadcaster’s chat session.
*
* @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
* Retrieves all global badges.
*/
getChattersPaginated(broadcaster, moderator) {
return new HelixPaginatedRequestWithTotal_1.HelixPaginatedRequestWithTotal({
url: 'chat/chatters',
userId: (0, common_1.extractUserId)(moderator),
scopes: ['moderator:read:chatters'],
query: (0, generic_external_1.createModeratorActionQuery)(broadcaster, moderator)
}, this._client, data => new HelixChatChatter_1.HelixChatChatter(data, this._client));
}
/**
* Gets all global badges.
*/
async getGlobalBadges() {

@@ -91,5 +72,5 @@ const result = await this._client.callApi({

/**
* Gets all badges specific to the given broadcaster.
* Retrieves all badges specific to the given broadcaster.
*
* @param broadcaster The broadcaster to get badges for.
* @param broadcaster The broadcaster to retrieve badges for.
*/

@@ -100,3 +81,2 @@ async getChannelBadges(broadcaster) {

url: 'chat/badges',
userId: (0, common_1.extractUserId)(broadcaster),
query: (0, api_call_1.createBroadcasterQuery)(broadcaster)

@@ -107,3 +87,3 @@ });

/**
* Gets all global emotes.
* Retrieves all global emotes.
*/

@@ -118,12 +98,11 @@ async getGlobalEmotes() {

/**
* Gets all emotes specific to the given broadcaster.
* Retrieves all emotes from a channel.
*
* @param broadcaster The broadcaster to get emotes for.
* @param channel The channel to retrieve emotes from.
*/
async getChannelEmotes(broadcaster) {
async getChannelEmotes(channel) {
const result = await this._client.callApi({
type: 'helix',
url: 'chat/emotes',
userId: (0, common_1.extractUserId)(broadcaster),
query: (0, api_call_1.createBroadcasterQuery)(broadcaster)
query: (0, api_call_1.createBroadcasterQuery)(channel)
});

@@ -133,5 +112,5 @@ return result.data.map(data => new HelixChannelEmote_1.HelixChannelEmote(data, this._client));

/**
* Gets all emotes from a list of emote sets.
* Retrieves all emotes from a list of emote sets.
*
* @param setIds The IDs of the emote sets to get emotes from.
* @param setIds The IDs of the emote sets to retrieve emotes from.
*/

@@ -147,3 +126,3 @@ async getEmotesFromSets(setIds) {

/**
* Gets the settings of a broadcaster's chat.
* Retrieves the settings of a broadcaster's chat.
*

@@ -156,3 +135,2 @@ * @param broadcaster The broadcaster the chat belongs to.

url: 'chat/settings',
userId: (0, common_1.extractUserId)(broadcaster),
query: (0, api_call_1.createBroadcasterQuery)(broadcaster)

@@ -163,3 +141,3 @@ });

/**
* Gets the settings of a broadcaster's chat, including the delay settings.
* Retrieves the settings of a broadcaster's chat, including the delay settings.
*

@@ -176,4 +154,3 @@ * @param broadcaster The broadcaster the chat belongs to.

url: 'chat/settings',
userId: (0, common_1.extractUserId)(moderator),
scopes: ['moderator:read:chat_settings'],
scope: 'moderator:read:chat_settings',
query: (0, generic_external_1.createModeratorActionQuery)(broadcaster, moderator)

@@ -200,4 +177,3 @@ });

method: 'PATCH',
userId: (0, common_1.extractUserId)(moderator),
scopes: ['moderator:manage:chat_settings'],
scope: 'moderator:manage:chat_settings',
query: (0, generic_external_1.createModeratorActionQuery)(broadcaster, moderator),

@@ -223,4 +199,3 @@ jsonBody: (0, chat_external_1.createChatSettingsUpdateBody)(settings)

method: 'POST',
userId: (0, common_1.extractUserId)(moderator),
scopes: ['moderator:manage:announcements'],
scope: 'moderator:manage:announcements',
query: (0, generic_external_1.createModeratorActionQuery)(broadcaster, moderator),

@@ -234,3 +209,3 @@ jsonBody: {

/**
* Gets the chat colors for a list of users.
* Retrieves the chat colors for a list of users.
*

@@ -252,3 +227,3 @@ * Returns a Map with user IDs as keys and their colors as values.

/**
* Gets the chat color for a user.
* Retrieves the chat color for a user.
*

@@ -260,12 +235,5 @@ * Returns the color as hex code, `null` if the user did not set a color, or `undefined` if the user is unknown.

async getColorForUser(user) {
const response = await this._client.callApi({
type: 'helix',
url: 'chat/color',
userId: (0, common_1.extractUserId)(user),
query: (0, generic_external_1.createSingleKeyQuery)('user_id', (0, common_1.extractUserId)(user))
});
if (!response.data.length) {
return undefined;
}
return response.data[0].color || null;
const userId = (0, common_1.extractUserId)(user);
const result = await this.getColorsForUsers([userId]);
return result.get(userId);
}

@@ -285,26 +253,6 @@ /**

method: 'PUT',
userId: (0, common_1.extractUserId)(user),
scopes: ['user:manage:chat_color'],
scope: 'user:manage:chat_color',
query: (0, chat_external_1.createChatColorUpdateQuery)(user, color)
});
}
/**
* Sends a shoutout to the specified broadcaster.
* The broadcaster may send a shoutout once every 2 minutes. They may send the same broadcaster a shoutout once every 60 minutes.
*
* @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) {
await this._client.callApi({
type: 'helix',
url: 'chat/shoutouts',
method: 'POST',
userId: (0, common_1.extractUserId)(moderator),
scopes: ['moderator:manage:shoutouts'],
query: (0, chat_external_1.createShoutoutQuery)(from, to, moderator)
});
}
};

@@ -311,0 +259,0 @@ HelixChatApi = tslib_1.__decorate([

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

/**
* Gets a specific version of the badge.
* Retrieves a specific version of the badge.
*

@@ -20,0 +20,0 @@ * @param versionId The ID of the version.

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

/**
* Gets a specific version of the badge.
* Retrieves a specific version of the badge.
*

@@ -28,0 +28,0 @@ * @param versionId The ID of the version.

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

getImageUrl(scale: HelixChatBadgeScale): string;
/**
* The title of the badge.
*/
get title(): string;
/**
* The description of the badge.
*/
get description(): string;
/**
* The action to take when clicking on the badge. Set to `null` if no action is specified.
*/
get clickAction(): string | null;
/**
* The URL to navigate to when clicking on the badge. Set to `null` if no URL is specified.
*/
get clickUrl(): string | null;
}
//# sourceMappingURL=HelixChatBadgeVersion.d.ts.map

@@ -24,26 +24,2 @@ "use strict";

}
/**
* The title of the badge.
*/
get title() {
return this[common_1.rawDataSymbol].title;
}
/**
* The description of the badge.
*/
get description() {
return this[common_1.rawDataSymbol].description;
}
/**
* The action to take when clicking on the badge. Set to `null` if no action is specified.
*/
get clickAction() {
return this[common_1.rawDataSymbol].click_action;
}
/**
* The URL to navigate to when clicking on the badge. Set to `null` if no URL is specified.
*/
get clickUrl() {
return this[common_1.rawDataSymbol].click_url;
}
};

@@ -50,0 +26,0 @@ HelixChatBadgeVersion = tslib_1.__decorate([

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import { type ApiClient } from '../../../ApiClient';
import { type HelixChatChatterData } from '../../../interfaces/helix/chat.external';

@@ -7,2 +7,4 @@ import { type HelixUser } from '../user/HelixUser';

* A user connected to a Twitch channel's chat session.
*
* @beta
*/

@@ -12,3 +14,3 @@ export declare class HelixChatChatter extends DataObject<HelixChatChatterData> {

/** @private */
constructor(data: HelixChatChatterData, client: BaseApiClient);
constructor(data: HelixChatChatterData, client: ApiClient);
/**

@@ -27,3 +29,3 @@ * The ID of the user.

/**
* Gets more information about the user.
* Retrieves more information about the user.
*/

@@ -30,0 +32,0 @@ getUser(): Promise<HelixUser>;

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

* A user connected to a Twitch channel's chat session.
*
* @beta
*/

@@ -36,6 +38,6 @@ let HelixChatChatter = class HelixChatChatter extends common_1.DataObject {

/**
* Gets more information about the user.
* Retrieves more information about the user.
*/
async getUser() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].user_id));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].user_id));
}

@@ -42,0 +44,0 @@ };

import { rawDataSymbol } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixEmoteFromSetData } from '../../../interfaces/helix/chat.external';

@@ -14,3 +14,3 @@ import type { HelixUser } from '../user/HelixUser';

private readonly _client;
constructor(data: HelixEmoteFromSetData, client: BaseApiClient);
constructor(data: HelixEmoteFromSetData, client: ApiClient);
/**

@@ -33,3 +33,3 @@ * The type of the emote.

/**
* Gets more information about the user that owns the emote, or null if the emote is not owned by a user.
* Retrieves more info about the user that owns the emote, or null if the emote is not owned by a user.
*/

@@ -36,0 +36,0 @@ getOwner(): Promise<HelixUser | null>;

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

/**
* Gets more information about the user that owns the emote, or null if the emote is not owned by a user.
* Retrieves more info about the user that owns the emote, or null if the emote is not owned by a user.
*/

@@ -52,0 +52,0 @@ async getOwner() {

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixClipData } from '../../../interfaces/helix/clip.external';

@@ -10,3 +10,3 @@ import type { HelixGame } from '../game/HelixGame';

/** @private */
constructor(data: HelixClipData, client: BaseApiClient);
constructor(data: HelixClipData, client: ApiClient);
/**

@@ -33,3 +33,3 @@ * The clip ID.

/**
* Gets information about the broadcaster of the stream where the clip was created.
* Retrieves information about the broadcaster of the stream where the clip was created.
*/

@@ -46,3 +46,3 @@ getBroadcaster(): Promise<HelixUser>;

/**
* Gets information about the creator of the clip.
* Retrieves information about the creator of the clip.
*/

@@ -55,3 +55,3 @@ getCreator(): Promise<HelixUser>;

/**
* Gets information about the video the clip is taken from.
* Retrieves information about the video the clip is taken from.
*/

@@ -64,5 +64,5 @@ getVideo(): Promise<HelixVideo>;

/**
* Gets information about the game that was being played when the clip was created.
* Retrieves information about the game that was being played when the clip was created.
*/
getGame(): Promise<HelixGame | null>;
getGame(): Promise<HelixGame>;
/**

@@ -69,0 +69,0 @@ * The language of the stream where the clip was created.

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

/**
* Gets information about the broadcaster of the stream where the clip was created.
* Retrieves information about the broadcaster of the stream where the clip was created.
*/
async getBroadcaster() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].broadcaster_id));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].broadcaster_id));
}

@@ -63,6 +63,6 @@ /**

/**
* Gets information about the creator of the clip.
* Retrieves information about the creator of the clip.
*/
async getCreator() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].creator_id));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].creator_id));
}

@@ -76,6 +76,6 @@ /**

/**
* Gets information about the video the clip is taken from.
* Retrieves information about the video the clip is taken from.
*/
async getVideo() {
return (0, common_1.checkRelationAssertion)(await this._client.videos.getVideoById(this[common_1.rawDataSymbol].video_id));
return (await this._client.videos.getVideoById(this[common_1.rawDataSymbol].video_id));
}

@@ -89,8 +89,6 @@ /**

/**
* Gets information about the game that was being played when the clip was created.
* Retrieves information about the game that was being played when the clip was created.
*/
async getGame() {
return this[common_1.rawDataSymbol].game_id
? (0, common_1.checkRelationAssertion)(await this._client.games.getGameById(this[common_1.rawDataSymbol].game_id))
: null;
return (await this._client.games.getGameById(this[common_1.rawDataSymbol].game_id));
}

@@ -97,0 +95,0 @@ /**

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

* ```ts
* const api = new ApiClient({ authProvider });
* const clipId = await api.clips.createClip({ channel: '125328655' });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const clipId = await api.clips.createClip({ channelId: '125328655' });
* ```

@@ -25,5 +25,5 @@ *

/**
* Gets clips for the specified broadcaster in descending order of views.
* Retrieves clips for the specified broadcaster in descending order of views.
*
* @param broadcaster The broadcaster to fetch clips for.
* @param user The broadcaster to fetch clips for.
* @param filter

@@ -33,7 +33,7 @@ *

*/
getClipsForBroadcaster(broadcaster: UserIdResolvable, filter?: HelixPaginatedClipFilter): Promise<HelixPaginatedResult<HelixClip>>;
getClipsForBroadcaster(user: UserIdResolvable, filter?: HelixPaginatedClipFilter): Promise<HelixPaginatedResult<HelixClip>>;
/**
* Creates a paginator for clips for the specified broadcaster.
*
* @param broadcaster The broadcaster to fetch clips for.
* @param user The broadcaster to fetch clips for.
* @param filter

@@ -43,5 +43,5 @@ *

*/
getClipsForBroadcasterPaginated(broadcaster: UserIdResolvable, filter?: HelixClipFilter): HelixPaginatedRequest<HelixClipData, HelixClip>;
getClipsForBroadcasterPaginated(user: UserIdResolvable, filter?: HelixClipFilter): HelixPaginatedRequest<HelixClipData, HelixClip>;
/**
* Gets clips for the specified game in descending order of views.
* Retrieves clips for the specified game in descending order of views.
*

@@ -64,3 +64,3 @@ * @param gameId The game ID.

/**
* Gets the clips identified by the given IDs.
* Retrieves the clips identified by the given IDs.
*

@@ -71,3 +71,3 @@ * @param ids The clip IDs.

/**
* Gets the clip identified by the given ID.
* Retrieves the clip identified by the given ID.
*

@@ -74,0 +74,0 @@ * @param id The clip ID.

@@ -19,4 +19,4 @@ "use strict";

* ```ts
* const api = new ApiClient({ authProvider });
* const clipId = await api.clips.createClip({ channel: '125328655' });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const clipId = await api.clips.createClip({ channelId: '125328655' });
* ```

@@ -29,5 +29,5 @@ *

/**
* Gets clips for the specified broadcaster in descending order of views.
* Retrieves clips for the specified broadcaster in descending order of views.
*
* @param broadcaster The broadcaster to fetch clips for.
* @param user The broadcaster to fetch clips for.
* @param filter

@@ -37,8 +37,7 @@ *

*/
async getClipsForBroadcaster(broadcaster, filter = {}) {
async getClipsForBroadcaster(user, filter = {}) {
return await this._getClips({
...filter,
filterType: 'broadcaster_id',
ids: (0, common_1.extractUserId)(broadcaster),
userId: (0, common_1.extractUserId)(broadcaster)
ids: (0, common_1.extractUserId)(user)
});

@@ -49,3 +48,3 @@ }

*
* @param broadcaster The broadcaster to fetch clips for.
* @param user The broadcaster to fetch clips for.
* @param filter

@@ -55,12 +54,11 @@ *

*/
getClipsForBroadcasterPaginated(broadcaster, filter = {}) {
getClipsForBroadcasterPaginated(user, filter = {}) {
return this._getClipsPaginated({
...filter,
filterType: 'broadcaster_id',
ids: (0, common_1.extractUserId)(broadcaster),
userId: (0, common_1.extractUserId)(broadcaster)
ids: (0, common_1.extractUserId)(user)
});
}
/**
* Gets clips for the specified game in descending order of views.
* Retrieves clips for the specified game in descending order of views.
*

@@ -95,3 +93,3 @@ * @param gameId The game ID.

/**
* Gets the clips identified by the given IDs.
* Retrieves the clips identified by the given IDs.
*

@@ -108,3 +106,3 @@ * @param ids The clip IDs.

/**
* Gets the clip identified by the given ID.
* Retrieves the clip identified by the given ID.
*

@@ -126,3 +124,3 @@ * @param id The clip ID.

async createClip(params) {
const { channel, createAfterDelay = false } = params;
const { channelId, createAfterDelay = false } = params;
const result = await this._client.callApi({

@@ -132,6 +130,4 @@ type: 'helix',

method: 'POST',
userId: (0, common_1.extractUserId)(channel),
scopes: ['clips:edit'],
canOverrideScopedUserContext: true,
query: (0, clip_external_1.createClipCreateQuery)(channel, createAfterDelay)
scope: 'clips:edit',
query: (0, clip_external_1.createClipCreateQuery)(channelId, createAfterDelay)
});

@@ -147,3 +143,2 @@ return result.data[0].id;

url: 'clips',
userId: params.userId,
query: {

@@ -159,3 +154,2 @@ ...(0, clip_external_1.createClipQuery)(params),

url: 'clips',
userId: params.userId,
query: (0, clip_external_1.createClipQuery)(params)

@@ -162,0 +156,0 @@ }, this._client, data => new HelixClip_1.HelixClip(data, this._client));

import type { UserIdResolvable } from '@twurple/common';
import { type HelixEventSubSubscriptionStatus } from '../../../interfaces/helix/eventSub.external';
import { type HelixEventSubDropEntitlementGrantFilter, type HelixEventSubTransportOptions, type HelixPaginatedEventSubSubscriptionsResult } from '../../../interfaces/helix/eventSub.input';
import { type HelixEventSubTransportOptions, type HelixPaginatedEventSubSubscriptionsResult } from '../../../interfaces/helix/eventSub.input';
import { BaseApi } from '../../BaseApi';

@@ -22,3 +22,3 @@ import type { HelixPagination } from '../HelixPagination';

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* await api.eventSub.subscribeToUserFollowsTo('125328655', { callbackUrl: 'https://example.com' });

@@ -32,3 +32,3 @@ * ```

/**
* Gets the current EventSub subscriptions for the current client.
* Retrieves the current EventSub subscriptions for the current client.
*

@@ -49,7 +49,7 @@ * Requires an app access token to work; does not work with user tokens.

/**
* Gets the current EventSub subscriptions with the given status for the current client.
* Retrieves the current EventSub subscriptions with the given status for the current client.
*
* Requires an app access token to work; does not work with user tokens.
*
* @param status The status of the subscriptions to get.
* @param status The status of the subscriptions to retrieve.
* @param pagination

@@ -65,11 +65,11 @@ *

*
* @param status The status of the subscriptions to get.
* @param status The status of the subscriptions to retrieve.
*/
getSubscriptionsForStatusPaginated(status: HelixEventSubSubscriptionStatus): HelixPaginatedEventSubSubscriptionsRequest;
/**
* Gets the current EventSub subscriptions with the given type for the current client.
* Retrieves the current EventSub subscriptions with the given type for the current client.
*
* Requires an app access token to work; does not work with user tokens.
*
* @param type The type of the subscriptions to get.
* @param type The type of the subscriptions to retrieve.
* @param pagination

@@ -85,11 +85,11 @@ *

*
* @param type The type of the subscriptions to get.
* @param type The type of the subscriptions to retrieve.
*/
getSubscriptionsForTypePaginated(type: string): HelixPaginatedEventSubSubscriptionsRequest;
/**
* Gets the current EventSub subscriptions for the current user and client.
* Retrieves the current EventSub subscriptions for the current user and client.
*
* Requires an app access token to work; does not work with user tokens.
*
* @param user The user to get subscriptions for.
* @param user The user to retrieve subscriptions for.
* @param pagination

@@ -105,3 +105,3 @@ *

*
* @param user The user to get subscriptions for.
* @param user The user to retrieve subscriptions for.
*/

@@ -118,7 +118,5 @@ getSubscriptionsForUserPaginated(user: UserIdResolvable): HelixPaginatedEventSubSubscriptionsRequest;

* @param transport The transport of the subscription.
* @param user The user to create the subscription in context of.
* @param requiredScopeSet The scope set required by the subscription. Will only be checked for applicable transports.
* @param isBatched Whether to enable batching for the subscription. Is only supported for select topics.
* @param requiredScope The scope required by the subscription. Will only be checked for applicable transports.
*/
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, requiredScope?: string): Promise<HelixEventSubSubscription>;
/**

@@ -142,3 +140,3 @@ * Deletes a subscription.

* @param broadcaster The broadcaster you want to listen to online events for.
* @param transport The transport options.
* @param transport The transport options
*/

@@ -150,3 +148,3 @@ subscribeToStreamOnlineEvents(broadcaster: UserIdResolvable, transport: HelixEventSubTransportOptions): Promise<HelixEventSubSubscription>;

* @param broadcaster The broadcaster you want to listen to online events for.
* @param transport The transport options.
* @param transport The transport options
*/

@@ -158,3 +156,3 @@ subscribeToStreamOfflineEvents(broadcaster: UserIdResolvable, transport: HelixEventSubTransportOptions): Promise<HelixEventSubSubscription>;

* @param broadcaster The broadcaster you want to listen to update events for.
* @param transport The transport options.
* @param transport The transport options
*/

@@ -165,22 +163,11 @@ subscribeToChannelUpdateEvents(broadcaster: UserIdResolvable, transport: HelixEventSubTransportOptions): Promise<HelixEventSubSubscription>;

*
* @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.
* @param transport The transport options.
* @param broadcaster The broadcaster you want to listen to follow events for.
* @param transport The transport options
*/
subscribeToChannelFollowEvents(broadcaster: UserIdResolvable, transport: HelixEventSubTransportOptions): Promise<HelixEventSubSubscription>;
/**
* 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.
*
* @param broadcaster The broadcaster you want to listen to subscribe events for.
* @param transport The transport options.
* @param transport The transport options
*/

@@ -192,3 +179,3 @@ subscribeToChannelSubscriptionEvents(broadcaster: UserIdResolvable, transport: HelixEventSubTransportOptions): Promise<HelixEventSubSubscription>;

* @param broadcaster The broadcaster you want to listen to subscription gift events for.
* @param transport The transport options.
* @param transport The transport options
*/

@@ -200,3 +187,3 @@ subscribeToChannelSubscriptionGiftEvents(broadcaster: UserIdResolvable, transport: HelixEventSubTransportOptions): Promise<HelixEventSubSubscription>;

* @param broadcaster The broadcaster you want to listen to subscription message events for.
* @param transport The transport options.
* @param transport The transport options
*/

@@ -208,3 +195,3 @@ subscribeToChannelSubscriptionMessageEvents(broadcaster: UserIdResolvable, transport: HelixEventSubTransportOptions): Promise<HelixEventSubSubscription>;

* @param broadcaster The broadcaster you want to listen to subscription end events for.
* @param transport The transport options.
* @param transport The transport options
*/

@@ -223,3 +210,3 @@ subscribeToChannelSubscriptionEndEvents(broadcaster: UserIdResolvable, transport: HelixEventSubTransportOptions): Promise<HelixEventSubSubscription>;

* @param broadcaster The broadcaster you want to listen to charity donation events for.
* @param transport The transport options.
* @param transport The transport option.
*/

@@ -231,3 +218,3 @@ subscribeToChannelCharityCampaignStartEvents(broadcaster: UserIdResolvable, transport: HelixEventSubTransportOptions): Promise<HelixEventSubSubscription>;

* @param broadcaster The broadcaster you want to listen to charity donation events for.
* @param transport The transport options.
* @param transport The transport option.
*/

@@ -239,3 +226,3 @@ subscribeToChannelCharityCampaignStopEvents(broadcaster: UserIdResolvable, transport: HelixEventSubTransportOptions): Promise<HelixEventSubSubscription>;

* @param broadcaster The broadcaster you want to listen to charity donation events for.
* @param transport The transport options.
* @param transport The transport option.
*/

@@ -247,3 +234,3 @@ subscribeToChannelCharityDonationEvents(broadcaster: UserIdResolvable, transport: HelixEventSubTransportOptions): Promise<HelixEventSubSubscription>;

* @param broadcaster The broadcaster you want to listen to charity donation events for.
* @param transport The transport options.
* @param transport The transport option.
*/

@@ -255,3 +242,3 @@ subscribeToChannelCharityCampaignProgressEvents(broadcaster: UserIdResolvable, transport: HelixEventSubTransportOptions): Promise<HelixEventSubSubscription>;

* @param broadcaster The broadcaster you want to listen to ban events for.
* @param transport The transport options.
* @param transport The transport option.
*/

@@ -469,18 +456,2 @@ subscribeToChannelBanEvents(broadcaster: UserIdResolvable, transport: HelixEventSubTransportOptions): Promise<HelixEventSubSubscription>;

/**
* Subscribe to events that represent a broadcaster shouting out another broadcaster.
*
* @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>;
/**
* 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>;
/**
* Subscribe to events that represent an extension Bits transaction.

@@ -517,14 +488,4 @@ *

subscribeToUserUpdateEvents(user: UserIdResolvable, transport: HelixEventSubTransportOptions, withEmail?: boolean): Promise<HelixEventSubSubscription>;
/**
* Subscribe to events that represent a drop entitlement being granted.
*
* @beta
* @expandParams
*
* @param filter
* @param transport The transport options.
*/
subscribeToDropEntitlementGrantEvents(filter: HelixEventSubDropEntitlementGrantFilter, transport: HelixEventSubTransportOptions): Promise<HelixEventSubSubscription>;
private _deleteSubscriptionsWithCondition;
}
//# sourceMappingURL=HelixEventSubApi.d.ts.map

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

const tslib_1 = require("tslib");
const shared_utils_1 = require("@d-fischer/shared-utils");
const common_1 = require("@twurple/common");

@@ -29,3 +28,3 @@ const eventSub_external_1 = require("../../../interfaces/helix/eventSub.external");

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* await api.eventSub.subscribeToUserFollowsTo('125328655', { callbackUrl: 'https://example.com' });

@@ -39,3 +38,3 @@ * ```

/**
* Gets the current EventSub subscriptions for the current client.
* Retrieves the current EventSub subscriptions for the current client.
*

@@ -66,10 +65,10 @@ * Requires an app access token to work; does not work with user tokens.

getSubscriptionsPaginated() {
return new HelixPaginatedEventSubSubscriptionsRequest_1.HelixPaginatedEventSubSubscriptionsRequest({}, undefined, this._client);
return new HelixPaginatedEventSubSubscriptionsRequest_1.HelixPaginatedEventSubSubscriptionsRequest({}, this._client);
}
/**
* Gets the current EventSub subscriptions with the given status for the current client.
* Retrieves the current EventSub subscriptions with the given status for the current client.
*
* Requires an app access token to work; does not work with user tokens.
*
* @param status The status of the subscriptions to get.
* @param status The status of the subscriptions to retrieve.
* @param pagination

@@ -99,13 +98,13 @@ *

*
* @param status The status of the subscriptions to get.
* @param status The status of the subscriptions to retrieve.
*/
getSubscriptionsForStatusPaginated(status) {
return new HelixPaginatedEventSubSubscriptionsRequest_1.HelixPaginatedEventSubSubscriptionsRequest({ status }, undefined, this._client);
return new HelixPaginatedEventSubSubscriptionsRequest_1.HelixPaginatedEventSubSubscriptionsRequest({ status }, this._client);
}
/**
* Gets the current EventSub subscriptions with the given type for the current client.
* Retrieves the current EventSub subscriptions with the given type for the current client.
*
* Requires an app access token to work; does not work with user tokens.
*
* @param type The type of the subscriptions to get.
* @param type The type of the subscriptions to retrieve.
* @param pagination

@@ -135,13 +134,13 @@ *

*
* @param type The type of the subscriptions to get.
* @param type The type of the subscriptions to retrieve.
*/
getSubscriptionsForTypePaginated(type) {
return new HelixPaginatedEventSubSubscriptionsRequest_1.HelixPaginatedEventSubSubscriptionsRequest({ type }, undefined, this._client);
return new HelixPaginatedEventSubSubscriptionsRequest_1.HelixPaginatedEventSubSubscriptionsRequest({ type }, this._client);
}
/**
* Gets the current EventSub subscriptions for the current user and client.
* Retrieves the current EventSub subscriptions for the current user and client.
*
* Requires an app access token to work; does not work with user tokens.
*
* @param user The user to get subscriptions for.
* @param user The user to retrieve subscriptions for.
* @param pagination

@@ -155,3 +154,2 @@ *

url: 'eventsub/subscriptions',
userId: (0, common_1.extractUserId)(user),
query: {

@@ -173,7 +171,6 @@ ...(0, generic_external_1.createSingleKeyQuery)('user_id', (0, common_1.extractUserId)(user)),

*
* @param user The user to get subscriptions for.
* @param user The user to retrieve subscriptions for.
*/
getSubscriptionsForUserPaginated(user) {
const userId = (0, common_1.extractUserId)(user);
return new HelixPaginatedEventSubSubscriptionsRequest_1.HelixPaginatedEventSubSubscriptionsRequest((0, generic_external_1.createSingleKeyQuery)('user_id', userId), userId, this._client);
return new HelixPaginatedEventSubSubscriptionsRequest_1.HelixPaginatedEventSubSubscriptionsRequest((0, generic_external_1.createSingleKeyQuery)('user_id', (0, common_1.extractUserId)(user)), this._client);
}

@@ -189,21 +186,6 @@ /**

* @param transport The transport of the subscription.
* @param user The user to create the subscription in context of.
* @param requiredScopeSet The scope set required by the subscription. Will only be checked for applicable transports.
* @param isBatched Whether to enable batching for the subscription. Is only supported for select topics.
* @param requiredScope The scope required by the subscription. Will only be checked for applicable transports.
*/
async createSubscription(type, version, condition, transport, user, requiredScopeSet, isBatched) {
const usesAppAuth = transport.method === 'webhook';
const scopes = usesAppAuth ? undefined : requiredScopeSet;
if (!usesAppAuth && !user) {
throw new Error(`Transport ${transport.method} can only handle subscriptions with user context`);
}
const jsonBody = {
type,
version,
condition,
transport
};
if (isBatched) {
jsonBody.is_batching_enabled = true;
}
async createSubscription(type, version, condition, transport, requiredScope) {
const scope = transport.method === 'websocket' ? requiredScope : undefined;
const result = await this._client.callApi({

@@ -213,6 +195,9 @@ type: 'helix',

method: 'POST',
scopes,
userId: (0, shared_utils_1.mapOptional)(user, common_1.extractUserId),
forceType: usesAppAuth ? 'app' : 'user',
jsonBody
scope,
jsonBody: {
type,
version,
condition,
transport
}
});

@@ -252,6 +237,6 @@ return new HelixEventSubSubscription_1.HelixEventSubSubscription(result.data[0], this._client);

* @param broadcaster The broadcaster you want to listen to online events for.
* @param transport The transport options.
* @param transport The transport options
*/
async subscribeToStreamOnlineEvents(broadcaster, transport) {
return await this.createSubscription('stream.online', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster);
return await this.createSubscription('stream.online', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport);
}

@@ -262,6 +247,6 @@ /**

* @param broadcaster The broadcaster you want to listen to online events for.
* @param transport The transport options.
* @param transport The transport options
*/
async subscribeToStreamOfflineEvents(broadcaster, transport) {
return await this.createSubscription('stream.offline', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster);
return await this.createSubscription('stream.offline', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport);
}

@@ -272,6 +257,6 @@ /**

* @param broadcaster The broadcaster you want to listen to update events for.
* @param transport The transport options.
* @param transport The transport options
*/
async subscribeToChannelUpdateEvents(broadcaster, transport) {
return await this.createSubscription('channel.update', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster);
return await this.createSubscription('channel.update', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport);
}

@@ -281,29 +266,16 @@ /**

*
* @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.
* @param transport The transport options.
* @param broadcaster The broadcaster you want to listen to follow events for.
* @param transport The transport options
*/
async subscribeToChannelFollowEvents(broadcaster, transport) {
return await this.createSubscription('channel.follow', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster);
return await this.createSubscription('channel.follow', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport);
}
/**
* 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.
*
* @param broadcaster The broadcaster you want to listen to subscribe events for.
* @param transport The transport options.
* @param transport The transport options
*/
async subscribeToChannelSubscriptionEvents(broadcaster, transport) {
return await this.createSubscription('channel.subscribe', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster, ['channel:read:subscriptions']);
return await this.createSubscription('channel.subscribe', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, 'channel:read:subscriptions');
}

@@ -314,6 +286,6 @@ /**

* @param broadcaster The broadcaster you want to listen to subscription gift events for.
* @param transport The transport options.
* @param transport The transport options
*/
async subscribeToChannelSubscriptionGiftEvents(broadcaster, transport) {
return await this.createSubscription('channel.subscription.gift', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster, ['channel:read:subscriptions']);
return await this.createSubscription('channel.subscription.gift', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, 'channel:read:subscriptions');
}

@@ -324,6 +296,6 @@ /**

* @param broadcaster The broadcaster you want to listen to subscription message events for.
* @param transport The transport options.
* @param transport The transport options
*/
async subscribeToChannelSubscriptionMessageEvents(broadcaster, transport) {
return await this.createSubscription('channel.subscription.message', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster, ['channel:read:subscriptions']);
return await this.createSubscription('channel.subscription.message', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, 'channel:read:subscriptions');
}

@@ -334,6 +306,6 @@ /**

* @param broadcaster The broadcaster you want to listen to subscription end events for.
* @param transport The transport options.
* @param transport The transport options
*/
async subscribeToChannelSubscriptionEndEvents(broadcaster, transport) {
return await this.createSubscription('channel.subscription.end', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster, ['channel:read:subscriptions']);
return await this.createSubscription('channel.subscription.end', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, 'channel:read:subscriptions');
}

@@ -347,3 +319,3 @@ /**

async subscribeToChannelCheerEvents(broadcaster, transport) {
return await this.createSubscription('channel.cheer', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster, ['bits:read']);
return await this.createSubscription('channel.cheer', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, 'bits:read');
}

@@ -354,6 +326,6 @@ /**

* @param broadcaster The broadcaster you want to listen to charity donation events for.
* @param transport The transport options.
* @param transport The transport option.
*/
async subscribeToChannelCharityCampaignStartEvents(broadcaster, transport) {
return await this.createSubscription('channel.charity_campaign.start', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster, ['channel:read:charity']);
return await this.createSubscription('channel.charity_campaign.start', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, 'channel:read:charity');
}

@@ -364,6 +336,6 @@ /**

* @param broadcaster The broadcaster you want to listen to charity donation events for.
* @param transport The transport options.
* @param transport The transport option.
*/
async subscribeToChannelCharityCampaignStopEvents(broadcaster, transport) {
return await this.createSubscription('channel.charity_campaign.stop', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster, ['channel:read:charity']);
return await this.createSubscription('channel.charity_campaign.stop', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, 'channel:read:charity');
}

@@ -374,6 +346,6 @@ /**

* @param broadcaster The broadcaster you want to listen to charity donation events for.
* @param transport The transport options.
* @param transport The transport option.
*/
async subscribeToChannelCharityDonationEvents(broadcaster, transport) {
return await this.createSubscription('channel.charity_campaign.donate', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster, ['channel:read:charity']);
return await this.createSubscription('channel.charity_campaign.donate', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, 'channel:read:charity');
}

@@ -384,6 +356,6 @@ /**

* @param broadcaster The broadcaster you want to listen to charity donation events for.
* @param transport The transport options.
* @param transport The transport option.
*/
async subscribeToChannelCharityCampaignProgressEvents(broadcaster, transport) {
return await this.createSubscription('channel.charity_campaign.progress', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster, ['channel:read:charity']);
return await this.createSubscription('channel.charity_campaign.progress', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, 'channel:read:charity');
}

@@ -394,6 +366,6 @@ /**

* @param broadcaster The broadcaster you want to listen to ban events for.
* @param transport The transport options.
* @param transport The transport option.
*/
async subscribeToChannelBanEvents(broadcaster, transport) {
return await this.createSubscription('channel.ban', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster, ['channel:moderate']);
return await this.createSubscription('channel.ban', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, 'channel:moderate');
}

@@ -407,3 +379,3 @@ /**

async subscribeToChannelUnbanEvents(broadcaster, transport) {
return await this.createSubscription('channel.unban', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster, ['channel:moderate']);
return await this.createSubscription('channel.unban', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, 'channel:moderate');
}

@@ -418,3 +390,3 @@ /**

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']);
return await this.createSubscription('channel.shield_mode.begin', '1', (0, eventSub_external_1.createEventSubModeratorCondition)(broadcaster, moderator), transport, 'moderator:read:shield_mode');
}

@@ -429,3 +401,3 @@ /**

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']);
return await this.createSubscription('channel.shield_mode.end', '1', (0, eventSub_external_1.createEventSubModeratorCondition)(broadcaster, moderator), transport, 'moderator:read:shield_mode');
}

@@ -439,3 +411,3 @@ /**

async subscribeToChannelModeratorAddEvents(broadcaster, transport) {
return await this.createSubscription('channel.moderator.add', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster, ['moderation:read']);
return await this.createSubscription('channel.moderator.add', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, 'moderation:read');
}

@@ -449,3 +421,3 @@ /**

async subscribeToChannelModeratorRemoveEvents(broadcaster, transport) {
return await this.createSubscription('channel.moderator.remove', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster, ['moderation:read']);
return await this.createSubscription('channel.moderator.remove', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, 'moderation:read');
}

@@ -459,3 +431,3 @@ /**

async subscribeToChannelRaidEventsFrom(broadcaster, transport) {
return await this.createSubscription('channel.raid', '1', (0, generic_external_1.createSingleKeyQuery)('from_broadcaster_user_id', (0, common_1.extractUserId)(broadcaster)), transport, broadcaster);
return await this.createSubscription('channel.raid', '1', (0, generic_external_1.createSingleKeyQuery)('from_broadcaster_user_id', (0, common_1.extractUserId)(broadcaster)), transport);
}

@@ -469,3 +441,3 @@ /**

async subscribeToChannelRaidEventsTo(broadcaster, transport) {
return await this.createSubscription('channel.raid', '1', (0, generic_external_1.createSingleKeyQuery)('to_broadcaster_user_id', (0, common_1.extractUserId)(broadcaster)), transport, broadcaster);
return await this.createSubscription('channel.raid', '1', (0, generic_external_1.createSingleKeyQuery)('to_broadcaster_user_id', (0, common_1.extractUserId)(broadcaster)), transport);
}

@@ -479,3 +451,3 @@ /**

async subscribeToChannelRewardAddEvents(broadcaster, transport) {
return await this.createSubscription('channel.channel_points_custom_reward.add', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster, ['channel:read:redemptions', 'channel:manage:redemptions']);
return await this.createSubscription('channel.channel_points_custom_reward.add', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, 'channel:read:redemptions');
}

@@ -489,3 +461,3 @@ /**

async subscribeToChannelRewardUpdateEvents(broadcaster, transport) {
return await this.createSubscription('channel.channel_points_custom_reward.update', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster, ['channel:read:redemptions', 'channel:manage:redemptions']);
return await this.createSubscription('channel.channel_points_custom_reward.update', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, 'channel:read:redemptions');
}

@@ -500,3 +472,3 @@ /**

async subscribeToChannelRewardUpdateEventsForReward(broadcaster, rewardId, transport) {
return await this.createSubscription('channel.channel_points_custom_reward.update', '1', (0, eventSub_external_1.createEventSubRewardCondition)(broadcaster, rewardId), transport, broadcaster, ['channel:read:redemptions', 'channel:manage:redemptions']);
return await this.createSubscription('channel.channel_points_custom_reward.update', '1', (0, eventSub_external_1.createEventSubRewardCondition)(broadcaster, rewardId), transport, 'channel:read:redemptions');
}

@@ -510,3 +482,3 @@ /**

async subscribeToChannelRewardRemoveEvents(broadcaster, transport) {
return await this.createSubscription('channel.channel_points_custom_reward.remove', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster, ['channel:read:redemptions', 'channel:manage:redemptions']);
return await this.createSubscription('channel.channel_points_custom_reward.remove', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, 'channel:read:redemptions');
}

@@ -521,3 +493,3 @@ /**

async subscribeToChannelRewardRemoveEventsForReward(broadcaster, rewardId, transport) {
return await this.createSubscription('channel.channel_points_custom_reward.remove', '1', (0, eventSub_external_1.createEventSubRewardCondition)(broadcaster, rewardId), transport, broadcaster, ['channel:read:redemptions', 'channel:manage:redemptions']);
return await this.createSubscription('channel.channel_points_custom_reward.remove', '1', (0, eventSub_external_1.createEventSubRewardCondition)(broadcaster, rewardId), transport, 'channel:read:redemptions');
}

@@ -531,3 +503,3 @@ /**

async subscribeToChannelRedemptionAddEvents(broadcaster, transport) {
return await this.createSubscription('channel.channel_points_custom_reward_redemption.add', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster, ['channel:read:redemptions', 'channel:manage:redemptions']);
return await this.createSubscription('channel.channel_points_custom_reward_redemption.add', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, 'channel:read:redemptions');
}

@@ -542,3 +514,3 @@ /**

async subscribeToChannelRedemptionAddEventsForReward(broadcaster, rewardId, transport) {
return await this.createSubscription('channel.channel_points_custom_reward_redemption.add', '1', (0, eventSub_external_1.createEventSubRewardCondition)(broadcaster, rewardId), transport, broadcaster, ['channel:read:redemptions', 'channel:manage:redemptions']);
return await this.createSubscription('channel.channel_points_custom_reward_redemption.add', '1', (0, eventSub_external_1.createEventSubRewardCondition)(broadcaster, rewardId), transport, 'channel:read:redemptions');
}

@@ -552,3 +524,3 @@ /**

async subscribeToChannelRedemptionUpdateEvents(broadcaster, transport) {
return await this.createSubscription('channel.channel_points_custom_reward_redemption.update', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster, ['channel:read:redemptions', 'channel:manage:redemptions']);
return await this.createSubscription('channel.channel_points_custom_reward_redemption.update', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, 'channel:read:redemptions');
}

@@ -563,3 +535,3 @@ /**

async subscribeToChannelRedemptionUpdateEventsForReward(broadcaster, rewardId, transport) {
return await this.createSubscription('channel.channel_points_custom_reward_redemption.update', '1', (0, eventSub_external_1.createEventSubRewardCondition)(broadcaster, rewardId), transport, broadcaster, ['channel:read:redemptions', 'channel:manage:redemptions']);
return await this.createSubscription('channel.channel_points_custom_reward_redemption.update', '1', (0, eventSub_external_1.createEventSubRewardCondition)(broadcaster, rewardId), transport, 'channel:read:redemptions');
}

@@ -573,3 +545,3 @@ /**

async subscribeToChannelPollBeginEvents(broadcaster, transport) {
return await this.createSubscription('channel.poll.begin', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster, ['channel:read:polls', 'channel:manage:polls']);
return await this.createSubscription('channel.poll.begin', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, 'channel:read:polls');
}

@@ -583,3 +555,3 @@ /**

async subscribeToChannelPollProgressEvents(broadcaster, transport) {
return await this.createSubscription('channel.poll.progress', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster, ['channel:read:polls', 'channel:manage:polls']);
return await this.createSubscription('channel.poll.progress', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, 'channel:read:polls');
}

@@ -593,3 +565,3 @@ /**

async subscribeToChannelPollEndEvents(broadcaster, transport) {
return await this.createSubscription('channel.poll.end', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster, ['channel:read:polls', 'channel:manage:polls']);
return await this.createSubscription('channel.poll.end', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, 'channel:read:polls');
}

@@ -603,3 +575,3 @@ /**

async subscribeToChannelPredictionBeginEvents(broadcaster, transport) {
return await this.createSubscription('channel.prediction.begin', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster, ['channel:read:predictions', 'channel:manage:predictions']);
return await this.createSubscription('channel.prediction.begin', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, 'channel:read:predictions');
}

@@ -613,3 +585,3 @@ /**

async subscribeToChannelPredictionProgressEvents(broadcaster, transport) {
return await this.createSubscription('channel.prediction.progress', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster, ['channel:read:predictions', 'channel:manage:predictions']);
return await this.createSubscription('channel.prediction.progress', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, 'channel:read:predictions');
}

@@ -623,3 +595,3 @@ /**

async subscribeToChannelPredictionLockEvents(broadcaster, transport) {
return await this.createSubscription('channel.prediction.lock', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster, ['channel:read:predictions', 'channel:manage:predictions']);
return await this.createSubscription('channel.prediction.lock', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, 'channel:read:predictions');
}

@@ -633,3 +605,3 @@ /**

async subscribeToChannelPredictionEndEvents(broadcaster, transport) {
return await this.createSubscription('channel.prediction.end', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster, ['channel:read:predictions', 'channel:manage:predictions']);
return await this.createSubscription('channel.prediction.end', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, 'channel:read:predictions');
}

@@ -643,3 +615,3 @@ /**

async subscribeToChannelGoalBeginEvents(broadcaster, transport) {
return await this.createSubscription('channel.goal.begin', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster, ['channel:read:goals']);
return await this.createSubscription('channel.goal.begin', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, 'channel:read:goals');
}

@@ -653,3 +625,3 @@ /**

async subscribeToChannelGoalProgressEvents(broadcaster, transport) {
return await this.createSubscription('channel.goal.progress', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster, ['channel:read:goals']);
return await this.createSubscription('channel.goal.progress', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, 'channel:read:goals');
}

@@ -663,3 +635,3 @@ /**

async subscribeToChannelGoalEndEvents(broadcaster, transport) {
return await this.createSubscription('channel.goal.end', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster, ['channel:read:goals']);
return await this.createSubscription('channel.goal.end', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, 'channel:read:goals');
}

@@ -673,3 +645,3 @@ /**

async subscribeToChannelHypeTrainBeginEvents(broadcaster, transport) {
return await this.createSubscription('channel.hype_train.begin', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster, ['channel:read:hype_train']);
return await this.createSubscription('channel.hype_train.begin', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, 'channel:read:hype_train');
}

@@ -683,3 +655,3 @@ /**

async subscribeToChannelHypeTrainProgressEvents(broadcaster, transport) {
return await this.createSubscription('channel.hype_train.progress', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster, ['channel:read:hype_train']);
return await this.createSubscription('channel.hype_train.progress', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, 'channel:read:hype_train');
}

@@ -693,25 +665,5 @@ /**

async subscribeToChannelHypeTrainEndEvents(broadcaster, transport) {
return await this.createSubscription('channel.hype_train.end', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, broadcaster, ['channel:read:hype_train']);
return await this.createSubscription('channel.hype_train.end', '1', (0, eventSub_external_1.createEventSubBroadcasterCondition)(broadcaster), transport, 'channel:read:hype_train');
}
/**
* Subscribe to events that represent a broadcaster shouting out another broadcaster.
*
* @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']);
}
/**
* 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.
*/
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']);
}
/**
* Subscribe to events that represent an extension Bits transaction.

@@ -754,16 +706,4 @@ *

async subscribeToUserUpdateEvents(user, transport, withEmail) {
return await this.createSubscription('user.update', '1', (0, generic_external_1.createSingleKeyQuery)('user_id', (0, common_1.extractUserId)(user)), transport, user, withEmail ? ['user:read:email'] : undefined);
return await this.createSubscription('user.update', '1', (0, generic_external_1.createSingleKeyQuery)('user_id', (0, common_1.extractUserId)(user)), transport, withEmail ? 'user:read:email' : undefined);
}
/**
* Subscribe to events that represent a drop entitlement being granted.
*
* @beta
* @expandParams
*
* @param filter
* @param transport The transport options.
*/
async subscribeToDropEntitlementGrantEvents(filter, transport) {
return await this.createSubscription('drop.entitlement.grant', '1', (0, eventSub_external_1.createEventSubDropEntitlementGrantCondition)(filter), transport, undefined, undefined, true);
}
async _deleteSubscriptionsWithCondition(cond) {

@@ -770,0 +710,0 @@ const subsPaginator = this.getSubscriptionsPaginated();

import { DataObject } from '@twurple/common';
import type { BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixEventSubSubscriptionData, type HelixEventSubSubscriptionStatus, type HelixEventSubTransportData } from '../../../interfaces/helix/eventSub.external';

@@ -10,3 +10,3 @@ /**

/** @private */
constructor(data: HelixEventSubSubscriptionData, client: BaseApiClient);
constructor(data: HelixEventSubSubscriptionData, client: ApiClient);
/**

@@ -13,0 +13,0 @@ * The ID of the subscription.

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

import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixEventSubSubscriptionData, type HelixPaginatedEventSubSubscriptionsResponse } from '../../../interfaces/helix/eventSub.external';

@@ -15,9 +15,9 @@ import { HelixPaginatedRequestWithTotal } from '../HelixPaginatedRequestWithTotal';

/** @private */
constructor(query: Record<string, string>, userId: string | undefined, client: BaseApiClient);
constructor(query: Record<string, string>, client: ApiClient);
/**
* Gets the total cost of EventSub subscriptions.
* Retrieves and returns the total cost of EventSub subscriptions.
*/
getTotalCost(): Promise<number>;
/**
* Gets the cost limit of EventSub subscriptions.
* Retrieves and returns the cost limit of EventSub subscriptions.
*/

@@ -24,0 +24,0 @@ getMaxTotalCost(): Promise<number>;

@@ -16,6 +16,5 @@ "use strict";

/** @private */
constructor(query, userId, client) {
constructor(query, client) {
super({
url: 'eventsub/subscriptions',
userId,
query

@@ -25,3 +24,3 @@ }, client, data => new HelixEventSubSubscription_1.HelixEventSubSubscription(data, client));

/**
* Gets the total cost of EventSub subscriptions.
* Retrieves and returns the total cost of EventSub subscriptions.
*/

@@ -34,3 +33,3 @@ async getTotalCost() {

/**
* Gets the cost limit of EventSub subscriptions.
* Retrieves and returns the cost limit of EventSub subscriptions.
*/

@@ -37,0 +36,0 @@ async getMaxTotalCost() {

@@ -19,3 +19,3 @@ import { HelixExtension } from '@twurple/common';

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const transactions = await api.extionsions.getExtensionTransactions('abcd');

@@ -29,10 +29,10 @@ * ```

/**
* Gets a released extension by ID.
* Retrieves a released extension by ID.
*
* @param extensionId The ID of the extension.
* @param version The version of the extension. If not given, gets the latest version.
* @param version The version of the extension. If not given, retrieves the latest version.
*/
getReleasedExtension(extensionId: string, version?: string): Promise<HelixExtension>;
/**
* Gets a list of channels that are currently live and have the given extension installed.
* Retrieves a list of channels that are currently live and have the given extension installed.
*

@@ -52,3 +52,3 @@ * @param extensionId The ID of the extension.

/**
* Gets an extension's Bits products.
* Retrieves an extension's Bits products.
*

@@ -64,3 +64,3 @@ * This only works if the provided token belongs to an extension's client ID,

*
* This only works if the provided token belongs to an extension's client ID,
* * This only works if the provided token belongs to an extension's client ID,
* and will create/update a product for that extension.

@@ -74,5 +74,5 @@ *

/**
* Gets a list of transactions for the given extension.
* Retrieves a list of transactions for the given extension.
*
* @param extensionId The ID of the extension to get transactions for.
* @param extensionId The ID of the extension to retrieve transactions for.
* @param filter Additional filters.

@@ -84,3 +84,3 @@ */

*
* @param extensionId The ID of the extension to get transactions for.
* @param extensionId The ID of the extension to retrieve transactions for.
* @param filter Additional filters.

@@ -87,0 +87,0 @@ */

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

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const transactions = await api.extionsions.getExtensionTransactions('abcd');

@@ -32,6 +32,6 @@ * ```

/**
* Gets a released extension by ID.
* Retrieves a released extension by ID.
*
* @param extensionId The ID of the extension.
* @param version The version of the extension. If not given, gets the latest version.
* @param version The version of the extension. If not given, retrieves the latest version.
*/

@@ -47,3 +47,3 @@ async getReleasedExtension(extensionId, version) {

/**
* Gets a list of channels that are currently live and have the given extension installed.
* Retrieves a list of channels that are currently live and have the given extension installed.
*

@@ -78,3 +78,3 @@ * @param extensionId The ID of the extension.

/**
* Gets an extension's Bits products.
* Retrieves an extension's Bits products.
*

@@ -97,3 +97,3 @@ * This only works if the provided token belongs to an extension's client ID,

*
* This only works if the provided token belongs to an extension's client ID,
* * This only works if the provided token belongs to an extension's client ID,
* and will create/update a product for that extension.

@@ -115,5 +115,5 @@ *

/**
* Gets a list of transactions for the given extension.
* Retrieves a list of transactions for the given extension.
*
* @param extensionId The ID of the extension to get transactions for.
* @param extensionId The ID of the extension to retrieve transactions for.
* @param filter Additional filters.

@@ -135,3 +135,3 @@ */

*
* @param extensionId The ID of the extension to get transactions for.
* @param extensionId The ID of the extension to retrieve transactions for.
* @param filter Additional filters.

@@ -138,0 +138,0 @@ */

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixExtensionProductType, type HelixExtensionTransactionData } from '../../../interfaces/helix/extensions.external';

@@ -11,3 +11,3 @@ import type { HelixUser } from '../user/HelixUser';

/** @private */
constructor(data: HelixExtensionTransactionData, client: BaseApiClient);
constructor(data: HelixExtensionTransactionData, client: ApiClient);
/**

@@ -34,3 +34,3 @@ * The ID of the transaction.

/**
* Gets information about the broadcaster that runs the extension on their channel.
* Retrieves information about the broadcaster that runs the extension on their channel.
*/

@@ -51,3 +51,3 @@ getBroadcaster(): Promise<HelixUser>;

/**
* Gets information about the user that made the transaction.
* Retrieves information about the user that made the transaction.
*/

@@ -54,0 +54,0 @@ getUser(): Promise<HelixUser>;

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

/**
* Gets information about the broadcaster that runs the extension on their channel.
* Retrieves information about the broadcaster that runs the extension on their channel.
*/
async getBroadcaster() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].broadcaster_id));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].broadcaster_id));
}

@@ -72,6 +72,6 @@ /**

/**
* Gets information about the user that made the transaction.
* Retrieves information about the user that made the transaction.
*/
async getUser() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].user_id));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].user_id));
}

@@ -78,0 +78,0 @@ /**

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixGameData } from '../../../interfaces/helix/game.external';

@@ -15,3 +15,3 @@ import { type HelixStreamData } from '../../../interfaces/helix/stream.external';

/** @private */
constructor(data: HelixGameData, client: BaseApiClient);
constructor(data: HelixGameData, client: ApiClient);
/**

@@ -41,3 +41,3 @@ * The ID of the game.

/**
* Gets streams that are currently playing the game.
* Retrieves streams that are currently playing the game.
*

@@ -44,0 +44,0 @@ * @param pagination

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

/**
* Gets streams that are currently playing the game.
* Retrieves streams that are currently playing the game.
*

@@ -55,0 +55,0 @@ * @param pagination

@@ -14,3 +14,3 @@ import { type HelixGameData } from '../../../interfaces/helix/game.external';

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const game = await api.games.getGameByName('Hearthstone');

@@ -24,3 +24,3 @@ * ```

/**
* Gets the game data for the given list of game IDs.
* Retrieves the game data for the given list of game IDs.
*

@@ -31,3 +31,3 @@ * @param ids The game IDs you want to look up.

/**
* Gets the game data for the given list of game names.
* Retrieves the game data for the given list of game names.
*

@@ -38,3 +38,3 @@ * @param names The game names you want to look up.

/**
* Gets the game data for the given list of IGDB IDs.
* Retrieves the game data for the given list of IGDB IDs.
*

@@ -45,3 +45,3 @@ * @param igdbIds The IGDB IDs you want to look up.

/**
* Gets the game data for the given game ID.
* Retrieves the game data for the given game ID.
*

@@ -52,3 +52,3 @@ * @param id The game ID you want to look up.

/**
* Gets the game data for the given game name.
* Retrieves the game data for the given game name.
*

@@ -59,3 +59,3 @@ * @param name The game name you want to look up.

/**
* Gets the game data for the given IGDB ID.
* Retrieves the game data for the given IGDB ID.
*

@@ -66,3 +66,3 @@ * @param igdbId The IGDB ID you want to look up.

/**
* Gets a list of the most viewed games at the moment.
* Retrieves a list of the most viewed games at the moment.
*

@@ -69,0 +69,0 @@ * @param pagination

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

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const game = await api.games.getGameByName('Hearthstone');

@@ -28,3 +28,3 @@ * ```

/**
* Gets the game data for the given list of game IDs.
* Retrieves the game data for the given list of game IDs.
*

@@ -37,3 +37,3 @@ * @param ids The game IDs you want to look up.

/**
* Gets the game data for the given list of game names.
* Retrieves the game data for the given list of game names.
*

@@ -46,3 +46,3 @@ * @param names The game names you want to look up.

/**
* Gets the game data for the given list of IGDB IDs.
* Retrieves the game data for the given list of IGDB IDs.
*

@@ -55,3 +55,3 @@ * @param igdbIds The IGDB IDs you want to look up.

/**
* Gets the game data for the given game ID.
* Retrieves the game data for the given game ID.
*

@@ -66,3 +66,3 @@ * @param id The game ID you want to look up.

/**
* Gets the game data for the given game name.
* Retrieves the game data for the given game name.
*

@@ -77,3 +77,3 @@ * @param name The game name you want to look up.

/**
* Gets the game data for the given IGDB ID.
* Retrieves the game data for the given IGDB ID.
*

@@ -88,3 +88,3 @@ * @param igdbId The IGDB ID you want to look up.

/**
* Gets a list of the most viewed games at the moment.
* Retrieves a list of the most viewed games at the moment.
*

@@ -91,0 +91,0 @@ * @param pagination

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixGoalData, type HelixGoalType } from '../../../interfaces/helix/goal.external';

@@ -11,3 +11,3 @@ import type { HelixUser } from '../user/HelixUser';

/** @private */
constructor(data: HelixGoalData, client: BaseApiClient);
constructor(data: HelixGoalData, client: ApiClient);
/**

@@ -30,3 +30,3 @@ * The ID of the goal.

/**
* Gets more information about the broadcaster.
* Retrieves more information about the broadcaster.
*/

@@ -33,0 +33,0 @@ getBroadcaster(): Promise<HelixUser>;

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

/**
* Gets more information about the broadcaster.
* Retrieves more information about the broadcaster.
*/
async getBroadcaster() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].broadcaster_id));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].broadcaster_id));
}

@@ -47,0 +47,0 @@ /**

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

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const { data: goals } = await api.helix.goals.getGoals('61369223');

@@ -14,0 +14,0 @@ *

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

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const { data: goals } = await api.helix.goals.getGoals('61369223');

@@ -28,4 +28,2 @@ *

url: 'goals',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:read:goals'],
query: (0, api_call_1.createBroadcasterQuery)(broadcaster)

@@ -32,0 +30,0 @@ });

import type { HelixPaginatedResponse, TwitchApiCallOptions } from '@twurple/api-call';
import { type BaseApiClient } from '../../client/BaseApiClient';
import { type ContextApiCallOptions } from '../../client/ContextApiCallOptions';
import type { ApiClient } from '../../ApiClient';
/**

@@ -28,15 +27,15 @@ * Represents a request to the new Twitch API (Helix) that utilizes a cursor to paginate through its results.

/** @private */
constructor(_callOptions: Omit<ContextApiCallOptions, 'type'>, client: BaseApiClient, _mapper: (data: D) => T | T[], _limitPerPage?: number);
constructor(_callOptions: Omit<TwitchApiCallOptions, 'type'>, client: ApiClient, _mapper: (data: D) => T | T[], _limitPerPage?: number);
/**
* The last fetched page of data associated to the requested resource.
* The last retrieved page of data associated to the requested resource.
*
* Only works with {@link HelixPaginatedRequest#getNext}} and not with any other methods of data fetching.
* Only works with {@link HelixPaginatedRequest#getNext}} and not with any other methods of data retrieval.
*/
get current(): D[] | undefined;
/**
* Gets the next available page of data associated to the requested resource, or an empty array if there are no more available pages.
* Retrieves and returns the next available page of data associated to the requested resource, or an empty array if there are no more available pages.
*/
getNext(): Promise<T[]>;
/**
* Gets all data associated to the requested resource.
* Retrieves and returns all data associated to the requested resource.
*

@@ -49,3 +48,3 @@ * Be aware that this makes multiple calls to the Twitch API. Due to this, you might be more suspectible to rate limits.

/**
* Gets the current cursor.
* Retrieves the current cursor.
*

@@ -52,0 +51,0 @@ * Only useful if you want to make manual requests to the API.

@@ -35,5 +35,5 @@ "use strict";

/**
* The last fetched page of data associated to the requested resource.
* The last retrieved page of data associated to the requested resource.
*
* Only works with {@link HelixPaginatedRequest#getNext}} and not with any other methods of data fetching.
* Only works with {@link HelixPaginatedRequest#getNext}} and not with any other methods of data retrieval.
*/

@@ -45,3 +45,3 @@ get current() {

/**
* Gets the next available page of data associated to the requested resource, or an empty array if there are no more available pages.
* Retrieves and returns the next available page of data associated to the requested resource, or an empty array if there are no more available pages.
*/

@@ -63,3 +63,3 @@ async getNext() {

/**
* Gets all data associated to the requested resource.
* Retrieves and returns all data associated to the requested resource.
*

@@ -84,3 +84,3 @@ * Be aware that this makes multiple calls to the Twitch API. Due to this, you might be more suspectible to rate limits.

/**
* Gets the current cursor.
* Retrieves the current cursor.
*

@@ -87,0 +87,0 @@ * Only useful if you want to make manual requests to the API.

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

/**
* Gets the total number of entities existing in the queried result set.
* Retrieves and returns the total number of entities existing in the queried result set.
*/

@@ -15,0 +15,0 @@ getTotalCount(): Promise<number>;

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

/**
* Gets the total number of entities existing in the queried result set.
* Retrieves and returns the total number of entities existing in the queried result set.
*/

@@ -17,0 +17,0 @@ async getTotalCount() {

import type { ConstructedType } from '@d-fischer/shared-utils';
import type { HelixPaginatedResponse, HelixPaginatedResponseWithTotal } from '@twurple/api-call';
import { type BaseApiClient } from '../../client/BaseApiClient';
import type { ApiClient } from '../../ApiClient';
/**

@@ -11,3 +11,3 @@ * A result coming from a Helix resource that is paginated using a cursor.

*/
readonly data: T[];
data: T[];
/**

@@ -25,3 +25,3 @@ * A cursor for traversing more results.

*/
readonly data: T[];
data: T[];
/**

@@ -36,6 +36,6 @@ * A cursor for traversing more results.

}
/** @private */ export declare function createPaginatedResult<I, O extends new (data: I, client: BaseApiClient) => ConstructedType<O>>(response: HelixPaginatedResponse<I>, type: O, client: BaseApiClient): HelixPaginatedResult<ConstructedType<O>>;
/** @private */ export declare function createPaginatedResult<I, O extends new (data: I, client: ApiClient) => ConstructedType<O>>(response: HelixPaginatedResponse<I>, type: O, client: ApiClient): HelixPaginatedResult<ConstructedType<O>>;
/** @private */ export declare function createPaginatedResult<I, O extends new (data: I) => ConstructedType<O>>(response: HelixPaginatedResponse<I>, type: O): HelixPaginatedResult<ConstructedType<O>>;
/** @private */ export declare function createPaginatedResultWithTotal<I, O extends new (data: I, client: BaseApiClient) => ConstructedType<O>>(response: HelixPaginatedResponseWithTotal<I>, type: O, client: BaseApiClient): HelixPaginatedResultWithTotal<ConstructedType<O>>;
/** @private */ export declare function createPaginatedResultWithTotal<I, O extends new (data: I, client: ApiClient) => ConstructedType<O>>(response: HelixPaginatedResponseWithTotal<I>, type: O, client: ApiClient): HelixPaginatedResultWithTotal<ConstructedType<O>>;
/** @private */ export declare function createPaginatedResultWithTotal<I, O extends new (data: I) => ConstructedType<O>>(response: HelixPaginatedResponseWithTotal<I>, type: O): HelixPaginatedResultWithTotal<ConstructedType<O>>;
//# sourceMappingURL=HelixPaginatedResult.d.ts.map

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

/** @private */ function createPaginatedResult(response, type, client) {
var _a;
let dataCache = undefined;
var _a, _b, _c;
return {
get data() {
var _a, _b;
return (dataCache !== null && dataCache !== void 0 ? dataCache : (dataCache = (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.map(data => new type(data, client))) !== null && _b !== void 0 ? _b : []));
},
cursor: (_a = response.pagination) === null || _a === void 0 ? void 0 : _a.cursor
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
data: (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.map(data => new type(data, client))) !== null && _b !== void 0 ? _b : [],
cursor: (_c = response.pagination) === null || _c === void 0 ? void 0 : _c.cursor
};

@@ -18,8 +15,4 @@ }

/** @private */ function createPaginatedResultWithTotal(response, type, client) {
let dataCache = undefined;
return {
get data() {
var _a, _b;
return (dataCache !== null && dataCache !== void 0 ? dataCache : (dataCache = (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.map(data => new type(data, client))) !== null && _b !== void 0 ? _b : []));
},
data: response.data.map(data => new type(data, client)),
cursor: response.pagination.cursor,

@@ -26,0 +19,0 @@ total: response.total

import type { RateLimiterResponseParameters } from '@d-fischer/rate-limiter';
import { ResponseBasedRateLimiter } from '@d-fischer/rate-limiter';
import type { TwitchApiCallOptionsInternal } from '../../client/ApiClient';
import type { TwitchApiCallOptionsInternal } from '../../ApiClient';
/** @private */

@@ -5,0 +5,0 @@ export declare class HelixRateLimiter extends ResponseBasedRateLimiter<TwitchApiCallOptionsInternal, Response> {

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

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const { data: events } = await api.hypeTrain.getHypeTrainEventsForBroadcaster('125328655');

@@ -26,3 +26,3 @@ * ```

/**
* Gets the events of the current or latest Hype Train for the specified broadcaster.
* Retrieves the events of the current or latest Hype Train for the specified broadcaster.
*

@@ -29,0 +29,0 @@ * @param broadcaster The broadcaster to fetch Hype Train events for.

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

const api_call_1 = require("@twurple/api-call");
const common_1 = require("@twurple/common");
const BaseApi_1 = require("../../BaseApi");

@@ -19,3 +18,3 @@ const HelixPaginatedRequest_1 = require("../HelixPaginatedRequest");

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const { data: events } = await api.hypeTrain.getHypeTrainEventsForBroadcaster('125328655');

@@ -29,3 +28,3 @@ * ```

/**
* Gets the events of the current or latest Hype Train for the specified broadcaster.
* Retrieves the events of the current or latest Hype Train for the specified broadcaster.
*

@@ -41,4 +40,3 @@ * @param broadcaster The broadcaster to fetch Hype Train events for.

url: 'hypetrain/events',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:read:hype_train'],
scope: 'channel:read:hype_train',
query: {

@@ -59,4 +57,3 @@ ...(0, api_call_1.createBroadcasterQuery)(broadcaster),

url: 'hypetrain/events',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:read:hype_train'],
scope: 'channel:read:hype_train',
query: (0, api_call_1.createBroadcasterQuery)(broadcaster)

@@ -63,0 +60,0 @@ }, this._client, (data) => new HelixHypeTrainEvent_1.HelixHypeTrainEvent(data, this._client));

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixHypeTrainContributionData, type HelixHypeTrainContributionType } from '../../../interfaces/helix/hypeTrain.external';

@@ -11,3 +11,3 @@ import type { HelixUser } from '../user/HelixUser';

/** @private */
constructor(data: HelixHypeTrainContributionData, client: BaseApiClient);
constructor(data: HelixHypeTrainContributionData, client: ApiClient);
/**

@@ -18,3 +18,3 @@ * The ID of the user contributing to the Hype Train.

/**
* Gets additional information about the user contributing to the Hype Train.
* Retrieves additional information about the user contributing to the Hype Train.
*/

@@ -21,0 +21,0 @@ getUser(): Promise<HelixUser>;

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

/**
* Gets additional information about the user contributing to the Hype Train.
* Retrieves additional information about the user contributing to the Hype Train.
*/
async getUser() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].user));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].user));
}

@@ -29,0 +29,0 @@ /**

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixEventData } from '../../../interfaces/helix/generic.external';

@@ -13,3 +13,3 @@ import { type HelixHypeTrainEventData, type HelixHypeTrainEventType } from '../../../interfaces/helix/hypeTrain.external';

/** @private */
constructor(data: HelixEventData<HelixHypeTrainEventData, HelixHypeTrainEventType>, client: BaseApiClient);
constructor(data: HelixEventData<HelixHypeTrainEventData, HelixHypeTrainEventType>, client: ApiClient);
/**

@@ -40,3 +40,3 @@ * The unique ID of the Hype Train event.

/**
* Gets more information about the broadcaster where the Hype Train event was triggered.
* Retrieves more information about the broadcaster where the Hype Train event was triggered.
*/

@@ -43,0 +43,0 @@ getBroadcaster(): Promise<HelixUser>;

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

/**
* Gets more information about the broadcaster where the Hype Train event was triggered.
* Retrieves more information about the broadcaster where the Hype Train event was triggered.
*/
async getBroadcaster() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].event_data.broadcaster_id));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].event_data.broadcaster_id));
}

@@ -60,0 +60,0 @@ /**

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

/**
* The ID of the broadcaster for which the AutoMod settings were fetched.
* The ID of the broadcaster for which the AutoMod settings are retrieved.
*/

@@ -11,0 +11,0 @@ get broadcasterId(): string;

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

/**
* The ID of the broadcaster for which the AutoMod settings were fetched.
* The ID of the broadcaster for which the AutoMod settings are retrieved.
*/

@@ -14,0 +14,0 @@ get broadcasterId() {

import { rawDataSymbol } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixBanData } from '../../../interfaces/helix/moderation.external';

@@ -13,3 +13,3 @@ import { HelixBanUser } from './HelixBanUser';

/** @private */
constructor(data: HelixBanData, client: BaseApiClient);
constructor(data: HelixBanData, broadcasterId: string, client: ApiClient);
/**

@@ -16,0 +16,0 @@ * The name of the user that was banned or put in a timeout.

@@ -14,4 +14,4 @@ "use strict";

/** @private */
constructor(data, client) {
super(data, data.expires_at || null, client);
constructor(data, broadcasterId, client) {
super(data, broadcasterId, data.expires_at || null, client);
}

@@ -18,0 +18,0 @@ /**

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import { type ApiClient } from '../../../ApiClient';
import { type HelixCommonBanUserData } from '../../../interfaces/helix/moderation.external';

@@ -12,6 +12,14 @@ import { type HelixUser } from '../user/HelixUser';

private readonly _client;
private readonly _broadcasterId;
private readonly _expiryTimestamp;
/** @private */
constructor(data: HelixCommonBanUserData, expiryTimestamp: string | null, client: BaseApiClient);
constructor(data: HelixCommonBanUserData, broadcasterId: string, expiryTimestamp: string | null, client: ApiClient);
/**
* The ID of the broadcaster whose chat room the user was banned/timed out from chatting in.
*
* @deprecated As this is the result of a ban action or list request that takes the broadcaster ID as a parameter,
* use that directly instead.
*/
get broadcasterId(): string;
/**
* The date and time that the ban/timeout was created.

@@ -25,2 +33,6 @@ */

/**
* @deprecated Use {@link HelixBanUser#expiryDate} instead.
*/
get endDate(): Date | null;
/**
* The ID of the moderator that banned or put the user in the timeout.

@@ -30,3 +42,3 @@ */

/**
* Gets more information about the moderator that banned or put the user in the timeout.
* Retrieves more information about the moderator that banned or put the user in the timeout.
*/

@@ -39,3 +51,3 @@ getModerator(): Promise<HelixUser>;

/**
* Gets more information about the user that was banned or put in a timeout.
* Fetches more info about the user that was banned or put in a timeout.
*/

@@ -42,0 +54,0 @@ getUser(): Promise<HelixUser>;

@@ -14,4 +14,5 @@ "use strict";

/** @private */
constructor(data, expiryTimestamp, client) {
constructor(data, broadcasterId, expiryTimestamp, client) {
super(data);
this._broadcasterId = broadcasterId;
this._expiryTimestamp = expiryTimestamp;

@@ -21,2 +22,11 @@ this._client = client;

/**
* The ID of the broadcaster whose chat room the user was banned/timed out from chatting in.
*
* @deprecated As this is the result of a ban action or list request that takes the broadcaster ID as a parameter,
* use that directly instead.
*/
get broadcasterId() {
return this._broadcasterId;
}
/**
* The date and time that the ban/timeout was created.

@@ -34,2 +44,8 @@ */

/**
* @deprecated Use {@link HelixBanUser#expiryDate} instead.
*/
get endDate() {
return this.expiryDate;
}
/**
* The ID of the moderator that banned or put the user in the timeout.

@@ -41,6 +57,6 @@ */

/**
* Gets more information about the moderator that banned or put the user in the timeout.
* Retrieves more information about the moderator that banned or put the user in the timeout.
*/
async getModerator() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].moderator_id));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].moderator_id));
}

@@ -54,6 +70,6 @@ /**

/**
* Gets more information about the user that was banned or put in a timeout.
* Fetches more info about the user that was banned or put in a timeout.
*/
async getUser() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].user_id));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].user_id));
}

@@ -66,2 +82,5 @@ };

(0, shared_utils_1.Enumerable)(false)
], HelixBanUser.prototype, "_broadcasterId", void 0);
tslib_1.__decorate([
(0, shared_utils_1.Enumerable)(false)
], HelixBanUser.prototype, "_expiryTimestamp", void 0);

@@ -68,0 +87,0 @@ HelixBanUser = tslib_1.__decorate([

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

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const { data: users } = await api.moderation.getBannedUsers('61369223');

@@ -32,5 +32,5 @@ * ```

/**
* Gets a list of banned users in a given channel.
* Retrieves a list of banned users in a given channel.
*
* @param channel The channel to get the banned users from.
* @param channel The channel to retrieve the banned users from.
* @param filter Additional filters for the result set.

@@ -44,3 +44,3 @@ *

*
* @param channel The channel to get the banned users from.
* @param channel The channel to retrieve the banned users from.
*/

@@ -56,5 +56,5 @@ getBannedUsersPaginated(channel: UserIdResolvable): HelixPaginatedRequest<HelixBanData, HelixBan>;

/**
* Gets a list of moderators in a given channel.
* Retrieves a list of moderators in a given channel.
*
* @param channel The channel to get moderators from.
* @param channel The channel to retrieve moderators from.
* @param filter Additional filters for the result set.

@@ -68,3 +68,3 @@ *

*
* @param channel The channel to get moderators from.
* @param channel The channel to retrieve moderators from.
*/

@@ -109,7 +109,7 @@ getModeratorsPaginated(channel: UserIdResolvable): HelixPaginatedRequest<HelixModeratorData, HelixModerator>;

/**
* Gets the AutoMod settings for a broadcaster.
* Retrieves the AutoMod settings for a broadcaster.
*
* @param broadcaster The broadcaster to get the AutoMod settings for.
* @param broadcaster The broadcaster for which the AutoMod settings are retrieved.
* @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.
* This user must match the user associated with the user OAuth token.
*/

@@ -122,3 +122,3 @@ getAutoModSettings(broadcaster: UserIdResolvable, moderator: UserIdResolvable): Promise<HelixAutoModSettings[]>;

* @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.
* This user must match the user associated with the user OAuth token.
* @param data The updated AutoMod settings that replace the current AutoMod settings.

@@ -132,3 +132,3 @@ */

* @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.
* This user must match the user associated with the user OAuth token.
* @param data

@@ -146,3 +146,3 @@ *

* @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.
* This user must match the user associated with the user OAuth token.
* @param user The user who will be unbanned/removed from timeout.

@@ -154,5 +154,5 @@ */

*
* @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 broadcaster The broadcaster for whose channel blocked terms will be retrieved.
* @param moderator A user that has permission to retrieve blocked terms for the broadcaster's channel.
* This user must match the user associated with the user OAuth token.
* @param pagination

@@ -170,3 +170,3 @@ *

* @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.
* This user must match the user associated with the user OAuth token.
* @param text The word or phrase to block from being used in the broadcaster's channel.

@@ -182,3 +182,3 @@ *

* @param moderator A user that has permission to unblock terms in the broadcaster's channel.
* The token of this user will be used to remove the blocked term.
* This user must match the user associated with the user OAuth token.
* @param id The ID of the term that should be unblocked.

@@ -202,4 +202,4 @@ */

* @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.
* @param moderator A user that has permission to read Shield Mode status in the broadcaster's channel.
* This user must match the user associated with the user OAuth token.
*/

@@ -212,4 +212,4 @@ getShieldModeStatus(broadcaster: UserIdResolvable, moderator: UserIdResolvable): Promise<HelixShieldModeStatus>;

* @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.
* This user must match the user associated with the user OAuth token.
* @param activate Whether or not to activate Shield Mode on the broadcaster's channel.
*/

@@ -216,0 +216,0 @@ updateShieldModeStatus(broadcaster: UserIdResolvable, moderator: UserIdResolvable, activate: boolean): Promise<HelixShieldModeStatus>;

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

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const { data: users } = await api.moderation.getBannedUsers('61369223');

@@ -37,5 +37,5 @@ * ```

/**
* Gets a list of banned users in a given channel.
* Retrieves a list of banned users in a given channel.
*
* @param channel The channel to get the banned users from.
* @param channel The channel to retrieve the banned users from.
* @param filter Additional filters for the result set.

@@ -46,7 +46,7 @@ *

async getBannedUsers(channel, filter) {
var _a;
const result = await this._client.callApi({
type: 'helix',
url: 'moderation/banned',
userId: (0, common_1.extractUserId)(channel),
scopes: ['moderation:read'],
scope: 'moderation:read',
query: {

@@ -57,3 +57,7 @@ ...(0, moderation_external_1.createModerationUserListQuery)(channel, filter),

});
return (0, HelixPaginatedResult_1.createPaginatedResult)(result, HelixBan_1.HelixBan, this._client);
// TODO revert to createPaginatedResult when broadcaster ID parameter is gone (prop already deprecated)
return {
data: result.data.map(data => new HelixBan_1.HelixBan(data, (0, common_1.extractUserId)(channel), this._client)),
cursor: (_a = result.pagination) === null || _a === void 0 ? void 0 : _a.cursor
};
}

@@ -63,3 +67,3 @@ /**

*
* @param channel The channel to get the banned users from.
* @param channel The channel to retrieve the banned users from.
*/

@@ -69,6 +73,5 @@ getBannedUsersPaginated(channel) {

url: 'moderation/banned',
userId: (0, common_1.extractUserId)(channel),
scopes: ['moderation:read'],
scope: 'moderation:read',
query: (0, api_call_1.createBroadcasterQuery)(channel)
}, this._client, data => new HelixBan_1.HelixBan(data, this._client), 50 // possibly a relatively consistent workaround for twitchdev/issues#18
}, this._client, data => new HelixBan_1.HelixBan(data, (0, common_1.extractUserId)(channel), this._client), 50 // possibly a relatively consistent workaround for twitchdev/issues#18
);

@@ -88,5 +91,5 @@ }

/**
* Gets a list of moderators in a given channel.
* Retrieves a list of moderators in a given channel.
*
* @param channel The channel to get moderators from.
* @param channel The channel to retrieve moderators from.
* @param filter Additional filters for the result set.

@@ -100,4 +103,3 @@ *

url: 'moderation/moderators',
userId: (0, common_1.extractUserId)(channel),
scopes: ['moderation:read', 'channel:manage:moderators'],
scope: 'moderation:read',
query: {

@@ -113,3 +115,3 @@ ...(0, moderation_external_1.createModerationUserListQuery)(channel, filter),

*
* @param channel The channel to get moderators from.
* @param channel The channel to retrieve moderators from.
*/

@@ -119,4 +121,3 @@ getModeratorsPaginated(channel) {

url: 'moderation/moderators',
userId: (0, common_1.extractUserId)(channel),
scopes: ['moderation:read', 'channel:manage:moderators'],
scope: 'moderation:read',
query: (0, api_call_1.createBroadcasterQuery)(channel)

@@ -147,4 +148,3 @@ }, this._client, data => new HelixModerator_1.HelixModerator(data, this._client));

method: 'POST',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:manage:moderators'],
scope: 'channel:manage:moderators',
query: (0, moderation_external_1.createModeratorModifyQuery)(broadcaster, user)

@@ -164,4 +164,3 @@ });

method: 'DELETE',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:manage:moderators'],
scope: 'channel:manage:moderators',
query: (0, moderation_external_1.createModeratorModifyQuery)(broadcaster, user)

@@ -181,4 +180,3 @@ });

method: 'POST',
userId: (0, common_1.extractUserId)(channel),
scopes: ['moderation:read'],
scope: 'moderation:read',
query: (0, api_call_1.createBroadcasterQuery)(channel),

@@ -203,4 +201,3 @@ jsonBody: {

method: 'POST',
userId: (0, common_1.extractUserId)(user),
scopes: ['moderator:manage:automod'],
scope: 'moderator:manage:automod',
jsonBody: (0, moderation_external_1.createAutoModProcessBody)(user, msgId, allow)

@@ -210,7 +207,7 @@ });

/**
* Gets the AutoMod settings for a broadcaster.
* Retrieves the AutoMod settings for a broadcaster.
*
* @param broadcaster The broadcaster to get the AutoMod settings for.
* @param broadcaster The broadcaster for which the AutoMod settings are retrieved.
* @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.
* This user must match the user associated with the user OAuth token.
*/

@@ -221,4 +218,3 @@ async getAutoModSettings(broadcaster, moderator) {

url: 'moderation/automod/settings',
userId: (0, common_1.extractUserId)(moderator),
scopes: ['moderator:read:automod_settings'],
scope: 'moderator:read:automod_settings',
query: (0, generic_external_1.createModeratorActionQuery)(broadcaster, moderator)

@@ -233,3 +229,3 @@ });

* @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.
* This user must match the user associated with the user OAuth token.
* @param data The updated AutoMod settings that replace the current AutoMod settings.

@@ -242,4 +238,3 @@ */

method: 'PUT',
userId: (0, common_1.extractUserId)(moderator),
scopes: ['moderator:manage:automod_settings'],
scope: 'moderator:manage:automod_settings',
query: (0, generic_external_1.createModeratorActionQuery)(broadcaster, moderator),

@@ -255,3 +250,3 @@ jsonBody: (0, moderation_external_1.createAutoModSettingsBody)(data)

* @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.
* This user must match the user associated with the user OAuth token.
* @param data

@@ -268,8 +263,7 @@ *

method: 'POST',
userId: (0, common_1.extractUserId)(moderator),
scopes: ['moderator:manage:banned_users'],
scope: 'moderator:manage:banned_users',
query: (0, generic_external_1.createModeratorActionQuery)(broadcaster, moderator),
jsonBody: (0, moderation_external_1.createBanUserBody)(data)
});
return result.data.map(banData => new HelixBanUser_1.HelixBanUser(banData, banData.end_time, this._client));
return result.data.map(banData => new HelixBanUser_1.HelixBanUser(banData, banData.broadcaster_id, banData.end_time, this._client));
}

@@ -281,3 +275,3 @@ /**

* @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.
* This user must match the user associated with the user OAuth token.
* @param user The user who will be unbanned/removed from timeout.

@@ -290,4 +284,3 @@ */

method: 'DELETE',
userId: (0, common_1.extractUserId)(moderator),
scopes: ['moderator:manage:banned_users'],
scope: 'moderator:manage:banned_users',
query: {

@@ -302,5 +295,5 @@ ...(0, generic_external_1.createModeratorActionQuery)(broadcaster, moderator),

*
* @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 broadcaster The broadcaster for whose channel blocked terms will be retrieved.
* @param moderator A user that has permission to retrieve blocked terms for the broadcaster's channel.
* This user must match the user associated with the user OAuth token.
* @param pagination

@@ -316,4 +309,3 @@ *

url: 'moderation/blocked_terms',
userId: (0, common_1.extractUserId)(moderator),
scopes: ['moderator:read:blocked_terms'],
scope: 'moderator:read:blocked_terms',
query: {

@@ -331,3 +323,3 @@ ...(0, generic_external_1.createModeratorActionQuery)(broadcaster, moderator),

* @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.
* This user must match the user associated with the user OAuth token.
* @param text The word or phrase to block from being used in the broadcaster's channel.

@@ -342,4 +334,3 @@ *

method: 'POST',
userId: (0, common_1.extractUserId)(moderator),
scopes: ['moderator:manage:blocked_terms'],
scope: 'moderator:manage:blocked_terms',
query: (0, generic_external_1.createModeratorActionQuery)(broadcaster, moderator),

@@ -357,3 +348,3 @@ jsonBody: {

* @param moderator A user that has permission to unblock terms in the broadcaster's channel.
* The token of this user will be used to remove the blocked term.
* This user must match the user associated with the user OAuth token.
* @param id The ID of the term that should be unblocked.

@@ -366,4 +357,3 @@ */

method: 'DELETE',
userId: (0, common_1.extractUserId)(moderator),
scopes: ['moderator:manage:blocked_terms'],
scope: 'moderator:manage:blocked_terms',
query: {

@@ -390,4 +380,3 @@ ...(0, generic_external_1.createModeratorActionQuery)(broadcaster, moderator),

method: 'DELETE',
userId: (0, common_1.extractUserId)(moderator),
scopes: ['moderator:manage:chat_messages'],
scope: 'moderator:manage:chat_messages',
query: {

@@ -403,4 +392,4 @@ ...(0, generic_external_1.createModeratorActionQuery)(broadcaster, moderator),

* @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.
* @param moderator A user that has permission to read Shield Mode status in the broadcaster's channel.
* This user must match the user associated with the user OAuth token.
*/

@@ -412,4 +401,3 @@ async getShieldModeStatus(broadcaster, moderator) {

method: 'GET',
userId: (0, common_1.extractUserId)(moderator),
scopes: ['moderator:read:shield_mode', 'moderator:manage:shield_mode'],
scope: 'moderator:read:shield_mode',
query: (0, generic_external_1.createModeratorActionQuery)(broadcaster, moderator)

@@ -424,4 +412,4 @@ });

* @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.
* This user must match the user associated with the user OAuth token.
* @param activate Whether or not to activate Shield Mode on the broadcaster's channel.
*/

@@ -433,4 +421,3 @@ async updateShieldModeStatus(broadcaster, moderator, activate) {

method: 'PUT',
userId: (0, common_1.extractUserId)(moderator),
scopes: ['moderator:manage:shield_mode'],
scope: 'moderator:manage:shield_mode',
query: (0, generic_external_1.createModeratorActionQuery)(broadcaster, moderator),

@@ -437,0 +424,0 @@ jsonBody: (0, moderation_external_1.createUpdateShieldModeStatusBody)(activate)

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixModeratorData } from '../../../interfaces/helix/moderation.external';

@@ -11,3 +11,3 @@ import type { HelixUser } from '../user/HelixUser';

/** @private */
constructor(data: HelixModeratorData, client: BaseApiClient);
constructor(data: HelixModeratorData, client: ApiClient);
/**

@@ -26,3 +26,3 @@ * The ID of the user.

/**
* Gets more information about the user.
* Retrieves more information about the user.
*/

@@ -29,0 +29,0 @@ getUser(): Promise<HelixUser>;

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

/**
* Gets more information about the user.
* Retrieves more information about the user.
*/
async getUser() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].user_id));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].user_id));
}

@@ -41,0 +41,0 @@ };

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import type { HelixShieldModeStatusData } from '../../../interfaces/helix/moderation.external';

@@ -11,3 +11,3 @@ import type { HelixUser } from '../user/HelixUser';

/** @private */
constructor(data: HelixShieldModeStatusData, client: BaseApiClient);
constructor(data: HelixShieldModeStatusData, client: ApiClient);
/**

@@ -30,3 +30,3 @@ * Whether Shield Mode is active.

/**
* Gets more information about the moderator that last activated Shield Mode.
* Retrieves more information about the moderator that last activated Shield Mode.
*/

@@ -33,0 +33,0 @@ getModerator(): Promise<HelixUser>;

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

/**
* Gets more information about the moderator that last activated Shield Mode.
* Retrieves more information about the moderator that last activated Shield Mode.
*/
async getModerator() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].moderator_id));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].moderator_id));
}

@@ -47,0 +47,0 @@ /**

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixPollData, type HelixPollStatus } from '../../../interfaces/helix/poll.external';

@@ -12,3 +12,3 @@ import type { HelixUser } from '../user/HelixUser';

/** @private */
constructor(data: HelixPollData, client: BaseApiClient);
constructor(data: HelixPollData, client: ApiClient);
/**

@@ -31,3 +31,3 @@ * The ID of the poll.

/**
* Gets more information about the broadcaster.
* Retrieves more information about the broadcaster.
*/

@@ -40,2 +40,14 @@ getBroadcaster(): Promise<HelixUser>;

/**
* Whether voting with bits is enabled for the poll.
*
* @deprecated Twitch removed this feature.
*/
get isBitsVotingEnabled(): boolean;
/**
* The amount of bits that a vote costs.
*
* @deprecated Twitch removed this feature.
*/
get bitsPerVote(): number;
/**
* Whether voting with channel points is enabled for the poll.

@@ -42,0 +54,0 @@ */

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

/**
* Gets more information about the broadcaster.
* Retrieves more information about the broadcaster.
*/
async getBroadcaster() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].broadcaster_id));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].broadcaster_id));
}

@@ -55,2 +55,18 @@ /**

/**
* Whether voting with bits is enabled for the poll.
*
* @deprecated Twitch removed this feature.
*/
get isBitsVotingEnabled() {
return this[common_1.rawDataSymbol].bits_voting_enabled;
}
/**
* The amount of bits that a vote costs.
*
* @deprecated Twitch removed this feature.
*/
get bitsPerVote() {
return this[common_1.rawDataSymbol].bits_per_vote;
}
/**
* Whether voting with channel points is enabled for the poll.

@@ -57,0 +73,0 @@ */

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

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const { data: polls } = await api.helix.polls.getPolls('61369223');

@@ -26,5 +26,5 @@ * ```

/**
* Gets a list of polls for the given broadcaster.
* Retrieves a list of polls for the given broadcaster.
*
* @param broadcaster The broadcaster to get polls for.
* @param broadcaster The broadcaster to retrieve polls for.
* @param pagination

@@ -38,9 +38,9 @@ *

*
* @param broadcaster The broadcaster to get polls for.
* @param broadcaster The broadcaster to retrieve polls for.
*/
getPollsPaginated(broadcaster: UserIdResolvable): HelixPaginatedRequest<HelixPollData, HelixPoll>;
/**
* Gets polls by IDs.
* Retrieves polls by IDs.
*
* @param broadcaster The broadcaster to get the polls for.
* @param broadcaster The broadcaster to retrieve the polls for.
* @param ids The IDs of the polls.

@@ -50,5 +50,5 @@ */

/**
* Gets a poll by ID.
* Retrieves a poll by ID.
*
* @param broadcaster The broadcaster to get the poll for.
* @param broadcaster The broadcaster to retrieve the poll for.
* @param id The ID of the poll.

@@ -55,0 +55,0 @@ */

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

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const { data: polls } = await api.helix.polls.getPolls('61369223');

@@ -31,5 +31,5 @@ * ```

/**
* Gets a list of polls for the given broadcaster.
* Retrieves a list of polls for the given broadcaster.
*
* @param broadcaster The broadcaster to get polls for.
* @param broadcaster The broadcaster to retrieve polls for.
* @param pagination

@@ -43,4 +43,3 @@ *

url: 'polls',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:read:polls'],
scope: 'channel:read:polls',
query: {

@@ -56,3 +55,3 @@ ...(0, api_call_1.createBroadcasterQuery)(broadcaster),

*
* @param broadcaster The broadcaster to get polls for.
* @param broadcaster The broadcaster to retrieve polls for.
*/

@@ -62,4 +61,3 @@ getPollsPaginated(broadcaster) {

url: 'polls',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:read:polls'],
scope: 'channel:read:polls',
query: (0, api_call_1.createBroadcasterQuery)(broadcaster)

@@ -69,5 +67,5 @@ }, this._client, data => new HelixPoll_1.HelixPoll(data, this._client), 20);

/**
* Gets polls by IDs.
* Retrieves polls by IDs.
*
* @param broadcaster The broadcaster to get the polls for.
* @param broadcaster The broadcaster to retrieve the polls for.
* @param ids The IDs of the polls.

@@ -82,4 +80,3 @@ */

url: 'polls',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:read:polls'],
scope: 'channel:read:polls',
query: (0, generic_external_1.createGetByIdsQuery)(broadcaster, ids)

@@ -90,5 +87,5 @@ });

/**
* Gets a poll by ID.
* Retrieves a poll by ID.
*
* @param broadcaster The broadcaster to get the poll for.
* @param broadcaster The broadcaster to retrieve the poll for.
* @param id The ID of the poll.

@@ -113,4 +110,3 @@ */

method: 'POST',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:manage:polls'],
scope: 'channel:manage:polls',
jsonBody: (0, poll_external_1.createPollBody)(broadcaster, data)

@@ -132,4 +128,3 @@ });

method: 'PATCH',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:manage:polls'],
scope: 'channel:manage:polls',
jsonBody: (0, poll_external_1.createPollEndBody)(broadcaster, id, showResult)

@@ -136,0 +131,0 @@ });

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

get channelPointsVotes(): number;
/**
* The votes the choice received by spending bits.
*
* @deprecated Twitch removed this feature.
*/
get bitsVotes(): number;
}
//# sourceMappingURL=HelixPollChoice.d.ts.map

@@ -34,2 +34,10 @@ "use strict";

}
/**
* The votes the choice received by spending bits.
*
* @deprecated Twitch removed this feature.
*/
get bitsVotes() {
return this[common_1.rawDataSymbol].bits_votes;
}
};

@@ -36,0 +44,0 @@ HelixPollChoice = tslib_1.__decorate([

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixPredictionData, type HelixPredictionStatus } from '../../../interfaces/helix/prediction.external';

@@ -12,3 +12,3 @@ import type { HelixUser } from '../user/HelixUser';

/** @private */
constructor(data: HelixPredictionData, client: BaseApiClient);
constructor(data: HelixPredictionData, client: ApiClient);
/**

@@ -31,3 +31,3 @@ * The ID of the prediction.

/**
* Gets more information about the broadcaster.
* Retrieves more information about the broadcaster.
*/

@@ -34,0 +34,0 @@ getBroadcaster(): Promise<HelixUser>;

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

/**
* Gets more information about the broadcaster.
* Retrieves more information about the broadcaster.
*/
async getBroadcaster() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].broadcaster_id));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].broadcaster_id));
}

@@ -94,5 +94,3 @@ /**

get winningOutcomeId() {
// can apparently be empty string
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
return this[common_1.rawDataSymbol].winning_outcome_id || null;
return this[common_1.rawDataSymbol].winning_outcome_id;
}

@@ -103,3 +101,3 @@ /**

get winningOutcome() {
if (!this[common_1.rawDataSymbol].winning_outcome_id) {
if (this[common_1.rawDataSymbol].winning_outcome_id === null) {
return null;

@@ -106,0 +104,0 @@ }

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

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const { data: predictions } = await api.helix.predictions.getPredictions('61369223');

@@ -26,5 +26,5 @@ * ```

/**
* Gets a list of predictions for the given broadcaster.
* Retrieves a list of predictions for the given broadcaster.
*
* @param broadcaster The broadcaster to get predictions for.
* @param broadcaster The broadcaster to retrieve predictions for.
* @param pagination

@@ -38,9 +38,9 @@ *

*
* @param broadcaster The broadcaster to get predictions for.
* @param broadcaster The broadcaster to retrieve predictions for.
*/
getPredictionsPaginated(broadcaster: UserIdResolvable): HelixPaginatedRequest<HelixPredictionData, HelixPrediction>;
/**
* Gets predictions by IDs.
* Retrieves predictions by IDs.
*
* @param broadcaster The broadcaster to get the predictions for.
* @param broadcaster The broadcaster to retrieve the predictions for.
* @param ids The IDs of the predictions.

@@ -50,5 +50,5 @@ */

/**
* Gets a prediction by ID.
* Retrieves a prediction by ID.
*
* @param broadcaster The broadcaster to get the prediction for.
* @param broadcaster The broadcaster to retrieve the prediction for.
* @param id The ID of the prediction.

@@ -55,0 +55,0 @@ */

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

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const { data: predictions } = await api.helix.predictions.getPredictions('61369223');

@@ -31,5 +31,5 @@ * ```

/**
* Gets a list of predictions for the given broadcaster.
* Retrieves a list of predictions for the given broadcaster.
*
* @param broadcaster The broadcaster to get predictions for.
* @param broadcaster The broadcaster to retrieve predictions for.
* @param pagination

@@ -43,4 +43,3 @@ *

url: 'predictions',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:read:predictions'],
scope: 'channel:read:predictions',
query: {

@@ -56,3 +55,3 @@ ...(0, api_call_1.createBroadcasterQuery)(broadcaster),

*
* @param broadcaster The broadcaster to get predictions for.
* @param broadcaster The broadcaster to retrieve predictions for.
*/

@@ -62,4 +61,3 @@ getPredictionsPaginated(broadcaster) {

url: 'predictions',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:read:predictions'],
scope: 'channel:read:predictions',
query: (0, api_call_1.createBroadcasterQuery)(broadcaster)

@@ -69,5 +67,5 @@ }, this._client, data => new HelixPrediction_1.HelixPrediction(data, this._client), 20);

/**
* Gets predictions by IDs.
* Retrieves predictions by IDs.
*
* @param broadcaster The broadcaster to get the predictions for.
* @param broadcaster The broadcaster to retrieve the predictions for.
* @param ids The IDs of the predictions.

@@ -82,4 +80,3 @@ */

url: 'predictions',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:read:predictions'],
scope: 'channel:read:predictions',
query: (0, generic_external_1.createGetByIdsQuery)(broadcaster, ids)

@@ -90,5 +87,5 @@ });

/**
* Gets a prediction by ID.
* Retrieves a prediction by ID.
*
* @param broadcaster The broadcaster to get the prediction for.
* @param broadcaster The broadcaster to retrieve the prediction for.
* @param id The ID of the prediction.

@@ -113,4 +110,3 @@ */

method: 'POST',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:manage:predictions'],
scope: 'channel:manage:predictions',
jsonBody: (0, prediction_external_1.createPredictionBody)(broadcaster, data)

@@ -153,4 +149,3 @@ });

method: 'PATCH',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:manage:predictions'],
scope: 'channel:manage:predictions',
jsonBody: (0, prediction_external_1.createEndPredictionBody)(broadcaster, id, status, outcomeId)

@@ -157,0 +152,0 @@ });

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixPredictionOutcomeColor, type HelixPredictionOutcomeData } from '../../../interfaces/helix/prediction.external';

@@ -11,3 +11,3 @@ import { HelixPredictor } from './HelixPredictor';

/** @private */
constructor(data: HelixPredictionOutcomeData, client: BaseApiClient);
constructor(data: HelixPredictionOutcomeData, client: ApiClient);
/**

@@ -14,0 +14,0 @@ * The ID of the outcome.

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixPredictorData } from '../../../interfaces/helix/prediction.external';

@@ -11,3 +11,3 @@ import type { HelixUser } from '../user/HelixUser';

/** @private */
constructor(data: HelixPredictorData, client: BaseApiClient);
constructor(data: HelixPredictorData, client: ApiClient);
/**

@@ -26,3 +26,3 @@ * The user ID of the predictor.

/**
* Gets more information about the predictor.
* Retrieves more information about the predictor.
*/

@@ -29,0 +29,0 @@ getUser(): Promise<HelixUser | null>;

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

/**
* Gets more information about the predictor.
* Retrieves more information about the predictor.
*/

@@ -38,0 +38,0 @@ async getUser() {

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

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const raid = await api.raids.startRaid('125328655', '61369223');

@@ -14,0 +14,0 @@ * ```

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

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const raid = await api.raids.startRaid('125328655', '61369223');

@@ -37,4 +37,2 @@ * ```

method: 'POST',
userId: (0, common_1.extractUserId)(from),
scopes: ['channel:manage:raids'],
query: (0, raid_external_1.createRaidStartQuery)(from, to)

@@ -54,4 +52,2 @@ });

method: 'DELETE',
userId: (0, common_1.extractUserId)(from),
scopes: ['channel:manage:raids'],
query: (0, api_call_1.createBroadcasterQuery)(from)

@@ -58,0 +54,0 @@ });

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixUserRelationData } from '../../../interfaces/helix/generic.external';

@@ -11,3 +11,3 @@ import type { HelixUser } from '../user/HelixUser';

/** @private */
constructor(data: HelixUserRelationData, client: BaseApiClient);
constructor(data: HelixUserRelationData, client: ApiClient);
/**

@@ -26,3 +26,3 @@ * The ID of the user.

/**
* Gets additional information about the user.
* Retrieves additional information about the user.
*/

@@ -29,0 +29,0 @@ getUser(): Promise<HelixUser>;

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

/**
* Gets additional information about the user.
* Retrieves additional information about the user.
*/
async getUser() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].user_id));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].user_id));
}

@@ -41,0 +41,0 @@ };

import type { HelixPaginatedResponse, TwitchApiCallOptions } from '@twurple/api-call';
import type { UserIdResolvable } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixScheduleSegmentData } from '../../../interfaces/helix/schedule.external';

@@ -13,3 +13,3 @@ import { type HelixScheduleFilter } from '../../../interfaces/helix/schedule.input';

/** @private */
constructor(broadcaster: UserIdResolvable, client: BaseApiClient, filter?: HelixScheduleFilter);
constructor(broadcaster: UserIdResolvable, client: ApiClient, filter?: HelixScheduleFilter);
/** @private */

@@ -16,0 +16,0 @@ protected _fetchData(additionalOptions?: Partial<TwitchApiCallOptions>): Promise<HelixPaginatedResponse<HelixScheduleSegmentData>>;

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixScheduleData } from '../../../interfaces/helix/schedule.external';

@@ -12,3 +12,3 @@ import type { HelixUser } from '../user/HelixUser';

/** @private */
constructor(data: HelixScheduleData, client: BaseApiClient);
constructor(data: HelixScheduleData, client: ApiClient);
/**

@@ -31,3 +31,3 @@ * The segments of the schedule.

/**
* Gets more information about the broadcaster.
* Retrieves more information about the broadcaster.
*/

@@ -34,0 +34,0 @@ getBroadcaster(): Promise<HelixUser>;

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

/**
* Gets more information about the broadcaster.
* Retrieves more information about the broadcaster.
*/
async getBroadcaster() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].broadcaster_id));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].broadcaster_id));
}

@@ -49,0 +49,0 @@ /**

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

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const { data: schedule } = await api.helix.schedule.getSchedule('61369223');

@@ -23,3 +23,3 @@ * ```

/**
* Gets the schedule for a given broadcaster.
* Retrieves the schedule for a given broadcaster.
*

@@ -42,3 +42,3 @@ * @param broadcaster The broadcaster to get the schedule of.

/**
* Gets a set of schedule segments by IDs.
* Retrieves a set of schedule segments by IDs.
*

@@ -50,3 +50,3 @@ * @param broadcaster The broadcaster to get schedule segments of.

/**
* Gets a single schedule segment by ID.
* Retrieves a single schedule segment by ID.
*

@@ -58,3 +58,3 @@ * @param broadcaster The broadcaster to get a schedule segment of.

/**
* Gets the schedule for a given broadcaster in iCal format.
* Retrieves the schedule for a given broadcaster in iCal format.
*

@@ -61,0 +61,0 @@ * @param broadcaster The broadcaster to get the schedule for.

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

const api_call_1 = require("@twurple/api-call");
const common_1 = require("@twurple/common");
const generic_external_1 = require("../../../interfaces/helix/generic.external");

@@ -21,3 +20,3 @@ const schedule_external_1 = require("../../../interfaces/helix/schedule.external");

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const { data: schedule } = await api.helix.schedule.getSchedule('61369223');

@@ -31,3 +30,3 @@ * ```

/**
* Gets the schedule for a given broadcaster.
* Retrieves the schedule for a given broadcaster.
*

@@ -43,3 +42,2 @@ * @param broadcaster The broadcaster to get the schedule of.

url: 'schedule',
userId: (0, common_1.extractUserId)(broadcaster),
query: {

@@ -67,3 +65,3 @@ ...(0, schedule_external_1.createScheduleQuery)(broadcaster, filter),

/**
* Gets a set of schedule segments by IDs.
* Retrieves a set of schedule segments by IDs.
*

@@ -78,3 +76,2 @@ * @param broadcaster The broadcaster to get schedule segments of.

url: 'schedule',
userId: (0, common_1.extractUserId)(broadcaster),
query: (0, generic_external_1.createGetByIdsQuery)(broadcaster, ids)

@@ -85,3 +82,3 @@ });

/**
* Gets a single schedule segment by ID.
* Retrieves a single schedule segment by ID.
*

@@ -96,3 +93,3 @@ * @param broadcaster The broadcaster to get a schedule segment of.

/**
* Gets the schedule for a given broadcaster in iCal format.
* Retrieves the schedule for a given broadcaster in iCal format.
*

@@ -121,4 +118,3 @@ * @param broadcaster The broadcaster to get the schedule for.

method: 'PATCH',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:manage:schedule'],
scope: 'channel:manage:schedule',
query: (0, schedule_external_1.createScheduleSettingsUpdateQuery)(broadcaster, settings)

@@ -140,4 +136,3 @@ });

method: 'POST',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:manage:schedule'],
scope: 'channel:manage:schedule',
query: (0, api_call_1.createBroadcasterQuery)(broadcaster),

@@ -162,4 +157,3 @@ jsonBody: (0, schedule_external_1.createScheduleSegmentBody)(data)

method: 'PATCH',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:manage:schedule'],
scope: 'channel:manage:schedule',
query: (0, schedule_external_1.createScheduleSegmentModifyQuery)(broadcaster, segmentId),

@@ -181,4 +175,3 @@ jsonBody: (0, schedule_external_1.createScheduleSegmentUpdateBody)(data)

method: 'DELETE',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:manage:schedule'],
scope: 'channel:manage:schedule',
query: (0, schedule_external_1.createScheduleSegmentModifyQuery)(broadcaster, segmentId)

@@ -185,0 +178,0 @@ });

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixScheduleSegmentData } from '../../../interfaces/helix/schedule.external';

@@ -11,3 +11,3 @@ import type { HelixGame } from '../game/HelixGame';

/** @private */
constructor(data: HelixScheduleSegmentData, client: BaseApiClient);
constructor(data: HelixScheduleSegmentData, client: ApiClient);
/**

@@ -42,3 +42,3 @@ * The ID of the segment.

/**
* Gets more information about the category the segment is scheduled for, or null if no category is specified.
* Retrieves more information about the category the segment is scheduled for, or null if no category is specified.
*/

@@ -45,0 +45,0 @@ getCategory(): Promise<HelixGame | null>;

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

/**
* Gets more information about the category the segment is scheduled for, or null if no category is specified.
* Retrieves more information about the category the segment is scheduled for, or null if no category is specified.
*/

@@ -64,0 +64,0 @@ async getCategory() {

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixChannelSearchResultData } from '../../../interfaces/helix/search.external';
import type { HelixGame } from '../game/HelixGame';
import type { HelixTag } from '../tag/HelixTag';
import type { HelixUser } from '../user/HelixUser';

@@ -12,3 +13,3 @@ /**

/** @private */
constructor(data: HelixChannelSearchResultData, client: BaseApiClient);
constructor(data: HelixChannelSearchResultData, client: ApiClient);
/**

@@ -31,3 +32,3 @@ * The language of the channel.

/**
* Gets additional information about the owner of the channel.
* Retrieves additional information about the owner of the channel.
*/

@@ -44,5 +45,5 @@ getUser(): Promise<HelixUser>;

/**
* Gets information about the game that is being played on the stream.
* Retrieves information about the game that is being played on the stream.
*/
getGame(): Promise<HelixGame | null>;
getGame(): Promise<HelixGame>;
/**

@@ -53,2 +54,14 @@ * Whether the channel is currently live.

/**
* The IDs of the tags set on the channel.
*
* @deprecated
*/
get tagIds(): string[];
/**
* Retrieves the tags of the channel.
*
* @deprecated
*/
getTags(): Promise<HelixTag[]>;
/**
* The tags applied to the channel.

@@ -55,0 +68,0 @@ */

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

/**
* Gets additional information about the owner of the channel.
* Retrieves additional information about the owner of the channel.
*/
async getUser() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].id));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].id));
}

@@ -60,8 +60,6 @@ /**

/**
* Gets information about the game that is being played on the stream.
* Retrieves information about the game that is being played on the stream.
*/
async getGame() {
return this[common_1.rawDataSymbol].game_id
? (0, common_1.checkRelationAssertion)(await this._client.games.getGameById(this[common_1.rawDataSymbol].game_id))
: null;
return (await this._client.games.getGameById(this[common_1.rawDataSymbol].game_id));
}

@@ -75,2 +73,18 @@ /**

/**
* The IDs of the tags set on the channel.
*
* @deprecated
*/
get tagIds() {
return this[common_1.rawDataSymbol].tag_ids;
}
/**
* Retrieves the tags of the channel.
*
* @deprecated
*/
async getTags() {
return await this._client.tags.getStreamTagsByIds(this[common_1.rawDataSymbol].tag_ids);
}
/**
* The tags applied to the channel.

@@ -77,0 +91,0 @@ */

@@ -17,3 +17,3 @@ import { type HelixGameData } from '../../../interfaces/helix/game.external';

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const channels = await api.search.searchChannels('pear');

@@ -20,0 +20,0 @@ * ```

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

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const channels = await api.search.searchChannels('pear');

@@ -23,0 +23,0 @@ * ```

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixStreamData, type HelixStreamType } from '../../../interfaces/helix/stream.external';
import type { HelixGame } from '../game/HelixGame';
import type { HelixTag } from '../tag/HelixTag';
import type { HelixUser } from '../user/HelixUser';

@@ -12,3 +13,3 @@ /**

/** @private */
constructor(data: HelixStreamData, client: BaseApiClient);
constructor(data: HelixStreamData, client: ApiClient);
/**

@@ -31,3 +32,3 @@ * The stream ID.

/**
* Gets information about the user broadcasting the stream.
* Retrieves information about the user broadcasting the stream.
*/

@@ -44,3 +45,3 @@ getUser(): Promise<HelixUser>;

/**
* Gets information about the game that is being played on the stream.
* Retrieves information about the game that is being played on the stream.
*

@@ -72,7 +73,2 @@ * Returns null if the stream doesn't currently have a game.

* The URL of the thumbnail of the stream.
*
* This URL includes the placeholders `{width}` and `{height}`
* which you must replace with the desired dimensions of the thumbnail (in pixels).
*
* You can also use {@link HelixStream#getThumbnailUrl} to do this replacement.
*/

@@ -88,2 +84,14 @@ get thumbnailUrl(): string;

/**
* The IDs of the tags of the stream.
*
* @deprecated
*/
get tagIds(): string[];
/**
* Retrieves the tags of the stream.
*
* @deprecated
*/
getTags(): Promise<HelixTag[]>;
/**
* The tags applied to the stream.

@@ -90,0 +98,0 @@ */

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

/**
* Gets information about the user broadcasting the stream.
* Retrieves information about the user broadcasting the stream.
*/
async getUser() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].user_id));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].user_id));
}

@@ -60,3 +60,3 @@ /**

/**
* Gets information about the game that is being played on the stream.
* Retrieves information about the game that is being played on the stream.
*

@@ -66,5 +66,3 @@ * Returns null if the stream doesn't currently have a game.

async getGame() {
return this[common_1.rawDataSymbol].game_id
? (0, common_1.checkRelationAssertion)(await this._client.games.getGameById(this[common_1.rawDataSymbol].game_id))
: null;
return this[common_1.rawDataSymbol].game_id ? await this._client.games.getGameById(this[common_1.rawDataSymbol].game_id) : null;
}

@@ -103,7 +101,2 @@ /**

* The URL of the thumbnail of the stream.
*
* This URL includes the placeholders `{width}` and `{height}`
* which you must replace with the desired dimensions of the thumbnail (in pixels).
*
* You can also use {@link HelixStream#getThumbnailUrl} to do this replacement.
*/

@@ -125,2 +118,20 @@ get thumbnailUrl() {

/**
* The IDs of the tags of the stream.
*
* @deprecated
*/
get tagIds() {
var _a;
return (_a = this[common_1.rawDataSymbol].tag_ids) !== null && _a !== void 0 ? _a : [];
}
/**
* Retrieves the tags of the stream.
*
* @deprecated
*/
async getTags() {
var _a;
return await this._client.tags.getStreamTagsByIds((_a = this[common_1.rawDataSymbol].tag_ids) !== null && _a !== void 0 ? _a : []);
}
/**
* The tags applied to the stream.

@@ -127,0 +138,0 @@ */

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

import type { HelixForwardPagination, HelixPagination } from '../HelixPagination';
import { HelixTag } from '../tag/HelixTag';
import { HelixStream } from './HelixStream';

@@ -19,3 +20,3 @@ import { HelixStreamMarker } from './HelixStreamMarker';

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const stream = await api.streams.getStreamByUserId('125328655');

@@ -29,3 +30,3 @@ * ```

/**
* Gets a list of streams.
* Retrieves a list of streams.
*

@@ -44,27 +45,27 @@ * @param filter

/**
* Gets the current streams for the given usernames.
* Retrieves the current streams for the given usernames.
*
* @param users The username to get the streams for.
* @param users The username to retrieve the streams for.
*/
getStreamsByUserNames(users: UserNameResolvable[]): Promise<HelixStream[]>;
/**
* Gets the current stream for the given username.
* Retrieves the current stream for the given username.
*
* @param user The username to get the stream for.
* @param user The username to retrieve the stream for.
*/
getStreamByUserName(user: UserNameResolvable): Promise<HelixStream | null>;
/**
* Gets the current streams for the given user IDs.
* Retrieves the current streams for the given user IDs.
*
* @param users The user IDs to get the streams for.
* @param users The user IDs to retrieve the streams for.
*/
getStreamsByUserIds(users: UserIdResolvable[]): Promise<HelixStream[]>;
/**
* Gets the current stream for the given user ID.
* Retrieves the current stream for the given user ID.
*
* @param user The user ID to get the stream for.
* @param user The user ID to retrieve the stream for.
*/
getStreamByUserId(user: UserIdResolvable): Promise<HelixStream | null>;
/**
* Gets a list of all stream markers for a user.
* Retrieves a list of all stream markers for an user.
*

@@ -78,3 +79,3 @@ * @param user The user to list the stream markers for.

/**
* Creates a paginator for all stream markers for a user.
* Creates a paginator for all stream markers for an user.
*

@@ -85,5 +86,4 @@ * @param user The user to list the stream markers for.

/**
* Gets a list of all stream markers for a video.
* Retrieves a list of all stream markers for a video.
*
* @param user The user the video belongs to.
* @param videoId The video to list the stream markers for.

@@ -94,10 +94,9 @@ * @param pagination

*/
getStreamMarkersForVideo(user: UserIdResolvable, videoId: string, pagination?: HelixPagination): Promise<HelixPaginatedResult<HelixStreamMarkerWithVideo>>;
getStreamMarkersForVideo(videoId: string, pagination?: HelixPagination): Promise<HelixPaginatedResult<HelixStreamMarkerWithVideo>>;
/**
* Creates a paginator for all stream markers for a video.
*
* @param user The user the video belongs to.
* @param videoId The video to list the stream markers for.
*/
getStreamMarkersForVideoPaginated(user: UserIdResolvable, videoId: string): HelixPaginatedRequest<HelixStreamGetMarkersResponse, HelixStreamMarkerWithVideo>;
getStreamMarkersForVideoPaginated(videoId: string): HelixPaginatedRequest<HelixStreamGetMarkersResponse, HelixStreamMarkerWithVideo>;
/**

@@ -113,9 +112,26 @@ * Creates a new stream marker.

/**
* Gets the stream key of a stream.
* Retrieves the tags of a stream.
*
* @param broadcaster The broadcaster to get the stream key for.
* @param broadcaster The broadcaster of the stream.
*
* @deprecated
*/
getStreamTags(broadcaster: UserIdResolvable): Promise<HelixTag[]>;
/**
* Replaces the tags of a stream.
*
* @param broadcaster The broadcaster of the stream.
* @param tagIds The tags to set. If not given, removes all tags.
*
* @deprecated
*/
replaceStreamTags(broadcaster: UserIdResolvable, tagIds?: string[]): Promise<void>;
/**
* Retrieves the stream key of a stream.
*
* @param broadcaster The broadcaster to retrieve the stream key for.
*/
getStreamKey(broadcaster: UserIdResolvable): Promise<string>;
/**
* Gets the streams that are currently live and are followed by the given user.
* Retrieves the streams that are currently live and are followed by the given user.
*

@@ -134,4 +150,6 @@ * @param user The user to check followed streams for.

getFollowedStreamsPaginated(user: UserIdResolvable): HelixPaginatedRequest<HelixStreamData, HelixStream>;
private _getStreamMarkers;
private _getStreamMarkersPaginated;
private static _mapGetStreamMarkersResult;
}
//# sourceMappingURL=HelixStreamApi.d.ts.map

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

const HelixPagination_1 = require("../HelixPagination");
const HelixTag_1 = require("../tag/HelixTag");
const HelixStream_1 = require("./HelixStream");

@@ -27,3 +28,3 @@ const HelixStreamMarker_1 = require("./HelixStreamMarker");

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const stream = await api.streams.getStreamByUserId('125328655');

@@ -37,3 +38,3 @@ * ```

/**
* Gets a list of streams.
* Retrieves a list of streams.
*

@@ -67,5 +68,5 @@ * @param filter

/**
* Gets the current streams for the given usernames.
* Retrieves the current streams for the given usernames.
*
* @param users The username to get the streams for.
* @param users The username to retrieve the streams for.
*/

@@ -77,5 +78,5 @@ async getStreamsByUserNames(users) {

/**
* Gets the current stream for the given username.
* Retrieves the current stream for the given username.
*
* @param user The username to get the stream for.
* @param user The username to retrieve the stream for.
*/

@@ -88,5 +89,5 @@ async getStreamByUserName(user) {

/**
* Gets the current streams for the given user IDs.
* Retrieves the current streams for the given user IDs.
*
* @param users The user IDs to get the streams for.
* @param users The user IDs to retrieve the streams for.
*/

@@ -98,18 +99,13 @@ async getStreamsByUserIds(users) {

/**
* Gets the current stream for the given user ID.
* Retrieves the current stream for the given user ID.
*
* @param user The user ID to get the stream for.
* @param user The user ID to retrieve the stream for.
*/
async getStreamByUserId(user) {
const userId = (0, common_1.extractUserId)(user);
const result = await this._client.callApi({
url: 'streams',
type: 'helix',
userId,
query: (0, stream_external_1.createStreamQuery)({ userId: userId })
});
return (0, shared_utils_1.mapNullable)(result.data[0], data => new HelixStream_1.HelixStream(data, this._client));
var _a;
const result = await this.getStreamsByUserIds([user]);
return (_a = result[0]) !== null && _a !== void 0 ? _a : null;
}
/**
* Gets a list of all stream markers for a user.
* Retrieves a list of all stream markers for an user.
*

@@ -122,21 +118,6 @@ * @param user The user to list the stream markers for.

async getStreamMarkersForUser(user, pagination) {
var _a;
const result = await this._client.callApi({
url: 'streams/markers',
type: 'helix',
query: {
...(0, generic_external_1.createUserQuery)(user),
...(0, HelixPagination_1.createPaginationQuery)(pagination)
},
userId: (0, common_1.extractUserId)(user),
scopes: ['user:read:broadcast'],
canOverrideScopedUserContext: true
});
return {
data: (0, shared_utils_1.flatten)(result.data.map(data => HelixStreamApi_1._mapGetStreamMarkersResult(data, this._client))),
cursor: (_a = result.pagination) === null || _a === void 0 ? void 0 : _a.cursor
};
return await this._getStreamMarkers('user_id', (0, common_1.extractUserId)(user), pagination);
}
/**
* Creates a paginator for all stream markers for a user.
* Creates a paginator for all stream markers for an user.
*

@@ -146,14 +127,7 @@ * @param user The user to list the stream markers for.

getStreamMarkersForUserPaginated(user) {
return new HelixPaginatedRequest_1.HelixPaginatedRequest({
url: 'streams/markers',
query: (0, generic_external_1.createUserQuery)(user),
userId: (0, common_1.extractUserId)(user),
scopes: ['user:read:broadcast'],
canOverrideScopedUserContext: true
}, this._client, data => HelixStreamApi_1._mapGetStreamMarkersResult(data, this._client));
return this._getStreamMarkersPaginated('user_id', (0, common_1.extractUserId)(user));
}
/**
* Gets a list of all stream markers for a video.
* Retrieves a list of all stream markers for a video.
*
* @param user The user the video belongs to.
* @param videoId The video to list the stream markers for.

@@ -164,19 +138,4 @@ * @param pagination

*/
async getStreamMarkersForVideo(user, videoId, pagination) {
var _a;
const result = await this._client.callApi({
url: 'streams/markers',
type: 'helix',
query: {
...(0, stream_external_1.createVideoQuery)(videoId),
...(0, HelixPagination_1.createPaginationQuery)(pagination)
},
userId: (0, common_1.extractUserId)(user),
scopes: ['user:read:broadcast'],
canOverrideScopedUserContext: true
});
return {
data: (0, shared_utils_1.flatten)(result.data.map(data => HelixStreamApi_1._mapGetStreamMarkersResult(data, this._client))),
cursor: (_a = result.pagination) === null || _a === void 0 ? void 0 : _a.cursor
};
async getStreamMarkersForVideo(videoId, pagination) {
return await this._getStreamMarkers('video_id', videoId, pagination);
}

@@ -186,13 +145,6 @@ /**

*
* @param user The user the video belongs to.
* @param videoId The video to list the stream markers for.
*/
getStreamMarkersForVideoPaginated(user, videoId) {
return new HelixPaginatedRequest_1.HelixPaginatedRequest({
url: 'streams/markers',
query: (0, stream_external_1.createVideoQuery)(videoId),
userId: (0, common_1.extractUserId)(user),
scopes: ['user:read:broadcast'],
canOverrideScopedUserContext: true
}, this._client, data => HelixStreamApi_1._mapGetStreamMarkersResult(data, this._client));
getStreamMarkersForVideoPaginated(videoId) {
return this._getStreamMarkersPaginated('video_id', videoId);
}

@@ -213,5 +165,3 @@ /**

type: 'helix',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:manage:broadcast'],
canOverrideScopedUserContext: true,
scope: 'channel:manage:broadcast',
jsonBody: (0, stream_external_1.createStreamMarkerBody)(broadcaster, description)

@@ -229,6 +179,39 @@ });

/**
* Gets the stream key of a stream.
* Retrieves the tags of a stream.
*
* @param broadcaster The broadcaster to get the stream key for.
* @param broadcaster The broadcaster of the stream.
*
* @deprecated
*/
async getStreamTags(broadcaster) {
const result = await this._client.callApi({
type: 'helix',
url: 'streams/tags',
query: (0, api_call_1.createBroadcasterQuery)(broadcaster)
});
return result.data.map(data => new HelixTag_1.HelixTag(data));
}
/**
* Replaces the tags of a stream.
*
* @param broadcaster The broadcaster of the stream.
* @param tagIds The tags to set. If not given, removes all tags.
*
* @deprecated
*/
async replaceStreamTags(broadcaster, tagIds) {
await this._client.callApi({
type: 'helix',
url: 'streams/tags',
scope: 'channel:manage:broadcast',
method: 'PUT',
query: (0, api_call_1.createBroadcasterQuery)(broadcaster),
jsonBody: (0, generic_external_1.createSingleKeyQuery)('tag_ids', tagIds)
});
}
/**
* Retrieves the stream key of a stream.
*
* @param broadcaster The broadcaster to retrieve the stream key for.
*/
async getStreamKey(broadcaster) {

@@ -238,3 +221,3 @@ const result = await this._client.callApi({

url: 'streams/key',
scopes: ['channel:read:stream_key'],
scope: 'channel:read:stream_key',
query: (0, api_call_1.createBroadcasterQuery)(broadcaster)

@@ -245,3 +228,3 @@ });

/**
* Gets the streams that are currently live and are followed by the given user.
* Retrieves the streams that are currently live and are followed by the given user.
*

@@ -254,10 +237,8 @@ * @param user The user to check followed streams for.

async getFollowedStreams(user, pagination) {
const userId = (0, common_1.extractUserId)(user);
const result = await this._client.callApi({
type: 'helix',
url: 'streams/followed',
userId,
scopes: ['user:read:follows'],
scope: 'user:read:follows',
query: {
...(0, generic_external_1.createSingleKeyQuery)('user_id', userId),
...(0, generic_external_1.createSingleKeyQuery)('user_id', (0, common_1.extractUserId)(user)),
...(0, HelixPagination_1.createPaginationQuery)(pagination)

@@ -274,14 +255,37 @@ }

getFollowedStreamsPaginated(user) {
const userId = (0, common_1.extractUserId)(user);
return new HelixPaginatedRequest_1.HelixPaginatedRequest({
url: 'streams/followed',
userId,
scopes: ['user:read:follows'],
query: (0, generic_external_1.createSingleKeyQuery)('user_id', userId)
scope: 'user:read:follows',
query: (0, generic_external_1.createSingleKeyQuery)('user_id', (0, common_1.extractUserId)(user))
}, this._client, data => new HelixStream_1.HelixStream(data, this._client));
}
static _mapGetStreamMarkersResult(data, client) {
async _getStreamMarkers(queryType, id, pagination) {
var _a;
const result = await this._client.callApi({
url: 'streams/markers',
type: 'helix',
query: {
[queryType]: id,
...(0, HelixPagination_1.createPaginationQuery)(pagination)
},
scope: 'user:read:broadcast'
});
return {
data: (0, shared_utils_1.flatten)(result.data.map(HelixStreamApi_1._mapGetStreamMarkersResult.bind(this._client))),
cursor: (_a = result.pagination) === null || _a === void 0 ? void 0 : _a.cursor
};
}
_getStreamMarkersPaginated(queryType, id) {
return new HelixPaginatedRequest_1.HelixPaginatedRequest({
url: 'streams/markers',
query: {
[queryType]: id
},
scope: 'user:read:broadcast'
}, this._client, HelixStreamApi_1._mapGetStreamMarkersResult.bind(this._client));
}
static _mapGetStreamMarkersResult(data) {
return data.videos.reduce((result, video) => [
...result,
...video.markers.map(marker => new HelixStreamMarkerWithVideo_1.HelixStreamMarkerWithVideo(marker, video.video_id, client))
...video.markers.map(marker => new HelixStreamMarkerWithVideo_1.HelixStreamMarkerWithVideo(marker, video.video_id, this))
], []);

@@ -288,0 +292,0 @@ }

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixStreamMarkerData } from '../../../interfaces/helix/stream.external';

@@ -8,5 +8,5 @@ /**

export declare class HelixStreamMarker extends DataObject<HelixStreamMarkerData> {
/** @private */ protected readonly _client: BaseApiClient;
/** @private */ protected readonly _client: ApiClient;
/** @private */
constructor(data: HelixStreamMarkerData, client: BaseApiClient);
constructor(data: HelixStreamMarkerData, client: ApiClient);
/**

@@ -13,0 +13,0 @@ * The ID of the marker.

import { rawDataSymbol } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixStreamMarkerVideoData } from '../../../interfaces/helix/stream.external';

@@ -15,3 +15,3 @@ import type { HelixVideo } from '../video/HelixVideo';

/** @private */
constructor(data: HelixStreamMarkerVideoData, _videoId: string, client: BaseApiClient);
constructor(data: HelixStreamMarkerVideoData, _videoId: string, client: ApiClient);
/**

@@ -26,3 +26,3 @@ * The URL of the video, which will start playing at the position of the stream marker.

/**
* Gets the video data of the video the marker was set in.
* Retrieves the video data of the video the marker was set in.
*/

@@ -29,0 +29,0 @@ getVideo(): Promise<HelixVideo>;

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

/**
* Gets the video data of the video the marker was set in.
* Retrieves the video data of the video the marker was set in.
*/
async getVideo() {
return (0, common_1.checkRelationAssertion)(await this._client.videos.getVideoById(this._videoId));
return (await this._client.videos.getVideoById(this._videoId));
}

@@ -37,0 +37,0 @@ };

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

import { type UserIdResolvable } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixPaginatedSubscriptionsResponse, type HelixSubscriptionData } from '../../../interfaces/helix/subscription.external';

@@ -16,5 +15,5 @@ import { HelixPaginatedRequestWithTotal } from '../HelixPaginatedRequestWithTotal';

/** @private */
constructor(broadcaster: UserIdResolvable, client: BaseApiClient);
constructor(query: Record<string, string>, client: ApiClient);
/**
* Gets the total sub points of the broadcaster.
* Retrieves and returns the total sub points of the broadcaster.
*/

@@ -21,0 +20,0 @@ getPoints(): Promise<number>;

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

const tslib_1 = require("tslib");
const api_call_1 = require("@twurple/api-call");
const common_1 = require("@twurple/common");

@@ -18,12 +17,11 @@ const HelixPaginatedRequestWithTotal_1 = require("../HelixPaginatedRequestWithTotal");

/** @private */
constructor(broadcaster, client) {
constructor(query, client) {
super({
url: 'subscriptions',
scopes: ['channel:read:subscriptions'],
userId: (0, common_1.extractUserId)(broadcaster),
query: (0, api_call_1.createBroadcasterQuery)(broadcaster)
scope: 'channel:read:subscriptions',
query
}, client, data => new HelixSubscription_1.HelixSubscription(data, client));
}
/**
* Gets the total sub points of the broadcaster.
* Retrieves and returns the total sub points of the broadcaster.
*/

@@ -30,0 +28,0 @@ async getPoints() {

@@ -25,3 +25,3 @@ import { rawDataSymbol } from '@twurple/common';

/**
* Gets more information about the broadcaster.
* Retrieves more information about the broadcaster.
*/

@@ -32,15 +32,15 @@ getBroadcaster(): Promise<HelixUser>;

*/
get gifterId(): string | null;
get gifterId(): string;
/**
* The name of the gifter.
*/
get gifterName(): string | null;
get gifterName(): string;
/**
* The display name of the gifter.
*/
get gifterDisplayName(): string | null;
get gifterDisplayName(): string;
/**
* Gets more information about the gifter.
* Retrieves more information about the gifter.
*/
getGifter(): Promise<HelixUser | null>;
getGifter(): Promise<HelixUser>;
/**

@@ -59,3 +59,3 @@ * The user ID of the subscribed user.

/**
* Gets more information about the subscribed user.
* Retrieves more information about the subscribed user.
*/

@@ -62,0 +62,0 @@ getUser(): Promise<HelixUser>;

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

/**
* Gets more information about the broadcaster.
* Retrieves more information about the broadcaster.
*/
async getBroadcaster() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].broadcaster_id));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].broadcaster_id));
}

@@ -42,3 +42,3 @@ /**

get gifterId() {
return this[common_1.rawDataSymbol].is_gift ? this[common_1.rawDataSymbol].gifter_id : null;
return this[common_1.rawDataSymbol].gifter_id;
}

@@ -49,3 +49,3 @@ /**

get gifterName() {
return this[common_1.rawDataSymbol].is_gift ? this[common_1.rawDataSymbol].gifter_login : null;
return this[common_1.rawDataSymbol].gifter_login;
}

@@ -56,11 +56,9 @@ /**

get gifterDisplayName() {
return this[common_1.rawDataSymbol].is_gift ? this[common_1.rawDataSymbol].gifter_name : null;
return this[common_1.rawDataSymbol].gifter_name;
}
/**
* Gets more information about the gifter.
* Retrieves more information about the gifter.
*/
async getGifter() {
return this[common_1.rawDataSymbol].is_gift
? (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].gifter_id))
: null;
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].gifter_id));
}

@@ -86,6 +84,6 @@ /**

/**
* Gets more information about the subscribed user.
* Retrieves more information about the subscribed user.
*/
async getUser() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].user_id));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].user_id));
}

@@ -92,0 +90,0 @@ };

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

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const subscription = await api.subscriptions.getSubscriptionForUser('61369223', '125328655');

@@ -25,3 +25,3 @@ * ```

/**
* Gets a list of all subscriptions to a given broadcaster.
* Retrieves a list of all subscriptions to a given broadcaster.
*

@@ -41,3 +41,3 @@ * @param broadcaster The broadcaster to list subscriptions to.

/**
* Gets the subset of the given user list that is subscribed to the given broadcaster.
* Retrieves the subset of the given user list that is subscribed to the given broadcaster.
*

@@ -49,3 +49,3 @@ * @param broadcaster The broadcaster to find subscriptions to.

/**
* Gets the subscription data for a given user to a given broadcaster.
* Retrieves the subscription data for a given user to a given broadcaster.
*

@@ -52,0 +52,0 @@ * This checks with the authorization of a broadcaster.

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

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const subscription = await api.subscriptions.getSubscriptionForUser('61369223', '125328655');

@@ -32,3 +32,3 @@ * ```

/**
* Gets a list of all subscriptions to a given broadcaster.
* Retrieves a list of all subscriptions to a given broadcaster.
*

@@ -43,5 +43,4 @@ * @param broadcaster The broadcaster to list subscriptions to.

url: 'subscriptions',
scopes: ['channel:read:subscriptions'],
scope: 'channel:read:subscriptions',
type: 'helix',
userId: (0, common_1.extractUserId)(broadcaster),
query: {

@@ -63,6 +62,6 @@ ...(0, api_call_1.createBroadcasterQuery)(broadcaster),

getSubscriptionsPaginated(broadcaster) {
return new HelixPaginatedSubscriptionsRequest_1.HelixPaginatedSubscriptionsRequest(broadcaster, this._client);
return new HelixPaginatedSubscriptionsRequest_1.HelixPaginatedSubscriptionsRequest((0, api_call_1.createBroadcasterQuery)(broadcaster), this._client);
}
/**
* Gets the subset of the given user list that is subscribed to the given broadcaster.
* Retrieves the subset of the given user list that is subscribed to the given broadcaster.
*

@@ -74,6 +73,5 @@ * @param broadcaster The broadcaster to find subscriptions to.

const result = await this._client.callApi({
url: 'subscriptions',
scope: 'channel:read:subscriptions',
type: 'helix',
url: 'subscriptions',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['channel:read:subscriptions'],
query: (0, generic_external_1.createChannelUsersCheckQuery)(broadcaster, users)

@@ -84,3 +82,3 @@ });

/**
* Gets the subscription data for a given user to a given broadcaster.
* Retrieves the subscription data for a given user to a given broadcaster.
*

@@ -111,4 +109,3 @@ * This checks with the authorization of a broadcaster.

url: 'subscriptions/user',
userId: (0, common_1.extractUserId)(user),
scopes: ['user:read:subscriptions'],
scope: 'user:read:subscriptions',
query: (0, subscription_external_1.createSubscriptionCheckQuery)(broadcaster, user)

@@ -115,0 +112,0 @@ });

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixUserSubscriptionData } from '../../../interfaces/helix/subscription.external';

@@ -9,5 +9,5 @@ import type { HelixUser } from '../user/HelixUser';

export declare class HelixUserSubscription extends DataObject<HelixUserSubscriptionData> {
/** @private */ protected readonly _client: BaseApiClient;
/** @private */ protected readonly _client: ApiClient;
/** @private */
constructor(data: HelixUserSubscriptionData, client: BaseApiClient);
constructor(data: HelixUserSubscriptionData, client: ApiClient);
/**

@@ -26,3 +26,3 @@ * The user ID of the broadcaster.

/**
* Gets more information about the broadcaster.
* Retrieves more information about the broadcaster.
*/

@@ -29,0 +29,0 @@ getBroadcaster(): Promise<HelixUser | null>;

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

/**
* Gets more information about the broadcaster.
* Retrieves more information about the broadcaster.
*/

@@ -38,0 +38,0 @@ async getBroadcaster() {

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixTeamData } from '../../../interfaces/helix/team.external';

@@ -9,5 +9,5 @@ import type { HelixUserRelation } from '../relations/HelixUserRelation';

export declare class HelixTeam extends DataObject<HelixTeamData> {
/** @private */ protected readonly _client: BaseApiClient;
/** @private */ protected readonly _client: ApiClient;
/** @private */
constructor(data: HelixTeamData, client: BaseApiClient);
constructor(data: HelixTeamData, client: ApiClient);
/**

@@ -52,3 +52,3 @@ * The ID of the team.

/**
* Gets the relations to the members of the team.
* Retrieves the relations to the members of the team.
*/

@@ -55,0 +55,0 @@ getUserRelations(): Promise<HelixUserRelation[]>;

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

/**
* Gets the relations to the members of the team.
* Retrieves the relations to the members of the team.
*/

@@ -76,0 +76,0 @@ async getUserRelations() {

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

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const tags = await api.teams.getChannelTeams('125328655');

@@ -22,9 +22,9 @@ * ```

/**
* Gets a list of all teams a broadcaster is a member of.
* Retrieves a list of all teams a broadcaster is a member of.
*
* @param broadcaster The broadcaster to get the teams of.
* @param broadcaster The broadcaster to retrieve the teams of.
*/
getTeamsForBroadcaster(broadcaster: UserIdResolvable): Promise<HelixTeam[]>;
/**
* Gets a team by ID.
* Retrieves a team by ID.
*

@@ -37,3 +37,3 @@ * Returns null if there is no team with the given ID.

/**
* Gets a team by name.
* Retrieves a team by name.
*

@@ -40,0 +40,0 @@ * Returns null if there is no team with the given name.

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

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const tags = await api.teams.getChannelTeams('125328655');

@@ -27,5 +27,5 @@ * ```

/**
* Gets a list of all teams a broadcaster is a member of.
* Retrieves a list of all teams a broadcaster is a member of.
*
* @param broadcaster The broadcaster to get the teams of.
* @param broadcaster The broadcaster to retrieve the teams of.
*/

@@ -37,3 +37,2 @@ async getTeamsForBroadcaster(broadcaster) {

url: 'teams/channel',
userId: (0, common_1.extractUserId)(broadcaster),
query: (0, api_call_1.createBroadcasterQuery)(broadcaster)

@@ -44,3 +43,3 @@ });

/**
* Gets a team by ID.
* Retrieves a team by ID.
*

@@ -71,3 +70,3 @@ * Returns null if there is no team with the given ID.

/**
* Gets a team by name.
* Retrieves a team by name.
*

@@ -74,0 +73,0 @@ * Returns null if there is no team with the given name.

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixFollowData } from '../../../interfaces/helix/user.external';

@@ -11,3 +11,3 @@ import type { HelixUser } from './HelixUser';

/** @private */
constructor(data: HelixFollowData, client: BaseApiClient);
constructor(data: HelixFollowData, client: ApiClient);
/**

@@ -26,3 +26,3 @@ * The user ID of the following user.

/**
* Gets the data of the following user.
* Retrieves the data of the following user.
*/

@@ -43,3 +43,3 @@ getUser(): Promise<HelixUser>;

/**
* Gets the data of the followed broadcaster.
* Retrieves the data of the followed broadcaster.
*/

@@ -46,0 +46,0 @@ getFollowedUser(): Promise<HelixUser>;

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

/**
* Gets the data of the following user.
* Retrieves the data of the following user.
*/
async getUser() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].from_id));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].from_id));
}

@@ -60,6 +60,6 @@ /**

/**
* Gets the data of the followed broadcaster.
* Retrieves the data of the followed broadcaster.
*/
async getFollowedUser() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].to_id));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].to_id));
}

@@ -66,0 +66,0 @@ /**

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

async setDescription(description) {
return await this._client.users.updateAuthenticatedUser(this, { description });
return await this._client.users.updateUser({ description });
}

@@ -28,0 +28,0 @@ };

import type { HelixUserType, UserIdResolvable, UserIdResolvableType, UserNameResolveableType } from '@twurple/common';
import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import { type HelixBroadcasterType, type HelixUserData } from '../../../interfaces/helix/user.external';
import type { ApiClient } from '../../../ApiClient';
import { type HelixUserData } from '../../../interfaces/helix/user.external';
import type { HelixPaginatedResultWithTotal } from '../HelixPaginatedResult';

@@ -13,5 +13,5 @@ import type { HelixStream } from '../stream/HelixStream';

export declare class HelixUser extends DataObject<HelixUserData> implements UserIdResolvableType, UserNameResolveableType {
/** @private */ protected readonly _client: BaseApiClient;
/** @private */ protected readonly _client: ApiClient;
/** @private */
constructor(data: HelixUserData, client: BaseApiClient);
constructor(data: HelixUserData, client: ApiClient);
/** @private */

@@ -40,5 +40,5 @@ get cacheKey(): string;

/**
* The type of the broadcaster.
* The type of the user.
*/
get broadcasterType(): HelixBroadcasterType;
get broadcasterType(): string;
/**

@@ -53,2 +53,8 @@ * The URL of the profile picture of the user.

/**
* The total number of views of the user's channel.
*
* @deprecated This contains stale data, as Twitch stopped counting on 2022-06-06.
*/
get views(): number;
/**
* The date when the user was created, i.e. when they registered on Twitch.

@@ -58,17 +64,12 @@ */

/**
* Gets the channel's stream data.
* Retrieves the channel's stream data.
*/
getStream(): Promise<HelixStream | null>;
/**
* Gets a list of broadcasters the user follows.
*
* @deprecated Use {@link HelixChannelApi#getFollowedChannels} instead.
* Retrieves a list of broadcasters the user follows.
*/
getFollows(): Promise<HelixPaginatedResultWithTotal<HelixFollow>>;
/**
* Gets the follow data of the given user to the broadcaster.
* Retrieves the follow data of the given user to the broadcaster.
*
* @deprecated Use {@link HelixChannelApi#getChannelFollowers}
* or {@link HelixChannelApi#getFollowedChannels} instead.
*
* @param user The user to check the follow from.

@@ -78,7 +79,4 @@ */

/**
* Gets the follow data of the user to the given broadcaster.
* Retrieves 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.

@@ -90,5 +88,2 @@ */

*
* @deprecated Use {@link HelixChannelApi#getChannelFollowers}
* or {@link HelixChannelApi#getFollowedChannels} instead.
*
* @param broadcaster The broadcaster to check the user's follow to.

@@ -100,5 +95,2 @@ */

*
* @deprecated Use {@link HelixChannelApi#getChannelFollowers}
* or {@link HelixChannelApi#getFollowedChannels} instead.
*
* @param user The user to check the broadcaster's follow from.

@@ -108,3 +100,3 @@ */

/**
* Gets the subscription data for the user to the given broadcaster, or `null` if the user is not subscribed.
* Retrieves the subscription data for the user to the given broadcaster, or `null` if the user is not subscribed.
*

@@ -111,0 +103,0 @@ * @param broadcaster The broadcaster you want to get the subscription data for.

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

/**
* The type of the broadcaster.
* The type of the user.
*/

@@ -70,2 +70,10 @@ get broadcasterType() {

/**
* The total number of views of the user's channel.
*
* @deprecated This contains stale data, as Twitch stopped counting on 2022-06-06.
*/
get views() {
return this[common_1.rawDataSymbol].view_count;
}
/**
* The date when the user was created, i.e. when they registered on Twitch.

@@ -77,3 +85,3 @@ */

/**
* Gets the channel's stream data.
* Retrieves the channel's stream data.
*/

@@ -84,5 +92,3 @@ async getStream() {

/**
* Gets a list of broadcasters the user follows.
*
* @deprecated Use {@link HelixChannelApi#getFollowedChannels} instead.
* Retrieves a list of broadcasters the user follows.
*/

@@ -93,7 +99,4 @@ async getFollows() {

/**
* Gets the follow data of the given user to the broadcaster.
* Retrieves the follow data of the given user to the broadcaster.
*
* @deprecated Use {@link HelixChannelApi#getChannelFollowers}
* or {@link HelixChannelApi#getFollowedChannels} instead.
*
* @param user The user to check the follow from.

@@ -105,7 +108,4 @@ */

/**
* Gets the follow data of the user to the given broadcaster.
* Retrieves 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.

@@ -119,5 +119,2 @@ */

*
* @deprecated Use {@link HelixChannelApi#getChannelFollowers}
* or {@link HelixChannelApi#getFollowedChannels} instead.
*
* @param broadcaster The broadcaster to check the user's follow to.

@@ -131,5 +128,2 @@ */

*
* @deprecated Use {@link HelixChannelApi#getChannelFollowers}
* or {@link HelixChannelApi#getFollowedChannels} instead.
*
* @param user The user to check the broadcaster's follow from.

@@ -141,3 +135,3 @@ */

/**
* Gets the subscription data for the user to the given broadcaster, or `null` if the user is not subscribed.
* Retrieves the subscription data for the user to the given broadcaster, or `null` if the user is not subscribed.
*

@@ -144,0 +138,0 @@ * @param broadcaster The broadcaster you want to get the subscription data for.

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

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const user = await api.users.getUserById('125328655');

@@ -33,3 +33,3 @@ * ```

/**
* Gets the user data for the given list of user IDs.
* Retrieves the user data for the given list of user IDs.
*

@@ -40,9 +40,9 @@ * @param userIds The user IDs you want to look up.

/**
* Gets the user data for the given list of usernames.
* Retrieves the user data for the given list of user names.
*
* @param userNames The usernames you want to look up.
* @param userNames The user names you want to look up.
*/
getUsersByNames(userNames: UserNameResolvable[]): Promise<HelixUser[]>;
/**
* Gets the user data for the given user ID.
* Retrieves the user data for the given user ID.
*

@@ -53,27 +53,22 @@ * @param user The user ID you want to look up.

/**
* Gets the user data for the given username.
* Retrieves the user data for the given user name.
*
* @param userName The username you want to look up.
* @param userName The user name you want to look up.
*/
getUserByName(userName: UserNameResolvable): Promise<HelixUser | null>;
/**
* Gets the user data of the given authenticated user.
* Retrieves the user data of the currently authenticated user.
*
* @param user The user to get data for.
* @param withEmail Whether you need the user's email address.
*/
getAuthenticatedUser(user: UserIdResolvable, withEmail?: boolean): Promise<HelixPrivilegedUser>;
getMe(withEmail?: boolean): Promise<HelixPrivilegedUser>;
/**
* Updates the given authenticated user's data.
* Updates the currently authenticated user's data.
*
* @param user The user to update.
* @param data The data to update.
*/
updateAuthenticatedUser(user: UserIdResolvable, data: HelixUserUpdate): Promise<HelixPrivilegedUser>;
updateUser(data: HelixUserUpdate): Promise<HelixPrivilegedUser>;
/**
* Gets a list of follow relations.
* Retrieves a list of follow relations.
*
* @deprecated Use {@link HelixChannelApi#getChannelFollowers}
* or {@link HelixChannelApi#getFollowedChannels} instead.
*
* @param filter

@@ -87,5 +82,2 @@ *

*
* @deprecated Use {@link HelixChannelApi#getChannelFollowersPaginated}
* or {@link HelixChannelApi#getFollowedChannelsPaginated} instead.
*
* @param filter

@@ -97,9 +89,6 @@ *

/**
* Gets the follow relation bewteen a given user and a given broadcaster.
* Retrieves the follow relation bewteen a given user and a given broadcaster.
*
* @deprecated Use {@link HelixChannelApi#getChannelFollowers}
* or {@link HelixChannelApi#getFollowedChannels} instead.
*
* @param user The user to get the follow relation for.
* @param broadcaster The broadcaster to get the follow relation for.
* @param user The user to retrieve the follow relation for.
* @param broadcaster The broadcaster to retrieve the follow relation for.
*/

@@ -110,5 +99,2 @@ getFollowFromUserToBroadcaster(user: UserIdResolvable, broadcaster: UserIdResolvable): Promise<HelixFollow | null>;

*
* @deprecated Use {@link HelixChannelApi#getChannelFollowers}
* or {@link HelixChannelApi#getFollowedChannels} instead.
*
* @param user The user to check the follow for.

@@ -119,5 +105,5 @@ * @param broadcaster The broadcaster to check the follow for.

/**
* Gets a list of users blocked by the given user.
* Retrieves a list of users blocked by the given user.
*
* @param user The user to get blocks for.
* @param user The user to retrieve blocks for.
* @param pagination

@@ -131,3 +117,3 @@ *

*
* @param user The user to get blocks for.
* @param user The user to retrieve blocks for.
*/

@@ -138,3 +124,2 @@ getBlocksPaginated(user: UserIdResolvable): HelixPaginatedRequest<HelixUserBlockData, HelixUserBlock>;

*
* @param broadcaster The user to add the block to.
* @param target The user to block.

@@ -145,28 +130,24 @@ * @param additionalInfo Additional info to give context to the block.

*/
createBlock(broadcaster: UserIdResolvable, target: UserIdResolvable, additionalInfo?: HelixUserBlockAdditionalInfo): Promise<void>;
createBlock(target: UserIdResolvable, additionalInfo?: HelixUserBlockAdditionalInfo): Promise<void>;
/**
* Unblocks the given user.
*
* @param broadcaster The user to remove the block from.
* @param target The user to unblock.
*/
deleteBlock(broadcaster: UserIdResolvable, target: UserIdResolvable): Promise<void>;
deleteBlock(target: UserIdResolvable): Promise<void>;
/**
* Gets a list of all extensions for the given authenticated user.
*
* @param broadcaster The broadcaster to get the list of extensions for.
* @param withInactive Whether to include inactive extensions.
* Retrieves a list of all extensions for the authenticated user.
*/
getExtensionsForAuthenticatedUser(broadcaster: UserIdResolvable, withInactive?: boolean): Promise<HelixUserExtension[]>;
getMyExtensions(): Promise<HelixUserExtension[]>;
/**
* Gets a list of all installed extensions for the given user.
* Retrieves a list of all installed extensions for the given user.
*
* @param user The user to get the installed extensions for.
* @param withDev Whether to include extensions that are in development.
*
* If not given, get the installed extensions for the authenticated user.
*/
getActiveExtensions(user: UserIdResolvable, withDev?: boolean): Promise<HelixInstalledExtensionList>;
getActiveExtensions(user?: UserIdResolvable): Promise<HelixInstalledExtensionList>;
/**
* Updates the installed extensions for the given authenticated user.
* Updates the installed extensions for the authenticated user.
*
* @param broadcaster The user to update the installed extensions for.
* @param data The extension installation payload.

@@ -177,3 +158,3 @@ *

*/
updateActiveExtensionsForAuthenticatedUser(broadcaster: UserIdResolvable, data: HelixUserExtensionUpdatePayload): Promise<HelixInstalledExtensionList>;
updateMyActiveExtensions(data: HelixUserExtensionUpdatePayload): Promise<HelixInstalledExtensionList>;
private static _makeFollowsQuery;

@@ -180,0 +161,0 @@ private _getUsers;

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

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const user = await api.users.getUserById('125328655');

@@ -39,3 +39,3 @@ * ```

/**
* Gets the user data for the given list of user IDs.
* Retrieves the user data for the given list of user IDs.
*

@@ -48,5 +48,5 @@ * @param userIds The user IDs you want to look up.

/**
* Gets the user data for the given list of usernames.
* Retrieves the user data for the given list of user names.
*
* @param userNames The usernames you want to look up.
* @param userNames The user names you want to look up.
*/

@@ -57,3 +57,3 @@ async getUsersByNames(userNames) {

/**
* Gets the user data for the given user ID.
* Retrieves the user data for the given user ID.
*

@@ -63,17 +63,9 @@ * @param user The user ID you want to look up.

async getUserById(user) {
const userId = (0, common_1.extractUserId)(user);
const result = await this._client.callApi({
type: 'helix',
url: 'users',
userId,
query: {
id: userId
}
});
return (0, shared_utils_1.mapNullable)(result.data[0], data => new HelixUser_1.HelixUser(data, this._client));
const users = await this._getUsers('id', [(0, common_1.extractUserId)(user)]);
return users.length ? users[0] : null;
}
/**
* Gets the user data for the given username.
* Retrieves the user data for the given user name.
*
* @param userName The username you want to look up.
* @param userName The user name you want to look up.
*/

@@ -85,8 +77,7 @@ async getUserByName(userName) {

/**
* Gets the user data of the given authenticated user.
* Retrieves the user data of the currently authenticated user.
*
* @param user The user to get data for.
* @param withEmail Whether you need the user's email address.
*/
async getAuthenticatedUser(user, withEmail = false) {
async getMe(withEmail = false) {
var _a;

@@ -96,5 +87,3 @@ const result = await this._client.callApi({

url: 'users',
forceType: 'user',
userId: (0, common_1.extractUserId)(user),
scopes: withEmail ? ['user:read:email'] : undefined
scope: withEmail ? 'user:read:email' : ''
});

@@ -108,8 +97,7 @@ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition

/**
* Updates the given authenticated user's data.
* Updates the currently authenticated user's data.
*
* @param user The user to update.
* @param data The data to update.
*/
async updateAuthenticatedUser(user, data) {
async updateUser(data) {
const result = await this._client.callApi({

@@ -119,4 +107,3 @@ type: 'helix',

method: 'PUT',
userId: (0, common_1.extractUserId)(user),
scopes: ['user:edit'],
scope: 'user:edit',
query: {

@@ -129,7 +116,4 @@ description: data.description

/**
* Gets a list of follow relations.
* Retrieves a list of follow relations.
*
* @deprecated Use {@link HelixChannelApi#getChannelFollowers}
* or {@link HelixChannelApi#getFollowedChannels} instead.
*
* @param filter

@@ -140,10 +124,7 @@ *

async getFollows(filter) {
var _a;
const query = HelixUserApi_1._makeFollowsQuery(filter);
const result = await this._client.callApi({
url: 'users/follows',
type: 'helix',
url: 'users/follows',
userId: (0, common_1.extractUserId)((_a = filter.followedUser) !== null && _a !== void 0 ? _a : filter.user),
query: {
...query,
...HelixUserApi_1._makeFollowsQuery(filter),
...(0, HelixPagination_1.createPaginationQuery)(filter)

@@ -157,5 +138,2 @@ }

*
* @deprecated Use {@link HelixChannelApi#getChannelFollowersPaginated}
* or {@link HelixChannelApi#getFollowedChannelsPaginated} instead.
*
* @param filter

@@ -166,7 +144,5 @@ *

getFollowsPaginated(filter) {
var _a;
const query = HelixUserApi_1._makeFollowsQuery(filter);
return new HelixPaginatedRequestWithTotal_1.HelixPaginatedRequestWithTotal({
url: 'users/follows',
userId: (0, common_1.extractUserId)((_a = filter.followedUser) !== null && _a !== void 0 ? _a : filter.user),
query

@@ -176,9 +152,6 @@ }, this._client, data => new HelixFollow_1.HelixFollow(data, this._client));

/**
* Gets the follow relation bewteen a given user and a given broadcaster.
* Retrieves the follow relation bewteen a given user and a given broadcaster.
*
* @deprecated Use {@link HelixChannelApi#getChannelFollowers}
* or {@link HelixChannelApi#getFollowedChannels} instead.
*
* @param user The user to get the follow relation for.
* @param broadcaster The broadcaster to get the follow relation for.
* @param user The user to retrieve the follow relation for.
* @param broadcaster The broadcaster to retrieve the follow relation for.
*/

@@ -192,5 +165,2 @@ async getFollowFromUserToBroadcaster(user, broadcaster) {

*
* @deprecated Use {@link HelixChannelApi#getChannelFollowers}
* or {@link HelixChannelApi#getFollowedChannels} instead.
*
* @param user The user to check the follow for.

@@ -203,5 +173,5 @@ * @param broadcaster The broadcaster to check the follow for.

/**
* Gets a list of users blocked by the given user.
* Retrieves a list of users blocked by the given user.
*
* @param user The user to get blocks for.
* @param user The user to retrieve blocks for.
* @param pagination

@@ -215,4 +185,3 @@ *

url: 'users/blocks',
userId: (0, common_1.extractUserId)(user),
scopes: ['user:read:blocked_users'],
scope: 'user:read:blocked_users',
query: {

@@ -228,3 +197,3 @@ ...(0, api_call_1.createBroadcasterQuery)(user),

*
* @param user The user to get blocks for.
* @param user The user to retrieve blocks for.
*/

@@ -234,4 +203,3 @@ getBlocksPaginated(user) {

url: 'users/blocks',
userId: (0, common_1.extractUserId)(user),
scopes: ['user:read:blocked_users'],
scope: 'user:read:blocked_users',
query: (0, api_call_1.createBroadcasterQuery)(user)

@@ -243,3 +211,2 @@ }, this._client, data => new HelixUserBlock_1.HelixUserBlock(data, this._client));

*
* @param broadcaster The user to add the block to.
* @param target The user to block.

@@ -250,3 +217,3 @@ * @param additionalInfo Additional info to give context to the block.

*/
async createBlock(broadcaster, target, additionalInfo = {}) {
async createBlock(target, additionalInfo = {}) {
await this._client.callApi({

@@ -256,4 +223,3 @@ type: 'helix',

method: 'PUT',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['user:manage:blocked_users'],
scope: 'user:manage:blocked_users',
query: (0, user_external_1.createUserBlockCreateQuery)(target, additionalInfo)

@@ -265,6 +231,5 @@ });

*
* @param broadcaster The user to remove the block from.
* @param target The user to unblock.
*/
async deleteBlock(broadcaster, target) {
async deleteBlock(target) {
await this._client.callApi({

@@ -274,4 +239,3 @@ type: 'helix',

method: 'DELETE',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['user:manage:blocked_users'],
scope: 'user:manage:blocked_users',
query: (0, user_external_1.createUserBlockDeleteQuery)(target)

@@ -281,13 +245,8 @@ });

/**
* Gets a list of all extensions for the given authenticated user.
*
* @param broadcaster The broadcaster to get the list of extensions for.
* @param withInactive Whether to include inactive extensions.
* Retrieves a list of all extensions for the authenticated user.
*/
async getExtensionsForAuthenticatedUser(broadcaster, withInactive = false) {
async getMyExtensions() {
const result = await this._client.callApi({
type: 'helix',
url: 'users/extensions/list',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: withInactive ? ['user:edit:broadcast'] : ['user:read:broadcast', 'user:edit:broadcast']
url: 'users/extensions/list'
});

@@ -297,15 +256,13 @@ return result.data.map(data => new HelixUserExtension_1.HelixUserExtension(data));

/**
* Gets a list of all installed extensions for the given user.
* Retrieves a list of all installed extensions for the given user.
*
* @param user The user to get the installed extensions for.
* @param withDev Whether to include extensions that are in development.
*
* If not given, get the installed extensions for the authenticated user.
*/
async getActiveExtensions(user, withDev = false) {
const userId = (0, common_1.extractUserId)(user);
async getActiveExtensions(user) {
const result = await this._client.callApi({
type: 'helix',
url: 'users/extensions',
userId,
scopes: withDev ? ['user:read:broadcast', 'user:edit:broadcast'] : undefined,
query: (0, generic_external_1.createSingleKeyQuery)('user_id', userId)
query: (0, generic_external_1.createSingleKeyQuery)('user_id', (0, shared_utils_1.mapOptional)(user, common_1.extractUserId))
});

@@ -315,5 +272,4 @@ return new HelixInstalledExtensionList_1.HelixInstalledExtensionList(result.data);

/**
* Updates the installed extensions for the given authenticated user.
* Updates the installed extensions for the authenticated user.
*
* @param broadcaster The user to update the installed extensions for.
* @param data The extension installation payload.

@@ -324,3 +280,3 @@ *

*/
async updateActiveExtensionsForAuthenticatedUser(broadcaster, data) {
async updateMyActiveExtensions(data) {
const result = await this._client.callApi({

@@ -330,4 +286,2 @@ type: 'helix',

method: 'PUT',
userId: (0, common_1.extractUserId)(broadcaster),
scopes: ['user:edit:broadcast'],
jsonBody: { data }

@@ -334,0 +288,0 @@ });

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixUserBlockData } from '../../../interfaces/helix/user.external';

@@ -11,3 +11,3 @@ import type { HelixUser } from './/HelixUser';

/** @private */
constructor(data: HelixUserBlockData, client: BaseApiClient);
constructor(data: HelixUserBlockData, client: ApiClient);
/**

@@ -26,3 +26,3 @@ * The ID of the blocked user.

/**
* Gets additional information about the blocked user.
* Retrieves additional information about the blocked user.
*/

@@ -29,0 +29,0 @@ getUser(): Promise<HelixUser>;

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

/**
* Gets additional information about the blocked user.
* Retrieves additional information about the blocked user.
*/
async getUser() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].user_id));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].user_id));
}

@@ -41,0 +41,0 @@ };

import { DataObject } from '@twurple/common';
import { type BaseApiClient } from '../../../client/BaseApiClient';
import type { ApiClient } from '../../../ApiClient';
import { type HelixVideoData, type HelixVideoMutedSegmentData, type HelixVideoType } from '../../../interfaces/helix/video.external';

@@ -11,3 +11,3 @@ import type { HelixUser } from '../user/HelixUser';

/** @private */
constructor(data: HelixVideoData, client: BaseApiClient);
constructor(data: HelixVideoData, client: ApiClient);
/**

@@ -30,3 +30,3 @@ * The ID of the video.

/**
* Gets information about the user who created the video.
* Retrieves information about the user who created the video.
*/

@@ -33,0 +33,0 @@ getUser(): Promise<HelixUser>;

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

/**
* Gets information about the user who created the video.
* Retrieves information about the user who created the video.
*/
async getUser() {
return (0, common_1.checkRelationAssertion)(await this._client.users.getUserById(this[common_1.rawDataSymbol].user_id));
return (await this._client.users.getUserById(this[common_1.rawDataSymbol].user_id));
}

@@ -48,0 +48,0 @@ /**

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

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const { data: videos } = await api.videos.getVideosByUser('125328655');

@@ -27,3 +27,3 @@ * ```

/**
* Gets the video data for the given list of video IDs.
* Retrieves the video data for the given list of video IDs.
*

@@ -34,3 +34,3 @@ * @param ids The video IDs you want to look up.

/**
* Gets the video data for the given video ID.
* Retrieves the video data for the given video ID.
*

@@ -41,5 +41,5 @@ * @param id The video ID you want to look up.

/**
* Gets the videos of the given user.
* Retrieves the videos of the given user.
*
* @param user The user you want to get videos from.
* @param user The user you want to retrieve videos from.
* @param filter

@@ -53,3 +53,3 @@ *

*
* @param user The user you want to get videos from.
* @param user The user you want to retrieve videos from.
* @param filter

@@ -61,5 +61,5 @@ *

/**
* Gets the videos of the given game.
* Retrieves the videos of the given game.
*
* @param gameId The game you want to get videos from.
* @param gameId The game you want to retrieve videos from.
* @param filter

@@ -73,3 +73,3 @@ *

*
* @param gameId The game you want to get videos from.
* @param gameId The game you want to retrieve videos from.
* @param filter

@@ -83,6 +83,5 @@ *

*
* @param broadcaster The broadcaster to delete the videos for.
* @param ids The IDs of the videos to delete.
*/
deleteVideosByIds(broadcaster: UserIdResolvable, ids: string[]): Promise<void>;
deleteVideosByIds(ids: string[]): Promise<void>;
private _getVideos;

@@ -89,0 +88,0 @@ private _getVideosPaginated;

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

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* const { data: videos } = await api.videos.getVideosByUser('125328655');

@@ -29,3 +29,3 @@ * ```

/**
* Gets the video data for the given list of video IDs.
* Retrieves the video data for the given list of video IDs.
*

@@ -39,3 +39,3 @@ * @param ids The video IDs you want to look up.

/**
* Gets the video data for the given video ID.
* Retrieves the video data for the given video ID.
*

@@ -49,5 +49,5 @@ * @param id The video ID you want to look up.

/**
* Gets the videos of the given user.
* Retrieves the videos of the given user.
*
* @param user The user you want to get videos from.
* @param user The user you want to retrieve videos from.
* @param filter

@@ -64,3 +64,3 @@ *

*
* @param user The user you want to get videos from.
* @param user The user you want to retrieve videos from.
* @param filter

@@ -75,5 +75,5 @@ *

/**
* Gets the videos of the given game.
* Retrieves the videos of the given game.
*
* @param gameId The game you want to get videos from.
* @param gameId The game you want to retrieve videos from.
* @param filter

@@ -89,3 +89,3 @@ *

*
* @param gameId The game you want to get videos from.
* @param gameId The game you want to retrieve videos from.
* @param filter

@@ -101,6 +101,5 @@ *

*
* @param broadcaster The broadcaster to delete the videos for.
* @param ids The IDs of the videos to delete.
*/
async deleteVideosByIds(broadcaster, ids) {
async deleteVideosByIds(ids) {
await this._client.callApi({

@@ -110,4 +109,3 @@ type: 'helix',

method: 'DELETE',
scopes: ['channel:manage:videos'],
userId: (0, common_1.extractUserId)(broadcaster),
scope: 'channel:manage:videos',
query: {

@@ -123,5 +121,4 @@ id: ids

const result = await this._client.callApi({
url: 'videos',
type: 'helix',
url: 'videos',
userId: filterType === 'user_id' ? filterValues[0] : undefined,
query: {

@@ -137,3 +134,2 @@ ...HelixVideoApi_1._makeVideosQuery(filterType, filterValues, filter),

url: 'videos',
userId: filterType === 'user_id' ? filterValues[0] : undefined,
query: HelixVideoApi_1._makeVideosQuery(filterType, filterValues, filter)

@@ -140,0 +136,0 @@ }, this._client, data => new HelixVideo_1.HelixVideo(data, this._client));

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

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* await api.whispers.sendWhisper('61369223', '86753099', 'Howdy, partner!');

@@ -13,0 +13,0 @@ * ```

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

* ```ts
* const api = new ApiClient({ authProvider });
* const api = new ApiClient(new StaticAuthProvider(clientId, accessToken));
* await api.whispers.sendWhisper('61369223', '86753099', 'Howdy, partner!');

@@ -45,4 +45,3 @@ * ```

method: 'POST',
userId: (0, common_1.extractUserId)(from),
scopes: ['user:manage:whispers'],
scope: 'user:manage:whispers',
query: (0, whisper_external_1.createWhisperQuery)(from, to),

@@ -49,0 +48,0 @@ jsonBody: {

@@ -10,3 +10,3 @@ /**

/**
* The number of leaderboard entries you want to get.
* The number of leaderboard entries you want to retrieve.
*/

@@ -21,3 +21,3 @@ count?: number;

/**
* The time to get the bits leaderboard for.
* The time to retrieve the bits leaderboard for.
*/

@@ -24,0 +24,0 @@ startDate?: Date;

@@ -30,16 +30,2 @@ import { type CommercialLength, type UserIdResolvable } from '@twurple/common';

/** @private */
export interface HelixFollowedChannelData {
broadcaster_id: string;
broadcaster_login: string;
broadcaster_name: string;
followed_at: string;
}
/** @private */
export interface HelixChannelFollowerData {
user_id: string;
user_login: string;
user_name: string;
followed_at: string;
}
/** @private */
export declare function createChannelUpdateBody(data: HelixChannelUpdate): {

@@ -62,12 +48,2 @@ game_id: string | undefined;

};
/** @private */
export declare function createChannelFollowerQuery(broadcaster: UserIdResolvable, user?: UserIdResolvable): {
broadcaster_id: string;
user_id: string | undefined;
};
/** @private */
export declare function createFollowedChannelQuery(user: UserIdResolvable, broadcaster?: UserIdResolvable): {
broadcaster_id: string | undefined;
user_id: string;
};
//# sourceMappingURL=channel.external.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createFollowedChannelQuery = exports.createChannelFollowerQuery = exports.createChannelVipUpdateQuery = exports.createChannelCommercialBody = exports.createChannelUpdateBody = void 0;
const shared_utils_1 = require("@d-fischer/shared-utils");
exports.createChannelVipUpdateQuery = exports.createChannelCommercialBody = exports.createChannelUpdateBody = void 0;
const common_1 = require("@twurple/common");

@@ -34,17 +33,1 @@ /** @private */

exports.createChannelVipUpdateQuery = createChannelVipUpdateQuery;
/** @private */
function createChannelFollowerQuery(broadcaster, user) {
return {
broadcaster_id: (0, common_1.extractUserId)(broadcaster),
user_id: (0, shared_utils_1.mapOptional)(user, common_1.extractUserId)
};
}
exports.createChannelFollowerQuery = createChannelFollowerQuery;
/** @private */
function createFollowedChannelQuery(user, broadcaster) {
return {
broadcaster_id: (0, shared_utils_1.mapOptional)(broadcaster, common_1.extractUserId),
user_id: (0, common_1.extractUserId)(user)
};
}
exports.createFollowedChannelQuery = createFollowedChannelQuery;

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

image_url_4x: string;
title: string;
description: string;
click_action: string | null;
click_url: string | null;
}

@@ -116,8 +112,2 @@ /** @private */

};
/** @private */
export declare function createShoutoutQuery(from: UserIdResolvable, to: UserIdResolvable, moderator: UserIdResolvable): {
from_broadcaster_id: string;
to_broadcaster_id: string;
moderator_id: string;
};
//# sourceMappingURL=chat.external.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createShoutoutQuery = exports.createChatColorUpdateQuery = exports.createChatSettingsUpdateBody = void 0;
exports.createChatColorUpdateQuery = exports.createChatSettingsUpdateBody = void 0;
const common_1 = require("@twurple/common");

@@ -28,10 +28,1 @@ /** @private */

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

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

ids: string | string[];
userId?: string;
}

@@ -40,5 +39,5 @@ /** @private */

/**
* The broadcaster of which you want to create a clip.
* The ID of the broadcaster of which you want to create a clip.
*/
channel: UserIdResolvable;
channelId: UserIdResolvable;
/**

@@ -45,0 +44,0 @@ * Add a delay before the clip creation that accounts for the usual delay in the viewing experience.

import { type HelixPaginatedResponseWithTotal } from '@twurple/api-call';
import { type UserIdResolvable } from '@twurple/common';
import { type HelixEventSubDropEntitlementGrantFilter } from './eventSub.input';
export declare type HelixEventSubSubscriptionStatus = 'enabled' | 'webhook_callback_verification_pending' | 'webhook_callback_verification_failed' | 'websocket_disconnected' | 'notification_failures_exceeded' | 'authorization_revoked' | 'user_removed';

@@ -63,4 +62,2 @@ /** @private */

};
/** @private */
export declare function createEventSubDropEntitlementGrantCondition(filter: HelixEventSubDropEntitlementGrantFilter): Record<string, string | undefined>;
//# sourceMappingURL=eventSub.external.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createEventSubDropEntitlementGrantCondition = exports.createEventSubModeratorCondition = exports.createEventSubRewardCondition = exports.createEventSubBroadcasterCondition = void 0;
exports.createEventSubModeratorCondition = exports.createEventSubRewardCondition = exports.createEventSubBroadcasterCondition = void 0;
const common_1 = require("@twurple/common");

@@ -25,10 +25,1 @@ /** @private */

exports.createEventSubModeratorCondition = createEventSubModeratorCondition;
/** @private */
function createEventSubDropEntitlementGrantCondition(filter) {
return {
organization_id: filter.organizationId,
category_id: filter.categoryId,
campaign_id: filter.campaignId
};
}
exports.createEventSubDropEntitlementGrantCondition = createEventSubDropEntitlementGrantCondition;

@@ -36,19 +36,2 @@ import { type HelixEventSubSubscription } from '../../api/helix/eventSub/HelixEventSubSubscription';

}
/**
* Filters for EventSub drop entitlement grant events.
*/
export interface HelixEventSubDropEntitlementGrantFilter {
/**
* The ID of the organization that owns the categories/games to get events for.
*/
organizationId: string;
/**
* The ID of the category/game to get events for.
*/
categoryId?: string;
/**
* The ID of the campaign to get events for.
*/
campaignId?: string;
}
//# sourceMappingURL=eventSub.input.d.ts.map

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

/** @private */
export declare function createUserQuery(user: UserIdResolvable): {
user_id: string;
};
/** @private */
export declare function createModeratorActionQuery(broadcaster: UserIdResolvable, moderator: UserIdResolvable): {

@@ -30,0 +26,0 @@ broadcaster_id: string;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createChannelUsersCheckQuery = exports.createGetByIdsQuery = exports.createModeratorActionQuery = exports.createUserQuery = exports.createSingleKeyQuery = void 0;
exports.createChannelUsersCheckQuery = exports.createGetByIdsQuery = exports.createModeratorActionQuery = exports.createSingleKeyQuery = void 0;
const common_1 = require("@twurple/common");

@@ -11,9 +11,2 @@ /** @private */

/** @private */
function createUserQuery(user) {
return {
user_id: (0, common_1.extractUserId)(user)
};
}
exports.createUserQuery = createUserQuery;
/** @private */
function createModeratorActionQuery(broadcaster, moderator) {

@@ -20,0 +13,0 @@ return {

import { type UserIdResolvable } from '@twurple/common';
import { type HelixAutoModSettings } from '../../api/helix/moderation/HelixAutoModSettings';
import { type HelixBanFilter, type HelixBanUserRequest, type HelixModeratorFilter } from './moderation.input';
import { type HelixBanFilter, type HelixBanUserRequest } from './moderation.input';
/** @private */

@@ -68,3 +68,3 @@ export interface HelixAutoModSettingsData {

/** @private */
export declare function createModerationUserListQuery(channel: UserIdResolvable, filter?: HelixModeratorFilter | HelixBanFilter): {
export declare function createModerationUserListQuery(channel: UserIdResolvable, filter?: HelixBanFilter): {
broadcaster_id: string;

@@ -71,0 +71,0 @@ user_id: string | string[] | undefined;

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

reason: data.reason,
user_id: (0, common_1.extractUserId)(data.user)
user_id: (0, common_1.extractUserId)(data.userId)
}

@@ -54,0 +54,0 @@ };

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

*/
userId?: string | string[];
userId: string | string[];
}

@@ -25,3 +25,3 @@ /**

*/
userId?: string | string[];
userId: string | string[];
}

@@ -37,2 +37,8 @@ export interface HelixCheckAutoModStatusData {

messageText: string;
/**
* The ID of the sender of the message the AutoMod status needs to be checked for.
*
* @deprecated This is no longer used by Twitch.
*/
userId?: string;
}

@@ -55,4 +61,4 @@ export declare type HelixAutoModSettingsUpdate = Exclude<HelixAutoModSettings, 'broadcasterId' | 'moderatorId'>;

*/
user: UserIdResolvable;
userId: UserIdResolvable;
}
//# sourceMappingURL=moderation.input.d.ts.map

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

duration: number;
bits_voting_enabled: boolean;
bits_per_vote: number;
channel_points_voting_enabled: boolean;

@@ -41,0 +43,0 @@ channel_points_per_vote: number;

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

function createPollBody(broadcaster, data) {
var _a;
var _a, _b;
return {

@@ -14,4 +14,6 @@ broadcaster_id: (0, common_1.extractUserId)(broadcaster),

duration: data.duration,
bits_voting_enabled: data.bitsPerVote != null,
bits_per_vote: (_a = data.bitsPerVote) !== null && _a !== void 0 ? _a : 0,
channel_points_voting_enabled: data.channelPointsPerVote != null,
channel_points_per_vote: (_a = data.channelPointsPerVote) !== null && _a !== void 0 ? _a : 0
channel_points_per_vote: (_b = data.channelPointsPerVote) !== null && _b !== void 0 ? _b : 0
};

@@ -18,0 +20,0 @@ }

@@ -18,2 +18,8 @@ /**

/**
* The number of bits that a vote should cost. If not given, voting with bits will be disabled.
*
* @deprecated Twitch removed this feature.
*/
bitsPerVote?: number;
/**
* The number of channel points that a vote should cost. If not given, voting with channel points will be disabled.

@@ -20,0 +26,0 @@ */

@@ -11,2 +11,3 @@ import { type HelixChannelSearchFilter } from './search.input';

is_live: boolean;
tag_ids: string[];
tags: string[];

@@ -13,0 +14,0 @@ thumbnail_url: string;

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

thumbnail_url: string;
tag_ids: string[] | null;
is_mature: boolean;

@@ -67,7 +68,3 @@ }

};
/** @private */
export declare function createVideoQuery(id: string): {
video_id: string;
};
export {};
//# sourceMappingURL=stream.external.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createVideoQuery = exports.createStreamMarkerBody = exports.createStreamQuery = void 0;
exports.createStreamMarkerBody = exports.createStreamQuery = void 0;
const common_1 = require("@twurple/common");

@@ -24,8 +24,1 @@ /** @private */

exports.createStreamMarkerBody = createStreamMarkerBody;
/** @private */
function createVideoQuery(id) {
return {
video_id: id
};
}
exports.createVideoQuery = createVideoQuery;
import { type UserIdResolvable } from '@twurple/common';
import { type HelixForwardPagination } from '../../api/helix/HelixPagination';
/**
* User data to update using {@link HelixUserApi#updateAuthenticatedUser}}.
* User data to update using {@link HelixUserApi#updateUser}}.
*/

@@ -6,0 +6,0 @@ export interface HelixUserUpdate {

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

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

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

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

"devDependencies": {
"@twurple/auth": "6.2.0-pre.1",
"@twurple/auth": "6.2.0",
"@types/retry": "^0.12.2"
},
"peerDependencies": {
"@twurple/auth": "6.2.0-pre.1"
"@twurple/auth": "6.2.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

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

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

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

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