diff --git a/web/CHANGELOG.md b/web/CHANGELOG.md index 900179e368..6fa7ccdd1a 100644 --- a/web/CHANGELOG.md +++ b/web/CHANGELOG.md @@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Added + +- Generated Stripe payment API calls: checkout sessions, webhook setup, and return URLs. + +### Changed + +- Updated auto-generated APIs and content manifest schemas to latest OpenAPI specs. + +### Fixed + +- Fixed useless regex escapes in `BeamJsonUtils`. + ## [1.1.1] - 2026-04-16 ### Fixed diff --git a/web/src/__generated__/apis/PaymentsApi.ts b/web/src/__generated__/apis/PaymentsApi.ts index 24e31dbf9f..39483331c2 100644 --- a/web/src/__generated__/apis/PaymentsApi.ts +++ b/web/src/__generated__/apis/PaymentsApi.ts @@ -26,6 +26,7 @@ import type { LocalizedPriceMap } from '@/__generated__/schemas/LocalizedPriceMa import type { PaymentResultResponse } from '@/__generated__/schemas/PaymentResultResponse'; import type { SteamAuthRequest } from '@/__generated__/schemas/SteamAuthRequest'; import type { SteamOrderInfoResponse } from '@/__generated__/schemas/SteamOrderInfoResponse'; +import type { StripeWebhookSetupResponse } from '@/__generated__/schemas/StripeWebhookSetupResponse'; import type { SubscriptionVerificationResponse } from '@/__generated__/schemas/SubscriptionVerificationResponse'; import type { TrackPurchaseRequest } from '@/__generated__/schemas/TrackPurchaseRequest'; import type { VerifyPurchaseRequest } from '@/__generated__/schemas/VerifyPurchaseRequest'; @@ -212,6 +213,30 @@ export async function paymentsPostFacebookPurchaseCompleteBasic(requester: HttpR }); } +/** + * @remarks + * **Authentication:** + * This method requires a valid bearer token in the `Authorization` header. + * + * @param requester - The `HttpRequester` type to use for the API request. + * @param payload - The `CancelPurchaseRequest` instance to use for the API request + * @param gamertag - Override the Gamer Tag of the player. This is generally inferred by the auth token. + * + */ +export async function paymentsPostStripePurchaseCancelBasic(requester: HttpRequester, payload: CancelPurchaseRequest, gamertag?: string): Promise> { + let endpoint = "/basic/payments/stripe/purchase/cancel"; + + // Make the API request + return makeApiRequest({ + r: requester, + e: endpoint, + m: POST, + p: payload, + g: gamertag, + w: true + }); +} + /** * @remarks * **Authentication:** @@ -295,6 +320,25 @@ export async function paymentsPostGoogleplayPurchaseCompleteBasic(requester: Htt }); } +/** + * @param requester - The `HttpRequester` type to use for the API request. + * @param payload - The `CompletePurchaseRequest` instance to use for the API request + * @param gamertag - Override the Gamer Tag of the player. This is generally inferred by the auth token. + * + */ +export async function paymentsPostStripePurchaseCompleteBasic(requester: HttpRequester, payload: CompletePurchaseRequest, gamertag?: string): Promise> { + let endpoint = "/basic/payments/stripe/purchase/complete"; + + // Make the API request + return makeApiRequest({ + r: requester, + e: endpoint, + m: POST, + p: payload, + g: gamertag + }); +} + /** * @param requester - The `HttpRequester` type to use for the API request. * @param payload - The `TrackPurchaseRequest` instance to use for the API request @@ -405,6 +449,23 @@ export async function paymentsPostFacebookPurchaseCancelBasic(requester: HttpReq }); } +/** + * @param requester - The `HttpRequester` type to use for the API request. + * @param gamertag - Override the Gamer Tag of the player. This is generally inferred by the auth token. + * + */ +export async function paymentsPostStripeWebhookSetupBasic(requester: HttpRequester, gamertag?: string): Promise> { + let endpoint = "/basic/payments/stripe/webhook/setup"; + + // Make the API request + return makeApiRequest({ + r: requester, + e: endpoint, + m: POST, + g: gamertag + }); +} + /** * @param requester - The `HttpRequester` type to use for the API request. * @param payload - The `TrackPurchaseRequest` instance to use for the API request @@ -612,6 +673,46 @@ export async function paymentsPostTestPurchaseFailBasic(requester: HttpRequester }); } +/** + * @param requester - The `HttpRequester` type to use for the API request. + * @param sku - The `sku` parameter to include in the API request. + * @param gamertag - Override the Gamer Tag of the player. This is generally inferred by the auth token. + * + */ +export async function paymentsGetStripeProductBasic(requester: HttpRequester, sku: string, gamertag?: string): Promise> { + let endpoint = "/basic/payments/stripe/product"; + + // Make the API request + return makeApiRequest({ + r: requester, + e: endpoint, + m: GET, + q: { + sku + }, + g: gamertag + }); +} + +/** + * @param requester - The `HttpRequester` type to use for the API request. + * @param payload - The `VerifyPurchaseRequest` instance to use for the API request + * @param gamertag - Override the Gamer Tag of the player. This is generally inferred by the auth token. + * + */ +export async function paymentsPostStripePurchaseVerifyBasic(requester: HttpRequester, payload: VerifyPurchaseRequest, gamertag?: string): Promise> { + let endpoint = "/basic/payments/stripe/purchase/verify"; + + // Make the API request + return makeApiRequest({ + r: requester, + e: endpoint, + m: POST, + p: payload, + g: gamertag + }); +} + /** * @remarks * **Authentication:** @@ -850,6 +951,30 @@ export async function paymentsGetWindowsProductBasic(requester: HttpRequester, s }); } +/** + * @remarks + * **Authentication:** + * This method requires a valid bearer token in the `Authorization` header. + * + * @param requester - The `HttpRequester` type to use for the API request. + * @param payload - The `FailPurchaseRequest` instance to use for the API request + * @param gamertag - Override the Gamer Tag of the player. This is generally inferred by the auth token. + * + */ +export async function paymentsPostStripePurchaseFailBasic(requester: HttpRequester, payload: FailPurchaseRequest, gamertag?: string): Promise> { + let endpoint = "/basic/payments/stripe/purchase/fail"; + + // Make the API request + return makeApiRequest({ + r: requester, + e: endpoint, + m: POST, + p: payload, + g: gamertag, + w: true + }); +} + /** * @remarks * **Authentication:** @@ -874,6 +999,30 @@ export async function paymentsPostGoogleplayPurchaseFailBasic(requester: HttpReq }); } +/** + * @remarks + * **Authentication:** + * This method requires a valid bearer token in the `Authorization` header. + * + * @param requester - The `HttpRequester` type to use for the API request. + * @param payload - The `BeginPurchaseRequest` instance to use for the API request + * @param gamertag - Override the Gamer Tag of the player. This is generally inferred by the auth token. + * + */ +export async function paymentsPostStripePurchaseBeginBasic(requester: HttpRequester, payload: BeginPurchaseRequest, gamertag?: string): Promise> { + let endpoint = "/basic/payments/stripe/purchase/begin"; + + // Make the API request + return makeApiRequest({ + r: requester, + e: endpoint, + m: POST, + p: payload, + g: gamertag, + w: true + }); +} + /** * @param requester - The `HttpRequester` type to use for the API request. * @param sku - The `sku` parameter to include in the API request. @@ -1161,6 +1310,25 @@ export async function paymentsPostWindowsPurchaseFailBasic(requester: HttpReques }); } +/** + * @param requester - The `HttpRequester` type to use for the API request. + * @param payload - The `TrackPurchaseRequest` instance to use for the API request + * @param gamertag - Override the Gamer Tag of the player. This is generally inferred by the auth token. + * + */ +export async function paymentsPostStripePurchaseTrackBasic(requester: HttpRequester, payload: TrackPurchaseRequest, gamertag?: string): Promise> { + let endpoint = "/basic/payments/stripe/purchase/track"; + + // Make the API request + return makeApiRequest({ + r: requester, + e: endpoint, + m: POST, + p: payload, + g: gamertag + }); +} + /** * @remarks * **Authentication:** diff --git a/web/src/__generated__/schemas/BeginPurchaseRequest.ts b/web/src/__generated__/schemas/BeginPurchaseRequest.ts index 0fd9afd52b..897c2ffedb 100644 --- a/web/src/__generated__/schemas/BeginPurchaseRequest.ts +++ b/web/src/__generated__/schemas/BeginPurchaseRequest.ts @@ -6,5 +6,6 @@ export type BeginPurchaseRequest = { purchaseId: string; language?: string; + returnUrl?: string; time?: string; }; diff --git a/web/src/__generated__/schemas/ClientManifestJsonResponse.ts b/web/src/__generated__/schemas/ClientManifestJsonResponse.ts index 4331742cf5..94f3da4690 100644 --- a/web/src/__generated__/schemas/ClientManifestJsonResponse.ts +++ b/web/src/__generated__/schemas/ClientManifestJsonResponse.ts @@ -7,6 +7,7 @@ import type { ClientContentInfoJson } from './ClientContentInfoJson'; export type ClientManifestJsonResponse = { entries: ClientContentInfoJson[]; + clientVersion?: string; createdAt?: bigint | string; publisherAccountId?: bigint | string; uid?: string; diff --git a/web/src/__generated__/schemas/ClientManifestResponse.ts b/web/src/__generated__/schemas/ClientManifestResponse.ts index d9d467b0b3..b4f0987091 100644 --- a/web/src/__generated__/schemas/ClientManifestResponse.ts +++ b/web/src/__generated__/schemas/ClientManifestResponse.ts @@ -7,6 +7,7 @@ import type { ClientContentInfo } from './ClientContentInfo'; export type ClientManifestResponse = { items: ClientContentInfo[]; + clientVersion?: string; createdAt?: bigint | string; latestUpdate?: bigint | string; }; diff --git a/web/src/__generated__/schemas/ContentBasicManifest.ts b/web/src/__generated__/schemas/ContentBasicManifest.ts index 27ff30e69c..e51a8e6f09 100644 --- a/web/src/__generated__/schemas/ContentBasicManifest.ts +++ b/web/src/__generated__/schemas/ContentBasicManifest.ts @@ -14,6 +14,7 @@ export type ContentBasicManifest = { id: string; references: (ContentReference | TextReference | BinaryReference)[]; archived?: boolean; + clientVersion?: string; diffObjectKey?: string; lastChanged?: bigint | string; publisherAccountId?: bigint | string; diff --git a/web/src/__generated__/schemas/SaveManifestRequest.ts b/web/src/__generated__/schemas/SaveManifestRequest.ts index b6a52ad0ef..b96d6eb200 100644 --- a/web/src/__generated__/schemas/SaveManifestRequest.ts +++ b/web/src/__generated__/schemas/SaveManifestRequest.ts @@ -8,4 +8,5 @@ import type { ReferenceSuperset } from './ReferenceSuperset'; export type SaveManifestRequest = { id: string; references: ReferenceSuperset[]; + clientVersion?: string; }; diff --git a/web/src/__generated__/schemas/StripeWebhookSetupResponse.ts b/web/src/__generated__/schemas/StripeWebhookSetupResponse.ts new file mode 100644 index 0000000000..dc9e6423de --- /dev/null +++ b/web/src/__generated__/schemas/StripeWebhookSetupResponse.ts @@ -0,0 +1,10 @@ +/** + * ⚠️ THIS FILE IS AUTO-GENERATED. DO NOT EDIT MANUALLY. + * All manual edits will be lost when this file is regenerated. + */ + +export type StripeWebhookSetupResponse = { + endpointId: string; + status: string; + url: string; +}; diff --git a/web/src/__generated__/schemas/index.ts b/web/src/__generated__/schemas/index.ts index fc3a509bf0..c4068160a8 100644 --- a/web/src/__generated__/schemas/index.ts +++ b/web/src/__generated__/schemas/index.ts @@ -750,6 +750,7 @@ export * from './SteamOrderInfoResponse'; export * from './Store'; export * from './StringStringKeyValuePair'; export * from './StripeSubscriptionResponse'; +export * from './StripeWebhookSetupResponse'; export * from './SubscriberDetailsResponse'; export * from './SubscriptionVerificationRequest'; export * from './SubscriptionVerificationResponse';