@xpoz/xpoz 0.4.0 → 0.4.2

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 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
@@ -714,15 +736,20 @@ All fields are optional and typed as their respective TypeScript types. Unknown
714
736
  | `hashtags` | `string[]` | Hashtags in tweet |
715
737
  | `mentions` | `string[]` | Mentioned usernames |
716
738
  | `mediaUrls` | `string[]` | Media attachment URLs |
717
- | `urls` | `string[]` | URLs in tweet |
739
+ | `urls` | `string[]` | URLs in tweet text |
718
740
  | `country` | `string` | Country (if geo-tagged) |
719
741
  | `createdAt` | `string` | Creation timestamp |
720
742
  | `createdAtDate` | `string` | Creation date (YYYY-MM-DD) |
721
743
  | `conversationId` | `string` | Thread conversation ID |
722
744
  | `quotedTweetId` | `string` | ID of quoted tweet |
723
745
  | `replyToTweetId` | `string` | ID of parent tweet |
724
- | `isRetweet` | `boolean` | Whether this is a retweet |
725
746
  | `possiblySensitive` | `boolean` | Sensitive content flag |
747
+ | `isRetweet` | `boolean` | Whether this is a retweet |
748
+ | `hasBirdwatchNotes` | `boolean` | Has community notes |
749
+ | `birdwatchNotesId` | `string` | Birdwatch note ID |
750
+ | `birdwatchNotesText`| `string` | Birdwatch note text |
751
+ | `birdwatchNotesUrl` | `string` | Birdwatch note URL |
752
+ | `status` | `string` | Tweet status |
726
753
 
727
754
  ### TwitterUser
728
755
 
@@ -742,9 +769,6 @@ All fields are optional and typed as their respective TypeScript types. Unknown
742
769
  | `profileImageUrl` | `string` | Profile picture URL |
743
770
  | `createdAt` | `string` | Account creation timestamp |
744
771
  | `accountBasedIn` | `string` | Account location |
745
- | `isInauthentic` | `boolean` | Inauthenticity flag |
746
- | `isInauthenticProbScore` | `number` | Inauthenticity probability |
747
- | `avgTweetsPerDayLastMonth` | `number` | Tweeting frequency |
748
772
 
749
773
  ### InstagramPost
750
774
 
@@ -760,8 +784,10 @@ All fields are optional and typed as their respective TypeScript types. Unknown
760
784
  | `videoPlayCount` | `number` | Video play count |
761
785
  | `mediaType` | `string` | Media type |
762
786
  | `imageUrl` | `string` | Image URL |
763
- | `videoUrl` | `string` | Video URL |
764
- | `createdAtDate` | `string` | Creation date |
787
+ | `videoUrl` | `string` | Video URL |
788
+ | `createdAtDate` | `string` | Creation date |
789
+ | `genAiChatWithAiCtaInfo` | `string` | Gen AI chat CTA info |
790
+ | `hasHighRiskGenAiInformTreatment` | `boolean` | High risk Gen AI treatment flag |
765
791
 
766
792
  ### InstagramUser
767
793
 
@@ -866,6 +892,9 @@ All fields are optional and typed as their respective TypeScript types. Unknown
866
892
  | `downloadCount` | `number` | Number of downloads |
867
893
  | `forwardCount` | `number` | Number of forwards/shares |
868
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 |
869
898
  | `postType` | `number` | Post type code |
870
899
  | `isPrivate` | `boolean` | Private post flag |
871
900
  | `createdAt` | `string` | Creation timestamp |
package/dist/index.cjs CHANGED
@@ -296,7 +296,7 @@ function coerce(value) {
296
296
  }
297
297
 
298
298
  // src/version.ts
299
- var VERSION = "0.4.0";
299
+ var VERSION = "0.4.2";
300
300
 
301
301
  // src/mcp/transport.ts
302
302
  var USER_AGENT = `xpoz-ts-sdk/${VERSION}`;
@@ -540,7 +540,7 @@ var BaseNamespace = class {
540
540
  String(result["error"] ?? "Unknown error")
541
541
  );
542
542
  }
