import { d as Page, f as Result, m as OpenCloudError, s as OpenCloudClientOptions, u as RequestOptions } from "./types-C3Egi37J.mjs"; import { i as RobloxLocale, r as RobloxLanguageCode } from "./data.generated-B2ceLfSn.mjs"; //#region src/domains/game-internationalization/game-pass-icon/types.d.ts /** * Parameters for uploading or replacing the per-locale icon registered * against a game pass. A subsequent upload for the same * `(gamePassId, languageCode)` pair replaces the existing icon for that * locale. * * @since 0.1.0 */ interface UploadGamePassIconParameters { /** Stringified ID of the game pass whose icon is being uploaded. */ readonly gamePassId: string; /** Image bytes to upload. PNG and JPEG are accepted by the server. */ readonly image: Blob | Uint8Array; /** * Roblox wire form the icon is being uploaded for. Either the * Language form (e.g. `en`, `fil`, `zh-hans`) or the Locale form * (e.g. `en_us`, `pt_br`, `ar_001`). */ readonly languageCode: RobloxLanguageCode | RobloxLocale; } //#endregion //#region src/domains/game-internationalization/game-pass-name-description/types.d.ts /** * Parameters for updating the per-locale name and/or description registered * against a game pass. Both `name` and `description` are optional; fields * omitted from the call are not included in the JSON body so the server * leaves the existing value for that locale untouched. * * @since 0.1.0 */ interface UpdateGamePassNameDescriptionParameters { /** Replacement display name for the supplied locale. */ readonly name?: string; /** Replacement description for the supplied locale. */ readonly description?: string; /** Stringified ID of the game pass whose localization is being updated. */ readonly gamePassId: string; /** * Roblox wire form being updated. Either the Language form (e.g. * `en`, `fil`, `zh-hans`) or the Locale form (e.g. `en_us`, `pt_br`, * `ar_001`). */ readonly languageCode: RobloxLanguageCode | RobloxLocale; } //#endregion //#region src/domains/game-passes/game-passes/types.d.ts /** * Pricing feature flags that can be enabled on a game pass. Values * mirror the Open Cloud `GamePasses.PricingFeature` enum. * * @since 0.1.0 */ type GamePassPricingFeature = "Invalid" | "PriceOptimization" | "RegionalPricing" | "UserFixedPrice"; /** * Public shape of a game pass's pricing configuration. * * @since 0.1.0 */ interface GamePassPrice { /** Default Robux price; `undefined` when no default price is configured. */ readonly defaultPriceInRobux: number | undefined; /** Pricing feature flags currently enabled on this game pass. */ readonly enabledFeatures: ReadonlyArray; } /** * A Roblox game pass as exposed to SDK consumers. Fields use DX-friendly * names and types (stringified IDs, `Date` timestamps) rather than the * raw wire representation. * * @since 0.1.0 */ interface GamePass { /** Stringified game pass ID. The API returns an int64; always use this. */ readonly id: string; /** Display name of the game pass. */ readonly name: string; /** ISO timestamp at which the game pass was created, as a `Date`. */ readonly createdAt: Date; /** Consumer-facing description shown on the store listing. */ readonly description: string; /** Icon asset ID as a string; `undefined` when no icon is uploaded. */ readonly iconAssetId: string | undefined; /** Whether the game pass is currently purchasable. */ readonly isForSale: boolean; /** Whether managed pricing is enabled for the game pass. */ readonly isManagedPricingEnabled: boolean; /** Pricing configuration; `undefined` when pricing is not yet set. */ readonly price: GamePassPrice | undefined; /** ISO timestamp of the most recent update, as a `Date`. */ readonly updatedAt: Date; } /** * Parameters for creating a new game pass under a universe. * * @since 0.1.0 */ interface CreateGamePassParameters { /** Display name of the new game pass. */ readonly name: string; /** Optional consumer-facing description shown on the store listing. */ readonly description?: string; /** Optional icon image uploaded with the new game pass. */ readonly imageFile?: Blob | Uint8Array; /** Whether the game pass should be purchasable immediately. */ readonly isForSale?: boolean; /** Whether regional pricing should be enabled at creation time. */ readonly isRegionalPricingEnabled?: boolean; /** Optional default price in Robux at creation time. */ readonly price?: number; /** Stringified ID of the universe that owns the game pass. */ readonly universeId: string; } /** * Parameters for reading a single game pass by ID. * * @since 0.1.0 */ interface GetGamePassParameters { /** Stringified ID of the game pass to retrieve. */ readonly gamePassId: string; /** Stringified ID of the universe that owns the game pass. */ readonly universeId: string; } /** * Parameters for listing the game passes registered against a universe. * Pagination is cursor-based: omit `pageToken` to fetch the first page, * then thread the previous response's `nextPageToken` back in until it * is `undefined`. * * @since 0.1.0 */ interface ListGamePassesParameters { /** Optional page size; the server defaults to 50 when omitted. */ readonly pageSize?: number; /** Optional cursor returned by a previous page; omit for the first page. */ readonly pageToken?: string; /** Stringified ID of the universe whose game passes to list. */ readonly universeId: string; } /** * Parameters for partially updating an existing game pass. Every field * except the identifiers is optional; omitted fields are not included * in the multipart body so the server leaves their current values * untouched. * * @since 0.1.0 */ interface UpdateGamePassParameters { /** Optional new display name for the game pass. */ readonly name?: string; /** Optional new consumer-facing description shown on the store listing. */ readonly description?: string; /** Stringified ID of the game pass to update. */ readonly gamePassId: string; /** Optional replacement icon image. */ readonly imageFile?: Blob | Uint8Array; /** Optional new value for whether the game pass is purchasable. */ readonly isForSale?: boolean; /** Optional new value for whether regional pricing is enabled. */ readonly isRegionalPricingEnabled?: boolean; /** Optional new default price in Robux. */ readonly price?: number; /** Stringified ID of the universe that owns the game pass. */ readonly universeId: string; } //#endregion //#region src/resources/game-passes/client.d.ts interface GamePassLocalizationHandle { /** * Updates the per-locale display name and/or description registered against * a game pass. Either `name`, `description`, or both may be supplied; * omitted fields are not forwarded so the server leaves the existing value * for that locale untouched. Mirrors the upstream `200 OK` echo body as * `undefined` data. * * @param parameters - Game pass and language identifiers plus the optional * replacement values. * @param options - Optional per-request overrides. * @returns A success {@link Result} with no payload, or the * {@link OpenCloudError} that caused the request to fail. */ updateNameDescription: (parameters: UpdateGamePassNameDescriptionParameters, options?: RequestOptions) => Promise>; /** * Uploads or replaces the per-locale icon for a game pass. A subsequent * upload for the same `(gamePassId, languageCode)` pair replaces the * existing icon for that locale. Does not retry on 5xx so a duplicate * upload cannot be created if the server fails mid-write. * * No default request timeout applies to this upload; pass `options.timeout` * to set a per-call deadline. * * @param parameters - Game pass and language identifiers plus the image * bytes to upload. * @param options - Optional per-request overrides. * @returns A success {@link Result} with no payload, or the * {@link OpenCloudError} that caused the request to fail. */ uploadIcon: (parameters: UploadGamePassIconParameters, options?: RequestOptions) => Promise>; } /** * Public client for the Roblox Open Cloud Game Passes API. * * Wires request builders, the injected {@link * OpenCloudClientOptions.httpClient}, and response parsers into a single * ergonomic surface. Every method returns a {@link Result} so callers handle * failure explicitly; no thrown `OpenCloudError` ever escapes the client. * * ```ts * import { GamePassesClient } from "@bedrock-rbx/ocale/game-passes"; * * const client = new GamePassesClient({ apiKey: process.env.ROBLOX_API_KEY! }); * * const result = await client.get({ * universeId: "1234567890", * gamePassId: "9876543210", * }); * * if (result.success) { * console.log(`${result.data.name} (${result.data.id})`); * } else { * console.error(result.err.message); * } * ``` * * Listing is cursor-paginated; drive the loop on `nextPageToken`: * * ```ts * let pageToken: string | undefined; * do { * const page = await client.list({ universeId: "1234567890", pageToken }); * if (!page.success) { * console.error(page.err.message); * break; * } * * for (const pass of page.data.items) { * console.log(`${pass.name} (${pass.id})`); * } * * pageToken = page.data.nextPageToken; * } while (pageToken !== undefined); * ``` * * @since 0.1.0 * * @example * * ```ts * import { GamePassesClient } from "@bedrock-rbx/ocale/game-passes"; * * const client = new GamePassesClient({ apiKey: "your-key" }); * expect(client).toBeInstanceOf(GamePassesClient); * ``` */ declare class GamePassesClient { #private; /** * Operation Group exposing per-locale localization Operations * (`updateNameDescription`, `uploadIcon`) backed by the * `legacy-game-internationalization` domain. Source-language values * remain on {@link GamePassesClient.update}; methods on this group set * per-locale overlays on top. Shares the parent client's HTTP, * rate-limit, and retry plumbing. */ readonly localization: GamePassLocalizationHandle; /** * Creates a new {@link GamePassesClient}. Configuration is frozen on * construction; per-request overrides are accepted on each method. * * @param options - Client-level configuration including the API key. */ constructor(options: OpenCloudClientOptions); /** * Creates a new game pass under the supplied universe. * * No default request timeout applies to this upload; pass `options.timeout` * to set a per-call deadline. * * @param parameters - Creation fields including the universe and pass name. * @param options - Optional per-request overrides. * @returns A {@link Result} wrapping the parsed {@link GamePass} or the * {@link OpenCloudError} that caused the request to fail. */ create(parameters: CreateGamePassParameters, options?: RequestOptions): Promise>; /** * Reads a single game pass by ID. * * @param parameters - Universe and game pass identifiers. * @param options - Optional per-request overrides (e.g. A different * {@link OpenCloudClientOptions.apiKey} for this call only). * @returns A {@link Result} wrapping the parsed {@link GamePass} or the * {@link OpenCloudError} that caused the request to fail. */ get(parameters: GetGamePassParameters, options?: RequestOptions): Promise>; /** * Lists one page of game passes for the supplied universe. Pagination is * cursor-based: omit `pageToken` for the first page, then thread the * previous response's `nextPageToken` back in until it is `undefined`. * * @param parameters - Universe identifier and optional page cursors. * @param options - Optional per-request overrides. * @returns A {@link Result} wrapping a {@link Page} of {@link GamePass}, * or the {@link OpenCloudError} that caused the request to fail. */ list(parameters: ListGamePassesParameters, options?: RequestOptions): Promise, OpenCloudError>>; /** * Partially updates an existing game pass. Mirrors the upstream * `204 No Content` response: a successful update yields `undefined` * data. Callers that need the post-update state (for example to * observe a server-derived `updatedAt`) chain * {@link GamePassesClient.get} themselves so the GET only fires when * actually needed. * * No default request timeout applies to this upload; pass `options.timeout` * to set a per-call deadline. * * @param parameters - The universe and game pass identifiers and the * fields to update. Only fields explicitly provided are forwarded. * @param options - Optional per-request overrides. * @returns A success {@link Result} with no payload, or the * {@link OpenCloudError} that caused the request to fail. */ update(parameters: UpdateGamePassParameters, options?: RequestOptions): Promise>; } //#endregion export { type CreateGamePassParameters, type GamePass, type GamePassPrice, type GamePassPricingFeature, GamePassesClient, type GetGamePassParameters, type ListGamePassesParameters, type UpdateGamePassNameDescriptionParameters, type UpdateGamePassParameters, type UploadGamePassIconParameters }; //# sourceMappingURL=game-passes.d.mts.map