Socket
Socket
Sign inDemoInstall

@twurple/api

Package Overview
Dependencies
Maintainers
2
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 5.0.0-pre.6 to 5.0.0-pre.7

22

lib/API/Helix/Clip/HelixClipApi.d.ts

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

import type { HelixPaginatedResult } from '../HelixPaginatedResult';
import type { HelixPagination } from '../HelixPagination';
import type { HelixClipData } from './HelixClip';

@@ -22,12 +23,19 @@ import { HelixClip } from './HelixClip';

endDate?: string;
/**
* The maximum number of results to retrieve. Defaults to 20.
*/
limit?: number;
}
/**
* @inheritDoc
*/
export interface HelixPaginatedClipFilter extends HelixClipFilter, HelixPagination {
}
/** @private */
export interface HelixClipIdFilter extends HelixClipFilter {
export interface HelixClipIdFilterPart {
filterType: HelixClipFilterType;
ids: string | string[];
}
/** @private */
export interface HelixClipIdFilter extends HelixClipFilter, HelixClipIdFilterPart {
}
/** @private */
export interface HelixPaginatedClipIdFilter extends HelixPaginatedClipFilter, HelixClipIdFilterPart {
}
/**

@@ -71,3 +79,3 @@ * Parameters for creating a clip.

*/
getClipsForBroadcaster(user: UserIdResolvable, filter?: HelixClipFilter): Promise<HelixPaginatedResult<HelixClip>>;
getClipsForBroadcaster(user: UserIdResolvable, filter?: HelixPaginatedClipFilter): Promise<HelixPaginatedResult<HelixClip>>;
/**

@@ -90,3 +98,3 @@ * Creates a paginator for the latest clips for the specified broadcaster.

*/
getClipsForGame(gameId: string, filter?: HelixClipFilter): Promise<HelixPaginatedResult<HelixClip>>;
getClipsForGame(gameId: string, filter?: HelixPaginatedClipFilter): Promise<HelixPaginatedResult<HelixClip>>;
/**

@@ -93,0 +101,0 @@ * Creates a paginator for the latest clips for the specified game.

@@ -8,3 +8,3 @@ /**

*/
limit?: string;
limit?: number;
/**

@@ -11,0 +11,0 @@ * A cursor to get the following page of.

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

before,
first: limit
first: limit === null || limit === void 0 ? void 0 : limit.toString()
};
}
exports.makePaginationQuery = makePaginationQuery;

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

const HelixPaginatedResult_1 = require("../HelixPaginatedResult");
const HelixPagination_1 = require("../HelixPagination");
const HelixHypeTrainEvent_1 = require("./HelixHypeTrainEvent");

@@ -30,4 +31,3 @@ /**

*/
async getHypeTrainEventsForBroadcaster(broadcaster, pagination = {}) {
const { after, limit = '20' } = pagination;
async getHypeTrainEventsForBroadcaster(broadcaster, pagination) {
const result = await this._client.callApi({

@@ -39,4 +39,3 @@ type: 'helix',

broadcaster_id: common_1.extractUserId(broadcaster),
after,
first: limit
...HelixPagination_1.makePaginationQuery(pagination)
}

@@ -43,0 +42,0 @@ });

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

*/
async searchCategories(query, pagination = {}) {
async searchCategories(query, pagination) {
const result = await this._client.callApi({

@@ -35,0 +35,0 @@ type: 'helix',

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

* @param user The user to list the stream markers for.
* @param pagination
*
* @expandParams
*/
getStreamMarkersForUser(user: UserIdResolvable): Promise<HelixPaginatedResult<HelixStreamMarker>>;
getStreamMarkersForUser(user: UserIdResolvable, pagination?: HelixPagination): Promise<HelixPaginatedResult<HelixStreamMarker>>;
/**

@@ -111,4 +114,7 @@ * Creates a paginator for all stream markers for an user.

* @param videoId The video to list the stream markers for.
* @param pagination
*
* @expandParams
*/
getStreamMarkersForVideo(videoId: string): Promise<HelixPaginatedResult<HelixStreamMarkerWithVideo>>;
getStreamMarkersForVideo(videoId: string, pagination?: HelixPagination): Promise<HelixPaginatedResult<HelixStreamMarkerWithVideo>>;
/**

@@ -115,0 +121,0 @@ * Creates a paginator for all stream markers for a video.

@@ -91,5 +91,8 @@ "use strict";

* @param user The user to list the stream markers for.
* @param pagination
*
* @expandParams
*/
async getStreamMarkersForUser(user) {
return await this._getStreamMarkers('user_id', common_1.extractUserId(user));
async getStreamMarkersForUser(user, pagination) {
return await this._getStreamMarkers('user_id', common_1.extractUserId(user), pagination);
}

@@ -108,5 +111,8 @@ /**

* @param videoId The video to list the stream markers for.
* @param pagination
*
* @expandParams
*/
async getStreamMarkersForVideo(videoId) {
return await this._getStreamMarkers('video_id', videoId);
async getStreamMarkersForVideo(videoId, pagination) {
return await this._getStreamMarkers('video_id', videoId, pagination);
}

@@ -201,3 +207,3 @@ /**

}
async _getStreamMarkers(queryType, id) {
async _getStreamMarkers(queryType, id, pagination) {
var _a;

@@ -208,3 +214,4 @@ const result = await this._client.callApi({

query: {
[queryType]: id
[queryType]: id,
...HelixPagination_1.makePaginationQuery(pagination)
},

@@ -211,0 +218,0 @@ scope: 'user:read:broadcast'

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

import type { HelixPaginatedResult } from '../HelixPaginatedResult';
import type { HelixForwardPagination } from '../HelixPagination';
import type { HelixSubscriptionData } from './HelixSubscription';

@@ -26,4 +27,7 @@ import { HelixSubscription } from './HelixSubscription';

* @param broadcaster The broadcaster to list subscriptions to.
* @param pagination
*
* @expandParams
*/
getSubscriptions(broadcaster: UserIdResolvable): Promise<HelixPaginatedResult<HelixSubscription>>;
getSubscriptions(broadcaster: UserIdResolvable, pagination?: HelixForwardPagination): Promise<HelixPaginatedResult<HelixSubscription>>;
/**

@@ -53,4 +57,7 @@ * Creates a paginator for all subscriptions to a given broadcaster.

* @param broadcaster The broadcaster to retrieve subscription events for.
* @param pagination
*
* @expandParams
*/
getSubscriptionEventsForBroadcaster(broadcaster: UserIdResolvable): Promise<HelixPaginatedResult<HelixSubscriptionEvent>>;
getSubscriptionEventsForBroadcaster(broadcaster: UserIdResolvable, pagination?: HelixForwardPagination): Promise<HelixPaginatedResult<HelixSubscriptionEvent>>;
/**

@@ -57,0 +64,0 @@ * Creates a paginator for the recent subscription events for a given broadcaster.

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

const HelixPaginatedResult_1 = require("../HelixPaginatedResult");
const HelixPagination_1 = require("../HelixPagination");
const HelixSubscription_1 = require("./HelixSubscription");

@@ -28,4 +29,7 @@ const HelixSubscriptionEvent_1 = require("./HelixSubscriptionEvent");

* @param broadcaster The broadcaster to list subscriptions to.
* @param pagination
*
* @expandParams
*/
async getSubscriptions(broadcaster) {
async getSubscriptions(broadcaster, pagination) {
const result = await this._client.callApi({

@@ -36,3 +40,4 @@ url: 'subscriptions',

query: {
broadcaster_id: common_1.extractUserId(broadcaster)
broadcaster_id: common_1.extractUserId(broadcaster),
...HelixPagination_1.makePaginationQuery(pagination)
}

@@ -88,5 +93,8 @@ });

* @param broadcaster The broadcaster to retrieve subscription events for.
* @param pagination
*
* @expandParams
*/
async getSubscriptionEventsForBroadcaster(broadcaster) {
return await this._getSubscriptionEvents('broadcaster_id', common_1.extractUserId(broadcaster));
async getSubscriptionEventsForBroadcaster(broadcaster, pagination) {
return await this._getSubscriptionEvents('broadcaster_id', common_1.extractUserId(broadcaster), pagination);
}

@@ -117,3 +125,3 @@ /**

}
async _getSubscriptionEvents(by, id) {
async _getSubscriptionEvents(by, id, pagination) {
const result = await this._client.callApi({

@@ -124,3 +132,4 @@ type: 'helix',

query: {
[by]: id
[by]: id,
...HelixPagination_1.makePaginationQuery(pagination)
}

@@ -127,0 +136,0 @@ });

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

*/
async getAllStreamTags(pagination = {}) {
async getAllStreamTags(pagination) {
const result = await this._client.callApi({

@@ -71,4 +71,5 @@ type: 'helix',

async getStreamTagById(id) {
var _a;
const tags = await this.getStreamTagsByIds([id]);
return tags.length ? tags[0] : null;
return (_a = tags[0]) !== null && _a !== void 0 ? _a : null;
}

@@ -75,0 +76,0 @@ };

@@ -51,2 +51,7 @@ import type { UserIdResolvable, UserNameResolvable } from '@twurple/common';

/**
* @inheritDoc
*/
export interface HelixPaginatedFollowFilter extends HelixFollowFilter, HelixForwardPagination {
}
/**
* The Helix API methods that deal with users.

@@ -102,9 +107,13 @@ *

*
* @param filter Several filtering and pagination parameters. See the {@HelixFollowFilter} documentation.
* @param filter
*
* @expandParams
*/
getFollows(filter: HelixFollowFilter): Promise<HelixPaginatedResultWithTotal<HelixFollow>>;
getFollows(filter: HelixPaginatedFollowFilter): Promise<HelixPaginatedResultWithTotal<HelixFollow>>;
/**
* Creates a paginator for follow relations.
*
* @param filter Several filtering and pagination parameters. See the {@HelixFollowFilter} documentation.
* @param filter
*
* @expandParams
*/

@@ -111,0 +120,0 @@ getFollowsPaginated(filter: HelixFollowFilter): HelixPaginatedRequestWithTotal<HelixFollowData, HelixFollow>;

@@ -102,10 +102,14 @@ "use strict";

*
* @param filter Several filtering and pagination parameters. See the {@HelixFollowFilter} documentation.
* @param filter
*
* @expandParams
*/
async getFollows(filter) {
const query = HelixUserApi_1._makeFollowsQuery(filter);
const result = await this._client.callApi({
url: 'users/follows',
type: 'helix',
query
query: {
...HelixUserApi_1._makeFollowsQuery(filter),
...HelixPagination_1.makePaginationQuery(filter)
}
});

@@ -117,3 +121,5 @@ return HelixPaginatedResult_1.createPaginatedResultWithTotal(result, HelixFollow_1.HelixFollow, this._client);

*
* @param filter Several filtering and pagination parameters. See the {@HelixFollowFilter} documentation.
* @param filter
*
* @expandParams
*/

@@ -120,0 +126,0 @@ getFollowsPaginated(filter) {

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

* @param user The user you want to retrieve videos from.
* @param filter Additional filters for the result set.
* @param filter
*
* @expandParams
*/

@@ -76,3 +78,5 @@ getVideosByUser(user: UserIdResolvable, filter?: HelixPaginatedVideoFilter): Promise<HelixPaginatedResult<HelixVideo>>;

* @param user The user you want to retrieve videos from.
* @param filter Additional filters for the result set.
* @param filter
*
* @expandParams
*/

@@ -84,5 +88,7 @@ getVideosByUserPaginated(user: UserIdResolvable, filter?: HelixVideoFilter): HelixPaginatedRequest<HelixVideoData, HelixVideo>;

* @param gameId The game you want to retrieve videos from.
* @param filter Additional filters for the result set.
* @param filter
*
* @expandParams
*/
getVideosByGame(gameId: string, filter?: HelixVideoFilter): Promise<HelixPaginatedResult<HelixVideo>>;
getVideosByGame(gameId: string, filter?: HelixPaginatedVideoFilter): Promise<HelixPaginatedResult<HelixVideo>>;
/**

@@ -92,3 +98,5 @@ * Creates a paginator for videos of the given game.

* @param gameId The game you want to retrieve videos from.
* @param filter Additional filters for the result set.
* @param filter
*
* @expandParams
*/

@@ -95,0 +103,0 @@ getVideosByGamePaginated(gameId: string, filter?: HelixVideoFilter): HelixPaginatedRequest<HelixVideoData, HelixVideo>;

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

* @param user The user you want to retrieve videos from.
* @param filter Additional filters for the result set.
* @param filter
*
* @expandParams
*/

@@ -57,3 +59,5 @@ async getVideosByUser(user, filter = {}) {

* @param user The user you want to retrieve videos from.
* @param filter Additional filters for the result set.
* @param filter
*
* @expandParams
*/

@@ -68,3 +72,5 @@ getVideosByUserPaginated(user, filter = {}) {

* @param gameId The game you want to retrieve videos from.
* @param filter Additional filters for the result set.
* @param filter
*
* @expandParams
*/

@@ -78,3 +84,5 @@ async getVideosByGame(gameId, filter = {}) {

* @param gameId The game you want to retrieve videos from.
* @param filter Additional filters for the result set.
* @param filter
*
* @expandParams
*/

@@ -81,0 +89,0 @@ getVideosByGamePaginated(gameId, filter = {}) {

import type { UserIdResolvable } from '@twurple/common';
import { BaseApi } from '../../BaseApi';
import { HelixPaginatedRequestWithTotal } from '../HelixPaginatedRequestWithTotal';
import type { HelixPaginatedResultWithTotal } from '../HelixPaginatedResult';
import type { HelixForwardPagination } from '../HelixPagination';
import type { HelixWebHookSubscriptionData } from './HelixWebHookSubscription';

@@ -69,4 +71,10 @@ import { HelixWebHookSubscription } from './HelixWebHookSubscription';

*/
getSubscriptions(): Promise<HelixPaginatedRequestWithTotal<HelixWebHookSubscriptionData, HelixWebHookSubscription>>;
getSubscriptions(pagination?: HelixForwardPagination): Promise<HelixPaginatedResultWithTotal<HelixWebHookSubscription>>;
/**
* Creates a paginator for the current WebHook subscriptions for the current client.
*
* Requires an app access token to work; does not work with user tokens.
*/
getSubscriptionsPaginated(): HelixPaginatedRequestWithTotal<HelixWebHookSubscriptionData, HelixWebHookSubscription>;
/**
* Sends an arbitrary request to subscribe to or unsubscribe from an event.

@@ -73,0 +81,0 @@ *

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

const HelixPaginatedRequestWithTotal_1 = require("../HelixPaginatedRequestWithTotal");
const HelixPaginatedResult_1 = require("../HelixPaginatedResult");
const HelixPagination_1 = require("../HelixPagination");
const HelixWebHookSubscription_1 = require("./HelixWebHookSubscription");

@@ -28,3 +30,2 @@ /**

let HelixWebHooksApi = class HelixWebHooksApi extends BaseApi_1.BaseApi {
// TODO rename to getSubscriptionsPaginated and make sync
/**

@@ -35,3 +36,16 @@ * Retrieves the current WebHook subscriptions for the current client.

*/
async getSubscriptions() {
async getSubscriptions(pagination) {
const result = await this._client.callApi({
type: 'helix',
url: 'webhooks/subscriptions',
query: HelixPagination_1.makePaginationQuery(pagination)
});
return HelixPaginatedResult_1.createPaginatedResultWithTotal(result, HelixWebHookSubscription_1.HelixWebHookSubscription, this._client);
}
/**
* Creates a paginator for the current WebHook subscriptions for the current client.
*
* Requires an app access token to work; does not work with user tokens.
*/
getSubscriptionsPaginated() {
return new HelixPaginatedRequestWithTotal_1.HelixPaginatedRequestWithTotal({

@@ -38,0 +52,0 @@ url: 'webhooks/subscriptions'

{
"name": "@twurple/api",
"version": "5.0.0-pre.6",
"version": "5.0.0-pre.7",
"publishConfig": {

@@ -40,8 +40,8 @@ "access": "public"

"@d-fischer/shared-utils": "^3.1.1",
"@twurple/api-call": "^5.0.0-pre.6",
"@twurple/common": "^5.0.0-pre.6",
"@twurple/api-call": "^5.0.0-pre.7",
"@twurple/common": "^5.0.0-pre.7",
"tslib": "^2.0.3"
},
"devDependencies": {
"@twurple/auth": "^5.0.0-pre.6"
"@twurple/auth": "^5.0.0-pre.7"
},

@@ -62,3 +62,3 @@ "peerDependencies": {

},
"gitHead": "ce8b79e0eb955f087a58cb92269de8e0a1f42373"
"gitHead": "e003a6a99d1b8c1636327ca166d40e020b7f1760"
}

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