import { f as Result, m as OpenCloudError, s as OpenCloudClientOptions, u as RequestOptions } from "./types-C3Egi37J.mjs"; import { t as ResourceClient } from "./resource-client-BivRq3JZ.mjs"; //#region src/domains/cloud-v2/memory-store-queues/types.d.ts /** * Caller-supplied input for the `enqueue` method on `StorageClient.queues`. * Mirrors `Cloud_CreateMemoryStoreQueueItem` on the Open Cloud API. * * @since 0.1.0 */ interface EnqueueQueueItemParameters { /** * Opaque queue payload. Round-trips as JSON, including nested `null` * values inside objects and arrays. The top-level value cannot be * `null`: the server rejects null payloads with a 400, so the type * forbids it at compile time. */ readonly data: Exclude; /** * Optional priority. Higher values are dequeued first; equal priorities * preserve insertion order. Omitted entries are inserted at the back of * the queue. */ readonly priority?: number; /** Stringified queue identifier; the queue is auto-created on first use. */ readonly queueId: string; /** * Optional time-to-live in seconds. After this many seconds the item is * automatically removed from the queue. Omitted entries inherit the * server-default TTL. */ readonly ttl?: number; /** Stringified ID of the universe that owns the queue. */ readonly universeId: string; } /** * Parsed representation of a memory-store queue item, as returned by the * Open Cloud `Cloud_CreateMemoryStoreQueueItem` and (inside the array) * `Cloud_ReadMemoryStoreQueueItems` endpoints. * * @since 0.1.0 */ interface QueueItem { /** Server-generated item identifier, parsed from the wire `path`. */ readonly id: string; /** * Opaque queue payload. Nested `null` values inside the JSON shape are * preserved verbatim; only the top level is constrained. */ readonly data: Exclude; /** Timestamp at which the server removes the item from the queue. */ readonly expiresAt: Date; /** Priority recorded on the item, or `undefined` when none was set. */ readonly priority: number | undefined; /** Stringified queue identifier, parsed from the wire `path`. */ readonly queueId: string; /** Stringified universe identifier, parsed from the wire `path`. */ readonly universeId: string; } /** * Caller-supplied input for the `dequeue` method on * `StorageClient.queues`. Mirrors `Cloud_ReadMemoryStoreQueueItems`. * * @since 0.1.0 */ interface DequeueQueueItemsParameters { /** * If `true`, the server returns 404 when fewer than `count` items * are available. Defaults to `false`, in which case the server * returns whatever subset is currently at the front of the queue. */ readonly allOrNothing?: boolean; /** * Number of items to read from the front of the queue. Defaults to * `1`; values above `200` are clamped server-side. */ readonly count?: number; /** * Number of seconds the dequeued items remain invisible to * subsequent reads. Items not acknowledged via `discard` reappear * once the window elapses. Defaults to `30` seconds server-side. */ readonly invisibilityWindow?: number; /** Stringified queue identifier. */ readonly queueId: string; /** Stringified ID of the universe that owns the queue. */ readonly universeId: string; } /** * Parsed result of a successful `Cloud_ReadMemoryStoreQueueItems` * response. The `readId` value must be passed to a subsequent * `discard` call to acknowledge the items; otherwise the items reappear * once the invisibility window elapses. * * @since 0.1.0 */ interface DequeueResult { /** Items dequeued from the front of the queue, in dequeue order. */ readonly items: ReadonlyArray; /** * Identifier of the dequeue operation. Pass this to `discard` to * remove the items from the queue permanently. */ readonly readId: string; } /** * Caller-supplied input for the `discard` method on * `StorageClient.queues`. Mirrors `Cloud_DiscardMemoryStoreQueueItems`. * Acknowledging a `readId` removes the dequeued batch from the queue * permanently; without `discard`, the items reappear once their * invisibility window elapses. * * @since 0.1.0 */ interface DiscardQueueItemsParameters { /** Stringified queue identifier. */ readonly queueId: string; /** Identifier returned by a prior `dequeue` call. */ readonly readId: string; /** Stringified ID of the universe that owns the queue. */ readonly universeId: string; } //#endregion //#region src/domains/cloud-v2/memory-store-sorted-maps/types.d.ts /** * Discriminated union describing a sorted-map item's sort key. The * server contract requires at most one of `stringSortKey` or * `numericSortKey`; the union surfaces that constraint at the type * level so callers cannot accidentally set both. * * @since 0.1.0 */ type SortKey = { readonly kind: "numeric"; readonly value: number; } | { readonly kind: "string"; readonly value: string; }; /** * Caller-supplied input for the `create` method on * `StorageClient.sortedMaps`. Mirrors * `Cloud_CreateMemoryStoreSortedMapItem` on the Open Cloud API. * * @since 0.1.0 */ interface CreateSortedMapItemParameters { /** * Caller-supplied item identifier. The server stores items * case-sensitively; the value is URL-encoded by the builder. */ readonly itemId: string; /** Stringified sorted-map identifier. */ readonly mapId: string; /** Optional sort key driving the item's position in the map. */ readonly sortKey?: SortKey; /** * Optional time-to-live in seconds. After this many seconds the * item is automatically removed. Omitted entries inherit the * server-default TTL. */ readonly ttl?: number; /** Stringified ID of the universe that owns the sorted map. */ readonly universeId: string; /** * Opaque item payload. May be any JSON value, including `null`, * matching the protobuf `Value` contract on the wire. */ readonly value: JSONValue; } /** * Caller-supplied input for the `list` method on * `StorageClient.sortedMaps`. Mirrors * `Cloud_ListMemoryStoreSortedMapItems` on the Open Cloud API. All * paging and filtering parameters are optional; omitting them returns * up to one item server-side (`maxPageSize` defaults to `1`). * * @since 0.1.0 */ interface ListSortedMapItemsParameters { /** * Optional CEL filter on `id` and `sortKey`. The server supports * `<`, `>`, and `&&` operators only; other operators are rejected * server-side with a validation error. */ readonly filter?: string; /** Stringified sorted-map identifier. */ readonly mapId: string; /** * Maximum items per page. Capped at `100` server-side; values above * the cap are clamped. Defaults to `1` when omitted. */ readonly maxPageSize?: number; /** * Sort order. The server supports the `id` field only, with an * optional ` desc` suffix. */ readonly orderBy?: string; /** * Page token returned by a previous call. When supplied, all other * parameters must match the previous call exactly. */ readonly pageToken?: string; /** Stringified ID of the universe that owns the sorted map. */ readonly universeId: string; } /** * Parsed representation of a sorted-map item, as returned by every * sorted-map operation that yields a single item. * * @since 0.1.0 */ interface SortedMapItem { /** Item identifier, parsed from the wire `path`. */ readonly id: string; /** * Server-generated etag for optimistic concurrency. Surfaced for * caller inspection; the SDK does not yet emit an `If-Match` header * for conditional update or delete. */ readonly etag: string; /** Timestamp at which the server removes the item from the map. */ readonly expiresAt: Date; /** Stringified sorted-map identifier, parsed from the wire `path`. */ readonly mapId: string; /** * Parsed sort key, or `undefined` when the item has none. The server * contract is one-of: a response carrying both `stringSortKey` and * `numericSortKey` is rejected as malformed. */ readonly sortKey: SortKey | undefined; /** Stringified universe identifier, parsed from the wire `path`. */ readonly universeId: string; /** * Opaque item payload. Round-trips as JSON, including nested `null` * values inside objects and arrays, and `null` at the top level. */ readonly value: JSONValue; } /** * Parsed result of a successful `Cloud_ListMemoryStoreSortedMapItems` * response. * * @since 0.1.0 */ interface ListSortedMapItemsResult { /** Items returned in the current page, ordered per `orderBy`. */ readonly items: ReadonlyArray; /** * Page token for the next call, or `undefined` when no more pages * exist. Pass back through `pageToken` to retrieve the next page. */ readonly nextPageToken: string | undefined; } /** * Caller-supplied input for the `delete` method on * `StorageClient.sortedMaps`. Mirrors * `Cloud_DeleteMemoryStoreSortedMapItem` on the Open Cloud API. * * @since 0.1.0 */ interface DeleteSortedMapItemParameters { /** Caller-supplied item identifier. URL-encoded by the builder. */ readonly itemId: string; /** Stringified sorted-map identifier. */ readonly mapId: string; /** Stringified ID of the universe that owns the sorted map. */ readonly universeId: string; } /** * Caller-supplied input for the `get` method on * `StorageClient.sortedMaps`. Mirrors * `Cloud_GetMemoryStoreSortedMapItem` on the Open Cloud API. * * @since 0.1.0 */ interface GetSortedMapItemParameters { /** Caller-supplied item identifier. URL-encoded by the builder. */ readonly itemId: string; /** Stringified sorted-map identifier. */ readonly mapId: string; /** Stringified ID of the universe that owns the sorted map. */ readonly universeId: string; } /** * Caller-supplied input for the `update` method on * `StorageClient.sortedMaps`. Mirrors * `Cloud_UpdateMemoryStoreSortedMapItem` on the Open Cloud API. Body * fields (`value`, `ttl`, `sortKey`) are optional under PATCH * semantics; omitted fields are left unchanged on the server. * * @since 0.1.0 */ interface UpdateSortedMapItemParameters { /** * When `true`, the server creates the item if it does not exist * instead of returning 404. Travels as the `allowMissing` query * string parameter. */ readonly allowMissing?: boolean; /** Caller-supplied item identifier. URL-encoded by the builder. */ readonly itemId: string; /** Stringified sorted-map identifier. */ readonly mapId: string; /** * Replacement sort key. Either kind of {@link SortKey} resets the * field on the wire; omit the field to leave the existing sort key * untouched. */ readonly sortKey?: SortKey; /** * Replacement time-to-live in seconds. Omitted entries leave the * existing TTL unchanged. */ readonly ttl?: number; /** Stringified ID of the universe that owns the sorted map. */ readonly universeId: string; /** * Replacement value. Omitted entries leave the existing value unchanged. */ readonly value?: JSONValue; } //#endregion //#region src/resources/storage/queues-group.d.ts /** * Operation Group on `StorageClient` that exposes the memory-store * queue endpoints. Queues are FIFO collections of opaque JSON values * with optional priority and TTL; consumers enqueue items, dequeue * them in batches, and acknowledge processed batches with a read * identifier. */ declare class MemoryStoreQueuesGroup { #private; /** * Wraps the shared {@link ResourceClient} so the Operation Group * routes calls through the same retry, hooks, and rate-limit queues * as the rest of the parent client. * * @param inner - The shared {@link ResourceClient} owned by the * parent client. */ constructor(inner: ResourceClient); /** * Dequeues up to `count` items from the front of the queue. Items * returned become invisible to subsequent reads for * `invisibilityWindow` seconds (default 30 server-side); they * reappear once the window elapses unless acknowledged via * `discard` with the returned `readId`. * * On 5xx, dequeue does not retry: the server may have set * invisibility on a batch before the response failed, so a retry * would return a *different* batch and the first one is lost until * the window expires. Callers that can detect duplicates externally * may opt back into 5xx retry per call by passing `retryableStatuses` * on `options`. * * @param parameters - Universe and queue identifiers, plus optional * `count`, `allOrNothing`, and `invisibilityWindow`. * @param options - Optional per-request overrides. * @returns A {@link Result} wrapping the parsed {@link DequeueResult} * or the {@link OpenCloudError} that caused the request to fail. */ dequeue(parameters: DequeueQueueItemsParameters, options?: RequestOptions): Promise>; /** * Acknowledges a dequeued batch of items, removing them from the * queue permanently. Pass the `readId` returned from the prior * `dequeue` call. Without `discard`, the items reappear once the * invisibility window elapses. * * The call is idempotent: a second `discard` with the same `readId` * is a no-op once the batch has been acknowledged. The retry policy * therefore retries both 429 and 5xx. * * @param parameters - Universe and queue identifiers, plus the * `readId` returned from a prior dequeue. * @param options - Optional per-request overrides. * @returns A {@link Result} wrapping `undefined` on success (the * server returns an empty body) or the {@link OpenCloudError} * that caused the request to fail. */ discard(parameters: DiscardQueueItemsParameters, options?: RequestOptions): Promise>; /** * Enqueues a single item onto a memory-store queue. The queue is * auto-created on first use; the queue identifier is any string the * caller picks. Items with higher `priority` values are dequeued * first; equal priorities preserve insertion order. Items expire * and are removed automatically after `ttl` seconds, or after a * server-default lifetime when omitted. * * @param parameters - Universe and queue identifiers, the opaque * payload, and optional `priority` and `ttl`. * @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 QueueItem} or * the {@link OpenCloudError} that caused the request to fail. */ enqueue(parameters: EnqueueQueueItemParameters, options?: RequestOptions): Promise>; } //#endregion //#region src/resources/storage/sorted-maps-group.d.ts /** * Operation Group on `StorageClient` that exposes the memory-store * sorted-map endpoints. Sorted maps are ordered collections of * (id, value, sortKey) triples; consumers create, read, update, list, * and delete items keyed by a caller-supplied identifier and ordered * by an optional string or numeric sort key. */ declare class MemoryStoreSortedMapsGroup { #private; /** * Wraps the shared {@link ResourceClient} so the Operation Group * routes calls through the same retry, hooks, and rate-limit queues * as the rest of the parent client. * * @param inner - The shared {@link ResourceClient} owned by the * parent client. */ constructor(inner: ResourceClient); /** * Creates a single item in a sorted map. The sorted map is * auto-created on first use; the map identifier is any string the * caller picks. Items are keyed by `itemId` (case-sensitive) and * ordered by an optional `sortKey`. Items expire and are removed * automatically after `ttl` seconds, or after a server-default * lifetime when omitted. * * On 5xx, create does not retry: Roblox Open Cloud has no * idempotency-key support, so a retry of a transient failure risks * producing a duplicate item. * * @param parameters - Universe, sorted-map, item identifiers, the * value to store, and optional `sortKey` and `ttl`. * @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 SortedMapItem} * or the {@link OpenCloudError} that caused the request to fail. */ create(parameters: CreateSortedMapItemParameters, options?: RequestOptions): Promise>; /** * Removes a single item from a sorted map. The call is idempotent: * a second `delete` against the same item is a no-op once the * server has dropped the row. The retry policy retries both 429 * and 5xx. * * @param parameters - Universe, sorted-map, and item identifiers. * @param options - Optional per-request overrides. * @returns A {@link Result} wrapping `undefined` on success or the * {@link OpenCloudError} that caused the request to fail. */ delete(parameters: DeleteSortedMapItemParameters, options?: RequestOptions): Promise>; /** * Reads a single item from a sorted map. Returns the parsed * {@link SortedMapItem} with the server-recorded `etag` for use in * subsequent conditional updates (once the SDK begins emitting * `If-Match`; see the package README). * * @param parameters - Universe, sorted-map, and item identifiers. * @param options - Optional per-request overrides. * @returns A {@link Result} wrapping the parsed {@link SortedMapItem} * or the {@link OpenCloudError} that caused the request to fail. */ get(parameters: GetSortedMapItemParameters, options?: RequestOptions): Promise>; /** * Lists items in a sorted map. The server caps `maxPageSize` at * `100` and defaults it to `1` when omitted, so callers explicitly * pass `maxPageSize` to retrieve more than a single item per page. * The `filter` parameter accepts a CEL expression on `id` and * `sortKey` (operators `<`, `>`, `&&` only). * * @param parameters - Universe and sorted-map identifiers, plus * optional pagination and filter parameters. * @param options - Optional per-request overrides. * @returns A {@link Result} wrapping the parsed * {@link ListSortedMapItemsResult} or the {@link OpenCloudError} * that caused the request to fail. */ list(parameters: ListSortedMapItemsParameters, options?: RequestOptions): Promise>; /** * Updates a sorted-map item under PATCH semantics: omitted body * fields are left unchanged on the server, supplied fields replace * their existing values. Passing `allowMissing: true` creates the * item when no row exists instead of returning 404. * * Retries 5xx because PATCH with the same body produces the same * server state. * * @param parameters - Universe, sorted-map, and item identifiers, * plus any subset of `value`, `ttl`, `sortKey`, and * `allowMissing`. * @param options - Optional per-request overrides. * @returns A {@link Result} wrapping the parsed {@link SortedMapItem} * or the {@link OpenCloudError} that caused the request to fail. */ update(parameters: UpdateSortedMapItemParameters, options?: RequestOptions): Promise>; } //#endregion //#region src/resources/storage/client.d.ts /** * Public client for the Roblox Open Cloud `Data and memory stores` * Feature. Today it covers memory-store queues via the * {@link StorageClient.queues} Operation Group and memory-store sorted * maps via the {@link StorageClient.sortedMaps} Operation Group; a * future data-stores Operation Group slots in as a sibling on the same * client. * * Every method returns a `Result` so callers handle failure * explicitly; no thrown error ever escapes the client. * * @since 0.1.0 * * @example * * ```ts * import { StorageClient } from "@bedrock-rbx/ocale/storage"; * * const client = new StorageClient({ apiKey: "your-key" }); * expect(client).toBeInstanceOf(StorageClient); * ``` */ declare class StorageClient { /** Memory-store queue Operation Group. */ readonly queues: MemoryStoreQueuesGroup; /** Memory-store sorted-map Operation Group. */ readonly sortedMaps: MemoryStoreSortedMapsGroup; /** * Creates a new {@link StorageClient}. 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); } //#endregion export { type CreateSortedMapItemParameters, type DeleteSortedMapItemParameters, type DequeueQueueItemsParameters, type DequeueResult, type DiscardQueueItemsParameters, type EnqueueQueueItemParameters, type GetSortedMapItemParameters, type ListSortedMapItemsParameters, type ListSortedMapItemsResult, type QueueItem, type SortKey, type SortedMapItem, StorageClient, type UpdateSortedMapItemParameters }; //# sourceMappingURL=storage.d.mts.map