543
- if (result["status"] === "success" || "results" in result) {
543
+ if (result["status"] === "success" || result["status"] === "no_data" || "results" in result) {
544
544
  return result;
545
545
  }
546
546
  const operationId = result["operationId"];
@@ -629,10 +629,12 @@ var GET_REDDIT_SUBREDDITS_BY_KEYWORDS = "getRedditSubredditsByKeywords";
629
629
  var GET_TIKTOK_POSTS_BY_IDS = "getTiktokPostsByIds";
630
630
  var GET_TIKTOK_POSTS_BY_USER = "getTiktokPostsByUser";
631
631
  var SEARCH_TIKTOK_POSTS = "getTiktokPostsByKeywords";
632
+ var GET_TIKTOK_POSTS_BY_HASHTAGS = "getTiktokPostsByHashtags";
632
633
  var GET_TIKTOK_COMMENTS = "getTiktokCommentsByPostId";
633
634
  var GET_TIKTOK_USER = "getTiktokUser";
634
635
  var SEARCH_TIKTOK_USERS = "searchTiktokUsers";
635
636
  var GET_TIKTOK_USERS_BY_KEYWORDS = "getTiktokUsersByKeywords";
637
+ var GET_TIKTOK_USERS_BY_HASHTAGS = "getTiktokUsersByHashtags";
636
638
  var GET_TRACKED_ITEMS = "getTrackedItems";
637
639
  var ADD_TRACKED_ITEMS = "addTrackedItems";
638
640
  var REMOVE_TRACKED_ITEMS = "removeTrackedItems";
@@ -1127,6 +1129,26 @@ var TiktokNamespace = class extends BaseNamespace {
1127
1129
  args
1128
1130
  );
1129
1131
  }
1132
+ async getPostsByHashtags(hashtags, options = {}) {
1133
+ const args = this.buildArgs({ hashtags, ...options });
1134
+ const result = await this.callAndMaybePoll(GET_TIKTOK_POSTS_BY_HASHTAGS, args);
1135
+ return this.buildPaginatedResult(
1136
+ result,
1137
+ parsePost3,
1138
+ GET_TIKTOK_POSTS_BY_HASHTAGS,
1139
+ args
1140
+ );
1141
+ }
1142
+ async getUsersByHashtags(hashtags, options = {}) {
1143
+ const args = this.buildArgs({ hashtags, ...options });
1144
+ const result = await this.callAndMaybePoll(GET_TIKTOK_USERS_BY_HASHTAGS, args);
1145
+ return this.buildPaginatedResult(
1146
+ result,
1147
+ parseUser4,
1148
+ GET_TIKTOK_USERS_BY_HASHTAGS,
1149
+ args
1150
+ );
1151
+ }
1130
1152
  };
1131
1153
 
1132
1154
  // src/namespaces/tracking.ts
