x-twitter-scraper 0.12.3 → 0.13.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/CHANGELOG.md +73 -2
- package/README.md +66 -51
- package/client.d.mts +18 -15
- package/client.d.mts.map +1 -1
- package/client.d.ts +18 -15
- package/client.d.ts.map +1 -1
- package/client.js +3 -3
- package/client.js.map +1 -1
- package/client.mjs +4 -4
- package/client.mjs.map +1 -1
- package/core/streaming.d.mts +33 -0
- package/core/streaming.d.mts.map +1 -0
- package/core/streaming.d.ts +33 -0
- package/core/streaming.d.ts.map +1 -0
- package/core/streaming.js +270 -0
- package/core/streaming.js.map +1 -0
- package/core/streaming.mjs +265 -0
- package/core/streaming.mjs.map +1 -0
- package/internal/decoders/line.d.mts +17 -0
- package/internal/decoders/line.d.mts.map +1 -0
- package/internal/decoders/line.d.ts +17 -0
- package/internal/decoders/line.d.ts.map +1 -0
- package/internal/decoders/line.js +116 -0
- package/internal/decoders/line.js.map +1 -0
- package/internal/decoders/line.mjs +111 -0
- package/internal/decoders/line.mjs.map +1 -0
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +7 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +7 -0
- package/internal/parse.mjs.map +1 -1
- package/internal/tslib.js +18 -18
- package/package.json +23 -5
- package/resources/account.d.mts +35 -12
- package/resources/account.d.mts.map +1 -1
- package/resources/account.d.ts +35 -12
- package/resources/account.d.ts.map +1 -1
- package/resources/account.js +4 -3
- package/resources/account.js.map +1 -1
- package/resources/account.mjs +4 -3
- package/resources/account.mjs.map +1 -1
- package/resources/compose.d.mts +77 -21
- package/resources/compose.d.mts.map +1 -1
- package/resources/compose.d.ts +77 -21
- package/resources/compose.d.ts.map +1 -1
- package/resources/compose.js +3 -4
- package/resources/compose.js.map +1 -1
- package/resources/compose.mjs +3 -4
- package/resources/compose.mjs.map +1 -1
- package/resources/credits.d.mts +18 -10
- package/resources/credits.d.mts.map +1 -1
- package/resources/credits.d.ts +18 -10
- package/resources/credits.d.ts.map +1 -1
- package/resources/credits.js +5 -4
- package/resources/credits.js.map +1 -1
- package/resources/credits.mjs +5 -4
- package/resources/credits.mjs.map +1 -1
- package/resources/drafts.d.mts +13 -17
- package/resources/drafts.d.mts.map +1 -1
- package/resources/drafts.d.ts +13 -17
- package/resources/drafts.d.ts.map +1 -1
- package/resources/drafts.js +4 -4
- package/resources/drafts.mjs +4 -4
- package/resources/draws.d.mts +84 -28
- package/resources/draws.d.mts.map +1 -1
- package/resources/draws.d.ts +84 -28
- package/resources/draws.d.ts.map +1 -1
- package/resources/draws.js +24 -9
- package/resources/draws.js.map +1 -1
- package/resources/draws.mjs +24 -9
- package/resources/draws.mjs.map +1 -1
- package/resources/events.d.mts +2564 -21
- package/resources/events.d.mts.map +1 -1
- package/resources/events.d.ts +2564 -21
- package/resources/events.d.ts.map +1 -1
- package/resources/events.js +34 -2
- package/resources/events.js.map +1 -1
- package/resources/events.mjs +34 -2
- package/resources/events.mjs.map +1 -1
- package/resources/extractions.d.mts +410 -128
- package/resources/extractions.d.mts.map +1 -1
- package/resources/extractions.d.ts +410 -128
- package/resources/extractions.d.ts.map +1 -1
- package/resources/extractions.js +74 -12
- package/resources/extractions.js.map +1 -1
- package/resources/extractions.mjs +74 -12
- package/resources/extractions.mjs.map +1 -1
- package/resources/guest-wallets.d.mts +6 -5
- package/resources/guest-wallets.d.mts.map +1 -1
- package/resources/guest-wallets.d.ts +6 -5
- package/resources/guest-wallets.d.ts.map +1 -1
- package/resources/guest-wallets.js +2 -1
- package/resources/guest-wallets.js.map +1 -1
- package/resources/guest-wallets.mjs +2 -1
- package/resources/guest-wallets.mjs.map +1 -1
- package/resources/index.d.mts +6 -6
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +6 -6
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/monitors/index.d.mts +2 -2
- package/resources/monitors/index.d.mts.map +1 -1
- package/resources/monitors/index.d.ts +2 -2
- package/resources/monitors/index.d.ts.map +1 -1
- package/resources/monitors/index.js.map +1 -1
- package/resources/monitors/index.mjs.map +1 -1
- package/resources/monitors/keywords.d.mts +66 -14
- package/resources/monitors/keywords.d.mts.map +1 -1
- package/resources/monitors/keywords.d.ts +66 -14
- package/resources/monitors/keywords.d.ts.map +1 -1
- package/resources/monitors/keywords.js +16 -10
- package/resources/monitors/keywords.js.map +1 -1
- package/resources/monitors/keywords.mjs +16 -10
- package/resources/monitors/keywords.mjs.map +1 -1
- package/resources/monitors/monitors.d.mts +53 -16
- package/resources/monitors/monitors.d.mts.map +1 -1
- package/resources/monitors/monitors.d.ts +53 -16
- package/resources/monitors/monitors.d.ts.map +1 -1
- package/resources/monitors/monitors.js +12 -10
- package/resources/monitors/monitors.js.map +1 -1
- package/resources/monitors/monitors.mjs +12 -10
- package/resources/monitors/monitors.mjs.map +1 -1
- package/resources/radar.d.mts +32 -36
- package/resources/radar.d.mts.map +1 -1
- package/resources/radar.d.ts +32 -36
- package/resources/radar.d.ts.map +1 -1
- package/resources/radar.js +1 -1
- package/resources/radar.mjs +1 -1
- package/resources/shared.d.mts +1726 -233
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +1726 -233
- package/resources/shared.d.ts.map +1 -1
- package/resources/styles.d.mts +34 -23
- package/resources/styles.d.mts.map +1 -1
- package/resources/styles.d.ts +34 -23
- package/resources/styles.d.ts.map +1 -1
- package/resources/styles.js +11 -13
- package/resources/styles.js.map +1 -1
- package/resources/styles.mjs +11 -13
- package/resources/styles.mjs.map +1 -1
- package/resources/subscribe.d.mts +1 -1
- package/resources/subscribe.d.ts +1 -1
- package/resources/subscribe.js +1 -1
- package/resources/subscribe.mjs +1 -1
- package/resources/support/index.d.mts +1 -1
- package/resources/support/index.d.mts.map +1 -1
- package/resources/support/index.d.ts +1 -1
- package/resources/support/index.d.ts.map +1 -1
- package/resources/support/index.js.map +1 -1
- package/resources/support/index.mjs.map +1 -1
- package/resources/support/support.d.mts +2 -2
- package/resources/support/support.d.mts.map +1 -1
- package/resources/support/support.d.ts +2 -2
- package/resources/support/support.d.ts.map +1 -1
- package/resources/support/support.js.map +1 -1
- package/resources/support/support.mjs.map +1 -1
- package/resources/support/tickets.d.mts +30 -10
- package/resources/support/tickets.d.mts.map +1 -1
- package/resources/support/tickets.d.ts +30 -10
- package/resources/support/tickets.d.ts.map +1 -1
- package/resources/support/tickets.js +7 -7
- package/resources/support/tickets.js.map +1 -1
- package/resources/support/tickets.mjs +7 -7
- package/resources/support/tickets.mjs.map +1 -1
- package/resources/trends.d.mts +21 -5
- package/resources/trends.d.mts.map +1 -1
- package/resources/trends.d.ts +21 -5
- package/resources/trends.d.ts.map +1 -1
- package/resources/trends.js +2 -1
- package/resources/trends.js.map +1 -1
- package/resources/trends.mjs +2 -1
- package/resources/trends.mjs.map +1 -1
- package/resources/webhooks.d.mts +80 -14
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +80 -14
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js +30 -11
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +30 -11
- package/resources/webhooks.mjs.map +1 -1
- package/resources/x/account-connection-attempts.d.mts +1 -1
- package/resources/x/account-connection-attempts.d.ts +1 -1
- package/resources/x/account-connection-attempts.js +1 -1
- package/resources/x/account-connection-attempts.mjs +1 -1
- package/resources/x/account-connection-challenges.d.mts +30 -11
- package/resources/x/account-connection-challenges.d.mts.map +1 -1
- package/resources/x/account-connection-challenges.d.ts +30 -11
- package/resources/x/account-connection-challenges.d.ts.map +1 -1
- package/resources/x/account-connection-challenges.js +5 -4
- package/resources/x/account-connection-challenges.js.map +1 -1
- package/resources/x/account-connection-challenges.mjs +5 -4
- package/resources/x/account-connection-challenges.mjs.map +1 -1
- package/resources/x/accounts.d.mts +38 -10
- package/resources/x/accounts.d.mts.map +1 -1
- package/resources/x/accounts.d.ts +38 -10
- package/resources/x/accounts.d.ts.map +1 -1
- package/resources/x/accounts.js +8 -7
- package/resources/x/accounts.js.map +1 -1
- package/resources/x/accounts.mjs +8 -7
- package/resources/x/accounts.mjs.map +1 -1
- package/resources/x/analysis.d.mts +3274 -0
- package/resources/x/analysis.d.mts.map +1 -0
- package/resources/x/analysis.d.ts +3274 -0
- package/resources/x/analysis.d.ts.map +1 -0
- package/resources/x/analysis.js +132 -0
- package/resources/x/analysis.js.map +1 -0
- package/resources/x/analysis.mjs +128 -0
- package/resources/x/analysis.mjs.map +1 -0
- package/resources/x/bookmarks.d.mts +84 -9
- package/resources/x/bookmarks.d.mts.map +1 -1
- package/resources/x/bookmarks.d.ts +84 -9
- package/resources/x/bookmarks.d.ts.map +1 -1
- package/resources/x/bookmarks.js +6 -4
- package/resources/x/bookmarks.js.map +1 -1
- package/resources/x/bookmarks.mjs +6 -4
- package/resources/x/bookmarks.mjs.map +1 -1
- package/resources/x/broadcasts.d.mts +176 -0
- package/resources/x/broadcasts.d.mts.map +1 -0
- package/resources/x/broadcasts.d.ts +176 -0
- package/resources/x/broadcasts.d.ts.map +1 -0
- package/resources/x/broadcasts.js +29 -0
- package/resources/x/broadcasts.js.map +1 -0
- package/resources/x/broadcasts.mjs +25 -0
- package/resources/x/broadcasts.mjs.map +1 -0
- package/resources/x/communities/communities.d.mts +612 -128
- package/resources/x/communities/communities.d.mts.map +1 -1
- package/resources/x/communities/communities.d.ts +612 -128
- package/resources/x/communities/communities.d.ts.map +1 -1
- package/resources/x/communities/communities.js +96 -17
- package/resources/x/communities/communities.js.map +1 -1
- package/resources/x/communities/communities.mjs +96 -17
- package/resources/x/communities/communities.mjs.map +1 -1
- package/resources/x/communities/index.d.mts +2 -1
- package/resources/x/communities/index.d.mts.map +1 -1
- package/resources/x/communities/index.d.ts +2 -1
- package/resources/x/communities/index.d.ts.map +1 -1
- package/resources/x/communities/index.js +3 -1
- package/resources/x/communities/index.js.map +1 -1
- package/resources/x/communities/index.mjs +1 -0
- package/resources/x/communities/index.mjs.map +1 -1
- package/resources/x/communities/join.d.mts +46 -25
- package/resources/x/communities/join.d.mts.map +1 -1
- package/resources/x/communities/join.d.ts +46 -25
- package/resources/x/communities/join.d.ts.map +1 -1
- package/resources/x/communities/join.js +10 -7
- package/resources/x/communities/join.js.map +1 -1
- package/resources/x/communities/join.mjs +10 -7
- package/resources/x/communities/join.mjs.map +1 -1
- package/resources/x/communities/media.d.mts +197 -0
- package/resources/x/communities/media.d.mts.map +1 -0
- package/resources/x/communities/media.d.ts +197 -0
- package/resources/x/communities/media.d.ts.map +1 -0
- package/resources/x/communities/media.js +29 -0
- package/resources/x/communities/media.js.map +1 -0
- package/resources/x/communities/media.mjs +25 -0
- package/resources/x/communities/media.mjs.map +1 -0
- package/resources/x/communities/tweets.d.mts +350 -20
- package/resources/x/communities/tweets.d.mts.map +1 -1
- package/resources/x/communities/tweets.d.ts +350 -20
- package/resources/x/communities/tweets.d.ts.map +1 -1
- package/resources/x/communities/tweets.js +8 -7
- package/resources/x/communities/tweets.js.map +1 -1
- package/resources/x/communities/tweets.mjs +8 -7
- package/resources/x/communities/tweets.mjs.map +1 -1
- package/resources/x/dm.d.mts +245 -13
- package/resources/x/dm.d.mts.map +1 -1
- package/resources/x/dm.d.ts +245 -13
- package/resources/x/dm.d.ts.map +1 -1
- package/resources/x/dm.js +29 -2
- package/resources/x/dm.js.map +1 -1
- package/resources/x/dm.mjs +29 -2
- package/resources/x/dm.mjs.map +1 -1
- package/resources/x/followers.d.mts +31 -3
- package/resources/x/followers.d.mts.map +1 -1
- package/resources/x/followers.d.ts +31 -3
- package/resources/x/followers.d.ts.map +1 -1
- package/resources/x/followers.js +2 -1
- package/resources/x/followers.js.map +1 -1
- package/resources/x/followers.mjs +2 -1
- package/resources/x/followers.mjs.map +1 -1
- package/resources/x/index.d.mts +12 -8
- package/resources/x/index.d.mts.map +1 -1
- package/resources/x/index.d.ts +12 -8
- package/resources/x/index.d.ts.map +1 -1
- package/resources/x/index.js +9 -1
- package/resources/x/index.js.map +1 -1
- package/resources/x/index.mjs +5 -1
- package/resources/x/index.mjs.map +1 -1
- package/resources/x/jobs.d.mts +506 -0
- package/resources/x/jobs.d.mts.map +1 -0
- package/resources/x/jobs.d.ts +506 -0
- package/resources/x/jobs.d.ts.map +1 -0
- package/resources/x/jobs.js +60 -0
- package/resources/x/jobs.js.map +1 -0
- package/resources/x/jobs.mjs +56 -0
- package/resources/x/jobs.mjs.map +1 -0
- package/resources/x/lists.d.mts +1058 -27
- package/resources/x/lists.d.mts.map +1 -1
- package/resources/x/lists.d.ts +1058 -27
- package/resources/x/lists.d.ts.map +1 -1
- package/resources/x/lists.js +39 -9
- package/resources/x/lists.js.map +1 -1
- package/resources/x/lists.mjs +39 -9
- package/resources/x/lists.mjs.map +1 -1
- package/resources/x/media.d.mts +24 -13
- package/resources/x/media.d.mts.map +1 -1
- package/resources/x/media.d.ts +24 -13
- package/resources/x/media.d.ts.map +1 -1
- package/resources/x/media.js +2 -2
- package/resources/x/media.mjs +2 -2
- package/resources/x/profile.d.mts +60 -33
- package/resources/x/profile.d.mts.map +1 -1
- package/resources/x/profile.d.ts +60 -33
- package/resources/x/profile.d.ts.map +1 -1
- package/resources/x/profile.js +3 -3
- package/resources/x/profile.mjs +3 -3
- package/resources/x/spaces.d.mts +857 -0
- package/resources/x/spaces.d.mts.map +1 -0
- package/resources/x/spaces.d.ts +857 -0
- package/resources/x/spaces.d.ts.map +1 -0
- package/resources/x/spaces.js +58 -0
- package/resources/x/spaces.js.map +1 -0
- package/resources/x/spaces.mjs +54 -0
- package/resources/x/spaces.mjs.map +1 -0
- package/resources/x/tweets/index.d.mts +1 -1
- package/resources/x/tweets/index.d.mts.map +1 -1
- package/resources/x/tweets/index.d.ts +1 -1
- package/resources/x/tweets/index.d.ts.map +1 -1
- package/resources/x/tweets/index.js.map +1 -1
- package/resources/x/tweets/index.mjs.map +1 -1
- package/resources/x/tweets/like.d.mts +38 -20
- package/resources/x/tweets/like.d.mts.map +1 -1
- package/resources/x/tweets/like.d.ts +38 -20
- package/resources/x/tweets/like.d.ts.map +1 -1
- package/resources/x/tweets/like.js +2 -2
- package/resources/x/tweets/like.mjs +2 -2
- package/resources/x/tweets/retweet.d.mts +38 -20
- package/resources/x/tweets/retweet.d.mts.map +1 -1
- package/resources/x/tweets/retweet.d.ts +38 -20
- package/resources/x/tweets/retweet.d.ts.map +1 -1
- package/resources/x/tweets/retweet.js +2 -2
- package/resources/x/tweets/retweet.mjs +2 -2
- package/resources/x/tweets/tweets.d.mts +2639 -326
- package/resources/x/tweets/tweets.d.mts.map +1 -1
- package/resources/x/tweets/tweets.d.ts +2639 -326
- package/resources/x/tweets/tweets.d.ts.map +1 -1
- package/resources/x/tweets/tweets.js +147 -21
- package/resources/x/tweets/tweets.js.map +1 -1
- package/resources/x/tweets/tweets.mjs +147 -21
- package/resources/x/tweets/tweets.mjs.map +1 -1
- package/resources/x/users/follow.d.mts +38 -20
- package/resources/x/users/follow.d.mts.map +1 -1
- package/resources/x/users/follow.d.ts +38 -20
- package/resources/x/users/follow.d.ts.map +1 -1
- package/resources/x/users/follow.js +2 -2
- package/resources/x/users/follow.mjs +2 -2
- package/resources/x/users/index.d.mts +1 -1
- package/resources/x/users/index.d.mts.map +1 -1
- package/resources/x/users/index.d.ts +1 -1
- package/resources/x/users/index.d.ts.map +1 -1
- package/resources/x/users/index.js.map +1 -1
- package/resources/x/users/index.mjs.map +1 -1
- package/resources/x/users/users.d.mts +3068 -457
- package/resources/x/users/users.d.mts.map +1 -1
- package/resources/x/users/users.d.ts +3068 -457
- package/resources/x/users/users.d.ts.map +1 -1
- package/resources/x/users/users.js +205 -22
- package/resources/x/users/users.js.map +1 -1
- package/resources/x/users/users.mjs +205 -22
- package/resources/x/users/users.mjs.map +1 -1
- package/resources/x/write-actions.d.mts +13 -6
- package/resources/x/write-actions.d.mts.map +1 -1
- package/resources/x/write-actions.d.ts +13 -6
- package/resources/x/write-actions.d.ts.map +1 -1
- package/resources/x/write-actions.js +1 -1
- package/resources/x/write-actions.mjs +1 -1
- package/resources/x/x.d.mts +864 -27
- package/resources/x/x.d.mts.map +1 -1
- package/resources/x/x.d.ts +864 -27
- package/resources/x/x.d.ts.map +1 -1
- package/resources/x/x.js +78 -5
- package/resources/x/x.js.map +1 -1
- package/resources/x/x.mjs +80 -7
- package/resources/x/x.mjs.map +1 -1
- package/skills/x-twitter-scraper/SKILL.md +97 -350
- package/skills/x-twitter-scraper/metadata.json +3 -9
- package/skills/x-twitter-scraper/references/draws.md +24 -24
- package/skills/x-twitter-scraper/references/extractions.md +71 -62
- package/skills/x-twitter-scraper/references/mcp-setup.md +36 -39
- package/skills/x-twitter-scraper/references/mcp-tools.md +105 -166
- package/skills/x-twitter-scraper/references/python-examples.md +5 -5
- package/skills/x-twitter-scraper/references/security.md +8 -8
- package/skills/x-twitter-scraper/references/types-mcp-output-schemas.md +4 -4
- package/skills/x-twitter-scraper/references/types.md +0 -1
- package/skills/x-twitter-scraper/references/usage.md +5 -5
- package/skills/x-twitter-scraper/references/webhooks.md +28 -31
- package/skills/x-twitter-scraper/references/workflows.md +70 -71
- package/skills/x-twitter-scraper/skill-card.md +13 -14
- package/skills/x-twitter-scraper/skillspector-report.md +8 -5
- package/skills/xquik-account-automation/LICENSE +21 -0
- package/skills/xquik-account-automation/SKILL.md +91 -0
- package/skills/xquik-social-research/SKILL.md +49 -56
- package/src/client.ts +47 -4
- package/src/core/streaming.ts +328 -0
- package/src/internal/decoders/line.ts +140 -0
- package/src/internal/parse.ts +9 -0
- package/src/resources/account.ts +41 -12
- package/src/resources/compose.ts +77 -21
- package/src/resources/credits.ts +19 -10
- package/src/resources/drafts.ts +13 -22
- package/src/resources/draws.ts +94 -36
- package/src/resources/events.ts +3225 -68
- package/src/resources/extractions.ts +512 -125
- package/src/resources/guest-wallets.ts +6 -5
- package/src/resources/index.ts +24 -1
- package/src/resources/monitors/index.ts +2 -0
- package/src/resources/monitors/keywords.ts +82 -14
- package/src/resources/monitors/monitors.ts +66 -14
- package/src/resources/radar.ts +32 -36
- package/src/resources/shared.ts +2227 -351
- package/src/resources/styles.ts +43 -27
- package/src/resources/subscribe.ts +1 -1
- package/src/resources/support/index.ts +1 -0
- package/src/resources/support/support.ts +2 -0
- package/src/resources/support/tickets.ts +38 -10
- package/src/resources/trends.ts +23 -5
- package/src/resources/webhooks.ts +109 -15
- package/src/resources/x/account-connection-attempts.ts +1 -1
- package/src/resources/x/account-connection-challenges.ts +39 -11
- package/src/resources/x/accounts.ts +46 -10
- package/src/resources/x/analysis.ts +3947 -0
- package/src/resources/x/bookmarks.ts +103 -9
- package/src/resources/x/broadcasts.ts +225 -0
- package/src/resources/x/communities/communities.ts +743 -141
- package/src/resources/x/communities/index.ts +9 -0
- package/src/resources/x/communities/join.ts +46 -23
- package/src/resources/x/communities/media.ts +251 -0
- package/src/resources/x/communities/tweets.ts +427 -20
- package/src/resources/x/dm.ts +334 -11
- package/src/resources/x/followers.ts +35 -3
- package/src/resources/x/index.ts +106 -1
- package/src/resources/x/jobs.ts +627 -0
- package/src/resources/x/lists.ts +1307 -28
- package/src/resources/x/media.ts +24 -12
- package/src/resources/x/profile.ts +60 -30
- package/src/resources/x/spaces.ts +1076 -0
- package/src/resources/x/tweets/index.ts +18 -0
- package/src/resources/x/tweets/like.ts +38 -18
- package/src/resources/x/tweets/retweet.ts +38 -18
- package/src/resources/x/tweets/tweets.ts +3695 -843
- package/src/resources/x/users/follow.ts +38 -18
- package/src/resources/x/users/index.ts +22 -0
- package/src/resources/x/users/users.ts +3687 -465
- package/src/resources/x/write-actions.ts +13 -5
- package/src/resources/x/x.ts +1227 -15
- package/src/streaming.ts +6 -0
- package/src/version.ts +1 -1
- package/streaming.d.mts +3 -0
- package/streaming.d.mts.map +1 -0
- package/streaming.d.ts +3 -0
- package/streaming.d.ts.map +1 -0
- package/streaming.js +9 -0
- package/streaming.js.map +1 -0
- package/streaming.mjs +6 -0
- package/streaming.mjs.map +1 -0
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/skills/x-twitter-scraper/references/types-rest-api-vs-mcp-field-naming.md +0 -15
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// SPDX-FileCopyrightText: 2026 Xquik contributors
|
|
3
|
+
//
|
|
4
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
var _LineDecoder_buffer, _LineDecoder_carriageReturnIndex;
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.LineDecoder = void 0;
|
|
8
|
+
exports.findDoubleNewlineIndex = findDoubleNewlineIndex;
|
|
9
|
+
const tslib_1 = require("../tslib.js");
|
|
10
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
11
|
+
const bytes_1 = require("../utils/bytes.js");
|
|
12
|
+
/**
|
|
13
|
+
* A re-implementation of httpx's `LineDecoder` in Python that handles incrementally
|
|
14
|
+
* reading lines from text.
|
|
15
|
+
*
|
|
16
|
+
* https://github.com/encode/httpx/blob/920333ea98118e9cf617f246905d7b202510941c/httpx/_decoders.py#L258
|
|
17
|
+
*/
|
|
18
|
+
class LineDecoder {
|
|
19
|
+
constructor() {
|
|
20
|
+
_LineDecoder_buffer.set(this, void 0);
|
|
21
|
+
_LineDecoder_carriageReturnIndex.set(this, void 0);
|
|
22
|
+
tslib_1.__classPrivateFieldSet(this, _LineDecoder_buffer, new Uint8Array(), "f");
|
|
23
|
+
tslib_1.__classPrivateFieldSet(this, _LineDecoder_carriageReturnIndex, null, "f");
|
|
24
|
+
}
|
|
25
|
+
decode(chunk) {
|
|
26
|
+
if (chunk == null) {
|
|
27
|
+
return [];
|
|
28
|
+
}
|
|
29
|
+
const binaryChunk = chunk instanceof ArrayBuffer ? new Uint8Array(chunk)
|
|
30
|
+
: typeof chunk === 'string' ? (0, bytes_1.encodeUTF8)(chunk)
|
|
31
|
+
: chunk;
|
|
32
|
+
tslib_1.__classPrivateFieldSet(this, _LineDecoder_buffer, (0, bytes_1.concatBytes)([tslib_1.__classPrivateFieldGet(this, _LineDecoder_buffer, "f"), binaryChunk]), "f");
|
|
33
|
+
const lines = [];
|
|
34
|
+
let patternIndex;
|
|
35
|
+
while ((patternIndex = findNewlineIndex(tslib_1.__classPrivateFieldGet(this, _LineDecoder_buffer, "f"), tslib_1.__classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f"))) != null) {
|
|
36
|
+
if (patternIndex.carriage && tslib_1.__classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f") == null) {
|
|
37
|
+
// skip until we either get a corresponding `\n`, a new `\r` or nothing
|
|
38
|
+
tslib_1.__classPrivateFieldSet(this, _LineDecoder_carriageReturnIndex, patternIndex.index, "f");
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
// we got double \r or \rtext\n
|
|
42
|
+
if (tslib_1.__classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f") != null &&
|
|
43
|
+
(patternIndex.index !== tslib_1.__classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f") + 1 || patternIndex.carriage)) {
|
|
44
|
+
lines.push((0, bytes_1.decodeUTF8)(tslib_1.__classPrivateFieldGet(this, _LineDecoder_buffer, "f").subarray(0, tslib_1.__classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f") - 1)));
|
|
45
|
+
tslib_1.__classPrivateFieldSet(this, _LineDecoder_buffer, tslib_1.__classPrivateFieldGet(this, _LineDecoder_buffer, "f").subarray(tslib_1.__classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f")), "f");
|
|
46
|
+
tslib_1.__classPrivateFieldSet(this, _LineDecoder_carriageReturnIndex, null, "f");
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
const endIndex = tslib_1.__classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f") !== null ? patternIndex.preceding - 1 : patternIndex.preceding;
|
|
50
|
+
const line = (0, bytes_1.decodeUTF8)(tslib_1.__classPrivateFieldGet(this, _LineDecoder_buffer, "f").subarray(0, endIndex));
|
|
51
|
+
lines.push(line);
|
|
52
|
+
tslib_1.__classPrivateFieldSet(this, _LineDecoder_buffer, tslib_1.__classPrivateFieldGet(this, _LineDecoder_buffer, "f").subarray(patternIndex.index), "f");
|
|
53
|
+
tslib_1.__classPrivateFieldSet(this, _LineDecoder_carriageReturnIndex, null, "f");
|
|
54
|
+
}
|
|
55
|
+
return lines;
|
|
56
|
+
}
|
|
57
|
+
flush() {
|
|
58
|
+
if (!tslib_1.__classPrivateFieldGet(this, _LineDecoder_buffer, "f").length) {
|
|
59
|
+
return [];
|
|
60
|
+
}
|
|
61
|
+
return this.decode('\n');
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.LineDecoder = LineDecoder;
|
|
65
|
+
_LineDecoder_buffer = new WeakMap(), _LineDecoder_carriageReturnIndex = new WeakMap();
|
|
66
|
+
LineDecoder.NEWLINE_CHARS = new Set(['\n', '\r']);
|
|
67
|
+
LineDecoder.NEWLINE_REGEXP = /\r\n|[\n\r]/g;
|
|
68
|
+
/**
|
|
69
|
+
* This function searches the buffer for the end patterns, (\r or \n)
|
|
70
|
+
* and returns an object with the index preceding the matched newline and the
|
|
71
|
+
* index after the newline char. `null` is returned if no new line is found.
|
|
72
|
+
*
|
|
73
|
+
* ```ts
|
|
74
|
+
* findNewLineIndex('abc\ndef') -> { preceding: 2, index: 3 }
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
function findNewlineIndex(buffer, startIndex) {
|
|
78
|
+
const newline = 0x0a; // \n
|
|
79
|
+
const carriage = 0x0d; // \r
|
|
80
|
+
for (let i = startIndex ?? 0; i < buffer.length; i++) {
|
|
81
|
+
if (buffer[i] === newline) {
|
|
82
|
+
return { preceding: i, index: i + 1, carriage: false };
|
|
83
|
+
}
|
|
84
|
+
if (buffer[i] === carriage) {
|
|
85
|
+
return { preceding: i, index: i + 1, carriage: true };
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
function findDoubleNewlineIndex(buffer) {
|
|
91
|
+
// This function searches the buffer for the end patterns (\r\r, \n\n, \r\n\r\n)
|
|
92
|
+
// and returns the index right after the first occurrence of any pattern,
|
|
93
|
+
// or -1 if none of the patterns are found.
|
|
94
|
+
const newline = 0x0a; // \n
|
|
95
|
+
const carriage = 0x0d; // \r
|
|
96
|
+
for (let i = 0; i < buffer.length - 1; i++) {
|
|
97
|
+
if (buffer[i] === newline && buffer[i + 1] === newline) {
|
|
98
|
+
// \n\n
|
|
99
|
+
return i + 2;
|
|
100
|
+
}
|
|
101
|
+
if (buffer[i] === carriage && buffer[i + 1] === carriage) {
|
|
102
|
+
// \r\r
|
|
103
|
+
return i + 2;
|
|
104
|
+
}
|
|
105
|
+
if (buffer[i] === carriage &&
|
|
106
|
+
buffer[i + 1] === newline &&
|
|
107
|
+
i + 3 < buffer.length &&
|
|
108
|
+
buffer[i + 2] === carriage &&
|
|
109
|
+
buffer[i + 3] === newline) {
|
|
110
|
+
// \r\n\r\n
|
|
111
|
+
return i + 4;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return -1;
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=line.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line.js","sourceRoot":"","sources":["../../src/internal/decoders/line.ts"],"names":[],"mappings":";AAAA,kDAAkD;AAClD,EAAE;AACF,sCAAsC;;;;AA4GtC,wDA6BC;;AAvID,sFAAsF;AAEtF,6CAAqE;AAIrE;;;;;GAKG;AACH,MAAa,WAAW;IAOtB;QAHA,sCAAoB;QACpB,mDAAoC;QAGlC,+BAAA,IAAI,uBAAW,IAAI,UAAU,EAAE,MAAA,CAAC;QAChC,+BAAA,IAAI,oCAAwB,IAAI,MAAA,CAAC;IACnC,CAAC;IAED,M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M,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,OAAO,EACzB,CAAC;YACD,WAAW;YACX,OAAO,CAAC,GAAG,CAAC,CAAC;QACf,CAAC;IACH,CAAC;IAED,OAAO,CAAC,CAAC,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2026 Xquik contributors
|
|
2
|
+
//
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
var _LineDecoder_buffer, _LineDecoder_carriageReturnIndex;
|
|
5
|
+
import { __classPrivateFieldGet, __classPrivateFieldSet } from "../tslib.mjs";
|
|
6
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
7
|
+
import { concatBytes, decodeUTF8, encodeUTF8 } from "../utils/bytes.mjs";
|
|
8
|
+
/**
|
|
9
|
+
* A re-implementation of httpx's `LineDecoder` in Python that handles incrementally
|
|
10
|
+
* reading lines from text.
|
|
11
|
+
*
|
|
12
|
+
* https://github.com/encode/httpx/blob/920333ea98118e9cf617f246905d7b202510941c/httpx/_decoders.py#L258
|
|
13
|
+
*/
|
|
14
|
+
export class LineDecoder {
|
|
15
|
+
constructor() {
|
|
16
|
+
_LineDecoder_buffer.set(this, void 0);
|
|
17
|
+
_LineDecoder_carriageReturnIndex.set(this, void 0);
|
|
18
|
+
__classPrivateFieldSet(this, _LineDecoder_buffer, new Uint8Array(), "f");
|
|
19
|
+
__classPrivateFieldSet(this, _LineDecoder_carriageReturnIndex, null, "f");
|
|
20
|
+
}
|
|
21
|
+
decode(chunk) {
|
|
22
|
+
if (chunk == null) {
|
|
23
|
+
return [];
|
|
24
|
+
}
|
|
25
|
+
const binaryChunk = chunk instanceof ArrayBuffer ? new Uint8Array(chunk)
|
|
26
|
+
: typeof chunk === 'string' ? encodeUTF8(chunk)
|
|
27
|
+
: chunk;
|
|
28
|
+
__classPrivateFieldSet(this, _LineDecoder_buffer, concatBytes([__classPrivateFieldGet(this, _LineDecoder_buffer, "f"), binaryChunk]), "f");
|
|
29
|
+
const lines = [];
|
|
30
|
+
let patternIndex;
|
|
31
|
+
while ((patternIndex = findNewlineIndex(__classPrivateFieldGet(this, _LineDecoder_buffer, "f"), __classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f"))) != null) {
|
|
32
|
+
if (patternIndex.carriage && __classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f") == null) {
|
|
33
|
+
// skip until we either get a corresponding `\n`, a new `\r` or nothing
|
|
34
|
+
__classPrivateFieldSet(this, _LineDecoder_carriageReturnIndex, patternIndex.index, "f");
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
// we got double \r or \rtext\n
|
|
38
|
+
if (__classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f") != null &&
|
|
39
|
+
(patternIndex.index !== __classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f") + 1 || patternIndex.carriage)) {
|
|
40
|
+
lines.push(decodeUTF8(__classPrivateFieldGet(this, _LineDecoder_buffer, "f").subarray(0, __classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f") - 1)));
|
|
41
|
+
__classPrivateFieldSet(this, _LineDecoder_buffer, __classPrivateFieldGet(this, _LineDecoder_buffer, "f").subarray(__classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f")), "f");
|
|
42
|
+
__classPrivateFieldSet(this, _LineDecoder_carriageReturnIndex, null, "f");
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
const endIndex = __classPrivateFieldGet(this, _LineDecoder_carriageReturnIndex, "f") !== null ? patternIndex.preceding - 1 : patternIndex.preceding;
|
|
46
|
+
const line = decodeUTF8(__classPrivateFieldGet(this, _LineDecoder_buffer, "f").subarray(0, endIndex));
|
|
47
|
+
lines.push(line);
|
|
48
|
+
__classPrivateFieldSet(this, _LineDecoder_buffer, __classPrivateFieldGet(this, _LineDecoder_buffer, "f").subarray(patternIndex.index), "f");
|
|
49
|
+
__classPrivateFieldSet(this, _LineDecoder_carriageReturnIndex, null, "f");
|
|
50
|
+
}
|
|
51
|
+
return lines;
|
|
52
|
+
}
|
|
53
|
+
flush() {
|
|
54
|
+
if (!__classPrivateFieldGet(this, _LineDecoder_buffer, "f").length) {
|
|
55
|
+
return [];
|
|
56
|
+
}
|
|
57
|
+
return this.decode('\n');
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
_LineDecoder_buffer = new WeakMap(), _LineDecoder_carriageReturnIndex = new WeakMap();
|
|
61
|
+
LineDecoder.NEWLINE_CHARS = new Set(['\n', '\r']);
|
|
62
|
+
LineDecoder.NEWLINE_REGEXP = /\r\n|[\n\r]/g;
|
|
63
|
+
/**
|
|
64
|
+
* This function searches the buffer for the end patterns, (\r or \n)
|
|
65
|
+
* and returns an object with the index preceding the matched newline and the
|
|
66
|
+
* index after the newline char. `null` is returned if no new line is found.
|
|
67
|
+
*
|
|
68
|
+
* ```ts
|
|
69
|
+
* findNewLineIndex('abc\ndef') -> { preceding: 2, index: 3 }
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
function findNewlineIndex(buffer, startIndex) {
|
|
73
|
+
const newline = 0x0a; // \n
|
|
74
|
+
const carriage = 0x0d; // \r
|
|
75
|
+
for (let i = startIndex ?? 0; i < buffer.length; i++) {
|
|
76
|
+
if (buffer[i] === newline) {
|
|
77
|
+
return { preceding: i, index: i + 1, carriage: false };
|
|
78
|
+
}
|
|
79
|
+
if (buffer[i] === carriage) {
|
|
80
|
+
return { preceding: i, index: i + 1, carriage: true };
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
export function findDoubleNewlineIndex(buffer) {
|
|
86
|
+
// This function searches the buffer for the end patterns (\r\r, \n\n, \r\n\r\n)
|
|
87
|
+
// and returns the index right after the first occurrence of any pattern,
|
|
88
|
+
// or -1 if none of the patterns are found.
|
|
89
|
+
const newline = 0x0a; // \n
|
|
90
|
+
const carriage = 0x0d; // \r
|
|
91
|
+
for (let i = 0; i < buffer.length - 1; i++) {
|
|
92
|
+
if (buffer[i] === newline && buffer[i + 1] === newline) {
|
|
93
|
+
// \n\n
|
|
94
|
+
return i + 2;
|
|
95
|
+
}
|
|
96
|
+
if (buffer[i] === carriage && buffer[i + 1] === carriage) {
|
|
97
|
+
// \r\r
|
|
98
|
+
return i + 2;
|
|
99
|
+
}
|
|
100
|
+
if (buffer[i] === carriage &&
|
|
101
|
+
buffer[i + 1] === newline &&
|
|
102
|
+
i + 3 < buffer.length &&
|
|
103
|
+
buffer[i + 2] === carriage &&
|
|
104
|
+
buffer[i + 3] === newline) {
|
|
105
|
+
// \r\n\r\n
|
|
106
|
+
return i + 4;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return -1;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=line.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line.mjs","sourceRoot":"","sources":["../../src/internal/decoders/line.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,EAAE;AACF,sCAAsC;;;AAEtC,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,2BAAuB;AAIrE;;;;;GAKG;AACH,MAAM,OAAO,WAAW;IAOtB;QAHA,sCAAoB;QACpB,mDAAoC;QAGlC,uBAAA,IAAI,uBAAW,IAAI,UAAU,EAAE,MAAA,CAAC;QAChC,uBAAA,IAAI,oCAAwB,IAAI,MAAA,CAAC;IACnC,CAAC;IAED,MAAM,CAAC,KAAY;QACjB,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YAClB,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,WAAW,GACf,KAAK,YAAY,WAAW,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC;YACpD,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,KA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AAO,KAAK,EAAE,mBAAmB,EAAE,8BAA0B;
|
|
1
|
+
{"version":3,"file":"parse.d.mts","sourceRoot":"","sources":["../src/internal/parse.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,8BAA0B;AAE7D,OAAO,EAAE,KAAK,eAAe,EAAE,sBAAkB;AAGjD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,mBAAmB,CAAC;IAC7B,UAAU,EAAE,eAAe,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,wBAAsB,oBAAoB,CAAC,CAAC,EAAE,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,CAAC,CAAC,CAgD1G"}
|
package/internal/parse.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../src/internal/parse.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,6BAA0B;
|
|
1
|
+
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../src/internal/parse.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,6BAA0B;AAE7D,OAAO,EAAE,KAAK,eAAe,EAAE,qBAAkB;AAGjD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,mBAAmB,CAAC;IAC7B,UAAU,EAAE,eAAe,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,wBAAsB,oBAAoB,CAAC,CAAC,EAAE,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,CAAC,CAAC,CAgD1G"}
|
package/internal/parse.js
CHANGED
|
@@ -4,10 +4,17 @@
|
|
|
4
4
|
// SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.defaultParseResponse = defaultParseResponse;
|
|
7
|
+
const streaming_1 = require("../core/streaming.js");
|
|
7
8
|
const log_1 = require("./utils/log.js");
|
|
8
9
|
async function defaultParseResponse(client, props) {
|
|
9
10
|
const { response, requestLogID, retryOfRequestLogID, startTime } = props;
|
|
10
11
|
const body = await (async () => {
|
|
12
|
+
if (props.options.stream) {
|
|
13
|
+
(0, log_1.loggerFor)(client).debug('response', response.status, response.url, response.headers, response.body);
|
|
14
|
+
// Note: there is an invariant here that isn't represented in the type system
|
|
15
|
+
// that if you set `stream: true` the response type must also be `Stream<T>`
|
|
16
|
+
return streaming_1.Stream.fromSSEResponse(response, props.controller, client);
|
|
17
|
+
}
|
|
11
18
|
// fetch refuses to read the body when the status code is 204.
|
|
12
19
|
if (response.status === 204) {
|
|
13
20
|
return null;
|
package/internal/parse.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../src/internal/parse.ts"],"names":[],"mappings":";AAAA,kDAAkD;AAClD,EAAE;AACF,sCAAsC;;
|
|
1
|
+
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../src/internal/parse.ts"],"names":[],"mappings":";AAAA,kDAAkD;AAClD,EAAE;AACF,sCAAsC;;AAkBtC,oDAgDC;AA7DD,oDAA2C;AAE3C,wCAA8D;AAWvD,KAAK,UAAU,oBAAoB,CAAI,MAAuB,EAAE,KAAuB;IAC5F,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,mBAAmB,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IACzE,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,IAAI,E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QACnC,OAAO,IAAoB,CAAC;IAC9B,CAAC,CAAC,EAAE,CAAC;IACL,IAAA,eAAS,EAAC,MAAM,CAAC,CAAC,KAAK,CACrB,IAAI,YAAY,mBAAmB,EACnC,IAAA,0BAAoB,EAAC;QACnB,mBAAmB;QACnB,GAAG,EAAE,QAAQ,CAAC,GAAG;QACjB,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,IAAI;QACJ,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS;KACnC,CAAC,CACH,CAAC;IACF,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/internal/parse.mjs
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
// SPDX-FileCopyrightText: 2026 Xquik contributors
|
|
2
2
|
//
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
import { Stream } from "../core/streaming.mjs";
|
|
4
5
|
import { formatRequestDetails, loggerFor } from "./utils/log.mjs";
|
|
5
6
|
export async function defaultParseResponse(client, props) {
|
|
6
7
|
const { response, requestLogID, retryOfRequestLogID, startTime } = props;
|
|
7
8
|
const body = await (async () => {
|
|
9
|
+
if (props.options.stream) {
|
|
10
|
+
loggerFor(client).debug('response', response.status, response.url, response.headers, response.body);
|
|
11
|
+
// Note: there is an invariant here that isn't represented in the type system
|
|
12
|
+
// that if you set `stream: true` the response type must also be `Stream<T>`
|
|
13
|
+
return Stream.fromSSEResponse(response, props.controller, client);
|
|
14
|
+
}
|
|
8
15
|
// fetch refuses to read the body when the status code is 204.
|
|
9
16
|
if (response.status === 204) {
|
|
10
17
|
return null;
|
package/internal/parse.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.mjs","sourceRoot":"","sources":["../src/internal/parse.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,EAAE;AACF,sCAAsC;
|
|
1
|
+
{"version":3,"file":"parse.mjs","sourceRoot":"","sources":["../src/internal/parse.ts"],"names":[],"mappings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X,MAAM,aAAa,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;YAC7D,IAAI,aAAa,KAAK,GAAG,EAAE,CAAC;gBAC1B,8CAA8C;gBAC9C,OAAO,SAAc,CAAC;YACxB,CAAC;YAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YACnC,OAAO,IAAS,CAAC;QACnB,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACnC,OAAO,IAAoB,CAAC;IAC9B,CAAC,CAAC,EAAE,CAAC;IACL,SAAS,CAAC,MAAM,CAAC,CAAC,KAAK,CACrB,IAAI,YAAY,mBAAmB,EACnC,oBAAoB,CAAC;QACnB,mBAAmB;QACnB,GAAG,EAAE,QAAQ,CAAC,GAAG;QACjB,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,IAAI;QACJ,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS;KACnC,CAAC,CACH,CAAC;IACF,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/internal/tslib.js
CHANGED
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.__setModuleDefault = exports.__createBinding = void 0;
|
|
4
|
-
exports.__importStar = __importStar;
|
|
5
|
-
exports.__exportStar = __exportStar;
|
|
6
4
|
exports.__classPrivateFieldSet = __classPrivateFieldSet;
|
|
7
5
|
exports.__classPrivateFieldGet = __classPrivateFieldGet;
|
|
6
|
+
exports.__importStar = __importStar;
|
|
7
|
+
exports.__exportStar = __exportStar;
|
|
8
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
9
|
+
if (kind === "m")
|
|
10
|
+
throw new TypeError("Private method is not writable");
|
|
11
|
+
if (kind === "a" && !f)
|
|
12
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
13
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
14
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
15
|
+
return kind === "a" ? f.call(receiver, value) : f ? (f.value = value) : state.set(receiver, value), value;
|
|
16
|
+
}
|
|
17
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
18
|
+
if (kind === "a" && !f)
|
|
19
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
20
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
21
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
22
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
23
|
+
}
|
|
8
24
|
var __createBinding = Object.create
|
|
9
25
|
? function (o, m, k, k2) {
|
|
10
26
|
if (k2 === void 0)
|
|
@@ -63,19 +79,3 @@ function __exportStar(m, o) {
|
|
|
63
79
|
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
64
80
|
__createBinding(o, m, p);
|
|
65
81
|
}
|
|
66
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
67
|
-
if (kind === "m")
|
|
68
|
-
throw new TypeError("Private method is not writable");
|
|
69
|
-
if (kind === "a" && !f)
|
|
70
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
71
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
72
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
73
|
-
return kind === "a" ? f.call(receiver, value) : f ? (f.value = value) : state.set(receiver, value), value;
|
|
74
|
-
}
|
|
75
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
76
|
-
if (kind === "a" && !f)
|
|
77
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
78
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
79
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
80
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
81
|
-
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x-twitter-scraper",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.13.0",
|
|
4
|
+
"description": "X API & Twitter API SDK for TypeScript. Scrape Twitter search, profiles & followers as a Twitter scraper & tweet scraper. Not affiliated with X Corp.",
|
|
5
5
|
"author": "Xquik <support@xquik.com>",
|
|
6
6
|
"types": "./index.d.ts",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -18,15 +18,22 @@
|
|
|
18
18
|
"x-api",
|
|
19
19
|
"twitter-api",
|
|
20
20
|
"twitter-scraper",
|
|
21
|
+
"tweet-scraper",
|
|
22
|
+
"scrape-twitter",
|
|
23
|
+
"twitter-api-alternative",
|
|
24
|
+
"twitter-data-api",
|
|
25
|
+
"twitter-sdk",
|
|
26
|
+
"twitter-api-typescript",
|
|
27
|
+
"twitter-api-javascript",
|
|
28
|
+
"twitter-api-node",
|
|
29
|
+
"typescript-sdk",
|
|
21
30
|
"x-twitter-scraper",
|
|
22
31
|
"xquik",
|
|
23
32
|
"pi-package",
|
|
24
|
-
"typescript-sdk",
|
|
25
33
|
"twitter-search",
|
|
26
34
|
"follower-export",
|
|
27
35
|
"webhooks",
|
|
28
|
-
"x-automation"
|
|
29
|
-
"social-media-api"
|
|
36
|
+
"x-automation"
|
|
30
37
|
],
|
|
31
38
|
"pi": {
|
|
32
39
|
"skills": [
|
|
@@ -50,6 +57,7 @@
|
|
|
50
57
|
"test": "./scripts/test",
|
|
51
58
|
"build": "./scripts/build",
|
|
52
59
|
"check:reproducible": "./scripts/check-reproducible",
|
|
60
|
+
"check:all": "pnpm lint && pnpm test --runInBand && pnpm run check:reproducible && node scripts/utils/check-audit.cjs",
|
|
53
61
|
"format": "./scripts/format",
|
|
54
62
|
"tsn": "ts-node -r tsconfig-paths/register",
|
|
55
63
|
"lint": "./scripts/lint",
|
|
@@ -144,6 +152,16 @@
|
|
|
144
152
|
"./resources.mjs": {
|
|
145
153
|
"default": "./resources.mjs"
|
|
146
154
|
},
|
|
155
|
+
"./streaming": {
|
|
156
|
+
"import": "./streaming.mjs",
|
|
157
|
+
"require": "./streaming.js"
|
|
158
|
+
},
|
|
159
|
+
"./streaming.js": {
|
|
160
|
+
"default": "./streaming.js"
|
|
161
|
+
},
|
|
162
|
+
"./streaming.mjs": {
|
|
163
|
+
"default": "./streaming.mjs"
|
|
164
|
+
},
|
|
147
165
|
"./uploads": {
|
|
148
166
|
"import": "./uploads.mjs",
|
|
149
167
|
"require": "./uploads.js"
|
package/resources/account.d.mts
CHANGED
|
@@ -6,7 +6,8 @@ import { RequestOptions } from "../internal/request-options.mjs";
|
|
|
6
6
|
*/
|
|
7
7
|
export declare class Account extends APIResource {
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Returns plan, credit, monitoring, and account settings for the authenticated
|
|
10
|
+
* user.
|
|
10
11
|
*
|
|
11
12
|
* @example
|
|
12
13
|
* ```ts
|
|
@@ -15,7 +16,7 @@ export declare class Account extends APIResource {
|
|
|
15
16
|
*/
|
|
16
17
|
retrieve(options?: RequestOptions): APIPromise<AccountRetrieveResponse>;
|
|
17
18
|
/**
|
|
18
|
-
*
|
|
19
|
+
* Links an X username to the authenticated Xquik account.
|
|
19
20
|
*
|
|
20
21
|
* @example
|
|
21
22
|
* ```ts
|
|
@@ -26,7 +27,7 @@ export declare class Account extends APIResource {
|
|
|
26
27
|
*/
|
|
27
28
|
setXUsername(body: AccountSetXUsernameParams, options?: RequestOptions): APIPromise<AccountSetXUsernameResponse>;
|
|
28
29
|
/**
|
|
29
|
-
*
|
|
30
|
+
* Changes the locale used for account responses and notifications.
|
|
30
31
|
*
|
|
31
32
|
* @example
|
|
32
33
|
* ```ts
|
|
@@ -46,6 +47,10 @@ export interface AccountRetrieveResponse {
|
|
|
46
47
|
monitorsAllowed: number;
|
|
47
48
|
monitorsUsed: number;
|
|
48
49
|
plan: 'active' | 'inactive';
|
|
50
|
+
/**
|
|
51
|
+
* Subscription state without billing provider identifiers.
|
|
52
|
+
*/
|
|
53
|
+
subscription: AccountRetrieveResponse.Subscription;
|
|
49
54
|
creditInfo?: AccountRetrieveResponse.CreditInfo;
|
|
50
55
|
/**
|
|
51
56
|
* Linked X username, omitted when no X account is connected.
|
|
@@ -55,21 +60,21 @@ export interface AccountRetrieveResponse {
|
|
|
55
60
|
export declare namespace AccountRetrieveResponse {
|
|
56
61
|
interface MonitorBilling {
|
|
57
62
|
/**
|
|
58
|
-
*
|
|
63
|
+
* Daily credits for currently active monitors.
|
|
59
64
|
*/
|
|
60
65
|
activeDailyEstimate: string;
|
|
61
66
|
/**
|
|
62
|
-
*
|
|
67
|
+
* Credits charged each hour for currently active monitors.
|
|
63
68
|
*/
|
|
64
69
|
activeHourlyBurn: string;
|
|
65
70
|
/**
|
|
66
|
-
*
|
|
71
|
+
* Daily credits charged for 1 active monitor.
|
|
67
72
|
*/
|
|
68
|
-
creditsPerActiveMonitorDay:
|
|
73
|
+
creditsPerActiveMonitorDay: '720';
|
|
69
74
|
/**
|
|
70
|
-
* Hourly credits charged for 1 active monitor.
|
|
75
|
+
* Hourly credits charged for 1 active monitor. It is a monitor's only charge.
|
|
71
76
|
*/
|
|
72
|
-
creditsPerActiveMonitorHour:
|
|
77
|
+
creditsPerActiveMonitorHour: '30';
|
|
73
78
|
/**
|
|
74
79
|
* Webhook and event deliveries are included in monitor billing.
|
|
75
80
|
*/
|
|
@@ -83,26 +88,44 @@ export declare namespace AccountRetrieveResponse {
|
|
|
83
88
|
*/
|
|
84
89
|
unlimitedSlots: boolean;
|
|
85
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Subscription state without billing provider identifiers.
|
|
93
|
+
*/
|
|
94
|
+
interface Subscription {
|
|
95
|
+
status: 'none' | 'active' | 'past_due' | 'canceling' | 'incomplete';
|
|
96
|
+
/**
|
|
97
|
+
* Renewal date, or the end date when canceling.
|
|
98
|
+
*/
|
|
99
|
+
currentPeriodEnd?: string;
|
|
100
|
+
currentPeriodStart?: string;
|
|
101
|
+
tier?: 'starter' | 'pro' | 'business';
|
|
102
|
+
}
|
|
86
103
|
interface CreditInfo {
|
|
87
104
|
/**
|
|
88
105
|
* Dollar amount charged when automatic top-up runs.
|
|
89
106
|
*/
|
|
90
107
|
autoTopupAmountDollars: number;
|
|
91
108
|
autoTopupEnabled: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* True when 3 declined charges in a row on one card stopped automatic top-up while
|
|
111
|
+
* it stays enabled. A paid top-up, a paid plan renewal, or the next automatic
|
|
112
|
+
* top-up on a new card clears it.
|
|
113
|
+
*/
|
|
114
|
+
autoTopupStopped: boolean;
|
|
92
115
|
/**
|
|
93
116
|
* Bigint string threshold that triggers automatic top-up when enabled.
|
|
94
117
|
*/
|
|
95
|
-
autoTopupThreshold:
|
|
118
|
+
autoTopupThreshold: '10000' | '50000' | '100000' | '250000';
|
|
96
119
|
/**
|
|
97
120
|
* Bigint string to preserve precision above Number.MAX_SAFE_INTEGER.
|
|
98
121
|
*/
|
|
99
122
|
balance: string;
|
|
100
123
|
/**
|
|
101
|
-
* Total purchased
|
|
124
|
+
* Total purchased credits as a bigint string.
|
|
102
125
|
*/
|
|
103
126
|
lifetimePurchased: string;
|
|
104
127
|
/**
|
|
105
|
-
* Total consumed
|
|
128
|
+
* Total consumed credits as a bigint string.
|
|
106
129
|
*/
|
|
107
130
|
lifetimeUsed: string;
|
|
108
131
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.mts","sourceRoot":"","sources":["../src/resources/account.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,gCAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAE7D;;GAEG;AACH,qBAAa,OAAQ,SAAQ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