@xpoz/xpoz 0.8.0 → 0.8.1

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/dist/index.cjs CHANGED
@@ -301,7 +301,7 @@ function coerce(value) {
301
301
  }
302
302
 
303
303
  // src/version.ts
304
- var VERSION = "0.8.0";
304
+ var VERSION = "0.8.1";
305
305
 
306
306
  // src/mcp/transport.ts
307
307
  var USER_AGENT = `xpoz-ts-sdk/${VERSION}`;
@@ -1061,20 +1061,20 @@ var TwitterNamespace = class extends BaseNamespace {
1061
1061
  );
1062
1062
  }
1063
1063
  async searchPosts(query, options = {}) {
1064
- const args = this.buildArgs({
1065
- query,
1066
- fields: options.fields,
1067
- startDate: options.startDate,
1068
- endDate: options.endDate,
1069
- authorUsername: options.authorUsername,
1070
- authorId: options.authorId,
1071
- language: options.language,
1072
- filterOutRetweets: options.filterOutRetweets,
1073
- forceLatest: options.forceLatest,
1074
- responseType: options.responseType,
1075
- limit: options.limit
1076
- });
1077
1064
  if (options.responseType === "csv" /* Csv */) {
1065
+ const args = this.buildArgs({
1066
+ query,
1067
+ fields: options.fields,
1068
+ startDate: options.startDate,
1069
+ endDate: options.endDate,
1070
+ authorUsername: options.authorUsername,
1071
+ authorId: options.authorId,
1072
+ language: options.language,
1073
+ filterOutRetweets: options.filterOutRetweets,
1074
+ forceLatest: options.forceLatest,
1075
+ responseType: options.responseType,
1076
+ limit: options.limit
1077
+ });
1078
1078
  const raw = await this.callTool(SEARCH_TWITTER_POSTS, args);
1079
1079
  const exportOpId = raw["operationId"] ?? raw["dataDumpExportOperationId"] ?? null;
1080
1080
  const csvRaw = {
@@ -1088,15 +1088,24 @@ var TwitterNamespace = class extends BaseNamespace {
1088
1088
  args
1089
1089
  );
1090
1090
  }
1091
- const result = await this.callAndMaybePoll(
1092
- SEARCH_TWITTER_POSTS,
1093
- args
1091
+ const params = {
1092
+ q: query,
1093
+ since: options.startDate,
1094
+ until: options.endDate,
1095
+ username: options.authorUsername,
1096
+ lang: options.language,
1097
+ fields: csvFields(options.fields)
1098
+ };
1099
+ const response = await this.rest.get(
1100
+ TWITTER_LIVE_ROUTES.posts,
1101
+ params
1094
1102
  );
1095
- return this.buildPaginatedResult(
1096
- result,
1097
- parseTwitterPost,
1098
- SEARCH_TWITTER_POSTS,
1099
- args
1103
+ return this.cursorToPaginatedResult(
1104
+ response,
1105
+ (cursor) => this.rest.get(
1106
+ TWITTER_LIVE_ROUTES.posts,
1107
+ { ...params, cursor }
1108
+ )
1100
1109
  );
1101
1110
  }
1102
1111
  async getRetweets(postId, options = {}) {
package/dist/index.d.cts CHANGED
@@ -978,7 +978,7 @@ declare class OperationCancelledError extends XpozError {
978
978
  constructor(operationId: string);
979
979
  }
980
980
 
981
- declare const VERSION = "0.8.0";
981
+ declare const VERSION = "0.8.1";
982
982
 
983
983
  declare function checkForUpdates(): Promise<void>;
984
984
 
package/dist/index.d.ts CHANGED
@@ -978,7 +978,7 @@ declare class OperationCancelledError extends XpozError {
978
978
  constructor(operationId: string);
979
979
  }
980
980
 
981
- declare const VERSION = "0.8.0";
981
+ declare const VERSION = "0.8.1";
982
982
 
983
983
  declare function checkForUpdates(): Promise<void>;
984
984
 
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.8.0";
251
+ var VERSION = "0.8.1";
252
252
 
253
253
  // src/mcp/transport.ts
254
254
  var USER_AGENT = `xpoz-ts-sdk/${VERSION}`;
@@ -1008,20 +1008,20 @@ var TwitterNamespace = class extends BaseNamespace {
1008
1008
  );
1009
1009
  }
1010
1010
  async searchPosts(query, options = {}) {
1011
- const args = this.buildArgs({
1012
- query,
1013
- fields: options.fields,
1014
- startDate: options.startDate,
1015
- endDate: options.endDate,
1016
- authorUsername: options.authorUsername,
1017
- authorId: options.authorId,
1018
- language: options.language,
1019
- filterOutRetweets: options.filterOutRetweets,
1020
- forceLatest: options.forceLatest,
1021
- responseType: options.responseType,
1022
- limit: options.limit
1023
- });
1024
1011
  if (options.responseType === "csv" /* Csv */) {
1012
+ const args = this.buildArgs({
1013
+ query,
1014
+ fields: options.fields,
1015
+ startDate: options.startDate,
1016
+ endDate: options.endDate,
1017
+ authorUsername: options.authorUsername,
1018
+ authorId: options.authorId,
1019
+ language: options.language,
1020
+ filterOutRetweets: options.filterOutRetweets,
1021
+ forceLatest: options.forceLatest,
1022
+ responseType: options.responseType,
1023
+ limit: options.limit
1024
+ });
1025
1025
  const raw = await this.callTool(SEARCH_TWITTER_POSTS, args);
1026
1026
  const exportOpId = raw["operationId"] ?? raw["dataDumpExportOperationId"] ?? null;
1027
1027
  const csvRaw = {
@@ -1035,15 +1035,24 @@ var TwitterNamespace = class extends BaseNamespace {
1035
1035
  args
1036
1036
  );
1037
1037
  }
1038
- const result = await this.callAndMaybePoll(
1039
- SEARCH_TWITTER_POSTS,
1040
- args
1038
+ const params = {
1039
+ q: query,
1040
+ since: options.startDate,
1041
+ until: options.endDate,
1042
+ username: options.authorUsername,
1043
+ lang: options.language,
1044
+ fields: csvFields(options.fields)
1045
+ };
1046
+ const response = await this.rest.get(
1047
+ TWITTER_LIVE_ROUTES.posts,
1048
+ params
1041
1049
  );
1042
- return this.buildPaginatedResult(
1043
- result,
1044
- parseTwitterPost,
1045
- SEARCH_TWITTER_POSTS,
1046
- args
1050
+ return this.cursorToPaginatedResult(
1051
+ response,
1052
+ (cursor) => this.rest.get(
1053
+ TWITTER_LIVE_ROUTES.posts,
1054
+ { ...params, cursor }
1055
+ )
1047
1056
  );
1048
1057
  }
1049
1058
  async getRetweets(postId, options = {}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xpoz/xpoz",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "TypeScript SDK for the Xpoz social media intelligence platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",