Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

better-youtube-api

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

better-youtube-api - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

out/types/Banners.js

20

out/entities/channel.js

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

this.commentCount = Number(channel.statistics.commentCount);
this.banners = channel.brandingSettings.image;
// Unknown behavior
/* istanbul ignore next */
if (channel.brandingSettings.channel) {
this.keywords = channel.brandingSettings.channel.keywords ? channel.brandingSettings.channel.keywords.split(' ') : [];
this.featuredChannels = channel.brandingSettings.channel.featuredChannelsUrls ?
channel.brandingSettings.channel.featuredChannelsUrls.map(id => `https://www.youtube.com/channel/${id}`) : [];
}
if (!channel.statistics.hiddenSubscriberCount) {

@@ -39,2 +47,5 @@ this.subCount = Number(channel.statistics.subscriberCount);

this.id = data.id.channelId;
// Impossible to test
/* istanbul ignore next */
this.liveStatus = data.snippet.liveBroadcastContent !== 'none' ? data.snippet.liveBroadcastContent : false;
}

@@ -93,3 +104,3 @@ else {

/**
* Fetches the channels's discussion tab comments and assigns them to Channel#comments.
* Fetches the channel's discussion tab comments and assigns them to Channel#comments.
* @param maxResults The maximum amount of comments to fetch

@@ -112,4 +123,9 @@ */

*/
Channel.part = 'snippet,contentDetails,statistics,status';
Channel.part = 'snippet,contentDetails,statistics,status,brandingSettings';
/**
* The fields to request for this entity.
*/
Channel.fields = 'items(kind,id,contentDetails(relatedPlaylists(uploads)),statistics(subscriberCount,commentCount,viewCount,hiddenSubscriberCount),' +
'snippet(title,description,thumbnails,publishedAt,country,defaultLanguage),brandingSettings(image,channel(keywords,featuredChannelsUrls)),status(isLinked))';
//# sourceMappingURL=channel.js.map

15

out/entities/comment.js

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

};
this.rateable = comment.canRate;
this.popular = comment.likeCount >= 100;
this.likes = comment.likeCount;
this.datePublished = comment.publishedAt;
this.dateEdited = comment.updatedAt;
this.rateable = comment.snippet.canRate;
this.popular = comment.snippet.likeCount >= 100;
this.likes = comment.snippet.likeCount;
this.datePublished = comment.snippet.publishedAt;
this.dateEdited = comment.snippet.updatedAt;
this.parentId = comment.snippet.parentId ? comment.snippet.parentId : comment.snippet.videoId ? comment.snippet.videoId : comment.snippet.channelId;

@@ -80,3 +80,8 @@ if (this.parentId) {

YTComment.part = 'snippet';
/**
* The fields to request for this entity.
*/
YTComment.fields = 'items(kind,id,' +
'snippet(authorDisplayName,authorProfileImageUrl,authorChannelId,authorChannelUrl,textDisplay,textOriginal,parentId,videoId,channelId,canRate,likeCount,publishedAt,updatedAt))';
//# sourceMappingURL=comment.js.map

@@ -71,3 +71,7 @@ "use strict";

Playlist.part = 'snippet,contentDetails,player';
/**
* The fields to request for this entity.
*/
Playlist.fields = 'items(kind,id,snippet(tags,title,channelId,publishedAt,thumbnails),contentDetails(itemCount),player(embedHtml))';
//# sourceMappingURL=playlist.js.map

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

this.shortUrl = `https://youtu.be/${this.id}`;
// Impossible to test
/* istanbul ignore next */
this.liveStatus = data.snippet.liveBroadcastContent !== 'none' ? data.snippet.liveBroadcastContent : false;
return this;

@@ -102,3 +105,8 @@ }

Video.part = 'snippet,contentDetails,statistics,status';
/**
* The fields to request for this entity.
*/
Video.fields = 'items(kind,id,contentDetails(duration),statistics(likeCount,dislikeCount,viewCount),' +
'snippet(title,description,thumbnails,publishedAt,channelId,liveBroadcastContent))';
//# sourceMappingURL=video.js.map

@@ -54,2 +54,11 @@ "use strict";

