@xpoz/xpoz 0.6.13 → 0.8.0
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 +35 -36
- package/dist/index.cjs +464 -168
- package/dist/index.d.cts +107 -45
- package/dist/index.d.ts +107 -45
- package/dist/index.js +464 -168
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -26,6 +26,13 @@ declare class RestTransport {
|
|
|
26
26
|
get<T>(path: string, params?: QueryParams): Promise<T>;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
declare abstract class LiveNamespace {
|
|
30
|
+
protected transport: RestTransport;
|
|
31
|
+
constructor(transport: RestTransport);
|
|
32
|
+
protected page<T>(path: string, params: QueryParams): Promise<CursorResult<T>>;
|
|
33
|
+
protected single<T>(path: string, params: QueryParams): Promise<T | null>;
|
|
34
|
+
}
|
|
35
|
+
|
|
29
36
|
interface CursorPageResponse<T> {
|
|
30
37
|
results: T[];
|
|
31
38
|
count: number;
|
|
@@ -35,6 +42,9 @@ interface CursorPageResponse<T> {
|
|
|
35
42
|
}
|
|
36
43
|
type InstagramConnectionType = "followers" | "following";
|
|
37
44
|
type InstagramInteractionType = "commenters" | "likers";
|
|
45
|
+
type TwitterConnectionType = "followers" | "following";
|
|
46
|
+
type TwitterInteractionType = "commenters" | "quoters" | "retweeters";
|
|
47
|
+
type TwitterLiveSortBy = "relevance" | "latest";
|
|
38
48
|
interface PaginationInfo {
|
|
39
49
|
tableName?: string | null;
|
|
40
50
|
totalRows: number;
|
|
@@ -63,6 +73,8 @@ interface InstagramPost {
|
|
|
63
73
|
likeCount?: number | null;
|
|
64
74
|
commentCount?: number | null;
|
|
65
75
|
reshareCount?: number | null;
|
|
76
|
+
mediaRepostCount?: number | null;
|
|
77
|
+
saveCount?: number | null;
|
|
66
78
|
videoPlayCount?: number | null;
|
|
67
79
|
location?: string | null;
|
|
68
80
|
genAiChatWithAiCtaInfo?: string | null;
|
|
@@ -92,6 +104,8 @@ interface InstagramUser {
|
|
|
92
104
|
relevantPostsLikesSum?: number | null;
|
|
93
105
|
relevantPostsCommentsSum?: number | null;
|
|
94
106
|
relevantPostsResharesSum?: number | null;
|
|
107
|
+
relevantPostsMediaRepostsSum?: number | null;
|
|
108
|
+
relevantPostsSavesSum?: number | null;
|
|
95
109
|
relevantPostsVideoPlaysSum?: number | null;
|
|
96
110
|
[key: string]: unknown;
|
|
97
111
|
}
|
|
@@ -117,11 +131,7 @@ interface InstagramComment {
|
|
|
117
131
|
[key: string]: unknown;
|
|
118
132
|
}
|
|
119
133
|
|
|
120
|
-
declare class InstagramLiveNamespace {
|
|
121
|
-
private transport;
|
|
122
|
-
constructor(transport: RestTransport);
|
|
123
|
-
private page;
|
|
124
|
-
private single;
|
|
134
|
+
declare class InstagramLiveNamespace extends LiveNamespace {
|
|
125
135
|
searchPosts(query: string, options?: {
|
|
126
136
|
fields?: string[];
|
|
127
137
|
cursor?: string;
|
|
@@ -154,44 +164,6 @@ declare class InstagramLiveNamespace {
|
|
|
154
164
|
}): Promise<CursorResult<InstagramUser>>;
|
|
155
165
|
}
|
|
156
166
|
|
|
157
|
-
type FetchPage<T> = (pageNumber: number, tableName: string | null | undefined) => Promise<PaginatedResult<T>>;
|
|
158
|
-
type FetchExport = (exportOperationId: string) => Promise<string>;
|
|
159
|
-
declare class PaginatedResult<T> {
|
|
160
|
-
data: T[];
|
|
161
|
-
pagination: PaginationInfo;
|
|
162
|
-
private _tableName;
|
|
163
|
-
private _exportOperationId;
|
|
164
|
-
private _fetchPage;
|
|
165
|
-
private _fetchExport;
|
|
166
|
-
constructor(options: {
|
|
167
|
-
data: T[];
|
|
168
|
-
pagination: PaginationInfo;
|
|
169
|
-
tableName: string | null | undefined;
|
|
170
|
-
exportOperationId: string | null | undefined;
|
|
171
|
-
fetchPage: FetchPage<T>;
|
|
172
|
-
fetchExport: FetchExport | null;
|
|
173
|
-
});
|
|
174
|
-
hasNextPage(): boolean;
|
|
175
|
-
nextPage(): Promise<PaginatedResult<T>>;
|
|
176
|
-
getPage(pageNumber: number): Promise<PaginatedResult<T>>;
|
|
177
|
-
exportCsv(): Promise<string>;
|
|
178
|
-
private _fetchPageResult;
|
|
179
|
-
toString(): string;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
type CallTool = (name: string, args: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
183
|
-
type RawDict = Record<string, unknown>;
|
|
184
|
-
declare class BaseNamespace {
|
|
185
|
-
protected callTool: CallTool;
|
|
186
|
-
protected timeoutMs: number;
|
|
187
|
-
constructor(callTool: CallTool, timeoutMs?: number);
|
|
188
|
-
protected callAndMaybePoll(toolName: string, args: RawDict): Promise<RawDict>;
|
|
189
|
-
protected buildPaginatedResult<T>(raw: RawDict, parseItem: (item: RawDict) => T, toolName: string, baseArgs: RawDict): PaginatedResult<T>;
|
|
190
|
-
protected buildArgs(args: Record<string, unknown>): RawDict;
|
|
191
|
-
protected extractPagination(raw: RawDict): PaginationInfo;
|
|
192
|
-
protected extractResults(raw: RawDict): RawDict[];
|
|
193
|
-
}
|
|
194
|
-
|
|
195
167
|
interface TwitterPost {
|
|
196
168
|
id?: string | null;
|
|
197
169
|
text?: string | null;
|
|
@@ -279,6 +251,88 @@ interface TwitterUser {
|
|
|
279
251
|
[key: string]: unknown;
|
|
280
252
|
}
|
|
281
253
|
|
|
254
|
+
declare class TwitterLiveNamespace extends LiveNamespace {
|
|
255
|
+
searchPosts(query: string, options?: {
|
|
256
|
+
since?: string;
|
|
257
|
+
until?: string;
|
|
258
|
+
lang?: string;
|
|
259
|
+
countryCode?: string;
|
|
260
|
+
sortBy?: TwitterLiveSortBy;
|
|
261
|
+
fields?: string[];
|
|
262
|
+
cursor?: string;
|
|
263
|
+
}): Promise<CursorResult<TwitterPost>>;
|
|
264
|
+
getPostsByUser(username: string, options?: {
|
|
265
|
+
since?: string;
|
|
266
|
+
until?: string;
|
|
267
|
+
fields?: string[];
|
|
268
|
+
cursor?: string;
|
|
269
|
+
}): Promise<CursorResult<TwitterPost>>;
|
|
270
|
+
getPost(postId: string, options?: {
|
|
271
|
+
fields?: string[];
|
|
272
|
+
}): Promise<TwitterPost | null>;
|
|
273
|
+
getComments(postId: string, options?: {
|
|
274
|
+
fields?: string[];
|
|
275
|
+
cursor?: string;
|
|
276
|
+
}): Promise<CursorResult<TwitterPost>>;
|
|
277
|
+
getQuotes(postId: string, options?: {
|
|
278
|
+
fields?: string[];
|
|
279
|
+
cursor?: string;
|
|
280
|
+
}): Promise<CursorResult<TwitterPost>>;
|
|
281
|
+
getPostInteractingUsers(postId: string, interactionType: TwitterInteractionType, options?: {
|
|
282
|
+
fields?: string[];
|
|
283
|
+
cursor?: string;
|
|
284
|
+
}): Promise<CursorResult<TwitterUser>>;
|
|
285
|
+
searchUsers(query: string, options?: {
|
|
286
|
+
fields?: string[];
|
|
287
|
+
cursor?: string;
|
|
288
|
+
}): Promise<CursorResult<TwitterUser>>;
|
|
289
|
+
getUser(username: string, options?: {
|
|
290
|
+
fields?: string[];
|
|
291
|
+
}): Promise<TwitterUser | null>;
|
|
292
|
+
getUserConnections(username: string, connectionType: TwitterConnectionType, options?: {
|
|
293
|
+
fields?: string[];
|
|
294
|
+
cursor?: string;
|
|
295
|
+
}): Promise<CursorResult<TwitterUser>>;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
type FetchPage<T> = (pageNumber: number, tableName: string | null | undefined) => Promise<PaginatedResult<T>>;
|
|
299
|
+
type FetchExport = (exportOperationId: string) => Promise<string>;
|
|
300
|
+
declare class PaginatedResult<T> {
|
|
301
|
+
data: T[];
|
|
302
|
+
pagination: PaginationInfo;
|
|
303
|
+
private _tableName;
|
|
304
|
+
private _exportOperationId;
|
|
305
|
+
private _fetchPage;
|
|
306
|
+
private _fetchExport;
|
|
307
|
+
constructor(options: {
|
|
308
|
+
data: T[];
|
|
309
|
+
pagination: PaginationInfo;
|
|
310
|
+
tableName: string | null | undefined;
|
|
311
|
+
exportOperationId: string | null | undefined;
|
|
312
|
+
fetchPage: FetchPage<T>;
|
|
313
|
+
fetchExport: FetchExport | null;
|
|
314
|
+
});
|
|
315
|
+
hasNextPage(): boolean;
|
|
316
|
+
nextPage(): Promise<PaginatedResult<T>>;
|
|
317
|
+
getPage(pageNumber: number): Promise<PaginatedResult<T>>;
|
|
318
|
+
exportCsv(): Promise<string>;
|
|
319
|
+
private _fetchPageResult;
|
|
320
|
+
toString(): string;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
type CallTool = (name: string, args: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
324
|
+
type RawDict = Record<string, unknown>;
|
|
325
|
+
declare class BaseNamespace {
|
|
326
|
+
protected callTool: CallTool;
|
|
327
|
+
protected timeoutMs: number;
|
|
328
|
+
constructor(callTool: CallTool, timeoutMs?: number);
|
|
329
|
+
protected callAndMaybePoll(toolName: string, args: RawDict): Promise<RawDict>;
|
|
330
|
+
protected buildPaginatedResult<T>(raw: RawDict, parseItem: (item: RawDict) => T, toolName: string, baseArgs: RawDict): PaginatedResult<T>;
|
|
331
|
+
protected buildArgs(args: Record<string, unknown>): RawDict;
|
|
332
|
+
protected extractPagination(raw: RawDict): PaginationInfo;
|
|
333
|
+
protected extractResults(raw: RawDict): RawDict[];
|
|
334
|
+
}
|
|
335
|
+
|
|
282
336
|
declare enum ResponseType {
|
|
283
337
|
Fast = "fast",
|
|
284
338
|
Paging = "paging",
|
|
@@ -286,6 +340,9 @@ declare enum ResponseType {
|
|
|
286
340
|
}
|
|
287
341
|
|
|
288
342
|
declare class TwitterNamespace extends BaseNamespace {
|
|
343
|
+
private rest;
|
|
344
|
+
constructor(callTool: (name: string, args: Record<string, unknown>) => Promise<Record<string, unknown>>, timeoutMs: number, restTransport: RestTransport);
|
|
345
|
+
private cursorToPaginatedResult;
|
|
289
346
|
getPostsByIds(postIds: string[], options?: {
|
|
290
347
|
fields?: string[];
|
|
291
348
|
forceLatest?: boolean;
|
|
@@ -364,6 +421,9 @@ declare class TwitterNamespace extends BaseNamespace {
|
|
|
364
421
|
}
|
|
365
422
|
|
|
366
423
|
declare class InstagramNamespace extends BaseNamespace {
|
|
424
|
+
private rest;
|
|
425
|
+
constructor(callTool: (name: string, args: Record<string, unknown>) => Promise<Record<string, unknown>>, timeoutMs: number, restTransport: RestTransport);
|
|
426
|
+
private cursorToPaginatedResult;
|
|
367
427
|
getPostsByIds(postIds: string[], options?: {
|
|
368
428
|
fields?: string[];
|
|
369
429
|
forceLatest?: boolean;
|
|
@@ -873,6 +933,7 @@ declare class XpozClient {
|
|
|
873
933
|
private versionCheck;
|
|
874
934
|
private restTransport;
|
|
875
935
|
private instagramLiveNamespace?;
|
|
936
|
+
private twitterLiveNamespace?;
|
|
876
937
|
constructor(options?: {
|
|
877
938
|
apiKey?: string;
|
|
878
939
|
serverUrl?: string;
|
|
@@ -881,6 +942,7 @@ declare class XpozClient {
|
|
|
881
942
|
apiUrl?: string;
|
|
882
943
|
});
|
|
883
944
|
get instagramLive(): InstagramLiveNamespace;
|
|
945
|
+
get twitterLive(): TwitterLiveNamespace;
|
|
884
946
|
connect(): Promise<void>;
|
|
885
947
|
close(): Promise<void>;
|
|
886
948
|
[Symbol.asyncDispose](): Promise<void>;
|
|
@@ -916,8 +978,8 @@ declare class OperationCancelledError extends XpozError {
|
|
|
916
978
|
constructor(operationId: string);
|
|
917
979
|
}
|
|
918
980
|
|
|
919
|
-
declare const VERSION = "0.
|
|
981
|
+
declare const VERSION = "0.8.0";
|
|
920
982
|
|
|
921
983
|
declare function checkForUpdates(): Promise<void>;
|
|
922
984
|
|
|
923
|
-
export { type AccountBilling, type AccountDetails, type AccountUsage, type AddTrackedItemsResult, AuthenticationError, BillingPeriod, CreditResetFrequency, type CreditsUsageHistory, type CursorPageResponse, CursorResult, type InstagramComment, type InstagramConnectionType, type InstagramInteractionType, type InstagramPost, type InstagramUser, NotFoundError, 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, type UsageHistoryBucket, VERSION, ValidationError, XpozClient, XpozConnectionError, XpozError, checkForUpdates };
|
|
985
|
+
export { type AccountBilling, type AccountDetails, type AccountUsage, type AddTrackedItemsResult, AuthenticationError, BillingPeriod, CreditResetFrequency, type CreditsUsageHistory, type CursorPageResponse, CursorResult, type InstagramComment, type InstagramConnectionType, type InstagramInteractionType, type InstagramPost, type InstagramUser, NotFoundError, 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 TwitterConnectionType, type TwitterInteractionType, type TwitterLiveSortBy, type TwitterPost, type TwitterUser, type UsageHistoryBucket, VERSION, ValidationError, XpozClient, XpozConnectionError, XpozError, checkForUpdates };
|
package/dist/index.d.ts
CHANGED
|
@@ -26,6 +26,13 @@ declare class RestTransport {
|
|
|
26
26
|
get<T>(path: string, params?: QueryParams): Promise<T>;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
declare abstract class LiveNamespace {
|
|
30
|
+
protected transport: RestTransport;
|
|
31
|
+
constructor(transport: RestTransport);
|
|
32
|
+
protected page<T>(path: string, params: QueryParams): Promise<CursorResult<T>>;
|
|
33
|
+
protected single<T>(path: string, params: QueryParams): Promise<T | null>;
|
|
34
|
+
}
|
|
35
|
+
|
|
29
36
|
interface CursorPageResponse<T> {
|
|
30
37
|
results: T[];
|
|
31
38
|
count: number;
|
|
@@ -35,6 +42,9 @@ interface CursorPageResponse<T> {
|
|
|
35
42
|
}
|
|
36
43
|
type InstagramConnectionType = "followers" | "following";
|
|
37
44
|
type InstagramInteractionType = "commenters" | "likers";
|
|
45
|
+
type TwitterConnectionType = "followers" | "following";
|
|
46
|
+
type TwitterInteractionType = "commenters" | "quoters" | "retweeters";
|
|
47
|
+
type TwitterLiveSortBy = "relevance" | "latest";
|
|
38
48
|
interface PaginationInfo {
|
|
39
49
|
tableName?: string | null;
|
|
40
50
|
totalRows: number;
|
|
@@ -63,6 +73,8 @@ interface InstagramPost {
|
|
|
63
73
|
likeCount?: number | null;
|
|
64
74
|
commentCount?: number | null;
|
|
65
75
|
reshareCount?: number | null;
|
|
76
|
+
mediaRepostCount?: number | null;
|
|
77
|
+
saveCount?: number | null;
|
|
66
78
|
videoPlayCount?: number | null;
|
|
67
79
|
location?: string | null;
|
|
68
80
|
genAiChatWithAiCtaInfo?: string | null;
|
|
@@ -92,6 +104,8 @@ interface InstagramUser {
|
|
|
92
104
|
relevantPostsLikesSum?: number | null;
|
|
93
105
|
relevantPostsCommentsSum?: number | null;
|
|
94
106
|
relevantPostsResharesSum?: number | null;
|
|
107
|
+
relevantPostsMediaRepostsSum?: number | null;
|
|
108
|
+
relevantPostsSavesSum?: number | null;
|
|
95
109
|
relevantPostsVideoPlaysSum?: number | null;
|
|
96
110
|
[key: string]: unknown;
|
|
97
111
|
}
|
|
@@ -117,11 +131,7 @@ interface InstagramComment {
|
|
|
117
131
|
[key: string]: unknown;
|
|
118
132
|
}
|
|
119
133
|
|
|
120
|
-
declare class InstagramLiveNamespace {
|
|
121
|
-
private transport;
|
|
122
|
-
constructor(transport: RestTransport);
|
|
123
|
-
private page;
|
|
124
|
-
private single;
|
|
134
|
+
declare class InstagramLiveNamespace extends LiveNamespace {
|
|
125
135
|
searchPosts(query: string, options?: {
|
|
126
136
|
fields?: string[];
|
|
127
137
|
cursor?: string;
|
|
@@ -154,44 +164,6 @@ declare class InstagramLiveNamespace {
|
|
|
154
164
|
}): Promise<CursorResult<InstagramUser>>;
|
|
155
165
|
}
|
|
156
166
|
|
|
157
|
-
type FetchPage<T> = (pageNumber: number, tableName: string | null | undefined) => Promise<PaginatedResult<T>>;
|
|
158
|
-
type FetchExport = (exportOperationId: string) => Promise<string>;
|
|
159
|
-
declare class PaginatedResult<T> {
|
|
160
|
-
data: T[];
|
|
161
|
-
pagination: PaginationInfo;
|
|
162
|
-
private _tableName;
|
|
163
|
-
private _exportOperationId;
|
|
164
|
-
private _fetchPage;
|
|
165
|
-
private _fetchExport;
|
|
166
|
-
constructor(options: {
|
|
167
|
-
data: T[];
|
|
168
|
-
pagination: PaginationInfo;
|
|
169
|
-
tableName: string | null | undefined;
|
|
170
|
-
exportOperationId: string | null | undefined;
|
|
171
|
-
fetchPage: FetchPage<T>;
|
|
172
|
-
fetchExport: FetchExport | null;
|
|
173
|
-
});
|
|
174
|
-
hasNextPage(): boolean;
|
|
175
|
-
nextPage(): Promise<PaginatedResult<T>>;
|
|
176
|
-
getPage(pageNumber: number): Promise<PaginatedResult<T>>;
|
|
177
|
-
exportCsv(): Promise<string>;
|
|
178
|
-
private _fetchPageResult;
|
|
179
|
-
toString(): string;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
type CallTool = (name: string, args: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
183
|
-
type RawDict = Record<string, unknown>;
|
|
184
|
-
declare class BaseNamespace {
|
|
185
|
-
protected callTool: CallTool;
|
|
186
|
-
protected timeoutMs: number;
|
|
187
|
-
constructor(callTool: CallTool, timeoutMs?: number);
|
|
188
|
-
protected callAndMaybePoll(toolName: string, args: RawDict): Promise<RawDict>;
|
|
189
|
-
protected buildPaginatedResult<T>(raw: RawDict, parseItem: (item: RawDict) => T, toolName: string, baseArgs: RawDict): PaginatedResult<T>;
|
|
190
|
-
protected buildArgs(args: Record<string, unknown>): RawDict;
|
|
191
|
-
protected extractPagination(raw: RawDict): PaginationInfo;
|
|
192
|
-
protected extractResults(raw: RawDict): RawDict[];
|
|
193
|
-
}
|
|
194
|
-
|
|
195
167
|
interface TwitterPost {
|
|
196
168
|
id?: string | null;
|
|
197
169
|
text?: string | null;
|
|
@@ -279,6 +251,88 @@ interface TwitterUser {
|
|
|
279
251
|
[key: string]: unknown;
|
|
280
252
|
}
|
|
281
253
|
|
|
254
|
+
declare class TwitterLiveNamespace extends LiveNamespace {
|
|
255
|
+
searchPosts(query: string, options?: {
|
|
256
|
+
since?: string;
|
|
257
|
+
until?: string;
|
|
258
|
+
lang?: string;
|
|
259
|
+
countryCode?: string;
|
|
260
|
+
sortBy?: TwitterLiveSortBy;
|
|
261
|
+
fields?: string[];
|
|
262
|
+
cursor?: string;
|
|
263
|
+
}): Promise<CursorResult<TwitterPost>>;
|
|
264
|
+
getPostsByUser(username: string, options?: {
|
|
265
|
+
since?: string;
|
|
266
|
+
until?: string;
|
|
267
|
+
fields?: string[];
|
|
268
|
+
cursor?: string;
|
|
269
|
+
}): Promise<CursorResult<TwitterPost>>;
|
|
270
|
+
getPost(postId: string, options?: {
|
|
271
|
+
fields?: string[];
|
|
272
|
+
}): Promise<TwitterPost | null>;
|
|
273
|
+
getComments(postId: string, options?: {
|
|
274
|
+
fields?: string[];
|
|
275
|
+
cursor?: string;
|
|
276
|
+
}): Promise<CursorResult<TwitterPost>>;
|
|
277
|
+
getQuotes(postId: string, options?: {
|
|
278
|
+
fields?: string[];
|
|
279
|
+
cursor?: string;
|
|
280
|
+
}): Promise<CursorResult<TwitterPost>>;
|
|
281
|
+
getPostInteractingUsers(postId: string, interactionType: TwitterInteractionType, options?: {
|
|
282
|
+
fields?: string[];
|
|
283
|
+
cursor?: string;
|
|
284
|
+
}): Promise<CursorResult<TwitterUser>>;
|
|
285
|
+
searchUsers(query: string, options?: {
|
|
286
|
+
fields?: string[];
|
|
287
|
+
cursor?: string;
|
|
288
|
+
}): Promise<CursorResult<TwitterUser>>;
|
|
289
|
+
getUser(username: string, options?: {
|
|
290
|
+
fields?: string[];
|
|
291
|
+
}): Promise<TwitterUser | null>;
|
|
292
|
+
getUserConnections(username: string, connectionType: TwitterConnectionType, options?: {
|
|
293
|
+
fields?: string[];
|
|
294
|
+
cursor?: string;
|
|
295
|
+
}): Promise<CursorResult<TwitterUser>>;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
type FetchPage<T> = (pageNumber: number, tableName: string | null | undefined) => Promise<PaginatedResult<T>>;
|
|
299
|
+
type FetchExport = (exportOperationId: string) => Promise<string>;
|
|
300
|
+
declare class PaginatedResult<T> {
|
|
301
|
+
data: T[];
|
|
302
|
+
pagination: PaginationInfo;
|
|
303
|
+
private _tableName;
|
|
304
|
+
private _exportOperationId;
|
|
305
|
+
private _fetchPage;
|
|
306
|
+
private _fetchExport;
|
|
307
|
+
constructor(options: {
|
|
308
|
+
data: T[];
|
|
309
|
+
pagination: PaginationInfo;
|
|
310
|
+
tableName: string | null | undefined;
|
|
311
|
+
exportOperationId: string | null | undefined;
|
|
312
|
+
fetchPage: FetchPage<T>;
|
|
313
|
+
fetchExport: FetchExport | null;
|
|
314
|
+
});
|
|
315
|
+
hasNextPage(): boolean;
|
|
316
|
+
nextPage(): Promise<PaginatedResult<T>>;
|
|
317
|
+
getPage(pageNumber: number): Promise<PaginatedResult<T>>;
|
|
318
|
+
exportCsv(): Promise<string>;
|
|
319
|
+
private _fetchPageResult;
|
|
320
|
+
toString(): string;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
type CallTool = (name: string, args: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
324
|
+
type RawDict = Record<string, unknown>;
|
|
325
|
+
declare class BaseNamespace {
|
|
326
|
+
protected callTool: CallTool;
|
|
327
|
+
protected timeoutMs: number;
|
|
328
|
+
constructor(callTool: CallTool, timeoutMs?: number);
|
|
329
|
+
protected callAndMaybePoll(toolName: string, args: RawDict): Promise<RawDict>;
|
|
330
|
+
protected buildPaginatedResult<T>(raw: RawDict, parseItem: (item: RawDict) => T, toolName: string, baseArgs: RawDict): PaginatedResult<T>;
|
|
331
|
+
protected buildArgs(args: Record<string, unknown>): RawDict;
|
|
332
|
+
protected extractPagination(raw: RawDict): PaginationInfo;
|
|
333
|
+
protected extractResults(raw: RawDict): RawDict[];
|
|
334
|
+
}
|
|
335
|
+
|
|
282
336
|
declare enum ResponseType {
|
|
283
337
|
Fast = "fast",
|
|
284
338
|
Paging = "paging",
|
|
@@ -286,6 +340,9 @@ declare enum ResponseType {
|
|
|
286
340
|
}
|
|
287
341
|
|
|
288
342
|
declare class TwitterNamespace extends BaseNamespace {
|
|
343
|
+
private rest;
|
|
344
|
+
constructor(callTool: (name: string, args: Record<string, unknown>) => Promise<Record<string, unknown>>, timeoutMs: number, restTransport: RestTransport);
|
|
345
|
+
private cursorToPaginatedResult;
|
|
289
346
|
getPostsByIds(postIds: string[], options?: {
|
|
290
347
|
fields?: string[];
|
|
291
348
|
forceLatest?: boolean;
|
|
@@ -364,6 +421,9 @@ declare class TwitterNamespace extends BaseNamespace {
|
|
|
364
421
|
}
|
|
365
422
|
|
|
366
423
|
declare class InstagramNamespace extends BaseNamespace {
|
|
424
|
+
private rest;
|
|
425
|
+
constructor(callTool: (name: string, args: Record<string, unknown>) => Promise<Record<string, unknown>>, timeoutMs: number, restTransport: RestTransport);
|
|
426
|
+
private cursorToPaginatedResult;
|
|
367
427
|
getPostsByIds(postIds: string[], options?: {
|
|
368
428
|
fields?: string[];
|
|
369
429
|
forceLatest?: boolean;
|
|
@@ -873,6 +933,7 @@ declare class XpozClient {
|
|
|
873
933
|
private versionCheck;
|
|
874
934
|
private restTransport;
|
|
875
935
|
private instagramLiveNamespace?;
|
|
936
|
+
private twitterLiveNamespace?;
|
|
876
937
|
constructor(options?: {
|
|
877
938
|
apiKey?: string;
|
|
878
939
|
serverUrl?: string;
|
|
@@ -881,6 +942,7 @@ declare class XpozClient {
|
|
|
881
942
|
apiUrl?: string;
|
|
882
943
|
});
|
|
883
944
|
get instagramLive(): InstagramLiveNamespace;
|
|
945
|
+
get twitterLive(): TwitterLiveNamespace;
|
|
884
946
|
connect(): Promise<void>;
|
|
885
947
|
close(): Promise<void>;
|
|
886
948
|
[Symbol.asyncDispose](): Promise<void>;
|
|
@@ -916,8 +978,8 @@ declare class OperationCancelledError extends XpozError {
|
|
|
916
978
|
constructor(operationId: string);
|
|
917
979
|
}
|
|
918
980
|
|
|
919
|
-
declare const VERSION = "0.
|
|
981
|
+
declare const VERSION = "0.8.0";
|
|
920
982
|
|
|
921
983
|
declare function checkForUpdates(): Promise<void>;
|
|
922
984
|
|
|
923
|
-
export { type AccountBilling, type AccountDetails, type AccountUsage, type AddTrackedItemsResult, AuthenticationError, BillingPeriod, CreditResetFrequency, type CreditsUsageHistory, type CursorPageResponse, CursorResult, type InstagramComment, type InstagramConnectionType, type InstagramInteractionType, type InstagramPost, type InstagramUser, NotFoundError, 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, type UsageHistoryBucket, VERSION, ValidationError, XpozClient, XpozConnectionError, XpozError, checkForUpdates };
|
|
985
|
+
export { type AccountBilling, type AccountDetails, type AccountUsage, type AddTrackedItemsResult, AuthenticationError, BillingPeriod, CreditResetFrequency, type CreditsUsageHistory, type CursorPageResponse, CursorResult, type InstagramComment, type InstagramConnectionType, type InstagramInteractionType, type InstagramPost, type InstagramUser, NotFoundError, 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 TwitterConnectionType, type TwitterInteractionType, type TwitterLiveSortBy, type TwitterPost, type TwitterUser, type UsageHistoryBucket, VERSION, ValidationError, XpozClient, XpozConnectionError, XpozError, checkForUpdates };
|