x-twitter-scraper 0.3.2 → 0.4.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 +35 -0
- package/README.md +25 -5
- package/api-promise.d.mts +1 -0
- package/api-promise.d.mts.map +1 -1
- package/api-promise.d.ts +1 -0
- package/api-promise.d.ts.map +1 -1
- package/api-promise.mjs +1 -0
- package/api-promise.mjs.map +1 -1
- package/client.d.mts +23 -17
- package/client.d.mts.map +1 -1
- package/client.d.ts +23 -17
- package/client.d.ts.map +1 -1
- package/client.js +42 -17
- package/client.js.map +1 -1
- package/client.mjs +42 -17
- package/client.mjs.map +1 -1
- package/core/api-promise.d.mts.map +1 -1
- package/core/api-promise.d.ts.map +1 -1
- package/core/api-promise.mjs.map +1 -1
- package/core/error.mjs.map +1 -1
- package/core/resource.d.mts.map +1 -1
- package/core/resource.d.ts.map +1 -1
- package/core/uploads.d.mts.map +1 -1
- package/core/uploads.d.ts.map +1 -1
- package/core/uploads.mjs.map +1 -1
- package/error.d.mts +1 -0
- package/error.d.mts.map +1 -1
- package/error.d.ts +1 -0
- package/error.d.ts.map +1 -1
- package/error.mjs +1 -0
- package/error.mjs.map +1 -1
- package/index.d.mts.map +1 -1
- package/index.d.ts.map +1 -1
- package/index.mjs.map +1 -1
- package/internal/detect-platform.mjs.map +1 -1
- package/internal/headers.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.mjs.map +1 -1
- package/internal/request-options.d.mts +4 -0
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts +4 -0
- package/internal/request-options.d.ts.map +1 -1
- package/internal/request-options.js.map +1 -1
- package/internal/request-options.mjs.map +1 -1
- package/internal/shims.d.mts +6 -0
- package/internal/shims.d.mts.map +1 -1
- package/internal/shims.d.ts +6 -0
- package/internal/shims.d.ts.map +1 -1
- package/internal/to-file.d.mts.map +1 -1
- package/internal/to-file.d.ts.map +1 -1
- package/internal/to-file.mjs.map +1 -1
- package/internal/types.d.mts +4 -4
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +4 -4
- package/internal/types.d.ts.map +1 -1
- package/internal/uploads.d.mts.map +1 -1
- package/internal/uploads.d.ts.map +1 -1
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/base64.mjs.map +1 -1
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js +3 -2
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +3 -2
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/path.mjs.map +1 -1
- package/internal/utils/query.mjs.map +1 -1
- package/internal/utils/values.mjs.map +1 -1
- package/internal/utils.d.mts.map +1 -1
- package/internal/utils.d.ts.map +1 -1
- package/internal/utils.mjs.map +1 -1
- package/package.json +29 -16
- package/resource.d.mts +1 -0
- package/resource.d.mts.map +1 -1
- package/resource.d.ts +1 -0
- package/resource.d.ts.map +1 -1
- package/resource.mjs +1 -0
- package/resource.mjs.map +1 -1
- package/resources/account.d.mts +59 -3
- package/resources/account.d.mts.map +1 -1
- package/resources/account.d.ts +59 -3
- package/resources/account.d.ts.map +1 -1
- package/resources/account.mjs.map +1 -1
- package/resources/compose.d.mts.map +1 -1
- package/resources/compose.d.ts.map +1 -1
- package/resources/compose.mjs.map +1 -1
- package/resources/credits.d.mts +88 -11
- package/resources/credits.d.mts.map +1 -1
- package/resources/credits.d.ts +88 -11
- package/resources/credits.d.ts.map +1 -1
- package/resources/credits.js +37 -4
- package/resources/credits.js.map +1 -1
- package/resources/credits.mjs +37 -4
- package/resources/credits.mjs.map +1 -1
- package/resources/drafts.d.mts +4 -1
- package/resources/drafts.d.mts.map +1 -1
- package/resources/drafts.d.ts +4 -1
- package/resources/drafts.d.ts.map +1 -1
- package/resources/drafts.mjs.map +1 -1
- package/resources/draws.d.mts +33 -8
- package/resources/draws.d.mts.map +1 -1
- package/resources/draws.d.ts +33 -8
- package/resources/draws.d.ts.map +1 -1
- package/resources/draws.js +12 -4
- package/resources/draws.js.map +1 -1
- package/resources/draws.mjs +12 -4
- package/resources/draws.mjs.map +1 -1
- package/resources/events.d.mts +46 -7
- package/resources/events.d.mts.map +1 -1
- package/resources/events.d.ts +46 -7
- package/resources/events.d.ts.map +1 -1
- package/resources/events.mjs.map +1 -1
- package/resources/extractions.d.mts +287 -17
- package/resources/extractions.d.mts.map +1 -1
- package/resources/extractions.d.ts +287 -17
- package/resources/extractions.d.ts.map +1 -1
- package/resources/extractions.js +3 -2
- package/resources/extractions.js.map +1 -1
- package/resources/extractions.mjs +3 -2
- package/resources/extractions.mjs.map +1 -1
- package/resources/guest-wallets.d.mts +245 -0
- package/resources/guest-wallets.d.mts.map +1 -0
- package/resources/guest-wallets.d.ts +245 -0
- package/resources/guest-wallets.d.ts.map +1 -0
- package/resources/guest-wallets.js +79 -0
- package/resources/guest-wallets.js.map +1 -0
- package/resources/guest-wallets.mjs +75 -0
- package/resources/guest-wallets.mjs.map +1 -0
- package/resources/index.d.mts +5 -5
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +5 -5
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +4 -4
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -2
- package/resources/index.mjs.map +1 -1
- package/resources/monitors/index.d.mts +3 -0
- package/resources/monitors/index.d.mts.map +1 -0
- package/resources/monitors/index.d.ts +3 -0
- package/resources/monitors/index.d.ts.map +1 -0
- package/resources/monitors/index.js +9 -0
- package/resources/monitors/index.js.map +1 -0
- package/resources/monitors/index.mjs +4 -0
- package/resources/monitors/index.mjs.map +1 -0
- package/resources/monitors/keywords.d.mts +164 -0
- package/resources/monitors/keywords.d.mts.map +1 -0
- package/resources/monitors/keywords.d.ts +164 -0
- package/resources/monitors/keywords.d.ts.map +1 -0
- package/resources/monitors/keywords.js +80 -0
- package/resources/monitors/keywords.js.map +1 -0
- package/resources/monitors/keywords.mjs +76 -0
- package/resources/monitors/keywords.mjs.map +1 -0
- package/resources/monitors/monitors.d.mts +127 -0
- package/resources/monitors/monitors.d.mts.map +1 -0
- package/resources/monitors/monitors.d.ts +127 -0
- package/resources/monitors/monitors.d.ts.map +1 -0
- package/resources/monitors/monitors.js +84 -0
- package/resources/monitors/monitors.js.map +1 -0
- package/resources/monitors/monitors.mjs +79 -0
- package/resources/monitors/monitors.mjs.map +1 -0
- package/resources/monitors.d.mts +1 -111
- package/resources/monitors.d.mts.map +1 -1
- package/resources/monitors.d.ts +1 -111
- package/resources/monitors.d.ts.map +1 -1
- package/resources/monitors.js +2 -70
- package/resources/monitors.js.map +1 -1
- package/resources/monitors.mjs +1 -68
- package/resources/monitors.mjs.map +1 -1
- package/resources/radar.d.mts +3 -3
- package/resources/radar.d.mts.map +1 -1
- package/resources/radar.d.ts +3 -3
- package/resources/radar.d.ts.map +1 -1
- package/resources/radar.mjs.map +1 -1
- package/resources/shared.d.mts +251 -19
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +251 -19
- package/resources/shared.d.ts.map +1 -1
- package/resources/styles.d.mts.map +1 -1
- package/resources/styles.d.ts.map +1 -1
- package/resources/styles.mjs.map +1 -1
- package/resources/subscribe.d.mts +20 -6
- package/resources/subscribe.d.mts.map +1 -1
- package/resources/subscribe.d.ts +20 -6
- package/resources/subscribe.d.ts.map +1 -1
- package/resources/subscribe.js +12 -4
- package/resources/subscribe.js.map +1 -1
- package/resources/subscribe.mjs +12 -4
- package/resources/subscribe.mjs.map +1 -1
- package/resources/support/index.d.mts.map +1 -1
- package/resources/support/index.d.ts.map +1 -1
- package/resources/support/index.mjs.map +1 -1
- package/resources/support/support.d.mts.map +1 -1
- package/resources/support/support.d.ts.map +1 -1
- package/resources/support/support.mjs.map +1 -1
- package/resources/support/tickets.d.mts +9 -7
- package/resources/support/tickets.d.mts.map +1 -1
- package/resources/support/tickets.d.ts +9 -7
- package/resources/support/tickets.d.ts.map +1 -1
- package/resources/support/tickets.js +9 -7
- package/resources/support/tickets.js.map +1 -1
- package/resources/support/tickets.mjs +9 -7
- package/resources/support/tickets.mjs.map +1 -1
- package/resources/support.d.mts.map +1 -1
- package/resources/support.d.ts.map +1 -1
- package/resources/support.mjs.map +1 -1
- package/resources/trends.d.mts +2 -2
- package/resources/trends.d.mts.map +1 -1
- package/resources/trends.d.ts +2 -2
- package/resources/trends.d.ts.map +1 -1
- package/resources/trends.mjs.map +1 -1
- package/resources/webhooks.d.mts +34 -1
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +34 -1
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js +11 -0
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +11 -0
- package/resources/webhooks.mjs.map +1 -1
- package/resources/x/account-connection-challenges.d.mts +41 -0
- package/resources/x/account-connection-challenges.d.mts.map +1 -0
- package/resources/x/account-connection-challenges.d.ts +41 -0
- package/resources/x/account-connection-challenges.d.ts.map +1 -0
- package/resources/x/account-connection-challenges.js +27 -0
- package/resources/x/account-connection-challenges.js.map +1 -0
- package/resources/x/account-connection-challenges.mjs +23 -0
- package/resources/x/account-connection-challenges.mjs.map +1 -0
- package/resources/x/accounts.d.mts +13 -41
- package/resources/x/accounts.d.mts.map +1 -1
- package/resources/x/accounts.d.ts +13 -41
- package/resources/x/accounts.d.ts.map +1 -1
- package/resources/x/accounts.js +3 -3
- package/resources/x/accounts.mjs +3 -3
- package/resources/x/accounts.mjs.map +1 -1
- package/resources/x/bookmarks.d.mts +6 -0
- package/resources/x/bookmarks.d.mts.map +1 -1
- package/resources/x/bookmarks.d.ts +6 -0
- package/resources/x/bookmarks.d.ts.map +1 -1
- package/resources/x/bookmarks.mjs.map +1 -1
- package/resources/x/communities/communities.d.mts +50 -14
- package/resources/x/communities/communities.d.mts.map +1 -1
- package/resources/x/communities/communities.d.ts +50 -14
- package/resources/x/communities/communities.d.ts.map +1 -1
- package/resources/x/communities/communities.js +5 -2
- package/resources/x/communities/communities.js.map +1 -1
- package/resources/x/communities/communities.mjs +6 -3
- package/resources/x/communities/communities.mjs.map +1 -1
- package/resources/x/communities/index.d.mts +2 -2
- package/resources/x/communities/index.d.mts.map +1 -1
- package/resources/x/communities/index.d.ts +2 -2
- package/resources/x/communities/index.d.ts.map +1 -1
- package/resources/x/communities/index.js.map +1 -1
- package/resources/x/communities/index.mjs +1 -1
- package/resources/x/communities/index.mjs.map +1 -1
- package/resources/x/communities/join.d.mts +16 -12
- package/resources/x/communities/join.d.mts.map +1 -1
- package/resources/x/communities/join.d.ts +16 -12
- package/resources/x/communities/join.d.ts.map +1 -1
- package/resources/x/communities/join.js +7 -8
- package/resources/x/communities/join.js.map +1 -1
- package/resources/x/communities/join.mjs +7 -8
- package/resources/x/communities/join.mjs.map +1 -1
- package/resources/x/communities/tweets.d.mts +29 -6
- package/resources/x/communities/tweets.d.mts.map +1 -1
- package/resources/x/communities/tweets.d.ts +29 -6
- package/resources/x/communities/tweets.d.ts.map +1 -1
- package/resources/x/communities/tweets.js +5 -2
- package/resources/x/communities/tweets.js.map +1 -1
- package/resources/x/communities/tweets.mjs +5 -2
- package/resources/x/communities/tweets.mjs.map +1 -1
- package/resources/x/communities.d.mts.map +1 -1
- package/resources/x/communities.d.ts.map +1 -1
- package/resources/x/communities.mjs.map +1 -1
- package/resources/x/dm.d.mts +17 -5
- package/resources/x/dm.d.mts.map +1 -1
- package/resources/x/dm.d.ts +17 -5
- package/resources/x/dm.d.ts.map +1 -1
- package/resources/x/dm.js +2 -2
- package/resources/x/dm.js.map +1 -1
- package/resources/x/dm.mjs +2 -2
- package/resources/x/dm.mjs.map +1 -1
- package/resources/x/followers.d.mts +2 -2
- package/resources/x/followers.d.mts.map +1 -1
- package/resources/x/followers.d.ts +2 -2
- package/resources/x/followers.d.ts.map +1 -1
- package/resources/x/followers.mjs.map +1 -1
- package/resources/x/index.d.mts +4 -2
- package/resources/x/index.d.mts.map +1 -1
- package/resources/x/index.d.ts +4 -2
- package/resources/x/index.d.ts.map +1 -1
- package/resources/x/index.js +5 -1
- package/resources/x/index.js.map +1 -1
- package/resources/x/index.mjs +2 -0
- package/resources/x/index.mjs.map +1 -1
- package/resources/x/lists.d.mts +19 -0
- package/resources/x/lists.d.mts.map +1 -1
- package/resources/x/lists.d.ts +19 -0
- package/resources/x/lists.d.ts.map +1 -1
- package/resources/x/lists.mjs.map +1 -1
- package/resources/x/media.d.mts +17 -8
- package/resources/x/media.d.mts.map +1 -1
- package/resources/x/media.d.ts +17 -8
- package/resources/x/media.d.ts.map +1 -1
- package/resources/x/media.js +2 -3
- package/resources/x/media.js.map +1 -1
- package/resources/x/media.mjs +3 -4
- package/resources/x/media.mjs.map +1 -1
- package/resources/x/profile.d.mts +8 -9
- package/resources/x/profile.d.mts.map +1 -1
- package/resources/x/profile.d.ts +8 -9
- package/resources/x/profile.d.ts.map +1 -1
- package/resources/x/profile.js +4 -4
- package/resources/x/profile.js.map +1 -1
- package/resources/x/profile.mjs +5 -5
- package/resources/x/profile.mjs.map +1 -1
- package/resources/x/tweets/index.d.mts.map +1 -1
- package/resources/x/tweets/index.d.ts.map +1 -1
- package/resources/x/tweets/index.mjs.map +1 -1
- package/resources/x/tweets/like.d.mts.map +1 -1
- package/resources/x/tweets/like.d.ts.map +1 -1
- package/resources/x/tweets/like.mjs.map +1 -1
- package/resources/x/tweets/retweet.d.mts.map +1 -1
- package/resources/x/tweets/retweet.d.ts.map +1 -1
- package/resources/x/tweets/retweet.mjs.map +1 -1
- package/resources/x/tweets/tweets.d.mts +442 -29
- package/resources/x/tweets/tweets.d.mts.map +1 -1
- package/resources/x/tweets/tweets.d.ts +442 -29
- package/resources/x/tweets/tweets.d.ts.map +1 -1
- package/resources/x/tweets/tweets.js +1 -1
- package/resources/x/tweets/tweets.js.map +1 -1
- package/resources/x/tweets/tweets.mjs +1 -1
- package/resources/x/tweets/tweets.mjs.map +1 -1
- package/resources/x/tweets.d.mts.map +1 -1
- package/resources/x/tweets.d.ts.map +1 -1
- package/resources/x/tweets.mjs.map +1 -1
- package/resources/x/users/follow.d.mts.map +1 -1
- package/resources/x/users/follow.d.ts.map +1 -1
- package/resources/x/users/follow.mjs.map +1 -1
- 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 +666 -9
- package/resources/x/users/users.d.mts.map +1 -1
- package/resources/x/users/users.d.ts +666 -9
- package/resources/x/users/users.d.ts.map +1 -1
- package/resources/x/users/users.js +26 -4
- package/resources/x/users/users.js.map +1 -1
- package/resources/x/users/users.mjs +26 -4
- package/resources/x/users/users.mjs.map +1 -1
- package/resources/x/users.d.mts.map +1 -1
- package/resources/x/users.d.ts.map +1 -1
- package/resources/x/users.mjs.map +1 -1
- package/resources/x/write-actions.d.mts +51 -0
- package/resources/x/write-actions.d.mts.map +1 -0
- package/resources/x/write-actions.d.ts +51 -0
- package/resources/x/write-actions.d.ts.map +1 -0
- package/resources/x/write-actions.js +26 -0
- package/resources/x/write-actions.js.map +1 -0
- package/resources/x/write-actions.mjs +22 -0
- package/resources/x/write-actions.mjs.map +1 -0
- package/resources/x/x.d.mts +65 -12
- package/resources/x/x.d.mts.map +1 -1
- package/resources/x/x.d.ts +65 -12
- package/resources/x/x.d.ts.map +1 -1
- package/resources/x/x.js +10 -1
- package/resources/x/x.js.map +1 -1
- package/resources/x/x.mjs +10 -1
- package/resources/x/x.mjs.map +1 -1
- package/resources/x.d.mts.map +1 -1
- package/resources/x.d.ts.map +1 -1
- package/resources/x.mjs.map +1 -1
- package/resources.d.mts.map +1 -1
- package/resources.d.ts.map +1 -1
- package/resources.mjs.map +1 -1
- package/src/client.ts +86 -40
- package/src/internal/request-options.ts +2 -0
- package/src/internal/utils/log.ts +2 -1
- package/src/resources/account.ts +72 -5
- package/src/resources/credits.ts +117 -10
- package/src/resources/drafts.ts +4 -1
- package/src/resources/draws.ts +33 -12
- package/src/resources/events.ts +52 -7
- package/src/resources/extractions.ts +364 -12
- package/src/resources/guest-wallets.ts +337 -0
- package/src/resources/index.ts +15 -10
- package/src/resources/monitors/index.ts +21 -0
- package/src/resources/monitors/keywords.ts +221 -0
- package/src/resources/monitors/monitors.ts +195 -0
- package/src/resources/monitors.ts +1 -153
- package/src/resources/radar.ts +3 -3
- package/src/resources/shared.ts +463 -21
- package/src/resources/subscribe.ts +29 -8
- package/src/resources/support/tickets.ts +9 -7
- package/src/resources/trends.ts +2 -2
- package/src/resources/webhooks.ts +43 -0
- package/src/resources/x/account-connection-challenges.ts +61 -0
- package/src/resources/x/accounts.ts +15 -46
- package/src/resources/x/bookmarks.ts +6 -0
- package/src/resources/x/communities/communities.ts +68 -16
- package/src/resources/x/communities/index.ts +7 -2
- package/src/resources/x/communities/join.ts +23 -16
- package/src/resources/x/communities/tweets.ts +32 -6
- package/src/resources/x/dm.ts +20 -7
- package/src/resources/x/followers.ts +2 -2
- package/src/resources/x/index.ts +10 -1
- package/src/resources/x/lists.ts +22 -0
- package/src/resources/x/media.ts +25 -11
- package/src/resources/x/profile.ts +11 -12
- package/src/resources/x/tweets/tweets.ts +540 -32
- package/src/resources/x/users/index.ts +4 -0
- package/src/resources/x/users/users.ts +834 -8
- package/src/resources/x/write-actions.ts +79 -0
- package/src/resources/x/x.ts +107 -10
- package/src/version.ts +1 -1
- package/uploads.d.mts +1 -0
- package/uploads.d.mts.map +1 -1
- package/uploads.d.ts +1 -0
- package/uploads.d.ts.map +1 -1
- package/uploads.mjs +1 -0
- package/uploads.mjs.map +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/resources/api-keys.d.mts +0 -68
- package/resources/api-keys.d.mts.map +0 -1
- package/resources/api-keys.d.ts +0 -68
- package/resources/api-keys.d.ts.map +0 -1
- package/resources/api-keys.js +0 -48
- package/resources/api-keys.js.map +0 -1
- package/resources/api-keys.mjs +0 -44
- package/resources/api-keys.mjs.map +0 -1
- package/resources/bot/bot.d.mts +0 -10
- package/resources/bot/bot.d.mts.map +0 -1
- package/resources/bot/bot.d.ts +0 -10
- package/resources/bot/bot.d.ts.map +0 -1
- package/resources/bot/bot.js +0 -17
- package/resources/bot/bot.js.map +0 -1
- package/resources/bot/bot.mjs +0 -12
- package/resources/bot/bot.mjs.map +0 -1
- package/resources/bot/index.d.mts +0 -3
- package/resources/bot/index.d.mts.map +0 -1
- package/resources/bot/index.d.ts +0 -3
- package/resources/bot/index.d.ts.map +0 -1
- package/resources/bot/index.js +0 -9
- package/resources/bot/index.js.map +0 -1
- package/resources/bot/index.mjs +0 -4
- package/resources/bot/index.mjs.map +0 -1
- package/resources/bot/platform-links.d.mts +0 -4
- package/resources/bot/platform-links.d.mts.map +0 -1
- package/resources/bot/platform-links.d.ts +0 -4
- package/resources/bot/platform-links.d.ts.map +0 -1
- package/resources/bot/platform-links.js +0 -9
- package/resources/bot/platform-links.js.map +0 -1
- package/resources/bot/platform-links.mjs +0 -5
- package/resources/bot/platform-links.mjs.map +0 -1
- package/resources/bot.d.mts +0 -2
- package/resources/bot.d.mts.map +0 -1
- package/resources/bot.d.ts +0 -2
- package/resources/bot.d.ts.map +0 -1
- package/resources/bot.js +0 -6
- package/resources/bot.js.map +0 -1
- package/resources/bot.mjs +0 -3
- package/resources/bot.mjs.map +0 -1
- package/src/resources/api-keys.ts +0 -100
- package/src/resources/bot/bot.ts +0 -15
- package/src/resources/bot/index.ts +0 -4
- package/src/resources/bot/platform-links.ts +0 -5
- package/src/resources/bot.ts +0 -3
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import * as GuestWalletsAPI from "./guest-wallets.mjs";
|
|
3
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
|
4
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* Accountless prepaid access for paid read endpoints
|
|
7
|
+
*/
|
|
8
|
+
export declare class GuestWallets extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Create a one-use Stripe-hosted checkout after the user explicitly confirms a
|
|
11
|
+
* $10-$250 USD amount. This request creates no charge by itself. The user opens
|
|
12
|
+
* checkout_url on Stripe. This endpoint returns the paid-read API key without
|
|
13
|
+
* requiring an Xquik account, email, dashboard, or Xquik web page. An idempotent
|
|
14
|
+
* replay returns the same key.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const guestWallet = await client.guestWallets.create({
|
|
19
|
+
* amount_minor: 1000,
|
|
20
|
+
* currency: 'usd',
|
|
21
|
+
* 'Idempotency-Key': 'e1cb97D8-dDF3-4AaA-ad0a-49E4A0d1CfAa',
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
create(params: GuestWalletCreateParams, options?: RequestOptions): APIPromise<GuestWalletCreateResponse>;
|
|
26
|
+
/**
|
|
27
|
+
* Poll after Stripe payment. Use usable to decide whether paid reads can run. An
|
|
28
|
+
* active wallet can remain usable while a top-up is pending. A new wallet becomes
|
|
29
|
+
* usable only after verified webhook fulfillment. Send the guest key as
|
|
30
|
+
* Authorization: Bearer.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* const response = await client.guestWallets.retrieveStatus();
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
retrieveStatus(options?: RequestOptions): APIPromise<GuestWalletRetrieveStatusResponse>;
|
|
38
|
+
/**
|
|
39
|
+
* Create a one-use Stripe-hosted checkout for an existing paid-read guest key
|
|
40
|
+
* after the user explicitly confirms a $10-$250 USD amount. The key remains the
|
|
41
|
+
* same. This request creates no charge by itself and never redirects through an
|
|
42
|
+
* Xquik web page.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* const response = await client.guestWallets.topup({
|
|
47
|
+
* amount_minor: 1000,
|
|
48
|
+
* currency: 'usd',
|
|
49
|
+
* 'Idempotency-Key': 'e1cb97D8-dDF3-4AaA-ad0a-49E4A0d1CfAa',
|
|
50
|
+
* });
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
topup(params: GuestWalletTopupParams, options?: RequestOptions): APIPromise<GuestWalletTopupResponse>;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Confirmed USD amount for a guest wallet purchase.
|
|
57
|
+
*/
|
|
58
|
+
export interface GuestWalletAmount {
|
|
59
|
+
/**
|
|
60
|
+
* USD amount in cents. Accepted range is $10-$250.
|
|
61
|
+
*/
|
|
62
|
+
amount_minor: number;
|
|
63
|
+
currency: 'usd';
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Initial guest wallet response containing the one-time key.
|
|
67
|
+
*/
|
|
68
|
+
export interface GuestWalletCreateResponse {
|
|
69
|
+
account_required: false;
|
|
70
|
+
/**
|
|
71
|
+
* Confirmed USD amount for a guest wallet purchase.
|
|
72
|
+
*/
|
|
73
|
+
amount: GuestWalletAmount;
|
|
74
|
+
/**
|
|
75
|
+
* Paid-read bearer credential returned only by initial creation. Store it as a
|
|
76
|
+
* secret. Never place it in a URL or log.
|
|
77
|
+
*/
|
|
78
|
+
api_key: string;
|
|
79
|
+
authorization: GuestWalletCreateResponse.Authorization;
|
|
80
|
+
/**
|
|
81
|
+
* Raw Stripe-hosted checkout URL for user interaction.
|
|
82
|
+
*/
|
|
83
|
+
checkout_url: string;
|
|
84
|
+
credential_notice: 'Store api_key and the Idempotency-Key securely before sharing checkout_url. No email recovery is available.';
|
|
85
|
+
/**
|
|
86
|
+
* Usage granted after verified payment.
|
|
87
|
+
*/
|
|
88
|
+
credits: string;
|
|
89
|
+
/**
|
|
90
|
+
* Time when the pending checkout expires.
|
|
91
|
+
*/
|
|
92
|
+
expires_at: string;
|
|
93
|
+
instructions: 'Give checkout_url to the user. They must complete payment on Stripe. Never submit payment for them. After payment, poll status_url every poll_after_seconds until latest_purchase.status is no longer pending.';
|
|
94
|
+
/**
|
|
95
|
+
* Wait at least this long before polling status_url.
|
|
96
|
+
*/
|
|
97
|
+
poll_after_seconds: 2;
|
|
98
|
+
purchase_id: string;
|
|
99
|
+
requires_user_interaction: true;
|
|
100
|
+
status: 'creating' | 'pending' | 'paid' | 'expired' | 'failed' | 'refunded' | 'disputed';
|
|
101
|
+
status_url: 'https://xquik.com/api/v1/guest-wallets/status';
|
|
102
|
+
wallet_id: string;
|
|
103
|
+
}
|
|
104
|
+
export declare namespace GuestWalletCreateResponse {
|
|
105
|
+
interface Authorization {
|
|
106
|
+
header: 'Authorization';
|
|
107
|
+
scheme: 'Bearer';
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Current balance, usability, and latest guest purchase state.
|
|
112
|
+
*/
|
|
113
|
+
export interface GuestWalletRetrieveStatusResponse {
|
|
114
|
+
balance: string;
|
|
115
|
+
/**
|
|
116
|
+
* Latest guest wallet purchase fulfillment state.
|
|
117
|
+
*/
|
|
118
|
+
latest_purchase: GuestWalletRetrieveStatusResponse.LatestPurchase | null;
|
|
119
|
+
/**
|
|
120
|
+
* Polling delay while payment is pending. Null means stop.
|
|
121
|
+
*/
|
|
122
|
+
poll_after_seconds: 2 | null;
|
|
123
|
+
scope: 'paid_reads';
|
|
124
|
+
/**
|
|
125
|
+
* Combined wallet and pending-checkout state. A pending top-up can coexist with
|
|
126
|
+
* usable true. Terminal expired or failed states require a new guest wallet.
|
|
127
|
+
*/
|
|
128
|
+
status: 'active' | 'pending' | 'expired' | 'failed' | 'frozen' | 'closed';
|
|
129
|
+
/**
|
|
130
|
+
* Top-up action when usable and no checkout is pending.
|
|
131
|
+
*/
|
|
132
|
+
top_up: GuestWalletRetrieveStatusResponse.TopUp | null;
|
|
133
|
+
/**
|
|
134
|
+
* Authoritative paid-read readiness. Use instead of status.
|
|
135
|
+
*/
|
|
136
|
+
usable: boolean;
|
|
137
|
+
wallet_id: string;
|
|
138
|
+
}
|
|
139
|
+
export declare namespace GuestWalletRetrieveStatusResponse {
|
|
140
|
+
/**
|
|
141
|
+
* Latest guest wallet purchase fulfillment state.
|
|
142
|
+
*/
|
|
143
|
+
interface LatestPurchase {
|
|
144
|
+
/**
|
|
145
|
+
* Confirmed USD amount for a guest wallet purchase.
|
|
146
|
+
*/
|
|
147
|
+
amount: GuestWalletsAPI.GuestWalletAmount;
|
|
148
|
+
/**
|
|
149
|
+
* Present only while the purchase is pending.
|
|
150
|
+
*/
|
|
151
|
+
checkout_url: string | null;
|
|
152
|
+
credits: string;
|
|
153
|
+
expires_at: string;
|
|
154
|
+
purchase_id: string;
|
|
155
|
+
status: 'creating' | 'pending' | 'paid' | 'expired' | 'failed' | 'refunded' | 'disputed';
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Top-up action when usable and no checkout is pending.
|
|
159
|
+
*/
|
|
160
|
+
interface TopUp {
|
|
161
|
+
method: 'POST';
|
|
162
|
+
path: '/api/v1/guest-wallets/topups';
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Pending Stripe checkout and guest wallet purchase details.
|
|
167
|
+
*/
|
|
168
|
+
export interface GuestWalletTopupResponse {
|
|
169
|
+
account_required: false;
|
|
170
|
+
/**
|
|
171
|
+
* Confirmed USD amount for a guest wallet purchase.
|
|
172
|
+
*/
|
|
173
|
+
amount: GuestWalletAmount;
|
|
174
|
+
/**
|
|
175
|
+
* Raw Stripe-hosted checkout URL for user interaction.
|
|
176
|
+
*/
|
|
177
|
+
checkout_url: string;
|
|
178
|
+
/**
|
|
179
|
+
* Usage granted after verified payment.
|
|
180
|
+
*/
|
|
181
|
+
credits: string;
|
|
182
|
+
/**
|
|
183
|
+
* Time when the pending checkout expires.
|
|
184
|
+
*/
|
|
185
|
+
expires_at: string;
|
|
186
|
+
instructions: 'Give checkout_url to the user. They must complete payment on Stripe. Never submit payment for them. After payment, poll status_url every poll_after_seconds until latest_purchase.status is no longer pending.';
|
|
187
|
+
/**
|
|
188
|
+
* Wait at least this long before polling status_url.
|
|
189
|
+
*/
|
|
190
|
+
poll_after_seconds: 2;
|
|
191
|
+
purchase_id: string;
|
|
192
|
+
requires_user_interaction: true;
|
|
193
|
+
status: 'creating' | 'pending' | 'paid' | 'expired' | 'failed' | 'refunded' | 'disputed';
|
|
194
|
+
status_url: 'https://xquik.com/api/v1/guest-wallets/status';
|
|
195
|
+
wallet_id: string;
|
|
196
|
+
/**
|
|
197
|
+
* Paid-read bearer credential returned only by initial creation. Store it as a
|
|
198
|
+
* secret. Never place it in a URL or log.
|
|
199
|
+
*/
|
|
200
|
+
api_key?: string;
|
|
201
|
+
authorization?: GuestWalletTopupResponse.Authorization;
|
|
202
|
+
credential_notice?: 'Store api_key and the Idempotency-Key securely before sharing checkout_url. No email recovery is available.';
|
|
203
|
+
}
|
|
204
|
+
export declare namespace GuestWalletTopupResponse {
|
|
205
|
+
interface Authorization {
|
|
206
|
+
header: 'Authorization';
|
|
207
|
+
scheme: 'Bearer';
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
export interface GuestWalletCreateParams {
|
|
211
|
+
/**
|
|
212
|
+
* Body param: Confirmed USD amount in cents.
|
|
213
|
+
*/
|
|
214
|
+
amount_minor: number;
|
|
215
|
+
/**
|
|
216
|
+
* Body param
|
|
217
|
+
*/
|
|
218
|
+
currency: 'usd';
|
|
219
|
+
/**
|
|
220
|
+
* Header param: Generate a cryptographically random UUID v4. Reuse it only to
|
|
221
|
+
* retry the same wallet and amount request. Initial wallet creation can recover
|
|
222
|
+
* the API key from this value, so store it as a secret and never log it.
|
|
223
|
+
*/
|
|
224
|
+
'Idempotency-Key': string;
|
|
225
|
+
}
|
|
226
|
+
export interface GuestWalletTopupParams {
|
|
227
|
+
/**
|
|
228
|
+
* Body param: Confirmed USD amount in cents.
|
|
229
|
+
*/
|
|
230
|
+
amount_minor: number;
|
|
231
|
+
/**
|
|
232
|
+
* Body param
|
|
233
|
+
*/
|
|
234
|
+
currency: 'usd';
|
|
235
|
+
/**
|
|
236
|
+
* Header param: Generate a cryptographically random UUID v4. Reuse it only to
|
|
237
|
+
* retry the same wallet and amount request. Initial wallet creation can recover
|
|
238
|
+
* the API key from this value, so store it as a secret and never log it.
|
|
239
|
+
*/
|
|
240
|
+
'Idempotency-Key': string;
|
|
241
|
+
}
|
|
242
|
+
export declare namespace GuestWallets {
|
|
243
|
+
export { type GuestWalletAmount as GuestWalletAmount, type GuestWalletCreateResponse as GuestWalletCreateResponse, type GuestWalletRetrieveStatusResponse as GuestWalletRetrieveStatusResponse, type GuestWalletTopupResponse as GuestWalletTopupResponse, type GuestWalletCreateParams as GuestWalletCreateParams, type GuestWalletTopupParams as GuestWalletTopupParams, };
|
|
244
|
+
}
|
|
245
|
+
//# sourceMappingURL=guest-wallets.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guest-wallets.d.mts","sourceRoot":"","sources":["../src/resources/guest-wallets.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,KAAK,eAAe,4BAAwB;AACnD,OAAO,EAAE,UAAU,EAAE,gCAA4B;AAEjD,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAE7D;;GAEG;AACH,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,MAAM,EAAE,uBAAuB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,yBAAyB,CAAC;IAUxG;;;;;;;;;;OAUG;IACH,cAAc,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,iCAAiC,CAAC;IAOvF;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,MAAM,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,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,CAAC;IAElB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,aAAa,CAAC,EAAE,wBAAwB,CAAC,aAAa,CAAC;IAEvD,iBAAiB,CAAC,EAAE,6GAA6G,CAAC;CACnI;AAED,yBAAiB,wBAAwB,CAAC;IACxC,UAAiB,aAAa;QAC5B,MAAM,EAAE,eAAe,CAAC;QAExB,MAAM,EAAE,QAAQ,CAAC;KAClB;CACF;AAED,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC;IAEhB;;;;OAIG;IACH,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC;IAEhB;;;;OAIG;IACH,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
|
2
|
+
import * as GuestWalletsAPI from "./guest-wallets.js";
|
|
3
|
+
import { APIPromise } from "../core/api-promise.js";
|
|
4
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
5
|
+
/**
|
|
6
|
+
* Accountless prepaid access for paid read endpoints
|
|
7
|
+
*/
|
|
8
|
+
export declare class GuestWallets extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Create a one-use Stripe-hosted checkout after the user explicitly confirms a
|
|
11
|
+
* $10-$250 USD amount. This request creates no charge by itself. The user opens
|
|
12
|
+
* checkout_url on Stripe. This endpoint returns the paid-read API key without
|
|
13
|
+
* requiring an Xquik account, email, dashboard, or Xquik web page. An idempotent
|
|
14
|
+
* replay returns the same key.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const guestWallet = await client.guestWallets.create({
|
|
19
|
+
* amount_minor: 1000,
|
|
20
|
+
* currency: 'usd',
|
|
21
|
+
* 'Idempotency-Key': 'e1cb97D8-dDF3-4AaA-ad0a-49E4A0d1CfAa',
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
create(params: GuestWalletCreateParams, options?: RequestOptions): APIPromise<GuestWalletCreateResponse>;
|
|
26
|
+
/**
|
|
27
|
+
* Poll after Stripe payment. Use usable to decide whether paid reads can run. An
|
|
28
|
+
* active wallet can remain usable while a top-up is pending. A new wallet becomes
|
|
29
|
+
* usable only after verified webhook fulfillment. Send the guest key as
|
|
30
|
+
* Authorization: Bearer.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* const response = await client.guestWallets.retrieveStatus();
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
retrieveStatus(options?: RequestOptions): APIPromise<GuestWalletRetrieveStatusResponse>;
|
|
38
|
+
/**
|
|
39
|
+
* Create a one-use Stripe-hosted checkout for an existing paid-read guest key
|
|
40
|
+
* after the user explicitly confirms a $10-$250 USD amount. The key remains the
|
|
41
|
+
* same. This request creates no charge by itself and never redirects through an
|
|
42
|
+
* Xquik web page.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* const response = await client.guestWallets.topup({
|
|
47
|
+
* amount_minor: 1000,
|
|
48
|
+
* currency: 'usd',
|
|
49
|
+
* 'Idempotency-Key': 'e1cb97D8-dDF3-4AaA-ad0a-49E4A0d1CfAa',
|
|
50
|
+
* });
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
topup(params: GuestWalletTopupParams, options?: RequestOptions): APIPromise<GuestWalletTopupResponse>;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Confirmed USD amount for a guest wallet purchase.
|
|
57
|
+
*/
|
|
58
|
+
export interface GuestWalletAmount {
|
|
59
|
+
/**
|
|
60
|
+
* USD amount in cents. Accepted range is $10-$250.
|
|
61
|
+
*/
|
|
62
|
+
amount_minor: number;
|
|
63
|
+
currency: 'usd';
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Initial guest wallet response containing the one-time key.
|
|
67
|
+
*/
|
|
68
|
+
export interface GuestWalletCreateResponse {
|
|
69
|
+
account_required: false;
|
|
70
|
+
/**
|
|
71
|
+
* Confirmed USD amount for a guest wallet purchase.
|
|
72
|
+
*/
|
|
73
|
+
amount: GuestWalletAmount;
|
|
74
|
+
/**
|
|
75
|
+
* Paid-read bearer credential returned only by initial creation. Store it as a
|
|
76
|
+
* secret. Never place it in a URL or log.
|
|
77
|
+
*/
|
|
78
|
+
api_key: string;
|
|
79
|
+
authorization: GuestWalletCreateResponse.Authorization;
|
|
80
|
+
/**
|
|
81
|
+
* Raw Stripe-hosted checkout URL for user interaction.
|
|
82
|
+
*/
|
|
83
|
+
checkout_url: string;
|
|
84
|
+
credential_notice: 'Store api_key and the Idempotency-Key securely before sharing checkout_url. No email recovery is available.';
|
|
85
|
+
/**
|
|
86
|
+
* Usage granted after verified payment.
|
|
87
|
+
*/
|
|
88
|
+
credits: string;
|
|
89
|
+
/**
|
|
90
|
+
* Time when the pending checkout expires.
|
|
91
|
+
*/
|
|
92
|
+
expires_at: string;
|
|
93
|
+
instructions: 'Give checkout_url to the user. They must complete payment on Stripe. Never submit payment for them. After payment, poll status_url every poll_after_seconds until latest_purchase.status is no longer pending.';
|
|
94
|
+
/**
|
|
95
|
+
* Wait at least this long before polling status_url.
|
|
96
|
+
*/
|
|
97
|
+
poll_after_seconds: 2;
|
|
98
|
+
purchase_id: string;
|
|
99
|
+
requires_user_interaction: true;
|
|
100
|
+
status: 'creating' | 'pending' | 'paid' | 'expired' | 'failed' | 'refunded' | 'disputed';
|
|
101
|
+
status_url: 'https://xquik.com/api/v1/guest-wallets/status';
|
|
102
|
+
wallet_id: string;
|
|
103
|
+
}
|
|
104
|
+
export declare namespace GuestWalletCreateResponse {
|
|
105
|
+
interface Authorization {
|
|
106
|
+
header: 'Authorization';
|
|
107
|
+
scheme: 'Bearer';
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Current balance, usability, and latest guest purchase state.
|
|
112
|
+
*/
|
|
113
|
+
export interface GuestWalletRetrieveStatusResponse {
|
|
114
|
+
balance: string;
|
|
115
|
+
/**
|
|
116
|
+
* Latest guest wallet purchase fulfillment state.
|
|
117
|
+
*/
|
|
118
|
+
latest_purchase: GuestWalletRetrieveStatusResponse.LatestPurchase | null;
|
|
119
|
+
/**
|
|
120
|
+
* Polling delay while payment is pending. Null means stop.
|
|
121
|
+
*/
|
|
122
|
+
poll_after_seconds: 2 | null;
|
|
123
|
+
scope: 'paid_reads';
|
|
124
|
+
/**
|
|
125
|
+
* Combined wallet and pending-checkout state. A pending top-up can coexist with
|
|
126
|
+
* usable true. Terminal expired or failed states require a new guest wallet.
|
|
127
|
+
*/
|
|
128
|
+
status: 'active' | 'pending' | 'expired' | 'failed' | 'frozen' | 'closed';
|
|
129
|
+
/**
|
|
130
|
+
* Top-up action when usable and no checkout is pending.
|
|
131
|
+
*/
|
|
132
|
+
top_up: GuestWalletRetrieveStatusResponse.TopUp | null;
|
|
133
|
+
/**
|
|
134
|
+
* Authoritative paid-read readiness. Use instead of status.
|
|
135
|
+
*/
|
|
136
|
+
usable: boolean;
|
|
137
|
+
wallet_id: string;
|
|
138
|
+
}
|
|
139
|
+
export declare namespace GuestWalletRetrieveStatusResponse {
|
|
140
|
+
/**
|
|
141
|
+
* Latest guest wallet purchase fulfillment state.
|
|
142
|
+
*/
|
|
143
|
+
interface LatestPurchase {
|
|
144
|
+
/**
|
|
145
|
+
* Confirmed USD amount for a guest wallet purchase.
|
|
146
|
+
*/
|
|
147
|
+
amount: GuestWalletsAPI.GuestWalletAmount;
|
|
148
|
+
/**
|
|
149
|
+
* Present only while the purchase is pending.
|
|
150
|
+
*/
|
|
151
|
+
checkout_url: string | null;
|
|
152
|
+
credits: string;
|
|
153
|
+
expires_at: string;
|
|
154
|
+
purchase_id: string;
|
|
155
|
+
status: 'creating' | 'pending' | 'paid' | 'expired' | 'failed' | 'refunded' | 'disputed';
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Top-up action when usable and no checkout is pending.
|
|
159
|
+
*/
|
|
160
|
+
interface TopUp {
|
|
161
|
+
method: 'POST';
|
|
162
|
+
path: '/api/v1/guest-wallets/topups';
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Pending Stripe checkout and guest wallet purchase details.
|
|
167
|
+
*/
|
|
168
|
+
export interface GuestWalletTopupResponse {
|
|
169
|
+
account_required: false;
|
|
170
|
+
/**
|
|
171
|
+
* Confirmed USD amount for a guest wallet purchase.
|
|
172
|
+
*/
|
|
173
|
+
amount: GuestWalletAmount;
|
|
174
|
+
/**
|
|
175
|
+
* Raw Stripe-hosted checkout URL for user interaction.
|
|
176
|
+
*/
|
|
177
|
+
checkout_url: string;
|
|
178
|
+
/**
|
|
179
|
+
* Usage granted after verified payment.
|
|
180
|
+
*/
|
|
181
|
+
credits: string;
|
|
182
|
+
/**
|
|
183
|
+
* Time when the pending checkout expires.
|
|
184
|
+
*/
|
|
185
|
+
expires_at: string;
|
|
186
|
+
instructions: 'Give checkout_url to the user. They must complete payment on Stripe. Never submit payment for them. After payment, poll status_url every poll_after_seconds until latest_purchase.status is no longer pending.';
|
|
187
|
+
/**
|
|
188
|
+
* Wait at least this long before polling status_url.
|
|
189
|
+
*/
|
|
190
|
+
poll_after_seconds: 2;
|
|
191
|
+
purchase_id: string;
|
|
192
|
+
requires_user_interaction: true;
|
|
193
|
+
status: 'creating' | 'pending' | 'paid' | 'expired' | 'failed' | 'refunded' | 'disputed';
|
|
194
|
+
status_url: 'https://xquik.com/api/v1/guest-wallets/status';
|
|
195
|
+
wallet_id: string;
|
|
196
|
+
/**
|
|
197
|
+
* Paid-read bearer credential returned only by initial creation. Store it as a
|
|
198
|
+
* secret. Never place it in a URL or log.
|
|
199
|
+
*/
|
|
200
|
+
api_key?: string;
|
|
201
|
+
authorization?: GuestWalletTopupResponse.Authorization;
|
|
202
|
+
credential_notice?: 'Store api_key and the Idempotency-Key securely before sharing checkout_url. No email recovery is available.';
|
|
203
|
+
}
|
|
204
|
+
export declare namespace GuestWalletTopupResponse {
|
|
205
|
+
interface Authorization {
|
|
206
|
+
header: 'Authorization';
|
|
207
|
+
scheme: 'Bearer';
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
export interface GuestWalletCreateParams {
|
|
211
|
+
/**
|
|
212
|
+
* Body param: Confirmed USD amount in cents.
|
|
213
|
+
*/
|
|
214
|
+
amount_minor: number;
|
|
215
|
+
/**
|
|
216
|
+
* Body param
|
|
217
|
+
*/
|
|
218
|
+
currency: 'usd';
|
|
219
|
+
/**
|
|
220
|
+
* Header param: Generate a cryptographically random UUID v4. Reuse it only to
|
|
221
|
+
* retry the same wallet and amount request. Initial wallet creation can recover
|
|
222
|
+
* the API key from this value, so store it as a secret and never log it.
|
|
223
|
+
*/
|
|
224
|
+
'Idempotency-Key': string;
|
|
225
|
+
}
|
|
226
|
+
export interface GuestWalletTopupParams {
|
|
227
|
+
/**
|
|
228
|
+
* Body param: Confirmed USD amount in cents.
|
|
229
|
+
*/
|
|
230
|
+
amount_minor: number;
|
|
231
|
+
/**
|
|
232
|
+
* Body param
|
|
233
|
+
*/
|
|
234
|
+
currency: 'usd';
|
|
235
|
+
/**
|
|
236
|
+
* Header param: Generate a cryptographically random UUID v4. Reuse it only to
|
|
237
|
+
* retry the same wallet and amount request. Initial wallet creation can recover
|
|
238
|
+
* the API key from this value, so store it as a secret and never log it.
|
|
239
|
+
*/
|
|
240
|
+
'Idempotency-Key': string;
|
|
241
|
+
}
|
|
242
|
+
export declare namespace GuestWallets {
|
|
243
|
+
export { type GuestWalletAmount as GuestWalletAmount, type GuestWalletCreateResponse as GuestWalletCreateResponse, type GuestWalletRetrieveStatusResponse as GuestWalletRetrieveStatusResponse, type GuestWalletTopupResponse as GuestWalletTopupResponse, type GuestWalletCreateParams as GuestWalletCreateParams, type GuestWalletTopupParams as GuestWalletTopupParams, };
|
|
244
|
+
}
|
|
245
|
+
//# sourceMappingURL=guest-wallets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guest-wallets.d.ts","sourceRoot":"","sources":["../src/resources/guest-wallets.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,KAAK,eAAe,2BAAwB;AACnD,OAAO,EAAE,UAAU,EAAE,+BAA4B;AAEjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAE7D;;GAEG;AACH,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,MAAM,EAAE,uBAAuB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,yBAAyB,CAAC;IAUxG;;;;;;;;;;OAUG;IACH,cAAc,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,iCAAiC,CAAC;IAOvF;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,MAAM,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;CAStG;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB,QAAQ,EAAE,KAAK,CAAC;CACjB;AAED;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G,CAAC;CACnI;AAED,yBAAiB,wBAAwB,CAAC;IACxC,UAAiB,aAAa;QAC5B,MAAM,EAAE,eAAe,CAAC;QAExB,MAAM,EAAE,QAAQ,CAAC;KAClB;CACF;AAED,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC;IAEhB;;;;OAIG;IACH,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC;IAEhB;;;;OAIG;IACH,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.GuestWallets = void 0;
|
|
5
|
+
const resource_1 = require("../core/resource.js");
|
|
6
|
+
const headers_1 = require("../internal/headers.js");
|
|
7
|
+
/**
|
|
8
|
+
* Accountless prepaid access for paid read endpoints
|
|
9
|
+
*/
|
|
10
|
+
class GuestWallets extends resource_1.APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* Create a one-use Stripe-hosted checkout after the user explicitly confirms a
|
|
13
|
+
* $10-$250 USD amount. This request creates no charge by itself. The user opens
|
|
14
|
+
* checkout_url on Stripe. This endpoint returns the paid-read API key without
|
|
15
|
+
* requiring an Xquik account, email, dashboard, or Xquik web page. An idempotent
|
|
16
|
+
* replay returns the same key.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const guestWallet = await client.guestWallets.create({
|
|
21
|
+
* amount_minor: 1000,
|
|
22
|
+
* currency: 'usd',
|
|
23
|
+
* 'Idempotency-Key': 'e1cb97D8-dDF3-4AaA-ad0a-49E4A0d1CfAa',
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
create(params, options) {
|
|
28
|
+
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
29
|
+
return this._client.post('/guest-wallets', {
|
|
30
|
+
body,
|
|
31
|
+
...options,
|
|
32
|
+
headers: (0, headers_1.buildHeaders)([{ 'Idempotency-Key': idempotencyKey }, options?.headers]),
|
|
33
|
+
__security: {},
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Poll after Stripe payment. Use usable to decide whether paid reads can run. An
|
|
38
|
+
* active wallet can remain usable while a top-up is pending. A new wallet becomes
|
|
39
|
+
* usable only after verified webhook fulfillment. Send the guest key as
|
|
40
|
+
* Authorization: Bearer.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const response = await client.guestWallets.retrieveStatus();
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
retrieveStatus(options) {
|
|
48
|
+
return this._client.get('/guest-wallets/status', {
|
|
49
|
+
...options,
|
|
50
|
+
__security: { apiKeyAuth: true, oauthBearerAuth: true },
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Create a one-use Stripe-hosted checkout for an existing paid-read guest key
|
|
55
|
+
* after the user explicitly confirms a $10-$250 USD amount. The key remains the
|
|
56
|
+
* same. This request creates no charge by itself and never redirects through an
|
|
57
|
+
* Xquik web page.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* const response = await client.guestWallets.topup({
|
|
62
|
+
* amount_minor: 1000,
|
|
63
|
+
* currency: 'usd',
|
|
64
|
+
* 'Idempotency-Key': 'e1cb97D8-dDF3-4AaA-ad0a-49E4A0d1CfAa',
|
|
65
|
+
* });
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
topup(params, options) {
|
|
69
|
+
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
70
|
+
return this._client.post('/guest-wallets/topups', {
|
|
71
|
+
body,
|
|
72
|
+
...options,
|
|
73
|
+
headers: (0, headers_1.buildHeaders)([{ 'Idempotency-Key': idempotencyKey }, options?.headers]),
|
|
74
|
+
__security: { apiKeyAuth: true, oauthBearerAuth: true },
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
exports.GuestWallets = GuestWallets;
|
|
79
|
+
//# sourceMappingURL=guest-wallets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guest-wallets.js","sourceRoot":"","sources":["../src/resources/guest-wallets.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAAmD;AAGnD;;GAEG;AACH,MAAa,YAAa,SAAQ,sBAAW;IAC3C;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,MAA+B,EAAE,OAAwB;QAC9D,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE;YACzC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,iBAAiB,EAAE,cAAc,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAChF,UAAU,EAAE,EAAE;SACf,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,cAAc,CAAC,OAAwB;QACrC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE;YAC/C,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE;SACxD,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,MAA8B,EAAE,OAAwB;QAC5D,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,uBAAuB,EAAE;YAChD,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,iBAAiB,EAAE,cAAc,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAChF,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE;SACxD,CAAC,CAAC;IACL,CAAC;CACF;AArED,oCAqEC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
import { buildHeaders } from "../internal/headers.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* Accountless prepaid access for paid read endpoints
|
|
6
|
+
*/
|
|
7
|
+
export class GuestWallets extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Create a one-use Stripe-hosted checkout after the user explicitly confirms a
|
|
10
|
+
* $10-$250 USD amount. This request creates no charge by itself. The user opens
|
|
11
|
+
* checkout_url on Stripe. This endpoint returns the paid-read API key without
|
|
12
|
+
* requiring an Xquik account, email, dashboard, or Xquik web page. An idempotent
|
|
13
|
+
* replay returns the same key.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const guestWallet = await client.guestWallets.create({
|
|
18
|
+
* amount_minor: 1000,
|
|
19
|
+
* currency: 'usd',
|
|
20
|
+
* 'Idempotency-Key': 'e1cb97D8-dDF3-4AaA-ad0a-49E4A0d1CfAa',
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
create(params, options) {
|
|
25
|
+
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
26
|
+
return this._client.post('/guest-wallets', {
|
|
27
|
+
body,
|
|
28
|
+
...options,
|
|
29
|
+
headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey }, options?.headers]),
|
|
30
|
+
__security: {},
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Poll after Stripe payment. Use usable to decide whether paid reads can run. An
|
|
35
|
+
* active wallet can remain usable while a top-up is pending. A new wallet becomes
|
|
36
|
+
* usable only after verified webhook fulfillment. Send the guest key as
|
|
37
|
+
* Authorization: Bearer.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const response = await client.guestWallets.retrieveStatus();
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
retrieveStatus(options) {
|
|
45
|
+
return this._client.get('/guest-wallets/status', {
|
|
46
|
+
...options,
|
|
47
|
+
__security: { apiKeyAuth: true, oauthBearerAuth: true },
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Create a one-use Stripe-hosted checkout for an existing paid-read guest key
|
|
52
|
+
* after the user explicitly confirms a $10-$250 USD amount. The key remains the
|
|
53
|
+
* same. This request creates no charge by itself and never redirects through an
|
|
54
|
+
* Xquik web page.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* const response = await client.guestWallets.topup({
|
|
59
|
+
* amount_minor: 1000,
|
|
60
|
+
* currency: 'usd',
|
|
61
|
+
* 'Idempotency-Key': 'e1cb97D8-dDF3-4AaA-ad0a-49E4A0d1CfAa',
|
|
62
|
+
* });
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
topup(params, options) {
|
|
66
|
+
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
67
|
+
return this._client.post('/guest-wallets/topups', {
|
|
68
|
+
body,
|
|
69
|
+
...options,
|
|
70
|
+
headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey }, options?.headers]),
|
|
71
|
+
__security: { apiKeyAuth: true, oauthBearerAuth: true },
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=guest-wallets.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guest-wallets.mjs","sourceRoot":"","sources":["../src/resources/guest-wallets.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAG/C,OAAO,EAAE,YAAY,EAAE,gCAA4B;AAGnD;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,MAA+B,EAAE,OAAwB;QAC9D,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE;YACzC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,iBAAiB,EAAE,cAAc,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAChF,UAAU,EAAE,EAAE;SACf,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,cAAc,CAAC,OAAwB;QACrC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE;YAC/C,GAAG,OAAO;YACV,UAAU,EAAE,EAAE,UAAU,EAAE,I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