x-twitter-scraper 0.12.4 → 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 +65 -0
- package/README.md +30 -9
- 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 +99 -344
- package/skills/x-twitter-scraper/metadata.json +2 -2
- package/skills/x-twitter-scraper/references/mcp-setup.md +12 -15
- package/skills/x-twitter-scraper/references/mcp-tools.md +105 -166
- 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/skill-card.md +5 -6
- package/skills/x-twitter-scraper/skillspector-report.md +6 -3
- package/skills/xquik-account-automation/LICENSE +21 -0
- package/skills/xquik-account-automation/SKILL.md +91 -0
- package/skills/xquik-social-research/SKILL.md +48 -55
- 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,140 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2026 Xquik contributors
|
|
2
|
+
//
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
6
|
+
|
|
7
|
+
import { concatBytes, decodeUTF8, encodeUTF8 } from '../utils/bytes';
|
|
8
|
+
|
|
9
|
+
export type Bytes = string | ArrayBuffer | Uint8Array | null | undefined;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A re-implementation of httpx's `LineDecoder` in Python that handles incrementally
|
|
13
|
+
* reading lines from text.
|
|
14
|
+
*
|
|
15
|
+
* https://github.com/encode/httpx/blob/920333ea98118e9cf617f246905d7b202510941c/httpx/_decoders.py#L258
|
|
16
|
+
*/
|
|
17
|
+
export class LineDecoder {
|
|
18
|
+
static NEWLINE_CHARS = new Set(['\n', '\r']);
|
|
19
|
+
static NEWLINE_REGEXP = /\r\n|[\n\r]/g;
|
|
20
|
+
|
|
21
|
+
#buffer: Uint8Array;
|
|
22
|
+
#carriageReturnIndex: number | null;
|
|
23
|
+
|
|
24
|
+
constructor() {
|
|
25
|
+
this.#buffer = new Uint8Array();
|
|
26
|
+
this.#carriageReturnIndex = null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
decode(chunk: Bytes): string[] {
|
|
30
|
+
if (chunk == null) {
|
|
31
|
+
return [];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const binaryChunk =
|
|
35
|
+
chunk instanceof ArrayBuffer ? new Uint8Array(chunk)
|
|
36
|
+
: typeof chunk === 'string' ? encodeUTF8(chunk)
|
|
37
|
+
: chunk;
|
|
38
|
+
|
|
39
|
+
this.#buffer = concatBytes([this.#buffer, binaryChunk]);
|
|
40
|
+
|
|
41
|
+
const lines: string[] = [];
|
|
42
|
+
let patternIndex;
|
|
43
|
+
while ((patternIndex = findNewlineIndex(this.#buffer, this.#carriageReturnIndex)) != null) {
|
|
44
|
+
if (patternIndex.carriage && this.#carriageReturnIndex == null) {
|
|
45
|
+
// skip until we either get a corresponding `\n`, a new `\r` or nothing
|
|
46
|
+
this.#carriageReturnIndex = patternIndex.index;
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// we got double \r or \rtext\n
|
|
51
|
+
if (
|
|
52
|
+
this.#carriageReturnIndex != null &&
|
|
53
|
+
(patternIndex.index !== this.#carriageReturnIndex + 1 || patternIndex.carriage)
|
|
54
|
+
) {
|
|
55
|
+
lines.push(decodeUTF8(this.#buffer.subarray(0, this.#carriageReturnIndex - 1)));
|
|
56
|
+
this.#buffer = this.#buffer.subarray(this.#carriageReturnIndex);
|
|
57
|
+
this.#carriageReturnIndex = null;
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const endIndex =
|
|
62
|
+
this.#carriageReturnIndex !== null ? patternIndex.preceding - 1 : patternIndex.preceding;
|
|
63
|
+
|
|
64
|
+
const line = decodeUTF8(this.#buffer.subarray(0, endIndex));
|
|
65
|
+
lines.push(line);
|
|
66
|
+
|
|
67
|
+
this.#buffer = this.#buffer.subarray(patternIndex.index);
|
|
68
|
+
this.#carriageReturnIndex = null;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return lines;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
flush(): string[] {
|
|
75
|
+
if (!this.#buffer.length) {
|
|
76
|
+
return [];
|
|
77
|
+
}
|
|
78
|
+
return this.decode('\n');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* This function searches the buffer for the end patterns, (\r or \n)
|
|
84
|
+
* and returns an object with the index preceding the matched newline and the
|
|
85
|
+
* index after the newline char. `null` is returned if no new line is found.
|
|
86
|
+
*
|
|
87
|
+
* ```ts
|
|
88
|
+
* findNewLineIndex('abc\ndef') -> { preceding: 2, index: 3 }
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
function findNewlineIndex(
|
|
92
|
+
buffer: Uint8Array,
|
|
93
|
+
startIndex: number | null,
|
|
94
|
+
): { preceding: number; index: number; carriage: boolean } | null {
|
|
95
|
+
const newline = 0x0a; // \n
|
|
96
|
+
const carriage = 0x0d; // \r
|
|
97
|
+
|
|
98
|
+
for (let i = startIndex ?? 0; i < buffer.length; i++) {
|
|
99
|
+
if (buffer[i] === newline) {
|
|
100
|
+
return { preceding: i, index: i + 1, carriage: false };
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (buffer[i] === carriage) {
|
|
104
|
+
return { preceding: i, index: i + 1, carriage: true };
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function findDoubleNewlineIndex(buffer: Uint8Array): number {
|
|
112
|
+
// This function searches the buffer for the end patterns (\r\r, \n\n, \r\n\r\n)
|
|
113
|
+
// and returns the index right after the first occurrence of any pattern,
|
|
114
|
+
// or -1 if none of the patterns are found.
|
|
115
|
+
const newline = 0x0a; // \n
|
|
116
|
+
const carriage = 0x0d; // \r
|
|
117
|
+
|
|
118
|
+
for (let i = 0; i < buffer.length - 1; i++) {
|
|
119
|
+
if (buffer[i] === newline && buffer[i + 1] === newline) {
|
|
120
|
+
// \n\n
|
|
121
|
+
return i + 2;
|
|
122
|
+
}
|
|
123
|
+
if (buffer[i] === carriage && buffer[i + 1] === carriage) {
|
|
124
|
+
// \r\r
|
|
125
|
+
return i + 2;
|
|
126
|
+
}
|
|
127
|
+
if (
|
|
128
|
+
buffer[i] === carriage &&
|
|
129
|
+
buffer[i + 1] === newline &&
|
|
130
|
+
i + 3 < buffer.length &&
|
|
131
|
+
buffer[i + 2] === carriage &&
|
|
132
|
+
buffer[i + 3] === newline
|
|
133
|
+
) {
|
|
134
|
+
// \r\n\r\n
|
|
135
|
+
return i + 4;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return -1;
|
|
140
|
+
}
|
package/src/internal/parse.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
6
6
|
|
|
7
7
|
import type { FinalRequestOptions } from './request-options';
|
|
8
|
+
import { Stream } from '../core/streaming';
|
|
8
9
|
import { type XTwitterScraper } from '../client';
|
|
9
10
|
import { formatRequestDetails, loggerFor } from './utils/log';
|
|
10
11
|
|
|
@@ -20,6 +21,14 @@ export type APIResponseProps = {
|
|
|
20
21
|
export async function defaultParseResponse<T>(client: XTwitterScraper, props: APIResponseProps): Promise<T> {
|
|
21
22
|
const { response, requestLogID, retryOfRequestLogID, startTime } = props;
|
|
22
23
|
const body = await (async () => {
|
|
24
|
+
if (props.options.stream) {
|
|
25
|
+
loggerFor(client).debug('response', response.status, response.url, response.headers, response.body);
|
|
26
|
+
|
|
27
|
+
// Note: there is an invariant here that isn't represented in the type system
|
|
28
|
+
// that if you set `stream: true` the response type must also be `Stream<T>`
|
|
29
|
+
return Stream.fromSSEResponse(response, props.controller, client) as any;
|
|
30
|
+
}
|
|
31
|
+
|
|
23
32
|
// fetch refuses to read the body when the status code is 204.
|
|
24
33
|
if (response.status === 204) {
|
|
25
34
|
return null as T;
|
package/src/resources/account.ts
CHANGED
|
@@ -13,7 +13,8 @@ import { RequestOptions } from '../internal/request-options';
|
|
|
13
13
|
*/
|
|
14
14
|
export class Account extends APIResource {
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Returns plan, credit, monitoring, and account settings for the authenticated
|
|
17
|
+
* user.
|
|
17
18
|
*
|
|
18
19
|
* @example
|
|
19
20
|
* ```ts
|
|
@@ -25,7 +26,7 @@ export class Account extends APIResource {
|
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
/**
|
|
28
|
-
*
|
|
29
|
+
* Links an X username to the authenticated Xquik account.
|
|
29
30
|
*
|
|
30
31
|
* @example
|
|
31
32
|
* ```ts
|
|
@@ -42,7 +43,7 @@ export class Account extends APIResource {
|
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
/**
|
|
45
|
-
*
|
|
46
|
+
* Changes the locale used for account responses and notifications.
|
|
46
47
|
*
|
|
47
48
|
* @example
|
|
48
49
|
* ```ts
|
|
@@ -72,6 +73,11 @@ export interface AccountRetrieveResponse {
|
|
|
72
73
|
|
|
73
74
|
plan: 'active' | 'inactive';
|
|
74
75
|
|
|
76
|
+
/**
|
|
77
|
+
* Subscription state without billing provider identifiers.
|
|
78
|
+
*/
|
|
79
|
+
subscription: AccountRetrieveResponse.Subscription;
|
|
80
|
+
|
|
75
81
|
creditInfo?: AccountRetrieveResponse.CreditInfo;
|
|
76
82
|
|
|
77
83
|
/**
|
|
@@ -83,24 +89,24 @@ export interface AccountRetrieveResponse {
|
|
|
83
89
|
export namespace AccountRetrieveResponse {
|
|
84
90
|
export interface MonitorBilling {
|
|
85
91
|
/**
|
|
86
|
-
*
|
|
92
|
+
* Daily credits for currently active monitors.
|
|
87
93
|
*/
|
|
88
94
|
activeDailyEstimate: string;
|
|
89
95
|
|
|
90
96
|
/**
|
|
91
|
-
*
|
|
97
|
+
* Credits charged each hour for currently active monitors.
|
|
92
98
|
*/
|
|
93
99
|
activeHourlyBurn: string;
|
|
94
100
|
|
|
95
101
|
/**
|
|
96
|
-
*
|
|
102
|
+
* Daily credits charged for 1 active monitor.
|
|
97
103
|
*/
|
|
98
|
-
creditsPerActiveMonitorDay:
|
|
104
|
+
creditsPerActiveMonitorDay: '720';
|
|
99
105
|
|
|
100
106
|
/**
|
|
101
|
-
* Hourly credits charged for 1 active monitor.
|
|
107
|
+
* Hourly credits charged for 1 active monitor. It is a monitor's only charge.
|
|
102
108
|
*/
|
|
103
|
-
creditsPerActiveMonitorHour:
|
|
109
|
+
creditsPerActiveMonitorHour: '30';
|
|
104
110
|
|
|
105
111
|
/**
|
|
106
112
|
* Webhook and event deliveries are included in monitor billing.
|
|
@@ -118,6 +124,22 @@ export namespace AccountRetrieveResponse {
|
|
|
118
124
|
unlimitedSlots: boolean;
|
|
119
125
|
}
|
|
120
126
|
|
|
127
|
+
/**
|
|
128
|
+
* Subscription state without billing provider identifiers.
|
|
129
|
+
*/
|
|
130
|
+
export interface Subscription {
|
|
131
|
+
status: 'none' | 'active' | 'past_due' | 'canceling' | 'incomplete';
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Renewal date, or the end date when canceling.
|
|
135
|
+
*/
|
|
136
|
+
currentPeriodEnd?: string;
|
|
137
|
+
|
|
138
|
+
currentPeriodStart?: string;
|
|
139
|
+
|
|
140
|
+
tier?: 'starter' | 'pro' | 'business';
|
|
141
|
+
}
|
|
142
|
+
|
|
121
143
|
export interface CreditInfo {
|
|
122
144
|
/**
|
|
123
145
|
* Dollar amount charged when automatic top-up runs.
|
|
@@ -126,10 +148,17 @@ export namespace AccountRetrieveResponse {
|
|
|
126
148
|
|
|
127
149
|
autoTopupEnabled: boolean;
|
|
128
150
|
|
|
151
|
+
/**
|
|
152
|
+
* True when 3 declined charges in a row on one card stopped automatic top-up while
|
|
153
|
+
* it stays enabled. A paid top-up, a paid plan renewal, or the next automatic
|
|
154
|
+
* top-up on a new card clears it.
|
|
155
|
+
*/
|
|
156
|
+
autoTopupStopped: boolean;
|
|
157
|
+
|
|
129
158
|
/**
|
|
130
159
|
* Bigint string threshold that triggers automatic top-up when enabled.
|
|
131
160
|
*/
|
|
132
|
-
autoTopupThreshold:
|
|
161
|
+
autoTopupThreshold: '10000' | '50000' | '100000' | '250000';
|
|
133
162
|
|
|
134
163
|
/**
|
|
135
164
|
* Bigint string to preserve precision above Number.MAX_SAFE_INTEGER.
|
|
@@ -137,12 +166,12 @@ export namespace AccountRetrieveResponse {
|
|
|
137
166
|
balance: string;
|
|
138
167
|
|
|
139
168
|
/**
|
|
140
|
-
* Total purchased
|
|
169
|
+
* Total purchased credits as a bigint string.
|
|
141
170
|
*/
|
|
142
171
|
lifetimePurchased: string;
|
|
143
172
|
|
|
144
173
|
/**
|
|
145
|
-
* Total consumed
|
|
174
|
+
* Total consumed credits as a bigint string.
|
|
146
175
|
*/
|
|
147
176
|
lifetimeUsed: string;
|
|
148
177
|
}
|
package/src/resources/compose.ts
CHANGED
|
@@ -13,10 +13,8 @@ import { RequestOptions } from '../internal/request-options';
|
|
|
13
13
|
*/
|
|
14
14
|
export class Compose extends APIResource {
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* goal-specific guidance. Score applies deterministic text checks. It does not
|
|
19
|
-
* predict reach or expose X ranking weights.
|
|
16
|
+
* Uses xai-org/x-algorithm facts to compose and refine text. Score checks text. It
|
|
17
|
+
* never predicts reach or engagement.
|
|
20
18
|
*
|
|
21
19
|
* @example
|
|
22
20
|
* ```ts
|
|
@@ -24,6 +22,7 @@ export class Compose extends APIResource {
|
|
|
24
22
|
* step: 'compose',
|
|
25
23
|
* topic: 'PostgreSQL query planning',
|
|
26
24
|
* goal: 'engagement',
|
|
25
|
+
* styleUsername: 'example_user',
|
|
27
26
|
* });
|
|
28
27
|
* ```
|
|
29
28
|
*/
|
|
@@ -32,20 +31,26 @@ export class Compose extends APIResource {
|
|
|
32
31
|
}
|
|
33
32
|
}
|
|
34
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Rules, questions, and research guidance for drafting a post.
|
|
36
|
+
*/
|
|
35
37
|
export type ComposeCreateResponse =
|
|
36
38
|
| ComposeCreateResponse.ComposePrepareResult
|
|
37
39
|
| ComposeCreateResponse.ComposeRefineResult
|
|
38
40
|
| ComposeCreateResponse.ComposeScoreResult;
|
|
39
41
|
|
|
40
42
|
export namespace ComposeCreateResponse {
|
|
43
|
+
/**
|
|
44
|
+
* Rules, questions, and research guidance for drafting a post.
|
|
45
|
+
*/
|
|
41
46
|
export interface ComposePrepareResult {
|
|
42
47
|
/**
|
|
43
|
-
*
|
|
48
|
+
* Facts derived only from xai-org/x-algorithm.
|
|
44
49
|
*/
|
|
45
50
|
contentRules: Array<ComposePrepareResult.ContentRule>;
|
|
46
51
|
|
|
47
52
|
/**
|
|
48
|
-
*
|
|
53
|
+
* Source ranking signals. Repository defaults may vary in production.
|
|
49
54
|
*/
|
|
50
55
|
engagementMultipliers: Array<ComposePrepareResult.EngagementMultiplier>;
|
|
51
56
|
|
|
@@ -64,12 +69,14 @@ export namespace ComposeCreateResponse {
|
|
|
64
69
|
nextStep: string;
|
|
65
70
|
|
|
66
71
|
/**
|
|
67
|
-
*
|
|
72
|
+
* Deprecated compatibility field. Always empty.
|
|
73
|
+
*
|
|
74
|
+
* @deprecated
|
|
68
75
|
*/
|
|
69
76
|
radarRecommendations: Array<ComposePrepareResult.RadarRecommendation>;
|
|
70
77
|
|
|
71
78
|
/**
|
|
72
|
-
*
|
|
79
|
+
* Source signals with production values withheld as null.
|
|
73
80
|
*/
|
|
74
81
|
scorerWeights: Array<ComposePrepareResult.ScorerWeight>;
|
|
75
82
|
|
|
@@ -100,19 +107,30 @@ export namespace ComposeCreateResponse {
|
|
|
100
107
|
}
|
|
101
108
|
|
|
102
109
|
export namespace ComposePrepareResult {
|
|
110
|
+
/**
|
|
111
|
+
* One source-backed ranking fact returned during preparation.
|
|
112
|
+
*/
|
|
103
113
|
export interface ContentRule {
|
|
104
114
|
rule: string;
|
|
105
115
|
}
|
|
106
116
|
|
|
117
|
+
/**
|
|
118
|
+
* One ranking signal and its source-value limit.
|
|
119
|
+
*/
|
|
107
120
|
export interface EngagementMultiplier {
|
|
108
121
|
/**
|
|
109
122
|
* Human-readable published signal name.
|
|
110
123
|
*/
|
|
111
124
|
action: string;
|
|
112
125
|
|
|
113
|
-
multiplier: '
|
|
126
|
+
multiplier: 'Source default; production value can vary';
|
|
114
127
|
}
|
|
115
128
|
|
|
129
|
+
/**
|
|
130
|
+
* Deprecated compatibility schema. The response array is empty.
|
|
131
|
+
*
|
|
132
|
+
* @deprecated
|
|
133
|
+
*/
|
|
116
134
|
export interface RadarRecommendation {
|
|
117
135
|
/**
|
|
118
136
|
* Radar endpoint for this source.
|
|
@@ -132,9 +150,12 @@ export namespace ComposeCreateResponse {
|
|
|
132
150
|
useFor: string;
|
|
133
151
|
}
|
|
134
152
|
|
|
153
|
+
/**
|
|
154
|
+
* One source ranking signal without a production claim.
|
|
155
|
+
*/
|
|
135
156
|
export interface ScorerWeight {
|
|
136
157
|
/**
|
|
137
|
-
* Signal direction and
|
|
158
|
+
* Signal direction and production limit.
|
|
138
159
|
*/
|
|
139
160
|
context: string;
|
|
140
161
|
|
|
@@ -144,28 +165,40 @@ export namespace ComposeCreateResponse {
|
|
|
144
165
|
signal: string;
|
|
145
166
|
|
|
146
167
|
/**
|
|
147
|
-
*
|
|
168
|
+
* Null prevents source defaults becoming production claims.
|
|
148
169
|
*/
|
|
149
170
|
weight: null;
|
|
150
171
|
}
|
|
151
172
|
|
|
173
|
+
/**
|
|
174
|
+
* A saved username style and analyzed post count.
|
|
175
|
+
*/
|
|
152
176
|
export interface SavedStyle {
|
|
177
|
+
/**
|
|
178
|
+
* Whole number from 0.
|
|
179
|
+
*/
|
|
153
180
|
tweetCount: number;
|
|
154
181
|
|
|
155
182
|
username: string;
|
|
156
183
|
}
|
|
157
184
|
}
|
|
158
185
|
|
|
186
|
+
/**
|
|
187
|
+
* Source-backed guidance for refining a post.
|
|
188
|
+
*/
|
|
159
189
|
export interface ComposeRefineResult {
|
|
160
190
|
/**
|
|
161
|
-
*
|
|
191
|
+
* Request context and xai-org/x-algorithm guidance.
|
|
162
192
|
*/
|
|
163
193
|
compositionGuidance: Array<string>;
|
|
164
194
|
|
|
195
|
+
/**
|
|
196
|
+
* @deprecated
|
|
197
|
+
*/
|
|
165
198
|
examplePatterns: Array<ComposeRefineResult.ExamplePattern>;
|
|
166
199
|
|
|
167
200
|
/**
|
|
168
|
-
* X post intent
|
|
201
|
+
* X post intent generated for the refined topic.
|
|
169
202
|
*/
|
|
170
203
|
intentUrl: string;
|
|
171
204
|
|
|
@@ -173,6 +206,11 @@ export namespace ComposeCreateResponse {
|
|
|
173
206
|
}
|
|
174
207
|
|
|
175
208
|
export namespace ComposeRefineResult {
|
|
209
|
+
/**
|
|
210
|
+
* Deprecated example-pattern schema. The response array is empty.
|
|
211
|
+
*
|
|
212
|
+
* @deprecated
|
|
213
|
+
*/
|
|
176
214
|
export interface ExamplePattern {
|
|
177
215
|
description: string;
|
|
178
216
|
|
|
@@ -180,9 +218,12 @@ export namespace ComposeCreateResponse {
|
|
|
180
218
|
}
|
|
181
219
|
}
|
|
182
220
|
|
|
221
|
+
/**
|
|
222
|
+
* Posting validation without a fabricated ranking score.
|
|
223
|
+
*/
|
|
183
224
|
export interface ComposeScoreResult {
|
|
184
225
|
/**
|
|
185
|
-
* Deterministic
|
|
226
|
+
* Deterministic input validation. Not a reach prediction.
|
|
186
227
|
*/
|
|
187
228
|
checklist: Array<ComposeScoreResult.Checklist>;
|
|
188
229
|
|
|
@@ -194,7 +235,7 @@ export namespace ComposeCreateResponse {
|
|
|
194
235
|
|
|
195
236
|
topSuggestion: string;
|
|
196
237
|
|
|
197
|
-
totalChecks:
|
|
238
|
+
totalChecks: 1;
|
|
198
239
|
|
|
199
240
|
/**
|
|
200
241
|
* Present only when every check passes.
|
|
@@ -203,6 +244,9 @@ export namespace ComposeCreateResponse {
|
|
|
203
244
|
}
|
|
204
245
|
|
|
205
246
|
export namespace ComposeScoreResult {
|
|
247
|
+
/**
|
|
248
|
+
* One deterministic draft check.
|
|
249
|
+
*/
|
|
206
250
|
export interface Checklist {
|
|
207
251
|
factor: string;
|
|
208
252
|
|
|
@@ -216,12 +260,18 @@ export namespace ComposeCreateResponse {
|
|
|
216
260
|
}
|
|
217
261
|
}
|
|
218
262
|
|
|
263
|
+
/**
|
|
264
|
+
* Inputs for preparing source-backed post guidance.
|
|
265
|
+
*/
|
|
219
266
|
export type ComposeCreateParams =
|
|
220
267
|
| ComposeCreateParams.ComposePrepareRequest
|
|
221
268
|
| ComposeCreateParams.ComposeRefineRequest
|
|
222
269
|
| ComposeCreateParams.ComposeScoreRequest;
|
|
223
270
|
|
|
224
271
|
export declare namespace ComposeCreateParams {
|
|
272
|
+
/**
|
|
273
|
+
* Inputs for preparing source-backed post guidance.
|
|
274
|
+
*/
|
|
225
275
|
export interface ComposePrepareRequest {
|
|
226
276
|
step: 'compose';
|
|
227
277
|
|
|
@@ -231,7 +281,7 @@ export declare namespace ComposeCreateParams {
|
|
|
231
281
|
topic: string;
|
|
232
282
|
|
|
233
283
|
/**
|
|
234
|
-
*
|
|
284
|
+
* User goal used for one follow-up question.
|
|
235
285
|
*/
|
|
236
286
|
goal?: 'engagement' | 'followers' | 'authority' | 'conversation';
|
|
237
287
|
|
|
@@ -243,9 +293,12 @@ export declare namespace ComposeCreateParams {
|
|
|
243
293
|
[k: string]: unknown;
|
|
244
294
|
}
|
|
245
295
|
|
|
296
|
+
/**
|
|
297
|
+
* Inputs for refining a post plan.
|
|
298
|
+
*/
|
|
246
299
|
export interface ComposeRefineRequest {
|
|
247
300
|
/**
|
|
248
|
-
*
|
|
301
|
+
* User goal interpreted against published ranking signals.
|
|
249
302
|
*/
|
|
250
303
|
goal: 'engagement' | 'followers' | 'authority' | 'conversation';
|
|
251
304
|
|
|
@@ -257,7 +310,7 @@ export declare namespace ComposeCreateParams {
|
|
|
257
310
|
tone: string;
|
|
258
311
|
|
|
259
312
|
/**
|
|
260
|
-
* Subject
|
|
313
|
+
* Subject to refine into a post.
|
|
261
314
|
*/
|
|
262
315
|
topic: string;
|
|
263
316
|
|
|
@@ -279,21 +332,24 @@ export declare namespace ComposeCreateParams {
|
|
|
279
332
|
[k: string]: unknown;
|
|
280
333
|
}
|
|
281
334
|
|
|
335
|
+
/**
|
|
336
|
+
* Inputs for checking a post draft.
|
|
337
|
+
*/
|
|
282
338
|
export interface ComposeScoreRequest {
|
|
283
339
|
/**
|
|
284
|
-
* Full post text
|
|
340
|
+
* Full post text. The endpoint never assigns a ranking score.
|
|
285
341
|
*/
|
|
286
342
|
draft: string;
|
|
287
343
|
|
|
288
344
|
step: 'score';
|
|
289
345
|
|
|
290
346
|
/**
|
|
291
|
-
*
|
|
347
|
+
* @deprecated Ignored. Remove this field.
|
|
292
348
|
*/
|
|
293
349
|
hasLink?: boolean;
|
|
294
350
|
|
|
295
351
|
/**
|
|
296
|
-
* @deprecated Ignored. Remove this field.
|
|
352
|
+
* @deprecated Ignored. Remove this field.
|
|
297
353
|
*/
|
|
298
354
|
hasMedia?: boolean;
|
|
299
355
|
|
package/src/resources/credits.ts
CHANGED
|
@@ -10,11 +10,11 @@ import { buildHeaders } from '../internal/headers';
|
|
|
10
10
|
import { RequestOptions } from '../internal/request-options';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* Subscription, billing, and
|
|
13
|
+
* Subscription, billing, and credits
|
|
14
14
|
*/
|
|
15
15
|
export class Credits extends APIResource {
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Redirects to the active hosted top-up checkout.
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
20
|
* ```ts
|
|
@@ -36,7 +36,7 @@ export class Credits extends APIResource {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* Returns the account credit balance and usage context.
|
|
40
40
|
*
|
|
41
41
|
* @example
|
|
42
42
|
* ```ts
|
|
@@ -48,7 +48,7 @@ export class Credits extends APIResource {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
|
-
*
|
|
51
|
+
* Returns verification status for a credit top-up.
|
|
52
52
|
*
|
|
53
53
|
* @example
|
|
54
54
|
* ```ts
|
|
@@ -72,6 +72,7 @@ export class Credits extends APIResource {
|
|
|
72
72
|
* ```ts
|
|
73
73
|
* const response = await client.credits.topupBalance({
|
|
74
74
|
* dollars: 10,
|
|
75
|
+
* locale: 'en',
|
|
75
76
|
* });
|
|
76
77
|
* ```
|
|
77
78
|
*/
|
|
@@ -92,24 +93,31 @@ export interface CreditRetrieveBalanceResponse {
|
|
|
92
93
|
auto_topup_enabled: boolean;
|
|
93
94
|
|
|
94
95
|
/**
|
|
95
|
-
*
|
|
96
|
+
* Whether declined charges stopped automatic top-up while it is enabled. It stops
|
|
97
|
+
* after 3 declines in a row on one card. A paid top-up, a paid plan renewal, or
|
|
98
|
+
* the next automatic top-up on a new card clears it.
|
|
99
|
+
*/
|
|
100
|
+
auto_topup_stopped: boolean;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Credit balance threshold that triggers automatic top-up when enabled,
|
|
96
104
|
* represented as a bigint string.
|
|
97
105
|
*/
|
|
98
106
|
auto_topup_threshold: string;
|
|
99
107
|
|
|
100
108
|
/**
|
|
101
|
-
* Current
|
|
109
|
+
* Current credit balance as a bigint string to preserve precision above
|
|
102
110
|
* Number.MAX_SAFE_INTEGER.
|
|
103
111
|
*/
|
|
104
112
|
balance: string;
|
|
105
113
|
|
|
106
114
|
/**
|
|
107
|
-
* Lifetime purchased
|
|
115
|
+
* Lifetime purchased credits as a bigint string.
|
|
108
116
|
*/
|
|
109
117
|
lifetime_purchased: string;
|
|
110
118
|
|
|
111
119
|
/**
|
|
112
|
-
* Lifetime consumed
|
|
120
|
+
* Lifetime consumed credits as a bigint string.
|
|
113
121
|
*/
|
|
114
122
|
lifetime_used: string;
|
|
115
123
|
}
|
|
@@ -123,7 +131,7 @@ export interface CreditRetrieveTopupStatusResponse {
|
|
|
123
131
|
amount_dollars?: number | null;
|
|
124
132
|
|
|
125
133
|
/**
|
|
126
|
-
* Bigint string
|
|
134
|
+
* Bigint string credit amount granted or pending.
|
|
127
135
|
*/
|
|
128
136
|
credits?: string;
|
|
129
137
|
}
|
|
@@ -162,7 +170,8 @@ export interface CreditTopupBalanceParams {
|
|
|
162
170
|
dollars: number;
|
|
163
171
|
|
|
164
172
|
/**
|
|
165
|
-
* Optional
|
|
173
|
+
* Optional site language for Stripe's return page. An unsupported 1 uses en, the
|
|
174
|
+
* default.
|
|
166
175
|
*/
|
|
167
176
|
locale?: string;
|
|
168
177
|
}
|