@xpoz/xpoz 0.4.1 → 0.6.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/README.md +26 -1
- package/dist/index.cjs +58 -5
- package/dist/index.d.cts +70 -3
- package/dist/index.d.ts +70 -3
- package/dist/index.js +56 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -200,7 +200,7 @@ The following methods accept both `responseType` and `limit`:
|
|
|
200
200
|
- `twitter.getPostsByAuthor()`, `twitter.searchPosts()`, `twitter.getUsersByKeywords()`
|
|
201
201
|
- `instagram.getPostsByUser()`, `instagram.searchPosts()`, `instagram.getUsersByKeywords()`
|
|
202
202
|
- `reddit.searchPosts()`
|
|
203
|
-
- `tiktok.getPostsByUser()`, `tiktok.searchPosts()`, `tiktok.getUsersByKeywords()`
|
|
203
|
+
- `tiktok.getPostsByUser()`, `tiktok.searchPosts()`, `tiktok.getUsersByKeywords()`, `tiktok.getPostsByHashtags()`, `tiktok.getUsersByHashtags()`
|
|
204
204
|
|
|
205
205
|
These methods accept `limit` only:
|
|
206
206
|
|
|
@@ -640,6 +640,28 @@ const results = await client.tiktok.searchPosts("travel vlog", {
|
|
|
640
640
|
});
|
|
641
641
|
```
|
|
642
642
|
|
|
643
|
+
#### `getPostsByHashtags(hashtags, options?) -> Promise<PaginatedResult<TiktokPost>>`
|
|
644
|
+
|
|
645
|
+
Search posts by hashtags via the indexed `hashtags` column. Pass bare alphanumeric tags (no leading `#`). Max 5 hashtags per request; OR semantics across the list.
|
|
646
|
+
|
|
647
|
+
```typescript
|
|
648
|
+
const results = await client.tiktok.getPostsByHashtags(["dance", "fyp"], {
|
|
649
|
+
responseType: ResponseType.Fast,
|
|
650
|
+
limit: 50,
|
|
651
|
+
});
|
|
652
|
+
```
|
|
653
|
+
|
|
654
|
+
#### `getUsersByHashtags(hashtags, options?) -> Promise<PaginatedResult<TiktokUser>>`
|
|
655
|
+
|
|
656
|
+
Find users who authored posts tagged with the given hashtags. Same input rules as `getPostsByHashtags`.
|
|
657
|
+
|
|
658
|
+
```typescript
|
|
659
|
+
const users = await client.tiktok.getUsersByHashtags(["sustainable_fashion"], {
|
|
660
|
+
responseType: ResponseType.Fast,
|
|
661
|
+
limit: 20,
|
|
662
|
+
});
|
|
663
|
+
```
|
|
664
|
+
|
|
643
665
|
#### `getComments(postId, options?) -> Promise<PaginatedResult<TiktokComment>>`
|
|
644
666
|
|
|
645
667
|
```typescript
|
|
@@ -870,6 +892,9 @@ All fields are optional and typed as their respective TypeScript types. Unknown
|
|
|
870
892
|
| `downloadCount` | `number` | Number of downloads |
|
|
871
893
|
| `forwardCount` | `number` | Number of forwards/shares |
|
|
872
894
|
| `videoThumbnail` | `string` | Thumbnail URL |
|
|
895
|
+
| `videoUrl` | `string[]` | Array of video URLs |
|
|
896
|
+
| `duration` | `number` | Video duration in seconds |
|
|
897
|
+
| `hashtags` | `string[]` | Hashtags in the post |
|
|
873
898
|
| `postType` | `number` | Post type code |
|
|
874
899
|
| `isPrivate` | `boolean` | Private post flag |
|
|
875
900
|
| `createdAt` | `string` | Creation timestamp |
|
package/dist/index.cjs
CHANGED
|
@@ -31,6 +31,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
33
|
AuthenticationError: () => AuthenticationError,
|
|
34
|
+
BillingPeriod: () => BillingPeriod,
|
|
35
|
+
CreditResetFrequency: () => CreditResetFrequency,
|
|
34
36
|
OperationCancelledError: () => OperationCancelledError,
|
|
35
37
|
OperationFailedError: () => OperationFailedError,
|
|
36
38
|
OperationTimeoutError: () => OperationTimeoutError,
|
|
@@ -296,7 +298,7 @@ function coerce(value) {
|
|
|
296
298
|
}
|
|
297
299
|
|
|
298
300
|
// src/version.ts
|
|
299
|
-
var VERSION = "0.
|
|
301
|
+
var VERSION = "0.6.5";
|
|
300
302
|
|
|
301
303
|
// src/mcp/transport.ts
|
|
302
304
|
var USER_AGENT = `xpoz-ts-sdk/${VERSION}`;
|
|
@@ -629,13 +631,16 @@ var GET_REDDIT_SUBREDDITS_BY_KEYWORDS = "getRedditSubredditsByKeywords";
|
|
|
629
631
|
var GET_TIKTOK_POSTS_BY_IDS = "getTiktokPostsByIds";
|
|
630
632
|
var GET_TIKTOK_POSTS_BY_USER = "getTiktokPostsByUser";
|
|
631
633
|
var SEARCH_TIKTOK_POSTS = "getTiktokPostsByKeywords";
|
|
634
|
+
var GET_TIKTOK_POSTS_BY_HASHTAGS = "getTiktokPostsByHashtags";
|
|
632
635
|
var GET_TIKTOK_COMMENTS = "getTiktokCommentsByPostId";
|
|
633
636
|
var GET_TIKTOK_USER = "getTiktokUser";
|
|
634
637
|
var SEARCH_TIKTOK_USERS = "searchTiktokUsers";
|
|
635
638
|
var GET_TIKTOK_USERS_BY_KEYWORDS = "getTiktokUsersByKeywords";
|
|
639
|
+
var GET_TIKTOK_USERS_BY_HASHTAGS = "getTiktokUsersByHashtags";
|
|
636
640
|
var GET_TRACKED_ITEMS = "getTrackedItems";
|
|
637
641
|
var ADD_TRACKED_ITEMS = "addTrackedItems";
|
|
638
642
|
var REMOVE_TRACKED_ITEMS = "removeTrackedItems";
|
|
643
|
+
var GET_ACCOUNT_DETAILS = "getAccountDetails";
|
|
639
644
|
|
|
640
645
|
// src/namespaces/twitter.ts
|
|
641
646
|
function parseTwitterPost(item) {
|
|
@@ -790,7 +795,8 @@ var TwitterNamespace = class extends BaseNamespace {
|
|
|
790
795
|
const args = this.buildArgs({
|
|
791
796
|
identifier,
|
|
792
797
|
identifierType: options.identifierType ?? "username",
|
|
793
|
-
fields: options.fields
|
|
798
|
+
fields: options.fields,
|
|
799
|
+
forceLatest: options.forceLatest
|
|
794
800
|
});
|
|
795
801
|
const result = await this.callAndMaybePoll(GET_TWITTER_USER, args);
|
|
796
802
|
const results = result["results"];
|
|
@@ -892,7 +898,8 @@ var InstagramNamespace = class extends BaseNamespace {
|
|
|
892
898
|
const args = this.buildArgs({
|
|
893
899
|
identifier,
|
|
894
900
|
identifierType: options.identifierType ?? "username",
|
|
895
|
-
fields: options.fields
|
|
901
|
+
fields: options.fields,
|
|
902
|
+
forceLatest: options.forceLatest
|
|
896
903
|
});
|
|
897
904
|
const result = await this.callAndMaybePoll(GET_INSTAGRAM_USER, args);
|
|
898
905
|
const results = result["results"];
|
|
@@ -1103,7 +1110,8 @@ var TiktokNamespace = class extends BaseNamespace {
|
|
|
1103
1110
|
const args = this.buildArgs({
|
|
1104
1111
|
identifier,
|
|
1105
1112
|
identifierType: options.identifierType ?? "username",
|
|
1106
|
-
fields: options.fields
|
|
1113
|
+
fields: options.fields,
|
|
1114
|
+
forceLatest: options.forceLatest
|
|
1107
1115
|
});
|
|
1108
1116
|
const result = await this.callAndMaybePoll(GET_TIKTOK_USER, args);
|
|
1109
1117
|
const results = result["results"];
|
|
@@ -1127,13 +1135,33 @@ var TiktokNamespace = class extends BaseNamespace {
|
|
|
1127
1135
|
args
|
|
1128
1136
|
);
|
|
1129
1137
|
}
|
|
1138
|
+
async getPostsByHashtags(hashtags, options = {}) {
|
|
1139
|
+
const args = this.buildArgs({ hashtags, ...options });
|
|
1140
|
+
const result = await this.callAndMaybePoll(GET_TIKTOK_POSTS_BY_HASHTAGS, args);
|
|
1141
|
+
return this.buildPaginatedResult(
|
|
1142
|
+
result,
|
|
1143
|
+
parsePost3,
|
|
1144
|
+
GET_TIKTOK_POSTS_BY_HASHTAGS,
|
|
1145
|
+
args
|
|
1146
|
+
);
|
|
1147
|
+
}
|
|
1148
|
+
async getUsersByHashtags(hashtags, options = {}) {
|
|
1149
|
+
const args = this.buildArgs({ hashtags, ...options });
|
|
1150
|
+
const result = await this.callAndMaybePoll(GET_TIKTOK_USERS_BY_HASHTAGS, args);
|
|
1151
|
+
return this.buildPaginatedResult(
|
|
1152
|
+
result,
|
|
1153
|
+
parseUser4,
|
|
1154
|
+
GET_TIKTOK_USERS_BY_HASHTAGS,
|
|
1155
|
+
args
|
|
1156
|
+
);
|
|
1157
|
+
}
|
|
1130
1158
|
};
|
|
1131
1159
|
|
|
1132
1160
|
// src/namespaces/tracking.ts
|
|
1133
1161
|
var TrackingNamespace = class extends BaseNamespace {
|
|
1134
1162
|
async getTrackedItems() {
|
|
1135
1163
|
const result = await this.callTool(GET_TRACKED_ITEMS, {});
|
|
1136
|
-
return result["
|
|
1164
|
+
return result["results"] ?? [];
|
|
1137
1165
|
}
|
|
1138
1166
|
async addTrackedItems(items) {
|
|
1139
1167
|
const args = this.buildArgs({ items });
|
|
@@ -1147,6 +1175,14 @@ var TrackingNamespace = class extends BaseNamespace {
|
|
|
1147
1175
|
}
|
|
1148
1176
|
};
|
|
1149
1177
|
|
|
1178
|
+
// src/namespaces/account.ts
|
|
1179
|
+
var AccountNamespace = class extends BaseNamespace {
|
|
1180
|
+
async getAccountDetails() {
|
|
1181
|
+
const result = await this.callTool(GET_ACCOUNT_DETAILS, {});
|
|
1182
|
+
return result["data"];
|
|
1183
|
+
}
|
|
1184
|
+
};
|
|
1185
|
+
|
|
1150
1186
|
// src/versionCheck.ts
|
|
1151
1187
|
var NPM_REGISTRY_URL = "https://registry.npmjs.org/@xpoz/xpoz/latest";
|
|
1152
1188
|
var CHECK_TIMEOUT_MS = 3e3;
|
|
@@ -1194,6 +1230,7 @@ var XpozClient = class {
|
|
|
1194
1230
|
reddit;
|
|
1195
1231
|
tiktok;
|
|
1196
1232
|
tracking;
|
|
1233
|
+
account;
|
|
1197
1234
|
transport;
|
|
1198
1235
|
versionCheck;
|
|
1199
1236
|
constructor(options = {}) {
|
|
@@ -1213,6 +1250,7 @@ var XpozClient = class {
|
|
|
1213
1250
|
this.reddit = new RedditNamespace(callTool, timeoutMs);
|
|
1214
1251
|
this.tiktok = new TiktokNamespace(callTool, timeoutMs);
|
|
1215
1252
|
this.tracking = new TrackingNamespace(callTool, timeoutMs);
|
|
1253
|
+
this.account = new AccountNamespace(callTool, timeoutMs);
|
|
1216
1254
|
}
|
|
1217
1255
|
async connect() {
|
|
1218
1256
|
await this.transport.connect();
|
|
@@ -1233,6 +1271,7 @@ var TrackedItemType = /* @__PURE__ */ ((TrackedItemType2) => {
|
|
|
1233
1271
|
TrackedItemType2["Keyword"] = "keyword";
|
|
1234
1272
|
TrackedItemType2["User"] = "user";
|
|
1235
1273
|
TrackedItemType2["Subreddit"] = "subreddit";
|
|
1274
|
+
TrackedItemType2["Hashtag"] = "hashtag";
|
|
1236
1275
|
return TrackedItemType2;
|
|
1237
1276
|
})(TrackedItemType || {});
|
|
1238
1277
|
var TrackedItemPlatform = /* @__PURE__ */ ((TrackedItemPlatform2) => {
|
|
@@ -1242,9 +1281,23 @@ var TrackedItemPlatform = /* @__PURE__ */ ((TrackedItemPlatform2) => {
|
|
|
1242
1281
|
TrackedItemPlatform2["TikTok"] = "tiktok";
|
|
1243
1282
|
return TrackedItemPlatform2;
|
|
1244
1283
|
})(TrackedItemPlatform || {});
|
|
1284
|
+
|
|
1285
|
+
// src/types/account.ts
|
|
1286
|
+
var BillingPeriod = /* @__PURE__ */ ((BillingPeriod2) => {
|
|
1287
|
+
BillingPeriod2["Monthly"] = "monthly";
|
|
1288
|
+
BillingPeriod2["Annual"] = "annual";
|
|
1289
|
+
return BillingPeriod2;
|
|
1290
|
+
})(BillingPeriod || {});
|
|
1291
|
+
var CreditResetFrequency = /* @__PURE__ */ ((CreditResetFrequency2) => {
|
|
1292
|
+
CreditResetFrequency2["Monthly"] = "monthly";
|
|
1293
|
+
CreditResetFrequency2["Never"] = "never";
|
|
1294
|
+
return CreditResetFrequency2;
|
|
1295
|
+
})(CreditResetFrequency || {});
|
|
1245
1296
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1246
1297
|
0 && (module.exports = {
|
|
1247
1298
|
AuthenticationError,
|
|
1299
|
+
BillingPeriod,
|
|
1300
|
+
CreditResetFrequency,
|
|
1248
1301
|
OperationCancelledError,
|
|
1249
1302
|
OperationFailedError,
|
|
1250
1303
|
OperationTimeoutError,
|
package/dist/index.d.cts
CHANGED
|
@@ -191,6 +191,7 @@ declare class TwitterNamespace extends BaseNamespace {
|
|
|
191
191
|
getUser(identifier: string, options?: {
|
|
192
192
|
identifierType?: string;
|
|
193
193
|
fields?: string[];
|
|
194
|
+
forceLatest?: boolean;
|
|
194
195
|
}): Promise<TwitterUser>;
|
|
195
196
|
searchUsers(name: string, options?: {
|
|
196
197
|
limit?: number;
|
|
@@ -199,6 +200,8 @@ declare class TwitterNamespace extends BaseNamespace {
|
|
|
199
200
|
getUserConnections(username: string, connectionType: string, options?: {
|
|
200
201
|
fields?: string[];
|
|
201
202
|
forceLatest?: boolean;
|
|
203
|
+
responseType?: ResponseType;
|
|
204
|
+
limit?: number;
|
|
202
205
|
}): Promise<PaginatedResult<TwitterUser>>;
|
|
203
206
|
getUsersByKeywords(query: string, options?: {
|
|
204
207
|
fields?: string[];
|
|
@@ -315,6 +318,7 @@ declare class InstagramNamespace extends BaseNamespace {
|
|
|
315
318
|
getUser(identifier: string, options?: {
|
|
316
319
|
identifierType?: string;
|
|
317
320
|
fields?: string[];
|
|
321
|
+
forceLatest?: boolean;
|
|
318
322
|
}): Promise<InstagramUser>;
|
|
319
323
|
searchUsers(name: string, options?: {
|
|
320
324
|
limit?: number;
|
|
@@ -495,6 +499,7 @@ declare class RedditNamespace extends BaseNamespace {
|
|
|
495
499
|
}): Promise<PaginatedResult<RedditComment>>;
|
|
496
500
|
getUser(username: string, options?: {
|
|
497
501
|
fields?: string[];
|
|
502
|
+
forceLatest?: boolean;
|
|
498
503
|
}): Promise<RedditUser>;
|
|
499
504
|
searchUsers(name: string, options?: {
|
|
500
505
|
limit?: number;
|
|
@@ -542,6 +547,9 @@ interface TiktokPost {
|
|
|
542
547
|
downloadCount?: number | null;
|
|
543
548
|
forwardCount?: number | null;
|
|
544
549
|
playCount?: number | null;
|
|
550
|
+
hashtags?: string[] | null;
|
|
551
|
+
duration?: number | null;
|
|
552
|
+
videoUrl?: string[] | null;
|
|
545
553
|
createdAt?: string | null;
|
|
546
554
|
createdAtTimestamp?: number | null;
|
|
547
555
|
createdAtDate?: string | null;
|
|
@@ -616,6 +624,7 @@ declare class TiktokNamespace extends BaseNamespace {
|
|
|
616
624
|
getUser(identifier: string, options?: {
|
|
617
625
|
identifierType?: string;
|
|
618
626
|
fields?: string[];
|
|
627
|
+
forceLatest?: boolean;
|
|
619
628
|
}): Promise<TiktokUser>;
|
|
620
629
|
searchUsers(name: string, options?: {
|
|
621
630
|
limit?: number;
|
|
@@ -629,12 +638,29 @@ declare class TiktokNamespace extends BaseNamespace {
|
|
|
629
638
|
responseType?: ResponseType;
|
|
630
639
|
limit?: number;
|
|
631
640
|
}): Promise<PaginatedResult<TiktokUser>>;
|
|
641
|
+
getPostsByHashtags(hashtags: string[], options?: {
|
|
642
|
+
fields?: string[];
|
|
643
|
+
startDate?: string;
|
|
644
|
+
endDate?: string;
|
|
645
|
+
forceLatest?: boolean;
|
|
646
|
+
responseType?: ResponseType;
|
|
647
|
+
limit?: number;
|
|
648
|
+
}): Promise<PaginatedResult<TiktokPost>>;
|
|
649
|
+
getUsersByHashtags(hashtags: string[], options?: {
|
|
650
|
+
fields?: string[];
|
|
651
|
+
startDate?: string;
|
|
652
|
+
endDate?: string;
|
|
653
|
+
forceLatest?: boolean;
|
|
654
|
+
responseType?: ResponseType;
|
|
655
|
+
limit?: number;
|
|
656
|
+
}): Promise<PaginatedResult<TiktokUser>>;
|
|
632
657
|
}
|
|
633
658
|
|
|
634
659
|
declare enum TrackedItemType {
|
|
635
660
|
Keyword = "keyword",
|
|
636
661
|
User = "user",
|
|
637
|
-
Subreddit = "subreddit"
|
|
662
|
+
Subreddit = "subreddit",
|
|
663
|
+
Hashtag = "hashtag"
|
|
638
664
|
}
|
|
639
665
|
declare enum TrackedItemPlatform {
|
|
640
666
|
Twitter = "twitter",
|
|
@@ -667,12 +693,53 @@ declare class TrackingNamespace extends BaseNamespace {
|
|
|
667
693
|
removeTrackedItems(items: TrackedItem[]): Promise<RemoveTrackedItemsResult>;
|
|
668
694
|
}
|
|
669
695
|
|
|
696
|
+
declare enum BillingPeriod {
|
|
697
|
+
Monthly = "monthly",
|
|
698
|
+
Annual = "annual"
|
|
699
|
+
}
|
|
700
|
+
declare enum CreditResetFrequency {
|
|
701
|
+
Monthly = "monthly",
|
|
702
|
+
Never = "never"
|
|
703
|
+
}
|
|
704
|
+
interface PlanFeatures {
|
|
705
|
+
credits: number;
|
|
706
|
+
creditResetFrequency: CreditResetFrequency;
|
|
707
|
+
extraCreditPrice: number;
|
|
708
|
+
trackedItems?: number;
|
|
709
|
+
csvRowExportLimit: number;
|
|
710
|
+
extraCsvRowPrice: number;
|
|
711
|
+
extraTrackedItemPrice?: number;
|
|
712
|
+
maxRowsPerExport?: number;
|
|
713
|
+
}
|
|
714
|
+
interface AccountBilling {
|
|
715
|
+
billingPeriod: BillingPeriod;
|
|
716
|
+
nextRenewalDate: string | null;
|
|
717
|
+
}
|
|
718
|
+
interface AccountUsage {
|
|
719
|
+
subscriptionCreditsRemaining: number;
|
|
720
|
+
extraCreditsRemaining: number;
|
|
721
|
+
extraTrackedItems: number;
|
|
722
|
+
}
|
|
723
|
+
interface AccountDetails {
|
|
724
|
+
plan: {
|
|
725
|
+
name: string;
|
|
726
|
+
features: PlanFeatures;
|
|
727
|
+
};
|
|
728
|
+
billing: AccountBilling | null;
|
|
729
|
+
usage: AccountUsage;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
declare class AccountNamespace extends BaseNamespace {
|
|
733
|
+
getAccountDetails(): Promise<AccountDetails>;
|
|
734
|
+
}
|
|
735
|
+
|
|
670
736
|
declare class XpozClient {
|
|
671
737
|
twitter: TwitterNamespace;
|
|
672
738
|
instagram: InstagramNamespace;
|
|
673
739
|
reddit: RedditNamespace;
|
|
674
740
|
tiktok: TiktokNamespace;
|
|
675
741
|
tracking: TrackingNamespace;
|
|
742
|
+
account: AccountNamespace;
|
|
676
743
|
private transport;
|
|
677
744
|
private versionCheck;
|
|
678
745
|
constructor(options?: {
|
|
@@ -710,8 +777,8 @@ declare class OperationCancelledError extends XpozError {
|
|
|
710
777
|
constructor(operationId: string);
|
|
711
778
|
}
|
|
712
779
|
|
|
713
|
-
declare const VERSION = "0.
|
|
780
|
+
declare const VERSION = "0.6.5";
|
|
714
781
|
|
|
715
782
|
declare function checkForUpdates(): Promise<void>;
|
|
716
783
|
|
|
717
|
-
export { type AddTrackedItemsResult, AuthenticationError, type InstagramComment, type InstagramPost, type InstagramUser, OperationCancelledError, OperationFailedError, OperationTimeoutError, PaginatedResult, type PaginationInfo, type RedditComment, type RedditPost, type RedditPostWithComments, type RedditSubreddit, type RedditUser, type RemoveTrackedItemsResult, ResponseType, type SubredditWithPosts, type TiktokComment, type TiktokPost, type TiktokUser, type TrackedItem, TrackedItemPlatform, TrackedItemType, type TwitterPost, type TwitterUser, VERSION, XpozClient, XpozConnectionError, XpozError, checkForUpdates };
|
|
784
|
+
export { type AccountBilling, type AccountDetails, type AccountUsage, type AddTrackedItemsResult, AuthenticationError, BillingPeriod, CreditResetFrequency, type InstagramComment, type InstagramPost, type InstagramUser, OperationCancelledError, OperationFailedError, OperationTimeoutError, PaginatedResult, type PaginationInfo, type PlanFeatures, type RedditComment, type RedditPost, type RedditPostWithComments, type RedditSubreddit, type RedditUser, type RemoveTrackedItemsResult, ResponseType, type SubredditWithPosts, type TiktokComment, type TiktokPost, type TiktokUser, type TrackedItem, TrackedItemPlatform, TrackedItemType, type TwitterPost, type TwitterUser, VERSION, XpozClient, XpozConnectionError, XpozError, checkForUpdates };
|
package/dist/index.d.ts
CHANGED
|
@@ -191,6 +191,7 @@ declare class TwitterNamespace extends BaseNamespace {
|
|
|
191
191
|
getUser(identifier: string, options?: {
|
|
192
192
|
identifierType?: string;
|
|
193
193
|
fields?: string[];
|
|
194
|
+
forceLatest?: boolean;
|
|
194
195
|
}): Promise<TwitterUser>;
|
|
195
196
|
searchUsers(name: string, options?: {
|
|
196
197
|
limit?: number;
|
|
@@ -199,6 +200,8 @@ declare class TwitterNamespace extends BaseNamespace {
|
|
|
199
200
|
getUserConnections(username: string, connectionType: string, options?: {
|
|
200
201
|
fields?: string[];
|
|
201
202
|
forceLatest?: boolean;
|
|
203
|
+
responseType?: ResponseType;
|
|
204
|
+
limit?: number;
|
|
202
205
|
}): Promise<PaginatedResult<TwitterUser>>;
|
|
203
206
|
getUsersByKeywords(query: string, options?: {
|
|
204
207
|
fields?: string[];
|
|
@@ -315,6 +318,7 @@ declare class InstagramNamespace extends BaseNamespace {
|
|
|
315
318
|
getUser(identifier: string, options?: {
|
|
316
319
|
identifierType?: string;
|
|
317
320
|
fields?: string[];
|
|
321
|
+
forceLatest?: boolean;
|
|
318
322
|
}): Promise<InstagramUser>;
|
|
319
323
|
searchUsers(name: string, options?: {
|
|
320
324
|
limit?: number;
|
|
@@ -495,6 +499,7 @@ declare class RedditNamespace extends BaseNamespace {
|
|
|
495
499
|
}): Promise<PaginatedResult<RedditComment>>;
|
|
496
500
|
getUser(username: string, options?: {
|
|
497
501
|
fields?: string[];
|
|
502
|
+
forceLatest?: boolean;
|
|
498
503
|
}): Promise<RedditUser>;
|
|
499
504
|
searchUsers(name: string, options?: {
|
|
500
505
|
limit?: number;
|
|
@@ -542,6 +547,9 @@ interface TiktokPost {
|
|
|
542
547
|
downloadCount?: number | null;
|
|
543
548
|
forwardCount?: number | null;
|
|
544
549
|
playCount?: number | null;
|
|
550
|
+
hashtags?: string[] | null;
|
|
551
|
+
duration?: number | null;
|
|
552
|
+
videoUrl?: string[] | null;
|
|
545
553
|
createdAt?: string | null;
|
|
546
554
|
createdAtTimestamp?: number | null;
|
|
547
555
|
createdAtDate?: string | null;
|
|
@@ -616,6 +624,7 @@ declare class TiktokNamespace extends BaseNamespace {
|
|
|
616
624
|
getUser(identifier: string, options?: {
|
|
617
625
|
identifierType?: string;
|
|
618
626
|
fields?: string[];
|
|
627
|
+
forceLatest?: boolean;
|
|
619
628
|
}): Promise<TiktokUser>;
|
|
620
629
|
searchUsers(name: string, options?: {
|
|
621
630
|
limit?: number;
|
|
@@ -629,12 +638,29 @@ declare class TiktokNamespace extends BaseNamespace {
|
|
|
629
638
|
responseType?: ResponseType;
|
|
630
639
|
limit?: number;
|
|
631
640
|
}): Promise<PaginatedResult<TiktokUser>>;
|
|
641
|
+
getPostsByHashtags(hashtags: string[], options?: {
|
|
642
|
+
fields?: string[];
|
|
643
|
+
startDate?: string;
|
|
644
|
+
endDate?: string;
|
|
645
|
+
forceLatest?: boolean;
|
|
646
|
+
responseType?: ResponseType;
|
|
647
|
+
limit?: number;
|
|
648
|
+
}): Promise<PaginatedResult<TiktokPost>>;
|
|
649
|
+
getUsersByHashtags(hashtags: string[], options?: {
|
|
650
|
+
fields?: string[];
|
|
651
|
+
startDate?: string;
|
|
652
|
+
endDate?: string;
|
|
653
|
+
forceLatest?: boolean;
|
|
654
|
+
responseType?: ResponseType;
|
|
655
|
+
limit?: number;
|
|
656
|
+
}): Promise<PaginatedResult<TiktokUser>>;
|
|
632
657
|
}
|
|
633
658
|
|
|
634
659
|
declare enum TrackedItemType {
|
|
635
660
|
Keyword = "keyword",
|
|
636
661
|
User = "user",
|
|
637
|
-
Subreddit = "subreddit"
|
|
662
|
+
Subreddit = "subreddit",
|
|
663
|
+
Hashtag = "hashtag"
|
|
638
664
|
}
|
|
639
665
|
declare enum TrackedItemPlatform {
|
|
640
666
|
Twitter = "twitter",
|
|
@@ -667,12 +693,53 @@ declare class TrackingNamespace extends BaseNamespace {
|
|
|
667
693
|
removeTrackedItems(items: TrackedItem[]): Promise<RemoveTrackedItemsResult>;
|
|
668
694
|
}
|
|
669
695
|
|
|
696
|
+
declare enum BillingPeriod {
|
|
697
|
+
Monthly = "monthly",
|
|
698
|
+
Annual = "annual"
|
|
699
|
+
}
|
|
700
|
+
declare enum CreditResetFrequency {
|
|
701
|
+
Monthly = "monthly",
|
|
702
|
+
Never = "never"
|
|
703
|
+
}
|
|
704
|
+
interface PlanFeatures {
|
|
705
|
+
credits: number;
|
|
706
|
+
creditResetFrequency: CreditResetFrequency;
|
|
707
|
+
extraCreditPrice: number;
|
|
708
|
+
trackedItems?: number;
|
|
709
|
+
csvRowExportLimit: number;
|
|
710
|
+
extraCsvRowPrice: number;
|
|
711
|
+
extraTrackedItemPrice?: number;
|
|
712
|
+
maxRowsPerExport?: number;
|
|
713
|
+
}
|
|
714
|
+
interface AccountBilling {
|
|
715
|
+
billingPeriod: BillingPeriod;
|
|
716
|
+
nextRenewalDate: string | null;
|
|
717
|
+
}
|
|
718
|
+
interface AccountUsage {
|
|
719
|
+
subscriptionCreditsRemaining: number;
|
|
720
|
+
extraCreditsRemaining: number;
|
|
721
|
+
extraTrackedItems: number;
|
|
722
|
+
}
|
|
723
|
+
interface AccountDetails {
|
|
724
|
+
plan: {
|
|
725
|
+
name: string;
|
|
726
|
+
features: PlanFeatures;
|
|
727
|
+
};
|
|
728
|
+
billing: AccountBilling | null;
|
|
729
|
+
usage: AccountUsage;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
declare class AccountNamespace extends BaseNamespace {
|
|
733
|
+
getAccountDetails(): Promise<AccountDetails>;
|
|
734
|
+
}
|
|
735
|
+
|
|
670
736
|
declare class XpozClient {
|
|
671
737
|
twitter: TwitterNamespace;
|
|
672
738
|
instagram: InstagramNamespace;
|
|
673
739
|
reddit: RedditNamespace;
|
|
674
740
|
tiktok: TiktokNamespace;
|
|
675
741
|
tracking: TrackingNamespace;
|
|
742
|
+
account: AccountNamespace;
|
|
676
743
|
private transport;
|
|
677
744
|
private versionCheck;
|
|
678
745
|
constructor(options?: {
|
|
@@ -710,8 +777,8 @@ declare class OperationCancelledError extends XpozError {
|
|
|
710
777
|
constructor(operationId: string);
|
|
711
778
|
}
|
|
712
779
|
|
|
713
|
-
declare const VERSION = "0.
|
|
780
|
+
declare const VERSION = "0.6.5";
|
|
714
781
|
|
|
715
782
|
declare function checkForUpdates(): Promise<void>;
|
|
716
783
|
|
|
717
|
-
export { type AddTrackedItemsResult, AuthenticationError, type InstagramComment, type InstagramPost, type InstagramUser, OperationCancelledError, OperationFailedError, OperationTimeoutError, PaginatedResult, type PaginationInfo, type RedditComment, type RedditPost, type RedditPostWithComments, type RedditSubreddit, type RedditUser, type RemoveTrackedItemsResult, ResponseType, type SubredditWithPosts, type TiktokComment, type TiktokPost, type TiktokUser, type TrackedItem, TrackedItemPlatform, TrackedItemType, type TwitterPost, type TwitterUser, VERSION, XpozClient, XpozConnectionError, XpozError, checkForUpdates };
|
|
784
|
+
export { type AccountBilling, type AccountDetails, type AccountUsage, type AddTrackedItemsResult, AuthenticationError, BillingPeriod, CreditResetFrequency, type InstagramComment, type InstagramPost, type InstagramUser, OperationCancelledError, OperationFailedError, OperationTimeoutError, PaginatedResult, type PaginationInfo, type PlanFeatures, type RedditComment, type RedditPost, type RedditPostWithComments, type RedditSubreddit, type RedditUser, type RemoveTrackedItemsResult, ResponseType, type SubredditWithPosts, type TiktokComment, type TiktokPost, type TiktokUser, type TrackedItem, TrackedItemPlatform, TrackedItemType, type TwitterPost, type TwitterUser, VERSION, XpozClient, XpozConnectionError, XpozError, checkForUpdates };
|
package/dist/index.js
CHANGED
|
@@ -248,7 +248,7 @@ function coerce(value) {
|
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
// src/version.ts
|
|
251
|
-
var VERSION = "0.
|
|
251
|
+
var VERSION = "0.6.5";
|
|
252
252
|
|
|
253
253
|
// src/mcp/transport.ts
|
|
254
254
|
var USER_AGENT = `xpoz-ts-sdk/${VERSION}`;
|
|
@@ -581,13 +581,16 @@ var GET_REDDIT_SUBREDDITS_BY_KEYWORDS = "getRedditSubredditsByKeywords";
|
|
|
581
581
|
var GET_TIKTOK_POSTS_BY_IDS = "getTiktokPostsByIds";
|
|
582
582
|
var GET_TIKTOK_POSTS_BY_USER = "getTiktokPostsByUser";
|
|
583
583
|
var SEARCH_TIKTOK_POSTS = "getTiktokPostsByKeywords";
|
|
584
|
+
var GET_TIKTOK_POSTS_BY_HASHTAGS = "getTiktokPostsByHashtags";
|
|
584
585
|
var GET_TIKTOK_COMMENTS = "getTiktokCommentsByPostId";
|
|
585
586
|
var GET_TIKTOK_USER = "getTiktokUser";
|
|
586
587
|
var SEARCH_TIKTOK_USERS = "searchTiktokUsers";
|
|
587
588
|
var GET_TIKTOK_USERS_BY_KEYWORDS = "getTiktokUsersByKeywords";
|
|
589
|
+
var GET_TIKTOK_USERS_BY_HASHTAGS = "getTiktokUsersByHashtags";
|
|
588
590
|
var GET_TRACKED_ITEMS = "getTrackedItems";
|
|
589
591
|
var ADD_TRACKED_ITEMS = "addTrackedItems";
|
|
590
592
|
var REMOVE_TRACKED_ITEMS = "removeTrackedItems";
|
|
593
|
+
var GET_ACCOUNT_DETAILS = "getAccountDetails";
|
|
591
594
|
|
|
592
595
|
// src/namespaces/twitter.ts
|
|
593
596
|
function parseTwitterPost(item) {
|
|
@@ -742,7 +745,8 @@ var TwitterNamespace = class extends BaseNamespace {
|
|
|
742
745
|
const args = this.buildArgs({
|
|
743
746
|
identifier,
|
|
744
747
|
identifierType: options.identifierType ?? "username",
|
|
745
|
-
fields: options.fields
|
|
748
|
+
fields: options.fields,
|
|
749
|
+
forceLatest: options.forceLatest
|
|
746
750
|
});
|
|
747
751
|
const result = await this.callAndMaybePoll(GET_TWITTER_USER, args);
|
|
748
752
|
const results = result["results"];
|
|
@@ -844,7 +848,8 @@ var InstagramNamespace = class extends BaseNamespace {
|
|
|
844
848
|
const args = this.buildArgs({
|
|
845
849
|
identifier,
|
|
846
850
|
identifierType: options.identifierType ?? "username",
|
|
847
|
-
fields: options.fields
|
|
851
|
+
fields: options.fields,
|
|
852
|
+
forceLatest: options.forceLatest
|
|
848
853
|
});
|
|
849
854
|
const result = await this.callAndMaybePoll(GET_INSTAGRAM_USER, args);
|
|
850
855
|
const results = result["results"];
|
|
@@ -1055,7 +1060,8 @@ var TiktokNamespace = class extends BaseNamespace {
|
|
|
1055
1060
|
const args = this.buildArgs({
|
|
1056
1061
|
identifier,
|
|
1057
1062
|
identifierType: options.identifierType ?? "username",
|
|
1058
|
-
fields: options.fields
|
|
1063
|
+
fields: options.fields,
|
|
1064
|
+
forceLatest: options.forceLatest
|
|
1059
1065
|
});
|
|
1060
1066
|
const result = await this.callAndMaybePoll(GET_TIKTOK_USER, args);
|
|
1061
1067
|
const results = result["results"];
|
|
@@ -1079,13 +1085,33 @@ var TiktokNamespace = class extends BaseNamespace {
|
|
|
1079
1085
|
args
|
|
1080
1086
|
);
|
|
1081
1087
|
}
|
|
1088
|
+
async getPostsByHashtags(hashtags, options = {}) {
|
|
1089
|
+
const args = this.buildArgs({ hashtags, ...options });
|
|
1090
|
+
const result = await this.callAndMaybePoll(GET_TIKTOK_POSTS_BY_HASHTAGS, args);
|
|
1091
|
+
return this.buildPaginatedResult(
|
|
1092
|
+
result,
|
|
1093
|
+
parsePost3,
|
|
1094
|
+
GET_TIKTOK_POSTS_BY_HASHTAGS,
|
|
1095
|
+
args
|
|
1096
|
+
);
|
|
1097
|
+
}
|
|
1098
|
+
async getUsersByHashtags(hashtags, options = {}) {
|
|
1099
|
+
const args = this.buildArgs({ hashtags, ...options });
|
|
1100
|
+
const result = await this.callAndMaybePoll(GET_TIKTOK_USERS_BY_HASHTAGS, args);
|
|
1101
|
+
return this.buildPaginatedResult(
|
|
1102
|
+
result,
|
|
1103
|
+
parseUser4,
|
|
1104
|
+
GET_TIKTOK_USERS_BY_HASHTAGS,
|
|
1105
|
+
args
|
|
1106
|
+
);
|
|
1107
|
+
}
|
|
1082
1108
|
};
|
|
1083
1109
|
|
|
1084
1110
|
// src/namespaces/tracking.ts
|
|
1085
1111
|
var TrackingNamespace = class extends BaseNamespace {
|
|
1086
1112
|
async getTrackedItems() {
|
|
1087
1113
|
const result = await this.callTool(GET_TRACKED_ITEMS, {});
|
|
1088
|
-
return result["
|
|
1114
|
+
return result["results"] ?? [];
|
|
1089
1115
|
}
|
|
1090
1116
|
async addTrackedItems(items) {
|
|
1091
1117
|
const args = this.buildArgs({ items });
|
|
@@ -1099,6 +1125,14 @@ var TrackingNamespace = class extends BaseNamespace {
|
|
|
1099
1125
|
}
|
|
1100
1126
|
};
|
|
1101
1127
|
|
|
1128
|
+
// src/namespaces/account.ts
|
|
1129
|
+
var AccountNamespace = class extends BaseNamespace {
|
|
1130
|
+
async getAccountDetails() {
|
|
1131
|
+
const result = await this.callTool(GET_ACCOUNT_DETAILS, {});
|
|
1132
|
+
return result["data"];
|
|
1133
|
+
}
|
|
1134
|
+
};
|
|
1135
|
+
|
|
1102
1136
|
// src/versionCheck.ts
|
|
1103
1137
|
var NPM_REGISTRY_URL = "https://registry.npmjs.org/@xpoz/xpoz/latest";
|
|
1104
1138
|
var CHECK_TIMEOUT_MS = 3e3;
|
|
@@ -1146,6 +1180,7 @@ var XpozClient = class {
|
|
|
1146
1180
|
reddit;
|
|
1147
1181
|
tiktok;
|
|
1148
1182
|
tracking;
|
|
1183
|
+
account;
|
|
1149
1184
|
transport;
|
|
1150
1185
|
versionCheck;
|
|
1151
1186
|
constructor(options = {}) {
|
|
@@ -1165,6 +1200,7 @@ var XpozClient = class {
|
|
|
1165
1200
|
this.reddit = new RedditNamespace(callTool, timeoutMs);
|
|
1166
1201
|
this.tiktok = new TiktokNamespace(callTool, timeoutMs);
|
|
1167
1202
|
this.tracking = new TrackingNamespace(callTool, timeoutMs);
|
|
1203
|
+
this.account = new AccountNamespace(callTool, timeoutMs);
|
|
1168
1204
|
}
|
|
1169
1205
|
async connect() {
|
|
1170
1206
|
await this.transport.connect();
|
|
@@ -1185,6 +1221,7 @@ var TrackedItemType = /* @__PURE__ */ ((TrackedItemType2) => {
|
|
|
1185
1221
|
TrackedItemType2["Keyword"] = "keyword";
|
|
1186
1222
|
TrackedItemType2["User"] = "user";
|
|
1187
1223
|
TrackedItemType2["Subreddit"] = "subreddit";
|
|
1224
|
+
TrackedItemType2["Hashtag"] = "hashtag";
|
|
1188
1225
|
return TrackedItemType2;
|
|
1189
1226
|
})(TrackedItemType || {});
|
|
1190
1227
|
var TrackedItemPlatform = /* @__PURE__ */ ((TrackedItemPlatform2) => {
|
|
@@ -1194,8 +1231,22 @@ var TrackedItemPlatform = /* @__PURE__ */ ((TrackedItemPlatform2) => {
|
|
|
1194
1231
|
TrackedItemPlatform2["TikTok"] = "tiktok";
|
|
1195
1232
|
return TrackedItemPlatform2;
|
|
1196
1233
|
})(TrackedItemPlatform || {});
|
|
1234
|
+
|
|
1235
|
+
// src/types/account.ts
|
|
1236
|
+
var BillingPeriod = /* @__PURE__ */ ((BillingPeriod2) => {
|
|
1237
|
+
BillingPeriod2["Monthly"] = "monthly";
|
|
1238
|
+
BillingPeriod2["Annual"] = "annual";
|
|
1239
|
+
return BillingPeriod2;
|
|
1240
|
+
})(BillingPeriod || {});
|
|
1241
|
+
var CreditResetFrequency = /* @__PURE__ */ ((CreditResetFrequency2) => {
|
|
1242
|
+
CreditResetFrequency2["Monthly"] = "monthly";
|
|
1243
|
+
CreditResetFrequency2["Never"] = "never";
|
|
1244
|
+
return CreditResetFrequency2;
|
|
1245
|
+
})(CreditResetFrequency || {});
|
|
1197
1246
|
export {
|
|
1198
1247
|
AuthenticationError,
|
|
1248
|
+
BillingPeriod,
|
|
1249
|
+
CreditResetFrequency,
|
|
1199
1250
|
OperationCancelledError,
|
|
1200
1251
|
OperationFailedError,
|
|
1201
1252
|
OperationTimeoutError,
|