package/dist/index.d.cts CHANGED
@@ -53,11 +53,15 @@ interface TwitterPost {
53
53
  conversationId?: string | null;
54
54
  lang?: string | null;
55
55
  source?: string | null;
56
- status?: string | null;
57
56
  deleted?: boolean | null;
58
57
  suspended?: boolean | null;
59
58
  possiblySensitive?: boolean | null;
60
59
  isRetweet?: boolean | null;
60
+ hasBirdwatchNotes?: boolean | null;
61
+ birdwatchNotesId?: string | null;
62
+ birdwatchNotesText?: string | null;
63
+ birdwatchNotesUrl?: string | null;
64
+ status?: string | null;
61
65
  likeCount?: number | null;
62
66
  retweetCount?: number | null;
63
67
  replyCount?: number | null;
@@ -71,22 +75,16 @@ interface TwitterPost {
71
75
  replyToUsername?: string | null;
72
76
  originalTweetId?: string | null;
73
77
  editedTweets?: string[] | null;
74
- replySettings?: string | null;
75
78
  hashtags?: string[] | null;
76
79
  mentions?: string[] | null;
77
80
  mediaUrls?: string[] | null;
78
- grokGeneratedContent?: Record<string, unknown>[] | null;
79
81
  urls?: string[] | null;
82
+ grokGeneratedContent?: Record<string, unknown>[] | null;
80
83
  country?: string | null;
81
84
  region?: string | null;
82
85
  city?: string | null;
83
- hasBirdwatchNotes?: boolean | null;
84
- birdwatchNotesId?: string | null;
85
- birdwatchNotesText?: string | null;
86
- birdwatchNotesUrl?: string | null;
87
86
  createdAt?: string | null;
88
87
  createdAtDate?: string | null;
89
- xFetchedAt?: string | null;
90
88
  [key: string]: unknown;
91
89
  }
92
90
  interface TwitterUser {
@@ -115,25 +113,13 @@ interface TwitterUser {
115
113
  locationAccurate?: boolean | null;
116
114
  label?: string | null;
117
115
  labelType?: string | null;
118
- collectedFollowingCount?: number | null;
119
- collectedFollowersCount?: number | null;
120
- collectedFollowersCoverage?: number | null;
121
- collectedFollowingCoverage?: number | null;
122
- avgTweetsPerDayLastMonth?: number | null;
123
116
  nLang?: number | null;
124
117
  nLangsFiltered?: number | null;
125
- inauthenticType?: string | null;
126
- isInauthentic?: boolean | null;
127
- isInauthenticProbScore?: number | null;
128
- isInauthenticCalculatedAt?: string | null;
129
118
  verifiedSinceDatetime?: string | null;
130
119
  usernameChanges?: string[] | null;
131
120
  lastUsernameChangeDatetime?: string | null;
132
121
  createdAt?: string | null;
133
- createdAtDate?: string | null;
134
- xFetchedAt?: string | null;
135
122
  modifiedAt?: string | null;
136
- xModifiedAt?: string | null;
137
123
  aggRelevance?: number | null;
138
124
  relevantTweetsCount?: number | null;
139
125
  relevantTweetsImpressionsSum?: number | null;
@@ -213,6 +199,8 @@ declare class TwitterNamespace extends BaseNamespace {
213
199
  getUserConnections(username: string, connectionType: string, options?: {
214
200
  fields?: string[];
215
201
  forceLatest?: boolean;
202
+ responseType?: ResponseType;
203
+ limit?: number;
216
204
  }): Promise<PaginatedResult<TwitterUser>>;
217
205
  getUsersByKeywords(query: string, options?: {
218
206
  fields?: string[];
@@ -246,12 +234,11 @@ interface InstagramPost {
246
234
  reshareCount?: number | null;
247
235
  videoPlayCount?: number | null;
248
236
  location?: string | null;
237
+ genAiChatWithAiCtaInfo?: string | null;
238
+ hasHighRiskGenAiInformTreatment?: boolean | null;
249
239
  createdAt?: string | null;
250
240
  createdAtTimestamp?: number | null;
251
241
  createdAtDate?: string | null;
252
- lastFetch?: string | null;
253
- lastFetchDatetime?: string | null;
254
- xLastUpdated?: string | null;
255
242
  [key: string]: unknown;
256
243
  }
257
244
  interface InstagramUser {
@@ -269,9 +256,6 @@ interface InstagramUser {
269
256
  profileUrl?: string | null;
270
257
  externalUrl?: string | null;
271
258
  hasAnonymousProfilePicture?: boolean | null;
272
- lastFetch?: string | null;
273
- lastFetchDatetime?: string | null;
274
- xLastUpdated?: string | null;
275
259
  aggRelevance?: number | null;
276
260
  relevantPostsCount?: number | null;
277
261
  relevantPostsLikesSum?: number | null;
@@ -299,9 +283,6 @@ interface InstagramComment {
299
283
  createdAt?: string | null;
300
284
  createdAtTimestamp?: number | null;
301
285
  createdAtDate?: string | null;
302
- lastFetch?: string | null;
303
- lastFetchDatetime?: string | null;
304
- xLastUpdated?: string | null;
305
286
  [key: string]: unknown;
306
287
  }
307
288
 
@@ -392,9 +373,6 @@ interface RedditPost {
392
373
  createdAt?: string | null;
393
374
  createdAtTimestamp?: number | null;
394
375
  createdAtDate?: string | null;
395
- lastFetch?: string | null;
396
- lastFetchDatetime?: string | null;
397
- xLastUpdated?: string | null;
398
376
  [key: string]: unknown;
399
377
  }
400
378
  interface RedditUser {
@@ -425,9 +403,6 @@ interface RedditUser {
425
403
  createdAt?: string | null;
426
404
  createdAtTimestamp?: number | null;
427
405
  createdAtDate?: string | null;
428
- lastFetch?: string | null;
429
- lastFetchDatetime?: string | null;
430
- xLastUpdated?: string | null;
431
406
  aggRelevance?: number | null;
432
407
  relevantPostsCount?: number | null;
433
408
  relevantPostsUpvotesSum?: number | null;
@@ -456,9 +431,6 @@ interface RedditComment {
456
431
  createdAt?: string | null;
457
432
  createdAtTimestamp?: number | null;
458
433
  createdAtDate?: string | null;
459
- lastFetch?: string | null;
460
- lastFetchDatetime?: string | null;
461
- xLastUpdated?: string | null;
462
434
  [key: string]: unknown;
463
435
  }
464
436
  interface RedditSubreddit {
@@ -481,9 +453,6 @@ interface RedditSubreddit {
481
453
  createdAt?: string | null;
482
454
  createdAtTimestamp?: number | null;
483
455
  createdAtDate?: string | null;
484
- lastFetch?: string | null;
485
- lastFetchDatetime?: string | null;
486
- xLastUpdated?: string | null;
487
456
  aggRelevance?: number | null;
488
457
  relevantPostsCount?: number | null;
489
458
  relevantPostsUpvotesSum?: number | null;
@@ -575,18 +544,12 @@ interface TiktokPost {
575
544
  downloadCount?: number | null;
576
545
  forwardCount?: number | null;
577
546
  playCount?: number | null;
547
+ hashtags?: string[] | null;
548
+ duration?: number | null;
549
+ videoUrl?: string[] | null;
578
550
  createdAt?: string | null;
579
551
  createdAtTimestamp?: number | null;
580
552
  createdAtDate?: string | null;
581
- lastFetch?: string | null;
582
- lastFetchDatetime?: string | null;
583
- xLastUpdated?: string | null;
584
- aggRelevance?: number | null;
585
- relevantPostsCount?: number | null;
586
- relevantPostsLikesSum?: number | null;
587
- relevantPostsCommentsSum?: number | null;
588
- relevantPostsPlaysSum?: number | null;
589
- relevantPostsForwardsSum?: number | null;
590
553
  [key: string]: unknown;
591
554
  }
592
555
  interface TiktokUser {
@@ -606,9 +569,6 @@ interface TiktokUser {
606
569
  region?: string | null;
607
570
  createdAt?: string | null;
608
571
  usernameModifyTime?: string | null;
609
- lastFetch?: string | null;
610
- lastFetchDatetime?: string | null;
611
- xLastUpdated?: string | null;
612
572
  aggRelevance?: number | null;
613
573
  relevantPostsCount?: number | null;
614
574
  relevantPostsLikesSum?: number | null;
@@ -627,9 +587,6 @@ interface TiktokComment {
627
587
  createdAt?: string | null;
628
588
  createdAtTimestamp?: number | null;
629
589
  createdAtDate?: string | null;
630
- lastFetch?: string | null;
631
- lastFetchDatetime?: string | null;
632
- xLastUpdated?: string | null;
633
590
  [key: string]: unknown;
634
591
  }
635
592
 
@@ -677,6 +634,22 @@ declare class TiktokNamespace extends BaseNamespace {
677
634
  responseType?: ResponseType;
678
635
  limit?: number;
679
636
  }): Promise<PaginatedResult<TiktokUser>>;
637
+ getPostsByHashtags(hashtags: string[], options?: {
638
+ fields?: string[];
639
+ startDate?: string;
640
+ endDate?: string;
641
+ forceLatest?: boolean;
642
+ responseType?: ResponseType;
643
+ limit?: number;
644
+ }): Promise<PaginatedResult<TiktokPost>>;
645
+ getUsersByHashtags(hashtags: string[], options?: {
646
+ fields?: string[];
647
+ startDate?: string;
648
+ endDate?: string;
649
+ forceLatest?: boolean;
650
+ responseType?: ResponseType;
651
+ limit?: number;
652
+ }): Promise<PaginatedResult<TiktokUser>>;
680
653
  }
681
654
 
682
655
  declare enum TrackedItemType {
@@ -758,7 +731,7 @@ declare class OperationCancelledError extends XpozError {
758
731
  constructor(operationId: string);
759
732
  }
760
733
 
761
- declare const VERSION = "0.4.0";
734
+ declare const VERSION = "0.4.2";
762
735
 
763
736
  declare function checkForUpdates(): Promise<void>;
764
737
 
package/dist/index.d.ts CHANGED
@@ -53,11 +53,15 @@ interface TwitterPost {
53
53
  conversationId?: string | null;
54
54
  lang?: string | null;
55
55
  source?: string | null;
56
- status?: string | null;
57
56
  deleted?: boolean | null;
58
57
  suspended?: boolean | null;
59
58
  possiblySensitive?: boolean | null;
60
59
  isRetweet?: boolean | null;
60
+ hasBirdwatchNotes?: boolean | null;
61
+ birdwatchNotesId?: string | null;
62
+ birdwatchNotesText?: string | null;
63
+ birdwatchNotesUrl?: string | null;
64
+ status?: string | null;
61
65
  likeCount?: number | null;
62
66
  retweetCount?: number | null;
63
67
  replyCount?: number | null;
@@ -71,22 +75,16 @@ interface TwitterPost {
71
75
  replyToUsername?: string | null;
72
76
  originalTweetId?: string | null;
73
77
  editedTweets?: string[] | null;
74
- replySettings?: string | null;
75
78
  hashtags?: string[] | null;
76
79
  mentions?: string[] | null;
77
80
  mediaUrls?: string[] | null;
78
- grokGeneratedContent?: Record<string, unknown>[] | null;
79
81
  urls?: string[] | null;
82
+ grokGeneratedContent?: Record<string, unknown>[] | null;
80
83
  country?: string | null;
81
84
  region?: string | null;
82
85
  city?: string | null;
83
- hasBirdwatchNotes?: boolean | null;
84
- birdwatchNotesId?: string | null;
85
- birdwatchNotesText?: string | null;
86
- birdwatchNotesUrl?: string | null;
87
86
  createdAt?: string | null;
88
87
  createdAtDate?: string | null;
89
- xFetchedAt?: string | null;
90
88
  [key: string]: unknown;
91
89
  }
92
90
  interface TwitterUser {
@@ -115,25 +113,13 @@ interface TwitterUser {
115
113
  locationAccurate?: boolean | null;
116
114
  label?: string | null;
117
115
  labelType?: string | null;
118
- collectedFollowingCount?: number | null;
119
- collectedFollowersCount?: number | null;
120
- collectedFollowersCoverage?: number | null;
121
- collectedFollowingCoverage?: number | null;
122
- avgTweetsPerDayLastMonth?: number | null;
123
116
  nLang?: number | null;
124
117
  nLangsFiltered?: number | null;
125
- inauthenticType?: string | null;
126
- isInauthentic?: boolean | null;
127
- isInauthenticProbScore?: number | null;
128
- isInauthenticCalculatedAt?: string | null;
129
118
  verifiedSinceDatetime?: string | null;
130
119
  usernameChanges?: string[] | null;
131
120
  lastUsernameChangeDatetime?: string | null;
132
121
  createdAt?: string | null;
133
- createdAtDate?: string | null;
134
- xFetchedAt?: string | null;
135
122
  modifiedAt?: string | null;
136
- xModifiedAt?: string | null;
137
123
  aggRelevance?: number | null;
138
124
  relevantTweetsCount?: number | null;
139
125
  relevantTweetsImpressionsSum?: number | null;
@@ -213,6 +199,8 @@ declare class TwitterNamespace extends BaseNamespace {
213
199
  getUserConnections(username: string, connectionType: string, options?: {
214
200
  fields?: string[];
215
201
  forceLatest?: boolean;
202
+ responseType?: ResponseType;
203
+ limit?: number;
216
204
  }): Promise<PaginatedResult<TwitterUser>>;
217
205
  getUsersByKeywords(query: string, options?: {
218
206
  fields?: string[];
@@ -246,12 +234,11 @@ interface InstagramPost {
246
234
  reshareCount?: number | null;
247
235
  videoPlayCount?: number | null;
248
236
  location?: string | null;
237
+ genAiChatWithAiCtaInfo?: string | null;
238
+ hasHighRiskGenAiInformTreatment?: boolean | null;
249
239
  createdAt?: string | null;
250
240
  createdAtTimestamp?: number | null;
251
241
  createdAtDate?: string | null;
252
- lastFetch?: string | null;
253
- lastFetchDatetime?: string | null;
254
- xLastUpdated?: string | null;
255
242
  [key: string]: unknown;
256
243
  }
257
244
  interface InstagramUser {
@@ -269,9 +256,6 @@ interface InstagramUser {
269
256
  profileUrl?: string | null;
270
257
  externalUrl?: string | null;
271
258
  hasAnonymousProfilePicture?: boolean | null;
272
- lastFetch?: string | null;
273
- lastFetchDatetime?: string | null;
274
- xLastUpdated?: string | null;
275
259
  aggRelevance?: number | null;
276
260
  relevantPostsCount?: number | null;
277
261
  relevantPostsLikesSum?: number | null;
@@ -299,9 +283,6 @@ interface InstagramComment {
299
283
  createdAt?: string | null;
300
284
  createdAtTimestamp?: number | null;
301
285
  createdAtDate?: string | null;
302
- lastFetch?: string | null;
303
- lastFetchDatetime?: string | null;
304
- xLastUpdated?: string | null;
305
286
  [key: string]: unknown;
306
287
  }
307
288
 
@@ -392,9 +373,6 @@ interface RedditPost {
392
373
  createdAt?: string | null;
393
374
  createdAtTimestamp?: number | null;
394
375
  createdAtDate?: string | null;
395
- lastFetch?: string | null;
396
- lastFetchDatetime?: string | null;
397
- xLastUpdated?: string | null;
398
376
  [key: string]: unknown;
399
377
  }
400
378
  interface RedditUser {
@@ -425,9 +403,6 @@ interface RedditUser {
425
403
  createdAt?: string | null;
426
404
  createdAtTimestamp?: number | null;
427
405
  createdAtDate?: string | null;
428
- lastFetch?: string | null;
429
- lastFetchDatetime?: string | null;
430
- xLastUpdated?: string | null;
431
406
  aggRelevance?: number | null;
432
407
  relevantPostsCount?: number | null;
433
408
  relevantPostsUpvotesSum?: number | null;
@@ -456,9 +431,6 @@ interface RedditComment {
456
431
  createdAt?: string | null;
457
432
  createdAtTimestamp?: number | null;
458
433
  createdAtDate?: string | null;
459
- lastFetch?: string | null;
460
- lastFetchDatetime?: string | null;
461
- xLastUpdated?: string | null;
462
434
  [key: string]: unknown;
463
435
  }
464
436
  interface RedditSubreddit {
@@ -481,9 +453,6 @@ interface RedditSubreddit {
481
453
  createdAt?: string | null;
482
454
  createdAtTimestamp?: number | null;
483
455
  createdAtDate?: string | null;
484
- lastFetch?: string | null;
485
- lastFetchDatetime?: string | null;
486
- xLastUpdated?: string | null;
487
456
  aggRelevance?: number | null;
488
457
  relevantPostsCount?: number | null;
489
458
  relevantPostsUpvotesSum?: number | null;
@@ -575,18 +544,12 @@ interface TiktokPost {
575
544
  downloadCount?: number | null;
576
545
  forwardCount?: number | null;
577
546
  playCount?: number | null;
547
+ hashtags?: string[] | null;
548
+ duration?: number | null;
549
+ videoUrl?: string[] | null;
578
550
  createdAt?: string | null;
579
551
  createdAtTimestamp?: number | null;
580
552
  createdAtDate?: string | null;
581
- lastFetch?: string | null;
582
- lastFetchDatetime?: string | null;
583
- xLastUpdated?: string | null;
584
- aggRelevance?: number | null;
585
- relevantPostsCount?: number | null;
586
- relevantPostsLikesSum?: number | null;
587
- relevantPostsCommentsSum?: number | null;
588
- relevantPostsPlaysSum?: number | null;
589
- relevantPostsForwardsSum?: number | null;
590
553
  [key: string]: unknown;
591
554
  }
592
555
  interface TiktokUser {
@@ -606,9 +569,6 @@ interface TiktokUser {
606
569
  region?: string | null;
607
570
  createdAt?: string | null;
608
571
  usernameModifyTime?: string | null;
609
- lastFetch?: string | null;
610
- lastFetchDatetime?: string | null;
611
- xLastUpdated?: string | null;
612
572
  aggRelevance?: number | null;
613
573
  relevantPostsCount?: number | null;
614
574
  relevantPostsLikesSum?: number | null;
@@ -627,9 +587,6 @@ interface TiktokComment {
627
587
  createdAt?: string | null;
628
588
  createdAtTimestamp?: number | null;
629
589
  createdAtDate?: string | null;
630
- lastFetch?: string | null;
631
- lastFetchDatetime?: string | null;
632
- xLastUpdated?: string | null;
633
590
  [key: string]: unknown;
634
591
  }
635
592
 
@@ -677,6 +634,22 @@ declare class TiktokNamespace extends BaseNamespace {
677
634
  responseType?: ResponseType;
678
635
  limit?: number;
679
636
  }): Promise<PaginatedResult<TiktokUser>>;
637
+ getPostsByHashtags(hashtags: string[], options?: {
638
+ fields?: string[];
639
+ startDate?: string;
640
+ endDate?: string;
641
+ forceLatest?: boolean;
642
+ responseType?: ResponseType;
643
+ limit?: number;
644
+ }): Promise<PaginatedResult<TiktokPost>>;
645
+ getUsersByHashtags(hashtags: string[], options?: {
646
+ fields?: string[];
647
+ startDate?: string;
648
+ endDate?: string;
649
+ forceLatest?: boolean;
650
+ responseType?: ResponseType;
651
+ limit?: number;
652
+ }): Promise<PaginatedResult<TiktokUser>>;
680
653
  }
681
654
 
682
655
  declare enum TrackedItemType {
@@ -758,7 +731,7 @@ declare class OperationCancelledError extends XpozError {
758
731
  constructor(operationId: string);
759
732
  }
760
733
 
761
- declare const VERSION = "0.4.0";
734
+ declare const VERSION = "0.4.2";
762
735
 
763
736
  declare function checkForUpdates(): Promise<void>;
764
737
 
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.4.0";
251
+ var VERSION = "0.4.2";
252
252
 
253
253
  // src/mcp/transport.ts
254
254
  var USER_AGENT = `xpoz-ts-sdk/${VERSION}`;
@@ -492,7 +492,7 @@ var BaseNamespace = class {
492
492
  String(result["error"] ?? "Unknown error")
493
493
  );
494
494
  }
495
- if (result["status"] === "success" || "results" in result) {
495
+ if (result["status"] === "success" || result["status"] === "no_data" || "results" in result) {
496
496
  return result;
497
497
  }
498
498
  const operationId = result["operationId"];
@@ -581,10 +581,12 @@ 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";
@@ -1079,6 +1081,26 @@ var TiktokNamespace = class extends BaseNamespace {
1079
1081
  args
1080
1082
  );
1081
1083
  }
1084
+ async getPostsByHashtags(hashtags, options = {}) {
1085
+ const args = this.buildArgs({ hashtags, ...options });
1086
+ const result = await this.callAndMaybePoll(GET_TIKTOK_POSTS_BY_HASHTAGS, args);
1087
+ return this.buildPaginatedResult(
1088
+ result,
1089
+ parsePost3,
1090
+ GET_TIKTOK_POSTS_BY_HASHTAGS,
1091
+ args
1092
+ );
1093
+ }
1094
+ async getUsersByHashtags(hashtags, options = {}) {
1095
+ const args = this.buildArgs({ hashtags, ...options });
1096
+ const result = await this.callAndMaybePoll(GET_TIKTOK_USERS_BY_HASHTAGS, args);
1097
+ return this.buildPaginatedResult(
1098
+ result,
1099
+ parseUser4,
1100
+ GET_TIKTOK_USERS_BY_HASHTAGS,
1101
+ args
1102
+ );
1103
+ }
1082
1104
  };
1083
1105
 
1084
1106
  // src/namespaces/tracking.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xpoz/xpoz",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "TypeScript SDK for the Xpoz social media intelligence platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -18,6 +18,8 @@
18
18
  ],
19
19
  "scripts": {
20
20
  "build": "tsup src/index.ts --format cjs,esm --dts --clean",
21
+ "build:scripts": "tsup src/scripts/generate-expectations.ts --format esm --out-dir dist/scripts",
22
+ "generate-expectations": "node dist/scripts/generate-expectations.js",
21
23
  "typecheck": "tsc --noEmit",
22
24
  "test": "vitest run",
23
25
  "prepublishOnly": "npm run build"