@xpoz/xpoz 0.4.2 → 0.6.6
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 +36 -5
- package/dist/index.d.cts +50 -3
- package/dist/index.d.ts +50 -3
- package/dist/index.js +34 -5
- package/package.json +1 -1
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.6";
|
|
300
302
|
|
|
301
303
|
// src/mcp/transport.ts
|
|
302
304
|
var USER_AGENT = `xpoz-ts-sdk/${VERSION}`;
|
|
@@ -638,6 +640,7 @@ var GET_TIKTOK_USERS_BY_HASHTAGS = "getTiktokUsersByHashtags";
|
|
|
638
640
|
var GET_TRACKED_ITEMS = "getTrackedItems";
|
|
639
641
|
var ADD_TRACKED_ITEMS = "addTrackedItems";
|
|
640
642
|
var REMOVE_TRACKED_ITEMS = "removeTrackedItems";
|
|
643
|
+
var GET_ACCOUNT_DETAILS = "getAccountDetails";
|
|
641
644
|
|
|
642
645
|
// src/namespaces/twitter.ts
|
|
643
646
|
function parseTwitterPost(item) {
|
|
@@ -792,7 +795,8 @@ var TwitterNamespace = class extends BaseNamespace {
|
|
|
792
795
|
const args = this.buildArgs({
|
|
793
796
|
identifier,
|
|
794
797
|
identifierType: options.identifierType ?? "username",
|
|
795
|
-
fields: options.fields
|
|
798
|
+
fields: options.fields,
|
|
799
|
+
forceLatest: options.forceLatest
|
|
796
800
|
});
|
|
797
801
|
const result = await this.callAndMaybePoll(GET_TWITTER_USER, args);
|
|
798
802
|
const results = result["results"];
|
|
@@ -894,7 +898,8 @@ var InstagramNamespace = class extends BaseNamespace {
|
|
|
894
898
|
const args = this.buildArgs({
|
|
895
899
|
identifier,
|
|
896
900
|
identifierType: options.identifierType ?? "username",
|
|
897
|
-
fields: options.fields
|
|
901
|
+
fields: options.fields,
|
|
902
|
+
forceLatest: options.forceLatest
|
|
898
903
|
});
|
|
899
904
|
const result = await this.callAndMaybePoll(GET_INSTAGRAM_USER, args);
|
|
900
905
|
const results = result["results"];
|
|
@@ -1105,7 +1110,8 @@ var TiktokNamespace = class extends BaseNamespace {
|
|
|
1105
1110
|
const args = this.buildArgs({
|
|
1106
1111
|
identifier,
|
|
1107
1112
|
identifierType: options.identifierType ?? "username",
|
|
1108
|
-
fields: options.fields
|
|
1113
|
+
fields: options.fields,
|
|
1114
|
+
forceLatest: options.forceLatest
|
|
1109
1115
|
});
|
|
1110
1116
|
const result = await this.callAndMaybePoll(GET_TIKTOK_USER, args);
|
|
1111
1117
|
const results = result["results"];
|
|
@@ -1155,7 +1161,7 @@ var TiktokNamespace = class extends BaseNamespace {
|
|
|
1155
1161
|
var TrackingNamespace = class extends BaseNamespace {
|
|
1156
1162
|
async getTrackedItems() {
|
|
1157
1163
|
const result = await this.callTool(GET_TRACKED_ITEMS, {});
|
|
1158
|
-
return result["
|
|
1164
|
+
return result["results"] ?? [];
|
|
1159
1165
|
}
|
|
1160
1166
|
async addTrackedItems(items) {
|
|
1161
1167
|
const args = this.buildArgs({ items });
|
|
@@ -1169,6 +1175,14 @@ var TrackingNamespace = class extends BaseNamespace {
|
|
|
1169
1175
|
}
|
|
1170
1176
|
};
|
|
1171
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
|
+
|
|
1172
1186
|
// src/versionCheck.ts
|
|
1173
1187
|
var NPM_REGISTRY_URL = "https://registry.npmjs.org/@xpoz/xpoz/latest";
|
|
1174
1188
|
var CHECK_TIMEOUT_MS = 3e3;
|
|
@@ -1216,6 +1230,7 @@ var XpozClient = class {
|
|
|
1216
1230
|
reddit;
|
|
1217
1231
|
tiktok;
|
|
1218
1232
|
tracking;
|
|
1233
|
+
account;
|
|
1219
1234
|
transport;
|
|
1220
1235
|
versionCheck;
|
|
1221
1236
|
constructor(options = {}) {
|
|
@@ -1235,6 +1250,7 @@ var XpozClient = class {
|
|
|
1235
1250
|
this.reddit = new RedditNamespace(callTool, timeoutMs);
|
|
1236
1251
|
this.tiktok = new TiktokNamespace(callTool, timeoutMs);
|
|
1237
1252
|
this.tracking = new TrackingNamespace(callTool, timeoutMs);
|
|
1253
|
+
this.account = new AccountNamespace(callTool, timeoutMs);
|
|
1238
1254
|
}
|
|
1239
1255
|
async connect() {
|
|
1240
1256
|
await this.transport.connect();
|
|
@@ -1255,6 +1271,7 @@ var TrackedItemType = /* @__PURE__ */ ((TrackedItemType2) => {
|
|
|
1255
1271
|
TrackedItemType2["Keyword"] = "keyword";
|
|
1256
1272
|
TrackedItemType2["User"] = "user";
|
|
1257
1273
|
TrackedItemType2["Subreddit"] = "subreddit";
|
|
1274
|
+
TrackedItemType2["Hashtag"] = "hashtag";
|
|
1258
1275
|
return TrackedItemType2;
|
|
1259
1276
|
})(TrackedItemType || {});
|
|
1260
1277
|
var TrackedItemPlatform = /* @__PURE__ */ ((TrackedItemPlatform2) => {
|
|
@@ -1264,9 +1281,23 @@ var TrackedItemPlatform = /* @__PURE__ */ ((TrackedItemPlatform2) => {
|
|
|
1264
1281
|
TrackedItemPlatform2["TikTok"] = "tiktok";
|
|
1265
1282
|
return TrackedItemPlatform2;
|
|
1266
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 || {});
|
|
1267
1296
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1268
1297
|
0 && (module.exports = {
|
|
1269
1298
|
AuthenticationError,
|
|
1299
|
+
BillingPeriod,
|
|
1300
|
+
CreditResetFrequency,
|
|
1270
1301
|
OperationCancelledError,
|
|
1271
1302
|
OperationFailedError,
|
|
1272
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;
|
|
@@ -317,6 +318,7 @@ declare class InstagramNamespace extends BaseNamespace {
|
|
|
317
318
|
getUser(identifier: string, options?: {
|
|
318
319
|
identifierType?: string;
|
|
319
320
|
fields?: string[];
|
|
321
|
+
forceLatest?: boolean;
|
|
320
322
|
}): Promise<InstagramUser>;
|
|
321
323
|
searchUsers(name: string, options?: {
|
|
322
324
|
limit?: number;
|
|
@@ -497,6 +499,7 @@ declare class RedditNamespace extends BaseNamespace {
|
|
|
497
499
|
}): Promise<PaginatedResult<RedditComment>>;
|
|
498
500
|
getUser(username: string, options?: {
|
|
499
501
|
fields?: string[];
|
|
502
|
+
forceLatest?: boolean;
|
|
500
503
|
}): Promise<RedditUser>;
|
|
501
504
|
searchUsers(name: string, options?: {
|
|
502
505
|
limit?: number;
|
|
@@ -547,6 +550,7 @@ interface TiktokPost {
|
|
|
547
550
|
hashtags?: string[] | null;
|
|
548
551
|
duration?: number | null;
|
|
549
552
|
videoUrl?: string[] | null;
|
|
553
|
+
transcriptsJson?: Record<string, string> | null;
|
|
550
554
|
createdAt?: string | null;
|
|
551
555
|
createdAtTimestamp?: number | null;
|
|
552
556
|
createdAtDate?: string | null;
|
|
@@ -621,6 +625,7 @@ declare class TiktokNamespace extends BaseNamespace {
|
|
|
621
625
|
getUser(identifier: string, options?: {
|
|
622
626
|
identifierType?: string;
|
|
623
627
|
fields?: string[];
|
|
628
|
+
forceLatest?: boolean;
|
|
624
629
|
}): Promise<TiktokUser>;
|
|
625
630
|
searchUsers(name: string, options?: {
|
|
626
631
|
limit?: number;
|
|
@@ -655,7 +660,8 @@ declare class TiktokNamespace extends BaseNamespace {
|
|
|
655
660
|
declare enum TrackedItemType {
|
|
656
661
|
Keyword = "keyword",
|
|
657
662
|
User = "user",
|
|
658
|
-
Subreddit = "subreddit"
|
|
663
|
+
Subreddit = "subreddit",
|
|
664
|
+
Hashtag = "hashtag"
|
|
659
665
|
}
|
|
660
666
|
declare enum TrackedItemPlatform {
|
|
661
667
|
Twitter = "twitter",
|
|
@@ -688,12 +694,53 @@ declare class TrackingNamespace extends BaseNamespace {
|
|
|
688
694
|
removeTrackedItems(items: TrackedItem[]): Promise<RemoveTrackedItemsResult>;
|
|
689
695
|
}
|
|
690
696
|
|
|
697
|
+
declare enum BillingPeriod {
|
|
698
|
+
Monthly = "monthly",
|
|
699
|
+
Annual = "annual"
|
|
700
|
+
}
|
|
701
|
+
declare enum CreditResetFrequency {
|
|
702
|
+
Monthly = "monthly",
|
|
703
|
+
Never = "never"
|
|
704
|
+
}
|
|
705
|
+
interface PlanFeatures {
|
|
706
|
+
credits: number;
|
|
707
|
+
creditResetFrequency: CreditResetFrequency;
|
|
708
|
+
extraCreditPrice: number;
|
|
709
|
+
trackedItems?: number;
|
|
710
|
+
csvRowExportLimit: number;
|
|
711
|
+
extraCsvRowPrice: number;
|
|
712
|
+
extraTrackedItemPrice?: number;
|
|
713
|
+
maxRowsPerExport?: number;
|
|
714
|
+
}
|
|
715
|
+
interface AccountBilling {
|
|
716
|
+
billingPeriod: BillingPeriod;
|
|
717
|
+
nextRenewalDate: string | null;
|
|
718
|
+
}
|
|
719
|
+
interface AccountUsage {
|
|
720
|
+
subscriptionCreditsRemaining: number;
|
|
721
|
+
extraCreditsRemaining: number;
|
|
722
|
+
extraTrackedItems: number;
|
|
723
|
+
}
|
|
724
|
+
interface AccountDetails {
|
|
725
|
+
plan: {
|
|
726
|
+
name: string;
|
|
727
|
+
features: PlanFeatures;
|
|
728
|
+
};
|
|
729
|
+
billing: AccountBilling | null;
|
|
730
|
+
usage: AccountUsage;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
declare class AccountNamespace extends BaseNamespace {
|
|
734
|
+
getAccountDetails(): Promise<AccountDetails>;
|
|
735
|
+
}
|
|
736
|
+
|
|
691
737
|
declare class XpozClient {
|
|
692
738
|
twitter: TwitterNamespace;
|
|
693
739
|
instagram: InstagramNamespace;
|
|
694
740
|
reddit: RedditNamespace;
|
|
695
741
|
tiktok: TiktokNamespace;
|
|
696
742
|
tracking: TrackingNamespace;
|
|
743
|
+
account: AccountNamespace;
|
|
697
744
|
private transport;
|
|
698
745
|
private versionCheck;
|
|
699
746
|
constructor(options?: {
|
|
@@ -731,8 +778,8 @@ declare class OperationCancelledError extends XpozError {
|
|
|
731
778
|
constructor(operationId: string);
|
|
732
779
|
}
|
|
733
780
|
|
|
734
|
-
declare const VERSION = "0.
|
|
781
|
+
declare const VERSION = "0.6.6";
|
|
735
782
|
|
|
736
783
|
declare function checkForUpdates(): Promise<void>;
|
|
737
784
|
|
|
738
|
-
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 };
|
|
785
|
+
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;
|
|
@@ -317,6 +318,7 @@ declare class InstagramNamespace extends BaseNamespace {
|
|
|
317
318
|
getUser(identifier: string, options?: {
|
|
318
319
|
identifierType?: string;
|
|
319
320
|
fields?: string[];
|
|
321
|
+
forceLatest?: boolean;
|
|
320
322
|
}): Promise<InstagramUser>;
|
|
321
323
|
searchUsers(name: string, options?: {
|
|
322
324
|
limit?: number;
|
|
@@ -497,6 +499,7 @@ declare class RedditNamespace extends BaseNamespace {
|
|
|
497
499
|
}): Promise<PaginatedResult<RedditComment>>;
|
|
498
500
|
getUser(username: string, options?: {
|
|
499
501
|
fields?: string[];
|
|
502
|
+
forceLatest?: boolean;
|
|
500
503
|
}): Promise<RedditUser>;
|
|
501
504
|
searchUsers(name: string, options?: {
|
|
502
505
|
limit?: number;
|
|
@@ -547,6 +550,7 @@ interface TiktokPost {
|
|
|
547
550
|
hashtags?: string[] | null;
|
|
548
551
|
duration?: number | null;
|
|
549
552
|
videoUrl?: string[] | null;
|
|
553
|
+
transcriptsJson?: Record<string, string> | null;
|
|
550
554
|
createdAt?: string | null;
|
|
551
555
|
createdAtTimestamp?: number | null;
|
|
552
556
|
createdAtDate?: string | null;
|
|
@@ -621,6 +625,7 @@ declare class TiktokNamespace extends BaseNamespace {
|
|
|
621
625
|
getUser(identifier: string, options?: {
|
|
622
626
|
identifierType?: string;
|
|
623
627
|
fields?: string[];
|
|
628
|
+
forceLatest?: boolean;
|
|
624
629
|
}): Promise<TiktokUser>;
|
|
625
630
|
searchUsers(name: string, options?: {
|
|
626
631
|
limit?: number;
|
|
@@ -655,7 +660,8 @@ declare class TiktokNamespace extends BaseNamespace {
|
|
|
655
660
|
declare enum TrackedItemType {
|
|
656
661
|
Keyword = "keyword",
|
|
657
662
|
User = "user",
|
|
658
|
-
Subreddit = "subreddit"
|
|
663
|
+
Subreddit = "subreddit",
|
|
664
|
+
Hashtag = "hashtag"
|
|
659
665
|
}
|
|
660
666
|
declare enum TrackedItemPlatform {
|
|
661
667
|
Twitter = "twitter",
|
|
@@ -688,12 +694,53 @@ declare class TrackingNamespace extends BaseNamespace {
|
|
|
688
694
|
removeTrackedItems(items: TrackedItem[]): Promise<RemoveTrackedItemsResult>;
|
|
689
695
|
}
|
|
690
696
|
|
|
697
|
+
declare enum BillingPeriod {
|
|
698
|
+
Monthly = "monthly",
|
|
699
|
+
Annual = "annual"
|
|
700
|
+
}
|
|
701
|
+
declare enum CreditResetFrequency {
|
|
702
|
+
Monthly = "monthly",
|
|
703
|
+
Never = "never"
|
|
704
|
+
}
|
|
705
|
+
interface PlanFeatures {
|
|
706
|
+
credits: number;
|
|
707
|
+
creditResetFrequency: CreditResetFrequency;
|
|
708
|
+
extraCreditPrice: number;
|
|
709
|
+
trackedItems?: number;
|
|
710
|
+
csvRowExportLimit: number;
|
|
711
|
+
extraCsvRowPrice: number;
|
|
712
|
+
extraTrackedItemPrice?: number;
|
|
713
|
+
maxRowsPerExport?: number;
|
|
714
|
+
}
|
|
715
|
+
interface AccountBilling {
|
|
716
|
+
billingPeriod: BillingPeriod;
|
|
717
|
+
nextRenewalDate: string | null;
|
|
718
|
+
}
|
|
719
|
+
interface AccountUsage {
|
|
720
|
+
subscriptionCreditsRemaining: number;
|
|
721
|
+
extraCreditsRemaining: number;
|
|
722
|
+
extraTrackedItems: number;
|
|
723
|
+
}
|
|
724
|
+
interface AccountDetails {
|
|
725
|
+
plan: {
|
|
726
|
+
name: string;
|
|
727
|
+
features: PlanFeatures;
|
|
728
|
+
};
|
|
729
|
+
billing: AccountBilling | null;
|
|
730
|
+
usage: AccountUsage;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
declare class AccountNamespace extends BaseNamespace {
|
|
734
|
+
getAccountDetails(): Promise<AccountDetails>;
|
|
735
|
+
}
|
|
736
|
+
|
|
691
737
|
declare class XpozClient {
|
|
692
738
|
twitter: TwitterNamespace;
|
|
693
739
|
instagram: InstagramNamespace;
|
|
694
740
|
reddit: RedditNamespace;
|
|
695
741
|
tiktok: TiktokNamespace;
|
|
696
742
|
tracking: TrackingNamespace;
|
|
743
|
+
account: AccountNamespace;
|
|
697
744
|
private transport;
|
|
698
745
|
private versionCheck;
|
|
699
746
|
constructor(options?: {
|
|
@@ -731,8 +778,8 @@ declare class OperationCancelledError extends XpozError {
|
|
|
731
778
|
constructor(operationId: string);
|
|
732
779
|
}
|
|
733
780
|
|
|
734
|
-
declare const VERSION = "0.
|
|
781
|
+
declare const VERSION = "0.6.6";
|
|
735
782
|
|
|
736
783
|
declare function checkForUpdates(): Promise<void>;
|
|
737
784
|
|
|
738
|
-
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 };
|
|
785
|
+
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.6";
|
|
252
252
|
|
|
253
253
|
// src/mcp/transport.ts
|
|
254
254
|
var USER_AGENT = `xpoz-ts-sdk/${VERSION}`;
|
|
@@ -590,6 +590,7 @@ var GET_TIKTOK_USERS_BY_HASHTAGS = "getTiktokUsersByHashtags";
|
|
|
590
590
|
var GET_TRACKED_ITEMS = "getTrackedItems";
|
|
591
591
|
var ADD_TRACKED_ITEMS = "addTrackedItems";
|
|
592
592
|
var REMOVE_TRACKED_ITEMS = "removeTrackedItems";
|
|
593
|
+
var GET_ACCOUNT_DETAILS = "getAccountDetails";
|
|
593
594
|
|
|
594
595
|
// src/namespaces/twitter.ts
|
|
595
596
|
function parseTwitterPost(item) {
|
|
@@ -744,7 +745,8 @@ var TwitterNamespace = class extends BaseNamespace {
|
|
|
744
745
|
const args = this.buildArgs({
|
|
745
746
|
identifier,
|
|
746
747
|
identifierType: options.identifierType ?? "username",
|
|
747
|
-
fields: options.fields
|
|
748
|
+
fields: options.fields,
|
|
749
|
+
forceLatest: options.forceLatest
|
|
748
750
|
});
|
|
749
751
|
const result = await this.callAndMaybePoll(GET_TWITTER_USER, args);
|
|
750
752
|
const results = result["results"];
|
|
@@ -846,7 +848,8 @@ var InstagramNamespace = class extends BaseNamespace {
|
|
|
846
848
|
const args = this.buildArgs({
|
|
847
849
|
identifier,
|
|
848
850
|
identifierType: options.identifierType ?? "username",
|
|
849
|
-
fields: options.fields
|
|
851
|
+
fields: options.fields,
|
|
852
|
+
forceLatest: options.forceLatest
|
|
850
853
|
});
|
|
851
854
|
const result = await this.callAndMaybePoll(GET_INSTAGRAM_USER, args);
|
|
852
855
|
const results = result["results"];
|
|
@@ -1057,7 +1060,8 @@ var TiktokNamespace = class extends BaseNamespace {
|
|
|
1057
1060
|
const args = this.buildArgs({
|
|
1058
1061
|
identifier,
|
|
1059
1062
|
identifierType: options.identifierType ?? "username",
|
|
1060
|
-
fields: options.fields
|
|
1063
|
+
fields: options.fields,
|
|
1064
|
+
forceLatest: options.forceLatest
|
|
1061
1065
|
});
|
|
1062
1066
|
const result = await this.callAndMaybePoll(GET_TIKTOK_USER, args);
|
|
1063
1067
|
const results = result["results"];
|
|
@@ -1107,7 +1111,7 @@ var TiktokNamespace = class extends BaseNamespace {
|
|
|
1107
1111
|
var TrackingNamespace = class extends BaseNamespace {
|
|
1108
1112
|
async getTrackedItems() {
|
|
1109
1113
|
const result = await this.callTool(GET_TRACKED_ITEMS, {});
|
|
1110
|
-
return result["
|
|
1114
|
+
return result["results"] ?? [];
|
|
1111
1115
|
}
|
|
1112
1116
|
async addTrackedItems(items) {
|
|
1113
1117
|
const args = this.buildArgs({ items });
|
|
@@ -1121,6 +1125,14 @@ var TrackingNamespace = class extends BaseNamespace {
|
|
|
1121
1125
|
}
|
|
1122
1126
|
};
|
|
1123
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
|
+
|
|
1124
1136
|
// src/versionCheck.ts
|
|
1125
1137
|
var NPM_REGISTRY_URL = "https://registry.npmjs.org/@xpoz/xpoz/latest";
|
|
1126
1138
|
var CHECK_TIMEOUT_MS = 3e3;
|
|
@@ -1168,6 +1180,7 @@ var XpozClient = class {
|
|
|
1168
1180
|
reddit;
|
|
1169
1181
|
tiktok;
|
|
1170
1182
|
tracking;
|
|
1183
|
+
account;
|
|
1171
1184
|
transport;
|
|
1172
1185
|
versionCheck;
|
|
1173
1186
|
constructor(options = {}) {
|
|
@@ -1187,6 +1200,7 @@ var XpozClient = class {
|
|
|
1187
1200
|
this.reddit = new RedditNamespace(callTool, timeoutMs);
|
|
1188
1201
|
this.tiktok = new TiktokNamespace(callTool, timeoutMs);
|
|
1189
1202
|
this.tracking = new TrackingNamespace(callTool, timeoutMs);
|
|
1203
|
+
this.account = new AccountNamespace(callTool, timeoutMs);
|
|
1190
1204
|
}
|
|
1191
1205
|
async connect() {
|
|
1192
1206
|
await this.transport.connect();
|
|
@@ -1207,6 +1221,7 @@ var TrackedItemType = /* @__PURE__ */ ((TrackedItemType2) => {
|
|
|
1207
1221
|
TrackedItemType2["Keyword"] = "keyword";
|
|
1208
1222
|
TrackedItemType2["User"] = "user";
|
|
1209
1223
|
TrackedItemType2["Subreddit"] = "subreddit";
|
|
1224
|
+
TrackedItemType2["Hashtag"] = "hashtag";
|
|
1210
1225
|
return TrackedItemType2;
|
|
1211
1226
|
})(TrackedItemType || {});
|
|
1212
1227
|
var TrackedItemPlatform = /* @__PURE__ */ ((TrackedItemPlatform2) => {
|
|
@@ -1216,8 +1231,22 @@ var TrackedItemPlatform = /* @__PURE__ */ ((TrackedItemPlatform2) => {
|
|
|
1216
1231
|
TrackedItemPlatform2["TikTok"] = "tiktok";
|
|
1217
1232
|
return TrackedItemPlatform2;
|
|
1218
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 || {});
|
|
1219
1246
|
export {
|
|
1220
1247
|
AuthenticationError,
|
|
1248
|
+
BillingPeriod,
|
|
1249
|
+
CreditResetFrequency,
|
|
1221
1250
|
OperationCancelledError,
|
|
1222
1251
|
OperationFailedError,
|
|
1223
1252
|
OperationTimeoutError,
|