ensembledata 0.1.1 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/client.js +202 -11
- package/src/version.js +1 -1
- package/types/version.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ensembledata",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Node.js bindings for the EnsembleData API",
|
|
5
5
|
"author": "EnsembleData <hello@ensembledata.com>",
|
|
6
6
|
"contributors": [
|
|
7
|
-
"
|
|
7
|
+
"EnsembleData <hello@ensembledata.com>"
|
|
8
8
|
],
|
|
9
9
|
"homepage": "https://ensembledata.com",
|
|
10
10
|
"repository": {
|
package/src/client.js
CHANGED
|
@@ -613,6 +613,22 @@ class YoutubeEndpoints {
|
|
|
613
613
|
});
|
|
614
614
|
}
|
|
615
615
|
|
|
616
|
+
/**
|
|
617
|
+
* @param {{ channelId: string; depth: number }} params
|
|
618
|
+
* @param {{ extraParams?: Record<string, any>; timeout?: number }} options
|
|
619
|
+
* @returns {Promise<EDResponse>}
|
|
620
|
+
*/
|
|
621
|
+
channelStreams({ channelId, depth }, options = {}) {
|
|
622
|
+
const params = filterUndefinedValues({
|
|
623
|
+
...options.extraParams,
|
|
624
|
+
browseId: channelId,
|
|
625
|
+
depth,
|
|
626
|
+
});
|
|
627
|
+
return this.#requester.get("/youtube/channel/streams", params, {
|
|
628
|
+
timeout: options.timeout,
|
|
629
|
+
});
|
|
630
|
+
}
|
|
631
|
+
|
|
616
632
|
/**
|
|
617
633
|
* @param {{
|
|
618
634
|
* id: string;
|
|
@@ -901,30 +917,20 @@ class InstagramEndpoints {
|
|
|
901
917
|
* @param {{
|
|
902
918
|
* hashtag: string;
|
|
903
919
|
* cursor?: string;
|
|
904
|
-
* chunkSize?: number;
|
|
905
920
|
* getAuthorInfo?: boolean;
|
|
906
|
-
* alternativeMethod?: boolean;
|
|
907
921
|
* }} params
|
|
908
922
|
* @param {{ extraParams?: Record<string, any>; timeout?: number }} options
|
|
909
923
|
* @returns {Promise<EDResponse>}
|
|
910
924
|
*/
|
|
911
925
|
hashtagPosts(
|
|
912
|
-
{
|
|
913
|
-
hashtag,
|
|
914
|
-
cursor = undefined,
|
|
915
|
-
chunkSize = undefined,
|
|
916
|
-
getAuthorInfo = undefined,
|
|
917
|
-
alternativeMethod = undefined,
|
|
918
|
-
},
|
|
926
|
+
{ hashtag, cursor = undefined, getAuthorInfo = undefined },
|
|
919
927
|
options = {},
|
|
920
928
|
) {
|
|
921
929
|
const params = filterUndefinedValues({
|
|
922
930
|
...options.extraParams,
|
|
923
931
|
name: hashtag,
|
|
924
932
|
cursor,
|
|
925
|
-
chunk_size: chunkSize,
|
|
926
933
|
get_author_info: getAuthorInfo,
|
|
927
|
-
alternative_method: alternativeMethod,
|
|
928
934
|
});
|
|
929
935
|
return this.#requester.get("/instagram/hashtag/posts", params, {
|
|
930
936
|
timeout: options.timeout,
|
|
@@ -1064,6 +1070,182 @@ class RedditEndpoints {
|
|
|
1064
1070
|
}
|
|
1065
1071
|
}
|
|
1066
1072
|
|
|
1073
|
+
class TwitterEndpoints {
|
|
1074
|
+
/**
|
|
1075
|
+
* @type {Requester}
|
|
1076
|
+
* @readonly
|
|
1077
|
+
*/
|
|
1078
|
+
#requester;
|
|
1079
|
+
|
|
1080
|
+
/** @param {{ requester: Requester }} options */
|
|
1081
|
+
constructor({ requester }) {
|
|
1082
|
+
this.#requester = requester;
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
/**
|
|
1086
|
+
* @param {{ name: string }} params
|
|
1087
|
+
* @param {{ extraParams?: Record<string, any>; timeout?: number }} options
|
|
1088
|
+
* @returns {Promise<EDResponse>}
|
|
1089
|
+
*/
|
|
1090
|
+
userInfo({ name }, options = {}) {
|
|
1091
|
+
const params = filterUndefinedValues({
|
|
1092
|
+
...options.extraParams,
|
|
1093
|
+
name,
|
|
1094
|
+
});
|
|
1095
|
+
return this.#requester.get("/twitter/user/info", params, {
|
|
1096
|
+
timeout: options.timeout,
|
|
1097
|
+
});
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
/**
|
|
1101
|
+
* @param {{ id: number }} params
|
|
1102
|
+
* @param {{ extraParams?: Record<string, any>; timeout?: number }} options
|
|
1103
|
+
* @returns {Promise<EDResponse>}
|
|
1104
|
+
*/
|
|
1105
|
+
userTweets({ id }, options = {}) {
|
|
1106
|
+
const params = filterUndefinedValues({
|
|
1107
|
+
...options.extraParams,
|
|
1108
|
+
id,
|
|
1109
|
+
});
|
|
1110
|
+
return this.#requester.get("/twitter/user/tweets", params, {
|
|
1111
|
+
timeout: options.timeout,
|
|
1112
|
+
});
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
/**
|
|
1116
|
+
* @param {{ id: number }} params
|
|
1117
|
+
* @param {{ extraParams?: Record<string, any>; timeout?: number }} options
|
|
1118
|
+
* @returns {Promise<EDResponse>}
|
|
1119
|
+
*/
|
|
1120
|
+
postInfo({ id }, options = {}) {
|
|
1121
|
+
const params = filterUndefinedValues({
|
|
1122
|
+
...options.extraParams,
|
|
1123
|
+
id,
|
|
1124
|
+
});
|
|
1125
|
+
return this.#requester.get("/twitter/post/info", params, {
|
|
1126
|
+
timeout: options.timeout,
|
|
1127
|
+
});
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
class ThreadsEndpoints {
|
|
1132
|
+
/**
|
|
1133
|
+
* @type {Requester}
|
|
1134
|
+
* @readonly
|
|
1135
|
+
*/
|
|
1136
|
+
#requester;
|
|
1137
|
+
|
|
1138
|
+
/** @param {{ requester: Requester }} options */
|
|
1139
|
+
constructor({ requester }) {
|
|
1140
|
+
this.#requester = requester;
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
/**
|
|
1144
|
+
* @param {{ name: string; sorting?: "0" | "1" }} params
|
|
1145
|
+
* @param {{ extraParams?: Record<string, any>; timeout?: number }} options
|
|
1146
|
+
* @returns {Promise<EDResponse>}
|
|
1147
|
+
*/
|
|
1148
|
+
searchKeyword({ name, sorting = undefined }, options = {}) {
|
|
1149
|
+
const params = filterUndefinedValues({
|
|
1150
|
+
...options.extraParams,
|
|
1151
|
+
name,
|
|
1152
|
+
sorting,
|
|
1153
|
+
});
|
|
1154
|
+
return this.#requester.get("/threads/keyword/search", params, {
|
|
1155
|
+
timeout: options.timeout,
|
|
1156
|
+
});
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
/**
|
|
1160
|
+
* @param {{ name: string }} params
|
|
1161
|
+
* @param {{ extraParams?: Record<string, any>; timeout?: number }} options
|
|
1162
|
+
* @returns {Promise<EDResponse>}
|
|
1163
|
+
*/
|
|
1164
|
+
userSearch({ name }, options = {}) {
|
|
1165
|
+
const params = filterUndefinedValues({
|
|
1166
|
+
...options.extraParams,
|
|
1167
|
+
name,
|
|
1168
|
+
});
|
|
1169
|
+
return this.#requester.get("/threads/user/search", params, {
|
|
1170
|
+
timeout: options.timeout,
|
|
1171
|
+
});
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
/**
|
|
1175
|
+
* @param {{ id: number }} params
|
|
1176
|
+
* @param {{ extraParams?: Record<string, any>; timeout?: number }} options
|
|
1177
|
+
* @returns {Promise<EDResponse>}
|
|
1178
|
+
*/
|
|
1179
|
+
userInfo({ id }, options = {}) {
|
|
1180
|
+
const params = filterUndefinedValues({
|
|
1181
|
+
...options.extraParams,
|
|
1182
|
+
id,
|
|
1183
|
+
});
|
|
1184
|
+
return this.#requester.get("/threads/user/info", params, {
|
|
1185
|
+
timeout: options.timeout,
|
|
1186
|
+
});
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
/**
|
|
1190
|
+
* @param {{ id: number; chunkSize?: number }} params
|
|
1191
|
+
* @param {{ extraParams?: Record<string, any>; timeout?: number }} options
|
|
1192
|
+
* @returns {Promise<EDResponse>}
|
|
1193
|
+
*/
|
|
1194
|
+
userPosts({ id, chunkSize = undefined }, options = {}) {
|
|
1195
|
+
const params = filterUndefinedValues({
|
|
1196
|
+
...options.extraParams,
|
|
1197
|
+
id,
|
|
1198
|
+
chunk_size: chunkSize,
|
|
1199
|
+
});
|
|
1200
|
+
return this.#requester.get("/threads/user/posts", params, {
|
|
1201
|
+
timeout: options.timeout,
|
|
1202
|
+
});
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
/**
|
|
1206
|
+
* @param {{ id: number }} params
|
|
1207
|
+
* @param {{ extraParams?: Record<string, any>; timeout?: number }} options
|
|
1208
|
+
* @returns {Promise<EDResponse>}
|
|
1209
|
+
*/
|
|
1210
|
+
postReplies({ id }, options = {}) {
|
|
1211
|
+
const params = filterUndefinedValues({
|
|
1212
|
+
...options.extraParams,
|
|
1213
|
+
id,
|
|
1214
|
+
});
|
|
1215
|
+
return this.#requester.get("/threads/post/replies", params, {
|
|
1216
|
+
timeout: options.timeout,
|
|
1217
|
+
});
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
class SnapchatEndpoints {
|
|
1222
|
+
/**
|
|
1223
|
+
* @type {Requester}
|
|
1224
|
+
* @readonly
|
|
1225
|
+
*/
|
|
1226
|
+
#requester;
|
|
1227
|
+
|
|
1228
|
+
/** @param {{ requester: Requester }} options */
|
|
1229
|
+
constructor({ requester }) {
|
|
1230
|
+
this.#requester = requester;
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
/**
|
|
1234
|
+
* @param {{ name: string }} params
|
|
1235
|
+
* @param {{ extraParams?: Record<string, any>; timeout?: number }} options
|
|
1236
|
+
* @returns {Promise<EDResponse>}
|
|
1237
|
+
*/
|
|
1238
|
+
userInfo({ name }, options = {}) {
|
|
1239
|
+
const params = filterUndefinedValues({
|
|
1240
|
+
...options.extraParams,
|
|
1241
|
+
name,
|
|
1242
|
+
});
|
|
1243
|
+
return this.#requester.get("/snapchat/user/info", params, {
|
|
1244
|
+
timeout: options.timeout,
|
|
1245
|
+
});
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1067
1249
|
export class EDClient {
|
|
1068
1250
|
/**
|
|
1069
1251
|
* @type {Requester}
|
|
@@ -1099,6 +1281,15 @@ export class EDClient {
|
|
|
1099
1281
|
|
|
1100
1282
|
/** @readonly */
|
|
1101
1283
|
this.reddit = new RedditEndpoints({ requester });
|
|
1284
|
+
|
|
1285
|
+
/** @readonly */
|
|
1286
|
+
this.twitter = new TwitterEndpoints({ requester });
|
|
1287
|
+
|
|
1288
|
+
/** @readonly */
|
|
1289
|
+
this.threads = new ThreadsEndpoints({ requester });
|
|
1290
|
+
|
|
1291
|
+
/** @readonly */
|
|
1292
|
+
this.snapchat = new SnapchatEndpoints({ requester });
|
|
1102
1293
|
}
|
|
1103
1294
|
|
|
1104
1295
|
/**
|
package/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "0.1.
|
|
1
|
+
export const VERSION = "0.1.5";
|
package/types/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION: "0.1.
|
|
1
|
+
export const VERSION: "0.1.2";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|