ensembledata 0.1.1 → 0.1.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ensembledata",
3
- "version": "0.1.1",
3
+ "version": "0.1.4",
4
4
  "description": "Node.js bindings for the EnsembleData API",
5
5
  "author": "EnsembleData <hello@ensembledata.com>",
6
6
  "contributors": [
package/src/client.js CHANGED
@@ -1064,6 +1064,182 @@ class RedditEndpoints {
1064
1064
  }
1065
1065
  }
1066
1066
 
1067
+ class TwitterEndpoints {
1068
+ /**
1069
+ * @type {Requester}
1070
+ * @readonly
1071
+ */
1072
+ #requester;
1073
+
1074
+ /** @param {{ requester: Requester }} options */
1075
+ constructor({ requester }) {
1076
+ this.#requester = requester;
1077
+ }
1078
+
1079
+ /**
1080
+ * @param {{ name: string }} params
1081
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
1082
+ * @returns {Promise<EDResponse>}
1083
+ */
1084
+ userInfo({ name }, options = {}) {
1085
+ const params = filterUndefinedValues({
1086
+ ...options.extraParams,
1087
+ name,
1088
+ });
1089
+ return this.#requester.get("/twitter/user/info", params, {
1090
+ timeout: options.timeout,
1091
+ });
1092
+ }
1093
+
1094
+ /**
1095
+ * @param {{ id: number }} params
1096
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
1097
+ * @returns {Promise<EDResponse>}
1098
+ */
1099
+ userTweets({ id }, options = {}) {
1100
+ const params = filterUndefinedValues({
1101
+ ...options.extraParams,
1102
+ id,
1103
+ });
1104
+ return this.#requester.get("/twitter/user/tweets", params, {
1105
+ timeout: options.timeout,
1106
+ });
1107
+ }
1108
+
1109
+ /**
1110
+ * @param {{ id: number }} params
1111
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
1112
+ * @returns {Promise<EDResponse>}
1113
+ */
1114
+ postInfo({ id }, options = {}) {
1115
+ const params = filterUndefinedValues({
1116
+ ...options.extraParams,
1117
+ id,
1118
+ });
1119
+ return this.#requester.get("/twitter/post/info", params, {
1120
+ timeout: options.timeout,
1121
+ });
1122
+ }
1123
+ }
1124
+
1125
+ class ThreadsEndpoints {
1126
+ /**
1127
+ * @type {Requester}
1128
+ * @readonly
1129
+ */
1130
+ #requester;
1131
+
1132
+ /** @param {{ requester: Requester }} options */
1133
+ constructor({ requester }) {
1134
+ this.#requester = requester;
1135
+ }
1136
+
1137
+ /**
1138
+ * @param {{ name: string; sorting?: "0" | "1" }} params
1139
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
1140
+ * @returns {Promise<EDResponse>}
1141
+ */
1142
+ searchKeyword({ name, sorting = undefined }, options = {}) {
1143
+ const params = filterUndefinedValues({
1144
+ ...options.extraParams,
1145
+ name,
1146
+ sorting,
1147
+ });
1148
+ return this.#requester.get("/threads/keyword/search", params, {
1149
+ timeout: options.timeout,
1150
+ });
1151
+ }
1152
+
1153
+ /**
1154
+ * @param {{ name: string }} params
1155
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
1156
+ * @returns {Promise<EDResponse>}
1157
+ */
1158
+ userSearch({ name }, options = {}) {
1159
+ const params = filterUndefinedValues({
1160
+ ...options.extraParams,
1161
+ name,
1162
+ });
1163
+ return this.#requester.get("/threads/user/search", params, {
1164
+ timeout: options.timeout,
1165
+ });
1166
+ }
1167
+
1168
+ /**
1169
+ * @param {{ id: number }} params
1170
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
1171
+ * @returns {Promise<EDResponse>}
1172
+ */
1173
+ userInfo({ id }, options = {}) {
1174
+ const params = filterUndefinedValues({
1175
+ ...options.extraParams,
1176
+ id,
1177
+ });
1178
+ return this.#requester.get("/threads/user/info", params, {
1179
+ timeout: options.timeout,
1180
+ });
1181
+ }
1182
+
1183
+ /**
1184
+ * @param {{ id: number; chunkSize?: number }} params
1185
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
1186
+ * @returns {Promise<EDResponse>}
1187
+ */
1188
+ userPosts({ id, chunkSize = undefined }, options = {}) {
1189
+ const params = filterUndefinedValues({
1190
+ ...options.extraParams,
1191
+ id,
1192
+ chunk_size: chunkSize,
1193
+ });
1194
+ return this.#requester.get("/threads/user/posts", params, {
1195
+ timeout: options.timeout,
1196
+ });
1197
+ }
1198
+
1199
+ /**
1200
+ * @param {{ id: number }} params
1201
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
1202
+ * @returns {Promise<EDResponse>}
1203
+ */
1204
+ postReplies({ id }, options = {}) {
1205
+ const params = filterUndefinedValues({
1206
+ ...options.extraParams,
1207
+ id,
1208
+ });
1209
+ return this.#requester.get("/threads/post/replies", params, {
1210
+ timeout: options.timeout,
1211
+ });
1212
+ }
1213
+ }
1214
+
1215
+ class SnapchatEndpoints {
1216
+ /**
1217
+ * @type {Requester}
1218
+ * @readonly
1219
+ */
1220
+ #requester;
1221
+
1222
+ /** @param {{ requester: Requester }} options */
1223
+ constructor({ requester }) {
1224
+ this.#requester = requester;
1225
+ }
1226
+
1227
+ /**
1228
+ * @param {{ name: string }} params
1229
+ * @param {{ extraParams?: Record<string, any>; timeout?: number }} options
1230
+ * @returns {Promise<EDResponse>}
1231
+ */
1232
+ userInfo({ name }, options = {}) {
1233
+ const params = filterUndefinedValues({
1234
+ ...options.extraParams,
1235
+ name,
1236
+ });
1237
+ return this.#requester.get("/snapchat/user/info", params, {
1238
+ timeout: options.timeout,
1239
+ });
1240
+ }
1241
+ }
1242
+
1067
1243
  export class EDClient {
1068
1244
  /**
1069
1245
  * @type {Requester}
@@ -1099,6 +1275,15 @@ export class EDClient {
1099
1275
 
1100
1276
  /** @readonly */
1101
1277
  this.reddit = new RedditEndpoints({ requester });
1278
+
1279
+ /** @readonly */
1280
+ this.twitter = new TwitterEndpoints({ requester });
1281
+
1282
+ /** @readonly */
1283
+ this.threads = new ThreadsEndpoints({ requester });
1284
+
1285
+ /** @readonly */
1286
+ this.snapchat = new SnapchatEndpoints({ requester });
1102
1287
  }
1103
1288
 
1104
1289
  /**
package/src/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "0.1.1";
1
+ export const VERSION = "0.1.4";
@@ -1,2 +1,2 @@
1
- export const VERSION: "0.1.0";
1
+ export const VERSION: "0.1.2";
2
2
  //# sourceMappingURL=version.d.ts.map