/**
* Search supported entities on YouTube.
* @param types An array of types to search for. May be a single type or multiple types.
* @param searchTerm What to search for on YouTube.
* @param maxResults The maximum amount of results to find. Defaults to 10.
*/
search(types, searchTerm, maxResults = 10) {
return this._search(types, searchTerm, maxResults);
}
/**
* Search videos on YouTube.

@@ -60,3 +69,3 @@ * @param searchTerm What to search for on YouTube.

searchVideos(searchTerm, maxResults = 10) {
return this.search(entities_1.Video, searchTerm, maxResults);
return this.search([entities_1.Video], searchTerm, maxResults);
}

@@ -69,3 +78,3 @@ /**

searchChannels(searchTerm, maxResults = 10) {
return this.search(entities_1.Channel, searchTerm, maxResults);
return this.search([entities_1.Channel], searchTerm, maxResults);
}

@@ -78,24 +87,33 @@ /**

searchPlaylists(searchTerm, maxResults = 10) {
return this.search(entities_1.Playlist, searchTerm, maxResults);
return this.search([entities_1.Playlist], searchTerm, maxResults);
}
/**
* Get a video object from the ID of a video.
* @param id The ID of the video.
* Get a video object from the URL, ID, or Title of a video.
* @param videoResolvable The URL, ID, or Title of the video.
*/
getVideo(id) {
return this.getItemById(entities_1.Video, id);
getVideo(videoResolvable) {
return __awaiter(this, void 0, void 0, function* () {
const id = yield this.getId(videoResolvable, 'video');
return this.getItemById(entities_1.Video, id);
});
}
/**
* Get a channel object from the ID of a channel.
* @param id The ID of the channel.
* Get a channel object from the Username, URL or ID of a channel.
* @param channelResolvable The Username, URL or ID of the channel.
*/
getChannel(id) {
return this.getItemById(entities_1.Channel, id);
getChannel(channelResolvable) {
return __awaiter(this, void 0, void 0, function* () {
const id = yield this.getId(channelResolvable, 'channel');
return this.getItemById(entities_1.Channel, id);
});
}
/**
* Get a playlist object from the ID of a playlist.
* @param id The ID of the playlist.
* Get a playlist object from the URL, ID, or Title of a playlist.
* @param playlistResolvable The URL, ID, or Title of the playlist.
*/
getPlaylist(id) {
return this.getItemById(entities_1.Playlist, id);
getPlaylist(playlistResolvable) {
return __awaiter(this, void 0, void 0, function* () {
const id = yield this.getId(playlistResolvable, 'playlist');
return this.getItemById(entities_1.Playlist, id);
});
}

@@ -106,9 +124,11 @@ /**

*/
getComment(id) {
return this.getItemById(entities_1.YTComment, id);
getComment(commentId) {
return this.getItemById(entities_1.YTComment, commentId);
}
/**
* @deprecated Use getVideo() instead
* Get a video object from the url of a video.
* @param url The url of the video.
*/
/* istanbul ignore next */
getVideoByUrl(url) {

@@ -122,5 +142,7 @@ const id = util_1.parseUrl(url);

/**
* @deprecated Use getChannel() instead
* Get a channel object from the url of a channel.
* @param url The url of the channel.
*/
/* istanbul ignore next */
getChannelByUrl(url) {

@@ -134,5 +156,7 @@ const id = util_1.parseUrl(url);

/**
* @deprecated Use getPlaylist() instead
* Get a playlist object from the url of a playlist.
* @param url The url of the playlist.
*/
/* istanbul ignore next */
getPlaylistByUrl(url) {

@@ -147,23 +171,32 @@ const id = util_1.parseUrl(url);

* Get `maxResults` videos in a playlist. Used mostly internally with `Playlist#fetchVideos`.
* @param playlistId The ID of the playlist.
* @param playlistResolvable The URL, ID, or Title of the playlist.
* @param maxResults The maximum amount of videos to get from the playlist. If <= 0 or not included, returns all videos in the playlist.
*/
getPlaylistItems(playlistId, maxResults = -1) {
return this.getPaginatedItems('playlistItems', playlistId, maxResults);
getPlaylistItems(playlistResolvable, maxResults = -1) {
return __awaiter(this, void 0, void 0, function* () {
const playlistId = yield this.getId(playlistResolvable, 'playlist');
return this.getPaginatedItems('playlistItems', playlistId, maxResults);
});
}
/**
* Get `maxResults` comments from a video. Used mostly internally with `Video#fetchComments`.
* @param videoId The ID of the video.
* @param videoResolvable The URL, ID, or Title of the video.
* @param maxResults The maximum amount of comments to get from the video. If <= 0 or not included, returns all comments on the video.
*/
getVideoComments(videoId, maxResults = -1) {
return this.getPaginatedItems('commentThreads:video', videoId, maxResults);
getVideoComments(videoResolvable, maxResults = -1) {
return __awaiter(this, void 0, void 0, function* () {
const videoId = yield this.getId(videoResolvable, 'video');
return this.getPaginatedItems('commentThreads:video', videoId, maxResults);
});
}
/**
* Get `maxResults` comments from a channel's discussion tab. Used mostly internally with `Channel#fetchComments`.
* @param channelId The ID of the channel.
* @param channelResolvable The Username, URL, or ID of the channel.
* @param maxResults The maximum amount of comments to get from the channel. If <= 0 or not included, returns all comments on the channel.
*/
getChannelComments(channelId, maxResults = -1) {
return this.getPaginatedItems('commentThreads:channel', channelId, maxResults);
getChannelComments(channelResolvable, maxResults = -1) {
return __awaiter(this, void 0, void 0, function* () {
const channelId = yield this.getId(channelResolvable, 'channel');
return this.getPaginatedItems('commentThreads:channel', channelId, maxResults);
});
}

@@ -179,5 +212,6 @@ /**

/* istanbul ignore next */
search(type, searchTerm, maxResults = 10) {
_search(types, searchTerm, maxResults = 10) {
return __awaiter(this, void 0, void 0, function* () {
const cached = caching_1.Cache.get(`search://${type.endpoint}/"${searchTerm}"/${maxResults}`);
const type = types.map(t => t.endpoint.substring(0, t.endpoint.length - 1)).join(',');
const cached = caching_1.Cache.get(`search://${type}/"${searchTerm}"/${maxResults}`);
if (this._shouldCache && cached) {

@@ -189,14 +223,24 @@ return cached;

}
const fields = 'items(kind,id,snippet(title,description,thumbnails,publishedAt,channelId))';
const results = yield util_1.request.api('search', {
q: encodeURIComponent(searchTerm),
fields: encodeURIComponent(fields),
maxResults,
part: 'snippet',
type: type.endpoint.substring(0, type.endpoint.length - 1)
type
}, this.token, this.tokenType);
const items = [];
results.items.forEach(item => {
items.push(new type(this, item));
if (item.id.videoId) {
items.push(new entities_1.Video(this, item));
}
else if (item.id.channelId) {
items.push(new entities_1.Channel(this, item));
}
else if (item.id.playlistId) {
items.push(new entities_1.Playlist(this, item));
}
});
if (this._shouldCache && this._cacheSearches) {
this._cache(`search://${type.endpoint}/"${searchTerm}"/${maxResults}`, items);
this._cache(`search://${type}/"${searchTerm}"/${maxResults}`, items);
}

@@ -216,3 +260,7 @@ return items;

}
const result = yield util_1.request.api(type.endpoint, { id, part: type.part }, this.token, this.tokenType);
const result = yield util_1.request.api(type.endpoint, {
id,
fields: encodeURIComponent(type.fields),
part: type.part
}, this.token, this.tokenType);
if (result.items.length === 0) {

@@ -323,2 +371,35 @@ return Promise.reject('Item not found');

}
/* istanbul ignore next */
getId(input, type) {
return __awaiter(this, void 0, void 0, function* () {
let id = null;
if (input.includes('youtube.com') || input.includes('youtu.be')) {
const idFromUrl = util_1.parseUrl(input)[type];
// Custom channel URLs don't work that well
if (type === 'channel' && idFromUrl && !idFromUrl.startsWith('UC')) {
id = yield util_1.request.api('search', { q: idFromUrl, type, part: 'id' }, this.token, this.tokenType).then(r => r.items[0] ? r.items[0].id.channelId : undefined);
}
id = idFromUrl;
}
if (id !== null && id !== undefined && id !== '') {
return id;
}
if (type === 'channel' && (!input.startsWith('UC') || input.includes(' '))) {
id = yield util_1.request.api('search', { q: input, type, part: 'id' }, this.token, this.tokenType).then(r => r.items[0] ? r.items[0].id.channelId : undefined);
}
else if (type === 'playlist' && input.includes(' ')) {
id = yield util_1.request.api('search', { q: input, type, part: 'id' }, this.token, this.tokenType).then(r => r.items[0] ? r.items[0].id.playlistId : undefined);
}
else if (type === 'video' && (input.length < 11 || input.includes(' '))) {
id = yield util_1.request.api('search', { q: input, type, part: 'id' }, this.token, this.tokenType).then(r => r.items[0] ? r.items[0].id.videoId : undefined);
}
else {
id = input;
}
if (id === null || id === undefined || id === '') {
return Promise.reject('Item not found');
}
return id;
});
}
}

@@ -325,0 +406,0 @@ exports.YouTube = YouTube;

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

function parseUrl(url) {
url = url.startsWith('https://www.') ? url :
(url.startsWith('www.') ? `https://${url}` :
(url.startsWith('https://') ? `${url.substring(0, 8)}www.${url.substring(8)}` : `https://www.${url}`));
const parsed = url_1.parse(url, true);

@@ -28,4 +31,4 @@ switch (parsed.hostname) {

}
else if (parsed.pathname.startsWith('/channel/')) {
const id = parsed.pathname.replace('/channel/', '');
else if (parsed.pathname.startsWith('/channel/') || parsed.pathname.startsWith('/c/')) {
const id = parsed.pathname.replace('/channel/', '').replace('/c/', '');
if (!id || !idRegex.test(id)) {

@@ -38,2 +41,3 @@ return { video: null, playlist: null, channel: null };

}
case 'www.youtu.be':
case 'youtu.be':

@@ -40,0 +44,0 @@ return { video: /^\/[a-zA-Z0-9-_]+$/.test(parsed.pathname) ? parsed.pathname.slice(1) : null, playlist: null, channel: null };

{
"name": "better-youtube-api",
"version": "2.0.0",
"version": "2.1.0",
"description": "A very easy to use promise-based Youtube Data v3 API.",

@@ -8,3 +8,3 @@ "main": "out/index.js",

"scripts": {
"test": "mocha --exit --require ts-node/register --require source-map-support/register \"./test/!(oauth).spec.ts\"",
"test": "mocha --exit --require ts-node/register/transpile-only --require source-map-support/register --recursive \"./test/!(oauth).spec.ts\"",
"coverage": "nyc yarn test && nyc report --reporter=text-lcov | coveralls",

@@ -30,2 +30,3 @@ "docs": "gulp typedoc",

"@types/chai": "^4.1.4",
"@types/dotenv": "^6.1.1",
"@types/mocha": "^5.2.5",

@@ -35,2 +36,3 @@ "@types/node": "12.6.2",

"coveralls": "^3.0.5",
"dotenv": "^8.1.0",
"fs-nextra": "0.4.5",

@@ -49,8 +51,7 @@ "gulp": "4.0.2",

"typedoc": "0.15.0",
"typescript": "^3.0.1"
"typescript": "^3.6.4"
},
"repository": {
"url": "https://github.com/jasonhaxstuff/better-youtube-api.git"
},
"dependencies": {}
}
}

@@ -7,5 +7,6 @@ # Better YouTube API

[![GitHub license](https://img.shields.io/github/license/jasonhaxstuff/better-youtube-api.svg)](https://github.com/jasonhaxstuff/better-youtube-api/blob/master/LICENSE)
[![Coverage Status](https://coveralls.io/repos/github/jasonhaxstuff/better-youtube-api/badge.svg?branch=master)](https://coveralls.io/github/jasonhaxstuff/better-youtube-api?branch=master)
[![Actions Status](https://github.com/jasonhaxstuff/better-youtube-api/workflows/CI/badge.svg)](https://github.com/jasonhaxstuff/better-youtube-api/actions)
[![Coverage status](https://coveralls.io/repos/github/jasonhaxstuff/better-youtube-api/badge.svg?branch=master)](https://coveralls.io/github/jasonhaxstuff/better-youtube-api?branch=master)
[![Actions status](https://github.com/jasonhaxstuff/better-youtube-api/workflows/CI/badge.svg)](https://github.com/jasonhaxstuff/better-youtube-api/actions)
[![Downloads](https://img.shields.io/npm/dt/better-youtube-api.svg)](https://www.npmjs.com/package/better-youtube-api)
[![Version](https://img.shields.io/npm/v/better-youtube-api.svg)](https://www.npmjs.com/package/better-youtube-api)

@@ -38,11 +39,25 @@ Check out [our website](https://bbothell.me/better-youtube-api)!

### You can do the same thing with playlists, channels, and comments by replacing `Video` with any of them. ###
Get a video by URL:
```js
const video = await youtube.getVideoByUrl('https://youtube.com/watch?v=dQw4w9WgXcQ')
const video = await youtube.getVideo('https://youtube.com/watch?v=dQw4w9WgXcQ')
console.log(video)
```
You can do the same thing with playlists, channels, and comments by replacing `Video` with either one.
Get a video by title (or similar title):
```js
const video = await youtube.getVideo('never gonna give you up')
console.log(video)
```
## Search videos:
```js
const videos = await youtube.searchVideos('never gonna give you up', 12)
console.log(videos) // array of 12 partial video objects
```
Note: This wrapper does not implement every feature of the YouTube API. With a single developer working on it, there just isn't time for everything to be implemented. Some of the objectively most-important features have been added. The limits imposed by the wrapper are not imposed by YouTube.

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

import { YouTube, Playlist, Thumbnail } from '..';
import { YouTube, Playlist, Thumbnail, Banners } from '..';
import { YTComment } from './comment';

@@ -16,2 +16,6 @@ /**

/**
* The fields to request for this entity.
*/
static fields: string;
/**
* The YouTube object that created this channel object.

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

/**
* This channel's banners.
*/
banners: Banners;
/**
* The date this channel was created.

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

/**
* This channel's keywords.
*/
keywords: string[];
/**
* The channel's uploads. Only available after calling `Channel#fetchVideos()`

@@ -92,2 +104,14 @@ */

comments: YTComment[];
/**
* The URLs of all of this channel's featured channels.
*/
featuredChannels: string[];
/**
* Only set if the channel is a search result.
*
* If the channel has an ongoing livestream, this is `live`.
* If the channel has an upcoming livestream, this is `upcoming`.
* If the channel has neither an ongoing nor upcoming livestream, this is `false`.
*/
liveStatus: 'live' | 'upcoming' | false;
constructor(youtube: YouTube, data: any);

@@ -111,3 +135,3 @@ private _init;

/**
* Fetches the channels's discussion tab comments and assigns them to Channel#comments.
* Fetches the channel's discussion tab comments and assigns them to Channel#comments.
* @param maxResults The maximum amount of comments to fetch

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

@@ -12,2 +12,6 @@ import { YouTube } from '..';

/**
* The fields to request for this entity.
*/
static fields: string;
/**
* The YouTube object used to create the comment.

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

@@ -15,2 +15,6 @@ import { YouTube, Video, Thumbnail } from '..';

/**
* The fields to request for this entity.
*/
static fields: string;
/**
* The YouTube object that created this playlist.

@@ -17,0 +21,0 @@ */

@@ -17,2 +17,6 @@ import { YouTube } from '..';

/**
* The fields to request for this entity.
*/
static fields: string;
/**
* YouTube object that created the video.

@@ -99,2 +103,8 @@ */

comments: YTComment[];
/**
* If this is a ongoing livestream, this is `live`.
* If this is an upcoming livestream, this is `upcoming`.
* If this is not a livestream, this is `false`.
*/
liveStatus: 'live' | 'upcoming' | false;
constructor(youtube: YouTube, data: any);

@@ -101,0 +111,0 @@ private _init;

@@ -25,2 +25,9 @@ import { Video, Channel, Playlist, YTComment } from './entities';

/**
* Search supported entities on YouTube.
* @param types An array of types to search for. May be a single type or multiple types.
* @param searchTerm What to search for on YouTube.
* @param maxResults The maximum amount of results to find. Defaults to 10.
*/
search(types: (typeof Video | typeof Channel | typeof Playlist)[], searchTerm: string, maxResults?: number): Promise<(Video | Channel | Playlist)[]>;
/**
* Search videos on YouTube.

@@ -44,16 +51,16 @@ * @param searchTerm What to search for on YouTube.

/**
* Get a video object from the ID of a video.
* @param id The ID of the video.
* Get a video object from the URL, ID, or Title of a video.
* @param videoResolvable The URL, ID, or Title of the video.
*/
getVideo(id: string): Promise<Video>;
getVideo(videoResolvable: string): Promise<Video>;
/**
* Get a channel object from the ID of a channel.
* @param id The ID of the channel.
* Get a channel object from the Username, URL or ID of a channel.
* @param channelResolvable The Username, URL or ID of the channel.
*/
getChannel(id: string): Promise<Channel>;
getChannel(channelResolvable: string): Promise<Channel>;
/**
* Get a playlist object from the ID of a playlist.
* @param id The ID of the playlist.
* Get a playlist object from the URL, ID, or Title of a playlist.
* @param playlistResolvable The URL, ID, or Title of the playlist.
*/
getPlaylist(id: string): Promise<Playlist>;
getPlaylist(playlistResolvable: string): Promise<Playlist>;
/**

@@ -63,4 +70,5 @@ * Get a comment object from the ID of a comment.

*/
getComment(id: string): Promise<YTComment>;
getComment(commentId: string): Promise<YTComment>;
/**
* @deprecated Use getVideo() instead
* Get a video object from the url of a video.

@@ -71,2 +79,3 @@ * @param url The url of the video.

/**
* @deprecated Use getChannel() instead
* Get a channel object from the url of a channel.

@@ -77,2 +86,3 @@ * @param url The url of the channel.

/**
* @deprecated Use getPlaylist() instead
* Get a playlist object from the url of a playlist.

@@ -84,18 +94,18 @@ * @param url The url of the playlist.

* Get `maxResults` videos in a playlist. Used mostly internally with `Playlist#fetchVideos`.
* @param playlistId The ID of the playlist.
* @param playlistResolvable The URL, ID, or Title of the playlist.
* @param maxResults The maximum amount of videos to get from the playlist. If <= 0 or not included, returns all videos in the playlist.
*/
getPlaylistItems(playlistId: string, maxResults?: number): Promise<Video[]>;
getPlaylistItems(playlistResolvable: string, maxResults?: number): Promise<Video[]>;
/**
* Get `maxResults` comments from a video. Used mostly internally with `Video#fetchComments`.
* @param videoId The ID of the video.
* @param videoResolvable The URL, ID, or Title of the video.
* @param maxResults The maximum amount of comments to get from the video. If <= 0 or not included, returns all comments on the video.
*/
getVideoComments(videoId: string, maxResults?: number): Promise<YTComment[]>;
getVideoComments(videoResolvable: string, maxResults?: number): Promise<YTComment[]>;
/**
* Get `maxResults` comments from a channel's discussion tab. Used mostly internally with `Channel#fetchComments`.
* @param channelId The ID of the channel.
* @param channelResolvable The Username, URL, or ID of the channel.
* @param maxResults The maximum amount of comments to get from the channel. If <= 0 or not included, returns all comments on the channel.
*/
getChannelComments(channelId: string, maxResults?: number): Promise<YTComment[]>;
getChannelComments(channelResolvable: string, maxResults?: number): Promise<YTComment[]>;
/**

@@ -107,5 +117,6 @@ * Get `maxResults` replies to a comment. Used mostly internally with `Comment#fetchReplies`.

getCommentReplies(commentId: string, maxResults?: number): Promise<YTComment[]>;
private search;
private _search;
private getItemById;
private getPaginatedItems;
private getId;
}

@@ -112,0 +123,0 @@ declare type YouTubeOptions = {

export * from './Thumbnail';
export * from './ISODuration';
export * from './Banners';
export declare const request: {
api: (subUrl: string, params: Object, token: string, type: "oauth" | "key") => Promise<any>;
api: (subUrl: string, params: Object, token: string, type: "key" | "oauth") => Promise<any>;
post: (subUrl: string, params: Object, token: string, data: any) => Promise<any>;
put: (subUrl: string, params: Object, token: string, data: any) => Promise<any>;
};

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