import { f as Result, m as OpenCloudError, s as OpenCloudClientOptions, u as RequestOptions } from "./types-C3Egi37J.mjs"; import { a as ListLogsParameters, f as LuauExecutionTask, h as SubmitAtVersionParameters, m as SubmitAtHeadParameters, n as LuauExecutionSubmitOptions, o as LogMessage, p as LuauExecutionTaskRef, r as PollUntilDoneOptions, s as LogPage, t as LuauExecutionRunOptions, u as GetParameters } from "./capacity-admission-BvnJjY0S.mjs"; //#region src/domains/cloud-v2/places/types.d.ts /** * Caller-supplied input for the `update` method on `PlacesClient`. * Every writable field is optional; presence of a key drives the * `updateMask` query string that the server uses as the field-mask * for the partial update. Absent keys are left untouched server-side. * * @since 0.1.0 */ interface UpdatePlaceParameters { /** New description for the place. */ readonly description?: string; /** New display name for the place. */ readonly displayName?: string; /** Stringified ID of the place to update. */ readonly placeId: string; /** New maximum number of allowed users in a single server. */ readonly serverSize?: number; /** Stringified ID of the universe that owns the place. */ readonly universeId: string; } /** * Parsed representation of a Roblox place's configuration, as returned * by the Open Cloud `Cloud_GetPlace` and `Cloud_UpdatePlace` endpoints. * * @since 0.1.0 */ interface Place { /** Stringified place ID, extracted from the wire `path`. */ readonly id: string; /** Timestamp when the place was created. */ readonly createdAt: Date; /** Long-form description of the place. */ readonly description: string; /** Human-facing name of the place. */ readonly displayName: string; /** Whether this place is the universe's root place. */ readonly root: boolean; /** Maximum allowed users in a single server; `undefined` when unset. */ readonly serverSize: number | undefined; /** Stringified universe ID, extracted from the wire `path`. */ readonly universeId: string; /** Whether the place was created in-experience. */ readonly universeRuntimeCreation: boolean; /** Timestamp of the most recent update. */ readonly updatedAt: Date; } //#endregion //#region src/domains/universes/places/types.d.ts /** * Caller-supplied input for the `publish` and `save` methods on * `PlacesClient`. Both methods take the same parameter shape; which * version-type query string is used is decided by the method, not the * caller. * * @since 0.1.0 */ interface PublishParameters { /** Raw `.rbxl` or `.rbxlx` file bytes. Must be non-empty. */ readonly body: Uint8Array; /** * Whether `body` is the binary or XML place format. The transport * sends `application/octet-stream` for `"rbxl"` and `application/xml` * for `"rbxlx"`, and the builder rejects payloads whose magic bytes * disagree with the declared format before any HTTP call. */ readonly format: "rbxl" | "rbxlx"; /** Stringified ID of the place inside the universe. */ readonly placeId: string; /** Stringified ID of the universe that owns the place. */ readonly universeId: string; } /** * Successful response from publishing or saving a new place version. * * @since 0.1.0 */ interface PlaceVersion { /** * Auto-incrementing version number assigned by Roblox. Always at least * `1` for the first publish; increases by one for every subsequent * publish or save against the same place. */ readonly versionNumber: number; } //#endregion //#region src/resources/places/client.d.ts /** * Operation Group exposed by {@link PlacesClient} as the * `luauExecution` namespace. Provides `submit` to queue a Luau script, * `get` to fetch a task's current state, and `listLogs` to retrieve * structured log messages. Shares the same dispatch wiring as the * top-level `LuauExecutionClient` exposed at * `@bedrock-rbx/ocale/luau-execution`. * * @since 0.1.0 */ interface LuauExecutionHandle { /** * Fetches the current state of a previously-submitted Luau * execution task. Uses idempotent retry semantics for both 429 and * 5xx. * * @param parameters - The task ref plus an optional `view` selector. * @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 LuauExecutionTask} or the {@link OpenCloudError} that * caused the request to fail. */ get(parameters: GetParameters, options?: RequestOptions): Promise>; /** * Lists one page of structured log messages produced by a * previously-submitted Luau execution task. Messages from multiple * server-side chunks are flattened into a single ordered array. * Uses idempotent retry semantics for both 429 and 5xx. * * @param parameters - The task ref and optional pagination controls * (`pageSize`, `pageToken`). * @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 LogPage} or * the {@link OpenCloudError} that caused the request to fail. */ listLogs(parameters: ListLogsParameters, options?: RequestOptions): Promise>; /** * Polls `get` with `view=BASIC` on a configurable backoff schedule until * the task reaches a terminal state, the wall-clock budget is exhausted, * or the supplied `AbortSignal` fires. Returns the terminal task on * success. * * @param ref - Reference to the task to poll, typically returned by `submit`. * @param options - Polling and per-request overrides. * @returns A {@link Result} wrapping the terminal {@link LuauExecutionTask}, * or an error if aborted, timed out, or the transport fails. */ pollUntilDone(ref: LuauExecutionTaskRef, options?: PollUntilDoneOptions): Promise>; /** * Submits a Luau script and polls `get` with `view=BASIC` until the * task reaches a terminal state, the wall-clock budget is exhausted, * or the supplied `AbortSignal` fires. Combines `submit` and * `pollUntilDone` in one call. * * @param parameters - The same input accepted by `submit`. * @param options - Polling and per-request overrides. * @returns A {@link Result} wrapping the terminal * {@link LuauExecutionTask}, or an error if submit fails, the task * is aborted, timed out, or the transport fails. */ runUntilDone(parameters: SubmitAtHeadParameters | SubmitAtVersionParameters, options?: LuauExecutionRunOptions): Promise>; /** * Submits a Luau script for execution against a place. Dispatches * to the head-version URL when `versionId` is omitted, or to the * specific-version URL when one is supplied. Both URL shapes share * one rate-limit queue and one required-scope set. * * @param parameters - The universe and place identifiers, the * script to run, an optional `versionId`, and any other writable * submit fields. * @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 LuauExecutionTask} or the {@link OpenCloudError} that * caused the request to fail. */ submit(parameters: SubmitAtHeadParameters | SubmitAtVersionParameters, options?: LuauExecutionSubmitOptions): Promise>; } /** * Public client for the Roblox Open Cloud `Place` resource. Covers * place-version publishing (`publish`, `save`), place-configuration * updates (`update`), and the Luau execution Operation Group * (`luauExecution.submit`, `luauExecution.get`). Every method returns * a {@link Result} so callers handle failure explicitly; no thrown * {@link OpenCloudError} ever escapes the client. * * Publishing or saving a 5xx-failed place version is not retried * automatically: Roblox does not support idempotency keys, so a retry * could publish a duplicate version unnoticed. Callers that *can* detect * duplicates externally may opt back into 5xx retry per-call by passing * `retryableStatuses` on the second argument. The `update` method, by * contrast, is idempotent and retries both 429 and 5xx automatically. * * Failures that never reached Open Cloud *are* retried: transient transport * errors, and responses served by an edge gateway rather than the API. Neither * can have created a version, so neither risks the duplicate a 5xx does. * * @since 0.1.0 * * @example * * ```ts * import { PlacesClient } from "@bedrock-rbx/ocale/places"; * * const client = new PlacesClient({ apiKey: "your-key" }); * expect(client).toBeInstanceOf(PlacesClient); * ``` */ declare class PlacesClient { #private; readonly luauExecution: LuauExecutionHandle; /** * Creates a new {@link PlacesClient}. 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); /** * Publishes a new live version of a place. * * No default request timeout applies to this upload; pass `options.timeout` * to set a per-call deadline. * * @param parameters - Universe and place identifiers, the place file * bytes, and their declared `format`. * @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 PlaceVersion} * or the {@link OpenCloudError} that caused the request to fail. */ publish(parameters: PublishParameters, options?: RequestOptions): Promise>; /** * Saves a new draft version of a place. Identical to {@link publish} * except the resulting version is not made live; consumers can list or * promote it later. Shares a single per-API-key rate-limit queue with * `publish` because Roblox attributes both calls to the same per-minute * quota. * * No default request timeout applies to this upload; pass `options.timeout` * to set a per-call deadline. * * @param parameters - Universe and place identifiers, the place file * bytes, and their declared `format`. * @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 PlaceVersion} * or the {@link OpenCloudError} that caused the request to fail. */ save(parameters: PublishParameters, options?: RequestOptions): Promise>; /** * Partially updates a place's configuration. The fields supplied on * `parameters` (excluding the identifiers) are forwarded to the * server via a Google-style `updateMask`; unmentioned fields are * left untouched. The universe's root place is the canonical place * to update when changing a universe's description or display name: * both are derived server-side from the root place. * * @param parameters - The universe and place identifiers and the * fields to update. At least one writable field must be supplied. * @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 Place} or * the {@link OpenCloudError} that caused the request to fail. */ update(parameters: UpdatePlaceParameters, options?: RequestOptions): Promise>; } //#endregion export { type ListLogsParameters, type LogMessage, type LogPage, type LuauExecutionHandle, type Place, type PlaceVersion, PlacesClient, type PublishParameters, type UpdatePlaceParameters }; //# sourceMappingURL=places.d.mts.map